refs #452, support for P3D in project class

This commit is contained in:
Klaus Basan
2015-09-23 15:07:55 +02:00
committed by Mathew Sutcliffe
parent fc2982c7c3
commit 0a74c3421d
2 changed files with 28 additions and 15 deletions

View File

@@ -1,6 +1,7 @@
#include "project.h"
#include <QStringList>
#include "blackmisc/blackmiscfreefunctions.h"
#include "blackmisc/simulation/simulatorinfo.h"
#define BLACK_VERSION_STR_X(v) #v
#define BLACK_VERSION_STR(v) BLACK_VERSION_STR_X(v)
@@ -53,6 +54,16 @@ namespace BlackMisc
#endif
}
bool CProject::isCompiledWithP3DSupport()
{
return isCompiledWithFsxSupport();
}
bool CProject::isCompiledWithMsFlightSimulatorSupport()
{
return isCompiledWithFs9Support() || isCompiledWithFsxSupport() || isCompiledWithP3DSupport();
}
bool CProject::isCompiledWithXPlaneSupport()
{
#ifdef WITH_XPLANE
@@ -95,25 +106,20 @@ namespace BlackMisc
return info;
}
const QString &CProject::simulators()
const BlackMisc::Simulation::CSimulatorInfo &CProject::simulators()
{
static QString sims;
if (sims.isEmpty())
{
static QStringList sl;
if (isCompiledWithFsxSupport()) sl << "FSX";
if (isCompiledWithXPlaneSupport()) sl << "XPlane";
if (isCompiledWithFs9Support()) sl << "FS9";
sims = sl.join(", ");
if (sims.isEmpty()) sims = "<none>";
}
return sims;
static const BlackMisc::Simulation::CSimulatorInfo simInfo(
isCompiledWithFsxSupport(),
isCompiledWithFs9Support(),
isCompiledWithXPlaneSupport(),
isCompiledWithP3DSupport()
);
return simInfo;
}
const char *CProject::simulatorsChar()
{
static const QByteArray a(simulators().toUtf8());
return a.constData();
return simulators().toQString().toUtf8().constData();
}
const QString &CProject::version()

View File

@@ -11,6 +11,7 @@
#define BLACKMISC_CPROJECT_H
#include "blackmiscexport.h"
#include "blackmisc/simulation/simulatorinfo.h"
#include <QString>
namespace BlackMisc
@@ -37,6 +38,12 @@ namespace BlackMisc
//! with FSX support?
static bool isCompiledWithFsxSupport();
//! with P3D support
static bool isCompiledWithP3DSupport();
//! Compiled with any MS Flight Simulator support (P3D, FSX, FS9)
static bool isCompiledWithMsFlightSimulatorSupport();
//! with XPlane support?
static bool isCompiledWithXPlaneSupport();
@@ -50,7 +57,7 @@ namespace BlackMisc
static const QString &compiledInfo();
//! Simulator String info
static const QString &simulators();
static const BlackMisc::Simulation::CSimulatorInfo &simulators();
//! Simulator String info
static const char *simulatorsChar();