mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2025-01-30 23:10:14 -05:00
Merge with develop
This commit is contained in:
parent
fa0a66695c
commit
a6092c21d4
@ -23,6 +23,7 @@ Globals::Globals()
|
||||
singleThreaded = true;
|
||||
verbosity = VerbosityLevel::VERBOSITY_SILENT;
|
||||
outputPath = Directory::GetCurrentDirectory();
|
||||
singleThreaded = true;
|
||||
}
|
||||
|
||||
Globals::~Globals()
|
||||
|
@ -52,7 +52,7 @@ extern "C" void CVar_SetS32(const char* name, int32_t value) {
|
||||
if (!cvar) {
|
||||
cvar = std::make_unique<CVar>();
|
||||
}
|
||||
cvar->type = CVAR_TYPE_S32;
|
||||
cvar->type = CVarType::S32;
|
||||
cvar->value.valueS32 = value;
|
||||
}
|
||||
|
||||
@ -61,7 +61,7 @@ void CVar_SetFloat(const char* name, float value) {
|
||||
if (!cvar) {
|
||||
cvar = std::make_unique<CVar>();
|
||||
}
|
||||
cvar->type = CVAR_TYPE_FLOAT;
|
||||
cvar->type = CVarType::Float;
|
||||
cvar->value.valueFloat = value;
|
||||
}
|
||||
|
||||
@ -70,8 +70,8 @@ extern "C" void CVar_SetString(const char* name, const char* value) {
|
||||
if (!cvar) {
|
||||
cvar = std::make_unique<CVar>();
|
||||
}
|
||||
cvar->type = CVAR_TYPE_STRING;
|
||||
cvar->value.valueStr = ImStrdup(value);
|
||||
cvar->type = CVarType::String;
|
||||
cvar->value.valueStr = value;
|
||||
}
|
||||
|
||||
extern "C" void CVar_RegisterS32(const char* name, int32_t defaultValue) {
|
||||
|
@ -3,7 +3,14 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum CVarType { CVAR_TYPE_S32, CVAR_TYPE_FLOAT, CVAR_TYPE_STRING } CVarType;
|
||||
#ifdef __cplusplus
|
||||
typedef enum class CVarType
|
||||
{
|
||||
S32,
|
||||
Float,
|
||||
String,
|
||||
RGBA
|
||||
} CVarType;
|
||||
|
||||
typedef struct CVar {
|
||||
const char* name;
|
||||
@ -16,6 +23,9 @@ typedef struct CVar {
|
||||
} value;
|
||||
} CVar;
|
||||
|
||||
CVar* CVar_Get(char* name);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
|
@ -351,6 +351,7 @@
|
||||
<ClInclude Include="Audio.h" />
|
||||
<ClInclude Include="AudioPlayer.h" />
|
||||
<ClInclude Include="Blob.h" />
|
||||
<ClInclude Include="color.h" />
|
||||
<ClInclude Include="ControlDeck.h" />
|
||||
<ClInclude Include="Cvar.h" />
|
||||
<ClInclude Include="Environment.h" />
|
||||
|
@ -653,6 +653,9 @@
|
||||
<ClInclude Include="GameVersions.h">
|
||||
<Filter>Source Files\Resources</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="color.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="GameOverlay.h">
|
||||
<Filter>Source Files\CustomImpl\Overlay</Filter>
|
||||
</ClInclude>
|
||||
|
@ -988,7 +988,6 @@
|
||||
<ClInclude Include="soh\frame_interpolation.h" />
|
||||
<ClInclude Include="include\alloca.h" />
|
||||
<ClInclude Include="include\bgm.h" />
|
||||
<ClInclude Include="include\color.h" />
|
||||
<ClInclude Include="include\command_macros_base.h" />
|
||||
<ClInclude Include="include\fp.h" />
|
||||
<ClInclude Include="include\functions.h" />
|
||||
|
@ -2384,9 +2384,6 @@
|
||||
<ClInclude Include="include\bgm.h">
|
||||
<Filter>Header Files\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\color.h">
|
||||
<Filter>Header Files\include</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="include\command_macros_base.h">
|
||||
<Filter>Header Files\include</Filter>
|
||||
</ClInclude>
|
||||
|
@ -426,11 +426,11 @@ static bool GetCVarHandler(const std::vector<std::string>& args) {
|
||||
|
||||
if (cvar != nullptr)
|
||||
{
|
||||
if (cvar->type == CVAR_TYPE_S32)
|
||||
if (cvar->type == CVarType::S32)
|
||||
INFO("[SOH] Variable %s is %i", args[1].c_str(), cvar->value.valueS32);
|
||||
else if (cvar->type == CVAR_TYPE_FLOAT)
|
||||
else if (cvar->type == CVarType::Float)
|
||||
INFO("[SOH] Variable %s is %f", args[1].c_str(), cvar->value.valueFloat);
|
||||
else if (cvar->type == CVAR_TYPE_STRING)
|
||||
else if (cvar->type == CVarType::String)
|
||||
INFO("[SOH] Variable %s is %s", args[1].c_str(), cvar->value.valueStr);
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user