Proper SDL library initialization for Audio and Joystick subsystems (ported from master)
This commit is contained in:
@@ -48,6 +48,9 @@
|
||||
#include <QSplashScreen>
|
||||
#include <QThread>
|
||||
#include <iostream>
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
#include <SDL.h>
|
||||
#endif
|
||||
#include "simulatordialog.h"
|
||||
#include "eeprominterface.h"
|
||||
|
||||
@@ -98,6 +101,17 @@ int main(int argc, char *argv[])
|
||||
|
||||
QTextCodec::setCodecForCStrings(QTextCodec::codecForName("UTF-8"));
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
uint32_t sdlFlags = 0;
|
||||
#ifdef JOYSTICKS
|
||||
sdlFlags |= SDL_INIT_JOYSTICK;
|
||||
#endif
|
||||
#ifdef SIMU_AUDIO
|
||||
sdlFlags |= SDL_INIT_AUDIO;
|
||||
#endif
|
||||
SDL_Init(sdlFlags);
|
||||
#endif
|
||||
|
||||
SimulatorDialog *dialog;
|
||||
QString eepromFileName;
|
||||
QDir eedir;
|
||||
@@ -160,5 +174,9 @@ int main(int argc, char *argv[])
|
||||
|
||||
delete dialog;
|
||||
|
||||
#if defined(JOYSTICKS) || defined(SIMU_AUDIO)
|
||||
SDL_Quit();
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user