diff --git a/assets-fx/img/bopti_1col.png b/assets-fx/img/bopti_1col.png new file mode 100644 index 0000000..f1fca5b Binary files /dev/null and b/assets-fx/img/bopti_1col.png differ diff --git a/assets-fx/img/bopti_2col.png b/assets-fx/img/bopti_2col.png new file mode 100644 index 0000000..793fe8b Binary files /dev/null and b/assets-fx/img/bopti_2col.png differ diff --git a/assets-fx/img/bopti_3col.png b/assets-fx/img/bopti_3col.png new file mode 100644 index 0000000..660079b Binary files /dev/null and b/assets-fx/img/bopti_3col.png differ diff --git a/assets-fx/img/opt_gint_bopti.png b/assets-fx/img/opt_gint_bopti.png new file mode 100644 index 0000000..8388216 Binary files /dev/null and b/assets-fx/img/opt_gint_bopti.png differ diff --git a/src/gint/bopti.c b/src/gint/bopti.c index 760c600..cf7fbc2 100644 --- a/src/gint/bopti.c +++ b/src/gint/bopti.c @@ -5,10 +5,10 @@ #include #include +#ifdef FXCG50 /* gintctl_gint_bopti(): Test image rendering */ void gintctl_gint_bopti(void) { -#ifdef FXCG50 extern bopti_image_t img_swift; extern bopti_image_t img_swords; extern bopti_image_t img_potion_17x22, img_potion_18x22; @@ -62,5 +62,93 @@ void gintctl_gint_bopti(void) key = getkey().key; } -#endif } +#endif + +#ifdef FX9860G +static void img(int x, int y, bopti_image_t *img, int sub, int flags) +{ + int ix = 0; + int w = img->width; + + if(sub) x += 2, ix += 2, w -= 4; + dsubimage(x, y, img, ix, 0, w, img->height, flags); +} +#define img(x, y, i) img(x, y, & img_bopti_##i, sub, flags) + +void gintctl_gint_bopti(void) +{ + extern bopti_image_t img_opt_gint_bopti; + extern bopti_image_t img_bopti_1col; + extern bopti_image_t img_bopti_2col; + extern bopti_image_t img_bopti_3col; + + int key = 0; + int cols=0, flags=DIMAGE_NONE, sub=0, back=0; + + while(key != KEY_EXIT) + { + dclear(back ? C_BLACK : C_WHITE); + + if(cols == 0) + { + img( -6, 4, 1col); + img( 20, 4, 1col); + img( 42, 4, 1col); + img( 64, 4, 1col); + img( 90, 4, 1col); + img(122, 4, 1col); + + dsubimage(0, 10, &img_bopti_1col, 6, 0, 6, 4, flags); + dsubimage(5, 16, &img_bopti_1col, 6, 0, 6, 4, flags); + dsubimage(4, 22, &img_bopti_1col, 5, 0, 7, 4, flags); + dsubimage(3, 28, &img_bopti_1col, 4, 0, 8, 4, flags); + dsubimage(2, 34, &img_bopti_1col, 3, 0, 9, 4, flags); + dsubimage(1, 40, &img_bopti_1col, 2, 0,10, 4, flags); + dsubimage(0, 40, &img_bopti_1col, 1, 0,11, 4, flags); + dsubimage(0, 46, &img_bopti_1col, 0, 0,12, 4, flags); + + img(33, 12, 1col); + } + else if(cols == 1) + { + img(-10, 4, 2col); + img( 28, 4, 2col); + img( 96, 4, 2col); + img( 46, 12, 2col); + } + else if(cols == 2) + { + img(-30, 4, 3col); + img( 90, 4, 3col); + img( -4, 12, 3col); + img( 64, 12, 3col); + } + else if(cols == 3) + { + img( 0, 4, 1col); + img( 20, 4, 1col); + img( 42, 4, 1col); + img( 64, 4, 1col); + img(116, 4, 1col); + } + + dsubimage(0, 56, &img_opt_gint_bopti, 0,0,128,8, DIMAGE_NONE); + dsubimage(0, 56, &img_opt_gint_bopti, 0, 9*cols, 21, 8, + DIMAGE_NONE); + if(flags & DIMAGE_NOCLIP) + { + dsubimage(86, 56, &img_opt_gint_bopti, 86, 9, 21, 8, + DIMAGE_NONE); + } + + dupdate(); + + key = getkey().key; + if(key == KEY_F1) cols = (cols + 1) % 4; + if(key == KEY_F4) sub = !sub; + if(key == KEY_F5) flags ^= DIMAGE_NOCLIP; + if(key == KEY_F6) back = !back; + } +} +#endif