]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_rsurf.c
implemented support for GL_ARB_texture_compression - this is controlled
[xonotic/darkplaces.git] / gl_rsurf.c
index 0333beff4a4f9285e82be796718dd1a6ca91360f..da62f71ecfca406fa0b92d7b24d0d0dc5e16d7af 100644 (file)
@@ -942,7 +942,8 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
        if (!BoxesOverlap(model->normalmins, model->normalmaxs, lightmins, lightmaxs))
                return;
        R_UpdateAllTextureInfo(ent);
-       GL_PolygonOffset(r_refdef.shadowpolygonfactor + r_polygonoffset_submodel_factor.value, r_refdef.shadowpolygonoffset + r_polygonoffset_submodel_offset.value);CHECKGLERROR
+       if (ent->model->brush.submodel)
+               GL_PolygonOffset(r_refdef.shadowpolygonfactor + r_polygonoffset_submodel_factor.value, r_refdef.shadowpolygonoffset + r_polygonoffset_submodel_offset.value);
        if (model->brush.shadowmesh)
        {
                R_Shadow_PrepareShadowMark(model->brush.shadowmesh->numtriangles);
@@ -971,7 +972,8 @@ void R_Q1BSP_DrawShadowVolume(entity_render_t *ent, vec3_t relativelightorigin,
                }
                R_Shadow_VolumeFromList(model->surfmesh.num_vertices, model->surfmesh.num_triangles, rsurface.vertex3f, model->surfmesh.data_element3i, model->surfmesh.data_neighbor3i, relativelightorigin, relativelightdirection, projectdistance, numshadowmark, shadowmarklist);
        }
-       GL_PolygonOffset(r_refdef.shadowpolygonfactor, r_refdef.shadowpolygonoffset);CHECKGLERROR
+       if (ent->model->brush.submodel)
+               GL_PolygonOffset(r_refdef.shadowpolygonfactor, r_refdef.shadowpolygonoffset);
 }
 
 #define BATCHSIZE 1024
@@ -1142,6 +1144,11 @@ void R_ReplaceWorldTexture (void)
        int                     i;
        const char      *r, *newt;
        skinframe_t *skinframe;
+       if (!r_refdef.worldmodel)
+       {
+               Con_Printf("There is no worldmodel\n");
+               return;
+       }
        m = r_refdef.worldmodel;
 
        if(Cmd_Argc() < 2)
@@ -1163,7 +1170,7 @@ void R_ReplaceWorldTexture (void)
        {
                if(t->width && !strcasecmp(t->name, r))
                {
-                       if ((skinframe = R_SkinFrame_LoadExternal((char*)newt, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP, true)))
+                       if ((skinframe = R_SkinFrame_LoadExternal((char*)newt, TEXF_MIPMAP | TEXF_ALPHA | TEXF_PRECACHE | TEXF_PICMIP | TEXF_COMPRESS, true)))
                        {
                                t->skinframes[0] = skinframe;
                                Con_Printf("%s replaced with %s\n", r, newt);
@@ -1184,6 +1191,11 @@ void R_ListWorldTextures (void)
        model_t         *m;
        texture_t       *t;
        int                     i;
+       if (!r_refdef.worldmodel)
+       {
+               Con_Printf("There is no worldmodel\n");
+               return;
+       }
        m = r_refdef.worldmodel;
 
        Con_Print("Worldmodel textures :\n");