From 1377afe41431f06ee0efd4b6ad614cf6acc240d5 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 29 Nov 2017 07:29:04 +0000 Subject: [PATCH] CON: Add EVENT_PRECUTSCENE. Used with startcutscene. RETURN sets the frame of an ANM before it is rendered. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6506 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/anim.cpp | 4 ++++ source/duke3d/src/events_defs.h | 1 + source/duke3d/src/gamedef.cpp | 1 + 3 files changed, 6 insertions(+) diff --git a/source/duke3d/src/anim.cpp b/source/duke3d/src/anim.cpp index 26f0af39f..849e88203 100644 --- a/source/duke3d/src/anim.cpp +++ b/source/duke3d/src/anim.cpp @@ -323,6 +323,8 @@ int32_t Anim_Play(const char *fn) if (!pic) break; // no more pics! + VM_OnEventWithReturn(EVENT_PRECUTSCENE, -1, myconnectindex, framenum); + animvpx_render_frame(&codec); VM_OnEventWithReturn(EVENT_CUTSCENE, -1, myconnectindex, framenum); @@ -466,6 +468,8 @@ int32_t Anim_Play(const char *fn) if (totalclock < ototalclock - 1) continue; + i = VM_OnEventWithReturn(EVENT_PRECUTSCENE, -1, myconnectindex, i); + waloff[TILE_ANIM] = (intptr_t)ANIM_DrawFrame(i); invalidatetile(TILE_ANIM, 0, 1 << 4); // JBF 20031228 diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index e5bcc5e4b..e341318d6 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -125,6 +125,7 @@ enum GameEvent_t { EVENT_DISPLAYOVERHEADMAPTEXT, EVENT_PRELOADGAME, EVENT_POSTSAVEGAME, + EVENT_PRECUTSCENE, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index baf4c06c3..55fa84ce5 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -719,6 +719,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_DISPLAYOVERHEADMAPTEXT", "EVENT_PRELOADGAME", "EVENT_POSTSAVEGAME", + "EVENT_PRECUTSCENE", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif