Component definitions now loaded from schema. No default values yet.

This commit is contained in:
sippeangelo
2015-12-08 18:07:32 +01:00
parent 03bbe25a1e
commit d7de4fc694
9 changed files with 504 additions and 46 deletions
+4 -2
View File
@@ -29,8 +29,10 @@ ComponentWrapper World::AttachComponent(EntityID entity, std::string componentTy
// Allocate space for the component
ComponentWrapper c = pool->Allocate(entity);
// Write default values
memcpy(c.Data, ci.Defaults.get(), ci.Meta.Stride);
// TODO: Write default values
if (ci.Defaults != nullptr) {
//memcpy(c.Data, ci.Defaults.get(), ci.Meta.Stride);
}
return c;
}