mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "menus.h"
|
||||
#include "blackmisc/blackmiscfreefunctions.h"
|
||||
#include "blackmisc/makeunique.h"
|
||||
@@ -16,14 +18,16 @@
|
||||
|
||||
namespace XBus
|
||||
{
|
||||
template <typename T> void *voidptr_cast(T i) // "safe" cast from integer to void*
|
||||
//! "safe" cast from integer to void*
|
||||
template <typename T> void *voidptr_cast(T i)
|
||||
{
|
||||
static_assert(std::is_integral<T>::value, "voidptr_cast expects an integer");
|
||||
typedef typename std::conditional<std::is_signed<T>::value, intptr_t, uintptr_t>::type intptr_type;
|
||||
return reinterpret_cast<void *>(static_cast<intptr_type>(i));
|
||||
}
|
||||
|
||||
template <typename T> T intptr_cast(void *p) // "safe" cast from void* to integer
|
||||
//! "safe" cast from void* to integer
|
||||
template <typename T> T intptr_cast(void *p)
|
||||
{
|
||||
static_assert(std::is_integral<T>::value, "voidptr_cast returns an integer");
|
||||
typedef typename std::conditional<std::is_signed<T>::value, intptr_t, uintptr_t>::type intptr_type;
|
||||
@@ -119,3 +123,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
@@ -17,6 +19,7 @@
|
||||
namespace XBus
|
||||
{
|
||||
|
||||
|
||||
const int c_screenWidth = 1024;
|
||||
const int c_screenHeight = 768;
|
||||
const int c_boxLeft = 128;
|
||||
@@ -141,3 +144,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#ifndef NOMINMAX
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
@@ -38,9 +40,11 @@ namespace XBus
|
||||
surfaces.lights.timeOffset = static_cast<quint16>(qrand() % 0xffff);
|
||||
}
|
||||
|
||||
|
||||
QString g_xplanePath;
|
||||
QString g_sep;
|
||||
|
||||
//! Init global xplane path
|
||||
void initXPlanePath()
|
||||
{
|
||||
char xplanePath[512];
|
||||
@@ -297,7 +301,7 @@ namespace XBus
|
||||
}
|
||||
}
|
||||
|
||||
// memcmp function which ignores the header ("size" member) and compares only the payload (the rest of the struct)
|
||||
//! memcmp function which ignores the header ("size" member) and compares only the payload (the rest of the struct)
|
||||
template <typename T>
|
||||
int memcmpPayload(T *dst, T *src)
|
||||
{
|
||||
@@ -306,7 +310,7 @@ namespace XBus
|
||||
sizeof(*dst) - sizeof(dst->size));
|
||||
}
|
||||
|
||||
// linearly interpolate angle in degrees
|
||||
//! linearly interpolate angle in degrees
|
||||
template <typename T>
|
||||
T lerpDegrees(T from, T to, double factor)
|
||||
{
|
||||
@@ -394,3 +398,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
@@ -7,12 +7,15 @@
|
||||
* contained in the LICENSE file.
|
||||
*/
|
||||
|
||||
//! \cond PRIVATE
|
||||
|
||||
#include "weather.h"
|
||||
#include <QDebug>
|
||||
|
||||
namespace XBus
|
||||
{
|
||||
|
||||
//! Set cloud layer
|
||||
template <class T>
|
||||
void setCloudLayerImpl(T &layer, int base, int tops, int type, int coverage)
|
||||
{
|
||||
@@ -33,6 +36,7 @@ namespace XBus
|
||||
}
|
||||
}
|
||||
|
||||
//! Set wind layer
|
||||
template <class T>
|
||||
void setWindLayerImpl(T &layer, int altitude, float direction, int speed, int shearDirection, int shearSpeed, int turbulence)
|
||||
{
|
||||
@@ -56,3 +60,5 @@ namespace XBus
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//! \endcond
|
||||
|
||||
Reference in New Issue
Block a user