-EntityTemplate.getComponent additional data check
-LinearLayout proggress: *added alignment to data *fixed add/remove component functions
This commit is contained in:
parent
c18ac54265
commit
c915b1a8c7
3 changed files with 63 additions and 38 deletions
|
|
@ -45,6 +45,7 @@ export struct EntityTemplate
|
|||
|
||||
T* getComponent(T)()
|
||||
{
|
||||
if(T.component_id >= info.tmpl_deltas.length)return null;
|
||||
version(LinearLayout)return cast(T*)(entity_data.ptr + info.tmpl_deltas[T.component_id]);
|
||||
else return cast(T*)(entity_data.ptr + info.deltas[T.component_id]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue