diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 49f34fa72..1fe231be2 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -207,7 +207,8 @@ static void getclosestpointonwall_internal(vec2_t const p, int32_t const dawall, return; } - i = tabledivide64((i << 15), j) << 15; + i = ((i << 15) / j) << 15; + //i = tabledivide64((i << 15), j) << 15; *closest = { (int32_t)(w.x + ((d.x * i) >> 30)), (int32_t)(w.y + ((d.y * i) >> 30)) }; } diff --git a/source/common/compositesaveame.h b/source/common/compositesaveame.h index 85ebe6a8d..4b9a542cd 100644 --- a/source/common/compositesaveame.h +++ b/source/common/compositesaveame.h @@ -17,7 +17,10 @@ class CompositeSavegameWriter public: void Clear() { + isCompressed.Clear(); + subfilenames.Clear(); subfiles.DeleteAndClear(); + filename = ""; } void SetFileName(const char* fn) { diff --git a/source/exhumed/src/exhumed.cpp b/source/exhumed/src/exhumed.cpp index e7ec2f3da..dba0f4acf 100644 --- a/source/exhumed/src/exhumed.cpp +++ b/source/exhumed/src/exhumed.cpp @@ -887,13 +887,13 @@ void DoPassword(int nPassword) case 2: // LOBOCOP { - lLocalCodes |= 0x20; + lLocalCodes |= kButtonCheatGuns; break; } case 3: // LOBODEITY { - lLocalCodes |= 0x40; + lLocalCodes |= kButtonCheatGodMode; break; } @@ -910,7 +910,7 @@ void DoPassword(int nPassword) case 5: { - lLocalCodes |= 0x80; + lLocalCodes |= kButtonCheatKeys; break; } @@ -954,7 +954,7 @@ void DoPassword(int nPassword) case 9: { - lLocalCodes |= 0x100; // LOBOSWAG? + lLocalCodes |= kButtonCheatItems; // LOBOSWAG break; } diff --git a/source/exhumed/src/exhumed.h b/source/exhumed/src/exhumed.h index 94cf28fe0..1196ad70b 100644 --- a/source/exhumed/src/exhumed.h +++ b/source/exhumed/src/exhumed.h @@ -143,6 +143,7 @@ void mysetbrightness(char nBrightness); void StartFadeIn(); int DoFadeIn(); +void DoPassword(int nPassword); void InitSpiritHead(); diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index ad8b2ee59..90bb5874d 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -669,6 +669,15 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) int runtimer = (int)totalclock; + // Trim smoke in widescreen + vec2_t mapwinxy1 = windowxy1, mapwinxy2 = windowxy2; + int32_t width = mapwinxy2.x - mapwinxy1.x + 1, height = mapwinxy2.y - mapwinxy1.y + 1; + if (3 * width > 4 * height) + { + mapwinxy1.x += (width - 4 * height / 3) / 2; + mapwinxy2.x -= (width - 4 * height / 3) / 2; + } + // User has 12 seconds to do something on the map screen before loading the current level while (nIdleSeconds < 12) { @@ -681,8 +690,6 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) startTime = (int)totalclock; } - int moveTimer = (int)totalclock; - int tileY = curYPos; // Draw the background screens @@ -711,7 +718,10 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) int smokeX = MapLevelFires[i].fires[j].xPos + FireTiles[nFireType][nFireFrame].xOffs; int smokeY = MapLevelFires[i].fires[j].yPos + FireTiles[nFireType][nFireFrame].yOffs + curYPos + screenY; - overwritesprite(smokeX, smokeY, nTile, 0, 2, kPalNormal); + // Use rotatesprite to trim smoke in widescreen + rotatesprite(smokeX << 16, smokeY << 16, 65536L, 0, + nTile, 0, kPalNormal, 16 + 2, mapwinxy1.x, mapwinxy1.y, mapwinxy2.x, mapwinxy2.y); +// overwritesprite(smokeX, smokeY, nTile, 0, 2, kPalNormal); } } @@ -749,7 +759,6 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) { bFadeDone = kTrue; FadeIn(); - moveTimer = (int)totalclock; } if (curYPos == destYPos) @@ -811,8 +820,6 @@ int menu_DrawTheMap(int nLevel, int nLevelNew, int nLevelBest) runtimer = (int)totalclock; } - //curYPos += var_2C * (((int)totalclock - moveTimer) / 2); - if (inputState.CheckAllInput()) { if (var_2C < 8) { diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index e53348876..2e6598703 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -30,11 +30,73 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_PS_NS +static int osdcmd_god(osdcmdptr_t UNUSED(parm)) +{ + UNREFERENCED_CONST_PARAMETER(parm); + + if (!nNetPlayerCount && !bInDemo) + { + DoPassword(3); + } + else + OSD_Printf("god: Not in a single-player game.\n"); + + return OSDCMD_OK; +} + +static int osdcmd_noclip(osdcmdptr_t UNUSED(parm)) +{ + UNREFERENCED_CONST_PARAMETER(parm); + + if (!nNetPlayerCount && !bInDemo) + { + DoPassword(6); + } + else + { + OSD_Printf("noclip: Not in a single-player game.\n"); + } + + return OSDCMD_OK; +} + +static int osdcmd_changelevel(osdcmdptr_t parm) +{ + char* p; + + if (parm->numparms != 1) return OSDCMD_SHOWHELP; + + int nLevel = strtol(parm->parms[0], &p, 10); + if (p[0]) return OSDCMD_SHOWHELP; + + if (nLevel < 0) return OSDCMD_SHOWHELP; + + int nMaxLevels; + + if (!ISDEMOVER) { + nMaxLevels = 32; + } + else { + nMaxLevels = 4; + } + + if (nLevel > nMaxLevels) + { + OSD_Printf("changelevel: invalid level number\n"); + return OSDCMD_SHOWHELP; + } + + levelnew = nLevel; + levelnum = nLevel; + + return OSDCMD_OK; +} + int32_t registerosdcommands(void) { //if (VOLUMEONE) - // OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); + OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); //else //{ // OSD_RegisterFunction("changelevel","changelevel : warps to the given level", osdcmd_changelevel); @@ -47,9 +109,10 @@ int32_t registerosdcommands(void) //OSD_RegisterFunction("give","give : gives requested item", osdcmd_give); - //OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god); + OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god); //OSD_RegisterFunction("activatecheat","activatecheat : activates a cheat code", osdcmd_activatecheat); + OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); //OSD_RegisterFunction("restartmap", "restartmap: restarts the current map", osdcmd_restartmap); //OSD_RegisterFunction("restartsound","restartsound: reinitializes the sound system",osdcmd_restartsound); diff --git a/source/exhumed/src/player.cpp b/source/exhumed/src/player.cpp index 289eed5b2..d1aad85c0 100644 --- a/source/exhumed/src/player.cpp +++ b/source/exhumed/src/player.cpp @@ -1415,7 +1415,7 @@ loc_1AB8E: uint16_t buttons = sPlayerInput[nPlayer].buttons; - if (buttons & 0x40) // LOBODEITY cheat + if (buttons & kButtonCheatGodMode) // LOBODEITY cheat { char strDeity[96]; // TODO - reduce in size? @@ -1437,18 +1437,18 @@ loc_1AB8E: sprintf(strDeity, "Deity mode %s for player", strDMode); StatusMessage(150, strDeity); } - else if (buttons & 0x20) // LOBOCOP cheat + else if (buttons & kButtonCheatGuns) // LOBOCOP cheat { FillWeapons(nPlayer); StatusMessage(150, "All weapons loaded for player"); } - else if (buttons & 0x80) // LOBOPICK cheat + else if (buttons & kButtonCheatKeys) // LOBOPICK cheat { PlayerList[nPlayer].keys = 0xFFFF; StatusMessage(150, "All keys loaded for player"); RefreshStatus(); } - else if (buttons & 0x100) // LOBOSWAG cheat + else if (buttons & kButtonCheatItems) // LOBOSWAG cheat { FillItems(nPlayer); StatusMessage(150, "All items loaded for player"); diff --git a/source/rr/src/sector.cpp b/source/rr/src/sector.cpp index f445b51a2..1333b1a88 100644 --- a/source/rr/src/sector.cpp +++ b/source/rr/src/sector.cpp @@ -5248,7 +5248,7 @@ void G_Thunder(void) { if (krand2() > 65000) { - g_winderTime = 256; + g_winderTime = 128; g_winderFlash = 1; S_PlaySound(351+(rand()%3)); } diff --git a/source/thirdparty/include/enet.h b/source/thirdparty/include/enet.h index 7cc99c232..8c722ad19 100644 --- a/source/thirdparty/include/enet.h +++ b/source/thirdparty/include/enet.h @@ -4878,7 +4878,7 @@ extern "C" { tv->tv_nsec = t.QuadPart % 1000000 * 1000; return (0); } - #elif __APPLE__ && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 + #elif __APPLE__ && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200 && !defined CLOCK_MONOTONIC #define CLOCK_MONOTONIC 0 int clock_gettime(int X, struct timespec *ts) {