Removed flxanimate entirely + Fixed transition + Fixed offsets
This commit is contained in:
+1
-2
@@ -14,7 +14,6 @@
|
||||
|
||||
<!-- Other Libraries -->
|
||||
<git name="hscript-improved" url="https://github.com/CodenameCrew/hscript-improved" ref="codename-dev" />
|
||||
<git name="flxanimate" url="https://github.com/CodenameCrew/cne-flxanimate" />
|
||||
<git name="hxdiscord_rpc" url="https://github.com/CodenameCrew/cne-hxdiscord_rpc" skipDeps="true" />
|
||||
<lib name="funkin-modchart" version="1.2.4" skipDeps="true" />
|
||||
<lib name="hxvlc" version="1.9.3" skipDeps="true" />
|
||||
@@ -33,7 +32,7 @@
|
||||
|
||||
<git name="hxcpp" url="https://github.com/CodenameCrew/cne-hxcpp" />
|
||||
|
||||
<git name="flixel-animate" url="https://github.com/MaybeMaru/flixel-animate/" ref="flixel-5.3.0" skipDeps="true"/>
|
||||
<git name="flixel-animate" url="https://github.com/MaybeMaru/flixel-animate/" skipDeps="true"/>
|
||||
</if>
|
||||
|
||||
<!-- Hxcpp Building -->
|
||||
|
||||
@@ -130,7 +130,6 @@
|
||||
<haxelib name="hxvlc" if="VIDEO_CUTSCENES" />
|
||||
<haxelib name="away3d" if="THREE_D_SUPPORT" />
|
||||
<haxelib name="format" />
|
||||
<haxelib name="flxanimate" />
|
||||
<haxelib name="flixel-animate" />
|
||||
<haxelib name="nape-haxe4" if="NAPE_ENABLED"/>
|
||||
|
||||
|
||||
@@ -16,6 +16,8 @@ import funkin.backend.utils.XMLUtil.AnimData;
|
||||
import funkin.backend.utils.XMLUtil.BeatAnim;
|
||||
import funkin.backend.utils.XMLUtil.IXMLEvents;
|
||||
import haxe.io.Path;
|
||||
import flixel.graphics.frames.FlxFrame;
|
||||
import flixel.math.FlxAngle;
|
||||
|
||||
enum abstract XMLAnimType(Int)
|
||||
{
|
||||
@@ -373,4 +375,46 @@ class FunkinSprite extends FlxAnimate implements IBeatReceiver implements IOffse
|
||||
animation.curAnim.curFrame = val;
|
||||
return val;
|
||||
}
|
||||
|
||||
override function drawComplex(camera:FlxCamera):Void
|
||||
{
|
||||
#if (flixel < "6.1.0") final frame = this._frame; #end
|
||||
final matrix = this._matrix; // TODO: Just use local?
|
||||
|
||||
frame.prepareMatrix(matrix, FlxFrameAngle.ANGLE_0, checkFlipX() != camera.flipX, checkFlipY() != camera.flipY);
|
||||
matrix.translate(-origin.x, -origin.y);
|
||||
|
||||
if (frameOffsetAngle != null && frameOffsetAngle != angle)
|
||||
{
|
||||
var angleOff = (frameOffsetAngle - angle) * FlxAngle.TO_RAD;
|
||||
var cos = Math.cos(angleOff);
|
||||
var sin = Math.sin(angleOff);
|
||||
// cos doesnt need to be negated
|
||||
_matrix.rotateWithTrig(cos, -sin);
|
||||
_matrix.translate(-frameOffset.x, -frameOffset.y);
|
||||
_matrix.rotateWithTrig(cos, sin);
|
||||
}
|
||||
else
|
||||
_matrix.translate(-frameOffset.x, -frameOffset.y);
|
||||
|
||||
matrix.scale(scale.x, scale.y);
|
||||
if (bakedRotationAngle <= 0)
|
||||
{
|
||||
updateTrig();
|
||||
if (angle != 0)
|
||||
matrix.rotateWithTrig(_cosAngle, _sinAngle);
|
||||
}
|
||||
if (skew.x != 0 || skew.y != 0)
|
||||
{
|
||||
updateSkew();
|
||||
_matrix.concat(FlxAnimate._skewMatrix);
|
||||
}
|
||||
getScreenPosition(_point, camera);
|
||||
_point.x += origin.x - offset.x;
|
||||
_point.y += origin.y - offset.y;
|
||||
matrix.translate(_point.x, _point.y);
|
||||
if (isPixelPerfectRender(camera))
|
||||
preparePixelPerfectMatrix(matrix);
|
||||
camera.drawPixels(frame, framePixels, matrix, colorTransform, blend, antialiasing, shader);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ import flixel.util.FlxAxes;
|
||||
import flixel.util.FlxColor;
|
||||
import flixel.util.typeLimit.OneOfThree;
|
||||
import flixel.util.typeLimit.OneOfTwo;
|
||||
import flxanimate.data.AnimationData.AnimAtlas;
|
||||
import funkin.backend.system.Conductor;
|
||||
import funkin.backend.utils.XMLUtil.TextFormat;
|
||||
import haxe.CallStack;
|
||||
@@ -34,6 +33,7 @@ import haxe.xml.Access;
|
||||
import lime.utils.Assets;
|
||||
import openfl.display.BitmapData;
|
||||
import openfl.geom.ColorTransform;
|
||||
import animate.FlxAnimateJson;
|
||||
|
||||
using StringTools;
|
||||
|
||||
@@ -1252,13 +1252,13 @@ final class CoolUtil
|
||||
return animsList;
|
||||
}
|
||||
|
||||
public static function getAnimsListFromAtlas(atlas:AnimAtlas):Array<String> {
|
||||
public static function getAnimsListFromAtlas(atlas:AnimationJson):Array<String> {
|
||||
if (atlas == null) return [];
|
||||
|
||||
var animsList:Array<String> = [];
|
||||
if (atlas.AN.SN != null) animsList.push(atlas.AN.SN);
|
||||
if (atlas.SD != null)
|
||||
for (symbol in atlas.SD.S)
|
||||
for (symbol in atlas.SD)
|
||||
if (symbol.SN != null) animsList.push(symbol.SN);
|
||||
|
||||
return animsList;
|
||||
|
||||
@@ -2,12 +2,6 @@ package funkin.editors.character;
|
||||
|
||||
import flixel.text.FlxText.FlxTextFormat;
|
||||
import flixel.text.FlxText.FlxTextFormatMarkerPair;
|
||||
import flxanimate.animate.FlxAnim.FlxSymbolAnimation;
|
||||
import flxanimate.animate.FlxSymbol;
|
||||
import flxanimate.animate.FlxElement;
|
||||
import flxanimate.animate.SymbolParameters;
|
||||
import flxanimate.animate.FlxKeyFrame;
|
||||
import flxanimate.animate.FlxTimeline;
|
||||
import flixel.graphics.frames.FlxFrame;
|
||||
import flixel.animation.FlxAnimation;
|
||||
import openfl.geom.Rectangle;
|
||||
|
||||
@@ -3,7 +3,6 @@ package funkin.editors.ui;
|
||||
import flixel.util.typeLimit.OneOfTwo;
|
||||
import flixel.text.FlxText.FlxTextFormat;
|
||||
import flixel.text.FlxText.FlxTextFormatMarkerPair;
|
||||
import flxanimate.data.SpriteMapData.AnimateAtlas;
|
||||
import flixel.graphics.frames.FlxFramesCollection;
|
||||
import haxe.Json;
|
||||
import haxe.io.Bytes;
|
||||
@@ -11,6 +10,7 @@ import haxe.io.Path;
|
||||
import openfl.display.BitmapData;
|
||||
import sys.FileSystem;
|
||||
import sys.io.File;
|
||||
import animate.FlxAnimateJson;
|
||||
|
||||
using StringTools;
|
||||
using funkin.backend.utils.BitmapUtil;
|
||||
@@ -122,7 +122,7 @@ class UIImageExplorer extends UIFileExplorer {
|
||||
for(file in files) {
|
||||
if(SPRITEMAP_JSON_REGEX.match(file)) {
|
||||
var content:String = CoolUtil.removeBOM(File.getContent(Path.join([directoryPath, file])));
|
||||
var json:AnimateAtlas = Json.parse(content);
|
||||
var json:SpritemapJson = Json.parse(content);
|
||||
if(json.meta.image.toLowerCase() == fileName.toLowerCase())
|
||||
foundSpritemapJson = true;
|
||||
} else if(file == "Animation.json")
|
||||
@@ -147,7 +147,7 @@ class UIImageExplorer extends UIFileExplorer {
|
||||
spritemaps.sort(Reflect.compare);
|
||||
for(spritemap in spritemaps) {
|
||||
var content:String = CoolUtil.removeBOM(File.getContent(Path.join([directoryPath, spritemap])));
|
||||
var json:AnimateAtlas = Json.parse(content);
|
||||
var json:SpritemapJson = Json.parse(content);
|
||||
var imageToFind:String = json.meta.image.toLowerCase();
|
||||
for(file in files) {
|
||||
// lowercase since windows does case insensitive stuff, so we use lowercase to match behavior on mac and linux
|
||||
|
||||
Reference in New Issue
Block a user