mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-01 09:23:03 -04:00
compile on gcc 3.2
This commit is contained in:
parent
03c8de6eae
commit
911bb92934
@ -28,6 +28,7 @@
|
||||
#include "fmodAudioSound.h"
|
||||
#include "nullAudioSound.h"
|
||||
#include "virtualFileSystem.h"
|
||||
#include "string_utils.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <cctype>
|
||||
@ -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") {
|
||||
|
@ -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<string, SoundCacheEntry > 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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user