comparison mm7_3.cpp @ 829:d5b1870df3ab

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