Mercurial > mm7
diff mm7_2.cpp @ 1590:5792fdafe2f5
Слияние
author | Ritor1 |
---|---|
date | Wed, 11 Sep 2013 09:39:09 +0600 |
parents | f408fbf3d9cc 75fafd8ced59 |
children | 1efbaf1d01c3 |
line wrap: on
line diff
--- a/mm7_2.cpp Wed Sep 11 09:23:41 2013 +0600 +++ b/mm7_2.cpp Wed Sep 11 09:39:09 2013 +0600 @@ -36,7 +36,6 @@ #include "Arcomage.h" #include "LOD.h" #include "Actor.h" -#include "Allocator.h" #include "Events.h" #include "Viewport.h" #include "FrameTableInc.h" @@ -345,7 +344,7 @@ do { v6 = v5->pNext; - pAllocator->FreeChunk(v5); + free(v5); v5 = v6; } while ( v6 ); @@ -780,7 +779,7 @@ if ( pRenderer->pRenderD3D ) pRenderer->pBeforePresentFunction(); pRenderer->_49F1BC("MM7_Win.Pcx"); - pAllocator->FreeChunk(pFont); + free(pFont); window_SpeakInHouse->Release(); window_SpeakInHouse = 0; if ( v15 == (void *)2 ) @@ -2064,7 +2063,7 @@ } //----- (00452442) -------------------------------------------------------- -unsigned int __fastcall sub_452442(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4) +unsigned int __fastcall _452442_color_cvt(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4) { int v4; // ebx@0 __int16 v5; // ST14_2@1 @@ -2357,7 +2356,7 @@ int item_counter; if ( pMapStatsTXT_Raw ) - pAllocator->FreeChunk(pMapStatsTXT_Raw); + free(pMapStatsTXT_Raw); pMapStatsTXT_Raw = NULL; pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0); strtok(pMapStatsTXT_Raw, "\r"); @@ -2694,7 +2693,7 @@ int item_counter; if ( pHostileTXT_Raw ) - pAllocator->FreeChunk(pHostileTXT_Raw); + free(pHostileTXT_Raw); pHostileTXT_Raw = NULL; pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0); strtok(pHostileTXT_Raw, "\r"); @@ -2731,7 +2730,7 @@ } if ( pHostileTXT_Raw) { - pAllocator->FreeChunk(pHostileTXT_Raw); + free(pHostileTXT_Raw); pHostileTXT_Raw = NULL; } } @@ -3756,7 +3755,7 @@ } //----- (00464479) -------------------------------------------------------- -void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() +void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() { int v0; // esi@9 @@ -3776,7 +3775,7 @@ if (uCurrentlyLoadedLevelType == LEVEL_Indoor) pIndoor->Release(); else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) - pOutdoor->Release2(); + pOutdoor->Release(); pAudioPlayer->StopChannels(-1, -1); pSoundList->_4A9D79(0); @@ -3804,21 +3803,16 @@ } //----- (00464761) -------------------------------------------------------- -void Game_DeinitializeAndTerminate(int exitCode) +void Game_DeinitializeAndTerminate(int exitCode) { - int v1; // esi@1 - HANDLE v2; // eax@1 - - v1 = exitCode; - v2 = GetCurrentProcess(); - SetPriorityClass(v2, 0x20u); + SetPriorityClass(GetCurrentProcess(), 0x20u); ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); pGame->Deinitialize(); pRenderer->Release2(); if ( !DestroyWindow(hWnd) ) GetLastError(); hWnd = 0; - exit(v1); + exit(exitCode); } //----- (004647AB) -------------------------------------------------------- @@ -3839,13 +3833,13 @@ // 6BE3A0: using guessed type float flt_6BE3A0; //----- (00464839) -------------------------------------------------------- -char Is_out15odm_underwater() +char Is_out15odm_underwater() { return _stricmp(pCurrentMapName, "out15.odm") == 0; } //----- (00464851) -------------------------------------------------------- -void SetUnderwaterFog() +void SetUnderwaterFog() { day_fogrange_1 = 50; day_fogrange_2 = 5000; @@ -3888,7 +3882,7 @@ if ( !_stricmp(pCurrentMapName, "out15.odm") ) { bUnderwater = true; - pGame->uFlags2 |= 8u; + pGame->uFlags2 |= GAME_FLAGS_2_ALTER_GRAVITY; } pParty->floor_face_pid = 0; if ( _stricmp(Str1, "blv") ) @@ -3899,7 +3893,7 @@ _461103_load_level_sub(); if ( !_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv") ) { - //spawning grounds & good analogue - no loot & exp from monsters + //spawning grounds & walls of mist - no loot & exp from monsters for (uint i = 0; i < uNumActors; ++i) { @@ -4515,15 +4509,6 @@ return false; } } - - pAllocator = Allocator::Create(); - if (!pAllocator->Initialize(48 * 1024)) - { - MessageBoxW(nullptr, - L"Unable to Allocate 48Mb of RAM", - L"More RAM Memory Required", MB_ICONEXCLAMATION); - return false; - } game_starting_year = 1168; @@ -4980,6 +4965,7 @@ void IntegrityTest() { + assert(sizeof(MovieHeader) == 44); assert(sizeof(SoundDesc_mm6) == 112); assert(sizeof(SoundDesc) == 120); assert(sizeof(OverlayDesc) == 8);