From c9981e76af9a207c888bd8654c019277f9c58945 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 29 Nov 2017 07:29:23 +0000 Subject: [PATCH] CON: Add EVENT_DISPLAYEND and EVENT_DISPLAYROOMSEND. EVENT_DISPLAYROOMSEND: Triggered right after the game world is rendered and before any sprite above the screen. EVENT_DISPLAYEND: Triggered after the game draws everything above the screen, including menus. A counterpart to EVENT_DISPLAYSTART. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6512 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/events_defs.h | 2 ++ source/duke3d/src/game.cpp | 2 ++ source/duke3d/src/gamedef.cpp | 2 ++ source/duke3d/src/screens.cpp | 2 ++ 4 files changed, 8 insertions(+) diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index c4a5fc721..4d2ec193e 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -128,6 +128,8 @@ enum GameEvent_t { EVENT_PRECUTSCENE, EVENT_SKIPCUTSCENE, EVENT_SCREEN, + EVENT_DISPLAYROOMSEND, + EVENT_DISPLAYEND, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 6c5814621..6793459fe 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -1168,6 +1168,8 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) newaspect_enable = 0; setaspect(viewingRange, yxAspect); } + + VM_OnEvent(EVENT_DISPLAYROOMSEND, g_player[screenpeek].ps->i, screenpeek); } void G_DumpDebugInfo(void) diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 7165b8616..58299a4f0 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -724,6 +724,8 @@ const char *EventNames[MAXEVENTS] = "EVENT_PRECUTSCENE", "EVENT_SKIPCUTSCENE", "EVENT_SCREEN", + "EVENT_DISPLAYROOMSEND", + "EVENT_DISPLAYEND", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index 319e7c860..b1cd0ca9b 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -1293,6 +1293,8 @@ void G_DisplayRest(int32_t smoothratio) applied = 0; } } + + VM_OnEvent(EVENT_DISPLAYEND, g_player[screenpeek].ps->i, screenpeek); } void G_FadePalette(int32_t r, int32_t g, int32_t b, int32_t e)