# HG changeset patch # User Gloval # Date 1369247191 -14400 # Node ID ff2d888f8033fc6c439cf9061d2caeaeef247af8 # Parent 7f8be9f9769e1c5f99fa5275030a0da71a04f18c# Parent 306ec23b37df217ba294891f24fd490c399194dc Merge diff -r 7f8be9f9769e -r ff2d888f8033 Bink_Smacker.h --- a/Bink_Smacker.h Wed May 22 22:25:44 2013 +0400 +++ b/Bink_Smacker.h Wed May 22 22:26:31 2013 +0400 @@ -144,6 +144,13 @@ HDC lastdc; }; +#define SMACKBUFFER555 0x80000000 +#define SMACKBUFFER565 0xC0000000 + +#define SMACKBLIT1X 1 +#define SMACKBLIT2X 2 +#define SMACKBLIT2XSMOOTHING 4 +#define SMACKBLIT2XINTERLACE 8 int __stdcall SmackSoundUseMSS(HDIGDRIVER hDrv); diff -r 7f8be9f9769e -r ff2d888f8033 CShow.cpp --- a/CShow.cpp Wed May 22 22:25:44 2013 +0400 +++ b/CShow.cpp Wed May 22 22:26:31 2013 +0400 @@ -1,80 +1,34 @@ +#include + #include "CShow.h" #include "VideoPlayer.h" #include "Mouse.h" -void CShow::PlayMovie( MovieType eVideo, bool bShowMouseAfterPlayback ) +void CShow::PlayMovie(MovieType eVideo, bool bShowMouseAfterPlayback) { - int v3; // edx@5 - const char *Name; // ecx@5 - //std::string v5; // [sp-18h] [bp-24h]@4 - //signed int v6; // [sp-Ch] [bp-18h]@10 - int ScreenSizeFlag; // [sp-8h] [bp-14h]@4 - //int v8; // [sp-4h] [bp-10h]@4 - //char v9; // [sp+0h] [bp-Ch]@14 - //char v10; // [sp+4h] [bp-8h]@4 - //int a3; // [sp+Bh] [bp-1h]@14 + if (bNoVideo) return; + + if (pAsyncMouse) + pAsyncMouse->Suspend(); - if (bNoVideo) - return; + switch (eVideo) + { + case MOVIE_3DOLogo: VideoPlayer::MovieLoop("3dologo", 0, 0, 1); break; + case MOVIE_NWCLogo: VideoPlayer::MovieLoop("new world logo", 0, 1, 1); break; + case MOVIE_JVC: VideoPlayer::MovieLoop("jvc", 0, 1, 1); break; + case MOVIE_Intro: VideoPlayer::MovieLoop("Intro", 0, 1, 1); break; + case MOVIE_Emerald: VideoPlayer::MovieLoop("Intro Post", 0, 1, 1); break; + case MOVIE_Death: VideoPlayer::MovieLoop("losegame", 2, 1, 1); break; + case MOVIE_Outro: VideoPlayer::MovieLoop("end_seq1", 20, 1, 1); break; + default: + assert(false && "Invalid movie requested in " __FUNCTION__); + break; + } + + if (bShowMouseAfterPlayback) if (pAsyncMouse) - pAsyncMouse->Suspend(); - switch ( eVideo ) - { - case MOVIE_Invalid: - MessageBoxW(nullptr, L"No movie", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Show.cpp:40", 0); - break; - case MOVIE_3DOLogo: - ScreenSizeFlag = 0; - v3 = 0; - Name = "3dologo"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - case MOVIE_NWCLogo: - ScreenSizeFlag = 1; - v3 = 0; - Name = "new world logo"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - case MOVIE_JVC: - ScreenSizeFlag = 1; - v3 = 0; - Name = "jvc"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - case MOVIE_Intro: - ScreenSizeFlag = 1; - v3 = 0; - Name = "Intro"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - case MOVIE_Emerald: - ScreenSizeFlag = 1; - v3 = 0; - Name = "Intro Post"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - case MOVIE_Death: - ScreenSizeFlag = 1; - v3 = 2; - Name = "losegame"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - case MOVIE_Outro: - ScreenSizeFlag = 1; - v3 = 20; - Name = "end_seq1"; - VideoPlayer::MovieLoop(Name, v3, ScreenSizeFlag, 1); - break; - default: - MessageBoxW(nullptr, L"Invalid movie requested in CShow::Run()", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Show.cpp:72", 0); - break; - } - if ( bShowMouseAfterPlayback ) - { - if (pAsyncMouse) - pAsyncMouse->Resume(); - } + pAsyncMouse->Resume(); } diff -r 7f8be9f9769e -r ff2d888f8033 GUIWindow.cpp --- a/GUIWindow.cpp Wed May 22 22:25:44 2013 +0400 +++ b/GUIWindow.cpp Wed May 22 22:26:31 2013 +0400 @@ -99,7 +99,6 @@ for ( i = uNumVisibleWindows; i >= 0; --i ) { result = 84 * pVisibleWindowsIdxs[i]; - //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) j->field_28 = 0; } @@ -107,7 +106,6 @@ for ( k = uNumVisibleWindows; k >= 0; --k ) { result = 84 * pVisibleWindowsIdxs[k]; - //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) { LOBYTE(result) = v10; diff -r 7f8be9f9769e -r ff2d888f8033 Game.cpp --- a/Game.cpp Wed May 22 22:25:44 2013 +0400 +++ b/Game.cpp Wed May 22 22:26:31 2013 +0400 @@ -373,11 +373,6 @@ pEventTimer->Update(); pMiscTimer->Update(); - static int gtc_old = GetTickCount(); - int gtc = GetTickCount(); - Log::Warning(L"Evt/Msc/GTC dt: %u/%u/%u", pEventTimer->uTimeElapsed, pMiscTimer->uTimeElapsed, gtc - gtc_old); - gtc_old = gtc; - OnTimer(0); GameUI_StatusBar_UpdateTimedString(0); if ( pMiscTimer->bPaused && !pEventTimer->bPaused ) diff -r 7f8be9f9769e -r ff2d888f8033 Party.cpp --- a/Party.cpp Wed May 22 22:25:44 2013 +0400 +++ b/Party.cpp Wed May 22 22:26:31 2013 +0400 @@ -28,6 +28,26 @@ + + +//----- (0044A56A) -------------------------------------------------------- +void Party::CountHirelings() +{ + field_70A = 0; + + for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) + { + auto npc = pNPCStats->pNewNPCData + i; + if (npc->Hired() && + (!pHirelings[0].pName || strcmp(npc->pName, pHirelings[0].pName))) + { + if (!pHirelings[1].pName || strcmp(npc->pName, pHirelings[1].pName)) + ++field_70A; + } + } +} + + // inlined //----- (mm6c::004858D0) -------------------------------------------------- void Party::Zero() @@ -786,17 +806,17 @@ pPartyBuffs[i].Reset(); - pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; + pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 100; // default character ui - stats uFlags = 0; memset(_autonote_bits, 0, 12); memset(_quest_bits, 0, 64); memset(pIsArtifactFound, 0, 29); - _449B7E_toggle_bit(_quest_bits, 1, 1); - _449B7E_toggle_bit(_quest_bits, 2, 1); - _449B7E_toggle_bit(_quest_bits, 3, 1); - _449B7E_toggle_bit(_quest_bits, 4, 1); - _449B7E_toggle_bit(_quest_bits, 5, 1); - _449B7E_toggle_bit(_quest_bits, 6, 1); + _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_RED_POTION_ACTIVE, 1); + _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_SEASHELL_ACTIVE, 1); + _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LONGBOW_ACTIVE, 1); + _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_PLATE_ACTIVE, 1); + _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_LUTE_ACTIVE, 1); + _449B7E_toggle_bit(_quest_bits, PARTY_QUEST_EMERALD_HAT_ACTIVE, 1); memset(field_3C._shop_ban_times,0,53*sizeof(__int64)); @@ -828,7 +848,7 @@ v0 = pActors;//[0].pMonsterInfo.uMovementType; do { - if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != 4 && v0->pMonsterInfo.uMovementType != 5 ) + if ( v0->Actor::CanAct() && v0->pMonsterInfo.uHostilityType != MonsterInfo::Hostility_Long && v0->pMonsterInfo.uMovementType != 5 ) { v1 = abs(v0->vPosition.x - pParty->vPosition.x); v2 = abs(v0->vPosition.y - pParty->vPosition.y); @@ -1015,8 +1035,8 @@ memset(hireling, 0, sizeof(*hireling)); pParty->field_709 = 0; - Party__CountHirelings(); - viewparams->bRedrawGameUI = 1; + pParty->CountHirelings(); + viewparams->bRedrawGameUI = true; } } } diff -r 7f8be9f9769e -r ff2d888f8033 Party.h --- a/Party.h Wed May 22 22:25:44 2013 +0400 +++ b/Party.h Wed May 22 22:26:31 2013 +0400 @@ -10,6 +10,13 @@ enum PARTY_QUEST_BITS: unsigned __int32 { + PARTY_QUEST_EMERALD_RED_POTION_ACTIVE = 1, + PARTY_QUEST_EMERALD_SEASHELL_ACTIVE = 2, + PARTY_QUEST_EMERALD_LONGBOW_ACTIVE = 3, + PARTY_QUEST_EMERALD_PLATE_ACTIVE = 4, + PARTY_QUEST_EMERALD_LUTE_ACTIVE = 5, + PARTY_QUEST_EMERALD_HAT_ACTIVE = 6, + PARTY_QUEST_EVENMORN_MAP_FOUND = 64, PARTY_QUEST_FINISHED_EMERALD_ISLE = 136, PARTY_QUEST_FOUNTAIN_HARMONDALE = 206, @@ -163,6 +170,7 @@ bool _497FC5_check_party_perception_against_level(); bool AddItem(ItemGen *pItem); void Yell(); + void CountHirelings(); static void SetGold(unsigned int uNumGold); static void TakeGold(unsigned int uNumGold); diff -r 7f8be9f9769e -r ff2d888f8033 Player.cpp --- a/Player.cpp Wed May 22 22:25:44 2013 +0400 +++ b/Player.cpp Wed May 22 22:26:31 2013 +0400 @@ -8003,8 +8003,8 @@ case VAR_NPCs2: pParty->field_709 = 0; LOBYTE(pNPCStats->pNewNPCData[var_value].uFlags) |= 0x80u; - Party__CountHirelings(); - viewparams->bRedrawGameUI = 1; + pParty->CountHirelings(); + viewparams->bRedrawGameUI = true; break; case VAR_NumSkillPoints: this->uSkillPoints = var_value; @@ -8959,8 +8959,8 @@ case VAR_NPCs2: pParty->field_709 = 0; LOBYTE(pNPCStats->pNewNPCData[val].uFlags) |= 0x80u; - Party__CountHirelings(); - viewparams->bRedrawGameUI = 1; + pParty->CountHirelings(); + viewparams->bRedrawGameUI = true; break; case VAR_NumSkillPoints: Dst->uSkillPoints += val; @@ -9075,8 +9075,8 @@ { pParty->field_709 = 0; LOBYTE(pNPCStats->pNewNPCData[(int)pValue].uFlags) &= 0x7Fu; - Party__CountHirelings(); - viewparams->bRedrawGameUI = 1; + pParty->CountHirelings(); + viewparams->bRedrawGameUI = true; } break; case 241: @@ -9102,7 +9102,7 @@ if ( pParty->pHirelings[1].uProfession == pValue ) memset(&pParty->pHirelings[1], 0, 0x4Cu); pParty->field_709 = 0; - Party__CountHirelings(); + pParty->CountHirelings(); break; case 243: v17 = (char *)&this->uSkillPoints; diff -r 7f8be9f9769e -r ff2d888f8033 VideoPlayer.cpp --- a/VideoPlayer.cpp Wed May 22 22:25:44 2013 +0400 +++ b/VideoPlayer.cpp Wed May 22 22:26:31 2013 +0400 @@ -453,14 +453,14 @@ if ( a2.dwRBitMask == 0xF800 ) { if ( a2.dwGBitMask == 0x7E0 && a2.dwBBitMask == 0x1F ) - return 0xC0000000u; + return SMACKBUFFER565; } else { if ( a2.dwRBitMask == 0x7C00 && a2.dwGBitMask == 0x3E0 && a2.dwBBitMask == 0x1F ) - return 0x80000000u; + return SMACKBUFFER555; } MessageBoxA(0, "Unsupported pixel format.", "Smacker Error", 0); } @@ -816,12 +816,7 @@ Unload(); } } -// 4D83D8: using guessed type int __stdcall SmackBlitSetPalette(int, int, int); -// 4D83DC: using guessed type int __stdcall SmackBlitClear(int, int, int, int, int, int, int, int); -// 4D83E0: using guessed type int __stdcall SmackToBufferRect(int, int); -// 4D83E4: using guessed type int __stdcall SmackDoFrame(int); -// 4D83E8: using guessed type int __stdcall SmackNextFrame(int); -// 4D8404: using guessed type int __stdcall SmackBlit(int, int, int, int, int, int, int, int, int, int, int); + //----- (004BF08B) -------------------------------------------------------- void VideoPlayer::SmackUpdatePalette(HWND hWnd) @@ -1068,23 +1063,18 @@ return; } SmackToBuffer(pVideoPlayer->pSmackerMovie, 0, 0, pVideoPlayer->pSmackerMovie->Width, pVideoPlayer->pSmackerMovie->Height, v9, 0); + + v10 = SmackCheckSurfaceFromat(); if ( a4 ) { - if ( (unsigned int)uCPUSpeed < 165 ) - { - Log::Warning(L"Smacker seems to use lower resolution because it thinks CPU is slow"); - v10 = SmackCheckSurfaceFromat() | 2; - } + v10 |= SMACKBLIT2X; + + if (uCPUSpeed >= 165 ) + v10 |= SMACKBLIT2XSMOOTHING; else - { - v10 = SmackCheckSurfaceFromat(); - LOBYTE(v10) = v10 | 6; - } + Log::Warning(L"Smacker seems to use lower resolution because it thinks CPU is slow"); } - else - { - v10 = SmackCheckSurfaceFromat(); - } + v11 = SmackBlitOpen(v10); pVideoPlayer->pSmackMovieBlit = v11; if ( !v11 ) diff -r 7f8be9f9769e -r ff2d888f8033 Vis.cpp --- a/Vis.cpp Wed May 22 22:25:44 2013 +0400 +++ b/Vis.cpp Wed May 22 22:26:31 2013 +0400 @@ -761,101 +761,55 @@ //----- (004C1EE5) -------------------------------------------------------- bool Vis::_4C1EE5_BLV_IntersectBModel_2(int *a1, int *a2, __int16 *a3, __int16 *a4, Vec3_short_ *a5, BLVFace *pFace) { - bool result; // eax@1 - unsigned int v8; // ecx@1 - Vec3_short_ *v9; // ecx@2 - __int16 *v10; // edx@3 - signed int v11; // ecx@4 - char v12; // zf@6 - Vec3_short_ *v13; // ecx@6 - int v14; // edx@7 - __int16 *v15; // edx@8 - signed int v16; // ecx@9 - int v17; // edx@11 - __int16 *v18; // edx@12 - signed int v19; // ecx@13 - signed int a5a; // [sp+24h] [bp+18h]@2 - signed int a5b; // [sp+24h] [bp+18h]@7 - signed int a5c; // [sp+24h] [bp+18h]@11 + if (pFace->uAttributes & FACE_XY_PLANE) + { + *a1 = a5->x; + *a2 = a5->y; + + for (uint i = 0; i < pFace->uNumVertices; ++i) + { + a3[2 * i] = pFace->pXInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].x; + a3[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].x; + + a4[2 * i] = pFace->pYInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].y; + a4[2 * i + 1] = pFace->pYInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].y; + } + } + else if (pFace->uAttributes & FACE_XZ_PLANE) + { + *a1 = a5->x; + *a2 = a5->z; - result = (bool)pFace; - v8 = pFace->uAttributes; - if ( BYTE1(v8) & 1 ) - { - v9 = a5; - a5a = 0; - *a1 = v9->x; - *a2 = v9->y; - if ( pFace->uNumVertices ) + for (uint i = 0; i < pFace->uNumVertices; ++i) { - v10 = a4 + 1; - do - { - v11 = a5a; - a3[2 * a5a] = pFace->pXInterceptDisplacements[a5a] + pIndoor->pVertices[pFace->pVertexIDs[a5a]].x; - *(v10 - 1) = pFace->pYInterceptDisplacements[v11] + pIndoor->pVertices[pFace->pVertexIDs[v11]].y; - *(__int16 *)((char *)v10 + (int)a3 - (int)a4) = pFace->pXInterceptDisplacements[v11 + 1] - + pIndoor->pVertices[pFace->pVertexIDs[v11 + 1]].x; - ++a5a; - *v10 = pFace->pYInterceptDisplacements[v11 + 1] + pIndoor->pVertices[pFace->pVertexIDs[v11 + 1]].y; - v10 += 2; - } - while ( a5a < pFace->uNumVertices ); + a3[2 * i] = pFace->pXInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].x; + a3[2 * i + 1] = pFace->pXInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].x; + + a4[2 * i] = pFace->pZInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].z; + a4[2 * i + 1] = pFace->pZInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].z; + } + } + else if (pFace->uAttributes & FACE_YZ_PLANE) + { + *a1 = a5->y; + *a2 = a5->z; + + for (uint i = 0; i < pFace->uNumVertices; ++i) + { + a3[2 * i] = pFace->pYInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].y; + a3[2 * i + 1] = pFace->pYInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].y; + + a4[2 * i] = pFace->pZInterceptDisplacements[i] + pIndoor->pVertices[pFace->pVertexIDs[i]].z; + a4[2 * i + 1] = pFace->pZInterceptDisplacements[i + 1] + pIndoor->pVertices[pFace->pVertexIDs[i + 1]].z; } } else { - v12 = (BYTE1(v8) & 2) == 0; - v13 = a5; - if ( v12 ) - { - v17 = a5->y; - a5c = 0; - *a1 = v17; - *a2 = v13->z; - if ( pFace->uNumVertices ) - { - v18 = a4 + 1; - do - { - v19 = a5c; - a3[2 * a5c] = pFace->pYInterceptDisplacements[a5c] + pIndoor->pVertices[pFace->pVertexIDs[a5c]].y; - *(v18 - 1) = pFace->pZInterceptDisplacements[v19] + pIndoor->pVertices[pFace->pVertexIDs[v19]].z; - *(__int16 *)((char *)v18 + (int)(char *)a3 - (char *)a4) = pFace->pYInterceptDisplacements[v19 + 1] - + pIndoor->pVertices[pFace->pVertexIDs[v19 + 1]].y; - ++a5c; - *v18 = pFace->pZInterceptDisplacements[v19 + 1] + pIndoor->pVertices[pFace->pVertexIDs[v19 + 1]].z; - v18 += 2; - } - while ( a5c < pFace->uNumVertices ); - } - } - else - { - v14 = a5->x; - a5b = 0; - *a1 = v14; - *a2 = v13->z; - if ( pFace->uNumVertices ) - { - v15 = a4 + 1; - do - { - v16 = a5b; - a3[2 * a5b] = pFace->pXInterceptDisplacements[a5b] + pIndoor->pVertices[pFace->pVertexIDs[a5b]].x; - *(v15 - 1) = pFace->pZInterceptDisplacements[v16] + pIndoor->pVertices[pFace->pVertexIDs[v16]].z; - *(__int16 *)((char *)v15 + (int)a3 - (int)a4) = pFace->pXInterceptDisplacements[v16 + 1] - + pIndoor->pVertices[pFace->pVertexIDs[v16 + 1]].x; - ++a5b; - *v15 = pFace->pZInterceptDisplacements[v16 + 1] + pIndoor->pVertices[pFace->pVertexIDs[v16 + 1]].z; - v15 += 2; - } - while ( a5b < pFace->uNumVertices ); - } - } + assert(false); + return false; } - LOBYTE(result) = 1; - return result; + + return true; } //----- (004C2186) -------------------------------------------------------- diff -r 7f8be9f9769e -r ff2d888f8033 mm7_3.cpp --- a/mm7_3.cpp Wed May 22 22:25:44 2013 +0400 +++ b/mm7_3.cpp Wed May 22 22:26:31 2013 +0400 @@ -13756,13 +13756,8 @@ _5B65A8_npcdata_uflags_or_other = 0; } } -// 5B65A8: using guessed type int _5B65A8_npcdata_uflags_or_other; -// 5B65AC: using guessed type int _5B65AC_npcdata_fame_or_other; -// 5B65B0: using guessed type int _5B65B0_npcdata_rep_or_other; -// 5B65B4: using guessed type int _5B65B4_npcdata_loword_house_or_other; -// 5B65B8: using guessed type int _5B65B8_npcdata_hiword_house_or_other; -// 5B65BC: using guessed type int dword_5B65BC; -// 5B65C0: using guessed type int dword_5B65C0; + + //----- (00449A49) -------------------------------------------------------- __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2) @@ -13859,7 +13854,7 @@ //----- (00449B57) -------------------------------------------------------- bool _449B57_test_bit( unsigned __int8 *a1, __int16 a2 ) - { +{ return a1[(a2 - 1) >> 3] & (0x80u >> (a2 - 1) % 8); } @@ -13877,23 +13872,6 @@ pArray[v3 / 8] &= ~set_bit; } -//----- (0044A56A) -------------------------------------------------------- -void __cdecl Party__CountHirelings() -{ - pParty->field_70A = 0; - - for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) - { - auto npc = pNPCStats->pNewNPCData + i; - if (npc->Hired() && - (!pParty->pHirelings[0].pName || strcmp(npc->pName, pParty->pHirelings[0].pName))) - { - if (!pParty->pHirelings[1].pName || strcmp(npc->pName, pParty->pHirelings[1].pName)) - ++pParty->field_70A; - } - } -} - //----- (0044C175) -------------------------------------------------------- void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds) { @@ -13910,7 +13888,7 @@ } //----- (0044C1D0) -------------------------------------------------------- -void __cdecl ShowNothingHereStatus() +void ShowNothingHereStatus() { if ( !GameUI_Footer_TimeLeft ) ShowStatusBarString(pGlobalTXT_LocalizationStrings[521], 2u);// Nothing here @@ -13948,20 +13926,27 @@ //----- (0044C2F4) -------------------------------------------------------- int LevelDecoration::IsInteractive() { - signed int v1; // eax@1 - - v1 = this->uDecorationDescID; - if ( v1 > 34 ) - { - if ( v1 == 184 || v1 == 187 || v1 == 190 || v1 > 205 && v1 <= 221 ) - return 1; - } - else - { - if ( v1 == 34 || v1 >= 4 && (v1 <= 6 || v1 == 11 || v1 > 12 && (v1 <= 14 || v1 == 24)) ) - return 1; - } - return 0; + switch (uDecorationDescID) + { + case 4: // trash pile + case 5: // campfire + case 6: // cauldron + case 11: // fruit plate + case 13: // trash pile + case 14: // dirt + case 24: // keg + case 184: // fire + case 187: // fire + case 190: // fire + return true; + } + + if (uDecorationDescID >= 206 && uDecorationDescID <= 209) // lighthouse fire + return true; + if (uDecorationDescID >= 210 && uDecorationDescID <= 221) // magic pedistal + return true; + + return false; } //----- (0044C362) -------------------------------------------------------- @@ -13982,6 +13967,7 @@ float v13; // ST14_4@1 double v14; // ST0C_8@1 + assert(false); //v1 = this; v2 = (double)this->x * 0.000015258789; v3 = v2; diff -r 7f8be9f9769e -r ff2d888f8033 mm7_4.cpp --- a/mm7_4.cpp Wed May 22 22:25:44 2013 +0400 +++ b/mm7_4.cpp Wed May 22 22:26:31 2013 +0400 @@ -6680,7 +6680,7 @@ //LOBYTE(v2->uFlags) |= 0x80u; pCurrentNPCInfo->uFlags |= 128; pParty->field_709 = 0; - Party__CountHirelings(); + pParty->CountHirelings(); if ( pParty->pHirelings[0].pName ) { memcpy(&pParty->pHirelings[1], pCurrentNPCInfo, sizeof(pParty->pHirelings[1])); @@ -6695,7 +6695,7 @@ } strcpy(v22, v24); pParty->field_709 = 0; - Party__CountHirelings(); + pParty->CountHirelings(); PrepareHouse((HOUSE_ID)(int)window_SpeakInHouse->ptr_1C); dialog_menu_id = HOUSE_DIALOGUE_MAIN; @@ -7979,7 +7979,7 @@ memset(v11, 0, sizeof(NPCData)); } pParty->field_709 = 0; - Party__CountHirelings(); + pParty->CountHirelings(); dword_591084 = 0; pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); dword_7241C8 = 0; @@ -8027,7 +8027,7 @@ } strcpy(v13, v15); pParty->field_709 = 0; - Party__CountHirelings(); + pParty->CountHirelings(); pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); @@ -8090,7 +8090,7 @@ memset(v11, 0, sizeof(NPCData)); } pParty->field_709 = 0; - Party__CountHirelings(); + pParty->CountHirelings(); dword_591084 = 0; pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); dword_7241C8 = 0; diff -r 7f8be9f9769e -r ff2d888f8033 mm7_5.cpp --- a/mm7_5.cpp Wed May 22 22:25:44 2013 +0400 +++ b/mm7_5.cpp Wed May 22 22:26:31 2013 +0400 @@ -1344,7 +1344,7 @@ pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; pIcons_LOD->_4355F7(); continue; case SCREEN_INPUT_BLV://click escape @@ -1355,34 +1355,34 @@ { pParty->field_709 = 0; LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; - Party__CountHirelings(); - viewparams->bRedrawGameUI = 1; + pParty->CountHirelings(); + viewparams->bRedrawGameUI = true; dword_5B65CC = 0; } DialogueEnding(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; continue; case SCREEN_NPC_DIALOGUE://click escape if ( dword_5B65CC ) { pParty->field_709 = 0; LOBYTE(pNPCStats->pNewNPCData[dword_5B65CC].uFlags) &= 0x7Fu; - Party__CountHirelings(); - viewparams->bRedrawGameUI = 1; + pParty->CountHirelings(); + viewparams->bRedrawGameUI = true; dword_5B65CC = 0; } //goto LABEL_317; DialogueEnding(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; continue; case SCREEN_BRANCHLESS_NPC_DIALOG://click escape memset(GameUI_Footer_TimedString, 0, 0xC8u); sub_4452BB(); DialogueEnding(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; continue; case SCREEN_CHANGE_LOCATION://click escape if ( pParty->vPosition.x < -22528 ) @@ -1395,7 +1395,7 @@ pParty->vPosition.y = 22528; DialogueEnding(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; continue; case SCREEN_VIDEO: pVideoPlayer->Unload(); @@ -1428,7 +1428,7 @@ pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; pIcons_LOD->_4355F7(); continue; default: @@ -1484,7 +1484,7 @@ pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; pIcons_LOD->_4355F7(); continue; } @@ -1516,7 +1516,7 @@ pGUIWindow_CurrentMenu = 0; pEventTimer->Resume(); pCurrentScreen = SCREEN_GAME; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; pIcons_LOD->_4355F7(); continue; } @@ -1526,10 +1526,12 @@ GUIWindow::Create(0x25Au, 0x1C2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_GameSettings, 1); pEventTimer->Pause(); pAudioPlayer->StopChannels(-1, -1); + pCurrentScreen = SCREEN_MENU; + ++pIcons_LOD->uTexturePacksCount; - pCurrentScreen = 1; if ( !pIcons_LOD->uNumPrevLoadedFiles ) pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; + pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640, 480, WINDOW_OptionsButtons, 0, 0); uTextureID_Options = pIcons_LOD->LoadTexture("options", TEXTURE_16BIT_PALETTE); uTextureID_New1 = pIcons_LOD->LoadTexture("new1", TEXTURE_16BIT_PALETTE); @@ -1665,12 +1667,12 @@ pVideoPlayer->Unload(); DialogueEnding(); start_event_seq_number = 0; - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; continue; case UIMSG_CycleCharacters: v39 = GetAsyncKeyState(VK_SHIFT); uActiveCharacter = CycleCharacter(v39); - viewparams->bRedrawGameUI = 1; + viewparams->bRedrawGameUI = true; continue; case UIMSG_OnTravelByFoot: if ( pMessageQueue_50CBD0->uNumMessages ) diff -r 7f8be9f9769e -r ff2d888f8033 mm7_data.h --- a/mm7_data.h Wed May 22 22:25:44 2013 +0400 +++ b/mm7_data.h Wed May 22 22:26:31 2013 +0400 @@ -1403,7 +1403,6 @@ __int16 __fastcall sub_449A49_door_switch_animation(unsigned int uDoorID, int a2); // idb bool _449B57_test_bit(unsigned __int8 *a1, __int16 a2); void _449B7E_toggle_bit(unsigned char *pArray, __int16 a2, unsigned __int16 bToggle); // idb -void __cdecl Party__CountHirelings(); void __fastcall ShowStatusBarString(const char *pString, unsigned int uNumSeconds); void __cdecl ShowNothingHereStatus(); signed int __cdecl const_2();