diff --git a/src/am_map.cpp b/src/am_map.cpp index a317c1190..e7708ae23 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -189,6 +189,10 @@ CVAR(Bool, am_portaloverlay, true, CVAR_ARCHIVE) CVAR(Bool, am_showgrid, false, CVAR_ARCHIVE) CVAR(Float, am_zoomdir, 0, CVAR_ARCHIVE) +static const char *const DEFAULT_FONT_NAME = "AMMNUMx"; +CVAR(String, am_markfont, DEFAULT_FONT_NAME, CVAR_ARCHIVE) +CVAR(Int, am_markcolor, CR_GREY, CVAR_ARCHIVE) + CCMD(am_togglefollow) { am_followplayer = !am_followplayer; @@ -1128,7 +1132,9 @@ void DAutomap::restoreScaleAndLoc () int DAutomap::addMark () { - if (marknums[0].isValid()) + // Add a mark when default font is selected and its textures (AMMNUM?) + // are loaded. Mark is always added when custom font is selected + if (stricmp(*am_markfont, DEFAULT_FONT_NAME) != 0 || marknums[0].isValid()) { auto m = markpointnum; markpoints[markpointnum].x = m_x + m_w/2; @@ -3032,12 +3038,37 @@ void DAutomap::DrawMarker (FTexture *tex, double x, double y, int yadjust, void DAutomap::drawMarks () { + FFont* font; + bool fontloaded = false; + for (int i = 0; i < AM_NUMMARKPOINTS; i++) { if (markpoints[i].x != -1) { - DrawMarker (TexMan.GetTexture(marknums[i], true), markpoints[i].x, markpoints[i].y, -3, 0, - 1, 1, 0, 1, 0, LegacyRenderStyles[STYLE_Normal]); + if (!fontloaded) + { + font = stricmp(*am_markfont, DEFAULT_FONT_NAME) == 0 ? nullptr : V_GetFont(am_markfont); + fontloaded = true; + } + + if (font == nullptr) + { + DrawMarker(TexMan.GetTexture(marknums[i], true), markpoints[i].x, markpoints[i].y, -3, 0, + 1, 1, 0, 1, 0, LegacyRenderStyles[STYLE_Normal]); + } + else + { + char numstr[2] = { char('0' + i), 0 }; + double x = markpoints[i].x; + double y = markpoints[i].y; + + if (am_rotate == 1 || (am_rotate == 2 && viewactive)) + { + rotatePoint (&x, &y); + } + + screen->DrawText(font, am_markcolor, CXMTOF(x), CYMTOF(y), numstr, TAG_DONE); + } } } } diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 1bb74c620..75e18fa37 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -810,6 +810,7 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int bool fakedPain = false; bool forcedPain = false; bool noPain = false; + bool wakeup = false; // Dead or non-existent entity, do not react. Especially if the damage is cancelled. if (target == nullptr || target->health < 1 || damage < 0) @@ -822,23 +823,9 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int ((player->cheats & CF_GODMODE) && damage < TELEFRAG_DAMAGE)) return; } - - noPain = (flags & DMG_NO_PAIN) || (target->flags5 & MF5_NOPAIN) || (inflictor && (inflictor->flags5 & MF5_PAINLESS)); - - // Are we attempting to cause pain? - if (!noPain) - { - fakedPain = (isFakePain(target, inflictor, originaldamage)); - forcedPain = (MustForcePain(target, inflictor)); - } - - // [MC] No forced or faked pain so skip it. - // However the rest of the function must carry on. - if (!noPain && damage < 1 && !fakedPain && !forcedPain) - noPain = true; - + woundstate = target->FindState(NAME_Wound, mod); - if (woundstate != NULL) + if (woundstate != nullptr) { int woundhealth = target->WoundHealth; @@ -848,10 +835,16 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int return; } } + // [MC] NOPAIN will not stop the actor from waking up if damaged. + // ALLOW/CAUSEPAIN will enable infighting, even if painless. + noPain = (flags & DMG_NO_PAIN) || (target->flags5 & MF5_NOPAIN) || (inflictor && (inflictor->flags5 & MF5_PAINLESS)); + fakedPain = (isFakePain(target, inflictor, originaldamage)); + forcedPain = (MustForcePain(target, inflictor)); + wakeup = (damage > 0 || fakedPain || forcedPain); - if (!noPain && + if (!noPain && wakeup && ((target->player != nullptr || !G_SkillProperty(SKILLP_NoPain)) && !(target->flags & MF_SKULLFLY)) - && damage >= target->PainThreshold) + && (forcedPain || damage >= target->PainThreshold)) { if (inflictor && inflictor->PainType != NAME_None) mod = inflictor->PainType; @@ -860,13 +853,13 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int justhit = TriggerPainChance(target, mod, forcedPain, false); } - if (target->player == nullptr) target->reactiontime = 0; // we're awake now... - if (source) + if (wakeup && target->player == nullptr) target->reactiontime = 0; // we're awake now... + if (wakeup && source) { if (source == target->target) { target->threshold = target->DefThreshold; - if (target->state == target->SpawnState && target->SeeState != NULL) + if (target->state == target->SpawnState && target->SeeState != nullptr) { target->SetState(target->SeeState); } @@ -879,15 +872,15 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int // killough 2/15/98: remember last enemy, to prevent // sleeping early; 2/21/98: Place priority on players - if (target->lastenemy == NULL || - (target->lastenemy->player == NULL && target->TIDtoHate == 0) || + if (target->lastenemy == nullptr || + (target->lastenemy->player == nullptr && target->TIDtoHate == 0) || target->lastenemy->health <= 0) { target->lastenemy = target->target; // remember last enemy - killough } target->target = source; target->threshold = target->DefThreshold; - if (target->state == target->SpawnState && target->SeeState != NULL) + if (target->state == target->SpawnState && target->SeeState != nullptr) { target->SetState(target->SeeState); } diff --git a/src/version.h b/src/version.h index 2dec05a54..146947c84 100644 --- a/src/version.h +++ b/src/version.h @@ -34,10 +34,6 @@ #ifndef __VERSION_H__ #define __VERSION_H__ -#ifdef _WIN32 -#include "gitinfo.h" -#endif // _WIN32 - const char *GetGitDescription(); const char *GetGitHash(); const char *GetGitTime(); @@ -45,11 +41,7 @@ const char *GetVersionString(); /** Lots of different version numbers **/ -#ifdef GIT_DESCRIPTION -#define VERSIONSTR GIT_DESCRIPTION -#else #define VERSIONSTR "3.8pre" -#endif // The version as seen in the Windows resource #define RC_FILEVERSION 3,7,9999,0 diff --git a/src/win32/zdoom.rc b/src/win32/zdoom.rc index 325c1d064..74e019de8 100644 --- a/src/win32/zdoom.rc +++ b/src/win32/zdoom.rc @@ -75,11 +75,11 @@ BEGIN " VALUE ""FileDescription"", ""GZDoom""\r\n" " VALUE ""FileVersion"", RC_FILEVERSION2\r\n" " VALUE ""InternalName"", ""GZDoom""\r\n" - " VALUE ""LegalCopyright"", ""Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al.""\r\n" + " VALUE ""LegalCopyright"", ""Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al.""\r\n" " VALUE ""LegalTrademarks"", ""DoomR is a Registered Trademark of id Software, Inc.""\r\n" " VALUE ""OriginalFilename"", ""gzdoom.exe""\r\n" " VALUE ""ProductName"", ""GZDoom""\r\n" - " VALUE ""ProductVersion"", RC_PRODUCTVERSION2\r\n" + " VALUE ""ProductVersion"", GIT_VERSION\r\n" " END\r\n" " END\r\n" " BLOCK ""VarFileInfo""\r\n" @@ -523,14 +523,14 @@ BEGIN BEGIN VALUE "Comments", "Thanks to id Software for creating DOOM and then releasing the source code. Thanks also to TeamTNT for creating BOOM, which ZDoom is partially based on. Includes code based on the Cajun Bot 0.97 by Martin Collberg." VALUE "CompanyName", " " - VALUE "FileDescription", "GZDoom" + VALUE "FileDescription", "GZDoom " GIT_DESCRIPTION VALUE "FileVersion", RC_FILEVERSION2 VALUE "InternalName", "GZDoom" - VALUE "LegalCopyright", "Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al." - VALUE "LegalTrademarks", "DoomR is a Registered Trademark of id Software, Inc." + VALUE "LegalCopyright", "Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al." + VALUE "LegalTrademarks", "Doom® is a Registered Trademark of id Software, Inc." VALUE "OriginalFilename", "gzdoom.exe" VALUE "ProductName", "GZDoom" - VALUE "ProductVersion", RC_PRODUCTVERSION2 + VALUE "ProductVersion", GIT_DESCRIPTION END END BLOCK "VarFileInfo" diff --git a/wadsrc/static/language.enu b/wadsrc/static/language.enu index 9396e84ff..c0af8b13e 100644 --- a/wadsrc/static/language.enu +++ b/wadsrc/static/language.enu @@ -2003,6 +2003,8 @@ AUTOMAPMNU_SHOWTRIGGERLINES = "Show trigger lines"; AUTOMAPMNU_SHOWTHINGSPRITES = "Show things as sprites"; AUTOMAPMNU_PTOVERLAY = "Overlay portals"; AUTOMAPMNU_EMPTYSPACEMARGIN = "Empty space margin"; +AUTOMAPMNU_MARKFONT = "Mark font"; +AUTOMAPMNU_MARKCOLOR = "Mark color"; // Automap Controls MAPCNTRLMNU_TITLE = "Customize Map Controls"; @@ -2503,6 +2505,9 @@ OPTVAL_VTAVANILLA = "Auto (Vanilla Preferred)"; OPTVAL_SCALENEAREST = "Scaled (Nearest)"; OPTVAL_SCALELINEAR = "Scaled (Linear)"; OPTVAL_LETTERBOX = "Letterbox"; +OPTVAL_SMALL = "Small"; +OPTVAL_LARGE = "Large"; +OPTVAL_CONSOLE = "Console"; // Colors C_BRICK = "\cabrick"; diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 2a6fe6a65..d90160f92 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1077,6 +1077,14 @@ OptionValue MapTriggers 2, "$OPTVAL_ON" } +OptionString MapMarkFont +{ + "AMMNUMx", "$OPTVAL_DEFAULT" + "SmallFont", "$OPTVAL_SMALL" + "BigFont", "$OPTVAL_LARGE" + "ConsoleFont", "$OPTVAL_CONSOLE" +} + OptionMenu AutomapOptions protected { Title "$AUTOMAPMNU_TITLE" @@ -1103,6 +1111,9 @@ OptionMenu AutomapOptions protected Option "$AUTOMAPMNU_SHOWKEYS", "am_showkeys", "OnOff" Option "$AUTOMAPMNU_SHOWTRIGGERLINES", "am_showtriggerlines", "MapTriggers" Option "$AUTOMAPMNU_SHOWTHINGSPRITES", "am_showthingsprites", "STSTypes" + StaticText " " + Option "$AUTOMAPMNU_MARKFONT", "am_markfont", "MapMarkFont" + Option "$AUTOMAPMNU_MARKCOLOR", "am_markcolor", "TextColors" } //-------------------------------------------------------------------------------------------