mirror of
https://github.com/Relintai/pandemonium_engine.git
synced 2025-01-03 17:39:36 +01:00
Make enum values uppercase in frt.h.
This commit is contained in:
parent
18906f3cad
commit
afaf29c8d5
@ -89,10 +89,10 @@ struct EventHandler {
|
|||||||
|
|
||||||
struct Value {
|
struct Value {
|
||||||
enum Type {
|
enum Type {
|
||||||
Bool,
|
BOOL,
|
||||||
Int,
|
INT,
|
||||||
Float,
|
FLOAT,
|
||||||
String,
|
STRING,
|
||||||
} t;
|
} t;
|
||||||
union {
|
union {
|
||||||
bool b;
|
bool b;
|
||||||
@ -101,13 +101,13 @@ struct Value {
|
|||||||
const char *s;
|
const char *s;
|
||||||
} u;
|
} u;
|
||||||
Value(bool v)
|
Value(bool v)
|
||||||
: t(Bool) { u.b = v; }
|
: t(BOOL) { u.b = v; }
|
||||||
Value(int v)
|
Value(int v)
|
||||||
: t(Int) { u.i = v; }
|
: t(INT) { u.i = v; }
|
||||||
Value(float v)
|
Value(float v)
|
||||||
: t(Float) { u.f = v; }
|
: t(FLOAT) { u.f = v; }
|
||||||
Value(const char *v)
|
Value(const char *v)
|
||||||
: t(String) { u.s = v; }
|
: t(STRING) { u.s = v; }
|
||||||
};
|
};
|
||||||
|
|
||||||
struct Param {
|
struct Param {
|
||||||
|
@ -107,7 +107,7 @@ void parse_frt_param(const char *name, const char *value) {
|
|||||||
}
|
}
|
||||||
Value &v = p->value;
|
Value &v = p->value;
|
||||||
switch (v.t) {
|
switch (v.t) {
|
||||||
case Value::Bool:
|
case Value::BOOL:
|
||||||
if (!strcmp(value, "true")) {
|
if (!strcmp(value, "true")) {
|
||||||
v.u.b = true;
|
v.u.b = true;
|
||||||
} else if (!strcmp(value, "false")) {
|
} else if (!strcmp(value, "false")) {
|
||||||
@ -117,13 +117,13 @@ void parse_frt_param(const char *name, const char *value) {
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case Value::Int:
|
case Value::INT:
|
||||||
v.u.i = atoi(value);
|
v.u.i = atoi(value);
|
||||||
break;
|
break;
|
||||||
case Value::Float:
|
case Value::FLOAT:
|
||||||
v.u.f = (float)atof(value);
|
v.u.f = (float)atof(value);
|
||||||
break;
|
break;
|
||||||
case Value::String:
|
case Value::STRING:
|
||||||
v.u.s = value;
|
v.u.s = value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -283,16 +283,16 @@ public:
|
|||||||
p->source = Param::ProjectSettings;
|
p->source = Param::ProjectSettings;
|
||||||
Value &v = p->value;
|
Value &v = p->value;
|
||||||
switch (v.t) {
|
switch (v.t) {
|
||||||
case Value::Bool:
|
case Value::BOOL:
|
||||||
v.u.b = bool(project_settings->get(name));
|
v.u.b = bool(project_settings->get(name));
|
||||||
break;
|
break;
|
||||||
case Value::Int:
|
case Value::INT:
|
||||||
v.u.i = int(project_settings->get(name));
|
v.u.i = int(project_settings->get(name));
|
||||||
break;
|
break;
|
||||||
case Value::Float:
|
case Value::FLOAT:
|
||||||
v.u.f = float(project_settings->get(name));
|
v.u.f = float(project_settings->get(name));
|
||||||
break;
|
break;
|
||||||
case Value::String: {
|
case Value::STRING: {
|
||||||
String s = String(project_settings->get(name));
|
String s = String(project_settings->get(name));
|
||||||
v.u.s = strdup(s.ascii());
|
v.u.s = strdup(s.ascii());
|
||||||
// TODO: keep track and dealloc string copy
|
// TODO: keep track and dealloc string copy
|
||||||
|
Loading…
Reference in New Issue
Block a user