From 74908b1defcbee14c52eb19a8abdf187b5583fce Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Wed, 29 Nov 2017 07:29:14 +0000 Subject: [PATCH] CON: Add screenpal command. screenpal Similar to palfrom, but works on screen events. Values range from 0 to 255. Patch from Fox. git-svn-id: https://svn.eduke32.com/eduke32@6509 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/duke3d/src/gamedef.cpp | 5 +++++ source/duke3d/src/gamedef.h | 1 + source/duke3d/src/gameexec.cpp | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index e08aef93a..7165b8616 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -411,6 +411,7 @@ static tokenmap_t const vm_keywords[] = { "savemapstate", CON_SAVEMAPSTATE }, { "savenn", CON_SAVENN }, { "scalevar", CON_SCALEVAR }, + { "screenpal", CON_SCREENPAL }, { "screensound", CON_SCREENSOUND }, { "screentext", CON_SCREENTEXT }, { "scriptsize", CON_SCRIPTSIZE }, @@ -3656,6 +3657,10 @@ DO_DEFSTATE: } continue; + case CON_SCREENPAL: + C_GetManyVars(4); + continue; + case CON_HITRADIUSVAR: case CON_DRAWLINE256: C_GetManyVars(5); diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index f63a0345c..30290e83e 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -1147,6 +1147,7 @@ enum ScriptKeywords_t CON_STOPALLMUSIC, // 407 CON_ACTORSOUND, // 408 CON_STARTSCREEN, // 409 + CON_SCREENPAL, // 410 CON_END }; // KEEPINSYNC with the keyword list in lunatic/con_lang.lua diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 70cff5f02..712ba6273 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -3756,6 +3756,15 @@ nullquote: } continue; + case CON_SCREENPAL: + insptr++; + { + int32_t params[4]; + Gv_FillWithVars(params); + setpalettefade(params[0], params[1], params[2], params[3]); + } + continue; + case CON_SECTOROFWALL: insptr++; tw = *insptr++;