void replay_play(Replay *rpy, int firstidx) { if(rpy != &global.replay) { replay_copy(&global.replay, rpy, true); } if(firstidx >= global.replay.numstages || firstidx < 0) { log_warn("No stage #%i in the replay", firstidx); return; } global.replaymode = REPLAY_PLAY; for(int i = firstidx; i < global.replay.numstages; ++i) { ReplayStage *rstg = global.replay_stage = global.replay.stages+i; StageInfo *gstg = stage_get(rstg->stage); if(!gstg) { log_warn("Invalid stage %x in replay at %i skipped.", rstg->stage, i); continue; } global.plr.mode = plrmode_find(rstg->plr_char, rstg->plr_shot); stage_loop(gstg); if(global.game_over == GAMEOVER_ABORT) { break; } if(global.game_over == GAMEOVER_RESTART) { --i; } global.game_over = 0; } global.game_over = 0; global.replaymode = REPLAY_RECORD; replay_destroy(&global.replay); global.replay_stage = NULL; free_resources(false); }
void stage4_loop() { ShaderRule shaderrules[] = { stage4_fog, NULL }; stage_loop(stage_get(4), stage4_start, stage4_end, stage4_draw, stage4_events, shaderrules, 5550); }