diff options
author | hwc487 | 2012-04-19 13:01:43 -0700 |
---|---|---|
committer | hwc487 | 2012-04-19 13:01:43 -0700 |
commit | e6a20fe64574763483dc602bd759278ccf5e5e68 (patch) | |
tree | 69defe7200206f0257fe90697136fadef59d521e /js/helper-classes/RDGE/src/core/script/util/fpsTracker.js | |
parent | ae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff) | |
parent | 9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff) | |
download | ninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts:
js/lib/drawing/world.js
js/lib/geom/geom-obj.js
js/lib/rdge/materials/cloud-material.js
js/lib/rdge/materials/deform-material.js
js/lib/rdge/materials/flat-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/relief-tunnel-material.js
js/lib/rdge/materials/square-tunnel-material.js
js/lib/rdge/materials/star-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/tunnel-material.js
js/lib/rdge/materials/twist-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/uber-material.js
js/lib/rdge/materials/water-material.js
js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/util/fpsTracker.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/util/fpsTracker.js | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/util/fpsTracker.js b/js/helper-classes/RDGE/src/core/script/util/fpsTracker.js deleted file mode 100755 index 0b6cdd84..00000000 --- a/js/helper-classes/RDGE/src/core/script/util/fpsTracker.js +++ /dev/null | |||
@@ -1,51 +0,0 @@ | |||
1 | /* <copyright> | ||
2 | This file contains proprietary software owned by Motorola Mobility, Inc.<br/> | ||
3 | No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/> | ||
4 | (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. | ||
5 | </copyright> */ | ||
6 | |||
7 | fpsTracker = function (id) { | ||
8 | this.id = id; | ||
9 | this.fpsRaw = new stat(id + "_fps", "raw", 0, null, false); | ||
10 | this.fpsAvg = new stat(id + "_fps", "avg", 0, null, false); | ||
11 | this.fpsMin = new stat(id + "_fps", "min", 0, null, false); | ||
12 | this.fpsMax = new stat(id + "_fps", "max", 0, null, false); | ||
13 | this.samples = []; | ||
14 | this.maxSamples = 10; | ||
15 | this.timeStampMS = 0.0; | ||
16 | this.reportInterval = 500; | ||
17 | |||
18 | this.close = function() { | ||
19 | stat.pages[id + "_fps"] = null; | ||
20 | } | ||
21 | |||
22 | this.sample = function() { | ||
23 | var currMS = new Date().getTime(); | ||
24 | this.samples.push(currMS - this.timeStampMS); | ||
25 | if (this.samples.length > this.maxSamples) { | ||
26 | this.samples.shift(); | ||
27 | } | ||
28 | this.timeStampMS = currMS; | ||
29 | var accum = 0.0; | ||
30 | var fmin = -1e10; | ||
31 | var fmax = 1e10; | ||
32 | var i = this.samples.length - 1; | ||
33 | while (i >= 0) { | ||
34 | accum += this.samples[i]; | ||
35 | fmin = Math.max(fmin, this.samples[i]); | ||
36 | fmax = Math.min(fmax, this.samples[i]); | ||
37 | i--; | ||
38 | } | ||
39 | var denom = this.samples.length > 0 ? accum / this.samples.length : 0; | ||
40 | var avgFPS = denom > 0 ? 1000 / denom : 0; | ||
41 | var minFPS = fmin > 0 ? 1000 / fmin : 0; | ||
42 | var maxFPS = fmax > 0 ? 1000 / fmax : 0; | ||
43 | var lastSample = this.samples[this.samples.length - 1]; | ||
44 | var rawFPS = (lastSample > 0) ? 1000 / lastSample : 0; | ||
45 | |||
46 | this.fpsRaw.value = rawFPS.toFixed(2); | ||
47 | this.fpsAvg.value = avgFPS.toFixed(2); | ||
48 | this.fpsMin.value = minFPS.toFixed(2); | ||
49 | this.fpsMax.value = maxFPS.toFixed(2); | ||
50 | } | ||
51 | } \ No newline at end of file | ||