Skip to content

Commit

Permalink
spm-headers gcc fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
SeekyCt committed Sep 13, 2024
1 parent 2a2e7f6 commit 8bb038e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 10 deletions.
1 change: 1 addition & 0 deletions spm-headers/include/nw4r/lyt/layout.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <common.h>
#include <wii/mem.h>
#include <msl/new.h>
#include <nw4r/lyt/animation.h>
#include <nw4r/lyt/pane.h>
Expand Down
3 changes: 3 additions & 0 deletions spm-headers/include/nw4r/lyt/material.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
#pragma once

#include <common.h>
#include <wii/gx.h>
#include <nw4r/ut/linkList.h>

namespace nw4r {
namespace lyt {

USING(wii::gx::GXColorS10)

class Material
{
public:
Expand Down
21 changes: 14 additions & 7 deletions spm-headers/include/nw4r/math/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
namespace nw4r {
namespace math {

USING(wii::mtx::Vec3)
USING(wii::mtx::Mtx34)

struct _VEC2
{
f32 x, y;
Expand All @@ -18,10 +21,10 @@ struct _VEC2
struct VEC2 : _VEC2
{
VEC2() {}
VEC2(f32 x, f32 y)
VEC2(f32 x_, f32 y_)
{
this->x = x;
this->y = y;
this->x = x_;
this->y = y_;
}

operator f32*() { return reinterpret_cast<f32*>(this); }
Expand All @@ -37,11 +40,11 @@ struct _VEC3
struct VEC3 : _VEC3
{
VEC3() {}
VEC3(f32 x, f32 y, f32 z)
VEC3(f32 x_, f32 y_, f32 z_)
{
this->x = x;
this->y = y;
this->z = z;
this->x = x_;
this->y = y_;
this->z = z_;
}

operator Vec3*() { return reinterpret_cast<Vec3*>(this); }
Expand All @@ -53,12 +56,14 @@ struct _MTX34
{
union
{
#ifdef DECOMP
struct
{
f32 _00, _01, _02, _03,
_10, _11, _12, _13,
_20, _21, _22, _23;
};
#endif
f32 m[3][4];
f32 a[3 * 4];
Mtx34 mtx;
Expand All @@ -72,6 +77,7 @@ struct MTX34 : public _MTX34

MTX34() {}

#ifdef DECOMP
// clang-format off
MTX34(f32 f00, f32 f01, f32 f02, f32 f03,
f32 f10, f32 f11, f32 f12, f32 f13,
Expand All @@ -81,6 +87,7 @@ struct MTX34 : public _MTX34
_20 = f20; _21 = f21; _22 = f22; _23 = f23;
}
// clang-format on
#endif

operator MtxRef() { return mtx; }
operator MtxRefConst() const { return mtx; }
Expand Down
2 changes: 2 additions & 0 deletions spm-headers/include/nw4r/ut/color.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
namespace nw4r {
namespace ut {

USING(wii::gx::GXColor)

class Color : public GXColor {
public:
Color() { *this = 0xFFFFFFFF; }
Expand Down
4 changes: 2 additions & 2 deletions spm-headers/include/nw4r/ut/linkList.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ template <typename TIter> class ReverseIterator {
return *this;
}

const TIter::TElem* operator->() const {
const typename TIter::TElem* operator->() const {
return &this->operator*();
}

TIter::TElem& operator*() const {
typename TIter::TElem& operator*() const {
TIter it = mCurrent;
--it;
return *it;
Expand Down
1 change: 1 addition & 0 deletions spm-headers/include/spm/camdrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

CPP_WRAPPER(spm::camdrv)

USING(wii::gx::GXProjectionType)
USING(wii::mtx::Vec3)
USING(wii::mtx::Mtx34)
USING(wii::mtx::Mtx44)
Expand Down
2 changes: 1 addition & 1 deletion spm-headers/include/spm/fadedrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

CPP_WRAPPER(spm::fadedrv)

USING(wii::GX::GXColor)
USING(wii::gx::GXColor)

void fadeInit();
void fadeEntry(u32 transitionType, s32 param_2, GXColor colour);
Expand Down

0 comments on commit 8bb038e

Please sign in to comment.