mirror of
https://github.com/yquake2/yquake2remaster.git
synced 2025-02-12 15:05:31 +00:00
soft: scale down wall if texture is prescalled
This commit is contained in:
parent
e08490d3de
commit
1efc45612c
1 changed files with 30 additions and 4 deletions
|
@ -464,6 +464,31 @@ R_LoadPic(const char *name, const byte *pic, int width, int realwidth, int heigh
|
||||||
return image;
|
return image;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
if ((width != realwidth) &&
|
||||||
|
(height != realheight) &&
|
||||||
|
type != it_pic
|
||||||
|
)
|
||||||
|
{
|
||||||
|
/* image could be prescalled */
|
||||||
|
byte *scaled = NULL;
|
||||||
|
image_t *image;
|
||||||
|
|
||||||
|
scaled = malloc(realwidth * realheight);
|
||||||
|
if (!scaled)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
R_ImageShrink(pic, scaled, width, realwidth, height, realheight);
|
||||||
|
|
||||||
|
image = R_LoadPic8(name, scaled,
|
||||||
|
realwidth, realwidth,
|
||||||
|
realwidth, realheight,
|
||||||
|
realwidth * realheight, type);
|
||||||
|
free(scaled);
|
||||||
|
|
||||||
|
return image;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
return R_LoadPic8 (name, pic,
|
return R_LoadPic8 (name, pic,
|
||||||
width, realwidth,
|
width, realwidth,
|
||||||
|
@ -472,6 +497,7 @@ R_LoadPic(const char *name, const byte *pic, int width, int realwidth, int heigh
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Apply color light to texture pixel
|
* Apply color light to texture pixel
|
||||||
|
|
Loading…
Reference in a new issue