comparison nuklear_ui/blastem_nuklear.c @ 2020:e42c45ff06d5

Add Genesis 6-button contoller image
author Michael Pavone <pavone@retrodev.com>
date Sat, 21 Nov 2020 23:08:02 -0800
parents 193b804c9845
children 380bc5d4a2cf
comparison
equal deleted inserted replaced
2019:81eebbe6b2e3 2020:e42c45ff06d5
29 uint32_t *image_data; 29 uint32_t *image_data;
30 uint32_t width, height; 30 uint32_t width, height;
31 struct nk_image ui; 31 struct nk_image ui;
32 } ui_image; 32 } ui_image;
33 33
34 static ui_image **ui_images, *controller_360, *controller_ps4, *controller_ps4_6b, *controller_wiiu; 34 static ui_image **ui_images, *controller_360, *controller_ps4,
35 *controller_ps4_6b, *controller_wiiu, *controller_gen_6b;
35 static uint32_t num_ui_images, ui_image_storage; 36 static uint32_t num_ui_images, ui_image_storage;
36 37
37 typedef void (*view_fun)(struct nk_context *); 38 typedef void (*view_fun)(struct nk_context *);
38 static view_fun current_view; 39 static view_fun current_view;
39 static view_fun *previous_views; 40 static view_fun *previous_views;
986 free((char *)options[SIMILAR_CONTROLLERS].title); 987 free((char *)options[SIMILAR_CONTROLLERS].title);
987 } 988 }
988 989
989 static ui_image *select_best_image(controller_info *info) 990 static ui_image *select_best_image(controller_info *info)
990 { 991 {
991 if (info->variant != VARIANT_NORMAL) { 992 if (info->variant != VARIANT_NORMAL || info->type == TYPE_SEGA) {
992 return controller_ps4_6b; 993 if (info->type == TYPE_PSX) {
994 return controller_ps4_6b;
995 } else {
996 return controller_gen_6b;
997 }
993 } else if (info->type == TYPE_PSX) { 998 } else if (info->type == TYPE_PSX) {
994 return controller_ps4; 999 return controller_ps4;
995 } else if (info->type == TYPE_NINTENDO) { 1000 } else if (info->type == TYPE_NINTENDO) {
996 return controller_wiiu; 1001 return controller_wiiu;
997 } else { 1002 } else {
2378 2383
2379 controller_360 = load_ui_image("images/360.png"); 2384 controller_360 = load_ui_image("images/360.png");
2380 controller_ps4 = load_ui_image("images/ps4.png"); 2385 controller_ps4 = load_ui_image("images/ps4.png");
2381 controller_ps4_6b = load_ui_image("images/ps4_6b.png"); 2386 controller_ps4_6b = load_ui_image("images/ps4_6b.png");
2382 controller_wiiu = load_ui_image("images/wiiu.png"); 2387 controller_wiiu = load_ui_image("images/wiiu.png");
2388 controller_gen_6b = load_ui_image("images/genesis_6b.png");
2383 2389
2384 texture_init(); 2390 texture_init();
2385 2391
2386 if (file_loaded) { 2392 if (file_loaded) {
2387 current_view = view_play; 2393 current_view = view_play;