From 911bb92934f119dfb9812092ebfef5a8ec592f2d Mon Sep 17 00:00:00 2001 From: David Rose Date: Fri, 7 Feb 2003 18:46:46 +0000 Subject: [PATCH] compile on gcc 3.2 --- panda/src/audiotraits/fmodAudioManager.cxx | 10 +++++----- panda/src/audiotraits/fmodAudioManager.h | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/panda/src/audiotraits/fmodAudioManager.cxx b/panda/src/audiotraits/fmodAudioManager.cxx index 6fbd4e1a04..bf92cb87c4 100644 --- a/panda/src/audiotraits/fmodAudioManager.cxx +++ b/panda/src/audiotraits/fmodAudioManager.cxx @@ -28,6 +28,7 @@ #include "fmodAudioSound.h" #include "nullAudioSound.h" #include "virtualFileSystem.h" +#include "string_utils.h" #include #include @@ -179,8 +180,8 @@ get_sound(const string &file_name) { FSOUND_STREAM *stream = NULL; int flags = FSOUND_LOADMEMORY | FSOUND_MPEGACCURATE; string os_path = path.to_os_specific(); - string suffix = path.get_extension(); - std::transform(suffix.begin(), suffix.end(), suffix.begin(), tolower); + string suffix = downcase(path.get_extension()); + if (suffix == "mid" || suffix == "rmi" || suffix == "midi") { stream = FSOUND_Stream_OpenFile(os_path.c_str(), 0, 0); } else { @@ -421,11 +422,10 @@ dec_refcount(const string& file_name) { // newly-allocated buffer, and stores the size of the // buffer in size. Returns NULL if an error occurs. //////////////////////////////////////////////////////////////////// -void* FmodAudioManager:: +char* FmodAudioManager:: load(const Filename& filename, size_t &size) const { // Check file type (based on filename suffix - string suffix = filename.get_extension(); - std::transform(suffix.begin(), suffix.end(), suffix.begin(), tolower); + string suffix = downcase(filename.get_extension()); bool bSupported = false; if (suffix == "wav" || suffix == "mp3" || suffix == "mid" || suffix == "rmi" || suffix == "midi") { diff --git a/panda/src/audiotraits/fmodAudioManager.h b/panda/src/audiotraits/fmodAudioManager.h index 913f7bf32b..2428f074af 100644 --- a/panda/src/audiotraits/fmodAudioManager.h +++ b/panda/src/audiotraits/fmodAudioManager.h @@ -65,7 +65,7 @@ private: size_t size; // size of the data field, in bytes unsigned int refcount; // how many AudioSound objects are referencing me? bool stale; // can this entry be purged from the cache? - void *data; // the memory-mapped audio file. + char *data; // the memory-mapped audio file. } SoundCacheEntry; typedef pmap SoundMap; SoundMap _sounds; @@ -80,9 +80,9 @@ private: bool _is_valid; bool _active; - void* load(const Filename& filename, size_t &size) const; + char* load(const Filename& filename, size_t &size) const; - friend FmodAudioSound; + friend class FmodAudioSound; }; EXPCL_FMOD_AUDIO PT(AudioManager) Create_AudioManager();