From 88d19a2d9c682239dda7f349c18c535c08b34be1 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 13 Oct 2019 18:37:41 -0300 Subject: [PATCH 01/32] fix holey textures --- src/r_data.c | 358 ++++++++++++++++++++++++++++---------------------- src/r_data.h | 5 +- src/r_plane.c | 51 +++++-- 3 files changed, 242 insertions(+), 172 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index b8b363021..f1d19a219 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -483,7 +483,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) wadnum = patch->wad; lumpnum = patch->lump; lumplength = W_LumpLengthPwad(wadnum, lumpnum); - realpatch = W_CacheLumpNumPwad(wadnum, lumpnum, PU_CACHE); + realpatch = W_CacheLumpNumPwad(wadnum, lumpnum, PU_CACHE); // can't use W_CachePatchNumPwad because OpenGL #ifndef NO_PNG_LUMPS if (R_IsLumpPNG((UINT8 *)realpatch, lumplength)) @@ -557,7 +557,7 @@ static UINT8 *R_GenerateTexture(size_t texnum) texturememory += blocksize; block = Z_Malloc(blocksize+1, PU_STATIC, &texturecache[texnum]); - memset(block, 0xFF, blocksize+1); // Transparency hack + memset(block, TRANSPARENTPIXEL, blocksize+1); // Transparency hack // columns lookup table colofs = (UINT32 *)(void *)block; @@ -2520,7 +2520,11 @@ void R_PrecacheLevel(void) "spritememory: %s k\n", sizeu1(flatmemory>>10), sizeu2(texturememory>>10), sizeu3(spritememory>>10)); } -// https://github.com/coelckers/prboom-plus/blob/master/prboom2/src/r_patch.c#L350 +// +// R_CheckIfPatch +// +// Returns true if the lump is a valid patch. +// boolean R_CheckIfPatch(lumpnum_t lump) { size_t size; @@ -2565,6 +2569,71 @@ boolean R_CheckIfPatch(lumpnum_t lump) return result; } +// +// R_TextureToFlat +// +// Convert a texture to a flat. +// +void R_TextureToFlat(size_t tex, UINT8 *flat) +{ + texture_t *texture = textures[tex]; + + fixed_t col, ofs; + column_t *column; + UINT8 *desttop, *dest, *deststop; + UINT8 *source; + + // yea + R_CheckTextureCache(tex); + + desttop = flat; + deststop = desttop + (texture->width * texture->height); + + for (col = 0; col < texture->width; col++, desttop++) + { + // no post_t info + if (!texture->holes) + { + column = (column_t *)(R_GetColumn(tex, col)); + source = (UINT8 *)(column); + dest = desttop; + for (ofs = 0; dest < deststop && ofs < texture->height; ofs++) + { + if (source[ofs] != TRANSPARENTPIXEL) + *dest = source[ofs]; + dest += texture->width; + } + } + else + { + INT32 topdelta, prevdelta = -1; + column = (column_t *)((UINT8 *)R_GetColumn(tex, col) - 3); + while (column->topdelta != 0xff) + { + topdelta = column->topdelta; + if (topdelta <= prevdelta) + topdelta += prevdelta; + prevdelta = topdelta; + + dest = desttop + (topdelta * texture->width); + source = (UINT8 *)column + 3; + for (ofs = 0; dest < deststop && ofs < column->length; ofs++) + { + if (source[ofs] != TRANSPARENTPIXEL) + *dest = source[ofs]; + dest += texture->width; + } + column = (column_t *)((UINT8 *)column + column->length + 4); + } + } + } +} + +// +// R_PatchToFlat +// +// Convert a patch to a flat. +// void R_PatchToFlat(patch_t *patch, UINT8 *flat) { fixed_t col, ofs; @@ -2599,7 +2668,124 @@ void R_PatchToFlat(patch_t *patch, UINT8 *flat) } } +// +// R_FlatToPatch +// +// Convert a flat to a patch. +// +static unsigned char imgbuf[1<<26]; +patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency) +{ + UINT32 x, y; + UINT8 *img; + UINT8 *imgptr = imgbuf; + UINT8 *colpointers, *startofspan; + size_t size = 0; + + // Write image size and offset + WRITEINT16(imgptr, width); + WRITEINT16(imgptr, height); + WRITEINT16(imgptr, leftoffset); + WRITEINT16(imgptr, topoffset); + + // Leave placeholder to column pointers + colpointers = imgptr; + imgptr += width*4; + + // Write columns + for (x = 0; x < width; x++) + { + int lastStartY = 0; + int spanSize = 0; + startofspan = NULL; + + // Write column pointer + WRITEINT32(colpointers, imgptr - imgbuf); + + // Write pixels + for (y = 0; y < height; y++) + { + UINT8 paletteIndex = raw[((y * width) + x)]; + boolean opaque = transparency ? (paletteIndex != TRANSPARENTPIXEL) : true; + + // End span if we have a transparent pixel + if (!opaque) + { + if (startofspan) + WRITEUINT8(imgptr, 0); + startofspan = NULL; + continue; + } + + // Start new column if we need to + if (!startofspan || spanSize == 255) + { + int writeY = y; + + // If we reached the span size limit, finish the previous span + if (startofspan) + WRITEUINT8(imgptr, 0); + + if (y > 254) + { + // Make sure we're aligned to 254 + if (lastStartY < 254) + { + WRITEUINT8(imgptr, 254); + WRITEUINT8(imgptr, 0); + imgptr += 2; + lastStartY = 254; + } + + // Write stopgap empty spans if needed + writeY = y - lastStartY; + + while (writeY > 254) + { + WRITEUINT8(imgptr, 254); + WRITEUINT8(imgptr, 0); + imgptr += 2; + writeY -= 254; + } + } + + startofspan = imgptr; + WRITEUINT8(imgptr, writeY); + imgptr += 2; + spanSize = 0; + + lastStartY = y; + } + + // Write the pixel + WRITEUINT8(imgptr, paletteIndex); + spanSize++; + startofspan[1] = spanSize; + } + + if (startofspan) + WRITEUINT8(imgptr, 0); + + WRITEUINT8(imgptr, 0xFF); + } + + size = imgptr-imgbuf; + img = Z_Malloc(size, PU_STATIC, NULL); + memcpy(img, imgbuf, size); + + Z_Free(raw); + + if (destsize != NULL) + *destsize = size; + return (patch_t *)img; +} + #ifndef NO_PNG_LUMPS +// +// R_IsLumpPNG +// +// Returns true if the lump is a valid PNG. +// boolean R_IsLumpPNG(const UINT8 *d, size_t s) { if (s < 67) // http://garethrees.org/2007/11/14/pngcrush/ @@ -2812,125 +2998,31 @@ static UINT8 *PNG_RawConvert(const UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topo return flat; } +// +// R_PNGToFlat +// // Convert a PNG to a flat. -UINT8 *R_PNGToFlat(levelflat_t *levelflat, UINT8 *png, size_t size) +// +UINT8 *R_PNGToFlat(UINT16 *width, UINT16 *height, UINT8 *png, size_t size) { - return PNG_RawConvert(png, &levelflat->width, &levelflat->height, NULL, NULL, size); + return PNG_RawConvert(png, width, height, NULL, NULL, size); } +// +// R_PNGToPatch +// // Convert a PNG to a patch. -static unsigned char imgbuf[1<<26]; +// patch_t *R_PNGToPatch(const UINT8 *png, size_t size, size_t *destsize, boolean transparency) { UINT16 width, height; INT16 topoffset = 0, leftoffset = 0; UINT8 *raw = PNG_RawConvert(png, &width, &height, &topoffset, &leftoffset, size); - UINT32 x, y; - UINT8 *img; - UINT8 *imgptr = imgbuf; - UINT8 *colpointers, *startofspan; - if (!raw) I_Error("R_PNGToPatch: conversion failed"); - // Write image size and offset - WRITEINT16(imgptr, width); - WRITEINT16(imgptr, height); - WRITEINT16(imgptr, leftoffset); - WRITEINT16(imgptr, topoffset); - - // Leave placeholder to column pointers - colpointers = imgptr; - imgptr += width*4; - - // Write columns - for (x = 0; x < width; x++) - { - int lastStartY = 0; - int spanSize = 0; - startofspan = NULL; - - //printf("%d ", x); - // Write column pointer (@TODO may be wrong) - WRITEINT32(colpointers, imgptr - imgbuf); - - // Write pixels - for (y = 0; y < height; y++) - { - UINT8 paletteIndex = raw[((y * width) + x)]; - boolean opaque = transparency ? (paletteIndex != TRANSPARENTPIXEL) : true; - - // End span if we have a transparent pixel - if (!opaque) - { - if (startofspan) - WRITEUINT8(imgptr, 0); - startofspan = NULL; - continue; - } - - // Start new column if we need to - if (!startofspan || spanSize == 255) - { - int writeY = y; - - // If we reached the span size limit, finish the previous span - if (startofspan) - WRITEUINT8(imgptr, 0); - - if (y > 254) - { - // Make sure we're aligned to 254 - if (lastStartY < 254) - { - WRITEUINT8(imgptr, 254); - WRITEUINT8(imgptr, 0); - imgptr += 2; - lastStartY = 254; - } - - // Write stopgap empty spans if needed - writeY = y - lastStartY; - - while (writeY > 254) - { - WRITEUINT8(imgptr, 254); - WRITEUINT8(imgptr, 0); - imgptr += 2; - writeY -= 254; - } - } - - startofspan = imgptr; - WRITEUINT8(imgptr, writeY);///@TODO calculate starting y pos - imgptr += 2; - spanSize = 0; - - lastStartY = y; - } - - // Write the pixel - WRITEUINT8(imgptr, paletteIndex); - spanSize++; - startofspan[1] = spanSize; - } - - if (startofspan) - WRITEUINT8(imgptr, 0); - - WRITEUINT8(imgptr, 0xFF); - } - - size = imgptr-imgbuf; - img = Z_Malloc(size, PU_STATIC, NULL); - memcpy(img, imgbuf, size); - - Z_Free(raw); - - if (destsize != NULL) - *destsize = size; - return (patch_t *)img; + return R_FlatToPatch(raw, width, height, leftoffset, topoffset, destsize, transparency); } boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size) @@ -3001,53 +3093,3 @@ boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size) } #endif #endif - -void R_TextureToFlat(size_t tex, UINT8 *flat) -{ - texture_t *texture = textures[tex]; - - fixed_t col, ofs; - column_t *column; - UINT8 *desttop, *dest, *deststop; - UINT8 *source; - - desttop = flat; - deststop = desttop + (texture->width * texture->height); - - for (col = 0; col < texture->width; col++, desttop++) - { - column = (column_t *)R_GetColumn(tex, col); - if (!texture->holes) - { - dest = desttop; - source = (UINT8 *)(column); - for (ofs = 0; dest < deststop && ofs < texture->height; ofs++) - { - if (source[ofs] != TRANSPARENTPIXEL) - *dest = source[ofs]; - dest += texture->width; - } - } - else - { - INT32 topdelta, prevdelta = -1; - while (column->topdelta != 0xff) - { - topdelta = column->topdelta; - if (topdelta <= prevdelta) - topdelta += prevdelta; - prevdelta = topdelta; - - dest = desttop + (topdelta * texture->width); - source = (UINT8 *)(column) + 3; - for (ofs = 0; dest < deststop && ofs < column->length; ofs++) - { - if (source[ofs] != TRANSPARENTPIXEL) - *dest = source[ofs]; - dest += texture->width; - } - column = (column_t *)((UINT8 *)column + column->length + 4); - } - } - } -} diff --git a/src/r_data.h b/src/r_data.h index c2fd284ff..fc2e53949 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -161,13 +161,14 @@ const char *R_NameForColormap(extracolormap_t *extra_colormap); boolean R_CheckIfPatch(lumpnum_t lump); UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b); -void R_PatchToFlat(patch_t *patch, UINT8 *flat); void R_TextureToFlat(size_t tex, UINT8 *flat); +void R_PatchToFlat(patch_t *patch, UINT8 *flat); +patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency); #ifndef NO_PNG_LUMPS boolean R_IsLumpPNG(const UINT8 *d, size_t s); -UINT8 *R_PNGToFlat(levelflat_t *levelflat, UINT8 *png, size_t size); +UINT8 *R_PNGToFlat(UINT16 *width, UINT16 *height, UINT8 *png, size_t size); patch_t *R_PNGToPatch(const UINT8 *png, size_t size, size_t *destsize, boolean transparency); boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size); #endif diff --git a/src/r_plane.c b/src/r_plane.c index db5fb0f24..34debeea7 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -650,6 +650,11 @@ static void R_DrawSkyPlane(visplane_t *pl) } } +// +// R_CheckPowersOfTwo +// +// Self-explanatory? +// boolean R_CheckPowersOfTwo(void) { boolean wpow2 = (!(ds_flatwidth & (ds_flatwidth - 1))); @@ -667,6 +672,11 @@ boolean R_CheckPowersOfTwo(void) return ds_powersoftwo; } +// +// R_CheckFlatLength +// +// Determine the flat's dimensions from the lump length. +// void R_CheckFlatLength(size_t size) { switch (size) @@ -723,7 +733,24 @@ void R_CheckFlatLength(size_t size) } } -static UINT8 *R_GetPatchFlat(levelflat_t *levelflat, boolean leveltexture, boolean ispng) +// +// R_GenerateFlat +// +// Generate a flat from specified width and height. +// +static UINT8 *R_GenerateFlat(UINT16 width, UINT16 height) +{ + UINT8 *flat = Z_Malloc(width * height, PU_LEVEL, NULL); + memset(flat, TRANSPARENTPIXEL, width * height); + return flat; +} + +// +// R_GetTextureFlat +// +// Convert a texture or patch to a flat. +// +static UINT8 *R_GetTextureFlat(levelflat_t *levelflat, boolean leveltexture, boolean ispng) { UINT8 *flat; textureflat_t *texflat = &texflats[levelflat->texturenum]; @@ -747,14 +774,14 @@ static UINT8 *R_GetPatchFlat(levelflat_t *levelflat, boolean leveltexture, boole // If the texture changed, or the patch doesn't exist, convert either of them to a flat. if (levelflat->flatpatch == NULL || texturechanged) { + // Level texture if (leveltexture) { texture_t *texture = textures[levelflat->texturenum]; texflat->width = ds_flatwidth = texture->width; texflat->height = ds_flatheight = texture->height; - texflat->flat = Z_Malloc(ds_flatwidth * ds_flatheight, PU_LEVEL, NULL); - memset(texflat->flat, TRANSPARENTPIXEL, ds_flatwidth * ds_flatheight); + texflat->flat = R_GenerateFlat(ds_flatwidth, ds_flatheight); R_TextureToFlat(levelflat->texturenum, texflat->flat); flat = texflat->flat; @@ -762,13 +789,14 @@ static UINT8 *R_GetPatchFlat(levelflat_t *levelflat, boolean leveltexture, boole levelflat->width = ds_flatwidth; levelflat->height = ds_flatheight; } + // Patch (never happens yet) else { patch = (patch_t *)ds_source; #ifndef NO_PNG_LUMPS if (ispng) { - levelflat->flatpatch = R_PNGToFlat(levelflat, ds_source, W_LumpLength(levelflat->lumpnum)); + levelflat->flatpatch = R_PNGToFlat(&levelflat->width, &levelflat->height, ds_source, W_LumpLength(levelflat->lumpnum)); levelflat->topoffset = levelflat->leftoffset = 0; ds_flatwidth = levelflat->width; ds_flatheight = levelflat->height; @@ -782,8 +810,7 @@ static UINT8 *R_GetPatchFlat(levelflat_t *levelflat, boolean leveltexture, boole levelflat->topoffset = patch->topoffset * FRACUNIT; levelflat->leftoffset = patch->leftoffset * FRACUNIT; - levelflat->flatpatch = Z_Malloc(ds_flatwidth * ds_flatheight, PU_LEVEL, NULL); - memset(levelflat->flatpatch, TRANSPARENTPIXEL, ds_flatwidth * ds_flatheight); + levelflat->flatpatch = R_GenerateFlat(ds_flatwidth, ds_flatheight); R_PatchToFlat(patch, levelflat->flatpatch); } flat = levelflat->flatpatch; @@ -794,11 +821,11 @@ static UINT8 *R_GetPatchFlat(levelflat_t *levelflat, boolean leveltexture, boole flat = levelflat->flatpatch; ds_flatwidth = levelflat->width; ds_flatheight = levelflat->height; - - xoffs += levelflat->leftoffset; - yoffs += levelflat->topoffset; } + xoffs += levelflat->leftoffset; + yoffs += levelflat->topoffset; + levelflat->lasttexturenum = levelflat->texturenum; return flat; } @@ -963,15 +990,15 @@ void R_DrawSinglePlane(visplane_t *pl) // Check if the flat is actually a wall texture. if (levelflat->texturenum != 0 && levelflat->texturenum != -1) - flat = R_GetPatchFlat(levelflat, true, false); + flat = R_GetTextureFlat(levelflat, true, false); #ifndef NO_PNG_LUMPS // Maybe it's a PNG?! else if (R_IsLumpPNG(ds_source, size)) - flat = R_GetPatchFlat(levelflat, false, true); + flat = R_GetTextureFlat(levelflat, false, true); #endif // Maybe it's just a patch, then? else if (R_CheckIfPatch(levelflat->lumpnum)) - flat = R_GetPatchFlat(levelflat, false, false); + flat = R_GetTextureFlat(levelflat, false, false); // It's a raw flat. else { From 0cf27741290ac8fa7d405da346264ae431a42ad1 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Sun, 13 Oct 2019 19:45:35 -0300 Subject: [PATCH 02/32] remove duplicate NearestColor prototype --- src/r_data.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/r_data.h b/src/r_data.h index fc2e53949..e71d45766 100644 --- a/src/r_data.h +++ b/src/r_data.h @@ -159,8 +159,6 @@ const char *R_NameForColormap(extracolormap_t *extra_colormap); #define R_PutRgbaRGBA(r, g, b, a) (R_PutRgbaRGB(r, g, b) + R_PutRgbaA(a)) boolean R_CheckIfPatch(lumpnum_t lump); -UINT8 NearestColor(UINT8 r, UINT8 g, UINT8 b); - void R_TextureToFlat(size_t tex, UINT8 *flat); void R_PatchToFlat(patch_t *patch, UINT8 *flat); patch_t *R_FlatToPatch(UINT8 *raw, UINT16 width, UINT16 height, UINT16 leftoffset, UINT16 topoffset, size_t *destsize, boolean transparency); From c935797a342ff4832149dbee74233f0ba9c07c77 Mon Sep 17 00:00:00 2001 From: Nev3r Date: Mon, 14 Oct 2019 16:30:20 +0200 Subject: [PATCH 03/32] Encapsulate the second behavior branch into an else. When a tag is provided, the tagged sector-related branch is run exclusively now. This prevents playing the same sound again from the caller object's origin and other unwanted behaviors. Signed-off-by: Nev3r --- src/p_spec.c | 45 ++++++++++++++++++++++++--------------------- 1 file changed, 24 insertions(+), 21 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index 256ca3453..45fd9e4f0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2718,6 +2718,7 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) CONS_Debug(DBG_GAMELOGIC, "Line type 414 Executor: sfx number %d is invalid!\n", sfxnum); return; } + if (line->tag != 0) // Do special stuff only if a non-zero linedef tag is set { if (line->flags & ML_EFFECT5) // Repeat Midtexture @@ -2758,30 +2759,32 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) return; } } - - if (line->flags & ML_NOCLIMB) + else { - // play the sound from nowhere, but only if display player triggered it - if (mo && mo->player && (mo->player == &players[displayplayer] || mo->player == &players[secondarydisplayplayer])) + if (line->flags & ML_NOCLIMB) + { + // play the sound from nowhere, but only if display player triggered it + if (mo && mo->player && (mo->player == &players[displayplayer] || mo->player == &players[secondarydisplayplayer])) + S_StartSound(NULL, sfxnum); + } + else if (line->flags & ML_EFFECT4) + { + // play the sound from nowhere S_StartSound(NULL, sfxnum); - } - else if (line->flags & ML_EFFECT4) - { - // play the sound from nowhere - S_StartSound(NULL, sfxnum); - } - else if (line->flags & ML_BLOCKMONSTERS) - { - // play the sound from calling sector's soundorg - if (callsec) - S_StartSound(&callsec->soundorg, sfxnum); + } + else if (line->flags & ML_BLOCKMONSTERS) + { + // play the sound from calling sector's soundorg + if (callsec) + S_StartSound(&callsec->soundorg, sfxnum); + else if (mo) + S_StartSound(&mo->subsector->sector->soundorg, sfxnum); + } else if (mo) - S_StartSound(&mo->subsector->sector->soundorg, sfxnum); - } - else if (mo) - { - // play the sound from mobj that triggered it - S_StartSound(mo, sfxnum); + { + // play the sound from mobj that triggered it + S_StartSound(mo, sfxnum); + } } } break; From 2f26cfad018a31a6e91b886fec1d61c564184d97 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 14 Oct 2019 17:17:00 +0100 Subject: [PATCH 04/32] Prevent wraparound on Level platter when there are less than 3 rows. Addresses #251 - I wanted to keep the scrolling because it looks nice and because I don't want to fuck with these drawers too bad. --- src/m_menu.c | 60 +++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 48 insertions(+), 12 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index fb276f77d..c0b02a5b7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4895,13 +4895,25 @@ static void M_HandleLevelPlatter(INT32 choice) { boolean exitmenu = false; // exit to previous menu INT32 selectval; + UINT8 iter; switch (choice) { case KEY_DOWNARROW: + if (lsrow == levelselect.numrows-1) + { + if (levelselect.numrows < 3) + { + if (!lsoffs[0]) // prevent sound spam + { + lsoffs[0] = -8; + S_StartSound(NULL,sfx_s3kb7); + } + return; + } + lsrow = UINT8_MAX; + } lsrow++; - if (lsrow == levelselect.numrows) - lsrow = 0; lsoffs[0] = lsvseperation(lsrow); @@ -4915,17 +4927,29 @@ static void M_HandleLevelPlatter(INT32 choice) break; case KEY_UPARROW: - lsoffs[0] = -lsvseperation(lsrow); - + iter = lsrow; + if (!lsrow) + { + if (levelselect.numrows < 3) + { + if (!lsoffs[0]) // prevent sound spam + { + lsoffs[0] = 8; + S_StartSound(NULL,sfx_s3kb7); + } + return; + } + lsrow = levelselect.numrows; + } lsrow--; - if (lsrow == UINT8_MAX) - lsrow = levelselect.numrows-1; + + lsoffs[0] = -lsvseperation(iter); if (levelselect.rows[lsrow].header[0]) lshli = lsrow; else { - UINT8 iter = lsrow; + iter = lsrow; do iter = ((iter == 0) ? levelselect.numrows-1 : iter-1); while ((iter != lsrow) && !(levelselect.rows[iter].header[0])); @@ -4958,7 +4982,7 @@ static void M_HandleLevelPlatter(INT32 choice) M_LevelSelectWarp(0); Nextmap_OnChange(); } - else if (!lsoffs[0]) // prevent sound spam + else if (!lsoffs[0]) // prevent sound spam { lsoffs[0] = -8; S_StartSound(NULL,sfx_s3kb2); @@ -4988,7 +5012,7 @@ static void M_HandleLevelPlatter(INT32 choice) ifselectvalnextmap(lscol) else ifselectvalnextmap(0) } - else if (!lsoffs[1]) // prevent sound spam + else if (!lsoffs[1]) // prevent sound spam { lsoffs[1] = 8; S_StartSound(NULL,sfx_s3kb7); @@ -5017,7 +5041,7 @@ static void M_HandleLevelPlatter(INT32 choice) ifselectvalnextmap(lscol) else ifselectvalnextmap(0) } - else if (!lsoffs[1]) // prevent sound spam + else if (!lsoffs[1]) // prevent sound spam { lsoffs[1] = -8; S_StartSound(NULL,sfx_s3kb7); @@ -5188,7 +5212,13 @@ static void M_DrawLevelPlatterMenu(void) // finds row at top of the screen while (y > -8) { - iter = ((iter == 0) ? levelselect.numrows-1 : iter-1); + if (iter == 0) + { + if (levelselect.numrows < 3) + break; + iter = levelselect.numrows; + } + iter--; y -= lsvseperation(iter); } @@ -5197,7 +5227,13 @@ static void M_DrawLevelPlatterMenu(void) { M_DrawLevelPlatterRow(iter, y); y += lsvseperation(iter); - iter = ((iter == levelselect.numrows-1) ? 0 : iter+1); + if (iter == levelselect.numrows-1) + { + if (levelselect.numrows < 3) + break; + iter = UINT8_MAX; + } + iter++; } // draw cursor box From 5007abee23e1528ed1f20be9c051179419a68a4a Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 14 Oct 2019 13:22:33 -0700 Subject: [PATCH 05/32] Collide with walls of FOF if both planes are intangible --- src/p_maputl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 22998c60e..6ba8f1d59 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -674,7 +674,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); - if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF + if (delta1 >= delta2 && (rover->flags & FF_INTANGABLEFLATS) != FF_PLATFORM) // thing is below FOF { if (bottomheight < opentop) { opentop = bottomheight; @@ -687,7 +687,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) highceiling = bottomheight; } - if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF + if (delta1 < delta2 && (rover->flags & FF_INTANGABLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF { if (topheight > openbottom) { openbottom = topheight; From 079ef023c98971c1ac50f4ce3989a5a80556bf5b Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 15 Oct 2019 10:49:14 +0100 Subject: [PATCH 06/32] Fix dedicated server extra lua variables not being synched for joiners. Original fix written by Lat`. --- src/lua_script.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index deb644dc0..1d4cc462c 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -1121,7 +1121,7 @@ void LUA_Archive(void) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i]) + if (!playeringame[i] && i > 0) // dedicated servers... continue; // all players in game will be archived, even if they just add a 0. ArchiveExtVars(&players[i], "player"); @@ -1157,7 +1157,7 @@ void LUA_UnArchive(void) for (i = 0; i < MAXPLAYERS; i++) { - if (!playeringame[i]) + if (!playeringame[i] && i > 0) // dedicated servers... continue; UnArchiveExtVars(&players[i]); } From 42de16b9042e31775b06362aadda2a6ea8926fd9 Mon Sep 17 00:00:00 2001 From: sphere Date: Wed, 16 Oct 2019 21:12:04 +0200 Subject: [PATCH 07/32] Make the maces and related objects normally placeable. --- src/info.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/info.c b/src/info.c index dd5338ef0..655664f9b 100644 --- a/src/info.c +++ b/src/info.c @@ -11104,7 +11104,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SMALLMACE - -1, // doomednum + 1130, // doomednum S_SMALLMACE, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11131,7 +11131,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BIGMACE - -1, // doomednum + 1131, // doomednum S_BIGMACE, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11158,7 +11158,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SMALLGRABCHAIN - -1, // doomednum + 1132, // doomednum S_SMALLGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11185,8 +11185,8 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BIGGRABCHAIN - -1, // doomednum - S_BIGGRABCHAIN, // spawnstate + 1133, // doomednum + S_BIGGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate sfx_None, // seesound @@ -11212,7 +11212,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_YELLOWSPRINGBALL - -1, // doomednum + 1134, // doomednum S_YELLOWSPRINGBALL, // spawnstate 1000, // spawnhealth S_YELLOWSPRINGBALL2, // seestate @@ -11239,7 +11239,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_REDSPRINGBALL - -1, // doomednum + 1135, // doomednum S_REDSPRINGBALL, // spawnstate 1000, // spawnhealth S_REDSPRINGBALL2, // seestate @@ -11266,7 +11266,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SMALLFIREBAR - -1, // doomednum + 1136, // doomednum S_SMALLFIREBAR1, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11293,7 +11293,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BIGFIREBAR - -1, // doomednum + 1137, // doomednum S_BIGFIREBAR1, // spawnstate 1000, // spawnhealth S_NULL, // seestate From b58b043a5e141d4d093b410d09a62320b3cf26e0 Mon Sep 17 00:00:00 2001 From: sphere Date: Wed, 16 Oct 2019 21:20:49 +0200 Subject: [PATCH 08/32] Add normally placeable maces to the ZB config. --- extras/conf/SRB2-22.cfg | 60 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index d936721b6..606b8af68 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -2175,7 +2175,7 @@ linedeftypes title = "Award Rings"; prefix = "(460)"; } - + 461 { title = "Spawn Object"; @@ -5038,6 +5038,62 @@ thingtypes width = 8; height = 208; } + 1130 + { + title = "Small Mace"; + sprite = "SMCEA0"; + width = 17; + height = 34; + } + 1131 + { + title = "Big Mace"; + sprite = "BMCEA0"; + width = 34; + height = 68; + } + 1132 + { + title = "Small Grabbable Chain"; + sprite = "SMCHA0"; + width = 17; + height = 34; + } + 1133 + { + title = "Big Grabbable Chain"; + sprite = "BMCHA0"; + width = 17; + height = 34; + } + 1134 + { + title = "Yellow Spring Ball"; + sprite = "YSPBA0"; + width = 17; + height = 34; + } + 1135 + { + title = "Red Spring Ball"; + sprite = "RSPBA0"; + width = 34; + height = 68; + } + 1136 + { + title = "Small Fireball"; + sprite = "SFBRA0"; + width = 17; + height = 34; + } + 1136 + { + title = "Large Fireball"; + sprite = "BFBRA0"; + width = 17; + height = 34; + } } aridcanyon @@ -6416,4 +6472,4 @@ thingsfilters } } -} \ No newline at end of file +} From 124716b8dd79cbfc43e31820fddf6810ac584d8d Mon Sep 17 00:00:00 2001 From: sphere Date: Wed, 16 Oct 2019 22:30:52 +0200 Subject: [PATCH 09/32] Correct some ZB config errors & remove grabbable chains. --- extras/conf/SRB2-22.cfg | 112 ++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 63 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 606b8af68..41e8a30ea 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -4141,6 +4141,34 @@ thingtypes angletext = "Retraction interval"; parametertext = "Initial delay"; } + 1130 + { + title = "Small Mace"; + sprite = "SMCEA0"; + width = 17; + height = 34; + } + 1131 + { + title = "Big Mace"; + sprite = "BMCEA0"; + width = 34; + height = 68; + } + 1136 + { + title = "Small Fireball"; + sprite = "SFBRA0"; + width = 17; + height = 34; + } + 1137 + { + title = "Large Fireball"; + sprite = "BFBRA0"; + width = 34; + height = 68; + } } springs @@ -4248,6 +4276,20 @@ thingtypes width = 16; height = 32; } + 1134 + { + title = "Yellow Spring Ball"; + sprite = "YSPBA0"; + width = 17; + height = 34; + } + 1135 + { + title = "Red Spring Ball"; + sprite = "RSPBA0"; + width = 17; + height = 34; + } } patterns @@ -4828,7 +4870,7 @@ thingtypes } 1104 { - title = "Mace"; + title = "Mace Spawnpoint"; sprite = "SMCEA0"; width = 17; height = 34; @@ -4838,7 +4880,7 @@ thingtypes } 1105 { - title = "Chain & Maces"; + title = "Chain with Maces Spawnpoint"; sprite = "SMCEA0"; width = 17; height = 34; @@ -4848,7 +4890,7 @@ thingtypes } 1106 { - title = "Chained Spring"; + title = "Chained Spring Spawnpoint"; sprite = "YSPBA0"; width = 17; height = 34; @@ -4858,7 +4900,7 @@ thingtypes } 1107 { - title = "Chain"; + title = "Chain Spawnpoint"; sprite = "BMCHA0"; width = 17; height = 34; @@ -4868,7 +4910,7 @@ thingtypes 1108 { arrow = 1; - title = "Chain (Hidden)"; + title = "Hidden Chain Spawnpoint"; sprite = "internal:chain3"; width = 17; height = 34; @@ -4876,7 +4918,7 @@ thingtypes } 1109 { - title = "Firebar"; + title = "Firebar Spawnpoint"; sprite = "BFBRA0"; width = 17; height = 34; @@ -4886,7 +4928,7 @@ thingtypes } 1110 { - title = "Custom Mace"; + title = "Custom Mace Spawnpoint"; sprite = "SMCEA0"; width = 17; height = 34; @@ -5038,62 +5080,6 @@ thingtypes width = 8; height = 208; } - 1130 - { - title = "Small Mace"; - sprite = "SMCEA0"; - width = 17; - height = 34; - } - 1131 - { - title = "Big Mace"; - sprite = "BMCEA0"; - width = 34; - height = 68; - } - 1132 - { - title = "Small Grabbable Chain"; - sprite = "SMCHA0"; - width = 17; - height = 34; - } - 1133 - { - title = "Big Grabbable Chain"; - sprite = "BMCHA0"; - width = 17; - height = 34; - } - 1134 - { - title = "Yellow Spring Ball"; - sprite = "YSPBA0"; - width = 17; - height = 34; - } - 1135 - { - title = "Red Spring Ball"; - sprite = "RSPBA0"; - width = 34; - height = 68; - } - 1136 - { - title = "Small Fireball"; - sprite = "SFBRA0"; - width = 17; - height = 34; - } - 1136 - { - title = "Large Fireball"; - sprite = "BFBRA0"; - width = 17; - height = 34; - } } aridcanyon From 2cc129c5c0e1e1dafbbc93fe50a0f19660fa8b13 Mon Sep 17 00:00:00 2001 From: sphere Date: Wed, 16 Oct 2019 22:31:57 +0200 Subject: [PATCH 10/32] Undo grabbable chains being placeable for now, since they're bugged. --- src/info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 655664f9b..33340876e 100644 --- a/src/info.c +++ b/src/info.c @@ -11158,7 +11158,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SMALLGRABCHAIN - 1132, // doomednum + -1, // doomednum S_SMALLGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11185,7 +11185,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BIGGRABCHAIN - 1133, // doomednum + -1, // doomednum S_BIGGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate From 26fed7767138bc6570aceacef5d969061d42a06a Mon Sep 17 00:00:00 2001 From: sphere Date: Thu, 17 Oct 2019 01:01:40 +0200 Subject: [PATCH 11/32] Fix standalone hangable chains being broken, thanks to toaster. --- src/info.c | 4 ++-- src/p_user.c | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/info.c b/src/info.c index 33340876e..655664f9b 100644 --- a/src/info.c +++ b/src/info.c @@ -11158,7 +11158,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SMALLGRABCHAIN - -1, // doomednum + 1132, // doomednum S_SMALLGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11185,7 +11185,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BIGGRABCHAIN - -1, // doomednum + 1133, // doomednum S_BIGGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate diff --git a/src/p_user.c b/src/p_user.c index 33f84e2db..a67274d79 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4345,7 +4345,6 @@ void P_DoJump(player_t *player, boolean soundandstate) { player->mo->momz = 9*FRACUNIT; player->powers[pw_carry] = CR_NONE; - player->mo->tracer->flags |= MF_PUSHABLE; P_SetTarget(&player->mo->tracer->target, NULL); P_SetTarget(&player->mo->tracer, NULL); } @@ -12057,7 +12056,7 @@ void P_PlayerAfterThink(player_t *player) mo->momx = rock->momx; mo->momy = rock->momy; mo->momz = 0; - + if (player->panim == PA_IDLE && (mo->momx || mo->momy)) { P_SetPlayerMobjState(player->mo, S_PLAY_WALK); From 1604e4d439030fd47d860bae82d093713ffdf7da Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sat, 19 Oct 2019 22:20:48 +0200 Subject: [PATCH 12/32] Make spinbust behavior consistent with other bustable blocks and rename FF_ONLYKNUX to FF_STRONGBUST --- extras/conf/SRB2-22.cfg | 2 +- src/dehacked.c | 6 ++--- src/p_spec.c | 2 +- src/p_user.c | 53 ++++++++++++++++++++++------------------- src/r_defs.h | 6 ++--- 5 files changed, 36 insertions(+), 33 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index d936721b6..2fd84d279 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -1527,7 +1527,7 @@ linedeftypes title = "Bustable Block"; prefix = "(254)"; flags8text = "[3] Slope skew sides"; - flags64text = "[6] Only bustable by Knuckles"; + flags64text = "[6] Reinforced"; flags128text = "[7] Only block non-players"; flags512text = "[9] Shattered by pushables"; flags1024text = "[10] Trigger linedef executor"; diff --git a/src/dehacked.c b/src/dehacked.c index 8d240326d..c0d71e1ae 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8915,9 +8915,9 @@ struct { {"FF_PLATFORM",FF_PLATFORM}, ///< You can jump up through this to the top. {"FF_REVERSEPLATFORM",FF_REVERSEPLATFORM}, ///< A fall-through floor in normal gravity, a platform in reverse gravity. {"FF_INTANGABLEFLATS",FF_INTANGABLEFLATS}, ///< Both flats are intangable, but the sides are still solid. - {"FF_SHATTER",FF_SHATTER}, ///< Used with ::FF_BUSTUP. Thinks everyone's Knuckles. - {"FF_SPINBUST",FF_SPINBUST}, ///< Used with ::FF_BUSTUP. Jump or fall onto it while curled in a ball. - {"FF_ONLYKNUX",FF_ONLYKNUX}, ///< Used with ::FF_BUSTUP. Only Knuckles can break this rock. + {"FF_SHATTER",FF_SHATTER}, ///< Used with ::FF_BUSTUP. Bustable on mere touch. + {"FF_SPINBUST",FF_SPINBUST}, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames. + {"FF_STRONGBUST",FF_STRONGBUST }, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee). {"FF_RIPPLE",FF_RIPPLE}, ///< Ripple the flats {"FF_COLORMAPONLY",FF_COLORMAPONLY}, ///< Only copy the colormap, not the lightlevel {"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. diff --git a/src/p_spec.c b/src/p_spec.c index ebee50a45..f4aeba3e4 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -7089,7 +7089,7 @@ void P_SpawnSpecials(INT32 fromnetsave) case 254: // Bustable block ffloorflags = FF_EXISTS|FF_SOLID|FF_RENDERALL|FF_BUSTUP; if (lines[i].flags & ML_NOCLIMB) - ffloorflags |= FF_ONLYKNUX; + ffloorflags |= FF_STRONGBUST; P_AddFakeFloorsByLine(i, ffloorflags, secthinkers); break; diff --git a/src/p_user.c b/src/p_user.c index 33f84e2db..9ba432689 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -2456,39 +2456,42 @@ static void P_CheckBustableBlocks(player_t *player) if ((rover->flags & FF_BUSTUP)/* && !rover->master->frontsector->crumblestate*/) { - // If it's an FF_SPINBUST, you have to either be jumping, or coming down - // onto the top from a spin. - if (rover->flags & FF_SPINBUST && ((!(player->pflags & PF_JUMPED) && !(player->pflags & PF_SPINNING) && !(player->pflags & PF_BOUNCING)) || (player->pflags & PF_STARTDASH))) + // If it's an FF_SHATTER, you can break it just by touching it. + if (rover->flags & FF_SHATTER) + goto bust; + + // If it's an FF_SPINBUST, you can break it if you are in your spinning frames + // (either from jumping or spindashing). + if (rover->flags & FF_SPINBUST + && (((player->pflags & PF_SPINNING) && !(player->pflags & PF_STARTDASH)) + || (player->pflags & PF_JUMPED && !(player->pflags & PF_NOJUMPDAMAGE)))) + goto bust; + + // You can always break it if you have CA_GLIDEANDCLIMB + // or if you are bouncing on it + // or you are using CA_TWINSPIN/CA2_MELEE. + if (player->charability == CA_GLIDEANDCLIMB + || (player->pflags & PF_BOUNCING) + || ((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY)) + || (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2)) + goto bust; + + if (rover->flags & FF_STRONGBUST) continue; - // if it's not an FF_SHATTER, you must be spinning (and not jumping) - // or be super - // or have CA_GLIDEANDCLIMB - // or be in dashmode with SF_DASHMODE - // or be using CA_TWINSPIN - // or be using CA2_MELEE - // or are drilling in NiGHTS - // or are recording for Metal Sonic - if (!(rover->flags & FF_SHATTER) && !(rover->flags & FF_SPINBUST) - && !((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED)) + // If it's not an FF_STRONGBUST, you can break if you are spinning (and not jumping) + // or you are super + // or you are in dashmode with SF_DASHMODE + // or you are drilling in NiGHTS + // or you are recording for Metal Sonic + if (!((player->pflags & PF_SPINNING) && !(player->pflags & PF_JUMPED)) && !(player->powers[pw_super]) - && !(player->charability == CA_GLIDEANDCLIMB) - && !(player->pflags & PF_BOUNCING) && !((player->charflags & SF_DASHMODE) && (player->dashmode >= 3*TICRATE)) - && !((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY)) - && !(player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2) && !(player->pflags & PF_DRILLING) && !metalrecording) continue; - // Only players with CA_GLIDEANDCLIMB, or CA_TWINSPIN/CA2_MELEE users can break this rock... - if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX) - && !(player->charability == CA_GLIDEANDCLIMB - || (player->pflags & PF_BOUNCING) - || ((player->charability == CA_TWINSPIN) && (player->panim == PA_ABILITY)) - || (player->charability2 == CA2_MELEE && player->panim == PA_ABILITY2))) - continue; - + bust: topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); diff --git a/src/r_defs.h b/src/r_defs.h index 6aeb0671c..4a5c38410 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -139,9 +139,9 @@ typedef enum FF_PLATFORM = 0x2000000, ///< You can jump up through this to the top. FF_REVERSEPLATFORM = 0x4000000, ///< A fall-through floor in normal gravity, a platform in reverse gravity. FF_INTANGABLEFLATS = 0x6000000, ///< Both flats are intangable, but the sides are still solid. - FF_SHATTER = 0x8000000, ///< Used with ::FF_BUSTUP. Thinks everyone's Knuckles. - FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Jump or fall onto it while curled in a ball. - FF_ONLYKNUX = 0x20000000, ///< Used with ::FF_BUSTUP. Only Knuckles can break this rock. + FF_SHATTER = 0x8000000, ///< Used with ::FF_BUSTUP. Bustable on mere touch. + FF_SPINBUST = 0x10000000, ///< Used with ::FF_BUSTUP. Also bustable if you're in your spinning frames. + FF_STRONGBUST = 0x20000000, ///< Used with ::FF_BUSTUP. Only bustable by "strong" characters (Knuckles) and abilities (bouncing, twinspin, melee). FF_RIPPLE = 0x40000000, ///< Ripple the flats FF_COLORMAPONLY = 0x80000000, ///< Only copy the colormap, not the lightlevel FF_GOOWATER = FF_SHATTERBOTTOM, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. From b219be6f5e1ee1c9820ffd0352c175508c40ca45 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sat, 19 Oct 2019 21:37:03 -0400 Subject: [PATCH 13/32] Remove level select restrictions in Multiplayer --- src/m_menu.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index fb276f77d..56f757470 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4546,12 +4546,10 @@ static boolean M_LevelAvailableOnPlatter(INT32 mapnum) if (!(mapheaderinfo[mapnum]->typeoflevel & TOL_COOP)) return true; - if (mapvisited[mapnum]) // MV_MP - return true; - if (mapnum+1 == spstage_start) return true; + return true; /* FALLTHRU */ case LLM_RECORDATTACK: case LLM_NIGHTSATTACK: From 0a321b96d3fca05ef92f2ff2a19adb22f0ffe499 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Sun, 20 Oct 2019 12:28:30 +0200 Subject: [PATCH 14/32] Clarified description of "strong" bustable blocks in the ZB config --- extras/conf/SRB2-22.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index 2fd84d279..5a36caaf0 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -1527,7 +1527,7 @@ linedeftypes title = "Bustable Block"; prefix = "(254)"; flags8text = "[3] Slope skew sides"; - flags64text = "[6] Reinforced"; + flags64text = "[6] Strong characters only"; flags128text = "[7] Only block non-players"; flags512text = "[9] Shattered by pushables"; flags1024text = "[10] Trigger linedef executor"; From d6411b954917fb1fbe17be7e643e6e5645591c59 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 21 Oct 2019 13:43:02 +0800 Subject: [PATCH 15/32] Add new ATZ gargoyle sprites --- src/hardware/hw_light.c | 5 ++++- src/info.c | 49 ++++++++++++++++++++++------------------- src/info.h | 5 ++++- 3 files changed, 34 insertions(+), 25 deletions(-) diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index f4637ff7f..08a5dcc10 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -404,6 +404,10 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_HHPL &lspr[NOLIGHT], // SPR_SHRM &lspr[NOLIGHT], // SPR_HHZM + + // Azure Temple Scenery + &lspr[NOLIGHT], // SPR_BGAR + &lspr[NOLIGHT], // SPR_RCRY // Botanic Serenity Scenery &lspr[NOLIGHT], // SPR_BSZ1 @@ -424,7 +428,6 @@ light_t *t_lspr[NUMSPRITES] = // Misc Scenery &lspr[NOLIGHT], // SPR_STLG &lspr[NOLIGHT], // SPR_DBAL - &lspr[NOLIGHT], // SPR_RCRY // Powerup Indicators &lspr[NOLIGHT], // SPR_ARMA diff --git a/src/info.c b/src/info.c index dd5338ef0..576a250fe 100644 --- a/src/info.c +++ b/src/info.c @@ -298,6 +298,10 @@ char sprnames[NUMSPRITES + 1][5] = "HHPL", // Dr Seuss Trees "SHRM", // Mushroom "HHZM", // Misc + + // Azure Temple Scenery + "BGAR", // ATZ Gargoyles + "RCRY", // ATZ Red Crystal (Target) // Botanic Serenity Scenery "BSZ1", // Tall flowers @@ -318,7 +322,6 @@ char sprnames[NUMSPRITES + 1][5] = // Misc Scenery "STLG", // Stalagmites "DBAL", // Disco - "RCRY", // ATZ Red Crystal (Target) // Powerup Indicators "ARMA", // Armageddon Shield Orb @@ -2546,31 +2549,31 @@ state_t states[NUMSTATES] = {SPR_WVIN, 1|FF_PAPERSPRITE, -1, {NULL}, 0, 0, S_NULL}, // S_WALLVINE_SHORT // Trapgoyles - {SPR_GARG, 0, 67, {NULL}, 0, 0, S_TRAPGOYLE_CHECK}, // S_TRAPGOYLE - {SPR_GARG, 0, 3, {NULL}, 0, 0, S_TRAPGOYLE_FIRE1}, // S_TRAPGOYLE_CHECK - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLE_FIRE2}, // S_TRAPGOYLE_FIRE1 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLE_FIRE3}, // S_TRAPGOYLE_FIRE2 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLE}, // S_TRAPGOYLE_FIRE3 + {SPR_BGAR, 0, 67, {NULL}, 0, 0, S_TRAPGOYLE_CHECK}, // S_TRAPGOYLE + {SPR_BGAR, 0, 3, {NULL}, 0, 0, S_TRAPGOYLE_FIRE1}, // S_TRAPGOYLE_CHECK + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLE_FIRE2}, // S_TRAPGOYLE_FIRE1 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLE_FIRE3}, // S_TRAPGOYLE_FIRE2 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLE}, // S_TRAPGOYLE_FIRE3 - {SPR_GARG, 0, 67, {NULL}, 0, 0, S_TRAPGOYLEUP_CHECK}, // S_TRAPGOYLEUP - {SPR_GARG, 0, 3, {NULL}, 0, 0, S_TRAPGOYLEUP_FIRE1}, // S_TRAPGOYLEUP_CHECK - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+45, S_TRAPGOYLEUP_FIRE2}, // S_TRAPGOYLEUP_FIRE1 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+45, S_TRAPGOYLEUP_FIRE3}, // S_TRAPGOYLEUP_FIRE2 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+45, S_TRAPGOYLEUP}, // S_TRAPGOYLEUP_FIRE3 + {SPR_BGAR, 0, 67, {NULL}, 0, 0, S_TRAPGOYLEUP_CHECK}, // S_TRAPGOYLEUP + {SPR_BGAR, 0, 3, {NULL}, 0, 0, S_TRAPGOYLEUP_FIRE1}, // S_TRAPGOYLEUP_CHECK + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+45, S_TRAPGOYLEUP_FIRE2}, // S_TRAPGOYLEUP_FIRE1 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+45, S_TRAPGOYLEUP_FIRE3}, // S_TRAPGOYLEUP_FIRE2 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+45, S_TRAPGOYLEUP}, // S_TRAPGOYLEUP_FIRE3 - {SPR_GARG, 0, 67, {NULL}, 0, 0, S_TRAPGOYLEDOWN_CHECK}, // S_TRAPGOYLEDOWN - {SPR_GARG, 0, 3, {NULL}, 0, 0, S_TRAPGOYLEDOWN_FIRE1}, // S_TRAPGOYLEDOWN_CHECK - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+315, S_TRAPGOYLEDOWN_FIRE2}, // S_TRAPGOYLEDOWN_FIRE1 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+315, S_TRAPGOYLEDOWN_FIRE3}, // S_TRAPGOYLEDOWN_FIRE2 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+315, S_TRAPGOYLEDOWN}, // S_TRAPGOYLEDOWN_FIRE3 + {SPR_BGAR, 0, 67, {NULL}, 0, 0, S_TRAPGOYLEDOWN_CHECK}, // S_TRAPGOYLEDOWN + {SPR_BGAR, 0, 3, {NULL}, 0, 0, S_TRAPGOYLEDOWN_FIRE1}, // S_TRAPGOYLEDOWN_CHECK + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+315, S_TRAPGOYLEDOWN_FIRE2}, // S_TRAPGOYLEDOWN_FIRE1 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+315, S_TRAPGOYLEDOWN_FIRE3}, // S_TRAPGOYLEDOWN_FIRE2 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16)+315, S_TRAPGOYLEDOWN}, // S_TRAPGOYLEDOWN_FIRE3 - {SPR_GARG, 0, 135, {NULL}, 0, 0, S_TRAPGOYLELONG_CHECK}, // S_TRAPGOYLELONG - {SPR_GARG, 0, 3, {NULL}, 0, 0, S_TRAPGOYLELONG_FIRE1}, // S_TRAPGOYLELONG_CHECK - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE2}, // S_TRAPGOYLELONG_FIRE1 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE3}, // S_TRAPGOYLELONG_FIRE2 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE4}, // S_TRAPGOYLELONG_FIRE3 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE5}, // S_TRAPGOYLELONG_FIRE4 - {SPR_GARG, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG}, // S_TRAPGOYLELONG_FIRE5 + {SPR_BGAR, 0, 135, {NULL}, 0, 0, S_TRAPGOYLELONG_CHECK}, // S_TRAPGOYLELONG + {SPR_BGAR, 0, 3, {NULL}, 0, 0, S_TRAPGOYLELONG_FIRE1}, // S_TRAPGOYLELONG_CHECK + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE2}, // S_TRAPGOYLELONG_FIRE1 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE3}, // S_TRAPGOYLELONG_FIRE2 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE4}, // S_TRAPGOYLELONG_FIRE3 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG_FIRE5}, // S_TRAPGOYLELONG_FIRE4 + {SPR_BGAR, 0, 1, {A_TrapShot}, (16<<16)+MT_DEMONFIRE, (30<<16), S_TRAPGOYLELONG}, // S_TRAPGOYLELONG_FIRE5 // Target/Red Crystal {SPR_RCRY, 0, -1, {NULL}, 0, 0, S_TARGET_IDLE}, // S_TARGET_IDLE diff --git a/src/info.h b/src/info.h index 0502fd095..74ca5b141 100644 --- a/src/info.h +++ b/src/info.h @@ -554,6 +554,10 @@ typedef enum sprite SPR_HHPL, // Dr Seuss Trees SPR_SHRM, // Mushroom SPR_HHZM, // Misc + + // Azure Temple Scenery + SPR_BGAR, // ATZ Gargoyles + SPR_RCRY, // ATZ Red Crystal (Target) // Botanic Serenity Scenery SPR_BSZ1, // Tall flowers @@ -574,7 +578,6 @@ typedef enum sprite // Misc Scenery SPR_STLG, // Stalagmites SPR_DBAL, // Disco - SPR_RCRY, // ATZ Red Crystal (Target) // Powerup Indicators SPR_ARMA, // Armageddon Shield Orb From 3a3122e2554c1c285afc610d1b89537b010fffa3 Mon Sep 17 00:00:00 2001 From: lachwright Date: Mon, 21 Oct 2019 16:22:20 +0800 Subject: [PATCH 16/32] Add green flame sprites, state, and object --- src/dehacked.c | 4 ++++ src/hardware/hw_light.c | 3 ++- src/info.c | 33 ++++++++++++++++++++++++++++++++- src/info.h | 5 +++++ 4 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 8d240326d..68da8b022 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5971,6 +5971,9 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_TARGET_RESPAWN", "S_TARGET_ALLDONE", + // ATZ's green flame + "S_GREENFLAME", + // Stalagmites "S_STG0", "S_STG1", @@ -7707,6 +7710,7 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_TRAPGOYLEDOWN", "MT_TRAPGOYLELONG", "MT_TARGET", + "MT_GREENFLAME", // Stalagmites "MT_STALAGMITE0", diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index 08a5dcc10..58bd37da0 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -199,7 +199,7 @@ light_t *t_lspr[NUMSPRITES] = &lspr[NOLIGHT], // SPR_EGGO &lspr[NOLIGHT], // SPR_SEBH &lspr[NOLIGHT], // SPR_FAKE - &lspr[NOLIGHT], // SPR_SHCK + &lspr[LBLUESHINE_L],// SPR_SHCK // Boss 4 (Castle Eggman) &lspr[NOLIGHT], // SPR_EGGP @@ -408,6 +408,7 @@ light_t *t_lspr[NUMSPRITES] = // Azure Temple Scenery &lspr[NOLIGHT], // SPR_BGAR &lspr[NOLIGHT], // SPR_RCRY + &lspr[GREENBALL_L], // SPR_CFLM // Botanic Serenity Scenery &lspr[NOLIGHT], // SPR_BSZ1 diff --git a/src/info.c b/src/info.c index 576a250fe..7c67c7b57 100644 --- a/src/info.c +++ b/src/info.c @@ -298,10 +298,11 @@ char sprnames[NUMSPRITES + 1][5] = "HHPL", // Dr Seuss Trees "SHRM", // Mushroom "HHZM", // Misc - + // Azure Temple Scenery "BGAR", // ATZ Gargoyles "RCRY", // ATZ Red Crystal (Target) + "CFLM", // Green torch flame // Botanic Serenity Scenery "BSZ1", // Tall flowers @@ -2582,6 +2583,9 @@ state_t states[NUMSTATES] = {SPR_RCRY, 1, 0, {A_SpawnObjectRelative}, 0, MT_TARGET, S_NULL}, // S_TARGET_RESPAWN {SPR_RCRY, FF_FULLBRIGHT|1, -1, {A_SetObjectFlags}, MF_PUSHABLE, 1, S_TARGET_ALLDONE}, // S_TARGET_ALLDONE + // Green flame + {SPR_CFLM, FF_FULLBRIGHT|FF_ANIMATE|FF_RANDOMANIM, -1, {NULL}, 7, 3, S_GREENFLAME}, // S_GREENFLAME + // Stalagmites {SPR_STLG, 0, -1, {NULL}, 0, 0, S_NULL}, // S_STG0 {SPR_STLG, 1, -1, {NULL}, 0, 0, S_NULL}, // S_STG1 @@ -13482,6 +13486,33 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_NULL // raisestate }, + { // MT_GREENFLAME + 1505, // doomednum + S_GREENFLAME, // spawnstate + 1000, // spawnhealth + S_NULL, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + MT_NULL, // painchance + sfx_None, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 8*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 0, // mass + 0, // damage + sfx_None, // activesound + MF_NOGRAVITY|MF_PAIN, // flags + S_NULL // raisestate + }, + { // MT_STALAGMITE0 1900, // doomednum S_STG0, // spawnstate diff --git a/src/info.h b/src/info.h index 74ca5b141..562fbb582 100644 --- a/src/info.h +++ b/src/info.h @@ -558,6 +558,7 @@ typedef enum sprite // Azure Temple Scenery SPR_BGAR, // ATZ Gargoyles SPR_RCRY, // ATZ Red Crystal (Target) + SPR_CFLM, // Green torch flame // Botanic Serenity Scenery SPR_BSZ1, // Tall flowers @@ -2698,6 +2699,9 @@ typedef enum state S_TARGET_RESPAWN, S_TARGET_ALLDONE, + // ATZ's green flame + S_GREENFLAME, + // Stalagmites S_STG0, S_STG1, @@ -4456,6 +4460,7 @@ typedef enum mobj_type MT_TRAPGOYLEDOWN, MT_TRAPGOYLELONG, MT_TARGET, // AKA Red Crystal + MT_GREENFLAME, // Stalagmites MT_STALAGMITE0, From 8c5c2a7e4b42788a50b2af3e01cde5a5f9f4215a Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 21 Oct 2019 12:42:04 -0700 Subject: [PATCH 17/32] Flatb --- tools/flatb/Makefile | 9 + tools/flatb/flatb.c | 566 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 575 insertions(+) create mode 100644 tools/flatb/Makefile create mode 100644 tools/flatb/flatb.c diff --git a/tools/flatb/Makefile b/tools/flatb/Makefile new file mode 100644 index 000000000..2134973e6 --- /dev/null +++ b/tools/flatb/Makefile @@ -0,0 +1,9 @@ +.PHONY : all clean + +all : flatb + +flatb.exe : flatb.c + i686-w64-mingw32-gcc $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) $(LDLIBS) -o $@ $< + +clean : + $(RM) flatb flatb.exe diff --git a/tools/flatb/flatb.c b/tools/flatb/flatb.c new file mode 100644 index 000000000..edc089232 --- /dev/null +++ b/tools/flatb/flatb.c @@ -0,0 +1,566 @@ +#define HELP \ +"Usage: flatb WAD-file list-file" "\n"\ +"Replace flats and textures by name in a DOOM WAD." "\n"\ +"\n"\ +"list-file may have the following format:" "\n"\ +"\n"\ +"GFZFLR01 GFZFLR02" "\n"\ +"# Comment" "\n"\ +"GFZROCK GFZBLOCK" "\n"\ +"\n"\ +"The first name and second name may be delimited by any whitespace." "\n"\ +"\n"\ +"Copyright 2019 James R." "\n"\ +"All rights reserved." "\n" + +/* +Copyright 2019 James R. +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this + list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright notice. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +#include +#include +#include +#include +#include +#include + +#define cchar const char +#define cvoid const void + +#define LONG int32_t + +#define va_inline( __ap,__last, ... )\ +(\ + va_start (__ap,__last),\ + __VA_ARGS__,\ + va_end (__ap)\ +) + +#define DELIM "\t\n\r " + +typedef struct +{ + FILE * fp; + cchar * filename; +} +File; + +int (*le32)(cvoid *); + +void +Pexit (int c, cchar *s, ...) +{ + va_list ap; + va_inline (ap, s, + + vfprintf(stderr, s, ap) + + ); + exit(c); +} + +void +Prexit (cchar *pr, ...) +{ + va_list ap; + va_inline (ap, pr, + + vfprintf(stderr, pr, ap) + + ); + perror(""); + exit(-1); +} + +void +Fopen (File *f, cchar *filename, const char *mode) +{ + FILE *fp; + if (!( fp = fopen(filename, mode) )) + Prexit("%s", filename); + f->filename = filename; + f->fp = fp; +} + +void +Ferr (File *f) +{ + if (ferror(f->fp)) + Prexit("%s", f->filename); +} + +char * +Fgets (File *f, int b, char *p) +{ + if (!( p = fgets(p, b, f->fp) )) + Ferr(f); + return p; +} + +void +Fread (File *f, int b, void *p) +{ + if (fread(p, 1, b, f->fp) < b) + Ferr(f); +} + +void +Fwrite (File *f, int b, cvoid *s) +{ + if (fwrite(s, 1, b, f->fp) < b) + Ferr(f); +} + +void +Fseek (File *f, long o) +{ + if (fseek(f->fp, o, SEEK_SET) == -1) + Prexit("%s", f->filename); +} + +void * +Malloc (int b) +{ + void *p; + if (!( p = malloc(b) )) + Prexit("%d", b); + return p; +} + +void * +Calloc (int c, int b) +{ + void *p; + if (!( p = calloc(c, b) )) + Prexit("(%d)%d", c, b); + return p; +} + +void +Reallocp (void *pp, int b) +{ + void *p; + if (!( p = realloc((*(void **)pp), b) )) + Prexit("%d", b); + (*(void **)pp) = p; +} + +void +strucpy (char *p, cchar *s, int n) +{ + int c; + int i; + for (i = 0; i < n && ( c = s[i] ); ++i) + p[i] = toupper(c); +} + +int +e32 (cvoid *s) +{ + unsigned int c; + c = *(LONG *)s; + return ( + ( c >> 24 ) | + (( c >> 8 )& 0x00FF00 )| + (( c << 8 )& 0xFF0000 )| + ( c << 24 ) + ); +} + +int +n32 (cvoid *s) +{ + return *(LONG *)s; +} + +void +Ie () +{ + int c; + c = 1; + if (*(char *)&c == 1) + le32 = n32; + else + le32 = e32; +} + +File wad_file; +File list_file; + +int list_c; +char *** list_v; + +char * directory; +char * lump; +int lumpsize; + +char * sectors; +int sectors_c; + +char * sides; +int sides_c; + +int st_floors; +int st_ceilings; +int st_sectors; + +int st_sides; +int st_uppers; +int st_mids; +int st_lowers; + +/* this is horseshit */ +char * old; +char * new; +int did; + +void +Itable () +{ + char a[1024]; + + char ***ttt; + char ***ppp; + + char **pp; + + int c; + + while (Fgets(&list_file, sizeof a, a)) + { + c = a[0]; + if (!( + c == '\n' || + c == '#' + )) + { + list_c++; + } + } + + rewind(list_file.fp); + + list_v = Calloc(list_c, sizeof (char **)); + for ( + ttt = ( ppp = list_v ) + list_c; + ppp < ttt; + ++ppp + ) + { + (*ppp) = pp = Calloc(2, sizeof (char *)); + pp[0] = Malloc(9); + pp[1] = Malloc(9); + } +} + +void +Iwad () +{ + char buf[12]; + + char * t; + char * p; + int map; + + char *sector_p; + char * side_p; + + int n; + int h; + + Fread(&wad_file, 12, buf); + if ( + memcmp(buf, "IWAD", 4) != 0 && + memcmp(buf, "PWAD", 4) != 0 + ) + { + Pexit(-1,"%s: Not a WAD\n", wad_file.filename); + } + + Fseek(&wad_file, (*le32)(&buf[8])); + + n = (*le32)(&buf[4]) * 8; + h = n / 9; + n *= 2; + directory = Malloc(n); + /* minimum number of lumps for a map */ + sectors = Malloc(h); + sides = Malloc(h); + + Fread(&wad_file, n, directory); + + sector_p = sectors; + side_p = sides; + map = 3; + for (t = ( p = directory ) + n; p < t; p += 16) + { + /* looking for SECTORS? Hopefully order doesn't matter in real world. */ + /* also search for fucking SIDES MY SIDES AAAAAAAAAA */ + switch (map) + { + case 0: + case 2: + if (strncmp(&p[8], "SECTORS", 8) == 0) + { + /* copy file offset and size */ + memcpy(sector_p, p, 8); + sector_p += 8; + sectors_c++; + map |= 1; + } + case 1: + if (strncmp(&p[8], "SIDEDEFS", 8) == 0) + { + memcpy(side_p, p, 8); + side_p += 8; + sides_c++; + map |= 2; + } + } + if (map == 3) + { + /* MAP marker */ + if (p[13] == '\0' && strncmp(&p[8], "MAP", 3) == 0) + map = 0; + } + } +} + +void +Fuckyou (char *p, int f, int *st) +{ + if (strncmp(p, old, 8) == 0) + { + strncpy(p, new, 8); + (*st)++; + did |= f; + } +} + +void +Epic (char *p, char *t) +{ + char *top; + char *bot; + int i; + /* oh hi magic number! */ + for (; p < t; p += 26) + { + bot = &p [4]; + top = &p[12]; + did = 0; + for (i = 0; i < list_c; ++i) + { + old = list_v[i][0]; + new = list_v[i][1]; + switch (did) + { + case 0: + case 2: + Fuckyou(bot, 1, &st_floors); + case 1: + Fuckyou(top, 2, &st_ceilings); + } + if (did == 3) + break; + } + if (did) + st_sectors++; + } +} + +void +Epic2 (char *p, char *t) +{ + char *top; + char *mid; + char *bot; + int i; + for (; p < t; p += 30) + { + top = &p [4]; + bot = &p[12]; + mid = &p[20]; + did = 0; + for (i = 0; i < list_c; ++i) + { + old = list_v[i][0]; + new = list_v[i][1]; + switch (did) + { + case 0: + case 2: + case 4: + case 6: + Fuckyou(top, 1, &st_uppers); + case 1: + case 5: + Fuckyou(mid, 2, &st_mids); + case 3: + Fuckyou(bot, 4, &st_lowers); + } + if (did == 7) + break; + } + if (did) + st_sides++; + } +} + +void +Fuck (char *p, int c, void (*fn)(char *,char *)) +{ + char *t; + int offs; + int size; + for (t = p + c * 8; p < t; p += 8) + { + offs = (*le32)(p); + size = (*le32)(p + 4); + if (lumpsize < size) + { + Reallocp(&lump, size); + lumpsize = size; + } + Fseek(&wad_file, offs); + Fread(&wad_file, size, lump); + (*fn)(lump, lump + size); + Fseek(&wad_file, offs); + Fwrite(&wad_file, size, lump); + } +} + +void +Awad () +{ + Fuck (sectors, sectors_c, Epic); + Fuck (sides, sides_c, Epic2); +} + +void +Readtable () +{ + char a[1024]; + + int s; + char *old; + char *new; + + int c; + + s = 0; + + while (Fgets(&list_file, sizeof a, a)) + { + c = a[0]; + if (!( + c == '\n' || + c == '#' + )) + { + if ( + ( old = strtok(a, DELIM) ) && + ( new = strtok(0, DELIM) ) + ) + { + strucpy(list_v[s][0], old, 8); + strucpy(list_v[s][1], new, 8); + ++s; + } + } + } +} + +void +Cleanup () +{ + char ***ttt; + char ***ppp; + + char **pp; + + free(lump); + free(sides); + free(sectors); + free(directory); + + if (list_v) + { + for ( + ttt = ( ppp = list_v ) + list_c; + ppp < ttt && ( pp = (*ppp) ); + ++ppp + ) + { + free(pp[0]); + free(pp[1]); + free(pp); + } + free(list_v); + } +} + +int +main (int ac, char **av) +{ + int n; + + if (ac < 3) + Pexit(0,HELP); + + Fopen (& wad_file, av[1], "rb+"); + Fopen (&list_file, av[2], "r"); + + if (atexit(Cleanup) != 0) + Pexit(-1,"Failed to register cleanup function.\n"); + + Itable(); + Readtable(); + + Ie(); + + Iwad(); + Awad(); + + printf( + "%5d sectors changed.\n" + "%5d floors.\n" + "%5d ceilings.\n" + "\n" + "%5d sides.\n" + "%5d upper textures.\n" + "%5d mid textures.\n" + "%5d lower textures.\n", + + st_sectors, + + st_floors, + st_ceilings, + + st_sides, + + st_uppers, + st_mids, + st_lowers); + + return 0; +} From acd28c001ed48003986f1978df4977da087f1e16 Mon Sep 17 00:00:00 2001 From: James R Date: Mon, 21 Oct 2019 14:44:16 -0700 Subject: [PATCH 18/32] lmao I forgot the backside FOF --- src/p_maputl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 6ba8f1d59..111103294 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -720,7 +720,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); - if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF + if (delta1 >= delta2 && (rover->flags & FF_INTANGABLEFLATS) != FF_PLATFORM) // thing is below FOF { if (bottomheight < opentop) { opentop = bottomheight; @@ -733,7 +733,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) highceiling = bottomheight; } - if (delta1 < delta2 && !(rover->flags & FF_REVERSEPLATFORM)) // thing is above FOF + if (delta1 < delta2 && (rover->flags & FF_INTANGABLEFLATS) != FF_REVERSEPLATFORM) // thing is above FOF { if (topheight > openbottom) { openbottom = topheight; From 57a8af1557fdb81c0553181a3f9e271428c7a485 Mon Sep 17 00:00:00 2001 From: sphere Date: Tue, 22 Oct 2019 02:29:34 +0200 Subject: [PATCH 19/32] Disable standalone hangable chains, since they're not a good mechanic. --- src/info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/info.c b/src/info.c index 655664f9b..33340876e 100644 --- a/src/info.c +++ b/src/info.c @@ -11158,7 +11158,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_SMALLGRABCHAIN - 1132, // doomednum + -1, // doomednum S_SMALLGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate @@ -11185,7 +11185,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = }, { // MT_BIGGRABCHAIN - 1133, // doomednum + -1, // doomednum S_BIGGRABCHAIN, // spawnstate 1000, // spawnhealth S_NULL, // seestate From 520deac658a532d74acd0cae4551cbab42bc0813 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 22 Oct 2019 16:39:44 +0100 Subject: [PATCH 20/32] remove last few specks of Windows CE code I missed years ago --- src/m_misc.c | 2 +- src/r_data.c | 2 +- src/screen.h | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/src/m_misc.c b/src/m_misc.c index aaaf30d67..f7d5cf961 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -197,7 +197,7 @@ INT32 M_MapNumber(char first, char second) // ========================================================================== // some libcs has no access function, make our own -#if defined (_WIN32_WCE) +#if 0 int access(const char *path, int amode) { int accesshandle = -1; diff --git a/src/r_data.c b/src/r_data.c index f1d19a219..524baad15 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -35,7 +35,7 @@ #endif // Not sure if this is necessary, but it was in w_wad.c, so I'm putting it here too -Shadow Hog -#ifdef _WIN32_WCE +#if 0 #define AVOID_ERRNO #else #include diff --git a/src/screen.h b/src/screen.h index 3554b5520..79f21e8e4 100644 --- a/src/screen.h +++ b/src/screen.h @@ -39,13 +39,8 @@ // we try to re-allocate a minimum of buffers for stability of the memory, // so all the small-enough tables based on screen size, are allocated once // and for all at the maximum size. -#if defined (_WIN32_WCE) -#define MAXVIDWIDTH 320 -#define MAXVIDHEIGHT 200 -#else #define MAXVIDWIDTH 1920 // don't set this too high because actually #define MAXVIDHEIGHT 1200 // lots of tables are allocated with the MAX size. -#endif #define BASEVIDWIDTH 320 // NEVER CHANGE THIS! This is the original #define BASEVIDHEIGHT 200 // resolution of the graphics. From d62674c18436eefbb21b3c5de33bd7aaebf651eb Mon Sep 17 00:00:00 2001 From: James R Date: Tue, 22 Oct 2019 19:18:56 -0700 Subject: [PATCH 21/32] Clang warnings --- src/info.c | 8 ++++---- src/p_enemy.c | 2 +- src/p_user.c | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/info.c b/src/info.c index 33340876e..23ba67f37 100644 --- a/src/info.c +++ b/src/info.c @@ -4059,7 +4059,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = MT_THOK, // damage sfx_None, // activesound MF_SOLID|MF_SHOOTABLE, // flags - MT_NULL // raisestate + (statenum_t)MT_NULL// raisestate }, { // MT_TAILSOVERLAY @@ -4491,7 +4491,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_s3kd2l, // activesound MF_PAIN|MF_NOGRAVITY|MF_NOCLIPHEIGHT, // flags - MT_CRUSHCHAIN // raisestate + (statenum_t)MT_CRUSHCHAIN// raisestate }, { // MT_CRUSHCHAIN @@ -11829,7 +11829,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_None, // activesound MF_SLIDEME|MF_SOLID|MF_PUSHABLE, // flags - MT_ROCKCRUMBLE3 // raisestate + (statenum_t)MT_ROCKCRUMBLE3// raisestate }, { // MT_BRAMBLES @@ -12531,7 +12531,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 0, // damage sfx_s3k76, // activesound MF_PUSHABLE, // flags - MT_MINECARTSIDEMARK // raisestate + (statenum_t)MT_MINECARTSIDEMARK// raisestate }, { // MT_MINECARTSEG diff --git a/src/p_enemy.c b/src/p_enemy.c index f67d7d194..06544392d 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -2170,7 +2170,7 @@ void A_CrushclawLaunch(mobj_t *actor) UINT8 i = 0; for (i = 0; (i < CSEGS); i++) { - mobj_t *newchain = P_SpawnMobjFromMobj(actor, 0, 0, 0, actor->info->raisestate); + mobj_t *newchain = P_SpawnMobjFromMobj(actor, 0, 0, 0, (mobjtype_t)actor->info->raisestate); P_SetTarget(&prevchain->target, newchain); prevchain = newchain; } diff --git a/src/p_user.c b/src/p_user.c index a67274d79..3f4d08222 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -10456,7 +10456,7 @@ static mobj_t *P_LookForRails(mobj_t* mobj, fixed_t c, fixed_t s, angle_t target //Axes must be directly parallel or antiparallel, give or take 5 degrees. if (angdiff < ANG10) { - mark = P_SpawnMobj(nx, ny, nz, mobj->info->raisestate); + mark = P_SpawnMobj(nx, ny, nz, (mobjtype_t)mobj->info->raisestate); return mark; } } From bfce75d5cd2bf76bdf48e11605ef5faf5fa66bbf Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Wed, 23 Oct 2019 16:29:50 -0400 Subject: [PATCH 22/32] Disable restriction for ``DEVELOP`` builds only --- src/m_menu.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 56f757470..894b19e60 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -4549,7 +4549,11 @@ static boolean M_LevelAvailableOnPlatter(INT32 mapnum) if (mapnum+1 == spstage_start) return true; - return true; +#ifndef DEVELOP + if (mapvisited[mapnum]) // MV_MP +#endif + return true; + /* FALLTHRU */ case LLM_RECORDATTACK: case LLM_NIGHTSATTACK: From a215eeabf06ec8f66e352590bf002c84bef32e87 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 24 Oct 2019 18:51:12 +0100 Subject: [PATCH 23/32] * Fix Super players who die being eternally super. * Fix music stack corruption in multiplayer where a super player dies and it's not you. * Fix players in minecarts having their state eternally set to S_PLAY_STND (bug discovered/evident while super, so goes in this branch). Resolves #259. --- src/p_inter.c | 22 ++++++++++++++++++++++ src/p_user.c | 22 ++++++++++++++++------ 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index cce9df91b..c960ae31a 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -2468,6 +2468,28 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, UINT8 damaget target->flags |= MF_NOBLOCKMAP|MF_NOCLIP|MF_NOCLIPHEIGHT|MF_NOGRAVITY; P_SetThingPosition(target); + if (target->player->powers[pw_super]) + { + target->player->powers[pw_super] = 0; + if (P_IsLocalPlayer(target->player)) + { + music_stack_noposition = true; // HACK: Do not reposition next music + music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music + } + P_RestoreMusic(target->player); + + if (gametype != GT_COOP) + { + HU_SetCEchoFlags(0); + HU_SetCEchoDuration(5); + HU_DoCEcho(va("%s\\is no longer super.\\\\\\\\", player_names[target->player-players])); + } + } + + target->color = target->player->skincolor; + target->colorized = false; + G_GhostAddColor(GHC_NORMAL); + if ((target->player->lives <= 1) && (netgame || multiplayer) && (gametype == GT_COOP) && (cv_cooplives.value == 0)) ; else if (!target->player->bot && !target->player->spectator && !G_IsSpecialStage(gamemap) && (target->player->lives != INFLIVES) diff --git a/src/p_user.c b/src/p_user.c index e572e771b..62f797c46 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4156,8 +4156,11 @@ static void P_DoSuperStuff(player_t *player) { player->powers[pw_super] = 0; P_SetPlayerMobjState(player->mo, S_PLAY_STND); - music_stack_noposition = true; // HACK: Do not reposition next music - music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music + if (P_IsLocalPlayer(player)) + { + music_stack_noposition = true; // HACK: Do not reposition next music + music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music + } P_RestoreMusic(player); P_SpawnShieldOrb(player); @@ -4226,7 +4229,7 @@ static void P_DoSuperStuff(player_t *player) if (gametype != GT_COOP) player->powers[pw_flashing] = flashingtics-1; - if ((player->mo->health > 0) && (player->mo->sprite2 & FF_SPR2SUPER)) + if (player->mo->sprite2 & FF_SPR2SUPER) P_SetPlayerMobjState(player->mo, player->mo->state-states); // Inform the netgame that the champion has fallen in the heat of battle. @@ -4239,8 +4242,11 @@ static void P_DoSuperStuff(player_t *player) } // Resume normal music if you're the console player - music_stack_noposition = true; // HACK: Do not reposition next music - music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music + if (P_IsLocalPlayer(player)) + { + music_stack_noposition = true; // HACK: Do not reposition next music + music_stack_fadeout = MUSICRATE/2; // HACK: Fade out current music + } P_RestoreMusic(player); // If you had a shield, restore its visual significance. @@ -10674,7 +10680,11 @@ static void P_MinecartThink(player_t *player) } } - P_SetPlayerMobjState(player->mo, S_PLAY_STND); + if (player->mo->state-states != S_PLAY_STND) + { + P_SetPlayerMobjState(player->mo, S_PLAY_STND); + player->mo->tics = -1; + } // Move player to minecart. P_TeleportMove(player->mo, minecart->x - minecart->momx, minecart->y - minecart->momy, minecart->z + max(minecart->momz, 0) + 8*FRACUNIT); From 989e089e0af5ce8de1e8e722e40d314bf5b2c60c Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 24 Oct 2019 19:00:54 +0100 Subject: [PATCH 24/32] resolve #263 (this is going into master because it's literally just the line being present twice) --- src/p_inter.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index cce9df91b..80140d49d 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1493,8 +1493,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_SetMobjState(mo2, mo2->info->painstate); } } - - S_StartSound(toucher, special->info->painsound); return; case MT_FAKEMOBILE: From 527254584d6859b68b09dff72849c1eca783093d Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 24 Oct 2019 19:16:53 +0100 Subject: [PATCH 25/32] Disable tailsbot in NiGHTS maps, not just Special Stages. (Resolves #261) --- src/d_netcmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 1e69d371e..385e2295d 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -1692,7 +1692,7 @@ void D_MapChange(INT32 mapnum, INT32 newgametype, boolean pultmode, boolean rese // Kick bot from special stages if (botskin) { - if (G_IsSpecialStage(mapnum)) + if (G_IsSpecialStage(mapnum) || (mapheaderinfo[mapnum-1] && (mapheaderinfo[mapnum-1]->typeoflevel & TOL_NIGHTS))) { if (botingame) { From ea0fe50f5a7923bf8683daa4e73f0a84a771c074 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 24 Oct 2019 19:33:03 +0100 Subject: [PATCH 26/32] Fix CEZ3's first phase being cheated by Fang. --- src/p_mobj.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index f1dc5d760..650d0f561 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4929,6 +4929,7 @@ static void P_Boss4Thinker(mobj_t *mobj) mobj->movecount += mobj->threshold; if (mobj->movecount <= 0) { + mobj->flags2 &= ~MF2_INVERTAIMABLE; mobj->movecount = 0; mobj->movedir++; // Initialization complete, next phase! } @@ -10308,6 +10309,9 @@ mobj_t *P_SpawnMobj(fixed_t x, fixed_t y, fixed_t z, mobjtype_t type) mobj->movefactor = -512*FRACUNIT; mobj->flags2 |= MF2_CLASSICPUSH; break; + case MT_EGGMOBILE4: + mobj->flags2 |= MF2_INVERTAIMABLE; + break; case MT_FLICKY_08: mobj->color = (P_RandomChance(FRACUNIT/2) ? SKINCOLOR_RED : SKINCOLOR_AQUA); break; From 4ff46d14dd936e5a997ee48b4ac284e9371c86f3 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 24 Oct 2019 19:55:02 +0100 Subject: [PATCH 27/32] Added an experiment with an alternate CEZ3 pinch behaviour (but keep it disabled because it was kind of boring). --- src/p_mobj.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 650d0f561..d612bbbec 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -4716,13 +4716,17 @@ static void P_Boss4MoveSpikeballs(mobj_t *mobj, angle_t angle, fixed_t fz) } } +#define CEZ3TILT + // Pull them closer. static void P_Boss4PinchSpikeballs(mobj_t *mobj, angle_t angle, fixed_t dz) { INT32 s; mobj_t *base = mobj, *seg; - fixed_t originx, originy, workx, worky, dx, dy, bz = mobj->watertop+(8<watertop+(8<spawnpoint) { originx = mobj->spawnpoint->x << FRACBITS; @@ -4733,13 +4737,25 @@ static void P_Boss4PinchSpikeballs(mobj_t *mobj, angle_t angle, fixed_t dz) originx = mobj->x; originy = mobj->y; } +#else + if (mobj->spawnpoint) + { + rad -= R_PointToDist2(mobj->x, mobj->y, + (mobj->spawnpoint->x<spawnpoint->y<tracer)) // there are 10 per spoke, remember that { - dx = (originx + P_ReturnThrustX(mobj, angle, (9*132)<x)/9; - dy = (originy + P_ReturnThrustY(mobj, angle, (9*132)<y)/9; +#ifdef CEZ3TILT + dx = (originx + P_ReturnThrustX(mobj, angle, rad) - mobj->x)/9; + dy = (originy + P_ReturnThrustY(mobj, angle, rad) - mobj->y)/9; +#else + dx = P_ReturnThrustX(mobj, angle, rad)/9; + dy = P_ReturnThrustY(mobj, angle, rad)/9; +#endif workx = mobj->x + P_ReturnThrustX(mobj, angle, (112)<y + P_ReturnThrustY(mobj, angle, (112)<hnext, --s) From d89d8acc59f530ddbbd3839492dffd80937d453c Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 24 Oct 2019 20:40:03 +0100 Subject: [PATCH 28/32] I can't figure out how to make this consistent at all, so in order to have the water look good in levels designed for it, I think it's necessary to effectively revert everything with SHITPLANESPARENCY to a roughly 2.1-equivalent behaviour. --- src/r_plane.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/r_plane.c b/src/r_plane.c index 34debeea7..481af3913 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -44,6 +44,9 @@ // Quincunx antialiasing of flats! //#define QUINCUNX +// good night sweet prince +#define SHITPLANESPARENCY + //SoM: 3/23/2000: Use Boom visplane hashing. visplane_t *visplanes[MAXVISPLANES]; @@ -868,7 +871,11 @@ void R_DrawSinglePlane(visplane_t *pl) else // Opaque, but allow transparent flat pixels spanfunc = splatfunc; +#ifdef SHITPLANESPARENCY + if ((spanfunc == splatfunc) != (pl->extra_colormap && (pl->extra_colormap->fog & 4))) +#else if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2)) +#endif light = (pl->lightlevel >> LIGHTSEGSHIFT); else light = LIGHTLEVELS-1; @@ -922,7 +929,11 @@ void R_DrawSinglePlane(visplane_t *pl) else // Opaque, but allow transparent flat pixels spanfunc = splatfunc; +#ifdef SHITPLANESPARENCY + if ((spanfunc == splatfunc) != (pl->extra_colormap && (pl->extra_colormap->fog & 4))) +#else if (!pl->extra_colormap || !(pl->extra_colormap->fog & 2)) +#endif light = (pl->lightlevel >> LIGHTSEGSHIFT); else light = LIGHTLEVELS-1; From d5b1467e79330301cd9394da5199e3b994da5d56 Mon Sep 17 00:00:00 2001 From: lachwright Date: Fri, 25 Oct 2019 18:48:40 +0800 Subject: [PATCH 29/32] Put player in jump state after spinning during a wall transfer --- src/p_mobj.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index f1dc5d760..60ba7ed2d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1990,6 +1990,8 @@ void P_XYMovement(mobj_t *mo) { mo->momz = transfermomz; mo->standingslope = NULL; + if (player->pflags & PF_SPINNING) + player->pflags = (player->pflags & ~PF_SPINNING) | (P_GetJumpFlags(player) | PF_THOKKED); } } #endif From 2d458059c87a52c6d207dad4a18d842a6451dadb Mon Sep 17 00:00:00 2001 From: lachwright Date: Fri, 25 Oct 2019 18:51:41 +0800 Subject: [PATCH 30/32] Don't fuck nojumpspin characters who are capable of rolling --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 60ba7ed2d..1c6e3a7b4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1991,7 +1991,7 @@ void P_XYMovement(mobj_t *mo) mo->momz = transfermomz; mo->standingslope = NULL; if (player->pflags & PF_SPINNING) - player->pflags = (player->pflags & ~PF_SPINNING) | (P_GetJumpFlags(player) | PF_THOKKED); + player->pflags = (player->pflags & ~PF_SPINNING) | (PF_JUMPED | PF_THOKKED); } } #endif From 863101824aefc0799b9b32f7ad1c8dc9f29e1393 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 25 Oct 2019 20:17:50 +0200 Subject: [PATCH 31/32] Removed palm tree trunks from the ZB config. They no longer exist as mapthings. --- extras/conf/SRB2-22.cfg | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index edd5be442..f1e8481eb 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -5622,13 +5622,6 @@ thingtypes title = "BSZ Clover"; sprite = "BSZ8B0"; } - 1472 - { - title = "Palm Tree Trunk (Big)"; - width = 16; - height = 160; - sprite = "BSZ8C0"; - } 1473 { title = "Palm Tree Leaves (Big)"; @@ -5636,13 +5629,6 @@ thingtypes height = 160; sprite = "BSZ8D0"; } - 1474 - { - title = "Palm Tree Trunk (Small)"; - width = 8; - height = 80; - sprite = "BSZ8E0"; - } 1475 { title = "Palm Tree Leaves (Small)"; From 53ac815334e1970b81001b5397644eedd4cc4c15 Mon Sep 17 00:00:00 2001 From: MascaraSnake Date: Fri, 25 Oct 2019 20:48:51 +0200 Subject: [PATCH 32/32] ...and also rename the palm tree leaves accordingly --- extras/conf/SRB2-22.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extras/conf/SRB2-22.cfg b/extras/conf/SRB2-22.cfg index f1e8481eb..a06b1a29d 100644 --- a/extras/conf/SRB2-22.cfg +++ b/extras/conf/SRB2-22.cfg @@ -5624,14 +5624,14 @@ thingtypes } 1473 { - title = "Palm Tree Leaves (Big)"; + title = "Palm Tree (Big)"; width = 16; height = 160; sprite = "BSZ8D0"; } 1475 { - title = "Palm Tree Leaves (Small)"; + title = "Palm Tree (Small)"; width = 16; height = 80; sprite = "BSZ8F0";