MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / processMouseWheel

Function processMouseWheel

src/OpenLoco/src/Input/MouseInput.cpp:1870–1922  ·  view source on GitHub ↗

0x004C6202

Source from the content-addressed store, hash-verified

1868
1869 // 0x004C6202
1870 void processMouseWheel()
1871 {
1872 int wheel = 0;
1873
1874 for (; _cursorWheel > 0; _cursorWheel--)
1875 {
1876 wheel -= 17;
1877 }
1878
1879 for (; _cursorWheel < 0; _cursorWheel++)
1880 {
1881 wheel += 17;
1882 }
1883
1884 if (Tutorial::state() != Tutorial::State::none)
1885 {
1886 return;
1887 }
1888
1889 if (Input::hasFlag(Input::Flags::rightMousePressed))
1890 {
1891 if (SceneManager::isTitleMode())
1892 {
1893 return;
1894 }
1895
1896 auto main = WindowManager::getMainWindow();
1897 if (main != nullptr && wheel != 0)
1898 {
1899
1900 if (wheel > 0)
1901 {
1902 main->viewportRotateRight();
1903 }
1904 else if (wheel < 0)
1905 {
1906 main->viewportRotateLeft();
1907 }
1908 TownManager::updateLabels();
1909 StationManager::updateLabels();
1910 Windows::MapWindow::centerOnViewPoint();
1911 }
1912
1913 return;
1914 }
1915
1916 if (wheel == 0)
1917 {
1918 return;
1919 }
1920
1921 WindowManager::wheelInput(wheel);
1922 }
1923
1924 Ui::WindowType getPressedWindowType()
1925 {

Callers 2

handleInputFunction · 0.85
openFunction · 0.85

Calls 9

isTitleModeFunction · 0.85
getMainWindowFunction · 0.85
centerOnViewPointFunction · 0.85
wheelInputFunction · 0.85
viewportRotateRightMethod · 0.80
viewportRotateLeftMethod · 0.80
stateFunction · 0.50
hasFlagFunction · 0.50
updateLabelsFunction · 0.50

Tested by

no test coverage detected