libultraship
Reimplementations of libultra (N64 SDK) functions for modern hardware
Loading...
Searching...
No Matches
consolevariablebridge.h
Go to the documentation of this file.
1#pragma once
2
3#include "stdint.h"
5#include "ship/Api.h"
6
7#ifdef __cplusplus
8#include <memory>
10void CVarSetConsoleVariable(std::shared_ptr<Ship::ConsoleVariable> consoleVariable);
11std::shared_ptr<Ship::ConsoleVariable> CVarGetConsoleVariable();
12
17std::shared_ptr<Ship::CVar> CVarGet(const char* name);
18
19extern "C" {
20#endif
21
27API_EXPORT int32_t CVarGetInteger(const char* name, int32_t defaultValue);
28
34API_EXPORT float CVarGetFloat(const char* name, float defaultValue);
35
41API_EXPORT const char* CVarGetString(const char* name, const char* defaultValue);
42
48API_EXPORT Color_RGBA8 CVarGetColor(const char* name, Color_RGBA8 defaultValue);
49
55API_EXPORT Color_RGB8 CVarGetColor24(const char* name, Color_RGB8 defaultValue);
56
62API_EXPORT void CVarSetInteger(const char* name, int32_t value);
63
69API_EXPORT void CVarSetFloat(const char* name, float value);
70
76API_EXPORT void CVarSetString(const char* name, const char* value);
77
83API_EXPORT void CVarSetColor(const char* name, Color_RGBA8 value);
84
90API_EXPORT void CVarSetColor24(const char* name, Color_RGB8 value);
91
100API_EXPORT void CVarRegisterInteger(const char* name, int32_t defaultValue);
101
107API_EXPORT void CVarRegisterFloat(const char* name, float defaultValue);
108
114API_EXPORT void CVarRegisterString(const char* name, const char* defaultValue);
115
121API_EXPORT void CVarRegisterColor(const char* name, Color_RGBA8 defaultValue);
122
128API_EXPORT void CVarRegisterColor24(const char* name, Color_RGB8 defaultValue);
129
134API_EXPORT void CVarClear(const char* name);
135
140API_EXPORT bool CVarExists(const char* name);
141
146API_EXPORT void CVarClearBlock(const char* name);
147
153API_EXPORT void CVarCopy(const char* from, const char* to);
154
159
164
165#ifdef __cplusplus
166};
167#endif
API export/import macros for cross-platform shared library symbol visibility.
#define API_EXPORT
Marks a symbol for export from (or import into) a shared library.
Definition Api.h:32
API_EXPORT void CVarLoad()
Loads all CVar values from the persisted config file into the runtime store.
API_EXPORT void CVarClear(const char *name)
Removes the named CVar from the runtime store (does not affect persisted config).
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 CVarSetFloat(const char *name, float value)
Sets the named CVar to a float value (creates it 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.
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 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 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 CVarClearBlock(const char *name)
Removes all CVars whose names begin with the given prefix.
API_EXPORT float CVarGetFloat(const char *name, float defaultValue)
Returns the float value of the named CVar, or defaultValue if it is not set.
void CVarSetConsoleVariable(std::shared_ptr< Ship::ConsoleVariable > consoleVariable)
API_EXPORT void CVarSave()
Saves all runtime CVar values to the persisted config file.
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.
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 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 CVarSetColor(const char *name, Color_RGBA8 value)
Sets the named CVar to an RGBA colour value (creates it if it does not exist).
std::shared_ptr< Ship::ConsoleVariable > CVarGetConsoleVariable()
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 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 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 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 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 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 CVarCopy(const char *from, const char *to)
Copies the value of the CVar named from to a new CVar named to.
8-bit RGB colour without an alpha channel.
Definition color.h:14
8-bit RGBA colour (red, green, blue, alpha).
Definition color.h:26