From 310979e9e6d64a54bf0b7a0df4627f31f5c06f6c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 30 Jun 2013 18:16:02 +0200 Subject: [PATCH 01/27] - fixed clang compile error "friend declaration specifying a default argument must be the only declaration". --- src/p_spec.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_spec.h b/src/p_spec.h index 4f67f87ffb..57d2169729 100644 --- a/src/p_spec.h +++ b/src/p_spec.h @@ -763,7 +763,7 @@ protected: fixed_t stairsize, fixed_t speed, int delay, int reset, int igntxt, int usespecials); friend bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, - fixed_t speed, fixed_t height, int crush, int change, bool hexencrush, bool hereticlower=false); + fixed_t speed, fixed_t height, int crush, int change, bool hexencrush, bool hereticlower); friend bool EV_FloorCrushStop (int tag); friend bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed); private: @@ -774,7 +774,7 @@ bool EV_BuildStairs (int tag, DFloor::EStair type, line_t *line, fixed_t stairsize, fixed_t speed, int delay, int reset, int igntxt, int usespecials); bool EV_DoFloor (DFloor::EFloor floortype, line_t *line, int tag, - fixed_t speed, fixed_t height, int crush, int change, bool hexencrush, bool hereticlower); + fixed_t speed, fixed_t height, int crush, int change, bool hexencrush, bool hereticlower=false); bool EV_FloorCrushStop (int tag); bool EV_DoDonut (int tag, line_t *line, fixed_t pillarspeed, fixed_t slimespeed); From 7e6a5c1448fe4f8c2efdb813e4ba685414f1b450 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 1 Jul 2013 11:02:35 +0200 Subject: [PATCH 02/27] - added damage type specific extreme death and extreme crash states. Order of labels is 'Death.extreme.damagetype' ('XDeath.damagetype') and 'Crash.extreme.damagetype'. - fixed: Damage of type 'extreme' did not get recorded as an extreme death for the mugshot code. - changed: extreme deaths now only get recorded when an extreme death state was actually used, to ensure that the crash state being used is the correct one associated with the death state. --- src/p_interaction.cpp | 61 +++++++++++++++++++++++++++++++++---------- src/p_mobj.cpp | 10 ++++++- 2 files changed, 56 insertions(+), 15 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index c46cb40f74..cc4c9aece6 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -657,10 +657,37 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) FState *diestate = NULL; + int gibhealth = GibHealth(); + bool extremelydead = ((health < gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH)); + + // Special check for 'extreme' damage type to ensure that it gets recorded properly as an extreme death for subsequent checks. + if (DamageType == NAME_Extreme) + { + extremelydead = true; + DamageType = NAME_None; + } + + // find the appropriate death state. The order is: + // + // 1. If damagetype is not 'none' and death is extreme, try a damage type specific extreme death state + // 2. If no such state is found or death is not extreme try a damage type specific normal death state + // 3. If damagetype is 'ice' and actor is a monster or player, try the generic freeze death (unless prohibited) + // 4. If no state has been found and death is extreme, try the extreme death state + // 5. If no such state is found or death is not extreme try the regular death state. + // 6. If still no state has been found, destroy the actor immediately. if (DamageType != NAME_None) { - diestate = FindState (NAME_Death, DamageType, true); + if (extremelydead) + { + FName labels[] = { NAME_Death, NAME_Extreme, DamageType }; + diestate = FindState(3, labels, true); + } + if (diestate == NULL) + { + diestate = FindState (NAME_Death, DamageType, true); + if (diestate != NULL) extremelydead = false; + } if (diestate == NULL) { if (DamageType == NAME_Ice) @@ -669,6 +696,7 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) if (!deh.NoAutofreeze && !(flags4 & MF4_NOICEDEATH) && (player || (flags3 & MF3_ISMONSTER))) { diestate = FindState(NAME_GenericFreezeDeath); + extremelydead = false; } } } @@ -676,8 +704,6 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) if (diestate == NULL) { int flags4 = inflictor == NULL ? 0 : inflictor->flags4; - - int gibhealth = GibHealth(); // Don't pass on a damage type this actor cannot handle. // (most importantly, prevent barrels from passing on ice damage.) @@ -687,26 +713,33 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) DamageType = NAME_None; } - if ((health < gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH)) + if (extremelydead) { // Extreme death diestate = FindState (NAME_Death, NAME_Extreme, true); - // If a non-player, mark as extremely dead for the crash state. - if (diestate != NULL && player == NULL && health >= gibhealth) - { - health = gibhealth - 1; - } - // For players, mark the appropriate flag. - else if (player != NULL) - { - player->cheats |= CF_EXTREMELYDEAD; - } } if (diestate == NULL) { // Normal death + extremelydead = false; diestate = FindState (NAME_Death); } } + if (extremelydead) + { + // We'll only get here if an actual extreme death state was used. + + // For players, mark the appropriate flag. + if (player != NULL) + { + player->cheats |= CF_EXTREMELYDEAD; + } + // If a non-player, mark as extremely dead for the crash state. + else if (health >= gibhealth) + { + health = gibhealth - 1; + } + } + if (diestate != NULL) { SetState (diestate); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 41b41aec67..3b11ec415d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -5922,7 +5922,15 @@ void AActor::Crash() if (DamageType != NAME_None) { - crashstate = FindState(NAME_Crash, DamageType, true); + if (health < GibHealth()) + { // Extreme death + FName labels[] = { NAME_Crash, NAME_Extreme, DamageType }; + crashstate = FindState (3, labels, true); + } + if (crashstate == NULL) + { // Normal death + crashstate = FindState(NAME_Crash, DamageType, true); + } } if (crashstate == NULL) { From 02ff428d54386735419407031afa787b80d00bd1 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 1 Jul 2013 16:57:46 -0400 Subject: [PATCH 03/27] - Allow generator expressions to be turned off during pk3 building with CMake. - On Mac OS X, ensure assembly code is disabled by default (since it won't work). --- CMakeLists.txt | 33 +++++++++++++++++++++++++++++++++ src/CMakeLists.txt | 7 ++++++- wadsrc/CMakeLists.txt | 10 +--------- 3 files changed, 40 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 22bc0e7cc5..0858ecab55 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,39 @@ cmake_minimum_required( VERSION 2.4 ) project(ZDoom) +# Generator expression are available some time in CMake 2.8. Due to +# cmake_minimum_required, we can assume a minor version of > 7 implies major >= 2 +if(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) + option( NO_GENERATOR_EXPRESSIONS "Disable generator expressions (for building pk3s with IDEs)." OFF ) +else(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) + set( NO_GENERATOR_EXPRESSIONS ON ) +endif(${CMAKE_MAJOR_VERSION} GREATER 2 OR ${CMAKE_MINOR_VERSION} GREATER 7) + +# Simplify pk3 building, add_pk3(filename srcdirectory) +function( add_pk3 PK3_NAME PK3_DIR ) + get_target_property(ZIPDIR_EXE zipdir LOCATION) + + # Generate target name. Just use "pk3" for main pk3 target. + string( REPLACE "." "_" PK3_TARGET ${PK3_NAME} ) + if( ${PK3_TARGET} STREQUAL "zdoom_pk3" ) + set( PK3_TARGET "pk3" ) + endif( ${PK3_TARGET} STREQUAL "zdoom_pk3" ) + + if( NO_GENERATOR_EXPRESSIONS ) + add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} + COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} $ + DEPENDS zipdir ${PK3_DIR} ) + else( NO_GENERATOR_EXPRESSIONS ) + add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} + COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ${PK3_DIR} + DEPENDS zipdir ${PK3_DIR} ) + endif( NO_GENERATOR_EXPRESSIONS ) + + add_custom_target( ${PK3_TARGET} ALL + DEPENDS ${ZDOOM_OUTPUT_DIR}/${PK3_NAME} ) +endfunction( add_pk3 ) + IF( NOT CMAKE_BUILD_TYPE ) SET( CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel." diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a8abc70c82..82f347fd82 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,7 +9,12 @@ include( CheckFunctionExists ) include( CheckCXXCompilerFlag ) include( FindPkgConfig ) -option( NO_ASM "Disable assembly code" ) +if( NOT APPLE ) + option( NO_ASM "Disable assembly code" OFF ) +else( NOT APPLE ) + # At the moment asm code doesn't work with OS X, so disable by default + option( NO_ASM "Disable assembly code" ON ) +endif( NOT APPLE ) if( "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" ) option( NO_STRIP "Do not strip Release or MinSizeRel builds" ) # At least some versions of Xcode fail if you strip with the linker diff --git a/wadsrc/CMakeLists.txt b/wadsrc/CMakeLists.txt index 4220525116..83dc8292d8 100644 --- a/wadsrc/CMakeLists.txt +++ b/wadsrc/CMakeLists.txt @@ -1,11 +1,3 @@ cmake_minimum_required( VERSION 2.4 ) -get_target_property(ZIPDIR_EXE zipdir LOCATION) - -add_custom_command( OUTPUT ${ZDOOM_OUTPUT_DIR}/zdoom.pk3 - COMMAND ${ZIPDIR_EXE} -udf ${ZDOOM_OUTPUT_DIR}/zdoom.pk3 ${CMAKE_CURRENT_SOURCE_DIR}/static - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${ZDOOM_OUTPUT_DIR}/zdoom.pk3 $ - DEPENDS zipdir ${CMAKE_CURRENT_SOURCE_DIR}/static ) - -add_custom_target( pk3 ALL - DEPENDS ${ZDOOM_OUTPUT_DIR}/zdoom.pk3 ) +add_pk3(zdoom.pk3 ${CMAKE_CURRENT_SOURCE_DIR}/static) From e9425b356b568d51d80bbcc37f145c363dbcb503 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 1 Jul 2013 21:40:09 -0500 Subject: [PATCH 04/27] - Fixed: Verbose user info strings were written with an extra backslash character between the key and value. --- src/d_netinfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 7f94ef686e..92c8abc3ee 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -713,7 +713,7 @@ void D_WriteUserInfoStrings (int pnum, BYTE **stream, bool compact) if (!compact) { // In verbose mode, prepend the cvar's name - *stream += sprintf(*((char **)stream), "\\%s\\", pair->Key.GetChars()); + *stream += sprintf(*((char **)stream), "\\%s", pair->Key.GetChars()); } // A few of these need special handling for compatibility reasons. switch (pair->Key.GetIndex()) From 2717ed703d0f877a18498ebaf83bf6e0a32d6b86 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 1 Jul 2013 21:51:12 -0500 Subject: [PATCH 05/27] Shuffle FActionMap for better 64-bit alignment. --- src/c_dispatch.cpp | 66 +++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 7b701bd534..d253549868 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -92,8 +92,8 @@ private: struct FActionMap { - unsigned int Key; // value from passing Name to MakeKey() FButtonStatus *Button; + unsigned int Key; // value from passing Name to MakeKey() char Name[12]; }; @@ -134,38 +134,38 @@ bool ParsingKeyConf; FActionMap ActionMaps[] = { - { 0x0d52d67b, &Button_AM_PanLeft, "am_panleft"}, - { 0x125f5226, &Button_User2, "user2" }, - { 0x1eefa611, &Button_Jump, "jump" }, - { 0x201f1c55, &Button_Right, "right" }, - { 0x20ccc4d5, &Button_Zoom, "zoom" }, - { 0x23a99cd7, &Button_Back, "back" }, - { 0x41df90c2, &Button_AM_ZoomIn, "am_zoomin"}, - { 0x426b69e7, &Button_Reload, "reload" }, - { 0x4463f43a, &Button_LookDown, "lookdown" }, - { 0x51f7a334, &Button_AM_ZoomOut, "am_zoomout"}, - { 0x534c30ee, &Button_User4, "user4" }, - { 0x5622bf42, &Button_Attack, "attack" }, - { 0x577712d0, &Button_User1, "user1" }, - { 0x57c25cb2, &Button_Klook, "klook" }, - { 0x59f3e907, &Button_Forward, "forward" }, - { 0x6167ce99, &Button_MoveDown, "movedown" }, - { 0x676885b8, &Button_AltAttack, "altattack" }, - { 0x6fa41b84, &Button_MoveLeft, "moveleft" }, - { 0x818f08e6, &Button_MoveRight, "moveright" }, - { 0x8197097b, &Button_AM_PanRight, "am_panright"}, - { 0x8d89955e, &Button_AM_PanUp, "am_panup"} , - { 0xa2b62d8b, &Button_Mlook, "mlook" }, - { 0xab2c3e71, &Button_Crouch, "crouch" }, - { 0xb000b483, &Button_Left, "left" }, - { 0xb62b1e49, &Button_LookUp, "lookup" }, - { 0xb6f8fe92, &Button_User3, "user3" }, - { 0xb7e6a54b, &Button_Strafe, "strafe" }, - { 0xce301c81, &Button_AM_PanDown, "am_pandown"}, - { 0xd5897c73, &Button_ShowScores, "showscores" }, - { 0xe0ccb317, &Button_Speed, "speed" }, - { 0xe0cfc260, &Button_Use, "use" }, - { 0xfdd701c7, &Button_MoveUp, "moveup" }, + { &Button_AM_PanLeft, 0x0d52d67b, "am_panleft"}, + { &Button_User2, 0x125f5226, "user2" }, + { &Button_Jump, 0x1eefa611, "jump" }, + { &Button_Right, 0x201f1c55, "right" }, + { &Button_Zoom, 0x20ccc4d5, "zoom" }, + { &Button_Back, 0x23a99cd7, "back" }, + { &Button_AM_ZoomIn, 0x41df90c2, "am_zoomin"}, + { &Button_Reload, 0x426b69e7, "reload" }, + { &Button_LookDown, 0x4463f43a, "lookdown" }, + { &Button_AM_ZoomOut, 0x51f7a334, "am_zoomout"}, + { &Button_User4, 0x534c30ee, "user4" }, + { &Button_Attack, 0x5622bf42, "attack" }, + { &Button_User1, 0x577712d0, "user1" }, + { &Button_Klook, 0x57c25cb2, "klook" }, + { &Button_Forward, 0x59f3e907, "forward" }, + { &Button_MoveDown, 0x6167ce99, "movedown" }, + { &Button_AltAttack, 0x676885b8, "altattack" }, + { &Button_MoveLeft, 0x6fa41b84, "moveleft" }, + { &Button_MoveRight, 0x818f08e6, "moveright" }, + { &Button_AM_PanRight, 0x8197097b, "am_panright"}, + { &Button_AM_PanUp, 0x8d89955e, "am_panup"} , + { &Button_Mlook, 0xa2b62d8b, "mlook" }, + { &Button_Crouch, 0xab2c3e71, "crouch" }, + { &Button_Left, 0xb000b483, "left" }, + { &Button_LookUp, 0xb62b1e49, "lookup" }, + { &Button_User3, 0xb6f8fe92, "user3" }, + { &Button_Strafe, 0xb7e6a54b, "strafe" }, + { &Button_AM_PanDown, 0xce301c81, "am_pandown"}, + { &Button_ShowScores, 0xd5897c73, "showscores" }, + { &Button_Speed, 0xe0ccb317, "speed" }, + { &Button_Use, 0xe0cfc260, "use" }, + { &Button_MoveUp, 0xfdd701c7, "moveup" }, }; #define NUM_ACTIONS countof(ActionMaps) From 001ed91fd484c56c2d8217b6d15a08ecf17252ef Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 1 Jul 2013 22:01:26 -0500 Subject: [PATCH 06/27] - Fixed: ACS's PlaySound should mask off the flag bits from the channel before passing it to S_IsActorPlayingSomething(). --- src/p_acs.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index cd55caefb3..f57846b3c9 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5025,7 +5025,7 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound) { S_Sound(spot, chan, sid, vol, atten); } - else if (!S_IsActorPlayingSomething(spot, chan, sid)) + else if (!S_IsActorPlayingSomething(spot, chan & 7, sid)) { S_Sound(spot, chan | CHAN_LOOP, sid, vol, atten); } From 23e21cc85e9fbc378ec2cb00ed30ddf37c15c36b Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Mon, 1 Jul 2013 22:02:46 -0500 Subject: [PATCH 07/27] - Fixed: S_IsChannelUsed() is declared as static, so it should be defined as such, too. --- src/s_sound.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 2626c2b825..d1c3139672 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -1683,7 +1683,7 @@ bool S_GetSoundPlayingInfo (const FPolyObj *poly, int sound_id) // //========================================================================== -bool S_IsChannelUsed(AActor *actor, int channel, int *seen) +static bool S_IsChannelUsed(AActor *actor, int channel, int *seen) { if (*seen & (1 << channel)) { From 5af1e6f734b631bca677559324477bf319c1cd1c Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 2 Jul 2013 14:15:08 -0500 Subject: [PATCH 08/27] - Added a compatibility option to fix Super Sonic Doom's first bonus stage leaving you frozen when you finished it. --- src/compatibility.cpp | 1 + src/doomdef.h | 1 + src/p_lnspec.cpp | 5 +++++ wadsrc/static/compatibility.txt | 8 ++++++++ 4 files changed, 15 insertions(+) diff --git a/src/compatibility.cpp b/src/compatibility.cpp index 4a4f19d6be..7bbff73224 100644 --- a/src/compatibility.cpp +++ b/src/compatibility.cpp @@ -105,6 +105,7 @@ static FCompatOption Options[] = { "vileghosts", BCOMPATF_VILEGHOSTS, SLOT_BCOMPAT }, { "ignoreteleporttags", BCOMPATF_BADTELEPORTERS, SLOT_BCOMPAT }, { "rebuildnodes", BCOMPATF_REBUILDNODES, SLOT_BCOMPAT }, + { "linkfrozenprops", BCOMPATF_LINKFROZENPROPS, SLOT_BCOMPAT }, // list copied from g_mapinfo.cpp { "shorttex", COMPATF_SHORTTEX, SLOT_COMPAT }, diff --git a/src/doomdef.h b/src/doomdef.h index 3a3c31e6ab..675923b4a4 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -349,6 +349,7 @@ enum BCOMPATF_BADTELEPORTERS = 1 << 3, // Ignore tags on Teleport specials BCOMPATF_BADPORTALS = 1 << 4, // Restores the old unstable portal behavior BCOMPATF_REBUILDNODES = 1 << 5, // Force node rebuild + BCOMPATF_LINKFROZENPROPS = 1 << 6, // Clearing PROP_TOTALLYFROZEN or PROP_FROZEN also clears the other }; // phares 3/20/98: diff --git a/src/p_lnspec.cpp b/src/p_lnspec.cpp index 67df3def1e..a0164ab824 100644 --- a/src/p_lnspec.cpp +++ b/src/p_lnspec.cpp @@ -2813,6 +2813,11 @@ FUNC(LS_SetPlayerProperty) { int i; + if ((ib_compatflags & BCOMPATF_LINKFROZENPROPS) && (mask & (CF_FROZEN | CF_TOTALLYFROZEN))) + { // Clearing one of these properties clears both of them (if the compat flag is set.) + mask = CF_FROZEN | CF_TOTALLYFROZEN; + } + for (i = 0; i < MAXPLAYERS; i++) { if (!playeringame[i]) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index a84ba218b7..795b9348ad 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -353,3 +353,11 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 // make the blue key spawn above the 3D floor setthingz 918 296 } + +64B6CE3CB7349B6F6B1A885C449ACB96 // Super Sonic Doom, map31 +{ + // During the end-of-level tally, both PROP_FROZEN and PROP_TOTALLYFROZEN + // are set, but only PROP_TOTALLYFROZEN is cleared, so PROP_FROZEN is + // still set when returning to the origin map. + linkfrozenprops +} From e845b292c2c148e161785f6938d4470b67cacdf4 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 2 Jul 2013 14:48:03 -0500 Subject: [PATCH 09/27] - Always clear bEvilGrin after checking it in FMugShot::UpdateState(). If it's not an appropriate time to show the grin when the flag is set, it shouldn't be saved until later. --- src/g_shared/sbar_mugshot.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/g_shared/sbar_mugshot.cpp b/src/g_shared/sbar_mugshot.cpp index fcadb0d1be..0849fd3544 100644 --- a/src/g_shared/sbar_mugshot.cpp +++ b/src/g_shared/sbar_mugshot.cpp @@ -352,11 +352,8 @@ int FMugShot::UpdateState(player_t *player, StateFlags stateflags) SetState("grin", false); return 0; } - else if (CurrentState == NULL) - { - bEvilGrin = false; - } } + bEvilGrin = false; bool ouch = (!st_oldouch && FaceHealth - player->health > ST_MUCHPAIN) || (st_oldouch && player->health - FaceHealth > ST_MUCHPAIN); if (player->damagecount && From f1dff6c9d3c6c32c3d6721d010b6f1957b121c4e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 2 Jul 2013 22:01:54 +0200 Subject: [PATCH 10/27] - fixed: The new XDeath code forgot to move the assignment of the flags4 variable. Also renamed the variable to avoid conflicts. --- src/p_interaction.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index cc4c9aece6..43499d3533 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -658,7 +658,8 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) FState *diestate = NULL; int gibhealth = GibHealth(); - bool extremelydead = ((health < gibhealth || flags4 & MF4_EXTREMEDEATH) && !(flags4 & MF4_NOEXTREMEDEATH)); + int iflags4 = inflictor == NULL ? 0 : inflictor->flags4; + bool extremelydead = ((health < gibhealth || iflags4 & MF4_EXTREMEDEATH) && !(iflags4 & MF4_NOEXTREMEDEATH)); // Special check for 'extreme' damage type to ensure that it gets recorded properly as an extreme death for subsequent checks. if (DamageType == NAME_Extreme) @@ -703,7 +704,6 @@ void AActor::Die (AActor *source, AActor *inflictor, int dmgflags) } if (diestate == NULL) { - int flags4 = inflictor == NULL ? 0 : inflictor->flags4; // Don't pass on a damage type this actor cannot handle. // (most importantly, prevent barrels from passing on ice damage.) From 5b17c0779b72de7d34ec25d94e9e13287e646ca0 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 2 Jul 2013 15:46:31 -0500 Subject: [PATCH 11/27] Version 2.7.1 --- src/version.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/version.h b/src/version.h index 4b6dc14a70..6f23d89fd8 100644 --- a/src/version.h +++ b/src/version.h @@ -41,11 +41,11 @@ const char *GetVersionString(); /** Lots of different version numbers **/ -#define VERSIONSTR "2.7.0" +#define VERSIONSTR "2.7.1" // The version as seen in the Windows resource -#define RC_FILEVERSION 2,7,0,0 -#define RC_PRODUCTVERSION 2,7,0,0 +#define RC_FILEVERSION 2,7,1,0 +#define RC_PRODUCTVERSION 2,7,1,0 #define RC_PRODUCTVERSION2 "2.7" // Version identifier for network games. From 80a3e4f902281c22d53cca78048e9ae559b2fd6e Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Wed, 3 Jul 2013 01:58:13 -0400 Subject: [PATCH 12/27] - Fixed: Cocoa IWAD picker needed to be updated to handle git version strings. --- src/sdl/iwadpicker_cocoa.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sdl/iwadpicker_cocoa.mm b/src/sdl/iwadpicker_cocoa.mm index 1a1fa8b8c1..a0469ac7a8 100644 --- a/src/sdl/iwadpicker_cocoa.mm +++ b/src/sdl/iwadpicker_cocoa.mm @@ -156,7 +156,7 @@ static const char* const tableHeaders[NUM_COLUMNS] = { "IWAD", "Game" }; cancelled = false; app = [NSApplication sharedApplication]; - id windowTitle = [NSString stringWithUTF8String:GAMESIG " " DOTVERSIONSTR ": Select an IWAD to use"]; + id windowTitle = [NSString stringWithFormat:@GAMESIG " %s: Select an IWAD to use", GetVersionString()]; NSRect frame = NSMakeRect(0, 0, 440, 450); window = [[NSWindow alloc] initWithContentRect:frame styleMask:NSTitledWindowMask backing:NSBackingStoreBuffered defer:NO]; From 9dd3c4b2d59c9d332d0d70aedb0d3033ea13eea3 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Fri, 5 Jul 2013 00:45:45 -0400 Subject: [PATCH 13/27] - When erroring due to the lack of iwads, print instructions more relevent to the user's platform. --- src/d_iwad.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index e53a1d3629..6b430fa038 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -367,7 +367,7 @@ int FIWadManager::CheckIWAD (const char *doomwaddir, WadStuff *wads) // Under UNIX OSes, the search path is: // 1. Current directory // 2. $DOOMWADDIR -// 3. $HOME/.zdoom +// 3. $HOME/.config/zdoom // 4. The share directory defined at compile time (/usr/local/share/zdoom) // // The search path can be altered by editing the IWADSearch.Directories @@ -516,9 +516,19 @@ int FIWadManager::IdentifyVersion (TArray &wadfiles, const char *iwad, I_FatalError ("Cannot find a game IWAD (doom.wad, doom2.wad, heretic.wad, etc.).\n" "Did you install ZDoom properly? You can do either of the following:\n" "\n" +#if defined(_WIN32) "1. Place one or more of these wads in the same directory as ZDoom.\n" "2. Edit your zdoom-username.ini and add the directories of your iwads\n" "to the list beneath [IWADSearch.Directories]"); +#elif defined(__APPLE__) + "1. Place one or more of these wads in ~/Library/Application Support/zdoom/\n" + "2. Edit your ~/Library/Preferences/zdoom.ini and add the directories\n" + "of your iwads to the list beneath [IWADSearch.Directories]"); +#else + "1. Place one or more of these wads in ~/.config/zdoom/.\n" + "2. Edit your ~/.config/zdoom/zdoom.ini and add the directories of your\n" + "iwads to the list beneath [IWADSearch.Directories]"); +#endif } pickwad = 0; From 453f4ace5c4bab61fd3741433ee43884f4a1283d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 09:01:00 +0200 Subject: [PATCH 14/27] - added compatibility setting for stuff in Cheogsh2 MAP04's megasphere cage which is positioned too low. --- wadsrc/static/compatibility.txt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index 795b9348ad..4b75dfaba3 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -361,3 +361,18 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 // still set when returning to the origin map. linkfrozenprops } + +D62DCA9EC226DE49108D5DD9271F7631 // Cheogsh 2 map04 +{ + // Stuff in megasphere cage is positioned too low + setthingz 1640 528 + setthingz 1641 528 + setthingz 1642 528 + setthingz 1643 528 + setthingz 1644 528 + setthingz 1645 528 + setthingz 1646 528 + setthingz 1647 528 + setthingz 1648 528 + setthingz 1649 528 +} \ No newline at end of file From 10dd75f9028e45db9f5264c9b5e654c7973d9ef7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 09:31:49 +0200 Subject: [PATCH 15/27] - externalized "New save game" line for save screen. --- src/menu/loadsavemenu.cpp | 2 +- wadsrc/static/language.enu | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 99ac599380..20779a221b 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -898,7 +898,7 @@ IMPLEMENT_CLASS(DSaveMenu) DSaveMenu::DSaveMenu(DMenu *parent, FListMenuDescriptor *desc) : DLoadSaveMenu(parent, desc) { - strcpy (NewSaveNode.Title, ""); + strcpy (NewSaveNode.Title, GStrings["NEWSAVE"]); NewSaveNode.bNoDelete = true; SaveGames.Insert(0, &NewSaveNode); TopItem = 0; diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 0c8fff5d3e..4b5225f547 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -112,6 +112,7 @@ PD_YELLOWCO = "You need a yellow card to activate this object"; PD_BLUESO = "You need a blue skull to activate this object"; PD_REDSO = "You need a red skull to activate this object"; PD_YELLOWSO = "You need a yellow skull to activate this object"; +NEWSAVE = ""; GGSAVED = "game saved."; HUSTR_MSGU = "[Message unsent]"; PICKUP_PISTOL_DROPPED = "Picked up a pistol."; From e9be49f37dcf175ad9d750eec8c27bc04522a250 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 09:47:39 +0200 Subject: [PATCH 16/27] - fixed: R_DeinitPlanes did not free all visplanes because it called R_ClearPlanes with 'fullclear' set to false. - removed some redundancy from R_ClearPlanes. --- src/r_plane.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index 8bf5444552..986d992033 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -174,7 +174,15 @@ void R_InitPlanes () void R_DeinitPlanes () { fakeActive = 0; - R_ClearPlanes(false); + + // do not use R_ClearPlanes because at this point the screen pointer is no longer valid. + for (int i = 0; i <= MAXVISPLANES; i++) // new code -- killough + { + for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; ) + { + freehead = &(*freehead)->next; + } + } for (visplane_t *pl = freetail; pl != NULL; ) { visplane_t *next = pl->next; @@ -490,7 +498,7 @@ void R_MapColoredPlane (int y, int x1) void R_ClearPlanes (bool fullclear) { - int i, max; + int i; // Don't clear fake planes if not doing a full clear. if (!fullclear) @@ -516,7 +524,6 @@ void R_ClearPlanes (bool fullclear) } else { - max = fullclear ? MAXVISPLANES : MAXVISPLANES-1; for (i = 0; i <= MAXVISPLANES; i++) // new code -- killough { for (*freehead = visplanes[i], visplanes[i] = NULL; *freehead; ) @@ -524,10 +531,7 @@ void R_ClearPlanes (bool fullclear) freehead = &(*freehead)->next; } } - } - if (fullclear) - { // opening / clipping determination clearbufshort (floorclip, viewwidth, viewheight); // [RH] clip ceiling to console bottom From 2d2498d1e2772e49098ad17ea5b39adb81c6271f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 10:58:53 +0200 Subject: [PATCH 17/27] - fixed: userinfo_t needs a destructor to delete its CVARs when it is destroyed. --- src/d_netinfo.cpp | 11 +++++++++++ src/d_player.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/src/d_netinfo.cpp b/src/d_netinfo.cpp index 92c8abc3ee..6832a047e1 100644 --- a/src/d_netinfo.cpp +++ b/src/d_netinfo.cpp @@ -1048,3 +1048,14 @@ CCMD (playerinfo) } } } + +userinfo_t::~userinfo_t() +{ + TMapIterator it(*this); + TMap::Pair *pair; + + while (it.NextPair(pair)) + { + delete pair->Value; + } +} diff --git a/src/d_player.h b/src/d_player.h index 6169dcebfd..fcc5415516 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -260,6 +260,8 @@ enum struct userinfo_t : TMap { + ~userinfo_t(); + int GetAimDist() const { if (dmflags2 & DF2_NOAUTOAIM) From 3e8e587ac7cc2e9a59929874d70ea7ae6406474e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 12:37:25 +0200 Subject: [PATCH 18/27] - fixed another leak with userinfos: Since they are no longer POD they may not be memset to 0 in the player_t constructor. --- src/p_user.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_user.cpp b/src/p_user.cpp index 5ac8a1a885..35ab99036b 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -309,7 +309,6 @@ player_t::player_t() ConversationFaceTalker(0) { memset (&cmd, 0, sizeof(cmd)); - memset (&userinfo, 0, sizeof(userinfo)); memset (frags, 0, sizeof(frags)); memset (psprites, 0, sizeof(psprites)); memset (&skill, 0, sizeof(skill)); From a59a886f949b7121c983b24222a5373b6aa4d593 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 13:24:00 +0200 Subject: [PATCH 19/27] - fixed: The SectorDamage 3D-floor code didn't account for Vavoom-style 3D floors where floor and ceiling plane of the control sector are inverted. --- src/p_spec.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 3a63577484..a831029cfc 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -639,12 +639,21 @@ void P_SectorDamage(int tag, int amount, FName type, const PClass *protectClass, { next = actor->snext; // Only affect actors touching the 3D floor - if (actor->z + actor->height > sec->floorplane.ZatPoint(actor->x, actor->y)) + fixed_t z1 = sec->floorplane.ZatPoint(actor->x, actor->y); + fixed_t z2 = sec->ceilingplane.ZatPoint(actor->x, actor->y); + if (z2 < z1) + { + // Account for Vavoom-style 3D floors + fixed_t zz = z1; + z1 = z2; + z2 = zz; + } + if (actor->z + actor->height > z1) { // If DAMAGE_IN_AIR is used, anything not beneath the 3D floor will be // damaged (so, anything touching it or above it). Other 3D floors between // the actor and this one will not stop this effect. - if ((flags & DAMAGE_IN_AIR) || actor->z <= sec->ceilingplane.ZatPoint(actor->x, actor->y)) + if ((flags & DAMAGE_IN_AIR) || actor->z <= z2)) { // Here we pass the DAMAGE_IN_AIR flag to disable the floor check, since it // only works with the real sector's floor. We did the appropriate height checks From 0c86650db03664712103d2d15278b49d08f52b98 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 14:22:49 +0200 Subject: [PATCH 20/27] - fixed: The savegame code for player restoration did some undefined things with the userinfo that only worked due to previous memory leaks. It must ensure that the userinfos get properly transferred and not implicitly rely on the copy assignment being used to copy the actual player data. --- src/p_saveg.cpp | 16 +++++++++++++--- src/p_spec.cpp | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index a045c50989..d33f21f6f2 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -256,11 +256,20 @@ static void CopyPlayer (player_t *dst, player_t *src, const char *name) { // The userinfo needs to be saved for real players, but it // needs to come from the save for bots. - userinfo_t uibackup = dst->userinfo; + userinfo_t uibackup; + userinfo_t uibackup2; + + uibackup.TransferFrom(dst->userinfo); + uibackup2.TransferFrom(src->userinfo); + int chasecam = dst->cheats & CF_CHASECAM; // Remember the chasecam setting bool attackdown = dst->attackdown; bool usedown = dst->usedown; - *dst = *src; + + + dst->~player_t(); // ensure that the userinfo in dst does not contain anything before copying everything over. + *dst = *src; // To avoid memory leaks at this point the userinfo in src must be empty which is taken care of by the TransferFrom call above. + dst->cheats |= chasecam; if (dst->isbot) @@ -276,10 +285,11 @@ static void CopyPlayer (player_t *dst, player_t *src, const char *name) } bglobal.botnum++; bglobal.botingame[dst - players] = true; + dst->userinfo.TransferFrom(uibackup2); } else { - dst->userinfo = uibackup; + dst->userinfo.TransferFrom(uibackup); } // Validate the skin dst->userinfo.SkinNumChanged(R_FindSkin(skins[dst->userinfo.GetSkin()].name, dst->CurrentPlayerClass)); diff --git a/src/p_spec.cpp b/src/p_spec.cpp index a831029cfc..63f7c1c89e 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -653,7 +653,7 @@ void P_SectorDamage(int tag, int amount, FName type, const PClass *protectClass, // If DAMAGE_IN_AIR is used, anything not beneath the 3D floor will be // damaged (so, anything touching it or above it). Other 3D floors between // the actor and this one will not stop this effect. - if ((flags & DAMAGE_IN_AIR) || actor->z <= z2)) + if ((flags & DAMAGE_IN_AIR) || actor->z <= z2) { // Here we pass the DAMAGE_IN_AIR flag to disable the floor check, since it // only works with the real sector's floor. We did the appropriate height checks From a90b49dc72447fb7ba29f1f1bd5d9a0441babdba Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Jul 2013 14:33:45 +0200 Subject: [PATCH 21/27] - added string table replacement for A_Print, A_PrintBold and A_Log. --- src/thingdef/thingdef_codeptr.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index d2b64c7187..638dd27536 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -70,6 +70,7 @@ #include "m_bbox.h" #include "r_data/r_translate.h" #include "p_trace.h" +#include "gstrings.h" static FRandom pr_camissile ("CustomActorfire"); @@ -2133,6 +2134,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Print) ACTION_PARAM_FLOAT(time, 1); ACTION_PARAM_NAME(fontname, 2); + if (text[0] == '$') text = GStrings(text+1); if (self->CheckLocalView (consoleplayer) || (self->target!=NULL && self->target->CheckLocalView (consoleplayer))) { @@ -2171,6 +2173,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_PrintBold) float saved = con_midtime; FFont *font = NULL; + if (text[0] == '$') text = GStrings(text+1); if (fontname != NAME_None) { font = V_GetFont(fontname); @@ -2196,11 +2199,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Log) { ACTION_PARAM_START(1); ACTION_PARAM_STRING(text, 0); + + if (text[0] == '$') text = GStrings(text+1); Printf("%s\n", text); ACTION_SET_RESULT(false); // Prints should never set the result for inventory state chains! } -//=========================================================================== +//========================================================================= // // A_LogInt // From 77236132932d08a508855c3b44bd5b428f19d851 Mon Sep 17 00:00:00 2001 From: Braden Obrzut Date: Mon, 22 Jul 2013 02:09:46 -0400 Subject: [PATCH 22/27] - Fixed: ACS function pointer instructions were not updated when library tag size changed. - Fixed: undefined sequence compiler warning. --- src/p_acs.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index f57846b3c9..74a670346e 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -5556,7 +5556,8 @@ int DLevelScript::RunScript () case PCD_PUSHFUNCTION: { int funcnum = NEXTBYTE; - PushToStack(funcnum | activeBehavior->GetLibraryID()); + // Not technically a string, but since we use the same tagging mechanism + PushToStack(TAGSTR(funcnum)); break; } case PCD_CALL: @@ -5572,7 +5573,7 @@ int DLevelScript::RunScript () if(pcd == PCD_CALLSTACK) { funcnum = STACK(1); - module = FBehavior::StaticGetModule(funcnum>>16); + module = FBehavior::StaticGetModule(funcnum>>LIBRARYID_SHIFT); --sp; funcnum &= 0xFFFF; // Clear out tag @@ -8449,7 +8450,8 @@ scriptwait: case PCD_SAVESTRING: // Saves the string { - PushToStack(GlobalACSStrings.AddString(work, Stack, sp)); + const int str = GlobalACSStrings.AddString(work, Stack, sp); + PushToStack(str); STRINGBUILDER_FINISH(work); } break; From db562142f07e304feb35e7848f7da6cae1b0e153 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 22 Jul 2013 22:25:44 +0200 Subject: [PATCH 23/27] - Fix c++11 literal suffix warnings / patch by Edward-san. --- src/c_cmds.cpp | 10 +++--- src/g_level.cpp | 4 +-- src/p_glnodes.cpp | 2 +- src/resourcefiles/file_7z.cpp | 2 +- src/s_playlist.cpp | 2 +- src/sc_man.cpp | 2 +- src/sdl/i_system.cpp | 2 +- src/sound/fmodsound.cpp | 38 +++++++++++------------ src/sound/music_fluidsynth_mididevice.cpp | 8 ++--- 9 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/c_cmds.cpp b/src/c_cmds.cpp index c3ffe0a5f1..5bde4c5060 100644 --- a/src/c_cmds.cpp +++ b/src/c_cmds.cpp @@ -960,8 +960,8 @@ CCMD(nextmap) { if (netgame) { - Printf ("Use "TEXTCOLOR_BOLD"changemap"TEXTCOLOR_NORMAL" instead. "TEXTCOLOR_BOLD"Nextmap" - TEXTCOLOR_NORMAL" is for single-player only.\n"); + Printf ("Use " TEXTCOLOR_BOLD "changemap" TEXTCOLOR_NORMAL " instead. " TEXTCOLOR_BOLD "Nextmap" + TEXTCOLOR_NORMAL " is for single-player only.\n"); return; } char *next = NULL; @@ -988,8 +988,8 @@ CCMD(nextsecret) { if (netgame) { - Printf ("Use "TEXTCOLOR_BOLD"changemap"TEXTCOLOR_NORMAL" instead. "TEXTCOLOR_BOLD"Nextsecret" - TEXTCOLOR_NORMAL" is for single-player only.\n"); + Printf ("Use " TEXTCOLOR_BOLD "changemap" TEXTCOLOR_NORMAL " instead. " TEXTCOLOR_BOLD "Nextsecret" + TEXTCOLOR_NORMAL " is for single-player only.\n"); return; } char *next = NULL; @@ -1138,4 +1138,4 @@ CCMD(secret) else inlevel = false; } } -} \ No newline at end of file +} diff --git a/src/g_level.cpp b/src/g_level.cpp index 755a4fba62..a452d55767 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -164,8 +164,8 @@ CCMD (map) { if (netgame) { - Printf ("Use "TEXTCOLOR_BOLD"changemap"TEXTCOLOR_NORMAL" instead. "TEXTCOLOR_BOLD"Map" - TEXTCOLOR_NORMAL" is for single-player only.\n"); + Printf ("Use " TEXTCOLOR_BOLD "changemap" TEXTCOLOR_NORMAL " instead. " TEXTCOLOR_BOLD "Map" + TEXTCOLOR_NORMAL " is for single-player only.\n"); return; } if (argv.argc() > 1) diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index 7a14e4d447..2665f69ba6 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -252,7 +252,7 @@ static bool LoadGLVertexes(FileReader * lump) // GLNodes V1 and V4 are unsupported. // V1 because the precision is insufficient and // V4 due to the missing partner segs - Printf("GL nodes v%d found. This format is not supported by "GAMENAME"\n", + Printf("GL nodes v%d found. This format is not supported by " GAMENAME "\n", (*(int *)gldata == gNd4)? 4:1); delete [] gldata; diff --git a/src/resourcefiles/file_7z.cpp b/src/resourcefiles/file_7z.cpp index 2f955705ee..8b1c23b67f 100644 --- a/src/resourcefiles/file_7z.cpp +++ b/src/resourcefiles/file_7z.cpp @@ -243,7 +243,7 @@ bool F7ZFile::Open(bool quiet) Archive = NULL; if (!quiet) { - Printf("\n"TEXTCOLOR_RED"%s: ", Filename); + Printf("\n" TEXTCOLOR_RED "%s: ", Filename); if (res == SZ_ERROR_UNSUPPORTED) { Printf("Decoder does not support this archive\n"); diff --git a/src/s_playlist.cpp b/src/s_playlist.cpp index ce82a8182d..c7af3b0c55 100644 --- a/src/s_playlist.cpp +++ b/src/s_playlist.cpp @@ -63,7 +63,7 @@ bool FPlayList::ChangeList (const char *path) if ( (file = fopen (path, "rb")) == NULL) { - Printf ("Could not open "TEXTCOLOR_BOLD"%s"TEXTCOLOR_NORMAL": %s\n", path, strerror(errno)); + Printf ("Could not open " TEXTCOLOR_BOLD "%s" TEXTCOLOR_NORMAL ": %s\n", path, strerror(errno)); return false; } diff --git a/src/sc_man.cpp b/src/sc_man.cpp index 148f006375..4b9d710a33 100644 --- a/src/sc_man.cpp +++ b/src/sc_man.cpp @@ -922,7 +922,7 @@ void STACK_ARGS FScanner::ScriptMessage (const char *message, ...) va_end (arglist); } - Printf (TEXTCOLOR_RED"Script error, \"%s\" line %d:\n"TEXTCOLOR_RED"%s\n", ScriptName.GetChars(), + Printf (TEXTCOLOR_RED "Script error, \"%s\" line %d:\n" TEXTCOLOR_RED "%s\n", ScriptName.GetChars(), AlreadyGot? AlreadyGotLine : Line, composed.GetChars()); } diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index 46e3898ff9..292da5930b 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -616,7 +616,7 @@ int I_PickIWad (WadStuff *wads, int numwads, bool showwin, int defaultiwad) const char *str; if((str=getenv("KDE_FULL_SESSION")) && strcmp(str, "true") == 0) { - FString cmd("kdialog --title \""GAMESIG" "); + FString cmd("kdialog --title \"" GAMESIG " "); cmd << GetVersionString() << ": Select an IWAD to use\"" " --menu \"ZDoom found more than one IWAD\n" "Select from the list below to determine which one to use:\""; diff --git a/src/sound/fmodsound.cpp b/src/sound/fmodsound.cpp index 6dd7a5459a..c21ba40549 100644 --- a/src/sound/fmodsound.cpp +++ b/src/sound/fmodsound.cpp @@ -732,8 +732,8 @@ bool FMODSoundRenderer::Init() } if (wrongver != NULL) { - Printf (" "TEXTCOLOR_ORANGE"Error! You are using %s version of FMOD (%x.%02x.%02x).\n" - " "TEXTCOLOR_ORANGE"This program was built for version %x.%02x.%02x\n", + Printf (" " TEXTCOLOR_ORANGE "Error! You are using %s version of FMOD (%x.%02x.%02x).\n" + " " TEXTCOLOR_ORANGE "This program was built for version %x.%02x.%02x\n", wrongver, version >> 16, (version >> 8) & 255, version & 255, FMOD_VERSION >> 16, (FMOD_VERSION >> 8) & 255, FMOD_VERSION & 255); @@ -1261,15 +1261,15 @@ void FMODSoundRenderer::PrintStatus() unsigned int bufferlength; int numbuffers; - Printf ("Loaded FMOD version: "TEXTCOLOR_GREEN"%x.%02x.%02x\n", ActiveFMODVersion >> 16, + Printf ("Loaded FMOD version: " TEXTCOLOR_GREEN "%x.%02x.%02x\n", ActiveFMODVersion >> 16, (ActiveFMODVersion >> 8) & 255, ActiveFMODVersion & 255); if (FMOD_OK == Sys->getOutput(&output)) { - Printf ("Output type: "TEXTCOLOR_GREEN"%s\n", Enum_NameForNum(OutputNames, output)); + Printf ("Output type: " TEXTCOLOR_GREEN "%s\n", Enum_NameForNum(OutputNames, output)); } if (FMOD_OK == Sys->getSpeakerMode(&speakermode)) { - Printf ("Speaker mode: "TEXTCOLOR_GREEN"%s\n", Enum_NameForNum(SpeakerModeNames, speakermode)); + Printf ("Speaker mode: " TEXTCOLOR_GREEN "%s\n", Enum_NameForNum(SpeakerModeNames, speakermode)); } if (FMOD_OK == Sys->getDriver(&driver)) { @@ -1278,19 +1278,19 @@ void FMODSoundRenderer::PrintStatus() { strcpy(name, "Unknown"); } - Printf ("Driver: "TEXTCOLOR_GREEN"%d"TEXTCOLOR_NORMAL" ("TEXTCOLOR_ORANGE"%s"TEXTCOLOR_NORMAL")\n", driver, name); + Printf ("Driver: " TEXTCOLOR_GREEN "%d" TEXTCOLOR_NORMAL " (" TEXTCOLOR_ORANGE "%s" TEXTCOLOR_NORMAL ")\n", driver, name); DumpDriverCaps(Driver_Caps, Driver_MinFrequency, Driver_MaxFrequency); } if (FMOD_OK == Sys->getSoftwareFormat(&samplerate, &format, &numoutputchannels, NULL, &resampler, NULL)) { - Printf (TEXTCOLOR_LIGHTBLUE "Software mixer sample rate: "TEXTCOLOR_GREEN"%d\n", samplerate); - Printf (TEXTCOLOR_LIGHTBLUE "Software mixer format: "TEXTCOLOR_GREEN"%s\n", Enum_NameForNum(SoundFormatNames, format)); - Printf (TEXTCOLOR_LIGHTBLUE "Software mixer channels: "TEXTCOLOR_GREEN"%d\n", numoutputchannels); - Printf (TEXTCOLOR_LIGHTBLUE "Software mixer resampler: "TEXTCOLOR_GREEN"%s\n", Enum_NameForNum(ResamplerNames, resampler)); + Printf (TEXTCOLOR_LIGHTBLUE "Software mixer sample rate: " TEXTCOLOR_GREEN "%d\n", samplerate); + Printf (TEXTCOLOR_LIGHTBLUE "Software mixer format: " TEXTCOLOR_GREEN "%s\n", Enum_NameForNum(SoundFormatNames, format)); + Printf (TEXTCOLOR_LIGHTBLUE "Software mixer channels: " TEXTCOLOR_GREEN "%d\n", numoutputchannels); + Printf (TEXTCOLOR_LIGHTBLUE "Software mixer resampler: " TEXTCOLOR_GREEN "%s\n", Enum_NameForNum(ResamplerNames, resampler)); } if (FMOD_OK == Sys->getDSPBufferSize(&bufferlength, &numbuffers)) { - Printf (TEXTCOLOR_LIGHTBLUE "DSP buffers: "TEXTCOLOR_GREEN"%u samples x %d\n", bufferlength, numbuffers); + Printf (TEXTCOLOR_LIGHTBLUE "DSP buffers: " TEXTCOLOR_GREEN "%u samples x %d\n", bufferlength, numbuffers); } } @@ -1302,8 +1302,8 @@ void FMODSoundRenderer::PrintStatus() void FMODSoundRenderer::DumpDriverCaps(FMOD_CAPS caps, int minfrequency, int maxfrequency) { - Printf (TEXTCOLOR_OLIVE " Min. frequency: "TEXTCOLOR_GREEN"%d\n", minfrequency); - Printf (TEXTCOLOR_OLIVE " Max. frequency: "TEXTCOLOR_GREEN"%d\n", maxfrequency); + Printf (TEXTCOLOR_OLIVE " Min. frequency: " TEXTCOLOR_GREEN "%d\n", minfrequency); + Printf (TEXTCOLOR_OLIVE " Max. frequency: " TEXTCOLOR_GREEN "%d\n", maxfrequency); Printf (" Features:\n"); if (caps == 0) Printf(TEXTCOLOR_OLIVE " None\n"); if (caps & FMOD_CAPS_HARDWARE) Printf(TEXTCOLOR_OLIVE " Hardware mixing\n"); @@ -1318,7 +1318,7 @@ void FMODSoundRenderer::DumpDriverCaps(FMOD_CAPS caps, int minfrequency, int max { Printf("\n"); } - if (caps & FMOD_CAPS_REVERB_LIMITED) Printf("TEXTCOLOR_OLIVE Limited reverb\n"); + if (caps & FMOD_CAPS_REVERB_LIMITED) Printf(TEXTCOLOR_OLIVE " Limited reverb\n"); } //========================================================================== @@ -1386,11 +1386,11 @@ FString FMODSoundRenderer::GatherStats() } #endif - out.Format ("%d channels,"TEXTCOLOR_YELLOW"%5.2f"TEXTCOLOR_NORMAL"%% CPU " - "(DSP:"TEXTCOLOR_YELLOW"%5.2f"TEXTCOLOR_NORMAL"%% " - "Stream:"TEXTCOLOR_YELLOW"%5.2f"TEXTCOLOR_NORMAL"%% " - "Geometry:"TEXTCOLOR_YELLOW"%5.2f"TEXTCOLOR_NORMAL"%% " - "Update:"TEXTCOLOR_YELLOW"%5.2f"TEXTCOLOR_NORMAL"%%)", + out.Format ("%d channels," TEXTCOLOR_YELLOW "%5.2f" TEXTCOLOR_NORMAL "%% CPU " + "(DSP:" TEXTCOLOR_YELLOW "%5.2f" TEXTCOLOR_NORMAL "%% " + "Stream:" TEXTCOLOR_YELLOW "%5.2f" TEXTCOLOR_NORMAL "%% " + "Geometry:" TEXTCOLOR_YELLOW "%5.2f" TEXTCOLOR_NORMAL "%% " + "Update:" TEXTCOLOR_YELLOW "%5.2f" TEXTCOLOR_NORMAL "%%)", channels, total, dsp, stream, geometry, update); return out; } diff --git a/src/sound/music_fluidsynth_mididevice.cpp b/src/sound/music_fluidsynth_mididevice.cpp index 2e86cb2eeb..53a93fe099 100644 --- a/src/sound/music_fluidsynth_mididevice.cpp +++ b/src/sound/music_fluidsynth_mididevice.cpp @@ -620,10 +620,10 @@ FString FluidSynthMIDIDevice::GetStats() fluid_settings_getint(FluidSettings, "synth.polyphony", &maxpoly); CritSec.Leave(); - out.Format("Voices: "TEXTCOLOR_YELLOW"%3d"TEXTCOLOR_NORMAL"/"TEXTCOLOR_ORANGE"%3d"TEXTCOLOR_NORMAL"("TEXTCOLOR_RED"%3d"TEXTCOLOR_NORMAL")" - TEXTCOLOR_YELLOW"%6.2f"TEXTCOLOR_NORMAL"%% CPU " - "Reverb: "TEXTCOLOR_YELLOW"%3s"TEXTCOLOR_NORMAL - " Chorus: "TEXTCOLOR_YELLOW"%3s", + out.Format("Voices: " TEXTCOLOR_YELLOW "%3d" TEXTCOLOR_NORMAL "/" TEXTCOLOR_ORANGE "%3d" TEXTCOLOR_NORMAL "(" TEXTCOLOR_RED "%3d" TEXTCOLOR_NORMAL ")" + TEXTCOLOR_YELLOW "%6.2f" TEXTCOLOR_NORMAL "%% CPU " + "Reverb: " TEXTCOLOR_YELLOW "%3s" TEXTCOLOR_NORMAL + " Chorus: " TEXTCOLOR_YELLOW "%3s", voices, polyphony, maxpoly, load, reverb, chorus); return out; } From 83bd8ba1b809faff11dd04829be771ce892eb6e9 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 22 Jul 2013 22:37:50 +0200 Subject: [PATCH 24/27] - added NeuralStunner's player.userange submission, but changed it to use the value directly from the PlayerPawn data. - bumped savegame version for addition of APlayerPawn::userange. --- src/d_player.h | 1 + src/p_map.cpp | 22 ++++++++++++++++------ src/p_user.cpp | 4 ++++ src/thingdef/thingdef_properties.cpp | 9 +++++++++ src/version.h | 2 +- wadsrc/static/actors/shared/player.txt | 1 + 6 files changed, 32 insertions(+), 7 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 6169dcebfd..e4bc48f2d4 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -140,6 +140,7 @@ public: int SpawnMask; FNameNoInit MorphWeapon; fixed_t AttackZOffset; // attack height, relative to player center + fixed_t UseRange; // [NS] Distance at which player can +use const PClass *FlechetteType; // [CW] Fades for when you are being damaged. diff --git a/src/p_map.cpp b/src/p_map.cpp index 17bb3e1359..211e030565 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4359,14 +4359,17 @@ bool P_NoWayTraverse (AActor *usething, fixed_t endx, fixed_t endy) void P_UseLines (player_t *player) { angle_t angle; - fixed_t x1, y1; + fixed_t x1, y1, usedist; bool foundline; foundline = false; angle = player->mo->angle >> ANGLETOFINESHIFT; - x1 = player->mo->x + (USERANGE>>FRACBITS)*finecosine[angle]; - y1 = player->mo->y + (USERANGE>>FRACBITS)*finesine[angle]; + usedist = player->mo->UseRange; + + // [NS] Now queries the Player's UseRange. + x1 = player->mo->x + FixedMul(usedist, finecosine[angle]); + y1 = player->mo->y + FixedMul(usedist, finesine[angle]); // old code: // @@ -4398,13 +4401,20 @@ void P_UseLines (player_t *player) bool P_UsePuzzleItem (AActor *PuzzleItemUser, int PuzzleItemType) { int angle; - fixed_t x1, y1, x2, y2; + fixed_t x1, y1, x2, y2, usedist; angle = PuzzleItemUser->angle>>ANGLETOFINESHIFT; x1 = PuzzleItemUser->x; y1 = PuzzleItemUser->y; - x2 = x1+(USERANGE>>FRACBITS)*finecosine[angle]; - y2 = y1+(USERANGE>>FRACBITS)*finesine[angle]; + + // [NS] If it's a Player, get their UseRange. + if (PuzzleItemUser->player) + usedist = PuzzleItemUser->player->mo->UseRange; + else + usedist = USERANGE; + + x2 = x1 + FixedMul(usedist, finecosine[angle]); + y2 = y1 + FixedMul(usedist, finesine[angle]); FPathTraverse it(x1, y1, x2, y2, PT_ADDLINES|PT_ADDTHINGS); intercept_t *in; diff --git a/src/p_user.cpp b/src/p_user.cpp index 5ac8a1a885..5d8283e7e6 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -474,6 +474,10 @@ void APlayerPawn::Serialize (FArchive &arc) { arc << GruntSpeed << FallingScreamMinSpeed << FallingScreamMaxSpeed; } + if (SaveVersion >= 4502) + { + arc << UseRange; + } } //=========================================================================== diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index cf4ef95bba..61a18b370d 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2410,6 +2410,15 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, viewheight, F, PlayerPawn) defaults->ViewHeight = z; } +//========================================================================== +// +//========================================================================== +DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn) +{ + PROP_FIXED_PARM(z, 0); + defaults->UseRange = z; +} + //========================================================================== // //========================================================================== diff --git a/src/version.h b/src/version.h index 1038e401b5..8bdd8ca818 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 4501 +#define SAVEVER 4502 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) diff --git a/wadsrc/static/actors/shared/player.txt b/wadsrc/static/actors/shared/player.txt index 05fb998c31..5457880a76 100644 --- a/wadsrc/static/actors/shared/player.txt +++ b/wadsrc/static/actors/shared/player.txt @@ -24,6 +24,7 @@ Actor PlayerPawn : Actor native Player.GruntSpeed 12 Player.FallingScreamSpeed 35,40 Player.ViewHeight 41 + Player.UseRange 64 Player.ForwardMove 1,1 Player.SideMove 1,1 Player.ColorRange 0,0 From cb3275cb404803c821305eb44d3f9be20584c082 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 22 Jul 2013 22:47:13 +0200 Subject: [PATCH 25/27] - added NORANDOMPUFFZ flag for LineAttack - by Blue Shadow. --- src/p_acs.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index f57846b3c9..4a3ab2444b 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -112,6 +112,9 @@ FRandom pr_acs ("ACS"); #define NOT_FLOOR 8 #define NOT_CEILING 16 +// LineAtack flags +#define FHF_NORANDOMPUFFZ 1 + // SpawnDecal flags #define SDF_ABSANGLE 1 #define SDF_PERMANENT 2 @@ -4966,10 +4969,13 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const FName pufftype = argCount > 4 && args[4]? FName(FBehavior::StaticLookupString(args[4])) : NAME_BulletPuff; FName damagetype = argCount > 5 && args[5]? FName(FBehavior::StaticLookupString(args[5])) : NAME_None; fixed_t range = argCount > 6 && args[6]? args[6] : MISSILERANGE; + int flags = argCount > 7 && args[7]? args[7] : 0; + + int fhflags = (flags & FHF_NORANDOMPUFFZ)? LAF_NORANDOMPUFFZ : 0; if (args[0] == 0) { - P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype); + P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype, fhflags); } else { @@ -4978,7 +4984,7 @@ int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const while ((source = it.Next()) != NULL) { - P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype); + P_LineAttack(activator, angle, range, pitch, damage, damagetype, pufftype, fhflags); } } } From 181181a8651f9b018d0df4e46d6a131b6fc9530c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 23 Jul 2013 12:31:44 +0200 Subject: [PATCH 26/27] - removed player_t destructor call in CopyPlayer. --- src/p_saveg.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/p_saveg.cpp b/src/p_saveg.cpp index d33f21f6f2..bf0da0cbe3 100644 --- a/src/p_saveg.cpp +++ b/src/p_saveg.cpp @@ -267,7 +267,6 @@ static void CopyPlayer (player_t *dst, player_t *src, const char *name) bool usedown = dst->usedown; - dst->~player_t(); // ensure that the userinfo in dst does not contain anything before copying everything over. *dst = *src; // To avoid memory leaks at this point the userinfo in src must be empty which is taken care of by the TransferFrom call above. dst->cheats |= chasecam; From af470b3d56f700b0b188c53897af93f78e82b475 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 23 Jul 2013 12:32:33 +0200 Subject: [PATCH 27/27] - fixed: The global variables holding the view's fixed colormap must be preserved when rendering to a camera texture. --- src/r_utility.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/r_utility.cpp b/src/r_utility.cpp index b5382ccad4..0b51578ed1 100644 --- a/src/r_utility.cpp +++ b/src/r_utility.cpp @@ -62,6 +62,9 @@ extern bool DrawFSHUD; // [RH] Defined in d_main.cpp EXTERN_CVAR (Bool, cl_capfps) +extern lighttable_t* fixedcolormap; +extern FSpecialColormap*realfixedcolormap; + // TYPES ------------------------------------------------------------------- struct InterpolationViewer @@ -1005,6 +1008,11 @@ void FCanvasTextureInfo::UpdateAll () { FCanvasTextureInfo *probe; + // curse Doom's overuse of global variables in the renderer. + // These get clobbered by rendering to a camera texture but they need to be preserved so the final rendering can be done with the correct palette. + unsigned char *savecolormap = fixedcolormap; + FSpecialColormap *savecm = realfixedcolormap; + for (probe = List; probe != NULL; probe = probe->Next) { if (probe->Viewpoint != NULL && probe->Texture->bNeedsUpdate) @@ -1012,6 +1020,9 @@ void FCanvasTextureInfo::UpdateAll () Renderer->RenderTextureView(probe->Texture, probe->Viewpoint, probe->FOV); } } + + fixedcolormap = savecolormap; + realfixedcolormap = savecm; } //==========================================================================