diff options
author | erihel <erihel@gmail.com> | 2012-12-25 17:46:48 +0100 |
---|---|---|
committer | erihel <erihel@gmail.com> | 2012-12-25 17:46:48 +0100 |
commit | 1fa5f7a96fb4a1700847ebcf0b07a557da630b10 (patch) | |
tree | f448e87eeb5623c4c1127dae35c7daa80ea84a82 /src | |
parent | 6d607e3ae8d60d2d5f11f053511a305db415205e (diff) | |
download | colobot-1fa5f7a96fb4a1700847ebcf0b07a557da630b10.tar.gz colobot-1fa5f7a96fb4a1700847ebcf0b07a557da630b10.tar.bz2 colobot-1fa5f7a96fb4a1700847ebcf0b07a557da630b10.zip |
* Changed log level in sound module
* Fixed warnings in sound module
* Fixed problem with map loading when locale with different number separator
Diffstat (limited to 'src')
-rw-r--r-- | src/app/app.cpp | 2 | ||||
-rw-r--r-- | src/object/robotmain.cpp | 4 | ||||
-rw-r--r-- | src/sound/oalsound/alsound.cpp | 8 | ||||
-rw-r--r-- | src/sound/oalsound/buffer.cpp | 4 | ||||
-rw-r--r-- | src/sound/oalsound/channel.cpp | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/src/app/app.cpp b/src/app/app.cpp index 683b053..da4fca4 100644 --- a/src/app/app.cpp +++ b/src/app/app.cpp @@ -316,7 +316,7 @@ bool CApplication::Create() langStr += locale; strcpy(S_LANGUAGE, langStr.c_str()); putenv(S_LANGUAGE); - setlocale(LC_ALL, ""); + setlocale(LC_ALL, locale.c_str()); GetLogger()->Debug("Set locale to '%s'\n", locale.c_str()); bindtextdomain("colobot", COLOBOT_I18N_DIR); diff --git a/src/object/robotmain.cpp b/src/object/robotmain.cpp index 1da4587..d5805d0 100644 --- a/src/object/robotmain.cpp +++ b/src/object/robotmain.cpp @@ -3793,6 +3793,8 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) int rankObj = 0; int rankGadget = 0; CObject* sel = 0; + char *locale = setlocale(LC_NUMERIC, nullptr); + setlocale(LC_NUMERIC, "C"); while (fgets(line, 500, file) != NULL) { @@ -4526,6 +4528,8 @@ void CRobotMain::CreateScene(bool soluce, bool fixScene, bool resetObject) } m_dialog->SetSceneRead(""); m_dialog->SetStackRead(""); + + setlocale(LC_NUMERIC, locale); } //! Creates an object of decoration mobile or stationary diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp index 5f416da..00cb9b2 100644 --- a/src/sound/oalsound/alsound.cpp +++ b/src/sound/oalsound/alsound.cpp @@ -259,7 +259,7 @@ bool ALSound::SearchFreeBuffer(Sound sound, int &channel, bool &bAlreadyLoaded) int lowerOrEqual = -1; for (auto it : mChannels) { if (it.second->GetPriority() < priority) { - GetLogger()->Info("Sound channel with lower priority will be reused."); + GetLogger()->Debug("Sound channel with lower priority will be reused."); channel = it.first; return true; } @@ -269,7 +269,7 @@ bool ALSound::SearchFreeBuffer(Sound sound, int &channel, bool &bAlreadyLoaded) if (lowerOrEqual != -1) { channel = lowerOrEqual; - GetLogger()->Info("Sound channel with lower or equal priority will be reused."); + GetLogger()->Debug("Sound channel with lower or equal priority will be reused."); return true; } @@ -457,11 +457,11 @@ void ALSound::FrameMove(float delta) if (it.second->GetEnvelope().totalTime <= it.second->GetCurrentTime()) { if (oper.nextOper == SOPER_LOOP) { - GetLogger()->Info("Replay.\n"); + GetLogger()->Trace("Sound oper: replay.\n"); it.second->SetCurrentTime(0.0f); it.second->Play(); } else { - GetLogger()->Info("Next.\n"); + GetLogger()->Trace("Sound oper: next.\n"); it.second->SetStartAmplitude(oper.finalAmplitude); it.second->SetStartFrequency(oper.finalFrequency); it.second->PopEnvelope(); diff --git a/src/sound/oalsound/buffer.cpp b/src/sound/oalsound/buffer.cpp index 37211e9..dbfdca2 100644 --- a/src/sound/oalsound/buffer.cpp +++ b/src/sound/oalsound/buffer.cpp @@ -36,7 +36,7 @@ Buffer::~Buffer() { bool Buffer::LoadFromFile(std::string filename, Sound sound) { mSound = sound; - GetLogger()->Info("Loading audio file: %s\n", filename.c_str()); + GetLogger()->Debug("Loading audio file: %s\n", filename.c_str()); mBuffer = alutCreateBufferFromFile(filename.c_str()); ALenum error = alutGetError(); @@ -53,7 +53,7 @@ bool Buffer::LoadFromFile(std::string filename, Sound sound) { alGetBufferi(mBuffer, AL_CHANNELS, &channels); alGetBufferi(mBuffer, AL_FREQUENCY, &freq); - mDuration = (ALfloat)size / channels / bits / 8 / (ALfloat)freq; + mDuration = static_cast<ALfloat>(size) / channels / bits / 8 / static_cast<ALfloat>(freq); mLoaded = true; return true; diff --git a/src/sound/oalsound/channel.cpp b/src/sound/oalsound/channel.cpp index 4476dee..2285414 100644 --- a/src/sound/oalsound/channel.cpp +++ b/src/sound/oalsound/channel.cpp @@ -227,7 +227,7 @@ void Channel::AdjustFrequency(float freq) { void Channel::AdjustVolume(float volume) { - SetVolume(mStartAmplitude * (float) volume); + SetVolume(mStartAmplitude * volume); } |