From 9973bedd5f3711773b5b5f2e276e400893398b99 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 5 Feb 2016 16:38:33 +0000 Subject: [PATCH 01/53] Free the memory of all clipping arrays for each portal properly Not the actual fix I'm intending to make with this branch, but it's needed anyway --- src/r_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/r_main.c b/src/r_main.c index a4e72cba9..ccaa14b8e 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1360,6 +1360,9 @@ void R_RenderPlayerView(player_t *player) // okay done. free it. portalcullsector = NULL; // Just in case... portal_base = portal->next; + Z_Free(portal->ceilingclip); + Z_Free(portal->floorclip); + Z_Free(portal->frontscale); Z_Free(portal); } // END PORTAL RENDERING From 166fafd71708553539c753783b924496387ba4d0 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 6 Feb 2016 18:57:26 +0000 Subject: [PATCH 02/53] Fixed div-by-zero crash relating to portals, drawsegs and midtextures Had to remove Red's scale hack in order to do so, because it utterly fails when the drawseg doesn't actually belong to the portal in the first place. --- src/r_bsp.c | 4 +++- src/r_bsp.h | 1 + src/r_defs.h | 2 ++ src/r_main.c | 11 +---------- src/r_segs.c | 5 +++++ src/r_things.c | 3 +++ 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index c87d8baa7..52be9a0e3 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -26,6 +26,7 @@ side_t *sidedef; line_t *linedef; sector_t *frontsector; sector_t *backsector; +boolean portalline; // is curline a portal seg? // very ugly realloc() of drawsegs at run-time, I upped it to 512 // instead of 256.. and someone managed to send me a level with @@ -378,6 +379,7 @@ static void R_AddLine(seg_t *line) return; curline = line; + portalline = false; // OPTIMIZE: quickly reject orthogonal back sides. angle1 = R_PointToAngle(line->v1->x, line->v1->y); @@ -431,7 +433,7 @@ static void R_AddLine(seg_t *line) backsector = line->backsector; // Portal line - if (line->linedef->special == 40 && P_PointOnLineSide(viewx, viewy, line->linedef) == 0) + if (line->linedef->special == 40 && line->side == 0) { if (portalrender < cv_maxportals.value) { diff --git a/src/r_bsp.h b/src/r_bsp.h index 14b11ea77..3d0429fec 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -23,6 +23,7 @@ extern side_t *sidedef; extern line_t *linedef; extern sector_t *frontsector; extern sector_t *backsector; +extern boolean portalline; // is curline a portal seg? // drawsegs are allocated on the fly... see r_segs.c diff --git a/src/r_defs.h b/src/r_defs.h index f18410fe8..a982a598b 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -675,6 +675,8 @@ typedef struct drawseg_s INT32 numthicksides; fixed_t frontscale[MAXVIDWIDTH]; + UINT8 portalpass; // if > 0 and == portalrender, do not clip sprites + #ifdef ESLOPE fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures diff --git a/src/r_main.c b/src/r_main.c index ccaa14b8e..a6b13302e 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -91,7 +91,6 @@ typedef struct portal_pair INT16 *ceilingclip; INT16 *floorclip; fixed_t *frontscale; - size_t seg; } portal_pair; portal_pair *portal_base, *portal_cap; line_t *portalclipline; @@ -1230,7 +1229,7 @@ void R_AddPortal(INT32 line1, INT32 line2, INT32 x1, INT32 x2) portal->start = x1; portal->end = x2; - portal->seg = ds_p-drawsegs; + portalline = true; // this tells R_StoreWallRange that curline is a portal seg portal->viewx = viewx; portal->viewy = viewy; @@ -1344,14 +1343,6 @@ void R_RenderPlayerView(player_t *player) validcount++; - if (portal->seg) - { - // Push the portal's old drawseg out of the way so it isn't interfering with sprite clipping. -Red - drawseg_t *seg = drawsegs+portal->seg; - seg->scale1 = 0; - seg->scale2 = 0; - } - R_RenderBSPNode((INT32)numnodes - 1); R_ClipSprites(); //R_DrawPlanes(); diff --git a/src/r_segs.c b/src/r_segs.c index 04873b29c..0106a1bac 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2887,6 +2887,11 @@ void R_StoreWallRange(INT32 start, INT32 stop) R_RenderSegLoop(); colfunc = wallcolfunc; + if (portalline) // if curline is a portal, set portalrender for drawseg + ds_p->portalpass = portalrender+1; + else + ds_p->portalpass = 0; + // save sprite clipping info if (((ds_p->silhouette & SIL_TOP) || maskedtexture) && !ds_p->sprtopclip) { diff --git a/src/r_things.c b/src/r_things.c index 2a3f8e771..667a26e0f 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2058,6 +2058,9 @@ void R_ClipSprites(void) continue; } + if (ds->portalpass > 0 && ds->portalpass == portalrender) + continue; // is a portal + r1 = ds->x1 < spr->x1 ? spr->x1 : ds->x1; r2 = ds->x2 > spr->x2 ? spr->x2 : ds->x2; From ae2b1e8ea1ba860107d036e316011f0427ec329d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 6 Feb 2016 21:06:52 +0000 Subject: [PATCH 03/53] Use <= instead of ==, so that sprites for second-tier portals and beyond still display thx Red for spotting this --- src/r_defs.h | 2 +- src/r_things.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/r_defs.h b/src/r_defs.h index a982a598b..107b8a83f 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -675,7 +675,7 @@ typedef struct drawseg_s INT32 numthicksides; fixed_t frontscale[MAXVIDWIDTH]; - UINT8 portalpass; // if > 0 and == portalrender, do not clip sprites + UINT8 portalpass; // if > 0 and <= portalrender, do not affect sprite clipping #ifdef ESLOPE fixed_t maskedtextureheight[MAXVIDWIDTH]; // For handling sloped midtextures diff --git a/src/r_things.c b/src/r_things.c index 667a26e0f..3767b02be 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -2058,7 +2058,7 @@ void R_ClipSprites(void) continue; } - if (ds->portalpass > 0 && ds->portalpass == portalrender) + if (ds->portalpass > 0 && ds->portalpass <= portalrender) continue; // is a portal r1 = ds->x1 < spr->x1 ? spr->x1 : ds->x1; From dabc4415af553ec8a1bc14e381635e7d9879d279 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 13 Feb 2016 18:11:50 +0000 Subject: [PATCH 04/53] Fix crash caused by drawing scaled, mirrored sprites semi-covered on the left side by portal edge I suspect this crash was possible even outside the context of portals, but whatever --- src/r_things.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/r_things.c b/src/r_things.c index 3767b02be..87879a415 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -839,10 +839,10 @@ static void R_DrawVisSprite(vissprite_t *vis) dc_texturemid = FixedDiv(dc_texturemid,this_scale); //Oh lordy, mercy me. Don't freak out if sprites go offscreen! - if (vis->xiscale > 0) + /*if (vis->xiscale > 0) frac = FixedDiv(frac, this_scale); else if (vis->x1 <= 0) - frac = (vis->x1 - vis->x2) * vis->xiscale; + frac = (vis->x1 - vis->x2) * vis->xiscale;*/ sprtopscreen = centeryfrac - FixedMul(dc_texturemid, spryscale); //dc_hires = 1; @@ -1306,7 +1306,7 @@ static void R_ProjectSprite(mobj_t *thing) } if (vis->x1 > x1) - vis->startfrac += vis->xiscale*(vis->x1-x1); + vis->startfrac += FixedDiv(vis->xiscale, this_scale)*(vis->x1-x1); //Fab: lumppat is the lump number of the patch to use, this is different // than lumpid for sprites-in-pwad : the graphics are patched From 4b447b3d0db33c92ca1e542cc6a955af3dec45ea Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 28 Feb 2016 18:30:29 +0000 Subject: [PATCH 05/53] Don't add polyobjects to a mobj's sector nodes list. This causes the player to teeter whenever they are above the polyobject's bottom, whether or not it is solid Also, a minor tweak for the teetering code itself, though it looks a right mess and probably should be redone in the future --- src/p_map.c | 6 ++++++ src/p_user.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 61d57dcd1..760252c8b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -3712,6 +3712,9 @@ static inline boolean PIT_GetSectors(line_t *ld) if (P_BoxOnLineSide(tmbbox, ld) != -1) return true; + if (ld->polyobj) // line belongs to a polyobject, don't add it + return true; + // This line crosses through the object. // Collect the sector(s) from the line and add to the @@ -3744,6 +3747,9 @@ static inline boolean PIT_GetPrecipSectors(line_t *ld) if (P_BoxOnLineSide(preciptmbbox, ld) != -1) return true; + if (ld->polyobj) // line belongs to a polyobject, don't add it + return true; + // This line crosses through the object. // Collect the sector(s) from the line and add to the diff --git a/src/p_user.c b/src/p_user.c index da65b7cb4..b3ba5f61f 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3087,7 +3087,7 @@ static void P_DoTeeter(player_t *player) } if (polybottom > player->mo->z + player->mo->height + tiptop - || (polybottom < player->mo->z + || (polytop < player->mo->z && player->mo->z + player->mo->height < player->mo->ceilingz - tiptop)) teeter = true; else @@ -3105,7 +3105,7 @@ static void P_DoTeeter(player_t *player) } if (polytop < player->mo->z - tiptop - || (polytop > player->mo->z + player->mo->height + || (polybottom > player->mo->z + player->mo->height && player->mo->z > player->mo->floorz + tiptop)) teeter = true; else From 668cc85d7b3f828ef723289939ac134b57ce191d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 2 Mar 2016 20:31:04 +0000 Subject: [PATCH 06/53] P_ClosestPointOnLine can now (optionally) take custom coordinates that you want to make up your line --- src/lua_baselib.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 5e2d31b10..be06982f3 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -140,14 +140,38 @@ static int lib_pAproxDistance(lua_State *L) static int lib_pClosestPointOnLine(lua_State *L) { + int n = lua_gettop(L); fixed_t x = luaL_checkfixed(L, 1); fixed_t y = luaL_checkfixed(L, 2); - line_t *line = *((line_t **)luaL_checkudata(L, 3, META_LINE)); vertex_t result; //HUDSAFE - if (!line) - return LUA_ErrInvalid(L, "line_t"); - P_ClosestPointOnLine(x, y, line, &result); + if (lua_isuserdata(L, 3)) // use a real linedef to get our points + { + line_t *line = *((line_t **)luaL_checkudata(L, 3, META_LINE)); + if (!line) + return LUA_ErrInvalid(L, "line_t"); + P_ClosestPointOnLine(x, y, line, &result); + } + else // use custom coordinates of our own! + { + vertex_t v1, v2; // fake vertexes + line_t junk; // fake linedef + + if (n < 6) + return luaL_error(L, "arguments 3 to 6 not all given (expected 4 fixed-point integers)"); + + v1.x = luaL_checkfixed(L, 3); + v1.y = luaL_checkfixed(L, 4); + v2.x = luaL_checkfixed(L, 5); + v2.y = luaL_checkfixed(L, 6); + + junk.v1 = &v1; + junk.v2 = &v2; + junk.dx = v2.x - v1.x; + junk.dy = v2.y - v1.y; + P_ClosestPointOnLine(x, y, &junk, &result); + } + lua_pushfixed(L, result.x); lua_pushfixed(L, result.y); return 2; From 4ab2c336e7e19c73a1a287802dc0e1f0969a55b8 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 6 Mar 2016 19:32:07 +0000 Subject: [PATCH 07/53] Possibly fixed the issues with LibGME mentioned in issue #14. Not even the HAVE_LIBGME macro was defined apparently, huh. --- cmake/Modules/FindGME.cmake | 8 ++++---- src/CMakeLists.txt | 1 + src/sdl/CMakeLists.txt | 3 +++ 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cmake/Modules/FindGME.cmake b/cmake/Modules/FindGME.cmake index 3b0c68de7..ea80af454 100644 --- a/cmake/Modules/FindGME.cmake +++ b/cmake/Modules/FindGME.cmake @@ -6,16 +6,16 @@ find_path(GME_INCLUDE_DIR NAMES gme.h PATHS ${GME_PKGCONF_INCLUDE_DIRS} - /usr/include/gme - /usr/local/include/gme + "/usr/include/gme" + "/usr/local/include/gme" ) find_library(GME_LIBRARY NAMES gme PATHS ${GME_PKGCONF_LIBRARY_DIRS} - /usr/lib - /usr/local/lib + "/usr/lib" + "/usr/local/lib" ) set(GME_PROCESS_INCLUDES GME_INCLUDE_DIR) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index d9e25dbb8..6ec8f2d71 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -314,6 +314,7 @@ if(${SRB2_CONFIG_HAVE_GME}) find_package(GME) if(${GME_FOUND}) set(SRB2_HAVE_GME ON) + add_definitions(-DHAVE_LIBGME) else() message(WARNING "You have specified that GME is available but it was not found.") endif() diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index b3d734521..7190efaac 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -122,6 +122,7 @@ if(${SDL2_FOUND}) add_framework(SDL2 SRB2SDL2) add_framework(SDL2_mixer SRB2SDL2) target_link_libraries(SRB2SDL2 PRIVATE + ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -131,6 +132,7 @@ if(${SDL2_FOUND}) target_link_libraries(SRB2SDL2 PRIVATE ${SDL2_LIBRARIES} ${SDL2_MIXER_LIBRARIES} + ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} ${OPENGL_LIBRARIES} @@ -198,6 +200,7 @@ if(${SDL2_FOUND}) target_include_directories(SRB2SDL2 PRIVATE ${SDL2_INCLUDE_DIRS} ${SDL2_MIXER_INCLUDE_DIRS} + ${GME_INCLUDE_DIRS} ${PNG_INCLUDE_DIRS} ${ZLIB_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} From eab51414f348470edfb7b84e2157db7d9b1af39d Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 7 Mar 2016 21:16:02 +0000 Subject: [PATCH 08/53] Fix typo in A_ChangeAngleAbsolute --- src/p_enemy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 367d5714a..ffb690822 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -7223,7 +7223,7 @@ void A_ChangeAngleAbsolute(mobj_t *actor) //const angle_t amin = FixedAngle(locvar1*FRACUNIT); //const angle_t amax = FixedAngle(locvar2*FRACUNIT); #ifdef HAVE_BLUA - if (LUA_CallAction("A_ChangeAngelAbsolute", actor)) + if (LUA_CallAction("A_ChangeAngleAbsolute", actor)) return; #endif From 54f95eb3877ce02eeab87cad1bf1ccd835990c83 Mon Sep 17 00:00:00 2001 From: JTE Date: Wed, 20 May 2015 23:54:04 -0400 Subject: [PATCH 09/53] Revert "Change angle_t handling in Lua." This partially reverts commit ef0e61fc3357fc8fb5367b522dd738edc96b2a7a. --- src/dehacked.c | 60 ++++++++++++++++++++++++------------------------ src/lua_script.h | 6 ++--- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index c21e8fb99..47c87eefc 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7267,36 +7267,36 @@ struct { {"FF_GOOWATER",FF_GOOWATER}, ///< Used with ::FF_SWIMMABLE. Makes thick bouncey goop. // Angles - {"ANG1",ANG1>>16}, - {"ANG2",ANG2>>16}, - {"ANG10",ANG10>>16}, - {"ANG15",ANG15>>16}, - {"ANG20",ANG20>>16}, - {"ANG30",ANG30>>16}, - {"ANG60",ANG60>>16}, - {"ANG64h",ANG64h>>16}, - {"ANG105",ANG105>>16}, - {"ANG210",ANG210>>16}, - {"ANG255",ANG255>>16}, - {"ANG340",ANG340>>16}, - {"ANG350",ANG350>>16}, - {"ANGLE_11hh",ANGLE_11hh>>16}, - {"ANGLE_22h",ANGLE_22h>>16}, - {"ANGLE_45",ANGLE_45>>16}, - {"ANGLE_67h",ANGLE_67h>>16}, - {"ANGLE_90",ANGLE_90>>16}, - {"ANGLE_112h",ANGLE_112h>>16}, - {"ANGLE_135",ANGLE_135>>16}, - {"ANGLE_157h",ANGLE_157h>>16}, - {"ANGLE_180",ANGLE_180>>16}, - {"ANGLE_202h",ANGLE_202h>>16}, - {"ANGLE_225",ANGLE_225>>16}, - {"ANGLE_247h",ANGLE_247h>>16}, - {"ANGLE_270",ANGLE_270>>16}, - {"ANGLE_292h",ANGLE_292h>>16}, - {"ANGLE_315",ANGLE_315>>16}, - {"ANGLE_337h",ANGLE_337h>>16}, - {"ANGLE_MAX",ANGLE_MAX>>16}, + {"ANG1",ANG1}, + {"ANG2",ANG2}, + {"ANG10",ANG10}, + {"ANG15",ANG15}, + {"ANG20",ANG20}, + {"ANG30",ANG30}, + {"ANG60",ANG60}, + {"ANG64h",ANG64h}, + {"ANG105",ANG105}, + {"ANG210",ANG210}, + {"ANG255",ANG255}, + {"ANG340",ANG340}, + {"ANG350",ANG350}, + {"ANGLE_11hh",ANGLE_11hh}, + {"ANGLE_22h",ANGLE_22h}, + {"ANGLE_45",ANGLE_45}, + {"ANGLE_67h",ANGLE_67h}, + {"ANGLE_90",ANGLE_90}, + {"ANGLE_112h",ANGLE_112h}, + {"ANGLE_135",ANGLE_135}, + {"ANGLE_157h",ANGLE_157h}, + {"ANGLE_180",ANGLE_180}, + {"ANGLE_202h",ANGLE_202h}, + {"ANGLE_225",ANGLE_225}, + {"ANGLE_247h",ANGLE_247h}, + {"ANGLE_270",ANGLE_270}, + {"ANGLE_292h",ANGLE_292h}, + {"ANGLE_315",ANGLE_315}, + {"ANGLE_337h",ANGLE_337h}, + {"ANGLE_MAX",ANGLE_MAX}, // P_Chase directions (dirtype_t) {"DI_NODIR",DI_NODIR}, diff --git a/src/lua_script.h b/src/lua_script.h index ec67703c3..b4b668ce7 100644 --- a/src/lua_script.h +++ b/src/lua_script.h @@ -30,9 +30,9 @@ #define lua_pushfixed(L, f) lua_pushinteger(L, f) // angle_t casting -// we reduce the angle to a fixed point between 0.0 and 1.0 -#define luaL_checkangle(L, i) (((angle_t)(luaL_checkfixed(L, i)&0xFFFF))<<16) -#define lua_pushangle(L, a) lua_pushfixed(L, a>>16) +// TODO deal with signedness +#define luaL_checkangle(L, i) ((angle_t)luaL_checkinteger(L, i)) +#define lua_pushangle(L, a) lua_pushinteger(L, a) #ifdef _DEBUG void LUA_ClearExtVars(void); From 83e9eb6df4a0e75b3dbc958d4d0f482a7059e314 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Wed, 9 Mar 2016 18:30:11 -0800 Subject: [PATCH 10/53] patch.dta officially in use. Version number updated. --- src/config.h.in | 8 ++++++++ src/d_main.c | 18 +++++++++++++----- src/doomdef.h | 12 ++++++++---- 3 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/config.h.in b/src/config.h.in index 5cd75fa5a..eef4fec13 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -15,7 +15,9 @@ #define ASSET_HASH_PLAYER_DTA "${SRB2_ASSET_player.dta_HASH}" #define ASSET_HASH_RINGS_DTA "${SRB2_ASSET_rings.dta_HASH}" #define ASSET_HASH_ZONES_DTA "${SRB2_ASSET_zones.dta_HASH}" +#ifdef USE_PATCH_DTA #define ASSET_HASH_PATCH_DTA "${SRB2_ASSET_patch.dta_HASH}" +#endif #define SRB2_COMP_REVISION "${SRB2_COMP_REVISION}" #define SRB2_COMP_BRANCH "${SRB2_COMP_BRANCH}" @@ -26,10 +28,16 @@ #else +/* Manually defined asset hashes for non-CMake builds + * Last updated 2000 / 00 / 00 + */ #define ASSET_HASH_SRB2_SRB "c1b9577687f8a795104aef4600720ea7" #define ASSET_HASH_ZONES_DTA "303838c6c534d9540288360fa49cca60" #define ASSET_HASH_PLAYER_DTA "cfca0f1c73023cbbd8f844f45480f799" #define ASSET_HASH_RINGS_DTA "85901ad4bf94637e5753d2ac2c03ea26" +#ifdef USE_PATCH_DTA +#define ASSET_HASH_PATCH_DTA "0c66790502e648bfce90fdc5bb15722e" +#endif #endif #endif diff --git a/src/d_main.c b/src/d_main.c index 3918d8118..1349a64e4 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -841,8 +841,10 @@ static void IdentifyVersion(void) // Add the weapons D_AddFile(va(pandf,srb2waddir,"rings.dta")); +#ifdef USE_PATCH_DTA // Add our crappy patches to fix our bugs - // D_AddFile(va(pandf,srb2waddir,"patch.dta")); + D_AddFile(va(pandf,srb2waddir,"patch.dta")); +#endif #if !defined (HAVE_SDL) || defined (HAVE_MIXER) { @@ -1133,12 +1135,18 @@ void D_SRB2Main(void) W_VerifyFileMD5(1, ASSET_HASH_ZONES_DTA); // zones.dta W_VerifyFileMD5(2, ASSET_HASH_PLAYER_DTA); // player.dta W_VerifyFileMD5(3, ASSET_HASH_RINGS_DTA); // rings.dta - //W_VerifyFileMD5(4, "0c66790502e648bfce90fdc5bb15722e"); // patch.dta - // don't check music.dta because people like to modify it, and it doesn't matter if they do - // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. +#ifdef USE_PATCH_DTA + W_VerifyFileMD5(4, ASSET_HASH_PATCH_DTA); // patch.dta #endif - mainwads = 4; // there are 5 wads not to unload + // don't check music.dta because people like to modify it, and it doesn't matter if they do + // ...except it does if they slip maps in there, and that's what W_VerifyNMUSlumps is for. +#endif //ifndef DEVELOP + + mainwads = 4; // there are 4 wads not to unload +#ifdef USE_PATCH_DTA + ++mainwads; // patch.dta adds one more +#endif cht_Init(); diff --git a/src/doomdef.h b/src/doomdef.h index a44fe4779..c3a0bfa6e 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -148,13 +148,17 @@ extern FILE *logstream; // we use comprevision and compbranch instead. #else #define VERSION 201 // Game version -#define SUBVERSION 14 // more precise version number -#define VERSIONSTRING "v2.1.14" -#define VERSIONSTRINGW L"v2.1.14" +#define SUBVERSION 15 // more precise version number +#define VERSIONSTRING "v2.1.15" +#define VERSIONSTRINGW L"v2.1.15" // Hey! If you change this, add 1 to the MODVERSION below! // Otherwise we can't force updates! #endif +// Does this version require an added patch file? +// Comment or uncomment this as necessary. +#define USE_PATCH_DTA + // Modification options // If you want to take advantage of the Master Server's ability to force clients to update // to the latest version, fill these out. Otherwise, just comment out UPDATE_ALERT and leave @@ -208,7 +212,7 @@ extern FILE *logstream; // it's only for detection of the version the player is using so the MS can alert them of an update. // Only set it higher, not lower, obviously. // Note that we use this to help keep internal testing in check; this is why v2.1.0 is not version "1". -#define MODVERSION 19 +#define MODVERSION 20 // ========================================================================= From 5b89164cf7e4ada2ac999ed41d163059c2a1ec76 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 10 Mar 2016 20:50:54 +0000 Subject: [PATCH 11/53] Fix camera going nuts around intangible polyobjects --- src/p_map.c | 2 +- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 61d57dcd1..5c5d9cdfd 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1616,7 +1616,7 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) po->validcount = validcount; - if (!P_PointInsidePolyobj(po, x, y)) + if (!P_PointInsidePolyobj(po, x, y) || !(po->flags & POF_SOLID)) { plink = (polymaplink_t *)(plink->link.next); continue; diff --git a/src/p_user.c b/src/p_user.c index 03b2c1dd8..c08eea5c6 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8163,7 +8163,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall po->validcount = validcount; - if (!P_PointInsidePolyobj(po, x, y)) + if (!P_PointInsidePolyobj(po, x, y) || !(po->flags & POF_SOLID)) { plink = (polymaplink_t *)(plink->link.next); continue; From 509516f59f2711856c0edbbacbf6f3fa11de8b36 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Thu, 10 Mar 2016 16:38:06 -0500 Subject: [PATCH 12/53] travis: enable apt and ccache cache --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c652584f8..5815e711f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,6 +10,8 @@ compiler: - clang cache: + apt: true + ccache: true directories: - $HOME/srb2_cache From f9949a3026a7ac965c036a2e7c12bbc9f5627a4b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 12:24:51 -0400 Subject: [PATCH 13/53] dropping NOVERSION, you will not build SRB2 without a SCM --- src/Makefile | 5 ----- 1 file changed, 5 deletions(-) diff --git a/src/Makefile b/src/Makefile index d4cc64a4b..8520d8d5e 100644 --- a/src/Makefile +++ b/src/Makefile @@ -262,9 +262,7 @@ else OBJS+=$(OBJDIR)/hw3sound.o endif -ifndef NOVERSION OPTS += -DCOMPVERSION -endif ifndef NONX86 ifndef GCC29 @@ -550,9 +548,6 @@ cleandep: $(REMOVE) comptime.h pre-build: -ifdef NOVERSION - -@touch comptime.c -else ifdef WINDOWSHELL -..\comptime.bat . else From f5b56f2a076e89a59ad6fdcdb6e4c2e26f02c3e1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 12:28:22 -0400 Subject: [PATCH 14/53] fixup --- src/Makefile | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 8520d8d5e..701cdcfb1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -553,7 +553,6 @@ ifdef WINDOWSHELL else -@../comptime.sh . endif -endif clean: $(REMOVE) *~ *.flc From 2ecdd9e6f9ea891c7cead7f3331b1b626df2681b Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 14 Jan 2016 04:31:48 -0800 Subject: [PATCH 15/53] Branch and revision information in builds Also makes comptime.bat work with git if able. Development builds will now show the branch and the SHA1 hash of the revision. Also been tested to work with subversion, where it displays "Subversion r####". You know, just in case. --- comptime.bat | 28 ++++++++++++++++++++++++---- comptime.sh | 10 +++++++--- src/comptime.c | 2 ++ src/d_netcmd.c | 4 ++++ src/doomdef.h | 7 +++++-- src/m_menu.c | 9 ++++++--- src/m_misc.c | 10 ++++------ 7 files changed, 52 insertions(+), 18 deletions(-) diff --git a/comptime.bat b/comptime.bat index 23ee7ea55..b8450ff64 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,10 +1,30 @@ @ECHO OFF -set REV=Unknown +set BRA=Unknown +set REV=illegal + copy nul: /b +%1\comptime.c tmp.$$$ > nul move tmp.$$$ %1\comptime.c > nul -SET REV=illegal -FOR /F "usebackq" %%s IN (`svnversion %1`) DO @SET REV=%%s + +if exist .git goto gitrev +if exist .svn goto svnrev +goto filwri + +:gitrev +set GIT=%2 +if "%GIT%"=="" set GIT=git +FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s +FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s +set REV=%REV:~0,8% +goto filwri + +:svnrev +set BRA=Subversion +FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +goto filwri + +:filwri ECHO // Do not edit! This file was autogenerated > %1\comptime.h ECHO // by the %0 batch file >> %1\comptime.h ECHO // >> %1\comptime.h -ECHO const char* comprevision = "r%REV%"; >> %1\comptime.h +ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h +ECHO const char* comprevision = "%REV%"; >> %1\comptime.h diff --git a/comptime.sh b/comptime.sh index 703bb2d35..71c5f08aa 100755 --- a/comptime.sh +++ b/comptime.sh @@ -5,13 +5,15 @@ if [ x"$1" != x ]; then fi versiongit() { - gitversion=`git describe` + gitbranch=`git rev-parse --abbrev-ref HEAD` + gitversion=`git rev-parse HEAD` cat < $path/comptime.h // Do not edit! This file was autogenerated -// by the $0 script with git svn +// by the $0 script with git // -const char* comprevision = "$gitversion"; +const char* compbranch = "$gitbranch"; +const char* comprevision = "${gitversion:0:8}"; EOF exit 0 } @@ -23,6 +25,7 @@ versionsvn() { // Do not edit! This file was autogenerated // by the $0 script with subversion // +const char* compbranch = "Subversion"; const char* comprevision = "r$svnrevision"; EOF exit 0 @@ -34,6 +37,7 @@ versionfake() { // Do not edit! This file was autogenerated // by the $0 script with an unknown or nonexist SCM // +const char* compbranch = "Unknown"; const char* comprevision = "illegal"; EOF } diff --git a/src/comptime.c b/src/comptime.c index a4dc5b0f9..9f1fe2f71 100644 --- a/src/comptime.c +++ b/src/comptime.c @@ -9,12 +9,14 @@ #if (defined(CMAKECONFIG)) #include "config.h" +const char *compbranch = ""; // hell if I know what to do with cmake const char *comprevision = SRB2_COMP_REVISION; #elif (defined(COMPVERSION)) #include "comptime.h" #else +const char *compbranch = "Unknown"; const char *comprevision = "illegal"; #endif diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 266161c7c..30208422f 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -3179,7 +3179,11 @@ static void Command_ListWADS_f(void) */ static void Command_Version_f(void) { +#ifdef DEVELOP + CONS_Printf("Sonic Robo Blast 2 %s-%s (%s %s)\n", compbranch, comprevision, compdate, comptime); +#else CONS_Printf("Sonic Robo Blast 2 %s (%s %s %s)\n", VERSIONSTRING, compdate, comptime, comprevision); +#endif } #ifdef UPDATE_ALERT diff --git a/src/doomdef.h b/src/doomdef.h index e4b426ebc..fe7fad8ae 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -141,7 +141,10 @@ extern FILE *logstream; #if 0 #define VERSION 0 // Game version #define SUBVERSION 0 // more precise version number -#define VERSIONSTRING "Trunk" +#define VERSIONSTRING "Development EXE" +#define VERSIONSTRINGW L"Development EXE" +// most interface strings are ignored in development mode. +// we use comprevision and compbranch instead. #else #define VERSION 201 // Game version #define SUBVERSION 14 // more precise version number @@ -413,7 +416,7 @@ INT32 I_GetKey(void); #endif // Compile date and time and revision. -extern const char *compdate, *comptime, *comprevision; +extern const char *compdate, *comptime, *comprevision, *compbranch; // Disabled code and code under testing // None of these that are disabled in the normal build are guaranteed to work perfectly diff --git a/src/m_menu.c b/src/m_menu.c index 1e7745535..780de7ad5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -2463,11 +2463,14 @@ void M_Drawer(void) V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, customversionstring); } else -#if VERSION > 0 || SUBVERSION > 0 + { +#ifdef DEVELOP // Development -- show revision / branch info + V_DrawThinString(vid.dupx, vid.height - 17*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, compbranch); + V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, comprevision); +#else // Regular build V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s", VERSIONSTRING)); -#else // Trunk build, show revision info - V_DrawThinString(vid.dupx, vid.height - 9*vid.dupy, V_NOSCALESTART|V_TRANSLUCENT|V_ALLOWLOWERCASE, va("%s (%s)", VERSIONSTRING, comprevision)); #endif + } } } diff --git a/src/m_misc.c b/src/m_misc.c index 21728792f..22effdddf 100644 --- a/src/m_misc.c +++ b/src/m_misc.c @@ -1800,16 +1800,14 @@ UINT8 M_HighestBit(UINT32 num) const char *GetRevisionString(void) { - INT32 vinfo; - static char rev[8] = {0}; + static char rev[9] = {0}; if (rev[0]) return rev; - vinfo = atoi(&comprevision[1]); - if (vinfo) - snprintf(rev, 7, "r%d", vinfo); + if (comprevision[0] == 'r') + strncpy(rev, comprevision, 7); else - strcpy(rev, "rNULL"); + snprintf(rev, 7, "r%s", comprevision); rev[7] = '\0'; return rev; From 7e174290d7e2ade1a3dde14a77e9ab6e6a48bec0 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 14 Jan 2016 04:36:27 -0800 Subject: [PATCH 16/53] SVN needs the revision prefixed with 'r' --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index b8450ff64..119b3bb5c 100644 --- a/comptime.bat +++ b/comptime.bat @@ -20,6 +20,7 @@ goto filwri :svnrev set BRA=Subversion FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +set REV=r%REV% goto filwri :filwri From 2f21c24d7703732a3e9a209991240d3850300484 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Sat, 16 Jan 2016 11:35:34 -0800 Subject: [PATCH 17/53] Makefile can run comptime.bat from src\ too --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 119b3bb5c..9e127f001 100644 --- a/comptime.bat +++ b/comptime.bat @@ -6,6 +6,7 @@ copy nul: /b +%1\comptime.c tmp.$$$ > nul move tmp.$$$ %1\comptime.c > nul if exist .git goto gitrev +if exist ..\.git goto gitrev if exist .svn goto svnrev goto filwri From 873fa10fe192ffc4a545b4fa129153f13ca311c4 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 17:47:02 -0400 Subject: [PATCH 18/53] comptime.bat: Windows 8.1 sucks --- comptime.bat | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/comptime.bat b/comptime.bat index 9e127f001..9028e2888 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,4 +1,3 @@ -@ECHO OFF set BRA=Unknown set REV=illegal @@ -13,20 +12,20 @@ goto filwri :gitrev set GIT=%2 if "%GIT%"=="" set GIT=git -FOR /F "usebackq" %%s IN (`%GIT% rev-parse --abbrev-ref HEAD`) DO @SET BRA=%%s -FOR /F "usebackq" %%s IN (`%GIT% rev-parse HEAD`) DO @SET REV=%%s +for /f "usebackq" %%s in (`%GIT% rev-parse --abbrev-ref HEAD`) do @set BRA=%%s +for /f "usebackq" %%s in (`%GIT% rev-parse HEAD`) do @set REV=%%s set REV=%REV:~0,8% goto filwri :svnrev set BRA=Subversion -FOR /F "usebackq" %%s IN (`svnversion .`) DO @SET REV=%%s +for /f "usebackq" %%s in (`svnversion .`) do @set REV=%%s set REV=r%REV% goto filwri :filwri -ECHO // Do not edit! This file was autogenerated > %1\comptime.h -ECHO // by the %0 batch file >> %1\comptime.h -ECHO // >> %1\comptime.h -ECHO const char* compbranch = "%BRA%"; >> %1\comptime.h -ECHO const char* comprevision = "%REV%"; >> %1\comptime.h +echo // Do not edit! This file was autogenerated > %1\comptime.h +echo // by the %0 batch file >> %1\comptime.h +echo // >> %1\comptime.h +echo const char* compbranch = "%BRA%"; >> %1\comptime.h +echo const char* comprevision = "%REV%"; >> %1\comptime.h From bbe93a6d31d9d9f7ac1c77c60800e9c2f2f5d810 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 14 Mar 2016 20:36:37 -0500 Subject: [PATCH 19/53] comptime.bat: Put @echo off back in --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e2888..0c7ea06d6 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,3 +1,4 @@ +@echo off set BRA=Unknown set REV=illegal From c4e54d52e704ae16835237b039253c3428295547 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 14 Mar 2016 21:54:53 -0400 Subject: [PATCH 20/53] comptime.bat: restore echo off --- comptime.bat | 1 + 1 file changed, 1 insertion(+) diff --git a/comptime.bat b/comptime.bat index 9028e2888..0c7ea06d6 100644 --- a/comptime.bat +++ b/comptime.bat @@ -1,3 +1,4 @@ +@echo off set BRA=Unknown set REV=illegal From 5dd0e533b37e980c273901d137f17061c70ec6dd Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 15 Mar 2016 21:18:25 +0000 Subject: [PATCH 21/53] Removed unused "supdate" variable --- src/d_main.c | 2 -- src/d_main.h | 1 - 2 files changed, 3 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index a959a8632..0a3fae3b5 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -509,7 +509,6 @@ static void D_Display(void) // ========================================================================= tic_t rendergametic; -boolean supdate; void D_SRB2Loop(void) { @@ -600,7 +599,6 @@ void D_SRB2Loop(void) // Update display, next frame, with current state. D_Display(); - supdate = false; if (moviemode) M_SaveFrame(); diff --git a/src/d_main.h b/src/d_main.h index 800b61f53..c5ce19ef4 100644 --- a/src/d_main.h +++ b/src/d_main.h @@ -17,7 +17,6 @@ #include "d_event.h" #include "w_wad.h" // for MAX_WADFILES -extern boolean supdate; extern boolean advancedemo; // make sure not to write back the config until it's been correctly loaded From 76d71bda926d11eb1315bf1e0fe36fa39d87ec59 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 25 Mar 2016 19:43:17 +0000 Subject: [PATCH 22/53] destend now scales the added-on patch width properly if needed --- src/v_video.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/v_video.c b/src/v_video.c index df81ac6d6..3eb71bb06 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -477,7 +477,16 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t } deststart = desttop; - destend = desttop + SHORT(patch->width) * dupx; + if (pscale != FRACUNIT) // scale width properly + { + fixed_t pwidth = SHORT(patch->width)<>= FRACBITS; + destend = desttop + pwidth; + } + else + destend = desttop + SHORT(patch->width) * dupx; for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++x, desttop++) { From 3698c2583d36a0d302e2b005cea221d838ad80af Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 25 Mar 2016 20:04:49 +0000 Subject: [PATCH 23/53] wrap prevention code now takes flipped patches into account --- src/v_video.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/src/v_video.c b/src/v_video.c index 3eb71bb06..b9bdb271f 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -336,6 +336,8 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t const column_t *column; UINT8 *desttop, *dest, *deststart, *destend; const UINT8 *source, *deststop; + fixed_t pwidth; // patch width + fixed_t offx = 0; // x offset if (rendermode == render_none) return; @@ -476,25 +478,36 @@ void V_DrawFixedPatch(fixed_t x, fixed_t y, fixed_t pscale, INT32 scrn, patch_t } } - deststart = desttop; if (pscale != FRACUNIT) // scale width properly { - fixed_t pwidth = SHORT(patch->width)<width)<>= FRACBITS; - destend = desttop + pwidth; } else - destend = desttop + SHORT(patch->width) * dupx; + pwidth = SHORT(patch->width) * dupx; - for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++x, desttop++) + deststart = desttop; + destend = desttop + pwidth; + + for (col = 0; (col>>FRACBITS) < SHORT(patch->width); col += colfrac, ++offx, desttop++) { INT32 topdelta, prevdelta = -1; - if (x < 0) // don't draw off the left of the screen (WRAP PREVENTION) - continue; - if (x >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION) - break; + if (flip) // offx is measured from right edge instead of left + { + if (x+pwidth-offx < 0) // don't draw off the left of the screen (WRAP PREVENTION) + break; + if (x+pwidth-offx >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION) + continue; + } + else + { + if (x+offx < 0) // don't draw off the left of the screen (WRAP PREVENTION) + continue; + if (x+offx >= vid.width) // don't draw off the right of the screen (WRAP PREVENTION) + break; + } column = (const column_t *)((const UINT8 *)(patch) + LONG(patch->columnofs[col>>FRACBITS])); while (column->topdelta != 0xff) From 0953c9430b18bc8380aaf00f6871309a75c31a07 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:16:35 -0400 Subject: [PATCH 24/53] travis-ci: try osx building --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5815e711f..e58f09513 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ language: c -sudo: required -dist: trusty + +matrix: + include: + - os: linux + dist: trusty + sudo: required + - os: osx env: - CFLAGS=-Wno-absolute-value -Werror From 73dd5cd8035c368d7858ee45fe0eeb1e24166766 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:48:39 -0400 Subject: [PATCH 25/53] travis-ci: add brew packages --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index e58f09513..049d465a1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,4 +37,8 @@ before_script: - cd build - cmake .. +before_install: + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libsdl game-music-emu p7zip ; fi + script: make From 8d36a77e42c092f8108248a17ccca20f6af9110f Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:53:13 -0400 Subject: [PATCH 26/53] travis-ci: libpng, not libsdl --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 049d465a1..d70e1dc9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c +sudo: required matrix: include: - os: linux dist: trusty - sudo: required - os: osx env: @@ -39,6 +39,6 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libsdl game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libpng game-music-emu p7zip ; fi script: make From dfa41ed8782ea24485bcfa2f3d4066bc14b6d2c9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:56:05 -0400 Subject: [PATCH 27/53] travis-ci: drop libpng for osx --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index d70e1dc9a..bc5489308 100644 --- a/.travis.yml +++ b/.travis.yml @@ -39,6 +39,6 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer libpng game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi script: make From 9162e7da9d59f869bf99691a2f381f405ae0629d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 19:56:51 -0400 Subject: [PATCH 28/53] travis-ci: move dist setting to top --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bc5489308..d131a82b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,10 @@ language: c sudo: required +dist: trusty matrix: include: - os: linux - dist: trusty - os: osx env: From 23c9892fea6af16054f82d8eb3f295f590c11448 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:02:57 -0400 Subject: [PATCH 29/53] travis-ci: fixup os list --- .travis.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index d131a82b2..4ebef34a0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,10 +2,9 @@ language: c sudo: required dist: trusty -matrix: - include: - - os: linux - - os: osx +os: + - linux + - osx env: - CFLAGS=-Wno-absolute-value -Werror From 0c9081f762dd5d4cbcdcfe3871bcc599fbefc316 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:10:14 -0400 Subject: [PATCH 30/53] cmake: try to fixup mac build --- src/sdl/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 7190efaac..f44e3dee5 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -117,7 +117,7 @@ if(${SDL2_FOUND}) add_executable(SRB2SDL2 MACOSX_BUNDLE WIN32 ${SRB2_SDL2_TOTAL_SOURCES}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) - if((CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")) + if(${CMAKE_SYSTEM} MATCHES Darwin) add_framework(CoreFoundation SRB2SDL2) add_framework(SDL2 SRB2SDL2) add_framework(SDL2_mixer SRB2SDL2) @@ -227,7 +227,7 @@ if(${SDL2_FOUND}) endif() #### Installation #### - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(${CMAKE_SYSTEM} MATCHES Darwin) install(TARGETS SRB2SDL2 BUNDLE DESTINATION . ) @@ -268,7 +268,7 @@ if(${SDL2_FOUND}) # Mac bundle fixup - if (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") + if(${CMAKE_SYSTEM} MATCHES Darwin) install(CODE " include(BundleUtilities) fixup_bundle(\"${CMAKE_INSTALL_PREFIX}/Sonic Robo Blast 2.app\" From dadf8e1260a83125089f43ba2a6ddb119f2a474a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:21:56 -0400 Subject: [PATCH 31/53] cmake: remove fixed HWRENDER define --- src/doomtype.h | 1 - src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/doomtype.h b/src/doomtype.h index 8e7da6881..d833176f7 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -94,7 +94,6 @@ typedef long ssize_t; #ifdef __APPLE_CC__ #define DIRECTFULLSCREEN #define DEBUG_LOG -#define HWRENDER #define NOIPX #endif diff --git a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj index 98599fb60..c3f0d3b38 100644 --- a/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj +++ b/src/sdl/macosx/Srb2mac.xcodeproj/project.pbxproj @@ -1270,6 +1270,7 @@ HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, + HWRENDER, ); GCC_THREADSAFE_STATICS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; @@ -1392,6 +1393,7 @@ HAVE_BLUA, LUA_USE_POSIX, COMPVERSION, + HWRENDER, ); GCC_THREADSAFE_STATICS = NO; GCC_TREAT_IMPLICIT_FUNCTION_DECLARATIONS_AS_ERRORS = YES; From 2165c6806661ccdc3d854dae3e528a5e9ed339f3 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:25:52 -0400 Subject: [PATCH 32/53] travis: add -Wno-unknown-warning-option --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 4ebef34a0..c7e8b66b0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ os: - osx env: -- CFLAGS=-Wno-absolute-value -Werror +- CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror compiler: - gcc From 18f51b343b17d0ce70b271a3c6a832ab9cf9028a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:37:14 -0400 Subject: [PATCH 33/53] build: more mac fixes --- .travis.yml | 2 ++ src/md5.c | 2 +- src/string.c | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c7e8b66b0..e781c46e3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,9 @@ dist: trusty os: - linux + env: CFLAGS=-Wno-absolute-value -Werror - osx + env: CFLAGS=--Werror env: - CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror diff --git a/src/md5.c b/src/md5.c index aeaac2cde..ba89c499b 100644 --- a/src/md5.c +++ b/src/md5.c @@ -36,7 +36,7 @@ #include #else #ifndef HAVE_MEMCPY - #if !((defined (_WIN32) || defined (_WIN32_WCE)) && !defined (__CYGWIN__)) + #if !((defined (_WIN32) || defined (_WIN32_WCE)) && !defined (__CYGWIN__)) && !defined (__APPLE__) #define memcpy(d, s, n) bcopy ((s), (d), (n)) #endif #endif diff --git a/src/string.c b/src/string.c index 436757309..19540547c 100644 --- a/src/string.c +++ b/src/string.c @@ -15,6 +15,8 @@ #include #include "doomdef.h" +#if !defined (__APPLE__) + // Like the OpenBSD version, but it doesn't check for src not being a valid // C string. size_t strlcat(char *dst, const char *src, size_t siz) @@ -46,3 +48,5 @@ size_t strlcpy(char *dst, const char *src, size_t siz) dst[0] = '\0'; return strlcat(dst, src, siz); } + +#endif From fc1d71454b0c7ccdf3071a34e586ab27918c5c4d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:56:04 -0400 Subject: [PATCH 34/53] travis: fixup xml --- .travis.yml | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index e781c46e3..88d47d485 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,14 +2,11 @@ language: c sudo: required dist: trusty -os: - - linux - env: CFLAGS=-Wno-absolute-value -Werror - - osx - env: CFLAGS=--Werror - -env: -- CFLAGS=-Wno-absolute-value -Wno-unknown-warning-option -Werror +matrix: + include: + - os: linux + env: CFLAGS=Wno-absolute-value -Werror + - osx compiler: - gcc From 7122908560818ff3d36d862243983fa28c07e652 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 20:57:57 -0400 Subject: [PATCH 35/53] travis: matrix is not correct --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 88d47d485..c378e9ef8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,9 @@ language: c sudo: required dist: trusty -matrix: - include: - - os: linux - env: CFLAGS=Wno-absolute-value -Werror - - osx +os: + - linux + - osx compiler: - gcc From 9bc6ce3d85b3d353a4d14df9b78d292c65de602e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 21:43:17 -0400 Subject: [PATCH 36/53] travis: steal SDL2 dmg for Mac build --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index c378e9ef8..84bf5dea1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,5 +36,7 @@ before_script: before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi script: make From 2c4a27c7c6c2262debab568f5b0c466bf740b4c8 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:07:34 -0400 Subject: [PATCH 37/53] macosx: let fix linking to SDL frameworks --- .travis.yml | 2 +- src/sdl/CMakeLists.txt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 84bf5dea1..df89593c4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -37,6 +37,6 @@ before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip ; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/release/SDL2-2.0.4.dmg; hdiutil attach SDL2-2.0.4.dmg; sudo cp -a /Volumes/SDL2/SDL2.framework /Library/Frameworks/; fi - - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then curl -O -L https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-2.0.1.dmg; hdiutil attach SDL2_mixer-2.0.1.dmg; sudo cp -a /Volumes/SDL2_mixer/SDL2_mixer.framework /Library/Frameworks/; fi script: make diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index f44e3dee5..f57aa2c1f 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -118,10 +118,10 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) - add_framework(CoreFoundation SRB2SDL2) - add_framework(SDL2 SRB2SDL2) - add_framework(SDL2_mixer SRB2SDL2) target_link_libraries(SRB2SDL2 PRIVATE + CoreFoundation + SDL2 + SDL2_mixer ${GME_LIBRARIES} ${PNG_LIBRARIES} ${ZLIB_LIBRARIES} From 077781cc567d1b7b6bee96abbba652fea0b121da Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:11:39 -0400 Subject: [PATCH 38/53] macosx: drop CoreFoundation linking --- src/sdl/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index f57aa2c1f..26448cb69 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -119,7 +119,6 @@ if(${SDL2_FOUND}) if(${CMAKE_SYSTEM} MATCHES Darwin) target_link_libraries(SRB2SDL2 PRIVATE - CoreFoundation SDL2 SDL2_mixer ${GME_LIBRARIES} From 0f853640e219bda4a2af3406d1fdade541be88ad Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 25 Mar 2016 22:23:47 -0400 Subject: [PATCH 39/53] macosx: We need CoreFoudation for SDLMain --- src/sdl/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index 26448cb69..7f6771262 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -118,7 +118,9 @@ if(${SDL2_FOUND}) set_target_properties(SRB2SDL2 PROPERTIES OUTPUT_NAME ${SRB2_SDL2_EXE_NAME}) if(${CMAKE_SYSTEM} MATCHES Darwin) + find_library(CORE_LIB CoreFoundation) target_link_libraries(SRB2SDL2 PRIVATE + ${CORE_LIB} SDL2 SDL2_mixer ${GME_LIBRARIES} From 1108a52959780c51201c2808d8ec35ee5e204bfe Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 29 Mar 2016 22:44:16 +0100 Subject: [PATCH 40/53] Check change in ceilinglightsec for markceiling code, not floorlightsec --- src/r_segs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/r_segs.c b/src/r_segs.c index 04873b29c..2820262e0 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1922,7 +1922,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) || backsector->ceilingpic_angle != frontsector->ceilingpic_angle //SoM: 3/22/2000: Prevents bleeding. || (frontsector->heightsec != -1 && frontsector->ceilingpic != skyflatnum) - || backsector->floorlightsec != frontsector->floorlightsec + || backsector->ceilinglightsec != frontsector->ceilinglightsec //SoM: 4/3/2000: Check for colormaps || frontsector->extra_colormap != backsector->extra_colormap || (frontsector->ffloors != backsector->ffloors && frontsector->tag != backsector->tag)) From 0fe6ee533990adbd50da7abef36e54d76e9bf70d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 00:22:12 -0400 Subject: [PATCH 41/53] cleanup abs warnings --- src/b_bot.c | 2 +- src/lua_hudlib.c | 2 +- src/p_map.c | 4 ++-- src/p_user.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 3072b1d75..5e128bff1 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -49,7 +49,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) { cmd->forwardmove = sonic->player->cmd.forwardmove; - cmd->angleturn = abs((tails->angle - sonic->angle))>>16; + cmd->angleturn = (angle_t)((tails->angle - sonic->angle))>>16; if (sonic->angle < tails->angle) cmd->angleturn = -cmd->angleturn; } else if (dist > FixedMul(512*FRACUNIT, tails->scale)) diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 19390d50d..d5947489a 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -408,7 +408,7 @@ static int libd_drawPaddedNum(lua_State *L) HUDONLY x = luaL_checkinteger(L, 1); y = luaL_checkinteger(L, 2); - num = abs(luaL_checkinteger(L, 3)); + num = labs(luaL_checkinteger(L, 3)); digits = luaL_optinteger(L, 4, 2); flags = luaL_optinteger(L, 5, 0); flags &= ~V_PARAMMASK; // Don't let crashes happen. diff --git a/src/p_map.c b/src/p_map.c index 1aa8bc391..09f49423b 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2507,8 +2507,8 @@ isblocking: climbangle += (ANGLE_90 * (whichside ? -1 : 1)); - if (((!slidemo->player->climbing && abs((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) - || (slidemo->player->climbing == 1 && abs((slidemo->angle - climbline)) < ANGLE_135)) + if (((!slidemo->player->climbing && (angle_t)((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) + || (slidemo->player->climbing == 1 && (angle_t)((slidemo->angle - climbline)) < ANGLE_135)) && P_IsClimbingValid(slidemo->player, climbangle)) { slidemo->angle = climbangle; diff --git a/src/p_user.c b/src/p_user.c index ce68e2d61..34d2d4bae 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7899,9 +7899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player == &players[consoleplayer]) { if (focusangle >= localangle) - localangle += abs((focusangle - localangle))>>5; + localangle += (angle_t)((focusangle - localangle))>>5; else - localangle -= abs((focusangle - localangle))>>5; + localangle -= (angle_t)((focusangle - localangle))>>5; } } else if (P_AnalogMove(player)) // Analog From 7e07d2d77a660139244a3dea823cf4d020dc0672 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 00:23:28 -0400 Subject: [PATCH 42/53] travis-ci: reenable -Werror --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index df89593c4..c15cc6795 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,9 @@ language: c sudo: required dist: trusty +env: +- CFLAGS=-Werror + os: - linux - osx From b169529dfde93925add91bd6b4dd0486a327492d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 11:47:27 -0400 Subject: [PATCH 43/53] switich to do the angle math in signed, then run it thur abs() --- src/b_bot.c | 2 +- src/p_map.c | 4 ++-- src/p_user.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/b_bot.c b/src/b_bot.c index 5e128bff1..e9b00497e 100644 --- a/src/b_bot.c +++ b/src/b_bot.c @@ -49,7 +49,7 @@ static inline void B_BuildTailsTiccmd(mobj_t *sonic, mobj_t *tails, ticcmd_t *cm if (sonic->player->pflags & (PF_MACESPIN|PF_ITEMHANG)) { cmd->forwardmove = sonic->player->cmd.forwardmove; - cmd->angleturn = (angle_t)((tails->angle - sonic->angle))>>16; + cmd->angleturn = abs((signed)(tails->angle - sonic->angle))>>16; if (sonic->angle < tails->angle) cmd->angleturn = -cmd->angleturn; } else if (dist > FixedMul(512*FRACUNIT, tails->scale)) diff --git a/src/p_map.c b/src/p_map.c index 09f49423b..bcb3c08a9 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2507,8 +2507,8 @@ isblocking: climbangle += (ANGLE_90 * (whichside ? -1 : 1)); - if (((!slidemo->player->climbing && (angle_t)((slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) - || (slidemo->player->climbing == 1 && (angle_t)((slidemo->angle - climbline)) < ANGLE_135)) + if (((!slidemo->player->climbing && abs((signed)(slidemo->angle - ANGLE_90 - climbline)) < ANGLE_45) + || (slidemo->player->climbing == 1 && abs((signed)(slidemo->angle - climbline)) < ANGLE_135)) && P_IsClimbingValid(slidemo->player, climbangle)) { slidemo->angle = climbangle; diff --git a/src/p_user.c b/src/p_user.c index 34d2d4bae..6053ad1e5 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7899,9 +7899,9 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall if (player == &players[consoleplayer]) { if (focusangle >= localangle) - localangle += (angle_t)((focusangle - localangle))>>5; + localangle += abs((signed)(focusangle - localangle))>>5; else - localangle -= (angle_t)((focusangle - localangle))>>5; + localangle -= abs((signed)(focusangle - localangle))>>5; } } else if (P_AnalogMove(player)) // Analog From 10cc421fae6095dc6151700b9cd9006164cc0d3c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 12:58:00 -0400 Subject: [PATCH 44/53] travis: add all/extra warnings --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index c15cc6795..54c5901d0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ sudo: required dist: trusty env: -- CFLAGS=-Werror +- CFLAGS=-Wall -W -Werror os: - linux From d90536967d6cd05b1e454f45d252723909bf3d10 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 14:05:07 -0400 Subject: [PATCH 45/53] removed/remline ununsed code --- src/am_map.c | 33 -------- src/hardware/hw_main.c | 6 -- src/hardware/hw_md2.c | 185 ----------------------------------------- src/m_cheat.c | 20 ----- src/mserv.c | 27 ------ src/p_maputl.c | 15 ---- src/p_spec.c | 6 +- src/r_things.c | 5 -- src/sdl/i_video.c | 13 --- 9 files changed, 5 insertions(+), 305 deletions(-) diff --git a/src/am_map.c b/src/am_map.c index 70714facb..97b7c5164 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -30,9 +30,7 @@ static const UINT8 REDRANGE = 16; static const UINT8 GRAYS = (1*16); static const UINT8 GRAYSRANGE = 16; static const UINT8 BROWNS = (3*16); -static const UINT8 BROWNRANGE = 16; static const UINT8 YELLOWS = (7*16); -static const UINT8 YELLOWRANGE = 8; static const UINT8 GREENS = (10*16); static const UINT8 GREENRANGE = 16; static const UINT8 DBLACK = 31; @@ -41,11 +39,8 @@ static const UINT8 DWHITE = 0; static const UINT8 NOCLIMBREDS = 248; static const UINT8 NOCLIMBREDRANGE = 8; static const UINT8 NOCLIMBGRAYS = 204; -static const UINT8 NOCLIMBGRAYSRANGE = 4; static const UINT8 NOCLIMBBROWNS = (2*16); -static const UINT8 NOCLIMBBROWNRANGE = 16; static const UINT8 NOCLIMBYELLOWS = (11*16); -static const UINT8 NOCLIMBYELLOWRANGE = 8; #ifdef _NDS @@ -67,15 +62,10 @@ static const UINT8 NOCLIMBYELLOWRANGE = 8; #define TSWALLCOLORS GRAYS #define TSWALLRANGE GRAYSRANGE #define NOCLIMBTSWALLCOLORS NOCLIMBGRAYS -#define NOCLIMBTSWALLRANGE NOCLIMBGRAYSRANGE #define FDWALLCOLORS BROWNS -#define FDWALLRANGE BROWNRANGE #define NOCLIMBFDWALLCOLORS NOCLIMBBROWNS -#define NOCLIMBFDWALLRANGE NOCLIMBBROWNRANGE #define CDWALLCOLORS YELLOWS -#define CDWALLRANGE YELLOWRANGE #define NOCLIMBCDWALLCOLORS NOCLIMBYELLOWS -#define NOCLIMBCDWALLRANGE NOCLIMBYELLOWRANGE #define THINGCOLORS GREENS #define THINGRANGE GREENRANGE #define SECRETWALLCOLORS WALLCOLORS @@ -255,29 +245,6 @@ static AMDRAWFLINEFUNC AM_drawFline; static void AM_drawFline_soft(const fline_t *fl, INT32 color); -/** Calculates the slope and slope according to the x-axis of a line - * segment in map coordinates (with the upright y-axis and all) so - * that it can be used with the braindead drawing stuff. - * - * \param ml The line segment. - * \param is Holds the result. - */ -static inline void AM_getIslope(const mline_t *ml, islope_t *is) -{ - INT32 dx, dy; - - dy = ml->a.y - ml->b.y; - dx = ml->b.x - ml->a.x; - if (!dy) - is->islp = (dx < 0 ? -INT32_MAX : INT32_MAX); - else - is->islp = FixedDiv(dx, dy); - if (!dx) - is->slp = (dy < 0 ? -INT32_MAX : INT32_MAX); - else - is->slp = FixedDiv(dy, dx); -} - static void AM_activateNewScale(void) { m_x += m_w/2; diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index b0186049a..ae26b8deb 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -3404,12 +3404,6 @@ static void HWR_ClearSprites(void) gr_visspritecount = 0; } -static inline void HWR_ResetVisSpriteChunks(void) -{ - memset(gr_visspritechunks, 0, sizeof(gr_visspritechunks)); -} - - // -------------------------------------------------------------------------- // HWR_NewVisSprite // -------------------------------------------------------------------------- diff --git a/src/hardware/hw_md2.c b/src/hardware/hw_md2.c index 0745b9a00..a160be67b 100644 --- a/src/hardware/hw_md2.c +++ b/src/hardware/hw_md2.c @@ -406,191 +406,6 @@ static md2_model_t *md2_readModel(const char *filename) return model; } -/* - * center model - */ -static inline void md2_getBoundingBox (md2_model_t *model, float *minmax) -{ - size_t i; - float minx, maxx; - float miny, maxy; - float minz, maxz; - - minx = miny = minz = 999999.0f; - maxx = maxy = maxz = -999999.0f; - - /* get bounding box */ - for (i = 0; i < model->header.numVertices; i++) - { - md2_triangleVertex_t *v = &model->frames[0].vertices[i]; - - if (v->vertex[0] < minx) - minx = v->vertex[0]; - else if (v->vertex[0] > maxx) - maxx = v->vertex[0]; - - if (v->vertex[1] < miny) - miny = v->vertex[1]; - else if (v->vertex[1] > maxy) - maxy = v->vertex[1]; - - if (v->vertex[2] < minz) - minz = v->vertex[2]; - else if (v->vertex[2] > maxz) - maxz = v->vertex[2]; - } - - minmax[0] = minx; - minmax[1] = maxx; - minmax[2] = miny; - minmax[3] = maxy; - minmax[4] = minz; - minmax[5] = maxz; -} - -static inline INT32 md2_getAnimationCount(md2_model_t *model) -{ - size_t i, pos; - INT32 j = 0, count; - char name[16], last[16]; - - strcpy(last, model->frames[0].name); - pos = strlen(last) - 1; - while (last[pos] >= '0' && last[pos] <= '9' && j < 2) - { - pos--; - j++; - } - last[pos + 1] = '\0'; - - count = 0; - - for (i = 0; i <= model->header.numFrames; i++) - { - if (i == model->header.numFrames) - strcpy(name, ""); // some kind of a sentinel - else - strcpy(name, model->frames[i].name); - pos = strlen(name) - 1; - j = 0; - while (name[pos] >= '0' && name[pos] <= '9' && j < 2) - { - pos--; - j++; - } - name[pos + 1] = '\0'; - - if (strcmp(last, name)) - { - strcpy(last, name); - count++; - } - } - - return count; -} - -static inline const char * md2_getAnimationName (md2_model_t *model, INT32 animation) -{ - size_t i, pos; - INT32 j = 0, count; - static char last[32]; - char name[32]; - - strcpy(last, model->frames[0].name); - pos = strlen(last) - 1; - while (last[pos] >= '0' && last[pos] <= '9' && j < 2) - { - pos--; - j++; - } - last[pos + 1] = '\0'; - - count = 0; - - for (i = 0; i <= model->header.numFrames; i++) - { - if (i == model->header.numFrames) - strcpy(name, ""); // some kind of a sentinel - else - strcpy(name, model->frames[i].name); - pos = strlen(name) - 1; - j = 0; - while (name[pos] >= '0' && name[pos] <= '9' && j < 2) - { - pos--; - j++; - } - name[pos + 1] = '\0'; - - if (strcmp(last, name)) - { - if (count == animation) - return last; - - strcpy(last, name); - count++; - } - } - - return 0; -} - -static inline void md2_getAnimationFrames(md2_model_t *model, - INT32 animation, INT32 *startFrame, INT32 *endFrame) -{ - size_t i, pos; - INT32 j = 0, count, numFrames, frameCount; - char name[16], last[16]; - - strcpy(last, model->frames[0].name); - pos = strlen(last) - 1; - while (last[pos] >= '0' && last[pos] <= '9' && j < 2) - { - pos--; - j++; - } - last[pos + 1] = '\0'; - - count = 0; - numFrames = 0; - frameCount = 0; - - for (i = 0; i <= model->header.numFrames; i++) - { - if (i == model->header.numFrames) - strcpy(name, ""); // some kind of a sentinel - else - strcpy(name, model->frames[i].name); - pos = strlen(name) - 1; - j = 0; - while (name[pos] >= '0' && name[pos] <= '9' && j < 2) - { - pos--; - j++; - } - name[pos + 1] = '\0'; - - if (strcmp(last, name)) - { - strcpy(last, name); - - if (count == animation) - { - *startFrame = frameCount - numFrames; - *endFrame = frameCount - 1; - return; - } - - count++; - numFrames = 0; - } - frameCount++; - numFrames++; - } - *startFrame = *endFrame = 0; -} - static inline void md2_printModelInfo (md2_model_t *model) { #if 0 diff --git a/src/m_cheat.c b/src/m_cheat.c index 8cea4c6ae..c8a19666b 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -161,26 +161,6 @@ static UINT8 cht_CheckCheat(cheatseq_t *cht, char key) return rc; } -static inline void cht_GetParam(cheatseq_t *cht, char *buffer) -{ - UINT8 *p; - UINT8 c; - - p = cht->sequence; - while (*(p++) != 1) - ; - - do - { - c = *p; - *(buffer++) = c; - *(p++) = 0; - } while (c && *p != 0xff); - - if (*p == 0xff) - *buffer = 0; -} - boolean cht_Responder(event_t *ev) { UINT8 ret = 0, ch = 0; diff --git a/src/mserv.c b/src/mserv.c index 568474d73..c47d149ee 100644 --- a/src/mserv.c +++ b/src/mserv.c @@ -351,33 +351,6 @@ static INT32 GetServersList(void) } #endif -/** Get the MOTD from the master server. - */ -static inline INT32 GetMSMOTD(void) -{ - msg_t msg; - INT32 count = 0; - - msg.type = GET_MOTD_MSG; - msg.length = 0; - if (MS_Write(&msg) < 0) - return MS_WRITE_ERROR; - - while (MS_Read(&msg) >= 0) - { - if (!msg.length) - { - if (!count) - CONS_Alert(CONS_NOTICE, M_GetText("No servers currently running.\n")); - return MS_NO_ERROR; - } - count++; - CONS_Printf("%s",msg.buffer); - } - - return MS_READ_ERROR; -} - // // MS_Connect() // diff --git a/src/p_maputl.c b/src/p_maputl.c index 48dd54e8d..2aa667811 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -34,21 +34,6 @@ fixed_t P_AproxDistance(fixed_t dx, fixed_t dy) return dx + dy - (dy>>1); } -// -// P_PartialDistance -// Useful only for iterations finding the 'closest point' -// -FUNCMATH static inline fixed_t P_PartialDistance(fixed_t dx, fixed_t dy) -{ - dx >>= FRACBITS; - dy >>= FRACBITS; - - dx *= dx; - dy *= dy; - - return dx + dy; -} - // // P_ClosestPointOnLine // Finds the closest point on a given line to the supplied point diff --git a/src/p_spec.c b/src/p_spec.c index 8228c60b3..a292a8bb0 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -102,7 +102,7 @@ static void Add_Pusher(pushertype_e type, fixed_t x_mag, fixed_t y_mag, mobj_t * static void Add_MasterDisappearer(tic_t appeartime, tic_t disappeartime, tic_t offset, INT32 line, INT32 sourceline); static void P_AddBlockThinker(sector_t *sec, line_t *sourceline); static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline); -static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec); +//static void P_AddBridgeThinker(line_t *sourceline, sector_t *sec); static void P_AddFakeFloorsByLine(size_t line, ffloortype_e ffloorflags, thinkerlist_t *secthinkers); static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec); static void Add_Friction(INT32 friction, INT32 movefactor, INT32 affectee, INT32 referrer); @@ -593,6 +593,7 @@ void P_SetupLevelFlatAnims(void) // UTILITIES // +#if 0 /** Gets a side from a sector line. * * \param currentSector Sector the line is in. @@ -632,6 +633,7 @@ static inline boolean twoSided(INT32 sector, INT32 line) { return (sectors[sector].lines[line])->sidenum[1] != 0xffff; } +#endif /** Finds sector next to current. * @@ -5050,6 +5052,7 @@ static void P_AddFloatThinker(sector_t *sec, INT32 tag, line_t *sourceline) * \sa P_SpawnSpecials, T_BridgeThinker * \author SSNTails */ +/* static inline void P_AddBridgeThinker(line_t *sourceline, sector_t *sec) { levelspecthink_t *bridge; @@ -5072,6 +5075,7 @@ static inline void P_AddBridgeThinker(line_t *sourceline, sector_t *sec) bridge->vars[4] = sourceline->tag; // Start tag bridge->vars[5] = (sides[sourceline->sidenum[0]].textureoffset>>FRACBITS); // End tag } +*/ /** Adds a Mario block thinker, which changes the block's texture between blank * and ? depending on whether it has contents. diff --git a/src/r_things.c b/src/r_things.c index 9a8b1319b..c5f3c5245 100644 --- a/src/r_things.c +++ b/src/r_things.c @@ -550,11 +550,6 @@ void R_ClearSprites(void) visspritecount = clippedvissprites = 0; } -static inline void R_ResetVisSpriteChunks(void) -{ - memset(visspritechunks, 0, sizeof(visspritechunks)); -} - // // R_NewVisSprite // diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 963310a26..0f9fa58a8 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -126,8 +126,6 @@ static Uint8 BitsPerPixel = 16; #endif Uint16 realwidth = BASEVIDWIDTH; Uint16 realheight = BASEVIDHEIGHT; -static const Uint32 surfaceFlagsW = 0/*|SDL_RESIZABLE*/; -static const Uint32 surfaceFlagsF = 0; static SDL_bool mousegrabok = SDL_TRUE; #define HalfWarpMouse(x,y) SDL_WarpMouseInWindow(window, (Uint16)(x/2),(Uint16)(y/2)) static SDL_bool videoblitok = SDL_FALSE; @@ -1252,17 +1250,6 @@ static inline boolean I_SkipFrame(void) } } -static inline SDL_bool SDLmatchVideoformat(void) -{ - const SDL_PixelFormat *vidformat = vidSurface->format; - const INT32 vfBPP = vidformat?vidformat->BitsPerPixel:0; - return (((vfBPP == 8 && vid.bpp == 1 && - !vidformat->Rmask && !vidformat->Gmask && !vidformat->Bmask) || - (vfBPP == 15 && vid.bpp == 2 && vidformat->Rmask == 0x7C00 && - vidformat->Gmask == 0x03E0 && vidformat->Bmask == 0x001F )) && - !vidformat->Amask && (vidSurface->flags & SDL_RLEACCEL) == 0); -} - // // I_FinishUpdate // From 75f65c4d44d07e3b7538cafc65141b0e0c7f6016 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 20:17:09 -0400 Subject: [PATCH 46/53] using abs() on unsigned have no effect --- src/g_game.c | 2 +- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 3b7ef158f..9ea51ebab 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4336,7 +4336,7 @@ void G_GhostTicker(void) { case GHC_SUPER: // Super Sonic (P_DoSuperStuff) g->mo->color = SKINCOLOR_SUPER1; - g->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4); + g->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); diff --git a/src/p_user.c b/src/p_user.c index 45f860115..72b08db9c 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3449,7 +3449,7 @@ static void P_DoSuperStuff(player_t *player) case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; } - player->mo->color += abs( ( ( leveltime >> 1 ) % 9) - 4); + player->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) From de630d0c33ed786fe33a0e3fc5b1492812c02c2e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 30 Mar 2016 20:30:24 -0400 Subject: [PATCH 47/53] appveyor: let check warnings as well --- appveyor.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/appveyor.yml b/appveyor.yml index 4edcd7a7f..3ddec6dfb 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -11,6 +11,7 @@ environment: SDL2_MIXER_URL: https://www.libsdl.org/projects/SDL_mixer/release/SDL2_mixer-devel-2.0.1-mingw.tar.gz SDL2_MIXER_ARCHIVE: SDL2_mixer-devel-2.0.1-mingw.tar SDL2_MIXER_MOVE: SDL2_mixer-2.0.1\i686-w64-mingw32 + CFLAGS: -Wall -W -Werror cache: - SDL2-devel-2.0.4-mingw.tar.gz From 3812b6bc20c313b6eed1471f837f70485d73a0bd Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Mar 2016 06:48:08 -0700 Subject: [PATCH 48/53] the abs() is necessary; force unsigned shift and signed result --- src/g_game.c | 2 +- src/p_user.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 9ea51ebab..9578cbf8f 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -4336,7 +4336,7 @@ void G_GhostTicker(void) { case GHC_SUPER: // Super Sonic (P_DoSuperStuff) g->mo->color = SKINCOLOR_SUPER1; - g->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); + g->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); break; case GHC_INVINCIBLE: // Mario invincibility (P_CheckInvincibilityTimer) g->mo->color = (UINT8)(leveltime % MAXSKINCOLORS); diff --git a/src/p_user.c b/src/p_user.c index 72b08db9c..518321197 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3449,7 +3449,7 @@ static void P_DoSuperStuff(player_t *player) case 2: /* Knux */ player->mo->color = SKINCOLOR_KSUPER1; break; default: /* everyone */ player->mo->color = SKINCOLOR_SUPER1; break; } - player->mo->color += ( ( ( leveltime >> 1 ) % 9) - 4); + player->mo->color += abs( ( (signed)( (unsigned)leveltime >> 1 ) % 9) - 4); if ((cmd->forwardmove != 0 || cmd->sidemove != 0 || player->pflags & (PF_CARRIED|PF_ROPEHANG|PF_ITEMHANG|PF_MACESPIN)) && !(leveltime % TICRATE) && (player->mo->momx || player->mo->momy)) From 690b65b47fe996b2f325eca1846b23b13fcdcad1 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Mar 2016 06:51:04 -0700 Subject: [PATCH 49/53] "Sonic can now become Super Sonic" exists again Fixed an off-by-one array error in the process --- src/y_inter.c | 86 ++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 74 insertions(+), 12 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 104c1004d..32a722612 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -77,10 +77,14 @@ typedef union struct { - char passed1[13]; // KNUCKLES GOT - char passed2[16]; // A CHAOS EMERALD + char passed1[SKINNAMESIZE+1]; // KNUCKLES GOT / CRAWLA HONCHO + char passed2[17]; // A CHAOS EMERALD / GOT THEM ALL! + char passed3[15]; // CAN NOW BECOME + char passed4[SKINNAMESIZE+7]; // SUPER CRAWLA HONCHO INT32 passedx1; INT32 passedx2; + INT32 passedx3; + INT32 passedx4; y_bonus_t bonus; patch_t *bonuspatch; @@ -250,19 +254,62 @@ void Y_IntermissionDrawer(void) } else if (intertype == int_spec) { - // draw the header -/* if (endtic != -1 && ALL7EMERALDS(emeralds) && data.spec.nowsuper != NULL) - V_DrawScaledPatch(48, 32, 0, data.spec.nowsuper); - else - V_DrawScaledPatch(data.spec.headx, 26, 0, data.spec.cemerald); */ + static tic_t animatetic = 0; + INT32 ttheight = 16; + INT32 xoffset1 = 0; // Line 1 x offset + INT32 xoffset2 = 0; // Line 2 x offset + INT32 xoffset3 = 0; // Line 3 x offset + UINT8 drawsection = 0; - if (data.spec.passed1[0] != '\0') + // draw the header + if (intertic <= TICRATE) + animatetic = 0; + else if (!animatetic && data.spec.bonus.points == 0 && data.spec.passed3[0] != '\0') + animatetic = intertic; + + if (animatetic) { - V_DrawLevelTitle(data.spec.passedx1, 24, 0, data.spec.passed1); - V_DrawLevelTitle(data.spec.passedx2, 24+V_LevelNameHeight(data.spec.passed2)+2, 0, data.spec.passed2); + INT32 animatetimer = (intertic - animatetic); + if (animatetimer <= 8) + { + xoffset1 = -(animatetimer * 40); + xoffset2 = -((animatetimer-2) * 40); + if (xoffset2 > 0) xoffset2 = 0; + } + else if (animatetimer <= 19) + { + drawsection = 1; + xoffset1 = (16-animatetimer) * 40; + xoffset2 = (18-animatetimer) * 40; + xoffset3 = (20-animatetimer) * 40; + if (xoffset1 < 0) xoffset1 = 0; + if (xoffset2 < 0) xoffset2 = 0; + } + else + drawsection = 1; + } + + if (drawsection == 1) + { + ttheight = 16; + V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); + ttheight += V_LevelNameHeight(data.spec.passed3) + 2; + V_DrawLevelTitle(data.spec.passedx3 + xoffset2, ttheight, 0, data.spec.passed3); + ttheight += V_LevelNameHeight(data.spec.passed4) + 2; + V_DrawLevelTitle(data.spec.passedx4 + xoffset3, ttheight, 0, data.spec.passed4); + } + else if (data.spec.passed1[0] != '\0') + { + ttheight = 24; + V_DrawLevelTitle(data.spec.passedx1 + xoffset1, ttheight, 0, data.spec.passed1); + ttheight += V_LevelNameHeight(data.spec.passed2) + 2; + V_DrawLevelTitle(data.spec.passedx2 + xoffset2, ttheight, 0, data.spec.passed2); } else - V_DrawLevelTitle(data.spec.passedx2, 24+(V_LevelNameHeight(data.spec.passed2)/2)+2, 0, data.spec.passed2); + { + ttheight = 24 + (V_LevelNameHeight(data.spec.passed2)/2) + 2; + V_DrawLevelTitle(data.spec.passedx2 + xoffset1, ttheight, 0, data.spec.passed2); + } // draw the emeralds if (intertic & 1) @@ -1098,6 +1145,10 @@ void Y_StartIntermission(void) data.spec.nowsuper = NULL; } */ + // Super form stuff (normally blank) + data.spec.passed3[0] = '\0'; + data.spec.passed4[0] = '\0'; + // set up the "got through act" message according to skin name if (stagefailed) { @@ -1111,10 +1162,19 @@ void Y_StartIntermission(void) skins[players[consoleplayer].skin].realname); data.spec.passed1[sizeof data.spec.passed1 - 1] = '\0'; strcpy(data.spec.passed2, "GOT THEM ALL!"); + + if (skins[players[consoleplayer].skin].flags & SF_SUPER) + { + strcpy(data.spec.passed3, "CAN NOW BECOME"); + snprintf(data.spec.passed4, + sizeof data.spec.passed4, "SUPER %s", + skins[players[consoleplayer].skin].realname); + data.spec.passed4[sizeof data.spec.passed4 - 1] = '\0'; + } } else { - if (strlen(skins[players[consoleplayer].skin].realname) <= 8) + if (strlen(skins[players[consoleplayer].skin].realname) <= SKINNAMESIZE-5) { snprintf(data.spec.passed1, sizeof data.spec.passed1, "%s GOT", @@ -1127,6 +1187,8 @@ void Y_StartIntermission(void) } data.spec.passedx1 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed1))/2; data.spec.passedx2 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed2))/2; + data.spec.passedx3 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed3))/2; + data.spec.passedx4 = (BASEVIDWIDTH - V_LevelNameWidth(data.spec.passed4))/2; break; } From fc8e7728cd79afa6edba40333378ebf3ab90faf5 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Thu, 31 Mar 2016 06:57:11 -0700 Subject: [PATCH 50/53] I meant to extend this to 4 seconds but forgot --- src/y_inter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/y_inter.c b/src/y_inter.c index 32a722612..71e72122c 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -755,7 +755,7 @@ void Y_Ticker(void) { if (intertic > tallydonetic) { - endtic = intertic + 4*TICRATE; // 4 second pause after end of tally for sound + endtic = intertic + 4*TICRATE; // 4 second pause after end of tally S_StartSound(NULL, sfx_flgcap); // cha-ching! } return; @@ -775,7 +775,7 @@ void Y_Ticker(void) if (data.spec.continues & 0x80) // don't set endtic yet! tallydonetic = intertic + (3*TICRATE)/2; else // okay we're good. - endtic = intertic + 3*TICRATE; // 3 second pause after end of tally + endtic = intertic + 4*TICRATE; // 4 second pause after end of tally S_StartSound(NULL, sfx_chchng); // cha-ching! From f3f2c5962255b2f731c6acefd1067bb49b03c980 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 31 Mar 2016 20:42:01 -0500 Subject: [PATCH 51/53] Remove p_fab.c --- src/CMakeLists.txt | 1 - src/Makefile | 1 - src/p_fab.c | 15 --------------- 3 files changed, 17 deletions(-) delete mode 100644 src/p_fab.c diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 13d3312dd..035b46556 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -139,7 +139,6 @@ set(SRB2_CORE_RENDER_SOURCES set(SRB2_CORE_GAME_SOURCES p_ceilng.c p_enemy.c - p_fab.c p_floor.c p_inter.c p_lights.c diff --git a/src/Makefile b/src/Makefile index 449b4065d..0c034143d 100644 --- a/src/Makefile +++ b/src/Makefile @@ -437,7 +437,6 @@ OBJS:=$(i_main_o) \ $(OBJDIR)/info.o \ $(OBJDIR)/p_ceilng.o \ $(OBJDIR)/p_enemy.o \ - $(OBJDIR)/p_fab.o \ $(OBJDIR)/p_floor.o \ $(OBJDIR)/p_inter.o \ $(OBJDIR)/p_lights.o \ diff --git a/src/p_fab.c b/src/p_fab.c deleted file mode 100644 index 7ccb93a94..000000000 --- a/src/p_fab.c +++ /dev/null @@ -1,15 +0,0 @@ -// SONIC ROBO BLAST 2 -//----------------------------------------------------------------------------- -// Copyright (C) 1998-2000 by DooM Legacy Team. -// Copyright (C) 1999-2014 by Sonic Team Junior. -// -// This program is free software distributed under the -// terms of the GNU General Public License, version 2. -// See the 'LICENSE' file for more details. -//----------------------------------------------------------------------------- -/// \file p_fab.c -/// \brief some new action routines, separated from the original doom -/// sources, so that you can include it or remove it easy. - -/// \todo -/// This file is now unused, please remove at some point From 033090b2c883f9f6df1de1555f1e0037ab06bd1f Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Thu, 31 Mar 2016 20:47:57 -0500 Subject: [PATCH 52/53] Remove p_fab.c from Code::Blocks project --- SRB2.cbp | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/SRB2.cbp b/SRB2.cbp index 5a03955b8..43696ee2e 100644 --- a/SRB2.cbp +++ b/SRB2.cbp @@ -3293,23 +3293,6 @@ HW3SOUND for 3D hardware sound support