diff options
| author | MegaMech <MegaMech@users.noreply.github.com> | 2025-01-23 11:22:07 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-01-23 11:22:07 -0700 |
| commit | 1f189dfa804a05177f99dda1044898eb63fdcb3f (patch) | |
| tree | 598e0a6c26a5554afd1fcbcd801079fd1df090d3 /src/engine/CoreMath.h | |
| parent | 24ecfc3db43bfa606f41c42ef8778f96b5047c6b (diff) | |
Game.cpp and World.cpp Cleanup (#159)
* Remove CProperties and delete dup Properties from World.h
* Improvement
* Fix compile
* Cleanup
* Document gRaceState
* wip cleanup
* compile
* Impl PlayerBombKart
* Rename CourseManager_ to CM_
* Finish renames m_ to CM_
* cleanup
* Remove extra printf
---------
Co-authored-by: MegaMech <7255464+MegaMech@users.noreply.github.com>
Diffstat (limited to 'src/engine/CoreMath.h')
| -rw-r--r-- | src/engine/CoreMath.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/engine/CoreMath.h b/src/engine/CoreMath.h index c5f3211f4..ea74dd9a4 100644 --- a/src/engine/CoreMath.h +++ b/src/engine/CoreMath.h @@ -1,4 +1,5 @@ -#pragma once +#ifndef CORE_MATH_H +#define CORE_MATH_H #include <libultraship.h> @@ -13,6 +14,7 @@ struct FVector { float x, y, z; +#ifdef __cplusplus FVector& operator=(const FVector& other) { x = other.x; y = other.y; @@ -22,6 +24,7 @@ struct FVector { FVector() : x(0), y(0), z(0) {} FVector(float x, float y, float z) : x(x), y(y), z(z) {} +#endif // __cplusplus }; /** @@ -33,6 +36,7 @@ struct FVector { struct FVector2D { float x, z; +#ifdef __cplusplus FVector2D& operator=(const FVector2D& other) { x = other.x; z = other.z; @@ -41,12 +45,14 @@ struct FVector2D { FVector2D() : x(0), z(0) {} FVector2D(float x, float z) : x(x), z(z) {} +#endif // __cplusplus }; // Sets integer X Z coordinates -struct IVector2D { +typedef struct IVector2D { int32_t X, Z; +#ifdef __cplusplus IVector2D() : X(0), Z(0) {} // Default constructor IVector2D(int32_t x, int32_t z) : X(x), Z(z) {} // Constructor to initialize with values @@ -57,11 +63,13 @@ struct IVector2D { Z = other.Z; return *this; } -}; +#endif // __cplusplus +} IVector2D; struct FRotation { float pitch, yaw, roll; +#ifdef __cplusplus FRotation& operator=(const FRotation& other) { pitch = other.pitch; yaw = other.yaw; @@ -71,6 +79,7 @@ struct FRotation { FRotation() : pitch(0), yaw(0), roll(0) {} FRotation(float p, float y, float r) : pitch(p), yaw(y), roll(r) {} +#endif // __cplusplus }; /** @@ -80,6 +89,7 @@ struct FRotation { struct IPathSpan { int Start, End; +#ifdef __cplusplus // Default Constructor IPathSpan() : Start(0), End(0) {} @@ -105,4 +115,7 @@ struct IPathSpan { bool operator!=(const IPathSpan& Other) const { return !(*this == Other); } +#endif // __cplusplus }; + +#endif // CORE_MATH_H
\ No newline at end of file |
