Commit graph

9353 commits

Author SHA1 Message Date
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
Kp feb0baf040 Pass canvas to gr_ubitmap00 2016-12-29 03:27:10 +00:00
Kp 1fa5aef9ac Pass canvas to gr_line 2016-12-29 03:27:10 +00:00
Kp 7439949595 Pass canvas to gr_uline 2016-12-29 03:27:10 +00:00
Kp 27a033d634 Pass canvas to gr_box0 2016-12-29 03:27:10 +00:00
Kp dc4a75ca41 Pass canvas to gr_ubox0 2016-12-29 03:27:10 +00:00
Kp fab08ec636 Pass canvas to gr_universal_uline 2016-12-29 03:27:10 +00:00
Kp fc7bfac31b Pass canvas to 2d/line.cpp plot 2016-12-29 03:27:09 +00:00
Kp 962912e08a Pass canvas to gr_hline 2016-12-29 03:27:09 +00:00
Kp d43426a0f7 Pass canvas to gr_vline 2016-12-29 03:27:09 +00:00
Kp ef06aa089a Pass canvas to gr_pixel 2016-12-29 03:27:09 +00:00
Kp 7e4d07490d Pass canvas to gr_upixel 2016-12-29 03:27:09 +00:00
Kp 1ed06c91b7 Pass canvas to ogl_ulinec 2016-12-29 03:27:09 +00:00
Kp fee4346dc1 Pass canvas to ogl_urect 2016-12-29 03:27:08 +00:00
Kp bc66f5ce9b Pass canvas to gr_scanline 2016-12-29 03:27:08 +00:00
Kp e63593edc4 Pass canvas to gr_uscanline 2016-12-29 03:27:08 +00:00
Kp 290cb6e7c0 Use array<> for ogl_urect float arrays 2016-12-29 03:27:08 +00:00
Kp 29c912d2da Fid -Wold-style-cast warning in SDL-only code 2016-12-29 03:27:08 +00:00
zico a10d9e0bba Prevent access of potentially uninitialized r.value in nm_trigger_radio_button() 2016-12-28 20:36:00 +01:00
zico 3672bbd1f2 Made show_briefing_bitmap() properly consider HIRESMODE (i.e. Mac data), using scaling logic from show_animated_bitmap(). 2016-12-28 16:28:08 +01:00
zico 03f5cbf3a4 Fixed issue in frame_animation_angle(): Due to deltaang.*a being usually small values and frametime getting smaller with higher FPS, the usual use of fixmul will have scaled_delta_angle result in 0 way too often and long, making the robot animation run circles around itself. So multiply deltaang by DELTA_ANG_SCALE when passed to fixmul. 2016-12-28 15:26:33 +01:00
Kp 879070f814 Fix uninitialized value usage during init_player_stats_new_ship
init_player_stats_new_ship used select_primary_weapon and
select_secondary_weapon to assign the player's weapons.  However, those
functions read the current weapon and jumped according to its value.  A
new ship has no defined value for current weapons, so the jump triggered
an uninitialized value warning from Valgrind.

Add new functions set_primary_weapon, set_secondary_weapon that work
like the previous select_* functions, but always take the path used
for weapons not equal, without checking.  This prevents the warnings
from Valgrind, as well as a theoretical risk of initializing the ship
improperly.
2016-12-25 00:33:25 +00:00
Kp fed011df94 Exclude OBJ_NONE objects from can_collide flags test 2016-12-25 00:33:24 +00:00
Kp 5d752e741d Factor out object_create_explosion_sub collision test
An 11-line if() test is unreadable.  Split it out into a helper.
2016-12-25 00:33:24 +00:00
Kp b05325d0ab Initialize lavafall_hiss_playing for each ship 2016-12-25 00:33:24 +00:00
Kp fa1f8488f0 Use uint8_t for sidenum 2016-12-24 22:44:08 +00:00
Kp e07f5072cb Fix inverted change_light test
An optimization meant to allow change_light to stop early caused it to
stop much too early, so it rarely did any work.  Flip the sense of the
test so it does not stop early.

Fixes: 2bd538f353 ("Sort delta light indices")
2016-12-24 18:12:18 +00:00
Kp 539629c14b Avoid leaking uninitialized bytes to the network 2016-12-24 18:12:17 +00:00
Kp 47eae7176d Split valptridx declarations
The declaration of valptridx_specialized_types needed to be found by
Argument Dependent Lookup, but this was inconvenient for some types.
Split the declaration of valptridx_specialized_types out from the
definition of valptridx global subtype.
2016-12-24 18:12:17 +00:00
Kp 012238ba14 Fold segnum.h into fwd-segment.h 2016-12-24 18:12:17 +00:00
Kp efe5a574a7 Fix Ubuntu package name in INSTALL.markdown
Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/288>
2016-12-23 02:56:55 +00:00
Kp 265af2b9e5 Extend SConf diagnostics for failed system headers 2016-12-22 05:21:17 +00:00
Kp 2ba300be8c Remove bogus demo messages
Demos do not record difficulty level or track hostages correctly.  Do
not show these fields in the demo pause dialog, since they reflect
the state of the player's last played game, not the state of the player
recording the demo.
2016-12-22 05:21:16 +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 29b9c255fa Remove unnecessary FuelCenter operator- 2016-12-22 05:21:16 +00:00
Kp 10aa2e5106 Move some kconfig symbols into namespace dsx 2016-12-22 05:21:16 +00:00
Kp 0109355ae0 Switch kconfig_handler to D2 mouse button semantics
Presumably, D2 switched to EVENT_MOUSE_BUTTON_UP for a good reason.
Switch D1 to that rule too.
2016-12-22 05:21:16 +00:00
Kp bb6b548540 Remove unused listbox_get_window 2016-12-22 05:21:16 +00:00
Kp 44d1536969 Narrow scope of state_restore_all_sub variables
The previous attempt to assign defaults for values that the savegame
lacks was ignored because it overwrote a variable after the last read.
An early draft of that patch worked, but a last minute reorganization to
keep similar purpose code together made the change ineffective.

Narrow the scope of that variable and write to the correct variable.

Fixes: f62ed80205 ("Reset values that should have been in the savegame, but are not")
2016-12-21 03:54:18 +00:00
Kp 76c44b3a64 Mark DemoWBUType constexpr 2016-12-20 05:17:33 +00:00
Kp f62ed80205 Reset values that should have been in the savegame, but are not 2016-12-17 18:39:18 +00:00
Kp 171e87a1e7 Fix failure to unmap custom hogs 2016-12-17 18:39:18 +00:00
Kp 8eb295beeb Factor out get_console_color_by_priority gr_find_closest_color calls 2016-12-17 18:39:17 +00:00
Kp 4a01fab66d Fix failure to remove expired walls
std::remove_if can be called on an iterator that returns a proxy object,
but the results of that call are not generally useful.  When remove_if
attempts to move-assign over removed elements, it instead assigns over
the temporary proxy object.  If the proxy object has typical move
semantics, move-assigning over it has no effect on the underlying
container.

Revert to using partial_range on the underlying container.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/283>
Fixes: 1f434f98ad ("Use valptridx for ActiveDoors")
2016-12-11 23:47:40 +00:00
Kp 656d0879cc Fix clean test of Valgrind poison support
Headers included by SConstruct tests cannot rely on the existence of
"dxxsconf.h"; instead, SConstruct must define the symbols that would
have been in it.
2016-12-11 23:47:40 +00:00
Kp b3809266a3 Use enumerate in more loops 2016-12-11 01:56:44 +00:00