From 5aae710c8db9d07e61c59d8cad83cf6eec1545df Mon Sep 17 00:00:00 2001 From: MegAmi Date: Mon, 24 Jun 2024 10:05:45 -0500 Subject: [PATCH] Store Origins check as a variable Helps to reduce lag on lower-end hardware/platforms --- .clang-format | 1 - RSDKv3/Drawing.cpp | 2 +- RSDKv3/RSDKv3-sdl2.vcxproj | 2 +- RSDKv3/RSDKv3.vcxproj | 2 +- RSDKv3/RetroEngine.cpp | 5 +++-- RSDKv3/RetroEngine.hpp | 5 ++++- RSDKv3/Scene.cpp | 2 +- 7 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.clang-format b/.clang-format index 0f9c62b9..6d34aa32 100644 --- a/.clang-format +++ b/.clang-format @@ -12,7 +12,6 @@ AllowShortLoopsOnASingleLine: true BinPackArguments: true BinPackParameters: true SpaceAfterCStyleCast: false -BreakBeforeBraces: Attach BreakBeforeTernaryOperators: true BreakBeforeBinaryOperators: NonAssignment Cpp11BracedListStyle: false diff --git a/RSDKv3/Drawing.cpp b/RSDKv3/Drawing.cpp index f8f0c669..cb228617 100644 --- a/RSDKv3/Drawing.cpp +++ b/RSDKv3/Drawing.cpp @@ -1948,7 +1948,7 @@ void DrawStageGFX() DrawObjectList(5); #if !RETRO_USE_ORIGINAL_CODE // Hacky fix for Tails Object not working properly on non-Origins bytecode - if (forceUseScripts || GetGlobalVariableByName("NOTIFY_1P_VS_SELECT") != 0) + if (forceUseScripts || Engine.usingOrigins) #endif DrawObjectList(7); // Extra Origins draw list (who knows why it comes before 6) DrawObjectList(6); diff --git a/RSDKv3/RSDKv3-sdl2.vcxproj b/RSDKv3/RSDKv3-sdl2.vcxproj index a08b6496..270b550f 100644 --- a/RSDKv3/RSDKv3-sdl2.vcxproj +++ b/RSDKv3/RSDKv3-sdl2.vcxproj @@ -43,7 +43,7 @@ Application true - v142 + v143 Unicode diff --git a/RSDKv3/RSDKv3.vcxproj b/RSDKv3/RSDKv3.vcxproj index 8d4551b1..3c3ed848 100644 --- a/RSDKv3/RSDKv3.vcxproj +++ b/RSDKv3/RSDKv3.vcxproj @@ -43,7 +43,7 @@ Application true - v142 + v143 Unicode diff --git a/RSDKv3/RetroEngine.cpp b/RSDKv3/RetroEngine.cpp index 457b8f15..81ee4eef 100644 --- a/RSDKv3/RetroEngine.cpp +++ b/RSDKv3/RetroEngine.cpp @@ -1104,9 +1104,8 @@ bool RetroEngine::LoadGameConfig(const char *filePath) LoadXMLStages(NULL, 0); SetGlobalVariableByName("Engine.Standalone", 1); -#endif - SetGlobalVariableByName("game.hasPlusDLC", !RSDK_AUTOBUILD); +#endif #if !RETRO_USE_ORIGINAL_CODE if (strlen(Engine.startSceneFolder) && strlen(Engine.startSceneID)) { @@ -1117,6 +1116,8 @@ bool RetroEngine::LoadGameConfig(const char *filePath) startList_Game = STAGELIST_BONUS; startStage_Game = 0xFE; } + + Engine.usingOrigins = GetGlobalVariableByName("NOTIFY_1P_VS_SELECT") != 0; #endif return true; diff --git a/RSDKv3/RetroEngine.hpp b/RSDKv3/RetroEngine.hpp index e6b621fd..c3da2f1c 100644 --- a/RSDKv3/RetroEngine.hpp +++ b/RSDKv3/RetroEngine.hpp @@ -419,6 +419,9 @@ class RetroEngine #endif bool usingDataFile = false; bool usingBytecode = false; +#if !RETRO_USE_ORIGINAL_CODE + bool usingOrigins = false; +#endif byte bytecodeMode = BYTECODE_MOBILE; bool forceFolder = false; @@ -442,7 +445,7 @@ class RetroEngine int frameSkipSetting = 0; int frameSkipTimer = 0; - bool useSteamDir = true; + bool useSteamDir = false; #if !RETRO_USE_ORIGINAL_CODE // Ported from RSDKv5 diff --git a/RSDKv3/Scene.cpp b/RSDKv3/Scene.cpp index 9435e1a4..4845bff2 100644 --- a/RSDKv3/Scene.cpp +++ b/RSDKv3/Scene.cpp @@ -320,7 +320,7 @@ void ProcessStage(void) DrawObjectList(5); #if !RETRO_USE_ORIGINAL_CODE // Hacky fix for Tails Object not working properly on non-Origins bytecode - if (forceUseScripts || GetGlobalVariableByName("NOTIFY_1P_VS_SELECT") != 0) + if (forceUseScripts || Engine.usingOrigins) #endif DrawObjectList(7); // Extra Origins draw list (who knows why it comes before 6) DrawObjectList(6);