Component definitions and default values loading from schema

This commit is contained in:
2015-12-08 21:38:52 +01:00
parent 1e1ce4e127
commit 0dbe0fe48e
5 changed files with 130 additions and 27 deletions
+2 -4
View File
@@ -29,10 +29,8 @@ ComponentWrapper World::AttachComponent(EntityID entity, std::string componentTy
// Allocate space for the component
ComponentWrapper c = pool->Allocate(entity);
// TODO: Write default values
if (ci.Defaults != nullptr) {
//memcpy(c.Data, ci.Defaults.get(), ci.Meta.Stride);
}
// Write default values
memcpy(c.Data, ci.Defaults.get(), ci.Meta.Stride);
return c;
}