spm-headers gcc fixes

This commit is contained in:
Seeky 2024-09-13 16:08:43 +01:00
parent 2a2e7f6bbf
commit 8bb038eb14
7 changed files with 24 additions and 10 deletions

View File

@ -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>

View File

@ -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:

View File

@ -10,6 +10,9 @@
namespace nw4r {
namespace math {
USING(wii::mtx::Vec3)
USING(wii::mtx::Mtx34)
struct _VEC2
{
f32 x, y;
@ -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); }
@ -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); }
@ -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;
@ -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,
@ -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; }

View File

@ -10,6 +10,8 @@
namespace nw4r {
namespace ut {
USING(wii::gx::GXColor)
class Color : public GXColor {
public:
Color() { *this = 0xFFFFFFFF; }

View File

@ -168,11 +168,11 @@ public:
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;

View File

@ -11,6 +11,7 @@
CPP_WRAPPER(spm::camdrv)
USING(wii::gx::GXProjectionType)
USING(wii::mtx::Vec3)
USING(wii::mtx::Mtx34)
USING(wii::mtx::Mtx44)

View File

@ -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);