diff --git a/polymer/eduke32/source/anim.c b/polymer/eduke32/source/anim.c index 7e941d7e3..3c18c0a61 100644 --- a/polymer/eduke32/source/anim.c +++ b/polymer/eduke32/source/anim.c @@ -207,7 +207,7 @@ static void endanimvol43(int32_t fr) } } -void G_PlayAnim(const char *fn, char t) +int32_t G_PlayAnim(const char *fn, char t) { uint8_t *animbuf; int32_t i, length=0, numframes=0; @@ -216,6 +216,7 @@ void G_PlayAnim(const char *fn, char t) #endif int32_t handle=-1; int32_t frametime = 0; + int32_t running = 1; // t parameter: // @@ -237,6 +238,7 @@ void G_PlayAnim(const char *fn, char t) if (I_CheckAllInput()) { FX_StopAllSounds(); + running = 0; goto end_anim; } @@ -249,7 +251,6 @@ void G_PlayAnim(const char *fn, char t) animvpx_codec_ctx codec; uint8_t *pic; uint32_t msecsperframe, nextframetime; - int32_t running = 1; int32_t animidx, framenum=0, soundidx=0, numtotalsounds=0; // custom anim sounds Bstrncpyz(vpxfn, fn, BMAX_PATH); @@ -273,7 +274,7 @@ void G_PlayAnim(const char *fn, char t) OSD_Printf("Failed reading IVF file: %s\n", animvpx_read_ivf_header_errmsg[i]); kclose(handle); - return; + return 0; } animvpx_setup_glstate(); @@ -281,7 +282,7 @@ void G_PlayAnim(const char *fn, char t) { OSD_Printf("Error initializing VPX codec.\n"); animvpx_restore_glstate(); - return; + return 0; } animidx = t-1; @@ -352,14 +353,14 @@ void G_PlayAnim(const char *fn, char t) animvpx_uninit_codec(&codec); I_ClearAllInput(); - return; // done with playing VP8! + return !running; // done with playing VP8! } #endif // ANM playback --- v v v --- handle = kopen4load(fn, 0); if (handle == -1) - return; + return 0; length = kfilelength(handle); if (length == 0) @@ -421,7 +422,10 @@ void G_PlayAnim(const char *fn, char t) G_HandleAsync(); if (I_CheckAllInput()) + { + running = 0; goto end_anim_restore_gl; + } if (g_restorePalette == 1) { @@ -464,4 +468,6 @@ end_anim: I_ClearAllInput(); ANIM_FreeAnim(); walock[TILE_ANIM] = 1; + + return !running; } diff --git a/polymer/eduke32/source/anim.h b/polymer/eduke32/source/anim.h index a496464fd..cc4c1c312 100644 --- a/polymer/eduke32/source/anim.h +++ b/polymer/eduke32/source/anim.h @@ -29,7 +29,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. extern uint16_t anim_hi_numsounds[NUM_HARDCODED_ANIMS], *anim_hi_sounds[NUM_HARDCODED_ANIMS]; # endif -void G_PlayAnim(const char *fn,char t); +int32_t G_PlayAnim(const char *fn,char t); /* void endanimvol43(int32_t fr); void endanimvol42(int32_t fr); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index e93792ff0..253623d30 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -12300,17 +12300,24 @@ static void G_BonusCutscenes(void) if (ud.lockout == 0) { I_ClearInputWaiting(); - G_PlayAnim("vol4e1.anm",8); + t = G_PlayAnim("vol4e1.anm",8); clearallviews(0L); nextpage(); - G_PlayAnim("vol4e2.anm",10); + if (t) + goto end_vol4e; + + t = G_PlayAnim("vol4e2.anm",10); clearallviews(0L); nextpage(); + if (t) + goto end_vol4e; + G_PlayAnim("vol4e3.anm",11); clearallviews(0L); nextpage(); } +end_vol4e: FX_StopAllSounds(); S_ClearSoundLocks(); S_PlaySound(ENDSEQVOL3SND4); diff --git a/polymer/eduke32/source/premap.c b/polymer/eduke32/source/premap.c index 03e15ef8d..62be6655a 100644 --- a/polymer/eduke32/source/premap.c +++ b/polymer/eduke32/source/premap.c @@ -1390,15 +1390,23 @@ void G_NewGame(int32_t vn, int32_t ln, int32_t sk) clearview(0L); nextpage(); - G_PlayAnim("vol41a.anm",6); + i = G_PlayAnim("vol41a.anm",6); clearview(0L); nextpage(); + if (i) + goto end_vol4a; + + i = G_PlayAnim("vol42a.anm",7); + clearview(0L); + nextpage(); + if (i) + goto end_vol4a; - G_PlayAnim("vol42a.anm",7); G_PlayAnim("vol43a.anm",9); clearview(0L); nextpage(); +end_vol4a: FX_StopAllSounds(); }