Commit graph

1061 commits

Author SHA1 Message Date
zico b2cad09c26 Added new texture filtering options based on patch of user 'beware' 2016-08-29 20:53:10 +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 198cb4e449 Allow rvalue references for some serial.h process_buffer overloads 2016-08-28 22:41:47 +00:00
Kp 0a2676315d Flatten serial.h type constructor pad() 2016-08-28 22:41:46 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 16318e7c9e Remove empty #if/#endif in loadgl.h
Prior rewrites left empty conditionals.  Remove those conditionals.
2016-08-22 00:31:15 +00:00
Kp 655d0e6714 Remove unused loadgl typedefs
Per request from Mako88, remove unused loadgl typedefs.  loadgl.h
was imported from elsewhere and defines typedefs for many functions
that Descent does not use.  Some of these are guarded by WINVER
conditionals and, in Mako88's unspecified environment, defining WINVER
to expose these results in a build failure because the guarded typedef
requires a type that is not defined by the environment.

Compensate for that by removing all unused gl typedefs.

    # Save the results to a file, then run the file separately.  This
    # avoids any chance that sed might try to edit the file while later
    # searches are still running.
    git grep 'typedef .*OGLFUNCCALL \*' common/include/loadgl.h | sed -e 's/^.*OGLFUNCCALL \*//' -e 's/).*$//' | while read f; do
        if ! git grep -q 'DEFVAR\s'"$f"'\>' -- common/include/loadgl.h; then
            echo "/\\<$f\\>/d"
        fi
    done > unused.sed
    sed -i common/include/loadgl.h -f unused.sed
2016-08-22 00:31:15 +00:00
Kp f50aef0241 Remove unused loadgl indirections
Per request from Mako88, remove unused loadgl indirections.  loadgl.h
was imported from elsewhere and defines indirections for many functions
that Descent does not use.  Some of these are guarded by WINVER
conditionals and, in Mako88's unspecified environment, defining WINVER
to expose these results in a build failure because the guarded typedef
requires a type that is not defined by the environment.

Compensate for that, and likely improve the generated code, by removing
all unused gl symbols.

    # Save the results to a file, then run the file separately.  This
    # avoids any chance that sed might try to edit the file while later
    # searches are still running.
    s=( `git ls-files '*.h' '*.cpp' | grep -v -F common/include/loadgl.h` )
    git grep '#define w\?gl[A-Z]\w\+ dw\?gl' common/include/loadgl.h |
	    gawk '{print $2;}' | while read f; do
	    if ! git grep -q -l '\<d\?'"$f"'\>' -- "${s[@]}"; then
		    echo "/\\<d\?$f\\>/d"
	    fi
    done > unused.sed
    sed -i common/include/loadgl.h -f unused.sed
2016-08-20 22:28:44 +00:00
Kp 4cb3d46148 Move <type_traits> test to Cxx11RequiredFeature
Commit 957016621e ("Remove support for
Boost.TypeTraits") removed support for any alternative implementation of
<type_traits>, so C++11 <type_traits> is now required.  Move it to
the Cxx11RequiredFeature array to combine it with the other required
feature tests.
2016-08-08 00:07:20 +00:00
Kp 95a53ed820 Require C++11 range-based for
Fallback support for Boost.Foreach is broken and no one has reported it.
The minimum required gcc version supports range-based for.  Recent Clang
supports range-based for.  No Microsoft compilers are supported.  Remove
support for the fallback Boost.Foreach and move the C++11 range-based
for test to the Cxx11RequiredFeature array.
2016-08-08 00:07:19 +00:00
Kp a09dce6ead Remove char[N] overload for PHYSFSX_getRealPath 2016-08-06 19:55:25 +00:00
Kp 53deef077a Prefer make_unique over raw new 2016-08-06 19:55:24 +00:00
Kp 2e88fec559 Flatten some ui type hierarchy 2016-08-06 19:55:24 +00:00
Kp 5fb379430f Flatten some serial type hierarchy 2016-08-06 19:55:24 +00:00
Kp 37ec5e25d4 Declare ~UI_GADGET as protected
UI_GADGET subclasses should always be deleted through the subtype
pointer.
2016-08-06 19:55:23 +00:00
Kp df8dc7cc46 Include fwd-partial_range.h in physfs_list.h
All users of physfs_list.h included fwd-partial_range.h or
partial_range.h; physfs_list.h did not include either, but assumed one
would be available.  Include fwd to fix check_header_includes=1 build.

Fixes: ff67afd440 ("Propagate partial_range up into PHYSFSX_findFiles family")
2016-08-06 19:55:23 +00:00
Kp 7d3c3288a9 Remove support for array other than std::array
Building with Boost.Array fails due to name lookup errors.  These could
be fixed, but since no one has reported them and they are fairly old,
Boost.Array appears to be unused.  Remove support for it.

Building with std::tr1::array fails due to missing features in
std::tr1:array relative to std::array.  No one has reported this either,
so remove support for std::tr1:array.

Move the test for std::array into the Cxx11RequiredFeature list so that
it is run as part of the group test, rather than as a separate
statement.
2016-07-31 22:25:49 +00:00
Kp 2f938a35d9 Rewrite parenthesized uses of old-style numeric casts to static_cast
s/(\(float\|\(unsigned \)\?\(int\|long\)\|double\|short\|unsigned\))\s*(/static_cast<\1>(/g
2016-07-31 22:25:49 +00:00
Kp 99bbd0cf26 Mark global constants as constexpr
s/^const \([^*]*=.*;\)/constexpr \1/
2016-07-23 04:10:42 +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 c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp dfcf28ff10 Rename fmtcheck macros to follow standard conventions 2016-07-15 03:43:03 +00:00
Kp 4526f509f3 Remove useless cast in f2db
Bare floating point literals are double.
2016-07-15 03:43:02 +00:00
Kp 946e7bd4ee Move some digi symbols to dcx 2016-07-15 03:43:02 +00:00
Kp 5d7c7d6454 Make assert_equal inherit integral_constant 2016-07-15 03:43:01 +00:00
Kp 957016621e Remove support for Boost.TypeTraits
Boost enable_if works differently from std::enable_if, so the build is
broken when using Boost.TypeTraits.  The broken code has been present
for a long time and no one reported it.  Remove the fallback to Boost.
2016-07-15 03:43:01 +00:00
Kp 40d4bf4f09 Remove unused inherit_void_ptr_handler 2016-07-15 03:43:01 +00:00
Kp 6554b96b66 Remove unused SWAPINT64 2016-07-14 01:59:04 +00:00
Kp 59750d3c29 Rewrite declarations of ubyte * to standard uint8_t * 2016-07-14 01:59:02 +00:00
Kp e8d5992797 Remove unused CENTER_STRING_LENGTH 2016-07-09 17:58:35 +00:00
Kp 82a8f6ebb0 Pass bm_mode to gr_init_bitmap 2016-05-28 17:31:27 +00:00
Kp 3c5add9d0e Pass bm_mode to gr_init_bitmap_alloc 2016-05-28 17:31:27 +00:00
Kp 86122120b7 Pass bm_mode to gr_init_canvas 2016-05-28 17:31:27 +00:00
Kp dcc56e6b39 Propagate bm_mode::linear into iff_read_bitmap 2016-05-28 17:31:27 +00:00
Kp c00f918a8e Propagate bm_mode::linear into bald_guy_load 2016-05-28 17:31:26 +00:00
Kp 3fb16c1d7a Propagate bm_mode::linear into pcx_read_bitmap 2016-05-28 17:31:26 +00:00
Kp 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp a0cc2bfc7e Pass canvas to ogl_upixelc 2016-05-28 17:31:26 +00:00
Kp 2dfd87f276 Move OGL_VIEWPORT assignments above glViewport 2016-05-28 17:31:26 +00:00
Kp bbda32f78d Make cv_fade_level unsigned 2016-05-28 17:31:26 +00:00
Kp 608467161b Remove obsolete arguments from DEFINE_VALPTRIDX_SUBTYPE 2016-04-06 03:34:13 +00:00
Kp 443b1f2915 Add file/line to valptridx output when available 2016-04-06 03:34:13 +00:00
Kp 5b3a36e6b8 Remove valptridx operator-(P *, A &) 2016-04-06 03:34:13 +00:00
Kp fb6db67d94 Include file+line in UserError output 2016-04-03 17:50:42 +00:00
Kp 27cef20eb3 Move namespace dsx handling to dsx-ns.h 2016-03-19 19:08:10 +00:00
Kp b8f39b024a Move DoMenu into dsx 2016-03-19 19:08:10 +00:00
Kp 08de1bbff0 Remove cv_color
It is only ever set to 0 or copied from other canvases.  Set it to zero
everywhere.
2016-02-12 04:02:28 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp e09a590e6f Pass color to Vline 2016-02-12 04:02:28 +00:00