From 0c77f4a6f5876c8743180d2856f9e2e633c67428 Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Sun, 7 Sep 2008 12:36:20 +0000 Subject: [PATCH] Adds logic CON commands: ifvaror | ifvarxor ^ ifvareither || (rename?) git-svn-id: https://svn.eduke32.com/eduke32@1060 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 12 +++++++++++ polymer/eduke32/source/gamedef.h | 6 ++++++ polymer/eduke32/source/gameexec.c | 36 +++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 564b0b12c..476523cc6 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -471,6 +471,12 @@ const char *keyw[] = "setgamepalette", // 334 "setdefname", // 335 "setcfgname", // 336 + "ifvaror", // 337 + "ifvarvaror", // 338 + "ifvarxor", // 339 + "ifvarvarxor", // 340 + "ifvareither", // 341 + "ifvarvareither", // 342 "" }; @@ -4001,6 +4007,9 @@ static int parsecommand(void) case CON_IFVARVARE: case CON_IFVARVARN: case CON_IFVARVARAND: + case CON_IFVARVAROR: + case CON_IFVARVARXOR: + case CON_IFVARVAREITHER: case CON_WHILEVARVARN: { intptr_t offset; @@ -4040,6 +4049,9 @@ static int parsecommand(void) case CON_IFVARE: case CON_IFVARN: case CON_IFVARAND: + case CON_IFVAROR: + case CON_IFVARXOR: + case CON_IFVAREITHER: case CON_WHILEVARN: { intptr_t offset; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 59df8826c..b59fe3cac 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -859,5 +859,11 @@ enum keywords CON_SETGAMEPALETTE, // 334 CON_SETDEFNAME, // 335 CON_SETCFGNAME, // 336 + CON_IFVAROR, // 337 + CON_IFVARVAROR, // 338 + CON_IFVARXOR, // 339 + CON_IFVARVARXOR, // 340 + CON_IFVAREITHER, // 341 + CON_IFVARVAREITHER, // 342 CON_END }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 7cd80c9d2..15404c944 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -3821,6 +3821,24 @@ static int parse(void) parseifelse(GetGameVarID(j, g_i, g_p) & GetGameVarID(*(insptr), g_i, g_p)); break; + case CON_IFVARVAROR: + insptr++; + j=*insptr++; + parseifelse(GetGameVarID(j, g_i, g_p) | GetGameVarID(*(insptr), g_i, g_p)); + break; + + case CON_IFVARVARXOR: + insptr++; + j=*insptr++; + parseifelse(GetGameVarID(j, g_i, g_p) ^ GetGameVarID(*(insptr), g_i, g_p)); + break; + + case CON_IFVARVAREITHER: + insptr++; + j=*insptr++; + parseifelse(GetGameVarID(j, g_i, g_p) || GetGameVarID(*(insptr), g_i, g_p)); + break; + case CON_IFVARVARN: insptr++; j=*insptr++; @@ -3896,6 +3914,24 @@ static int parse(void) parseifelse(GetGameVarID(j, g_i, g_p) & *insptr); break; + case CON_IFVAROR: + insptr++; + j=*insptr++; + parseifelse(GetGameVarID(j, g_i, g_p) | *insptr); + break; + + case CON_IFVARXOR: + insptr++; + j=*insptr++; + parseifelse(GetGameVarID(j, g_i, g_p) ^ *insptr); + break; + + case CON_IFVAREITHER: + insptr++; + j=*insptr++; + parseifelse(GetGameVarID(j, g_i, g_p) || *insptr); + break; + case CON_IFVARG: insptr++; j=*insptr++;