Fixed bool serialization
This commit is contained in:
@@ -43,11 +43,11 @@ Node_Render_Data :: struct {
|
|||||||
|
|
||||||
Renderable :: struct {
|
Renderable :: struct {
|
||||||
visible: bool = true;
|
visible: bool = true;
|
||||||
type : Renderable_Type;
|
type : Renderable_Type; @DontSerialize
|
||||||
|
|
||||||
model: *Model;
|
model: *Model; @DontSerialize
|
||||||
nodes: [MAX_NODES] Node_Render_Data;
|
nodes: [MAX_NODES] Node_Render_Data; @DontSerialize
|
||||||
num_nodes: s64;
|
num_nodes: s64; @DontSerialize
|
||||||
}
|
}
|
||||||
|
|
||||||
MAX_CHILDREN :: 16;
|
MAX_CHILDREN :: 16;
|
||||||
@@ -75,7 +75,7 @@ Entity :: struct {
|
|||||||
snap_offset: Vector3;
|
snap_offset: Vector3;
|
||||||
snap_intervals: Vector3 = .{1,1,1};
|
snap_intervals: Vector3 = .{1,1,1};
|
||||||
|
|
||||||
renderable: Renderable; @DontSerialize
|
renderable: Renderable;
|
||||||
animator: Animator; @DontSerialize
|
animator: Animator; @DontSerialize
|
||||||
|
|
||||||
// Physics
|
// Physics
|
||||||
|
|||||||
@@ -205,9 +205,9 @@ if updated {
|
|||||||
}
|
}
|
||||||
DONE
|
DONE
|
||||||
|
|
||||||
generate_member_serialization :: (type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
generate_member_serialization :: (struct_type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
||||||
for type.members {
|
for struct_type.members {
|
||||||
if should_serialize(type, it) {
|
if should_serialize(struct_type, it) {
|
||||||
new_path : string;
|
new_path : string;
|
||||||
if path.count == 0 {
|
if path.count == 0 {
|
||||||
new_path = it.name;
|
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 = "") {
|
generate_member_deserialization :: (struct_type: *Type_Info_Struct, builder: *String_Builder, path: string = "") {
|
||||||
for type.members {
|
for struct_type.members {
|
||||||
if should_serialize(type, it) {
|
if should_serialize(struct_type, it) {
|
||||||
|
print("DESER %\n", struct_type.name);
|
||||||
new_path : string;
|
new_path : string;
|
||||||
if path.count == 0 {
|
if path.count == 0 {
|
||||||
new_path = it.name;
|
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\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);
|
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 .FLOAT; #through;
|
||||||
case .ENUM; {
|
case .ENUM; {
|
||||||
print_to_builder(builder, "\t\t\t\tcase \"%\";\n", new_path);
|
print_to_builder(builder, "\t\t\t\tcase \"%\";\n", new_path);
|
||||||
|
|||||||
Reference in New Issue
Block a user