Move SysNoHogDir to CGameArg

Move DXX_USE_SHAREPATH definition to apply to common files too, since
common files see CGameArg.
This commit is contained in:
Kp 2023-01-07 22:17:31 +00:00
parent 5ce4d49004
commit 704bde86bd
4 changed files with 13 additions and 12 deletions

View file

@ -4364,12 +4364,19 @@ class DXXCommon(LazyObjectConstructor):
CXXFLAGS = ['-funsigned-char'],
CPPPATH = ['common/include', 'common/main', '.'],
CPPFLAGS = SCons.Util.CLVar('-Wno-sign-compare'),
CPPDEFINES = [
# PhysFS 2.1 and later deprecate functions PHYSFS_read,
# PHYSFS_write, which Rebirth uses extensively. PhysFS 2.0
# does not implement the new non-deprecated functions.
# Disable the deprecation error until PhysFS 2.0 support is
# removed.
CPPDEFINES = [('PHYSFS_DEPRECATED', '')],
('PHYSFS_DEPRECATED', ''),
# Every file that sees `CGameArg` must know whether a sharepath
# exists. Most files do not need to know the value of
# sharepath. Pass only its existence, so that changing the
# sharepath does not needlessly rebuild those files.
('DXX_USE_SHAREPATH', int(not not user_settings.sharepath)),
],
)
add_flags = defaultdict(list)
if user_settings.builddir:
@ -5009,12 +5016,6 @@ class DXXProgram(DXXCommon):
self.env_CPPDEFINES,
# For PRIi64
('__STDC_FORMAT_MACROS',),
# Every file that sees `GameArg` must know whether a
# sharepath exists. Most files do not need to know the
# value of sharepath. Pass only its existence, so that
# changing the sharepath does not needlessly rebuild
# those files.
('DXX_USE_SHAREPATH', int(not not sharepath)),
],
CPPPATH = [os.path.join(self.srcdir, 'main')],
LIBS = ['m'],

View file

@ -118,6 +118,9 @@ struct CArg : prohibit_void_ptr<CArg>
bool DbgRenderStats;
uint8_t DbgBpp;
int8_t DbgVerbose;
#if DXX_USE_SHAREPATH
bool SysNoHogDir;
#endif
bool SysNoNiceFPS;
int SysMaxFPS;
uint16_t MplUdpHostPort;
@ -143,9 +146,6 @@ extern CArg CGameArg;
namespace dsx {
struct Arg : prohibit_void_ptr<Arg>
{
#if DXX_USE_SHAREPATH
bool SysNoHogDir;
#endif
#ifdef DXX_BUILD_DESCENT_I
bool EdiNoBm;
#endif

View file

@ -217,7 +217,7 @@ static void ReadCmdArgs(Inilist &ini, Arglist &Args)
* pass it via a cross-platform ini.
*/
#if DXX_USE_SHAREPATH
GameArg.SysNoHogDir = true;
CGameArg.SysNoHogDir = true;
#endif
}
else if (!d_stricmp(p, "-use_players_dir"))

View file

@ -218,7 +218,7 @@ bool PHYSFSX_init(int argc, char *argv[])
PHYSFS_mount(p, nullptr, 1);
}
#if DXX_USE_SHAREPATH
else if (!GameArg.SysNoHogDir)
else if (!CGameArg.SysNoHogDir)
{
con_puts(CON_DEBUG, "PHYSFS: append sharepath directory \"" DXX_SHAREPATH "\" to search path");
PHYSFS_mount(DXX_SHAREPATH, nullptr, 1);