Mercurial > mm7
comparison mm7_5.cpp @ 223:1bd823f52e3a
Merge
author | Gloval |
---|---|
date | Sun, 17 Feb 2013 11:41:44 +0400 |
parents | 8113753ed2ae 0c64754c7fd4 |
children | c879446b4a22 0df4136b6aac 24de34910d3e |
comparison
equal
deleted
inserted
replaced
222:8113753ed2ae | 223:1bd823f52e3a |
---|---|
67 signed int v0; // edi@6 | 67 signed int v0; // edi@6 |
68 char *v1; // esi@6 | 68 char *v1; // esi@6 |
69 unsigned int v2; // edx@7 | 69 unsigned int v2; // edx@7 |
70 Actor *pActor; // ecx@13 | 70 Actor *pActor; // ecx@13 |
71 int v4; // ecx@18 | 71 int v4; // ecx@18 |
72 NPCData *pNPCData0; // eax@18 | 72 //NPCData *pNPCData0; // eax@18 |
73 int v6; // edx@20 | 73 //int v6; // edx@20 |
74 int v7; // ecx@29 | 74 //int v7; // ecx@29 |
75 unsigned int v8; // edx@59 | 75 unsigned int v8; // edx@59 |
76 unsigned int v9; // ecx@60 | 76 unsigned int v9; // ecx@60 |
77 unsigned int v10; // ecx@73 | 77 unsigned int v10; // ecx@73 |
78 unsigned int v11; // eax@75 | 78 unsigned int v11; // eax@75 |
79 unsigned __int8 v12; // sf@75 | 79 unsigned __int8 v12; // sf@75 |
242 int v175; // [sp+0h] [bp-5FCh]@550 | 242 int v175; // [sp+0h] [bp-5FCh]@550 |
243 int v176; // [sp+0h] [bp-5FCh]@599 | 243 int v176; // [sp+0h] [bp-5FCh]@599 |
244 const char *v177; // [sp+0h] [bp-5FCh]@629 | 244 const char *v177; // [sp+0h] [bp-5FCh]@629 |
245 char *v178; // [sp+0h] [bp-5FCh]@637 | 245 char *v178; // [sp+0h] [bp-5FCh]@637 |
246 int v179; // [sp+4h] [bp-5F8h]@0 | 246 int v179; // [sp+4h] [bp-5F8h]@0 |
247 signed int _this; // [sp+14h] [bp-5E8h]@22 | 247 //signed int _this; // [sp+14h] [bp-5E8h]@22 |
248 signed int thisa; // [sp+14h] [bp-5E8h]@251 | 248 signed int thisa; // [sp+14h] [bp-5E8h]@251 |
249 signed int thisb; // [sp+14h] [bp-5E8h]@272 | 249 signed int thisb; // [sp+14h] [bp-5E8h]@272 |
250 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 | 250 Player *pPlayer7; // [sp+14h] [bp-5E8h]@373 |
251 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 | 251 Player *pPlayer8; // [sp+14h] [bp-5E8h]@377 |
252 char *thise; // [sp+14h] [bp-5E8h]@445 | 252 char *thise; // [sp+14h] [bp-5E8h]@445 |
331 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].uNPC_ID; | 331 dword_5B65D0_dialogue_actor_npc_id = pActors[uMessageParam].uNPC_ID; |
332 pActor = &pActors[uMessageParam]; | 332 pActor = &pActors[uMessageParam]; |
333 //goto _actor_init_dlg; | 333 //goto _actor_init_dlg; |
334 pActor->InitializeDialogue(v0); | 334 pActor->InitializeDialogue(v0); |
335 continue; | 335 continue; |
336 case UIMSG_86: | 336 case UIMSG_StartHireling1Dialogue: |
337 case UIMSG_87: | 337 case UIMSG_StartHireling2Dialogue: |
338 if ( bNoNPCHiring != 1 && !pCurrentScreen ) | 338 { |
339 { | 339 if (bNoNPCHiring || pCurrentScreen) |
340 continue; | |
341 | |
340 if ( pMessageQueue_50CBD0->uNumMessages ) | 342 if ( pMessageQueue_50CBD0->uNumMessages ) |
341 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 343 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
342 uAction = 0; | 344 uAction = 0; |
343 uNumSeconds = uMessage - 134; | 345 int hireling_idx = uMessage - UIMSG_StartHireling1Dialogue; |
344 v4 = 0; | 346 v4 = 0; |
345 pNPCData0 = pParty->pHirelings; | 347 |
346 do | 348 for (uint i = 0; i < 2; ++i) |
349 //pNPCData0 = pParty->pHirelings; | |
350 //do | |
347 { | 351 { |
348 if ( pNPCData0->pName ) | 352 if (pParty->pHirelings[i].pName) |
349 { | 353 //{ |
350 v6 = uAction++; | 354 //v6 = uAction++; |
351 pTmpBuf[v6] = v4; | 355 pTmpBuf[uAction++] = i; |
352 } | 356 //} |
353 ++pNPCData0; | 357 //++pNPCData0; |
354 ++v4; | 358 //++v4; |
355 } | 359 } |
356 while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem ); | 360 //while ( (signed int)pNPCData0 < (signed int)&pParty->pPickedItem ); |
357 _this = 0; | 361 |
358 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | 362 //_this = 0; |
363 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
359 { | 364 { |
360 pNPCData4 = pNPCStats->pNewNPCData; | 365 auto npc = pNPCStats->pNewNPCData + i; |
361 do | 366 //do |
362 { | 367 //{ |
363 if ( pNPCData4->uFlags & 0x80 | 368 if (npc->uFlags & 0x80 && |
364 && (!pParty->pHirelings[0].pName || strcmp(pNPCData4->pName, pParty->pHirelings[0].pName)) | 369 (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName)) && |
365 && (!pParty->pHirelings[1].pName || strcmp(pNPCData4->pName, pParty->pHirelings[1].pName)) ) | 370 (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) ) |
366 { | 371 { |
367 v7 = uAction++; | 372 //v7 =; |
368 pTmpBuf[v7] = _this + 2; | 373 pTmpBuf[uAction++] = i + 2; |
369 } | 374 } |
370 ++_this; | 375 //++_this; |
371 ++pNPCData4; | 376 //++pNPCData4; |
372 } | 377 //} |
373 while ( _this < (signed int)pNPCStats->uNumNewNPCs ); | 378 //while ( _this < (signed int)pNPCStats->uNumNewNPCs ); |
374 } | 379 } |
375 if ( (signed int)(uNumSeconds + (unsigned __int8)pParty->field_709) < uAction ) | 380 |
381 if ( (signed int)(hireling_idx + (unsigned __int8)pParty->field_709) < uAction ) | |
376 { | 382 { |
377 //Actor::Actor(&actor); | 383 //Actor::Actor(&actor); |
378 memset(&actor, 0, 0x344u); | 384 memset(&actor, 0, 0x344u); |
379 actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - uNumSeconds; | 385 actor.uNPC_ID += -1 - (unsigned __int8)pParty->field_709 - hireling_idx; |
380 pActor = &actor; | 386 pActor = &actor; |
381 //_actor_init_dlg: | 387 //_actor_init_dlg: |
382 pActor->InitializeDialogue(v0); | 388 pActor->InitializeDialogue(v0); |
383 } | 389 } |
384 } | 390 } |
2960 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; | 2966 _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; |
2961 continue; | 2967 continue; |
2962 case UIMSG_4E: | 2968 case UIMSG_4E: |
2963 if ( dword_50654C && byte_506550 ) | 2969 if ( dword_50654C && byte_506550 ) |
2964 { | 2970 { |
2965 v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage].pName; | 2971 v173 = pSpellStats->pInfos[dword_50654C + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage].pName; |
2966 v157 = pGlobalTXT_LocalizationStrings[483]; | 2972 v157 = pGlobalTXT_LocalizationStrings[483]; |
2967 _sprintex_2args_draw_status_and_continue: | 2973 _sprintex_2args_draw_status_and_continue: |
2968 sprintf(pTmpBuf, v157, v173); | 2974 sprintf(pTmpBuf, v157, v173); |
2969 } | 2975 } |
2970 else | 2976 else |
3017 v130 = 0; | 3023 v130 = 0; |
3018 dword_50654C = 0; | 3024 dword_50654C = 0; |
3019 v127 = 203; | 3025 v127 = 203; |
3020 goto _play_sound_and_continue; | 3026 goto _play_sound_and_continue; |
3021 } | 3027 } |
3022 v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->pNumSpellBookPage; | 3028 v99 = dword_50654C + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage; |
3023 pPlayers[uActiveCharacter]->uQuickSpell = v99; | 3029 pPlayers[uActiveCharacter]->uQuickSpell = v99; |
3024 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); | 3030 stru_A750F8[uActiveCharacter + 3]._494836(v99, uActiveCharacter); |
3025 if ( uActiveCharacter ) | 3031 if ( uActiveCharacter ) |
3026 pPlayer10->PlaySound(SPEECH_12, 0); | 3032 pPlayer10->PlaySound(SPEECH_12, 0); |
3027 byte_506550 = 0; | 3033 byte_506550 = 0; |
3036 thisl = (int)&pPlayer3->pActiveSkills[12]; | 3042 thisl = (int)&pPlayer3->pActiveSkills[12]; |
3037 do | 3043 do |
3038 { | 3044 { |
3039 if ( *(short *)thisl ) | 3045 if ( *(short *)thisl ) |
3040 { | 3046 { |
3041 if ( pPlayer3->pNumSpellBookPage == v101 ) | 3047 if ( pPlayer3->lastOpenedSpellbookPage == v101 ) |
3042 uAction = (int)pNPCData4; | 3048 uAction = (int)pNPCData4; |
3043 v102 = (int)pNPCData4; | 3049 v102 = (int)pNPCData4; |
3044 pNPCData4 = (NPCData *)((char *)pNPCData4 + 1); | 3050 pNPCData4 = (NPCData *)((char *)pNPCData4 + 1); |
3045 v217[v102] = v101; | 3051 v217[v102] = v101; |
3046 } | 3052 } |
3071 ++uAction; | 3077 ++uAction; |
3072 if ( uAction >= (signed int)pNPCData4 ) | 3078 if ( uAction >= (signed int)pNPCData4 ) |
3073 uAction = 0; | 3079 uAction = 0; |
3074 } | 3080 } |
3075 sub_41140B(); | 3081 sub_41140B(); |
3076 pPlayers[uActiveCharacter]->pNumSpellBookPage = LOBYTE(v217[uAction]); | 3082 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]); |
3077 pGUIWindow_CurrentMenu->OpenSpellBook(); | 3083 pGUIWindow_CurrentMenu->OpenSpellBook(); |
3078 v165 = 0; | 3084 v165 = 0; |
3079 v151 = 0; | 3085 v151 = 0; |
3080 v144 = 0; | 3086 v144 = 0; |
3081 v139 = 0; | 3087 v139 = 0; |
3083 v132 = 0; | 3089 v132 = 0; |
3084 v130 = 0; | 3090 v130 = 0; |
3085 v127 = rand() % 2 + 204; | 3091 v127 = rand() % 2 + 204; |
3086 goto _play_sound_and_continue; | 3092 goto _play_sound_and_continue; |
3087 case UIMSG_57: | 3093 case UIMSG_57: |
3088 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->pNumSpellBookPage ) | 3094 if ( pTurnEngine->field_4 == 3 || !uActiveCharacter || uMessageParam == pPlayers[uActiveCharacter]->lastOpenedSpellbookPage ) |
3089 continue; | 3095 continue; |
3090 sub_41140B(); | 3096 sub_41140B(); |
3091 pPlayers[uActiveCharacter]->pNumSpellBookPage = uMessageParam; | 3097 pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam; |
3092 pGUIWindow_CurrentMenu->OpenSpellBook(); | 3098 pGUIWindow_CurrentMenu->OpenSpellBook(); |
3093 v165 = 0; | 3099 v165 = 0; |
3094 v151 = 0; | 3100 v151 = 0; |
3095 v144 = 0; | 3101 v144 = 0; |
3096 v139 = 0; | 3102 v139 = 0; |
3617 v137 = 0; | 3623 v137 = 0; |
3618 v133 = 0; | 3624 v133 = 0; |
3619 //LABEL_733: | 3625 //LABEL_733: |
3620 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); | 3626 GUIWindow::Create(v9, v8, v133, v137, pWindowType1, (int)pButton2, v163); |
3621 continue; | 3627 continue; |
3622 case UIMSG_194: | 3628 case UIMSG_Game_Action: |
3623 if ( pMessageQueue_50CBD0->uNumMessages ) | 3629 if ( pMessageQueue_50CBD0->uNumMessages ) |
3624 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | 3630 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; |
3625 OnPressSpace(); | 3631 OnPressSpace(); |
3626 continue; | 3632 continue; |
3627 case UIMSG_16F: | 3633 case UIMSG_16F: |
12736 int v12; // [sp+6Ch] [bp-8h]@4 | 12742 int v12; // [sp+6Ch] [bp-8h]@4 |
12737 int v13; // [sp+70h] [bp-4h]@4 | 12743 int v13; // [sp+70h] [bp-4h]@4 |
12738 | 12744 |
12739 v1 = pPlayers[uActiveCharacter]; | 12745 v1 = pPlayers[uActiveCharacter]; |
12740 v10 = _this; | 12746 v10 = _this; |
12741 v2 = &pSpellStats->pInfos[(signed int)((char *)_this + 11 * v1->pNumSpellBookPage) + 1]; | 12747 v2 = &pSpellStats->pInfos[(signed int)((char *)_this + 11 * v1->lastOpenedSpellbookPage) + 1]; |
12742 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) | 12748 if ( pMouse->GetCursorPos(&a2)->y <= 250 ) |
12743 v3 = pMouse->GetCursorPos(&a2)->y + 30; | 12749 v3 = pMouse->GetCursorPos(&a2)->y + 30; |
12744 else | 12750 else |
12745 v3 = 30; | 12751 v3 = 30; |
12746 a1.uFrameY = v3; | 12752 a1.uFrameY = v3; |
12795 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | 12801 v8 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
12796 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); | 12802 a1.DrawTitleText(pFontArrus, 0x78u, 0xCu, v8, v7, 3u); |
12797 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0); | 12803 a1.DrawText(pFontSmallnum, 120, 44, 0, pTmpBuf2, 0, 0, 0); |
12798 a1.uFrameWidth = 108; | 12804 a1.uFrameWidth = 108; |
12799 a1.uFrameZ = a1.uFrameX + 107; | 12805 a1.uFrameZ = a1.uFrameX + 107; |
12800 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->pNumSpellBookPage + 12], 3u); | 12806 a1.DrawTitleText(pFontComic, 0xCu, 0x4Bu, 0, pSkillNames[v1->lastOpenedSpellbookPage + 12], 3u); |
12801 sprintf( | 12807 sprintf( |
12802 pTmpBuf, | 12808 pTmpBuf, |
12803 "%s\n%d", | 12809 "%s\n%d", |
12804 pGlobalTXT_LocalizationStrings[522], | 12810 pGlobalTXT_LocalizationStrings[522], |
12805 *(&pSpellDatas[0].field_12 //temp_fix field_14 | 12811 *(&pSpellDatas[0].field_12 //temp_fix field_14 |
12806 + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->pNumSpellBookPage + 12]) >> 6) | 12812 + ((unsigned int)LOBYTE(v1->pActiveSkills[v1->lastOpenedSpellbookPage + 12]) >> 6) |
12807 + 10 * (int)((char *)v10 + 11 * v1->pNumSpellBookPage))); | 12813 + 10 * (int)((char *)v10 + 11 * v1->lastOpenedSpellbookPage))); |
12808 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u); | 12814 a1.DrawTitleText(pFontComic, 0xCu, a1.uFrameHeight - LOBYTE(pFontComic->uFontHeight) - 16, 0, pTmpBuf, 3u); |
12809 dword_507B00_spell_info_to_draw_in_popup = 0; | 12815 dword_507B00_spell_info_to_draw_in_popup = 0; |
12810 } | 12816 } |
12811 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; | 12817 // 507B00: using guessed type int dword_507B00_spell_info_to_draw_in_popup; |
12812 | 12818 |
13128 return v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u); | 13134 return v6.DrawTitleText(pBook2Font, 0, 22u, 0, pGlobalTXT_LocalizationStrings[10], 3u); |
13129 } | 13135 } |
13130 // 4E1D3A: using guessed type __int16 word_4E1D3A[]; | 13136 // 4E1D3A: using guessed type __int16 word_4E1D3A[]; |
13131 | 13137 |
13132 //----- (00411300) -------------------------------------------------------- | 13138 //----- (00411300) -------------------------------------------------------- |
13133 Texture *__fastcall LoadSpellbook(unsigned int uID) | 13139 void LoadSpellbook(unsigned int school) |
13134 { | 13140 { |
13135 unsigned int v1; // esi@1 | 13141 //unsigned int v1; // esi@1 |
13136 Player *pPlayer; // ecx@1 | 13142 Player *pPlayer; // ecx@1 |
13137 char v3; // al@1 | 13143 char v3; // al@1 |
13138 int v4; // edi@5 | 13144 //int v4; // edi@5 |
13139 Texture *result; // eax@6 | 13145 //Texture *result; // eax@6 |
13140 char *v6; // edi@7 | 13146 //unsigned char *v6; // edi@7 |
13141 unsigned int v7; // eax@7 | 13147 //unsigned int v7; // eax@7 |
13142 unsigned __int8 v8; // sf@8 | 13148 //unsigned __int8 v8; // sf@8 |
13143 unsigned __int8 v9; // of@8 | 13149 //unsigned __int8 v9; // of@8 |
13144 char pContainer[20]; // [sp+Ch] [bp-1Ch]@7 | 13150 char pContainer[20]; // [sp+Ch] [bp-1Ch]@7 |
13145 Texture *v11; // [sp+20h] [bp-8h]@5 | 13151 //Texture *v11; // [sp+20h] [bp-8h]@5 |
13146 int v12; // [sp+24h] [bp-4h]@5 | 13152 //int v12; // [sp+24h] [bp-4h]@5 |
13147 | 13153 |
13148 byte_506550 = 0; | 13154 byte_506550 = 0; |
13149 v1 = uID; | 13155 //v1 = uID; |
13150 pPlayer = pPlayers[uActiveCharacter]; | 13156 pPlayer = pPlayers[uActiveCharacter]; |
13151 v3 = pPlayer->uQuickSpell; | 13157 v3 = pPlayer->uQuickSpell; |
13152 if ( v3 && (unsigned __int8)v3 / 11 == v1 ) | 13158 if ( v3 && (unsigned __int8)v3 / 11 == school ) |
13153 dword_50654C = (unsigned __int8)v3 - 11 * v1; | 13159 dword_50654C = (unsigned __int8)v3 - 11 * school; |
13154 else | 13160 else |
13155 dword_50654C = 0; | 13161 dword_50654C = 0; |
13156 v4 = 1; | 13162 |
13157 v12 = 1; | 13163 char *v11 = &pPlayer->field_152[11 * school + 63]; |
13158 v11 = (Texture *)&pPlayer->field_152[11 * v1 + 63]; | 13164 |
13159 do | 13165 for (uint i = 1; i < 12; ++i) |
13160 { | 13166 { |
13161 result = v11; | 13167 if (v11[i]) |
13162 if ( v11->pName[v4] ) | 13168 { |
13163 { | 13169 sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]); |
13164 v6 = &byte_4E2430[12 * v1] + v4; | 13170 dword_506408[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); |
13165 sprintf(pContainer, "SB%sS%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); | 13171 |
13166 v7 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | 13172 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[school], pSpellbookSpellIndices[school][i]); |
13167 dword_506408[v12] = &pIcons_LOD->pTextures[v7]; | 13173 dword_5063D8[i] = pIcons_LOD->LoadTexturePtr(pContainer, TEXTURE_16BIT_PALETTE); |
13168 sprintf(pContainer, "SB%sC%02d", spellbook_texture_filename_suffices[v1], (unsigned __int8)*v6); | 13174 } |
13169 result = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)]; | 13175 } |
13170 dword_5063D8[v12] = result; | |
13171 } | |
13172 v4 = v12 + 1; | |
13173 v9 = v12++ > 12;//v9 = __OFSUB__(v12 + 1, 12); | |
13174 v8 = v12++ - 11 < 0; | |
13175 } | |
13176 while ( v8 ^ v9 ); | |
13177 return result; | |
13178 } | 13176 } |
13179 // 4E1D18: using guessed type char *spellbook_texture_filename_suffices[8]; | |
13180 // 506408: using guessed type int dword_506408[]; | |
13181 // 50654C: using guessed type int dword_50654C; | |
13182 // 506550: using guessed type char byte_506550; | |
13183 | 13177 |
13184 //----- (0041140B) -------------------------------------------------------- | 13178 //----- (0041140B) -------------------------------------------------------- |
13185 GUIWindow *__cdecl sub_41140B() | 13179 GUIWindow *__cdecl sub_41140B() |
13186 { | 13180 { |
13187 signed int v0; // esi@1 | 13181 signed int v0; // esi@1 |
13277 { | 13271 { |
13278 int v0; // ecx@1 | 13272 int v0; // ecx@1 |
13279 | 13273 |
13280 v0 = 0; | 13274 v0 = 0; |
13281 if ( uActiveCharacter ) | 13275 if ( uActiveCharacter ) |
13282 v0 = pParty->pPlayers[uActiveCharacter-1].pNumSpellBookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2); | 13276 v0 = pParty->pPlayers[uActiveCharacter-1].lastOpenedSpellbookPage;//*((char *)&pParty->pPartyBuffs[5].uExpireTime + 6972 * uActiveCharacter + 2); |
13283 pRenderer->DrawTextureIndexed(8u, 8u, pTextures_5064A0[v0]); | 13277 pRenderer->DrawTextureIndexed(8u, 8u, pTextures_5064A0[v0]); |
13284 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C); | 13278 pRenderer->DrawTextureIndexed(0x1DCu, 0x1C2u, pTexture_50643C); |
13285 pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448); | 13279 pRenderer->DrawTextureIndexed(0x231u, 0x1C2u, pTexture_506448); |
13286 } | 13280 } |
13287 | 13281 |
13316 POINT v24; | 13310 POINT v24; |
13317 int v25; | 13311 int v25; |
13318 | 13312 |
13319 sub_412AF9(); | 13313 sub_412AF9(); |
13320 v0 = pPlayers[uActiveCharacter]; | 13314 v0 = pPlayers[uActiveCharacter]; |
13321 v1 = 11 * v0->pNumSpellBookPage; | 13315 v1 = 11 * v0->lastOpenedSpellbookPage; |
13322 v2 = pIcons_LOD->FindTextureByName("Pending"); | 13316 v2 = pIcons_LOD->FindTextureByName("Pending"); |
13323 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); | 13317 v3 = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); |
13324 pRenderer->ClearZBuffer(0, 479); | 13318 pRenderer->ClearZBuffer(0, 479); |
13325 v4 = 1; | 13319 v4 = 1; |
13326 if ( __OFSUB__(v1, v1 + 11) ^ 1 ) | 13320 if ( __OFSUB__(v1, v1 + 11) ^ 1 ) |
13342 v23 = dword_506408[v4]; | 13336 v23 = dword_506408[v4]; |
13343 v6 = v5; | 13337 v6 = v5; |
13344 } | 13338 } |
13345 if ( v6->pLevelOfDetail0 ) | 13339 if ( v6->pLevelOfDetail0 ) |
13346 { | 13340 { |
13347 v7 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage + v4])); | 13341 v7 = 2 * (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]); |
13348 v19 = pViewport->uViewportY + dword_4E20D0[v7 + 1]; | 13342 v19 = pViewport->uViewportY + dword_4E20D0[v7 + 1]; |
13349 v17 = pViewport->uViewportX + dword_4E20D0[v7]; | 13343 v17 = pViewport->uViewportX + dword_4E20D0[v7]; |
13350 if ( BYTE1(v6->pBits) & 2 ) | 13344 if ( BYTE1(v6->pBits) & 2 ) |
13351 pRenderer->DrawTextureTransparent(v17, v19, v6); | 13345 pRenderer->DrawTextureTransparent(v17, v19, v6); |
13352 else | 13346 else |
13353 pRenderer->DrawTextureIndexed(v17, v19, v6); | 13347 pRenderer->DrawTextureIndexed(v17, v19, v6); |
13354 v8 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v4)); | 13348 v8 = 2 * (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v4]); |
13355 pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], v23, v4); | 13349 pRenderer->_4A612A(dword_4E20D0[v8], dword_4E20D0[v8 + 1], v23, v4); |
13356 } | 13350 } |
13357 } | 13351 } |
13358 } | 13352 } |
13359 ++v4; | 13353 ++v4; |
13366 { | 13360 { |
13367 v11 = dword_5063D8[v10]; | 13361 v11 = dword_5063D8[v10]; |
13368 if ( v11->pLevelOfDetail0 ) | 13362 if ( v11->pLevelOfDetail0 ) |
13369 { | 13363 { |
13370 v21 = dword_5063D8[v10]; | 13364 v21 = dword_5063D8[v10]; |
13371 v12 = 2 * (12 * v0->pNumSpellBookPage + (unsigned __int8)*(&byte_4E2430[12 * v0->pNumSpellBookPage] + v10)); | 13365 v12 = 2 * (12 * v0->lastOpenedSpellbookPage + pSpellbookSpellIndices[v0->lastOpenedSpellbookPage][v10]); |
13372 v20 = pViewport->uViewportY + dword_4E20D0[v12 + 1]; | 13366 v20 = pViewport->uViewportY + dword_4E20D0[v12 + 1]; |
13373 v18 = pViewport->uViewportX + dword_4E20D0[v12]; | 13367 v18 = pViewport->uViewportX + dword_4E20D0[v12]; |
13374 if ( BYTE1(v11->pBits) & 2 ) | 13368 if ( BYTE1(v11->pBits) & 2 ) |
13375 pRenderer->DrawTextureTransparent(v18, v20, v21); | 13369 pRenderer->DrawTextureTransparent(v18, v20, v21); |
13376 else | 13370 else |
13384 v25 = 0; | 13378 v25 = 0; |
13385 do | 13379 do |
13386 { | 13380 { |
13387 if ( *(short *)a2.x ) | 13381 if ( *(short *)a2.x ) |
13388 { | 13382 { |
13389 if ( v0->pNumSpellBookPage == v13 ) | 13383 if ( v0->lastOpenedSpellbookPage == v13 ) |
13390 { | 13384 { |
13391 pPageTexture = pTextures_tabs[v13][1]; | 13385 pPageTexture = pTextures_tabs[v13][1]; |
13392 switch ( v13 ) | 13386 switch ( v13 ) |
13393 { | 13387 { |
13394 case 0: | 13388 case 0: |
16177 { | 16171 { |
16178 back_to_game(); | 16172 back_to_game(); |
16179 return; | 16173 return; |
16180 } | 16174 } |
16181 } | 16175 } |
16176 | |
16182 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором | 16177 if ( pParty->pPickedItem.uItemID )//нажатие на портрет перса правой кнопкой мыши с раствором |
16183 { | 16178 { |
16184 //v1 = 0; | 16179 //v1 = 0; |
16185 //do | 16180 //do |
16186 for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) | 16181 for ( pPlayerNum = 0; pPlayerNum < 4; ++pPlayerNum) |
16193 } | 16188 } |
16194 //++v1; | 16189 //++v1; |
16195 } | 16190 } |
16196 //while ( v1 < 4 ); | 16191 //while ( v1 < 4 ); |
16197 } | 16192 } |
16193 | |
16198 pEventTimer->Pause(); | 16194 pEventTimer->Pause(); |
16199 if ( pCurrentScreen <= SCREEN_CHEST ) | 16195 if ( pCurrentScreen <= SCREEN_CHEST ) |
16200 { | 16196 { |
16201 if ( pCurrentScreen == SCREEN_CHEST ) | 16197 if ( pCurrentScreen == SCREEN_CHEST ) |
16202 { | 16198 { |