Codechange: Add InverseRemapCoords2 function for remapping viewport coordinates to underlying tile coordinates (Patch by adf88, #6583)

This commit is contained in:
Johannes E. Krause
2019-01-13 20:52:04 +01:00
committed by Niels Martin Hansen
parent 43852baace
commit f0290d5de7
4 changed files with 72 additions and 56 deletions

View File

@@ -108,6 +108,7 @@ static inline Point RemapCoords2(int x, int y)
* @param y Y coordinate of the 2D coordinate.
* @return X and Y components of equivalent world or tile coordinate.
* @note Inverse of #RemapCoords function. Smaller values may get rounded.
* @see InverseRemapCoords2
*/
static inline Point InverseRemapCoords(int x, int y)
{
@@ -115,6 +116,8 @@ static inline Point InverseRemapCoords(int x, int y)
return pt;
}
Point InverseRemapCoords2(int x, int y, bool clamp_to_map = false);
uint ApplyFoundationToSlope(Foundation f, Slope *s);
/**
* Applies a foundation to a slope.