mirror of
https://github.com/holub/mame
synced 2025-06-24 05:17:04 +03:00
Put the code that launches a save/load state into methods
This commit is contained in:
parent
f63148b735
commit
c962154875
@ -1209,6 +1209,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;
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user