|
libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
|
#include "stdint.h"#include "libultraship/color.h"#include "ship/Api.h"#include <memory>#include "ship/config/ConsoleVariable.h"Go to the source code of this file.
Functions | |
| void | CVarSetConsoleVariable (std::shared_ptr< Ship::ConsoleVariable > consoleVariable) |
| std::shared_ptr< Ship::ConsoleVariable > | CVarGetConsoleVariable () |
| std::shared_ptr< Ship::CVar > | CVarGet (const char *name) |
| Returns a shared pointer to the CVar with the given name, or nullptr if it does not exist. | |
| API_EXPORT int32_t | CVarGetInteger (const char *name, int32_t defaultValue) |
Returns the integer value of the named CVar, or defaultValue if it is not set. | |
| API_EXPORT float | CVarGetFloat (const char *name, float defaultValue) |
Returns the float value of the named CVar, or defaultValue if it is not set. | |
| API_EXPORT const char * | CVarGetString (const char *name, const char *defaultValue) |
Returns the string value of the named CVar, or defaultValue if it is not set. | |
| API_EXPORT Color_RGBA8 | CVarGetColor (const char *name, Color_RGBA8 defaultValue) |
Returns the RGBA colour value of the named CVar, or defaultValue if it is not set. | |
| API_EXPORT Color_RGB8 | CVarGetColor24 (const char *name, Color_RGB8 defaultValue) |
Returns the RGB colour value of the named CVar, or defaultValue if it is not set. | |
| API_EXPORT void | CVarSetInteger (const char *name, int32_t value) |
| Sets the named CVar to an integer value (creates it if it does not exist). | |
| API_EXPORT void | CVarSetFloat (const char *name, float value) |
| Sets the named CVar to a float value (creates it if it does not exist). | |
| API_EXPORT void | CVarSetString (const char *name, const char *value) |
| Sets the named CVar to a string value (creates it if it does not exist). | |
| API_EXPORT void | CVarSetColor (const char *name, Color_RGBA8 value) |
| Sets the named CVar to an RGBA colour value (creates it if it does not exist). | |
| API_EXPORT void | CVarSetColor24 (const char *name, Color_RGB8 value) |
| Sets the named CVar to an RGB colour value (creates it if it does not exist). | |
| API_EXPORT void | CVarRegisterInteger (const char *name, int32_t defaultValue) |
| Registers an integer CVar with a default value if it has not been set before. | |
| API_EXPORT void | CVarRegisterFloat (const char *name, float defaultValue) |
| Registers a float CVar with a default value if it has not been set before. | |
| API_EXPORT void | CVarRegisterString (const char *name, const char *defaultValue) |
| Registers a string CVar with a default value if it has not been set before. | |
| API_EXPORT void | CVarRegisterColor (const char *name, Color_RGBA8 defaultValue) |
| Registers an RGBA colour CVar with a default value if it has not been set before. | |
| API_EXPORT void | CVarRegisterColor24 (const char *name, Color_RGB8 defaultValue) |
| Registers an RGB colour CVar with a default value if it has not been set before. | |
| API_EXPORT void | CVarClear (const char *name) |
| Removes the named CVar from the runtime store (does not affect persisted config). | |
| API_EXPORT bool | CVarExists (const char *name) |
| Returns true if the named CVar currently has a value in the runtime store. | |
| API_EXPORT void | CVarClearBlock (const char *name) |
| Removes all CVars whose names begin with the given prefix. | |
| API_EXPORT void | CVarCopy (const char *from, const char *to) |
Copies the value of the CVar named from to a new CVar named to. | |
| API_EXPORT void | CVarLoad () |
| Loads all CVar values from the persisted config file into the runtime store. | |
| API_EXPORT void | CVarSave () |
| Saves all runtime CVar values to the persisted config file. | |
| API_EXPORT void CVarClear | ( | const char * | name | ) |
Removes the named CVar from the runtime store (does not affect persisted config).
| name | CVar name to remove. |
| API_EXPORT void CVarClearBlock | ( | const char * | name | ) |
Removes all CVars whose names begin with the given prefix.
| name | Prefix string (e.g. "gMod."). |
| API_EXPORT void CVarCopy | ( | const char * | from, |
| const char * | to | ||
| ) |
Copies the value of the CVar named from to a new CVar named to.
| from | Source CVar name. |
| to | Destination CVar name (created if it does not exist). |
| API_EXPORT bool CVarExists | ( | const char * | name | ) |
Returns true if the named CVar currently has a value in the runtime store.
| name | CVar name. |
| std::shared_ptr< Ship::CVar > CVarGet | ( | const char * | name | ) |
Returns a shared pointer to the CVar with the given name, or nullptr if it does not exist.
| name | CVar name (e.g. "gMyOption"). |
| API_EXPORT Color_RGBA8 CVarGetColor | ( | const char * | name, |
| Color_RGBA8 | defaultValue | ||
| ) |
Returns the RGBA colour value of the named CVar, or defaultValue if it is not set.
| name | CVar name. |
| defaultValue | Default RGBA colour. |
| API_EXPORT Color_RGB8 CVarGetColor24 | ( | const char * | name, |
| Color_RGB8 | defaultValue | ||
| ) |
Returns the RGB colour value of the named CVar, or defaultValue if it is not set.
| name | CVar name. |
| defaultValue | Default RGB colour. |
| std::shared_ptr< Ship::ConsoleVariable > CVarGetConsoleVariable | ( | ) |
| API_EXPORT float CVarGetFloat | ( | const char * | name, |
| float | defaultValue | ||
| ) |
Returns the float value of the named CVar, or defaultValue if it is not set.
| name | CVar name. |
| defaultValue | Value returned when the CVar does not exist. |
| API_EXPORT int32_t CVarGetInteger | ( | const char * | name, |
| int32_t | defaultValue | ||
| ) |
Returns the integer value of the named CVar, or defaultValue if it is not set.
| name | CVar name. |
| defaultValue | Value returned when the CVar does not exist. |
| API_EXPORT const char * CVarGetString | ( | const char * | name, |
| const char * | defaultValue | ||
| ) |
Returns the string value of the named CVar, or defaultValue if it is not set.
| name | CVar name. |
| defaultValue | Value returned when the CVar does not exist (must outlive the call). |
| API_EXPORT void CVarLoad | ( | ) |
Loads all CVar values from the persisted config file into the runtime store.
| API_EXPORT void CVarRegisterColor | ( | const char * | name, |
| Color_RGBA8 | defaultValue | ||
| ) |
Registers an RGBA colour CVar with a default value if it has not been set before.
| name | CVar name. |
| defaultValue | Default RGBA colour. |
| API_EXPORT void CVarRegisterColor24 | ( | const char * | name, |
| Color_RGB8 | defaultValue | ||
| ) |
Registers an RGB colour CVar with a default value if it has not been set before.
| name | CVar name. |
| defaultValue | Default RGB colour. |
| API_EXPORT void CVarRegisterFloat | ( | const char * | name, |
| float | defaultValue | ||
| ) |
Registers a float CVar with a default value if it has not been set before.
| name | CVar name. |
| defaultValue | Default float value. |
| API_EXPORT void CVarRegisterInteger | ( | const char * | name, |
| int32_t | defaultValue | ||
| ) |
Registers an integer CVar with a default value if it has not been set before.
Unlike CVarSetInteger(), this is a no-op when the CVar already has a value.
| name | CVar name. |
| defaultValue | Default value to use when the CVar is absent. |
| API_EXPORT void CVarRegisterString | ( | const char * | name, |
| const char * | defaultValue | ||
| ) |
Registers a string CVar with a default value if it has not been set before.
| name | CVar name. |
| defaultValue | Default string value. |
| API_EXPORT void CVarSave | ( | ) |
Saves all runtime CVar values to the persisted config file.
| API_EXPORT void CVarSetColor | ( | const char * | name, |
| Color_RGBA8 | value | ||
| ) |
Sets the named CVar to an RGBA colour value (creates it if it does not exist).
| name | CVar name. |
| value | New RGBA colour. |
| API_EXPORT void CVarSetColor24 | ( | const char * | name, |
| Color_RGB8 | value | ||
| ) |
Sets the named CVar to an RGB colour value (creates it if it does not exist).
| name | CVar name. |
| value | New RGB colour. |
| void CVarSetConsoleVariable | ( | std::shared_ptr< Ship::ConsoleVariable > | consoleVariable | ) |
| API_EXPORT void CVarSetFloat | ( | const char * | name, |
| float | value | ||
| ) |
Sets the named CVar to a float value (creates it if it does not exist).
| name | CVar name. |
| value | New float value. |
| API_EXPORT void CVarSetInteger | ( | const char * | name, |
| int32_t | value | ||
| ) |
Sets the named CVar to an integer value (creates it if it does not exist).
| name | CVar name. |
| value | New integer value. |
| API_EXPORT void CVarSetString | ( | const char * | name, |
| const char * | value | ||
| ) |
Sets the named CVar to a string value (creates it if it does not exist).
| name | CVar name. |
| value | New string value (copied internally). |