Ref T317, style

This commit is contained in:
Klaus Basan
2018-09-06 22:17:12 +02:00
parent 947ca805bb
commit 24deffca74

View File

@@ -8,6 +8,7 @@
*/ */
#include "simulatorp3d.h" #include "simulatorp3d.h"
#include "../fsxcommon/simconnectfunctions.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"
@@ -23,6 +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;
namespace BlackSimPlugin namespace BlackSimPlugin
{ {
@@ -39,6 +41,8 @@ namespace BlackSimPlugin
// set build/sim specific SimConnectProc, which is the FSX SimConnectProc on WIN32 systems // set build/sim specific SimConnectProc, which is the FSX SimConnectProc on WIN32 systems
if (CBuildConfig::isCompiledWithP3DSupport() && CBuildConfig::isRunningOnWindowsNtPlatform() && CBuildConfig::buildWordSize() == 64) if (CBuildConfig::isCompiledWithP3DSupport() && CBuildConfig::isRunningOnWindowsNtPlatform() && CBuildConfig::buildWordSize() == 64)
{ {
// modern x64 P3D
this->setUsingFsxTerrainProbe(false);
m_dispatchProc = &CSimulatorP3D::SimConnectProc; m_dispatchProc = &CSimulatorP3D::SimConnectProc;
} }
this->setDefaultModel(CAircraftModel("LOCKHEED L049_2", CAircraftModel::TypeModelMatchingDefaultModel, this->setDefaultModel(CAircraftModel("LOCKHEED L049_2", CAircraftModel::TypeModelMatchingDefaultModel,
@@ -62,7 +66,7 @@ namespace BlackSimPlugin
case SIMCONNECT_RECV_ID_GROUND_INFO: case SIMCONNECT_RECV_ID_GROUND_INFO:
{ {
// https://www.prepar3d.com/SDKv4/sdk/simconnect_api/references/structures_and_enumerations.html#SIMCONNECT_RECV_GROUND_INFO // https://www.prepar3d.com/SDKv4/sdk/simconnect_api/references/structures_and_enumerations.html#SIMCONNECT_RECV_GROUND_INFO
const SIMCONNECT_RECV_GROUND_INFO *pObjData = (SIMCONNECT_RECV_GROUND_INFO *) pData; const SIMCONNECT_RECV_GROUND_INFO *pObjData = static_cast<SIMCONNECT_RECV_GROUND_INFO *>(pData);
const DWORD requestId = pObjData->dwRequestID; const DWORD requestId = pObjData->dwRequestID;
if (!CSimulatorFsxCommon::isRequestForSimObjTerrainProbe(requestId)) { break; } if (!CSimulatorFsxCommon::isRequestForSimObjTerrainProbe(requestId)) { break; }
// valid elevation request // valid elevation request
@@ -111,7 +115,7 @@ namespace BlackSimPlugin
SIMCONNECT_GROUND_INFO_ALT_FORMAT_FEET, SIMCONNECT_GROUND_INFO_ALT_FORMAT_FEET,
SIMCONNECT_GROUND_INFO_SOURCE_FLAG_PLATFORMS); SIMCONNECT_GROUND_INFO_SOURCE_FLAG_PLATFORMS);
bool ok = false; bool ok = false;
if (hr == S_OK) if (isOk(hr))
{ {
ok = true; ok = true;
emit this->requestedElevation(callsign); emit this->requestedElevation(callsign);
@@ -142,7 +146,7 @@ namespace BlackSimPlugin
Q_UNUSED(model); Q_UNUSED(model);
HRESULT hr = SimConnect_ChangeView(m_hSimConnect, view); HRESULT hr = SimConnect_ChangeView(m_hSimConnect, view);
return hr == S_OK; return isOk(hr);
/** /**
if (!simObject.hasValidRequestAndObjectId()) { return false; } if (!simObject.hasValidRequestAndObjectId()) { return false; }