Redline/source/entities.cpp
maride 02061d74c2 Original 1.0.5 code
(as received from Jonas Echterhoff)
2016-04-02 14:43:55 +02:00

24 lines
510 B
C++
Executable File

#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;
}