azrp: update image shader to use dwindow settings

This commit is contained in:
Lephenixnoir 2022-11-19 17:47:14 +01:00
parent ec74a983b3
commit e86a95f6d6
Signed by: Lephenixnoir
GPG Key ID: 1BBA026E13FC0495
11 changed files with 21 additions and 30 deletions

View File

@ -115,6 +115,8 @@ extern int azrp_frag_count;
extern int azrp_frag_offset;
/* Height of fragments. */
extern int azrp_frag_height;
/* dwindow settings for the display ({ 0, 0, azrp_width, azrp_height }). */
extern struct dwindow azrp_window;
/* azrp_config_scale(): Select the renderer's super-scaling factor

View File

@ -18,6 +18,8 @@ int azrp_frag_offset;
int azrp_frag_count;
/* Height of fragment. */
int azrp_frag_height;
/* dwindow settings for the display ({ 0, 0, azrp_width, azrp_height }). */
struct dwindow azrp_window;
/* Number and total size of queued commands. */
static int commands_count=0, commands_length=0;
@ -170,6 +172,8 @@ static void update_size(void)
azrp_width = 198, azrp_height = 112, azrp_frag_height = 16;
else if(azrp_scale == 3)
azrp_width = 132, azrp_height = 75, azrp_frag_height = 16;
azrp_window = (struct dwindow){ 0, 0, azrp_width, azrp_height };
}
void azrp_config_scale(int scale)

View File

@ -39,8 +39,7 @@ void azrp_subimage_p4(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, &azrp_window)) {
cmd.loop = azrp_image_shader_p4_normal;
azrp_queue_image(&box, img, &cmd);
}
@ -59,8 +58,7 @@ void azrp_subimage_p4_clearbg(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, &azrp_window)) {
cmd.effect += 4;
cmd.color_1 = bg_color;
cmd.loop = gint_image_p4_clearbg_alt;

View File

@ -14,8 +14,7 @@ void azrp_subimage_p4_dye(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, &azrp_window)) {
cmd.effect += 4;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = dye_color;

View File

@ -14,8 +14,7 @@ void azrp_subimage_p4_swapcolor(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, &azrp_window)) {
cmd.effect += 8;
cmd.color_1 = old_index;
cmd.color_2 = new_color;
@ -39,8 +38,7 @@ void azrp_subimage_p4_addbg(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, true, true, &cmd, &azrp_window)) {
cmd.effect += 8;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = bg_color;

View File

@ -39,8 +39,7 @@ void azrp_subimage_p8(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.loop = azrp_image_shader_p8_normal;
azrp_queue_image(&box, img, &cmd);
}
@ -60,8 +59,7 @@ void azrp_subimage_p8_clearbg(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 4;
cmd.color_1 = bg_color;
cmd.loop = gint_image_p8_clearbg;

View File

@ -14,8 +14,7 @@ void azrp_subimage_p8_dye(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 4;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = dye_color;

View File

@ -14,8 +14,7 @@ void azrp_subimage_p8_swapcolor(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 8;
cmd.color_1 = old_index;
cmd.color_2 = new_color;
@ -39,8 +38,7 @@ void azrp_subimage_p8_addbg(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 8;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = bg_color;

View File

@ -39,8 +39,7 @@ void azrp_subimage_rgb16(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, false, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, false, &cmd, &azrp_window)) {
cmd.loop = azrp_image_shader_rgb16_normal;
azrp_queue_image(&box, img, &cmd);
}
@ -60,8 +59,7 @@ void azrp_subimage_rgb16_clearbg(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 4;
cmd.color_1 = bg_color;
cmd.loop = azrp_image_shader_rgb16_clearbg;

View File

@ -14,8 +14,7 @@ void azrp_subimage_rgb16_dye(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 12;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = dye_color;

View File

@ -14,8 +14,7 @@ void azrp_subimage_rgb16_swapcolor(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 8;
cmd.color_1 = old_color;
cmd.color_2 = new_color;
@ -39,8 +38,7 @@ void azrp_subimage_rgb16_addbg(int x, int y, image_t const *img,
struct gint_image_box box = { x, y, w, h, left, top };
struct gint_image_cmd cmd;
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, azrp_width,
azrp_height)) {
if(gint_image_mkcmd(&box, img, eff, false, true, &cmd, &azrp_window)) {
cmd.effect += 8;
cmd.color_1 = image_alpha(img->format);
cmd.color_2 = bg_color;