Commit graph

45 commits

Author SHA1 Message Date
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 5fa8c06914 Add experimental support for autosaves
Set autosave interval to 10 minutes, unless specified in the player's
configuration file.  Players can change the autosave to 0 minutes to
disable it.
2020-04-19 20:47:07 +00:00
Kp dd0f639176 Avoid reducing player's highest-level when replaying a non-MRU level
If the level was not the most recently played, a save is forced so that
it can be marked as most recently played.  However, the logic to force
the save also forced an update of the highest-level field, even if that
reduced it.

- Rename the parameter to clarify its meaning.
- Add comments explaining the logic to force the save.
- Only update the highest-level field when the update would increase the saved value
2019-08-24 04:32:24 +00:00
Kp 9898d136f1 Fix fortification crash loading missions with long filenames
The highest-level tracking code assumed filenames would always fit in a
char[9].  This was true on DOS, but has not been true in Rebirth for
many years.  Builds without fortification caused silent memory
corruption in this case.

Refuse to create highest-level entries if they would cause corruption.
Log a diagnostic telling the user that this happened.
2019-03-09 23:39:16 +00:00
Kp 6ab28cb8cb Use enum for Difficulty_level 2018-05-12 18:24:19 +00:00
Kp 7311712399 Compile out joystick key settings when DXX_MAX_JOYSTICKS=0 2017-12-05 05:29:55 +00:00
Kp a24490033f Allow players to remove thief at level start
Commit f4b21088a0 ("Track vulcan ammo explicitly") fixed an original
retail bug that prevented the thief from stealing energy weapons,
because the thief could only steal weapons for which the player had ammo
and energy weapons never have ammo.  This went unremarked for several
years, until a recent report of the new semantics as a game-breaking
regression because the thief is now "ridiculously potent".

Address this report, as well as an intermittently raised issue from
various users over time, by adding two new knobs to both the single
player "Gameplay" menu and the multiplayer setup screen: "Remove Thief
at level start" and "Prevent Thief Stealing Energy Weapons".

"Remove Thief" deletes the thief object during level load.  It has no
impact on save games, and changing it after entering a level has no
effect on any thief already in the level.

"Prevent Thief Stealing" is checked at the moment of theft and, when
enabled, prevents stealing primary weapons other than Vulcan/Gauss.
This can be changed at will in single player and is immediately
effective.  In multiplayer, this option can only be changed by the game
host in the pre-game setup.

For both knobs, there is one pair of checkboxes to control this as a
player preference, which applies in single player games.  There is a
second pair of checkboxes in the multiplayer setup, which applies only
to multiplayer games.  Therefore, in multiplayer, the host chooses thief
settings and all clients use the host's choice.  The host may configure
the thief differently in multiplayer from how the host plays in single
player.

For users who wanted to remove the thief, no specific tally has been
kept for who requested it or when.  Now that the code is being updated,
this is thrown in as an easy addition.

Reported-by: MegaDescent <http://forum.dxx-rebirth.com/showthread.php?tid=980> (for the thief stealing energy weapons as a game-breaking regression)
2017-08-26 19:47:52 +00:00
Kp d5ed019014 Add experimental MP-aware mouselook 2017-03-25 19:34:02 +00:00
Kp ec19a6947f Move more symbols to namespace dsx 2016-10-02 19:35:34 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
zico ab89dcd366 Reworked 586ba9ff6db85b976f074589c5dd7e2d6ff40cd1: Show player ping along with player kills/scores and made it a toggle for HUD configuration so the player can enable it permanently 2016-03-30 20:09:46 +02:00
Kp 9e174a0e0e Factor out primary/secondary search/reorder 2016-01-17 17:36:48 +00:00
Kp 26e948d5f1 Uninline namespace dsx 2015-12-13 18:00:49 +00:00
Kp 32051298ae Use inline namespace dcx/dsx for more symbols 2015-12-13 18:00:48 +00:00
Kp 63ca0eb87b Make respawn-on-fire configurable
Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/162>
2015-11-21 18:12:13 +00:00
Kp 5f5fd23060 Use enum class for HUD type 2015-11-14 18:17:22 +00:00
Kp 7da64d3782 Add new autoselect-while-firing mode: "when firing stops"
Mako88 reports that some users want not to autoselect while firing, but
do not notice when a new weapon is added to the HUD, and end up never
activating a preferred weapon.  Add a new autoselect mode that remembers
what would be selected and switches to it once the player ceases firing.

Changes since Mako88's proposed version:
- Use `enum class` for autoselection mode and a radio button to
  represent the decision of Immediate/Never/Delayed.
- Handle delayed autoselect for vulcan ammo.
- Set Delayed_primary == Primary_weapon to indicate no change is needed,
  rather than Delayed_primary==-1.  This lets some paths use
  Delayed_primary without checking for a magic value.
- Likewise Delayed_secondary / Secondary_weapon.
- Update Delayed_primary/Delayed_secondary when changing active
  primary/secondary weapon, so that a player who changes weapons while
  firing will automatically clear any deferred change.

Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/97>
Based-on-patch-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/pull/147>
2015-10-18 18:11:57 +00:00
Kp e2c6e8449f Factor out cloak/invul timer display 2015-10-03 17:17:49 +00:00
zico 9292431396 Merge branch 'unification/master' of github.com:dxx-rebirth/dxx-rebirth into unification/master 2015-09-27 10:52:04 +02:00
zico cbe0b4ec69 Added Cloak and Invulnerability Timers to Cockpit and Statusbar and made this feature optional (defaults to off) 2015-09-27 10:51:37 +02:00
Kp 230bc630ed Store FriendMissileView inside MissileViewEnabled
This allows it to persist silently when configuration files are read and
rewritten by versions of Rebirth which do not understand
FriendMissileView.
2015-09-26 21:17:14 +00:00
Kp d971cf7702 Wrap game-specific types in game-specific preprocessor guards
These types are not used in common code, and in some cases would provoke
a -Wodr warning if they were used.
2015-09-26 21:17:12 +00:00
zico 69353631f0 Made missile views from friendly players optional (off by default) 2015-09-26 20:28:49 +02:00
zico d3660207d2 Added Mouse Overrun Buffer option as proposed by kp 2015-09-24 16:31:10 +02:00
Kp 64ff1cda89 Only restore non-alpha when alpha was used 2015-08-21 03:12:35 +00:00
Kp 70c4cc87ab Use forward-declaration header for weapon.h 2015-07-25 23:10:45 +00:00
Kp 15fb75c1c7 Fix check_header_includes build 2015-07-25 23:10:45 +00:00
John Ackerman fe71a94d53 Implement Nonlinear Joystick Settings
[Kp: fix whitespace; squash fixes into main]
Requested-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/pull/84>
2015-06-11 01:41:26 +00:00
Kp 4e937ae239 Reduce playsave.h includes
Move non-common includes into defined(D1||D2)
2015-04-19 04:18:50 +00:00
Kp fc30cdcc9b Use ntstring for NetworkMessageMacro name 2015-01-12 00:26:02 +00:00
Kp 12770802ab Use ntstring for guidebot name 2015-01-12 00:26:02 +00:00
Kp d7d6e5728d Use array<> for ReticleRGBA 2015-01-12 00:26:02 +00:00
Kp 84011e55d2 Use partial_range when searching HighestLevels 2014-12-08 04:49:20 +00:00
Kp 3e8ec8932f Use array<> for player_config 2014-08-26 02:59:01 +00:00
zico ad7cb106bc Changed custom D1X license to GPLv3 2014-06-01 19:55:23 +02:00
Kp 073f00974a Eliminate uses of the typedef struct X { ... } X; pattern
C++ does not require this pattern.

import re, fileinput
to = re.compile(r'^typedef struct ([a-z_A-Z]+)\s*{')
tc = re.compile(r'^}(.*?)\s*([a-z_A-Z]+);$')
osn = None
for line in fileinput.input(inplace=True):
	m = to.match(line)
	if m:
		osn = m.group(1)
		print 'struct %s\n{' % osn
		continue
	if osn:
		m = tc.match(line)
		if m:
			csn = m.group(2)
			if osn == csn:
				print '}%s;' % m.group(1)
				osn = None
				continue
			else:
				osn = None
	print line,
2013-12-28 22:48:07 +00:00
Kp 86a88bedbd Use enum for CockpitMode
This makes the debugger output nicer.
2013-12-20 03:14:16 +00:00
Kp 38e92ddce0 Remove useless __pack__ on PlayerCfg 2013-12-08 00:15:13 +00:00
Kp 9de54cfa74 Switch to C++ linkage
import fileinput
guard = 0
cxxguard = '#ifdef __cplusplus\n'
for line in fileinput.input(inplace=True):
	if line == cxxguard:
		guard = 1
		continue
	if guard:
		if line == 'extern "C" {\n':
			guard = 2
			continue
		if line == '}\n':
			guard = 0
			continue
		if guard == 2:
			assert(line == '#endif\n')
			guard = 0
			print cxxguard,
			continue
	print line,
2013-12-06 03:35:32 +00:00
Kp 7dd7d6704b Make write_player_file void 2013-10-06 17:56:37 +00:00
Kp 06c83c9393 Move similar/main/gamecntl.c -> similar/main/gamecntl.cpp 2013-10-05 21:35:58 +00:00
Kp f9899a9f20 Mark various functions static 2013-10-03 03:11:51 +00:00
Kp afcbfe8e54 Rename d1x/d2x variables to unify names between D1X and D2X 2013-08-24 16:44:30 +00:00
Kp 4577dd3977 Merge branch 'd2x-rebirth/master' into unification/master 2013-07-21 21:34:46 +00:00
Kp c1b6f8ef8c Move */main/playsave.h -> common/main/playsave.h 2013-03-03 01:03:33 +00:00
Renamed from d1x-rebirth/main/playsave.h (Browse further)