diff options
author | 2016-06-19 18:07:05 -0400 | |
---|---|---|
committer | 2016-06-23 06:40:21 -0400 | |
commit | c96215487573733e7250e76524b95de43e8bef8e (patch) | |
tree | 1fc6079f44d10f108bc05ba078b060103fec9269 /src | |
parent | f63148b735f7c8978da124b83cb4bba9261d009d (diff) |
Put the code that launches a save/load state into methods
Diffstat (limited to 'src')
-rw-r--r-- | src/frontend/mame/ui/ui.cpp | 32 | ||||
-rw-r--r-- | src/frontend/mame/ui/ui.h | 2 |
2 files changed, 28 insertions, 6 deletions
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp index 24d7b61fd2e..df941f3ceb7 100644 --- a/src/frontend/mame/ui/ui.cpp +++ b/src/frontend/mame/ui/ui.cpp @@ -1210,6 +1210,30 @@ void mame_ui_manager::draw_profiler(render_container *container) //------------------------------------------------- +// start_save_state +//------------------------------------------------- + +void mame_ui_manager::start_save_state() +{ + machine().pause(); + m_load_save_hold = true; + set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_SAVE); +} + + +//------------------------------------------------- +// start_load_state +//------------------------------------------------- + +void mame_ui_manager::start_load_state() +{ + machine().pause(); + m_load_save_hold = true; + set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_LOAD); +} + + +//------------------------------------------------- // image_handler_ingame - execute display // callback function for each image device //------------------------------------------------- @@ -1386,18 +1410,14 @@ UINT32 mame_ui_manager::handler_ingame(render_container *container) // handle a save state request if (machine().ui_input().pressed(IPT_UI_SAVE_STATE)) { - machine().pause(); - m_load_save_hold = true; - set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_SAVE); + start_save_state(); return LOADSAVE_SAVE; } // handle a load state request if (machine().ui_input().pressed(IPT_UI_LOAD_STATE)) { - machine().pause(); - m_load_save_hold = true; - set_handler(UI_CALLBACK_TYPE_GENERAL, &mame_ui_manager::handler_load_save, (UINT32)LOADSAVE_LOAD); + start_load_state(); return LOADSAVE_LOAD; } diff --git a/src/frontend/mame/ui/ui.h b/src/frontend/mame/ui/ui.h index 982200d0556..d02e9dd2037 100644 --- a/src/frontend/mame/ui/ui.h +++ b/src/frontend/mame/ui/ui.h @@ -236,6 +236,8 @@ public: void draw_timecode_counter(render_container *container); void draw_timecode_total(render_container *container); void draw_profiler(render_container *container); + void start_save_state(); + void start_load_state(); // print the game info string into a buffer std::string &game_info_astring(std::string &str); |