azur: update to new gint 2.8 image format

This commit is contained in:
Lephe 2022-05-27 20:53:08 +01:00 committed by Lephenixnoir
parent 8ac9ac747a
commit e63b1eb3c4
Signed by untrusted user: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
10 changed files with 19 additions and 19 deletions

View File

@ -5,10 +5,10 @@ void azrp_queue_image(struct gint_image_box *box, image_t const *img,
struct gint_image_cmd *cmd)
{
/* TODO: Ironically, this loads all 3 entry points */
int p = img->profile;
if(p == IMAGE_RGB565 || p == IMAGE_RGB565A)
int f = img->format;
if(IMAGE_IS_RGB16(f))
cmd->shader_id = AZRP_SHADER_IMAGE_RGB16;
else if(p == IMAGE_P8_RGB565 || p == IMAGE_P8_RGB565A)
else if(IMAGE_IS_P8(f))
cmd->shader_id = AZRP_SHADER_IMAGE_P8;
else
cmd->shader_id = AZRP_SHADER_IMAGE_P4;
@ -29,13 +29,13 @@ void azrp_queue_image(struct gint_image_box *box, image_t const *img,
void azrp_subimage(int x, int y, image_t const *img,
int left, int top, int width, int height, int flags)
{
int p = img->profile;
int f = img->format;
if(p == IMAGE_RGB565 || p == IMAGE_RGB565A)
if(IMAGE_IS_RGB16(f))
return azrp_subimage_rgb16(x, y, img, left, top, width, height, flags);
if(p == IMAGE_P8_RGB565 || p == IMAGE_P8_RGB565A)
if(IMAGE_IS_P8(f))
return azrp_subimage_p8(x, y, img, left, top, width, height, flags);
if(p == IMAGE_P4_RGB565 || p == IMAGE_P4_RGB565A)
if(IMAGE_IS_P4(f))
return azrp_subimage_p4(x, y, img, left, top, width, height, flags);
}

View File

@ -31,9 +31,9 @@ void azrp_image_p4(int x, int y, image_t const *img, int eff)
void azrp_subimage_p4(int x, int y, image_t const *img,
int left, int top, int w, int h, int eff)
{
if(img->profile == IMAGE_P4_RGB565A)
if(img->format == IMAGE_P4_RGB565A)
return azrp_subimage_p4_clearbg(x, y, img, left, top, w, h, eff,
img->alpha);
image_alpha(img->format));
prof_enter(azrp_perf_cmdgen);
struct gint_image_box box = { x, y, w, h, left, top };

View File

@ -17,7 +17,7 @@ void azrp_subimage_p4_dye(int x, int y, image_t const *img,
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
cmd.effect += 4;
cmd.color_1 = img->alpha;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = dye_color;
cmd.loop = gint_image_p4_dye;
azrp_queue_image(&box, img, &cmd);

View File

@ -42,7 +42,7 @@ void azrp_subimage_p4_addbg(int x, int y, image_t const *img,
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
cmd.effect += 8;
cmd.color_1 = img->alpha;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = bg_color;
cmd.loop = gint_image_p4_swapcolor;
azrp_queue_image(&box, img, &cmd);

View File

@ -31,9 +31,9 @@ void azrp_image_p8(int x, int y, image_t const *img, int eff)
void azrp_subimage_p8(int x, int y, image_t const *img,
int left, int top, int w, int h, int eff)
{
if(img->profile == IMAGE_P8_RGB565A)
if(img->format == IMAGE_P8_RGB565A)
return azrp_subimage_p8_clearbg(x, y, img, left, top, w, h, eff,
img->alpha);
image_alpha(img->format));
prof_enter(azrp_perf_cmdgen);
struct gint_image_box box = { x, y, w, h, left, top };

View File

@ -17,7 +17,7 @@ void azrp_subimage_p8_dye(int x, int y, image_t const *img,
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
cmd.effect += 4;
cmd.color_1 = img->alpha;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = dye_color;
cmd.loop = gint_image_p8_dye;
azrp_queue_image(&box, img, &cmd);

View File

@ -42,7 +42,7 @@ void azrp_subimage_p8_addbg(int x, int y, image_t const *img,
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
cmd.effect += 8;
cmd.color_1 = img->alpha;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = bg_color;
cmd.loop = azrp_image_shader_p8_swapcolor;
azrp_queue_image(&box, img, &cmd);

View File

@ -31,9 +31,9 @@ void azrp_image_rgb16(int x, int y, image_t const *img, int eff)
void azrp_subimage_rgb16(int x, int y, image_t const *img,
int left, int top, int w, int h, int eff)
{
if(img->profile == IMAGE_RGB565A)
if(img->format == IMAGE_RGB565A)
return azrp_subimage_rgb16_clearbg(x, y, img, left, top, w, h, eff,
img->alpha);
image_alpha(img->format));
prof_enter(azrp_perf_cmdgen);
struct gint_image_box box = { x, y, w, h, left, top };

View File

@ -17,7 +17,7 @@ void azrp_subimage_rgb16_dye(int x, int y, image_t const *img,
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
cmd.effect += 12;
cmd.color_1 = img->alpha;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = dye_color;
cmd.loop = azrp_image_shader_rgb16_dye;
azrp_queue_image(&box, img, &cmd);

View File

@ -42,7 +42,7 @@ void azrp_subimage_rgb16_addbg(int x, int y, image_t const *img,
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
cmd.effect += 8;
cmd.color_1 = img->alpha;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = bg_color;
cmd.loop = azrp_image_shader_rgb16_swapcolor;
azrp_queue_image(&box, img, &cmd);