Skip to content

Commit

Permalink
Merge pull request #345 from icosahedral-dragon/demo-support
Browse files Browse the repository at this point in the history
Demo support
  • Loading branch information
Interrupt authored Jan 8, 2020
2 parents d505761 + 0a191b9 commit 06d882e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
13 changes: 7 additions & 6 deletions src/GameSrc/Headers/setploop.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define SETUP_ANIM_UPDATE LL_CHG_BASE << 0

// loop id's
#define SETUP_ANIM 0
#define SETUP_JOURNEY 1
#define SETUP_DIFFICULTY 2
#define SETUP_CREDITS 3
#define SETUP_CONTINUE 4
typedef enum {
SETUP_JOURNEY,
SETUP_DIFFICULTY,
SETUP_CREDITS,
SETUP_CONTINUE
} SetupMode;

// Prototypes
void setup_loop(void);
void journey_credits_done(void);
errtype journey_credits_func(uchar draw_stuff);

// Globals
extern int setup_mode;
extern SetupMode setup_mode;

#endif // __SETPLOOP_H
7 changes: 6 additions & 1 deletion src/GameSrc/cutsloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,12 @@ short play_cutscene(int id, bool show_credits)
MacTuneKillCurrentTheme();

cutscene_filehandle = ResOpenFile(cutscene_files[id]);
if (cutscene_filehandle <= 0) return 0;
if (cutscene_filehandle <= 0) {
// If we failed to play the cutscene, go to setup / credits.
_new_mode = SETUP_LOOP;
chg_set_flg(GL_CHG_LOOP);
return 0;
}

INFO("Playing Cutscene %i", id);

Expand Down
8 changes: 3 additions & 5 deletions src/GameSrc/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,8 @@ uiSlab setup_slab;
LGRegion setup_root_region;
uchar play_intro_anim;
uchar save_game_exists = FALSE;
int setup_mode;
int last_setup_mode;
SetupMode setup_mode;
SetupMode last_setup_mode;
int intro_num;
int splash_num;
int diff_sum = 0;
Expand Down Expand Up @@ -1516,7 +1516,6 @@ void setup_loop(void)
case SETUP_DIFFICULTY: difficulty_draw(draw_stuff); break;
case SETUP_JOURNEY: journey_draw(draw_stuff); break;
case SETUP_CONTINUE: journey_continue_func(draw_stuff); break;
case SETUP_ANIM: break; // FIXME: What should this do?
case SETUP_CREDITS: journey_credits_func(draw_stuff); break;
}
}
Expand Down Expand Up @@ -1585,13 +1584,12 @@ void setup_start(void)
if (!save_game_exists && start_first_time)
{
play_intro_anim = TRUE;
setup_mode = SETUP_ANIM;
}
else
{
play_intro_anim = FALSE;
setup_mode = SETUP_JOURNEY;
}
setup_mode = SETUP_JOURNEY;
}

if (!start_first_time) closedown_game(TRUE);
Expand Down

0 comments on commit 06d882e

Please sign in to comment.