Skip to content

Commit

Permalink
so yeah!
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackx2 committed Feb 2, 2025
1 parent 5436ce6 commit 18c252a
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 37 deletions.
6 changes: 3 additions & 3 deletions Project.xml
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@
<!-- Crisp Visuals -->
<define name="CRISP_VISUALS" if="windows" unless="32bits"/>

<!-- Preload Assets -->
<define name="PRELOAD_ALL" unless="web" />

<!-- Enables a terminal log prompt on debug builds -->
<define name="DEBUG_SERVER_ALLOWED" if="debug desktop"/>

<!-- Enables a terminal log prompt on debug builds -->
<define name="GIT_ALLOWED" if="debug"/>

<!-- Remove "officialBuild" to use videos on source mod -->
<define name="VIDEOS_ALLOWED" if="(windows || linux || android) officialBuild || debug" unless="32bits"/>

Expand Down
5 changes: 5 additions & 0 deletions source/funkin/backend/macro/GitMacro.hx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package funkin.backend.macro;

#if GIT_ALLOWED
#if macro
import sys.io.Process;
#end
Expand All @@ -10,20 +11,23 @@ class GitMacro
* Current git commit number.
*/
public static var commitNumber(get, never):Int;

@:noCompletion private static function get_commitNumber()
return _commitNumber();

/**
* Current git commit hash.
*/
public static var commitHash(get, never):String;

@:noCompletion private static function get_commitHash()
return _commitHash();

/**
* Current git branch.
*/
public static var branch(get, never):String;

@:noCompletion private static function get_branch()
return _currentBranch();

Expand Down Expand Up @@ -86,3 +90,4 @@ class GitMacro
return macro $v{""} #end
}
}
#end
43 changes: 21 additions & 22 deletions source/funkin/game/FPS.hx
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ class FPS extends TextField
private var currentTime:Float;
private var times:Array<Float>;

private inline function addLine(str:String = "", ?lineDown:Bool = true):String
return text += '${lineDown ? '\n' : ''}$str';

public function new(x:Float = 10, y:Float = 10, color:Int = 0x000000)
{
super();
Expand Down Expand Up @@ -62,15 +65,6 @@ class FPS extends TextField
times = [];
}

// DO NOT USE// NOT CURRENTLY WORKIN ATM

@:deprecated("DON@T USE NOT DONE!!!!")
@:noCompletion override function set_alpha(val:Float):Float
return bgSprite.alpha = super.alpha = val;

@:noCompletion override function set_visible(val:Bool):Bool
return bgSprite.visible = super.visible = val;

@:noCompletion private override function __enterFrame(deltaTime:Float):Void
{
currentTime += deltaTime;
Expand All @@ -86,31 +80,31 @@ class FPS extends TextField

if (currentCount != cacheCount)
{
text = '${#if ASTRO_WATERMARKS ClientPrefs.data.gayFurryStuff ? "owo's per second" : #end 'FPS'}: $currentFPS';

var memoryMegas:Float = 0;
text = "";
addLine('${#if ASTRO_WATERMARKS ClientPrefs.data.gayFurryStuff ? "owo's per second" : #end 'FPS'}: $currentFPS', false);

#if openfl
var memoryMegas:Float = 0;
memoryMegas = Math.abs(FlxMath.roundDecimal(System.totalMemory / 1000000, 1));
text += '\n${#if ASTRO_WATERMARKS ClientPrefs.data.gayFurryStuff ? "proot mem usage" : #end 'Memory'}: ${memoryMegas} MB';
addLine('${#if ASTRO_WATERMARKS ClientPrefs.data.gayFurryStuff ? "proot mem usage" : #end 'Memory'}: ${memoryMegas} MB');
#end

#if debug
text += '\n${#if ASTRO_WATERMARKS ClientPrefs.data.gayFurryStuff ? "orbl pick one pls 🙏" : #end "Commit"}: ${GitMacro.commitNumber} [${GitMacro.commitHash}] ${GitMacro.branch}';
#if GIT_ALLOWED
addLine('${#if ASTRO_WATERMARKS ClientPrefs.data.gayFurryStuff ? "orbl pick one pls 🙏" : #end "Commit"}: ${GitMacro.commitNumber} [${GitMacro.commitHash}] ${GitMacro.branch}');
#end

textColor = 0xFFFFFFFF;
if (memoryMegas > 3000 || currentFPS <= ClientPrefs.data.framerate / 2)
textColor = 0xFFFF0000;

#if (gl_stats && !disable_cffi && (!html5 || !canvas))
addLine();
addLine('ntotalDC: ${Context3DStats.totalDrawCalls()}');
addLine('nstageDC: ${Context3DStats.contextDrawCalls(DrawCallContext.STAGE)}');
addLine('stage3DDC: ${Context3DStats.contextDrawCalls(DrawCallContext.STAGE3D)}');
#end

bgSprite.scaleX = this.width + offset.x * 2 + 10;
textColor = 0xFFFFFFFF;
if (#if openfl memoryMegas > 3000 || #end currentFPS <= ClientPrefs.data.framerate / 2)
textColor = 0xFFFF0000;

bgSprite.scaleX = this.width + offset.x * 2 - 10;
bgSprite.scaleY = this.height + offset.y * 2 + 3;
}

Expand All @@ -120,6 +114,11 @@ class FPS extends TextField
bgSprite.y = this.y - offset.y;
}

private inline function addLine(str:String = ""):String
return text += '\n$str';
@:deprecated("DON@T USE NOT DONE!!!!")
@:noCompletion override function set_alpha(val:Float):Float{
return bgSprite.alpha = super.alpha = val;
}

@:noCompletion override function set_visible(val:Bool):Bool
return bgSprite.visible = super.visible = val;
}
19 changes: 9 additions & 10 deletions source/funkin/game/Init.hx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class Init extends flixel.FlxState

hxvlc.util.Handle.initAsync(#if (hxvlc >= "1.8.0") ['--no-lua'] #end, _ -> {
trace(_ ? "LibVLC initialized" : "Error on initializing LibVLC!");
Main.fpsVar.visible = ClientPrefs.data.showFPS;
clearState();
});
#else
Expand All @@ -70,7 +69,7 @@ class Init extends flixel.FlxState
}

static function clearState() : Void {
trace('Leaving state');
Main.fpsVar.visible = ClientPrefs.data.showFPS;
FlxG.switchState(new TitleState());
}

Expand Down Expand Up @@ -131,6 +130,14 @@ class Init extends flixel.FlxState
#if SHADERS_ALLOWED
private function fragFix():Void
{
function resetSpriteCache(sprite:openfl.display.Sprite):Void
{
@:privateAccess {
sprite.__cacheBitmap = null;
sprite.__cacheBitmapData = null;
}
}

FlxG.signals.gameResized.add(function(w, h)
{
if (FlxG.cameras != null)
Expand All @@ -142,14 +149,6 @@ class Init extends flixel.FlxState
resetSpriteCache(FlxG.game);
});
}

private static function resetSpriteCache(sprite:openfl.display.Sprite):Void
{
@:privateAccess {
sprite.__cacheBitmap = null;
sprite.__cacheBitmapData = null;
}
}
#end

#if WATERMARK
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/states/ModsMenuState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ class ModsMenuState extends MusicBeatState
// FlxG.autoPause = ClientPrefs.data.autoPause;
FlxTransitionableState.skipNextTransIn = true;
FlxTransitionableState.skipNextTransOut = true;
var curMod:ModItem = modsGroup.members[curSelectedMod];
final curMod:ModItem = modsGroup.members[curSelectedMod];
MusicBeatState.switchState(new ModsMenuState(curMod != null ? curMod.folder : null));
}
}
Expand Down
2 changes: 1 addition & 1 deletion source/funkin/game/states/TitleState.hx
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ class TitleState extends MusicBeatState
var pressedEnter:Bool = FlxG.keys.justPressed.ENTER || controls.ACCEPT;

if(FlxG.keys.justPressed.F5)
MusicBeatState.switchState(new funkin.game.states.owo.VeryFuniState());
MusicBeatState.switchState(new funkin.game.states.owo.VeryFuniState(new TitleState()));

#if mobile
for (touch in FlxG.touches.list)
Expand Down

0 comments on commit 18c252a

Please sign in to comment.