comparison mm7_3.cpp @ 179:f102bbff6fd8

15.02.13 Water
author Ritor1
date Fri, 15 Feb 2013 17:14:24 +0600
parents 1dfa65be220e
children c5bd7a825ef2
comparison
equal deleted inserted replaced
178:1dfa65be220e 179:f102bbff6fd8
8364 array_50AC10[3].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist; 8364 array_50AC10[3].vWorldViewPosition.x = pOutdoorCamera->shading_dist_mist;
8365 array_50AC10[3]._rhw = 1; 8365 array_50AC10[3]._rhw = 1;
8366 array_50AC10[3].u = 1; 8366 array_50AC10[3].u = 1;
8367 array_50AC10[3].v = 1 + t; 8367 array_50AC10[3].v = 1 + t;
8368 pRenderer->DrawStrip(_this.uNumVertices, &_this, 8368 pRenderer->DrawStrip(_this.uNumVertices, &_this,
8369 pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]); 8369 pBitmaps_LOD->pHardwareTextures[_this.uTileBitmapID]);
8370 return; 8370 return;
8371 } 8371 }
8372 8372
8373 8373
8374 //----- (00479A53) -------------------------------------------------------- 8374 //----- (00479A53) --------------------------------------------------------
8375 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID) 8375 void __fastcall _479A53_draw_some_blv_poly(unsigned int uNumVertices, unsigned int uFaceID)
16482 { 16482 {
16483 strcpy(pTmpBuf, pNPC->pName); 16483 strcpy(pTmpBuf, pNPC->pName);
16484 } 16484 }
16485 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3); 16485 v51.DrawTitleText(pFontArrus, 483, 112, v2, pTmpBuf, 3);
16486 pParty->GetPartyFame(); 16486 pParty->GetPartyFame();
16487 if ( (signed int)uDialogueType > 89 ) 16487 if ( (signed int)uDialogueType > DIALOGUE_ARENA_WELCOME )
16488 { 16488 {
16489 if ( uDialogueType == 90 ) 16489 if ( uDialogueType == DIALOGUE_ARENA_FIGHT_NOT_OVER_YET )
16490 { 16490 {
16491 pWindow.uFrameWidth = 460; 16491 pWindow.uFrameWidth = 460;
16492 pWindow.uFrameZ = 452; 16492 pWindow.uFrameZ = 452;
16493 pOutString = pFontArrus; 16493 pOutString = pFontArrus;
16494 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:" 16494 v12 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[577], &pWindow, 13, 0) + 7;//"Get back in there you wimps:"
16502 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428); 16502 pRenderer->DrawTextureIndexed(8, 347 - v12, pTexture_591428);
16503 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0); 16503 v13 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[577], pFontArrus, &pWindow, 0xDu, 0);
16504 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0); 16504 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v12, 0, v13, 0, 0, 0);
16505 goto LABEL_42; 16505 goto LABEL_42;
16506 } 16506 }
16507 if ( uDialogueType == 91 ) 16507 if ( uDialogueType == DIALOGUE_ARENA_REWARD )
16508 { 16508 {
16509 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold." 16509 sprintf(v4, pGlobalTXT_LocalizationStrings[576], dword_F8B1B4);// "Congratulations on your win: here's your stuff: %u gold."
16510 pInString = v4; 16510 pInString = v4;
16511 v8 = 0; 16511 v8 = 0;
16512 pWindow.uFrameWidth = 460; 16512 pWindow.uFrameWidth = 460;
16523 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16523 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16524 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); 16524 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8);
16525 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); 16525 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
16526 goto LABEL_42; 16526 goto LABEL_42;
16527 } 16527 }
16528 if ( uDialogueType == 92 ) 16528 if ( uDialogueType == DIALOGUE_ARENA_ALREADY_WON )
16529 { 16529 {
16530 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:" 16530 v7 = pGlobalTXT_LocalizationStrings[582]; // "You already won this trip to the Arena:"
16531 v8 = 0; 16531 v8 = 0;
16532 pInString = v7; 16532 pInString = v7;
16533 pWindow.uFrameWidth = 460; 16533 pWindow.uFrameWidth = 460;
16547 goto LABEL_42; 16547 goto LABEL_42;
16548 } 16548 }
16549 } 16549 }
16550 else 16550 else
16551 { 16551 {
16552 if ( uDialogueType == 89 ) 16552 if ( uDialogueType == DIALOGUE_ARENA_WELCOME )
16553 { 16553 {
16554 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:" 16554 v7 = pGlobalTXT_LocalizationStrings[574]; // "Welcome to the Arena of Life and Death. Remember, you are only allowed one arena combat per visit. To fight an arena battle, select the option that best describes your abilities and return to me- if you survive:"
16555 v8 = 0; 16555 v8 = 0;
16556 pInString = v7; 16556 pInString = v7;
16557 pWindow.uFrameWidth = 460; 16557 pWindow.uFrameWidth = 460;
16568 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16568 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16569 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); 16569 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8);
16570 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); 16570 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
16571 goto LABEL_42; 16571 goto LABEL_42;
16572 } 16572 }
16573 if ( uDialogueType == 13 ) 16573 if ( uDialogueType == DIALOGUE_13 )
16574 { 16574 {
16575 v5 = 5 * pNPC->uProfession; 16575 v5 = 5 * pNPC->uProfession;
16576 v6 = (char *)*(&pNPCStats->field_13A64 + v5); 16576 v6 = (char *)*(&pNPCStats->field_13A64 + v5);
16577 v8 = 0; 16577 v8 = 0;
16578 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0); 16578 v7 = sub_495461(v6, uActiveCharacter - 1, 0, 0, 0, 0);
16591 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428); 16591 pRenderer->DrawTextureIndexed(8u, 347 - v12, pTexture_591428);
16592 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8); 16592 v13 = FitTextInAWindow(pInString, pOutString, &pWindow, 0xDu, v8);
16593 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8); 16593 pDialogueWindow->DrawText(pOutString, 13, 354 - v12, v8, v13, v8, v8, v8);
16594 goto LABEL_42; 16594 goto LABEL_42;
16595 } 16595 }
16596 if ( (signed int)uDialogueType > 18 ) 16596 if ( (signed int)uDialogueType > DIALOGUE_18 )
16597 { 16597 {
16598 if ( (signed int)uDialogueType > 24 ) 16598 if ( (signed int)uDialogueType > DIALOGUE_24 )
16599 { 16599 {
16600 if ( uDialogueType == 77 ) 16600 if ( uDialogueType == DIALOGUE_77 )
16601 { 16601 {
16602 v5 = 5 * pNPC->uProfession; 16602 v5 = 5 * pNPC->uProfession;
16603 if ( byte_F8B1EC ) 16603 if ( byte_F8B1EC )
16604 { 16604 {
16605 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession); 16605 v6 = (char *)*(&pNPCStats->field_13A5C + 5 * pNPC->uProfession);
16703 { 16703 {
16704 if ( *(int *)v54 == 2 ) 16704 if ( *(int *)v54 == 2 )
16705 { 16705 {
16706 v8 = 0; 16706 v8 = 0;
16707 if ( pNPC->uFlags & 0x80 ) 16707 if ( pNPC->uFlags & 0x80 )
16708 v9 = (char *)*(&pNPCStats->field_13A68 + 5 * pNPC->uProfession); 16708 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pDismissText;
16709 else 16709 else
16710 v9 = (char *)*(&pNPCStats->field_13A64 + 5 * pNPC->uProfession); //"Invalid String Passed" 16710 v9 = (char *)pNPCStats->pProfessions[pNPC->uProfession].pJoinText; //"Invalid String Passed"
16711 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0); 16711 v10 = sub_495461(v9, uActiveCharacter - 1, 0, 0, 0, 0);
16712 LABEL_32: 16712 LABEL_32:
16713 pInString = v10; 16713 pInString = v10;
16714 if ( v10 == (char *)v8 ) 16714 if ( v10 == (char *)v8 )
16715 goto LABEL_42; 16715 goto LABEL_42;
16948 { 16948 {
16949 unsigned int v1; // esi@1 16949 unsigned int v1; // esi@1
16950 NPCData *result; // eax@5 16950 NPCData *result; // eax@5
16951 int v3; // esi@9 16951 int v3; // esi@9
16952 int v4; // ecx@9 16952 int v4; // ecx@9
16953 int v5; // edx@9 16953 //int v5; // edx@9
16954 NPCData *v6; // eax@9 16954 //NPCData *v6; // eax@9
16955 char *v7; // ebx@14 16955 char *v7; // ebx@14
16956 NPCData *v8; // edi@14 16956 NPCData *v8; // edi@14
16957 char v9; // al@22 16957 char v9; // al@22
16958 std::string v10; // [sp-18h] [bp-2Ch]@4 16958 char v10;
16959 const char *v11; // [sp-8h] [bp-1Ch]@4 16959 //std::string v10; // [sp-18h] [bp-2Ch]@4
16960 int v11;
16961 //const char *v11; // [sp-8h] [bp-1Ch]@4
16960 int v12; // [sp-4h] [bp-18h]@4 16962 int v12; // [sp-4h] [bp-18h]@4
16961 std::string *v13; // [sp+Ch] [bp-8h]@4 16963 int v13;
16964 char *v14;
16965 //std::string *v13; // [sp+Ch] [bp-8h]@4
16962 int a3; // [sp+13h] [bp-1h]@4 16966 int a3; // [sp+13h] [bp-1h]@4
16963 16967 int i;
16964 v1 = npcid; 16968
16969 /*v1 = npcid;
16965 if ( (npcid & 0x80000000u) == 0 ) 16970 if ( (npcid & 0x80000000u) == 0 )
16966 { 16971 {
16967 if ( (signed int)npcid < 5000 ) 16972 if ( (signed int)npcid < 5000 )
16968 { 16973 {
16969 if ( (signed int)npcid >= 501 ) 16974 if ( (signed int)npcid >= 501 )
17014 if ( (unsigned __int8)v9 >= 2u ) 17019 if ( (unsigned __int8)v9 >= 2u )
17015 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499]; 17020 result = &pNPCStats->pNPCData[(unsigned __int8)v9 + 499];
17016 else 17021 else
17017 result = &pParty->pHirelings[(unsigned __int8)v9]; 17022 result = &pParty->pHirelings[(unsigned __int8)v9];
17018 } 17023 }
17019 return result; 17024 return result;*/
17025 v1 = npcid;
17026 if ( npcid >= 0 )
17027 {
17028 if ( npcid < 5000 )
17029 {
17030 if ( npcid >= 501 )
17031 {
17032 MessageBoxW(nullptr, L"NPC id exceeds MAX_DATA!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Events.cpp:1984", 0);
17033 }
17034 return &pNPCStats->pNewNPCData[v1 - 1];
17035 }
17036 return &pNPCStats->array_13EF4[npcid - 5000];
17037 }
17038
17039
17040 if ( npcid >= 5000 )
17041 return &pNPCStats->array_13EF4[npcid - 5000];
17042 if (uDialogue_SpeakingActorNPC_ID >= 0)
17043 {
17044 result = 0;
17045 }
17046 else
17047 {
17048 v3 = uDialogue_SpeakingActorNPC_ID - 1;
17049 v4 = 0;
17050
17051 for (i = 0; i < 4; ++i)
17052 {
17053 if (pParty->pHirelings[i].pName)
17054 pTmpBuf[v4++] = i;
17055 }
17056
17057 if (pNPCStats->uNumNewNPCs > 0)
17058 {
17059 for (i = 0; i < pNPCStats->uNumNewNPCs; ++i)
17060 {
17061 if (pNPCStats->pNewNPCData[i].uFlags & 0x80)
17062 {
17063 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName))
17064 {
17065 if (!pParty->pHirelings[1].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[1].pName))
17066 pTmpBuf[v4++] = i + 2;
17067 }
17068 }
17069 }
17070 }
17071
17072 v9 = pTmpBuf[v3];
17073 if ( v9 >= 2 )
17074 result = &pNPCStats->pNPCData[499 + v9];
17075 else
17076 result = &pParty->pHirelings[v9];
17077 }
17020 } 17078 }
17021 17079
17022 //----- (00445B2C) -------------------------------------------------------- 17080 //----- (00445B2C) --------------------------------------------------------
17023 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2) 17081 NPCData *__fastcall GetNewNPCData(signed int npcid, int a2)
17024 { 17082 {