Moved FSX common functions to FsCommon as those can also be used with FS9

This commit is contained in:
Klaus Basan
2018-11-01 02:49:03 +01:00
parent b6ce9e0408
commit fc1e45089e
4 changed files with 11 additions and 8 deletions

View File

@@ -1,5 +1,5 @@
/* Copyright (C) 2018 /* Copyright (C) 2018
* swift project Community / Contributors * swift Project Community / Contributors
* *
* This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level * This file is part of swift project. It is subject to the license terms in the LICENSE file found in the top-level
* directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project, * directory of this distribution and at http://www.swift-project.org/license.html. No part of swift project,
@@ -9,18 +9,19 @@
//! \file //! \file
#ifndef BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTFUNCTIONS_H #ifndef BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMONFUNCTIONS_H
#define BLACKSIMPLUGIN_FSXCOMMON_SIMCONNECTFUNCTIONS_H #define BLACKSIMPLUGIN_FSCOMMON_SIMULATORFSCOMMONFUNCTIONS_H
#include <Windows.h> #include <Windows.h>
#include <QtGlobal> #include <QtGlobal>
namespace BlackSimPlugin namespace BlackSimPlugin
{ {
namespace FsxCommon namespace FsCommon
{ {
//! Correctly casted values/checks @{ //! Correctly casted values/checks @{
HRESULT inline s_ok() { return S_OK; } HRESULT inline s_ok() { return S_OK; }
HRESULT inline s_false() { return S_FALSE; }
static bool inline isOk(HRESULT result) { return result == s_ok(); } static bool inline isOk(HRESULT result) { return result == s_ok(); }
static bool inline isOk(HRESULT hr1, HRESULT hr2, HRESULT hr3 = s_ok(), HRESULT hr4 = s_ok()) { return isOk(hr1) && isOk(hr2) && isOk(hr3) && isOk(hr4); } static bool inline isOk(HRESULT hr1, HRESULT hr2, HRESULT hr3 = s_ok(), HRESULT hr4 = s_ok()) { return isOk(hr1) && isOk(hr2) && isOk(hr3) && isOk(hr4); }
bool inline isFailure(HRESULT result) { return !isOk(result); } bool inline isFailure(HRESULT result) { return !isOk(result); }

View File

@@ -9,7 +9,7 @@
#include "simconnectdatadefinition.h" #include "simconnectdatadefinition.h"
#include "simconnectsymbols.h" #include "simconnectsymbols.h"
#include "simconnectfunctions.h" #include "../fscommon/simulatorfscommonfunctions.h"
#include "blackmisc/aviation/aircraftparts.h" #include "blackmisc/aviation/aircraftparts.h"
#include "blackmisc/aviation/aircraftenginelist.h" #include "blackmisc/aviation/aircraftenginelist.h"
#include "blackmisc/logmessage.h" #include "blackmisc/logmessage.h"
@@ -17,6 +17,7 @@
using namespace BlackMisc; using namespace BlackMisc;
using namespace BlackMisc::Aviation; using namespace BlackMisc::Aviation;
using namespace BlackSimPlugin::FsCommon;
namespace BlackSimPlugin namespace BlackSimPlugin
{ {

View File

@@ -9,7 +9,7 @@
#include "simulatorfsxcommon.h" #include "simulatorfsxcommon.h"
#include "simconnectsymbols.h" #include "simconnectsymbols.h"
#include "simconnectfunctions.h" #include "../fscommon/simulatorfscommonfunctions.h"
#include "blackcore/application.h" #include "blackcore/application.h"
#include "blackmisc/network/textmessage.h" #include "blackmisc/network/textmessage.h"
#include "blackmisc/simulation/fsx/simconnectutilities.h" #include "blackmisc/simulation/fsx/simconnectutilities.h"
@@ -48,6 +48,7 @@ using namespace BlackMisc::Simulation::Fsx;
using namespace BlackMisc::Simulation::Settings; using namespace BlackMisc::Simulation::Settings;
using namespace BlackMisc::Weather; using namespace BlackMisc::Weather;
using namespace BlackCore; using namespace BlackCore;
using namespace BlackSimPlugin::FsCommon;
namespace BlackSimPlugin namespace BlackSimPlugin
{ {

View File

@@ -8,7 +8,7 @@
*/ */
#include "simulatorp3d.h" #include "simulatorp3d.h"
#include "../fsxcommon/simconnectfunctions.h" #include "../fscommon/simulatorfscommonfunctions.h"
#include "blackmisc/threadutils.h" #include "blackmisc/threadutils.h"
#include "blackmisc/logmessage.h" #include "blackmisc/logmessage.h"
#include "blackconfig/buildconfig.h" #include "blackconfig/buildconfig.h"
@@ -24,7 +24,7 @@ using namespace BlackMisc::Simulation::FsCommon;
using namespace BlackSimPlugin::FsxCommon; using namespace BlackSimPlugin::FsxCommon;
using namespace BlackMisc::Weather; using namespace BlackMisc::Weather;
using namespace BlackCore; using namespace BlackCore;
using namespace BlackSimPlugin::FsxCommon; using namespace BlackSimPlugin::FsCommon;
namespace BlackSimPlugin namespace BlackSimPlugin
{ {