diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index 11990baf3..5e34de756 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -529,7 +529,7 @@ static inline void inplace_vx_tweak_sector(sectortypevx *vxsec, int32_t yaxp) # undef SECTORVX_SZ1 # undef SECTORVX_SZ4 -// 36 bytes +// 38 bytes typedef struct { Tracker(Wall, int32_t) x, y; @@ -541,9 +541,10 @@ typedef struct Tracker(Wall, uint8_t) pal, xrepeat, yrepeat, xpanning, ypanning; Tracker(Wall, uint16_t) lotag, hitag; Tracker(Wall, int16_t) extra; + Tracker(Wall, uint8_t) blend, filler_; } walltypevx; -# define WALLVX_SZ2 sizeof(walltypevx)-offsetof(walltypevx, cstat) +# define WALLVX_SZ2 offsetof(walltypevx, blend)-offsetof(walltypevx, cstat) static inline void copy_v7_from_vx_wall(walltypev7 *v7wal, const walltypevx *vxwal) { @@ -561,6 +562,8 @@ static inline void inplace_vx_from_v7_wall(walltypevx *vxwal) /* [cstat..extra] */ Bmemmove(&vxwal->cstat, &v7wal->cstat, WALLVX_SZ2); + + vxwal->blend = vxwal->filler_ = 0; } static inline void inplace_vx_tweak_wall(walltypevx *vxwal, int32_t yaxp) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 36c7342e2..e9d7c3c10 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -665,7 +665,7 @@ void yax_update(int32_t resetstat) #if !defined NEW_MAP_FORMAT editstatus = oeditstatus; #else - mapversion = (numyaxbunches>0) ? 10 : get_mapversion(); + mapversion = get_mapversion(); #endif } @@ -6694,8 +6694,11 @@ static void drawmaskwall(int16_t damaskwallcnt) else { if (globalorientation&128) +#ifdef NEW_MAP_FORMAT + setup_blend(wal->blend, globalorientation&512); +#else setup_blend(0, globalorientation&512); - +#endif transmaskwallscan(xb1[z],xb2[z], 0); } } @@ -10986,13 +10989,26 @@ int32_t loadmaphack(const char *filename) LUNATIC_CB int32_t (*saveboard_maptext)(const char *filename, const vec3_t *dapos, int16_t daang, int16_t dacursectnum); #endif -// Get map version of binary map format (< map-int VX). +// Get map version of external map format (<10: old binary format, ==10: new +// 'VX' map-text format). static int32_t get_mapversion(void) { #ifdef YAX_ENABLE if (numyaxbunches > 0) +# ifdef NEW_MAP_FORMAT + return 10; +# else return 9; - else +# endif +#endif + +#ifdef NEW_MAP_FORMAT + { + int32_t i; + for (i=0; i MAXSECTORSV7 || numwalls > MAXWALLSV7 || Numsprites > MAXSPRITESV7) return 8; @@ -11038,8 +11054,11 @@ int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int1 // and the engine-reported number of sprites 'Numsprites'. Bassert(numsprites == Numsprites); + // Determine the map version. + mapversion = get_mapversion(); + #ifdef NEW_MAP_FORMAT - if (numyaxbunches > 0) + if (mapversion == 10) { initprintf("Saving of TROR maps not yet accessible in the Lunatic preview build\n"); return -1; @@ -11055,8 +11074,6 @@ int32_t saveboard(const char *filename, const vec3_t *dapos, int16_t daang, int1 return -1; } - // Determine the map version. - mapversion = get_mapversion(); tl = B_LITTLE32(mapversion); Bwrite(fil,&tl,4); tl = B_LITTLE32(dapos->x); Bwrite(fil,&tl,4); diff --git a/polymer/eduke32/source/lunatic/defs_common.lua b/polymer/eduke32/source/lunatic/defs_common.lua index 7f3e95bcc..78890165a 100644 --- a/polymer/eduke32/source/lunatic/defs_common.lua +++ b/polymer/eduke32/source/lunatic/defs_common.lua @@ -25,7 +25,7 @@ ffi.cdef "const char **g_argv;" -- (env var: LUAJIT_DUMPFILE) -- profile: load LuaJIT's 'jit.p' module for profiling (LuaJIT 2.1 only) -- (env var: LUAJIT_PROFILEFILE) --- strict: catch various conditions that may indicate an logical error +-- strict: catch various conditions that may indicate a logical error -- TODO for strict: actor[], spriteext[], per-actor gamevars local debug_flags = {} local IS_DEBUG_FLAG = { @@ -242,6 +242,7 @@ struct { int8_t shade; uint8_t pal, xrepeat, yrepeat, xpanning, ypanning; int16_t lotag, hitag, extra; + uint8_t blend, _filler; }]] -- NOTE for FFI definitions: we're compiling EDuke32 with -funsigned-char, so diff --git a/polymer/eduke32/source/lunatic/engine_maptext.lua b/polymer/eduke32/source/lunatic/engine_maptext.lua index 1307163c6..fa6dce2c2 100644 --- a/polymer/eduke32/source/lunatic/engine_maptext.lua +++ b/polymer/eduke32/source/lunatic/engine_maptext.lua @@ -67,13 +67,13 @@ local wall_members = { -- optional f = "cstat", - m = "overpicnum", + m = "overpicnum", b = "blend", p = "pal", w = { "upwall", -1 }, W = { "dnwall", -1 }, o = "lotag", i = "hitag", e = { "extra", -1 } } -local wall_ord = { mand="1 23 4 5 6 78 90 ", opt="f m p wW oie" } +local wall_ord = { mand="1 23 4 5 6 78 90 ", opt="f mb p wW oie" } local wall_default = ffi.new("const walltype", { extra = -1, upwall=-1, dnwall=-1 })