vis: fix to use mbsp_t
This commit is contained in:
parent
cbba35a346
commit
abf2a3665b
|
|
@ -48,7 +48,7 @@ const bsp2_dface_t *BSP_GetFace(const mbsp_t *bsp, int fnum)
|
|||
return &bsp->dfaces[fnum];
|
||||
}
|
||||
|
||||
bsp2_dface_t *BSP_GetFace(bsp2_t *bsp, int fnum)
|
||||
bsp2_dface_t *BSP_GetFace(mbsp_t *bsp, int fnum)
|
||||
{
|
||||
Q_assert(fnum >= 0 && fnum < bsp->numfaces);
|
||||
return &bsp->dfaces[fnum];
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@
|
|||
const dmodel_t *BSP_GetWorldModel(const mbsp_t *bsp);
|
||||
int Face_GetNum(const mbsp_t *bsp, const bsp2_dface_t *f);
|
||||
const bsp2_dface_t *BSP_GetFace(const mbsp_t *bsp, int fnum);
|
||||
bsp2_dface_t *BSP_GetFace(bsp2_t *bsp, int fnum);
|
||||
bsp2_dface_t *BSP_GetFace(mbsp_t *bsp, int fnum);
|
||||
int Face_VertexAtIndex(const mbsp_t *bsp, const bsp2_dface_t *f, int v);
|
||||
void Face_PointAtIndex(const mbsp_t *bsp, const bsp2_dface_t *f, int v, vec3_t point_out);
|
||||
plane_t Face_Plane(const mbsp_t *bsp, const bsp2_dface_t *f);
|
||||
|
|
|
|||
|
|
@ -139,7 +139,7 @@ void BasePortalVis(void);
|
|||
|
||||
void PortalFlow(portal_t *p);
|
||||
|
||||
void CalcAmbientSounds(bsp2_t *bsp);
|
||||
void CalcAmbientSounds(mbsp_t *bsp);
|
||||
|
||||
extern double starttime, endtime, statetime;
|
||||
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ Find an aproximate distance to the nearest emiter of each class for each leaf.
|
|||
====================
|
||||
*/
|
||||
static void
|
||||
SurfaceBBox(const bsp2_t *bsp, const bsp2_dface_t *surf,
|
||||
SurfaceBBox(const mbsp_t *bsp, const bsp2_dface_t *surf,
|
||||
vec3_t mins, vec3_t maxs)
|
||||
{
|
||||
int i, j;
|
||||
|
|
@ -71,13 +71,13 @@ SurfaceBBox(const bsp2_t *bsp, const bsp2_dface_t *surf,
|
|||
====================
|
||||
*/
|
||||
void
|
||||
CalcAmbientSounds(bsp2_t *bsp)
|
||||
CalcAmbientSounds(mbsp_t *bsp)
|
||||
{
|
||||
const bsp2_dface_t *surf;
|
||||
const texinfo_t *info;
|
||||
const gtexinfo_t *info;
|
||||
const miptex_t *miptex;
|
||||
int i, j, k, l;
|
||||
bsp2_dleaf_t *leaf, *hit;
|
||||
mleaf_t *leaf, *hit;
|
||||
byte *vis;
|
||||
vec3_t mins, maxs;
|
||||
float d, maxd;
|
||||
|
|
@ -111,7 +111,7 @@ CalcAmbientSounds(bsp2_t *bsp)
|
|||
hit = &bsp->dleafs[j + 1];
|
||||
|
||||
for (k = 0; k < hit->nummarksurfaces; k++) {
|
||||
surf = BSP_GetFace(bsp, bsp->dmarksurfaces[hit->firstmarksurface + k]);
|
||||
surf = BSP_GetFace(bsp, bsp->dleaffaces[hit->firstmarksurface + k]);
|
||||
info = &bsp->texinfo[surf->texinfo];
|
||||
ofs = bsp->dtexdata->dataofs[info->miptex];
|
||||
miptex = (const miptex_t *)((byte *)bsp->dtexdata + ofs);
|
||||
|
|
|
|||
16
vis/vis.cc
16
vis/vis.cc
|
|
@ -572,7 +572,7 @@ CompressRow(const byte *vis, const int numbytes, byte *out)
|
|||
int totalvis;
|
||||
|
||||
static void
|
||||
LeafFlow(int leafnum, bsp2_dleaf_t *dleaf)
|
||||
LeafFlow(int leafnum, mleaf_t *dleaf)
|
||||
{
|
||||
leaf_t *leaf;
|
||||
byte *outbuffer;
|
||||
|
|
@ -709,7 +709,7 @@ ClusterFlow(int clusternum, leafbits_t *buffer)
|
|||
==================
|
||||
*/
|
||||
void
|
||||
CalcPortalVis(const bsp2_t *bsp)
|
||||
CalcPortalVis(const mbsp_t *bsp)
|
||||
{
|
||||
int i, startcount;
|
||||
portal_t *p;
|
||||
|
|
@ -748,7 +748,7 @@ CalcPortalVis(const bsp2_t *bsp)
|
|||
==================
|
||||
*/
|
||||
void
|
||||
CalcVis(const bsp2_t *bsp)
|
||||
CalcVis(const mbsp_t *bsp)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
|
@ -1015,7 +1015,7 @@ SetWindingSphere(winding_t *w)
|
|||
============
|
||||
*/
|
||||
void
|
||||
LoadPortals(char *name, bsp2_t *bsp)
|
||||
LoadPortals(char *name, mbsp_t *bsp)
|
||||
{
|
||||
int i, j, count;
|
||||
portal_t *p;
|
||||
|
|
@ -1212,7 +1212,7 @@ int
|
|||
main(int argc, char **argv)
|
||||
{
|
||||
bspdata_t bspdata;
|
||||
bsp2_t *const bsp = &bspdata.data.bsp2;
|
||||
mbsp_t *const bsp = &bspdata.data.mbsp;
|
||||
int32_t loadversion;
|
||||
int i;
|
||||
|
||||
|
|
@ -1281,8 +1281,7 @@ main(int argc, char **argv)
|
|||
LoadBSPFile(sourcefile, &bspdata);
|
||||
|
||||
loadversion = bspdata.version;
|
||||
if (loadversion != BSP2VERSION)
|
||||
ConvertBSPFormat(BSP2VERSION, &bspdata);
|
||||
ConvertBSPFormat(GENERIC_BSP, &bspdata);
|
||||
|
||||
strcpy(portalfile, argv[i]);
|
||||
StripExtension(portalfile);
|
||||
|
|
@ -1314,8 +1313,7 @@ main(int argc, char **argv)
|
|||
CalcAmbientSounds(bsp);
|
||||
|
||||
/* Convert data format back if necessary */
|
||||
if (loadversion != BSP2VERSION)
|
||||
ConvertBSPFormat(loadversion, &bspdata);
|
||||
ConvertBSPFormat(loadversion, &bspdata);
|
||||
|
||||
WriteBSPFile(sourcefile, &bspdata);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue