changeset 2506:9b96a51011fb

for sound
author Ritor1
date Thu, 25 Sep 2014 10:39:49 +0600
parents e3a619609dae
children 6dcc6e8dd041
files Engine/Events.cpp Engine/Game.cpp Engine/Graphics/Indoor.cpp Engine/Graphics/RenderD3D11.cpp Engine/Graphics/RenderD3D11.h Engine/MMT.cpp Engine/Objects/Actor.cpp Engine/Objects/Chest.cpp Engine/Objects/Player.cpp Engine/Objects/SpriteObject.cpp GUI/GUIWindow.cpp GUI/UI/Books/UIMapBook.cpp GUI/UI/Books/UINotesBooks.cpp GUI/UI/UIPopup.cpp Media/Audio/AudioCD.cpp Media/Audio/AudioCD.h Media/Audio/AudioPlayer.cpp Media/Audio/AudioPlayer.h
diffstat 18 files changed, 358 insertions(+), 172 deletions(-) [+]
line wrap: on
line diff
--- a/Engine/Events.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Events.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -653,7 +653,7 @@
             activeLevelDecoration = (LevelDecoration*)1;
             if ( EnterHouse(HOUSE_BODY_GUILD_ERATHIA) )
               {
-              pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
+              pAudioPlayer->PlaySound(SOUND_Invalid, 0, 0, -1, 0, 0, 0, 0);
               window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_HouseInterior, 165, 0);
               v48 = window_SpeakInHouse->pControlsHead;
               if ( window_SpeakInHouse->pControlsHead )
@@ -1176,7 +1176,7 @@
         if ( EnterHouse((enum HOUSE_ID)EVT_DWORD(_evt->v5)))
           {
             pRenderer->Sub01();
-          pAudioPlayer->PlaySound((SoundID)0, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_Invalid, 0, 0, -1, 0, 0, 0, 0);
           pAudioPlayer->PlaySound(SOUND_EnteringAHouse, 814, 0, -1, 0, 0, 0, 0);
           v104 = 187;
           if ( uCurrentHouse_Animation != 167 )
--- a/Engine/Game.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Game.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -1580,7 +1580,7 @@
         case UIMSG_ChangeKeyButton:
           if ( uGameMenuUI_CurentlySelectedKeyIdx != -1 )
           {
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           v14 = uMessageParam;
@@ -1607,7 +1607,7 @@
             pPrevVirtualCidesMapping[i] = pKeyActionMap->GetActionVKey((enum InputAction)i);
             GameMenuUI_InvaligKeyBindingsFlags[i] = false;
           }
-          pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_219, 0, 0, -1, 0, 0, 0, 0);
           continue;
         case UIMSG_SelectKeyPage1:
           KeyboardPageNum = 1;
@@ -1667,13 +1667,13 @@
             if ( (uGammaPos -- -1) < 0 )
             {
               uGammaPos = 0;
-              pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
+              pAudioPlayer->PlaySound(SOUND_21, 0, 0, -1, 0, 0, 0, 0);
               continue;
             }
             v19 = (double)(signed int)uGammaPos * 0.1 + 0.6;
             pGame->pGammaController->Initialize(v19);
             GUIWindow::Create(21, 161, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderLeft, (char *)1);
-            pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_21, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           if ( uMessageParam == 5 )
@@ -1684,7 +1684,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, (char *)1);
-              pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
+              pAudioPlayer->PlaySound(SOUND_21, 0, 0, -1, 0, 0, 0, 0);
               continue;
             }
             uGammaPos = 9;
@@ -1695,7 +1695,7 @@
             v22 = (double)(signed int)uGammaPos * 0.1 + 0.6;
             pGame->pGammaController->Initialize(v22);
           }
-          pAudioPlayer->PlaySound((SoundID)21, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_21, 0, 0, -1, 0, 0, 0, 0);
           continue;
         case UIMSG_ToggleBloodsplats:
           pGame->ToggleFlags2(0x20u);
@@ -1744,10 +1744,11 @@
               uSoundVolumeMultiplier = 0;
             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);
-			//int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook);
-			//if (v)
-				//__debugbreak();
+            pAudioPlayer->PlaySound(SOUND_shurch, -1, 0, -1, 0, 0, 0, 0);
+			int v = AIL_redbook_volume(pAudioPlayer->hAILRedbook);
+			//v = v+1;
+			if (v)
+			  __debugbreak();
             continue;
           }
           if ( uMessageParam == 5 )//Increase sound level button right
@@ -1758,16 +1759,16 @@
             //v168 = 1;
             v24 = 435;
             //v154 = (int)pBtn_SliderRight;
-            GUIWindow::Create(v24, 0xA2u, 0, 0, WINDOW_PressedButton2, (int)pBtn_SliderRight, (char *)1);
+            GUIWindow::Create(v24, 162, 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);
+            pAudioPlayer->PlaySound(SOUND_shurch, -1, 0, -1, 0, 0, 0, 0);
             continue;
           }
           uSoundVolumeMultiplier = (pMouse->GetCursorPos(&v207)->x - 263) / 17;
           if ( (char)uSoundVolumeMultiplier > 8 )
             uSoundVolumeMultiplier = 9;
           pAudioPlayer->SetMasterVolume(pSoundVolumeLevels[uSoundVolumeMultiplier] * 128.0f);
-          pAudioPlayer->PlaySound((SoundID)218, -1, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_shurch, -1, 0, -1, 0, 0, 0, 0);
           continue;
         case UIMSG_ToggleFlipOnExit:
           bFlipOnExit = bFlipOnExit == 0;
@@ -1790,7 +1791,7 @@
             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);
+            pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
             continue;
           }
           if ( uMessageParam == 5 )
@@ -1801,7 +1802,7 @@
             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);
+            pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
             continue;
           }
           uVoicesVolumeMultiplier = (pMouse->GetCursorPos(&v205)->x - 263) / 17;
@@ -1809,7 +1810,7 @@
             uVoicesVolumeMultiplier = 9;
           if ( !uVoicesVolumeMultiplier )
             continue;
-          pAudioPlayer->PlaySound((SoundID)5788, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
+          pAudioPlayer->PlaySound(SOUND_hf445a, -1, 0, -1, 0, 0, pSoundVolumeLevels[uVoicesVolumeMultiplier] * 128.0f, 0);
           continue;
         case UIMSG_SetTurnSpeed:
           if ( uMessageParam )
@@ -2168,7 +2169,7 @@
                         stru_506E40.Release();
                         break;
                       }
-                      pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+                      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
                       break;
                     case SCREEN_REST://close rest screen
                       if ( dword_506F14 )
@@ -2237,7 +2238,7 @@
                           continue;
                       }
                       GetHouseGoodbyeSpeech();
-                      pAudioPlayer->PlaySound(SOUND_7, 814, 0, -1, 0, 0, 0, 0);
+                      pAudioPlayer->PlaySound(SOUND_WoodDRClose, 814, 0, -1, 0, 0, 0, 0);
                       pMediaPlayer->Unload();
                       pGUIWindow_CurrentMenu = window_SpeakInHouse;
                       if ( pGUIWindow_Settings )
@@ -3255,13 +3256,13 @@
             pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             v73 = "Can't jump to that location!";
           }
-          ShowStatusBarString(v73, 6u);
+          ShowStatusBarString(v73, 6);
           continue;
         case UIMSG_CastQuickSpell:
           if ( bUnderwater == 1 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           if ( !uActiveCharacter || (pPlayer2 = pPlayers[uActiveCharacter], pPlayer2->uTimeToRecovery) )
@@ -3357,7 +3358,7 @@
           if ( dword_506F14 == 2 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           GUIWindow::Create(pButton_RestUI_Wait5Minutes->uX, pButton_RestUI_Wait5Minutes->uY, 0, 0, WINDOW_PressedButton2,
@@ -3369,7 +3370,7 @@
           if ( dword_506F14 == 2 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           GUIWindow::Create(pButton_RestUI_Wait1Hour->uX, pButton_RestUI_Wait1Hour->uY, 0, 0, WINDOW_PressedButton2,
@@ -3440,7 +3441,7 @@
           if ( dword_506F14 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           if ( pParty->uNumFoodRations < uRestUI_FoodRequiredToRest )
@@ -3487,7 +3488,7 @@
                 }*/
                 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
                 ShowStatusBarString(pGlobalTXT_LocalizationStrings[481], 2);// "Encounter!"
-                pAudioPlayer->PlaySound((SoundID)227, 0, 0, -1, 0, 0, 0, 0);
+                pAudioPlayer->PlaySound(SOUND_227, 0, 0, -1, 0, 0, 0, 0);
                 continue;
               }
             }
@@ -3506,7 +3507,7 @@
           if ( dword_506F14 == 2 )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[477], 2);// "You are already resting!"
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           GUIWindow::Create(pButton_RestUI_WaitUntilDawn->uX, pButton_RestUI_WaitUntilDawn->uY, 0, 0, WINDOW_PressedButton2,
@@ -3560,7 +3561,7 @@
           {
             pPlayer10->uQuickSpell = 0;
             quick_spell_at_page = 0;
-            pAudioPlayer->PlaySound((SoundID)203, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_203, 0, 0, -1, 0, 0, 0, 0);
             continue;
           }
           pPlayers[uActiveCharacter]->uQuickSpell = quick_spell_at_page + 11 * pPlayers[uActiveCharacter]->lastOpenedSpellbookPage;
@@ -3585,7 +3586,7 @@
             }
           }
           if ( !skill_count )//нет скиллов
-            pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_204), 0, 0, -1, 0, 0, 0, 0);
           else
           {
             if ( GetAsyncKeyState(VK_SHIFT) )
@@ -3603,7 +3604,7 @@
             OnCloseSpellBookPage();
             pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = LOBYTE(v217[uAction]);
             pGUIWindow_CurrentMenu->OpenSpellBook();
-            pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_204), 0, 0, -1, 0, 0, 0, 0);
           }
           continue;
         }
@@ -3613,7 +3614,7 @@
           OnCloseSpellBookPage();
           pPlayers[uActiveCharacter]->lastOpenedSpellbookPage = uMessageParam;
           pGUIWindow_CurrentMenu->OpenSpellBook();
-          pAudioPlayer->PlaySound((SoundID)(rand() % 2 + 204), 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound((SoundID)(rand() % 2 + SOUND_204), 0, 0, -1, 0, 0, 0, 0);
           continue;
         case UIMSG_SelectSpell:
         {
@@ -3670,7 +3671,7 @@
           if ( bUnderwater == true )
           {
             ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2);// "You can not do that while you are underwater!"
-            pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+            pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           }
           else
           {
@@ -3684,7 +3685,7 @@
                 pCurrentScreen = SCREEN_SPELL_BOOK;
                 pEventTimer->Pause();
                 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
-                pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
+                pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0);
                 viewparams->field_48 = 1;
                 continue;
               }
@@ -3696,7 +3697,7 @@
                 pCurrentScreen = SCREEN_SPELL_BOOK;
                 pEventTimer->Pause();
                 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_SpellBook, 0, 0);
-                pAudioPlayer->PlaySound((SoundID)48, 0, 0, -1, 0, 0, 0, 0);
+                pAudioPlayer->PlaySound(SOUND_48, 0, 0, -1, 0, 0, 0, 0);
                 viewparams->field_48 = 1;
                 continue;
               }
@@ -4260,12 +4261,12 @@
         case UIMSG_PlayerCreationClickPlus:
           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);
+          pAudioPlayer->PlaySound(SOUND_20, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreationClickMinus:
           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);
+          pAudioPlayer->PlaySound(SOUND_23, 0, 0, -1, 0, 0, 0, 0);
           break;
         case UIMSG_PlayerCreationSelectActiveSkill:
           if ( pPlayer[uPlayerCreationUI_SelectedCharacter].GetSkillIdxByOrder(3) == 37 )
@@ -4300,7 +4301,7 @@
             pParty->pPlayers[pParam].pActiveSkills[pPlayer[pParam].GetSkillIdxByOrder(3)] = 0;
           break;
         case UIMSG_PlayerCreationChangeName:
-          pAudioPlayer->PlaySound((SoundID)24, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_24, 0, 0, -1, 0, 0, 0, 0);
           v3 = (void *)pParam;
           uPlayerCreationUI_SelectedCharacter = pParam;
           pKeyActionMap->EnterText(0, 15, pGUIWindow_CurrentMenu);
@@ -4469,7 +4470,7 @@
 //----- (0042FBDD) --------------------------------------------------------
 void  sub_42FBDD()
 {
-  pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+  pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
   pRenderer->DrawTextureTransparent(pBtn_YES->uX, pBtn_YES->uY, pBtn_YES->pTextures[0]);
   pRenderer->Present();
 }
@@ -4477,7 +4478,7 @@
 //----- (0042FC15) --------------------------------------------------------
 void  CloseWindowBackground()
 {
-  pAudioPlayer->PlaySound(SOUND_Button2, -2, 0, -1, 0, 0, 0, 0);
+  pAudioPlayer->PlaySound(SOUND_StartMainChoice02, -2, 0, -1, 0, 0, 0, 0);
   pRenderer->DrawTextureTransparent(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, pBtn_ExitCancel->pTextures[0]);
   pRenderer->Present();
 }
@@ -4961,10 +4962,10 @@
 	pEventTimer->Initialize();
 	window = OSWindow::Create(L"Might and Magic® Trilogy", game_width, game_height);//Create  game window
 
-	bool use_d3d11 = false;
-	if (use_d3d11)
-		pRenderer = RenderD3D11::Create();
-	else
+	//bool use_d3d11 = false;
+	//if (use_d3d11)
+		//pRenderer = RenderD3D11::Create();
+	//else
 		pRenderer = Render::Create();//Create DirectX
 	if (!pRenderer)
 	{
--- a/Engine/Graphics/Indoor.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Graphics/Indoor.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -5760,7 +5760,7 @@
         if ( on_water )
           pAudioPlayer->PlaySound(SOUND_RunAlongWater, 804, 1, -1, 0, 0, 0, 0);
         else if ( pIndoor->pFaces[uFaceID].uAttributes & FACE_INDOOR_CARPET )//по ковру
-          pAudioPlayer->PlaySound((SoundID)50, 804, 1, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_50, 804, 1, -1, 0, 0, 0, 0);
         else
           pAudioPlayer->PlaySound(SOUND_RunAlong3DModel, 804, 1, -1, 0, 0, 0, 0);
         pParty->walk_sound_timer = 96;//64
@@ -5773,7 +5773,7 @@
         if ( on_water )
           pAudioPlayer->PlaySound(SOUND_WalkAlongWater, 804, 1, -1, 0, 0, 0, 0);
         else if ( pIndoor->pFaces[uFaceID].uAttributes & FACE_INDOOR_CARPET )//по ковру
-          pAudioPlayer->PlaySound((SoundID)89, 804, 1, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_89, 804, 1, -1, 0, 0, 0, 0);
         else
           pAudioPlayer->PlaySound(SOUND_WalkAlong3DModel, 804, 1, -1, 0, 0, 0, 0);
         pParty->walk_sound_timer = 144;//64
--- a/Engine/Graphics/RenderD3D11.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Graphics/RenderD3D11.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -1,4 +1,4 @@
-#include <d3dcompiler.h>
+/*#include <d3dcompiler.h>
 #include <comdef.h> // _com_error
 
 #include "../ErrorHandling.h"
@@ -231,7 +231,7 @@
 
   unsigned int device_flags = 0;//D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT;
   #ifndef NODEBUG
-    device_flags |= 0/*D3D11_CREATE_DEVICE_DEBUG | D3D11_CREATE_DEVICE_DEBUGGABLE*/;
+    device_flags |= 0*//*D3D11_CREATE_DEVICE_DEBUG | D3D11_CREATE_DEVICE_DEBUGGABLE*//*;
    #endif
 
   HRESULT (__stdcall *dll_D3D11CreateDeviceAndSwapChain)(IDXGIAdapter* pAdapter, D3D_DRIVER_TYPE DriverType, HMODULE Software, UINT Flags, CONST D3D_FEATURE_LEVEL* pFeatureLevels, UINT FeatureLevels, UINT SDKVersion, CONST DXGI_SWAP_CHAIN_DESC* pSwapChainDesc, IDXGISwapChain** ppSwapChain, ID3D11Device** ppDevice, D3D_FEATURE_LEVEL* pFeatureLevel, ID3D11DeviceContext** ppImmediateContext);
@@ -242,7 +242,7 @@
   {
     MessageBoxA(nullptr, "Received Direct3D 9 or lower", "", 0);
     __debugbreak();
-  }
+  }*/
       /*if (fullscreen)
       {
         extern void ChangeResolution(int new_dith, int new_height, int new_bpp);
@@ -253,7 +253,7 @@
       }
       ErrorD3D(pSwapChain->SetFullscreenState(fullscreen, nullptr));*/
 
-
+  /*
   ID3D11Texture2D *pSwapChainSurface;
   {
     ErrorD3D(pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (void **)&pSwapChainSurface));
@@ -322,4 +322,4 @@
   d3dc->RSSetViewports(1, &viewport);
 
   return true;
-}
\ No newline at end of file
+}*/
\ No newline at end of file
--- a/Engine/Graphics/RenderD3D11.h	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Graphics/RenderD3D11.h	Thu Sep 25 10:39:49 2014 +0600
@@ -1,4 +1,4 @@
-#pragma once
+/*#pragma once
 
 #include <cstdint>
 #include <cstdio>
@@ -170,3 +170,4 @@
     ID3D11RenderTargetView  *primary_srv;
     ID3D11DepthStencilView  *depth_srv;
 };
+*/
\ No newline at end of file
--- a/Engine/MMT.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/MMT.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -210,8 +210,8 @@
   pGUIWindow2 = 0;
   pAudioPlayer->StopChannels(-1, -1);
 
-  //if (!bNoSound )
-    //PlayAudio(L"Sounds\\New_Sounds/Stronghold_Theme.mp3");
+  if (!bNoSound )
+    PlayAudio(L"Sounds\\New_Sounds/Stronghold_Theme.mp3");
   //if (!bNoVideo )
     //pVideoPlayer->PlayMovie(L"Anims\\New_Video/3DOLOGO.smk");
 
@@ -354,7 +354,8 @@
         case UIMSG_MMT_MainMenu_MM6:
           //video
           //SetCurrentMenuID(MENU_MAIN_MM6);
-          pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);//temporarily
+		  alSourcef (mSourceID, AL_GAIN,    0.5f);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);//temporarily
           break;
         case UIMSG_MMT_MainMenu_MM7: //new button for ММ7
           //GUIWindow::Create(495, 172, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnNew, 0);
@@ -365,12 +366,14 @@
         case UIMSG_MMT_MainMenu_MM8:
           //video
           //SetCurrentMenuID(MENU_MAIN_MM8);
-          pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);//temporarily
+		  alSourcei (mSourceID, AL_LOOPING,  1);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);//temporarily
           break;
         case UIMSG_MMT_MainMenu_Continue:
           //video
           //SetCurrentMenuID(MENU_MAIN_Continue);
-          pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);//temporarily
+		  alSourcef (mSourceID, AL_GAIN,    1.0f);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);//temporarily
           break;
         case UIMSG_ExitToWindows:
           GUIWindow::Create(495, 337, 0, 0, WINDOW_PressedButton2, (int)pMainMenu_BtnExit, 0);
--- a/Engine/Objects/Actor.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Objects/Actor.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -2277,7 +2277,7 @@
   v6->uPitchAngle = v16;
   v6->uAIState = Pursuing;
   if ( rand() % 100 < 2 )
-    Actor::PlaySound(uActorID, 2u);
+    Actor::PlaySound(uActorID, 2);
   v6->UpdateAnimation();
 }
 
--- a/Engine/Objects/Chest.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Objects/Chest.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -163,7 +163,7 @@
       pSpellObject.spell_target_pid = 0;
       pSpellObject.uFacing = 0;
       pSpellObject.Create(0, 0, 0, 0);
-      pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
       pSpellObject.ExplosionTraps();
       chest->uFlags &= 0xFEu;
       if ( uActiveCharacter && !_A750D8_player_speech_timer && !OpenedTelekinesis )
--- a/Engine/Objects/Player.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Objects/Player.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -2313,97 +2313,97 @@
     {
       case SPECIAL_ATTACK_CURSE:
         SetCondition(Condition_Cursed, 1);
-        pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_221, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_WEAK:
         SetCondition(Condition_Weak, 1);
-        pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_221, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_SLEEP:
         SetCondition(Condition_Sleep, 1);
-        pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_221, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_DRUNK:
         SetCondition(Condition_Drunk, 1);
-        pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_221, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_INSANE:
         SetCondition(Condition_Insane, 1);
-        pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_224, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_POISON_WEAK:
         SetCondition(Condition_Poison_Weak, 1);
-        pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_222, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_POISON_MEDIUM:
         SetCondition(Condition_Poison_Medium, 1);
-        pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_222, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_POISON_SEVERE:
         SetCondition(Condition_Poison_Severe, 1);
-        pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_222, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_DISEASE_WEAK:
         SetCondition(Condition_Disease_Weak, 1);
-        pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_222, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_DISEASE_MEDIUM:
         SetCondition(Condition_Disease_Medium, 1);
-        pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_222, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_DISEASE_SEVERE:
         SetCondition(Condition_Disease_Severe, 1);
-        pAudioPlayer->PlaySound((SoundID)222, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_222, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_PARALYZED:
         SetCondition(Condition_Paralyzed, 1);
-        pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_224, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_UNCONSCIOUS:
         SetCondition(Condition_Unconcious, 1);
-        pAudioPlayer->PlaySound((SoundID)224, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_224, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_DEAD:
         SetCondition(Condition_Dead, 1);
-        pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_225, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_PETRIFIED:
         SetCondition(Condition_Pertified, 1);
-        pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_225, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_ERADICATED:
         SetCondition(Condition_Eradicated, 1);
-        pAudioPlayer->PlaySound((SoundID)225, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_225, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
@@ -2414,7 +2414,7 @@
         {
           PlaySound(SPEECH_40, 0);
           v48->SetBroken();
-          pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_47, 0, 0, -1, 0, 0, 0, 0);
         }
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
@@ -2433,27 +2433,27 @@
         }
         memcpy(v27, &this->pInventoryItemList[this->pInventoryMatrix[v47]-1], 0x24u);
         RemoveItemAtInventoryIndex(v47);
-        pAudioPlayer->PlaySound((SoundID)47, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_47, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_AGING:
         PlaySound(SPEECH_42, 0);
         ++this->sAgeModifier;
-        pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_226, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_MANA_DRAIN:
         PlaySound(SPEECH_41, 0);
         this->sMana = 0;
-        pAudioPlayer->PlaySound((SoundID)226, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_226, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
       case SPECIAL_ATTACK_FEAR:
         SetCondition(Condition_Fear, 1);
-        pAudioPlayer->PlaySound((SoundID)221, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_221, 0, 0, -1, 0, 0, 0, 0);
         pGame->pStru6Instance->SetPlayerBuffAnim(0x99u, v3);
         return 1;
         break;
@@ -4322,10 +4322,10 @@
       v68 = pParty->pPickedItem.GetDisplayName();
       sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
       ShowStatusBarString(pTmpBuf.data(), 2);
-      pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       return;
     }
-    pAudioPlayer->PlaySound((SoundID)211, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_EatApple, 0, 0, -1, 0, 0, 0, 0);
 
     if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
     {
@@ -4613,11 +4613,11 @@
           default:
           v68 = pParty->pPickedItem.GetDisplayName();
           sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36], v68);//"%s can not be used that way"
-          ShowStatusBarString(pTmpBuf.data(), 2u);
-          pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+          ShowStatusBarString(pTmpBuf.data(), 2);
+          pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
           return;
       }
-      pAudioPlayer->PlaySound((SoundID)210, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_210, 0, 0, -1, 0, 0, 0, 0);
       if ( pGUIWindow_CurrentMenu && pGUIWindow_CurrentMenu->eWindowType != WINDOW_null)
       {
 //         if ( !v73 )                                            v73 is always 1 at this point
@@ -4654,14 +4654,14 @@
 
       v68 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()];
       sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);
-      ShowStatusBarString(pTmpBuf.data(), 2u);
-      pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+      ShowStatusBarString(pTmpBuf.data(), 2);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       return;
     }
     if ( bUnderwater == 1 )
     {
       ShowStatusBarString(pGlobalTXT_LocalizationStrings[652], 2u);//"You can not do that while you are underwater!"
-      pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       return;
     }
 
@@ -4696,8 +4696,8 @@
       {
         v66 = pParty->pPickedItem.GetDisplayName();
         sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[380], v66);//"You already know the %s spell"
-        ShowStatusBarString(pTmpBuf.data(), 2u);
-        pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+        ShowStatusBarString(pTmpBuf.data(), 2);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
         return;
       }
       if ( !playerAffected->CanAct() )
@@ -4705,7 +4705,7 @@
         v66 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()];
         sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v66);//"That player is %s"
         ShowStatusBarString(pTmpBuf.data(), 2);
-        pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
         return;
       }
       v16 = v15 % 11 + 1;
@@ -4771,7 +4771,7 @@
       v68 = aCharacterConditionNames[playerAffected->GetMajorConditionIdx()];
       sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[382], v68);//That player is %s
       ShowStatusBarString(pTmpBuf.data(), 2);
-      pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
       return;
   }
   else
@@ -4864,31 +4864,31 @@
             break;
 
       }
-      ShowStatusBarString(pTmpBuf.data(), 2u);
+      ShowStatusBarString(pTmpBuf.data(), 2);
       pMouse->RemoveHoldingItem();
       pGame->pStru6Instance->SetPlayerBuffAnim(SPELL_QUEST_COMPLETED, player_num - 1);
       playerAffected->PlaySound(SPEECH_93, 0);
-      pAudioPlayer->PlaySound((SoundID)219, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_219, 0, 0, -1, 0, 0, 0, 0);
       if ( pParty->uDaysPlayed == 6 || pParty->uDaysPlayed == 20 )
-          {
-          playerAffected->SetCondition(Condition_Eradicated, 0);
-          pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
-          }
+      {
+        playerAffected->SetCondition(Condition_Eradicated, 0);
+        pAudioPlayer->PlaySound(SOUND_215, 0, 0, -1, 0, 0, 0, 0);
+      }
       else if ( pParty->uDaysPlayed == 12 || pParty->uDaysPlayed == 26 )
-          {
-          playerAffected->SetCondition(Condition_Dead, 0);
-          pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);
-          }
+      {
+        playerAffected->SetCondition(Condition_Dead, 0);
+        pAudioPlayer->PlaySound(SOUND_215, 0, 0, -1, 0, 0, 0, 0);
+      }
       else  if ( pParty->uDaysPlayed == 4 || pParty->uDaysPlayed == 25 )
       {
         playerAffected->SetCondition(Condition_Pertified, 0);
-        pAudioPlayer->PlaySound((SoundID)215, 0, 0, -1, 0, 0, 0, 0);                 
+        pAudioPlayer->PlaySound(SOUND_215, 0, 0, -1, 0, 0, 0, 0);                 
       }
       return;
       }
       else if ( pParty->pPickedItem.uItemID == 630 ) //Red Apple
       {
-          Party::GiveFood(1u);
+          Party::GiveFood(1);
           pAudioPlayer->PlaySound(SOUND_EatApple, 0, 0, -1, 0, 0, 0, 0);
       }
       else if ( pParty->pPickedItem.uItemID == 632 ) //Lute
@@ -4922,8 +4922,8 @@
       {
         v68 = pParty->pPickedItem.GetDisplayName();
         sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[36],v68);//"%s can not be used that way"
-        ShowStatusBarString(pTmpBuf.data(), 2u);
-        pAudioPlayer->PlaySound((SoundID)27, 0, 0, -1, 0, 0, 0, 0);
+        ShowStatusBarString(pTmpBuf.data(), 2);
+        pAudioPlayer->PlaySound(SOUND_error, 0, 0, -1, 0, 0, 0, 0);
         return;
       }
 
--- a/Engine/Objects/SpriteObject.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Engine/Objects/SpriteObject.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -1245,7 +1245,7 @@
 				 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0;
 				 v13 = 8 * uLayingItemID;
 				 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID);
-				 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0);
+				 pAudioPlayer->PlaySound(SOUND_Explosion, v13, 0, -1, 0, 0, 0, 0);
 				 return 0;
 	}
 
@@ -1279,7 +1279,7 @@
 				{
 					v13 = 8 * uLayingItemID;
 					LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID);
-					pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0);
+					pAudioPlayer->PlaySound(SOUND_Explosion, v13, 0, -1, 0, 0, 0, 0);
 				}
 				return 0;
 	}
@@ -1339,7 +1339,7 @@
 				{
 					v13 = 8 * uLayingItemID;
 					LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID);
-					pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0);
+					pAudioPlayer->PlaySound(SOUND_Explosion, v13, 0, -1, 0, 0, 0, 0);
 					return 0;
 				}
 				return 0;
@@ -1370,7 +1370,7 @@
 				AttackerInfo.Add(v38, 512, v40, v39, v37, 0, 0);
 				if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE)
 					trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor);
-				pAudioPlayer->PlaySound(SOUND_8, v147, 0, -1, 0, 0, 0, 0);
+				pAudioPlayer->PlaySound(SOUND_Explosion, v147, 0, -1, 0, 0, 0, 0);
 				return 0;
 	}
 
--- a/GUI/GUIWindow.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/GUI/GUIWindow.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -1924,7 +1924,7 @@
       case WINDOW_PressedButton2:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         if ( pButton->uX >= 0 && pButton->uX <= window->GetWidth() )
         {
@@ -1953,7 +1953,7 @@
       case WINDOW_CharactersPressedButton:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
         viewparams->bRedrawGameUI = 1;
@@ -1968,7 +1968,7 @@
       case WINDOW_PressedButton:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
         viewparams->bRedrawGameUI = 1;
@@ -1983,7 +1983,7 @@
       case WINDOW_5D:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
         viewparams->bRedrawGameUI = 1;
@@ -1993,7 +1993,7 @@
       case WINDOW_SaveLoadBtn:
       {
         if (pWindow->Hint != (char *)1)
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
         pHint = pWindow->Hint;
@@ -2010,7 +2010,7 @@
       case WINDOW_LoadGame_CancelBtn:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound((SoundID)75, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureTransparent(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[0]);
         viewparams->bRedrawGameUI = 1;
@@ -2023,7 +2023,7 @@
       case WINDOW_CloseRestWindowBtn:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pGUIButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pGUIButton->pTextures[0]);
         pHint = pWindow->Hint;
@@ -2037,7 +2037,7 @@
       case WINDOW_ExitCharacterWindow:
       {
         if ( pWindow->Hint != (char *)1 )
-          pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+          pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pButton = (GUIButton *)pWindow->ptr_1C;
         pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, pButton->pTextures[1]);
         pHint = pWindow->Hint;
@@ -2059,7 +2059,7 @@
         GUIButton2.uWidth = 171;
         GUIButton2.uHeight = 37;
         GUIButton2.pParent = pButton_RestUI_WaitUntilDawn->pParent;
-        pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+        pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
         pRenderer->DrawTextureIndexed(pWindow->uFrameX, pWindow->uFrameY, *((Texture **)pWindow->ptr_1C + 15));
         viewparams->bRedrawGameUI = 1;
         GUIButton2.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, 0, 0);//Отдых и лечение 8 часов
--- a/GUI/UI/Books/UIMapBook.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/GUI/UI/Books/UIMapBook.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -239,7 +239,7 @@
     viewparams->_443225();
 
   if ( BtnUp_flag | BtnDown_flag | Book_PageBtn3_flag | Book_PageBtn4_flag | Book_PageBtn5_flag | Book_PageBtn6_flag )
-    pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+    pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
   BtnUp_flag = 0;
   BtnDown_flag = 0;
   Book_PageBtn6_flag = 0;
--- a/GUI/UI/Books/UINotesBooks.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/GUI/UI/Books/UINotesBooks.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -188,7 +188,7 @@
     else//press(нажатие)
     {
       change_flag = true;
-      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
       _506568_autonote_type = AUTONOTE_POTION_RECEPIE;
       pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 398, pViewport->uViewportTL_Y + 113, pTex_book_button3_on);
     }
@@ -208,7 +208,7 @@
     else
     {
       change_flag = true;
-      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
       _506568_autonote_type = AUTONOTE_STAT_HINT;
       pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 399, pViewport->uViewportTL_Y + 150, pTex_book_button4_on);
     }
@@ -228,7 +228,7 @@
     else
     {
       change_flag = true;
-      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
       _506568_autonote_type = AUTONOTE_OBELISK;
       pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 188, pTex_book_button5_on);
     }
@@ -248,7 +248,7 @@
     else
     {
       change_flag = true;
-      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
       _506568_autonote_type = AUTONOTE_SEER;
       pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 226, pTex_book_button6_on);
     }
@@ -268,7 +268,7 @@
     else
     {
       change_flag = true;
-      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
       _506568_autonote_type = AUTONOTE_MISC;
       pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 264, pTex_book_button7_on);
     }
@@ -288,7 +288,7 @@
     else
     {
       change_flag = true;
-      pAudioPlayer->PlaySound(SOUND_Button2, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_StartMainChoice02, 0, 0, -1, 0, 0, 0, 0);
       _506568_autonote_type = AUTONOTE_TEACHER;
       pRenderer->DrawTextureTransparent(pViewport->uViewportTL_X + 397, pViewport->uViewportTL_Y + 302, pTex_book_button8_on);
     }
--- a/GUI/UI/UIPopup.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/GUI/UI/UIPopup.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -1858,7 +1858,7 @@
     {
       pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
       pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 11 + 10, DMGT_FIRE);
-      pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
       pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
       v39.z = pParty->vPosition.z + pParty->sEyelevel;
       v39.x = pParty->vPosition.x;
@@ -1883,7 +1883,7 @@
       pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
       pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 71 + 30, DMGT_FIRE);
       pPlayers[uActiveCharacter]->ItemsEnchant(1);
-      pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
       pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
 
       v39.z = pParty->vPosition.z + pParty->sEyelevel;
@@ -1909,7 +1909,7 @@
       pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
       pPlayers[uActiveCharacter]->ReceiveDamage(rand() % 201 + 50, DMGT_FIRE);
       pPlayers[uActiveCharacter]->ItemsEnchant(5);
-      pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
 
       pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
 
@@ -1936,7 +1936,7 @@
       pPlayers[uActiveCharacter]->RemoveItemAtInventoryIndex(pOut_y);
       pPlayers[uActiveCharacter]->SetCondition(Condition_Eradicated, 0);
       pPlayers[uActiveCharacter]->ItemsEnchant(0);
-      pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0);
+      pAudioPlayer->PlaySound(SOUND_Explosion, 0, 0, -1, 0, 0, 0, 0);
 
       pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Escape, 0, 0);
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Media/Audio/AudioCD.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -0,0 +1,119 @@
+#define _CRTDBG_MAP_ALLOC
+#include <stdlib.h>
+#include <crtdbg.h>
+#define _CRT_SECURE_NO_WARNINGS
+
+#include <string>
+#include "AudioCD.h"
+#include "Engine/mm7_data.h"
+#include "Engine/Log.h"
+//#include "OSAPI.h"
+#include <sstream>
+//char в wchar_t
+bool char2wchar_t(char *str1, wchar_t *str2)
+{
+	std::wstringstream st;
+	st << str1;
+	return !(st >> str2).fail();
+};
+class CDaudio *CD_Audio;
+
+void CDaudio::CDRomOpen(bool bOpenDrive, char *drive)
+{ 
+    DWORD flags;
+	MCIERROR err;
+	wchar_t *wStr = new wchar_t;
+
+	char2wchar_t(drive,wStr);
+    open.lpstrDeviceType = (LPCWSTR)(DWORD)MCI_DEVTYPE_CD_AUDIO;
+    open.lpstrElementName = (LPCWSTR)wStr;
+
+    flags = MCI_OPEN_TYPE | MCI_OPEN_TYPE_ID;
+
+    if (!mciSendCommand(0, MCI_OPEN, flags, (DWORD) &open)) 
+    {
+		// The device opened successfully; get the device ID. 
+		MCI_STATUS_PARMS mciStatusParms;
+		mciStatusParms.dwItem = MCI_STATUS_READY;
+		if (mciSendCommand(open.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)&mciStatusParms))
+		{
+          Log::Warning(L"CD device is not ready");
+          return;
+		}
+		// Set the time format to minute/second/frame (MSF) format. 
+		mciSetParms.dwTimeFormat = MCI_FORMAT_TMSF; 
+        flags = MCI_SET_TIME_FORMAT; 
+        if ( mciSendCommand(open.wDeviceID, MCI_SET, flags, (DWORD)&mciSetParms))
+		{
+          mciSendCommand(open.wDeviceID, MCI_CLOSE, 0, NULL); 
+		  Log::Warning(L"audio time format error");
+		  return;
+		} 
+		// Get the number of tracks;
+        // limit to number that can be displayed (20). 
+		mciStatusParms.dwItem = MCI_STATUS_NUMBER_OF_TRACKS;
+		if (mciSendCommand(open.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM, (DWORD)&mciStatusParms))
+		{
+          Log::Warning(L"No audio tracks");
+          return;		
+		}
+		CD_Audio->number_of_tracks = mciStatusParms.dwReturn;//количество треков
+
+        for ( unsigned int i = 0; i < CD_Audio->number_of_tracks; i++)
+		{
+		  mciStatusParms.dwTrack = i + 1;
+		  mciStatusParms.dwItem = MCI_STATUS_LENGTH;
+		  if ( mciSendCommand(open.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM + MCI_TRACK, (DWORD)&mciStatusParms))
+		  {
+            Log::Warning(L"audio track is corrupt");
+            return;
+		  }
+		  CD_Audio->tracks[i].track_length = mciStatusParms.dwReturn;//длина трека
+
+          // For each track, get and save the starting location
+		  mciStatusParms.dwItem = MCI_STATUS_POSITION;
+		  if ( mciSendCommand(open.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK, (DWORD)(LPVOID) &mciStatusParms)) 
+		  {
+            mciSendCommand(open.wDeviceID, MCI_CLOSE, 0, NULL);
+            return;
+          } 
+		  CD_Audio->tracks[i].position = mciStatusParms.dwReturn;
+
+	      mciStatusParms.dwItem = MCI_CDA_STATUS_TYPE_TRACK;
+		  mciSendCommand(open.wDeviceID, MCI_STATUS, MCI_STATUS_ITEM | MCI_TRACK, (DWORD)&mciStatusParms);
+		  CD_Audio->tracks[i].track_type = mciStatusParms.dwReturn;// MCI_CDA_TRACK_AUDIO = 1088, MCI_CDA_TRACK_OTHER = 1089
+
+          CD_Audio->tracks[i].playing_time_minute = MCI_MSF_MINUTE(CD_Audio->tracks[i].track_length);
+          CD_Audio->tracks[i].playing_time_second = MCI_MSF_SECOND(CD_Audio->tracks[i].track_length);
+
+		}
+
+		/*
+		MCI_PLAY_PARMS playParams;
+        MCIDEVICEID devID = open.wDeviceID;
+        playParams.dwCallback = 0;
+        playParams.dwFrom = 0;
+        playParams.dwTo = 0;
+        err = mciSendCommand(devID, MCI_PLAY, (DWORD)MCI_WAIT, (DWORD)(LPVOID)&playParams );
+		if ( err )
+			__debugbreak();*/
+    }
+}
+
+void CDaudio::CDAudioPlay(int TrackID)
+{ 
+  DWORD flags;
+
+
+
+  //DWORD lengthTrack = LengthTrack(TrackID);
+  mciPlayParms.dwFrom = MCI_MAKE_TMSF(TrackID, 0, 0, 0); 
+ // mciPlayParms.dwTo   = MCI_MAKE_TMSF(TrackID, CD_Audio->tracks[TrackID].playing_time_minute, 
+	//CD_Audio->tracks[TrackID].playing_time_second, 0);
+  flags = MCI_FROM;// | MCI_TO;
+  if (mciSendCommand(open.wDeviceID, MCI_PLAY, flags, (DWORD)&mciPlayParms))
+  {
+    Log::Warning(L"audio track is corrupt");
+    return;  
+  }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Media/Audio/AudioCD.h	Thu Sep 25 10:39:49 2014 +0600
@@ -0,0 +1,36 @@
+#define WIN32_LEAN_AND_MEAN
+#include <windows.h>
+
+#include <MMSystem.h>
+//#pragma comment(lib, "winmm.lib")
+struct CDAudioTrack
+{
+  int track_length;
+  int track_type;
+  int playing_time_minute;
+  int playing_time_second;
+  int position;
+};
+
+class CDaudio
+{
+  private:
+    MCI_OPEN_PARMS open;
+    MCI_SET_PARMS mciSetParms;
+	MCI_PLAY_PARMS mciPlayParms;
+    int number_of_tracks;
+    CDAudioTrack tracks[20];
+
+  public:
+
+    CDaudio()
+    {
+      ZeroMemory(&open, sizeof(open));
+      number_of_tracks = 0;
+      memset(&tracks, 0, sizeof(CDAudioTrack) * 20);
+    }
+
+    void CDRomOpen(bool bOpenDrive, char *drive);
+    void CDAudioPlay(int TrackID);
+};
+extern class CDaudio *CD_Audio;
\ No newline at end of file
--- a/Media/Audio/AudioPlayer.cpp	Fri Sep 19 18:03:18 2014 +0600
+++ b/Media/Audio/AudioPlayer.cpp	Thu Sep 25 10:39:49 2014 +0600
@@ -84,8 +84,12 @@
   {
     for ( uint i = 1; i < pSoundList->sNumSounds; ++i )
     {
+		//if ( i == 41 )
+			//__debugbreak();
       sprintf(pSoundName, "%s", pSL_Sounds[i].pSoundName);
       pSoundDesc = &pSoundList->pSL_Sounds[i];
+	  //if ( pSL_Sounds[i].uSoundID == 75 )
+	    //__debugbreak();
       if ( pSoundList->pSL_Sounds[i].eType != SOUND_DESC_SYSTEM )
         continue;
       pSoundList->pSL_Sounds[i].pSoundData[0] = ::LoadSound(pSoundName, (SoundData *)-1, pSL_Sounds[i].uSoundID); // Ritor result crash exe file
@@ -532,10 +536,7 @@
   int v52; // eax@104
   float v53; // ST0C_4@106
   float v54; // ST04_4@106
-//  SoundDesc *pSoundDesc; // edx@107
-//  SpriteObject *pLayingItem3; // eax@114
   signed int v62; // esi@133
-//  int v68; // eax@143
   unsigned int v86; // [sp+14h] [bp-60h]@84
   RenderVertexSoft pRenderVertexSoft; // [sp+24h] [bp-50h]@1
   int v90; // [sp+58h] [bp-1Ch]@68
@@ -606,11 +607,7 @@
         if ( AIL_sample_status(pMixerChannels[j].hSample) == AIL::Sample::Done )
         {
           AIL_init_sample(pMixerChannels[j].hSample);
-          char *p = (char *)pSoundList->pSL_Sounds[sound_id].pSoundData[sound_data_id];
-          //if (sound_data_id == 0)  p = p + 4;//for RIFF
-		  //if ( eSoundID == 75 )// Ritor1: include +7 for pSounds[20]
-			  //p = p + 7;
-          AIL_set_sample_file(pMixerChannels[j].hSample, p, -1);
+          AIL_set_sample_file(pMixerChannels[j].hSample, pSoundList->pSL_Sounds[sound_id].pSoundData[sound_data_id]->pData, -1);
           if ( sample_volume == 10000 )
             sample_volume = uMasterVolume;
           if (uVolume)
@@ -654,30 +651,25 @@
             FreeChannel(&pMixerChannels[13]);
       }*/
       AIL_init_sample(pMixerChannels[13].hSample);
-      char *p = (char *)pSoundList->pSL_Sounds[sound_id].pSoundData[sound_data_id];
-      if (sound_data_id == 0)
-        p = p + 4;//for RIFF
-	  if ( eSoundID == 75 )//  Ritor1: include +7 for pSounds[20]
-		  p = p + 7;
-       AIL_set_sample_file(pMixerChannels[13].hSample, p, -1);
-       if ( sample_volume == 10000 )
-         sample_volume = uMasterVolume;
-       if (uVolume)
-         sample_volume = uVolume;
-       AIL_set_sample_volume(pMixerChannels[13].hSample, sample_volume);
-       int object_type = PID_TYPE(pid),
-           object_id = PID_ID(pid);
-       if (uNumRepeats)
-         AIL_set_sample_loop_count(pMixerChannels[13].hSample, uNumRepeats - 1);
-       pMixerChannels[13].uSourceTrackIdx = sound_id;
-       pMixerChannels[13].source_pid = pid;
-       pMixerChannels[13].uSourceTrackID = eSoundID;
-       int rval = AIL_start_sample(pMixerChannels[13].hSample);//no sound chest close 
-       if ( sPlaybackRate )
-         AIL_set_sample_playback_rate(pMixerChannels[13].hSample, sPlaybackRate);
-       if (object_type == OBJECT_Player)
-         AIL_sample_ms_position(pMixerChannels[13].hSample, &sLastTrackLengthMS, 0);
-       return;
+      AIL_set_sample_file(pMixerChannels[13].hSample, pSoundList->pSL_Sounds[sound_id].pSoundData[sound_data_id]->pData, -1);
+      if ( sample_volume == 10000 )
+        sample_volume = uMasterVolume;
+      if (uVolume)
+        sample_volume = uVolume;
+      AIL_set_sample_volume(pMixerChannels[13].hSample, sample_volume);
+      int object_type = PID_TYPE(pid),
+        object_id = PID_ID(pid);
+      if (uNumRepeats)
+        AIL_set_sample_loop_count(pMixerChannels[13].hSample, uNumRepeats - 1);
+      pMixerChannels[13].uSourceTrackIdx = sound_id;
+      pMixerChannels[13].source_pid = pid;
+      pMixerChannels[13].uSourceTrackID = eSoundID;
+      int rval = AIL_start_sample(pMixerChannels[13].hSample);//no sound chest close 
+      if ( sPlaybackRate )
+        AIL_set_sample_playback_rate(pMixerChannels[13].hSample, sPlaybackRate);
+      if (object_type == OBJECT_Player)
+        AIL_sample_ms_position(pMixerChannels[13].hSample, &sLastTrackLengthMS, 0);
+      return;
     }
     else if (pid < 0)    // exclusive sounds - no override (close chest)
     {
@@ -699,9 +691,8 @@
         {
           AIL_init_sample(pMixerChannels[j].hSample);
           char *p = (char *)pSoundList->pSL_Sounds[sound_id].pSoundData[sound_data_id];
-          if (sound_data_id == 0)  p = p + 4;//for RIFF
-		  if ( eSoundID == 75 )//  Ritor1: include +7 for pSounds[20]
-			  p = p + 7;
+          if (sound_data_id == 0)  
+			  p = p + 4;//for RIFF
           AIL_set_sample_file(pMixerChannels[j].hSample, p, -1);
           if ( sample_volume == 10000 )
             sample_volume = uMasterVolume;
@@ -2711,13 +2702,9 @@
   {
     pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uCompressedSize = pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uDecompressedSize;
     if ( pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uDecompressedSize )
-    {
       ReadFile(pAudioPlayer->hAudioSnd, pOutBuff->pData, pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uDecompressedSize, &NumberOfBytesRead, 0);// Ritor1: pSounds[20]
-    }
     else
-    {
       MessageBoxW(nullptr, L"Can't load sound file!", L"E:\\WORK\\MSDEV\\MM7\\MM7\\Code\\Sound.cpp:448", 0);
-    }
   }
   else
   {
@@ -2726,9 +2713,18 @@
     zlib::MemUnzip(pOutBuff->pData, &pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uDecompressedSize, (const void *)uID, pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uCompressedSize);
     free((void *)uID);
   }
+
   if ( pOutBuff )
   {
     pOutBuff->uDataSize = pAudioPlayer->pSoundHeaders[uFindSound_BinSearch_ResultID].uDecompressedSize;
+
+    if ( uID == SOUND_StartMainChoice02 )//Ritor1: code included (BUG)
+    {
+      char *p = (char *)pOutBuff->pData;
+      p = p+7;
+      memcpy(&pOutBuff->pData, p, NumberOfBytesRead - 7);
+	  pOutBuff->uDataSize = NumberOfBytesRead - 7;
+    }
     uLastLoadedSoundID = 0;
     if ( pSounds[0].pSoundData )
     {
--- a/Media/Audio/AudioPlayer.h	Fri Sep 19 18:03:18 2014 +0600
+++ b/Media/Audio/AudioPlayer.h	Thu Sep 25 10:39:49 2014 +0600
@@ -75,22 +75,29 @@
 {
   SOUND_Invalid = 0,
   SOUND_EnteringAHouse = 6,
-  SOUND_7 = 7,
-  SOUND_8 = 0x8,
-  SOUND_24 = 24,
+  SOUND_WoodDRClose = 7,
+  SOUND_Explosion = 0x8,
+  SOUND_20 = 0x14,
+  SOUND_21 = 0x15,
+  SOUND_23 = 0x17,
+  SOUND_24 = 0x18,
   SOUND_error = 27,
+  SOUND_47 = 0x2F,
+  SOUND_48 = 0x30,
+  SOUND_50 = 50,
   SOUND_RunAlongWater = 63,
   SOUND_RunAlong3DModel = 64,
   SOUND_Button = 66,
   SOUND_67 = 67,
   SOUND_71 = 71,
-  SOUND_Button2 = 75,
+  SOUND_StartMainChoice02 = 75,
   SOUND_78 = 78,
   SOUND_80 = 80,
   SOUND_81 = 81,
   SOUND_83 = 83,
   SOUND_84 = 84,
   SOUND_85 = 85,
+  SOUND_89 = 89,
   SOUND_WalkAlongWater = 102,
   SOUND_WalkAlong3DModel = 103,
   SOUND_Arcomage_LoseResources = 0x78,
@@ -111,14 +118,26 @@
   SOUND_PlayGryphonheartsTrumpet = 135, // 87
   SOUND_GoldReceived = 0xC8,
   SOUND_203 = 203,
+  SOUND_204 = 204,
   SOUND_206 = 206,
   SOUND_207 = 207,
   SOUND_OpenChest = 208,
   SOUND_PlayerCantCastSpell = 0xD1,
+  SOUND_210 = 0xD2,
   SOUND_EatApple = 211, // D3
+  SOUND_215 = 0xD7,
   SOUND_Bell = 0xD9,
+  SOUND_shurch = 0xDA, //218
+  SOUND_219 = 0xDB,
+  SOUND_221 = 0xDD,
+  SOUND_222 = 0xDE,
+  SOUND_224 = 0xE0,
+  SOUND_225 = 0xE1,
+  SOUND_226 = 0xE2,
+  SOUND_227 = 0xE3,
   SOUND_OpenBook = 230,
   SOUND_CloseBook = 231,
+  SOUND_hf445a = 0x169C,
   SOUND_11090 = 11090,
   SOUND_12040 = 12040,
   SOUND_Arena_Welcome = 14060,
@@ -241,6 +260,17 @@
   SOUND_DESC_LOCK = 0x4,
 };
 
+struct TSearchRec
+{
+int Time;
+int Size;
+int Attr;
+char Name[32];
+int ExcludeAttr;
+int FindHandle;
+_WIN32_FIND_DATAA FindData;
+} ;
+
 /*  326 */
 enum SOUND_DESC_FLAGS
 {