Commit graph

9096 commits

Author SHA1 Message Date
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
Kp 0fb59c225c Move add_points_to_score into namespace dsx 2016-12-05 00:26:10 +00:00
Kp f3ebdca557 Return segidx from escort_get_goal_segment 2016-12-05 00:26:10 +00:00
Kp e0f6077afa Pass vcsegidx to render_mine 2016-12-05 00:26:10 +00:00
Kp d7ea84aa36 Pass vcsegidx to multi_send_boss_teleport 2016-12-05 00:26:10 +00:00
Kp 31f330c0ff Pass vcsegidx to multi_send_door_open_specific 2016-12-05 00:26:10 +00:00
Kp fe44705d2d Pass vcsegidx to multi_send_effect_blowup 2016-12-05 00:26:10 +00:00
Kp 6bffe9949e Pass vcsegidx to multi_send_create_powerup 2016-12-05 00:26:09 +00:00
Kp 82b068bf9c Pass vsegidx to multi_send_door_open 2016-12-05 00:26:09 +00:00
Kp 67afde75e3 Fold net_udp_send_door_updates calls to multi_send_door_open 2016-12-05 00:26:09 +00:00
Kp b5be5f2099 Pass vcwallptridx to multi_send_hostage_door_status
Avoid recomputing the wall pointer that the caller already had.
2016-12-05 00:26:09 +00:00
Kp 3fc128607c Pass vsegidx_t to disable_flicker 2016-12-05 00:26:09 +00:00
Kp c035f5e93f Pass segidx_t to create_path_points 2016-12-05 00:26:09 +00:00
Kp c60d93326c Propagate constant third parameter of create_n_segment_path_to_door 2016-12-05 00:26:08 +00:00
Kp b696d8cf22 Pass segidx_t to create_n_segment_path 2016-12-05 00:26:08 +00:00
Kp d8a1428f13 Pass segidx_t to init_ai_object 2016-12-05 00:26:08 +00:00
Kp aaea5411e1 Only set -Wunused if __attribute__((unused)) works 2016-12-05 00:26:08 +00:00
zico bfe6149cdb Fixed regression from 6e20d86941 in which flag OF_PLAYER_DROPPED in drop_powerup would only be set for OBJ_ROBOT but not OBJ_POWERUP, making the Guidebot unable to locate player spew 2016-12-04 21:39:03 +01:00
zico 34b24c0d69 Fixed regression from d1x-rebirth 0.57.3: Properly read out flat poly color for morph models from model data 2016-12-04 21:21:49 +01:00
zico ffb68756e3 Changed handling of scrape_player_on_wall(), preventing it to occur multiple times per frame. 2016-12-02 13:37:08 +01:00
zico ad5a5047d4 Improved handling for Guidebot goals that are not objects: Set object_none to Escort_goal_index for ESCORT_GOAL_EXIT, ESCORT_GOAL_ENERGYCEN and ESCORT_GOAL_SCRAM. Changed handling for ESCORT_GOAL_EXIT to work like ESCORT_GOALFUELCEN (without needing Escort_goal_index). Let detect_escort_goal_accomplished() bail if Escort_goal_index == object_none (replacing case ahndling for ESCORT_GOAL_SCRAM). Minor formatting improvements of detect_escort_goal_accomplished() and removal of stub case of ESCORT_GOAL_FUELCEN. 2016-11-29 19:30:16 +01:00
Kp f8cc32a4af Merge pull #272 into master 2016-11-26 22:51:49 +00:00
Kp 6153fc6f8d Recharge omega cannon on entering new level 2016-11-26 22:51:49 +00:00
Kp 6226e5fbbf Remove obsolete operator-(wall *, array<wall, N> &) 2016-11-26 22:51:49 +00:00