diff --git a/source/blood/CMakeLists.txt b/source/blood/CMakeLists.txt index 449e9ff4f..b57788221 100644 --- a/source/blood/CMakeLists.txt +++ b/source/blood/CMakeLists.txt @@ -29,7 +29,6 @@ set( PCH_SOURCES src/blood.cpp src/callback.cpp src/choke.cpp - src/config.cpp src/controls.cpp src/credits.cpp src/db.cpp @@ -39,7 +38,6 @@ set( PCH_SOURCES src/eventq.cpp src/fire.cpp src/fx.cpp - src/gamemenu.cpp src/gameutil.cpp src/gib.cpp src/globals.cpp diff --git a/source/blood/src/actor.cpp b/source/blood/src/actor.cpp index 266b6d07c..c4ee807b9 100644 --- a/source/blood/src/actor.cpp +++ b/source/blood/src/actor.cpp @@ -37,7 +37,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aiunicult.h" #include "blood.h" #include "callback.h" -#include "config.h" #include "db.h" #include "endgame.h" #include "eventq.h" diff --git a/source/blood/src/asound.cpp b/source/blood/src/asound.cpp index b78333743..18415020c 100644 --- a/source/blood/src/asound.cpp +++ b/source/blood/src/asound.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" //#include "blood.h" #include "view.h" -#include "config.h" +#include "globals.h" #include "db.h" #include "player.h" #include "sound.h" diff --git a/source/blood/src/blood.cpp b/source/blood/src/blood.cpp index 9369792ab..9dc6cc599 100644 --- a/source/blood/src/blood.cpp +++ b/source/blood/src/blood.cpp @@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "db.h" #include "blood.h" #include "choke.h" -#include "config.h" #include "controls.h" #include "credits.h" #include "demo.h" @@ -436,6 +435,21 @@ int gHealthTemp[kMaxPlayers]; vec3_t startpos; int16_t startang, startsectnum; +static void drawLoadingScreen(void) +{ + char buffer[80]; + if (gGameOptions.nGameType == 0) + { + if (gDemo.at1) + strcpy(buffer, GStrings("TXTB_LDEMO")); + else + strcpy(buffer, GStrings("TXTB_LLEVEL")); + } + else + strcpy(buffer, GStrings(FStringf("TXTB_NETGT%d", gGameOptions.nGameType))); + viewLoadingScreen(2049, buffer, levelGetTitle(), NULL); +} + void StartLevel(GAMEOPTIONS *gameOptions) { STAT_Update(0); diff --git a/source/blood/src/callback.cpp b/source/blood/src/callback.cpp index 14764f7fb..eaaf49c92 100644 --- a/source/blood/src/callback.cpp +++ b/source/blood/src/callback.cpp @@ -30,7 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "ai.h" #include "blood.h" #include "callback.h" -#include "config.h" #include "db.h" #include "dude.h" #include "eventq.h" diff --git a/source/blood/src/config.cpp b/source/blood/src/config.cpp deleted file mode 100644 index 37ed8a192..000000000 --- a/source/blood/src/config.cpp +++ /dev/null @@ -1,65 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 Nuke.YKT - -This file is part of NBlood. - -NBlood is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#include "ns.h" // Must come before everything else! - - -#include "baselayer.h" -#include "common_game.h" -#include "build.h" - -#include "baselayer.h" -#include "gamecontrol.h" -#include "blood.h" -#include "config.h" -#include "globals.h" -#include "screen.h" -#include "sound.h" -#include "view.h" - -// we load this in to get default button and key assignments -// as well as setting up function mappings - -BEGIN_BLD_NS - - -int32_t gTurnSpeed = 92; -int32_t gDetail = 4; -int32_t cl_weaponswitch; -int32_t gFollowMap = 1; -int32_t gOverlayMap = 0; -int32_t gRotateMap = 0; -int32_t gMessageCount = 4; -int32_t gMessageTime = 5; -int32_t gMessageFont = 0; -int32_t gMouseSensitivity; -bool gNoClip; -bool gInfiniteAmmo; -int32_t gDeliriumBlur = 1; - -////////// -int gWeaponsV10x; -///////// - - -END_BLD_NS diff --git a/source/blood/src/config.h b/source/blood/src/config.h deleted file mode 100644 index 73da3f754..000000000 --- a/source/blood/src/config.h +++ /dev/null @@ -1,53 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 Nuke.YKT - -This file is part of NBlood. - -NBlood is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#ifndef config_public_h_ -#define config_public_h_ - -#include "gamecvars.h" -#include "gamecontrol.h" - -BEGIN_BLD_NS - -#define MAXPLAYERNAME 16 - -extern int32_t gTurnSpeed; -extern int32_t gDetail; -extern int32_t gFollowMap; -extern int32_t gOverlayMap; -extern int32_t gRotateMap; -extern int32_t gMessageCount; -extern int32_t gMessageTime; -extern int32_t gMessageFont; -extern int32_t gMouseSensitivity; -extern bool gNoClip; -extern bool gInfiniteAmmo; -extern int32_t gDeliriumBlur; - -/////// -extern int gWeaponsV10x; -////// - -END_BLD_NS - -#endif diff --git a/source/blood/src/controls.cpp b/source/blood/src/controls.cpp index a564a6992..a50a35ae0 100644 --- a/source/blood/src/controls.cpp +++ b/source/blood/src/controls.cpp @@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "gamecontrol.h" #include "common_game.h" #include "blood.h" -#include "config.h" #include "controls.h" #include "globals.h" #include "levels.h" diff --git a/source/blood/src/credits.cpp b/source/blood/src/credits.cpp index 10dfaa3cd..07fa2acd1 100644 --- a/source/blood/src/credits.cpp +++ b/source/blood/src/credits.cpp @@ -28,7 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "SmackerDecoder.h" #include "common_game.h" #include "blood.h" -#include "config.h" #include "controls.h" #include "globals.h" #include "screen.h" diff --git a/source/blood/src/d_menu.cpp b/source/blood/src/d_menu.cpp index f6b95a863..6130ea67b 100644 --- a/source/blood/src/d_menu.cpp +++ b/source/blood/src/d_menu.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "common_game.h" #include "blood.h" -#include "config.h" #include "globals.h" #include "inifile.h" #include "levels.h" diff --git a/source/blood/src/fx.cpp b/source/blood/src/fx.cpp index 34a452669..b890d9fbf 100644 --- a/source/blood/src/fx.cpp +++ b/source/blood/src/fx.cpp @@ -29,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "actor.h" #include "blood.h" #include "callback.h" -#include "config.h" +#include "globals.h" #include "db.h" #include "eventq.h" #include "fx.h" diff --git a/source/blood/src/gamemenu.cpp b/source/blood/src/gamemenu.cpp deleted file mode 100644 index 8d9332391..000000000 --- a/source/blood/src/gamemenu.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//------------------------------------------------------------------------- -/* -Copyright (C) 2010-2019 EDuke32 developers and contributors -Copyright (C) 2019 Nuke.YKT - -This file is part of NBlood. - -NBlood is free software; you can redistribute it and/or -modify it under the terms of the GNU General Public License version 2 -as published by the Free Software Foundation. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - -See the GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. -*/ -//------------------------------------------------------------------------- - -#include "ns.h" // Must come before everything else! - -#include "build.h" -#include "compat.h" -#include "common_game.h" -#include "blood.h" -#include "config.h" -#include "globals.h" -#include "inifile.h" -#include "levels.h" -#include "qav.h" -#include "demo.h" -#include "view.h" -#include "c_bind.h" -#include "gstrings.h" - -BEGIN_BLD_NS - - -void drawLoadingScreen(void) -{ - char buffer[80]; - if (gGameOptions.nGameType == 0) - { - if (gDemo.at1) - strcpy(buffer, GStrings("TXTB_LDEMO")); - else - strcpy(buffer, GStrings("TXTB_LLEVEL")); - } - else - strcpy(buffer, GStrings(FStringf("TXTB_NETGT%d", gGameOptions.nGameType))); - viewLoadingScreen(2049, buffer, levelGetTitle(), NULL); -} - - -END_BLD_NS diff --git a/source/blood/src/gib.cpp b/source/blood/src/gib.cpp index 3812381cd..38ba0f0f6 100644 --- a/source/blood/src/gib.cpp +++ b/source/blood/src/gib.cpp @@ -31,7 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "blood.h" #include "db.h" #include "callback.h" -#include "config.h" +#include "globals.h" #include "eventq.h" #include "fx.h" #include "gib.h" diff --git a/source/blood/src/globals.cpp b/source/blood/src/globals.cpp index b2b96fcfe..83cf6df25 100644 --- a/source/blood/src/globals.cpp +++ b/source/blood/src/globals.cpp @@ -42,6 +42,20 @@ int gFrameRate; static const char *_module; static int _line; +int32_t gTurnSpeed = 92; +int32_t gDetail = 4; +int32_t gFollowMap = 1; +int32_t gOverlayMap = 0; +int32_t gRotateMap = 0; +bool gNoClip; +bool gInfiniteAmmo; +int32_t gDeliriumBlur = 1; + +////////// +int gWeaponsV10x; +///////// + + void _SetErrorLoc(const char *pzFile, int nLine) { _module = pzFile; diff --git a/source/blood/src/globals.h b/source/blood/src/globals.h index c58f04b77..8b604172d 100644 --- a/source/blood/src/globals.h +++ b/source/blood/src/globals.h @@ -25,6 +25,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "version.h" #include "filesystem.h" +#include "gamecvars.h" +#include "gamecontrol.h" BEGIN_BLD_NS @@ -35,4 +37,19 @@ extern int gFrame; extern int gFrameRate; extern bool bVanilla; +#define MAXPLAYERNAME 16 + +extern int32_t gTurnSpeed; +extern int32_t gDetail; +extern int32_t gFollowMap; +extern int32_t gOverlayMap; +extern int32_t gRotateMap; +extern bool gNoClip; +extern bool gInfiniteAmmo; +extern int32_t gDeliriumBlur; + +/////// +extern int gWeaponsV10x; +////// + END_BLD_NS diff --git a/source/blood/src/levels.cpp b/source/blood/src/levels.cpp index ea37c84d6..00b3518dc 100644 --- a/source/blood/src/levels.cpp +++ b/source/blood/src/levels.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "blood.h" -#include "config.h" +#include "globals.h" #include "credits.h" #include "endgame.h" #include "inifile.h" diff --git a/source/blood/src/loadsave.cpp b/source/blood/src/loadsave.cpp index f28c2e0e8..6697ecc8b 100644 --- a/source/blood/src/loadsave.cpp +++ b/source/blood/src/loadsave.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "mmulti.h" #include "common_game.h" -#include "config.h" #include "ai.h" #include "blood.h" #include "demo.h" diff --git a/source/blood/src/messages.cpp b/source/blood/src/messages.cpp index ec6c142ef..ea3c01b03 100644 --- a/source/blood/src/messages.cpp +++ b/source/blood/src/messages.cpp @@ -28,7 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "gamecontrol.h" #include "common_game.h" #include "blood.h" -#include "config.h" #include "demo.h" #include "eventq.h" #include "globals.h" diff --git a/source/blood/src/misc.h b/source/blood/src/misc.h index 822601f01..45f8e5860 100644 --- a/source/blood/src/misc.h +++ b/source/blood/src/misc.h @@ -35,7 +35,6 @@ void ChangeExtension(char *pzFile, const char *pzExt); void SplitPath(const char *pzPath, char *pzDirectory, char *pzFile, char *pzType); void FireInit(void); void FireProcess(void); -void drawLoadingScreen(void); void UpdateNetworkMenus(void); void InitMirrors(void); void sub_5571C(char mode); diff --git a/source/blood/src/network.cpp b/source/blood/src/network.cpp index bec668580..6f9320e83 100644 --- a/source/blood/src/network.cpp +++ b/source/blood/src/network.cpp @@ -29,7 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "mmulti.h" #include "pragmas.h" #include "compat.h" -#include "config.h" #include "controls.h" #include "globals.h" #include "network.h" diff --git a/source/blood/src/osdcmd.cpp b/source/blood/src/osdcmd.cpp index eaedc9a91..0c27ae14b 100644 --- a/source/blood/src/osdcmd.cpp +++ b/source/blood/src/osdcmd.cpp @@ -28,7 +28,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "mmulti.h" #include "common_game.h" -#include "config.h" #include "blood.h" #include "demo.h" #include "globals.h" @@ -49,20 +48,19 @@ static int osdcmd_map(CCmdFuncPtr parm) if (parm->numparms != 1) return CCMD_SHOWHELP; - char filename[BMAX_PATH]; + FString mapname = parm->parms[0]; + FString mapfilename = mapname; + DefaultExtension(mapfilename, ".map"); - strcpy(filename, parm->parms[0]); - ChangeExtension(filename, ""); - - if (!fileSystem.Lookup(filename, "MAP")) + if (!fileSystem.FindFile(mapfilename)) { - Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", filename); + Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapfilename); return CCMD_OK; } for (int i = 0; i < 512; i++) { - if (mapList[i].labelName.CompareNoCase(filename) == 0) + if (mapList[i].labelName.CompareNoCase(mapname) == 0) { int e = i / kMaxLevels; int m = i % kMaxLevels; @@ -75,7 +73,7 @@ static int osdcmd_map(CCmdFuncPtr parm) if (gDemo.at1) gDemo.StopPlayback(); - levelAddUserMap(filename); + levelAddUserMap(mapname); if (numplayers > 1) { diff --git a/source/blood/src/player.cpp b/source/blood/src/player.cpp index a9f7e1c24..e4cde9a92 100644 --- a/source/blood/src/player.cpp +++ b/source/blood/src/player.cpp @@ -30,7 +30,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "actor.h" #include "blood.h" #include "callback.h" -#include "config.h" #include "controls.h" #include "demo.h" #include "eventq.h" diff --git a/source/blood/src/player.h b/source/blood/src/player.h index 6d58b805a..3e5358a11 100644 --- a/source/blood/src/player.h +++ b/source/blood/src/player.h @@ -26,7 +26,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "common_game.h" #include "compat.h" -#include "config.h" +#include "globals.h" #include "controls.h" #include "db.h" #include "dude.h" diff --git a/source/blood/src/screen.cpp b/source/blood/src/screen.cpp index cd28738e8..59e3c9287 100644 --- a/source/blood/src/screen.cpp +++ b/source/blood/src/screen.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "globals.h" -#include "config.h" #include "screen.h" #include "v_video.h" diff --git a/source/blood/src/sfx.cpp b/source/blood/src/sfx.cpp index 69b1716bc..9a9c0f7d4 100644 --- a/source/blood/src/sfx.cpp +++ b/source/blood/src/sfx.cpp @@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "compat.h" #include "common_game.h" -#include "config.h" #include "gameutil.h" #include "player.h" #include "sound.h" diff --git a/source/blood/src/sound.cpp b/source/blood/src/sound.cpp index a97cbc01f..73b2acab0 100644 --- a/source/blood/src/sound.cpp +++ b/source/blood/src/sound.cpp @@ -25,12 +25,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "build.h" #include "compat.h" #include "common_game.h" -#include "config.h" #include "levels.h" #include "sound.h" #include "baselayer.h" #include "raze_music.h" #include "raze_sound.h" +#include "gamecontrol.h" BEGIN_BLD_NS diff --git a/source/blood/src/tile.cpp b/source/blood/src/tile.cpp index b8ea6870a..bb6f2a193 100644 --- a/source/blood/src/tile.cpp +++ b/source/blood/src/tile.cpp @@ -31,7 +31,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "common_game.h" #include "blood.h" -#include "config.h" #include "globals.h" #include "view.h" diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index c7c4ce261..e97c1f18f 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -34,7 +34,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "aistate.h" #include "blood.h" #include "choke.h" -#include "config.h" #include "db.h" #include "endgame.h" #include "gameutil.h" @@ -1834,15 +1833,10 @@ void viewInit(void) memset(data, TRANSPARENT_INDEX, kLensSize*kLensSize); gGameMessageMgr.SetState(hud_messages); gGameMessageMgr.SetCoordinates(1, 1); - char nFont; - if (gMessageFont == 0) - nFont = 3; - else - nFont = 0; - gGameMessageMgr.SetFont(nFont); - gGameMessageMgr.SetMaxMessages(gMessageCount); - gGameMessageMgr.SetMessageTime(gMessageTime); + gGameMessageMgr.SetFont(3); + gGameMessageMgr.SetMaxMessages(4); + gGameMessageMgr.SetMessageTime(5); for (int i = 0; i < 16; i++) { diff --git a/source/blood/src/weapon.cpp b/source/blood/src/weapon.cpp index 646c40cdd..8823c9f3c 100644 --- a/source/blood/src/weapon.cpp +++ b/source/blood/src/weapon.cpp @@ -33,7 +33,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "blood.h" #include "db.h" #include "callback.h" -#include "config.h" #include "eventq.h" #include "fx.h" #include "gameutil.h" diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index 0fdfcf4f6..83de9bbe9 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -1629,73 +1629,8 @@ static void PrintLastError () // //========================================================================== -FResourceLump *FileSystem::Lookup(const char *name, const char *type) -{ - FStringf fname("%s.%s", name, type); - auto lump = FindFile(fname); - if (lump >= 0) return FileInfo[lump].lump; - else return nullptr; -} - FResourceLump* FileSystem::GetFileAt(int no) { return FileInfo[no].lump; } -//========================================================================== -// -// Stand-ins for Blood's resource class -// -//========================================================================== - -const void *FileSystem::Lock(int lump) -{ - if ((size_t)lump >= FileInfo.Size()) return nullptr; - auto lumpp = FileInfo[lump].lump; - return lumpp->Lock(); -} - -void FileSystem::Unlock(int lump) -{ - if ((size_t)lump >= FileInfo.Size()) return; - auto lumpp = FileInfo[lump].lump; - lumpp->Unlock(); -} - -const void *FileSystem::Get(int lump) -{ - if ((size_t)lump >= FileInfo.Size()) return nullptr; - auto lumpp = FileInfo[lump].lump; - auto p = lumpp->Lock(); - lumpp->RefCount = INT_MAX/2; // lock forever. - return p; -} - -//========================================================================== -// -// Stand-ins for Blood's resource class -// -//========================================================================== - -const void *FileSystem::Lock(FResourceLump *lump) -{ - if (lump) return lump->Lock(); - else return nullptr; -} - -void FileSystem::Unlock(FResourceLump *lump) -{ - if (lump) lump->Unlock(); -} - -const void *FileSystem::Load(FResourceLump *lump) -{ - if (lump) - { - auto p = lump->Lock(); - lump->RefCount = INT_MAX/2; // lock forever. - return p; - } - else return nullptr; -} - diff --git a/source/common/filesystem/filesystem.h b/source/common/filesystem/filesystem.h index e8197258a..89cc288d3 100644 --- a/source/common/filesystem/filesystem.h +++ b/source/common/filesystem/filesystem.h @@ -187,19 +187,8 @@ public: int AddFromBuffer(const char* name, const char* type, char* data, int size, int id, int flags); FileReader* GetFileReader(int wadnum); // Gets a FileReader object to the entire WAD void InitHashChains(); - - // Blood stuff - FResourceLump* Lookup(const char* name, const char* type); - FResourceLump* GetFileAt(int no); - const void* Lock(int lump); - void Unlock(int lump); - const void* Get(int lump); - static const void* Lock(FResourceLump* lump); - static void Unlock(FResourceLump* lump); - static const void* Load(FResourceLump* lump);; - protected: struct LumpRecord; diff --git a/source/exhumed/src/osdcmds.cpp b/source/exhumed/src/osdcmds.cpp index c2e6e230b..4490c983c 100644 --- a/source/exhumed/src/osdcmds.cpp +++ b/source/exhumed/src/osdcmds.cpp @@ -68,10 +68,12 @@ static int osdcmd_map(CCmdFuncPtr parm) return CCMD_SHOWHELP; } FString mapname = parm->parms[0]; + FString mapfilename = mapname; + DefaultExtension(mapfilename, ".map"); - if (!fileSystem.Lookup(mapname, "MAP")) + if (!fileSystem.FindFile(mapfilename)) { - Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapname.GetChars()); + Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapfilename.GetChars()); return CCMD_OK; } diff --git a/source/games/duke/src/ccmds.cpp b/source/games/duke/src/ccmds.cpp index 9b7f53764..bf7879af3 100644 --- a/source/games/duke/src/ccmds.cpp +++ b/source/games/duke/src/ccmds.cpp @@ -90,8 +90,10 @@ static int ccmd_map(CCmdFuncPtr parm) return CCMD_SHOWHELP; } FString mapname = parm->parms[0]; + FString mapfilename = mapname; + DefaultExtension(mapfilename, ".map"); - if (!fileSystem.Lookup(mapname, "MAP")) + if (!fileSystem.FindFile(mapfilename)) { Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapname.GetChars()); return CCMD_OK; @@ -106,9 +108,8 @@ static int ccmd_map(CCmdFuncPtr parm) Printf(TEXTCOLOR_RED "Cannot use user maps in shareware.\n"); return CCMD_OK; } - DefaultExtension(mapname, ".map"); - if (mapname[0] != '/') mapname.Insert(0, "/"); - map = SetupUserMap(mapname, !isRR() ? "dethtoll.mid" : nullptr); + if (mapfilename[0] != '/') mapfilename.Insert(0, "/"); + map = SetupUserMap(mapfilename, !isRR() ? "dethtoll.mid" : nullptr); } if (numplayers > 1) { diff --git a/source/sw/src/osdcmds.cpp b/source/sw/src/osdcmds.cpp index c6e3be43b..c838ea2ca 100644 --- a/source/sw/src/osdcmds.cpp +++ b/source/sw/src/osdcmds.cpp @@ -61,10 +61,12 @@ static int osdcmd_map(CCmdFuncPtr parm) return CCMD_SHOWHELP; } FString mapname = parm->parms[0]; + FString mapfilename = mapname; + DefaultExtension(mapfilename, ".map"); - if (!fileSystem.Lookup(mapname, "MAP")) + if (!fileSystem.FindFile(mapfilename)) { - Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapname.GetChars()); + Printf(TEXTCOLOR_RED "map: file \"%s\" not found.\n", mapfilename.GetChars()); return CCMD_OK; }