Commit graph

66 commits

Author SHA1 Message Date
Kp a70188e7a5 Move various static functions into anonymous namespace 2022-07-09 13:39:29 +00:00
Kp e54338ce4e Combine canvas+color into g3_draw_line_context 2022-06-05 17:44:52 +00:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp e6126b800f Reorder endlevel definitions to split by dcx/dsx 2020-10-01 03:25:27 +00:00
Kp db7b4b3f88 Refer to <memory> directly, not through "compiler-make_unique.h" 2020-05-02 21:18:43 +00:00
Kp cc38cdf4b8 Qualify uses of std::make_unique 2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 3f74084c0f Include segment.h for terrain.cpp to handle over-eager instantiation
In some configurations, gcc (but not clang) instantiate
valptridx<segment>::array_managed_type too eagerly, then fail if the
sizeof(segment) is unknown.  Include segment.h so that the size is
available.
2019-12-16 01:56:59 +00:00
Kp ade6ee4195 Move exit_segnum to d_player_unique_endlevel_state
exit_segnum is set during load_endlevel_data, which currently runs too
early for this to depend on the exit used, and thus to be player-unique.
That data should be loaded at need, when the level ends, rather than
during level setup.  This can be addressed later, when support for
multiple exits is improved.
2019-08-15 01:34:22 +00:00
Kp f87c503618 Move Viewer_eye to local scope 2018-12-30 00:43:57 +00:00
Kp 6043168d51 Move various SDL-only texture mapping functions to !DXX_USE_OGL
The OGL build compiles, but does not use, various texture mapping
functions.  Move these to be built only for the SDL build.
2017-11-01 02:01:21 +00:00
Kp 7bae498c45 Cache bitset::operator[] result 2017-09-30 18:00:15 +00:00
Kp 753cbafe61 Pass canvas to render_terrain 2017-03-11 19:56:26 +00:00
Kp a6fc1f6357 Pass canvas to draw_cell 2017-03-11 19:56:26 +00:00
Kp 7410ad343c Pass canvas to render_mine 2017-03-10 01:22:28 +00:00
Kp 08e4a6e620 Use stdint constants for some INT*_MAX
clang becomes confused trying to determine which vm_distance_squared
constructor to use for a literal input of 0x7fffffffffffffff, even
though the size of the input requires it to be `long` and only one
constructor can take a `long`.  Switch from an explicit
0x7fffffffffffffff to the symbolic constant INT64_MAX, which has the
same value, but a platform-appropriate suffix to force the compiler to
pick the right type.

For general clarity, switch some other instances of integer maximum
literals to symbolic constants of the same value.

This commit has no effect on the generated code (except for changes to
line numbers).

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/pull/324>
Fixes: 17208cca79 ("Disallow int for vm_distance_squared")
2017-02-22 03:05:43 +00:00
Kp 59b57bd7dc Pass canvas to g3_check_and_draw_tmap 2017-02-11 21:42:40 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +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 9a06543781 Switch terrain.cpp light cast to static_cast 2016-09-04 00:02:51 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp dcc56e6b39 Propagate bm_mode::linear into iff_read_bitmap 2016-05-28 17:31:27 +00:00
Kp 398596c468 Use enum for bitmap mode 2016-05-28 17:31:26 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 2016-02-12 04:02:28 +00:00
Kp 8c24eaa721 Pass color to g3_draw_line 2016-02-12 04:02:28 +00:00
Kp ccee595321 Remove Interpolation_method from OGL build 2015-11-06 03:51:10 +00:00
Kp 68834fb929 Expand render_mine window_rendered_data helper inline 2015-05-05 03:20:42 +00:00
Kp 31450e4843 Pass iff_read_bitmap arg by & 2015-01-25 05:32:44 +00:00
Kp 9794cfddc9 Move some local structs into anonymous namespaces 2015-01-24 19:16:34 +00:00
Kp d3e657222e Use RAIIdmem for height_array 2015-01-23 03:55:04 +00:00
Kp 9ffd958d3d Create window_rendered_data locally 2014-12-18 04:12:38 +00:00
Kp b79e432a3e Pass render_mine arg by & 2014-12-13 04:11:16 +00:00
Kp 5eddc2c197 Make bitmap bm_data const where easy 2014-12-02 03:24:38 +00:00
Kp 855b249555 Make g3s_point const only in OGL 2014-11-16 19:14:51 +00:00
Kp c2d308807c Make various g3s_point * const 2014-11-15 03:10:06 +00:00
Kp 8e0d85b666 Pass g3_draw_tmap arg by & 2014-11-13 03:44:04 +00:00
Kp baa39fe8f7 Add g3_rotate_point that returns result 2014-11-13 03:41:29 +00:00
Kp aba13a0bd0 Pass g3_draw_line arg by & 2014-11-13 03:19:52 +00:00
Kp 40eb2e6b01 Add vm_vec_scale_add that returns result 2014-11-02 03:43:57 +00:00
Kp b32f5e5df3 Add vm_vec_copy_scale that returns result 2014-11-02 03:43:47 +00:00
Kp 805d7f2404 Pass get_face_light arg by & 2014-11-02 03:43:29 +00:00
Kp 697bdcf078 Add vm_vec_normal that returns result 2014-11-01 03:17:48 +00:00
Kp ff877834cb Pass render_terrain vector by & 2014-11-01 03:12:57 +00:00
Kp 5bb9c88979 Add vm_vec_sub that returns result 2014-10-29 03:24:31 +00:00
Kp 2ceabf5034 Pass g3_add_delta_vec arg by & 2014-10-02 03:02:36 +00:00
Kp adae9888b9 Pass g3_rotate_delta_vec arg by & 2014-10-02 03:02:36 +00:00
Kp 68211d20d3 Pass g3_rotate_point arg by & 2014-10-02 03:02:35 +00:00
Kp f509b49dc3 Pass vm_vec_normal arg by & 2014-10-01 02:28:42 +00:00
Kp 05a91f9b58 Pass vm_vec_scale_add2 arguments by & 2014-09-28 21:43:14 +00:00
Kp 4104bf4f11 Pass vm_vec_scale_add arguments by & 2014-09-28 21:43:14 +00:00