From 1c99e0917ec9028ca172cb9c8b524f4aec7d349a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 12:24:12 +0200 Subject: [PATCH 1/9] - do not treat the ':' as a path separator. The cases where it really is needed have special handling for it, in all others it causes more problems than it solves. --- src/common/utility/cmdlib.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/utility/cmdlib.cpp b/src/common/utility/cmdlib.cpp index 3e108492d..dac58292a 100644 --- a/src/common/utility/cmdlib.cpp +++ b/src/common/utility/cmdlib.cpp @@ -73,7 +73,7 @@ static inline bool IsSeperator (int c) if (c == '/') return true; #ifdef _WIN32 - if (c == '\\' || c == ':') + if (c == '\\') return true; #endif return false; From 14ce0f4605fb46938fe79c273c12b9725f9cd14e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 12:37:50 +0200 Subject: [PATCH 2/9] - deleted unused variable. --- src/menu/loadsavemenu.cpp | 2 -- src/menu/menu.h | 1 - 2 files changed, 3 deletions(-) diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 6811ef4b8..25bc4b16b 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -504,7 +504,6 @@ unsigned FSavegameManager::ExtractSaveData(int index) { delete SavePic; SavePic = nullptr; - SavePicData.Clear(); } } } @@ -536,7 +535,6 @@ void FSavegameManager::UnloadSaveData() SaveCommentString = ""; SavePic = nullptr; - SavePicData.Clear(); } DEFINE_ACTION_FUNCTION(FSavegameManager, UnloadSaveData) diff --git a/src/menu/menu.h b/src/menu/menu.h index 98fd2addb..ce17a188b 100644 --- a/src/menu/menu.h +++ b/src/menu/menu.h @@ -72,7 +72,6 @@ private: FSaveGameNode NewSaveNode; int LastSaved = -1; int LastAccessed = -1; - TArray SavePicData; FTexture *SavePic = nullptr; public: From 6dfc416b515f51bd12481f90e7474b862ec4855b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:04:29 +0200 Subject: [PATCH 3/9] - fixed setup of IPK3's where all content is in a subdirectory. These never received the file name list that was needed to eliminate this directory from internal paths. --- src/d_iwad.cpp | 10 +++++++++- src/d_main.cpp | 16 ++++++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index b9a8ae5d0..9b9cb7f7d 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -263,6 +263,8 @@ void FIWadManager::ParseIWadInfo(const char *fn, const char *data, int datasize, // 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) { @@ -352,7 +354,13 @@ int FIWadManager::CheckIWADInfo(const char* fn) { 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 filenames; + filenames.Push(fn); + check.InitMultipleFiles(filenames, true, &lfi); if (check.GetNumEntries() > 0) { int num = check.CheckNumForName("IWADINFO"); diff --git a/src/d_main.cpp b/src/d_main.cpp index 70a95aa05..163c9824f 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -184,6 +184,9 @@ extern bool M_DemoNoPlay; // [RH] if true, then skip any demos in the loop extern bool insave; extern TDeletingArray 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) { @@ -1850,8 +1853,12 @@ static FString CheckGameInfo(TArray & pwads) { 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. - check.InitMultipleFiles(pwads, true); + check.InitMultipleFiles(pwads, true, &lfi); if (check.GetNumEntries() > 0) { int num = check.CheckNumForName("GAMEINFO"); @@ -2989,11 +2996,8 @@ static int D_DoomMain_Internal (void) } 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 : folders) lfi.reservedFolders.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); + for (auto p : iwad_folders) lfi.reservedFolders.Push(p); + for (auto p : iwad_reserved) lfi.requiredPrefixes.Push(p); lfi.postprocessFunc = [&]() { From 90f3b49bc3aaff91f756cccf19dd05b6d59a7185 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:17:20 +0200 Subject: [PATCH 4/9] - removed the "no IWAD definitions found" error message because the condition it checks for is not an error. --- src/d_iwad.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index 9b9cb7f7d..a4876ac10 100644 --- a/src/d_iwad.cpp +++ b/src/d_iwad.cpp @@ -283,10 +283,6 @@ FIWadManager::FIWadManager(const char *firstfn, const char *optfn) ParseIWadInfo("IWADINFO", (const char*)data.Data(), data.Size()); } } - if (mIWadNames.Size() == 0 || mIWadInfos.Size() == 0) - { - I_FatalError("No IWAD definitions found"); - } } From 5228a67ff584929c8f7a3a65ba0838335ae6744b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:23:02 +0200 Subject: [PATCH 5/9] - fixed keybinding reader - before trying to load DEFBINDS the lump index wasn't reset. --- src/common/console/c_bind.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/console/c_bind.cpp b/src/common/console/c_bind.cpp index f4802b1e5..609f2bf86 100644 --- a/src/common/console/c_bind.cpp +++ b/src/common/console/c_bind.cpp @@ -720,6 +720,7 @@ void C_SetDefaultKeys(const char* baseconfig) ReadBindings(lump, true); } + lastlump = 0; while ((lump = fileSystem.FindLump("DEFBINDS", &lastlump)) != -1) { ReadBindings(lump, false); From e63871d6f5625181c265c770f9dd2205ea05d6d1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:40:21 +0200 Subject: [PATCH 6/9] - made 3D floor damage transfers optional by adding a new flag bit (2048) and made that mode automatic for the old ZDoom-based light only transfer special. --- src/maploader/specials.cpp | 5 +++-- src/playsim/p_3dfloors.cpp | 5 +++-- src/playsim/p_3dfloors.h | 2 +- wadsrc/static/zscript/mapdata.zs | 3 ++- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/maploader/specials.cpp b/src/maploader/specials.cpp index 64f3ea7b8..240b0818b 100644 --- a/src/maploader/specials.cpp +++ b/src/maploader/specials.cpp @@ -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 ((param2 & 128) && !(flags & FF_SOLID)) flags |= FF_FLOOD | FF_SEETHROUGH | FF_SHOOTTHROUGH; 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); if (!tex.Exists() && alpha < 255) { @@ -970,7 +971,7 @@ int MapLoader::Set3DFloor(line_t * line, int param, int param2, int alpha) 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) { diff --git a/src/playsim/p_3dfloors.cpp b/src/playsim/p_3dfloors.cpp index 7d7c60889..ece17634b 100644 --- a/src/playsim/p_3dfloors.cpp +++ b/src/playsim/p_3dfloors.cpp @@ -217,10 +217,11 @@ void P_PlayerOnSpecial3DFloor(player_t* player) // Player must be on top of the floor to be affected... if(player->mo->Z() != rover->top.plane->ZatPoint(player->mo)) continue; } - else + else { //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)) continue; } diff --git a/src/playsim/p_3dfloors.h b/src/playsim/p_3dfloors.h index f0b1e87fd..05d222137 100644 --- a/src/playsim/p_3dfloors.h +++ b/src/playsim/p_3dfloors.h @@ -23,7 +23,7 @@ typedef enum FF_UPPERTEXTURE = 0x20000, FF_LOWERTEXTURE = 0x40000, 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_INVERTSECTOR = 0x400000, // swap meaning of sector planes FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap diff --git a/wadsrc/static/zscript/mapdata.zs b/wadsrc/static/zscript/mapdata.zs index 1ac5f12de..b681711d4 100644 --- a/wadsrc/static/zscript/mapdata.zs +++ b/wadsrc/static/zscript/mapdata.zs @@ -234,7 +234,8 @@ struct F3DFloor native play FF_UPPERTEXTURE = 0x20000, FF_LOWERTEXTURE = 0x40000, 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_INVERTSECTOR = 0x400000, // swap meaning of sector planes FF_DYNAMIC = 0x800000, // created by partitioning another 3D-floor due to overlap From a21d3ae106749d161d04f5c8fdd88493d01ce498 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:46:00 +0200 Subject: [PATCH 7/9] - fixed incorrect value range for particle's depth value, used for sorting. --- src/rendering/hwrenderer/scene/hw_sprites.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index 151615935..5ad839616 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -1222,7 +1222,7 @@ void HWSprite::ProcessParticle (HWDrawInfo *di, particle_t *particle, sector_t * z1=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; this->particle=particle; From db6a2842535e76a8162b8b084ffcf690a959f610 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 13:49:10 +0200 Subject: [PATCH 8/9] - apply aspect ratio compensation for all fullscreen images with a height of 200 and 400, and not just to 320x200 and 640x400. --- src/common/2d/v_draw.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/2d/v_draw.cpp b/src/common/2d/v_draw.cpp index a70d47e5f..87600541c 100644 --- a/src/common/2d/v_draw.cpp +++ b/src/common/2d/v_draw.cpp @@ -390,7 +390,9 @@ bool SetTextureParms(F2DDrawer * drawer, DrawParms *parms, FTexture *img, double double srcwidth = img->GetDisplayWidthDouble(); double srcheight = img->GetDisplayHeightDouble(); 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->keepratio = true; auto screenratio = ActiveRatio(GetWidth(), GetHeight()); From 052172b9ee0bc48800c4b08cde843bd7ac2f647e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 19 Apr 2020 18:00:27 +0200 Subject: [PATCH 9/9] - let TeleportSpecial universally map to Teleport when checking action special names. --- src/playsim/p_lnspec.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/playsim/p_lnspec.cpp b/src/playsim/p_lnspec.cpp index 5a3a67996..121e3402c 100644 --- a/src/playsim/p_lnspec.cpp +++ b/src/playsim/p_lnspec.cpp @@ -3911,6 +3911,13 @@ int P_FindLineSpecial (const char *string, int *min_args, int *max_args) 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; }