mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-23 01:10:53 +00:00
Merge remote-tracking branch 'gzdoom/master' into newmaster202004
This commit is contained in:
commit
6291892ce6
17 changed files with 71 additions and 27 deletions
|
@ -390,7 +390,9 @@ bool SetTextureParms(F2DDrawer * drawer, DrawParms *parms, FTexture *img, double
|
||||||
double srcwidth = img->GetDisplayWidthDouble();
|
double srcwidth = img->GetDisplayWidthDouble();
|
||||||
double srcheight = img->GetDisplayHeightDouble();
|
double srcheight = img->GetDisplayHeightDouble();
|
||||||
int autoaspect = parms->fsscalemode;
|
int autoaspect = parms->fsscalemode;
|
||||||
aspect = autoaspect == 0 || (srcwidth == 320 && srcheight == 200) || (srcwidth == 640 && srcheight == 400)? 1.333 : srcwidth / srcheight;
|
if (srcheight == 200) aspect = srcwidth / 240.;
|
||||||
|
else if (srcheight == 400) aspect = srcwidth / 480;
|
||||||
|
else aspect = srcwidth / srcheight;
|
||||||
parms->x = parms->y = 0;
|
parms->x = parms->y = 0;
|
||||||
parms->keepratio = true;
|
parms->keepratio = true;
|
||||||
auto screenratio = ActiveRatio(GetWidth(), GetHeight());
|
auto screenratio = ActiveRatio(GetWidth(), GetHeight());
|
||||||
|
|
|
@ -720,6 +720,7 @@ void C_SetDefaultKeys(const char* baseconfig)
|
||||||
ReadBindings(lump, true);
|
ReadBindings(lump, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lastlump = 0;
|
||||||
while ((lump = fileSystem.FindLump("DEFBINDS", &lastlump)) != -1)
|
while ((lump = fileSystem.FindLump("DEFBINDS", &lastlump)) != -1)
|
||||||
{
|
{
|
||||||
ReadBindings(lump, false);
|
ReadBindings(lump, false);
|
||||||
|
|
|
@ -73,7 +73,7 @@ static inline bool IsSeperator (int c)
|
||||||
if (c == '/')
|
if (c == '/')
|
||||||
return true;
|
return true;
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
if (c == '\\' || c == ':')
|
if (c == '\\')
|
||||||
return true;
|
return true;
|
||||||
#endif
|
#endif
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -263,6 +263,8 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize,
|
||||||
// Look for IWAD definition lump
|
// Look for IWAD definition lump
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
extern const char* iwad_folders[13];
|
||||||
|
extern const char* iwad_reserved[12];
|
||||||
|
|
||||||
FIWadManager::FIWadManager(const char *firstfn, const char *optfn)
|
FIWadManager::FIWadManager(const char *firstfn, const char *optfn)
|
||||||
{
|
{
|
||||||
|
@ -281,10 +283,6 @@ FIWadManager::FIWadManager(const char *firstfn, const char *optfn)
|
||||||
ParseIWadInfo("IWADINFO", (const char*)data.Data(), data.Size());
|
ParseIWadInfo("IWADINFO", (const char*)data.Data(), data.Size());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (mIWadNames.Size() == 0 || mIWadInfos.Size() == 0)
|
|
||||||
{
|
|
||||||
I_FatalError("No IWAD definitions found");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -352,7 +350,13 @@ int FIWadManager::CheckIWADInfo(const char* fn)
|
||||||
{
|
{
|
||||||
FileSystem check;
|
FileSystem check;
|
||||||
|
|
||||||
check.InitSingleFile(fn, true);
|
LumpFilterInfo lfi;
|
||||||
|
for (auto p : iwad_folders) lfi.reservedFolders.Push(p);
|
||||||
|
for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p);
|
||||||
|
|
||||||
|
TArray<FString> filenames;
|
||||||
|
filenames.Push(fn);
|
||||||
|
check.InitMultipleFiles(filenames, true, &lfi);
|
||||||
if (check.GetNumEntries() > 0)
|
if (check.GetNumEntries() > 0)
|
||||||
{
|
{
|
||||||
int num = check.CheckNumForName("IWADINFO");
|
int num = check.CheckNumForName("IWADINFO");
|
||||||
|
@ -372,6 +376,9 @@ int FIWadManager::CheckIWADInfo(const char* fn)
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mOrderNames.Push(result.Name);
|
||||||
|
return mIWadInfos.Push(result);
|
||||||
}
|
}
|
||||||
catch (CRecoverableError & err)
|
catch (CRecoverableError & err)
|
||||||
{
|
{
|
||||||
|
|
|
@ -185,6 +185,9 @@ extern bool M_DemoNoPlay; // [RH] if true, then skip any demos in the loop
|
||||||
extern bool insave;
|
extern bool insave;
|
||||||
extern TDeletingArray<FLightDefaults *> LightDefaults;
|
extern TDeletingArray<FLightDefaults *> LightDefaults;
|
||||||
|
|
||||||
|
const char* iwad_folders[13] = { "flats/", "textures/", "hires/", "sprites/", "voxels/", "colormaps/", "acs/", "maps/", "voices/", "patches/", "graphics/", "sounds/", "music/" };
|
||||||
|
const char* iwad_reserved[12] = { "mapinfo", "zmapinfo", "gameinfo", "sndinfo", "sbarinfo", "menudef", "gldefs", "animdefs", "decorate", "zscript", "iwadinfo" "maps/" };
|
||||||
|
|
||||||
|
|
||||||
CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
|
CUSTOM_CVAR(Float, i_timescale, 1.0f, CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
|
@ -1854,8 +1857,12 @@ static FString CheckGameInfo(TArray<FString> & pwads)
|
||||||
{
|
{
|
||||||
FileSystem check;
|
FileSystem check;
|
||||||
|
|
||||||
|
LumpFilterInfo lfi;
|
||||||
|
for (auto p : iwad_folders) lfi.reservedFolders.Push(p);
|
||||||
|
for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p);
|
||||||
|
|
||||||
// Open the entire list as a temporary file system and look for a GAMEINFO lump. The last one will automatically win.
|
// Open the entire list as a temporary file system and look for a GAMEINFO lump. The last one will automatically win.
|
||||||
check.InitMultipleFiles(pwads, true);
|
check.InitMultipleFiles(pwads, true, &lfi);
|
||||||
if (check.GetNumEntries() > 0)
|
if (check.GetNumEntries() > 0)
|
||||||
{
|
{
|
||||||
int num = check.CheckNumForName("GAMEINFO");
|
int num = check.CheckNumForName("GAMEINFO");
|
||||||
|
@ -2993,11 +3000,8 @@ static int D_DoomMain_Internal (void)
|
||||||
}
|
}
|
||||||
lfi.gameTypeFilter.Push(FStringf("game-%s", GameTypeName()));
|
lfi.gameTypeFilter.Push(FStringf("game-%s", GameTypeName()));
|
||||||
|
|
||||||
static const char* folders[] = { "flats/", "textures/", "hires/", "sprites/", "voxels/", "colormaps/", "acs/", "maps/", "voices/", "patches/", "graphics/", "sounds/", "music/" };
|
for (auto p : iwad_folders) lfi.reservedFolders.Push(p);
|
||||||
for (auto p : folders) lfi.reservedFolders.Push(p);
|
for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p);
|
||||||
|
|
||||||
static const char* reserved[] = { "mapinfo", "zmapinfo", "gameinfo", "sndinfo", "sbarinfo", "menudef", "gldefs", "animdefs", "decorate", "zscript", "maps/" };
|
|
||||||
for (auto p : reserved) lfi.requiredPrefixes.Push(p);
|
|
||||||
|
|
||||||
lfi.postprocessFunc = [&]()
|
lfi.postprocessFunc = [&]()
|
||||||
{
|
{
|
||||||
|
|
|
@ -943,7 +943,8 @@ int MapLoader::Set3DFloor(line_t * line, int param, int param2, int alpha)
|
||||||
// if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough
|
// if flooding is used the floor must be non-solid and is automatically made shootthrough and seethrough
|
||||||
if ((param2 & 128) && !(flags & FF_SOLID)) flags |= FF_FLOOD | FF_SEETHROUGH | FF_SHOOTTHROUGH;
|
if ((param2 & 128) && !(flags & FF_SOLID)) flags |= FF_FLOOD | FF_SEETHROUGH | FF_SHOOTTHROUGH;
|
||||||
if (param2 & 512) flags |= FF_FADEWALLS;
|
if (param2 & 512) flags |= FF_FADEWALLS;
|
||||||
if (param2&1024) flags |= FF_RESET;
|
if (param2 & 1024) flags |= FF_RESET;
|
||||||
|
if (param2 & 2048) flags |= FF_NODAMAGE;
|
||||||
FTextureID tex = line->sidedef[0]->GetTexture(side_t::top);
|
FTextureID tex = line->sidedef[0]->GetTexture(side_t::top);
|
||||||
if (!tex.Exists() && alpha < 255)
|
if (!tex.Exists() && alpha < 255)
|
||||||
{
|
{
|
||||||
|
@ -970,7 +971,7 @@ int MapLoader::Set3DFloor(line_t * line, int param, int param2, int alpha)
|
||||||
|
|
||||||
void MapLoader::Spawn3DFloors ()
|
void MapLoader::Spawn3DFloors ()
|
||||||
{
|
{
|
||||||
static int flagvals[] = {512, 2+512, 512+1024};
|
static int flagvals[] = {512+2048, 2+512+2048, 512+1024+2048};
|
||||||
|
|
||||||
for (auto &line : Level->lines)
|
for (auto &line : Level->lines)
|
||||||
{
|
{
|
||||||
|
|
|
@ -504,7 +504,6 @@ unsigned FSavegameManager::ExtractSaveData(int index)
|
||||||
{
|
{
|
||||||
delete SavePic;
|
delete SavePic;
|
||||||
SavePic = nullptr;
|
SavePic = nullptr;
|
||||||
SavePicData.Clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -536,7 +535,6 @@ void FSavegameManager::UnloadSaveData()
|
||||||
|
|
||||||
SaveCommentString = "";
|
SaveCommentString = "";
|
||||||
SavePic = nullptr;
|
SavePic = nullptr;
|
||||||
SavePicData.Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION(FSavegameManager, UnloadSaveData)
|
DEFINE_ACTION_FUNCTION(FSavegameManager, UnloadSaveData)
|
||||||
|
|
|
@ -72,7 +72,6 @@ private:
|
||||||
FSaveGameNode NewSaveNode;
|
FSaveGameNode NewSaveNode;
|
||||||
int LastSaved = -1;
|
int LastSaved = -1;
|
||||||
int LastAccessed = -1;
|
int LastAccessed = -1;
|
||||||
TArray<char> SavePicData;
|
|
||||||
FTexture *SavePic = nullptr;
|
FTexture *SavePic = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -217,10 +217,11 @@ void P_PlayerOnSpecial3DFloor(player_t* player)
|
||||||
// Player must be on top of the floor to be affected...
|
// Player must be on top of the floor to be affected...
|
||||||
if(player->mo->Z() != rover->top.plane->ZatPoint(player->mo)) continue;
|
if(player->mo->Z() != rover->top.plane->ZatPoint(player->mo)) continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//Water and DEATH FOG!!! heh
|
//Water and DEATH FOG!!! heh
|
||||||
if (player->mo->Z() > rover->top.plane->ZatPoint(player->mo) ||
|
if ((rover->flags & FF_NODAMAGE) ||
|
||||||
|
player->mo->Z() > rover->top.plane->ZatPoint(player->mo) ||
|
||||||
player->mo->Top() < rover->bottom.plane->ZatPoint(player->mo))
|
player->mo->Top() < rover->bottom.plane->ZatPoint(player->mo))
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ typedef enum
|
||||||
FF_UPPERTEXTURE = 0x20000,
|
FF_UPPERTEXTURE = 0x20000,
|
||||||
FF_LOWERTEXTURE = 0x40000,
|
FF_LOWERTEXTURE = 0x40000,
|
||||||
FF_THINFLOOR = 0x80000, // EDGE
|
FF_THINFLOOR = 0x80000, // EDGE
|
||||||
FF_SCROLLY = 0x100000, // EDGE - not yet implemented!!!
|
FF_NODAMAGE = 0x100000, // no damage transfers
|
||||||
FF_FIX = 0x200000, // use floor of model sector as floor and floor of real sector as ceiling
|
FF_FIX = 0x200000, // use floor of model sector as floor and floor of real sector as ceiling
|
||||||
FF_INVERTSECTOR = 0x400000, // swap meaning of sector planes
|
FF_INVERTSECTOR = 0x400000, // swap meaning of sector planes
|
||||||
FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap
|
FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap
|
||||||
|
|
|
@ -3911,6 +3911,13 @@ int P_FindLineSpecial (const char *string, int *min_args, int *max_args)
|
||||||
max = mid - 1;
|
max = mid - 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Alias for ZScript. Check here to have universal support everywhere.
|
||||||
|
if (!stricmp(string, "TeleportSpecial"))
|
||||||
|
{
|
||||||
|
if (min_args != NULL) *min_args = 1;
|
||||||
|
if (max_args != NULL) *max_args = 3;
|
||||||
|
return Teleport;
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5000,9 +5000,12 @@ void StaticPointerSubstitution(AActor* old, AActor* notOld)
|
||||||
|
|
||||||
if (old == nullptr) return;
|
if (old == nullptr) return;
|
||||||
|
|
||||||
// This is only allowed to replace players. For everything else the results are undefined.
|
// This is only allowed to replace players or swap out morphed monsters
|
||||||
if (!old->IsKindOf(NAME_PlayerPawn) || (notOld != nullptr && !notOld->IsKindOf(NAME_PlayerPawn))) return;
|
if (!old->IsKindOf(NAME_PlayerPawn) || (notOld != nullptr && !notOld->IsKindOf(NAME_PlayerPawn)))
|
||||||
|
{
|
||||||
|
if (notOld == nullptr) return;
|
||||||
|
if (!old->IsKindOf(NAME_MorphedMonster) && !notOld->IsKindOf(NAME_MorphedMonster)) return;
|
||||||
|
}
|
||||||
// Go through all objects.
|
// Go through all objects.
|
||||||
i = 0; DObject* last = 0;
|
i = 0; DObject* last = 0;
|
||||||
for (probe = GC::Root; probe != NULL; probe = probe->ObjNext)
|
for (probe = GC::Root; probe != NULL; probe = probe->ObjNext)
|
||||||
|
|
|
@ -1230,7 +1230,7 @@ void HWSprite::ProcessParticle (HWDrawInfo *di, particle_t *particle, sector_t *
|
||||||
z1=z-scalefac;
|
z1=z-scalefac;
|
||||||
z2=z+scalefac;
|
z2=z+scalefac;
|
||||||
|
|
||||||
depth = FloatToFixed((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin);
|
depth = (float)((x - vp.Pos.X) * vp.TanCos + (y - vp.Pos.Y) * vp.TanSin);
|
||||||
|
|
||||||
actor=nullptr;
|
actor=nullptr;
|
||||||
this->particle=particle;
|
this->particle=particle;
|
||||||
|
|
|
@ -1614,6 +1614,22 @@ DEFINE_ACTION_FUNCTION_NATIVE(AActor, Substitute, StaticPointerSubstitution)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_NATIVE(_PlayerPawn, Substitute, StaticPointerSubstitution)
|
||||||
|
{
|
||||||
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
|
PARAM_OBJECT(replace, AActor);
|
||||||
|
StaticPointerSubstitution(self, replace);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
DEFINE_ACTION_FUNCTION_NATIVE(_MorphedMonster, Substitute, StaticPointerSubstitution)
|
||||||
|
{
|
||||||
|
PARAM_SELF_PROLOGUE(AActor);
|
||||||
|
PARAM_OBJECT(replace, AActor);
|
||||||
|
StaticPointerSubstitution(self, replace);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetSpawnableType, P_GetSpawnableType)
|
DEFINE_ACTION_FUNCTION_NATIVE(AActor, GetSpawnableType, P_GetSpawnableType)
|
||||||
{
|
{
|
||||||
PARAM_PROLOGUE;
|
PARAM_PROLOGUE;
|
||||||
|
|
|
@ -461,7 +461,7 @@ class Actor : Thinker native
|
||||||
virtual native void Die(Actor source, Actor inflictor, int dmgflags = 0, Name MeansOfDeath = 'none');
|
virtual native void Die(Actor source, Actor inflictor, int dmgflags = 0, Name MeansOfDeath = 'none');
|
||||||
virtual native bool Slam(Actor victim);
|
virtual native bool Slam(Actor victim);
|
||||||
virtual native void Touch(Actor toucher);
|
virtual native void Touch(Actor toucher);
|
||||||
native void Substitute(Actor replacement);
|
private native void Substitute(Actor replacement);
|
||||||
native ui void DisplayNameTag();
|
native ui void DisplayNameTag();
|
||||||
|
|
||||||
// Called by inventory items to see if this actor is capable of touching them.
|
// Called by inventory items to see if this actor is capable of touching them.
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
extend class PlayerPawn
|
extend class PlayerPawn
|
||||||
{
|
{
|
||||||
|
private native void Substitute(PlayerPawn replacement);
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// EndAllPowerupEffects
|
// EndAllPowerupEffects
|
||||||
|
@ -503,6 +505,8 @@ class MorphedMonster : Actor
|
||||||
+FLOORCLIP
|
+FLOORCLIP
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private native void Substitute(Actor replacement);
|
||||||
|
|
||||||
override void OnDestroy ()
|
override void OnDestroy ()
|
||||||
{
|
{
|
||||||
if (UnmorphedMe != NULL)
|
if (UnmorphedMe != NULL)
|
||||||
|
|
|
@ -234,7 +234,8 @@ struct F3DFloor native play
|
||||||
FF_UPPERTEXTURE = 0x20000,
|
FF_UPPERTEXTURE = 0x20000,
|
||||||
FF_LOWERTEXTURE = 0x40000,
|
FF_LOWERTEXTURE = 0x40000,
|
||||||
FF_THINFLOOR = 0x80000, // EDGE
|
FF_THINFLOOR = 0x80000, // EDGE
|
||||||
FF_SCROLLY = 0x100000, // EDGE - not yet implemented!!!
|
FF_SCROLLY = 0x100000, // old leftover definition
|
||||||
|
FF_NODAMAGE = 0x100000, // no damage transfers
|
||||||
FF_FIX = 0x200000, // use floor of model sector as floor and floor of real sector as ceiling
|
FF_FIX = 0x200000, // use floor of model sector as floor and floor of real sector as ceiling
|
||||||
FF_INVERTSECTOR = 0x400000, // swap meaning of sector planes
|
FF_INVERTSECTOR = 0x400000, // swap meaning of sector planes
|
||||||
FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap
|
FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap
|
||||||
|
|
Loading…
Reference in a new issue