X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fdebugscript.cpp;h=c2cc2efbc962f3b26d82b512f815f0cb069f5b1b;hp=9bb5ea640c69e7f395b20bf6a794345b6c146781;hb=5ef972c655ad9d17ac01e208c3d7bc57a4c10c7c;hpb=326f04a375ce3120f7e8957e3d7cd5f296f513e3 diff --git a/src/debugscript.cpp b/src/debugscript.cpp index 9bb5ea6..c2cc2ef 100644 --- a/src/debugscript.cpp +++ b/src/debugscript.cpp @@ -113,6 +113,12 @@ void DebugScript::ParseAction() { currentAction.type = AT_RecordPerformance; } + else if (actionType == "debugfont") + { + currentAction.type = AT_DebugFont; + inp >> currentAction.textargs; + } + } bool DebugScript::Execute(View *view, Screen *scr) @@ -207,6 +213,10 @@ bool DebugScript::Execute(View *view, Screen *scr) case AT_RecordPerformance: PrintPerformance(view, scr); break; + case AT_DebugFont: + scr->ShowDebugFont(currentAction.textargs == "1" || currentAction.textargs == "on"); + currentAction.loops = 1; + break; default: Fatal("Unknown script command in queue."); } @@ -228,13 +238,14 @@ void DebugScript::PrintPerformance(View * view, Screen * scr) now.clock = clock(); now.object_count = view->Doc().ObjectCount(); now.view_bounds = view->GetBounds(); - // object_count delta clock delta x deltax y deltay w deltaw h deltah - printf("%d\t%d\t%lu\t%lu\t%e\t%e\t%e\t%e\t%e\t%e\t%e\t%e\n", - now.object_count, now.object_count - m_perf_last.object_count, - (uint64_t)now.clock, (uint64_t)(now.clock - m_perf_last.clock), - Double(now.view_bounds.x), Double(now.view_bounds.x - m_perf_last.view_bounds.x), - Double(now.view_bounds.y), Double(now.view_bounds.y - m_perf_last.view_bounds.y), - Double(now.view_bounds.w), Double(now.view_bounds.w - m_perf_last.view_bounds.w), - Double(now.view_bounds.h), Double(now.view_bounds.h - m_perf_last.view_bounds.h)); + + // object_count clock delta_clock x Log10(x) y Log10(y) w Log10(w) Size(w) + printf("%d\t%lu\t%lu\t%s\t%f\t%s\t%f\t%s\t%f\t%lu\n", + now.object_count, (uint64_t)now.clock, + (uint64_t)(now.clock - m_perf_last.clock), + Str(now.view_bounds.x).c_str(), Log10(Abs(now.view_bounds.x)), + Str(now.view_bounds.y).c_str(), Log10(Abs(now.view_bounds.y)), + Str(now.view_bounds.w).c_str(), Log10(now.view_bounds.w), + Size(now.view_bounds.w)); m_perf_last = now; }