Sly 1:LM

LM (limit) is a data structure used in. Limits are used to clamp values to ensure they fall within a certain range.

Structure
The LM struct is declared as follows:

Usage
The helper function  is used to clamp a float value to fall within a given limit.. It takes a pointer to an  and float value , and returns the value of   clamped to fall between   and   inclusive.

Some limits are so commonly used they are defined as global values in the game’s code. One example is  which defines a limit on the interval [0,1].

Examples

 * When updating the player’s  in the function , the new suck is clamped to the range allowed by the current difficulty level. For the easy and medium difficulties the limit is [0,1], but for the hard difficulty the limit is [0,0].