Mend compiler warnings in magic/src/halftone.c
This commit is contained in:
parent
94943d9fdd
commit
d27c21bf2a
1 changed files with 6 additions and 2 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
/* halftone.c
|
/* halftone.c
|
||||||
|
|
||||||
Last modified: 2021.09.21
|
Last modified: 2021.10.24
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -340,7 +340,11 @@ void halftone_line_callback(void *ptr, int which ATTRIBUTE_UNUSED,
|
||||||
'square' buffer (which starts as white)
|
'square' buffer (which starts as white)
|
||||||
(since the target is RGB, we use `min()`) */
|
(since the target is RGB, we use `min()`) */
|
||||||
SDL_GetRGB(api->getpixel(square, sqx, sqy), square->format, &or, &og, &ob);
|
SDL_GetRGB(api->getpixel(square, sqx, sqy), square->format, &or, &og, &ob);
|
||||||
pixel = SDL_MapRGB(square->format, min(r * 1.2, or), min(g * 1.2, og), min(b * 1.2, ob));
|
pixel = SDL_MapRGB(square->format,
|
||||||
|
min((Uint8) (r * 1.2), or),
|
||||||
|
min((Uint8) (g * 1.2), og),
|
||||||
|
min((Uint8) (b * 1.2), ob)
|
||||||
|
);
|
||||||
api->putpixel(square, sqx, sqy, pixel);
|
api->putpixel(square, sqx, sqy, pixel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue