Commit graph

9198 commits

Author SHA1 Message Date
Kp 6e8c3b3357 Pass canvas to gr_internal_string_clipped{,_m} 2017-01-08 22:31:59 +00:00
Kp c291873041 Pass canvas to gr_internal_string_clipped_template 2017-01-08 22:31:59 +00:00
Kp 9dbcbc51ce Pass canvas to gr_ustring_mono 2017-01-08 22:31:59 +00:00
Kp 83e86707aa Pass canvas to gr_internal_string0{,m} 2017-01-08 22:31:59 +00:00
Kp f0ee7af1aa Pass canvas to gr_internal_string0_template 2017-01-08 22:31:58 +00:00
Kp f58b66173f Pass canvas to gr_internal_color_string 2017-01-08 22:31:58 +00:00
Kp 8d1bd87b33 Pass canvas to ogl_internal_string 2017-01-08 22:31:58 +00:00
Kp 4b2102f41a Factor out show_framerate x/y for gr_printf 2017-01-08 22:31:58 +00:00
Kp f339e60606 Scrub object subtypes on load
Old versions of Rebirth sometimes saved games with bogus object data,
such that `obj->type == OBJ_NONE`, but `obj->movement_type`,
`obj->control_type`, or `obj->render_type` were not their respective
*_NONE constants.  This confused the game loader code such that it would
load invalid data from the `mtype`, `ctype`, or `rtype` unions and use
it without checking.

Try to counter some of this by exiting early if the object has type
OBJ_NONE.
2017-01-07 23:34:18 +00:00
Kp 2c4af523dd Use ugly preprocessor hook hack to fix Clang build failure
Clang rejects a declared (but never defined and never used) `static`
function.  Change the declaration to be the value of a macro that will
be expanded only when the function is both defined and used.

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/295>
Fixes: 55822d0b4d ("Add wrappers for more precise Valgrind physfs diagnostics")
2017-01-07 19:09:04 +00:00
Chris Taylor f634b084ed Update Xcode project for recently added/removed files
Added:
common/include/cpp-valptridx.h
common/misc/vg-wrap-physfs.h
common/misc/vgrphys.cpp
common/misc/vgwphys.cpp

Added (some time ago):
common/include/dsx-ns.h

Removed:
common/main/segnum.h
2017-01-07 15:30:18 +08:00
Kp 55822d0b4d Add wrappers for more precise Valgrind physfs diagnostics 2017-01-01 23:19:21 +00:00
Kp 61fe5c2bbd Add undocumented CPP/CXX/LINK flags that bypass SConf testing
These flags are passed through to the underlying build, but not checked
by the SConf tests.  They are meant for options which will work in the
main build, but fail in the configure environment, such as `-Wl,--wrap`.
2017-01-01 23:19:21 +00:00
Kp fe04c3fef6 Initialize obsolete fields
Valgrind warns when writing uninitialized data to a file.  The Descent
savegame format requires writing certain fields that are no longer used.
Set those fields to 0 to prevent leaking stack data into the file.
2017-01-01 23:19:21 +00:00
Kp 3fab4bfeb5 Fix uninitialized write of segment light_subtracted
Levels which fit in MAX_SEGMENTS_ORIGINAL read exactly
MAX_SEGMENTS_ORIGINAL segments worth of light_subtracted, even though
fewer segments were defined.  Prepare light_subtracted into a temporary
stack buffer instead of doing byte-at-a-time writes.  Initialize this
stack buffer to 0 when necessary.  Write the buffer once it is fully
prepared.
2017-01-01 00:45:46 +00:00
Kp a7ec4ccd63 Avoid uninitialized reads when saving game
player_info::cloak_time is only defined if the player is cloaked.
player_info::invulnerable_time is only defined if the player is
invulnerable.

In both cases, the game save code tried to read the ::*_time variable
even when it was undefined.  Modify the saving code to check player
flags before reading the associated timer.
2017-01-01 00:45:46 +00:00
Kp fe50c0a20a Factor out point_list setup 2017-01-01 00:45:45 +00:00
Kp 2c7e36ef1e Cache KEY_M vsegptridx 2017-01-01 00:45:45 +00:00
Kp c914131009 Pass canvas to gr_rle_expand_scanline_generic 2017-01-01 00:45:45 +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 794dcce327 Pass canvas to gr_urect 2017-01-01 00:45:44 +00:00
Kp 774dedd21d Pass canvas to gr_bm_pixel 2017-01-01 00:45:44 +00:00
Kp 2be580df0c Pass canvas to gr_bm_upixel 2017-01-01 00:45:44 +00:00
Kp 77c22d3a7f Pass canvas to gr_settransblend 2017-01-01 00:45:44 +00:00
Kp c3c4ab8e3e Pass canvas to gr_box 2017-01-01 00:45:44 +00:00
Kp dac1a69f7c Pass canvas to gr_ubox 2017-01-01 00:45:44 +00:00
Kp 1b57e9a5ff Pass canvas to show_fullscr 2017-01-01 00:45:43 +00:00
Kp 250bf58e51 Pass canvas to gr_bitmapm 2017-01-01 00:45:43 +00:00
zico daad12106d Fixed texture malformations of op_tmappoly in g3_draw_morphing_model_state(). 2016-12-30 14:49:40 +01:00
zico 24bd4170f4 Added debug key combo DEL+M to generate a morphing robot in the player segment, rotating through all available bots. Handy for testing purposes. 2016-12-30 14:45:47 +01:00
Kp 3a4eafac03 Add workaround for passive thief bot
zicodxx reports that f7d0c85 made the thief bot passive and timid.
His analysis suggests that the problem is because f7d0c85 changed
find_connected_distance to return vm_distance::maximum_value() in places
where it previously returned magic values that were not maximum (caching
a distance of F1_0*1000 and returning a distance of -1).  Rather than
try to fix the underlying code that relied on these magic values, revert
those return paths to return these unusual values.  Move the unusual
values to named constants in file scope so that they are easier to find
and correlate.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/286>
Analyzed-by: zicodxx

Fixes: f7d0c853ba ("Use special types for distance/magnitude")
2016-12-29 03:27:14 +00:00
Kp 362d526546 Pass canvas to gr_disk 2016-12-29 03:27:13 +00:00
Kp acd309099b Pass canvas to gr_ucircle 2016-12-29 03:27:13 +00:00
Kp 08d0aa9b59 Pass canvas to gr_bitmap 2016-12-29 03:27:13 +00:00
Kp d7cd6d17c3 Pass canvas to gr_ubitmapm 2016-12-29 03:27:13 +00:00
Kp 6ab3b18657 Pass canvas to gr_ubitmap 2016-12-29 03:27:12 +00:00
Kp 99f5cfbb10 Pass canvas to ogl_ubitmapm_cs 2016-12-29 03:27:12 +00:00
Kp 1b617b9d5c Pass canvas to gr_ubitmapGENERICm 2016-12-29 03:27:12 +00:00
Kp ea0b0137f9 Pass canvas to gr_ubitmap012m 2016-12-29 03:27:12 +00:00
Kp aba8f163e6 Pass canvas to gr_ubitmap012 2016-12-29 03:27:12 +00:00
Kp ba70ec2142 Pass canvas to gr_for_each_bitmap_byte 2016-12-29 03:27:12 +00:00
Kp d1f1633f45 Pass canvas to gr_ubitmapGENERIC 2016-12-29 03:27:11 +00:00
Kp 7e62a5670e Pass canvas to gr_box12 2016-12-29 03:27:11 +00:00
Kp 14961b52fe Pass canvas to gr_ubox12 2016-12-29 03:27:11 +00:00
Kp 1e1272fcf2 Cache temporaries in show_briefing_bitmap
Avoid recomputing the same width/height expressions.  This saves ~20
instructions and ~100 bytes on x86_64-pc-linux-gnu.
2016-12-29 03:27:11 +00:00
Kp 9f6c54e29a Pass unsigned x/y to gr_gpixel 2016-12-29 03:27:11 +00:00
Kp f4752eabb3 Pass canvas to gr_for_each_bitmap_byte callback 2016-12-29 03:27:11 +00:00
Kp ba78153f13 Pass canvas to gr_ubitmap00m 2016-12-29 03:27:11 +00:00
Kp eb5419b934 Unify gr_ubitmap00{,m} 2016-12-29 03:27:10 +00:00