diff --git a/source/games/duke/src/player_d.cpp b/source/games/duke/src/player_d.cpp index e8db7217a..2f27940cb 100644 --- a/source/games/duke/src/player_d.cpp +++ b/source/games/duke/src/player_d.cpp @@ -465,7 +465,7 @@ static void shootweapon(DDukeActor *actor, int p, DVector3 pos, DAngle ang, int goto SKIPBULLETHOLE; if (hit.hitSector && hit.hitSector->lotag == 0) - if (hit.hitWall->overpicnum != DTILE_BIGFORCE) + if (!(tileflags(hit.hitWall->overtexture()) & TFLAG_FORCEFIELD)) if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag == 0) || (!hit.hitWall->twoSided() && hit.hitSector->lotag == 0)) if ((hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0) @@ -1987,7 +1987,7 @@ int operateTripbomb(int snum) return 0; if (hit.hitWall != nullptr) - if (hit.hitWall->overpicnum == DTILE_BIGFORCE) + if (tileflags(hit.hitWall->overtexture()) & TFLAG_FORCEFIELD) return 0; DDukeActor* act; diff --git a/source/games/duke/src/player_r.cpp b/source/games/duke/src/player_r.cpp index dc046fa5a..df91aa2a7 100644 --- a/source/games/duke/src/player_r.cpp +++ b/source/games/duke/src/player_r.cpp @@ -358,7 +358,7 @@ static void shootweapon(DDukeActor* actor, int p, DVector3 pos, DAngle ang, int goto SKIPBULLETHOLE; if (hit.hitSector != nullptr && hit.hitSector->lotag == 0) - if (hit.hitWall->overpicnum != RTILE_BIGFORCE) + if (!(tileflags(hit.hitWall->overtexture()) & TFLAG_FORCEFIELD)) if ((hit.hitWall->twoSided() && hit.hitWall->nextSector()->lotag == 0) || (!hit.hitWall->twoSided() && hit.hitSector->lotag == 0)) if ((hit.hitWall->cstat & CSTAT_WALL_MASKED) == 0) diff --git a/source/games/duke/src/sectors.cpp b/source/games/duke/src/sectors.cpp index fa538fc9d..4e97811f6 100644 --- a/source/games/duke/src/sectors.cpp +++ b/source/games/duke/src/sectors.cpp @@ -1248,7 +1248,7 @@ void operateforcefields(DDukeActor *effector, int low) auto wal = animwall[p].wall; if (low == wal->lotag || low == -1) - if (tileflags(wal->overtexture()) & TFLAG_FORCEFIELD) + if (tileflags(wal->overtexture()) & (TFLAG_FORCEFIELD | TFLAG_ANIMFORCEFIELD)) { animwall[p].tag = 0; @@ -1277,7 +1277,7 @@ void checkhitwall(DDukeActor* spr, walltype* wal, const DVector3& pos) { lotsofglass(spr, wal, 70); wal->cstat &= ~CSTAT_WALL_MASKED; - wal->overpicnum = TILE_MIRRORBROKE; + wal->setovertexture(TexMan.CheckForTexture("MIRRORBROKE", ETextureType::Any)); wal->portalflags = 0; S_PlayActorSound(GLASS_HEAVYBREAK, spr); return; diff --git a/source/games/duke/src/sectors_d.cpp b/source/games/duke/src/sectors_d.cpp index 65ef00ca8..edcafcd90 100644 --- a/source/games/duke/src/sectors_d.cpp +++ b/source/games/duke/src/sectors_d.cpp @@ -130,27 +130,26 @@ void checkplayerhurt_d(player_struct* p, const Collision& coll) auto wal = coll.hitWall; if (p->hurt_delay > 0) p->hurt_delay--; - else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) switch (wal->overpicnum) + else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) { - case DTILE_W_FORCEFIELD: - case DTILE_W_FORCEFIELD + 1: - case DTILE_W_FORCEFIELD + 2: - p->GetActor()->spr.extra -= 5; + int tf = tileflags(wal->overtexture()); + if (tf & TFLAG_ANIMFORCEFIELD) + { + p->GetActor()->spr.extra -= 5; - p->hurt_delay = 16; - SetPlayerPal(p, PalEntry(32, 32, 0, 0)); + p->hurt_delay = 16; + SetPlayerPal(p, PalEntry(32, 32, 0, 0)); - p->vel.XY() = -p->GetActor()->spr.Angles.Yaw.ToVector() * 16; - S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor()); - - checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2); - break; - - case DTILE_BIGFORCE: - p->hurt_delay = 26; - checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2); - break; + p->vel.XY() = -p->GetActor()->spr.Angles.Yaw.ToVector() * 16; + S_PlayActorSound(DUKE_LONGTERM_PAIN, p->GetActor()); + checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2); + } + else if (tf & TFLAG_FORCEFIELD) + { + p->hurt_delay = 26; + checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2); + } } } diff --git a/source/games/duke/src/sectors_r.cpp b/source/games/duke/src/sectors_r.cpp index 423ab8e1a..2feaa8e30 100644 --- a/source/games/duke/src/sectors_r.cpp +++ b/source/games/duke/src/sectors_r.cpp @@ -141,13 +141,14 @@ void checkplayerhurt_r(player_struct* p, const Collision &coll) auto wal = coll.hitWall; if (p->hurt_delay > 0) p->hurt_delay--; - else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) switch (wal->overpicnum) + else if (wal->cstat & (CSTAT_WALL_BLOCK | CSTAT_WALL_ALIGN_BOTTOM | CSTAT_WALL_MASKED | CSTAT_WALL_BLOCK_HITSCAN)) { - case RTILE_BIGFORCE: - p->hurt_delay = 26; - checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2); - break; - + int tf = tileflags(wal->overtexture()); + if (tf & TFLAG_FORCEFIELD) + { + p->hurt_delay = 26; + checkhitwall(p->GetActor(), wal, p->GetActor()->getPosWithOffsetZ() + p->GetActor()->spr.Angles.Yaw.ToVector() * 2); + } } } } diff --git a/source/games/sw/src/break.cpp b/source/games/sw/src/break.cpp index c3cd8c2f7..6fe3b41b3 100644 --- a/source/games/sw/src/break.cpp +++ b/source/games/sw/src/break.cpp @@ -36,6 +36,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "weapon.h" #include "break.h" +#include "buildtiles.h" + BEGIN_SW_NS @@ -435,8 +437,9 @@ int CompareSearchBreakInfo(int* picnum, BREAK_INFO* break_info) return(*picnum - break_info->picnum); } -BREAK_INFO* FindWallBreakInfo(int picnum) +BREAK_INFO* FindWallBreakInfo(FTextureID texid) { + int picnum = legacyTileNum(texid); return(BREAK_INFO*)(bsearch(&picnum, &WallBreakInfo, SIZ(WallBreakInfo), sizeof(BREAK_INFO), (int(*)(const void*, const void*))CompareSearchBreakInfo)); } @@ -465,7 +468,7 @@ BREAK_INFO* SetupWallForBreak(walltype* wallp) { BREAK_INFO* break_info; - break_info = FindWallBreakInfo(wallp->wallpicnum); + break_info = FindWallBreakInfo(wallp->walltexture()); if (break_info) { wallp->lotag = TAG_WALL_BREAK; @@ -474,7 +477,7 @@ BREAK_INFO* SetupWallForBreak(walltype* wallp) if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) { - break_info = FindWallBreakInfo(wallp->overpicnum); + break_info = FindWallBreakInfo(wallp->overtexture()); if (break_info) { wallp->lotag = TAG_WALL_BREAK; @@ -565,7 +568,7 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type // only break ONE of the walls if (nwp->lotag == TAG_WALL_BREAK && - nwp->overpicnum > 0 && + nwp->overtexture().isValid() && (nwp->cstat & CSTAT_WALL_MASKED)) { nwp->lotag = 0; @@ -573,9 +576,9 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type } if (wallp->overtexture().isValid() && (wallp->cstat & CSTAT_WALL_MASKED)) - break_info = FindWallBreakInfo(wallp->overpicnum); + break_info = FindWallBreakInfo(wallp->overtexture()); else - break_info = FindWallBreakInfo(wallp->wallpicnum); + break_info = FindWallBreakInfo(wallp->walltexture()); if (!break_info) { @@ -616,12 +619,12 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type else { wallp->cstat &= ~(CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK); - wallp->overpicnum = break_info->breaknum; + wallp->setovertexture(tileGetTextureID(break_info->breaknum)); if (wallp->twoSided()) { nwp = wallp->nextWall(); nwp->cstat &= ~(CSTAT_WALL_BLOCK_HITSCAN|CSTAT_WALL_BLOCK); - nwp->overpicnum = break_info->breaknum; + nwp->setovertexture(tileGetTextureID(break_info->breaknum)); } } } @@ -631,7 +634,7 @@ int AutoBreakWall(walltype* wallp, const DVector3& hit_pos, DAngle ang, int type wallp->setwalltexture(FNullTextureID()); // temporary break pic else { - wallp->wallpicnum = break_info->breaknum; + wallp->setwalltexture(tileGetTextureID(break_info->breaknum)); if (wallp->hitag < 0) DoWallBreakSpriteMatch(wallp->hitag); } diff --git a/source/games/sw/src/break.h b/source/games/sw/src/break.h index 810a30067..368273ad4 100644 --- a/source/games/sw/src/break.h +++ b/source/games/sw/src/break.h @@ -45,7 +45,6 @@ struct BREAK_INFO int16_t flags, shrap_amt; }; -BREAK_INFO* FindWallBreakInfo(int picnum); BREAK_INFO* FindSpriteBreakInfo(int picnum); void SortBreakInfo(void); BREAK_INFO* SetupWallForBreak(walltype* wallp); diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index 09f0e796d..adf45383e 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -1142,7 +1142,7 @@ void UpdateWallPortalState() continue; } walltype* wal = mirror[i].mirrorWall; - if (wal->wallpicnum != MIRRORLABEL) + if (wal->walltexture() != tileGetTextureID(MIRRORLABEL)) { wal->portalflags = 0; continue; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index 183c454da..c6f11ee87 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -891,6 +891,7 @@ enum ESurfType { TSURF_WATER = 1, TSURF_LAVA = 2, + TSURF_SHALLOWWATER = 3, }; // User->Flags flags diff --git a/source/games/sw/src/jsector.cpp b/source/games/sw/src/jsector.cpp index 25ede2082..33256f65f 100644 --- a/source/games/sw/src/jsector.cpp +++ b/source/games/sw/src/jsector.cpp @@ -218,25 +218,9 @@ void JS_SpriteSetup(void) // Check for certain walls to make sounds for(auto& wal : wall) { - int picnum = wal.wallpicnum; - - // Set the don't stick bit for liquid tiles - switch (picnum) - { - case 175: - case 179: - case 300: - case 320: - case 330: - case 352: - case 780: - case 890: - case 2608: - case 2616: - //case 3834: + int surf = tilesurface(wal.walltexture()); + if (surf == TSURF_WATER || surf == TSURF_LAVA || surf == TSURF_SHALLOWWATER) wal.extra |= WALLFX_DONT_STICK; - break; - } } } @@ -269,9 +253,10 @@ void JS_InitMirrors(void) mirror[i].ismagic = false; } + auto mi = tileGetTextureID(MIRROR); for(auto& wal : wall) { - if (wal.twoSided() && (wal.overpicnum == MIRROR) && (wal.cstat & CSTAT_WALL_1WAY)) + if (wal.twoSided() && (wal.overtexture() == mi) && (wal.cstat & CSTAT_WALL_1WAY)) { auto sec = wal.nextSector(); if ((sec->floorstat & CSTAT_SECTOR_SKY) == 0) @@ -282,9 +267,9 @@ void JS_InitMirrors(void) wal.setovertexture(sec->ceilingtexture); continue; } - - wal.overpicnum = MIRRORLABEL; - wal.wallpicnum = MIRRORLABEL; + auto ml = tileGetTextureID(MIRRORLABEL); + wal.setovertexture(ml); + wal.setwalltexture(ml); sec->floorstat |= CSTAT_SECTOR_SKY; mirror[mirrorcnt].mirrorWall = &wal; mirror[mirrorcnt].mirrorSector = sec; diff --git a/source/games/sw/src/namelist.h b/source/games/sw/src/namelist.h index a30063c8e..da9ee9822 100644 --- a/source/games/sw/src/namelist.h +++ b/source/games/sw/src/namelist.h @@ -459,3 +459,8 @@ x(DANGERSIGNBROKE, 4973) x(LITEDISP22BROKE, 4980) x(TITSUBISHIBROKE, 4918) x(ZILLACARSIDEBROKE, 4903) + +x(SHALLOWWATER, 352) +x(AWATER, 780) +x(FLSLUDGE, 2608) +x(SLUDGE, 2616) diff --git a/wadsrc/static/filter/shadowwarrior/constants.mi b/wadsrc/static/filter/shadowwarrior/constants.mi index e3803419f..e6af13512 100644 --- a/wadsrc/static/filter/shadowwarrior/constants.mi +++ b/wadsrc/static/filter/shadowwarrior/constants.mi @@ -6,7 +6,8 @@ constants TFLAG_BUNNYFRIENDLY = 1 // surface types - TSURF_WATER = 1 - TSURF_LAVA = 2 + TSURF_WATER = 1 + TSURF_LAVA = 2 + TSURF_SHALLOWWATER = 3 } diff --git a/wadsrc/static/filter/shadowwarrior/rmapinfo.texflags b/wadsrc/static/filter/shadowwarrior/rmapinfo.texflags index fbbd41c9b..f7a25fe27 100644 --- a/wadsrc/static/filter/shadowwarrior/rmapinfo.texflags +++ b/wadsrc/static/filter/shadowwarrior/rmapinfo.texflags @@ -53,5 +53,8 @@ surfacetypes LAVA6, LAVA7, LAVA8 + + TSURF_SHALLOWWATER = + SHALLOWWATER, AWATER, FLSLUDGE, SLUDGE } \ No newline at end of file