Commit graph

220 commits

Author SHA1 Message Date
Kp a815541ef5 Fix check_header_includes=1 poison.h 2017-02-19 19:33:36 +00:00
Kp 171e87a1e7 Fix failure to unmap custom hogs 2016-12-17 18:39:18 +00:00
zico 78ad83a134 Fixed compile-time errors when using use_udp=0. Still some warnings but it builds. 2016-10-31 11:21:59 +01:00
Kp c006d068d8 Restructure PHYSFSX read helpers into template function 2016-10-17 03:49:31 +00:00
Kp 2d8928958d Fix some use_udp=0 build breaks
The build is still broken for use_udp=0.
2016-10-08 23:24:22 +00:00
Kp f24e9f836c Rename MAX_JOYSTICKS to DXX_MAX_JOYSTICKS
Rename symbol MAX_JOYSTICKS to DXX_MAX_JOYSTICKS to show that it is a DXX
symbol, not one inherited from a library.

git grep -lzw MAX_JOYSTICKS -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_JOYSTICKS\>/DXX_&/g'
2016-09-25 04:52:48 +00:00
Kp 62b58e9890 Move OGL to dxxsconf.h; rename to DXX_USE_OGL
Rename symbol OGL to DXX_USE_OGL to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -lzw OGL -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGL/\1 DXX_USE_OGL/' -e 's/\(\s*#\s*if\)ndef OGL/\1 !DXX_USE_OGL/' -e 's/\(\s*#\s*if !\?\)defined(OGL)/\1DXX_USE_OGL/'
2016-09-24 18:06:11 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp 435aa5a020 Move USE_UDP to dxxsconf.h; rename to DXX_USE_UDP
Rename symbol USE_UDP to DXX_USE_UDP to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -l USE_UDP -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(USE_UDP\)$/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(USE_UDP\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp 7c8c2b5aa4 Move USE_TRACKER to dxxsconf.h; rename to DXX_USE_TRACKER
Rename symbol USE_TRACKER to DXX_USE_TRACKER to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -l USE_TRACKER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_TRACKER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_TRACKER\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
Kp ddf888cd72 Move USE_SDLMIXER to dxxsconf.h; rename to DXX_USE_SDLMIXER
Rename symbol USE_SDLMIXER to DXX_USE_SDLMIXER to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct and
inferno.cpp were manual.

git grep -l USE_SDLMIXER -- '*.h' '*.cpp' | xargs sed -i -e 's/^#ifdef \(USE_SDLMIXER\)$/#if DXX_\1/' -e 's/#\(el\)\?if \(.*\)defined(\(USE_SDLMIXER\))/#\1if \2DXX_\3/'
2016-09-11 18:49:15 +00:00
zico 8e097e79f0 Fixed byte offset in string for SDL_DISABLE_LOCK_KEYS, putting the 1 in place of the 0 instead on the terminator. 2016-09-05 11:31:22 +02:00
zico 6c6a32ba92 Added patch by user 'beware' to remove dark edges around textures and added command-line/INI option to disable this patch if desired (nostalgia). Fixed misleading indentation in ogl.cpp along the way. 2016-08-29 17:07:30 +02:00
Kp a09dce6ead Remove char[N] overload for PHYSFSX_getRealPath 2016-08-06 19:55:25 +00:00
Kp b0821cff55 Fix inverted sense of -use_players_dir
Fixes: 4d483ca88f ("Simplify use of SysUsePlayersDir")
2016-07-22 02:25:17 +00:00
Kp 4d483ca88f Simplify use of SysUsePlayersDir 2016-07-21 01:43:22 +00:00
Kp 231223895d Rewrite simple pointer casts from C style to reinterpret_cast<>
This pass only targets commonly used standard types.

s/(\(\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\*\)\s*)\s*(/reinterpret_cast<\1>(/g
2016-06-05 01:04:26 +00:00
Kp 7fdce88558 Add parentheses around target of simple casts
C casts do not require parentheses.  C++ casts require grouping around
the target.  Prepare for conversion to C++ casts by adding otherwise
unnecessary parentheses around the target of simple C casts.

This pass does not attempt to process expressions that involve
any subexpression that can nest arbitrarily, such as parentheses or
brackets.  It also works only on commonly used standard types.

	(int) a->b;	// changed
	(int) a[b];	// not changed

s/\((\s*\(\(un\)\?signed\|int\|char\|short\|long\|float\|double\|s\?size_t\|\(u\?int[[:digit:]]\+_t\)\)\s*\**\s*)\s*\)\([&+-]\?\)\([[:alnum:]_.]\+\s*->\s*\)*\([[:alnum:]_.]\+\)\(\s*\([];+>)*\/^%,|&<>]\)\|$\|\(\s*-\s*[^>]\)\)/\1(\5\6\7)\8/g
2016-06-05 01:04:25 +00:00
Kp b31446340c Rewrite cast of (ubyte*) to standard type uint8_t
s/(\s*ubyte\s*\*\s*)/(uint8_t *)/g
2016-06-05 01:04:25 +00:00
Kp 0bba26fde5 Move ini.pop_back() into ReadIniArgs
Both callers of ReadIniArgs need the string removed afterward.  Prior to
8fb9a0f, only the parser for `-ini` needed the string removed.  The
caller for the automatic ini file ended and destroyed the container.  As
of 8fb9a0f, the container persists.  Leaving the string in the container
causes a bad error message if the command line is rejected.

It is bad form to have ReadIniArgs pop, but the caller push.  However,
the two callers use different signatures for emplace_back(), so unifying
the push would require calling a suboptimal emplace_back.  Choose the
lesser evil of unbalanced push/pop.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/198>
2016-05-31 00:42:56 +00:00
BuildTools 1de5f510ef Only break on spaes and tabs 2016-05-12 08:15:26 -05:00
BuildTools 8fb9a05f7d Break arguments on any whitespace. Also allow commandline arguments to
override ini arguments. Fixes #180.
2016-05-10 10:54:57 -05:00
Kp 195c589e3f Move file-local classes into anonymous namespace 2016-03-04 04:12:35 +00:00
Kp 217357711f Move some argument processing to dcx 2016-03-02 02:52:44 +00:00
Kp ff67afd440 Propagate partial_range up into PHYSFSX_findFiles family 2016-01-29 04:05:47 +00:00
Kp 92625ff2d0 Fix clang build of CGameArg
clang is confused by the use of a class named dcx.  Move the declaration
into a namespace{} block to avoid this.
2016-01-29 04:05:47 +00:00
Kp 86709f547b Fix capitalization of PHYSFS_File
Per comment in physfs.h, the spelling PHYSFS_file is deprecated.
Replace all instances with PHYSFS_File.
2016-01-09 16:38:14 +00:00
Kp 823ff63126 Move MplTrackerAddr to CArg 2015-12-24 04:01:29 +00:00
Kp 0b87ff267f Move MplTrackerPort to CArg 2015-12-24 04:01:29 +00:00
Kp 3f9f1f2b49 Move MplUdpMyPort to CArg 2015-12-24 04:01:29 +00:00
Kp 56e77d4fec Move MplUdpHostPort to CArg 2015-12-24 04:01:28 +00:00
Kp 0fb84b883f Move DbgAltTex to CArg 2015-12-24 04:01:28 +00:00
Kp b0e0f48058 Move DbgTexMap to CArg 2015-12-24 04:01:28 +00:00
Kp a91ef00a86 Move DbgNoCompressPigBitmap to CArg 2015-12-24 04:01:28 +00:00
Kp 834258fffa Move DbgNoDoubleBuffer to CArg 2015-12-24 04:01:28 +00:00
Kp 048615f95e Move DbgRenderStats to CArg 2015-12-24 04:01:28 +00:00
Kp 45a287f44b Move DbgNoRun to CArg 2015-12-24 04:01:28 +00:00
Kp ee98ef18f3 Move DbgSdlASyncBlit to CArg 2015-12-24 04:01:28 +00:00
Kp 94616f5e1c Move DbgSdlHWSurface to CArg 2015-12-24 04:01:27 +00:00
Kp 4f14be6056 Move MplUdpHostAddr to CArg 2015-12-24 04:01:27 +00:00
Kp 2c3f64478d Move OglSyncWait to CArg 2015-12-24 04:01:27 +00:00
Kp 9ec7e766cf Move OglSyncMethod to CArg 2015-12-24 04:01:27 +00:00
Kp d7c694b126 Move OglFixedFont to CArg 2015-12-24 04:01:27 +00:00
Kp 679e0adf3d Move SysAutoDemo to CArg 2015-12-24 04:01:27 +00:00
Kp cbd2cd7c54 Move SysNoTitles to CArg 2015-12-24 04:01:27 +00:00
Kp 948fa32f9c Move SysNoBorders to CArg 2015-12-24 04:01:27 +00:00
Kp 4ac7055928 Move SysWindow to CArg 2015-12-24 04:01:27 +00:00
Kp 2629b5b3d9 Move SysAutoRecordDemo to CArg 2015-12-24 04:01:27 +00:00
Kp 93f3162a41 Move SysLowMem to CArg 2015-12-24 04:01:26 +00:00
Kp 2b4447f927 Move SysUsePlayersDir to CArg 2015-12-24 04:01:26 +00:00
Kp 2cea05d0a7 Move SysRecordDemoNameTemplate to CArg 2015-12-24 04:01:26 +00:00
Kp 63cd2dbb6b Move SysPilot to CArg 2015-12-24 04:01:26 +00:00
Kp 584e2ce408 Move SysHogDir to CArg 2015-12-24 04:01:26 +00:00
Kp 9f1abe1910 Move SndNoMusic to CArg 2015-12-24 04:01:26 +00:00
Kp bb3a386b47 Move GfxSkipHiresFNT to CArg 2015-12-24 04:01:26 +00:00
Kp 23bb4c5826 Move SysNoNiceFPS to CArg 2015-12-24 04:01:26 +00:00
Kp 28ee4c1804 Move DbgUseOldTextureMerge to CArg 2015-12-18 04:08:24 +00:00
Kp 900bebe799 Move DbgGlRGBA2Ok to CArg 2015-12-18 04:08:24 +00:00
Kp fa17246b7b Move DbgGlLuminance4Alpha4Ok to CArg 2015-12-18 04:08:24 +00:00
Kp 7022d20b1e Move DbgGlGetTexLevelParamOk to CArg 2015-12-18 04:08:24 +00:00
Kp 4a280e4556 Move DbgGlReadPixelsOk to CArg 2015-12-18 04:08:24 +00:00
Kp b3e6dd3eb5 Move DbgGlIntensity4Ok to CArg 2015-12-18 04:08:23 +00:00
Kp cdae6cad4d Move DbgBpp to CArg 2015-12-18 04:08:23 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 8109379fdd Use inline namespace dsx for similar/misc/ 2015-12-13 18:00:48 +00:00
Kp b1ec69a3a2 Move CtlNoJoystick to CArg 2015-11-26 02:56:55 +00:00
Kp 7153ec69a9 Move SndNoSound to CGameArg 2015-11-24 04:05:36 +00:00
Kp a579f75d05 Move SndDisableSdlMixer to CGameArg 2015-11-24 04:05:36 +00:00
Kp ed2fa6f76a Remove unused PHYSFSX_getFreeDiskSpace 2015-11-24 04:05:35 +00:00
Kp e33f7f751b Move SysShowCmdHelp to CGameArg
Both games support SysShowCmdHelp.  Move it to the common structure.
2015-11-24 04:05:35 +00:00
Kp d4511b3128 Move SysNoHogDir to CGameArg
Both games support SysNoHogDir.  Move it to the common structure.
2015-11-24 04:05:35 +00:00
Kp 9981dc622e Move SysMissionDir to CGameArg
Both games support SysMissionDir.  Move it to the common structure.
2015-11-24 04:05:35 +00:00
Kp 64dee5d52a Move SysMaxFPS to CGameArg
Both games support SysMaxFPS.  Move it to the common structure.
2015-11-24 04:05:35 +00:00
Kp 5def3b0733 Fix Valgrind warning in PHYSFSX init 2015-10-24 03:13:11 +00:00
Kp 21057db809 Move DbgSafelog, DbgVerbose to CArg 2015-10-18 21:01:21 +00:00
Kp 7b28dc7110 Remove PHYSFSX_getRealPath assert(*stdPath!='/')
If the user configures the jukebox to play music from outside the
virtual directory, then stdPath can be absolute.
2015-10-18 21:01:19 +00:00
Kp 03b57abff0 Add $D*X_REBIRTH_HOME and $REBIRTH_HOME to override default path
Previously, Rebirth on __unix__ always set the write directory to
"~/.d*x-rebirth" (or "~/Library/Preferences/D*X Rebirth/" on Mac).  Add
$D*X_REBIRTH_HOME and $REBIRTH_HOME to override it.  If
$D*X_REBIRTH_HOME is set, use that.  If not, then try $REBIRTH_HOME.  If
that is also unset, then use the hardcoded default.
2015-10-18 00:34:00 +00:00
Kp a0919bf345 Add support for -add-missions-dir 2015-10-11 22:21:00 +00:00
Kp 02754f9ada Reduce PHYSFSX_getRealPath length checks 2015-10-11 22:21:00 +00:00
Kp a37bae4b4f Track output size for PHYSFSX_getRealPath 2015-10-11 22:21:00 +00:00
Kp 927618e650 Remove useless PHYSFS_eof tests
Each test triggers a system seek call.  EOF will be signalled by
PHYSFSX_fgets returning nullptr.
2015-10-09 02:46:11 +00:00
Kp a4826a2f75 Defer PHYSFS_tell in PHYSFSX_fgets 2015-10-09 02:46:11 +00:00
Kp 29f79f0a6b Enable -notitles for Descent 2 2015-10-09 02:46:09 +00:00
Kp da4d1e0670 Remove bool SysNoHogDir on non-unix 2015-09-22 02:28:38 +00:00
Kp 80f47ec7d9 Cache PHYSFS writedir/separator 2015-09-22 02:28:38 +00:00
Kp 204b608fa6 Normalize MACH&&APPLE vs APPLE&&MACH 2015-09-13 20:23:05 +00:00
Kp be3ab3bd81 Use range_for in PHYSFSX_checkMatchingExtension 2015-08-14 03:02:04 +00:00
Kp fa9f2e626d Move DbgShowMemInfo to CArg
Members of Arg are not visible to common code, so common/mem/mem.cpp
broke during the -Wodr cleanup.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/114>
Fixes: 6bd93e466f ("Guard args.h for LTO -Wodr")
2015-08-11 03:05:55 +00:00
Kp a58e8f87a0 Move similar/misc/hash.cpp -> common/misc/hash.cpp 2015-07-18 21:01:56 +00:00
Kp 6bd93e466f Guard args.h for LTO -Wodr 2015-07-18 21:01:56 +00:00
Kp 4c200342dd Use range_for for PHYSFS archive types 2015-07-18 21:01:55 +00:00
Kp 968cdbecf4 Add non-aborting UserError for user-caused fatal errors 2015-06-16 03:15:40 +00:00
Kp 29f239d6b1 Raise PHYSFSX_exists bool check to caller
All callers use a constant value, so raise the check into the caller to
let the optimizer delete the unnecessary branch.
2015-05-09 17:39:02 +00:00
Kp fc4b686d9d Store PHYSFS_list element count in list when needed 2015-05-09 17:38:57 +00:00
Kp c3925353fd Use null_sentinel_iterator for PHYSFS_list_t 2015-04-26 20:15:51 +00:00
Kp 143c536c77 Use PHYSFS_list_t for more functions 2015-04-26 20:15:50 +00:00
Kp 84c638ed64 Move PHYSFS_list_t to separate header 2015-04-19 04:18:49 +00:00
derhass 639b569496 Merge branch 'unification/master' into unification/syncgl_v2
Conflicts:
	similar/arch/ogl/gr.cpp
	similar/misc/args.cpp
2015-03-23 20:18:17 +01:00
Kp 7bf49fe551 Fix clang -Wmissing-braces warnings 2015-03-22 18:49:21 +00:00