diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a96587d97..2823d3c21 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,6 @@ March 23, 2008 (Changes by Graf Zahl) +- Fixed: The sector translators must clear unused bits because they might + render a sector's special inoperable. - Expanded the args for MAPINFO special actions to 32 bit integers as in the rest of the game. - Fixed: The specialaction list was not copied properly when transferred diff --git a/src/p_xlat.cpp b/src/p_xlat.cpp index 9fae187b1..7eafaa067 100644 --- a/src/p_xlat.cpp +++ b/src/p_xlat.cpp @@ -330,13 +330,6 @@ int P_TranslateSectorSpecial (int special) { int mask = 0; - // Allow any supported sector special by or-ing 0x8000 to it in Doom format maps - // That's for those who like to mess around with existing maps. ;) - if (special & 0x8000) - { - return special & 0x7fff; - } - for(unsigned i = 0; i < SectorMasks.Size(); i++) { int newmask = special & SectorMasks[i].mask; @@ -345,6 +338,7 @@ int P_TranslateSectorSpecial (int special) special &= ~newmask; if (SectorMasks[i].op == 1) newmask <<= SectorMasks[i].shift; else if (SectorMasks[i].op == -1) newmask >>= SectorMasks[i].shift; + else if (SectorMasks[i].op == 0 && SectorMasks[i].shift ==1) newmask = 0; mask |= newmask; } } diff --git a/src/xlat/parse_xlat.cpp b/src/xlat/parse_xlat.cpp index d414ccb41..a5472f887 100644 --- a/src/xlat/parse_xlat.cpp +++ b/src/xlat/parse_xlat.cpp @@ -161,14 +161,14 @@ struct XlatParseContext { "include", "define", "enum", "arg5", "arg4", "arg3", "arg2", "flags", "lineid", "tag", - "sector", "bitmask", "nobitmask" + "sector", "bitmask", "nobitmask", "clear" }; static const short types[] = { INCLUDE, DEFINE, ENUM, ARG5, ARG4, ARG3, ARG2, FLAGS, TAG, TAG, - SECTOR, BITMASK, NOBITMASK + SECTOR, BITMASK, NOBITMASK, CLEAR }; int i; diff --git a/src/xlat/xlat_parser.h b/src/xlat/xlat_parser.h index 3fa54abce..4a1bb3a40 100644 --- a/src/xlat/xlat_parser.h +++ b/src/xlat/xlat_parser.h @@ -32,5 +32,6 @@ #define SEMICOLON 32 #define NOBITMASK 33 #define BITMASK 34 -#define LSHASSIGN 35 -#define RSHASSIGN 36 +#define CLEAR 35 +#define LSHASSIGN 36 +#define RSHASSIGN 37 diff --git a/src/xlat/xlat_parser.y b/src/xlat/xlat_parser.y index b3b9f9482..4974f7f2d 100644 --- a/src/xlat/xlat_parser.y +++ b/src/xlat/xlat_parser.y @@ -488,6 +488,12 @@ sector_bitmask ::= SECTOR BITMASK exp(mask) SEMICOLON. SectorMasks.Push(sm); } +sector_bitmask ::= SECTOR BITMASK exp(mask) CLEAR SEMICOLON. +{ + FSectorMask sm = { mask, 0, 1}; + SectorMasks.Push(sm); +} + sector_op(A) ::= LSHASSIGN. { A = 1; } sector_op(A) ::= RSHASSIGN. { A = -1; } diff --git a/wadsrc/xlat/doom.txt b/wadsrc/xlat/doom.txt index c07c9e3ab..25b84b2f0 100644 --- a/wadsrc/xlat/doom.txt +++ b/wadsrc/xlat/doom.txt @@ -1,6 +1,7 @@ include "xlat/base.txt" +sector bitmask 0xf000 clear; sector bitmask 0xfe0 <<= 3; sector 1 = dLight_Flicker; diff --git a/wadsrc/xlat/heretic.txt b/wadsrc/xlat/heretic.txt index 0632a9ae5..b1a4908b0 100644 --- a/wadsrc/xlat/heretic.txt +++ b/wadsrc/xlat/heretic.txt @@ -10,6 +10,7 @@ include "xlat/base.txt" 106 = WALK, Stairs_BuildUpDoom (tag, F_SLOW, 16) 107 = USE, Stairs_BuildUpDoom (tag, F_SLOW, 16) +sector bitmask 0xf000 clear; sector bitmask 0xfc0 <<= 3; sector 1 = dLight_Flicker; diff --git a/wadsrc/xlat/strife.txt b/wadsrc/xlat/strife.txt index bd9e9056a..72ae2686b 100644 --- a/wadsrc/xlat/strife.txt +++ b/wadsrc/xlat/strife.txt @@ -324,6 +324,7 @@ RetailOnly = 121 233 = USE|REP, ACS_ExecuteWithResult (0, 233, tag) 234 = USE|REP, ACS_ExecuteWithResult (0, 234, tag) +sector bitmask 0xf000 clear; sector bitmask 0xfe0 <<= 3; sector 1 = dLight_Flicker;