#include "gamemem.h"
#include "entities.h"

tGameEntity *gFirstEntity=NULL,*gCameraEntity,*gViewedEntity;
int gEntityID=0;

void EntityResetCount()
{
	gEntityID=0;
}

tGameEntity *EntityNew(tGameEntity *prev)
{
	tGameEntity *entity=(tGameEntity*)MemoryAllocateZeroedBlock(sizeof(tGameEntity));
	entity->next=prev->next;
	entity->prev=prev;
	((tGameEntity*)(prev->next))->prev=entity;
	prev->next=entity;	
	MatrixIdentity(entity->dir);
	MatrixIdentity(entity->rVelo);
	entity->id=gEntityID++;
	return entity;
}
