Load sounds with the help of physfsrwops library
authorunc0rr
Sat, 24 Nov 2012 00:28:32 +0400
changeset 8117 329d9756b57c
parent 8115 ac1007c6dea8
child 8118 b0ccf8d13645
child 8119 257ffa847aa2
Load sounds with the help of physfsrwops library
QTfrontend/main.cpp
QTfrontend/util/SDLInteraction.cpp
--- a/QTfrontend/main.cpp	Fri Nov 23 16:19:01 2012 +0400
+++ b/QTfrontend/main.cpp	Sat Nov 24 00:28:32 2012 +0400
@@ -231,7 +231,6 @@
     engine.mount(cfgdir->absolutePath());
     engine.setWriteDir(cfgdir->absolutePath());
     engine.mountPacks();
-    qDebug() << datadir->absolutePath();
 
     QTranslator Translator;
     {
--- a/QTfrontend/util/SDLInteraction.cpp	Fri Nov 23 16:19:01 2012 +0400
+++ b/QTfrontend/util/SDLInteraction.cpp	Sat Nov 24 00:28:32 2012 +0400
@@ -28,6 +28,8 @@
 
 #include "SDLInteraction.h"
 
+#include "physfsrwops.h"
+
 extern char sdlkeys[1024][2][128];
 extern char xb360buttons[][128];
 extern char xb360dpad[128];
@@ -193,7 +195,7 @@
 {
     SDLAudioInit();
     if (!m_soundMap->contains(soundFile))
-        m_soundMap->insert(soundFile, Mix_LoadWAV(soundFile.toLocal8Bit().constData()));
+        m_soundMap->insert(soundFile, Mix_LoadWAV_RW(PHYSFSRWOPS_openRead(soundFile.toLocal8Bit().constData()), 1));
 
     //FIXME: this is a hack, but works as long as we have few concurrent playing sounds
     if (Mix_Playing(lastchannel) == false)
@@ -232,7 +234,7 @@
     SDLAudioInit();
 
     if (m_music == NULL)
-        m_music = Mix_LoadMUS(m_musicTrack.toLocal8Bit().constData());
+        m_music = Mix_LoadMUS_RW(PHYSFSRWOPS_openRead(m_musicTrack.toLocal8Bit().constData()));
 
     Mix_VolumeMusic(MIX_MAX_VOLUME - 28);
     Mix_FadeInMusic(m_music, -1, 1750);