From ec82ff4158dc373d662afa3f640d4b1b82e5c18b Mon Sep 17 00:00:00 2001 From: JackCarterSmith Date: Mon, 20 Feb 2023 22:25:57 +0100 Subject: [PATCH] More details on hob struct --- RSPModelLib/include/RSPModel_datatypes.h | 6 +++--- RSPModelLib/src/hob_struct2.h | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/RSPModelLib/include/RSPModel_datatypes.h b/RSPModelLib/include/RSPModel_datatypes.h index 7da867f..17a6207 100644 --- a/RSPModelLib/include/RSPModel_datatypes.h +++ b/RSPModelLib/include/RSPModel_datatypes.h @@ -47,15 +47,15 @@ typedef struct rspmodel_vertex { short x,y,z,w; } T_RSPMODEL_VERTEX; typedef struct rspmodel_texcoord { short u,v; } T_RSPMODEL_TEXCOORD; typedef struct face_flags { - unsigned int fUnknown0:1; - unsigned int fUnknown1:1; + unsigned int fUnused0:1; //TODO: Parse all HOB to find anyone with this field different of 0 + unsigned int fUnused1:1; //TODO: Parse all HOB to find anyone with this field different of 0 unsigned int fHasTexture:1; unsigned int fIsQuad:1; unsigned int fSeparateColorVertex:1; unsigned int fHasColor:1; unsigned int fHasExtraBytesBeforeColor:1; - unsigned int fIsTransparent:1; + unsigned int fNoCulled:1; // Face with this flag always be rendered without culling, usefull to render "flat" object unsigned int fUnknown8:1; unsigned int fUnknown9:1; diff --git a/RSPModelLib/src/hob_struct2.h b/RSPModelLib/src/hob_struct2.h index fe4123a..62a1b5a 100644 --- a/RSPModelLib/src/hob_struct2.h +++ b/RSPModelLib/src/hob_struct2.h @@ -205,11 +205,11 @@ typedef struct PACK hobfile_faceblock { typedef struct PACK hobfile_faces_header { unsigned int flags; - unsigned char b1; - unsigned char b2; - unsigned char b3; + unsigned char b1; // Seem to alter texture mapping on face, 49 -> quad face, 48 -> tri face, 47 -> N/A + unsigned char b2; // 61 -> texture right rotation, 71 -> little red overlay, 81 -> bigger red overlay, x1 -> don't do anything + unsigned char b3; // Seem to alter rendering matrix or maybe vertices position relative to unsigned char faceBlockIntSize; // Bytes size divided by 4, count as number of UInt32 type. - unsigned short headerSeparator; + unsigned short headerSeparator; // If header it's uncommon, it's probably because you made a wrong parsing unsigned short materialIndex; unsigned short vertexIndices[4]; // Relative to facegroup, the last value is equal to 0 when it's triangle shape. } T_HOBFILE_FACES_HEADER;