/*
-Copyright (C) 2004 Parallel Realities
+Copyright (C) 2004-2011 Parallel Realities
+Copyright (C) 2011-2015 Perpendicular Dimensions
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
#include "cutscene.h"
+List sceneList;
+
void createSceneList()
{
- char sceneLine[1024];
+ char sceneLine[1024] = "";
char *line = NULL;
int waitTime = 0;
Cutscene *scene = NULL;
line = strtok(NULL, "\n");
if (strcmp(line, "@none@") != 0)
{
- strncpy(scene->sprite, line, sizeof scene->sprite);
+ strlcpy(scene->sprite, line, sizeof scene->sprite);
debug(("Loading cutscene image %s\n", scene->sprite));
graphics.quickSprite(scene->sprite, graphics.loadImage(scene->sprite));
}
line = strtok(NULL, "\n");
}
- if (strcmp(line, "@none@") != 0)
+ if (scene && strcmp(line, "@none@") != 0)
{
scene->appendText(line);
}
char sceneLine[1024];
if (!engine.loadData(_("data/ending")))
- graphics.showErrorAndExit("Couldn't load cutscene data file (%s)", _("data/ending"));
+ return graphics.showErrorAndExit("Couldn't load cutscene data file (%s)", _("data/ending")), false;
char *line = strtok((char*)engine.dataBuffer, "\n");
int i = 0;
float panelAlpha = 0;
- SDL_SetAlpha(panel, SDL_SRCALPHA|SDL_RLEACCEL, 0);
+ SDL_SetAlpha(panel, 0);
engine.clearInput();
engine.flushInput();
if (panelAlpha < 256)
{
panelAlpha += (1 * engine.getTimeDifference());
- SDL_SetAlpha(panel, SDL_SRCALPHA|SDL_RLEACCEL, (int)panelAlpha);
+ SDL_SetAlpha(panel, panelAlpha);
if (image != NULL)
{
- SDL_SetAlpha(image, SDL_SRCALPHA|SDL_RLEACCEL, (int)panelAlpha);
+ SDL_SetAlpha(image, panelAlpha);
graphics.blit(image, 0, 0, graphics.screen, false);
}
graphics.blit(panel, 0, 390, graphics.screen, false);
return;
}
- audio.loadMusic("music/daisyChain2.mod");
-
char sceneName[1024];
snprintf(sceneName, sizeof sceneName, "%s Start", game.stageName);
if (setupScene(sceneName))
{
+ audio.loadMusic("music/cutscene");
showScene(true);
}
return;
}
- if (strcmp(game.stageName, "Final Battle") != 0)
- {
- audio.loadMusic("music/daisyChain2.mod");
- }
- else
- {
- audio.loadMusic("music/sweetDreams.xm");
- }
-
+
char sceneName[1024];
snprintf(sceneName, sizeof sceneName, "%s End", game.stageName);
if (setupScene(sceneName))
{
+ if (strcmp(game.stageName, "Final Battle") != 0)
+ {
+ audio.loadMusic("music/cutscene");
+ }
+ else
+ {
+ audio.loadMusic("music/end");
+ }
+
showScene(allowSkip);
}
graphics.free();
audio.free();
- audio.loadMusic("music/friendDied.mod");
+ audio.loadMusic("music/gameover");
setupScene("Easy Game Finished");
showScene(true);
audio.fadeMusic();