This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| functions:a_getcvarfixed [2017/03/17 15:10] – korshun | functions:a_getcvarfixed [2017/06/16 10:25] (current) – korshun | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| '' | '' | ||
| - | <note important> | + | <note important> |
| ===== Description ===== | ===== Description ===== | ||
| Returns the value of an int or float CVar as a fixed-point number. | Returns the value of an int or float CVar as a fixed-point number. | ||
| - | Returns 0 if: | + | Returns 0 if the CVar doesn' |
| - | * the CVar doesn' | + | |
| - | * the CVar is a string that doesn' | + | |
| - | * the CVar is not an integer, a float or a string. | + | |
| - | The function works by calling [[zdoom> | + | The function works by calling [[zdoom> |
| ===== Examples ===== | ===== Examples ===== | ||
| < | < | ||
| - | int mul = GetCVarFixed(" | + | int mul = a_GetCVarFixed(" |
| int value = FixedMul(x, mul); | int value = FixedMul(x, mul); | ||
| + | </ | ||
| + | |||
| + | From [[UpdateCursor]] source: | ||
| + | < | ||
| + | int sensitivity = a_GetCVarFixed(" | ||
| + | int speedX = FixedDiv(CursorSpeedX, | ||
| + | int speedY = FixedDiv(CursorSpeedY, | ||
| </ | </ | ||
| ===== See also ===== | ===== See also ===== | ||
| * [[GetUserCVarFixed]] | * [[GetUserCVarFixed]] | ||