Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/Core/Debug/OODebuggerInterface.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ SOFTWARE.
*/


#pragma once

#import "OOFoundation.h"

@class OODebugMonitor;

// Interface for debugger.
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/DockEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import "ShipEntity.h"
#import "StationEntity.h" // For MAX_DOCKING_STAGES

Expand Down
1 change: 1 addition & 0 deletions src/Core/Entities/Entity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ MA 02110-1301, USA.

*/

#pragma once

#import "OOFoundation.h"
#import "OOMaths.h"
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/OOVisualEffectEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

*/

#pragma once

#import "OOEntityWithDrawable.h"
#import "OOPlanetEntity.h"
#import "OOJSPropID.h"
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/OOWaypointEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import "Entity.h"

@interface OOWaypointEntity: Entity <OOBeaconEntity>
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/PlanetEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import "OOStellarBody.h"

#if !NEW_PLANETS
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/PlayerEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import <Foundation/Foundation.h>
#import "WormholeEntity.h"
#import "ShipEntity.h"
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/ShipEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

*/

#pragma once

#import "OOEntityWithDrawable.h"
#import "OOPlanetEntity.h"
#import "OOJSPropID.h"
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/StationEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import "ShipEntity.h"
#import "OOJSInterfaceDefinition.h"
#import "Universe.h"
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Entities/WormholeEntity.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import "Entity.h"

#define WORMHOLE_EXPIRES_TIMEINTERVAL 900.0
Expand Down
3 changes: 3 additions & 0 deletions src/Core/Materials/OOConcreteTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ SOFTWARE.

*/

#pragma once

#import "OOOpenGLExtensionManager.h"
#import "OOTexture.h"


Expand Down
2 changes: 0 additions & 2 deletions src/Core/Materials/OOConcreteTexture.m
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ of this software and associated documentation files (the "Software"), to deal

#import "OOTextureInternal.h"
#import "OOConcreteTexture.h"

#import "OOTextureLoader.h"

#import "OOCollectionExtractors.h"
#import "Universe.h"
#import "ResourceManager.h"
Expand Down
1 change: 0 additions & 1 deletion src/Core/Materials/OOShaderUniformMethodType.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ SOFTWARE.
#if OO_SHADERS || !defined(NDEBUG)

#import "OOMaths.h"
#import "OOHPVector.h"


typedef enum
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Materials/OOTexture.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ SOFTWARE.

*/

#pragma once

#import <Foundation/Foundation.h>

#import "OOOpenGL.h"
Expand Down
2 changes: 2 additions & 0 deletions src/Core/Materials/OOTextureInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ SOFTWARE.

*/

#pragma once

#import "OOTexture.h"
#import "OOOpenGLExtensionManager.h"

Expand Down
4 changes: 3 additions & 1 deletion src/Core/NSFileManagerOOExtensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ MA 02110-1301, USA.

*/

#import <Foundation/Foundation.h>
#pragma once

#import "OOFoundation.h"

#define SAVEDIR "oolite-saves"

Expand Down
3 changes: 2 additions & 1 deletion src/Core/OOALSoundChannel.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ SOFTWARE.

*/

#import <Foundation/Foundation.h>
#pragma once

#import "OOOpenALController.h"
#import "OOMaths.h"

Expand Down
8 changes: 2 additions & 6 deletions src/Core/OOBoundingBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,9 @@ MA 02110-1301, USA.

*/

#pragma once

#ifndef INCLUDED_OOMATHS_h
#error Do not include OOBoundingBox.h directly; include OOMaths.h.
#else

#include "OOHPVector.h"

typedef struct
{
Expand Down Expand Up @@ -112,5 +110,3 @@ OOINLINE Vector OOBoundingBoxCenter(BoundingBox bb)
{
return vector_multiply_scalar(vector_add(bb.min, bb.max), 0.5f);
}

#endif
2 changes: 2 additions & 0 deletions src/Core/OOEquipmentType.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ SOFTWARE.

*/

#pragma once

#import "OOFoundation.h"
#import "OOTypes.h"
#import "OOScript.h"
Expand Down
10 changes: 1 addition & 9 deletions src/Core/OOFastArithmetic.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@ MA 02110-1301, USA.

*/


#ifndef INCLUDED_OOMATHS_h
#error Do not include OOFastArithmetic.h directly; include OOMaths.h.
#else

#pragma once

/* Clamp to range. */
OOINLINE float OOClamp_0_1_f(float value) INLINE_CONST_FUNC;
Expand Down Expand Up @@ -107,7 +103,3 @@ OOINLINE double OOLerpd(double v0, double v1, double fraction)
// Linear interpolation - equivalent to v0 * (1.0 - fraction) + v1 * fraction.
return v0 + fraction * (v1 - v0);
}



#endif /* INCLUDED_OOMATHS_h */
3 changes: 3 additions & 0 deletions src/Core/OOFoundation.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ MA 02110-1301, USA.
causing a warning in Clang. This lets us write #define FOO (1 && OOLITE_DEBUG)
instead.
*/

#pragma once

#ifdef NDEBUG
#define OOLITE_DEBUG 0
#else
Expand Down
14 changes: 3 additions & 11 deletions src/Core/OOHPVector.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ MA 02110-1301, USA.
*/


#ifndef INCLUDED_OOMATHS_h
#error Do not include OOHPVector.h directly; include OOMaths.h.
#else
#pragma once

#include "OOFastArithmetic.h"
#include "OOVector.h"

#ifndef OOMATHS_EXTERNAL_VECTOR_TYPES

Expand Down Expand Up @@ -68,7 +68,6 @@ OOINLINE HPVector2D MakeHPVector2D(OOHPScalar vx, OOHPScalar vy) INLINE_CONST_FU
OOINLINE HPVector vectorToHPVector(Vector v) INLINE_CONST_FUNC;
OOINLINE Vector HPVectorToVector(HPVector v) INLINE_CONST_FUNC;

#if !OOMATHS_STANDALONE
/* Generate random vectors. */
HPVector OORandomUnitHPVector(void);
HPVector OOHPVectorRandomSpatial(OOHPScalar maxLength); // Random vector uniformly distributed in radius-maxLength sphere. (Longer vectors are more common.)
Expand All @@ -78,8 +77,6 @@ HPVector OORandomPositionInShell(HPVector centre, OOHPScalar inner, OOHPScalar o
/* returns the projection of 'point' to the plane defined by the point
'plane' and the normal vector 'normal' */
HPVector OOProjectHPVectorToPlane(HPVector point, HPVector plane, HPVector normal);
#endif


/* Multiply vector by scalar (in place) */
OOINLINE void HPscale_vector(HPVector *outHPVector, OOHPScalar factor) ALWAYS_INLINE_FUNC NONNULL_FUNC;
Expand Down Expand Up @@ -142,11 +139,9 @@ NSArray *ArrayFromHPVector(HPVector vector);

#endif

#if OOMATHS_OPENGL_INTEGRATION
/* OpenGL conveniences. Need to be macros to work with OOMacroOpenGL. */
#define GLVertexOOHPVector(v) do { HPVector v_ = v; glVertex3f(v_.x, v_.y, v_.z); } while (0)
#define GLTranslateOOHPVector(v) do { HPVector v_ = v; OOGL(glTranslatef(v_.x, v_.y, v_.z)); } while (0)
#endif


/*** Only inline definitions beyond this point ***/
Expand Down Expand Up @@ -355,6 +350,3 @@ OOINLINE HPVector HPnormal_to_surface(HPVector v1, HPVector v2, HPVector v3)
d1 = HPvector_subtract(v3, v2);
return HPcross_product(d0, d1);
}


#endif /* INCLUDED_OOMATHS_h */
3 changes: 0 additions & 3 deletions src/Core/OOHPVector.m
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
#endif


#if !OOMATHS_STANDALONE
/* This generates random vectors distrubuted evenly over the surface of the
unit sphere. It does this the simple way, by generating vectors in the
half-unit cube and rejecting those outside the half-unit sphere (and the
Expand Down Expand Up @@ -142,5 +141,3 @@ HPVector OOProjectHPVectorToPlane(HPVector point, HPVector plane, HPVector norma
{
return HPvector_subtract(point,HPvector_multiply_scalar(normal,HPdot_product(HPvector_subtract(point, plane), normal)));
}

#endif
2 changes: 2 additions & 0 deletions src/Core/OOJoystickManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ MA 02110-1301, USA.

*/

#pragma once

#import "OOFoundation.h"


Expand Down
4 changes: 4 additions & 0 deletions src/Core/OOJoystickProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ MA 02110-1301, USA.

*/

#pragma once

#import "OOFoundation.h"

#define STICKPROFILE_TYPE_STANDARD 1
#define STICKPROFILE_TYPE_SPLINE 2
#define STICKPROFILE_MAX_POWER 10.0
Expand Down
28 changes: 1 addition & 27 deletions src/Core/OOMaths.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,12 @@ MA 02110-1301, USA.
*/


#ifndef INCLUDED_OOMATHS_h
#define INCLUDED_OOMATHS_h
#pragma once

#ifdef __cplusplus
extern "C" {
#endif

#ifndef OOMATHS_STANDALONE
#define OOMATHS_STANDALONE 0
#endif

#ifndef OOMATHS_OPENGL_INTEGRATION
#define OOMATHS_OPENGL_INTEGRATION !OOMATHS_STANDALONE
#endif

#ifdef __OBJC__
#import <Foundation/Foundation.h>
#endif
Expand All @@ -54,17 +45,9 @@ extern "C" {
#include <stdint.h>
#include <limits.h>
#include <assert.h>

#if OOMATHS_OPENGL_INTEGRATION
#include "OOOpenGL.h"
#endif


#if OOMATHS_OPENGL_INTEGRATION
typedef GLfloat OOScalar;
#else
typedef float OOScalar;
#endif

typedef double OOHPScalar;

Expand Down Expand Up @@ -119,23 +102,14 @@ typedef double OOHPScalar;
#endif


#include "OOFastArithmetic.h"
#include "OOVector.h"
#include "OOHPVector.h"
#include "OOQuaternion.h"
#include "OOMatrix.h"

#if !OOMATHS_STANDALONE
#include "OOVoxel.h"
#include "OOTriangle.h"
#include "OOBoundingBox.h"

#include "legacy_random.h"
#endif


#ifdef __cplusplus
}
#endif

#endif /* INCLUDED_OOMATHS_h */
Loading
Loading