mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 04:25:35 +08:00
refs #452, support for P3D in project class
This commit is contained in:
committed by
Mathew Sutcliffe
parent
fc2982c7c3
commit
0a74c3421d
@@ -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()
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user