diff options
author | Yohann Ferreira <bertram@cegetel.net> | 2005-03-24 21:24:31 +0000 |
---|---|---|
committer | Yohann Ferreira <bertram@cegetel.net> | 2005-03-24 21:24:31 +0000 |
commit | b5a9e699b9685e2a7d448171e282fd284754caf1 (patch) | |
tree | 4c8787fb30d28ec685bbcbb2ddca962b838a256d /src/sound.cpp | |
parent | adf5fb5d45c11a0506d199d2cc672535c8418ce1 (diff) | |
download | mana-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.gz mana-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.bz2 mana-b5a9e699b9685e2a7d448171e282fd284754caf1.tar.xz mana-b5a9e699b9685e2a7d448171e282fd284754caf1.zip |
Logger Implemented. (3/3)
Diffstat (limited to 'src/sound.cpp')
-rw-r--r-- | src/sound.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/sound.cpp b/src/sound.cpp index 74222c8c..8de4077e 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -23,6 +23,7 @@ #include "sound.h" #include "log.h" +#include "main.h" void Sound::init(int voices, int mod_voices) { @@ -50,7 +51,7 @@ void Sound::init(int voices, int mod_voices) items = -1; isOk = 0; - log("Sound::Init() Initializing Sound"); + logger.log("Sound::Init() Initializing Sound"); } void Sound::setVolume(int music) @@ -81,7 +82,7 @@ void Sound::startBgm(char *in, int loop) stopBgm(); } - log("Sound::startBgm() playing \"%s\" %d times", in, loop); + logger.log("Sound::startBgm() playing \"%s\" %d times", in, loop); bgm = Mix_LoadMUS(in); Mix_PlayMusic(bgm, loop); @@ -91,7 +92,7 @@ void Sound::stopBgm() { if (isOk == -1) return; - log("Sound::stopBgm()"); + logger.log("Sound::stopBgm()"); if (bgm != NULL) { Mix_HaltMusic(); @@ -102,12 +103,12 @@ void Sound::stopBgm() SOUND_SID Sound::loadItem(char *fpath) { - log("Sound::loadItem() precaching \"%s\"", fpath); + logger.log("Sound::loadItem() precaching \"%s\"", fpath); Mix_Chunk *newItem; if ((newItem = Mix_LoadWAV(fpath))) { soundpool[++items] = newItem; - log("Sound::loadItem() success SOUND_SID = %d", items); + logger.log("Sound::loadItem() success SOUND_SID = %d", items); return items; } @@ -117,7 +118,7 @@ SOUND_SID Sound::loadItem(char *fpath) void Sound::startItem(SOUND_SID id, int volume) { if (soundpool[id]) { - log("Sound::startItem() playing SOUND_SID = %d", id); + logger.log("Sound::startItem() playing SOUND_SID = %d", id); Mix_VolumeChunk(soundpool[id], volume); Mix_PlayChannel(-1, soundpool[id], 0); } @@ -131,7 +132,7 @@ void Sound::clearCache() } soundpool.clear(); - log("Sound::clearCache() wiped all items off the cache"); + logger.log("Sound::clearCache() wiped all items off the cache"); } void Sound::close() @@ -139,7 +140,7 @@ void Sound::close() isOk = -1; clearCache(); Mix_CloseAudio(); - log("Sound::close() shutting down Sound"); + logger.log("Sound::close() shutting down Sound"); } bool Sound::isMaxVol(int vol) |