Commit graph

82 commits

Author SHA1 Message Date
Kp f3d4dff941 Use enum class for clipping_code
Adjust code_window_point to use the same masks as clipping_code.
Previously, it had top and bottom swapped.  However, since its output
was only ever compared for equality to 0, this transposition should not
affect the observable behavior.
2022-10-02 19:51:35 +00:00
Kp 1808b6badd Use enum class for projection_flag 2022-10-02 19:51:35 +00:00
Kp ad8f970bf6 Pass g3s_point & to free_temp_point
Only one point is freed at a time, so pass by reference.
2022-10-02 19:51:35 +00:00
Kp 23315ebec2 Fix SDL-only g3_draw_sphere overflow test
PF_OVERFLOW is part of p3_flags, not p3_codes.  Testing p3_codes meant
that the disk would be drawn when CC_OFF_RIGHT was unset.  This seems
unlikely to be what was intended, so fix the mismatch by switching to
use p3_flags instead of switching the symbolic constant.
2022-09-24 17:47:52 +00:00
Kp fd1be66fa4 Pass std::span to draw_tmap, draw_tmap_flat 2022-09-24 17:47:52 +00:00
Kp a48e6ab56b Pass std::span to _g3_draw_tmap 2022-09-24 17:47:52 +00:00
Kp 491d23e2d9 Pass std::span to _g3_draw_poly 2022-09-24 17:47:52 +00:00
Kp a70188e7a5 Move various static functions into anonymous namespace 2022-07-09 13:39:29 +00:00
Kp 4fd412b2ea Precompute g3_draw_line GL color data 2022-06-05 17:44:52 +00:00
Kp e54338ce4e Combine canvas+color into g3_draw_line_context 2022-06-05 17:44:52 +00:00
Kp 67705bdd7a Return checkmuldiv result in std::optional 2022-05-24 02:32:58 +00:00
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 5d12f62d77 Omit p3_{u,v,l} from OpenGL builds
These are write-only for OpenGL.  All reads are in SDL-only code.
Remove them to save 3 ints of space in every g3s_point.
2019-01-01 04:54:35 +00:00
Kp 12b57e84e6 Switch most in-tree http:// links to https://
For each link given as http://, verify that the site is accessible over
https:// and, if so, switch to it.  These domains were converted:

* llvm.org
* clang.llvm.org
* en.cppreference.com
* www.dxx-rebirth.com
* www.libsdl.org
* www.scons.org
2018-09-02 00:57:29 +00:00
Kp b65b6339f4 Make g3_draw_sphere pnt argument const (for OGL only)
SDL still needs to modify it, so use alias type `cg3s_point`, which is
`const g3s_point` in OGL and `g3s_point` in SDL.
2017-08-16 01:54:26 +00:00
Kp 66ee668e48 Pass canvas to _g3_draw_poly 2017-02-11 21:42:41 +00:00
Kp 214d930e14 Pass canvas to must_clip_flat_face 2017-02-11 21:42:41 +00:00
Kp 416954bbdf Pass canvas to gr_upoly_tmap 2017-02-11 21:42:40 +00:00
Kp 4791a40007 Pass canvas to _g3_draw_tmap 2017-02-11 21:42:39 +00:00
Kp a0538843b7 Pass canvas to must_clip_tmap_face 2017-02-11 21:42:39 +00:00
Kp 19151c12d9 Pass canvas to draw_tmap{,_flat} 2017-02-11 21:42:39 +00:00
Kp 80e7ade6a1 Pass canvas to g3_draw_sphere 2017-02-11 21:42:33 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp b7d266897c Pass canvas to must_clip_line 2017-02-11 21:42:33 +00:00
Kp 47a319bba5 Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp 362d526546 Pass canvas to gr_disk 2016-12-29 03:27:13 +00:00
Kp 1fa5aef9ac Pass canvas to gr_line 2016-12-29 03:27:10 +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 d08bfc3170 Pass color to g3_draw_sphere 2016-02-12 04:02:28 +00:00
Kp 1b4b6673ee Pass color to g3_draw_poly 2016-02-12 04:02:28 +00:00
Kp a98d553f3e Pass color to must_clip_flat_face 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 6b9a03cf2d Pass color to gr_upoly_tmap 2016-02-12 04:02:28 +00:00
Kp 36bd39babe Pass color to gr_line 2016-02-12 04:02:28 +00:00
Kp 3c73d44771 Pass color to gr_disk 2016-02-12 04:02:28 +00:00
Kp 8e186e93e2 Unify g3_draw_sphere must_clip_line paths 2016-02-12 04:02:28 +00:00
Kp 0f700eec0b Unify g3_draw_sphere calls to gr_disk 2016-02-11 03:25:52 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp 43dd620557 Use inline namespace dcx for common/3d 2015-12-05 22:57:24 +00:00
Kp 2059c5a4ad Remove unused must_clip_flat_face return value 2015-04-02 02:36:54 +00:00
Kp 72d349b0e0 Remove unused g3_draw_sphere return value 2015-04-02 02:36:54 +00:00
Kp 1125a751db Remove unused g3_draw_poly return value 2015-04-02 02:36:54 +00:00
Kp c3161d08d5 Remove unused g3_draw_line return value 2015-04-02 02:36:54 +00:00
Kp 9f6cbbe0e0 Move Vertex_list to local scope 2015-03-11 02:19:15 +00:00
Bradley Bell 3c0b5b0b31 include gr.h
needed for various 2d functions when building the software renderer
2015-02-06 21:59:27 -08:00
Kp 492d6fd996 Remove draw_tmap from OGL build
It is only used as a placeholder.  Replace it with a number.

Compile out various non-OGL functions when building for OGL.
2015-01-22 03:34:20 +00:00
Kp 634f97e8d2 Pass tmap drawer grs_bitmap by & 2014-11-30 22:09:18 +00:00
Kp cdf0d887f6 Move temporary points onto stack 2014-11-16 19:14:51 +00:00
Kp 855b249555 Make g3s_point const only in OGL 2014-11-16 19:14:51 +00:00