Merge branch 'master' of https://github.com/coelckers/gzdoom into localization

This commit is contained in:
Rachael Alexanderson 2019-02-16 10:50:49 -05:00
commit 9f62289507
6 changed files with 73 additions and 41 deletions

View file

@ -189,6 +189,10 @@ CVAR(Bool, am_portaloverlay, true, CVAR_ARCHIVE)
CVAR(Bool, am_showgrid, false, CVAR_ARCHIVE) CVAR(Bool, am_showgrid, false, CVAR_ARCHIVE)
CVAR(Float, am_zoomdir, 0, 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) CCMD(am_togglefollow)
{ {
am_followplayer = !am_followplayer; am_followplayer = !am_followplayer;
@ -1128,7 +1132,9 @@ void DAutomap::restoreScaleAndLoc ()
int DAutomap::addMark () 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; auto m = markpointnum;
markpoints[markpointnum].x = m_x + m_w/2; 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 () void DAutomap::drawMarks ()
{ {
FFont* font;
bool fontloaded = false;
for (int i = 0; i < AM_NUMMARKPOINTS; i++) for (int i = 0; i < AM_NUMMARKPOINTS; i++)
{ {
if (markpoints[i].x != -1) if (markpoints[i].x != -1)
{ {
DrawMarker (TexMan.GetTexture(marknums[i], true), markpoints[i].x, markpoints[i].y, -3, 0, if (!fontloaded)
1, 1, 0, 1, 0, LegacyRenderStyles[STYLE_Normal]); {
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);
}
} }
} }
} }

View file

@ -810,6 +810,7 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int
bool fakedPain = false; bool fakedPain = false;
bool forcedPain = false; bool forcedPain = false;
bool noPain = false; bool noPain = false;
bool wakeup = false;
// Dead or non-existent entity, do not react. Especially if the damage is cancelled. // Dead or non-existent entity, do not react. Especially if the damage is cancelled.
if (target == nullptr || target->health < 1 || damage < 0) if (target == nullptr || target->health < 1 || damage < 0)
@ -823,22 +824,8 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int
return; 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); woundstate = target->FindState(NAME_Wound, mod);
if (woundstate != NULL) if (woundstate != nullptr)
{ {
int woundhealth = target->WoundHealth; int woundhealth = target->WoundHealth;
@ -848,10 +835,16 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int
return; 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)) ((target->player != nullptr || !G_SkillProperty(SKILLP_NoPain)) && !(target->flags & MF_SKULLFLY))
&& damage >= target->PainThreshold) && (forcedPain || damage >= target->PainThreshold))
{ {
if (inflictor && inflictor->PainType != NAME_None) if (inflictor && inflictor->PainType != NAME_None)
mod = inflictor->PainType; mod = inflictor->PainType;
@ -860,13 +853,13 @@ static void ReactToDamage(AActor *target, AActor *inflictor, AActor *source, int
justhit = TriggerPainChance(target, mod, forcedPain, false); justhit = TriggerPainChance(target, mod, forcedPain, false);
} }
if (target->player == nullptr) target->reactiontime = 0; // we're awake now... if (wakeup && target->player == nullptr) target->reactiontime = 0; // we're awake now...
if (source) if (wakeup && source)
{ {
if (source == target->target) if (source == target->target)
{ {
target->threshold = target->DefThreshold; target->threshold = target->DefThreshold;
if (target->state == target->SpawnState && target->SeeState != NULL) if (target->state == target->SpawnState && target->SeeState != nullptr)
{ {
target->SetState(target->SeeState); 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 // killough 2/15/98: remember last enemy, to prevent
// sleeping early; 2/21/98: Place priority on players // sleeping early; 2/21/98: Place priority on players
if (target->lastenemy == NULL || if (target->lastenemy == nullptr ||
(target->lastenemy->player == NULL && target->TIDtoHate == 0) || (target->lastenemy->player == nullptr && target->TIDtoHate == 0) ||
target->lastenemy->health <= 0) target->lastenemy->health <= 0)
{ {
target->lastenemy = target->target; // remember last enemy - killough target->lastenemy = target->target; // remember last enemy - killough
} }
target->target = source; target->target = source;
target->threshold = target->DefThreshold; target->threshold = target->DefThreshold;
if (target->state == target->SpawnState && target->SeeState != NULL) if (target->state == target->SpawnState && target->SeeState != nullptr)
{ {
target->SetState(target->SeeState); target->SetState(target->SeeState);
} }

View file

@ -34,10 +34,6 @@
#ifndef __VERSION_H__ #ifndef __VERSION_H__
#define __VERSION_H__ #define __VERSION_H__
#ifdef _WIN32
#include "gitinfo.h"
#endif // _WIN32
const char *GetGitDescription(); const char *GetGitDescription();
const char *GetGitHash(); const char *GetGitHash();
const char *GetGitTime(); const char *GetGitTime();
@ -45,11 +41,7 @@ const char *GetVersionString();
/** Lots of different version numbers **/ /** Lots of different version numbers **/
#ifdef GIT_DESCRIPTION
#define VERSIONSTR GIT_DESCRIPTION
#else
#define VERSIONSTR "3.8pre" #define VERSIONSTR "3.8pre"
#endif
// The version as seen in the Windows resource // The version as seen in the Windows resource
#define RC_FILEVERSION 3,7,9999,0 #define RC_FILEVERSION 3,7,9999,0

View file

@ -75,11 +75,11 @@ BEGIN
" VALUE ""FileDescription"", ""GZDoom""\r\n" " VALUE ""FileDescription"", ""GZDoom""\r\n"
" VALUE ""FileVersion"", RC_FILEVERSION2\r\n" " VALUE ""FileVersion"", RC_FILEVERSION2\r\n"
" VALUE ""InternalName"", ""GZDoom""\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 ""LegalTrademarks"", ""DoomR is a Registered Trademark of id Software, Inc.""\r\n"
" VALUE ""OriginalFilename"", ""gzdoom.exe""\r\n" " VALUE ""OriginalFilename"", ""gzdoom.exe""\r\n"
" VALUE ""ProductName"", ""GZDoom""\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"
" END\r\n" " END\r\n"
" BLOCK ""VarFileInfo""\r\n" " BLOCK ""VarFileInfo""\r\n"
@ -523,14 +523,14 @@ BEGIN
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 "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 "CompanyName", " "
VALUE "FileDescription", "GZDoom" VALUE "FileDescription", "GZDoom " GIT_DESCRIPTION
VALUE "FileVersion", RC_FILEVERSION2 VALUE "FileVersion", RC_FILEVERSION2
VALUE "InternalName", "GZDoom" VALUE "InternalName", "GZDoom"
VALUE "LegalCopyright", "Copyright © 1993-1996 id Software, 1998-2010 Randy Heit, 2002-2010 Christoph Oelckers, et al." 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 "LegalTrademarks", "Doom® is a Registered Trademark of id Software, Inc."
VALUE "OriginalFilename", "gzdoom.exe" VALUE "OriginalFilename", "gzdoom.exe"
VALUE "ProductName", "GZDoom" VALUE "ProductName", "GZDoom"
VALUE "ProductVersion", RC_PRODUCTVERSION2 VALUE "ProductVersion", GIT_DESCRIPTION
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"

View file

@ -2003,6 +2003,8 @@ AUTOMAPMNU_SHOWTRIGGERLINES = "Show trigger lines";
AUTOMAPMNU_SHOWTHINGSPRITES = "Show things as sprites"; AUTOMAPMNU_SHOWTHINGSPRITES = "Show things as sprites";
AUTOMAPMNU_PTOVERLAY = "Overlay portals"; AUTOMAPMNU_PTOVERLAY = "Overlay portals";
AUTOMAPMNU_EMPTYSPACEMARGIN = "Empty space margin"; AUTOMAPMNU_EMPTYSPACEMARGIN = "Empty space margin";
AUTOMAPMNU_MARKFONT = "Mark font";
AUTOMAPMNU_MARKCOLOR = "Mark color";
// Automap Controls // Automap Controls
MAPCNTRLMNU_TITLE = "Customize Map Controls"; MAPCNTRLMNU_TITLE = "Customize Map Controls";
@ -2503,6 +2505,9 @@ OPTVAL_VTAVANILLA = "Auto (Vanilla Preferred)";
OPTVAL_SCALENEAREST = "Scaled (Nearest)"; OPTVAL_SCALENEAREST = "Scaled (Nearest)";
OPTVAL_SCALELINEAR = "Scaled (Linear)"; OPTVAL_SCALELINEAR = "Scaled (Linear)";
OPTVAL_LETTERBOX = "Letterbox"; OPTVAL_LETTERBOX = "Letterbox";
OPTVAL_SMALL = "Small";
OPTVAL_LARGE = "Large";
OPTVAL_CONSOLE = "Console";
// Colors // Colors
C_BRICK = "\cabrick"; C_BRICK = "\cabrick";

View file

@ -1077,6 +1077,14 @@ OptionValue MapTriggers
2, "$OPTVAL_ON" 2, "$OPTVAL_ON"
} }
OptionString MapMarkFont
{
"AMMNUMx", "$OPTVAL_DEFAULT"
"SmallFont", "$OPTVAL_SMALL"
"BigFont", "$OPTVAL_LARGE"
"ConsoleFont", "$OPTVAL_CONSOLE"
}
OptionMenu AutomapOptions protected OptionMenu AutomapOptions protected
{ {
Title "$AUTOMAPMNU_TITLE" Title "$AUTOMAPMNU_TITLE"
@ -1103,6 +1111,9 @@ OptionMenu AutomapOptions protected
Option "$AUTOMAPMNU_SHOWKEYS", "am_showkeys", "OnOff" Option "$AUTOMAPMNU_SHOWKEYS", "am_showkeys", "OnOff"
Option "$AUTOMAPMNU_SHOWTRIGGERLINES", "am_showtriggerlines", "MapTriggers" Option "$AUTOMAPMNU_SHOWTRIGGERLINES", "am_showtriggerlines", "MapTriggers"
Option "$AUTOMAPMNU_SHOWTHINGSPRITES", "am_showthingsprites", "STSTypes" Option "$AUTOMAPMNU_SHOWTHINGSPRITES", "am_showthingsprites", "STSTypes"
StaticText " "
Option "$AUTOMAPMNU_MARKFONT", "am_markfont", "MapMarkFont"
Option "$AUTOMAPMNU_MARKCOLOR", "am_markcolor", "TextColors"
} }
//------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------