Commit graph

9119 commits

Author SHA1 Message Date
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
Kp 2f179b1f48 Simplify compute_average_pixel loop 2016-12-11 01:56:44 +00:00
Kp 17a50272f0 Pass player_info to more gauges functions 2016-12-11 01:56:43 +00:00
Kp 2cd4fdc70b Fold show_homing_warning call to hud_gauge_bitblt 2016-12-11 01:56:43 +00:00
Kp 06034a53f9 Print key kill goal statistics to console
When the reactor is forcibly destroyed by the kill goal code, print to
the console and the game log the data that players could otherwise
capture with a screenshot of the network player information.
2016-12-10 17:51:11 +00:00
Kp 3e2150c470 Remove some of the weirder quirks of timeout killgoal handling
Require that at least one player have at least one kill.  If all players
have at most zero kills, return without declaring a winner.
2016-12-10 17:51:11 +00:00
Kp 87be333d29 Fold automap pause_game setup 2016-12-10 17:51:11 +00:00
Kp 0169f10728 Pass player_info to gauge functions 2016-12-10 17:51:10 +00:00
Kp 6fbcef75b1 Pass player object to draw_hud 2016-12-10 17:51:10 +00:00
Kp 83043ebd72 Pass player_info to compute_vis_and_vec 2016-12-10 17:51:10 +00:00
Kp e669e71dda Pass player_info to ai_fire_laser_at_player 2016-12-10 17:51:10 +00:00
Kp 442af298cb Pass player_info to allowed_to_fire_missile 2016-12-10 17:51:10 +00:00
Kp 7e6c9fb172 Pass player_info to allowed_to_fire_flare 2016-12-10 17:51:10 +00:00
Kp ad055dc60e Fold calls to hud_printf_vulcan_ammo
The conditional is a bit ugly due to the D1 test.

--------

    #include <cstdio>

    void hud_printf_vulcan_ammo(int mline, int x, int y, int line = __builtin_LINE())
    {
	    printf("mline=%2i line=%2i x=%2i y=%2i\n", mline, line, x, y);
    }

    void expanded_form(int full, int vertical, int mline = __builtin_LINE())
    {
	    const int x = 10, y = 20, line_spacing = 5;
	    if (full)
	    {
		    if (!vertical)
			    hud_printf_vulcan_ammo(mline, x, y - line_spacing);
    #if defined(DXX_BUILD_DESCENT_I)
		    else
			    hud_printf_vulcan_ammo(mline, x, y);
    #endif
	    }
	    else
		    hud_printf_vulcan_ammo(mline, x - 2, y - 3);
    }

    void folded_form(int full, int vertical, int mline = __builtin_LINE())
    {
	    const int x = 10, y = 20, line_spacing = 5;
	    int vx, vy;
	    if (full ? (
		    vertical ?
    #if defined(DXX_BUILD_DESCENT_I)
		    (vx = x, vy = y, true)
    #else
		    false
    #endif
		    : (vx = x, vy = y - line_spacing, true)
		    ) : (vx = x - 2, vy = y - 3, true))
		    hud_printf_vulcan_ammo(mline, vx, vy);
    }

    int main()
    {
    #define run(f)	\
	    f(0, 0);	\
	    f(1, 0);	\
	    f(0, 1);	\
	    f(1, 1)
	    run(expanded_form);
	    run(folded_form);
    }

--------
2016-12-10 17:51:09 +00:00
Kp fe0c97ebb9 Move Player_eggs_dropped to player_info 2016-12-10 17:51:09 +00:00
Kp c7634a1923 Move Auto_fire_fusion_cannon_time to player_info 2016-12-10 17:51:09 +00:00
Kp 51b06f6cdc Move Fusion_charge to player_info
This eliminates some ugly hacks regarding remotely generated fusion
shots.
2016-12-10 17:51:09 +00:00
Kp 117e205ff0 Fold spreadfire calls to Laser_player_fire_spread 2016-12-10 17:51:09 +00:00
Kp 2646bfe005 Fold Fusion_charge PALETTE_FLASH_ADD calls 2016-12-10 17:51:08 +00:00
Kp ccd71dd579 Remove unnecessary scores_maybe_add_player close of Game_wind
scores_maybe_add_player might close Game_wind, if it does not return
early.  All two callers unconditionally close Game_wind.  Remove the
unnecessary closure in scores_maybe_add_player.
2016-12-10 17:51:08 +00:00
Kp 4cec1910e2 Propagate scores_maybe_add_player argument 2016-12-10 17:51:08 +00:00
Kp a88eb5867d Fold score saying copy 2016-12-10 17:51:08 +00:00
Kp 1f434f98ad Use valptridx for ActiveDoors 2016-12-10 17:51:08 +00:00
Kp 65b05638cc Switch MAX_REACTORS from #define to constexpr 2016-12-10 17:51:08 +00:00
Kp 62a4f001ea Define valptridx factories of non-const types as mutable
Previously:

	constexpr vTYPEptr{};
	constexpr vcTYPEptr{};

Now:

	__attribute_unused static vTYPEptr{};
	constexpr vcTYPEptr{};	// unchanged from above

This is necessary for future work.  It should have no user observable
effects for now.
2016-12-10 17:51:08 +00:00
Kp 53bf638c2c Cache valptridx success check
Use a compound statement to cache the success condition as a local
boolean, then reference the local in the macro expansions.  This should
hint to the optimizer that this is always the same expression, which
should encourage it not to repeat the test in the generated code.

Actual results vary.  x86_64-pc-linux-gnu-g++-5.4.0 generates code that
is bigger, but uses fewer instructions.
2016-12-10 17:51:07 +00:00
Kp 9a45534ccc Require support for reference qualified methods 2016-12-10 17:51:07 +00:00
Kp ea040f100d Cache SConstruct startup variables 2016-12-10 17:51:07 +00:00
Kp 73c70566a0 Derive vptr factory from ptr factory 2016-12-10 17:51:07 +00:00
Kp 6c85086a43 Pass vcsegptridx to multi_send_light_specific 2016-12-10 17:51:07 +00:00
kreatordxx 62abd810a4 Merge pull request #282 from dxx-rebirth/demo_fix
Fix freeze when aborting game while demo is recording
2016-12-08 13:22:24 +08:00
Kp 6e03e6b4c1 Add hack to compensate for memdebug premature scan 2016-12-08 03:32:06 +00:00
Chris Taylor 17ca665ed5 Only return window_event_result::deleted from game_handler when Game_wind was deleted in that call of game_handler
Fixes freeze when aborting game while demo is recording
2016-12-07 09:38:03 +08:00
Kp 515476f02b Propagate constant third parameter of call_object_create_egg 2016-12-05 00:26:11 +00:00
Kp 19528a85d0 Fix various check_header_includes=1 failures 2016-12-05 00:26:11 +00:00