Start mission from hub.

This commit is contained in:
Steve 2018-02-18 09:29:37 +00:00
parent 2cd629cf86
commit 46d6ce1cd6
4 changed files with 10 additions and 6 deletions

View File

@ -71,6 +71,8 @@ void initHub(void)
memset(&keySprites, 0, sizeof(Sprite*) * MAX_KEY_TYPES); memset(&keySprites, 0, sizeof(Sprite*) * MAX_KEY_TYPES);
selectedMission = NULL;
loadMusic("music/61321__mansardian__news-background.ogg"); loadMusic("music/61321__mansardian__news-background.ogg");
atlasTexture = getTexture("gfx/atlas/atlas.png"); atlasTexture = getTexture("gfx/atlas/atlas.png");
@ -517,6 +519,8 @@ static void startMission(void)
saveGame(); saveGame();
stopMusic(); stopMusic();
initWorld();
} }
static void cancel(void) static void cancel(void)

View File

@ -49,6 +49,7 @@ extern void playMusic(int loop);
extern void stopMusic(void); extern void stopMusic(void);
extern void startSectionTransition(void); extern void startSectionTransition(void);
extern void endSectionTransition(void); extern void endSectionTransition(void);
extern void initWorld(void);
extern App app; extern App app;
extern Colors colors; extern Colors colors;

View File

@ -57,10 +57,10 @@ static void doDebugControls(void)
world.bob->weaponType = WPN_GRENADES; world.bob->weaponType = WPN_GRENADES;
} }
if (app.keyboard[SDL_SCANCODE_0]) if (app.keyboard[SDL_SCANCODE_0] && world.state != WS_COMPLETE)
{ {
saveGame(); stopMusic();
saveWorld(); world.state = WS_COMPLETE;
app.keyboard[SDL_SCANCODE_0] = 0; world.missionCompleteTimer = FPS * 3;
} }
} }

View File

@ -20,8 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "../common.h" #include "../common.h"
extern void saveGame(void); extern void stopMusic(void);
extern void saveWorld(void);
extern App app; extern App app;
extern Dev dev; extern Dev dev;