more mewui -> ui renames (nw)

This commit is contained in:
Miodrag Milanovic 2016-02-04 15:01:41 +01:00
parent 213283e430
commit 52d97f0dfa
15 changed files with 162 additions and 162 deletions

View File

@ -201,7 +201,7 @@ const options_entry emu_options::s_option_entries[] =
//-------------------------------------------------
emu_options::emu_options()
: mewui_options()
: ui_options()
, m_coin_impulse(0)
, m_joystick_contradictory(false)
, m_sleep(true)

View File

@ -201,7 +201,7 @@ struct game_driver;
class software_part;
class emu_options : public mewui_options
class emu_options : public ui_options
{
static const UINT32 OPTION_FLAG_DEVICE = 0x80000000;

View File

@ -33,8 +33,8 @@ ui_menu_custom_ui::ui_menu_custom_ui(running_machine &machine, render_container
ui_menu_custom_ui::~ui_menu_custom_ui()
{
std::string error_string;
machine().options().set_value(OPTION_HIDE_PANELS, mewui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string);
mewui_globals::reset = true;
machine().options().set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string);
ui_globals::reset = true;
}
//-------------------------------------------------
@ -53,7 +53,7 @@ void ui_menu_custom_ui::handle()
if (m_event->iptkey == IPT_UI_LEFT || m_event->iptkey == IPT_UI_RIGHT)
{
changed = true;
(m_event->iptkey == IPT_UI_RIGHT) ? mewui_globals::panels_status++ : mewui_globals::panels_status--;
(m_event->iptkey == IPT_UI_RIGHT) ? ui_globals::panels_status++ : ui_globals::panels_status--;
}
@ -75,7 +75,7 @@ void ui_menu_custom_ui::handle()
for (int index = 0; index < total; ++index)
s_sel[index] = hide_status[index];
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, mewui_globals::panels_status));
ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ui_globals::panels_status));
}
}
}
@ -94,8 +94,8 @@ void ui_menu_custom_ui::populate()
item_append("Fonts", nullptr, 0, (void *)(FPTR)FONT_MENU);
item_append("Colors", nullptr, 0, (void *)(FPTR)COLORS_MENU);
UINT32 arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, mewui_globals::panels_status);
item_append("Filters and Info/Image", hide_status[mewui_globals::panels_status], arrow_flags, (void *)(FPTR)HIDE_MENU);
UINT32 arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, ui_globals::panels_status);
item_append("Filters and Info/Image", hide_status[ui_globals::panels_status], arrow_flags, (void *)(FPTR)HIDE_MENU);
item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;

View File

@ -327,7 +327,7 @@ ui_menu_directory::ui_menu_directory(running_machine &machine, render_container
ui_menu_directory::~ui_menu_directory()
{
save_game_options(machine());
mewui_globals::reset = true;
ui_globals::reset = true;
}
//-------------------------------------------------

View File

@ -89,7 +89,7 @@ ui_menu_display_options::~ui_menu_display_options()
machine().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string);
machine().options().set_value(m_options[1].option, m_video[m_options[1].status].option, OPTION_PRIORITY_CMDLINE, error_string);
mewui_globals::reset = true;
ui_globals::reset = true;
}
//-------------------------------------------------

View File

@ -1363,7 +1363,7 @@ void ui_menu::draw_select_game(bool noinput)
float ud_arrow_width = line_height * machine().render().ui_aspect();
float gutter_width = 0.4f * line_height * machine().render().ui_aspect() * 1.3f;
mouse_x = -1, mouse_y = -1;
float right_panel_size = (mewui_globals::panels_status == HIDE_BOTH || mewui_globals::panels_status == HIDE_RIGHT_PANEL) ? 2.0f * UI_BOX_LR_BORDER : 0.3f;
float right_panel_size = (ui_globals::panels_status == HIDE_BOTH || ui_globals::panels_status == HIDE_RIGHT_PANEL) ? 2.0f * UI_BOX_LR_BORDER : 0.3f;
float visible_width = 1.0f - 4.0f * UI_BOX_LR_BORDER;
float primary_left = (1.0f - visible_width) * 0.5f;
float primary_width = visible_width;
@ -1397,9 +1397,9 @@ void ui_menu::draw_select_game(bool noinput)
visible_main_menu_height = (float)(visible_lines * line_height);
if (!is_swlist)
mewui_globals::visible_main_lines = visible_lines;
ui_globals::visible_main_lines = visible_lines;
else
mewui_globals::visible_sw_lines = visible_lines;
ui_globals::visible_sw_lines = visible_lines;
// compute top/left of inner menu area by centering
float visible_left = primary_left;
@ -1600,7 +1600,7 @@ void ui_menu::draw_select_game(bool noinput)
// reset redraw icon stage
if (!is_swlist)
mewui_globals::redraw_icon = false;
ui_globals::redraw_icon = false;
}
//-------------------------------------------------
@ -1610,17 +1610,17 @@ void ui_menu::draw_select_game(bool noinput)
void ui_menu::get_title_search(std::string &snaptext, std::string &searchstr)
{
// get arts title text
snaptext.assign(arts_info[mewui_globals::curimage_view].title);
snaptext.assign(arts_info[ui_globals::curimage_view].title);
// get search path
path_iterator path(machine().options().value(arts_info[mewui_globals::curimage_view].path));
path_iterator path(machine().options().value(arts_info[ui_globals::curimage_view].path));
std::string curpath;
searchstr.assign(machine().options().value(arts_info[mewui_globals::curimage_view].path));
searchstr.assign(machine().options().value(arts_info[ui_globals::curimage_view].path));
// iterate over path and add path for zipped formats
while (path.next(curpath))
{
path_iterator path_iter(arts_info[mewui_globals::curimage_view].addpath);
path_iterator path_iter(arts_info[ui_globals::curimage_view].addpath);
std::string c_path;
while (path_iter.next(c_path))
searchstr.append(";").append(curpath).append(PATH_SEPARATOR).append(c_path);
@ -1664,10 +1664,10 @@ void ui_menu::handle_main_keys(UINT32 flags)
validate_selection(1);
// swallow left/right keys if they are not appropriate
bool ignoreleft = ((item[selected].flags & MENU_FLAG_LEFT_ARROW) == 0 || mewui_globals::panels_status == HIDE_BOTH || mewui_globals::panels_status == HIDE_RIGHT_PANEL);
bool ignoreright = ((item[selected].flags & MENU_FLAG_RIGHT_ARROW) == 0 || mewui_globals::panels_status == HIDE_BOTH || mewui_globals::panels_status == HIDE_RIGHT_PANEL);
bool ignoreup = (mewui_globals::panels_status == HIDE_BOTH || mewui_globals::panels_status == HIDE_LEFT_PANEL);
bool ignoredown = (mewui_globals::panels_status == HIDE_BOTH || mewui_globals::panels_status == HIDE_LEFT_PANEL);
bool ignoreleft = ((item[selected].flags & MENU_FLAG_LEFT_ARROW) == 0 || ui_globals::panels_status == HIDE_BOTH || ui_globals::panels_status == HIDE_RIGHT_PANEL);
bool ignoreright = ((item[selected].flags & MENU_FLAG_RIGHT_ARROW) == 0 || ui_globals::panels_status == HIDE_BOTH || ui_globals::panels_status == HIDE_RIGHT_PANEL);
bool ignoreup = (ui_globals::panels_status == HIDE_BOTH || ui_globals::panels_status == HIDE_LEFT_PANEL);
bool ignoredown = (ui_globals::panels_status == HIDE_BOTH || ui_globals::panels_status == HIDE_LEFT_PANEL);
input_manager &minput = machine().input();
// accept left/right keys as-is with repeat
@ -1893,25 +1893,25 @@ void ui_menu::handle_main_events(UINT32 flags)
topline_datsview -= right_visible_lines - 1;
else if (hover == HOVER_LPANEL_ARROW)
{
if (mewui_globals::panels_status == HIDE_LEFT_PANEL)
mewui_globals::panels_status = SHOW_PANELS;
else if (mewui_globals::panels_status == HIDE_BOTH)
mewui_globals::panels_status = HIDE_RIGHT_PANEL;
else if (mewui_globals::panels_status == SHOW_PANELS)
mewui_globals::panels_status = HIDE_LEFT_PANEL;
else if (mewui_globals::panels_status == HIDE_RIGHT_PANEL)
mewui_globals::panels_status = HIDE_BOTH;
if (ui_globals::panels_status == HIDE_LEFT_PANEL)
ui_globals::panels_status = SHOW_PANELS;
else if (ui_globals::panels_status == HIDE_BOTH)
ui_globals::panels_status = HIDE_RIGHT_PANEL;
else if (ui_globals::panels_status == SHOW_PANELS)
ui_globals::panels_status = HIDE_LEFT_PANEL;
else if (ui_globals::panels_status == HIDE_RIGHT_PANEL)
ui_globals::panels_status = HIDE_BOTH;
}
else if (hover == HOVER_RPANEL_ARROW)
{
if (mewui_globals::panels_status == HIDE_RIGHT_PANEL)
mewui_globals::panels_status = SHOW_PANELS;
else if (mewui_globals::panels_status == HIDE_BOTH)
mewui_globals::panels_status = HIDE_LEFT_PANEL;
else if (mewui_globals::panels_status == SHOW_PANELS)
mewui_globals::panels_status = HIDE_RIGHT_PANEL;
else if (mewui_globals::panels_status == HIDE_LEFT_PANEL)
mewui_globals::panels_status = HIDE_BOTH;
if (ui_globals::panels_status == HIDE_RIGHT_PANEL)
ui_globals::panels_status = SHOW_PANELS;
else if (ui_globals::panels_status == HIDE_BOTH)
ui_globals::panels_status = HIDE_LEFT_PANEL;
else if (ui_globals::panels_status == SHOW_PANELS)
ui_globals::panels_status = HIDE_RIGHT_PANEL;
else if (ui_globals::panels_status == HIDE_LEFT_PANEL)
ui_globals::panels_status = HIDE_BOTH;
}
else if (hover == HOVER_B_FAV)
{
@ -1958,7 +1958,7 @@ void ui_menu::handle_main_events(UINT32 flags)
}
else if (hover >= HOVER_RP_FIRST && hover <= HOVER_RP_LAST)
{
mewui_globals::rpanel = (HOVER_RP_FIRST - hover) * (-1);
ui_globals::rpanel = (HOVER_RP_FIRST - hover) * (-1);
stop = true;
}
else if (hover >= HOVER_SW_FILTER_FIRST && hover <= HOVER_SW_FILTER_LAST)
@ -2116,7 +2116,7 @@ float ui_menu::draw_right_box_title(float x1, float y1, float x2, float y2)
if (mouse_hit && x1 <= mouse_x && x1 + midl > mouse_x && y1 <= mouse_y && y1 + line_height > mouse_y)
{
if (mewui_globals::rpanel != cells)
if (ui_globals::rpanel != cells)
{
bgcolor = UI_MOUSEOVER_BG_COLOR;
fgcolor = UI_MOUSEOVER_COLOR;
@ -2124,7 +2124,7 @@ float ui_menu::draw_right_box_title(float x1, float y1, float x2, float y2)
}
}
if (mewui_globals::rpanel != cells)
if (ui_globals::rpanel != cells)
{
container->add_line(x1, y1 + line_height, x1 + midl, y1 + line_height, UI_LINE_WIDTH,
UI_BORDER_COLOR, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
@ -2168,7 +2168,7 @@ std::string ui_menu::arts_render_common(float origx1, float origy1, float origx2
machine().ui().draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
draw_common_arrow(origx1, origy1, origx2, origy2, mewui_globals::curimage_view, FIRST_VIEW, LAST_VIEW, title_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curimage_view, FIRST_VIEW, LAST_VIEW, title_size);
return searchstr;
}
@ -2272,7 +2272,7 @@ void ui_menu::arts_render_images(bitmap_argb32 *tmp_bitmap, float origx1, float
int dest_yPixel = tmp_bitmap->height();
// force 4:3 ratio min
if (machine().options().forced_4x3_snapshot() && ratioI < 0.75f && mewui_globals::curimage_view == SNAPSHOT_VIEW)
if (machine().options().forced_4x3_snapshot() && ratioI < 0.75f && ui_globals::curimage_view == SNAPSHOT_VIEW)
{
// smaller ratio will ensure that the image fits in the view
dest_yPixel = tmp_bitmap->width() * 0.75f;
@ -2387,7 +2387,7 @@ void ui_menu::draw_icon(int linenum, void *selectedref, float x0, float y0)
if (driver == nullptr)
return;
if (olddriver[linenum] != driver || mewui_globals::redraw_icon)
if (olddriver[linenum] != driver || ui_globals::redraw_icon)
{
olddriver[linenum] = driver;

View File

@ -587,7 +587,7 @@ ui_menu_misc_options::~ui_menu_misc_options()
std::string error_string;
for (int d = 1; d < ARRAY_LENGTH(m_options); ++d)
machine().options().set_value(m_options[d].option, m_options[d].status, OPTION_PRIORITY_CMDLINE, error_string);
mewui_globals::reset = true;
ui_globals::reset = true;
}
//-------------------------------------------------
@ -607,7 +607,7 @@ void ui_menu_misc_options::handle()
changed = true;
int value = (FPTR)m_event->itemref;
if (!strcmp(m_options[value].option, OPTION_ENLARGE_SNAPS))
mewui_globals::switch_image = true;
ui_globals::switch_image = true;
m_options[value].status = !m_options[value].status;
}
}

View File

@ -16,7 +16,7 @@
// MEWUI EXTRA OPTIONS
//**************************************************************************
const options_entry mewui_options::s_option_entries[] =
const options_entry ui_options::s_option_entries[] =
{
// seach path options
{ nullptr, nullptr, OPTION_HEADER, "MEWUI SEARCH PATH OPTIONS" },
@ -79,11 +79,11 @@ const options_entry mewui_options::s_option_entries[] =
};
//-------------------------------------------------
// mewui_options - constructor
// ui_options - constructor
//-------------------------------------------------
mewui_options::mewui_options()
ui_options::ui_options()
: core_options()
{
add_entries(mewui_options::s_option_entries);
add_entries(ui_options::s_option_entries);
}

View File

@ -71,11 +71,11 @@
#define OPTION_UI_DIPSW_COLOR "ui_dipsw_color"
#define OPTION_UI_SLIDER_COLOR "ui_slider_color"
class mewui_options : public core_options
class ui_options : public core_options
{
public:
// construction/destruction
mewui_options();
ui_options();
// Search path options
const char *history_path() const { return value(OPTION_HISTORY_PATH); }

View File

@ -40,7 +40,7 @@ ui_menu_game_options::~ui_menu_game_options()
{
ui_menu::menu_stack->reset(UI_MENU_RESET_SELECT_FIRST);
save_game_options(machine());
mewui_globals::switch_image = true;
ui_globals::switch_image = true;
}
//-------------------------------------------------

View File

@ -78,7 +78,7 @@ void ui_menu_selector::handle()
break;
}
mewui_globals::switch_image = true;
ui_globals::switch_image = true;
ui_menu::stack_pop(machine());
}
else if (m_event->iptkey == IPT_SPECIAL)

View File

@ -169,12 +169,12 @@ ui_menu_select_game::ui_menu_select_game(running_machine &machine, render_contai
moptions.set_value(OPTION_SNAPNAME, "%g/%i", OPTION_PRIORITY_CMDLINE, error_string);
moptions.set_value(OPTION_SOFTWARENAME, "", OPTION_PRIORITY_CMDLINE, error_string);
mewui_globals::curimage_view = FIRST_VIEW;
mewui_globals::curdats_view = MEWUI_FIRST_LOAD;
mewui_globals::switch_image = false;
mewui_globals::default_image = true;
ui_globals::curimage_view = FIRST_VIEW;
ui_globals::curdats_view = MEWUI_FIRST_LOAD;
ui_globals::switch_image = false;
ui_globals::default_image = true;
ume_filters::actual = moptions.start_filter();
mewui_globals::panels_status = moptions.hide_panels();
ui_globals::panels_status = moptions.hide_panels();
}
//-------------------------------------------------
@ -209,7 +209,7 @@ ui_menu_select_game::~ui_menu_select_game()
mopt.set_value(OPTION_START_FILTER, ume_filters::actual, OPTION_PRIORITY_CMDLINE, error_string);
mopt.set_value(OPTION_LAST_USED_FILTER, filter.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
mopt.set_value(OPTION_LAST_USED_MACHINE, last_driver.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
mopt.set_value(OPTION_HIDE_PANELS, mewui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string);
mopt.set_value(OPTION_HIDE_PANELS, ui_globals::panels_status, OPTION_PRIORITY_CMDLINE, error_string);
save_game_options(machine());
}
@ -223,9 +223,9 @@ void ui_menu_select_game::handle()
bool enabled_dats = machine().options().enabled_dats();
// if i have to load datfile, performe an hard reset
if (mewui_globals::reset)
if (ui_globals::reset)
{
mewui_globals::reset = false;
ui_globals::reset = false;
machine().schedule_hard_reset();
ui_menu::stack_reset(machine());
return;
@ -263,17 +263,17 @@ void ui_menu_select_game::handle()
else if (m_event->iptkey == IPT_UI_LEFT)
{
// Images
if (mewui_globals::rpanel == RP_IMAGES && mewui_globals::curimage_view > FIRST_VIEW)
if (ui_globals::rpanel == RP_IMAGES && ui_globals::curimage_view > FIRST_VIEW)
{
mewui_globals::curimage_view--;
mewui_globals::switch_image = true;
mewui_globals::default_image = false;
ui_globals::curimage_view--;
ui_globals::switch_image = true;
ui_globals::default_image = false;
}
// Infos
else if (mewui_globals::rpanel == RP_INFOS && mewui_globals::curdats_view > MEWUI_FIRST_LOAD)
else if (ui_globals::rpanel == RP_INFOS && ui_globals::curdats_view > MEWUI_FIRST_LOAD)
{
mewui_globals::curdats_view--;
ui_globals::curdats_view--;
topline_datsview = 0;
}
}
@ -282,17 +282,17 @@ void ui_menu_select_game::handle()
else if (m_event->iptkey == IPT_UI_RIGHT)
{
// Images
if (mewui_globals::rpanel == RP_IMAGES && mewui_globals::curimage_view < LAST_VIEW)
if (ui_globals::rpanel == RP_IMAGES && ui_globals::curimage_view < LAST_VIEW)
{
mewui_globals::curimage_view++;
mewui_globals::switch_image = true;
mewui_globals::default_image = false;
ui_globals::curimage_view++;
ui_globals::switch_image = true;
ui_globals::default_image = false;
}
// Infos
else if (mewui_globals::rpanel == RP_INFOS && mewui_globals::curdats_view < MEWUI_LAST_LOAD)
else if (ui_globals::rpanel == RP_INFOS && ui_globals::curdats_view < MEWUI_LAST_LOAD)
{
mewui_globals::curdats_view++;
ui_globals::curdats_view++;
topline_datsview = 0;
}
}
@ -313,11 +313,11 @@ void ui_menu_select_game::handle()
// handle UI_LEFT_PANEL
else if (m_event->iptkey == IPT_UI_LEFT_PANEL)
mewui_globals::rpanel = RP_IMAGES;
ui_globals::rpanel = RP_IMAGES;
// handle UI_RIGHT_PANEL
else if (m_event->iptkey == IPT_UI_RIGHT_PANEL)
mewui_globals::rpanel = RP_INFOS;
ui_globals::rpanel = RP_INFOS;
// escape pressed with non-empty text clears the text
else if (m_event->iptkey == IPT_UI_CANCEL && m_search[0] != 0)
@ -547,8 +547,8 @@ void ui_menu_select_game::handle()
void ui_menu_select_game::populate()
{
mewui_globals::redraw_icon = true;
mewui_globals::switch_image = true;
ui_globals::redraw_icon = true;
ui_globals::switch_image = true;
int old_item_selected = -1;
if (main_filters::actual != FILTER_FAVORITE_GAME)
@ -668,10 +668,10 @@ void ui_menu_select_game::populate()
if (old_item_selected != -1)
{
selected = old_item_selected;
if (mewui_globals::visible_main_lines == 0)
if (ui_globals::visible_main_lines == 0)
top_line = (selected != 0) ? selected - 1 : 0;
else
top_line = selected - (mewui_globals::visible_main_lines / 2);
top_line = selected - (ui_globals::visible_main_lines / 2);
if (reselect_last::software.empty())
reselect_last::reset();
@ -1942,7 +1942,7 @@ float ui_menu_select_game::draw_left_panel(float x1, float y1, float x2, float y
ui_manager &mui = machine().ui();
float line_height = mui.get_line_height();
if (mewui_globals::panels_status == SHOW_PANELS || mewui_globals::panels_status == HIDE_RIGHT_PANEL)
if (ui_globals::panels_status == SHOW_PANELS || ui_globals::panels_status == HIDE_RIGHT_PANEL)
{
float origy1 = y1;
float origy2 = y2;
@ -2131,10 +2131,10 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
float oy1 = origy1 + line_height;
// MAMESCORE? Full size text
if (mewui_globals::curdats_view == MEWUI_STORY_LOAD)
if (ui_globals::curdats_view == MEWUI_STORY_LOAD)
text_size = 1.0f;
std::string snaptext(dats_info[mewui_globals::curdats_view]);
std::string snaptext(dats_info[ui_globals::curdats_view]);
// apply title to right panel
float title_size = 0.0f;
@ -2151,25 +2151,25 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
mui.draw_text_full(container, snaptext.c_str(), origx1, origy1, origx2 - origx1, JUSTIFY_CENTER,
WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
draw_common_arrow(origx1, origy1, origx2, origy2, mewui_globals::curdats_view, MEWUI_FIRST_LOAD, MEWUI_LAST_LOAD, title_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::curdats_view, MEWUI_FIRST_LOAD, MEWUI_LAST_LOAD, title_size);
if (driver != olddriver || mewui_globals::curdats_view != oldview)
if (driver != olddriver || ui_globals::curdats_view != oldview)
{
buffer.clear();
olddriver = driver;
oldview = mewui_globals::curdats_view;
oldview = ui_globals::curdats_view;
topline_datsview = 0;
totallines = 0;
std::vector<std::string> m_item;
if (mewui_globals::curdats_view == MEWUI_GENERAL_LOAD)
if (ui_globals::curdats_view == MEWUI_GENERAL_LOAD)
general_info(driver, buffer);
else if (mewui_globals::curdats_view != MEWUI_COMMAND_LOAD)
machine().datfile().load_data_info(driver, buffer, mewui_globals::curdats_view);
else if (ui_globals::curdats_view != MEWUI_COMMAND_LOAD)
machine().datfile().load_data_info(driver, buffer, ui_globals::curdats_view);
else
machine().datfile().command_sub_menu(driver, m_item);
if (!m_item.empty() && mewui_globals::curdats_view == MEWUI_COMMAND_LOAD)
if (!m_item.empty() && ui_globals::curdats_view == MEWUI_COMMAND_LOAD)
{
for (size_t x = 0; x < m_item.size(); ++x)
{
@ -2189,7 +2189,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
WRAP_WORD, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
return;
}
else if (mewui_globals::curdats_view != MEWUI_STORY_LOAD && mewui_globals::curdats_view != MEWUI_COMMAND_LOAD)
else if (ui_globals::curdats_view != MEWUI_STORY_LOAD && ui_globals::curdats_view != MEWUI_COMMAND_LOAD)
mui.wrap_text(container, buffer.c_str(), origx1, origy1, origx2 - origx1 - (2.0f * gutter_width), totallines, xstart, xend, text_size);
else
mui.wrap_text(container, buffer.c_str(), 0.0f, 0.0f, 1.0f - (2.0f * gutter_width), totallines, xstart, xend, text_size);
@ -2215,7 +2215,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
else if (r == r_visible_lines - 1 && itemline != totallines - 1)
info_arrow(1, origx1, origx2, oy1, line_height, text_size, ud_arrow_width);
// special case for mamescore
else if (mewui_globals::curdats_view == MEWUI_STORY_LOAD)
else if (ui_globals::curdats_view == MEWUI_STORY_LOAD)
{
// check size
float textlen = mui.get_string_width_ex(tempbuf.c_str(), text_size);
@ -2245,13 +2245,13 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
}
// special case for command
else if (mewui_globals::curdats_view == MEWUI_COMMAND_LOAD || mewui_globals::curdats_view == MEWUI_GENERAL_LOAD)
else if (ui_globals::curdats_view == MEWUI_COMMAND_LOAD || ui_globals::curdats_view == MEWUI_GENERAL_LOAD)
{
// check size
float textlen = mui.get_string_width_ex(tempbuf.c_str(), text_size);
float tmp_size = (textlen > sc) ? text_size * (sc / textlen) : text_size;
int first_dspace = (mewui_globals::curdats_view == MEWUI_COMMAND_LOAD) ? tempbuf.find(" ") : tempbuf.find(":");
int first_dspace = (ui_globals::curdats_view == MEWUI_COMMAND_LOAD) ? tempbuf.find(" ") : tempbuf.find(":");
if (first_dspace > 0)
{
float effective_width = origx2 - origx1 - gutter_width;
@ -2290,7 +2290,7 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
{
mui.draw_text_full(container, "History", origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
mewui_globals::cur_sw_dats_view = 0;
ui_globals::cur_sw_dats_view = 0;
}
else
{
@ -2308,18 +2308,18 @@ void ui_menu_select_game::infos_render(void *selectedref, float origx1, float or
title_size = MAX(txt_lenght, title_size);
}
mui.draw_text_full(container, t_text[mewui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
mui.draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
draw_common_arrow(origx1, origy1, origx2, origy2, mewui_globals::cur_sw_dats_view, 0, 1, title_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size);
}
if (oldsoft != soft || old_sw_view != mewui_globals::cur_sw_dats_view)
if (oldsoft != soft || old_sw_view != ui_globals::cur_sw_dats_view)
{
buffer.clear();
old_sw_view = mewui_globals::cur_sw_dats_view;
old_sw_view = ui_globals::cur_sw_dats_view;
oldsoft = soft;
if (mewui_globals::cur_sw_dats_view == 0)
if (ui_globals::cur_sw_dats_view == 0)
{
if (soft->startempty == 1)
machine().datfile().load_data_info(soft->driver, buffer, MEWUI_HISTORY_LOAD);
@ -2375,7 +2375,7 @@ void ui_menu_select_game::draw_right_panel(void *selectedref, float origx1, floa
float line_height = mui.get_line_height();
float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect();
rgb_t fgcolor = UI_TEXT_COLOR;
bool hide = (mewui_globals::panels_status == HIDE_RIGHT_PANEL || mewui_globals::panels_status == HIDE_BOTH);
bool hide = (ui_globals::panels_status == HIDE_RIGHT_PANEL || ui_globals::panels_status == HIDE_BOTH);
float x2 = (hide) ? origx2 : origx1 + 2.0f * UI_BOX_LR_BORDER;
// set left-right arrows dimension
@ -2403,7 +2403,7 @@ void ui_menu_select_game::draw_right_panel(void *selectedref, float origx1, floa
origx1 = x2;
origy1 = draw_right_box_title(origx1, origy1, origx2, origy2);
if (mewui_globals::rpanel == RP_IMAGES)
if (ui_globals::rpanel == RP_IMAGES)
arts_render(selectedref, origx1, origy1, origx2, origy2);
else
infos_render(selectedref, origx1, origy1, origx2, origy2);
@ -2442,14 +2442,14 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
if (driver)
{
if (mewui_globals::default_image)
((driver->flags & MACHINE_TYPE_ARCADE) == 0) ? mewui_globals::curimage_view = CABINETS_VIEW : mewui_globals::curimage_view = SNAPSHOT_VIEW;
if (ui_globals::default_image)
((driver->flags & MACHINE_TYPE_ARCADE) == 0) ? ui_globals::curimage_view = CABINETS_VIEW : ui_globals::curimage_view = SNAPSHOT_VIEW;
std::string searchstr;
searchstr = arts_render_common(origx1, origy1, origx2, origy2);
// loads the image if necessary
if (driver != olddriver || !snapx_bitmap->valid() || mewui_globals::switch_image)
if (driver != olddriver || !snapx_bitmap->valid() || ui_globals::switch_image)
{
emu_file snapfile(searchstr.c_str(), OPEN_FLAG_READ);
bitmap_argb32 *tmp_bitmap;
@ -2501,7 +2501,7 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
}
olddriver = driver;
mewui_globals::switch_image = false;
ui_globals::switch_image = false;
arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2, false);
auto_free(machine(), tmp_bitmap);
}
@ -2522,15 +2522,15 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
{
std::string fullname, pathname;
if (mewui_globals::default_image)
(soft->startempty == 0) ? mewui_globals::curimage_view = SNAPSHOT_VIEW : mewui_globals::curimage_view = CABINETS_VIEW;
if (ui_globals::default_image)
(soft->startempty == 0) ? ui_globals::curimage_view = SNAPSHOT_VIEW : ui_globals::curimage_view = CABINETS_VIEW;
// arts title and searchpath
std::string searchstr;
searchstr = arts_render_common(origx1, origy1, origx2, origy2);
// loads the image if necessary
if (soft != oldsoft || !snapx_bitmap->valid() || mewui_globals::switch_image)
if (soft != oldsoft || !snapx_bitmap->valid() || ui_globals::switch_image)
{
emu_file snapfile(searchstr.c_str(), OPEN_FLAG_READ);
bitmap_argb32 *tmp_bitmap;
@ -2548,7 +2548,7 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
render_load_jpeg(*tmp_bitmap, snapfile, nullptr, fullname.c_str());
}
}
else if (mewui_globals::curimage_view == TITLES_VIEW)
else if (ui_globals::curimage_view == TITLES_VIEW)
{
// First attempt from name list
pathname.assign(soft->listname).append("_titles");
@ -2590,7 +2590,7 @@ void ui_menu_select_game::arts_render(void *selectedref, float origx1, float ori
}
oldsoft = soft;
mewui_globals::switch_image = false;
ui_globals::switch_image = false;
arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2, true);
auto_free(machine(), tmp_bitmap);
}

View File

@ -132,9 +132,9 @@ ui_menu_select_software::ui_menu_select_software(running_machine &machine, rende
build_software_list();
load_sw_custom_filters();
mewui_globals::curimage_view = SNAPSHOT_VIEW;
mewui_globals::switch_image = true;
mewui_globals::cur_sw_dats_view = MEWUI_FIRST_LOAD;
ui_globals::curimage_view = SNAPSHOT_VIEW;
ui_globals::switch_image = true;
ui_globals::cur_sw_dats_view = MEWUI_FIRST_LOAD;
std::string error_string;
machine.options().set_value(OPTION_SOFTWARENAME, "", OPTION_PRIORITY_CMDLINE, error_string);
@ -146,8 +146,8 @@ ui_menu_select_software::ui_menu_select_software(running_machine &machine, rende
ui_menu_select_software::~ui_menu_select_software()
{
mewui_globals::curimage_view = CABINETS_VIEW;
mewui_globals::switch_image = true;
ui_globals::curimage_view = CABINETS_VIEW;
ui_globals::switch_image = true;
}
//-------------------------------------------------
@ -178,17 +178,17 @@ void ui_menu_select_software::handle()
else if (m_event->iptkey == IPT_UI_LEFT)
{
// Images
if (mewui_globals::rpanel == RP_IMAGES && mewui_globals::curimage_view > FIRST_VIEW)
if (ui_globals::rpanel == RP_IMAGES && ui_globals::curimage_view > FIRST_VIEW)
{
mewui_globals::curimage_view--;
mewui_globals::switch_image = true;
mewui_globals::default_image = false;
ui_globals::curimage_view--;
ui_globals::switch_image = true;
ui_globals::default_image = false;
}
// Infos
else if (mewui_globals::rpanel == RP_INFOS && mewui_globals::cur_sw_dats_view > 0)
else if (ui_globals::rpanel == RP_INFOS && ui_globals::cur_sw_dats_view > 0)
{
mewui_globals::cur_sw_dats_view--;
ui_globals::cur_sw_dats_view--;
topline_datsview = 0;
}
}
@ -197,17 +197,17 @@ void ui_menu_select_software::handle()
else if (m_event->iptkey == IPT_UI_RIGHT)
{
// Images
if (mewui_globals::rpanel == RP_IMAGES && mewui_globals::curimage_view < LAST_VIEW)
if (ui_globals::rpanel == RP_IMAGES && ui_globals::curimage_view < LAST_VIEW)
{
mewui_globals::curimage_view++;
mewui_globals::switch_image = true;
mewui_globals::default_image = false;
ui_globals::curimage_view++;
ui_globals::switch_image = true;
ui_globals::default_image = false;
}
// Infos
else if (mewui_globals::rpanel == RP_INFOS && mewui_globals::cur_sw_dats_view < 1)
else if (ui_globals::rpanel == RP_INFOS && ui_globals::cur_sw_dats_view < 1)
{
mewui_globals::cur_sw_dats_view++;
ui_globals::cur_sw_dats_view++;
topline_datsview = 0;
}
}
@ -237,11 +237,11 @@ void ui_menu_select_software::handle()
// handle UI_LEFT_PANEL
else if (m_event->iptkey == IPT_UI_LEFT_PANEL)
mewui_globals::rpanel = RP_IMAGES;
ui_globals::rpanel = RP_IMAGES;
// handle UI_RIGHT_PANEL
else if (m_event->iptkey == IPT_UI_RIGHT_PANEL)
mewui_globals::rpanel = RP_INFOS;
ui_globals::rpanel = RP_INFOS;
// escape pressed with non-empty text clears the text
else if (m_event->iptkey == IPT_UI_CANCEL && m_search[0] != 0)
@ -444,7 +444,7 @@ void ui_menu_select_software::populate()
if (old_software != -1)
{
selected = old_software;
top_line = selected - (mewui_globals::visible_sw_lines / 2);
top_line = selected - (ui_globals::visible_sw_lines / 2);
}
reselect_last::reset();
@ -1258,7 +1258,7 @@ float ui_menu_select_software::draw_left_panel(float x1, float y1, float x2, flo
{
ui_manager &mui = machine().ui();
if (mewui_globals::panels_status == SHOW_PANELS || mewui_globals::panels_status == HIDE_RIGHT_PANEL)
if (ui_globals::panels_status == SHOW_PANELS || ui_globals::panels_status == HIDE_RIGHT_PANEL)
{
float origy1 = y1;
float origy2 = y2;
@ -1431,7 +1431,7 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa
{
mui.draw_text_full(container, "History", origx1, origy1, origx2 - origx1, JUSTIFY_CENTER, WRAP_TRUNCATE,
DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
mewui_globals::cur_sw_dats_view = 0;
ui_globals::cur_sw_dats_view = 0;
}
else
{
@ -1449,19 +1449,19 @@ void ui_menu_select_software::infos_render(void *selectedref, float origx1, floa
title_size = MAX(txt_lenght, title_size);
}
mui.draw_text_full(container, t_text[mewui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
mui.draw_text_full(container, t_text[ui_globals::cur_sw_dats_view].c_str(), origx1, origy1, origx2 - origx1,
JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR,
nullptr, nullptr);
draw_common_arrow(origx1, origy1, origx2, origy2, mewui_globals::cur_sw_dats_view, 0, 1, title_size);
draw_common_arrow(origx1, origy1, origx2, origy2, ui_globals::cur_sw_dats_view, 0, 1, title_size);
}
if (oldsoft != soft || old_sw_view != mewui_globals::cur_sw_dats_view)
if (oldsoft != soft || old_sw_view != ui_globals::cur_sw_dats_view)
{
buffer.clear();
old_sw_view = mewui_globals::cur_sw_dats_view;
old_sw_view = ui_globals::cur_sw_dats_view;
oldsoft = soft;
if (mewui_globals::cur_sw_dats_view == 0)
if (ui_globals::cur_sw_dats_view == 0)
{
if (soft->startempty == 1)
machine().datfile().load_data_info(soft->driver, buffer, MEWUI_HISTORY_LOAD);
@ -1536,14 +1536,14 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
if (driver)
{
if (mewui_globals::default_image)
((driver->flags & MACHINE_TYPE_ARCADE) == 0) ? mewui_globals::curimage_view = CABINETS_VIEW : mewui_globals::curimage_view = SNAPSHOT_VIEW;
if (ui_globals::default_image)
((driver->flags & MACHINE_TYPE_ARCADE) == 0) ? ui_globals::curimage_view = CABINETS_VIEW : ui_globals::curimage_view = SNAPSHOT_VIEW;
std::string searchstr;
searchstr = arts_render_common(origx1, origy1, origx2, origy2);
// loads the image if necessary
if (driver != olddriver || !snapx_bitmap->valid() || mewui_globals::switch_image)
if (driver != olddriver || !snapx_bitmap->valid() || ui_globals::switch_image)
{
emu_file snapfile(searchstr.c_str(), OPEN_FLAG_READ);
bitmap_argb32 *tmp_bitmap;
@ -1595,7 +1595,7 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
}
olddriver = driver;
mewui_globals::switch_image = false;
ui_globals::switch_image = false;
arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2, false);
auto_free(machine(), tmp_bitmap);
}
@ -1615,15 +1615,15 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
else if (soft)
{
std::string fullname, pathname;
if (mewui_globals::default_image)
(soft->startempty == 0) ? mewui_globals::curimage_view = SNAPSHOT_VIEW : mewui_globals::curimage_view = CABINETS_VIEW;
if (ui_globals::default_image)
(soft->startempty == 0) ? ui_globals::curimage_view = SNAPSHOT_VIEW : ui_globals::curimage_view = CABINETS_VIEW;
// arts title and searchpath
std::string searchstr;
searchstr = arts_render_common(origx1, origy1, origx2, origy2);
// loads the image if necessary
if (soft != oldsoft || !snapx_bitmap->valid() || mewui_globals::switch_image)
if (soft != oldsoft || !snapx_bitmap->valid() || ui_globals::switch_image)
{
emu_file snapfile(searchstr.c_str(), OPEN_FLAG_READ);
bitmap_argb32 *tmp_bitmap;
@ -1641,7 +1641,7 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
render_load_jpeg(*tmp_bitmap, snapfile, nullptr, fullname.c_str());
}
}
else if (mewui_globals::curimage_view == TITLES_VIEW)
else if (ui_globals::curimage_view == TITLES_VIEW)
{
// First attempt from name list
pathname.assign(soft->listname).append("_titles");
@ -1683,7 +1683,7 @@ void ui_menu_select_software::arts_render(void *selectedref, float origx1, float
}
oldsoft = soft;
mewui_globals::switch_image = false;
ui_globals::switch_image = false;
arts_render_images(tmp_bitmap, origx1, origy1, origx2, origy2, true);
auto_free(machine(), tmp_bitmap);
}
@ -1708,7 +1708,7 @@ void ui_menu_select_software::draw_right_panel(void *selectedref, float origx1,
float line_height = mui.get_line_height();
float lr_arrow_width = 0.4f * line_height * machine().render().ui_aspect();
rgb_t fgcolor = UI_TEXT_COLOR;
bool hide = (mewui_globals::panels_status == HIDE_RIGHT_PANEL || mewui_globals::panels_status == HIDE_BOTH);
bool hide = (ui_globals::panels_status == HIDE_RIGHT_PANEL || ui_globals::panels_status == HIDE_BOTH);
float x2 = (hide) ? origx2 : origx1 + 2.0f * UI_BOX_LR_BORDER;
// set left-right arrows dimension
@ -1736,7 +1736,7 @@ void ui_menu_select_software::draw_right_panel(void *selectedref, float origx1,
origx1 = x2;
origy1 = draw_right_box_title(origx1, origy1, origx2, origy2);
if (mewui_globals::rpanel == RP_IMAGES)
if (ui_globals::rpanel == RP_IMAGES)
arts_render(selectedref, origx1, origy1, origx2, origy2);
else
infos_render(selectedref, origx1, origy1, origx2, origy2);

View File

@ -13,7 +13,7 @@
#include <algorithm>
extern const char MEWUI_VERSION_TAG[];
const char MEWUI_VERSION_TAG[] = "# MEWUI INFO ";
const char MEWUI_VERSION_TAG[] = "# UI INFO ";
// Years index
UINT16 c_year::actual = 0;
@ -48,17 +48,17 @@ const char *ume_filters::text[] = { "ALL", "ARCADES", "SYSTEMS" };
size_t ume_filters::length = ARRAY_LENGTH(ume_filters::text);
// Globals
UINT8 mewui_globals::rpanel = 0;
UINT8 mewui_globals::curimage_view = 0;
UINT8 mewui_globals::curdats_view = 0;
UINT8 mewui_globals::cur_sw_dats_view = 0;
bool mewui_globals::switch_image = false;
bool mewui_globals::default_image = true;
bool mewui_globals::reset = false;
bool mewui_globals::redraw_icon = false;
int mewui_globals::visible_main_lines = 0;
int mewui_globals::visible_sw_lines = 0;
UINT16 mewui_globals::panels_status = 0;
UINT8 ui_globals::rpanel = 0;
UINT8 ui_globals::curimage_view = 0;
UINT8 ui_globals::curdats_view = 0;
UINT8 ui_globals::cur_sw_dats_view = 0;
bool ui_globals::switch_image = false;
bool ui_globals::default_image = true;
bool ui_globals::reset = false;
bool ui_globals::redraw_icon = false;
int ui_globals::visible_main_lines = 0;
int ui_globals::visible_sw_lines = 0;
UINT16 ui_globals::panels_status = 0;
// Custom filter
UINT16 custfltr::main = 0;

View File

@ -223,7 +223,7 @@ struct c_year
};
// GLOBAL CLASS
struct mewui_globals
struct ui_globals
{
static UINT8 curimage_view, curdats_view, cur_sw_dats_view, rpanel;
static bool switch_image, redraw_icon, default_image, reset;