From 152bcd0e2fb1e8dbd88c0013c0baf19e72c1f97f Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Sat, 21 Nov 2020 23:08:02 -0800 Subject: Add Genesis 6-button contoller image --- images/genesis_6b.png | Bin 0 -> 82338 bytes nuklear_ui/blastem_nuklear.c | 12 +++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 images/genesis_6b.png diff --git a/images/genesis_6b.png b/images/genesis_6b.png new file mode 100644 index 0000000..cd9724c Binary files /dev/null and b/images/genesis_6b.png differ diff --git a/nuklear_ui/blastem_nuklear.c b/nuklear_ui/blastem_nuklear.c index dcb5ec5..242d6ef 100644 --- a/nuklear_ui/blastem_nuklear.c +++ b/nuklear_ui/blastem_nuklear.c @@ -31,7 +31,8 @@ typedef struct struct nk_image ui; } ui_image; -static ui_image **ui_images, *controller_360, *controller_ps4, *controller_ps4_6b, *controller_wiiu; +static ui_image **ui_images, *controller_360, *controller_ps4, + *controller_ps4_6b, *controller_wiiu, *controller_gen_6b; static uint32_t num_ui_images, ui_image_storage; typedef void (*view_fun)(struct nk_context *); @@ -988,8 +989,12 @@ void view_select_binding_dest(struct nk_context *context) static ui_image *select_best_image(controller_info *info) { - if (info->variant != VARIANT_NORMAL) { - return controller_ps4_6b; + if (info->variant != VARIANT_NORMAL || info->type == TYPE_SEGA) { + if (info->type == TYPE_PSX) { + return controller_ps4_6b; + } else { + return controller_gen_6b; + } } else if (info->type == TYPE_PSX) { return controller_ps4; } else if (info->type == TYPE_NINTENDO) { @@ -2380,6 +2385,7 @@ void blastem_nuklear_init(uint8_t file_loaded) controller_ps4 = load_ui_image("images/ps4.png"); controller_ps4_6b = load_ui_image("images/ps4_6b.png"); controller_wiiu = load_ui_image("images/wiiu.png"); + controller_gen_6b = load_ui_image("images/genesis_6b.png"); texture_init(); -- cgit v1.2.3