MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / ScrollMainViewport

Function ScrollMainViewport

src/window.cpp:2802–2809  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2800const std::chrono::milliseconds TIME_BETWEEN_DOUBLE_CLICK(500); ///< Time between 2 left clicks before it becoming a double click.
2801
2802static void ScrollMainViewport(int x, int y)
2803{
2804 if (_game_mode != GM_MENU && _game_mode != GM_BOOTSTRAP) {
2805 Window *w = GetMainWindow();
2806 w->viewport->dest_scrollpos_x += ScaleByZoom(x, w->viewport->zoom);
2807 w->viewport->dest_scrollpos_y += ScaleByZoom(y, w->viewport->zoom);
2808 }
2809}
2810
2811/**
2812 * Describes all the different arrow key combinations the game allows

Callers 1

HandleKeyScrollingFunction · 0.85

Calls 2

GetMainWindowFunction · 0.85
ScaleByZoomFunction · 0.85

Tested by

no test coverage detected