mirror of
https://github.com/libretro/RetroArch
synced 2025-02-20 15:40:44 +00:00
(RMenu) Callback function for rendering font messages
This commit is contained in:
parent
481b09a14a
commit
5fdb1577d8
@ -21,6 +21,23 @@
|
||||
#include "../rmenu.h"
|
||||
#include "../../../gfx/context/ps3_ctx.h"
|
||||
|
||||
#define HARDCODE_FONT_SIZE 0.91f
|
||||
#define POSITION_X 0.09f
|
||||
#define POSITION_X_CENTER 0.5f
|
||||
#define POSITION_Y_START 0.17f
|
||||
#define POSITION_Y_INCREMENT 0.035f
|
||||
#define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
|
||||
#define COMMENT_TWO_Y_POSITION 0.91f
|
||||
#define COMMENT_Y_POSITION 0.82f
|
||||
|
||||
#define MSG_QUEUE_X_POSITION g_settings.video.msg_pos_x
|
||||
#define MSG_QUEUE_Y_POSITION 0.76f
|
||||
#define MSG_QUEUE_FONT_SIZE 1.03f
|
||||
|
||||
#define MSG_PREV_NEXT_Y_POSITION 0.03f
|
||||
#define CURRENT_PATH_Y_POSITION 0.15f
|
||||
#define CURRENT_PATH_FONT_SIZE FONT_SIZE
|
||||
|
||||
static void rmenu_ctx_ps3_clear(void)
|
||||
{
|
||||
gfx_ctx_clear();
|
||||
@ -77,6 +94,12 @@ static void rmenu_ctx_ps3_set_default_pos(rmenu_default_positions_t *position)
|
||||
position->current_path_y_position = CURRENT_PATH_Y_POSITION;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_ps3_render_msg(float xpos, float ypos, float scale, float color, const char *msg, ...)
|
||||
{
|
||||
gl_t *gl = driver.video_data;
|
||||
gl_render_msg_place(gl, xpos, ypos, scale, color, msg)
|
||||
}
|
||||
|
||||
const rmenu_context_t rmenu_ctx_ps3 = {
|
||||
.clear = rmenu_ctx_ps3_clear,
|
||||
.blend = rmenu_ctx_ps3_blend,
|
||||
@ -84,6 +107,7 @@ const rmenu_context_t rmenu_ctx_ps3 = {
|
||||
.init_textures = rmenu_ctx_ps3_init_textures,
|
||||
.render_selection_panel = rmenu_ctx_ps3_render_selection_panel,
|
||||
.render_bg = rmenu_ctx_ps3_render_bg,
|
||||
.render_msg = rmenu_ctx_ps3_render_msg,
|
||||
.swap_buffers = rmenu_ctx_ps3_swap_buffers,
|
||||
.set_default_pos = rmenu_ctx_ps3_set_default_pos,
|
||||
};
|
||||
|
@ -20,6 +20,23 @@
|
||||
#define ROM_PANEL_WIDTH 510
|
||||
#define ROM_PANEL_HEIGHT 20
|
||||
|
||||
#define POSITION_X m_menuMainRomListPos_x
|
||||
#define POSITION_X_CENTER (m_menuMainRomListPos_x + 350)
|
||||
#define POSITION_Y_START m_menuMainRomListPos_y
|
||||
#define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
|
||||
#define POSITION_Y_INCREMENT 20
|
||||
#define COMMENT_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 3))
|
||||
#define COMMENT_TWO_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 1))
|
||||
|
||||
#define MSG_QUEUE_X_POSITION POSITION_X
|
||||
#define MSG_QUEUE_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 7) + 5)
|
||||
#define MSG_QUEUE_FONT_SIZE HARDCODE_FONT_SIZE
|
||||
|
||||
#define MSG_PREV_NEXT_Y_POSITION 24
|
||||
|
||||
#define CURRENT_PATH_Y_POSITION (m_menuMainRomListPos_y - ((POSITION_Y_INCREMENT/2)))
|
||||
#define CURRENT_PATH_FONT_SIZE 21
|
||||
|
||||
int xpos, ypos;
|
||||
texture_image m_menuMainRomSelectPanel;
|
||||
texture_image m_menuMainBG;
|
||||
@ -112,6 +129,12 @@ static void rmenu_ctx_xdk_set_default_pos(rmenu_default_positions_t *position)
|
||||
position->current_path_y_position = CURRENT_PATH_Y_POSITION;
|
||||
}
|
||||
|
||||
static void rmenu_ctx_xdk_render_msg(float xpos, float ypos, float scale, float color, const char *msg, ...)
|
||||
{
|
||||
xdk_d3d_video_t *d3d = (xdk_d3d_video_t*)driver.video_data;
|
||||
xfonts_render_msg_place(d3d, xpos, ypos, scale, msg);
|
||||
}
|
||||
|
||||
const rmenu_context_t rmenu_ctx_xdk = {
|
||||
rmenu_ctx_xdk_clear,
|
||||
rmenu_ctx_xdk_blend,
|
||||
@ -119,6 +142,7 @@ const rmenu_context_t rmenu_ctx_xdk = {
|
||||
rmenu_ctx_xdk_init_textures,
|
||||
rmenu_ctx_xdk_render_selection_panel,
|
||||
rmenu_ctx_xdk_render_bg,
|
||||
rmenu_ctx_xdk_render_msg,
|
||||
rmenu_ctx_xdk_swap_buffers,
|
||||
rmenu_ctx_xdk_set_default_pos,
|
||||
};
|
||||
|
@ -600,14 +600,14 @@ static void display_menubar(menu *current_menu)
|
||||
switch(current_menu->enum_id)
|
||||
{
|
||||
case GENERAL_VIDEO_MENU:
|
||||
render_msg_place_func(default_pos.x_position, default_pos.msg_prev_next_y_position, default_pos.font_size, WHITE, "NEXT ->");
|
||||
context->render_msg(default_pos.x_position, default_pos.msg_prev_next_y_position, default_pos.font_size, WHITE, "NEXT ->");
|
||||
break;
|
||||
case GENERAL_AUDIO_MENU:
|
||||
case EMU_GENERAL_MENU:
|
||||
case EMU_VIDEO_MENU:
|
||||
case EMU_AUDIO_MENU:
|
||||
case PATH_MENU:
|
||||
render_msg_place_func(default_pos.x_position, default_pos.msg_prev_next_y_position, default_pos.font_size, WHITE, "<- PREV | NEXT ->");
|
||||
context->render_msg(default_pos.x_position, default_pos.msg_prev_next_y_position, default_pos.font_size, WHITE, "<- PREV | NEXT ->");
|
||||
break;
|
||||
case CONTROLS_MENU:
|
||||
case INGAME_MENU_RESIZE:
|
||||
@ -623,7 +623,7 @@ static void display_menubar(menu *current_menu)
|
||||
#endif
|
||||
case PATH_SRAM_DIR_CHOICE:
|
||||
case PATH_SYSTEM_DIR_CHOICE:
|
||||
render_msg_place_func(default_pos.x_position, default_pos.msg_prev_next_y_position, default_pos.font_size, WHITE, "<- PREV");
|
||||
context->render_msg(default_pos.x_position, default_pos.msg_prev_next_y_position, default_pos.font_size, WHITE, "<- PREV");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -646,7 +646,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));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, current_path);
|
||||
context->render_msg(default_pos.x_position, default_pos.current_path_y_position, default_pos.current_path_font_size, WHITE, current_path);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@ -656,9 +656,9 @@ static void display_menubar(menu *current_menu)
|
||||
context->render_bg(&position);
|
||||
|
||||
#ifdef __CELLOS_LV2__
|
||||
render_msg_place_func(default_pos.x_position, 0.05f, 1.4f, WHITE, current_menu->title);
|
||||
render_msg_place_func(0.3f, 0.06f, 0.82f, WHITE, m_title);
|
||||
render_msg_place_func(0.80f, 0.015f, 0.82f, WHITE, rarch_version);
|
||||
context->render_msg(default_pos.x_position, 0.05f, 1.4f, WHITE, current_menu->title);
|
||||
context->render_msg(0.3f, 0.06f, 0.82f, WHITE, m_title);
|
||||
context->render_msg(0.80f, 0.015f, 0.82f, WHITE, rarch_version);
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -728,9 +728,9 @@ static void browser_render(filebrowser_t * b, float current_x, float current_y,
|
||||
}
|
||||
|
||||
#ifdef _XBOX1
|
||||
render_msg_place_func(currentX, currentY, 0, 0, fname_tmp);
|
||||
context->render_msg(currentX, currentY, 0, 0, fname_tmp);
|
||||
#else
|
||||
render_msg_place_func(currentX, currentY, FONT_SIZE, i == current_index ? RED : b->current_dir.list->elems[i].attr.b ? GREEN : WHITE, fname_tmp);
|
||||
context->render_msg(currentX, currentY, FONT_SIZE, i == current_index ? RED : b->current_dir.list->elems[i].attr.b ? GREEN : WHITE, fname_tmp);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@ -864,8 +864,8 @@ static void select_file(item *items, menu *current_menu, uint64_t input)
|
||||
display_menubar(current_menu);
|
||||
|
||||
snprintf(comment_two, sizeof(comment_two), "[%s] - return to settings [%s] - Reset Startdir", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_X), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_START));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, comment_two);
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, comment_two);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment);
|
||||
}
|
||||
|
||||
static void select_directory(item *items, menu *current_menu, uint64_t input)
|
||||
@ -948,13 +948,13 @@ static void select_directory(item *items, 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(1 << RETRO_DEVICE_ID_JOYPAD_B), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_X));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position, default_pos.font_size, YELLOW, msg);
|
||||
context->render_msg(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(1 << RETRO_DEVICE_ID_JOYPAD_START));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), FONT_SIZE, YELLOW, msg);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), 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(1 << RETRO_DEVICE_ID_JOYPAD_Y));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg);
|
||||
context->render_msg(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)
|
||||
@ -1752,8 +1752,8 @@ static void select_setting(item *items, menu *current_menu, uint64_t input)
|
||||
{
|
||||
if(items[i].page == current_menu->page)
|
||||
{
|
||||
render_msg_place_func(items[i].text_xpos, items[i].text_ypos, FONT_SIZE, current_menu->selected == items[i].enum_id ? YELLOW : items[i].item_color, items[i].text);
|
||||
render_msg_place_func(default_pos.x_position_center, items[i].text_ypos, FONT_SIZE, items[i].text_color, items[i].setting_text);
|
||||
context->render_msg(items[i].text_xpos, items[i].text_ypos, FONT_SIZE, current_menu->selected == items[i].enum_id ? YELLOW : items[i].item_color, items[i].text);
|
||||
context->render_msg(default_pos.x_position_center, items[i].text_ypos, FONT_SIZE, items[i].text_color, items[i].setting_text);
|
||||
|
||||
if(current_menu->selected == items[i].enum_id)
|
||||
{
|
||||
@ -1766,12 +1766,12 @@ static void select_setting(item *items, menu *current_menu, uint64_t input)
|
||||
}
|
||||
}
|
||||
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, items[current_menu->selected].comment);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, items[current_menu->selected].comment);
|
||||
|
||||
snprintf(msg, sizeof(msg), "[%s] + [%s] - resume game | [%s] - go forward", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_L3), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_R3), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_R));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position, FONT_SIZE, YELLOW, msg);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_two_y_position, FONT_SIZE, YELLOW, msg);
|
||||
snprintf(msg, sizeof(msg), "[%s] - default | [%s]/[%s] - go back", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_START), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_L), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_A));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), FONT_SIZE, YELLOW, msg);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), FONT_SIZE, YELLOW, msg);
|
||||
}
|
||||
|
||||
static void menu_romselect_iterate(filebrowser_t *filebrowser, item *items, menu_romselect_action_t action)
|
||||
@ -1829,15 +1829,15 @@ static void select_rom(item *items, menu *current_menu, uint64_t input)
|
||||
else
|
||||
snprintf(msg, sizeof(msg), "INFO - Press [%s] to load the game.", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_B));
|
||||
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg);
|
||||
context->render_msg(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(1 << RETRO_DEVICE_ID_JOYPAD_L3), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_R3));
|
||||
snprintf(msg2, sizeof(msg2), "[%s] - Settings", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_SELECT));
|
||||
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position, FONT_SIZE, YELLOW, msg);
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), FONT_SIZE, YELLOW, msg2);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_two_y_position, FONT_SIZE, YELLOW, msg);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_two_y_position + (default_pos.y_position_increment * 1), FONT_SIZE, YELLOW, msg2);
|
||||
}
|
||||
|
||||
|
||||
@ -1944,60 +1944,60 @@ static void ingame_menu_resize(item *items, menu *current_menu, uint64_t input)
|
||||
snprintf(viewport_w, sizeof(viewport_w), "Viewport W: #%d", g_console.viewports.custom_vp.width);
|
||||
snprintf(viewport_h, sizeof(viewport_h), "Viewport H: #%d", g_console.viewports.custom_vp.height);
|
||||
|
||||
render_msg_place_func(default_pos.x_position, default_pos.y_position, default_pos.font_size, GREEN, viewport_x);
|
||||
render_msg_place_func(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*1), default_pos.font_size, GREEN, viewport_y);
|
||||
render_msg_place_func(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*2), default_pos.font_size, GREEN, viewport_w);
|
||||
render_msg_place_func(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*3), default_pos.font_size, GREEN, viewport_h);
|
||||
context->render_msg(default_pos.x_position, default_pos.y_position, default_pos.font_size, GREEN, viewport_x);
|
||||
context->render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*1), default_pos.font_size, GREEN, viewport_y);
|
||||
context->render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*2), default_pos.font_size, GREEN, viewport_w);
|
||||
context->render_msg(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*3), default_pos.font_size, GREEN, viewport_h);
|
||||
|
||||
render_msg_place_func(default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*4), default_pos.font_size, WHITE, "CONTROLS:");
|
||||
context->render_msg(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(1 << RETRO_DEVICE_ID_JOYPAD_LEFT), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_LEFT));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, "- Viewport X --");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*5), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_RIGHT), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_RIGHT));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, "- Viewport X ++");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*6), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_UP), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_UP));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, "- Viewport Y ++");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*7), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_DOWN), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_LEFT_DPAD_DOWN));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, "- Viewport Y --");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*8), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_L), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_LEFT));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, "- Viewport W --");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*9), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_R), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_RIGHT));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, "- Viewport W ++");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*10), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_L2), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_UP));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, "- Viewport H ++");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*11), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_R2), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_ANALOG_RIGHT_DPAD_DOWN));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, "- Viewport H --");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*12), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_X));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, "- Reset To Defaults");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*13), default_pos.font_size, WHITE, msg);
|
||||
context->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");
|
||||
|
||||
snprintf(msg, sizeof(msg), "[%s]", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_Y));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, "- Show Game");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*14), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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(1 << RETRO_DEVICE_ID_JOYPAD_A));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, msg);
|
||||
render_msg_place_func (default_pos.x_position_center, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, "- Go back");
|
||||
context->render_msg (default_pos.x_position, default_pos.y_position+(default_pos.y_position_increment*15), default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (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), "Allows you to resize the screen.\nPress [%s] to reset to defaults, and [%s] to go back.", rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_X), rarch_input_find_platform_key_label(1 << RETRO_DEVICE_ID_JOYPAD_A));
|
||||
render_msg_place_func (default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg);
|
||||
context->render_msg (default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, msg);
|
||||
}
|
||||
}
|
||||
|
||||
@ -2187,46 +2187,46 @@ static void ingame_menu(item *items, 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));
|
||||
render_msg_place_func(default_pos.x_position, default_pos.y_position, default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_LOAD_STATE), strw_buffer);
|
||||
context->render_msg(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));
|
||||
render_msg_place_func(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);
|
||||
context->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);
|
||||
|
||||
rarch_settings_create_menu_item_label(strw_buffer, S_LBL_ASPECT_RATIO, sizeof(strw_buffer));
|
||||
render_msg_place_func(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);
|
||||
context->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);
|
||||
|
||||
snprintf(overscan_msg, sizeof(overscan_msg), "Overscan: %f", g_console.overscan_amount);
|
||||
render_msg_place_func(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), overscan_msg);
|
||||
context->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), overscan_msg);
|
||||
|
||||
rarch_settings_create_menu_item_label(strw_buffer, S_LBL_ROTATION, sizeof(strw_buffer));
|
||||
render_msg_place_func (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);
|
||||
context->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);
|
||||
|
||||
#ifdef HAVE_FBO
|
||||
rarch_settings_create_menu_item_label(strw_buffer, S_LBL_SCALE_FACTOR, sizeof(strw_buffer));
|
||||
render_msg_place_func (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);
|
||||
context->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);
|
||||
#endif
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
|
||||
#ifdef HAVE_MULTIMAN
|
||||
render_msg_place_func(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");
|
||||
context->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");
|
||||
#endif
|
||||
|
||||
render_msg_place_func(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_DASHBOARD)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_DASHBOARD), "Return to Dashboard");
|
||||
context->render_msg(default_pos.x_position, (default_pos.y_position+(default_pos.y_position_increment*MENU_ITEM_RETURN_TO_DASHBOARD)), default_pos.font_size, MENU_ITEM_SELECTED(MENU_ITEM_RETURN_TO_DASHBOARD), "Return to Dashboard");
|
||||
|
||||
render_msg_place_func(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment);
|
||||
context->render_msg(default_pos.x_position, default_pos.comment_y_position, default_pos.font_size, WHITE, comment);
|
||||
|
||||
rmenu_position_t position = {0};
|
||||
position.x = default_pos.x_position;
|
||||
@ -2506,7 +2506,7 @@ void menu_loop(void)
|
||||
|
||||
if (message && g_console.info_msg_enable)
|
||||
{
|
||||
render_msg_place_func(default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, message);
|
||||
context->render_msg(default_pos.msg_queue_x_position, default_pos.msg_queue_y_position, default_pos.msg_queue_font_size, WHITE, message);
|
||||
}
|
||||
|
||||
context->swap_buffers();
|
||||
|
@ -22,52 +22,18 @@
|
||||
#define input_ptr input_ps3
|
||||
#define video_ptr video_gl
|
||||
#define DEVICE_PTR device_ptr
|
||||
#define HARDCODE_FONT_SIZE 0.91f
|
||||
#define FONT_SIZE (g_console.menu_font_size)
|
||||
#define render_msg_place_func(xpos, ypos, scale, color, msg) gl_render_msg_place(DEVICE_PTR, xpos, ypos, scale, color, msg)
|
||||
|
||||
#define NUM_ENTRY_PER_PAGE 15
|
||||
#define POSITION_X 0.09f
|
||||
#define POSITION_X_CENTER 0.5f
|
||||
#define POSITION_Y_START 0.17f
|
||||
#define POSITION_Y_INCREMENT 0.035f
|
||||
#define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
|
||||
#define COMMENT_TWO_Y_POSITION 0.91f
|
||||
#define COMMENT_Y_POSITION 0.82f
|
||||
|
||||
#define MSG_QUEUE_X_POSITION g_settings.video.msg_pos_x
|
||||
#define MSG_QUEUE_Y_POSITION 0.76f
|
||||
#define MSG_QUEUE_FONT_SIZE 1.03f
|
||||
|
||||
#define MSG_PREV_NEXT_Y_POSITION 0.03f
|
||||
#define CURRENT_PATH_Y_POSITION 0.15f
|
||||
#define CURRENT_PATH_FONT_SIZE FONT_SIZE
|
||||
#elif defined(_XBOX1)
|
||||
#define DEVICE_CAST xdk_d3d_video_t*
|
||||
#define input_ptr input_xinput
|
||||
#define video_ptr video_xdk_d3d
|
||||
#define DEVICE_PTR device_ptr
|
||||
#define HARDCODE_FONT_SIZE 21
|
||||
#define FONT_SIZE 21
|
||||
#define render_msg_place_func(xpos, ypos, scale, color, msg) xfonts_render_msg_place(DEVICE_PTR, xpos, ypos, scale, msg)
|
||||
#define FONT_SIZE 21
|
||||
|
||||
#define NUM_ENTRY_PER_PAGE 12
|
||||
#define POSITION_X m_menuMainRomListPos_x
|
||||
#define POSITION_X_CENTER (m_menuMainRomListPos_x + 350)
|
||||
#define POSITION_Y_START m_menuMainRomListPos_y
|
||||
#define POSITION_Y_BEGIN (POSITION_Y_START + POSITION_Y_INCREMENT)
|
||||
#define POSITION_Y_INCREMENT 20
|
||||
#define COMMENT_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 3))
|
||||
#define COMMENT_TWO_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 1))
|
||||
|
||||
#define MSG_QUEUE_X_POSITION POSITION_X
|
||||
#define MSG_QUEUE_Y_POSITION (ypos - ((POSITION_Y_INCREMENT/2) * 7) + 5)
|
||||
#define MSG_QUEUE_FONT_SIZE HARDCODE_FONT_SIZE
|
||||
|
||||
#define MSG_PREV_NEXT_Y_POSITION 24
|
||||
|
||||
#define CURRENT_PATH_Y_POSITION (m_menuMainRomListPos_y - ((POSITION_Y_INCREMENT/2)))
|
||||
#define CURRENT_PATH_FONT_SIZE 21
|
||||
#endif
|
||||
|
||||
typedef struct
|
||||
@ -128,6 +94,7 @@ typedef struct rmenu_context
|
||||
void (*init_textures)(void);
|
||||
void (*render_selection_panel)(rmenu_position_t *position);
|
||||
void (*render_bg)(rmenu_position_t *position);
|
||||
void (*render_msg)(float xpos, float ypos, float scale, float color, const char *msg, ...);
|
||||
void (*swap_buffers)(void);
|
||||
void (*set_default_pos)(rmenu_default_positions_t *position);
|
||||
} rmenu_context_t;
|
||||
|
Loading…
x
Reference in New Issue
Block a user