qbsp: restore weird 1 unit bounds shrinkage Q1 needs

This commit is contained in:
Eric Wasylishen 2022-06-22 22:37:09 -06:00
parent af802d5447
commit 92af2ed3f7
2 changed files with 9 additions and 3 deletions

View File

@ -974,9 +974,9 @@ TEST_CASE("q1_cube", "[testmaps_q1]")
CHECK(cube_bounds_grown.mins() == headnode.mins);
CHECK(cube_bounds_grown.maxs() == headnode.maxs);
// model bounds
// CHECK(cube_bounds_grown.mins() == bsp.dmodels[0].mins);
// CHECK(cube_bounds_grown.maxs() == bsp.dmodels[0].maxs);
// model bounds are shrunk by 1 unit on each side for some reason
CHECK(cube_bounds.grow(-1).mins() == bsp.dmodels[0].mins);
CHECK(cube_bounds.grow(-1).maxs() == bsp.dmodels[0].maxs);
}
/**

View File

@ -272,6 +272,12 @@ void ExportDrawNodes(mapentity_t *entity, node_t *headnode, int firstface)
dmodel.mins[i] = headnode->bounds.mins()[i] + SIDESPACE;
dmodel.maxs[i] = headnode->bounds.maxs()[i] - SIDESPACE;
}
// shrink the bounds in Q1 based games (Q1 engine compensates for this in Mod_LoadSubmodels)
if (options.target_game->id != GAME_QUAKE_II) {
dmodel.mins += qvec3d(1,1,1);
dmodel.maxs -= qvec3d(1,1,1);
}
}
//=============================================================================