mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
[vulkan] Work around buggy maps with broken brushes
Conflagrant Rodent has a sub-model with 0 faces (double bit error?) causing simply counting faces to get out of sync with actual model starts thus breaking *all* brush models that come after it (including other maps). Thus be a little less lazy in figuring out model start faces.
This commit is contained in:
parent
524c1e27c4
commit
70ece6d5bb
1 changed files with 13 additions and 5 deletions
|
@ -393,12 +393,20 @@ Vulkan_BuildDisplayLists (model_t **models, int num_models, vulkan_ctx_t *ctx)
|
|||
|
||||
face_base = 0;
|
||||
for (int i = 0; i < num_models; i++) {
|
||||
if (models[i] && models[i]->type == mod_brush) {
|
||||
bsp_model_t *m = &bctx->models[models[i]->render_id];
|
||||
m->first_face = face_base;
|
||||
m->face_count = models[i]->brush.nummodelsurfaces;
|
||||
face_base += m->face_count;
|
||||
if (!models[i] || models[i]->type != mod_brush) {
|
||||
continue;
|
||||
}
|
||||
int num_faces = models[i]->brush.numsurfaces;
|
||||
bsp_model_t *m = &bctx->models[models[i]->render_id];
|
||||
m->first_face = face_base + models[i]->brush.firstmodelsurface;
|
||||
m->face_count = models[i]->brush.nummodelsurfaces;
|
||||
while (models[i + 1] && models[i + 1]->path[0] == '*') {
|
||||
i++;
|
||||
m = &bctx->models[models[i]->render_id];
|
||||
m->first_face = face_base + models[i]->brush.firstmodelsurface;
|
||||
m->face_count = models[i]->brush.nummodelsurfaces;
|
||||
}
|
||||
face_base += num_faces;;
|
||||
}
|
||||
|
||||
// All usable surfaces have been chained to the (base) texture they use.
|
||||
|
|
Loading…
Reference in a new issue