ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:a_getcvarfixed

This is an old revision of the document!


a_GetCVarFixed

fixed a_GetCVarFixed(str name)

The function is called a_GetCVarFixed() because it conflicts with GDCC's unrelated GetCVarFixed().

Description

Returns the value of an int or float CVar as a fixed-point number.

Returns 0 if:

  • the CVar doesn't exist.
  • the CVar is a string that doesn't look like a decimal number.
  • the CVar is not an integer, a float or a string.

The function works by calling GetCVarString and parsing the text with ParseFixed.

Examples

int mul = GetCVarFixed("mymod_multiplier"); // declared as float in CVARINFO
int value = FixedMul(x, mul);

See also

functions/a_getcvarfixed.1489763403.txt.gz · Last modified: 2017/03/17 17:10 by korshun