From ef28cac9196289f97acd78f7753ca70d633da6b0 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sun, 8 Mar 2015 07:58:06 +0000 Subject: [PATCH] CON: Add EVENT_DISPLAYCAMERAOSD. Set RETURN to -1 to disable it. From this event, if "getactor[THISACTOR].htg_t 0" is zero, then the camera is functional. Nonzero values indicate the camera has been destroyed, which is only possible when the CAMERASDESTRUCTABLE parameter of gamestartup has been enabled. git-svn-id: https://svn.eduke32.com/eduke32@5046 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/events_defs.h | 1 + polymer/eduke32/source/game.c | 3 +++ polymer/eduke32/source/gamedef.c | 1 + polymer/eduke32/source/lunatic/con_lang.lua | 3 ++- 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/events_defs.h b/polymer/eduke32/source/events_defs.h index a2c6bbe4e..fe2ee6ddb 100644 --- a/polymer/eduke32/source/events_defs.h +++ b/polymer/eduke32/source/events_defs.h @@ -107,6 +107,7 @@ enum GameEvent_t { EVENT_CUTSCENE, EVENT_DISPLAYCURSOR, EVENT_DISPLAYLEVELSTATS, + EVENT_DISPLAYCAMERAOSD, #ifdef LUNATIC EVENT_ANIMATEALLSPRITES, #endif diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 40c7bacfa..c0dca4011 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -12944,6 +12944,9 @@ void G_BonusScreen(int32_t bonusonly) static void G_DrawCameraText(int16_t i) { + if (VM_OnEvent(EVENT_DISPLAYCAMERAOSD, i, screenpeek) != 0) + return; + if (!T1) { rotatesprite_win(24<<16,33<<16,65536L,0,CAMCORNER,0,0,2); diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 8a7d14c66..2898c1667 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -672,6 +672,7 @@ const char *EventNames[MAXEVENTS] = "EVENT_CUTSCENE", "EVENT_DISPLAYCURSOR", "EVENT_DISPLAYLEVELSTATS", + "EVENT_DISPLAYCAMERAOSD", #ifdef LUNATIC "EVENT_ANIMATEALLSPRITES", #endif diff --git a/polymer/eduke32/source/lunatic/con_lang.lua b/polymer/eduke32/source/lunatic/con_lang.lua index 1898212d0..19b082b28 100644 --- a/polymer/eduke32/source/lunatic/con_lang.lua +++ b/polymer/eduke32/source/lunatic/con_lang.lua @@ -179,11 +179,12 @@ EVENT = { EVENT_CUTSCENE = 99, EVENT_DISPLAYCURSOR = 100, EVENT_DISPLAYLEVELSTATS = 101, + EVENT_DISPLAYCAMERAOSD = 102, -- EVENT_ANIMATEALLSPRITES = previous+1, -- internal -- KEEPINSYNC with MAXEVENTS below } -MAXEVENTS = 102 -- KEEPINSYNC with above EVENT_* list +MAXEVENTS = 103 -- KEEPINSYNC with above EVENT_* list -- NOTE: negated values are not exported to the ffi.C namespace or CON. -- See TWEAK_SFLAG below.