ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


getcvarfixed

This is an old revision of the document!


GetCVarFixed

fixed a_GetCVarFixed(str name)

ZDoom provides GetCVar for ints and GetCVarString for strings, but doesn't provide a way to retrieve the value of float CVars. ACSUtils implements GetCVarFixed by calling GetCVarString to retrieve the value of the CVar as a string, and parsing it with ACSUtils number parsing functions.

If the CVar's value is outside the range of fixed-point numbers, the function returns 0.0.
The function is called a_GetCVarFixed and not GetCVarFixed because GDCC defines its own broken GetCVarFixed, which causes a compilation error if another function named GetCVarFixed exists.

GetUserCVarFixed

fixed a_GetUserCVarFixed(int player, str name)

An equivalent function mimicking GetUserCVar and GetUserCVarString.

getcvarfixed.1555961445.txt.gz · Last modified: 2019/04/22 22:30 by korshun