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