- Joined
- Jan 9, 2009
- Messages
- 614
- Reaction score
- 152
Pretty easy to enable, but I havne't seen it in many servers.
Step 1. Open ZSoundEngine.h, search for "m_b3DSoundUpdate;", underneath that add
void Set3DSound( bool b3DSound ) { m_b3DSound = b3DSound; }
Step 2. Open ZSoundEngine.cpp, search for void ZSoundEngine:laySEFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
Replace that entire function with this:
Step 3. Search for this void ZSoundEngine:laySEReload(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer), replace entire function with this:
Step 4. Open ZConfiguration.cpp, search for childElement.GetChildContents(&m_Audio.b3DSound, ZTOK_AUDIO_3D_SOUND); uncomment, and comment the line below it.
Step 5. In ZConfiguration.cpp, search for CreateChildElement(ZTOK_AUDIO_3D_SOUND), and replace it with this:
Step 6. Open ZOptionInterface.cpp, search for Effect3D, , and uncomment the lines related to it
Step 7 (xml work).Decompile your default.mrs, and then open option.xml, search for Effect3d, uncomment it by removing <!-- before it and the --> after it, and replace that code with this code:
Step 8. Recompile, log in and test, if you have any issues post them here and i'll do my best to assist.
Credits: Andres for the ZSoundEngine edits.
Step 1. Open ZSoundEngine.h, search for "m_b3DSoundUpdate;", underneath that add
void Set3DSound( bool b3DSound ) { m_b3DSound = b3DSound; }
Step 2. Open ZSoundEngine.cpp, search for void ZSoundEngine:laySEFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
Replace that entire function with this:
void ZSoundEngine:laySEFire(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
{
if( !m_bSoundEnable || !pDesc ) return;
if( pDesc->m_nType.Ref() == MMIT_RANGE || pDesc->m_nType.Ref() == MMIT_CUSTOM )
{
char* szSndName = pDesc->m_szFireSndName;
if(bPlayer)
{
char szBuffer[64];
//3DSound
if(ZGetConfiguration()->GetAudio()->b3DSound)
{
sprintf( szBuffer, "%s_optional_2d", szSndName );
}
else
{
sprintf( szBuffer, "%s_2d", szSndName );
}
#ifdef _SOUND_LOG
mlog("%s stereo 2d sound is played..\n",szBuffer);
#endif
char* szDefault;
if (pDesc->m_nType.Ref() == MMIT_RANGE)
//3DSound
szDefault = szSndName;
else
szDefault = szSndName;
PlaySoundElseDefault(szBuffer,szDefault,rvector(x,y,z),bPlayer);
return;
}
PlaySoundElseDefault(szSndName,"we_rifle_fire",rvector(x,y,z),bPlayer);
}
}
Step 3. Search for this void ZSoundEngine:laySEReload(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer), replace entire function with this:
void ZSoundEngine:laySEReload(MMatchItemDesc *pDesc, float x, float y, float z, bool bPlayer)
{
if( !m_bSoundEnable || !pDesc ) return;
if(pDesc->m_nType.Ref() == MMIT_RANGE)
{
char* szSndName = pDesc->m_szReloadSndName;
if(bPlayer)
{
char szBuffer[64];
//3DSound
if(ZGetConfiguration()->GetAudio()->b3DSound)
{
sprintf( szBuffer, "%s_optional_2d", szSndName );
}
else
{
sprintf( szBuffer, "%s_2d", szSndName );
}
#ifdef _SOUND_LOG
mlog("%s stereo 2d sound is played..\n",szBuffer);
#endif
//3DSound
PlaySoundElseDefault(szSndName,"we_rifle_reload_2d",rvector(x,y,z),bPlayer);
}
PlaySoundElseDefault(szSndName,"we_rifle_reload",rvector(x,y,z),bPlayer);
}
}
Step 4. Open ZConfiguration.cpp, search for childElement.GetChildContents(&m_Audio.b3DSound, ZTOK_AUDIO_3D_SOUND); uncomment, and comment the line below it.
Step 5. In ZConfiguration.cpp, search for CreateChildElement(ZTOK_AUDIO_3D_SOUND), and replace it with this:
parentElement.AppendText("\n\t\t");
aElement = parentElement.CreateChildElement(ZTOK_AUDIO_3D_SOUND);
if(m_Audio.b3DSound==true) strcpy(temp, "true");
else strcpy(temp, "false");
aElement.SetContents(temp);
Step 6. Open ZOptionInterface.cpp, search for Effect3D, , and uncomment the lines related to it
Step 7 (xml work).Decompile your default.mrs, and then open option.xml, search for Effect3d, uncomment it by removing <!-- before it and the --> after it, and replace that code with this code:
<LABEL item="Label" parent="AudioOptionGroup">
<FONT>FONTa9</FONT>
<BOUNDS>
<X>3</X>
<Y>131</Y>
<W>100</W>
<H>24</H>
</BOUNDS>
<TEXT>3D Sound</TEXT>
</LABEL>
<BUTTON item="Effect3D" parent="AudioOptionGroup">
<BUTTONLOOK>Custom1ButtonLook</BUTTONLOOK>
<PUSHBUTTON/>
<BOUNDS>
<X>229</X>
<Y>131</Y>
<W>24</W>
<H>24</H>
</BOUNDS>
<ALIGN>
<HALIGN>right</HALIGN>
</ALIGN>
</BUTTON>
Step 8. Recompile, log in and test, if you have any issues post them here and i'll do my best to assist.
Credits: Andres for the ZSoundEngine edits.