mirror of
https://github.com/holub/mame
synced 2025-05-17 11:15:06 +03:00
uimenu: cleanups and fixes (nw)
This commit is contained in:
parent
1347023777
commit
a504f6bb44
@ -1159,10 +1159,10 @@ static void render_editor(DView_edit *editor)
|
||||
menu_main_populate - populate the main menu
|
||||
-------------------------------------------------*/
|
||||
|
||||
class ui_menu_what_the_hell : public ui_menu {
|
||||
class ui_menu_debug : public ui_menu {
|
||||
public:
|
||||
ui_menu_what_the_hell(running_machine &machine, render_container *container) : ui_menu(machine, container) {}
|
||||
virtual ~ui_menu_what_the_hell() {}
|
||||
ui_menu_debug(running_machine &machine, render_container *container) : ui_menu(machine, container) {}
|
||||
virtual ~ui_menu_debug() {}
|
||||
virtual void populate() {}
|
||||
virtual void handle() {}
|
||||
};
|
||||
@ -1175,7 +1175,7 @@ static void CreateMainMenu(running_machine &machine)
|
||||
|
||||
if (menu)
|
||||
auto_free(machine, menu);
|
||||
menu = auto_alloc_clear(machine, ui_menu_what_the_hell(machine, &machine.render().ui_container()));
|
||||
menu = auto_alloc_clear(machine, ui_menu_debug(machine, &machine.render().ui_container()));
|
||||
|
||||
switch (focus_view->type)
|
||||
{
|
||||
|
@ -604,6 +604,8 @@ void ui_menu_input_general::populate()
|
||||
input_item_data *item = (input_item_data *)m_pool_alloc(sizeof(*item));
|
||||
memset(item, 0, sizeof(*item));
|
||||
item->ref = entry;
|
||||
if(pollingitem && pollingref == entry)
|
||||
pollingitem = item;
|
||||
item->seqtype = seqtype;
|
||||
item->seq = input_type_seq(machine(), entry->type, entry->player, seqtype);
|
||||
item->defseq = &entry->defseq[seqtype];
|
||||
@ -676,6 +678,8 @@ void ui_menu_input_specific::populate()
|
||||
memset(item, 0, sizeof(*item));
|
||||
item->ref = field;
|
||||
item->seqtype = seqtype;
|
||||
if(pollingitem && pollingref == field)
|
||||
pollingitem = item;
|
||||
item->seq = input_field_seq(field, seqtype);
|
||||
item->defseq = &get_field_default_seq(field, seqtype);
|
||||
item->sortorder = sortorder + suborder[seqtype];
|
||||
@ -2501,11 +2505,9 @@ void ui_menu_select_game::handle()
|
||||
menu_select_game_populate - populate the game
|
||||
select menu
|
||||
-------------------------------------------------*/
|
||||
driver_enumerator *ui_menu_select_game::drivlist;
|
||||
|
||||
ui_menu_select_game::ui_menu_select_game(running_machine &machine, render_container *container, const char *gamename) : ui_menu(machine, container)
|
||||
{
|
||||
driverlist = (const game_driver **)m_pool_alloc((driver_list::total()+1)*sizeof(const game_driver *));
|
||||
driverlist = global_alloc_array(const game_driver *, driver_list::total()+1);
|
||||
build_driver_list();
|
||||
if(gamename)
|
||||
strcpy(search, gamename);
|
||||
@ -2567,6 +2569,7 @@ void ui_menu_select_game::populate()
|
||||
ui_menu_select_game::~ui_menu_select_game()
|
||||
{
|
||||
global_free(drivlist);
|
||||
global_free(driverlist);
|
||||
}
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
@ -121,10 +121,12 @@ protected:
|
||||
void toggle_none_default(input_seq &selected_seq, input_seq &original_seq, const input_seq &selected_defseq);
|
||||
const input_seq &get_field_default_seq(input_field_config *field, input_seq_type seqtype);
|
||||
|
||||
private:
|
||||
UINT16 last_sortorder;
|
||||
protected:
|
||||
const void * pollingref;
|
||||
input_item_data * pollingitem;
|
||||
|
||||
private:
|
||||
UINT16 last_sortorder;
|
||||
bool record_next;
|
||||
input_seq starting_seq;
|
||||
|
||||
@ -355,8 +357,7 @@ private:
|
||||
int matchlist[VISIBLE_GAMES_IN_LIST];
|
||||
const game_driver **driverlist;
|
||||
|
||||
// Still a hack, but a vaguely clearner one
|
||||
static driver_enumerator *drivlist;
|
||||
driver_enumerator *drivlist;
|
||||
|
||||
void build_driver_list();
|
||||
};
|
||||
|
@ -261,7 +261,7 @@ void ui_menu::item_append(const char *text, const char *subtext, UINT32 flags, v
|
||||
item[index + 1] = item[index];
|
||||
}
|
||||
|
||||
/* allocate a new item and populte it */
|
||||
/* allocate a new item and populate it */
|
||||
pitem = &item[index];
|
||||
pitem->text = (text != NULL) ? pool_strdup(text) : NULL;
|
||||
pitem->subtext = (subtext != NULL) ? pool_strdup(subtext) : NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user