From 8e753c188670bc83b837755ed765ce50d3be1084 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 27 Apr 2016 17:17:35 -0700 Subject: [PATCH 1/7] compilation fix for DEBUGRANDOM --- src/m_random.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/m_random.c b/src/m_random.c index 79f3af113..5fde12535 100644 --- a/src/m_random.c +++ b/src/m_random.c @@ -110,7 +110,7 @@ ATTRINLINE static fixed_t FUNCINLINE __internal_prng__(void) fixed_t P_RandomFixed(void) { #else -UINT8 P_RandomFixedD(const char *rfile, INT32 rline) +fixed_t P_RandomFixedD(const char *rfile, INT32 rline) { CONS_Printf("P_RandomFixed() at: %sp %d\n", rfile, rline); #endif From 8fd8f2c31683199179f438ec5cdda1653a5c8098 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 29 Apr 2016 18:01:05 +0100 Subject: [PATCH 2/7] Disable "splats" command unless WALLSPLATS is enabled apparently it was never used for what exists of floor splats' code, huh --- src/d_netcmd.c | 2 ++ src/d_netcmd.h | 2 ++ src/p_mobj.c | 2 ++ 3 files changed, 6 insertions(+) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index c62ff8fe1..b4ba92182 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -597,7 +597,9 @@ void D_RegisterClientCommands(void) CV_RegisterVar(&cv_gif_optimize); CV_RegisterVar(&cv_gif_downscale); +#ifdef WALLSPLATS CV_RegisterVar(&cv_splats); +#endif // register these so it is saved to config if ((username = I_GetUserName())) diff --git a/src/d_netcmd.h b/src/d_netcmd.h index 31a7cf818..42ac4c054 100644 --- a/src/d_netcmd.h +++ b/src/d_netcmd.h @@ -81,7 +81,9 @@ extern consvar_t cv_useranalog, cv_useranalog2; extern consvar_t cv_analog, cv_analog2; extern consvar_t cv_netstat; +#ifdef WALLSPLATS extern consvar_t cv_splats; +#endif extern consvar_t cv_countdowntime; extern consvar_t cv_runscripts; diff --git a/src/p_mobj.c b/src/p_mobj.c index 9bf95972c..bcbb72c42 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -38,7 +38,9 @@ // protos. static CV_PossibleValue_t viewheight_cons_t[] = {{16, "MIN"}, {56, "MAX"}, {0, NULL}}; consvar_t cv_viewheight = {"viewheight", VIEWHEIGHTS, 0, viewheight_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; +#ifdef WALLSPLATS consvar_t cv_splats = {"splats", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +#endif actioncache_t actioncachehead; From 770fa6f92442e8f0ccfb3e4e7995993a0074ed2d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 29 Apr 2016 18:32:03 +0100 Subject: [PATCH 3/7] Disable 16bpp drawing code since nothing of it is currently used anyway --- src/r_draw.c | 2 ++ src/r_draw.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/r_draw.c b/src/r_draw.c index 766e0428e..f7896b022 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -801,4 +801,6 @@ void R_DrawViewBorder(void) // INCLUDE 16bpp DRAWING CODE HERE // ========================================================================== +#ifdef HIGHCOLOR #include "r_draw16.c" +#endif diff --git a/src/r_draw.h b/src/r_draw.h index 0ece26487..97b2b2953 100644 --- a/src/r_draw.h +++ b/src/r_draw.h @@ -169,11 +169,13 @@ void R_DrawColumnShadowed_8(void); // 16bpp DRAWING CODE // ------------------ +#ifdef HIGHCOLOR void R_DrawColumn_16(void); void R_DrawWallColumn_16(void); void R_DrawTranslucentColumn_16(void); void R_DrawTranslatedColumn_16(void); void R_DrawSpan_16(void); +#endif // ========================================================================= #endif // __R_DRAW__ From 55a1de899c35c63d5f191d09a905a7fa42a853ce Mon Sep 17 00:00:00 2001 From: Sean Ryder Date: Fri, 29 Apr 2016 18:58:20 +0100 Subject: [PATCH 4/7] The fade masks textures should use an alpha format So they don't get effected by the texture format set by the screen depth GL_RGB5_A1 from 16-bit was removing all alpha from the texture --- src/hardware/r_opengl/r_opengl.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index a407a9e45..587a23935 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -1470,6 +1470,26 @@ EXPORT void HWRAPI(SetTexture) (FTextureInfo *pTexInfo) else pglTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex); } + else if (pTexInfo->grInfo.format == GR_TEXFMT_ALPHA_8) + { + //pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex); + if (MipMap) + { + pgluBuild2DMipmaps(GL_TEXTURE_2D, GL_ALPHA, w, h, GL_RGBA, GL_UNSIGNED_BYTE, ptex); +#ifdef GL_TEXTURE_MIN_LOD + pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_LOD, 0); +#endif +#ifdef GL_TEXTURE_MAX_LOD + if (pTexInfo->flags & TF_TRANSPARENT) + pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 0); // No mippmaps on transparent stuff + else + pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAX_LOD, 4); +#endif + //pglTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_LINEAR_MIPMAP_LINEAR); + } + else + pglTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, ptex); + } else { if (MipMap) From d2d73f085d641f5fdbd0ad531384793ecf4456fe Mon Sep 17 00:00:00 2001 From: Sean Ryder Date: Fri, 29 Apr 2016 20:56:46 +0100 Subject: [PATCH 5/7] Change internal formats of screen fade texture to RGB Don't think either of them need RGBA --- src/hardware/r_opengl/r_opengl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index 587a23935..ddd5807a5 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2163,7 +2163,7 @@ EXPORT void HWRAPI(StartScreenWipe) (void) Clamp2D(GL_TEXTURE_WRAP_S); Clamp2D(GL_TEXTURE_WRAP_T); #ifndef KOS_GL_COMPATIBILITY - pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, texsize, texsize, 0); + pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0); #endif tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now @@ -2192,7 +2192,7 @@ EXPORT void HWRAPI(EndScreenWipe)(void) Clamp2D(GL_TEXTURE_WRAP_S); Clamp2D(GL_TEXTURE_WRAP_T); #ifndef KOS_GL_COMPATIBILITY - pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 0, 0, texsize, texsize, 0); + pglCopyTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, 0, 0, texsize, texsize, 0); #endif tex_downloaded = 0; // 0 so it knows it doesn't have any of the cached patches downloaded right now From 6fcb6d27feb119ccc603da578a154f5e3b8816a8 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Sat, 30 Apr 2016 03:19:00 -0500 Subject: [PATCH 6/7] Fix Lua not having access to timeshit Fixes http://mb.srb2.org/showthread.php?t=41403. Not sure why nobody noticed this earlier. --- src/lua_playerlib.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 64513ab97..53af2e3ac 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -298,6 +298,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->lastlinehit); else if (fastcmp(field,"losstime")) lua_pushinteger(L, plr->losstime); + else if (fastcmp(field,"timeshit")) + lua_pushinteger(L, plr->timeshit); else if (fastcmp(field,"onconveyor")) lua_pushinteger(L, plr->onconveyor); else if (fastcmp(field,"awayviewmobj")) @@ -553,6 +555,8 @@ static int player_set(lua_State *L) plr->lastlinehit = (INT16)luaL_checkinteger(L, 3); else if (fastcmp(field,"losstime")) plr->losstime = (tic_t)luaL_checkinteger(L, 3); + else if (fastcmp(field,"timeshit")) + plr->timeshit = (UINT8)luaL_checkinteger(L, 3); else if (fastcmp(field,"onconveyor")) plr->onconveyor = (INT32)luaL_checkinteger(L, 3); else if (fastcmp(field,"awayviewmobj")) From 0eb41b4450c715971cfbfabfbb2723a9488bf48d Mon Sep 17 00:00:00 2001 From: Sean Ryder Date: Sat, 30 Apr 2016 13:40:00 +0100 Subject: [PATCH 7/7] Flip fade mask Y coordinates For some reason every texture and flat loaded into GL is vertically flipped --- src/hardware/r_opengl/r_opengl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/hardware/r_opengl/r_opengl.c b/src/hardware/r_opengl/r_opengl.c index ddd5807a5..5115da60d 100644 --- a/src/hardware/r_opengl/r_opengl.c +++ b/src/hardware/r_opengl/r_opengl.c @@ -2307,22 +2307,22 @@ EXPORT void HWRAPI(DoScreenWipe)(float alpha) // Bottom left pglMultiTexCoord2f(GL_TEXTURE0, 0.0f, 0.0f); - pglMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0.0f); + pglMultiTexCoord2f(GL_TEXTURE1, 0.0f, 1.0f); pglVertex3f(-1.0f, -1.0f, 1.0f); // Top left pglMultiTexCoord2f(GL_TEXTURE0, 0.0f, yfix); - pglMultiTexCoord2f(GL_TEXTURE1, 0.0f, 1.0f); + pglMultiTexCoord2f(GL_TEXTURE1, 0.0f, 0.0f); pglVertex3f(-1.0f, 1.0f, 1.0f); // Top right pglMultiTexCoord2f(GL_TEXTURE0, xfix, yfix); - pglMultiTexCoord2f(GL_TEXTURE1, 1.0f, 1.0f); + pglMultiTexCoord2f(GL_TEXTURE1, 1.0f, 0.0f); pglVertex3f(1.0f, 1.0f, 1.0f); // Bottom right pglMultiTexCoord2f(GL_TEXTURE0, xfix, 0.0f); - pglMultiTexCoord2f(GL_TEXTURE1, 1.0f, 0.0f); + pglMultiTexCoord2f(GL_TEXTURE1, 1.0f, 1.0f); pglVertex3f(1.0f, -1.0f, 1.0f); pglEnd();