Commit Graph
77 Commits
Author SHA1 Message Date
Goober5000 a4d10a3fe4 properly handle directive with long words
A follow-up of sorts to #2801, but independent of it.  If a directive line is not split, the HUD should handle it properly rather than Asserting and displaying the same line twice.
2020-10-16 21:02:36 -04:00
Goober5000 23b3aadf9b Message size fix (#2784)
* Fix underline length calculation in message scrollback
* Use SCP_string for message source (which allows ships with long display names to work without crashing) and message text
* Upgrade assorted functions to work with SCP_string
2020-10-06 14:31:03 -04:00
CasparKielwein 7e74153a3d remove unused functions in mission code.
There where serval relics of prior refactorings like unimplemented functions.
2018-12-28 10:29:22 +01:00
Artyrm f5ba1e470c Training messages fix. Their delay could be too small with voices volume ste to 0. 2018-09-17 20:12:58 +03:00
asarium ad54f588bb Use strongly typed handles for sound handles
This is similar to the other changes I already posted. Here the sound
instance handles are converted to their own handle type which will make
it easier to use the sound API.
2018-07-16 10:21:52 +02:00
asarium 9dfb8faea3 Use strongly-typed handles for sound entries
This converts the previous int handles to a strongly-typed wrapper
handle which will make the API more self-documenting and will ensure
that wrongly used handles are detected at compile time.

I already found a few mistakes with these changes which I also fixed
here.
2018-07-03 10:43:10 +02:00
asarium eeed22b91a Enable misc-unused-parameters
clang-tidy was used for fixing the warnings. It is not clear if this is
actually an improvement so this may still be disabled later.
2018-04-25 11:57:55 +02:00
asarium e28ebc2a6c Enable and fix misc-suspicious-string-compare check 2018-04-25 11:13:19 +02:00
asarium 0ff8a2c159 Add support for multiple sounds in one game sound entry
This adds support for specifying multiple sounds for a single game sound
entry. The engine then selects which sound will be played based on the
strategy provided by the game data. This required a few changes to some
of the game code since previously every game sound had exactly one sound
file attached to it. The most notable change is that it is no longer
possible to determine the exact duration a sound can have so instead the
new code computes the maximum duration a sound can have and uses that
where appropriate.

This also adds support for randomizing the pitch and volume of the sound
to provide a more varied experience even if only a single sound is used.

One possible issue that exists is that the "sequential" strategy only
works globally at the moment so if two sources use the same game sound
concurrently then the two sources will share the sequence of sounds
since there is no sound instance data at the moment. That can be added
in a future change but should not present a huge issue for most
use-cases.

Visual Studio on Appveyor somehow causes deprecation error on _our_
definition of vsprintf. I have no idea why these changes introduced this
warning but I won't debug Visual Studio compiler bugs that I can't
reproduce with my Visual Studio version so I just disabled those
warnings.
2017-10-17 10:57:22 +02:00
asarium 07107ce9b2 Fix newly introduced format warnings 2017-03-15 19:34:11 +01:00
MageKing17 b91e3c6ab1 Remove unhelpful assertions from comp_training_lines_by_born_on_date().
If an event with a directive contains both an is-destroyed/is-destroyed-delay for a wing with multiple waves AND the event's Sexp_useful_number is 0 (either the event contains an "is-event-*" SEXP (or one of the "-delay" ones with the optional third argument not set), and that SEXP didn't return true, or some part of the event evaluated to SEXP_CANT_EVAL) AND the wing currently has 0 ships in the mission (so Directive_count gets set to DIRECTIVE_WING_ZERO to mark the directive as being "temporarily" true, until the next wave arrives), then the directive winds up in the list of displayed directives without actually having a born_on_date set, so it fails this assertion. Since this is caused by the data supplied (in the mission) rather than a coding mistake, and since this assertion doesn't actually seem to be guarding against anything (because nothing bad happens if the comparison happens anyway, just with a born_on_date of 0), and it behaves just fine in Release builds where the assertion isn't checked, the simplest solution would seem to be to just remove the assertions altogether.

Found this issue while testing with demo data, so blame whatever Canadian wrote the first demo mission to make the "Destroy Libra" event check for either Libra being destroyed OR an event (that can't ever become true until after at least one wave of Libra gets destroyed) becoming true.
2017-01-24 12:03:06 -08:00
asarium 9a8bfc0217 More const correctness 2017-01-02 13:17:59 +01:00
Fabian Woltermann 770fce8de5 Bitset flags -- take 2 (#775)
This introduces a new mechanism for handling bit flags. Instead of using an int (or two, or three) to write bits into, this uses the std::bitset in a wrapper class that accepts an enum class as input. This means that certain classes of errors we've had a few of in the engine, where a coder used the wrong set of flags or checked them against the wrong variable (SF_STEALTH vs SIF_STEALTH, for example) can now be detected at a compiler level rather than not at all.
2016-08-12 16:13:50 -07:00
asarium 0cabe71fdd More 64-bit MSVC warning fixes 2016-08-10 13:33:12 +02:00
Echelon9 a7e6be3368 Simplify duplicative mission/ includes. 2015-06-22 20:24:30 +10:00
Echelon9 c5493bb480 Scripted sort and uniq on (internal) project includes. Improves search time and as a by product removed a number of duplicative includes. 2015-06-22 20:24:30 +10:00
Goober5000 886018d28f here a const, there a const, everywhere a const const
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9801 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:46:41 +10:00
karajorma e83c18a7f9 Clear out some cruft from the multiplayer code. Make sure Macros are being used. 2012-11-03 08:25:27 +00:00
Swifty a3fafcb248 Added Bottom Background Offset: and Max Line Width: to Directives gauge. 2012-09-10 06:23:46 +00:00
niffiwan a66665dd73 remove memsets on game_snd vars - struct now has vectors in it... 2012-08-02 10:17:32 +00:00
niffiwan 09c4bc2b00 GCC Warnings: mission/missiontraining.cpp - variable set but not used 2012-06-11 09:56:13 +00:00
niffiwan c8c0a213bf GCC Warnings: mission/missiontraining.cpp - variable defined but not used 2012-06-11 09:51:16 +00:00
niffiwan a6d501de98 Fix for last bit of mantis #2410: show training messages when hud-disabled-except-messages 2012-06-11 03:45:12 +00:00
The_E 17a99ac973 Partial fix for 2410: Fixes Directive gauge ignoring hud-disable-except messages 2012-05-10 21:38:15 +00:00
karajorma caf038d3fc Commit game_settings.tbl / -mod.tbm 2012-02-29 07:13:49 +00:00
Swifty 3affb86b52 Removed configOverride from HudGauge class since we don't even use it. 2012-02-05 03:41:31 +00:00
karajorma fb561c55c3 Remove a magic number. This number will probably become something defined in mod.tbl eventually but for now at least it's easy to find again. 2011-12-31 06:51:21 +00:00
The_E 8b65d3e3ce Patch for Mantis 2391 (again): Removes a few leftovers from the old HUD code that generated warnings unnecessarily. 2011-11-15 23:25:50 +00:00
Swifty 0ab6ecd58c Further fix for Mantis 2500. Directives should now be using sexp overrides. 2011-09-22 06:28:49 +00:00
Echelon9 8a4482c827 PVS-Studio fix (courtesy of niffiwan): V523 The 'then' statement is equivalent to the 'else' statement (missiontraining.cpp). 2011-08-30 13:06:28 +00:00
Echelon9 555a9033de Documentation: General clean-up and function documentation 2011-08-18 16:47:54 +00:00
Swifty 6488b73b0a Corrected directive gauge to use both X and Y offsets. 2011-07-14 07:08:53 +00:00
The_E ceb68d44bd Fix for Mantis 2240 (HUD anis and training messages do not display if hud_disable_except_messages is active) 2011-04-15 12:16:17 +00:00
The_E 9b580610ca Fix for Mantis 2409 (Directive gauge is rendered despite hud-disable-except-messages) 2011-04-04 13:07:17 +00:00
Zacam 09fad95070 Antipodes 7 Merge: HUD Overhaul, by Swifty. 2010-12-12 20:34:15 +00:00
The_E a1ecfe158b Adding the adjust-audio-volume sexp. 2010-08-19 19:45:28 +00:00
The_E 4d5008fcc1 Fix for Mantis 2263 (Objectives list is still displayed despite disable-hud-except-messages being active) 2010-07-17 14:59:32 +00:00
Backslash 5263673023 Add a $Max Directives: option to hud_gauges.tbl -- works just like $Max Escort Ships 2010-06-26 19:34:59 +00:00
Goober5000 04436d634f remove message from queue the correct way, thus fixing the training message crash 2010-05-19 04:28:43 +00:00
Goober5000 c5e3600bef reverted fix. It has problems, which is why I'm going over it first. 2010-05-16 22:26:58 +00:00
The_E acdc56272b Committing IssMneur's fix for Mantis 2183. 2010-05-16 15:40:11 +00:00
karajorma a2afa2b67a Switch to using the Macros for Multiplayer modes whenever possible. 2010-04-27 13:42:59 +00:00
chief1983 7846af6c24 No 2-arg asserts on Linux. 2010-04-19 23:32:52 +00:00
Goober5000 e537b1e133 merge Iss_Mneur's fix for Mantis #2178 (Assertion in missiontraining.cpp) 2010-04-19 03:49:09 +00:00
Echelon9 9824b21218 Revert r5760 training_message_queue changes 2010-01-07 17:21:44 +00:00
Echelon9 c2b601bd5c Rename function to correctly reflect what it does 2010-01-02 13:32:43 +00:00
Echelon9 67b86f7377 Make Training_Message_Queue dynamic with SCP_vector 2010-01-02 13:28:56 +00:00
portej05 98f337f701 safe_strings - from Antipodes build #1 2009-07-27 16:06:24 +00:00
portej05 719825f80d The big CVS comment removal. This chops approx. 3.5mb off a full checkout.
I've tested this through compiling and through hand checking. 
Normalises line endings in ALL files to \n.
2009-06-20 08:08:20 +00:00
karajorma 104d7895ba Fix for Mantis 1234 2007-08-19 22:15:41 +00:00