diff --git a/azur/src/gint/shaders/image.c b/azur/src/gint/shaders/image.c index 82e439d..0ae2162 100644 --- a/azur/src/gint/shaders/image.c +++ b/azur/src/gint/shaders/image.c @@ -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); } diff --git a/azur/src/gint/shaders/image_p4.c b/azur/src/gint/shaders/image_p4.c index 4938c10..a776e58 100644 --- a/azur/src/gint/shaders/image_p4.c +++ b/azur/src/gint/shaders/image_p4.c @@ -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 }; diff --git a/azur/src/gint/shaders/image_p4_dye.c b/azur/src/gint/shaders/image_p4_dye.c index f9a860f..36878a2 100644 --- a/azur/src/gint/shaders/image_p4_dye.c +++ b/azur/src/gint/shaders/image_p4_dye.c @@ -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); diff --git a/azur/src/gint/shaders/image_p4_swapcolor.c b/azur/src/gint/shaders/image_p4_swapcolor.c index 4464027..8cb4c79 100644 --- a/azur/src/gint/shaders/image_p4_swapcolor.c +++ b/azur/src/gint/shaders/image_p4_swapcolor.c @@ -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); diff --git a/azur/src/gint/shaders/image_p8.c b/azur/src/gint/shaders/image_p8.c index 34cd47c..658dd26 100644 --- a/azur/src/gint/shaders/image_p8.c +++ b/azur/src/gint/shaders/image_p8.c @@ -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 }; diff --git a/azur/src/gint/shaders/image_p8_dye.c b/azur/src/gint/shaders/image_p8_dye.c index a0128ee..91e2606 100644 --- a/azur/src/gint/shaders/image_p8_dye.c +++ b/azur/src/gint/shaders/image_p8_dye.c @@ -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); diff --git a/azur/src/gint/shaders/image_p8_swapcolor.c b/azur/src/gint/shaders/image_p8_swapcolor.c index ddb8da9..39542a2 100644 --- a/azur/src/gint/shaders/image_p8_swapcolor.c +++ b/azur/src/gint/shaders/image_p8_swapcolor.c @@ -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); diff --git a/azur/src/gint/shaders/image_rgb16.c b/azur/src/gint/shaders/image_rgb16.c index f7b4f82..477dc74 100644 --- a/azur/src/gint/shaders/image_rgb16.c +++ b/azur/src/gint/shaders/image_rgb16.c @@ -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 }; diff --git a/azur/src/gint/shaders/image_rgb16_dye.c b/azur/src/gint/shaders/image_rgb16_dye.c index d1572a1..cda6210 100644 --- a/azur/src/gint/shaders/image_rgb16_dye.c +++ b/azur/src/gint/shaders/image_rgb16_dye.c @@ -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); diff --git a/azur/src/gint/shaders/image_rgb16_swapcolor.c b/azur/src/gint/shaders/image_rgb16_swapcolor.c index 57e907a..c4d5802 100644 --- a/azur/src/gint/shaders/image_rgb16_swapcolor.c +++ b/azur/src/gint/shaders/image_rgb16_swapcolor.c @@ -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);