#include "quakedef.h"
-cvar_t r_max_size = {"r_max_size", "2048"};
-cvar_t r_picmip = {"r_picmip", "0"};
-cvar_t r_lerpimages = {"r_lerpimages", "1"};
-cvar_t r_upload = {"r_upload", "1"};
-cvar_t r_precachetextures = {"r_precachetextures", "1", true};
+cvar_t r_max_size = {0, "r_max_size", "2048"};
+cvar_t r_picmip = {0, "r_picmip", "0"};
+cvar_t r_lerpimages = {CVAR_SAVE, "r_lerpimages", "1"};
+cvar_t r_upload = {0, "r_upload", "1"};
+cvar_t r_precachetextures = {CVAR_SAVE, "r_precachetextures", "1"};
int gl_filter_min = GL_LINEAR_MIPMAP_LINEAR; //NEAREST;
int gl_filter_max = GL_LINEAR;
char engineversion[40];
//void GL_UploadTexture (gltexture_t *glt);
-void r_textures_start()
+void r_textures_start(void)
{
// int i;
// gltexture_t *glt;
// GL_UploadTexture(glt);
}
-void r_textures_shutdown()
+void r_textures_shutdown(void)
{
}
-void r_textures_newmap()
+void r_textures_newmap(void)
{
}
inrow = (int *)indata + inwidth*(i*inheight/outheight);
frac = fracstep >> 1;
j = outwidth - 4;
- while(j >= 0)
+ while (j >= 0)
{
out[0] = inrow[frac >> 16];frac += fracstep;
out[1] = inrow[frac >> 16];frac += fracstep;
out[2] = inrow[frac >> 16];frac += fracstep;
out[3] = inrow[frac >> 16];frac += fracstep;
out += 4;
- j--;
+ j -= 4;
}
if (j & 2)
{
if (!identifier[0])
Host_Error("R_LoadTexture: no identifier\n");
+ if (data == NULL)
+ Host_Error("R_LoadTexture: \"%s\" has no data\n", identifier);
// clear the alpha flag if the texture has no transparent pixels
if (flags & TEXF_ALPHA)
glt->texeldatasize = R_CalcTexelDataSize(width, height, flags & TEXF_MIPMAP);
precache = false;
- if (r_precachetextures.value >= 1)
+ if (flags & TEXF_ALWAYSPRECACHE)
+ precache = true;
+ else if (r_precachetextures.value >= 1)
{
if (flags & TEXF_PRECACHE)
precache = true;