mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-06 06:32:56 +01:00
Make _lastMainViewport use ScreenCoordsXY
This commit is contained in:
@@ -242,10 +242,9 @@ void InGameConsole::Update()
|
||||
rct_viewport* mainViewport = window_get_viewport(mainWindow);
|
||||
if (mainViewport != nullptr)
|
||||
{
|
||||
if (_lastMainViewportX != mainViewport->viewPos.x || _lastMainViewportY != mainViewport->viewPos.y)
|
||||
if (_lastMainViewport != mainViewport->viewPos)
|
||||
{
|
||||
_lastMainViewportX = mainViewport->viewPos.x;
|
||||
_lastMainViewportY = mainViewport->viewPos.y;
|
||||
_lastMainViewport = mainViewport->viewPos;
|
||||
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <openrct2/interface/InteractiveConsole.h>
|
||||
#include <openrct2/world/Location.hpp>
|
||||
|
||||
namespace OpenRCT2::Ui
|
||||
{
|
||||
@@ -25,7 +26,7 @@ namespace OpenRCT2::Ui
|
||||
|
||||
bool _isOpen = false;
|
||||
int32_t _consoleLeft, _consoleTop, _consoleRight, _consoleBottom;
|
||||
int32_t _lastMainViewportX, _lastMainViewportY;
|
||||
ScreenCoordsXY _lastMainViewport;
|
||||
std::deque<std::string> _consoleLines;
|
||||
utf8 _consoleCurrentLine[CONSOLE_INPUT_SIZE] = {};
|
||||
int32_t _consoleCaretTicks;
|
||||
|
||||
@@ -72,6 +72,16 @@ struct ScreenCoordsXY
|
||||
{
|
||||
return { x + rhs.x, y + rhs.y };
|
||||
}
|
||||
|
||||
bool operator==(const ScreenCoordsXY& other) const
|
||||
{
|
||||
return x == other.x && y == other.y;
|
||||
}
|
||||
|
||||
bool operator!=(const ScreenCoordsXY& other) const
|
||||
{
|
||||
return !(*this == other);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user