From 97fd71c3db929abcbbeb692687372b0e4489b464 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 28 Jan 2018 04:31:04 +0000 Subject: [PATCH] Add EVENT_DISPLAYOVERHEADMAPPLAYER. RETURN is the tilenum to be displayed. It is pre-populated with what the game will display for the current frame. Set RETURN to -1 to disable. git-svn-id: https://svn.eduke32.com/eduke32@6608 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/events_defs.h | 1 + source/duke3d/src/gamedef.cpp | 1 + source/duke3d/src/screens.cpp | 5 +++++ 3 files changed, 7 insertions(+) diff --git a/source/duke3d/src/events_defs.h b/source/duke3d/src/events_defs.h index 2da2bb77d..62d81e688 100644 --- a/source/duke3d/src/events_defs.h +++ b/source/duke3d/src/events_defs.h @@ -141,6 +141,7 @@ enum GameEvent_t { EVENT_EXITGAMESCREEN, EVENT_EXITPROGRAMSCREEN, EVENT_ALTWEAPON, + EVENT_DISPLAYOVERHEADMAPPLAYER, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index e73c06a44..9146270ae 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -737,6 +737,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_EXITGAMESCREEN", "EVENT_EXITPROGRAMSCREEN", "EVENT_ALTWEAPON", + "EVENT_DISPLAYOVERHEADMAPPLAYER", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index c0214103e..5cb303dbc 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -593,6 +593,11 @@ static void G_DrawOverheadMap(int32_t cposx, int32_t cposy, int32_t czoom, int16 else i = APLAYERTOP; + int32_t i = VM_OnEventWithReturn(EVENT_DISPLAYOVERHEADMAPPLAYER, g_player[p].ps->i, p, i); + + if (i < 0) + continue; + j = klabs(g_player[p].ps->truefz-g_player[p].ps->pos.z)>>8; j = mulscale16(czoom*(sprite[g_player[p].ps->i].yrepeat+j), yxaspect);