diff --git a/pokerth.pro b/pokerth.pro index 9962cba2..6b653c07 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -269,7 +269,10 @@ win32{ } 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{ @@ -305,5 +308,3 @@ MOC_DIR = mocs OBJECTS_DIR = obj QT += # QMAKE_CXXFLAGS_DEBUG += -g - - diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 1d2178ed..3260e4c9 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1072,7 +1072,7 @@ void mainWindowImpl::refreshAction(int playerID, int playerAction) { actionLabelArray[playerID]->setPixmap(QPixmap(":/actions/resources/graphics/actions/action_"+actionArray[playerAction]+".png")); //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) { diff --git a/src/gui/qt/resources/translations/pokerth_nl.qm b/src/gui/qt/resources/translations/pokerth_nl.qm index 58b64053..9ea21b28 100644 Binary files a/src/gui/qt/resources/translations/pokerth_nl.qm and b/src/gui/qt/resources/translations/pokerth_nl.qm differ diff --git a/src/gui/qt/sound/sdlplayer.cpp b/src/gui/qt/sound/sdlplayer.cpp index 80750e01..281069b2 100644 --- a/src/gui/qt/sound/sdlplayer.cpp +++ b/src/gui/qt/sound/sdlplayer.cpp @@ -43,14 +43,38 @@ void SDLPlayer::initAudio() { } } -void SDLPlayer::playSound(string audioString) { +void SDLPlayer::playSound(string audioString, int playerID) { if(audioEnabled) { - + QFile myFile(":sounds/resources/sounds/"+QString::fromStdString(audioString)+".wav"); 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(); QDataStream in(&myFile); @@ -59,6 +83,11 @@ void SDLPlayer::playSound(string audioString) { 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); } // else cout << "could not load " << audioString << ".wav" << endl; diff --git a/src/gui/qt/sound/sdlplayer.h b/src/gui/qt/sound/sdlplayer.h index 03267a9d..3db0696c 100644 --- a/src/gui/qt/sound/sdlplayer.h +++ b/src/gui/qt/sound/sdlplayer.h @@ -36,7 +36,7 @@ public: ~SDLPlayer(); void initAudio(); - void playSound(std::string); + void playSound(std::string, int playerID); void audioDone(); void closeAudio(); diff --git a/ts/pokerth_nl.ts b/ts/pokerth_nl.ts index 2c1083a8..afd46f94 100644 --- a/ts/pokerth_nl.ts +++ b/ts/pokerth_nl.ts @@ -1232,7 +1232,7 @@ p, li { white-space: pre-wrap; } Hands - Rondes + Handen