Reverse ordering of faces to match old code

Fix missing max(1) on leaf/cluster counts
This commit is contained in:
Jonathan 2022-01-17 16:09:10 -05:00
parent 63b8608799
commit b824acb376
2 changed files with 5 additions and 5 deletions

View File

@ -303,7 +303,7 @@ static std::vector<face_t> CreateBrushFaces(const mapentity_t *src, hullbrush_t
vec_t r;
std::optional<winding_t> w;
qbsp_plane_t plane;
std::vector<face_t> facelist;
std::list<face_t> facelist;
qvec3d point;
vec_t max, min;
@ -345,7 +345,7 @@ static std::vector<face_t> CreateBrushFaces(const mapentity_t *src, hullbrush_t
FError("face->numpoints > MAXEDGES ({}), source face on line {}", MAXEDGES, mapface.linenum);
// this face is a keeper
face_t &f = facelist.emplace_back();
face_t &f = facelist.emplace_front();
f.planenum = PLANENUM_LEAF;
f.w.resize(w->size());
@ -414,7 +414,7 @@ static std::vector<face_t> CreateBrushFaces(const mapentity_t *src, hullbrush_t
hullbrush->bounds = {-delta, delta};
}
return facelist;
return { std::make_move_iterator(facelist.begin()), std::make_move_iterator(facelist.end()) };
}
/*

View File

@ -531,10 +531,10 @@ static void ClusterFlow(int clusternum, leafbits_t &buffer, mbsp_t *bsp)
/* Allocate for worst case where RLE might grow the data (unlikely) */
if (bsp->loadversion->game->id == GAME_QUAKE_II) {
compressed = new uint8_t[(portalleafs * 2) / 8];
compressed = new uint8_t[max(1, (portalleafs * 2) / 8)];
len = CompressRow(outbuffer, (portalleafs + 7) >> 3, compressed);
} else {
compressed = new uint8_t[(portalleafs_real * 2) / 8];
compressed = new uint8_t[max(1, (portalleafs_real * 2) / 8)];
len = CompressRow(outbuffer, (portalleafs_real + 7) >> 3, compressed);
}