summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/ui')
-rw-r--r--src/emu/ui/ui.cpp26
-rw-r--r--src/emu/ui/ui.h6
2 files changed, 32 insertions, 0 deletions
diff --git a/src/emu/ui/ui.cpp b/src/emu/ui/ui.cpp
index 6d996ac50a0..860da34e212 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())
{
diff --git a/src/emu/ui/ui.h b/src/emu/ui/ui.h
index 5a07a0800b5..3da9bfb1bab 100644
--- a/src/emu/ui/ui.h
+++ b/src/emu/ui/ui.h
@@ -171,6 +171,10 @@ public:
// other
void process_natural_keyboard();
+ void set_show_timecode_counter(bool value) { m_show_timecode_counter = value; m_show_timecode_total = true; }
+ bool show_timecode_counter();
+ bool show_timecode_total();
+
// word wrap
void wrap_text(render_container *container, const char *origs, float x, float y, float origwrapwidth, int &totallines, std::vector<int> &xstart, std::vector<int> &xend, float text_size = 1.0f);
@@ -195,6 +199,8 @@ private:
std::unique_ptr<UINT8[]> m_non_char_keys_down;
render_texture * m_mouse_arrow_texture;
bool m_mouse_show;
+ bool m_show_timecode_counter;
+ bool m_show_timecode_total;
bool m_load_save_hold;
ui_options m_ui_options;