From 23c6011348b56dd18946799cb4c4ed3d5204b184 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 27 Oct 2019 13:12:36 -0400 Subject: [PATCH 1/9] Fix char select music not playing in secrets menu --- src/m_menu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_menu.c b/src/m_menu.c index 54c0b6c87..ea95b9c85 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2306,7 +2306,7 @@ void M_InitMenuPresTables(void) strncpy(menupres[i].musname, "_recat", 7); else if (i == MN_SP_NIGHTSATTACK) strncpy(menupres[i].musname, "_nitat", 7); - else if (i == MN_SP_PLAYER) + else if (i == MN_SP_PLAYER || i == MN_SR_PLAYER) strncpy(menupres[i].musname, "_chsel", 7); } } From df785e16519fa1d76c1925577df19d8dbbe845a5 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 27 Oct 2019 17:20:43 +0000 Subject: [PATCH 2/9] * Add alternate numerical drawer for continues on Intermission screen if there's > 5. * Tweak offsets on Continue screen numerical continue drawer to match. --- src/f_finale.c | 4 ++-- src/y_inter.c | 20 ++++++++++++++++---- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index eb1415042..9d0d7892e 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -2586,8 +2586,8 @@ void F_ContinueDrawer(void) { if (!(continuetime & 1) || continuetime > 17) V_DrawContinueIcon(x, 68, 0, players[consoleplayer].skin, players[consoleplayer].skincolor); - V_DrawScaledPatch(x+12, 68-2, 0, stlivex); - V_DrawRightAlignedString(x+36, 69-5, 0, + V_DrawScaledPatch(x+12, 66, 0, stlivex); + V_DrawRightAlignedString(x+38, 64, 0, va("%d",(imcontinuing ? ncontinues-1 : ncontinues))); } else diff --git a/src/y_inter.c b/src/y_inter.c index 2fed35de3..c9ab564ba 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -425,11 +425,23 @@ void Y_IntermissionDrawer(void) UINT8 continues = data.spec.continues & 0x7F; V_DrawScaledPatch(152 + xoffset5, 150+yoffset, 0, data.spec.pcontinues); - for (i = 0; i < continues; ++i) + if (continues > 5) { - if ((data.spec.continues & 0x80) && i == continues-1 && (endtic < 0 || intertic%20 < 10)) - break; - V_DrawContinueIcon(246 + xoffset5 - (i*20), 162+yoffset, 0, *data.spec.playerchar, *data.spec.playercolor); + INT32 leftx = (continues >= 10) ? 216 : 224; + V_DrawContinueIcon(leftx + xoffset5, 162+yoffset, 0, *data.spec.playerchar, *data.spec.playercolor); + V_DrawScaledPatch(leftx + xoffset5 + 12, 160+yoffset, 0, stlivex); + if (!((data.spec.continues & 0x80) && !(endtic < 0 || intertic%20 < 10))) + V_DrawRightAlignedString(252 + xoffset5, 158+yoffset, 0, + va("%d",(((data.spec.continues & 0x80) && (endtic < 0)) ? continues-1 : continues))); + } + else + { + for (i = 0; i < continues; ++i) + { + if ((data.spec.continues & 0x80) && i == continues-1 && (endtic < 0 || intertic%20 < 10)) + break; + V_DrawContinueIcon(246 + xoffset5 - (i*20), 162+yoffset, 0, *data.spec.playerchar, *data.spec.playercolor); + } } } } From e91bf1a32e68ca852528ab9d285fffa9df7b0f7c Mon Sep 17 00:00:00 2001 From: Louis-Antoine Date: Mon, 28 Oct 2019 16:10:22 +0100 Subject: [PATCH 3/9] Fix some intro fades displaying text in all-caps --- src/f_finale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index eb1415042..096e4424b 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -836,7 +836,7 @@ void F_IntroDrawer(void) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawScaledPatch(0, 0, 0, radar); W_UnlockCachedPatch(radar); - V_DrawString(8, 128, 0, cutscene_disptext); + V_DrawString(8, 128, V_ALLOWLOWERCASE, cutscene_disptext); F_WipeEndScreen(); F_RunWipe(99,true); @@ -849,7 +849,7 @@ void F_IntroDrawer(void) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawScaledPatch(0, 0, 0, grass); W_UnlockCachedPatch(grass); - V_DrawString(8, 128, 0, cutscene_disptext); + V_DrawString(8, 128, V_ALLOWLOWERCASE, cutscene_disptext); F_WipeEndScreen(); F_RunWipe(99,true); @@ -862,7 +862,7 @@ void F_IntroDrawer(void) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawSmallScaledPatch(0, 0, 0, confront); W_UnlockCachedPatch(confront); - V_DrawString(8, 128, 0, cutscene_disptext); + V_DrawString(8, 128, V_ALLOWLOWERCASE, cutscene_disptext); F_WipeEndScreen(); F_RunWipe(99,true); @@ -875,7 +875,7 @@ void F_IntroDrawer(void) V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); V_DrawSmallScaledPatch(0, 0, 0, sdo); W_UnlockCachedPatch(sdo); - V_DrawString(224, 8, 0, cutscene_disptext); + V_DrawString(224, 8, V_ALLOWLOWERCASE, cutscene_disptext); F_WipeEndScreen(); F_RunWipe(99,true); From 0a49340ae11f4deab9e089079dc6e6ba22f2f64a Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Mon, 28 Oct 2019 23:46:33 -0300 Subject: [PATCH 4/9] Fix warnings when NOPNG=1 --- src/hardware/hw_cache.c | 4 +++- src/r_data.c | 6 +++++- src/w_wad.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_cache.c b/src/hardware/hw_cache.c index 02df290b8..5cfd0f61c 100644 --- a/src/hardware/hw_cache.c +++ b/src/hardware/hw_cache.c @@ -690,7 +690,9 @@ static void HWR_GenerateTexture(INT32 texnum, GLTexture_t *grtex) // Composite the columns together. for (i = 0, patch = texture->patches; i < texture->patchcount; i++, patch++) { +#ifndef NO_PNG_LUMPS size_t lumplength = W_LumpLengthPwad(patch->wad, patch->lump); +#endif realpatch = W_CacheLumpNumPwad(patch->wad, patch->lump, PU_CACHE); #ifndef NO_PNG_LUMPS if (R_IsLumpPNG((UINT8 *)realpatch, lumplength)) @@ -929,9 +931,9 @@ static void HWR_LoadPatchFlat(GLMipmap_t *grMipmap, lumpnum_t flatlumpnum) { UINT8 *flat; patch_t *patch = (patch_t *)W_CacheLumpNum(flatlumpnum, PU_STATIC); +#ifndef NO_PNG_LUMPS size_t lumplength = W_LumpLength(flatlumpnum); -#ifndef NO_PNG_LUMPS if (R_IsLumpPNG((UINT8 *)patch, lumplength)) patch = R_PNGToPatch((UINT8 *)patch, lumplength, NULL, false); #endif diff --git a/src/r_data.c b/src/r_data.c index 524baad15..74cbf6ad4 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -831,7 +831,9 @@ void R_LoadTextures(void) { UINT16 wadnum = (UINT16)w; lumpnum_t lumpnum = texstart + j; +#ifndef NO_PNG_LUMPS size_t lumplength; +#endif if (wadfiles[w]->type == RET_PK3) { @@ -839,8 +841,10 @@ void R_LoadTextures(void) continue; // If it is then SKIP IT } - lumplength = W_LumpLengthPwad(wadnum, lumpnum); patchlump = W_CacheLumpNumPwad(wadnum, lumpnum, PU_CACHE); +#ifndef NO_PNG_LUMPS + lumplength = W_LumpLengthPwad(wadnum, lumpnum); +#endif //CONS_Printf("\n\"%s\" is a single patch, dimensions %d x %d",W_CheckNameForNumPwad((UINT16)w,texstart+j),patchlump->width, patchlump->height); texture = textures[i] = Z_Calloc(sizeof(texture_t) + sizeof(texpatch_t), PU_STATIC, NULL); diff --git a/src/w_wad.c b/src/w_wad.c index 4d08b26dc..51c77fd87 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -1531,7 +1531,10 @@ void *W_CachePatchNumPwad(UINT16 wad, UINT16 lump, INT32 tag) if (!lumpcache[lump]) { size_t len = W_LumpLengthPwad(wad, lump); - void *ptr, *lumpdata, *srcdata = NULL; + void *ptr, *lumpdata; +#ifndef NO_PNG_LUMPS + void *srcdata = NULL; +#endif ptr = Z_Malloc(len, tag, &lumpcache[lump]); lumpdata = Z_Malloc(len, tag, NULL); From 5464b6ab280dafc35f8b50bb4a0b66e280ddc4ff Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 29 Oct 2019 00:15:33 -0300 Subject: [PATCH 5/9] Use doomtype.h types instead of libpng types --- src/r_data.c | 35 ++++++++++++++++++----------------- 1 file changed, 18 insertions(+), 17 deletions(-) diff --git a/src/r_data.c b/src/r_data.c index 74cbf6ad4..d37f7822d 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -2802,22 +2802,23 @@ boolean R_IsLumpPNG(const UINT8 *d, size_t s) #ifdef HAVE_PNG -#if PNG_LIBPNG_VER_DLLNUM < 14 +/*#if PNG_LIBPNG_VER_DLLNUM < 14 typedef PNG_CONST png_byte *png_const_bytep; -#endif -typedef struct { - png_const_bytep buffer; - png_uint_32 bufsize; - png_uint_32 current_pos; +#endif*/ +typedef struct +{ + const UINT8 *buffer; + UINT32 size; + UINT32 position; } png_io_t; static void PNG_IOReader(png_structp png_ptr, png_bytep data, png_size_t length) { png_io_t *f = png_get_io_ptr(png_ptr); - if (length > (f->bufsize - f->current_pos)) + if (length > (f->size - f->position)) png_error(png_ptr, "PNG_IOReader: buffer overrun"); - memcpy(data, f->buffer + f->current_pos, length); - f->current_pos += length; + memcpy(data, f->buffer + f->position, length); + f->position += length; } typedef struct @@ -2903,10 +2904,10 @@ static png_bytep *PNG_Read(const UINT8 *png, UINT16 *w, UINT16 *h, INT16 *topoff png_memcpy(png_jmpbuf(png_ptr), jmpbuf, sizeof jmp_buf); #endif - // set our own read_function - png_io.buffer = (png_const_bytep)png; - png_io.bufsize = size; - png_io.current_pos = 0; + // set our own read function + png_io.buffer = png; + png_io.size = size; + png_io.position = 0; png_set_read_fn(png_ptr, &png_io, PNG_IOReader); memset(&chunk, 0x00, sizeof(png_chunk_t)); @@ -3073,10 +3074,10 @@ boolean R_PNGDimensions(UINT8 *png, INT16 *width, INT16 *height, size_t size) png_memcpy(png_jmpbuf(png_ptr), jmpbuf, sizeof jmp_buf); #endif - // set our own read_function - png_io.buffer = (png_bytep)png; - png_io.bufsize = size; - png_io.current_pos = 0; + // set our own read function + png_io.buffer = png; + png_io.size = size; + png_io.position = 0; png_set_read_fn(png_ptr, &png_io, PNG_IOReader); #ifdef PNG_SET_USER_LIMITS_SUPPORTED From 16c107e2ac3ac3590bbf2b5822bb425dd27f6cc5 Mon Sep 17 00:00:00 2001 From: Steel Titanium Date: Sun, 3 Nov 2019 21:43:09 -0500 Subject: [PATCH 6/9] Fix garbage string being drawn on record attack menu Pretty silly of me to assume it would be NUL-terminated by default. --- src/m_menu.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/m_menu.c b/src/m_menu.c index 8fe782cac..e736cc6f7 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -8723,6 +8723,10 @@ void M_DrawTimeAttackMenu(void) char beststr[40]; char reqscore[40], reqtime[40], reqrings[40]; + strcpy(reqscore, "\0"); + strcpy(reqtime, "\0"); + strcpy(reqrings, "\0"); + M_DrawLevelPlatterHeader(32-lsheadingheight/2, cv_nextmap.string, true, false); // A 160x100 image of the level as entry MAPxxP From ed967f077c0ef88f9772e36e72f68851c01add4f Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 5 Nov 2019 17:04:57 -0300 Subject: [PATCH 7/9] Restore the last gameplay frame while on the intermission screen --- src/d_main.c | 1 + src/y_inter.c | 123 ++++++++++++++++++++++++++++++++++++++++++++++++-- src/y_inter.h | 1 + 3 files changed, 121 insertions(+), 4 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 52f1d2997..eff608281 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -415,6 +415,7 @@ static void D_Display(void) if (rendermode == render_soft) { VID_BlitLinearScreen(screens[0], screens[1], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); + Y_ConsiderScreenBuffer(); usebuffer = true; } lastdraw = false; diff --git a/src/y_inter.c b/src/y_inter.c index 2fed35de3..335b2a43b 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -143,9 +143,21 @@ static patch_t *widebgpatch = NULL; // INTERSCW static patch_t *bgtile = NULL; // SPECTILE/SRB2BACK static patch_t *interpic = NULL; // custom picture defined in map header static boolean usetile; +static INT32 timer; + +typedef struct +{ + INT32 source_width, source_height; + INT32 source_bpp, source_rowbytes; + UINT8 *source_picture; + INT32 target_width, target_height; + INT32 target_bpp, target_rowbytes; + UINT8 *target_picture; +} y_buffer_t; + boolean usebuffer = false; static boolean useinterpic; -static INT32 timer; +static y_buffer_t *y_buffer; static INT32 intertic; static INT32 tallydonetic = -1; @@ -153,6 +165,8 @@ static INT32 endtic = -1; intertype_t intertype = int_none; +static void Y_RescaleScreenBuffer(void); +static void Y_CleanupScreenBuffer(void); static void Y_AwardCoopBonuses(void); static void Y_AwardSpecialStageBonus(void); static void Y_CalculateCompetitionWinners(void); @@ -207,6 +221,94 @@ static void Y_IntermissionTokenDrawer(void) V_DrawCroppedPatch(32<width), calc); } +// +// Y_ConsiderScreenBuffer +// +// Can we copy the current screen +// to a buffer? +// +void Y_ConsiderScreenBuffer(void) +{ + if (gameaction != ga_completed) + return; + + if (y_buffer == NULL) + y_buffer = Z_Calloc(sizeof(y_buffer_t), PU_STATIC, NULL); + else + return; + + y_buffer->source_width = vid.width; + y_buffer->source_height = vid.height; + y_buffer->source_bpp = vid.bpp; + y_buffer->source_rowbytes = vid.rowbytes; + y_buffer->source_picture = ZZ_Alloc(y_buffer->source_width*vid.bpp * y_buffer->source_height); + VID_BlitLinearScreen(screens[1], y_buffer->source_picture, vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); + + // Make the rescaled screen buffer + Y_RescaleScreenBuffer(); +} + +// +// Y_RescaleScreenBuffer +// +// Write the rescaled source picture, +// to the destination picture that +// has the current screen's resolutions. +// +static void Y_RescaleScreenBuffer(void) +{ + INT32 sx, sy; // source + INT32 dx, dy; // dest + fixed_t scalefac, yscalefac; + fixed_t rowfrac, colfrac; + UINT8 *dest; + + // Who knows? + if (y_buffer == NULL) + return; + + if (y_buffer->target_picture) + Z_Free(y_buffer->target_picture); + + y_buffer->target_width = vid.width; + y_buffer->target_height = vid.height; + y_buffer->target_rowbytes = vid.rowbytes; + y_buffer->target_bpp = vid.bpp; + y_buffer->target_picture = ZZ_Alloc(y_buffer->target_width*vid.bpp * y_buffer->target_height); + dest = y_buffer->target_picture; + + scalefac = FixedDiv(y_buffer->target_width*FRACUNIT, y_buffer->source_width*FRACUNIT); + yscalefac = FixedDiv(y_buffer->target_height*FRACUNIT, y_buffer->source_height*FRACUNIT); + + rowfrac = FixedDiv(FRACUNIT, yscalefac); + colfrac = FixedDiv(FRACUNIT, scalefac); + + for (sy = 0, dy = 0; sy < (y_buffer->source_height << FRACBITS) && dy < y_buffer->target_height; sy += rowfrac, dy++) + for (sx = 0, dx = 0; sx < (y_buffer->source_width << FRACBITS) && dx < y_buffer->target_width; sx += colfrac, dx += y_buffer->target_bpp) + dest[(dy * y_buffer->target_rowbytes) + dx] = y_buffer->source_picture[((sy>>FRACBITS) * y_buffer->source_width) + (sx>>FRACBITS)]; +} + +// +// Y_CleanupScreenBuffer +// +// Free all related memory. +// +static void Y_CleanupScreenBuffer(void) +{ + // Who knows? + if (y_buffer == NULL) + return; + + if (y_buffer->target_picture) + Z_Free(y_buffer->target_picture); + + if (y_buffer->source_picture) + Z_Free(y_buffer->source_picture); + + Z_Free(y_buffer); + y_buffer = NULL; +} + // // Y_IntermissionDrawer // @@ -229,12 +331,23 @@ void Y_IntermissionDrawer(void) else if (!usetile) { if (rendermode == render_soft && usebuffer) - VID_BlitLinearScreen(screens[1], screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); + { + // no y_buffer + if (y_buffer == NULL) + VID_BlitLinearScreen(screens[1], screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); + else + { + // Maybe the resolution changed? + if ((y_buffer->target_width != vid.width) || (y_buffer->target_height != vid.height)) + Y_RescaleScreenBuffer(); + + // Blit the already-scaled screen buffer to the current screen + VID_BlitLinearScreen(y_buffer->target_picture, screens[0], vid.width*vid.bpp, vid.height, vid.width*vid.bpp, vid.rowbytes); + } + } #ifdef HWRENDER else if(rendermode != render_soft && usebuffer) - { HWR_DrawIntermissionBG(); - } #endif else { @@ -2096,6 +2209,8 @@ static void Y_UnloadData(void) if (rendermode != render_soft) return; + Y_CleanupScreenBuffer(); + // unload the background patches UNLOAD(bgpatch); UNLOAD(widebgpatch); diff --git a/src/y_inter.h b/src/y_inter.h index 4c6ad2bdf..ccb48dbd4 100644 --- a/src/y_inter.h +++ b/src/y_inter.h @@ -15,6 +15,7 @@ void Y_IntermissionDrawer(void); void Y_Ticker(void); void Y_StartIntermission(void); void Y_EndIntermission(void); +void Y_ConsiderScreenBuffer(void); typedef enum { From 6d024b712489b992f702b99f28702094afaebf25 Mon Sep 17 00:00:00 2001 From: Jaime Passos Date: Tue, 5 Nov 2019 17:35:16 -0300 Subject: [PATCH 8/9] I guess I'll have to do at least SOMETHING about OpenGL --- src/d_main.c | 7 +++++++ src/y_inter.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/d_main.c b/src/d_main.c index eff608281..ca40fcb24 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -227,7 +227,14 @@ static void D_Display(void) SCR_SetMode(); // change video mode if (vid.recalc) + { SCR_Recalc(); // NOTE! setsizeneeded is set by SCR_Recalc() +#ifdef HWRENDER + // Shoot! The screen texture was flushed! + if ((rendermode == render_opengl) && (gamestate == GS_INTERMISSION)) + usebuffer = false; +#endif + } // change the view size if needed if (setsizeneeded) diff --git a/src/y_inter.c b/src/y_inter.c index 335b2a43b..0a6e3b3fe 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -346,7 +346,7 @@ void Y_IntermissionDrawer(void) } } #ifdef HWRENDER - else if(rendermode != render_soft && usebuffer) + else if (rendermode != render_soft && usebuffer) HWR_DrawIntermissionBG(); #endif else From b157c21a35cb6246974864c4b096b5e914314270 Mon Sep 17 00:00:00 2001 From: James R Date: Thu, 7 Nov 2019 14:56:42 -0800 Subject: [PATCH 9/9] There's some whitespace... --- src/hardware/hw_light.c | 2 +- src/info.h | 2 +- src/p_floor.c | 2 +- src/p_map.c | 4 ++-- src/p_spec.c | 2 +- src/p_user.c | 28 ++++++++++++++-------------- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/src/hardware/hw_light.c b/src/hardware/hw_light.c index fa66536b6..8f62f7763 100644 --- a/src/hardware/hw_light.c +++ b/src/hardware/hw_light.c @@ -406,7 +406,7 @@ 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 diff --git a/src/info.h b/src/info.h index e7f41f585..57943c389 100644 --- a/src/info.h +++ b/src/info.h @@ -556,7 +556,7 @@ 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) diff --git a/src/p_floor.c b/src/p_floor.c index 1360375a7..423fc1b70 100644 --- a/src/p_floor.c +++ b/src/p_floor.c @@ -2459,7 +2459,7 @@ void T_RaiseSector(levelspecthink_t *raise) break; } } - + if (raise->vars[9]) // Dynamically Sinking Platform^tm { #define shaketime 10 diff --git a/src/p_map.c b/src/p_map.c index 159489f70..33ac20265 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1040,7 +1040,7 @@ static boolean PIT_CheckThing(mobj_t *thing) { if (tmthing->z > thing->z + thing->height || thing->z > tmthing->z + tmthing->height || !thing->health) return true; - + if (thing == tmthing->tracer) // don't collide with rider return true; @@ -1054,7 +1054,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_KillMobj(thing, tmthing, tmthing->tracer, 0); return true; } - + if (thing->type == tmthing->type // bounce against other rollout rocks && (tmthing->momx || tmthing->momy || thing->momx || thing->momy)) { diff --git a/src/p_spec.c b/src/p_spec.c index 50939ae5b..7b23ecbe7 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -6068,7 +6068,7 @@ static void P_AddAirbob(sector_t *sec, line_t *sourceline, boolean noadjust, boo airbob->vars[5] = sec->ceilingheight; airbob->vars[4] = airbob->vars[5] - (sec->ceilingheight - sec->floorheight); - + airbob->vars[9] = dynamic ? 1 : 0; airbob->sourceline = sourceline; diff --git a/src/p_user.c b/src/p_user.c index f81f6d956..561183cd5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1096,7 +1096,7 @@ boolean P_PlayerCanDamage(player_t *player, mobj_t *thing) // Spinning. if (player->pflags & PF_SPINNING) return true; - + if (player->dashmode >= DASHMODE_THRESHOLD && (player->charflags & (SF_DASHMODE|SF_MACHINE)) == (SF_DASHMODE|SF_MACHINE)) return true; @@ -7820,7 +7820,7 @@ static void P_MovePlayer(player_t *player) if (!(player->powers[pw_nocontrol] & (1<<15))) player->pflags |= PF_JUMPSTASIS; } - + if (player->charability == CA_GLIDEANDCLIMB && player->mo->state-states == S_PLAY_GLIDE_LANDING) { player->pflags |= PF_STASIS; @@ -10978,19 +10978,19 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume) tic_t dashmode = player->dashmode; boolean underwater = mo->eflags & MFE_UNDERWATER; statenum_t stat = fume->state-states; - + if (panim != PA_WALK && panim != PA_RUN && panim != PA_DASH) // turn invisible when not in a coherent movement state { if (stat != fume->info->spawnstate) P_SetMobjState(fume, fume->info->spawnstate); return; } - + if (underwater) // No fume underwater; spawn bubbles instead! { fume->movedir += FixedAngle(FixedDiv(2 * player->speed, 3 * mo->scale)); fume->movefactor += player->speed; - + if (fume->movefactor > FixedDiv(2 * player->normalspeed, 3 * mo->scale)) { INT16 i; @@ -11000,7 +11000,7 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume) fixed_t factorX = P_ReturnThrustX(mo, angle + ANGLE_90, mo->scale); fixed_t factorY = P_ReturnThrustY(mo, angle + ANGLE_90, mo->scale); fixed_t offsetH, offsetV, x, y, z; - + for (i = -1; i < 2; i += 2) { offsetH = i*P_ReturnThrustX(fume, fume->movedir, radiusV); @@ -11010,10 +11010,10 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume) z = mo->z + (mo->height >> 1) + offsetV; P_SpawnMobj(x, y, z, MT_SMALLBUBBLE)->scale = mo->scale >> 1; } - + fume->movefactor = 0; } - + if (panim == PA_WALK) { if (stat != fume->info->spawnstate) @@ -11021,13 +11021,13 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume) return; } } - + if (stat == fume->info->spawnstate) // If currently inivisble, activate! { P_SetMobjState(fume, (stat = fume->info->seestate)); P_SetScale(fume, mo->scale); } - + if (dashmode > DASHMODE_THRESHOLD && stat != fume->info->seestate) // If in dashmode, grow really big and flash { fume->destscale = mo->scale; @@ -11044,19 +11044,19 @@ static void P_DoMetalJetFume(player_t *player, mobj_t *fume) fume->flags2 = (fume->flags2 & ~MF2_DONTDRAW) | (mo->flags2 & MF2_DONTDRAW); fume->destscale = (mo->scale + FixedDiv(player->speed, player->normalspeed)) / (underwater ? 6 : 3); fume->color = FUME_SKINCOLORS[(dashmode * sizeof(FUME_SKINCOLORS)) / (DASHMODE_MAX + 1)]; - + if (underwater) { fume->frame = (fume->frame & FF_FRAMEMASK) | FF_ANIMATE | (P_RandomRange(0, 9) * FF_TRANS10); } } - + fume->movecount = dashmode; // keeps track of previous dashmode value so we know whether Metal is entering or leaving it fume->eflags = (fume->eflags & ~MFE_VERTICALFLIP) | (mo->eflags & MFE_VERTICALFLIP); // Make sure to flip in reverse gravity! - + // Finally, set its position dist = -mo->radius - FixedMul(fume->info->radius, fume->destscale - mo->scale/3); - + P_UnsetThingPosition(fume); fume->x = mo->x + P_ReturnThrustX(fume, angle, dist); fume->y = mo->y + P_ReturnThrustY(fume, angle, dist);