From 688c078e4a213e311134f3c0edb0aa3d253bad44 Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Mon, 15 Apr 2024 14:36:27 +0200 Subject: [PATCH] Moved externals + small fix --- assets/data/states/StageEditor.hx | 4 ++-- commandline/Main.hx | 15 +++++++++++---- source/external/ExternalMac.hx | 11 +++++++++++ .../system/macros => external}/LinkerMacro.hx | 2 +- .../utils/native => }/external/external_code.xml | 0 .../external/include/mac/CursorHelper.h | 0 .../utils/native => }/external/include/mac/Mac.h | 0 .../native => }/external/src/mac/CursorHelper.mm | 0 .../utils/native => }/external/src/mac/Mac.mm | 0 source/funkin/backend/utils/native/Mac.hx | 11 +---------- .../editors/stage/elements/StageElementButton.hx | 2 +- 11 files changed, 27 insertions(+), 18 deletions(-) create mode 100644 source/external/ExternalMac.hx rename source/{funkin/backend/system/macros => external}/LinkerMacro.hx (96%) rename source/{funkin/backend/utils/native => }/external/external_code.xml (100%) rename source/{funkin/backend/utils/native => }/external/include/mac/CursorHelper.h (100%) rename source/{funkin/backend/utils/native => }/external/include/mac/Mac.h (100%) rename source/{funkin/backend/utils/native => }/external/src/mac/CursorHelper.mm (100%) rename source/{funkin/backend/utils/native => }/external/src/mac/Mac.mm (100%) diff --git a/assets/data/states/StageEditor.hx b/assets/data/states/StageEditor.hx index e37acc0b..a458667b 100644 --- a/assets/data/states/StageEditor.hx +++ b/assets/data/states/StageEditor.hx @@ -33,7 +33,7 @@ function create() { WindowUtils.onClosing = function() { if(!FlxG.keys.pressed.ALT) { Lib.application.window.onClose.cancel(); - FlxG.switchState(new StageEditor("test")); + FlxG.switchState(new StageEditor(StageEditor.__stage)); trace("you dont need to close doofus goofus"); } } @@ -42,7 +42,7 @@ function create() { function update() { if(FlxG.keys.justPressed.R) { trace("reloading"); - FlxG.switchState(new StageEditor("test")); + FlxG.switchState(new StageEditor(StageEditor.__stage)); } } diff --git a/commandline/Main.hx b/commandline/Main.hx index 9d5ed778..b4992402 100644 --- a/commandline/Main.hx +++ b/commandline/Main.hx @@ -49,7 +49,8 @@ class Main { "If you want a full build which contains all assets, run \"cne release\" or \"cne test-release\"", "Additional arguments will be sent to the lime compiler.", "", - "-debug : Builds a debug build." + "-debug : Builds a debug build.", + "-clean : Compiled files will be deleted before compiling." ].join("\n") }, { @@ -67,7 +68,8 @@ class Main { "If you want a full build which contains all assets, run \"cne release\" or \"cne test-release\"", "Additional arguments will be sent to the lime compiler.", "", - "-debug : Builds a debug build." + "-debug : Builds a debug build.", + "-clean : Compiled files will be deleted before compiling." ].join("\n") }, { @@ -78,6 +80,7 @@ class Main { "Usage: run ", "", "This will run the last build that was created.", + "If the last build was a debug build, you need to pass the -debug argument to run it.", "Additional arguments will be sent to the lime compiler." ].join("\n") }, @@ -90,7 +93,9 @@ class Main { "", "This will create and run a final ready-for-release build,", "which means this build will be able to be release on websites such as GameBanana without worrying about source-dependant stuff.", - "Additional arguments will be sent to the lime compiler." + "Additional arguments will be sent to the lime compiler.", + "", + "-clean : Compiled files will be deleted before compiling." ].join("\n") }, { @@ -102,7 +107,9 @@ class Main { "", "This will create and run a final ready-for-release build,", "which means this build will be able to be release on websites such as GameBanana without worrying about source-dependant stuff.", - "Additional arguments will be sent to the lime compiler." + "Additional arguments will be sent to the lime compiler.", + "", + "-clean : Compiled files will be deleted before compiling." ].join("\n") }, { diff --git a/source/external/ExternalMac.hx b/source/external/ExternalMac.hx new file mode 100644 index 00000000..6ac4abd4 --- /dev/null +++ b/source/external/ExternalMac.hx @@ -0,0 +1,11 @@ +package external; + +#if mac +@:build(external.LinkerMacro.xml('external_code.xml')) +@:native("ExternalMac") +@:include('Mac.h') +extern class ExternalMac { + @:native("ExternalMac::setCursorIcon") + public static function setCursorIcon(icon:Int):Bool; +} +#end \ No newline at end of file diff --git a/source/funkin/backend/system/macros/LinkerMacro.hx b/source/external/LinkerMacro.hx similarity index 96% rename from source/funkin/backend/system/macros/LinkerMacro.hx rename to source/external/LinkerMacro.hx index 926bb800..3f3912b9 100644 --- a/source/funkin/backend/system/macros/LinkerMacro.hx +++ b/source/external/LinkerMacro.hx @@ -1,4 +1,4 @@ -package funkin.backend.system.macros; +package external; import haxe.io.Path; import haxe.macro.Expr; diff --git a/source/funkin/backend/utils/native/external/external_code.xml b/source/external/external_code.xml similarity index 100% rename from source/funkin/backend/utils/native/external/external_code.xml rename to source/external/external_code.xml diff --git a/source/funkin/backend/utils/native/external/include/mac/CursorHelper.h b/source/external/include/mac/CursorHelper.h similarity index 100% rename from source/funkin/backend/utils/native/external/include/mac/CursorHelper.h rename to source/external/include/mac/CursorHelper.h diff --git a/source/funkin/backend/utils/native/external/include/mac/Mac.h b/source/external/include/mac/Mac.h similarity index 100% rename from source/funkin/backend/utils/native/external/include/mac/Mac.h rename to source/external/include/mac/Mac.h diff --git a/source/funkin/backend/utils/native/external/src/mac/CursorHelper.mm b/source/external/src/mac/CursorHelper.mm similarity index 100% rename from source/funkin/backend/utils/native/external/src/mac/CursorHelper.mm rename to source/external/src/mac/CursorHelper.mm diff --git a/source/funkin/backend/utils/native/external/src/mac/Mac.mm b/source/external/src/mac/Mac.mm similarity index 100% rename from source/funkin/backend/utils/native/external/src/mac/Mac.mm rename to source/external/src/mac/Mac.mm diff --git a/source/funkin/backend/utils/native/Mac.hx b/source/funkin/backend/utils/native/Mac.hx index 0db00f42..612335e3 100644 --- a/source/funkin/backend/utils/native/Mac.hx +++ b/source/funkin/backend/utils/native/Mac.hx @@ -4,7 +4,6 @@ package funkin.backend.utils.native; import funkin.backend.utils.NativeAPI.CodeCursor; import openfl.ui.Mouse; -@:build(funkin.backend.system.macros.LinkerMacro.xml('external/external_code.xml')) @:headerInclude('sys/sysctl.h') class Mac { @:functionCode(' @@ -24,20 +23,12 @@ class Mac { public static function setMouseCursorIcon(icon:CodeCursor):Void { - final valid:Bool = ExternalMac.setCursorIcon(icon.toInt()); + final valid:Bool = external.ExternalMac.setCursorIcon(icon.toInt()); if(!valid) { Mouse.cursor = icon.toOpenFL(); } } } - -@:build(funkin.backend.system.macros.LinkerMacro.xml('external/external_code.xml')) -@:native("ExternalMac") -@:include('Mac.h') -extern class ExternalMac { - @:native("ExternalMac::setCursorIcon") - public static function setCursorIcon(icon:Int):Bool; -} #end diff --git a/source/funkin/editors/stage/elements/StageElementButton.hx b/source/funkin/editors/stage/elements/StageElementButton.hx index ae88b66b..65a29459 100644 --- a/source/funkin/editors/stage/elements/StageElementButton.hx +++ b/source/funkin/editors/stage/elements/StageElementButton.hx @@ -142,7 +142,7 @@ class StageElementButton extends UIButton { public function getInfoText():String { var pos = getPos(); - var text = '${getName()} (${CoolUtil.quantize(pos.x, 100)}x${CoolUtil.quantize(pos.y, 100)})'; + var text = '${getName()} (${CoolUtil.quantize(pos.x, 100)}, ${CoolUtil.quantize(pos.y, 100)})'; pos.put(); return text; }