From 7e1db2f4c6dd5a0a451a6d9b5bc81503e224aad4 Mon Sep 17 00:00:00 2001 From: NeeEoo Date: Sun, 11 Feb 2024 20:22:33 +0100 Subject: [PATCH] Fixed bug + optimization --- .../funkin/backend/scripting/events/GameOverCreationEvent.hx | 2 +- source/funkin/backend/utils/BitmapUtil.hx | 4 ++-- source/funkin/backend/utils/CoolUtil.hx | 2 +- source/funkin/game/GameOverSubstate.hx | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/funkin/backend/scripting/events/GameOverCreationEvent.hx b/source/funkin/backend/scripting/events/GameOverCreationEvent.hx index 8536e16e..bb9b04c0 100644 --- a/source/funkin/backend/scripting/events/GameOverCreationEvent.hx +++ b/source/funkin/backend/scripting/events/GameOverCreationEvent.hx @@ -16,7 +16,7 @@ final class GameOverCreationEvent extends CancellableEvent public var gameOverSong:String; - public var bpm:Int; + public var bpm:Float; public var lossSFX:String; diff --git a/source/funkin/backend/utils/BitmapUtil.hx b/source/funkin/backend/utils/BitmapUtil.hx index 298b4843..367d0123 100644 --- a/source/funkin/backend/utils/BitmapUtil.hx +++ b/source/funkin/backend/utils/BitmapUtil.hx @@ -19,7 +19,7 @@ class BitmapUtil { for(x in 0...bmap.width) { color = bmap.getPixel32(x, y); fixedColor = 0xFF000000 + (color % 0x1000000); - if (colorMap[fixedColor] == null) + if (!colorMap.exists(fixedColor)) colorMap[fixedColor] = 0; colorMap[fixedColor] += color.alphaFloat; } @@ -50,7 +50,7 @@ class BitmapUtil { for(x in 0...bmap.width) { color = bmap.getPixel32(x, y); fixedColor = 0xFF000000 + (color % 0x1000000); - if (colorMap[fixedColor] == null) + if (!colorMap.exists(fixedColor)) colorMap[fixedColor] = 0; colorMap[fixedColor] += color.alphaFloat * 0.33 + (0.67 * (color.saturation * (2 * (color.lightness > 0.5 ? 0.5 - (color.lightness) : color.lightness)))); } diff --git a/source/funkin/backend/utils/CoolUtil.hx b/source/funkin/backend/utils/CoolUtil.hx index 01c7f309..d73304c1 100644 --- a/source/funkin/backend/utils/CoolUtil.hx +++ b/source/funkin/backend/utils/CoolUtil.hx @@ -618,7 +618,7 @@ class CoolUtil frontEnd.music = music; } - public static inline function flxeaseFromString(mainEase:String, suffix:String) + @:noUsing public static inline function flxeaseFromString(mainEase:String, suffix:String) return Reflect.field(FlxEase, mainEase + (mainEase == "linear" ? "" : suffix)); } diff --git a/source/funkin/game/GameOverSubstate.hx b/source/funkin/game/GameOverSubstate.hx index b2f7636f..c7d6c44e 100644 --- a/source/funkin/game/GameOverSubstate.hx +++ b/source/funkin/game/GameOverSubstate.hx @@ -20,7 +20,7 @@ class GameOverSubstate extends MusicBeatSubstate public var characterName:String; public var gameOverSong:String; - public var gameOverSongBPM:Int; + public var gameOverSongBPM:Float; public var lossSFXName:String; public var retrySFX:String; public var player:Bool;