comparison mm7_4.cpp @ 711:a5e587c8e30e

some cleaning
author Gloval
date Thu, 21 Mar 2013 23:10:57 +0400
parents d6236f6a9882
children e7c86528a2b3
comparison
equal deleted inserted replaced
709:af08fc9e29c8 711:a5e587c8e30e
5919 } 5919 }
5920 5920
5921 5921
5922 5922
5923 //----- (004AD504) -------------------------------------------------------- 5923 //----- (004AD504) --------------------------------------------------------
5924 int __fastcall sub_4AD504(unsigned int uFaceID) 5924 int __fastcall sub_4AD504(signed int sFaceID)
5925 { 5925 {
5926 int result; // eax@1 5926 int result; // eax@1
5927 unsigned int v2; // ebx@1 5927 signed int v2; // ebx@1
5928 BLVFace *v3; // esi@3 5928 BLVFace *v3; // esi@3
5929 Texture *v4; // edi@6 5929 Texture *v4; // edi@6
5930 int v5; // eax@7 5930 int v5; // eax@7
5931 int v6; // edx@7 5931 int v6; // edx@7
5932 int v7; // ecx@7 5932 int v7; // ecx@7
6046 unsigned int v121; // [sp+98h] [bp-Ch]@15 6046 unsigned int v121; // [sp+98h] [bp-Ch]@15
6047 unsigned __int16 *v122; // [sp+9Ch] [bp-8h]@15 6047 unsigned __int16 *v122; // [sp+9Ch] [bp-8h]@15
6048 unsigned int v123; // [sp+A0h] [bp-4h]@13 6048 unsigned int v123; // [sp+A0h] [bp-4h]@13
6049 6049
6050 result = pRenderer->uTargetSurfacePitch; 6050 result = pRenderer->uTargetSurfacePitch;
6051 v2 = uFaceID; 6051 v2 = sFaceID;
6052 v95 = pRenderer->uTargetSurfacePitch; 6052 v95 = pRenderer->uTargetSurfacePitch;
6053 if ( (uFaceID & 0x80000000u) == 0 ) 6053 if ( sFaceID >= 0 )
6054 { 6054 {
6055 if ( (signed int)uFaceID < (signed int)pIndoor->uNumFaces ) 6055 if ( sFaceID < (signed int)pIndoor->uNumFaces )
6056 { 6056 {
6057 v3 = &pIndoor->pFaces[uFaceID]; 6057 v3 = &pIndoor->pFaces[sFaceID];
6058 v91 = &pIndoor->pFaces[uFaceID]; 6058 v91 = &pIndoor->pFaces[sFaceID];
6059 if ( !pRenderer->pRenderD3D ) 6059 if ( !pRenderer->pRenderD3D )
6060 { 6060 {
6061 result = sub_423B5D(uFaceID); 6061 result = sub_423B5D(sFaceID);
6062 if ( result ) 6062 if ( result )
6063 { 6063 {
6064 result = sub_424829(result, &stru_F8A590, pBLVRenderParams->field_7C, v2); 6064 result = sub_424829(result, &stru_F8A590, pBLVRenderParams->field_7C, v2);
6065 if ( result ) 6065 if ( result )
6066 { 6066 {
9619 pParty->field_709 = 0; 9619 pParty->field_709 = 0;
9620 Party__CountHirelings(); 9620 Party__CountHirelings();
9621 9621
9622 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); 9622 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0);
9623 9623
9624 if ( (sDialogue_SpeakingActorNPC_ID & 0x80000000u) == 0 ) 9624 if ( sDialogue_SpeakingActorNPC_ID >= 0 )
9625 pDialogue_SpeakingActor->uAIState = Removed; 9625 pDialogue_SpeakingActor->uAIState = Removed;
9626 if ( uActiveCharacter ) 9626 if ( uActiveCharacter )
9627 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0); 9627 pPlayers[uActiveCharacter]->PlaySound(SPEECH_61, 0);
9628 } 9628 }
9629 } 9629 }
9840 9840
9841 9841
9842 9842
9843 9843
9844 //----- (004B6478) -------------------------------------------------------- 9844 //----- (004B6478) --------------------------------------------------------
9845 int __cdecl sub_4B6478() 9845 void sub_4B6478()
9846 { 9846 {
9847 GUIWindow *v0; // ebx@1 9847 GUIWindow *v0; // ebx@1
9848 Player *v1; // edi@1 9848 Player *v1; // edi@1
9849 unsigned int v2; // eax@1 9849 unsigned int v2; // eax@1
9850 signed int v3; // esi@1 9850 signed int v3; // esi@1
9851 int v4; // ebx@1 9851 int v4; // ebx@1
9948 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; 9948 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3;
9949 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5; 9949 *(&pMessageQueue_50CBD0->uNumMessages + result) = v5;
9950 ++pMessageQueue_50CBD0->uNumMessages; 9950 ++pMessageQueue_50CBD0->uNumMessages;
9951 }*/ 9951 }*/
9952 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5); 9952 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5);
9953 return result; // void func 9953 return; // void func
9954 } 9954 }
9955 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) 9955 if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) )
9956 { 9956 {
9957 v24 = pNPCTopics[171].pText; 9957 v24 = pNPCTopics[171].pText;
9958 v25 = v31; 9958 v25 = v31;
9959 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0); 9959 v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0);
9960 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u); 9960 v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u);
9961 result = (int)pDialogueWindow;
9962 pDialogueWindow->pNumPresenceButton = 0; 9961 pDialogueWindow->pNumPresenceButton = 0;
9963 return result; 9962 return ;
9964 } 9963 }
9965 result = sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win(); 9964
9966 if ( !result ) 9965 if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() )
9967 return result; 9966 return;
9968 v8 = pDialogueWindow; 9967 v8 = pDialogueWindow;
9969 v33 = 0; 9968 v33 = 0;
9970 v34 = 0; 9969 v34 = 0;
9971 v29 = pDialogueWindow; 9970 v29 = pDialogueWindow;
9972 v9 = pDialogueWindow->pStartingPosActiveItem; 9971 v9 = pDialogueWindow->pStartingPosActiveItem;
9993 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]); 9992 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]);
9994 strcat(pTmpBuf, "\n \n"); 9993 strcat(pTmpBuf, "\n \n");
9995 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]); 9994 strcat(pTmpBuf, pGlobalTXT_LocalizationStrings[528]);
9996 v22 = v31; 9995 v22 = v31;
9997 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v28, 0, 0); 9996 v23 = pFontArrus->CalcTextHeight(pTmpBuf, &v28, 0, 0);
9998 return (int)v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u); 9997 v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf, 3u);
9998 return;
9999 } 9999 }
10000 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v32); 10000 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[401], v32);
10001 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u); 10001 v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf, 3u);
10002 v32 = (149 - v33) / v34; 10002 v32 = (149 - v33) / v34;
10003 if ( (149 - v33) / v34 > 32 ) 10003 if ( (149 - v33) / v34 > 32 )
10004 v32 = 32; 10004 v32 = 32;
10005 result = v8->pStartingPosActiveItem; 10005
10006 v35 = result; 10006 v35 = v8->pStartingPosActiveItem;
10007 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162; 10007 v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162;
10008 if ( result < result + v8->pNumPresenceButton ) 10008 if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton )
10009 { 10009 {
10010 v33 = 2; 10010 v33 = 2;
10011 do 10011 do
10012 { 10012 {
10013 v14 = v8->GetControl(v35); 10013 v14 = v8->GetControl(v35);
10041 v14->uY = v16; 10041 v14->uY = v16;
10042 LABEL_34: 10042 LABEL_34:
10043 v8 = v29; 10043 v8 = v29;
10044 ++v35; 10044 ++v35;
10045 ++v33; 10045 ++v33;
10046 result = v29->pNumPresenceButton + v29->pStartingPosActiveItem; 10046 }
10047 } 10047 while ( v35 <v29->pNumPresenceButton + v29->pStartingPosActiveItem );
10048 while ( v35 < result ); 10048 }
10049 } 10049 return;
10050 return result;
10051 } 10050 }
10052 10051
10053 10052
10054 10053
10055 //----- (004B6943) -------------------------------------------------------- 10054 //----- (004B6943) --------------------------------------------------------