--- a/QTfrontend/SDLs.cpp Sat Jul 31 10:52:43 2010 +0200
+++ b/QTfrontend/SDLs.cpp Sat Jul 31 11:24:53 2010 +0200
@@ -35,7 +35,7 @@
{
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK);
-
+
musicInitialized = 0;
music = NULL;
if(SDL_NumJoysticks())
@@ -86,7 +86,7 @@
for(int jid = 0; jid < SDL_NumJoysticks(); jid++)
{
SDL_Joystick* joy = SDL_JoystickOpen(jid);
-
+
// Retrieve the game controller's name and strip "Controller (...)" that's added by some drivers (English only)
QString joyname = QString(SDL_JoystickName(jid)).replace(QRegExp("^Controller \\((.*)\\)$"), "\\1");
@@ -102,7 +102,7 @@
{
// Again store the part of the string not changing for multiple uses
QString axis = prefix + QApplication::translate("binds (keys)", "Axis") + QString(" %1 ").arg(aid + 1);
-
+
// Entry for "Axis Up"
sprintf(sdlkeys[i][0], "j%da%du", jid, aid);
sprintf(sdlkeys[i++][1], "%s", ((isxb && aid < 5) ? (prefix + QApplication::translate("binds (keys)", xbox360axes[aid * 2])) : axis + QApplication::translate("binds (keys)", "(Up)")).toStdString().c_str());
@@ -119,33 +119,33 @@
QString hat = prefix + (isxb ? (QApplication::translate("binds (keys)", xb360dpad) + QString(" ")) : QApplication::translate("binds (keys)", "Hat") + QString(" %1 ").arg(hid + 1));
// Entry for "Hat Up"
- sprintf(sdlkeys[i][0], "j%dh%du", jid, hid);
+ sprintf(sdlkeys[i][0], "j%dh%du", jid, hid);
sprintf(sdlkeys[i++][1], "%s", (hat + QApplication::translate("binds (keys)", "(Up)")).toStdString().c_str());
// Entry for "Hat Down"
- sprintf(sdlkeys[i][0], "j%dh%dd", jid, hid);
+ sprintf(sdlkeys[i][0], "j%dh%dd", jid, hid);
sprintf(sdlkeys[i++][1], "%s", (hat + QApplication::translate("binds (keys)", "(Down)")).toStdString().c_str());
// Entry for "Hat Left"
- sprintf(sdlkeys[i][0], "j%dh%dl", jid, hid);
+ sprintf(sdlkeys[i][0], "j%dh%dl", jid, hid);
sprintf(sdlkeys[i++][1], "%s", (hat + QApplication::translate("binds (keys)", "(Left)")).toStdString().c_str());
// Entry for "Hat Right"
- sprintf(sdlkeys[i][0], "j%dh%dr", jid, hid);
+ sprintf(sdlkeys[i][0], "j%dh%dr", jid, hid);
sprintf(sdlkeys[i++][1], "%s", (hat + QApplication::translate("binds (keys)", "(Right)")).toStdString().c_str());
}
-
+
// Register entries for all buttons of this joystick/gamepad
for(int bid = 0; bid < SDL_JoystickNumButtons(joy) && i < 1022; bid++)
{
// Buttons
- sprintf(sdlkeys[i][0], "j%db%d", jid, bid);
+ sprintf(sdlkeys[i][0], "j%db%d", jid, bid);
sprintf(sdlkeys[i++][1], "%s", (prefix + ((isxb && bid < 10) ? (QApplication::translate("binds (keys)", xb360buttons[bid]) + QString(" ")) : QApplication::translate("binds (keys)", "Button") + QString(" %1").arg(bid + 1))).toStdString().c_str());
}
// Close the game controller as we no longer need it
SDL_JoystickClose(joy);
}
-
+
// Terminate the list
sdlkeys[i][0][0] = '\0';
sdlkeys[i][1][0] = '\0';
@@ -167,7 +167,7 @@
if (music == NULL) {
music = Mix_LoadMUS((datadir->absolutePath() + "/Music/main theme.ogg").toLocal8Bit().constData());
-
+
}
Mix_VolumeMusic(MIX_MAX_VOLUME - 28);
Mix_FadeInMusic(music, -1, 1750);