Commit graph

8657 commits

Author SHA1 Message Date
Kp c029d47825 Pass player powerup_flags to move_around_player 2016-10-02 00:34:41 +00:00
Kp bb65d3ce97 Pass player powerup_flags to ai_fire_laser_at_player 2016-10-02 00:34:41 +00:00
Kp 8cfa1508b6 Pass player powerup_flags to escort_set_goal_object 2016-10-02 00:34:41 +00:00
Kp ae74c6c43a Pass reference segment number to choose_thief_recreation_segment 2016-10-02 00:34:41 +00:00
Kp 147af3d4f5 Use array<> for pick_connected_segment arrays 2016-10-02 00:34:41 +00:00
Kp e6e00debba Pass only segidx to pick_connected_segment
A full object is not necessary.
2016-10-02 00:34:41 +00:00
Kp a62cc369ab Expand get_local_player_shields
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-10-02 00:34:40 +00:00
Kp fe99fe232b Expand get_local_player_vulcan_ammo
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-10-02 00:34:40 +00:00
Kp ce65735c04 Expand get_local_player_flags
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-10-02 00:34:40 +00:00
Kp 1b321ac0c6 Expand get_local_player_secondary_ammo
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-10-02 00:34:40 +00:00
Kp b422db5500 Expand get_local_player_cloak_time
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-10-02 00:34:39 +00:00
Kp 194d258e59 Condense buddy key check 2016-10-02 00:34:39 +00:00
Kp f3865db4cb Use implicit range of vtrgptr 2016-10-02 00:34:39 +00:00
Kp 08f6653fcd Split check_builtin_constant_p override 2016-10-02 00:34:39 +00:00
Kp 1ab55f7551 Cast maybe_select_weapon_by_type input to weapon enum
All callers provide a value which must be a valid weapon number.  Cast
the result to a weapon enum so that called helpers can be converted to
expect an enum.
2016-10-02 00:34:39 +00:00
Kp a88153c7d9 Add prohibit_void_ptr to player_selected_weapon 2016-10-02 00:34:38 +00:00
Kp 437d1717d8 Combine automap add_one_edge flags 2016-09-30 01:49:57 +00:00
Kp cd4e5441ba Rename WORDS_BIGENDIAN to DXX_WORDS_BIGENDIAN
Rename symbol WORDS_BIGENDIAN to DXX_WORDS_BIGENDIAN to show that it is a DXX
symbol, not one inherited from a library.

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

git grep -wl WORDS_BIGENDIAN -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(WORDS_BIGENDIAN\)\>/#if DXX_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(WORDS_BIGENDIAN\))/#\1if \2DXX_\3/' -e 's/^\s*#ifndef \(WORDS_BIGENDIAN\)\>/#if !DXX_\1/'
2016-09-30 01:49:57 +00:00
Chris Taylor 1c819359a6 Add -O0 flags for the Debug and Editor builds in Xcode.
Add -O0 flags for the Debug and Editor builds in Xcode, setting optimisation to None so the Xcode debugger reports on all variables, steps through code correctly and otherwise can debug properly.
2016-09-28 11:18:46 +08:00
Kp 6efd304118 Merge branch 'button_pointers' into master 2016-09-28 02:09:25 +00:00
Kp 8d25cf4162 Define newmenu_item::*_specific_type::nm_type
The *_specific_type structures have a static member `nm_type`.  In -O0
builds, an out-of-line definition of this member is required, but was
not present.  In -O2 builds, the optimizer happened to remove all
references to the out-of-line definition, so the link succeeded despite
not having a definition.  Add that definition.
2016-09-28 01:56:12 +00:00
Chris Taylor dd1a6cc7b9 Save more unique_ptr's to UI_GADGET_BUTTON's
Save unique_ptr's to UI_GADGET_BUTTON's in similar/editor/med.cpp and similar/editor/medwall.cpp. Fixes compile errors and resolves a crash when attempting to access both dialogs' gadgets (input event processing is the first attempt).
2016-09-27 15:11:50 +08:00
Kp 10f4f87a36 Fix _g3_draw_poly declaration/definition inconsistency
_g3_draw_poly uses type cg3s_point which is const in OGL and non-const
in SDL.  gcc-6 with LTO reports a One Definition Rule violation for this
mismatch:

    typedef const int cint;
    void f(cint *);
    void f(const int *) {}

The code ran correctly as it was, but the fix is trivial and has no
effect on the generated code, so fix it to satisfy the compiler.
2016-09-26 00:50:09 +00:00
Kp 56e4f6b6f7 Factor out set_color_by_model_light color
Optimizing compilers tend to factor out color automatically.  Move it up
to the caller to ensure that it is computed once even if the compiler
does not optimize aggressively.
2016-09-26 00:50:09 +00:00
Kp cc2fd7071d Fold endlevel_render_mine g3_set_view_matrix call 2016-09-26 00:50:09 +00:00
Kp d0c3f03d54 Remove unnecessary nullptr test on nonnull parameter in select_file_recursive2
gcc-6 warns about this test because the caller is not permitted to pass
nullptr here, so the test is unnecessary.
2016-09-26 00:50:09 +00:00
Kp ef6f803200 Remove unnecessary nullptr test on nonnull parameter
gcc-6 warns about this test because the caller is not permitted to pass
nullptr here, so the test is unnecessary.
2016-09-26 00:50:09 +00:00
Kp bf7995ade2 Fold render call to g3_set_view_matrix
Remove support for JOHN_ZOOM.  It was present in the initial release,
but never activated.
2016-09-26 00:50:08 +00:00
Kp 9da6507e82 Remove test DXX_HAVE_CONSTEXPR_UNION_CONSTRUCTOR
Test DXX_HAVE_CONSTEXPR_UNION_CONSTRUCTOR probes for a bug present in
<=gcc-4.7.x.  Rebirth now rejects <=gcc-4.8.x for other reasons, so all
supported gcc versions pass test DXX_HAVE_CONSTEXPR_UNION_CONSTRUCTOR.
Remove the test.
2016-09-25 04:52:49 +00:00
Kp 4894117d70 Rename MAX_HATS_PER_JOYSTICK to DXX_MAX_HATS_PER_JOYSTICK
Rename symbol MAX_HATS_PER_JOYSTICK to DXX_MAX_HATS_PER_JOYSTICK
to show that it is a DXX symbol, not one inherited from a library.

git grep -lzw MAX_HATS_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_HATS_PER_JOYSTICK\>/DXX_&/g'
2016-09-25 04:52:49 +00:00
Kp 94937de128 Rename MAX_BUTTONS_PER_JOYSTICK to DXX_MAX_BUTTONS_PER_JOYSTICK
Rename symbol MAX_BUTTONS_PER_JOYSTICK to DXX_MAX_BUTTONS_PER_JOYSTICK
to show that it is a DXX symbol, not one inherited from a library.

git grep -lzw MAX_BUTTONS_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_BUTTONS_PER_JOYSTICK\>/DXX_&/g'
2016-09-25 04:52:49 +00:00
Kp 7d38a9f0be Rename MAX_AXES_PER_JOYSTICK to DXX_MAX_AXES_PER_JOYSTICK
Rename symbol MAX_AXES_PER_JOYSTICK to DXX_MAX_AXES_PER_JOYSTICK to show
that it is a DXX symbol, not one inherited from a library.

git grep -lzw MAX_AXES_PER_JOYSTICK -- SConstruct '*.h' '*.cpp' | xargs -0 sed -i -e 's/\<MAX_AXES_PER_JOYSTICK\>/DXX_&/g'
2016-09-25 04:52:49 +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 335a87b994 Probe pkgconfig modversion 2016-09-25 04:52:48 +00:00
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