From baa82c396cec4a2c04d728de47d7a161ba95ab87 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Jun 2013 14:25:48 +0200 Subject: [PATCH 01/11] - disabled Heretic's 'joke' cheats and Chex's 'idmus' in 'allcheats' mode because their multiple occurence interfered with how the cheat parser works. --- src/st_stuff.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/st_stuff.cpp b/src/st_stuff.cpp index bbfad744a..8679e967c 100644 --- a/src/st_stuff.cpp +++ b/src/st_stuff.cpp @@ -208,8 +208,6 @@ static cheatseq_t HereticCheats[] = { CheatPonce, 0, 0, 0, {CHT_HEALTH,0}, Cht_Generic }, { CheatSkel, 0, 0, 0, {CHT_KEYS,0}, Cht_Generic }, { CheatChicken, 0, 0, 0, {CHT_MORPH,0}, Cht_Generic }, - { CheatAmmo, 0, 0, 0, {CHT_TAKEWEAPS,0}, Cht_Generic }, - { CheatGod, 0, 0, 0, {CHT_NOWUDIE,0}, Cht_Generic }, { CheatMassacre, 0, 0, 0, {CHT_MASSACRE,0}, Cht_Generic }, { CheatEngage, 0, 1, 0, {0,0}, Cht_ChangeLevel }, { CheatPowerup1[0], 0, 0, 0, {CHT_GIMMIEA,0}, Cht_Generic }, @@ -223,6 +221,8 @@ static cheatseq_t HereticCheats[] = { CheatPowerup1[8], 0, 0, 0, {CHT_GIMMIEI,0}, Cht_Generic }, { CheatPowerup1[9], 0, 0, 0, {CHT_GIMMIEJ,0}, Cht_Generic }, { CheatPowerup1[10], 0, 0, 0, {CHT_GIMMIEZ,0}, Cht_Generic }, + { CheatAmmo, 0, 0, 0, {CHT_TAKEWEAPS,0}, Cht_Generic }, + { CheatGod, 0, 0, 0, {CHT_NOWUDIE,0}, Cht_Generic }, }; static cheatseq_t HexenCheats[] = @@ -270,7 +270,6 @@ static cheatseq_t StrifeCheats[] = static cheatseq_t ChexCheats[] = { - { CheatMus, 0, 1, 0, {0,0}, Cht_Music }, { CheatKimHyers, 0, 1, 0, {0,0}, Cht_MyPos }, { CheatShrrill, 0, 0, 0, {0,0}, Cht_AutoMap }, { CheatDavidBrus, 0, 0, 0, {CHT_IDDQD,0}, Cht_Generic }, @@ -284,7 +283,8 @@ static cheatseq_t ChexCheats[] = { CheatDigitalCafe, 0, 0, 0, {CHT_BEHOLDA,0}, Cht_Generic }, { CheatJoshuaStorms, 0, 0, 0, {CHT_BEHOLDL,0}, Cht_Generic }, { CheatJoelKoenigs, 0, 0, 0, {CHT_CHAINSAW,0}, Cht_Generic }, - { CheatLeeSnyder, 0, 1, 0, {0,0}, Cht_ChangeLevel } + { CheatLeeSnyder, 0, 1, 0, {0,0}, Cht_ChangeLevel }, + { CheatMus, 0, 1, 0, {0,0}, Cht_Music }, }; static cheatseq_t SpecialCheats[] = @@ -342,8 +342,8 @@ bool ST_Responder (event_t *ev) else { static cheatseq_t *cheatlists[] = { DoomCheats, HereticCheats, HexenCheats, StrifeCheats, ChexCheats, SpecialCheats }; - static int counts[] = { countof(DoomCheats), countof(HereticCheats), countof(HexenCheats), - countof(StrifeCheats), countof(ChexCheats), countof(SpecialCheats) }; + static int counts[] = { countof(DoomCheats), countof(HereticCheats)-2, countof(HexenCheats), + countof(StrifeCheats), countof(ChexCheats)-1, countof(SpecialCheats) }; for (size_t i=0; i Date: Mon, 24 Jun 2013 15:40:17 +0200 Subject: [PATCH 02/11] - fixed: Application of inflictor's death damage type was done too late and missed a few spots where it needed. - fixed: DamageTypeReceived was not serialized. - fixed: The check for unhandled damage type was rendered ineffective by the old code handling the DeathType. --- src/p_interaction.cpp | 15 +++++++++------ src/p_mobj.cpp | 4 ++++ src/version.h | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 96b52e0b7..4ac5fceb9 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -657,14 +657,13 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) FState *diestate = NULL; - FName damagetype = (inflictor && inflictor->DeathType != NAME_None) ? inflictor->DeathType : DamageType; - if (damagetype != NAME_None) + if (DamageType != NAME_None) { - diestate = FindState (NAME_Death, damagetype, true); + diestate = FindState (NAME_Death, DamageType, true); if (diestate == NULL) { - if (damagetype == NAME_Ice) + if (DamageType == NAME_Ice) { // If an actor doesn't have an ice death, we can still give them a generic one. if (!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) && (player || (flags3 & MF3_ISMONSTER))) @@ -683,9 +682,9 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) // Don't pass on a damage type this actor cannot handle. // (most importantly, prevent barrels from passing on ice damage.) // Massacre must be preserved though. - if (damagetype != NAME_Massacre) + if (DamageType != NAME_Massacre) { - damagetype = NAME_None; + DamageType = NAME_None; } if ((health < gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH)) @@ -1278,6 +1277,10 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, if (target->health <= 0) { // Death target->special1 = damage; + + // use inflictor's death type if it got one. + if (inflictor && inflictor->DeathType != NAME_None) mod = inflictor->DeathType; + // check for special fire damage or ice damage deaths if (mod == NAME_Fire) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index aff990907..41b41aec6 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -270,6 +270,10 @@ void AActor::Serialize (FArchive &arc) << meleethreshold << meleerange << DamageType; + if (SaveVersion >= 4501) + { + arc << DamageTypeReceived; + } if (SaveVersion >= 3237) { arc diff --git a/src/version.h b/src/version.h index 0e290c775..4b6dc14a7 100644 --- a/src/version.h +++ b/src/version.h @@ -76,7 +76,7 @@ const char *GetVersionString(); // Use 4500 as the base git save version, since it's higher than the // SVN revision ever got. -#define SAVEVER 4500 +#define SAVEVER 4501 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) From c4ad09fe90168262dc37fec6c75fe89c40a5348d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Jun 2013 15:50:30 +0200 Subject: [PATCH 03/11] - added new MAPINFO/gameinfo keys for adding entries to some string arrays, most notably the player classes and the F1 info pages. --- src/gi.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/gi.cpp b/src/gi.cpp index 2df1fdde0..75476c800 100644 --- a/src/gi.cpp +++ b/src/gi.cpp @@ -96,10 +96,10 @@ const char* GameInfoBorders[] = strcpy(gameinfo.key, sc.String); \ } -#define GAMEINFOKEY_STRINGARRAY(key, variable, length) \ +#define GAMEINFOKEY_STRINGARRAY(key, variable, length, clear) \ else if(nextKey.CompareNoCase(variable) == 0) \ { \ - gameinfo.key.Clear(); \ + if (clear) gameinfo.key.Clear(); \ do \ { \ sc.MustGetToken(TK_StringConst); \ @@ -282,8 +282,10 @@ void FMapInfoParser::ParseGameInfo() } // Insert valid keys here. GAMEINFOKEY_CSTRING(titlePage, "titlePage", 8) - GAMEINFOKEY_STRINGARRAY(creditPages, "creditPage", 8) - GAMEINFOKEY_STRINGARRAY(PlayerClasses, "playerclasses", 0) + GAMEINFOKEY_STRINGARRAY(creditPages, "addcreditPage", 8, false) + GAMEINFOKEY_STRINGARRAY(creditPages, "CreditPage", 8, true) + GAMEINFOKEY_STRINGARRAY(PlayerClasses, "addplayerclasses", 0, false) + GAMEINFOKEY_STRINGARRAY(PlayerClasses, "playerclasses", 0, true) GAMEINFOKEY_STRING(titleMusic, "titleMusic") GAMEINFOKEY_FLOAT(titleTime, "titleTime") GAMEINFOKEY_FLOAT(advisoryTime, "advisoryTime") @@ -291,8 +293,9 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_STRING(chatSound, "chatSound") GAMEINFOKEY_STRING(finaleMusic, "finaleMusic") GAMEINFOKEY_CSTRING(finaleFlat, "finaleFlat", 8) - GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8) - GAMEINFOKEY_STRINGARRAY(infoPages, "infoPage", 8) + GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true) + GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false) + GAMEINFOKEY_STRINGARRAY(infoPages, "infoPage", 8, true) GAMEINFOKEY_CSTRING(PauseSign, "pausesign", 8) GAMEINFOKEY_STRING(quitSound, "quitSound") GAMEINFOKEY_CSTRING(borderFlat, "borderFlat", 8) @@ -321,7 +324,8 @@ void FMapInfoParser::ParseGameInfo() GAMEINFOKEY_INT(defaultdropstyle, "defaultdropstyle") GAMEINFOKEY_CSTRING(Endoom, "endoom", 8) GAMEINFOKEY_INT(player5start, "player5start") - GAMEINFOKEY_STRINGARRAY(quitmessages, "quitmessages", 0) + GAMEINFOKEY_STRINGARRAY(quitmessages, "addquitmessages", 0, false) + GAMEINFOKEY_STRINGARRAY(quitmessages, "quitmessages", 0, true) GAMEINFOKEY_STRING(mTitleColor, "menufontcolor_title") GAMEINFOKEY_STRING(mFontColor, "menufontcolor_label") GAMEINFOKEY_STRING(mFontColorValue, "menufontcolor_value") From 394f21f71e3dd27fa08383abd11f26f0d0fbc11f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 24 Jun 2013 16:42:43 +0200 Subject: [PATCH 04/11] - fixed: Draining health from a victim must check for damage reduction before awarding the health to the player. This affected Heretic's gauntlets, A_Saw and A_CustomPunch. - added a DONTDRAIN flag that prevents the above attacks from draining any health at all. --- src/actor.h | 2 +- src/g_doom/a_doomweaps.cpp | 7 ++++--- src/g_heretic/a_hereticweaps.cpp | 5 +++-- src/p_interaction.cpp | 2 +- src/p_local.h | 4 ++-- src/p_map.cpp | 14 +++++++++++--- src/thingdef/thingdef_codeptr.cpp | 7 ++++--- src/thingdef/thingdef_data.cpp | 1 + 8 files changed, 27 insertions(+), 15 deletions(-) diff --git a/src/actor.h b/src/actor.h index ab04b176d..7ec653447 100644 --- a/src/actor.h +++ b/src/actor.h @@ -265,7 +265,7 @@ enum // --- mobj.flags5 --- - /* = 0x00000001, */ + MF5_DONTDRAIN = 0x00000001, // cannot be drained health from. /* = 0x00000002, */ MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. /* = 0x00000008, */ diff --git a/src/g_doom/a_doomweaps.cpp b/src/g_doom/a_doomweaps.cpp index 07b7c0f56..5c5bb7eba 100644 --- a/src/g_doom/a_doomweaps.cpp +++ b/src/g_doom/a_doomweaps.cpp @@ -115,6 +115,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw) angle_t slope; player_t *player; AActor *linetarget; + int actualdamage; ACTION_PARAM_START(9); ACTION_PARAM_SOUND(fullsound, 0); @@ -151,7 +152,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw) return; } - P_LineAttack (self, angle, Range, slope, damage, NAME_Melee, pufftype, false, &linetarget); + P_LineAttack (self, angle, Range, slope, damage, NAME_Melee, pufftype, false, &linetarget, &actualdamage); if (!linetarget) { @@ -180,8 +181,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Saw) } } - if (LifeSteal) - P_GiveBody (self, (damage * LifeSteal) >> FRACBITS); + if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN)) + P_GiveBody (self, (actualdamage * LifeSteal) >> FRACBITS); S_Sound (self, CHAN_WEAPON, hitsound, 1, ATTN_NORM); diff --git a/src/g_heretic/a_hereticweaps.cpp b/src/g_heretic/a_hereticweaps.cpp index 5e1f0647c..23ecf1ae5 100644 --- a/src/g_heretic/a_hereticweaps.cpp +++ b/src/g_heretic/a_hereticweaps.cpp @@ -240,6 +240,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack) player_t *player; const PClass *pufftype; AActor *linetarget; + int actualdamage = 0; if (NULL == (player = self->player)) { @@ -273,7 +274,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack) pufftype = PClass::FindClass("GauntletPuff1"); } slope = P_AimLineAttack (self, angle, dist, &linetarget); - P_LineAttack (self, angle, dist, slope, damage, NAME_Melee, pufftype, false, &linetarget); + P_LineAttack (self, angle, dist, slope, damage, NAME_Melee, pufftype, false, &linetarget, &actualdamage); if (!linetarget) { if (pr_gatk() > 64) @@ -298,7 +299,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GauntletAttack) } if (power) { - P_GiveBody (self, damage>>1); + if (!(linetarget->flags5 & MF5_DONTDRAIN)) P_GiveBody (self, actualdamage>>1); S_Sound (self, CHAN_AUTO, "weapons/gauntletspowhit", 1, ATTN_NORM); } else diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 4ac5fceb9..c46cb40f7 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1262,7 +1262,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, // If the damaging player has the power of drain, give the player 50% of the damage // done in health. - if ( source && source->player && source->player->cheats & CF_DRAIN) + if ( source && source->player && source->player->cheats & CF_DRAIN && !(target->flags5 & MF5_DONTDRAIN)) { if (!target->player || target->player != source->player) { diff --git a/src/p_local.h b/src/p_local.h index f5e1f44a0..a4da0a04b 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -460,8 +460,8 @@ enum // P_LineAttack flags LAF_NORANDOMPUFFZ = 2 }; -AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, const PClass *pufftype, int flags = 0, AActor **victim = NULL); -AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, FName pufftype, int flags = 0, AActor **victim = NULL); +AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, const PClass *pufftype, int flags = 0, AActor **victim = NULL, int *actualdamage = NULL); +AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, int pitch, int damage, FName damageType, FName pufftype, int flags = 0, AActor **victim = NULL, int *actualdamage = NULL); void P_TraceBleed (int damage, fixed_t x, fixed_t y, fixed_t z, AActor *target, angle_t angle, int pitch); void P_TraceBleed (int damage, AActor *target, angle_t angle, int pitch); void P_TraceBleed (int damage, AActor *target, AActor *missile); // missile version diff --git a/src/p_map.cpp b/src/p_map.cpp index 1b85961c2..17bb3e135 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3496,7 +3496,7 @@ static ETraceStatus CheckForSpectral (FTraceResults &res, void *userdata) //========================================================================== AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, - int pitch, int damage, FName damageType, const PClass *pufftype, int flags, AActor **victim) + int pitch, int damage, FName damageType, const PClass *pufftype, int flags, AActor **victim, int *actualdamage) { fixed_t vx, vy, vz, shootz; FTraceResults trace; @@ -3514,6 +3514,10 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, { *victim = NULL; } + if (actualdamage != NULL) + { + *actualdamage = 0; + } angle >>= ANGLETOFINESHIFT; pitch = (angle_t)(pitch) >> ANGLETOFINESHIFT; @@ -3684,6 +3688,10 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, killPuff = true; } newdam = P_DamageMobj (trace.Actor, puff ? puff : t1, t1, damage, damageType, dmgflags); + if (actualdamage != NULL) + { + *actualdamage = newdam; + } } if (!(puffDefaults != NULL && puffDefaults->flags3&MF3_BLOODLESSIMPACT)) { @@ -3741,7 +3749,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, } AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, - int pitch, int damage, FName damageType, FName pufftype, int flags, AActor **victim) + int pitch, int damage, FName damageType, FName pufftype, int flags, AActor **victim, int *actualdamage) { const PClass * type = PClass::FindClass(pufftype); if (victim != NULL) @@ -3754,7 +3762,7 @@ AActor *P_LineAttack (AActor *t1, angle_t angle, fixed_t distance, } else { - return P_LineAttack(t1, angle, distance, pitch, damage, damageType, type, flags, victim); + return P_LineAttack(t1, angle, distance, pitch, damage, damageType, type, flags, victim, actualdamage); } return NULL; } diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index e7b26cb49..d2b64c718 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1388,6 +1388,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch) angle_t angle; int pitch; AActor * linetarget; + int actualdamage; if (!norandom) Damage *= (pr_cwpunch()%8+1); @@ -1404,13 +1405,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CustomPunch) if (!PuffType) PuffType = PClass::FindClass(NAME_BulletPuff); int puffFlags = LAF_ISMELEEATTACK | (flags & CPF_NORANDOMPUFFZ)? LAF_NORANDOMPUFFZ : 0; - P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget); + P_LineAttack (self, angle, Range, pitch, Damage, NAME_Melee, PuffType, puffFlags, &linetarget, &actualdamage); // turn to face target if (linetarget) { - if (LifeSteal) - P_GiveBody (self, (Damage * LifeSteal) >> FRACBITS); + if (LifeSteal && !(linetarget->flags5 & MF5_DONTDRAIN)) + P_GiveBody (self, (actualdamage * LifeSteal) >> FRACBITS); if (weapon != NULL) { diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 3dbbacac0..795bcb5cc 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -182,6 +182,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF4, NOSKIN, AActor, flags4), DEFINE_FLAG(MF4, BOSSDEATH, AActor, flags4), + DEFINE_FLAG(MF5, DONTDRAIN, AActor, flags5), DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5), DEFINE_FLAG(MF5, COUNTSECRET, AActor, flags5), DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5), From e989e11f5cac82bd7fe1201de099855dbaa4908b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 24 Jun 2013 20:52:01 -0500 Subject: [PATCH 05/11] - update revision via popen() (via GZDoom OS X) --- tools/updaterevision/updaterevision.c | 31 +++++++-------------------- 1 file changed, 8 insertions(+), 23 deletions(-) diff --git a/tools/updaterevision/updaterevision.c b/tools/updaterevision/updaterevision.c index c1e3ccc8f..2ae577917 100644 --- a/tools/updaterevision/updaterevision.c +++ b/tools/updaterevision/updaterevision.c @@ -29,8 +29,7 @@ void stripnl(char *str) int main(int argc, char **argv) { - char *name; - char vertag[64], lastlog[64], lasthash[64], run[256], *hash = NULL; + char vertag[64], lastlog[64], lasthash[64], *hash = NULL; FILE *stream = NULL; int gotrev = 0, needupdate = 1; @@ -47,33 +46,19 @@ int main(int argc, char **argv) // on a tag, it returns that tag. Otherwise it returns --. // Use git log to get the time of the latest commit in ISO 8601 format and its full hash. - sprintf(run, "git describe --tags && git log -1 --format=%%ai*%%H", argv[1]); - if ((name = tempnam(NULL, "gitout")) != NULL) + stream = popen("git describe --tags && git log -1 --format=%ai*%H", "r"); + + if (NULL != stream) { -#ifdef __APPLE__ - // tempnam will return errno of 2 even though it is successful for our purposes. - errno = 0; -#endif - if((stream = freopen(name, "w+b", stdout)) != NULL && - system(run) == 0 && - errno == 0 && - fseek(stream, 0, SEEK_SET) == 0 && - fgets(vertag, sizeof vertag, stream) == vertag && - fgets(lastlog, sizeof lastlog, stream) == lastlog) + if (fgets(vertag, sizeof vertag, stream) == vertag && + fgets(lastlog, sizeof lastlog, stream) == lastlog) { stripnl(vertag); stripnl(lastlog); gotrev = 1; } - } - if (stream != NULL) - { - fclose(stream); - remove(name); - } - if (name != NULL) - { - free(name); + + pclose(stream); } if (gotrev) From b9d594982594a75f2cf7d03362f5695193532731 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 24 Jun 2013 20:52:52 -0500 Subject: [PATCH 06/11] - Add popen/pclose macros for updaterevision on Windows. --- tools/updaterevision/updaterevision.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/updaterevision/updaterevision.c b/tools/updaterevision/updaterevision.c index 2ae577917..da0337a61 100644 --- a/tools/updaterevision/updaterevision.c +++ b/tools/updaterevision/updaterevision.c @@ -14,6 +14,11 @@ #include #include +#ifdef _WIN32 +#define popen _popen +#define pclose _pclose +#endif + // Used to strip newline characters from lines read by fgets. void stripnl(char *str) { From 1032170ccd09941b438390070d4aed91dac7adea Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 24 Jun 2013 20:53:49 -0500 Subject: [PATCH 07/11] - Add .aps files to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 822d07fb2..09e3fb4c4 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ *.suo *.pdb *.ilk +*.aps /Release /wadsrc_wad *.user From a5f5d8adcbd107098c5f2a9f59b160691a41dc65 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 24 Jun 2013 20:58:14 -0500 Subject: [PATCH 08/11] - Remove the first parameter from updaterevision, since it isn't needed with git. --- src/CMakeLists.txt | 2 +- tools/updaterevision/updaterevision.c | 12 ++++++------ zdoom.vcproj | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 6ba807090..a8abc70c8 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -488,7 +488,7 @@ endif( BACKPATCH ) get_target_property( UPDATEREVISION_EXE updaterevision LOCATION ) add_custom_target( revision_check ALL - COMMAND ${UPDATEREVISION_EXE} . src/gitinfo.h + COMMAND ${UPDATEREVISION_EXE} src/gitinfo.h WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} DEPENDS updaterevision ) diff --git a/tools/updaterevision/updaterevision.c b/tools/updaterevision/updaterevision.c index da0337a61..90127130a 100644 --- a/tools/updaterevision/updaterevision.c +++ b/tools/updaterevision/updaterevision.c @@ -41,9 +41,9 @@ int main(int argc, char **argv) vertag[0] = '\0'; lastlog[0] = '\0'; - if (argc != 3) + if (argc != 2) { - fprintf(stderr, "Usage: %s \n", argv[0]); + fprintf(stderr, "Usage: %s \n", argv[0]); return 1; } @@ -85,7 +85,7 @@ int main(int argc, char **argv) hash = lastlog + 1; } - stream = fopen (argv[2], "r"); + stream = fopen (argv[1], "r"); if (stream != NULL) { if (!gotrev) @@ -109,7 +109,7 @@ int main(int argc, char **argv) if (needupdate) { - stream = fopen (argv[2], "w"); + stream = fopen (argv[1], "w"); if (stream == NULL) { return 1; @@ -125,11 +125,11 @@ int main(int argc, char **argv) "#define GIT_TIME \"%s\"\n", hash, vertag, hash, lastlog); fclose(stream); - fprintf(stderr, "%s updated to commit %s.\n", argv[2], vertag); + fprintf(stderr, "%s updated to commit %s.\n", argv[1], vertag); } else { - fprintf (stderr, "%s is up to date at commit %s.\n", argv[2], vertag); + fprintf (stderr, "%s is up to date at commit %s.\n", argv[1], vertag); } return 0; diff --git a/zdoom.vcproj b/zdoom.vcproj index 99b52e4c8..89cf4c7b0 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -29,7 +29,7 @@ Date: Tue, 25 Jun 2013 11:55:49 +0200 Subject: [PATCH 09/11] - merged the two blocks for void.wad in compatibility.txt. --- wadsrc/static/compatibility.txt | 54 ++++++++++++++++----------------- 1 file changed, 26 insertions(+), 28 deletions(-) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 1a115fbe8..209ae2aa2 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -1,5 +1,31 @@ 6DC9F6CCEAE7A91AEC48EBE506F22BC4 // void.wad MAP01 { + // Slightly squash the pillars in the starting room with "stimpacks" + // floating on them so that they can be obtained. + sectorflooroffset 62 -8 + setwallyscale 286 front bot 1.090909 + setwallyscale 287 front bot 1.090909 + setwallyscale 288 front bot 1.090909 + setwallyscale 289 front bot 1.090909 + + sectorflooroffset 63 -8 + setwallyscale 290 front bot 1.090909 + setwallyscale 291 front bot 1.090909 + setwallyscale 292 front bot 1.090909 + setwallyscale 293 front bot 1.090909 + + sectorflooroffset 118 -8 + setwallyscale 710 front bot 1.090909 + setwallyscale 711 front bot 1.090909 + setwallyscale 712 front bot 1.090909 + setwallyscale 713 front bot 1.090909 + + sectorflooroffset 119 -8 + setwallyscale 714 front bot 1.090909 + setwallyscale 715 front bot 1.090909 + setwallyscale 716 front bot 1.090909 + setwallyscale 717 front bot 1.090909 + setslopeoverflow } @@ -306,34 +332,6 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 setactivation 455 16 // SPAC_Push } -6DC9F6CCEAE7A91AEC48EBE506F22BC4 // Void -{ - // Slightly squash the pillars in the starting room with "stimpacks" - // floating on them so that they can be obtained. - sectorflooroffset 62 -8 - setwallyscale 286 front bot 1.090909 - setwallyscale 287 front bot 1.090909 - setwallyscale 288 front bot 1.090909 - setwallyscale 289 front bot 1.090909 - - sectorflooroffset 63 -8 - setwallyscale 290 front bot 1.090909 - setwallyscale 291 front bot 1.090909 - setwallyscale 292 front bot 1.090909 - setwallyscale 293 front bot 1.090909 - - sectorflooroffset 118 -8 - setwallyscale 710 front bot 1.090909 - setwallyscale 711 front bot 1.090909 - setwallyscale 712 front bot 1.090909 - setwallyscale 713 front bot 1.090909 - - sectorflooroffset 119 -8 - setwallyscale 714 front bot 1.090909 - setwallyscale 715 front bot 1.090909 - setwallyscale 716 front bot 1.090909 - setwallyscale 717 front bot 1.090909 -} 65A1EB4C87386F290816660A52932FF1 // Master Levels, garrison.wad { From 72e91786e2334f6683b9a6669f1790aeeff1b6ce Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 25 Jun 2013 23:36:24 +0200 Subject: [PATCH 10/11] - added SetThingZ compatibility option for fixing problems resulting from the changes to spawn position handling. --- src/compatibility.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 839d60dc5..cbbe12f73 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -80,6 +80,7 @@ enum CP_SETACTIVATION, CP_SECTORFLOOROFFSET, CP_SETWALLYSCALE, + CP_SETTHINGZ, }; // EXTERNAL FUNCTION PROTOTYPES -------------------------------------------- @@ -294,6 +295,15 @@ void ParseCompatibility() sc.MustGetFloat(); CompatParams.Push(FLOAT2FIXED(sc.Float)); } + else if (sc.Compare("setthingz")) + { + if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size(); + CompatParams.Push(CP_SETTHINGZ); + sc.MustGetNumber(); + CompatParams.Push(sc.Number); + sc.MustGetFloat(); + CompatParams.Push(FLOAT2FIXED(sc.Float)); + } else { sc.UnGet(); @@ -497,6 +507,16 @@ void SetCompatibilityParams() i += 5; break; } + case CP_SETTHINGZ: + { + // When this is called, the things haven't been spawned yet so we can alter the position inside the MapThings array. + if (CompatParams[i+1] < MapThingsConverted.Size()) + { + MapThingsConverted[CompatParams[i+1]].z = CompatParams[i+2]; + } + i += 3; + break; + } } } } From fb1734ba502773adf11994ed48534afd407912e8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 26 Jun 2013 00:50:50 +0200 Subject: [PATCH 11/11] - fix previous commit and add compat option for Cheogh's blue key. --- src/compatibility.cpp | 3 ++- wadsrc/static/compatibility.txt | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index cbbe12f73..4a4f19d6b 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -90,6 +90,7 @@ enum // PRIVATE FUNCTION PROTOTYPES --------------------------------------------- // EXTERNAL DATA DECLARATIONS ---------------------------------------------- +extern TArray MapThingsConverted; // PUBLIC DATA DEFINITIONS ------------------------------------------------- @@ -510,7 +511,7 @@ void SetCompatibilityParams() case CP_SETTHINGZ: { // When this is called, the things haven't been spawned yet so we can alter the position inside the MapThings array. - if (CompatParams[i+1] < MapThingsConverted.Size()) + if ((unsigned)CompatParams[i+1] < MapThingsConverted.Size()) { MapThingsConverted[CompatParams[i+1]].z = CompatParams[i+2]; } diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 209ae2aa2..a84ba218b 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -347,3 +347,9 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 setlinespecial 397 NoiseAlert 0 0 0 0 0 setlinespecial 411 NoiseAlert 0 0 0 0 0 } + +952CC8D03572E17BA550B01B366EFBB9 // Cheogsh map01 +{ + // make the blue key spawn above the 3D floor + setthingz 918 296 +}