]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - gl_textures.c
add DeviceLost and DeviceRestored functions to R_Modules system
[xonotic/darkplaces.git] / gl_textures.c
index d20a0ecde3a13030582883ab6bbe42b06ba2c5ed..bcf79232cb848409f2e60b572253ac50c299226c 100644 (file)
@@ -590,7 +590,7 @@ void R_Textures_Init (void)
        Cvar_RegisterVariable (&gl_texturecompression_reflectmask);
        Cvar_RegisterVariable (&gl_nopartialtextureupdates);
 
-       R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap);
+       R_RegisterModule("R_Textures", r_textures_start, r_textures_shutdown, r_textures_newmap, NULL, NULL);
 }
 
 void R_Textures_Frame (void)
@@ -1035,7 +1035,7 @@ static rtexture_t *R_SetupTexture(rtexturepool_t *rtexturepool, const char *iden
        qglGenTextures(1, (GLuint *)&glt->texnum);CHECKGLERROR
        R_Upload(glt, data, 0, 0, 0, glt->inputwidth, glt->inputheight, glt->inputdepth);
        if ((glt->flags & TEXF_ALLOWUPDATES) && gl_nopartialtextureupdates.integer)
-               glt->bufferpixels = Mem_Alloc(texturemempool, glt->tilewidth*glt->tileheight*glt->tiledepth*glt->sides*glt->bytesperpixel);
+               glt->bufferpixels = (unsigned char *)Mem_Alloc(texturemempool, glt->tilewidth*glt->tileheight*glt->tiledepth*glt->sides*glt->bytesperpixel);
 
        // texture converting and uploading can take a while, so make sure we're sending keepalives
        CL_KeepaliveMessage(false);
@@ -1152,7 +1152,7 @@ int R_SaveTextureDDSFile(rtexture_t *rt, const char *filename, qboolean skipunco
                mipinfo[mip][3] = ddssize;
                ddssize += mipinfo[mip][2];
        }
-       dds = Mem_Alloc(tempmempool, ddssize);
+       dds = (unsigned char *)Mem_Alloc(tempmempool, ddssize);
        if (!dds)
                return -4;
        dds_caps1 = 0x1000; // DDSCAPS_TEXTURE