Files
OpenRCT2-Web/src/openrct2/interface/Window_internal.cpp
T

37 lines
819 B
C++
Raw Normal View History

#include "Window_internal.h"
2021-11-24 17:19:52 +02:00
#include "../entity/EntityList.h"
2021-11-26 16:49:52 +02:00
#include "../entity/EntityRegistry.h"
2021-05-29 06:01:32 +01:00
#include "Viewport.h"
void rct_window::SetLocation(const CoordsXYZ& coords)
{
window_scroll_to_location(this, coords);
flags &= ~WF_SCROLLING_TO_LOCATION;
}
void rct_window::ScrollToViewport()
{
2021-09-21 10:06:04 +01:00
if (viewport == nullptr || !focus.has_value())
return;
2021-09-21 10:06:04 +01:00
CoordsXYZ newCoords = focus.value().GetPos();
auto mainWindow = window_get_main();
if (mainWindow != nullptr)
window_scroll_to_location(mainWindow, newCoords);
}
void rct_window::Invalidate()
{
gfx_set_dirty_blocks({ windowPos, windowPos + ScreenCoordsXY{ width, height } });
}
void rct_window::RemoveViewport()
{
if (viewport == nullptr)
return;
viewport_remove(viewport);
viewport = nullptr;
}