# HG changeset patch # User Ritor1 # Date 1405513703 -21600 # Node ID 0673a59ec9e51bba2a1b39a2561620cb4278b744 # Parent e2d352b3a0a5f2cdfb04b06992a49dcc8ffc6b0d# Parent e7a551f458e1d48a1973bb94a0afd7352db74c9c Слияние diff -r e2d352b3a0a5 -r 0673a59ec9e5 AudioPlayer.cpp --- a/AudioPlayer.cpp Wed Jul 16 18:28:14 2014 +0600 +++ b/AudioPlayer.cpp Wed Jul 16 18:28:23 2014 +0600 @@ -85,8 +85,7 @@ pSoundDesc = &pSoundList->pSL_Sounds[i]; if ( pSoundList->pSL_Sounds[i].eType != SOUND_DESC_SYSTEM ) continue; - sprintf(pSoundName, "%s", pSL_Sounds[i].pSoundName); - pSoundList->pSL_Sounds[i].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)-1, pSL_Sounds[i].uSoundID); + pSoundList->pSL_Sounds[i].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)-1, pSL_Sounds[i].uSoundID); // Ritor result crash exe file if ( !pAudioPlayer->b3DSoundInitialized ) continue; pSoundDesc = &pSoundList->pSL_Sounds[i]; diff -r e2d352b3a0a5 -r 0673a59ec9e5 OSAPI.cpp --- a/OSAPI.cpp Wed Jul 16 18:28:14 2014 +0600 +++ b/OSAPI.cpp Wed Jul 16 18:28:23 2014 +0600 @@ -16,15 +16,17 @@ Log::Initialize(); //if (HWND hMM7Window = FindWindowW(L"MM7", 0)) - if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0)) + if (HWND hMM7Window = FindWindowW(L"M&MTrilogy", 0))//check whether the window is open( ) { if (IsIconic(hMM7Window)) ShowWindow(hMM7Window, SW_RESTORE); SetForegroundWindow(GetLastActivePopup(hMM7Window)); return 0; } - + //GetActiveWindow() (p ). + // , , , 0. HWND hPrevWindow = GetActiveWindow(); + if (!hPrevWindow) { Log::Warning(L"OS init: ok"); extern bool MM_Main(const wchar_t *pCmdLine); diff -r e2d352b3a0a5 -r 0673a59ec9e5 mm7_2.cpp --- a/mm7_2.cpp Wed Jul 16 18:28:14 2014 +0600 +++ b/mm7_2.cpp Wed Jul 16 18:28:23 2014 +0600 @@ -1778,6 +1778,7 @@ //pSprites_LOD->can_load_hardware_sprites = 1; pObjectList->InitializeSprites(); pOverlayList->InitializeSprites(); + if (!bNoSound) pSoundList->Initialize();