Go to file
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
common Move Player_eggs_dropped to player_info 2016-12-10 17:51:09 +00:00
contrib Add -O0 flags for the Debug and Editor builds in Xcode. 2016-09-28 11:18:46 +08:00
d1x-rebirth Merge pull #266 into master 2016-11-19 18:09:26 +00:00
d2x-rebirth Return segidx from escort_get_goal_segment 2016-12-05 00:26:10 +00:00
Documentation Require support for reference qualified methods 2016-12-10 17:51:07 +00:00
similar Fold calls to hud_printf_vulcan_ammo 2016-12-10 17:51:09 +00:00
.gitignore ignore XCode user data 2014-12-06 22:43:12 -08:00
COPYING.txt corrected typo in COPYING.txt (it's to its) 2014-06-06 13:18:52 +02:00
GPL-3.txt Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
INSTALL.markdown Add kreator's elaborations to Mac OS X install instructions 2016-09-11 18:49:16 +00:00
SConstruct Require support for reference qualified methods 2016-12-10 17:51:07 +00:00