diff --git a/console/griffin/griffin.c b/console/griffin/griffin.c index f01e7bcd7f..2d8d4ab33f 100644 --- a/console/griffin/griffin.c +++ b/console/griffin/griffin.c @@ -205,10 +205,12 @@ FONTS #include "../../gfx/fonts/fonts.c" #include "../../gfx/fonts/bitmapfont.c" +#ifdef HAVE_OPENGL +#include "../../gfx/fonts/gl_font.c" +#endif + #if defined(HAVE_LIBDBGFONT) #include "../../gfx/fonts/ps_libdbgfont.c" -#elif defined(HAVE_OPENGL) -#include "../../gfx/fonts/gl_font.c" #elif defined(_XBOX1) #include "../../gfx/fonts/xdk1_xfonts.c" #elif defined(_XBOX360) diff --git a/console/rmenu/rmenu.c b/console/rmenu/rmenu.c index c5fddd5f63..a4571a4e94 100644 --- a/console/rmenu/rmenu.c +++ b/console/rmenu/rmenu.c @@ -507,7 +507,7 @@ static void display_menubar(menu *current_menu) { case GENERAL_VIDEO_MENU: snprintf(msg, sizeof(msg), "NEXT -> [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_R)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, msg); break; case GENERAL_AUDIO_MENU: case EMU_GENERAL_MENU: @@ -515,12 +515,12 @@ static void display_menubar(menu *current_menu) case EMU_AUDIO_MENU: case PATH_MENU: snprintf(msg, sizeof(msg), "[%s] <- PREV | NEXT -> [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_L), rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_R)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, msg); break; case CONTROLS_MENU: case INGAME_MENU_RESIZE: snprintf(msg, sizeof(msg), "[%s] <- PREV", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_L)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, msg); break; default: break; @@ -543,7 +543,7 @@ static void display_menubar(menu *current_menu) fb = &tmpBrowser; case FILE_BROWSER_MENU: snprintf(current_path, sizeof(current_path), "PATH: %s", filebrowser_get_current_dir(fb)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, current_path); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, current_path); break; default: break; @@ -552,10 +552,10 @@ static void display_menubar(menu *current_menu) rarch_position_t position = {0}; device_ptr->ctx_driver->rmenu_draw_bg(&position); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.core_msg_x_position, default_pos.core_msg_y_position, default_pos.core_msg_font_size, WHITE, m_title); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.core_msg_x_position, default_pos.core_msg_y_position, default_pos.core_msg_font_size, WHITE, m_title); #ifdef __CELLOS_LV2__ - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, 0.05f, 1.4f, WHITE, current_menu->title); - device_ptr->ctx_driver->rmenu_render_msg(0.80f, 0.015f, 0.82f, WHITE, rarch_version); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, 0.05f, 1.4f, WHITE, current_menu->title); + device_ptr->font_ctx->render_msg_place(device_ptr,0.80f, 0.015f, 0.82f, WHITE, rarch_version); #endif } @@ -621,7 +621,7 @@ static void browser_render(filebrowser_t * b) device_ptr->ctx_driver->rmenu_draw_panel(&position); } - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.starting_y_position, default_pos.variable_font_size, i == current_index ? RED : b->current_dir.list->elems[i].attr.b ? GREEN : WHITE, fname_tmp); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.starting_y_position, default_pos.variable_font_size, i == current_index ? RED : b->current_dir.list->elems[i].attr.b ? GREEN : WHITE, fname_tmp); } } @@ -727,9 +727,9 @@ static void select_file(menu *current_menu, uint64_t input) display_menubar(current_menu); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment); snprintf(comment, sizeof(comment), "[%s] - return to settings [%s] - Reset Startdir", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_X), rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_START)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, comment); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, comment); } static void select_directory(menu *current_menu, uint64_t input) @@ -812,13 +812,13 @@ static void select_directory(menu *current_menu, uint64_t input) display_menubar(current_menu); snprintf(msg, sizeof(msg), "[%s] - Enter dir | [%s] - Go back", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_B), rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_X)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg); snprintf(msg, sizeof(msg), "[%s] - Reset to startdir", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_START)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), default_pos.font_size, YELLOW, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), default_pos.font_size, YELLOW, msg); snprintf(msg, sizeof(msg), "INFO - Browse to a directory and assign it as the path by\npressing [%s].", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_Y)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg); } static void set_keybind_digital(uint64_t default_retro_joypad_id, uint64_t input) @@ -1660,8 +1660,8 @@ static void select_setting(menu *current_menu, uint64_t input) if(items[i].page == current_menu->page) { default_pos.starting_y_position += default_pos.y_position_increment; - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.starting_y_position, default_pos.variable_font_size, current_menu->selected == items[i].enum_id ? YELLOW : WHITE, items[i].text); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position_center, default_pos.starting_y_position, default_pos.variable_font_size, WHITE, items[i].setting_text); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.starting_y_position, default_pos.variable_font_size, current_menu->selected == items[i].enum_id ? YELLOW : WHITE, items[i].text); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position_center, default_pos.starting_y_position, default_pos.variable_font_size, WHITE, items[i].setting_text); if(current_menu->selected == items[i].enum_id) { @@ -1670,7 +1670,7 @@ static void select_setting(menu *current_menu, uint64_t input) position.y = default_pos.starting_y_position; device_ptr->ctx_driver->rmenu_draw_panel(&position); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, items[i].comment); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, items[i].comment); } } } @@ -1678,9 +1678,9 @@ static void select_setting(menu *current_menu, uint64_t input) free(items); snprintf(msg, sizeof(msg), "[%s] + [%s] - Resume game", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_L3), rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_R3)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg); snprintf(msg, sizeof(msg), "[%s] - Reset to default", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_START)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), default_pos.font_size, YELLOW, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), default_pos.font_size, YELLOW, msg); } static void menu_romselect_iterate(filebrowser_t *filebrowser, menu_romselect_action_t action) @@ -1763,15 +1763,15 @@ static void select_rom(menu *current_menu, uint64_t input) else snprintf(msg, sizeof(msg), "INFO - Press [%s] to load the game.", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_B)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg); display_menubar(current_menu); snprintf(msg, sizeof(msg), "[%s] + [%s] - resume game", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_L3), rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_R3)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg); snprintf(msg, sizeof(msg), "[%s] - Settings", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_SELECT)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), default_pos.font_size, YELLOW, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), default_pos.font_size, YELLOW, msg); } static bool show_menu_screen = true; @@ -1876,60 +1876,60 @@ static void ingame_menu_resize(menu *current_menu, uint64_t input) snprintf(viewport_w, sizeof(viewport_w), "Viewport W: #%d", g_extern.console.screen.viewports.custom_vp.width); snprintf(viewport_h, sizeof(viewport_h), "Viewport H: #%d", g_extern.console.screen.viewports.custom_vp.height); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position, default_pos.font_size, GREEN, viewport_x); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*1), default_pos.font_size, GREEN, viewport_y); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*2), default_pos.font_size, GREEN, viewport_w); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*3), default_pos.font_size, GREEN, viewport_h); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position, default_pos.font_size, GREEN, viewport_x); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*1), default_pos.font_size, GREEN, viewport_y); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*2), default_pos.font_size, GREEN, viewport_w); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*3), default_pos.font_size, GREEN, viewport_h); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*4), default_pos.font_size, WHITE, "CONTROLS:"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*4), default_pos.font_size, WHITE, "CONTROLS:"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_LEFT), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_LEFT_X_DPAD_LEFT)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, "- Viewport X --"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, "- Viewport X --"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_RIGHT), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_LEFT_X_DPAD_RIGHT)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, "- Viewport X ++"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, "- Viewport X ++"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_UP), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_LEFT_Y_DPAD_UP)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, "- Viewport Y ++"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, "- Viewport Y ++"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_DOWN), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_LEFT_Y_DPAD_DOWN)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, "- Viewport Y --"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, "- Viewport Y --"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_L), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_RIGHT_X_DPAD_LEFT)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, "- Viewport W --"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, "- Viewport W --"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_R), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_RIGHT_X_DPAD_RIGHT)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, "- Viewport W ++"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, "- Viewport W ++"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_L2), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_RIGHT_Y_DPAD_UP)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, "- Viewport H ++"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, "- Viewport H ++"); snprintf(msg, sizeof(msg), "[%s] or [%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_R2), rarch_input_find_platform_key_label(1ULL << RARCH_ANALOG_RIGHT_Y_DPAD_DOWN)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, "- Viewport H --"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, "- Viewport H --"); snprintf(msg, sizeof(msg), "[%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_X)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, "- Reset To Defaults"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, "- Reset To Defaults"); snprintf(msg, sizeof(msg), "[%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_Y)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, "- Show Game"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, "- Show Game"); snprintf(msg, sizeof(msg), "[%s]", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_A)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, msg); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, "- Go back"); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place (device_ptr, default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, "- Go back"); snprintf(msg, sizeof(msg), "Press [%s] to reset to defaults.", rarch_input_find_platform_key_label(1ULL << RETRO_DEVICE_ID_JOYPAD_X)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg); } } @@ -2123,46 +2123,46 @@ static void ingame_menu(menu *current_menu, uint64_t input) display_menubar(current_menu); rarch_settings_create_menu_item_label(strw_buffer, S_LBL_LOAD_STATE_SLOT, sizeof(strw_buffer)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position, default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_LOAD_STATE), strw_buffer); + device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, default_pos.y_position, default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_LOAD_STATE), strw_buffer); rarch_settings_create_menu_item_label(strw_buffer, S_LBL_SAVE_STATE_SLOT, sizeof(strw_buffer)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SAVE_STATE), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SAVE_STATE), strw_buffer); + device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SAVE_STATE), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SAVE_STATE), strw_buffer); rarch_settings_create_menu_item_label(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer)); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_KEEP_ASPECT_RATIO)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_KEEP_ASPECT_RATIO), strw_buffer); + device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_KEEP_ASPECT_RATIO)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_KEEP_ASPECT_RATIO), strw_buffer); snprintf(strw_buffer, sizeof(strw_buffer), "Overscan: %f", g_extern.console.screen.overscan_amount); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_OVERSCAN_AMOUNT)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_OVERSCAN_AMOUNT), strw_buffer); + device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_OVERSCAN_AMOUNT)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_OVERSCAN_AMOUNT), strw_buffer); rarch_settings_create_menu_item_label(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_ORIENTATION)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_ORIENTATION), strw_buffer); + device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_ORIENTATION)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_ORIENTATION), strw_buffer); #ifdef HAVE_FBO rarch_settings_create_menu_item_label(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer)); - device_ptr->ctx_driver->rmenu_render_msg (default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SCALE_FACTOR)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SCALE_FACTOR), strw_buffer); + device_ptr->font_ctx->render_msg_place(device_ptr, default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SCALE_FACTOR)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SCALE_FACTOR), strw_buffer); #endif - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RESIZE_MODE)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RESIZE_MODE), "Resize Mode"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RESIZE_MODE)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RESIZE_MODE), "Resize Mode"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_FRAME_ADVANCE)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_FRAME_ADVANCE), "Frame Advance"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_FRAME_ADVANCE)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_FRAME_ADVANCE), "Frame Advance"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SCREENSHOT_MODE)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SCREENSHOT_MODE), "Screenshot Mode"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_SCREENSHOT_MODE)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_SCREENSHOT_MODE), "Screenshot Mode"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RESET)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RESET), "Reset"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RESET)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RESET), "Reset"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_GAME)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_GAME), "Return to Game"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_GAME)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_GAME), "Return to Game"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_MENU)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_MENU), "Return to Menu"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_MENU)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_MENU), "Return to Menu"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_CHANGE_LIBRETRO)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_CHANGE_LIBRETRO), "Change libretro core"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_CHANGE_LIBRETRO)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_CHANGE_LIBRETRO), "Change libretro core"); #ifdef HAVE_MULTIMAN - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_MULTIMAN)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_MULTIMAN), "Return to multiMAN"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_MULTIMAN)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_MULTIMAN), "Return to multiMAN"); #endif - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_QUIT_RARCH)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_QUIT_RARCH), "Quit RetroArch"); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_QUIT_RARCH)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_QUIT_RARCH), "Quit RetroArch"); - device_ptr->ctx_driver->rmenu_render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment); rarch_position_t position = {0}; position.x = default_pos.x_position; @@ -2220,6 +2220,8 @@ void menu_loop(void) do { + g_extern.frame_count++; + //first button input frame uint64_t input_state_first_frame = 0; uint64_t input_state = 0; @@ -2379,7 +2381,7 @@ void menu_loop(void) if (message && g_extern.console.rmenu.state.msg_info.enable) { - device_ptr->ctx_driver->rmenu_render_msg(default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, message); + device_ptr->font_ctx->render_msg_place(device_ptr,default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, message); } device_ptr->ctx_driver->swap_buffers(); diff --git a/gfx/context/ps3_ctx.c b/gfx/context/ps3_ctx.c index e76000b262..2a7057116a 100644 --- a/gfx/context/ps3_ctx.c +++ b/gfx/context/ps3_ctx.c @@ -31,7 +31,7 @@ #include "../image.h" #include "../gfx_context.h" -#include "../gl_font.h" +#include "../fonts/gl_font.h" #if defined(HAVE_RMENU) GLuint menu_texture_id; @@ -135,13 +135,6 @@ static void gfx_ctx_ps3_set_default_pos(rmenu_default_positions_t *position) position->core_msg_font_size = COMMENT_Y_POSITION; } -static void rmenu_ctx_ps3_render_msg(float xpos, float ypos, float scale, unsigned color, const char *msg, ...) -{ - gl_t *gl = driver.video_data; - - gl_render_msg_place(gl, xpos, ypos, scale, color, msg); -} - static void rmenu_ctx_ps3_screenshot_enable(bool enable) { #if(CELL_SDK_VERSION > 0x340000) @@ -577,7 +570,6 @@ const gfx_ctx_driver_t gfx_ctx_ps3 = { gfx_ctx_menu_draw_bg, gfx_ctx_menu_draw_panel, gfx_ctx_ps3_set_default_pos, - rmenu_ctx_ps3_render_msg, rmenu_ctx_ps3_screenshot_enable, rmenu_ctx_ps3_screenshot_dump, rmenu_ctx_ps3_drive_mapping_previous, diff --git a/gfx/fonts/fonts.c b/gfx/fonts/fonts.c index 1d3c4e3223..384e125748 100644 --- a/gfx/fonts/fonts.c +++ b/gfx/fonts/fonts.c @@ -23,9 +23,6 @@ static const font_renderer_driver_t *font_backends[] = { #ifdef HAVE_FREETYPE &ft_font_renderer, -#endif -#ifdef HAVE_LIBDBGFONT - &libdbgps_font_renderer, #endif &bitmap_font_renderer, }; diff --git a/gfx/fonts/fonts.h b/gfx/fonts/fonts.h index 2ffdefa1dc..5a4e10ad84 100644 --- a/gfx/fonts/fonts.h +++ b/gfx/fonts/fonts.h @@ -50,7 +50,6 @@ typedef struct font_renderer_driver extern const font_renderer_driver_t ft_font_renderer; extern const font_renderer_driver_t bitmap_font_renderer; -extern const font_renderer_driver_t libdbgps_font_renderer; bool font_renderer_create_default(const font_renderer_driver_t **driver, void **handle); diff --git a/gfx/fonts/gl_font.c b/gfx/fonts/gl_font.c index 1cadc03c34..feadda24ec 100644 --- a/gfx/fonts/gl_font.c +++ b/gfx/fonts/gl_font.c @@ -17,7 +17,11 @@ #include "../../general.h" static const gl_font_renderer_t *gl_font_backends[] = { +#ifdef HAVE_LIBDBGFONT + &libdbg_font, +#else &gl_raster_font, +#endif }; const gl_font_renderer_t *gl_font_init_first(void *data, const char *font_path, unsigned font_size) diff --git a/gfx/fonts/gl_font.h b/gfx/fonts/gl_font.h index ab58d677ec..0a66b91122 100644 --- a/gfx/fonts/gl_font.h +++ b/gfx/fonts/gl_font.h @@ -30,6 +30,7 @@ typedef struct gl_font_renderer } gl_font_renderer_t; extern const gl_font_renderer_t gl_raster_font; +extern const gl_font_renderer_t libdbg_font; const gl_font_renderer_t *gl_font_init_first(void *data, const char *font_path, unsigned font_size); diff --git a/gfx/fonts/ps_libdbgfont.c b/gfx/fonts/ps_libdbgfont.c index 57bd87d182..f0e498eb0b 100644 --- a/gfx/fonts/ps_libdbgfont.c +++ b/gfx/fonts/ps_libdbgfont.c @@ -33,7 +33,7 @@ #define DbgFontDraw cellDbgFontDraw #endif -static void *libdbgpsfont_renderer_init(const char *font_path, unsigned font_size) +static bool gl_init_font(void *data, const char *font_path, unsigned font_size) { (void)font_path; (void)font_size; @@ -46,6 +46,7 @@ static void *libdbgpsfont_renderer_init(const char *font_path, unsigned font_siz #if defined(SN_TARGET_PSP2) cfg.fontSize = SCE_DBGFONT_FONTSIZE_LARGE; #elif defined(__CELLOS_LV2__) + // FIXME - We need to do init_font_first in gl_start because of this gl_t *gl = (gl_t*)driver.video_data; cfg.bufSize = SCE_DBGFONT_BUFSIZE_LARGE; @@ -55,56 +56,39 @@ static void *libdbgpsfont_renderer_init(const char *font_path, unsigned font_siz DbgFontInit(&cfg); - return handle; + return true; } -static void libdbgpsfont_renderer_free(void *data) +static void gl_deinit_font(void *data) { (void)data; DbgFontExit(); } -static void libdbgpsfont_renderer_free_output(void *data, struct font_output_list *output) -{ -} - -static void libdbgpsfont_renderer_msg(void *data, const char *msg, struct font_output_list *output) +static void gl_render_msg(void *data, const char *msg) { (void)data; - float x, y, scale; - unsigned color; - - if(!output) - { - x = g_settings.video.msg_pos_x; - y = 0.76f; - scale = 1.04f; - color = SILVER; - } - else - { - x = output->head->off_x; - y = output->head->off_y; - scale = output->head->scaling_factor; - color = WHITE; - } + float x = g_settings.video.msg_pos_x; + float y = 0.76f; + float scale = 1.04f; + unsigned color = SILVER; DbgFontPrint(x, y, scale, color, msg); DbgFontPrint(x, y, scale - 0.01f, WHITE, msg); DbgFontDraw(); } -static const char *libdbgpsfont_renderer_get_default_font(void) +static void gl_render_msg_place(void *data, float x, float y, float scale, uint32_t color, const char *msg) { - return ""; + DbgFontPrint(x, y, scale, color, msg); + DbgFontDraw(); } -const font_renderer_driver_t libdbgps_font_renderer = { - libdbgpsfont_renderer_init, - libdbgpsfont_renderer_msg, - libdbgpsfont_renderer_free_output, - libdbgpsfont_renderer_free, - libdbgpsfont_renderer_get_default_font, - "libdbgpsfont", +const gl_font_renderer_t libdbg_font = { + gl_init_font, + gl_deinit_font, + gl_render_msg, + gl_render_msg_place, + "GL raster", }; diff --git a/gfx/gfx_context.h b/gfx/gfx_context.h index 9c4dec9611..434df912ed 100644 --- a/gfx/gfx_context.h +++ b/gfx/gfx_context.h @@ -118,7 +118,6 @@ typedef struct gfx_ctx_driver void (*rmenu_draw_bg)(rarch_position_t *position); void (*rmenu_draw_panel)(rarch_position_t *position); void (*rmenu_set_default_pos)(rmenu_default_positions_t *position); - void (*rmenu_render_msg)(float xpos, float ypos, float scale, unsigned color, const char *msg, ...); void (*rmenu_screenshot_enable)(bool enable); void (*rmenu_screenshot_dump)(void *data); const char *(*drive_mapping_previous)(void); diff --git a/gfx/gl.c b/gfx/gl.c index 239d29f72e..984c990927 100644 --- a/gfx/gl.c +++ b/gfx/gl.c @@ -1543,7 +1543,10 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo context_input_driver_func(input, input_data); +#ifndef HAVE_RMENU + // Comes too early for console - moved to gl_start gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size); +#endif gl_init_pbo_readback(gl); @@ -1713,6 +1716,11 @@ static void gl_start(void) gl_t *gl = (gl_t*)driver.video_data; +#ifdef RARCH_CONSOLE + // Comes too early for console - moved to gl_start + gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size); +#endif + context_get_available_resolutions_func(); #ifdef HAVE_RMENU