# HG changeset patch # User Grumpy7 # Date 1370788077 -7200 # Node ID 68655becb94b4c73487c3828f3e66bf0e898f617 # Parent 0d6c7ff3cddd4b9eb39ecc0be6191e816dcfd0ba# Parent 746f7ef994cb4d492929eda884e784976b378bfe merge diff -r 0d6c7ff3cddd -r 68655becb94b Arcomage.cpp --- a/Arcomage.cpp Sun Jun 09 16:06:12 2013 +0200 +++ b/Arcomage.cpp Sun Jun 09 16:27:57 2013 +0200 @@ -43,9 +43,9 @@ void DrawBricksCount(int a1, char* text, POINT *pXY); // idb void DrawGemsCount(int a1, char* text, POINT* pXY); void DrawBeastsCount(int a1, char *text, POINT *pXY); // idb -void DrawPlayersTowers(); -void DrawPlayersWall(); -void __cdecl am_40B4B9(); +void DrawPlayersTowers(); +void DrawPlayersWall(); +void DrawCards(); void __fastcall am_40B76F(int a1); int GetPlayerHandCardCount(int player_num); signed int DrawCardsRectangles(int player_num); @@ -65,8 +65,6 @@ void __fastcall DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill); // idb void SetPixel(POINT *pTargetXY, unsigned __int16 uColor); int __fastcall rand_interval(int a, int b); // idb -char *__fastcall inv_strcat(const char *Source, char *Dest); -char *__fastcall inv_strcpy(const char *Source, char *Dest); void __fastcall intToString(int val, char *pOut); /* 388 */ @@ -109,8 +107,8 @@ ArcomageGame *pArcomageGame = new ArcomageGame; ArcomagePlayer am_Players[2]; -Acromage_st1 shown_cards[10]; - +Acromage_st1 shown_cards[10]; //amuint_4FAA78; // weak +ArcomageCard pCards[87]; stru272 array_4FABD0[10]; @@ -165,7 +163,8 @@ char am_byte_4FAA77; // weak signed int current_card_slot_index; -unsigned int played_card_id; // idb +int played_card_id; // idb 4FABC0 +int uCardID; // idb 4FAA50 int deck_walk_index; @@ -173,6 +172,15 @@ int start_gems_amount; int start_beasts_amount; +POINT amuint_4FAA3C_blt_xy; +POINT am_uint_4FAA44_blt_xy; +POINT amuint_4FAA54_blt_xy; +POINT amuint_4FAA5C_blt_xy; + + + +int dword_4FABB8; // weak + //----- (0040DD2F) -------------------------------------------------------- bool stru273::_40DD2F() @@ -1660,7 +1668,6 @@ } } - // inv_strcpy(pDeckMaster, byte_5054C8); strcpy(deckMaster.name, pDeckMaster); for (i=0, card_dispenser_counter=-2, card_id_counter=0; ifield_F6 = 1; - }*/ + } if ( pArcomageGame->field_F6 ) { DrawGameUI(v13); @@ -2169,7 +2176,7 @@ am_EndScene(); am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); - am_40B4B9(); + DrawCards(); DrawPlayersTowers(); DrawPlayersWall(); DrawPlayersText(); @@ -2301,21 +2308,21 @@ if ( am_byte_4FAA77 ) { - inv_strcpy(pGlobalTXT_LocalizationStrings[266], text_buff);// DISCARD A CARD + strcpy(text_buff, pGlobalTXT_LocalizationStrings[266]);// DISCARD A CARD text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2; text_position.y = 306; pPrimaryWindow_draws_text(-1, text_buff, &text_position); } - inv_strcpy(am_Players[0].pPlayerName, text_buff); + strcpy( text_buff, am_Players[0].pPlayerName); if ( !current_player_num ) - inv_strcat("***", text_buff); + strcat(text_buff, "***"); text_position.x = 47 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; text_position.y = 21; pPrimaryWindow_draws_text(-1, text_buff, &text_position); - inv_strcpy(am_Players[1].pPlayerName, text_buff); + strcpy(text_buff, am_Players[1].pPlayerName); if ( current_player_num == 1 ) - inv_strcat("***", text_buff); + strcat(text_buff, "***" ); text_position.x = 595 - pArcomageGame->pfntComic->GetLineWidth(text_buff) / 2; text_position.y = 21; pPrimaryWindow_draws_text(-1, text_buff, &text_position); @@ -2667,8 +2674,8 @@ } //----- (0040B4B9) -------------------------------------------------------- -void __cdecl am_40B4B9() -{ +void DrawCards() + { int v0; // esi@1 char v1; // bl@1 @@ -2811,6 +2818,234 @@ //----- (0040B76F) -------------------------------------------------------- void __fastcall am_40B76F(int a1) { + +int v1; // eax@3 +int v2; // eax@3 +int v3; // esi@4 +int v4; // eax@4 +POINT *v5; // edx@6 +RECT *v6; // ecx@6 +Acromage_st1 *v7; // ebx@11 +int v8; // eax@15 +Acromage_st1 *v9; // ecx@15 +int v10; // ecx@19 +int v11; // eax@20 +int v12; // ecx@20 +int v13; // eax@20 +unsigned int v14; // ecx@21 +double v15; // st7@22 +POINT *v16; // edx@23 +int v17; // eax@32 +char v18; // zf@37 +int v19; // eax@41 +int v20; // eax@46 +int v21; // ecx@46 +int v22; // eax@46 +int v23; // [sp-4h] [bp-2Ch]@28 +RECT pSrcXYZW; // [sp+Ch] [bp-1Ch]@6 +POINT pTargetXY; // [sp+1Ch] [bp-Ch]@20 +int v26; // [sp+24h] [bp-4h]@1 + +v26 = a1; +if ( amuint_4FAA4C != -1 ) + { + if ( amuint_4FAA38 >= 9 ) + { + am_uint_4FAA44_blt_xy.y = 18; + am_uint_4FAA44_blt_xy.x = 120; + v1 = GetPlayerHandCardCount(current_player_num); + v2 = (640 - 96 * v1) / v1 + 96; + if ( am_byte_4E185D ) + { + // v3 = 188 * current_player_num + 8 * amuint_4FAA4C; + // amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 + *(am_Players[0].arr_6C[0] + v3) - 120) / 10; + amuint_4FAA3C_blt_xy.x=(amuint_4FAA4C * v2 + am_Players[current_player_num].arr_6C[amuint_4FAA4C].field_0-120)/10; + v4 = (am_Players[current_player_num].arr_6C[amuint_4FAA4C].field_4+309) /10;//(*(&am_Players[0].arr_6C[0][1] + v3) + 309) / 10; + } + else + { + amuint_4FAA3C_blt_xy.x = (amuint_4FAA4C * v2 - 120) / 10; + v4 = 30; + } + am_uint_4FAA44_blt_xy.y += v4; + am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; + pSrcXYZW.top = 0; + amuint_4FAA3C_blt_xy.y = v4; + pSrcXYZW.left = 192; + pSrcXYZW.right = 288; + pSrcXYZW.bottom = 128; + v5 = &am_uint_4FAA44_blt_xy; + v6 = &pSrcXYZW; + Blt_Copy(v6, v5, 2); + goto LABEL_11; + } + pSrcXYZW.top = 0; + v6 = &pSrcXYZW; + v5 = &am_uint_4FAA44_blt_xy; + pSrcXYZW.bottom = 128; + pSrcXYZW.right = 288; + pSrcXYZW.left = 192; + if ( amuint_4FAA38 ) + { + am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; + am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y; + Blt_Copy(v6, v5, 2); + goto LABEL_11; + } + am_uint_4FAA44_blt_xy.x += amuint_4FAA3C_blt_xy.x; + am_uint_4FAA44_blt_xy.y += amuint_4FAA3C_blt_xy.y; + Blt_Copy(&pSrcXYZW, &am_uint_4FAA44_blt_xy, 2); + amuint_4FAA4C = -1; + } +LABEL_11: +v7 = shown_cards; +if ( uCardID != -1 ) + { + if ( v26 <= 10 ) + { + if ( v26 == 10 ) + { + pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); + // v8 = 0; + for (v8=0; v8<10; ++v8) + { + if (shown_cards[v8].uCardId==-1) + { + shown_cards[v8].uCardId = uCardID; + shown_cards[v8].field_4 = 1; + break; + } + } + /* v9 = shown_cards; + while ( v9->uCardId != -1 ) + { + ++v9; + ++v8; + if ( v9 >= &dword_4FABB8 ) + goto LABEL_20; + } + + v10 = v8; + shown_cards[v10].uCardId = uCardID; + shown_cards[v10].field_4 = 1;*/ +//LABEL_20: + pTargetXY.x = shown_cards[v8].field_8.x; + pTargetXY.y = shown_cards[v8].field_8.y; + Blt_Copy(&pSrcXYZW, &pTargetXY, 0); + uCardID = -1; + } + } + else + { + pArcomageGame->GetCardRect(uCardID, &pSrcXYZW); + amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; + amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; + Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); + } + } +v14 = played_card_id; +if ( played_card_id != -1 ) + { + v15 = v26; + if ( v15 > 15.0 ) + { + pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); + v16 = &amuint_4FAA5C_blt_xy; + amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; + amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; + Blt_Copy(&pSrcXYZW, v16, 2); + return; + } + if ( v15 == 15.0 ) + { + am_40BF77(current_player_num, played_card_id); + pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); + pTargetXY.x = 272; + pTargetXY.y = 173; + Blt_Copy(&pSrcXYZW, &pTargetXY, 2); + return; + } + if ( v15 == 5.0 ) + { + amuint_4FAA5C_blt_xy.x = 272; + amuint_4FAA5C_blt_xy.y = 173; + for (v17=0; v17<10; ++v17) + { + if (shown_cards[v17].uCardId==-1) + break; + } + /* v17 = 0; + do + { + if ( v7->uCardId == -1 ) + break; + ++v7; + ++v17; + } + while ( v7 < &dword_4FABB8 );*/ + // v26 = 32 * v17; + + amuint_4FAA54_blt_xy.x = (shown_cards[v17].field_8.x - 272) / 5; + amuint_4FAA54_blt_xy.y = (shown_cards[v17].field_8.y - 173) / 5; + pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); + pTargetXY.x = 272; + pTargetXY.y = 173; + Blt_Copy(&pSrcXYZW, &pTargetXY, 2); + return; + } + if ( v15 >= 5.0 ) + { + v18 = v26 == 0; + } + else + { + v18 = v26 == 0; + if ( v26 > 0 ) + { + pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); + amuint_4FAA5C_blt_xy.x += amuint_4FAA54_blt_xy.x; + amuint_4FAA5C_blt_xy.y += amuint_4FAA54_blt_xy.y; + Blt_Copy(&pSrcXYZW, &amuint_4FAA5C_blt_xy, 0); + return; + } + } + if ( !v18 ) + { + + pArcomageGame->GetCardRect(v14, &pSrcXYZW); + pTargetXY.x = 272; + pTargetXY.y = 173; + Blt_Copy(&pSrcXYZW, &pTargetXY, 2); + return; + } + pArcomageGame->GetCardRect(played_card_id, &pSrcXYZW); + for (v19=0; v19<10; ++v19) + { + if (shown_cards[v19].uCardId==-1) + { + shown_cards[v19].uCardId = played_card_id; + break; + } + + } + /* v19 = 0; + while ( v7->uCardId != -1 ) + { + ++v7; + ++v19; + if ( v7 >= &dword_4FABB8 ) + goto LABEL_46; + } + shown_cards[v19].uCardId = played_card_id; + LABEL_46:*/ + + pTargetXY.x = shown_cards[v19].field_8.x; + pTargetXY.y = shown_cards[v19].field_8.y; + Blt_Copy(&pSrcXYZW, &pTargetXY, 0); + played_card_id = -1; + } + + // int v1; // eax@3 // int v2; // eax@3 // int v3; // esi@4 @@ -3342,9 +3577,8 @@ int i; if ( card_slot_index <= -1 ) - return 0; + return false; v2 = 0; - v3 = 0; for(i=0; i<10; ++i) { @@ -3358,42 +3592,32 @@ if ( pCards[am_Players[player_num].cards_at_hand[i]].field_2B) { - ArcomageGame::PlaySound(0x16u); - v7 = current_player_num; + ArcomageGame::PlaySound(22); v8 = GetPlayerHandCardCount(current_player_num); - v9 = 188 * v7 + 8 * v3; -// v10 = 96 * v3 + *(int *)((char *)am_Players[0].arr_6C[0] + v9) + (640 - 96 * v8) / (v8 + 1); - // v11 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v9) + 327; - amuint_4FAA5C_blt_xy[0] = v10; - amuint_4FAA5C_blt_xy[1] = v11; + v10=am_Players[player_num].arr_6C[i].field_0 + (640 - 96 * v8) / (v8 + 1); + amuint_4FAA5C_blt_xy.x = v10; + amuint_4FAA5C_blt_xy.y = am_Players[player_num].arr_6C[i].field_4 + 327;//v11; v12 = 0; + if ( !am_byte_4FAA75 ) { - v13 = (signed int)amuint_4FAA78.data(); - do - { - if ( *(unsigned int *)v13 == -1 ) - break; - v13 += 32; - ++v12; - } - while ( v13 < (signed int)&dword_4FABB8 ); + for (v12=0; v12<10; ++v12) + { + if (shown_cards[v12].uCardId== -1) + break; + } } pArcomageGame->field_F6 = 1; - amuint_4FAA54_blt_xy[0] = (amuint_4FAA80[8 * v12] - v10) / 10; - amuint_4FAA54_blt_xy[1] = (amuint_4FAA84[8 * v12] - 327) / 10; - v14 = *(unsigned int *)v6; - *(unsigned int *)v6 = -1; + amuint_4FAA54_blt_xy.x = (shown_cards[v12].field_8.x - v10) / 10; + amuint_4FAA54_blt_xy.y = (shown_cards[v12].field_8.y - 327) / 10; + + uCardID = am_Players[player_num].cards_at_hand[i]; + am_Players[player_num].cards_at_hand[i] = -1; am_byte_4FAA77 = 0; - uCardID = v14; - result = 1; + return true; } else - { - - result = 0; - } - return result; + return false; } // 4FAA75: using guessed type char am_byte_4FAA75; // 4FAA77: using guessed type char am_byte_4FAA77; @@ -3421,42 +3645,35 @@ int v15; // ecx@8 int v16; // ecx@8 - v3 = player_num; if ( card_slot_num <= -1 ) return false; v4 = 0; - v5 = &am_Players[v3]; - v6 = 0; - v7 = (int)v5->cards_at_hand; - do + + for (v6=0; v6<10; ++v6) { - if ( *(unsigned int *)v7 != -1 ) + if ( am_Players[player_num].cards_at_hand[v6] != -1 ) { if ( card_slot_num == v4 ) break; ++v4; } - ++v6; - v7 += 4; } - while ( v6 < 10 ); + result = CanCardBePlayed(player_num, v6); if ( result ) { - ArcomageGame::PlaySound(0x17u); - v8 = current_player_num; + ArcomageGame::PlaySound(23); v9 = GetPlayerHandCardCount(current_player_num); - v10 = 188 * v8 + 8 * v6; - v11 = v6 + 47 * v3; - + // v10 = 188 * v8 + 8 * v6; + // v11 = v6 + 47 * v3; pArcomageGame->field_F6 = 1; //v12 = 96 * v6 + *(int *)((char *)am_Players[0].arr_6C[0] + v10) + (640 - 96 * v9) / (v9 + 1); // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327; - amuint_4FAA5C_blt_xy[0] = v12; - amuint_4FAA5C_blt_xy[1] = v13; - - amuint_4FAA54_blt_xy[0] = (272 - v12) / 5; - amuint_4FAA54_blt_xy[1] = -30; + amuint_4FAA5C_blt_xy.x = am_Players[player_num].arr_6C[v6].field_0 + (640 - 96 * v9) / (v9 + 1);//v12; + amuint_4FAA5C_blt_xy.y = am_Players[player_num].arr_6C[v6].field_4 + 327;//v13; + + amuint_4FAA54_blt_xy.x = (272 - v12) / 5; + amuint_4FAA54_blt_xy.y = -30; v14 = &pCards[v5->cards_at_hand[v6]]; v5->resource_bricks -= v14->needed_bricks; @@ -5549,14 +5766,17 @@ { result = a2; v2->wall_height = a2 + v3; - goto LABEL_7; + } + else + { a2 += v3; result = -v3; v2->wall_height = 0; + v2->tower_height += a2; + } } - v2->tower_height += a2; -LABEL_7: + if ( v2->tower_height < 0 ) v2->tower_height = 0; return result; @@ -5588,7 +5808,7 @@ //nullsub_1(); xy[0] = 0; xy[1] = 0; - inv_strcpy("Победи", pText); + // inv_strcpy("Победи", pText); v2 = 0; xy[1] = 160; xy[0] = 320 - 12 * v2 / 2; @@ -5956,17 +6176,6 @@ return a + rand() % (b - a + 1); } -//----- (0040DEB4) -------------------------------------------------------- -char *__fastcall inv_strcat(const char *Source, char *Dest) - { - return strcat(Dest, Source); - } - -//----- (0040DEBE) -------------------------------------------------------- -char *__fastcall inv_strcpy(const char *Source, char *Dest) - { - return strcpy(Dest, Source); - } //----- (0040DEC8) -------------------------------------------------------- void __fastcall intToString(int val, char *pOut) diff -r 0d6c7ff3cddd -r 68655becb94b GUIWindow.cpp --- a/GUIWindow.cpp Sun Jun 09 16:06:12 2013 +0200 +++ b/GUIWindow.cpp Sun Jun 09 16:27:57 2013 +0200 @@ -159,34 +159,19 @@ v1 = toupper(uHotkey); v2 = uNumVisibleWindows; v3 = v1; - if ( uNumVisibleWindows >= 0 ) + for( v2 = uNumVisibleWindows; v2 >= 0 && pVisibleWindowsIdxs[v2] > 0; v2-- ) { - while ( 2 ) - { - v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; - for ( result = v4->pControlsHead; result; result = result->pNext ) - { - if ( result->uHotkey == v3 ) - { - pMessageQueue_50CBD0->AddMessage(result->msg, result->msg_param, 0); - /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; - *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - return result; - } - } - if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 && v4->uFrameHeight == 480) ) - { - --v2; - if ( v2 >= 0 ) - continue; - } - break; - } + v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; + for ( result = v4->pControlsHead; result; result = result->pNext ) + { + if ( result->uHotkey == v3 ) + { + pMessageQueue_50CBD0->AddMessage(result->msg, result->msg_param, 0); + return result; + } + } + if ( !v4->uFrameX && !v4->uFrameY && (v4->uFrameWidth == 640 && v4->uFrameHeight == 480) ) + break; } return 0; } @@ -1036,11 +1021,11 @@ pWindow.DrawTitleText(pFontCreate, 0x1E3u, 113, pColor2, pTitleText, 3); continue; } - pTitleText = HouseNPCData[v8 - (dword_591080 != 0)]->pName; - v9 = pNPCPortraits_x[6 + (uNumDialogueNPCPortraits - 1)][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; + pTitleText = HouseNPCData[v8 +1 - (dword_591080 != 0)]->pName; + v9 = pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v8] + pDialogueNPCPortraits[v8]->uTextureHeight + 2; } v10 = v9; - pWindow.DrawTitleText(pFontCreate, 0x1E3u, v10, pColor2, pTitleText, 3); + pWindow.DrawTitleText(pFontCreate, 483, v10, pColor2, pTitleText, 3); } } if ( pDialogueNPCCount == uNumDialogueNPCPortraits && uHouse_ExitPic ) @@ -1842,15 +1827,12 @@ if (eWindowType == WINDOW_HouseInterior) { pCurrentScreen = SCREEN_HOUSE; - pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания + pBtn_ExitCancel = pWindow->CreateButton(471, 445, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[80],//Выйти из здания pIcons_LOD->GetTexture(uExitCancelTextureId), 0); - v25 = uNumDialogueNPCPortraits; - v26 = 0; - if ( uNumDialogueNPCPortraits > 0 ) - { + for ( v26 = 0; v26 < uNumDialogueNPCPortraits; ++v26 ) { - if ( v26 + 1 == v25 && uHouse_ExitPic ) + if ( v26 + 1 == uNumDialogueNPCPortraits && uHouse_ExitPic ) { v30 = pMapStats->pInfos[uHouse_ExitPic].pName; v29 = (char*)pGlobalTXT_LocalizationStrings[LOCSTR_ENTER_S]; @@ -1858,21 +1840,19 @@ else { if ( v26 || !dword_591080 ) - v27 = HouseNPCData[v26 - (dword_591080 != 0)]->pName; + v27 = HouseNPCData[v26 +1 - (dword_591080 != 0)]->pName; else - //v27 = (char *)p2DEvents_minus1_::08[13 * a4]; v27 = (char *)p2DEvents[pButton - 1].pProprieterName; v30 = v27; v29 = (char*)pGlobalTXT_LocalizationStrings[435]; } sprintfex(byte_591180[v26].data(), v29, v30); - HouseNPCData[v26 + 7] = (NPCData *)pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], + dword_5913F4[v26] = pWindow->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][v26], pNPCPortraits_y[uNumDialogueNPCPortraits - 1][v26], 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v26, 0, byte_591180[v26].data(), 0, 0, 0); - v25 = uNumDialogueNPCPortraits; } - } - if ( v25 == 1 ) + + if ( uNumDialogueNPCPortraits == 1 ) { window_SpeakInHouse = &pWindowList[uNextFreeWindowID]; _4B4224_UpdateNPCTopics(0); diff -r 0d6c7ff3cddd -r 68655becb94b UIHouses.cpp --- a/UIHouses.cpp Sun Jun 09 16:06:12 2013 +0200 +++ b/UIHouses.cpp Sun Jun 09 16:27:57 2013 +0200 @@ -336,110 +336,71 @@ //int v11; // ecx@19 //char pContainer[36]; // [sp+Ch] [bp-54h]@16 int v13; // [sp+30h] [bp-30h]@11 - int Dst[6]; // [sp+34h] [bp-2Ch]@1 + int npc_id_arr[6]; // [sp+34h] [bp-2Ch]@1 //unsigned int v15; // [sp+4Ch] [bp-14h]@1 int uAnimationID; // [sp+50h] [bp-10h]@1 //unsigned int *v17; // [sp+54h] [bp-Ch]@3 //unsigned int v18; // [sp+58h] [bp-8h]@1 //int v19; // [sp+5Ch] [bp-4h]@7 - //v15 = uHouseID; - //v1 = 52 * uHouseID; - //uAnimationID = p2DEvents_minus1___02[26 * uHouseID]; + uAnimationID = p2DEvents[house - 1].uAnimationID; - //v18 = 52 * uHouseID; - memset(Dst, 0, 0x18u); - //uExitPic = *(__int16 *)((char *)p2DEvents_minus1_::2C + v1); - //uExitPic = p2DEvents[uHouseID - 1].uExitPicID; + memset(npc_id_arr, 0, sizeof(npc_id_arr)); uNumDialogueNPCPortraits = 0; uHouse_ExitPic = p2DEvents[house - 1].uExitPicID; if ( uHouse_ExitPic ) { - //uExitMapID = *(__int16 *)((char *)p2DEvents_minus1_::30 + v1); uExitMapID = p2DEvents[house - 1]._quest_related; if ( uExitMapID > 0 ) { - //v17 = (unsigned int *)(uExitMapID - 1); if(_449B57_test_bit(pParty->_quest_bits,uExitMapID)) - // if ( !((unsigned __int8)(0x80u >> (uExitMapID - 1) % 8) & pParty->_quest_bits[(uExitMapID - 1) >> 3]) ) { - //uExitPic = 0; uHouse_ExitPic = 0; } } } - dword_591080 = pAnimatedRooms[uAnimationID].field_8; - //result = dword_591080; - - //v2 = 0; + dword_591080 = pAnimatedRooms[uAnimationID].house_npc_id; + HouseNPCData[0]=0; uNumDialogueNPCPortraits = 0; if ( dword_591080 ) { - //v2 = 1; - Dst[0] = dword_591080; + + npc_id_arr[0] = dword_591080; uNumDialogueNPCPortraits = 1; } - //v19 = 1; - for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) + for (uint i = 1; i < pNPCStats->uNumNewNPCs; ++i) { - auto npc = pNPCStats->pNewNPCData + i; - //v6 = &pNPCStats->pNewNPCData[1].uFlags; - //v17 = &pNPCStats->pNewNPCData[1].uFlags; - //do - //{ - if (npc->Location2D == house ) + if (pNPCStats->pNewNPCData[i].Location2D == house ) { - if (~npc->uFlags & 0x80) - //if ( !(*(char *)v6 & 0x80) ) + if (!(pNPCStats->pNewNPCData[i].uFlags & 0x80)) { - v7 = uNumDialogueNPCPortraits++ - (dword_591080 != 0) ? 1 : 0; - HouseNPCData[v7] = npc; - //v6 = v17; - //*(&v13 + v2) = *(v17 - 1); - Dst[uNumDialogueNPCPortraits - 1] = npc->uPortraitID; - //v1 = v18; - if ((npc->uFlags & 3) != 2) - ++npc->uFlags; + + HouseNPCData[uNumDialogueNPCPortraits+1- (dword_591080 != 0) ? 1 : 0] = &pNPCStats->pNewNPCData[i]; + npc_id_arr[uNumDialogueNPCPortraits] = pNPCStats->pNewNPCData[i].uPortraitID; + ++uNumDialogueNPCPortraits; + if ((pNPCStats->pNewNPCData[i].uFlags & 3) != 2) + ++pNPCStats->pNewNPCData[i].uFlags; } } - //++v19; - //v6 += 19; - //v17 = v6; - //} - //while ( v19 < (signed int)pNPCStats->uNumNewNPCs ); + } - //uNumDialogueNPCPortraits = v2; - //v19 = 0; for (uint i = 0; i < uNumDialogueNPCPortraits; ++i) - //if ( v2 > 0 ) { - //do - //{ - //v8 = v19; + char icon_name[128]; - sprintfex(icon_name, "npc%03u", Dst[i]); - //v9 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); - //++v19; + sprintfex(icon_name, "npc%03u", npc_id_arr[i]); pDialogueNPCPortraits[i] = pIcons_LOD->LoadTexturePtr(icon_name, TEXTURE_16BIT_PALETTE); - //result = v19; - //} - //while ( v19 < uNumDialogueNPCPortraits ); - //uExitPic = uHouse_ExitPic; } if (uHouse_ExitPic) { - //v10 = pIcons_LOD->LoadTexture(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE); - //v11 = uNumDialogueNPCPortraits++; - pDialogueNPCPortraits[uNumDialogueNPCPortraits++] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE); - //result = *(__int16 *)((char *)p2DEvents_minus1_::2E + v1); - //result = p2DEvents[house - 1].uExitMapID; + pDialogueNPCPortraits[uNumDialogueNPCPortraits] = pIcons_LOD->LoadTexturePtr(pHouse_ExitPictures[uHouse_ExitPic], TEXTURE_16BIT_PALETTE); + ++uNumDialogueNPCPortraits; uHouse_ExitPic = p2DEvents[house - 1].uExitMapID; } - //return result; } @@ -6090,3 +6051,212 @@ } return; } + + +//----- (004B6478) -------------------------------------------------------- +void sub_4B6478() + { + GUIWindow *v0; // ebx@1 + Player *v1; // edi@1 + unsigned int v2; // eax@1 + signed int v3; // esi@1 + int v4; // ebx@1 + unsigned int v5; // esi@5 + int v6; // edi@6 + int result; // eax@13 + GUIWindow *v8; // ebx@17 + int v9; // eax@17 + int v10; // ecx@17 + unsigned int v11; // ecx@18 + int v12; // eax@20 + int v13; // eax@21 + GUIButton *v14; // esi@27 + int v15; // ecx@27 + unsigned int v16; // eax@28 + const char *v17; // ebx@29 + int v18; // eax@29 + unsigned int v19; // ecx@29 + int v20; // eax@29 + unsigned __int16 v21; // ax@29 + unsigned __int16 v22; // ST14_2@36 + int v23; // eax@36 + const char *v24; // ST18_4@37 + unsigned __int16 v25; // ST14_2@37 + int v26; // eax@37 + int v27; // [sp-4h] [bp-80h]@8 + GUIWindow v28; // [sp+Ch] [bp-70h]@1 + GUIWindow *v29; // [sp+60h] [bp-1Ch]@17 + unsigned int v30; // [sp+64h] [bp-18h]@1 + int v31; // [sp+68h] [bp-14h]@1 + int v32; // [sp+6Ch] [bp-10h]@1 + int v33; // [sp+70h] [bp-Ch]@17 + int v34; // [sp+74h] [bp-8h]@17 + int v35; // [sp+78h] [bp-4h]@17 + + v0 = window_SpeakInHouse; + memcpy(&v28, window_SpeakInHouse, sizeof(v28)); + v1 = pPlayers[uActiveCharacter]; + v28.uFrameX = 483; + v28.uFrameWidth = 148; + v28.uFrameZ = 334; + v30 = TargetColor(0xFFu, 0xFFu, 0xFFu); + v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu); + v2 = 52 * (unsigned int)v0->ptr_1C; + //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100; + v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100; + //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]); + v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); + v4 = v3 * (100 - v1->GetMerchant()) / 100; + v32 = v4; + if ( v4 < v3 / 3 ) + { + v4 = v3 / 3; + v32 = v3 / 3; + } + if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN) + { + if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + { + v5 = 0; + + __debugbreak(); + //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] + // or + //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] + // or + //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] + __debugbreak(); // whacky condition - fix + if (false + //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) + || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) ) + { + pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); + } + else + { + if ( pParty->uNumGold < v4 ) + { + ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); + v27 = 4; + } + else + { + Party::TakeGold(v4); + *(short *)v6 = 1; + v27 = 2; + } + PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27); + } + } + else + { + v5 = 0; + } + /*result = pMessageQueue_50CBD0->uNumMessages; + if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) + { + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; + pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; + result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; + *(&pMessageQueue_50CBD0->uNumMessages + result) = v5; + ++pMessageQueue_50CBD0->uNumMessages; + }*/ + pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5); + return; // void func + } + if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) + { + v24 = pNPCTopics[171].pText; + v25 = v31; + v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0); + v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u); + pDialogueWindow->pNumPresenceButton = 0; + return ; + } + + if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) + return; + v8 = pDialogueWindow; + v33 = 0; + v34 = 0; + v29 = pDialogueWindow; + v9 = pDialogueWindow->pStartingPosActiveItem; + v10 = v9 + pDialogueWindow->pNumPresenceButton; + v35 = pDialogueWindow->pStartingPosActiveItem; + if ( v9 >= v10 ) + goto LABEL_40; + do + { + v11 = v8->GetControl(v35)->msg_param - 36; + if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] ) + { + v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0); + v33 += v12; + ++v34; + } + v13 = v8->pStartingPosActiveItem; + ++v35; + } + while ( v35 < v8->pNumPresenceButton + v13 ); + if ( !v34 ) + { +LABEL_40: + sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]); + strcat(pTmpBuf.data(), "\n \n"); + strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); + v22 = v31; + v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0); + v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u); + return; + } + sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32); + v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u); + v32 = (149 - v33) / v34; + if ( (149 - v33) / v34 > 32 ) + v32 = 32; + + v35 = v8->pStartingPosActiveItem; + v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162; + if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton ) + { + v33 = 2; + do + { + v14 = v8->GetControl(v35); + v15 = v14->msg_param - 36; + if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] ) + { + v16 = 0; + if ( !v1->pActiveSkills[v15] ) + { + v17 = pSkillNames[v15]; + v14->uY = v32 + v34; + v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0); + v19 = v14->uY; + v14->uHeight = v18; + v20 = v19 + v18 - 1; + v14->uW = v20; + v34 = v20; + v21 = v31; + if ( pDialogueWindow->pCurrentPosActiveItem != v33 ) + v21 = v30; + v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u); + goto LABEL_34; + } + } + else + { + v16 = 0; + } + v14->uW = v16; + v14->uHeight = v16; + v14->uY = v16; +LABEL_34: + v8 = v29; + ++v35; + ++v33; + } + while ( v35 pNumPresenceButton + v29->pStartingPosActiveItem ); + } + return; +} \ No newline at end of file diff -r 0d6c7ff3cddd -r 68655becb94b mm7_2.cpp --- a/mm7_2.cpp Sun Jun 09 16:06:12 2013 +0200 +++ b/mm7_2.cpp Sun Jun 09 16:27:57 2013 +0200 @@ -879,7 +879,7 @@ //v3 = byte_591180; do { - HouseNPCData[v2 + 7] = (NPCData *)window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2], + dword_5913F4[v2] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[v1 - 1][v2], pNPCPortraits_y[v1 - 1][v2], 0x3Fu, 0x49u, 1, 0, UIMSG_ClickHouseNPCPortrait, v2, 0, byte_591180[v2].data(), 0, 0, 0); v1 = uNumDialogueNPCPortraits; ++v2; diff -r 0d6c7ff3cddd -r 68655becb94b mm7_4.cpp --- a/mm7_4.cpp Sun Jun 09 16:06:12 2013 +0200 +++ b/mm7_4.cpp Sun Jun 09 16:27:57 2013 +0200 @@ -3373,7 +3373,7 @@ if ( dword_5C35D4 ) { //__debugbreak(); // fix - npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; + npc = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0))]; //- 1 } else npc = GetNPCData(sDialogue_SpeakingActorNPC_ID); @@ -6467,7 +6467,7 @@ //int v25; // [sp-4h] [bp-10h]@49 uDialogueType = uMessageParam + 1; - pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; + pCurrentNPCInfo = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1 if ( uMessageParam <= 24 ) { switch ( uMessageParam ) @@ -7209,7 +7209,7 @@ } a1.uFrameWidth -= 10; a1.uFrameZ -= 10; - v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; + v58 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1 v6 = v58; v55 = TargetColor(0xE1u, 0xCDu, 0x23u); v7 = TargetColor(0x15u, 0x99u, 0xE9u); @@ -7763,7 +7763,7 @@ NPCData *v1; // edi@1 v0 = 0; - v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) - 1)]; + v1 = HouseNPCData[(unsigned int)((char *)pDialogueNPCCount + -(dword_591080 != 0) )];//- 1 pDialogueWindow->Release(); pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x15Eu, WINDOW_MainMenu, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton( 0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, @@ -7811,7 +7811,7 @@ } else { - v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) + 1)]; + v17 = HouseNPCData[_this + 1 - ((dword_591080 != 0) )];//+ 1 if ( dialog_menu_id == HOUSE_DIALOGUE_OTHER ) { pDialogueWindow->Release(); @@ -7819,7 +7819,7 @@ else { for ( i = 0; i < uNumDialogueNPCPortraits; ++i ) - ((GUIButton *)HouseNPCData[i + 7])->Release(); + dword_5913F4[i]->Release(); } pDialogueWindow = GUIWindow::Create(0, 0, 640, 0x159u, WINDOW_MainMenu, 0, 0); pBtn_ExitCancel = pDialogueWindow->CreateButton( 471u, 445u, 169u, 35u, 1, 0, UIMSG_Escape, 0, 0, @@ -8240,213 +8240,7 @@ */ } -//----- (004B6478) -------------------------------------------------------- -void sub_4B6478() - { - GUIWindow *v0; // ebx@1 - Player *v1; // edi@1 - unsigned int v2; // eax@1 - signed int v3; // esi@1 - int v4; // ebx@1 - unsigned int v5; // esi@5 - int v6; // edi@6 - int result; // eax@13 - GUIWindow *v8; // ebx@17 - int v9; // eax@17 - int v10; // ecx@17 - unsigned int v11; // ecx@18 - int v12; // eax@20 - int v13; // eax@21 - GUIButton *v14; // esi@27 - int v15; // ecx@27 - unsigned int v16; // eax@28 - const char *v17; // ebx@29 - int v18; // eax@29 - unsigned int v19; // ecx@29 - int v20; // eax@29 - unsigned __int16 v21; // ax@29 - unsigned __int16 v22; // ST14_2@36 - int v23; // eax@36 - const char *v24; // ST18_4@37 - unsigned __int16 v25; // ST14_2@37 - int v26; // eax@37 - int v27; // [sp-4h] [bp-80h]@8 - GUIWindow v28; // [sp+Ch] [bp-70h]@1 - GUIWindow *v29; // [sp+60h] [bp-1Ch]@17 - unsigned int v30; // [sp+64h] [bp-18h]@1 - int v31; // [sp+68h] [bp-14h]@1 - int v32; // [sp+6Ch] [bp-10h]@1 - int v33; // [sp+70h] [bp-Ch]@17 - int v34; // [sp+74h] [bp-8h]@17 - int v35; // [sp+78h] [bp-4h]@17 - - v0 = window_SpeakInHouse; - memcpy(&v28, window_SpeakInHouse, sizeof(v28)); - v1 = pPlayers[uActiveCharacter]; - v28.uFrameX = 483; - v28.uFrameWidth = 148; - v28.uFrameZ = 334; - v30 = TargetColor(0xFFu, 0xFFu, 0xFFu); - v31 = TargetColor(0xFFu, 0xFFu, 0x9Bu); - v2 = 52 * (unsigned int)v0->ptr_1C; - //v32 = (unsigned __int8)(((p2DEvents_minus1___00[v2 / 2] != 18) - 1) & 0x96) + 100; - v32 = (unsigned __int8)(((p2DEvents[(unsigned int)v0->ptr_1C - 1].uType != 18) - 1) & 0x96) + 100; - //v3 = (signed __int64)((double)v32 * p2DEvents_minus1__20[v2 / 4]); - v3 = (signed __int64)((double)v32 * p2DEvents[(unsigned int)v0->ptr_1C - 1].fPriceMultiplier); - v4 = v3 * (100 - v1->GetMerchant()) / 100; - v32 = v4; - if ( v4 < v3 / 3 ) - { - v4 = v3 / 3; - v32 = v3 / 3; - } - if ( dialog_menu_id != HOUSE_DIALOGUE_MAIN) - { - if ( sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) - { - v5 = 0; - - __debugbreak(); - //pSkillAvailabilityPerClass[8 + v58->uClass][4 + v23] - // or - //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass][v23 - 36] - // or - //byte_4ED970_skill_learn_ability_by_class_table[v58->uClass - 1][v23 + 1] - __debugbreak(); // whacky condition - fix - if (false - //if ( !*(&byte_4ED94C[37 * v1->uClass / 3] + dword_F8B19C) - || (v6 = (int)(&v1->uIntelligence + dialog_menu_id), *(short *)v6) ) - { - pAudioPlayer->PlaySound(SOUND_27, 0, 0, -1, 0, 0, 0, 0); - } - else - { - if ( pParty->uNumGold < v4 ) - { - ShowStatusBarString(pGlobalTXT_LocalizationStrings[155], 2u); - v27 = 4; - } - else - { - Party::TakeGold(v4); - *(short *)v6 = 1; - v27 = 2; - } - PlayHouseSound((unsigned int)window_SpeakInHouse->ptr_1C, (HouseSoundID)v27); - } - } - else - { - v5 = 0; - } - /*result = pMessageQueue_50CBD0->uNumMessages; - if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) - { - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; - pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; - result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; - *(&pMessageQueue_50CBD0->uNumMessages + result) = v5; - ++pMessageQueue_50CBD0->uNumMessages; - }*/ - pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, v5); - return; // void func - } - if ( !(unsigned __int16)_449B57_test_bit((unsigned __int8 *)v1->_guilds_member_bits, word_4F0754[2 * (unsigned int)window_SpeakInHouse->ptr_1C]) ) - { - v24 = pNPCTopics[171].pText; - v25 = v31; - v26 = pFontArrus->CalcTextHeight(pNPCTopics[171].pText, &v28, 0, 0); - v28.DrawTitleText(pFontArrus, 0, (212 - v26) / 2 + 101, v25, v24, 3u); - pDialogueWindow->pNumPresenceButton = 0; - return ; - } - - if ( !sub_4B1784_check_if_player_concious__draw_warning_else_mess_with_dlg_win() ) - return; - v8 = pDialogueWindow; - v33 = 0; - v34 = 0; - v29 = pDialogueWindow; - v9 = pDialogueWindow->pStartingPosActiveItem; - v10 = v9 + pDialogueWindow->pNumPresenceButton; - v35 = pDialogueWindow->pStartingPosActiveItem; - if ( v9 >= v10 ) - goto LABEL_40; - do - { - v11 = v8->GetControl(v35)->msg_param - 36; - if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v11] && !v1->pActiveSkills[v11] ) - { - v12 = pFontArrus->CalcTextHeight(pSkillNames[v11], &v28, 0, 0); - v33 += v12; - ++v34; - } - v13 = v8->pStartingPosActiveItem; - ++v35; - } - while ( v35 < v8->pNumPresenceButton + v13 ); - if ( !v34 ) - { -LABEL_40: - sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[544], v1->pName, pClassNames[v1->classType]); - strcat(pTmpBuf.data(), "\n \n"); - strcat(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[528]); - v22 = v31; - v23 = pFontArrus->CalcTextHeight(pTmpBuf.data(), &v28, 0, 0); - v28.DrawTitleText(pFontArrus, 0, (174 - v23) / 2 + 138, v22, pTmpBuf.data(), 3u); - return; - } - sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[401], v32); - v28.DrawTitleText(pFontArrus, 0, 0x92u, 0, pTmpBuf.data(), 3u); - v32 = (149 - v33) / v34; - if ( (149 - v33) / v34 > 32 ) - v32 = 32; - - v35 = v8->pStartingPosActiveItem; - v34 = (149 - v34 * v32 - v33) / 2 - v32 / 2 + 162; - if ( v8->pStartingPosActiveItem < v8->pStartingPosActiveItem+ v8->pNumPresenceButton ) - { - v33 = 2; - do - { - v14 = v8->GetControl(v35); - v15 = v14->msg_param - 36; - if ( byte_4ED970_skill_learn_ability_by_class_table[v1->classType / 3][v15] ) - { - v16 = 0; - if ( !v1->pActiveSkills[v15] ) - { - v17 = pSkillNames[v15]; - v14->uY = v32 + v34; - v18 = pFontArrus->CalcTextHeight(v17, &v28, 0, 0); - v19 = v14->uY; - v14->uHeight = v18; - v20 = v19 + v18 - 1; - v14->uW = v20; - v34 = v20; - v21 = v31; - if ( pDialogueWindow->pCurrentPosActiveItem != v33 ) - v21 = v30; - v28.DrawTitleText(pFontArrus, 0, v19, v21, v17, 3u); - goto LABEL_34; - } - } - else - { - v16 = 0; - } - v14->uW = v16; - v14->uHeight = v16; - v14->uY = v16; -LABEL_34: - v8 = v29; - ++v35; - ++v33; - } - while ( v35 pNumPresenceButton + v29->pStartingPosActiveItem ); - } - return; -} + //----- (00405CFF) -------------------------------------------------------- void stru262_TurnBased::End(bool bPlaySound) diff -r 0d6c7ff3cddd -r 68655becb94b mm7_data.cpp --- a/mm7_data.cpp Sun Jun 09 16:06:12 2013 +0200 +++ b/mm7_data.cpp Sun Jun 09 16:27:57 2013 +0200 @@ -904,12 +904,10 @@ char byte_4FAA2E; // weak int amuint_4FAA34; // weak int amuint_4FAA38; // weak -int amuint_4FAA3C_blt_xy[2]; -int am_uint_4FAA44_blt_xy[2]; + int amuint_4FAA4C; // weak -unsigned int uCardID; // idb -std::array amuint_4FAA54_blt_xy; -std::array amuint_4FAA5C_blt_xy; + + int dword_4FAA64; // weak int dword_4FAA68; // weak @@ -918,14 +916,13 @@ char am_byte_4FAA75; // weak char am_byte_4FAA76; // weak -std::array amuint_4FAA78; // weak + char am_byte_4FAA7C[777]; // weak -std::array amuint_4FAA80; // weak -std::array amuint_4FAA84; // weak + int amuint_4FAA88[777]; // weak int amuint_4FAA8C[777]; // weak int amuint_4FAA90[777][2]; -int dword_4FABB8; // weak + int amuint_4FABC4; // weak @@ -1119,8 +1116,8 @@ int dword_591178_teleporty; // weak int dword_59117C_teleportx; // weak std::array, 6> byte_591180; // idb -std::array HouseNPCData;//array_5913D8 this array size temporarily increased to 60 from 6 to work aroud house overflow - +std::array HouseNPCData;//0 zero element holds standart house npc +GUIButton* dword_5913F4[6]; struct Texture *pTexture_591428; struct Texture *pTexture_outside; // idb struct Texture *pTexture_Dialogue_Background; diff -r 0d6c7ff3cddd -r 68655becb94b mm7_data.h --- a/mm7_data.h Sun Jun 09 16:06:12 2013 +0200 +++ b/mm7_data.h Sun Jun 09 16:27:57 2013 +0200 @@ -543,12 +543,10 @@ extern char byte_4FAA2E; // weak extern int amuint_4FAA34; // weak extern int amuint_4FAA38; // weak -extern int amuint_4FAA3C_blt_xy[2]; -extern int am_uint_4FAA44_blt_xy[2]; + extern int amuint_4FAA4C; // weak -extern unsigned int uCardID; // idb -extern std::array amuint_4FAA54_blt_xy; -extern std::array amuint_4FAA5C_blt_xy; + + extern int dword_4FAA64; // weak extern int dword_4FAA68; // weak @@ -557,14 +555,13 @@ extern char am_byte_4FAA75; // weak extern char am_byte_4FAA76; // weak -extern std::array amuint_4FAA78; // weak + extern char am_byte_4FAA7C[777]; // weak -extern std::array amuint_4FAA80; // weak -extern std::array amuint_4FAA84; // weak + extern int amuint_4FAA88[777]; // weak extern int amuint_4FAA8C[777]; // weak extern int amuint_4FAA90[777][2]; -extern int dword_4FABB8; // weak + extern int amuint_4FABC4; // weak @@ -758,8 +755,8 @@ extern int dword_591178_teleporty; // weak extern int dword_59117C_teleportx; // weak extern std::array, 6> byte_591180; // idb -extern std::array HouseNPCData; //this array size temporarily increased to 60 from 6 to work aroud house overflow - +extern std::array HouseNPCData; //0this array size temporarily increased to 60 from 6 to work aroud house overflow +extern GUIButton* dword_5913F4[6]; extern struct Texture *pTexture_591428; extern struct Texture *pTexture_outside; // idb extern struct Texture *pTexture_Dialogue_Background; diff -r 0d6c7ff3cddd -r 68655becb94b stru159.h --- a/stru159.h Sun Jun 09 16:06:12 2013 +0200 +++ b/stru159.h Sun Jun 09 16:27:57 2013 +0200 @@ -8,7 +8,7 @@ { char *video_name; int field_4; - int field_8; + int house_npc_id; unsigned __int8 uBuildingType; unsigned __int8 uRoomSoundId; unsigned __int16 padding_e;