Sly 1:LM: Difference between revisions
Jump to navigation
Jump to search
Content added Content deleted
TheOnlyZac (talk | contribs) (Fixed broken link) |
TheOnlyZac (talk | contribs) (Fixed struct fields table) |
||
Line 8: | Line 8: | ||
== Fields == |
== Fields == |
||
{{Struct |
{{Struct top}} |
||
{{Struct field|0x4|0x4|float|gMin|Lower bound}} |
{{Struct field|0x4|0x4|float|gMin|Lower bound}} |
||
{{Struct field|0x8|0x4|float|gMax|Upper bound}} |
{{Struct field|0x8|0x4|float|gMax|Upper bound}} |
||
{{Struct field|0xC|0x4|float|u4ag|}} |
{{Struct field|0xC|0x4|float|u4ag|}} |
||
{{Struct bottom}} |
|||
}} |
|||
==Usage== |
==Usage== |
Latest revision as of 16:03, 23 September 2023
Data Structure | |
---|---|
Game | Sly Cooper and the Thievius Raccoonus |
Size | 12 bytes |
Official Name | Yes |
LM (limit) is a data structure used in Sly Cooper and the Thievius Raccoonus. Limits are used to clamp values to ensure they fall within a certain range.
Fields
Offset | Size | Type | Name | Notes |
---|---|---|---|---|
0x4 | 0x4 | float
|
gMin
|
Lower bound |
0x8 | 0x4 | float
|
gMax
|
Upper bound |
0xC | 0x4 | float
|
u4ag
|
Usage
The helper function GLimitLm
is used to clamp a float value to fall within a given limit.. It takes a pointer to an LM
and float value g
, and returns the value of g
clamped to fall between gMin
and gMax
inclusive.
Some limits are so commonly used they are defined as global values in the game’s code. One example is g_lmZeroOne
which defines a limit on the interval [0,1].
Examples
- When updating the player’s
uSuck
in the functionChangeSuck
, 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].