ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:getcvarfixed

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
functions:getcvarfixed [2017/03/13 15:38] – created korshunfunctions:getcvarfixed [2017/03/17 15:11] (current) korshun
Line 1: Line 1:
 ====== GetCVarFixed ====== ====== GetCVarFixed ======
 {{tag>zdoom cvar}} {{tag>zdoom cvar}}
-''fixed a_GetCVarFixed(str name)'' +#REDIRECT a_GetCVarFixed
- +
-<note important>The function is called ''a_GetCVarFixed()'' because it conflicts with [[:GDCC]]'s unrelated ''GetCVarFixed()''.</note> +
- +
-===== 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 [[zdoom>GetCVarString|GetCVarString()]] and parsing the text with [[ParseFixed|ParseFixed()]]. +
- +
-===== Examples ===== +
-<code> +
-int mul = GetCVarFixed("mymod_multiplier"); // declared as float in CVARINFO +
-int value = FixedMul(x, mul); +
-</code> +
- +
-===== See also ===== +
-  * [[GetUserCVarFixed|GetUserCVarFixed()]]+
functions/getcvarfixed.1489419518.txt.gz · Last modified: by korshun