Mercurial > mm7
comparison mm7_5.cpp @ 73:0a7860ded5c2
spellbook close crash fixed
author | zipi |
---|---|
date | Sun, 27 Jan 2013 17:05:48 +0000 |
parents | f12a7fd4d114 |
children | 377535d6e366 |
comparison
equal
deleted
inserted
replaced
72:55e3aa43021d | 73:0a7860ded5c2 |
---|---|
13167 if ( v11->pName[v4] ) | 13167 if ( v11->pName[v4] ) |
13168 { | 13168 { |
13169 v6 = &byte_4E2430[12 * v1] + v4; | 13169 v6 = &byte_4E2430[12 * v1] + v4; |
13170 sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); | 13170 sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); |
13171 v7 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | 13171 v7 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); |
13172 dword_506408[v12] = 72 * v7 + 7145548; | 13172 dword_506408[v12] = &pIcons_LOD->pTextures[v7]; |
13173 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); | 13173 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); |
13174 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)]; | 13174 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)]; |
13175 dword_5063D8[v12] = result; | 13175 dword_5063D8[v12] = result; |
13176 } | 13176 } |
13177 v4 = v12 + 1; | 13177 v4 = v12 + 1; |
13195 GUIWindow *result; // eax@5 | 13195 GUIWindow *result; // eax@5 |
13196 | 13196 |
13197 v0 = 0; | 13197 v0 = 0; |
13198 do | 13198 do |
13199 { | 13199 { |
13200 dword_506404[v0]->Release(); | 13200 dword_5063D8[11+v0]->Release(); |
13201 dword_506434[v0]->Release(); | 13201 dword_506408[11+v0]->Release(); |
13202 --v0; | 13202 --v0; |
13203 } | 13203 } |
13204 while ( v0 >= -11 ); | 13204 while ( v0 >= -11 ); |
13205 pIcons_LOD->_40F9C5(); | 13205 pIcons_LOD->_40F9C5(); |
13206 v1 = pGUIWindow_CurrentMenu->pControlsHead; | 13206 v1 = pGUIWindow_CurrentMenu->pControlsHead; |
13235 v0 = &pTextures_tabs[0][1]; | 13235 v0 = &pTextures_tabs[0][1]; |
13236 v1 = pTextures_5064A0; | 13236 v1 = pTextures_5064A0; |
13237 do | 13237 do |
13238 { | 13238 { |
13239 (*v1)->Release(); | 13239 (*v1)->Release(); |
13240 v2 = (Texture *)*((int *)v0 - 1); | 13240 v2 = *(v0 - 1); |
13241 *v1 = 0; | 13241 *v1 = 0; |
13242 v2->Release(); | 13242 v2->Release(); |
13243 v3 = *(Texture **)v0; | 13243 v3 = *v0; |
13244 *((int *)v0 - 1) = 0; | 13244 *(v0 - 1) = 0; |
13245 v3->Release(); | 13245 v3->Release(); |
13246 *(int *)v0 = 0; | 13246 *v0 = 0; |
13247 ++v1; | 13247 ++v1; |
13248 v0 += 8; | 13248 v0 += 2; |
13249 } | 13249 } |
13250 while ( (signed int)v1 < (signed int)&pTextures_5064A0[9] ); | 13250 while ( (signed int)v1 < (signed int)&pTextures_5064A0[9] ); |
13251 pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0); | 13251 pAudioPlayer->PlaySound((SoundID)231, 0, 0, -1, 0, 0, 0, 0); |
13252 pIcons_LOD->_4114F2(); | 13252 pIcons_LOD->_4114F2(); |
13253 } | 13253 } |
13314 unsigned int v18; // [sp-Ch] [bp-2Ch]@15 | 13314 unsigned int v18; // [sp-Ch] [bp-2Ch]@15 |
13315 unsigned int v19; // [sp-8h] [bp-28h]@8 | 13315 unsigned int v19; // [sp-8h] [bp-28h]@8 |
13316 unsigned int v20; // [sp-8h] [bp-28h]@15 | 13316 unsigned int v20; // [sp-8h] [bp-28h]@15 |
13317 Texture *v21; // [sp-4h] [bp-24h]@15 | 13317 Texture *v21; // [sp-4h] [bp-24h]@15 |
13318 signed int v22; // [sp-4h] [bp-24h]@22 | 13318 signed int v22; // [sp-4h] [bp-24h]@22 |
13319 int v23[2]; // [sp+10h] [bp-10h]@5 | 13319 Texture *v23; // [sp+10h] [bp-10h]@5 |
13320 POINT a2; // [sp+18h] [bp-8h]@13 | 13320 POINT a2; // [sp+18h] [bp-8h]@13 |
13321 POINT v24; | |
13322 int v25; | |
13321 | 13323 |
13322 sub_412AF9(); | 13324 sub_412AF9(); |
13323 v0 = pPlayers[uActiveCharacter]; | 13325 v0 = pPlayers[uActiveCharacter]; |
13324 v1 = 11 * v0->pNumSpellBookPage; | 13326 v1 = 11 * v0->pNumSpellBookPage; |
13325 v2 = pIcons_LOD->FindTextureByName("Pending"); | 13327 v2 = pIcons_LOD->FindTextureByName("Pending"); |
13336 if ( v5 != v3 ) | 13338 if ( v5 != v3 ) |
13337 { | 13339 { |
13338 if ( dword_50654C == v4 ) | 13340 if ( dword_50654C == v4 ) |
13339 { | 13341 { |
13340 v6 = dword_5063D8[v4]; | 13342 v6 = dword_5063D8[v4]; |
13341 v23[0] = (int)dword_5063D8[v4]; | 13343 v23 = dword_5063D8[v4]; |
13342 } | 13344 } |
13343 else | 13345 else |
13344 { | 13346 { |
13345 v23[0] = dword_506408[v4]; | 13347 v23 = dword_506408[v4]; |
13346 v6 = v5; | 13348 v6 = v5; |
13347 } | 13349 } |
13348 if ( v6->pLevelOfDetail0 ) | 13350 if ( v6->pLevelOfDetail0 ) |
13349 { | 13351 { |
13350 v7 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage + v4])); | 13352 v7 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage + v4])); |
13353 if ( BYTE1(v6->pBits) & 2 ) | 13355 if ( BYTE1(v6->pBits) & 2 ) |
13354 pRenderer->DrawTextureTransparent(v17, v19, v6); | 13356 pRenderer->DrawTextureTransparent(v17, v19, v6); |
13355 else | 13357 else |
13356 pRenderer->DrawTextureIndexed(v17, v19, v6); | 13358 pRenderer->DrawTextureIndexed(v17, v19, v6); |
13357 v8 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v4)); | 13359 v8 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v4)); |
13358 pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], (Texture *)v23[0], v4); | 13360 pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], v23, v4); |
13359 } | 13361 } |
13360 } | 13362 } |
13361 } | 13363 } |
13362 ++v4; | 13364 ++v4; |
13363 } | 13365 } |
13364 while ( v4 + v1 - 1 < v1 + 11 ); | 13366 while ( v4 + v1 - 1 < v1 + 11 ); |
13365 } | 13367 } |
13366 v9 = pMouse->GetCursorPos(&a2); | 13368 v9 = pMouse->GetCursorPos(&a2); |
13367 v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)v23)->y]] & 0xFFFF; | 13369 v10 = pRenderer->pActiveZBuffer[v9->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v24)->y]] & 0xFFFF; |
13368 if ( v10 ) | 13370 if ( v10 ) |
13369 { | 13371 { |
13370 v11 = dword_5063D8[v10]; | 13372 v11 = dword_5063D8[v10]; |
13371 if ( v11->pLevelOfDetail0 ) | 13373 if ( v11->pLevelOfDetail0 ) |
13372 { | 13374 { |
13382 } | 13384 } |
13383 v13 = 0; | 13385 v13 = 0; |
13384 a2.x = (LONG)&v0->pActiveSkills[12]; | 13386 a2.x = (LONG)&v0->pActiveSkills[12]; |
13385 v14 = (unsigned int)&v0->pActiveSkills[12]; | 13387 v14 = (unsigned int)&v0->pActiveSkills[12]; |
13386 v15 = (unsigned int)&v0->pActiveSkills[12]; | 13388 v15 = (unsigned int)&v0->pActiveSkills[12]; |
13387 v23[0] = 0; | 13389 v25 = 0; |
13388 do | 13390 do |
13389 { | 13391 { |
13390 if ( *(short *)a2.x ) | 13392 if ( *(short *)a2.x ) |
13391 { | 13393 { |
13392 if ( v0->pNumSpellBookPage == v13 ) | 13394 if ( v0->pNumSpellBookPage == v13 ) |
13476 default: | 13478 default: |
13477 break; | 13479 break; |
13478 } | 13480 } |
13479 } | 13481 } |
13480 pRenderer->DrawTextureTransparent(v14, v15, v16); | 13482 pRenderer->DrawTextureTransparent(v14, v15, v16); |
13481 v13 = v23[0]; | 13483 v13 = v25; |
13482 } | 13484 } |
13483 a2.x += 2; | 13485 a2.x += 2; |
13484 ++v13; | 13486 ++v13; |
13485 v23[0] = v13; | 13487 v25 = v13; |
13486 } | 13488 } |
13487 while ( v13 < 9 ); | 13489 while ( v13 < 9 ); |
13488 } | 13490 } |
13489 // 506408: using guessed type int dword_506408[]; | 13491 // 506408: using guessed type int dword_506408[]; |
13490 // 50654C: using guessed type int dword_50654C; | 13492 // 50654C: using guessed type int dword_50654C; |