Commit graph

198 commits

Author SHA1 Message Date
Kp b0cb681ae7 Add gcc-7 /*-fallthrough*/ comments for obvious cases
For switch cases where existing comments or code flow logic obviously
intended to fall through, add a gcc-7 /*-fallthrough*/ comment to
silence warnings about this.  Some cases which are less obvious are not
converted, so the code does not yet compile clean with
-Wimplicit-fallthrough.

Reported-by: parkerlreed <https://github.com/dxx-rebirth/dxx-rebirth/issues/338>
2017-06-07 02:44:54 +00:00
Kp 9cfbf44834 Pass object &to toggle_headlight_active 2017-04-22 21:23:55 +00:00
Kp 829e95b6f8 Separate hoard/proximity tracking 2017-03-18 18:07:36 +00:00
Kp a1e8d19715 Factor out screenshot save code 2017-03-10 01:22:28 +00:00
Kp b6778f65c7 Cache canvas in printscreen handler 2017-03-10 01:22:28 +00:00
Kp 8542940b24 Pass canvas to render_frame 2017-03-10 01:22:27 +00:00
Kp 673baa15e9 Clear FakingInvul when enabling real invulnerability 2017-02-26 00:00:01 +00:00
Kp 08e4a6e620 Use stdint constants for some INT*_MAX
clang becomes confused trying to determine which vm_distance_squared
constructor to use for a literal input of 0x7fffffffffffffff, even
though the size of the input requires it to be `long` and only one
constructor can take a `long`.  Switch from an explicit
0x7fffffffffffffff to the symbolic constant INT64_MAX, which has the
same value, but a platform-appropriate suffix to force the compiler to
pick the right type.

For general clarity, switch some other instances of integer maximum
literals to symbolic constants of the same value.

This commit has no effect on the generated code (except for changes to
line numbers).

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/pull/324>
Fixes: 17208cca79 ("Disallow int for vm_distance_squared")
2017-02-22 03:05:43 +00:00
Kp 859b399d20 Use mask for Secondary_last_was_super 2017-02-19 19:33:45 +00:00
Kp aeb452f715 Fold do_weapon_n_item_stuff toggle sound 2017-02-19 19:33:44 +00:00
Kp 6b8f08142f Pass canvas to LINE_SPACING
Macro LINE_SPACING previously used global grd_curcanv implicitly.
Change it to take a canvas argument.  Change all callers to pass
grd_curcanv, so that usage is explicit.
2017-02-11 21:42:42 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +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
Kp cdfe7cc308 Merge branch cheats2 into master 2017-01-31 03:57:59 +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
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 2ecc4c4a07 Remove call to window_close(Game_wind) when stopping demo playback
Replace call to window_close(Game_wind) with returning window_event_result::close to game_handler. Applies to whenever newdemo_stop_playback() is called. Closing a window within its handler is problematic - it can result in an unstable state.
2017-01-09 19:09:34 +08:00
kreatordxx f590ec45c6 Merge pull request #298 from dxx-rebirth/no_game_wind_close
Remove calls to window_close(Game_wind)
2017-01-09 09:32:24 +08:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +00:00
Chris Taylor 4cc801f42f Remove calls to window_close(Game_wind) when game finished or over
Replace calls to window_close(Game_wind) with returning window_event_result::close to game handler. Applies to when DoEndGame() is called, DoGameOver() is called, aborting in the kmatrix screen (multiplayer game) during AdvanceLevel() and playing one demo frame causes playback to stop in GameProcessFrame(). Closing a window within its handler is problematic - it can result in an unstable state.
2017-01-08 21:08:50 +08:00
Kp 2c7e36ef1e Cache KEY_M vsegptridx 2017-01-01 00:45:45 +00:00
zico 24bd4170f4 Added debug key combo DEL+M to generate a morphing robot in the player segment, rotating through all available bots. Handy for testing purposes. 2016-12-30 14:45:47 +01: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 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 f8cc32a4af Merge pull #272 into master 2016-11-26 22:51:49 +00:00
Kp 48ac006c59 Remove obsolete and broken DOOR_DEBUGGING code
This code has been #ifdef'd out since 2002, relied on implicit-int in
its declaration (deprecated in C, forbidden in C++), and has been broken
for years due to vms_vector changes.  Remove it.
2016-11-26 22:51:46 +00:00
Chris Taylor bf6eb99d7a When switching to the editor in a game, use a proper saved game
This preserves virtually all game information, including active fire. The saved game 'gamesave.sge' can also be loaded with File->Restore Game State. The level can still be saved as usual (but it warns the user if there's an unsaved game state). This functionality may be useful for testing (or cheating! ;) )
2016-11-21 15:22:11 +08:00
Kp 4497812674 Use enum for object type 2016-11-20 23:12:00 +00:00
Chris Taylor cf0065da34 More efficiently check if editor loaded properly from within a game 2016-11-13 13:34:13 +08:00
Chris Taylor ac438f4cc2 Allow the user to carry on as usual if any of the editor files are missing (i.e. before editor was loaded).
If a game was playing, continue playing. If it was in the main menu, return to the main menu. (If all files are put in place the editor can load again.)
2016-11-11 16:09:57 +08:00
Chris Taylor 143ed30fee Merging in unification/master, resolving conflict in similar/main/kmatrix.cpp 2016-11-06 14:20:18 +08:00
Chris Taylor 9511f65a90 Declare some local window_event_result vars later (clarity) 2016-10-31 14:58:34 +08:00
Kp 8a2e15e20a Add message for when user disables full map cheat 2016-10-29 23:16:18 +00:00
Kp df8f93d63e Cache player object in FinalCheats 2016-10-28 03:39:41 +00:00
Kp c8dda073ca Pass player object to transfer_energy_to_shield 2016-10-28 03:39:41 +00:00
Chris Taylor 2d587de8dc Make call_default_handler return a window_event_result
Make call_default_handler return a window_event_result to inform the event system in future, particularly if a window was closed.
2016-10-27 16:36:24 +08:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
Kp f21abc94cb Move player::hostages_on_board to player_info 2016-10-15 00:53:19 +00:00
Kp ecb91955ae Move player::score to player_info 2016-10-15 00:53:19 +00:00
Chris Taylor 60ac1eaad3 Replace delete dcx::window kludge with a better solution
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
kreatordxx b87fcad332 Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
Allow window subclasses
2016-10-03 10:36:26 +08:00
Kp ec19a6947f Move more symbols to namespace dsx 2016-10-02 19:35:34 +00:00
Chris Taylor 87617e8ac9 Allow dcx::window struct to be subclassed - step 3
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Kp 603159ec4b Pass secondary_weapon_index_t to do_secondary_weapon_select 2016-10-02 00:34:49 +00:00
Kp 3f27b6daac Pass player_info to CyclePrimary 2016-10-02 00:34:46 +00:00
Kp 2c37514235 Pass player_info to CycleSecondary 2016-10-02 00:34:46 +00:00
Kp e3c3e39045 Pass player_info to do_primary_weapon_select 2016-10-02 00:34:46 +00:00
Kp 86a4942883 Pass player_info to do_secondary_weapon_select 2016-10-02 00:34:45 +00:00