//cvar_t r_subdivide_size = {CVAR_SAVE, "r_subdivide_size", "128", "how large water polygons should be (smaller values produce more polygons which give better warping effects)"};
cvar_t r_novis = {0, "r_novis", "0", "draws whole level, see also sv_cullentities_pvs 0"};
-cvar_t r_picmipworld = {CVAR_SAVE, "r_picmipworld", "1", "whether gl_picmip shall apply to world textures too"};
cvar_t r_nosurftextures = {0, "r_nosurftextures", "0", "pretends there was no texture lump found in the q1bsp/hlbsp loading (useful for debugging this rare case)"};
cvar_t r_subdivisions_tolerance = {0, "r_subdivisions_tolerance", "4", "maximum error tolerance on curve subdivision for rendering purposes (in other words, the curves will be given as many polygons as necessary to represent curves at this quality)"};
cvar_t r_subdivisions_mintess = {0, "r_subdivisions_mintess", "0", "minimum number of subdivisions (values above 0 will smooth curves that don't need it)"};
{
// Cvar_RegisterVariable(&r_subdivide_size);
Cvar_RegisterVariable(&r_novis);
- Cvar_RegisterVariable(&r_picmipworld);
Cvar_RegisterVariable(&r_nosurftextures);
Cvar_RegisterVariable(&r_subdivisions_tolerance);
Cvar_RegisterVariable(&r_subdivisions_mintess);
// LordHavoc: HL sky textures are entirely different than quake
if (!loadmodel->brush.ishlbsp && !strncmp(tx->name, "sky", 3) && mtwidth == mtheight * 2)
{
- data = loadimagepixelsbgra(tx->name, false, false, r_texture_convertsRGB_skin.integer);
+ data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s/%s", mapname, tx->name), false, false, r_texture_convertsRGB_skin.integer, NULL);
+ if (!data)
+ data = loadimagepixelsbgra(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s", tx->name), false, false, r_texture_convertsRGB_skin.integer, NULL);
if (data && image_width == image_height * 2)
{
R_Q1BSP_LoadSplitSky(data, image_width, image_height, 4);
}
else
{
- skinframe = R_SkinFrame_LoadExternal(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s/%s", mapname, tx->name), TEXF_ALPHA | TEXF_MIPMAP | (r_picmipworld.integer ? TEXF_PICMIP : 0) | TEXF_COMPRESS, false);
+ skinframe = R_SkinFrame_LoadExternal(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s/%s", mapname, tx->name), TEXF_ALPHA | TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP | TEXF_COMPRESS, false);
if (!skinframe)
- skinframe = R_SkinFrame_LoadExternal(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s", tx->name), TEXF_ALPHA | TEXF_MIPMAP | (r_picmipworld.integer ? TEXF_PICMIP : 0) | TEXF_COMPRESS, false);
+ skinframe = R_SkinFrame_LoadExternal(gamemode == GAME_TENEBRAE ? tx->name : va("textures/%s", tx->name), TEXF_ALPHA | TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP | TEXF_COMPRESS, false);
if (!skinframe)
{
// did not find external texture, load it from the bsp or wad3
{
tx->width = image_width;
tx->height = image_height;
- skinframe = R_SkinFrame_LoadInternalBGRA(tx->name, TEXF_ALPHA | TEXF_MIPMAP | (r_picmipworld.integer ? TEXF_PICMIP : 0), pixels, image_width, image_height);
+ skinframe = R_SkinFrame_LoadInternalBGRA(tx->name, TEXF_ALPHA | TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP, pixels, image_width, image_height);
}
if (freepixels)
Mem_Free(freepixels);
}
else if (mtdata) // texture included
- skinframe = R_SkinFrame_LoadInternalQuake(tx->name, TEXF_MIPMAP | (r_picmipworld.integer ? TEXF_PICMIP : 0), false, r_fullbrights.integer, mtdata, tx->width, tx->height);
+ skinframe = R_SkinFrame_LoadInternalQuake(tx->name, TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP, false, r_fullbrights.integer, mtdata, tx->width, tx->height);
}
// if skinframe is still NULL the "missing" texture will be used
if (skinframe)
loadmodel->brushq3.num_mergedlightmaps = lightmapnumber + 1;
loadmodel->brushq3.data_lightmaps = Mem_Realloc(loadmodel->mempool, loadmodel->brushq3.data_lightmaps, loadmodel->brushq3.num_mergedlightmaps * sizeof(loadmodel->brushq3.data_lightmaps[0]));
loadmodel->brushq3.data_deluxemaps = Mem_Realloc(loadmodel->mempool, loadmodel->brushq3.data_deluxemaps, loadmodel->brushq3.num_mergedlightmaps * sizeof(loadmodel->brushq3.data_deluxemaps[0]));
- loadmodel->brushq3.data_lightmaps[lightmapnumber] = lightmaptexture = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%i", lightmapnumber), lightmapsize, lightmapsize, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_ALLOWUPDATES, NULL);
+ loadmodel->brushq3.data_lightmaps[lightmapnumber] = lightmaptexture = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%i", lightmapnumber), lightmapsize, lightmapsize, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_ALLOWUPDATES, -1, NULL);
if (loadmodel->brushq1.nmaplightdata)
- loadmodel->brushq3.data_deluxemaps[lightmapnumber] = deluxemaptexture = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%i", lightmapnumber), lightmapsize, lightmapsize, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_ALLOWUPDATES, NULL);
+ loadmodel->brushq3.data_deluxemaps[lightmapnumber] = deluxemaptexture = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%i", lightmapnumber), lightmapsize, lightmapsize, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | TEXF_ALLOWUPDATES, -1, NULL);
lightmapnumber++;
Mod_AllocLightmap_Reset(&allocState);
Mod_AllocLightmap_Block(&allocState, ssize, tsize, &lightmapx, &lightmapy);
if (mod_q1bsp_polygoncollisions.integer)
{
- Mod_MakeCollisionBIH(mod, true);
+ Mod_MakeCollisionBIH(mod, true, &mod->collision_bih);
// point traces and contents checks still use the bsp tree
mod->TraceLine = Mod_CollisionBIH_TraceLine;
mod->TraceBox = Mod_CollisionBIH_TraceBox;
}
+ else
+ Mod_MakeCollisionBIH(mod, true, &mod->render_bih);
// generate VBOs and other shared data before cloning submodels
if (i == 0)
strlcpy (out[i].name, in[i].name, sizeof (out[i].name));
out[i].surfaceflags = LittleLong(in[i].surfaceflags);
out[i].supercontents = Mod_Q3BSP_SuperContentsFromNativeContents(loadmodel, LittleLong(in[i].contents));
- Mod_LoadTextureFromQ3Shader(out + i, out[i].name, true, true, TEXF_MIPMAP | (r_picmipworld.integer ? TEXF_PICMIP : 0) | TEXF_COMPRESS);
+ Mod_LoadTextureFromQ3Shader(out + i, out[i].name, true, true, TEXF_MIPMAP | TEXF_ISWORLD | TEXF_PICMIP | TEXF_COMPRESS);
// restore the surfaceflags and supercontents
out[i].surfaceflags = LittleLong(in[i].surfaceflags);
out[i].supercontents = Mod_Q3BSP_SuperContentsFromNativeContents(loadmodel, LittleLong(in[i].contents));
if (developer_loading.integer)
Con_Printf("Using external lightmaps\n");
FS_StripExtension(loadmodel->name, mapname, sizeof(mapname));
- inpixels[0] = loadimagepixelsbgra(va("%s/lm_%04d", mapname, 0), false, false, false);
+ inpixels[0] = loadimagepixelsbgra(va("%s/lm_%04d", mapname, 0), false, false, false, NULL);
if(!inpixels[0])
return;
for(count = 1; ; ++count)
{
- inpixels[count] = loadimagepixelsbgra(va("%s/lm_%04d", mapname, count), false, false, false);
+ inpixels[count] = loadimagepixelsbgra(va("%s/lm_%04d", mapname, count), false, false, false, NULL);
if(!inpixels[count])
break; // we got all of them
if(image_width != size || image_height != size)
;
if (developer_loading.integer)
Con_Printf("lightmap merge texture #%i is %ix%i (%i of %i used)\n", lightmapindex, mergewidth*size, mergeheight*size, min(j, mergewidth*mergeheight), mergewidth*mergeheight);
- loadmodel->brushq3.data_lightmaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), mergewidth * size, mergeheight * size, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : TEXF_ALLOWUPDATES), NULL);
+ loadmodel->brushq3.data_lightmaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), mergewidth * size, mergeheight * size, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : TEXF_ALLOWUPDATES), -1, NULL);
if (loadmodel->brushq3.data_deluxemaps)
- loadmodel->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%04i", lightmapindex), mergewidth * size, mergeheight * size, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bspdeluxemaps.integer ? TEXF_COMPRESS : TEXF_ALLOWUPDATES), NULL);
+ loadmodel->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%04i", lightmapindex), mergewidth * size, mergeheight * size, NULL, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bspdeluxemaps.integer ? TEXF_COMPRESS : TEXF_ALLOWUPDATES), -1, NULL);
}
mergewidth = R_TextureWidth(loadmodel->brushq3.data_lightmaps[lightmapindex]) / size;
mergeheight = R_TextureHeight(loadmodel->brushq3.data_lightmaps[lightmapindex]) / size;
{
// figure out which merged lightmap texture this fits into
if (loadmodel->brushq3.deluxemapping && (i & 1))
- loadmodel->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%04i", lightmapindex), size, size, convertedpixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bspdeluxemaps.integer ? TEXF_COMPRESS : 0), NULL);
+ loadmodel->brushq3.data_deluxemaps[lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("deluxemap%04i", lightmapindex), size, size, convertedpixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bspdeluxemaps.integer ? TEXF_COMPRESS : 0), -1, NULL);
else
- loadmodel->brushq3.data_lightmaps [lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), size, size, convertedpixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : 0), NULL);
+ loadmodel->brushq3.data_lightmaps [lightmapindex] = R_LoadTexture2D(loadmodel->texturepool, va("lightmap%04i", lightmapindex), size, size, convertedpixels, TEXTYPE_BGRA, TEXF_FORCELINEAR | (gl_texturecompression_q3bsplightmaps.integer ? TEXF_COMPRESS : 0), -1, NULL);
}
}
vec_t backdist1;
vec_t backdist2;
vec_t backfrac;
- vec3_t clipped[2];
+ vec3_t clipped, newstart, newend;
#endif
vec3_t segmentmins;
vec3_t segmentmaxs;
// START end START END
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[0]);
- start = clipped[0];
+ VectorLerp(start, frontfrac, end, newstart); start = newstart;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
#ifdef BIHLINECLIP
// start END START END
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[0]);
- end = clipped[0];
+ VectorLerp(start, frontfrac, end, newend); end = newend;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, end, linestart, lineend);
#ifdef BIHLINECLIP
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- end = clipped[0];
+ VectorLerp(start, backfrac, end, newend); end = newend;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// START end start END
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[1]);
- Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, clipped[1], end, linestart, lineend);
+ VectorLerp(start, frontfrac, end, clipped);
+ Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, clipped, end, linestart, lineend);
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- end = clipped[0];
+ VectorLerp(start, backfrac, end, newend); end = newend;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// start END start END
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[1]);
- Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, clipped[1], linestart, lineend);
+ VectorLerp(start, frontfrac, end, clipped);
+ Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, clipped, linestart, lineend);
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- end = clipped[0];
+ VectorLerp(start, backfrac, end, newend); end = newend;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// START END start END
#ifdef BIHLINECLIP
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- end = clipped[0];
+ VectorLerp(start, backfrac, end, newend); end = newend;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, end, linestart, lineend);
#ifdef BIHLINECLIP
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- start = clipped[0];
+ VectorLerp(start, backfrac, end, newstart); start = newstart;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// START end START end
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[1]);
- Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, clipped[1], end, linestart, lineend);
+ VectorLerp(start, frontfrac, end, clipped);
+ Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, clipped, end, linestart, lineend);
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- start = clipped[0];
+ VectorLerp(start, backfrac, end, newstart); start = newstart;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// start END START end
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[1]);
- Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, clipped[1], linestart, lineend);
+ VectorLerp(start, frontfrac, end, clipped);
+ Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, clipped, linestart, lineend);
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- start = clipped[0];
+ VectorLerp(start, backfrac, end, newstart); start = newstart;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// START END START end
#ifdef BIHLINECLIP
backfrac = backdist1 / (backdist1 - backdist2);
- VectorLerp(start, backfrac, end, clipped[0]);
- start = clipped[0];
+ VectorLerp(start, backfrac, end, newstart); start = newstart;
segmentmins[0] = min(start[0], end[0]);
segmentmins[1] = min(start[1], end[1]);
segmentmins[2] = min(start[2], end[2]);
// START end start end
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[1]);
- Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, clipped[1], end, linestart, lineend);
+ VectorLerp(start, frontfrac, end, clipped);
+ Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, clipped, end, linestart, lineend);
#else
Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, end, linestart, lineend);
#endif
// start END start end
#ifdef BIHLINECLIP
frontfrac = frontdist1 / (frontdist1 - frontdist2);
- VectorLerp(start, frontfrac, end, clipped[1]);
- Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, clipped[1], linestart, lineend);
+ VectorLerp(start, frontfrac, end, clipped);
+ Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, clipped, linestart, lineend);
#else
Mod_CollisionBIH_TraceLine_RecursiveBIHNode(trace, model, node->front, start, end, linestart, lineend);
#endif
return supercontents;
}
-void Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces)
+bih_t *Mod_MakeCollisionBIH(dp_model_t *model, qboolean userendersurfaces, bih_t *out)
{
int j;
int bihnumleafs;
for (j = 0, surface = model->data_surfaces + model->firstmodelsurface;j < nummodelsurfaces;j++, surface++)
{
if (surface->texture->basematerialflags & MATERIALFLAG_MESHCOLLISIONS)
- bihnumleafs += surface->num_triangles;
+ bihnumleafs += surface->num_triangles + surface->num_collisiontriangles;
else
bihnumleafs += surface->num_collisiontriangles;
}
}
if (!bihnumleafs)
- return;
+ return NULL;
// allocate the memory for the BIH leaf nodes
bihleafs = Mem_Alloc(loadmodel->mempool, sizeof(bih_leaf_t) * bihnumleafs);
continue;
bihleafs[bihleafindex].type = BIH_RENDERTRIANGLE;
bihleafs[bihleafindex].textureindex = surface->texture - model->data_textures;
+ bihleafs[bihleafindex].surfaceindex = surface - model->data_surfaces;
bihleafs[bihleafindex].itemindex = triangleindex+surface->num_firsttriangle;
bihleafs[bihleafindex].mins[0] = min(rendervertex3f[3*e[0]+0], min(rendervertex3f[3*e[1]+0], rendervertex3f[3*e[2]+0])) - 1;
bihleafs[bihleafindex].mins[1] = min(rendervertex3f[3*e[0]+1], min(rendervertex3f[3*e[1]+1], rendervertex3f[3*e[2]+1])) - 1;
continue;
bihleafs[bihleafindex].type = BIH_BRUSH;
bihleafs[bihleafindex].textureindex = brush->texture - model->data_textures;
+ bihleafs[bihleafindex].surfaceindex = -1;
bihleafs[bihleafindex].itemindex = brushindex+model->firstmodelbrush;
VectorCopy(brush->colbrushf->mins, bihleafs[bihleafindex].mins);
VectorCopy(brush->colbrushf->maxs, bihleafs[bihleafindex].maxs);
{
bihleafs[bihleafindex].type = BIH_COLLISIONTRIANGLE;
bihleafs[bihleafindex].textureindex = surface->texture - model->data_textures;
+ bihleafs[bihleafindex].surfaceindex = surface - model->data_surfaces;
bihleafs[bihleafindex].itemindex = triangleindex+surface->num_firstcollisiontriangle;
bihleafs[bihleafindex].mins[0] = min(collisionvertex3f[3*e[0]+0], min(collisionvertex3f[3*e[1]+0], collisionvertex3f[3*e[2]+0])) - 1;
bihleafs[bihleafindex].mins[1] = min(collisionvertex3f[3*e[0]+1], min(collisionvertex3f[3*e[1]+1], collisionvertex3f[3*e[2]+1])) - 1;
temp_leafsortscratch = temp_leafsort + bihnumleafs;
// now build it
- BIH_Build(&model->collision_bih, bihnumleafs, bihleafs, bihmaxnodes, bihnodes, temp_leafsort, temp_leafsortscratch);
+ BIH_Build(out, bihnumleafs, bihleafs, bihmaxnodes, bihnodes, temp_leafsort, temp_leafsortscratch);
// we're done with the temporary data
Mem_Free(temp_leafsort);
// resize the BIH nodes array if it over-allocated
- if (model->collision_bih.maxnodes > model->collision_bih.numnodes)
+ if (out->maxnodes > out->numnodes)
{
- model->collision_bih.maxnodes = model->collision_bih.numnodes;
- model->collision_bih.nodes = Mem_Realloc(loadmodel->mempool, model->collision_bih.nodes, model->collision_bih.numnodes * sizeof(bih_node_t));
+ out->maxnodes = out->numnodes;
+ out->nodes = Mem_Realloc(loadmodel->mempool, out->nodes, out->numnodes * sizeof(bih_node_t));
}
+
+ return out;
}
static int Mod_Q3BSP_SuperContentsFromNativeContents(dp_model_t *model, int nativecontents)
if (j < mod->nummodelsurfaces)
mod->DrawAddWaterPlanes = R_Q1BSP_DrawAddWaterPlanes;
- Mod_MakeCollisionBIH(mod, false);
+ Mod_MakeCollisionBIH(mod, false, &mod->collision_bih);
+ Mod_MakeCollisionBIH(mod, true, &mod->render_bih);
// generate VBOs and other shared data before cloning submodels
if (i == 0)
Mod_BuildTextureVectorsFromNormals(0, loadmodel->surfmesh.num_vertices, loadmodel->surfmesh.num_triangles, loadmodel->surfmesh.data_vertex3f, loadmodel->surfmesh.data_texcoordtexture2f, loadmodel->surfmesh.data_normal3f, loadmodel->surfmesh.data_element3i, loadmodel->surfmesh.data_svector3f, loadmodel->surfmesh.data_tvector3f, true);
Mod_BuildTriangleNeighbors(loadmodel->surfmesh.data_neighbor3i, loadmodel->surfmesh.data_element3i, loadmodel->surfmesh.num_triangles);
- Mod_MakeCollisionBIH(loadmodel, true);
+ Mod_MakeCollisionBIH(loadmodel, true, &mod->collision_bih);
+ mod->render_bih = mod->collision_bih;
}
loadmodel->num_textures = numtextures;
loadmodel->data_textures = Mem_Alloc(loadmodel->mempool, loadmodel->num_textures * sizeof(texture_t));
for (i = 0;i < numtextures;i++)
- Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, texturenames[i], true, true, TEXF_MIPMAP | TEXF_ALPHA | (r_picmipworld.integer ? TEXF_PICMIP : 0) | TEXF_COMPRESS);
+ Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, texturenames[i], true, true, TEXF_MIPMAP | TEXF_ALPHA | TEXF_ISWORLD | TEXF_PICMIP | TEXF_COMPRESS);
// free the texturenames array since we are now done with it
for (i = 0;i < numtextures;i++)