Fixed bool serialization
This commit is contained in:
@@ -44,7 +44,7 @@ build :: (build_release: bool, main_path: string, game_name: string, working_dir
|
||||
entity_serialize_proc_string: [..] string;
|
||||
|
||||
should_serialize :: (type: *Type_Info_Struct, member: Type_Info_Struct_Member) -> bool {
|
||||
if type!= null {
|
||||
if type != null {
|
||||
if type.name == {
|
||||
case "Vector2"; {
|
||||
if member.name == {
|
||||
@@ -205,9 +205,9 @@ if updated {
|
||||
}
|
||||
DONE
|
||||
|
||||
generate_member_serialization :: (type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
||||
for type.members {
|
||||
if should_serialize(type, it) {
|
||||
generate_member_serialization :: (struct_type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
||||
for struct_type.members {
|
||||
if should_serialize(struct_type, it) {
|
||||
new_path : string;
|
||||
if path.count == 0 {
|
||||
new_path = it.name;
|
||||
@@ -242,9 +242,10 @@ generate_member_serialization :: (type: *Type_Info_Struct, builder: *String_Buil
|
||||
}
|
||||
}
|
||||
|
||||
generate_member_deserialization :: (type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
||||
for type.members {
|
||||
if should_serialize(type, it) {
|
||||
generate_member_deserialization :: (struct_type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
||||
for struct_type.members {
|
||||
if should_serialize(struct_type, it) {
|
||||
print("DESER %\n", struct_type.name);
|
||||
new_path : string;
|
||||
if path.count == 0 {
|
||||
new_path = it.name;
|
||||
@@ -269,7 +270,10 @@ generate_member_deserialization :: (type: *Type_Info_Struct, builder: *String_Bu
|
||||
print_to_builder(builder, "\t\t\t\tcase \"%\";\n", new_path);
|
||||
print_to_builder(builder, "\t\t\t\tif values[1].count > 0 { e.%1 = copy_string(trim(values[1])); }\n", new_path);
|
||||
}
|
||||
case .BOOL; #through;
|
||||
case .BOOL; {
|
||||
print_to_builder(builder, "\t\t\t\tcase \"%\";\n", new_path);
|
||||
print_to_builder(builder, "\t\t\t\t\tscan2(trim(values[1]), \"\%\", *e.%);\n", new_path);
|
||||
}
|
||||
case .FLOAT; #through;
|
||||
case .ENUM; {
|
||||
print_to_builder(builder, "\t\t\t\tcase \"%\";\n", new_path);
|
||||
|
||||
Reference in New Issue
Block a user