From 1d6856039bc80a1270b788d64ba40ef163e141ac Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Tue, 31 Jan 2023 23:06:48 +0100 Subject: [PATCH] Revert "scrapped profiler" This reverts commit 6b3ba95ed3f5c3aaa6205acca22bb0677bee3e11. --- Project.xml | 4 -- buildnumber.txt | 2 +- source/funkin/system/FunkinGame.hx | 13 ------ source/funkin/system/FunkinProfiler.hx | 64 -------------------------- source/funkin/system/Main.hx | 2 +- 5 files changed, 2 insertions(+), 83 deletions(-) delete mode 100644 source/funkin/system/FunkinGame.hx delete mode 100644 source/funkin/system/FunkinProfiler.hx diff --git a/Project.xml b/Project.xml index d85e6216..dca9035c 100644 --- a/Project.xml +++ b/Project.xml @@ -131,15 +131,11 @@ - - - - diff --git a/buildnumber.txt b/buildnumber.txt index 929701d3..f3409cd6 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -2220 \ No newline at end of file +2204 \ No newline at end of file diff --git a/source/funkin/system/FunkinGame.hx b/source/funkin/system/FunkinGame.hx deleted file mode 100644 index a3e7f079..00000000 --- a/source/funkin/system/FunkinGame.hx +++ /dev/null @@ -1,13 +0,0 @@ -package funkin.system; - -import flixel.FlxState; -import flixel.FlxGame; - -class FunkinGame extends FlxGame { - public function new(gameWidth = 0, gameHeight = 0, ?initialState:Class, updateFramerate = 60, drawFramerate = 60, skipSplash = false, startFullscreen = false) { - super(gameWidth, gameHeight, initialState, 1, updateFramerate, drawFramerate, skipSplash, startFullscreen); - #if (cpp && ENABLE_PROFILER) - cpp.vm.Profiler.start('./profiler.txt'); - #end - } -} \ No newline at end of file diff --git a/source/funkin/system/FunkinProfiler.hx b/source/funkin/system/FunkinProfiler.hx deleted file mode 100644 index 0f320738..00000000 --- a/source/funkin/system/FunkinProfiler.hx +++ /dev/null @@ -1,64 +0,0 @@ -package funkin.system; - -import flixel.util.FlxDestroyUtil.IFlxDestroyable; -import flixel.util.FlxPool; -class FunkinProfiler { - private static var __pool:FlxPool = new FlxPool(FunkinProfilerEvent); - private static inline function __getEvent(name:String) - return __pool.get().set(name); - - public static var events:Array = []; - - public static function reset() { - for(e in events) - e.recycle(); - } - - public static function registerEvent(event:String, level:Int = 0) { - var curEventsArray = events; - var l:Int = 0; - var ev:FunkinProfilerEvent; - while(l < level) { - ev = curEventsArray.last(); - if (ev == null) - curEventsArray.push(ev = __getEvent("Unknown")); - curEventsArray = ev.childs; - l++; - } - - curEventsArray.push(__getEvent(event)); - } - -} - -class FunkinProfilerEvent implements IFlxDestroyable { - public var name:String = null; - public var childs:Array = []; - - public function new() {} - - public function set(name:String):FunkinProfilerEvent { - this.name = name; - if (childs != null) - while(childs.length > 0) - childs.shift(); - else - childs = []; - return this; - } - - public function destroy() { - name = null; - childs = null; - } - - public function recycle() { - name = null; - if (childs != null) - for(c in childs) - if (c != null) - c.recycle(); - @:privateAccess - FunkinProfiler.__pool.put(this); - } -} \ No newline at end of file diff --git a/source/funkin/system/Main.hx b/source/funkin/system/Main.hx index d6ba2e4c..a3073244 100644 --- a/source/funkin/system/Main.hx +++ b/source/funkin/system/Main.hx @@ -100,7 +100,7 @@ class Main extends Sprite } - addChild(new FunkinGame(gameWidth, gameHeight, null, framerate, framerate, skipSplash, startFullscreen)); + addChild(new FlxGame(gameWidth, gameHeight, null, zoom, framerate, framerate, skipSplash, startFullscreen)); loadGameSettings(); // FlxG.switchState(new TitleState()); FlxG.switchState(new funkin.menus.BetaWarningState());