Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added a bunch of performance debugging options.

  • Loading branch information...
commit 252410f7b25e5e0e589a142795617e02a03c2ffe 1 parent d09db60
@conorwdickinson conorwdickinson authored
View
4 engine/core/gameframe.js
@@ -32,6 +32,10 @@ var GameFrame = (function() {
css_keyframe: true,
int_snap: true,
transform3d: true,
+ disable_world_elements: false,
+ disable_sprite_anim: false,
+ sprite_url_override: null,
+ sprite_scale: 1.0,
webgl_blended_canvas: false,
webgl_debug: false,
webgl_batch_sprites: false,
View
6 engine/core/gob.js
@@ -23,9 +23,11 @@ var Gob = (function() {
// go looking for non-sprite sheet version
sprite = Sprites.spritedictionary[spriteid+"0"];
}
- if (frame >= sprite.frames)
+ if (frame >= sprite.frames || sprite.no_anim) {
frame = 0;
- gobs[id] = {id: id, spriteid: basesprite, frame: frame, pos: pos, vel: (vel ? vel : vel), theta: (vel ? Math.atan2(vel[1],vel[0]) : 0), scale: (scale ? scale : 1), z: (z ? z : Math.random() * 2000), dirty: true, time: Tick.current, atime: Tick.current, animate: false, discon: true};
+ }
+ scale = (scale || 1.0) * GameFrame.settings.sprite_scale;
+ gobs[id] = {id: id, spriteid: basesprite, frame: frame, pos: pos, vel: vel, theta: (vel ? Math.atan2(vel[1],vel[0]) : 0), scale: scale, z: (z ? z : Math.random() * 2000), dirty: true, time: Tick.current, atime: Tick.current, animate: false, discon: true};
return gobs[id];
}
View
5 engine/core/sprites.js
@@ -48,6 +48,9 @@ var Sprites = (function() {
data.width /= 2;
data.height /= 2;
}
+
+ data.url = GameFrame.settings.sprite_url_override || data.url;
+
if (spritedictionary[id] === undefined) {
if (data.left === undefined) {
data.left = 0;
@@ -57,7 +60,7 @@ var Sprites = (function() {
}
spritedictionary[id] = data;
spritedictionary[id].id = spriteid++;
- spritedictionary[id].no_anim = data.no_anim;
+ spritedictionary[id].no_anim = data.no_anim || GameFrame.settings.disable_sprite_anim;
spritedictionary[id].imageel = new Image();
spritedictionary[id].imageel.id = id;
spritedictionary[id].imageel.onload = function(event) {
View
5 engine/core/world.js
@@ -16,6 +16,9 @@ var World = (function() {
var elements = {};
function add(id, spriteid, pos, zindex) {
+ if (GameFrame.settings.disable_world_elements) {
+ return;
+ }
if (!elements[id] || elements[id].pos[0] != pos[0] || elements[id].pos[1] != pos[1] || elements[id].spriteid != spriteid) {
World.dirty = true;
elements[id] = {id: id, spriteid: spriteid, pos: pos,
@@ -155,7 +158,7 @@ var World = (function() {
var retval = {dirty: element.dirty,
pos: pos,
size: [sprite.width, sprite.height],
- theta: 0,scale:1,
+ theta: 0, scale: GameFrame.settings.sprite_scale,
x: 0,
y: 0,
zindex: sprite.zindex,
View
BIN  images/white.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
1  perf/perf.js
@@ -259,6 +259,7 @@ var Perf = (function() {
{
render_mode: GameFrame.WEBGL,
sprite_sheets: true, int_snap: false,
+ //disable_sprite_anim: true, sprite_url_override: 'images/white.png', disable_world_elements: true, sprite_scale: 0.01,
webgl_debug: false, webgl_blended_canvas: false, webgl_batch_sprites: true
},
tfps: 30, background: 'world', sprites: 'rot', demo: true
Please sign in to comment.
Something went wrong with that request. Please try again.