Showing the changes to libraries/input-plugins/src/input-plugins (1 of 1 file). Show all
Unified · Split
| @@ -20,6 +20,10 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #include "InputPluginsLogging.h" |
| 22 | 22 | |
| 23 | +#ifndef SIXENSE_LIB_FILENAME | |
| 24 | +#define SIXENSE_LIB_FILENAME QCoreApplication::applicationDirPath() + "/../Frameworks/libsixense_x64" | |
| 25 | +#endif | |
| 26 | + | |
| 23 | 27 | using Library = std::unique_ptr<QLibrary>; |
| 24 | 28 | static Library SIXENSE; |
| 25 | 29 | |
| @@ -41,15 +45,9 @@ Callable resolve(const Library& library, const char* name) { · 15 unmodified lines | ||
| 41 | 45 | |
| 42 | 46 | |
| 43 | 47 | void loadSixense() { |
| 44 | − if (!SIXENSE) { | |
| 45 | − static const QString LIBRARY_PATH = | |
| 46 | −#ifdef SIXENSE_LIB_FILENAME | |
| 47 | − SIXENSE_LIB_FILENAME; | |
| 48 | −#else | |
| 49 | − QCoreApplication::applicationDirPath() + "/../Frameworks/libsixense_x64"; | |
| 50 | −#endif | |
| 51 | − SIXENSE.reset(new QLibrary(LIBRARY_PATH)); | |
| 52 | − } | |
| 48 | + Q_ASSERT_X(!(SIXENSE && SIXENSE->isLoaded()), __FUNCTION__, "Sixense library already loaded"); | |
| 49 | + SIXENSE.reset(new QLibrary(SIXENSE_LIB_FILENAME)); | |
| 50 | + Q_CHECK_PTR(SIXENSE); | |
| 53 | 51 | |
| 54 | 52 | if (SIXENSE->load()){ |
| 55 | 53 | qDebug() << "Loaded sixense library for hydra support -" << SIXENSE->fileName(); |