From dd4e8962d85bc9c65923418b576d622bdaf01bbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Tue, 10 Sep 2024 22:59:45 +0200 Subject: [PATCH 1/4] better default forced FINALLY i had the best idea to fix this shit --- source/funkin/backend/FunkinSprite.hx | 2 +- source/funkin/backend/utils/XMLUtil.hx | 21 ++++++++++++--------- source/funkin/game/Character.hx | 1 + 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/source/funkin/backend/FunkinSprite.hx b/source/funkin/backend/FunkinSprite.hx index 23304ce7..21a35962 100644 --- a/source/funkin/backend/FunkinSprite.hx +++ b/source/funkin/backend/FunkinSprite.hx @@ -133,7 +133,7 @@ class FunkinSprite extends FlxSkewedSprite implements IBeatReceiver implements I // TODO: find a solution without countedBeat var anim = beatAnims[FlxMath.wrap(countedBeat++, 0, beatAnims.length - 1)]; if (anim.name != null && anim.name != "null" && anim.name != "none") - playAnim(anim.name); + playAnim(anim.name, anim.forced); } } diff --git a/source/funkin/backend/utils/XMLUtil.hx b/source/funkin/backend/utils/XMLUtil.hx index 880cd96c..6143cf9d 100644 --- a/source/funkin/backend/utils/XMLUtil.hx +++ b/source/funkin/backend/utils/XMLUtil.hx @@ -1,6 +1,7 @@ package funkin.backend.utils; import funkin.backend.FunkinSprite; +import funkin.game.Character; import funkin.backend.system.ErrorCode; import funkin.backend.FunkinSprite.XMLAnimType; import flixel.util.FlxColor; @@ -170,8 +171,7 @@ class XMLUtil { animType: spr.spriteAnimType, x: 0, y: 0, - indices: [for(i in 0...spr.frames.frames.length) i], - forced: (node.has.forced && node.att.forced == "true") || (!node.has.forced && spr.spriteAnimType == BEAT) + indices: [for(i in 0...spr.frames.frames.length) i] }); } } @@ -188,7 +188,7 @@ class XMLUtil { return loadSpriteFromXML(Type.createInstance(cl, args), node, parentFolder, defaultAnimType); } - public static function extractAnimFromXML(anim:Access, animType:XMLAnimType = NONE, loop:Bool = false):AnimData { + public static function extractAnimFromXML(anim:Access, animType:XMLAnimType = NONE, loop:Bool = false, ?sprite:FunkinSprite):AnimData { var animData:AnimData = { name: null, anim: null, @@ -197,8 +197,7 @@ class XMLUtil { animType: animType, x: 0, y: 0, - indices: [], - forced: false, + indices: [] }; if (anim.has.name) animData.name = anim.att.name; @@ -254,24 +253,28 @@ class XMLUtil { if (sprite is FunkinSprite) { var xmlSpr = cast(sprite, FunkinSprite); + var name = animData.name; switch(animData.animType) { case BEAT: xmlSpr.beatAnims.push({ - name: animData.name, - forced: animData.forced.getDefault(false) + name: name, + forced: animData.forced.getDefault(defaultForcedCheck(name, xmlSpr)) }); case LOOP: - xmlSpr.animation.play(animData.name, animData.forced.getDefault(false)); + xmlSpr.animation.play(name, animData.forced.getDefault(defaultForcedCheck(name, xmlSpr))); default: // nothing } - xmlSpr.animDatas.set(animData.name, animData); + xmlSpr.animDatas.set(name, animData); } return OK; } return MISSING_PROPERTY; } + public static inline function defaultForcedCheck(animName:String, sprite:FunkinSprite):Bool + return sprite is Character && (animName.startsWith("idle") || animName.startsWith("danceLeft") || animName.startsWith("danceRight")) ? false : sprite.spriteAnimType == BEAT; + public static inline function fixXMLText(text:String) { var v:String; return [for(l in text.split("\n")) if ((v = l.trim()) != "") v].join("\n"); diff --git a/source/funkin/game/Character.hx b/source/funkin/game/Character.hx index c3fa20cc..ac13c820 100644 --- a/source/funkin/game/Character.hx +++ b/source/funkin/game/Character.hx @@ -283,6 +283,7 @@ class Character extends FunkinSprite implements IBeatReceiver implements IOffset public inline function buildCharacter(xml:Access) { this.xml = xml; // Modders wassup :D sprite = curCharacter; + spriteAnimType = BEAT; if (xml.x.exists("isPlayer")) playerOffsets = (xml.x.get("isPlayer") == "true"); if (xml.x.exists("x")) globalOffset.x = Std.parseFloat(xml.x.get("x")); From f281cc6ee4d213ecd037ddd327e65568c3efbcb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Tue, 10 Sep 2024 23:11:39 +0200 Subject: [PATCH 2/4] forgor to remove this --- source/funkin/backend/utils/XMLUtil.hx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/funkin/backend/utils/XMLUtil.hx b/source/funkin/backend/utils/XMLUtil.hx index 6143cf9d..dc39244d 100644 --- a/source/funkin/backend/utils/XMLUtil.hx +++ b/source/funkin/backend/utils/XMLUtil.hx @@ -188,7 +188,7 @@ class XMLUtil { return loadSpriteFromXML(Type.createInstance(cl, args), node, parentFolder, defaultAnimType); } - public static function extractAnimFromXML(anim:Access, animType:XMLAnimType = NONE, loop:Bool = false, ?sprite:FunkinSprite):AnimData { + public static function extractAnimFromXML(anim:Access, animType:XMLAnimType = NONE, loop:Bool = false):AnimData { var animData:AnimData = { name: null, anim: null, From dec2a126390faa60f3b458bfdaff312eb9ea355b Mon Sep 17 00:00:00 2001 From: Lily Date: Fri, 13 Sep 2024 23:08:28 +0300 Subject: [PATCH 3/4] fix for gles (#381) * fix for gles * Fix formatting --------- Co-authored-by: Ne_Eo --- assets/shaders/engine/editorBlur.frag | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/assets/shaders/engine/editorBlur.frag b/assets/shaders/engine/editorBlur.frag index ffcbc755..147aada3 100644 --- a/assets/shaders/engine/editorBlur.frag +++ b/assets/shaders/engine/editorBlur.frag @@ -21,17 +21,17 @@ void main() { return; vec4 color = getColor(camPos); - float fsteps = steps; - for(float inside = 1.0; inside < stepsInside+1.0; inside++) { + float fsteps = float(steps); + for(float inside = 1.0; inside < float(stepsInside)+1.0; inside++) { for(int i = 0; i < steps; i++) { - float fi = i; + float fi = float(i); color += getColor(camPos + vec2( - strength * (inside / stepsInside) * cos(fi / fsteps * (PI * 2.0)), - strength * (inside / stepsInside) * sin(fi / fsteps * (PI * 2.0)) + strength * (inside / float(stepsInside)) * cos(fi / fsteps * (PI * 2.0)), + strength * (inside / float(stepsInside)) * sin(fi / fsteps * (PI * 2.0)) )); } } - color /= steps * stepsInside; + color /= vec4(steps * stepsInside); gl_FragColor = color; -} \ No newline at end of file +} From fabdeb3fa11c7ae902ef8a90b7a2ecbd90c5037a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=8D=9A=7ENex?= <87421482+NexIsDumb@users.noreply.github.com> Date: Fri, 13 Sep 2024 22:31:17 +0200 Subject: [PATCH 4/4] fixing actions + `HXCPP_CATCH_SEGV` credits to @mcagabe19 for the hxcpp suggestion! --- .github/workflows/linux.yml | 4 ++-- .github/workflows/macos.yml | 4 ++-- .github/workflows/windows.yml | 4 ++-- project.xml | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4e742b35..63a036bb 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -38,12 +38,12 @@ jobs: - name: Tar files run: tar -zcvf CodenameEngine.tar.gz -C export/release/linux/bin . - name: Uploading artifact (entire build) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Codename Engine path: CodenameEngine.tar.gz # - name: Uploading artifact (executable) - # uses: actions/upload-artifact@v2 + # uses: actions/upload-artifact@v4 # with: # name: Update-Linux # path: export/release/linux/bin/CodenameEngine diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3dd28814..fa75491a 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -35,12 +35,12 @@ jobs: - name: Tar files run: tar -zcvf CodenameEngine.tar.gz -C export/release/macos/bin . - name: Uploading artifact (entire build) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Codename Engine path: CodenameEngine.tar.gz # - name: Uploading artifact (executable) - # uses: actions/upload-artifact@v2 + # uses: actions/upload-artifact@v4 # with: # name: Update-Mac # path: export/release/macos/bin/CodenameEngine diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d89c1687..702bedc5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,12 +33,12 @@ jobs: run: | haxelib run lime build windows - name: Uploading artifact (entire build) - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Codename Engine path: export/release/windows/bin # - name: Uploading artifact (executable) - # uses: actions/upload-artifact@v2 + # uses: actions/upload-artifact@v4 # with: # name: Update-Windows # path: export/release/windows/bin/CodenameEngine.exe diff --git a/project.xml b/project.xml index 77ae6af6..9b396fa7 100644 --- a/project.xml +++ b/project.xml @@ -195,6 +195,7 @@ +