diff options
author | 2010-08-21 22:25:58 +0000 | |
---|---|---|
committer | 2010-08-21 22:25:58 +0000 | |
commit | a2f7346d9099da6582b42bc912a2436d8e9c6f44 (patch) | |
tree | a4aec5d15135079bcad4484386e389a7080da494 /src/emu/ui.c | |
parent | e8d644d285d743a93b2442d4c2f9b568a38a4715 (diff) |
I had originally wanted to convert the profiler to use scopes (e.g.,
create a stack class that started the profiler in the constructor
and stopped it in the destructor). Sadly, doing that causes gcc to
call out to hook up the unwind chain, and this tanks performance
quite badly, even when the profiler is off.
Since I had already class-ified profiler.c, I decided to keep the old
way of doing things but wrap it in the newer classes. So at least it
wasn't a complete waste of my time.
Search & replace:
profiler_mark_start -> g_profiler.start
profiler_mark_end -> g_profiler.end
Diffstat (limited to 'src/emu/ui.c')
-rw-r--r-- | src/emu/ui.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/emu/ui.c b/src/emu/ui.c index 28b73481c77..db551a63cd5 100644 --- a/src/emu/ui.c +++ b/src/emu/ui.c @@ -822,16 +822,8 @@ int ui_get_show_fps(void) void ui_set_show_profiler(int show) { - if (show) - { - show_profiler = TRUE; - profiler_start(); - } - else - { - show_profiler = FALSE; - profiler_stop(); - } + show_profiler = show; + g_profiler.enable(show); } @@ -1302,7 +1294,7 @@ static UINT32 handler_ingame(running_machine *machine, render_container *contain if (show_profiler) { astring profilertext; - profiler_get_text(machine, profilertext); + g_profiler.text(*machine, profilertext); ui_draw_text_full(container, profilertext, 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_WORD, DRAW_OPAQUE, ARGB_WHITE, ARGB_BLACK, NULL, NULL); } |