summaryrefslogtreecommitdiffstats
path: root/src/sound
diff options
context:
space:
mode:
authorKrzysztof Dermont <erihel@gmail.com>2014-06-20 23:41:38 +0200
committerKrzysztof Dermont <erihel@gmail.com>2014-06-20 23:51:28 +0200
commit2260f6bf4feb62929e32a1bea9cd3f403aa034b1 (patch)
treea9f830fe8ddfa57598a0802ced6540befb8c8c75 /src/sound
parentba62e6f8be5f7008939677ce70799ecc26adf420 (diff)
downloadcolobot-2260f6bf4feb62929e32a1bea9cd3f403aa034b1.tar.gz
colobot-2260f6bf4feb62929e32a1bea9cd3f403aa034b1.tar.bz2
colobot-2260f6bf4feb62929e32a1bea9cd3f403aa034b1.zip
Big part of PhysFS support
* removed -mod argument * removed -datadir argument * removed -lang argument * removed some dead ui code * added resource manager and file loaders (stream and SDL) * changed interface textures location to match new directory structure * removed CGameData for mod support * added PhysFS support
Diffstat (limited to 'src/sound')
-rw-r--r--src/sound/oalsound/alsound.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/sound/oalsound/alsound.cpp b/src/sound/oalsound/alsound.cpp
index 8afbdd2..4d40c3b 100644
--- a/src/sound/oalsound/alsound.cpp
+++ b/src/sound/oalsound/alsound.cpp
@@ -18,8 +18,6 @@
#include "sound/oalsound/alsound.h"
-#include "app/gamedata.h"
-
#include <algorithm>
#include <iomanip>
@@ -165,7 +163,7 @@ int ALSound::GetMusicVolume()
bool ALSound::Cache(Sound sound, const std::string &filename)
{
Buffer *buffer = new Buffer();
- if (buffer->LoadFromFile(CGameData::GetInstancePointer()->GetFilePath(DIR_SOUND, filename), sound))
+ if (buffer->LoadFromFile(filename, sound))
{
m_sounds[sound] = buffer;
return true;
@@ -178,7 +176,7 @@ bool ALSound::CacheMusic(const std::string &filename)
if (m_music.find(filename) == m_music.end())
{
Buffer *buffer = new Buffer();
- if (buffer->LoadFromFile(CGameData::GetInstancePointer()->GetFilePath(DIR_MUSIC, filename), static_cast<Sound>(-1)))
+ if (buffer->LoadFromFile(filename, static_cast<Sound>(-1)))
{
m_music[filename] = buffer;
return true;
@@ -635,21 +633,20 @@ bool ALSound::PlayMusic(const std::string &filename, bool bRepeat, float fadeTim
return false;
}
- std::string file = CGameData::GetInstancePointer()->GetFilePath(DIR_MUSIC, filename);
Buffer *buffer;
// check if we have music in cache
if (m_music.find(filename) == m_music.end())
{
GetLogger()->Debug("Music %s was not cached!\n", filename.c_str());
- if (!boost::filesystem::exists(file))
+ if (!boost::filesystem::exists(filename))
{
GetLogger()->Debug("Requested music %s was not found.\n", filename.c_str());
return false;
}
buffer = new Buffer();
- if (!buffer->LoadFromFile(file, static_cast<Sound>(-1)))
+ if (!buffer->LoadFromFile(filename, static_cast<Sound>(-1)))
{
return false;
}