diff --git a/src/challenges/challengeHome.c b/src/challenges/challengeHome.c index ab33b50..b953bcb 100644 --- a/src/challenges/challengeHome.c +++ b/src/challenges/challengeHome.c @@ -60,13 +60,13 @@ void initChallengeHome(void) app.delegate.draw = &draw; memset(&app.keyboard, 0, sizeof(int) * MAX_KEYBOARD_KEYS); - background = getTexture("gfx/backgrounds/background06.jpg"); - planetTexture = getTexture("gfx/planets/bluePlanet.png"); + background = getTexture(getBackgroundTextureName(rand())); + planetTexture = getTexture(getPlanetTextureName(rand())); battle.camera.x = battle.camera.y = 0; - planet.x = SCREEN_WIDTH; - planet.y = (rand() % SCREEN_HEIGHT - 128); + planet.x = rand() % SCREEN_WIDTH; + planet.y = rand() % SCREEN_HEIGHT; game.currentMission = NULL; @@ -174,7 +174,7 @@ static void draw(void) { drawBackground(background); - blit(planetTexture, planet.x, planet.y, 0); + blit(planetTexture, planet.x, planet.y, 1); drawStars(); diff --git a/src/challenges/challengeHome.h b/src/challenges/challengeHome.h index 3d23165..d0a517e 100644 --- a/src/challenges/challengeHome.h +++ b/src/challenges/challengeHome.h @@ -55,6 +55,8 @@ extern void selectWidget(const char *name, const char *group); extern void updateAllMissions(void); extern char *getTranslatedString(char *string); extern void blit(SDL_Texture *t, int x, int y, int centered); +extern char *getBackgroundTextureName(int n); +extern char *getPlanetTextureName(int n); extern App app; extern Battle battle; diff --git a/src/draw/background.c b/src/draw/background.c index 4b139ce..7461128 100644 --- a/src/draw/background.c +++ b/src/draw/background.c @@ -113,12 +113,12 @@ void drawBackground(SDL_Texture *texture) } } -char *getBackgroundTexture(int i) +char *getBackgroundTextureName(int i) { return backgrounds[i % numBackgrounds]; } -char *getPlanetTexture(int i) +char *getPlanetTextureName(int i) { return planets[i % numPlanets]; } diff --git a/src/galaxy/mission.c b/src/galaxy/mission.c index 48eecd2..28bcdf0 100644 --- a/src/galaxy/mission.c +++ b/src/galaxy/mission.c @@ -228,7 +228,7 @@ static char *getAutoBackground(char *filename) hash = hashcode(filename); } - return getBackgroundTexture(hash); + return getBackgroundTextureName(hash); } static char *getAutoPlanet(char *filename) @@ -244,7 +244,7 @@ static char *getAutoPlanet(char *filename) hash = hashcode(filename); } - return getPlanetTexture(hash); + return getPlanetTextureName(hash); } void completeMission(void) diff --git a/src/galaxy/mission.h b/src/galaxy/mission.h index faccf16..c2a62dd 100644 --- a/src/galaxy/mission.h +++ b/src/galaxy/mission.h @@ -51,8 +51,8 @@ extern void initMissionInfo(void); extern char *getTranslatedString(char *string); extern void updateStarSystemMissions(void); extern void updateChallengeMissions(void); -extern char *getBackgroundTexture(int n); -extern char *getPlanetTexture(int n); +extern char *getBackgroundTextureName(int n); +extern char *getPlanetTextureName(int n); extern Battle battle; extern Entity *player;