From 709702990739a9a9f9805fd37dfc4bdc3e16f136 Mon Sep 17 00:00:00 2001 From: ItsLJcool Date: Thu, 30 Oct 2025 11:42:46 -0700 Subject: [PATCH 1/3] testing shit --- flixel/system/FlxAssets.hx | 11 ++++++++++- include.xml | 2 ++ tests/unit/src/FlxAssert.hx | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/flixel/system/FlxAssets.hx b/flixel/system/FlxAssets.hx index a30cfc4a74..db438ad778 100644 --- a/flixel/system/FlxAssets.hx +++ b/flixel/system/FlxAssets.hx @@ -19,6 +19,7 @@ import haxe.Json; import haxe.xml.Access; import openfl.Assets; import openfl.utils.ByteArray; +import webp.WebP; using StringTools; @@ -260,7 +261,15 @@ class FlxAssets public static inline function getBitmapData(id:String):BitmapData { if (Assets.exists(id)) - return Assets.getBitmapData(id, false); + { + switch (Path.extension(id)) + { + case 'webp': + return WebP.getBitmapData(id, true); + default: + return Assets.getBitmapData(id, false); + } + } FlxG.log.error('Could not find a BitmapData asset with ID \'$id\'.'); return null; } diff --git a/include.xml b/include.xml index 652ec226db..616cdaf516 100644 --- a/include.xml +++ b/include.xml @@ -21,6 +21,8 @@ + + diff --git a/tests/unit/src/FlxAssert.hx b/tests/unit/src/FlxAssert.hx index 136ceaee2e..507e3565ce 100644 --- a/tests/unit/src/FlxAssert.hx +++ b/tests/unit/src/FlxAssert.hx @@ -23,7 +23,7 @@ class FlxAssert && areNearHelper(expected.y, actual.y, margin) && areNearHelper(expected.width, actual.width, margin) && areNearHelper(expected.height, actual.height, margin); - + if (areNear) Assert.assertionCount++; else From 8b39d13a89257e3ecee25e02d64f9f287fffe789 Mon Sep 17 00:00:00 2001 From: ItsLJcool Date: Thu, 30 Oct 2025 12:45:58 -0700 Subject: [PATCH 2/3] peak --- flixel/system/FlxAssets.hx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flixel/system/FlxAssets.hx b/flixel/system/FlxAssets.hx index db438ad778..3277fd0d9e 100644 --- a/flixel/system/FlxAssets.hx +++ b/flixel/system/FlxAssets.hx @@ -20,6 +20,7 @@ import haxe.xml.Access; import openfl.Assets; import openfl.utils.ByteArray; import webp.WebP; +import haxe.io.Path; using StringTools; @@ -265,7 +266,7 @@ class FlxAssets switch (Path.extension(id)) { case 'webp': - return WebP.getBitmapData(id, true); + return WebP.getBitmapDataFromBytes(Assets.getBytes(id)); // WebP.getBitmapData(id); is broken as of rn default: return Assets.getBitmapData(id, false); } From f724823ab86b9a09b9a78b318b79e232c1fd5532 Mon Sep 17 00:00:00 2001 From: ItsLJcool Date: Thu, 30 Oct 2025 13:36:47 -0700 Subject: [PATCH 3/3] fixes --- flixel/system/FlxAssets.hx | 6 +++++- include.xml | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/flixel/system/FlxAssets.hx b/flixel/system/FlxAssets.hx index 3277fd0d9e..3c0bba835c 100644 --- a/flixel/system/FlxAssets.hx +++ b/flixel/system/FlxAssets.hx @@ -19,8 +19,10 @@ import haxe.Json; import haxe.xml.Access; import openfl.Assets; import openfl.utils.ByteArray; -import webp.WebP; import haxe.io.Path; +#if hxWebP +import webp.WebP; +#end using StringTools; @@ -265,8 +267,10 @@ class FlxAssets { switch (Path.extension(id)) { + #if hxWebP case 'webp': return WebP.getBitmapDataFromBytes(Assets.getBytes(id)); // WebP.getBitmapData(id); is broken as of rn + #end default: return Assets.getBitmapData(id, false); } diff --git a/include.xml b/include.xml index 616cdaf516..b99220d984 100644 --- a/include.xml +++ b/include.xml @@ -21,8 +21,8 @@ - - + +