X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=gl_rsurf.c;h=1a52a66ca44de9c196c9c64869f0e859aae710f5;hb=a51a70c2254b27a68e5fe74cc5985b02dc36e1e9;hp=746632b3287a9bb2c86f43766fc121464f17434e;hpb=6f10cbc0e758254cc200332fd61f96d7cc972a48;p=xonotic%2Fdarkplaces.git diff --git a/gl_rsurf.c b/gl_rsurf.c index 746632b3..1a52a66c 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -584,9 +584,9 @@ void R_View_WorldVisibility(qboolean forcenovis) continue; if (r_vis_trace.integer) { - if (p->tracetime != realtime && R_CanSeeBox(r_vis_trace_samples.value, r_vis_trace_eyejitter.value, r_vis_trace_enlarge.value, r_vis_trace_expand.value, r_vis_trace_pad.value, r_refdef.view.origin, cullmins, cullmaxs)) - p->tracetime = realtime; - if (realtime - p->tracetime > r_vis_trace_delay.value) + if (p->tracetime != host.realtime && R_CanSeeBox(r_vis_trace_samples.value, r_vis_trace_eyejitter.value, r_vis_trace_enlarge.value, r_vis_trace_expand.value, r_vis_trace_pad.value, r_refdef.view.origin, cullmins, cullmaxs)) + p->tracetime = host.realtime; + if (host.realtime - p->tracetime > r_vis_trace_delay.value) continue; } if (leafstackpos >= (int)(sizeof(leafstack) / sizeof(leafstack[0]))) @@ -918,10 +918,12 @@ static void R_Q1BSP_RecursiveGetLightInfo_BSP(r_q1bsp_getlightinfo_t *info, qboo for (leafsurfaceindex = 0;leafsurfaceindex < numleafsurfaces;leafsurfaceindex++) { surfaceindex = leafsurfaceindices[leafsurfaceindex]; + surface = surfaces + surfaceindex; + if(!surface->texture) + continue; if (CHECKPVSBIT(info->outsurfacepvs, surfaceindex)) continue; SETPVSBIT(info->outsurfacepvs, surfaceindex); - surface = surfaces + surfaceindex; if (!BoxesOverlap(info->lightmins, info->lightmaxs, surface->mins, surface->maxs)) continue; addedtris = false; @@ -1338,7 +1340,7 @@ void R_Q1BSP_DrawShadowMap(int side, entity_render_t *ent, const vec3_t relative for (modelsurfacelistindex = 0;modelsurfacelistindex < modelnumsurfaces;modelsurfacelistindex++) { surface = model->data_surfaces + modelsurfacelist[modelsurfacelistindex]; - if (surfacesides && !(surfacesides[modelsurfacelistindex] && (1 << side))) + if (surfacesides && !(surfacesides[modelsurfacelistindex] & (1 << side))) continue; rsurface.texture = R_GetCurrentTexture(surface->texture); if (rsurface.texture->currentmaterialflags & MATERIALFLAG_NOSHADOW) @@ -1587,8 +1589,8 @@ void GL_Surf_Init(void) Cvar_RegisterVariable(&r_vis_trace_surfaces); Cvar_RegisterVariable(&r_q3bsp_renderskydepth); - Cmd_AddCommand(&cmd_client, "r_replacemaptexture", R_ReplaceWorldTexture_f, "override a map texture for testing purposes"); - Cmd_AddCommand(&cmd_client, "r_listmaptextures", R_ListWorldTextures_f, "list all textures used by the current map"); + Cmd_AddCommand(CMD_CLIENT, "r_replacemaptexture", R_ReplaceWorldTexture_f, "override a map texture for testing purposes"); + Cmd_AddCommand(CMD_CLIENT, "r_listmaptextures", R_ListWorldTextures_f, "list all textures used by the current map"); //R_RegisterModule("GL_Surf", gl_surf_start, gl_surf_shutdown, gl_surf_newmap); }