mirror of
https://github.com/yquake2/ref_vk.git
synced 2024-11-10 06:41:45 +00:00
parent
eeeec10131
commit
07a53c1bc6
1 changed files with 20 additions and 3 deletions
|
@ -1137,9 +1137,26 @@ Vk_LoadPic(char *name, byte *pic, int width, int realwidth,
|
|||
// resize 8bit images only when we forced such logic
|
||||
if (r_scale8bittextures->value)
|
||||
{
|
||||
byte *image_converted = malloc(width * height * 4);
|
||||
scale2x(pic, image_converted, width, height);
|
||||
image->vk_texture.mipLevels = Vk_Upload8(image_converted, width * 2, height * 2, image->type, &texBuffer, &upload_width, &upload_height);
|
||||
byte *image_converted;
|
||||
int scale = 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->vk_texture.mipLevels = Vk_Upload8(image_converted, width * scale, height * scale,
|
||||
image->type, &texBuffer,
|
||||
&upload_width, &upload_height);
|
||||
free(image_converted);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue