Skip to content

Commit

Permalink
Update FPSCounter.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesisfeline committed Mar 30, 2024
1 parent 9dfb955 commit 6056069
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions source/debug/FPSCounter.hx
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ class FPSCounter extends TextField {
public var differentPosition:Bool = false;
public var counterFont:String = "vcr.ttf";

public function new(x:Float = 10, y:Float = 10)
{
public function new(x:Float = 10, y:Float = 10) {
super();

this.x = x;
Expand All @@ -67,8 +66,7 @@ class FPSCounter extends TextField {
times = [];

//#if flash
addEventListener(Event.ENTER_FRAME, function(e)
{
addEventListener(Event.ENTER_FRAME, (e) -> {
var time = Lib.getTimer();
__enterFrame(time - currentTime);
});
Expand Down Expand Up @@ -113,19 +111,19 @@ class FPSCounter extends TextField {

if (ClientPrefs.data.engineVersion) {
text += "\n[ALLEYWAY VER] 1.0b / [PE VER]" + MainMenuState.psychEngineVersion;
text += "\n[VS.FOXA VER] 3.0+";
text += "\n[VS.FOXA VER] 3.0 SE";
}

// #if debug
if (ClientPrefs.data.debugInfo) {
text += '\nState: ${Type.getClassName(Type.getClass(FlxG.state))}';
if (FlxG.state.subState != null)
text += '\nSubstate: ${Type.getClassName(Type.getClass(FlxG.state.subState))}';
if (FlxG.state.subState != null) text += '\nSubstate: ${Type.getClassName(Type.getClass(FlxG.state.subState))}';
else text += '\nSubstate: NONE';
text += "\nDevice: " + '${lime.system.System.deviceModel} ${lime.system.System.deviceVendor}';
text += "\nOS: " + '${lime.system.System.platformLabel} ${lime.system.System.platformVersion}';
text += "\nGL Render: " + '${getGLInfo(RENDERER)}';
text += "\nGL Shading version: " + '${getGLInfo(SHADING_LANGUAGE_VERSION)})';
text += "\nFlixel: " + FlxG.VERSION;
text += "\nFlixel: " + FlxG.VERSION + "-foxa";
}
// #end

Expand Down Expand Up @@ -170,9 +168,8 @@ class FPSCounter extends TextField {
private static inline function fromHSL(h:Float, s:Float, l:Float) {
h /= 360;
var r:Float, g:Float, b:Float;
if (s == 0.0) {
r = g = b = l;
} else {
if (s == 0.0) r = g = b = l;
else {
var q:Float = l < 0.5 ? l * (1.0 + s) : l + s - l * s;
var p:Float = 2.0 * l - q;
r = hueToRGB(p, q, h + 1.0 / 3.0);
Expand All @@ -184,8 +181,7 @@ class FPSCounter extends TextField {

// hueToRGB function
private static inline function hueToRGB(p:Float, q:Float, h:Float) {
if (h < 0.0) h += 1.0;
if (h > 1.0) h -= 1.0;
if (h < 0.0) h += 1.0; if (h > 1.0) h -= 1.0;
if (6.0 * h < 1.0) return p + (q - p) * 6.0 * h;
if (2.0 * h < 1.0) return q;
if (3.0 * h < 2.0) return p + (q - p) * ((2.0 / 3.0) - h) * 6.0;
Expand Down

0 comments on commit 6056069

Please sign in to comment.