diff --git a/source/duke3d/src/gamedef.cpp b/source/duke3d/src/gamedef.cpp index 93a0ecaf9..90564963a 100644 --- a/source/duke3d/src/gamedef.cpp +++ b/source/duke3d/src/gamedef.cpp @@ -575,6 +575,8 @@ const char *keyw[] = "scalevar", // 401 "undefinegamefunc", // 402 "getclosestcol", // 403 + "drawline256", // 404 + "drawlinergb", // 405 "" }; #endif @@ -3607,9 +3609,14 @@ DO_DEFSTATE: continue; case CON_HITRADIUSVAR: + case CON_DRAWLINE256: C_GetManyVars(5); continue; + case CON_DRAWLINERGB: + C_GetManyVars(6); + continue; + case CON_HITRADIUS: C_GetNextValue(LABEL_DEFINE); C_GetNextValue(LABEL_DEFINE); diff --git a/source/duke3d/src/gamedef.h b/source/duke3d/src/gamedef.h index ebc46cf0f..3494bcebc 100644 --- a/source/duke3d/src/gamedef.h +++ b/source/duke3d/src/gamedef.h @@ -1137,6 +1137,8 @@ enum ScriptKeywords_t CON_SCALEVAR, // 401 CON_UNDEFINEGAMEFUNC, // 402 CON_GETCLOSESTCOL, // 403 + CON_DRAWLINE256, // 404 + CON_DRAWLINERGB, // 405 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 4287a96d9..4a2777495 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -21,6 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. //------------------------------------------------------------------------- #include "compat.h" +#include "colmatch.h" + #include "duke3d.h" #include "scriplib.h" @@ -4899,6 +4901,36 @@ finish_qsprintf: } continue; + case CON_DRAWLINE256: + insptr++; + { + struct { + vec2_t pos[2]; + int32_t index; + } v; + + Gv_GetManyVars(sizeof(v)/sizeof(int32_t), (int32_t *)&v); + + drawline256(v.pos[0].x, v.pos[0].y, v.pos[1].x, v.pos[1].y, v.index); + } + continue; + + case CON_DRAWLINERGB: + insptr++; + { + struct { + vec2_t pos[2]; + int32_t index, rgb; + } v; + + Gv_GetManyVars(sizeof(v)/sizeof(int32_t), (int32_t *)&v); + + palette_t const p = { (uint8_t)(v.rgb & 0xFF), (uint8_t)((v.rgb >> 8) & 0xFF), (uint8_t)((v.rgb >> 16) & 0xFF), (uint8_t)v.index }; + + drawlinergb(v.pos[0].x, v.pos[0].y, v.pos[1].x, v.pos[1].y, p); + } + continue; + case CON_INV: if ((aGameVars[*(insptr + 1)].flags & (GAMEVAR_USER_MASK | GAMEVAR_PTR_MASK)) == 0) aGameVars[*(insptr + 1)].global = -aGameVars[*(insptr + 1)].global;