Commit graph

9311 commits

Author SHA1 Message Date
Kp e765f8b744 Reorder ui_draw_button to support folding 2017-02-11 21:42:34 +00:00
Kp f28a5e77f1 Fold ui_draw_button calls to gr_set_fontcolor 2017-02-11 21:42:34 +00:00
Kp 554daa61cc Pass font to ui_get_button_size 2017-02-11 21:42:34 +00:00
Kp 1413264697 Cache canvas in print_clock 2017-02-11 21:42:34 +00:00
Kp beaa49a7ba Pass destination bitmap to scale_bitmap 2017-02-11 21:42:34 +00:00
Kp 590a025a89 Pass canvas to g3_start_frame 2017-02-11 21:42:34 +00:00
Kp 740b3a9649 Pass canvas to ogl_start_frame 2017-02-11 21:42:33 +00:00
Kp 80e7ade6a1 Pass canvas to g3_draw_sphere 2017-02-11 21:42:33 +00:00
Kp 513e7ceceb Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp b7d266897c Pass canvas to must_clip_line 2017-02-11 21:42:33 +00:00
Kp 47a319bba5 Pass canvas to g3_draw_line 2017-02-11 21:42:33 +00:00
Kp d779a26307 Pass canvas to gr_bm_ubitblt0x_rle 2017-02-11 21:42:33 +00:00
Kp f8b057d43d Pass canvas to gr_bm_ubitbltm 2017-02-11 21:42:32 +00:00
Kp 9cc5d6f439 Pass canvas to gr_bm_ubitblt 2017-02-11 21:42:32 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 0dcae721d9 Make canvas an explicit argument to gr_printf
Previously, a macro implied *grd_curcanv as the canvas.  Pass the canvas
explicitly so that callers can choose the canvas to use.
2017-02-11 21:42:32 +00:00
Kp d1657ba269 Make canvas an explicit argument to gr_uprintf
Previously, a macro implied *grd_curcanv as the canvas.  Pass the canvas
explicitly so that callers can choose the canvas to use.
2017-02-11 21:42:32 +00:00
Kp 3fb0367423 Use range_for in duplicate_group 2017-02-11 21:42:31 +00:00
Kp 227eb98c3e Pass player_info to do_cockpit_window_view 2017-02-11 21:42:31 +00:00
Kp 8783c22003 Remove obsolete ogl_pal 2017-02-11 21:42:31 +00:00
Kp 2cf0a0034a Simplify g3_draw_poly call stack 2017-02-11 21:42:31 +00:00
Kp 1a3d89aecf Use vsegptridx in editor group functions 2017-02-11 21:42:31 +00:00
Kp 43a700a200 Prefer grs_main_bitmap::reset() to direct reinitialization
This ensures that any allocated resources are always freed.
2017-02-11 21:42:31 +00:00
Kp 96eb8b824a Fold briefing::guy_bitmap_show into briefing::guy_bitmap 2017-02-11 21:42:31 +00:00
Kp c242319829 Use RLE helper for bitblt RLE decoding 2017-02-11 21:42:30 +00:00
Kp c1440ff995 Factor out RLE expansion
Many sites open-coded walking a bitmap and handling whether it was
RLE_BIG.  Factor that out into a helper class and redirect those sites
to use it.
2017-02-11 21:42:30 +00:00
Kp 625bfde977 Tighten test for warning -Wuseless-cast
zicodxx reported a compiler error when using inheriting constructors
when using an unspecified environment.  Investigation shows that gcc-6.x
has a regression that causes spurious -Wuseless-cast warnings where the
compiler automatically synthesizes a cast, then warns the user that the
synthesized cast is useless.

Compensate for this by extending the -Wuseless-cast testcase to provoke
this bug, if present.  Affected users will lose -Wuseless-cast, but
their build will succeed.

Reported-by: zicodxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/316>
2017-02-08 23:34:41 +00:00
Kp 7df99350dd Pass player to do_laser_firing_player 2017-02-08 23:34:41 +00:00
Kp 82d10b910c Pass player_info to allowed_to_fire_laser 2017-02-08 23:34:41 +00:00
Kp c8f51c7184 Simplify redundant ehostage.cpp conditional 2017-02-08 23:34:41 +00:00
Kp c16b7763e9 Remove unused ui_draw_line_in 2017-02-08 23:34:41 +00:00
Kp d40c636ecc Reorder gr_free_bitmap_data to improve tail call optimization 2017-02-08 23:34:41 +00:00
Chris Taylor f7471af2d6 In ReadControls, continue executing code even if HandleDeathInput handled a key event
This allows the player to press a movement key to respawn after death, and the same keypress will cause the ship to move. Now this works with the option 'when dead, respawn by pressing any key' as well as 'when dead, respawn by pressing the Fire key'.
2017-02-08 12:17:51 +08:00
Chris Taylor 88b5e616a9 Replace calls to window_set_visible in DoPlayerDead() with stop/start_time()
This is so game_flush_inputs() isn't called - part of change allowing player to respawn and begin moving with the same keypress. With this commit, you can use this feature with the 'when dead, respawn by pressing the Fire key' option - i.e. hold down movement key, then press fire key to respawn.
2017-02-08 12:17:51 +08:00
Chris Taylor 7ab97744c4 Remove call to game_flush_common_inputs() in game_flush_respawn_inputs()
Later commits will enable the player to press a movement key to respawn on death, then move with the same keypress. This commit makes sure the player stops moving when the key is released.
2017-02-08 12:17:51 +08:00
Kp d4f58d7bd3 Reload player object number after loading objects 2017-02-06 02:00:49 +00:00
Kp 98c9374a12 Simplify powerup_grab_cheat_all path
Movement handling has an ugly hack that tries to grab powerups near the
console player, but it reuses general collision handling and fails to
check whether the player is alive.

Add a liveness check.  Place the check so that it happens once, before
the objects are scanned, rather than being needlessly repeated for every
object.

Refactor the collision code to let the movement hack skip the parts it
does not need.

Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/302#issuecomment-275816259>
2017-02-04 23:10:29 +00:00
Kp d5634f4406 Add hack for old savegames on boss levels
Reported-by: vLKp <https://github.com/dxx-rebirth/dxx-rebirth/issues/291#issuecomment-271118416>
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/291#issuecomment-275896181>
Fixes: df5d4196e7 ("When converting object_rw to object, recompute gun points for CT_CNTRLCEN as they are now part of object and not globals anymore")
2017-02-04 23:10:29 +00:00
Kp 62778327a7 Pass cobjptridx to apply_light 2017-01-31 04:25:06 +00:00
Kp 6ac840c52c Fix pch=1 build
PCH mode causes the Valgrind-wrapper header to be included in places
it is not meant to be used, which leads to spurious compiler errors.

PCH mode causes the Valgrind-wrapper __real_* stub functions to see
the physfsx.h PHYSFS macros, which also causes errors.

Fortunately, both cases can be easily fixed.

Add preprocessor guards to the Valgrind-wrapper header to cause it to
compile out when the PCH phase runs.  It has no include guard, so it
will be rescanned with the proper macros when the two consuming files
are built normally.

Modify the Valgrind-wrapper __real_* stub functions to use
the standard macro avoidance trick so that they do not call the
physfsx.h PHYSFS macros.
2017-01-31 04:25:06 +00:00
Kp cdfe7cc308 Merge branch cheats2 into master 2017-01-31 03:57:59 +00:00
Chris Taylor e9b0ca9a83 Don't decrement trigger in remove_trigger_num if it's trigger_none
Fixes a crash when loading a level with redundant triggers and editor enabled, e.g. Passion of Death.
2017-01-30 11:08:58 +08:00
Kp 28489e0770 Merge branch baldguy into master 2017-01-29 21:17:18 +00:00
Kp 59bad96d5f Add back homing weapons cheat for D2
Kreator proposed restoring the Descent 2 cheat that grants homing
capability to all weapons.  This commit implements that proposition,
with some changes to the implementation details.

Based-on-patch-by: Chris Taylor <chris@icculus.org>
Requested-by: Chris Taylor <https://github.com/dxx-rebirth/dxx-rebirth/pull/318>
2017-01-29 21:02:48 +00:00
Kp 32760e8a8f Simplify test for weapon_info::homing_flag 2017-01-29 21:02:38 +00:00
Kp 07200620a1 Simplify test for weapon_info::homing_flag 2017-01-29 20:57:40 +00:00
Kp 9c330da29f Prevent guidebot crash on unattainable goal
Yarn reported that Descent 2: Counterstrike level 9 can place the
guidebot in a situation where

    (Escort_goal_index == object_guidebot_cannot_reach &&
    Escort_special_goal != ESCORT_GOAL_UNSPECIFIED)

If this happens and the player grabs a powerup, then the game crashes
trying to check if the grabbed powerup was of the type that the guidebot
sought.  Since the guidebot was not seeking any object, the answer is
that this is not the sought object.

The design ought not set Escort_goal_index to an invalid object index,
but it does.  Fixing that is too invasive for now.  Add a special case
to prevent this crash.

Reported-by: Yarn <http://www.dxx-rebirth.com/frm/index.php/topic,2158.0.html>
2017-01-29 18:54:52 +00:00
Chris Taylor 000ba37b42 Fix typo with cheat - should be 'ORALGROOVE' not 'ALGROOVE'
No noticeable effect in game, except that just typing 'ALGROOVE' will activate the cheat, which is different to original.
2017-01-29 15:19:02 +08:00
Chris Taylor 877cef9a20 Enable "BALDGUY" cheat for Descent 1
Typing "BALDGUY" after enabling cheats will activate the 'baldguy' easter egg for D1X-Rebirth, which will show next time a briefing is shown featuring Dravis (Mac D1 data only). As with the original, it just plays the 'Cheater!' sound with no HUD message.
2017-01-29 13:05:58 +08:00
Chris Taylor 56125b7e64 Get 'baldguy' cheat to work for Mac Descent 1 data
Pressing ALT-B when in the briefings using Mac Descent 1 data in D1X-Rebirth works again - showing Dravis wearing a silly hat. Before it would exit load_briefing_screen prematurely.
2017-01-29 13:05:57 +08:00