From a0a7049785beb0c608b0ced8e4d926b9baba64e6 Mon Sep 17 00:00:00 2001 From: Roland Winklmeier Date: Mon, 11 Mar 2013 18:51:45 +0100 Subject: [PATCH] Minor fixes in cmake and source files --- CMakeLists.txt | 9 +++++---- blackd/qt_displayer.cpp | 3 +++ blacklib/include/blackcore/fsd_messages.h | 5 +++-- blacklib/include/blackcore/interpolator.h | 1 + blacklib/include/blackmisc/type_info.h | 2 +- blacklib/src/blackcore/fsd_messages.cpp | 1 - blacklib/src/blackcore/interpolator.cpp | 6 ++++++ cmake/modules/FindSimConnect.cmake | 4 ++-- 8 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3265f9705..07550acb0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -41,12 +41,13 @@ OPTION(WITH_BLACK_XPLANE "Build BlackBox as a X-Plane Plugin" OPTION(WITH_SIMULATOR_DRIVER "Build Simulator Drivers." ON) IF(WITH_SIMULATOR_DRIVER) + OPTION(WITH_STATIC_DRIVERS "Build static simulator drivers" OFF ) ############### Drivers ############### IF(WIN32) - OPTION(WITH_DRIVER_FSX "Build FSX Simulator Driver" ON ) + OPTION(WITH_DRIVER_FSX "Build FSX Simulator Driver" OFF ) OPTION(WITH_DRIVER_FS9 "Build FS2004 Simulator Driver" OFF ) ENDIF(WIN32) - OPTION(WITH_DRIVER_XPLANE "Build X-Plane Simulator Driver" ON ) + OPTION(WITH_DRIVER_XPLANE "Build X-Plane Simulator Driver" OFF ) ENDIF(WITH_SIMULATOR_DRIVER) # By default, force release configuration @@ -119,12 +120,12 @@ endIF() #### SimConnect #### IF(WITH_DRIVER_FSX) find_package(SimConnect REQUIRED) -ENDIF() +ENDIF(WITH_DRIVER_FSX) #### DirectPlay #### IF(WITH_DRIVER_FS9) find_package(DirectPlay REQUIRED) -ENDIF() +ENDIF(WITH_DRIVER_FS9) ############### Compilers flags ############### diff --git a/blackd/qt_displayer.cpp b/blackd/qt_displayer.cpp index 31fdcc9ba..fb0e02890 100644 --- a/blackd/qt_displayer.cpp +++ b/blackd/qt_displayer.cpp @@ -30,6 +30,9 @@ void CQtDisplayer::setParam (QPlainTextEdit *debugWindow) void CQtDisplayer::doPrint ( const BlackMisc::CLog::SLogInformation &logInformation, const QString &message) { + if (!m_DebugWindow) + return; + bool needSpace = false; QString line; diff --git a/blacklib/include/blackcore/fsd_messages.h b/blacklib/include/blackcore/fsd_messages.h index 61200ccb0..8711b98fd 100644 --- a/blacklib/include/blackcore/fsd_messages.h +++ b/blacklib/include/blackcore/fsd_messages.h @@ -117,6 +117,7 @@ namespace FSD FSD_MSG_Plane_Position() : FSD_MSG(QString("@")) { + m_message_tokens.resize(10); } inline QString SquawkMode() const { return m_message_tokens.at(0); } @@ -125,7 +126,7 @@ namespace FSD inline quint16 Rating() const { return m_message_tokens.at(3).toUInt(); } inline double Latitude() const { return m_message_tokens.at(4).toDouble(); } inline double Longitude() const { return m_message_tokens.at(5).toDouble(); } - inline qint32 Altitude() const { return m_message_tokens.at(6).toInt(); } + inline double Altitude() const { return m_message_tokens.at(6).toDouble(); } inline qint32 Speed() const { return m_message_tokens.at(7).toInt(); } inline quint32 PBH() const { return m_message_tokens.at(8).toUInt(); } inline qint32 AltDiff() const { return m_message_tokens.at(9).toInt(); } @@ -136,7 +137,7 @@ namespace FSD inline void setRating ( const quint16 rating) { m_message_tokens.replace(3, QString("%1").arg(rating)); } inline void setLatitude ( const double latitude) { m_message_tokens.replace(4, QString("%1").arg(latitude)); } inline void setLongitude ( const double longitude) { m_message_tokens.replace(5, QString("%1").arg(longitude)); } - inline void setAltitude ( const qint32 altitude) { m_message_tokens.replace(6, QString("%1").arg(altitude)); } + inline void setAltitude ( const double altitude) { m_message_tokens.replace(6, QString("%1").arg(altitude)); } inline void setSpeed ( const qint32 speed) { m_message_tokens.replace(7, QString("%1").arg(speed)); } inline void setPBH ( const quint32 pbh) { m_message_tokens.replace(8, QString("%1").arg(pbh)); } inline void setAltDiff ( const qint32 altdiff) { m_message_tokens.replace(9, QString("%1").arg(altdiff)); } diff --git a/blacklib/include/blackcore/interpolator.h b/blacklib/include/blackcore/interpolator.h index 5fcda1014..b19e41b9f 100644 --- a/blacklib/include/blackcore/interpolator.h +++ b/blacklib/include/blackcore/interpolator.h @@ -45,6 +45,7 @@ class CInterpolator { public: CInterpolator(); + virtual ~CInterpolator(); void initialize(); diff --git a/blacklib/include/blackmisc/type_info.h b/blacklib/include/blackmisc/type_info.h index decc28877..7061bd9c7 100644 --- a/blacklib/include/blackmisc/type_info.h +++ b/blacklib/include/blackmisc/type_info.h @@ -6,7 +6,7 @@ #ifndef TYPE_INFO_H #define TYPE_INFO_H -#include +#include namespace BlackMisc { diff --git a/blacklib/src/blackcore/fsd_messages.cpp b/blacklib/src/blackcore/fsd_messages.cpp index f4f374d84..6b4b59973 100644 --- a/blacklib/src/blackcore/fsd_messages.cpp +++ b/blacklib/src/blackcore/fsd_messages.cpp @@ -83,7 +83,6 @@ namespace FSD QTextStream& FSD_MSG_Plane_Position::operator<< ( QTextStream& in) { QString message = in.readAll(); - m_message_tokens.resize(10); qint32 size = unpack(message, m_message_tokens); bAssert ( size == 10 ); diff --git a/blacklib/src/blackcore/interpolator.cpp b/blacklib/src/blackcore/interpolator.cpp index 76e47b5c8..4f4a09040 100644 --- a/blacklib/src/blackcore/interpolator.cpp +++ b/blacklib/src/blackcore/interpolator.cpp @@ -14,6 +14,12 @@ CInterpolator::CInterpolator() m_time.start(); } +CInterpolator::~CInterpolator() +{ + delete m_state_begin; + delete m_state_end; +} + void CInterpolator::initialize() { diff --git a/cmake/modules/FindSimConnect.cmake b/cmake/modules/FindSimConnect.cmake index 9ed37b71a..18bb31176 100644 --- a/cmake/modules/FindSimConnect.cmake +++ b/cmake/modules/FindSimConnect.cmake @@ -18,7 +18,7 @@ FIND_PATH(SIMCONNECT_INCLUDE_DIR "$ENV{ProgramFiles(x86)}/Microsoft Games/Microsoft Flight Simulator X SDK/SDK/Core Utilities Kit/SimConnect SDK" PATH_SUFFIXES inc) -FIND_PATH(SIMCONNECT_LIBRARY +FIND_PATH(SIMCONNECT_LIBRARY_DIR NAMES SimConnect.lib PATHS "$ENV{ProgramFiles(x86)}/Microsoft Games/Microsoft Flight Simulator X SDK/SDK/Core Utilities Kit/SimConnect SDK" @@ -27,4 +27,4 @@ FIND_PATH(SIMCONNECT_LIBRARY # handle the QUIETLY and REQUIRED arguments and set SIMCONNECT_FOUND to TRUE # if all listed variables are TRUE find_package_handle_standard_args(SimConnect DEFAULT_MSG - SIMCONNECT_LIBRARY SIMCONNECT_INCLUDE_DIR) \ No newline at end of file + SIMCONNECT_LIBRARY_DIR SIMCONNECT_INCLUDE_DIR) \ No newline at end of file