diff --git a/gfx/entities/jumpgate.png b/gfx/entities/jumpgate.png index 6da1c61..4548afc 100644 Binary files a/gfx/entities/jumpgate.png and b/gfx/entities/jumpgate.png differ diff --git a/gfx/entities/portal.png b/gfx/entities/portal.png new file mode 100644 index 0000000..82c87e0 Binary files /dev/null and b/gfx/entities/portal.png differ diff --git a/src/battle/entities.c b/src/battle/entities.c index c944702..54c4b1b 100644 --- a/src/battle/entities.c +++ b/src/battle/entities.c @@ -20,12 +20,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "entities.h" -static Entity deadHead; -static Entity *deadTail; - -static int disabledGlow; -static int disabledGlowDir; - static void drawEntity(Entity *e); static void doEntity(void); static void alignComponents(void); @@ -37,6 +31,13 @@ static int drawComparator(const void *a, const void *b); static void notifyNewArrivals(void); static int isCapitalShipComponent(Entity *e); +static SDL_Texture *jumpPortal; +static float jumpPortAngle; +static Entity deadHead; +static Entity *deadTail; +static int disabledGlow; +static int disabledGlowDir; + void initEntities(void) { memset(&deadHead, 0, sizeof(Entity)); @@ -45,6 +46,9 @@ void initEntities(void) disabledGlow = DISABLED_GLOW_MAX; disabledGlowDir = -DISABLED_GLOW_SPEED; + + jumpPortal = getTexture("gfx/entities/portal.png"); + jumpPortAngle = 0; } Entity *spawnEntity(void) @@ -253,6 +257,12 @@ void doEntities(void) { disabledGlowDir = -DISABLED_GLOW_SPEED; } + + jumpPortAngle += 0.5; + if (jumpPortAngle >= 360) + { + jumpPortAngle -= 360; + } } static void restrictToBattleArea(Entity *e) @@ -381,6 +391,11 @@ void drawEntities(void) static void drawEntity(Entity *e) { + if (e->type == ET_JUMPGATE) + { + blitRotated(jumpPortal, e->x - battle.camera.x, e->y - battle.camera.y, jumpPortAngle); + } + SDL_SetTextureColorMod(e->texture, 255, 255, 255); if (e->armourHit > 0) diff --git a/src/battle/entities.h b/src/battle/entities.h index 0d9f070..4656bdc 100644 --- a/src/battle/entities.h +++ b/src/battle/entities.h @@ -35,6 +35,8 @@ extern void drawShieldHitEffect(Entity *e); extern void removeFromQuadtree(Entity *e, Quadtree *root); extern void addToQuadtree(Entity *e, Quadtree *root); extern void updateCapitalShipComponentProperties(Entity *parent); +extern void drawJumpPortal(Entity *e); +extern SDL_Texture *getTexture(char *filename); extern App app; extern Battle battle; diff --git a/src/system/io.c b/src/system/io.c index f0a4857..74db09e 100644 --- a/src/system/io.c +++ b/src/system/io.c @@ -87,7 +87,7 @@ char *getSaveFilePath(char *filename) sprintf(path, "%s/%s", app.saveDir, filename); - SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO, "getSaveFilePath = '%s'", path); + SDL_LogMessage(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_DEBUG, "getSaveFilePath = '%s'", path); return path; }