summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui/selsoft.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui/selsoft.h')
-rw-r--r--src/frontend/mame/ui/selsoft.h38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/frontend/mame/ui/selsoft.h b/src/frontend/mame/ui/selsoft.h
index e65a5ddc61f..1becf695841 100644
--- a/src/frontend/mame/ui/selsoft.h
+++ b/src/frontend/mame/ui/selsoft.h
@@ -1,5 +1,5 @@
// license:BSD-3-Clause
-// copyright-holders:Maurizio Petrarota
+// copyright-holders:Maurizio Petrarota, Vas Crabb
/***************************************************************************
ui/selsoft.h
@@ -22,25 +22,19 @@ namespace ui {
class menu_select_software : public menu_select_launch
{
public:
- menu_select_software(mame_ui_manager &mui, render_container &container, const game_driver *driver);
+ menu_select_software(mame_ui_manager &mui, render_container &container, game_driver const &driver);
virtual ~menu_select_software() override;
private:
- enum { VISIBLE_GAMES_IN_SEARCH = 200 };
-
- typedef std::map<software_filter::type, software_filter::ptr> filter_map;
-
- const game_driver *m_driver;
- bool m_has_empty_start;
- software_filter_data m_filter_data;
- filter_map m_filters;
- software_filter::type m_filter_type;
+ using filter_map = std::map<software_filter::type, software_filter::ptr>;
+ using icon_cache = texture_lru<ui_software_info const *>;
virtual void populate(float &customtop, float &custombottom) override;
virtual void handle() override;
- // draw left panel
+ // drawing
virtual float draw_left_panel(float x1, float y1, float x2, float y2) override;
+ virtual render_texture *get_icon_texture(int linenum, void *selectedref) override;
// get selected software and/or driver
virtual void get_selection(ui_software_info const *&software, game_driver const *&driver) const override;
@@ -56,10 +50,6 @@ private:
// toolbar
virtual void inkey_export() override { throw false; }
- ui_software_info *m_searchlist[VISIBLE_GAMES_IN_SEARCH + 1];
- std::vector<ui_software_info *> m_displaylist, m_tmp, m_sortedlist;
- std::vector<ui_software_info> m_swinfo;
-
void build_software_list();
void find_matches(const char *str, int count);
void load_sw_custom_filters();
@@ -67,9 +57,21 @@ private:
// handlers
void inkey_select(const event *menu_event);
- virtual void general_info(const game_driver *driver, std::string &buffer) override {}
+ virtual void general_info(const game_driver *driver, std::string &buffer) override { }
+
+ std::map<std::string, std::string> m_icon_paths;
+ icon_cache m_icons;
+ game_driver const &m_driver;
+ bool m_has_empty_start;
+ software_filter_data m_filter_data;
+ filter_map m_filters;
+ software_filter::type m_filter_type;
+
+ std::vector<ui_software_info> m_swinfo;
+ ui_software_info const *m_searchlist[MAX_VISIBLE_SEARCH + 1];
+ std::vector<std::reference_wrapper<ui_software_info const> > m_displaylist;
};
} // namespace ui
-#endif /* MAME_FRONTEND_UI_SELSOFT_H */
+#endif // MAME_FRONTEND_UI_SELSOFT_H