diff options
author | 2016-02-08 18:46:35 +0100 | |
---|---|---|
committer | 2016-02-08 18:46:35 +0100 | |
commit | b051abab1fd969f371f43dd966163c1d0b6fa70f (patch) | |
tree | 5e3fcc2bf57ff4bf8f199d5b027eff228bddbc1e /src/emu/ui/ui.cpp | |
parent | a880c4fce7948e9c5fbb9d53c4858f50cb8dd493 (diff) | |
parent | f736cd5abcea21c8b2c8c4f2d2909952856ac22d (diff) |
Merge pull request #610 from motoschifo/master
Videosnaps patch (additional file to write: gamename.inp.timecode) [Michele Fochi]
Diffstat (limited to 'src/emu/ui/ui.cpp')
-rw-r--r-- | src/emu/ui/ui.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp index 013f1c5c4bb..c92e700b433 100644 --- a/src/emu/ui/ui.cpp +++ b/src/emu/ui/ui.cpp @@ -286,6 +286,8 @@ void ui_manager::init() m_popup_text_end = 0; m_use_natural_keyboard = false; m_mouse_arrow_texture = nullptr; + m_show_timecode_counter = false; + m_show_timecode_total = false; m_load_save_hold = false; get_font_rows(&machine()); @@ -1035,6 +1037,16 @@ bool ui_manager::is_menu_active(void) } +bool ui_manager::show_timecode_counter() +{ + return m_show_timecode_counter; +} +bool ui_manager::show_timecode_total() +{ + return m_show_timecode_total; +} + + /*************************************************************************** TEXT GENERATORS @@ -1559,6 +1571,20 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, nullptr, nullptr); } + // Show the duration of current part (intro or gameplay or extra) + if (machine.ui().show_timecode_counter()) { + std::string tempstring; + machine.ui().draw_text_full(container, machine.video().timecode_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f, + JUSTIFY_RIGHT, WRAP_WORD, DRAW_OPAQUE, rgb_t(0xf0,0xf0,0x10,0x10), ARGB_BLACK, NULL, NULL); + } + // Show the total time elapsed for the video preview (all parts intro, gameplay, extras) + if (machine.ui().show_timecode_total()) { + std::string tempstring; + machine.ui().draw_text_full(container, machine.video().timecode_total_text(tempstring).c_str(), 0.0f, 0.0f, 1.0f, + JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, rgb_t(0xf0,0x10,0xf0,0x10), ARGB_BLACK, NULL, NULL); + } + + // draw the profiler if visible if (machine.ui().show_profiler()) { @@ -1622,6 +1648,10 @@ UINT32 ui_manager::handler_ingame(running_machine &machine, render_container *co machine.ui().image_handler_ingame(); + // handle a save input timecode request + if (machine.ui_input().pressed(IPT_UI_TIMECODE)) + machine.video().save_input_timecode(); + if (ui_disabled) return ui_disabled; if (machine.ui_input().pressed(IPT_UI_CANCEL)) |