new flixel fork and stuff

This commit is contained in:
Yoshman29
2023-04-07 19:51:01 +02:00
parent 3c6531b154
commit adad87db8b
25 changed files with 80 additions and 100 deletions
+4 -5
View File
@@ -139,7 +139,6 @@
<!-- Comment this out to disable commit number on FPS -->
<define name="SHOW_BUILD_ON_FPS" />
<haxedef name="VIDEO_CUTSCENES" if="VIDEO_CUTSCENES" />
<haxedef name="UPDATE_CHECKING" if="UPDATE_CHECKING" />
<haxedef name="DISCORD_RPC" if="DISCORD_RPC" />
@@ -149,13 +148,13 @@
<!-- _______________________________ Libraries ______________________________ -->
<haxelib name="hxCodec" if="VIDEO_CUTSCENES" />
<haxelib name="away3d" />
<haxelib name="format" />
<haxelib name="flxanimate" />
<haxelib name="flixel-yc29" rename="flixel" />
<haxelib name="flixel" />
<haxelib name="flixel-addons" />
<haxedev set='webgl' />
<haxelib name="hscript-improved" />
@@ -165,13 +164,13 @@
<haxelib name="hxcpp-debug-server" if="desktop debug"/>
<!-- _________________________________ HScript classes _______________________________ -->
<!-- _________________________________ Additional stuff _______________________________ -->
<section if="COMPILE_ALL_CLASSES">
<haxeflag name="-dce" value="no" />
<haxeflag name="--macro" value="funkin.macros.ScriptsMacro.addAdditionalClasses()" />
</section>
<haxeflag name="--macro" value="exclude('funkin.updating')" unless="UPDATE_CHECKING"/>
<haxeflag name="--macro" value="exclude('funkin.multitasking')" unless="ALLOW_MULTITASKING"/>
+22 -7
View File
@@ -11,18 +11,33 @@
"version": null
},
{
"name": "flixel-yc29",
"name": "flixel-addons",
"type": "haxelib",
"version": null
},
{
"name": "spinehaxe",
"type": "haxelib",
"version": null
},
{
"name": "flixel",
"type": "git",
"dir": "flixel",
"ref": "master",
"url": "https://www.github.com/YoshiCrafter29/flixel"
"ref": "dev",
"url": "https://www.github.com/FNF-CNE-Devs/flixel"
},
{
"name": "flixel-addons",
"type": "git",
"ref": "dev",
"url": "https://www.github.com/FNF-CNE-Devs/flixel-addons"
},
{
"name": "flxanimate",
"type": "git",
"dir": "flxanimate",
"ref": "master",
"url": "https://github.com/YoshiCrafter29/flxanimate/"
"url": "https://github.com/FNF-CNE-Devs/flxanimate/"
},
{
"name": "format",
@@ -33,8 +48,8 @@
"name": "hscript-improved",
"type": "git",
"dir": "hscript-improved",
"ref": "master",
"url": "https://www.github.com/YoshiCrafter29/hscript-improved"
"ref": "custom-classes",
"url": "https://www.github.com/FNF-CNE-Devs/hscript-improved"
},
{
"name": "hxCodec",
+1 -1
View File
@@ -1,6 +1,6 @@
package funkin.cutscenes;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import funkin.cutscenes.dialogue.*;
import haxe.xml.Access;
+1 -1
View File
@@ -1,7 +1,7 @@
package funkin.editors.charter;
import flixel.input.keyboard.FlxKey;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.util.FlxSort;
import flixel.math.FlxPoint;
import funkin.editors.charter.CharterBackdrop.CharterBackdropDummy;
+3 -3
View File
@@ -292,7 +292,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
__drawingShadowFrame = true;
var oldFrame = _frame;
var oldPos = FlxPoint.get(rotOffset.x, rotOffset.y);
var oldPos = FlxPoint.get(frameOffset.x, frameOffset.y);
__oldColorTransform.copyColorTransform(colorTransform);
@@ -307,11 +307,11 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset
_frame = shadowFrame.frame;
var o = getAnimOffset(shadowFrame.anim);
rotOffset.set(o.x, o.y);
frameOffset.set(o.x, o.y);
super.draw();
_frame = oldFrame;
rotOffset.set(oldPos.x, oldPos.y);
frameOffset.set(oldPos.x, oldPos.y);
colorTransform.copyColorTransform(__oldColorTransform);
+1 -1
View File
@@ -1,7 +1,7 @@
package funkin.game;
import flixel.addons.transition.FlxTransitionableState;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.FlxSubState;
import flixel.math.FlxPoint;
import flixel.util.FlxColor;
+6 -6
View File
@@ -208,17 +208,17 @@ class Note extends FlxSprite
setPosition(__strum.x, __strum.y);
rotOffset.x -= pos.x / scale.x;
rotOffset.y -= pos.y / scale.y;
frameOffset.x -= pos.x / scale.x;
frameOffset.y -= pos.y / scale.y;
this.rotOffsetAngle = __noteAngle;
this.frameOffsetAngle = __noteAngle;
super.draw();
this.rotOffsetAngle = 0;
this.frameOffsetAngle = 0;
rotOffset.x += pos.x / scale.x;
rotOffset.y += pos.y / scale.y;
frameOffset.x += pos.x / scale.x;
frameOffset.y += pos.y / scale.y;
setPosition(pos.x, pos.y);
pos.put();
+1 -1
View File
@@ -13,7 +13,7 @@ import funkin.scripting.ScriptPack;
import flixel.FlxSubState;
import flixel.addons.transition.FlxTransitionableState;
import flixel.math.FlxPoint;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.ui.FlxBar;
+14 -2
View File
@@ -10,9 +10,21 @@ import haxe.macro.Expr;
*/
class ScriptsMacro {
public static function addAdditionalClasses() {
for(inc in ["flixel", "away3d", "flx3d", "sys", "DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting"]) {
for(inc in [
// FLIXEL
"flixel.util", "flixel.ui", "flixel.tweens", "flixel.tile", "flixel.text",
"flixel.system", "flixel.sound", "flixel.path", "flixel.math", "flixel.input",
"flixel.group", "flixel.graphics", "flixel.effects", "flixel.animation",
// FLIXEL ADDONS
"flixel.addons.api", "flixel.addons.display", "flixel.addons.effects", "flixel.addons.ui",
"flixel.addons.plugin", "flixel.addons.text", "flixel.addons.tile", "flixel.addons.transition",
"flixel.addons.util",
// OTHER LIBRARIES & STUFF
"away3d", "flx3d", #if sys "sys", #end
// BASE HAXE
"DateTools", "EReg", "Lambda", "StringBuf", "haxe.crypto", "haxe.display", "haxe.exceptions", "haxe.extern", "scripting"
])
Compiler.include(inc);
}
// FOR ABSTRACTS
Compiler.addGlobalMetadata('haxe.xml', '@:build(hscript.UsingHandler.build())');
+1 -1
View File
@@ -7,7 +7,7 @@ import funkin.scripting.Script;
import flixel.FlxSubState;
import flixel.addons.transition.FlxTransitionableState;
import flixel.input.keyboard.FlxKey;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
import flixel.util.FlxColor;
+1 -1
View File
@@ -15,7 +15,7 @@ import flixel.group.FlxGroup;
import flixel.input.gamepad.FlxGamepad;
import flixel.math.FlxPoint;
import flixel.math.FlxRect;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.system.ui.FlxSoundTray;
import flixel.text.FlxText;
import flixel.tweens.FlxTween;
+1 -1
View File
@@ -123,7 +123,7 @@ class Options
public static function applySettings() {
applyKeybinds();
FlxG.game.stage.quality = (FlxG.forceNoAntialiasing = !antialiasing) ? LOW : BEST;
FlxG.game.stage.quality = (FlxG.enableAntialiasing = antialiasing) ? LOW : BEST;
FlxG.autoPause = autoPause;
FlxG.drawFramerate = FlxG.updateFramerate = framerate;
}
+1 -1
View File
@@ -37,7 +37,7 @@ class Script extends FlxBasic implements IFlxDestroyable {
"state" => flixel.FlxG.state,
"FlxEase" => flixel.tweens.FlxEase,
"FlxTween" => flixel.tweens.FlxTween,
"FlxSound" => flixel.system.FlxSound,
"FlxSound" => flixel.sound.FlxSound,
"FlxAssets" => flixel.system.FlxAssets,
"FlxMath" => flixel.math.FlxMath,
"FlxGroup" => flixel.group.FlxGroup,
@@ -1,7 +1,7 @@
package funkin.scripting.events;
import flixel.tweens.FlxTween;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
final class CountdownEvent extends CancellableEvent {
/**
+4 -10
View File
@@ -26,22 +26,16 @@ class FlxAnimate extends flxanimate.FlxAnimate {
getScreenPosition(_point, camera).subtractPoint(offset);
rMatrix.translate(-origin.x, -origin.y);
if (!showPivot && limb.name != "pivot") {
if (rotOffsetAngle != null && rotOffsetAngle != angle)
if (frameOffsetAngle != null && frameOffsetAngle != angle)
{
var angleOff = (-angle + rotOffsetAngle) * FlxAngle.TO_RAD;
var angleOff = (-angle + frameOffsetAngle) * FlxAngle.TO_RAD;
rMatrix.rotate(-angleOff);
if (useOffsetAsRotOffset)
rMatrix.translate(-offset.x, -offset.y);
else
rMatrix.translate(-rotOffset.x, -rotOffset.y);
rMatrix.translate(-frameOffset.x, -frameOffset.y);
rMatrix.rotate(angleOff);
}
else
{
if (useOffsetAsRotOffset)
rMatrix.translate(-offset.x, -offset.y);
else
rMatrix.translate(-rotOffset.x, -rotOffset.y);
rMatrix.translate(-frameOffset.x, -frameOffset.y);
}
rMatrix.scale(scale.x, scale.y);
+2 -2
View File
@@ -184,7 +184,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
animateAtlas.scrollFactor = scrollFactor;
animateAtlas.scale = scale;
animateAtlas.offset = offset;
animateAtlas.rotOffset = rotOffset;
animateAtlas.frameOffset = frameOffset;
animateAtlas.x = x;
animateAtlas.y = y;
animateAtlas.angle = angle;
@@ -277,7 +277,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I
}
var daOffset = getAnimOffset(AnimName);
rotOffset.set(daOffset.x, daOffset.y);
frameOffset.set(daOffset.x, daOffset.y);
daOffset.putWeak();
lastAnimContext = Context;
+2 -41
View File
@@ -62,51 +62,12 @@ class Main extends Sprite
public static var gameThreads:Array<Thread> = [];
#end
public static function main():Void
{
#if windows NativeAPI.setDarkMode(true); #end
Lib.current.addChild(instance = new Main());
}
public function new()
{
super();
#if windows NativeAPI.setDarkMode(true); #end
if (stage != null)
{
init();
}
else
{
addEventListener(Event.ADDED_TO_STAGE, init);
}
}
private function init(?E:Event):Void
{
if (hasEventListener(Event.ADDED_TO_STAGE))
{
removeEventListener(Event.ADDED_TO_STAGE, init);
}
setupGame();
}
private function setupGame():Void
{
var stageWidth:Int = Lib.current.stage.stageWidth;
var stageHeight:Int = Lib.current.stage.stageHeight;
if (zoom == -1)
{
var ratioX:Float = stageWidth / gameWidth;
var ratioY:Float = stageHeight / gameHeight;
zoom = Math.min(ratioX, ratioY);
gameWidth = Math.ceil(stageWidth / zoom);
gameHeight = Math.ceil(stageHeight / zoom);
}
addChild(game = new FunkinGame(gameWidth, gameHeight, MainState, zoom, framerate, framerate, skipSplash, startFullscreen));
addChild(game = new FunkinGame(gameWidth, gameHeight, MainState, framerate, framerate, skipSplash, startFullscreen));
#if !mobile
addChild(framerateSprite = new funkin.system.framerate.Framerate());
-1
View File
@@ -9,7 +9,6 @@ import funkin.scripting.events.*;
import funkin.scripting.Script;
import funkin.interfaces.IBeatReceiver;
import funkin.system.Conductor;
import flixel.addons.ui.FlxUIState;
import funkin.options.PlayerSettings;
class MusicBeatState extends FlxTransitionableState implements IBeatReceiver
+3 -3
View File
@@ -36,9 +36,9 @@ class OptimizedBitmapData extends BitmapData {
readable = true;
this.image = null;
@:privateAccess
if (FlxG.bitmap.__doNotDelete)
MemoryUtil.clearMinor();
// @:privateAccess
// if (FlxG.bitmap.__doNotDelete)
// MemoryUtil.clearMinor();
}
#end
}
@@ -1,7 +1,7 @@
package funkin.system.modules;
import lime.media.AudioManager;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.FlxState;
import funkin.utils.NativeAPI;
+1 -1
View File
@@ -4,7 +4,7 @@ import funkin.shaders.CustomShader;
import funkin.ui.FunkinText;
import funkin.menus.TitleState;
import flixel.math.FlxRect;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.ui.FlxBar;
import funkin.updating.UpdateUtil.UpdateCheckCallback;
+3 -3
View File
@@ -2,9 +2,9 @@ package funkin.utils;
import flixel.tweens.FlxTween;
import flixel.system.frontEnds.SoundFrontEnd;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import funkin.system.Conductor;
import flixel.system.FlxSoundGroup;
import flixel.sound.FlxSoundGroup;
import animateatlas.AtlasFrameMaker;
import haxe.Json;
import funkin.menus.StoryMenuState.WeekData;
@@ -571,7 +571,7 @@ class CoolUtil
spr.acceleration.set();
spr.drag.set();
spr.antialiasing = FlxSprite.defaultAntialiasing;
spr.rotOffset.set();
spr.frameOffset.set();
FlxTween.cancelTweensOf(spr);
}
+1 -1
View File
@@ -2,7 +2,7 @@ package funkin.utils;
import funkin.scripting.events.DiscordPresenceUpdateEvent;
import haxe.Json;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
#if DISCORD_RPC
import discord_rpc.DiscordRpc;
import sys.thread.Thread;
+4 -4
View File
@@ -1,6 +1,6 @@
package funkin.utils;
import flixel.system.FlxSound;
import flixel.sound.FlxSound;
import flixel.util.FlxTimer;
import flixel.tweens.FlxTween;
@@ -32,8 +32,8 @@ class FunkinParentDisabler extends FlxBasic {
FlxTimer.globalManager._timers = [];
// cameras
__cameras = [for(c in FlxG.cameras.list) if (c.followActive) c];
for(c in __cameras) c.followActive = false;
__cameras = [for(c in FlxG.cameras.list) if (c.followEnabled) c];
for(c in __cameras) c.followEnabled = false;
// sounds
__sounds = [for(s in FlxG.sound.list) if (s.playing) s];
@@ -54,7 +54,7 @@ class FunkinParentDisabler extends FlxBasic {
for(t in __tweens) FlxTween.globalManager._tweens.push(t);
for(t in __timers) FlxTimer.globalManager._timers.push(t);
}
for(c in __cameras) c.followActive = true;
for(c in __cameras) c.followEnabled = true;
for(s in __sounds) s.play();
}
}
+1 -1
View File
@@ -105,7 +105,7 @@ class HiddenProcess {
}
public function exitCode(block:Bool = true):Null<Int> {
return NativeProcess.process_exit(p);
return NativeProcess.process_exit(p #if (haxe >= "4.3.0"), block #end);
}
public function close():Void {