diff --git a/include/qbsp/qbsp.hh b/include/qbsp/qbsp.hh index 84b00747..a3156ecf 100644 --- a/include/qbsp/qbsp.hh +++ b/include/qbsp/qbsp.hh @@ -302,7 +302,7 @@ struct face_t { size_t planenum; int texinfo; - contentflags_t contents; // contents on the front of the face + twosided contents; // contents on the front/back of the face winding_t w; std::vector original_vertices; // the vertices of this face before fragmentation; filled in by EmitVertices std::vector fragments; // the vertices of this face post-fragmentation; filled in by TJunc diff --git a/qbsp/exportobj.cc b/qbsp/exportobj.cc index 0b78feae..b4605ca4 100644 --- a/qbsp/exportobj.cc +++ b/qbsp/exportobj.cc @@ -121,7 +121,7 @@ void ExportObj_Faces(const std::string &filesuffix, const std::vectorcontents.native); + std::string mtlname = fmt::format("contents{}\n", face->contents.back.native); ExportObjFace(objfile, mtlname, face->w, face->get_texinfo(), &vertcount); } diff --git a/qbsp/faces.cc b/qbsp/faces.cc index 4731187d..cf950039 100644 --- a/qbsp/faces.cc +++ b/qbsp/faces.cc @@ -52,12 +52,12 @@ static bool ShouldOmitFace(face_t *f) return true; // HACK: to save a few faces, don't output the interior faces of sky brushes - if (f->contents.is_sky(qbsp_options.target_game)) { + if (f->contents.front.is_sky(qbsp_options.target_game)) { return true; } // omit faces fully covered by detail wall - if (f->contents.is_detail_wall(qbsp_options.target_game)) { + if (f->contents.front.is_detail_wall(qbsp_options.target_game)) { return true; } @@ -138,7 +138,7 @@ Returns a global edge number, possibly negative to indicate a backwards edge. */ inline int64_t GetEdge(const size_t &v1, const size_t &v2, const face_t *face, emit_faces_stats_t &stats) { - if (!face->contents.is_valid(qbsp_options.target_game, false)) + if (!face->contents.front.is_valid(qbsp_options.target_game, false)) FError("Face with invalid contents"); // search for existing edges @@ -495,7 +495,7 @@ static std::unique_ptr FaceFromPortal(portal_t *p, bool pside) f->w = p->winding.clone(); } - f->contents = p->nodes[pside]->contents; + f->contents = {.front = p->nodes[pside]->contents, .back = p->nodes[!pside]->contents}; UpdateFaceSphere(f.get());