From b716534104cbd5c4d2a0c17d2f68d6f3a9b95763 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 20 Dec 2014 13:08:27 +0000 Subject: [PATCH] Lunatic: sync MAXJOYAXES, add lunatic/test/sprite_addtv.con. DONT_BUILD. git-svn-id: https://svn.eduke32.com/eduke32@4829 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 1 + polymer/eduke32/source/lunatic/defs.ilua | 5 ++- .../source/lunatic/test/sprite_access.con | 2 +- .../source/lunatic/test/sprite_addtv.con | 31 +++++++++++++++++++ 4 files changed, 37 insertions(+), 2 deletions(-) create mode 100644 polymer/eduke32/source/lunatic/test/sprite_addtv.con diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 9dd51fcc4..f6ac94f8f 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -10921,6 +10921,7 @@ int32_t loadmaphack(const char *filename) else if (fn[0]) { // re-load + // XXX: what if we changed between levels? Could a wrong maphack be loaded? script = scriptfile_fromfile(fn); } diff --git a/polymer/eduke32/source/lunatic/defs.ilua b/polymer/eduke32/source/lunatic/defs.ilua index 71719ff92..8532fa968 100644 --- a/polymer/eduke32/source/lunatic/defs.ilua +++ b/polymer/eduke32/source/lunatic/defs.ilua @@ -480,8 +480,11 @@ enum MAXMOUSEAXES = 2, MAXJOYBUTTONS = 32, MAXJOYBUTTONSANDHATS = (32+4), - MAXJOYAXES = 8, + MAXJOYAXES = 9, + NUMGAMEFUNCTIONS = 56, + + // game.h MAXRIDECULE = 10, MAXRIDECULELENGTH = 40, MAXSAVEGAMES = 10, diff --git a/polymer/eduke32/source/lunatic/test/sprite_access.con b/polymer/eduke32/source/lunatic/test/sprite_access.con index 58b1197a5..7a2d47949 100644 --- a/polymer/eduke32/source/lunatic/test/sprite_access.con +++ b/polymer/eduke32/source/lunatic/test/sprite_access.con @@ -67,7 +67,7 @@ endevent gamevar alpha 0 0 gamevar tmp 0 0 -onevent EVENT_GAME // XXX: better: on spawn + loadactor +onevent EVENT_GAME // XXX: better: in EVENT_EGS + EVENT_LOADACTOR ifactor LIZTROOP { getactor[THISACTOR].mdflags tmp diff --git a/polymer/eduke32/source/lunatic/test/sprite_addtv.con b/polymer/eduke32/source/lunatic/test/sprite_addtv.con new file mode 100644 index 000000000..48501ff6f --- /dev/null +++ b/polymer/eduke32/source/lunatic/test/sprite_addtv.con @@ -0,0 +1,31 @@ + +gamevar tmp 0 0 +gamevar cs 0 0 + +state setup_animatesprites + getactor[THISACTOR].mdflags tmp + orvar tmp 16 + setactor[THISACTOR].mdflags tmp +ends + +onevent EVENT_EGS + state setup_animatesprites +endevent + +onevent EVENT_LOADACTOR + state setup_animatesprites +endevent + +// Assuming a PALETTE.DAT with e.g.: +// blend 0: 50/50 alpha +// blend 1: factor 1.0 additive +// +// See discussion starting from +// http://forums.duke4.net/topic/775-eduke32-20-and-polymer/page__view__findpost__p__213408 +onevent EVENT_ANIMATESPRITES + getactor[THISACTOR].cstat cs + ifvarand cs 2 ifvarand cs 512 + setactor[THISACTOR].blend 1 + else + setactor[THISACTOR].blend 0 +endevent