diff --git a/org/flixel/FlxG.as b/org/flixel/FlxG.as index 9fa37e43..759b8865 100755 --- a/org/flixel/FlxG.as +++ b/org/flixel/FlxG.as @@ -27,7 +27,7 @@ package org.flixel * Assign a minor version to your library. * Appears after the decimal in the console. */ - static public var LIBRARY_MINOR_VERSION:uint = 40; + static public var LIBRARY_MINOR_VERSION:uint = 41; /** * Internal tracker for game object (so we can pause & unpause) diff --git a/org/flixel/FlxGame.as b/org/flixel/FlxGame.as index b8521a91..cff0c9f1 100755 --- a/org/flixel/FlxGame.as +++ b/org/flixel/FlxGame.as @@ -412,7 +412,8 @@ package org.flixel //Initialize game console _console = new FlxConsole(_gameXOffset,_gameYOffset,_zoom); - addChild(_console); + if(!FlxG.mobile) + addChild(_console); var vstring:String = FlxG.LIBRARY_NAME+" v"+FlxG.LIBRARY_MAJOR_VERSION+"."+FlxG.LIBRARY_MINOR_VERSION; if(FlxG.debug) vstring += " [debug]"; diff --git a/org/flixel/FlxText.as b/org/flixel/FlxText.as index eebcec90..f6304c6b 100644 --- a/org/flixel/FlxText.as +++ b/org/flixel/FlxText.as @@ -223,7 +223,7 @@ package org.flixel _pixels = new BitmapData(width,height,true,0); _bbb = new BitmapData(width,height,true,0); frameHeight = height; - _tf.height = height*1.2; + _tf.height = height*1.2; _flashRect.x = 0; _flashRect.y = 0; _flashRect.width = width; diff --git a/org/flixel/data/FlxConsole.as b/org/flixel/data/FlxConsole.as index 0bb5896a..1329e7e6 100644 --- a/org/flixel/data/FlxConsole.as +++ b/org/flixel/data/FlxConsole.as @@ -89,9 +89,9 @@ package org.flixel.data var tmp:Bitmap = new Bitmap(new BitmapData(FlxG.width*Zoom,FlxG.height*Zoom,true,0x7F000000)); addChild(tmp); - mtrUpdate = new FlxMonitor(8); - mtrRender = new FlxMonitor(8); - mtrTotal = new FlxMonitor(8); + mtrUpdate = new FlxMonitor(16); + mtrRender = new FlxMonitor(16); + mtrTotal = new FlxMonitor(16); _text = new TextField(); _text.width = tmp.width; @@ -146,6 +146,8 @@ package org.flixel.data if(Text == null) Text = "NULL"; trace(Text); + if(FlxG.mobile) + return; _lines.push(Text); if(_lines.length > MAX_CONSOLE_LINES) { @@ -165,6 +167,12 @@ package org.flixel.data */ public function toggle():void { + if(FlxG.mobile) + { + log("FRAME TIMING DATA:\n=========================\n"+printTimingData()+"\n"); + return; + } + if(_YT == _by) _YT = _byt; else @@ -181,11 +189,7 @@ package org.flixel.data { var total:Number = mtrTotal.average(); _fpsDisplay.text = uint(1000/total) + " fps"; - var up:uint = mtrUpdate.average(); - var rn:uint = mtrRender.average(); - var fx:uint = up+rn; - var tt:uint = uint(total); - _extraDisplay.text = up + "ms update\n" + rn + "ms render\n" + fx + "ms flixel\n" + (tt-fx) + "ms flash\n" + tt + "ms total"; + _extraDisplay.text = printTimingData(); if(_Y < _YT) _Y += FlxG.height*10*FlxG.elapsed; @@ -200,5 +204,17 @@ package org.flixel.data } y = Math.floor(_Y); } + + /** + * Returns a string of frame timing data. + */ + protected function printTimingData():String + { + var up:uint = mtrUpdate.average(); + var rn:uint = mtrRender.average(); + var fx:uint = up+rn; + var tt:uint = mtrTotal.average(); + return up + "ms update\n" + rn + "ms render\n" + fx + "ms flixel\n" + (tt-fx) + "ms flash\n" + tt + "ms total"; + } } } \ No newline at end of file