A 3D game engine from scratch.

refactor spatial::ComponentSet into just spatial::state->components

+5 -12
+4 -7
src/spatial.cpp
··· 80 80 Array<spatial::Component> * 81 81 spatial::get_components() 82 82 { 83 - return &spatial::state->component_set.components; 83 + return &spatial::state->components; 84 84 } 85 85 86 86 87 87 spatial::Component * 88 88 spatial::get_component(entities::Handle entity_handle) 89 89 { 90 - return spatial::state->component_set.components[entity_handle]; 90 + return spatial::state->components[entity_handle]; 91 91 } 92 92 93 93 ··· 95 95 spatial::init(spatial::State *spatial_state, memory::Pool *asset_memory_pool) 96 96 { 97 97 spatial::state = spatial_state; 98 - spatial::state->component_set = { 99 - .components = Array<spatial::Component>( 100 - asset_memory_pool, MAX_N_ENTITIES, "spatial_components", true, 1 101 - ) 102 - }; 98 + spatial::state->components = Array<spatial::Component>( 99 + asset_memory_pool, MAX_N_ENTITIES, "spatial_components", true, 1); 103 100 }
+1 -5
src/spatial.hpp
··· 38 38 Component *last_model_matrix_spatial_component; 39 39 }; 40 40 41 - struct ComponentSet { 42 - Array<Component> components; 43 - }; 44 - 45 41 struct State { 46 - ComponentSet component_set; 42 + Array<Component> components; 47 43 }; 48 44 49 45