git.ucc.asn.au
/
ipdf
/
code.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
profileon/profileoff in debugscript
[ipdf/code.git]
/
src
/
debugscript.cpp
diff --git
a/src/debugscript.cpp
b/src/debugscript.cpp
index
ed10cc3
..
9d78b26
100644
(file)
--- a/
src/debugscript.cpp
+++ b/
src/debugscript.cpp
@@
-1,4
+1,5
@@
#include "debugscript.h"
#include "debugscript.h"
+#include "profiler.h"
#include <string>
#include <string>
@@
-185,6
+186,16
@@
void DebugScript::ParseAction(View * view, Screen * scr)
{
currentAction.type = AT_PrintBounds;
}
{
currentAction.type = AT_PrintBounds;
}
+ else if (actionType == "profileon")
+ {
+ currentAction.type = AT_ProfileDisplay;
+ currentAction.iz = 1;
+ }
+ else if (actionType == "profileoff")
+ {
+ currentAction.type = AT_ProfileDisplay;
+ currentAction.iz = 0;
+ }
else
Fatal("Unknown action %s", actionType.c_str());
else
Fatal("Unknown action %s", actionType.c_str());
@@
-401,6
+412,11
@@
bool DebugScript::Execute(View *view, Screen *scr)
printf("%s\t%s\t%s\t%s\n", Str(view->GetBounds().x).c_str(), Str(view->GetBounds().y).c_str(), Str(view->GetBounds().w).c_str(), Str(view->GetBounds().h).c_str());
break;
}
printf("%s\t%s\t%s\t%s\n", Str(view->GetBounds().x).c_str(), Str(view->GetBounds().y).c_str(), Str(view->GetBounds().w).c_str(), Str(view->GetBounds().h).c_str());
break;
}
+ case AT_ProfileDisplay:
+ {
+ g_profiler.Enable(currentAction.iz);
+ break;
+ }
default:
Fatal("Unknown script command in queue.");
}
default:
Fatal("Unknown script command in queue.");
}
UCC
git Repository :: git.ucc.asn.au