don't try to upload distorttextures if the texture shader extension is missing
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jan 2004 03:54:29 +0000 (03:54 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 12 Jan 2004 03:54:29 +0000 (03:54 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3803 d7cf8633-e32d-0410-b094-e92efae38249

model_shared.c

index 2884192..766ab18 100644 (file)
@@ -112,19 +112,24 @@ void Mod_BuildDistortTexture (void)
                }
        }
 
+
        for (i=0; i<4; i++)
        {
                for (j=0; j<16; j++)
                {
-                       for (y=0; y<DISTORTRESOLUTION; y++)
+                       mod_shared_distorttexture[i*16+j] = NULL;
+                       if (gl_textureshader)
                        {
-                               for (x=0; x<DISTORTRESOLUTION; x++)
+                               for (y=0; y<DISTORTRESOLUTION; y++)
                                {
-                                       data[4][y][x][0] = Mod_MorphDistortTexture (data[(i-1)&3][y][x][0], data[i][y][x][0], data[(i+1)&3][y][x][0], data[(i+2)&3][y][x][0], 0.0625*j);
-                                       data[4][y][x][1] = Mod_MorphDistortTexture (data[(i-1)&3][y][x][1], data[i][y][x][1], data[(i+1)&3][y][x][1], data[(i+2)&3][y][x][1], 0.0625*j);
+                                       for (x=0; x<DISTORTRESOLUTION; x++)
+                                       {
+                                               data[4][y][x][0] = Mod_MorphDistortTexture (data[(i-1)&3][y][x][0], data[i][y][x][0], data[(i+1)&3][y][x][0], data[(i+2)&3][y][x][0], 0.0625*j);
+                                               data[4][y][x][1] = Mod_MorphDistortTexture (data[(i-1)&3][y][x][1], data[i][y][x][1], data[(i+1)&3][y][x][1], data[(i+2)&3][y][x][1], 0.0625*j);
+                                       }
                                }
+                               mod_shared_distorttexture[i*16+j] = R_LoadTexture2D(mod_shared_texturepool, va("distorttexture%i", i*16+j), DISTORTRESOLUTION, DISTORTRESOLUTION, &data[4][0][0][0], TEXTYPE_DSDT, TEXF_PRECACHE, NULL);
                        }
-                       mod_shared_distorttexture[i*16+j] = R_LoadTexture2D(mod_shared_texturepool, va("distorttexture%i", i*16+j), DISTORTRESOLUTION, DISTORTRESOLUTION, &data[4][0][0][0], TEXTYPE_DSDT, TEXF_PRECACHE, NULL);
                }
        }