2022-05-04 18:27:02 +02:00
|
|
|
#include <gint/image.h>
|
|
|
|
#include <gint/display.h>
|
|
|
|
|
|
|
|
void dimage_p4(int x, int y, image_t const *img, int eff)
|
|
|
|
{
|
|
|
|
dsubimage_p4(x, y, img, 0, 0, img->width, img->height, eff);
|
|
|
|
}
|
|
|
|
|
|
|
|
void dsubimage_p4(int x, int y, image_t const *img,
|
|
|
|
int left, int top, int w, int h, int eff)
|
|
|
|
{
|
2022-05-14 00:30:52 +02:00
|
|
|
if(img->format == IMAGE_P4_RGB565A)
|
2022-05-04 18:27:02 +02:00
|
|
|
return dsubimage_p4_clearbg(x, y, img, left, top, w, h, eff,
|
2022-05-14 13:54:59 +02:00
|
|
|
image_alpha(img->format));
|
2022-05-04 18:27:02 +02:00
|
|
|
|
|
|
|
struct gint_image_box box = { x, y, w, h, left, top };
|
|
|
|
struct gint_image_cmd cmd;
|
|
|
|
|
2022-11-16 18:00:12 +01:00
|
|
|
if(!gint_image_mkcmd(&box, img, eff, false, false, &cmd, &dwindow))
|
|
|
|
return;
|
2022-05-04 18:27:02 +02:00
|
|
|
cmd.loop = gint_image_p4_normal;
|
|
|
|
gint_image_p4_loop(DWIDTH, &cmd);
|
|
|
|
}
|
|
|
|
|
|
|
|
void dimage_p4_clearbg(int x, int y, image_t const *img, int eff, int bg)
|
|
|
|
{
|
|
|
|
dsubimage_p4_clearbg(x, y, img, 0, 0, img->width, img->height, eff,bg);
|
|
|
|
}
|
|
|
|
|
|
|
|
void dsubimage_p4_clearbg(int x, int y, image_t const *img,
|
|
|
|
int left, int top, int w, int h, int eff, int bg_color)
|
|
|
|
{
|
|
|
|
struct gint_image_box box = { x, y, w, h, left, top };
|
|
|
|
struct gint_image_cmd cmd;
|
|
|
|
|
2022-11-16 18:00:12 +01:00
|
|
|
if(!gint_image_mkcmd(&box, img, eff, false, false, &cmd, &dwindow))
|
|
|
|
return;
|
2022-05-04 18:27:02 +02:00
|
|
|
cmd.color_1 = bg_color;
|
|
|
|
cmd.loop = gint_image_p4_clearbg;
|
|
|
|
gint_image_p4_loop(DWIDTH, &cmd);
|
|
|
|
}
|