bsputils: add BSP_GetWorldModel

This commit is contained in:
Eric Wasylishen 2017-06-25 14:37:26 -06:00
parent 572cfd6118
commit 602616451c
2 changed files with 10 additions and 0 deletions

View File

@ -23,6 +23,15 @@
#include <common/qvec.hh>
const dmodel_t *BSP_GetWorldModel(const bsp2_t *bsp)
{
// We only support .bsp's that have a world model
if (bsp->nummodels < 1) {
Error("BSP has no models");
}
return &bsp->dmodels[0];
}
int Face_GetNum(const bsp2_t *bsp, const bsp2_dface_t *f)
{
Q_assert(f != nullptr);

View File

@ -26,6 +26,7 @@
#include <common/qvec.hh>
const dmodel_t *BSP_GetWorldModel(const bsp2_t *bsp);
int Face_GetNum(const bsp2_t *bsp, const bsp2_dface_t *f);
const bsp2_dface_t *BSP_GetFace(const bsp2_t *bsp, int fnum);
bsp2_dface_t *BSP_GetFace(bsp2_t *bsp, int fnum);