From 36d1cbd9952eb287566439d2fe59ed21e62408d4 Mon Sep 17 00:00:00 2001 From: hnt_ts Date: Sat, 16 Aug 2008 11:20:08 +0000 Subject: [PATCH] Added a new CON command: setgamepalette git-svn-id: https://svn.eduke32.com/eduke32@980 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/gamedef.c | 2 ++ polymer/eduke32/source/gamedef.h | 1 + polymer/eduke32/source/gameexec.c | 18 +++++++++++++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/polymer/eduke32/source/gamedef.c b/polymer/eduke32/source/gamedef.c index 2f0ec1d23..091db2b86 100644 --- a/polymer/eduke32/source/gamedef.c +++ b/polymer/eduke32/source/gamedef.c @@ -467,6 +467,7 @@ const char *keyw[] = "cmenu", // 331 "gettimedate", // 332 "activatecheat", // 333 + "setgamepalette", // 334 "" }; @@ -3499,6 +3500,7 @@ static int parsecommand(void) case CON_STARTTRACKVAR: case CON_CLEARMAPSTATE: case CON_ACTIVATECHEAT: + case CON_SETGAMEPALETTE: transvar(); return 0; diff --git a/polymer/eduke32/source/gamedef.h b/polymer/eduke32/source/gamedef.h index 22ab8a92b..c4de00b8b 100644 --- a/polymer/eduke32/source/gamedef.h +++ b/polymer/eduke32/source/gamedef.h @@ -844,4 +844,5 @@ enum keywords CON_CMENU, // 331 CON_GETTIMEDATE, // 332 CON_ACTIVATECHEAT, // 333 + CON_SETGAMEPALETTE, // 334 }; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 6766a6c4e..2db1c1ee0 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -7535,6 +7535,22 @@ static int parse(void) osdcmd_cheatsinfo_stat.cheatnum = j; break; + case CON_SETGAMEPALETTE: + insptr++; + j=GetGameVarID(*(insptr++), g_i, g_p); + switch(j) + { + default: + case 0:setgamepalette(g_player[g_p].ps,palette ,0);break; + case 1:setgamepalette(g_player[g_p].ps,waterpal ,0);break; + case 2:setgamepalette(g_player[g_p].ps,slimepal ,0);break; + case 3:setgamepalette(g_player[g_p].ps,drealms ,0);break; + case 4:setgamepalette(g_player[g_p].ps,titlepal ,0);break; + case 5:setgamepalette(g_player[g_p].ps,endingpal,0);break; + case 6:setgamepalette(g_player[g_p].ps,animpal ,0);break; + } + break; + case CON_GETTEXTURECEILING: insptr++; SetGameVarID(g_iTextureID, sector[g_sp->sectnum].ceilingpicnum, g_i, g_p); @@ -7853,7 +7869,7 @@ static int parse(void) "current opcode: %d, next five values: %d, %d, %d, %d, %d\ncurrent actor: %d (%d)\n", *(insptr-5),*(insptr-4),*(insptr-3),*(insptr-2),*(insptr-1),*insptr,*(insptr+1), *(insptr+2),*(insptr+3),*(insptr+4),*(insptr+5),g_i,g_sp->picnum); - OSD_Printf("line_num: %d, g_tw: %d\n",line_num,g_tw); + OSD_Printf("line_num: %d, g_tw: %d\n",line_num,g_tw); gameexit("An error has occurred in the EDuke32 CON executor.\n\n" "If you are an end user, please e-mail the file eduke32.log\n"