1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-17 03:53:07 +01:00

Merge pull request #21424 from ZehMatt/viewport-update

Store the rotation in viewports
This commit is contained in:
Matt
2024-03-07 22:42:00 +02:00
committed by GitHub
30 changed files with 286 additions and 228 deletions

View File

@@ -1165,15 +1165,14 @@ static int32_t ConsoleCommandSet(InteractiveConsole& console, const arguments_t&
else if (argv[0] == "current_rotation" && InvalidArguments(&invalidArgs, int_valid[0]))
{
uint8_t currentRotation = GetCurrentRotation();
WindowBase* mainWindow = WindowGetMain();
int32_t newRotation = int_val[0];
if (newRotation < 0 || newRotation > 3)
{
console.WriteLineError("Invalid argument. Valid rotations are 0-3.");
}
else if (newRotation != currentRotation && mainWindow != nullptr)
else if (newRotation != currentRotation)
{
WindowRotateCamera(*mainWindow, newRotation - currentRotation);
ViewportRotateAll(newRotation - currentRotation);
}
console.Execute("get current_rotation");
}