some source cleanup
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
export/
|
export/
|
||||||
|
dump/
|
||||||
latest/windows/obj/
|
latest/windows/obj/
|
||||||
latest/windows/haxe/
|
latest/windows/haxe/
|
||||||
.vscode/
|
.vscode/
|
||||||
+1
-17
@@ -146,23 +146,7 @@
|
|||||||
|
|
||||||
<section if="COMPILE_ALL_CLASSES">
|
<section if="COMPILE_ALL_CLASSES">
|
||||||
<haxeflag name="-dce" value="no" />
|
<haxeflag name="-dce" value="no" />
|
||||||
|
<haxeflag name="--macro" value="funkin.macros.ScriptsMacro.addAdditionalClasses()" />
|
||||||
<!-- so that everything within flixel gets compiled which means hscript super powaaah -->
|
|
||||||
<haxeflag name="--macro" value="include('flixel')" />
|
|
||||||
<haxeflag name="--macro" value="include('away3d')" />
|
|
||||||
<haxeflag name="--macro" value="include('flx3d')" />
|
|
||||||
<haxeflag name="--macro" value="include('sys')" unless="web"/>
|
|
||||||
|
|
||||||
<!-- HAXE STUFF !-->
|
|
||||||
<haxeflag name="--macro" value="include('DateTools')" />
|
|
||||||
<haxeflag name="--macro" value="include('EReg')" />
|
|
||||||
<haxeflag name="--macro" value="include('Lambda')" />
|
|
||||||
<haxeflag name="--macro" value="include('StringBuf')" />
|
|
||||||
<haxeflag name="--macro" value="include('haxe.crypto')" />
|
|
||||||
<haxeflag name="--macro" value="include('haxe.display')" />
|
|
||||||
<haxeflag name="--macro" value="include('haxe.exceptions')" />
|
|
||||||
<haxeflag name="--macro" value="include('haxe.extern')" />
|
|
||||||
<haxeflag name="--macro" value="exclude('scripting')" />
|
|
||||||
</section>
|
</section>
|
||||||
<haxeflag name="--macro" value="exclude('funkin.updating')" unless="UPDATE_CHECKING"/>
|
<haxeflag name="--macro" value="exclude('funkin.updating')" unless="UPDATE_CHECKING"/>
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
1548
|
1556
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package funkin.macros;
|
||||||
|
#if macro
|
||||||
|
import haxe.macro.Expr;
|
||||||
|
import haxe.macro.Context;
|
||||||
|
import haxe.macro.Printer;
|
||||||
|
import haxe.macro.Type.ClassField;
|
||||||
|
import haxe.macro.TypeTools;
|
||||||
|
|
||||||
|
class FlxSpriteProxyMacro {
|
||||||
|
public static function build() {
|
||||||
|
return Context.getBuildFields();
|
||||||
|
|
||||||
|
/*
|
||||||
|
//TODO: FIX ALL OF THIS
|
||||||
|
var parentFields:Array<ClassField> = [];
|
||||||
|
var parentFieldsNames:Array<String> = [];
|
||||||
|
var superClass = Context.getLocalClass().get().superClass.t.get();
|
||||||
|
while(superClass != null) {
|
||||||
|
for(e in superClass.fields.get()) {
|
||||||
|
if (!parentFieldsNames.contains(e.name) && !e.kind.match(FMethod(MethInline))) {
|
||||||
|
parentFields.push(e);
|
||||||
|
parentFieldsNames.push(e.name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (superClass.superClass != null)
|
||||||
|
superClass = superClass.superClass.t.get();
|
||||||
|
else
|
||||||
|
superClass = null;
|
||||||
|
}
|
||||||
|
parentFieldsNames = [];
|
||||||
|
trace(Context.getLocalType());
|
||||||
|
var fields:Array<Field> = Context.getBuildFields();
|
||||||
|
|
||||||
|
// loop through all parent functions
|
||||||
|
for(f in parentFields) {
|
||||||
|
for(field in fields)
|
||||||
|
if (field.name == f.name)
|
||||||
|
continue;
|
||||||
|
switch(f.type) {
|
||||||
|
case TLazy(lazyFunc):
|
||||||
|
switch(lazyFunc()) {
|
||||||
|
case TFun(args, ret):
|
||||||
|
|
||||||
|
// its a function / getter / setter! overriding
|
||||||
|
var overFunc:Function = {
|
||||||
|
args: [for(a in args) {
|
||||||
|
value: null,
|
||||||
|
type: TypeTools.toComplexType(a.t),
|
||||||
|
opt: a.opt,
|
||||||
|
name: a.name
|
||||||
|
}]
|
||||||
|
};
|
||||||
|
var funcName = f.name;
|
||||||
|
|
||||||
|
var argNames:Array<haxe.macro.Expr> = [];
|
||||||
|
for(a in args)
|
||||||
|
argNames.push({
|
||||||
|
pos: Context.makePosition({
|
||||||
|
min: 1,
|
||||||
|
max: 2,
|
||||||
|
file: "DeezNuts.hx"
|
||||||
|
}),
|
||||||
|
expr: EConst(CIdent(a.name))
|
||||||
|
});
|
||||||
|
if (ret == null) {
|
||||||
|
overFunc.expr = macro {
|
||||||
|
function test(p1) {
|
||||||
|
trace(p1);
|
||||||
|
}
|
||||||
|
if (this.proxy != null) {
|
||||||
|
this.proxy.$funcName($a{argNames});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
super.$funcName($a{argNames});
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
overFunc.expr = macro {
|
||||||
|
if (this.proxy != null) {
|
||||||
|
return this.proxy.$funcName($a{argNames});
|
||||||
|
}
|
||||||
|
return super.$funcName($a{argNames});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
var field:Field = {
|
||||||
|
pos: Context.makePosition({
|
||||||
|
min: 0,
|
||||||
|
max: 0,
|
||||||
|
file: "DeezNuts.hx"
|
||||||
|
}),
|
||||||
|
name: f.name,
|
||||||
|
kind: FFun(overFunc),
|
||||||
|
access: [AOverride, APublic]
|
||||||
|
};
|
||||||
|
var p = new Printer();
|
||||||
|
trace(p.printField(field));
|
||||||
|
fields.push(field);
|
||||||
|
default:
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
// nothing
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return fields;
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#end
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
package funkin.macros;
|
||||||
|
|
||||||
|
#if macro
|
||||||
|
import haxe.macro.Context;
|
||||||
|
import haxe.macro.Compiler;
|
||||||
|
import haxe.macro.Expr;
|
||||||
|
|
||||||
|
class ScriptsMacro {
|
||||||
|
public static function addAdditionalClasses() {
|
||||||
|
Compiler.include("flixel");
|
||||||
|
Compiler.include("away3d");
|
||||||
|
Compiler.include("flx3d");
|
||||||
|
#if sys
|
||||||
|
Compiler.include("sys");
|
||||||
|
#end
|
||||||
|
|
||||||
|
Compiler.include("DateTools");
|
||||||
|
Compiler.include("EReg");
|
||||||
|
Compiler.include("Lambda");
|
||||||
|
Compiler.include("StringBuf");
|
||||||
|
Compiler.include("haxe.crypto");
|
||||||
|
Compiler.include("haxe.display");
|
||||||
|
Compiler.include("haxe.exceptions");
|
||||||
|
Compiler.include("haxe.extern");
|
||||||
|
|
||||||
|
Compiler.include("scripting");
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function build():Array<Field> {
|
||||||
|
var fields:Array<Field> = Context.getBuildFields();
|
||||||
|
|
||||||
|
for(f in fields) {
|
||||||
|
switch(f.kind) {
|
||||||
|
case FFun(func):
|
||||||
|
if (f.access == null) f.access = [];
|
||||||
|
if (f.access.contains(AInline))
|
||||||
|
f.access.remove(AInline);
|
||||||
|
f.access.push(ADynamic);
|
||||||
|
default:
|
||||||
|
// do nothing u piece of shit
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return fields;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#end
|
||||||
+2
-1
@@ -3,4 +3,5 @@ haxelib git flixel-yc29 https://www.github.com/YoshiCrafter29/flixel
|
|||||||
haxelib git hscript-improved https://www.github.com/YoshiCrafter29/hscript-improved
|
haxelib git hscript-improved https://www.github.com/YoshiCrafter29/hscript-improved
|
||||||
haxelib install away3d
|
haxelib install away3d
|
||||||
haxelib install hxCodec
|
haxelib install hxCodec
|
||||||
haxelib install markdown
|
haxelib install markdown
|
||||||
|
haxelib git flxanimate https://github.com/Dot-Stuff/flxanimate/
|
||||||
Reference in New Issue
Block a user