OpenTTD Source 20250312-master-gcdcc6b491d
|
Data structure for a window viewport. More...
#include <window_gui.h>
Public Member Functions | |
void | CancelFollow (const Window &viewport_window) |
Cancel viewport vehicle following, and raise follow location widget if needed. | |
Data Fields | |
VehicleID | follow_vehicle |
VehicleID to follow if following a vehicle, VehicleID::Invalid() otherwise. | |
int32_t | scrollpos_x |
Currently shown x coordinate (virtual screen coordinate of topleft corner of the viewport). | |
int32_t | scrollpos_y |
Currently shown y coordinate (virtual screen coordinate of topleft corner of the viewport). | |
int32_t | dest_scrollpos_x |
Current destination x coordinate to display (virtual screen coordinate of topleft corner of the viewport). | |
int32_t | dest_scrollpos_y |
Current destination y coordinate to display (virtual screen coordinate of topleft corner of the viewport). | |
![]() | |
int | left |
Screen coordinate left edge of the viewport. | |
int | top |
Screen coordinate top edge of the viewport. | |
int | width |
Screen width of the viewport. | |
int | height |
Screen height of the viewport. | |
int | virtual_left |
Virtual left coordinate. | |
int | virtual_top |
Virtual top coordinate. | |
int | virtual_width |
width << zoom | |
int | virtual_height |
height << zoom | |
ZoomLevel | zoom |
The zoom level of the viewport. | |
std::shared_ptr< LinkGraphOverlay > | overlay |
Data structure for a window viewport.
A viewport is either following a vehicle (its id in then in follow_vehicle), or it aims to display a specific location dest_scrollpos_x, dest_scrollpos_y (follow_vehicle is then VehicleID::Invalid()). The actual location being shown is scrollpos_x, scrollpos_y.
Definition at line 251 of file window_gui.h.
void ViewportData::CancelFollow | ( | const Window & | viewport_window | ) |
Cancel viewport vehicle following, and raise follow location widget if needed.
viewport_window | Window of this viewport. |
Definition at line 3727 of file viewport.cpp.
References FindWindowById(), follow_vehicle, Window::RaiseWidgetWhenLowered(), WC_MAIN_WINDOW, WC_VEHICLE_VIEW, WID_VV_LOCATION, and Window::window_class.
Referenced by HandleAutoscroll(), and ScrollWindowTo().
int32_t ViewportData::dest_scrollpos_x |
Current destination x coordinate to display (virtual screen coordinate of topleft corner of the viewport).
Definition at line 255 of file window_gui.h.
Referenced by DoZoomInOutWindow(), HandleAutoscroll(), InitializeWindowViewport(), ExtraViewportWindow::OnClick(), MainWindow::OnScroll(), ExtraViewportWindow::OnScroll(), ScrollWindowTo(), and UpdateViewportPosition().
int32_t ViewportData::dest_scrollpos_y |
Current destination y coordinate to display (virtual screen coordinate of topleft corner of the viewport).
Definition at line 256 of file window_gui.h.
Referenced by DoZoomInOutWindow(), HandleAutoscroll(), InitializeWindowViewport(), ExtraViewportWindow::OnClick(), MainWindow::OnScroll(), ExtraViewportWindow::OnScroll(), ScrollWindowTo(), and UpdateViewportPosition().
VehicleID ViewportData::follow_vehicle |
VehicleID to follow if following a vehicle, VehicleID::Invalid() otherwise.
Definition at line 252 of file window_gui.h.
Referenced by CancelFollow(), ChangeVehicleViewports(), ChangeVehicleWindow(), HandleViewportScroll(), InitializeWindowViewport(), ExtraViewportWindow::OnClick(), MainWindow::OnMouseWheel(), and UpdateViewportPosition().
int32_t ViewportData::scrollpos_x |
Currently shown x coordinate (virtual screen coordinate of topleft corner of the viewport).
Definition at line 253 of file window_gui.h.
Referenced by DoZoomInOutWindow(), InitializeWindowViewport(), ExtraViewportWindow::OnClick(), MainWindow::OnScroll(), ExtraViewportWindow::OnScroll(), ScrollWindowTo(), and UpdateViewportPosition().
int32_t ViewportData::scrollpos_y |
Currently shown y coordinate (virtual screen coordinate of topleft corner of the viewport).
Definition at line 254 of file window_gui.h.
Referenced by DoZoomInOutWindow(), InitializeWindowViewport(), ExtraViewportWindow::OnClick(), MainWindow::OnScroll(), ExtraViewportWindow::OnScroll(), ScrollWindowTo(), and UpdateViewportPosition().