Sep 7, 2006 at 6:26 PM
RuneLancer said:Hehe, glad to see you got FMOD working after all. Have you started working on a wrapper class (for reuse in future projects) or is it all directly integrated in your source for the time being? Not that either way is any better, once compiled, but it's worth the time to try to modularize code. Just some advice from an idiot who spent many projects copy-pasting bits and pieces from his Win32 GUI management routines in his younger years.
Err, it's a seperate class, but it does specifically what it needs to do for CaveShark. A wrapper class wouldn't be too hard though. It'd just take slight modification of my current class. It also should have the ERRCHECK with result as PART of the class. It's a seperate stand alone function right now.
Code:
class sounds
{
public:
/*creates and initialize the sound system
and the sound streams for weapon.wav
and item.wav */
void init();
void wpnSnd(); //Plays weapon sound
void itmSnd(); //Plays item sound
private:
FMOD::System *system; //pointer to the sound system object
FMOD::Sound *wpnwav; //pointer to weapon wav
FMOD::Sound *itmwav; //pointer to item wav
FMOD_RESULT result; //for ERRCHECK
};
I won't bother including the actual function definitions as the comments describe them.
stupid board ruined my indents.