Skip to content

Commit 0953b97

Browse files
MAJigsaw77Hundrec
authored andcommitted
Make BitmapData.fromBytes calls use hardware
1 parent 8a12a6f commit 0953b97

7 files changed

Lines changed: 11 additions & 11 deletions

File tree

source/funkin/ui/debug/stageeditor/components/NewObjDialog.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class NewObjDialog extends Dialog
6060
if (data != null)
6161
{
6262
var file:StageEditorAssetFile = stageEditorState.createFile(bitmapName, data);
63-
spr.loadGraphic(BitmapData.fromBytes(file.data));
63+
spr.loadGraphic(BitmapData.fromBytes(file.data, true));
6464

6565
spr.usedFiles.push(file);
6666
}

source/funkin/ui/debug/stageeditor/components/TextureAtlasSettingsDialog.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class TextureAtlasSettingsDialog extends Dialog
6565

6666
@:privateAccess
6767
var spritemaps:Array<SpritemapInput> = [for (i in 0...Std.int(spritemapFiles.length / 2)) {
68-
source: BitmapData.fromBytes(spritemapFiles[i * 2].data),
68+
source: BitmapData.fromBytes(spritemapFiles[i * 2].data, true),
6969
json: SerializerUtil.sanitizeJSON(spritemapFiles[i * 2 + 1].data.toString())
7070
}];
7171

source/funkin/ui/debug/stageeditor/handlers/AssetDataHandler.hx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class AssetDataHandler
9494

9595
if (spritesheet != null && frameData != null)
9696
{
97-
object.frames = FlxAtlasFrames.fromSparrow(BitmapData.fromBytes(spritesheet.data), frameData.data.toString());
97+
object.frames = FlxAtlasFrames.fromSparrow(BitmapData.fromBytes(spritesheet.data, true), frameData.data.toString());
9898
}
9999

100100
case 'packer':
@@ -103,7 +103,7 @@ class AssetDataHandler
103103

104104
if (spritesheet != null && frameData != null)
105105
{
106-
object.frames = FlxAtlasFrames.fromSpriteSheetPacker(BitmapData.fromBytes(spritesheet.data), frameData.data.toString());
106+
object.frames = FlxAtlasFrames.fromSpriteSheetPacker(BitmapData.fromBytes(spritesheet.data, true), frameData.data.toString());
107107
}
108108

109109
case 'animateatlas':
@@ -115,7 +115,7 @@ class AssetDataHandler
115115
{
116116
var name:String = '/spritemap${i + 1}';
117117
spritemaps.push({
118-
source: BitmapData.fromBytes(data.neededFiles.find(f -> f.name.endsWith('$name.png'))?.data),
118+
source: BitmapData.fromBytes(data.neededFiles.find(f -> f.name.endsWith('$name.png'))?.data, true),
119119
json: data.neededFiles.find(f -> f.name.endsWith('$name.json'))?.data?.toString() ?? ''
120120
});
121121
}
@@ -143,7 +143,7 @@ class AssetDataHandler
143143
object.color = FlxColor.fromString(data.assetPath);
144144
}
145145
else
146-
object.loadGraphic(BitmapData.fromBytes(data.neededFiles[0].data));
146+
object.loadGraphic(BitmapData.fromBytes(data.neededFiles[0].data, true));
147147

148148
object.usedFiles = data.neededFiles;
149149

source/funkin/ui/debug/stageeditor/toolboxes/StageEditorObjectGraphicToolbox.hx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class StageEditorObjectGraphicToolbox extends StageEditorDefaultToolbox
5757
objImage.resource = imageInfo.data;
5858

5959
var file:StageEditorAssetFile = state.createFile(selectedFile.name, selectedFile.bytes);
60-
linkedObj.loadGraphic(BitmapData.fromBytes(file.data));
60+
linkedObj.loadGraphic(BitmapData.fromBytes(file.data, true));
6161
linkedObj.updateHitbox();
6262

6363
linkedObj.usedFiles.push(file);
@@ -79,7 +79,7 @@ class StageEditorObjectGraphicToolbox extends StageEditorDefaultToolbox
7979
state.createURLDialog(function(bytes:lime.utils.Bytes)
8080
{
8181
var file:StageEditorAssetFile = state.createFile('${linkedObj.name}.png', bytes);
82-
linkedObj.loadGraphic(BitmapData.fromBytes(file.data));
82+
linkedObj.loadGraphic(BitmapData.fromBytes(file.data, true));
8383
linkedObj.updateHitbox();
8484

8585
linkedObj.usedFiles.push(file);

source/funkin/ui/modmenu/ModMenuInstallPopup.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ class ModMenuInstallPopup extends FunkinSpriteGroup
220220
}
221221
else
222222
{
223-
modIcon.loadGraphic(openfl.display.BitmapData.fromBytes(bytes));
223+
modIcon.loadGraphic(openfl.display.BitmapData.fromBytes(bytes, true));
224224
}
225225

226226
modIcon.antialiasing = true;

source/funkin/ui/modmenu/ModMenuItem.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ class ModMenuItem extends FunkinSpriteGroup
275275
}
276276
else
277277
{
278-
modIcon.loadGraphic(openfl.display.BitmapData.fromBytes(mod.icon));
278+
modIcon.loadGraphic(openfl.display.BitmapData.fromBytes(mod.icon, true));
279279
}
280280

281281
modIcon.scrollFactor.set();

source/funkin/ui/transition/preload/FunkinPreloader.hx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,7 +478,7 @@ class FunkinPreloader extends FlxBasePreloader
478478

479479
if (lime.graphics.Image.__isWebP(mod.icon)) continue;
480480

481-
FunkinAssetCache.instance.permaCacheFlxGraphic(mod.id, openfl.display.BitmapData.fromImage(lime.graphics.Image.fromBytes(mod.icon)));
481+
FunkinAssetCache.instance.permaCacheFlxGraphic(mod.id, openfl.display.BitmapData.fromBytes(mod.icon, true));
482482
}
483483

484484
var assetsToCache:Array<AssetPath> = Assets.queryPreloadAssets(IMAGE);

0 commit comments

Comments
 (0)