mirror of https://github.com/minetest/minetest.git
Fixed more style and naming convention issues
This commit is contained in:
parent
6a33ffebd1
commit
d954cfd68b
|
@ -337,13 +337,13 @@ public:
|
||||||
alcCloseDevice(m_device);
|
alcCloseDevice(m_device);
|
||||||
m_device = NULL;
|
m_device = NULL;
|
||||||
|
|
||||||
for (UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator i = m_buffers.begin();
|
for (UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator it = m_buffers.begin();
|
||||||
i != m_buffers.end(); ++i) {
|
it != m_buffers.end(); ++it) {
|
||||||
for (std::vector<SoundBuffer*>::iterator iter = (*i).second.begin();
|
for (std::vector<SoundBuffer*>::iterator iter = (*it).second.begin();
|
||||||
iter != (*i).second.end(); ++iter) {
|
iter != (*it).second.end(); ++iter) {
|
||||||
delete *iter;
|
delete *iter;
|
||||||
}
|
}
|
||||||
(*i).second.clear();
|
(*it).second.clear();
|
||||||
}
|
}
|
||||||
m_buffers.clear();
|
m_buffers.clear();
|
||||||
infostream<<"Audio: Deinitialized."<<std::endl;
|
infostream<<"Audio: Deinitialized."<<std::endl;
|
||||||
|
@ -351,10 +351,10 @@ public:
|
||||||
|
|
||||||
void addBuffer(const std::string &name, SoundBuffer *buf)
|
void addBuffer(const std::string &name, SoundBuffer *buf)
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator i =
|
UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator it =
|
||||||
m_buffers.find(name);
|
m_buffers.find(name);
|
||||||
if(i != m_buffers.end()){
|
if(it != m_buffers.end()){
|
||||||
i->second.push_back(buf);
|
it->second.push_back(buf);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
std::vector<SoundBuffer*> bufs;
|
std::vector<SoundBuffer*> bufs;
|
||||||
|
@ -365,11 +365,11 @@ public:
|
||||||
|
|
||||||
SoundBuffer* getBuffer(const std::string &name)
|
SoundBuffer* getBuffer(const std::string &name)
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator i =
|
UNORDERED_MAP<std::string, std::vector<SoundBuffer*> >::iterator it =
|
||||||
m_buffers.find(name);
|
m_buffers.find(name);
|
||||||
if(i == m_buffers.end())
|
if (it == m_buffers.end())
|
||||||
return NULL;
|
return NULL;
|
||||||
std::vector<SoundBuffer*> &bufs = i->second;
|
std::vector<SoundBuffer*> &bufs = it->second;
|
||||||
int j = myrand() % bufs.size();
|
int j = myrand() % bufs.size();
|
||||||
return bufs[j];
|
return bufs[j];
|
||||||
}
|
}
|
||||||
|
@ -443,10 +443,10 @@ public:
|
||||||
|
|
||||||
void deleteSound(int id)
|
void deleteSound(int id)
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
|
UNORDERED_MAP<int, PlayingSound*>::iterator it = m_sounds_playing.find(id);
|
||||||
if(i == m_sounds_playing.end())
|
if (it == m_sounds_playing.end())
|
||||||
return;
|
return;
|
||||||
PlayingSound *sound = i->second;
|
PlayingSound *sound = it->second;
|
||||||
|
|
||||||
alDeleteSources(1, &sound->source_id);
|
alDeleteSources(1, &sound->source_id);
|
||||||
|
|
||||||
|
@ -456,20 +456,20 @@ public:
|
||||||
|
|
||||||
void pauseSnd(int id)
|
void pauseSnd(int id)
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
|
UNORDERED_MAP<int, PlayingSound*>::iterator it = m_sounds_playing.find(id);
|
||||||
if(i == m_sounds_playing.end())
|
if (it == m_sounds_playing.end())
|
||||||
return;
|
return;
|
||||||
PlayingSound *sound = i->second;
|
PlayingSound *sound = it->second;
|
||||||
|
|
||||||
alSourcePause(sound->source_id);
|
alSourcePause(sound->source_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
void resumeSnd(int id)
|
void resumeSnd(int id)
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
|
UNORDERED_MAP<int, PlayingSound*>::iterator it = m_sounds_playing.find(id);
|
||||||
if(i == m_sounds_playing.end())
|
if (it == m_sounds_playing.end())
|
||||||
return;
|
return;
|
||||||
PlayingSound *sound = i->second;
|
PlayingSound *sound = it->second;
|
||||||
|
|
||||||
alSourcePlay(sound->source_id);
|
alSourcePlay(sound->source_id);
|
||||||
}
|
}
|
||||||
|
@ -485,13 +485,13 @@ public:
|
||||||
std::set<std::string> paths;
|
std::set<std::string> paths;
|
||||||
std::set<std::string> datas;
|
std::set<std::string> datas;
|
||||||
m_fetcher->fetchSounds(name, paths, datas);
|
m_fetcher->fetchSounds(name, paths, datas);
|
||||||
for(std::set<std::string>::iterator i = paths.begin();
|
for (std::set<std::string>::iterator it = paths.begin();
|
||||||
i != paths.end(); ++i){
|
it != paths.end(); ++it){
|
||||||
loadSoundFile(name, *i);
|
loadSoundFile(name, *it);
|
||||||
}
|
}
|
||||||
for(std::set<std::string>::iterator i = datas.begin();
|
for (std::set<std::string>::iterator it = datas.begin();
|
||||||
i != datas.end(); ++i){
|
it != datas.end(); ++it){
|
||||||
loadSoundData(name, *i);
|
loadSoundData(name, *it);
|
||||||
}
|
}
|
||||||
return getBuffer(name);
|
return getBuffer(name);
|
||||||
}
|
}
|
||||||
|
@ -503,10 +503,10 @@ public:
|
||||||
<<m_sounds_playing.size()<<" playing sounds, "
|
<<m_sounds_playing.size()<<" playing sounds, "
|
||||||
<<m_buffers.size()<<" sound names loaded"<<std::endl;
|
<<m_buffers.size()<<" sound names loaded"<<std::endl;
|
||||||
std::set<int> del_list;
|
std::set<int> del_list;
|
||||||
for(UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.begin();
|
for (UNORDERED_MAP<int, PlayingSound*>::iterator it = m_sounds_playing.begin();
|
||||||
i != m_sounds_playing.end(); ++i) {
|
it != m_sounds_playing.end(); ++it) {
|
||||||
int id = i->first;
|
int id = it->first;
|
||||||
PlayingSound *sound = i->second;
|
PlayingSound *sound = it->second;
|
||||||
// If not playing, remove it
|
// If not playing, remove it
|
||||||
{
|
{
|
||||||
ALint state;
|
ALint state;
|
||||||
|
@ -520,10 +520,10 @@ public:
|
||||||
if (!del_list.empty())
|
if (!del_list.empty())
|
||||||
verbosestream<<"OpenALSoundManager::maintain(): deleting "
|
verbosestream<<"OpenALSoundManager::maintain(): deleting "
|
||||||
<<del_list.size()<<" playing sounds"<<std::endl;
|
<<del_list.size()<<" playing sounds"<<std::endl;
|
||||||
for(std::set<int>::iterator i = del_list.begin();
|
for (std::set<int>::iterator it = del_list.begin();
|
||||||
i != del_list.end(); ++i)
|
it != del_list.end(); ++it)
|
||||||
{
|
{
|
||||||
deleteSound(*i);
|
deleteSound(*it);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -618,10 +618,10 @@ public:
|
||||||
|
|
||||||
void updateSoundPosition(int id, v3f pos)
|
void updateSoundPosition(int id, v3f pos)
|
||||||
{
|
{
|
||||||
UNORDERED_MAP<int, PlayingSound*>::iterator i = m_sounds_playing.find(id);
|
UNORDERED_MAP<int, PlayingSound*>::iterator it = m_sounds_playing.find(id);
|
||||||
if (i == m_sounds_playing.end())
|
if (it == m_sounds_playing.end())
|
||||||
return;
|
return;
|
||||||
PlayingSound *sound = i->second;
|
PlayingSound *sound = it->second;
|
||||||
|
|
||||||
alSourcei(sound->source_id, AL_SOURCE_RELATIVE, false);
|
alSourcei(sound->source_id, AL_SOURCE_RELATIVE, false);
|
||||||
alSource3f(sound->source_id, AL_POSITION, pos.X, pos.Y, pos.Z);
|
alSource3f(sound->source_id, AL_POSITION, pos.X, pos.Y, pos.Z);
|
||||||
|
|
Loading…
Reference in New Issue