diff --git a/build/engine/sounds/actor/step/default1.ogg b/build/engine/sounds/actor/step/default1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..10bddbf3524db9d5baa225f54dbb1b7b1567be47 Binary files /dev/null and b/build/engine/sounds/actor/step/default1.ogg differ diff --git a/build/engine/sounds/actor/step/default2.ogg b/build/engine/sounds/actor/step/default2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..10bddbf3524db9d5baa225f54dbb1b7b1567be47 Binary files /dev/null and b/build/engine/sounds/actor/step/default2.ogg differ diff --git a/build/engine/sounds/actor/step/default3.ogg b/build/engine/sounds/actor/step/default3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..73a09e6a81665bd572d304d2b150b45ea63fe1d2 Binary files /dev/null and b/build/engine/sounds/actor/step/default3.ogg differ diff --git a/build/engine/sounds/actor/step/default4.ogg b/build/engine/sounds/actor/step/default4.ogg new file mode 100644 index 0000000000000000000000000000000000000000..3f2e4af404716328ecf97ce14dd1b8936bae4698 Binary files /dev/null and b/build/engine/sounds/actor/step/default4.ogg differ diff --git a/build/engine/sounds/actor/step/earth1.ogg b/build/engine/sounds/actor/step/earth1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..35be9058f776be270fc07b29c21256af2a2d08cf Binary files /dev/null and b/build/engine/sounds/actor/step/earth1.ogg differ diff --git a/build/engine/sounds/actor/step/earth2.ogg b/build/engine/sounds/actor/step/earth2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..2c86be24cdfe51c1b827992981fa468603206cc9 Binary files /dev/null and b/build/engine/sounds/actor/step/earth2.ogg differ diff --git a/build/engine/sounds/actor/step/earth3.ogg b/build/engine/sounds/actor/step/earth3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..a61dd0549a6f6167863832251477bc1a5d4804ee Binary files /dev/null and b/build/engine/sounds/actor/step/earth3.ogg differ diff --git a/build/engine/sounds/actor/step/earth4.ogg b/build/engine/sounds/actor/step/earth4.ogg new file mode 100644 index 0000000000000000000000000000000000000000..fe7ba8a7f10da38a5bb688d73f5df1d781473dfe Binary files /dev/null and b/build/engine/sounds/actor/step/earth4.ogg differ diff --git a/build/engine/sounds/actor/step/grass1.ogg b/build/engine/sounds/actor/step/grass1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..f038d57c7acabb79c2b535e8f47f861fa80937e3 Binary files /dev/null and b/build/engine/sounds/actor/step/grass1.ogg differ diff --git a/build/engine/sounds/actor/step/grass2.ogg b/build/engine/sounds/actor/step/grass2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..f3d4b55338dd8b27fa8017685c595c0380dbabda Binary files /dev/null and b/build/engine/sounds/actor/step/grass2.ogg differ diff --git a/build/engine/sounds/actor/step/grass3.ogg b/build/engine/sounds/actor/step/grass3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..329af390d67654b88daf923f2b079a0b85dca254 Binary files /dev/null and b/build/engine/sounds/actor/step/grass3.ogg differ diff --git a/build/engine/sounds/actor/step/grass4.ogg b/build/engine/sounds/actor/step/grass4.ogg new file mode 100644 index 0000000000000000000000000000000000000000..989c27d6d14dde7a7d7435d1abd6ef0c08776c01 Binary files /dev/null and b/build/engine/sounds/actor/step/grass4.ogg differ diff --git a/build/engine/sounds/actor/step/gravel1.ogg b/build/engine/sounds/actor/step/gravel1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..c85b6f54783885149cb551f0b451e0f5ee3f62eb Binary files /dev/null and b/build/engine/sounds/actor/step/gravel1.ogg differ diff --git a/build/engine/sounds/actor/step/gravel2.ogg b/build/engine/sounds/actor/step/gravel2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..2e0aa06f236aa1a2cadf30a8dc485091381cdc3e Binary files /dev/null and b/build/engine/sounds/actor/step/gravel2.ogg differ diff --git a/build/engine/sounds/actor/step/metal_plate1.ogg b/build/engine/sounds/actor/step/metal_plate1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..fed2f89c008b638eaa51de437aa094c8df607b35 Binary files /dev/null and b/build/engine/sounds/actor/step/metal_plate1.ogg differ diff --git a/build/engine/sounds/actor/step/metal_plate2.ogg b/build/engine/sounds/actor/step/metal_plate2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..3c34feb6bb8f124952662c44f3f30ea77dd88453 Binary files /dev/null and b/build/engine/sounds/actor/step/metal_plate2.ogg differ diff --git a/build/engine/sounds/actor/step/metal_plate3.ogg b/build/engine/sounds/actor/step/metal_plate3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..10f64e0ed1697a0e3bf2a0b2a95848c6cf38344d Binary files /dev/null and b/build/engine/sounds/actor/step/metal_plate3.ogg differ diff --git a/build/engine/sounds/actor/step/metal_plate4.ogg b/build/engine/sounds/actor/step/metal_plate4.ogg new file mode 100644 index 0000000000000000000000000000000000000000..70a87c80702b5878707e3ff9229a608069d50ce4 Binary files /dev/null and b/build/engine/sounds/actor/step/metal_plate4.ogg differ diff --git a/build/engine/sounds/actor/step/new_wood1.ogg b/build/engine/sounds/actor/step/new_wood1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..47c65ba7dc20fd5662b26dbf2006251f306aa76b Binary files /dev/null and b/build/engine/sounds/actor/step/new_wood1.ogg differ diff --git a/build/engine/sounds/actor/step/new_wood2.ogg b/build/engine/sounds/actor/step/new_wood2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..8b3a7ef404310275c0c001fbed24ae3f04242306 Binary files /dev/null and b/build/engine/sounds/actor/step/new_wood2.ogg differ diff --git a/build/engine/sounds/actor/step/new_wood3.ogg b/build/engine/sounds/actor/step/new_wood3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..bc86b78d3a5ca0bf2740cb2fceec9f245d316ec2 Binary files /dev/null and b/build/engine/sounds/actor/step/new_wood3.ogg differ diff --git a/build/engine/sounds/actor/step/new_wood4.ogg b/build/engine/sounds/actor/step/new_wood4.ogg new file mode 100644 index 0000000000000000000000000000000000000000..1b4f161016511b0c11cb5bcfa0382288cb1fcf5a Binary files /dev/null and b/build/engine/sounds/actor/step/new_wood4.ogg differ diff --git a/build/engine/sounds/actor/step/t_water1.ogg b/build/engine/sounds/actor/step/t_water1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..9f4439fa1374a449553e27cace2e27529a628f16 Binary files /dev/null and b/build/engine/sounds/actor/step/t_water1.ogg differ diff --git a/build/engine/sounds/actor/step/t_water2.ogg b/build/engine/sounds/actor/step/t_water2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..6917fc69f77e70d3d5e8530a72e6855a983b2397 Binary files /dev/null and b/build/engine/sounds/actor/step/t_water2.ogg differ diff --git a/build/engine/sounds/actor/step/tin1.ogg b/build/engine/sounds/actor/step/tin1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..3f46493f0495972c6dd575da3965a4dc40cc7103 Binary files /dev/null and b/build/engine/sounds/actor/step/tin1.ogg differ diff --git a/build/engine/sounds/actor/step/tin2.ogg b/build/engine/sounds/actor/step/tin2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..f24e21407c78a4cc3062e38d9f47e9f34edfb638 Binary files /dev/null and b/build/engine/sounds/actor/step/tin2.ogg differ diff --git a/build/engine/sounds/actor/step/tin3.ogg b/build/engine/sounds/actor/step/tin3.ogg new file mode 100644 index 0000000000000000000000000000000000000000..29e734b64bec62da25d71e30a0fe33c7b0654eb2 Binary files /dev/null and b/build/engine/sounds/actor/step/tin3.ogg differ diff --git a/build/engine/sounds/actor/step/tin4.ogg b/build/engine/sounds/actor/step/tin4.ogg new file mode 100644 index 0000000000000000000000000000000000000000..0939da1dedf474b6bed20e32b3b52f2de386fb89 Binary files /dev/null and b/build/engine/sounds/actor/step/tin4.ogg differ diff --git a/build/engine/sounds/actor/step/wpn_large1.ogg b/build/engine/sounds/actor/step/wpn_large1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..6eaa45b21f4569f11addc776c38f26bf5b815b9d Binary files /dev/null and b/build/engine/sounds/actor/step/wpn_large1.ogg differ diff --git a/build/engine/sounds/actor/step/wpn_large2.ogg b/build/engine/sounds/actor/step/wpn_large2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..acff58e339b5aa1897bd419a349909c0b466a496 Binary files /dev/null and b/build/engine/sounds/actor/step/wpn_large2.ogg differ diff --git a/build/engine/sounds/actor/step/wpn_small1.ogg b/build/engine/sounds/actor/step/wpn_small1.ogg new file mode 100644 index 0000000000000000000000000000000000000000..7fdca9aa57ded3ee490280c575ae828f70887b4b Binary files /dev/null and b/build/engine/sounds/actor/step/wpn_small1.ogg differ diff --git a/build/engine/sounds/actor/step/wpn_small2.ogg b/build/engine/sounds/actor/step/wpn_small2.ogg new file mode 100644 index 0000000000000000000000000000000000000000..f960ee93b63f7a65179278c8da1fecda9cff536d Binary files /dev/null and b/build/engine/sounds/actor/step/wpn_small2.ogg differ diff --git a/source/game/GameData.cpp b/source/game/GameData.cpp index 8fc53d94b61887df04800338d759fc36166e3fde..44916e2a20265e6c6c56c7dc03da5f4ac3b28dc7 100644 --- a/source/game/GameData.cpp +++ b/source/game/GameData.cpp @@ -1184,7 +1184,7 @@ GameData::~GameData() for(int i = 0; i < MPT_COUNT; ++i) { // @TODO: SSCore_SndDelete3dInst() - mem_delete_a(m_pidFootstepSound[i]); + mem_delete_a(m_aFootstepSound[i]); } } @@ -1394,55 +1394,65 @@ void GameData::playFootstepSound(MTLTYPE_PHYSIC mtl_type, const float3 &f3Pos) { return; } - ID idSound = m_pidFootstepSound[mtl_type][rand() % iCount]; - SSCore_SndInstancePlay3d(idSound, false, false, (float3*)&f3Pos); + /*ID idSound = m_pidFootstepSound[mtl_type][rand() % iCount]; + SSCore_SndInstancePlay3d(idSound, false, false, (float3*)&f3Pos);*/ + IXSoundEmitter *pEmitter = m_aFootstepSound[mtl_type][rand() % iCount]; + if (pEmitter) + pEmitter->play(); } void GameData::loadFoostepsSounds() { Array<const char*> aSounds[MPT_COUNT]; - aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("actor/step/default1.ogg"); - aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("actor/step/default2.ogg"); - aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("actor/step/default3.ogg"); - aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("actor/step/default4.ogg"); + aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("sounds/actor/step/default1.ogg"); + aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("sounds/actor/step/default2.ogg"); + aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("sounds/actor/step/default3.ogg"); + aSounds[MTLTYPE_PHYSIC_CONCRETE].push_back("sounds/actor/step/default4.ogg"); - aSounds[MTLTYPE_PHYSIC_METAL].push_back("actor/step/metal_plate1.ogg"); - aSounds[MTLTYPE_PHYSIC_METAL].push_back("actor/step/metal_plate2.ogg"); - aSounds[MTLTYPE_PHYSIC_METAL].push_back("actor/step/metal_plate3.ogg"); - aSounds[MTLTYPE_PHYSIC_METAL].push_back("actor/step/metal_plate4.ogg"); + aSounds[MTLTYPE_PHYSIC_METAL].push_back("sounds/actor/step/metal_plate1.ogg"); + aSounds[MTLTYPE_PHYSIC_METAL].push_back("sounds/actor/step/metal_plate2.ogg"); + aSounds[MTLTYPE_PHYSIC_METAL].push_back("sounds/actor/step/metal_plate3.ogg"); + aSounds[MTLTYPE_PHYSIC_METAL].push_back("sounds/actor/step/metal_plate4.ogg"); - aSounds[MTLTYPE_PHYSIC_TREE].push_back("actor/step/new_wood1.ogg"); - aSounds[MTLTYPE_PHYSIC_TREE].push_back("actor/step/new_wood2.ogg"); - aSounds[MTLTYPE_PHYSIC_TREE].push_back("actor/step/new_wood3.ogg"); - aSounds[MTLTYPE_PHYSIC_TREE].push_back("actor/step/new_wood4.ogg"); + aSounds[MTLTYPE_PHYSIC_TREE].push_back("sounds/actor/step/new_wood1.ogg"); + aSounds[MTLTYPE_PHYSIC_TREE].push_back("sounds/actor/step/new_wood2.ogg"); + aSounds[MTLTYPE_PHYSIC_TREE].push_back("sounds/actor/step/new_wood3.ogg"); + aSounds[MTLTYPE_PHYSIC_TREE].push_back("sounds/actor/step/new_wood4.ogg"); - aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("actor/step/earth1.ogg"); - aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("actor/step/earth2.ogg"); - aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("actor/step/earth3.ogg"); - aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("actor/step/earth4.ogg"); + aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("sounds/actor/step/earth1.ogg"); + aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("sounds/actor/step/earth2.ogg"); + aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("sounds/actor/step/earth3.ogg"); + aSounds[MTLTYPE_PHYSIC_GROUD_SAND].push_back("sounds/actor/step/earth4.ogg"); - aSounds[MTLTYPE_PHYSIC_WATER].push_back("actor/step/t_water1.ogg"); - aSounds[MTLTYPE_PHYSIC_WATER].push_back("actor/step/t_water2.ogg"); + aSounds[MTLTYPE_PHYSIC_WATER].push_back("sounds/actor/step/t_water1.ogg"); + aSounds[MTLTYPE_PHYSIC_WATER].push_back("sounds/actor/step/t_water2.ogg"); - aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("actor/step/grass1.ogg"); - aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("actor/step/grass2.ogg"); - aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("actor/step/grass3.ogg"); - aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("actor/step/grass4.ogg"); + aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("sounds/actor/step/grass1.ogg"); + aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("sounds/actor/step/grass2.ogg"); + aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("sounds/actor/step/grass3.ogg"); + aSounds[MTLTYPE_PHYSIC_LEAF_GRASS].push_back("sounds/actor/step/grass4.ogg"); //aSounds[MTLTYPE_PHYSIC_GLASS].push_back("actor/step/.ogg"); //aSounds[MTLTYPE_PHYSIC_PLASTIC].push_back("actor/step/.ogg"); //aSounds[MTLTYPE_PHYSIC_FLESH].push_back("actor/step/.ogg"); + IXSoundSystem *pSound = (IXSoundSystem*)(Core_GetIXCore()->getPluginManager()->getInterface(IXSOUNDSYSTEM_GUID)); + IXSoundLayer *pMasterLayer = pSound->findLayer("master"); + + if (!pMasterLayer) + return; + for(int i = 0; i < MPT_COUNT; ++i) { Array<const char*> *paSounds = &aSounds[i]; int jl = paSounds->size(); m_iFootstepSoundCount[i] = jl; - m_pidFootstepSound[i] = jl ? new ID[jl] : NULL; + m_aFootstepSound[i] = (jl ? new IXSoundEmitter*[jl] : NULL); for(int j = 0; j < jl; ++j) { - m_pidFootstepSound[i][j] = SSCore_SndCreate3dInst(paSounds[0][j], SX_SOUND_CHANNEL_GAME, 100); + m_aFootstepSound[i][j] = pMasterLayer->newSoundEmitter(paSounds[0][j], SOUND_DTYPE_3D); + //m_aFootstepSound[i][j] = SSCore_SndCreate3dInst(paSounds[0][j], SX_SOUND_CHANNEL_GAME, 100); } } } diff --git a/source/game/GameData.h b/source/game/GameData.h index 3a858aebeb01d7bde4d052e60d3bd2e80d0d2dc2..af9f47b8620dcc90182420f9613d5d97b358b839 100644 --- a/source/game/GameData.h +++ b/source/game/GameData.h @@ -15,6 +15,7 @@ See the license in LICENSE #include "HUDcontroller.h" #include "GameStateManager.h" #include <light/IXLightSystem.h> +#include <xcommon/IXSoundSystem.h> class GameData { @@ -50,7 +51,8 @@ protected: void loadFoostepsSounds(); - ID *m_pidFootstepSound[MPT_COUNT]; + //ID *m_pidFootstepSound[MPT_COUNT]; + IXSoundEmitter **m_aFootstepSound[MPT_COUNT]; int m_iFootstepSoundCount[MPT_COUNT]; static void ccmd_forward_on(); diff --git a/source/xEngine/Engine.cpp b/source/xEngine/Engine.cpp index 3c31cdfb5159a617dfe6f9386c8d199ba272dacb..3203de1870e26d474d0ea2114c15827438e0bb47 100644 --- a/source/xEngine/Engine.cpp +++ b/source/xEngine/Engine.cpp @@ -170,10 +170,10 @@ bool XMETHODCALLTYPE CEngine::initGraphics(XWINDOW_OS_HANDLE hWindow, IXEngineCa oAudioDesc.uSampleRate = 44100; oAudioDesc.calc(); - /*IXSoundSystem *pSound = (IXSoundSystem*)(m_pCore->getPluginManager()->getInterface(IXSOUNDSYSTEM_GUID)); + IXSoundSystem *pSound = (IXSoundSystem*)(m_pCore->getPluginManager()->getInterface(IXSOUNDSYSTEM_GUID)); IXSoundLayer *pMasterLayer = pSound->createMasterLayer(&oAudioDesc, "master"); pMasterLayer->play(true); - IXSoundPlayer *pPlayer = pMasterLayer->newSoundPlayer("sounds/guitar_10.ogg", SOUND_DTYPE_2D); + /*IXSoundPlayer *pPlayer = pMasterLayer->newSoundPlayer("sounds/guitar_10.ogg", SOUND_DTYPE_2D); pPlayer->play();*/ /*IXSoundEmitter *pEmitter = pMasterLayer->newSoundEmitter("sounds/ak74_shoot.ogg", SOUND_DTYPE_2D); pEmitter->play();*/ @@ -186,7 +186,7 @@ bool XMETHODCALLTYPE CEngine::initGraphics(XWINDOW_OS_HANDLE hWindow, IXEngineCa Sleep(100); } }*/ - + LibReport(REPORT_MSG_LEVEL_NOTICE, "LIB sound initialized\n"); @@ -232,8 +232,6 @@ bool XMETHODCALLTYPE CEngine::initGraphics(XWINDOW_OS_HANDLE hWindow, IXEngineCa - LibReport(REPORT_MSG_LEVEL_NOTICE, "LIB sound initialized\n"); - // init game SGame_0Create((HWND)hWindow, true);