31 image->pixels[0] = NULL;
40 c = inwidth * inheight;
59 width = image->upload_width;
60 height = image->upload_height;
62 if (image->flags & IF_TURBULENT) {
67 b = image->width * image->height;
70 if (image->type == IT_WALL) {
71 image->pixels[0] = R_Malloc(MIPSIZE(b) *
TEX_BYTES);
72 image->pixels[1] = image->pixels[0] + b *
TEX_BYTES;
73 image->pixels[2] = image->pixels[1] + b *
TEX_BYTES / 4;
74 image->pixels[3] = image->pixels[2] + b *
TEX_BYTES / 16;
76 if (!(
r_config.flags & QVF_GAMMARAMP))
79 if (
width == image->width &&
height == image->height) {
83 image->upload_width = image->width;
84 image->upload_height = image->height;
87 IMG_MipMap(image->pixels[1], image->pixels[0], image->width >> 0, image->height >> 0);
88 IMG_MipMap(image->pixels[2], image->pixels[1], image->width >> 1, image->height >> 1);
89 IMG_MipMap(image->pixels[3], image->pixels[2], image->width >> 2, image->height >> 2);
93 image->pixels[0] = pic;
95 if (!(image->flags & IF_OPAQUE)) {
96 for (i = 0; i <
c; i++) {
99 image->flags |= IF_TRANSPARENT;
105 if (image->type == IT_SKIN && !(
r_config.flags & QVF_GAMMARAMP))
115 for (i = 0; i < 256; i++)
120 for (i = 0; i < 256; i++) {
121 inf = 255 * pow((i + 0.5) / 255.5, g) + 0.5;
139 ntx->width = ntx->height =
NTX;
140 ntx->upload_width = ntx->upload_height =
NTX;
141 ntx->pixels[0] = buffer;
146 for (
m = 0;
m < 4;
m++) {
147 p = (uint32_t *)ntx->pixels[
m];
148 for (y = 0; y < (
NTX >>
m); y++) {
149 for (x = 0; x < (
NTX >>
m); x++) {
150 if ((x ^ y) & (1 << (3 -
m)))