# HG changeset patch # User Ritor1 # Date 1371268527 -21600 # Node ID 8a196c85818012770d96f1000cf04ac0cf6fdc6a # Parent 21a46b38ca240f5fa8bde2fa56ebc4aa116d318b# Parent 2929c4406d2ca53213e57293091d9ac4b7062b22 Слияние diff -r 21a46b38ca24 -r 8a196c858180 Actor.cpp --- a/Actor.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Actor.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -5,7 +5,7 @@ #include -#include "VideoPlayer.h" +#include "mm7_data.h" #include "DecalBuilder.h" #include "Sprites.h" diff -r 21a46b38ca24 -r 8a196c858180 Allocator.cpp --- a/Allocator.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Allocator.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,7 +4,6 @@ #include #include -#include "OSAPI.h" #include "Allocator.h" diff -r 21a46b38ca24 -r 8a196c858180 Arcomage.cpp --- a/Arcomage.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Arcomage.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -5,7 +5,7 @@ #include #include -#include "LightmapBuilder.h" +#include "Render.h" #include "Arcomage.h" #include "VideoPlayer.h" #include "AudioPlayer.h" @@ -20,41 +20,41 @@ #include "VectorTypes.h" #include "texts.h" #include +#include "mm7_data.h" void SetStartConditions(); - - void SetStartGameData(); void FillPlayerDeck(); void InitalHandsFill(); void GetNextCardFromDeck(int player_num); int GetEmptyCardSlotIndex(int player_num); void IncreaseResourcesInTurn(int player_num); -void __cdecl am_40A383(); -bool IsGameOver(); -char __thiscall am_40A560(unsigned int _this); -void DrawGameUI(int a1); // idb -void am_40AA4E(); +void TurnChange(); +bool IsGameOver(); +int CalculateCardPower(ArcomagePlayer* player, ArcomagePlayer* enemy, ArcomageCard* pCard, int mastery); +char PlayerTurn(int player_num); +void DrawGameUI(int animation_stage); +void DrawSparks(); void DrawRectanglesForText(); void DrawPlayersText(); -void DrawPlayerLevels(int a1, char *text, POINT *pXY); // idb -void DrawBricksCount(int a1, char* text, POINT *pXY); // idb +void DrawPlayerLevels(int a1, char *text, POINT *pXY); +void DrawBricksCount(int a1, char* text, POINT *pXY); void DrawGemsCount(int a1, char* text, POINT* pXY); -void DrawBeastsCount(int a1, char *text, POINT *pXY); // idb +void DrawBeastsCount(int a1, char *text, POINT *pXY); void DrawPlayersTowers(); void DrawPlayersWall(); void DrawCards(); void DrawCardAnimation(int a1); int GetPlayerHandCardCount(int player_num); signed int DrawCardsRectangles(int player_num); -bool am_40BCFB(int player_num, signed int card_slot_index); +bool DiscardCard(int player_num, signed int card_slot_index); bool PlayCard(int player_num, signed int card_slot_num); bool CanCardBePlayed(int player_num, int hand_card_indx); -void ApplyCardToPlayer(int player_num, unsigned int uCardID); // idb +void ApplyCardToPlayer(int player_num, unsigned int uCardID); int am_40D2B4(POINT* a1, int a2); // weak -int am_40D402(int player_num, int damage); // weak +int ApplyDamageToBuildings(int player_num, int damage); // weak void GameResultsApply(); void pPrimaryWindow_draws_text(int a1, const char *pText, POINT *pXY); @@ -62,9 +62,10 @@ void __fastcall Blt_Chroma(RECT *pSrcXYZW, POINT *pTargetXY, int a3, int a4); void Blt_Copy(RECT *pSrcRect, POINT *pTargetXY, int a3); void __cdecl am_EndScene(); -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 +void DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill); +void SetPixel2sq( POINT *pTargetXY, unsigned __int16 uColor ); +void SetPixel(POINT *pTargetXY, unsigned __int16 uColor); +int rand_interval(int min, int max); // idb void __fastcall intToString(int val, char *pOut); /* 388 */ @@ -81,10 +82,10 @@ __int16 bricks_amount; __int16 gems_amount; __int16 beasts_amount; - int field_14; + int mastery_lvl; }; #pragma pack(pop) -ArcomageStartConditions start_conditions[13] = +const ArcomageStartConditions start_conditions[13] = { { 30, 100, 15, 5, 2, 2, 2, 10, 10, 10, 0}, { 50, 150, 20, 5, 2, 2, 2, 5, 5, 5, 1}, @@ -127,17 +128,28 @@ int x; int y; - char field_8; - char field_9; - char field_A; - char field_B; + char curr_mouse_left; + char mouse_left_state_changed; + char curr_mouse_right; + char mouse_right_state_changed; }; #pragma pack(pop) +#pragma pack(push, 1) +struct am_2 + { + int slot_index; + int card_power; + }; +#pragma pack(pop) + +am_2 cards_power[10]; +std::array<__int16, 12> am_sounds; + char byte_4E185C = 1; // weak char am_byte_4E185D = 1; // weak -char byte_4E185E = 1; // weak +char use_start_bonus = 1; // weak int start_tower_height; int start_wall_height; @@ -154,13 +166,13 @@ int max_tower_height = 50; int max_resources_amount = 100 ; -int dword_4DF3A4; // weak +int opponent_mastery = 1 ; // weak char byte_4FAA2C; // weak char byte_4FAA2D; // weak int current_player_num; // idb -char am_byte_4FAA77; // weak +char need_to_discard_card; // weak signed int current_card_slot_index; int played_card_id; // idb 4FABC0 @@ -177,10 +189,29 @@ POINT amuint_4FAA54_blt_xy; POINT amuint_4FAA5C_blt_xy; - +int dword_4FAA64; // weak +int dword_4FAA68; // weak int dword_4FABB8; // weak +char byte_4FAA00; // weak + +int amuint_4FAA34; // weak +int amuint_4FAA38; // weak +int amuint_4FAA4C; // weak + +char byte_4FAA2E; // weak + +int dword_4FAA70; // weak +char byte_4FAA74; // weak +char am_byte_4FAA75; // weak +char am_byte_4FAA76; // weak + +int amuint_4FABC4; // weak + + +char byte_505880; // weak +char byte_505881; // weak //----- (0040DD2F) -------------------------------------------------------- bool stru273::_40DD2F() @@ -188,12 +219,12 @@ this->x = pArcomageGame->mouse_x; this->y = pArcomageGame->mouse_y; - this->field_8 = pArcomageGame->mouse_left; - this->field_9 = pArcomageGame->mouse_left == pArcomageGame->field_F7; - this->field_A = pArcomageGame->mouse_right; - this->field_B = pArcomageGame->mouse_right == pArcomageGame->field_F8; - pArcomageGame->field_F7 = pArcomageGame->mouse_left; - pArcomageGame->field_F8 = pArcomageGame->mouse_right; + this->curr_mouse_left = pArcomageGame->mouse_left; + this->mouse_left_state_changed = pArcomageGame->mouse_left == pArcomageGame->prev_mouse_left; + this->curr_mouse_right = pArcomageGame->mouse_right; + this->mouse_right_state_changed = pArcomageGame->mouse_right == pArcomageGame->prev_mouse_right; + pArcomageGame->prev_mouse_left = pArcomageGame->mouse_left; + pArcomageGame->prev_mouse_right = pArcomageGame->mouse_right; return true; } @@ -206,13 +237,13 @@ } //----- (0040DFD1) -------------------------------------------------------- -void stru272_stru0::Ctor(stru272_stru0 *a1) +void stru272_stru0::Ctor(stru272_stru0 **a1) { stru272_stru0 *v2; // eax@1 v2 = (stru272_stru0 *)malloc(0x5Cu); - a1 = v2; + *a1 = v2; v2->signature = SIG_trpg; - v2->field_8 = 0; + v2->position_in_sparks_arr = 0; v2->field_30 = 0.0; v2->field_58 = 0; v2->field_59 = 0; @@ -234,16 +265,16 @@ } //----- (0040E01A) -------------------------------------------------------- -int stru272_stru0::_40E01A( stru272_stru2* a2 ) +int stru272_stru0::StartFill( stru272_stru2* a2 ) { auto a1 = this; if ( a1->signature == SIG_trpg ) { a1->field_4 = a2->field_20; - a1->field_C = a2->field_0 << 16; - a1->field_10 = a2->field_4 << 16; - a1->field_14 = a2->field_8 << 16; - a1->field_18 = a2->field_C << 16; + a1->field_C = a2->effect_area.left << 16; + a1->field_10 = a2->effect_area.top << 16; + a1->field_14 = a2->effect_area.right << 16; + a1->field_18 = a2->effect_area.bottom << 16; a1->field_1C = a2->field_10; a1->field_20 = a2->field_14; a1->field_24 = a2->field_18; @@ -253,7 +284,7 @@ a1->field_38 = (int)(a2->field_2Cf * 65536.0); a1->field_3C = a2->field_30; a1->field_40 = a2->field_34; - a1->field_54 = a2->field_38; + a1->field_54 = a2->sparks_array; a1->field_59 = 1; return 0; @@ -269,14 +300,14 @@ { if ( a2 ) { - field_8 = 0; + position_in_sparks_arr = 0; field_30 = 0.0; } if ( field_59 && a3 ) { for (int i=0; isignature != SIG_trpg ) return 2; - v3 = this->field_8; + v3 = this->position_in_sparks_arr; v22 = this->field_30; v4 = v3; if ( v3 > 0 ) @@ -330,28 +361,29 @@ v7 = this->field_54; v20 = this->field_28; v21 = this->field_4; - while ( v7->field_0 <= 0 ) + while ( v7->have_spark <= 0 ) { if ( v22 >= 1.0 ) { v12 = v1->field_40; v13 = v1->field_3C; - v7->field_0 = v13 + rand() % (v12 - v13 + 1); + v7->have_spark = rand_interval(v13,v12); v7->field_14 = (rand() % 17 - 8) << 16; v7->field_18 = (rand() % 17 - 8) << 16; + v14 = v1->field_14 - 1; v15 = v1->field_C; - v16 = v15 + rand() % (v14 - v15 + 1); + v16 = rand_interval(v15,v14); v7->field_C = v16; - v7->field_4.x = v16 >> 16; + v7->spark_position.x = v16 >> 16; v17 = v1->field_18 - 1; v18 = v1->field_10; - v22 = v22 - 1.0; - v19 = v18 + rand() % (v17 - v18 + 1); + v19 = rand_interval(v17, v18); v7->field_10 = v19; - v7->field_4.y = v19 >> 16; - --v1->field_8; + v7->spark_position.y = v19 >> 16; + --v1->position_in_sparks_arr; + v22 = v22 - 1.0; goto LABEL_13; } LABEL_14: @@ -365,17 +397,17 @@ } } v8 = v7->field_14; - --v7->field_0; + --v7->have_spark; v9 = v8 + v7->field_C; v10 = v20 + v7->field_18; v7->field_C = v9; - v7->field_4.x = v9 >> 16; + v7->spark_position.x = v9 >> 16; v11 = v10 + v7->field_10; v7->field_18 = v10; v7->field_10 = v11; - v7->field_4.y = v11 >> 16; + v7->spark_position.y = v11 >> 16; LABEL_13: v6 = 1; goto LABEL_14; @@ -389,7 +421,7 @@ if (signature == SIG_trpg ) { - if ( field_8 <= 0 ) + if ( position_in_sparks_arr <= 0 ) return field_58 != 0 ? 2 : 0; else return 1; @@ -427,9 +459,9 @@ pTargetPoint.x = 0; pTargetPoint.y = 0; - pSrcRect.left = 0; - pSrcRect.right = 640; - pSrcRect.top = 0; + pSrcRect.left = 0; + pSrcRect.top = 0; + pSrcRect.right = 640; pSrcRect.bottom = 480; pRenderer->BeginScene(); @@ -757,793 +789,441 @@ return true; } +int CalculateCardPower(ArcomagePlayer* player, ArcomagePlayer* enemy, ArcomageCard* pCard, int mastery) + { + enum V_INDX{ + P_TOWER_M10, + P_WALL_M10, + E_TOWER, + E_WALL, + E_BUILDINGS, + E_QUARRY, + E_MAGIC, + E_ZOO, + E_RES, + V_INDEX_MAX + }; + + const int mastery_coeff[V_INDEX_MAX][2]= {{10, 5}, //P_TOWER_M10 + {2, 1}, //P_WALL_M10 + {1, 10}, //E_TOWER + {1, 3}, //E_WALL + {1, 7}, //E_BUILDINGS + {1, 5}, //E_QUARRY + {1, 40}, //E_MAGIC + {1, 40}, //E_ZOO + {1, 2} //E_RES + }; + int card_power= 0; + int element_power; + + + if ( pCard->to_player_tower == 99 || pCard->to_pl_enm_tower == 99|| + pCard->to_player_tower2 == 99 || pCard->to_pl_enm_tower2 == 99 ) + element_power = enemy->tower_height - player->tower_height; + else + element_power = pCard->to_player_tower + pCard->to_pl_enm_tower + pCard->to_player_tower2 + pCard->to_pl_enm_tower2; + + if ( player->tower_height >= 10 ) + card_power += mastery_coeff[P_TOWER_M10][mastery]*element_power; + else + card_power += 20*element_power; + + + if ( pCard->to_player_wall == 99 || pCard->to_pl_enm_wall == 99 || + pCard->to_player_wall2 == 99 || pCard->to_pl_enm_wall2 == 99 ) + element_power = enemy->wall_height - player->wall_height; + else + element_power = pCard->to_player_wall + pCard->to_pl_enm_wall + + pCard->to_player_wall2 + pCard->to_pl_enm_wall2; + if ( player->wall_height >= 10 ) + card_power += mastery_coeff[P_WALL_M10][mastery]*element_power; //1 + else + card_power += 5*element_power; + + + card_power += 7 * (pCard->to_player_buildings + pCard->to_pl_enm_buildings + + pCard->to_player_buildings2 + pCard->to_pl_enm_buildings2); + + if ( pCard->to_player_quarry_lvl == 99 || pCard->to_pl_enm_quarry_lvl == 99 || + pCard->to_player_quarry_lvl2 == 99 || pCard->to_pl_enm_quarry_lvl2 == 99 ) + element_power = enemy->quarry_level - player->quarry_level; + else + element_power = pCard->to_player_quarry_lvl + pCard->to_pl_enm_quarry_lvl + + pCard->to_player_quarry_lvl2 + pCard->to_pl_enm_quarry_lvl; + + card_power += 40 * element_power; + + if ( pCard->to_player_magic_lvl == 99 || pCard->to_pl_enm_magic_lvl == 99 || + pCard->to_player_magic_lvl2 == 99 || pCard->to_pl_enm_magic_lvl2 == 99 ) + element_power = enemy->magic_level - player->magic_level; + else + element_power = pCard->to_player_magic_lvl + pCard->to_pl_enm_magic_lvl + + pCard->to_player_magic_lvl2 + pCard->to_pl_enm_magic_lvl2; + card_power += 40 *element_power; + + if ( pCard->to_player_zoo_lvl == 99 || pCard->to_pl_enm_zoo_lvl == 99 || + pCard->to_player_zoo_lvl2 == 99 || pCard->to_pl_enm_zoo_lvl2 == 99 ) + element_power = enemy->zoo_level - player->zoo_level; + else + element_power = pCard->to_player_zoo_lvl + pCard->to_pl_enm_zoo_lvl + + pCard->to_player_zoo_lvl2 + pCard->to_pl_enm_zoo_lvl2; + card_power += 40 *element_power; + + if ( pCard->to_player_bricks == 99 || pCard->to_pl_enm_bricks == 99 || + pCard->to_player_bricks2 == 99 || pCard->to_pl_enm_bricks2 == 99 ) + element_power = enemy->resource_bricks - player->resource_bricks; + else + element_power = pCard->to_player_bricks + pCard->to_pl_enm_bricks + + pCard->to_player_bricks2 + pCard->to_pl_enm_bricks2; + card_power += 2 *element_power; + + + if ( pCard->to_player_gems == 99 || pCard->to_pl_enm_gems == 99 || + pCard->to_player_gems2 == 99 || pCard->to_pl_enm_gems2 == 99 ) + element_power = enemy->resource_gems - player->resource_gems; + else + element_power = pCard->to_player_gems + pCard->to_pl_enm_gems + + pCard->to_player_gems2 + pCard->to_pl_enm_gems2; + card_power += 2 *element_power; + + if ( pCard->to_player_beasts == 99 || pCard->to_pl_enm_beasts == 99 || + pCard->to_player_beasts2 == 99 || pCard->to_pl_enm_beasts2 == 99 ) + element_power = enemy->resource_beasts - player->resource_beasts; + else + element_power = pCard->to_player_beasts + pCard->to_pl_enm_beasts + + pCard->to_player_beasts2 + pCard->to_pl_enm_beasts2; + card_power += 2 *element_power; + + if ( pCard->to_enemy_tower == 99 || pCard->to_enemy_tower2 == 99 ) + element_power = player->tower_height - enemy->tower_height; + else + element_power = -(pCard->to_enemy_tower + pCard->to_enemy_tower2); + card_power += mastery_coeff[E_TOWER][mastery]*element_power; + + if ( pCard->to_enemy_wall == 99 || pCard->to_enemy_wall2 == 99 ) + element_power = player->wall_height - enemy->wall_height; + else + element_power = -(pCard->to_enemy_wall + pCard->to_enemy_wall2); + card_power += mastery_coeff[E_WALL][mastery]*element_power; + + card_power -= mastery_coeff[E_BUILDINGS][mastery]*(pCard->to_enemy_buildings + pCard->to_enemy_buildings2); + + if ( pCard->to_enemy_quarry_lvl == 99 || pCard->to_enemy_quarry_lvl2 == 99 ) + element_power = player->quarry_level - enemy->quarry_level; //5 + else + element_power = -(pCard->to_enemy_quarry_lvl + pCard->to_enemy_quarry_lvl2); //5 + card_power += mastery_coeff[E_QUARRY][mastery]*element_power; + + if ( pCard->to_enemy_magic_lvl == 99 || pCard->to_enemy_magic_lvl2 == 99 ) + element_power = player->magic_level - enemy->magic_level; //40 + else + element_power = -(pCard->to_enemy_magic_lvl + pCard->to_enemy_magic_lvl2); + card_power += mastery_coeff[E_MAGIC][mastery]*element_power; + + if ( pCard->to_enemy_zoo_lvl == 99 || pCard->to_enemy_zoo_lvl2 == 99 ) + element_power = player->zoo_level - enemy->zoo_level; //40 + else + element_power = -(pCard->to_enemy_zoo_lvl + pCard->to_enemy_zoo_lvl2); + card_power += mastery_coeff[E_ZOO][mastery]*element_power; + + if ( pCard->to_enemy_bricks == 99 || pCard->to_enemy_bricks2 == 99 ) + element_power = player->resource_bricks - enemy->resource_bricks; //2 + else + element_power = -(pCard->to_enemy_bricks + pCard->to_enemy_bricks2); + card_power += mastery_coeff[E_RES][mastery]*element_power; + + if ( pCard->to_enemy_gems == 99 || pCard->to_enemy_gems2 == 99 ) + element_power = player->resource_gems - enemy->resource_gems; //2 + else + element_power = -(pCard->to_enemy_gems + pCard->to_enemy_gems2); + card_power += mastery_coeff[E_RES][mastery]*element_power; + + if ( pCard->to_enemy_beasts == 99 || pCard->to_enemy_beasts2 == 99 ) + element_power = player->resource_beasts - enemy->resource_beasts; //2 + else + element_power = -(pCard->to_enemy_beasts + pCard->to_enemy_beasts2); + card_power += mastery_coeff[E_RES][mastery]*element_power; + + if ( pCard->field_30 || pCard->field_4D ) + card_power *= 10; + + if ( pCard->field_24 == 1 ) + element_power = player->resource_bricks - pCard->needed_bricks; + else if ( pCard->field_24 == 2 ) + element_power = player->resource_gems - pCard->needed_gems; + else if (pCard->field_24 == 3) + element_power = player->resource_beasts - pCard->needed_beasts; + if ( element_power > 3 ) + element_power = 3; + card_power += 5 * element_power; + + if ( enemy->tower_height <= pCard->to_enemy_tower2 + pCard->to_enemy_tower ) + card_power += 9999; + + if (pCard->to_enemy_tower2 + pCard->to_enemy_tower + + pCard->to_enemy_wall + pCard->to_enemy_wall2 + + pCard->to_enemy_buildings + pCard->to_enemy_buildings2 >= enemy->wall_height + enemy->tower_height) + card_power += 9999; + + if ( (pCard->to_player_tower2 + pCard->to_pl_enm_tower2 + + pCard->to_player_tower + pCard->to_pl_enm_tower + player->tower_height) >= max_tower_height ) + card_power += 9999; + + return card_power; + } + + //----- (00408BB4) -------------------------------------------------------- -bool __fastcall am_408BB4(int a1) +bool OpponentsAITurn(int player_num) { -// char result; // al@3 -// signed int v3; // ebx@8 -// int v4; // esi@8 -// int v5; // eax@9 -// int v6; // edi@9 -// int v7; // eax@11 -// signed int v8; // eax@11 -// int v9; // ebx@5 -// int v10; // eax@5 -// int v11; // ecx@18 -// char v12; // bl@20 -// int v13; // eax@20 -// ArcomageCard *v14; // ecx@20 -// char v15; // dl@20 -// char v16; // dl@24 -// int v17; // edx@25 -// int v18; // edx@27 -// char v19; // dl@31 -// int v20; // edx@32 -// char v21; // dl@35 -// char v22; // dl@39 -// int v23; // edx@40 -// char v24; // dl@45 -// int v25; // edx@46 -// char v26; // dl@52 -// int v27; // edx@53 -// char v28; // dl@58 -// int v29; // edx@59 -// char v30; // dl@64 -// int v31; // edx@65 -// char v32; // dl@70 -// int v33; // edx@71 -// char v34; // dl@76 -// int v35; // edx@77 -// char v36; // dl@82 -// int v37; // edx@83 -// char v38; // dl@86 -// char v39; // dl@90 -// int v40; // edi@93 -// char v41; // dl@93 -// int v42; // esi@93 -// char v43; // bl@94 -// int v44; // esi@95 -// char v45; // dl@99 -// char v46; // dl@103 -// char v47; // dl@107 -// char v48; // dl@111 -// char v49; // dl@115 -// ArcomagePlayer *v50; // ebx@116 -// ArcomagePlayer *v51; // edx@116 -// int v52; // esi@124 -// int v53; // edx@124 -// int v54; // edx@127 -// int v55; // esi@130 -// int v56; // edi@138 -// int l; // esi@138 -// int v58; // eax@140 -// int v59; // ecx@142 -// int v60; // edx@142 -// int v61; // ebx@142 -// int v62; // eax@145 -// int v63; // esi@146 -// int v64; // ebx@4 -// int v65; // eax@4 -// int v66; // ecx@168 -// char v67; // bl@170 -// int v68; // eax@170 -// ArcomageCard *v69; // ecx@170 -// char v70; // dl@170 -// char v71; // dl@174 -// int v72; // edx@175 -// int v73; // edx@177 -// char v74; // dl@181 -// char v75; // dl@184 -// char v76; // dl@188 -// int v77; // edx@189 -// char v78; // dl@194 -// char v79; // dl@200 -// int v80; // edx@201 -// char v81; // dl@206 -// int v82; // edx@207 -// char v83; // dl@212 -// int v84; // edx@213 -// char v85; // dl@218 -// int v86; // edx@219 -// char v87; // dl@224 -// int v88; // edx@225 -// char v89; // dl@230 -// int v90; // edx@231 -// char v91; // dl@234 -// int v92; // edx@235 -// char v93; // dl@238 -// int v94; // edx@239 -// int v95; // esi@241 -// char v96; // dl@241 -// int v97; // esi@241 -// char v98; // bl@242 -// int v99; // edi@243 -// int v100; // edx@245 -// int v101; // edi@246 -// char v102; // dl@247 -// int v103; // edx@248 -// char v104; // dl@251 -// int v105; // edx@252 -// char v106; // dl@255 -// int v107; // edx@256 -// char v108; // dl@259 -// int v109; // edx@260 -// char v110; // dl@263 -// ArcomagePlayer *v111; // ebx@264 -// ArcomagePlayer *v112; // edx@264 -// int v113; // esi@272 -// int v114; // edx@272 -// int v115; // edx@275 -// int v116; // esi@278 -// int v117; // edi@286 -// int j; // esi@286 -// int v119; // eax@288 -// int v120; // ecx@290 -// int v121; // edx@290 -// int v122; // ebx@290 -// int v123; // eax@293 -// int v124; // esi@294 -// int v125; // [sp-28h] [bp-28h]@130 -// int v126; // [sp-28h] [bp-28h]@278 -// int k; // [sp-24h] [bp-24h]@18 -// int i; // [sp-24h] [bp-24h]@168 -// int v129; // [sp-20h] [bp-20h]@5 -// int v130; // [sp-20h] [bp-20h]@4 -// int v131; // [sp-1Ch] [bp-1Ch]@17 -// int v132; // [sp-1Ch] [bp-1Ch]@140 -// int v133; // [sp-1Ch] [bp-1Ch]@167 -// int v134; // [sp-1Ch] [bp-1Ch]@288 -// int v135; // [sp-18h] [bp-18h]@5 -// int v136; // [sp-18h] [bp-18h]@4 -// signed int v137; // [sp-14h] [bp-14h]@0 -// int v138; // [sp-14h] [bp-14h]@93 -// int v139; // [sp-14h] [bp-14h]@130 -// int v140; // [sp-14h] [bp-14h]@241 -// int v141; // [sp-14h] [bp-14h]@278 -// ArcomagePlayer *v142; // [sp-10h] [bp-10h]@5 -// ArcomagePlayer *v143; // [sp-10h] [bp-10h]@4 -// ArcomagePlayer *v144; // [sp-Ch] [bp-Ch]@5 -// ArcomagePlayer *v145; // [sp-Ch] [bp-Ch]@4 -// char v146; // [sp-8h] [bp-8h]@35 -// char v147; // [sp-8h] [bp-8h]@184 -// char v148; // [sp-5h] [bp-5h]@20 -// char v149; // [sp-5h] [bp-5h]@170 -// -// byte_4FAA00 = 1; -// if ( dword_4DF3A4 ) -// { -// if ( dword_4DF3A4 != 1 ) -// { -// result = dword_4DF3A4 - 2; -// if ( dword_4DF3A4 != 2 ) -// return result != 0; -// v64 = a1; -// v145 = &stru_505708[a1]; -// v130 = a1; -// v143 = &stru_505708[(a1 + 1) % 2]; -// v136 = GetPlayerHandCardCount(a1); -// v65 = 0; -// do -// { -// if ( v65 >= v136 ) -// { -// dword_4FA9B0[2 * v65] = -1; -// dword_4FA9B4[2 * v65] = -9999; -// } -// else -// { -// dword_4FA9B0[2 * v65] = v65; -// dword_4FA9B4[2 * v65] = 0; -// } -// ++v65; -// } -// while ( v65 < 10 ); -// v133 = 0; -// if ( v136 > 0 ) -// { -// v66 = 47 * v64; -// for ( i = 47 * v64; ; v66 = i ) -// { -// v67 = 99; -// v68 = 2 * v133; -// v69 = &pCards[stru_505708[0].cards_at_hand[v66 + dword_4FA9B0[2 * v133]]]; -// v70 = v69->field_38[2]; -// v149 = v69->field_38[2]; -// if ( v145->field_24 >= 10 ) -// { -// if ( v70 == 99 -// || v69->field_48[4] == 99 -// || v69->field_48[15] == 99 -// || (v74 = BYTE1(v69->field_68), v74 == 99) ) -// v73 = 5 * (v143->field_24 - v145->field_24); -// else -// v73 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v74); -// } -// else -// { -// if ( v70 == 99 -// || v69->field_48[4] == 99 -// || v69->field_48[15] == 99 -// || (v71 = BYTE1(v69->field_68), v71 == 99) ) -// v72 = 5 * (v143->field_24 - v145->field_24); -// else -// v72 = 5 * (v149 + v69->field_48[4] + v69->field_48[15] + v71); -// v73 = 4 * v72; -// } -// dword_4FA9B4[v68] += v73; -// v75 = v69->field_38[1]; -// v147 = v69->field_38[1]; -// if ( v145->field_28 >= 10 ) -// { -// if ( v75 == 99 -// || v69->field_48[3] == 99 -// || v69->field_48[14] == 99 -// || (v78 = LOBYTE(v69->field_68), v78 == 99) ) -// v77 = v143->field_28 - v145->field_28; -// else -// v77 = v147 + v69->field_48[3] + v69->field_48[14] + v78; -// } -// else -// { -// if ( v75 == 99 -// || v69->field_48[3] == 99 -// || v69->field_48[14] == 99 -// || (v76 = LOBYTE(v69->field_68), v76 == 99) ) -// v77 = 5 * (v143->field_28 - v145->field_28); -// else -// v77 = 5 * (v147 + v69->field_48[3] + v69->field_48[14] + v76); -// } -// dword_4FA9B4[v68] += v77; -// dword_4FA9B4[v68] += 7 * (v69->field_38[0] + v69->field_48[2] + v69->field_48[13] + v69->field_58[15]); -// if ( BYTE2(v69->field_30) == 99 -// || v69->field_38[12] == 99 -// || v69->field_48[7] == 99 -// || (v79 = v69->field_58[9], v79 == 99) ) -// v80 = 5 * (v143->field_2C - v145->field_2C); -// else -// v80 = 5 * (BYTE2(v69->field_30) + v69->field_38[12] + v69->field_48[7] + v79); -// dword_4FA9B4[v68] += 8 * v80; -// if ( BYTE3(v69->field_30) == 99 -// || v69->field_38[13] == 99 -// || v69->field_48[8] == 99 -// || (v81 = v69->field_58[10], v81 == 99) ) -// v82 = 5 * (v143->field_30 - v145->field_30); -// else -// v82 = 5 * (BYTE3(v69->field_30) + v69->field_38[13] + v69->field_48[8] + v81); -// dword_4FA9B4[v68] += 8 * v82; -// if ( LOBYTE(v69->field_34) == 99 -// || v69->field_38[14] == 99 -// || v69->field_48[9] == 99 -// || (v83 = v69->field_58[11], v83 == 99) ) -// v84 = 5 * (v143->field_34 - v145->field_34); -// else -// v84 = 5 * (LOBYTE(v69->field_34) + v69->field_38[14] + v69->field_48[9] + v83); -// dword_4FA9B4[v68] += 8 * v84; -// if ( BYTE1(v69->field_34) == 99 -// || v69->field_38[15] == 99 -// || v69->field_48[10] == 99 -// || (v85 = v69->field_58[12], v85 == 99) ) -// v86 = v143->field_38 - v145->field_38; -// else -// v86 = BYTE1(v69->field_34) + v69->field_38[15] + v69->field_48[10] + v85; -// dword_4FA9B4[v68] += 2 * v86; -// if ( BYTE2(v69->field_34) == 99 -// || v69->field_48[0] == 99 -// || v69->field_48[11] == 99 -// || (v87 = v69->field_58[13], v87 == 99) ) -// v88 = v143->field_3C - v145->field_3C; -// else -// v88 = BYTE2(v69->field_34) + v69->field_48[0] + v69->field_48[11] + v87; -// dword_4FA9B4[v68] += 2 * v88; -// if ( BYTE3(v69->field_34) == 99 -// || v69->field_48[1] == 99 -// || v69->field_48[12] == 99 -// || (v89 = v69->field_58[14], v89 == 99) ) -// v90 = v143->field_40 - v145->field_40; -// else -// v90 = BYTE3(v69->field_34) + v69->field_48[1] + v69->field_48[12] + v89; -// dword_4FA9B4[v68] += 2 * v90; -// if ( v69->field_38[11] == 99 || (v91 = v69->field_58[8], v91 == 99) ) -// v92 = 10 * (v145->field_24 - v143->field_24); -// else -// v92 = -10 * (v69->field_38[11] + v91); -// dword_4FA9B4[v68] += v92; -// if ( v69->field_38[10] == 99 || (v93 = v69->field_58[7], v93 == 99) ) -// v94 = 3 * (v145->field_28 - v143->field_28); -// else -// v94 = -3 * (v69->field_38[10] + v93); -// dword_4FA9B4[v68] += v94; -// v95 = v69->field_38[9]; -// v140 = v95; -// v96 = v69->field_38[3]; -// dword_4FA9B4[v68] += -7 * (v69->field_58[6] + v95); -// v97 = dword_4FA9B4[v68]; -// if ( v96 == 99 ) -// goto LABEL_245; -// v98 = v69->field_58[0]; -// if ( v98 == 99 ) -// break; -// v99 = v96 + v98; -// v67 = 99; -// dword_4FA9B4[v68] = v97 - 5 * v99; -//LABEL_246: -// v101 = v140; -// if ( v69->field_38[4] == v67 || (v102 = v69->field_58[1], v102 == v67) ) -// v103 = 5 * (v145->field_30 - v143->field_30); -// else -// v103 = -5 * (v69->field_38[4] + v102); -// dword_4FA9B4[v68] += v103; -// if ( v69->field_38[5] == v67 || (v104 = v69->field_58[2], v104 == v67) ) -// v105 = 5 * (v145->field_34 - v143->field_34); -// else -// v105 = -5 * (v69->field_38[5] + v104); -// dword_4FA9B4[v68] += v105; -// if ( v69->field_38[6] == v67 || (v106 = v69->field_58[3], v106 == v67) ) -// v107 = v145->field_38 - v143->field_38; -// else -// v107 = -(v69->field_38[6] + v106); -// dword_4FA9B4[v68] += 2 * v107; -// if ( v69->field_38[7] == v67 || (v108 = v69->field_58[4], v108 == v67) ) -// v109 = v145->field_3C - v143->field_3C; -// else -// v109 = -(v69->field_38[7] + v108); -// dword_4FA9B4[v68] += 2 * v109; -// if ( v69->field_38[8] == v67 || (v110 = v69->field_58[5], v110 == v67) ) -// { -// v112 = v145; -// v111 = v143; -// dword_4FA9B4[v68] += 2 * (v145->field_40 - v143->field_40); -// } -// else -// { -// v111 = v143; -// dword_4FA9B4[v68] += -2 * (v69->field_38[8] + v110); -// v112 = v145; -// } -// if ( LOBYTE(v69->field_30) || v69->field_48[5] ) -// dword_4FA9B4[v68] *= 10; -// if ( LOBYTE(v69->field_24) == 1 ) -// { -// v113 = LOBYTE(v69->field_28); -// v114 = v112->field_38; -// } -// else -// { -// if ( LOBYTE(v69->field_24) == 2 ) -// { -// v113 = BYTE1(v69->field_28); -// v114 = v112->field_3C; -// } -// else -// { -// if ( LOBYTE(v69->field_24) != 3 ) -// goto LABEL_278; -// v113 = BYTE2(v69->field_28); -// v114 = v112->field_40; -// } -// } -// v115 = v114 - v113; -// if ( v115 > 3 ) -// v115 = 3; -// dword_4FA9B4[v68] += 5 * v115; -//LABEL_278: -// v116 = v69->field_58[8]; -// v141 = v111->field_24; -// v126 = v69->field_38[11]; -// if ( v141 <= v116 + v126 ) -// dword_4FA9B4[v68] += 9999; -// v137 = v111->field_28 + v141; -// if ( v137 <= v116 + v126 + v69->field_58[6] + v69->field_58[7] + v101 + v69->field_38[10] ) -// dword_4FA9B4[v68] += 9999; -// if ( v69->field_48[15] + (signed int)BYTE1(v69->field_68) + v145->field_24 + v69->field_48[4] + v149 >= dword_4E1884 ) -// dword_4FA9B4[v68] += 9999; -// ++v133; -// if ( v133 >= v136 ) -// { -// v64 = v130; -// goto LABEL_286; -// } -// } -// v67 = 99; -//LABEL_245: -// v100 = v145->field_2C - v143->field_2C; -// dword_4FA9B4[v68] = v97 + 4 * v100 + v100; -// goto LABEL_246; -// } -//LABEL_286: -// v117 = v136 - 1; -// for ( j = v136 - 1; j >= 0; --j ) -// { -// v137 = 0; -// if ( j > 0 ) -// { -// v119 = (int)dword_4FA9B0; -// v134 = j; -// v137 = j; -// do -// { -// if ( *(unsigned int *)(v119 + 4) < *(unsigned int *)(v119 + 12) ) -// { -// v120 = *(unsigned int *)v119; -// v121 = *(unsigned int *)(v119 + 4); -// *(unsigned int *)v119 = *(unsigned int *)(v119 + 8); -// v122 = *(unsigned int *)(v119 + 12); -// *(unsigned int *)(v119 + 8) = v120; -// *(unsigned int *)(v119 + 4) = v122; -// v64 = v130; -// *(unsigned int *)(v119 + 12) = v121; -// } -// v119 += 8; -// --v134; -// } -// while ( v134 ); -// } -// } -// v123 = v136 - 1; -// if ( am_byte_4FAA77 ) -// { -// if ( v117 >= 0 ) -// { -// while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) ) -// { -// --v123; -// if ( v123 < 0 ) -// return am_40BCFB(v64, v137) != 0; -// } -// v137 = dword_4FA9B0[2 * v123]; -// } -// } -// else -// { -// v124 = 0; -// if ( v117 >= 0 ) -// { -// while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v64 + dword_4FA9B0[2 * v123]]].field_28) ) -// { -// --v123; -// if ( v123 < 0 ) -// goto LABEL_299; -// } -// v137 = dword_4FA9B0[2 * v123]; -// } -//LABEL_299: -// if ( v136 > 0 ) -// { -// while ( !am_40BF15(v64, dword_4FA9B0[2 * v124]) || dword_4FA9B4[2 * v124] < 0 ) -// { -// ++v124; -// if ( v124 >= v136 ) -// return am_40BCFB(v64, v137) != 0; -// } -// return am_40BE0E(v64, dword_4FA9B0[2 * v124]) != 0; -// } -// } -// return am_40BCFB(v64, v137) != 0; -// } -// v9 = a1; -// v144 = &stru_505708[a1]; -// v129 = a1; -// v142 = &stru_505708[(a1 + 1) % 2]; -// v135 = GetPlayerHandCardCount(a1); -// v10 = 0; -// do -// { -// if ( v10 >= v135 ) -// { -// dword_4FA9B0[2 * v10] = -1; -// dword_4FA9B4[2 * v10] = -9999; -// } -// else -// { -// dword_4FA9B0[2 * v10] = v10; -// dword_4FA9B4[2 * v10] = 0; -// } -// ++v10; -// } -// while ( v10 < 10 ); -// v131 = 0; -// if ( v135 > 0 ) -// { -// v11 = 47 * v9; -// for ( k = 47 * v9; ; v11 = k ) -// { -// v12 = 99; -// v13 = 2 * v131; -// v14 = &pCards[stru_505708[0].cards_at_hand[v11 + dword_4FA9B0[2 * v131]]]; -// v15 = v14->field_38[2]; -// v148 = v14->field_38[2]; -// if ( v144->field_24 >= 10 ) -// { -// if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v19 = BYTE1(v14->field_68), v19 == 99) ) -// v20 = 5 * (v142->field_24 - v144->field_24); -// else -// v20 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v19); -// v18 = 2 * v20; -// } -// else -// { -// if ( v15 == 99 || v14->field_48[4] == 99 || v14->field_48[15] == 99 || (v16 = BYTE1(v14->field_68), v16 == 99) ) -// v17 = 5 * (v142->field_24 - v144->field_24); -// else -// v17 = 5 * (v148 + v14->field_48[4] + v14->field_48[15] + v16); -// v18 = 4 * v17; -// } -// dword_4FA9B4[v13] += v18; -// v21 = v14->field_38[1]; -// v146 = v14->field_38[1]; -// if ( v144->field_28 >= 10 ) -// { -// if ( v21 == 99 -// || v14->field_48[3] == 99 -// || v14->field_48[14] == 99 -// || (v24 = LOBYTE(v14->field_68), v24 == 99) ) -// v25 = v142->field_28 - v144->field_28; -// else -// v25 = v146 + v14->field_48[3] + v14->field_48[14] + v24; -// v23 = 2 * v25; -// } -// else -// { -// if ( v21 == 99 -// || v14->field_48[3] == 99 -// || v14->field_48[14] == 99 -// || (v22 = LOBYTE(v14->field_68), v22 == 99) ) -// v23 = 5 * (v142->field_28 - v144->field_28); -// else -// v23 = 5 * (v146 + v14->field_48[3] + v14->field_48[14] + v22); -// } -// dword_4FA9B4[v13] += v23; -// dword_4FA9B4[v13] += 7 * (v14->field_38[0] + v14->field_48[2] + v14->field_48[13] + v14->field_58[15]); -// if ( BYTE2(v14->field_30) == 99 -// || v14->field_38[12] == 99 -// || v14->field_48[7] == 99 -// || (v26 = v14->field_58[9], v26 == 99) ) -// v27 = 5 * (v142->field_2C - v144->field_2C); -// else -// v27 = 5 * (BYTE2(v14->field_30) + v14->field_38[12] + v14->field_48[7] + v26); -// dword_4FA9B4[v13] += 8 * v27; -// if ( BYTE3(v14->field_30) == 99 -// || v14->field_38[13] == 99 -// || v14->field_48[8] == 99 -// || (v28 = v14->field_58[10], v28 == 99) ) -// v29 = 5 * (v142->field_30 - v144->field_30); -// else -// v29 = 5 * (BYTE3(v14->field_30) + v14->field_38[13] + v14->field_48[8] + v28); -// dword_4FA9B4[v13] += 8 * v29; -// if ( LOBYTE(v14->field_34) == 99 -// || v14->field_38[14] == 99 -// || v14->field_48[9] == 99 -// || (v30 = v14->field_58[11], v30 == 99) ) -// v31 = 5 * (v142->field_34 - v144->field_34); -// else -// v31 = 5 * (LOBYTE(v14->field_34) + v14->field_38[14] + v14->field_48[9] + v30); -// dword_4FA9B4[v13] += 8 * v31; -// if ( BYTE1(v14->field_34) == 99 -// || v14->field_38[15] == 99 -// || v14->field_48[10] == 99 -// || (v32 = v14->field_58[12], v32 == 99) ) -// v33 = v142->field_38 - v144->field_38; -// else -// v33 = BYTE1(v14->field_34) + v14->field_38[15] + v14->field_48[10] + v32; -// dword_4FA9B4[v13] += 2 * v33; -// if ( BYTE2(v14->field_34) == 99 -// || v14->field_48[0] == 99 -// || v14->field_48[11] == 99 -// || (v34 = v14->field_58[13], v34 == 99) ) -// v35 = v142->field_3C - v144->field_3C; -// else -// v35 = BYTE2(v14->field_34) + v14->field_48[0] + v14->field_48[11] + v34; -// dword_4FA9B4[v13] += 2 * v35; -// if ( BYTE3(v14->field_34) == 99 -// || v14->field_48[1] == 99 -// || v14->field_48[12] == 99 -// || (v36 = v14->field_58[14], v36 == 99) ) -// v37 = v142->field_40 - v144->field_40; -// else -// v37 = BYTE3(v14->field_34) + v14->field_48[1] + v14->field_48[12] + v36; -// dword_4FA9B4[v13] += 2 * v37; -// if ( v14->field_38[11] == 99 || (v38 = v14->field_58[8], v38 == 99) ) -// dword_4FA9B4[v13] += v144->field_24 - v142->field_24; -// else -// dword_4FA9B4[v13] -= v14->field_38[11] + v38; -// if ( v14->field_38[10] == 99 || (v39 = v14->field_58[7], v39 == 99) ) -// dword_4FA9B4[v13] += v144->field_28 - v142->field_28; -// else -// dword_4FA9B4[v13] -= v14->field_38[10] + v39; -// v40 = v14->field_38[9]; -// v138 = v14->field_38[9]; -// dword_4FA9B4[v13] -= v40 + v14->field_58[6]; -// v41 = v14->field_38[3]; -// v42 = dword_4FA9B4[v13]; -// if ( v41 == 99 ) -// goto LABEL_97; -// v43 = v14->field_58[0]; -// if ( v43 == 99 ) -// break; -// v44 = v42 - v43; -// v12 = 99; -// dword_4FA9B4[v13] = v44 - v41; -//LABEL_98: -// if ( v14->field_38[4] == v12 || (v45 = v14->field_58[1], v45 == v12) ) -// dword_4FA9B4[v13] += v144->field_30 - v142->field_30; -// else -// dword_4FA9B4[v13] -= v14->field_38[4] + v45; -// if ( v14->field_38[5] == v12 || (v46 = v14->field_58[2], v46 == v12) ) -// dword_4FA9B4[v13] += v144->field_34 - v142->field_34; -// else -// dword_4FA9B4[v13] -= v14->field_38[5] + v46; -// if ( v14->field_38[6] == v12 || (v47 = v14->field_58[3], v47 == v12) ) -// dword_4FA9B4[v13] += v144->field_38 - v142->field_38; -// else -// dword_4FA9B4[v13] -= v14->field_38[6] + v47; -// if ( v14->field_38[7] == v12 || (v48 = v14->field_58[4], v48 == v12) ) -// dword_4FA9B4[v13] += v144->field_3C - v142->field_3C; -// else -// dword_4FA9B4[v13] -= v14->field_38[7] + v48; -// if ( v14->field_38[8] == v12 || (v49 = v14->field_58[5], v49 == v12) ) -// { -// v51 = v144; -// v50 = v142; -// dword_4FA9B4[v13] += v144->field_40 - v142->field_40; -// } -// else -// { -// v50 = v142; -// dword_4FA9B4[v13] -= v14->field_38[8] + v49; -// v51 = v144; -// } -// if ( LOBYTE(v14->field_30) || v14->field_48[5] ) -// dword_4FA9B4[v13] *= 10; -// if ( LOBYTE(v14->field_24) == 1 ) -// { -// v52 = LOBYTE(v14->field_28); -// v53 = v51->field_38; -// } -// else -// { -// if ( LOBYTE(v14->field_24) == 2 ) -// { -// v52 = BYTE1(v14->field_28); -// v53 = v51->field_3C; -// } -// else -// { -// if ( LOBYTE(v14->field_24) != 3 ) -// goto LABEL_130; -// v52 = BYTE2(v14->field_28); -// v53 = v51->field_40; -// } -// } -// v54 = v53 - v52; -// if ( v54 > 3 ) -// v54 = 3; -// dword_4FA9B4[v13] += 5 * v54; -//LABEL_130: -// v55 = v14->field_58[8]; -// v139 = v50->field_24; -// v125 = v14->field_38[11]; -// if ( v139 <= v55 + v125 ) -// dword_4FA9B4[v13] += 9999; -// v137 = v50->field_28 + v139; -// if ( v137 <= v55 + v125 + v14->field_58[6] + v14->field_58[7] + v40 + v14->field_38[10] ) -// dword_4FA9B4[v13] += 9999; -// if ( v14->field_48[15] + (signed int)BYTE1(v14->field_68) + v144->field_24 + v14->field_48[4] + v148 >= dword_4E1884 ) -// dword_4FA9B4[v13] += 9999; -// ++v131; -// if ( v131 >= v135 ) -// { -// v9 = v129; -// goto LABEL_138; -// } -// } -// v12 = 99; -//LABEL_97: -// v40 = v138; -// dword_4FA9B4[v13] = v42 + v144->field_2C - v142->field_2C; -// goto LABEL_98; -// } -//LABEL_138: -// v56 = v135 - 1; -// for ( l = v135 - 1; l >= 0; --l ) -// { -// v137 = 0; -// if ( l > 0 ) -// { -// v58 = (int)dword_4FA9B0; -// v132 = l; -// v137 = l; -// do -// { -// if ( *(unsigned int *)(v58 + 4) < *(unsigned int *)(v58 + 12) ) -// { -// v59 = *(unsigned int *)v58; -// v60 = *(unsigned int *)(v58 + 4); -// *(unsigned int *)v58 = *(unsigned int *)(v58 + 8); -// v61 = *(unsigned int *)(v58 + 12); -// *(unsigned int *)(v58 + 8) = v59; -// *(unsigned int *)(v58 + 4) = v61; -// v9 = v129; -// *(unsigned int *)(v58 + 12) = v60; -// } -// v58 += 8; -// --v132; -// } -// while ( v132 ); -// } -// } -// v62 = v135 - 1; -// if ( am_byte_4FAA77 ) -// { -// if ( v56 >= 0 ) -// { -// while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) ) -// { -// --v62; -// if ( v62 < 0 ) -// return am_40BCFB(v9, v137) != 0; -// } -// v137 = dword_4FA9B0[2 * v62]; -// } -// } -// else -// { -// v63 = 0; -// if ( v56 >= 0 ) -// { -// while ( !BYTE3(pCards[stru_505708[0].cards_at_hand[47 * v9 + dword_4FA9B0[2 * v62]]].field_28) ) -// { -// --v62; -// if ( v62 < 0 ) -// goto LABEL_151; -// } -// v137 = dword_4FA9B0[2 * v62]; -// } -//LABEL_151: -// if ( v135 > 0 ) -// { -// while ( !am_40BF15(v9, dword_4FA9B0[2 * v63]) || dword_4FA9B4[2 * v63] < 0 ) -// { -// ++v63; -// if ( v63 >= v135 ) -// return am_40BCFB(v9, v137) != 0; -// } -// return am_40BE0E(v9, dword_4FA9B0[2 * v63]) != 0; -// } -// } -// return am_40BCFB(v9, v137) != 0; -// } -// v3 = 0; -// v4 = a1; -// if ( am_byte_4FAA77 ) -// { -//LABEL_11: -// v7 = GetPlayerHandCardCount(v4); -// v8 = rand_interval(0, v7 - 1); -// result = am_40BCFB(v4, v8); -// } -// else -// { -// while ( 1 ) -// { -// v5 = GetPlayerHandCardCount(v4); -// v6 = rand_interval(0, v5 - 1); -// if ( am_40BF15(v4, v6) ) -// break; -// ++v3; -// if ( v3 >= 10 ) -// goto LABEL_11; -// } -// result = am_40BE0E(v4, v6); -// } + + char result; // al@3 + signed int v2; // ebx@8 + int v3; // esi@8 + int all_player_cards_count; // eax@9 + int random_card_slot; // edi@9 + int v6; // eax@11 + signed int v7; // eax@11 + int v8; // ebx@5 + int v9; // eax@5 + int v10; // ecx@18 + int v11; // eax@20 + ArcomageCard *v12; // ecx@20 + char v13; // dl@20 + char v14; // dl@24 + int v15; // edx@25 + int v16; // edx@27 + char v17; // dl@31 + int v18; // edx@32 + char v19; // dl@35 + char v20; // dl@39 + int v21; // edx@40 + char v22; // dl@45 + int v23; // edx@46 + char v24; // dl@52 + int v25; // edx@53 + char v26; // dl@58 + int v27; // edx@59 + char v28; // dl@64 + int v29; // edx@65 + char v30; // dl@70 + int v31; // edx@71 + char v32; // dl@76 + int v33; // edx@77 + char v34; // dl@82 + int v35; // edx@83 + char v36; // dl@86 + char v37; // dl@90 + int v38; // edi@93 + char v39; // dl@93 + int v40; // esi@93 + char v41; // bl@94 + char v42; // dl@98 + char v43; // dl@102 + char v44; // dl@106 + char v45; // dl@110 + char v46; // dl@114 + ArcomagePlayer *v47; // ebx@115 + ArcomagePlayer *v48; // edx@115 + int v49; // esi@123 + int v50; // edx@123 + int v51; // edx@126 + int v52; // esi@129 + int v53; // edi@137 + int j; // esi@137 + am_2 *v55; // eax@139 + int v56; // ecx@141 + int v57; // edx@141 + int v58; // ebx@141 + int v59; // eax@144 + int v60; // esi@145 + int v61; // ebx@4 + int v62; // eax@4 + int v63; // ecx@167 + int v64; // eax@169 + ArcomageCard *pCard; // ecx@169 + char v66; // dl@169 + char v67; // dl@173 + int v68; // edx@174 + int v69; // edx@176 + char v70; // dl@180 + char v71; // dl@183 + char v72; // dl@187 + int v73; // edx@188 + char v74; // dl@193 + char v75; // dl@199 + int v76; // edx@200 + char v77; // dl@205 + int v78; // edx@206 + char v79; // dl@211 + int v80; // edx@212 + char v81; // dl@217 + int v82; // edx@218 + char v83; // dl@223 + int v84; // edx@224 + char v85; // dl@229 + int v86; // edx@230 + char v87; // dl@233 + int v88; // edx@234 + char v89; // dl@237 + int v90; // edx@238 + int v91; // esi@240 + char v92; // dl@240 + int v93; // esi@240 + char v94; // bl@241 + int v95; // edx@243 + int v96; // edi@244 + char v97; // dl@245 + int v98; // edx@246 + char v99; // dl@249 + int v100; // edx@250 + char v101; // dl@253 + int v102; // edx@254 + char v103; // dl@257 + int v104; // edx@258 + char v105; // dl@261 + ArcomagePlayer *v106; // ebx@262 + ArcomagePlayer *v107; // edx@262 + int v108; // esi@270 + int v109; // edx@270 + int v110; // edx@273 + int v111; // esi@276 + int v112; // edi@284 + // int j; // esi@284 + am_2 *v114; // eax@286 + int v115; // ecx@288 + int v116; // edx@288 + int v117; // ebx@288 + int v118; // eax@291 + int v119; // esi@292 + int v120; // [sp-28h] [bp-28h]@129 + int v121; // [sp-28h] [bp-28h]@276 + int k; // [sp-24h] [bp-24h]@18 + int i; // [sp-24h] [bp-24h]@167 + int v124; // [sp-20h] [bp-20h]@5 + int v125; // [sp-20h] [bp-20h]@4 + int v126; // [sp-1Ch] [bp-1Ch]@17 + int v127; // [sp-1Ch] [bp-1Ch]@139 + int v128; // [sp-1Ch] [bp-1Ch]@166 + int v129; // [sp-1Ch] [bp-1Ch]@286 + int v130; // [sp-18h] [bp-18h]@5 + int cards_count; // [sp-18h] [bp-18h]@4 + int v132; // [sp-14h] [bp-14h]@0 + int v133; // [sp-14h] [bp-14h]@93 + int v134; // [sp-14h] [bp-14h]@129 + int v135; // [sp-14h] [bp-14h]@240 + int v136; // [sp-14h] [bp-14h]@276 + ArcomagePlayer *enemy; // [sp-10h] [bp-10h]@5 + ArcomagePlayer *enemy1; // [sp-10h] [bp-10h]@4 + ArcomagePlayer *player; // [sp-Ch] [bp-Ch]@5 + ArcomagePlayer *player1; // [sp-Ch] [bp-Ch]@4 + char v141; // [sp-8h] [bp-8h]@35 + char v142; // [sp-8h] [bp-8h]@183 + char v143; // [sp-5h] [bp-5h]@20 + char v144; // [sp-5h] [bp-5h]@169 + + byte_4FAA00 = 1; + if ( opponent_mastery == 0) + { + if ( need_to_discard_card==0 ) //am_byte_4FAA77 + { + for(int i = 0; i<10 ; ++i ) + { + all_player_cards_count = GetPlayerHandCardCount(player_num); + random_card_slot = rand_interval(0, all_player_cards_count - 1); + if ( CanCardBePlayed(player_num, random_card_slot) ) + return PlayCard(player_num, random_card_slot); + } + } + all_player_cards_count = GetPlayerHandCardCount(player_num); + random_card_slot= rand_interval(0, all_player_cards_count - 1); + return DiscardCard(player_num, random_card_slot); + } + else if (( opponent_mastery == 1 )|| ( opponent_mastery == 2 )) + { + player = &am_Players[player_num]; + enemy = &am_Players[(player_num + 1) % 2]; + all_player_cards_count = GetPlayerHandCardCount(player_num); + for(int i = 0; i<10 ; ++i ) + { + if ( i >= all_player_cards_count ) + { + cards_power[i].slot_index = -1; + cards_power[i].card_power = -9999; + } + else + { + cards_power[i].slot_index = i; + cards_power[i].card_power = 0; + } + } + for(int i = 0; i< all_player_cards_count ; ++i ) + { + v12 = &pCards[am_Players[player_num].cards_at_hand[cards_power[i].slot_index]]; + cards_power[i].card_power = CalculateCardPower(player, enemy, v12, opponent_mastery-1); + } + + for (int j = all_player_cards_count - 1; j >= 0; --j ) + { + for (int m=0; m= 0 ) + { + while ( !pCards[am_Players[player_num].cards_at_hand[cards_power[v59].slot_index]].can_be_discarded ) + { + --v59; + if ( v59 < 0 ) + return DiscardCard(player_num, v132); + } + v132 = cards_power[v59].slot_index; + } + } + else + { + v60 = 0; + if ( all_player_cards_count - 1 >= 0 ) + { + while ( !pCards[am_Players[player_num].cards_at_hand[cards_power[v59].slot_index]].can_be_discarded ) + { + --v59; + if ( v59 < 0 ) + goto LABEL_150; + } + v132 = cards_power[v59].slot_index; + } +LABEL_150: + if ( (all_player_cards_count - 1)> 0 ) + { + while ( !CanCardBePlayed(player_num, cards_power[v60].slot_index) || cards_power[v60].card_power < 0 ) + { + ++v60; + if ( v60 >= all_player_cards_count - 1 ) + return DiscardCard(player_num, v132); + } + return PlayCard(player_num, cards_power[v60].slot_index); + } + } + return DiscardCard(player_num, v132); + } + + return true;//result != 0; } -// 408BB4: could not find valid save-restore pair for ebp -// 4DF3A4: using guessed type int dword_4DF3A4; -// 4E1884: using guessed type int dword_4E1884; -// 4FA9B0: using guessed type int dword_4FA9B0[]; -// 4FA9B4: using guessed type int dword_4FA9B4[]; -// 4FAA00: using guessed type char byte_4FAA00; -// 4FAA77: using guessed type char am_byte_4FAA77; @@ -1568,18 +1248,18 @@ GetNextCardFromDeck(current_player_num); while ( 1 ) { - byte_4FAA24 = am_40A560(current_player_num); + byte_4FAA24 = PlayerTurn(current_player_num); if ( GetPlayerHandCardCount(current_player_num) <= minimum_cards_at_hand ) break; - am_byte_4FAA77 = 1; + need_to_discard_card = 1; if ( pArcomageGame->field_F4 ) goto LABEL_8; } - am_byte_4FAA77 = 0; + need_to_discard_card = 0; } pArcomageGame->GameOver = IsGameOver(); if ( !pArcomageGame->GameOver ) - am_40A383(); + TurnChange(); if ( pArcomageGame->field_F4 ) pArcomageGame->GameOver = 1; } @@ -1657,16 +1337,15 @@ am_Players[i].cards_at_hand[j] = -1; if ( am_byte_4E185D ) { - am_Players[i].arr_6C[j].field_0 = -1; - am_Players[i].arr_6C[j].field_4 = -1; + am_Players[i].card_shift[j].x = -1; + am_Players[i].card_shift[j].y = -1; } else { - am_Players[i].arr_6C[j].field_0 = 0; - am_Players[i].arr_6C[j].field_4 = 0; + am_Players[i].card_shift[j].x = 0; + am_Players[i].card_shift[j].y = 0; } - } - + } } strcpy(deckMaster.name, pDeckMaster); for (i=0, card_dispenser_counter=-2, card_id_counter=0; i -1 ) { - for (v3 = 0; v3field_F6 = 1; byte_4FAA2D = 1; } @@ -1830,20 +1505,16 @@ { am_Players[player_num].resource_bricks += quarry_bonus + am_Players[player_num].quarry_level; am_Players[player_num].resource_gems += magic_bonus + am_Players[player_num].magic_level; - am_Players[player_num].resource_beasts += zoo_bonus + am_Players[player_num].zoo_level; + am_Players[player_num].resource_beasts += zoo_bonus + am_Players[player_num].zoo_level; } //----- (0040A383) -------------------------------------------------------- -void __cdecl am_40A383() -{ - int v0; // eax@4 - int v1; // ecx@4 - unsigned __int8 v2; // sf@4 - unsigned __int8 v3; // of@4 - int v4; // eax@6 - char Dest[64]; // [sp+4h] [bp-64h]@4 - RECT v6; // [sp+44h] [bp-24h]@6 +void TurnChange() + { + + char player_name[64]; // [sp+4h] [bp-64h]@4 + // RECT v6; // [sp+44h] [bp-24h]@6 ArcomageGame_stru1 v10; // [sp+54h] [bp-14h]@7 POINT v11; // [sp+60h] [bp-8h]@4 @@ -1862,23 +1533,20 @@ //nullsub_1(); // v11.x = 0; // v11.y = 0; - strcpy(Dest,"The Next Player is: ");//"" + strcpy(player_name,"The Next Player is: ");//"" // v0 = 0; v11.y = 200; v11.x = 320; // - 12 * v0 / 2; - pPrimaryWindow_draws_text(-1, Dest, &v11); + pPrimaryWindow_draws_text(-1, player_name, &v11); am_byte_4FAA75 = 1; - v1 = ++current_player_num; - if ( v1 >= 2 ) - { - v1 = 0; + ++current_player_num; + if ( current_player_num >= 2 ) current_player_num = 0; - } - strcpy(Dest, am_Players[v1].pPlayerName); + strcpy(player_name, am_Players[current_player_num].pPlayerName); // v4 = 0; v11.y = 260; v11.x = 320;// - 12 * v4 / 2; - pPrimaryWindow_draws_text(-1, Dest, &v11); + pPrimaryWindow_draws_text(-1, player_name, &v11); /* v6.left = 0; v6.right = 640; v6.top = 0; @@ -1887,28 +1555,25 @@ CallRenderPresent(); //nullsub_1(); while ( 1 ) - { - while ( 1 ) - { + { while ( !ArcomageGame::MsgLoop(20, &v10) ) ; - if ( v10.field_0 != 1 ) - break; - if ( v10.field_4 ) - goto LABEL_13; - //nullsub_1(); - } - if ( v10.field_0 > 4 ) - { - if ( v10.field_0 <= 8 ) - goto LABEL_13; - if ( v10.field_0 == 10 ) - break; - } + if ( v10.field_0 == 1 ) + { + if ( v10.field_4 ) + break; + //nullsub_1(); + continue; + } + if (( v10.field_0 > 4 )&& ( v10.field_0 <= 8 )) + break; + if ( v10.field_0 == 10 ) + { + pArcomageGame->field_F4 = 1; + byte_4FAA74 = 1; + break; + } } - pArcomageGame->field_F4 = 1; - byte_4FAA74 = 1; -LABEL_13: /* v11.x = 0; v11.y = 0; v6.left = 0; @@ -1947,8 +1612,8 @@ //----- (0040A560) -------------------------------------------------------- -char am_40A560(unsigned int player_num) -{ +char PlayerTurn( int player_num ) + { int v1; // ebp@0 unsigned __int64 v2; // qax@3 unsigned __int64 v3; // kr00_8@3 @@ -1960,13 +1625,13 @@ int v10[4]; // [sp+80h] [bp-30h]@69 POINT pTargetXY; // [sp+90h] [bp-20h]@75 ArcomageGame_stru1 a2; // [sp+98h] [bp-18h]@8 - int v13; // [sp+A4h] [bp-Ch]@1 + int animation_stage; // [sp+A4h] [bp-Ch]@1 char v15; // [sp+AEh] [bp-2h]@63 - char v16; // [sp+AFh] [bp-1h]@1 + bool break_loop; // [sp+AFh] [bp-1h]@1 uCardID = -1; - v16 = 0; - v13 = 20; + break_loop = false; + animation_stage = 20; byte_4FAA00 = 0; dword_4FAA68 = 0; amuint_4FAA38 = 10; @@ -1982,9 +1647,9 @@ } while (v3 < 6); - pArcomageGame->event_timer_time = pEventTimer->Time(); + pArcomageGame->event_timer_time = (unsigned int )pEventTimer->Time(); if ( pArcomageGame->field_F4 ) - v16 = 1; + break_loop = 1; ArcomageGame::MsgLoop(0, &a2); switch ( a2.field_0 ) { @@ -1993,7 +1658,7 @@ { pAudioPlayer->StopChannels(-1, -1); dword_4FAA68 = 0; - v16 = 1; + break_loop = true; pArcomageGame->field_F4 = 1; } break; @@ -2003,16 +1668,17 @@ case 10: pAudioPlayer->StopChannels(-1, -1); byte_4FAA74 = 1; - v16 = 1; + break_loop = true; pArcomageGame->field_F4 = 1; break; } - if (am_Players[current_player_num].IsHisTurn != 1 && !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D ) + if (am_Players[current_player_num].IsHisTurn != 1 && + !byte_4FAA00 && !byte_4FAA2E && !byte_4FAA2D ) { if ( am_byte_4FAA75 ) am_byte_4FAA76 = 1; - am_408BB4(current_player_num); + OpponentsAITurn(current_player_num); byte_4FAA2E = 1; } if ( amuint_4FAA4C != -1 && amuint_4FAA38 > 10 ) @@ -2027,13 +1693,13 @@ { byte_4FAA2D = 0; amuint_4FAA38 = 10; - v16 = 0; + break_loop = false; } } if ( byte_4FAA2E ) { - --v13; - if ( v13 < 0 ) + --animation_stage; + if ( animation_stage < 0 ) { if ( dword_4FAA68 > 1 ) { @@ -2042,36 +1708,36 @@ } else { - v16 = 1; + break_loop = true; } byte_4FAA2E = 0; - v13 = 20; + animation_stage = 20; } } } else { - if ( am_byte_4FAA77 ) + if ( need_to_discard_card ) { - if ( a2.field_0 == 7 && am_40BCFB(player_num, current_card_slot_index) ) + if ( a2.field_0 == 7 && DiscardCard(player_num, current_card_slot_index) ) { if ( am_byte_4FAA75 ) am_byte_4FAA76 = 1; if ( dword_4FAA64 > 0 ) { --dword_4FAA64; - am_byte_4FAA77 = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; + need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; } byte_4FAA2E = 1; } - if ( a2.field_0 == 8 && am_40BCFB(player_num, current_card_slot_index) ) + if ( a2.field_0 == 8 && DiscardCard(player_num, current_card_slot_index) ) { if ( am_byte_4FAA75 ) am_byte_4FAA76 = 1; if ( dword_4FAA64 > 0 ) { --dword_4FAA64; - am_byte_4FAA77 = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; + need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; } byte_4FAA2E = 1; } @@ -2089,7 +1755,7 @@ } if ( a2.field_0 == 8 ) { - if ( am_40BCFB(player_num, current_card_slot_index) ) + if ( DiscardCard(player_num, current_card_slot_index) ) { byte_4FAA2E = 1; if ( am_byte_4FAA75 ) @@ -2134,12 +1800,12 @@ //} if ( dword_4FABB8 != DrawCardsRectangles(player_num) ) { - dword_4FABB8 = DrawCardsRectangles(player_num); - pArcomageGame->field_F6 = 1; + dword_4FABB8 = DrawCardsRectangles(player_num); + pArcomageGame->field_F6 = 1; } if ( pArcomageGame->field_F6 ) { - DrawGameUI(v13); + DrawGameUI(animation_stage); DoBlt_Copy(pArcomageGame->pBackgroundPixels); pArcomageGame->field_F6 = 0; } @@ -2154,18 +1820,18 @@ am_BeginScene(pArcomageGame->pBackgroundPixels, -1, 1); Blt_Copy(&pSrcXYZW, &pTargetXY, 2); am_EndScene(); - DrawGameUI(v13); + DrawGameUI(animation_stage); pRenderer->Present(); pArcomageGame->field_F9 = 0; } } - while ( !v16 ); + while ( !break_loop ); return dword_4FAA68 > 0; } //----- (0040A9AF) -------------------------------------------------------- -void DrawGameUI( int a1 ) +void DrawGameUI( int animation_stage ) { am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); @@ -2180,54 +1846,41 @@ am_EndScene(); am_BeginScene(pArcomageGame->pSpritesPixels, -1, 1); - DrawCardAnimation(a1); + DrawCardAnimation(animation_stage); for( int i=0; i<10; ++i) { - if (array_4FABD0[i].field_0) - array_4FABD0[i].field_40->_40E133(); + if (array_4FABD0[i].have_effect) + array_4FABD0[i].field_40->DrawEffect(); } current_card_slot_index = DrawCardsRectangles(current_player_num); - am_40AA4E(); + DrawSparks(); am_EndScene(); } //----- (0040AA4E) -------------------------------------------------------- -void am_40AA4E() +void DrawSparks() { - int v5; // [sp-4h] [bp-2Ch]@4 - unsigned int v7; - int v8; // [sp+14h] [bp-14h]@10 - int v9; // [sp+18h] [bp-10h]@10 - RECT pXYZW; - - v9 = 0x0000FF00; - v8 = 0x000000FF; + int rgb_pixel_color; // [sp-4h] [bp-2Ch]@4 + unsigned int pixel_color; for (int i=0; i<10; ++i) { - if(array_4FABD0[i].field_0 && (array_4FABD0[i].field_40->_40E2A7()==2)) + if(array_4FABD0[i].have_effect && (array_4FABD0[i].field_40->_40E2A7()==2)) { - - v5 = v9; - if ( !array_4FABD0[i].field_1 ) - v5 = v8; - - v7 = R8G8B8_to_TargetFormat(v5); + rgb_pixel_color = 0x0000FF00; + if ( !array_4FABD0[i].effect_sign ) + rgb_pixel_color = 0x000000FF; + + pixel_color = R8G8B8_to_TargetFormat(rgb_pixel_color); for(int j=0; j<150; ++j ) { - if (array_4FABD0[i].field_44[j].field_0 > 0) + if (array_4FABD0[i].effect_sparks[j].have_spark > 0) { if (j%2) - SetPixel(&array_4FABD0[i].field_44[j].field_4, v7); + SetPixel(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color); else - { - pXYZW.left = array_4FABD0[i].field_44[j].field_4.x; - pXYZW.right = pXYZW.left + 2; - pXYZW.top = array_4FABD0[i].field_44[j].field_4.y; - pXYZW.bottom = pXYZW.top + 2; - DrawRect(&pXYZW, v7, 1); - } + SetPixel2sq(&array_4FABD0[i].effect_sparks[j].spark_position, pixel_color); } } } @@ -2242,8 +1895,8 @@ RECT pSrcRect; // [sp+Ch] [bp-18h]@1 POINT pTargetXY; // [sp+1Ch] [bp-8h]@1 //resources rectangles + pSrcRect.left = 765; pSrcRect.top = 0; - pSrcRect.left = 765; pSrcRect.right = 843; pSrcRect.bottom = 216; @@ -2257,8 +1910,8 @@ //players name rectangle pSrcRect.left = 283; + pSrcRect.top = 166; pSrcRect.right = 361; - pSrcRect.top = 166; pSrcRect.bottom = 190; pTargetXY.x = 8; pTargetXY.y = 13; @@ -2268,10 +1921,10 @@ pTargetXY.y = 13; Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); - //tower heigth rectangle + //tower height rectangle pSrcRect.left = 234; + pSrcRect.top = 166; pSrcRect.right = 283; - pSrcRect.top = 166; pSrcRect.bottom = 190; pTargetXY.x = 100; pTargetXY.y = 296; @@ -2281,10 +1934,10 @@ pTargetXY.y = 296; Blt_Chroma(&pSrcRect, &pTargetXY, pArcomageGame->field_54, 2); - //wall heigth rectangle - pSrcRect.left = 192; + //wall height rectangle + pSrcRect.left = 192; + pSrcRect.top = 166; pSrcRect.right = 234; - pSrcRect.top = 166; pSrcRect.bottom = 190; pTargetXY.x = 168; pTargetXY.y = 296; @@ -2303,7 +1956,7 @@ char text_buff[32]; // [sp+Ch] [bp-28h]@2 POINT text_position; // [sp+2Ch] [bp-8h]@2 - if ( am_byte_4FAA77 ) + if ( need_to_discard_card ) { strcpy(text_buff, pGlobalTXT_LocalizationStrings[266]);// DISCARD A CARD text_position.x = 320 - pArcomageGame->pfntArrus->GetLineWidth(text_buff) / 2; @@ -2345,7 +1998,7 @@ pPrimaryWindow_draws_text(-1, text_buff, &text_position); res_value = am_Players[0].quarry_level; - if ( byte_4E185E ) + if ( use_start_bonus ) res_value =am_Players[0].quarry_level + quarry_bonus; intToString(res_value, text_buff); text_position.x = 14;// - 6 * 0 / 2; @@ -2353,7 +2006,7 @@ DrawPlayerLevels(-1, text_buff, &text_position); res_value = am_Players[1].quarry_level; - if ( byte_4E185E ) + if ( use_start_bonus ) res_value = am_Players[1].quarry_level + quarry_bonus; intToString(res_value, text_buff); // v2 = 0; @@ -2362,7 +2015,7 @@ DrawPlayerLevels(-1, text_buff, &text_position); res_value = am_Players[0].magic_level; - if ( byte_4E185E ) + if ( use_start_bonus ) res_value = am_Players[0].magic_level + magic_bonus; intToString(res_value, text_buff); // v4 = 0; @@ -2371,8 +2024,8 @@ DrawPlayerLevels(-1, text_buff, &text_position); res_value = am_Players[1].magic_level; - if ( byte_4E185E ) - res_value = am_Players[1].magic_level+magic_bonus; + if ( use_start_bonus ) + res_value = am_Players[1].magic_level + magic_bonus; intToString(res_value, text_buff); // v6 = 0; text_position.y = 164; @@ -2380,7 +2033,7 @@ DrawPlayerLevels(-1, text_buff, &text_position); res_value = am_Players[0].zoo_level; - if ( byte_4E185E ) + if ( use_start_bonus ) res_value = am_Players[0].zoo_level + zoo_bonus; intToString(res_value, text_buff); // v8 = 0; @@ -2389,7 +2042,7 @@ DrawPlayerLevels(-1, text_buff, &text_position); res_value = am_Players[1].zoo_level; - if ( byte_4E185E ) + if ( use_start_bonus ) res_value = am_Players[1].zoo_level + zoo_bonus; intToString(res_value, text_buff); // v10 = 0; @@ -2652,7 +2305,7 @@ v3 = 100; - if ( am_Players[1].wall_height <= 0 ) + if ( am_Players[1].wall_height > 0 ) { pSrcXYZW.top = 0; @@ -2704,11 +2357,11 @@ while ( v2 < v0 ) { v3 = current_player_num; - if ( am_byte_4E185D != 0 ) + if ( am_byte_4E185D) { - pTargetXY.x += am_Players[current_player_num].arr_6C[v2].field_0 ; - pTargetXY.y += am_Players[current_player_num].arr_6C[v2].field_4; + pTargetXY.x += am_Players[current_player_num].card_shift[v2].x ; + pTargetXY.y += am_Players[current_player_num].card_shift[v2].y; } v7 = am_Players[current_player_num].cards_at_hand[v2]; if ( v7 == -1 ) @@ -2740,10 +2393,10 @@ v3 = current_player_num; pTargetXY.x += v24 + 96; LABEL_15: - if ( am_byte_4E185D != 0 ) + if ( am_byte_4E185D ) { - pTargetXY.x -= am_Players[current_player_num].arr_6C[v2].field_0 ; - pTargetXY.y -= am_Players[current_player_num].arr_6C[v2].field_4 ; + pTargetXY.x -= am_Players[current_player_num].card_shift[v2].x ; + pTargetXY.y -= am_Players[current_player_num].card_shift[v2].y ; } ++v2; } @@ -2852,8 +2505,8 @@ { // 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; + amuint_4FAA3C_blt_xy.x=(amuint_4FAA4C * v2 + am_Players[current_player_num].card_shift[amuint_4FAA4C].x-120)/10; + v4 = (am_Players[current_player_num].card_shift[amuint_4FAA4C].y+309) /10;//(*(&am_Players[0].arr_6C[0][1] + v3) + 309) / 10; } else { @@ -2965,17 +2618,7 @@ 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); @@ -3058,7 +2701,7 @@ //----- (0040BB67) -------------------------------------------------------- signed int DrawCardsRectangles( int player_num ) { - +//need do fix rectangle not fit to card //int v1; // esi@1 signed int result; // eax@1 @@ -3139,8 +2782,8 @@ if ( am_byte_4E185D ) { // v9 = v3 + 8 * v7; - v10 = am_Players[player_num].arr_6C[v7].field_0;//*(am_player[0].arr_6C[0] + v9); - v11 = am_Players[player_num].arr_6C[v7].field_4;//*(&am_player[0].arr_6C[0][1] + v9); + v10 = am_Players[player_num].card_shift[v7].x;//*(am_player[0].arr_6C[0] + v9); + v11 = am_Players[player_num].card_shift[v7].y;//*(&am_player[0].arr_6C[0][1] + v9); pXYZW.left += v10; pXYZW.right += v10; pXYZW.top += v11; @@ -3156,8 +2799,8 @@ pXYZW.right += var18; if ( am_byte_4E185D ) { - v16 = am_Players[player_num].arr_6C[v30].field_0;//*(am_player[0].arr_6C[0] + v15); - v17 = am_Players[player_num].arr_6C[v30].field_4;//*(&am_player[0].arr_6C[0][1] + v15); + v16 = am_Players[player_num].card_shift[v30].x;//*(am_player[0].arr_6C[0] + v15); + v17 = am_Players[player_num].card_shift[v30].y;//*(&am_player[0].arr_6C[0][1] + v15); pXYZW.left -= v16; pXYZW.right -= v16; pXYZW.top -= v17; @@ -3192,7 +2835,7 @@ // 4E185D: using guessed type char am_byte_4E185D; //----- (0040BCFB) -------------------------------------------------------- -bool am_40BCFB( int player_num, signed int card_slot_index ) +bool DiscardCard( int player_num, signed int card_slot_index ) { int v2; // esi@2 signed int v3; // edi@2 @@ -3224,13 +2867,13 @@ } } - if ( pCards[am_Players[player_num].cards_at_hand[i]].field_2B) + if ( pCards[am_Players[player_num].cards_at_hand[i]].can_be_discarded) { ArcomageGame::PlaySound(22); v8 = GetPlayerHandCardCount(current_player_num); - v10=am_Players[player_num].arr_6C[i].field_0 + (640 - 96 * v8) / (v8 + 1); + v10=am_Players[player_num].card_shift[i].x + (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; + amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[i].y + 327;//v11; v12 = 0; if ( !am_byte_4FAA75 ) @@ -3244,48 +2887,42 @@ pArcomageGame->field_F6 = 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; + need_to_discard_card = 0; return true; } else return false; } -// 4FAA75: using guessed type char am_byte_4FAA75; -// 4FAA77: using guessed type char am_byte_4FAA77; -// 4FAA78: using guessed type int amuint_4FAA78[]; -// 4FAA80: using guessed type int amuint_4FAA80[]; -// 4FAA84: using guessed type int amuint_4FAA84[]; -// 4FABB8: using guessed type int dword_4FABB8; + //----- (0040BE0E) -------------------------------------------------------- bool PlayCard( int player_num, signed int card_slot_num ) { - bool result; // eax@0 + int v3; // ebp@1 int v4; // ecx@2 ArcomagePlayer *v5; // esi@2 - int v6; // edi@2 + int card_index; // edi@2 int v7; // eax@2 int v8; // ebx@8 - int v9; // eax@8 + int cards_at_hand; // eax@8 int v10; // ebx@8 int v11; // ebp@8 int v12; // ecx@8 int v13; // eax@8 - ArcomageCard *v14; // eax@8 + ArcomageCard *pCard; // eax@8 int v15; // ecx@8 int v16; // ecx@8 if ( card_slot_num <= -1 ) return false; + v4 = 0; - - for (v6=0; v6<10; ++v6) + for (card_index=0; card_index<10; ++card_index) { - if ( am_Players[player_num].cards_at_hand[v6] != -1 ) + if ( am_Players[player_num].cards_at_hand[card_index] != -1 ) { if ( card_slot_num == v4 ) break; @@ -3293,29 +2930,29 @@ } } - result = CanCardBePlayed(player_num, v6); - if ( result ) + if (CanCardBePlayed(player_num, card_index) ) { ArcomageGame::PlaySound(23); - v9 = GetPlayerHandCardCount(current_player_num); - // v10 = 188 * v8 + 8 * v6; - // v11 = v6 + 47 * v3; + cards_at_hand = GetPlayerHandCardCount(current_player_num); pArcomageGame->field_F6 = 1; - v12 = am_Players[player_num].arr_6C[v6].field_0 + (640 - 96 * v9) / (v9 + 1)+ 96 * v6 +(640 - 96 * v9) / (v9 + 1); + v12 = am_Players[player_num].card_shift[card_index].x + + (640 - 96 * cards_at_hand) / (cards_at_hand + 1)+ + 96 * card_index ; + // v13 = *(int *)((char *)&am_Players[0].arr_6C[0][1] + v10) + 327; amuint_4FAA5C_blt_xy.x = v12;//v12; - amuint_4FAA5C_blt_xy.y = am_Players[player_num].arr_6C[v6].field_4 + 327;//v13; + amuint_4FAA5C_blt_xy.y = am_Players[player_num].card_shift[card_index].y + 327;//v13; amuint_4FAA54_blt_xy.x = (272 - v12) / 5; amuint_4FAA54_blt_xy.y = -30; - v14 = &pCards[am_Players[player_num].cards_at_hand[v6]]; - am_Players[player_num].resource_bricks -= v14->needed_bricks; - am_Players[player_num].resource_beasts -= v14->needed_beasts; - am_Players[player_num].resource_gems -= v14->needed_gems; - played_card_id = am_Players[player_num].cards_at_hand[v6]; - am_Players[player_num].cards_at_hand[v6] = -1; - return true;; + pCard = &pCards[am_Players[player_num].cards_at_hand[card_index]]; + am_Players[player_num].resource_bricks -= pCard->needed_bricks; + am_Players[player_num].resource_beasts -= pCard->needed_beasts; + am_Players[player_num].resource_gems -= pCard->needed_gems; + played_card_id = am_Players[player_num].cards_at_hand[card_index]; + am_Players[player_num].cards_at_hand[card_index] = -1; + return true; } else return false; @@ -3353,1962 +2990,643 @@ //----- (0040BF77) -------------------------------------------------------- void ApplyCardToPlayer( int player_num, unsigned int uCardID ) { -// ArcomagePlayer *v2; // esi@1 -// int v3; // eax@1 -// ArcomagePlayer *v4; // edi@1 -// int v5; // eax@2 -// char v6; // sf@2 -// unsigned __int8 v7; // of@2 -// int v8; // eax@3 -// int v9; // eax@4 -// char v10; // zf@5 -// int v11; // eax@8 -// unsigned __int8 v12; // zf@8 -// char v13; // sf@8 -// unsigned __int8 v14; // of@8 -// int v15; // eax@9 -// int v16; // eax@10 -// char v17; // zf@12 -// char v18; // al@15 -// int v19; // eax@16 -// int v20; // eax@17 -// int v21; // eax@22 -// int v22; // eax@23 -// int v23; // eax@26 -// int v24; // edx@26 -// signed int v25; // ebx@26 -// ArcomageCard *v26; // ebx@28 -// int v27; // eax@28 -// int v28; // edx@33 -// int v29; // eax@33 -// int v30; // eax@35 -// int v31; // edx@40 -// int v32; // eax@40 -// int v33; // eax@42 -// int v34; // edx@47 -// int v35; // eax@47 -// int v36; // eax@49 -// int v37; // edx@54 -// int v38; // eax@54 -// bool v39; // eax@56 -// int v40; // edx@61 -// int v41; // eax@61 -// int v42; // eax@63 -// int v43; // edx@68 -// int v44; // eax@68 -// char v45; // al@70 -// int v46; // eax@72 -// int v47; // edx@77 -// int v48; // eax@77 -// int v49; // eax@79 -// int v50; // edx@84 -// int v51; // eax@84 -// int v52; // eax@86 -// int v53; // eax@91 -// int v54; // edx@91 -// int v55; // eax@93 -// int v56; // eax@98 -// int v57; // edx@98 -// int v58; // eax@100 -// int v59; // eax@105 -// int v60; // edx@105 -// int v61; // eax@107 -// int v62; // eax@112 -// int v63; // edx@112 -// int v64; // eax@114 -// int v65; // eax@119 -// int v66; // edx@119 -// int v67; // eax@121 -// int v68; // eax@126 -// int v69; // edx@126 -// char v70; // al@128 -// int v71; // eax@130 -// int v72; // eax@135 -// int v73; // edx@135 -// int v74; // eax@137 -// int v75; // eax@142 -// int v76; // edx@142 -// int v77; // eax@144 -// int v78; // eax@151 -// int v79; // ecx@151 -// int v80; // eax@155 -// int v81; // eax@162 -// int v82; // ecx@162 -// int v83; // eax@166 -// int v84; // eax@173 -// int v85; // ecx@173 -// int v86; // eax@177 -// int v87; // eax@184 -// int v88; // ecx@184 -// bool v89; // eax@188 -// int v90; // eax@195 -// int v91; // ecx@195 -// int v92; // eax@199 -// int v93; // eax@206 -// int v94; // ecx@206 -// char v95; // al@210 -// int v96; // eax@211 -// int v97; // edx@211 -// int v98; // eax@211 -// int v99; // eax@211 -// int v100; // eax@212 -// int v101; // eax@219 -// int v102; // ecx@219 -// int v103; // eax@223 -// int v104; // eax@231 -// int v105; // edx@231 -// signed int v106; // ebx@231 -// ArcomageCard *v107; // ebx@233 -// int v108; // eax@233 -// int v109; // edx@238 -// int v110; // eax@238 -// int v111; // eax@240 -// int v112; // edx@245 -// int v113; // eax@245 -// int v114; // eax@247 -// int v115; // edx@252 -// int v116; // eax@252 -// int v117; // eax@254 -// int v118; // edx@259 -// int v119; // eax@259 -// bool v120; // eax@261 -// int v121; // edx@266 -// int v122; // eax@266 -// int v123; // eax@268 -// int v124; // edx@273 -// int v125; // eax@273 -// char v126; // al@275 -// int v127; // eax@277 -// int v128; // edx@282 -// int v129; // eax@282 -// int v130; // eax@284 -// int v131; // edx@289 -// int v132; // eax@289 -// int v133; // eax@291 -// int v134; // eax@296 -// int v135; // edx@296 -// int v136; // eax@298 -// int v137; // eax@303 -// int v138; // edx@303 -// int v139; // eax@305 -// int v140; // eax@310 -// int v141; // edx@310 -// int v142; // eax@312 -// int v143; // eax@317 -// int v144; // edx@317 -// int v145; // eax@319 -// int v146; // eax@324 -// int v147; // edx@324 -// int v148; // eax@326 -// int v149; // eax@331 -// int v150; // edx@331 -// char v151; // al@333 -// int v152; // eax@335 -// int v153; // eax@340 -// int v154; // edx@340 -// int v155; // eax@342 -// int v156; // eax@347 -// int v157; // edx@347 -// int v158; // eax@349 -// int v159; // eax@356 -// int v160; // ecx@356 -// int v161; // eax@360 -// int v162; // eax@367 -// int v163; // ecx@367 -// int v164; // eax@371 -// int v165; // eax@378 -// int v166; // ecx@378 -// int v167; // eax@382 -// int v168; // eax@389 -// int v169; // ecx@389 -// bool v170; // eax@393 -// int v171; // eax@400 -// int v172; // ecx@400 -// int v173; // eax@404 -// int v174; // eax@411 -// int v175; // ecx@411 -// char v176; // al@415 -// int v177; // eax@416 -// int v178; // edx@416 -// int v179; // eax@416 -// int v180; // eax@416 -// int v181; // eax@417 -// int v182; // eax@424 -// int v183; // ecx@424 -// int v184; // eax@429 -// int v185; // ecx@429 -// signed int v186; // esi@511 -// Vec2_int_ v187; // [sp+Ch] [bp-64h]@488 -// //int v188; // [sp+10h] [bp-60h]@488 -// int v189; // [sp+14h] [bp-5Ch]@1 -// ArcomageCard *pCard; // [sp+18h] [bp-58h]@1 -// int v191; // [sp+1Ch] [bp-54h]@1 -// int v192; // [sp+20h] [bp-50h]@1 -// int v193; // [sp+24h] [bp-4Ch]@1 -// int v194; // [sp+28h] [bp-48h]@1 -// int v195; // [sp+2Ch] [bp-44h]@1 -// int v196; // [sp+30h] [bp-40h]@1 -// int v197; // [sp+34h] [bp-3Ch]@1 -// int v198; // [sp+38h] [bp-38h]@1 -// int v199; // [sp+3Ch] [bp-34h]@1 -// int v200; // [sp+40h] [bp-30h]@1 -// int v201; // [sp+44h] [bp-2Ch]@1 -// int v202; // [sp+48h] [bp-28h]@1 -// int v203; // [sp+4Ch] [bp-24h]@1 -// int v204; // [sp+50h] [bp-20h]@1 -// bool v205; // [sp+54h] [bp-1Ch]@1 -// int v206; // [sp+58h] [bp-18h]@1 -// int v207; // [sp+5Ch] [bp-14h]@1 -// int v208; // [sp+60h] [bp-10h]@1 -// int v209; // [sp+64h] [bp-Ch]@1 -// int v210; // [sp+68h] [bp-8h]@1 -// int v211; // [sp+6Ch] [bp-4h]@1 -// -// v194 = 0; -// v210 = 0; -// v208 = 0; -// v197 = 0; -// v205 = 0; -// v203 = 0; -// v201 = 0; -// v199 = 0; -// v192 = 0; -// v196 = 0; -// v211 = 0; -// v209 = 0; -// v207 = 0; -// v206 = 0; -// v204 = 0; -// v202 = 0; -// v200 = 0; -// v198 = 0; -// v191 = 0; -// v195 = 0; -// v193 = a1; -// v2 = &stru_505708[a1]; -// pCard = &pCards[uCardID]; -// v3 = pCard->field_2C; -// v189 = (a1 + 1) % 2; -// v4 = &stru_505708[v189]; -// switch ( v3 ) -// { -// case 2: -// v5 = v2->field_2C; -// v7 = __OFSUB__(v5, v4->field_2C); -// v6 = v5 - v4->field_2C < 0; -// goto LABEL_18; -// case 3: -// v8 = v2->field_30; -// v7 = __OFSUB__(v8, v4->field_30); -// v6 = v8 - v4->field_30 < 0; -// goto LABEL_18; -// case 4: -// v9 = v2->field_34; -// v7 = __OFSUB__(v9, v4->field_34); -// v6 = v9 - v4->field_34 < 0; -// goto LABEL_18; -// case 5: -// v10 = v2->field_2C == v4->field_2C; -// goto LABEL_21; -// case 6: -// v10 = v2->field_30 == v4->field_30; -// goto LABEL_21; -// case 7: -// v10 = v2->field_34 == v4->field_34; -// goto LABEL_21; -// case 8: -// v11 = v2->field_2C; -// v14 = __OFSUB__(v11, v4->field_2C); -// v12 = v11 == v4->field_2C; -// v13 = v11 - v4->field_2C < 0; -// goto LABEL_24; -// case 9: -// v15 = v2->field_30; -// v14 = __OFSUB__(v15, v4->field_30); -// v12 = v15 == v4->field_30; -// v13 = v15 - v4->field_30 < 0; -// goto LABEL_24; -// case 10: -// v16 = v2->field_34; -// v14 = __OFSUB__(v16, v4->field_34); -// v12 = v16 == v4->field_34; -// v13 = v16 - v4->field_34 < 0; -// goto LABEL_24; -// case 11: -// v10 = v2->field_28 == 0; -// goto LABEL_21; -// case 12: -// v17 = v2->field_28 == 0; -// goto LABEL_15; -// case 13: -// v10 = v4->field_28 == 0; -// goto LABEL_21; -// case 14: -// v17 = v4->field_28 == 0; -//LABEL_15: -// v18 = !v17; -// goto LABEL_25; -// case 15: -// v19 = v2->field_28; -// v7 = __OFSUB__(v19, v4->field_28); -// v6 = v19 - v4->field_28 < 0; -// goto LABEL_18; -// case 16: -// v20 = v2->field_24; -// v7 = __OFSUB__(v20, v4->field_24); -// v6 = v20 - v4->field_24 < 0; -//LABEL_18: -// v18 = v6 ^ v7; -// goto LABEL_25; -// case 17: -// v10 = v2->field_28 == v4->field_28; -// goto LABEL_21; -// case 18: -// v10 = v2->field_24 == v4->field_24; -//LABEL_21: -// v18 = v10; -// goto LABEL_25; -// case 19: -// v21 = v2->field_28; -// v14 = __OFSUB__(v21, v4->field_28); -// v12 = v21 == v4->field_28; -// v13 = v21 - v4->field_28 < 0; -// goto LABEL_24; -// case 20: -// v22 = v2->field_24; -// v14 = __OFSUB__(v22, v4->field_24); -// v12 = v22 == v4->field_24; -// v13 = v22 - v4->field_24 < 0; -//LABEL_24: -// v18 = !((unsigned __int8)(v13 ^ v14) | v12); -//LABEL_25: -// if ( v18 ) -// goto LABEL_26; -// goto LABEL_231; -// default: -//LABEL_26: -// v23 = BYTE1(pCard->field_30); -// v24 = v23 + (LOBYTE(pCard->field_30) == 1); -// v25 = 0; -// dword_4FAA68 = v23 + (LOBYTE(pCard->field_30) == 1); -// dword_4FAA64 = v23; -// if ( v23 > 0 ) -// { -// do -// { -// am_40A283(v193, v24); -// ++v25; -// } -// while ( v25 < SBYTE1(pCard->field_30) ); -// } -// v26 = pCard; -// am_byte_4FAA77 = GetPlayerHandCardCount(v193) > dword_4E1874; -// LOBYTE(v27) = BYTE2(pCard->field_30); -// if ( (_BYTE)v27 ) -// { -// if ( (_BYTE)v27 == 99 ) -// { -// v28 = v2->field_2C; -// v29 = v4->field_2C; -// if ( v28 < v29 ) -// { -// v2->field_2C = v29; -// v194 = v29 - v28; -// } -// } -// else -// { -// v27 = (char)v27; -// v6 = (char)v27 + v2->field_2C < 0; -// v2->field_2C += (char)v27; -// if ( v6 ) -// v2->field_2C = 0; -// v194 = v27; -// } -// } -// LOBYTE(v30) = BYTE3(v26->field_30); -// if ( (_BYTE)v30 ) -// { -// if ( (_BYTE)v30 == 99 ) -// { -// v31 = v2->field_30; -// v32 = v4->field_30; -// if ( v31 < v32 ) -// { -// v2->field_30 = v32; -// v210 = v32 - v31; -// } -// } -// else -// { -// v30 = (char)v30; -// v6 = (char)v30 + v2->field_30 < 0; -// v2->field_30 += (char)v30; -// if ( v6 ) -// v2->field_30 = 0; -// v210 = v30; -// } -// } -// LOBYTE(v33) = LOBYTE(v26->field_34); -// if ( (_BYTE)v33 ) -// { -// if ( (_BYTE)v33 == 99 ) -// { -// v34 = v2->field_34; -// v35 = v4->field_34; -// if ( v34 < v35 ) -// { -// v2->field_34 = v35; -// v208 = v35 - v34; -// } -// } -// else -// { -// v33 = (char)v33; -// v6 = (char)v33 + v2->field_34 < 0; -// v2->field_34 += (char)v33; -// if ( v6 ) -// v2->field_34 = 0; -// v208 = v33; -// } -// } -// LOBYTE(v36) = BYTE1(v26->field_34); -// if ( (_BYTE)v36 ) -// { -// if ( (_BYTE)v36 == 99 ) -// { -// v37 = v2->field_38; -// v38 = v4->field_38; -// if ( v37 < v38 ) -// { -// v2->field_38 = v38; -// v197 = v38 - v37; -// } -// } -// else -// { -// v36 = (char)v36; -// v6 = (char)v36 + v2->field_38 < 0; -// v2->field_38 += (char)v36; -// if ( v6 ) -// v2->field_38 = 0; -// v197 = v36; -// } -// } -// LOBYTE(v39) = BYTE2(v26->field_34); -// if ( v39 ) -// { -// if ( v39 == 99 ) -// { -// v40 = v2->field_3C; -// v41 = v4->field_3C; -// if ( v40 < v41 ) -// { -// v2->field_3C = v41; -// v205 = v41 - v40; -// } -// } -// else -// { -// v39 = v39; -// v6 = v39 + v2->field_3C < 0; -// v2->field_3C += v39; -// if ( v6 ) -// v2->field_3C = 0; -// v205 = v39; -// } -// } -// LOBYTE(v42) = BYTE3(v26->field_34); -// if ( (_BYTE)v42 ) -// { -// if ( (_BYTE)v42 == 99 ) -// { -// v43 = v2->field_40; -// v44 = v4->field_40; -// if ( v43 < v44 ) -// { -// v2->field_40 = v44; -// v203 = v44 - v43; -// } -// } -// else -// { -// v42 = (char)v42; -// v6 = (char)v42 + v2->field_40 < 0; -// v2->field_40 += (char)v42; -// if ( v6 ) -// v2->field_40 = 0; -// v203 = v42; -// } -// } -// v45 = v26->field_38[0]; -// if ( v45 ) -// { -// v196 = am_40D402(v193, v45); -// v192 = v26->field_38[0] - v196; -// } -// LOBYTE(v46) = v26->field_38[1]; -// if ( (_BYTE)v46 ) -// { -// if ( (_BYTE)v46 == 99 ) -// { -// v47 = v2->field_28; -// v48 = v4->field_28; -// if ( v47 < v48 ) -// { -// v2->field_28 = v48; -// v201 = v48 - v47; -// } -// } -// else -// { -// v46 = (char)v46; -// v6 = (char)v46 + v2->field_28 < 0; -// v2->field_28 += (char)v46; -// if ( v6 ) -// v2->field_28 = 0; -// v201 = v46; -// } -// } -// LOBYTE(v49) = v26->field_38[2]; -// if ( (_BYTE)v49 ) -// { -// if ( (_BYTE)v49 == 99 ) -// { -// v50 = v2->field_24; -// v51 = v4->field_24; -// if ( v50 < v51 ) -// { -// v2->field_24 = v51; -// v199 = v51 - v50; -// } -// } -// else -// { -// v49 = (char)v49; -// v6 = (char)v49 + v2->field_24 < 0; -// v2->field_24 += (char)v49; -// if ( v6 ) -// v2->field_24 = 0; -// v199 = v49; -// } -// } -// LOBYTE(v52) = v26->field_38[3]; -// if ( (_BYTE)v52 ) -// { -// if ( (_BYTE)v52 == 99 ) -// { -// v53 = v2->field_2C; -// v54 = v4->field_2C; -// if ( v53 > v54 ) -// { -// v4->field_2C = v53; -// v211 = v53 - v54; -// } -// } -// else -// { -// v52 = (char)v52; -// v6 = (char)v52 + v4->field_2C < 0; -// v4->field_2C += (char)v52; -// if ( v6 ) -// v4->field_2C = 0; -// v211 = v52; -// } -// } -// LOBYTE(v55) = v26->field_38[4]; -// if ( (_BYTE)v55 ) -// { -// if ( (_BYTE)v55 == 99 ) -// { -// v56 = v2->field_30; -// v57 = v4->field_30; -// if ( v56 > v57 ) -// { -// v4->field_30 = v56; -// v209 = v56 - v57; -// } -// } -// else -// { -// v55 = (char)v55; -// v6 = (char)v55 + v4->field_30 < 0; -// v4->field_30 += (char)v55; -// if ( v6 ) -// v4->field_30 = 0; -// v209 = v55; -// } -// } -// LOBYTE(v58) = v26->field_38[5]; -// if ( (_BYTE)v58 ) -// { -// if ( (_BYTE)v58 == 99 ) -// { -// v59 = v2->field_34; -// v60 = v4->field_34; -// if ( v59 > v60 ) -// { -// v4->field_34 = v59; -// v207 = v59 - v60; -// } -// } -// else -// { -// v58 = (char)v58; -// v6 = (char)v58 + v4->field_34 < 0; -// v4->field_34 += (char)v58; -// if ( v6 ) -// v4->field_34 = 0; -// v207 = v58; -// } -// } -// LOBYTE(v61) = v26->field_38[6]; -// if ( (_BYTE)v61 ) -// { -// if ( (_BYTE)v61 == 99 ) -// { -// v62 = v2->field_38; -// v63 = v4->field_38; -// if ( v62 > v63 ) -// { -// v4->field_38 = v62; -// v206 = v62 - v63; -// } -// } -// else -// { -// v61 = (char)v61; -// v6 = (char)v61 + v4->field_38 < 0; -// v4->field_38 += (char)v61; -// if ( v6 ) -// v4->field_38 = 0; -// v206 = v61; -// } -// } -// LOBYTE(v64) = v26->field_38[7]; -// if ( (_BYTE)v64 ) -// { -// if ( (_BYTE)v64 == 99 ) -// { -// v65 = v2->field_3C; -// v66 = v4->field_3C; -// if ( v65 > v66 ) -// { -// v4->field_3C = v65; -// v204 = v65 - v66; -// } -// } -// else -// { -// v64 = (char)v64; -// v6 = (char)v64 + v4->field_3C < 0; -// v4->field_3C += (char)v64; -// if ( v6 ) -// v4->field_3C = 0; -// v204 = v64; -// } -// } -// LOBYTE(v67) = v26->field_38[8]; -// if ( (_BYTE)v67 ) -// { -// if ( (_BYTE)v67 == 99 ) -// { -// v68 = v2->field_40; -// v69 = v4->field_40; -// if ( v68 > v69 ) -// { -// v4->field_40 = v68; -// v202 = v68 - v69; -// } -// } -// else -// { -// v67 = (char)v67; -// v6 = (char)v67 + v4->field_40 < 0; -// v4->field_40 += (char)v67; -// if ( v6 ) -// v4->field_40 = 0; -// v202 = v67; -// } -// } -// v70 = v26->field_38[9]; -// if ( v70 ) -// { -// v195 = am_40D402(v189, v70); -// v191 = v26->field_38[9] - v195; -// } -// LOBYTE(v71) = v26->field_38[10]; -// if ( (_BYTE)v71 ) -// { -// if ( (_BYTE)v71 == 99 ) -// { -// v72 = v2->field_28; -// v73 = v4->field_28; -// if ( v72 > v73 ) -// { -// v4->field_28 = v72; -// v200 = v72 - v73; -// } -// } -// else -// { -// v71 = (char)v71; -// v6 = (char)v71 + v4->field_28 < 0; -// v4->field_28 += (char)v71; -// if ( v6 ) -// v4->field_28 = 0; -// v200 = v71; -// } -// } -// LOBYTE(v74) = v26->field_38[11]; -// if ( (_BYTE)v74 ) -// { -// if ( (_BYTE)v74 == 99 ) -// { -// v75 = v2->field_24; -// v76 = v4->field_24; -// if ( v75 > v76 ) -// { -// v4->field_24 = v75; -// v198 = v75 - v76; -// } -// } -// else -// { -// v74 = (char)v74; -// v6 = (char)v74 + v4->field_24 < 0; -// v4->field_24 += (char)v74; -// if ( v6 ) -// v4->field_24 = 0; -// v198 = v74; -// } -// } -// LOBYTE(v77) = v26->field_38[12]; -// if ( (_BYTE)v77 ) -// { -// if ( (_BYTE)v77 == 99 ) -// { -// v78 = v2->field_2C; -// v79 = v4->field_2C; -// if ( v78 != v79 ) -// { -// if ( v78 <= v79 ) -// { -// v2->field_2C = v79; -// v194 = v79 - v78; -// } -// else -// { -// v4->field_2C = v78; -// v211 = v78 - v79; -// } -// } -// } -// else -// { -// v77 = (char)v77; -// v2->field_2C += (char)v77; -// v4->field_2C += (char)v77; -// if ( v2->field_2C < 0 ) -// v2->field_2C = 0; -// if ( v4->field_2C < 0 ) -// v4->field_2C = 0; -// v194 = v77; -// v211 = v77; -// } -// } -// LOBYTE(v80) = v26->field_38[13]; -// if ( (_BYTE)v80 ) -// { -// if ( (_BYTE)v80 == 99 ) -// { -// v81 = v2->field_30; -// v82 = v4->field_30; -// if ( v81 != v82 ) -// { -// if ( v81 <= v82 ) -// { -// v2->field_30 = v82; -// v210 = v82 - v81; -// } -// else -// { -// v4->field_30 = v81; -// v209 = v81 - v82; -// } -// } -// } -// else -// { -// v80 = (char)v80; -// v2->field_30 += (char)v80; -// v4->field_30 += (char)v80; -// if ( v2->field_30 < 0 ) -// v2->field_30 = 0; -// if ( v4->field_30 < 0 ) -// v4->field_30 = 0; -// v209 = v80; -// v210 = v80; -// } -// } -// LOBYTE(v83) = v26->field_38[14]; -// if ( (_BYTE)v83 ) -// { -// if ( (_BYTE)v83 == 99 ) -// { -// v84 = v2->field_34; -// v85 = v4->field_34; -// if ( v84 != v85 ) -// { -// if ( v84 <= v85 ) -// { -// v2->field_34 = v85; -// v208 = v85 - v84; -// } -// else -// { -// v4->field_34 = v84; -// v207 = v84 - v85; -// } -// } -// } -// else -// { -// v83 = (char)v83; -// v2->field_34 += (char)v83; -// v4->field_34 += (char)v83; -// if ( v2->field_34 < 0 ) -// v2->field_34 = 0; -// if ( v4->field_34 < 0 ) -// v4->field_34 = 0; -// v208 = v83; -// v207 = v83; -// } -// } -// LOBYTE(v86) = v26->field_38[15]; -// if ( (_BYTE)v86 ) -// { -// if ( (_BYTE)v86 == 99 ) -// { -// v87 = v2->field_38; -// v88 = v4->field_38; -// if ( v87 != v88 ) -// { -// if ( v87 <= v88 ) -// { -// v2->field_38 = v88; -// v197 = v88 - v87; -// } -// else -// { -// v4->field_38 = v87; -// v206 = v87 - v88; -// } -// } -// } -// else -// { -// v86 = (char)v86; -// v2->field_38 += (char)v86; -// v4->field_38 += (char)v86; -// if ( v2->field_38 < 0 ) -// v2->field_38 = 0; -// if ( v4->field_38 < 0 ) -// v4->field_38 = 0; -// v197 = v86; -// v206 = v86; -// } -// } -// LOBYTE(v89) = v26->field_48[0]; -// if ( v89 ) -// { -// if ( v89 == 99 ) -// { -// v90 = v2->field_3C; -// v91 = v4->field_3C; -// if ( v90 != v91 ) -// { -// if ( v90 <= v91 ) -// { -// v205 = v91 > v90; -// v2->field_3C = v91; -// } -// else -// { -// v204 = 1; -// v4->field_3C = v90; -// } -// } -// } -// else -// { -// v89 = v89; -// v2->field_3C += v89; -// v4->field_3C += v89; -// if ( v2->field_3C < 0 ) -// v2->field_3C = 0; -// if ( v4->field_3C < 0 ) -// v4->field_3C = 0; -// v205 = v89; -// v204 = v89; -// } -// } -// LOBYTE(v92) = v26->field_48[1]; -// if ( (_BYTE)v92 ) -// { -// if ( (_BYTE)v92 == 99 ) -// { -// v93 = v2->field_40; -// v94 = v4->field_40; -// if ( v93 != v94 ) -// { -// if ( v93 <= v94 ) -// { -// v2->field_40 = v94; -// v203 = v94 - v93; -// } -// else -// { -// v4->field_40 = v93; -// v202 = v93 - v94; -// } -// } -// } -// else -// { -// v92 = (char)v92; -// v2->field_40 += (char)v92; -// v4->field_40 += (char)v92; -// if ( v2->field_40 < 0 ) -// v2->field_40 = 0; -// if ( v4->field_40 < 0 ) -// v4->field_40 = 0; -// v203 = v92; -// v202 = v92; -// } -// } -// v95 = v26->field_48[2]; -// if ( v95 ) -// { -// v96 = am_40D402(v193, v95); -// v97 = v26->field_48[2]; -// v196 = v96; -// v98 = am_40D402(v189, v97); -// v195 = v98; -// v99 = v26->field_48[2] - v98; -// v192 = v26->field_48[2] - v196; -// v191 = v99; -// } -// LOBYTE(v100) = v26->field_48[3]; -// if ( (_BYTE)v100 ) -// { -// if ( (_BYTE)v100 == 99 ) -// { -// v101 = v2->field_28; -// v102 = v4->field_28; -// if ( v101 != v102 ) -// { -// if ( v101 <= v102 ) -// { -// v2->field_28 = v102; -// v201 = v102 - v101; -// } -// else -// { -// v4->field_28 = v101; -// v200 = v101 - v102; -// } -// } -// } -// else -// { -// v100 = (char)v100; -// v2->field_28 += (char)v100; -// v4->field_28 += (char)v100; -// if ( v2->field_28 < 0 ) -// v2->field_28 = 0; -// if ( v4->field_28 < 0 ) -// v4->field_28 = 0; -// v201 = v100; -// v200 = v100; -// } -// } -// LOBYTE(v103) = v26->field_48[4]; -// break; -// case 0: -//LABEL_231: -// v104 = pCard->field_48[6]; -// v105 = v104 + (pCard->field_48[5] == 1); -// v106 = 0; -// dword_4FAA68 = v104 + (pCard->field_48[5] == 1); -// dword_4FAA64 = v104; -// if ( v104 > 0 ) -// { -// do -// { -// am_40A283(v193, v105); -// ++v106; -// } -// while ( v106 < pCard->field_48[6] ); -// } -// v107 = pCard; -// am_byte_4FAA77 = GetPlayerHandCardCount(v193) > dword_4E1874; -// LOBYTE(v108) = pCard->field_48[7]; -// if ( (_BYTE)v108 ) -// { -// if ( (_BYTE)v108 == 99 ) -// { -// v109 = v2->field_2C; -// v110 = v4->field_2C; -// if ( v109 < v110 ) -// { -// v2->field_2C = v110; -// v194 = v110 - v109; -// } -// } -// else -// { -// v108 = (char)v108; -// v6 = (char)v108 + v2->field_2C < 0; -// v2->field_2C += (char)v108; -// if ( v6 ) -// v2->field_2C = 0; -// v194 = v108; -// } -// } -// LOBYTE(v111) = v107->field_48[8]; -// if ( (_BYTE)v111 ) -// { -// if ( (_BYTE)v111 == 99 ) -// { -// v112 = v2->field_30; -// v113 = v4->field_30; -// if ( v112 < v113 ) -// { -// v2->field_30 = v113; -// v210 = v113 - v112; -// } -// } -// else -// { -// v111 = (char)v111; -// v6 = (char)v111 + v2->field_30 < 0; -// v2->field_30 += (char)v111; -// if ( v6 ) -// v2->field_30 = 0; -// v210 = v111; -// } -// } -// LOBYTE(v114) = v107->field_48[9]; -// if ( (_BYTE)v114 ) -// { -// if ( (_BYTE)v114 == 99 ) -// { -// v115 = v2->field_34; -// v116 = v4->field_34; -// if ( v115 < v116 ) -// { -// v2->field_34 = v116; -// v208 = v116 - v115; -// } -// } -// else -// { -// v114 = (char)v114; -// v6 = (char)v114 + v2->field_34 < 0; -// v2->field_34 += (char)v114; -// if ( v6 ) -// v2->field_34 = 0; -// v208 = v114; -// } -// } -// LOBYTE(v117) = v107->field_48[10]; -// if ( (_BYTE)v117 ) -// { -// if ( (_BYTE)v117 == 99 ) -// { -// v118 = v2->field_38; -// v119 = v4->field_38; -// if ( v118 < v119 ) -// { -// v2->field_38 = v119; -// v197 = v119 - v118; -// } -// } -// else -// { -// v117 = (char)v117; -// v6 = (char)v117 + v2->field_38 < 0; -// v2->field_38 += (char)v117; -// if ( v6 ) -// v2->field_38 = 0; -// v197 = v117; -// } -// } -// LOBYTE(v120) = v107->field_48[11]; -// if ( v120 ) -// { -// if ( v120 == 99 ) -// { -// v121 = v2->field_3C; -// v122 = v4->field_3C; -// if ( v121 < v122 ) -// { -// v2->field_3C = v122; -// v205 = v122 - v121; -// } -// } -// else -// { -// v120 = v120; -// v6 = v120 + v2->field_3C < 0; -// v2->field_3C += v120; -// if ( v6 ) -// v2->field_3C = 0; -// v205 = v120; -// } -// } -// LOBYTE(v123) = v107->field_48[12]; -// if ( (_BYTE)v123 ) -// { -// if ( (_BYTE)v123 == 99 ) -// { -// v124 = v2->field_40; -// v125 = v4->field_40; -// if ( v124 < v125 ) -// { -// v2->field_40 = v125; -// v203 = v125 - v124; -// } -// } -// else -// { -// v123 = (char)v123; -// v6 = (char)v123 + v2->field_40 < 0; -// v2->field_40 += (char)v123; -// if ( v6 ) -// v2->field_40 = 0; -// v203 = v123; -// } -// } -// v126 = v107->field_48[13]; -// if ( v126 ) -// { -// v196 = am_40D402(v193, v126); -// v192 = v107->field_48[13] - v196; -// } -// LOBYTE(v127) = v107->field_48[14]; -// if ( (_BYTE)v127 ) -// { -// if ( (_BYTE)v127 == 99 ) -// { -// v128 = v2->field_28; -// v129 = v4->field_28; -// if ( v128 < v129 ) -// { -// v2->field_28 = v129; -// v201 = v129 - v128; -// } -// } -// else -// { -// v127 = (char)v127; -// v6 = (char)v127 + v2->field_28 < 0; -// v2->field_28 += (char)v127; -// if ( v6 ) -// v2->field_28 = 0; -// v201 = v127; -// } -// } -// LOBYTE(v130) = v107->field_48[15]; -// if ( (_BYTE)v130 ) -// { -// if ( (_BYTE)v130 == 99 ) -// { -// v131 = v2->field_24; -// v132 = v4->field_24; -// if ( v131 < v132 ) -// { -// v2->field_24 = v132; -// v199 = v132 - v131; -// } -// } -// else -// { -// v130 = (char)v130; -// v6 = (char)v130 + v2->field_24 < 0; -// v2->field_24 += (char)v130; -// if ( v6 ) -// v2->field_24 = 0; -// v199 = v130; -// } -// } -// LOBYTE(v133) = v107->field_58[0]; -// if ( (_BYTE)v133 ) -// { -// if ( (_BYTE)v133 == 99 ) -// { -// v134 = v2->field_2C; -// v135 = v4->field_2C; -// if ( v134 > v135 ) -// { -// v4->field_2C = v134; -// v211 = v134 - v135; -// } -// } -// else -// { -// v133 = (char)v133; -// v6 = (char)v133 + v4->field_2C < 0; -// v4->field_2C += (char)v133; -// if ( v6 ) -// v4->field_2C = 0; -// v211 = v133; -// } -// } -// LOBYTE(v136) = v107->field_58[1]; -// if ( (_BYTE)v136 ) -// { -// if ( (_BYTE)v136 == 99 ) -// { -// v137 = v2->field_30; -// v138 = v4->field_30; -// if ( v137 > v138 ) -// { -// v4->field_30 = v137; -// v209 = v137 - v138; -// } -// } -// else -// { -// v136 = (char)v136; -// v6 = (char)v136 + v4->field_30 < 0; -// v4->field_30 += (char)v136; -// if ( v6 ) -// v4->field_30 = 0; -// v209 = v136; -// } -// } -// LOBYTE(v139) = v107->field_58[2]; -// if ( (_BYTE)v139 ) -// { -// if ( (_BYTE)v139 == 99 ) -// { -// v140 = v2->field_34; -// v141 = v4->field_34; -// if ( v140 > v141 ) -// { -// v4->field_34 = v140; -// v207 = v140 - v141; -// } -// } -// else -// { -// v139 = (char)v139; -// v6 = (char)v139 + v4->field_34 < 0; -// v4->field_34 += (char)v139; -// if ( v6 ) -// v4->field_34 = 0; -// v207 = v139; -// } -// } -// LOBYTE(v142) = v107->field_58[3]; -// if ( (_BYTE)v142 ) -// { -// if ( (_BYTE)v142 == 99 ) -// { -// v143 = v2->field_38; -// v144 = v4->field_38; -// if ( v143 > v144 ) -// { -// v4->field_38 = v143; -// v206 = v143 - v144; -// } -// } -// else -// { -// v142 = (char)v142; -// v6 = (char)v142 + v4->field_38 < 0; -// v4->field_38 += (char)v142; -// if ( v6 ) -// v4->field_38 = 0; -// v206 = v142; -// } -// } -// LOBYTE(v145) = v107->field_58[4]; -// if ( (_BYTE)v145 ) -// { -// if ( (_BYTE)v145 == 99 ) -// { -// v146 = v2->field_3C; -// v147 = v4->field_3C; -// if ( v146 > v147 ) -// { -// v4->field_3C = v146; -// v204 = v146 - v147; -// } -// } -// else -// { -// v145 = (char)v145; -// v6 = (char)v145 + v4->field_3C < 0; -// v4->field_3C += (char)v145; -// if ( v6 ) -// v4->field_3C = 0; -// v204 = v145; -// } -// } -// LOBYTE(v148) = v107->field_58[5]; -// if ( (_BYTE)v148 ) -// { -// if ( (_BYTE)v148 == 99 ) -// { -// v149 = v2->field_40; -// v150 = v4->field_40; -// if ( v149 > v150 ) -// { -// v4->field_40 = v149; -// v202 = v149 - v150; -// } -// } -// else -// { -// v148 = (char)v148; -// v6 = (char)v148 + v4->field_40 < 0; -// v4->field_40 += (char)v148; -// if ( v6 ) -// v4->field_40 = 0; -// v202 = v148; -// } -// } -// v151 = v107->field_58[6]; -// if ( v151 ) -// { -// v195 = am_40D402(v189, v151); -// v191 = v107->field_58[6] - v195; -// } -// LOBYTE(v152) = v107->field_58[7]; -// if ( (_BYTE)v152 ) -// { -// if ( (_BYTE)v152 == 99 ) -// { -// v153 = v2->field_28; -// v154 = v4->field_28; -// if ( v153 > v154 ) -// { -// v4->field_28 = v153; -// v200 = v153 - v154; -// } -// } -// else -// { -// v152 = (char)v152; -// v6 = (char)v152 + v4->field_28 < 0; -// v4->field_28 += (char)v152; -// if ( v6 ) -// v4->field_28 = 0; -// v200 = v152; -// } -// } -// LOBYTE(v155) = v107->field_58[8]; -// if ( (_BYTE)v155 ) -// { -// if ( (_BYTE)v155 == 99 ) -// { -// v156 = v2->field_24; -// v157 = v4->field_24; -// if ( v156 > v157 ) -// { -// v4->field_24 = v156; -// v198 = v156 - v157; -// } -// } -// else -// { -// v155 = (char)v155; -// v6 = (char)v155 + v4->field_24 < 0; -// v4->field_24 += (char)v155; -// if ( v6 ) -// v4->field_24 = 0; -// v198 = v155; -// } -// } -// LOBYTE(v158) = v107->field_58[9]; -// if ( (_BYTE)v158 ) -// { -// if ( (_BYTE)v158 == 99 ) -// { -// v159 = v2->field_2C; -// v160 = v4->field_2C; -// if ( v159 != v160 ) -// { -// if ( v159 <= v160 ) -// { -// v2->field_2C = v160; -// v194 = v160 - v159; -// } -// else -// { -// v4->field_2C = v159; -// v211 = v159 - v160; -// } -// } -// } -// else -// { -// v158 = (char)v158; -// v2->field_2C += (char)v158; -// v4->field_2C += (char)v158; -// if ( v2->field_2C < 0 ) -// v2->field_2C = 0; -// if ( v4->field_2C < 0 ) -// v4->field_2C = 0; -// v194 = v158; -// v211 = v158; -// } -// } -// LOBYTE(v161) = v107->field_58[10]; -// if ( (_BYTE)v161 ) -// { -// if ( (_BYTE)v161 == 99 ) -// { -// v162 = v2->field_30; -// v163 = v4->field_30; -// if ( v162 != v163 ) -// { -// if ( v162 <= v163 ) -// { -// v2->field_30 = v163; -// v210 = v163 - v162; -// } -// else -// { -// v4->field_30 = v162; -// v209 = v162 - v163; -// } -// } -// } -// else -// { -// v161 = (char)v161; -// v2->field_30 += (char)v161; -// v4->field_30 += (char)v161; -// if ( v2->field_30 < 0 ) -// v2->field_30 = 0; -// if ( v4->field_30 < 0 ) -// v4->field_30 = 0; -// v209 = v161; -// v210 = v161; -// } -// } -// LOBYTE(v164) = v107->field_58[11]; -// if ( (_BYTE)v164 ) -// { -// if ( (_BYTE)v164 == 99 ) -// { -// v165 = v2->field_34; -// v166 = v4->field_34; -// if ( v165 != v166 ) -// { -// if ( v165 <= v166 ) -// { -// v2->field_34 = v166; -// v208 = v166 - v165; -// } -// else -// { -// v4->field_34 = v165; -// v207 = v165 - v166; -// } -// } -// } -// else -// { -// v164 = (char)v164; -// v2->field_34 += (char)v164; -// v4->field_34 += (char)v164; -// if ( v2->field_34 < 0 ) -// v2->field_34 = 0; -// if ( v4->field_34 < 0 ) -// v4->field_34 = 0; -// v208 = v164; -// v207 = v164; -// } -// } -// LOBYTE(v167) = v107->field_58[12]; -// if ( (_BYTE)v167 ) -// { -// if ( (_BYTE)v167 == 99 ) -// { -// v168 = v2->field_38; -// v169 = v4->field_38; -// if ( v168 != v169 ) -// { -// if ( v168 <= v169 ) -// { -// v2->field_38 = v169; -// v197 = v169 - v168; -// } -// else -// { -// v4->field_38 = v168; -// v206 = v168 - v169; -// } -// } -// } -// else -// { -// v167 = (char)v167; -// v2->field_38 += (char)v167; -// v4->field_38 += (char)v167; -// if ( v2->field_38 < 0 ) -// v2->field_38 = 0; -// if ( v4->field_38 < 0 ) -// v4->field_38 = 0; -// v197 = v167; -// v206 = v167; -// } -// } -// LOBYTE(v170) = v107->field_58[13]; -// if ( v170 ) -// { -// if ( v170 == 99 ) -// { -// v171 = v2->field_3C; -// v172 = v4->field_3C; -// if ( v171 != v172 ) -// { -// if ( v171 <= v172 ) -// { -// v205 = v172 > v171; -// v2->field_3C = v172; -// } -// else -// { -// v204 = 1; -// v4->field_3C = v171; -// } -// } -// } -// else -// { -// v170 = v170; -// v2->field_3C += v170; -// v4->field_3C += v170; -// if ( v2->field_3C < 0 ) -// v2->field_3C = 0; -// if ( v4->field_3C < 0 ) -// v4->field_3C = 0; -// v205 = v170; -// v204 = v170; -// } -// } -// LOBYTE(v173) = v107->field_58[14]; -// if ( (_BYTE)v173 ) -// { -// if ( (_BYTE)v173 == 99 ) -// { -// v174 = v2->field_40; -// v175 = v4->field_40; -// if ( v174 != v175 ) -// { -// if ( v174 <= v175 ) -// { -// v2->field_40 = v175; -// v203 = v175 - v174; -// } -// else -// { -// v4->field_40 = v174; -// v202 = v174 - v175; -// } -// } -// } -// else -// { -// v173 = (char)v173; -// v2->field_40 += (char)v173; -// v4->field_40 += (char)v173; -// if ( v2->field_40 < 0 ) -// v2->field_40 = 0; -// if ( v4->field_40 < 0 ) -// v4->field_40 = 0; -// v203 = v173; -// v202 = v173; -// } -// } -// v176 = v107->field_58[15]; -// if ( v176 ) -// { -// v177 = am_40D402(v193, v176); -// v178 = v107->field_58[15]; -// v196 = v177; -// v179 = am_40D402(v189, v178); -// v195 = v179; -// v180 = v107->field_58[15] - v179; -// v192 = v107->field_58[15] - v196; -// v191 = v180; -// } -// LOBYTE(v181) = LOBYTE(v107->field_68); -// if ( (_BYTE)v181 ) -// { -// if ( (_BYTE)v181 == 99 ) -// { -// v182 = v2->field_28; -// v183 = v4->field_28; -// if ( v182 != v183 ) -// { -// if ( v182 <= v183 ) -// { -// v2->field_28 = v183; -// v201 = v183 - v182; -// } -// else -// { -// v4->field_28 = v182; -// v200 = v182 - v183; -// } -// } -// } -// else -// { -// v181 = (char)v181; -// v2->field_28 += (char)v181; -// v4->field_28 += (char)v181; -// if ( v2->field_28 < 0 ) -// v2->field_28 = 0; -// if ( v4->field_28 < 0 ) -// v4->field_28 = 0; -// v201 = v181; -// v200 = v181; -// } -// } -// LOBYTE(v103) = BYTE1(v107->field_68); -// break; -// } -// if ( (_BYTE)v103 ) -// { -// if ( (_BYTE)v103 == 99 ) -// { -// v184 = v2->field_24; -// v185 = v4->field_24; -// if ( v184 != v185 ) -// { -// if ( v184 <= v185 ) -// { -// v2->field_24 = v185; -// v199 = v185 - v184; -// } -// else -// { -// v4->field_24 = v184; -// v198 = v184 - v185; -// } -// } -// } -// else -// { -// v103 = (char)v103; -// v2->field_24 += (char)v103; -// v4->field_24 += (char)v103; -// if ( v2->field_24 < 0 ) -// v2->field_24 = 0; -// if ( v4->field_24 < 0 ) -// v4->field_24 = 0; -// v199 = v103; -// v198 = v103; -// } -// } -// if ( v194 > 0 || v211 > 0 ) -// ArcomageGame::PlaySound(0x1Eu); -// if ( v194 < 0 || v211 < 0 ) -// ArcomageGame::PlaySound(0x1Fu); -// if ( v210 > 0 || v209 > 0 ) -// ArcomageGame::PlaySound(0x21u); -// if ( v210 < 0 || v209 < 0 ) -// ArcomageGame::PlaySound(0x22u); -// if ( v208 > 0 || v207 > 0 ) -// ArcomageGame::PlaySound(0x24u); -// if ( v208 < 0 || v207 < 0 ) -// ArcomageGame::PlaySound(0x25u); -// if ( v197 > 0 || v206 > 0 ) -// ArcomageGame::PlaySound(0x27u); -// if ( v197 < 0 || v206 < 0 ) -// ArcomageGame::PlaySound(0x28u); -// if ( v205 > 0 || v204 > 0 ) -// ArcomageGame::PlaySound(0x2Au); -// if ( v205 < 0 || v204 < 0 ) -// ArcomageGame::PlaySound(0x2Bu); -// if ( v203 > 0 || v202 > 0 ) -// ArcomageGame::PlaySound(0x2Du); -// if ( v203 < 0 || v202 < 0 ) -// ArcomageGame::PlaySound(0x2Eu); -// if ( v192 || v191 || v196 || v195 ) -// ArcomageGame::PlaySound(0x30u); -// if ( v201 > 0 || v200 > 0 ) -// ArcomageGame::PlaySound(0x31u); -// if ( v201 < 0 || v200 < 0 ) -// ArcomageGame::PlaySound(0x32u); -// if ( v199 > 0 || v198 > 0 ) -// ArcomageGame::PlaySound(0x34u); -// if ( v199 < 0 || v198 < 0 ) -// ArcomageGame::PlaySound(0x35u); -// if ( v193 ) -// { -// if ( v194 ) -// { -// v187.x = 573; -// v187.y = 92; -// am_40D2B4(&v187, v194); -// } -// if ( v211 ) -// { -// v187.x = 26; -// v187.y = 92; -// am_40D2B4(&v187, v211); -// } -// if ( v210 ) -// { -// v187.x = 573; -// v187.y = 164; -// am_40D2B4(&v187, v210); -// } -// if ( v209 ) -// { -// v187.x = 26; -// v187.y = 164; -// am_40D2B4(&v187, v209); -// } -// if ( v208 ) -// { -// v187.x = 573; -// v187.y = 236; -// am_40D2B4(&v187, v208); -// } -// if ( v207 ) -// { -// v187.x = 26; -// v187.y = 236; -// am_40D2B4(&v187, v207); -// } -// if ( v197 ) -// { -// v187.x = 563; -// v187.y = 114; -// am_40D2B4(&v187, v197); -// } -// if ( v206 ) -// { -// v187.x = 16; -// v187.y = 114; -// am_40D2B4(&v187, v206); -// } -// if ( v205 ) -// { -// v187.x = 563; -// v187.y = 186; -// am_40D2B4(&v187, v205); -// } -// if ( v204 ) -// { -// v187.x = 16; -// v187.y = 186; -// am_40D2B4(&v187, v204); -// } -// if ( v203 ) -// { -// v187.x = 563; -// v187.y = 258; -// am_40D2B4(&v187, v203); -// } -// if ( v202 ) -// { -// v187.x = 16; -// v187.y = 258; -// am_40D2B4(&v187, v202); -// } -// v186 = 296; -// if ( v201 ) -// { -// v187.x = 442; -// v187.y = 296; -// am_40D2B4(&v187, v201); -// } -// if ( v200 ) -// { -// v187.x = 180; -// v187.y = 296; -// am_40D2B4(&v187, v200); -// } -// if ( v199 ) -// { -// v187.x = 514; -// v187.y = 296; -// am_40D2B4(&v187, v199); -// } -// if ( v198 ) -// { -// v187.x = 122; -// v187.y = 296; -// am_40D2B4(&v187, v198); -// } -// if ( v196 ) -// { -// v187.x = 442; -// v187.y = 296; -// am_40D2B4(&v187, v196); -// } -// if ( v192 ) -// { -// v187.x = 514; -// v187.y = 296; -// am_40D2B4(&v187, v192); -// } -// if ( v195 ) -// { -// v187.x = 180; -// v187.y = 296; -// am_40D2B4(&v187, v195); -// } -// if ( v191 ) -// { -// v187.x = 122; -// goto LABEL_567; -// } -// } -// else -// { -// if ( v194 ) -// { -// v187.x = 26; -// v187.y = 92; -// am_40D2B4(&v187, v194); -// } -// if ( v211 ) -// { -// v187.x = 573; -// v187.y = 92; -// am_40D2B4(&v187, v211); -// } -// if ( v210 ) -// { -// v187.x = 26; -// v187.y = 164; -// am_40D2B4(&v187, v210); -// } -// if ( v209 ) -// { -// v187.x = 573; -// v187.y = 164; -// am_40D2B4(&v187, v209); -// } -// if ( v208 ) -// { -// v187.x = 26; -// v187.y = 236; -// am_40D2B4(&v187, v208); -// } -// if ( v207 ) -// { -// v187.x = 573; -// v187.y = 236; -// am_40D2B4(&v187, v207); -// } -// if ( v197 ) -// { -// v187.x = 16; -// v187.y = 114; -// am_40D2B4(&v187, v197); -// } -// if ( v206 ) -// { -// v187.x = 563; -// v187.y = 114; -// am_40D2B4(&v187, v206); -// } -// if ( v205 ) -// { -// v187.x = 16; -// v187.y = 186; -// am_40D2B4(&v187, v205); -// } -// if ( v204 ) -// { -// v187.x = 563; -// v187.y = 186; -// am_40D2B4(&v187, v204); -// } -// if ( v203 ) -// { -// v187.x = 16; -// v187.y = 258; -// am_40D2B4(&v187, v203); -// } -// if ( v202 ) -// { -// v187.x = 563; -// v187.y = 258; -// am_40D2B4(&v187, v202); -// } -// v186 = 296; -// if ( v201 ) -// { -// v187.x = 180; -// v187.y = 296; -// am_40D2B4(&v187, v201); -// } -// if ( v200 ) -// { -// v187.x = 442; -// v187.y = 296; -// am_40D2B4(&v187, v200); -// } -// if ( v199 ) -// { -// v187.x = 122; -// v187.y = 296; -// am_40D2B4(&v187, v199); -// } -// if ( v198 ) -// { -// v187.x = 514; -// v187.y = 296; -// am_40D2B4(&v187, v198); -// } -// if ( v196 ) -// { -// v187.x = 180; -// v187.y = 296; -// am_40D2B4(&v187, v196); -// } -// if ( v192 ) -// { -// v187.x = 122; -// v187.y = 296; -// am_40D2B4(&v187, v192); -// } -// if ( v195 ) -// { -// v187.x = 442; -// v187.y = 296; -// am_40D2B4(&v187, v195); -// } -// if ( v191 ) -// { -// v187.x = 514; -//LABEL_567: -// v187.y = v186; -// am_40D2B4(&v187, v191); -// return; -// } -// } + + +#define APPLY_TO_PLAYER( PLAYER, ENEMY,FIELD, VAL, RES )\ + if (VAL != 0) {\ + if (VAL == 99) {\ + if ( PLAYER->##FIELD < ENEMY->##FIELD ) {\ + PLAYER->##FIELD = ENEMY->##FIELD;\ + RES = ENEMY->##FIELD - PLAYER->##FIELD;\ + }\ + } else {\ + PLAYER->##FIELD += (signed int)(VAL);\ + if ( PLAYER->##FIELD<0 ) PLAYER->##FIELD= 0;\ + RES = (signed int)(VAL);\ + }\ + } + +#define APPLY_TO_ENEMY( PLAYER, ENEMY,FIELD, VAL, RES ) APPLY_TO_PLAYER(ENEMY, PLAYER, FIELD, VAL, RES) + +#define APPLY_TO_BOTH( PLAYER, ENEMY, FIELD, VAL, RES_P, RES_E ) \ + if ( VAL != 0) {\ + if ( VAL == 99 ) { \ + if ( PLAYER->##FIELD != ENEMY->##FIELD ) { \ + if ( PLAYER->##FIELD <= ENEMY->##FIELD ) { \ + PLAYER->##FIELD = ENEMY->##FIELD; \ + RES_P = ENEMY->##FIELD - PLAYER->##FIELD; \ + } else { \ + ENEMY->##FIELD = PLAYER->##FIELD; \ + RES_E = PLAYER->##FIELD - ENEMY->##FIELD; \ + } \ + }\ + } else { \ + PLAYER->##FIELD += (signed int)(VAL);\ + ENEMY->##FIELD += (signed int)(VAL); if (PLAYER->##FIELD < 0 ) {PLAYER->##FIELD = 0;} \ + if ( ENEMY->##FIELD < 0 ) {ENEMY->##FIELD = 0;} \ + RES_P = (signed int)(VAL); RES_E = (signed int)(VAL); \ + }\ + } + ArcomagePlayer *player; // esi@1 + int v3; // eax@1 + ArcomagePlayer *enemy; // edi@1 + int v5; // eax@2 + char v6; // sf@2 + unsigned __int8 v7; // of@2 + int v8; // eax@3 + int v9; // eax@4 + char v10; // zf@5 + int v11; // eax@8 + unsigned __int8 v12; // zf@8 + char v13; // sf@8 + unsigned __int8 v14; // of@8 + int v15; // eax@9 + int v16; // eax@10 + char v17; // zf@12 + char v18; // al@15 + int v19; // eax@16 + int v20; // eax@17 + int v21; // eax@22 + int v22; // eax@23 + int v23; // eax@26 + signed int v24; // ebx@26 + int v103; + int v104; + + POINT v184; // [sp+Ch] [bp-64h]@488 + int enemy_num; // [sp+14h] [bp-5Ch]@1 + ArcomageCard *pCard; // [sp+18h] [bp-58h]@1 + int buildings_e; // [sp+1Ch] [bp-54h]@1 + int buildings_p; // [sp+20h] [bp-50h]@1 + int quarry_p; // [sp+28h] [bp-48h]@1 + int dmg_e; // [sp+2Ch] [bp-44h]@1 + int dmg_p; // [sp+30h] [bp-40h]@1 + int bricks_p; // [sp+34h] [bp-3Ch]@1 + int tower_e; // [sp+38h] [bp-38h]@1 + int tower_p; // [sp+3Ch] [bp-34h]@1 + int wall_e; // [sp+40h] [bp-30h]@1 + int wall_p; // [sp+44h] [bp-2Ch]@1 + int beasts_e; // [sp+48h] [bp-28h]@1 + int beasts_p; // [sp+4Ch] [bp-24h]@1 + int gems_e; // [sp+50h] [bp-20h]@1 + int gems_p; // [sp+54h] [bp-1Ch]@1 + int bricks_e; // [sp+58h] [bp-18h]@1 + int zoo_e; // [sp+5Ch] [bp-14h]@1 + int zoo_p; // [sp+60h] [bp-10h]@1 + int magic_e; // [sp+64h] [bp-Ch]@1 + int magic_p; // [sp+68h] [bp-8h]@1 + int quarry_e; // [sp+6Ch] [bp-4h]@1 + + quarry_p = 0; + magic_p = 0; + zoo_p = 0; + bricks_p = 0; + gems_p = 0; + beasts_p = 0; + wall_p = 0; + tower_p = 0; + buildings_p = 0; + dmg_p = 0; + quarry_e = 0; + magic_e = 0; + zoo_e = 0; + bricks_e = 0; + gems_e = 0; + beasts_e = 0; + wall_e = 0; + tower_e = 0; + buildings_e = 0; + dmg_e = 0; + + player = &am_Players[player_num]; + pCard = &pCards[uCardID]; + enemy_num = (player_num + 1) % 2; + enemy = &am_Players[enemy_num]; + switch ( pCard->compare_param ) + { + case 2: + v5 = player->quarry_level; + v7 = __OFSUB__(v5, enemy->quarry_level); + v6 = v5 - enemy->quarry_level < 0; + v18 = v6 ^ v7; + goto LABEL_25; + case 3: + v8 = player->magic_level; + v7 = __OFSUB__(v8, enemy->magic_level); + v6 = v8 - enemy->magic_level < 0; + v18 = v6 ^ v7; + goto LABEL_25; + case 4: + v9 = player->zoo_level; + v7 = __OFSUB__(v9, enemy->zoo_level); + v6 = v9 - enemy->zoo_level < 0; + v18 = v6 ^ v7; + goto LABEL_25; + case 5: + v10 = player->quarry_level == enemy->quarry_level; + v18 = v10; + goto LABEL_25; + case 6: + v10 = player->magic_level == enemy->magic_level; + v18 = v10; + goto LABEL_25; + case 7: + v10 = player->zoo_level == enemy->zoo_level; + v18 = v10; + goto LABEL_25; + case 8: + v11 = player->quarry_level; + v14 = __OFSUB__(v11, enemy->quarry_level); + v12 = v11 == enemy->quarry_level; + v13 = v11 - enemy->quarry_level < 0; + v18 = !((v13 ^ v14) | v12); + goto LABEL_25; + case 9: + v15 = player->magic_level; + v14 = __OFSUB__(v15, enemy->magic_level); + v12 = v15 == enemy->magic_level; + v13 = v15 - enemy->magic_level < 0; + v18 = !((v13 ^ v14) | v12); + goto LABEL_25; + case 10: + v16 = player->zoo_level; + v14 = __OFSUB__(v16, enemy->zoo_level); + v12 = v16 == enemy->zoo_level; + v13 = v16 - enemy->zoo_level < 0; + v18 = !((v13 ^ v14) | v12); + goto LABEL_25; + case 11: + v10 = player->wall_height == 0; + v18 = v10; + goto LABEL_25; + case 12: + v17 = player->wall_height == 0; + v18 = !v17; + goto LABEL_25; + case 13: + v10 = enemy->wall_height == 0; + v18 = v10; + goto LABEL_25; + case 14: + v17 = enemy->wall_height == 0; + v18 = !v17; + goto LABEL_25; + case 15: + v19 = player->wall_height; + v7 = __OFSUB__(v19, enemy->wall_height); + v6 = v19 - enemy->wall_height < 0; + v18 = v6 ^ v7; + goto LABEL_25; + case 16: + v20 = player->tower_height; + v7 = __OFSUB__(v20, enemy->tower_height); + v6 = v20 - enemy->tower_height < 0; + v18 = v6 ^ v7; + goto LABEL_25; + case 17: + v10 = player->wall_height == enemy->wall_height; + v18 = v10; + goto LABEL_25; + case 18: + v10 = player->tower_height == enemy->tower_height; + v18 = v10; + goto LABEL_25; + case 19: + v21 = player->wall_height; + v14 = __OFSUB__(v21, enemy->wall_height); + v12 = v21 == enemy->wall_height; + v13 = v21 - enemy->wall_height < 0; + v18 = !((v13 ^ v14) | v12); + goto LABEL_25; + case 20: + v22 = player->tower_height; + v14 = __OFSUB__(v22, enemy->tower_height); + v12 = v22 == enemy->tower_height; + v13 = v22 - enemy->tower_height < 0; + v18 = !((v13 ^ v14) | v12); +LABEL_25: + if ( v18 ) + goto LABEL_26; + goto LABEL_231; + default: +LABEL_26: + v23 = pCard->draw_extra_card_count; + v24 = 0; + dword_4FAA68 = v23 + (pCard->field_30 == 1); + dword_4FAA64 = v23; + if ( v23 > 0 ) + { + do + { + GetNextCardFromDeck(player_num); + ++v24; + } + while ( v24 < pCard->draw_extra_card_count ); + } + + need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; + + + APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl, quarry_p); + APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl, magic_p); + APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl, zoo_p); + APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks, bricks_p); + APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems, gems_p); + APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts, beasts_p); + if ( pCard->to_player_buildings ) + { + dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings); + buildings_p = (signed int)pCard->to_player_buildings - dmg_p; + } + APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall, wall_p); + APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower, tower_p); + + APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl, quarry_e); + APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl, magic_e); + APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl, zoo_e); + APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks, bricks_e); + APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems, gems_e); + APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts, beasts_e); + if ( pCard->to_enemy_buildings ) + { + dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings); + buildings_e = (signed int)pCard->to_enemy_buildings - dmg_e; + } + APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall, wall_e); + APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower, tower_e); + + APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl, quarry_p, quarry_e); + APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl, magic_p, magic_e); + APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl, zoo_p, zoo_e); + APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks, bricks_p, bricks_e); + APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems, gems_p, gems_e); + APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts, beasts_p, beasts_e); + if ( pCard->to_pl_enm_buildings ) + { + dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings); + dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings); + buildings_p = (signed int)pCard->to_pl_enm_buildings - dmg_p; + buildings_e = (signed int)pCard->to_pl_enm_buildings - dmg_e; + } + APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall, wall_p, wall_e); + APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower, tower_p, tower_e); + break; + case 0: +LABEL_231: + v103 = pCard->can_draw_extra_card2; + v104 = 0; + dword_4FAA68 = v103 + (pCard->field_4D == 1); + dword_4FAA64 = v103; + if ( v103 > 0 ) + { + do + { + GetNextCardFromDeck(player_num); + ++v104; + } + while ( v104 < pCard->can_draw_extra_card2 ); + } + + need_to_discard_card = GetPlayerHandCardCount(player_num) > minimum_cards_at_hand; + + APPLY_TO_PLAYER(player, enemy, quarry_level, pCard->to_player_quarry_lvl2, quarry_p); + APPLY_TO_PLAYER(player, enemy, magic_level, pCard->to_player_magic_lvl2, magic_p); + APPLY_TO_PLAYER(player, enemy, zoo_level, pCard->to_player_zoo_lvl2, zoo_p); + APPLY_TO_PLAYER(player, enemy, resource_bricks, pCard->to_player_bricks2, bricks_p); + APPLY_TO_PLAYER(player, enemy, resource_gems, pCard->to_player_gems2, gems_p); + APPLY_TO_PLAYER(player, enemy, resource_beasts, pCard->to_player_beasts2, beasts_p); + if ( pCard->to_player_buildings2 ) + { + dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_player_buildings2); + buildings_p = (signed int)pCard->to_player_buildings2 - dmg_p; + } + APPLY_TO_PLAYER(player, enemy, wall_height, pCard->to_player_wall2, wall_p); + APPLY_TO_PLAYER(player, enemy, tower_height, pCard->to_player_tower2, tower_p); + + APPLY_TO_ENEMY(player, enemy, quarry_level, pCard->to_enemy_quarry_lvl2, quarry_e); + APPLY_TO_ENEMY(player, enemy, magic_level, pCard->to_enemy_magic_lvl2, magic_e); + APPLY_TO_ENEMY(player, enemy, zoo_level, pCard->to_enemy_zoo_lvl2, zoo_e); + APPLY_TO_ENEMY(player, enemy, resource_bricks, pCard->to_enemy_bricks2, bricks_e); + APPLY_TO_ENEMY(player, enemy, resource_gems, pCard->to_enemy_gems2, gems_e); + APPLY_TO_ENEMY(player, enemy, resource_beasts, pCard->to_enemy_beasts2, beasts_e); + if ( pCard->to_enemy_buildings2 ) + { + dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_enemy_buildings2); + buildings_e = (signed int)pCard->to_enemy_buildings2 - dmg_e; + } + APPLY_TO_ENEMY(player, enemy, wall_height, pCard->to_enemy_wall2, wall_e); + APPLY_TO_ENEMY(player, enemy, tower_height, pCard->to_enemy_tower2, tower_e); + + APPLY_TO_BOTH(player, enemy, quarry_level, pCard->to_pl_enm_quarry_lvl2, quarry_p, quarry_e); + APPLY_TO_BOTH(player, enemy, magic_level, pCard->to_pl_enm_magic_lvl2, magic_p, magic_e); + APPLY_TO_BOTH(player, enemy, zoo_level, pCard->to_pl_enm_zoo_lvl2, zoo_p, zoo_e); + APPLY_TO_BOTH(player, enemy, resource_bricks, pCard->to_pl_enm_bricks2, bricks_p, bricks_e); + APPLY_TO_BOTH(player, enemy, resource_gems, pCard->to_pl_enm_gems2, gems_p, gems_e); + APPLY_TO_BOTH(player, enemy, resource_beasts, pCard->to_pl_enm_beasts2, beasts_p, beasts_e); + + if ( pCard->to_pl_enm_buildings2 ) + { + dmg_p = ApplyDamageToBuildings(player_num, (signed int)pCard->to_pl_enm_buildings2); + dmg_e = ApplyDamageToBuildings(enemy_num, (signed int)pCard->to_pl_enm_buildings2); + buildings_p = (signed int)pCard->to_pl_enm_buildings2 - dmg_p; + buildings_e = (signed int)pCard->to_pl_enm_buildings2 - dmg_e; + } + APPLY_TO_BOTH(player, enemy, wall_height, pCard->to_pl_enm_wall2, wall_p, wall_e); + APPLY_TO_BOTH(player, enemy, tower_height, pCard->to_pl_enm_tower2, tower_p, tower_e); + break; + } + // } + if ( quarry_p > 0 || quarry_e > 0 ) + pArcomageGame->PlaySound(30); + if ( quarry_p < 0 || quarry_e < 0 ) + pArcomageGame->PlaySound(31); + if ( magic_p > 0 || magic_e > 0 ) + pArcomageGame->PlaySound(33); + if ( magic_p < 0 || magic_e < 0 ) + pArcomageGame->PlaySound(34); + if ( zoo_p > 0 || zoo_e > 0 ) + pArcomageGame->PlaySound(36); + if ( zoo_p < 0 || zoo_e < 0 ) + pArcomageGame->PlaySound(37); + if ( bricks_p > 0 || bricks_e > 0 ) + pArcomageGame->PlaySound(39); + if ( bricks_p < 0 || bricks_e < 0 ) + pArcomageGame->PlaySound(40); + if ( gems_p > 0 || gems_e > 0 ) + pArcomageGame->PlaySound(42); + if ( gems_p < 0 || gems_e < 0 ) + pArcomageGame->PlaySound(43); + if ( beasts_p > 0 || beasts_e > 0 ) + pArcomageGame->PlaySound(45u); + if ( beasts_p < 0 || beasts_e < 0 ) + pArcomageGame->PlaySound(46); + if ( buildings_p || buildings_e || dmg_p || dmg_e ) + pArcomageGame->PlaySound(48); + if ( wall_p > 0 || wall_e > 0 ) + pArcomageGame->PlaySound(49); + if ( wall_p < 0 || wall_e < 0 ) + pArcomageGame->PlaySound(50); + if ( tower_p > 0 || tower_e > 0 ) + pArcomageGame->PlaySound(52); + if ( tower_p < 0 || tower_e < 0 ) + pArcomageGame->PlaySound(53); + if ( player_num ) + { + if ( quarry_p ) + { + v184.x = 573; + v184.y = 92; + am_40D2B4(&v184, quarry_p); + } + if ( quarry_e ) + { + v184.x = 26; + v184.y = 92; + am_40D2B4(&v184, quarry_e); + } + if ( magic_p ) + { + v184.x = 573; + v184.y = 164; + am_40D2B4(&v184, magic_p); + } + if ( magic_e ) + { + v184.x = 26; + v184.y = 164; + am_40D2B4(&v184, magic_e); + } + if ( zoo_p ) + { + v184.x = 573; + v184.y = 236; + am_40D2B4(&v184, zoo_p); + } + if ( zoo_e ) + { + v184.x = 26; + v184.y = 236; + am_40D2B4(&v184, zoo_e); + } + if ( bricks_p ) + { + v184.x = 563; + v184.y = 114; + am_40D2B4(&v184, bricks_p); + } + if ( bricks_e ) + { + v184.x = 16; + v184.y = 114; + am_40D2B4(&v184, bricks_e); + } + if ( gems_p ) + { + v184.x = 563; + v184.y = 186; + am_40D2B4(&v184, gems_p); + } + if ( gems_e ) + { + v184.x = 16; + v184.y = 186; + am_40D2B4(&v184, gems_e); + } + if ( beasts_p ) + { + v184.x = 563; + v184.y = 258; + am_40D2B4(&v184, beasts_p); + } + if ( beasts_e ) + { + v184.x = 16; + v184.y = 258; + am_40D2B4(&v184, beasts_e); + } + if ( wall_p ) + { + v184.x = 442; + v184.y = 296; + am_40D2B4(&v184, wall_p); + } + if ( wall_e ) + { + v184.x = 180; + v184.y = 296; + am_40D2B4(&v184, wall_e); + } + if ( tower_p ) + { + v184.x = 514; + v184.y = 296; + am_40D2B4(&v184, tower_p); + } + if ( tower_e ) + { + v184.x = 122; + v184.y = 296; + am_40D2B4(&v184, tower_e); + } + if ( dmg_p ) + { + v184.x = 442; + v184.y = 296; + am_40D2B4(&v184, dmg_p); + } + if ( buildings_p ) + { + v184.x = 514; + v184.y = 296; + am_40D2B4(&v184, buildings_p); + } + if ( dmg_e ) + { + v184.x = 180; + v184.y = 296; + am_40D2B4(&v184, dmg_e); + } + if ( buildings_e ) + { + v184.x = 122; + v184.y = 296; + am_40D2B4(&v184, buildings_e); + } + } + else + { + if ( quarry_p ) + { + v184.x = 26; + v184.y = 92; + am_40D2B4(&v184, quarry_p); + } + if ( quarry_e ) + { + v184.x = 573; + v184.y = 92; + am_40D2B4(&v184, quarry_e); + } + if ( magic_p ) + { + v184.x = 26; + v184.y = 164; + am_40D2B4(&v184, magic_p); + } + if ( magic_e ) + { + v184.x = 573; + v184.y = 164; + am_40D2B4(&v184, magic_e); + } + if ( zoo_p ) + { + v184.x = 26; + v184.y = 236; + am_40D2B4(&v184, zoo_p); + } + if ( zoo_e ) + { + v184.x = 573; + v184.y = 236; + am_40D2B4(&v184, zoo_e); + } + if ( bricks_p ) + { + v184.x = 16; + v184.y = 114; + am_40D2B4(&v184, bricks_p); + } + if ( bricks_e ) + { + v184.x = 563; + v184.y = 114; + am_40D2B4(&v184, bricks_e); + } + if ( gems_p ) + { + v184.x = 16; + v184.y = 186; + am_40D2B4(&v184, gems_p); + } + if ( gems_e ) + { + v184.x = 563; + v184.y = 186; + am_40D2B4(&v184, gems_e); + } + if ( beasts_p ) + { + v184.x = 16; + v184.y = 258; + am_40D2B4(&v184, beasts_p); + } + if ( beasts_e ) + { + v184.x = 563; + v184.y = 258; + am_40D2B4(&v184, beasts_e); + } + if ( wall_p ) + { + v184.x = 180; + v184.y = 296; + am_40D2B4(&v184, wall_p); + } + if ( wall_e ) + { + v184.x = 442; + v184.y = 296; + am_40D2B4(&v184, wall_e); + } + if ( tower_p ) + { + v184.x = 122; + v184.y = 296; + am_40D2B4(&v184, tower_p); + } + if ( tower_e ) + { + v184.x = 514; + v184.y = 296; + am_40D2B4(&v184, tower_e); + } + if ( dmg_p ) + { + v184.x = 180; + v184.y = 296; + am_40D2B4(&v184, dmg_p); + } + if ( buildings_p ) + { + v184.x = 122; + v184.y = 296; + am_40D2B4(&v184, buildings_p); + } + if ( dmg_e ) + { + v184.x = 442; + v184.y = 296; + am_40D2B4(&v184, dmg_e); + } + if ( buildings_e ) + { + v184.x = 514; + v184.y = 296; + am_40D2B4(&v184, buildings_e); + } + } +#undef APPLY_TO_BOTH +#undef APPLY_TO_ENEMY +#undef APPLY_TO_PLAYER + } //----- (0040D2B4) -------------------------------------------------------- -int am_40D2B4( POINT* a1, int a2 ) +int am_40D2B4( POINT* startXY, int effect_value ) { int v2; // ebp@1 POINT *v3; // edi@1 @@ -5319,14 +3637,14 @@ v11 = 0; - v2 = a2; - v3 = a1; - while ( array_4FABD0[v11].field_0 ) + v2 = effect_value; + + while ( array_4FABD0[v11].have_effect ) { result = array_4FABD0[v11].field_40->_40E2A7(); if ( !result ) { - array_4FABD0[v11].field_0 = 0; + array_4FABD0[v11].have_effect = 0; --v11; } ++v11; @@ -5334,20 +3652,20 @@ return result; } v6 = v11; - array_4FABD0[v11].field_0 = 1; - if ( v2 <= 0 ) + array_4FABD0[v11].have_effect = 1; + if ( effect_value <= 0 ) { - array_4FABD0[v6].field_1 = 0; - v2 = -v2; + array_4FABD0[v6].effect_sign = 0; + effect_value = -effect_value; } else { - array_4FABD0[v6].field_1 = 1; + array_4FABD0[v6].effect_sign = 1; } - array_4FABD0[v6].field_4.field_0 = v3->x - 20; - array_4FABD0[v6].field_4.field_8 = v3->x + 20; - array_4FABD0[v6].field_4.field_4 = v3->y - 20; - array_4FABD0[v6].field_4.field_C = v3->y + 20; + array_4FABD0[v6].field_4.effect_area.left = startXY->x - 20; + array_4FABD0[v6].field_4.effect_area.right = startXY->x + 20; + array_4FABD0[v6].field_4.effect_area.top = startXY->y - 20; + array_4FABD0[v6].field_4.effect_area.bottom = startXY->y + 20; array_4FABD0[v6].field_4.field_10 = -60; array_4FABD0[v6].field_4.field_14 = 60; array_4FABD0[v6].field_4.field_18 = 180; @@ -5358,17 +3676,17 @@ array_4FABD0[v6].field_4.field_2Cf = 8.0; array_4FABD0[v6].field_4.field_30 = 5; array_4FABD0[v6].field_4.field_34 = 15; - array_4FABD0[v6].field_4.field_38 = &array_4FABD0[v6].field_44[0]; + array_4FABD0[v6].field_4.sparks_array = &array_4FABD0[v6].effect_sparks[0]; v8 = array_4FABD0[v6].field_40; - v8->_40E01A(&array_4FABD0[v6].field_4); - if ( 10 * v2 > 150 ) - v2 = 15; + v8->StartFill(&array_4FABD0[v6].field_4); + if ( 10 * effect_value > 150 ) + effect_value = 15; if ( v8->signature != SIG_trpg ) return 2; if ( !v8->field_59 ) return 3; - v8->field_8 = 10 * v2; + v8->position_in_sparks_arr = 10 * effect_value; v8->field_30 = 0.0; v8->field_58 = 0; v8->field_44 = 0; @@ -5376,13 +3694,13 @@ v8->field_48 = 0; v8->field_50 = 0; for (int i=0; ifield_4; ++i) - v8->field_54[i].field_0=0; + v8->field_54[i].have_spark=0; return 0; } //----- (0040D402) -------------------------------------------------------- -int am_40D402( int player_num, int damage ) +int ApplyDamageToBuildings( int player_num, int damage ) { ArcomagePlayer *v2; // ecx@1 int v3; // esi@1 @@ -5687,9 +4005,8 @@ for (int i=0; i<12; ++i) am_sounds[i] = pSoundList->LoadSound(v4++, 0); - for (int i=0; i<10; ++i) - array_4FABD0[i].field_40->Ctor(array_4FABD0[i].field_40); + stru272_stru0::Ctor(&array_4FABD0[i].field_40); current_card_slot_index = -1; amuint_4FAA4C = -1; @@ -5698,7 +4015,7 @@ byte_4FAA2C = 0; byte_505880 = 0; dword_4FAA70 = 0; - am_byte_4FAA77 = 0; + need_to_discard_card = 0; SetStartGameData(); InitalHandsFill(); //nullsub_1(); @@ -5719,14 +4036,10 @@ } - - - - //----- (00409BE8) -------------------------------------------------------- void SetStartConditions() { - ArcomageStartConditions *st_cond; // eax@1 + const ArcomageStartConditions *st_cond; // eax@1 st_cond = &start_conditions[window_SpeakInHouse->par1C - 108]; start_tower_height = st_cond->tower_height; @@ -5741,7 +4054,7 @@ max_tower_height = st_cond->max_tower; max_resources_amount = st_cond->max_resources; - dword_4DF3A4 = st_cond->field_14; + opponent_mastery = st_cond->mastery_lvl; start_bricks_amount = st_cond->bricks_amount; start_gems_amount = st_cond->gems_amount; @@ -5753,14 +4066,12 @@ //----- (0040D75D) -------------------------------------------------------- void pPrimaryWindow_draws_text( int a1, const char *pText, POINT *pXY ) { - int v4; // qax@1 - v4 = pFontComic->uFontHeight - 3; - pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - (v4 >> 1) + 3, 0, pText, 0, 0, 0); + pPrimaryWindow->DrawText( pFontComic, pXY->x, pXY->y - ((pFontComic->uFontHeight - 3) >> 1) + 3, 0, pText, 0, 0, 0); } //----- (0040DB27) -------------------------------------------------------- -void __fastcall DrawRect(RECT *pXYZW, unsigned __int16 uColor, char bSolidFill) +void DrawRect( RECT *pXYZW, unsigned __int16 uColor, char bSolidFill ) { RECT *v3; // esi@1 @@ -5782,6 +4093,23 @@ pRenderer->EndScene(); } +void SetPixel2sq( POINT *pTargetXY, unsigned __int16 uColor ) + { + pRenderer->BeginScene(); + if ( pRenderer->uNumSceneBegins ) + { + int xVal = pTargetXY->x; + int yVal = pTargetXY->y; + if ( xVal >= 0 && xVal <= 639 && yVal >= 0 && yVal <= 479) + { + pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * yVal] = uColor; + pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * yVal] = uColor; + pRenderer->pTargetSurface[xVal + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor; + pRenderer->pTargetSurface[xVal+1 + pRenderer->uTargetSurfacePitch * (yVal+1)] = uColor; + } + pRenderer->EndScene(); + } + } //----- (0040DBD3) -------------------------------------------------------- void SetPixel( POINT *pTargetXY, unsigned __int16 uColor ) @@ -5801,9 +4129,9 @@ //----- (0040DDB1) -------------------------------------------------------- -int __fastcall rand_interval(int a, int b) +int rand_interval( int min, int max ) { - return a + rand() % (b - a + 1); + return min + rand() % (max - min + 1); } diff -r 21a46b38ca24 -r 8a196c858180 Arcomage.h --- a/Arcomage.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Arcomage.h Sat Jun 15 09:55:27 2013 +0600 @@ -3,13 +3,6 @@ #include "Texture.h" -#pragma pack(push, 1) -struct am_st1 -{ - int field_0; - int field_4; -}; -#pragma pack(pop) /* 401 */ #pragma pack(push, 1) @@ -38,69 +31,66 @@ char needed_bricks; char needed_gems; char needed_beasts; - char field_2B; - char field_2C; - char field_2D; - char field_2E; - char field_2F; + char can_be_discarded; + int compare_param; char field_30; - char field_31; - char field_32; - char field_33; - char field_34; - char field_35; - char field_36; - char field_37; - char field_38; - char field_39; - char field_3A; - char field_3B; - char field_3C; - char field_3D; - char field_3E; - char field_3F; - char field_40; - char field_41; - char field_42; - char field_43; - char field_44; - char field_45; - char field_46; - char field_47; - char field_48; - char field_49; - char field_4A; - char field_4B; - char field_4C; + char draw_extra_card_count; + char to_player_quarry_lvl; + char to_player_magic_lvl; + char to_player_zoo_lvl; + char to_player_bricks; + char to_player_gems; + char to_player_beasts; + char to_player_buildings; + char to_player_wall; + char to_player_tower; + char to_enemy_quarry_lvl; + char to_enemy_magic_lvl; + char to_enemy_zoo_lvl; + char to_enemy_bricks; + char to_enemy_gems; + char to_enemy_beasts; + char to_enemy_buildings; + char to_enemy_wall; + char to_enemy_tower; + char to_pl_enm_quarry_lvl; + char to_pl_enm_magic_lvl; + char to_pl_enm_zoo_lvl; + char to_pl_enm_bricks; + char to_pl_enm_gems; + char to_pl_enm_beasts; + char to_pl_enm_buildings; + char to_pl_enm_wall; + char to_pl_enm_tower; char field_4D; - char field_4E; - char field_4F; - char field_50; - char field_51; - char field_52; - char field_53; - char field_54; - char field_55; - char field_56; - char field_57; - char field_58; - char field_59; - char field_5A; - char field_5B; - char field_5C; - char field_5D; - char field_5E; - char field_5F; - char field_60; - char field_61; - char field_62; - char field_63; - char field_64; - char field_65; - char field_66; - char field_67; - char field_68; - char field_69; + char can_draw_extra_card2; + char to_player_quarry_lvl2; + char to_player_magic_lvl2; + char to_player_zoo_lvl2; + char to_player_bricks2; + char to_player_gems2; + char to_player_beasts2; + char to_player_buildings2; + char to_player_wall2; + char to_player_tower2; + char to_enemy_quarry_lvl2; + char to_enemy_magic_lvl2; + char to_enemy_zoo_lvl2; + char to_enemy_bricks2; + char to_enemy_gems2; + char to_enemy_beasts2; + char to_enemy_buildings2; + char to_enemy_wall2; + char to_enemy_tower2; + char to_pl_enm_quarry_lvl2; + char to_pl_enm_magic_lvl2; + char to_pl_enm_zoo_lvl2; + char to_pl_enm_bricks2; + char to_pl_enm_gems2; + char to_pl_enm_beasts2; + char to_pl_enm_buildings2; + char to_pl_enm_wall2; + char to_pl_enm_tower2; char field_6A; char field_6B; }; @@ -123,7 +113,7 @@ int resource_gems; int resource_beasts; int cards_at_hand[10]; - am_st1 arr_6C[10]; + POINT card_shift[10]; }; #pragma pack(pop) @@ -175,8 +165,7 @@ struct GUIFont *pfntComic;//ptr_48; struct GUIFont *pfntArrus;//ptr_4C; int field_50; - __int16 field_54; - __int16 field_56; + int field_54; RGBTexture pGameBackground; RGBTexture pSprites; int event_timer_time; @@ -187,8 +176,8 @@ char field_F4; char GameOver; char field_F6; - char field_F7; - char field_F8; + char prev_mouse_left; + char prev_mouse_right; char field_F9; char bGameInProgress; }; @@ -205,8 +194,8 @@ #pragma pack(push, 1) struct stru272_stru1 { - int field_0; - POINT field_4; + int have_spark; + POINT spark_position; int field_C; int field_10; int field_14; @@ -218,10 +207,11 @@ #pragma pack(push, 1) struct stru272_stru2 { - int field_0; - int field_4; - int field_8; - int field_C; +/*int field_0; +int field_4; +int field_8; +int field_C;*/ + RECT effect_area; int field_10; int field_14; int field_18; @@ -232,7 +222,7 @@ float field_2Cf; int field_30; int field_34; - stru272_stru1* field_38; + stru272_stru1* sparks_array; }; #pragma pack(pop) @@ -241,16 +231,16 @@ #pragma pack(push, 1) struct stru272_stru0 // ARCOMAGE stuff { - static void Ctor(stru272_stru0 *a1); + static void Ctor(stru272_stru0 **a1); int Dtor(); - int _40E01A(stru272_stru2* a2); + int StartFill(stru272_stru2* a2); int Empty(char a2, char a3); - int _40E133(); + int DrawEffect(); int _40E2A7(); int signature; int field_4; - int field_8; + int position_in_sparks_arr; int field_C; int field_10; int field_14; @@ -292,13 +282,13 @@ #pragma pack(push, 1) struct stru272 { - char field_0; - char field_1; + char have_effect; + char effect_sign; char _pad_2; char _pad_3; stru272_stru2 field_4; stru272_stru0 *field_40; - stru272_stru1 field_44[150]; + stru272_stru1 effect_sparks[150]; }; #pragma pack(pop) diff -r 21a46b38ca24 -r 8a196c858180 ArcomageCards.cpp --- a/ArcomageCards.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/ArcomageCards.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -2,264 +2,351 @@ #include "Arcomage.h" ArcomageCard pCards[87] = { - {"Brick Shortage", 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {"Brick Shortage", + 0, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, -8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {"Lucky Cache", 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + {"Lucky Cache", + 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, - {"Friendly Terrain", 2, 1, 0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 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, }; \ No newline at end of file diff -r 21a46b38ca24 -r 8a196c858180 AudioPlayer.cpp --- a/AudioPlayer.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/AudioPlayer.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -7,6 +7,7 @@ #include "stru11.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "AudioPlayer.h" #include "Allocator.h" @@ -54,7 +55,7 @@ std::array pSoundVolumeLevels = { 0.0000000f, 0.1099999f, 0.2199999f, 0.3300000f, 0.4399999f, - 0.5500000f, 0.6600000f, 0.7699999f, 0.8799999f, 0.9900000f + 0.5500000f, 0.6600000f, 0.7699999f, 0.8799999f, 0.9700000f //changed 0.9900000f to 0.9700000f. for some reason it only works for values below this }; @@ -2255,9 +2256,11 @@ do { v11 = v14[v10]; - v10++; + v12 = 16 * (v14[v10++] + 47); pMixerChannels[v11].uSourceTrackID = 0; - pMixerChannels[v11].hSample = NULL; + v13 = __OFSUB__(v10, num_same_sound_on_channels); + v6 = v10 - num_same_sound_on_channels < 0; + *(unsigned int *)((char *)&bEAXSupported + v12) = 0; } while (v10 #include +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Mouse.h" #include "MapInfo.h" #include "Game.h" -#include "Outdoor.h" +#include "Render.h" #include "GUIWindow.h" #include "GUIProgressBar.h" #include "Chest.h" diff -r 21a46b38ca24 -r 8a196c858180 GUIButton.cpp --- a/GUIButton.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/GUIButton.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -1,7 +1,6 @@ #include "GUIWindow.h" #include "GUIFont.h" -#include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 GUIFont.h --- a/GUIFont.h Sat Jun 15 09:55:07 2013 +0600 +++ b/GUIFont.h Sat Jun 15 09:55:27 2013 +0600 @@ -12,6 +12,8 @@ #pragma pack(pop) /* 170 */ +#pragma warning( push ) +#pragma warning( disable : 4200 ) #pragma pack(push, 1) struct GUIFont { @@ -43,8 +45,10 @@ GUICharMetric pMetrics[256]; int font_pixels_offset[256]; unsigned char pFontData[0]; //array of font pixels + }; #pragma pack(pop) +#pragma warning( pop ) GUIFont *LoadFont(const char *pFontFile, const char *pFontPalette, ...); char * FitTextInAWindow(const char *pInString, GUIFont *pFont, GUIWindow *pWindow, signed int uX, int a5); diff -r 21a46b38ca24 -r 8a196c858180 GUIProgressBar.h --- a/GUIProgressBar.h Sat Jun 15 09:55:07 2013 +0600 +++ b/GUIProgressBar.h Sat Jun 15 09:55:27 2013 +0600 @@ -41,9 +41,9 @@ RGBTexture field_68; RGBTexture field_90; RGBTexture field_B8; - Texture field_E0; - Texture pBardata; - Texture pLoadingProgress; + struct Texture field_E0; + struct Texture pBardata; + struct Texture pLoadingProgress; }; #pragma pack(pop) diff -r 21a46b38ca24 -r 8a196c858180 GUIWindow.cpp --- a/GUIWindow.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/GUIWindow.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -29,8 +29,36 @@ #include "mm7_data.h" +typedef struct _RGBColor + { + unsigned char R; + unsigned char B; + unsigned char G; + }RGBColor; +std::array spell_tooltip_colors={{ + {0x96, 0xD4, 0xFF}, + {0xFF, 0x80, 0x00}, + {0xFF, 0xFF, 0x9B}, + {0xE1, 0xE1, 0xE1}, + {0x80, 0x80, 0x80}, + {0x96, 0xD4, 0xFF}, + {0xFF, 0x55, 0x00}, + {0x96, 0xD4, 0xFF}, + {0xFF, 0x55, 0x00}, + {0xE1, 0xE1, 0xE1}, + {0xFF, 0x55, 0x00}, + {0x96, 0xD4, 0xFF}, + {0xEB, 0x0F, 0xFF}, + {0xFF, 0x80, 0x00}, + {0x96, 0xD4, 0xFF}, + {0x80, 0x80, 0x80}, + {0xFF, 0x55, 0x00}, + {0x00, 0x80, 0xFF}, + {0x00, 0x80, 0xFF}, + {0x96, 0xD4, 0xFF}}}; + int pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[1]; // idb struct GUIWindow *pWindow_MainMenu; @@ -46,11 +74,11 @@ //----- (004141CA) -------------------------------------------------------- -void ModalWindow(const char *pStr, int a4) -{ +void ModalWindow( const char *pStrHint, int a4 ) + { pEventTimer->Pause(); dword_506F0C[0] = pCurrentScreen; - ptr_507BDC = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, a4, (int)pStr); + ptr_507BDC = GUIWindow::Create(0, 0, 640, 480, WINDOW_FinalWindow, a4, pStrHint); pCurrentScreen = SCREEN_PRESS_ESCAPE_MESSAGE; } // 4E28F8: using guessed type int pCurrentScreen; @@ -180,79 +208,41 @@ //----- (0041D73D) -------------------------------------------------------- void GUIWindow::_41D73D_draw_buff_tooltip() { - GUIFont *v1; // esi@1 - GUIWindow *v2; // edi@1 - SpellBuff *v3; // eax@1 - unsigned int v4; // eax@5 - int v5; // ecx@5 - unsigned int v6; // eax@5 - unsigned int v7; // ecx@5 - char *v8; // ebx@7 - unsigned int v9; // eax@8 - unsigned int v10; // ecx@8 - __int64 v11; // ST28_8@11 - int v12; // esi@11 - const char *v13; // ST0C_4@11 - unsigned int v14; // eax@11 - char **v16; // [sp+14h] [bp-10h]@7 - GUIFont *a2; // [sp+18h] [bp-Ch]@1 - SpellBuff *v18; // [sp+1Ch] [bp-8h]@7 - int v19; // [sp+20h] [bp-4h]@1 - int v20; // [sp+20h] [bp-4h]@7 + + __int64 remaing_time; // ST28_8@11 + unsigned short text_color; + int Y_pos; // esi@11 + int string_count; // [sp+20h] [bp-4h]@7 + + + string_count = 0; + for (int i=0; i<20; ++i) + if ( pParty->pPartyBuffs[i].uExpireTime > 0i64 ) + ++string_count; - v1 = pFontComic; - v2 = this; - a2 = pFontComic; - v19 = 0; - v3 = pParty->pPartyBuffs; - do + uFrameHeight = pFontArrus->uFontHeight + 72; + uFrameHeight += (string_count - 1) * pFontArrus->uFontHeight; + uFrameZ = uFrameWidth + uFrameX - 1; + uFrameW = uFrameY + uFrameHeight - 1; + DrawMessageBox(0); + DrawTitleText(pFontArrus, 0, 12, 0, pGlobalTXT_LocalizationStrings[451], 3u); + if ( !string_count ) + DrawTitleText(pFontComic, 0, 40, 0, pGlobalTXT_LocalizationStrings[153], 3u); + + GetTickCount(); + string_count = 0; + for (int i=0; i<20; ++i) { - if ( (signed __int64)v3->uExpireTime > 0 ) - ++v19; - ++v3; + if ( pParty->pPartyBuffs[i].uExpireTime>0i64 )//!!! + { + remaing_time = pParty->pPartyBuffs[i].uExpireTime- pParty->uTimePlayed;//!!! + Y_pos = string_count * pFontComic->uFontHeight + 40; + text_color = TargetColor(spell_tooltip_colors[i].R, spell_tooltip_colors[i].G, spell_tooltip_colors[i].B); + DrawText(pFontComic, 52, Y_pos, text_color, aSpellNames[i], 0, 0, 0); + sub_41D20D_buff_remaining_time_string(Y_pos, this, remaing_time, pFontComic); + ++string_count; + } } - while ( (signed int)v3 < (signed int)pParty->pPlayers ); - v4 = LOBYTE(pFontArrus->uFontHeight) + 72; - this->uFrameHeight = v4; - v5 = v4 + (v19 - 1) * LOBYTE(pFontArrus->uFontHeight); - v6 = v2->uFrameWidth; - v2->uFrameHeight = v5; - v7 = v2->uFrameHeight; - v2->uFrameZ = v6 + v2->uFrameX - 1; - v2->uFrameW = v2->uFrameY + v7 - 1; - v2->DrawMessageBox(0); - v2->DrawTitleText(pFontArrus, 0, 0xCu, 0, pGlobalTXT_LocalizationStrings[451], 3u); - if ( !v19 ) - v2->DrawTitleText(v1, 0, 0x28u, 0, pGlobalTXT_LocalizationStrings[153], 3u); - v20 = 0; - GetTickCount(); - v8 = &_4E2B21_buff_spell_tooltip_colors[1]; - v16 = aSpellNames.data(); - v18 = pParty->pPartyBuffs; - do - { - v9 = LODWORD(v18->uExpireTime); - v10 = HIDWORD(v18->uExpireTime); - if ( (v10 & 0x80000000u) == 0 && ((signed int)v10 > 0 || v9) )//!!! - { - v11 = __PAIR__(v10, v9) - pParty->uTimePlayed;//!!! - v12 = v20 * LOBYTE(v1->uFontHeight) + 40; - v13 = *v16; - ++v20; - v14 = TargetColor( - (unsigned __int8)*(v8 - 1), - (unsigned __int8)*v8, - (unsigned __int8)v8[1]); - v2->DrawText(a2, 52, v12, v14, v13, 0, 0, 0); - sub_41D20D_buff_remaining_time_string(v12, v2, v11, a2); - v1 = a2; - } - ++v18; - ++v16; - v8 += 3; - } - while ( (signed int)v18 < (signed int)pParty->pPlayers ); - } @@ -1206,7 +1196,8 @@ //----- (0044D406) -------------------------------------------------------- -void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing ) +void GUIWindow::DrawTitleText( GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, + const char *pInString, unsigned int uLineSpacing ) { GUIWindow *pWindow; // esi@1 unsigned int v8; // ebx@1 @@ -1383,7 +1374,7 @@ pRenderer->DrawTextPalette( v12, v13, - v17, + (unsigned char*)v17, v16, LOBYTE(v10->uFontHeight), v10->pFontPalettes[0], @@ -1409,11 +1400,11 @@ //----- (0044CB4F) -------------------------------------------------------- -int GUIWindow::DrawTextInRect(GUIFont *a2, unsigned int uX, unsigned int uY, unsigned int uColor, const char *Str1, int Source, int a8) -{ - GUIFont *pFont; // edi@1 +int GUIWindow::DrawTextInRect( GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text ) + { + int pLineWidth; // ebx@1 - int v11; // esi@3 + int text_width; // esi@3 unsigned __int8 v12; // cl@7 signed int v13; // esi@19 signed int v14; // ebx@19 @@ -1423,11 +1414,11 @@ int v18; // ecx@23 int v19; // ecx@24 unsigned int v20; // ecx@26 - int v21; // eax@28 + unsigned char* v21; // eax@28 int v22; // ebx@34 int v23; // eax@34 int v24; // ebx@36 - char Str; // [sp+Ch] [bp-20h]@34 + char Str[6]; // [sp+Ch] [bp-20h]@34 char v26; // [sp+Fh] [bp-1Dh]@34 char v27; // [sp+11h] [bp-1Bh]@35 int v28; // [sp+20h] [bp-Ch]@17 @@ -1437,144 +1428,114 @@ size_t Str1b; // [sp+40h] [bp+14h]@19 const char *Sourcea; // [sp+44h] [bp+18h]@20 int v34; // [sp+48h] [bp+1Ch]@26 + int i; - pFont = a2; + pWindow = this; - pNumLen = strlen(Str1); - pLineWidth = pFont->GetLineWidth(Str1); - if ( pLineWidth < Source ) + pNumLen = strlen(text); + pLineWidth = pFont->GetLineWidth(text); + if ( pLineWidth < rect_width ) { - pWindow->DrawText(pFont, uX, uY, uColor, Str1, 0, 0, 0); + pWindow->DrawText(pFont, uX, uY, uColor, text, 0, 0, 0); return pLineWidth; } - strcpy(pTmpBuf2.data(), Str1); - v11 = 0; - if ( a8 ) + strcpy(pTmpBuf2.data(), text); + text_width = 0; + if ( reverse_text ) _strrev(pTmpBuf2.data()); Str1a = 0; - if ( (signed int)pNumLen > 0 ) - { - do + for (i=0; i= Source ) + if ( text_width >= rect_width ) break; - if ( pFont->IsCharValid(v12 = pTmpBuf2[Str1a]) ) + v12 = pTmpBuf2[i]; + if ( pFont->IsCharValid(v12) ) { - if ( v12 < 9u ) - { - if ( (signed int)Str1a > 0 ) - v11 += pFont->pMetrics[v12].uLeftSpacing; - v11 += *((int *)&pFont->cFirstChar + 3 * v12 + 9); - if ( (signed int)Str1a < (signed int)pNumLen ) - v11 += pFont->pMetrics[v12].uRightSpacing; - goto LABEL_16; - } - if ( v12 > 0xAu )//10 - { - if ( v12 == 12 ) + switch (v12) { - Str1a += 5; - } - else - { - if ( v12 != 13 ) - { - if ( (signed int)Str1a > 0 ) - v11 += pFont->pMetrics[v12].uLeftSpacing; - v11 += *((int *)&pFont->cFirstChar + 3 * v12 + 9); - if ( (signed int)Str1a < (signed int)pNumLen ) - v11 += pFont->pMetrics[v12].uRightSpacing; - } - } - } + case '\t':// Horizontal tab 09 + case '\n': //Line Feed 0A 10 + case '\r': //Form Feed, page eject 0C 12 + break; + case '\f': //Carriage Return 0D 13 + i += 5; + break; + default: + if ( i > 0 ) + text_width += pFont->pMetrics[v12].uLeftSpacing; + text_width += pFont->pMetrics[v12].uWidth; + if ( i < pNumLen ) + text_width += pFont->pMetrics[v12].uRightSpacing; + } } -LABEL_16: - ++Str1a; } - while ( (signed int)Str1a < (signed int)pNumLen ); - } - pTmpBuf2[Str1a - 1] = 0; + pTmpBuf2[i - 1] = 0; + + pNumLen = strlen(pTmpBuf2.data()); v28 = pFont->GetLineWidth(pTmpBuf2.data()); - if ( a8 ) + if ( reverse_text ) _strrev(pTmpBuf2.data()); - Str1b = 0; + v13 = uX + pWindow->uFrameX; v14 = uY + pWindow->uFrameY; - if ( (signed int)pNumLen > 0 ) + for (i=0; iIsCharValid(v15 = pTmpBuf2[Str1b]) ) + v15 = pTmpBuf2[i]; + if ( pFont->IsCharValid(v15) ) { - v16 = v15; - v17 = v15 - 9; - if ( v17 )//>0 - { - v18 = v17 - 1; - if ( v18 )//>0 + switch (v12) + { + case '\t':// Horizontal tab 09 + { + strncpy(Str, &pTmpBuf2[i+1], 3); + Str[3] = 0; + // atoi(Str); + i += 3; + break; + } + case '\n': //Line Feed 0A 10 + { + v24 = pFont->uFontHeight; + v13 = uX; + uY = uY + pFont->uFontHeight - 3; + v14 = uY+pFont->uFontHeight - 3; + break; + } + case '\r': //Form Feed, page eject 0C 12 { - v19 = v18 - 2; - if ( v19 )//>0 - { - if ( v19 == 1 )//v15 == 13 - { - strncpy(&Str, Sourcea, 3u); - v26 = 0; - Str1b += 3; - Sourcea += 3; - v22 = atoi(&Str); - v23 = pFont->GetLineWidth(&pTmpBuf2[Str1b]); - v13 = pWindow->uFrameZ - v23 - v22; - v14 = uY; - } - else//v15 > 13 - { - v20 = *((int *)&pFont->cFirstChar + 3 * v16 + 9); - v34 = *((int *)&pFont->cFirstChar + 3 * v16 + 9); - if ( (signed int)Str1b > 0 ) - v13 += pFont->pMetrics[v16].uLeftSpacing; - v21 = (int)((char *)&pFont[1] + pFont->font_pixels_offset[v16]); - if ( (short)uColor ) - pRenderer->DrawText(v13, v14, (unsigned __int8 *)v21, v20, LOBYTE(pFont->uFontHeight), pFont->pFontPalettes[0], uColor, 0); - else - pRenderer->DrawTextPalette(v13, v14, v21, v20, LOBYTE(pFont->uFontHeight), pFont->pFontPalettes[0], 0); - v13 += v34; - if ( (signed int)Str1b < (signed int)pNumLen ) - v13 += pFont->pMetrics[(unsigned __int8)pTmpBuf2[Str1b]].uRightSpacing; - } - } - else//v15 == 12 - { - strncpy(&Str, Sourcea, 5u); - v27 = 0; - Str1b += 5; - Sourcea += 5; - uColor = atoi(&Str); - } + strncpy(Str, &pTmpBuf2[i+1], 5); + Str[5] = 0; + i += 5; + uColor = atoi(Str); + break; + } + case '\f': //Carriage Return 0D 13 + { + strncpy(Str, &pTmpBuf2[i+1], 3); + Str[3] = 0; + i += 3; + v23 = pFont->GetLineWidth(&pTmpBuf2[i]); + v13 = pWindow->uFrameZ - v23 - atoi(Str); + v14 = uY; + break; } - else//v15 == 10 - { - v24 = LOBYTE(pFont->uFontHeight); - v13 = uX; - uY = uY + v24 - 3; - v14 = v24 + uY - 3; - } - } - else//v15 == 9 - { - strncpy(&Str, Sourcea, 3u); - v26 = 0; - atoi(&Str); - Str1b += 3; - Sourcea += 3; - } + default: + v20 = pFont->pMetrics[v15].uWidth; + if ( i > 0 ) + v13 += pFont->pMetrics[v15].uLeftSpacing; + v21 = &pFont->pFontData[pFont->font_pixels_offset[v15]]; + if ( uColor ) + pRenderer->DrawText(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], uColor, 0); + else + pRenderer->DrawTextPalette(v13, v14, v21, v20, pFont->uFontHeight, pFont->pFontPalettes[0], 0); + v13 += v20; + if ( i < (signed int)pNumLen ) + v13 += pFont->pMetrics[v15].uRightSpacing; + } } - ++Str1b; - ++Sourcea; - } - while ( (signed int)Str1b < (signed int)pNumLen ); + + } return v28; } @@ -1597,25 +1558,23 @@ pButton = (GUIButton *)pAllocator->AllocNamedChunk(0, 0xBCu, "BUTTON"); pButton->pParent = this; - pButton->uX = uX + this->uFrameX; - v13 = uY + this->uFrameY; + pButton->uWidth = uWidth; pButton->uHeight = uHeight; - pButton->uY = v13; - pButton->uWidth = uWidth; + if ( a6 == 2 && !uHeight ) pButton->uHeight = uWidth; - v14 = pButton->uX; + pButton->uButtonType = a6; - v15 = v14 + uWidth - 1; - pButton->uZ = v15; - v17 = pButton->uY; + pButton->uX = uX + this->uFrameX; + pButton->uY = uY + this->uFrameY; + pButton->uZ = pButton->uX + uWidth - 1; + pButton->uW = pButton->uY + uHeight - 1; pButton->field_2C_is_pushed = 0; - pButton->uW = v17 + uHeight - 1; pButton->field_1C = a7; pButton->msg = msg; pButton->msg_param = msg_param; pButton->uHotkey = uHotkey; - strlen(pName); + //strlen(pName); strcpy(pButton->pButtonName, pName); va_start(texturs_ptr, pName); while (NULL!=(pTextures=va_arg(texturs_ptr, Texture *))) @@ -1637,20 +1596,15 @@ } //----- (00459C2B) -------------------------------------------------------- -void GUIWindow::DrawFlashingInputCursor(signed int a3, int a4, GUIFont *a2) -{ - signed int v4; // esi@1 - GUIWindow *v5; // edi@1 - - v4 = a3; - v5 = this; +void GUIWindow::DrawFlashingInputCursor( signed int uX, int uY, struct GUIFont *a2 ) + { if ( GetTickCount() % 1000 > 500 ) - DrawText(a2, v4, a4, 0, "_", 0, 0, 0); + DrawText(a2, uX, uY, 0, "_", 0, 0, 0); } //----- (0041C432) -------------------------------------------------------- -GUIWindow *GUIWindow::Create(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, WindowType eWindowType, int pButton, int a5) -{ +GUIWindow * GUIWindow::Create( unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eWindowType, int pButton, const char* hint ) + { unsigned int uNextFreeWindowID; // ebp@1 //int *v8; // eax@1 //GUIWindow *pWindow; // esi@4 @@ -1679,15 +1633,16 @@ auto pWindow = &pWindowList[uNextFreeWindowID]; pWindow->uFrameWidth = uWidth; + pWindow->uFrameHeight = uHeight; + + pWindow->uFrameX = uX; + pWindow->uFrameY = uY; pWindow->uFrameZ = uX + uWidth - 1; pWindow->uFrameW = uY + uHeight - 1; + pWindow->ptr_1C = (void *)pButton; - pWindow->Hint = (char *)a5; - //v10 = uNumVisibleWindows; - pWindow->uFrameX = uX; - //++v10; - pWindow->uFrameY = uY; - pWindow->uFrameHeight = uHeight; + pWindow->Hint = hint; + pWindow->eWindowType = eWindowType; pWindow->receives_keyboard_input = false; ++uNumVisibleWindows; @@ -1699,10 +1654,11 @@ { switch (eWindowType) { - case WINDOW_Book: + case WINDOW_Book: { pWindow->InitializeBookView(); break; - case WINDOW_Dialogue: + } + case WINDOW_Dialogue: { pMainScreenNum = pCurrentScreen; pCurrentScreen = SCREEN_NPC_DIALOGUE; pBtn_ExitCancel = pWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], //"Exit" @@ -1794,8 +1750,8 @@ pWindow->_41D08F_set_keyboard_control_group(num_menu_buttons, 1, 0, 1); } break; - - case WINDOW_ChangeLocation: + } + case WINDOW_ChangeLocation: { pMainScreenNum = pCurrentScreen; pCurrentScreen = SCREEN_CHANGE_LOCATION; pBtn_ExitCancel = pWindow->CreateButton( 566, 445, 75, 33, 1, 0, UIMSG_CHANGE_LOCATION_ClickCencelBtn, 0, 'N', pGlobalTXT_LocalizationStrings[156], pIcons_LOD->GetTexture(uTextureID_BUTTDESC2), 0);// @@ -1803,16 +1759,19 @@ pWindow->CreateButton(pNPCPortraits_x[0][0], pNPCPortraits_y[0][0], 63, 73, 1, 0, UIMSG_OnTravelByFoot, 1, ' ', pWindow->Hint, 0, 0, 0); pWindow->CreateButton( 8, 8, 460, 344, 1, 0, UIMSG_OnTravelByFoot, 1, 0, pWindow->Hint, 0); break; - - case WINDOW_SpellBook: // + } + case WINDOW_SpellBook: {// InitializeBookTextures(); pWindow->OpenSpellBook(); break; - case WINDOW_GreetingNPC: // + } + case WINDOW_GreetingNPC: {// pMainScreenNum = pCurrentScreen; pKeyActionMap->EnterText(0, 15, pWindow); pCurrentScreen = SCREEN_BRANCHLESS_NPC_DIALOG; break; + } + } return pWindow; } @@ -1842,7 +1801,7 @@ if ( v26 || !dword_591080 ) v27 = HouseNPCData[v26 +1 - (dword_591080 != 0)]->pName; else - v27 = (char *)p2DEvents[pButton - 1].pProprieterName; + v27 = (char*)p2DEvents[pButton - 1].pProprieterName; v30 = v27; v29 = (char*)pGlobalTXT_LocalizationStrings[435]; } @@ -1879,7 +1838,6 @@ return pWindow; } if (eWindowType == WINDOW_Scroll) - //goto LABEL_62; { pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 1u, '1', "", 0); pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, UIMSG_SelectCharacter, 2u, '2', "", 0); diff -r 21a46b38ca24 -r 8a196c858180 GUIWindow.h --- a/GUIWindow.h Sat Jun 15 09:55:07 2013 +0600 +++ b/GUIWindow.h Sat Jun 15 09:55:27 2013 +0600 @@ -5,6 +5,7 @@ + enum UIMessageType: unsigned __int32 { UIMSG_0 = 0, @@ -252,21 +253,21 @@ /* 298 */ enum WindowType: unsigned __int32 { - WINDOW_null = 0, - WINDOW_MainMenu = 1, - WINDOW_OptionsButtons = 3, + WINDOW_null = 0, + WINDOW_MainMenu = 1, + WINDOW_OptionsButtons = 3, WINDOW_CharacterRecord = 4, - WINDOW_Options = 6, - WINDOW_8 = 8, - WINDOW_Book = 9, - WINDOW_Dialogue = 10, + WINDOW_Options = 6, + WINDOW_8 = 8, + WINDOW_Book = 9, + WINDOW_Dialogue = 10, WINDOW_QuickReference = 12, - WINDOW_F = 15, - WINDOW_Rest = 16, + WINDOW_F = 15, + WINDOW_Rest = 16, WINDOW_ChangeLocation = 17, - WINDOW_SpellBook = 0x12, - WINDOW_GreetingNPC = 19, - WINDOW_Chest = 0x14, + WINDOW_SpellBook = 18, + WINDOW_GreetingNPC = 19, + WINDOW_Chest = 20, WINDOW_22 = 0x16, WINDOW_SaveLoadButtons = 23, WINDOW_MainMenu_Load = 0x18, @@ -324,9 +325,9 @@ } GUIButton *CreateButton(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, int a6, int a7, - UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, Texture *pTextures, ...); - void DrawFlashingInputCursor(signed int a3, int a4, struct GUIFont *a2); - int DrawTextInRect(GUIFont *a2, unsigned int uX, unsigned int uY, unsigned int uColor, const char *Str1, int Source, int a8); + UIMessageType msg, unsigned int msg_param, unsigned __int8 uHotkey, const char *pName, struct Texture *pTextures, ...); + void DrawFlashingInputCursor(signed int uX, int uY, struct GUIFont *a2); + int DrawTextInRect(GUIFont *pFont, unsigned int uX, unsigned int uY, unsigned int uColor, const char *text, int rect_width, int reverse_text); void DrawText(GUIFont *a2, signed int uX, int uY, unsigned int uFontColor, const char *Str, int a7, int a8, unsigned int uFontShadowColor); void DrawTitleText(GUIFont *a2, signed int uHorizontalMargin, unsigned int uVerticalMargin, unsigned __int16 uDefaultColor, const char *pInString, unsigned int uLineSpacing); void DrawCurrentTime(__int64 a2); @@ -339,7 +340,7 @@ void _41D08F_set_keyboard_control_group(int a2, int a3, int a4, int a5); void _41D73D_draw_buff_tooltip(); - static GUIWindow *Create(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eType, int a4, int a5); + static GUIWindow *Create(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, enum WindowType eWindowType, int pButton, const char* hint); unsigned int uFrameX; unsigned int uFrameY; @@ -362,7 +363,7 @@ int numVisibleWindows; int receives_keyboard_input_2; // 0 no input 1 currently typing 2 enter pressed 3 escape pressed int receives_keyboard_input; - char *Hint; + const char *Hint; GUIButton *pControlsHead; GUIButton *pControlsTail; }; @@ -463,7 +464,7 @@ -void ModalWindow(const char *pStr, int a4); +void ModalWindow(const char *pStrHint, int a4); diff -r 21a46b38ca24 -r 8a196c858180 Game.cpp --- a/Game.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Game.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -38,6 +38,8 @@ #include "texts.h" #include "GUIFont.h" #include "Log.h" +#include "Lights.h" +#include "mm7_data.h" //#include "MM7.h" diff -r 21a46b38ca24 -r 8a196c858180 Indoor.cpp --- a/Indoor.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Indoor.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -6,7 +6,6 @@ #include "LightmapBuilder.h" #include "DecalBuilder.h" -#include "ParticleEngine.h" #include "stru9.h" #include "stru10.h" #include "stru367.h" @@ -34,6 +33,7 @@ #include "PaletteManager.h" #include "MapInfo.h" #include "IndoorCamera.h" +#include "Lights.h" #include "mm7_data.h" #include "MM7.h" diff -r 21a46b38ca24 -r 8a196c858180 Indoor.h --- a/Indoor.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Indoor.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,6 +1,7 @@ #pragma once #include "VectorTypes.h" #include "Weather.h" +#include "Indoor_stuff.h" @@ -128,17 +129,6 @@ -/* 291 */ -enum PolygonType : __int8 -{ - POLYGON_Invalid = 0x0, - POLYGON_VerticalWall = 0x1, - POLYGON_unk = 0x2, - POLYGON_Floor = 0x3, - POLYGON_InBetweenFloorAndWall = 0x4, - POLYGON_Ceiling = 0x5, - POLYGON_InBetweenCeilingAndWall = 0x6, -}; /* 90 */ #pragma pack(push, 1) @@ -576,5 +566,3 @@ - -#include "Indoor_stuff.h" \ No newline at end of file diff -r 21a46b38ca24 -r 8a196c858180 Indoor_stuff.h --- a/Indoor_stuff.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Indoor_stuff.h Sat Jun 15 09:55:27 2013 +0600 @@ -370,6 +370,17 @@ extern stru337 stru_F81018; +/* 291 */ +enum PolygonType : __int8 +{ + POLYGON_Invalid = 0x0, + POLYGON_VerticalWall = 0x1, + POLYGON_unk = 0x2, + POLYGON_Floor = 0x3, + POLYGON_InBetweenFloorAndWall = 0x4, + POLYGON_Ceiling = 0x5, + POLYGON_InBetweenCeilingAndWall = 0x6, +}; /* 147 */ diff -r 21a46b38ca24 -r 8a196c858180 Keyboard.cpp --- a/Keyboard.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Keyboard.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -2,7 +2,6 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "OSAPI.h" #include "Keyboard.h" #include "GUIWindow.h" diff -r 21a46b38ca24 -r 8a196c858180 LOD.h --- a/LOD.h Sat Jun 15 09:55:07 2013 +0600 +++ b/LOD.h Sat Jun 15 09:55:27 2013 +0600 @@ -150,13 +150,13 @@ bool LoadIconsOrEvents(const char *pLODFilename); void ReleaseAll(); unsigned int LoadTexture(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); - Texture *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); - int LoadTextureFromLOD(Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType); - int ReloadTexture(Texture *pDst, const char *pContainer, int mode); + struct Texture *LoadTexturePtr(const char *pContainer, enum TEXTURE_TYPE uTextureType = TEXTURE_DEFAULT); + int LoadTextureFromLOD(struct Texture *pOutTex, const char *pContainer, enum TEXTURE_TYPE eTextureType); + int ReloadTexture(struct Texture *pDst, const char *pContainer, int mode); void ReleaseHardwareTextures(); void ReleaseLostHardwareTextures(); void _410423_move_textures_to_device(); - int _410522(Texture *pDst, const char *pContainer, unsigned int uTextureType); + int _410522(struct Texture *pDst, const char *pContainer, unsigned int uTextureType); void SetupPalettes(unsigned int uTargetRBits, unsigned int uTargetGBits, unsigned int uTargetBBits); void ReleaseAll2(); void _4114F2(); @@ -165,7 +165,7 @@ void _inlined_sub1(); void _inlined_sub2(); - inline Texture *GetTexture(int idx) + inline struct Texture *GetTexture(int idx) { assert(idx < 1000); if (idx == -1) return nullptr; // we need to return dummy texture here diff -r 21a46b38ca24 -r 8a196c858180 LightmapBuilder.cpp --- a/LightmapBuilder.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/LightmapBuilder.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -5,6 +5,7 @@ #include "Log.h" #include "OutdoorCamera.h" +#include "Lights.h" #include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 LightmapBuilder.h --- a/LightmapBuilder.h Sat Jun 15 09:55:07 2013 +0600 +++ b/LightmapBuilder.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,8 +1,9 @@ #pragma once #include #include "Render.h" -#include "Lights.h" +struct LightsStack_StationaryLight_; +struct LightsStack_MobileLight_; /* 115 */ #pragma pack(push, 1) diff -r 21a46b38ca24 -r 8a196c858180 LightsStack.cpp --- a/LightsStack.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/LightsStack.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -1,7 +1,6 @@ #include #include "Lights.h" -#include "mm7_data.h" //----- (00467D88) -------------------------------------------------------- bool LightsStack_MobileLight_::AddLight(__int16 x, __int16 y, __int16 z, __int16 uSectorID, int uRadius, unsigned __int8 r, unsigned __int8 g, unsigned __int8 b, char uLightType) diff -r 21a46b38ca24 -r 8a196c858180 Math.h --- a/Math.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Math.h Sat Jun 15 09:55:27 2013 +0600 @@ -2,6 +2,9 @@ #include #include #include +#include +#include +#include /* 186 */ @@ -35,9 +38,6 @@ #define ROUNDING_EPSILON 0.0000001 #endif -#include -#include -#include template int bankersRounding( diff -r 21a46b38ca24 -r 8a196c858180 Mouse.cpp --- a/Mouse.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Mouse.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -2,10 +2,10 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "OSAPI.h" -#include "VideoPlayer.h" -#include "Vis.h" +#include "Texture.h" +#include "mm7_data.h" +#include "Render.h" #include "Mouse.h" #include "Items.h" #include "Party.h" diff -r 21a46b38ca24 -r 8a196c858180 Outdoor.cpp --- a/Outdoor.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Outdoor.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -30,6 +30,7 @@ #include "mm7_data.h" #include "MM7.h" +#include "Lights.h" #include "MapInfo.h" diff -r 21a46b38ca24 -r 8a196c858180 Outdoor.h --- a/Outdoor.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Outdoor.h Sat Jun 15 09:55:27 2013 +0600 @@ -2,8 +2,7 @@ #include "Indoor.h" #include "TileFrameTable.h" -#include "Weather.h" -#include "BSPModel.h" +#include "Outdoor_stuff.h" #define DAY_ATTRIB_FOG 1 @@ -193,7 +192,7 @@ char pSkyTextureName[32]; char pGroundTileset[32]; OutdoorLocationTileType pTileTypes[4]; // [3] road tileset - unsigned int uNumBModels; + int uNumBModels; struct OutdoorLocationTerrain pTerrain; void *pCmap; BSPModel *pBModels; @@ -273,5 +272,3 @@ - -#include "Outdoor_stuff.h" \ No newline at end of file diff -r 21a46b38ca24 -r 8a196c858180 Outdoor_stuff.h --- a/Outdoor_stuff.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Outdoor_stuff.h Sat Jun 15 09:55:27 2013 +0600 @@ -32,7 +32,7 @@ __int16 field_32; int field_34; struct stru149 *ptr_38; - Texture *pTexture; + struct Texture *pTexture; struct Span *prolly_head; struct Span *prolly_tail; int **ptr_48; diff -r 21a46b38ca24 -r 8a196c858180 Party.h --- a/Party.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Party.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,7 +1,6 @@ #pragma once #include "Player.h" #include "NPC.h" -#include "Spells.h" #include "VectorTypes.h" diff -r 21a46b38ca24 -r 8a196c858180 Player.cpp --- a/Player.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Player.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -7,7 +7,6 @@ #include "stru6.h" -#include "OSAPI.h" #include "Player.h" #include "PlayerFrameTable.h" #include "AudioPlayer.h" @@ -7871,15 +7870,15 @@ void Player::SetVariable(enum VariableType var_type, signed int var_value) { signed int currPlayerId; // ebx@1 - Player *v4; // esi@1 - unsigned int v5; // edi@1 + Player *v4_unused; // esi@1 + unsigned int v5_unused; // edi@1 unsigned int v6; // esi@13 unsigned int v7; // esi@14 - signed int v8; // eax@17 + signed int v8_unused; // eax@17 ItemGen *v9; // ecx@17 int v10; // eax@21 signed int v11; // eax@30 - Player *v12; // ecx@44 + Player *unused12; // ecx@44 char *v13; // ecx@45 Player *v14; // ecx@49 int v15; // ecx@86 @@ -7894,23 +7893,22 @@ DDM_DLV_Header *v24; // ecx@148 signed int v25; // eax@172 int v26; // [sp-8h] [bp-3Ch]@84 - signed int v27; // [sp-4h] [bp-38h]@4 - int v28; // [sp-4h] [bp-38h]@84 + signed int unused27; // [sp-4h] [bp-38h]@4 + int v28_unused; // [sp-4h] [bp-38h]@84 ItemGen item; // [sp+Ch] [bp-28h]@52 - char v30; // [sp+32h] [bp-2h]@1 - char v31; // [sp+33h] [bp-1h]@1 - - currPlayerId = 0; - v30 = 0; - v31 = 0; - v4 = this; - v5 = 0; - if ( this == pPlayers[2] ) - currPlayerId = 1; - else if ( this == pPlayers[3] ) - currPlayerId = 2; - else if ( this == pPlayers[4] ) - currPlayerId = 3; + char v30_unused; // [sp+32h] [bp-2h]@1 + char v31_unused; // [sp+33h] [bp-1h]@1 + + currPlayerId = -1; + for (int i = 1; i <= 4; i++) //TODO: add a member variable for playerid in the future + { + if ( this == pPlayers[i] ) + { + currPlayerId = i - 1; + break; + } + } + assert(currPlayerId != -1); if ( var_type > VAR_AutoNotes ) { if ( var_type <= VAR_GoldInBank ) @@ -7976,50 +7974,36 @@ return; bFlashHistoryBook = 1; } -LABEL_172: v25 = 8 * currPlayerId + 400; LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); - pAudioPlayer->PlaySound(SOUND_20001, v25, v5, -1, v5, v5, v5, v5); + pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); return; } - if ( var_type != 307 ) - { - switch ( var_type ) - { - case 308: - pParty->uNumBountiesCollected = var_value; - break; - case 309: - pParty->uNumPrisonTerms = var_value; - break; - case 310: - pParty->uNumArenaPageWins = var_value; - break; - case 311: - pParty->uNumArenaSquireWins = var_value; - break; - case 312: - pParty->uNumArenaKnightWins = var_value; - break; - case 313: - pParty->uNumArenaLordWins = var_value; - break; - } - return; - } - pParty->uNumDeaths = var_value; -LABEL_168: - if ( v30 != 1 ) - { -LABEL_170: - if ( v31 != 1 ) - return; - v5 = 0; - goto LABEL_172; - } -LABEL_169: - pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); - goto LABEL_170; + switch ( var_type ) + { + case VAR_NumDeaths: + pParty->uNumDeaths = var_value; + break; + case VAR_NumBounties: + pParty->uNumBountiesCollected = var_value; + break; + case VAR_PrisonTerms: + pParty->uNumPrisonTerms = var_value; + break; + case VAR_ArenaWinsPage: + pParty->uNumArenaPageWins = var_value; + break; + case VAR_ArenaWinsSquire: + pParty->uNumArenaSquireWins = var_value; + break; + case VAR_ArenaWinsKnight: + pParty->uNumArenaKnightWins = var_value; + break; + case VAR_ArenaWinsLord: + pParty->uNumArenaLordWins = var_value; + break; + } + return; } if ( var_type == VAR_AutoNotes ) { @@ -8028,219 +8012,210 @@ && pAutonoteTxt[var_value-1].pText ) { v20 = pPlayers[currPlayerId + 1]; - v30 = 1; v20->PlaySound(SPEECH_96, 0); v21 = pAutonoteTxt[var_value-1].eType;// dword_72371C[2 * a3]; bFlashAutonotesBook = 1; _506568_autonote_type = v21; + DrawPlayerBuffAnimBasedOnCondition(currPlayerId); } _449B7E_toggle_bit(pParty->_autonote_bits, var_value, 1u); - v31 = 1; - goto LABEL_168; - } - if ( var_type <= VAR_ActualMight ) - { - if ( var_type != VAR_ActualMight ) - { - switch ( var_type ) - { - case VAR_RandomGold: - v6 = rand() % var_value + 1; - Party::SetGold(v6); - sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold - ShowStatusBarString(pTmpBuf.data(), 2u); - GameUI_DrawFoodAndGold(); - return; - case VAR_RandomFood: - v7 = rand() % var_value + 1; - Party::SetFood(v7); - sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food - ShowStatusBarString(pTmpBuf.data(), 2u); - GameUI_DrawFoodAndGold(); - goto LABEL_124; - case VAR_Sex: - this->uSex = (PLAYER_SEX)var_value; - goto LABEL_124; - case VAR_Class: - this->classType = (PLAYER_CLASS_TYPE)var_value; - if ( (char)var_value != 35 ) - goto LABEL_124; - v8 = 0; - v9 = this->pInventoryItems; - break; - case VAR_CurrentHP: - this->sHealth = var_value; - goto LABEL_124; - case VAR_MaxHP: - this->sHealth = GetMaxHealth(); - return; - case VAR_CurrentSP: - this->sMana = var_value; - goto LABEL_124; - case VAR_MaxSP: - this->sMana = GetMaxMana(); - return; - case VAR_ACModifier: - this->sACModifier = (unsigned __int8)var_value; - goto LABEL_124; - case VAR_BaseLevel: - this->uLevel = (unsigned __int8)var_value; - goto LABEL_124; - case VAR_LevelModifier: - this->sLevelModifier = (unsigned __int8)var_value; - goto LABEL_124; - case VAR_Age: - this->sAgeModifier = var_value; - return; - case VAR_Award: - if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & - pPlayers[currPlayerId + 1]->_guilds_member_bits[((signed __int16)var_value - 1)/ 8]) - //&& dword_723E80_award_related[2 * a3] ) - && pAwards[var_value].pText ) + PlaySoundBasedOnCondition(currPlayerId); + return; + } + if ( var_type <= VAR_BaseLuck ) + { + switch ( var_type ) + { + case VAR_Sex: + this->uSex = (PLAYER_SEX)var_value; + goto LABEL_124; + case VAR_Class: + this->classType = (PLAYER_CLASS_TYPE)var_value; + if ( (char)var_value == PLAYER_CLASS_LICH ) + { + v9 = NULL; + for (int i = 0; i < 138; i++) + { + v9 = &this->pInventoryItems[i]; + if (v9->uItemID == 615) + break; + } + if (v9 != NULL || v9->uItemID != 615) { - v30 = 1; - v31 = 1; - pPlayers[currPlayerId + 1]->PlaySound(SPEECH_96, 0); + v10 = (int)((char *)this + 36 * 138); //originally 36 * v8. the code got to this condition only if v8 was equal to 138 + *(int *)(v10 + 532) = 601; + *(char *)(v10 + 558) = currPlayerId + 1; } - _449B7E_toggle_bit((unsigned char *)v4->_guilds_member_bits, var_value, 1u); - goto LABEL_168; - case VAR_Experience: - this->uExperience = var_value; - goto LABEL_124; - case VAR_QBits_QuestsDone: - if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) - // && (&dword_722F10)[4 * a3] ) - && pQuestTable[var_value-1] ) + if ( this->sResFireBase < 20 ) + this->sResFireBase = 20; + if ( this->sResAirBase < 20 ) + this->sResAirBase = 20; + if ( this->sResWaterBase < 20 ) + this->sResWaterBase = 20; + if ( this->sResEarthBase < 20 ) + this->sResEarthBase = 20; + this->sResMindBase = 200; + this->sResBodyBase = 200; + v11 = this->GetSexByVoice(); + this->uPrevVoiceID = this->uVoiceID; + this->uPrevFace = this->uCurrentFace; + if ( v11 ) { - v14 = pPlayers[currPlayerId + 1]; - bFlashQuestBook = 1; - v30 = 1; - v31 = 1; - v14->PlaySound(SPEECH_93, 0); + this->uCurrentFace = 21; + this->uVoiceID = 21; + } + else + { + this->uCurrentFace = 20; + this->uVoiceID = 20; } - v13 = (char *)pParty->_quest_bits; -LABEL_51: - _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u); - if (( v30 != 1 )&&( v31 != 1 )) - return; - else - pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); - if ( v31 != 1 ) - return; - v25 = 8 * currPlayerId + 400; - LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); - pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); - return; - case VAR_PlayerItemInHands: - item.Reset(); - item.Reset(); - item.uItemID = var_value; - item.uAttributes = 1; - pParty->SetHoldingItem(&item); - if ( var_value >= ITEM_ARTIFACT_PUCK && var_value <= ITEM_RELIC_MEKORIGS_HAMMER ) - pParty->pIsArtifactFound[var_value-500] = 1; - return; - case VAR_FixedGold: - Party::SetGold(var_value); - return; - case VAR_BaseMight: - this->uMight = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_BaseIntellect: - this->uIntelligence = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_BasePersonality: - this->uWillpower = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_BaseEndurance: - this->uEndurance = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_BaseSpeed: - this->uSpeed = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_BaseAccuracy: - this->uAccuracy = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_BaseLuck: - this->uLuck = (unsigned __int8)var_value; - goto LABEL_84; - case VAR_FixedFood: - Party::SetFood(var_value); - goto LABEL_124; - case VAR_MightBonus: - goto LABEL_64; - case VAR_IntellectBonus: - goto LABEL_68; - case VAR_PersonalityBonus: - goto LABEL_69; - case VAR_EnduranceBonus: - goto LABEL_70; - case VAR_SpeedBonus: - goto LABEL_71; - case VAR_AccuracyBonus: - goto LABEL_72; - case VAR_LuckBonus: - goto LABEL_73; - default: - return; - } - while ( v9->uItemID != 615 ) - { - ++v8; - ++v9; - if ( v8 >= 138 ) - goto LABEL_22; - } - v10 = (int)((char *)v4 + 36 * v8); - *(int *)(v10 + 532) = 601; - *(char *)(v10 + 558) = currPlayerId + 1; -LABEL_22: - if ( v4->sResFireBase < 20 ) - v4->sResFireBase = 20; - if ( v4->sResAirBase < 20 ) - v4->sResAirBase = 20; - if ( v4->sResWaterBase < 20 ) - v4->sResWaterBase = 20; - if ( v4->sResEarthBase < 20 ) - v4->sResEarthBase = 20; - v4->sResMindBase = 200; - v4->sResBodyBase = 200; - v11 = v4->GetSexByVoice(); - v4->uPrevVoiceID = v4->uVoiceID; - v4->uPrevFace = v4->uCurrentFace; - if ( v11 ) - { - v4->uCurrentFace = 21; - v4->uVoiceID = 21; - } - else - { - v4->uCurrentFace = 20; - v4->uVoiceID = 20; - } - ReloadPlayerPortraits(currPlayerId, v4->uCurrentFace); - goto LABEL_124; - } -LABEL_64: - this->uMightBonus = (unsigned __int8)var_value; + ReloadPlayerPortraits(currPlayerId, this->uCurrentFace); + } + goto LABEL_124; + case VAR_CurrentHP: + this->sHealth = var_value; + goto LABEL_124; + case VAR_MaxHP: + this->sHealth = GetMaxHealth(); + return; + case VAR_CurrentSP: + this->sMana = var_value; + goto LABEL_124; + case VAR_MaxSP: + this->sMana = GetMaxMana(); + return; + case VAR_ACModifier: + this->sACModifier = (unsigned __int8)var_value; + goto LABEL_124; + case VAR_BaseLevel: + this->uLevel = (unsigned __int8)var_value; + goto LABEL_124; + case VAR_LevelModifier: + this->sLevelModifier = (unsigned __int8)var_value; + goto LABEL_124; + case VAR_Age: + this->sAgeModifier = var_value; + return; + case VAR_Award: + if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & + pPlayers[currPlayerId + 1]->_guilds_member_bits[((signed __int16)var_value - 1)/ 8]) + //&& dword_723E80_award_related[2 * a3] ) + && pAwards[var_value].pText ) + { + pPlayers[currPlayerId + 1]->PlaySound(SPEECH_96, 0); + DrawPlayerBuffAnimBasedOnCondition(currPlayerId); + PlaySoundBasedOnCondition(currPlayerId); + } + _449B7E_toggle_bit((unsigned char *)this->_guilds_member_bits, var_value, 1u); + return; + case VAR_Experience: + this->uExperience = var_value; + goto LABEL_124; + case VAR_QBits_QuestsDone: + if ( !((unsigned __int8)(0x80u >> ((signed __int16)var_value - 1) % 8) & pParty->_quest_bits[((signed __int16)var_value - 1) >> 3]) + // && (&dword_722F10)[4 * a3] ) + && pQuestTable[var_value-1] ) + { + v14 = pPlayers[currPlayerId + 1]; + bFlashQuestBook = 1; + v14->PlaySound(SPEECH_93, 0); + DrawPlayerBuffAnimBasedOnCondition(currPlayerId); + PlaySoundBasedOnCondition(currPlayerId); + } + v13 = (char *)pParty->_quest_bits; + _449B7E_toggle_bit((unsigned char *)v13, var_value, 1u); + return; + case VAR_PlayerItemInHands: + item.Reset(); + item.Reset(); + item.uItemID = var_value; + item.uAttributes = 1; + pParty->SetHoldingItem(&item); + if ( var_value >= ITEM_ARTIFACT_PUCK && var_value <= ITEM_RELIC_MEKORIGS_HAMMER ) + pParty->pIsArtifactFound[var_value-500] = 1; + return; + case VAR_FixedGold: + Party::SetGold(var_value); + return; + case VAR_RandomGold: + v6 = rand() % var_value + 1; + Party::SetGold(v6); + sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[500], v6);// You have %lu gold + ShowStatusBarString(pTmpBuf.data(), 2u); + GameUI_DrawFoodAndGold(); + return; + case VAR_FixedFood: + Party::SetFood(var_value); + goto LABEL_124; + case VAR_RandomFood: + v7 = rand() % var_value + 1; + Party::SetFood(v7); + sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[501], v7);// You have %lu food + ShowStatusBarString(pTmpBuf.data(), 2u); + GameUI_DrawFoodAndGold(); + goto LABEL_124; + case VAR_MightBonus: + goto LABEL_64; + case VAR_IntellectBonus: + goto LABEL_68; + case VAR_PersonalityBonus: + goto LABEL_69; + case VAR_EnduranceBonus: + goto LABEL_70; + case VAR_SpeedBonus: + goto LABEL_71; + case VAR_AccuracyBonus: + goto LABEL_72; + case VAR_LuckBonus: + goto LABEL_73; + case VAR_BaseMight: + this->uMight = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + case VAR_BaseIntellect: + this->uIntelligence = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + case VAR_BasePersonality: + this->uWillpower = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + case VAR_BaseEndurance: + this->uEndurance = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + case VAR_BaseSpeed: + this->uSpeed = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + case VAR_BaseAccuracy: + this->uAccuracy = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + case VAR_BaseLuck: + this->uLuck = (unsigned __int8)var_value; + v26 = 92; + goto LABEL_112; + default: + return; + } LABEL_111: - v28 = 0; v26 = SPEECH_91; LABEL_112: v19 = pPlayers[currPlayerId + 1]; - v31 = 1; - v19->PlaySound((PlayerSpeech)v26, v28); - goto LABEL_169; - } - if ( var_type <= VAR_FireResistanceBonus ) - { - if ( var_type == VAR_FireResistanceBonus ) - { - this->sResFireBonus = (unsigned __int8)var_value; - goto LABEL_111; - } + v19->PlaySound((PlayerSpeech)v26, 0); + DrawPlayerBuffAnimBasedOnCondition(currPlayerId); + PlaySoundBasedOnCondition(currPlayerId); + return; + } + if ( var_type <= VAR_MagicResistance ) + { switch ( var_type ) { + case VAR_ActualMight: +LABEL_64: + this->uMightBonus = (unsigned __int8)var_value; + goto LABEL_111; case VAR_ActualIntellect: LABEL_68: this->uIntelligenceBonus = (unsigned __int8)var_value; @@ -8267,35 +8242,42 @@ goto LABEL_111; case VAR_FireResistance: this->sResFireBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_AirResistance: this->sResAirBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_WaterResistance: this->sResWaterBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_EarthResistance: this->sResEarthBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_SpiritResistance: this->sResSpiritBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_MindResistance: this->sResMindBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_BodyResistance: this->sResBodyBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_LightResistance: this->sResLightBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_DarkResistance: this->sResDarkBase = (unsigned __int8)var_value; - goto LABEL_84; + v26 = 92; + goto LABEL_112; case VAR_MagicResistance: this->sResMagicBase = (unsigned __int8)var_value; -LABEL_84: - v28 = 0; v26 = 92; goto LABEL_112; default: @@ -8312,7 +8294,7 @@ return; if ( var_type <= VAR_Eradicated ) { - v4->SetCondition(var_type - 105, 1); + this->SetCondition(var_type - 105, 1); } else { @@ -8322,94 +8304,94 @@ byte_5E4C15[var_type] = var_value; return; } - memset(v4, 0, 0xA0u); + memset(this, 0, 0xA0u); } -LABEL_124: - v31 = 1; - goto LABEL_169; - } -LABEL_106: - v16 = (int)((char *)&v4->pConditions[16] + 2 * var_type); - v17 = *(char *)v16; - if ( var_value <= VAR_BodyResistanceBonus ) - { - LOWORD(v15) = (unsigned __int8)var_value; - v18 = v15 | v17 & VAR_BodyResistanceBonus; } else { - LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0); - } - *(short *)v16 = v18; - goto LABEL_124; - } - if ( var_type == VAR_DisarmTrapSkill ) - if ( v30 != 1 ) - { - if ( v31 != 1 ) - return; - v5 = 0; - goto LABEL_172; - } - pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); - goto LABEL_170; - if ( var_type <= VAR_BodyResistanceBonus ) + v16 = (int)((char *)&this->pConditions[16] + 2 * var_type); + v17 = *(char *)v16; + if ( var_value <= VAR_BodyResistanceBonus ) + { + LOWORD(v15) = (unsigned __int8)var_value; + v18 = v15 | v17 & VAR_BodyResistanceBonus; + } + else + { + LOWORD(v18) = (unsigned __int8)(var_value | v17 & 0xC0); + } + *(short *)v16 = v18; + } +LABEL_124: + DrawPlayerBuffAnimBasedOnCondition(currPlayerId); + PlaySoundBasedOnCondition(currPlayerId); + return; + } + if ( var_type <= VAR_MagicResistanceBonus ) { switch ( var_type ) { - case VAR_BodyResistanceBonus: - v4->sResBodyBonus = (unsigned __int8)var_value; + case VAR_FireResistanceBonus: + this->sResFireBonus = (unsigned __int8)var_value; break; case VAR_AirResistanceBonus: - v4->sResAirBonus = (unsigned __int8)var_value; + this->sResAirBonus = (unsigned __int8)var_value; break; case VAR_WaterResistanceBonus: - v4->sResWaterBonus = (unsigned __int8)var_value; + this->sResWaterBonus = (unsigned __int8)var_value; break; case VAR_EarthResistanceBonus: - v4->sResEarthBonus = (unsigned __int8)var_value; + this->sResEarthBonus = (unsigned __int8)var_value; break; case VAR_SpiritResistanceBonus: - v4->sResSpiritBonus = (unsigned __int8)var_value; + this->sResSpiritBonus = (unsigned __int8)var_value; + break; + case VAR_MindResistanceBonus: + this->sResMindBonus = (unsigned __int8)var_value; + break; + case VAR_BodyResistanceBonus: + this->sResBodyBonus = (unsigned __int8)var_value; + break; + case VAR_LightResistanceBonus: + this->sResLightBonus = (unsigned __int8)var_value; + break; + case VAR_DarkResistanceBonus: + this->sResDarkBonus = (unsigned __int8)var_value; + break; + case VAR_PhysicalResistanceBonus: + assert("VAR_PhysicalResistanceBonus variable unsupported" && false); + return; + break; + case VAR_MagicResistanceBonus: + this->sResMagicBonus = (unsigned __int8)var_value; break; default: - if ( var_type != 62 ) + assert("Unexpected var_type" && false); return; - v4->sResMindBonus = (unsigned __int8)var_value; break; } goto LABEL_111; } - if ( var_type == VAR_LightResistanceBonus ) - { - v4->sResLightBonus = (unsigned __int8)var_value; - goto LABEL_111; - } - if ( var_type == VAR_DarkResistanceBonus ) - { - v4->sResDarkBonus = (unsigned __int8)var_value; - goto LABEL_111; - } - if ( var_type == VAR_MagicResistanceBonus ) - { - v4->sResMagicBonus = (unsigned __int8)var_value; - goto LABEL_111; - } - if ( var_type > VAR_MagicResistanceBonus && var_type <= VAR_DiplomacySkill ) - if ( v30 != 1 ) - { - if ( v31 != 1 ) - return; - v5 = 0; - v25 = 8 * currPlayerId + 400; - LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); - pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); - return; - } - pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); - goto LABEL_170; -} - + if ( var_type > VAR_MagicResistanceBonus && var_type <= VAR_DiplomacySkill || var_type == VAR_DisarmTrapSkill) //VAR_ThieverySkill wasn't present in the original function + { + return; + } +} + + +//----- (new function) -------------------------------------------------------- +void Player::PlaySoundBasedOnCondition(int currPlayerId) +{ + signed int v25 = 8 * currPlayerId + 400; + LOBYTE(v25) = PID(OBJECT_Player,currPlayerId - 112); + pAudioPlayer->PlaySound(SOUND_20001, v25, 0, -1, 0, 0, 0, 0); +} + +//----- (new function) -------------------------------------------------------- +void Player::DrawPlayerBuffAnimBasedOnCondition(int currPlayerId) +{ + pGame->pStru6Instance->SetPlayerBuffAnim(0x96u, currPlayerId); +} //----- (0044AFFB) -------------------------------------------------------- void Player::AddVariable(enum VariableType var_type, signed int val) diff -r 21a46b38ca24 -r 8a196c858180 Player.h --- a/Player.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Player.h Sat Jun 15 09:55:27 2013 +0600 @@ -590,6 +590,8 @@ void SalesProcess(unsigned int inventory_idnx, int item_index, int _2devent_idx);//0x4BE2DD bool Recover(signed int a2); bool CanCastSpell(unsigned int uRequiredMana); + void PlaySoundBasedOnCondition(int currPlayerId); + void DrawPlayerBuffAnimBasedOnCondition(int currPlayerId); inline bool Weak() {return pConditions[Condition_Weak] != 0;} inline bool Dead() {return pConditions[Condition_Dead] != 0;} @@ -619,7 +621,6 @@ - __int64 pConditions[20]; unsigned __int64 uExperience; char pName[16]; diff -r 21a46b38ca24 -r 8a196c858180 PlayerFrameTable.h --- a/PlayerFrameTable.h Sat Jun 15 09:55:07 2013 +0600 +++ b/PlayerFrameTable.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,5 +1,4 @@ #pragma once -#include "Player.h" /* 46 */ diff -r 21a46b38ca24 -r 8a196c858180 Random.cpp --- a/Random.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Random.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -1,8 +1,7 @@ #include #include "Random.h" - -#include "mm7_data.h" +#include "Math.h" @@ -50,13 +49,11 @@ double v3; // ST04_8@1 int floored_random; // ecx@1 - v1 = this; v2 = GetRandom() * (double)this->range; - v3 = v2 + 6.7553994e15; - floored_random = LODWORD(v3); - if ( SLODWORD(v3) >= v1->range ) - floored_random = v1->range; - return floored_random + v1->min; + floored_random = bankersRounding(v2); + if ( floored_random >= this->range ) + floored_random = this->range; + return floored_random + this->min; } //----- (004BE65D) -------------------------------------------------------- diff -r 21a46b38ca24 -r 8a196c858180 Render.cpp --- a/Render.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Render.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -36,6 +36,7 @@ #include "texts.h" #include "mm7_data.h" #include "MM7.h" +#include "Lights.h" #pragma comment(lib, "lib\\legacy_dx\\lib\\ddraw.lib") #pragma comment(lib, "lib\\legacy_dx\\lib\\dxguid.lib") @@ -9565,8 +9566,8 @@ } //----- (004A6AB1) -------------------------------------------------------- -void Render::DrawTextPalette(int x, int y, int a4, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8) -{ +void Render::DrawTextPalette( int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8 ) + { int v8; // edi@2 unsigned int v9; // esi@2 unsigned __int16 *v10; // eax@2 @@ -9599,14 +9600,14 @@ v8 = a5; v9 = a6; v10 = &pTargetSurface[x + y * uTargetSurfacePitch]; - v11 = (unsigned char *)a4; - v25 = a4; + v11 = (unsigned char *)font_pixels; + v25 = (int)font_pixels; if ( this->bClip ) { v12 = this->uClipX; if ( a2 < (signed int)v12 ) { - v25 = v12 - a2 + a4; + v25 = v12 - a2 + (int)font_pixels; v10 += v12 - a2; v8 = a5 + a2 - v12; } diff -r 21a46b38ca24 -r 8a196c858180 Render.h --- a/Render.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Render.h Sat Jun 15 09:55:27 2013 +0600 @@ -323,7 +323,7 @@ void DrawTerrainPolygon(unsigned int uNumVertices, stru148 *a4, IDirect3DTexture2 *a5, bool transparent, bool clampAtTextureBorders); void DrawSkyPolygon(unsigned int uNumVertices, stru148 *a3, IDirect3DTexture2 *pTexture); void _4A2ED5(signed int a2, stru148 *a3, IDirect3DTexture2 *pHwTex); - void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, Texture *pTex, int uPackedID, unsigned int uColor, int a8); + void DrawIndoorPolygon(unsigned int uNumVertices, struct BLVFace *a3, IDirect3DTexture2 *pHwTex, struct Texture *pTex, int uPackedID, unsigned int uColor, int a8); void MakeParticleBillboardAndPush_BLV(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); void MakeParticleBillboardAndPush_ODM(RenderBillboardTransform_local0 *a2, IDirect3DTexture2 *a3, unsigned int uDiffuse, int angle); void TransformBillboard(RenderBillboardTransform_local0 *a2, Sprite *pSprite, int dimming_level, RenderBillboard *pBillboard); @@ -340,20 +340,20 @@ void ResetTextureClipRect(); void DrawTextureRGB(unsigned int uOutX, unsigned int uOutY, RGBTexture *a4); void _4A5D33(unsigned int a2, unsigned int a3, int a4, int a5, RGBTexture *pTexture); - void DrawTextureIndexed(unsigned int uX, unsigned int uY, Texture *a4); - void ZBuffer_Fill_2(signed int a2, signed int a3, Texture *pTexture, int a5); - void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, Texture *pTexture, int zVal); - void DrawTextureTransparent(unsigned int uX, unsigned int uY, Texture *pTexture); - void _4A63E6(unsigned int a2, unsigned int a3, Texture *a4, Texture *a5, int a6, int a7, int a8); - void _4A65CC(unsigned int x, unsigned int y, Texture *a4, Texture *a5, int a6, int a7, int a8); - void DrawTransparentRedShade(unsigned int a2, unsigned int a3, Texture *a4); - void DrawTransparentGreenShade(signed int a2, signed int a3, Texture *pTexture); - void _4A6A68(unsigned int a2, unsigned int a3, Texture *a4, __int16 height); - void DrawTextPalette(int x, int y, int a4, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8); + void DrawTextureIndexed(unsigned int uX, unsigned int uY, struct Texture *a4); + void ZBuffer_Fill_2(signed int a2, signed int a3, struct Texture *pTexture, int a5); + void DrawMaskToZBuffer(signed int uOutX, unsigned int uOutY, struct Texture *pTexture, int zVal); + void DrawTextureTransparent(unsigned int uX, unsigned int uY, struct Texture *pTexture); + void _4A63E6(unsigned int a2, unsigned int a3, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); + void _4A65CC(unsigned int x, unsigned int y, struct Texture *a4, struct Texture *a5, int a6, int a7, int a8); + void DrawTransparentRedShade(unsigned int a2, unsigned int a3, struct Texture *a4); + void DrawTransparentGreenShade(signed int a2, signed int a3, struct Texture *pTexture); + void _4A6A68(unsigned int a2, unsigned int a3, struct Texture *a4, __int16 height); + void DrawTextPalette(int x, int y, unsigned char* font_pixels, int a5, unsigned int uFontHeight, unsigned __int16 *pPalette, int a8); void DrawText(signed int uOutX, signed int uOutY, unsigned __int8 *pFontPixels, unsigned int uCharWidth, unsigned int uCharHeight, unsigned __int16 *pFontPalette, unsigned __int16 uFaceColor, unsigned __int16 uShadowColor); void FillRectFast(unsigned int uX, unsigned int uY, unsigned int uWidth, unsigned int uHeight, unsigned int uColor16); int _4A6DF5(unsigned __int16 *pBitmap, unsigned int uBitmapPitch, struct Vec2_int_ *pBitmapXY, unsigned __int16 *pTarget, unsigned int uTargetPitch, Vec4_int_ *a7); - void _4A6E7E(unsigned int a2, unsigned int a3, Texture *a4); + void _4A6E7E(unsigned int a2, unsigned int a3, struct Texture *a4); char DrawBuildingsD3D(); struct BSPModel *DrawBuildingsSW(); int OnOutdoorRedrawSW(); diff -r 21a46b38ca24 -r 8a196c858180 SpriteObject.cpp --- a/SpriteObject.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/SpriteObject.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -227,7 +227,7 @@ int v33; // eax@62 int v34; // ecx@62 int v35; // eax@63 - Actor *v36; // ecx@67 + int v36; // ecx@67 __int16 v37; // ax@67 int v38; // eax@72 int v39; // eax@72 @@ -250,8 +250,8 @@ int v56; // [sp+94h] [bp-14h]@11 int v57; // [sp+98h] [bp-10h]@1 int v58; // [sp+9Ch] [bp-Ch]@1 - int v59; // [sp+A0h] [bp-8h]@1 - Actor *v60; // [sp+A4h] [bp-4h]@11 + int on_water; // [sp+A0h] [bp-8h]@1 + int v60; // [sp+A4h] [bp-4h]@11 uLayingItemID_ = uLayingItemID; v1 = &pSpriteObjects[uLayingItemID]; @@ -262,20 +262,19 @@ v4 = v1->vPosition.x; v5 = v2->uHeight; v55 = 0; - v6 = ODM_GetFloorLevel(v4, v3, v1->vPosition.z, v5, &v59, &v55, 0); + v6 = ODM_GetFloorLevel(v4, v3, v1->vPosition.z, v5, &on_water, &v55, 0); v7 = v6; v54 = v6; v8 = v6 + 1; if ( v1->vPosition.z <= v6 + 1 ) { - if ( v59 ) + if ( on_water ) { v9 = v6 + 60; if ( v55 ) v9 = v7 + 30; sub_42F960_create_object(v1->vPosition.x, v1->vPosition.y, v9); SpriteObject::OnInteraction(uLayingItemID_); - v7 = v54; } } else @@ -283,7 +282,7 @@ v58 = 1; } v10 = v2->uFlags; - if ( !(v10 & 0x20) ) + if ( !(v2->uFlags & OBJECT_DESC_NO_GRAVITY) ) { if ( v58 ) { @@ -298,11 +297,11 @@ ODM_GetTerrainNormalAt(v12, v11, &v51); v1->vVelocity.z -= LOWORD(pEventTimer->uTimeElapsed) * GetGravityStrength(); v56 = abs(v51.y * v1->vVelocity.y + v51.z * v1->vVelocity.z + v51.x * v1->vVelocity.x) >> 16; - v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16); + v60 = ((unsigned __int64)(v56 * (signed __int64)v51.x) >> 16); v1->vVelocity.x += (unsigned int)(v56 * v51.x) >> 16; - v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16); + v60 = ((unsigned __int64)(v56 * (signed __int64)v51.y) >> 16); v1->vVelocity.y += (unsigned int)(v56 * v51.y) >> 16; - v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16); + v60 = ((unsigned __int64)(v56 * (signed __int64)v51.z) >> 16); v1->vVelocity.z += (unsigned int)(v56 * v51.z) >> 16; LABEL_12: v7 = v54; @@ -316,75 +315,64 @@ return; } v1->vPosition.z = v8; - if ( !(v2->uFlags & 0x80) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) ) + if ( !(v2->uFlags & OBJECT_DESC_BOUNCE) || (v21 = -v1->vVelocity.z >> 1, v1->vVelocity.z = v21, (signed __int16)v21 < 10) ) v1->vVelocity.z = 0; - v60 = (Actor *)v1->vVelocity.x; - v55 = 58500; - v60 = (Actor *)((unsigned __int64)(58500i64 * (signed int)v60) >> 16); - v1->vVelocity.x = (signed __int16)v60; - v60 = (Actor *)v1->vVelocity.y; - v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16); - v55 = 58500; - v1->vVelocity.y = (signed __int16)v60; - v60 = (Actor *)v1->vVelocity.z; - v60 = (Actor *)((unsigned __int64)(v55 * (signed __int64)(signed int)v60) >> 16); - v22 = v1->vVelocity.x; - v1->vVelocity.z = (signed __int16)v60; - if ( v1->vVelocity.y * v1->vVelocity.y + v22 * v22 >= 400 ) - goto LABEL_12; + + v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16); + v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16); + v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16); + + if ( (v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x) < 400 ) + { + v1->vVelocity.y = 0; v1->vVelocity.x = 0; - if ( !(HIBYTE(v2->uFlags) & 1) ) - return; memset(&Dst, 0, 0x68u); - v23 = v2->uFlags; Dst.x = (double)v1->vPosition.x; Dst.y = (double)v1->vPosition.y; Dst.z = (double)v1->vPosition.z; Dst.flt_10 = 0.0; Dst.flt_14 = 0.0; Dst.flt_18 = 0.0; - if ( HIBYTE(v23) & 2 ) + if (v2->uFlags & OBJECT_DESC_TRIAL_FIRE ) { Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; Dst.uDiffuse = 0xFF3C1E; - v24 = rand(); - v48 = (TEXTURE_TYPE)0; -LABEL_83: - v47 = "effpar01"; + Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; + Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); + Dst.flt_28 = 1.0; + pGame->pParticleEngine->AddParticle(&Dst); } - else + else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE) { - if ( HIBYTE(v23) & 4 ) - { + Dst.type = ParticleType_Line; Dst.uDiffuse = rand(); Dst.timeToLive = 64; Dst.uTextureID = 0; -LABEL_89: Dst.flt_28 = 1.0; pGame->pParticleEngine->AddParticle(&Dst); - return; } + else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE ) + { Dst.type = ParticleType_Bitmap | ParticleType_8; Dst.uDiffuse = rand(); - v24 = rand(); - v48 = (TEXTURE_TYPE)0; -LABEL_87: - v47 = "effpar03"; + Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; + Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); + Dst.flt_28 = 1.0; + pGame->pParticleEngine->AddParticle(&Dst); } - Dst.timeToLive = (unsigned __int8)(v24 & 0x80) + 128; - Dst.uTextureID = pBitmaps_LOD->LoadTexture(v47, v48); - goto LABEL_89; + return; + } } LABEL_13: if ( v1->vPosition.z > v7 - && (v13 = v1->vPosition.x, v13 >= -32768) - && v13 <= 32768 - && (v14 = v1->vPosition.y, v14 >= -32768) - && v14 <= 32768 + && (v13 = v1->vPosition.x, v13 >= -0x8000) + && v13 <= 0x8000 + && (v14 = v1->vPosition.y, v14 >= -0x8000) + && v14 <= 0x8000 && v1->vPosition.z <= 13000 - || !(v2->uFlags & 0x40) ) + || !(v2->uFlags & OBJECT_DESC_INTERACTABLE) ) goto LABEL_92; if ( v1->vPosition.z < v7 ) v1->vPosition.z = v8; @@ -414,34 +402,23 @@ return; _46E889_collide_against_bmodels(0); v16 = WorldPosToGridCellZ(v1->vPosition.y); - v17 = v1->vPosition.x; - v58 = v16; - v18 = WorldPosToGridCellX(v17); - _46E26D_collide_against_sprites(v18, v58); + v18 = WorldPosToGridCellX(v1->vPosition.x); + _46E26D_collide_against_sprites(v18, v16); if (PID_TYPE(v1->spell_caster_pid) != OBJECT_Player) _46EF01_collision_chech_player(0); if (PID_TYPE(v1->spell_caster_pid) == OBJECT_Actor) { v19 = PID_ID(v1->spell_caster_pid); - if ( v19 >= 0 ) + if (( v19 >= 0 )&&( v19 < (signed int)(uNumActors - 1) )) { - if ( v19 < (signed int)(uNumActors - 1) ) - { - v56 = 0; - if ( (signed int)uNumActors > 0 ) - { - v60 = pActors.data(); - v20 = &pActors[v19]; - do + + v20 = &pActors[v19]; + for (v56 =0; v56 < uNumActors; ++v56) { - if ( v20->GetActorsRelation(v60) ) + if ( v20->GetActorsRelation(&pActors[v56]) ) _46DF1A_collide_against_actor(v56, 0); - ++v56; - ++v60; + } - while ( v56 < (signed int)uNumActors ); - } - } } } else @@ -458,7 +435,7 @@ &v49, &v50, 0); - if ( v59 && v26 < v27 + 60 ) + if ( on_water && v26 < v27 + 60 ) { if ( v50 ) v44 = v27 + 30; @@ -474,50 +451,55 @@ v1->vPosition.y = stru_721530.normal2.y; v1->vPosition.z = stru_721530.normal2.z - stru_721530.prolly_normal_d - 1; v1->uSectorID = LOWORD(stru_721530.uSectorID); - if ( !(HIBYTE(v2->uFlags) & 1) ) - return; memset(&Dst, 0, 0x68u); - v45 = v2->uFlags; Dst.x = (double)v1->vPosition.x; Dst.y = (double)v1->vPosition.y; Dst.z = (double)v1->vPosition.z; Dst.flt_10 = 0.0; Dst.flt_14 = 0.0; Dst.flt_18 = 0.0; - if ( HIBYTE(v45) & 2 ) + if ( v2->uFlags & OBJECT_DESC_TRIAL_FIRE ) { Dst.type = ParticleType_Bitmap | ParticleType_Rotating | ParticleType_8; Dst.uDiffuse = 0xFF3C1E; - v24 = rand(); - v48 = (TEXTURE_TYPE)0; - goto LABEL_83; + Dst.timeToLive = (unsigned __int8)( rand() & 0x80) + 128; + Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar01", TEXTURE_DEFAULT); + Dst.flt_28 = 1.0; + pGame->pParticleEngine->AddParticle(&Dst); + return; } - if ( HIBYTE(v45) & 4 ) + else if ( v2->uFlags & OBJECT_DESC_TRIAL_LINE ) { Dst.type = ParticleType_Line; - v46 = rand(); Dst.uTextureID = 0; - Dst.uDiffuse = v46; + Dst.uDiffuse = rand(); Dst.timeToLive = 64; - goto LABEL_89; + Dst.flt_28 = 1.0; + pGame->pParticleEngine->AddParticle(&Dst); + return; } - Dst.type = ParticleType_Bitmap | ParticleType_8; - Dst.uDiffuse = rand(); - v24 = rand(); - v48 = (TEXTURE_TYPE)0; - goto LABEL_87; + else if ( v2->uFlags & OBJECT_DESC_TRIAL_PARTICLE) + { + Dst.type = ParticleType_Bitmap | ParticleType_8; + Dst.uDiffuse = rand(); + Dst.timeToLive = (unsigned __int8)(rand() & 0x80) + 128; + Dst.uTextureID = pBitmaps_LOD->LoadTexture("effpar03", TEXTURE_DEFAULT); + Dst.flt_28 = 1.0; + pGame->pParticleEngine->AddParticle(&Dst); + } + return; } - v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16); + v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16); v1->vPosition.x += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.x) >> 16; - v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); + v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16); v1->vPosition.y += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.y) >> 16; - v60 = (Actor *)((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); + v60 = ((unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16); v28 = LOWORD(stru_721530.uSectorID); v1->vPosition.z += (unsigned __int64)(stru_721530.field_7C * (signed __int64)stru_721530.field_58.z) >> 16; v29 = v1->vPosition.z; v1->uSectorID = v28; stru_721530.field_70 += stru_721530.field_7C; - if ( v2->uFlags & 0x40 ) + if ( v2->uFlags & OBJECT_DESC_INTERACTABLE ) { if ( v29 < v54 ) v1->vPosition.z = v54 + 1; @@ -541,8 +523,8 @@ v57 = (unsigned __int64)(v56 * (signed __int64)v57) >> 16; v58 = v32->pFacePlane.vNormal.y; v58 = (unsigned __int64)(v56 * (signed __int64)v58) >> 16; - v60 = (Actor *)v32->pFacePlane.vNormal.z; - v60 = (Actor *)((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16); + v60 = v32->pFacePlane.vNormal.z; + v60 = ((unsigned __int64)(v56 * (signed __int64)(signed int)v60) >> 16); v1->vVelocity.x += 2 * v57; v1->vVelocity.y += 2 * v58; if ( v32->pFacePlane.vNormal.z <= 32000 ) @@ -552,10 +534,9 @@ else { v36 = v60; - v57 = 32000; v1->vVelocity.z += (signed __int16)v60; - v58 = (unsigned __int64)(v57 * (signed __int64)(signed int)v36) >> 16; - v37 = (unsigned int)(v57 * (int)v36) >> 16; + v58 = (unsigned __int64)(32000 * (signed __int64)(signed int)v36) >> 16; + v37 = (unsigned int)(32000 * v36) >> 16; } v1->vVelocity.z += v37; LABEL_70: @@ -574,21 +555,14 @@ goto LABEL_73; } LABEL_74: - v58 = v1->vVelocity.x; - v57 = 58500; - v58 = (unsigned __int64)(58500i64 * v58) >> 16; - v1->vVelocity.x = v58; - v58 = v1->vVelocity.y; - v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16; - v57 = 58500; - v1->vVelocity.y = v58; - v58 = v1->vVelocity.z; - v58 = (unsigned __int64)(v57 * (signed __int64)v58) >> 16; + v1->vVelocity.x = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.x) >> 16); + v1->vVelocity.y = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.y) >> 16); + v1->vVelocity.z = (signed __int16)((unsigned __int64)(58500i64 * (signed __int64)(signed int)v1->vVelocity.z) >> 16); + ++v55; - v43 = __OFSUB__(v55, 100); - v42 = v55 - 100 < 0; - v1->vVelocity.z = v58; - if ( !(v42 ^ v43) ) + //v43 = __OFSUB__(v55, 100); + // v42 = v55 - 100 < 0; + if (v55>=100 )//!(v42 ^ v43) return; } v57 = integer_sqrt(v1->vVelocity.y * v1->vVelocity.y + v1->vVelocity.x * v1->vVelocity.x); @@ -597,12 +571,12 @@ v1->vPosition.y - pLevelDecorations[v30].vPosition.y); v56 = v38; v39 = stru_5C6E00->Cos(v38); - v60 = (Actor *)v39; + // v60 = v39; v40 = v39 * (signed __int64)v57; v58 = v40 >> 16; v1->vVelocity.x = WORD1(v40); v41 = stru_5C6E00->Sin(v56 - stru_5C6E00->uIntegerHalfPi); - v60 = (Actor *)v41; + // v60 = v41; v35 = (unsigned __int64)(v41 * (signed __int64)v57) >> 16; v58 = v35; LABEL_73: diff -r 21a46b38ca24 -r 8a196c858180 SpriteObject.h --- a/SpriteObject.h Sat Jun 15 09:55:07 2013 +0600 +++ b/SpriteObject.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,5 +1,4 @@ #pragma once -#include "VectorTypes.h" #include "Items.h" enum diff -r 21a46b38ca24 -r 8a196c858180 Texture.cpp --- a/Texture.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Texture.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -192,6 +192,8 @@ unsigned int uTextureID_BACKDOLL; // weak unsigned int uTextureID_BACKHAND; // weak +stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; +stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; Texture pTex_F7CE30; diff -r 21a46b38ca24 -r 8a196c858180 Texture.h --- a/Texture.h Sat Jun 15 09:55:07 2013 +0600 +++ b/Texture.h Sat Jun 15 09:55:27 2013 +0600 @@ -125,51 +125,49 @@ - - extern std::array pSavegameThumbnails; -extern std::array pTexture_LloydBeacons; -extern Texture *pTexture_50635C; -extern Texture *pTexture_506368; -extern Texture *pTexture_50636C; -extern Texture *pTexture_506370; -extern Texture *pTexture_506374; -extern Texture *pTexture_506378; -extern Texture *pTexture_50637C; -extern Texture *pTexture_506380; -extern Texture *pTexture_506384; -extern Texture *pTexture_506388; -extern Texture *pTexture_50638C; -extern Texture *pTexture_506390; -extern Texture *pTexture_506394; -extern Texture *pTex_tab_an_7a__zoot_off; -extern Texture *pTex_tab_an_6a__zoom_off; -extern Texture *pTex_tab_an_7b__zoot_on; -extern Texture *pTex_tab_an_6b__zoom_on; -extern std::array pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit +extern std::array pTexture_LloydBeacons; +extern struct Texture *pTexture_50635C; +extern struct Texture *pTexture_506368; +extern struct Texture *pTexture_50636C; +extern struct Texture *pTexture_506370; +extern struct Texture *pTexture_506374; +extern struct Texture *pTexture_506378; +extern struct Texture *pTexture_50637C; +extern struct Texture *pTexture_506380; +extern struct Texture *pTexture_506384; +extern struct Texture *pTexture_506388; +extern struct Texture *pTexture_50638C; +extern struct Texture *pTexture_506390; +extern struct Texture *pTexture_506394; +extern struct Texture *pTex_tab_an_7a__zoot_off; +extern struct Texture *pTex_tab_an_6a__zoom_off; +extern struct Texture *pTex_tab_an_7b__zoot_on; +extern struct Texture *pTex_tab_an_6b__zoom_on; +extern std::array pTexture_TownPortalIcons; // [0]Harmonale, [1]Pierpont, [2]Nighon, [3]Evenmorn Island, [4]Celestia, [5]The Pit -extern std::array dword_5063D8; -extern std::array dword_506408; -extern Texture *pTexture_50643C; // idb -extern Texture *ptr_506440; -extern Texture *pTexture_506444; -extern Texture *pTexture_506448; // idb -extern std::array, 9> pTextures_tabs; -extern Texture *pTexture_mapbordr; // idb -extern Texture *pTexture_pagemask; // idb -extern std::array pSpellBookPagesTextr; -extern Texture *pSpellBookPagesTextr_9; -extern Texture *pSpellBookPagesTextr_10; -extern Texture *pSpellBookPagesTextr_11; -extern Texture *pSpellBookPagesTextr_12; -extern Texture *pSpellBookPagesTextr_13; -extern Texture *pTexture_AutonotesBook; -extern Texture *pTexture_CurrentBook; -extern Texture *pTex_moon_new; -extern Texture *pTex_moon_4; -extern Texture *pTex_moon_2; -extern Texture *pTex_moon_2_2; -extern Texture *pTex_moon_ful; +extern std::array dword_5063D8; +extern std::array dword_506408; +extern struct Texture *pTexture_50643C; // idb +extern struct Texture *ptr_506440; +extern struct Texture *pTexture_506444; +extern struct Texture *pTexture_506448; // idb +extern std::array, 9> pTextures_tabs; +extern struct Texture *pTexture_mapbordr; // idb +extern struct Texture *pTexture_pagemask; // idb +extern std::array pSpellBookPagesTextr; +extern struct Texture *pSpellBookPagesTextr_9; +extern struct Texture *pSpellBookPagesTextr_10; +extern struct Texture *pSpellBookPagesTextr_11; +extern struct Texture *pSpellBookPagesTextr_12; +extern struct Texture *pSpellBookPagesTextr_13; +extern struct Texture *pTexture_AutonotesBook; +extern struct Texture *pTexture_CurrentBook; +extern struct Texture *pTex_moon_new; +extern struct Texture *pTex_moon_4; +extern struct Texture *pTex_moon_2; +extern struct Texture *pTex_moon_2_2; +extern struct Texture *pTex_moon_ful; @@ -211,16 +209,16 @@ extern unsigned int uTextureID_BUTTMAKE; extern unsigned int uTextureID_BUTTYES2; extern unsigned int uTextureID_x_ok_u; -extern std::array pPlayerPortraits; -extern std::array pTexture_IC_KNIGHT; -extern Texture *pTexture_MAKESKY; -extern Texture *pTexture_MAKETOP; -extern std::array pTextures_arrowr; -extern std::array pTextures_arrowl; -extern Texture *pTexture_presleft; -extern Texture *pTexture_pressrigh; -extern Texture *pTexture_buttminu; -extern Texture *pTexture_buttplus; +extern std::array pPlayerPortraits; +extern std::array pTexture_IC_KNIGHT; +extern struct Texture *pTexture_MAKESKY; +extern struct Texture *pTexture_MAKETOP; +extern std::array pTextures_arrowr; +extern std::array pTextures_arrowl; +extern struct Texture *pTexture_presleft; +extern struct Texture *pTexture_pressrigh; +extern struct Texture *pTexture_buttminu; +extern struct Texture *pTexture_buttplus; extern unsigned int uTextureID_Quit1; extern unsigned int uTextureID_Resume1; extern unsigned int uTextureID_Controls1; @@ -269,9 +267,9 @@ extern unsigned int uTextureID_right_panel_loop; // weak -extern Texture *pTexture_Leather; -extern Texture *pTexture_RestUI_CurrentSkyFrame; // idb -extern Texture *pTexture_RestUI_CurrentHourglassFrame; // idb +extern struct Texture *pTexture_Leather; +extern struct Texture *pTexture_RestUI_CurrentSkyFrame; // idb +extern struct Texture *pTexture_RestUI_CurrentHourglassFrame; // idb extern std::array uTextureID_Optkb; @@ -315,12 +313,13 @@ extern unsigned int uTextureID_BACKHAND; // weak -extern Texture pTex_F7CE30; +extern struct Texture pTex_F7CE30; extern RGBTexture stru_5773C4; // idb - +extern struct stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; moved to texture.h +extern struct stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; moved to texture.h @@ -347,15 +346,15 @@ struct stru350 { stru350 *_450DDE(); - bool _450DF1(const stru355 *p1, const stru355 *p2); + bool _450DF1(const struct stru355 *p1, const struct stru355 *p2); unsigned int _450F55(int a2); int _450FB1(int a2); int sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch, unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch, int a9, int a10); - stru355 field_0; - stru355 field_20; + struct stru355 field_0; + struct stru355 field_20; int field_40; int field_44; int field_48; diff -r 21a46b38ca24 -r 8a196c858180 Time.cpp --- a/Time.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Time.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -1,10 +1,9 @@ -#include "OSAPI.h" #include "Time.h" #include "Keyboard.h" #include "Log.h" -#include "mm7_data.h" +#include "OSAPI.h" diff -r 21a46b38ca24 -r 8a196c858180 UICharacter.cpp --- a/UICharacter.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UICharacter.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -15,7 +15,7 @@ #include "GUIProgressBar.h" #include "Party.h" #include "AudioPlayer.h" -#include "Outdoor.h" +#include "Render.h" #include "IndoorCamera.h" #include "LOD.h" #include "Viewport.h" @@ -1728,7 +1728,6 @@ uCellY = 32 * (i / 14) + 17; uCellX = 32 * (i % 14) + 14; - uint item_texture_id = pIcons_LOD->LoadTexture(pItemsTable->pItems[item->uItemID].pIconName, TEXTURE_16BIT_PALETTE); v7 = pIcons_LOD->GetTexture(item_texture_id); @@ -1744,7 +1743,7 @@ v14 = v7->uTextureHeight; if (v14 < 14 ) v14 = 14; - v17 = uCellX + ((v15 - v7->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v7->uTextureHeight + 32) >> 1)]; + v17 = uCellX + ((v15 - v7->uTextureWidth) >> 1) + pSRZBufferLineOffsets[uCellY + (( (int)((v14 - 14) & 0xFFFFFFE0) - v7->uTextureHeight + 32) >> 1)]; //added typecast. without it the value in the brackets got cat to unsigned which messed stuff up if (item->uAttributes & 0xF0) { diff -r 21a46b38ca24 -r 8a196c858180 UIHouses.cpp --- a/UIHouses.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UIHouses.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -2,9 +2,10 @@ #define _CRT_SECURE_NO_WARNINGS #endif +#include "Texture.h" +#include "mm7_data.h" #include "UIHouses.h" #include "Party.h" -#include "Player.h" #include "texts.h" #include "Events.h" #include "Arcomage.h" @@ -14,20 +15,15 @@ #include "GUIFont.h" #include "Events2D.h" #include "Overlays.h" -#include "Render.h" -#include "Indoor.h" #include "Outdoor.h" #include "AudioPlayer.h" #include "VideoPlayer.h" #include "Monsters.h" #include "Viewport.h" #include "Keyboard.h" -#include "NPC.h" #include "IndoorCamera.h" #include "MapInfo.h" #include "Log.h" -#include "MM7.h" -#include "mm7_data.h" #include "Game.h" #include "stru159.h" diff -r 21a46b38ca24 -r 8a196c858180 UIMainMenu.cpp --- a/UIMainMenu.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UIMainMenu.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,48 +4,18 @@ #include -#include "MM7.h" #include "Mouse.h" #include "Keyboard.h" -#include "MapInfo.h" -#include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" -#include "Party.h" #include "AudioPlayer.h" -#include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" +#include "Render.h" #include "LOD.h" -#include "Actor.h" #include "Allocator.h" -#include "Events.h" -#include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" -#include "SpriteObject.h" -#include "ObjectList.h" -#include "Chest.h" #include "PaletteManager.h" -#include "DecorationList.h" -#include "SaveLoad.h" -#include "stru123.h" -#include "Time.h" #include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "mm7_data.h" @@ -343,7 +313,7 @@ pFontQuick->_44D2FD_prolly_draw_credits_entry(pFontCChar, 0, a2.uFrameHeight, (signed __int16)pTexture2.uWidth, (signed __int16)pTexture2.uHeight, pColor1, pColor2, pString, pTexture2.pPixels, (signed __int16)pTexture2.uWidth); free(pString); - pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, (int)ptr); + pWindow_MainMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, ptr); pWindow_MainMenu->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_Escape, 0, 0x1Bu, "", 0); pCurrentScreen = SCREEN_CREATORS; SetCurrentMenuID(MENU_CREDITSPROC); diff -r 21a46b38ca24 -r 8a196c858180 UIOptions.cpp --- a/UIOptions.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UIOptions.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -6,46 +6,13 @@ #include "IndoorCameraD3D.h" #include "CShow.h" #include "GammaControl.h" -#include "stru6.h" -#include "stru9.h" +#include "Render.h" -#include "MapInfo.h" #include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" -#include "Party.h" #include "AudioPlayer.h" -#include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" #include "LOD.h" -#include "Actor.h" -#include "Allocator.h" -#include "Events.h" -#include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" -#include "SpriteObject.h" -#include "ObjectList.h" -#include "Chest.h" -#include "PaletteManager.h" -#include "DecorationList.h" -#include "SaveLoad.h" -#include "stru123.h" -#include "Time.h" -#include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 UIPartyCreation.cpp --- a/UIPartyCreation.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UIPartyCreation.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,59 +4,20 @@ #include -#include "MM7.h" -#include "LightmapBuilder.h" -#include "DecalBuilder.h" -#include "ParticleEngine.h" #include "Mouse.h" #include "Keyboard.h" -#include "IndoorCameraD3D.h" -#include "CShow.h" -#include "GammaControl.h" -#include "stru6.h" -#include "stru9.h" -#include "stru10.h" -#include "stru11.h" -#include "stru12.h" -#include "MapInfo.h" #include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" #include "Party.h" #include "AudioPlayer.h" -#include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" +#include "Render.h" #include "LOD.h" -#include "Actor.h" #include "Allocator.h" -#include "Events.h" -#include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" -#include "SpriteObject.h" -#include "ObjectList.h" -#include "Chest.h" -#include "PaletteManager.h" -#include "DecorationList.h" -#include "SaveLoad.h" -#include "stru123.h" #include "Time.h" #include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 UIPopup.cpp --- a/UIPopup.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UIPopup.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -10,43 +10,19 @@ #include "Sprites.h" #include "Vis.h" -#include "MapInfo.h" #include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" #include "Party.h" #include "AudioPlayer.h" -#include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" #include "LOD.h" #include "Actor.h" -#include "Allocator.h" -#include "Events.h" #include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" #include "SpriteObject.h" #include "ObjectList.h" #include "Chest.h" #include "PaletteManager.h" -#include "DecorationList.h" -#include "SaveLoad.h" -#include "stru123.h" #include "Time.h" -#include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "mm7_data.h" @@ -2184,7 +2160,7 @@ } if ( pWindow.Hint ) { - pHint = pWindow.Hint; + pHint = (char*)pWindow.Hint; pWindow.Hint = 0; pWindow.uFrameWidth = 384; pWindow.uFrameHeight = 256; diff -r 21a46b38ca24 -r 8a196c858180 UIRest.cpp --- a/UIRest.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UIRest.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,46 +4,15 @@ #include -#include "MM7.h" -#include "MapInfo.h" -#include "Game.h" -#include "Player.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" #include "Party.h" #include "AudioPlayer.h" #include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" #include "LOD.h" -#include "Actor.h" -#include "Allocator.h" -#include "Events.h" #include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" -#include "SpriteObject.h" -#include "ObjectList.h" -#include "Chest.h" -#include "PaletteManager.h" -#include "DecorationList.h" -#include "SaveLoad.h" -#include "stru123.h" #include "Time.h" -#include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "mm7_data.h" @@ -223,5 +192,6 @@ Sleep6Hours(); } else - GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]); // "Exit Rest" + GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, + (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]); // "Exit Rest" } \ No newline at end of file diff -r 21a46b38ca24 -r 8a196c858180 UISaveLoad.cpp --- a/UISaveLoad.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UISaveLoad.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -6,46 +6,16 @@ #include #include "MM7.h" -#include "Mouse.h" #include "Keyboard.h" #include "MapInfo.h" -#include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" -#include "Party.h" -#include "AudioPlayer.h" -#include "Outdoor.h" +#include "Render.h" #include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" #include "LOD.h" -#include "Actor.h" #include "Allocator.h" -#include "Events.h" -#include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" -#include "SpriteObject.h" -#include "ObjectList.h" -#include "Chest.h" -#include "PaletteManager.h" -#include "DecorationList.h" #include "SaveLoad.h" -#include "stru123.h" -#include "Time.h" -#include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 UITransition.cpp --- a/UITransition.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UITransition.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -5,52 +5,22 @@ #include #include -#include "Mouse.h" -#include "Keyboard.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "MapInfo.h" -#include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" #include "GUIProgressBar.h" #include "Party.h" #include "AudioPlayer.h" #include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" #include "LOD.h" -#include "Actor.h" -#include "Allocator.h" -#include "Events.h" -#include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" -#include "SpriteObject.h" -#include "ObjectList.h" -#include "Chest.h" -#include "PaletteManager.h" -#include "DecorationList.h" -#include "SaveLoad.h" -#include "stru123.h" #include "Time.h" -#include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" #include "stru159.h" -#include "stru160.h" -#include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" #include "Events2D.h" #include "texts.h" #include "UIHouses.h" -#include "mm7_data.h" - @@ -130,7 +100,7 @@ LABEL_19: strcpy(sHouseName.data(), v21); LABEL_20: - pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, (int)sHouseName.data()); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_Transition, 0, sHouseName.data()); //if ( BYTE1(pAnimatedRooms[p2DEvents_minus1___02[26 * v9]].field_C) ) if ( pAnimatedRooms[p2DEvents[anim_id - 1].uAnimationID].uRoomSoundId ) PlayHouseSound(anim_id, HouseSound_Greeting); @@ -169,7 +139,7 @@ sprintfex(sHouseName.data(), pGlobalTXT_LocalizationStrings[410], pMapStats->pInfos[v1].pName);// "Leave %s" else strcpy(sHouseName.data(), pGlobalTXT_LocalizationStrings[79]);// "Exit" - pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, (int)sHouseName.data()); + pDialogueWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_ChangeLocation, 0, sHouseName.data()); } diff -r 21a46b38ca24 -r 8a196c858180 UiGame.cpp --- a/UiGame.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/UiGame.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,66 +4,36 @@ #include +#include "Texture.h" #include "MM7.h" -#include "BSPModel.h" -#include "LightmapBuilder.h" -#include "DecalBuilder.h" -#include "ParticleEngine.h" #include "Mouse.h" #include "Keyboard.h" -#include "IndoorCameraD3D.h" -#include "CShow.h" -#include "GammaControl.h" -#include "stru6.h" -#include "stru9.h" -#include "stru10.h" -#include "stru11.h" -#include "stru12.h" +#include "mm7_data.h" #include "Vis.h" #include "MapInfo.h" #include "Game.h" #include "GUIWindow.h" #include "GUIFont.h" -#include "GUIProgressBar.h" #include "Party.h" #include "AudioPlayer.h" #include "Outdoor.h" -#include "IndoorCamera.h" -#include "Overlays.h" -#include "Monsters.h" -#include "Arcomage.h" #include "LOD.h" #include "Actor.h" -#include "Allocator.h" -#include "Events.h" #include "Viewport.h" -#include "FrameTableInc.h" -#include "Math.h" #include "SpriteObject.h" #include "ObjectList.h" -#include "Chest.h" -#include "PaletteManager.h" #include "DecorationList.h" #include "PlayerFrameTable.h" -#include "SaveLoad.h" #include "stru123.h" #include "Time.h" #include "IconFrameTable.h" -#include "Awards.h" -#include "Autonotes.h" -#include "stru160.h" #include "TurnEngine.h" -#include "CastSpellInfo.h" -#include "Weather.h" -#include "stru298.h" -#include "StorylineTextTable.h" -#include "Events2D.h" #include "texts.h" #include "UIHouses.h" +#include "BSPModel.h" -#include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 VideoPlayer.cpp --- a/VideoPlayer.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/VideoPlayer.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -2,10 +2,10 @@ #define _CRT_SECURE_NO_WARNINGS #endif -#include "OSAPI.h" #include "Bink_Smacker.h" +#include "mm7_data.h" #include "CShow.h" #include "Mouse.h" @@ -19,10 +19,8 @@ #include "Allocator.h" #include "Time.h" #include "Log.h" +#include "texts.h" #include "UIHouses.h" -#include "texts.h" -#include "MM7.h" -#include "mm7_data.h" VideoPlayer *pVideoPlayer = nullptr; @@ -1173,4 +1171,17 @@ bStopBeforeSchedule = 0; pResetflag = 0; pGame->pCShow->PlayMovie(MOVIE_Death, 1); -} \ No newline at end of file +} + +//----- (004BE6F5) -------------------------------------------------------- +VideoPlayer::VideoPlayer() : + field_54(0), + pBinkMovie(nullptr), pBinkBuffer(nullptr), + pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr) +{ + //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); + bStopBeforeSchedule = false; + pResetflag = 0; + byte_F8BC0C = 0; + //pBinkMovie = nullptr; +} diff -r 21a46b38ca24 -r 8a196c858180 VideoPlayer.h --- a/VideoPlayer.h Sat Jun 15 09:55:07 2013 +0600 +++ b/VideoPlayer.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,8 +1,7 @@ #pragma once #include "OSAPI.h" +#include "Texture.h" -#include "Texture.h" -#include "mm7_data.h" @@ -113,18 +112,7 @@ #pragma pack(push, 1) struct VideoPlayer { - //----- (004BE6F5) -------------------------------------------------------- - inline VideoPlayer(): - field_54(0), - pBinkMovie(nullptr), pBinkBuffer(nullptr), - pSmackerMovie(nullptr), pSmackerBuffer(nullptr), pSmackMovieBlit(nullptr) - { - //RGBTexture::RGBTexture(&pVideoPlayer->pVideoFrame); - bStopBeforeSchedule = false; - pResetflag = 0; - byte_F8BC0C = 0; - //pBinkMovie = nullptr; - } + VideoPlayer(); //----- (004BECBD) -------------------------------------------------------- virtual ~VideoPlayer() { diff -r 21a46b38ca24 -r 8a196c858180 Viewport.cpp --- a/Viewport.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Viewport.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -1,9 +1,7 @@ #include "Viewport.h" #include "Party.h" -#include "VectorTypes.h" #include "Indoor.h" -#include "Render.h" #include "Math.h" #include "mm7_data.h" diff -r 21a46b38ca24 -r 8a196c858180 Vis.cpp --- a/Vis.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Vis.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -1,8 +1,8 @@ #include -#include "BSPModel.h" #include "Vis.h" #include "Outdoor.h" +#include "BSPModel.h" #include "Game.h" #include "Actor.h" #include "IndoorCamera.h" diff -r 21a46b38ca24 -r 8a196c858180 Weather.cpp --- a/Weather.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/Weather.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,7 +4,7 @@ #include "Viewport.h" #include "Render.h" -#include "mm7_data.h" +#include "mm7_data.h" ////TODO: remove this once LOWORD/HIWRD stuff is refactored diff -r 21a46b38ca24 -r 8a196c858180 mm7_1.cpp --- a/mm7_1.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_1.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -40,7 +40,6 @@ #include "TurnEngine.h" #include "texts.h" #include "UIHouses.h" -#include "mm7_data.h" #include "stru367.h" int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); diff -r 21a46b38ca24 -r 8a196c858180 mm7_2.cpp --- a/mm7_2.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_2.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -8,6 +8,8 @@ #include +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Sprites.h" #include "BSPModel.h" @@ -63,8 +65,8 @@ #include "Log.h" #include "UIHouses.h" #include "texts.h" -#include "mm7_data.h" #include "MM7.h" +#include "Lights.h" //----- (004BB756) -------------------------------------------------------- signed int __fastcall sub_4BB756(signed int a1) @@ -5607,43 +5609,46 @@ pIcons_LOD->_4114F2(); } +void set_stru1_field_8_InArcomage(int inValue) +{ + switch(inValue) + { + case 91:LOBYTE(pArcomageGame->stru1.field_8) = 123;break; + case 92:LOBYTE(pArcomageGame->stru1.field_8) = 124;break; + case 93:LOBYTE(pArcomageGame->stru1.field_8) = 125;break; + case 96:LOBYTE(pArcomageGame->stru1.field_8) = 126;break; + case 61:LOBYTE(pArcomageGame->stru1.field_8) = 43;break; + case 55:LOBYTE(pArcomageGame->stru1.field_8) = 38;break; + case 56:LOBYTE(pArcomageGame->stru1.field_8) = 42;break; + case 57:LOBYTE(pArcomageGame->stru1.field_8) = 40;break; + case 59:LOBYTE(pArcomageGame->stru1.field_8) = 58;break; + case 54:LOBYTE(pArcomageGame->stru1.field_8) = 94;break; + case 50:LOBYTE(pArcomageGame->stru1.field_8) = 64;break; + case 51:LOBYTE(pArcomageGame->stru1.field_8) = 35;break; + case 52:LOBYTE(pArcomageGame->stru1.field_8) = 36;break; + case 53:LOBYTE(pArcomageGame->stru1.field_8) = 37;break; + case 49:LOBYTE(pArcomageGame->stru1.field_8) = 33;break; + case 39:LOBYTE(pArcomageGame->stru1.field_8) = 34;break; + case 44:LOBYTE(pArcomageGame->stru1.field_8) = 60;break; + case 46:LOBYTE(pArcomageGame->stru1.field_8) = 62;break; + case 47:LOBYTE(pArcomageGame->stru1.field_8) = 63;break; + case 48:LOBYTE(pArcomageGame->stru1.field_8) = 41;break; + default:LOBYTE(pArcomageGame->stru1.field_8) = inValue;break; + } +} + + //----- (004637EB) -------------------------------------------------------- int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam) { - //unsigned int v4; // esi@1 - Render *v5; // ecx@14 HANDLE v6; // eax@32 - Keyboard *v7; // eax@33 - //HDC v9; // edi@41 HDC v10; // edi@50 int v11; // esi@50 - //char v12; // zf@132 signed int v13; // eax@135 - int v14; // eax@139 - int v15; // eax@140 - int v16; // eax@141 - int v17; // eax@142 - int v18; // eax@150 - int v19; // eax@151 - int v20; // eax@152 - int v21; // eax@161 - int v22; // eax@162 - int v23; // eax@163 - int v24; // eax@170 - int v25; // eax@171 - int v26; // eax@172 - char v27; // al@174 - //bool v28; // ebx@201 char v29; // dl@209 - char v30; // cl@210 bool v31; // ebx@211 - void *v32; // ebx@214 float v33; // ST04_4@246 float v34; // ST04_4@254 - HWND v35; // [sp+8h] [bp-64h]@103 - UINT v36; // [sp+Ch] [bp-60h]@103 - WPARAM v37; // [sp+10h] [bp-5Ch]@103 - LPARAM v38; // [sp+14h] [bp-58h]@103 struct tagPAINTSTRUCT Paint; // [sp+24h] [bp-48h]@13 int pXY[2]; // [sp+64h] [bp-8h]@261 int a2; // [sp+7Ch] [bp+10h]@50 @@ -5881,7 +5886,6 @@ ArcomageGame::OnMouseClick(1, 1); return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_LBUTTONUP: - v32 = 0; if ( !pArcomageGame->bGameInProgress ) //goto LABEL_218; { @@ -5892,7 +5896,6 @@ ArcomageGame::OnMouseClick(0, 0); return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_RBUTTONUP: - v32 = 0; if ( !pArcomageGame->bGameInProgress ) { //LABEL_218: @@ -5901,10 +5904,7 @@ return DefWindowProcA(hWnd, Msg, wParam, lParam); } pArcomageGame->stru1.field_0 = 4; - v29 = 0; - //goto LABEL_262; - v30 = 1; - ArcomageGame::OnMouseClick(v30, v29 != 0); + ArcomageGame::OnMouseClick(1, false); return DefWindowProcA(hWnd, Msg, wParam, lParam); case WM_LBUTTONDBLCLK: @@ -6003,30 +6003,19 @@ { if ( Msg == WM_WINDOWPOSCHANGED ) { - if (pVideoPlayer) - { - if (pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer) - { - BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0); - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - } - //goto _def_wnd_proc; + if (pVideoPlayer && pVideoPlayer->AnyMovieLoaded() && pVideoPlayer->pBinkBuffer) + { + BinkBufferSetOffset(pVideoPlayer->pBinkBuffer, 0, 0); + } return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( Msg != WM_KEYFIRST ) { - if ( Msg == WM_KEYUP ) - { - if ( wParam == VK_CONTROL ) - { - dword_507B98_ctrl_pressed = 0; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - return DefWindowProcA(hWnd, Msg, wParam, lParam); + if ( Msg == WM_KEYUP && wParam == VK_CONTROL ) + { + dword_507B98_ctrl_pressed = 0; + } + return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 ) { @@ -6074,508 +6063,23 @@ if ( pCurrentScreen != SCREEN_GAME && pCurrentScreen != SCREEN_PRESS_ESCAPE_MESSAGE ) return 0; } + pArcomageGame->stru1.field_0 = 1; - if ( (unsigned __int16)GetAsyncKeyState(VK_SHIFT) >> 8 >= 0 ) - v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u); - else - { - v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u); - if ( (signed int)(unsigned __int16)v13 > 54 ) - { - if ( v13 > 61 ) - { - if ( v13 == 91 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 123; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 92 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 124; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 93 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 125; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 96 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 126; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - } - else - { - if ( v13 == 61 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 43; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 55 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 38; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 56 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 42; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 57 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 40; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 59 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 58; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - } - } - else - { - if ( (unsigned __int16)v13 == 54 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 94; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 > 49 ) - { - if ( v13 == 50 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 64; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 51 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 35; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 52 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 36; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 53 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 37; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - } - else - { - if ( v13 == 49 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 33; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 39 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 34; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 44 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 60; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 46 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 62; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 47 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 63; - //goto LABEL_181; - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - if ( v13 == 48 ) - { - LOBYTE(pArcomageGame->stru1.field_8) = 41; -//LABEL_181: - if ( wParam == 27 ) - { - pArcomageGame->GameOver = 1; - pArcomageGame->field_F4 = 1; - pArcomageGame->uGameResult = 2; - pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - if ( wParam != 114 ) - { - if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; - return DefWindowProcA(hWnd, Msg, wParam, lParam); - } - SendMessageA(hWnd, WM_COMMAND, 103, 0); - return 0; - } - } - } - v27 = MapVirtualKeyA((unsigned __int16)wParam, 2u); - } - LOBYTE(pArcomageGame->stru1.field_8) = v27; - //goto LABEL_181; + + v13 = (unsigned __int16)MapVirtualKeyA((unsigned __int16)wParam, 2u); + set_stru1_field_8_InArcomage(v13); if ( wParam == 27 ) { pArcomageGame->GameOver = 1; pArcomageGame->field_F4 = 1; pArcomageGame->uGameResult = 2; pArcomageGame->field_B0 = -2; - //goto _def_wnd_proc; return DefWindowProcA(hWnd, Msg, wParam, lParam); } if ( wParam != 114 ) { if ( wParam == 115 && !pVideoPlayer->AnyMovieLoaded() ) - SendMessageA(hWnd, 0x111u, 0x68u, 0); - //goto _def_wnd_proc; + SendMessageA(hWnd, 0x111u, 0x68u, 0); return DefWindowProcA(hWnd, Msg, wParam, lParam); } SendMessageA(hWnd, WM_COMMAND, 103, 0); @@ -6704,7 +6208,6 @@ if ( pArcomageGame->bGameInProgress ) { pArcomageGame->field_F9 = 1; - v5 = pRenderer; } else { @@ -6714,7 +6217,6 @@ EndPaint(hWnd, &Paint); return 0; } - v5 = pRenderer; } pRenderer->Present(); //LABEL_20: @@ -7760,7 +7262,7 @@ if (!bNoSound) pAudioPlayer->Initialize(hWnd); - pVideoPlayer = new VideoPlayer; + pVideoPlayer = new VideoPlayer(); pVideoPlayer->Initialize(); dword_6BE364_game_settings_1 |= 0x4000; diff -r 21a46b38ca24 -r 8a196c858180 mm7_3.cpp --- a/mm7_3.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_3.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -5,7 +5,8 @@ #include -#include "VideoPlayer.h" +#include "Texture.h" +#include "mm7_data.h" #include "Sprites.h" #include "BSPModel.h" #include "OutdoorCamera.h" @@ -15,7 +16,7 @@ #include "Mouse.h" #include "Keyboard.h" #include "stru6.h" - +#include "FactionTable.h" #include "MapInfo.h" #include "Game.h" #include "GUIWindow.h" @@ -46,9 +47,9 @@ #include "stru298.h" #include "texts.h" #include "Log.h" +#include "Lights.h" #include "MM7.h" -#include "mm7_data.h" //----- (0046E44E) -------------------------------------------------------- int __thiscall _46E44E_collide_against_faces_and_portals(unsigned int b1) @@ -14791,8 +14792,9 @@ if ( target_pid_type == OBJECT_Actor ) { v36 = v75.uDistance; - v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (pActor->pMonsterInfo.uID - 1) / 3] - + (pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3); + //v37 = (unsigned __int8)*(&byte_5C8D1A[89 * (pActor->pMonsterInfo.uID - 1) / 3] + // + (pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3); + v37 =pFactionTable->relations[(pActor->pMonsterInfo.uID-1) / 3 + 1][(pActors[PID_ID(target_pid)].pMonsterInfo.uID - 1) / 3 + 1]; } else { diff -r 21a46b38ca24 -r 8a196c858180 mm7_4.cpp --- a/mm7_4.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_4.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,6 +4,8 @@ #include +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Sprites.h" #include "BSPModel.h" @@ -43,7 +45,7 @@ #include "texts.h" #include "Log.h" #include "UIHouses.h" -#include "mm7_data.h" +#include "Lights.h" //----- (0046CC4B) -------------------------------------------------------- void __cdecl check_event_triggers() @@ -473,30 +475,25 @@ dword_721160[0] = -1; dword_721110[0] = -1; odm_floor_level[0] = GetTerrainHeightsAroundParty2(X, Y, pIsOnWater, bWaterWalk); - if ( (signed int)pOutdoor->uNumBModels <= 0 ) - { - *a6 = 0; - return odm_floor_level[0]; - } - v38 = 0; - for ( pBModelNum = 0; pBModelNum < (signed int)pOutdoor->uNumBModels; ++pBModelNum ) - { - pBModel = &pOutdoor->pBModels[v38]; - if ( X <= pBModel->sMaxX && X >= pBModel->sMinX && Y <= pBModel->sMaxY && Y >= pBModel->sMinY ) - { - if ( (signed int)pBModel->uNumFaces > 0 ) + + for ( pBModelNum = 0; pBModelNum < pOutdoor->uNumBModels; ++pBModelNum ) + { + pBModel = &pOutdoor->pBModels[pBModelNum]; + if ( X <= pBModel->sMaxX && X >= pBModel->sMinX && + Y <= pBModel->sMaxY && Y >= pBModel->sMinY ) + { + if ( pBModel->uNumFaces > 0 ) { v39 = 0; for ( pFaceNum = 0; pFaceNum < pBModel->uNumFaces; ++pFaceNum ) { - pFace = &pBModel->pFaces[v39]; + pFace = &pBModel->pFaces[pFaceNum]; if ( (pFace->uPolygonType == POLYGON_Floor || pFace->uPolygonType == POLYGON_InBetweenFloorAndWall) && !(pFace->uAttributes & 0x20000000) && X <= pFace->pBoundingBox.x2 && X >= pFace->pBoundingBox.x1 && Y <= pFace->pBoundingBox.y2 && Y >= pFace->pBoundingBox.y1 ) { - if ( pFace->uNumVertices ) - { + for ( uint i = 0; i < pFace->uNumVertices; ++i) { word_721040[2 * i] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i]].x; @@ -504,7 +501,6 @@ word_721040[2 * i + 1] = pFace->pXInterceptDisplacements[i] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].x; word_720F70[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pBModel->pVertices.pVertices[pFace->pVertexIDs[i + 1]].y; } - } word_721040[2 * pFace->uNumVertices] = word_721040[0]; word_720F70[2 * pFace->uNumVertices] = word_720F70[0]; v43 = word_720F70[0] >= Y; @@ -553,11 +549,10 @@ } } } - ++v39; + } } } - ++v38; } if ( v46 == 1 ) { @@ -852,10 +847,10 @@ side1_dy = (double)(x1z1_y - x1z2_y); side2_dy = (double)(x2z2_y - x1z2_y); side2_dx = (double)(grid_pos_x2 - grid_pos_x1); - side1_dx = (double)(grid_pos_x1 - grid_pos_x1); - side2_dz = (double)(grid_pos_z2 - grid_pos_z2); // bug? z2 - z2 - side1_dz = (double)(grid_pos_z2 - grid_pos_z2); // z1 - z2 - Log::Warning(L"%S %S %u\n", __FILE__, __FUNCTION__, __LINE__); + side1_dx = (double)(grid_pos_x1 - grid_pos_x2); + side2_dz = 0.0;//(double)(grid_pos_z2 - grid_pos_z2); // bug? z2 - z2 + side1_dz = (double)(grid_pos_z1 - grid_pos_z2); // z1 - z2 yes + //Log::Warning(L"%S %S %u\n", __FILE__, __FUNCTION__, __LINE__); /* |\ side1 | \ |____\ @@ -866,8 +861,8 @@ side1_dy = (double)(x2z2_y - x2z1_y); side2_dy = (double)(x1z1_y - x2z1_y); side2_dx = (double)(grid_pos_x1 - grid_pos_x2); - side1_dx = (double)(grid_pos_x2 - grid_pos_x2); - side2_dz = (double)(grid_pos_z1 - grid_pos_z1); + side1_dx = (double)(grid_pos_x2 - grid_pos_x1); + side2_dz = 0.0;//(double)(grid_pos_z1 - grid_pos_z1); side1_dz = (double)(grid_pos_z2 - grid_pos_z1); /* side 2 diff -r 21a46b38ca24 -r 8a196c858180 mm7_5.cpp --- a/mm7_5.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_5.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -4,6 +4,8 @@ #include +#include "Texture.h" +#include "mm7_data.h" #include "VideoPlayer.h" #include "Sprites.h" #include "MapInfo.h" @@ -15,7 +17,8 @@ #include "Keyboard.h" #include "GammaControl.h" #include "stru11.h" - +#include "mm7_data.h" +#include "FactionTable.h" #include "Vis.h" #include "mm7.h" #include "Game.h" @@ -45,7 +48,8 @@ #include "texts.h" #include "Log.h" #include "UIHouses.h" -#include "mm7_data.h" +#include "Lights.h" +#include "Lights.h" //----- (004304E7) -------------------------------------------------------- void __cdecl GameUI_MsgProc() @@ -724,7 +728,7 @@ } v19 = (double)(signed int)uGammaPos * 0.1 + 0.6; pGame->pGammaController->Initialize(v19); - GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1); + GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); continue; } @@ -735,7 +739,7 @@ { v21 = (double)(signed int)uGammaPos * 0.1 + 0.6; pGame->pGammaController->Initialize(v21); - GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1); + GUIWindow::Create(213, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0); continue; } @@ -764,7 +768,7 @@ --uMusicVolimeMultiplier; if ( (char)uMusicVolimeMultiplier < 1 ) uMusicVolimeMultiplier = 0; - GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1); + GUIWindow::Create(243, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); if ( uMusicVolimeMultiplier ) pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); @@ -775,7 +779,7 @@ ++uMusicVolimeMultiplier; if ( (char)uMusicVolimeMultiplier > 9 ) uMusicVolimeMultiplier = 9; - GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1); + GUIWindow::Create(435, 0xD8u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); if ( uMusicVolimeMultiplier ) pAudioPlayer->PlaySound(SOUND_Bell, -1, 0, -1, 0, 0, pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f, 0); pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[(char)uMusicVolimeMultiplier] * 64.0f); @@ -794,7 +798,7 @@ --uSoundVolumeMultiplier; if ( (char)uSoundVolumeMultiplier < 1 ) uSoundVolumeMultiplier = 0; - GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1); + GUIWindow::Create(243, 162, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); continue; @@ -807,7 +811,7 @@ //v168 = 1; v24 = 435; //v154 = (int)pBtn_SliderRight; - GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1); + GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f); pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0); continue; @@ -836,7 +840,7 @@ --uVoicesVolumeMultiplier; if ( (char)uVoicesVolumeMultiplier < 1 ) uVoicesVolumeMultiplier = 0; - GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, 1); + GUIWindow::Create(243, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1); if ( !uVoicesVolumeMultiplier ) continue; pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); @@ -847,7 +851,7 @@ ++uVoicesVolumeMultiplier; if ( (char)uVoicesVolumeMultiplier > 8 ) uVoicesVolumeMultiplier = 9; - GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, 1); + GUIWindow::Create(435, 270, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1); if ( !uVoicesVolumeMultiplier ) continue; pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0); @@ -1510,7 +1514,7 @@ if ( !pGUIWindow_Settings )//Draw Menu { dword_6BE138 = -1; - GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, 1); + GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, (char *)1); pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); pCurrentScreen = SCREEN_MENU; @@ -1944,7 +1948,7 @@ case UIMSG_OnCastTownPortal: pAudioPlayer->StopChannels(-1, -1); - pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, uMessageParam); + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_Book, WINDOW_TownPortal, (char *)uMessageParam); continue; case UIMSG_OnCastLloydsBeacon: @@ -2132,7 +2136,7 @@ _5B65B8_npcdata_hiword_house_or_other = v66; InitializeActors(); } - v67 = pGUIWindow_CurrentMenu->Hint; + v67 = (char*)pGUIWindow_CurrentMenu->Hint; if ( v67 ) *((int *)v67 + 17) = 1; else @@ -2451,7 +2455,7 @@ _42ECB5_PlayerAttacksActor(); continue; case UIMSG_ExitRest: - GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, (int)pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" + GUIWindow::Create(pButton_RestUI_Exit->uX, pButton_RestUI_Exit->uY, 0, 0, WINDOW_CloseRestWindowBtn, (int)pButton_RestUI_Exit, pGlobalTXT_LocalizationStrings[81]);// "Exit Rest" continue; case UIMSG_Wait5Minutes: if ( dword_506F14 == 2 ) @@ -2461,7 +2465,7 @@ continue; } GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2, - (int)pButton_RestUI_Wait5Minutes, (int)pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" + (int)pButton_RestUI_Wait5Minutes, pGlobalTXT_LocalizationStrings[238]);// "Wait 5 Minutes" dword_506F14 = 1; _506F18_num_hours_to_sleep = 5; continue; @@ -2473,7 +2477,7 @@ continue; } GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2, - (int)pButton_RestUI_Wait1Hour, (int)pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" + (int)pButton_RestUI_Wait1Hour, pGlobalTXT_LocalizationStrings[239]);// "Wait 1 Hour" dword_506F14 = 1; _506F18_num_hours_to_sleep = 60; continue; @@ -2611,7 +2615,7 @@ continue; } GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2, - (int)pButton_RestUI_WaitUntilDawn, (int)pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" + (int)pButton_RestUI_WaitUntilDawn, pGlobalTXT_LocalizationStrings[237]);// "Wait until Dawn" v97 = _494820_training_time(pParty->uCurrentHour); dword_506F14 = 1; _506F18_num_hours_to_sleep = 60 * v97 - pParty->uCurrentMinute; @@ -3007,7 +3011,7 @@ default: continue; } - GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); continue; case UIMSG_SelectCharacter: if ( pMessageQueue_50CBD0->uNumMessages ) @@ -3332,7 +3336,7 @@ } while (player->GetSexByVoice() != pSex); pButton = pCreationUI_BtnPressLeft2[pParam]; - GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); player->PlaySound(SPEECH_PickMe, 0); break; @@ -3344,7 +3348,7 @@ } while (player->GetSexByVoice() != pSex); pButton = pCreationUI_BtnPressRight2[pParam]; - GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, 1); + GUIWindow::Create(pButton->uX, pButton->uY, 0, 0, WINDOW_PressedButton, (int)pButton, (char *)1); pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); player->PlaySound(SPEECH_PickMe, 0); break; @@ -3362,7 +3366,7 @@ pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; uPlayerCreationUI_SelectedCharacter = v25; - GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], 1); + GUIWindow::Create(pCreationUI_BtnPressLeft[v25]->uX, pCreationUI_BtnPressLeft[v25]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressLeft[v25], (char *)1); pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0.0, 0); pPlayer->PlaySound(SPEECH_PickMe, 0); break; @@ -3378,17 +3382,17 @@ pGUIWindow_CurrentMenu->pCurrentPosActiveItem = (pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7 + pGUIWindow_CurrentMenu->pStartingPosActiveItem + 7 * pParam; uPlayerCreationUI_SelectedCharacter = v21; - GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], 1); + GUIWindow::Create(pCreationUI_BtnPressRight[v21]->uX, pCreationUI_BtnPressRight[v21]->uY, 0, 0, WINDOW_PressedButton, (int)pCreationUI_BtnPressRight[v21], (char *)1); pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); pPlayer->PlaySound(SPEECH_PickMe, 0); break; case UIMSG_PlayerCreationClickPlus: - GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, 1); + GUIWindow::Create(613, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnPlus, (char *)1); pPlayer[uPlayerCreationUI_SelectedCharacter].IncreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); pAudioPlayer->PlaySound((SoundID)20, 0, 0, -1, 0, 0, 0, 0); break; case UIMSG_PlayerCreationClickMinus: - GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, 1); + GUIWindow::Create(523, 393, 0, 0, WINDOW_PressedButton2, (int)pPlayerCreationUI_BtnMinus, (char *)1); pPlayer[uPlayerCreationUI_SelectedCharacter].DecreaseAttribute((pGUIWindow_CurrentMenu->pCurrentPosActiveItem - pGUIWindow_CurrentMenu->pStartingPosActiveItem) % 7); pAudioPlayer->PlaySound((SoundID)23, 0, 0, -1, 0, 0, 0, 0); break; @@ -3625,6 +3629,50 @@ this->z = (1.0 / sqrt(this->x * this->x + this->y * this->y + this->z * this->z)) * this->z; } +//----- (00438526) -------------------------------------------------------- +stru11::stru11() +{ + stru11 *v1; // esi@1 + signed int v2; // eax@1 + char *v3; // edx@1 + + v1 = this; + v2 = 0; + this->cpuid_00000000_eax_numops = 0; + this->cpuid_00000001_eax = 0; + this->cpuid_00000001_edx = 0; + this->field_38 = 0; + this->field_3C = 0; + this->cpuid_80000000_edx = 0; + this->cpuid_80000001_eax = 0; + this->cpuid_80000001_edx = 0; + this->cpuid_80000005_ebx = 0; + this->cpuid_80000005_ecx = 0; + this->cpuid_80000005_edx = 0; + this->cpuid_80000006_ecx = 0; + this->field_AC = 0; + this->uProcessorManufacturer = 0; + LOBYTE(this->cpuid_80000002_registers2[0]) = 0; + v3 = (char *)&this->cpuid_00000002_eax; + do + { + if ( v2 < 3 ) + *((int *)v3 - 9) = 0; + if ( v2 < 4 ) + *(int *)v3 = 0; + if ( v2 < 12 ) + *((int *)v3 + 17) = 0; + if ( v2 < 13 ) + this->pCPUString[v2] = 0; + if ( v2 < 30 ) + *((char *)this->field_40 + v2) = 0; + *((char *)&this->cpuid_80000002_registers2[0] + v2++ + 1) = 0; + v3 += 4; + } + while ( v2 < 48 ); + CheckCPU(); +} + //----- (004385B5) -------------------------------------------------------- void stru11::CheckCPU() { @@ -6886,7 +6934,8 @@ v20 = 0; } if (PID_TYPE(v22) == OBJECT_Actor) - v10 = (unsigned __int8)*(&byte_5C8D1A[89 * (pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID - 1) / 3] + (v5->pMonsterInfo.uID - 1) / 3); + //v10 = (unsigned __int8)*(&byte_5C8D1A[89 * (pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID - 1) / 3] + (v5->pMonsterInfo.uID - 1) / 3); + v10 = pFactionTable->relations[(pMonsterStats->pInfos[pActors[PID_ID(v22)].pMonsterInfo.uID].uID) / 3 + 1][(v5->pMonsterInfo.uID - 1) / 3 + 1]; else v10 = 4; if ( v10 == 1 ) @@ -9490,7 +9539,7 @@ { GUIWindow *pWindow; // esi@4 //unsigned int pWindowType; // eax@4 - char *pHint; // edx@66 + const char *pHint; // edx@66 GUIButton *pButtonPtr_1C; // ebp@79 char *pHint1; // edx@80 int v26; // eax@98 diff -r 21a46b38ca24 -r 8a196c858180 mm7_data.cpp --- a/mm7_data.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_data.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -61,8 +61,6 @@ int num_achieved_awards; int num_achieved_awards_2; -#include "stru159.h" - #include "stru160.h" std::array array_4EB8B8 = {{ @@ -486,17 +484,17 @@ std::array pHealthBarPos = {{22, 137, 251, 366}}; std::array pManaBarPos = {{102, 217, 331, 447}}; -std::array _4E2B21_buff_spell_tooltip_colors; -std::array monster_popup_y_offsets = + +std::array monster_popup_y_offsets = {{ - 236, 20, 0, 216, 0, 0, 0, 0, 0, 0, 206, - 20, 0, 246, 246, 236, 10, 246, 0, 0, 0, 236, - 10, 246, 0, 0, 0, 236, 246, 0, 0, 0, 216, - 236, 0, 0, 0, 206, 226, 226, 226, 226, 226, 226, - 0, 0, 0, 0, 0, 0, 236, 236, 236, 20, 20, - 20, 10, 10, 10, 10, 10, 10, 166, 196, 216, 236, - 236, 176, 246, 0, 0, 216, 0, 0, 0, 236, 10, - 0, 0, 0, 0, 0, 0, 196, 0, 0, 0, 0 + -20, 20, 0, -40, 0, 0, 0, 0, 0, 0, -50, + 20, 0, -10, -10, -20, 10, -10, 0, 0, 0, -20, + 10, -10, 0, 0, 0, -20, -10, 0, 0, 0, -40, + -20, 0, 0, 0, -50, -30, -30, -30, -30, -30, -30, + 0, 0, 0, 0, 0, 0, -20, -20, -20, 20, 20, + 20, 10, 10, 10, 10, 10, 10, -90, -60, -40, -20, + -20, -80, -10, 0, 0, -40, 0, 0, 0, -20, 10, + 0, 0, 0, 0, 0, 0, -60, 0, 0, 0, 0 }}; unsigned char hourglass_icon_idx = 12; // weak @@ -572,8 +570,6 @@ int bWinNT4_0; // weak std::array<__int16, 11> word_4E8152 = {0, 0, 0, 90, 8, 2, 70, 20, 10, 50, 30}; -stru355 stru_4E82A4 = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; -stru355 stru_4EFCBC = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; char byte_4E94D0 = 5; // weak char byte_4E94D1 = 9; // weak char _4E94D2_light_type = 6; // weak @@ -892,66 +888,15 @@ std::array ai_near_actors_distances; std::array ai_near_actors_ids; std::array dword_4F8580; // weak -int dword_4FA9B0[777]; // weak -int dword_4FA9B4[777]; // weak -char byte_4FAA00; // weak -std::array<__int16, 12> am_sounds; + + + _UNKNOWN unk_4FAA20; // weak char byte_4FAA24; // weak HWND dword_4FAA28; // idb -char byte_4FAA2E; // weak -int amuint_4FAA34; // weak -int amuint_4FAA38; // weak -int amuint_4FAA4C; // weak - - -int dword_4FAA64; // weak -int dword_4FAA68; // weak - -int dword_4FAA70; // weak -char byte_4FAA74; // weak -char am_byte_4FAA75; // weak -char am_byte_4FAA76; // weak - - -char am_byte_4FAA7C[777]; // weak - -int amuint_4FAA88[777]; // weak -int amuint_4FAA8C[777]; // weak -int amuint_4FAA90[777][2]; - - - -int amuint_4FABC4; // weak - -char byte_4FABD0[777]; // weak -char byte_4FABD1[777]; // weak -_UNKNOWN unk_4FABD4; // weak -int dword_4FABD8[777]; // weak -int dword_4FABDC[777]; // weak -int dword_4FABE0[777]; // weak -int dword_4FABE4[777]; // weak -int dword_4FABE8[777]; // weak -int dword_4FABEC[777]; // weak -int dword_4FABF0[777]; // weak -int dword_4FABF4[777]; // weak -int dword_4FABF8[777]; // weak -int dword_4FABFC[777]; // weak -int dword_4FAC00[777]; // weak -int dword_4FAC04[777]; // weak -int dword_4FAC08[777]; // weak -int dword_4FAC0C[777]; // weak -_UNKNOWN unk_5052C8; // weak - - - - - -char byte_505880; // weak -char byte_505881; // weak int dword_505890; // weak std::array pSRZBufferLineOffsets; @@ -965,8 +910,8 @@ __int64 qword_506350; // weak char byte_506360; // weak int dword_506364; // weak -Texture *dword_506404[12]; // weak -Texture *dword_50640C[12]; // weak +//Texture *dword_506404[12]; // weak +//Texture *dword_50640C[12]; // weak unsigned int uExitCancelTextureId; int dword_50651C; // weak int dword_506528; // weak @@ -1192,7 +1137,7 @@ char *pSkillDescTXT_Raw; struct FactionTable *pFactionTable; -std::array byte_5C8D1A; // weak +//std::array byte_5C8D1A; // weak std::array byte_5E4C15; // weak std::array pSomeItemsNames; diff -r 21a46b38ca24 -r 8a196c858180 mm7_data.h --- a/mm7_data.h Sat Jun 15 09:55:07 2013 +0600 +++ b/mm7_data.h Sat Jun 15 09:55:27 2013 +0600 @@ -3,9 +3,11 @@ #include "VectorTypes.h" #include "OSAPI.h" #include +#include "Items.h" //TODO: remove this once sub_467E7F_EquipBody if moved to a class or something typedef char _UNKNOWN; + typedef unsigned int uint; @@ -430,8 +432,8 @@ //extern int pMagicSkills[9]; extern std::array pHealthBarPos; extern std::array pManaBarPos; -extern std::array _4E2B21_buff_spell_tooltip_colors; -extern std::array monster_popup_y_offsets; // weak +//extern std::array _4E2B21_buff_spell_tooltip_colors; +extern std::array monster_popup_y_offsets; // weak extern unsigned char hourglass_icon_idx; // weak @@ -463,9 +465,8 @@ extern int bWinNT4_0; // weak extern std::array<__int16, 11> word_4E8152; extern std::array< std::array, 7> byte_4E8168; -#include "Texture.h" -extern stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; -extern stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; +//extern stru355 stru_4E82A4;// = {0x20, 0x41, 0, 0x20, 0xFF0000, 0xFF00, 0xFF, 0xFF000000}; moved to texture.h +//extern stru355 stru_4EFCBC;// = {0x20, 0x41, 0, 0x10, 0x7C00, 0x3E0, 0x1F, 0x8000}; moved to texture.h extern char byte_4E94D0; // weak extern char _4E94D2_light_type; // weak extern char byte_4E94D3; // weak @@ -530,61 +531,12 @@ extern std::array dword_4F8580; // weak extern int dword_4FA9B0[]; // weak extern int dword_4FA9B4[]; // weak -extern char byte_4FAA00; // weak -extern std::array<__int16, 12> am_sounds; + extern _UNKNOWN unk_4FAA20; // weak extern char byte_4FAA24; // weak extern HWND dword_4FAA28; // idb -extern char byte_4FAA2E; // weak -extern int amuint_4FAA34; // weak -extern int amuint_4FAA38; // weak -extern int amuint_4FAA4C; // weak - - -extern int dword_4FAA64; // weak -extern int dword_4FAA68; // weak - -extern int dword_4FAA70; // weak -extern char byte_4FAA74; // weak -extern char am_byte_4FAA75; // weak -extern char am_byte_4FAA76; // weak - - -extern char am_byte_4FAA7C[777]; // weak - -extern int amuint_4FAA88[777]; // weak -extern int amuint_4FAA8C[777]; // weak -extern int amuint_4FAA90[777][2]; - - - -extern int amuint_4FABC4; // weak - -extern char byte_4FABD0[]; // weak -extern char byte_4FABD1[]; // weak -extern _UNKNOWN unk_4FABD4; // weak -extern int dword_4FABD8[]; // weak -extern int dword_4FABDC[]; // weak -extern int dword_4FABE0[]; // weak -extern int dword_4FABE4[]; // weak -extern int dword_4FABE8[]; // weak -extern int dword_4FABEC[]; // weak -extern int dword_4FABF0[]; // weak -extern int dword_4FABF4[]; // weak -extern int dword_4FABF8[]; // weak -extern int dword_4FABFC[]; // weak -extern int dword_4FAC00[]; // weak -extern int dword_4FAC04[]; // weak -extern int dword_4FAC08[]; // weak -extern int dword_4FAC0C[]; // weak -extern _UNKNOWN unk_5052C8; // weak - -extern char byte_5054C8[32]; // idb - -extern char byte_505880; // weak -extern char byte_505881; // weak extern int dword_505890; // weak extern std::array pSRZBufferLineOffsets; @@ -598,7 +550,7 @@ extern __int64 qword_506350; // weak extern char byte_506360; // weak extern int dword_506364; // weak -extern Texture *dword_50640C[]; // weak +//extern Texture *dword_50640C[]; // weak extern unsigned int uExitCancelTextureId; extern int dword_50651C; // weak extern int dword_506528; // weak @@ -826,7 +778,7 @@ extern char *pStatsTXT_Raw; extern char *pSkillDescTXT_Raw; extern struct FactionTable *pFactionTable; -extern std::array byte_5C8D1A; // weak +//extern std::array byte_5C8D1A; // weak extern std::array byte_5E4C15; // weak extern std::array pSomeItemsNames; @@ -1157,7 +1109,7 @@ int loc_40E4FC(); // weak void __fastcall ZBuffer_Fill(int *pZBuffer, int uTextureId, int iZValue); -void __fastcall ZBuffer_DoFill(int *pZBuffer, Texture *pTex, int uZValue); +void __fastcall ZBuffer_DoFill(int *pZBuffer, struct Texture *pTex, int uZValue); void __fastcall sub_40F92A(int *pZBuffer, struct Texture *a2, int a3); // idb void __cdecl SetMoonPhaseNames(); signed int __fastcall sub_410D99_get_map_index(int a1); @@ -1392,7 +1344,6 @@ enum MENU_STATE GetCurrentMenuID(); void *__thiscall output_debug_string(void *_this, std::string a2, const char *a3, int a4); std::string *__fastcall _4678E2_make_error_string(std::string *a1, int line, std::string file); -#include "Items.h" void sub_467E7F_EquipBody(ITEM_EQUIP_TYPE uEquipType); // idb void CreateMsgScrollWindow(signed int mscroll_id); void __cdecl free_book_subwindow(); diff -r 21a46b38ca24 -r 8a196c858180 stru11.h --- a/stru11.h Sat Jun 15 09:55:07 2013 +0600 +++ b/stru11.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,54 +1,12 @@ #pragma once -#include "mm7_data.h" /* 128 */ #pragma pack(push, 1) struct stru11 { - //----- (00438526) -------------------------------------------------------- - stru11() - { - stru11 *v1; // esi@1 - signed int v2; // eax@1 - char *v3; // edx@1 - v1 = this; - v2 = 0; - this->cpuid_00000000_eax_numops = 0; - this->cpuid_00000001_eax = 0; - this->cpuid_00000001_edx = 0; - this->field_38 = 0; - this->field_3C = 0; - this->cpuid_80000000_edx = 0; - this->cpuid_80000001_eax = 0; - this->cpuid_80000001_edx = 0; - this->cpuid_80000005_ebx = 0; - this->cpuid_80000005_ecx = 0; - this->cpuid_80000005_edx = 0; - this->cpuid_80000006_ecx = 0; - this->field_AC = 0; - this->uProcessorManufacturer = 0; - LOBYTE(this->cpuid_80000002_registers2[0]) = 0; - v3 = (char *)&this->cpuid_00000002_eax; - do - { - if ( v2 < 3 ) - *((int *)v3 - 9) = 0; - if ( v2 < 4 ) - *(int *)v3 = 0; - if ( v2 < 12 ) - *((int *)v3 + 17) = 0; - if ( v2 < 13 ) - this->pCPUString[v2] = 0; - if ( v2 < 30 ) - *((char *)this->field_40 + v2) = 0; - *((char *)&this->cpuid_80000002_registers2[0] + v2++ + 1) = 0; - v3 += 4; - } - while ( v2 < 48 ); - CheckCPU(); - } + stru11(); void CheckCPU(); void RunCPUID(); diff -r 21a46b38ca24 -r 8a196c858180 stru298.h --- a/stru298.h Sat Jun 15 09:55:07 2013 +0600 +++ b/stru298.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,5 +1,4 @@ #pragma once -#include "VectorTypes.h" /* 303 */ #pragma pack(push, 1) diff -r 21a46b38ca24 -r 8a196c858180 stru6.cpp --- a/stru6.cpp Sat Jun 15 09:55:07 2013 +0600 +++ b/stru6.cpp Sat Jun 15 09:55:27 2013 +0600 @@ -20,6 +20,7 @@ #include "Overlays.h" #include "stru160.h" #include "Math.h" +#include "Lights.h" #include "MM7.h" diff -r 21a46b38ca24 -r 8a196c858180 stru6.h --- a/stru6.h Sat Jun 15 09:55:07 2013 +0600 +++ b/stru6.h Sat Jun 15 09:55:27 2013 +0600 @@ -1,5 +1,4 @@ #pragma once -#include "Render.h" /* 120 */