From 156a5dac8f0e0846e39a3a1d711fd89b43576984 Mon Sep 17 00:00:00 2001 From: Steve Date: Tue, 6 Feb 2018 07:32:08 +0000 Subject: [PATCH] isOnScreen -> isVisible. --- src/combat/explosions.h | 1 - src/structs.h | 2 +- src/world/effects.h | 1 - src/world/entities.c | 12 ++++++------ src/world/items.h | 1 - src/world/world.c | 2 +- 6 files changed, 8 insertions(+), 11 deletions(-) diff --git a/src/combat/explosions.h b/src/combat/explosions.h index 596fcec..779dcc2 100644 --- a/src/combat/explosions.h +++ b/src/combat/explosions.h @@ -28,4 +28,3 @@ extern Entity **getAllEntsWithin(int x, int y, int w, int h, Entity *ignore); extern int getDistance(int x1, int y1, int x2, int y2); extern void swapSelf(Entity *e); -extern Entity *self; diff --git a/src/structs.h b/src/structs.h index 6e966ff..f072598 100644 --- a/src/structs.h +++ b/src/structs.h @@ -130,7 +130,7 @@ struct Entity { int isSolid; int isStatic; int isOnGround; - int isOnScreen; + int isVisible; int isMissionTarget; int observationTime; Entity *riding; diff --git a/src/world/effects.h b/src/world/effects.h index 545aaf0..f6c0d36 100644 --- a/src/world/effects.h +++ b/src/world/effects.h @@ -25,4 +25,3 @@ extern Sprite *getSprite(char *name); extern void initFleshChunk(Decoration *d); extern void initDebris(Decoration *d); -extern World world; diff --git a/src/world/entities.c b/src/world/entities.c index cc3188f..57e6384 100644 --- a/src/world/entities.c +++ b/src/world/entities.c @@ -91,7 +91,7 @@ void doEntities(void) removeFromQuadtree(self, &world.quadtree); - self->isOnScreen = 0; + self->isVisible = 0; if (self->flags & EF_TELEPORTING) { @@ -102,7 +102,7 @@ void doEntities(void) if ((self->flags & EF_ALWAYS_PROCESS) > 0 || getDistance(camMidX, camMidY, self->x, self->y) < SCREEN_WIDTH || isObserving()) { - self->isOnScreen = 1; + self->isVisible = 1; } else if (self->flags & EF_KILL_OFFSCREEN) { @@ -111,7 +111,7 @@ void doEntities(void) self->riding = NULL; - if (self->isOnScreen) + if (self->isVisible) { memset(touched, 0, sizeof(Entity*) * MAX_TOUCHED); @@ -124,7 +124,7 @@ void doEntities(void) if (self->flags & EF_GONE) { - self->isOnScreen = 0; + self->isVisible = 0; continue; } @@ -178,7 +178,7 @@ void doEntities(void) if ((self->flags & EF_FLICKER) && flicker) { - self->isOnScreen = 0; + self->isVisible = 0; } if (self->alive == ALIVE_DEAD) @@ -231,7 +231,7 @@ void drawEntities(int plane) for (i = 0, self = candidates[i] ; self != NULL ; self = candidates[++i]) { - draw = self->isOnScreen && !(self->flags & EF_GONE) && self->plane == plane; + draw = self->isVisible && !(self->flags & EF_GONE) && self->plane == plane; if (draw) { diff --git a/src/world/items.h b/src/world/items.h index a022ac2..9503773 100644 --- a/src/world/items.h +++ b/src/world/items.h @@ -20,7 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "../common.h" -extern Entity *initItem(void); extern int rrnd(int low, int high); extern int getRandomPlayerWeapon(int excludeGrenades); extern Sprite *getSprite(char *name); diff --git a/src/world/world.c b/src/world/world.c index 54e22e6..b3e4eef 100644 --- a/src/world/world.c +++ b/src/world/world.c @@ -500,7 +500,7 @@ void observeActivation(Entity *e) { int i; - if (e->observationTime < SDL_GetTicks() && !e->isOnScreen) + if (e->observationTime < SDL_GetTicks() && !e->isVisible) { for (i = 0 ; i < MAX_ENTS_TO_OBSERVE ; i++) {