Merge remote-tracking branch 'upstream/master'

This commit is contained in:
Simon 2023-01-27 09:33:18 +00:00
commit 42f29bd4bb
20 changed files with 1814 additions and 1612 deletions

View file

@ -480,7 +480,7 @@ CollisionBase clipmove_(vec3_t * const pos, int * const sectnum, int32_t xvect,
const int32_t sinang = bsin(actor->int_ang());
vec2_t const span = { (int)tex->GetDisplayWidth(), (int)tex->GetDisplayHeight() };
vec2_t const repeat = { int(actor->spr.scale.X * scaletoint), int(actor->spr.scale.Y * scaletoint) };
vec2_t adjofs = { (int)tex->GetDisplayTopOffset(), (int)tex->GetDisplayTopOffset() };
vec2_t adjofs = { (int)tex->GetDisplayLeftOffset(), (int)tex->GetDisplayTopOffset() };
if (actor->spr.cstat & CSTAT_SPRITE_XFLIP)
adjofs.X = -adjofs.X;

View file

@ -29,7 +29,7 @@ CVAR(Bool, vid_fps, false, 0)
EXTERN_CVAR(Bool, ui_generic)
CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL | CVAR_GLOBALCONFIG)
CUSTOM_CVAR(String, language, "auto", CVAR_ARCHIVE | CVAR_NOINITCALL /* | CVAR_GLOBALCONFIG*/)
{
GStrings.UpdateLanguage(self);
UpdateGenericUI(ui_generic);

View file

@ -924,10 +924,16 @@ void M_Init (void)
}
catch (CVMAbortException &err)
{
menuDelegate = nullptr;
err.MaybePrintMessage();
Printf(PRINT_NONOTIFY | PRINT_BOLD, "%s", err.stacktrace.GetChars());
I_FatalError("Failed to initialize menus");
}
catch (...)
{
menuDelegate = nullptr;
throw;
}
M_CreateMenus();
}

View file

@ -150,13 +150,13 @@ void DeinitMenus()
pair->Value = nullptr;
}
}
MenuDescriptors.Clear();
OptionValues.Clear();
if (menuDelegate)
{
menuDelegate->Destroy();
menuDelegate = nullptr;
}
MenuDescriptors.Clear();
OptionValues.Clear();
}
FTextureID GetMenuTexture(const char* const name)

View file

@ -1188,7 +1188,11 @@ int RunGame()
void updatePauseStatus()
{
// This must go through the network in multiplayer games.
if (M_Active() || System_WantGuiCapture() || !AppActive)
if (M_Active() || System_WantGuiCapture())
{
paused = 1;
}
else if (!AppActive)
{
if (i_pauseinbackground)
paused = 1;

View file

@ -149,6 +149,7 @@ static FSoundID S_AddSound(const char* logicalname, int lumpnum, FScanner* sc)
FSoundID S_AddSound(const char* logicalname, const char* lumpname, FScanner* sc)
{
int lump = fileSystem.CheckNumForFullName(lumpname, true, ns_sounds);
if (lump == -1 && sc) sc->ScriptMessage("%s: sound file not found", sc->String);
return S_AddSound(logicalname, lump, sc);
}
@ -425,6 +426,10 @@ static void S_AddSNDINFO (int lump)
default:
{ // Got a logical sound mapping
if (sc.String[0] == '$')
{
sc.ScriptError("%s: Unknown keyword");
}
FString name (sc.String);
if (wantassigns == -1)
{

View file

@ -36,11 +36,13 @@ enum
kGenDudeTransformStatus = -222,
kGenDudeUpdTimeRate = 10,
kGenDudeMaxMeleeDist = 2048,
kGenDudeMaxMeleeDistf = 128,
kGenDudeMinDispesion = 200,
kGenDudeMaxDispersion = 3500,
};
constexpr double kGenDudeMaxMeleeDistf = 128;
enum {
kGenDudeSeqIdleL = 0,
kGenDudeSeqDeathDefault = 1,

View file

@ -88,8 +88,8 @@ void GetSpriteExtents(spritetypebase const* const pSprite, double* top, double*
if ((pSprite->cstat & CSTAT_SPRITE_ALIGNMENT_MASK) != CSTAT_SPRITE_ALIGNMENT_FLOOR)
{
auto tex = TexMan.GetGameTexture(pSprite->spritetexture());
double height = tex->GetDisplayHeight();
double center = height / 2 + tex->GetDisplayTopOffset();
int height = int(tex->GetDisplayHeight());
int center = height / 2 + int(tex->GetDisplayTopOffset());
*top -= pSprite->scale.Y * center;
*bottom += pSprite->scale.Y * (height - center);
}

View file

@ -329,7 +329,8 @@ void fxSpawnEjectingBrass(DBloodActor* actor, double z, double dist, int rdist)
{
if (!VanillaMode())
pBrass->spr.Angles.Yaw = RandomAngle();
double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4);
int iDist = (rdist << 18) / 120 + Random2(((rdist / 4) << 18) / 120);
double nDist = iDist / 65536.;
DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90;
pBrass->vel.XY() = nAngle.ToVector() * nDist;
pBrass->vel.Z = actor->vel.Z - 2 - Random2(40) / 30.;
@ -351,7 +352,8 @@ void fxSpawnEjectingShell(DBloodActor* actor, double z, double dist, int rdist)
{
if (!VanillaMode())
pShell->spr.Angles.Yaw = RandomAngle();
double nDist = rdist / 30. + Random2F(((rdist / 4) << 18) / 120, 4);
int iDist = (rdist << 18) / 120 + Random2(((rdist / 4) << 18) / 120);
double nDist = iDist / 65536.;
DAngle nAngle = actor->spr.Angles.Yaw + Random2A(56) + DAngle90;
pShell->vel.XY() = nAngle.ToVector() * nDist;
pShell->vel.Z = actor->vel.Z - 2 - Random2(28) / 30.;

View file

@ -67,14 +67,14 @@ enum
kModernTypeFlag64 = 0x0040,
kMaxRandomizeRetries = 16,
kPercFull = 100,
kCondRange = 100,
};
constexpr int kPercFull = 100;
enum
{
kPatrolStateSize = 42,
kPatrolAlarmSeeDistSq = 625*625,
kPatrolAlarmHearDist = 10000,
kMaxPatrolSpotValue = 500,
kMinPatrolTurnDelay = 8,
@ -83,7 +83,6 @@ enum
kDudeFlagStealth = 0x0001,
kDudeFlagCrouch = 0x0002,
kSlopeDist = 0x20,
kEffectGenCallbackBase = 200,
kTriggerSpriteScreen = 0x0001,
kTriggerSpriteAim = 0x0002,
@ -92,6 +91,8 @@ enum
kMaxAllowedPowerup = kMaxPowerUps
};
constexpr double kPatrolAlarmSeeDistSq = 625 * 625;
constexpr double kSlopeDist = 0x20;
constexpr double kMaxPatrolVelocity = FixedToFloat(500000); // ~7.63
constexpr double kMaxPatrolCrouchVelocity = (kMaxPatrolVelocity / 2);

View file

@ -4,12 +4,10 @@
// all game constants got collected here.
enum
{
TICRATE = 120,
REALGAMETICSPERSEC = 30, // The number of game state updates per second:
TICSPERFRAME = (TICRATE/REALGAMETICSPERSEC) // (This used to be TICRATE/GAMETICSPERSEC, which was 120/26 = 4.615~ truncated to 4 by integer division.)
};
constexpr int TICRATE = 120;
constexpr int REALGAMETICSPERSEC = 30; // The number of game state updates per second:
constexpr int TICSPERFRAME = (TICRATE / REALGAMETICSPERSEC); // (This used to be TICRATE/GAMETICSPERSEC, which was 120/26 = 4.615~ truncated to 4 by integer division.)
// tile names which are identical for all games.
enum

View file

@ -228,7 +228,7 @@ double hitawall(player_struct* p, walltype** hitw)
DDukeActor* aim(DDukeActor* actor, int abase)
{
DAngle aang = DAngle90 * (AUTO_AIM_ANGLE / 512.);
DAngle aang = DAngle90 * (+AUTO_AIM_ANGLE / 512.);
bool gotshrinker, gotfreezer;
static const int aimstats[] = { STAT_PLAYER, STAT_DUMMYPLAYER, STAT_ACTOR, STAT_ZOMBIEACTOR };

View file

@ -2794,12 +2794,12 @@ DEFINE_ACTION_FUNCTION(_Exhumed, GetViewPlayer)
DEFINE_ACTION_FUNCTION(_Exhumed, GetPistolClip)
{
ACTION_RETURN_POINTER(&PlayerList[nLocalPlayer].nPistolClip);
ACTION_RETURN_INT(PlayerList[nLocalPlayer].nPistolClip);
}
DEFINE_ACTION_FUNCTION(_Exhumed, GetPlayerClip)
{
ACTION_RETURN_POINTER(&PlayerList[nLocalPlayer].nPlayerClip);
ACTION_RETURN_INT(PlayerList[nLocalPlayer].nPlayerClip);
}
DEFINE_ACTION_FUNCTION(_ExhumedPlayer, IsUnderwater)

View file

@ -1406,7 +1406,7 @@ void InitAmbient(int num, DSWActor* actor);
inline void PlaySound(int num, PLAYER* player, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
{
_PlaySound(num, nullptr, player, nullptr, flags, channel, sndflags);
_PlaySound(num, nullptr, player, nullptr, flags | v3df_follow, channel, sndflags);
}
inline void PlaySound(int num, int flags, int channel = 8, EChanFlags sndflags = CHANF_NONE)
{
@ -1521,9 +1521,6 @@ extern int lockspeed;
// Various scattered constants
enum
{
synctics = 3,
ACTORMOVETICS = (synctics << 1),
TICSPERMOVEMENT = synctics,
ACTOR_GRAVITY = 8,
// subtract value from clipdist on getzrange calls
STAT_DAMAGE_LIST_SIZE = 20,
@ -1535,6 +1532,11 @@ enum
};
constexpr int synctics = 3;
constexpr int ACTORMOVETICS = (synctics << 1);
constexpr int TICSPERMOVEMENT = synctics;
constexpr double GETZRANGE_CLIP_ADJ = 0.5;

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

47
wadsrc/static/lmacros.csv Normal file
View file

@ -0,0 +1,47 @@
name,language,male,female,neutral,object
adj_cs,cs,ý,á,é,é
ao_cs,cs,,a,o,o
psf1_cs,cs,ova,ina,ova,ova
psn1_cs,cs,ovo,ino,ovo,ovo
self_cs,cs,sám,sama,samo,samo
tgs_past_cs,cs,,ši,ši,ši
tgs_pr1_cs,cs,e,íc,íc,íc
e_de,de,,e,,
in_de,de,,in,,
pp_de,de,seine,ihre,seine,seine
pro_eo,eo,li,ŝi,ri,ĝi
ao_esp,es,o,a,o,o
a_esp,es,,a,,
ae_esp,es,e,a,e,e
e_fr,fr,,e,,
hij_ze_nl,nl,hij,ze,hij,hij
zijn_haar_nl,nl,zijn,haar,zijn,zijn
ao_pl,pl,,a,o,o
adj_pl,pl,y,a,e,e
irreg_1_pl,pl,szedł ,eszła,eszło,eszło
irreg_2_pl,pl,ął,ęła,ęło,ęło
irreg_3_pl,pl,eś,aś,eś,eś
irreg_4_pl,pl,ógł,ogła,ogło,ogło
irreg_5_pl,pl,ien,na,no,no
ao_ptb,pt,o,a,o,o
ao_rus,ru,,а,о,о
refl_rus,ru,ся,ась,ось,ось
adj_1_rus,ru,ый,ая,ое,ое
adj_2_rus,ru,ен,на,но,но
adj_3_rus,ru,ён,на,но,но
irreg_1_rus,ru,ёл,ла,ло,ло
irreg_2_rus,ru,,ла,ло,ло
irreg_3_rus,ru,ёг,егла,егло,егло
pron_rus,ru,него,неё,него,него
ao_1_sr,sr,о,ла,ло,ло
ao_2_sr,sr,ао,ла,ло,ло
ao_3_sr,sr,ог,у,ог,ог
adj_1_sr,sr,,а,о,о
adj_2_sr,sr,ан,на,но,но
adj_3_sr,sr,ар,ра,ро,ро
pro_gr,el,τον,την,τον,το
pro2_gr,el,Τον,Την,Τον,Το
pro3_gr,el,στον,στην,στο,στο
art_gr,el,Ο,Η,Το,Το
pro4_gr,el,του,της,του,του
pro_dk,da,han,hun,han,det
1 name language male female neutral object
2 adj_cs cs ý á é é
3 ao_cs cs a o o
4 psf1_cs cs ova ina ova ova
5 psn1_cs cs ovo ino ovo ovo
6 self_cs cs sám sama samo samo
7 tgs_past_cs cs ši ši ši
8 tgs_pr1_cs cs e íc íc íc
9 e_de de e
10 in_de de in
11 pp_de de seine ihre seine seine
12 pro_eo eo li ŝi ri ĝi
13 ao_esp es o a o o
14 a_esp es a
15 ae_esp es e a e e
16 e_fr fr e
17 hij_ze_nl nl hij ze hij hij
18 zijn_haar_nl nl zijn haar zijn zijn
19 ao_pl pl a o o
20 adj_pl pl y a e e
21 irreg_1_pl pl szedł eszła eszło eszło
22 irreg_2_pl pl ął ęła ęło ęło
23 irreg_3_pl pl
24 irreg_4_pl pl ógł ogła ogło ogło
25 irreg_5_pl pl ien na no no
26 ao_ptb pt o a o o
27 ao_rus ru а о о
28 refl_rus ru ся ась ось ось
29 adj_1_rus ru ый ая ое ое
30 adj_2_rus ru ен на но но
31 adj_3_rus ru ён на но но
32 irreg_1_rus ru ёл ла ло ло
33 irreg_2_rus ru ла ло ло
34 irreg_3_rus ru ёг егла егло егло
35 pron_rus ru него неё него него
36 ao_1_sr sr о ла ло ло
37 ao_2_sr sr ао ла ло ло
38 ao_3_sr sr ог у ог ог
39 adj_1_sr sr а о о
40 adj_2_sr sr ан на но но
41 adj_3_sr sr ар ра ро ро
42 pro_gr el τον την τον το
43 pro2_gr el Τον Την Τον Το
44 pro3_gr el στον στην στο στο
45 art_gr el Ο Η Το Το
46 pro4_gr el του της του του
47 pro_dk da han hun han det

View file

@ -1831,11 +1831,12 @@ OptionString "LanguageOptions"
"eng", "English (UK)"
"cs", "Česky (Czech)"
"de", "Deutsch (German)"
//"es", "Español (España) (Castilian Spanish)"
//"esm", "Español (Latino) (Latin American Spanish)"
//"eo", "Esperanto"
//"fi", "Suomi (Finnish)"
//"fr", "Français (French)"
"fr", "Français (French)"
//"it", "Italiano (Italian)"
//"jp", "日本語 (Japanese)"
//"ko", "한국어 (Korean)"
@ -1848,6 +1849,20 @@ OptionString "LanguageOptions"
//"sr", "Српски (Serbian)"
}
OptionString "LanguageOptionsDuke"
{
"auto", "Auto"
"default", "English (US)"
"eng", "English (UK)"
"cs", "Česky (Czech)"
"de", "Deutsch (German)"
"es", "Español (Spanish)"
"fr", "Français (French)"
"pl", "Polski (Polish)"
"pt", "Português do Brasil (Brazilian Portuguese)"
"ro", "Română (Romanian)"
}
OptionMenu "MiscOptions" protected
{
Title "$MISCMNU_TITLE"
@ -1875,7 +1890,14 @@ OptionMenu "MiscOptions" protected
Option "$MISCMNU_NINJA", "sw_ninjahack", "OnOff"
}
//StaticText " "
Option "$OPTMNU_LANGUAGE", "language", "LanguageOptions"
ifgame(Duke, Nam, WW2GI, Redneck, RedneckRides)
{
Option "$OPTMNU_LANGUAGE", "language", "LanguageOptionsDuke"
}
else
{
Option "$OPTMNU_LANGUAGE", "language", "LanguageOptions"
}
IfOption(Windows)
{
StaticText " "

Binary file not shown.

View file

@ -10,7 +10,7 @@ class DukeCactusBroke : DukeActor
{
self.cstat |= CSTAT_SPRITE_BLOCK_ALL;
self.clipdist = 8;
self.ChangeStat(STAT_ACTOR);
self.ChangeStat(STAT_DEFAULT);
}
}
@ -34,7 +34,7 @@ class DukeCactus : DukeCactusBroke
double vel = frandom(4, 8);
double zvel = -frandom(0, 16) - self.vel.Z * 0.25;
let spawned = dlevel.SpawnActor(self.sector, self.pos.plusZ(-48), "DukeScrap", -8, (0.75, 0.75), ang, vel, zvel, self);
let spawned = dlevel.SpawnActor(self.sector, self.pos.plusZ(-48), "DukeScrap", -8, (0.75, 0.75), ang, vel, zvel, self, STAT_MISC);
if (spawned)
{
spawned.spriteextra = DukeScrap.Scrap3 + random(0, 3);