Cleanup
This commit is contained in:
+2
-9
@@ -103,10 +103,6 @@
|
||||
<!-- Comment this out to disable updates !-->
|
||||
<!-- <define name="UPDATE_CHECKING" unless="web || hl || neko"/> -->
|
||||
|
||||
<!-- Fixes thing with macros -->
|
||||
<define name="HL" if="hl"/>
|
||||
<define name="SYS" if="cpp || hl || neko"/>
|
||||
|
||||
<!-- Comment this out to disable Discord RPC !-->
|
||||
<section if="cpp">
|
||||
<define name="DISCORD_RPC" if="desktop"/>
|
||||
@@ -144,9 +140,6 @@
|
||||
<!-- Comment this out to disable support for custom ndlls. !-->
|
||||
<haxedef name="NDLLS_SUPPORTED" unless="web || iphonesim" />
|
||||
|
||||
<!-- Comment this out to disable support for custom extended classes (data/classes). !-->
|
||||
<define name="SOFTCODED_CLASSES" />
|
||||
|
||||
<!-- Comment this out to disable support for Away3D Flixel Intergration (reduces compile times)-->
|
||||
<define name="THREE_D_SUPPORT" />
|
||||
|
||||
@@ -190,10 +183,10 @@
|
||||
|
||||
<section if="COMPILE_ALL_CLASSES">
|
||||
<haxeflag name="-dce" value="no" />
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.ScriptsMacro.addAdditionalClasses()" />
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.Macros.addAdditionalClasses()" />
|
||||
</section>
|
||||
|
||||
<haxeflag name="--macro" value="exclude('funkin.backend.system.updating')" unless="UPDATE_CHECKING"/>
|
||||
<haxeflag name="--macro" value="funkin.backend.system.macros.Macros.initMacros()" />
|
||||
|
||||
<!-- Fix compiling issues -->
|
||||
<setenv name="HAXEPATH" value="./"/>
|
||||
|
||||
@@ -4,19 +4,11 @@ import funkin.editors.SaveWarning;
|
||||
import funkin.backend.assets.AssetsLibraryList;
|
||||
import funkin.backend.system.framerate.SystemInfo;
|
||||
import openfl.utils.AssetLibrary;
|
||||
import openfl.utils.AssetCache;
|
||||
import openfl.text.TextFormat;
|
||||
import flixel.system.ui.FlxSoundTray;
|
||||
import funkin.backend.utils.NativeAPI;
|
||||
import funkin.menus.BetaWarningState;
|
||||
import funkin.menus.TitleState;
|
||||
import flixel.FlxGame;
|
||||
import flixel.FlxState;
|
||||
import openfl.Assets;
|
||||
import openfl.Lib;
|
||||
import openfl.display.FPS;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.events.Event;
|
||||
import flixel.graphics.FlxGraphic;
|
||||
import flixel.addons.transition.FlxTransitionableState;
|
||||
import flixel.addons.transition.FlxTransitionSprite.GraphicTransTileDiamond;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package funkin.backend.system.macros;
|
||||
|
||||
#if macro
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Expr;
|
||||
|
||||
/**
|
||||
* Macro that generates all additional fields, making events much easier to code in.
|
||||
* It adds the `recycle` function, which allows you to "reset" an event's values.
|
||||
@@ -19,7 +22,6 @@ class EventMacro {
|
||||
if (f.name == "recycle")
|
||||
return fields;
|
||||
|
||||
|
||||
// gets all fields
|
||||
var values:Array<EventVar> = [];
|
||||
var hiddenValues:Array<EventVar> = [];
|
||||
@@ -48,8 +50,8 @@ class EventMacro {
|
||||
// add recycle option
|
||||
var func:Function = {
|
||||
args: [for(a in values) {
|
||||
value: a.expr,
|
||||
type: a.type,
|
||||
value: a.expr,
|
||||
type: a.type,
|
||||
opt: false,
|
||||
name: a.name
|
||||
}],
|
||||
@@ -87,7 +89,7 @@ class EventMacro {
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
// add a "set this" expr to reset each private/hidden variables
|
||||
for(v in hiddenValues) {
|
||||
var name = v.name;
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package funkin.backend.system.macros;
|
||||
|
||||
#if macro
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Expr;
|
||||
|
||||
/**
|
||||
* Macro that automatically generates flush and load functions.
|
||||
*/
|
||||
@@ -13,7 +16,6 @@ class FunkinSaveMacro {
|
||||
* @return Array<Field>
|
||||
*/
|
||||
public static function build(saveFieldName:String = "save", saveFuncName:String = "flush", loadFuncName:String = "load"):Array<Field> {
|
||||
|
||||
var fields:Array<Field> = Context.getBuildFields();
|
||||
|
||||
var fieldNames:Array<String> = [];
|
||||
|
||||
@@ -30,12 +30,12 @@ class HashLinkFixer {
|
||||
|
||||
public static function init() {
|
||||
#if !display
|
||||
#if HL
|
||||
for(apply in applyOn) {
|
||||
compile(apply);
|
||||
if(Context.defined("hl")) {
|
||||
for(apply in applyOn) {
|
||||
compile(apply);
|
||||
}
|
||||
}
|
||||
#end
|
||||
#end
|
||||
}
|
||||
|
||||
public static function compile(name:String) {
|
||||
|
||||
+17
-12
@@ -1,14 +1,13 @@
|
||||
package funkin.backend.system.macros;
|
||||
|
||||
#if macro
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Compiler;
|
||||
import haxe.macro.*;
|
||||
import haxe.macro.Expr;
|
||||
|
||||
/**
|
||||
* Macros containing additional help functions to expand HScript capabilities.
|
||||
*/
|
||||
class ScriptsMacro {
|
||||
class Macros {
|
||||
public static function addAdditionalClasses() {
|
||||
for(inc in [
|
||||
// FLIXEL
|
||||
@@ -27,19 +26,25 @@ class ScriptsMacro {
|
||||
])
|
||||
Compiler.include(inc);
|
||||
|
||||
for(inc in [#if SYS "sys", "openfl.net", "funkin.backend.system.net" #end]) {
|
||||
#if !HL
|
||||
Compiler.include(inc);
|
||||
#else
|
||||
// TODO: Hashlink
|
||||
//Compiler.include(inc, ["sys.net.UdpSocket", "openfl.net.DatagramSocket"]); // fixes FATAL ERROR : Failed to load function std@socket_set_broadcast
|
||||
#end
|
||||
var isHl = Context.defined("hl");
|
||||
|
||||
if(Context.defined("sys")) {
|
||||
for(inc in ["sys", "openfl.net", "funkin.backend.system.net"]) {
|
||||
if(!isHl)
|
||||
Compiler.include(inc);
|
||||
else {
|
||||
// TODO: Hashlink
|
||||
//Compiler.include(inc, ["sys.net.UdpSocket", "openfl.net.DatagramSocket"]); // fixes FATAL ERROR : Failed to load function std@socket_set_broadcast
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Compiler.include("funkin", #if !UPDATE_CHECKING ['funkin.backend.system.updating'] #end);
|
||||
}
|
||||
|
||||
#if HL HashLinkFixer.init(); #end
|
||||
// Todo rewrite this to use if(Context.defined(""))
|
||||
public static function initMacros() {
|
||||
if(Context.defined("hl"))
|
||||
HashLinkFixer.init();
|
||||
}
|
||||
}
|
||||
#end
|
||||
@@ -1,6 +1,9 @@
|
||||
package funkin.backend.system.macros;
|
||||
|
||||
#if macro
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Expr;
|
||||
|
||||
using StringTools;
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package funkin.backend.system.macros;
|
||||
|
||||
#if macro
|
||||
import haxe.macro.Context;
|
||||
import haxe.macro.Expr;
|
||||
import haxe.macro.Expr.ExprDef;
|
||||
#end
|
||||
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
#if macro
|
||||
import haxe.macro.*;
|
||||
import haxe.macro.Expr;
|
||||
#end
|
||||
@@ -3,8 +3,8 @@ package funkin.backend.utils;
|
||||
import funkin.backend.utils.native.*;
|
||||
|
||||
/**
|
||||
* Class for Windows-only functions, such as transparent windows, message boxes, and more.
|
||||
* Does not have any effect on other platforms.
|
||||
* Class for functions that talk to a lower level than haxe, such as message boxes, and more.
|
||||
* Some functions might not have effect on some platforms.
|
||||
*/
|
||||
class NativeAPI {
|
||||
@:dox(hide) public static function registerAudio() {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#if !macro
|
||||
package funkin.editors;
|
||||
|
||||
import funkin.editors.ui.*;
|
||||
import flixel.math.FlxPoint;
|
||||
|
||||
using funkin.editors.ui.UIUtil;
|
||||
using funkin.editors.ui.UIUtil;
|
||||
#end
|
||||
@@ -1,3 +1,5 @@
|
||||
#if !macro
|
||||
package funkin.options.categories;
|
||||
|
||||
import funkin.options.type.*;
|
||||
import funkin.options.type.*;
|
||||
#end
|
||||
Reference in New Issue
Block a user