Ensure we draw entities when in observing mode.
This commit is contained in:
parent
17cb8bdc84
commit
bea993ece0
|
@ -260,6 +260,22 @@ void doEntities(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void doEntitiesStatic(void)
|
||||||
|
{
|
||||||
|
int camMidX, camMidY;
|
||||||
|
|
||||||
|
camMidX = camera.x + (SCREEN_WIDTH / 2);
|
||||||
|
camMidY = camera.y + (SCREEN_HEIGHT / 2);
|
||||||
|
|
||||||
|
for (self = world.entityHead.next ; self != NULL ; self = self->next)
|
||||||
|
{
|
||||||
|
if (getDistance(camMidX, camMidY, self->x, self->y) < SCREEN_WIDTH || isObserving())
|
||||||
|
{
|
||||||
|
self->isVisible = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void drawEntities(int plane)
|
void drawEntities(int plane)
|
||||||
{
|
{
|
||||||
int x, y, draw, i, t;
|
int x, y, draw, i, t;
|
||||||
|
|
|
@ -353,6 +353,8 @@ static void doWorldObserving(void)
|
||||||
|
|
||||||
cameraTrack(world.entityToTrack);
|
cameraTrack(world.entityToTrack);
|
||||||
|
|
||||||
|
doEntitiesStatic();
|
||||||
|
|
||||||
if (--world.observationTimer == 0)
|
if (--world.observationTimer == 0)
|
||||||
{
|
{
|
||||||
if (++observationIndex < MAX_ENTS_TO_OBSERVE && world.entitiesToObserve[observationIndex] != NULL)
|
if (++observationIndex < MAX_ENTS_TO_OBSERVE && world.entitiesToObserve[observationIndex] != NULL)
|
||||||
|
|
|
@ -42,6 +42,7 @@ extern int isSolid(int x, int y);
|
||||||
extern int isLiquid(int x, int y);
|
extern int isLiquid(int x, int y);
|
||||||
extern int isWalkable(int x, int y);
|
extern int isWalkable(int x, int y);
|
||||||
extern void doEntities(void);
|
extern void doEntities(void);
|
||||||
|
extern void doEntitiesStatic(void);
|
||||||
extern void doParticles(void);
|
extern void doParticles(void);
|
||||||
extern void doHud(void);
|
extern void doHud(void);
|
||||||
extern Entity *createEntity(char *typeStr);
|
extern Entity *createEntity(char *typeStr);
|
||||||
|
|
Loading…
Reference in New Issue