From a2c7da7863c3bac215f49f746c99256cd87ce200 Mon Sep 17 00:00:00 2001 From: Lily Date: Thu, 21 Nov 2024 23:39:31 +0300 Subject: [PATCH] remove wide screen --- source/funkin/backend/system/Main.hx | 3 - source/funkin/options/Options.hx | 1 - .../options/categories/MobileOptions.hx | 6 -- .../backend/system/MobileRatioScaleMode.hx | 79 ------------------- 4 files changed, 89 deletions(-) delete mode 100644 source/mobile/funkin/backend/system/MobileRatioScaleMode.hx diff --git a/source/funkin/backend/system/Main.hx b/source/funkin/backend/system/Main.hx index 8a8fb283d..fb3027849 100644 --- a/source/funkin/backend/system/Main.hx +++ b/source/funkin/backend/system/Main.hx @@ -16,9 +16,6 @@ import flixel.addons.transition.TransitionData; import flixel.math.FlxPoint; import flixel.math.FlxRect; import funkin.backend.system.modules.*; -#if mobile -import mobile.funkin.backend.system.MobileRatioScaleMode as FunkinRatioScaleMode; -#end #if ALLOW_MULTITHREADING import sys.thread.Thread; diff --git a/source/funkin/options/Options.hx b/source/funkin/options/Options.hx index 81b50db84..d4a7934a1 100644 --- a/source/funkin/options/Options.hx +++ b/source/funkin/options/Options.hx @@ -41,7 +41,6 @@ class Options // mobile options #if mobile public static var screenTimeOut:Bool = false; - public static var wideScreen:Bool = false; #end public static var hideHitbox:Bool = false; public static var hitboxType:String = 'gradient'; diff --git a/source/funkin/options/categories/MobileOptions.hx b/source/funkin/options/categories/MobileOptions.hx index 37fe8fd62..222060cce 100644 --- a/source/funkin/options/categories/MobileOptions.hx +++ b/source/funkin/options/categories/MobileOptions.hx @@ -54,10 +54,6 @@ class MobileOptions extends OptionsScreen { "Allow Screen Timeout", "If checked, The phone will enter sleep mode if the player is inactive.", "screenTimeOut")); - add(new Checkbox( - "Wide Screen", - "If checked, It'll change aspect ratio of the game.", - "wideScreen")); #end #if android add(new ArrayOption( @@ -72,9 +68,7 @@ class MobileOptions extends OptionsScreen { override function update(elapsed) { #if mobile final lastScreenTimeOut:Bool = Options.screenTimeOut; - final lastWideScreen:Bool = Options.wideScreen; if (lastScreenTimeOut != Options.screenTimeOut) LimeSystem.allowScreenTimeout = Options.screenTimeOut; - if (lastWideScreen != Options.wideScreen) FlxG.scaleMode = new mobile.funkin.backend.system.MobileRatioScaleMode(); #end super.update(elapsed); } diff --git a/source/mobile/funkin/backend/system/MobileRatioScaleMode.hx b/source/mobile/funkin/backend/system/MobileRatioScaleMode.hx deleted file mode 100644 index 318c64cde..000000000 --- a/source/mobile/funkin/backend/system/MobileRatioScaleMode.hx +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (C) 2024 Mobile Porting Team - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -package mobile.funkin.backend.system; - -import flixel.FlxG; -import flixel.system.scaleModes.BaseScaleMode; - -/** - * ... - * @author: Karim Akra - */ -class MobileRatioScaleMode extends BaseScaleMode -{ - public static var allowWideScreen(default, set):Bool = true; - - override function updateGameSize(Width:Int, Height:Int):Void - { - if (funkin.options.Options.wideScreen && allowWideScreen) - { - super.updateGameSize(Width, Height); - } - else - { - var ratio:Float = FlxG.width / FlxG.height; - var realRatio:Float = Width / Height; - - var scaleY:Bool = realRatio < ratio; - - if (scaleY) - { - gameSize.x = Width; - gameSize.y = Math.floor(gameSize.x / ratio); - } - else - { - gameSize.y = Height; - gameSize.x = Math.floor(gameSize.y * ratio); - } - } - } - - override function updateGamePosition():Void - { - if (funkin.options.Options.wideScreen && allowWideScreen) - FlxG.game.x = FlxG.game.y = 0; - else - super.updateGamePosition(); - } - - @:noCompletion - private static function set_allowWideScreen(value:Bool):Bool - { - allowWideScreen = value; - FlxG.scaleMode = new MobileRatioScaleMode(); - return value; - } - - public function resetSize() {} -}