mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-06 10:15:38 +08:00
#12 Fixing linux build
This commit is contained in:
@@ -8,6 +8,10 @@ INCLUDEPATH += ..
|
||||
|
||||
DEPENDPATH += . ..
|
||||
|
||||
linux-g++* {
|
||||
QMAKE_CXXFLAGS += -std=c++0x
|
||||
}
|
||||
|
||||
#PRECOMPILED_HEADER = stdpch.h
|
||||
|
||||
precompile_header:!isEmpty(PRECOMPILED_HEADER) {
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
|
||||
#include "mathematics.h"
|
||||
|
||||
#include <math.h>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
namespace Constants
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace FSD
|
||||
class FSD_MSG : public BlackMisc::IMessage
|
||||
{
|
||||
public:
|
||||
FSD_MSG(QString& id) : IMessage(id)
|
||||
FSD_MSG(QString id) : IMessage(id)
|
||||
{
|
||||
|
||||
}
|
||||
@@ -40,7 +40,7 @@ namespace FSD
|
||||
class FSD_MSG_AddPilot : public FSD_MSG
|
||||
{
|
||||
public:
|
||||
FSD_MSG_AddPilot() : FSD_MSG(QString("#AP")), m_revision(VATSIM_PROTOCOL_REV),
|
||||
FSD_MSG_AddPilot() : FSD_MSG("#AP"), m_revision(VATSIM_PROTOCOL_REV),
|
||||
m_rating(1)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ double CMath::hypot(double x, double y)
|
||||
double CMath::cubicRootReal(const double x)
|
||||
{
|
||||
double result;
|
||||
result = std::pow(std::abs(x), (double)1/3);
|
||||
result = pow(abs(x), (double)1/3);
|
||||
|
||||
return x < 0 ? -result : result;
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
#ifndef MATH_H
|
||||
#define MATH_H
|
||||
|
||||
#include <math.h>
|
||||
|
||||
namespace BlackCore
|
||||
{
|
||||
|
||||
|
||||
@@ -92,6 +92,8 @@ namespace BlackCore {
|
||||
bool beaconLights; //!< true if beacon lights on
|
||||
};
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
||||
//! A callback that is called when the simulator is started.
|
||||
typedef std::tr1::function<void(const bool status)> cbSimStarted;
|
||||
|
||||
@@ -104,6 +106,20 @@ namespace BlackCore {
|
||||
//! A callback that is called when the user's plane changes its model.
|
||||
typedef std::tr1::function<void(const CPlaneModel &model)> cbChangedModel;
|
||||
|
||||
#else
|
||||
//! A callback that is called when the simulator is started.
|
||||
typedef std::function<void(const bool status)> cbSimStarted;
|
||||
|
||||
//! A callback that is called when the user's plane changes its avionics state.
|
||||
typedef std::function<void(const CAvionicsState &state)> cbChangedAvionicsState;
|
||||
|
||||
//! A callback that is called when the user's plane changes its animation state.
|
||||
typedef std::function<void(const CAnimationState &state)> cbChangedAnimationState;
|
||||
|
||||
//! A callback that is called when the user's plane changes its model.
|
||||
typedef std::function<void(const CPlaneModel &model)> cbChangedModel;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* The interface that is implemented by each simulator driver.
|
||||
*
|
||||
@@ -200,14 +216,25 @@ namespace BlackCore {
|
||||
virtual bool setAnimationState(const qint32 planeID, const CAnimationState &state) = 0;
|
||||
|
||||
//! Calls the supplied visitor function once for every model available in the simulator.
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
virtual void visitAllModels(const std::tr1::function<void(const CPlaneModel &)> &visitor) = 0;
|
||||
#else
|
||||
virtual void visitAllModels(const std::function<void(const CPlaneModel &)> &visitor) = 0;
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* Fills container with all models.
|
||||
* Class T must be a container of CPlaneModel objects and must support push_back.
|
||||
*/
|
||||
#ifdef Q_OS_WIN
|
||||
template <class T>
|
||||
void getAllModels(T &container) { visitAllModels(std::tr1::bind(T::push_back, container)); }
|
||||
#else
|
||||
template <class T>
|
||||
void getAllModels(T &container) { visitAllModels(std::bind(T::push_back, container)); }
|
||||
#endif
|
||||
|
||||
|
||||
protected:
|
||||
BlackMisc::IContext *m_libraryContext; //!< The global context.
|
||||
|
||||
Reference in New Issue
Block a user