MCPcopy Create free account
hub / github.com/StrongPC123/Far-Cry-1-Source-Full / CSoundSystem

Method CSoundSystem

CrySoundSystem/SoundSystem.cpp:235–393  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

233
234//////////////////////////////////////////////////////////////////////
235CSoundSystem::CSoundSystem(ISystem* pSystem, HWND hWnd) : CSoundSystemCommon(pSystem)
236{
237 GUARD_HEAP;
238 m_bOK=m_bInside=false;
239
240 if (!pSystem)
241 return;
242
243 m_fSFXVolume=1.0f;
244 m_fMusicVolume=1.0f;
245 m_pVisArea=NULL;
246
247 m_nSpeakerConfig=-1; //force to set
248 m_bPause=false;
249
250 m_pISystem = pSystem;
251 m_pILog=pSystem->GetILog();
252 m_pTimer=pSystem->GetITimer();
253 m_pStreamEngine=pSystem->GetStreamEngine();
254
255 m_itLastInactivePos=m_lstSoundSpotsInactive.end();
256 m_nInactiveSoundSpotsSize=0;
257 m_nBuffersLoaded=0;
258
259 m_nMinSoundPriority = 0;
260
261 m_pDSPUnitSFXFilter=NULL;
262
263 m_fDirAttCone=0.0f;
264
265 for (int i=0;i<MAX_SOUNDSCALE_GROUPS;i++) m_fSoundScale[i]=1.0f;
266 memset(m_VisAreas,0,MAX_VIS_AREAS*sizeof(int));
267
268 m_nMuteRefCnt=0;
269
270 m_nSampleRate=m_pCVarSampleRate->GetIVal();
271
272 //if (!m_pCVARSoundEnable->GetIVal())
273 // return;
274
275 if (m_pCVARDummySound->GetIVal())
276 return; // creates dummy sound system
277
278 if (CS_GetVersion() != CS_VERSION)
279 {
280 m_pILog->Log("Music:Init:Incorrect DLL version for CRYSOUND: Need %.2f\n",CS_VERSION);
281 return;
282 }
283
284#if !defined(_DEBUG)// || defined(WIN64)
285 CS_SetMemorySystem(NULL,NULL,CrySound_Alloc,CrySound_Realloc,CrySound_Free);
286#endif
287
288 m_pILog->Log("------------------------------------------CRYSOUND VERSION=%f\n",CS_GetVersion());
289
290 //configure CS's stability under windows
291 //CS_SetBufferSize(CS_BUFFERSIZE);
292

Callers

nothing calls this directly

Calls 6

GetILogMethod · 0.80
GetITimerMethod · 0.80
GetStreamEngineMethod · 0.80
GetIValMethod · 0.80
endMethod · 0.45
LogMethod · 0.45

Tested by

no test coverage detected