TGEA 1.7 Bug - SFX FMod module with obsolete function name
by David Wyand · in Torque Game Engine Advanced · 04/24/2008 (8:35 pm) · 1 replies
Greetings!
When I first dropped in the FMod library to be used by TGEA it wasn't being recognized by the SFX system. ie: FMod didn't show up as a choice in the Options dialog. After some digging I found that the SFX layer was built with v4.08.06, and since then one of the FMod function names has changed.
The culprit was FMOD_System_GetDriverName(). Starting with 4.11 (the latest is 4.15) this had been changed to FMOD_System_GetDriverInfo(), and its number of parameters has also changed. Because of this change the loading of the FMod DLL fails (as would its initialization if it were to be blindly loaded).
The fix is straight forward. Change line 34 of fmodFunctions.h from this:
to this:
You'll also need to replace the code that calls this function. That would be line 112 of sfxFMODProvider.cpp:
to this:
Finally you'll want to replace everything in engine/lib/fmod with the same versions that came with your FMod DLL. For me this was version 4.15, which so far is working out great.
- LightWave Dave
When I first dropped in the FMod library to be used by TGEA it wasn't being recognized by the SFX system. ie: FMod didn't show up as a choice in the Options dialog. After some digging I found that the SFX layer was built with v4.08.06, and since then one of the FMod function names has changed.
The culprit was FMOD_System_GetDriverName(). Starting with 4.11 (the latest is 4.15) this had been changed to FMOD_System_GetDriverInfo(), and its number of parameters has also changed. Because of this change the loading of the FMod DLL fails (as would its initialization if it were to be blindly loaded).
The fix is straight forward. Change line 34 of fmodFunctions.h from this:
FMOD_FUNCTION(FMOD_System_GetDriverName, (FMOD_SYSTEM *system, int id, char *name, int namelen))
to this:
FMOD_FUNCTION(FMOD_System_GetDriverInfo, (FMOD_SYSTEM *system, int id, char *name, int namelen, FMOD_GUID *GUID))
You'll also need to replace the code that calls this function. That would be line 112 of sfxFMODProvider.cpp:
res = mFMod.FMOD_System_GetDriverName(SFXFMODDevice::smSystem, i, nameBuff, 256);
to this:
res = mFMod.FMOD_System_GetDriverInfo(SFXFMODDevice::smSystem, i, nameBuff, 256, NULL);
Finally you'll want to replace everything in engine/lib/fmod with the same versions that came with your FMod DLL. For me this was version 4.15, which so far is working out great.
- LightWave Dave
About the author
A long time Associate of the GarageGames' community and author of the Torque 3D Game Development Cookbook. Buy it today from Packt Publishing!
Associate Tom Spilman
Sickhead Games
I went ahead and merged your changes along with the latest stable version, FMOD Ex 4.14.06.
Fix in repo rev# 13160.