Improved consistency of comment formatting.
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
//Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
|
||||
//National Aeronautics and Space Administration. All Rights Reserved.
|
||||
// Copyright (c) 2013-2015 United States Government as represented by the Administrator of the
|
||||
// National Aeronautics and Space Administration. All Rights Reserved.
|
||||
//
|
||||
//X-Plane API
|
||||
//Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved.
|
||||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
//associated documentation files(the "Software"), to deal in the Software without restriction,
|
||||
//including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
//sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
|
||||
//furnished to do so, subject to the following conditions :
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Neither the names of the authors nor that of X - Plane or Laminar Research
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission from the authors or
|
||||
// Laminar Research, respectively.
|
||||
// X-Plane API
|
||||
// Copyright(c) 2008, Sandy Barbour and Ben Supnik All rights reserved.
|
||||
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
// associated documentation files(the "Software"), to deal in the Software without restriction,
|
||||
// including without limitation the rights to use, copy, modify, merge, publish, distribute,
|
||||
// sublicense, and / or sell copies of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions :
|
||||
// * Redistributions of source code must retain the above copyright notice,
|
||||
// this list of conditions and the following disclaimer.
|
||||
// * Neither the names of the authors nor that of X - Plane or Laminar Research
|
||||
// may be used to endorse or promote products derived from this software
|
||||
// without specific prior written permission from the authors or
|
||||
// Laminar Research, respectively.
|
||||
#include "Drawing.h"
|
||||
|
||||
#include "XPLMDisplay.h"
|
||||
@@ -23,7 +23,7 @@
|
||||
#include <cmath>
|
||||
#include <string>
|
||||
#include <cstring>
|
||||
//OpenGL includes
|
||||
// OpenGL includes
|
||||
#if IBM
|
||||
#include <windows.h>
|
||||
#endif
|
||||
@@ -31,11 +31,11 @@
|
||||
# include <OpenGL/gl.h>
|
||||
#else
|
||||
# include <GL/gl.h>
|
||||
#endif/*__APPLE__*/
|
||||
#endif
|
||||
|
||||
namespace XPC
|
||||
{
|
||||
//Internal Structures
|
||||
// Internal Structures
|
||||
typedef struct
|
||||
{
|
||||
double x;
|
||||
@@ -43,7 +43,7 @@ namespace XPC
|
||||
double z;
|
||||
} LocalPoint;
|
||||
|
||||
//Internal Memory
|
||||
// Internal Memory
|
||||
static const size_t MSG_MAX = 1024;
|
||||
static const size_t MSG_LINE_MAX = MSG_MAX / 16;
|
||||
static bool msgEnabled = false;
|
||||
@@ -64,7 +64,7 @@ namespace XPC
|
||||
XPLMDataRef planeYref;
|
||||
XPLMDataRef planeZref;
|
||||
|
||||
//Internal Functions
|
||||
// Internal Functions
|
||||
|
||||
/// Comparse two size_t integers. Used by qsort in RemoveWaypoints.
|
||||
static int cmp(const void * a, const void * b)
|
||||
@@ -90,34 +90,34 @@ namespace XPC
|
||||
/// \param d The distance from the player airplane to the center of the cube.
|
||||
static void gl_drawCube(float x, float y, float z, float d)
|
||||
{
|
||||
//tan(0.25) degrees. Should scale all markers to appear about the same size
|
||||
// tan(0.25) degrees. Should scale all markers to appear about the same size
|
||||
const float TAN = 0.00436335F;
|
||||
float h = d * TAN;
|
||||
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
//Top
|
||||
// Top
|
||||
glVertex3f(x - h, y + h, z - h);
|
||||
glVertex3f(x + h, y + h, z - h);
|
||||
glVertex3f(x - h, y + h, z + h);
|
||||
glVertex3f(x + h, y + h, z + h);
|
||||
//Front
|
||||
// Front
|
||||
glVertex3f(x - h, y - h, z + h);
|
||||
glVertex3f(x + h, y - h, z + h);
|
||||
//Bottom
|
||||
// Bottom
|
||||
glVertex3f(x - h, y - h, z - h);
|
||||
glVertex3f(x + h, y - h, z - h);
|
||||
//Back
|
||||
// Back
|
||||
glVertex3f(x - h, y + h, z - h);
|
||||
glVertex3f(x + h, y + h, z - h);
|
||||
|
||||
glEnd();
|
||||
glBegin(GL_QUADS);
|
||||
//Left
|
||||
// Left
|
||||
glVertex3f(x - h, y + h, z - h);
|
||||
glVertex3f(x - h, y + h, z + h);
|
||||
glVertex3f(x - h, y - h, z + h);
|
||||
glVertex3f(x - h, y - h, z - h);
|
||||
//Right
|
||||
// Right
|
||||
glVertex3f(x + h, y + h, z + h);
|
||||
glVertex3f(x + h, y + h, z - h);
|
||||
glVertex3f(x + h, y - h, z - h);
|
||||
@@ -147,7 +147,7 @@ namespace XPC
|
||||
float py = XPLMGetDataf(planeYref);
|
||||
float pz = XPLMGetDataf(planeZref);
|
||||
|
||||
//Convert to local
|
||||
// Convert to local
|
||||
for (size_t i = 0; i < numWaypoints; ++i)
|
||||
{
|
||||
Waypoint* g = &waypoints[i];
|
||||
@@ -157,7 +157,7 @@ namespace XPC
|
||||
}
|
||||
|
||||
|
||||
//Draw posts
|
||||
// Draw posts
|
||||
glColor3f(1.0F, 1.0F, 1.0F);
|
||||
glBegin(GL_LINES);
|
||||
for (size_t i = 0; i < numWaypoints; ++i)
|
||||
@@ -168,7 +168,7 @@ namespace XPC
|
||||
}
|
||||
glEnd();
|
||||
|
||||
//Draw route
|
||||
// Draw route
|
||||
glColor3f(1.0F, 0.0F, 0.0F);
|
||||
glBegin(GL_LINE_STRIP);
|
||||
for (size_t i = 0; i < numWaypoints; ++i)
|
||||
@@ -178,7 +178,7 @@ namespace XPC
|
||||
}
|
||||
glEnd();
|
||||
|
||||
//Draw markers
|
||||
// Draw markers
|
||||
glColor3f(1.0F, 1.0F, 1.0F);
|
||||
for (size_t i = 0; i < numWaypoints; ++i)
|
||||
{
|
||||
@@ -192,7 +192,7 @@ namespace XPC
|
||||
return 1;
|
||||
}
|
||||
|
||||
//Public Functions
|
||||
// Public Functions
|
||||
void Drawing::ClearMessage()
|
||||
{
|
||||
XPLMUnregisterDrawCallback(MessageDrawCallback, xplm_Phase_Window, 0, NULL);
|
||||
@@ -209,7 +209,7 @@ namespace XPC
|
||||
return;
|
||||
}
|
||||
|
||||
//Set the message, location, and mark new lines.
|
||||
// Set the message, location, and mark new lines.
|
||||
strncpy(msgVal, msg, len + 1);
|
||||
newLineCount = 0;
|
||||
for (size_t i = 0; i < len && newLineCount < MSG_LINE_MAX; ++i)
|
||||
@@ -223,7 +223,7 @@ namespace XPC
|
||||
msgX = x < 0 ? 10 : x;
|
||||
msgY = y < 0 ? 600 : y;
|
||||
|
||||
//Enable drawing if necessary
|
||||
// Enable drawing if necessary
|
||||
if (!msgEnabled)
|
||||
{
|
||||
XPLMRegisterDrawCallback(MessageDrawCallback, xplm_Phase_Window, 0, NULL);
|
||||
@@ -268,7 +268,7 @@ namespace XPC
|
||||
|
||||
void Drawing::RemoveWaypoints(Waypoint points[], size_t numPoints)
|
||||
{
|
||||
//Build a list of indices of waypoints we should delete.
|
||||
// Build a list of indices of waypoints we should delete.
|
||||
size_t delPoints[WAYPOINT_MAX];
|
||||
size_t delPointsCur = 0;
|
||||
for (size_t i = 0; i < numPoints; ++i)
|
||||
@@ -286,10 +286,10 @@ namespace XPC
|
||||
}
|
||||
}
|
||||
}
|
||||
//Sort the indices so that we only have to iterate them once
|
||||
// Sort the indices so that we only have to iterate them once
|
||||
qsort(delPoints, delPointsCur, sizeof(size_t), cmp);
|
||||
|
||||
//Copy the new array on top of the old array
|
||||
// Copy the new array on top of the old array
|
||||
size_t copyCur = 0;
|
||||
size_t count = delPointsCur;
|
||||
delPointsCur = 0;
|
||||
|
||||
Reference in New Issue
Block a user