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
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,7 @@ def MatchingFor(*versions):
Object(Matching, "SB/Core/x/xQuickCull.cpp"),
Object(Matching, "SB/Core/x/xsavegame.cpp"),
Object(NonMatching, "SB/Core/x/xScene.cpp", extra_cflags=["-sym on"]),
Object(NonMatching, "SB/Core/x/xScrFx.cpp"),
Object(Equivalent, "SB/Core/x/xScrFx.cpp", extra_cflags=["-sym on"]),
Object(NonMatching, "SB/Core/x/xserializer.cpp"),
Object(NonMatching, "SB/Core/x/xSFX.cpp"),
Object(NonMatching, "SB/Core/x/xShadow.cpp"),
Expand Down
78 changes: 60 additions & 18 deletions include/rwsdk/rwcore.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,73 @@

#include <rwsdk/rwplcore.h>

typedef struct _RxObjSpace3DVertex RxObjSpace3DVertex;

union RxColorUnion
{
RwRGBA preLitColor;
RwRGBA color;
};

// TODO: Determine whether c should go before or after objNormal
// Context: These headers came from an official header source (unsure of release platform)
// However, currently decomped functions seem to pack the struct
// in this particular way so it's like this for now.
// See: zActionLIne.cpp
struct _RxObjSpace3DVertex
{
RwV3d objVertex;
RwV3d objNormal;
RxColorUnion c;
typedef struct RxObjSpace3DVertex RxObjSpace3DVertex;
struct RxObjSpace3DVertex
{
RwReal x;
RwReal y;
RwReal z;
RwReal nx;
RwReal ny;
RwReal nz;
RwUInt8 r;
RwUInt8 g;
RwUInt8 b;
RwUInt8 a;
RwReal u;
RwReal v;
};

typedef RxObjSpace3DVertex RxObjSpace3DLitVertex;
typedef RxObjSpace3DLitVertex RwIm3DVertex;

#define RwIm3DVertexSetPos(_vert, _imx, _imy, _imz) \
MACRO_START \
{ \
(_vert)->x = _imx; \
(_vert)->y = _imy; \
(_vert)->z = _imz; \
} \
MACRO_STOP

#define RwIm3DVertexSetNormal(_vert, _imx, _imy, _imz) \
MACRO_START \
{ \
(_vert)->nx = _imx; \
(_vert)->ny = _imy; \
(_vert)->nz = _imz; \
} \
MACRO_STOP

#define RwIm3DVertexSetRGBA(_vert, _r, _g, _b, _a) \
MACRO_START \
{ \
(_vert)->r = _r; \
(_vert)->g = _g; \
(_vert)->b = _b; \
(_vert)->a = _a; \
} \
MACRO_STOP

#define RwIm3DVertexSetUV(_vert, _u, _v) \
MACRO_START \
{ \
(_vert)->u = _u; \
(_vert)->v = _v; \
} \
MACRO_STOP

enum RwIm3DTransformFlags
{
rwIM3D_VERTEXUV = 1,
rwIM3D_ALLOPAQUE = 2,
rwIM3D_NOCLIP = 4,
rwIM3D_VERTEXXYZ = 8,
rwIM3D_VERTEXRGBA = 16,
rwIM3DTRANSFORMFLAGSFORCEENUMSIZEINT = RWFORCEENUMSIZEINT
};
typedef enum RwIm3DTransformFlags RwIm3DTransformFlags;

typedef struct rxHeapFreeBlock;
typedef struct rxHeapSuperBlockDescriptor;
typedef struct RxHeap;
Expand Down
2 changes: 1 addition & 1 deletion src/SB/Core/gc/iParMgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void iRenderFlush()

void iRenderTrianglesImmediate(S32 vertType, S32 vertTypeSize, void* data, S32 dataSize, U16* index, S32 indexSize)
{
if (RwIm3DTransform((_RxObjSpace3DVertex *)data, dataSize, NULL, 1) != NULL)
if (RwIm3DTransform((RwIm3DVertex *)data, dataSize, NULL, 1) != NULL)
{
if (indexSize != 0)
{
Expand Down
Loading