Commit graph

191 commits

Author SHA1 Message Date
Kp 764d20d4e1 Make grs_bitmap::bm_flags private 2017-01-15 00:03:13 +00:00
Kp f4fffeea49 Make more render state const when possible
Make Render_zoom const in builds where there are no statements that can
change it.

Use vcseg, not vseg, for some segment accesses.
2017-01-15 00:03:12 +00:00
Kp 22e364e030 Pass canvas to gr_clear_canvas 2017-01-01 00:45:45 +00:00
Kp 0905aefa0a Pass canvas to gr_rect 2017-01-01 00:45:45 +00:00
Kp 77c22d3a7f Pass canvas to gr_settransblend 2017-01-01 00:45:44 +00:00
Kp 1fa5aef9ac Pass canvas to gr_line 2016-12-29 03:27:10 +00:00
Kp ef06aa089a Pass canvas to gr_pixel 2016-12-29 03:27:09 +00:00
Kp d085175cbd Scrub invalid primary textures at level load
Past releases, when rendering an invalid primary texture, would
Int3() and then reset the texture to zero.  Commit d767f7c changed the
logic to return without resetting the texture, since the reset seemed to
be unnecessary.  Unfortunately, it is necessary.  Some levels, including
those shipped with the retail game data, specify bogus primary textures
on some surfaces.  After d767f7c, rendering a surface with an invalid
primary texture causes the surface to be invisible, even if it has a
valid secondary texture.

Remove the return statement added in d767f7c.  Extend
validate_segment_side to validate the primary texture on the tested
side.  When an invalid texture is found, reset it and log a diagnostic.
For built-in levels, log at level CON_VERBOSE since players cannot
readily fix the level.  For external levels, log at level CON_URGENT so
that level authors know to fix their level before releasing it.

Fixes: d767f7cd5e ("Pass vcsegptridx to render_face")
2016-12-22 05:21:16 +00:00
Kp e0f6077afa Pass vcsegidx to render_mine 2016-12-05 00:26:10 +00:00
Chris Taylor bae558b2e1 Fix selection in the game view for the editor
build_segment_list and build_object_lists are now required for _search_mode as well (i.e. required for every frame), as the segment list is no longer a set of global variables.
2016-11-11 16:09:57 +08:00
zico 8bd3eaad4c Fixed misleading indentations. 2016-10-31 11:36:48 +01:00
Kp 65f9fd54f8 Use vcsegptr for build_object_lists 2016-10-29 23:16:17 +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 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 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 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 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 ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 3550f2d7ff Flatten render type hierarchy 2016-07-16 16:52:04 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp f48247d5c7 Fix -Wshadow warnings in render_compare_context_t 2016-05-21 17:24:51 +00:00
Kp 560401e1ff Fix -Wshadow warnings in check_face 2016-05-21 17:24:51 +00:00
Kp f4e1ebb576 Remove unnecessary gr_setcolor calls 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 8c24eaa721 Pass color to g3_draw_line 2016-02-12 04:02:28 +00:00
Kp 36bd39babe Pass color to gr_line 2016-02-12 04:02:28 +00:00
Kp 23047b1165 Pass color to gr_rect 2016-02-12 04:02:28 +00:00
Kp f235d6b12b Pass color to gr_pixel 2016-02-12 04:02:28 +00:00
Kp 553b313099 Use vwallptr 2016-02-12 04:02:28 +00:00
Kp b57f08c798 Use partial_const_range 2016-02-12 04:02:28 +00:00
Kp 08f7d850e0 Fix SDL build failure 2016-01-26 03:45:06 +00:00
Kp a3ae630829 Remove default argument for basic_ptridx(index) 2016-01-09 16:38:14 +00:00
Kp cefc79f869 Construct find_point_seg segptridx explicitly 2016-01-09 16:38:13 +00:00
Kp 98f5afa9f8 Remove default argument for basic_ptr(pointer,array &) 2016-01-09 16:38:13 +00:00
Kp d7890e37cb Skip copying segment normals in render_side 2016-01-03 20:21:35 +00:00
Kp 2e8900ab73 Remove unused lcnt_save,scnt_save 2016-01-03 20:21:35 +00:00
Kp 3428ea6392 Remove Show_only_curside
Show_only_curside was locked to 0 in EDITOR builds, but only EDITOR
builds could render the current side.
2016-01-03 20:21:35 +00:00
Kp c57db299ba Make first_terminal_seg local 2016-01-03 20:21:34 +00:00
Kp d479819931 Use absolute_sibling to reduce global references for ptridx 2015-12-22 04:18:51 +00:00
Kp db9fb0ed42 Move more symbols into namespace dcx/dsx 2015-12-22 04:18:50 +00:00
Kp 28ee4c1804 Move DbgUseOldTextureMerge to CArg 2015-12-18 04:08:24 +00:00
Kp dc8c0323d8 Uninline namespace dcx 2015-12-13 18:00:49 +00:00
Kp e784fd96fa Use inline namespace dcx for common/texmap 2015-12-05 22:57:24 +00:00
Kp 0c75aecc45 Check most uses of object id 2015-11-27 03:56:13 +00:00
zico bd391e2363 Reduced the level rendering from 3 passes to 2 while maintinaing the original function (may need optimization, tho); Rendering level parts with transparency effects (force fields, energy center sparks) in same pass as objects to prevent them from making objects invisible behind them; Changed object sorting to they render back to front to prevent rendering issues (robots disappearing behind explosions, further away powerup rendered over a closer one, etc) 2015-10-25 18:16:34 +01:00