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

Function CheckOverflow

src/viewport.cpp:3061–3067  ·  view source on GitHub ↗

* Check for overflowing the map. * @param test the variable to test for overflowing * @param other the other variable to update to keep the line * @param max the maximum value for the \c test variable * @param mult the constant to multiply the difference by for \c other */

Source from the content-addressed store, hash-verified

3059 * @param mult the constant to multiply the difference by for \c other
3060 */
3061static void CheckOverflow(int &test, int &other, int max, int mult)
3062{
3063 if (test <= max) return;
3064
3065 other += mult * (test - max);
3066 test = max;
3067}
3068
3069/** while dragging */
3070static void CalcRaildirsDrawstyle(int x, int y, int method)

Callers 1

CalcRaildirsDrawstyleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected