Commit graph

8623 commits

Author SHA1 Message Date
Kp 69eec0d71f Save some editor gadget pointers 2016-09-24 18:06:11 +00:00
Kp 8585bd7d7c Change LazyObjectConstructor to nested comprehension 2016-09-24 18:06:11 +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 3544ea097d Move OGLES to dxxsconf.h; rename to DXX_USE_OGLES
Rename symbol OGLES to DXX_USE_OGLES 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 OGLES -- '*.h' '*.cpp' | xargs -0 sed -i -e 's/\(\s*#\s*if\)def\s*OGLES/\1 DXX_USE_OGLES/' -e 's/\(\s*#\s*if\)ndef OGLES/\1 !DXX_USE_OGLES/'
2016-09-24 18:06:11 +00:00
Kp 7a13d3f228 Include dxxsconf.h explicitly and earlier 2016-09-24 18:06:10 +00:00
Kp 9ef9bd2445 Fix SConstruct pcall cache bug
Caching pcall as a default argument interfered with hotpatching pcall to
become an appropriate implementation after testing for the presence of
git.
2016-09-24 18:06:10 +00:00
Chris Taylor e7bb902d35 Allow frameworks and libraries to be packaged into the DXX-Rebirth app bundle for Mac OS X (under Contents/Frameworks).
Previously this could be achieved by setting the install path to @executable_path/../Frameworks/<path to framework> for each framework or library, but for Mac OS X 10.5 onwards, these frameworks (namely SDL and SDL_mixer) are set by default to install to @rpath for greater flexibility. @rpath is then set by the binary, in this case DXX-Rebirth to @loader_path/../Frameworks via SCons.

On Mac OS X it is common practice to distribute applications with any frameworks or libraries specific to that application within the application bundle.
2016-09-20 15:18:50 +08:00
zico 1e6a5ec528 Addition for 6c6a32ba92, allowing edge padding for overlaying level textures, disabling it for base textures. This isn't needed and improves visual appearence of base textures with transparency (fuelcenters, forcefields, grates, etc) when texture filtering is enabled. 2016-09-17 18:26:59 +02:00
zico 1f144f167c Addition for 6c6a32ba92, allowing edge padding for level and polymodel texturees only but disable it for sprites, fonts, hud images, etc. as those looked bad with this form of color bleeding in combination with various texture filtering mechanics. 2016-09-17 15:56:43 +02:00
Kp 94cc8c4d78 Blacklist -Wold-style-cast on buggy clang versions
clang on OS X incorrectly diagnoses mistakes in Apple system headers
even when -Wsystem-headers is not specified.  Move -Wold-style-cast from
the forced CXXFLAGS section to an SConf test that includes one of the
deficient headers.  This should cause SConf to declare OS X clang as
unable to use -Wold-style-cast, which is necessary to avoid spurious
failures when including Apple headers that use old style casts.
2016-09-15 01:50:56 +00:00
Kp 8180fc34e8 Merge branch 'locale_header_directive' into unification/master
`std::use_facet` is provided by `<locale>`.  x86_64-pc-linux-gnu happens
to provide `std::use_facet` in inferno.cpp without explicitly including
`<locale>`.  kreator found that clang on OS X does not implicitly
provide `<locale>`.  `<locale>` must be included to make
`std::use_facet` available on OS X.  Although it worked without this on
Linux, it is the right thing to do everywhere.
2016-09-15 01:50:56 +00:00
Kp 0bff113335 Fix triangle rendering problem
Unlike many uses of index_sequence<N...>, this set of N... is not the
result of make_tree_index_sequence.  Some callers pass sequences with
`Nn != n` for some n, so vp is not initialized as a copy of all elements
of ovp in the same order as ovp.

Fixes: fa5475aa54 ("Remove unnecessary copy of vertex points")
2016-09-14 01:59:33 +00:00
Kp 2ccb4e7066 Fix SCons OS X get_platform_objects build error 2016-09-14 01:59:32 +00:00
kreatordxx b39cdac1fd Add include directive for <locale>
Add include directive for <locale>, fixing four compiler errors on Apple Clang.
2016-09-13 19:34:32 +08:00
Kp f11235147a Work around clang crash bug
clang crashes with a segmentation fault if asked to implicitly convert
1u to std::size_t in partial_range inline chain.  Add a conversion
outside the inline chain, which seems to avoid the bug.
2016-09-11 18:49:17 +00:00
Kp 9a8bd1aecb Add disabled tests for curl/jsoncpp
The legacy UDP tracker does not need either curl or jsoncpp.
The new HTTP tracker requires both.  Add tests for both, guarded by
`use_tracker`.  Force `use_tracker` to False for now.  When the HTTP
tracker is made active, remove the assignment so that use_tracker=1 will
enable the new tests.
2016-09-11 18:49:16 +00:00
Kp a578c48c53 Add kreator's elaborations to Mac OS X install instructions
Kreator suggested some additional guidance for OS X users who want to
compile Rebirth from source.  This commit is based strongly on his text,
with light editing from me for markdown rules and consistency with other
parts of the document.

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/215>
Patch-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/files/465803/mac_tools_doc.patch.txt>
2016-09-11 18:49:16 +00:00
Kp cf0cc3b85b Remove GOG reference from INSTALL.markdown
GOG ceased selling Descent data at the end of 2015 due to licensing
issues.  Remove the reference to their game page.
2016-09-11 18:49:16 +00:00
Kp be691aba0b Move git extra version from DXXProgram to Git 2016-09-11 18:49:16 +00:00
Kp 72e9ed319c Rename VERSION to DXX_VERSION_STR
Rename symbol VERSION to DXX_VERSION_STR to show that it is a DXX
symbol, not one inherited from a library.
2016-09-11 18:49:16 +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 0015b4282c Move IPv6 to dxxsconf.h; rename to DXX_USE_IPv6
Rename symbol IPv6 to DXX_USE_IPv6 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 IPv6 -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(IPv6\)$/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(IPv6\))/#\1if \2DXX_USE_\3/'
2016-09-11 18:49:15 +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
Kp 0249358ccc Fold render_face flashing light tests 2016-09-11 18:49:15 +00:00
Kp 2952857461 Unify calculating green/blue when control_center_destroyed 2016-09-11 18:49:14 +00:00
Kp 4ed4ceece6 Cache references to array elements in render_face
Make the code easier to read by assuring the reader that each array
is always accessed at exactly one index per pass of the loop.
2016-09-11 18:49:14 +00:00
Kp 090852d6cd Defer initializing dyn_light in render_face
Cloaked faces do not require dyn_light.  Defer it to a later loop that
covers the same extents.
2016-09-11 18:49:14 +00:00
Kp 1f1be05d10 Simplify bm2 initialization in render_face 2016-09-11 18:49:14 +00:00
Kp fa5475aa54 Remove unnecessary copy of vertex points 2016-09-11 18:49:14 +00:00
Kp baa8831bce Test whether compiler handles -Wuseless-cast
clang does not understand -Wuseless-cast.  Passing -Wuseless-cast to
clang causes clang to fail the compile.  Resolve this by adding an SConf
test for -Wuseless-cast instead of adding it unconditionally.  It cannot
be put in the compiler preferred options tuple since it must be set
before the test for whether casting a ptrdiff to int is useless.
2016-09-11 18:49:14 +00:00
Kp 8e3a07f99d Remove laser.cpp inclusion of unused header reverse.h 2016-09-11 18:49:14 +00:00
Kp f8872f59a7 Expand single-use typedef in place 2016-09-11 18:49:13 +00:00
Kp 4864f533cf Pass object_base &to fly_init 2016-09-11 18:49:13 +00:00
Kp 198b068da6 Expand get_local_player_energy
It was a convenient transition macro, but its presence was always
intended to be temporary.  Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
2016-09-11 18:49:13 +00:00
Kp 02e1babe28 Convert loadgl.h dll_GetSymbol calls to reinterpret_cast
s/(\(\w\+\))\(dll_Get.*\);/reinterpret_cast<\1>(\2);/
2016-09-09 01:35:43 +00:00
Kp 211be472b8 Convert loadgl.h DLL wrappers to C++ casts 2016-09-09 01:35:42 +00:00
Kp 8f9b9d7504 Unfold register_program comprehension
The folded form combined multiple targets into one, which is not the
desired result.

'''
unfolded
l=['gcc5,', 'mingw5,'] e='gcc5,' p=('gcc5', '')
l=['gcc5,', 'mingw5,'] e='mingw5,' p=('mingw5', '')
folded
l=['gcc5,', 'mingw5,'] e='mingw5,' p=('gcc5', '', 'mingw5', '')
'''

    import itertools
    l = ['gcc5,', 'mingw5,']
    print('unfolded')
    for e in l:
	    for p in itertools.product(*[v.split('+') for v in e.split(',')]):
		    print("l=%r e=%r p=%r" % (l, e, p))
    print('folded')
    for p in itertools.product(*[
		    v.split('+')    \
			    for e in l  \
			    for v in e.split(',')	\
	    ]):
	    print("l=%r e=%r p=%r" % (l, e, p))
2016-09-07 04:24:33 +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
Kp dee78671dc Enable -Wold-style-cast 2016-09-04 19:10:43 +00:00
Kp 3fc1441b3f Remove unused Win32 OpenGL indirections 2016-09-04 19:10:43 +00:00
Kp 6a8cc912e1 Switch hmp.cpp to use C++ casts 2016-09-04 19:10:43 +00:00
Kp 705bbff53a Remove bogus cast in Win32 MIDI get_event
Casting `&unsigned` to `(unsigned long *)` is wrong.  It happened to
work because these types are the same size on Windows and this code is
only used on Windows.  Remove the bogus cast and fix the function
prototype.
2016-09-04 19:10:43 +00:00
Kp 1e34dae94d Switch Win32 net_udp socket broadcast to C++ cast 2016-09-04 19:10:43 +00:00
Kp fcb0b4fa66 Replace SDL CD_INDRIVE with equivalent that uses C++ static_cast
<=gcc-5 with -Wold-style-cast warn when expansions of SDL macro
CD_INDRIVE produce an old style cast, even though the cast comes from a
system header.  Undefine it and define an equivalent that uses a C++
cast, so that uses do not provoke a warning.
2016-09-04 19:10:43 +00:00
Kp c7041a9b26 Use reinterpret_cast for digi magic value (void*)-1 2016-09-04 19:10:43 +00:00
Kp e06d8b33aa Reuse string_array_sort_func for file_sort_func
Both functions have the same implementation, so delete static
file_sort_func and use string_array_sort_func.
2016-09-04 19:10:43 +00:00
Kp 48dbd0333c Use static_cast for c_fp_tmap_scanline_per 2016-09-04 19:10:42 +00:00
Kp 4293227a54 Move strutil qsort comparator casts into function 2016-09-04 19:10:42 +00:00