mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Round values after renormalization when generating mipmaps.
This commit is contained in:
parent
7864ac8019
commit
3d4f248fda
1 changed files with 6 additions and 6 deletions
|
|
@ -4575,9 +4575,9 @@ void Image::renormalize_uint8(uint8_t *p_rgb) {
|
|||
n += Vector3(1, 1, 1);
|
||||
n *= 0.5;
|
||||
n *= 255;
|
||||
p_rgb[0] = CLAMP(int(n.x), 0, 255);
|
||||
p_rgb[1] = CLAMP(int(n.y), 0, 255);
|
||||
p_rgb[2] = CLAMP(int(n.z), 0, 255);
|
||||
p_rgb[0] = CLAMP(int(Math::round(n.x)), 0, 255);
|
||||
p_rgb[1] = CLAMP(int(Math::round(n.y)), 0, 255);
|
||||
p_rgb[2] = CLAMP(int(Math::round(n.z)), 0, 255);
|
||||
}
|
||||
|
||||
void Image::renormalize_float(float *p_rgb) {
|
||||
|
|
@ -4604,9 +4604,9 @@ void Image::renormalize_uint16(uint16_t *p_rgb) {
|
|||
n += Vector3(1, 1, 1);
|
||||
n *= 0.5;
|
||||
n *= 65535;
|
||||
p_rgb[0] = CLAMP(int(n.x), 0, 65535);
|
||||
p_rgb[1] = CLAMP(int(n.y), 0, 65535);
|
||||
p_rgb[2] = CLAMP(int(n.z), 0, 65535);
|
||||
p_rgb[0] = CLAMP(int(Math::round(n.x)), 0, 65535);
|
||||
p_rgb[1] = CLAMP(int(Math::round(n.y)), 0, 65535);
|
||||
p_rgb[2] = CLAMP(int(Math::round(n.z)), 0, 65535);
|
||||
}
|
||||
|
||||
Image::Image(const uint8_t *p_mem_png_jpg, int p_len) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue