Commit 8155b64d by William Bundy

rituals build 124

parent 77810235
git add --all
git commit -m "rituals build 123"
git commit -m "rituals build 124"
git push
git push github
122
1475278343.323119
123
1475278349.902413
......@@ -162,13 +162,42 @@ int main(int argc, char** argv)
//Print struct typedefs
Struct_Def* s_head = structdef;
Meta_Type* type_start = arena_push_struct(arena, Meta_Type);
Meta_Type* type_head = type_start;
do {
if(s_head->name == NULL) continue;
printf("typedef struct %s %s;\n", s_head->name, s_head->name);
if(type_head == NULL) {
type_head = get_types_in_struct(s_head, type_start, Work_Arena);
} else {
type_head = get_types_in_struct(s_head, type_head, Work_Arena);
}
} while(s_head = s_head->next);
type_head = type_start;
Meta_Type* unique_type_start = arena_push_struct(Work_Arena, Meta_Type);
*unique_type_start = *type_start;
unique_type_start->next = NULL;
Meta_Type* unique_type_head = unique_type_start;
do {
bool eq = true;
unique_type_head = unique_type_start;
do {
if(meta_type_equals(type_head, unique_type_head)) {
eq = false;
break;
}
} while(unique_type_head = unique_type_head->next);
if(eq) {
unique_type_head->next = arena_push_struct(Work_Arena, Meta_Type);
unique_type_head = unique_type_head->next;
*unique_type_head = *type_head;
}
} while(type_head = type_head->next);
} while(s_head = s_head->next);
//Print Meta_Types for structs
Struct_Def** all_structs = arena_push_array(Work_Arena,
......
......@@ -1347,23 +1347,16 @@ void populate_meta_type(Struct_Member* member, Struct_Kind kind, Struct_Def* par
}
}
void _get_types_in_struct(Struct_Def* def, Meta_Type* head, Memory_Arena* arena)
Meta_Type* get_types_in_struct(Struct_Def* def, Meta_Type* head, Memory_Arena* arena)
{
for(isize i = 0; i < def->member_count; ++i) {
populate_meta_type(def->members + i, def->member_kinds[i], def, head);
head->next = arena_push_struct(arena, Meta_Type);
head = head->next;
}
return head;
}
Meta_Type* get_types_in_struct(Struct_Def* def, Memory_Arena* arena)
{
Meta_Type* start = arena_push_struct(arena, Meta_Type);
_get_types_in_struct(def, start, arena);
return start;
}
enum Meta_Flags
{
MetaFlag_IsPointer = Flag(0),
......
......@@ -1358,7 +1358,6 @@ _get_member_address src/rituals_renderer.cpp 131;" d file:
_get_member_address src/wtb_sprite_renderer.h 123;" d
_get_sprite_y_base src/rituals_renderer.cpp 80;" d file:
_get_sprite_y_base src/wtb_sprite_renderer.h 72;" d
_get_types_in_struct src/metaprogram/metaprogram_parser.cpp /^void _get_types_in_struct(Struct_Def* def, Meta_Type* head, Memory_Arena* arena)$/;" f
_gl_offset src/rituals_renderer.cpp 132;" d file:
_gl_offset src/wtb_sprite_renderer.h 124;" d
_h src/thirdparty/tinydir.h /^ HANDLE _h;$/;" m struct:tinydir_dir
......@@ -1725,7 +1724,7 @@ generate_world_area src/rituals_world.cpp /^void generate_world_area(World* worl
get_area_file src/rituals_serialization.cpp /^FILE* get_area_file(const char* name, isize id, const char* mode)$/;" f
get_next_file src/metaprogram/metaprogram_parser.cpp /^Lexer_File* get_next_file(Lexer* lex)$/;" f
get_next_grid_cell src/rituals_simulation.cpp /^Sim_Grid_Cell* get_next_grid_cell(Sim_Static_Grid* grid)$/;" f
get_types_in_struct src/metaprogram/metaprogram_parser.cpp /^Meta_Type* get_types_in_struct(Struct_Def* def, Memory_Arena* arena)$/;" f
get_types_in_struct src/metaprogram/metaprogram_parser.cpp /^Meta_Type* get_types_in_struct(Struct_Def* def, Meta_Type* head, Memory_Arena* arena)$/;" f
get_world_file src/rituals_serialization.cpp /^FILE* get_world_file(const char* name, const char* mode)$/;" f
glActiveTexture src/thirdparty/gl_core_3_3.h 1118;" d
glAttachShader src/thirdparty/gl_core_3_3.h 1195;" d
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment