3d audio added ;) + nl translation updated
This commit is contained in:
+4
-3
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Binary file not shown.
@@ -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;
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
~SDLPlayer();
|
||||
|
||||
void initAudio();
|
||||
void playSound(std::string);
|
||||
void playSound(std::string, int playerID);
|
||||
void audioDone();
|
||||
void closeAudio();
|
||||
|
||||
|
||||
+1
-1
@@ -1232,7 +1232,7 @@ p, li { white-space: pre-wrap; }
|
||||
<message>
|
||||
<location filename="../src/gui/qt/mainwindow.ui" line="841"/>
|
||||
<source>Hands</source>
|
||||
<translation>Rondes</translation>
|
||||
<translation>Handen</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../src/gui/qt/mainwindow.ui" line="864"/>
|
||||
|
||||
Reference in New Issue
Block a user