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
David's final changes: more profiler features, fixes.
[ipdf/code.git]
/
src
/
debugscript.cpp
diff --git
a/src/debugscript.cpp
b/src/debugscript.cpp
index
dd6a5df
..
434743d
100644
(file)
--- a/
src/debugscript.cpp
+++ b/
src/debugscript.cpp
@@
-173,14
+173,14
@@
void DebugScript::ParseAction(View * view, Screen * scr)
currentAction.type = AT_ScreenShot;
inp >> currentAction.textargs;
}
currentAction.type = AT_ScreenShot;
inp >> currentAction.textargs;
}
- else if (actionType == "print
fps
")
+ else if (actionType == "print
spf
")
{
{
- currentAction.type = AT_Print
FPS
;
+ currentAction.type = AT_Print
SPF
;
currentAction.iz = currentAction.loops;
currentAction.iz = currentAction.loops;
- m_
fps
_cpu_mean = 0;
- m_
fps
_gpu_mean = 0;
- m_
fps
_cpu_stddev = 0;
- m_
fps
_gpu_stddev = 0;
+ m_
spf
_cpu_mean = 0;
+ m_
spf
_gpu_mean = 0;
+ m_
spf
_cpu_stddev = 0;
+ m_
spf
_gpu_stddev = 0;
}
else if (actionType == "printbounds")
{
}
else if (actionType == "printbounds")
{
@@
-226,16
+226,16
@@
bool DebugScript::Execute(View *view, Screen *scr)
case AT_WaitFrame:
break;
case AT_Translate:
case AT_WaitFrame:
break;
case AT_Translate:
- view->Translate(
currentAction.x, currentAction.y
);
+ view->Translate(
Double(currentAction.x), Double(currentAction.y)
);
break;
case AT_TranslatePx:
view->Translate(Real(currentAction.ix)/Real(scr->ViewportWidth()), Real(currentAction.iy)/Real(scr->ViewportHeight()));
break;
case AT_Zoom:
break;
case AT_TranslatePx:
view->Translate(Real(currentAction.ix)/Real(scr->ViewportWidth()), Real(currentAction.iy)/Real(scr->ViewportHeight()));
break;
case AT_Zoom:
- view->ScaleAroundPoint(
currentAction.x, currentAction.y, currentAction.z
);
+ view->ScaleAroundPoint(
Double(currentAction.x), Double(currentAction.y), Double(currentAction.z)
);
break;
case AT_ZoomPx:
break;
case AT_ZoomPx:
- view->ScaleAroundPoint(Real(currentAction.ix)/Real(scr->ViewportWidth()),Real(currentAction.iy)/Real(scr->ViewportHeight()),
Real(expf(-currentAction.iz/20.f
)));
+ view->ScaleAroundPoint(Real(currentAction.ix)/Real(scr->ViewportWidth()),Real(currentAction.iy)/Real(scr->ViewportHeight()),
exp(Real(-currentAction.iz)/Real(20
)));
break;
case AT_SetGPURendering:
view->SetGPURendering(true);
break;
case AT_SetGPURendering:
view->SetGPURendering(true);
@@
-320,13
+320,13
@@
bool DebugScript::Execute(View *view, Screen *scr)
VReal s = target.w/(view->GetBounds().w);
VReal s = target.w/(view->GetBounds().w);
- if (
Real(s) != 1
)
+ if (
s != VReal(1)
)
{
VReal x0;
VReal y0;
x0 = (view->GetBounds().x - target.x)/((s - VReal(1))*view->GetBounds().w);
y0 = (view->GetBounds().y - target.y)/((s - VReal(1))*view->GetBounds().h);
{
VReal x0;
VReal y0;
x0 = (view->GetBounds().x - target.x)/((s - VReal(1))*view->GetBounds().w);
y0 = (view->GetBounds().y - target.y)/((s - VReal(1))*view->GetBounds().h);
- view->ScaleAroundPoint(
x0, y0, s
);
+ view->ScaleAroundPoint(
Double(x0), Double(y0), Double(s)
);
currentAction.loops++;
}
else
currentAction.loops++;
}
else
@@
-344,13
+344,13
@@
bool DebugScript::Execute(View *view, Screen *scr)
target.w += view->GetBounds().w;
target.h += view->GetBounds().h;
VReal s = target.w/(view->GetBounds().w);
target.w += view->GetBounds().w;
target.h += view->GetBounds().h;
VReal s = target.w/(view->GetBounds().w);
- if (
Real(s) != 1
)
+ if (
s != VReal(1)
)
{
VReal x0;
VReal y0;
x0 = (view->GetBounds().x - target.x)/((s - VReal(1))*view->GetBounds().w);
y0 = (view->GetBounds().y - target.y)/((s - VReal(1))*view->GetBounds().h);
{
VReal x0;
VReal y0;
x0 = (view->GetBounds().x - target.x)/((s - VReal(1))*view->GetBounds().w);
y0 = (view->GetBounds().y - target.y)/((s - VReal(1))*view->GetBounds().h);
- view->ScaleAroundPoint(
x0, y0, s
);
+ view->ScaleAroundPoint(
Double(x0), Double(y0), Double(s)
);
currentAction.loops++;
}
else
currentAction.loops++;
}
else
@@
-379,7
+379,7
@@
bool DebugScript::Execute(View *view, Screen *scr)
currentAction.loops = 1;
break;
}
currentAction.loops = 1;
break;
}
- case AT_Print
FPS
:
+ case AT_Print
SPF
:
{
// Using a (apparently) Soviet trick to calculate the stddev in one pass
// This was my favourite algorithm in my Physics honours project
{
// Using a (apparently) Soviet trick to calculate the stddev in one pass
// This was my favourite algorithm in my Physics honours project
@@
-390,35
+390,35
@@
bool DebugScript::Execute(View *view, Screen *scr)
if (currentAction.loops <= 1)
{
double n = double(currentAction.iz);
if (currentAction.loops <= 1)
{
double n = double(currentAction.iz);
- m_
fps
_cpu_mean /= n;
- m_
fps
_gpu_mean /= n;
+ m_
spf
_cpu_mean /= n;
+ m_
spf
_gpu_mean /= n;
- m_
fps_cpu_stddev = sqrt(m_fps_cpu_stddev / n - m_fps_cpu_mean*m_fps
_cpu_mean);
- m_
fps_gpu_stddev = sqrt(m_fps_gpu_stddev / n - m_fps_gpu_mean*m_fps
_gpu_mean);
+ m_
spf_cpu_stddev = sqrt(m_spf_cpu_stddev / n - m_spf_cpu_mean*m_spf
_cpu_mean);
+ m_
spf_gpu_stddev = sqrt(m_spf_gpu_stddev / n - m_spf_gpu_mean*m_spf
_gpu_mean);
printf("%d\t%f\t%f\t%f\t%f\n", currentAction.iz,
printf("%d\t%f\t%f\t%f\t%f\n", currentAction.iz,
- m_
fps_gpu_mean, m_fps
_gpu_stddev,
- m_
fps_cpu_mean, m_fps
_cpu_stddev);
+ m_
spf_gpu_mean, m_spf
_gpu_stddev,
+ m_
spf_cpu_mean, m_spf
_cpu_stddev);
}
else
{
}
else
{
- double
fps_cpu = 1.0/
scr->GetLastFrameTimeCPU();
- double
fps_gpu = 1.0/
scr->GetLastFrameTimeGPU();
+ double
spf_cpu =
scr->GetLastFrameTimeCPU();
+ double
spf_gpu =
scr->GetLastFrameTimeGPU();
- m_
fps_cpu_mean += fps
_cpu;
- m_
fps_gpu_mean += fps
_gpu;
+ m_
spf_cpu_mean += spf
_cpu;
+ m_
spf_gpu_mean += spf
_gpu;
- m_
fps_cpu_stddev += fps_cpu*fps
_cpu;
- m_
fps_gpu_stddev += fps_gpu*fps
_gpu;
+ m_
spf_cpu_stddev += spf_cpu*spf
_cpu;
+ m_
spf_gpu_stddev += spf_gpu*spf
_gpu;
}
break;
}
case AT_PrintBounds:
{
}
break;
}
case AT_PrintBounds:
{
- 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());
+ printf("%s\t%s\t%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(), Str(Log10(view->GetBounds().w)).c_str(), Str(Log10(view->GetBounds().h)
).c_str());
break;
}
case AT_ProfileDisplay:
break;
}
case AT_ProfileDisplay:
@@
-449,14
+449,15
@@
void DebugScript::PrintPerformance(View * view, Screen * scr)
now.view_bounds = view->GetBounds();
// object_count clock delta_clock x Log10(x) y Log10(y) w Log10(w) Size(w)
now.view_bounds = view->GetBounds();
// object_count clock delta_clock x Log10(x) y Log10(y) w Log10(w) Size(w)
- #ifdef QUADTREE_DISABLED
+
//
#ifdef QUADTREE_DISABLED
printf("%d\t%llu\t%llu\t%s\t%s\t%s\t%s\t%s\t%s\t%u\n",
now.object_count, (long long unsigned)now.clock,
(long long unsigned)(now.clock - m_perf_last.clock),
printf("%d\t%llu\t%llu\t%s\t%s\t%s\t%s\t%s\t%s\t%u\n",
now.object_count, (long long unsigned)now.clock,
(long long unsigned)(now.clock - m_perf_last.clock),
- Str(now.view_bounds.x).c_str(), Str(Log10(Abs(now.view_bounds.x))).c_str(),
+ "", "", "", "", "", "", 0);
+ /*Str(now.view_bounds.x).c_str(), Str(Log10(Abs(now.view_bounds.x))).c_str(),
Str(now.view_bounds.y).c_str(), Str(Log10(Abs(now.view_bounds.y))).c_str(),
Str(now.view_bounds.w).c_str(), Str(Log10(now.view_bounds.w)).c_str(),
Str(now.view_bounds.y).c_str(), Str(Log10(Abs(now.view_bounds.y))).c_str(),
Str(now.view_bounds.w).c_str(), Str(Log10(now.view_bounds.w)).c_str(),
- (unsigned)Size(now.view_bounds.w));
- #endif
+ (unsigned)Size(now.view_bounds.w));
*/
+
//
#endif
m_perf_last = now;
}
m_perf_last = now;
}
UCC
git Repository :: git.ucc.asn.au