From b87102afb26ab07732307b935bc306aecc10dc99 Mon Sep 17 00:00:00 2001 From: Nico de Poel Date: Mon, 6 Feb 2023 16:09:25 +0100 Subject: [PATCH] Export model face data --- main.cpp | 4 ++-- ps1bsp.h | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/main.cpp b/main.cpp index 4c8941f..e221bd6 100644 --- a/main.cpp +++ b/main.cpp @@ -381,8 +381,8 @@ int process_faces(const world_t* world, const TextureList& textures) outModel.origin = model->origin.convertWorldPosition(); outModel.nodeId0 = (u_short)model->node_id0; outModel.nodeId1 = (u_short)model->node_id1; - outModel.nodeId2 = (u_short)model->node_id2; - outModel.nodeId3 = (u_short)model->node_id3; + outModel.firstFace = (u_short)model->face_id; + outModel.numFaces = (u_short)model->face_num; outModels.push_back(outModel); } diff --git a/ps1bsp.h b/ps1bsp.h index 2de23ad..1745db6 100644 --- a/ps1bsp.h +++ b/ps1bsp.h @@ -153,17 +153,22 @@ typedef struct ps1bsp_leaf_s // Run-time data const struct ps1bsp_leaf_s* nextLeaf; // For chaining leafs in drawing order + const struct ps1bsp_model_s* models; } ps1bsp_leaf_t; -typedef struct +typedef struct ps1bsp_model_s { SVECTOR boundingSphere; SVECTOR origin; u_short nodeId0; u_short nodeId1; - u_short nodeId2; - u_short nodeId3; + u_short firstFace; + u_short numFaces; + + // Run-time data + const struct ps1bsp_model_s* nextModel; + const struct ps1bsp_leaf_s* currentLeaf; } ps1bsp_model_t; // Pre-parsed and encoded entity data (this runs the risk of becoming too bloated)