-update README code example (to one that compile)

-remove Entity.instance and gEM, global manager is now gEntityManager
This commit is contained in:
Mergul 2021-03-02 19:44:18 +01:00
parent d1c48e4c5f
commit 3b954b732b
11 changed files with 617 additions and 604 deletions

View file

@ -119,7 +119,7 @@ struct GUIManager
// void addComponent(ComponentRef comp, const (char)* name)
// {
// uint size = EntityManager.instance.components[becsID(comp)].size;
// uint size = gEntityManager.components[becsID(comp)].size;
// void* data = malloc(size);
// memcpy(data, comp.ptr, size);
// components.add(ComponentGUI(name, data, becsID(comp)));
@ -127,7 +127,7 @@ struct GUIManager
void addComponent(T)(T comp, const (char)* name)
{
uint size = EntityManager.instance.components[becsID(comp)].size;
uint size = gEntityManager.components[becsID(comp)].size;
void* data = malloc(size);
memcpy(data, &comp, size);
components.add(ComponentGUI(name, data, becsID(comp)));
@ -472,7 +472,7 @@ struct GUIManager
break;
case Tool.selector:
{
Entity* entity = gEM.getEntity(launcher.selected_entity);
Entity* entity = gEntityManager.getEntity(launcher.selected_entity);
style.Colors[ImGuiCol_Header] = col;
entityComponentsGUI(entity);
}