mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2024-11-26 06:20:48 +00:00
gl1: Scale 3x for nolerp 8bit textures
This commit is contained in:
parent
f49235d28a
commit
dcdc37ea35
1 changed files with 21 additions and 5 deletions
|
@ -353,9 +353,10 @@ R_ImageList_f(void)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
R_Printf(PRINT_ALL, " %3i %3i %s: %s %s\n",
|
R_Printf(PRINT_ALL, " %3i %3i %s: %s (%dx%d) %s\n",
|
||||||
image->upload_width, image->upload_height,
|
image->upload_width, image->upload_height,
|
||||||
palstrings[image->paletted], image->name, in_use);
|
palstrings[image->paletted], image->name,
|
||||||
|
image->width, image->height, in_use);
|
||||||
}
|
}
|
||||||
|
|
||||||
R_Printf(PRINT_ALL,
|
R_Printf(PRINT_ALL,
|
||||||
|
@ -951,9 +952,24 @@ R_LoadPic(char *name, byte *pic, int width, int realwidth,
|
||||||
// resize 8bit images only when we forced such logic
|
// resize 8bit images only when we forced such logic
|
||||||
if (r_scale8bittextures->value)
|
if (r_scale8bittextures->value)
|
||||||
{
|
{
|
||||||
byte *image_converted = malloc(width * height * 4);
|
byte *image_converted;
|
||||||
scale2x(pic, image_converted, width, height);
|
int scale = 2;
|
||||||
image->has_alpha = R_Upload8(image_converted, width * 2, height * 2,
|
|
||||||
|
// scale 3 times if lerp image
|
||||||
|
if (!nolerp && (vid.height >= 240 * 3))
|
||||||
|
scale = 3;
|
||||||
|
|
||||||
|
image_converted = malloc(width * height * scale * scale);
|
||||||
|
if (!image_converted)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
if (scale == 3) {
|
||||||
|
scale3x(pic, image_converted, width, height);
|
||||||
|
} else {
|
||||||
|
scale2x(pic, image_converted, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
image->has_alpha = R_Upload8(image_converted, width * scale, height * scale,
|
||||||
(image->type != it_pic && image->type != it_sky),
|
(image->type != it_pic && image->type != it_sky),
|
||||||
image->type == it_sky);
|
image->type == it_sky);
|
||||||
free(image_converted);
|
free(image_converted);
|
||||||
|
|
Loading…
Reference in a new issue