From ebd2bdd1c82eaef65526de767dc9a40401f63393 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Fri, 1 Jan 2016 14:53:29 -0600 Subject: [PATCH 001/150] Add CA_DASHMODE to the game This works fine in single player on vanilla builds, multiplayer is untested. This might not be the best way to handle the ability, so modifications for efficiency/sanity might be necessary. --- src/d_player.h | 3 ++- src/dehacked.c | 1 + src/p_user.c | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 63 insertions(+), 1 deletion(-) diff --git a/src/d_player.h b/src/d_player.h index e2a1081b0..08c98b7a3 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -57,7 +57,8 @@ typedef enum CA_FALLSWITCH, CA_JUMPBOOST, CA_AIRDRILL, - CA_JUMPTHOK + CA_JUMPTHOK, + CA_DASHMODE } charability_t; //Secondary skin abilities diff --git a/src/dehacked.c b/src/dehacked.c index 0ba054f07..3fd05ffe6 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7623,6 +7623,7 @@ struct { {"CA_JUMPBOOST",CA_JUMPBOOST}, {"CA_AIRDRILL",CA_AIRDRILL}, {"CA_JUMPTHOK",CA_JUMPTHOK}, + {"CA_DASHMODE",CA_DASHMODE}, // Secondary {"CA2_NONE",CA2_NONE}, // now slot 0! {"CA2_SPINDASH",CA2_SPINDASH}, diff --git a/src/p_user.c b/src/p_user.c index 8854d8d64..4b307feca 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4072,6 +4072,7 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) case CA_THOK: case CA_HOMINGTHOK: case CA_JUMPTHOK: // Credit goes to CZ64 and Sryder13 for the original + case CA_DASHMODE: // Credit goes to Iceman404 // Now it's Sonic's abilities turn! // THOK! if (!(player->pflags & PF_THOKKED) || (player->charability2 == CA2_MULTIABILITY)) @@ -8664,6 +8665,8 @@ void P_DoPityCheck(player_t *player) // boolean playerdeadview; // show match/chaos/tag/capture the flag rankings while in death view +INT32 dashmode = 0; // initial variable set for CA_DASHMODE +boolean dashmodeflag = false; void P_PlayerThink(player_t *player) { @@ -9148,6 +9151,63 @@ void P_PlayerThink(player_t *player) player->pflags &= ~PF_SLIDING; + // Dash mode ability for Metal Sonic + if ((player->charability == CA_DASHMODE) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho. + { + fixed_t defspeed = skins[player->skin].normalspeed; // Default normalspeed. + fixed_t maxtop = skins[player->skin].normalspeed * 55/36; + + if (!(player->speed > player->normalspeed)) //are we currently exceeding our normalspeed? + player->actionspd = player->normalspeed; //if not, force thok to normalspeed + else + player->actionspd = player->speed; //otherwise, thok at your current speed (this fixes super and speedshoes thok slowing you down) + + if (player->speed >= (defspeed - 5*FRACUNIT) || (player->pflags & PF_STARTDASH)) + { + dashmode++; // Counter. Adds 1 to dash mode per tic in top speed. + if (dashmode == 3*TICRATE) // This isn't in the ">=" equation because it'd cause the sound to play infinitely. + S_StartSound(player->mo, sfx_s3ka2); // If the player enters dashmode, play this sound on the the tic it starts. + } + else if (!(player->pflags & PF_SPINNING)) + { + if (dashmode > 0) + dashmode = dashmode - 3; // Rather than lose it all, it gently counts back down! + else if (dashmode < 0) + dashmode = 0; + } + + if (dashmode >= 3*TICRATE && P_IsObjectOnGround(player->mo)) // Dash Mode can continue counting in the air, but will only activate on floor touch. + dashmodeflag = true; + + if (dashmode < 3*TICRATE) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair. + { + player->normalspeed = defspeed; // Reset to default if not capable of entering dash mode. + player->jumpfactor = 1*FRACUNIT; + dashmodeflag = false; + } + + //WHEN PARAMETERS ARE MET, REWARD THE DASH MODE EFFECTS + if (dashmodeflag) + { + if (player->normalspeed < maxtop) // If the player is not currently at 50 normalspeed in dash mode, add speed each tic + { + player->normalspeed = player->normalspeed + 1*FRACUNIT/5; // Enter Dash Mode smoothly. + if (player->jumpfactor < 5*FRACUNIT/4) + player->jumpfactor = player->jumpfactor + 1*FRACUNIT/300; // Boosts his jumpheight. Remember fractions instead of decimals. "1.5*FRACUNIT = 3*FRACUNIT/2" + } + } + + //COSMETIC STUPIDITY! + if (dashmode > 108) //Dash Mode will go down a tic a bit above activation, this makes dust spawn every other tic. + dashmode = 107; + + if (player->normalspeed >= maxtop) + { + mobj_t *ghost = P_SpawnGhostMobj(player->mo); // Spawns afterimages + ghost->fuse = 2; // Makes the images fade quickly + } + } + /* // Colormap verification { From a15a4ace7e8bac122a90ddc6645f76f76de1ff87 Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sat, 2 Jan 2016 22:34:55 -0600 Subject: [PATCH 002/150] Do dashmode thok speed adjustments at thok instead of modifying actionspd --- src/p_user.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_user.c b/src/p_user.c index 4b307feca..034bab498 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -4079,13 +4079,19 @@ static void P_DoJumpStuff(player_t *player, ticcmd_t *cmd) { // Catapult the player fixed_t actionspd = player->actionspd; + + if (player->charability == CA_DASHMODE) + actionspd = max(player->normalspeed, FixedDiv(player->speed, player->mo->scale)); + if (player->mo->eflags & MFE_UNDERWATER) actionspd >>= 1; + if ((player->charability == CA_JUMPTHOK) && !(player->pflags & PF_THOKKED)) { player->pflags &= ~PF_JUMPED; P_DoJump(player, false); } + P_InstaThrust(player->mo, player->mo->angle, FixedMul(actionspd, player->mo->scale)); if (maptol & TOL_2D) From ba8c0dfc6e55e1116aa93b3ce4b030711340d114 Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sat, 2 Jan 2016 22:58:35 -0600 Subject: [PATCH 003/150] Clean up dash mode and make multiplayer-compatible Actionspd is now the running speed in dashmode. --- src/p_user.c | 45 ++++++++++++++------------------------------- 1 file changed, 14 insertions(+), 31 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 034bab498..802e7f9c3 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8671,8 +8671,6 @@ void P_DoPityCheck(player_t *player) // boolean playerdeadview; // show match/chaos/tag/capture the flag rankings while in death view -INT32 dashmode = 0; // initial variable set for CA_DASHMODE -boolean dashmodeflag = false; void P_PlayerThink(player_t *player) { @@ -9160,15 +9158,10 @@ void P_PlayerThink(player_t *player) // Dash mode ability for Metal Sonic if ((player->charability == CA_DASHMODE) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho. { - fixed_t defspeed = skins[player->skin].normalspeed; // Default normalspeed. +#define dashmode player->glidetime fixed_t maxtop = skins[player->skin].normalspeed * 55/36; - if (!(player->speed > player->normalspeed)) //are we currently exceeding our normalspeed? - player->actionspd = player->normalspeed; //if not, force thok to normalspeed - else - player->actionspd = player->speed; //otherwise, thok at your current speed (this fixes super and speedshoes thok slowing you down) - - if (player->speed >= (defspeed - 5*FRACUNIT) || (player->pflags & PF_STARTDASH)) + if (player->speed >= FixedMul(skins[player->skin].normalspeed - 5*FRACUNIT, player->mo->scale) || (player->pflags & PF_STARTDASH)) { dashmode++; // Counter. Adds 1 to dash mode per tic in top speed. if (dashmode == 3*TICRATE) // This isn't in the ">=" equation because it'd cause the sound to play infinitely. @@ -9176,42 +9169,32 @@ void P_PlayerThink(player_t *player) } else if (!(player->pflags & PF_SPINNING)) { - if (dashmode > 0) + if (dashmode > 3) dashmode = dashmode - 3; // Rather than lose it all, it gently counts back down! - else if (dashmode < 0) + else dashmode = 0; } - - if (dashmode >= 3*TICRATE && P_IsObjectOnGround(player->mo)) // Dash Mode can continue counting in the air, but will only activate on floor touch. - dashmodeflag = true; if (dashmode < 3*TICRATE) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair. { - player->normalspeed = defspeed; // Reset to default if not capable of entering dash mode. - player->jumpfactor = 1*FRACUNIT; - dashmodeflag = false; + player->normalspeed = skins[player->skin].normalspeed; // Reset to default if not capable of entering dash mode. + player->jumpfactor = skins[player->skin].jumpfactor; } - - //WHEN PARAMETERS ARE MET, REWARD THE DASH MODE EFFECTS - if (dashmodeflag) + else if (P_IsObjectOnGround(player->mo)) // Activate dash mode if we're on the ground. { - if (player->normalspeed < maxtop) // If the player is not currently at 50 normalspeed in dash mode, add speed each tic - { + if (player->normalspeed < skins[player->skin].actionspd) // If the player normalspeed is not currently at actionspd in dash mode, add speed each tic player->normalspeed = player->normalspeed + 1*FRACUNIT/5; // Enter Dash Mode smoothly. - if (player->jumpfactor < 5*FRACUNIT/4) - player->jumpfactor = player->jumpfactor + 1*FRACUNIT/300; // Boosts his jumpheight. Remember fractions instead of decimals. "1.5*FRACUNIT = 3*FRACUNIT/2" - } + + if (player->jumpfactor < FixedMul(skins[player->skin].jumpfactor, 5*FRACUNIT/4)) // Boost jump height. + player->jumpfactor = player->jumpfactor + 1*FRACUNIT/300; } - - //COSMETIC STUPIDITY! - if (dashmode > 108) //Dash Mode will go down a tic a bit above activation, this makes dust spawn every other tic. - dashmode = 107; - - if (player->normalspeed >= maxtop) + + if (player->normalspeed >= skins[player->skin].actionspd) { mobj_t *ghost = P_SpawnGhostMobj(player->mo); // Spawns afterimages ghost->fuse = 2; // Makes the images fade quickly } +#undef dashmode } /* From c38af2c6a2751336da1512d9e3a15ec1e75c565e Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sat, 2 Jan 2016 23:26:22 -0600 Subject: [PATCH 004/150] Remove unused maxtop variable --- src/p_user.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 802e7f9c3..3b0d48628 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9159,8 +9159,6 @@ void P_PlayerThink(player_t *player) if ((player->charability == CA_DASHMODE) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho. { #define dashmode player->glidetime - fixed_t maxtop = skins[player->skin].normalspeed * 55/36; - if (player->speed >= FixedMul(skins[player->skin].normalspeed - 5*FRACUNIT, player->mo->scale) || (player->pflags & PF_STARTDASH)) { dashmode++; // Counter. Adds 1 to dash mode per tic in top speed. From 95d6cba18405b5ce7f9224e1849b3f0751bc6f02 Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 25 Jan 2016 01:49:37 -0600 Subject: [PATCH 005/150] [HACK] Make dashmode work again Fixed one of Red's mistakes, and used a different struct variable for dashmode. This needs to be changed though, because everything will break if someone loads a circuit map. --- src/p_user.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 3b0d48628..91bbfc6f2 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9158,7 +9158,7 @@ void P_PlayerThink(player_t *player) // Dash mode ability for Metal Sonic if ((player->charability == CA_DASHMODE) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho. { -#define dashmode player->glidetime +#define dashmode player->laps if (player->speed >= FixedMul(skins[player->skin].normalspeed - 5*FRACUNIT, player->mo->scale) || (player->pflags & PF_STARTDASH)) { dashmode++; // Counter. Adds 1 to dash mode per tic in top speed. @@ -9168,10 +9168,13 @@ void P_PlayerThink(player_t *player) else if (!(player->pflags & PF_SPINNING)) { if (dashmode > 3) - dashmode = dashmode - 3; // Rather than lose it all, it gently counts back down! + dashmode -= 3; // Rather than lose it all, it gently counts back down! else dashmode = 0; } + + if (dashmode > 254) + dashmode = 3*TICRATE+1; if (dashmode < 3*TICRATE) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair. { From 67b92d727344ab66bb5e070a9d45e8e647942c87 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 25 Jan 2016 11:47:33 +0000 Subject: [PATCH 006/150] Went and fixed the dashmode variable hack nonsense once and for all myself would have gone for "dashtime", but then I was reminded that was already a name for something to do with spindash. Oh well --- src/d_clisrv.c | 2 ++ src/d_clisrv.h | 1 + src/d_player.h | 1 + src/lua_playerlib.c | 4 ++++ src/p_saveg.c | 2 ++ src/p_user.c | 11 ++++++----- 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 31738e9b2..ee2d18961 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -531,6 +531,7 @@ static inline void resynch_write_player(resynch_pak *rsp, const size_t i) rsp->deadtimer = players[i].deadtimer; rsp->exiting = (tic_t)LONG(players[i].exiting); rsp->homing = players[i].homing; + rsp->dashmode = (tic_t)LONG(players[i].dashmode); rsp->cmomx = (fixed_t)LONG(players[i].cmomx); rsp->cmomy = (fixed_t)LONG(players[i].cmomy); rsp->rmomx = (fixed_t)LONG(players[i].rmomx); @@ -656,6 +657,7 @@ static void resynch_read_player(resynch_pak *rsp) players[i].deadtimer = rsp->deadtimer; players[i].exiting = (tic_t)LONG(rsp->exiting); players[i].homing = rsp->homing; + players[i].dashmode = (tic_t)LONG(rsp->dashmode); players[i].cmomx = (fixed_t)LONG(rsp->cmomx); players[i].cmomy = (fixed_t)LONG(rsp->cmomy); players[i].rmomx = (fixed_t)LONG(rsp->rmomx); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 6bc06f13a..2bcfad176 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -191,6 +191,7 @@ typedef struct INT32 deadtimer; tic_t exiting; UINT8 homing; + tic_t dashmode; fixed_t cmomx; fixed_t cmomy; fixed_t rmomx; diff --git a/src/d_player.h b/src/d_player.h index 08c98b7a3..a3acb8728 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -352,6 +352,7 @@ typedef struct player_s tic_t exiting; // Exitlevel timer UINT8 homing; // Are you homing? + tic_t dashmode; // counter for dashmode ability tic_t skidtime; // Skid timer diff --git a/src/lua_playerlib.c b/src/lua_playerlib.c index 64513ab97..b03833354 100644 --- a/src/lua_playerlib.c +++ b/src/lua_playerlib.c @@ -202,6 +202,8 @@ static int player_get(lua_State *L) lua_pushinteger(L, plr->exiting); else if (fastcmp(field,"homing")) lua_pushinteger(L, plr->homing); + else if (fastcmp(field,"dashmode")) + lua_pushinteger(L, plr->dashmode); else if (fastcmp(field,"skidtime")) lua_pushinteger(L, plr->skidtime); else if (fastcmp(field,"cmomx")) @@ -452,6 +454,8 @@ static int player_set(lua_State *L) plr->exiting = (tic_t)luaL_checkinteger(L, 3); else if (fastcmp(field,"homing")) plr->homing = (UINT8)luaL_checkinteger(L, 3); + else if (fastcmp(field,"dashmode")) + plr->dashmode = (tic_t)luaL_checkinteger(L, 3); else if (fastcmp(field,"skidtime")) plr->skidtime = (tic_t)luaL_checkinteger(L, 3); else if (fastcmp(field,"cmomx")) diff --git a/src/p_saveg.c b/src/p_saveg.c index 07e7b3564..a574afb55 100644 --- a/src/p_saveg.c +++ b/src/p_saveg.c @@ -162,6 +162,7 @@ static inline void P_NetArchivePlayers(void) WRITEINT32(save_p, players[i].deadtimer); WRITEUINT32(save_p, players[i].exiting); WRITEUINT8(save_p, players[i].homing); + WRITEUINT32(save_p, players[i].dashmode); WRITEUINT32(save_p, players[i].skidtime); //////////////////////////// @@ -337,6 +338,7 @@ static inline void P_NetUnArchivePlayers(void) players[i].deadtimer = READINT32(save_p); // End game if game over lasts too long players[i].exiting = READUINT32(save_p); // Exitlevel timer players[i].homing = READUINT8(save_p); // Are you homing? + players[i].dashmode = READUINT32(save_p); // counter for dashmode ability players[i].skidtime = READUINT32(save_p); // Skid timer //////////////////////////// diff --git a/src/p_user.c b/src/p_user.c index 91bbfc6f2..8a6d8b871 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9155,10 +9155,10 @@ void P_PlayerThink(player_t *player) player->pflags &= ~PF_SLIDING; +#define dashmode player->dashmode // Dash mode ability for Metal Sonic if ((player->charability == CA_DASHMODE) && !(maptol & TOL_NIGHTS)) // woo, dashmode! no nights tho. { -#define dashmode player->laps if (player->speed >= FixedMul(skins[player->skin].normalspeed - 5*FRACUNIT, player->mo->scale) || (player->pflags & PF_STARTDASH)) { dashmode++; // Counter. Adds 1 to dash mode per tic in top speed. @@ -9172,10 +9172,10 @@ void P_PlayerThink(player_t *player) else dashmode = 0; } - + if (dashmode > 254) dashmode = 3*TICRATE+1; - + if (dashmode < 3*TICRATE) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair. { player->normalspeed = skins[player->skin].normalspeed; // Reset to default if not capable of entering dash mode. @@ -9195,9 +9195,10 @@ void P_PlayerThink(player_t *player) mobj_t *ghost = P_SpawnGhostMobj(player->mo); // Spawns afterimages ghost->fuse = 2; // Makes the images fade quickly } -#undef dashmode } - + else + dashmode = 0; +#undef dashmode /* // Colormap verification { From e314b442b2762d79df4f07d5a6da0ae0d6c6c57c Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Mon, 25 Jan 2016 20:26:31 -0600 Subject: [PATCH 007/150] Remove dashmode limit since tic_t is UINT32 This might be overpowered as hell. Needs testing for sure. --- src/p_user.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 8a6d8b871..3c86c3621 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9173,9 +9173,6 @@ void P_PlayerThink(player_t *player) dashmode = 0; } - if (dashmode > 254) - dashmode = 3*TICRATE+1; - if (dashmode < 3*TICRATE) // Exits Dash Mode if you drop below speed/dash counter tics. Not in the above block so it doesn't keep disabling in midair. { player->normalspeed = skins[player->skin].normalspeed; // Reset to default if not capable of entering dash mode. From 560d7d9aae52260626266d45f9112ed6532b9f6b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 3 Mar 2016 22:38:06 +0000 Subject: [PATCH 008/150] Sideways springs, horizontal hog-launchers, perpendicular plungers... Call them what you like, they're in the game now --- src/dehacked.c | 33 ++++++++++++ src/info.c | 133 +++++++++++++++++++++++++++++++++++++++++++++---- src/info.h | 36 +++++++++++++ 3 files changed, 191 insertions(+), 11 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 7b527eeef..45e2486e0 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -5463,6 +5463,36 @@ static const char *const STATE_LIST[] = { // array length left dynamic for sanit "S_RDIAG7", "S_RDIAG8", + // Yellow Side Spring + "S_YHORIZ1", + "S_YHORIZ2", + "S_YHORIZ3", + "S_YHORIZ4", + "S_YHORIZ5", + "S_YHORIZ6", + "S_YHORIZ7", + "S_YHORIZ8", + + // Red Side Spring + "S_RHORIZ1", + "S_RHORIZ2", + "S_RHORIZ3", + "S_RHORIZ4", + "S_RHORIZ5", + "S_RHORIZ6", + "S_RHORIZ7", + "S_RHORIZ8", + + // Blue Side Spring + "S_BHORIZ1", + "S_BHORIZ2", + "S_BHORIZ3", + "S_BHORIZ4", + "S_BHORIZ5", + "S_BHORIZ6", + "S_BHORIZ7", + "S_BHORIZ8", + // Rain "S_RAIN1", "S_RAINRETURN", @@ -6222,6 +6252,9 @@ static const char *const MOBJTYPE_LIST[] = { // array length left dynamic for s "MT_REDSPRING", "MT_YELLOWDIAG", // Yellow Diagonal Spring "MT_REDDIAG", // Red Diagonal Spring + "MT_YELLOWHORIZ", // Yellow Side Spring + "MT_REDHORIZ", // Red Side Spring + "MT_BLUEHORIZ", // Blue Side Spring // Interactive Objects "MT_BUBBLES", // Bubble source diff --git a/src/info.c b/src/info.c index ec1a8926e..cb5d436cf 100644 --- a/src/info.c +++ b/src/info.c @@ -43,17 +43,17 @@ char sprnames[NUMSPRITES + 1][5] = "DFLM","XMS1","XMS2","XMS3","BSZ1","BSZ2","BSZ3","BSZ4","BSZ5","BSZ6", "BSZ7","BSZ8","STLG","DBAL","RCRY","ARMA","ARMF","ARMB","WIND","MAGN", "ELEM","FORC","PITY","IVSP","SSPK","GOAL","BIRD","BUNY","MOUS","CHIC", - "COWZ","RBRD","SPRY","SPRR","SPRB","YSPR","RSPR","RAIN","SNO1","SPLH", - "SPLA","SMOK","BUBP","BUBO","BUBN","BUBM","POPP","TFOG","SEED","PRTL", - "SCOR","DRWN","TTAG","GFLG","RRNG","RNGB","RNGR","RNGI","RNGA","RNGE", - "RNGS","RNGG","PIKB","PIKR","PIKA","PIKE","PIKS","PIKG","TAUT","TGRE", - "TSCR","COIN","CPRK","GOOM","BGOM","FFWR","FBLL","SHLL","PUMA","HAMM", - "KOOP","BFLM","MAXE","MUS1","MUS2","TOAD","NDRN","SUPE","SUPZ","NDRL", - "NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT","SPRK","BOM1","BOM2", - "BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE","ROIF","ROIG","ROIH", - "ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO","ROIP","BBAL","GWLG", - "GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF","SRBG","SRBH","SRBI", - "SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", + "COWZ","RBRD","SPRY","SPRR","SPRB","YSPR","RSPR","SSWY","SSWR","SSWB", + "RAIN","SNO1","SPLH","SPLA","SMOK","BUBP","BUBO","BUBN","BUBM","POPP", + "TFOG","SEED","PRTL","SCOR","DRWN","TTAG","GFLG","RRNG","RNGB","RNGR", + "RNGI","RNGA","RNGE","RNGS","RNGG","PIKB","PIKR","PIKA","PIKE","PIKS", + "PIKG","TAUT","TGRE","TSCR","COIN","CPRK","GOOM","BGOM","FFWR","FBLL", + "SHLL","PUMA","HAMM","KOOP","BFLM","MAXE","MUS1","MUS2","TOAD","NDRN", + "SUPE","SUPZ","NDRL","NSPK","NBMP","HOOP","NSCR","NPRU","CAPS","SUPT", + "SPRK","BOM1","BOM2","BOM3","BOM4","ROIA","ROIB","ROIC","ROID","ROIE", + "ROIF","ROIG","ROIH","ROII","ROIJ","ROIK","ROIL","ROIM","ROIN","ROIO", + "ROIP","BBAL","GWLG","GWLR","SRBA","SRBB","SRBC","SRBD","SRBE","SRBF", + "SRBG","SRBH","SRBI","SRBJ","SRBK","SRBL","SRBM","SRBN","SRBO", }; char spr2names[NUMPLAYERSPRITES][5] = @@ -1850,6 +1850,36 @@ state_t states[NUMSTATES] = {SPR_RSPR, 2, 1, {NULL}, 0, 0, S_RDIAG8}, // S_RDIAG7 {SPR_RSPR, 1, 1, {NULL}, 0, 0, S_RDIAG1}, // S_RDIAG8 + // Yellow Side Spring + {SPR_SSWY, 0, -1, {NULL}, 0, 0, S_NULL}, // S_YHORIZ1 + {SPR_SSWY, 1, 1, {A_Pain}, 0, 0, S_YHORIZ3}, // S_YHORIZ2 + {SPR_SSWY, 2, 1, {NULL}, 0, 0, S_YHORIZ4}, // S_YHORIZ3 + {SPR_SSWY, 3, 1, {NULL}, 0, 0, S_YHORIZ5}, // S_YHORIZ4 + {SPR_SSWY, 4, 1, {NULL}, 0, 0, S_YHORIZ6}, // S_YHORIZ5 + {SPR_SSWY, 3, 1, {NULL}, 0, 0, S_YHORIZ7}, // S_YHORIZ6 + {SPR_SSWY, 2, 1, {NULL}, 0, 0, S_YHORIZ8}, // S_YHORIZ7 + {SPR_SSWY, 1, 1, {NULL}, 0, 0, S_YHORIZ1}, // S_YHORIZ8 + + // Red Side Spring + {SPR_SSWR, 0, -1, {NULL}, 0, 0, S_NULL}, // S_RHORIZ1 + {SPR_SSWR, 1, 1, {A_Pain}, 0, 0, S_RHORIZ3}, // S_RHORIZ2 + {SPR_SSWR, 2, 1, {NULL}, 0, 0, S_RHORIZ4}, // S_RHORIZ3 + {SPR_SSWR, 3, 1, {NULL}, 0, 0, S_RHORIZ5}, // S_RHORIZ4 + {SPR_SSWR, 4, 1, {NULL}, 0, 0, S_RHORIZ6}, // S_RHORIZ5 + {SPR_SSWR, 3, 1, {NULL}, 0, 0, S_RHORIZ7}, // S_RHORIZ6 + {SPR_SSWR, 2, 1, {NULL}, 0, 0, S_RHORIZ8}, // S_RHORIZ7 + {SPR_SSWR, 1, 1, {NULL}, 0, 0, S_RHORIZ1}, // S_RHORIZ8 + + // Blue Side Spring + {SPR_SSWB, 0, -1, {NULL}, 0, 0, S_NULL}, // S_BHORIZ1 + {SPR_SSWB, 1, 1, {A_Pain}, 0, 0, S_BHORIZ3}, // S_BHORIZ2 + {SPR_SSWB, 2, 1, {NULL}, 0, 0, S_BHORIZ4}, // S_BHORIZ3 + {SPR_SSWB, 3, 1, {NULL}, 0, 0, S_BHORIZ5}, // S_BHORIZ4 + {SPR_SSWB, 4, 1, {NULL}, 0, 0, S_BHORIZ6}, // S_BHORIZ5 + {SPR_SSWB, 3, 1, {NULL}, 0, 0, S_BHORIZ7}, // S_BHORIZ6 + {SPR_SSWB, 2, 1, {NULL}, 0, 0, S_BHORIZ8}, // S_BHORIZ7 + {SPR_SSWB, 1, 1, {NULL}, 0, 0, S_BHORIZ1}, // S_BHORIZ8 + // Rain {SPR_RAIN, FF_TRANS50, -1, {NULL}, 0, 0, S_NULL}, // S_RAIN1 {SPR_RAIN, FF_TRANS50, 1, {NULL}, 0, 0, S_RAIN1}, // S_RAINRETURN @@ -5283,6 +5313,87 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = S_RDIAG2 // raisestate }, + { // MT_YELLOWHORIZ + 558, // doomednum + S_YHORIZ1, // spawnstate + 1, // spawnhealth + S_YHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_spring, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 0, // mass + 16*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags + S_YHORIZ2 // raisestate + }, + + { // MT_REDHORIZ + 559, // doomednum + S_RHORIZ1, // spawnstate + 1, // spawnhealth + S_RHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_spring, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 0, // mass + 64*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags + S_RHORIZ2 // raisestate + }, + + { // MT_BLUEHORIZ + 560, // doomednum + S_BHORIZ1, // spawnstate + 1, // spawnhealth + S_BHORIZ2, // seestate + sfx_None, // seesound + 8, // reactiontime + sfx_None, // attacksound + S_NULL, // painstate + 0, // painchance + sfx_spring, // painsound + S_NULL, // meleestate + S_NULL, // missilestate + S_NULL, // deathstate + S_NULL, // xdeathstate + sfx_None, // deathsound + 0, // speed + 16*FRACUNIT, // radius + 32*FRACUNIT, // height + 0, // display offset + 0, // mass + 4*FRACUNIT, // damage + sfx_None, // activesound + MF_SOLID|MF_SPRING|MF_NOGRAVITY, // flags + S_BHORIZ2 // raisestate + }, + { // MT_BUBBLES 500, // doomednum S_BUBBLES1, // spawnstate diff --git a/src/info.h b/src/info.h index 677d0f9e4..83faf87c4 100644 --- a/src/info.h +++ b/src/info.h @@ -448,6 +448,9 @@ typedef enum sprite SPR_SPRB, // Blue springs SPR_YSPR, // Yellow Diagonal Spring SPR_RSPR, // Red Diagonal Spring + SPR_SSWY, // Yellow Side Spring + SPR_SSWR, // Red Side Spring + SPR_SSWB, // Blue Side Spring // Environmental Effects SPR_RAIN, // Rain @@ -2348,6 +2351,36 @@ typedef enum state S_RDIAG7, S_RDIAG8, + // Yellow Side Spring + S_YHORIZ1, + S_YHORIZ2, + S_YHORIZ3, + S_YHORIZ4, + S_YHORIZ5, + S_YHORIZ6, + S_YHORIZ7, + S_YHORIZ8, + + // Red Side Spring + S_RHORIZ1, + S_RHORIZ2, + S_RHORIZ3, + S_RHORIZ4, + S_RHORIZ5, + S_RHORIZ6, + S_RHORIZ7, + S_RHORIZ8, + + // Blue Side Spring + S_BHORIZ1, + S_BHORIZ2, + S_BHORIZ3, + S_BHORIZ4, + S_BHORIZ5, + S_BHORIZ6, + S_BHORIZ7, + S_BHORIZ8, + // Rain S_RAIN1, S_RAINRETURN, @@ -3125,6 +3158,9 @@ typedef enum mobj_type MT_REDSPRING, MT_YELLOWDIAG, // Yellow Diagonal Spring MT_REDDIAG, // Red Diagonal Spring + MT_YELLOWHORIZ, // Yellow Side Spring + MT_REDHORIZ, // Red Side Spring + MT_BLUEHORIZ, // Blue Side Spring // Interactive Objects MT_BUBBLES, // Bubble source From 928c6acf4b7fa009599c508fa2337578c2b8f3ca Mon Sep 17 00:00:00 2001 From: yoshibot Date: Tue, 17 May 2016 22:56:49 -0500 Subject: [PATCH 009/150] Simplify OS X bundle resource discovery, fix a sigsegv --- src/sdl/macosx/mac_resources.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/sdl/macosx/mac_resources.c b/src/sdl/macosx/mac_resources.c index dacc8014b..706c5e7fc 100644 --- a/src/sdl/macosx/mac_resources.c +++ b/src/sdl/macosx/mac_resources.c @@ -9,23 +9,21 @@ void OSX_GetResourcesPath(char * buffer) mainBundle = CFBundleGetMainBundle(); if (mainBundle) { + const int BUF_SIZE = 256; // because we somehow always know that + CFURLRef appUrlRef = CFBundleCopyBundleURL(mainBundle); CFStringRef macPath = CFURLCopyFileSystemPath(appUrlRef, kCFURLPOSIXPathStyle); - CFStringRef resources = CFStringCreateWithCString(kCFAllocatorMalloc, "/Contents/Resources", kCFStringEncodingASCII); - const void* rawarray[2] = {macPath, resources}; - CFArrayRef array = CFArrayCreate(kCFAllocatorMalloc, rawarray, 2, NULL); - CFStringRef separator = CFStringCreateWithCString(kCFAllocatorMalloc, "", kCFStringEncodingASCII); - CFStringRef fullPath = CFStringCreateByCombiningStrings(kCFAllocatorMalloc, array, separator); - const char * path = CFStringGetCStringPtr(fullPath, kCFStringEncodingASCII); - strcpy(buffer, path); - CFRelease(fullPath); - path = NULL; - CFRelease(array); - CFRelease(resources); + + const char* rawPath = CFStringGetCStringPtr(macPath, kCFStringEncodingASCII); + + if (CFStringGetLength(macPath) + strlen("/Contents/Resources") < BUF_SIZE) + { + strcpy(buffer, rawPath); + strcat(buffer, "/Contents/Resources"); + } + CFRelease(macPath); CFRelease(appUrlRef); - //CFRelease(mainBundle); - CFRelease(separator); } - -} \ No newline at end of file + CFRelease(mainBundle); +} From df89563882d8eb7e2bc848944a0b76853d086970 Mon Sep 17 00:00:00 2001 From: yoshibot Date: Wed, 18 May 2016 19:14:53 -0500 Subject: [PATCH 010/150] Add a way to build OS X binaries (not .app) through Makefiles --- src/Makefile | 14 ++++++++++++++ src/Makefile.cfg | 11 +++++++++++ src/doomtype.h | 2 +- src/sdl/MakeNIX.cfg | 9 +++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 701cdcfb1..deee38545 100644 --- a/src/Makefile +++ b/src/Makefile @@ -189,6 +189,10 @@ ifdef FREEBSD UNIXCOMMON=1 endif +ifdef MACOSX +UNIXCOMMON=1 +endif + ifdef NDS NOPNG=1 NONET=1 @@ -588,11 +592,16 @@ ifndef WINDOWSHELL -$(GZIP) $(GZIP_OPT2) $(BIN)/$(DBGNAME).txt endif endif + +# i dont know why, but the os x executable absolutely hates +# being touched by objcopy. so let's not do it +ifndef MACOSX ifndef PSP $(OBJCOPY) $(BIN)/$(EXENAME) $(BIN)/$(DBGNAME) $(OBJCOPY) --strip-debug $(BIN)/$(EXENAME) -$(OBJCOPY) --add-gnu-debuglink=$(BIN)/$(DBGNAME) $(BIN)/$(EXENAME) endif +endif ifndef NOUPX -$(UPX) $(UPX_OPTS) $(BIN)/$(EXENAME) endif @@ -737,6 +746,11 @@ $(OBJDIR)/%.o: %.c $(OBJDIR)/%.o: $(INTERFACE)/%.c $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ +ifdef MACOSX +$(OBJDIR)/%.o: sdl/macosx/%.c + $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ +endif + $(OBJDIR)/%.o: hardware/%.c $(CC) $(CFLAGS) $(WFLAGS) -c $< -o $@ diff --git a/src/Makefile.cfg b/src/Makefile.cfg index fa8896a7c..7acb45596 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -403,6 +403,17 @@ else WINDRES=windres endif +# because Apple screws with us on this +# need to get bintools from homebrew +# need to get gzip from homebrew (it's in dupes) +ifdef MACOSX + CC=clang + CXX=clang + OBJCOPY=gobjcopy + OBJDUMP=gobjdump + GZIP=/usr/local/bin/gzip +endif + OBJDUMP_OPTS?=--wide --source --line-numbers LD=$(CC) diff --git a/src/doomtype.h b/src/doomtype.h index d833176f7..6bc2c5731 100644 --- a/src/doomtype.h +++ b/src/doomtype.h @@ -92,7 +92,7 @@ typedef long ssize_t; #endif #ifdef __APPLE_CC__ -#define DIRECTFULLSCREEN +#define DIRECTFULLSCREEN 1 #define DEBUG_LOG #define NOIPX #endif diff --git a/src/sdl/MakeNIX.cfg b/src/sdl/MakeNIX.cfg index f5c9b2075..1a0b54210 100644 --- a/src/sdl/MakeNIX.cfg +++ b/src/sdl/MakeNIX.cfg @@ -56,6 +56,15 @@ ifdef FREEBSD LIBS+=-lipx -lkvm endif +# +#here is Mac OS X +# +ifdef MACOSX + OBJS+=$(OBJDIR)/mac_resources.o + OBJS+=$(OBJDIR)/mac_alert.o + LIBS+=-framework CoreFoundation +endif + # #here is GP2x (arm-gp2x-linux) # From bb90c8366a4cd16ead76b96819065acf332ca3d3 Mon Sep 17 00:00:00 2001 From: yoshibot Date: Wed, 18 May 2016 22:13:53 -0500 Subject: [PATCH 011/150] Fixed bugs in OS X alert code and simplified; added more NULL checks in OS X resource code --- src/sdl/macosx/mac_alert.c | 37 +++++++++++++++++++++++++--------- src/sdl/macosx/mac_resources.c | 18 ++++++++++++----- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/src/sdl/macosx/mac_alert.c b/src/sdl/macosx/mac_alert.c index 455e36509..2a139041a 100644 --- a/src/sdl/macosx/mac_alert.c +++ b/src/sdl/macosx/mac_alert.c @@ -25,19 +25,38 @@ #include "mac_alert.h" #include +#define CFSTRINGIFY(x) CFStringCreateWithCString(NULL, x, kCFStringEncodingASCII) + int MacShowAlert(const char *title, const char *message, const char *button1, const char *button2, const char *button3) { CFOptionFlags results; - CFUserNotificationDisplayAlert(0, - kCFUserNotificationStopAlertLevel | kCFUserNotificationNoDefaultButtonFlag, - NULL, NULL, NULL, - CFStringCreateWithCString(NULL, title, kCFStringEncodingASCII), - CFStringCreateWithCString(NULL, message, kCFStringEncodingASCII), - button1 != NULL ? CFStringCreateWithCString(NULL, button1, kCFStringEncodingASCII) : NULL, - button2 != NULL ? CFStringCreateWithCString(NULL, button2, kCFStringEncodingASCII) : NULL, - button3 != NULL ? CFStringCreateWithCString(NULL, button3, kCFStringEncodingASCII) : NULL, - &results); + CFStringRef cf_title = CFSTRINGIFY(title); + CFStringRef cf_message = CFSTRINGIFY(message); + CFStringRef cf_button1 = NULL; + CFStringRef cf_button2 = NULL; + CFStringRef cf_button3 = NULL; + + if (button1 != NULL) + cf_button1 = CFSTRINGIFY(button1); + if (button2 != NULL) + cf_button2 = CFSTRINGIFY(button2); + if (button3 != NULL) + cf_button3 = CFSTRINGIFY(button3); + + CFOptionFlags alert_flags = kCFUserNotificationStopAlertLevel | kCFUserNotificationNoDefaultButtonFlag; + + CFUserNotificationDisplayAlert(0, alert_flags, NULL, NULL, NULL, cf_title, cf_message, + cf_button1, cf_button2, cf_button3, &results); + + if (cf_button1 != NULL) + CFRelease(cf_button1); + if (cf_button2 != NULL) + CFRelease(cf_button2); + if (cf_button3 != NULL) + CFRelease(cf_button3); + CFRelease(cf_message); + CFRelease(cf_title); return (int)results; } diff --git a/src/sdl/macosx/mac_resources.c b/src/sdl/macosx/mac_resources.c index 706c5e7fc..d67b92580 100644 --- a/src/sdl/macosx/mac_resources.c +++ b/src/sdl/macosx/mac_resources.c @@ -12,11 +12,20 @@ void OSX_GetResourcesPath(char * buffer) const int BUF_SIZE = 256; // because we somehow always know that CFURLRef appUrlRef = CFBundleCopyBundleURL(mainBundle); - CFStringRef macPath = CFURLCopyFileSystemPath(appUrlRef, kCFURLPOSIXPathStyle); + CFStringRef macPath; + if (appUrlRef != NULL) + macPath = CFURLCopyFileSystemPath(appUrlRef, kCFURLPOSIXPathStyle); + else + macPath = NULL; - const char* rawPath = CFStringGetCStringPtr(macPath, kCFStringEncodingASCII); - - if (CFStringGetLength(macPath) + strlen("/Contents/Resources") < BUF_SIZE) + const char* rawPath; + + if (macPath != NULL) + rawPath = CFStringGetCStringPtr(macPath, kCFStringEncodingASCII); + else + rawPath = NULL; + + if (rawPath != NULL && (CFStringGetLength(macPath) + strlen("/Contents/Resources") < BUF_SIZE)) { strcpy(buffer, rawPath); strcat(buffer, "/Contents/Resources"); @@ -25,5 +34,4 @@ void OSX_GetResourcesPath(char * buffer) CFRelease(macPath); CFRelease(appUrlRef); } - CFRelease(mainBundle); } From 8fbc0d7f69cd683bd23253522fcf696fd10674e8 Mon Sep 17 00:00:00 2001 From: yoshibot Date: Wed, 18 May 2016 23:52:06 -0500 Subject: [PATCH 012/150] remove bogus homebrew gzip; objdump allowed to fail in that way --- src/Makefile | 3 +-- src/Makefile.cfg | 2 -- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/Makefile b/src/Makefile index deee38545..cbd362ae1 100644 --- a/src/Makefile +++ b/src/Makefile @@ -593,8 +593,7 @@ ifndef WINDOWSHELL endif endif -# i dont know why, but the os x executable absolutely hates -# being touched by objcopy. so let's not do it +# mac os x lsdlsrb2 does not like objcopy ifndef MACOSX ifndef PSP $(OBJCOPY) $(BIN)/$(EXENAME) $(BIN)/$(DBGNAME) diff --git a/src/Makefile.cfg b/src/Makefile.cfg index 7acb45596..2e67474ca 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -405,13 +405,11 @@ endif # because Apple screws with us on this # need to get bintools from homebrew -# need to get gzip from homebrew (it's in dupes) ifdef MACOSX CC=clang CXX=clang OBJCOPY=gobjcopy OBJDUMP=gobjdump - GZIP=/usr/local/bin/gzip endif OBJDUMP_OPTS?=--wide --source --line-numbers From f94d3a1fb0a407f31c35854f370883a6bceaf361 Mon Sep 17 00:00:00 2001 From: Hank Brannock Date: Sun, 22 May 2016 22:38:16 -0400 Subject: [PATCH 013/150] The code in i_net.c doesn't actually seem to be used in SRB2. I was able to compile a build without it, and hosting and joining netgames worked just fine (well, as fine as they can with the current state of the netcode...). Do we really need to keep it around? If not, I say get rid of it. It seems like useless clutter that is just going to confuse people who are trying to understand the source code. --- src/Makefile.cfg | 1 - src/d_net.c | 2 +- src/i_net.h | 3 - src/sdl/Srb2SDL-vc10.vcxproj | 1 - src/sdl/Srb2SDL-vc10.vcxproj.filters | 3 - src/sdl/i_net.c | 442 --------------------------- src/sdl12/i_net.c | 442 --------------------------- 7 files changed, 1 insertion(+), 893 deletions(-) delete mode 100644 src/sdl/i_net.c delete mode 100644 src/sdl12/i_net.c diff --git a/src/Makefile.cfg b/src/Makefile.cfg index fa8896a7c..5fdea8474 100644 --- a/src/Makefile.cfg +++ b/src/Makefile.cfg @@ -207,7 +207,6 @@ endif #determine the interface directory (where you put all i_*.c) i_cdmus_o=$(OBJDIR)/i_cdmus.o -i_net_o=$(OBJDIR)/i_net.o i_system_o=$(OBJDIR)/i_system.o i_sound_o=$(OBJDIR)/i_sound.o i_main_o=$(OBJDIR)/i_main.o diff --git a/src/d_net.c b/src/d_net.c index 03e126b50..4b6678c23 100644 --- a/src/d_net.c +++ b/src/d_net.c @@ -1080,7 +1080,7 @@ boolean D_CheckNetGame(void) multiplayer = false; // only dos version with external driver will return true - netgame = I_InitNetwork(); + netgame = false; // I_InitNetwork() is no longer used if (!netgame && !I_NetOpenSocket) { D_SetDoomcom(); diff --git a/src/i_net.h b/src/i_net.h index e378f5723..ae4697015 100644 --- a/src/i_net.h +++ b/src/i_net.h @@ -148,7 +148,4 @@ extern const char *(*I_GetBanMask) (size_t ban); extern boolean (*I_SetBanAddress) (const char *address,const char *mask); extern boolean *bannednode; -/// \brief Called by D_SRB2Main to be defined by extern network driver -boolean I_InitNetwork(void); - #endif diff --git a/src/sdl/Srb2SDL-vc10.vcxproj b/src/sdl/Srb2SDL-vc10.vcxproj index 452b47ed1..5dc01cfd9 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj +++ b/src/sdl/Srb2SDL-vc10.vcxproj @@ -398,7 +398,6 @@ - diff --git a/src/sdl/Srb2SDL-vc10.vcxproj.filters b/src/sdl/Srb2SDL-vc10.vcxproj.filters index 9396b4823..b037140e5 100644 --- a/src/sdl/Srb2SDL-vc10.vcxproj.filters +++ b/src/sdl/Srb2SDL-vc10.vcxproj.filters @@ -837,9 +837,6 @@ SDLApp - - SDLApp - SDLApp diff --git a/src/sdl/i_net.c b/src/sdl/i_net.c deleted file mode 100644 index ee4a34c13..000000000 --- a/src/sdl/i_net.c +++ /dev/null @@ -1,442 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL network interface - -#include "../doomdef.h" - -#include "../i_system.h" -#include "../d_event.h" -#include "../d_net.h" -#include "../m_argv.h" - -#include "../doomstat.h" - -#include "../i_net.h" - -#include "../z_zone.h" - -#include "../i_tcp.h" - -#ifdef HAVE_SDL - -#ifdef HAVE_SDLNET - -#include "SDL_net.h" - -#define MAXBANS 20 - -static IPaddress clientaddress[MAXNETNODES+1]; -static IPaddress banned[MAXBANS]; - -static UDPpacket mypacket; -static UDPsocket mysocket = NULL; -static SDLNet_SocketSet myset = NULL; - -static size_t numbans = 0; -static boolean NET_bannednode[MAXNETNODES+1]; /// \note do we really need the +1? -static boolean init_SDLNet_driver = false; - -static const char *NET_AddrToStr(IPaddress* sk) -{ - static char s[22]; // 255.255.255.255:65535 - strcpy(s, SDLNet_ResolveIP(sk)); - if (sk->port != 0) strcat(s, va(":%d", sk->port)); - return s; -} - -static const char *NET_GetNodeAddress(INT32 node) -{ - if (!nodeconnected[node]) - return NULL; - return NET_AddrToStr(&clientaddress[node]); -} - -static const char *NET_GetBanAddress(size_t ban) -{ - if (ban > numbans) - return NULL; - return NET_AddrToStr(&banned[ban]); -} - -static boolean NET_cmpaddr(IPaddress* a, IPaddress* b) -{ - return (a->host == b->host && (b->port == 0 || a->port == b->port)); -} - -static boolean NET_CanGet(void) -{ - return myset?(SDLNet_CheckSockets(myset,0) == 1):false; -} - -static void NET_Get(void) -{ - INT32 mystatus; - INT32 newnode; - mypacket.len = MAXPACKETLENGTH; - if (!NET_CanGet()) - { - doomcom->remotenode = -1; // no packet - return; - } - mystatus = SDLNet_UDP_Recv(mysocket,&mypacket); - if (mystatus != -1) - { - if (mypacket.channel != -1) - { - doomcom->remotenode = mypacket.channel+1; // good packet from a game player - doomcom->datalength = mypacket.len; - return; - } - newnode = SDLNet_UDP_Bind(mysocket,-1,&mypacket.address); - if (newnode != -1) - { - size_t i; - newnode++; - M_Memcpy(&clientaddress[newnode], &mypacket.address, sizeof (IPaddress)); - DEBFILE(va("New node detected: node:%d address:%s\n", newnode, - NET_GetNodeAddress(newnode))); - doomcom->remotenode = newnode; // good packet from a game player - doomcom->datalength = mypacket.len; - for (i = 0; i < numbans; i++) - { - if (NET_cmpaddr(&mypacket.address, &banned[i])) - { - DEBFILE("This dude has been banned\n"); - NET_bannednode[newnode] = true; - break; - } - } - if (i == numbans) - NET_bannednode[newnode] = false; - return; - } - else - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } - else if (mystatus == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } - - DEBFILE("New node detected: No more free slots\n"); - doomcom->remotenode = -1; // no packet -} - -#if 0 -static boolean NET_CanSend(void) -{ - return true; -} -#endif - -static void NET_Send(void) -{ - if (!doomcom->remotenode) - return; - mypacket.len = doomcom->datalength; - if (SDLNet_UDP_Send(mysocket,doomcom->remotenode-1,&mypacket) == 0) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } -} - -static void NET_FreeNodenum(INT32 numnode) -{ - // can't disconnect from self :) - if (!numnode) - return; - - DEBFILE(va("Free node %d (%s)\n", numnode, NET_GetNodeAddress(numnode))); - - SDLNet_UDP_Unbind(mysocket,numnode-1); - - memset(&clientaddress[numnode], 0, sizeof (IPaddress)); -} - -static UDPsocket NET_Socket(void) -{ - UDPsocket temp = NULL; - Uint16 portnum = 0; - IPaddress tempip = {INADDR_BROADCAST,0}; - //Hurdler: I'd like to put a server and a client on the same computer - //Logan: Me too - //BP: in fact for client we can use any free port we want i have read - // in some doc that connect in udp can do it for us... - //Alam: where? - if (M_CheckParm("-clientport")) - { - if (!M_IsNextParm()) - I_Error("syntax: -clientport "); - portnum = atoi(M_GetNextParm()); - } - else - portnum = sock_port; - temp = SDLNet_UDP_Open(portnum); - if (!temp) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return NULL; - } - if (SDLNet_UDP_Bind(temp,BROADCASTADDR-1,&tempip) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - SDLNet_UDP_Close(temp); - return NULL; - } - clientaddress[BROADCASTADDR].port = sock_port; - clientaddress[BROADCASTADDR].host = INADDR_BROADCAST; - - doomcom->extratics = 1; // internet is very high ping - - return temp; -} - -static void I_ShutdownSDLNetDriver(void) -{ - if (myset) SDLNet_FreeSocketSet(myset); - myset = NULL; - SDLNet_Quit(); - init_SDLNet_driver = false; -} - -static void I_InitSDLNetDriver(void) -{ - if (init_SDLNet_driver) - I_ShutdownSDLNetDriver(); - if (SDLNet_Init() == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return; // No good! - } - D_SetDoomcom(); - mypacket.data = doomcom->data; - init_SDLNet_driver = true; -} - -static void NET_CloseSocket(void) -{ - if (mysocket) - SDLNet_UDP_Close(mysocket); - mysocket = NULL; -} - -static SINT8 NET_NetMakeNodewPort(const char *hostname, const char *port) -{ - INT32 newnode; - UINT16 portnum = sock_port; - IPaddress hostnameIP; - - // retrieve portnum from address! - if (port && !port[0]) - portnum = atoi(port); - - if (SDLNet_ResolveHost(&hostnameIP,hostname,portnum) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return -1; - } - newnode = SDLNet_UDP_Bind(mysocket,-1,&hostnameIP); - if (newnode == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return newnode; - } - newnode++; - M_Memcpy(&clientaddress[newnode],&hostnameIP,sizeof (IPaddress)); - return (SINT8)newnode; -} - - -static boolean NET_OpenSocket(void) -{ - memset(clientaddress, 0, sizeof (clientaddress)); - - //I_OutputMsg("SDL_Net Code starting up\n"); - - I_NetSend = NET_Send; - I_NetGet = NET_Get; - I_NetCloseSocket = NET_CloseSocket; - I_NetFreeNodenum = NET_FreeNodenum; - I_NetMakeNodewPort = NET_NetMakeNodewPort; - - //I_NetCanSend = NET_CanSend; - - // build the socket but close it first - NET_CloseSocket(); - mysocket = NET_Socket(); - - if (!mysocket) - return false; - - // for select - myset = SDLNet_AllocSocketSet(1); - if (!myset) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return false; - } - if (SDLNet_UDP_AddSocket(myset,mysocket) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return false; - } - return true; -} - -static boolean NET_Ban(INT32 node) -{ - if (numbans == MAXBANS) - return false; - - M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress)); - banned[numbans].port = 0; - numbans++; - return true; -} - -static boolean NET_SetBanAddress(const char *address, const char *mask) -{ - (void)mask; - if (bans == MAXBANS) - return false; - - if (SDLNet_ResolveHost(&banned[numbans], address, 0) == -1) - return false; - numbans++; - return true; -} - -static void NET_ClearBans(void) -{ - numbans = 0; -} -#endif - -// -// I_InitNetwork -// Only required for DOS, so this is more a dummy -// -boolean I_InitNetwork(void) -{ -#ifdef HAVE_SDLNET - char serverhostname[255]; - boolean ret = false; - SDL_version SDLcompiled; - const SDL_version *SDLlinked = SDLNet_Linked_Version(); - SDL_NET_VERSION(&SDLcompiled) - I_OutputMsg("Compiled for SDL_Net version: %d.%d.%d\n", - SDLcompiled.major, SDLcompiled.minor, SDLcompiled.patch); - I_OutputMsg("Linked with SDL_Net version: %d.%d.%d\n", - SDLlinked->major, SDLlinked->minor, SDLlinked->patch); - //if (!M_CheckParm ("-sdlnet")) - // return false; - // initilize the driver - I_InitSDLNetDriver(); - I_AddExitFunc(I_ShutdownSDLNetDriver); - if (!init_SDLNet_driver) - return false; - - if (M_CheckParm("-udpport")) - { - if (M_IsNextParm()) - sock_port = (UINT16)atoi(M_GetNextParm()); - else - sock_port = 0; - } - - // parse network game options, - if (M_CheckParm("-server") || dedicated) - { - server = true; - - // If a number of clients (i.e. nodes) is specified, the server will wait for the clients - // to connect before starting. - // If no number is specified here, the server starts with 1 client, and others can join - // in-game. - // Since Boris has implemented join in-game, there is no actual need for specifying a - // particular number here. - // FIXME: for dedicated server, numnodes needs to be set to 0 upon start -/* if (M_IsNextParm()) - doomcom->numnodes = (INT16)atoi(M_GetNextParm()); - else */if (dedicated) - doomcom->numnodes = 0; - else - doomcom->numnodes = 1; - - if (doomcom->numnodes < 0) - doomcom->numnodes = 0; - if (doomcom->numnodes > MAXNETNODES) - doomcom->numnodes = MAXNETNODES; - - // server - servernode = 0; - // FIXME: - // ??? and now ? - // server on a big modem ??? 4*isdn - net_bandwidth = 16000; - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - - ret = true; - } - else if (M_CheckParm("-connect")) - { - if (M_IsNextParm()) - strcpy(serverhostname, M_GetNextParm()); - else - serverhostname[0] = 0; // assuming server in the LAN, use broadcast to detect it - - // server address only in ip - if (serverhostname[0]) - { - COM_BufAddText("connect \""); - COM_BufAddText(serverhostname); - COM_BufAddText("\"\n"); - - // probably modem - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - } - else - { - // so we're on a LAN - COM_BufAddText("connect any\n"); - - net_bandwidth = 800000; - hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; - } - } - - mypacket.maxlen = hardware_MAXPACKETLENGTH; - I_NetOpenSocket = NET_OpenSocket; - I_Ban = NET_Ban; - I_ClearBans = NET_ClearBans; - I_GetNodeAddress = NET_GetNodeAddress; - I_GetBenAddress = NET_GetBenAddress; - I_SetBanAddress = NET_SetBanAddress; - bannednode = NET_bannednode; - - return ret; -#else - if ( M_CheckParm ("-net") ) - { - I_Error("-net not supported, use -server and -connect\n" - "see docs for more\n"); - } - return false; -#endif -} -#endif diff --git a/src/sdl12/i_net.c b/src/sdl12/i_net.c deleted file mode 100644 index ee4a34c13..000000000 --- a/src/sdl12/i_net.c +++ /dev/null @@ -1,442 +0,0 @@ -// Emacs style mode select -*- C++ -*- -//----------------------------------------------------------------------------- -// -// Copyright (C) 1993-1996 by id Software, Inc. -// Portions Copyright (C) 1998-2000 by DooM Legacy Team. -// -// This program is free software; you can redistribute it and/or -// modify it under the terms of the GNU General Public License -// as published by the Free Software Foundation; either version 2 -// of the License, or (at your option) any later version. -// -// This program is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -// GNU General Public License for more details. -//----------------------------------------------------------------------------- -/// \file -/// \brief SDL network interface - -#include "../doomdef.h" - -#include "../i_system.h" -#include "../d_event.h" -#include "../d_net.h" -#include "../m_argv.h" - -#include "../doomstat.h" - -#include "../i_net.h" - -#include "../z_zone.h" - -#include "../i_tcp.h" - -#ifdef HAVE_SDL - -#ifdef HAVE_SDLNET - -#include "SDL_net.h" - -#define MAXBANS 20 - -static IPaddress clientaddress[MAXNETNODES+1]; -static IPaddress banned[MAXBANS]; - -static UDPpacket mypacket; -static UDPsocket mysocket = NULL; -static SDLNet_SocketSet myset = NULL; - -static size_t numbans = 0; -static boolean NET_bannednode[MAXNETNODES+1]; /// \note do we really need the +1? -static boolean init_SDLNet_driver = false; - -static const char *NET_AddrToStr(IPaddress* sk) -{ - static char s[22]; // 255.255.255.255:65535 - strcpy(s, SDLNet_ResolveIP(sk)); - if (sk->port != 0) strcat(s, va(":%d", sk->port)); - return s; -} - -static const char *NET_GetNodeAddress(INT32 node) -{ - if (!nodeconnected[node]) - return NULL; - return NET_AddrToStr(&clientaddress[node]); -} - -static const char *NET_GetBanAddress(size_t ban) -{ - if (ban > numbans) - return NULL; - return NET_AddrToStr(&banned[ban]); -} - -static boolean NET_cmpaddr(IPaddress* a, IPaddress* b) -{ - return (a->host == b->host && (b->port == 0 || a->port == b->port)); -} - -static boolean NET_CanGet(void) -{ - return myset?(SDLNet_CheckSockets(myset,0) == 1):false; -} - -static void NET_Get(void) -{ - INT32 mystatus; - INT32 newnode; - mypacket.len = MAXPACKETLENGTH; - if (!NET_CanGet()) - { - doomcom->remotenode = -1; // no packet - return; - } - mystatus = SDLNet_UDP_Recv(mysocket,&mypacket); - if (mystatus != -1) - { - if (mypacket.channel != -1) - { - doomcom->remotenode = mypacket.channel+1; // good packet from a game player - doomcom->datalength = mypacket.len; - return; - } - newnode = SDLNet_UDP_Bind(mysocket,-1,&mypacket.address); - if (newnode != -1) - { - size_t i; - newnode++; - M_Memcpy(&clientaddress[newnode], &mypacket.address, sizeof (IPaddress)); - DEBFILE(va("New node detected: node:%d address:%s\n", newnode, - NET_GetNodeAddress(newnode))); - doomcom->remotenode = newnode; // good packet from a game player - doomcom->datalength = mypacket.len; - for (i = 0; i < numbans; i++) - { - if (NET_cmpaddr(&mypacket.address, &banned[i])) - { - DEBFILE("This dude has been banned\n"); - NET_bannednode[newnode] = true; - break; - } - } - if (i == numbans) - NET_bannednode[newnode] = false; - return; - } - else - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } - else if (mystatus == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } - - DEBFILE("New node detected: No more free slots\n"); - doomcom->remotenode = -1; // no packet -} - -#if 0 -static boolean NET_CanSend(void) -{ - return true; -} -#endif - -static void NET_Send(void) -{ - if (!doomcom->remotenode) - return; - mypacket.len = doomcom->datalength; - if (SDLNet_UDP_Send(mysocket,doomcom->remotenode-1,&mypacket) == 0) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - } -} - -static void NET_FreeNodenum(INT32 numnode) -{ - // can't disconnect from self :) - if (!numnode) - return; - - DEBFILE(va("Free node %d (%s)\n", numnode, NET_GetNodeAddress(numnode))); - - SDLNet_UDP_Unbind(mysocket,numnode-1); - - memset(&clientaddress[numnode], 0, sizeof (IPaddress)); -} - -static UDPsocket NET_Socket(void) -{ - UDPsocket temp = NULL; - Uint16 portnum = 0; - IPaddress tempip = {INADDR_BROADCAST,0}; - //Hurdler: I'd like to put a server and a client on the same computer - //Logan: Me too - //BP: in fact for client we can use any free port we want i have read - // in some doc that connect in udp can do it for us... - //Alam: where? - if (M_CheckParm("-clientport")) - { - if (!M_IsNextParm()) - I_Error("syntax: -clientport "); - portnum = atoi(M_GetNextParm()); - } - else - portnum = sock_port; - temp = SDLNet_UDP_Open(portnum); - if (!temp) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return NULL; - } - if (SDLNet_UDP_Bind(temp,BROADCASTADDR-1,&tempip) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - SDLNet_UDP_Close(temp); - return NULL; - } - clientaddress[BROADCASTADDR].port = sock_port; - clientaddress[BROADCASTADDR].host = INADDR_BROADCAST; - - doomcom->extratics = 1; // internet is very high ping - - return temp; -} - -static void I_ShutdownSDLNetDriver(void) -{ - if (myset) SDLNet_FreeSocketSet(myset); - myset = NULL; - SDLNet_Quit(); - init_SDLNet_driver = false; -} - -static void I_InitSDLNetDriver(void) -{ - if (init_SDLNet_driver) - I_ShutdownSDLNetDriver(); - if (SDLNet_Init() == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return; // No good! - } - D_SetDoomcom(); - mypacket.data = doomcom->data; - init_SDLNet_driver = true; -} - -static void NET_CloseSocket(void) -{ - if (mysocket) - SDLNet_UDP_Close(mysocket); - mysocket = NULL; -} - -static SINT8 NET_NetMakeNodewPort(const char *hostname, const char *port) -{ - INT32 newnode; - UINT16 portnum = sock_port; - IPaddress hostnameIP; - - // retrieve portnum from address! - if (port && !port[0]) - portnum = atoi(port); - - if (SDLNet_ResolveHost(&hostnameIP,hostname,portnum) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return -1; - } - newnode = SDLNet_UDP_Bind(mysocket,-1,&hostnameIP); - if (newnode == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return newnode; - } - newnode++; - M_Memcpy(&clientaddress[newnode],&hostnameIP,sizeof (IPaddress)); - return (SINT8)newnode; -} - - -static boolean NET_OpenSocket(void) -{ - memset(clientaddress, 0, sizeof (clientaddress)); - - //I_OutputMsg("SDL_Net Code starting up\n"); - - I_NetSend = NET_Send; - I_NetGet = NET_Get; - I_NetCloseSocket = NET_CloseSocket; - I_NetFreeNodenum = NET_FreeNodenum; - I_NetMakeNodewPort = NET_NetMakeNodewPort; - - //I_NetCanSend = NET_CanSend; - - // build the socket but close it first - NET_CloseSocket(); - mysocket = NET_Socket(); - - if (!mysocket) - return false; - - // for select - myset = SDLNet_AllocSocketSet(1); - if (!myset) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return false; - } - if (SDLNet_UDP_AddSocket(myset,mysocket) == -1) - { - I_OutputMsg("SDL_Net: %s",SDLNet_GetError()); - return false; - } - return true; -} - -static boolean NET_Ban(INT32 node) -{ - if (numbans == MAXBANS) - return false; - - M_Memcpy(&banned[numbans], &clientaddress[node], sizeof (IPaddress)); - banned[numbans].port = 0; - numbans++; - return true; -} - -static boolean NET_SetBanAddress(const char *address, const char *mask) -{ - (void)mask; - if (bans == MAXBANS) - return false; - - if (SDLNet_ResolveHost(&banned[numbans], address, 0) == -1) - return false; - numbans++; - return true; -} - -static void NET_ClearBans(void) -{ - numbans = 0; -} -#endif - -// -// I_InitNetwork -// Only required for DOS, so this is more a dummy -// -boolean I_InitNetwork(void) -{ -#ifdef HAVE_SDLNET - char serverhostname[255]; - boolean ret = false; - SDL_version SDLcompiled; - const SDL_version *SDLlinked = SDLNet_Linked_Version(); - SDL_NET_VERSION(&SDLcompiled) - I_OutputMsg("Compiled for SDL_Net version: %d.%d.%d\n", - SDLcompiled.major, SDLcompiled.minor, SDLcompiled.patch); - I_OutputMsg("Linked with SDL_Net version: %d.%d.%d\n", - SDLlinked->major, SDLlinked->minor, SDLlinked->patch); - //if (!M_CheckParm ("-sdlnet")) - // return false; - // initilize the driver - I_InitSDLNetDriver(); - I_AddExitFunc(I_ShutdownSDLNetDriver); - if (!init_SDLNet_driver) - return false; - - if (M_CheckParm("-udpport")) - { - if (M_IsNextParm()) - sock_port = (UINT16)atoi(M_GetNextParm()); - else - sock_port = 0; - } - - // parse network game options, - if (M_CheckParm("-server") || dedicated) - { - server = true; - - // If a number of clients (i.e. nodes) is specified, the server will wait for the clients - // to connect before starting. - // If no number is specified here, the server starts with 1 client, and others can join - // in-game. - // Since Boris has implemented join in-game, there is no actual need for specifying a - // particular number here. - // FIXME: for dedicated server, numnodes needs to be set to 0 upon start -/* if (M_IsNextParm()) - doomcom->numnodes = (INT16)atoi(M_GetNextParm()); - else */if (dedicated) - doomcom->numnodes = 0; - else - doomcom->numnodes = 1; - - if (doomcom->numnodes < 0) - doomcom->numnodes = 0; - if (doomcom->numnodes > MAXNETNODES) - doomcom->numnodes = MAXNETNODES; - - // server - servernode = 0; - // FIXME: - // ??? and now ? - // server on a big modem ??? 4*isdn - net_bandwidth = 16000; - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - - ret = true; - } - else if (M_CheckParm("-connect")) - { - if (M_IsNextParm()) - strcpy(serverhostname, M_GetNextParm()); - else - serverhostname[0] = 0; // assuming server in the LAN, use broadcast to detect it - - // server address only in ip - if (serverhostname[0]) - { - COM_BufAddText("connect \""); - COM_BufAddText(serverhostname); - COM_BufAddText("\"\n"); - - // probably modem - hardware_MAXPACKETLENGTH = INETPACKETLENGTH; - } - else - { - // so we're on a LAN - COM_BufAddText("connect any\n"); - - net_bandwidth = 800000; - hardware_MAXPACKETLENGTH = MAXPACKETLENGTH; - } - } - - mypacket.maxlen = hardware_MAXPACKETLENGTH; - I_NetOpenSocket = NET_OpenSocket; - I_Ban = NET_Ban; - I_ClearBans = NET_ClearBans; - I_GetNodeAddress = NET_GetNodeAddress; - I_GetBenAddress = NET_GetBenAddress; - I_SetBanAddress = NET_SetBanAddress; - bannednode = NET_bannednode; - - return ret; -#else - if ( M_CheckParm ("-net") ) - { - I_Error("-net not supported, use -server and -connect\n" - "see docs for more\n"); - } - return false; -#endif -} -#endif From 390927cc3228dc734b6f09c789eb61630a62cb9b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 14:14:04 -0400 Subject: [PATCH 014/150] Makefile: compile debug build with -Og on GCC 4.8 and higher --- src/Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index f43e3c24d..f7a8c1b85 100644 --- a/src/Makefile +++ b/src/Makefile @@ -366,7 +366,12 @@ ifdef DEBUGMODE # build with debugging information WINDRESFLAGS = -D_DEBUG - CFLAGS+=-O0 -Wall -DPARANOIA -DRANGECHECK +ifdef GCC48 + CFLAGS+=-Og +else + CFLAGS+=-O0 +endif + CFLAGS+= -Wall -DPARANOIA -DRANGECHECK else From d1aab2e41860b428af4b37ad34341c4cdd2a8af8 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 14:22:02 -0400 Subject: [PATCH 015/150] gcc: clear uninitialized warnings in am_map.c --- src/am_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/am_map.c b/src/am_map.c index 90f815729..b28cecf11 100644 --- a/src/am_map.c +++ b/src/am_map.c @@ -999,7 +999,7 @@ static inline void AM_drawWalls(void) static mline_t l; #ifdef ESLOPE fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends - fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends + fixed_t backf1 = 0, backf2 = 0, backc1 = 0, backc2 = 0; // back floor ceiling ends #endif for (i = 0; i < numlines; i++) From dac8da80b9a4af8fca126cd00acc3074c451ea6e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 18:36:16 -0400 Subject: [PATCH 016/150] travis: try out build matrix --- .travis.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index f1996215b..8eed66572 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,16 +2,16 @@ language: c sudo: required dist: trusty -env: -- CFLAGS=-Wall -W -Werror - -os: - - linux - - osx - -compiler: - - gcc - - clang +matrix: + include: + - os: linux + env: CC=gcc + - os: linux + env: CC=clang + - os: osx + env: CC=gcc + - os: osx + env: CC=clang cache: apt: true @@ -34,6 +34,7 @@ before_script: - mkdir build - cd build - cmake .. + - set CFLAGS=-Wall -W -Werror before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi From 06021c3427355ac02e39d7a85d552d7b0ed21521 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 18:38:09 -0400 Subject: [PATCH 017/150] travis: fixup spacing --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8eed66572..c4025a089 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,13 @@ dist: trusty matrix: include: - os: linux - env: CC=gcc + env: CC=gcc - os: linux - env: CC=clang + env: CC=clang - os: osx - env: CC=gcc + env: CC=gcc - os: osx - env: CC=clang + env: CC=clang cache: apt: true From 6ff86c2a64c2b1a605b641353ad1dde5943cd708 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 18:44:48 -0400 Subject: [PATCH 018/150] travis: see if compiler works in build matrix --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index c4025a089..10157cc1d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,13 +5,13 @@ dist: trusty matrix: include: - os: linux - env: CC=gcc + compiler: gcc - os: linux - env: CC=clang + compiler: clang - os: osx - env: CC=gcc + compiler: gcc - os: osx - env: CC=clang + compiler: clang cache: apt: true From b2713cef767ec60b511db0bfef9284248281bf2b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 21:12:46 -0400 Subject: [PATCH 019/150] travis-ci: add all the xcode versions --- .travis.yml | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/.travis.yml b/.travis.yml index 10157cc1d..3d09c7b62 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,8 +9,52 @@ matrix: - os: linux compiler: clang - os: osx + osx_image: beta-xcode6.1 compiler: gcc - os: osx + osx_image: beta-xcode6.1 + compiler: clang + - os: osx + osx_image: beta-xcode6.2 + compiler: gcc + - os: osx + osx_image: beta-xcode6.2 + compiler: clang + - os: osx + osx_image: beta-xcode6.3 + compiler: gcc + - os: osx + osx_image: beta-xcode6.3 + compiler: clang + - os: osx + osx_image: xcode6.4 + compiler: gcc + - os: osx + osx_image: xcode6.4 + compiler: clang + - os: osx + osx_image: xcode7 + compiler: gcc + - os: osx + osx_image: xcode7 + compiler: clang + - os: osx + osx_image: xcode7.1 + compiler: gcc + - os: osx + osx_image: xcode7.1 + compiler: clang + - os: osx + osx_image: xcode7.2 + compiler: gcc + - os: osx + osx_image: xcode7.2 + compiler: clang + - os: osx + osx_image: xcode7.3 + compiler: gcc + - os: osx + osx_image: xcode7.3 compiler: clang cache: From 80985e9d852d32e056ac4aa6db34192ac6f2fc43 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 22:24:02 -0400 Subject: [PATCH 020/150] travis: build iwth all the gcc packages? --- .travis.yml | 123 ++++++++++++++++++++++++++++++++++------------------ 1 file changed, 80 insertions(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d09c7b62..291d2fc3f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,42 @@ matrix: include: - os: linux compiler: gcc + - os: linux + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.8 + env: CC=gcc-4.8 + - os: linux + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-4.9 + env: CC=gcc-4.9 + - os: linux + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-5 + env: CC=gcc-5 + - os: linux + compiler: gcc + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-6 + env: CC=gcc-6 - os: linux compiler: clang - os: osx @@ -14,48 +50,48 @@ matrix: - os: osx osx_image: beta-xcode6.1 compiler: clang - - os: osx - osx_image: beta-xcode6.2 - compiler: gcc - - os: osx - osx_image: beta-xcode6.2 - compiler: clang - - os: osx - osx_image: beta-xcode6.3 - compiler: gcc - - os: osx - osx_image: beta-xcode6.3 - compiler: clang - - os: osx - osx_image: xcode6.4 - compiler: gcc - - os: osx - osx_image: xcode6.4 - compiler: clang - - os: osx - osx_image: xcode7 - compiler: gcc - - os: osx - osx_image: xcode7 - compiler: clang - - os: osx - osx_image: xcode7.1 - compiler: gcc - - os: osx - osx_image: xcode7.1 - compiler: clang - - os: osx - osx_image: xcode7.2 - compiler: gcc - - os: osx - osx_image: xcode7.2 - compiler: clang - - os: osx - osx_image: xcode7.3 - compiler: gcc - - os: osx - osx_image: xcode7.3 - compiler: clang +# - os: osx +# osx_image: beta-xcode6.2 +# compiler: gcc +# - os: osx +# osx_image: beta-xcode6.2 +# compiler: clang# +# - os: osx +# osx_image: beta-xcode6.3 +# compiler: gcc +# - os: osx +# osx_image: beta-xcode6.3 +# compiler: clang +# - os: osx +# osx_image: xcode6.4 +# compiler: gcc +# - os: osx +# osx_image: xcode6.4 +# compiler: clang +# - os: osx +# osx_image: xcode7 +# compiler: gcc +# - os: osx +# osx_image: xcode7 +# compiler: clang +# - os: osx +# osx_image: xcode7.1 +# compiler: gcc +# - os: osx +# osx_image: xcode7.1 +# compiler: clang +# - os: osx +# osx_image: xcode7.2 +# compiler: gcc +# - os: osx +# osx_image: xcode7.2 +# compiler: clang +# - os: osx +# osx_image: xcode7.3 +# compiler: gcc +# - os: osx +# osx_image: xcode7.3 +# compiler: clang cache: apt: true @@ -73,6 +109,7 @@ addons: - p7zip-full before_script: + - $CC --version - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build @@ -82,7 +119,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 brew install sdl2_mixer game-music-emu p7zip cmake; 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 - mkdir -p $HOME/srb2_cache From 3efdb9907c0496b3c6a637efed9d46d7ec98b399 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 22:46:09 -0400 Subject: [PATCH 021/150] travis-ci: add packages in all gcc builds --- .travis.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.travis.yml b/.travis.yml index 291d2fc3f..02d9eaea7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,6 +15,11 @@ matrix: packages: - gcc-4.8 env: CC=gcc-4.8 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full - os: linux compiler: gcc addons: @@ -24,6 +29,11 @@ matrix: packages: - gcc-4.9 env: CC=gcc-4.9 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full - os: linux compiler: gcc addons: @@ -33,6 +43,11 @@ matrix: packages: - gcc-5 env: CC=gcc-5 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full - os: linux compiler: gcc addons: @@ -41,6 +56,11 @@ matrix: - ubuntu-toolchain-r-test packages: - gcc-6 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full env: CC=gcc-6 - os: linux compiler: clang From f4bde57789d9d5f14075933732678e75aa5e44e1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 22:47:35 -0400 Subject: [PATCH 022/150] travis-ci: copy and paste issue --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 02d9eaea7..99df739d3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -14,12 +14,12 @@ matrix: - ubuntu-toolchain-r-test packages: - gcc-4.8 - env: CC=gcc-4.8 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + env: CC=gcc-4.8 - os: linux compiler: gcc addons: @@ -28,12 +28,12 @@ matrix: - ubuntu-toolchain-r-test packages: - gcc-4.9 - env: CC=gcc-4.9 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + env: CC=gcc-4.9 - os: linux compiler: gcc addons: @@ -42,12 +42,12 @@ matrix: - ubuntu-toolchain-r-test packages: - gcc-5 - env: CC=gcc-5 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + env: CC=gcc-5 - os: linux compiler: gcc addons: @@ -72,7 +72,7 @@ matrix: compiler: clang # - os: osx # osx_image: beta-xcode6.2 -# compiler: gcc +# compiler: gcc # - os: osx # osx_image: beta-xcode6.2 # compiler: clang# From e3c6ee14a89382f874f3e9977d0b3d9d3a9b529d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 22:54:25 -0400 Subject: [PATCH 023/150] travis-ci: fixup env setting --- .travis.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 99df739d3..2ac260118 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-4.8 + env: CC=gcc-4.8 - os: linux compiler: gcc addons: @@ -33,7 +33,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-4.9 + env: CC=gcc-4.9 - os: linux compiler: gcc addons: @@ -47,7 +47,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-5 + env: CC=gcc-5 - os: linux compiler: gcc addons: @@ -61,7 +61,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-6 + env: CC=gcc-6 - os: linux compiler: clang - os: osx From 590a749deda49e7372ba115a490e1042f3984573 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 23:06:59 -0400 Subject: [PATCH 024/150] travis-ci: can not use $CC, let use $GCC --- .travis.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2ac260118..0955f4830 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-4.8 + env: GCC=gcc-4.8 - os: linux compiler: gcc addons: @@ -33,7 +33,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-4.9 + env: GCC=gcc-4.9 - os: linux compiler: gcc addons: @@ -47,7 +47,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-5 + env: GCC=gcc-5 - os: linux compiler: gcc addons: @@ -61,15 +61,15 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: CC=gcc-6 + env: GCC=gcc-6 - os: linux compiler: clang - - os: osx - osx_image: beta-xcode6.1 - compiler: gcc - - os: osx - osx_image: beta-xcode6.1 - compiler: clang +# - os: osx +# osx_image: beta-xcode6.1 +# compiler: gcc +# - os: osx +# osx_image: beta-xcode6.1 +# compiler: clang # - os: osx # osx_image: beta-xcode6.2 # compiler: gcc @@ -114,7 +114,7 @@ matrix: # compiler: clang cache: - apt: true + apt: true ccache: true directories: - $HOME/srb2_cache @@ -129,6 +129,7 @@ addons: - p7zip-full before_script: + - set CC=$GCC - $CC --version - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets From 30d02affa485373dca15590a30bc6839f686e821 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 23:18:52 -0400 Subject: [PATCH 025/150] travis-ci: let use export, not set --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 0955f4830..b3e39988e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,7 +129,7 @@ addons: - p7zip-full before_script: - - set CC=$GCC + - export CC=$GCC - $CC --version - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets From 42dffcb6f3d54012cdc7d9722939b7763482e910 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Fri, 27 May 2016 23:40:23 -0400 Subject: [PATCH 026/150] travis-ci: test for _CC --- .travis.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index b3e39988e..7448702b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,7 +19,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: GCC=gcc-4.8 + env: _CC=gcc-4.8 - os: linux compiler: gcc addons: @@ -33,7 +33,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: GCC=gcc-4.9 + env: _CC=gcc-4.9 - os: linux compiler: gcc addons: @@ -47,7 +47,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: GCC=gcc-5 + env: _CC=gcc-5 - os: linux compiler: gcc addons: @@ -61,7 +61,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: GCC=gcc-6 + env: _CC=gcc-6 - os: linux compiler: clang # - os: osx @@ -129,8 +129,7 @@ addons: - p7zip-full before_script: - - export CC=$GCC - - $CC --version + - $_CC --version&&export CC=$_CC - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build From 327840092085fc91a3a4e50f659a7cbfc2583a11 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 00:01:22 -0400 Subject: [PATCH 027/150] travis-ci: add test for $_CC --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7448702b1..3a6f166c2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,7 +129,7 @@ addons: - p7zip-full before_script: - - $_CC --version&&export CC=$_CC + -if $_CC --version 2>/dev/null; then export CC=$_CC; fi - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build From 64e03c0f93698fb7b294e911cb134fa5a16ec17c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 00:23:27 -0400 Subject: [PATCH 028/150] travis-ci: clean up test --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 3a6f166c2..781a5b1de 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,7 +129,7 @@ addons: - p7zip-full before_script: - -if $_CC --version 2>/dev/null; then export CC=$_CC; fi + -if $_CC --version 2>/dev/null; then export CC=$_CC; fi; - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build From 439883b8c959c0f765759937a48fced176633408 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 00:33:44 -0400 Subject: [PATCH 029/150] travis-ci: spacing --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 781a5b1de..3d5830040 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,7 +129,7 @@ addons: - p7zip-full before_script: - -if $_CC --version 2>/dev/null; then export CC=$_CC; fi; + - if $_CC --version 2>/dev/null; then export CC=$_CC; fi; - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build From ffc92489bbd969cba666be44408cdff8f6ae92bb Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 00:53:14 -0400 Subject: [PATCH 030/150] travia-ci: compile all xcode --- .travis.yml | 96 ++++++++++++++++++++++++++--------------------------- 1 file changed, 48 insertions(+), 48 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3d5830040..d3c48b365 100644 --- a/.travis.yml +++ b/.travis.yml @@ -64,54 +64,54 @@ matrix: env: _CC=gcc-6 - os: linux compiler: clang -# - os: osx -# osx_image: beta-xcode6.1 -# compiler: gcc -# - os: osx -# osx_image: beta-xcode6.1 -# compiler: clang -# - os: osx -# osx_image: beta-xcode6.2 -# compiler: gcc -# - os: osx -# osx_image: beta-xcode6.2 -# compiler: clang# -# - os: osx -# osx_image: beta-xcode6.3 -# compiler: gcc -# - os: osx -# osx_image: beta-xcode6.3 -# compiler: clang -# - os: osx -# osx_image: xcode6.4 -# compiler: gcc -# - os: osx -# osx_image: xcode6.4 -# compiler: clang -# - os: osx -# osx_image: xcode7 -# compiler: gcc -# - os: osx -# osx_image: xcode7 -# compiler: clang -# - os: osx -# osx_image: xcode7.1 -# compiler: gcc -# - os: osx -# osx_image: xcode7.1 -# compiler: clang -# - os: osx -# osx_image: xcode7.2 -# compiler: gcc -# - os: osx -# osx_image: xcode7.2 -# compiler: clang -# - os: osx -# osx_image: xcode7.3 -# compiler: gcc -# - os: osx -# osx_image: xcode7.3 -# compiler: clang + - os: osx + osx_image: beta-xcode6.1 + compiler: gcc + - os: osx + osx_image: beta-xcode6.1 + compiler: clang + - os: osx + osx_image: beta-xcode6.2 + compiler: gcc + - os: osx + osx_image: beta-xcode6.2 + compiler: clang# + - os: osx + osx_image: beta-xcode6.3 + compiler: gcc + - os: osx + osx_image: beta-xcode6.3 + compiler: clang + - os: osx + osx_image: xcode6.4 + compiler: gcc + - os: osx + osx_image: xcode6.4 + compiler: clang + - os: osx + osx_image: xcode7 + compiler: gcc + - os: osx + osx_image: xcode7 + compiler: clang + - os: osx + osx_image: xcode7.1 + compiler: gcc + - os: osx + osx_image: xcode7.1 + compiler: clang + - os: osx + osx_image: xcode7.2 + compiler: gcc + - os: osx + osx_image: xcode7.2 + compiler: clang + - os: osx + osx_image: xcode7.3 + compiler: gcc + - os: osx + osx_image: xcode7.3 + compiler: clang cache: apt: true From 9d3f2890c3abc72e48e34013a4f7c6b9b91da00c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 01:12:24 -0400 Subject: [PATCH 031/150] travis-ci fixup space --- .travis.yml | 78 ++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/.travis.yml b/.travis.yml index d3c48b365..10e11b808 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,45 +73,45 @@ matrix: - os: osx osx_image: beta-xcode6.2 compiler: gcc - - os: osx - osx_image: beta-xcode6.2 - compiler: clang# - - os: osx - osx_image: beta-xcode6.3 - compiler: gcc - - os: osx - osx_image: beta-xcode6.3 - compiler: clang - - os: osx - osx_image: xcode6.4 - compiler: gcc - - os: osx - osx_image: xcode6.4 - compiler: clang - - os: osx - osx_image: xcode7 - compiler: gcc - - os: osx - osx_image: xcode7 - compiler: clang - - os: osx - osx_image: xcode7.1 - compiler: gcc - - os: osx - osx_image: xcode7.1 - compiler: clang - - os: osx - osx_image: xcode7.2 - compiler: gcc - - os: osx - osx_image: xcode7.2 - compiler: clang - - os: osx - osx_image: xcode7.3 - compiler: gcc - - os: osx - osx_image: xcode7.3 - compiler: clang + - os: osx + osx_image: beta-xcode6.2 + compiler: clang# + - os: osx + osx_image: beta-xcode6.3 + compiler: gcc + - os: osx + osx_image: beta-xcode6.3 + compiler: clang + - os: osx + osx_image: xcode6.4 + compiler: gcc + - os: osx + osx_image: xcode6.4 + compiler: clang + - os: osx + osx_image: xcode7 + compiler: gcc + - os: osx + osx_image: xcode7 + compiler: clang + - os: osx + osx_image: xcode7.1 + compiler: gcc + - os: osx + osx_image: xcode7.1 + compiler: clang + - os: osx + osx_image: xcode7.2 + compiler: gcc + - os: osx + osx_image: xcode7.2 + compiler: clang + - os: osx + osx_image: xcode7.3 + compiler: gcc + - os: osx + osx_image: xcode7.3 + compiler: clang cache: apt: true From 94485edcbb9ba003bce834eee40b282e1a19413a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 02:53:42 -0400 Subject: [PATCH 032/150] travis:-ci: install cmake on some OSX systems --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 10e11b808..a1ce25878 100644 --- a/.travis.yml +++ b/.travis.yml @@ -139,7 +139,8 @@ 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 cmake; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install sdl2_mixer game-music-emu p7zip; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew outdated cmake||brew install cmake; 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 - mkdir -p $HOME/srb2_cache From e7b15d5f95bf4aa313d3dd54b1d4b562a2bde203 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 03:22:59 -0400 Subject: [PATCH 033/150] travis-cl: fixup osx? --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index a1ce25878..fd7013960 100644 --- a/.travis.yml +++ b/.travis.yml @@ -140,7 +140,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 brew outdated cmake||brew install cmake; fi + - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install cmake||true; 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 - mkdir -p $HOME/srb2_cache From 0b1fc30d0ed2687211e3d5e19a86ab85515688fe Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 17:16:29 -0400 Subject: [PATCH 034/150] travis-ci: clang and gcc are the same on osx and xcode6.3 does not works --- .travis.yml | 58 ++++++++++++++++------------------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index fd7013960..ea7cd4568 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,8 @@ matrix: include: - os: linux compiler: gcc + #gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 - os: linux - compiler: gcc addons: apt: sources: @@ -19,9 +19,9 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: _CC=gcc-4.8 + compiler: gcc-4.8 + #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - os: linux - compiler: gcc addons: apt: sources: @@ -33,9 +33,9 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: _CC=gcc-4.9 + compiler: gcc-4.9 + #gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3 - os: linux - compiler: gcc addons: apt: sources: @@ -47,9 +47,9 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: _CC=gcc-5 + compiler: gcc-5 + #gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204 - os: linux - compiler: gcc addons: apt: sources: @@ -61,57 +61,33 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - env: _CC=gcc-6 + compiler: gcc-7 + #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang + #clang version 3.5.0 (tags/RELEASE_350/final) - os: osx osx_image: beta-xcode6.1 - compiler: gcc - - os: osx - osx_image: beta-xcode6.1 - compiler: clang + #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) - os: osx osx_image: beta-xcode6.2 - compiler: gcc - - os: osx - osx_image: beta-xcode6.2 - compiler: clang# - - os: osx - osx_image: beta-xcode6.3 compiler: gcc - - os: osx - osx_image: beta-xcode6.3 - compiler: clang + #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) - os: osx osx_image: xcode6.4 - compiler: gcc - - os: osx - osx_image: xcode6.4 - compiler: clang + #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) - os: osx osx_image: xcode7 - compiler: gcc - - os: osx - osx_image: xcode7 - compiler: clang + #Apple LLVM version 7.0.0 (clang-700.0.72) - os: osx osx_image: xcode7.1 - compiler: gcc - - os: osx - osx_image: xcode7.1 - compiler: clang + #Apple LLVM version 7.0.0 (clang-700.1.76) - os: osx osx_image: xcode7.2 - compiler: gcc - - os: osx - osx_image: xcode7.2 - compiler: clang + #Apple LLVM version 7.0.2 (clang-700.1.81) - os: osx osx_image: xcode7.3 - compiler: gcc - - os: osx - osx_image: xcode7.3 - compiler: clang + #Apple LLVM version 7.3.0 (clang-703.0.31) cache: apt: true From 3cf5d1ddecf9025f58d49a42640d21df682066eb Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 17:22:50 -0400 Subject: [PATCH 035/150] travis-ci: fixup gcc-6 build and added xcode6.3 --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ea7cd4568..8918713ab 100644 --- a/.travis.yml +++ b/.travis.yml @@ -61,7 +61,7 @@ matrix: - libgl1-mesa-dev - libgme-dev - p7zip-full - compiler: gcc-7 + compiler: gcc-6 #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang @@ -73,6 +73,9 @@ matrix: osx_image: beta-xcode6.2 compiler: gcc #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) + - os: osx + osx_image: beta-xcode6.3 + # - os: osx osx_image: xcode6.4 #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) From 90ae2b2d1d5301e20b9869b7bb777095a1a19365 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 17:44:38 -0400 Subject: [PATCH 036/150] cmake: compile with warnings --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8918713ab..7f46c3071 100644 --- a/.travis.yml +++ b/.travis.yml @@ -113,8 +113,8 @@ before_script: - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build - cd build - - cmake .. - - set CFLAGS=-Wall -W -Werror + - export CFLAGS=-Wall -W -Werror + - cmake .. -DCMAKE_BUILD_TYPE=Release before_install: - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update ; fi From c76c5152c2928d4a0d4ce663c2a3b2cfd79b7f6c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 17:59:19 -0400 Subject: [PATCH 037/150] travis-ci: fixup CFLAGS env and disable xcode6.3, it is really broken --- .travis.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 7f46c3071..5b414f975 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,9 +73,9 @@ matrix: osx_image: beta-xcode6.2 compiler: gcc #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) - - os: osx - osx_image: beta-xcode6.3 - # +# - os: osx +# osx_image: beta-xcode6.3 +# # - os: osx osx_image: xcode6.4 #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) @@ -108,12 +108,11 @@ addons: - p7zip-full before_script: - - if $_CC --version 2>/dev/null; then export CC=$_CC; fi; - wget --verbose --server-response -c http://rosenthalcastle.org/srb2/SRB2-v2115-assets-2.7z -O $HOME/srb2_cache/SRB2-v2115-assets-2.7z - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build - cd build - - export CFLAGS=-Wall -W -Werror + - export CFLAGS="-Wall -W -Werror" - cmake .. -DCMAKE_BUILD_TYPE=Release before_install: From f4a84c916e6639bf28915e1e7cea7bb14472a3ec Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 18:39:15 -0400 Subject: [PATCH 038/150] travis: Fixedup gcc 5 error and allow gcc 6 to fail --- .travis.yml | 8 +++++--- src/sdl/i_main.c | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5b414f975..eabc52f46 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,8 @@ sudo: required dist: trusty matrix: + allow_failures: + compiler: gcc-6 include: - os: linux compiler: gcc @@ -73,9 +75,9 @@ matrix: osx_image: beta-xcode6.2 compiler: gcc #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) -# - os: osx -# osx_image: beta-xcode6.3 -# # + - os: osx + osx_image: beta-xcode6.3 + # - os: osx osx_image: xcode6.4 #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 74b61339b..a12ff6376 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -245,7 +245,7 @@ int main(int argc, char **argv) #endif // return to OS -#ifndef __GNUC__ +#if !defined (__GNUC__) || (__GNUC__ < 5) return 0; #endif } From ad6c2e634f6ddb9b8a24e4fca0817e347ae0543e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:08:50 -0400 Subject: [PATCH 039/150] travis: disable xcode6.3 --- .travis.yml | 8 ++++---- src/sdl/i_main.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index eabc52f46..6376ed52b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -75,10 +75,10 @@ matrix: osx_image: beta-xcode6.2 compiler: gcc #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) - - os: osx - osx_image: beta-xcode6.3 - # - - os: osx +# - os: osx +# osx_image: beta-xcode6.3 +# # +# - os: osx osx_image: xcode6.4 #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) - os: osx diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index a12ff6376..6ccea92a3 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -245,7 +245,7 @@ int main(int argc, char **argv) #endif // return to OS -#if !defined (__GNUC__) || (__GNUC__ < 5) +#if !defined (__GNUC__) || (__GNUC__ < 4) return 0; #endif } From 02e67a4a950be49f7abdc3daed60100164827ec0 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:15:37 -0400 Subject: [PATCH 040/150] travis: add gcc 4.4, 4.6 and 4.7 --- .travis.yml | 36 ++++++++++++++++++++++++++++++++++++ src/sdl/i_main.c | 2 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6376ed52b..1e4caa7bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,42 @@ matrix: allow_failures: compiler: gcc-6 include: + - os: linux + addons: + apt: + packages: + - gcc-4.4 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + compiler: gcc-4.4 + #gcc-4.4 + - os: linux + addons: + apt: + packages: + - gcc-4.6 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + compiler: gcc-4.6 + #gcc-4.6 + - os: linux + addons: + apt: + packages: + - gcc-4.7 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + compiler: gcc-4.7 + #gcc-4.7 - os: linux compiler: gcc #gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4 diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 6ccea92a3..e06c4ae95 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -245,7 +245,7 @@ int main(int argc, char **argv) #endif // return to OS -#if !defined (__GNUC__) || (__GNUC__ < 4) +#if !defined (__GNUC__) || (__GNUC__ < 3) return 0; #endif } From a1d246a34e7d5b9b89a032f577ee89e1762a1d9b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:17:21 -0400 Subject: [PATCH 041/150] travis-cl: disable gcc-6 build --- .travis.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1e4caa7bf..2c7eb93ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,20 +87,20 @@ matrix: - p7zip-full compiler: gcc-5 #gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204 - - os: linux - addons: - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - gcc-6 - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - p7zip-full - compiler: gcc-6 - #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 +# - os: linux +# addons: +# apt: +# sources: +# - ubuntu-toolchain-r-test +# packages: +# - gcc-6 +# - libsdl2-mixer-dev +# - libpng-dev +# - libgl1-mesa-dev +# - libgme-dev +# - p7zip-full +# compiler: gcc-6 +# #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang #clang version 3.5.0 (tags/RELEASE_350/final) From 35f36e1bba7c0af75c0338ca176ffa5b388d6b66 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:28:37 -0400 Subject: [PATCH 042/150] travis-ci: set v of nulK to 0 --- src/blua/lcode.c | 1 + src/sdl/i_main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/blua/lcode.c b/src/blua/lcode.c index 743a094a8..5c7fed454 100644 --- a/src/blua/lcode.c +++ b/src/blua/lcode.c @@ -270,6 +270,7 @@ static int boolK (FuncState *fs, int b) { static int nilK (FuncState *fs) { TValue k, v; + setbvalue(&v, 0); setnilvalue(&v); /* cannot use nil as key; instead use table itself to represent nil */ sethvalue(fs->L, &k, fs->h); diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index e06c4ae95..2364281d6 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -245,7 +245,7 @@ int main(int argc, char **argv) #endif // return to OS -#if !defined (__GNUC__) || (__GNUC__ < 3) +#if !defined (__GNUC__) return 0; #endif } From d9aa430817fc4bc60c0aae634153cb7fa6872960 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:42:38 -0400 Subject: [PATCH 043/150] use memmove in D_MD5PasswordPass() and drop noreturn --- src/d_netcmd.c | 2 +- src/sdl/i_main.c | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 3dd95bf99..1658d1a61 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2601,7 +2601,7 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, if (len > 256-strlen(salt)) len = 256-strlen(salt); - memcpy(tmpbuf, buffer, len); + memmove(tmpbuf, buffer, len); strcpy(&tmpbuf[len], salt); len += strlen(salt); if (len < 256) diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index 2364281d6..ab7631bc6 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -144,10 +144,8 @@ void XBoxStartup() myargv = NULL; #else #ifdef FORCESDLMAIN -FUNCNORETURN int SDL_main(int argc, char **argv) #else -FUNCNORETURN int main(int argc, char **argv) #endif { @@ -245,8 +243,6 @@ int main(int argc, char **argv) #endif // return to OS -#if !defined (__GNUC__) return 0; -#endif } #endif From 3aea4a7601cbc2cbf954fb86cf80b2ab30902099 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:48:52 -0400 Subject: [PATCH 044/150] replace strcpy with memmove in D_MD5PasswordPass() --- src/d_netcmd.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 1658d1a61..868469cfb 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2598,11 +2598,13 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, memset(dest, 0, 16); #else XBOXSTATIC char tmpbuf[256]; + const size_t sl = strlen(salt) - if (len > 256-strlen(salt)) - len = 256-strlen(salt); - memmove(tmpbuf, buffer, len); - strcpy(&tmpbuf[len], salt); + if (len > 256-sl) + len = 256-s;; + memcpy(tmpbuf, buffer, len); + memmove(&tmpbuf[len], salt, sl); + //strcpy(&tmpbuf[len], salt); len += strlen(salt); if (len < 256) memset(&tmpbuf[len],0,256-len); From 35b254feaa18d7fc40943c2fe2d98fbc7742b071 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 19:51:10 -0400 Subject: [PATCH 045/150] D_MD5PasswordPass, fixup --- src/d_netcmd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 868469cfb..4f73a2564 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -2598,10 +2598,10 @@ static void D_MD5PasswordPass(const UINT8 *buffer, size_t len, const char *salt, memset(dest, 0, 16); #else XBOXSTATIC char tmpbuf[256]; - const size_t sl = strlen(salt) + const size_t sl = strlen(salt); if (len > 256-sl) - len = 256-s;; + len = 256-sl; memcpy(tmpbuf, buffer, len); memmove(&tmpbuf[len], salt, sl); //strcpy(&tmpbuf[len], salt); From 4956be2bd4916e81e5c123117d20c2e9de5b6ac7 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 21:23:09 -0400 Subject: [PATCH 046/150] gcc-6: error: left shift of negative value [-Werror=shift-negative-value] --- src/i_tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index 89e59c8b8..eca218c80 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -466,7 +466,7 @@ static boolean SOCK_cmpaddr(mysockaddr_t *a, mysockaddr_t *b, UINT8 mask) UINT32 bitmask = INADDR_NONE; if (mask && mask < 32) - bitmask = htonl(-1 << (32 - mask)); + bitmask = htonl((UINT32)(-1) << (32 - mask)); if (b->any.sa_family == AF_INET) return (a->ip4.sin_addr.s_addr & bitmask) == (b->ip4.sin_addr.s_addr & bitmask) From 9e196613a01954febe0d4a2a1b838d2afdad8ec6 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 21:23:46 -0400 Subject: [PATCH 047/150] =?UTF-8?q?gcc-6:=20error:=20this=20=E2=80=98for?= =?UTF-8?q?=E2=80=99=20clause=20does=20not=20guard...=20[-Werror=3Dmislead?= =?UTF-8?q?ing-indentation]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 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 6d1e8f113..6c1294444 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -7430,7 +7430,7 @@ static void M_HandleFogColor(INT32 choice) l = strlen(temp); for (i = 0; i < l; i++) cv_grfogcolor.zstring[5 - i] = temp[l - i]; - cv_grfogcolor.zstring[5] = (char)choice; + cv_grfogcolor.zstring[5] = (char)choice; } break; } From 209d76cb9dbcba5a6175a49269b1d88bd85a54e4 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 21:24:06 -0400 Subject: [PATCH 048/150] =?UTF-8?q?gcc-6:=20error:=20this=20=E2=80=98if?= =?UTF-8?q?=E2=80=99=20clause=20does=20not=20guard...=20[-Werror=3Dmislead?= =?UTF-8?q?ing-indentation]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/blua/ltablib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/blua/ltablib.c b/src/blua/ltablib.c index 2e50ce0ae..2dd157155 100644 --- a/src/blua/ltablib.c +++ b/src/blua/ltablib.c @@ -137,7 +137,7 @@ static void addfield (lua_State *L, luaL_Buffer *b, int i) { if (!lua_isstring(L, -1)) luaL_error(L, "invalid value (%s) at index %d in table for " LUA_QL("concat"), luaL_typename(L, -1), i); - luaL_addvalue(b); + luaL_addvalue(b); } From b60ab05721b56f0a083af37d223e192ebe7be934 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 21:31:33 -0400 Subject: [PATCH 049/150] travis-ci: reenable gcc-6 --- .travis.yml | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2c7eb93ef..1e4caa7bf 100644 --- a/.travis.yml +++ b/.travis.yml @@ -87,20 +87,20 @@ matrix: - p7zip-full compiler: gcc-5 #gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204 -# - os: linux -# addons: -# apt: -# sources: -# - ubuntu-toolchain-r-test -# packages: -# - gcc-6 -# - libsdl2-mixer-dev -# - libpng-dev -# - libgl1-mesa-dev -# - libgme-dev -# - p7zip-full -# compiler: gcc-6 -# #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 + - os: linux + addons: + apt: + sources: + - ubuntu-toolchain-r-test + packages: + - gcc-6 + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + compiler: gcc-6 + #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang #clang version 3.5.0 (tags/RELEASE_350/final) From e866630b22e152a0d9bdb4902c566d92294e38d1 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 21:50:06 -0400 Subject: [PATCH 050/150] travis: disable tautological-compare warnings --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e4caa7bf..9e92ae1f8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -150,7 +150,8 @@ before_script: - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build - cd build - - export CFLAGS="-Wall -W -Werror" + - export CFLAGS="-Wall -W -Werror -Wno-tautological-compare -Wno-error=tautological-compare" + - $CC -Wno-error=tautological-compare -dM -E - < /dev/null&>/dev/null||export CFLAGS="Wall -W -Werror" - cmake .. -DCMAKE_BUILD_TYPE=Release before_install: From 2dfdc99cb5e620ecf2911191a610007d16a0640e Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 22:30:28 -0400 Subject: [PATCH 051/150] travis-ci: let add pre build files, gcc-6 get disable warning flags --- .travis.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 9e92ae1f8..836ac58ae 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,6 +100,7 @@ matrix: - libgme-dev - p7zip-full compiler: gcc-6 + env: WFLAGS=-Werror -Wno-tautological-compare -Wno-error=tautological-compare #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang @@ -150,8 +151,7 @@ before_script: - 7z x $HOME/srb2_cache/SRB2-v2115-assets-2.7z -oassets - mkdir build - cd build - - export CFLAGS="-Wall -W -Werror -Wno-tautological-compare -Wno-error=tautological-compare" - - $CC -Wno-error=tautological-compare -dM -E - < /dev/null&>/dev/null||export CFLAGS="Wall -W -Werror" + - export CFLAGS="-Wall -W $WFLAGS" - cmake .. -DCMAKE_BUILD_TYPE=Release before_install: From 68329624899d693c7df5ecccf3e7e5fcd6fa7cf5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 28 May 2016 22:45:47 -0400 Subject: [PATCH 052/150] travis-ci: env vars need to be quoted --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 836ac58ae..69e8ee9ef 100644 --- a/.travis.yml +++ b/.travis.yml @@ -100,7 +100,7 @@ matrix: - libgme-dev - p7zip-full compiler: gcc-6 - env: WFLAGS=-Werror -Wno-tautological-compare -Wno-error=tautological-compare + env: WFLAGS="-Wno-tautological-compare -Wno-error=tautological-compare" #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang From febaabd80baa41cc0e8970a4e04ed416f03fb88b Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 29 May 2016 09:40:56 -0400 Subject: [PATCH 053/150] travis: label up each compiler build, and remove the allow_failures --- .travis.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69e8ee9ef..f9f701efe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,6 @@ sudo: required dist: trusty matrix: - allow_failures: - compiler: gcc-6 include: - os: linux addons: @@ -17,7 +15,7 @@ matrix: - libgme-dev - p7zip-full compiler: gcc-4.4 - #gcc-4.4 + #gcc-4.4 (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7 - os: linux addons: apt: @@ -29,7 +27,7 @@ matrix: - libgme-dev - p7zip-full compiler: gcc-4.6 - #gcc-4.6 + #gcc-4.6 (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4 - os: linux addons: apt: @@ -114,7 +112,7 @@ matrix: #Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn) # - os: osx # osx_image: beta-xcode6.3 -# # +# #I think xcode.6.3 VM is broken, it does not boot # - os: osx osx_image: xcode6.4 #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) From 6fb70f8d02ced358f746aa1dda03b12a786df09a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 29 May 2016 09:47:30 -0400 Subject: [PATCH 054/150] travis-ci: let only display, not error on autological warnings --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f9f701efe..c6c4313cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -98,7 +98,7 @@ matrix: - libgme-dev - p7zip-full compiler: gcc-6 - env: WFLAGS="-Wno-tautological-compare -Wno-error=tautological-compare" + env: WFLAGS="-Wno-error=tautological-compare" #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang From 2c73e2a2cdd992cdc839491b39346effbbe286a6 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 29 May 2016 16:47:38 +0100 Subject: [PATCH 055/150] Fix flung emeralds not disappearing in death pits (assuming it wasn't an intentional behaviour thing of course) --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 4122619d1..68fb1696f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2245,6 +2245,7 @@ static boolean P_ZMovement(mobj_t *mo) case MT_BLUETEAMRING: case MT_FLINGRING: case MT_FLINGCOIN: + case MT_FLINGEMERALD: // Remove flinged stuff from death pits. if (P_CheckDeathPitCollide(mo)) { @@ -2276,7 +2277,6 @@ static boolean P_ZMovement(mobj_t *mo) if (!(mo->momx || mo->momy || mo->momz)) return true; break; - case MT_FLINGEMERALD: case MT_NIGHTSWING: if (!(mo->momx || mo->momy || mo->momz)) return true; From a2aeece419b3632ea3d783a38a424195290b3384 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 30 May 2016 21:53:29 +0100 Subject: [PATCH 056/150] Significant rework of main seg-rendering code, to eliminate the possibility of drawing off-screen and crashing the game as result NOTE: HOMs sometimes appear in the sky in maps like AGZ (map40), so this isn't completely fine yet. I'll fix that later --- src/r_segs.c | 110 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 42 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 11b4c8aef..931b79a66 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1453,34 +1453,45 @@ static void R_RenderSegLoop (void) frontscale[rw_x] = rw_scale; // draw the wall tiers - if (midtexture && yl <= yh && yh < vid.height && yh > 0) + if (midtexture) { // single sided line - dc_yl = yl; - dc_yh = yh; - dc_texturemid = rw_midtexturemid; - dc_source = R_GetColumn(midtexture,texturecolumn); - dc_texheight = textureheight[midtexture]>>FRACBITS; + if (yl <= yh && yh >= 0 && yl < viewheight) + { + dc_yl = yl; + dc_yh = yh; + dc_texturemid = rw_midtexturemid; + dc_source = R_GetColumn(midtexture,texturecolumn); + dc_texheight = textureheight[midtexture]>>FRACBITS; - //profile stuff --------------------------------------------------------- + //profile stuff --------------------------------------------------------- #ifdef TIMING - ProfZeroTimer(); + ProfZeroTimer(); #endif - colfunc(); + colfunc(); #ifdef TIMING - RDMSR(0x10,&mycount); - mytotal += mycount; //64bit add + RDMSR(0x10,&mycount); + mytotal += mycount; //64bit add - if (nombre--==0) - I_Error("R_DrawColumn CPU Spy reports: 0x%d %d\n", *((INT32 *)&mytotal+1), - (INT32)mytotal); + if (nombre--==0) + I_Error("R_DrawColumn CPU Spy reports: 0x%d %d\n", *((INT32 *)&mytotal+1), + (INT32)mytotal); #endif - //profile stuff --------------------------------------------------------- + //profile stuff --------------------------------------------------------- - // dont draw anything more for this column, since - // a midtexture blocks the view - ceilingclip[rw_x] = (INT16)viewheight; - floorclip[rw_x] = -1; + // dont draw anything more for this column, since + // a midtexture blocks the view + ceilingclip[rw_x] = (INT16)viewheight; + floorclip[rw_x] = -1; + } + else + { + // note: don't use min/max macros here + if (markceiling && yl >= 0) + ceilingclip[rw_x] = (yl-1 > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); + if (markfloor && yh < viewheight) + floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); + } } else { @@ -1494,21 +1505,27 @@ static void R_RenderSegLoop (void) if (mid >= floorclip[rw_x]) mid = floorclip[rw_x]-1; - if (mid >= yl && yh < vid.height && yh > 0) + if (yl < 0) + ; // do nothing, off-screen + else if (mid >= yl && yl < viewheight) { - dc_yl = yl; - dc_yh = mid; - dc_texturemid = rw_toptexturemid; - dc_source = R_GetColumn(toptexture,texturecolumn); - dc_texheight = textureheight[toptexture]>>FRACBITS; - colfunc(); - ceilingclip[rw_x] = (INT16)mid; + if (mid >= 0) + { + dc_yl = yl; + dc_yh = mid; + dc_texturemid = rw_toptexturemid; + dc_source = R_GetColumn(toptexture,texturecolumn); + dc_texheight = textureheight[toptexture]>>FRACBITS; + colfunc(); + ceilingclip[rw_x] = (INT16)mid; + } + // else do nothing, off-screen } else - ceilingclip[rw_x] = (INT16)((INT16)yl - 1); + ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); } - else if (markceiling) // no top wall - ceilingclip[rw_x] = (INT16)((INT16)yl - 1); + else if (markceiling && yl >= 0) // no top wall + ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); if (bottomtexture) { @@ -1520,24 +1537,33 @@ static void R_RenderSegLoop (void) if (mid <= ceilingclip[rw_x]) mid = ceilingclip[rw_x]+1; - if (mid <= yh && yh < vid.height && yh > 0) + if (yh >= viewheight) + ; // do nothing, off-screen + else if (mid <= yh && yh >= 0) { - dc_yl = mid; - dc_yh = yh; - dc_texturemid = rw_bottomtexturemid; - dc_source = R_GetColumn(bottomtexture, - texturecolumn); - dc_texheight = textureheight[bottomtexture]>>FRACBITS; - colfunc(); - floorclip[rw_x] = (INT16)mid; + if (mid < viewheight) + { + dc_yl = mid; + dc_yh = yh; + dc_texturemid = rw_bottomtexturemid; + dc_source = R_GetColumn(bottomtexture, + texturecolumn); + dc_texheight = textureheight[bottomtexture]>>FRACBITS; + colfunc(); + floorclip[rw_x] = (INT16)mid; + } + // else do nothing, off-screen } else - floorclip[rw_x] = (INT16)((INT16)yh + 1); + floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); } - else if (markfloor) // no bottom wall - floorclip[rw_x] = (INT16)((INT16)yh + 1); + else if (markfloor && yh < viewheight) // no bottom wall + floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1), -1; } + if (floorclip[rw_x] > viewheight) + I_Error("floorclip[%d] > viewheight (value is %d)", rw_x, floorclip[rw_x]); + if (maskedtexture || numthicksides) { // save texturecol From 5c5b85f369646d82354a9e8dc916cd18d72d3dd9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 30 May 2016 17:16:58 -0400 Subject: [PATCH 057/150] travis-ci: add builds for clang 3.4 to 3.8 --- .travis.yml | 66 +++++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 59 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index c6c4313cc..54cd25c63 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,36 +8,36 @@ matrix: addons: apt: packages: - - gcc-4.4 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-4.4 compiler: gcc-4.4 #gcc-4.4 (Ubuntu/Linaro 4.4.7-8ubuntu1) 4.4.7 - os: linux addons: apt: packages: - - gcc-4.6 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-4.6 compiler: gcc-4.6 #gcc-4.6 (Ubuntu/Linaro 4.6.4-6ubuntu2) 4.6.4 - os: linux addons: apt: packages: - - gcc-4.7 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-4.7 compiler: gcc-4.7 #gcc-4.7 - os: linux @@ -49,12 +49,12 @@ matrix: sources: - ubuntu-toolchain-r-test packages: - - gcc-4.8 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-4.8 compiler: gcc-4.8 #gcc-4.8 (Ubuntu 4.8.5-2ubuntu1~14.04.1) 4.8.5 - os: linux @@ -63,12 +63,12 @@ matrix: sources: - ubuntu-toolchain-r-test packages: - - gcc-4.9 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-4.9 compiler: gcc-4.9 #gcc-4.9 (Ubuntu 4.9.3-8ubuntu2~14.04) 4.9.3 - os: linux @@ -77,12 +77,12 @@ matrix: sources: - ubuntu-toolchain-r-test packages: - - gcc-5 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-5 compiler: gcc-5 #gcc-5 (Ubuntu 5.3.0-3ubuntu1~14.04) 5.3.0 20151204 - os: linux @@ -91,18 +91,70 @@ matrix: sources: - ubuntu-toolchain-r-test packages: - - gcc-6 - libsdl2-mixer-dev - libpng-dev - libgl1-mesa-dev - libgme-dev - p7zip-full + - gcc-6 compiler: gcc-6 env: WFLAGS="-Wno-error=tautological-compare" #gcc-6 (Ubuntu 6.1.1-3ubuntu11~14.04.1) 6.1.1 20160511 - os: linux compiler: clang #clang version 3.5.0 (tags/RELEASE_350/final) + - os: linux + apt: + sources: + - llvm-toolchain-precise-3.5 + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.5 + compiler: clang + # + - os: linux + apt: + sources: + - llvm-toolchain-precise-3.6 + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.6 + compiler: clang + # + - os: linux + apt: + sources: + - llvm-toolchain-precise-3.7 + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.7 + compiler: clang + # + - os: linux + apt: + sources: + - llvm-toolchain-precise-3.8 + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.8 + compiler: clang + # - os: osx osx_image: beta-xcode6.1 #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) From 9f5ecdcd9c8b9f47824c9f56a212d0eea629e05c Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 30 May 2016 17:19:32 -0400 Subject: [PATCH 058/150] travis: add mssing addons: section --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 54cd25c63..b96f21811 100644 --- a/.travis.yml +++ b/.travis.yml @@ -104,6 +104,7 @@ matrix: compiler: clang #clang version 3.5.0 (tags/RELEASE_350/final) - os: linux + addons: apt: sources: - llvm-toolchain-precise-3.5 @@ -117,6 +118,7 @@ matrix: compiler: clang # - os: linux + addons: apt: sources: - llvm-toolchain-precise-3.6 @@ -130,6 +132,7 @@ matrix: compiler: clang # - os: linux + addons: apt: sources: - llvm-toolchain-precise-3.7 @@ -143,6 +146,7 @@ matrix: compiler: clang # - os: linux + addons: apt: sources: - llvm-toolchain-precise-3.8 From 5e154ce3fd5a980d4fac923ba6161963124d8dc2 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 30 May 2016 17:21:24 -0400 Subject: [PATCH 059/150] travis: use the correct binary name for clang --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index b96f21811..bc6941162 100644 --- a/.travis.yml +++ b/.travis.yml @@ -129,7 +129,7 @@ matrix: - libgme-dev - p7zip-full - clang-3.6 - compiler: clang + compiler: clang-3.6 # - os: linux addons: @@ -143,7 +143,7 @@ matrix: - libgme-dev - p7zip-full - clang-3.7 - compiler: clang + compiler: clang-3.7 # - os: linux addons: @@ -157,7 +157,7 @@ matrix: - libgme-dev - p7zip-full - clang-3.8 - compiler: clang + compiler: clang-3.8 # - os: osx osx_image: beta-xcode6.1 From 9a703bbeda78b93a87d99ff0745c6e00e01d9aaf Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 30 May 2016 17:41:23 -0400 Subject: [PATCH 060/150] travis-ci: drop clang 3.6, 3.7 and 3.8 --- .travis.yml | 44 +------------------------------------------- 1 file changed, 1 insertion(+), 43 deletions(-) diff --git a/.travis.yml b/.travis.yml index bc6941162..6ff3f788c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -115,49 +115,7 @@ matrix: - libgme-dev - p7zip-full - clang-3.5 - compiler: clang - # - - os: linux - addons: - apt: - sources: - - llvm-toolchain-precise-3.6 - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - p7zip-full - - clang-3.6 - compiler: clang-3.6 - # - - os: linux - addons: - apt: - sources: - - llvm-toolchain-precise-3.7 - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - p7zip-full - - clang-3.7 - compiler: clang-3.7 - # - - os: linux - addons: - apt: - sources: - - llvm-toolchain-precise-3.8 - packages: - - libsdl2-mixer-dev - - libpng-dev - - libgl1-mesa-dev - - libgme-dev - - p7zip-full - - clang-3.8 - compiler: clang-3.8 + compiler: clang-3.5 # - os: osx osx_image: beta-xcode6.1 From 61faee12bc2e0e9c8d9d0d596e5cf8ab6e2ba8b5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Mon, 30 May 2016 17:52:30 -0400 Subject: [PATCH 061/150] travis-ci: add back clang 3.6 to 3.8, but also have toolchain test repos into the mix --- .travis.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/.travis.yml b/.travis.yml index 6ff3f788c..a6423b624 100644 --- a/.travis.yml +++ b/.travis.yml @@ -116,6 +116,51 @@ matrix: - p7zip-full - clang-3.5 compiler: clang-3.5 + #Ubuntu clang version 3.5.0-4ubuntu2~trusty2 (tags/RELEASE_350/final) (based on LLVM 3.5.0) + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.6 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.6 + compiler: clang-3.6 + # + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.7 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.7 + compiler: clang-3.7 + # + - os: linux + addons: + apt: + sources: + - llvm-toolchain-precise-3.8 + - ubuntu-toolchain-r-test + packages: + - libsdl2-mixer-dev + - libpng-dev + - libgl1-mesa-dev + - libgme-dev + - p7zip-full + - clang-3.8 + compiler: clang-3.8 # - os: osx osx_image: beta-xcode6.1 From eb90f4f50deec77b35d31224a456144683cd096a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Mon, 30 May 2016 22:53:22 +0100 Subject: [PATCH 062/150] welp no success in fixing the sky HOMs yet, committing progress anyway --- src/r_segs.c | 58 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 931b79a66..99324d03f 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1487,10 +1487,20 @@ static void R_RenderSegLoop (void) else { // note: don't use min/max macros here - if (markceiling && yl >= 0) - ceilingclip[rw_x] = (yl-1 > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); - if (markfloor && yh < viewheight) - floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); + if (markceiling) + { + if (yl >= 0) + ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); + else + ceilingclip[rw_x] = -1; + } + else if (markfloor) + { + if (yh < viewheight) + floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); + else + floorclip[rw_x] = (INT16)viewheight; + } } } else @@ -1505,9 +1515,7 @@ static void R_RenderSegLoop (void) if (mid >= floorclip[rw_x]) mid = floorclip[rw_x]-1; - if (yl < 0) - ; // do nothing, off-screen - else if (mid >= yl && yl < viewheight) + if (mid >= yl && yl < viewheight) { if (mid >= 0) { @@ -1519,13 +1527,21 @@ static void R_RenderSegLoop (void) colfunc(); ceilingclip[rw_x] = (INT16)mid; } - // else do nothing, off-screen + else + ceilingclip[rw_x] = -1; } - else + else if (yl >= 0) ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); + else + ceilingclip[rw_x] = -1; + } + else if (markceiling) // no top wall + { + if (yl >= 0) + ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); + else + ceilingclip[rw_x] = -1; } - else if (markceiling && yl >= 0) // no top wall - ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); if (bottomtexture) { @@ -1537,9 +1553,7 @@ static void R_RenderSegLoop (void) if (mid <= ceilingclip[rw_x]) mid = ceilingclip[rw_x]+1; - if (yh >= viewheight) - ; // do nothing, off-screen - else if (mid <= yh && yh >= 0) + if (mid <= yh && yh >= 0) { if (mid < viewheight) { @@ -1552,13 +1566,21 @@ static void R_RenderSegLoop (void) colfunc(); floorclip[rw_x] = (INT16)mid; } - // else do nothing, off-screen + else + floorclip[rw_x] = (INT16)viewheight; } - else + else if (yh < viewheight) floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); + else + floorclip[rw_x] = (INT16)viewheight; + } + else if (markfloor) // no bottom wall + { + if (yh < viewheight) + floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); + else + floorclip[rw_x] = (INT16)viewheight; } - else if (markfloor && yh < viewheight) // no bottom wall - floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1), -1; } if (floorclip[rw_x] > viewheight) From fa002e58ad0f11f362a5bdfdb0629c9494906a1b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 15:01:19 +0100 Subject: [PATCH 063/150] Did a bunch of things to/for slopes. *The No Physics flag now works (Red, you might want to doublecheck this to see whether I haven't missed any eosteric stuff out). Going downhill is a little bumpy, and I'm not sure whether that's good or not. Someone help me out here? *The SRB2CB typeshims are now behind #ifdef ESLOPE_TYPESHIM instead of #if 1 for easier disabling. *Slopes' downhill thrusts are now scaled with regards to object gravity. This is actually untested in gravities other than normal and reverse normal but it's one line which can be easily reverted in that circumstance. I also checked with MI to make sure this is how it's calculated elsewhere, so fingers crossed this doesn't cause any edge cases. *As a consequence of the above point, there's now a function in p_mobj.c/h that returns an object's internal gravity - seperated out from the logic of P_CheckGravity, which really didn't need to be so monolithic. Multiply by global gravity to get the thrust. This should probably be available to Lua somehow, but I have absolutely no idea where to start with that. Wolfs, maybe? Non-comprehensive test file available at /toaster/slptst3.wad on the ftp. --- src/doomdef.h | 6 ++++++ src/p_mobj.c | 31 ++++++++++++++++++++++--------- src/p_mobj.h | 3 +++ src/p_slopes.c | 50 ++++++++++++++++++++++++++++++++++---------------- src/p_user.c | 8 ++++---- 5 files changed, 69 insertions(+), 29 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index 9a1e5af9e..e645c0848 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -431,6 +431,12 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Kalaron/Eternity Engine slope code (SRB2CB ported) #define ESLOPE +#if defined(ESLOPE) +/// Backwards compatibility with SRB2CB's slope linedef types. +/// \note A simple shim that prints a warning. +#define ESLOPE_TYPESHIM +#endif + /// Delete file while the game is running. /// \note EXTREMELY buggy, tends to crash game. //#define DELFILE diff --git a/src/p_mobj.c b/src/p_mobj.c index 68fb1696f..775cd9d6d 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1252,13 +1252,12 @@ static void P_PlayerFlip(mobj_t *mo) } // -// P_CheckGravity +// P_GetMobjGravity // -// Checks the current gravity state -// of the object. If affect is true, -// a gravity force will be applied. +// Returns the current gravity +// value of the object. // -void P_CheckGravity(mobj_t *mo, boolean affect) +fixed_t P_GetMobjGravity(mobj_t *mo) { fixed_t gravityadd = 0; boolean no3dfloorgrav = true; // Custom gravity @@ -1400,11 +1399,25 @@ void P_CheckGravity(mobj_t *mo, boolean affect) if (goopgravity) gravityadd = -gravityadd/5; - if (affect) - mo->momz += FixedMul(gravityadd, mo->scale); - if (mo->player && !!(mo->eflags & MFE_VERTICALFLIP) != wasflip) P_PlayerFlip(mo); + + return gravityadd; +} + +// +// P_CheckGravity +// +// Checks the current gravity state +// of the object. If affect is true, +// a gravity force will be applied. +// +void P_CheckGravity(mobj_t *mo, boolean affect) +{ + fixed_t gravityadd = P_GetMobjGravity(mo); + + if (affect) + mo->momz += FixedMul(gravityadd, mo->scale); if (mo->type == MT_SKIM && mo->z + mo->momz <= mo->watertop && mo->z >= mo->watertop) { @@ -1480,7 +1493,7 @@ static void P_XYFriction(mobj_t *mo, fixed_t oldx, fixed_t oldy) && abs(player->rmomy) < FixedMul(STOPSPEED, mo->scale) && (!(player->cmd.forwardmove && !(twodlevel || mo->flags2 & MF2_TWOD)) && !player->cmd.sidemove && !(player->pflags & PF_SPINNING)) #ifdef ESLOPE - && !(player->mo->standingslope && abs(player->mo->standingslope->zdelta) >= FRACUNIT/2) + && !(player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && (abs(player->mo->standingslope->zdelta) >= FRACUNIT/2)) #endif ) { diff --git a/src/p_mobj.h b/src/p_mobj.h index 9542ce8ba..de7f0c8d5 100644 --- a/src/p_mobj.h +++ b/src/p_mobj.h @@ -425,6 +425,9 @@ void P_AddCachedAction(mobj_t *mobj, INT32 statenum); // check mobj against water content, before movement code void P_MobjCheckWater(mobj_t *mobj); +// get mobj gravity +fixed_t P_GetMobjGravity(mobj_t *mo); + // Player spawn points void P_SpawnPlayer(INT32 playernum); void P_MovePlayerToSpawn(INT32 playernum, mapthing_t *mthing); diff --git a/src/p_slopes.c b/src/p_slopes.c index 6393ca4b5..f4ef4dcc2 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -16,6 +16,7 @@ #include "m_bbox.h" #include "z_zone.h" #include "p_local.h" +#include "p_mobj.h" #include "p_spec.h" #include "p_slopes.h" #include "p_setup.h" @@ -881,7 +882,7 @@ void P_SetSlopesFromVertexHeights(lumpnum_t lumpnum) // Reset the dynamic slopes pointer, and read all of the fancy schmancy slopes void P_ResetDynamicSlopes(void) { size_t i; -#if 1 // Rewrite old specials to new ones, and give a console warning +#ifdef ESLOPE_TYPESHIM // Rewrite old specials to new ones, and give a console warning boolean warned = false; #endif @@ -894,7 +895,7 @@ void P_ResetDynamicSlopes(void) { { switch (lines[i].special) { -#if 1 // Rewrite old specials to new ones, and give a console warning +#ifdef ESLOPE_TYPESHIM // Rewrite old specials to new ones, and give a console warning #define WARNME if (!warned) {warned = true; CONS_Alert(CONS_WARNING, "This level uses old slope specials.\nA conversion will be needed before 2.2's release.\n");} case 386: case 387: @@ -1018,6 +1019,9 @@ fixed_t P_GetZAt(pslope_t *slope, fixed_t x, fixed_t y) // When given a vector, rotates it and aligns it to a slope void P_QuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope) { + if (slope->flags & SL_NOPHYSICS) + return; // No physics, no quantizing. + vector3_t axis; axis.x = -slope->d.y; axis.y = slope->d.x; @@ -1032,26 +1036,37 @@ void P_QuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope) // Handles slope ejection for objects void P_SlopeLaunch(mobj_t *mo) { - // Double the pre-rotation Z, then halve the post-rotation Z. This reduces the - // vertical launch given from slopes while increasing the horizontal launch - // given. Good for SRB2's gravity and horizontal speeds. - vector3_t slopemom; - slopemom.x = mo->momx; - slopemom.y = mo->momy; - slopemom.z = mo->momz*2; - P_QuantizeMomentumToSlope(&slopemom, mo->standingslope); - - mo->momx = slopemom.x; - mo->momy = slopemom.y; - mo->momz = slopemom.z/2; + if (!(mo->standingslope->flags & SL_NOPHYSICS)) // If there's physics, time for launching. + { + // Double the pre-rotation Z, then halve the post-rotation Z. This reduces the + // vertical launch given from slopes while increasing the horizontal launch + // given. Good for SRB2's gravity and horizontal speeds. + vector3_t slopemom; + slopemom.x = mo->momx; + slopemom.y = mo->momy; + slopemom.z = mo->momz*2; + P_QuantizeMomentumToSlope(&slopemom, mo->standingslope); + mo->momx = slopemom.x; + mo->momy = slopemom.y; + mo->momz = slopemom.z/2; + } + //CONS_Printf("Launched off of slope.\n"); mo->standingslope = NULL; } // Function to help handle landing on slopes void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) -{ +{ + if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated. + if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope + thing->momz = -P_MobjFlip(thing); + thing->standingslope = slope; + } + return; + } + vector3_t mom; mom.x = thing->momx; mom.y = thing->momy; @@ -1081,6 +1096,9 @@ void P_ButteredSlope(mobj_t *mo) if (!mo->standingslope) return; + + if (mo->standingslope->flags & SL_NOPHYSICS) + return; // No physics, no butter. if (mo->flags & (MF_NOCLIPHEIGHT|MF_NOGRAVITY)) return; // don't slide down slopes if you can't touch them or you're not affected by gravity @@ -1116,7 +1134,7 @@ void P_ButteredSlope(mobj_t *mo) // This makes it harder to zigzag up steep slopes, as well as allows greater top speed when rolling down // Multiply by gravity - thrust = FixedMul(thrust, gravity); // TODO account for per-sector gravity etc + thrust = FixedMul(thrust, FixedMul(gravity, abs(P_GetMobjGravity(mo)))); // Now uses the absolute of mobj gravity. You're welcome. // Multiply by scale (gravity strength depends on mobj scale) thrust = FixedMul(thrust, mo->scale); diff --git a/src/p_user.c b/src/p_user.c index 4117cfc4c..461497bcb 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -3741,7 +3741,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) { if ((cmd->buttons & BT_USE) && player->speed < FixedMul(5<mo->scale) && !player->mo->momz && onground && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING) #ifdef ESLOPE - && (!player->mo->standingslope || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) + && (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) #endif ) { @@ -3774,7 +3774,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) else if ((cmd->buttons & BT_USE || ((twodlevel || (player->mo->flags2 & MF2_TWOD)) && cmd->forwardmove < -20)) && !player->climbing && !player->mo->momz && onground && (player->speed > FixedMul(5<mo->scale) #ifdef ESLOPE - || (player->mo->standingslope && abs(player->mo->standingslope->zdelta) >= FRACUNIT/2) + || (player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) >= FRACUNIT/2) #endif ) && !(player->pflags & PF_USEDOWN) && !(player->pflags & PF_SPINNING)) { @@ -3790,7 +3790,7 @@ static void P_DoSpinDash(player_t *player, ticcmd_t *cmd) if (onground && player->pflags & PF_SPINNING && !(player->pflags & PF_STARTDASH) && player->speed < FixedMul(5*FRACUNIT,player->mo->scale) #ifdef ESLOPE - && (!player->mo->standingslope || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) + && (!player->mo->standingslope || (player->mo->standingslope->flags & SL_NOPHYSICS) || abs(player->mo->standingslope->zdelta) < FRACUNIT/2) #endif ) { @@ -4776,7 +4776,7 @@ static void P_3dMovement(player_t *player) #ifdef ESLOPE if ((totalthrust.x || totalthrust.y) - && player->mo->standingslope && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) { + && player->mo->standingslope && (!(player->mo->standingslope->flags & SL_NOPHYSICS)) && abs(player->mo->standingslope->zdelta) > FRACUNIT/2) { // Factor thrust to slope, but only for the part pushing up it! // The rest is unaffected. angle_t thrustangle = R_PointToAngle2(0, 0, totalthrust.x, totalthrust.y)-player->mo->standingslope->xydirection; From ad61050bb07825453b83fdd8735c2e85460d6ac2 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 16:01:05 +0100 Subject: [PATCH 064/150] Whitespace removal. --- src/p_mobj.c | 2 +- src/p_slopes.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 775cd9d6d..35d8f1ad2 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1401,7 +1401,7 @@ fixed_t P_GetMobjGravity(mobj_t *mo) if (mo->player && !!(mo->eflags & MFE_VERTICALFLIP) != wasflip) P_PlayerFlip(mo); - + return gravityadd; } diff --git a/src/p_slopes.c b/src/p_slopes.c index f4ef4dcc2..462f7c3cb 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -1021,7 +1021,7 @@ void P_QuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope) { if (slope->flags & SL_NOPHYSICS) return; // No physics, no quantizing. - + vector3_t axis; axis.x = -slope->d.y; axis.y = slope->d.x; @@ -1051,14 +1051,14 @@ void P_SlopeLaunch(mobj_t *mo) mo->momy = slopemom.y; mo->momz = slopemom.z/2; } - + //CONS_Printf("Launched off of slope.\n"); mo->standingslope = NULL; } // Function to help handle landing on slopes void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) -{ +{ if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated. if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope thing->momz = -P_MobjFlip(thing); @@ -1096,7 +1096,7 @@ void P_ButteredSlope(mobj_t *mo) if (!mo->standingslope) return; - + if (mo->standingslope->flags & SL_NOPHYSICS) return; // No physics, no butter. From bd588ad0f4bed71863f9b4a3d47661b38d70511d Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 31 May 2016 11:05:59 -0400 Subject: [PATCH 065/150] travis-ci: note down what version of clang we are compiling with --- .travis.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index a6423b624..a5d1d0f67 100644 --- a/.travis.yml +++ b/.travis.yml @@ -131,7 +131,7 @@ matrix: - p7zip-full - clang-3.6 compiler: clang-3.6 - # + #Ubuntu clang version 3.6.2-svn240577-1~exp1 (branches/release_36) (based on LLVM 3.6.2) - os: linux addons: apt: @@ -146,7 +146,7 @@ matrix: - p7zip-full - clang-3.7 compiler: clang-3.7 - # + #Ubuntu clang version 3.7.1-svn253571-1~exp1 (branches/release_37) (based on LLVM 3.7.1) - os: linux addons: apt: @@ -161,7 +161,7 @@ matrix: - p7zip-full - clang-3.8 compiler: clang-3.8 - # + #clang version 3.8.1-svn271127-1~exp1 (branches/release_38) - os: osx osx_image: beta-xcode6.1 #Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn) From 8b2b49fb043ee32a8269ff4a0fe2db74c47e3d1a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 31 May 2016 16:08:29 +0100 Subject: [PATCH 066/150] Just some final cleanup of the code I changed --- src/r_segs.c | 59 ++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 41 deletions(-) diff --git a/src/r_segs.c b/src/r_segs.c index 99324d03f..ec3eaa180 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1486,21 +1486,11 @@ static void R_RenderSegLoop (void) } else { - // note: don't use min/max macros here + // note: don't use min/max macros, since casting from INT32 to INT16 is involved here if (markceiling) - { - if (yl >= 0) - ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); - else - ceilingclip[rw_x] = -1; - } - else if (markfloor) - { - if (yh < viewheight) - floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); - else - floorclip[rw_x] = (INT16)viewheight; - } + ceilingclip[rw_x] = (yh >= 0) ? ((yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1)) : -1; + if (markfloor) + floorclip[rw_x] = (yh < viewheight) ? ((yh < -1) ? -1 : (INT16)((INT16)yh + 1)) : (INT16)viewheight; } } else @@ -1515,9 +1505,11 @@ static void R_RenderSegLoop (void) if (mid >= floorclip[rw_x]) mid = floorclip[rw_x]-1; - if (mid >= yl && yl < viewheight) + if (mid >= yl) // back ceiling lower than front ceiling ? { - if (mid >= 0) + if (yl >= viewheight) // entirely off bottom of screen + ceilingclip[rw_x] = (INT16)viewheight; + else if (mid >= 0) // safe to draw top texture { dc_yl = yl; dc_yh = mid; @@ -1527,21 +1519,14 @@ static void R_RenderSegLoop (void) colfunc(); ceilingclip[rw_x] = (INT16)mid; } - else + else // entirely off top of screen ceilingclip[rw_x] = -1; } - else if (yl >= 0) - ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); else - ceilingclip[rw_x] = -1; + ceilingclip[rw_x] = (yh >= 0) ? ((yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1)) : -1; } else if (markceiling) // no top wall - { - if (yl >= 0) - ceilingclip[rw_x] = (yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1); - else - ceilingclip[rw_x] = -1; - } + ceilingclip[rw_x] = (yh >= 0) ? ((yl > viewheight) ? (INT16)viewheight : (INT16)((INT16)yl - 1)) : -1; if (bottomtexture) { @@ -1553,9 +1538,11 @@ static void R_RenderSegLoop (void) if (mid <= ceilingclip[rw_x]) mid = ceilingclip[rw_x]+1; - if (mid <= yh && yh >= 0) + if (mid <= yh) // back floor higher than front floor ? { - if (mid < viewheight) + if (yh < 0) // entirely off top of screen + floorclip[rw_x] = -1; + else if (mid < viewheight) // safe to draw bottom texture { dc_yl = mid; dc_yh = yh; @@ -1566,26 +1553,16 @@ static void R_RenderSegLoop (void) colfunc(); floorclip[rw_x] = (INT16)mid; } - else + else // entirely off bottom of screen floorclip[rw_x] = (INT16)viewheight; } - else if (yh < viewheight) - floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); else - floorclip[rw_x] = (INT16)viewheight; + floorclip[rw_x] = (yh < viewheight) ? ((yh < -1) ? -1 : (INT16)((INT16)yh + 1)) : (INT16)viewheight; } else if (markfloor) // no bottom wall - { - if (yh < viewheight) - floorclip[rw_x] = (yh < -1) ? -1 : (INT16)((INT16)yh + 1); - else - floorclip[rw_x] = (INT16)viewheight; - } + floorclip[rw_x] = (yh < viewheight) ? ((yh < -1) ? -1 : (INT16)((INT16)yh + 1)) : (INT16)viewheight; } - if (floorclip[rw_x] > viewheight) - I_Error("floorclip[%d] > viewheight (value is %d)", rw_x, floorclip[rw_x]); - if (maskedtexture || numthicksides) { // save texturecol From 6058eec1c9c4c0b5129c72f94dce0e4a7dca01d8 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 16:14:21 +0100 Subject: [PATCH 067/150] Holy shit. I spent two hours staring at how garbage this code was and didn't even realise it was #ifdef'd out behind a define not even mentioned in doomdef.h. It's not actually used anywhere (superseded entirely by the much nicer, much more relevant P_NewVertexSlope()... out with you, ancient, foul demons who should've been SPRINGCLEANed long ago. --- src/p_slopes.c | 255 ------------------------------------------------- src/p_slopes.h | 20 ---- 2 files changed, 275 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index 462f7c3cb..cb5f07b2b 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -624,261 +624,6 @@ pslope_t *P_SlopeById(UINT16 id) return ret; } -#ifdef SPRINGCLEAN -#include "byteptr.h" - -#include "p_setup.h" -#include "p_local.h" - -//========================================================================== -// -// P_SetSlopesFromVertexHeights -// -//========================================================================== -void P_SetSlopesFromVertexHeights(lumpnum_t lumpnum) -{ - mapthing_t *mt; - boolean vt_found = false; - size_t i, j, k, l, q; - - //size_t i; - //mapthing_t *mt; - char *data; - char *datastart; - - // SRB2CBTODO: WHAT IS (5 * sizeof (short))?! It = 10 - // anything else seems to make a map not load properly, - // but this hard-coded value MUST have some reason for being what it is - size_t snummapthings = W_LumpLength(lumpnum) / (5 * sizeof (short)); - mapthing_t *smapthings = Z_Calloc(snummapthings * sizeof (*smapthings), PU_LEVEL, NULL); - fixed_t x, y; - sector_t *sector; - // Spawn axis points first so they are - // at the front of the list for fast searching. - data = datastart = W_CacheLumpNum(lumpnum, PU_LEVEL); - mt = smapthings; - for (i = 0; i < snummapthings; i++, mt++) - { - mt->x = READINT16(data); - mt->y = READINT16(data); - mt->angle = READINT16(data); - mt->type = READINT16(data); - mt->options = READINT16(data); - // mt->z hasn't been set yet! - //mt->extrainfo = (byte)(mt->type >> 12); // slope things are special, they have a bigger range of types - - //mt->type &= 4095; // SRB2CBTODO: WHAT IS THIS???? Mobj type limits?!!!! - x = mt->x*FRACUNIT; - y = mt->y*FRACUNIT; - sector = R_PointInSubsector(x, y)->sector; - // Z for objects -#ifdef ESLOPE - if (sector->f_slope) - mt->z = (short)(P_GetZAt(sector->f_slope, x, y)>>FRACBITS); - else -#endif - mt->z = (short)(sector->floorheight>>FRACBITS); - - mt->z = mt->z + (mt->options >> ZSHIFT); - - if (mt->type == THING_VertexFloorZ || mt->type == THING_VertexCeilingZ) // THING_VertexFloorZ - { - for(l = 0; l < numvertexes; l++) - { - if (vertexes[l].x == mt->x*FRACUNIT && vertexes[l].y == mt->y*FRACUNIT) - { - if (mt->type == THING_VertexFloorZ) - { - vertexes[l].z = mt->z*FRACUNIT; - //I_Error("Z value: %i", vertexes[l].z/FRACUNIT); - - } - else - { - vertexes[l].z = mt->z*FRACUNIT; // celing floor - } - vt_found = true; - } - } - //mt->type = 0; // VPHYSICS: Dynamic slopes - - - - - - - if (vt_found) - { - for (k = 0; k < numsectors; k++) - { - sector_t *sec = §ors[k]; - if (sec->linecount != 3) continue; // only works with triangular sectors - - v3float_t vt1, vt2, vt3; // cross = ret->normalf - v3float_t vec1, vec2; - - int vi1, vi2, vi3; - - vi1 = (int)(sec->lines[0]->v1 - vertexes); - vi2 = (int)(sec->lines[0]->v2 - vertexes); - vi3 = (sec->lines[1]->v1 == sec->lines[0]->v1 || sec->lines[1]->v1 == sec->lines[0]->v2)? - (int)(sec->lines[1]->v2 - vertexes) : (int)(sec->lines[1]->v1 - vertexes); - - //if (vertexes[vi1].z) - // I_Error("OSNAP %i", vertexes[vi1].z/FRACUNIT); - //if (vertexes[vi2].z) - // I_Error("OSNAP %i", vertexes[vi2].z/FRACUNIT); - //if (vertexes[vi3].z) - // I_Error("OSNAP %i", vertexes[vi3].z/FRACUNIT); - - //I_Error("%i, %i", mt->z*FRACUNIT, vertexes[vi1].z); - - //I_Error("%i, %i, %i", mt->x, mt->y, mt->z); - //P_SpawnMobj(mt->x*FRACUNIT, mt->y*FRACUNIT, mt->z*FRACUNIT, MT_RING); - - // TODO: Make sure not to spawn in the same place 2x! (we need an object in every vertex of the - // triangle sector to setup the real vertex slopes - // Check for the vertexes of all sectors - for(q = 0; q < numvertexes; q++) - { - if (vertexes[q].x == mt->x*FRACUNIT && vertexes[q].y == mt->y*FRACUNIT) - { - //I_Error("yeah %i", vertexes[q].z); - P_SpawnMobj(vertexes[q].x, vertexes[q].y, vertexes[q].z, MT_RING); -#if 0 - if ((mt->y*FRACUNIT == vertexes[vi1].y && mt->x*FRACUNIT == vertexes[vi1].x && mt->z*FRACUNIT == vertexes[vi1].z) - && !(mt->y*FRACUNIT == vertexes[vi2].y && mt->x*FRACUNIT == vertexes[vi2].x && mt->z*FRACUNIT == vertexes[vi2].z) - && !(mt->y*FRACUNIT == vertexes[vi3].y && mt->x*FRACUNIT == vertexes[vi3].x && mt->z*FRACUNIT == vertexes[vi3].z)) - P_SpawnMobj(vertexes[vi1].x, vertexes[vi1].y, vertexes[vi1].z, MT_RING); - else if ((mt->y*FRACUNIT == vertexes[vi2].y && mt->x*FRACUNIT == vertexes[vi2].x && mt->z*FRACUNIT == vertexes[vi2].z) - && !(mt->y*FRACUNIT == vertexes[vi1].y && mt->x*FRACUNIT == vertexes[vi1].x && mt->z*FRACUNIT == vertexes[vi1].z) - && !(mt->y*FRACUNIT == vertexes[vi3].y && mt->x*FRACUNIT == vertexes[vi3].x && mt->z*FRACUNIT == vertexes[vi3].z)) - P_SpawnMobj(vertexes[vi2].x, vertexes[vi2].y, vertexes[vi2].z, MT_BOUNCETV); - else if ((mt->y*FRACUNIT == vertexes[vi3].y && mt->x*FRACUNIT == vertexes[vi3].x && mt->z*FRACUNIT == vertexes[vi3].z) - && !(mt->y*FRACUNIT == vertexes[vi2].y && mt->x*FRACUNIT == vertexes[vi2].x && mt->z*FRACUNIT == vertexes[vi2].z) - && !(mt->y*FRACUNIT == vertexes[vi1].y && mt->x*FRACUNIT == vertexes[vi1].x && mt->z*FRACUNIT == vertexes[vi1].z)) - P_SpawnMobj(vertexes[vi3].x, vertexes[vi3].y, vertexes[vi3].z, MT_GFZFLOWER1); - else -#endif - continue; - } - } - - vt1.x = FIXED_TO_FLOAT(vertexes[vi1].x); - vt1.y = FIXED_TO_FLOAT(vertexes[vi1].y); - vt2.x = FIXED_TO_FLOAT(vertexes[vi2].x); - vt2.y = FIXED_TO_FLOAT(vertexes[vi2].y); - vt3.x = FIXED_TO_FLOAT(vertexes[vi3].x); - vt3.y = FIXED_TO_FLOAT(vertexes[vi3].y); - - for(j = 0; j < 2; j++) - { - - fixed_t z3; - //I_Error("Lo hicimos"); - - vt1.z = mt->z;//FIXED_TO_FLOAT(j==0 ? sec->floorheight : sec->ceilingheight); - vt2.z = mt->z;//FIXED_TO_FLOAT(j==0? sec->floorheight : sec->ceilingheight); - z3 = mt->z;//j==0? sec->floorheight : sec->ceilingheight; // Destination height - vt3.z = FIXED_TO_FLOAT(z3); - - if (P_PointOnLineSide(vertexes[vi3].x, vertexes[vi3].y, sec->lines[0]) == 0) - { - vec1.x = vt2.x - vt3.x; - vec1.y = vt2.y - vt3.y; - vec1.z = vt2.z - vt3.z; - - vec2.x = vt1.x - vt3.x; - vec2.y = vt1.y - vt3.y; - vec2.z = vt1.z - vt3.z; - } - else - { - vec1.x = vt1.x - vt3.x; - vec1.y = vt1.y - vt3.y; - vec1.z = vt1.z - vt3.z; - - vec2.x = vt2.x - vt3.x; - vec2.y = vt2.y - vt3.y; - vec2.z = vt2.z - vt3.z; - } - - - pslope_t *ret = Z_Malloc(sizeof(pslope_t), PU_LEVEL, NULL); - memset(ret, 0, sizeof(*ret)); - - { - M_CrossProduct3f(&ret->normalf, &vec1, &vec2); - - // Cross product length - float len = (float)sqrt(ret->normalf.x * ret->normalf.x + - ret->normalf.y * ret->normalf.y + - ret->normalf.z * ret->normalf.z); - - if (len == 0) - { - // Only happens when all vertices in this sector are on the same line. - // Let's just ignore this case. - //CONS_Printf("Slope thing at (%d,%d) lies directly on its target line.\n", (int)(x>>16), (int)(y>>16)); - return; - } - // cross/len - ret->normalf.x /= len; - ret->normalf.y /= len; - ret->normalf.z /= len; - - // ZDoom cross = ret->normalf - // Fix backward normals - if ((ret->normalf.z < 0 && j == 0) || (ret->normalf.z > 0 && j == 1)) - { - // cross = -cross - ret->normalf.x = -ret->normalf.x; - ret->normalf.y = -ret->normalf.x; - ret->normalf.z = -ret->normalf.x; - } - } - - secplane_t *srcplane = Z_Calloc(sizeof(*srcplane), PU_LEVEL, NULL); - - srcplane->a = FLOAT_TO_FIXED (ret->normalf.x); - srcplane->b = FLOAT_TO_FIXED (ret->normalf.y); - srcplane->c = FLOAT_TO_FIXED (ret->normalf.z); - //srcplane->ic = FixedDiv(FRACUNIT, srcplane->c); - srcplane->d = -TMulScale16 (srcplane->a, vertexes[vi3].x, - srcplane->b, vertexes[vi3].y, - srcplane->c, z3); - - if (j == 0) - { - sec->f_slope = ret; - sec->f_slope->secplane = *srcplane; - } - else if (j == 1) - { - sec->c_slope = ret; - sec->c_slope->secplane = *srcplane; - } - } - } - } - - - - - - - - - } - } - Z_Free(datastart); - - - - -} -#endif - // Reset the dynamic slopes pointer, and read all of the fancy schmancy slopes void P_ResetDynamicSlopes(void) { size_t i; diff --git a/src/p_slopes.h b/src/p_slopes.h index 80921a84b..dd9b6f2d2 100644 --- a/src/p_slopes.h +++ b/src/p_slopes.h @@ -21,26 +21,6 @@ void P_RunDynamicSlopes(void); // sectors. void P_SpawnSlope_Line(int linenum); -#ifdef SPRINGCLEAN -// Loads just map objects that make slopes, -// terrain affecting objects have to be spawned first -void P_SetSlopesFromVertexHeights(lumpnum_t lumpnum); - -typedef enum -{ - THING_SlopeFloorPointLine = 9500, - THING_SlopeCeilingPointLine = 9501, - THING_SetFloorSlope = 9502, - THING_SetCeilingSlope = 9503, - THING_CopyFloorPlane = 9510, - THING_CopyCeilingPlane = 9511, - THING_VavoomFloor=1500, - THING_VavoomCeiling=1501, - THING_VertexFloorZ=1504, - THING_VertexCeilingZ=1505, -} slopething_e; -#endif - // // P_CopySectorSlope // From da2abbb39ff5302ee7a86e0dd717f1185af0a00a Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 16:24:51 +0100 Subject: [PATCH 068/150] Failed a build because C is an obnoxious language. --- src/p_slopes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index cb5f07b2b..bd354c500 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -764,10 +764,11 @@ fixed_t P_GetZAt(pslope_t *slope, fixed_t x, fixed_t y) // When given a vector, rotates it and aligns it to a slope void P_QuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope) { + vector3_t axis; // Fuck you, C90. + if (slope->flags & SL_NOPHYSICS) return; // No physics, no quantizing. - vector3_t axis; axis.x = -slope->d.y; axis.y = slope->d.x; axis.z = 0; @@ -804,6 +805,8 @@ void P_SlopeLaunch(mobj_t *mo) // Function to help handle landing on slopes void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) { + vector3_t mom; // Ditto. + if (slope->flags & SL_NOPHYSICS) { // No physics, no need to make anything complicated. if (P_MobjFlip(thing)*(thing->momz) < 0) { // falling, land on slope thing->momz = -P_MobjFlip(thing); @@ -812,7 +815,6 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) return; } - vector3_t mom; mom.x = thing->momx; mom.y = thing->momy; mom.z = thing->momz*2; From 2262e4aeb906cfb20852c3f2287cf68aa3571072 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 31 May 2016 11:26:29 -0400 Subject: [PATCH 069/150] travis-ci: allow clang-3.8 to fail --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index a5d1d0f67..cc10c23fb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -187,6 +187,8 @@ matrix: - os: osx osx_image: xcode7.3 #Apple LLVM version 7.3.0 (clang-703.0.31) + allow_failures: + - compiler: clang-3.8 cache: apt: true From d998ddfae46f0250d1336488fe3e99ca1d2c4c95 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 17:07:28 +0100 Subject: [PATCH 070/150] When you haven't found all the vertices, it's just not safe to carry on. Hit them with a descriptive I_Error so they don't get confused as hell like Glaber did. http://mb.srb2.org/showthread.php?t=41455 for reference. Also took the opportunity to nuke or otherwise neuter a bunch of Kalaron's bizzare ramblings (most are questions which have long-been answered by Red's efforts) at the same time. --- src/p_slopes.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index bd354c500..659f8b330 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -200,7 +200,6 @@ static fixed_t P_GetExtent(sector_t *sector, line_t *line) // Find furthest vertex from the reference line. It, along with the two ends // of the line, will define the plane. - // SRB2CBTODO: Use a formula to get the slope to slide objects depending on how steep for(i = 0; i < sector->linecount; i++) { line_t *li = sector->lines[i]; @@ -232,7 +231,6 @@ static fixed_t P_GetExtent(sector_t *sector, line_t *line) // // Creates one or more slopes based on the given line type and front/back // sectors. -// Kalaron: Check if dynamic slopes need recalculation // void P_SpawnSlope_Line(int linenum) { @@ -277,7 +275,7 @@ void P_SpawnSlope_Line(int linenum) ny = -FixedDiv(line->dx, len); } - // SRB2CBTODO: Transform origin relative to the bounds of an individual FOF + // TODO: Transform origin relative to the bounds of an individual FOF origin.x = line->v1->x + (line->v2->x - line->v1->x)/2; origin.y = line->v1->y + (line->v2->y - line->v1->y)/2; @@ -328,7 +326,7 @@ void P_SpawnSlope_Line(int linenum) // fslope->normal is a 3D line perpendicular to the 3D vector // Sync the linedata of the line that started this slope - // SRB2CBTODO: Anything special for remote(control sector)-based slopes later? + // TODO: Anything special for control sector based slopes later? fslope->sourceline = line; // To find the real highz/lowz of a slope, you need to check all the vertexes @@ -380,7 +378,7 @@ void P_SpawnSlope_Line(int linenum) cslope->refpos = 2; // Sync the linedata of the line that started this slope - // SRB2CBTODO: Anything special for remote(control sector)-based slopes later? + // TODO: Anything special for control sector based slopes later? cslope->sourceline = line; // Remember the way the slope is formed @@ -446,7 +444,7 @@ void P_SpawnSlope_Line(int linenum) fslope->refpos = 3; // Sync the linedata of the line that started this slope - // SRB2CBTODO: Anything special for remote(control sector)-based slopes later? + // TODO: Anything special for control sector based slopes later? fslope->sourceline = line; // Remember the way the slope is formed @@ -489,7 +487,7 @@ void P_SpawnSlope_Line(int linenum) cslope->refpos = 4; // Sync the linedata of the line that started this slope - // SRB2CBTODO: Anything special for remote(control sector)-based slopes later? + // TODO: Anything special for control sector based slopes later? cslope->sourceline = line; // Remember the way the slope is formed @@ -555,16 +553,11 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag ret->vertices[2] = mt; } - if (!ret->vertices[0]) - CONS_Printf("PANIC 0\n"); - if (!ret->vertices[1]) - CONS_Printf("PANIC 1\n"); - if (!ret->vertices[2]) - CONS_Printf("PANIC 2\n"); - // Now set heights for each vertex, because they haven't been set yet for (i = 0; i < 3; i++) { mt = ret->vertices[i]; + if (!mt) // If a vertex wasn't found, it's game over. There's nothing you can do to recover (except maybe try and kill the slope instead - TODO?) + I_Error("Slope vertex %d (for linedef tag %d) not found.", i, tag1); if (mt->extrainfo) mt->z = mt->options; else From d4d44777f43297f398247f8db81302d493f25763 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 17:43:27 +0100 Subject: [PATCH 071/150] Okay, now vertex slopes aren't placement-order-dependent any more. Hopefully this is the best way to handle things. --- src/p_slopes.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/p_slopes.c b/src/p_slopes.c index 659f8b330..d9e2cef66 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -546,9 +546,17 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag continue; if (!ret->vertices[0] && mt->angle == tag1) + { ret->vertices[0] = mt; + mt = mapthings; + i = 0; + } else if (!ret->vertices[1] && mt->angle == tag2) + { ret->vertices[1] = mt; + mt = mapthings; + i = 0; + } else if (!ret->vertices[2] && mt->angle == tag3) ret->vertices[2] = mt; } From 7071fbe29e5c078631c6dae366ca81bcbc570e34 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Tue, 31 May 2016 18:13:17 +0100 Subject: [PATCH 072/150] I made a mistake. Fuck git reverts, they are a nightmare, let's just do this the old fashioned way. --- src/p_slopes.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index d9e2cef66..659f8b330 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -546,17 +546,9 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag continue; if (!ret->vertices[0] && mt->angle == tag1) - { ret->vertices[0] = mt; - mt = mapthings; - i = 0; - } else if (!ret->vertices[1] && mt->angle == tag2) - { ret->vertices[1] = mt; - mt = mapthings; - i = 0; - } else if (!ret->vertices[2] && mt->angle == tag3) ret->vertices[2] = mt; } From d24cc494439fcc3b2a92048be256199b191cf8bb Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Tue, 31 May 2016 21:31:29 +0100 Subject: [PATCH 073/150] Fix FOF height checks all over p_spec.c to account for slopes This fixes certain sector specials and linedef executor specials etc not accounting for players/mobjs touching sloped FOFs --- src/p_spec.c | 81 ++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 24 deletions(-) diff --git a/src/p_spec.c b/src/p_spec.c index fbcb8b4f0..9e4c3f079 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -2434,10 +2434,10 @@ static void P_ProcessLineSpecial(line_t *line, mobj_t *mo, sector_t *callsec) if (rover->master->frontsector->tag != line->tag) continue; - if (mo->z > *rover->topheight) + if (mo->z > P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector)) continue; - if (mo->z + mo->height < *rover->bottomheight) + if (mo->z + mo->height < P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector)) continue; foundit = true; @@ -3227,8 +3227,8 @@ boolean P_IsFlagAtBase(mobjtype_t flag) if (GETSECSPECIAL(rover->master->frontsector->special, 4) != specialnum) continue; - if (mo->z <= *rover->topheight - && mo->z >= *rover->bottomheight) + if (mo->z <= P_GetSpecialTopZ(mo, sectors + rover->secnum, mo->subsector->sector) + && mo->z >= P_GetSpecialBottomZ(mo, sectors + rover->secnum, mo->subsector->sector)) return true; } } @@ -3262,12 +3262,17 @@ sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 n // Hmm.. maybe there's a FOF that has it... for (rover = player->mo->subsector->sector->ffloors; rover; rover = rover->next) { + fixed_t topheight, bottomheight; + if (GETSECSPECIAL(rover->master->frontsector->special, section) != number) continue; if (!(rover->flags & FF_EXISTS)) continue; + topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); + bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); + // Check the 3D floor's type... if (rover->flags & FF_BLOCKPLAYER) { @@ -3275,27 +3280,27 @@ sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 n if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)) { - if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != *rover->topheight) + if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != topheight) continue; } else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)) { if (!(player->mo->eflags & MFE_VERTICALFLIP) - || player->mo->z + player->mo->height != *rover->bottomheight) + || player->mo->z + player->mo->height != bottomheight) continue; } else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH) { - if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == *rover->bottomheight) - || (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == *rover->topheight))) + if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == bottomheight) + || (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == topheight))) continue; } } else { // Water and DEATH FOG!!! heh - if (player->mo->z > *rover->topheight || (player->mo->z + player->mo->height) < *rover->bottomheight) + if (player->mo->z > topheight || (player->mo->z + player->mo->height) < bottomheight) continue; } @@ -3317,12 +3322,17 @@ sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 n // Hmm.. maybe there's a FOF that has it... for (rover = node->m_sector->ffloors; rover; rover = rover->next) { + fixed_t topheight, bottomheight; + if (GETSECSPECIAL(rover->master->frontsector->special, section) != number) continue; if (!(rover->flags & FF_EXISTS)) continue; + topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); + bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, player->mo->subsector->sector); + // Check the 3D floor's type... if (rover->flags & FF_BLOCKPLAYER) { @@ -3330,27 +3340,27 @@ sector_t *P_PlayerTouchingSectorSpecial(player_t *player, INT32 section, INT32 n if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)) { - if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != *rover->topheight) + if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != topheight) continue; } else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)) { if (!(player->mo->eflags & MFE_VERTICALFLIP) - || player->mo->z + player->mo->height != *rover->bottomheight) + || player->mo->z + player->mo->height != bottomheight) continue; } else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH) { - if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == *rover->bottomheight) - || (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == *rover->topheight))) + if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == bottomheight) + || (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == topheight))) continue; } } else { // Water and DEATH FOG!!! heh - if (player->mo->z > *rover->topheight || (player->mo->z + player->mo->height) < *rover->bottomheight) + if (player->mo->z > topheight || (player->mo->z + player->mo->height) < bottomheight) continue; } @@ -4335,12 +4345,17 @@ sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) for (rover = sector->ffloors; rover; rover = rover->next) { + fixed_t topheight, bottomheight; + if (!rover->master->frontsector->special) continue; if (!(rover->flags & FF_EXISTS)) continue; + topheight = P_GetSpecialTopZ(mo, sectors + rover->secnum, sector); + bottomheight = P_GetSpecialBottomZ(mo, sectors + rover->secnum, sector); + // Check the 3D floor's type... if (((rover->flags & FF_BLOCKPLAYER) && mo->player) || ((rover->flags & FF_BLOCKOTHERS) && !mo->player)) @@ -4349,27 +4364,27 @@ sector_t *P_ThingOnSpecial3DFloor(mobj_t *mo) if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)) { - if ((mo->eflags & MFE_VERTICALFLIP) || mo->z != *rover->topheight) + if ((mo->eflags & MFE_VERTICALFLIP) || mo->z != topheight) continue; } else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)) { if (!(mo->eflags & MFE_VERTICALFLIP) - || mo->z + mo->height != *rover->bottomheight) + || mo->z + mo->height != bottomheight) continue; } else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH) { - if (!((mo->eflags & MFE_VERTICALFLIP && mo->z + mo->height == *rover->bottomheight) - || (!(mo->eflags & MFE_VERTICALFLIP) && mo->z == *rover->topheight))) + if (!((mo->eflags & MFE_VERTICALFLIP && mo->z + mo->height == bottomheight) + || (!(mo->eflags & MFE_VERTICALFLIP) && mo->z == topheight))) continue; } } else { // Water and intangible FOFs - if (mo->z > *rover->topheight || (mo->z + mo->height) < *rover->bottomheight) + if (mo->z > topheight || (mo->z + mo->height) < bottomheight) continue; } @@ -4391,12 +4406,17 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) for (rover = sector->ffloors; rover; rover = rover->next) { + fixed_t topheight, bottomheight; + if (!rover->master->frontsector->special) continue; if (!(rover->flags & FF_EXISTS)) continue; + topheight = P_GetSpecialTopZ(player->mo, sectors + rover->secnum, sector); + bottomheight = P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, sector); + // Check the 3D floor's type... if (rover->flags & FF_BLOCKPLAYER) { @@ -4404,27 +4424,27 @@ static void P_PlayerOnSpecial3DFloor(player_t *player, sector_t *sector) if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING)) { - if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != P_GetSpecialTopZ(player->mo, sectors + rover->secnum, sector)) + if ((player->mo->eflags & MFE_VERTICALFLIP) || player->mo->z != topheight) continue; } else if ((rover->master->frontsector->flags & SF_FLIPSPECIAL_CEILING) && !(rover->master->frontsector->flags & SF_FLIPSPECIAL_FLOOR)) { if (!(player->mo->eflags & MFE_VERTICALFLIP) - || player->mo->z + player->mo->height != P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, sector)) + || player->mo->z + player->mo->height != bottomheight) continue; } else if (rover->master->frontsector->flags & SF_FLIPSPECIAL_BOTH) { - if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, sector)) - || (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == P_GetSpecialTopZ(player->mo, sectors + rover->secnum, sector)))) + if (!((player->mo->eflags & MFE_VERTICALFLIP && player->mo->z + player->mo->height == bottomheight) + || (!(player->mo->eflags & MFE_VERTICALFLIP) && player->mo->z == topheight))) continue; } } else { // Water and DEATH FOG!!! heh - if (player->mo->z > P_GetSpecialTopZ(player->mo, sectors + rover->secnum, sector) || (player->mo->z + player->mo->height) < P_GetSpecialBottomZ(player->mo, sectors + rover->secnum, sector)) + if (player->mo->z > topheight || (player->mo->z + player->mo->height) < bottomheight) continue; } @@ -5276,7 +5296,15 @@ void T_LaserFlash(laserthink_t *flash) sourcesec = ffloor->master->frontsector; // Less to type! +#ifdef ESLOPE + top = (*ffloor->t_slope) ? P_GetZAt(*ffloor->t_slope, sector->soundorg.x, sector->soundorg.y) + : *ffloor->topheight; + bottom = (*ffloor->b_slope) ? P_GetZAt(*ffloor->b_slope, sector->soundorg.x, sector->soundorg.y) + : *ffloor->bottomheight; + sector->soundorg.z = (top + bottom)/2; +#else sector->soundorg.z = (*ffloor->topheight + *ffloor->bottomheight)/2; +#endif S_StartSound(§or->soundorg, sfx_laser); // Seek out objects to DESTROY! MUAHAHHAHAHAA!!!*cough* @@ -6875,6 +6903,11 @@ void T_Disappear(disappear_t *d) if (!(lines[d->sourceline].flags & ML_NOCLIMB)) { +#ifdef ESLOPE + if (*rover->t_slope) + sectors[s].soundorg.z = P_GetZAt(*rover->t_slope, sectors[s].soundorg.x, sectors[s].soundorg.y); + else +#endif sectors[s].soundorg.z = *rover->topheight; S_StartSound(§ors[s].soundorg, sfx_appear); } From 5401257c747f02d779780bd28dbb9beea299e092 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 31 May 2016 17:56:05 -0400 Subject: [PATCH 074/150] travis-ci: llvm's APT repos are offline for now --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index cc10c23fb..e54677ac4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -188,6 +188,9 @@ matrix: osx_image: xcode7.3 #Apple LLVM version 7.3.0 (clang-703.0.31) allow_failures: + - compiler: clang-3.5 + - compiler: clang-3.6 + - compiler: clang-3.7 - compiler: clang-3.8 cache: From f21c72b889ab0d358f3b66cc5029a342cd66b18a Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Tue, 31 May 2016 21:30:18 -0400 Subject: [PATCH 075/150] debug: always load exchndl.dll --- src/sdl/i_main.c | 2 ++ src/win32/win_main.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/src/sdl/i_main.c b/src/sdl/i_main.c index ab7631bc6..25fccb9f9 100644 --- a/src/sdl/i_main.c +++ b/src/sdl/i_main.c @@ -214,12 +214,14 @@ int main(int argc, char **argv) #if defined (_WIN32) && !defined (_XBOX) #ifndef _WIN32_WCE { +#if 0 // just load the DLL p_IsDebuggerPresent pfnIsDebuggerPresent = (p_IsDebuggerPresent)GetProcAddress(GetModuleHandleA("kernel32.dll"), "IsDebuggerPresent"); if ((!pfnIsDebuggerPresent || !pfnIsDebuggerPresent()) #ifdef BUGTRAP && !InitBugTrap() #endif ) +#endif { LoadLibraryA("exchndl.dll"); } diff --git a/src/win32/win_main.c b/src/win32/win_main.c index 9c9a20e75..663eddbd4 100644 --- a/src/win32/win_main.c +++ b/src/win32/win_main.c @@ -644,13 +644,16 @@ int WINAPI WinMain (HINSTANCE hInstance, { int Result = -1; +#if 0 // Win95 and NT <4 don't have this, so link at runtime. p_IsDebuggerPresent pfnIsDebuggerPresent = (p_IsDebuggerPresent)GetProcAddress(GetModuleHandleA("kernel32.dll"),"IsDebuggerPresent"); +#endif UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); UNREFERENCED_PARAMETER(nCmdShow); +#if 0 #ifdef BUGTRAP // Try BugTrap first. if((!pfnIsDebuggerPresent || !pfnIsDebuggerPresent()) && InitBugTrap()) @@ -660,6 +663,7 @@ int WINAPI WinMain (HINSTANCE hInstance, #endif // Try Dr MinGW's exception handler. if (!pfnIsDebuggerPresent || !pfnIsDebuggerPresent()) +#endif LoadLibraryA("exchndl.dll"); prevExceptionFilter = SetUnhandledExceptionFilter(RecordExceptionInfo); From 62c4338d60740d8147fab5503f23130f7604444f Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 1 Jun 2016 13:19:44 +0100 Subject: [PATCH 076/150] Added P_GetMobjGravity to Lua. Check /toaster/gravitytest.lua for sample script. --- src/lua_baselib.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 7678c7c49..05ba00d68 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -13,6 +13,7 @@ #include "doomdef.h" #ifdef HAVE_BLUA #include "p_local.h" +#include "p_mobj.h" // So we can have P_GetMobjGravity #include "p_setup.h" // So we can have P_SetupLevelSky #include "z_zone.h" #include "r_main.h" @@ -437,6 +438,16 @@ static int lib_pMobjFlip(lua_State *L) return 1; } +static int lib_pGetMobjGravity(lua_State *L) +{ + mobj_t *mobj = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); + //HUDSAFE + if (!mobj) + return LUA_ErrInvalid(L, "mobj_t"); + lua_pushinteger(L, P_GetMobjGravity(mobj)); + return 1; +} + static int lib_pWeaponOrPanel(lua_State *L) { mobjtype_t type = luaL_checkinteger(L, 1); @@ -2008,6 +2019,7 @@ static luaL_Reg lib[] = { {"P_SPMAngle",lib_pSPMAngle}, {"P_SpawnPlayerMissile",lib_pSpawnPlayerMissile}, {"P_MobjFlip",lib_pMobjFlip}, + {"P_GetMobjGravity",lib_pGetMobjGravity}, {"P_WeaponOrPanel",lib_pWeaponOrPanel}, {"P_FlashPal",lib_pFlashPal}, {"P_GetClosestAxis",lib_pGetClosestAxis}, From 76d108d760a004a6e522c3364452c89074c68f0b Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 1 Jun 2016 14:49:14 +0100 Subject: [PATCH 077/150] Whoops, didn't realise pushing fixed and integer were different. My mistake. --- src/lua_baselib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 05ba00d68..c88ece50c 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -444,7 +444,7 @@ static int lib_pGetMobjGravity(lua_State *L) //HUDSAFE if (!mobj) return LUA_ErrInvalid(L, "mobj_t"); - lua_pushinteger(L, P_GetMobjGravity(mobj)); + lua_pushfixed(L, P_GetMobjGravity(mobj)); return 1; } From d86dc67218e7d601fd79c1dfbedd6a38b5958c82 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 1 Jun 2016 11:23:30 -0400 Subject: [PATCH 078/150] travis-ci: add back xcode6.2 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e54677ac4..0102cc1b1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -172,7 +172,7 @@ matrix: # - os: osx # osx_image: beta-xcode6.3 # #I think xcode.6.3 VM is broken, it does not boot -# - os: osx + - os: osx osx_image: xcode6.4 #Apple LLVM version 6.1.0 (clang-602.0.53) (based on LLVM 3.6.0svn) - os: osx From ae8b45965c4eb13856faffa1d4330634d200250d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 1 Jun 2016 16:45:10 +0100 Subject: [PATCH 079/150] No Size_t --> int in an I_Error print! [/rhyme] --- src/p_slopes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index 659f8b330..4a8eadc5f 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -557,7 +557,7 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag for (i = 0; i < 3; i++) { mt = ret->vertices[i]; if (!mt) // If a vertex wasn't found, it's game over. There's nothing you can do to recover (except maybe try and kill the slope instead - TODO?) - I_Error("Slope vertex %d (for linedef tag %d) not found.", i, tag1); + I_Error("Slope vertex %s (for linedef tag %d) not found.", sizeu1(i), tag1); if (mt->extrainfo) mt->z = mt->options; else From bf85cc25bd85e776a9ce2a1ba2f499b936185cdc Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 1 Jun 2016 18:51:38 +0100 Subject: [PATCH 080/150] OpenGL: Fix lower unpegged texture offset, fix lower unpegged + effect 1 so the texture actually skews --- src/hardware/hw_main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index bec9cdb1b..18eecb776 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1719,12 +1719,12 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) if (!(gr_linedef->flags & ML_DONTPEGBOTTOM)) texturevpegbottom = 0; else if (gr_linedef->flags & ML_EFFECT1) - texturevpegbottom = worldtop - worldlow; + texturevpegbottom = worldbottom - worldlow; else - texturevpegbottom = gr_frontsector->ceilingheight - gr_backsector->floorheight; + texturevpegbottom = gr_frontsector->floorheight - gr_backsector->floorheight; #else if (gr_linedef->flags & ML_DONTPEGBOTTOM) - texturevpegbottom = worldtop - worldlow; + texturevpegbottom = worldbottom - worldlow; else texturevpegbottom = 0; #endif @@ -1752,9 +1752,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) else if (gr_linedef->flags & ML_DONTPEGBOTTOM) { // Skewed by bottom - wallVerts[0].t = (texturevpegbottom + worldlow - worldbottom) * grTex->scaleY; - wallVerts[2].t = wallVerts[3].t - (worldlowslope - worldlow) * grTex->scaleY; - wallVerts[1].t = wallVerts[2].t - (worldbottomslope - worldlowslope) * grTex->scaleY; + wallVerts[0].t = wallVerts[1].t = (texturevpegbottom + worldlow - worldbottom) * grTex->scaleY; + //wallVerts[3].t = wallVerts[0].t - (worldlow - worldbottom) * grTex->scaleY; // no need, [3] is already this + wallVerts[2].t = wallVerts[1].t - (worldlowslope - worldbottomslope) * grTex->scaleY; } else { From dfe5246636772a51f6f10c829815abc184dba777 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 1 Jun 2016 14:00:14 -0400 Subject: [PATCH 081/150] appveyor: only for taggeed master builds --- appveyor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/appveyor.yml b/appveyor.yml index fd949dbb3..85cee6a31 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -75,6 +75,9 @@ deploy: folder: appveyor application: active_mode: false + on: + branch: master + appveyor_repo_tag: true on_finish: From c863e311fe01f64f66e9850379491de2f2d19f7a Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Wed, 1 Jun 2016 19:22:54 +0100 Subject: [PATCH 082/150] OpenGL: Fix upper texture Effect 1 only skewing --- src/hardware/hw_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 18eecb776..c838e8325 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -1675,9 +1675,9 @@ static void HWR_StoreWallRange(double startfrac, double endfrac) else { // Skewed by bottom - wallVerts[0].t = (texturevpegtop + worldhigh - worldtop) * grTex->scaleY; - wallVerts[2].t = wallVerts[3].t - (worldhighslope - worldhigh) * grTex->scaleY; - wallVerts[1].t = wallVerts[2].t - (worldhighslope - worldtopslope) * grTex->scaleY; + wallVerts[0].t = wallVerts[1].t = (texturevpegtop + worldtop - worldhigh) * grTex->scaleY; + wallVerts[3].t = wallVerts[0].t - (worldtop - worldhigh) * grTex->scaleY; + wallVerts[2].t = wallVerts[1].t - (worldtopslope - worldhighslope) * grTex->scaleY; } #endif } From a7640e4d6c133fa1451aab9856476db5f0b84ea5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Wed, 1 Jun 2016 14:32:03 -0400 Subject: [PATCH 083/150] travis: compress the build cache --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 0102cc1b1..e3408cf6f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -214,6 +214,7 @@ before_script: - mkdir build - cd build - export CFLAGS="-Wall -W $WFLAGS" + - export CCACHE_COMPRESS=true - cmake .. -DCMAKE_BUILD_TYPE=Release before_install: From 44a6e8bb54db02e7085ddf7098fad38c56928210 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Wed, 1 Jun 2016 19:52:12 +0100 Subject: [PATCH 084/150] I_Error description syntax consistency (buzzword buzzword buzzword). --- src/p_slopes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index 4a8eadc5f..72abf02bb 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -557,7 +557,7 @@ static pslope_t *P_NewVertexSlope(INT16 tag1, INT16 tag2, INT16 tag3, UINT8 flag for (i = 0; i < 3; i++) { mt = ret->vertices[i]; if (!mt) // If a vertex wasn't found, it's game over. There's nothing you can do to recover (except maybe try and kill the slope instead - TODO?) - I_Error("Slope vertex %s (for linedef tag %d) not found.", sizeu1(i), tag1); + I_Error("P_NewVertexSlope: Slope vertex %s (for linedef tag %d) not found!", sizeu1(i), tag1); if (mt->extrainfo) mt->z = mt->options; else From 919e3ed0e242208290f358c172338c5515004ffe Mon Sep 17 00:00:00 2001 From: wolfy852 Date: Wed, 1 Jun 2016 21:06:24 -0500 Subject: [PATCH 085/150] Make token available to Lua as a global variable Reviewed by @RedEnchilada --- src/dehacked.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/dehacked.c b/src/dehacked.c index 199ea43ca..f7845af44 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8276,6 +8276,9 @@ static inline int lib_getenum(lua_State *L) } else if (fastcmp(word,"VERSIONSTRING")) { lua_pushstring(L, VERSIONSTRING); return 1; + } else if (fastcmp(word, "token")) { + lua_pushinteger(L, token); + return 1; } return 0; From 1493537dfc7f0d2544d621fbf30157a34693d29d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 14:39:41 +0100 Subject: [PATCH 086/150] Moved the standingslope check in P_ZMovement to after the FOF and height adjustment as it is in P_PlayerZMovement, as reccomended. Doesn't actually stop Crawla jittering, but might as well make it happen for consistency's sake. --- src/p_mobj.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 35d8f1ad2..acf5b1b36 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2165,16 +2165,6 @@ static boolean P_ZMovement(mobj_t *mo) I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); -#ifdef ESLOPE - if (mo->standingslope) - { - if (mo->flags & MF_NOCLIPHEIGHT) - mo->standingslope = NULL; - else if (!P_IsObjectOnGround(mo)) - P_SlopeLaunch(mo); - } -#endif - // Intercept the stupid 'fall through 3dfloors' bug if (mo->subsector->sector->ffloors) P_AdjustMobjFloorZ_FFloors(mo, mo->subsector->sector, 0); @@ -2189,6 +2179,16 @@ static boolean P_ZMovement(mobj_t *mo) } mo->z += mo->momz; +#ifdef ESLOPE + if (mo->standingslope) + { + if (mo->flags & MF_NOCLIPHEIGHT) + mo->standingslope = NULL; + else if (!P_IsObjectOnGround(mo)) + P_SlopeLaunch(mo); + } +#endif + switch (mo->type) { case MT_THROWNBOUNCE: From 213a9632ca4b5cd68902bc805cc625d5b24d3e41 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 16:09:33 +0100 Subject: [PATCH 087/150] Let's multiply the thrust by the mobj's friction. You should have less chance of purchase on a slippery slope (tee hee) and more on a rough one, but the slopes were basically identical during testing before I implemented this change. --- src/p_slopes.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index 72abf02bb..ec07ab2fe 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -864,8 +864,6 @@ void P_ButteredSlope(mobj_t *mo) mult = FINECOSINE(angle >> ANGLETOFINESHIFT); } - //CONS_Printf("%d\n", mult); - thrust = FixedMul(thrust, FRACUNIT*2/3 + mult/8); } @@ -873,11 +871,18 @@ void P_ButteredSlope(mobj_t *mo) thrust = FixedMul(thrust, FRACUNIT+P_AproxDistance(mo->momx, mo->momy)/16); // This makes it harder to zigzag up steep slopes, as well as allows greater top speed when rolling down - // Multiply by gravity - thrust = FixedMul(thrust, FixedMul(gravity, abs(P_GetMobjGravity(mo)))); // Now uses the absolute of mobj gravity. You're welcome. - // Multiply by scale (gravity strength depends on mobj scale) + // The strength of gravity depends on the global gravity base setting... + thrust = FixedMul(thrust, gravity); + + // ...the sector-based gravity strength... + thrust = FixedMul(thrust, abs(P_GetMobjGravity(mo))); + + // ...and the scale of the object. thrust = FixedMul(thrust, mo->scale); + // Let's also multiply by friction for good measure. + thrust = FixedMul(thrust, mo->friction); + P_Thrust(mo, mo->standingslope->xydirection, thrust); } From 882622d2e70616376e81f82b8471645a1ac75721 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 16:42:07 +0100 Subject: [PATCH 088/150] ...I made two major mistakes with P_GetMobjGravity. *Didn't take into account object scale *Doubled force when on the ground (ignore what the comment of the line I moved says, it was relevant for slopes...) This also led to a mistake with slopes, where I was double-multiplying by the gravity constant to get half (because of a quirk of numbers...) --- src/p_mobj.c | 10 ++++++---- src/p_slopes.c | 12 +++--------- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index acf5b1b36..843123d57 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1316,9 +1316,6 @@ fixed_t P_GetMobjGravity(mobj_t *mo) if (mo->eflags & MFE_UNDERWATER && !goopgravity) gravityadd = gravityadd/3; - if (!mo->momz) // mobj at stop, no floor, so feel the push of gravity! - gravityadd <<= 1; - if (mo->player) { if (mo->player->charability == CA_FLY && (mo->player->powers[pw_tailsfly] @@ -1402,6 +1399,8 @@ fixed_t P_GetMobjGravity(mobj_t *mo) if (mo->player && !!(mo->eflags & MFE_VERTICALFLIP) != wasflip) P_PlayerFlip(mo); + gravityadd = FixedMul(gravityadd, mo->scale); + return gravityadd; } @@ -1416,8 +1415,11 @@ void P_CheckGravity(mobj_t *mo, boolean affect) { fixed_t gravityadd = P_GetMobjGravity(mo); + if (!mo->momz) // mobj at stop, no floor, so feel the push of gravity! + gravityadd <<= 1; + if (affect) - mo->momz += FixedMul(gravityadd, mo->scale); + mo->momz += gravityadd; if (mo->type == MT_SKIM && mo->z + mo->momz <= mo->watertop && mo->z >= mo->watertop) { diff --git a/src/p_slopes.c b/src/p_slopes.c index ec07ab2fe..ed25f00f3 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -812,7 +812,7 @@ void P_HandleSlopeLanding(mobj_t *thing, pslope_t *slope) mom.y = thing->momy; mom.z = thing->momz*2; - //CONS_Printf("langing on slope\n"); + //CONS_Printf("Landing on slope\n"); // Reverse quantizing might could use its own function later slope->zangle = ANGLE_MAX-slope->zangle; @@ -871,16 +871,10 @@ void P_ButteredSlope(mobj_t *mo) thrust = FixedMul(thrust, FRACUNIT+P_AproxDistance(mo->momx, mo->momy)/16); // This makes it harder to zigzag up steep slopes, as well as allows greater top speed when rolling down - // The strength of gravity depends on the global gravity base setting... - thrust = FixedMul(thrust, gravity); - - // ...the sector-based gravity strength... + // Let's get the gravity strength for the object... thrust = FixedMul(thrust, abs(P_GetMobjGravity(mo))); - // ...and the scale of the object. - thrust = FixedMul(thrust, mo->scale); - - // Let's also multiply by friction for good measure. + // ... and its friction against the ground for good measure. thrust = FixedMul(thrust, mo->friction); P_Thrust(mo, mo->standingslope->xydirection, thrust); From c1caf2132328985fc5abdbe65f08dc22bbd0aa8e Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Thu, 2 Jun 2016 16:51:12 +0100 Subject: [PATCH 089/150] Reccomended by MI: Dividing by the original friction value just so slopes with normal friction don't behave differently between next and this branch. --- src/p_slopes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_slopes.c b/src/p_slopes.c index ed25f00f3..797c6a558 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -874,8 +874,8 @@ void P_ButteredSlope(mobj_t *mo) // Let's get the gravity strength for the object... thrust = FixedMul(thrust, abs(P_GetMobjGravity(mo))); - // ... and its friction against the ground for good measure. - thrust = FixedMul(thrust, mo->friction); + // ... and its friction against the ground for good measure (divided by original friction to keep behaviour for normal slopes the same). + thrust = FixedMul(thrust, FixedDiv(mo->friction, ORIG_FRICTION)); P_Thrust(mo, mo->standingslope->xydirection, thrust); } From 83c4dba4cee64f1bc1432f08cc5ba75aac822c24 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 2 Jun 2016 20:16:25 +0100 Subject: [PATCH 090/150] Fix crash reported by FuriousFox at http://mb.srb2.org/showthread.php?t=41536 Basically this makes sure numwadfiles is updated before loading the SOC/Lua scripts, so if a Lua script calls COM_BufInsertText with the contents "addfile scr_mysticrealm.wad" it can't overwrite the last written wadfile slot! Not that COM_BufInsertText really should be used like that to begin with --- src/w_wad.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/w_wad.c b/src/w_wad.c index 40fea5223..aeaad3ced 100644 --- a/src/w_wad.c +++ b/src/w_wad.c @@ -475,11 +475,11 @@ UINT16 W_LoadWadFile(const char *filename) // CONS_Printf(M_GetText("Added file %s (%u lumps)\n"), filename, numlumps); wadfiles[numwadfiles] = wadfile; - W_LoadDehackedLumps(numwadfiles); + numwadfiles++; // must come BEFORE W_LoadDehackedLumps, so any addfile called by COM_BufInsertText called by Lua doesn't overwrite what we just loaded + W_LoadDehackedLumps(numwadfiles-1); W_InvalidateLumpnumCache(); - numwadfiles++; return wadfile->numlumps; } From 4c422f66050509826b08d8ed28b3d3acf44150b1 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 4 Jun 2016 18:31:21 +0100 Subject: [PATCH 091/150] OpenGL: closed door/window detection code now accounts for slopes, just like in software --- src/hardware/hw_main.c | 58 ++++++++++++++++++++++++++++++++++++------ 1 file changed, 50 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index c838e8325..35a01ffd1 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2892,15 +2892,57 @@ static void HWR_AddLine(seg_t * line) gr_backsector = R_FakeFlat(gr_backsector, &tempsec, NULL, NULL, true); - // Closed door. - if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || - gr_backsector->floorheight >= gr_frontsector->ceilingheight) - goto clipsolid; +#ifdef ESLOPE + if (gr_frontsector->f_slope || gr_frontsector->c_slope || gr_backsector->f_slope || gr_backsector->c_slope) + { + fixed_t v1x, v1y, v2x, v2y; // the seg's vertexes as fixed_t + fixed_t frontf1,frontf2, frontc1, frontc2; // front floor/ceiling ends + fixed_t backf1, backf2, backc1, backc2; // back floor ceiling ends - // Window. - if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || - gr_backsector->floorheight != gr_frontsector->floorheight) - goto clippass; + v1x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->x); + v1y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v1)->y); + v2x = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->x); + v2y = FLOAT_TO_FIXED(((polyvertex_t *)gr_curline->v2)->y); +#define SLOPEPARAMS(slope, end1, end2, normalheight) \ + if (slope) { \ + end1 = P_GetZAt(slope, v1x, v1y); \ + end2 = P_GetZAt(slope, v2x, v2y); \ + } else \ + end1 = end2 = normalheight; + + SLOPEPARAMS(gr_frontsector->f_slope, frontf1, frontf2, gr_frontsector->floorheight) + SLOPEPARAMS(gr_frontsector->c_slope, frontc1, frontc2, gr_frontsector->ceilingheight) + SLOPEPARAMS( gr_backsector->f_slope, backf1, backf2, gr_backsector->floorheight) + SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) +#undef SLOPEPARAMS + + // Closed door. + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } + + // Window. + if (backc1 != frontc1 || backc2 != frontc2 + || backf1 != frontf1 || backf2 != frontf2) + { + goto clippass; + } + } + else +#endif + { + // Closed door. + if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || + gr_backsector->floorheight >= gr_frontsector->ceilingheight) + goto clipsolid; + + // Window. + if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || + gr_backsector->floorheight != gr_frontsector->floorheight) + goto clippass; + } // Reject empty lines used for triggers and special events. // Identical floor and ceiling on both sides, From ba528a075ee578bd4b10d4f1bb56b424c6e1ae44 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Sat, 4 Jun 2016 19:47:40 +0100 Subject: [PATCH 092/150] Last few changes as reccomended by Red. (<3 u, no hetero) --- src/doomdef.h | 2 +- src/p_slopes.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/src/doomdef.h b/src/doomdef.h index e645c0848..cec46a32c 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -431,7 +431,7 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// Kalaron/Eternity Engine slope code (SRB2CB ported) #define ESLOPE -#if defined(ESLOPE) +#ifdef ESLOPE /// Backwards compatibility with SRB2CB's slope linedef types. /// \note A simple shim that prints a warning. #define ESLOPE_TYPESHIM diff --git a/src/p_slopes.c b/src/p_slopes.c index 797c6a558..b6338d95d 100644 --- a/src/p_slopes.c +++ b/src/p_slopes.c @@ -275,7 +275,6 @@ void P_SpawnSlope_Line(int linenum) ny = -FixedDiv(line->dx, len); } - // TODO: Transform origin relative to the bounds of an individual FOF origin.x = line->v1->x + (line->v2->x - line->v1->x)/2; origin.y = line->v1->y + (line->v2->y - line->v1->y)/2; From 69f556d40a281caa75697bf2241703418c763648 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 5 Jun 2016 21:29:40 +0100 Subject: [PATCH 093/150] Split AA trees code from m_misc.c/.h into m_aatree.c/.h Also updated any relevant project files that I can think of to include the new files, as well as the makefile of course. Some of the other project files haven't been touched in years so I'll leave those alone ...unless someone objects --- SRB2.cbp | 33 +++++ src/CMakeLists.txt | 2 + src/Makefile | 1 + src/m_aatree.c | 167 +++++++++++++++++++++++++ src/m_aatree.h | 31 +++++ src/m_misc.c | 155 ----------------------- src/m_misc.h | 13 -- src/sdl/Srb2SDL-vc10.vcxproj | 2 + src/sdl/Srb2SDL-vc10.vcxproj.filters | 6 + src/w_wad.h | 4 +- src/win32/Srb2win-vc10.vcxproj | 2 + src/win32/Srb2win-vc10.vcxproj.filters | 6 + 12 files changed, 251 insertions(+), 171 deletions(-) create mode 100644 src/m_aatree.c create mode 100644 src/m_aatree.h diff --git a/SRB2.cbp b/SRB2.cbp index 43696ee2e..99a712264 100644 --- a/SRB2.cbp +++ b/SRB2.cbp @@ -2815,6 +2815,39 @@ HW3SOUND for 3D hardware sound support