From c342594691b5784b33da948897c5577a9c0936f4 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 14 Jan 2021 23:55:45 +0100 Subject: [PATCH] - Exhumed: fixed wall scrollers. --- source/build/include/buildtypes.h | 2 ++ source/games/exhumed/src/lighting.cpp | 8 ++++---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/build/include/buildtypes.h b/source/build/include/buildtypes.h index caf5eda00..1ac86d561 100644 --- a/source/build/include/buildtypes.h +++ b/source/build/include/buildtypes.h @@ -94,6 +94,8 @@ struct walltype int xpan() const { return int(xpan_); } int ypan() const { return int(ypan_); } + void setxpan(float add) { xpan_ = fmod(add + 512, 256); } // +512 is for handling negative offsets + void setypan(float add) { ypan_ = fmod(add + 512, 256); } // +512 is for handling negative offsets void addxpan(float add) { xpan_ = fmod(xpan_ + add + 512, 256); } // +512 is for handling negative offsets void addypan(float add) { ypan_ = fmod(ypan_ + add + 512, 256); } // +512 is for handling negative offsets diff --git a/source/games/exhumed/src/lighting.cpp b/source/games/exhumed/src/lighting.cpp index ba2d39202..3b8b62a8c 100644 --- a/source/games/exhumed/src/lighting.cpp +++ b/source/games/exhumed/src/lighting.cpp @@ -745,8 +745,8 @@ void DoFlows() { short nWall = sFlowInfo[i].objindex; - wall[nWall].addxpan(sFlowInfo[i].xdelta / 16384.f); - wall[nWall].addypan(sFlowInfo[i].ydelta / 16384.f); + wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); + wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); if (sFlowInfo[i].xdelta < 0) { @@ -765,8 +765,8 @@ void DoFlows() { short nWall = sFlowInfo[i].objindex; - wall[nWall].addxpan(sFlowInfo[i].xdelta / 16384.f); - wall[nWall].addypan(sFlowInfo[i].ydelta / 16384.f); + wall[nWall].setxpan(sFlowInfo[i].xdelta / 16384.f); + wall[nWall].setypan(sFlowInfo[i].ydelta / 16384.f); if (sFlowInfo[i].xdelta >= sFlowInfo[i].xacc) {