From b1a7b28c14c2e11f0b522fc2cc83f94b6fc688f4 Mon Sep 17 00:00:00 2001 From: Yoshman29 <81191621+YoshiCrafter29@users.noreply.github.com> Date: Sat, 3 Dec 2022 23:24:45 +0100 Subject: [PATCH] Revert "tried optimization thing but it didnt worked lol" This reverts commit e51b618baa0e842af19a750d911709286778b0e8. --- .gitignore | 3 +- buildnumber.txt | 2 +- source/funkin/editors/CharacterEditor.hx | 2 +- source/funkin/mods/ModsFolderLibrary.hx | 21 +---------- source/funkin/mods/PngBinHandler.hx | 47 ------------------------ source/funkin/options/Options.hx | 1 - 6 files changed, 5 insertions(+), 71 deletions(-) delete mode 100644 source/funkin/mods/PngBinHandler.hx diff --git a/.gitignore b/.gitignore index b77db02a..8f54cb6b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ export/ latest/windows/obj/ latest/windows/haxe/ -.vscode/ -**.png.bin \ No newline at end of file +.vscode/ \ No newline at end of file diff --git a/buildnumber.txt b/buildnumber.txt index c197cc7a..8fad7c29 100644 --- a/buildnumber.txt +++ b/buildnumber.txt @@ -1 +1 @@ -1369 \ No newline at end of file +1354 \ No newline at end of file diff --git a/source/funkin/editors/CharacterEditor.hx b/source/funkin/editors/CharacterEditor.hx index 87c5655a..faa5d8d2 100644 --- a/source/funkin/editors/CharacterEditor.hx +++ b/source/funkin/editors/CharacterEditor.hx @@ -20,7 +20,7 @@ class CharacterEditor extends MusicBeatState { public override function create() { super.create(); - add(new Stage("stage")); + add(new Stage("default")); character = new Character(770, 100, characterName, true); characterName = character.curCharacter; diff --git a/source/funkin/mods/ModsFolderLibrary.hx b/source/funkin/mods/ModsFolderLibrary.hx index dfe89cd2..d483d01d 100644 --- a/source/funkin/mods/ModsFolderLibrary.hx +++ b/source/funkin/mods/ModsFolderLibrary.hx @@ -1,7 +1,5 @@ package funkin.mods; -import funkin.options.Options; -import lime.graphics.ImageBuffer; import lime.utils.Log; import lime.utils.AssetLibrary; import lime.utils.Assets as LimeAssets; @@ -98,23 +96,8 @@ class ModsFolderLibrary extends AssetLibrary implements ModsAssetLibrary { var path = getAssetPath(); editedTimes[id] = FileSystem.stat(path).mtime.getTime(); - var buffer:ImageBuffer = null; - var image:Image; - if (Options.enablePngBins) { - if (PngBinHandler.exists(path)) { - buffer = PngBinHandler.loadBinPng(path); - @:privateAccess - image = new Image(buffer); - } else { - @:privateAccess - image = Image.fromFile(path); - PngBinHandler.saveBinPng(image.buffer, path); - } - } else { - @:privateAccess - image = Image.fromFile(path); - } - return image; + var e = Image.fromFile(path); + return e; } } diff --git a/source/funkin/mods/PngBinHandler.hx b/source/funkin/mods/PngBinHandler.hx deleted file mode 100644 index 257f1fcc..00000000 --- a/source/funkin/mods/PngBinHandler.hx +++ /dev/null @@ -1,47 +0,0 @@ -package funkin.mods; - -import sys.FileSystem; -import lime.utils.UInt8Array; -import lime.graphics.ImageBuffer; -import openfl.utils.ByteArray; -import openfl.utils.Assets; -import sys.io.File; - -class PngBinHandler { - public static function loadBinPng(path:String) { - #if sys - var bytes = File.getBytes('$path.bin'); - - var width:Int = bytes.getInt32(0); - var height:Int = bytes.getInt32(4); - var bitsPerPixel:Int = bytes.getUInt16(8); - var pixelFormat:Int = bytes.getUInt16(10); - - var imageBuffer = new ImageBuffer(UInt8Array.fromBytes(bytes, 12), width, height, bitsPerPixel, pixelFormat); - - return imageBuffer; - #else - return null; - #end - } - - public static function saveBinPng(buffer:ImageBuffer, path:String) { - #if sys - var array = new ByteArrayData(buffer.data.length + 12); - array.writeInt(buffer.width); - array.writeInt(buffer.height); - array.writeShort(buffer.bitsPerPixel); - array.writeShort(buffer.format); - array.writeBytes(buffer.data.toBytes()); - File.saveBytes('$path.bin', array); - #end - } - - public static function exists(path:String) { - #if sys - return FileSystem.exists('$path.bin'); - #else - return false; - #end - } -} \ No newline at end of file diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 856fbe1d..f67f479a 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -21,7 +21,6 @@ class Options public static var fpsCounter:Bool = true; public static var autoPause:Bool = true; public static var antialiasing:Bool = true; - public static var enablePngBins:Bool = true; // optimization feature kinda which takes space on your computer! public static var volume:Float = 1; /**