Tiny refactor

This commit is contained in:
2024-10-18 16:12:24 +02:00
parent 8ee000ab74
commit 1d5b4499a4
38 changed files with 645 additions and 637 deletions

View File

@@ -262,7 +262,7 @@ generate_code :: (w: Workspace) {
builder: String_Builder;
for entity_type_names {
print_to_builder(*builder, "new_%1 :: (scene: *Scene = null) -> *%2 { _scene := scene;\nif _scene == null { \n_scene = current_scene; }\np, locator := find_and_occupy_empty_slot(*_scene.by_type._%2); p._locator = locator; register_entity(_scene, p); p.transform = create_identity_transform(); init_entity(p); return p; }\n", to_lower_copy_new(it,, allocator=temp), it);
print_to_builder(*builder, "new_%1 :: (scene: *Scene = null) -> *%2 { _scene := scene;\nif _scene == null { \n_scene = engine.current_scene; }\np, locator := find_and_occupy_empty_slot(*_scene.by_type._%2); p._locator = locator; register_entity(_scene, p); p.transform = create_identity_transform(); init_entity(p); return p; }\n", to_lower_copy_new(it,, allocator=temp), it);
}
add_build_string(builder_to_string(*builder), w);