3d audio added ;) + nl translation updated

This commit is contained in:
doitux
2007-06-12 23:13:18 +00:00
parent 3eea17f37d
commit 13aca4f616
6 changed files with 38 additions and 8 deletions
+3 -2
View File
@@ -270,6 +270,9 @@ win32{
unix{ unix{
LIBS += -lboost_thread -lcrypto -lSDL_mixer LIBS += -lboost_thread -lcrypto -lSDL_mixer
## My release static libs
#LIBS += -lboost_thread-mt_static -lcrypto -lSDL_mixer -lmikmod -lSDL
# -lmikmod -lSDL -laa -lgpm -lncurses
} }
macx{ macx{
@@ -305,5 +308,3 @@ MOC_DIR = mocs
OBJECTS_DIR = obj OBJECTS_DIR = obj
QT += QT +=
# QMAKE_CXXFLAGS_DEBUG += -g # QMAKE_CXXFLAGS_DEBUG += -g
+1 -1
View File
@@ -1072,7 +1072,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) {
actionLabelArray[playerID]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[playerAction]+".png")); actionLabelArray[playerID]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[playerAction]+".png"));
//play sounds if exist //play sounds if exist
if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound(actionArray[playerAction].toStdString()); if(myConfig->readConfigInt("PlaySoundEffects")) mySDLPlayer->playSound(actionArray[playerAction].toStdString(), playerID);
} }
if (playerAction == 1) { if (playerAction == 1) {
Binary file not shown.
+30 -1
View File
@@ -43,7 +43,7 @@ void SDLPlayer::initAudio() {
} }
} }
void SDLPlayer::playSound(string audioString) { void SDLPlayer::playSound(string audioString, int playerID) {
if(audioEnabled) { if(audioEnabled) {
@@ -51,6 +51,30 @@ void SDLPlayer::playSound(string audioString) {
if(myFile.open(QIODevice::ReadOnly)) { if(myFile.open(QIODevice::ReadOnly)) {
//set 3d position for player
int position = 0;
int distance = 0;
switch (playerID) {
case 0: { position = 180; distance = 30; }
break;
case 1: { position = 281; distance = 40; }
break;
case 2: { position = 315; distance = 80; }
break;
case 3: { position = 338; distance = 100; }
break;
case 4: { position = 23; distance = 100; }
break;
case 5: { position = 45; distance = 80; }
break;
case 6: { position = 79; distance = 30; }
break;
default: { position = 0; distance = 0; }
break;
}
audioDone(); audioDone();
QDataStream in(&myFile); QDataStream in(&myFile);
@@ -59,6 +83,11 @@ void SDLPlayer::playSound(string audioString) {
sound = Mix_QuickLoad_WAV(soundData); sound = Mix_QuickLoad_WAV(soundData);
// set channel 2 to be behind and right, and 100 units away
if(!Mix_SetPosition(0, position, distance)) {
printf("Mix_SetPosition: %s\n", Mix_GetError());
// no position effect, is it ok?
}
currentChannel = Mix_PlayChannel(-1, sound,0); currentChannel = Mix_PlayChannel(-1, sound,0);
} }
// else cout << "could not load " << audioString << ".wav" << endl; // else cout << "could not load " << audioString << ".wav" << endl;
+1 -1
View File
@@ -36,7 +36,7 @@ public:
~SDLPlayer(); ~SDLPlayer();
void initAudio(); void initAudio();
void playSound(std::string); void playSound(std::string, int playerID);
void audioDone(); void audioDone();
void closeAudio(); void closeAudio();
+1 -1
View File
@@ -1232,7 +1232,7 @@ p, li { white-space: pre-wrap; }
<message> <message>
<location filename="../src/gui/qt/mainwindow.ui" line="841"/> <location filename="../src/gui/qt/mainwindow.ui" line="841"/>
<source>Hands</source> <source>Hands</source>
<translation>Rondes</translation> <translation>Handen</translation>
</message> </message>
<message> <message>
<location filename="../src/gui/qt/mainwindow.ui" line="864"/> <location filename="../src/gui/qt/mainwindow.ui" line="864"/>