forked from metin-server/m2dev-client-src
New sound system & removed miles
This commit is contained in:
@@ -9,6 +9,7 @@ set_target_properties(UserInterface PROPERTIES LINK_FLAGS "/level='requireAdmini
|
||||
)
|
||||
|
||||
target_link_libraries(UserInterface
|
||||
AudioLib
|
||||
Discord
|
||||
EffectLib
|
||||
EterBase
|
||||
@@ -19,7 +20,6 @@ target_link_libraries(UserInterface
|
||||
EterPack
|
||||
EterPythonLib
|
||||
GameLib
|
||||
MilesLib
|
||||
PRTerrainLib
|
||||
ScriptLib
|
||||
SpeedTreeLib
|
||||
@@ -31,7 +31,6 @@ target_link_libraries(UserInterface
|
||||
DirectX
|
||||
Granny
|
||||
SpeedTree
|
||||
MilesSoundSystem
|
||||
Python
|
||||
WebView
|
||||
|
||||
|
||||
@@ -1051,10 +1051,10 @@ bool CPythonApplication::Create(PyObject * poSelf, const char * c_szName, int wi
|
||||
if (!m_pySystem.IsNoSoundCard())
|
||||
{
|
||||
// Sound
|
||||
if (!m_SoundManager.Create())
|
||||
if (!m_SoundEngine.Initialize())
|
||||
{
|
||||
// NOTE : Áß±¹ÃøÀÇ ¿äûÀ¸·Î »ý·«
|
||||
// LogBox(ApplicationStringTable_GetStringz(IDS_WARN_NO_SOUND_DEVICE));
|
||||
TraceError("Failed to initialize sound manager!");
|
||||
return false; // Is this important enough to stop the client?
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
#include "gamelib/ItemManager.h"
|
||||
#include "gamelib/FlyingObjectManager.h"
|
||||
#include "gamelib/GameEventManager.h"
|
||||
#include "milesLib/SoundManager.h"
|
||||
#include "AudioLib/SoundEngine.h"
|
||||
|
||||
#include "PythonEventManager.h"
|
||||
#include "PythonPlayer.h"
|
||||
@@ -310,7 +310,7 @@ class CPythonApplication : public CMSApplication, public CInputKeyboard, public
|
||||
CTimer m_timer;
|
||||
|
||||
CLightManager m_LightManager;
|
||||
CSoundManager m_SoundManager;
|
||||
SoundEngine m_SoundEngine;
|
||||
CFlyingManager m_FlyingManager;
|
||||
CRaceManager m_RaceManager;
|
||||
CGameEventManager m_GameEventManager;
|
||||
|
||||
@@ -91,9 +91,9 @@ void CPythonApplication::__UpdateCamera()
|
||||
// Sound Setting
|
||||
const D3DXVECTOR3 & c_rv3CameraDirection = pMainCamera->GetView();
|
||||
const D3DXVECTOR3 & c_rv3CameraUp = pMainCamera->GetUp();
|
||||
m_SoundManager.SetPosition(m_v3CenterPosition.x, m_v3CenterPosition.y, m_v3CenterPosition.z); // Listener - 캐릭터 위치
|
||||
m_SoundManager.SetDirection(c_rv3CameraDirection.x, c_rv3CameraDirection.y, c_rv3CameraDirection.z, c_rv3CameraUp.x, c_rv3CameraUp.y, c_rv3CameraUp.z);
|
||||
m_SoundManager.Update();
|
||||
m_SoundEngine.SetListenerPosition(m_v3CenterPosition.x, m_v3CenterPosition.y, m_v3CenterPosition.z); // Listener - 캐릭터 위치
|
||||
m_SoundEngine.SetListenerOrientation(c_rv3CameraDirection.x, c_rv3CameraDirection.y, c_rv3CameraDirection.z, c_rv3CameraUp.x, c_rv3CameraUp.y, c_rv3CameraUp.z);
|
||||
m_SoundEngine.Update();
|
||||
//////////////////////
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ LRESULT CPythonApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam
|
||||
|
||||
if (m_isActivateWnd)
|
||||
{
|
||||
m_SoundManager.RestoreVolume();
|
||||
m_SoundEngine.RestoreVolume();
|
||||
|
||||
//////////////////
|
||||
|
||||
@@ -71,7 +71,7 @@ LRESULT CPythonApplication::WindowProcedure(HWND hWnd, UINT uiMsg, WPARAM wParam
|
||||
}
|
||||
else
|
||||
{
|
||||
m_SoundManager.SaveVolume();
|
||||
m_SoundEngine.SaveVolume(m_isMinimizedWnd);
|
||||
|
||||
//////////////////
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ void CPythonItem::TGroundItemInstance::__PlayDropSound(DWORD eItemType, const D3
|
||||
if (eItemType>=DROPSOUND_NUM)
|
||||
return;
|
||||
|
||||
CSoundManager::Instance().PlaySound3D(c_rv3Pos.x, c_rv3Pos.y, c_rv3Pos.z, ms_astDropSoundFileName[eItemType].c_str());
|
||||
SoundEngine::Instance().PlaySound3D(ms_astDropSoundFileName[eItemType].c_str(), c_rv3Pos.x, c_rv3Pos.y, c_rv3Pos.z);
|
||||
}
|
||||
|
||||
bool CPythonItem::TGroundItemInstance::Update()
|
||||
@@ -165,7 +165,7 @@ void CPythonItem::PlayUseSound(DWORD dwItemID)
|
||||
if (eItemType>=USESOUND_NUM)
|
||||
return;
|
||||
|
||||
CSoundManager::Instance().PlaySound2D(m_astUseSoundFileName[eItemType].c_str());
|
||||
SoundEngine::Instance().PlaySound2D(m_astUseSoundFileName[eItemType].c_str());
|
||||
}
|
||||
|
||||
|
||||
@@ -181,12 +181,12 @@ void CPythonItem::PlayDropSound(DWORD dwItemID)
|
||||
if (eItemType>=DROPSOUND_NUM)
|
||||
return;
|
||||
|
||||
CSoundManager::Instance().PlaySound2D(SGroundItemInstance::ms_astDropSoundFileName[eItemType].c_str());
|
||||
SoundEngine::Instance().PlaySound2D(SGroundItemInstance::ms_astDropSoundFileName[eItemType].c_str());
|
||||
}
|
||||
|
||||
void CPythonItem::PlayUsePotionSound()
|
||||
{
|
||||
CSoundManager::Instance().PlaySound2D(m_astUseSoundFileName[USESOUND_POTION].c_str());
|
||||
SoundEngine::Instance().PlaySound2D(m_astUseSoundFileName[USESOUND_POTION].c_str());
|
||||
}
|
||||
|
||||
DWORD CPythonItem::__GetDropSoundType(const CItemData& c_rkItemData)
|
||||
|
||||
@@ -1,18 +1,17 @@
|
||||
#include "StdAfx.h"
|
||||
#include "PythonApplication.h"
|
||||
|
||||
PyObject * sndPlaySound(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndPlaySound2D(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.PlaySound2D(szFileName);
|
||||
SoundEngine::Instance().PlaySound2D(szFileName);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndPlaySound3D(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndPlaySound3D(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
float fx;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &fx))
|
||||
@@ -23,58 +22,43 @@ PyObject * sndPlaySound3D(PyObject * poSelf, PyObject * poArgs)
|
||||
float fz;
|
||||
if (!PyTuple_GetFloat(poArgs, 2, &fz))
|
||||
return Py_BuildException();
|
||||
char * szFileName;
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 3, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.PlaySound3D(fx, fy, fz, szFileName);
|
||||
SoundEngine::Instance().PlaySound3D(szFileName, fx, fy, fz);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndPlayMusic(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndFadeInMusic(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.PlaySound2D(szFileName);
|
||||
SoundEngine::Instance().FadeInMusic(szFileName);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndFadeInMusic(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndFadeOutMusic(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.FadeInMusic(szFileName);
|
||||
SoundEngine::Instance().FadeOutMusic(szFileName);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndFadeOutMusic(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndFadeOutAllMusic(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.FadeOutMusic(szFileName);
|
||||
SoundEngine::Instance().FadeOutAllMusic();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndFadeOutAllMusic(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndFadeLimitOutMusic(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.FadeOutAllMusic();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndFadeLimitOutMusic(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
char * szFileName;
|
||||
char* szFileName;
|
||||
if (!PyTuple_GetString(poArgs, 0, &szFileName))
|
||||
return Py_BuildException();
|
||||
|
||||
@@ -82,95 +66,74 @@ PyObject * sndFadeLimitOutMusic(PyObject * poSelf, PyObject * poArgs)
|
||||
if (!PyTuple_GetFloat(poArgs, 1, &fLimitVolume))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.FadeLimitOutMusic(szFileName, fLimitVolume);
|
||||
SoundEngine::Instance().FadeOutMusic(szFileName, fLimitVolume);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndStopAllSound(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndStopAllSound(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.StopAllSound3D();
|
||||
SoundEngine::Instance().StopAllSound3D();
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndSetMusicVolume(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndSetMasterVolume(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
float fVolume;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &fVolume))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.SetMusicVolume(fVolume);
|
||||
SoundEngine::Instance().SetMasterVolume(fVolume);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndSetSoundVolumef(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndSetMusicVolume(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
float fVolume;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &fVolume))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.SetSoundVolume(fVolume);
|
||||
SoundEngine::Instance().SetMusicVolume(fVolume);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
|
||||
PyObject * sndSetSoundVolume(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndSetSoundVolumef(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
int iVolume;
|
||||
if (!PyTuple_GetInteger(poArgs, 0, &iVolume))
|
||||
float fVolume;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &fVolume))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.SetSoundVolume(iVolume);
|
||||
SoundEngine::Instance().SetSoundVolume(fVolume);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndSetSoundScale(PyObject * poSelf, PyObject * poArgs)
|
||||
PyObject* sndSetSoundVolume(PyObject* poSelf, PyObject* poArgs)
|
||||
{
|
||||
float fScale;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &fScale))
|
||||
float volume;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &volume))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.SetSoundScale(fScale);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
PyObject * sndSetAmbienceSoundScale(PyObject * poSelf, PyObject * poArgs)
|
||||
{
|
||||
float fScale;
|
||||
if (!PyTuple_GetFloat(poArgs, 0, &fScale))
|
||||
return Py_BuildException();
|
||||
|
||||
CSoundManager& rkSndMgr=CSoundManager::Instance();
|
||||
rkSndMgr.SetAmbienceSoundScale(fScale);
|
||||
SoundEngine::Instance().SetSoundVolume(volume / 100.0f);
|
||||
return Py_BuildNone();
|
||||
}
|
||||
|
||||
void initsnd()
|
||||
{
|
||||
static PyMethodDef s_methods[] =
|
||||
static PyMethodDef s_methods[] =
|
||||
{
|
||||
{ "PlaySound", sndPlaySound, METH_VARARGS },
|
||||
{ "PlaySound", sndPlaySound2D, METH_VARARGS },
|
||||
{ "PlaySound3D", sndPlaySound3D, METH_VARARGS },
|
||||
{ "PlayMusic", sndPlayMusic, METH_VARARGS },
|
||||
{ "FadeInMusic", sndFadeInMusic, METH_VARARGS },
|
||||
{ "FadeOutMusic", sndFadeOutMusic, METH_VARARGS },
|
||||
{ "FadeOutAllMusic", sndFadeOutAllMusic, METH_VARARGS },
|
||||
{ "FadeLimitOutMusic", sndFadeLimitOutMusic, METH_VARARGS },
|
||||
{ "StopAllSound", sndStopAllSound, METH_VARARGS },
|
||||
|
||||
{ "SetMusicVolumef", sndSetMusicVolume, METH_VARARGS },
|
||||
{ "SetMasterVolume", sndSetMasterVolume, METH_VARARGS },
|
||||
{ "SetMusicVolume", sndSetMusicVolume, METH_VARARGS },
|
||||
{ "SetSoundVolumef", sndSetSoundVolumef, METH_VARARGS },
|
||||
{ "SetSoundVolume", sndSetSoundVolume, METH_VARARGS },
|
||||
{ "SetSoundScale", sndSetSoundScale, METH_VARARGS },
|
||||
{ "SetAmbienceSoundScale", sndSetAmbienceSoundScale, METH_VARARGS },
|
||||
{ NULL, NULL, NULL },
|
||||
};
|
||||
|
||||
Py_InitModule("snd", s_methods);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ void CPythonSystem::ChangeSystem()
|
||||
else
|
||||
CScreen::SetShadowFlag(false);
|
||||
*/
|
||||
CSoundManager& rkSndMgr = CSoundManager::Instance();
|
||||
SoundEngine& rkSndMgr = SoundEngine::Instance();
|
||||
/*
|
||||
float fMusicVolume;
|
||||
if (0 == m_Config.music_volume)
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "eterPythonLib/StdAfx.h"
|
||||
#include "gameLib/StdAfx.h"
|
||||
#include "scriptLib/StdAfx.h"
|
||||
#include "milesLib/StdAfx.h"
|
||||
#include "AudioLib/StdAfx.h"
|
||||
#include "EffectLib/StdAfx.h"
|
||||
#include "PRTerrainLib/StdAfx.h"
|
||||
#include "SpeedTreeLib/StdAfx.h"
|
||||
|
||||
Reference in New Issue
Block a user