Hello All,
As the title insists I'm having a problem with DXSound, or something based around that.
It seems that for some unknown reason (To me anyways) that all sound in-game works absolutely fine, that is until you hit someone and it won't make the normal weapon sound (Or any attacking sound).
Has anyone come across this and found a fix.
P.S. I have checked my files against Eflyff's ones and they are more of less similar (nothing that would cause this bug), and I have also copied across mssmp3.asi and mssogg.msi files to ensure they work as intended too (sometimes get mssogg.asi crashing).
Source: Virtuous V19 (Mostly fixed if you can believe that aha).
Upgraded Source to VS2013
- - - Updated - - -
Ignore that, for anyone having the same problem.
In dsutil.cpp, under the CSoundManager::Play method, look for
Replace everything underneath (to the next curly brace) with the followingCode:D3DXVECTOR3 vPos = *pvPosition - m_vPosListener; FLOAT fRadian = sqrt( fabs ( vPos.x ) * fabs ( vPos.x ) + fabs ( vPos.z ) * fabs ( vPos.z ) );
Code:if( fRadian > 100.0f ) return FALSE; else if (fRadian <= 0.0) { D3DVECTOR vec; m_pDSListener->GetPosition(&vec); pSound->m_pBufferParams[dwIndex].vPosition.x = vec.x; pSound->m_pBufferParams[dwIndex].vPosition.y = vec.y; pSound->m_pBufferParams[dwIndex].vPosition.z = vec.z; } else if (fRadian < 1.0){ D3DXVECTOR3 Line1 = D3DXVECTOR3(0.0f, 0.0f, -1.0f); D3DXVECTOR3 Line2 = -vPos; //Line2 = m_world.m_vCenter - Line2; // Nomralize Vectors FLOAT vlength = static_cast<FLOAT>(sqrt((Line2.x * Line2.x) + (Line2.z * Line2.z))); Line2 = Line2 / vlength; // ¶óµð¾È ±¸Çϱâ FLOAT a = acos(D3DXVec3Dot(&Line1, &Line2)); //a = ( D3DX_PI * 2.0f ) - a; if (vPos.x < 0) a = (D3DX_PI * 2.0f) - a; a += -m_fTheta; vPos.x = (float)((int)(sin(a) * fRadian)); // ¿©±â (int)ij½ºÆÃ ¹Ù²ÙÁö ¸»°Í. (int)¾ÈÇϸé ÄÄÅÍ ¸®º×µÊ. vPos.z = (float)((int)(cos(a) * fRadian)); vPos.y = (float)((int)vPos.y); D3DVECTOR v; v.x = vPos.x; // Ȥ½Ã ¸ô¶ó ÀÌ·¸°Ô ÇØºÃ´Ù. v.y = vPos.y; v.z = vPos.z; pSound->m_pBufferParams[dwIndex].vPosition = v; // D3XVECTOR3¸¦ D3DVECTOR¿¡ ±×´ë·Î ³Ö¾îµµ µÇ³ª? } else{ D3DXVECTOR3 Line1 = D3DXVECTOR3(0.0f, 0.0f, -1.0f); D3DXVECTOR3 Line2 = -vPos; //Line2 = m_world.m_vCenter - Line2; // Nomralize Vectors FLOAT vlength = static_cast<FLOAT>(sqrt((Line2.x * Line2.x) + (Line2.z * Line2.z))); Line2 = Line2 / vlength; // ¶óµð¾È ±¸Çϱâ FLOAT a = acos(D3DXVec3Dot(&Line1, &Line2)); //a = ( D3DX_PI * 2.0f ) - a; if (vPos.x < 0) a = (D3DX_PI * 2.0f) - a; a += -m_fTheta; vPos.x = (float)((int)(sin(a) * fRadian)); // ¿©±â (int)ij½ºÆÃ ¹Ù²ÙÁö ¸»°Í. (int)¾ÈÇϸé ÄÄÅÍ ¸®º×µÊ. vPos.z = (float)((int)(cos(a) * fRadian)); vPos.y = (float)((int)vPos.y); D3DVECTOR v; v.x = vPos.x; // Ȥ½Ã ¸ô¶ó ÀÌ·¸°Ô ÇØºÃ´Ù. v.y = vPos.y; v.z = vPos.z; pSound->m_pBufferParams[dwIndex].vPosition = v; // D3XVECTOR3¸¦ D3DVECTOR¿¡ ±×´ë·Î ³Ö¾îµµ µÇ³ª? }




