diff --git a/include/common/bspfile.hh b/include/common/bspfile.hh index 78c29ba3..14d143bf 100644 --- a/include/common/bspfile.hh +++ b/include/common/bspfile.hh @@ -714,6 +714,27 @@ typedef struct bspxentry_s struct bspxentry_s *next; } bspxentry_t; +// BRUSHLIST BSPX lump + +struct bspxbrushes_permodel { + int32_t ver; + int32_t modelnum; + int32_t numbrushes; + int32_t numfaces; +}; +struct bspxbrushes_perbrush { + float mins[3]; + float maxs[3]; + int16_t contents; + uint16_t numfaces; +}; +struct bspxbrushes_perface { + float normal[3]; + float dist; +}; + +/* ========================================================================= */ + struct bsp29_t { int nummodels; dmodelq1_t *dmodels_q; diff --git a/qbsp/qbsp.cc b/qbsp/qbsp.cc index d0b85e71..935e8041 100644 --- a/qbsp/qbsp.cc +++ b/qbsp/qbsp.cc @@ -515,26 +515,7 @@ void BSPX_Brushes_AddModel(struct bspxbrushes_s *ctx, int modelnum, brush_t *bru brush_t *b; face_t *f; - struct - { - int ver; - int modelnum; - int numbrushes; - int numfaces; - } permodel; - struct - { - float mins[3]; - float maxs[3]; - short contents; - unsigned short numfaces; - } perbrush; - struct - { - float normal[3]; - float dist; - } perface; - + bspxbrushes_permodel permodel; permodel.numbrushes = 0; permodel.numfaces = 0; for (b = brushes; b; b = b->next) @@ -559,6 +540,7 @@ void BSPX_Brushes_AddModel(struct bspxbrushes_s *ctx, int modelnum, brush_t *bru for (b = brushes; b; b = b->next) { + bspxbrushes_perbrush perbrush; perbrush.numfaces = 0; for (f = b->faces; f; f = f->next) { @@ -605,6 +587,7 @@ void BSPX_Brushes_AddModel(struct bspxbrushes_s *ctx, int modelnum, brush_t *bru for (f = b->faces; f; f = f->next) { + bspxbrushes_perface perface; /*skip axial*/ if (fabs(map.planes[f->planenum].normal[0]) == 1 || fabs(map.planes[f->planenum].normal[1]) == 1 ||