Skip to content

Commit

Permalink
Store Origins check as a variable
Browse files Browse the repository at this point in the history
Helps to reduce lag on lower-end hardware/platforms
  • Loading branch information
MegAmi24 committed Jun 24, 2024
1 parent 08a9800 commit 5aae710
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 8 deletions.
1 change: 0 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ AllowShortLoopsOnASingleLine: true
BinPackArguments: true
BinPackParameters: true
SpaceAfterCStyleCast: false
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakBeforeBinaryOperators: NonAssignment
Cpp11BracedListStyle: false
Expand Down
2 changes: 1 addition & 1 deletion RSDKv3/Drawing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion RSDKv3/RSDKv3-sdl2.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
Expand Down
2 changes: 1 addition & 1 deletion RSDKv3/RSDKv3.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
Expand Down
5 changes: 3 additions & 2 deletions RSDKv3/RetroEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion RSDKv3/RetroEngine.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion RSDKv3/Scene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5aae710

Please sign in to comment.