comparison mm7_3.cpp @ 827:085eb19b7ffd

mr.Malvik
author Ritor1
date Wed, 27 Mar 2013 01:39:54 +0600
parents 1133e34a7560
children d5b1870df3ab
comparison
equal deleted inserted replaced
826:1133e34a7560 827:085eb19b7ffd
12424 GUIWindow v5; // [sp+D4h] [bp-58h]@4 12424 GUIWindow v5; // [sp+D4h] [bp-58h]@4
12425 GUIFont *pFont; // [sp+128h] [bp-4h]@1 12425 GUIFont *pFont; // [sp+128h] [bp-4h]@1
12426 12426
12427 v0 = pFontArrus; 12427 v0 = pFontArrus;
12428 pFont = pFontArrus; 12428 pFont = pFontArrus;
12429 if ( ptr_F8B1E8 && !byte_5B0938[0] ) 12429 if ( current_npc_text && !byte_5B0938[0] )
12430 strcpy(byte_5B0938, ptr_F8B1E8); 12430 strcpy(byte_5B0938, current_npc_text);
12431 v5.uFrameWidth = game_viewport_width; 12431 v5.uFrameWidth = game_viewport_width;
12432 v5.uFrameZ = 452; 12432 v5.uFrameZ = 452;
12433 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7; 12433 v1 = pFontArrus->CalcTextHeight(byte_5B0938, &v5, 12, 0) + 7;
12434 if ( 352 - v1 < 8 ) 12434 if ( 352 - v1 < 8 )
12435 { 12435 {
12538 12538
12539 //----- (00445350) -------------------------------------------------------- 12539 //----- (00445350) --------------------------------------------------------
12540 void __cdecl DrawDialogueUI() 12540 void __cdecl DrawDialogueUI()
12541 { 12541 {
12542 NPCData *pNPC; // ebx@2 12542 NPCData *pNPC; // ebx@2
12543 int v1; // eax@2 12543 int pGreetType; // eax@2
12544 unsigned __int16 v2; // di@2 12544 unsigned __int16 v2; // di@2
12545 //unsigned int v3; // eax@2 12545 //unsigned int v3; // eax@2
12546 char *v4; // esi@3 12546 char *v4; // esi@3
12547 //int v5; // eax@11 12547 //int v5; // eax@11
12548 //char *v6; // ecx@13 12548 //char *v6; // ecx@13
12589 12589
12590 if ( !pDialogueWindow ) 12590 if ( !pDialogueWindow )
12591 return; 12591 return;
12592 memcpy(&v51, pDialogueWindow, sizeof(v51)); 12592 memcpy(&v51, pDialogueWindow, sizeof(v51));
12593 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID); 12593 pNPC = GetNPCData(sDialogue_SpeakingActorNPC_ID);
12594 v1 = sub_445C8B(sDialogue_SpeakingActorNPC_ID); 12594 pGreetType = GetGreetType(sDialogue_SpeakingActorNPC_ID);
12595 v51.uFrameWidth -= 10; 12595 v51.uFrameWidth -= 10;
12596 v51.uFrameZ -= 10; 12596 v51.uFrameZ -= 10;
12597 //v54 = v1; 12597 //v54 = v1;
12598 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu); 12598 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0xFFu);
12599 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u); 12599 GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xCDu, 0x23u);
12653 break; 12653 break;
12654 12654
12655 default: 12655 default:
12656 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0]) 12656 if (uDialogueType > DIALOGUE_18 && uDialogueType < DIALOGUE_23 && !byte_5B0938[0])
12657 { 12657 {
12658 pInString = (char *)ptr_F8B1E8; 12658 pInString = (char *)current_npc_text;
12659 } 12659 }
12660 else if (v1 == 1)//QuestNPCDialogue 12660 else if (pGreetType == 1)//QuestNPC_greet
12661 { 12661 {
12662 if (pNPC->greet) 12662 if (pNPC->greet)
12663 { 12663 {
12664 if ((pNPC->uFlags & 3) == 2) 12664 if ((pNPC->uFlags & 3) == 2)
12665 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2; 12665 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting2;
12666 else 12666 else
12667 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1; 12667 pInString = pNPCStats->pNPCGreetings[pNPC->greet - 1].pGreeting1;
12668 } 12668 }
12669 } 12669 }
12670 else if (v1 == 2)//HiredNPCDialogue 12670 else if (pGreetType == 2)//HiredNPC_greet
12671 { 12671 {
12672 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1; 12672 auto prof = pNPCStats->pProfessions + pNPC->uProfession - 1;
12673 12673
12674 if (pNPC->Hired()) 12674 if (pNPC->Hired())
12675 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0); 12675 pInString = BuilDialogueString(prof->pDismissText, uActiveCharacter - 1, 0, 0, 0, 0);
12889 } 12889 }
12890 pRenderer->DrawTextureIndexed(471, 445, (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0)); 12890 pRenderer->DrawTextureIndexed(471, 445, (Texture *)(uExitCancelTextureId != -1 ? &pIcons_LOD->pTextures[uExitCancelTextureId] : 0));
12891 } 12891 }
12892 12892
12893 //----- (00445C8B) -------------------------------------------------------- 12893 //----- (00445C8B) --------------------------------------------------------
12894 int __fastcall sub_445C8B(signed int a1) 12894 int __fastcall GetGreetType(signed int SpeakingNPC_ID)
12895 { 12895 {
12896 signed int v1; // ebx@1 12896 signed int v1; // ebx@1
12897 int v3; // edi@6 12897 int v3; // edi@6
12898 int v4; // ecx@6 12898 int v4; // ecx@6
12899 int v5; // edx@6 12899 int v5; // edx@6
12900 NPCData *v6; // eax@6 12900 NPCData *v6; // eax@6
12901 char *v7; // ebp@11 12901 char *v7; // ebp@11
12902 NPCData *v8; // esi@11 12902 NPCData *v8; // esi@11
12903 12903
12904 v1 = 0; 12904 v1 = 0;
12905 if ( a1 >= 0 ) 12905 if ( SpeakingNPC_ID >= 0 )
12906 { 12906 {
12907 if ( a1 < 5000 ) 12907 if ( SpeakingNPC_ID < 5000 )
12908 return 1; 12908 return 1;//QuestNPC_greet
12909 return 2; 12909 return 2;//HiredNPC_greet
12910 } 12910 }
12911 if ( a1 >= 5000 ) 12911 if ( SpeakingNPC_ID >= 5000 )
12912 return 2; 12912 return 2;
12913 v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1; 12913 v3 = abs((int)sDialogue_SpeakingActorNPC_ID) - 1;
12914 v4 = 0; 12914 v4 = 0;
12915 v5 = 0; 12915 v5 = 0;
12916 v6 = pParty->pHirelings; 12916 v6 = pParty->pHirelings;
12936 ++v1; 12936 ++v1;
12937 ++v8; 12937 ++v8;
12938 } 12938 }
12939 while ( v1 < (signed int)pNPCStats->uNumNewNPCs ); 12939 while ( v1 < (signed int)pNPCStats->uNumNewNPCs );
12940 } 12940 }
12941 return ((unsigned __int8)pTmpBuf[v3] < 2u) + 1; 12941 return ((unsigned __int8)pTmpBuf[v3] < 2) + 1;
12942 } 12942 }
12943 12943
12944 //----- (0044603D) -------------------------------------------------------- 12944 //----- (0044603D) --------------------------------------------------------
12945 void __cdecl sub_44603D() 12945 void __cdecl sub_44603D()
12946 { 12946 {