diff --git a/src/common/2d/v_draw.cpp b/src/common/2d/v_draw.cpp index fc1708ef42..a85f1ac8a2 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, FGameTexture *img, do double srcwidth = img->GetDisplayWidth(); double srcheight = img->GetDisplayHeight(); 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()); diff --git a/src/common/console/c_bind.cpp b/src/common/console/c_bind.cpp index f4802b1e55..609f2bf862 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); diff --git a/src/common/utility/cmdlib.cpp b/src/common/utility/cmdlib.cpp index 3e108492d0..dac58292a9 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; diff --git a/src/d_iwad.cpp b/src/d_iwad.cpp index b9a8ae5d02..a4876ac107 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) { @@ -281,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"); - } } @@ -352,7 +350,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 11f514d8f5..1c95229517 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) { @@ -1847,8 +1850,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"); @@ -2957,11 +2964,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 = [&]() { diff --git a/src/maploader/specials.cpp b/src/maploader/specials.cpp index 64f3ea7b80..240b0818bf 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/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 6811ef4b8d..25bc4b16bd 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 ed224e9608..c913cd2f2d 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; FGameTexture *SavePic = nullptr; public: diff --git a/src/playsim/p_3dfloors.cpp b/src/playsim/p_3dfloors.cpp index 7d7c60889d..ece17634ba 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 f0b1e87fd9..05d222137e 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/src/playsim/p_lnspec.cpp b/src/playsim/p_lnspec.cpp index 5a3a67996e..121e3402c3 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; } diff --git a/src/rendering/hwrenderer/scene/hw_sprites.cpp b/src/rendering/hwrenderer/scene/hw_sprites.cpp index 44dee7c84d..388179b1a7 100644 --- a/src/rendering/hwrenderer/scene/hw_sprites.cpp +++ b/src/rendering/hwrenderer/scene/hw_sprites.cpp @@ -1251,7 +1251,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; diff --git a/wadsrc/static/zscript/mapdata.zs b/wadsrc/static/zscript/mapdata.zs index 1ac5f12ded..b681711d47 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