diff --git a/include/qbsp/qbsp.hh b/include/qbsp/qbsp.hh index 7bf2f511..659bea13 100644 --- a/include/qbsp/qbsp.hh +++ b/include/qbsp/qbsp.hh @@ -229,7 +229,7 @@ struct face_t : face_fragment_t vec_t radius; // filled by TJunc - std::list fragments; + std::vector fragments; }; struct surface_t diff --git a/qbsp/tjunc.cc b/qbsp/tjunc.cc index c3954476..25a47c56 100644 --- a/qbsp/tjunc.cc +++ b/qbsp/tjunc.cc @@ -309,7 +309,7 @@ restart: w.resize(w.size() - (neww.size() - 2)); - face->fragments.emplace_front(face_fragment_t { std::move(neww) }); + face->fragments.push_back(face_fragment_t { std::move(neww) }); } while (1); } @@ -400,17 +400,10 @@ static void tjunc_fix_r(node_t *node, face_t *superface) if (node->planenum == PLANENUM_LEAF) return; - face_t *root = nullptr, *next; - - for (face_t *face = node->faces; face; face = next) { - next = face->next; + for (face_t *face = node->faces; face; face = face->next) { FixFaceEdges(face, superface); - face->next = root; - root = face; } - node->faces = root; - tjunc_fix_r(node->children[0], superface); tjunc_fix_r(node->children[1], superface); }