Compare commits

...
Author SHA1 Message Date
SirKnightly 84752b4d51 Automated build commit 2024-04-17 20:38:35 +00:00
JohnAFernandez d74627ba61 Remove version_override.cmake
This will hopefully allow the point release to succeed.
2024-04-17 16:36:13 -04:00
JohnAFernandez e21cc10c5e Update Release Mako with Previous Thread 2024-03-25 22:54:52 -04:00
Asteroth b5fe16081d fix an issue with animation directions 2024-03-25 22:54:52 -04:00
mjn-mixael 41bff809e3 Don't init the debrief ui in API mode 2024-03-25 22:54:52 -04:00
mjn-mixael f119f3d370 Default post processing to on because so many things require it 2024-03-25 22:54:52 -04:00
Joshua Glatt a90a0a55bd Handle container data correctly with eval_num() (#6031) 2024-03-25 22:54:52 -04:00
Joshua Glatt d08d8b4b02 fix crash when right-clicking on container modifier (#6030) 2024-03-25 22:54:52 -04:00
Mike Nelson f1292ad15a Push back instead of direct assignment (#6024)
* push back instead of direct assignment

* remove i
2024-03-25 22:54:51 -04:00
wookieejedi eb911c8ca2 Fix CTD with HUD Preset Switching (#6022)
* Fix CTD with HUD Preset Switching

After #5302 it was discoved that pressing the `Next` button in the HUD presets would cause a CTD.

Thanks for Lafiel for figuring this out
`If HC_current_file is HC_preset_filenames.size() - 1, then it'll oob on a vector access.`

Testing this PR fixes that crash.

* use static cast
2024-03-25 22:54:51 -04:00
MageKing17 125de7f131 Fix SSM strikes with a variable count.
In #2464, a somewhat hard-to-understand equation involving taking the modulo of a random number was replaced with a function that would do those calculations instead. The problem is that the function performed the *entire* formula, while the code it replaced was only operating on the *difference* between the two numbers. Fortunately, this is as easy to fix as changing a `+=` into just an `=`.
2024-03-25 22:54:51 -04:00
Birk Magnussen 78d0bddbe1 Add comment on MAX_OBJECTS 2024-03-25 22:54:51 -04:00
Birk Magnussen b009991fae Increase collision pair cache bitshift 2024-03-25 22:54:51 -04:00
Goober5000 f2806dc77a fix "this ship name is already in use" bug
This rather insidious FRED bug was all down to an improper check for the current ship.  It is possible for multiple objects of different types to be selected at the same time.  If, for example, a waypoint and ship are selected, and the waypoint was selected first, the waypoint will be what `cur_object_index` refers to.  Since the ship is the one and only ship selected, it will be what `single_ship` refers to.  Therefore, to avoid flagging its own ship name as a duplicate, the loop should exclude the single ship, not the current object.

The bug can be reliably triggered by selecting a waypoint, then adding a ship to the selection, then switching the focus to another application and back to FRED.  This finally squashes the bug.
2024-03-14 17:03:17 -04:00
SirKnightly 6cbf0fbbf8 Automated build commit 2024-02-26 02:47:29 +00:00
MageKing17 3a48613a2d Add some security to avoid invalid Random::next() calls. (#5988)
There were a few instances of `Random::next()` being called without ensuring its arguments couldn't trip an assertion. This should hopefully catch them all.
2024-02-14 15:03:51 -05:00
Goober5000 99875810c6 Merge pull request #5986 from Goober5000/24_0_RC2_edits
edit the release template
2024-02-11 01:53:27 -05:00
Goober5000 13420121dd edit the release template
A bit of wordsmithing and link updating for the release thread.
2024-02-10 00:34:28 -05:00
Goober5000 26c5152d4a Merge pull request #5985 from Goober5000/pof_file_valid_fname_checks
make model file checks consistent
2024-02-09 17:24:08 -05:00
BMagnu 5066e498a3 Virtual POF fixes (#5984)
* Fix wrong filename being used

* Fix replacement map not used for collision check

* Fix poly count and incorrect submodel numbers
2024-02-09 23:10:39 +01:00
Goober5000 4bf806c485 make model file checks consistent
The general expectation is that model filenames can be specified as 'none' or '<none>' for no model, but as discovered by no tea, this was not consistent across the code base.  For example, `$Model File: none` was handled as expected but `$External Model File: none` was not.  This PR makes the handling consistent for all ship, weapon, and shockwave POF files, and also adds some extra checks when models are loaded.
2024-02-09 17:00:45 -05:00
Goober5000 2403f13483 Merge pull request #5983 from Goober5000/fred_popup_enhancement
fix FRED's "new object type" popup
2024-02-09 00:29:52 -05:00
Goober5000 8e98cddd6e Merge pull request #5982 from Goober5000/issue_5980
address issue 5980
2024-02-08 12:56:54 -05:00
Goober5000 30cabc4174 fix FRED's "new object type" popup
1. Fix the item ID indexing on the popup submenus and make sure they correspond with the ship dropdown menu
2. Remove the "player start" popup menu option as it has very limited utility and was already removed in qtFRED
3. Reduce a bunch of casts by using more appropriate popup menu types
4. Actually place an object in the mission when one is chosen from the popup menu

Also:
1. Remove the `Default_player_model` variable as its use is redundant
2. Remove unused arguments of `create_player()`
2024-02-08 03:26:25 -05:00
Goober5000 8a3b36d921 uncorrect angles if we're saving without the corrected angles flag (which will happen if the save format isn't STANDARD) 2024-02-07 22:51:37 -05:00
Goober5000 b74824f793 use a different method for removing blank backgrounds 2024-02-07 18:27:52 -05:00
Goober5000 6a26ca5061 only display these warnings once, and only on explicit save 2024-02-07 18:27:52 -05:00
John Fernandez d34570ae90 Merge pull request #5979 from MjnMixael/fix_select_zoom
Unhardcode renderSelectModel zoom value
2024-02-06 23:40:41 -05:00
mjn-mixael a0f4c4d2b3 documentation error 2024-02-05 16:20:33 -06:00
mjn-mixael 63990c54a9 unhardcode zoom value 2024-02-05 16:14:07 -06:00
Goober5000 6593565165 Merge pull request #5976 from notimaginative/fix_cmdline_mod_on_unix
refactor unix modlist handling to fix serveral issues
2024-02-05 17:00:59 -05:00
Goober5000 af93922ba5 Merge pull request #5975 from notimaginative/fix_chdir_bug
fix error handling in cfile_push_chdir()
2024-02-05 17:00:47 -05:00
Fabian Woltermann daeb1a7940 Merge pull request #5977 from BMagnu/shadow_map_ifdef
Fix faulty / missing optimization for AMD shader compilation
2024-02-05 18:34:08 +01:00
Birk Magnussen f56cbc59f1 improve shader for shadow map generation 2024-02-05 14:43:54 +01:00
Taylor Richards 79418a073d use proper SCP types 2024-02-05 00:04:34 -05:00
Goober5000 ce2e165510 Merge pull request #5962 from Goober5000/warp_duration_fixes
fix warp time durations
2024-02-04 23:49:15 -05:00
Goober5000 e9ee311709 fix warp time durations
Properly set the warp durations when ships arrive and depart, so that the warp animation can open and close smoothly without any discontinuities.
2024-02-04 23:30:22 -05:00
Taylor Richards 7576d4f2fe refactor unix modlist handling to fix serveral issues
The result of this special parsing should produce a mod string identical
to the string passed on the command line with the following exceptions:
  directory name case, directory separators

Should address the following:
 - no fundamental difference in modlist compared to Windows
 - no errors or warnings that are not produced on Windows
 - do not remove mods from list if missing
 - verify mod directory is accessible and actually a directory
 - do minimum amount of work to see if mod directory is valid
 - fix bug with trainling slashes
2024-02-04 22:08:28 -05:00
Taylor Richards 866b06ca35 fix error handling in cfile_push_chdir()
Old Volition bug where the original directory is pushed onto a stack
before the chdir() call. If that call fails then the stack is left with
a used entry that won't be removed until restart and can cause the stack
to fill up. Now it's added only if the chdir() call succeeds.

Also take the opportunity to make Cfile_stack dynamic.
2024-02-04 22:03:56 -05:00
Goober5000 f3d15f8ddc Merge pull request #5972 from Goober5000/send_message_clarification
update sexp help for send-message
2024-02-04 15:19:10 -05:00
Goober5000 c9fe191d31 Merge pull request #5973 from Goober5000/modular_medals_fix
ensure medal information is correctly assigned
2024-02-04 15:18:53 -05:00
John Fernandez bad255fffb Merge pull request #5970 from Goober5000/sexp_exited_refinement
be mindful of death rolls when checking for ship stats
2024-02-03 23:31:01 -05:00
Goober5000 be260ef74c ensure medal information is correctly assigned
Make sure all medal fields are properly assigned.  In particular, if a modular -mdl.tbm is parsed, don't overwrite information from the base medals.tbl.  Fixes a bug reported in Discord.
2024-02-03 21:25:05 -05:00
Goober5000 0ac3d52261 update sexp help for send-message
Clarify message priorities, especially the conditions that allow High messages to be sent by Command.  Motivated by #5968.
2024-02-03 19:14:40 -05:00
John Fernandez f7df03c654 Merge pull request #5932 from Dark-Visor/sexp_ship_helps_final
Clarify which SEXPS work on ships not arrived
2024-02-03 17:14:34 -05:00
John Fernandez a7e1a27e36 Merge pull request #5963 from MjnMixael/fix_custom_string_dlg
Fix assert when adding custom strings
2024-02-03 16:03:56 -05:00
Goober5000 ab319a631c be mindful of death rolls when checking for ship stats
In #5649 / b6c0e8b, the ship registry was updated to take ship death rolls into account.  There was one small wrinkle that it did not account for, however: SEXP operators that return numeric values had previously (i.e. before the introduction of the ship registry) checked the mission log for ship destruction, but after #5649 the EXITED status was not set until after the ship had completely exploded, resulting in certain SEXPs having their conditions slightly modified.  The equivalent of checking the mission log for ship destruction is now checking the ship status for DEATH_ROLL, so it is necessary to make that change for the numeric SEXPs to behave as they did before.

The motivating result for all this is to fix SEXPs like `hits-left` firing after a ship has been destroyed but before it has finished exploding.  This can be seen by loading the first non-training mission of FSPort and comparing the messages that are sent if you use cheats to kill Alpha 2.
2024-02-02 16:51:38 -05:00
John Fernandez 7c2950480e Merge pull request #5969 from Goober5000/fix_blink_locked_anim
fix Blink Locked Animation: option
2024-02-01 07:48:00 -05:00
Goober5000 a80bc26bfc fix Blink Locked Animation: option
Due to a copy-paste error in #4581, this option was not set properly.
2024-02-01 02:08:56 -05:00
John Fernandez ead3c62d23 Merge pull request #5966 from MjnMixael/unfocused_pause_again
Prevent compiler optimization
2024-01-30 22:22:19 -05:00
mjn-mixael 5cd502fb79 prevent compiler optimization 2024-01-30 15:26:25 -06:00
Dark-Visor 905d777e18 Update to wording of sexp helps PR
Clarify wording on SEXP helps so that it is clear whether an Event will
be evaluated or have delayed evaluation.
2024-01-30 21:12:14 +00:00
Dark-Visor 66deb83980 Clarify which SEXPS work on ships not arrived
SEXP helps should let the FREDder know whether a given ship argument
needs to be already in-mission for the SEXPression to operate. Update
the helps to include (ship needs to be in-mission) or (ship does not
need to be in-mission) or other relevant helpful information.
2024-01-30 21:12:14 +00:00
mjn-mixael de3e382180 better defense 2024-01-30 08:11:58 -06:00
mjn-mixael 0190fda7ee fix assert when adding custom strings 2024-01-30 08:11:58 -06:00
Goober5000 9651dc1598 Merge pull request #5957 from Goober5000/fix_subsystem_message
fix ship subsystem parse warning
2024-01-29 22:53:18 -05:00
Goober5000 743cf779bf Merge pull request #5961 from Goober5000/another_gravity_fix
Third gravity fix
2024-01-29 22:38:49 -05:00
Goober5000 89a6e2aa7d fix ship subsystem parse warning
As reported by Trivial Psychic, if the number of subsystems exceeds the max as the result of a modular table, the error message was very misleading.  This fixes the error message and also makes it report the correct number of parsed subsystems.
2024-01-29 22:04:25 -05:00
Goober5000 84033d901c Third gravity fix
`ai_get_weapon` is not guaranteed to return a valid `wip`, so check for that here.  This should now cover all uses of `ai_get_weapon` in the codebase.

Fixes an Event Horizon crash reported in Discord.  Follow-up to #5842, commit 8dbe0e7.
2024-01-29 22:04:02 -05:00
John Fernandez 4b49123070 Merge pull request #5965 from notimaginative/fix_linux_build_image
switch to new linux build image
2024-01-29 16:36:40 -05:00
Taylor Richards 213bcbc80b find&replace ALL the things 2024-01-29 15:04:47 -05:00
Taylor Richards 0da34f0bc8 switch to new linux build image
Upgrades to Ubuntu 20.04 to fix Node v20 problem.
Bumps compiler to gcc-9.

NOTE: This breaks support for Linux distros older than Ubuntu 20.04
2024-01-29 14:57:38 -05:00
John Fernandez 8fcf385e7e Merge pull request #5955 from MjnMixael/no_ui_pause
Pause the UI properly based on user settings
2024-01-28 00:53:37 -05:00
mjn-mixael 4f4722ccad also pause the UI properly based on user settings 2024-01-25 13:14:24 -06:00
John Fernandez 7d94561ea5 Merge pull request #5920 from MjnMixael/properly_check_windowed
Properly check if we're running in a windowed mode
2024-01-25 00:21:43 -05:00
John Fernandez 248cec7cf9 Merge pull request #5921 from MjnMixael/save_multi_settings
Save these to the ini file
2024-01-25 00:20:50 -05:00
John Fernandez e987d1cd7b Merge pull request #5929 from MjnMixael/clean_cutscene_info
Cleanup ui cutscene api
2024-01-25 00:20:18 -05:00
John Fernandez f1aa29551b Merge pull request #5954 from MjnMixael/fix_discord_option
Fix discord option needing restart
2024-01-24 17:21:34 -05:00
Goober5000 76734fb5ed Merge pull request #5946 from Goober5000/splash_fix
fix splash crash and add supplemental script hook
2024-01-24 14:42:29 -05:00
mjn-mixael fb0a62c400 fix discord option needing restart 2024-01-24 10:07:37 -06:00
Goober5000 1403301b65 add variable to prevent any hooks from running until OnGameInit has run 2024-01-23 14:51:06 -05:00
John Fernandez 1d1eb5ec4d Merge pull request #5952 from MjnMixael/fix_custom_string_save
Fix custom string saving
2024-01-23 14:29:45 -05:00
Goober5000 7283412880 Merge pull request #5953 from Goober5000/fix_fire_at_coords
fix crash in fire-beam-at-coordinates
2024-01-23 00:40:12 -05:00
Mike Nelson 1d2ca8eb5a print option settings to the log (#5914) 2024-01-23 00:40:04 -05:00
Goober5000 130ddb41f1 Merge pull request #5947 from JohnAFernandez/keep-observers-from-crashing
Fix: Keep Chase view from crashing in multi
2024-01-23 00:13:07 -05:00
Goober5000 9462241c0b Merge pull request #5948 from BMagnu/fix_msaa_compile
Fix MSAA for some graphics drivers
2024-01-23 00:12:58 -05:00
Goober5000 14bba9aea1 fix crash in fire-beam-at-coordinates
A small oversight in #5837 - beam jitter is not done when targeting coordinates.
2024-01-23 00:07:33 -05:00
mjn-mixael c7b43b0e0e fix custom string saving 2024-01-22 12:18:25 -06:00
Birk Magnussen 1355c484fe Remove language-defined declaration 2024-01-19 22:15:29 +01:00
JohnAFernandez 1866c6adb5 Whoops, forgot to push typo fix 2024-01-19 01:49:43 -05:00
JohnAFernandez a11517984e Keep Chase view from crashing
For Observers in multi
2024-01-19 01:29:08 -05:00
Goober5000 f207d2d12c add new On Splash End hook for scripts that have been doing post-splash stuff in On Game Init 2024-01-18 17:00:02 -05:00
Goober5000 4970252e9f tweak initialization sequence to head off potential future problems 2024-01-18 16:51:36 -05:00
Goober5000 d789e9b33a fix crash caused by incomplete script initialization 2024-01-18 00:43:14 -05:00
Fabian Woltermann 292f7d3b03 Merge pull request #5938 from MjnMixael/unload_pilot_scpui
Fix SCPUI overwriting campaign data
2024-01-15 19:09:47 +01:00
mjn-mixael 3bfc37172a Expose unloading a player and campaign file 2024-01-14 22:32:25 -06:00
Goober5000 2bb1c10557 Merge pull request #5916 from Goober5000/number_hack_upgrade
upgrade the OPF_POSITIVE number hack
2024-01-14 19:19:16 -05:00
Goober5000 40fac5dd5f Merge pull request #5838 from Goober5000/turret_constify
constify some turret code
2024-01-12 20:46:03 -05:00
John Fernandez 2a33e374c2 Merge pull request #5926 from MjnMixael/is_movie_playing
LUA method to check if a movie is currently playing
2024-01-10 02:52:31 -05:00
mjn-mixael d48d00d946 static cast 2024-01-09 08:11:03 -06:00
mjn-mixael 562875130c Cleanup ui cutscene handling 2024-01-08 13:57:51 -06:00
mjn-mixael 4401101fea lua method to check if a movie is currently playing 2024-01-07 14:41:01 -06:00
mjn-mixael 509f887f6c Save these to the ini file 2024-01-05 17:04:58 -06:00
mjn-mixael 266079997a remove unused code 2024-01-05 13:31:31 -06:00
mjn-mixael f4a3903478 properly check if we're running in a windowed mode 2024-01-05 13:13:24 -06:00
Taylor Richards f4202df450 codesign Mac builds to prevent broken app message (#5919)
Apple Silicon Macs require that all code is signed in order to run. Our builds
are partially signed due to the SDL framework already being signed, so it is
seen as broken. To fix that we need to codesign all the rest of the necessary
files with an ad-hoc signature in order to allow the builds to work properly.
2024-01-04 22:25:59 -05:00
Goober5000 e619c0c3d3 Merge pull request #5910 from Goober5000/campaign_load_refactor
campaign error message improvement
2024-01-04 21:51:24 -05:00
Goober5000 ff0b79b6be move this and make it static 2024-01-04 13:49:27 -05:00
Goober5000 701d20c112 upgrade the OPF_POSITIVE number hack
This is a new method of ensuring that OPF_POSITIVE numbers are positive.  It works for all numeric arguments, including variables and literals, and caches the status of the node to avoid lookups for every negative number on every frame.  Tested on both operator and non-operator cases.

Follow-up to #5915.
2024-01-04 13:43:19 -05:00
Goober5000 9a45c9fd05 Merge pull request #5915 from Goober5000/number_hack_update
restore number hack sign checking in all builds
2024-01-04 13:41:47 -05:00
JohnAFernandez 146102e82c Merge pull request #5909 from Goober5000/remove_mht
remove mainhalltemp
2024-01-04 11:33:41 -05:00
Goober5000 be2c18d608 add back exceptions 2024-01-03 18:46:10 -05:00
Goober5000 c9644cdcae Merge pull request #5913 from Goober5000/5911_followup
5911 followup
2024-01-03 18:03:05 -05:00
Goober5000 d088e895f8 restore number hack sign checking in all builds
Operators that specify OPF_POSITIVE should be guaranteed to get positive numbers.  This code was previously disabled for performance reasons, but following the contract of the SEXP system is more important.  A future PR will improve the performance of the functions used here.

Also, the `num-players` operator takes no arguments, so fix that.
2024-01-03 14:24:43 -05:00
Goober5000 f1a9b2639b 5911 followup
In consultation with @BMagnu, code that validates data in the POF file itself should happen in `read_model_file_no_subsys`, as virtual POFs rely on their source files having correct data.  I've added comments and slightly rearranged things to make this clearer, and also moved the new code from `read_and_process_model_file`.  Additionally, I fixed two bugs by changing `parent > pm->n_models` to `parent >= pm->n_models` and adding a newline to the `nprintf`.
2024-01-03 11:34:18 -05:00
Fabian Woltermann a1690dcb90 Merge pull request #5911 from The-E/fix/invalid_eye_point_data
Fixes an issue with faulty eyepoint data causing a crash.
2024-01-03 14:45:26 +01:00
Fabian Woltermann 2c4088efdd Fixes an issue with faulty eyepoint data causing a crash. 2024-01-03 13:50:23 +01:00
Goober5000 da3725a3ac Merge pull request #5902 from Goober5000/refine_number_checking
refine numeric error checking in FRED
2024-01-03 00:00:22 -05:00
JohnAFernandez 81b7460e57 Merge pull request #5908 from MjnMixael/lua_enum_validation
Add some better error and validation checking to lua enums scripting API
2024-01-02 23:41:58 -05:00
Goober5000 c9a1127764 fall back to default campaign when starting the game or choosing a new pilot 2024-01-02 02:27:37 -05:00
Goober5000 6eb9ae2aec remove mainhalltemp
These files are not referenced anywhere and haven't been used since before FreeSpace 2 was released.
2024-01-01 23:51:45 -05:00
Goober5000 d3d9ee3092 refine campaign failure error messages 2024-01-01 17:41:42 -05:00
Goober5000 f66fc92859 int to boolean 2024-01-01 17:41:42 -05:00
Goober5000 94cbc350a4 handle main hall if campaign could not be loaded 2024-01-01 17:41:42 -05:00
Goober5000 550e9ec5b2 distinguish between corrupt and missing campaign files 2024-01-01 17:41:30 -05:00
mjn-mixael de3463958d Add some better error and validation checking to lua enums 2024-01-01 13:27:11 -06:00
Asteroth 03d7845124 improve comments (#5903) 2023-12-31 15:56:41 -05:00
Goober5000 661dceb0d8 Merge pull request #5906 from Goober5000/fix_vr_aspect_lock
additional HUD fixes for VR
2023-12-31 12:53:59 -05:00
m!m 202686dab6 Merge pull request #5907 from asarium/fix/balanceLuaStack
Fix unbalanced stack when retrieving Lua main thread
2023-12-31 18:18:41 +01:00
asarium b8da1106eb Fix unbalanced stack when retrieving Lua main thread
After getting the main state from the Lua registry, this function had
two Lua thread values on its Lua stack but we only removed one which
lead to a value being left on the stack.

Why did this not blow up before? Because undefined behavior.

The only place where this was called was when creating a Lua reference
value where luaL_ref is called in the same expression (see
UniqueLuaReference::create). The evaluation order of the parameters for
the make_shared call is not defined by the standard and for some reason
all major compilers (except clang) choose to execute the luaL_ref call
before the getMainThread call.

For those compilers, everything is fine. We have some extra values on
the Lua stack but that gets cleaned up after the API function finishes.

However, clang first evaluates the getMainThread which leaves an extra
Lua thread on the Lua stack. The luaL_ref call then references this
thread value instead of the intended value. In the concrete case, this
meant that LuaFunction saw that the reference points to a thread and
rightfully threw an exception.

This fixes #5904.
2023-12-31 17:44:58 +01:00
Goober5000 43f7921121 additional HUD fixes for VR
Use a single canonical `frametime` value for all HUD rendering, in both `hud_render_preprocess` and `hud_render_all`.  Previously, certain functions called through `hud_render_preprocess` were using the full frametime, rather than the half frametime needed for VR when the HUD is rendered twice.

Fixes #5882.
2023-12-30 20:35:15 -05:00
Goober5000 f4669db41c constify some turret code
Apply `const` to a whole bunch of functions.  Also change a bunch of ints to bools.
2023-12-30 00:00:31 -05:00
Tyler Blount b3df3364e4 Merge pull request #5837 from Goober5000/turret_refactor
untangle turret code a bit
2023-12-29 21:31:51 -07:00
Goober5000 b6a76b788d reuse beam points for collision test 2023-12-29 16:51:36 -05:00
Goober5000 e21b07662e refactor 'share fire direction'
Use a simpler, more robust, and more correct method of sharing the fire direction among beams: replicate the actual beam vector for all firing points.  This further cleans up and simplifies the beam firing code and also clarifies some vector math.
2023-12-29 16:35:34 -05:00
Goober5000 9b4b0b552b fix use of target position, and also don't get gvec if we don't need it 2023-12-29 16:34:22 -05:00
Goober5000 bdab7a0c55 untangle turret code a bit
1. make `check_ok_to_fire` return a boolean (like `check_los`)
2. make `check_ok_to_fire` and `check_los` both use a position argument since we don't need the whole turret
3. remove the redundant position prediction code from `ship_get_global_turret_gun_info` (since that needs to be a "pure" function) while making sure "share fire direction" still works
4. skip calculation of the vector in `ship_get_global_turret_gun_info` if we don't need it
5. move the position prediction code out of `aifft_rotate_turret` and into its own function
6. prune some gun position calculation calls since in most cases one will suffice
7. fix position "jitter" with weapon subsystem damage in missions that use gravity
8. `model_rotate_gun` now uses a nullptr position for a reset instead of an extra boolean argument
9. use a more efficient method to calculate gun barrel length
10. a couple variable name changes for clarity
2023-12-29 16:28:24 -05:00
Goober5000 e269cdab6e Merge pull request #5863 from Baezon/beams-respect-hull-check-self-damage
Make beams respect 'check hull' and 'can damage shooter' flags
2023-12-29 16:27:50 -05:00
wookieejedi edc76bcb40 Fix typo in lua error prints (#5901)
2 line typo fix `refere` -> `refer`
2023-12-29 13:42:35 -05:00
Goober5000 cbde5a8e85 refine numeric error checking in FRED
1. Allow a `+` to appear in front of numbers, just as with `-`
2. Check for `.` and `,` within numbers to give a less misleading error message than "not a number"
3. The old number hack inadvertently skipped numeric literals, so specifically check for those
2023-12-28 14:46:47 -05:00
Goober5000 7fcfc35820 Merge pull request #5898 from Goober5000/invalid_point_message_fix
make error messages more accurate
2023-12-24 14:31:06 -05:00
Goober5000 f852421d76 update messages per feedback 2023-12-24 13:27:51 -05:00
Goober5000 2321311725 make error messages more accurate
There are several SEXP argument types that themselves encompass multiple argument types: for example, ships and wings.  This could be misleading when there is an error message displayed.  So, this updates the error codes to explicitly cover all of the possibilities.
2023-12-24 13:27:51 -05:00
JohnAFernandez 733e1adcba Merge pull request #5892 from JohnAFernandez/Fix-Coverity-Workflow
Fix Coverity WorkFlow
2023-12-20 16:17:29 -05:00
Goober5000 485eb16fe3 Merge pull request #5827 from Goober5000/delay_status_tweak
tweak event status evaluation when the game is not in-mission
2023-12-19 19:34:35 -05:00
John Fernandez a493f07333 Fix Coverity WorkFlow
By using app image and switching to Checkout V1.

Also removes Vulkan SDK install, since it seems to be taken care of by the app image or is disabled.  I can't figure it out from the app images.
2023-12-19 12:12:56 -05:00
JohnAFernandez 366c1a9d0b Merge pull request #5891 from MjnMixael/self_credits_update
Self Credits update
2023-12-18 13:31:18 -05:00
mjn-mixael 0594a487c8 credit with my real name instead of online handle 2023-12-15 14:38:26 -06:00
JohnAFernandez f8733eab72 Merge pull request #5890 from MjnMixael/fix_obt_table
Make internal table file match updated parsing preference
2023-12-15 14:23:55 -05:00
mjn-mixael 8dcc4a24e9 make internal table file match updated parsing preference 2023-12-15 13:04:25 -06:00
Goober5000 bf4d7a3114 Merge pull request #5888 from Goober5000/fix_qtfred_option
fix crash in QtFRED
2023-12-14 20:57:10 -05:00
Goober5000 5e8a4f754d fix crash in QtFRED
Not sure how this option became false, but it should be true in order for the checkable menu option to be set up properly.
2023-12-14 18:56:10 -05:00
JohnAFernandez d0a537ff82 Merge pull request #5868 from MjnMixael/more_scpui_options
More scpui options
2023-12-14 12:48:36 -05:00
JohnAFernandez e7c98d6d23 Merge pull request #5880 from MjnMixael/fix_render_overhead
Fix renderOverheadModel's reliance on wss_slots
2023-12-14 12:48:16 -05:00
JohnAFernandez 36e7598ceb Merge pull request #5879 from JohnAFernandez/Fix-Player-Menu-Smarter
QOL: Don't reset the position in the player list if we switch modes
2023-12-11 17:46:28 -05:00
Mike Nelson 0672bd94e9 This should be Game instead of Graphics 2023-12-11 11:26:02 -06:00
Mike Nelson c7792cd781 Merge branch 'master' into more_scpui_options 2023-12-11 11:22:33 -06:00
JohnAFernandez 252392b26a Merge pull request #5865 from MjnMixael/scpui_multi_options
Scpui multi options
2023-12-11 11:54:53 -05:00
JohnAFernandez 65677542cb Merge pull request #5869 from MjnMixael/disable_cmdline_overrides
Disable cmdline overrides
2023-12-11 11:50:22 -05:00
mjn-mixael 691bbca2b2 remove renderOverheadModel's reliance on wss_slots 2023-12-11 09:36:49 -06:00
John Fernandez cd95b143a0 Only init player screen if we need to 2023-12-11 00:46:21 -05:00
Goober5000 a360a1f5f1 Merge pull request #5877 from Goober5000/bump_missionlog
bump missionlog limit
2023-12-10 18:20:52 -05:00
Goober5000 d1119b2353 bump missionlog limit
This limit has not been bumped since the original public source release.  The final mission in Shepherds has been experiencing mysterious bugs which were finally tracked down to the mission log overflowing its limit and discarding log entries.  Ideally the mission log should be made dynamic and the pruning mechanisms removed, but for the 24.0 release, it suffices to bump the limit.
2023-12-10 00:33:22 -05:00
JohnAFernandez c37e1b1c96 Merge pull request #5871 from Goober5000/juggling_fix
juggling fix
2023-12-09 14:30:43 -05:00
Goober5000 fd6ca9dde9 juggling fix
Volition used a bit of juggling when deleting the briefing editor pointer.  Turns out this actually prevents a crash in certain situations, so let's put it back.

Follow-up to #5866.
2023-12-09 14:04:53 -05:00
Goober5000 fbb3a8f6a5 Merge pull request #5829 from Goober5000/oswpt_registry_ptrs
replace pointers with indexes in ship registry and oswpt
2023-12-09 00:23:33 -05:00
JohnAFernandez 0e63d64647 Merge pull request #5451 from BMagnu/animation_driver
Animation Drivers
2023-12-08 20:58:54 -05:00
Goober5000 de50f693ae Merge pull request #5811 from Goober5000/perform_on_mission_skip
implement on-mission-skip SEXP
2023-12-08 20:05:20 -05:00
Goober5000 6e9b31cb5a replace pointers with indexes in ship registry and oswpt
This refactors the ship registry and the OSWPT struct to store data as indexes rather than pointers.  This is a prerequisite for making these collections dynamic in the future.  See also #5800.
2023-12-08 19:45:58 -05:00
Fabian Woltermann e316c28258 Merge pull request #5607 from EatThePath/opt/luastring
LuaDrawstring optimization
2023-12-08 17:18:20 +01:00
JohnAFernandez 1ef528af5f Merge pull request #5867 from MjnMixael/discord_option_category
Change the discord option category to "game"
2023-12-08 10:48:31 -05:00
EatThePath e536413259 Deferred light mesh submission optimizations (#5828)
* Reorganized opengl deferred light mesh drawing to submit all data before,
beginning to submit draws, and also to reduce total bind calls needed.

* Leftover unused variable cleanup

* CI didn't like my loops, maybe it'll like these.

* unused variable cleanup.
2023-12-08 07:40:42 -05:00
Goober5000 ccbe7efcbe Merge pull request #5866 from Goober5000/fred_autosave
add more autosaving in FRED
2023-12-07 18:12:37 -05:00
mjn-mixael 1fcf51bd92 unused vars 2023-12-07 16:55:41 -06:00
mjn-mixael b9938b854f commandline to disable using ingame options 2023-12-07 16:45:43 -06:00
mjn-mixael ad06cb1c5b disable commandline options overriding in-game options 2023-12-07 15:00:33 -06:00
mjn-mixael b62a7fbe3d no unfocused pause & localization + cleanup 2023-12-07 11:54:45 -06:00
mjn-mixael 4011a0800d screenshake option 2023-12-07 11:33:01 -06:00
mjn-mixael 8f7c6a0ed8 and force dropdown selector for display selection 2023-12-07 10:45:17 -06:00
mjn-mixael 9e719440c9 Change the discord option category to "game" 2023-12-07 10:31:15 -06:00
Goober5000 6692540cbf add more autosaving in FRED
FRED has an autosave feature but it wasn't invoked in too many places.  This adds autosaving whenever a major dialog is closed, unless it was closed by hitting Cancel.  NB: Autosave is not yet implemented in qtFRED.

Also, `addvariabledlg` incorrectly referred to `OnOk` instead of `OnOK` and `CMessageEditorDlg` incorrectly referred to `OnOK` instead of `OnOk`, so this fixes those and distinguishes `OnOk` by renaming it `OnButtonOk` to be consistent with the event editor and other dialogs.
2023-12-06 17:55:26 -05:00
mjn-mixael 668fc18d5c Make these two dropdown options to account for the longer string values 2023-12-06 15:29:32 -06:00
mjn-mixael a101e3cf77 spelling is hard 2023-12-06 15:25:37 -06:00
mjn-mixael dcce4a6538 Set the globals at player select rather than player load 2023-12-06 15:08:23 -06:00
mjn-mixael 7ce3217f17 multi login info & ip address list API 2023-12-06 12:49:38 -06:00
mjn-mixael 33a1b1f8ca clean up and fix 2023-12-06 09:59:36 -06:00
mjn-mixael a29a97f39a xstrs 2023-12-06 08:22:26 -06:00
Goober5000 8d40d7467e Merge pull request #5861 from BMagnu/fix_windowres_warning
Avoid a casting warning in cmdline.cpp
2023-12-06 01:07:22 -05:00
Goober5000 eb57482c1a Merge pull request #5864 from Goober5000/fix_query_node_argument_type
fix query_node_argument_type()
2023-12-06 01:05:53 -05:00
Goober5000 50f083043b fix query_node_argument_type()
Calling `query_node_argument_type()` on a node with no parent is a valid use case, so return the proper argument type.  Fixes a crash discovered by Applemush.
2023-12-05 17:03:48 -05:00
Goober5000 d02bd6ca04 Merge pull request #5862 from Goober5000/no_arrival_music
allow nonexistence of arrival overlays
2023-12-05 16:53:15 -05:00
Asteroth e543c1aea2 make beams respect check hull and self damage 2023-12-05 16:46:32 -05:00
Goober5000 22962afcde allow nonexistence of arrival overlays
Ever since retail, the code has assumed that a soundtrack would always have arrival music.  This removes that requirement.  If arrival music is missing, it will just be skipped.
2023-12-05 16:19:46 -05:00
Birk Magnussen 1f9c9a3673 Catch nonexistant curves 2023-12-05 21:25:22 +01:00
Birk Magnussen f3922f35e8 Properly cast to avoid a warning 2023-12-05 19:16:16 +01:00
Birk Magnussen bb5bfad828 Fix parsing and asserts 2023-12-05 18:54:30 +01:00
JohnAFernandez 18ac8425ee Merge pull request #5859 from MjnMixael/fix_language_selection
Only use- in-game language if the mod table option is enabled
2023-12-05 12:10:03 -05:00
BMagnu f6167bb89a Make sure that the openxr_loader subproject is forced to the correct debug iterator level (#5860) 2023-12-05 17:00:01 +00:00
Birk Magnussen c8ceb289ba Actually run drivers 2023-12-05 17:47:44 +01:00
Birk Magnussen 9ea64627ab property drivers 2023-12-05 17:47:43 +01:00
Birk Magnussen 6e9ca36481 fix driver parsing 2023-12-05 17:47:43 +01:00
Birk Magnussen 90dbdc4236 Add remap driver 2023-12-05 17:47:43 +01:00
Birk Magnussen 3a35f7ebe7 make curve inferment constant 2023-12-05 17:47:42 +01:00
Birk Magnussen 05f190b36c Ensure driver source precedence 2023-12-05 17:47:42 +01:00
Birk Magnussen 0924a392aa Add basic driver sources 2023-12-05 17:47:41 +01:00
Birk Magnussen 21db833dee Add driver files 2023-12-05 17:47:41 +01:00
Birk Magnussen 86011f2669 Driverify time 2023-12-05 17:47:41 +01:00
Birk Magnussen 2bd143e093 Separate Animation State tracking from direction and time tracking 2023-12-05 17:47:40 +01:00
mjn-mixael 79d3077071 quick & dirty initial work for the toggle options 2023-12-05 09:30:04 -06:00
mjn-mixael aacd14e1df only use- in-game language if the mod table option is enabled 2023-12-04 15:58:41 -06:00
BMagnu 43afcd5ea6 VR Lua interface (#5858)
* Allow lua to check whether VR is enabled

* Add global hook condition

* Add missing descriptionm
2023-12-04 20:39:26 +00:00
BMagnu b98544d862 Merge pull request #5583 from BMagnu/openxr
Add VR support through OpenXR
2023-12-05 04:57:19 +09:00
Birk Magnussen 7867dc77bd external Openxr vars on mac 2023-12-04 20:38:50 +01:00
Birk Magnussen 426c227b68 Actually make sure that OpenXR is not a target on maxc 2023-12-04 20:24:42 +01:00
Birk Magnussen 612bdcf4df Do not link OpenXR on mac 2023-12-04 20:20:41 +01:00
ETP 0d712d6fc0 Minor code cleanup. 2023-12-04 14:12:31 -05:00
Taylor Richards 62fa0c081b Merge pull request #5856 from notimaginative/mac_name_change_fixes
update nebula script for Mac filename changes
2023-12-04 00:13:23 -05:00
Taylor Richards 8035a2b32a update nebula script for Mac filename changes 2023-12-03 17:19:08 -05:00
ETP f7f2c58746 New method to wrap strings to drawing widths, and use of that method in lua gr.drawstring, resolves #5495 2023-12-03 14:31:33 -05:00
Goober5000 7bf0fd137d Merge pull request #5855 from Goober5000/coverity_magic
change two global variables to be scoped
2023-12-03 01:18:06 -05:00
Goober5000 6d818f1e3b Merge pull request #5565 from Goober5000/plieblang_good_primary_time
Add plieblang's good primary time SEXP
2023-12-02 23:45:46 -05:00
Goober5000 e23b5533aa change two global variables to be scoped
These variables are only ever used in the scope of `os_get_legacy_user_dir()`, so they can be scoped rather than global.  This should fix a Coverity issue on the `DCF(low_mem` debug console function.
2023-12-02 23:39:24 -05:00
Goober5000 6b79571edc Merge pull request #5854 from Goober5000/fix_api_format
fix Lua API arguments
2023-12-02 18:26:12 -05:00
JohnAFernandez 27f022b2f2 Merge pull request #5799 from JohnAFernandez/Fix-many-old-divide-by-issues
Add safety to crusty old physics code (coverity issue)
2023-12-02 18:19:54 -05:00
JohnAFernandez 4578fbc900 Merge pull request #5851 from MjnMixael/sound_assertion
Add assertion when getting a loaded sound index
2023-12-02 18:11:07 -05:00
John Fernandez bfde2144a2 Typo 2023-12-02 18:01:51 -05:00
John Fernandez 1787f4457b Add safety to crusty old physics code 2023-12-02 18:01:51 -05:00
Goober5000 be14c34f7d reset the timestamp instead of checking the size 2023-12-02 14:56:31 -05:00
Goober5000 da66bd65da feedback 1 2023-12-02 14:56:30 -05:00
Goober5000 dc7aa86147 updates based on comments 2023-12-02 14:56:30 -05:00
Goober5000 4bf743765c plieblang's good-primary-time 2023-12-02 14:56:30 -05:00
Taylor Richards b4e3ebe085 Merge pull request #5853 from notimaginative/mac_arm64_builds
add mac arm64 builds to CI workflow
2023-12-02 14:46:20 -05:00
Goober5000 ada432a1f3 fix Lua API arguments
Make sure the return value is actually a float so that the float format can process it.

Follow up to #5831.  Fixes a crash for invalid movies.
2023-12-02 13:04:14 -05:00
Goober5000 25d796afe4 implement on-mission-skip SEXP
Adds a SEXP that specifically checks for whether a player has skipped a mission.  This can be used to set tech room entries, allowed ships/weapons, and other campaign data that would otherwise break if a player skipped a mission.

This only applies to the the failed-five-times popup.  For this to work with the `skipmemymissionyo` cheat, it would be necessary to load every intervening mission and check the events.  That being said, `skipmemymissionyo` already automatically allows all ships and weapons, so there is much less, if any, need for this SEXP in that case.
2023-12-02 01:25:14 -05:00
Goober5000 1a034031d1 Merge pull request #4634 from Goober5000/sexp_reset_event
add reset-event and reset-goal
2023-12-02 01:03:38 -05:00
Goober5000 23098666e2 Merge pull request #5506 from MageKing17/bugfix/debrief-failure-skip-count
Restore (mostly-)retail debrief failure counting behavior.
2023-12-01 23:41:48 -05:00
Taylor Richards 5490751167 skip tests on mac if target arch doesn't match host
An arm64 mac can run unittests on a x86_64 build, but not the other way
around. So if the target arch doesn't match the build host arch then
just skip the tests. Saves us from a far more complicated fix that would
only produce the same test results anyway.
2023-12-01 23:05:56 -05:00
Taylor Richards 4bc9cf0846 set IS_ARM64 correctly if building on different arch 2023-12-01 23:01:29 -05:00
BMagnu dd9248fc22 Fix merge errors 2023-12-02 11:50:01 +09:00
BMagnu c2ed03ca59 Merge branch 'master' into openxr 2023-12-02 11:42:55 +09:00
Taylor Richards 7491a82d74 always build embedfile and unittests for host arch 2023-12-01 21:15:13 -05:00
MageKing17 2f0c0f1d6f Restore (mostly-)retail debrief failure counting behavior.
Back in 2008 (in commit 2c45dbbb5f), some retail code incrementing `Player->failures_this_session` was removed, seemingly by accident. A month later, a bug related to this was fixed (in commit 28a408deee) in a different way. Since this fix is rendered redundant by the restoration of the original behavior, I've removed it and put back in the old behavior. This is only "mostly-retail" because the retail code didn't check `Game_mode & GM_CAMPAIGN_MODE`.
2023-12-01 18:14:55 -08:00
Taylor Richards 3b231b375f add mac arm64 builds to CI workflow 2023-12-01 20:55:29 -05:00
Taylor Richards 07fb5bec0e support new prebuilt libs on mac (#5852) 2023-12-01 20:54:41 -05:00
mjn-mixael e51815a933 Add assertion when getting a loaded sound index 2023-12-01 11:27:17 -06:00
Goober5000 ea6e503ea1 Merge pull request #5839 from Goober5000/radar_timestamps
make radar timestamps type-safe
2023-11-30 13:19:58 -05:00
JohnAFernandez a381ecc607 Merge pull request #5844 from MjnMixael/fred_on_mission_load
FRED on mission load hook
2023-11-30 11:42:48 -05:00
Asteroth 125e47d749 Add cockpit 'sway' (#5840)
* add cockpit sway

* remove 5000 scaling factor
2023-11-30 10:52:39 -05:00
JohnAFernandez d280800bce Merge pull request #5847 from MjnMixael/remove_cd_checks
Remove the cd checks that always returned true anyway
2023-11-30 10:38:19 -05:00
JohnAFernandez a1c9b108ed Merge pull request #5842 from Baezon/gravity-fixes
Two gravity fixes
2023-11-30 10:38:05 -05:00
JohnAFernandez d7a06c893f Merge pull request #5848 from MjnMixael/fix_medal_parsing
Fix medal parsing issue
2023-11-30 10:37:33 -05:00
m!m 3aa672c855 Merge pull request #5843 from asarium/build/ci_qtfred
Reenable QtFred building for Linux CI builds
2023-11-29 21:08:05 +01:00
mjn-mixael 8acbe82aa0 fix medal parsing 2023-11-29 13:08:05 -06:00
JohnAFernandez 5227e2e0c4 Merge pull request #5830 from MjnMixael/vectorize_multi_pxo
Vectorize multi pxo
2023-11-29 13:47:04 -05:00
mjn-mixael 95baa85750 remove the cd checks that always returned true anyway 2023-11-29 11:27:31 -06:00
mjn-mixael fb1ffd8413 fred on mission load hook 2023-11-29 09:14:07 -06:00
asarium f43732c5da Reenable QtFred building for Linux CI builds
Qt has been added to the build image which eliminates the need to
dynamically install it which removed a possible point of failure.

At the moment this is only enabled for pull request builds and should
not affect nightly or release builds.
2023-11-29 11:34:42 +01:00
Asteroth 8dbe0e7b8a gravity fixes 2023-11-29 02:34:26 -05:00
mjn-mixael 3ad66b988d unused var 2023-11-28 20:48:21 -06:00
mjn-mixael 969759426a list instead of vector 2023-11-28 20:31:54 -06:00
m!m 224503391f Merge pull request #5841 from asarium/fix/build-upload
Update container image to fix artifact uploads
2023-11-28 14:29:08 +01:00
asarium 0edc6267aa Update container image to fix artifact uploads
The previous version of the image accidentally removed the /tmp
directory which broke things in the GitHub actions.

Initially, an update for the upload/download actions was tried which had
no effect but keeping these updated is probably a good idea.
2023-11-28 10:58:28 +01:00
Goober5000 def75287eb convert radar timestamps to new system
Also convert true/false variables to boolean.
2023-11-28 00:09:25 -05:00
Goober5000 c427014fc2 just use the flag 2023-11-27 18:19:56 -05:00
Goober5000 99d140fb83 indicate 'done' events with a flag 2023-11-27 18:19:56 -05:00
Goober5000 808e5bedd9 address feedback 2023-11-27 18:19:56 -05:00
Goober5000 6dfd1ed0b8 add reset-event and reset-goal
These new SEXP operators clear all status information from an event or goal, making it as if the event or goal had never been evaluated.

Implements feature discussed in #4184.
2023-11-27 18:19:56 -05:00
Goober5000 0d1d6fdf44 tweak event status evaluation when the game is not in-mission
The requirement for delayed event status checks to be strictly greater than the event fired timestamp (see commit eed50619ca / PR #5267) means that `is-event-true-delay 0` will not work in debriefings if the event becomes true and the debriefing SEXPs are evaluated on the exact same timestamp.  Normally this is not a problem, but one important exception is the `end-mission` operator which instantly sends the player to debriefing.

This timestamp behavior is working as designed and should be consistent as long as the `end-mission` operator has been around (I've verified it as far back as 3.7.4).  But it does lead to inconvenient situations where the event that called `end-mission` cannot be evaluated by the debriefing.  This makes it slightly more complicated to plan debriefing stages based on these events.

Therefore, it makes sense to add an exception to the event status function to ignore the delay if the evaluation is not in-mission.  This is consistent with evaluating events that *never* fired and also satisfies the principle of least astonishment for mission designers.

This also adds relevant documentation to the event and goal status operators.
2023-11-27 18:08:59 -05:00
m!m 369b90a156 Merge pull request #5833 from asarium/update_compilers
Update PR build image and compilers
2023-11-27 08:23:13 +01:00
mjn-mixael 7bb6a8ae86 negate this 2023-11-26 23:49:02 -06:00
Goober5000 7afb00e976 Merge pull request #5800 from Goober5000/reduce_ship_info_ptrs
avoid storing ship_info pointers in data structures
2023-11-26 23:30:13 -05:00
JohnAFernandez c4fe9e664f Merge pull request #5836 from MjnMixael/fix_hud_translations
Do not translate these if setting is enabled
2023-11-26 22:19:56 -05:00
JohnAFernandez eda9f16294 Merge pull request #5835 from MjnMixael/language_out_of_bounds
Verify this is in bounds and add vector_inbound macro
2023-11-26 22:19:32 -05:00
mjn-mixael f7dddc35d1 inline and remove signed check for size_t 2023-11-26 20:55:37 -06:00
mjn-mixael b8806e958d do not translate these if setting is enabled 2023-11-26 19:52:34 -06:00
mjn-mixael 40cf32133f in bounds check for language ext 2023-11-26 19:28:06 -06:00
Mike Nelson 691ec74406 Mission custom strings (#5544) 2023-11-26 19:15:30 -05:00
Goober5000 359886fee1 Merge pull request #5831 from Goober5000/movie_duration
add Lua function for movie duration
2023-11-26 16:00:26 -05:00
Mike Nelson 9b86d2f16d Scpui language selector (#5826)
* SCPUI in-game language selector

* xstr support

* proper debug print format

* minor fixes

* Save the language as json data rather than an index into the languages array

* ext instead of id for clarity

* Do this more formally

* unused param
2023-11-26 11:52:15 -05:00
asarium 260f15624b Update PR build image and compilers
This advances the versions for Clang to 16 and GCC to 13 along with
fixing any warnings these new versions are detecting now.

The new image versions also include Vulkan so the additional workflow
step for installing that is not necessary anymore.
2023-11-26 12:23:57 +01:00
mjn-mixael 6de870766a address additional feedback 2023-11-25 10:25:58 -06:00
Goober5000 072e802863 add Lua function for movie duration
This retrieves the duration from the movie stream.  Thanks to @asarium for pointing me in the right direction.
2023-11-23 13:11:40 -05:00
mjn-mixael 2ca9d6672c address feedback 2023-11-23 10:47:55 -06:00
mjn-mixael 7281e8d127 unused 2023-11-22 13:18:27 -06:00
mjn-mixael a730f30435 cleanup for checks 2023-11-22 13:07:16 -06:00
mjn-mixael cd5f044217 vectorize the chat 2023-11-22 12:31:05 -06:00
mjn-mixael 8b90cda3f4 nullptr 2023-11-22 09:52:13 -06:00
JohnAFernandez 6b2ced4643 Merge pull request #5815 from MageKing17/feature/direction-blind-contrails
Implement direction-blind contrails option.
2023-11-21 23:32:18 -05:00
JohnAFernandez 5ee051c55f Merge pull request #5803 from Baezon/start-loop-end-snd-weapons
Add Start/Loop/End sounds for weapons
2023-11-21 23:29:23 -05:00
Goober5000 ecc452088c Merge pull request #5751 from Goober5000/freespace_timestamps
upgrade timestamps referenced in freespace.cpp
2023-11-21 18:30:14 -05:00
mjn-mixael 841ae430c0 Vectorize the players list 2023-11-21 16:06:27 -06:00
Mike Nelson 3f7ffdb6a0 Localize strings in ship_select_blit_info (#5824) 2023-11-21 13:05:24 -05:00
Tyler Blount 737717fe3f Merge pull request #5569 from MjnMixael/loadout_no_validation
Do not validate loadouts
2023-11-20 21:57:57 -07:00
JohnAFernandez a463ac19cf Merge pull request #5825 from Baezon/fix-head-on-lasers
Fix for lasers with head on bitmaps
2023-11-20 21:57:53 -05:00
mjn-mixael 9d0ee6ab0d vectorize the channel list 2023-11-20 16:48:43 -06:00
Asteroth 703269aa71 fix for lasers with head on bitmaps 2023-11-20 17:27:11 -05:00
JohnAFernandez b7a0170cd1 Merge pull request #5818 from EatThePath/opt/single_batching
Remove redundant batching_render_all calls
2023-11-20 10:33:30 -05:00
JohnAFernandez 6f263365af Merge pull request #5761 from JohnAFernandez/Coverity-COPY_INSTEAD_OF_MOVE-ISSUES
These std moves were suggested by Coverity as optimizations
2023-11-19 23:11:26 -05:00
Goober5000 6435843c24 Merge pull request #5817 from Goober5000/fix_player_entry_delay
fix loadout dialog updating in FRED
2023-11-19 19:22:09 -05:00
Goober5000 22ee5d5c15 Merge pull request #5819 from Goober5000/the_new_old_checkbox
FRED checkbox upgrade
2023-11-19 19:22:00 -05:00
Mike Nelson 5fadb12b0f Deprecate IsValid in favor of isValid (#5814) 2023-11-19 18:58:35 -05:00
Taylor Richards e94c515ab8 fix deprecation warnings on newer ffmpeg versions (#5822) 2023-11-19 16:41:53 -05:00
Taylor Richards d83ddeed0f add arm64 detection and naming support (#5821) 2023-11-19 16:41:18 -05:00
Taylor Richards 3556d41b44 disable png neon optimizations on arm (#5820) 2023-11-19 16:41:03 -05:00
Mike Nelson f2df96b4bb remove is docked check for transfer-cargo sexp (#5810) 2023-11-19 11:25:14 -05:00
wookieejedi 9eeb3307d0 Expose isValid parse object check to scripting (#5816) 2023-11-19 07:51:33 -05:00
Goober5000 a406b43876 Merge pull request #5808 from Goober5000/rename_vaporize_chance
rename Vaporize Percent Chance
2023-11-18 23:04:38 -05:00
Goober5000 c86802e9c1 use alternate overlap fix
Back out the manual resize fix and apply a simpler fix that is less hackish.  See this other StackOverflow article:
https://stackoverflow.com/questions/57951333/cchecklistbox-items-get-overlapped-on-selection-if-app-build-using-visual-studi
2023-11-18 19:26:52 -05:00
Goober5000 5b4065bd53 FRED checkbox upgrade
The overlapping checkboxes problem described in #5494 is the result of the checkbox list item height being slightly too small.  A fix for this, which requires a subclass of `CCheckListBox`, is described in the following StackOverflow article:
https://stackoverflow.com/questions/3147958/mfc-cchecklistbox-items-overlap

It turns out there is already a subclass of `CCheckListBox` in the codebase: `ShipCheckListBox`, a class that was apparently left on the cutting room floor when DaveB refactored the team loadout dialog on 2/23/99.  It allows an entire selected range of items to be toggled by pressing the spacebar.  I've augmented it with the StackOverflow fix, and I've added it to the team loadout dialog as well as some other places that could benefit from it.

Fixes the other half of #5494.
2023-11-18 18:44:39 -05:00
ETP 5fd439fb60 Clean now-unused batch rendering flag. 2023-11-18 16:26:10 -05:00
ETP 2043f836ed Clean extra batched buffer run in particles 2023-11-18 15:53:47 -05:00
ETP 4a3c7fc9a9 Batched buffers are rendered soon after this anyway and the overhead is considerable.
Also removed what appears to be accidentally duplicated lines
2023-11-18 15:52:55 -05:00
Goober5000 e0e3f7e7ac fix loadout dialog updating in FRED
We need to call `UpdateData()` in the `OnOK()` function and in several other places so that the member variables are populated with the most recent input from the UI.  This prevents certain input (such as Player Entry Delay changes) from being lost by being overwritten with stale stored values.

This fixes a bug reported by Kitsune where the Player Entry Delay box did not work properly.  It also fixes the random checkbox issue from #5494.
2023-11-18 15:44:48 -05:00
Goober5000 542d9741c4 Merge pull request #5813 from Goober5000/fix_grid
small briefing bugfix
2023-11-18 15:04:10 -05:00
MageKing17 68eef5949b Implement direction-blind contrails option.
One of the features requested in #5378 (specifically the one requested in #5274), this adds a new "$Contrails use absolute speed:" option to game_settings.tbl, which makes the `ct_below_limit()` function check `objp->phys_info.speed` instead of `objp->phys_info.fspeed`. This allows contrails to appear when moving in a direction other than forwards.
2023-11-18 10:51:40 -08:00
Goober5000 7958670868 small briefing bugfix
Prevent "Disable grid rendering" from being stuck on.  Fixes a bug reported by Kitsune.
2023-11-18 12:34:28 -05:00
Mike Nelson 226ed40cec Move no campaign warning to on Ready Room click (#5809)
* Move no campaign warning to on ready room click

* Add a log print
2023-11-18 11:10:39 -05:00
Mike Nelson d454a74716 Add child enum suffix option (#5798) 2023-11-17 21:45:36 -05:00
Mike Nelson 4ff96abd9e Merge branch 'master' into loadout_no_validation 2023-11-17 10:29:50 -06:00
Mike Nelson 5bc1200731 Fred cutscene dialog (#5618)
* fred cutscene editor and deprecate alias types

* properly handle right-click delete

* cleanup

* these must be ints also
2023-11-17 11:27:05 -05:00
Asteroth b23dff91e7 revert removal of allow relative (#5807) 2023-11-16 22:20:54 -05:00
Goober5000 3af831e0b7 rename Vaporize Percent Chance
This option was misleadingly named when originally introduced, so give it a more sensible name.  The old name is still accepted for backwards compatibility.
2023-11-16 15:57:53 -05:00
Mike Nelson bcae459b56 Add way to offset directive help text only (#5802)
* add way to offset directive help text only

* specify which offset
2023-11-15 07:50:21 -05:00
Goober5000 ff7d85a60f Merge pull request #5806 from Baezon/fix-changing-bank-num
Fix for changing the number of banks on a ship
2023-11-15 00:10:30 -05:00
Goober5000 267fcfc6f8 also check ship_info_size() 2023-11-14 23:32:20 -05:00
Asteroth 8587bf768b fix changing number of banks 2023-11-14 20:04:55 -05:00
JohnAFernandez 535ff9f99a Merge pull request #5608 from Goober5000/move_cmdline_option
move -no_unfocused_pause
2023-11-14 16:01:20 -05:00
Asteroth 422ccaa514 fix 2023-11-14 13:15:30 -05:00
wookieejedi a3e27f566f Allow Modders to Set Rotational Scaling Multiplier for Asteroids/Debris (#5801)
* Allow Modders to Set Rotational Scaling Multiplier for Asteroids/Debris

Previously, there was no way to limit the velocity at which asteroids/debris randomly rotated. There was a way to set maximum speed, thus this PR follows that convention and adds a way to cap the rotational velocity scaling. This PR allows modders to set caps per type, including setting the value to 0 for no rotation.

A single scaling value was used b/c it was the most straightforward value to se via table and it was the employed the least code changes. Asteroids pick a random normalized vector for their rotation when spawning, and then that value is scaled by a random multiplier.

* use full multiplier instead
2023-11-14 08:02:16 -05:00
Asteroth 9ecb451efe more tweaks 2023-11-13 18:53:15 -05:00
Asteroth e3d2c02f99 tweak 2023-11-13 17:55:48 -05:00
Asteroth 13170a235e add start/loop/end sounds for weapons 2023-11-13 17:52:50 -05:00
Goober5000 5406445ed4 replace pointers with indexes in WarpEffect 2023-11-13 14:05:39 -05:00
Goober5000 301b9453b6 replace pointers with indexes in cockpit_display 2023-11-13 12:48:08 -05:00
JohnAFernandez cd32c2ce42 Merge pull request #5778 from freijon/fix_opt_flags
Don't ignore user-set -O* flags
2023-11-13 11:08:34 -05:00
Goober5000 7b1b1113da upgrade timestamps referenced in freespace.cpp
Convert additional timestamps to use the new timestamp system.  This covers all timestamps referred to in freespace.cpp.  For purposes of organization, the fade-in/fade-out timestamps have been moved to light.h|cpp and the training timestamps have been moved to missiontraining.h|cpp.

There are also several related code enhancements:
1. `FadeType` has been converted from `enum` to `enum class`
2. Initialization of the various training variables has been added to `training_mission_init` (previously they had never been reset between missions)
3. Validity checks have been added to the relevant locations for these timestamps
2023-11-12 15:22:30 -05:00
JohnAFernandez 1f32834d9d Merge pull request #5792 from MjnMixael/lua_enum_remove_item
Add ability to remove an enum item from a list
2023-11-12 14:31:49 -05:00
Mike Nelson bee0742aa2 downgrade this to a log print (#5791) 2023-11-12 10:07:16 -05:00
Mike Nelson d336d395db Fix incorrect out of bounds check (#5795) 2023-11-12 10:07:04 -05:00
Goober5000 1953bd9c49 Merge pull request #5748 from Goober5000/event_currency_tweaks
Event currency tweaks
2023-11-12 01:40:07 -05:00
Joshua Glatt e27cbe9517 Disallow Replace Container Data for all special argument SEXPs (#5793) 2023-11-12 01:38:55 -05:00
Goober5000 4b5d4320f8 Merge pull request #5794 from Goober5000/missionsave_tweaks
FRED missionsave updates
2023-11-11 23:43:00 -05:00
Goober5000 ed7f3e6880 Merge pull request #5787 from Goober5000/refactor_argument_functions
refactor argument functions
2023-11-11 19:39:55 -05:00
Goober5000 980d2c2bcc Merge pull request #5797 from Goober5000/fix_5773
fix 5773
2023-11-11 18:29:15 -05:00
Goober5000 17dfa0ddb9 fix 5773
In #5773, this use of frand_range(0, N) needed to be converted to Random::next(N+1), just like several other similar instances in that PR.

Fixes #5796.
2023-11-11 17:58:37 -05:00
Goober5000 5f511e34e3 FRED missionsave updates
1. Use the `optional_string_fred`/`fout` pattern so the FRED comment parser can follow along with the mission file
2. Since the #Custom Data section is optional and requires a version bump, don't output the section header if the section is empty
2023-11-11 14:34:17 -05:00
Goober5000 31c8739ecd Merge pull request #5788 from Goober5000/rcs_thruster_refactor
rcs thruster refactor
2023-11-11 13:17:48 -05:00
Goober5000 8e23c32b8c Merge pull request #5765 from Goober5000/subsystems_blown_optimization
optimization for checking whether subsystems are blown
2023-11-11 13:07:01 -05:00
mjn-mixael b628b665cf Do this using brain 2023-11-11 11:51:45 -06:00
mjn-mixael 7a367b10ad Add ability to remove an enum item from a list 2023-11-11 11:30:07 -06:00
wookieejedi 09c885c4af Add built-in xstrs for SCP-added custom controls (#5790) 2023-11-11 12:06:24 -05:00
JohnAFernandez 9ac6060abd Merge pull request #5522 from MjnMixael/mainhall_lua_esc
Custom lua action for mainhall esc keypress
2023-11-11 00:02:15 -05:00
JohnAFernandez a34f37fa8d Merge pull request #5645 from MjnMixael/lua_dynamic_enums
Lua Child Enums for Sexp types
2023-11-11 00:01:44 -05:00
JohnAFernandez 7645704ac2 Merge pull request #5753 from Baezon/moar-curves
Moar curves
2023-11-11 00:01:29 -05:00
wookieejedi b25e76cb65 Fix documentation error in On State Start (#5789) 2023-11-10 19:46:55 -05:00
BMagnu a9cfd27455 Expose more submodel instance and submodel attributes and functions to Lua (#5766)
* Add global to local for matrices

* Add lua integration

* Get Submodel from Submodel instance

* Add submodel functions

* Add model instance from submodel instance

* Fix index

* Fix copy paste error
2023-11-11 07:23:47 +09:00
Goober5000 110f609dea Merge pull request #5701 from Goober5000/jumpnode_constify
add const where appropriate to the jump node API
2023-11-09 17:52:30 -05:00
Birk Magnussen ba3ac66958 X compile error 2 2023-11-09 23:43:09 +01:00
Birk Magnussen 274366c8ad X compile error 2023-11-09 23:39:26 +01:00
Birk Magnussen df285b7ae1 Fix rebase errors 2023-11-09 23:14:08 +01:00
Birk Magnussen 7eec846b3d readd hudtarget 2023-11-09 22:56:47 +01:00
Birk Magnussen 25a9f6abe2 Avoid OGL errors 2023-11-09 22:56:07 +01:00
Birk Magnussen f0737f1b87 Tidyup, Linux init code is now tested 2023-11-09 22:56:07 +01:00
Birk Magnussen dbefa6d333 Actually init GLX 2023-11-09 22:56:07 +01:00
Birk Magnussen 54c0680b2a Fix HUD speed 2023-11-09 22:56:06 +01:00
Birk Magnussen 058cec3d2c Make VR 2D-Screen Auto recenter 2023-11-09 22:56:06 +01:00
Birk Magnussen a73cc9bfce Add option for window-scaling 2023-11-09 22:55:27 +01:00
Birk Magnussen 245ac3f6b3 Safe type conversions 2023-11-09 22:53:59 +01:00
Birk Magnussen ee6159c685 Fix incorrect print order 2023-11-09 22:53:59 +01:00
Birk Magnussen 68f9d90629 Proper swapchain AR detection 2023-11-09 22:53:59 +01:00
Birk Magnussen 2523218fdc Fix interfacing with the very segfaulty oculus runtime 2023-11-09 22:53:59 +01:00
Birk Magnussen b323760659 HUD offset never makes any sense 2023-11-09 22:53:54 +01:00
Birk Magnussen 5a93f78933 Mac Compile 2023-11-09 22:52:56 +01:00
Birk Magnussen e99341d79f Fix compile issues 2023-11-09 22:52:56 +01:00
Birk Magnussen 54a188d46a Try fixing compile on mac 2023-11-09 22:52:55 +01:00
Birk Magnussen f686046a1d Properly force VR AR 2023-11-09 22:52:51 +01:00
Birk Magnussen 61f8e0370b Fix Warning again again 2023-11-09 22:52:19 +01:00
Birk Magnussen 397125fc6e Fix Warning again 2023-11-09 22:52:19 +01:00
Birk Magnussen 6f458d5398 Fix Warning 2023-11-09 22:52:19 +01:00
Birk Magnussen 1223808a14 Need to output linear for OpenXR 2023-11-09 22:52:18 +01:00
Birk Magnussen 19c4c6edba Make sure scripts have correct Proj_fov 2023-11-09 22:50:59 +01:00
Birk Magnussen bfeb86f017 Properly apply asymmetric FOV to g3_rotate_ functions 2023-11-09 22:50:29 +01:00
Birk Magnussen e7ded2b4cd Integrate per-eye fov overrides 2023-11-09 22:49:44 +01:00
Birk Magnussen b2d1da6701 Enable Asymmetric Projection FOV 2023-11-09 22:49:41 +01:00
Birk Magnussen d0086c31b8 Fix asymmetric top-down fov and add logging 2023-11-09 22:48:55 +01:00
Birk Magnussen d9786f8aae Clang 2023-11-09 22:48:54 +01:00
Birk Magnussen fe916eb7ce Fix Warnings 2023-11-09 22:48:54 +01:00
Birk Magnussen a476897963 Fix BUild Issues 2023-11-09 22:48:54 +01:00
Birk Magnussen e404f32c7b Add warning if extension is not present 2023-11-09 22:48:54 +01:00
Birk Magnussen 77a2f5345f Fix HUD Message Head 2023-11-09 22:48:17 +01:00
Birk Magnussen 41efb57879 Lead indicator slew 2023-11-09 22:47:05 +01:00
Birk Magnussen 729aa2f6f7 Fixup HUD for slewing 2023-11-09 22:45:07 +01:00
Birk Magnussen 346ce5c975 Fix lighting 2023-11-09 22:43:51 +01:00
Birk Magnussen d1d64a0afb Autoslew HUD 2023-11-09 22:43:51 +01:00
Birk Magnussen 94cd6cf8bb Fix retail stars and screenshake 2023-11-09 22:43:51 +01:00
Birk Magnussen 9b09818b49 Cleanup 2023-11-09 22:43:50 +01:00
Birk Magnussen 1ab0d74939 Static linkage on Linux 2023-11-09 22:43:50 +01:00
Birk Magnussen 474db9e184 Fix mouse cursor rendering 2023-11-09 22:43:50 +01:00
Birk Magnussen 36cb7a62d6 Fix OpenGL Errors 2023-11-09 22:43:50 +01:00
Birk Magnussen cb1f1e9c0b Build Warnings 2023-11-09 22:43:49 +01:00
Birk Magnussen 9dc291569f Make OpenXR session creation build on llinux 2023-11-09 22:43:49 +01:00
Birk Magnussen 5da1a075ad Restore Debug timers 2023-11-09 22:43:31 +01:00
Birk Magnussen ad05ce147e Tidy up code 2023-11-09 22:43:31 +01:00
Birk Magnussen 9a227de872 Add option to scale down HUD in OpenXR mode 2023-11-09 22:43:30 +01:00
Birk Magnussen d4ca441449 Add graphics stubs 2023-11-09 22:43:30 +01:00
Birk Magnussen 4ea99eb461 Properly init HMD FoV 2023-11-09 22:43:27 +01:00
Birk Magnussen e01dabeb59 Lock VR behind flag 2023-11-09 22:42:46 +01:00
Birk Magnussen 27e80a3fff Fix VR coordinate transforms 2023-11-09 22:42:46 +01:00
Birk Magnussen 3ab8cb097c 2D flats as plane in space 2023-11-09 22:42:46 +01:00
Birk Magnussen 3721f8165d Basic Stereoscopy 2023-11-09 22:42:43 +01:00
Birk Magnussen f94119d722 Properly init OpenXR and just blit the backbuffer to both eyes for now 2023-11-09 22:40:19 +01:00
Birk Magnussen 5e78054a66 Properly init an OpenXR session, at least on Win32 2023-11-09 22:40:19 +01:00
Birk Magnussen cfe64748a4 Add Graphics abstraction layer 2023-11-09 22:40:18 +01:00
Birk Magnussen 7a281781e3 Make OpenXR linkable 2023-11-09 22:40:18 +01:00
Birk Magnussen a859192587 Basic OpenXR initialization 2023-11-09 22:39:58 +01:00
Goober5000 fa49d05e0c feedback 2023-11-09 15:48:43 -05:00
Goober5000 d8ff77f57f Merge pull request #5782 from Goober5000/build_fixes
a few build fixes
2023-11-09 15:27:38 -05:00
Birk Magnussen fdc8c246f5 Add OpenXR 2023-11-09 20:15:25 +01:00
BMagnu 395aadba6b Merge pull request #5676 from BMagnu/window_resolution
Add command line option for window resolution
2023-11-10 04:13:44 +09:00
Birk Magnussen 1625d86ad7 new res argument 2023-11-09 18:47:57 +01:00
Goober5000 187d24c2f4 rcs thruster refactor
Here's some low-hanging fruit for reducing the memory footprint of `ship_info`.  This turns the maneuvering thrusters array into a vector, refactors the names a bit, fixes thruster activation when `-nosound` is active, reduces the number of calls to `ship_get_thruster_status`, adds some const-correctness, and converts the timestamps to the new system.
2023-11-09 12:44:40 -05:00
mjn-mixael 47ac8a56a0 Some cleanup 2023-11-09 10:26:32 -06:00
JohnAFernandez 72ccbff147 Merge pull request #5781 from MjnMixael/mainhall_input_control
Mainhall ignore input
2023-11-09 09:51:39 -05:00
JohnAFernandez 9960d4bc9f Merge pull request #5755 from Baezon/particle-parent-size-factor
Allow particles to inherit size and lifetime
2023-11-09 09:50:27 -05:00
JohnAFernandez 2334138b99 Merge pull request #5774 from Baezon/lua-burst-params
Add lua burst values
2023-11-09 09:49:56 -05:00
Goober5000 a0b7134b9b refactor argument functions
Move some special-arg helper functions to sexp.h, as requested by jg18.  While we're at it, also refactor the names and add documentation.
2023-11-08 22:46:25 -05:00
Goober5000andJohnAFernandez b20efdec80 Update code/utils/HeapAllocator.cpp
Co-authored-by: JohnAFernandez <[email protected]>
2023-11-08 20:08:37 -05:00
Goober5000 b546dcf949 Merge pull request #5773 from Goober5000/frand_to_Random
convert some instances of frand_range to Random::next
2023-11-08 19:58:31 -05:00
Goober5000 15329b9564 Merge pull request #5786 from BMagnu/fix_headani
Fix wingman headanis
2023-11-08 19:58:19 -05:00
Goober5000 94bd1af5cd Merge pull request #5785 from Goober5000/waypoint_list_fix
fix invalid pointer access to waypoint lists
2023-11-08 19:57:55 -05:00
Birk Magnussen 367f48cf2f fix warning 2023-11-08 20:07:55 +01:00
Birk Magnussen eff00035fa Fix wingman Headani's when they're scaled up 2023-11-08 19:56:58 +01:00
Goober5000 ba2c2f03fb add index check 2023-11-08 13:39:00 -05:00
Goober5000 309bf0b3ea fix invalid pointer access to waypoint lists
Previously (since 2012!) a waypoint would store its parent list as a pointer.  However, this pointer can become invalidated if the waypoint list vector is resized.  To prevent this, store the parent list as an index.

This also renames the waypoint's `objnum` field to `m_objnum` to match the naming of the other fields.
2023-11-08 13:34:56 -05:00
Taylor Richards b62c49ec81 add version check to fix older ffmpeg versions (#5784) 2023-11-08 13:29:50 -05:00
mjn-mixael e34c82d7d1 bool + static cast 2023-11-08 09:25:22 -06:00
mjn-mixael 67e00da79b mainhall ignore input 2023-11-08 08:57:31 -06:00
JohnAFernandez 8528bfe750 Merge pull request #5777 from MjnMixael/hide_yo_jumpnode
Only untarget jumpnode if we're in a mission
2023-11-07 19:14:58 -05:00
Goober5000 37c344a127 a few build fixes
1. use `SIZE_T_ARG` instead of `"%lu"`; should fix format warning in #5780
2. since `HeapAllocator::checkRangesMerged()` has no effect unless running in debug, `#ifdef` out the function; should fix CI warning in #5778
2023-11-07 17:51:55 -05:00
Goober5000 b5b922cbf0 Merge pull request #5779 from Baezon/fix-collision-bug
Fix collision bug
2023-11-07 17:19:15 -05:00
Asteroth 1cbeae2cd9 make sure these remain copies 2023-11-07 15:52:36 -05:00
Goober5000 4292303018 Merge pull request #5776 from Goober5000/fred_import_fixes
FRED import fixes
2023-11-07 15:30:27 -05:00
Jonas Frei 3ebdc51c48 Don't ignore user-set -O* flags 2023-11-07 21:21:28 +01:00
mjn-mixael 6e8ab64523 only untarget if we're in a mission 2023-11-07 08:33:44 -06:00
Asteroth 1b04d9f22c trigger state 2023-11-07 01:22:44 -05:00
Goober5000 4013cf6046 FRED import fixes
Some patches for mission imports:
1. Check that the path isn't empty (the user didn't select "This PC") before continuing
2. Count successful imports
3. Avoid treating an import as a newly saved single mission unless the import was successful
2023-11-07 01:09:10 -05:00
Goober5000 26df8e9a45 assert -> assertion 2023-11-06 13:24:06 -05:00
Goober5000 bb3e3eadfc additional optimizations 2023-11-06 13:24:06 -05:00
Goober5000 b5e215a85c optimization for checking whether subsystems are blown
In many calls to `ship_get_subsystem_strength`, the caller doesn't care about the actual number, just whether the subsystem type is destroyed.  So this adds an optimization to check specifically for that.  In the case of `SUBSYSTEM_ENGINE`, this avoids an iteration over every subsystem on the ship which, for a ship with many turrets, can be significant.
2023-11-06 13:24:04 -05:00
Goober5000 da4eeb3582 Merge pull request #5771 from Goober5000/const_modelcollide
protect model_collide input values
2023-11-06 13:07:45 -05:00
Goober5000 dc578c2479 Merge pull request #5772 from Goober5000/const_eeo
protect eval_enemy_obj_struct input values
2023-11-06 13:07:34 -05:00
BMagnu 3522f3be91 Removed unused variables (#5775) 2023-11-06 18:05:11 +00:00
Goober5000 bd52d75ab9 tweaks 2023-11-06 11:37:01 -05:00
JohnAFernandez a54dc0ded7 Merge pull request #5767 from BMagnu/scripting_in_mission_state
Add a scripting-in-mission state
2023-11-06 11:07:59 -05:00
Goober5000 c076cd11f1 feedback 2023-11-06 10:23:50 -05:00
JohnAFernandez b42c7af847 Merge pull request #5742 from JohnAFernandez/Get-rid-of-int3s
Get rid of remaining int3s in AI code
2023-11-06 10:07:05 -05:00
John Fernandez 5893ef836c Feedback 2023-11-06 09:47:46 -05:00
Asteroth 9eeb7e7983 add burst values 2023-11-06 03:22:21 -05:00
Goober5000 71fa18927c Merge pull request #5770 from Goober5000/fix_fred_warning
fix a FRED compilation warning
2023-11-06 01:55:39 -05:00
Goober5000 ae89ed2b9d convert some instances of frand_range to Random::next
Some of the `frand_range` calls were used for integer calculations, so we can use `Random::next` now.

This also reduces the number of C-style casts in the codebase.
2023-11-06 01:48:29 -05:00
Goober5000 24a4c0df6a protect eval_enemy_obj_struct input values
Add `const` to the `eval_enemy_obj_struct` struct so its values aren't inadvertently overwritten.  Handle a bit of const-correctness propagation.  Also add default member initialization to the struct.
2023-11-06 00:05:54 -05:00
Goober5000 a5f90ddcc1 fix a FRED compilation warning
One of the Voice Acting Manager dialog's strings is now too long for the .rc file and is truncated at 256 characters.  Fortunately this can be worked around by setting it at runtime.
2023-11-05 21:43:36 -05:00
Goober5000 3fe94fc3f4 protect model_collide input values
Add `const` to the `mc_info` struct so its values aren't inadvertently overwritten.  Tweak some of the collision code to prevent overwrites.

Also remove the `flak_muzzle_flash` declaration since that function no longer exists.
2023-11-05 21:17:46 -05:00
Goober5000 f89d437506 Merge pull request #5762 from Goober5000/command_tweaks
Command fixes and tweaks
2023-11-05 20:37:35 -05:00
Birk Magnussen 86a8c1c6f5 Make this a pushing state, not a setting state 2023-11-05 23:42:35 +01:00
Birk Magnussen f72fb68615 Also add the state name 2023-11-05 23:13:35 +01:00
Birk Magnussen 3447b76736 Also change header 2023-11-05 22:23:06 +01:00
Birk Magnussen 7dd52a4214 Add scripting state that does not end mission 2023-11-05 22:04:23 +01:00
Birk Magnussen 8671b9e2f7 Make res parsing a warning 2023-11-05 17:40:15 +01:00
Goober5000 b861989fb6 Merge pull request #5764 from Goober5000/tweak_soundtrack_warning
two small tweaks
2023-11-05 11:12:12 -05:00
Goober5000 1c8a272eca two small tweaks
1. Update soundtrack message to make it easier for modders to track down missing files
2. Update sexp help for ai-stay-near-ship to show the right argument count
2023-11-04 21:05:54 -04:00
Goober5000 221b0dc7ee Command fixes and tweaks
In a few places where the game checks for the command sender, it should check for #Command as well, as long as the mission flag to override #Command is present.

Additionally, while the mission's command sender was originally intended to be a ship, it has been used to specify an alternative to #Command as well.  But this caused problems when the "override #Command" mission flag was active, as it transformed a hashed source into a non-hashed source.  So this commit adds a check to treat the source as hashed, if necessary, if a replacement has occurred.

Fixes #5749.
2023-11-03 17:27:20 -04:00
John Fernandez 0a5cf6ad9d Try the std moves suggested by Coverity
For many coverity issues
2023-11-03 14:40:04 -04:00
JohnAFernandez 2cb12b8ff7 Merge pull request #5593 from MjnMixael/rank_display_names
Rank display name and title
2023-11-03 14:34:55 -04:00
JohnAFernandez 9f173e8cd9 Merge pull request #5750 from MjnMixael/log_timer_padding
Provide a way to account for timer padding in the mission log
2023-11-03 14:34:17 -04:00
JohnAFernandez 6588daaca5 Merge pull request #5758 from JohnAFernandez/Coverity-Improper-Use-Of-Negative
Coverity improper use of negative
2023-11-03 14:32:36 -04:00
JohnAFernandez 9cd648a206 Merge pull request #5760 from TheForce172/fix/5759
Fix #5759 Sticky Support Ship
2023-11-03 14:32:13 -04:00
The Force 44c797f65b Disable support hud when Force rearm done 2023-11-03 14:10:00 +00:00
The Force 46b9c27dfe Fix #5759
Code should only be run in Dock stage 4.
also add extra check if ship is repairing itself
2023-11-03 12:48:57 +00:00
John Fernandez 33e3b13d43 More limited check 2023-11-02 23:27:46 -04:00
John Fernandez 8351d4f623 Ensure we don't use bad indexes in argument_of ops
For coverity 1523820
2023-11-02 23:22:28 -04:00
John Fernandez e0443739bd Always double check that active_goal is positive
Both branches of this ternary assume that it's positive.  Coverity 1523821
2023-11-02 22:42:02 -04:00
JohnAFernandez 80a206151c Merge pull request #5752 from MjnMixael/global_disable_loadout_restoration
Mod setting to disable FSO's internal loadout restoration
2023-11-02 19:25:46 -04:00
JohnAFernandez 64a592d0d5 Merge pull request #5756 from MjnMixael/custom_data_bounds_check
Missed a couple out of bounds checks
2023-11-02 19:25:27 -04:00
JohnAFernandez c30559a63a Merge pull request #5698 from Goober5000/waypoints_upgrade
Waypoints upgrade
2023-11-02 19:24:55 -04:00
JohnAFernandez 245cec5a34 Merge pull request #5694 from MjnMixael/lua_audio_upgrades
Upgrade Lua Sound Handling methods
2023-11-02 14:36:38 -04:00
JohnAFernandez ddedc1bd8e Merge pull request #5739 from MjnMixael/fix_general_order_paths
how about an if/then/else that actually works?
2023-11-02 14:34:23 -04:00
JohnAFernandez 6b71812e7b Merge pull request #5744 from JohnAFernandez/Handle-Oct30-Covscan-issues
Handle oct30 covscan issues
2023-11-02 12:19:16 -04:00
JohnAFernandez 844e9affea Merge pull request #5729 from JohnAFernandez/Fix-pointer-to-local-scope
Change the scope of this pointer
2023-11-02 12:18:53 -04:00
mjn-mixael b69cdc08ee Merge branch 'master' into loadout_no_validation
# Conflicts:
#	fred2/fred.rc
2023-11-02 09:30:42 -05:00
mjn-mixael 69d56172b0 missed a couple out of bounds checks 2023-11-02 08:27:45 -05:00
Asteroth 9d2a89f778 fix subsys position getting (#5740) 2023-11-02 08:15:39 -04:00
Asteroth adcc19085d more docs 2023-11-02 02:30:38 -04:00
Asteroth faddde8307 Merge remote-tracking branch 'upstream/master' into particle-parent-size-factor 2023-11-02 02:27:59 -04:00
Asteroth 0355d2b8d1 update docs 2023-11-02 02:27:40 -04:00
JohnAFernandez 21f42ce47b Merge pull request #5536 from MjnMixael/mission_custom_data
Mission custom data
2023-11-01 20:24:37 -04:00
Asteroth 574b1e6197 accidental shadow 2023-11-01 19:46:00 -04:00
mjn-mixael 34e57d301a Mod setting to disable FSO's internal loadout restoration 2023-11-01 17:49:04 -05:00
Asteroth dc83e4f14a few fixes 2023-11-01 18:16:38 -04:00
Asteroth 3c837b7e9a add all the curves 2023-11-01 18:08:45 -04:00
John Fernandez c7b77a5b24 Add a weekly coverity workflow
Since we removed travis ci, coverity has been unused for six years.  This allows us to submit a linux build to coverity scanning once a week.
2023-11-01 17:06:41 -04:00
mjn-mixael 5a58ff46f2 Add check to mission version 2023-11-01 15:53:04 -05:00
mjn-mixael 4145717363 Merge branch 'master' into mission_custom_data 2023-11-01 15:50:41 -05:00
mjn-mixael eca583074a update check for 23_3 data 2023-11-01 12:59:25 -05:00
mjn-mixael 723bdcb9f1 Merge branch 'master' into loadout_no_validation 2023-11-01 12:56:05 -05:00
Goober5000 cb4fe955ea change GetColor() signature 2023-11-01 11:03:04 -04:00
mjn-mixael ed83ed79ec provide a way to account for timer padding in the mission log 2023-11-01 09:35:30 -05:00
Goober5000 02669338e8 C++ casts 2023-11-01 10:03:51 -04:00
Goober5000 6e86a3a035 Merge pull request #5747 from Goober5000/directive_special_fix
make sure events are current before they become special
2023-11-01 09:36:44 -04:00
Goober5000 4f8344c91e Merge pull request #5741 from Goober5000/misc_updates
some polishing of recent changes
2023-11-01 09:36:33 -04:00
Goober5000 643d18c6f8 Merge pull request #5746 from TheForce172/fix-shader
Fix #5743
2023-11-01 09:36:24 -04:00
JohnAFernandez 8dc481d034 Merge pull request #5736 from BMagnu/alpha_mult_glow
Account for Glow and Spec maps for alpha-multiplied ships
2023-11-01 04:01:47 -04:00
JohnAFernandez 3ba2193d3f Merge pull request #5624 from MjnMixael/xstr_debug_filter
xstr debug filter
2023-11-01 03:31:06 -04:00
JohnAFernandez 8693fa37eb Merge pull request #5732 from Baezon/fix-damaged-engine-max-vel
Fix for ets changes when engines are <15%
2023-11-01 03:30:22 -04:00
JohnAFernandez 3764146957 Merge pull request #5611 from MjnMixael/force_rearm_sexp
Force rearm sexp
2023-11-01 03:29:09 -04:00
John Fernandez 50c923d397 Have fallback for !pmi 2023-11-01 03:26:30 -04:00
Goober5000 617c903cbd tweaks 2023-11-01 00:31:39 -04:00
Goober5000 b6903fbdf4 make sure events are current before they become special
There is an implicit assumption in the code that the `MEF_DIRECTIVE_SPECIAL` flag could not be set on an event until after the `MEF_CURRENT` flag was also set.  This change makes that assumption explicit, and also adds a check in `mission_process_event` to be sure the flag setting doesn't happen out of order.  This situation is very rare, but can happen if the following conditions are true:

1. there is an event directive checking for the destruction of a wing
2. the wing has multiple waves
3. the directive uses the older `is-event-true-delay` technique to control when it is displayed
4. the directive becomes temporarily true before it can be displayed and while there are still waves remaining

This previously caused the "directive special" logic to occur before the "event current" logic occurred, skipping the proper setting of `born_on_date`.

Fixes Github #5725 and Mantis 930.
2023-11-01 00:00:45 -04:00
mjn-mixael dc751a9c5d address feedback 2023-10-31 16:33:27 -05:00
Goober5000 dff0b2acb4 convert event status to enum 2023-10-31 15:56:35 -04:00
Goober5000 ea10ac157f split off the event currency functionality from Sexp_useful_number and move the setting of it 2023-10-31 14:57:48 -04:00
mjn-mixael 173a3d23e8 add comments 2023-10-31 13:36:58 -05:00
The Force 98e20c0979 Fix #5743 2023-10-31 18:07:33 +00:00
JohnAFernandez db02a829aa Fix uninitialized scalars 2 (#5737)
* Make sure we handle unknown location types

Avoids edge-case gargabe pointer 1522974

* Make sure local vectors are at least set to zero

For coverity 1522985

* Make sure from_table is initialized

When creating a replacement texture object, for coverity 1522989

* Change to Unreachable to help Linters

This was a false positive uninitialized scalar, Coverity 1523726.  Hopefully, changing to UNREACHABLE() will help linters avoid this false positive in the future.

* Initialize xyw on this struct instantiation

For coverity 1523730

* Add early return for ade_set_args if error

For coverity 1523732
2023-10-31 13:49:44 -04:00
JohnAFernandez cfe92a4d32 Fix auto copies (#5738)
* fix inefficient (auto x : container) loops

* Don't make two copies of every element...

* Fix more loops

* Last inefficient auto loops
2023-10-31 13:47:48 -04:00
John Fernandez 7f9a10a9a0 ensure that these functions can rely on pmi
For coverity 1523731
2023-10-31 13:37:23 -04:00
John Fernandez 925e2e53f4 A few more int3's 2023-10-31 13:09:03 -04:00
John Fernandez 0e7f24bcac Make sure we don't load nonsense nebulas
For coverity 1523734
2023-10-31 12:51:16 -04:00
John Fernandez b2d85b8e2f Add early return for low level bug
For coverity 1523734
2023-10-31 12:46:17 -04:00
John Fernandez e23409f5f8 Remove the final INT3's in AI code 2023-10-31 10:32:48 -04:00
John Fernandez 381e45f483 Replace remaining Int3's in aibig and aicode
Replacing with Unreachables and Assertions
2023-10-31 09:49:02 -04:00
Goober5000 2d2db58905 some polishing of recent changes
1. The player can target other object types besides ships, so when creating an `object_ship_wing_point_team`, make sure it is a ship
2. A few recent mission features require a version bump, but not all missions use these features; so do a "soft bump" where the mission version is updated only if necessary
3. Remove an unneeded #include by adding a `struct team_data` declaration (see #5599)
2023-10-30 22:59:37 -04:00
mjn-mixael 2b3da41a6d how about an if/then/else that actually works? 2023-10-30 15:46:25 -05:00
mjn-mixael 9da948be56 fix type mismatch 2023-10-30 15:16:16 -04:00
Birk Magnussen 79454fb6c4 Also Alpha-Fade Glow and Spec 2023-10-30 20:08:33 +01:00
John Fernandez 10ed12182c Change the scope of world_goal_pos
Coverity 1523195, change the scope of this variable so that the pointer is not invalidated outside of the if block.
2023-10-30 11:05:43 -04:00
John Fernandez 6038076bf0 Add current_cmeasure > -1 check
This is an actual edge case bug.  If no countermeasure was set, and then one was set, there might be a garbage timestamp set that would give an incorrect countermeasure delay on next use.
2023-10-30 10:56:45 -04:00
John Fernandez 40c8cbbb25 Add check for negative index
For coverity 1523515
2023-10-30 10:56:45 -04:00
John Fernandez bd7429c353 Get rid of Extraneous check
Coverity 1523341 is pointing out this check, but shipp->ship_info_index is checked earlier just before we set the shipp pointer on line 1243
2023-10-30 10:56:45 -04:00
John Fernandez faf130adb3 Add Assertion for Coverity 1093701 2023-10-30 10:56:45 -04:00
John Fernandez f7fef072df Feedback 2023-10-30 10:56:18 -04:00
John Fernandez 0da6a4a64c Coverity 1523287
Fall back to standard behavior if no allowed paths.

Missing bracket
2023-10-30 10:56:18 -04:00
John Fernandez f542fea96e coverity 1523419
Avoid dividing by zero when there is just one autoscale ai class
2023-10-30 10:56:18 -04:00
John Fernandez 742326e42e Coverity 1523548 Divide by zero
Make sure we only use autoscale delay if there is more than one autoscale ai class.
2023-10-30 10:56:18 -04:00
John Fernandez e25a6517fc Add a check for 0
To avoid division by zero (in dubious circumstances) explicitly check for zero.  For coverity 1523313
2023-10-30 10:56:18 -04:00
John Fernandez be0c78dc72 Add checks for options_multi_vox_plist_get
For coverity 1093612, this function *should* never return zero, but it is no catastrophic if it does.  Allowing it to return a negative value in some unknown edge case would allow it to clobber some other global data.

So now add a check for negative values and take no action if those negative values are reached.  Assert on debug.
2023-10-30 10:55:41 -04:00
John Fernandez ef681affbf Make sure we don't clobber other memory
If this index is negative one return early before we accidentally clobber other data.

Coverity 1523181
2023-10-30 10:55:41 -04:00
Asteroth 729e448fe5 review fixes 2023-10-30 02:10:18 -04:00
Asteroth 96ae3d0608 Revert "fix subsys pos finding for improved subsys attack pathing"
This reverts commit 55ed0a08f6.
2023-10-30 00:44:37 -04:00
Asteroth 55ed0a08f6 fix subsys pos finding for improved subsys attack pathing 2023-10-30 00:44:22 -04:00
Goober5000 3a2ac5ab5f Merge pull request #5726 from Goober5000/persona_index_check
check for out-of-range persona
2023-10-30 00:01:03 -04:00
Goober5000 435676a67d Merge pull request #5730 from Goober5000/class_type_check
make sure class_type exists when used
2023-10-30 00:00:47 -04:00
Asteroth c017ef9b8a fix for ets changes when engines are <15% 2023-10-29 23:54:36 -04:00
Goober5000 4fbe3b7131 make sure class_type exists when used
A mission in Mantle caused an invalid vector access when checking whether to vaporize a ship whose ship type was -1.  Turns out having "no type" is actually allowed, so I audited all `class_type` accesses throughout the code for potential -1 accesses.  Most were properly checked but a few were not.  A few others needed to be tweaked.

(I suspect this is something that would be on the Coverity list if it isn't already.)
2023-10-29 15:17:22 -04:00
Birk Magnussen e071603ac0 Multiply emissive with alpha 2023-10-29 10:29:01 +01:00
Goober5000 87a4ae1e41 check for out-of-range persona
For missions which use the Persona Index method, make sure the mod doesn't load a persona index that is out of range for the personas it knows about.
2023-10-28 21:23:25 -04:00
mjn-mixael c738941ccf Provide Lua a way to toggle the mainhall help overlay 2023-10-28 19:16:09 -04:00
John Fernandez 5c25bb9bcb Just use the already existing SCP_string
The destination strings in player_order are already SCP_strings, so no need to use manual allocation
2023-10-28 19:15:25 -04:00
John Fernandez e0bc6d0ed7 Fix memory leak in tga file writing
Yes.  I know, I know, we're not going to use this code anymore.  But just in case, I don't want this memory leak to have the possibility to exist in the future.
2023-10-28 19:15:25 -04:00
mjn-mixael e6792ab441 Merge branch 'master' into lua_dynamic_enums
# Conflicts:
#	code/parse/sexp.cpp
#	code/parse/sexp.h
#	fred2/sexp_tree.cpp
#	fred2/sexp_tree.h
#	qtfred/src/ui/widgets/sexp_tree.cpp
#	qtfred/src/ui/widgets/sexp_tree.h
2023-10-28 17:50:26 -05:00
Mike Nelson ec706a6a87 Allow SCPUI saving current player data to file (#5718)
* Allow saving current player data to file

* return nil, dummy

* unused
2023-10-27 07:32:37 -04:00
John Fernandez 5d0127a764 Fix workflow by adding reference branch 2023-10-26 23:41:28 -04:00
Mike Nelson 91c15e6f48 Player general orders (#5638) 2023-10-26 19:22:44 -04:00
Asteroth a9fc7bab8a fix for particle culling (#5719) 2023-10-26 16:08:09 -04:00
Taylor Richards 042c85d213 revert workaround for the windows runner breakage (#5722) 2023-10-26 13:53:27 -04:00
Goober5000 bb3d59ecbe Merge pull request #5715 from Baezon/fix-hud-target-triangle
Bugfix HUD target direction triangle
2023-10-25 23:19:26 -04:00
Goober5000 d1c57391cf Merge pull request #5699 from Goober5000/handle_shuffled_parse_objects
handle parse objects that are out of order
2023-10-25 23:18:19 -04:00
mjn-mixael 5d6c34c2ab Upgrade lua sound handle with pause/resume methods and channel selection 2023-10-25 08:31:06 -05:00
Mike Nelson 5986b7143f Adds custom data for intel entries (#5660)
* adds custom data for intel entries

* update tests

* This one, too
2023-10-25 07:32:03 -04:00
wookieejedi 5d447951b4 Add Game Option to refresh selected weapon in loadout (#5713)
* Add Game Option to refresh selected weapon in loadout

This PR adds an option to always ensure the viewed weapon is one that can actually be on the selected ship when first clicking on the weapon loadout.

If you go to the loadout in the briefing and view the weapons on your ship, then go and change your ship class and go back to the weapon loadout screen, you will see that the weapon shown in the window on the right side is from your very first viewing before you changed your ship class. Displaying a weapon not allowed on a ship by default can be confusing to players, especially on mods like FotG where most ships have unique weapons.

The player can still of course click on a non-allowed weapon to view it, but with this PR the player will be initially shown a selected weapon that is allowed on the ship when opening the loadout editor.

Tested and works as expected.

* update order to be near weapon bools
2023-10-25 07:31:23 -04:00
Sébastien Noel f149c36b44 Fix a few typos (#5598) 2023-10-24 20:33:45 -04:00
Asteroth 34b6cf74ab whoops forgot the rval 2023-10-24 15:16:12 -04:00
Asteroth bc33f90e32 early return if z is 0 2023-10-24 14:32:56 -04:00
MageKing17 bb47531c55 Make lock_fov settable for aspect/javelin missiles. (#5493)
The code has always checked a per-weapon-class value called `lock_fov` when comparing the dot product of a ship to its target to see if it can lock on to it, however the weapon table hasn't ever included a way to set this value; it's always the default value of 0.85. This just adds "+Lock FOV:" entries to aspect/javelin homing missile parsing after "+Seeker Strength:", which will set `lock_fov` as long as the supplied input is between 0 and 360 degrees.
2023-10-24 07:26:54 -04:00
Asteroth aed90493ec make g3_project_vertex unconditionally project 2023-10-23 17:53:30 -04:00
John Fernandez d54c3e51e3 Apply Workaround to windows Build 2023-10-23 15:47:27 -04:00
Goober5000 a215bea0d0 unswap the net signatures 2023-10-23 15:29:06 -04:00
Goober5000 ec23f6bd0e Merge pull request #5709 from Goober5000/fix_loadout_crash
fix a crash in the apply-loadout-to-wing routine
2023-10-23 12:21:30 -04:00
John Fernandez d93d56e1c9 remove redundant setting of object_host 2023-10-23 10:24:13 -04:00
John Fernandez d2265325e9 check for nullptr to avoid nullptr dereference
For coverity 1093467
2023-10-23 10:24:13 -04:00
John Fernandez 2bb22a2153 Return to avoid nullptr dereference
For coverity 1093461.  If this is null, the function is done at this point.
2023-10-23 10:24:13 -04:00
John Fernandez 018c22eee1 Make sure Net_player is not null here
For coverity 1093460. Net_player should never be null here, but it is C++ after all.
2023-10-23 10:24:13 -04:00
John Fernandez 6ef60c67ca Make sure Multi_pxo_channels is not null
For coverity 1093458
2023-10-23 10:24:13 -04:00
John Fernandez 982e8d7f85 Add net_player nullptr check
Address coverity 1093457 by adding a nullptr check and Assertion.  This *should* never happen, but that's what asserts are for, right?
2023-10-23 10:24:13 -04:00
John Fernandez 8affd53cf6 Remove Unused Functions
These functions have not been called from what I can tell since the source code was released.  But they did happen to trigger a clang warning, so it's time to get rid of them.
2023-10-23 07:50:29 -04:00
Mike Nelson eeaf894b15 Message notes feature (#5541)
* Add stage notes feature for mission messages

* don't keep notes outside the mission editor

* use F_MULTITEXT and do lcl_replacements

* this should be multitext too
2023-10-23 07:38:33 -04:00
Goober5000 b546d897ae fix a crash in the apply-loadout-to-wing routine
If a wing has fewer than four ships, clicking the apply-to-all button will cause a vector subscript out of range error.  This fixes it.
2023-10-23 00:44:33 -04:00
John Fernandez d8aea4ad30 Add CMakePresets.json to gitignore 2023-10-22 22:54:24 -04:00
Goober5000 829692b7bd Merge pull request #5468 from Goober5000/5462_followup
additional cleanup from PR 5462
2023-10-22 17:10:42 -04:00
Goober5000 855935d4eb Merge pull request #5706 from Goober5000/fix_5705
fix change-soundtrack after <No Music>
2023-10-22 16:12:30 -04:00
Goober5000 f83efb54c0 fix change-soundtrack after <No Music>
The fix in #5578 assumed that a previously playing soundtrack would properly set the timestamp, but if no soundtrack was previously played at all, this wouldn't happen.  So if we deliberately don't play a soundtrack, be sure to set the timestamp as if `event_music_do_frame()` had been called.

Fixes #5705.
2023-10-22 15:31:02 -04:00
Mike Nelson 3ca26587eb add default player weapon flag (#5600) 2023-10-22 13:23:30 -04:00
John Fernandez 3e2bb36d4b Fix Redefined Macro Warning
Clarify
2023-10-22 00:37:18 -04:00
Goober5000 02bd62ff3c Merge pull request #5700 from Goober5000/special_to_supercap
change "special warp physics" to "supercap warp physics"
2023-10-21 17:34:20 -04:00
Goober5000 e1e0239914 also the dialog text 2023-10-21 16:40:31 -04:00
Goober5000 17ad0e09dd add const where appropriate to the jump node API
See title.
2023-10-21 15:59:24 -04:00
Goober5000 e621dbe997 Merge pull request #5464 from Goober5000/render_constify
add const where appropriate to the modelrender API
2023-10-21 15:57:24 -04:00
Goober5000 ea5c328c13 change "special warp physics" to "supercap warp physics"
Per discussion with @Baezon, this is a more precise term.
2023-10-21 15:51:16 -04:00
Goober5000 8c0bc25303 Merge pull request #5671 from Goober5000/subsystem_calculation_fix
add "Calculate subsystem hitpoints after parsing" option
2023-10-21 14:08:37 -04:00
Goober5000 6b0a3b7606 handle parse objects that are out of order
Occasionally, FRED can save a mission with a wing's ships out of order; this can happen if ships are deleted and FRED finds a free index in the middle of the ship list.  This can cause benign but confusing mismatches in the ship registry, the hotkey list, and other places -- and it's also possible some mismatches may not be so benign, e.g. in multiplayer.  Anyway, it's better for the ships to appear in the order the wing expects them, so this adds a routine to swap them around if necessary.
2023-10-21 13:40:09 -04:00
Mike Nelson 9afe76b5d2 force msaa in-game toggle to require restart (#5688) 2023-10-21 11:44:15 -04:00
Mike Nelson ad27664ebc Pause and Resume voices (#5636)
* pause and resume voices

* Use newer styling rather than the sound.cpp styling
2023-10-21 10:23:53 -04:00
Goober5000 2fe182a4b1 Merge pull request #5604 from Goober5000/drawString_tweak
small speedup to drawString
2023-10-21 01:28:23 -04:00
Goober5000 60c2718b91 add spacing 2023-10-20 23:26:46 -04:00
Tyler Blount 15d9b9b3db Merge pull request #5689 from MjnMixael/fix_lightshafts_optimization
Fix lightshafts and bloom in-game options
2023-10-20 15:09:03 -07:00
mjn-mixael a0c787aa83 Merge branch 'master' into lua_dynamic_enums 2023-10-20 16:13:15 -05:00
mjn-mixael d00003e199 Merge branch 'master' into fix_lightshafts_optimization 2023-10-20 16:11:34 -05:00
Tyler Blount 991d0ee2d6 Merge pull request #5696 from MjnMixael/deferred_lighting_ingame
Add deferred lighting as an in-game option
2023-10-20 14:09:33 -07:00
Goober5000 ee27abf693 make CI happy 2023-10-20 16:23:50 -04:00
Goober5000 6bcd2f730c update qtfred 2023-10-20 15:51:29 -04:00
Goober5000 c8d78816b0 remaining const updates 2023-10-20 15:32:46 -04:00
mjn-mixael 3eee74a31c remove unneeded header 2023-10-20 14:16:22 -05:00
mjn-mixael 941d5f7ec3 Move the option definition to a file that doesn't require glad.h for building and resolve xstr issue 2023-10-20 14:01:50 -05:00
Goober5000 b53f3fc803 handle ship_return_seconds_to_goal for WPF_BACKTRACK 2023-10-20 14:58:18 -04:00
Goober5000 d1f0b9343f change iterators 2023-10-20 14:58:18 -04:00
Goober5000 0b2d4768f3 new sexp for waypoint index and backtrack 2023-10-20 14:58:17 -04:00
Goober5000 42fc9891e3 waypoint upgrades 2023-10-20 14:58:17 -04:00
Asteroth 0cde26dd6e make invalid model_subsystem model nums a hard error (#5591) 2023-10-20 14:40:48 -04:00
Mike Nelson 7804f7fff5 add feature to always display the damage gauge (#5518) 2023-10-20 14:40:27 -04:00
Asteroth 832cec27ad bugfix missile time determination (#5595) 2023-10-20 14:40:02 -04:00
Mike Nelson 31acb115c2 Add nebula-fade-poof SEXP (#5612)
* nebula-fade-poofs

* Move this up because order of operations is important.

* Add some documentation

* Respect time compression

* Fix sexp description

* Make sure faded poofs do not flicker

* optimize
2023-10-20 14:39:38 -04:00
Goober5000 f9591b3a92 Merge pull request #5664 from Goober5000/fix_cheat_status
fix incorrect setting of disabled/disarmed flags when cheating
2023-10-20 14:27:37 -04:00
mjn-mixael 21f92194f1 Add deferred lighting as an in-game option 2023-10-20 12:38:53 -05:00
wookieejedi c605451460 Fix glare shining through cockpits in freelook (#5690)
Fixes #3098. The `shipfx_eye_in_shadow` function did a collision check for cockpits, bit did not previously take into account of the viewpoint had a non-forward orientation (ie the player was using free look). This PR sets the collide check to take that into account with a 1 line fix. Tested with multiple FotG cockpits and fixes the issue.
2023-10-20 07:39:25 -04:00
Taylor Richards 2acdc65875 add workaround for broken windows workflow (#5693)
Temporary fix for broken windows workflow. Hopefully a more permanent
solution will be found soon and we can then remove this.

Reference: https://github.com/actions/runner-images/issues/8598
2023-10-19 17:39:04 -04:00
Goober5000 b7de2fd644 Merge pull request #5554 from Goober5000/set_armor_type_generic
enhance set-armor-type to work with generic subsystems
2023-10-19 14:09:50 -04:00
Tyler Blount a226a81d80 Merge pull request #5692 from JohnAFernandez/master
Revert one "Fix" and add comments
2023-10-19 09:25:36 -07:00
John Fernandez eb39532f7c Revert one "Fix" and add comments
Only one of these was an actual memory leak.

Add comments to clarify
2023-10-19 11:42:24 -04:00
JohnAFernandez 1478ace3e0 Avoid edge case divide by zero (#5683)
* Add a divide by zero check

For coverity 1107324.  Keeps framecount from dividing by zero in very rare circumstances.

* Add a clarifying comment

This marks isNaturalNumberFactor() so that we know it is the best way to get whether a number is a natural number.

Modulo division is slower and gives the same results.

* Spoiled by Rust
2023-10-19 07:57:12 -04:00
JohnAFernandez 7edc5bf842 Change underlying type to avoid endianness problem (#5680)
Before this change if the wrong endianness was used, the c style cast that was used here would lead to the argument being passed to getsockopt to lack the actual information.

Fixes coverity 1093482

(Directly cast to socklen_t)
2023-10-19 07:56:21 -04:00
JohnAFernandez b8dc7d643d Fix two small memory leaks (#5679)
Fixes 1093679 and 1093680 from coverity by freeing if an early return is reached.
2023-10-19 07:55:23 -04:00
Goober5000 883ed32796 ai-disable-ship-tactical and ai-disarm-ship-tactical (#5512)
Add "tactical" versions of disable and disarm goals which only perform the specific task without implying anything else.  The target ship is not protected and attack goals are not cleared from other ships.

There is also a new AI profiles flag to make this the default hud squad message command instead of the classic disable/disarm.
2023-10-19 07:50:49 -04:00
Mike Nelson f3dfc85c0f weapon ignores countermeasures flag (#5628) 2023-10-19 07:49:06 -04:00
mjn-mixael bfd261a1d3 Merge branch 'master' into lua_dynamic_enums
# Conflicts:
#	code/parse/sexp/LuaSEXP.cpp
2023-10-18 23:11:39 -05:00
mjn-mixael e32ea7b694 Merge branch 'master' into fix_lightshafts_optimization
# Conflicts:
#	code/graphics/post_processing.cpp
2023-10-18 23:09:43 -05:00
Tyler Blount 7ef70f6d4d Merge pull request #5627 from MjnMixael/new_controls_xstrs
Add built-in xstrs for SCP-added controls
2023-10-18 20:21:49 -07:00
Tyler Blount 1b1afbf8d7 Merge branch 'master' into new_controls_xstrs 2023-10-18 19:51:26 -07:00
Tyler Blount bfdf05469b Merge pull request #5622 from MjnMixael/scpui_options_localization
SCPUI Options Localization
2023-10-18 19:50:43 -07:00
mjn-mixael aee48373ab Make sure these post processing variables are not optimized out of non Debug builds 2023-10-18 15:07:21 -05:00
mjn-mixael a2f1638a99 adjust XSTR IDs 2023-10-18 13:55:46 -05:00
mjn-mixael 762cf4cb88 We'll get this right eventually 2023-10-18 13:45:55 -05:00
mjn-mixael 705287c8d4 "nothing" to see here 2023-10-18 13:26:05 -05:00
mjn-mixael e2aac31912 Merge branch 'master' into scpui_options_localization
# Conflicts:
#	code/camera/camera.cpp
2023-10-18 12:49:48 -05:00
Tyler Blount a9f5a11813 Merge pull request #5686 from MjnMixael/lua_add_scrollback
Lua add scrollback
2023-10-18 10:21:01 -07:00
mjn-mixael b8728ed828 get team rather than team index 2023-10-18 08:59:24 -05:00
mjn-mixael de1110650f Adjust XSTR IDs per feedback 2023-10-18 08:42:25 -05:00
BMagnu b3295e5a2d Fix near z planes for the cockpit rendering (#5654)
* Properly unify cockpit near planes

* Properly pass near plane to deferred shader
2023-10-18 08:08:22 -04:00
Tyler Blount a6c1b1b04a Merge pull request #5605 from naomimyselfandi/more-message-filters
More message filters
2023-10-18 00:36:24 -07:00
Goober5000 b5fdf52e8c Merge pull request #5428 from Goober5000/remove_key_save
remove hud_squadmsg_save_keys()
2023-10-18 03:25:09 -04:00
Goober5000 c43f5bdd58 Merge pull request #5516 from Goober5000/pof_version_fix
POF version fix
2023-10-18 03:24:55 -04:00
Tyler Blount dc7fc774b8 Merge pull request #5662 from MjnMixael/on_intro_hook
Intro about to play hook
2023-10-18 00:24:44 -07:00
Goober5000 dad16f76c4 Merge pull request #5574 from Goober5000/generateWeaponGroupId
add mn.generateWeaponGroupId()
2023-10-17 20:06:27 -04:00
Goober5000 d10c59f6cc Merge pull request #5629 from Goober5000/arrival_warp_distance
add support for predicting arrival warp distance
2023-10-17 20:06:17 -04:00
Goober5000 3bd2fc9a56 Merge pull request #5677 from Goober5000/fix_5529
rewrite primary weapon cycling
2023-10-17 20:06:10 -04:00
Goober5000 fabff58d09 Merge pull request #5684 from Goober5000/prevent_repeated_death
don't kill/self-destruct ship if it's already dying
2023-10-17 20:05:29 -04:00
Mike Nelson 2fd3bf091d add waytpoint as allowed lua sexp parameter type (#5631) 2023-10-17 19:28:40 -04:00
Mike Nelson b4442d3423 double the allowed cargo (#5626) 2023-10-17 19:27:43 -04:00
Mike Nelson cf4cae7264 add dkjson as a default lua file (#5534) 2023-10-17 19:26:39 -04:00
Mike Nelson ebea1b1240 remove new lines from default generated mission (#5519) 2023-10-17 19:25:06 -04:00
mjn-mixael 54341acb9b allow use of enums 2023-10-16 15:54:53 -05:00
mjn-mixael 07fd188064 lua method to add a message directly to the message log.
(cherry picked from commit 1caceeaa2b9ebe654a102e293146dc23b9f3c2ee)
2023-10-16 15:21:37 -05:00
BMagnu 0cbe06884b Allow to Capture Mouse in FSO window (#5678)
* Allow to capture mouse, and also make window present

* Fix Typo
2023-10-17 03:57:21 +09:00
Goober5000 c1d3e5a2ad Merge pull request #5597 from Goober5000/maneuver_despite_engines
add a maneuver-despite-engines flag
2023-10-16 14:40:05 -04:00
Naomi Coffman 2bcedc34cc Respond to PR feedback 2023-10-16 12:36:48 -04:00
Goober5000 16892c3e46 Merge pull request #5670 from Goober5000/fly_to_ship_upgrade
fix and upgrade ai-fly-to-ship
2023-10-16 04:26:23 -04:00
Goober5000 5c88b75b94 Merge pull request #5524 from Goober5000/splash_aspect_ratio
aspect-ratio-specific splash screens
2023-10-16 03:26:10 -04:00
Goober5000 987c705bc9 address feedback 2023-10-16 03:24:53 -04:00
Goober5000 b89cbbd530 fix and upgrade ai-fly-to-ship
The ai-fly-to-ship goal was added early in FSO's development but never worked right.  Until recently it could crash; and even aside from the crash the AI would try to reach the target's exact position, causing repeated collisions.  This folds ai-fly-to-ship into ai-stay-near-ship, since the behaviors are conceptually the same except for fly-to being satisfied as soon as the target is in range.

This also adds a new "escort" mode usable by both behaviors.  The default Volition behavior is to swoop toward the target in a long, graceful arc; the new mode generates a goal point and flies directly to that point.  These can be toggled via an optional sexp parameter.

There is also some minor cleanup and a new vec3d operator for convenience.

Needed for Scroll; depends on #5667.
2023-10-16 03:24:52 -04:00
Goober5000 d3383d9d87 Merge pull request #5667 from Goober5000/refactor_mission_goal_achievable
refactor ai_mission_goal_achievable
2023-10-16 03:23:43 -04:00
Goober5000 4f6d9c36a8 don't kill/self-destruct ship if it's already dying
If a ship is in the process of dying, it shouldn't be killed or self-destructed again.  This fixes a bug noticed by RedMageJoe during the Derelict playthrough.

(This situation is distinct from a ship being hit while in the middle of its death roll.  That shortens the death roll but does not try to kill the ship again.)
2023-10-16 00:36:10 -04:00
JohnAFernandez a36157f582 Merge pull request #5540 from MjnMixael/lua_mod_root
LUA get mod root
2023-10-15 23:16:40 -04:00
JohnAFernandez 3837455004 Merge pull request #5617 from MjnMixael/allow_no_subcategory
Allow Lua SEXPs to not specify a subcategory
2023-10-15 23:15:59 -04:00
JohnAFernandez 808f7a88c6 Merge pull request #5557 from MjnMixael/lua_launch_url
Lua method to launch arbitrary url
2023-10-15 23:15:08 -04:00
Goober5000 79702273d5 some tweaks and clarifications 2023-10-15 16:55:50 -04:00
BMagnu d06018bcad Bump version to 23.3 (#5681) 2023-10-15 19:23:34 +00:00
Goober5000 ac87cde80d supercap check should come from params 2023-10-15 14:16:51 -04:00
Goober5000 06d9e02c34 sync up tokens 2023-10-15 13:48:23 -04:00
Asteroth 40233ae05f use a constant for excess speed 2023-10-15 13:43:49 -04:00
Goober5000 57192065d6 change assert to assertion 2023-10-15 13:43:49 -04:00
Goober5000 d2031a476a some fixes 2023-10-15 13:43:49 -04:00
Asteroth c60ea2d4a7 move supercap warp time constant 2023-10-15 13:43:49 -04:00
Asteroth 6843d48358 add math for predicting warp in distance 2023-10-15 13:43:47 -04:00
Goober5000 066b251052 implement UI work for arrival warp distance 2023-10-15 13:42:27 -04:00
BMagnu 4596600627 Fix hiDPI (#5673) 2023-10-16 01:44:33 +09:00
BMagnu ea262f90c0 Make version parsing available (#5655)
* Make version parsing available

* Consolidate version parsing

* Recode version parsing and write test

* remove copy paste error
2023-10-16 01:44:25 +09:00
BMagnu 02e84f212a Fix HUD slewing (#5656)
* Fixup HUD for slewing

* Fix Training Message box

* Lead indicator slew

* Fix HUD Message Head

* Correctly render messages

* Fix HUD offset handling

* HUD offset never makes any sense

* Cleanup offset code

* Remove unused parameter

* Fix Talking Head in RTT mode
2023-10-16 01:44:17 +09:00
Goober5000 a1d92afebf Merge pull request #5659 from Goober5000/objecttypes_warp_range_factor
allow modification of warp audible range via objecttypes.tbl
2023-10-15 12:43:23 -04:00
Goober5000 a20f3ca030 Merge pull request #5561 from Goober5000/special_warp_physics
add "special warp physics" to custom warpin parameters
2023-10-15 12:42:22 -04:00
Goober5000 e132fcf74c Merge pull request #5585 from Goober5000/beam_api_stuff
additional beam-related features for Lua
2023-10-15 12:41:05 -04:00
Goober5000 7a4df25fc5 Merge pull request #5566 from Goober5000/allowed_in_campaign
add AllowedInCampaign virtvar
2023-10-14 17:01:50 -04:00
Mike Nelson 08dfcc8b74 lua access to Support Ship availability (#5570) 2023-10-15 05:40:12 +09:00
Mike Nelson 0def45b381 add death message as a dialog hv (#5542) 2023-10-15 05:40:05 +09:00
Goober5000 be6a2b9196 add gr.killAllParticles (#5481)
Some scripts under development will benefit from access to the `particle::kill_all()` function.
2023-10-15 05:39:53 +09:00
Mike Nelson f7413be1d8 preload subspace tunnel flag (#5532) 2023-10-15 05:39:42 +09:00
Mike Nelson 02233fc439 Set timer padding sexp (#5535)
* set timer padding sexp

* allow negative padding
2023-10-15 05:39:33 +09:00
BMagnu febd8cd2ad Allow an asymmetric FOV / Frustrum (#5657)
* Enable Asymmetric Projection FOV

* Properly apply asymmetric FOV to g3_rotate_ functions

* De-CPP14-ify

* cleanup

* Make GCC happy

* Fix Vertical Asymmetric FOV

* Fix printf
2023-10-15 05:39:24 +09:00
Goober5000 bf7125724d small updates 2023-10-12 18:07:11 -04:00
Goober5000 efce98db47 rewrite primary weapon cycling
Remove a whole bunch of ad-hoc code piled on top of the retail weapon cycling behavior, then replace it with a robust algorithm that takes all relevant attributes into account.

Fixes #5529.
2023-10-12 17:50:04 -04:00
Birk Magnussen 0c8564f085 Add option for window-scaling 2023-10-12 20:41:59 +02:00
Goober5000 45abdefc07 add "Calculate subsystem hitpoints after parsing" option
Subsystem hitpoints are calculated as a percentage of the ship's hull strength as they are parsed.  If a modular table modifies the ship's hull strength, the subsystems are not modified at the same time.  This can lead to unreasonably large or small subsystem hitpoint values, as recently seen in the 1.3.0 version of Cardinal Spear.

This PR adds an option to defer hitpoint calculation until after parsing so that the subsystem is a percentage of the correct hull strength.  Since this may affect the balance of existing mods, it is off by default unless the build targets 24.0 or later.

This also removes the long-unused `hull_percentage_of_hits` check and adds several log statements for significant options in game_settings.tbl.
2023-10-06 20:52:22 -04:00
Goober5000 73c612034b log the filename 2023-10-06 13:07:46 -04:00
Goober5000 1ae9aaab21 Merge pull request #5669 from Goober5000/additional_shipstatus_fixes
additional ShipStatus fixes
2023-10-06 01:13:45 -04:00
Goober5000 3a46ed66ba additional ShipStatus fixes
Update the Lua enums to be consistent with the new ShipStatus enums.

Separately, add an extra ship registry check in the event a ship doesn't exist in the ship registry.
2023-10-06 00:38:23 -04:00
Goober5000 f98806b034 refactor ai_mission_goal_achievable
Change `ai_mission_goal_achievable` to use the ship registry instead of looking up the target repeatedly.
2023-10-05 23:15:28 -04:00
Goober5000 1812efa209 Merge pull request #5666 from Goober5000/fix_briefing_popup
fix replacement textures in briefing popup
2023-10-05 23:07:28 -04:00
Goober5000 2966757e62 Merge pull request #5668 from Goober5000/better_message
tweak error message
2023-10-05 23:07:20 -04:00
Goober5000 bc3aad374e tweak error message
For better debugging.
2023-10-05 22:23:02 -04:00
Goober5000 dcfea6f141 modify and address feedback 2023-10-05 17:32:53 -04:00
Goober5000 c5d192524e Merge pull request #5665 from notimaginative/add_mac_to_forum_posts
add macOS builds back to forum release build posts
2023-10-05 02:24:10 -04:00
Goober5000 7a47cc0521 fix replacement textures in briefing popup
Use the same method for texture replacement in briefing popups that is already used in the tech room.

Also don't render shadows when the jump node is displayed, since it's not being lit anyway.
2023-10-05 00:59:57 -04:00
Taylor Richards a33cc0f6c4 add macOS builds back to forum release build posts 2023-10-05 00:22:55 -04:00
Goober5000 af4ec4facc Merge pull request #5663 from Goober5000/fix_5661
remove incorrect setting of ship status
2023-10-04 23:10:52 -04:00
Goober5000 d897643217 tweak messages per feedback 2023-10-04 22:25:29 -04:00
Goober5000 5688ba8637 fix incorrect setting of disabled/disarmed flags when cheating
Normally the disabled/disarmed flags are only set if the destroyed subsystem is actually an engine or turret.  This should be done for cheats as well, otherwise, for example, destroying any subsystem on a non-engined ship will cause it to become disabled.
2023-10-04 22:18:44 -04:00
Goober5000 6631975e45 some additional fixes 2023-10-04 21:15:30 -04:00
Goober5000 fa2b135bb1 remove incorrect setting of ship status
There is a bit of code in missionparse that sets the parse object because in-game joining needs it.  This is unrelated to ship status, so the status shouldn't be changed.  This fixes the bug and adds a comment to clarify the situation, as well as some warnings to help track down incorrect joining states.

Fixes #5661.  Follow-up to #5658 (where the regression was introduced) and #4836 (which fixed in-game joining).
2023-10-04 20:46:22 -04:00
mjn-mixael 1ce9d46822 Intro about to play hook 2023-10-04 11:16:48 -05:00
Tyler Blount 7f4d78f44a Merge pull request #5639 from Goober5000/red_alert_wing_status
add wing status to red-alert system
2023-10-03 18:11:30 -07:00
Tyler Blount 10f484a504 Merge pull request #5649 from Goober5000/fix_ship_status
fix ShipStatus states to correctly account for exploding ships
2023-10-03 18:11:25 -07:00
Tyler Blount f0c8c9ad74 Merge pull request #5658 from Goober5000/fix_barrel_roll
fix barrel roll crash in Star Fox: Event Horizon
2023-10-03 18:11:18 -07:00
Goober5000 79579eda94 fix barrel roll crash in Star Fox: Event Horizon
The Star Fox barrel roll effect is achieved using a script which spawns a new ship.  The script sets no-collide on this spawned ship, but it also tries to set the ship flag for all future ships -- and future ships require a parse object, which doesn't exist for a created ship.  This patches the FALLTHROUGH in the sexp code to account for that possibility.

Separately, there are other ways a parse object pointer could become null through unusual code states, so this adds an INVALID status and several additional checks to defend against this crash in other circumstances.
2023-10-03 14:00:22 -04:00
Goober5000 f7b9896294 allow modification of warp audible range via objecttypes.tbl
The retail warp range multiplier can yield ridiculous results, like an Elysium warp being audible over 9000 meters away.  So allow the multiplier to be set via ship type.
2023-10-03 12:50:05 -04:00
Goober5000 be8ec82649 Merge pull request #5642 from BMagnu/fix_null_shiphit
Fix null dereference when a subsystem is hit for damage by a null object
2023-10-02 20:20:56 -04:00
Goober5000 b72b7688f9 Merge pull request #5634 from Baezon/fix-ai-subsys-attack-subobj
Fix for improved subsys attack pathing
2023-10-02 20:20:32 -04:00
Birk Magnussen c2e01864d5 Incorporate feedback 2023-10-02 17:48:03 +02:00
Goober5000 7a4d4466fd Merge pull request #5651 from Goober5000/fly_to_ship_mode_fix
fix crash when a ship has the fly-to-ship goal
2023-10-02 11:14:05 -04:00
Goober5000 ec75cac4d9 fix crash when a ship has the fly-to-ship goal
Add the missing AI mode in the switch block.  Also remove some redundant `break`s.
2023-10-02 00:04:02 -04:00
Goober5000 b6c0e8b562 fix ShipStatus states to correctly account for exploding ships
Adds a `DEATH_ROLL` status to specifically cover the state after ships have been destroyed but before they exit.  I've also audited all code that interacts with the ship registry to use the correct state with this new state taken into consideration.

This fixes access to exploding ships that was broken when the ship registry framework was introduced.  In particular, the `when destroyed X beam-lock-all X` QoL feature now works again.
2023-10-01 18:10:55 -04:00
JohnAFernandez 8d0570846b Merge pull request #5647 from notimaginative/fix_mac_id10t_error
fix bad extraction command in mac distribution zip
2023-10-01 12:55:19 -04:00
Taylor Richards 93d0624b3e fix bad extraction command in mac distribution zip 2023-10-01 03:22:15 -04:00
Goober5000 563445466e Merge pull request #5646 from Goober5000/warning_message_tweaks
tweak some model warning messages
2023-09-30 22:32:40 -04:00
Goober5000 b7e9d4c9cb tweak some model warning messages
Per a thread in the TBP forum, elaborate on these model warnings a bit.

Two other small code tweaks as well.
2023-09-30 20:06:41 -04:00
Birk Magnussen 348fb5ffb4 Change to variables 2023-10-01 01:25:38 +02:00
mjn-mixael 6d08a90106 Prevent out-of-range assert 2023-09-30 13:13:20 -05:00
mjn-mixael 92ed875e69 allow for lua enums to reference lua enums 2023-09-30 10:36:55 -05:00
Taylor Richards d754c2cb50 tweak directory copying for frameworks on macOS (#5641)
CMake's copy_directory functions follow symlinks recursively as opposed to
preserving them. For mac frameworks, which make use of symlinks for versioning,
this causes the files to be duplicated multiple times in the copied framework.
Using rsync instead, just for frameworks, will properly duplicate the framework
while still avoiding the "file exists" error from cp.
2023-09-30 08:51:35 -04:00
Taylor Richards b760c5dec8 tweak mac build packaging (#5640)
Use GNU tar instead of the default bsdtar. This works around some weird
corruption bug triggered by the combination of the GitHub runner-VM, the llvm
linker, and bsdtar.

Adjust intermediate filenames such that they don't get uploaded to
indiegames by mistake.

Unpack builds as a single step instead of two.
2023-09-30 08:51:01 -04:00
JohnAFernandez 9c9b06a1b1 Merge pull request #5635 from MjnMixael/fix_gameplay_help
Do not clear Help Text
2023-09-30 05:02:20 -04:00
Birk Magnussen 30da49be81 Fix null dereference when hit for damage by a null object 2023-09-30 09:55:47 +02:00
Goober5000 c2d0eafc36 add wing status to red-alert system
If consecutive red-alert missions have different numbers of ships in a wing, then calculating the number of waves will not be correct.  This necessitates the addition of wing status to the stored data for red-alert sequences.

Not only must wing data be stored in `Red_alert_wing_status`, but also in the CSG file.  This necessitates a version bump.  Fortunately, the current design of CSG files allows extra data to be added to a section without breaking old builds, since the CSG loader will just skip over the unrecognized data.

This also renames `red_alert_wingman_status` to `red_alert_ship_status` since it's not limited to wingmen, as well as fixing the omission of exited ships if they are in the player's wing but don't have the red-alert-carry flag.

Fixes #5637.  Follow-up to #4457 and #5609.
2023-09-28 21:14:11 -04:00
mjn-mixael e3c7f81412 do not clear this 2023-09-27 23:17:32 -05:00
Asteroth 2b155c7a30 separate variable 2023-09-27 16:40:29 -04:00
Goober5000 df69993a84 Merge pull request #5633 from Goober5000/tweak_weapon_detonation
fix weapon detonation
2023-09-27 15:30:44 -04:00
Asteroth 3fb5bf1f5f fix world pos getting of target subsys 2023-09-27 14:35:53 -04:00
Goober5000 6823e24350 fix weapon detonation
Add some extra logic implied by the `Begun_detonation` flag.  Missiles that are homing can have their targets, headings, speeds, and lifetimes changed for various reasons.  If a missile has begun detonation, particularly if it is in "detonation limbo" because it is flying across a bowl-shaped turret, we don't want to change any of that.  The "detonation limbo" weapon lifetime is only accurate if all of those values remain constant.

Follow up to #4006.
2023-09-27 13:30:37 -04:00
MageKing17 305a7f6630 Show both name and callsign in escort list.
In #5477, I made the escort list respect hidden names by copying the behavior from `message_queue_process()`, which already checked those flags; however, this resulted in some dramatic behavioral changes for mods using callsigns for escort ships, and while making the behavior optional was a possibility, feedback suggested everyone would rather it just behaved like the target box and displayed both. So I replaced the code with similar logic from hudtargetbox.cpp, except with the "replace hidden name with ship class" code taking priority.
2023-09-26 16:33:45 -07:00
mjn-mixael 14a98e1470 add built-in xstrs for these controls 2023-09-26 10:07:29 -05:00
Goober5000 4ba6191e0c Merge pull request #5623 from notimaginative/fix_macos_packaging
fix macOS build packaging issues
2023-09-25 17:14:44 -04:00
mjn-mixael cb5bf05424 update comments here 2023-09-25 15:58:11 -05:00
Tyler Blount b4f633767e Merge pull request #5616 from Goober5000/HomingSubsys_fix
some fixes for setting HomingSubsystem in script
2023-09-25 13:56:24 -07:00
Naomi Coffman 15db3b17bc Respond to PR feedback 2023-09-24 11:09:31 -04:00
mjn-mixael 1dc701270f optimize this entirely out of release builds 2023-09-23 18:35:36 -05:00
mjn-mixael 41b10e4d40 xstr debug filter 2023-09-22 23:44:15 -05:00
mjn-mixael ba2c37a1fe xstr the boolean default on/off as well 2023-09-22 23:24:52 -05:00
mjn-mixael aa997dd9ed Fix some overlapping xstrs 2023-09-22 23:11:08 -05:00
Taylor Richards 6dbfba2c9f fix macOS build packaging issues
- handle double archiving of macOS builds so they'll work properly with Knossos
 - fix issue where only a single configuration was included in the package
   (Release or FastDebug, not both)
2023-09-22 22:14:15 -04:00
Taylor Richards 9748de5ec1 Merge pull request #5621 from notimaginative/use_static_libstdc++
use static libstdc++
2023-09-22 22:13:05 -04:00
mjn-mixael a0a523223c clean up options builders and use delayed xstr for localization 2023-09-22 19:15:42 -05:00
Taylor Richards 0765c7be95 try and fix clang build error 2023-09-22 16:17:23 -04:00
Taylor Richards 73f8e57961 statically link to libstdc++
Statically link to libstdc++ for CI/CD builds in an attempt
to avoid compatibility issues without relying on a crippled
docker build image.

Should properly fix #5571
2023-09-22 15:13:43 -04:00
Taylor Richards 743d8dd666 Revert "Revert "Update build image with curl and jq preinstalled""
This reverts commit f67814aaae.
2023-09-22 15:12:20 -04:00
mjn-mixael 8fbf22a055 allow lua sexps to not specify a subcategory 2023-09-21 10:12:17 -05:00
Goober5000 7b410b2116 some fixes for setting HomingSubsystem in script
1. Allow setting the homing subsystem if the homing object has already been set
2. Use the `weapon_set_tracking_info` function if setting both object and subsystem, as it handles several important homing things
2023-09-20 23:29:04 -04:00
Tyler Blount 8fed4437ee Merge pull request #5614 from MjnMixael/fix_setting_mission_stats
Fix setting mission stats
2023-09-20 10:57:05 -07:00
Tyler Blount ad25418f92 Merge pull request #5613 from MjnMixael/fix_get_shipclass_kills
Fix Lua API Error with Player Stats
2023-09-20 10:52:15 -07:00
mjn-mixael 5972457ad5 fix setting mission stats 2023-09-19 10:57:30 -05:00
mjn-mixael 35876bc17e fix api error 2023-09-18 23:15:56 -05:00
mjn-mixael f2d0bfdb31 add abort rearm 2023-09-18 09:06:09 -05:00
mjn-mixael 6350a67e73 Cleanup force-rearm 2023-09-18 09:05:53 -05:00
Goober5000 46fa212db6 Merge pull request #5610 from Goober5000/collide_and_no_collide_sync
sync setting and getting of collides and no_collide
2023-09-17 18:28:22 -04:00
Goober5000 d0d65cd30c Merge pull request #5609 from Goober5000/red_alert_followup
improve checks for red-alert status
2023-09-17 18:28:15 -04:00
Goober5000 cb0e9ce601 sync setting and getting of collides and no_collide
The `collides` and `no_collide` flags are equivalent, but opposite.  So when sexps or scripts get or set those flags, allow each to be used as an anti-synonym (not exactly an antonym) for the other.
2023-09-17 01:23:31 -04:00
Goober5000 13bc0362c8 improve checks for red-alert status
Two fixes for red alert missions:
1. Since any ship in the wing can be stored, not just the wing leader, the "prospective name" check should check for all possible names in each wave
2. If a wing wasn't actually stored, the red alert code should not reset the wing's wave number to 0

Follow-up to #4457.
2023-09-17 00:17:39 -04:00
Goober5000 bfad425738 move -no_unfocused_pause
As requested on Discord.  I don't use this option myself, so I welcome any arguments why this should or shouldn't change categories.
2023-09-16 22:27:21 -04:00
Goober5000 5749b856df Merge pull request #5606 from Goober5000/revert_5547
Revert 5547 and 5580
2023-09-16 15:39:35 -04:00
Goober5000 f67814aaae Revert "Update build image with curl and jq preinstalled"
This reverts commit 0219e65b00.
2023-09-16 14:58:39 -04:00
Goober5000 24daea79f3 Revert "Change ubuntu-latest to ubuntu-20.04"
This reverts commit 45306da4fe.
2023-09-16 14:58:27 -04:00
Goober5000 0f013f920b Revert "modify per feedback"
This reverts commit 679c3606c5.
2023-09-16 14:58:17 -04:00
Naomi Coffman 0811c7037b Allow (easily) requiring an exact mood match 2023-09-16 13:47:00 -04:00
Naomi Coffman f13a5b3736 Allow specifying tiebreakers between builtin messages 2023-09-16 13:47:00 -04:00
Naomi Coffman 04a5778235 Allow filtering builtin messages by nearby ships 2023-09-16 13:47:00 -04:00
Goober5000 5a941c1d59 small speedup to drawString
Since `gr_string` can accept a length parameter, there's no need to copy each line before it is drawn.

Related to #5495 but not one of the two options mentioned.
2023-09-16 13:43:11 -04:00
Goober5000 d0c3c7db21 Merge pull request #5602 from Goober5000/sexp_fixes
fix crash in unusually formatted handwritten SEXP
2023-09-16 13:34:26 -04:00
Goober5000 be678c2f54 Merge pull request #5603 from Goober5000/fix_message_candidates
fix random selection of message candidates
2023-09-16 13:34:14 -04:00
Naomi Coffman 9586f21780 Add team filters to messages 2023-09-16 10:24:40 -04:00
Goober5000 ed5a5861f7 aspect-ratio-specific splash screens
Adds the ability to specify an aspect ratio, or a range of aspect ratios, to be used by splash screens.
2023-09-16 02:18:10 -04:00
Goober5000 16180306ad fix random selection of message candidates
The `Random::next(low, high)` function returns a value in [low, high].  This location should use the single-argument version, `Random::next(int modulus)`, which returns a value in [0, modulus-1].
2023-09-16 02:12:22 -04:00
Goober5000 865045a231 fix crash in unusually formatted handwritten SEXP
As reported by Colt, there was a crash in the in-mission jump sequence in Shepherds where the mission previously worked.  The proximate cause was a handwritten SEXP called via script that omitted whitespace before an opening parenthesis.  This was incorrectly recognized by the upgraded SEXP parser as an invalid SEXP.  Unfortunately, a separate bug in `get_line_num()` caused a crash when the parser tried to display a warning, because the function tried to calculate the line number of a SEXP that did not come from a parsed file.

This commit fixes the parser to recognize opening parentheses even when no whitespace precedes them, moves the output to the 'unexpected end of sexp' warnings will they will now be seen, and fixes `get_line_num()` to work when there is no parsed text.

Follow-up to #5520.
2023-09-15 15:12:44 -04:00
mjn-mixael e387038cc3 base implementation of force-rearm 2023-09-15 13:55:37 -05:00
Tyler Blount 0b54c741a6 Merge pull request #5599 from MjnMixael/fix_scpui_reset_loadout
Actually reset the weapon pool with SCPUI
2023-09-14 15:26:32 -07:00
mjn-mixael baa34f1ffe Actually reset the weapon pool, dummy 2023-09-14 10:46:52 -05:00
Goober5000 89b33ebbc5 add a maneuver-despite-engines flag
This flag ignores engine status when determining whether and how a ship can maneuver.  Implements #5503.
2023-09-13 22:36:58 -04:00
Goober5000 53e6edf8bb documentation 2023-09-10 17:40:02 -04:00
Tyler Blount 0220ad0563 Merge pull request #5594 from MjnMixael/fix_campaign_saving_scpui
Save player after changing campaign in scpui
2023-09-10 13:55:59 -07:00
Tyler Blount 910521bdfe Merge pull request #4457 from JohnAFernandez/restore-red-alert-flags
Fix wing persistence and ensure checks for depleted wings are valid
2023-09-10 13:55:34 -07:00
Goober5000 7003e5caa2 get the wave count correct 2023-09-10 13:49:31 -04:00
mjn-mixael 8efe146300 save player after changing campaign in scpui 2023-09-09 23:01:59 -05:00
mjn-mixael 52b7a3d198 rank display name and title 2023-09-09 10:54:04 -05:00
Asteroth a14fb35713 initialize trail info better (#5588) 2023-09-09 02:41:55 -04:00
Goober5000 2d0dc7798d unused variable 2023-09-09 00:41:44 -04:00
Goober5000 8242e3b94b small edits 2023-09-08 19:40:53 -04:00
Goober5000 16cb6b3f2f rewrite red-alert bashing routine 2023-09-08 19:13:58 -04:00
Goober5000 8c9be400a6 Merge branch 'master' into restore-red-alert-flags 2023-09-08 00:57:54 -04:00
Goober5000 7974a682ef Merge pull request #5581 from TRBlount/briefing_icon_scale_followup
Follow-up for briefing icon scaling
2023-09-07 23:12:11 -04:00
Goober5000 41af098d19 Merge pull request #5582 from TRBlount/starfield_timestamp_fix
Update starfield animation handling
2023-09-07 23:12:04 -04:00
Goober5000 4c95370f74 add parse object flag for starting wing, and move starting wing checks to post-processing 2023-09-07 20:56:54 -04:00
Goober5000 a6730a997c feedback 2023-09-07 19:15:56 -04:00
Goober5000 c5b84d9406 Merge pull request #5589 from Goober5000/beam_armor_fix
supply parameter for is_beam in all armor checks
2023-09-07 16:40:52 -04:00
Tyler Blount d2f5a12d5f Add parentheses to make order of operations more clear 2023-09-06 19:26:20 -07:00
Tyler Blount 6f6e839bbf Update starfield animation handling 2023-09-06 19:23:48 -07:00
Goober5000 065524fd4b Merge pull request #5586 from Goober5000/firepoint_followup
fix the logic for lighting up firing points
2023-09-06 18:22:27 -04:00
Goober5000 c84cb7ab64 supply parameter for is_beam in all armor checks
For certain calculations involving armor, the `GetDamage` function needs to know if the damage is being applied by a beam so it can apply the calculations with the proper frametime.  The parameter was not provided in all cases, so this fixes that.

Follow-up to #1609.
2023-09-06 18:17:37 -04:00
Goober5000 587ed4e41f convert magic number to constant 2023-09-06 12:13:36 -04:00
Goober5000 8b8daece46 additional beam-related features for Lua
1. Add a `vanish()` function for beam objects, to be consistent with other object types
2. Add a `BeamFree` virtvar, analogous to `TurretLocked`
3. Add timestamp variants of TurretLocked and BeamFree to be consistent with sexps
4. Add `BeamLife`, `BeamWarmup`, and `BeamWarmdown` virtvars so scripts can access table properties
5. Add "On Beam Death", "On Beam Warmup", and "On Beam Warmdown" hooks
6. Clarify some existing documentation and patch a couple things
2023-09-06 00:28:07 -04:00
John Fernandez d73d46feb2 Stupidest typo in history 2023-09-04 14:50:01 -04:00
Goober5000 a881b339cc fix the logic for lighting up firing points
The firing point gauge did not work as advertised; this fixes it.  Unselected weapons are dimmed, selected weapons are normal, and firing weapons are bright.
2023-09-04 14:25:06 -04:00
Tyler Blount 1f90be0a86 Merge pull request #5584 from Goober5000/firepoint_fix
fix crash in firepoint gauge
2023-09-04 11:06:42 -07:00
Goober5000 4ce02ce291 fix crash in firepoint gauge
The gauge assumes that all firepoints will always have weapons, but it's possible for a ship to have less than the maximum number of weapons.
2023-09-03 18:07:40 -04:00
John Fernandez 7d83ece711 And make sure we can call the constructor 2023-09-01 19:34:25 -04:00
John Fernandez 9ee1a6eb23 Add a constructor for red_alert_wing_status 2023-09-01 19:25:36 -04:00
John Fernandez f258554304 add bash wingman status
And function calls.
2023-09-01 19:02:19 -04:00
John Fernandez 994048eb24 Create Struct And functions for restoring wings
This needs to be separate from ships
2023-09-01 16:54:46 -04:00
Tyler Blount 0af3197a90 Follow-up for briefing icon scaling 2023-09-01 12:15:41 -07:00
Goober5000 e5824b41bb Merge pull request #5580 from Goober5000/ubuntu_version_tweak
Change ubuntu-latest to ubuntu-20.04
2023-09-01 12:41:25 -04:00
Goober5000 679c3606c5 modify per feedback 2023-08-31 17:30:08 -04:00
Mike Nelson acbab034cc wtf (#5579) 2023-08-30 23:03:48 -04:00
Goober5000 45306da4fe Change ubuntu-latest to ubuntu-20.04 2023-08-30 22:57:29 -04:00
Goober5000 f09c7b3ba5 Merge pull request #5577 from Goober5000/additional_music_checks
additional music checks
2023-08-30 13:11:28 -04:00
John Fernandez 964f495238 A theoretical fix for invalid checks
Replace `wingp->num_waves == 0` with valid `wingp->current_wave >= wingp->num_waves` and correct six year old copy paste error.
2023-08-29 01:25:33 -04:00
Goober5000 865f7e725c Merge pull request #5578 from Goober5000/soundtrack_start_fix
fix soundtrack timestamp when change-soundtrack is called immediately
2023-08-27 16:33:28 -04:00
Goober5000 6a550a6701 additional music checks
This adds several fixes to make the event and menu music more robust:
1. The game will now run with zero soundtracks.  All accesses into a potentially empty vector should now have checks.
2. Soundtracks and menu music are now checked for validity before being played (not just when importing a FSM mission).
3. The parsing validity checks and the in-game event music now check for skippable patterns using the same function.
4. Zero measures and zero samples-per-measure now cause the game to skip a pattern.  Negative values now trigger a warning.
5. Omitting some or all of the `$Name:` lines for a soundtrack will not cause an assert.

Fixes #5576.  Follow-up to #5572.
2023-08-25 19:22:03 -04:00
Goober5000 ad2531efcc fix soundtrack timestamp when change-soundtrack is called immediately
There is a built-in delay for the event music to start playing, but this delay gets stepped on if `change-soundtrack` is called when the mission first starts.  So don't set the delay unless it has already elapsed at least once before.
2023-08-25 19:20:21 -04:00
Goober5000 8af06b9e78 Merge pull request #5575 from Goober5000/obj_sound_fix
fix persistent sounds not clearing their tally
2023-08-25 19:08:06 -04:00
Goober5000 b6eef2e8f2 fix persistent sounds not clearing their tally
When a non-looping persistent sound expires, `obj_snd_stop()` actually does need to be called.  Even though the sound is no longer playing, the `Num_obj_sounds_playing` tally needs to be decremented, otherwise it will eventually exceed its limit and prevent any additional persistent sounds from playing.  And it turns out `obj_snd_stop()` returns gracefully for sounds that aren't playing.

Follow-up to #3510.  Fixes a bug that appears to have been around since retail.
2023-08-25 13:27:09 -04:00
Goober5000 344e231058 add mn.generateWeaponGroupId()
The `mn.createWeapon()` function takes an optional group ID for weapons that share lighting, but the internal `weapon_create_group_id()` function was never exposed to the API.  This adds that.
2023-08-25 02:39:40 -04:00
BMagnu 2feeb34629 Move light calculation out of vertex shader (#5573) 2023-08-25 05:46:02 +09:00
Goober5000 9d28ba568c Merge pull request #5572 from Goober5000/5567_followup
fix validity check for soundtracks
2023-08-23 22:28:53 -04:00
Goober5000 1b6ed75d73 filename is already truncated 2023-08-23 21:10:05 -04:00
Goober5000 4cf7ab3474 fix validity check for soundtracks
Since event music soundtracks use the exact file extension specified (see #5567), the validity check should also use the exact file extension specified.

Also, move the validity check to after parsing has completed because extensions may be overridden.
2023-08-23 20:39:26 -04:00
mjn-mixael b7045f1756 do not validate loadouts feature 2023-08-22 23:29:18 -05:00
Goober5000 bd4b9cb0d7 Merge pull request #5568 from Goober5000/fix_campaign_crash
fix crash in campaign editor
2023-08-22 20:32:13 -04:00
Goober5000 926e10584c Merge pull request #5567 from Goober5000/event_music_extension_agnostic
handle extension mismatch in event music
2023-08-22 20:32:05 -04:00
Goober5000 defab61664 handle extension mismatch in event music
Currently, menu music will trim the extension and look for both OGG and WAV files, but event music will use the exact extension specified.  This is intended but could lead to unexpected results in mods, so display a warning for the modder.
2023-08-22 15:48:21 -04:00
Goober5000 7dc971a6f2 fix crash in campaign editor
The crash in #5514 appears to be caused by some of the graphics code not being in the expected state for the synchronization.  Looking at the code in `render_frame()`, a `gr_flip()` happens after one frame ends and before the next frame begins.  That implies that this `gr_flip()` should not be here, as it is in the middle of a frame.  For additional evidence, `gr_flip()` modifies the "uniform buffer manager" state, and that is part of the stack trace preceding the crash.  Removing this `gr_flip()` fixes the crash.

The strange thing is that this code *doesn't run at all* while the campaign editor is active.  I verified this by adding a MessageBox in place of `gr_flip()`; the MessageBox doesn't display until the campaign editor is exited.  And yet, FRED crashes with `gr_flip()` present and doesn't crash with it removed.  This calls for a new category of bug; I propose "spookybug", from spooky action-at-a-distance.

Fixes #5514.
2023-08-22 12:47:14 -04:00
Goober5000 e0a6ca9abd Merge pull request #5563 from Goober5000/movie_subtitle_font_tweak
fix $Movie subtitle font: for custom fonts
2023-08-21 16:42:11 -04:00
Goober5000 210a9a8309 add AllowedInCampaign virtvar
These can be used to set whether a ship or weapon is allowed in loadouts, without necessarily waiting for the mission to be accepted.
2023-08-21 16:32:56 -04:00
Goober5000 613fad21c9 fix $Movie subtitle font: for custom fonts
The default movie subtitle font is font01.vf, but mods with custom font tables might not use this font.  So this changes the handling slightly so that the movie player will use whatever the first available font is.

Follow-up to #1523.  Fixes a sometimes spurious warning in mod initialization.
2023-08-19 13:25:13 -04:00
Goober5000 91497d5056 Merge pull request #5560 from Goober5000/fred_help
improve launching of FRED help
2023-08-17 21:25:16 -04:00
Goober5000 6b3e50dade add "special warp physics" to custom warpin parameters
Supercaps use a physics flag on warpin that makes them slow down faster than they would under the normal physics code.  This adds that flag as an option for custom warp parameters.

Since flags are not yet parsed when warp parameters are parsed, the code needs to skip ahead and peek at the flags in the same way as the weapon override.
2023-08-16 19:07:30 -04:00
Goober5000 e796a4fe00 improve launching of FRED help
1. Fall back to the FREDzone help docs if the local files cannot be found
2. Tweak url_launch error message and add a return value

This consequently removes the ReleaseWarning which wasn't the friendliest or clearest way to tell the user about a missing help file.
2023-08-16 12:28:53 -04:00
Goober5000 03f01604d9 Merge pull request #5559 from Goober5000/fix_5515
assign weapon particle effects properly
2023-08-16 11:27:30 -04:00
Goober5000 1547526057 Merge pull request #5558 from Goober5000/streaminganim_extension
some streaming animation fixes
2023-08-16 11:27:21 -04:00
Goober5000 7602b88756 assign weapon particle effects properly
Since `std::unordered_map.insert` does nothing if a key already exists, use bracket notation.  Fixes #5515.
2023-08-15 23:16:07 -04:00
Goober5000 4812ff529d Merge pull request #5550 from Goober5000/modular_weapon_flags
fix flags in modular weapon entries being cleared
2023-08-15 17:41:26 -04:00
Goober5000 fe42c7bdff make alpha value work for streaming EFFs 2023-08-14 18:07:21 -04:00
Goober5000 f706d6c0a0 use the correct resize mode 2023-08-14 17:40:47 -04:00
Goober5000 16b9225533 remove extensions from streaming animations
Since other functions in the scripting API remove extensions before loading the files, and since the internal functions expect them to be removed, the streaming anim API should handle that too.
2023-08-14 16:41:20 -04:00
mjn-mixael 9a7500de36 lua method to launch arbitrary url 2023-08-13 09:27:30 -05:00
Goober5000 64d9b6fb74 Merge pull request #5548 from Goober5000/stay_near_ship_fixes
ai-stay-near-ship fixes
2023-08-13 09:27:52 -04:00
Goober5000 b40f5a15b2 Merge pull request #5553 from Goober5000/nightly_porphyrion_to_perses
nightly build updates
2023-08-10 00:07:24 -04:00
Goober5000 52a5c356cf Merge pull request #5551 from Goober5000/dock_goal_achievability
remove Int3()'s in ai_mission_goal_achievable
2023-08-09 23:51:56 -04:00
Goober5000 e71dba4207 enhance set-armor-type to work with generic subsystems 2023-08-09 18:21:19 -04:00
Goober5000 3b42ee42ca put the hull and shields at the top to be consistent with other sexps 2023-08-09 17:23:13 -04:00
Goober5000 b270c44ede use https for indiegames 2023-08-09 15:17:45 -04:00
Goober5000 6cf6f8a6fe update server 2023-08-09 15:14:43 -04:00
Goober5000 c273496c1e remove obsolete build files 2023-08-09 15:08:36 -04:00
Goober5000 8933aaff38 address feedback and add more chex 2023-08-09 15:01:41 -04:00
Goober5000 a3de0db735 remove Int3()'s in ai_mission_goal_achievable
As reported by Woutersmits, the GTT Nova did not dock with the GTD Hall in the first mission of Black Horizon.  Attempting to run a debug build caused a CTD.  Investigation showed that there was an invalid dockpoint triggering an Int3().  The dockpoint has been fixed, but to aid troubleshooting in the future, the Int3()'s in this function have been changed to more appropriate functions.
2023-08-09 04:11:47 -04:00
Goober5000 0dcb60f805 fix flags in modular weapon entries being cleared
When weapon flags are parsed in a modular table and override the previous set of flags, certain flags must be kept to preserve the behavior of the weapon.  The previous `preset_wi_flags` technique only worked if all such flags (homing, has-display-name, even whether the weapon turns) were set in the same modular table.  If a modular table overrode the flags but didn't specify those lines over again, mysterious and subtle bugs would occur.

This modifies the flag parsing to explicitly preserve all appropriate flags from the existing weapon entry, which fixes the bug.  It also allows all of the flags to be specified in one place, rather than scattering `preset_wi_flags` assignments throughout `parse_weapon`.  And this also adds quite a few flags to the flag list that were not handled at all under the previous design.

Finally this fixes a few incorrect assignments of default values to fields that should only happen the first time a weapon entry is parsed.
2023-08-09 01:49:35 -04:00
MageKing17 1bc7732b6e Merge pull request #5549 from MjnMixael/fix_sexp_descriptions
Correct a few sexp descriptions
2023-08-08 22:44:41 -07:00
mjn-mixael 2a64abfe92 correct a few sexp descriptions 2023-08-08 17:00:12 -05:00
Goober5000 d1e81be2aa ai-stay-near-ship fixes
Three fixes:
1. In commit fa0878b6b3 for PR #5338, the optional distance parameter was inadvertently changed to a bool.  This fixes the parameter.
2. The distance parameter was previously parsed using `atoi` which works for number literals, so change to `eval_num` to allow sexp return values.
3. Make `eval_num` consistent with `eval_sexp` in the sense that evaluating an empty list is valid and returns false or 0.

Also takes advantage of the fact that `is_sexp_true` works for empty lists to streamline optional arguments in `ai_add_goal_sub_sexp`.
2023-08-08 13:07:21 -04:00
Goober5000 e285641ac6 Merge pull request #5528 from Goober5000/detonate_on_expiration
'detonate on expiration' weapon flag
2023-08-07 22:18:58 -04:00
Goober5000 d3b1ad4328 remove vestigial debug variables 2023-08-07 16:59:02 -04:00
Tyler Blount 914f0e13e3 Merge pull request #5526 from Goober5000/hud_set_coords
add screen resolution scaling for hud-set-coords
2023-08-06 15:22:08 -07:00
m!m df68da3dd6 Merge pull request #5547 from asarium/image_curl_jq
Update build image with curl and jq preinstalled
2023-08-06 18:15:05 +02:00
asarium 0219e65b00 Update build image with curl and jq preinstalled
The install step in the CI pipeline is no longer needed after this
change and has been removed.
2023-08-06 17:09:42 +02:00
m!m cc171a6344 Merge pull request #5546 from asarium/fix_file_exists
Fix "File exists" error
2023-08-06 16:44:23 +02:00
asarium 7d066a1c45 Fix "File exists" error
Copying a file with cp on top of another one is not allowed by default
so switching the command to use the CMake provided one will fix the
issue and will also unify the commands for all platforms.

The directory support is necessary for Mac where the SDL library is
actually a directory.
2023-08-06 14:46:46 +02:00
mjn-mixael accb842ffa fix duplicate detection 2023-08-04 18:41:07 -05:00
Tyler Blount 6677fcabae Merge pull request #5513 from Goober5000/fred_campaign_path
fix a couple bugs in the campaign editor
2023-08-04 13:46:44 -07:00
Tyler Blount 171d36bf7f Merge pull request #5527 from Goober5000/fix_5507
add model filename back into debug log
2023-08-04 13:46:35 -07:00
Tyler Blount 9018ddf0d5 Merge pull request #5539 from MjnMixael/fix_bitmap_fps
Fix animated background bitmaps rendering with incorrect framerate
2023-08-04 13:46:28 -07:00
Tyler Blount d847236dd2 Merge pull request #5537 from MjnMixael/fix_loadout_ctd
Fix: Prevent loadout related CTD
2023-08-04 13:46:20 -07:00
mjn-mixael bb6b010487 lua get mod root 2023-08-02 12:04:33 -05:00
mjn-mixael 0ee3d099ab and not or dummy 2023-08-02 09:28:07 -05:00
mjn-mixael 9aa48579b0 also check upper range 2023-08-02 09:19:26 -05:00
mjn-mixael bb28d0b859 account for very low framerates 2023-08-02 09:17:01 -05:00
mjn-mixael 2ef3a935e4 Fix animated background bitmaps rendering with incorrect framerate 2023-08-02 08:23:52 -05:00
mjn-mixael 233fa38890 Prevent loadout related CTD 2023-08-01 16:16:30 -05:00
mjn-mixael 97adef1d87 frakking ints bro 2023-07-31 22:02:20 -05:00
Goober5000 e91d6ed17b 'detonate on expiration' weapon flag
For mods which want primary weapons to 'detonate', setting the detonation range is not reliable because, due to rounding imprecision, either the range (which detonates) or the lifetime (which does not) may happen first.  So this adds a flag to always detonate a weapon when its lifetime expires.  Secondary weapons have this flag by default, but primary weapons can add this flag in the $Flags list.  Additionally, if the detonation range and the predicted range due to lifetime are equal, the flag is added automatically.

Resolves #5521.
2023-07-29 18:23:38 -04:00
Goober5000 f6c86464aa add model filename back into debug log
In #4702 this log line was changed to the 'Model' category, which made it hidden by default.  This was missed in review but should be restored as it is a fairly important line.

Fixes #5507.
2023-07-29 15:29:29 -04:00
Goober5000 dd0af0e07c add screen resolution scaling for hud-set-coords
The hud-set-coords SEXP has always used exact pixels, without regard for the current screen resolution.  This adds a similar scaling mechanism as is used for show-subtitle.

Fixes #5525.
2023-07-29 15:21:43 -04:00
Goober5000 24031db712 Merge pull request #5520 from Goober5000/variable_token_fixes
SEXP parsing cleanup and fixes
2023-07-29 14:18:44 -04:00
Goober5000 d82b02a54a Merge pull request #5517 from Goober5000/fix_fred_bugs
fix mission corruption in FRED
2023-07-29 14:15:10 -04:00
Goober5000 a21876127d comment 2023-07-28 19:54:42 -04:00
Goober5000 f64de84e7c address feedback 2023-07-28 17:08:22 -04:00
Goober5000 feadc0bd69 feedback 2023-07-28 16:45:44 -04:00
mjn-mixael bb6917ab3b custom lua action for mainhall esc keypress 2023-07-28 09:30:30 -05:00
Goober5000 1252d794db Merge pull request #5509 from Baezon/fix-laser-single-segment-trails
Some more fixes for laser single segment trails
2023-07-27 23:12:49 -04:00
Goober5000 58fcbde152 Merge pull request #5511 from z64555/fillValues_more_error
Add more error checking in joy-sdl.cpp.
2023-07-27 23:12:24 -04:00
Goober5000 b3970798e1 variables will only be referenced in nodes, not generators like for-counter 2023-07-27 16:14:06 -04:00
Goober5000 da34e25bc3 handle things properly on parse error 2023-07-27 16:07:15 -04:00
Goober5000 7fc75c0d6c more robust handling of Mp, especially after error 2023-07-27 15:04:38 -04:00
Goober5000 859978fd84 upgrade container parsing as well; and check for malformed variable tokens 2023-07-27 03:38:17 -04:00
Goober5000 7781d9fcda fix sexp variables in argument lists 2023-07-27 02:19:54 -04:00
Asteroth 03e876f65b no shadow 2023-07-27 00:58:10 -04:00
Goober5000 9480869e0a make variable parsing more robust; don't assume that an @ is always followed by a valid variable name; fix length checks; soften non-fatal Errors to error_display(0) 2023-07-27 00:04:15 -04:00
Goober5000 481e82303c use tokens in sexp help 2023-07-26 14:55:31 -04:00
Goober5000 689ac56bc8 fix mission corruption in FRED
When using the mission importer, missions were being corrupted for very subtle reasons: due to some code reordering in prior commits, `raw_ptr` would be initialized to `Parse_text_raw` before `Parse_text_raw` itself was initialized.  This assignment was done in the `CFred_mission_save` constructor and the ordering dependency is not obvious.  Since this is a highly fragile situation and has the potential to affect any use of `parse_comments()` in FRED, it's better to explicitly assign `raw_ptr` when it is needed, and just initialize it to nullptr in the constructor.

This also sets the version number to the legacy version (0.10) when the mission is saved in the retail format.
2023-07-26 03:39:17 -04:00
Goober5000 c80f787d34 POF version fix
Modelread.cpp supports POF versions as low as 1900, but early model versions were not loaded properly because they relied on preprocessor directives rather than version checks.  This changes the POF loading to correctly check version numbers and chunk IDs.

Fixes crashes when attempting to load a FS1 model.
2023-07-26 00:00:17 -04:00
mjn-mixael 861a9c9c4a Add default custom data with descriptions that will show in FRED 2023-07-25 16:01:23 -05:00
mjn-mixael d2d1d8f996 qtFRED saving of custom data 2023-07-25 10:05:34 -05:00
mjn-mixael 46530b78b7 Working FRED implementation 2023-07-25 10:00:58 -05:00
Goober5000 c5469982c8 fix a couple bugs in the campaign editor
1. When saving a campaign, the save directory should be the one that the campaign was just loaded from.  If prompting the user, this should be the default save directory.  This fixes a bug where campaigns were saved to %APPDATA% instead of where the FREDder might expect.  This has been a bug ever since the migration of the game files from FreeSpace2 to %APPDATA%.
2. When saving a campaign, save only the external mission flags, not the working flags that are maintained during gameplay but have no meaning in the saved file.
2023-07-25 01:49:10 -04:00
z64555 db64a212d6 Adds more error checking in joy-sdl.cpp.
* In fillValues(), Check the size values returned by SDL to assert they are non-negative.  If they are negative, abort vector resize and mprintf the SDL Error.
2023-07-24 19:01:08 -05:00
Asteroth 0a07b7e0ad some fixes for laser single segment trails 2023-07-24 18:37:03 -04:00
mjn-mixael cf3b5e8085 base implementation of mission custom data 2023-07-24 16:51:06 -05:00
Tyler Blount 833d181700 Merge pull request #5504 from Baezon/fix-cmeasure-single-segment-trail
Fix for countermeasures with a single segment trail
2023-07-23 10:08:35 -07:00
Tyler Blount dfc716d91a Merge pull request #5501 from naomimyselfandi/zero-out-persona-bitfields
Explicitly zero out persona bitfields
2023-07-23 09:58:49 -07:00
Goober5000 8dd6a27418 Merge pull request #5475 from Goober5000/ai_autoscaling_check
prevent AI autoscaling for only a single autoscaled class
2023-07-22 21:46:25 -04:00
Asteroth 691ae8752e fix for countermeasures with a single segment trail 2023-07-20 23:42:35 -04:00
Asteroth 14b4fd3465 Fix weapon flags +override handling wrt spawn flag (#5488)
* fix wep flags +override wrt spawn

* Revert "fix wep flags +override wrt spawn"

This reverts commit 08a2bee1ca.

* parse +override ahead of time

* use string list instead

* hopefully fix whitespace???
2023-07-19 17:09:11 -04:00
Naomi Coffman fc6a1402c3 Explicitly zero out persona bitfields
Personae have a flag and a species bitfield. They're built up during parsing, but never explicitly zeroed out. This leads to ships occasionally getting an incorrect persona (especially common with support ships, which never have an explicit persona).

Additionally, this commit addresses an issue with the UES Aranyaka (and potentially other support ships belonging to species without a support persona). I'm honestly not sure why they were ever able to speak; however, with this change, they'll never be able to. As such, this commit introduces a "default support persona" to retain the desired behavior.
2023-07-19 15:04:18 -04:00
MageKing17 275f96d80c Remove Int3()s from message_translate_tokens().
In f350e06851, two Int3()s were added to `message_translate_tokens()`, to check for possible out-of-bounds errors. However, in c70fdc3a52, just a couple months later, the code being protected by those bounds checks were put into `else` branches, meaning the `Int3()`s became redundant. This wouldn't actually cause any problems unless somebody passed a string with two `$`s at least 40 characters apart to `message_translate_tokens()`. Cue #4876, which started calling `message_translate_tokens()` on debriefing stages and recommendations, which can contain color tags. This still wouldn't cause problems as long as the color tags are in pairs within close proximity (`translate_key()` would say "that's not the name of a scan code" and leave the text between the two tags alone), but as soon as two color tags are far enough apart to trip the bounds check conditional, the `Int3()` would be hit. This is still fine on Release builds, which ignore `Int3()`s, but triggers a breakpoint on debug builds, which depending on the user's system, can result in a CTD. Since, as far as I can tell, the `Int3()`s haven't actually been meaningful since 2006, I've just removed them (and inverted the conditionals), and testing by the affected user confirms that it no longer CTDs.
2023-07-18 13:34:26 -07:00
Goober5000 850d706df2 prevent AI autoscaling for only a single autoscaled class
When only one AI class performs autoscaling, the math formulas which use autoscaling will become meaningless (e.g. in `ai_maybe_launch_cmeasure()`) or will cause divide-by-zero errors (e.g. in `ai_manage_shield()`).  And autoscaling is not very useful outside of the specific ways that Volition used it.  So this adds some warnings and disables single-occurrence autoscaling.

Fixes #5474.
2023-07-18 01:05:18 -04:00
Goober5000 b06c8e72e1 Merge pull request #5499 from Goober5000/fireball_fix
fix Lua API access to Fireballs array
2023-07-18 00:34:53 -04:00
Asteroth b1fd9ffffb Improve performance of collision retiming (#5496)
* fast version of setting position and orientation

* preliminary stale collide time

* add global collision cache stale flag instead

* clean up

* more clean up

* no periods >.>

* bring back single object version

* rename and bring back stale object list

* use a set
2023-07-18 00:28:49 -04:00
Goober5000 e2c264cec4 fix Lua API access to Fireballs array
When fireballs were made dynamic in 609ed4ed94, the `MAX_FIREBALLS` #define lost any relationship to the fireball collection.  This removes it and also correctly specifies the size of the fireball collection.

This fixes a CTD when accessing items in `mn.Fireballs` via script.
2023-07-17 23:33:22 -04:00
Fabian Woltermann 3f889137d7 Merge pull request #5497 from The-E/fix/warn_for_invalid_trail_textures
Add a warning for cases when we couldn't load a trail bitmap
2023-07-17 23:53:48 +02:00
Fabian Woltermann 19f1e6b4ee remove bothersome warning 2023-07-17 23:07:37 +02:00
Goober5000 7e692ebca6 Merge pull request #5498 from Goober5000/5492_followup
add missing #includes to fix compilation
2023-07-17 16:17:03 -04:00
Goober5000 0067a57f8f add missing #includes to fix compilation
These #include lines are needed for the changes introduced in #5492.  Not sure why they weren't picked up by CI, or why they work in some compilers but not others.
2023-07-17 14:58:24 -04:00
Fabian Woltermann e028162dc2 update batching assertions 2023-07-17 18:54:12 +02:00
Fabian Woltermann 9b26439dd3 Add a warning for cases when we couldn't load a trail bitmap 2023-07-17 17:12:33 +02:00
Tyler Blount 1431270287 Merge pull request #5483 from Baezon/hud-gauge-load-safety
Improved hud gauge loading safety
2023-07-16 15:49:17 -07:00
Tyler Blount 06e74fa976 Merge pull request #5491 from MageKing17/bugfix/demo-missing-campaign
When playing the demo, don't try to reset if no campaign is active.
2023-07-16 15:47:59 -07:00
Tyler Blount 318fde51d7 Merge pull request #5492 from MageKing17/bugfix/voice-recognition-while-paused
Ignore voice recognition events while game is paused.
2023-07-16 15:47:51 -07:00
Goober5000 15daaf2633 additional cleanup from PR 5462
Some streamlining and constifying of the readyroom popup list and associated functions.

Followup to #5462.
2023-07-13 01:54:25 -04:00
MageKing17 d253302fc9 Also check popup_active() and popupdead_is_active(). 2023-07-12 16:07:17 -07:00
MageKing17 560eb31e4f Ignore voice recognition events while game is paused.
If you pause the game, say something into the microphone, then unpause, it can abruptly perform an action based on voice recognition; this is probably counter to player expectations. This adds a `gameseq_get_state() != GS_STATE_GAME_PAUSED` check to the existing conditional.
2023-07-12 15:09:36 -07:00
MageKing17 493df37287 When playing the demo, don't try to reset if no campaign is active.
If the "Campaign Room only available in full version" popup is shown, it tries to reset `Active_campaign_index`, except that if a pilot is loaded with a missing campaign file, `Active_campaign_index` is -1. This causes an out-of-bounds array access, so let's present an alternate popup in this case (either one to select whatever the first campaign file found is, or the generic `popup_game_feature_not_in_demo()` if no campaign files are found).
2023-07-12 14:53:40 -07:00
BMagnu 32298b89fd Properly deinit io lib LuaFunctions (#5485) 2023-07-11 07:03:52 +09:00
Asteroth d6ee515873 remove testing prints 2023-07-07 01:22:40 -04:00
Asteroth bc09f0672b better hud gauge load safety 2023-07-07 01:20:11 -04:00
Goober5000 859534a75c Merge pull request #5482 from Goober5000/ship_killer_name_fix
fix some bugs revealed by ships with long display names
2023-07-07 00:41:59 -04:00
Goober5000 5f8234d1cd fix some bugs revealed by ships with long display names
Several related fixes:
1. Copy the actual ship name, not the display name, to `killer_parent_name` for two reasons:
  1a. Since `killer_parent_name` is used to look up the ship, it must be the actual ship name, not the display name.
  1b. Copying the display name can cause a buffer overflow because display names can be longer than 31 characters.
2. The display name functionality is moved to the more appropriate location in `player_generate_death_message()`.
3. Remove `player_get_killer_weapon_name()` which only served as a proxy check for whether the weapon index was used or not.
4. Use `ship_registry_get()` rather than `ship_name_lookup()`.
5. Add comments to clarify the use of `killer_parent_name`.
2023-07-03 20:08:26 -04:00
Goober5000 03e0904398 Merge pull request #5477 from MageKing17/cleanup/ship-name-handling
Avoid displaying hidden ship names in the escort list.
2023-07-03 17:18:43 -04:00
Goober5000 99170a3a70 Merge pull request #5480 from Goober5000/dockpoint_checks
add some additional safety checks for dockpoint paths
2023-07-03 17:18:31 -04:00
Goober5000 9b72fb6592 add some additional safety checks for dockpoint paths
1. Check that a path index is in range
2. Check that a path's parent submodel is the same as the dockpoint's parent submodel
2023-07-03 12:35:34 -04:00
Goober5000 ed6adeb281 Merge pull request #5479 from Goober5000/fix_instructor_check
fix instructor check
2023-07-02 22:59:55 -04:00
Goober5000 7c13df5881 fix instructor check
Fix the instructor check for whether a ship should circle or not.  Follow-up to #5353.  Fixes #5478.
2023-07-02 22:13:54 -04:00
BMagnu c6a98ad228 Clear Thread-stuff more aggressively (#5476) 2023-07-03 04:38:15 +09:00
MageKing17 927567ffed Avoid displaying hidden ship names in the escort list.
Secondarily, display callsigns in the escort list, if one is given.
2023-07-02 11:26:52 -07:00
Tyler Blount 5ebf530a30 Merge pull request #5473 from MageKing17/bugfix/avoid-split-line-once-assertion
Remove `max_pixel_w > 0` assertion from `split_str_once()`.
2023-06-30 08:44:48 -07:00
MageKing17 b32b54a737 Remove max_pixel_w > 0 assertion from split_str_once().
In at least two instances, `split_str_once()` can be called with width values derived from mod-supplied values that can be 0 or less (specifically, two hud gauges: if `+Messages:` has a `Max Width:` that's too small, or `+Directives:` has a `Max Line Width:` of 0 or less). Since user-supplied code shouldn't be tripping assertions, I looked into adding security around the calling sites when I realized that the assertion wasn't actually protecting against anything; the function would run just fine with a negative pixel width, it would just break with every whitespace. Since both calling sites that could trip the assertion already treat getting `src` back as output as an "I can't split this" error condition, it's perfectly fine (and skips iterating through the string) to just `return src` if the maximum pixel width is 0 or less, so let's just do that instead. Technically this is a behavior change in Release code, but the result of the old code would've been to spam the message log with every individual word in every message (if `Max Width:` was too small), and for directives to seemingly-randomly split only after the first word (if `Max Line Width:` was 0 or less). Not splitting at all is at least as correct, saves some pointless processing, and *should* still be obviously wrong if there was supposed to be a reasonable width value.
2023-06-28 11:56:38 -07:00
Goober5000 447ed95878 Merge pull request #5469 from Goober5000/fix_5387
tweak filename length check for PNGs
2023-06-25 01:33:02 -04:00
Goober5000 1ddf247fd5 Merge pull request #5471 from Goober5000/fix_5470
fix Assertion in turret_swarm_set_up_info
2023-06-25 00:32:16 -04:00
Goober5000 7f05f775af fix Assertion in turret_swarm_set_up_info
It appears that `(turret->turret_enemy_objnum < 0)` is an expected and allowed condition, so just assert that the objnum does not exceed MAX_OBJECTS.

Fixes #5470.
2023-06-23 22:55:41 -04:00
Goober5000 6cfc54499d tweak filename length check for PNGs
This is a bit tricky because both animated and non-animated PNGs use the same extension.  So for PNGs we need to defer the filename length check until we know for sure that it is an animated image.

Fixes #5387.
2023-06-21 03:45:14 -04:00
Joshua Glatt 4fa5c0d3e7 Fix save on mission close' container (#5463) 2023-06-20 21:12:37 -07:00
Goober5000 8c237626a5 Merge pull request #5462 from Goober5000/fix_5459
allow getting of mission info even for files with long names
2023-06-20 18:10:09 -04:00
BMagnu 41312265d5 Decouple MSAA from deferred end (#5467) 2023-06-21 06:17:56 +09:00
Goober5000 ee42e767a5 add warning to save; and make loading/saving more robust 2023-06-19 16:17:01 -04:00
wookieejedi f6b445ed2e Fix crash that can occur due to invalid glow point bank (#5465)
PR adds extra validity check within `model_render_glowpoints` function. Other places in code that use `bank->submodel_parent` check for validity before looking up `pmi->submodel`, but this check was missing from this section (which caused a CTD in a mission restart due to `bank->submodel_parent` being -1).
2023-06-18 22:14:16 -04:00
Goober5000 17d36156cb add const where appropriate to the modelrender API
See title.  There were some cascade effects, but the changes are mostly contained to the model code.  The calls to `gr_render_model` and `g3_render_primitives` use `const_cast` because constifying that API would require a whole other PR.
2023-06-18 14:05:46 -04:00
Goober5000 126c2e27f7 allow getting of mission info even for files with long names
Issue #5459 notes that mission files that are too long will crash the FRED campaign editor, but this is an artificial restriction.  The only need for a string buffer here is to enforce the correct mission extension, so use a SCP_string for this, and add checks for whether string manipulation is in fact necessary.  (In most cases it isn't.)

Fixes #5459.
2023-06-17 01:05:59 -04:00
Tyler Blount f4aa5c079f Merge pull request #5461 from TRBlount/23_2_RC
Begin 23.2 Release Cycle
2023-06-16 19:10:13 -07:00
Tyler Blount 4f9e1360a5 Update changelog and release.mako for 23.2 2023-06-16 17:13:38 -07:00
Tyler Blount d839f9f3c9 Merge pull request #5444 from Goober5000/5401_followup
refinements of jump node features
2023-06-16 14:38:12 -07:00
Tyler Blount 9d10066da7 Merge pull request #5318 from Goober5000/per_species_warp
add per-species warp effects
2023-06-16 14:35:45 -07:00
Goober5000 d42f3f79ac Merge pull request #5457 from Goober5000/zero_sun_bank
fix angle conversions in FRED
2023-06-15 22:32:33 -04:00
Goober5000 32982351dc Merge pull request #5456 from Goober5000/kitsune_fix
handle special characters in additional places in FRED
2023-06-15 22:32:24 -04:00
Goober5000 bcb9e48586 fix angle conversions in FRED
In certain cases, angles would be rounded to 360, where the expected range is 0-359.  The range was guarded properly for skyboxes but not for bitmaps and suns.  This fixes that.  Additionally, since suns do not bank, the angle conversion now sets the bank to 0.

Fixes #5390.
2023-06-14 14:31:12 -04:00
wookieejedi df323423dd Update Some Newish CM Options to Floats (#5452) 2023-06-12 19:24:07 -04:00
Goober5000 26abf577cc handle special characters in additional places in FRED
Kitsune discovered that special characters, notably semicolons, were not properly handled in the Mission Specs editor.  This adds appropriate handling of special characters for fields in that editor, similar fields in the campaign editor, and the corresponding places in qtFRED.  This also makes error messages more descriptive for campaign load failures.
2023-06-11 16:34:50 -04:00
BMagnu 7c0827aaa2 Move bad check (#5455) 2023-06-10 23:13:26 +02:00
Asteroth 4845f6837d fix ai reposition oversight (#5454) 2023-06-08 20:13:46 -04:00
Shivansps 15e7fb16d1 Validate chunk size to avoid align crash and add align skip flag (#5450)
* validate chunk size to avoid align crash and add align skip flag

* change type from uint to int

* change mprintf output to a warning

* revert uint to int change and requested changes
2023-06-08 16:05:56 -04:00
Asteroth 60f3aa59d6 Make lasers less kinky (#5446)
* properly handle trapezoidal bitmaps

* clean up

* fixup single segment trails too

* fix
2023-06-07 19:59:07 -04:00
BMagnu 8562dde955 OpenGL Capability Handling (#5445)
* Init Particle shaders only if they're actually used

* set layout correctly

* Don't compile shadow shader if not needed

* Properly deal with capabilities

* Fix typo

* remove obsolete capability
2023-06-07 19:58:55 -04:00
Mike Nelson 85f915f352 Fix typo and copy/paste error (#5449) 2023-06-06 16:39:35 -04:00
Goober5000 23f6b39597 Merge pull request #5407 from z64555/fix/5405
Fix 5405
2023-06-05 21:45:01 -04:00
Goober5000 c7bc0a7263 Merge pull request #5443 from Goober5000/lighting_profiles_followup
some updates to the lighting profile code
2023-06-05 21:44:35 -04:00
Goober5000 3ae178e125 refinements of jump node features
1. Deprecate the old set-jumpnode-name sexp now that there is a set-jumpnode-display-name
2. Make the display name design consistent with ships and weapons; in particular add a `HasDisplayName()` function and automatically generate the display name for hash-truncated names
3. Keep the display name in sync when the name is changed in the FRED dialog
4. Fix the overriding of hash-truncated names with display names on the HUD
5. Fix the incorrect setting of the alphacolor flag when using FRED
6. Fix array out-of-bounds access when no object is selected

Follow-up to #5401.
2023-06-05 00:41:38 -04:00
Goober5000 e7cb174684 Merge pull request #5442 from Goober5000/retime_pairs_fix_and_update
some refinements for retiming of object collision pairs
2023-06-04 22:11:04 -04:00
Goober5000 aef5a022a8 Merge pull request #5440 from Goober5000/drop_shadows_option
add game_settings.tbl option to enable HUD drop shadows by default
2023-06-04 16:38:49 -04:00
Goober5000 fe77cbee3c Merge pull request #5441 from MjnMixael/default_cm_class
Lua access to default countermeasure class
2023-06-04 16:38:42 -04:00
Goober5000 ab5e016dbb some updates to the lighting profile code
1. Add const qualifier where appropriate to API methods
2. Change `TonemapperAlgorithm` from enum to enum class, for type safety and token scope
3. Update saving of lighting profile in FRED
4. Add saving of lighting profile in qtFRED
5. Add lighting profile (and asteroid) initialization to qtFRED
2023-06-04 16:09:51 -04:00
Goober5000 91e7bea55e Merge pull request #5439 from Goober5000/followup_stuff
Fixes for lab backgrounds and curve initialization
2023-06-04 16:09:23 -04:00
Goober5000 c72b8b0cf4 some refinements for retiming of object collision pairs
1. Add a function to retime *only* the collision pairs involving a specific object.  This is useful when only one object has moved, since only collisions involving that object are affected.
2. Use this function when objects are moved for autopilot, via sexp, and via script.

Previously collision pairs were not retimed when objects were moved via script, leading to bugs.  This fixes that.
2023-06-04 16:04:53 -04:00
mjn-mixael c07389ce6b invalid weapon 2023-06-04 09:22:01 -05:00
z64555 f07e3322e9 Use a std::runtime_error instead of std::exception, because messages in std::exceptions are not a cstdlib spec.
* Update doxy to reflect changes
2023-06-04 09:04:17 -05:00
Goober5000 8e242b4c40 Merge pull request #5433 from Goober5000/sexp_tree_search
Sexp tree searching and filtering
2023-06-03 23:33:19 -04:00
Asteroth 9bd3b00b49 add single segment trails (#5432) 2023-06-02 21:28:45 -04:00
Asteroth 46b886df2c add single segment trails (#5432) 2023-06-02 20:23:07 -04:00
Asteroth 87ad9d99c4 add single segment trails (#5432) 2023-06-02 20:22:40 -04:00
mjn-mixael 1a946beed1 lua access to default countermeasure class 2023-06-02 17:40:44 -05:00
Goober5000 720d938a3a address feedback 2023-06-02 16:26:25 -04:00
Goober5000 ab63301d22 Merge pull request #5401 from MjnMixael/translatable_jump_node
Enhance jump node handling
2023-06-01 22:43:08 -04:00
Goober5000 f1bed594f8 Merge pull request #5435 from MjnMixael/lua_is_player_allowed
Flags to see if a ship or weapon class is player allowed
2023-06-01 22:42:58 -04:00
Goober5000 8a44ff160f Merge pull request #5438 from MjnMixael/fix_default_lighting_profile
Default profile name needs to be added after reset()
2023-06-01 22:42:48 -04:00
Goober5000 ee74f86c5e use correct #Background bitmaps string, use correct string skipping, and do a little tidying 2023-06-01 15:58:39 -04:00
Goober5000 68d216d973 add curves_init and alphabetize #include list 2023-06-01 15:38:22 -04:00
Goober5000 d7d9f10208 add game_settings.tbl option to enable HUD drop shadows by default
As requested by a comment on #4543.
2023-06-01 15:23:41 -04:00
mjn-mixael cc567edaf7 default profile name needs to be added after reset() 2023-05-31 15:50:20 -05:00
mjn-mixael fd6b670a04 flags to see if a ship or weapon is player allowed 2023-05-31 11:37:59 -05:00
Goober5000 b24594acb8 Merge pull request #5418 from scp-fs2open/dependabot/pip/ci/post/requests-2.31.0
Bump requests from 2.26.0 to 2.31.0 in /ci/post
2023-05-30 22:56:52 -04:00
Goober5000 af84b91619 Merge pull request #5421 from BMagnu/modular_subsystem_set_data
Virtual POFs: Modify Subsystems
2023-05-30 22:56:34 -04:00
Goober5000 e28e681d08 Merge pull request #5426 from Baezon/all-poofs-default
All poofs on by default
2023-05-30 22:56:24 -04:00
Goober5000 b223665c3d Merge pull request #5434 from TheForce172/fix/qtFredload
Quick fix to qtfred loading on linux
2023-05-30 22:55:53 -04:00
The Force 303e482047 Quick fix to allow qtfred to compile on ubuntu 2023-05-30 23:53:26 +01:00
Goober5000 8fc28b01ea work with operator indexes to reduce back-and-forth between const and index 2023-05-30 15:41:24 -04:00
Goober5000 278355cac0 select text by default, and implement escape 2023-05-30 15:41:22 -04:00
Goober5000 9bd10e55c6 sort operators by cost when filtering, and use the same best-match strategy in sexp_match_closest_operator 2023-05-30 15:41:17 -04:00
Joshua Glatt a10c733122 allow using container data with ai-waypoints* SEXPs (#5429) 2023-05-29 15:24:18 -07:00
Goober5000 a06573b15e implement type-to-filter and enter-to-confirm 2023-05-29 00:31:27 -04:00
Goober5000 4ff90d3716 move some utilities to a better location, plus a slight refactor 2023-05-28 22:47:38 -04:00
Goober5000 01b96de318 fix handle mismatch 2023-05-28 22:42:23 -04:00
Goober5000 eb959cd0bf make the tooltip explain why an operator can't be selected 2023-05-28 22:42:23 -04:00
Goober5000 46dee9ff0c use selected operators, and prevent disabled operators from being confirmed 2023-05-28 22:42:23 -04:00
Goober5000 579ce220ab fix some sexp help text 2023-05-28 22:42:23 -04:00
Goober5000 09ae954d8e disable operators with incompatible return types 2023-05-28 22:42:23 -04:00
Goober5000 4c43f22a7a multiline tooltips work 2023-05-28 22:42:22 -04:00
Goober5000 9967ed5150 add a new MFC control for the operators 2023-05-28 22:42:22 -04:00
Goober5000 ff2ec6a2ab preliminary sexp operator popup 2023-05-28 22:42:22 -04:00
z64555 9b0846c897 Try const std::exception &e, as per Goober5000's suggestion. 2023-05-27 20:25:41 -05:00
Mike Nelson 2ed78ab1a8 Fix asteroid wrapping (#5419)
* refactor how asteroid wrapping is done and setup for allowing or disallowing range check

* allow fred to toggle enhanced spawn checking

* field naming adjustment

* some minor tweaks

* Add sexp compatibility

* We don't need to save the boolean, just the string.

* full qtFRED support
2023-05-27 15:03:49 -04:00
Goober5000 99450fa643 remove hud_squadmsg_save_keys()
Remove this function and associated items, since they are commented out and unused.
2023-05-27 13:39:47 -04:00
Goober5000 5373ceb650 Merge pull request #5425 from Goober5000/comm_menu_hook
add hooks for comm menu opening and closing
2023-05-27 12:07:52 -04:00
Goober5000 8e7a93698b Merge pull request #5424 from Goober5000/hud_gauge_qtfred_update
patch qtFRED's handling of hud gauges
2023-05-27 12:07:44 -04:00
Taylor Richards b3532e71cc add support for loose lz4 compressed files (#5411) 2023-05-26 22:43:13 -04:00
EatThePath bee289cfa9 Merge pull request #5423 from EatThePath/ltp/fix-reset-new-profiles
call reset() on new profiles to ensure properly set default values.
2023-05-26 21:46:10 -04:00
Asteroth 5bf35ef048 all poofs on by default 2023-05-26 17:44:58 -04:00
Asteroth 16e0e3d6c4 Use volume particles for poofs (#5412)
* allow volume particles for poofs

* fix
2023-05-26 16:23:06 -04:00
Goober5000 59a5d2642c add hooks for comm menu opening and closing
Implements #5420.
2023-05-26 12:51:34 -04:00
Goober5000 346bbb61a2 patch qtFRED's handling of hud gauges
There was a missing function call in qtFRED's initialization, which prevented custom HUD gauges from being loaded.  This adds that.  Additionally, this updates the deduplication code in `get_listing_opf_custom_hud_gauge` to match its counterpart in FRED.

Fixes #5422.
2023-05-26 11:34:11 -04:00
ETP 2ba173d208 call reset() on new profiles to ensure properly set default values. 2023-05-25 20:13:04 -04:00
Birk Magnussen f4b6a4af61 Property Append Mode proper 2023-05-25 20:55:22 +02:00
Birk Magnussen f8220ccd60 Property Append Mode 2023-05-25 20:54:04 +02:00
Birk Magnussen be29fc9eaa fix warning 2023-05-25 12:15:18 +02:00
Birk Magnussen 4d25b34c1b Add Subsystem data change 2023-05-25 12:12:55 +02:00
Asteroth 71ac62e395 add parent size and parent lifetime 2023-05-24 23:54:38 -04:00
EatThePath b32e7b35f7 fix #5416 by loading correct table filenames and ensuring tonemapper is parsed into proper profile. (#5417)
Also fixes semi-spurious warnings about missing default profile by ensuring proper creation of the default profile even if no files are found.
2023-05-22 22:46:58 -04:00
dependabot[bot] b837c4fa7a Bump requests from 2.26.0 to 2.31.0 in /ci/post
Bumps [requests](https://github.com/psf/requests) from 2.26.0 to 2.31.0.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/main/HISTORY.md)
- [Commits](https://github.com/psf/requests/compare/v2.26.0...v2.31.0)

---
updated-dependencies:
- dependency-name: requests
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-05-23 02:42:44 +00:00
Goober5000 7443fed890 Merge pull request #5415 from Goober5000/iequals
add lcase_equal and lcase_lessthan
2023-05-21 21:19:12 -04:00
Asteroth d4beb69328 Add player damage inflicted factor (#5406)
* add player damage inflicted factor

* update default file
2023-05-21 08:17:31 -04:00
Goober5000 d6f3fc76f9 Merge pull request #5414 from Goober5000/fix_event_delay_status
fix evaluation of event status for some events
2023-05-20 18:53:58 -04:00
Goober5000 3e0c7f0721 add lcase_equal and lcase_lessthan
The `SCP_string_lcase_equal_to()()` and `SCP_string_lcase_less_than()()` functors are rather unwieldy to use in non-functor situations, so this adds conventional function equivalents.
2023-05-20 18:21:37 -04:00
Goober5000 d0409ee7be Merge pull request #5409 from Goober5000/fred_and_parse_cleanup
some cleanup and refactoring
2023-05-20 12:41:10 -04:00
Fabian Woltermann 04ad198bb1 Merge pull request #5380 from EatThePath/ltp/multiple-profiles
Ltp/multiple profiles
2023-05-20 10:27:21 +02:00
Fabian Woltermann ca66b41a9e Merge branch 'master' into ltp/multiple-profiles 2023-05-20 10:02:05 +02:00
Goober5000 38c04d0ab3 fix evaluation of event status for some events
Related to #5267, and again concerned with the original check for event delay:
```
if ( (fix) Mission_events[i].timestamp + delay >= Missiontime )
    return SEXP_FALSE;
```
For events that were never evaluated at all, their timestamp remained 0.  Thus the function did not return and the status of the event (which by definition was incomplete) was always checked.

After the timestamp refactoring, this comparison always returned SEXP_FALSE for these events.  The correct behavior is to bypass invalid timestamps so that the status of the event is always checked.

This fixes the behavior of `is-event-false-delay` in debriefings.
2023-05-19 23:11:35 -04:00
Goober5000 d784f18a52 Merge pull request #5410 from Goober5000/fix_qtfred_init
fix qtFRED initialization
2023-05-19 20:57:29 -04:00
Mike Nelson d87cd04aad Traitor overrides feature (#5404)
* Traitor overrides feature

* must code the way goober codes or else

* clarity is key when you're ocd

* even more clarity
2023-05-19 13:07:50 -04:00
ETP aec4977e6e cleaned up some dead commented code 2023-05-19 13:05:28 -04:00
Goober5000 c7ad3592a6 fix qtFRED initialization
The `stars_post_level_init()` change in #5403 exposed a bug where qtFRED would sometimes try to render the mission before all setup had been completed, causing a crash because `Show_iffs` was zero-length.  This was due to the mission being created in the middle of initialization, instead of after initialization was complete.  This fix moves `createNewMission()` to main.cpp, after initialization has finished, and in parallel with the command-line option to load a mission.
2023-05-19 00:37:13 -04:00
Goober5000 1fe528b86d Merge pull request #5403 from Goober5000/skybox_timestamp_fix
patch FRED handling of starfield setup
2023-05-18 18:33:24 -04:00
Goober5000 34663c68bd some cleanup and refactoring
Refactor and clean up some of the code, and add some fixes and utility functions.  This covers the non-X-Wing part of #5277.
2023-05-18 18:28:09 -04:00
Asteroth 29e77013ab init curves in fred (#5408) 2023-05-18 04:51:51 -04:00
z64555 3ec4480c13 We actually want to throw when the pointer is a nullptr, thank you. 2023-05-17 09:38:54 -05:00
z64555 562dd95da3 Replace Assertion within io::joystick::Joystick's constructor with a throw.
* Add try-catch block within enumerateJoysticks() to catch the exception thrown by the Joystick constructor and log the deviceid and the SDL error.
2023-05-17 08:49:47 -05:00
Goober5000 2b1cd53db9 Merge pull request #5397 from Goober5000/lua_is_player
add ship:isPlayer()
2023-05-14 22:05:21 -04:00
Goober5000 be8c3ebb2f patch FRED handling of starfield setup
1. Skybox initialization (and perhaps other aspects of mission initialization) requires the existence of a timestamp snapshot, so make sure a snapshot has been taken before FRED creates a mission.  Follow-up to #5343.
2. Move `stars_post_level_init()` to `Editor::createNewMission()` in qtFRED to be consistent with FRED's `create_new_mission()`.

Fixes a crash when the user tries to add a skybox when FRED first launches.
2023-05-14 15:35:18 -04:00
BMagnuandFabian Woltermann b0b05b35fd MSAA (#5400)
* Add MS buffers

* Implement basic MSAA with commandline

* Move MSAA init to deferred pipeline

* Fix shadows when MSAA is enabled

* Implement resolve shader

* Cleanup basic resolve shader

* Implement front-first depth-aware MSAA resolve

* Fix background resolve

* Allow setting MSAA level

* Ensure good MSAA level

* Code Median shader for different sample counts

* Cleanup

* Add MSAA options toggle

* Add MSAA sample count pre-parsing

* Add GL scope

Co-authored-by: Fabian Woltermann <[email protected]>

* Typo
2023-05-14 08:14:51 +00:00
ETP 7beb28b4f6 added lab interface for selecting lighting profiles. 2023-05-13 21:12:59 -04:00
ETP a094eb00c8 Trim out some future feature code. 2023-05-13 21:12:59 -04:00
ETP 6ccde7b01d maybe appease CI 2023-05-13 21:12:58 -04:00
ETP 62b70e74ca Rebasing lighting profile switchery 2023-05-13 21:12:58 -04:00
EatThePath 89ffbb5a34 Merge pull request #5347 from EatThePath/ltp/profile-code-reorg
lighting profile code reorg
2023-05-13 21:11:58 -04:00
mjn-mixael 4c7e9f6585 On second thought, this should still be Name and not DisplayName 2023-05-12 16:38:07 -05:00
mjn-mixael 78b957982b enhance jump node handling 2023-05-12 15:30:41 -05:00
Goober5000 8aa5a22f5d Merge pull request #5399 from BMagnu/modularpof_parent_subsystem
Fix modular pof handling of dock / path parent names
2023-05-12 14:19:16 -04:00
BMagnu 26cfc8d017 Make check case insensitive 2023-05-13 01:52:40 +09:00
Goober5000 5ed0a9161c Merge pull request #5398 from Goober5000/update_dock_flags
update type_flags when dock name changes
2023-05-12 11:39:36 -04:00
Birk Magnussen 6f8c8e802a fix modular pof handling of dock / path parent names 2023-05-12 10:26:13 +02:00
Goober5000 712a70444b update type_flags when dock name changes
The `type_flags` on a model's dockpoints are determined by the dockpoint name.  If the name changes, the flags should be updated accordingly.

This fixes a bug in Scroll where a dockpoint that was imported and renamed to start with the word "cargo" was not compatible with cargo docking as expected.
2023-05-12 04:08:38 -04:00
Goober5000 eaf57bddf3 add ship:isPlayer()
Add Lua functions to check whether a ship or parse object is a player ship.
2023-05-12 00:35:29 -04:00
wookieejedi 29f82cb5d7 Fix two undocking bugs for small ships (#5396) 2023-05-11 17:06:42 -04:00
Goober5000 7846e593a0 Merge pull request #5394 from BMagnu/fix_anim_crash_dead_ship
Add additional checks for Animation List handling of nonexistent polymodel instances
2023-05-08 23:19:40 -04:00
Birk Magnussen ff3be1a4e3 Add additional checks for animation list handling of nonexistent polymodel instances 2023-05-06 13:42:21 +02:00
Goober5000 25348edff2 Merge pull request #5391 from Goober5000/tweak_int_parsing
make number parsing a little more forgiving
2023-05-05 14:38:04 -04:00
Goober5000 0bdcd3c2f4 Merge pull request #5393 from MjnMixael/lua_enum_index_fix
Lua Enum Hotfix
2023-05-05 14:37:54 -04:00
mjn-mixael 13a990a98f this needs to be converted from base 1 2023-05-05 10:14:48 -05:00
Asteroth 18ba984f3e fix for weapons with lots of inherited velocity (#5392) 2023-05-05 07:58:37 -04:00
Fabian Woltermann 488db515ce Merge pull request #5388 from BMagnu/fix_shader_hdr
Fix HDR conversions in main shader
2023-05-05 13:54:20 +02:00
Mike Nelson 3f8e3360f9 Some additional splash screen features (#5379)
* some additional splash screen features

* Do this based on actual milliseconds

* splash screen is skipped in standalone

* os_poll()
2023-05-04 14:24:10 -04:00
Goober5000 61579f746c make number parsing a little more forgiving
In retail, number parsing picked up immediately at the character after the number parsed, so parsing `0.50` as an int would yield 0, and then the next available characters would be `.50`.  Even though parsing has been tightened up and made stricter, we can still "fail gracefully" by simulating the old behavior.  And when failing gracefully, the message can be a warning.
2023-05-03 22:44:55 -04:00
Asteroth 02a40ae905 Remove model octants (#5373)
* remove model octants

* actually remove the struct

* comments

* remove scratch comment

* initialize
2023-05-01 23:54:43 -04:00
Goober5000 04a9de69ea Merge pull request #5375 from Goober5000/4562_redux
Modernise CFLAGS on Mac/Linux
2023-05-01 23:25:20 -04:00
Goober5000 1457bb0c7f Merge pull request #5386 from MjnMixael/no_unicode_font_error
Warn instead of error for bitmap fonts in unicode
2023-05-01 23:25:01 -04:00
Goober5000 275c7ffe66 Merge pull request #5389 from Goober5000/5381_followup
clear caches for both nodes in rand_sexp
2023-05-01 23:23:41 -04:00
Goober5000 e120bb90b6 clear caches for both nodes in rand_sexp
Since `rand_sexp` also writes text into the sexp node for the seed value, its cache should be cleared too.  And since this is a pretty common operation, wrap it in a `clear_cache` function.

Follow-up to #5381.
2023-05-01 16:36:58 -04:00
Goober5000 10ce1ac625 sync toolchain-apple-clang.cmake flags with the ones in toolchain-clang.cmake 2023-05-01 14:54:08 -04:00
Birk Magnussen baada08eca Fix shader 2023-05-01 20:00:59 +02:00
Goober5000 996a2002e6 Merge pull request #5377 from Goober5000/remove_old_fred_components
remove some obsolete FRED components
2023-04-30 20:48:50 -04:00
wookieejedi 5a1ac87802 Update recent particle optimizations to fix edge case slowdowns (#5385)
#5328 added a very useful culling for particles created by specific particle effects (ie weapons, now beams), though in an effort to simplify the culling process, that PR removed the necessary culling of default smoke on ships. This PR restores the culling of default smoke while also keeping the new culling of particle specific effects. Tested and works as expected, including fixing the slowdowns caused by the aforementioned removal of smoke effect culls.
2023-04-30 15:15:37 -04:00
mjn-mixael 9e5894512c warn instead of error 2023-04-30 10:57:15 -05:00
MageKing17 e5301b7595 Fix the rand SEXP's use of cached values. (#5381)
The `rand` SEXP stores the result of its first call in the "low" node. Prior to PR #2402, this worked fine, but after that, the value is cached when first evaluated, meaning that subsequent calls to the `rand` SEXP will always return the lowest value in the range, not whatever number was rolled the first time.

This commit makes it so that writing the rolled value to the node's `text` attribute is immediately followed by deleting the no-longer cached value, so that the SEXP continues to work as intended.
2023-04-30 11:31:32 -04:00
MageKing17 ae91e4af1b Actually handle a missing Fade_anim properly. (#5382)
When I made FSO not crash with demo data in PR #1156, I avoided calling `brief_maybe_blit_scene_cut()` if `Fade_anim` didn't load, when I should've made it do what the icculus port does in demo mode: pretend the animation finished immediately.

With this commit, the first mission of the demo correctly advances past the first briefing stage.
2023-04-29 17:13:37 -07:00
Fabian Woltermann b77902309a Merge pull request #5384 from The-E/fix/division_by_zero_when_rendering_glowpoints
fix crash in glowpoint rendering
2023-04-29 19:32:32 +02:00
Fabian Woltermann 09a1485a7b this makes sure we do not run into a division by zero under certain circumstances. Also skips glowpoint rendering if the glowpoint is currently invisible 2023-04-29 18:04:39 +02:00
Asteroth 63df812d79 Add beam particles (#5330)
* add beam particles

* tweaks

* more tweaks

* fix warning

* dumb c++

* fix switch

* spelling
2023-04-29 08:45:31 -04:00
Goober5000 4dc6fd417f Merge pull request #5374 from Goober5000/required_for_mission_fred
Add FRED support for the "required weapon" feature
2023-04-27 14:41:11 -04:00
Goober5000 f15c5188c3 remove some obsolete FRED components
- remove FolderDlg which hasn't been needed since we dropped support for Visual Studio 6
    (see version history of MFC, https://mariusbancila.ro/blog/2015/08/12/version-history-of-vc-mfc-and-atl/)
- remove dialog1 which isn't used
2023-04-27 14:37:01 -04:00
Asteroth b8dacdd898 afterburning hard ignores wings (#5376) 2023-04-27 02:51:41 -04:00
Goober5000 b97430e5a0 move from setjmp to try/catch 2023-04-26 19:36:16 -04:00
Goober5000 64c27d8186 fix unused variable warnings 2023-04-26 19:36:16 -04:00
Asteroth d43cf1018d ensure pmi for this lookup (#5372) 2023-04-25 22:27:41 -04:00
Goober5000 e7048f6940 make CI happy 2023-04-25 13:25:08 -04:00
Goober5000 ef1933ec1b Modernise CFLAGS on Mac/Linux
Per GCC optimisation guide, which applies equally well to clang:
* -funroll-loops should not be used unless directed by profiling. The compiler will already unroll loops when it's a good idea.
* clang and gcc now have -Og optimisation levels designed to enable debugging with good performance.

(second attempt at PR #4562)
2023-04-25 13:22:18 -04:00
Goober5000 2a74c93313 link with team loudout dialog 2023-04-25 12:51:23 -04:00
Goober5000 143c52d252 add checkboxlistdlg 2023-04-25 12:18:00 -04:00
Goober5000 53ba2e792a modify loadout dialog 2023-04-25 12:18:00 -04:00
Goober5000 06df0a8a4d Merge pull request #5332 from Goober5000/xmt_ssm
improve XMT handling of ssm.tbl
2023-04-25 00:14:04 -04:00
Taylor Richards 28747bb1b7 warn when a critical file might be be shadowed (#5350) 2023-04-24 02:19:30 -04:00
wookieejedi f2987aa749 Fix max Z speed when using ETS and engine damage tracking (#5368)
* Fix max Z speed when using ETS and engine damage tracking

Follow up for #5137 and #5292. This engine strength check thus needs to be added to all instances where `max_vel.xyz.z` is updated, so a function was created and added in respective locations. Fixes #5367.

* cleanup and adding validity assertations

* cleanup outdated comments

* might as well make the cleanup look nice

* update to account for more edge cases

* cleanup
2023-04-23 22:01:05 -04:00
Fabian Woltermann 938eacdee9 Merge pull request #5370 from The-E/fix/crash_when_logging_ai_submode
Fix crash when logging ai submode
2023-04-23 20:08:47 +02:00
Fabian Woltermann 898c0c1945 fix a crash when attempting to log the ai being in certain submodes 2023-04-23 19:19:44 +02:00
Fabian Woltermann 6234c97f4f fix invalid access when choosing builtin messages (#5369) 2023-04-23 17:19:23 +00:00
Fabian Woltermann 8dd4a05cd1 fix invalid access when choosing builtin messages 2023-04-23 18:52:15 +02:00
BMagnu 6e561761d1 Cleanup Variable Names for Volumetrics (#5362)
* Rename opacityDistance

* Add oversight
2023-04-23 08:16:12 -04:00
Goober5000 b3f237b8c1 Merge pull request #5366 from Goober5000/fred_rc_fixes
some FRED cleanup
2023-04-22 12:14:37 -04:00
Goober5000 587d5af8ca some FRED cleanup
1. Disambiguate dialog IDs for the music player and the volumetric nebula dialogs
2. Fix compilation of qtFRED
3. Small refactor of Personas access to use STL functions where appropriate
2023-04-21 23:16:51 -04:00
Goober5000 0cc28cf8fc Merge pull request #5348 from MjnMixael/sync_color_handling
Deprecate old versions in favor of versions that use color objects
2023-04-21 21:49:08 -04:00
Goober5000 5c9b309293 Merge pull request #5361 from Goober5000/fred_orient_qol
FRED object editor QOL improvements
2023-04-21 21:48:38 -04:00
Mike Nelson c19f05a9d9 organize and map additional keys (#5354) 2023-04-21 21:05:54 -04:00
BMagnu ab4d1fb779 Skip anim if type is unknown (#5363) 2023-04-22 02:28:27 +09:00
BMagnu 13e1f28c4a FRED Dialog for Volumetrics (#5351)
* Add volumetrics dialog skeleton

* Implement first fields in dialog

* Add dialog to main window

* Fix Spinners

* Add all non-noise inputs

* Add Noise Fields

* Fix errors

* Add Tooltips

* Fix fred menu

* Init dialog
2023-04-22 01:06:58 +09:00
Goober5000 bce1e7c2d9 Merge pull request #5360 from Goober5000/improve_spawn_collision
improve spawn collision checking
2023-04-21 09:40:47 -04:00
Goober5000 2f654c496c FRED object editor QOL improvements
1. When the "object" radio button is selected, the "point to" check box will also be selected
2. When an object is selected from the object list, the "object" radio button and "point to" check box will also be selected

Fixes #5356.
2023-04-20 23:58:18 -04:00
Goober5000 1feef8ff2a improve spawn collision checking
Take into account the collision flag and collision groups when spawning a ship.  Should fix #5357.

Also clean up the code a bit, including setting a few `int`s to `bool`s and adding a missing axis case.
2023-04-20 22:31:34 -04:00
Asteroth fa0878b6b3 Add an Ai goal flag to afterburn hard (#5338)
* add afterburn hard flag

* return some ab locked checks

* this one too

* more tweaks
2023-04-20 19:42:35 -04:00
wookieejedi 21d1ffd3bd Fixes CTD with New Particle Lifetime Curve (#5358)
Turns out Velocity Lifetime Curve was never initialized.
2023-04-20 14:39:46 -04:00
Goober5000 237fea6cbf Merge pull request #5355 from Goober5000/enhanced_sexp_warnings
enhance some SEXP warnings
2023-04-20 11:29:42 -04:00
mjn-mixael 95649dafa1 cleanup 2023-04-20 09:37:33 -05:00
EatThePath 427873a345 remove int3 from the rest of the batching things (#5349) 2023-04-20 07:43:29 -04:00
Asteroth 4a53ff742d Add debris density (#5340)
* add debris density

* doc new param
2023-04-20 02:48:19 -04:00
Goober5000 581c834353 Merge pull request #5337 from Goober5000/various_tweaks
Various tweaks and polishing
2023-04-19 22:20:53 -04:00
Goober5000 58f3e8fb06 Merge pull request #5345 from MjnMixael/finalize_scpui_api
Finalize scpui api
2023-04-19 22:20:06 -04:00
Goober5000 d7a2bba630 enhance some SEXP warnings
These messages add the context of the actual SEXPs causing the warnings to be displayed.  Motivated by Admiral Nelson's mod debugging work.
2023-04-19 22:15:21 -04:00
Goober5000 0d6791ff1d Merge pull request #5353 from Goober5000/joe_fixes
Joe fixes
2023-04-19 22:14:33 -04:00
Asteroth 9be559622e dont overwrite a disallowed depart order (#5352) 2023-04-19 17:30:09 -04:00
Asteroth 31b23d8c50 Whackable debris and asteroids (#5291)
* whackable debris and asteroids

* fixes

* review tweaks

* some more review tweaks
2023-04-19 10:56:46 -04:00
Asteroth 56f010a231 Add arbitrary curves support (#5323)
* Add arbitrary curves support

* review tweaks

* pretty sure i dont need this anymore
2023-04-19 08:13:06 -04:00
Goober5000 f0322a12f2 remove unused variable 2023-04-18 20:50:17 -04:00
Goober5000 f62e437dbd properly handle wingmen that are destroyed before mission 2023-04-18 19:50:32 -04:00
Goober5000 41e338e8ab Joe fix: if the Instructor is known to a mission, it should govern training messages 2023-04-18 19:49:29 -04:00
Goober5000 6ce1f5276a Joe fix: if a ship can't find a dock path, the game shouldn't crash 2023-04-18 19:46:36 -04:00
mjn-mixael 623f887495 documentation 2023-04-18 09:18:36 -05:00
mjn-mixael 3f6eae0836 Update methods to optionally accept and return color objects 2023-04-18 08:37:30 -05:00
Asteroth 0bffa82422 fix wep glowpoints (#5344) 2023-04-18 08:04:16 -04:00
Goober5000 d203d2915f Merge pull request #5343 from Goober5000/synchronized_timestamps_take_2
synchronize simulation timestamps across the entire frame
2023-04-17 19:15:32 -04:00
EatThePath 64af9e520c Merge pull request #5154 from EatThePath/opt/less-batching-find
Optimizing the trail renderer by avoiding repeated batch_find calls
2023-04-17 16:15:59 -05:00
ETP 77c7aee8f4 Moved the configurable profile adjustments into their own file 2023-04-17 14:58:14 -05:00
mjn-mixael eafab41823 unify language and capitolization 2023-04-17 14:50:38 -05:00
BMagnu bbb7599512 Add proper time wrapping for animations (#5339) 2023-04-18 04:40:04 +09:00
BMagnu 522e1aa360 Restrict player order accept ship (#5341) 2023-04-18 04:39:56 +09:00
ETP 57f9455f6c moving lighting profiles into a namespace and arranging it as cleanup for future changes 2023-04-17 14:36:41 -05:00
ETP a8035fec36 Applied formatting to lighting profiles files 2023-04-17 14:06:21 -05:00
Goober5000 9b337b714b take a new snapshot when time compression is updated 2023-04-17 12:10:56 -04:00
mjn-mixael f5a08bb694 change api description to finalize 2023-04-17 08:53:52 -05:00
mjn-mixael da7d9f28b9 global to param 2023-04-17 08:53:26 -05:00
Asteroth 4bbc9f3eb3 Improve particle culling and performance (#5328)
* better particle culling

* remove range on emitters

* explicit cast

* bit more efficient
2023-04-17 08:03:41 -04:00
Asteroth 7c4b9272d5 Randomize particle rotation (#5335)
* randomize particle rotation

* spelling

* initialize it, dummy
2023-04-17 07:37:38 -04:00
Goober5000 051d85d05c fix time compression with snapshotted timestamps
Because time compression adjusts the raw timestamp to be 0, it must use the exact value, not the snapshotted value, or the mission time will be slightly off.  So this commit fixes that problem, as well as making sure that changes in time compression always occur at the start of a frame.
2023-04-16 22:19:57 -04:00
Goober5000 b487969e5f use constant 2023-04-16 14:27:59 -04:00
ngld 86a81bfb9c Merge pull request #5342 from ngld/pr/fix-nightly-upload 2023-04-16 19:39:15 +02:00
ngld d7c22b126c Mark the nightly upload step as succesful as long as at least one mirror got the file 2023-04-16 19:00:32 +02:00
Mike Nelson 108def6224 Scpui Hud Config API (#5302)
* initial API for hud config elements

* get rendering, highlighting, and selecting working

* Add a way to create color objects

* some cleanup and fixes

* go away we dont need you

* allow arbitrarily scaling the hud config draw

* last few config options and innitial preset handling

* vectorize hud presets and setup handling

* some last minute fixes

* iiiiiiiiiiiiiiiiiiiiiiint

* really

* documentation and address feedback

* completely revert this as well

* more documentation

* document all the things

* comment out unused parameter

* peach emoji retentive

* whatever

* return types

* color
2023-04-16 08:13:06 -04:00
BMagnu ff296f8f98 Add a Translation Moveable (#5313)
* Add Translation Moveable

* Update SEXP docs

* Update some strings
2023-04-16 20:56:44 +09:00
Goober5000 4106414858 timestamps need to be synced in FRED too 2023-04-15 22:36:22 -04:00
Goober5000 9c5b4dfb49 synchronize simulation timestamps across the entire frame
Prior to the timer upgrade, all simulation timestamps shared identical timer and timestamp values for the duration of the frame, since they were only updated within the `game_set_frametime` function.  Since the timer upgrade depends on the system clock, timestamps evaluated near the end of the frame will be very slightly later than timestamps evaluated near the beginning of the frame.  It is desirable to keep them all in sync.

This PR tweaks the timestamp system to take a snapshot at the beginning of the frame, then use that snapshot for the entire duration of the frame.  This only affects simulation timestamps; real-time timestamps still use the live timer.
2023-04-15 22:17:23 -04:00
Goober5000 1083f34ffc Merge pull request #5336 from Goober5000/rank_adjustment
tweak rank handling in Lua
2023-04-15 22:04:38 -04:00
Mike Nelson 3c30257816 Modular messages table (#5285)
* modular messages table

* clarify warning
2023-04-16 08:40:25 +09:00
BMagnu 023a7d3e68 "On Frame but actually Wait before you continue"-Executor (#5314)
* add 'syncronized async run'

* cleanup

* cleanup 2

* Properly free the screen

* Incorporate feedback
2023-04-16 08:39:49 +09:00
BMagnu f32b575f0c Allow 0-Asteroid setups (#5329)
* Allow 0-Asteroid setups

* Make mission brief error non fatal
2023-04-16 08:39:04 +09:00
Asteroth 1525f829b7 Flush empty cbrief voice filenames to "None" (#5333)
* make clearing cbrief voice easier

* qtfred too

* ani_filename too
2023-04-15 15:06:37 -04:00
Goober5000 a932dc94c0 Merge pull request #5307 from MjnMixael/explicit_no_wrap
Explicitely do not split lines when making the message log
2023-04-15 14:59:09 -04:00
Goober5000 55a92a32de a bit of encapsulation 2023-04-15 14:23:05 -04:00
Goober5000 0c8a6c6f97 small streamlining 2023-04-15 14:23:05 -04:00
Goober5000 5e3f8e4792 Merge pull request #5334 from Goober5000/check_whitespace_comma
check for whitespace between token and comma
2023-04-15 14:19:37 -04:00
Goober5000 7018a560b9 streamline type conversion 2023-04-15 00:06:33 -04:00
Goober5000 bcc964d0fa color tweaks 2023-04-15 00:06:33 -04:00
Goober5000 8fbe2c244a address feedback 2023-04-14 20:34:19 -04:00
Goober5000 c6a2dcdfa9 tweak rank handling in Lua
Follow-up to #5280:

1. Make the Rank virtvar actually return a rank object, to be consistent with other Lua API methods
2. Add a RankIndex virtvar to replicate the previous functionality
3. Make RankIndex return the expected 1-based index for Lua

This is a breaking change to the API, but since the original API is less than a month old, the impact should be small.
2023-04-14 19:17:46 -04:00
Goober5000 d28db605a9 avoid repeated commas 2023-04-14 11:51:03 -04:00
Goober5000 67428f506c grayspace makes more sense here 2023-04-14 10:56:11 -04:00
Goober5000 0ff15cfe16 check for whitespace between token and comma
When parsing a list of numbers, such as in the $uvec or $fvec of models, a bug was reported where whitespace before the comma caused the number parsing to fail.  This change checks for a comma after whitespace instead of checking for a comma as the very next character.
2023-04-14 02:51:01 -04:00
Goober5000 4ee4f51ee2 improve XMT handling of ssm.tbl
Extensible modular table handling for -ssm.tbm files was not very robust due to quite a few assumptions left over from straight .tbl parsing.  Ostensibly optional fields were required, non-overridden fields were reset to defaults, etc.  This improves XMT parsing and adds sensible defaults for SSM fields.
2023-04-14 01:12:09 -04:00
Goober5000 4da52ca23b Merge pull request #5325 from Goober5000/hotkey_followup
convert hotkey types to enum
2023-04-14 01:07:44 -04:00
Fabian Woltermann 1d52bc5876 make sure deferred_global_data follows the alignment rules (#5331) 2023-04-13 20:45:56 +00:00
Asteroth 689dca1f3f bugfix accidental swap (#5324) 2023-04-12 14:55:04 -04:00
Goober5000 bb53f7ee68 type safety revealed something 2023-04-12 10:55:38 -04:00
Goober5000 78d9562661 feedback and fix 2023-04-12 10:55:38 -04:00
Goober5000 b7d1270439 convert hotkey types to enum
Here's a suggested followup to #5249.  This converts the hotkey type to an enum for improved type safety.  It also adds the corresponding Lua enums and adjusts the Type virtvar to return them.
2023-04-12 10:55:36 -04:00
Goober5000 257ba70d70 Merge pull request #5326 from Goober5000/validity_checks
add validity checks
2023-04-12 10:52:39 -04:00
Goober5000 10e5875289 add validity checks
Many of the recent scripting API enhancements are missing validity functions and validity checks, so this adds them.  There are also some documentation fixes and a >= vs. > bugfix.
2023-04-12 00:14:20 -04:00
BMagnu 64de96f6ce Fix Subsystem serialization (#5319) 2023-04-12 00:31:54 +09:00
Asteroth ac9636733f ets fixes (#5317) 2023-04-11 06:31:04 +09:00
Asteroth a2df152323 Add fov values to .pof models (#5244)
* add model fov values

* initialize proper defaults

* set defaults directly
2023-04-11 06:30:17 +09:00
Goober5000 fbca88d36d add per-species warp effects
This allows warp parameters to be specified in species_defs.tbl, rather than requiring them to be specified for each ship in ships.tbl.  Since this introduces a cyclic dependency between species_defs.tbl and sounds.tbl, the parsing of sounds.tbl is broken into two stages.

Implements request from #5283.
2023-04-10 17:24:38 -04:00
Mike Nelson e01a5359ac Scpui API for Control Config (#5305)
* read access to controls

* Early draft of checking keypresses in scpui

* detangle some code and prepare it for API usage

* API access to the core methods required

* move these checks into the UI methods

* comment

* fix bugs

* be smarter

* Need this stuff, too

* some more presets work

* unify func naming scheme

* cleanup and clarifications

* get detect keypress working

* allow searching and creating new presets based on current controls

* address feedback

* return nil if no preset is matched

* use the builtin methods which do the same thing, but slightly cleaner

* typo
2023-04-07 12:02:13 -04:00
BMagnu e2b205ffaa Modular POF Features 2 (#5209)
* Add weapon bank copy

* Add Path / Dock point copying

* cleanup

* Fix dock points

* Fix copy paste error

* Incorporate feedback

* Incorporate feedback 2

* delete copy assignment
2023-04-07 08:12:20 +09:00
Goober5000 1388866ddd Merge pull request #5315 from Goober5000/fix_qtfred_compilation
fix qtfred compilation
2023-04-06 11:04:31 -04:00
Goober5000 7e9e8bcb62 additional fixes 2023-04-05 21:14:45 -04:00
Goober5000 deded57112 fix qtfred compilation
Fix various compilation warnings and errors.
2023-04-05 20:56:53 -04:00
BMagnu 599a1893c3 Add +Use Ship as Template (#5311)
* Implement +Use Ship as Template

* Update Warning Message
2023-04-06 07:10:30 +09:00
Goober5000 dbff592f94 Merge pull request #5312 from Goober5000/chase_view_toggle
make 'player starts in chase view' a toggle
2023-04-05 13:00:23 -04:00
Goober5000 9c00070154 revert view on escape 2023-04-05 00:04:58 -04:00
Asteroth 203b738f79 Add $CockpitLaunchSnd (#5300)
* add cockpit launch snd

* whoops

* another whoopsie
2023-04-04 23:40:15 -04:00
Goober5000 b016163bf3 make 'player starts in chase view' a toggle
Per request of #5226.  This PR also makes the variable names more consistent.
2023-04-04 23:34:03 -04:00
Fabian Woltermann 884d47611f Merge pull request #5310 from The-E/fix/5309_div_by_zero_in_glowpoint_rendering
fix rare division-by-zero caused by unchecked data
2023-04-03 18:56:30 +02:00
Fabian Woltermann a786e2d541 fix rare division-by-zero caused by unchecked data 2023-04-03 18:16:44 +02:00
Goober5000 dc2370393e Merge pull request #5251 from Goober5000/move_self_destruct_log
move self-destruct mission logging to ship_hit_kill
2023-04-03 10:28:50 -04:00
Mike Nelson 0dd4daf2eb modular traitor + cleanup (#5188) 2023-04-03 14:12:57 +02:00
naomimyselfandi 949141c611 Message filter follow up (#5304)
* Fix intra-persona message borrowing logic

Closes #5299.

* Always assign personae for Support

Disabling the Auto_assign_personas flag had the side-effect of prohibiting support ships from ever speaking. Since a mod that wants this behavior (for whatever reason) can just not have a support persona, this commit makes an exception for them.

* Make Protect Target and Cover Me adaptive like Engage Enemy is

* Respect the allow subsitution flag
2023-04-03 08:11:46 -04:00
Fabian Woltermann 14689265ce Merge pull request #5308 from TRBlount/fix/vulkan_build
Prevent build error when Vulkan SDK isn't installed
2023-04-03 09:23:53 +02:00
Tyler Blount 837ac8d08e Also force if the option is set, but Vulkan could not be found 2023-04-02 19:56:50 -07:00
Tyler Blount 6cac2af8e4 Default to OFF for FSO_BUILD_WITH_VULKAN 2023-04-02 18:47:41 -07:00
mjn-mixael 80004f2996 explicitely do not split lines 2023-04-02 19:43:53 -05:00
Asteroth e3cd5c819f removal of current_max_speed (#5292) 2023-04-01 16:13:08 -04:00
Asteroth 39273db918 $beaminfo implies beam flag (#5297) 2023-04-01 16:12:32 -04:00
Asteroth cd36ce336f small fix for type5 fighter beams (#5298) 2023-04-01 16:11:54 -04:00
Goober5000 dcdade36a3 Merge pull request #5293 from Goober5000/5290_followup
additional constraint on Command arrival messages
2023-03-30 22:05:52 -04:00
naomimyselfandi cbbd197cd3 Add "no-first-wave-message" wing flag (#5288)
* Add "no-first-wave-message" wing flag

For when you want custom dialogue for the first wave, and automatic announcements for the rest.

* Fix FRED macro name
2023-03-30 21:17:03 -04:00
Goober5000 5d4cd31a79 fix IFF logic for teams that attack themselves (#5294)
If a team explicitly attacks itself, then the same-team checks should not apply.  Fixes a bug reported by SilverAngelX on Discord.
2023-03-30 21:16:45 -04:00
Asteroth 835285248e No overlapping turret sounds (#5295)
* prevent overlapping turret sounds

* whitespace

* fixes
2023-03-30 21:16:32 -04:00
Goober5000 682cffa610 additional constraint on Command arrival messages
Command should not be considered if the mission explicitly prevents Command from sending builtin messages.

Follow-up to #5290.
2023-03-29 00:31:03 -04:00
EatThePath 4753d0f761 Merge pull request #5290 from naomimyselfandi/configurable-command-arrival-message-chance
Dehardcode Command arrival message chance
2023-03-28 22:41:49 -05:00
Mike Nelson 85bcfd56e8 force expand wings instead of toggle for scpui (#5286) 2023-03-28 07:40:03 -04:00
Mike Nelson af88697348 Parse and save asteroids by name (#5134)
* parse and save asteroids by name

* typo

* update version
2023-03-28 07:38:14 -04:00
ETP 633f138afe Remove Int3() from new versions of batching_add_ for modernization 2023-03-27 23:46:54 -05:00
David Gibson d7ebb8f062 Optimizing the trail renderer building code path moderately by avoiding repeated batch_find calls 2023-03-27 23:01:05 -05:00
BMagnu 272d6261c4 Generic Lua Multiplayer RPC (#4835)
* Add automatic lua obj serialization function dispatch

* Implement fundamental and object de/serialization

* Proper default case for package deserialization

* Add No Multi func

* Add Serialization part

* Fix max encoding size for userdata

* Implement exception handling

* Start Implementing lua RPC

* Prepare waitAsync for RPC

* Add packet order enforcing and forwarding

* Add RPC registry

* Make RPCs callable

* Add waitRPC

* Add serializers

* Fix GCC error

* Explicitly specify lua_net_exception

* Fix Warnings

* Replace Seriliaze fundamental with cross-platform data types

* Appease Clang

* Prevent serialization CTD on invalid objects

* Actually use the temporaries assigned

* Fix OSWPT shadow

* Fix table deserialize order

* Incorporate Feedback

* Fix Warnigs

* ix WArnings 2

* Add sanity checks for OSWPT wing serialization

* Multi Bump

* Forgot we have american-style dates there
2023-03-28 03:07:03 +09:00
wookieejedi 2a492e00c2 Revert "synchronize simulation timestamps across the entire frame" (#5287)
* Revert "synchronize simulation timestamps across the entire frame"

* try a proper fix instead of revert

* make sure nothing is reverted

* and back to full revert
2023-03-27 09:59:23 -04:00
Fabian Woltermann c816a65c63 Merge pull request #5289 from EatThePath/restore-envmap-hotkey-export
restored the keyboard hotkey for envmap export.
2023-03-26 21:48:44 +02:00
Mike Nelson 8d762d3fbe fredTunes, Fredify, Fred Music, or whatever. It's a music player. (#5101)
* initial semi-working version

* better implementation of play and add stop and music.tbl viewer

* let the music window lose focus

* some cleanup

* add autoplay, next, previous

* use graphics

* Better dialog layout and allow ignoring files from the player list

* Make betterer

* a touch more cleanup

* revert this change

* missing bracket from merge conflict resolution

* address feedback
2023-03-25 13:52:11 -04:00
Naomi Coffman fec9603a09 Fix brainfart 2023-03-25 13:51:17 -04:00
Naomi Coffman 78cb768546 Dehardcode Command arrival message chance
Historically, there's been a hardcoded 25% chance for Command to announce an enemy wing arrival. This is problematic for mods without Command, like BTA.
2023-03-25 13:27:16 -04:00
David Gibson de057e421e restored the keyboard hotkey for envmap export. 2023-03-25 11:57:41 -05:00
Fabian Woltermann 9308318199 Merge pull request #5253 from naomimyselfandi/more-flexible-dynamic-messages
More flexible dynamic messages
2023-03-24 10:50:39 +01:00
Fabian Woltermann 17b34508e9 Merge pull request #5280 from MjnMixael/medals_access
Scpui API for medals access
2023-03-24 10:49:45 +01:00
Fabian Woltermann bcf0ab1957 Merge pull request #5256 from MjnMixael/texture_filtering_option
Expose texture filtering as a built-in option
2023-03-24 10:48:44 +01:00
Fabian Woltermann 18a679052b Merge pull request #5282 from qazwsxal/fix/gamma_stopgap
FIX: Incorrect gamma calculations in shaders.
2023-03-23 22:05:19 +01:00
Adam Leach d516ab3c23 Stopgap patch to make envmaps work again. 2023-03-23 19:33:41 +00:00
mjn-mixael dceea0d7a5 don't need this 2023-03-23 13:17:51 -05:00
mjn-mixael 1fdf8b1756 access to array sizes 2023-03-23 12:52:11 -05:00
mjn-mixael d76c733d66 nothing to see here 2023-03-23 12:23:03 -05:00
mjn-mixael c92d383b69 scpui api for medals access 2023-03-23 11:19:46 -05:00
Fabian Woltermann 7c6e27e83d Merge pull request #5279 from Baezon/clip-planes
Add clip planes to game_settings.tbl
2023-03-23 14:12:40 +01:00
Fabian Woltermann f2eca9ca3f Merge pull request #5249 from MjnMixael/scpui_hotkeys
Scpui hotkeys
2023-03-23 14:11:13 +01:00
Asteroth 31e891df0d rename and betterchecking 2023-03-23 05:04:02 -04:00
Fabian Woltermann 98f1777040 Merge pull request #5252 from MjnMixael/capitalize_icon_names
these should be capitalized
2023-03-23 10:01:15 +01:00
Asteroth af41dbae37 add clip planes to game_settings 2023-03-22 19:48:05 -04:00
mjn-mixael 242c7184b8 Merge branch 'master' into scpui_hotkeys
# Conflicts:
#	code/scripting/api/libs/ui.cpp
2023-03-22 09:14:21 -05:00
Fabian Woltermann 2f28dc2f1e Merge pull request #5239 from MjnMixael/scpui_game_help
SCPUI methods for the Game Help UI
2023-03-22 15:11:11 +01:00
mjn-mixael 88166d58bc Merge branch 'master' into scpui_hotkeys
# Conflicts:
#	code/scripting/api/libs/ui.cpp
#	code/source_groups.cmake
2023-03-22 08:33:11 -05:00
mjn-mixael 51c55550f0 Merge branch 'master' into scpui_game_help
# Conflicts:
#	code/scripting/api/libs/ui.cpp
2023-03-22 08:25:33 -05:00
BMagnu 9caa9c4c7c Expose some Nebula settings to Lua (#5268)
* Add more nebula options

* rename vars due to windows api defines
2023-03-22 12:42:18 +01:00
Mike Nelson fbf0db09a7 Scpui Mission Log (#5242)
* SCPUI access to scrollback items (mission event log and message log)

* copy paste error

* check the objective flags instead of the action flags now

* rename actions -> segments
2023-03-21 20:03:35 -04:00
Asteroth 6afb160ebd add some parameters for corkscrew start angle (#5275) 2023-03-21 20:03:20 -04:00
Naomi Coffman 6752a7f196 Fix bad merge 2023-03-20 11:30:05 -04:00
Naomi Coffman 2cb9b94f61 Merge branch 'master' into more-flexible-dynamic-messages 2023-03-20 11:07:36 -04:00
Goober5000 6f7c949e16 Merge pull request #5267 from Goober5000/event_timestamp_check_fix
fix an edge case in is-event-true-delay and related sexps
2023-03-20 11:04:32 -04:00
Goober5000 5b411f4041 Merge pull request #5266 from Goober5000/timestamp_snapshot
synchronize simulation timestamps across the entire frame
2023-03-20 11:04:14 -04:00
Naomi Coffman 91acdfbc23 Ensure variable is initialized 2023-03-20 10:58:46 -04:00
Mike Nelson 29ea809790 toggle auto-assigning personas (#5125) 2023-03-19 21:50:26 -04:00
Goober5000 7540c79993 add comment 2023-03-19 00:01:20 -04:00
Goober5000 eed50619ca fix an edge case in is-event-true-delay and related sexps
Originally the check for event delay was this:
```
if ( (fix) Mission_events[i].timestamp + delay >= Missiontime )
    return SEXP_FALSE;
```
This returns false even when the mission time is equal to the timestamp.  Therefore the timestamp check needs to use >, not >=.

Thanks to Durandal and ShivanSpS for helping to track this down.
2023-03-17 15:00:06 -04:00
Goober5000 685f641696 synchronize simulation timestamps across the entire frame
Prior to the timer upgrade, all simulation timestamps shared identical timer and timestamp values for the duration of the frame, since they were only updated within the `game_set_frametime` function.  Since the timer upgrade depends on the system clock, timestamps evaluated near the end of the frame will be very slightly later than timestamps evaluated near the beginning of the frame.  It is desirable to keep them all in sync.

This PR tweaks the timestamp system to take a snapshot at the beginning of the frame, then use that snapshot for the entire duration of the frame.  This only affects simulation timestamps; real-time timestamps still use the live timer.
2023-03-17 14:14:55 -04:00
Asteroth 32cfb59a9e fix a bug in mission log with subsys names (#5261) 2023-03-16 22:43:15 -04:00
Goober5000 75a14625cf Merge pull request #3392 from the-maddin/qt-campaign-editor
QtFRED campaign editor
2023-03-15 15:15:48 -04:00
Goober5000 56869f10a5 Merge pull request #5259 from MjnMixael/qtfred_warning_fix
Use qtfred style warning instead of fred style
2023-03-15 15:15:22 -04:00
Goober5000 482d4a19a8 Merge branch 'master' into qtfred_warning_fix 2023-03-15 14:18:11 -04:00
Goober5000 2baf97b07a Merge pull request #5257 from DMJC/master
Fixes for Missionsave.cpp and BriefingEditorDialog.ui
2023-03-15 14:13:33 -04:00
mjn-mixael 27d9e412cb use qtfred style warning instead of fred 2023-03-15 08:02:32 -05:00
James Carthew 6e51c7cc05 Fixed missionsave.cpp - removed deprecated MB_OK MessageBox command. 2023-03-15 22:16:05 +10:30
James Carthew 638745cb16 Fixed compilation error in BriefingEditorDialog.ui 2023-03-15 22:15:01 +10:30
mjn-mixael 900abcf680 expose texture filtering as a built-in option 2023-03-14 11:00:55 -05:00
Mike Nelson b74937d74f always test goober-suggested code for errors (#5254) 2023-03-13 16:38:55 -04:00
Naomi Coffman 2c42f425dc Remove some hardcoded send chances
I missed these earlier. Oh well. They're gone now.
2023-03-11 20:51:32 -05:00
Naomi Coffman fd82ff70f1 Merge all friendly arrival messages into one type 2023-03-11 19:14:14 -05:00
Naomi Coffman 1b5b902bdd Remove unused parameters
These were always 0, and now they're gone.
2023-03-11 18:11:56 -05:00
Naomi Coffman 730eddc73a Localize message type parsing 2023-03-11 17:57:03 -05:00
Naomi Coffman 39b24a5789 Add subject filters to most messages 2023-03-11 17:39:49 -05:00
Naomi Coffman 43bd4d95fa Support sender filters 2023-03-11 17:39:49 -05:00
Naomi Coffman 7a5c145436 Parse message filters
They're not used yet, but they do get parsed.
2023-03-11 11:39:06 -05:00
Naomi Coffman 95f5839b5f Disenlongate method names 2023-03-11 11:39:06 -05:00
Naomi Coffman 8d1171ae88 Add message types for every standard player order
This commit also changes a couple confusing message type names.
2023-03-11 11:39:06 -05:00
Naomi Coffman 11987590af Overhaul builtin message matching logic
The logic used to select builtin messages was complex and hard to follow. This commit replaces it with logic that, while not identical, is both similar and more flexible. Additionally, the old logic had a major limitation when it came to downgrading messages: If a message type was defined for *any* persona, then it couldn't be downgraded for *any* persona. The new logic removes this limitation, and makes downgrade paths easier to define as well.
2023-03-11 09:34:01 -05:00
Naomi Coffman 629857adfb Always use the tabled occurrence chance
Some message types had hard-coded occurrence chances. These have been removed, and the default occurrence chance for the corresponding type modified to compensate.
2023-03-11 09:33:55 -05:00
Naomi Coffman 29c644c10c Store message priority and timing with the type 2023-03-11 08:27:46 -05:00
mjn-mixael 2bb705eca0 these should be capitalized 2023-03-10 10:39:46 -06:00
Mike Nelson b1033732f1 fixup error checking in regards to sexps using dynamic parameters (#5245)
* fixup error checking in regards to sexps using dynamic parameters

* anal retentive

* add more nonsense to make other nonsense work

* check these better

* dammit github

This reverts commit 542707c1c2.

* do this again but not in GitHub

* more nonsense to handle nonsense

* Revert "more nonsense to handle nonsense"

This reverts commit 6bc8b6e775.

* this is the song that never ends
2023-03-10 03:05:53 -05:00
Goober5000 39d5fc36f7 Merge pull request #5250 from Goober5000/tweak_techroom_modelnum
fix Techroom_modelnum references
2023-03-10 00:06:53 -05:00
Goober5000 ede86efa99 move self-destruct mission logging to ship_hit_kill
This moves `LOG_SELF_DESTRUCTED` to the same place that `LOG_SHIP_DESTROYED` is recorded.  This allows self-destruction to be correctly recorded when a ship is self-destructed via script, as well as when it is auto-repaired with a negative hull multiplier, or when ships are killed off in in-game joining.
2023-03-09 23:47:19 -05:00
Goober5000 8b63f9528d fix Techroom_modelnum references
These should be >=, not >
2023-03-09 22:19:35 -05:00
mjn-mixael 08471e8749 cleanup includes 2023-03-09 16:41:18 -06:00
mjn-mixael 465190b154 fix some issues based on testing 2023-03-09 16:38:31 -06:00
mjn-mixael 3c498e65ec get hotkeys by line 2023-03-09 15:56:30 -06:00
mjn-mixael aa91e93aa6 copy/paste 2023-03-09 14:36:27 -06:00
mjn-mixael 3e24e21e4d add a dumb 2023-03-09 10:25:36 -06:00
mjn-mixael 6d142428c3 remove a dumb 2023-03-09 10:14:04 -06:00
mjn-mixael 92f140c080 add functions 2023-03-09 10:03:37 -06:00
mjn-mixael 03555ebce4 some cleanup and prep 2023-03-09 09:56:39 -06:00
Goober5000 0d3922d483 Merge pull request #5247 from Goober5000/fix_submodel_iteration
fix submodel sanity check
2023-03-08 19:51:37 -05:00
Goober5000 0f88965aed fix submodel sanity check
If a submodel doesn't have a parent, set `parent_sm` to nullptr instead of a random value.
2023-03-08 19:09:29 -05:00
Goober5000 a65813b292 Merge pull request #5234 from Goober5000/new_hud_gauges
add missing HUD gauges
2023-03-08 15:30:50 -05:00
Goober5000 8236a87d25 Merge pull request #5243 from Goober5000/add_ship_flags
add some ship flags to the alter-ship-flag lists
2023-03-08 15:29:55 -05:00
mjn-mixael e105b57a26 read access to mission hotkeys for scpui 2023-03-08 14:23:33 -06:00
Asteroth 482034a383 Adjust movement sanity checks to account for more situations (#5240)
* adjust movement sanity checks

* traverse through children

* use `model_iterate_submodel_tree`
2023-03-08 15:18:57 -05:00
Goober5000 5e255dd8d1 add some ship flags to the alter-ship-flag lists
A few ship flags were missing from these lists.
2023-03-07 22:40:21 -05:00
mjn-mixael 55a89dc13d clarify documentation 2023-03-07 13:27:00 -06:00
Fabian Woltermann 7205808e76 Merge pull request #5149 from MjnMixael/refactor_scrollback_msg
Refactor Msg_scrollback_lines
2023-03-07 18:11:06 +01:00
Goober5000 0b2c356fe8 Merge pull request #5241 from MjnMixael/fix_subsy_node_check
Check the op const, not the op dummy
2023-03-07 10:37:08 -05:00
JohnAFernandez 199fca289c Merge pull request #5223 from Baezon/shudder-multipliers
Add shudder multipliers
2023-03-07 10:29:12 -05:00
mjn-mixael c1260fc533 Check the op const, not the op dummy 2023-03-07 08:10:50 -06:00
niffiwan f9c9474b0c Merge pull request #5235 from niffiwan/fix/chucked-asteroids-speed
use large asteroids speed when chucking asteroids
2023-03-07 20:41:04 +10:00
niffiwan 625a77bdb1 Merge pull request #5238 from Baezon/remove-vestigal-attach-thrusters
Remove `Attach_thrusters` submodel flag
2023-03-07 20:40:29 +10:00
mjn-mixael 1d9fa9719c some cleanup 2023-03-06 18:26:19 -06:00
mjn-mixael bc2218a87b use a table 2023-03-06 18:22:33 -06:00
mjn-mixael b2e56dc408 Initial setup of lua access to help sections 2023-03-06 17:33:09 -06:00
mjn-mixael 8cd8e9b0ff address feedback 2023-03-06 09:45:55 -06:00
Fabian Woltermann 2392a6cc7d Merge pull request #5231 from BMagnu/volumetric_nebulae
Localized Volumetric Nebulae
2023-03-06 16:38:14 +01:00
Fabian Woltermann c8fd2af450 Merge pull request #5090 from MjnMixael/scpui_closeup_icons
SCPUI methods required for handling closeup briefing icon stuff
2023-03-06 16:36:44 +01:00
Mike Nelson 46d1386690 Enhance Dynamic SEXPs with parent parameters (#5033)
* Add ability for a Lua sexp parameter to require a 'parent' parameter

* Add dockpoint as a return type

* variable conflicts

* var name

* qtfred

* address feedback
2023-03-06 22:27:06 +09:00
BMagnu 7b288deb62 Add missing return statements 2023-03-06 14:26:29 +01:00
BMagnu 5be591a345 Separate parsing from initialization and remove RAII 2023-03-06 14:16:03 +01:00
niffiwan 5cc0404efc use input asteroids speed
In case anyone wants to change the type of asteroids chucked at ships in
future
2023-03-06 21:48:03 +10:00
Asteroth ece792d35b remove vestigal flag 2023-03-06 02:17:52 -05:00
BMagnu 7893f0e3c5 Remove superfluous comment 2023-03-06 00:15:59 +09:00
BMagnuandFabian Woltermann c2a61c7d86 Update volumetric fog uniform buffer
Co-authored-by: Fabian Woltermann <[email protected]>
2023-03-06 00:14:58 +09:00
Fabian Woltermann a918212fe6 Merge pull request #5237 from BMagnu/opengl_debug_access
Add new OpenGL Debug Mode to cmake
2023-03-05 15:42:15 +01:00
Birk Magnussen e561b9e915 Add new OpenGL Debug Mode to cmake 2023-03-05 14:56:53 +01:00
Fabian Woltermann 9d41b1bb1e Merge pull request #5236 from qazwsxal/gr_debug_groups
Enable debug scope on release builds
2023-03-05 14:21:17 +01:00
Birk Magnussen b3502ba413 Add GR debug scopes 2023-03-05 13:13:51 +01:00
Birk Magnussen 3917890981 Don't render volumetrics when fog is disabled 2023-03-05 13:03:01 +01:00
Adam Leach a150dc8255 Enable debug scope on release builds 2023-03-05 11:33:45 +00:00
niffiwan aa4c3840f4 use large asteroids speed when chucking asteroids
Chucked asteroids are always large. Therefore use their speed, not the
speed of the 1st parsed/small asteroid. Should not affect retail because
it uses the same speed for all three asteroids
2023-03-05 21:14:02 +10:00
niffiwan 65f96cbf42 Merge pull request #5233 from Baezon/fix-thruster-flicker
Small fix for thruster flicker
2023-03-05 21:06:30 +10:00
Mike Nelson e664849346 Use subsystem names instead of model names (#5217)
* use subsystem names instead of model names

* address feedback
2023-03-05 19:02:35 +09:00
Mike Nelson c7a5f87b1b Document options files (#5177)
* Some documentation

* top level descriptions
2023-03-05 19:01:45 +09:00
Goober5000 b265124459 add missing HUD gauges
Looks like the last time this list was updated was in commit 2cded90031, and other gauges have been added since then.  So let's update the list.
2023-03-05 01:36:09 -05:00
Asteroth 89f10a5495 small fix for thruster flicker 2023-03-05 00:55:14 -05:00
Birk Magnussen 2f4bea8b21 Fix claaaaang 2023-03-05 00:41:44 +01:00
Birk Magnussen 473f907a40 Fix more warnings 2023-03-05 00:28:34 +01:00
Birk Magnussen 8af5d4cf93 Tidy up more after lib 2023-03-05 00:06:06 +01:00
Birk Magnussen 58fd88a113 Tidy up after lib's warnings 2023-03-05 00:00:05 +01:00
Birk Magnussen b50456c244 Fix GCC Warns 2 2023-03-04 23:57:00 +01:00
Birk Magnussen 97fde4d149 Fix GCC Warns 2023-03-04 23:48:06 +01:00
Birk Magnussen 5b06f84771 Correct depth for FoV abberation 2023-03-04 23:24:34 +01:00
Birk Magnussen e194e84c27 Add FRED round trip support 2023-03-04 22:30:29 +01:00
Goober5000 e103eaeb45 add some XSTR entries (#5229)
Add XSTR entries for "or", "None", and "Nothing".

Note that there is already an XSTR entry for "none", but it does not have the right capitalization.

Note that "None" is localized in `textify_scancode` but not `textify_scancode_universal`.

This makes "Nothing" cargo use appropriate localization.

Fixes #5227.
2023-03-04 08:57:29 -06:00
Goober5000 8153e32351 Merge pull request #5224 from Baezon/ai-movement-flags
Update some movement flags to work for AI too
2023-03-03 23:29:20 -05:00
Goober5000 fd66eb7550 Merge pull request #5230 from Baezon/fix-damage-scaling-bug
Fix damage scaling oversight
2023-03-03 23:29:01 -05:00
Asteroth 02805be745 fix damage scaling oversight 2023-03-03 21:32:07 -05:00
Goober5000 f8f61e8b62 Merge pull request #5104 from Goober5000/persona_species
Persona species enhancements
2023-03-03 18:25:53 -05:00
BMagnu cfba7ec067 optimize Shader performance 2023-03-03 09:10:14 +01:00
Birk Magnussen 5e285e42bc Set proper texture address mide 2023-03-02 21:17:56 +01:00
Birk Magnussen 975b31dc91 Fix nebula alpha 2023-03-02 21:04:41 +01:00
MjnMixael 7a24e0e4c6 Refactor gameplay help (#5119)
* refactor gameplay help

* OCD

* some read better than others

* typo
2023-03-02 22:10:08 +09:00
MjnMixael 259828316d Use weapon tech model if no anim (#5075)
* initial working version

* cleanup and generalize variable names
2023-03-02 22:09:13 +09:00
BMagnu 3a3d2c4438 Tidy up shader code 2023-03-02 13:54:11 +01:00
BMagnu 4af5bf405f Make volumetrics obey nebula quality settings 2023-03-02 13:38:53 +01:00
BMagnu 7827cb4835 Add Noise intnsity lab integration 2023-03-02 13:01:10 +01:00
BMagnu db8292be03 Add noise color intensity 2023-03-02 12:54:00 +01:00
BMagnu 1b1a8983ee Properly check for uploaded textures 2023-03-02 12:39:14 +01:00
BMagnu 5e9dd9aef5 Calculate alpha for things rendered after the nebula 2023-03-02 12:35:35 +01:00
BMagnu c342a22507 handle 3d array access using define 2023-03-02 11:42:07 +01:00
Asteroth 15b1ed8822 fix name (#5225) 2023-03-02 10:23:49 +00:00
Asteroth a0e94eca92 update some movement flags to work for AI too 2023-03-01 21:11:23 -05:00
Asteroth 6720115b95 fix retail star look by applying gamma correction (#5222) 2023-03-01 20:19:00 -05:00
Asteroth c3d6d72941 add for engine wash too 2023-02-28 20:13:08 -05:00
Asteroth 0428fa221f add shudder multipliers 2023-02-28 20:08:26 -05:00
Birk Magnussen 7f83dd8ddb Fix volume map generation 2023-02-28 21:51:34 +01:00
Birk Magnussen dd1641fd15 Fix coordinates 2023-02-28 21:11:07 +01:00
Birk Magnussen 53b1dc690a Enter values from empirical testing 2023-02-28 20:27:11 +01:00
Birk Magnussen 5392a0d9fe Fix lab volumetrics 2023-02-28 20:24:46 +01:00
BMagnu 2f0e2f591f Adjust alpha of neb-affected effects 2023-02-28 14:17:49 +01:00
BMagnu cc1e26dd25 Fix skip_to_start_of_string_one_of 2023-02-27 16:56:08 +01:00
BMagnu 14b37add71 ImGui integration for neb settings 2023-02-27 16:49:39 +01:00
BMagnu e1f071036f Lab parse volumetric nebula 2023-02-27 15:55:03 +01:00
BMagnu 6b0f49cf3b Begin Lab integration 2023-02-27 09:37:11 +01:00
wookieejedi 9d57ca14de Add line of sight as optional AI override (#5220)
Many values in `ai.tbl` can be inserted as overrides for their equivalent `Ai_profiles.tbl` values. (They are all optional and if not set for an AI class, the values in AI Profiles will be used.)

This is particularly useful for making very specific AI classes that still follow the main AI profiles table with easy to change values.

This PR adds `$firing requires exact los:` as an optional override to set in `ai.tbl`. This particular override is very useful, since it can be set to off by default in the `ai_profiles.tbl` for performance, but then set to on for some select AI classes within `ai.tbl`, and those AI classes can be easily changed on the fly in a mission.
2023-02-26 21:43:40 -05:00
Birk Magnussen 2298c3fb31 Properly unload volume textures 2023-02-25 00:13:59 +01:00
Birk Magnussen 8f697dd03a Fix Noise, Fix Scale, Fix Pos 2023-02-24 23:50:50 +01:00
Goober5000 6eeeb788dc Merge pull request #5218 from Goober5000/5210_5157_followup
5210 and 5157 followup
2023-02-24 17:22:42 -05:00
BMagnu a60512cfa4 Add parsing for nebula settings 2023-02-24 14:51:18 +01:00
BMagnu 2fd24ecf29 Begin integration into mission 2023-02-24 14:16:38 +01:00
BMagnu 9cdbf4b5ed Load configurable noise 2023-02-24 11:59:21 +01:00
m!m d2e57becd3 Merge pull request #5219 from asarium/codeowners_update
Remove myself from code owners
2023-02-24 11:40:00 +01:00
asarium 305fa3c6eb Remove myself from code owners
I have not been able to keep up with code reviews for quite some time so
I should not be a default one.

Also fixed a copy issue which was missing an option to properly handle
already existing files.
2023-02-24 11:17:53 +01:00
Goober5000 7a2caea6ea here too 2023-02-23 23:02:30 -05:00
Goober5000 0fc8fcfad3 localization tweaks
1) follow-up to 5210: Avoid a memory leak caused by duplicating text, assigning it to a SCP_string, and then leaving the buffer in limbo
2) also keep the text as const char * since it's probably best to be consistent and keep the three types the same
3) be more scrupulous about checking for the existence of map entries, since the [] operator is create-if-not-found
2023-02-23 22:32:28 -05:00
Goober5000 dbe731782a prevent memory leaks in the mission log by using unique_ptr (since message_log_remove_segs no longer exists to free the strings) 2023-02-23 21:06:49 -05:00
Goober5000 6bc6b0f1e2 use SCP_string optimizations here 2023-02-23 20:35:48 -05:00
Birk Magnussen 6eee49a868 Optimize smoothing mode of volumetrics shader 2023-02-23 20:55:26 +01:00
Birk Magnussen b6f0e8e4e8 Build noise lib in release 2023-02-23 20:55:08 +01:00
BMagnu 1a5c39154d Very basic volumetric noise setup 2023-02-23 15:33:06 +01:00
Fabian Woltermann b373ad2df4 Merge pull request #5036 from MjnMixael/lua_access_to_enums
allow scripts to read LuaEnums and add LuaEnums
2023-02-23 14:46:48 +01:00
Fabian Woltermann 39c5336847 Merge pull request #5210 from MjnMixael/mapify_builtin_strings
Mapify builtin strings
2023-02-23 14:38:32 +01:00
Fabian Woltermann 9cfc6f4b07 Merge pull request #5157 from MjnMixael/refactor_scrollback_log
Refactor mission log scrollback
2023-02-23 14:35:15 +01:00
Fabian Woltermann 9190d90536 Merge pull request #5158 from MjnMixael/lua_goals_virtvars
Add virtvars for goal satisfaction and score
2023-02-23 14:33:54 +01:00
Fabian Woltermann 50fee8eb8a Merge pull request #5211 from Baezon/increase-snd-update
Increase sound update rate
2023-02-23 14:33:03 +01:00
Fabian Woltermann 7f44bd1969 Merge pull request #5213 from MjnMixael/check_dup_enum_items
Check duplicate enum items
2023-02-23 14:32:48 +01:00
BMagnu 03e3bdb40a cleanup noise 2023-02-23 12:33:33 +01:00
BMagnu c127b2b982 Make Edge smoothing toggleable 2023-02-23 11:06:50 +01:00
BMagnu 15d078aad2 Add edge smoothing and fix size ordering 2023-02-23 10:47:27 +01:00
Birk Magnussen 92fc993597 Remove UB due to Non uniform control flow 2023-02-23 00:48:53 +01:00
Birk Magnussen 88dd1f843b Disable noise 2023-02-23 00:14:26 +01:00
Birk Magnussen 084085a53f Make noise loadable 2023-02-22 23:19:45 +01:00
BMagnu eb81b50c55 Actually load noise volume texture 2023-02-22 16:50:19 +01:00
BMagnu 6e91356f47 Properly pass volumetric pso/size 2023-02-22 16:48:39 +01:00
BMagnu 9dbf5df152 Add Noise sampling to volumetric shader 2023-02-22 16:11:33 +01:00
BMagnu c2c02470d1 Add noise generation 2023-02-22 14:52:55 +01:00
BMagnu e78fbfb9be Add worley noise 2023-02-22 14:09:21 +01:00
BMagnu 756f0a9732 Incorporate new COLLIDE_ALL for nebula rendering 2023-02-22 12:26:54 +01:00
BMagnu 68ad0c826b Merge branch 'master' into volumetric_nebulae 2023-02-22 09:31:41 +01:00
Goober5000 f02ff33311 Merge pull request #5204 from Goober5000/enhance_sexp_comments
Enhance sexp comments
2023-02-21 21:40:25 -05:00
Goober5000 98268b139c Merge pull request #5214 from Goober5000/mc_info_init_update
add initializers to mc_info
2023-02-21 21:40:12 -05:00
Goober5000 5b175673ed add initializers to mc_info
This initializes `mc_info` to the correct values when it is constructed, removing the need for `mc_info_init`.

This PR also fixes a group of incorrectly inverted assignments in beam.cpp.
2023-02-21 19:09:10 -05:00
Asteroth 1dc4a210b7 Add collision flag for colliding with all polies (#5212)
* add collision flag for colliding with all polies

* copy paste error
2023-02-22 04:45:18 +09:00
mjn-mixael eaed502d62 break the loops 2023-02-21 12:25:49 -06:00
mjn-mixael 267921b443 skip the outer loop, not the inner loop 2023-02-21 11:51:07 -06:00
mjn-mixael 439f59e1f2 check for duplicates here, too 2023-02-21 09:12:54 -06:00
mjn-mixael ce8724a653 disallow enum duplicates 2023-02-21 09:10:48 -06:00
mjn-mixael ed78597635 check for duplicate enum items 2023-02-21 08:39:47 -06:00
mjn-mixael af41185acb Merge branch 'master' into lua_access_to_enums 2023-02-21 08:00:02 -06:00
MjnMixael 61247bf3e2 sexps to check turret weapons (#5072) 2023-02-21 18:11:21 +09:00
MjnMixael c83b4b5838 is-ship-emp-active sexp (#5071)
* is-ship-emp-active sexp

* remove these

* remove counting

* unused variable declarations
2023-02-21 18:11:00 +09:00
MjnMixael f6ffe4e399 add pre-parse enums support (#5011)
* add pre-parse enums support

* Skip to the next defined enum if one already exists by this name.

* do this as string instead of char array
2023-02-21 18:10:52 +09:00
Asteroth 18b48214a2 Fix some issues with damage application (#5084)
* fix some issues with damage application

* typo

* turn off flag for new versions

* update versions to apply to post 23.0 nightlies
2023-02-21 18:10:44 +09:00
Asteroth ddc5c7ac8b increase sound update rate 2023-02-21 01:17:09 -05:00
Goober5000 9d0629f657 Merge pull request #5196 from MjnMixael/flag_sexp_descriptions
Flag sexp descriptions
2023-02-20 23:26:29 -05:00
mjn-mixael 7d0743d5ed SCP_string 2023-02-20 18:01:08 -06:00
mjn-mixael 9e24469928 emplace 2023-02-20 17:28:21 -06:00
mjn-mixael 4483d5051b remote the last of the old array and actually copy the data into the map 2023-02-20 17:06:01 -06:00
the-maddin 4e9309a154 Comment branch types 2023-02-20 21:15:08 +01:00
the-maddin 439c22b528 Merge branch 'master' into qt-campaign-editor 2023-02-20 21:07:01 +01:00
Fabian Woltermann e3be23ac7f disable the fog pass when rendering cockpits (#5208) 2023-02-20 23:17:47 +09:00
MjnMixael 39c71d3a7b Flag to apply hud shudder to chase view (#5145)
* flag to apply hud shudder to chase view

* not not
2023-02-20 23:13:24 +09:00
MjnMixael b2fe7a94ae Remove nebula bitmap limit (#5128)
* Remove nebula bitmap limit

* FRED bounds check and qtFRED

* remove length checks
2023-02-20 23:13:10 +09:00
Asteroth b7353b2027 Add turret-fired-since SEXP (#5061)
* add turret-fired-since

* update to new timestamp system

* unused variables
2023-02-20 22:10:49 +09:00
BMagnu bef3f33f6a Always to sample buffer assign 2023-02-20 11:04:55 +01:00
BMagnu d0f051847c reduce 3d texture build from O(n^3) to O(n^2) 2023-02-20 11:00:41 +01:00
Fabian Woltermann 153d3effaa Merge pull request #5160 from The-E/feature/vulkan
make the vulkan support buildable again
2023-02-20 10:54:11 +01:00
Fabian Woltermann 96f0c66722 shut down the imgui SDL backend regardless of graphics API selected 2023-02-20 10:27:31 +01:00
Goober5000 bdea153270 Merge pull request #5163 from MjnMixael/lua_update_discord
Lua update discord
2023-02-19 18:40:18 -05:00
mjn-mixael 13e28a3102 const the header, dummy 2023-02-19 14:58:17 -06:00
Goober5000 b089dabadc Merge pull request #5207 from MageKing17/bugfix/negative-check-inversion
Fix negative child check inversion.
2023-02-19 15:54:48 -05:00
Goober5000 a20dd3bea9 Merge pull request #5174 from MjnMixael/get_audiostream_duration
get audiostream duration in float seconds
2023-02-19 15:46:30 -05:00
mjn-mixael 5dc8b04dab boom chikka const const 2023-02-19 14:32:48 -06:00
mjn-mixael 00995f5516 typos 2023-02-19 14:29:00 -06:00
MageKing17 8846e043fb Fix negative child check inversion.
In PR #5202, a bunch of `Assert(child >= 0);` statements were replaced with `if (child < 0) return nullptr;`, except the first one kept the assertion's condition (inverting the logic). This fixes this accidental inversion.
2023-02-19 12:26:37 -08:00
Goober5000 89c6d330f8 Merge pull request #5159 from MjnMixael/credits_no_splitting
Prevent line splitting if building credits for SCPUI
2023-02-19 15:10:14 -05:00
Goober5000 42db9f2e7b Merge pull request #5169 from MjnMixael/countermeasure_cargo_size
Feature for countermeasures to respect cargo size
2023-02-19 15:06:17 -05:00
Goober5000 35f4dab373 Update code/sound/audiostr.h
Update documentation
2023-02-19 14:44:41 -05:00
mjn-mixael 2ed504eb82 clarified descriptions 2023-02-19 10:48:48 -06:00
MjnMixael 5074a939ed Merge branch 'master' into lua_update_discord 2023-02-19 10:39:11 -06:00
Fabian Woltermann ec4222b412 Merge pull request #5190 from MjnMixael/lua_os_focus
Lua method to check if the game has focus
2023-02-19 17:22:27 +01:00
Fabian Woltermann 901dfe310b Merge pull request #5186 from MjnMixael/on_warp_complete_hook
On warp complete hook
2023-02-19 17:21:58 +01:00
Fabian Woltermann 5f6f4c11b2 Merge pull request #5191 from MjnMixael/unlimited_power
Unlimited Power
2023-02-19 17:21:07 +01:00
Fabian Woltermann 2de1441bf1 Merge pull request #5192 from MjnMixael/cutscene_custom_data
Cutscene custom data
2023-02-19 17:20:48 +01:00
Fabian Woltermann e1de3b6ac4 Merge pull request #5202 from Goober5000/deblongify_fred
deblongify fred
2023-02-19 17:20:02 +01:00
Fabian Woltermann 6960fe58c8 Merge pull request #5203 from Baezon/no-bsp-tree-optimization
Remove previous bsp tree skipping optimization
2023-02-19 17:19:46 +01:00
Fabian Woltermann 4b6a791b02 pin vulkan version to 1.3.204.0 2023-02-19 15:43:17 +01:00
Fabian Woltermann 801b693e63 make sure the WITH_VULKAN compile time flag is still set 2023-02-19 15:43:17 +01:00
Fabian Woltermann 0ab3a85289 cleanup 2023-02-19 15:43:17 +01:00
Fabian Woltermann faf8fb2ecc don't build vulkan on macos for now either 2023-02-19 15:43:17 +01:00
Fabian Woltermann 0fbc422ca0 remove vulkan references from the lab 2023-02-19 15:43:17 +01:00
Fabian Woltermann c835481e6d x86 builds don't get vulkan 2023-02-19 15:43:17 +01:00
Fabian Woltermann 4deaecece9 more compile fixes 2023-02-19 15:43:17 +01:00
Fabian Woltermann 1387c46b67 fix the rest of the pipelines 2023-02-19 15:43:17 +01:00
Fabian Woltermann acd4486fc1 remove unfinished imgui init 2023-02-19 15:43:17 +01:00
Fabian Woltermann b7343690de move vulkan sdk install to similar place in macos pipeline 2023-02-19 15:43:17 +01:00
Fabian Woltermann 7d39df9871 fix missing fall-through in case statement 2023-02-19 15:43:17 +01:00
Fabian Woltermann 4ab8d35b8b add curl to the gha container 2023-02-19 15:43:16 +01:00
Fabian Woltermann 3e7e3bfb4d more cleanup 2023-02-19 15:43:16 +01:00
Fabian Woltermann 42a16b4c7d fix minor issues breaking compilation in CI 2023-02-19 15:43:16 +01:00
Fabian Woltermann 7ea7953cd7 wip 2023-02-19 15:43:16 +01:00
Fabian Woltermann 0bb898ae2e download the vulkan sdk in the pipeline 2023-02-19 15:43:16 +01:00
Fabian Woltermann c6831d8b30 instead of shipping our own copy of vulkan-hpp, use the one in the official SDK 2023-02-19 15:43:16 +01:00
Asteroth 68aec1edef Merge remote-tracking branch 'upstream/master' into no-bsp-tree-optimization 2023-02-19 04:07:07 -05:00
Fabian Woltermann 072fee459b Merge pull request #5199 from Baezon/refactor-submodel-rand-points
Add `GetVertex()` and `NumVertices()` script functions and clean up random submodel point retrieval a bit
2023-02-19 08:58:03 +01:00
Goober5000 d85d854646 make multiline work in text editor 2023-02-18 16:17:32 -05:00
Goober5000 23c5355bc7 make multiline comments display properly without length restriction 2023-02-18 15:45:28 -05:00
Asteroth eba379330e update naming and remove unused function 2023-02-18 15:31:06 -05:00
Asteroth f75f08f7ba remove previous optimization 2023-02-18 15:15:41 -05:00
Goober5000 0357df1e7d add comment 2023-02-18 15:01:44 -05:00
Asteroth 7a5c6df202 update docs and prints 2023-02-18 14:58:00 -05:00
Goober5000 628ac80f2c prevent fred from crashing on a node that shouldn't be there 2023-02-18 14:55:18 -05:00
Goober5000 ea58a760ff prevent the BLONG by capturing keypresses 2023-02-18 14:09:44 -05:00
Fabian Woltermann 5e79d94bad Merge pull request #5201 from The-E/fix/deprecated_github_actions
Fix github CI deprecation warnings
2023-02-18 19:48:23 +01:00
Goober5000 2f4059b7fd Merge pull request #5198 from Goober5000/fix_mission_version
mission version numbers should be major.minor
2023-02-18 13:46:18 -05:00
Fabian Woltermann b030148c21 Merge pull request #5019 from Goober5000/query_referenced_update
more #define updates
2023-02-18 18:45:22 +01:00
MjnMixael 754c351498 per bank autoaim (#5074)
adds per-bank autoaim feature
2023-02-18 18:43:03 +01:00
Fabian Woltermann f45a6fb58c removes soon to be deprecated github CI commands. For details see https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ 2023-02-18 18:30:08 +01:00
Asteroth 6e25fbb50f unused variable 2023-02-17 23:55:22 -05:00
Asteroth db5a37c178 add num vertices script func 2023-02-17 23:23:24 -05:00
Asteroth b68e424213 refactor getting random vertices and script func 2023-02-17 23:03:57 -05:00
Goober5000 af428ca6b9 other feedback 2023-02-17 21:59:57 -05:00
Goober5000 731b5d53c5 change case 2023-02-17 21:50:42 -05:00
Birk Magnussen 3042846e62 Fix model-based volume generation 2023-02-18 00:17:44 +01:00
Goober5000 8d27682126 mission version numbers should be major.minor
Since older builds of FRED parse the mission version as a float, the version can contain a maximum of one decimal point.  These changes allow FRED and FSO to disregard the build number when loading, saving, or comparing versions.

There is also a small fix to qtfred's saving of the author field.
2023-02-17 12:32:54 -05:00
mjn-mixael 9f20cb1921 descriptions 2023-02-17 10:03:54 -06:00
BMagnu 8b75bbbb0d Add model read for 3d texture sample 2023-02-17 15:09:21 +01:00
BMagnu 9220b48592 Fix Typo and test oversampling 2023-02-17 13:26:18 +01:00
BMagnu f7f2b5f025 Encapsulate 3d texture render in volumetrics class 2023-02-17 11:59:13 +01:00
BMagnu 2531a31b1e tidyup parameters 2023-02-17 10:42:23 +01:00
Goober5000 8d406c2167 Merge pull request #5069 from MjnMixael/popup_shortcut_var
Pass shortcut key character to Lua as a hook variable
2023-02-16 22:32:44 -05:00
Goober5000 0813a7f416 Merge pull request #5195 from MjnMixael/fix_qtfred_building
missed items required to build qtfred
2023-02-16 22:31:45 -05:00
Goober5000 9a1badf444 Merge pull request #5193 from MjnMixael/object_death_documentation
Match documentation description to actual hook names.
2023-02-16 22:30:28 -05:00
MjnMixael 5df51711fe add ability to disable grid rendering for each stage (#5053)
* add ability to disable grid rendingering for each stage

* revert these
2023-02-16 22:22:32 -05:00
MjnMixael 7ec27f147f Allow for arbitrary briefing icon scaling (#5047)
* allow for arbitrary briefing icon scaling

* only apply valid scale values
2023-02-16 22:22:16 -05:00
mjn-mixael e972cdc2cf explicit size_t 2023-02-16 21:10:07 -06:00
mjn-mixael f220075bbe missed items required to build qtfred 2023-02-16 20:45:01 -06:00
mjn-mixael 730c84308e qtFRED support 2023-02-16 20:36:04 -06:00
mjn-mixael badde3ad96 Let FRED display flag descriptions 2023-02-16 17:12:47 -06:00
BMagnu 1371dc3a08 Add attribution before I forget 2023-02-16 16:11:09 +01:00
mjn-mixael 0c5342b875 Match documentation to actual hook names. 2023-02-16 09:05:30 -06:00
BMagnu 4c3024e5fc Add Beer-Powder absorption for diffuse lighting 2023-02-16 16:03:47 +01:00
mjn-mixael bbb7539fb6 cutscene custom data 2023-02-16 08:50:03 -06:00
BMagnu a9a110e8fa Add Heyney Greenstein Scattering 2023-02-16 14:58:19 +01:00
BMagnu a71dbbab6a Tidy up shader and prepare for diffuse lighting 2023-02-16 13:29:43 +01:00
BMagnu 3e8be9c8a3 Fix emissive blur 2023-02-16 12:30:56 +01:00
mjn-mixael b2270e4714 OPF_BOLT_TYPE is the senate 2023-02-15 18:24:37 -06:00
mjn-mixael 5410b3ef46 sssssssnake case 2023-02-15 16:54:17 -06:00
mjn-mixael 5344b45c47 scripting documentation 2023-02-15 16:48:11 -06:00
mjn-mixael 2bdf6c21f2 i pity the bool 2023-02-15 16:44:41 -06:00
mjn-mixael 5b2bd80609 cleanup os_foreground() 2023-02-15 16:42:03 -06:00
mjn-mixael 8063fc3863 Unlimited Power 2023-02-15 16:34:15 -06:00
Birk Magnussen 9ac262579d Document Emissive Attempts 2023-02-15 20:39:16 +01:00
mjn-mixael 4924f56613 lua method to check if the game has focus 2023-02-15 10:01:59 -06:00
BMagnu dbc2cb1c27 prepare volumetric shader for multi-influence color 2023-02-15 15:51:14 +01:00
Fabian Woltermann 076ad7770b remove main shader compile-time flags (#5055) 2023-02-15 15:20:11 +01:00
BMagnu 3c942fc409 Proper step calculation based on nebula parameters 2023-02-15 15:09:37 +01:00
BMagnu 5f48e55990 Proper alpha-considering ray marching 2023-02-15 14:26:48 +01:00
MjnMixael aaee1e5a32 enhance handling of motion debris (#5022)
* enhance handling of motion debris

* dunno what i was thinking here

* address feedback

* require all four bitmaps to be defined in new parsing method

* address feedback
2023-02-15 17:13:48 +09:00
MjnMixael ce274209c1 adds hudgage and event to the valid types of a Lua Sexp parameter (#5018) 2023-02-15 17:13:38 +09:00
MjnMixael 7be49e67d1 modular autopilot table (#4978)
* modular autopilot table

* clarical comment
2023-02-15 17:13:29 +09:00
BMagnu 8731ad1448 Add option to deprecate hooks (#5184)
* Add hook deprecation to calls

* Deprecate hooks properly

* Change OnSplashScreen hook callig

* Check for deprecated hooks at script time

* include hooks directly

* Check deprecation for lua added hooks

* Write deprecation notice to docs

* rescope Target_version

* fix typo
2023-02-15 17:12:25 +09:00
Birk Magnussen a5f634885b Get volumetric ray marching working 2023-02-15 01:14:34 +01:00
Goober5000 fe4d93393b Merge pull request #5122 from Goober5000/parse_object_colgroup
make collision_group_id accessible to parse objects
2023-02-14 18:45:06 -05:00
Birk Magnussen 9de6beb4c2 First working raycast 2023-02-14 21:03:18 +01:00
BMagnu 4485efe484 Add FRED SpaceMouse support (#4984)
* Add hidapi lib

* Add Spacemouse Interface

* Integrate HID API

* Implement basic 3dconnexion hid protocol

* FRED Spacemouse integration

* QtFRED support

* Fix assertion

* More devices

* Increase polling

* Wireless resetting

* QtFRED polling frequency

* Add nonlinear scalings

* Linux Build Options for HIDAPI

* Linux Build Options for HIDAPI 2

* Fix GCC

* Resolve Type Aliasing

* Fix out-of-focus control

* rename searchSpaceMouse
2023-02-15 03:00:08 +09:00
mjn-mixael 12a0a8642e override then normal hook 2023-02-14 09:56:22 -06:00
mjn-mixael e246616fac on warp complete hook 2023-02-14 09:43:35 -06:00
BMagnu d3701166af Properly clear new composite buffer 2023-02-14 16:41:57 +01:00
BMagnu e1db2ca59a Hooks into deferred draw code 2023-02-14 15:39:05 +01:00
BMagnu 063a567fe4 Being volumetrics calculations 2023-02-14 15:22:23 +01:00
BMagnu c32c655350 Keep Emissive texture intact during deferred render step 2023-02-14 15:21:00 +01:00
BMagnu 91d274cd6d Add 3D-Texture support 2023-02-14 14:36:28 +01:00
MjnMixael 08742f36e8 enable commandline language setting (#5013) 2023-02-14 17:28:09 +09:00
MjnMixael 24571d099e modular ai classes table (#4945)
* modular ai classes table

* bool instead of int

* merge these
2023-02-14 17:27:16 +09:00
MjnMixael f29c48965e fictionviewer localization (#5012)
* fictionviewer localization

* Move this to it's own method

* C_str
2023-02-14 17:26:36 +09:00
MjnMixael fbb209ef6b Modular rank table (#4854)
* vectorize ranks

* Add modular table parsing

* int

* comments

* prevent field overwriting if tbm is used

* address feedback

* off by one
2023-02-14 17:25:52 +09:00
Goober5000 7cc9f72cac Merge pull request #5077 from MjnMixael/gameplay_profiles_alias
Allow gameplay_profiles.tbl to be an alias of ai_profiles.tbl
2023-02-13 21:45:21 -05:00
Goober5000 6f7f9c2f48 Merge pull request #5120 from MjnMixael/scpui_pause_screen
funcs and virtvars for SCPUI pause screen
2023-02-13 21:45:12 -05:00
Goober5000 d398ce25fb Merge pull request #5117 from MjnMixael/pause_weapon_sounds
Expose pausing weapon sounds
2023-02-13 21:39:39 -05:00
Goober5000 3c59687d75 Merge pull request #5185 from MjnMixael/splash_screens_range
Keep splash screen rand choice in range
2023-02-13 21:13:19 -05:00
mjn-mixael ef3af0e254 Keep this in range 2023-02-13 14:56:27 -06:00
MjnMixael 40807000ad Merge branch 'master' into countermeasure_cargo_size 2023-02-12 23:18:02 -06:00
Goober5000 de5a422fc0 Merge pull request #5146 from MjnMixael/on_asteroid_created
On asteroid created hook
2023-02-12 21:25:32 -05:00
Goober5000 4b86f32b21 Merge pull request #5183 from Goober5000/thruster_flag_rename
rename thruster flags
2023-02-12 20:52:48 -05:00
Goober5000 09b6552908 rename thruster flags
`Roll_` and `Bank_` are synonyms, and the `Roll_` thruster flags should be `Yaw_` anyway, so rename them and rename their table strings.  This still checks the old table strings for compatibility.
2023-02-12 19:42:26 -05:00
Goober5000 de3e158b73 Merge pull request #5182 from Baezon/fix-thruster-sounds
Fix thruster sounds and add flag for player thruster sounds
2023-02-12 19:36:38 -05:00
Goober5000 a0c0766146 Merge pull request #5181 from Goober5000/build_fix
build compatibility fix
2023-02-12 19:24:12 -05:00
Asteroth 05790db5e7 clean up 2023-02-12 18:47:02 -05:00
Asteroth d28833e92a fix thruster sounds and add flag 2023-02-12 15:55:23 -05:00
Goober5000 60e5ba9541 Merge pull request #5139 from MjnMixael/has_armor_sexp
has-armor-type sexp
2023-02-12 15:40:53 -05:00
Goober5000 705d4a519f Merge pull request #5175 from MjnMixael/unlimit_cheats
Remove message requirement for custom cheats
2023-02-12 15:39:38 -05:00
Goober5000 950fbf1a13 Merge pull request #5178 from MjnMixael/lua_free_models
Lua method to free all loaded models
2023-02-12 15:39:27 -05:00
Goober5000 dd0b099d9b Merge pull request #5176 from MjnMixael/disable_old_debug_cmnds
Remove some old debug key checks in mainhall
2023-02-12 15:39:19 -05:00
Goober5000 ca6f25f5af Merge pull request #5085 from Goober5000/play_dead_ets
prevent ship from managing ETS if it is playing dead
2023-02-12 13:34:21 -05:00
MjnMixael 09215672a1 override to set glowpoint bank to default off (#5091) 2023-02-12 09:54:23 -05:00
MjnMixael 1076493ceb choose random splash image (#5054)
* choose random splash image

* address feedback
2023-02-12 09:52:57 -05:00
Goober5000 28a1e2a3d4 build compatibility fix
Follow-up to #5138.  Tweak the function header to be more compatible with different build environments; some don't like the `= ""` for some reason.
2023-02-11 22:18:38 -05:00
MjnMixaelandGoober5000 280d8c8c8a increase mission author name length limit (#5162)
* increase mission author name length limit

* use string_copy

---------

Co-authored-by: Goober5000 <[email protected]>
2023-02-12 08:29:18 +09:00
MjnMixael 58e7d50b1c Add to description 2023-02-11 16:19:24 -06:00
Goober5000 1c4db98bc5 Merge pull request #5180 from Goober5000/update_version_23.1.x
bump version to 23.1.x
2023-02-11 16:53:33 -05:00
Goober5000 214c6e3d5c bump version to 23.1.x 2023-02-11 16:28:59 -05:00
Goober5000 eaa063ba65 Merge pull request #5152 from Goober5000/mission_versioning
add versioning support to missions
2023-02-11 16:19:33 -05:00
mjn-mixael 002ab4885e gate float divisions behind mod flag 2023-02-11 14:48:55 -06:00
Goober5000 58175aa386 Merge pull request #5179 from Goober5000/model_sanity_checks
add some sanity checks for submodel indexes
2023-02-11 15:41:24 -05:00
Goober5000 0e70c4918a Merge pull request #5079 from MjnMixael/visible_node_comments
Make sexp node comments more visible at a glance
2023-02-11 15:37:27 -05:00
Goober5000 0d75790a6a Merge pull request #5138 from MjnMixael/force_emp_sexp
hud-force-emp-effect sexp
2023-02-11 15:36:48 -05:00
Goober5000 85e11ecd6d Merge pull request #5096 from MjnMixael/opf_turret_type
Implement opf_turret_type
2023-02-11 15:36:35 -05:00
Goober5000 3651239a6b Merge pull request #5010 from Goober5000/more_category_updates
more category updates
2023-02-11 15:33:28 -05:00
mjn-mixael 041a390660 no team, dummy 2023-02-11 14:26:39 -06:00
Goober5000 6bc1bff0ab add some sanity checks for submodel indexes
Add some checks during model load for submodel indexes that could be out of range due to a corrupt model.
2023-02-11 00:32:24 -05:00
mjn-mixael de1215f64e unused 2023-02-10 21:40:10 -06:00
mjn-mixael d101227721 lua method to free all loaded models 2023-02-10 20:57:23 -06:00
mjn-mixael 13b7f626a9 appease etp 2023-02-10 09:30:38 -06:00
mjn-mixael 0e375e2e0d remove some old debug key checks in mainhall 2023-02-10 09:00:38 -06:00
mjn-mixael a360245857 remove message requirement for custom cheats 2023-02-09 15:08:30 -06:00
mjn-mixael d0e26adc20 appease goober 2023-02-07 16:08:32 -06:00
wookieejedi 9403f17fbb Adds safety checks to scripting orders with waypoints (#5173)
* Adds safety checks to scripting orders with waypoints

Turns out setting a waypoint order then trying to get to target of that order in the same frame triggers a crash in the scripting API for ship orders (`order.cpp` line 295). This was due to invalid lookups which lacked safety checks.

This PR adds those safety checks. Now, if this situation is encountered, it leaves `objnum` at -1 and thus returns an object for which `isValid` is false.

Fix is tested and works as expected. Also fixes #5172

* appease clang

* cleanup thanks to Goober

* clang again

* forgot to re-add the nullptr

* remove redundant checks
2023-02-07 15:57:39 -05:00
mjn-mixael 289266d959 get audiostream duration in milliseconds 2023-02-07 13:18:53 -06:00
Goober5000 9a7b3fe0d6 Merge pull request #5171 from MjnMixael/clear_credits_scpui
Clear credits before rebuilding
2023-02-04 20:50:40 -05:00
mjn-mixael c5ea47fd05 clear credits before rebuilding 2023-02-04 01:26:04 -06:00
Goober5000 11dcb01a98 Merge pull request #5167 from Baezon/fix-ai-secondary-selection
Fix inadvertent AI usage of invalid weapons
2023-02-03 19:29:32 -05:00
mjn-mixael 4f36c6a781 feature for countermeasures to respect cargo size 2023-02-03 10:15:32 -06:00
BMagnu 605e89a01a Fix WeaponUsedConditions (#5165) 2023-02-03 06:23:48 +09:00
Asteroth 2100a0d2f3 change ai_choose_secondary_weapon to return validity 2023-02-02 15:37:27 -05:00
Goober5000 37f7c569b8 Merge pull request #5156 from Baezon/no-invalid-priority2-assignment
Dont assign a possibly -1 priority2_index
2023-02-01 19:48:37 -05:00
mjn-mixael 4a8991703f missed comma 2023-02-01 12:17:58 -06:00
mjn-mixael 34232bd5d8 const char instead of SCP_string 2023-02-01 12:03:44 -06:00
mjn-mixael 7eca7febcb expose setting discord presence 2023-02-01 11:52:41 -06:00
mjn-mixael 0ad91aaf3d prevent line splitting if building credits for SCPUI 2023-01-31 16:19:40 -06:00
mjn-mixael e83609b121 properly force fit the actions 2023-01-30 14:22:57 -06:00
mjn-mixael 1d93e9bff6 variable collision 2023-01-30 14:01:24 -06:00
mjn-mixael a568f514a3 add virtvars for goal satisfaction and score 2023-01-30 13:59:31 -06:00
mjn-mixael ed8a511fe9 refactor mission log scrollback 2023-01-30 13:37:02 -06:00
MjnMixael 1a6517cf51 if no valid choices, bail (#5153) 2023-01-30 13:42:47 -05:00
Asteroth e9c3b7e4b2 little clearer 2023-01-30 13:24:44 -05:00
Asteroth 2ae50c4a70 dont assign a possibly -1 priority2_index 2023-01-30 13:22:14 -05:00
Asteroth a5546a5dc7 better safety for ai_select_secondary_weapon (#5151) 2023-01-30 01:45:13 -05:00
Goober5000 f083018628 Merge pull request #5107 from MjnMixael/better_verify_orders
some validity checks to order sending
2023-01-28 20:43:37 -05:00
Goober5000 3c723c9ea9 add versioning support to missions
This finally enables the `$Version:` field in FreeSpace missions, which has been present ever since the beginning of FS1's development but has never been used for its intended purpose.  This field now stores the version of FSO that is required to run the mission.  If the version of the engine is not sufficient to run the version of the mission, then a) the mission is hidden from the mission listing, or b) a friendly notification is displayed if the mission is loaded anyway (for example, through a campaign).  Furthermore, FRED will notify the user if the mission's version is migrated from any version other than the legacy 0.10.

It will be the responsibility of coders who modify the mission format to also update the `MISSION_VERSION` constant with the appropriate major/minor/build/revision of the format change.
2023-01-28 18:01:51 -05:00
mjn-mixael e9be428cd1 refactor Msg_scrollback_lines 2023-01-27 16:36:03 -06:00
Goober5000 07768b2d2d Merge pull request #5142 from EatThePath/remove_trail_exclusion
Removed unhelpful optimization from trail rendering
2023-01-26 20:34:13 -05:00
Goober5000 543c7f220c Merge pull request #5144 from MjnMixael/fix_weapon_origin
If we're not drawing weapon models then skip all this
2023-01-26 20:34:02 -05:00
mjn-mixael 8360bae5af on asteroid created hook 2023-01-26 11:24:33 -06:00
mjn-mixael 6162c475a0 float 2023-01-26 08:34:34 -06:00
mjn-mixael 9419f24184 warning 2023-01-26 08:30:26 -06:00
Goober5000 ed14e03f73 Merge pull request #5141 from MjnMixael/scpui_load_hires
Allow way to prevent scpui loading hires animations
2023-01-25 22:47:33 -05:00
Goober5000 6cd74c979a Merge pull request #5137 from MjnMixael/num_linkable_weapons
Check if we have at least two linkable weapons
2023-01-25 22:46:34 -05:00
Goober5000 67d5acd836 Merge pull request #5143 from Goober5000/fix_tips
patch player tips
2023-01-25 20:25:01 -05:00
Goober5000 7978cbae0b Merge pull request #5140 from MjnMixael/check_beam_damage_factor
Warn if beams have damage factors while damage factors are disabled
2023-01-25 20:24:50 -05:00
mjn-mixael fe787ade08 if we're not drawing weapon models then skip all this 2023-01-25 17:06:07 -06:00
mjn-mixael 236b648b11 address feedback 2023-01-25 08:43:11 -06:00
mjn-mixael 414c630d04 address feedback 2023-01-25 08:31:36 -06:00
Goober5000 c70806a705 patch player tips
1. Be consistent about the check for `Player` being null, as the `Player` variable may be used later in the function without a null check
2. Return early if there are no tips to show, so as to prevent a crash
3. Use `Random::next` rather than `frand_range`
4. Use `SCP_string` to avoid string overflow

Fixes a crash discovered in Star Fox: Event Horizon
2023-01-25 00:01:36 -05:00
David Gibson 6ecfe2f186 Removed unhelpful optimization from trail rendering 2023-01-24 16:58:36 -06:00
mjn-mixael e0baaa6087 Allow way to prevent scpui loading hires animations 2023-01-24 16:20:00 -06:00
mjn-mixael 663ce18fab warn if beams have damage factors while damage factors are disabled 2023-01-24 12:28:33 -06:00
mjn-mixael d7bbecfa16 has-armor-type sexp 2023-01-24 11:20:25 -06:00
mjn-mixael d2e1e2b5de hud-force-emp-effect sexp 2023-01-23 21:50:36 -06:00
mjn-mixael 9e1181b70f check if we have at least two linkable weapons 2023-01-23 09:04:15 -06:00
Tyler Blount ae5c49e970 Merge pull request #5136 from scp-fs2open/fix/post-release-secrets
Inherit secrets when publishing Release builds
2023-01-22 20:49:40 -07:00
Tyler Blount 14d51b4584 Inherit secrets when publishing Release builds 2023-01-22 19:03:52 -07:00
Goober5000 b92954877d Merge pull request #5135 from Goober5000/fix_5089
fix sunglares when lightshafts are disabled
2023-01-22 15:02:08 -05:00
Asteroth 3047a226a3 Better account for runtime gravity changes (#5130)
* better account for changing gravity

* use `obj_used_list`

* check should_be_dead
2023-01-22 14:40:13 -05:00
MjnMixael 9974457df0 let passive fields wrap if gravity is involved (#5132) 2023-01-22 13:56:34 -05:00
Goober5000 11f2635abd add parse object collision group to sexps 2023-01-21 18:53:40 -05:00
Goober5000 df8268368a make collision_group_id accessible to parse objects
Add collision groups to parse objects so they can be set before arrival via script.
2023-01-21 18:10:51 -05:00
Goober5000 c72e214c47 fix sunglares when lightshafts are disabled
This is another case of a bug introduced by a bugfix, in this case #3885.  The original bug inadvertently made sun glare work in most cases where it was supposed to.

This commit removes the check for lightshafts when drawing the sun glare.  Since sun glare can be drawn regardless of whether lightshafts are enabled, the only thing that matters is to check that the view is not shadowed.
2023-01-21 17:52:55 -05:00
EatThePath 7177361c82 Merge pull request #5126 from EatThePath/fix-my-cmdline-mess
adding proper launcher documentation for some of my recent flags
2023-01-21 09:12:51 -06:00
Asteroth 654b0a0e42 Improve handling of failure to find spawn weapons (#5111)
* improve handling of failure to find spawn weps

* docs

* shadowing
2023-01-21 01:33:25 -05:00
Goober5000 add6a60439 Merge pull request #5129 from MjnMixael/more_asteroid_sexp_fixes
Move these checks into asteroid.cpp
2023-01-20 21:26:50 -05:00
MjnMixael 5694e5c810 Allow negative number in event editor (#5106)
* allow negative number in event editor

* handle qtFRED ui also
2023-01-20 18:06:08 +01:00
Goober5000 5c8806d040 Merge pull request #5127 from Goober5000/dont_blast_nocollide
don't blast no-collide objects
2023-01-19 21:38:57 -05:00
mjn-mixael 798e47409a Move these checkes into asteroid.cpp 2023-01-18 16:24:48 -06:00
Goober5000 f8acd4f898 don't blast no-collide objects
In the same way that navbuoys aren't blasted by explosions, no-collide objects shouldn't be blasted either.

Fixes #5068.
2023-01-18 01:59:20 -05:00
David Gibson 689467e21f ADding proper launcher documentation for some of my recent flags 2023-01-17 13:14:10 -06:00
Goober5000 b6ff2caa0a update the .mako file for release posts (#5118)
* update the .mako file for release posts

1. Change the "previous release" thread to 22.2
2. Change http to https where possible
3. Link to the github Bug Triage page rather than the Mantis filter
2023-01-17 01:52:15 +00:00
mjn-mixael 6b097be0a6 use me daddy 2023-01-16 14:15:56 -06:00
mjn-mixael 9980c3f5c5 funcs and virtvars for SCPUI pause screen 2023-01-16 14:02:01 -06:00
mjn-mixael bd1a288cd9 expose pausing weapon sounds 2023-01-15 21:02:50 -06:00
Tyler Blount 5020cf8b64 Merge pull request #5114 from z64555/fix_5113
Fix and expand upon debug safety catcher for ccfg.tbl flag reading.
2023-01-15 15:12:56 -07:00
Tyler Blount 4f1d486ea3 Merge pull request #5110 from MjnMixael/fix_asteroid_sexps
make sure we have an argument
2023-01-15 13:30:07 -07:00
Fabian Woltermann e8c9a0a3aa do not update the gl buffer for a batch if the batch is empty (#5115) 2023-01-15 19:15:47 +01:00
z64555 2bc1247002 Fix and expand upon debug safety catcher for ccfg.tbl flag reading.
* Expand upon some comments for clarity on assumptions and optimizations
* Define the CCF_NONE flag for posterity
2023-01-15 10:59:48 -06:00
mjn-mixael d8a052128e remove returns 2023-01-14 17:29:32 -06:00
mjn-mixael fa3631c9b9 make sure we have an argument 2023-01-14 17:24:43 -06:00
Fabian Woltermann 0fcf7e0fbe Remove the screen signature (#5108) 2023-01-14 16:45:10 +01:00
mjn-mixael ddde9079c9 some validity checks to order sending 2023-01-13 15:48:28 -06:00
Goober5000 d562104c0f Merge pull request #5105 from MjnMixael/fix_skipping_first_debris
don't skip first debris item
2023-01-12 22:42:25 -05:00
mjn-mixael a1dbf2e917 don't skip first debris item 2023-01-12 12:16:39 -06:00
Goober5000 eca7db0315 allow personas to be used by more than one species 2023-01-12 12:47:12 -05:00
Goober5000 be4d7acb6a change substitute_missing_messages to an actual flag, and add a no automatic assignment flag 2023-01-12 00:49:21 -05:00
Goober5000 02e5cc4353 remove PERSONA_FLAG_VASUDAN, since it is no longer assigned, and fix the -Vas suffix on the personas, which has apparently been broken since the species upgrade 2023-01-11 23:55:28 -05:00
JohnAFernandez d55a604ca5 Merge pull request #5098 from MjnMixael/fix_team_color_parse
fix team color parsing
2023-01-11 16:31:15 -05:00
mjn-mixael 481c0a490b address feedback 2023-01-11 08:14:29 -06:00
Fabian WoltermannandFabian Woltermann 264a44085d when checking sexp text strings, make sure to account for usages of <argument> (#5100)
Co-authored-by: Fabian Woltermann <[email protected]>
2023-01-10 21:33:39 +01:00
Goober5000 da3ed275d4 Merge pull request #5095 from MageKing17/bugfix/asteroid-targets-fred-crash
Avoid calling `asteroid_add_target()` in FRED.
2023-01-09 23:58:43 -05:00
Goober5000 44bebf17b8 Merge pull request #5097 from MjnMixael/add_missing_help
Add missing help for ship-untag sexp
2023-01-09 23:58:26 -05:00
mjn-mixael 0b234af925 fix team color parsing 2023-01-09 12:40:52 -06:00
mjn-mixael 5ca15685ef Add missing help for ship-untag sexp 2023-01-09 11:37:41 -06:00
mjn-mixael 2a5b930941 implement opf_turret_type for turret-protect-ship and turret-unprotect-ship 2023-01-09 11:13:37 -06:00
MageKing17 98713dadc1 Avoid calling asteroid_add_target() in FRED.
PR #5058 made `count_incident_asteroids()` use `Asteroid_obj_list` instead of `obj_used_list`; a perfectly sensible change in and of itself. However, PR #4827 had previously made `asteroid_obj_list_init()` only be called if FRED wasn't running (presumably because of the iteration through `Asteroid_objs` to clear flags, which is wasted effort in FRED). The problem is that without `list_init()` being called on `Asteroid_obj_list`, its `prev` and `next` were `nullptr` instead of linking back to itself, which means the beginning of the list and the end of the list were no longer considered the same (the iterator's `begin()` calls `GET_FIRST(head)`, which is effectively `head->next`, while `end()` calls `END_OF_LIST(head)`, which is effectively just `head`). This meant that iterating over `list_range(Asteroid_obj_list)` was returning `nullptr` as the first element of the list, and trying to dereference that would cause a crash. This was still not a problem in and of itself, as long as nothing tried to iterate over `Asteroid_obj_list` while FRED was running, which theoretically shouldn't be necessary...

PR #3704 changed mission parsing so that when parsing a ship with a name that matches one of the `Asteroid_field.target_names`, it would call `asteroid_add_target()` to initialize the relevant data for the asteroid field to fling asteroids at that ship. `asteroid_add_target()` calls `count_incident_asteroids()`, which (since PR #5058) iterates over `Asteroid_obj_list`, causing a crash due to dereferencing a null pointer on any mission that defines `$Asteroid Targets:` (and then actually has such a target be parsed).

While this could be solved by unconditionally initializing `Asteroid_obj_list`, there's really no need to do anything with `Asteroid_obj_list` in FRED, so instead the `asteroid_add_target()` call has been gated behind a `!Fred_running` check, and `Assertion()`s have been added to make sure `Asteroid_obj_list` has been initialized at the beginning of any function that does anything with it (besides initialize it), to catch similar problems in the future.

Fixes #5092.
2023-01-09 06:43:58 -08:00
Goober5000 b0f5a4cffb Merge pull request #5082 from MjnMixael/port_to_qtfred
This case was never ported to qtFRED
2023-01-08 13:32:09 -05:00
mjn-mixael 2881482182 fix rendering of jump nodes 2023-01-07 11:11:02 -06:00
mjn-mixael 661732a45b only load the model in the retail ui 2023-01-07 02:23:36 -06:00
mjn-mixael dd9faf9438 more missed stuff 2023-01-07 02:03:44 -06:00
mjn-mixael 856997326b some cleanup 2023-01-07 01:49:58 -06:00
mjn-mixael d52c2da8b5 take a break youve earned it 2023-01-07 01:48:39 -06:00
mjn-mixael c6a1639a82 scpui methods required for handling closeup briefing icon stuff 2023-01-07 01:48:39 -06:00
Goober5000 fc2cac617f Merge pull request #5087 from MjnMixael/fix_brief_api_highlight
fix api brief map not rendering icon highlight arrows
2023-01-06 21:09:27 -05:00
mjn-mixael 96bd06fbc1 fix api brief map not rendering icon highlight arrows 2023-01-06 09:49:16 -06:00
mjn-mixael d62e38d996 unify get_listing_opf_subsystem 2023-01-06 08:56:01 -06:00
Goober5000 a0181e715d prevent ship from managing ETS if it is playing dead
This was the bug found recently that was thought to be related to #2157.  It turns out that ships will manage ETS even if they are playing dead, which caused a ship to accelerate during a ship-maneuver as it directed more power to engines.  So this PR adds a "$ships playing dead don't manage ETS:" flag to control this behavior.  Tested and works.

This also capitalizes two flags that did not have an initial capital letter.
2023-01-06 03:04:11 -05:00
Goober5000 d8fe4a11be Merge pull request #5042 from MjnMixael/asteroid_sexp_missed_items
A few missed items and fixes to the asteroid debris sexp
2023-01-05 21:11:00 -05:00
MjnMixael 1a4abd9977 Typo 2023-01-05 12:29:42 -06:00
mjn-mixael aa6b1030f1 This case was never ported to qtFRED 2023-01-05 11:04:34 -06:00
mjn-mixael 3752a54a63 move 2023-01-05 10:48:47 -06:00
JohnAFernandez a49acc92f3 Merge pull request #5076 from MjnMixael/warn_dogfight_weapons
Warn dogfight weapons
2023-01-05 11:00:56 -05:00
MjnMixael 5ba4e50685 remove ignored missions from the lab list (#5081) 2023-01-05 10:06:28 +01:00
Goober5000 24e3243289 Merge pull request #5078 from MjnMixael/fix_fred_coords_input
Disallow overly large input in FRED Orientation Editor
2023-01-04 18:29:13 -05:00
mjn-mixael dbbd6b7705 Make sexp node comments more visible at a glance 2023-01-04 16:08:10 -06:00
mjn-mixael ae135b4922 mission profiles instead of gameplay profiles 2023-01-04 13:48:16 -06:00
mjn-mixael c1987aba62 < instead of <= 2023-01-04 13:44:57 -06:00
mjn-mixael 6f7bcbd0ff check INT_MIN also 2023-01-04 13:42:55 -06:00
mjn-mixael 9a8d5cde53 disallow overly large input 2023-01-04 09:08:58 -06:00
mjn-mixael efc5a370d5 better error message 2023-01-04 08:22:05 -06:00
mjn-mixael 4760bc7e2b Move this into the main loop 2023-01-04 08:14:24 -06:00
mjn-mixael 9c167b279d throw in -gmp.tbm as optional match to -aip.tbm 2023-01-03 21:25:59 -06:00
mjn-mixael 1884e4c4d1 allow gameplay_profiles.tbl to be an alias of ai_profiles.tbl 2023-01-03 21:21:37 -06:00
Goober5000 a7b46dba58 Merge pull request #5060 from MjnMixael/fix_mainhall_anims
SCPUI needs to be able run game_close_level
2023-01-03 21:23:38 -05:00
mjn-mixael cc079aedfa clearer warning message 2023-01-03 20:01:45 -06:00
mjn-mixael f3937a8f68 only run the check if the mission is a dogfight mission 2023-01-03 19:59:52 -06:00
mjn-mixael 1f7cdca5a9 optional 2023-01-03 19:56:56 -06:00
mjn-mixael d36a95962f warn if dogfight mission doesn't have dogfight weapons 2023-01-03 19:55:34 -06:00
Goober5000 d2eff1f141 Merge pull request #5073 from Goober5000/fixed_chain_repeat
restore retail behavior of chaining to repeating events
2023-01-03 19:03:33 -05:00
Goober5000 9ce7748c20 Merge pull request #5039 from Goober5000/object_iteration_fixes
more robust object iteration
2023-01-03 19:03:22 -05:00
mjn-mixael c74d523e18 third attempt at getting past that one guy 2023-01-03 14:52:55 -06:00
mjn-mixael 0bc26cab24 Revert "make sure game time is running in the mainhall"
This reverts commit 155e043bb0.
2023-01-03 08:37:06 -06:00
Goober5000 0d56bb9999 restore retail behavior of chaining to repeating events
To avoid changing behavior of existing mods, simulate the retail behavior unless the bugfix is explicitly activated.  The buggy retail behavior is to evaluate a chained event, not skip it, if the event is repeating, regardless of whether the repeat timestamp has elapsed.
2023-01-03 01:37:18 -05:00
Goober5000 f2fa235522 Merge pull request #5058 from Goober5000/missile_obj_list_iteration
add should-be-dead checks for missile and asteroid iterations
2023-01-02 14:19:03 -05:00
Goober5000 7829989478 Merge pull request #5070 from MjnMixael/fix_ingame_joystick
Make sure all 4 in-game joystick options get evaluated
2023-01-02 01:12:43 -05:00
mjn-mixael a8e411d310 Make sure all 4 ingame joystick options get evaluated 2023-01-01 23:30:50 -06:00
mjn-mixael 8cf7796809 Pass shortcut key character to Lua as a hook variable 2023-01-01 18:04:05 -06:00
Goober5000 07924f078a use Missile_obj_list or Asteroid_obj_list instead of obj_used_list where appropriate 2023-01-01 18:13:29 -05:00
Goober5000 782980844b add checks to Missile_obj_list and Asteroid_obj_list 2023-01-01 18:13:29 -05:00
Goober5000 c95865442e Merge pull request #5065 from notimaginative/fix_joystick_loops
swap loop order to fix joystick detection issue
2023-01-01 18:00:35 -05:00
Goober5000 f484ddef06 Merge pull request #5066 from notimaginative/fix_joyid_problem
use correct joystick id type (instance -> device)
2023-01-01 18:00:26 -05:00
JohnAFernandez 0c687f37c1 Merge pull request #5062 from Baezon/team-color-split-ships
Ensure 'split ships' are team colored
2022-12-31 23:24:56 -05:00
Goober5000 6de5c96127 add should-be-dead checks for object iterations (#5050)
Follow-up to #5040.  This extends the checks to most iterations over `obj_used_list` in FSO.  There are a few exceptions such as `waypoint_add` and `waypoint_remove`, plus a few others.  And none of the object iterations in FRED have the guard because FRED does not use the same object life cycle as FSO.
2022-12-31 23:23:39 -05:00
Taylor Richards 083984efec add support for .vpc extension on VP archives (#5067)
.vpc is identical to existing .vp except that it is allowed to
contain compressed files. This allows builds and tooling to know
that although the archive itself is retail compatible, it's content
may require special handling.

Simply rename your existing .vp to .vpc to indicate that it may
use compressed files. Existing tools can be updated to be able to
handle the compressed content within.

Although not recommended, the same archive can exist as both .vp
and .vpc for maximum compatibility. Both archives will be indexed
but the content of the .vpc will have priority.
2022-12-31 18:58:28 -05:00
Taylor Richards 9346f67d5c use correct joystick id type (instance -> device)
fixes #4793
2022-12-30 21:57:10 -05:00
Taylor Richards d2322cb2c2 swap loop order to fix joystick detection issue
fixes #4792
2022-12-30 21:48:34 -05:00
Asteroth 96f2a3b045 ensure split ships are team colored 2022-12-30 00:45:03 -05:00
Goober5000 e2e14bb6df Merge pull request #5059 from Baezon/team-color-change-pobjp
Check for parse object before team color change
2022-12-29 14:37:04 -05:00
mjn-mixael 155e043bb0 make sure game time is running in the mainhall 2022-12-29 11:01:43 -06:00
Asteroth ef721b3192 check for parse object 2022-12-29 03:27:38 -05:00
Goober5000 06ded501c8 Merge pull request #5056 from Goober5000/comment_tweak
comment tweak
2022-12-29 01:08:51 -05:00
Goober5000 9540caff5a Merge pull request #5057 from MageKing17/bugfix/use-universal-textifying
Use `textify_scancode_universal()` in more places.
2022-12-29 00:07:48 -05:00
MageKing17 3eacbc0e0b Use textify_scancode_universal() in more places.
Controls6 (PR #4133) changed `textify_scancode()` to be more l10n-aware, and added `textify_scancode_universal()` to continue serving the function of providing the values expected by scripts. Except there was one `textify_scancode()` call in the scripting system that wasn't changed, and it also wasn't used in FRED (for providing values for the `OPF_KEYPRESS` argument type, as used with `key-pressed`). This commit fixes both of these oversights, which *should* mean that all instances where a script or mission file needs to reference a keypress now use the same strings as before controls6.
2022-12-28 18:03:07 -08:00
Goober5000 a2d4576c4f comment tweak
Add a useful summary to the comment about event timestamps.
2022-12-28 17:34:15 -05:00
Fabian WoltermannandFabian Woltermann c727e40b8a apply the HDR colorspace stuff _after_ mixing in the team color glows (#5052)
Co-authored-by: Fabian Woltermann <[email protected]>
2022-12-28 18:48:20 +01:00
Goober5000 78b385e41b Merge pull request #5051 from Goober5000/wing_fix_and_error_checks
fix wing cues and add some more error checks
2022-12-27 15:30:34 -05:00
Goober5000 5485efe904 fix wing cues and add some more error checks
Fixes #5045 by correctly initializing wing arrival and departure cues.  Follow-up to #4856.  Also adds a bit more SEXP error checking.
2022-12-27 01:33:53 -05:00
Goober5000 85bb14898f Merge pull request #5040 from Goober5000/ship_obj_list_iteration
add should-be-dead checks for all ship iterations
2022-12-26 22:28:00 -05:00
MjnMixael a3bbf13da6 prevent access to goals outside the vector (#5044)
prevent access to goals outside the vector
2022-12-24 21:12:56 -05:00
JohnAFernandez 10d3bdda06 Merge pull request #5041 from MjnMixael/consolidate_tech_rendering
consolidation of tech rendering methods
2022-12-24 11:59:12 -05:00
Goober5000 dd93284777 Merge pull request #5043 from Baezon/no-pobjp-crash-fix
Fix a crash in `change_ship_type`
2022-12-23 13:14:06 -05:00
Goober5000 d6bb97d8f2 address feedback 2022-12-23 02:11:54 -05:00
Goober5000 46293ad0fe add should-be-dead checks for all ship iterations
When iterating through `Ship_obj_list`, check the `Should_be_dead` flag before using the object.  This fixes #4990 and adds defense-in-depth checks to guard against similar errors elsewhere.

I considered moving the `Ship_obj_list` removal from `obj_delete` to `ship_cleanup`, but decided it would be prudent to avoid fundamental changes to lifecycle management.
2022-12-23 00:51:31 -05:00
mjn-mixael 8aa4a86e1c set shadow override 2022-12-22 07:02:10 -06:00
Asteroth ca7618c993 check for if a ship has a parse object first 2022-12-22 04:02:43 -05:00
mjn-mixael fc21e12dfd A few missed items and fixes to the asteroid debris sexp 2022-12-21 21:11:14 -06:00
mjn-mixael a662f8168c consolidation of tech rendering methods 2022-12-21 20:45:40 -06:00
Goober5000 c2b93549a2 more robust object iteration
When iterating through various object collections, check for the should-be-dead flag to avoid returning objects that are on the verge of being deleted.

Separately, this adds the `isExpiring` function to check for should-be-dead objects.

This PR also makes object iteration consistent across all object types, both to reduce code duplication and to ensure that the length and iteration are done using the same algorithm.  Furthermore, if the number of should-be-dead objects is nonzero, the Lua array count for that frame will be different from the internal array count for that frame.

Fixes #5034.
2022-12-21 19:51:02 -05:00
Goober5000 32852c967e Merge pull request #5037 from Goober5000/hud_lock_iteration_fix
patch hud-lock iteration for objects that aren't ships
2022-12-21 12:44:46 -05:00
Goober5000 342373e2a1 Merge pull request #5038 from Goober5000/patch_hud_target_live_turret
patch some crash vulnerabilities in hud_target_live_turret
2022-12-21 12:43:59 -05:00
Goober5000 1070d1dbea patch hud-lock iteration for objects that aren't ships
Add a few more safety checks; don't assume every item is a ship.
2022-12-21 00:40:09 -05:00
Goober5000 6cf6b3266f patch some crash vulnerabilities in hud_target_live_turret
These checks risked causing a crash or memory access violation if they were ever encountered with an invalid target when `auto_advance` is true.
2022-12-20 20:40:43 -05:00
mjn-mixael 3b3a45d2d8 fix documentation 2022-12-20 16:07:52 -06:00
mjn-mixael 9f1c00c581 allow scripts to read LuaEnums and add LuaEnums 2022-12-20 15:53:40 -06:00
Asteroth f464b30089 update regen rates and autoaim fov on ship class change (#5029) 2022-12-21 00:17:23 +09:00
Asteroth 0fb6b2ae0d Update 22.4 version references to 23.0 (#5025)
* update references to 22.4 to 23.0

* fix a few more version references
2022-12-21 00:16:51 +09:00
Fabian Woltermann 18c182acc8 script hooks must be declared within global_hooks so that both FRED and FSO can see them (#5031) 2022-12-20 11:55:36 +01:00
Taylor Richards c9291e3f1c address issues related to cf.openFile() error handling (#5030)
- fix crash bug when path only contains dir separators
 - fix error handling when no path is specified in write mode
 - clarify function documentation

Fixes #5028
2022-12-20 01:27:51 -05:00
Goober5000 00f0cc4847 Merge pull request #5027 from Goober5000/comm_menu_open
add hu.isCommMenuOpen
2022-12-19 20:33:04 -05:00
Tyler Blount 2f8e10b8d8 Merge pull request #5024 from scp-fs2open/fix/CI-POST-result-status
Change check of POST response result
2022-12-18 20:35:01 -07:00
Tyler Blount 0acb22456c Respecify the env for Post Builds auto-trigger 2022-12-18 14:15:04 -07:00
Tyler Blount 22c8ae024e Change check of POST response result
This modified the check as `text` has been changed in the Requests API. In order to make the code compatible with the JSON result, we check `resp.status_code` instead.
2022-12-18 13:53:32 -07:00
Tyler Blount 5857b569a1 Merge pull request #5023 from scp-fs2open/fix/build-post-23.0-RC1
Fix failure to post Mac builds to forums
2022-12-18 11:31:26 -07:00
Tyler Blount 9136c04a34 Fix failure to post Mac builds to forums
Also includes replacement of string literals with constants to reduce maintenance overhead in the event the name of a group changes.
2022-12-18 10:22:31 -07:00
Fabian WoltermannandFabian Woltermann 87926995df Feature/dear imgui (#4987)
* Add imgui

* migrate render options

* remove wmcgui

* Add subsystem selection and highlighting

* Add a syntactic sugar extension for imgui

* don't rebuild the mission list every frame

* Add imgui_sugar extension

* Move helper functions out of lab_ui, add function to display consolidated table text for object

* add button to export cubemap

* fix entering and exiting the lab

* refactor some of this for greater cleanness

* use techroom lighting when no mission background is set

* minor things

* add imguizmo

* add imguizmo

* Add imgui

* migrate render options

* remove wmcgui

* Add subsystem selection and highlighting

* Add a syntactic sugar extension for imgui

* don't rebuild the mission list every frame

* Move helper functions out of lab_ui, add function to display consolidated table text for object

* add button to export cubemap

* fix entering and exiting the lab

* refactor some of this for greater cleanness

* minor things

* add imguizmo

* add imguizmo

* Add button to reset changes made in the render dialog

* refactoring

* unfuck rebase

* fix issue with loose mission files

* use with_CollapsingHeader for greater uniformity

* add weapon selection functionality

* make primaries and secondaries fire again

* implement animation triggers

* avoid crash when switching back and forth between ships with and without team colors

* add control to set team color setting to renderer texture dialog

* make sure the table text updates when the ship class changes

* let rotating subsystems rotate

* do not add imgui.h to pstypes

* code cleanup

* add subsys highlighter from fred

* Highlight non-modelled subsystems as well

* add cmdline flag to show the imgui demo dialogue

* fix compiler warnings reported by CI

* fix error when building the subsystem list

* refactor variable/method naming

* code cleanup

* remove vestigial code

* update to imgui 1.89.1

* add credits entry for imgui

* use the imgui namespace

* Separate the background dialog out into its own window

* make sure the subsystem highlights are placed correctly

Co-authored-by: Fabian Woltermann <[email protected]>
2022-12-18 16:29:20 +01:00
Goober5000 87a051a933 Merge branch 'master' into more_category_updates 2022-12-18 01:31:47 -05:00
BMagnu 66becc983e Fix OnBeamCollision oversight (#5021) 2022-12-18 01:04:59 +00:00
Goober5000 47564d1505 Merge pull request #5008 from MjnMixael/asteroid_sexp_error_checks
Add missing asteroid debris argument type error checking
2022-12-16 23:04:13 -05:00
Goober5000 7022ba191a ci stuff 2022-12-16 23:03:27 -05:00
Goober5000 4572aa1bc1 Merge pull request #5004 from JohnAFernandez/fix-use-of-incorrect-variables
Use the correct variables in this function
2022-12-16 22:58:59 -05:00
Goober5000 d36db98974 Merge pull request #5014 from MjnMixael/fix_render_tech_model
Do not include -destroyed subobjects in renderTechModel
2022-12-16 22:58:48 -05:00
Goober5000 a822d2ad60 Merge pull request #5016 from Goober5000/navpoint_fixes
initialize NavPoint properly
2022-12-16 22:58:41 -05:00
Goober5000 e3fc5f8bc1 add hu.isCommMenuOpen
A script function to tell if the comms menu is open
2022-12-16 22:20:52 -05:00
Goober5000 8d672bddb3 change SEXP_SRC_* to enum class 2022-12-16 22:10:22 -05:00
Goober5000 dc281a56f8 change SEXP_MODE_* to enum class 2022-12-16 19:45:05 -05:00
Goober5000 7b0a8eff9e change REF_TYPE_* to enum class 2022-12-16 19:41:45 -05:00
Fabian Woltermann 386e068890 Merge pull request #5015 from The-E/fix/old_ai_weapon_link_copypasta
fix vintage copypasta bug
2022-12-16 21:09:50 +01:00
Goober5000 5a674a7db1 initialize NavPoint properly
Initialize NavPoint values any time a NavPoint object is created, not just when the `clear()` function is run.
2022-12-16 12:59:53 -05:00
Fabian Woltermann 5984be99b6 fix vintage copypasta bug 2022-12-16 18:35:52 +01:00
mjn-mixael 84962ff33c Remove model instances after rendering 2022-12-16 09:39:11 -06:00
mjn-mixael 3136e0debf Use a model instance to prevent rendering destroyed subobjects 2022-12-16 09:31:19 -06:00
Goober5000 7318221e6a Merge pull request #5002 from Goober5000/beam_team
beam teams
2022-12-15 17:46:26 -05:00
Goober5000 c3477e88a7 beam teams
Add a Team virtvar to beam objects in Lua.
2022-12-15 15:44:54 -05:00
MjnMixael f1f27b21b7 Use define 2022-12-15 10:52:58 -06:00
Goober5000 52455bbc62 Merge pull request #5009 from MjnMixael/dynamic_sexp_enum
Dynamic sexp enum
2022-12-15 11:31:49 -05:00
mjn-mixael 25a4f66451 missed items 2022-12-15 01:01:10 -06:00
mjn-mixael e0eb7ef3d6 this should have a more unique name 2022-12-14 22:49:41 -06:00
mjn-mixael 2909e8fa2b address feedback 2022-12-14 22:32:51 -06:00
mjn-mixael a47658b336 address feedback 2022-12-14 15:41:36 -06:00
mjn-mixael 42a88a9e3f Comment 2022-12-14 13:54:17 -06:00
mjn-mixael 174976d2bb Better global name 2022-12-14 13:52:50 -06:00
mjn-mixael 911639d1b0 Add missing asteroid debris argument type error checking 2022-12-14 13:46:40 -06:00
mjn-mixael 5366f235ca Allow custom Lua Enums 2022-12-14 13:45:14 -06:00
Fabian Woltermann 76b301b4f1 Merge pull request #5007 from The-E/fix/5006_ssm_struct_not_initialized
Fix an issue with ssms sending uninitialized messages
2022-12-14 17:04:46 +01:00
mjn-mixael 49b486a326 use enum for list types 2022-12-14 09:12:11 -06:00
Fabian Woltermann c39861a600 When parsing an ssm, make sure to only use a custom message when one is actually defined 2022-12-14 15:18:05 +01:00
John Fernandez bb42302ba3 Use the correct variables in this function 2022-12-13 21:47:10 -05:00
Goober5000 d722f50f8b more category updates
1. Allow categories, not just subcategories, to be added by scripted SEXPs.
2. Allow subcategories in different categories to have the same name.
2022-12-13 21:16:26 -05:00
Goober5000 29217cc2aa Merge pull request #5000 from Baezon/playdead-player-turrets
Allow player turrets to fire despite play dead
2022-12-13 19:15:53 -05:00
BMagnu 385478824e Fix refactor bug (#5001) 2022-12-13 20:56:48 +00:00
Asteroth b0c6d81d89 ship_move_subsystems too 2022-12-13 15:38:21 -05:00
Asteroth 5d66f3108f allow player turrets to fire despite play dead 2022-12-13 15:02:08 -05:00
Goober5000 922be2ff36 Merge pull request #4999 from BMagnu/problematic_counter_lib
Remove problematic counter library
2022-12-13 13:52:52 -05:00
BMagnu af1f0eaeca Rework Script Conditions (#4960)
* add skeleton for hook condition API

* Begin Scripting Hook refactor

* Program Hook Conditions for current new-style hooks

* Replace more hooks

* Fully transition global hooks

* Convert legacy hooks pt. 1

* Convert legacy hooks pt. 2

* Convert legacy hooks pt. 3

* Post-conversion cleanup

* restore parsing

* Add Documentation and fix parsing

* Fixup engine ingame hook adding

* Fixup engine ingame hook adding again

* Fix warnings

* Fix GCC unqualified template base lookup

* unqualified lookup v2

* Virtual Destrcutors

* Fix Clang

* Fix ship objp hook condition shadow

* Remove global hook include in ship.h

* Incorporate Feedback

* Incorporate Feedback 2

* Add revision to inline version specififer
2022-12-14 03:51:27 +09:00
Birk Magnussen 6b3f99eafd comment for OP_NOT_AN_OP 2022-12-13 18:43:01 +01:00
Birk Magnussen cb008706a4 Tidy up comment 2022-12-13 18:37:08 +01:00
Birk Magnussen 9366963e42 Fix formatting 2022-12-13 18:32:27 +01:00
Birk Magnussen 7ed7b37f9a Replace enum in switch for readability purposes 2022-12-13 18:25:26 +01:00
Birk Magnussen a62a9cd5e0 Remove enum type name for safery 2022-12-13 18:21:32 +01:00
BMagnu 80b75352bf Respect First OP 2022-12-13 16:10:45 +01:00
BMagnu c58216f9c3 Remove Counter library 2022-12-13 16:04:55 +01:00
Goober5000 f40a018785 Merge pull request #4996 from MageKing17/bugfix/let-vc-2017-compile-again
Add missing locale argument to `std::isdigit()` calls.
2022-12-12 15:21:00 -05:00
JohnAFernandez cf9bfb8939 Merge pull request #4997 from Goober5000/subcategory_fixes
subcategory fixes and followup
2022-12-12 12:32:55 -05:00
Goober5000 74db049f85 subcategory fixes and followup
Several items here:
1. Patches several category and subcategory validation checks (comparisons to -1 rather than _NONE) that were missed in #4965.
2. Adds sanity checks to both built-in operators and scripted sexps to ensure categories and subcategories are consistent.
3. Deconflicts several built-in sexps that had inconsistent categories.

The inconsistent operators were:
* script-eval-string
* set-wing-formation
* get-ets-value
* turret-get-primary-ammo
* turret-get-secondary-ammo
* get-fov

Follow-up to #4965 and #4995.
2022-12-12 00:08:21 -05:00
MageKing17 7fde659b42 Add missing locale argument to std::isdigit() calls.
Much like a previous instance (fixed in #3281, although the function in question was later removed), `std::isdigit()` without a locale argument prevents MSVC 2017 from compiling FSO.
2022-12-11 20:11:42 -08:00
EatThePath 780ab89b61 Merge pull request #4995 from Goober5000/fix_4994
fix subcategory comparison
2022-12-11 22:04:52 -06:00
Goober5000 afbdd39bde fix subcategory comparison
Empty subcategories are now OP_SUBCATEGORY_NONE, not -1.  Fixes #4994.

Also fixes a cast warning in missionparse.cpp.
2022-12-11 22:27:47 -05:00
JohnAFernandez 6e159345d8 Merge pull request #4993 from MjnMixael/fix_passive_arc_iterator
fix passive arc iteration
2022-12-11 19:41:34 -05:00
MjnMixael a421d38455 Asteroid/Debris cleanup + Modular asteroids table (#4870)
* set-asteroid-field sexp

* errors

* scope

* set-debris-field sexp

* Clarify sexp documentation

* num_debris_sizes

* allow any order and activate display name feature

* unify naming scheme

* modular -ast.tbm

* styling

* decouple sexp parsing and asteroid field creation methods

* remove this

* fix merge oversights

* Remove this check

* reorder

* use scp_string instead

* spacing

* Only setup display name if it's empty

* Use define instead of magic numbers

* Ensure asteroid types get the correct spawn weight

* Warn if spawn weight is set for asteroid type

* typo

* Correctly handle asteroid split types

* iiiiiiiiiiiiiiiiiint

* address feedback
2022-12-11 19:29:23 -05:00
mjn-mixael c69bc1e395 fix passive arc iteration 2022-12-11 18:04:42 -06:00
Goober5000 e89a661210 Merge pull request #4992 from Goober5000/fix_4991
fix crash in ship_close_cockpit_displays
2022-12-10 22:20:32 -05:00
Goober5000 1e834010e0 fix crash in ship_close_cockpit_displays
This function can be called when `shipp` is null, so check for that.

Fixes #4991.
2022-12-10 21:37:28 -05:00
Goober5000 4b172c0ca9 Merge pull request #4965 from Goober5000/sexp_category_bump
SEXP operators, categories, and subcategories refactoring
2022-12-10 15:18:53 -05:00
Asteroth eb3b7544b5 ensure animations load first if available (#4986) 2022-12-10 08:45:21 -05:00
Goober5000 207540303f multi version bump for new SEXP operator IDs 2022-12-09 14:44:30 -05:00
Goober5000 89ed5be8c7 Merge pull request #4875 from Goober5000/dynamic_events
dynamic events and goals
2022-12-09 13:53:54 -05:00
Goober5000 57395a772a address feedback 2022-12-09 13:47:23 -05:00
Goober5000 e179caa339 add defaults to switch blocks 2022-12-09 13:47:23 -05:00
Goober5000 621593c39f convert categories, subcategories, and operator IDs 2022-12-09 13:47:23 -05:00
Goober5000 da66b8c08c use enum for sexp error check 2022-12-09 13:47:23 -05:00
Goober5000 ffed86e8a0 typesafe oswpt_type 2022-12-09 13:47:23 -05:00
Goober5000 719148beaa typesafe sexp_oper_type 2022-12-09 13:47:23 -05:00
Goober5000 1a487473d7 MAX_OPERATORS is no longer used 2022-12-09 13:47:23 -05:00
Goober5000 eddca6bdf0 Merge pull request #4961 from Goober5000/support_ship_cleanup
clean up support ship mode in all cases
2022-12-09 13:14:45 -05:00
Goober5000 226e956fcc dynamic events and goals
Make events and goals dynamic in missions and campaigns.  When parsing, initialize all fields to their defaults.
2022-12-09 13:10:39 -05:00
Goober5000 a88ccb69e7 Merge pull request #4963 from Goober5000/messageq_enhancement
make message queue dynamic
2022-12-09 11:03:54 -05:00
Goober5000 10bdf5c03b Address feedback 2022-12-08 21:53:10 -05:00
Goober5000 12cbf9ab61 make message queue dynamic
Use a vector for storing the message queue so it can be whatever size the mission needs.

As part of this, add `free` and `vm_free` deleters to be usable with `unique_ptr` and enhance `insertion_sort` to be usable with vectors.

Fixes #4959.
2022-12-08 21:53:10 -05:00
Goober5000 6496b97d21 Merge pull request #4985 from Goober5000/disable_qt_again
try disabling Qt builds
2022-12-08 21:50:33 -05:00
Goober5000 721680cb60 try disabling Qt builds
Per the example in #3160, disable Qt builds for the time being.
2022-12-08 19:54:46 -05:00
Goober5000 c4cf9edd41 Merge pull request #4983 from Goober5000/wing_formation_script_2
exposes wing formation via scripting
2022-12-08 13:32:15 -05:00
Goober5000 7f22137bc3 exposes wing formation via scripting
A rework of #4980, adding a wing formation type and a way to access them via `tb.WingFormations`.
2022-12-08 12:02:33 -05:00
Goober5000 fd77eba855 Merge pull request #4975 from Goober5000/sendMessage_enhancement
enhance sendMessage to allow messages sent from ships
2022-12-07 20:46:06 -05:00
MjnMixael e72e90b9cc Only set the colors for passive lightning (#4982) 2022-12-07 22:39:46 +00:00
MjnMixael 6d070c88b7 clean traitor.tbl parsing (#4949) 2022-12-07 17:29:05 -05:00
BMagnu 57f529e902 Fix edge case bugs with moveables in combination with special polymodels being animated (#4981) 2022-12-07 20:43:36 +00:00
MjnMixael a51b2750aa pre parse icons to get an accurate count (#4925)
* pre parse icons to get an accurate count

* static

* Some code clarity
2022-12-07 11:00:03 -05:00
MjnMixael fce04d5907 do correct math at parse (#4979) 2022-12-07 15:40:19 +00:00
wookieejedi 07a21a607a Mod Table Settings for Arc Widths (#4967)
* Mod Table Settings for Arc Widths

There is currently a way to set the color of EMP and Damage Arcs in game_settings.tbl, but no way to change the width.

This PR adds options useful to modders to set the width and how it is calculated. Looking over the code and asking around, I developed these exposed options.

The options also allow modders to control the arc widths in multiple ways. For example, if you want to set a constant width for all ships you would set the `+Do Not Use Width Multiplier Over Radius:` to something huge, and if you wanted no arcs ever you would set the `+Width Default:` to 0.

They are tested and work as expected.

* clang

* fix copy paste error from #2053

* tab cleanup

* whitespace cleanup 2

* same for type ship and damage
2022-12-07 07:24:05 -05:00
wookieejedi 3f21ba4d17 Expose decal options useful for modders (#4957)
* Fixes CTD with decals on dying ships

If a ship was getting shot with weapons that used decals, the decal code would hit an assertation, because the invalid decals were not being all removed.

This PR updates the decal cleanup loop, to ensure that no decals are missed and all invalid ones are removed. Tests confirm this fixes the issue.

Also cleaned up some comments and moved another assertation before setting of variables.

* Exposes modder useful options to decals

Now that decals are very stable, this PR exposes two options that are very useful for using decals, a random range for the radius along with the option to have a random rotation when the decal is created.

Tested and everything works as expected.

* add script ability to toggle decals

* properly use set arg not func

* fix two minor things in decal shader

* one more cleanup line

* fixes
2022-12-07 07:23:57 -05:00
Goober5000 0c49b09fd7 Merge pull request #4977 from Goober5000/set_formation
add changeable formation flying
2022-12-07 00:38:10 -05:00
Goober5000 e824caeea3 add changeable formation flying
Add a SEXP to change the formation and formation scale on-the-fly.
2022-12-06 23:16:54 -05:00
Goober5000 0211f44df9 Merge pull request #4973 from MjnMixael/fix_custom_data
Fix custom data when using tbms
2022-12-06 22:53:15 -05:00
Goober5000 823566244f Merge pull request #4953 from Baezon/fullneb-background-bgs
Add mission flag to show bg bitmaps despite fullneb
2022-12-06 22:52:51 -05:00
Goober5000 0e80428d48 Merge pull request #4946 from MjnMixael/per_weapon_autoaim
per weapon auto aim feature
2022-12-06 22:52:14 -05:00
Goober5000 ab3eb196b9 Merge pull request #4976 from Goober5000/fix_player_cheat_check
move player-is-cheating to the correct category
2022-12-06 22:06:08 -05:00
MjnMixael bc3da4fed7 custom colors for passive lightning (#4969)
* custom colors for passive lightning

* initialize member variables and apparently this can't be nullptr

* Small bugfix
2022-12-06 19:57:16 -05:00
Goober5000 ed06a424e2 move player-is-cheating to the correct category 2022-12-06 19:25:19 -05:00
Goober5000 bb3b3b7b13 Merge pull request #4974 from MjnMixael/remove_at_symbol
move @ removal up
2022-12-06 18:54:29 -05:00
Goober5000 affb402ee7 Merge pull request #4972 from Goober5000/mission_do_departure_cleanup
clean up mission_do_departure
2022-12-06 18:52:58 -05:00
Goober5000 7ac37d45c3 enhance sendMessage to allow messages sent from ships
Allow `mn.sendMessage` to send from a ship source, not only a string source, by allowing the ship object to be specified as the first argument.  Also add `ship:sendMessage` which is a more streamlined version of the same thing.
2022-12-06 16:40:00 -05:00
mjn-mixael b3b349a2f0 three lines for this short comment is silly 2022-12-06 12:50:35 -06:00
mjn-mixael 2988aa8fc8 move @ removal up 2022-12-06 12:43:33 -06:00
mjn-mixael 4d84e4c2a0 Make sure custom_data is properly cleared or carried over when shipclass info is reset or cloned/moved 2022-12-06 09:48:33 -06:00
Goober5000 d9dfceb279 clean up mission_do_departure
Since `mission_do_departure` can be called for multiple frames in a row, make sure that certain things run only once.
2022-12-05 22:00:51 -05:00
Goober5000 9dfb36962c Merge pull request #4971 from Goober5000/fix_cockpit_ctd
fix a crash when the Knossos explodes in A Flaming Sword
2022-12-05 21:45:26 -05:00
Goober5000 c634e64f27 fix a crash when the Knossos explodes in A Flaming Sword
The ship being accessed here is the viewer object, not the loop iterator.

Follow-up to #4936.
2022-12-05 19:56:48 -05:00
mjn-mixael 662d5f743a address feedback 2022-12-05 09:59:06 -06:00
BMagnu fb223c1dbe Properly init cockpit_model_instance to -1 (#4966) 2022-12-05 15:32:09 +00:00
BMagnu 5bb869953e Animate More Things (#4936)
* Add Cockpit AnimSet

* Add Skybox Animset

* Add cockpit model instanc

* Render ship cockpit with instance

* Finish scripting API

* Add moveables

* Fix Typo

* Fix moveable table value get

* Fix copy paste error

* Add Cockpit AnimSet

* Add Skybox Animset

* Add cockpit model instanc

* Render ship cockpit with instance

* Finish scripting API

* Add moveables

* Fix Typo

* Fix moveable table value get

* Fix copy paste error

* Add Animation Scripting Handle

* Add proper saving of skybox anim triggers

* Properly step non-obj animations

* Incorporate feedback

* Incorporate feedback

* Fix comparison
2022-12-05 10:00:29 +09:00
Goober5000 97614517a2 Merge pull request #4962 from Goober5000/set_weapon_protecc
add some additional weapon checks
2022-12-04 15:17:49 -05:00
Goober5000 0a29a74bc8 Merge pull request #4964 from Goober5000/squadron_wing_name_fix
fix wing name matching
2022-12-04 15:07:11 -05:00
MjnMixael 7c695eebd0 Allow setting glowpoint light intensity (#4955) 2022-12-05 04:56:06 +09:00
Goober5000 8f6e6e97f5 fix wing name matching
The logic designed to match Epsilon and Epsilon#clone would be tripped up by Pi and Pisces.  Tweak the string matching to handle this.

Fixes a bug reported on the forums: https://www.hard-light.net/forums/index.php?topic=98576.0
2022-12-04 14:06:56 -05:00
Goober5000 9c9ca3bcd6 remove unneeded function prototypes 2022-12-04 00:25:14 -05:00
MjnMixael bdea3d53c0 set-asteroid-field and set-debris-field sexps (#4860)
* set-asteroid-field sexp

* errors

* scope

* set-debris-field sexp

* Clarify sexp documentation

* num_debris_sizes

* styling

* decouple sexp parsing and asteroid field creation methods
2022-12-03 22:10:50 -05:00
Goober5000 360dcd4e1e add some additional weapon checks
Enhance set-primary-weapon and set-secondary-weapon to check the validity of the weapon bank and weapon type.
2022-12-03 20:34:15 -05:00
Goober5000 5a9136a5c2 clean up support ship mode in all cases
Whether a ship is a support ship or its target, and whether it is destroyed or vanished, its repair/rearm mode should be cleaned up in a consistent way.  This fixes a bug in Series Resurrecta where calling `ship-vanish` on a support ship put things into a broken state.
2022-12-03 20:06:32 -05:00
Goober5000 9fbcd71442 Merge pull request #4948 from Goober5000/isMouseButtonDownCount
add mouseButtonDownCount and flushMouse
2022-12-02 11:03:57 -05:00
Goober5000 7e337944f0 Merge pull request #4943 from EatThePath/better-dynsexp-error
Improved error message for missing sexp action
2022-12-01 21:25:24 -05:00
wookieejedi 31e55f4d12 Fixes CTD with decals on dying ships (#4956)
If a ship was getting shot with weapons that used decals, the decal code would hit an assertation, because the invalid decals were not being all removed.

This PR updates the decal cleanup loop, to ensure that no decals are missed and all invalid ones are removed. Tests confirm this fixes the issue.

Also cleaned up some comments and moved another assertation before setting of variables.
2022-12-01 14:18:46 -05:00
Goober5000 398cf2f8c3 add flushMouse 2022-11-30 23:36:14 -05:00
Goober5000 028ee9ec23 deprecate isMouseButtonDown and add mouseButtonDownCount
Implements #4429.
2022-11-30 22:04:48 -05:00
Goober5000 5b1f668e6f Merge pull request #4954 from Goober5000/patch_event_timestamps
fix event status evaluation for repeating events
2022-11-30 19:41:19 -05:00
Goober5000 08626aeecf fred2 support 2022-11-30 00:46:40 -05:00
Goober5000 42fba1c7f2 fix event status evaluation for repeating events
Two situations in the event timestamp life cycle, chain delays and event status delays, require accommodation for the timestamp-plus-interval case described in `mission_process_event()`.  Commit 06fc8c73 applied the fix for chain delays; this applies the same fix to event status delays.

Follow-up to #4633.  Fixes #4951.
2022-11-29 23:42:55 -05:00
Asteroth 3ed90e2b89 Add Fullneb_background_bitmaps mission flag 2022-11-29 23:00:39 -05:00
mjn-mixael 9e2aa0377f per weapon auto aim feature 2022-11-28 14:19:00 -06:00
Kiloku 4106176aab Cheat framework allowing for custom cheats, sexp for cheat used and On Cheat lua hook (#4387)
* Add SpawnShipCheat and convert Bravos spawning to it

* Clean-up and add canUseCheat() check

* Move some stuff to parent CustomCheat class

* Add cheat-used SEXP and On Cheat scripting hook

* Add cheat tbls and tbms, fix custom cheat detection, move cheat hooks to global hooks

* Add a default virtual destructor to CustomCheats for its derived classes to use

* Initialize buffers with memset so clang will calm down, also move cheat check a bit to keep old cheats

* Attempt to appease MSVC

* Clean-up and formatting

* Ensure custom cheats fit in the cheat code buffer

* Fix a merge mistake

* Move pre-set cheat to embedded cheats table

* Use appropriate types for stuff_string

* Remove unnecessary copying of the cheat buffer

* Explicit nullchecking

* Avoid copying values for initializing CustomCheat

* move cheat checking function to cheats_table.h, fix a typo

* Clarify OP_USED_CHEAT sexp description

* Remove unnecessary casting

* Use list initalization for Ship Cheats

* Move a few method definitions from the .h to .cpp

* Change buffer to const char*
2022-11-29 01:30:54 +09:00
Goober5000 ea93f29654 Merge pull request #4916 from Goober5000/fix_3849
guard against unknown variables
2022-11-27 22:50:34 -05:00
Goober5000 dbd1c027e8 Merge pull request #4944 from Goober5000/fix_fotg_ctd
fix crash on mission load
2022-11-27 17:10:49 -05:00
Goober5000 77fc5150c7 fix crash on mission load
Some subsystems will not have submodel instances, so make sure their velocities are not reset.  Fixes a crash in FotG.
2022-11-27 15:23:04 -05:00
Goober5000 027f109f9f Merge pull request #4929 from Goober5000/supplemental_autoscaling_fix
fix the rest of the autoscaled attributes
2022-11-27 14:37:22 -05:00
Goober5000 1b744a6ae1 Merge pull request #4932 from Goober5000/fix_event_dragging
make sexp_tree dragging more user-friendly
2022-11-27 14:37:07 -05:00
David Gibson 125e1e26bf Improved error message for missing sexp action 2022-11-27 13:28:50 -06:00
Taylor Richards 20dcdb2904 use case-insensitive comparison of cfile pathtypes (#4942)
fixes #4941
2022-11-27 13:37:32 -05:00
Taylor Richards 0be895d8bd add proper support of subfolders to lua listFiles (#4940)
Also updates function description to be more accurate and
document filter format for subfolder searches.

fixes #4939
2022-11-27 11:53:10 -05:00
BMagnu f76048b269 Enhance OnDialogX Hooks to encompass Death Popups (#4938)
* Add Scripting hooks to death popups

* Fix type

* cleanup
2022-11-27 19:01:50 +09:00
Goober5000 18150673c3 Merge pull request #4934 from Goober5000/ai_play_dead_fix
don't process turrets or subsystems when playing dead
2022-11-26 12:41:53 -05:00
BMagnu 5034855d4d Check if Texture is valid first (#4937) 2022-11-27 02:28:46 +09:00
Goober5000 1d5c802a9c handle speeds when removing play-dead 2022-11-25 12:20:45 -05:00
Goober5000 35380e8e24 don't process turrets or subsystems when playing dead
In the submodel reorganization in commit 575c050da4, subobject movement was moved out of the AI pipeline, which inadvertently removed the play-dead check that prevents subsystem movement.  This broke a few missions such as Scroll's 'Thor's Hammer'.  This PR restores the check.

Fixes #4933.
2022-11-25 11:35:13 -05:00
MjnMixael 649b513481 Modular bolts (#4880)
* better types and initialize objects with reasonable values

* modular -ltng.tbm

* fixes

* remove warning on no glow being defined

* do not error in FRED since the above code won't load the texture in FRED
2022-11-25 03:35:57 -05:00
Goober5000 cb7c760255 make sexp_tree dragging more user-friendly
FREDders expect events (and goals and campaign links) to land where you drag them.  So when dragging items earlier in the list, insert them before the item they are dropped on.
2022-11-24 20:55:18 -05:00
Goober5000 412cd8a993 Merge pull request #4931 from Goober5000/fix_warnings
fix two warnings
2022-11-24 16:43:33 -05:00
wookieejedi 1c45a18d9b Add Option to allow weapons that hit player to place per-weapon sound (#4921)
* Add Option to allow weapons that hit player to place per-weapon sound

Weapons that lasers or missiles that hit the player also play a hard coded sound, which is not ideal when trying to give valuable audio feedback to player.

This PR allows modders to stop the behavior and have the weapon class impact sound specified in the weapons table play instead of the hard coded sounds.

Tested and works as expected.

* add per class shockwave and weapon sounds

* naming update
2022-11-24 17:03:05 +00:00
MjnMixael 0af43628ad add set-order-allowed-for-target sexp (#4884) 2022-11-23 22:28:52 -05:00
Goober5000 8d8cdd9206 fix two warnings
`warning C4305: 'argument': truncation from 'double' to 'float'`
2022-11-23 22:25:51 -05:00
Goober5000 23a48ed9a8 Merge pull request #4927 from Goober5000/no_fred_weapons
add no_fred flag for weapons, and patch no_fred for ships
2022-11-23 21:43:28 -05:00
Goober5000 261e37d047 Merge pull request #4928 from Goober5000/options_tweaks
style tweaks for recently added options
2022-11-23 21:43:06 -05:00
BMagnu 67d0fb3dce Add 'Dont stop running sounds' (#4924) 2022-11-23 16:43:52 +09:00
Goober5000 c40764b65c add no_fred flag for weapons, and patch no_fred for ships
The new `no_fred` flag prevents weapons from being listed in the dropdown lists in the weapon dialog.  Also this fixes `no_fred` ships to not appear either: previously they were hidden in the main window dropdown but still appeared in the ship editor.

In order to vastly simplify the dropdown list code, the weapon dialog was refactored to use arrays of variables rather than one hardcoded variable per bank.

Implements #3643.
2022-11-22 21:30:25 -05:00
Goober5000 77be140a45 fix the rest of the autoscaled attributes
PR #4516 did not cover all of the autoscaled AI class attributes, since a few of them were labeled differently.  This adds checks to grab the correct autoscale index for the remaining cases:

```
$Afterburner Use Factor:
$Shockwave Evade Chances Per Second:
$Get Away Chance:
$Secondary Range Multiplier:
```

Fortunately, Sushi's investigation was pretty thorough.  Between these remaining cases and @EatThePath's autoscaling review, this PR should cover the complete set of autoscaling situations.

Fixes #4922.
2022-11-22 21:18:34 -05:00
Goober5000 89fb43b83d style tweaks for recently added options
1. Since Discord is both a common noun and a proper noun, capitalize it here to clarify what it refers to.
2. Capitalize the first letter of the Hotkey internal variable to follow the global variable convention.  And might as well clarify, while we're at it, that it hides hidden ships, not all ships.
2022-11-22 19:53:13 -05:00
Asteroth 13a08371cf fix an oversight from gravity changes (#4926) 2022-11-22 16:05:39 -05:00
Asteroth 732f1bdcbe Fix strange warp glow sizing (#4244)
* fix warp glow sizing

* whoops
2022-11-22 11:07:24 -05:00
EatThePath 8e560a0ba4 More old dead shader override code that isn't hooked to anything anymore. (#4861) 2022-11-22 11:06:51 -05:00
EatThePath 406c28d871 Add yaml file defining build options for vscode cmake tools users. (#4858) 2022-11-22 11:06:34 -05:00
Taylor Richards c9374ec6fb add text-to-speech support for macOS (#4914)
* add text-to-speech support for macOS

* only add Obj-C langs on mac

* move obj-c file to apple-specific block
2022-11-22 11:05:13 -05:00
Taylor Richards 072e1123d9 avoid playing voice messages with aux effects (EFX) (#4923) 2022-11-22 11:04:13 -05:00
Goober5000 e402af803b fix full ship list selection in FRED (#4919) 2022-11-21 20:15:44 -05:00
Asteroth 219bcca23a Implement gravity (#4803)
Adds gravity! Applies on a per-mission basis, and weapons, ships, debris, and asteroids now have a configurable "gravity const" which multiplies the effect of gravity on them, by default everything except debris is 0 (meaning no effect even when the mission has gravity). AI and the lead indicator will also lead for ballistic trajectories as well, given a gravity-affected weapon. No FRED support or gravity direction control yet, to come in later PRs.
2022-11-21 20:13:35 -05:00
Strygon 91eb48c5b8 Setting up Vampirism again... again (#4911)
* Setting up Vampirism again
2022-11-20 17:07:27 -05:00
MjnMixael d0fea8e14c option to always hide hidden hotkey ships (#4877) 2022-11-20 17:04:22 -05:00
John Fernandez d29ead20f6 optional feedback 2022-11-20 17:03:20 -05:00
John Fernandez 760a91376c Fix a warning
We shouldn't be checking that the `cci_h` is valid by seeing if it is greater than -1 because by that point it never will be.  Instead, we should be checking that the incoming id is valid and setting to the invalid state if it is not.
2022-11-20 17:03:20 -05:00
Goober5000 cf7919aef6 fix crash when changing ship classes in FRED (#4917)
PR #4908 had a small bug that caused a crash in FRED.  The code in question is only needed and only relevant when changing ship classes in-mission.
2022-11-20 21:56:43 +00:00
JohnAFernandez 2b6058d6f4 Adjust ssssssssssi in one more place (#4913)
* Fix crashes with sssi

We need to init in both places to avoid purging goals before ssi is set.

* Make sure we adjust for the wingp->special_ship--

Make sure we adjust sssi on ship death
2022-11-20 09:11:40 -05:00
Goober5000 7693138f56 also qtfred 2022-11-19 20:48:48 -05:00
Goober5000 d06e5ee627 guard against unknown variables
If a variable can't be found, fail gracefully instead of Asserting.  These changes will allow the mission to be saved and/or loaded, and will also allow the user to open the Event Editor and replace the nonexistent variable.  This fixes the crash/assertion failure in #3849, as well as the case where the variable is edited in the mission file.
2022-11-19 20:43:02 -05:00
Goober5000 5eddd06f44 Merge pull request #4915 from Goober5000/4878_followup
fix a copy+paste error
2022-11-19 20:23:59 -05:00
Goober5000 e62c148c53 fix a copy+paste error
This was accidentally introduced in #4878.
2022-11-19 18:54:39 -05:00
Goober5000 bfa498b378 Merge pull request #4898 from MjnMixael/force_sensor_static_sexp
hud-force-sensor-static sexp
2022-11-18 21:52:25 -05:00
Goober5000 ecb78479ce Merge pull request #4910 from MjnMixael/generate_script_name
allow getting message names in script generation
2022-11-18 21:51:55 -05:00
Goober5000 70b8a8e81e Merge pull request #4885 from Goober5000/fred_campaign_path
fix campaign loading in FRED
2022-11-18 21:49:57 -05:00
mjn-mixael 4e6ff9c355 allow getting message names in script generation 2022-11-18 11:06:34 -06:00
MjnMixael 2811e56d39 setup callsign and altname fields to use the full 31 characters allowed (#4905)
* setup callsign and altname fields to use the full 31 characters allowed

* no magic numbers
2022-11-18 10:06:09 -05:00
John Fernandez cd67d8ac6a Move the assertion.
This is just a much simpler and cleaner version of the same check.
2022-11-17 19:45:29 -05:00
MjnMixael 735b41631d ship flag to exempt it from targeting restrictions (#4878)
* ship flag to exempt it from nebula targeting restrictions

* Make this flag more generic

* address feedback
2022-11-17 07:38:37 -05:00
JohnAFernandezandGoober5000 203c5a04f6 Add special ship info index (#4908)
* Add special_ship_ship_info_index

* Change the wing's sssii if it's the wing leader

* Ignominious Lack of P

* Update code/ai/aigoals.cpp

Co-authored-by: Goober5000 <[email protected]>

* Update code/ai/aigoals.cpp

fix indentation

Co-authored-by: Goober5000 <[email protected]>
2022-11-17 05:46:13 +00:00
Goober5000 6918993994 Merge pull request #4907 from Goober5000/reanimate_textures
by default, start texture animation at the beginning of a mission
2022-11-16 23:46:53 -05:00
Goober5000 22782333c9 by default, start texture animation at the beginning of a mission
For all POFs that use animated textures, if no starting timestamp is specified, assume animation started at the beginning of the mission.  This fixes a bug reported in Starfox: Event Horizon where weapon POF animated textures stopped animating after the texture timestamp upgrade.
2022-11-16 22:50:04 -05:00
MjnMixael 727b3dc5c2 check nebula and poof bitmaps at parse time (#4895) 2022-11-16 10:47:00 -05:00
MjnMixael 76392de698 Fix overhead style (#4893)
* move initialization of overhead style

* Still need to init these colors for scpui
2022-11-16 07:37:58 -05:00
EatThePath d848adc1cf hook up cone light profile values (#4900) 2022-11-16 07:37:15 -05:00
wookieejedi 493158174a Fix Flashlights (#4902)
Area_normalisation term in deferred shader was not getting set properly for cone lights, which caused things like ship headlights to not work properly.

Tested and fixes issue as expected. Thanks to Qaz and EatThePath for pointing out how to fix it!
2022-11-16 07:36:48 -05:00
mjn-mixael 786b4b74f1 missed one 2022-11-15 21:29:04 -06:00
mjn-mixael 1f311adf13 hud init and better variable name 2022-11-15 20:20:20 -06:00
Goober5000 bd062d155e Merge pull request #4892 from MjnMixael/resize_fred_briefing
Increase default Briefing window size and allow custom setting
2022-11-15 20:53:15 -05:00
Goober5000 98a3c64cc8 fix campaign loading in FRED
Load campaigns using the full path provided by the user, not just from the configured mod paths.

Also tweaks initialization based on the campaign having already been cleared in `mission_campaign_clear()`.
2022-11-15 20:40:33 -05:00
JohnAFernandez 6255b9b154 Make sure that we check the correct instance (#4897) 2022-11-15 12:02:55 -05:00
mjn-mixael 2e42f9f215 hud-force-sensor-static sexp 2022-11-15 10:44:30 -06:00
Taylor Richards 3e57da1681 add support for subfolders to cfile (#4771)
* add subfolder support to cfile

* sort files in VP archives before indexing them

* fix indexing of sub-subfolders

* remove unused 8B22K & 16B11K sound path types

* add more items to skip subfolder scanning

* fix windows build issues

* fix unit tests by allowing 0-byte files to be indexed

* fix file indexing on windows

* add test for cfile subfolders

* remove specific 'markup' and 'css' interface subfolders

They aren't directly referenced anywhere by pathtype and the new
subfolder code will continue to index and load files from them

* add player binds to list of always-root locations

* remove file-based localization support

An alternative is left in place for old fonts, as that was the only place
it appeared to be used.

This method of file localization conflicts with subfolder support however
so if it's needed in the future then changes to the subfolder code will
be necessary.

* add subfolder support to cf_find_file_location_ext()

* add subfolder tests for cf_find_file_location*()

* add shlwapi to needed win32 libs

* small bit of cleanup

* add subfolder support to cf_get_file_list()

* add tests for cfile subfolder lists

* report files that might be shadowed

* fix issue with lists when a filter is used

Also fixes discrepancy in older cf_get_file_list() when a sub path
is specified (should be used in all cases, not just glob).

* address review suggestions
2022-11-15 08:00:13 -05:00
BMagnu f2f53b718d Actually assign enum value for constants (#4896) 2022-11-15 15:28:47 +09:00
Goober5000 dbf94acf02 Merge pull request #4881 from Goober5000/fred_swap_fix
fix swapping of things in FRED
2022-11-14 14:37:35 -05:00
JohnAFernandez 8712e69130 Merge pull request #4836 from JohnAFernandez/Fix-in-Game-Joining-Backup
Fix in game joining
2022-11-14 11:14:40 -05:00
JohnAFernandez 0d27a0f086 Enable client turrets to track targets (#4791)
* Enable clients to move turrets

This allows clients to user server data to move turrets according to the timing and target data on the server.  Uses a small packet to do so.
2022-11-14 15:58:41 +00:00
Goober5000 b9896ea611 Merge pull request #4890 from Goober5000/fix_wing_leader_check
fix wing leader check
2022-11-14 10:43:00 -05:00
John FernandezandTaylor Richards 11d571ed43 Fix a few other crash fixes that still existed
Co-Authored-By: Taylor Richards <[email protected]>
2022-11-14 10:30:28 -05:00
John FernandezandTaylor Richards 206ca742ab Further Fixes from Taylor
These fix up the in-game confirm packet and help sync client and server through a few timing fixes.

Co-Authored-By: Taylor Richards <[email protected]>
2022-11-14 10:30:28 -05:00
JohnAFernandezandBMagnu c89bc89cdc Use Lafiel's Fix
Fixes a check that object flags did not exceed ubyte size * 8.

Co-authored-by: BMagnu <[email protected]>
2022-11-14 10:30:28 -05:00
John Fernandez 4b26d38534 Fix mistake And Add lock clearing for multilock 2022-11-14 10:30:28 -05:00
John Fernandez bd79cc9a7a Buttress error reporting
fix
2022-11-14 10:30:28 -05:00
John FernandezandTaylor Richards 79c3571d2f Deny in-game Join for SW games
Because these are competitive games, we cannot allow in-game joining.

Co-Authored-By: Taylor Richards <[email protected]>
2022-11-14 10:30:28 -05:00
John Fernandez 2365174b55 Use tabs here 2022-11-14 10:30:28 -05:00
John Fernandezandwookieejedi 32b1e563bb Fix from Wookie for Joining more than once
Make sure that in game joiners adjust their time more than once.

Co-Authored-By: wookieejedi <[email protected]>
2022-11-14 10:30:28 -05:00
John Fernandez f8de460b75 Fix ships not moving
Revert "Fix ships not moving"

This reverts commit e989ad440009a20c1d0b1957ff0f10cc856d8fea.

Update multi_ingame.cpp
2022-11-14 10:30:28 -05:00
John Fernandez ba665bfc9d Attempt to adjust timing for in-game joiners
This allows in game joiners to avoid interpolation and physics bugs by using the first incoming timing from the server as its local missiontime.
2022-11-14 10:30:28 -05:00
JohnAFernandez 4e8203a066 Patch in-game joining crashes
Patches multiple things about in-game joining to allow it to be enabled by default.
2022-11-14 10:30:27 -05:00
BMagnu bd2c50aa1d Refactor Lua Enums (#4867)
* Refactor bitfield enums

* Add default case for lua switch

* Add default case for more lua switches

* Fix Warnings

* constexpr
2022-11-14 17:31:50 +09:00
JohnAFernandezandTaylor Richards d50a599934 Taylor's in-game fixes
Co-Authored-By: Taylor Richards <[email protected]>
2022-11-13 20:32:42 -05:00
Goober5000 9d898cb585 Merge pull request #4891 from Goober5000/cannot_perform_scan_flag
add cannot-perform-scan flag
2022-11-13 18:41:59 -05:00
Goober5000 b6d3065876 Merge pull request #4888 from Goober5000/fix_animated_textures
use correct math for animated textures
2022-11-13 16:14:01 -05:00
Goober5000 b2f5ea9065 Merge pull request #4764 from MjnMixael/3d_select_settings
3d select settings
2022-11-13 16:13:17 -05:00
mjn-mixael 495872e8fa ordering 2022-11-13 15:08:39 -06:00
MjnMixael 760cc543b7 replace keybinds in debriefing (#4876) 2022-11-13 16:05:14 -05:00
mjn-mixael abec56ee05 use a single variable array 2022-11-13 14:46:53 -06:00
mjn-mixael bab0752af2 increase default window size and allow custom setting 2022-11-13 10:31:16 -06:00
Goober5000 320ebd4762 add cannot-perform-scan flag
Prevents the player from performing a cargo or subsystem scan.  Can be toggled using alter-ship-flag.
2022-11-13 00:37:56 -05:00
Goober5000 48cd9b2989 fix wing leader check
The `special ship` field stores the index in the wing's `ship_index` array.  It does not store the shipnum itself.
2022-11-12 18:43:41 -05:00
Goober5000 e22112e0a9 use correct math for animated textures
Fixes #4887.  Follow-up to #4704.
2022-11-12 14:11:11 -05:00
Asteroth e85fabf671 bugfix arg order (#4882) 2022-11-11 23:06:42 -05:00
Goober5000 51f50132d2 Merge pull request #4886 from MageKing17/bugfix/make-sound-environment-sexp-errors-recoverable
Make sound environment SEXP errors recoverable.
2022-11-11 23:00:21 -05:00
MageKing17 6ef8028794 Make sound environment SEXP errors recoverable.
Adds `SEXP_CHECK_INVALID_SOUND_ENVIRONMENT` and `SEXP_CHECK_INVALID_SOUND_ENVIRONMENT_OPTION` to `sexp_recoverable_error()`. Neither causes a fatal problem, and the former can be spuriously triggered if EFX is disabled.
2022-11-11 16:40:01 -08:00
MjnMixael b5328a81c2 increase object limits (#4849) 2022-11-11 12:54:54 -05:00
EatThePath 63a0c9bdb9 Merge pull request #4883 from Goober5000/ai_profiles_bump
bump MAX_AI_PROFILES
2022-11-11 11:03:29 -06:00
Goober5000 2b3c533d09 bump MAX_AI_PROFILES
Previous limit lasted from 2005-11-21 until now (from commit b33caf6f45).  We'll see how long this one lasts.
2022-11-11 00:41:14 -05:00
Goober5000 351aed432f Merge pull request #4866 from Goober5000/formation_enhancements
add wing formation align button
2022-11-10 22:13:28 -05:00
MjnMixael 3367b5739f Fix poof name parsing and fix lab not knowing about the new parsing (#4879)
* Fix poof name parsing and fix lab not knowing about the new parsing

* address feedback
2022-11-10 21:40:26 -05:00
Goober5000 bd50aadf5c fix swapping of things in FRED
This properly updates event and goal signatures when events are moved around.  Fixes Mantis bugs 1005, 1961, and 2998.
2022-11-10 15:47:20 -05:00
mjn-mixael 3e87c3f54e not needed 2022-11-09 10:12:31 -06:00
mjn-mixael 35e6bc9df0 setup overhead style as a type enum 2022-11-09 09:16:57 -06:00
Goober5000 8ddbad645b Merge pull request #4874 from Goober5000/fix_path_masks
use correct path masks for parse objects
2022-11-08 23:48:00 -05:00
Goober5000 1736c9b230 use correct path masks for parse objects
Parse objects have their path masks temporarily set to -1 during parsing, since at that point the mask represents an index, not a bitfield.  In all other cases, the path mask defaults to 0.

Fixes #4873.
2022-11-08 23:14:10 -05:00
Goober5000 0b2dc58d5a add formation scale 2022-11-08 22:52:38 -05:00
Goober5000 94358c20e9 add wing formation align button
This button allows wings to be arranged in their formation so that they don't scramble around when they arrive.
2022-11-08 22:48:31 -05:00
Goober5000 2fba619a67 Merge pull request #4865 from Goober5000/clean_up_old_fields
clean up some obsolete fields
2022-11-08 22:37:53 -05:00
Goober5000 2984f21999 Merge pull request #4872 from Goober5000/init_ship_for_lab
fix lab CTD
2022-11-08 17:26:45 -05:00
Goober5000 f823a8dc62 fix lab CTD 2022-11-08 15:19:09 -05:00
MjnMixael 415924bbbd Fix num comparison for FS2 medals (#4869)
* Fix num comparison for FS2 medals

* works better if you get the proper position
2022-11-08 14:42:22 -05:00
Goober5000 e8fdfa5513 clean up some obsolete fields
Remove `behavior`, `type`, and `wing`, which are either unused or redundant.
2022-11-07 22:43:50 -05:00
Goober5000 0721792b93 Merge pull request #4856 from Goober5000/clear_mission_refactor
refactor mission initialization
2022-11-07 21:46:56 -05:00
Goober5000 5ab63a8ec9 use the clear-wing function when creating a wing in fred 2022-11-07 20:41:54 -05:00
Goober5000 21751a8a58 Merge pull request #4863 from Goober5000/lua_is_docked
add numDocked and isDocked
2022-11-07 20:29:26 -05:00
Goober5000 d43be3eba4 Merge pull request #4868 from Goober5000/decal_parse_fix
fix decal debug warnings in FRED
2022-11-07 14:23:03 -05:00
Goober5000 e64d6a062e fix decal debug warnings in FRED
Prevent warnings from being displayed due to decals not being loaded.
2022-11-07 11:19:00 -05:00
EatThePath f3601d8178 Merge pull request #4826 from MjnMixael/optional_discord_presence
Optional discord presence
2022-11-07 08:59:30 -06:00
MjnMixael 1ba0b8dcbe Modular medals (#4851)
* Modular medals table

* Remove Num_medals completely

* Handle badges out of order and allow setting of masks to handle mask indecies out of order

* const const const

* qtFRED

* address feedback
2022-11-07 22:53:28 +09:00
MjnMixael 26269e10bf toggle-asteroid-field sexp (#4857) 2022-11-07 22:52:52 +09:00
MjnMixael 6e1b194c38 Modular iff table (#4845)
* split up init, parsing, and data resolution

* modular iff table

* address feedback
2022-11-07 22:52:44 +09:00
Goober5000 7c26c19671 add numDocked and isDocked
Two useful script functions.
2022-11-06 16:19:45 -05:00
Goober5000 4ace4f6d5a nebula fix 2022-11-06 11:27:18 -05:00
Goober5000 1ec38ff71a parse object stuff 2022-11-06 11:27:18 -05:00
Goober5000 b48d2faa80 wing stuff 2022-11-06 11:27:18 -05:00
Goober5000 00acefea86 some fixes 2022-11-06 11:27:18 -05:00
Goober5000 cce4be4bfb refactor mission initialization
Gather all the mission initialization code into a common function for clarity and ease of expansion.  Previously, the various parsing routines contained initialization as well as parsing.  As a bonus, quite a few redundant initializations are streamlined.
2022-11-06 11:27:18 -05:00
Goober5000 f873a6fc99 Merge pull request #4862 from Goober5000/check_sexp_syntax_fix
improve SEXP syntax checking
2022-11-06 11:25:39 -05:00
Asteroth 2777e45a95 Add isMultipart and getModelFlag functions on subsystems (#4846)
* add `getModelFlag` function

* add ismultipartturret function

* fix

* fix link
2022-11-06 23:59:54 +09:00
Asteroth 924013b521 add burst shots and delay to scripts (#4847) 2022-11-06 23:59:34 +09:00
Goober5000 b44f9f6125 improve SEXP syntax checking
When the top-level operator of a SEXP is not found, flag the error instead of crashing.  This is helpful for missions that contain unsupported scripted SEXPs.

Also be sure to set the bad node in the event of a NONOP_ARGS syntax error.
2022-11-06 05:09:40 -05:00
EatThePath aef869aa2a Merge pull request #4859 from EatThePath/fix-loadout-flicker
always set the default gloss uniform since it is now always used
2022-11-05 14:07:05 -05:00
Asteroth 18d3c01576 Allow overriding gvec in fireWeapon on subsystems (#4852)
* allow for overriding of gvec

* update docs

* fix docs
2022-11-05 14:13:01 -04:00
David Gibson 830fed0bdc always set the default gloss uniform since it is now always used. Fixes flickering issue 2022-11-05 11:16:51 -05:00
MjnMixael bff3d433e2 properly get badge name (#4853) 2022-11-05 10:01:44 -04:00
Asteroth f5fe1c5d65 small fix for turret fire pos in beam-fire (#4848) 2022-11-04 19:16:40 -04:00
EatThePath e371032e5e Merge pull request #4850 from qazwsxal/shader_geom_fix
Minor lighting shader fixes
2022-11-03 22:58:01 -05:00
JohnAFernandez 595d63c001 Merge pull request #4841 from JohnAFernandez/Add-check-to-Escort-list-in-multi
Make sure that the escort list only lists valid targets on multi
2022-11-03 12:24:43 -04:00
EatThePath 06fc2c81f9 Shader/Material cleanup pass (#4838)
* Ripping out the gloss override code because it's vestigial

* Remove redundant teammask declaration.

* The NORMAL_ALPHA shader feature appears both useless and unusable.
Consequently, I'm removing it.
2022-11-02 17:19:54 -04:00
Adam Leach 8ec89751bb Use the correct k value for geometry term. Actually use area_norm 2022-11-02 16:32:54 +00:00
BMagnu d85c1431a4 libRocket Texture Passthrough (#4822)
* Properly handle lua texture refcounting

* Add linkTexture ui method

* Incorporate feedback
2022-11-02 18:25:22 +09:00
MjnMixael bd151095b3 implement modular nebula.tbl (#4834)
* implement modular nebula.tbl

* Address feedback and skip > 32 poofs

* read/write nebula poofs by name

* qtfred changes

* variable name

* log -> warning

* nullptr and make sure to only set bitmap_name when it's actually defined
2022-11-02 18:25:13 +09:00
Goober5000 7e8e28e6e8 Merge pull request #4844 from Goober5000/timestamp_compare_fix
fix timestamp_in_between functions
2022-11-01 14:33:58 -04:00
MjnMixael e6ef239ae6 Modular tips (#4843)
* vectorize tips

* make tips.tbl extendable with -tip.tbm
2022-11-01 21:46:22 +09:00
Goober5000 5f54188e5b add a few scripting dock functions (#4839)
* add a few scripting dock functions

Add setDocked, setUndocked, and jettison.

* address feedback
2022-11-01 21:45:49 +09:00
Asteroth a29378d245 Clearable Ship/Subsystem Targets via script (#4842)
* make sure Targets can be cleared with `nil`

* move `set_targeted_subsys` calls
2022-11-01 21:43:26 +09:00
MjnMixael 346817f3d0 Further limit what built-in UI elements can be setup when using SCPUI (#4824)
* Further limit what built-in UI elements can be setup when using SCPUI

* remove superfluous declaration
2022-11-01 21:43:14 +09:00
MjnMixael f0ecf8c2aa allow borrowing flyby sounds from a previously parsed species (#4828) 2022-11-01 21:43:01 +09:00
Goober5000 a86074e3cd fix timestamp_in_between functions
Fix the comparison and add documentation to the compare functions.
2022-11-01 01:10:59 -04:00
MjnMixael 0b9f0f25c9 Dont add whitespace for no_fred ships in the main list (#4833)
* Dont add whitespace for no_fred ships in the main list

* whitespace and better variable name

* fix comparisons
2022-10-31 18:45:21 +09:00
Asteroth 7d800e48ae Add $On Camera Set Up hook (#4832)
* add on camera set up hook

* typo
2022-10-31 03:28:48 -04:00
John Fernandez a00a7a7f26 Make sure that the escort list
Only lists valid targets on multi
2022-10-30 20:52:30 -04:00
Goober5000 874e22b8e1 Merge pull request #4831 from Goober5000/new_autoscale
take non-autoscaling AI classes into account when autoscaling
2022-10-30 00:05:34 -04:00
JohnAFernandez 18c1abb14f Merge pull request #4825 from MjnMixael/full_int3_fix
remove misplaced int3() and allow the game to continue with -1
2022-10-29 16:30:27 -04:00
JohnAFernandez 6cd217589b Merge pull request #4490 from JohnAFernandez/fix-traitors-multilocking-each-other
Allow multilock between traitors
2022-10-29 16:16:08 -04:00
Goober5000 0e477367ef Merge pull request #4827 from Goober5000/asteroid_target_init
asteroid field fix/refactor
2022-10-27 19:54:20 -04:00
BMagnu 8a3a99ccbd UI Popup Scripting Hook (#4806)
* Add Popup Init Hook

* Finish popup hooks

* Fix warnings

* Fix fallthrough

* feedback
2022-10-27 16:23:23 +09:00
MjnMixael 291f4f68ea Allow adding custom head anis to the list in FRED (#4818) 2022-10-27 16:22:49 +09:00
EatThePath 7a9a33d16c These old vars did something once, but not anymore (#4823) 2022-10-27 16:22:36 +09:00
Goober5000 1b0dd83c27 type safety 2022-10-26 21:07:44 -04:00
Goober5000 b42831b981 take non-autoscaling AI classes into account when autoscaling
This adds an AI profiles flag that filters autoscaling so that only the index and number of autoscaled classes are considered, not the index and number of all AI classes.

Fixes #4516.
2022-10-26 21:02:59 -04:00
Goober5000 e8bbb97f96 add clarifying comment 2022-10-26 20:42:03 -04:00
Goober5000 0a9032fc03 asteroid field fix/refactor
Some refactoring with asteroid fields:
1. Moves asteroid throwing targets into the Asteroid_field struct, in anticipation of potentially multiple fields in the future
2. Moves some initialization code into `asteroid_level_init`
3. Calls `asteroid_level_init` when a mission is cleared
4. Loads asteroid targets as part of the asteroid field update/init logic.  This fixes a FRED bug reported in Discord where asteroid targets stay in the dialog when a new mission is loaded
5. Remove `Default_asteroid_throwing_behavior` flag as it is equivalent to checking that the target list is empty
2022-10-26 19:16:08 -04:00
mjn-mixael 8bc5723d43 create mod.tbl and built-in option to enable or disable discord presence 2022-10-26 14:13:53 -05:00
mjn-mixael 37022fa5c2 Setup discord presence to be able to be toggled 2022-10-26 14:12:58 -05:00
mjn-mixael f4f223908c remove misplaced int3() and allow the game to continue with a value of -1 2022-10-26 10:13:48 -05:00
Goober5000 f07c4481ff Merge pull request #4820 from Goober5000/lua_type_check_cleanup
clean up stack when checking type
2022-10-25 09:43:34 -04:00
Goober5000 e6b9ff7361 Merge pull request #4704 from Goober5000/texture_timestamp
upgrade texture animation code to use new timestamps
2022-10-24 23:49:42 -04:00
MjnMixael b3c900803e translate key tokens in tips (#4808) 2022-10-24 16:51:08 -04:00
Goober5000 fdbdcec2b1 clean up stack when checking type
The `ade_odata_is_userdata_type` function didn't clean up its stack properly, as it left type information there for error reporting.  But there are other reasons to check userdata types besides error reporting, so this adds a flag to clean up in most situations.

Fix courtesy of @BMagnu.
2022-10-24 11:09:52 -04:00
MjnMixael 9d122616dd Update credits (#4799)
* add self and naomi to SCP credits

* Add EatThePath, Kiloku, and Lafiel as well
2022-10-24 10:36:32 -04:00
EatThePath f8e99e6012 Actually dynamically populate the empty debug filter files (#4817)
* Actually dynamically populate the default debug filters properly for empty files, rather than just enable everything.

* whitespace shuffle
2022-10-24 18:37:11 +09:00
BMagnu 2116d1fe66 Modular POF Features (#4713)
* Add turret copying

* Ad addturret parsing

* Fix gun_nr error

* Fix strncpy_s

* Fix strings better

* Cleanup submodel / turret copying

* Add 'Add Engine'

* Add Glowpoints, add Special Subsys

* Remember to keep the glowpoint texture

* Fix unused param
2022-10-24 18:35:51 +09:00
Goober5000 1cc027666e Merge pull request #4814 from Goober5000/fix_debris_crash
handle debris model instances correctly when shadows are enabled
2022-10-23 15:04:17 -04:00
Goober5000 fde3589d1d handle debris model instances correctly when shadows are enabled
Fixes #4813.
2022-10-23 14:13:08 -04:00
BMagnu 2080824a20 Can has high rez plz k thx bye (#4805) 2022-10-22 18:47:58 +09:00
Goober5000 11b37bbeae Merge pull request #4787 from Goober5000/createdebris
create debris using script functions
2022-10-21 23:24:47 -04:00
Goober5000 41074956a8 more fixes 2022-10-21 12:01:25 -04:00
MjnMixael c63ce5de8c Allow writing to player mission specific stats (#4801)
* Allow writing to player mission specific stats

* Documentation

* return false
2022-10-21 20:25:35 +09:00
MjnMixael 17e42e92cf cockpitinactive gauges should render in chase view (#4804)
* cockpitinactive gauges should render in chase view

* Simplify
2022-10-21 20:25:24 +09:00
Goober5000 debedf26ef partial fix 2022-10-20 23:32:30 -04:00
MjnMixael 90c4316a5e Update scpui documentation (#4802)
* Update documentation

* Typo
2022-10-20 19:13:03 +09:00
Goober5000 9782f191b9 Merge pull request #4789 from Goober5000/timestamps_3
music and training message timestamp conversion
2022-10-19 20:02:47 -04:00
Goober5000 49fb2f07c0 refactor per feedback, tweak to fix circular #include, use accessor, reorder, fix namespaces, fix API documentation 2022-10-19 14:44:57 -04:00
Goober5000 f24277c39e make clang happy 2022-10-19 14:22:10 -04:00
Goober5000 452c8370dc model instances are not needed for debris in many cases 2022-10-19 14:22:10 -04:00
Goober5000 77179dc183 add mn.createDebris
This is a new Lua API function that allows creation of arbitrary debris pieces, whether chunks of a ship's hull or shards of shrapnel.  All of the parameters are optional, and a wide variety of situations are possible ranging from vaporized bits to static chunks to chunks propelled by an explosion.
2022-10-19 14:22:10 -04:00
Goober5000 d37a446894 music and training message timestamp conversion 2022-10-19 14:11:23 -04:00
MjnMixael 7a5b840338 Allow setting an override wireframe color globally and add option to set target monitor style and wireframe color per gauge (#4786) 2022-10-19 21:51:35 +09:00
MjnMixael 50cd91bd86 Damage, swarm, corkscrew info virtvars (#4798)
* Add access to damage type, swarm, and corkscrew data

* Also return if the weapons have the appropriate flags

* Return nil for invalid handle and clarify documentation
2022-10-19 21:51:22 +09:00
MjnMixael 00c8b946a4 Modular species table (#4775)
* Add modular ability to add intel entries

* Allow for +nocreate in modular tables

* Allow intel.tbl as an alias of species.tbl

* Additional error checking and remove tests that are no longer required

* const
2022-10-19 21:51:15 +09:00
Asteroth 4c6f043274 Add a bunch of movement stats to ship class script api (#4797)
* add a bunch of script physics values

* fix

* small doc fix (its just called "damp" barely worth mentioning)
2022-10-18 20:54:30 -04:00
MjnMixael 307c770c58 Enable hud rearm timer in hud_gauges.tbl (#4777)
* Enable hud rearm timer in hud_gauges.tbl

* Comment
2022-10-18 22:21:51 +09:00
JohnAFernandez bd0e6bb990 Add an update interval for client update packets (#4796) 2022-10-18 21:54:16 +09:00
MjnMixael 0a6729b03d enable target info in hud_gauges.tbl (#4778)
* enable target info in hud_gauges.tbl

* Comment
2022-10-18 17:08:44 +09:00
Fabian Woltermann 9e56ba43a5 Merge pull request #4783 from MjnMixael/render_no_lighting
Allow option to choose to render with no lighting
2022-10-17 19:30:40 +02:00
Fabian Woltermann f76e110c87 Merge pull request #4795 from The-E/fix/4794_bump_max_instance_depth
Bump the MAX_INSTANCE_DEPTH constant to 32
2022-10-17 19:30:08 +02:00
Fabian Woltermann a8328a8ee7 bumps the MAX_INSTANCE_DEPTH constant to 32.
This bump should be sufficient to cover complex animation states. This fixes #4794
2022-10-17 18:59:51 +02:00
mjn-mixael 6464900fa1 Fully deprecate -ship_choice_3d and -weapon_choice_3d 2022-10-17 09:58:48 -05:00
mjn-mixael 64bd233c49 API to access the new 3d select settings in game_settings.tbl 2022-10-17 09:58:15 -05:00
mjn-mixael 2d4d886a6a Add Game Settings options for 3d ship and weapon select 2022-10-17 09:58:15 -05:00
mjn-mixael 32b059ae07 fix documentation 2022-10-17 08:09:26 -05:00
mjn-mixael 1af0a1082b int to bool 2022-10-17 08:04:02 -05:00
Goober5000 f34294cf95 Merge pull request #4788 from Goober5000/force_arrival_for_reinforcements
fix makeShipArrive and makeWingArrive for reinforcements
2022-10-17 01:16:56 -04:00
wookieejedi 5d60e56614 Update $POF file Techroom: Usage (#4785)
* Update `$POF file Techroom:` Usage

Currently `$POF file Techroom:` is only used in the weapons loadout screen (despite having techroom in the name). This PR expands the use of the `$POF file Techroom:` to shiploadout select and the actual techroom.

If it is desired I can put it behind a game settings flag, but IMO it would make the most sense for modders to have this just work as the actual name implies.

* clean up code with feedback

* typo fix in comment
2022-10-15 21:12:19 -04:00
wookieejedi 4d581e92e8 1 Line fix for player view render check (#4790)
Fix for recent updates to cockpit rendering check, which was false if the player was the only ship in a mission. `instance >0` was used but it is supposed to be `instance >= 0` (The object index is valid if larger or equal to 0, while the signature is only valid equal or larger to 1.) Tested and fix works as expected.
2022-10-15 21:59:14 +00:00
Goober5000 3d515ddfb7 upgrade texture animation code to use new timestamps
Timestamp changes for texture animation, both on ships and on the skybox.
2022-10-15 12:24:05 -04:00
Goober5000 9161601cac Merge pull request #4780 from Goober5000/alter_ship_flag_listing
prevent duplicate flag names in the alter-ship-flag list
2022-10-15 11:53:29 -04:00
MjnMixael 09a307b17d Virtvar to access the energy a weapon consumes (#4784)
* Virtvar to access the energy a weapon consumes

* quick fix
2022-10-15 09:54:44 -04:00
Goober5000 848d133fe3 Merge pull request #4767 from Goober5000/enhanced_print
enhance ba.print and add ba.println
2022-10-14 21:40:11 -04:00
Goober5000 8f8a6ca527 warning tweak 2022-10-14 21:08:47 -04:00
Goober5000 a2af63726e fix makeShipArrive and makeWingArrive for reinforcements
The script functions should make the ships/wings arrive even if they are reinforcement, so this PR fixes that.  Also, this PR adds some additional verification of the `num_uses` of reinforcements, especially when the player calls for a wing that is already present but has more uses remaining.
2022-10-14 20:44:39 -04:00
JohnAFernandez 8ea13a2b49 Merge pull request #4773 from MjnMixael/fix_target_team_colors
apply team colors to all target view styles
2022-10-14 15:25:23 -04:00
Goober5000 b67ae48590 Merge pull request #4782 from Goober5000/submodel_indexer_fix
model.Submodels fix
2022-10-14 14:04:12 -04:00
MjnMixael 3dcfa99c4a add warp flash to ingame options (#4776) 2022-10-14 10:04:59 -04:00
mjn-mixael 7a5a54d009 Allow option to choose to render with no lighting 2022-10-14 09:00:35 -05:00
Goober5000 da7228cedb model.Submodels fix
Guard against the indexer being invalid, e.g. if the model isn't loaded yet.
2022-10-14 02:07:35 -04:00
Goober5000 aa7a57ef4e Merge pull request #4781 from Goober5000/collision_fix
collision fix
2022-10-14 01:01:09 -04:00
Goober5000 c300278328 collision fix
Fix a typo in `collide_ship_ship`.  Also tweak some lines for clarity.
2022-10-14 00:28:44 -04:00
Goober5000 8b3dccce1c prevent duplicate flag names in the alter-ship-flag list 2022-10-13 15:35:50 -04:00
MjnMixael d323421817 Use a local int for model storage in renderTechModel (#4779)
* Use a local int for model storage here

* null -> nullptr
2022-10-13 17:06:03 +00:00
MjnMixael 7ab80a0162 Toggle cockpit (#4772)
* proof of concept

* Account for shadows

* Option to tie individual HUD gauges to the cockpit option

* Do this in a more user-friendly way

* Address feedback
2022-10-13 19:42:00 +09:00
Goober5000 d1b16d5269 Merge pull request #4762 from Goober5000/flag_list_cleanup
remove obsolete field
2022-10-13 02:02:08 -04:00
Goober5000 446b50cbaf Merge pull request #4774 from Goober5000/fix_ui_timestamp_check
fix updating of ui_timestamps
2022-10-11 20:02:22 -04:00
Goober5000 187cd35e74 add additional comments 2022-10-11 19:28:02 -04:00
Goober5000 e95d214143 Merge pull request #4756 from Goober5000/ship_entry_and_related
Add Lua API for ship registry
2022-10-11 19:24:54 -04:00
MjnMixael 6ae8674615 Correctly set credits default even for scpui access (#4768)
* Correctly set credits default even for scpui access

* These also need to move up for the same reason

* Match retail functionality
2022-10-11 16:47:10 +09:00
Goober5000 7c01485d2d fix updating of ui_timestamps
Since the debug pause check needs to use UI timestamps, and since UI timestamps must keep track of time regardless of time compression, pausing, or mission status, move the updating and checking to `game_do_state_common`.

Also fix a type conversion warning.
2022-10-11 01:06:33 -04:00
Goober5000 3850acdd23 documentation updates 2022-10-10 22:45:14 -04:00
mjn-mixael e3424b4350 apply team colors to all target view styles 2022-10-10 12:56:04 -05:00
Goober5000 f10e35e8dd Merge pull request #4769 from Goober5000/credits_get_music
get the credits music without starting it
2022-10-10 09:43:24 -04:00
MjnMixael bc6282b34b These were reversed (#4770) 2022-10-10 17:48:47 +09:00
Goober5000 d8ad8ebc77 get the credits music without starting it
Starting the music should happen in `credits_init`, not whenever someone needs to know the file name.
2022-10-09 15:41:54 -04:00
Goober5000 ab83a94eb4 remove obsolete field
The `flag_list` field is left over from before the type-safe refactor.  It was used to specify either the `flags` or `flags2` bitfield.
2022-10-07 13:24:52 -04:00
Goober5000 663474516f Merge pull request #4752 from Goober5000/arrival_departure_info
add arrival and departure info for wings, ships, and parse objects
2022-10-07 12:26:59 -04:00
wookieejedi 0dfed6de4b Add maximum self repair percentages for health and subsystems (#4761)
* Add maximum self repair percentages for health and subsystems

Adds two new options to help with the automatic self repairs for hull and subsystems: `$Hull Self Repair Maximum:` and `$Subsystem Self Repair Maximum:`. These values allow mods to specify how much a ship's hull or subsystem can self repair to, which is very useful to have some auto repair but not enough to make the hull or subsystem 100%.

Also cleans up the `ship_auto_repair_frame` function with removing un-used define values, improving comments, and making formatting consistent. Also updates the parse sections of repair rate for hull and subsystems to print to the log if values are being clamped.

Probably easiest to review with hiding whitespace changes.

* update local names to be easier matches to surrounding code

* incorporate feedback

Add back in define, fix == 0 checks, and fix edge case logic bugs
2022-10-07 12:05:23 -04:00
Goober5000 d73ac59383 enhance ba.print and add ba.println
There was code that could interpret any Lua type as an argument for printing, so I adapted it to be used in ba.print(), ba.warning(), and ba.error().  Also ba.println() seemed like a useful thing to add.
2022-10-06 22:52:58 -04:00
Goober5000 a47b2440d3 add ship registry 2022-10-06 20:43:09 -04:00
Goober5000 7d6f261221 add getWing() to parse_object 2022-10-06 20:43:09 -04:00
Goober5000 473521f5ed Merge pull request #4759 from Goober5000/wing_flags
add wing flags
2022-10-06 18:58:00 -04:00
Goober5000 f1f234b89d Merge pull request #4702 from EatThePath/debug-log-cleanup
Moved more things to debug filters, and associated cleanup
2022-10-06 16:57:27 -04:00
MjnMixael 00d067be47 Fix one missed resize mode (#4765) 2022-10-06 15:53:30 -04:00
David Gibson 2ba9a03d9a Restored submodel detail level message 2022-10-05 20:37:33 -05:00
Goober5000 14929db6fe address feedback and add sexps 2022-10-05 18:00:16 -04:00
Goober5000 6ce8963e13 Merge pull request #4757 from Goober5000/animated_effects_to_timestamp
make animated ship effects use the new timestamps
2022-10-05 16:39:08 -04:00
Goober5000 364741ef8f additional flag error checking 2022-10-05 11:40:54 -04:00
BMagnu 209cb7cba8 Enable PNG blobs in LibRocket (#4754)
* Allow reading PNGs from b64, including in librocket

* fix memleak

* tidyup

* fix bad delete

* Force flush on png write

* Pass more image size
2022-10-05 16:57:09 +09:00
Goober5000 02aed5fde4 Merge pull request #4760 from Goober5000/removeSoundByIndex_fix
removeSoundByIndex should be 1-based
2022-10-05 00:12:31 -04:00
Goober5000 8694c042f7 add wing flags
Add setFlag and getFlag for wings, just like for ships and parse objects
2022-10-04 23:59:30 -04:00
Goober5000 3f86fbc7ad removeSoundByIndex should be 1-based
Looks like no mods use this script method, so this change should be safe.
2022-10-04 23:40:10 -04:00
Goober5000 fded868f8c Merge pull request #4758 from Goober5000/4751_followup
fix a last-minute error check
2022-10-04 23:25:26 -04:00
Taylor Richards f1a7a98639 fix and clean up cf_create_default_path_string(): (#4747)
- consolidate old and new functions
 - add missing location flags override from earlier fix
 - add proper error handling where needed
2022-10-04 23:18:28 -04:00
Goober5000 ec8354957d fix a last-minute error check 2022-10-04 22:49:44 -04:00
Goober5000 afeca7cc8f add the same for ships and parse objects 2022-10-04 21:45:56 -04:00
Goober5000 f0542553d6 make animated ship effects use the new timestamps
In addition to type-safety, this now adjusts ship effects properly for time compression and pausing.
2022-10-04 21:42:47 -04:00
Goober5000 cfefaef385 add arrival and departure info for wings
Virtual variables corresponding to the same fields as in `set-arrival-info` and `set-departure-info`.  Plus more variables.  Some refactoring as well.
2022-10-04 20:59:52 -04:00
Goober5000 90638ce534 Merge pull request #4751 from Goober5000/ship_arrival_script_functions
Ship/Wing arrival script functions
2022-10-04 20:56:30 -04:00
MjnMixael 36b0fa046b Move rendering of the 3d overhead to it's own method and create an api (#4749)
* Move rendering of the overhead model to it's own method and create an API to call it.

* fix typos
2022-10-05 02:52:38 +09:00
Goober5000 c1d687f560 prevent redundant arrivals and return whether ships were created 2022-10-03 19:41:26 -04:00
Goober5000 94f99c35f9 remove obsolete fields 2022-10-03 19:36:27 -04:00
Goober5000 61ceeff893 and also for wings 2022-10-03 19:36:27 -04:00
Goober5000 ae3bbd2959 make a parse object arrive 2022-10-03 19:36:27 -04:00
Goober5000 0702a38e1c Merge pull request #4750 from Goober5000/lua_mission_music_scores
add getMusicScore and setMusicScore
2022-10-03 19:09:56 -04:00
Goober5000 064d3a7549 add getMusicScore and setMusicScore
Two new Lua API methods, plus some minor refactoring.
2022-10-03 17:14:33 -04:00
EatThePath e32e01eb50 Added an API function to allow clearing the log during play. (#4741)
* Added an API function to allow clearing the log during play.

* document test fix maybe

* return something
2022-10-04 04:17:53 +09:00
Goober5000 c661ae4590 Merge pull request #4703 from Goober5000/control_used_upgrade
upgrade controls code to use type-safe timestamps
2022-10-02 21:02:32 -04:00
Goober5000 7a654b7e7b per feedback 2022-10-02 20:13:19 -04:00
MjnMixael d902c7612b Api to render the 3d selection effect (#4737)
* Api to render the 3d selection effect

* Missing include

* documentation

* error message for effect type

* documentation
2022-10-03 08:25:15 +09:00
BMagnu 979d305afe Add screenToBlob scripting function (#4738)
* extract base64 routines

* Add screenToBlob scripting method

* Fix variable shadow

* Fix variable shadow again

* Fix usused variable
2022-10-03 07:33:46 +09:00
Goober5000 f14acf9fc1 Merge pull request #4744 from Goober5000/lua_cap_waypoint_speed
add WaypointSpeedCap
2022-10-02 16:54:52 -04:00
JohnAFernandez c2895ba8a4 Fix subsystem health and comparison frames (#4666)
* Fix subsystem change handling code

Make sure that subsystem help actually gets updated.

* change from pointer to literal

I had decided to use `new` in the past when I was less experienced.  So this changes it back to regular angle variables.

(And White space fix requested by Wookie)
2022-10-02 16:52:36 +00:00
MjnMixael 419c56d012 check if weapon is required by current mission (#4731) 2022-10-02 20:23:36 +09:00
MjnMixael e30931b6d2 API to save the current loadout to the player file (#4739)
* API to save the current loadout to the player file

* cleanup
2022-10-02 20:23:31 +09:00
Goober5000 20653ece8e add WaypointSpeedCap
As requested by FotG
2022-10-02 00:13:50 -04:00
Fabian Woltermann 77476edd73 Merge pull request #4735 from The-E/fix/lua_rendering_outside_of_objectrender
When rendering stuff outside of ON OBJECT RENDER hooks, use immediate mode
2022-10-01 22:06:37 +02:00
Fabian WoltermannandGoober5000 e69f2b3fec Update code/scripting/api/libs/graphics.cpp
Co-authored-by: Goober5000 <[email protected]>
2022-10-01 21:39:08 +02:00
wookieejedi 1e61964055 Add AI flag to support ai bay arrivals > 10 seconds (#4733)
* Add AI flag to support ai bay arrivals > 10 seconds

Currently, if an AI ship is emerging from a bay path, the AI will stop following that path after only 10 seconds (and some distance away from the starting point). This results in AI breaking off a path early if a bay arrival path is long and/or uses a slow bay arrive multipliers. For bays that require the ship to follow the exact path this results in AI that then run into the parent ship and each other.

This PR adds a flag which disables that 10 second timeout. Also, in my tests having a flag to disable works best, as opposed to setting a max time (which is hard to calculate with varying ship speeds and varying bay path lengths).

PR is tested and works as expected.

* fix spelling
2022-10-01 12:39:17 -04:00
MjnMixael f5c83fbb40 primary -> secondary (#4740) 2022-10-01 08:44:55 -04:00
MjnMixael 7819d8262d Only check for greater than, not equal to (#4734) 2022-10-01 08:43:20 -04:00
MjnMixael 1edf63c617 take userdata and return int (#4736) 2022-10-01 08:43:13 -04:00
Fabian Woltermann b2ab98a979 When rendering stuff outside of ON OBJECT RENDER hooks, use immediate mode 2022-10-01 10:49:39 +02:00
Goober5000 1b9ab28d29 Merge pull request #4732 from BMagnu/add_local_anims
Add local coordinate relations to allow restoring old absolute behaviour
2022-09-30 19:03:36 -04:00
Goober5000 c5cbd2297c Merge pull request #4726 from Goober5000/decals_right_side_up
flip decals right-side up
2022-09-30 19:03:09 -04:00
wookieejedi 678922472a Fix Remove-Order not working for Play Dead Orders (#4720)
* Fix Remove-Order not working for Play Dead Orders

Play-dead orders set a special case of the ai mode (AIM_PLAY_DEAD), which had special handling to return early in the AI frame function. Remove-order does not change the ai mode though, and thus even when a play-dead order was removed the `AIM_PLAY_DEAD' remained, which would continually trigger an early out in AI frame, which in turn would make turrets not fire on ships, even when the play-dead order was removed. No other orders had this early return, which is why remove order works for them.

This PR accounts for that special handling case. There also seemed to be an extra cleanup line for rearm and repair, so this was added right after that step.

Tested and works as expected.

* make fix flag enabled

* appease clang
2022-09-30 08:34:02 -04:00
Asteroth c9972f678a add on mouse wheel hook (#4724) 2022-09-30 16:46:52 +09:00
MjnMixael ef850ad302 Handle errors from create_wings() in an API friendly way (#4730) 2022-09-30 16:46:45 +09:00
MjnMixael 4d620bb3c7 API for checking and setting if a slot is filled or empty (#4729) 2022-09-30 16:45:06 +09:00
MjnMixael e963cfda93 return the actual number of starting wings (#4728) 2022-09-30 16:44:58 +09:00
BMagnu 4fa9a43e0e refactor names 2022-09-30 09:31:50 +02:00
BMagnu a9ec68ced6 Encapsulate relation parsing 2022-09-30 09:27:20 +02:00
Birk Magnussen 92a1a2c441 Add Local Coordinate relations to restore old absolute 2022-09-29 22:55:42 +02:00
MjnMixael 384e228347 Reset loadout to default and handle commit mission error returns (#4719)
* Reset loadout to default and handle commit mission error returns

* Return enum instead of int codes

* comment
2022-09-29 22:35:09 +09:00
MjnMixael 35ee34b86a isDisabled returns if the ship is used in the mission + some documentation fixes (#4725) 2022-09-29 16:19:05 +09:00
MjnMixael 2149a0e1ee API access to the remaining ship class strings (#4721)
* API access to the remaining ship class strings

* copy paste errors

* Actually return the string
2022-09-29 16:18:50 +09:00
MjnMixael 5979d29463 Scpui loadout pools (#4698)
* API Access to the ship and weapon pools

* func to indexer

* Make ship and weapon pools writable
2022-09-29 16:18:26 +09:00
MjnMixael e369cf98d3 API access to weapons allowed on a ship class and/or in a specific bank (#4697)
* API access to weapons allowed on a ship class and/or in a specific bank

* Allow just checking the ship and not banks

* # This is a combination of 2 commits.

syntax fix

Add method to get number of primary and secondary banks

* We don't need these

* get default weapons for each bank

* # This is a combination of 2 commits.

documentation

return secondary not primary

* fix merge error

* Address feedback
2022-09-29 16:18:14 +09:00
Goober5000 08b7fc68b7 flip decals right-side up
For some reason, decals appear upside-down unless the uvec is flipped.
2022-09-28 22:07:28 -04:00
MjnMixael 44d042edb8 Make Wss_slots writable (#4717)
* Make Wss_slots writable

* cleanup
2022-09-28 22:53:45 +09:00
EatThePath 8edb25c235 Merge pull request #4479 from Kiloku/long_turrets
Allow turrets to use their firepoints for target-leading calculations
2022-09-27 20:21:22 -05:00
EatThePath f641f0283e Merge branch 'master' into debug-log-cleanup 2022-09-27 10:34:12 -05:00
David Gibson b76294e528 Returned some more serious lines to the general categories. 2022-09-27 10:32:18 -05:00
David Gibson e86bbb0138 cleanup to the cleanup of filters
Moved more things to debug filters, and associated cleanup
2022-09-27 10:25:50 -05:00
Asteroth af4b23b7c4 handle 0 duration better (#4716) 2022-09-27 20:11:14 +09:00
BMagnu f0068b13a0 Prevent dangling threads from crashing FSO on close (#4701)
* Prevent dangling threads from crashing FSO on close

* Fix warning

* Properly allow multiple parent threads for unittests

* Fix Test

* Redo it using the lua GC method

* tidyup

* Fix Warnings

* Fix double default

* get rid of explicitly defined copy constructor to allow implicit copy assign to exist
2022-09-27 15:32:13 +09:00
JohnAFernandezandwookieejedi 2e3ff7410c Add corrections in multi ship record (#4650)
The ship record for player ships is not always accurate.  So as to correct entries as valid packets are received.

Also, remove a case where null vectors were being passed to the physics engine.

Co-Authored-By: wookieejedi <[email protected]>

Co-authored-by: wookieejedi <[email protected]>
2022-09-26 22:14:08 -04:00
Goober5000 ac57537f94 Merge pull request #4718 from Goober5000/script_vecmat_copy
a couple of scripting enhancements
2022-09-26 21:21:34 -04:00
Goober5000 1794ba87b3 address feedback 2022-09-26 19:54:18 -04:00
EatThePath 03a9c24330 Merge pull request #4711 from EatThePath/finaldata
created new "_override" universal mod directory
2022-09-26 18:43:09 -05:00
Goober5000 e2dbfca1c3 allow customizing of debug particle color 2022-09-26 18:45:19 -04:00
Goober5000 00746f1f92 add copy methods for matrixes and vectors 2022-09-26 18:43:50 -04:00
Fabian Woltermann 11ec3b64c6 Merge pull request #4712 from MjnMixael/ShipSelect3b
Lua API read-only access to the actual loadout
2022-09-26 15:38:31 +02:00
mjn-mixael eb3c8a25fb MAX_SHIP_WEAPONS 2022-09-26 08:03:40 -05:00
Asteroth 6cad66c7e7 Make sure immobile objects always have 0 velocity (#4708)
* make sure immobile objects are always 0 vel

* doesnt need to be conditional
2022-09-26 18:52:12 +09:00
David Gibson b69ac0cdd3 Implementing formatting and naming feedback 2022-09-25 19:53:54 -05:00
Goober5000 7d854c96c4 Merge pull request #4707 from Goober5000/fix_scripting_line_num
fix off-by-one error in Lua line numbering
2022-09-25 18:35:31 -04:00
David Gibson b572ef45eb added command line flag for override and addressed feedback 2022-09-25 16:16:09 -05:00
Fabian Woltermann ac27124243 Merge pull request #4715 from EatThePath/ltp-mult-lab-fix
Moved lab access to light multipliers to cleaner path
2022-09-25 19:06:21 +02:00
EatThePath 0152b7829a Merge pull request #4714 from Baezon/no-continuous-turn
Flag to turn off continuous turn when attacking
2022-09-25 11:37:57 -05:00
David Gibson 7d0393d565 Moved lab access to light multipliers to cleaner path 2022-09-25 11:35:29 -05:00
Asteroth 76c54a1016 flag to turn off continuous turn when attacking 2022-09-24 19:59:00 -04:00
mjn-mixael 1e7ee8b345 Lua API read-only access to the actual loadout 2022-09-24 16:30:44 -05:00
EatThePath 367e19b751 Merge pull request #4694 from MjnMixael/ScpuiShipSelect
Scpui ship select
2022-09-24 15:15:13 -05:00
David Gibson d0241d060c created new "load_last" universal mod directory 2022-09-24 15:00:16 -05:00
kiloku ad9bf0af71 Reset setting on mod_table_reset() 2022-09-24 10:35:25 -03:00
kiloku 4f8cf06e57 Game settings option to consider all turrets long 2022-09-24 10:32:54 -03:00
kiloku 8ef408c746 ship_get_global_turret_gun_info needs a gvec to not crash 2022-09-24 10:31:33 -03:00
kiloku 075bbe7e3b Add flag to list for parsers 2022-09-24 10:31:33 -03:00
kiloku 0a6558eea9 Adds new flag Turret_distant_firepoint that allows long turrets to aim correctly 2022-09-24 10:31:32 -03:00
BMagnu 19a7814e50 Merge Show Ship and Cockpit Renderpasses (#4705)
* Setup merge of ship model and cockpit

* Merge extmodel and cockpit rendering

* Fix hasCockpitModel check

* Fix non-coord-share mode and deferred

* Make extmodel shadowcast toggleable

* Fix extmodel shadows

* Make cockpit pass somewhat configurable

* tidyup
2022-09-24 22:10:55 +09:00
Goober5000 44802949da fix off-by-one error in Lua line numbering
This fixes the newline count used to make the parsed Lua code align with the source file.
2022-09-23 23:43:30 -04:00
BMagnu d186aefa92 Adds a cache for modular POFs (#4690)
* cleanup submodel index replacement

* Add modelreplace cache

* Move RenameSubobjects to new API

* Fix and tidyup

* Fix GCC error

* fix macro

* Appease Clang

* Properly skip reading non-final leaves from the cache

* fix warning

* Safe-stringify, incorporate comments
2022-09-23 18:38:50 +09:00
EatThePath 7c3e07ab7b Unify default filters and consolidate the new lua category 2022-09-22 21:58:24 -05:00
Goober5000 b49f70fbc3 upgrade controls code to use type-safe timestamps
This requires splitting the `used` field into digital and analog components.  The digital field stores the last-used timestamp, whereas the analog field stores the last value.
2022-09-22 22:26:34 -04:00
Adam Leach fed039fd54 logic error fix - update envMatrix even if there's no specmap (#4699) 2022-09-22 22:00:19 -04:00
Goober5000 2b1e08431c Merge pull request #4633 from Goober5000/event_and_goal_timestamps
convert event-related timestamps to new system
2022-09-22 18:51:06 -04:00
Goober5000 b0e8f260bb Merge pull request #4695 from Goober5000/more_sexps_to_scripts
a few more script enhancements
2022-09-22 18:50:11 -04:00
MjnMixael f7d84dfe76 Update ui.cpp
return
2022-09-22 09:13:27 -05:00
mjn-mixael 601a41bb60 return invalid handle 2022-09-22 08:17:19 -05:00
MjnMixael 5f183832e1 Scpui api briefing map (#4656)
* API version of the briefing map

* Cleanup

* Further cleanup

* # This is a combination of 2 commits.

Fix resizing and cleanup remaining static anim calls

Revert changes completely

* Fix documentation

* implement initBriefing and rearrange map drawing methods to match.

* Documentation

* nullptr
2022-09-22 16:04:14 +09:00
Goober5000 c7b1092a96 a few more script enhancements
1) Add the "no-thrusters" ship flag to the list of flag that can be used by alter-ship-flag or the ship's setFlag function
2) Add a `FireRateMultiplier` virtvar to control the firing rate of turrets (fulfills #4300)
3) Add a `setGlowPointBankActive` function to do the same thing as `activate-glow-point-bank`/`deactivate-glow-point-bank`
2022-09-22 02:12:17 -04:00
mjn-mixael 764c996361 Swap order 2022-09-21 18:39:58 -05:00
mjn-mixael 2f5ccc5b1a unused parameter 2022-09-21 18:02:52 -05:00
mjn-mixael 3a171493b0 Cleanup 2022-09-21 17:29:20 -05:00
mjn-mixael 655fe8d7f1 Loadout wing API (+4 squashed commit)
Squashed commit:

[83e8522d1] Comments

[50686ce6a] Wing Slot data

[450a0f6e1] Common Init

[0c603313e] Rough in WIP
2022-09-21 17:27:38 -05:00
wookieejedi 0c2a6a4f28 Fix multi lib (#4692)
Just adding 1 missing include
2022-09-21 22:08:38 +00:00
MjnMixael 3d700589c5 Give Lua access to the select anims and images (#4687) 2022-09-22 05:31:24 +09:00
EatThePath 33f24f1b4d -luadev flag and lua log filter (#4681)
* Adds new default 'lua' filter category for all lua errors and output
Adds -luadev flag that currently only makes lua errors non-fatal.

* Correcting unreachable code.

* Missed a halting code path for luadevmode

* comment fix
2022-09-22 05:31:06 +09:00
Goober5000 5e3f72229c Merge pull request #4684 from Goober5000/set_and_get_ship_flags
add setFlag and getFlag for ships and parse objects
2022-09-21 12:39:00 -04:00
Goober5000 544234743e update ship flags 2022-09-21 08:43:29 -04:00
Goober5000 fdb5506d41 make autodoc happy 2022-09-20 20:16:54 -04:00
Goober5000 7ff6da8b8b Merge pull request #4664 from Goober5000/script_model_queue_render
use queued rendering instead of immediate rendering for scripts
2022-09-20 20:09:34 -04:00
Goober5000 ce4563867d Merge pull request #4682 from MjnMixael/MissionTime
Mission time
2022-09-20 20:09:25 -04:00
Goober5000 9c71a3a1a0 allow an arbitrary number of flag arguments 2022-09-20 20:06:11 -04:00
MjnMixael eddda373d3 Allow API to optionally not start the next mission. (#4679)
* Allow API to optionally not start the next mission.

* false -> true
2022-09-21 08:16:04 +09:00
Joshua Glatt 86f458f01a Allow modifying map container data when the map is an argument (#4683)
* allow modifying map container data when the map is an argument

* skip past an invalid map key, avoid infinite loop
2022-09-21 08:11:17 +09:00
wookieejedi 7926366ee6 Update max priority for scripting AIgoals (#4685) 2022-09-20 19:09:16 -04:00
MjnMixael 710d7a614c These go here (#4689) 2022-09-21 08:08:47 +09:00
Goober5000 a379411d7a add ParsedShips indexer and update terminology 2022-09-20 16:08:43 -04:00
Goober5000 35abc3e3f5 Merge pull request #4688 from Goober5000/hud_gauge_fix
fix cargo scan type parsing
2022-09-20 15:18:04 -04:00
Goober5000 a89ba892a2 add setFlag and getFlag for ships and parse objects
This mirrors alter-ship-flag and are-ship-flags-set.
2022-09-20 14:43:24 -04:00
Goober5000 d1ba57bc23 fix cargo scan type parsing
Because of idiosyncrasies of `required_string_one_of`, use a different technique.
2022-09-20 14:16:04 -04:00
mjn-mixael 931cfdebb0 explicit bool 2022-09-19 20:34:10 -05:00
mjn-mixael f7b19553c8 nullptr while I'm here 2022-09-19 19:36:11 -05:00
mjn-mixael 6579719a04 documentation 2022-09-19 19:17:34 -05:00
mjn-mixael 68f03b5328 Add isInMission and always return getMissionTime 2022-09-19 19:05:54 -05:00
Goober5000 7fea61f618 Merge pull request #4669 from TRBlount/feature/movie_alpha
Allow movies to be alpha blended through the LUA Movie Player API
2022-09-19 18:50:20 -04:00
Goober5000 91d8031c32 Merge pull request #4677 from BMagnu/absolute_translation
Add Absolute Translation
2022-09-19 18:50:12 -04:00
wookieejedi 7b3705ad61 Fix VS Warning (#4676)
* Fix VS Warning

If this is trivial and not needed feel free to dismiss, but this one-line PR simply fixes a warning that keeps showing up when building with VS.

* individually cast

* cleaner fix
2022-09-19 17:40:35 -04:00
Goober5000 9a2a85198a Merge pull request #4680 from MjnMixael/ReverseHasDebriefing
This needs to be reversed to return the expected value
2022-09-19 17:25:06 -04:00
mjn-mixael cbd3d7da24 This needs to be reversed to return the expected value 2022-09-19 15:26:09 -05:00
JohnAFernandez 54f030ae6c Merge pull request #4671 from Goober5000/custom_hud_scan
add -dualscanlines as a HUD config option
2022-09-19 13:26:19 -04:00
Goober5000 be31334212 Merge pull request #4675 from MjnMixael/FixScramble
Fix returning int when bool expected in API
2022-09-19 11:50:40 -04:00
mjn-mixael 41dd60d111 Fix returning int when bool expected 2022-09-19 08:48:17 -05:00
BMagnu e88b898839 Add absolute translation 2022-09-19 11:57:40 +02:00
Goober5000 94fe34f619 a couple of animation fixes (#4673)
Done at Lafiel's direction.
2022-09-18 23:08:19 +00:00
Goober5000 56803e7c9f Merge pull request #4615 from MjnMixael/ScpuiDebriefingLibrary
Scpui API debriefing library
2022-09-18 18:36:33 -04:00
Goober5000 7a8b8d5fdc Merge pull request #4667 from BMagnu/seamless_anim_flag
Flag for seamless animations with startup period
2022-09-18 18:36:11 -04:00
Goober5000 782600ba7a Merge pull request #4663 from Goober5000/lighting_followup
lighting followup
2022-09-18 04:41:34 -04:00
Goober5000 36972b35f5 Merge pull request #4668 from Goober5000/stop_looping_animation
add stopLoopingSubmodelAnimation
2022-09-18 04:41:24 -04:00
Birk Magnussen cc027a91fc Incorporate Feedback 2022-09-18 10:23:15 +02:00
Goober5000 222a75f3e6 semi-deprecate dualscanlines, and put the default option in the 'else' block 2022-09-18 02:13:11 -04:00
Asteroth 5823c5f4b5 add disco scan lines 2022-09-18 01:41:14 -04:00
Goober5000 4c16c95b9b add -dualscanlines as a HUD config option
Allow different types of cargo scans, including the -dualscanline behavior, to be specified in the HUD gauges table.  Right now the options are "default" and "dualscanlines".
2022-09-18 00:50:28 -04:00
mjn-mixael ac82d8349c Virtvar -> Func 2022-09-17 22:24:48 -05:00
Tyler Blount 2f0a15da28 Remove alpha conditional check in VideoPresenter 2022-09-17 17:02:35 -07:00
Tyler Blount 0d78538a91 Update video shader and add alpha controls to VideoPresenter API 2022-09-17 15:53:04 -07:00
Goober5000 1e0845ca5e Merge pull request #4661 from scp-fs2open/dependabot/pip/ci/post/mako-1.2.2
Bump mako from 1.1.5 to 1.2.2 in /ci/post
2022-09-17 18:47:39 -04:00
Goober5000 6d204a7bc5 lighting followup
Two small fixes to follow up the lighting PRs

1) Change the mprintf to a Warning, both to be consistent with other deprecation warnings and to notify modders that they might need to accommodate the new lighting system
2) Parse any leftover data so that legacy tables don't cause FSO to choke on parsing
2022-09-17 18:43:36 -04:00
Goober5000 622c99fa2f add stopLoopingSubmodelAnimation
A script command to mirror the SEXP operator.
2022-09-17 17:45:28 -04:00
Goober5000 aafa386f22 Merge pull request #4237 from TheForce172/fix/shipEditorCleanup
QTFRED: Ship Editor Cleanup 2
2022-09-17 16:51:41 -04:00
Goober5000 29f1280df7 Merge pull request #4336 from virusman/pr/mac-release-builds
Add release CI config for Mac
2022-09-17 16:43:50 -04:00
BMagnu 5593bd168d Add optional deferred lighting pass for cockpits (#3445)
* Add deferred cockpit lighting

* Put deferred Cockpits behind a flag

* (hopefully) fix bad in-case initializer

* clear non base color buffer in subsequent deferred passes

* Proper deferred Cockpit rendering

* undo whitespace changes
2022-09-17 15:29:35 -04:00
Goober5000 b14db41126 Merge pull request #4647 from Goober5000/frame_debug_tweak
better adjustment of timestamp delta
2022-09-16 22:20:55 -04:00
Goober5000 85c1ae1f4b use queued rendering instead of immediate rendering for scripts
Scripts that render models in the On Object Render hook were effectively doing immediate renders in the middle of queued renders.  This caused some data, such as model orientation, to 'leak' between renders.  It might also have something to do with why the bug in #4637 had the particular graphical side effects that it did.

Anyway, changing the immediate renders to queued renders fixes the leaky orientations, and is probably a good upgrade for other reasons as well.
2022-09-16 17:27:50 -04:00
wookieejedi ad817795e2 Fix smart spawn flag (#4662)
Courtesy of Lafiel, this code fixes special flags such as those related to `spawn`. (Bug arose in #4620).

Tested and fixes the problem and works as expected.
2022-09-16 20:46:16 +00:00
Birk Magnussen 2a8ee1f80b Properly set flag 2022-09-16 21:43:34 +02:00
dependabot[bot] 1b82c101f6 Bump mako from 1.1.5 to 1.2.2 in /ci/post
Bumps [mako](https://github.com/sqlalchemy/mako) from 1.1.5 to 1.2.2.
- [Release notes](https://github.com/sqlalchemy/mako/releases)
- [Changelog](https://github.com/sqlalchemy/mako/blob/main/CHANGES)
- [Commits](https://github.com/sqlalchemy/mako/commits)

---
updated-dependencies:
- dependency-name: mako
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-09-16 19:03:37 +00:00
BMagnu 7d42bf08a6 Fix Animation 3D Sound (#4658)
* Add options to enable animation sound to actually be 3D

* Fix typo

* Fix objnum valid check
2022-09-16 14:35:10 -04:00
mjn-mixael 8d8cf0a41c Prevent multiple instances of evaluated debrief sexps 2022-09-16 12:44:10 -05:00
Fabian Woltermann ef496f08e0 Merge pull request #4657 from Goober5000/4602_followup
additional polishing of the briefing API
2022-09-16 15:47:49 +02:00
BMagnu 47b5bc6b64 Add flag safeguard 2022-09-16 13:38:15 +02:00
BMagnu 3f3ff4f685 Add Seamless with startup animation mode 2022-09-16 13:15:07 +02:00
BMagnu dc320d0768 Add special flag to animations 2022-09-16 11:36:00 +02:00
Goober5000 c9ca58f504 update 2022-09-15 20:09:55 -04:00
BMagnu cf8f90e93d Properly encapsulate special flag parsing (#4620)
* properly encapsulate special flag parsing

* Cleanup Cpp11 mess

* Fix missing include in vmallocator.h

* Fix bad merge

* address feedback
2022-09-16 07:39:45 +09:00
Goober5000 06fc8c73a5 this flag deserves its own commit 2022-09-15 18:38:57 -04:00
Goober5000 d92496ee02 convert event-related timestamps to new system
This change covers just the timestamps associated with goals and events, for better review and isolation purposes.

Follow-up to #4569.
2022-09-15 18:38:53 -04:00
Goober5000 c13e262bb8 Merge pull request #4640 from Goober5000/hud_scripting_enhancements
several minor HUD enhancements
2022-09-15 18:34:36 -04:00
Fabian Woltermann 8d93276423 Merge pull request #4654 from qazwsxal/light-power-fix
Light power fix
2022-09-15 20:08:58 +02:00
Fabian Woltermann 69915a1364 Merge pull request #4653 from qazwsxal/thicc_lights
Improved beam, blob and warp lighting
2022-09-15 20:07:53 +02:00
Fabian Woltermann 179f0c0f47 Merge pull request #4659 from qazwsxal/fix/sim_room_fix
Fix retail UI crash when campaign missions are selected in simulator
2022-09-15 19:09:58 +02:00
Adam Leach 5254a5867d keep MSVC happy 2022-09-15 17:51:02 +01:00
Adam Leach 2a4b5b0dee Remove duplicate. 2022-09-15 17:49:22 +01:00
David Gibson fea116ea82 fix ambient lighting to match 2022-09-15 17:47:25 +01:00
David Gibson b6bc5175da Add default brightness profile adjust and retune the techroom rendering appropriately. 2022-09-15 17:47:25 +01:00
David Gibson 02ebdd50d0 Switched to default size zero light emitters 2022-09-15 17:47:00 +01:00
David Gibson c5800b722d Adding configurable source radius to the lighting data and uniforms 2022-09-15 17:46:42 +01:00
Adam Leach 0eb5197ecd Fixes retail UI crash when campaign missions are selected in simulator 2022-09-15 17:35:13 +01:00
David Gibson cf0a785029 adjusted the width of beam light cores 2022-09-15 17:04:25 +01:00
Adam Leach a9a9c89c98 Actually fix lighting error (and document) 2022-09-15 17:04:25 +01:00
Adam Leach f9424a1b88 Factor out spherelight calcs, fix lighting error when inside spherelight 2022-09-15 17:04:25 +01:00
Adam Leach b0467d0697 Clamp beam length to prevent light from going past start/end points. 2022-09-15 17:04:25 +01:00
David Gibson d93e6cf752 Adjusted fireball sizing 2022-09-15 17:04:25 +01:00
David Gibson e00635d430 Switched to default size zero light emitters 2022-09-15 17:04:25 +01:00
David Gibson 413e817733 Attached reasonabled defaults to the new source radius settings 2022-09-15 17:04:25 +01:00
David Gibson e37427a24b Adding configurable source radius to the lighting data and uniforms 2022-09-15 17:04:25 +01:00
Adam Leach 30d534fe32 Documentation and a small optimisation. 2022-09-15 17:04:25 +01:00
Adam Leach b77b820aa2 Initial work for lights with adjustable emitter size and tube rendering. 2022-09-15 17:04:25 +01:00
mjn-mixael ce9dd1eaf3 cleanup includes 2022-09-15 10:41:57 -05:00
Fabian Woltermann 6c83a72403 Merge pull request #4652 from qazwsxal/qaz-shaders
Improved shaders and image based lighting
2022-09-15 17:39:07 +02:00
mjn-mixael 54b6efcf25 Address feedback 2022-09-15 10:27:45 -05:00
mjn-mixael 925aa44ebb Compare pointer to nullptr instead of 0 2022-09-15 10:27:42 -05:00
mjn-mixael f0f23b5fd0 Address feedback 2022-09-15 10:27:38 -05:00
mjn-mixael 7d77b8ebc0 Return this exactly to previous state 2022-09-15 10:27:35 -05:00
mjn-mixael 6f0f3a10eb Address feedback 2022-09-15 10:27:31 -05:00
mjn-mixael f011e59d61 Remove unreachable code 2022-09-15 10:27:22 -05:00
mjn-mixael d718c76906 Some cleanup 2022-09-15 10:27:21 -05:00
Mike N 895d4dce1a debriefing api access 2022-09-15 10:27:19 -05:00
Goober5000 e146a24f9e additional polishing of the briefing API
Follow-up to #4602.  Overall the PR was good, but there are a few extra small changes that should go in. In order of priority:

1) The `exitLoop`, `skipMission`, and `skipTraining` functions should check for campaign mode.
2) The `isVisible` virtvar should be changed to a function, because calling it may have side effects.  In standard usage, the briefing formula is evaluated exactly once per stage on briefing initialization, so scripts should follow this convention.
3) The `hasGoalsSlide` function should be called `hasGoalsStage`, because "stage" is the common terminology in FSO.
4) Paging out mission messages is already done in `game_level_close` and should be removed from not only the scripting method but the method it was based on.
5) For consistency, unused parameters should use the `SCP_UNUSED` macro.
6) The `isTraining` flag check can be slightly streamlined using the double-not trick.
2022-09-15 11:20:00 -04:00
EatThePath c66f90b46d Implemented a command line flag that forces a fixed RNG seed, (#4599)
* Implemented a command line flag that forces a fixed RNG seed, which reseeds the RNG on every mission load.

* Naming changes and bounds checking
2022-09-15 22:30:26 +09:00
Adam Leach d4ad137251 Converted warning to log message as the data is just ignored 2022-09-15 13:21:11 +01:00
Adam Leach 1e695cf807 Merge branch 'master' into qaz-shaders 2022-09-15 10:18:03 +01:00
Goober5000 850f2904dc Merge pull request #4603 from Goober5000/timestamp_migration_2
more timestamp migration
2022-09-15 02:01:19 -04:00
Goober5000 086e386b75 Merge pull request #4655 from Goober5000/improve_huge_fire_info_lookup
improve huge_fire_info lookup
2022-09-14 22:32:09 -04:00
EatThePath 452f554193 Crossing the specular rubicon (#4302)
* Applying directional brightness profile value, disconnected spec flags and made specular light always equal to diffuse light

* Switched over to new command line arguments

* Wire lab up to new lighting controls, and provide backwards-compatible defaults for emissive.

* cleanup unused new function

* make static some functions that can be static

* revise command-line and emissive handling

* handled specular sun depreciation and general removal of specular value handling

* Removed specular light color as a separate value in the uniform buffers.

* cleanup of leftover/post-rebase specular references

* further post-rebase repair of light flags command line and leftover specular

* move techroom/selection/breifing 'room' lights to a common function and
augment lighting setup for current rendering

* fixed some mishandling of lighting modifiers.

* Addressed code clarity and comments from review
2022-09-15 05:47:58 +09:00
Goober5000 15dc0aba77 improve huge_fire_info lookup
According to EatThePath's frame profiling, this one ship name lookup takes 2% of the frame time.  It can be easily optimized by making use of the ship registry.
2022-09-14 14:39:32 -04:00
Adam Leach 9cccab3f18 unused var check 2022-09-14 17:54:05 +01:00
Adam Leach 36a714b93f Merge branch 'master' into qaz-shaders 2022-09-14 16:56:57 +01:00
MjnMixael 70609bb3b9 Cleanup Fiction, Red Alert, and Loop Brief based on feedback on other PRs (#4649) 2022-09-14 16:01:57 +09:00
BMagnu 10a47781a0 Change cmd_briefing API to reference from copy (#4646) 2022-09-14 16:01:42 +09:00
MjnMixael ff55a39dd4 Scripting functions required for SCPUI conversion of all four Tech Room UIs (#4591)
* Documentation (+6 squashed commit)

Squashed commit:

[ea8550b54] Resolve errors

[9ab0a576d] Add way to count number of elements in the arrays

[eb74146cc] Correct this boolean check

[60fbc6008] Missed one

[78e65a4b7] Avoid naming collision

[4ea5ddead] Clean unneeded log print and compare like variables

* Adding simulator room here seems like a pretty safe option

* Scpui API to access to build the tech room cutscene list and a few methods to help playing the cutscene and return to the menu accurately

* Scpui API access for credits related data

* # This is a combination of 7 commits.

Clean unneeded log print and compare like variables

Avoid naming collision

Missed one

Correct this boolean check

Add way to count number of elements in the arrays

Resolve errors

Documentation

* Address feedback

* Address feedback

* Add virtvar isCampaignMission
2022-09-14 16:01:34 +09:00
Goober5000 ae57ea7158 Merge pull request #4643 from Goober5000/small_hook_refactor
small hook refactor
2022-09-13 18:24:45 -04:00
MjnMixael ef85e94e40 SCPUI API elements required for the Briefing (#4602)
* API elements required for the Briefing

* Resolve errors

* Check if the mission is a Scramble mission

* Add one missed flag check

* Slight API naming adjustment

* Address feedback

* Address Feedback again

* Differentiate var names
2022-09-14 04:39:20 +09:00
Goober5000 258e735af2 better adjustment of timestamp delta
When debugging, don't adjust the timestamp by the exact difference, since that would make the frametime 0 and cause div-0 errors.  Instead pretend that the previous frame was a reasonable duration.  Also, perform the timestamp check separately from the frametime check, since they are not always consistent.
2022-09-12 21:22:56 -04:00
Goober5000 19f193f533 Merge pull request #4644 from Goober5000/remove_asserts
remove two unnecessary asserts
2022-09-12 15:56:51 -04:00
wookieejedi d5eca2fab1 Auto Truncate default ship names (#4642)
* Auto Truncate default ship names

Previously, placing a ship that had a long class name might create a default name that was too long and thus trigger a buffer overflow assert.

Such behavior was confusing if someone was just placing things in FRED and not sure at all what happened or how to fix it.

This PR replaces the assert with code to auto truncate the ship class part of the name to ensure that the default name will fit into the designated size.

* change var name
2022-09-12 13:26:53 -04:00
Goober5000 f932c2da6a Merge pull request #4645 from Goober5000/fix_4637
fix script conditions for ships
2022-09-12 03:09:25 -04:00
BMagnu 14f94eb34f Add Angle SEXPs (#4641)
* Add angle SEXPs

* Convert to Degrees
2022-09-12 15:11:57 +09:00
Goober5000 4be8851c16 fix script conditions for ships
Like #4559 before it for weapons, this fixes the script conditions for ships.  The problem was the same: the script condition would evaluate to true if none of the objects under consideration were ships.  The fix is the same as well.  I checked all the other script condition categories, so no similar bugs should pop up in the future.

Fixes #4637.
2022-09-12 00:05:24 -04:00
Goober5000 5e4abb30a3 remove two unnecessary asserts
It's not necessary here to assert on the correct variable type, as having the wrong type here won't cause the code to break.  More importantly, the error will have been flagged before this point anyway, and this code is used for formatting the SEXP to be displayed in an error message.  It's not helpful to pre-empt an error message with an assert.
2022-09-11 23:21:16 -04:00
wookieejedi f2dd37fab3 Allow Autotarget to target new target when current target is deathrolling (#4638)
Discussion starts here: https://discord.com/channels/223511295431933953/722747742996267068/1018264927699476571
2022-09-11 22:29:56 -04:00
Goober5000 974981520d change names 2022-09-11 22:25:57 -04:00
Goober5000 46bd9ecae8 fred and qtfred 2022-09-11 22:24:25 -04:00
Goober5000 9fcf17b9e6 better distinguish between builtin and custom hud gauges, and allow both when the functions can handle it 2022-09-11 22:09:24 -04:00
Goober5000 9056a9c89b partial revert of 2e839eda0; these sexps need to get any gauge, not just the custom ones 2022-09-11 21:16:50 -04:00
Goober5000 0480fa69d9 several minor HUD enhancements
add `getDirectiveLines` and `setPosition` script functions
properly error if trying to set a HUD gauge name
remove the unneeded `Directive_frames_loaded` variable
improve accuracy of SEXP help for HUD gauge operators
2022-09-11 21:16:50 -04:00
virusman 288e3b86d1 Add release CI config for Mac 2022-09-11 16:03:55 -07:00
Goober5000 8bc4064670 small hook refactor
Basically just changing some parameter names.
2022-09-11 15:07:17 -04:00
Goober5000 9e6e95108d Merge pull request #4636 from Goober5000/fix_4635
properly account for string sizes in debrief_choose_voice
2022-09-11 13:00:29 -04:00
wookieejedi 375ccd7413 Fix conditional for Always_warn_player_about_unbound_keys (#4639)
Properly check if mission is singleplayer for the `Always_warn_player_about_unbound_keys` game option.
2022-09-11 11:17:00 -04:00
Kiloku d0c76a7eaa New options for lead indicators (#4411)
* Adds Lead Indicator Behavior option to game_settings.tbl

* Adds dont merge lead indicators flag to weapons, allowing homing secondaries to have their own lead indicators no matter what.

* Removed unused variable that was added just for testing

* add explicit int to float conversion to appease build checks

* Move some things around to avoid potentially undefined values

* Clean-up + address feedback

* Remove redundancy
2022-09-11 23:57:40 +09:00
Goober5000 7462dd68f8 fix subtitle clipping (#4625)
For subtitles drawn using the `$Show-subtitle base resolution:` feature, text near the side of the screen would get clipped off mysteriously.  The clipping corresponded precisely to the edge of a 4:3 boundary, which led me to discover that the clip boundary was still at the side of a 4:3 box, rather than a 16:10 box as was expected.  Explicitly setting the clip boundary when setting the screen scale fixed the issue.

For any graphics coders in the know, is this actually the proper fix?
2022-09-11 20:00:54 +09:00
Fabian Woltermann 9ba91d870c Merge pull request #4632 from The-E/fix/4614_demotion_went_too_far
Fix issue with new pilots getting demoted too fast
2022-09-10 21:15:05 +02:00
Asteroth ef57ffc2f4 Add maneuvering thruster easing (#4623)
some thruster and comment clean up, and thruster easing
2022-09-09 18:36:04 -05:00
Goober5000 1509448a34 properly account for string sizes in debrief_choose_voice
The null terminator was written past the end of the string buffer, which intruded on the next field in the struct.  Fixing this fixes #4635.  Also adjust the string concatenation a couple lines up because it could also write past the end of the buffer.
2022-09-09 12:07:07 -04:00
EatThePath bb232382cf Merge pull request #4528 from MageKing17/feature/default-shockwave-damage-types
Add default shockwave damage types functionality.
2022-09-09 09:53:30 -05:00
Fabian Woltermann e21dfcb457 when resetting stats before replaying a mission, check the rank table to see which rank the player should be 2022-09-08 19:17:47 +02:00
Goober5000 ae3fb54c02 add more timestamp documentation 2022-09-08 02:42:38 -04:00
Goober5000 16a8a46f42 Merge pull request #4579 from MjnMixael/RenderWeaponTechModel
Implement renderTechModel() and renderTechModel2() for weapons
2022-09-07 20:09:06 -04:00
Goober5000 9cb2892ca9 Merge pull request #4629 from Goober5000/script_interpolate_matrices
rotational interpolation
2022-09-07 16:48:26 -04:00
Fabian Woltermann c9c4632a87 Merge pull request #4631 from The-E/fix/lab_crash_when_destroying_dead_ship
Fix lab crash when destroying a destroyed ship
2022-09-07 19:29:43 +02:00
Fabian Woltermann f2abe516f3 check if the current lab object is actually a ship before trying to destroy it 2022-09-07 18:54:05 +02:00
Asteroth cb7d117bdf Automatic thruster activation (#4617)
* automatic thruster activation and glide thruster activation

* finalizing tweaks

* fixes

* whoops
2022-09-07 18:36:37 +09:00
Asteroth de503bb2d5 small fix for banking (#4624) 2022-09-07 18:35:30 +09:00
Goober5000 39b57cbf41 rotational interpolation
Add script support for rotational interpolation of matrixes (orientations) and vectors.
2022-09-06 21:48:03 -04:00
Goober5000 66473f03ab Merge pull request #4621 from Goober5000/fix_supercap_warpout
fix supercap immediate warpout
2022-09-06 18:20:15 -04:00
MageKing17 dbd3721b00 Default-enable inheriting damage type in mods targeting 22.4+. 2022-09-06 13:04:44 -07:00
BMagnu 565047e93b Implement a proper std::optional alternative (#4619)
* Add optional lib

* Replace modelreplace optionals

* Replace Animation Optional

* rework modelanimationdata constructors
2022-09-06 17:05:05 +09:00
BMagnu ee4d74a1af Prevent closed thread from re-closing (#4622) 2022-09-06 03:17:13 +00:00
JohnAFernandez f2038a8a1a Merge pull request #4613 from JohnAFernandez/Add-Interpolate-Matrices-For-Multi
Add interpolate matrices for multi
2022-09-05 19:40:36 -04:00
John Fernandez a93eeebff0 Fixes for Matrix interp 2022-09-05 19:05:12 -04:00
Goober5000 5d57da1755 fix supercap immediate warpout
Supercaps have a special physics flag applied when they warp in so that they slow down quickly.  However, if a supercap immediately warps out again - as in Deus Ex Machina and DEM: Interlude - this physics flag will interfere with the process so that the ship doesn't accelerate immediately even though the warpout portal is opening.  This will cause the ship to miss the portal and clip off a section.  The solution is to clear the flag once the warpout process starts.
2022-09-05 16:35:03 -04:00
Goober5000 fe44dda809 Merge pull request #4521 from Goober5000/end_of_mission_cutscene
mission-specific cutscene enhancements
2022-09-05 04:51:15 -04:00
Goober5000 3da5910c23 Merge pull request #4618 from Goober5000/object_radius
add Radius virtvar for objects
2022-09-05 04:25:22 -04:00
Goober5000 268a483bdb add Radius virtvar for objects
Surprised it hasn't been added before now.
2022-09-05 01:31:18 -04:00
Asteroth 6440c64b77 Fix cfread string's handling of null terminated strings (#4583)
* fix cfread string's handling of null terminated strings

* clarity and doc edits
2022-09-05 04:15:50 +09:00
BMagnu 2a2ed22e5b Enable LuaAI to use more arguments (#4577)
* Enhance LuaAI args

* Pass the Lua Parameters

* Cleanup debugging comment

* Fix warnings
2022-09-03 22:31:52 +09:00
PhantomHoover 402ee8636e Remove unused and costly checksum during model read (#4592)
Profiling shows this taking about 10% of the total time in loading BP's Icarus mission, and the result isn't even read any more!
2022-09-03 22:16:50 +09:00
BMagnu 74ba7899fd Virtual / Modular POFs (#4590)
* Integrate Barebones Framework

* further integration

* Add brak in read

* Defer subsystem generation

* Unentangle pof parsing and subsystem info writing

* finalize modelreplace skeleton

* Begin submodel copying

* First prototype of modular pofs demonstratable

* Allow Submodel Renaming

* Add copy children and set offset

* properly handle depth

* Add header modification

* Fix issues with parsing

* Fix Warnings

* incorporate feedback

* de std-ify

* Incorporate Feedback 2

* Fix macro

* Remove ref

* Enhance error messages
2022-09-03 22:15:56 +09:00
Goober5000 bc5ee36bd8 Merge pull request #4552 from Goober5000/additional_shudder_support
enhanced control for the global ship shudder
2022-09-03 00:12:42 -04:00
naomimyselfandi a8c8549015 Respect hashes in ship and wing names in the loadout screen (#4609)
* Respect hashes in ship and wing names in the loadout screen

* Use get_display_name()
2022-09-02 08:36:07 -04:00
naomimyselfandi 89dc0c66dc Allow assigning support ship per species (#4608)
* Allow assigning support ship per species

* Respond to PR feedback
2022-09-02 08:15:26 -04:00
Kiloku 05495cd1bc Add optional Drop Shadows to HUD (#4543)
* Add drop shadows to HUD text

* Add drop shadow to reticle

* Add control to toggle Drop Shadows

* Double render reticle shadows

* Use gauge_color instead of creating a temp var

* Add shadows to ETS gauges

* Set shadow default to false and adjust formatting

* Restore numbering for controlsconfig
2022-09-01 22:06:00 -04:00
wookieejedi d905410591 Allow mods to change Emp flash color, intensity, and string (#4607)
* Allow mods to change Emp flash color, intensity, and string

EMP is the only text warning that does not use an entry in the strings table (and thus it's the only text warning gauge that mods cannot change and/or translate). This PR adds a string entry for it to allow mods to translate and change the string like all other HUD gauge text warnings.

Also, EMP flash has a hard coded color and strength factor for the flash, whereas generic pain and shield pain have a configurable flash strength factor (shield pain flash is based on shield color, while generic pain is based on damage dealt). This PR also allows modders to change the strength intensity and color following previously established methods.

This PR also fixes a case of "Launch" that fell through the cracks. The function is supplied the translated string, but within the function it does not check for the translation.

Everything is tested and works as expected.

* incorporate feedback

* convert to float during parse

* incorporate more feedback

* improve safety checks
2022-09-01 21:31:16 -04:00
Fabian Woltermann 9a5e34b546 Merge pull request #4612 from The-E/fix/4604-defer_adding_hooks_until_safe
defer adding new scripting hooks until after hook processing is done
2022-09-01 19:03:24 +02:00
Fabian Woltermann a1b48d0a9e defer adding new scripting hooks until after hook processing is done 2022-09-01 18:30:48 +02:00
Taylor Richards bb06c75cb4 handle irc motd error to prevent connection hang (#4610)
A MOTD missing (422) message is non-fatal and should be handled the
same as a MOTD end (376) message to prevent the chat connection
process from hanging.
2022-09-01 05:57:01 -04:00
Taylor Richards ea2d9d9167 prepend PXO game identity to chat lobby window (#4606)
For help with troubleshooting, list what game/mod PXO identifies
this instance is running in the chat lobby stream.
2022-09-01 05:56:24 -04:00
John Fernandez 5d267307b2 Change last orient to sensible value
Previously this could be set to bad data, since the last orient calculated could be based on stale data.
2022-08-31 15:54:56 -04:00
John Fernandez dc625bca33 Change to interpolating matrices
Should create a steadier interpolation
2022-08-31 13:33:25 -04:00
John FernandezandAsteroth 2b0f35b58b Add an explicit Interpolate Matrices function
Written by Asteroth, derived from our ai code.  I added a couple safety checks and changed the type to void to match our library.

Co-Authored-By: Asteroth <[email protected]>
2022-08-31 13:33:25 -04:00
Asteroth a9b485da3d associate a single version to submodel translation (#4605) 2022-08-31 01:13:11 -04:00
MjnMixael ebc8ebd638 Add $Mod Title and $Mod Version options to game_settings.tbl (#4565)
* Add $Mod Title and $Mod Version options to game_settings.tbl for mainhall and Lua use

* Fix comparison

* documentation

* address feedback

* typo
2022-08-30 10:57:06 -04:00
Goober5000 ba82e4ef57 Merge pull request #4582 from Goober5000/model_translation
Model translation
2022-08-29 12:46:28 -04:00
Goober5000 6c7c093729 some more timestamps 2022-08-29 10:42:03 -04:00
Goober5000 3d74bac90b more timestamp migration
More conversion of timestamps to the new system.  Follow-up to #4569.
2022-08-29 09:27:30 -04:00
Goober5000 74ab0f7878 Merge pull request #4601 from Goober5000/good_rearm_time_fix
fix good-rearm-time bug
2022-08-29 00:59:56 -04:00
Goober5000 ef4c3984b5 fix good-rearm-time bug
The original implementation of `ai_good_time_to_rearm` did not revert to being a "bad" time to rearm when the time was up.  This fixes that and adds an AI profiles flag to toggle it.

Also converts `ai_rearm_timestamp` to use the new TIMESTAMP type.
2022-08-29 00:00:15 -04:00
JohnAFernandez 51ca0d20ee Merge pull request #4600 from MjnMixael/ColorTagFix
This should be func not virtvar
2022-08-28 18:17:22 -04:00
Goober5000 41d2cdc82c Merge pull request #4569 from Goober5000/asteroid_debris_timestamps
convert some timestamps to the new system
2022-08-28 17:44:41 -04:00
mjn-mixael 63d4a7ce8c This should be func not virtvar 2022-08-28 14:52:31 -05:00
MjnMixael 6425a999a6 Some User Interface API cleanup and generalization (#4595)
* Move colors up one level and generalize

* Initialize this first

* These are common to both all Briefings, so put them in the general Briefing category
2022-08-28 14:27:17 -04:00
MjnMixael be00e257b8 Scripting functions required for SCPUI conversion of Red Alert (#4587)
* Scripting functions required for SCPUI conversion of Red Alert

* Correct documenation

* Address feedback

* Missed return

* Briefings
2022-08-28 13:18:12 -04:00
wookieejedi 650ae9a074 Some extra safety checks for fiction viewer scripts (#4598)
Protects `Fiction_viewer_active_stage` if it reads a stage of -1 (it would have thrown a vector access error because the index is out of range). Also, given a lot of other scripting functions have additional built in error checks, I just added those to the fiction viewer functions.
2022-08-28 09:11:57 -04:00
MjnMixael 60509b2c3c Scripting functions required for SCPUI conversion of Loop Brief. (#4586)
* Scripting functions required for SCPUI conversion of Loop Brief.

* nullptr

* Fix documentation and make setting choice optional, defaulting to false.

* Documetation fix
2022-08-28 08:52:41 -04:00
Goober5000 67729990e3 we don't need to bump the multi version yet 2022-08-27 13:10:05 -04:00
Goober5000 9116f5de2d improve API 2022-08-27 13:10:05 -04:00
Goober5000 018363dac6 edit lab flag 2022-08-27 13:10:05 -04:00
Goober5000 662d71a57a add model animation support, based on Lafiel's guidance 2022-08-27 13:10:05 -04:00
Goober5000 d3807cbd08 add subsystem sexps 2022-08-27 13:10:05 -04:00
Goober5000 5cf412aad8 implement stepped and regular translation as controlled by subsystems 2022-08-27 13:10:05 -04:00
Goober5000 a1215c6d6f infrastructure for handling submodel translations - maintaining, colliding, rendering 2022-08-27 13:10:05 -04:00
Goober5000 d25a477ffc Merge pull request #4560 from Goober5000/floating_point_followup
floating-point followup
2022-08-27 13:00:43 -04:00
MjnMixaelandAsteroth 150608a980 Base method to determine Debug vs Release (#4597)
* Base method to determine Debug vs Release

* small spelling fix

Co-authored-by: Asteroth <[email protected]>
2022-08-27 11:42:06 -04:00
wookieejedi 1df396bbf4 Allow test_line_of_sight to return intersecting object signature (#4596)
* Allow `test_line_of_sight` to return intersecting object signature

The `test_line_of_sight` can currently provide the closest intersecting distance, but it would be very useful, especially for AI scripting, if this function could also return the signature of the intersecting object. This PR adds that functionality.

Tested and works as expected. Happy to discuss strategies for changing implementation, too. The extra, third return value for object signature was added to `getLineOfSightFirstIntersect` function because that function already returns 2 values. Thus, it will remain compatible with older scripts which only save the first 2 returned values.

* fix documentation

* fix typo

* return object instead of sig

* fix pointer

* use pointer pointer for full fix

* name clarification
2022-08-26 23:05:07 -04:00
MjnMixael a884633723 Fix documentation (#4594) 2022-08-26 23:03:54 -04:00
mjn-mixael 762d855e99 Implement renderTechModel() and renderTechModel2() for weapons 2022-08-26 12:21:40 -05:00
Goober5000 19e407df62 convert some timestamps to the new system
Mostly debris and asteroid timestamps, but also arc timestamps for ships.
2022-08-25 21:40:18 -04:00
Goober5000 8c47a03df9 Merge pull request #4469 from Goober5000/more_voice_acting_buttons
Voice acting manager enhancements
2022-08-25 21:37:55 -04:00
Goober5000 4dfb29f9d8 adjust MOI values per feedback 2022-08-25 21:36:40 -04:00
Goober5000 e67ea63121 use std::max 2022-08-25 21:36:40 -04:00
Goober5000 60540d2a57 floating-point followup
Floating-point comparisons are tricky beasts.  See this article for a good summary of the issues involved:
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/

This PR improves support somewhat, although there are obviously situations in the code (such as comparisons to 0) that should still be addressed.  This PR makes the following improvements:
1) Tightens the threshold on `IS_VEC_NULL` and `IS_VEC_NULL_SQ_SAFE` from 1e-16 and 1e-36 to FLT_EPSILON
2) Tightens the threshold for parsing `turn_time` in POFs
3) Restores the previous implementation of `fl_equal`
4) Adds a dedicated `IS_MOI_VEC_NULL` for moment of inertia values
5) Improves documentation

Follow-up to #4535 and #4443.
2022-08-25 21:36:40 -04:00
Goober5000 a1f58671e5 enhanced control for the global ship shudder
Allow the variables controlling ship shudder to be independently set using scripting.  Also add new flags to apply the shudder without decay and apply the shudder regardless of camera.

Also change the shudder timestamp to the new style.
2022-08-25 21:36:17 -04:00
Goober5000 c239490899 Merge pull request #4593 from virusman/pr/fix-mac-builds
Fix Mac builds by overriding py7zr version
2022-08-25 21:06:41 -04:00
virusman c30500b66e Fix Mac builds by overriding py7zr version 2022-08-25 17:11:46 -07:00
MjnMixael 6d26547928 Scripting functions necessary for SCPUI Fiction Viewer (#4584)
Scripting functions necessary for SCPUI Fiction Viewer
2022-08-25 18:16:42 -04:00
wookieejedi 261dc508f8 Script function for turnTowardsOrientation (#4578)
A simple copy of the same function on `ai_helper`, now usable on plain ships too.
2022-08-23 22:23:30 -04:00
Goober5000 a0890c291a Merge pull request #4585 from Goober5000/fix_sound_parsing
fix overriding of originally-empty sounds
2022-08-23 22:13:16 -04:00
MjnMixael 89ff900e68 Make cutscenes.tbl extendable with -csn.tbm (#4571)
* Make cutscenes.tbl extendable with -ccn.tbm

* Only let first cutscene of any parsed file be visible by default

* Implement +nocreate support and change modular ext from ccn to csn

* Remove commented out code

* Initialize char* as NULL

* Address feedback

* cleanup
2022-08-23 07:38:46 -04:00
Goober5000 f469da2606 fix overriding of originally-empty sounds
Follow-up to #3743.  A sound that was originally parsed as empty, but then re-parsed as non-empty, would still have the `GAME_SND_NOT_VALID` flag from the original attempt.  This fixes that by clearing the flag each time the filename is read.
2022-08-23 01:28:12 -04:00
Goober5000 38d099ebd6 Merge pull request #4581 from Goober5000/fs1_reticle_supplement
add missing hud_gauges.tbl options
2022-08-22 21:54:11 -04:00
Goober5000 063bf44a19 Merge pull request #4397 from Goober5000/separate_ondeath_hooks
add new hooks for each object type
2022-08-22 19:38:07 -04:00
Goober5000 9c61b389d6 add missing hud_gauges.tbl options
These options for controlling the locking animation are toggled by `$Reticle Style:` but were otherwise not available to HUD gauges.
2022-08-21 22:10:45 -04:00
Goober5000 2b582676a6 make OnShipDeath overridable, per request 2022-08-21 20:53:04 -04:00
Goober5000 ba36ad69f5 add new hooks for each object type
Splits the existing On Death hook into independent hooks for each relevant type.  Adds On Ship Death, On Missile Death, etc.  Also adds On Missile Death Started to complement On Ship Death Started.
2022-08-21 20:53:04 -04:00
BMagnu 76be16f6b2 Fix Typo (#4580) 2022-08-21 23:31:04 +00:00
BMagnu 2557478d55 Allow changing Animation Instance speed (#4572)
* Allow changing animation speed

* Return nil from function

* address feedback
2022-08-22 03:14:34 +09:00
Asteroth c68e737c51 cap zoom distance and lower sensitivity (#4557) 2022-08-22 02:18:01 +09:00
PhantomHoover a95ecf9c9c Fix dangling pointer in sexp.cpp (#4561)
If you define a variable inside a block, its lifetime is confined to that block. So oswpt needs to be lifted into the parent block.
2022-08-22 02:17:49 +09:00
PhantomHoover c153fa8d26 Fix dangling pointer in hudparse.cpp (#4558) 2022-08-22 02:16:42 +09:00
wookieejedi 0f6ea85224 Fix setting of $Shadow Quality Default: (#4576)
`$Shadow Quality Default:` allows mods to specify what the default shadow quality should be, given that `-enable_shadows` flag is used. If a mod used this game settings option but the player did not use the `-enable_shadows` flag, then a parsing error would show up.

This PR fixes that bug by reordering two lines. Tested and fix works as expected.
2022-08-21 12:04:35 -04:00
JohnAFernandez d1d63a912a Prioritize players in object update (#4575)
* Make sure that players are updated the more often

Mitigates the increased latency from multiple clients getting each other's positions.

And Adjust update times:

Because LAN settings are now widely used even on non-LAN connections, shift High to a little bit less frequently in some situations, and adjust LAN settings so that it doesn't take quite as much bandwidth for updating ships that are `rear_medium` or `rear_far`.

Also update comments.

* Remove unused define

This was used in the previous version of the object update code and doesn't need to be here anymore.
2022-08-21 11:15:47 -04:00
BMagnu 55eab4c7e7 Add turnTowardsOrientation (#4563) 2022-08-21 08:24:39 -04:00
Goober5000 38fbe6311e Merge pull request #4555 from MjnMixael/LuaPersonaAccess
Implement ability to get and set a ship's persona index
2022-08-21 00:54:50 -04:00
EatThePath 0b97fc2c8e Merge pull request #4554 from MjnMixael/OnLoadoutStarted
Add hook just before loadout parsing
2022-08-20 23:21:27 -05:00
MjnMixael 5f5b08b594 Mouse option strings (#4570)
* Updated display strings for mouse settings

* Reverse these to match input functionality

* Fix whitespace

* Update mouse.cpp

Fix whitespace again
2022-08-20 22:10:03 -04:00
The Force 88bae48ded Actually Alt-name & callsigns and don't update window if closed 2022-08-20 19:23:20 +01:00
Goober5000 12227fd0ab Merge pull request #4567 from Goober5000/fix_stepped_rotation
fix stepped rotation
2022-08-20 12:15:13 -04:00
Goober5000 74112e13f7 fix stepped rotation
As part of the cleanup in preparation for model translation, there was a bit of code review that was actually incorrect.  The calculation of the current step needs to be rounded down, because the step isn't actually complete until it fully reaches the next number.  Rounding the step causes the submodel to jump around in all sorts of weird ways.

Follow-up to #4443.
2022-08-20 10:53:50 -04:00
wookieejedi f82bf2276b Allows default shadow quality to be per mod (#4553) 2022-08-20 07:16:29 -04:00
BMagnu 61197d4c12 Add SEXP to stop an animation after loop (#4566)
* Add Animation Instance Flags

* Add SEXP barebones

* Unify and simplify animation parsing

* Clean up animation calling and use new animationlist api

* Add missing break
2022-08-20 18:44:17 +09:00
BMagnu 5a53de0eb8 Fix WeaponClass Script Condition (#4559)
* Fix Weaponclass hook

* remove bad include
2022-08-20 03:23:51 +09:00
MjnMixael 9b36fd1f6f Lua scan time (#4551)
* Add Lua access to a ship's Scan Time

* Disallow writing to the shipclass value

* Remove ship access in favor of shipclass access. Resolve read only issue.

* Cleanup and error if script attempts to set Scan Time

* Whoops. Still need to get the shipclass.
2022-08-19 07:57:56 -04:00
PhantomHoover 5ea90dcb46 Fix: Missing includes breaking Linux builds. Including the same thing twice in a row. A completely unnecessary recursive include loop. (#4556) 2022-08-19 07:50:51 -04:00
mjn-mixael 1d5c457c83 Fix issue 2022-08-19 00:28:59 -05:00
Mike N c0c7854c86 Address feedback 2022-08-18 16:01:32 -05:00
Mike N 3e884bd384 Change hook name 2022-08-18 12:57:38 -05:00
Mike N 103522b72a Implement ability to get and set a ship's persona index 2022-08-18 12:55:16 -05:00
Mike N 9a08bbf597 Add hook just before loadout parsing 2022-08-18 11:21:07 -05:00
Goober5000 34018db925 Merge pull request #4421 from Goober5000/add_missing_sexp_goals
add missing SEXP goals
2022-08-18 10:11:39 -04:00
Kiloku 843eda19dd Prevent subsystem fireWeapon scripting function from triggering an assert (#4537)
* Prevent an assert from being triggered down the line by giving a LuaError for invalid weapons

* Reword error message to match function documentation
2022-08-18 21:26:10 +09:00
Asteroth bfb77b2a00 add isPositionInFOV script function (#4540) 2022-08-18 21:25:40 +09:00
BMagnu 269bb1b221 Add scripting API and conditions for executing on server only (#4548)
* Add scripting API and conditions for executing on server only

* feedback
2022-08-18 21:13:05 +09:00
Goober5000 f68849f0d3 add missing SEXP goals
The rearm-ship and fly-to-ship goals were never set up to work with the `add-goal` SEXP.  This adds the necessary code to make them both work.
2022-08-17 23:07:38 -04:00
BMagnu 967619ab09 Add options to selectively disable shadows (#4536)
* Add options to selectively disable shadows

* Encapsulate logic

* Add comment for new functions
2022-08-18 05:42:43 +09:00
Asteroth 6e7fcdaac7 copy script function from ai helpers to plain ships (#4539) 2022-08-17 14:33:06 -04:00
Asteroth 96d6b8bc3f error if they try to change this (#4549) 2022-08-17 14:31:51 -04:00
Goober5000 3d741cea93 Merge pull request #4427 from Goober5000/ai_goal_refinement
Ai goal refinement
2022-08-17 12:24:43 -04:00
JohnAFernandez 9d6cdd9d84 Multi collision fix (ship-ship) collisions (#4542)
Change Interpolation function to bool

And calculate last position instead of just setting it

This should help FSO prevent some very odd collision issues when two ships collide
2022-08-17 09:14:07 -04:00
Goober5000 7eee0f9164 reorder code 2022-08-17 00:37:28 -04:00
Asteroth 8dc9081244 add script function for turret num fire points (#4538) 2022-08-16 12:09:30 -04:00
wookieejedi 31dc7c2269 Fix misspelled ID name for in-game options (#4541)
Thanks to MjnMixael for catching this.
2022-08-15 17:03:52 +00:00
Goober5000 0ca8add409 Merge pull request #4535 from wookieejedi/fix-null-vec-calculations
Fix False Null MOI warnings
2022-08-15 00:33:36 -04:00
wookieejedi 48cd864a59 comment update 2022-08-13 22:16:06 -04:00
Kiloku 89b369cd07 Merge pull request #4352 from Kiloku/aspect_immune_ship_flag
Add new ship flag Aspect_immune
2022-08-14 01:00:19 +01:00
kiloku f78f94c1f0 Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com into aspect_immune_ship_flag 2022-08-13 19:33:18 -03:00
MageKing17 f2f4ade45e Automatically calculate length of flag name lists. (#4532)
`Ai_flag_names[]`, `Object_flag_names[]`, and `Ship_flag_names[]` all had an associated `#define` containing their length that had to manually be incremented whenever new flag names were added to the list. This commit instead makes the number of flags in the list be computed by simple `sizeof` division, so now adding a new entry just requires adding the entry, rather than remembering to bump a `#define`. Tested in FRED to make sure populating `OPF_SHIP_FLAG` entries still works.
2022-08-13 13:30:06 -04:00
wookieejedi 294b8bd9ec appease clang 2022-08-13 10:58:32 -04:00
wookieejedi 4074cf4c9c Fix False Null MOI warnings
In #4443, `fl_near_zero` was set to use default epsilon values in the `IS_VEC_NULL` check. In this comparison, epsilon is the wrong threshold because it used to have a much smaller threshold. The fix restores the previous definitions of `IS_VEC_NULL` and `IS_VEC_NULL_SQ_SAFE` by exposing the epsilon value as an optional parameter (similar to how `IS_NEAR_ZERO` used to work. This PR also restores `IS_VEC_NULL_SQ_SAFE` where it was replaced by `IS_VEC_NULL.`
2022-08-13 09:59:10 -04:00
wookieejedi 8420e00ee1 Allow Mods to specific default multi update speeds (#4531)
Previosuly, the default object update speed setting for new players was `High`. Many mods, such as Fate of the Galaxy, do multiplayer tests where we have to ensure players are using the highest object update speed, which is LAN. This extra step is cumbersome and prone to players' forgetfulness.

This PR allows mods to set the default multiplayer object update speed for new pilots to mitigate this issue. Tested and works as expected.
2022-08-13 08:57:18 -04:00
Kiloku f767190ce8 Merge branch 'scp-fs2open:master' into aspect_immune_ship_flag 2022-08-13 12:30:04 +01:00
Goober5000 165db5d28b Merge pull request #4400 from Goober5000/lua_frame_cleanup
clean up Lua frame handling a bit
2022-08-12 21:29:20 -04:00
Goober5000 5f1ab9bfa8 Merge pull request #4442 from Goober5000/turret_barrel_fov
add ships.tbl override for turret fov
2022-08-12 21:28:49 -04:00
kiloku da51f480ed Yet another formatting fix 2022-08-12 14:27:17 -03:00
kiloku fa494aa8ce Fix comment formatting 2022-08-12 12:52:04 -03:00
kiloku 4e29b31ed8 Merge branch 'Kiloku-aspect_immune_ship_flag' into aspect_immune_ship_flag 2022-08-12 11:45:33 -03:00
kiloku a90e95bb33 Merge branch 'aspect_immune_ship_flag' of https://github.com/Kiloku/fs2open.github.com into Kiloku-aspect_immune_ship_flag 2022-08-12 11:42:17 -03:00
Goober5000 dfeb15f8e5 more cleanup in preparation for model translation (#4443)
* more cleanup in preparation for model translation

1) Clean up stepped rotation, fixing some logic, adding safeguards for invalid values, and allowing rotations to go in the opposite direction
2) Add more specific SEXP error checking for AWACS and rotating subsystems
3) Assorted refactoring and polishing

* address feedback, plus a bit of extra cleanup
2022-08-11 08:17:17 -04:00
JohnAFernandez 7733f2b0bb Only check that ships have left the mission (#4511) 2022-08-11 08:16:08 -04:00
Goober5000 5a6b389916 Merge pull request #4518 from Goober5000/hud_gauges_ux
don't prune HUD gauges by resolution in FRED
2022-08-09 19:55:50 -04:00
Goober5000 59f0b7eddf Merge pull request #4464 from Goober5000/must_go_faster
add x500 and x1000 movement speeds
2022-08-09 19:55:36 -04:00
Goober5000 ed1bce988f only attenuate a persistent sound by engine strength if it's an engine sound (#4506)
Previously the persistent object sound management code would attenuate all script-assigned sounds by engine strength, and would not play them at all if the engine was off.  This fixes the code to only apply that logic if the sound is in fact and engine sound.
2022-08-09 10:32:58 -04:00
Asteroth 53cb148180 bugfix for salvo mode and forced target (#4508) 2022-08-09 10:32:28 -04:00
JohnAFernandez f2f00cdb6e Bump to 22.3 (#4529) 2022-08-09 07:36:19 -04:00
MageKing17 7bd18faafa Add optional suffixes to add to inherited damage types.
This allows you to automatically append, for example, "-shock" to the damage type to make the shockwave damage type, so a weapon with "Heavy" damage type would automatically have its shockwave assigned the damage type "Heavy-shock".
2022-08-06 23:04:01 -07:00
MageKing17 9869f2f8d5 Allow shockwaves to have a default damage type.
This includes both separate defaults for dinky and non-dinky shockwaves, as well as automatic inheritance of the parent weapon's damage type (and if both are enabled simultaneously, the default is only used if there's nothing to inherit because the parent weapon doesn't set a damage type).
2022-08-06 23:04:01 -07:00
MageKing17 372f96cfc0 Const-correctness for damage_type_add() and damage_type_get_idx().
Neither of these modify their input, so the argument not being `const` was just stopping `const` strings from being used as input.
2022-08-06 23:04:01 -07:00
Tyler Blount 8038422eda Capture empty strings too 2022-08-06 16:21:18 -07:00
Tyler Blount dca5d84ae6 Merge pull request #4502 from Kiloku/markdown-testing
Preliminary Changelog for 22.2.0
2022-08-06 15:22:35 -07:00
Kiloku c5bd3ba96e Update Changelog.md 2022-08-05 09:31:30 -03:00
Kiloku f75837922e Formatting fix 2022-08-05 09:30:56 -03:00
Kiloku 71fc9cc37b Update Changelog.md 2022-08-05 09:25:19 -03:00
JohnAFernandez 6359cb973c Merge pull request #4526 from JohnAFernandez/Allow-OBJ-GHOST-in-Assert
Add OBJ_GHOST to this assert and add comments
2022-08-04 19:59:06 -04:00
John Fernandez bafa6d9896 Add OBJ_GHOST to this assert and add comments
This assert catches any weapon's parent object type, which can include OBJ_GHOST, which is a dead player.  OBJ_GHOST is being encountered in this function using BPC when the player dies via beam weapon and (likely) when the players weapon are hitting an enemy ship at the same time.  Because the player ship can damage an enemy after it is dead, allow for that in this function.
2022-08-03 10:34:39 -04:00
Kiloku 7f1310bef5 Update Changelog.md 2022-08-03 09:19:55 -03:00
Goober5000 d48cab0fce mission-specific cutscene enhancements
Add `$Post-debriefing Cutscene:`, and make `$Post-briefing Cutscene:` a synonym for `$Pre-game Cutscene:`.
2022-08-01 20:58:19 -04:00
Goober5000 8c7f9e5e9e don't prune HUD gauges by resolution in FRED
FRED needs to work with any HUD gauge in the table, so don't prune any based on resolution.  Fixes #4517.

This also improves checking for duplicate names in the FRED gauge list.
2022-07-30 17:31:48 -04:00
Kiloku 6095e2ae1c Hopefully final changelog version for 22.2.0! 2022-07-28 07:42:59 -03:00
Goober5000 19ca467c41 Merge pull request #4513 from EatThePath/cleanup-eval-stack
Clean up the lua stack after EvalStringWithReturn's function creation
2022-07-27 23:29:52 -04:00
David Gibson 73736280f9 Clean up the lua stack after EvalStringWithReturn's function creation 2022-07-27 19:18:26 -05:00
Kiloku f24a8e6876 Add changes up to RC8 2022-07-25 08:51:54 -03:00
Kiloku a1973e323e Move item to the correct category. 2022-07-25 08:51:27 -03:00
Kiloku 72d9d86008 Address feedback 2022-07-25 08:42:14 -03:00
Kiloku fec0c7a3b6 Merge branch 'scp-fs2open:master' into markdown-testing 2022-07-25 12:37:45 +01:00
Goober5000 d5546f95e8 Merge pull request #4510 from Goober5000/warn_about_too_many_sexps
prevent too many dynamic SEXPs from breaking the SEXP system
2022-07-24 17:10:10 -04:00
Goober5000 29edfeedea display category name 2022-07-24 15:08:49 -04:00
Goober5000 8cf20b0175 prevent too many dynamic SEXPs from breaking the SEXP system
SEXP categories will not support more than 256 SEXPs; this is why the CHANGE2 category had to be created when CHANGE got full.  Unfortunately, dynamic SEXPs will count toward this limit, so mysterious errors will occur for the ones whose category indexes roll over.  The problem is not easily fixable, but at least the engine can detect the situation, warn about it, and refrain from adding any problematic SEXPs.

Since too many *total* SEXPs would cause a similar problem, this adds a warning for that case too.
2022-07-24 15:06:13 -04:00
Goober5000 c85040efc4 prevent a crash on game exit (#4507)
When `mission_campaign_clear()` is called, all persistent SEXP nodes (those used by the campaign) are marked as non-persistent.  When `sexp_shutdown()` was moved in #4503, this caused `Sexp_nodes` to be nullptr when the campaign was cleared, which caused a crash.  This reorders the shutdown functions to prevent the crash.
2022-07-22 20:39:20 -05:00
MageKing17 a16be863f3 Actually grab the object's type when doing type checks. (#4505)
PR #4500 added some checks, but accidentally compared `aip->target_objnum` to an object type (although the assertion message correctly retrieved the object type, leading to the bizarre assertion that `OBJ_SHIP`, i.e. 1, was an invalid target object type). This commit makes them all access the `Objects[]` array and retrieve the `.type`, just as the assertion message does (and the pre-#4500 conditional did).

Related to #4504, in that it's the source of the failed assertions, although I can't be sure it was the cause of the crashes without testing.
2022-07-20 21:08:40 -04:00
Kiloku 4619ab6b59 Minor grammar, spelling and formatting fixes 2022-07-20 11:32:15 -03:00
Kiloku 4070013d8a Add changes up to RC7 2022-07-20 11:08:23 -03:00
Kiloku c8fac05fbe Update Changelog.md 2022-07-20 10:23:52 -03:00
Kiloku 0bc03a1dab Improve changelog from feedback 2022-07-20 10:21:40 -03:00
BMagnu de80c254ae Ensure that SEXP shudown is before script shutdown (#4503)
* Ensure that SEXP shudown is before script shutdown

* Move before scpui destroy call
2022-07-19 18:56:42 -05:00
Allen A. Babb d703fcacc3 Move processing of thrust keys to be within the same block as the throttle keys (#4501)
* Remove do_thrust_keys() function
* Clean up documentation of Viewer_mode flags
2022-07-19 18:55:55 -05:00
Kiloku b1c0793bff Preliminary Changelog for 22.2.0 2022-07-19 19:15:09 -03:00
Goober5000 ddef6ea377 Merge pull request #4498 from Baezon/clear-goals-fix
Bugfix for not present ships in `clear-goals`
2022-07-19 09:57:48 -04:00
BMagnu 2b2333f692 Ensure sufficient stack size for Lua values (#4482)
* Ensure sufficient stack size

* Fix Warning

* Fix formatting

* Rename variable and add docs
2022-07-19 10:14:41 +00:00
JohnAFernandez 4a819d7b20 Include more valid object types in this check (#4500)
* Include more valid object types in this check

The previous version of the fix only included ships because it was believed to be the object that a ship used to be guarding.  Now it's clear that this is an object that the ship is currently targeting *after* guarding something.

So remove the UNREACHABLE and manually check the valid object types with an assert.  Then only continue with the function if it is the right target type.

* typo
2022-07-19 01:47:51 -04:00
Adam Leach 92d4820995 Fix envmap shading transparent pixels. 2022-07-16 17:46:41 +01:00
Asteroth a79dd70138 bug fix for not present ships in clear-goals 2022-07-14 16:19:37 -04:00
Goober5000 d5af6b5775 Merge pull request #4496 from Goober5000/fix_4495
check all possible extensions for audio files
2022-07-14 13:19:03 -04:00
Goober5000 e3b24ea9e2 check all possible extensions for audio files
When the code checks for the existence of an audio file, be sure to check all relevant extensions.

This fixes #4495.  Tested with both ST:R personas as well as the Vasudan persona.
2022-07-14 01:38:05 -04:00
Joshua Glatt 8645210c0a Fix type checking and FRED help for containers in special argument lists (#4486) 2022-07-13 19:52:21 -07:00
Goober5000 8c39bf54d4 Merge pull request #4491 from Goober5000/time_updates
some fixes for playing movies via script
2022-07-13 20:00:26 -04:00
Adam Leach 6b6b58fa9d specColor is already premultiplied by aoFactors.y 2022-07-13 23:38:14 +01:00
Adam Leach b8f0b8ec05 optimisation. with envmap, halfVec == normal by definition. 2022-07-13 23:22:23 +01:00
Adam Leach a8f1f668c1 Fixed bug where anti-glint could be too strong 2022-07-13 23:12:35 +01:00
Adam Leach d2d7f17385 moved anti-glint so IBL glint prevented too. 2022-07-13 23:12:11 +01:00
Goober5000 bb43411bb1 elaborate script descriptions 2022-07-13 12:30:01 -04:00
Asteroth 622ae3ef2c Fix some bugs with maneuvers (#4483)
* split ai_control_info_check and player-not-use-ai wipes maneuvers

* remove redundant flag upkeep and clarify logic
2022-07-13 00:08:08 -04:00
Goober5000 ab7a1d8fd7 some fixes for playing movies via script
The movie player code was missing some important functionality, in particular:
1) There was only one timing method to get real-time elapsed time, which was not suitable for pausing or time compression
2) There was an improper cast for the FPS property, causing a script error
3) The `getSeconds` method lost precision during casting

This patches those deficiencies.
2022-07-12 23:35:27 -04:00
John Fernandez 4b23a1bd44 Feedback 2022-07-12 21:33:16 -04:00
John Fernandez 9f40a341cc Allow multilock between traitors
Use the proper attacking function here, as traitors need to be able to attack each other in dogfight mode.
2022-07-12 21:24:30 -04:00
Asteroth a246ef21aa make sure to cap bank_vel (#4487) 2022-07-12 20:15:42 -04:00
JohnAFernandez e8d379a91c Fix an nprintf being in the wrong logic branch (#4485) 2022-07-11 21:29:06 -04:00
Goober5000 45862e06a9 Merge pull request #4461 from daftmugi/fix/accidental-skip-cutscene
Prevent accidental skip cutscene at loading screen
2022-07-11 11:20:00 -04:00
Goober5000 f96a27feb4 Merge pull request #4370 from JohnAFernandez/Ensure-obj_team-is_called_safely
Do our best to avoid invalid types in obj_team
2022-07-09 23:06:11 -04:00
Goober5000 f935a4ac38 Merge pull request #4475 from Goober5000/fix_erroneous_angle_modification
fix erroneous position/angle modification
2022-07-09 22:58:15 -04:00
Goober5000 601addd5c2 more feedback 2022-07-09 01:56:24 -04:00
Goober5000 7cfbdcd6cf address feedback 2022-07-08 19:29:51 -04:00
Goober5000 826dfd01fc clean up Lua frame handling a bit
There's no need to keep all this infrastructure to run every frame for a barely used situation.  This cleans it up a bit and does the position reset in the actual drawString function.
2022-07-08 18:59:10 -04:00
Goober5000 a009dc188c Merge pull request #4470 from jg18/issue_4405
Provide a limited partial fix for FRED keyboard shortcuts
2022-07-08 18:56:40 -04:00
Goober5000 bb6d7515df Merge pull request #4477 from notimaginative/fix_fireball_lod_assertion
fix lod assertion check (it can equal the max)
2022-07-08 18:56:26 -04:00
Goober5000 f33b8d987e Merge pull request #4478 from notimaginative/fix_psnet_memory_error
fix memset() on nullptr in psnet_get_addr()
2022-07-08 18:56:07 -04:00
Goober5000 67d8d56dd0 add a message if the copy detects inconsistent personas 2022-07-08 18:55:08 -04:00
Goober5000 2fd98c908b Merge pull request #4476 from Goober5000/fix_4472
use proper bounds check when bashing hull in red-alert
2022-07-08 18:53:52 -04:00
Taylor Richards bf1a9f192a fix memset() on nullptr in psnet_get_addr()
"addr" is optional and allowed to be null, so we've got to check
it before zeroing
2022-07-08 13:24:58 -04:00
Taylor Richards ec8cb1ba71 fix lod assertion check (it can equal the max) 2022-07-08 13:22:39 -04:00
John Fernandez e9e722244b Return here if not a ship 2022-07-08 12:24:19 -04:00
John Fernandez 2449dd6f70 Equals is ok here 2022-07-08 12:17:53 -04:00
John Fernandez 2748cc6f97 Return here if not a ship in release 2022-07-08 12:17:02 -04:00
John Fernandez 660f72dcc7 Clearer Assertions(TM) 2022-07-08 12:09:52 -04:00
John Fernandez f1506987eb Make assertions more readable. 2022-07-08 12:09:52 -04:00
John Fernandez e0d2d76dc2 Add an else unreachable. 2022-07-08 12:09:52 -04:00
John Fernandez 09b35edae1 More helpful assertions here 2022-07-08 12:09:52 -04:00
John Fernandez 390ddb3fc8 Do our best to avoid invalid types in obj_team 2022-07-08 12:09:52 -04:00
Goober5000 b95e04743e restrict to wingman personas rather than fighter/bombers 2022-07-08 00:30:10 -04:00
Goober5000 0ab523bcf4 Merge pull request #4462 from the-maddin/fix-gcc12-warnings
Fix gcc12 warnings
2022-07-07 21:41:04 -04:00
Goober5000 d72c5dbe75 Merge pull request #4471 from Goober5000/snd_aav_fix
reset the adjusted volume when the mission closes
2022-07-07 21:40:29 -04:00
Goober5000 324ccf37cb use proper bounds check when bashing hull in red-alert
This range check is to ensure that the ship's hull is in a valid range, so it should therefore check that the hull is less than the max strength, not less than the current strength.  This was inadvertently changed in 593be42e66 and a04e83ab01, but retail behavior is to set the exact hull from the previous mission.

Tested for both regular ships and delayed-arrival ships.  Fixes #4472.
2022-07-07 21:31:14 -04:00
Taylor Richards 20094df4cd address issues causing network connectivity failures on macOS (#4473) 2022-07-07 03:15:27 -04:00
Goober5000 8db280ea83 fix erroneous position/angle modification
Due to rounding and conversion approximations, it was possible for FRED to think the position and/or angle was modified when no such modification had occurred.  This could result in erroneous updates.  In the case of angles this could result in a group of ships being assigned the wrong orientation.

Follow-up to #2614.
2022-07-07 02:57:06 -04:00
Goober5000 a12e74fe9d reset the adjusted volume when the mission closes
Move `snd_aav_init` to `game_level_close` so that it is always called when the mission exits, not just in the `GS_STATE_GAME_PLAY` state.

Fixes #4468.
2022-07-06 12:08:56 -04:00
Goober5000 495010275b add helpful dialog box 2022-07-06 12:08:38 -04:00
the-maddin 82e2b67ed8 remove magic number, static assert about lod level
assumption
2022-07-06 09:22:49 +02:00
Joshua Glatt 3311704253 Provide a limited partial fix for FRED keyboard shortcuts 2022-07-05 21:29:11 -07:00
Goober5000 4b686359ec tweak dialog and add note 2022-07-05 22:53:26 -04:00
Goober5000 09e72fe917 bugfixes 2022-07-05 22:43:58 -04:00
Goober5000 7c019c4157 implement functions 2022-07-05 22:43:58 -04:00
Goober5000 bc44909501 constify 2022-07-05 21:14:30 -04:00
Goober5000 f942837785 stub out functions 2022-07-05 20:56:03 -04:00
Goober5000 72355be198 FRED UI for new voice acting buttons 2022-07-05 20:49:27 -04:00
the-maddin 7f7eed7a48 comment to clarify 2022-07-05 23:38:57 +02:00
the-maddin a95938a418 remove #define 2022-07-05 23:38:41 +02:00
the-maddin 557a6a989c skip LODs instead of ERRORing 2022-07-05 23:35:37 +02:00
Asteroth 0f168ecc5b warn on mismatched turret objects (#4458) 2022-07-04 21:55:55 -04:00
Adam Leach af1da1c93f Potential fix for warp portal envmap lighting? 2022-07-04 10:42:31 +01:00
Joshua Glatt 1768f5bb1b Handle syntax checking and caching for nodes with dynamic values (#4460) 2022-07-03 23:57:54 -07:00
JohnAFernandez 9e6790f317 Prevent a crash by exiting here (#4449)
* Prevent a crash by exiting here

And make an assertion more explicit, just in case.

* Fix comment
2022-07-03 22:28:08 -04:00
JohnAFernandez 993a9e9f18 Merge pull request #4463 from Kiloku/bugfix/3321-clamp-values-from-pilot-file
Clamp values to their correct ranges when loading and saving pilot and campaign files
2022-07-03 10:18:30 -04:00
kiloku 516548d6be No clamping bools 2022-07-03 07:49:35 -03:00
kiloku d1800d8622 Use the labels displayed in the menus 2022-07-03 07:48:03 -03:00
Daft Mugi c9dd97d223 Prevent accidental skip cutscene at loading screen
`os_ignore_events()` deferred events instead of ignoring them. The
player could accidentally skip a cutscene at the loading screen and
not see any indication there was a cutscene.

This only removes deferred skip-cutscene key events, except ESC, right
before the cutscene plays. This makes it less likely for a player to
accidentally skip the cutscene.

This also renames `buffered_events` to `deferred_events` and
`os_ignore_events()` to `os_defer_events_on_load_screen()`, which more
accurately describes the behavior.

Fixes #4419.
2022-07-02 16:58:52 -05:00
Goober5000 d0d22f04a7 add x500 and x1000 movement speeds
As requested by Asteroth.
2022-07-02 13:26:27 -04:00
Goober5000 c0ea9f5ffc Merge pull request #4455 from Goober5000/sexp_error_msg_tweak
refine SEXP error reporting
2022-07-02 13:22:04 -04:00
kiloku 319c8cc2a1 Clamp values before saving 2022-07-02 09:47:46 -03:00
kiloku 07b8e8d6cb Clamp settings values when loading 2022-07-01 22:56:19 -03:00
the-maddin 80e2908aa3 GCC12 warning format-overflow
Fireball filename field could potentially overflow
when adding LOD filename extensions. Added explicit
lengths and checks.
2022-07-02 01:03:32 +02:00
Daft Mugi 25a6bf2b87 Prevent accidental skip cutscene at loading screen
os_ignore_events() was buffering events instead of ignoring them. This
caused any skip-cutscene key to be buffered during the loading screen,
which would later be handled during the cutscene. From the player's
perspective, there was no cutscene.

This changes os_ignore_events() to ignore events.

Fixes #4419.
2022-07-01 14:40:10 -05:00
Joshua Glatt 1930943d2d Auto-accept completed campaign mission before exiting game from debriefing screen via options menu (#4450) 2022-06-30 19:26:25 -07:00
the-maddin ed16a81e37 GCC12 warning array compare
not comparing ship_info name addresses, but
ship_info argument address with address of
iterator element.
2022-07-01 00:59:57 +02:00
Asteroth 0121e439aa tweak to getTurretHeading() docs (#4456) 2022-06-30 15:07:14 -04:00
Goober5000 6fb72499f9 make all the error messages consistent 2022-06-30 03:15:53 -04:00
Goober5000 eb69133a57 refine SEXP error reporting
Sync the "mission save" and "error reporting" versions of the SEXP variable string.  Also use `stuff_sexp_text_string` to print the "bad node" token rather than `Sexp_nodes[bad_node].text`, so that a human-readable token is displayed instead of a magic number like 26.

Related to #4226, as the generated error message is formatted differently enough to be confusing.
2022-06-30 02:50:08 -04:00
Goober5000 2fcc3ecbf8 Merge pull request #4434 from Goober5000/sync_orientation
sync Orientation virtvars
2022-06-29 19:29:13 -04:00
JohnAFernandez 30b2b6caa7 Merge pull request #4407 from JohnAFernandez/Fix-Hud-Brackets
A comprehensive fix for the `player.target_is_dying` variable.
2022-06-29 12:31:07 -04:00
John Fernandez 4250aab601 Hud Bracket fixes
1) A comprehensive fix for the is_target_dying variable

2) Also do distance correctly for non-player target brackets by adding a check that we're dealing with the target before using the current target distance.  Then also calc distance if it is not the player target.

3) Update comments and checks to be consistent

Many of these did not reflect how the variable was actually used, so update the comments.
2022-06-29 11:40:12 -04:00
Goober5000 a9e6c328cf Merge pull request #4448 from Goober5000/async_mprintfs
add some logging to waitAsync
2022-06-28 13:55:33 -04:00
m!m 07b6c17db0 Merge pull request #4445 from the-maddin/ignore-gcc11-warning
Ignore Wshadow warnings in stale librocket headers
2022-06-28 18:11:58 +02:00
Goober5000 2ce953aee8 address feedback 2022-06-28 12:04:16 -04:00
Goober5000 05f71a30fb add some logging to waitAsync
Log when the context is created, completes, and is aborted.  Adds insight for the situation described in #4432.
2022-06-28 12:02:13 -04:00
Goober5000 5dfef48bf6 Merge pull request #4452 from Goober5000/default_enabled_nprintf_categories
set up debug_filter.cfg to have default filters that can be turned off
2022-06-28 12:01:33 -04:00
wookieejedi f280f11824 Fix AI Goal Display Strings (#4451)
* Fix AI Goal Display Strings

Okay so previously, if a target goal was not valid the code was
`strcpy(outbuf, XSTR("no orders", 495)); `

but then it was changed to
`outbuf += XSTR("no orders", 495);`

So it would instead append the "no orders" instead of properly replace the whole string. Looks just like a copy and paster oversight, since all the other text appends the name of the target with the order.

This PR correctly replaces, rather than appends that text. Fixes #4345

* appease clang

* use more simple =
2022-06-28 09:33:29 -04:00
Goober5000 e7b73da90e Merge pull request #4447 from Goober5000/fix_4412_harder
even more fixes for the skip-training-mission crash
2022-06-27 23:50:02 -04:00
Goober5000 8698993d44 set up debug_filter.cfg to have default filters that can be turned off
Small refactoring of the debug filter, needed as a prerequisite for #4448.
2022-06-27 23:36:49 -04:00
wookieejedi 7b04d401fe Fix Seg Fault on Standalones with Safer Check for Secondaries (#4446)
Tests with standalone multiplayer builds revealed that the server would seg fault if a player tried to switch secondaries if the ship did not have secondaries. Tests with standalones showed this fixed the bug. Thanks to chief for the bug IDing and the fix code.
2022-06-26 22:20:48 -04:00
Goober5000 a2b05f085b even more fixes for the skip-training-mission crash
As noted in #4412, it's possible for `Campaign.current_mission` to be -1 even in campaign mode.  This explictly checks for that.
2022-06-26 19:08:50 -04:00
the-maddin 6e612cdc97 msvc compat 2022-06-26 21:57:09 +02:00
the-maddin 9a55d90f5d Ignore Wshadow warnings in stale librocket header
GCC 11 raises a warning due to a parameter "word"
shadowing a typedef "word".
2022-06-26 21:19:35 +02:00
Tyler Blount cc2b9fcf94 Use correct needs elements for post build action (#4439) 2022-06-25 19:00:26 -05:00
Goober5000 abb81c6eaa add ships.tbl override for turret fov
Add `$Turret Barrel FOV:` option for turrets in ships.tbl, as requested by CP5670.
2022-06-25 18:42:50 -04:00
Goober5000 ed8af9d197 Merge pull request #4440 from Goober5000/fix_message_source_error
better handling of invalid message sources
2022-06-25 16:44:23 -04:00
Goober5000 43f8b123a8 better handling of invalid message sources
Another bug discovered by Durandal.  The message sender was a variable containing an invalid value, and the game crashed.  This handles it more gracefully.

Tested and verified.
2022-06-25 15:56:52 -04:00
Goober5000 a930301ec1 Merge pull request #4437 from Goober5000/fix_remove_form_on_wing
fix crash when removing form-on-wing
2022-06-25 15:35:24 -04:00
Tyler Blount 112f2bb5ba Merge pull request #4438 from z64555/fix/post-build-release-autotrigger01
Fix/post build release autotrigger01
2022-06-25 09:55:11 -07:00
z64555 5b8dce1dda Try encapsulating the OR in the same brackets. 2022-06-25 10:23:57 -05:00
z64555 b6c684644a use inputs context instead of github.events.inputs context 2022-06-25 10:06:32 -05:00
Goober5000 d754f7fe0d fix crash when removing form-on-wing
This goal was missed in `ai_remove_goal_sexp_sub`, so add handling for it.  Also make the error message clearer in case another goal is missed in the future.
2022-06-25 00:41:34 -04:00
wookieejedi 2beaa886ca Fixes Team Colors not working with show-ship (#4436)
Updates the `show-ship` function to account for team colors. Also, cleans up the function a bit. Tested and works as expected. Fixes #4435
2022-06-24 22:06:13 -04:00
the-maddin ddeb40aa61 checks fix 2022-06-25 00:19:11 +02:00
Goober5000 53bc7861bf sync Orientation virtvars
The two `VIRTVAR`s for Orientation in subsystems and submodel instances do the same thing, but did not have the same code - in particular, the subsystem version did not update the subsystem angle and turret angle.  This syncs them up.
2022-06-23 10:08:34 -04:00
Taylor Richards 9de4a49c42 stop non-printable keys adding text to multi msg buffer (#4433)
Arrow, function, Ctrl, Alt ... and any other non-ascii keys
would previously add a blank space to the multi msg buffer.
This prevents that from happening, making sure that it's an
ascii character before appending it to the buffer.

(Retail bug??)
2022-06-23 05:55:52 -04:00
Goober5000 6e5626722a Merge pull request #4431 from Goober5000/skybox_none
fix clearing a skybox model when it isn't the mission default
2022-06-20 20:33:16 -04:00
Goober5000 1fa5068555 Merge pull request #4428 from Goober5000/fix_4412
more fixes for the skip-training-mission crash
2022-06-20 20:33:06 -04:00
Goober5000 d7f0051394 fix clearing a skybox model when it isn't the mission default
The previous way to clear a skybox was to set it to "default", and if the mission had no skybox then it would be cleared.  The skybox code can correctly handle the lack of a skybox, but if you pass an empty string to the skybox preloader it fails with a file not found error.  This fixes the preloader, and also adds "none" as an explicit no-skybox parameter.
2022-06-20 02:33:25 -04:00
Goober5000 6b9dacb598 more fixes for the skip-training-mission crash
Certain campaign-related functions would run even when the game was not in campaign mode (e.g. when playing in the tech room).  Normally these would be benign, but with a new pilot or with a skipped mission, the current campaign mission would be -1 and a crash would occur.

Should fully fix #4412.
2022-06-19 23:09:53 -04:00
Allen A. Babb eef9a340b1 Flush the mouse state after toggling between Use_mouse_to_fly in scripting/api/libs/controls.cpp::MouseControlStatus (#4426)
See the discussion in issue #4173 for details.
2022-06-19 20:43:42 -05:00
Goober5000 5b87f62d6a add optional distance to ai-stay-near-ship 2022-06-19 19:04:45 -04:00
Goober5000 b0057e959d move ai goal stuff to aigoals.h 2022-06-19 19:04:44 -04:00
Tyler Blount 4a9c6567cc Merge pull request #4425 from z64555/fix/post-build-release-autotrigger
Autotrigger on either workflow_call or push event.
2022-06-19 09:40:24 -07:00
z64555 ead7f10006 Autotrigger on either workflow_call or push event. 2022-06-19 07:21:50 -05:00
Taylor Richards c7abceaf30 fix control chars test that also excluded space key (#4424) 2022-06-19 06:32:53 -04:00
Tyler Blount a057917958 Merge pull request #4423 from notimaginative/fix_hud_preset_parsing
fix parsing issues with hud color presets
2022-06-18 16:48:38 -07:00
Adam Leach 5e4d6cc5de Implement IBL based off envmaps
Fixed environment map rendering


shift fresnel term to match ordering of ComputeGGX, document shader code.


Envmaps: Use tangentMatrix to build local coordinate system 


Fixed geometry self-shading calcs to improve shading of rough surfaces.


Cite paper correctly


optimsed env sampling 


Put envmap face generation a loop to make it easier to read


Precalculate points on circle for even faster envmap sampling..


Guard against NaNs


Revert to simpler envmap calcs, significantly faster on slower GPUs.


typo


We don't need the sample points any more.


Diffuse IBL shading


Fix gamma issues in envmap rendering


AO term on envmaps.


fix lab crash with retail data


Always render envmaps - PBR shouldn't care if a shine/specmap exists.
2022-06-18 19:57:54 +01:00
Adam Leach 5f4566620f UE4 based shaders
Better approximation in geometry/visibility term
Fixed Fresnel/Schlick model to be dependent on view in line with learn openGL PBR theory
introduce energy conservation term for diffuse rendering

Just use specColor instead of trying to figure out metalness.


Pull out g1 function for reuse


UE4 based shaders

Better approximation in geometry/visibility term
Fixed Fresnel/Schlick model to be dependent on view in line with learn openGL PBR theory
introduce energy conservation term for diffuse rendering

Just use specColor instead of trying to figure out metalness.


Pull out g1 function for reuse
2022-06-18 19:57:12 +01:00
Taylor Richards 010441fdbf fix parsing issues with hud color presets
The first issue is that if a gauge isn't found it will fail to parse
any remaining gauges in the file. The second issue is that when saving
the preset the game uses translated strings for the gauge name but
when loading the preset it uses untranslated strings.

This should address both issues while keeping the original purpose
of the changes as well as not breaking existing presets or requiring
any mod changes.

Ref: http://scp.indiegames.us/mantis/view.php?id=3099
2022-06-18 13:38:41 -04:00
Goober5000 b32698012a Merge pull request #4420 from Goober5000/main_hall_popup_priority
only display one popup when the player gets to the main hall
2022-06-18 13:05:41 -04:00
Goober5000 581fec1079 Merge pull request #4413 from Goober5000/ending_campaign_by_skipping_mission
end the campaign properly when a mission is skipped
2022-06-18 13:05:35 -04:00
BMagnu a44adde0e5 Followup improvement for the LuaAI AI Control Helper (#4422)
* Followup improvement for the LuaAI AI Control Helper

* Update docs
2022-06-18 18:31:50 +09:00
Taylor Richards e88542580e Merge pull request #4410 from notimaginative/fix_hud_config_presets
Fix issues with loading of hud config presets
2022-06-18 05:09:31 -04:00
Taylor Richards b5043417fc override default path creation when path must be from root
The default file path is always the primary mod user directory, however
some files are only ever created and read from the root user directory.
This allows for an override in such cases so that the location_flags
variable will match the intended root path.

Fixes #4384
2022-06-17 21:11:49 -04:00
Asteroth 049fa72df3 change bank to target vel from target position (#4417) 2022-06-18 06:06:36 +09:00
Goober5000 b8231a4ec1 only display one popup when the player gets to the main hall
There are three popups of decreasing priority that can appear in the main hall screen: campaign not found, pilot upgraded, and player tip.  Only one of these should actually be displayed -- the first popup will take the player to a different screen, rendering subsequent popups useless; and the second popup is more important than the third popup.  This PR prioritizes the popups accordingly.
2022-06-17 13:25:29 -04:00
Goober5000 1b563360ed Merge pull request #4401 from Goober5000/add_isActive_checks
add isActive checks for new-style script hooks
2022-06-16 19:42:36 -04:00
Fabian Woltermann 3ee1321d9d Merge pull request #4416 from The-E/fix/4415_several_lab_issues
Two minor lab fixes
2022-06-16 23:12:25 +02:00
Fabian Woltermann fb9304bae0 Fix #4415: Make sure that changing team colors only happens when there are team colors to change and only dump the envmap to disk if there actually is an envmap to dump 2022-06-16 22:14:26 +02:00
Goober5000 87e6a1350d Merge pull request #4414 from Goober5000/split_subsys_warnings
split subsystem warning display checks
2022-06-16 01:09:11 -04:00
Goober5000 bf05cadd14 split subsystem warning display checks
Since "No subsystems found" and "Not all subsystems have a record in ships.tbl" are different warnings, they should have different flags.  Follow-up to #4408.
2022-06-16 00:21:39 -04:00
Goober5000 29fe214d16 end the campaign properly when a mission is skipped
The "skip training" button and the "exit loop" button should both check whether the campaign is actually over before attempting to load the next mission.  The fix is simple - just use the same logic as in `mission_campaign_skip_to_next`.

Fixes #4412.
2022-06-16 00:02:48 -04:00
Goober5000 e27bf0c925 Merge pull request #4403 from Goober5000/fred_error_tweaks
some tweaks to the FRED error checking
2022-06-15 23:21:27 -04:00
Taylor Richards 83c4858f18 allow default hud config files to come from the file cache 2022-06-15 13:58:19 -04:00
JohnAFernandez 6104e6fcd3 Merge pull request #4404 from JohnAFernandez/Let's-support-the-hack-that-was-such-a-good-idea
Fix the standalone ship being added to ship list
2022-06-15 11:25:39 -04:00
Allen A. BabbandMageKing17 113b57df29 Changelog.py improvements and post-release-build.yaml debugging (#4380)
* Echo the event name to debug Auto trigger
* Add argparse library to changelog.py
* Allow user to authenticate with github creds (such as PAT's)

* Update ci/post/changelog.py

Use clearer notation for while loop

Co-authored-by: MageKing17 <[email protected]>

* Update ci/post/changelog.py

Co-authored-by: MageKing17 <[email protected]>

Co-authored-by: MageKing17 <[email protected]>
2022-06-14 22:26:56 -07:00
Joshua Glatt a25e12a041 Ignore weapons-locked slot status in selection screens when irrelevant (#4399) 2022-06-14 21:04:39 -07:00
Joshua Glatt fa29b91e68 Disallow Replace Container Data with special argument list (#4392) 2022-06-14 21:03:11 -07:00
BMagnu 6b91a6210c Properly set rotation data from LuaAI (#4406)
* Properly set rotation data from LuaAI

* Update Variable Name
2022-06-14 23:46:03 +00:00
John Fernandez 6098675cc0 A docked standalone ship is not possible. 2022-06-14 09:49:18 -04:00
John Fernandez 01331436c9 Fix the standalone ship being added to ship list
While it may seem counterintuitive, we have to keep the standalone bogus ship from being added to the ship list so that we don't have to exclude it from all the places it could cause crashes or mysterious AI behaviors.  Both were being observed, and this should fix them.
2022-06-13 21:39:03 -04:00
Goober5000 dbdc2457e0 some tweaks to the FRED error checking
1) Restore original behavior where function would exit after one error check (for consistency)
2) Exclude player ships from the check for ships in a wing sharing the same orders
2022-06-13 21:14:15 -04:00
the-maddin db68e30862 fix qvector error 2022-06-13 23:02:48 +02:00
Goober5000 7013981de5 add isActive checks for new-style script hooks
What it says on the tin.  Follow-up to #3538.  Fixes #4398.
2022-06-13 02:13:14 -04:00
David Gibson e78157908d fixed some mishandling of lighting modifiers. 2022-06-12 18:51:08 -05:00
Goober5000 8b9ac5f8a9 Merge pull request #4391 from Goober5000/fix_tech_db_default_flags
fix use of default tech database flags
2022-06-12 19:36:20 -04:00
the-maddin a1fc0907cf unified warning message handling 2022-06-13 01:00:04 +02:00
JohnAFernandez 7cf2832113 Merge pull request #4389 from JohnAFernandez/Remove-pointless-Asserts
Remove a pointless assert
2022-06-11 23:08:46 -04:00
The Force 16d32f3730 Fix text entry
Try and fix editable dropdowns
Change  pass-by value rather than refrence
2022-06-12 02:24:19 +01:00
Goober5000 6f5de692b9 Merge pull request #4376 from Goober5000/suppress_bitop_warnings
disable compilation warnings in BitOp
2022-06-11 20:16:11 -04:00
the-maddin 2c5f52a28d Integrated error checking
numbered to reflect campaigntreewnd.cpp
2022-06-12 02:04:12 +02:00
Goober5000 67b3c6ce46 fix use of default tech database flags
The "default" tech database flags indicate whether entries are in the tech room by default, that is when the table is originally parsed and the campaign is started.  Flags may be changed later, so that when the tech database is "reset to default" the flags can be returned to the known state as specified in the tables.

A bug was introduced back in commit c924e3997a (!) based on a misinterpretation of what "default" meant.  This fixes the bug and clarifies the flags.

Fixes #4390.
2022-06-11 18:03:21 -04:00
John Fernandez b3f0016d0e Remove a pointless assert 2022-06-11 15:02:09 -04:00
Joshua Glatt bd864baead Clean up list modifier code (#4363) 2022-06-10 17:31:25 -07:00
The Force 1e7cdbda47 Move All Ship Editor file so subfolder
Move All Ship Editor file so subfolder so it easier to navigate
2022-06-11 00:02:42 +01:00
The Force 7b04b3b27a Missed bit 2022-06-10 23:27:14 +01:00
The Force 13f3322ae8 Address Feedback 2022-06-10 23:24:34 +01:00
wookieejedi e6956b1b4c Fix FRED Crash with Team Colors (#4379)
`p_objp` uses cannot be used if FRED is running, and this PR adds that check to the updated team color fixes from #4207.

Fixes #4374
2022-06-10 08:32:29 -04:00
Allen A. Babb e0fd189833 re-enable mod-only controls that have a tab. (#4377) 2022-06-09 21:26:21 -05:00
Goober5000 28f06adc12 disable compilation warnings in BitOp
Since bit.c is a third-party file, we can't modify it, so let's instead disable the warnings for it.

Follow-up to #4274.  Fixes #4366.
2022-06-09 20:17:42 -04:00
BMagnu 3f830fbe78 Force legacy order for HUD commands (#4375) 2022-06-10 02:25:37 +09:00
Tyler Blount 0371b2d889 Merge pull request #4373 from scp-fs2open/fix/ci-re-str-cast
Don't try casting a string to an int
2022-06-08 19:11:55 -07:00
Tyler Blount 1bae96df07 Missed a parenthesis 2022-06-08 18:18:56 -07:00
Tyler Blount f3880eb03f Don't try casting a string to an int 2022-06-08 17:53:43 -07:00
Tyler Blount 263bf57c79 Merge pull request #4371 from scp-fs2open/fix/ci-regex-string
Check string, not number in release version regex
2022-06-08 10:15:32 -07:00
Tyler Blount d665c1ccf1 Actually look for a string in regex
`REVISION_STR_VERSION_PATTERN` is not currently matching against a string, it is matching against a number
2022-06-08 09:09:14 -07:00
Tyler Blount 5bde8bfebf Check either possibility for cmake set function (#4369)
There are two possible functions that can appear in `version_override.cmake`, so we need to make sure both are handled
2022-06-08 05:20:31 -05:00
Allen A. Babb a002219373 Use correct usage of subprocess.check_output() (#4368) 2022-06-08 01:17:23 +00:00
Allen A. Babb a923f64691 Fix Post Release Build action
Attempt 2.  Use ${{ }} style to reference env (#4365)
2022-06-07 14:54:31 +00:00
Allen A. Babb 7e06ccac7d Hopefully fix the post-build-release yaml (#4364)
* Directly use inputs for actions/checkout
2022-06-07 09:07:19 -05:00
Goober5000 2ff2732cc4 Merge pull request #4355 from Goober5000/lua_addSomeHookDoc
Convert some Lua hooks to the new style to add documentation
2022-06-06 23:24:10 -04:00
JohnAFernandez b328495b31 Correct some Bad Documentation (#4360)
authored-by: johnafernandez <jafernandez,[email protected]>
2022-06-06 19:31:05 -05:00
Goober5000 9acbd9bc94 enhance ActiveActions to accommodate both old-style and new-style script hooks 2022-06-06 17:26:07 -04:00
Goober5000 3a1e1b23d5 Merge pull request #4359 from Baezon/fix-music-start-delay
Small fix for music initialization
2022-06-06 17:24:22 -04:00
Taylor Richards e1ddbd5875 save PXO stats to local pilot file (#4354)
Retail saved tracker stats to the local pilot file after read, however
the newer pilot file code doesn't work the same way. This adds the
ability to properly update the pilot file with multiplayer stats from
the tracker during login.

NOTE: This will always overwrite multi stats in the pilot file with
the stats from the tracker!
2022-06-06 15:04:16 -04:00
Goober5000 1dfe0ab644 Merge pull request #4358 from Goober5000/xstr_entries_4259
add additional XSTR entries
2022-06-05 21:43:36 -04:00
Asteroth 22a71ea3e7 fix event_music_set_start_delay 2022-06-05 21:43:01 -04:00
Goober5000 8821cdf2cd add additional XSTR entries
Add entries requested by @Achille44.  Fixes #4259.
2022-06-05 21:09:01 -04:00
Goober5000 3ad92cce4e tweak strdup handling for argument vector (#4307)
* tweak strdup handling for argument vector
Follow-up to #4293
2022-06-05 18:58:11 -05:00
Goober5000 90576274fb Merge pull request #4357 from Goober5000/fs1_message_conversion_additional_check
additional checks for FS1 message conversion
2022-06-05 19:25:44 -04:00
Goober5000 3b49699b19 additional checks for FS1 message conversion
Before setting the `MQF_CONVERT_TO_COMMAND` flag, check to make sure the conversion will succeed.

This should ensure proper behavior for any case where command-conversion is needed.  I've tested it with both a message that should not be converted and a message that should, and both behave as expected.

Follow-up to #4150 and #4078.  Fixes #4356.
2022-06-05 18:02:39 -04:00
Goober5000 3a4794305f Convert some Lua hooks to the new style to add documentation
This takes a few of the existing hooks and converts them to the new style of hook definition which can include more extensive documentation and enumeration of supported hook variables.

This is an updated version of #3151 to work with the latest codebase.

NOTE: Before this can be integrated into the codebase, it needs an implementation for `bool script_state::IsActiveAction(int hookId)` which apparently only has support for old-style script hooks.
2022-06-05 16:38:03 -04:00
Fabian Woltermann 7facbcc262 Merge pull request #3769 from EatThePath/debug-viz-sphere
Implemented debug sphere queuing and rendering.
2022-06-05 18:24:52 +02:00
d38cc1f3db Controls6: Keyboard Localization and Scripted Contols (#4133)
Locale Sensitive Controls and Textfield Input
+ Add Keyboard Layout sensitive InputBoxes
+ Remove obsolete helper function

* Fig [] usage and remove old keybinding names
+ Fix Compile Warnings
+ Fix Compile Warnings 2
+ Fix Clang Warnings
+ Fix faulty style + remove lambda
+ Change reverse-lookup map to iterating function
+ Added controlconfigdefault.tbl generator
+ Fixed gcc warning
+ Fixed msvc warning
+ make debug console keyboard layout independent
+ Expand DCF Functionality for saving control presets
+ Address Issues

* Controls/update tbl (#5)

Updates controlconfigdefaults.tbl to write Primary and Secondary bindings.

* Added Scripting Hooks for controlsconfigdefault.tbl (#6)

* Handle Asserted Switch cases

* Controls is a library and should be in the libs folder

* Add Lock & EnableScripting Functionality and expose it to scripting API

* Added scripting isLocked

* Move Key Hooks to register-able callback

* Add option to remove hook

* Repurpose CCI.used for Axes

* Morph bitfield into a singleton class

* Add encoding conversion helpers
+ Add keyname conversion if needed
+ Merge refactored encoding functions
+ Change keycode encoding call
+ remove bad type modifier
+ Move Conversion functions to util/unicode
+ Change Encoding Enum to Enum Class
+ Adapt KeyName call for encoding enum class
+ Fix Warning due to enum class
+ Change validation to own function

* Make mActionToVal Assertion more helpful
* Fix typo
* Fix style
* Use constant, not magic number
* Document Ignored_keys[]
* Doxy class controls_lua_override_cache a bit better
* Put NameToVal safeties back in
* Reorder the +Disable and $Disable: options, and be exclusive
* Reorder the +Locked and $Loacked options, and be exclusive
* Revert changes in ValToJoy
* Revert errant duplicates
* Refactor printJoyJSON() to use getJsonArray for consistency
* Remove unused FS2toSDL map
* Remove ADE_FUNC(AxisActionInverted)

* Address gcc-5 issues
* Remove unused param for textify_scancode
* Declare textify_scancode_universal() in controlsconfig.h for use
* Clean up textify_scancode() and *_universal() a smidge for clarity

* Address most clang-9 issues

* Modernize NULL to nullptr

* Expand logic and document in controlsconfig::check_control() for clarity.
* Fix typo

* Remove unecassary static_cast
*  Use Assertion instead of Assert within control_config_common_read_section()
* mprintf()'s need new lines!

Co-authored-by: Birk Magnussen <[email protected]>
Co-authored-by: Birk Magnussen <[email protected]>
2022-06-05 10:19:46 -05:00
Joshua Glatt b893075efe Detect concurrent container modification (#4330)
* add node subtype for container names

* clean up and port changes to qtFRED

* fix parsing when container is the last argument

* fix serializing container name nodes

* fix parsing again

* disallow spaces in container names

* check for spaces and & chars while parsing container names

* early WIP for trying to get list containers of strings working as argument options

* indicate which SEXPs will be supported for now

* clean up

* add FRED/qtFRED support

* remove [in]validate-argument from supported SEXPs

* support map containers with string keys

* update FRED and qtFRED

* clean up

* update FRED help text

* revert some unneeded changes

* fix style

* remove added assertion

* backport useful changes from PR #4263 and then some

* clean up backport

* move condition_node evaluation outside of argument loop

* fix does_blank_of_op_support_container_args()

* fix assertion

* add OPF_DATA_OR_STR_CONTAINER and use restore old behavior of OPF_ANYTHING

* revert some unnecessary changes

* fix CI

* detect attempts to modify container while it is being used as special argument (WIP)

* evaluate conditional for each loop

* update placeholder text for new SEXP arg type

* finish/clean up
2022-06-05 08:47:51 -05:00
Goober5000 e3ad6664e0 Cached subsystem indexing (#4316)
* add subsystem indexer and ensure that ship_get_indexed_subsys and ship_get_first_subsys are independent

* also add reverse lookup from subsys to index

* update indexer to accommodate subsystem pointers being changed

* use clearer function names, and fix the type of subsys_list_indexer

* add assertions

* address latest feedbcak
2022-06-05 08:44:54 -05:00
JohnAFernandez 9abfb1e3f3 Merge pull request #4349 from JohnAFernandez/Multi-Bump
Multi Bump for 22.2 release
2022-06-05 00:55:15 -04:00
JohnAFernandez 2004d00588 Merge pull request #4144 from JohnAFernandez/Interpolation-Overhaul2
Interpolation Overhaul 2
2022-06-05 00:55:09 -04:00
JohnAFernandez abb8bbaf68 Merge pull request #4264 from notimaginative/multi_sexp_fixes
Multi sexp fixes
2022-06-05 00:55:03 -04:00
JohnAFernandez 6baadfef6f Merge pull request #4306 from BMagnu/de_bitfieldify_player_orders
De-Bitfield-y Player Orders
2022-06-05 00:54:55 -04:00
Taylor Richards b6378d6b0b revert multi bump (will be added in a separate PR) 2022-06-04 23:19:11 -04:00
John Fernandez a6cb299f28 Feedback 2022-06-04 23:06:56 -04:00
David Gibson 70b9c34f1a move techroom/selection/breifing 'room' lights to a common function and
augment lighting setup for current rendering
2022-06-04 20:40:12 -05:00
the-maddin 3d5ae71fc6 Merge remote-tracking branch 'refs/remotes/upstream/master' into qt-campaign-editor 2022-06-04 23:46:34 +02:00
the-maddin 5d0fadba19 doxy 2022-06-04 23:46:16 +02:00
kiloku 69d3f47e34 Re-added missing linebreak in ship flag list 2022-06-04 14:02:54 -03:00
JohnAFernandez 88c788a7b4 Interpolation Overhaul
Add files to partition interpolation code, base interpolation timing on Missiontime on remote instance vs. Mission time on the local instance.
2022-06-04 12:55:13 -04:00
JohnAFernandez 06c3087038 Merge pull request #4314 from JohnAFernandez/Fix-Rollback-Primary-Collisions
Fix rollback primary collisions
2022-06-04 12:43:12 -04:00
kiloku ecbebfab00 Fix some undesired whitespace changes 2022-06-04 13:26:28 -03:00
kiloku aecc626634 Add new ship flag Aspect_immune which stops ships from being locked onto by aspect seeking weapons 2022-06-04 12:54:16 -03:00
Goober5000 5e8815146d add some extra safeguards to gr.drawString (#4327)
* add some extra safeguards to gr.drawString

These will add insight if the errors reported by RedMadeJoe pop up again.  The root cause is in the script, but this will prevent FSO from choking.

* Add static bool for warning
2022-06-04 09:12:16 -05:00
Kiloku 01a4d01fd3 Draw 3d lines in space with Lua (#4331)
* Add support for drawing batched 3D lines of arbitrary color and thickness.

* Add draw3dLine lua function.

* Move line texture out of graphics.h into graphics.cpp, also rename it for proper code style.

* Move line texture generation to batching.cpp, create dedicated batching_add_line function and add support for a line with variable thickness at the start and end.

* Use references in the verts loop

* Add bound checks for line widths

* Warn if the Lua script uses invalid widths
2022-06-04 09:10:15 -05:00
wookieejedi 619e0e125e Add option to expand warning on unbound keys (#4342)
In Training missions, the game will check if keys used in directives are bound or unbound, and if unbound will display a message to the player to bind the key.

This is limited to only Training missions though, so this PR adds a `game_settings` option to allow modders to use that check in singleplayer mission types too, which is very useful for mods that rely on key presses in non-training missions. Also fixes #4340.
2022-06-04 08:17:24 -04:00
John Fernandez f18c4d39cc Bump for 22.2 release 2022-06-04 02:17:51 -04:00
John Fernandez ba5406f13c Add safety checks for bad ref objects
This will allow FSO to fall back to the old system when the reference object is somehow not a ship.
2022-06-04 01:58:01 -04:00
John Fernandez 779594b66a Feedback 2022-06-04 01:48:51 -04:00
John Fernandez 2163cfc5d3 Remove superfluous buggy check plus two more fixes
1. Also include number of frames variable

2. remove stale comment
2022-06-04 01:48:51 -04:00
John Fernandez b4c1c83a84 Fix further problems with time calc +
One other fix
2022-06-04 01:48:51 -04:00
John Fernandez d0d12b572a Check for collisions, and cull collided bolts
Add a function that removes colliders after collision detection so that we don't have dup collisions after rollback resim ends
2022-06-04 01:48:51 -04:00
John Fernandez 7b61f20eda Add old_position to rollback to fix rb collision 2022-06-04 01:48:51 -04:00
Tyler Blount e38c30bca6 Merge pull request #4346 from Kiloku/fix_line_endings
Fix line endings in the core codebase
2022-06-03 19:11:41 -07:00
Tyler Blount 7d87aad3f3 Merge pull request #4347 from Kiloku/fix_line_endings_other_files
Fix line endings in a few more files
2022-06-03 19:11:29 -07:00
Goober5000 6a37be55ba Merge pull request #4348 from EatThePath/load-fennel
Add Fennel script support to cfile.
2022-06-03 20:41:15 -04:00
Joshua Glatt 1f625f3a7f Support using containers with random-multiple-of SEXP (#4326) 2022-06-03 17:09:24 -07:00
David Gibson de98902de4 add .fnl to the scripts file extensions 2022-06-03 15:58:23 -05:00
David Gibson 13180db544 Merge remote-tracking branch 'origin/master' into light-flags-rubicon-2 2022-06-03 15:50:26 -05:00
David Gibson a7b59b4620 further post-rebase repair of light flags command line and leftover specular 2022-06-03 15:39:08 -05:00
EatThePath 13db223f03 Merge branch 'master' into debug-viz-sphere 2022-06-03 14:51:16 -05:00
David Gibson ee72bcec69 cleanup of leftover/post-rebase specular references 2022-06-03 14:07:57 -05:00
David Gibson cfa7d1736b Removed specular light color as a separate value in the uniform buffers. 2022-06-03 13:27:06 -05:00
David Gibson 252d0cb56a handled specular sun depreciation and general removal of specular value handling 2022-06-03 13:27:05 -05:00
David Gibson 4e835bafdb revise command-line and emissive handling 2022-06-03 13:26:29 -05:00
David Gibson 33f8109dfb make static some functions that can be static 2022-06-03 13:26:05 -05:00
David Gibson 89e17ec2f1 cleanup unused new function 2022-06-03 13:26:05 -05:00
David Gibson d73f8bf968 Wire lab up to new lighting controls, and provide backwards-compatible defaults for emissive. 2022-06-03 13:26:05 -05:00
David Gibson 6ee2699f51 Switched over to new command line arguments 2022-06-03 13:26:05 -05:00
David Gibson 23a46dcb65 Applying directional brightness profile value, disconnected spec flags and made specular light always equal to diffuse light 2022-06-03 13:22:54 -05:00
Tyler Blount 92c1ca2bb7 Merge pull request #4317 from notimaginative/stub_graphics_fixes
fix a bunch of graphics functions to respect GR_STUB
2022-06-03 11:18:43 -07:00
Taylor Richards 7fb8e64434 log non-psnet packets for debugging (#4339)
Previously, debug builds would assert if a packet was not a psnet packet
type. Port scans and general traffic checks could trigger this for any
public server. So we should just log these events instead, taking into
account that some of this traffic could be malicious in nature.
2022-06-03 14:16:49 -04:00
EatThePath 91b516c1c4 Merge pull request #4208 from EatThePath/weapon_lights
Weapon lights
2022-06-03 13:01:15 -05:00
kiloku 764e730e80 Fix line endings in a few more files 2022-06-03 14:28:58 -03:00
David Gibson d10309d3d4 fixed up copy-paste mistakes in new light_add functions 2022-06-03 12:13:58 -05:00
kiloku b7e99089d7 Fix line endings in the core codebase 2022-06-03 13:31:09 -03:00
Goober5000 154e5f6b4b Merge pull request #4344 from JohnAFernandez/timestamps_again
Use correct function for regular stamp
2022-06-02 15:22:31 -04:00
John Fernandez 6e9745c671 Use correct function for regular stamp 2022-06-02 14:12:49 -04:00
JohnAFernandez 709de972e6 Merge pull request #4343 from JohnAFernandez/Another-Timestamp-Function
Add overload for timestamp_elapsed_safe
2022-06-02 12:27:59 -04:00
John Fernandez 43b89d29b6 Add overload for timestamp_elapsed_safe
Why?  Cause multi
2022-06-02 11:34:52 -04:00
Joshua Glatt 6bfe6071d0 Add apply-container-filter SEXP (#4333) 2022-06-02 07:12:38 -07:00
JohnAFernandez 0bbd099853 Add timestamp get delta (#4334)
* Add timestamp get delta

For returning the delta between two timestamps, as a counterpart to timestamp_delta.
2022-06-02 09:35:52 -04:00
Goober5000 12f9ccc46f Merge pull request #4341 from Goober5000/campaign_error_check_fix
better error checking of campaign loop branches in FRED
2022-06-01 23:39:29 -04:00
Goober5000 bc1f36a423 better error checking of campaign loop branches in FRED
In the FRED campaign editor, error checking for campaign branches did not correctly handle loop branches.  This avoids performing inapplicable error checking for loop branches, adds a new applicable check, and excludes loop branches from the count of regular branches.  Fixes error checking for the FS2 main campaign.
2022-06-01 19:57:00 -04:00
Goober5000 5672f0ed53 Merge pull request #4332 from Goober5000/no_departure_warp_cleanup
clean up ship arrival and departure effects
2022-06-01 18:54:36 -04:00
Fabian Woltermann 9514f9babb Merge pull request #4168 from virusman/pr/mac-builds
Set up Mac builds on CI
2022-06-01 19:26:25 +02:00
Joshua Glatt 151bfd2f26 Support using string-valued containers in some when-argument SEXPs (#4305) 2022-06-01 07:57:15 -07:00
virusman f7d83978fc Move Mac ccache setup to CMakeLists.txt 2022-05-31 21:26:58 -07:00
virusman 014b73e54e PR review changes 2022-05-31 21:26:58 -07:00
virusman cd267972b9 Fix cache id for Qt 2022-05-31 21:26:58 -07:00
virusman 97a67958a7 Set up Mac builds on CI 2022-05-31 21:26:58 -07:00
Goober5000 d2f4a982e6 Merge pull request #4323 from Goober5000/4313_followup
minor cleanup of turret names
2022-05-31 23:06:00 -04:00
Goober5000 a745f6179a Merge pull request #4319 from Goober5000/draw_resized
Add gr.CurrentResizeMode
2022-05-31 20:47:25 -04:00
Birk Magnussen e3544e687e Free up order 0 for no-order 2022-05-31 21:36:22 +02:00
Goober5000 3088477a3e Merge pull request #4274 from Goober5000/lua_bitop
add Lua BitOp 1.0.2
2022-05-31 13:21:00 -04:00
Goober5000 b92f362a80 update containers to hopefully fix CI 2022-05-31 12:52:55 -04:00
Goober5000 ee1330669a add Lua BitOp 1.0.2
Adds the standard Lua extension library for bit operations in Lua 5.1.
http://bitop.luajit.org/

Note that this library is normally called "bit", but it is added here as "luabit" because there is already a FSO scripting library called "bit".
2022-05-31 10:23:44 -04:00
Goober5000 c1003f76b8 add new virtvar for getting and setting resize mode, and use it in drawString and drawStringResized 2022-05-31 00:21:10 -04:00
Goober5000 aa4a58e53b clean up ship arrival and departure effects
Due to both the AI code and the ship movement code calling warp departure logic, enabling `Framerate_independent_turning` caused ships with the no-departure-warp flag to depart twice.  Removing the call to `shipfx_actually_warpout` fixes this.

More fundamentally, this untangles and organizes the arrival and departure logic as it pertains to effects.  The actual arrival and departure code is moved to the `shipfx_actually_warpin` and `shipfx_actually_warpout functions`.  This simplifies `WarpEffect::warpEnd()` and allows `WarpEffect` and its subclasses to only concern themselves with the visual effects.

This also fixes a logging statement that could never actually be printed due to `delta_ms` being the wrong sign in the if() check.
2022-05-30 22:04:21 -04:00
Goober5000 85ed537960 Merge pull request #4324 from Goober5000/timestamp_comparisons
timestamp comparisons
2022-05-30 19:12:53 -04:00
Goober5000 a5ae3e7de8 Merge pull request #4328 from MageKing17/bugfix/missionparse-escort-assertion
Remove pointless assertion in mission parsing.
2022-05-30 19:12:44 -04:00
David Gibson 52fd857736 Simplified internal references to debug_sphere members 2022-05-30 14:50:09 -05:00
BMagnu 370e12dba5 Make number of player orders FRED can handle dynamic (#4290)
* Give FRED the ability to check dynamic player orders

* Fix Warning

* incorporate feedback

* Incorporate Feedback 2
2022-05-31 04:13:59 +09:00
Goober5000 5b44ea6a34 augment Assertion messages 2022-05-30 15:06:41 -04:00
Goober5000 28631b743c Merge pull request #4325 from EatThePath/bugfix/fix_4161
removed vestigial bit-depth asserts for aabitmaps.
2022-05-30 13:03:47 -04:00
MageKing17 8c1693df46 Remove pointless assertion in mission parsing.
When parsing escort priority, FSO asserts that the escort flag is set,
but this assertion is only valid in missions output by FRED; it's fairly
trivial to use notepad to remove the flag without removing escort
priority, thereby triggering the assertion. Furthermore, there doesn't
actually seem to be a problem if a parse object has an escort priority
without the escort flag; the engine won't actually use the priority
until/unless the ship is manually added to the escort list, and then it
doesn't matter that one is set.
2022-05-29 12:04:21 -07:00
Joshua Glatt c5be6095b2 Fix is_for_op() to follow existing conventions (#4322) 2022-05-29 10:42:33 -07:00
Birk Magnussen 3f227e7eeb Incorporate Feedback 2022-05-29 10:48:10 +02:00
David Gibson d2ddcfe4e0 removed vestigial bit-depth asserts for aabitmaps. 2022-05-28 16:57:05 -05:00
David Gibson 859d44f3a3 Rendering changes to stablize debug_sphere coloration 2022-05-28 16:37:47 -05:00
Goober5000 7780cf4617 timestamp comparisons
Add methods to compare timestamps, as well as methods to calculate deltas from existing timestamps.

Follow-up to #4286.
2022-05-28 17:13:24 -04:00
David Gibson 45b6362777 Applied automatic formatting to the new debug_sphere files
Restructured debug sphere code for efficiency
2022-05-28 16:10:48 -05:00
David Gibson c6c5d37f48 Converted debug sphere to class 2022-05-28 15:48:28 -05:00
David Gibson 753856421d dead code cleanup 2022-05-28 15:48:28 -05:00
David Gibson 90eb343aa9 Implemented debug sphere queuing and rendering. 2022-05-28 15:48:28 -05:00
Goober5000 39d9251e2c Merge pull request #4286 from Goober5000/timestamp_since
add timestamp_since
2022-05-28 16:35:28 -04:00
Goober5000 5f5d210a9b minor cleanup of turret names
Small follow-up to #4313 based on review comments that were 2 minutes too late.
2022-05-28 16:07:36 -04:00
The Force cfdeeb7109 Allow Weapon To Override Turret Name (#4313)
* Allow Weapon To Override Turret Name

* Loop through all banks rather than just the first

* Fix gcc warning
2022-05-28 15:55:39 -04:00
Goober5000 62cacb3f08 address feedback 2022-05-28 14:41:20 -04:00
EatThePath d1397147e4 Merge pull request #4308 from MageKing17/cleanup/deprecated-cmdline-flags
Handle deprecated cmdline flags programmatically.
2022-05-28 11:37:28 -05:00
Taylor Richards f5cbed9cdb use proper buffer size for PXO chat line (#4318)
fixes #4285
2022-05-28 08:53:48 -04:00
BMagnu f193c5233d Add LuaAI validity callbacks (#4304)
* Add callback for user specified availability status

* Add target restrict hook

* Fix Restrict hook and add not self restrict type

* Fix documentation

* Fix typo

* scope the ai achievability enum

* fix scoped achievabiliy
2022-05-28 21:18:28 +09:00
Goober5000 65998e8d04 Merge pull request #4320 from Goober5000/name_length_fixes
fix NAME_LENGTH discrepancy
2022-05-28 00:38:22 -04:00
Goober5000 d6c4fb8e53 fix NAME_LENGTH discrepancy
The ship creation code had an off-by-one error while checking the maximum length.  Fixes #4297.
2022-05-27 22:24:45 -04:00
Taylor Richards f6f16b6a32 clang-tidy fixes 2022-05-27 17:47:38 -04:00
Taylor Richards 39434fe7b1 fix a bunch of graphics functions to respect GR_STUB 2022-05-27 12:49:49 -04:00
Joshua Glatt 84023002db Add for-container-data and for-map-container-keys SEXPs (#4296) 2022-05-26 21:39:14 -07:00
BMagnu e22b8e44b7 Fix for real now (#4312) 2022-05-26 21:46:38 +09:00
Joshua Glatt 3fb034ab7f Add container name subtype to Sexp_nodes (#4299) 2022-05-25 21:26:05 -07:00
BMagnu 6ef7616dcc Fix orders accepted list parse (#4310) 2022-05-25 19:05:47 +00:00
The Force 9a04166d9f Add comment to address feedback
Add comment
2022-05-25 16:13:49 +01:00
The Force f86a869509 Change class to dialog rather than widget 2022-05-25 16:13:49 +01:00
The Force e4cadff3f5 const initial status editor
Finish Consting
2022-05-25 16:13:49 +01:00
The Force 465c8cb2d4 More Doxy and clarify function names
Finish doxy ship editor
2022-05-25 16:13:49 +01:00
The Force 9acc16dde3 Properly encapsulate data 2022-05-25 16:13:49 +01:00
The Force 6fc5f2e979 Fix crash bug with cargo 2022-05-25 16:13:49 +01:00
The Force a6665320e9 Add clang fixies that accidently got removed 2022-05-25 16:13:49 +01:00
The Force 9100cc9bc5 Const Parameters
Properly privatise and const model data
2022-05-25 16:13:49 +01:00
MageKing17 46310c0667 Handle deprecated cmdline flags programmatically.
Instead of keeping the old variables around (except renamed to include "_deprecated") and manually checking them one at a time with a lot of duplicated code, use existing information to generate the messages automatically.
2022-05-24 20:39:37 -07:00
Birk Magnussen 13d245a101 fix builtin 2022-05-24 21:04:36 +02:00
Goober5000 53aec7e4e4 Merge pull request #4293 from Goober5000/for_operator_memory_fixes
fix some memory management problems in the for-* operators
2022-05-24 11:18:37 -04:00
BMagnu c06007bcac Fred and clang tidy 2022-05-24 14:46:25 +02:00
BMagnu 50ef38bf21 Adapt QTFred 2022-05-24 14:02:45 +02:00
BMagnu 7dbb16bf06 Fix Warning 2022-05-24 13:56:07 +02:00
BMagnu ca3207de47 Tidyup 2022-05-24 13:50:22 +02:00
BMagnu 00078b9c77 Multi Bump 2022-05-24 13:42:18 +02:00
BMagnu 7155163223 Remove bitfield indexed player orders 2022-05-24 13:38:56 +02:00
BMagnu cfb5a04aa9 Activate LuaAI custom message parsing (#4303)
* Add parsing for specifying order accept messages

* Write out acknowledge in comment
2022-05-23 20:44:54 +00:00
BMagnu cd2aac4faa Fix FRED Add/Replace (#4301)
* Fix ID mangle
2022-05-23 20:40:14 +00:00
Joshua Glatt c8ace18317 Add copy-container SEXP (#4291) 2022-05-23 08:55:27 -07:00
Goober5000 54413fa0fb fix some memory management problems in the for-* operators
1) In `for-counter`, when `just_count` is true there is a memory leak, since the code never enters `test_argument_vector_for_condition`, but for the same reason, duplicating the string is not necessary in that case, so just add a blank string
2) Remove unnecessary `vm_strdup` calls from the other for-* operators
3) `const`ify argument management
2022-05-22 22:55:12 -04:00
the-maddin 2eb6410de8 Merge branch 'master' into qt-campaign-editor 2022-05-22 22:36:23 +02:00
David Gibson dc31a9f663 Corrected copy and paste error in light profile value setting 2022-05-22 10:14:34 -05:00
the-maddin 401a26623a changes z64555 v1.4 2022-05-22 15:17:31 +02:00
the-maddin 9336d7264f changes z64555 v1.3 2022-05-22 14:17:15 +02:00
Goober5000 663e3ade36 Merge pull request #4289 from Goober5000/3860_followup
briefing icon behavior tweaks per request
2022-05-22 00:36:23 -04:00
Goober5000 bfddd5f758 briefing icon behavior tweaks per request
Per #3860, don't disable any of the icon dropdowns, and don't change the ship class when the icon type is a special popup.
2022-05-21 18:25:45 -04:00
BMagnu 48baf8c0af Fix HUD squad menu PageDown (#4283)
* Fix HUD squad menu PageDown

* Clang Tidy
2022-05-22 05:57:59 +09:00
David Gibson 1699bf1570 Corrected order of operations in lightprofiles modifier processing 2022-05-20 14:34:10 -05:00
Goober5000 805e858123 Merge pull request #4277 from Goober5000/hud_target_distance
add hu.getTargetDistance()
2022-05-20 14:18:06 -04:00
Goober5000 260526cbd6 add hu.getTargetDistance()
Add a scripting function to return the distance as seen on the HUD.
2022-05-19 21:03:45 -04:00
Goober5000 ede0645d3b Merge pull request #4273 from Goober5000/resolve_4270
resolve FIXME for AIM_GET_BEHIND
2022-05-19 20:51:31 -04:00
Goober5000 e473ff011c add timestamp_since
Add `timestamp_since()` and modify a few places that use `timestamp_until()`.
2022-05-18 22:24:20 -04:00
Goober5000 7222c8a398 resolve FIXME for AIM_GET_BEHIND
This mode was never actually implemented, even in retail, so there is no FIXME as such.  Tweak the code to reflect this.  Fixes #4270.
2022-05-18 21:27:20 -04:00
Goober5000 48d5211e68 Merge pull request #4275 from naomimyselfandi/scpui-stage-hooks
Allow SCPUI to run `$On Briefing Stage:` hooks
2022-05-18 18:47:24 -04:00
BMagnu f707d471da Replace +Orders Accepted: Bitfield with flag list (#4282)
* Deprecate '+Orders Accepted:' Bitfield

* Add retail compat mode
2022-05-19 06:24:02 +09:00
The Force 6024b0026f Convert to unique_ptr 2022-05-18 18:59:53 +01:00
Taylor Richards 5e79021da3 use SCP_string for constructing multi/event log lines (#4284) 2022-05-18 13:56:37 -04:00
The Force 4320760e8e Merge branch 'master' into fix/shipEditorCleanup 2022-05-18 18:16:26 +01:00
EatThePath 4d66740f7a Merge pull request #4279 from qazwsxal/image-based-lighting
Lab Environment-Map Export
2022-05-17 22:12:14 -05:00
The Force 0d3290f14d Enable Doxygen for QTFred (#4281) 2022-05-17 22:08:32 -05:00
Taylor Richards b4f95c3b0c Merge pull request #4266 from notimaginative/fix_multi_timestamps
address multiple timestamp issues with multi
2022-05-17 20:07:09 -04:00
Taylor Richards 932c91b526 Merge pull request #4280 from notimaginative/multi_debug_helpers
add improvements to aid in multi troubleshooting
2022-05-17 20:05:55 -04:00
Naomi Coffman 0f9fee8d7c Lua indexes start at 1 2022-05-17 18:59:28 -04:00
The Force a20afd147e Doxygen Ship Editor 2022-05-17 19:27:49 +01:00
Taylor Richards 4581897b09 remove obsolete time stoppage for screenshots
With the new timestamp code this particular instance should no longer
be necessary. And prevents sync issues in multi with it gone
2022-05-17 13:55:08 -04:00
The Force cea490ab62 Constify Ship Editor
Add missed lines
2022-05-17 17:42:56 +01:00
The Force 20faa3083d Merge branch 'master' into fix/shipEditorCleanup 2022-05-17 15:18:57 +01:00
The Force 883566ad05 Add TBL Viewer (#4233) 2022-05-17 08:38:37 -05:00
Taylor Richards 62f41ceb73 fix options screen breaking multi
The options screen (F2) isn't a paused state in multi so we can't
stop time while it's active
2022-05-17 07:52:09 -04:00
Taylor Richards df6cf572ac convert multi timestamp()'s to ui_timestamp() where appropriate
A bit overkill for some of this but just covering the bases.

 * fix issues with in-game join
 * fix multi messaging and multi pause screen
 * make sure maintenance stuff (pings, voice, file xfer, etc.) isn't
   affected by pausing or time compression
2022-05-17 07:50:50 -04:00
Adam Leach 1d16bb28a4 Keep clang tidy happy (NULL->nullptr) 2022-05-17 11:11:47 +01:00
Adam Leach 862cf0d82c Keep clang -Werror=unused-but-set-variable happy. 2022-05-17 09:05:20 +01:00
Taylor Richards ead4376f47 fix unittests when non-interactive is used 2022-05-16 16:23:34 -04:00
Taylor Richards a8618a569c add improvements to aid in multi troubleshooting:
- report when multi.cfg is missing
 - add game version, multi version, cmdline, and PXO status
   to multi.log
 - use non-interactive mode by default on standalone and
   enable it as soon as possible
2022-05-16 15:47:30 -04:00
Adam Leach 98846a3f88 Clean up comments 2022-05-16 19:51:23 +01:00
Adam Leach dbd7b2f49a Update usage info in lab with M key 2022-05-16 19:23:24 +01:00
Adam Leach 743cd5035d Flip Y coord 2022-05-16 19:05:43 +01:00
Adam Leach 22b1f08592 Cleanup render target and don't produce cubemap images 2022-05-16 19:05:43 +01:00
Adam Leach 530118785a spherical environment map generation 2022-05-16 19:05:43 +01:00
Adam Leach d84486c357 remove superfluous filepath format 2022-05-16 19:05:43 +01:00
Adam Leach 2744af109a Dump Environment maps with "M" key in lab 2022-05-16 19:05:43 +01:00
BMagnu 5c4be3d392 LuaAI (#4198)
* Basic LuaAI

* LuaAI Player Order Support

* Add Player Order Target Restricts

* Fix init order

* Add AI helper API

* Fix subcategory stuff

* Fix Compiler Warnings

* Remove AI Mode switch Int3's

* Fix Lua docs

* Compiler warnings 2

* Clang Tidy

* Incorporate Feedback

* Incorporate Feedback 2

* Incorporate Feedback 3

* Incorporate Feedback 4

* Clang Tidy
2022-05-16 18:36:34 +09:00
Naomi Coffman 701a8de527 Allow SCPUI to run $On Briefing Stage: hooks 2022-05-15 19:44:48 -04:00
Goober5000 303480eecf Merge pull request #4257 from jg18/fix/fred-with-container-names
Ensure Replace/Add String and (Add) Paste are disabled for container name nodes
2022-05-15 13:47:26 -04:00
Goober5000 f9aad01349 Merge pull request #4267 from naomimyselfandi/cancel-future-waves
Add cancel-future-waves
2022-05-15 12:34:05 -04:00
Goober5000 1269feae44 Merge pull request #4271 from Goober5000/maybePlayCutscene_fix
fix maybePlayCutscene arguments
2022-05-15 12:33:04 -04:00
The Force 65ef9e3ac4 Fix references to changed name 2022-05-15 13:34:53 +01:00
The Force 42e2870410 Merge branch 'feature/shipTBLViewer' into fix/shipEditorCleanup 2022-05-15 13:32:56 +01:00
The Force ca3bc07959 More descriptive Name 2022-05-15 13:31:15 +01:00
David Gibson a214488395 shifted profile name for default profile parse to variable, and other small fixes to weapon color implementation 2022-05-14 18:58:21 -05:00
David Gibson 7dbb831efa Addressed some memory management problems in new weapon color code 2022-05-14 18:37:38 -05:00
Taylor Richards 4587c33e05 enable newer options of subtitle sexps for multi 2022-05-14 19:23:20 -04:00
Goober5000 3c22bf9c49 Merge pull request #4268 from Goober5000/clean_up_wing_waves
some wing wave cleanup
2022-05-14 14:31:25 -04:00
Goober5000 fa52bf747d fix maybePlayCutscene arguments
This must have been coded as `ui:maybePlayCutscene` when it should be `ui.maybePlayCutscene`
2022-05-14 14:30:04 -04:00
Naomi Coffman 2ffa4ca982 Document how cancelling interacts with is-destroyed-delay and friends 2022-05-14 07:46:56 -04:00
Goober5000 833326aa76 some wing wave cleanup
In the process of looking through `num_waves` and `current_wave` for #4267, I found a couple of confusing bits of code.  This clarifies things.
2022-05-14 01:34:42 -04:00
Goober5000 ba225dcf20 Merge pull request #4265 from notimaginative/standalone_crash_fix
fix a standalone crash from disabled uniform buffer manager
2022-05-14 00:06:27 -04:00
naomimyselfandi 0d461c1fc4 Replace "Always_show_goals" with "Toggle_showing_goals" (#4263)
* Replace "Always_show_goals" with "Toggle_showing_goals"

The "Always_show_goals" flag is a no-op on anything other than a
training mission. This replaces it with a new flag which toggles
whether the goals are shown instead, in keeping with the existing
"Toggle_debriefing" flag.

* Rename other occurrences of Always_show_goals

* Update stale comment

* Update stale member names

* Remove unused #define
2022-05-13 22:19:59 -05:00
Naomi Coffman f8fdda34a6 Fix shadowing 2022-05-13 22:19:01 -04:00
Naomi Coffman 798f1c8c2f Fix documentation typo 2022-05-13 21:50:01 -04:00
Naomi Coffman 1228a56e42 Add cancel-future-waves 2022-05-13 21:46:39 -04:00
Taylor Richards ab483eeea8 fix a standalone crash from disabled uniform buffer manager 2022-05-13 04:00:25 -04:00
Taylor Richards d1c12cc57f try to handle unknown sexp data more gracefully
fixes #3773
2022-05-13 00:35:40 -04:00
Goober5000 3d646e591d Merge pull request #4258 from Baezon/fix-sun-position-compensation-math
Correct sun position compensation math
2022-05-12 20:02:05 -04:00
Goober5000 20efcb9717 Merge pull request #4261 from Goober5000/disable_sun_bank
disable sun bank controls
2022-05-12 20:01:42 -04:00
Goober5000 b1a59ec8b3 Merge pull request #4262 from Goober5000/coverity_followup_fixes
miscellaneous fixes related to old Coverity fixes
2022-05-12 20:01:36 -04:00
Goober5000 7bece7a946 guard against negative turret_enemy_objnum 2022-05-12 01:50:09 -04:00
Goober5000 7606df6082 miscellaneous fixes related to old Coverity fixes
1) Remove the extra branch in `check_ok_to_fire` that was added in SVN revision 10392, or commit 0d54630e83.  If there was an actual Coverity error, this does not fix it at the proper location.  More importantly, this breaks certain turret firing behavior.
2) Fix a couple of bounds checks.
3) Remove an incorrect stale comment.

This fixes the broken turret swarm weapons that were uncovered by the fixes in #2959.
2022-05-12 01:03:50 -04:00
Goober5000 e534adf107 Merge pull request #4159 from Goober5000/test_replace
guard against off-by-one errors in replace_one and replace_all
2022-05-11 22:11:39 -04:00
JohnAFernandez 1acd763e4d Limit all MP client collisions to prevent bugs (#4209)
Players are still affected by collisions locally, but other ships will literally pass through each other until updated by the server.  A timestamp controls the frequency of collisions with the player ship.
2022-05-11 19:11:09 -07:00
Goober5000 6101627381 Merge pull request #4260 from Goober5000/4243_followup
revised disabling of Enter and Escape
2022-05-11 22:04:50 -04:00
Goober5000 741231be77 disable sun bank controls
Per Asteroth, and following PR #4258, sun banking is no longer meaningful and should be disabled.
2022-05-11 19:31:55 -04:00
Goober5000 e21575558e Merge pull request #4249 from Goober5000/fix_change_alt_name
fix assignment of alt-name when using the hash
2022-05-11 19:15:56 -04:00
Goober5000 dd287c4288 revised disabling of Enter and Escape
Turns out PR #4243 actually introduced a bug that appeared to implement the feature.  The previous implementation had the effect of intercepting all keypresses and routing them to the main window.  This fixes that bug by using `CDialog` instead of `CWnd`.  It also turns out that the `hWnd` window handle for some reason does not match the expected window, but fortunately, this implementation is only called in the correct window so the restriction is not needed.
2022-05-11 19:09:04 -04:00
Asteroth aa316433f1 qtfred too 2022-05-11 17:56:06 -04:00
Asteroth 9f63b17328 make sure to clamp 2022-05-11 15:26:03 -04:00
Asteroth 2e37aceab9 correct sun math 2022-05-11 14:13:39 -04:00
Joshua Glatt 42a7861990 Ensure Replace/Add String and (Add) Paste are disabled for container name nodes 2022-05-10 21:53:26 -07:00
Joshua Glatt e44456333e Fix clear-container SEXP (#4255) 2022-05-10 21:39:59 -07:00
Goober5000 be8cfe1180 Merge pull request #4256 from Goober5000/4121_followup
partial revert of targeting distance ranking change
2022-05-10 23:53:59 -04:00
Goober5000 b16d953bed partial revert of targeting distance ranking change
Normally, when the player cycles through targets using (for example) the hostile targeting key, the targets will be shown in order of distance.  In PR #4121, this was changed from bounding-box distance to center-distance, which has very little noticeable effect on the cycle except that it now agrees with the AI strategy for measuring distance.

However, when the player targets a hostile for the first time, or when the cycle resets after 1.5 seconds have passed, the first ship targeted will be the closest ship *or* the ship with the closest turret.  And furthermore, when the target cycle continues, the next ship targeted will be the next ship farther away.  There can be a dramatic difference between a turret, which may be very close, and the center of the ship, which may be very far away.  The target cycle will continue with these far-away ships, and this has the effect of leapfrogging any ships that are closer that should be targeted first.

There isn't any easy way to tell that a ship has been targeted because of its turret, and not because of some other targeting key or because the cycle has restarted, but fortunately the bounding-box distance is a reasonable approximation because turrets tend to be on the bounding boxes.  So this commit simply restores the distance functions to what they were before.  The other fixes from #4121 are not related and remain in place.
2022-05-10 22:51:01 -04:00
Goober5000 047458fc0c Merge pull request #4253 from Goober5000/fix_set_camera_facing
keep default identity orientation when host flag is active
2022-05-10 01:11:11 -04:00
Goober5000 1273cbcdc9 keep default identity orientation when host flag is active
When the `$Use host orientation for set-camera-facing` flag in game_settings.tbl is active, the camera will use the host's orientation as a basis for rotation.  However if there is no host, the camera unintentionally inherited its old stale orientation.  Instead the camera should base its new orientation on the identity matrix which is the expected behavior.
2022-05-10 00:35:50 -04:00
Goober5000 71a861bd6f more feedback, a fix, and a new test case 2022-05-10 00:30:48 -04:00
Goober5000 d7a4fc5eb1 modify tests 2022-05-09 21:51:09 -04:00
Goober5000 55be80dd6a address feedback 2022-05-09 21:00:21 -04:00
Goober5000 b278e95877 Merge pull request #4242 from Goober5000/fred_parse_cleanup
clean up some parse problems in FRED
2022-05-09 02:41:45 -04:00
Goober5000 215d90ccc0 Merge pull request #4250 from Goober5000/ship_created_cues
assign cues when a ship is ship-created
2022-05-09 02:41:36 -04:00
Goober5000 18a311e779 Merge pull request #4252 from Goober5000/new_timestamp_fix
use the proper time for the newly added timestamps
2022-05-09 02:41:14 -04:00
Joshua Glatt 7fd20c667a Implement query_modified() for Add/Modify Container FRED dialog (#4247) 2022-05-08 20:16:41 -07:00
Joshua Glatt 6f8e60eb17 SEXP containers, Part 8: Change SEXPs (#3862) 2022-05-08 20:15:59 -07:00
Goober5000 b29f183aee assign cues when a ship is ship-created
Assign locked-* cues when a ship is created so that their arrival and departure cues are not -1.  Supersedes PR #4248.
2022-05-08 23:15:33 -04:00
Goober5000 2f23a794fb use the proper time for the newly added timestamps
The new timestamps should use the timestamp ticker, which accounts for pauses and time compression, not the standard timer, which measures absolute elapsed time.  This fixes the bug reported on Discord where the supernova timer did not pause when the game was paused.
2022-05-08 22:58:47 -04:00
Goober5000 ba88b01f51 fix assignment of alt-name when using the hash
Alt-names with hashes that were added by the `change-alt-name` sexp used to have their hashes truncated properly.  This most likely broke when hash truncation was moved from the HUD code to the "display name" code.  This PR truncates hashes in the same way as truncation elsewhere.
2022-05-08 21:53:13 -04:00
the-maddin ec3ad17fa2 changes z64555 v1.2 2022-05-09 01:35:15 +02:00
the-maddin d9a9cb5f9d changes z64555 v1.1 2022-05-09 01:34:47 +02:00
Tyler Blount 1091a93752 Merge pull request #4246 from Baezon/no-mem-leak-bsp-changes
Fix memory leak and use tmap verts directly
2022-05-08 12:46:05 -07:00
Joshua Glatt a654b61d0c SEXP containers, Part 7: Status SEXPs (#3861) 2022-05-08 08:15:59 -07:00
David Gibson 1947f0d9bd Use custom color for beam lights 2022-05-07 17:21:28 -05:00
David Gibson 4aba6defdb Use custom colors for missile and laser weapon lights 2022-05-07 17:21:28 -05:00
David Gibson 29f7a38482 now parse and store light colors into weapon info 2022-05-07 17:21:28 -05:00
David Gibson 5c0b5480c8 Moves the light size multipliers one step closer to the user 2022-05-07 17:21:28 -05:00
David Gibson 20e139baf9 Now allow light setup directly via hdr color object 2022-05-07 17:21:28 -05:00
David Gibson bd9d16fd69 Lighting profiles support for tuning dynamic light values 2022-05-07 17:21:28 -05:00
David Gibson 6c473e7c09 pareshi for HDR colors 2022-05-07 17:21:28 -05:00
David Gibson e03bb48bb3 Implemented HDR color type for HDR light data 2022-05-07 17:21:28 -05:00
David Gibson e3927104bb Implemented optional parse into bool parsehi 2022-05-07 17:21:28 -05:00
Asteroth 2e4a568e2b update the swap bsp functions 2022-05-07 17:12:00 -04:00
Asteroth 326a0c32d0 fix memory leak and use tmap verts directly 2022-05-07 16:43:23 -04:00
Goober5000 4344642d3e further bugfixing and modify function return values 2022-05-07 15:08:26 -04:00
Goober5000 0e13c32d73 testing found a legit bug 2022-05-07 15:08:26 -04:00
Goober5000 79769ba76f more test cases 2022-05-07 15:08:26 -04:00
Goober5000 b404b137a0 guard against off-by-one errors in replace_one and replace_all
Also add some test cases for checking correct behavior.
2022-05-07 15:08:21 -04:00
Goober5000 c7a16a109a Merge pull request #4232 from Goober5000/fix_3860
add some UX guards to the briefing editor icons
2022-05-07 14:51:54 -04:00
Goober5000 99bbc23b64 Merge pull request #4245 from Baezon/sun-background-fix
Fix background sun positioning as well
2022-05-07 14:51:28 -04:00
Goober5000 aeedcc22a1 Merge pull request #4243 from Goober5000/fix_4240
disable Enter and Escape in the container dialog
2022-05-07 14:48:15 -04:00
Goober5000 0fb6fbec6d Merge pull request #4239 from Goober5000/fix_reset_tech_database
fix two bugs associated with custom tech databases
2022-05-07 14:47:39 -04:00
Asteroth 4dbaf40991 correct sun position too 2022-05-07 13:17:43 -04:00
Goober5000 505f8a93d0 disable Enter and Escape in the container dialog
Override some MFC signal paths to prevent Enter and Escape from doing their default behavior.  Also add a "save changes" prompt to the Cancel and Close buttons.

Fixes #4240.
2022-05-06 21:33:24 -04:00
Goober5000 9cafab6e26 clean up some parse problems in FRED
These were first noticed by @TheForce172 in PR #4241.  Instead manually editing the parse buffer, call the parsing functions to properly free the memory used by parsing the tables.  Also remove redundant calls to `ship_init`.
2022-05-06 20:01:15 -04:00
Goober5000 bb2bd3fc1d Merge pull request #4186 from Goober5000/fred_background_angle_fix
background bitmap fix
2022-05-06 18:43:38 -04:00
Goober5000 5e436dd276 fix two bugs associated with custom tech databases
1) In commit 770fce8de5, a flag was incorrectly ported from a bit to a flagset, which caused ships not in the tech db to not be removed.
2) Perhaps due to the pilot file upgrade, campaigns which had their tech databases reset would immediately load stale techroom data from the savefile.  This change writes the savefile after the reset so that subsequent reloads will load the correct data.
2022-05-05 22:42:20 -04:00
The Force f21ac8fd04 Clean-up Special stats dialog 2022-05-04 03:43:17 +01:00
The Force cb36670ce0 Clang-tidy 2022-05-04 03:39:01 +01:00
The Force bc2be1cbdf Clean-up Player orders dialog 2022-05-04 03:36:06 +01:00
The Force fa4c49e951 Clean-up Texture Replacement 2022-05-04 03:23:34 +01:00
Goober5000 4c948569c8 address feedback 2022-05-03 22:22:25 -04:00
The Force b6e259e374 Clean-up Flags Dialog 2022-05-04 03:05:52 +01:00
The Force ab307fe4a6 Clean-up Initial Status Dialog 2022-05-04 02:58:41 +01:00
Goober5000 5bde7cd1b6 Merge branch 'fred_background_angle_fix' of github.com:Goober5000/fs2open.github.com into fred_background_angle_fix 2022-05-02 19:50:29 -04:00
Goober5000 4b935731ca fix is_sun argument 2022-05-02 19:49:55 -04:00
Asteroth c1fdb640b1 add wiki link 2022-05-02 01:36:13 -04:00
Joshua Glatt 670665d0af SEXP containers, Part 6: FRED/qtFRED SEXP trees (#3852) 2022-05-01 20:27:39 -07:00
Goober5000 298265c831 replace names ending in 2 with names ending in new 2022-05-01 23:21:21 -04:00
MageKing17 65d4423b41 Make the "$Player Weapon Precedence:" list actually give precedence. (#4225)
Theoretically, the list actually had precedence when a table entry had fewer banks than the model, which would fill the extra banks with the first applicable weapon in the precedence list... except the engine `Error`s before that can happen, so it didn't actually do that. When a mission's loadout doesn't include one or more of the weapons the ship thinks it should have (i.e. it's left to its default loadout and one or more of those are missing), the missing weapons are replaced from the `Player_weapon_precedence` list. However, it didn't actually check precedence: it just went through every weapon type in order, and picked the first applicable one that also happened to be on the `Player_weapon_precedence` list.

This commit makes it so that instead of iterating through every weapon ID, we just iterate through the ones in the `Player_weapon_precedence` list (which is now a vector, thanks to #4201). Not only does this mean that higher entries in the list will be chosen first (meaning actual precedence), but since the vector will often be much shorter than `Weapon_info`, it should also take fewer iterations to find a valid weapon (or decide none of them are valid). This is technically a backwards-incompatible change, but since it only affects missions where a ship on the loadout screen lacks a weapon in its assigned loadout, it should be a relatively minor break.
2022-05-01 20:10:12 -07:00
Goober5000 30c168693b change 'fixed' to 'corrected' 2022-05-01 23:07:04 -04:00
Goober5000 ba18cecf44 add clarifying comment 2022-05-01 23:06:50 -04:00
wookieejedi fff19927e7 Add Subsystem Flag to Hide Turrets from Ship Loadout Stats (#4235)
* Add Subsystem Flag to Hide Turrets from Ship Loadout Stats

The statistics summary window in the ship loadout editor shows various aspects and stats of the selected ship. These can be toggled and customized through the ships table, but one line is actually autogenerated, `+Turrets`. This is unideal for certain ships, especially those which use turrets on ships in non-standard ways (for example having an AI controlled turret which shoots bombs). In these cases, the turrets are not actual turrets, and it is confusing for players seeing that there is a turret on the ship in the loadout editor. (I can give more detailed examples using FotG if needed).

This PR adds a subsystem flag which allows the modders to hide a turret subsystem so it is not counted in the auto generation of the `Turrets` summary line. (As a slight cleanup I also removed cleaned up the whitespace formatting on a nearby, but unrelated line).

* sync names

* fix renaming
2022-05-01 17:10:56 -04:00
BMagnu 316ef398e8 Encapsulate testing for LoS in a function and expose to Lua (#4234)
* Allow extracting userobjects from LuaTable

* Encapsulate test_los function and expose to lua

* Incorporate feedback

* Tidyup objcollide

* Fix LuaValue template

* Fix Warnings

* Fix Clang Tidy

* Update comments as suggested, Co-authored-by: m!m
2022-05-02 05:50:22 +09:00
The Force 9e8982edb4 GCC Appeasement 2022-05-01 20:22:08 +01:00
The Force 9afe340f46 Cleqanup Goals Dialog 2022-05-01 20:05:24 +01:00
The Force c07a679d87 Add TBL VIewer 2022-05-01 19:20:11 +01:00
The Force ba2ef3cb9d Fix newtype loading 2022-05-01 18:45:27 +01:00
Goober5000 53a2533169 Merge pull request #4212 from Goober5000/4088_followup
patch the freeing of SEXP nodes
2022-05-01 12:19:39 -04:00
EatThePath d698175670 Merge pull request #4222 from TRBlount/cleanup-model-code-1
Model code cleanup #1
2022-04-30 21:23:00 -05:00
EatThePath de39f591a1 Merge pull request #4020 from jg18/qtfred-replace-number-string
Implement Replace Data for Number and String in qtFRED
2022-04-30 21:22:32 -05:00
EatThePath 898bbd7260 Merge pull request #4230 from qazwsxal/bugfix/paste_proper
Clearer event editor Paste function names and saner defaults
2022-04-30 21:21:42 -05:00
The Force 30537a2ce9 Clang fix 2022-04-30 23:56:04 +01:00
The Force 328d3cce8c Try to avoid trigraph error 2022-04-30 23:43:18 +01:00
The Force b18f9ecee0 More GCC 2022-04-30 23:41:04 +01:00
The Force a5dbc27018 Cater to gcc 2022-04-30 23:33:58 +01:00
The Force c18ae68d65 Missed this 2022-04-30 23:29:29 +01:00
The Force 6c22137075 Change to new dialog loading style 2022-04-30 23:27:26 +01:00
The Force 41a3d9561d Add Tooltips 2022-04-30 23:16:04 +01:00
Goober5000 3a322edbcf Merge pull request #4224 from MageKing17/feature/unlimited-ship-flags
Allow an unlimited number of ship flags to be parsed at once.
2022-04-30 14:17:08 -04:00
The Force e3228c0241 Fix Crash Bug 2022-04-30 18:02:49 +01:00
The Force b63da42715 Memory Cleanup 2022-04-30 16:44:19 +01:00
The Force 9d6f729f81 Add TBL Viewer 2022-04-30 14:48:00 +01:00
Goober5000 fd56d8f850 Merge pull request #4231 from Goober5000/additional_script_conditions
fix up conditions for script hooks
2022-04-30 02:24:03 -04:00
Goober5000 8951dc19b1 add some UX guards to the briefing editor icons
1) Prevent the ship class from being changed if the icon image has a special closeup (like a jump node)
2) If the icon image is changed to a special closeup, automatically choose a ship class that doesn't have a custom icon

Fixes #3860
2022-04-30 01:37:48 -04:00
Goober5000 a061a08d4d address feedback 2022-04-30 01:01:02 -04:00
Goober5000 69e0f66d4b fix up conditions for script hooks
For script hooks which use conditions, be more consistent about evaluating both objects involved, as well as evaluating the different types of objects.

Fixes #3874.
2022-04-29 22:37:30 -04:00
Adam Leach f392c66c93 Swap menu order of paste commands to follow previous convention 2022-04-30 00:11:52 +01:00
Adam Leach 3d9b0c70cd Better descriptive name for paste operation. 2022-04-30 00:02:42 +01:00
Adam Leach 3b5f6424a1 Use CTRL+SHIFT+V for overwrite-paste 2022-04-29 23:58:34 +01:00
Adam Leach 5de12e2e50 move over item handle calls too. 2022-04-29 23:21:19 +01:00
Adam Leach 32c0f246e2 Revert re-ordering of menu items 2022-04-29 22:59:03 +01:00
Adam Leach b3e3fcf1d4 Updated menu name 2022-04-29 22:06:59 +01:00
Adam Leach 3f39cbd76a Clearer Paste function names and saner defaults 2022-04-29 21:41:04 +01:00
EatThePath 2e2a632055 Merge pull request #4229 from EatThePath/bad_lpt_line
Bad lpt line
2022-04-29 08:36:40 -05:00
David Gibson e2dd86ba99 Renamed a now badly named variable 2022-04-28 21:55:23 -05:00
the-maddin 0a7ff1bc1a changes jg18 v3 2022-04-29 01:28:37 +02:00
David Gibson 79c8d67281 Proper error handling for un-recognized lighting profile lines 2022-04-28 18:26:12 -05:00
Goober5000 855b7fe78c Merge pull request #4218 from Goober5000/fix_4170
make variable list parsing a little more robust
2022-04-28 18:29:10 -04:00
BMagnu 3aa6cd8a87 Add cockpit FoV (#4220)
* Add cockpit FoV

* Add override documentation for SEXP
2022-04-29 03:45:18 +09:00
MageKing17 acaa93a9d2 Avoid setting .rest for Locked_sexp_true/false with malformed SEXPs. (#4221)
* Avoid setting .rest for Locked_sexp_true/false with malformed SEXPs.

When FRED puts a `true` in the middle of a list of arguments, it wraps it in a nested list as `(true)`, because it's technically an operator; however, if someone writes a SEXP by hand, they could easily forget to do this, and in such cases, this causes `Locked_sexp_true` to be inserted into the middle of the list. If it's not the last element of the list, it will then have its `.rest` attribute set to the next node in the list. If this is a temporary SEXP (i.e. from Lua's `runSEXP()` function), this used to be a temporary problem, but PR #4088 changed the global search for any node with `.rest` set to the node being freed to require an explicit parent node. This means that `Locked_sexp_true.rest` remains set to a freed node, which can cause further issues. If such a malformed SEXP *isn't* temporary it can cause even more issues, even pre-#4088.

This commit changes `get_sexp()` so that if it detects `true` or `false` in the middle of a list (and not a single-element list), it will put it into a single-element sub-list, hopefully preventing any modification of `Locked_sexp_true` or `Locked_sexp_false`, as giving a `Warning`. This should cause it to behave as though `true` or `false` was actually `(true)` or `(false)`, respectively, and therefore run as expected.

* Add comment and remove unused variable declaration.

Thanks to @PhantomHoover for the wording on the comment.
2022-04-27 20:54:00 -07:00
Tyler Blount a2f6f791e4 Forgot some magic numbers 2022-04-27 15:22:07 -07:00
Goober5000 76bb1b6232 Merge pull request #4213 from Goober5000/hud_targetbox_flashes
add a script function to flash parts of the target box
2022-04-27 14:02:32 -04:00
MageKing17 0f3f5eeeb9 Actually clear delayed SSM parsing data when it's no longer needed. (#4223)
Back in #104, I made an *attempt* at clearing the delayed SSM parsing data once it'd been validated; however, for some reason, I only cleared half of the variables, and I only used `.clear()` rather than `.clear()` followed by `.shrink_to_fit()` (which means the same amount of memory was still reserved for these variables that would never be used again). While making #4201 I happened to comes across the "swap with empty temporary" paradigm do to both at once, so I decided to apply it to this old thing, as well as clearing all four variables rather than just two. Additionally, since these mappings don't actually care about ordering, I made them `unordered_map`s while I was at it. It's probably not a significant memory savings, but since we'd never need to use that memory after parsing, I figured we might as well reclaim it anyway.
2022-04-27 10:50:53 -07:00
MageKing17 95a0e2f17c Allow an unlimited number of ship flags to be parsed at once.
For some reason, ship flag parsing was still using a fixed-size array instead of a vector, limiting it to 20 flags parsed in a single entry. Since there wasn't really a reason to do that (it was basically parsing to a vector anyway, then resizing it down to the limit, then stuffing the C-strings into the array), I changed it to a vector.
2022-04-26 21:58:21 -07:00
Tyler Blount 33c53198a6 Update model typecast macros, add safe casts, clean up mistakes and unused function 2022-04-26 21:55:43 -07:00
EatThePath 05b94bb26b Merge pull request #4205 from EatThePath/parsehi_initial
Move of special parsing functions out of lighting_profiles into new file
2022-04-26 21:45:29 -05:00
Tyler Blount 64a213c667 Cleanup magic numbers and vertex loading for TMAPs 2022-04-26 18:35:48 -07:00
Asteroth 3e00b94a89 Early return instead of assert on 0 or less sized hud brackets (#4215)
* early return on 0 size brackets

* add comment
2022-04-26 18:10:31 -04:00
Joshua Glatt fe236b337f SEXP containers, Part 4: Text replacement (#3490) 2022-04-26 10:24:55 -07:00
wookieejedi 1de7ffc782 Fix RTT Cockpits Gauges with Change Ship Class (#4216)
* Fix RTT Cockpits Gauges with Change Ship Class

Previously, using the `change-ship-class` sexp or scripting function did not update RTT cockpit gauges. This PR adds the cockpit code update functions to fix the issue. Tested and works as expected.

* comment consistency
2022-04-25 22:18:02 -04:00
EatThePath ecac97c58a Beam light cleanup (#4211)
* beam_add_light_small() is only ever used in one place which always passes a point. Calculating the point inside is removed as redundant and obfuscating.

* Repeated beam light width calculation moved to function

* Repeated beam light state validation moved to function

* Repeated beam light noise generation moved to function

* cleanup superfluous parameter
2022-04-25 21:09:43 -05:00
Goober5000 97092997e9 make variable list parsing a little more robust
Properly report errors and warnings, and don't create duplicate variables.  Fixes #4170.
2022-04-25 18:43:38 -04:00
David Gibson e08805a5e2 actually remove the removed function 2022-04-25 16:31:48 -05:00
MageKing17 84ea99c371 Always record primary bank ammo capacity during ship creation. (#4217)
`ship_set_default_weapons()` (which is called by `ship_create()`) was only setting `swp->primary_bank_capacity` for a bank if the default weapon for that bank was ballistic; if the ship was then equipped with an ammo-using primary and the `set-primary-ammo` SEXP was used on it, it would think the bank had a capacity of zero, resulting in 0 ammo.

This commit simply moves the assignment outside of the conditional, so that primary bank capacities are always recorded in the `ship_weapon` class.
2022-04-25 19:25:31 +00:00
Goober5000 435a525e4f add a script function to flash parts of the target box
Add the `hu.flashTargetBox()` function.  Also move the `STR` macro to scp_defines.h and rename it `SCP_TOKEN_TO_STR`.
2022-04-24 23:14:49 -04:00
wookieejedi 30ae011d10 Fix Texture Replace and Team Colors with Ship Changes (#4207)
* Fix Texture Replace with Ship Changes

Tabled `$Texture Replace` did not work on ships where the class is changed in the loadout or with the `change-ship-class` sexp. This was because the replacement textures only were loaded during mission parse, and the `change_ship_type` did not account for loading new textures from ship classes that were not in the initial mission parse. Part of the bug was also that the code that updates texture replacements was after the texture page-in section of `change_ship_type`.

This PR fixes that bug by properly loading the textures in when the ship class changes. It also moves the code to within the `ship_model_change` function (which is only used in the `change_ship_type` function) so that the texture loading happens correctly before texture page in.

* fix accidental whitespace changes

* fix comment

* also fix team colors

* comment spelling fix

* appease clang

* properly clear replace textures between ship changes
2022-04-24 18:58:44 -07:00
JohnAFernandez 7466595478 Reinforcements Dialog (#3607)
Creates a working version of the reinforcements Dialog.
2022-04-24 21:40:32 -04:00
Goober5000 ca6a9017c6 patch the freeing of SEXP nodes
Followup to #4088.  A few calls of `free_sexp` (especially in `free_sexp2`) did not supply the calling node, which left inconsistent SEXP tree structures and caused a crash in TranscendE1M6.  This fixes the crash and fills in some of these places.
2022-04-24 20:41:03 -04:00
Goober5000 f394708f09 this should work 2022-04-24 18:48:12 -04:00
EatThePath c636ea5659 Remove light filtering data (#3737)
Removed useless light_ignore_objnum and affected_objnum lighting data, light_add_point_unique() subsequently removed as well, and cleaned up unused parameters.
2022-04-24 17:12:46 -05:00
Goober5000 47bd900918 moar 2022-04-24 18:12:23 -04:00
Goober5000 a6e3c74ad1 try this 2022-04-24 17:56:44 -04:00
Goober5000 0fc7c334a1 Merge pull request #4206 from Goober5000/hud_gauge_functions
add some script functions for HUD gauge data
2022-04-24 17:30:23 -04:00
Goober5000 83bd293a3a add some script functions for HUD gauge data
These are useful for adapting scripts based on whether HUD gauges are scaled and whether they use different coordinates or fonts.
2022-04-24 16:39:10 -04:00
Asteroth eb5be1c577 it wants double brackets i guess?? 2022-04-24 16:15:04 -04:00
Asteroth df39ac45d7 fill fix/unfix angles 2022-04-24 15:15:35 -04:00
Kiloku dca2ae715f Add a ship flag to allow the firing fail sound to play with locked primaries (#4203)
* Add a flag to allow the firing fail sound to play with locked primaries

* Adds an equivalent flag for Secondaries

* Make the flags accessible to FRED

* Fix whitespace mistakes

* Yet another whitespace fix

* Move primary fail sound flag check up to avoid wasting processing with unused shots

* Move secondary locked check up to avoid doing unnecessary checks
2022-04-24 13:09:50 -04:00
EatThePath 884e722109 Merge pull request #4191 from EatThePath/particlechance
Random chance of particle spawning
2022-04-23 20:23:44 -05:00
MageKing17 7184fbe781 Delay processing "$Player Weapon Precedence:" until after parsing. (#4201)
The `stuff_int_list()` call converts the weapon names into the appropriate index into the `Weapon_info` array; however, in `weapon_do_post_parse()`, we call `weapon_sort_by_type()`, which reorders the array; this makes these indices potentially point to the wrong weapon. Additionally, there's no protection against someone `+remove`ing one of the weapons in the list in a later TBM.

This commit makes it so we instead store the names into a vector of strings, then convert them into indices after `weapon_sort_by_type()` has already been called. Additionally, `Player_weapon_precedence` is changed from a fixed-size array to a vector, since it's usually not as long as `MAX_WEAPON_TYPES`.

Fixes #4199.
2022-04-23 14:55:36 -07:00
David Gibson a6611bf5b6 Corrected particle chance error handling 2022-04-23 15:29:59 -05:00
David Gibson a5091a4cb9 Move of special parsing functions out of lighting_profiles into new file 2022-04-23 14:43:35 -05:00
MageKing17 66619b9e46 Don't treat a bare <argument> as an error. (#4200)
PR #3750 made `check_sexp_syntax()` less permissive of node trees containing `<argument>`, which causes problems given that FRED saves `modify-variable`'s second argument as a `SEXP_ATOM_NUMBER`, as now `check_sexp_syntax()` complains that `<argument>` isn't a valid number. This commit both makes the `SEXP_ATOM_NUMBER` check skip the number validation logic if the `SNF_SPECIAL_ARG_IN_NODE` flag is set, as well as removing the `SEXP_ATOM_STRING` type check from the later `SNF_SPECIAL_ARG_IN_NODE` check (for making sure it's inside an `-argument` SEXP).
2022-04-22 22:16:41 +00:00
Goober5000 59064fdf89 fix bugs 2022-04-22 02:39:41 -04:00
Goober5000 af0b1fc9bb add FRED dialog support for flag 2022-04-22 02:06:16 -04:00
Goober5000 a64a587c63 save old versions of angles if background doesn't have flag 2022-04-22 00:25:14 -04:00
wookieejedi 675a806912 Fix FRED accessibility of new flag ai-attackable-if-no-collide V2 (#4194)
Turns out the `MAX_OBJECT_FLAG_NAMES` was not increased originally, so this PR increases it to match the new amount now that `ai-attackable-if-no-collide` flag was added.
2022-04-21 11:51:32 -04:00
Goober5000 e9ad970c20 Merge pull request #4192 from Goober5000/formation_fix
probably fix #4187
2022-04-21 00:17:40 -04:00
Tyler Blount d11c89d8b1 Merge pull request #4190 from Baezon/more-bsp-enhancements
More Pof space optimizations
2022-04-20 20:10:44 -07:00
Goober5000 ce6458b64f probably fix #4187
My guess is that, in `ai_ship_destroy`, if the dead ship's goal object has already died in the same frame, the `goal_objnum` will be -1 when `ai_formation_object_recalculate_slotnums` is about to be called.
2022-04-20 20:23:47 -04:00
David Gibson 0a20827620 test-ready random particle spawning 2022-04-20 18:54:22 -05:00
the-maddin e5f80a160a incorporate feedback 2022-04-21 00:32:36 +02:00
Goober5000 fa4c66dfac consolidate angle fixes into stars_fix_background_angles; add new script and sexp functions that use correct angles 2022-04-20 15:55:33 -04:00
Asteroth 8a188c56f6 add a doxy 2022-04-20 15:37:04 -04:00
wookieejedi 87ed583b28 Fix FRED accessibility of new flag ai-attackable-if-no-collide (#4189)
PR #4174 added this feature, this PR allows it to be useable with FRED.
2022-04-20 15:26:05 -04:00
Asteroth 3e2030bf01 clean up 2022-04-20 15:21:42 -04:00
JohnAFernandez 1396d44265 Basic Implementation for Attackable_if_no_collide (#4174)
A work-around for the default behavior where turrets will ignore ships that have no-collide set.  This allows turrets to target such ships.
2022-04-19 16:54:04 -05:00
Goober5000 d0c07f5dd8 Merge pull request #4172 from Goober5000/subtitle_screen_scale3
add optional flag to not change subtitle aspect ratio
2022-04-19 12:00:25 -04:00
Asteroth 527b46443b background bitmap fix, part 2
Uses simpler and more correct math for bg bitmap angles, and when old values are parsed, they are translated into correct values
2022-04-19 02:09:44 -04:00
Goober5000 f7dd1172c6 background bitmap fix, part 1
Adds the framework for loading and saving backgrounds with correct or incorrect angles.  Backgrounds in FSO will all have fixed angles internally, and newly created backgrounds in FRED will have fixed angles, but existing mission files will have incorrect angles.  The parser will determine whether the mission file contains fixed or unfixed angles and act accordingly.  (Actually fixing the angles will be done in part 2.)
2022-04-18 23:50:54 -04:00
Asteroth 2e4a657b57 more clean up and removing dead code 2022-04-18 18:05:46 -04:00
Asteroth 13a465825e swap tmap_num and nverts 2022-04-18 17:59:08 -04:00
Asteroth 943e5c395b first version of bsp space optimizations 2022-04-18 17:12:01 -04:00
John Fernandez c035f1341c Change type from int to const ubyte
This will remove the almost completely superfluous `if ( (type<0) || (type > MAX_TYPE_ID )) {` check by precluding it from ever happening.
2022-04-18 06:35:37 -04:00
John Fernandez 19ef658f56 Upgrade unknown packet type to mprintf
If we're not going to Assert that the packet type be known, at least always dump the unknown packet type to the log.
2022-04-18 06:35:37 -04:00
John Fernandez 34ba050242 Upgrade Cmdline_dump_packet_type to include length
Helps us by also dumping the amount of data that has been processed from that packet so far.

Also, dump how much data we need to get through to finish the packet correctly.
2022-04-18 06:35:37 -04:00
EatThePath f9b6bf56c9 Merge pull request #4176 from EatThePath/fso-go-brrr
Remove sound limit caps and raise max channels
2022-04-17 20:01:09 -05:00
Goober5000 4101d01e82 Merge pull request #4177 from Goober5000/fix_hud_gauge
various HUD gauge fixes
2022-04-17 19:47:09 -04:00
Goober5000 d785b9c141 tweak the function, per feedback 2022-04-17 18:38:33 -04:00
David Gibson bc2fca0469 Made allowances to not monopolize the reported max channels 2022-04-17 16:42:10 -05:00
Goober5000 681b2005ea various HUD gauge fixes
1) Fix part of the lookup logic in `hud_get_default_gauge_index`
2) Add back part of the lookup that was removed in #4003
3) Use custom checks with the `default_hud_gauges` list
4) Add a clarification comment to `default_hud_gauges`

Fixes #4171
2022-04-17 01:54:28 -04:00
JohnAFernandez a464e8615c Create commandline option for logging data packets (#4175)
* Basic logging of packet types

Add a commandline Parameter for loggin packet type

This is to help with debugging specific multi bugs.
2022-04-17 03:32:23 +00:00
David Gibson 32fe227f6d Removed the cap on enhanced sound +Limit: entirely. 2022-04-16 21:26:44 -05:00
David Gibson 1ecebe3ef3 Made the maximum number of channels used by openAL dynamic 2022-04-16 21:26:12 -05:00
David Gibson 20cea22a05 Decoupled max RTV voice channels from the enhanced sound limit. 2022-04-16 21:25:18 -05:00
Tyler Blount c7979129c7 Merge pull request #4163 from TRBlount/vertnorm_max_inc
Increase POF vertex limit
2022-04-16 10:57:18 -07:00
Tyler Blount 75cdc8efa2 Some extra feedback changes and documentation 2022-04-15 20:36:54 -07:00
Tyler Blount 10b1fa89cf Style and review changes 2022-04-15 15:38:55 -07:00
Tyler Blount a804d21764 Error reports for TMAP2 2022-04-14 20:03:17 -07:00
Goober5000 618804c1ff add optional flag to not change subtitle aspect ratio
Follow-up to #4158.  Allows use of the specified subtitle width and height in all cases, without stretching it to the screen's current aspect ratio.
2022-04-14 10:13:11 -04:00
Goober5000 bcc0d51040 Merge pull request #4158 from Goober5000/subtitle_screen_scale2
add the ability for subtitles to be scaled correctly to the screen
2022-04-14 10:11:56 -04:00
Tyler Blount 61a0973ad4 Clang tidy fix #3 2022-04-13 12:14:33 -07:00
Tyler Blount a387fdeb36 Another clang tidy fix 2022-04-13 12:00:51 -07:00
Tyler Blount e742920c93 Clang tidy fixes 2022-04-13 11:26:16 -07:00
Tyler Blount 2688e7cec5 More CI fixes 2022-04-13 11:26:16 -07:00
Tyler Blount 8066ac02cc Fix CI warnings 2022-04-13 11:26:16 -07:00
Tyler Blount 30e7747d6e More signed to unsigned conversions 2022-04-13 11:26:16 -07:00
Asteroth 38e02566c7 remove center and radius fields 2022-04-13 11:26:16 -07:00
Tyler Blount 60c39c698a Initial changes required to bump per-subobject vertex limit 2022-04-13 11:26:16 -07:00
EatThePath 4f562c73dc Merge pull request #4128 from EatThePath/Pseudo-InvSqrFalloff
Switched light shader attenuation math to something that looks more real
2022-04-12 22:41:59 -05:00
Tyler Blount 658860db57 Merge pull request #4167 from z64555/update-prebuilt01
Update PREBUILT_VERSION_NAME to latest (mac libs)
2022-04-12 18:38:41 -07:00
Adam Leach 2a7a93bbe4 Fix for #3629 (#4165)
* Zero init envmap name to prevent mistaken bm_load call, fix for #3629

* guards on envmap bm_load failure for lab renderer.
2022-04-12 21:35:06 -04:00
Goober5000 59528308a5 Merge pull request #4169 from Goober5000/subspace_sexp_preload
add preload ability for mission-set-subspace
2022-04-12 21:28:36 -04:00
Goober5000 c294d2b4ff add small optimization 2022-04-12 20:57:07 -04:00
Goober5000 0c7350dc23 add preload ability for mission-set-subspace
Page in the subspace stuff if the mission-set-subspace sexp is used.
2022-04-12 20:51:26 -04:00
z64555 ae8529e4c4 Update PREBUILT_VERSION_NAME to latest (mac libs) 2022-04-12 19:10:39 -05:00
Goober5000 00e2ef29f5 Merge pull request #4126 from z64555/actions/actions01
Fix auto-trigger for post-release build workflow, Checkout passed release tag, Fix version string
2022-04-12 12:26:24 -04:00
Goober5000 b6310539e7 Merge pull request #4162 from Goober5000/fix_subys_crash
prevent crashes in the event of a subsystem mismatch
2022-04-12 12:25:19 -04:00
Goober5000 0d982ecf52 prevent crashes in the event of a subsystem mismatch
Set the subsystem name pointers to nullptr so that we don't try to free random memory.  Also set the subsystem percentages to 0 for consistency.
2022-04-11 20:08:54 -04:00
Goober5000 fce754f899 Merge pull request #4160 from virusman/pr/mac-fix-unittests-compile
Change include order to fix compilation of unit tests on Mac
2022-04-11 19:58:00 -04:00
the-maddin e3a153ef5b Clarify abbreviations 2022-04-11 23:36:39 +02:00
virusman 51b57bc2d8 Change include order to fix compilation of unit tests on Mac 2022-04-10 21:06:28 -07:00
Goober5000 06f3bb77d1 add the ability for subtitles to be scaled correctly to the screen
By specifying a base resolution in game_settings.tbl, subtitles can be scaled to the screen in the same way as HUD gauges.  This can be used to prevent subtitles from appearing smaller at larger resolutions.

Depends on and is a follow-up to #4157.
2022-04-10 23:41:45 -04:00
Goober5000 8f48c1e3e2 Merge pull request #4157 from Goober5000/subtitle_screen_scale
add game_settings.tbl option to specify subtitle coords in pixels
2022-04-10 23:40:27 -04:00
David Gibson 9ed3eb1f2e style fix 2022-04-10 22:12:42 -05:00
z64555 b85f688080 Remove auto-include 2022-04-10 21:20:43 -05:00
Goober5000 3c695af35c Merge pull request #4155 from Goober5000/insertion_sort_update
Insertion sort update
2022-04-10 15:15:50 -04:00
Goober5000 2c64cd946d update documentation 2022-04-10 14:20:06 -04:00
z64555 32a9cace6d Remove redundant import
* clean up documentation a bit
* use a more straightforward regex for slicing out page number
* use for loop instead of while loop
* Test workflow successes differently for release and nightly
* move tag_name definition up to before its used in validation block
* Add a hopefully more straightforward existance check for tag_name
2022-04-10 12:42:15 -05:00
Goober5000 56351c6fb9 Merge pull request #4156 from Goober5000/supernova_timestamp
upgrade supernova timestamps
2022-04-10 13:31:51 -04:00
Goober5000 f3a94d4fc8 add game_settings.tbl option to specify subtitle coords in pixels
What it says on the tin.  This allows more precise positioning of subtitles, and a future PR will add the ability to scale them according to screen resolution.
2022-04-09 20:43:42 -04:00
Asteroth 916a5653dd Merge pull request #4151 from Baezon/fix-cockpit-engine-sound
Fix cockpit engine sound volume changing unexpectedly
2022-04-09 19:45:27 -04:00
Goober5000 7cc47c8233 exclude windebug from clang 2022-04-09 14:08:22 -04:00
Goober5000 06e560ae76 use move assignment when possible 2022-04-09 14:07:56 -04:00
Goober5000 4933906d18 upgrade supernova timestamps
This adds a type-safe TIMESTAMP, similar to UI_TIMESTAMP.  Eventually all of the FSO codebase will be switched over to this new type.  In the meantime, just the supernova code is switched over.
2022-04-09 13:23:03 -04:00
Goober5000 b15c00b012 Merge pull request #4153 from Goober5000/supernova_refactor
refactor supernova code
2022-04-09 13:07:14 -04:00
Joshua Glatt e0d89e41ba Add SEXP constants for containers (#4146) 2022-04-08 22:07:14 -07:00
Goober5000 2ff2aa46e4 turns out j cannot be size_t after all 2022-04-09 00:03:19 -04:00
Goober5000 0e07b07aa5 lazily copy elements of the array 2022-04-08 23:42:20 -04:00
Goober5000 dc458964c1 turn insertion_sort into a templated function that uses assignment, so that it can be used with non-POD types 2022-04-08 23:15:49 -04:00
Goober5000 256f3a46a2 fix a potential overflow due to a cast by changing the type to size_t, plus other tweaks 2022-04-08 22:34:55 -04:00
Goober5000 8fa332b869 refactor supernova code
A bit of cleanup, refactoring, and bugfixing...

1) The supernova code now uses enums to represent states, and those state transitions now all happen in `supernova_process` instead of being scattered around.
2) Some state transition bugs were fixed - e.g. the HUD is now disabled when the camera cuts to the external view, instead of when the camera stops moving; and the particles start and the simulation stops when the comments say they do.
3) There is now a game_settings.tbl flag to make the HUD countdown timer reach zero when the supernova hits, instead of reaching 5s.  This only affects the HUD display; actual timing is not changed.
4) Don't apply lightshafts if the supernova glare is in effect - partial fix for #4152.
2022-04-08 22:02:34 -04:00
Goober5000 93eeab4f67 Merge pull request #4150 from Goober5000/4078_followup
add an additional check to the convert-to-Command logic
2022-04-08 13:10:12 -04:00
Asteroth e37574d6d5 fix engine sound level at sip->max_speed 2022-04-07 22:59:41 -04:00
Goober5000 a2558bec5f add an additional check to the convert-to-Command logic
The FS1 behavior for converting wingmen messages to Command messages specifically applies to in-mission messages with multiple files corresponding to the possible senders.  There is no situation where a built-in message needs to be converted, and in fact built-in messages can't usually be substituted because most built-in messages are distinct.  This commit adds an extra check for that case.  It has the effect of "fixing" #4149 even though that isn't really a bug.
2022-04-07 00:50:47 -04:00
Goober5000 284ba488f3 Merge pull request #4111 from Goober5000/fred_object_orientation
Fred object orientation features
2022-04-06 15:04:40 -04:00
Goober5000 a159eba0ce Merge pull request #4147 from Goober5000/fix_show_subtitle
fix show-subtitle again
2022-04-06 08:33:29 -04:00
Goober5000 69e9d26c71 fix show-subtitle again
When the RGB values of the legacy `show-subtitle` were fixed (#2578) the `width` argument was inadvertently deleted, resulting in an off-by-one error for all subsequent arguments.  This fixes that.
2022-04-06 00:44:58 -04:00
Goober5000 7aaca0a84a Merge pull request #4127 from Goober5000/spooled_music_vector
vectorize Soundtracks and Spooled_music
2022-04-05 14:21:18 -04:00
JohnAFernandez d3a6d9c719 Check for valid index before accessing Weapon_info (#4145)
Use a default value if we cannot directly access it.
2022-04-05 12:49:22 -04:00
EatThePath c20ae7cd6b $AI ignores aspect lock for leading: AIP flag implemented (#4141) 2022-04-05 07:43:28 -04:00
Goober5000 ccff68164a Merge pull request #4143 from Goober5000/remove_daisy_chained_mission_flag
remove daisy-chained mission flag
2022-04-04 21:39:02 -04:00
Goober5000 0d12b0554c remove daisy-chained mission flag
This flag is not the sort of thing that should depend on the FREDder, and in any case it probably isn't needed.  So this removes it.
2022-04-04 16:03:36 -04:00
Goober5000 9e26d4a664 Merge pull request #4093 from Goober5000/player_load_hook
add player loaded hook
2022-04-04 15:58:47 -04:00
Goober5000 1b9a02ff5f Merge pull request #4101 from Goober5000/same_warp_when_docked
add flags to keep same warp effects when docked
2022-04-04 14:24:19 -04:00
Goober5000 493c9e004f add flags to keep same warp effects when docked
Same arrival warp when docked, same departure warp when docked, and associated changes to FRED, set-arrival-info, and set-departure-info.

Also fixes the nav-carry flag to properly save when a mission is saved.  Previously that flag would always be cleared.

Implements feature from #4095.
2022-04-04 12:31:03 -04:00
EatThePath 857c643253 collide_remove_weapons is too expensive. Removed it from weapon_create, instead simply don't create shots when at weapon limit. (#4134) 2022-04-04 20:49:37 +09:00
The Force 552a8ff32b Feature/texture replacement dialog (#4050)
* Files and Ui

* Finish Texture replacement editor

* Fix oversight

* Actually Save Submaps

* Appease gcc


More appeasing 


Finish error checking


Remove accidental shadowing


Appease gcc


appease clang


clang

* Really Windows?

* Enable multiedit if ship class same

* Address Error message Feedback

* Work around gcc
2022-04-04 07:38:51 -04:00
Goober5000 798eecdadf Merge pull request #4139 from BMagnu/anim_techroom
Fix techroom turret lookup and make animations more robust
2022-04-03 23:46:46 -04:00
BMagnu e2504bd162 Add 'pause on reverse' animation flag (#4084) 2022-04-04 10:39:02 +09:00
EatThePath e577e8db81 lua ship.checkVisibility mimicing sexp ship-is-visible (#4132)
* Implemented ship.checkVisibility for luaAPI, sharing logic with sexp isVisible. Made new function for the shared functionality

* Fixed a viewer-viewed mixup
2022-04-04 10:38:56 +09:00
Birk Magnussen abfa4b8fb5 Make Animations more Robust and fix techroom turret lookup 2022-04-04 10:36:26 +09:00
wookieejedi 063d7afcfe Fix destroyed submodels showing in techroom (#4138)
The check to not show `-destroyed` submodels is within `model_replicate_submodel_instance`, and that was only called for moveable submodels in the lab. This PR runs it for all submodels now. Tested and fix works as expected.
2022-04-04 09:32:07 +09:00
Goober5000 5ac80c26aa Merge pull request #4121 from Goober5000/make_target_distance_consistent
make HUD target distance consistent
2022-04-03 14:41:03 -04:00
Goober5000 4d33ed6c92 make HUD target distance consistent
Several careful tweaks to improve handling of distance as measured on the HUD.

1) Use `Player_ai->current_target_distance` for rendered HUD gauges which display the distance, because the distance is calculated in `hud_update_frame` (which is called from `game_simulation_frame`) and is used for a couple of these gauges already.  This change makes it all consistent.
1b) Some gauges which depend on distance but do not actually display it (e.g. the lead indicator) still calculate their distance immediately before using it.  I didn't change these because a) the calculation is still correct, even if redundant, and b) there is a small possibility of `hud_update_frame` changing the target after the distance is calculated, so these gauges are guaranteed to have the correct calculation.

2) On discovering that the `evaluate_ship_as_closest_target` specifically switched from bbox-distance to center-distance, I changed all "target closest X" functions to consistently evaluate center-distance.  I believe Volition did this to prioritize small fighters when dogfighting next to large ships.

3) Moved `hud_target_change_check` below the computation of `Player_ai->current_target_distance` because it uses the computed distance to determine the acceleration trend.  This way it will use the distance of the current frame, not the previous one.

4) Minor move of a `Target_static_looping` check into `hud_target_change_check` because it made sense.
2022-04-03 13:46:44 -04:00
Goober5000 7153f6b12e Merge pull request #4090 from Goober5000/nebula_background_ui
FRED Nebula background UI enhancements
2022-04-03 13:07:59 -04:00
Goober5000 a8ab80be21 Merge pull request #4135 from Goober5000/border_for_colored_events
address highlighting for events with background colors
2022-04-03 12:55:19 -04:00
Goober5000 68c8cdec1e Merge pull request #4136 from Goober5000/bastion_update
follow-up to 4074
2022-04-03 12:36:07 -04:00
Goober5000 10bfc687d9 m!m's fix 2022-04-03 12:34:54 -04:00
Goober5000 87eb2945f2 follow-up to 4074: elaborate the most common error message 2022-04-03 02:07:55 -04:00
z64555 de31fc4dc9 Create new GithubAPI class
* Add thread_url to forum.py for create_release()
2022-04-02 23:16:24 -05:00
Goober5000 47d5582a31 address highlighting for events with background colors
Events with background colors had their highlighting behavior disabled, because since an event has to be selected to add a color, users thought the color adding didn't work.  However it was pointed out in #4129 that users still would like to know which event is selected.  So this PR attempts to solve the problem by drawing a border over a selected event if that event has a background color.
2022-04-03 00:14:31 -04:00
z64555 8a410957ff Remove unused upload_url artifact
* Move doxy of upload-artifact
* Remove printing out secrets of HLP API and key (its censored, anyway)
2022-04-02 21:35:09 -05:00
Goober5000 e3c872b621 add player loaded hook
This hook will be called whenever a player is successfully loaded.
2022-04-02 18:45:46 -04:00
EatThePath db0598720d Add delay into ai_new_maybe_reposition_attack_subsys for performance reasons (#4087) 2022-04-02 14:04:08 -04:00
Goober5000 8062b67442 Merge pull request #4117 from Goober5000/fred_dynamic_iffs
dynamic IFF list in the ship select editor
2022-04-02 14:01:07 -04:00
Goober5000 636b4e81df Merge pull request #3960 from Goober5000/scripted_decals
add scripting support for decals
2022-04-02 13:57:40 -04:00
Goober5000 da02709fb0 Merge pull request #4118 from Goober5000/volition_list_range
add a class encapsulation for Volition's linked list
2022-04-02 13:57:27 -04:00
David Gibson ceb202e336 Switched light shader attenuation math to something that looks more real 2022-04-02 10:03:55 -05:00
Goober5000 3acf2d69b0 vectorize Soundtracks and Spooled_music
This removes the limits on soundtracks and menu music.  Some design tweaks are thrown in as well.
2022-04-02 00:52:43 -04:00
Goober5000 3863c8fd14 Merge pull request #4085 from Goober5000/campaign_start_hook
add campaign start hook
2022-04-01 23:59:08 -04:00
Goober5000 a75ad7573e Merge pull request #4096 from Goober5000/lua_sexp_help_updates
enhance help text for Lua sexps
2022-04-01 23:58:55 -04:00
Goober5000 dfeefad3f9 Merge pull request #4056 from Goober5000/nav_color
add capability (plus sexps) to set navpoint color
2022-04-01 23:31:08 -04:00
Goober5000 5e8c5934ed Merge pull request #4062 from Goober5000/weapon_list_iter
add missile list iterator
2022-04-01 23:31:00 -04:00
Goober5000 5324d90425 Merge pull request #4123 from Goober5000/fix_4122
Make sure that zero-length strings still get the proper height;  fixes missing whitespace in the credits
2022-04-01 23:28:17 -04:00
Goober5000 3d983207f2 bump version to 22.1.x (#4124) 2022-04-01 22:13:27 -05:00
Goober5000 67a2732c69 Merge pull request #4125 from Goober5000/22_0_changelog
21.0-22.0 changelog
2022-04-01 23:11:18 -04:00
z64555 a91833e13a Add asarium and z64555 as code owners to ci/ 2022-04-01 22:10:28 -05:00
Goober5000 363b5743eb more details 2022-04-01 22:40:24 -04:00
Goober5000 ddb69482cf changelog 2022-04-01 22:30:09 -04:00
z64555 81e86e6173 Maybe fix auto-trigger
* Move validation to before execution
* More debug messages
2022-04-01 21:27:55 -05:00
z64555 8513783049 Get version string from version_override.cmake and
version.cmake
2022-04-01 21:27:54 -05:00
z64555 3b7427c898 Checkout the given release tag, instead of HEAD 2022-04-01 21:27:54 -05:00
z64555 184bb632f6 Don't use version.cmake for versioning ID
* Use tag_name for versioning
2022-04-01 21:27:53 -05:00
z64555 ecf90fe3fe Use different changelog formatting 2022-04-01 21:27:53 -05:00
z64555 7cde6a8805 Fix bug exiting loop 2022-04-01 21:27:53 -05:00
z64555 de3d8779e8 Add python script to extract the PR titles from github for use as a human-readable changelog 2022-04-01 21:27:53 -05:00
z64555 bffd3750f8 Add POST_SIZE_MAX attribute
* Doxy ForumAPI methods
2022-04-01 21:27:52 -05:00
Goober5000 534c1f2c33 fix 4122
Make sure that zero-length strings still get the proper height.

Fixes #4122.  Follow-up to #4071.
2022-04-01 18:32:07 -04:00
Tyler Blount 1d3e62f007 Bump FSO version to 22.0 2022-04-01 14:18:23 -07:00
Goober5000 4b0c366328 fix 2022-03-31 15:21:31 -04:00
Goober5000 e362105261 tweak things and add const_iterator 2022-03-30 13:37:22 -04:00
Goober5000 8ac7853dee add a class encapsulation for Volition's linked list
This should allow collections which use the Volition linked list (for example `obj_used_list`) to be iterated using range-based `for` loops.
2022-03-29 23:39:57 -04:00
Goober5000 2232ec228f dynamic IFF list in the ship select editor
Allow all IFFs to be listed, even when the number exceeds 10.  Follow-up to #4116.  Related to #4090 as it uses the same multi-selection method.
2022-03-29 22:08:05 -04:00
Goober5000 132818ff86 Merge pull request #4116 from Goober5000/fix_4115
prevent the ship select dialog from crashing if there are too many IFFs
2022-03-29 19:20:50 -04:00
Goober5000 963e06e390 prevent the ship select dialog from crashing if there are too many IFFs 2022-03-29 13:24:54 -04:00
the-maddin ccf86293ce incorporate feedback 2022-03-29 00:59:59 +02:00
m!m d24175a393 Merge pull request #4110 from freijon/master
Don't ignore user-set LDFLAGS
2022-03-28 21:25:39 +02:00
Jonas Frei 10b68c17d2 Copy user-set LDFLAGS for clang toolchain 2022-03-28 20:50:21 +02:00
Goober5000 70d553a663 fix the formula 2022-03-28 02:17:07 -04:00
Goober5000 3c583e53f2 add flag to point ships while incorporating the ship's uvec 2022-03-28 01:56:48 -04:00
Goober5000 d195c1333c add CalcRelativeCoords dlg 2022-03-28 01:31:35 -04:00
Goober5000 77f96638d7 add independent vs relative option to the orientation editor 2022-03-28 01:11:43 -04:00
Jonas Frei 79cff94a88 Don't ignore user-set LDFLAGS 2022-03-28 06:52:17 +02:00
wookieejedi 12d391a7a5 Fix LUA Steering Control Override (#4104)
* Fix LUA Steering Control Override

I've been using `LUA_FULL_CONTROLS` in the updated mouse-as-a-joystick script, and it works well, but there's one last small bug I'd like to fix. `LUA_FULL_CONTROLS` affects things that beyond just steering values, which has the unfortunate side-effect of also overriding non-steering controls such as cruise percent. It would be less intrusive to use the `LUA_STEERING_CONTROLS`. Unfortunately, `LUA_STEERING_CONTROLS` just sets everything to 0, which I think is a code issue bug that has been around since the lua controls were added in 2010 (https://github.com/scp-fs2open/fs2open.github.com/commit/2a69aaa23ba0def3dbfb9f566706e7130a33866f).

This PR fixes usage of `LUA_STEERING_CONTROLS`, and in testing everything works as expected (including fixing the cruise percent issue). Also, I do not think there are any scripts that use `LUA_STEERING_CONTROLS`, but if desired I can make a new version called `LUA_STEERING_CONTROLS_FIXED` or something to that effect.

* correct order of if-check
2022-03-27 16:00:44 -04:00
Goober5000 3cb66670d0 Merge pull request #4107 from Goober5000/remove_parent_type
remove Object.parent_type
2022-03-27 15:22:01 -04:00
Goober5000 63445dec5a remove Object.parent_type
It's theoretically possible for `parent_type` to get out of sync with the parent's type, particularly if the parent is destroyed.  Since the field is almost never used, it can be removed.

Should fix #4105.
2022-03-27 12:38:48 -04:00
Goober5000 6198474b78 Merge pull request #4103 from Goober5000/fix_wing_editor_crash
fix a FRED crash
2022-03-26 23:57:38 -04:00
Goober5000 ceab0f82a9 fix a FRED crash
PR #4102 referred to the SEXP mini help box, which was added as a bug fix as part of #4101.  So this adds that bug fix separately.
2022-03-26 23:21:22 -04:00
Goober5000 ae5d458dde fix a bunch of FRED dialog problems (#4102)
1) Fixes the ship and wing dialog resizing for both sexp help and arrival/departure cues
2) Restores the sexp help in the Mission Goals dialog, which had been broken since the mini-help-box was added
2022-03-26 20:39:04 -05:00
EatThePath 1440200304 Added error handling to map accesses in contronconfigdefaults parsing (#4097) 2022-03-25 19:16:33 -05:00
Goober5000 e84fc4fcd8 enhance help text for Lua sexps
Two enhancements:
1) Allow the SEXP help description to take up multiple lines.  Since the parser did not originally use `stuff_string` with `F_MULTITEXT`, this required some creative parsing.
2) Generate the text for minimum and maximum number of arguments.
2022-03-25 02:09:10 -04:00
the-maddin f142780b95 clang 2022-03-25 00:55:49 +01:00
the-maddin 48f99e36b0 Merge branch 'master' into qt-campaign-editor 2022-03-25 00:22:45 +01:00
the-maddin 8bf51ff858 fix CheckedDataListModel pointer issue
(cherry picked from commit 3d4c03ede65657c38d5271cd70caa2e0eedef6bf)
2022-03-25 00:15:18 +01:00
the-maddin 84cb7fddba Export campaign model to Campaign struct
(cherry picked from commit 00ca3070063ba9859d316ac5e5da27aa67084561)
2022-03-25 00:15:15 +01:00
the-maddin 566d15dfec Add first mission selection, always keep valid
(cherry picked from commit 961a58a9b6bc261b6d11bf37a90bd457f602edc0)
2022-03-25 00:15:12 +01:00
the-maddin 0d82ca5be2 clang stuff
(cherry picked from commit 3ca042cc115372043527b94156faeb69b542aac7)
2022-03-25 00:15:06 +01:00
the-maddin 4857f320ad Saving part 2: Campaign Specs to Campaign
Move model Campaign Steps to engine campaign
struct

(cherry picked from commit 796eae1a8e003ba9b704692d460f909c20f49970)
2022-03-25 00:15:02 +01:00
the-maddin 636f6933be Ensure correct flags and loop state
(cherry picked from commit 68583f28cffa37a284b236173c29f11bf8ede1c5)
2022-03-25 00:14:58 +01:00
the-maddin a8483c5a8a Saving part 1: Output Campaign to file
Output a Campaign with ordered cmissions to a file,
like it is read.
This version does not depend on any FRED model/
implementation.

(cherry picked from commit c8aa141295de9f45813bc2bb762f3f2290ebad6d)
2022-03-25 00:14:53 +01:00
Goober5000 1454161b40 Merge pull request #4094 from Goober5000/fix_default_ship_name
fix a few bugs with display names
2022-03-24 08:53:59 -04:00
JohnAFernandez 4ed2f34cd4 Coverity 1361855 Always free Vertices and Indices (#3994)
* Coverity 1361855 Always free Vertices and Indices

* Coverity 1361844 - Same type of memory leak

Don't forget to do the same changes to sphere init

* nullptr, not NULL
2022-03-24 08:14:52 -04:00
Goober5000 15ab1c9afe fix a few bugs with display names
1) If a ship has its regular name change, clear the display name
2) When placing ships in FRED, truncate the ship name, if necessary, before creating the default name
2022-03-23 23:32:31 -04:00
Goober5000 827c00cf40 Merge pull request #4091 from BMagnu/moveable_sexp_match
Fix Moveable SEXP Matching
2022-03-23 23:31:53 -04:00
Goober5000 ad841af1b2 Merge pull request #4092 from BMagnu/moveable_update_fix
Fix edge case wrongly updating moveable
2022-03-23 23:31:43 -04:00
Birk Magnussen 3bf67572cb Fix updating rotation moveables 2022-03-23 12:45:26 +09:00
Birk Magnussen d13268e78d Fix Moveable SEXP matching 2022-03-23 11:36:13 +09:00
Goober5000 d92e8f4155 add nebula fog color override, plus missionsave support which wasn't implemented before 2022-03-22 10:27:22 -04:00
Goober5000 db9261d9d9 Merge pull request #4088 from EatThePath/run_sexp_optimize
Remove unneeded search of whole sexp node array from free_sexp
2022-03-20 23:33:20 -04:00
David Gibson 70d1abc6ff Remove unneeded search of whole sexp node array from free_sexp 2022-03-20 18:43:53 -05:00
Goober5000 475e3eb95e add ui for nebula fog color and nebula poofs, plus implement poof list 2022-03-20 19:33:37 -04:00
Goober5000 d37b4a4482 Merge pull request #4086 from Goober5000/background_fix
patch a background bug in FRED
2022-03-20 17:01:34 -04:00
Goober5000 89a50da355 patch a background bug in FRED
In FRED, deleting all suns and bitmaps should not delete the last remaining background.
2022-03-20 16:27:37 -04:00
Goober5000 375ae25ac9 add campaign start hook
This hook will be called when a campaign is started for the first time (whether in Player Select or in the campaign room), or is reset.
2022-03-20 14:48:32 -04:00
Goober5000 76a8433b5b Merge pull request #4077 from Goober5000/fix_3672
patch some holes in the mission cleanup
2022-03-19 22:58:42 -04:00
Goober5000 acc6686f67 Merge pull request #4083 from Goober5000/xstr_tweak
small XSTR qol improvement
2022-03-19 22:12:13 -04:00
Goober5000 32c5f17d15 small XSTR qol improvement
Allow `XSTR` to be used by itself, without implying an `XSTR()` tag.
2022-03-19 16:52:54 -04:00
Goober5000 12dd79a0c7 Merge pull request #4078 from Goober5000/fix_3759
be a little more careful about converting wingman messages to Command messages
2022-03-19 14:03:47 -04:00
BMagnu 2ca4616f37 Fix the Initial animations not properly setting prev_orient (#4082) 2022-03-19 11:47:32 -04:00
BMagnu 8c976a174f Improve Performance of Global to Local functions (#4080)
* Improve Performance of global to local point

* Improve Performance of global to local point dir

* Adapt Tests
2022-03-18 02:04:15 +00:00
Goober5000 cb38d89a1b be a little more careful about converting wingman messages to Command messages
FS1 has a feature which will occasionally convert a wingman message to a Command message.  This adds a few more checks to that feature:

1) Make the command-conversion code and the alive-check code mutually exclusive;
2) If the filename is not a FS1-style persona, don't change either a) the filename, or b) the talking head

Fixes #3759.
2022-03-16 23:12:44 -04:00
Goober5000 4b29f51b0e patch some holes in the mission cleanup
Bug #3672 was caused by the dead popup not being cleaned up properly when the player-dead state was left.  Closer examination revealed some possible holes in the cleanup logic - e.g. the game assumed that the mission would proceed to the debriefing but neglected the possibility that it would exit to the main hall.  This consolidates the two dead states and attempts to make the cleanup more robust.

Fixes #3672.
2022-03-16 21:41:35 -04:00
Goober5000 4dbdcd3783 some debug console updates (#4074)
Tweak the help for the 'bastion' command and change 'dcf_fov' to 'fov'.  Also add a new 'mainhall' command that can be used in the main hall, not just the player select screen.
2022-03-15 20:50:46 -05:00
Goober5000 d7fc0bdf8e Merge pull request #4075 from Goober5000/fix_3996
fix message list crash
2022-03-15 21:05:54 -04:00
Goober5000 e41077e07f fix message list crash
PR #3342 meant that occasionally FRED would try to save a message that didn't exist.  Make sure the old saved index doesn't point past the end of the valid message list.

Fixes #3996.
2022-03-15 20:32:53 -04:00
Goober5000 9ca14b6dd2 Merge pull request #4072 from Goober5000/patch_decals
prevent decals from being used on invalid objects
2022-03-13 22:22:27 -04:00
Goober5000 bd1cf2d07d prevent decals from being used on invalid objects 2022-03-13 21:55:44 -04:00
Goober5000 4b50fe5eca Merge pull request #4071 from Goober5000/fix_text_split
fix off-by-one error in text splitting logic
2022-03-13 15:02:39 -04:00
Goober5000 48ea08219e fix off-by-one error in text splitting logic
`gr_get_string_size` takes a length parameter, but `split_str_once` was calling it with the position instead.  This led to incorrect results occasionally.  If the incorrect pixel width had the bad luck to be exactly equal to the remaining space, this would cause an infinite loop.  This fixes the bug and adds a bunch of safeguards to prevent a similar situation in the future.
2022-03-12 22:58:03 -05:00
BMagnu e2e689d454 Properly set canonical_prev_orient and exclude turrets (#4070) 2022-03-12 17:46:14 -05:00
Asteroth d86ebd5eb2 Remove new assert in model_instance_local_to_global_dir (#4069)
* remove assert and clarify hit_normal

* remove other asserts too
2022-03-12 11:55:29 +09:00
BMagnu 471c4991eb Make Anim Validation Case Insensitive (#4068) 2022-03-10 10:16:23 -05:00
Goober5000 26417e2154 Merge pull request #4064 from Baezon/fix-target-bracket
Targeting brackets should use the header's bounding box, not detail0's
2022-03-09 23:45:09 -05:00
BMagnu 222f3e00a7 Fix moving submodel collision speed calculation (#4067) 2022-03-10 01:35:34 +09:00
BMagnuandGoober5000 9ab7a4626a Fix nested and animated submodel collisions (#4065)
* Calculate per-frame rotation axis

* function prototypes

* Add new submodel localization functions

* Fix collision detection for moving submodels

* Remove offending assert

* Add safeguard for stopped animations

* Fix last frame speed calc

* Fix childs with parent submodel rotations

* Fix Warnings

* Clang Bug Workaround

* clang tidy

* Incorporate Feedback

Co-authored-by: Goober5000 <[email protected]>
2022-03-09 23:49:11 +09:00
Taylor Richards 593372eea4 Merge pull request #4063 from notimaginative/fix_bsp_swap
swap bsp data before alignment
2022-03-07 22:43:45 -05:00
Asteroth 5f3dc91a24 use header's bbox, not detail0's 2022-03-07 20:15:52 -05:00
Taylor Richards 3e2008c23c swap bsp data before alignment
Changing endianess of bsp data must be done before any other
bsp processing
2022-03-07 08:25:37 -05:00
Goober5000 a047be61d5 add capability (plus sexps) to set navpoint color
This is useful because certain backgrounds (such as a nebula) will make it hard to see the default navpoint color.  Also this means that different navpoints can now have different colors.
2022-03-07 03:32:50 -05:00
Goober5000 79c096a488 add missile list iterator
Add mn.getMissileList(), similar to mn.getShipList().  See also #3660.
2022-03-07 03:27:11 -05:00
Allen A. Babb 9b34225522 Fixes the version string in main.py (#4060)
* Form version string based off of tag_name
* Use checkout@v3
* Update documentation
2022-03-06 20:37:25 -06:00
Goober5000 b01137ab53 Merge pull request #4059 from Goober5000/warp_tweaks
two small but important warp fixes
2022-03-06 21:12:27 -05:00
Goober5000 45ead0645c Merge pull request #4061 from Goober5000/clean_up_support_goals
fix support ships breaking in in-mission jumps
2022-03-06 21:12:07 -05:00
Allen A. Babb fe0b3d2099 Clean out player t_plr before use (#4058)
* Clean out player t_plr before use
* Directly reference t_plr instead of player* p
* player* p Needs to be set in ::verify() for other pilotfile:: methods to work
2022-03-06 15:16:25 -06:00
Goober5000 d7c2a962ff fix support ships breaking in in-mission jumps
If a support ship's repair goal is removed, abort the rearm.  There is extra cleanup that needs to be done for this goal only.
2022-03-06 15:30:14 -05:00
Allen A. Babb afce512f55 Repair Automated Forum and Nebula Scripts (#4052)
* Document things
* Maybe use a format that doxygen can understand
* Use dict comprehension to clean up main.groups a bit

* More docstrings

* Move FileGroup into module its supposed to be in

* Remove nightly-trigger.yml

* Rename workflow files to better describe their actions

* Re-add post build capabilities
* Post-build may be triggered by build-release.yaml or manually
* minor doc update to file_list.get_ftp_files()

* Maybe fix yaml errors

* "You have a syntax error on L345" Gee, thanks github debugger. Could you tell me what exactly that error may be?

* More fixes

* More fixes

* fix typo

* fix typo

* Allow manual trigger to specify releaseTag

* Try omitting the default for string

* Use correct .inputs member

* try environment instead of env

* Try elevating scope of env

* Comment out stuff to directly test env passing

* See if echo is working correctly

* Test if top level env is in scope

* Try github.event instead of github.events

* Uncomment lines, use correct context signature

* Pass ref_name to post-build-release workflow

* Fix arguments to git
Stash linux package since it can fail, too

* str and repr cannot be compared

* Get repo metadata differently to allow tests on forks

* echo repository var

* config["templates"] does not have a member ["installer"] so... we'll use ["release"] instead

* debug render_installer_config.  file groups malformed?

* Print out both keys of groups dict

* debug get_release_files. print binary_file list

* Revert file_list debug print
Try sorting binary_files by ReleaseFile.name

* Add checks before running mako to improve debugging QoL
* revert change to installer.py
* maybe fix call to render_nebula_release
* type the files argument to get IDE hints

* Revert typing.... :(

* missing parenthesis

* Disabled installer mako rendering

* Error check in ForumAPI to allow tests to continue

* debug print hlp forum key stuff

* Instead of none, check ""
2022-03-05 21:48:01 -06:00
Goober5000 310898dfd9 two small but important warp fixes
1) Don't knock the player out of the warp if the sequence has already moved to stage two.  It breaks the sequence and the game will still end the mission anyway.
2) Remove the Volition code for calculating player speed.  It did not actually affect the speed, but it *did* affect the calculation of warp distance which often caused the player's ship to miss the portal.
2022-03-05 20:37:40 -05:00
Goober5000 18a8e280dc add scripting support for decals
This extends the existing decal system so that decals can be created through scripting.
2022-03-01 19:07:39 -05:00
m!m 9b16413f5f Merge pull request #4054 from asarium/fix/decalOrientation
Fix render orientation for decals
2022-03-01 20:58:20 +01:00
asarium ac77a6eb77 Fix render orientation for decals
The orientation was broken since the engine rendered the decal box in
the direction of the hit normal which meant that the viewer was looking
at a flipped version of the decal texture.

This fixes that by flipping the direction of the decal before passing it
to the GPU.

This also fixes the orientation for weapon decals which previously did
not take the orientation of the weapon that just impacted into account.
2022-03-01 19:14:34 +01:00
m!m aac5e35a6e Merge pull request #4053 from asarium/fix/decalOffset
Fix uniform offset calcuation for decal header
2022-02-28 19:16:01 +01:00
asarium 6c99c4f48e Fix uniform offset calcuation for decal header
This was broken by the move to a single, global uniform buffer where we
started doing suballocation so offset 0 was reading bad data.

Also fixed a crash regarding an unknown locale name on Linux.
2022-02-28 18:49:53 +01:00
Joshua Glatt 5daea9dc0f Fix Windows debug heap assertion when using Edit Data in qtFRED (#4018) 2022-02-27 14:56:54 -08:00
Goober5000 6ae5a8555c Merge pull request #4051 from Shivansps/fix_align_bsp_data_access_violation
Dont try to read chunk size if chunk type is 0
2022-02-24 12:55:30 -05:00
Shivansps 5235f14473 dont try to read chunk size if chunk type is 0
Chunk type 0 is EOF and lacks the following int indicating the total chunk size.
2022-02-23 19:07:19 -03:00
Allen A. Babb 143f64129d Changes to build-release.yaml (#4044)
* Try using softprops/action-gh-release

* Try *_path instead of *_name

* Document action dependencies
* Use consistent versioning in some places

* Maybe continue windows_zip should an upload fail

* Skip building standalone image if not on source repo.

* Stash the windows zips to artifact ftp in case the publish steps fail.
* Combine publish steps into one step
2022-02-23 09:59:48 -06:00
BMagnu 0b0f323091 Fixed incoherent case sensitivity for animation submodels (#4047) 2022-02-22 18:03:41 +00:00
Goober5000 4559d15327 Merge pull request #4045 from Goober5000/fix_popup_time
fix time resuming when popups are closed
2022-02-22 01:01:14 -05:00
Goober5000 1e067113a5 tweak name, per feedback 2022-02-22 00:31:04 -05:00
Goober5000 ac5142df8a fix time resuming when popups are closed
If time is already stopped when a popup is displayed, it should remain stopped when the popup is closed.
2022-02-21 18:50:12 -05:00
Goober5000 58ac0dfdf2 Merge pull request #4043 from Goober5000/fix_keep_safe_distance
fix the keep-safe-distance AI mode
2022-02-20 22:38:18 -05:00
Goober5000 6496059979 fix the keep-safe-distance AI mode
There were two bugs that kept this from working until now:

1) The destination goal point was calculated to take the ship right through the center of danger.  Flipping the vector now takes the ship away from danger as intended.
2) The original AI code did not turn the ship at all.  The new code turns the ship toward its goal point.

The fixed behavior is tied to the new `$fix keep-safe-distance:` flag.
2022-02-20 22:07:31 -05:00
Allen A. Babb 97eb72b3b4 Set key to -1 and let CCB::take() do the actual binding later on... instead of overwriting changes. (#4042) 2022-02-20 19:10:23 +00:00
Goober5000 6a3794ca17 Merge pull request #4038 from Goober5000/patch_glowpoint_normals
prevent Assert with glowpoints
2022-02-19 20:45:02 -05:00
Goober5000 95d0036aeb Merge pull request #4039 from Goober5000/ship_registry_fix
fix an edge case for ships destroyed before mission
2022-02-19 20:44:47 -05:00
Goober5000 1b69e6e3ad fix an edge case for ships destroyed before mission
Make sure the ship registry correctly records these ships as having exited.
2022-02-19 19:46:33 -05:00
Goober5000 a1d92251cb prevent Assert with glowpoints
It's legal for glowpoints to have a zero vector as a normal, apparently, so test for this.
2022-02-19 19:23:48 -05:00
Goober5000 71c7875dbf Merge pull request #4037 from Goober5000/scanning_features
add some new scan features
2022-02-19 02:18:45 -05:00
Goober5000 237787c256 add some new scan features
1. Add custom scan times per subsystem
2. Add scanning time and range multipliers for player ships

Resolves #4027
2022-02-18 22:39:04 -05:00
BMagnu 55cbabb05c Improve costly RTT sanity check (#4036)
* Improve costly sanity check

* Remove commented code and improve documentation
2022-02-18 03:48:26 +09:00
Kiloku 6201309aa6 Adds -deadzone parameter to command line (#3915)
* Adds command line parameter for finer deadzone control
2022-02-17 09:06:31 -06:00
Goober5000 caa3ea05f0 Merge pull request #4031 from Goober5000/scripted_submodels
add scripting support for submodels
2022-02-17 02:34:06 -05:00
Goober5000 54ff2f00ed more updates 2022-02-17 01:57:34 -05:00
Goober5000 dc2d3ae623 fix compilation and address feedback 2022-02-16 23:57:54 -05:00
Goober5000 57705db466 add scripting support for submodels
Allow scripts to reference submodels, submodel instances, and model instances.  Currently just a few properties (like Orientation and Radius) can be accessed, but this can be easily expanded in the future.

Also add relevant functions to calculate real-world positions and orientations of rotated submodels.
2022-02-16 21:45:23 -05:00
Goober5000 b005d4ab3b Merge pull request #4033 from Goober5000/submodel_function_refactor
rename and document several model coordinate functions
2022-02-16 21:42:37 -05:00
wookieejedi 1c19238e70 Expand scripting string functions (#4035) 2022-02-16 17:04:47 -05:00
Goober5000 e2f63a2340 rename and document several model coordinate functions 2022-02-15 20:59:24 -05:00
Goober5000 fad086bc15 Merge pull request #4030 from Goober5000/submodel_calculation_cleanup
clean up model point/dir/normal/orient functions
2022-02-15 13:46:22 -05:00
Goober5000 5536832ef2 Merge pull request #4032 from Goober5000/isvalid_fix
fix another isValid scripting function
2022-02-15 00:45:07 -05:00
Goober5000 09da73eec8 fix another isValid scripting function 2022-02-15 00:02:05 -05:00
Goober5000 f0371cdb0c clean up model point/dir/normal/orient functions
Consolidated these functions and replaced the `find_submodel_point_*` functions with their closest `world_find_` counterparts.  (One of those functions may not have actually worked correctly.)  Also use the correct coordinate logic when returning normals from collision info in scripting.

Related to #3985 although not yet a fix for it.
2022-02-14 23:46:43 -05:00
Allen A. Babb 71773bfa95 Don't nullify axis_out[action] value when using mouse as joy (#4029) 2022-02-14 16:18:13 +00:00
Goober5000 b8203ecd7f Merge pull request #4026 from Goober5000/return_object_with_breed
a few scripting bugfixes
2022-02-14 07:47:22 -05:00
Goober5000 4fe11d8449 a few scripting bugfixes
When returning objects, be sure to use `ade_set_object_with_breed`, per the documentation on that function.  This ensures that all relevant subclass information can be used.

Also fix the return value of streaminganim's isValid() function.
2022-02-13 23:31:16 -05:00
Tyler Blount a9338510e1 Merge pull request #4025 from z64555/mouse_to_joy0
Mouse to joy0
2022-02-13 19:59:31 -07:00
Allen A. Babb 789dc3b529 Merge pull request #4024 from scp-fs2open/revert-3954-mouse_to_joy0
Revert "Treat Mouse as Joy0 if "turned on" in options menu"
2022-02-13 19:48:59 -06:00
Allen A. Babb c7de39c50c Revert "Treat Mouse as Joy0 if "turned on" in options menu (#3954)"
This reverts commit ff8c4cdf68.
2022-02-13 19:08:52 -06:00
Allen A. Babb ff8c4cdf68 Treat Mouse as Joy0 if "turned on" in options menu (#3954)
* Treat mouse axes as Joy0 axes if Use_mouse_to_fly is true.

* Treat mouse buttons as Joy0 buttons when Use_mouse_to_fly is true
* Don't spin out of control like a 3yo on pixie sticks when treating the mouse axes as Joy0 axes

* Address CI Issues 1

* Try FALLTHROUGH macro to appease the compiler gods.

* * Change the labels in the Options menu UI for the Mouse On/Off buttons
* Nudge the hardcoded postions for the labels for bothGR_640 and GR_1024 resolutions
* Adds the following XSTR indices
  1665 "Mouse Input Mode"
  1666 "Joy-0"

* Update player_tips_controls() to mention the changes to the Mouse Input Mode
2022-02-14 00:08:23 +00:00
z64555 6a15f5ef48 Update player_tips_controls() to mention the changes to the Mouse Input Mode 2022-02-13 17:02:05 -06:00
z64555 fcfdb2942b * Change the labels in the Options menu UI for the Mouse On/Off buttons
* Nudge the hardcoded postions for the labels for bothGR_640 and GR_1024 resolutions
* Adds the following XSTR indices
  1665 "Mouse Input Mode"
  1666 "Joy-0"
2022-02-13 16:12:57 -06:00
z64555 de04373727 Try FALLTHROUGH macro to appease the compiler gods. 2022-02-13 16:08:13 -06:00
z64555 3719bcc36d Address CI Issues 1 2022-02-13 16:08:13 -06:00
z64555 f84e5782d7 Treat mouse buttons as Joy0 buttons when Use_mouse_to_fly is true
* Don't spin out of control like a 3yo on pixie sticks when treating the mouse axes as Joy0 axes
2022-02-13 16:08:12 -06:00
z64555 e5ba711645 Treat mouse axes as Joy0 axes if Use_mouse_to_fly is true. 2022-02-13 16:08:12 -06:00
Allen A. Babb cf83573b2a Improve Pilot version checks (#3988)
* rename pilotfile::version to pilotfile::plr_ver
* Fix typo in warning message
* set plr_ver and csg_ver to PLR_VERSION_INVALID on init and close
* add PLAYER_FLAGS_PLR_VER_LOWER and *_CONTROLS flags to player defines
* Add popup to intercept the player before going into the mainhall with an old pilot
* Move the Constrols5 info popup into the mainhall
* Modifiy pilotfile::verify() to allow player flags to be passed on to callers

* Rename valid_pilot_lang() to valid_pilot()
* valid_pilot() checks plr_version of the pilot and prompts the user if they want to continue loading or not
* add no_popup param to valid_pilot() to allow scripting to use it

* Correctly clear the PLR_VER_CONTROLS player flag
* operator== is not operator+=
* don't clear player flags when closing a pilot file
* player tips popup comes after any warnings
* save committed pilot on playermenu close
* doxy playermenu::player_creat_new_pilot() and magagepilot::init_new_pilot()

* * add validation/safety catch in the barracks to prompt user if they want to select/convert a pilot with version mismatch
* PLAYER_FLAGS_PLR_VER_CONTROLS is a savable flag, cleared in the mainhall after the popup is dismiessed
* Move version flag sets in plr::load_player() and plr::verify() after calls to player_read_flags()
* Drop hints to players they should use a clone of the pilot in version prompt.
* Went ahead and added a VERSION_HIGHER flag and conditional in valid_pilot()
* Move Controsl5 notice popup into playermenu, next to the player_tips_pop().  Also allows player to "Don't show this again"

* Ignore plr version flags during unit tests since .plr -> .json conversion is never a pure clone

* Address CI issues:
* clang-tidy: use nullptr (modernize-use-nullptr)

* Add XSTR support to valid_pilot() and player_tips_constrols() popups.

* * Rename new PLAYER_FLAGS to something more descriptive
* Edit Popup text to be a bit more concise
* Add missing punctuation to language popup
2022-02-13 16:07:01 -06:00
Goober5000 244d220358 Merge pull request #4022 from Goober5000/ui_timestamp
another timestamp upgrade
2022-02-13 14:32:38 -05:00
Allen A. Babb 3e227b41c4 Restrict allowable characters for preset names (#4009)
* Doxy UI_INPUTBOX methods
* extend popup_input to allow non-alphanum character whitelist
2022-02-13 13:06:07 -06:00
Goober5000 eb29d065a2 Merge pull request #4019 from BMagnu/anim_axisrot_fix2
Fix Aix Rotation Moveable
2022-02-12 20:30:11 -05:00
Goober5000 c6d87b0626 there is now no longer a need to keep timestamps running during briefing, so keep them paused until the mission starts 2022-02-12 19:34:01 -05:00
Goober5000 0c8cfd160b improve the UI_TIMESTAMP type a bit 2022-02-12 19:34:01 -05:00
Goober5000 8e2e825204 add UI_TIMESTAMP type and switch some timestamps to use it 2022-02-12 19:01:15 -05:00
Goober5000 a0815e4fe6 Merge pull request #4014 from Goober5000/event_log_tweaks
event logging tweaks
2022-02-12 15:30:30 -05:00
Goober5000 b5721c67cc Merge pull request #4015 from Goober5000/operator_patches
improve robustness of sexp operators
2022-02-12 13:38:22 -05:00
Birk Magnussen 478edf50f6 Fix Aix Rotation Moveable 2022-02-12 16:52:39 +09:00
Joshua Glatt d129bcb6b7 revert unrelated but necessary fix 2022-02-11 23:51:18 -08:00
Joshua Glatt 2403cd7c44 add Replace Data for Number/String 2022-02-11 23:18:03 -08:00
Goober5000 c3adf704f8 improve robustness of sexp operators
1) Remove operator caching from `is-cargo-known-delay`, `cap-subsys-cargo-known-delay`, and `has-been-tagged-delay` so they can be used with `when-argument`
2) Note idiosyncrasies of `and-in-sequence` in SEXP help
3) Document logic for inverting known-true and known-false in `sexp_not`

Should fix #4013.
2022-02-10 22:17:21 -05:00
Goober5000 fe40f87606 event logging tweaks
A couple quality-of-life improvements for event logging:
1) Indent the SEXP operators according to their depth in the node tree
2) Add newlines between variables and containers
2022-02-10 21:15:15 -05:00
BMagnu b6474f795c Fix rotation localization (#4012) 2022-02-10 22:43:59 +09:00
Goober5000 2fde893be1 Merge pull request #4007 from Goober5000/fix_camera_orient
fix the camera flicker in the lab
2022-02-06 23:44:12 -05:00
Goober5000 5b87ed3f73 fix the camera flicker in the lab
As @Baezon figured out, when a host exists, `get_info` will return the orientation relative to the host.  When there is no host, `get_info` returns the absolute orientation.  In the latter case, `set_rotation_facing` does not need to do extra calculations to find the delta orientation.

Follow-up to #3989.
2022-02-06 23:06:06 -05:00
Goober5000 6a2e6e7c7d Merge pull request #4006 from Goober5000/fixed_missile_detonation
fix missile detonation for computers with high FPS
2022-02-06 18:39:57 -05:00
Goober5000 29a0736d34 fix missile detonation for computers with high FPS
There is a bit of code that detonates a missile if it misses impacting on a subsystem.  On Nyctaeus's Arachnas model, missiles could reach the center point of the main beam turret submodel without actually hitting any part of the submodel.  The fail-safe code would set the missile to detonate in that case, but on low-FPS systems the weapon would be able to actually hit the turret before it detonated.  On high-FPS systems, there is a clean miss.

This reworks the code to delay the missile detonation until it reaches the other side of the submodel, so it has time to hit some other part of it.  It also reduces the detonation time from 1/100 of a second (which is more than one frame on 120 FPS systems) to 1/1000 of a second (which is always less than one frame).
2022-02-06 17:53:19 -05:00
Goober5000 41b7f9ff1a Merge pull request #4003 from Goober5000/hud_gauge_and_string_upgrades
Hud gauge and string upgrades
2022-02-06 12:02:30 -05:00
Goober5000 18661ae4dd reverse check here because Lua will treat numbers as strings 2022-02-05 21:14:07 -05:00
Goober5000 89b9323705 fix documentation for unit tests 2022-02-05 15:46:37 -05:00
Goober5000 2e839eda0a rename hud_get_gauge to hud_get_custom_gauge for clarity 2022-02-05 15:14:23 -05:00
Goober5000 c05569180e upgrade gr.drawString to be able to use a custom sizing mode 2022-02-05 15:12:29 -05:00
Goober5000 5cf1b7ffc6 upgrade scripting to reference hud gauges by name or index, and allow a scripted hud gauge object to represent a default gauge 2022-02-05 15:11:21 -05:00
Fabian Woltermann 79d5288163 Merge pull request #4001 from The-E/fix/4000_mainhall_misc_anim_delay
Preserve the table-defined offset for initial misc animation playback
2022-02-04 17:12:26 +01:00
Goober5000 4864a1ff8b Merge pull request #4002 from Goober5000/set_skybox_check
when changing the skybox, check to see if it's the same as the current one
2022-02-04 00:05:16 -05:00
Goober5000 4ae246be57 when changing the skybox, check to see if it's the same as the current one 2022-02-03 22:43:22 -05:00
Fabian Woltermann d40d904be3 Set the first element of the misc anim delay structure during parsing, for aesthetic reasons 2022-02-03 16:54:38 +01:00
Fabian Woltermann 6ade65929c Update comments 2022-02-03 08:32:14 +01:00
Fabian Woltermann d120117899 Preserve the table-defined offset for initial misc animation playback 2022-02-02 21:35:58 +01:00
BMagnu e7d9f5a555 fix absolute moveable (#3995) 2022-02-01 05:08:39 +00:00
wookieejedi 34e74aad7b Fix limitations of GetColor script function (#3992)
* Fix limitations of GetColor script function

It is very valuable for custom HUD gauges to be able to show/use the IFF color of any given object. Previous scripting solutions were limited and did not account for traitor status, varying team combinations (i.e. TvT multiplayer), and other cases.

This PR allows scripters to get the IFF color of a given object properly, as it uses the same method that retail HUD gauges use.

Also, it turns out there was already a function `hud_get_iff_color` defined in `hud.h` It was never used though, as `hud_set_iff_color` both got the color then set it. I've added the color getting to the get function and the setting to the set function, that way the script function can easily just call the `hud_get_iff_color` function. If this is undesirable I can instead copy the entire logic of the function `hud_set_iff_color` into the script section.

Tested and works as expected.

* fix nil return

* clarify param comments
2022-01-31 23:33:19 +00:00
JohnAFernandez fba5521583 Merge pull request #3993 from JohnAFernandez/Fix-client-zombie-missiles
Partially revert 3313 to fix missiles never dying
2022-01-31 11:58:17 -05:00
Goober5000 42f834c115 Merge pull request #3989 from Goober5000/fix_3889
point camera correctly when using set-camera-facing
2022-01-31 01:21:12 -05:00
JohnAFernandez 9c7b0fbcd5 Merge pull request #3991 from JohnAFernandez/fix-edge-case-rollback-crash
Fix edge case rollback crash
2022-01-30 23:12:19 -05:00
Goober5000 6ab17aba2a move inline functions to the header file so Linux will compile 2022-01-30 22:58:24 -05:00
Goober5000 d8987b3de0 set some mod flags by default in 22.0 2022-01-30 22:58:24 -05:00
Goober5000 f6a903f2b9 correctly calculate the vector for pointing the camera 2022-01-30 22:58:24 -05:00
Goober5000 8a29586ef5 properly calculate submodel host orient 2022-01-30 22:58:24 -05:00
JohnAFernandez f5517eb782 Partially revert 3313 to fix missiles never dying
This should allow the client to cull missiles with no lifetime left once again.
2022-01-30 22:48:27 -05:00
JohnAFernandez c0b9d6a5e1 Move nprintf to better spot
The log would sometimes lie to us otherwise.
2022-01-30 22:25:07 -05:00
JohnAFernandez 82f343cd97 Make sure we don't set the frame to the one we're about to increment to
Which actually fixes the bug which caused everything in the first place
2022-01-30 22:23:55 -05:00
Goober5000 bd90781499 rename a couple variables for clarification 2022-01-30 22:23:44 -05:00
Goober5000 059babea50 add game_settings flag 2022-01-30 22:23:44 -05:00
Goober5000 73076f4909 Merge pull request #3990 from Goober5000/fix_broken_rotation
regression fix for rotating submodels
2022-01-30 22:17:34 -05:00
Goober5000 64724f8cc2 regression fix for rotating submodels
The POF format relies on some of the IDs being the values they are, so this change restores the original numbers.
2022-01-30 21:51:31 -05:00
wookieejedi 5e6119be25 Fix Damage Gauge Display (#3987)
Previously, the damage display gauge only showed the integrity for subsystem types. This was fine if there were a 1:1 match, with each type only having 1 subsystem. If there were more then 1 subsystem of a given type though, it would not display accurate information to the player.

This PR sets the displayed subsystem integrity to that actual specific subsystem, not the aggregate. Tested and works as expected (screenshot attached) and fixes #3982.
2022-01-30 17:34:24 -05:00
Goober5000 39213b9d75 Merge pull request #3979 from Goober5000/model_translation_phase_1
refactoring in preparation for model translation
2022-01-30 13:47:59 -05:00
BMagnu 79be6bb32d Fix edge case for turret lookup with template and display name (#3981) 2022-01-30 13:14:33 -05:00
Goober5000 df77ee7cf4 doh 2022-01-29 23:20:37 -05:00
Goober5000 2833b89d38 address feedback 2022-01-29 22:48:27 -05:00
BMagnu cacb1baa50 Improve Animation SEXP usability (#3976)
* Make the new animation SEXP use proper field checking and add suggested entries

* Clarify the animation SEXP description text
2022-01-30 10:27:30 +09:00
Goober5000 97952d6b6c refactoring in preparation for model translation
Mostly renaming of fields and functions, and moving some modelread sections into functions.  This reorganization will put the code on a better footing for the model translation feature.  No model translation code is included yet, and there should be no change in functionality.
2022-01-29 15:53:21 -05:00
Goober5000 d673b25041 Merge pull request #3978 from Goober5000/axis_inversion_upgrade
handle primary and secondary inversion explicitly and independently
2022-01-29 12:18:58 -05:00
Goober5000 fda33ec1fc handle primary and secondary inversion explicitly and independently
Treating both bindings together will fail when a player has one binding inverted but the other uninverted.  This was complicated by the dual-binding method mysteriously delegating to the single-binding method in certain cases.  This change removes the dual-binding methods altogether and explicitly handles the bindings individually.  It also adds additional scripting VIRTVARs for all current use cases.
2022-01-29 11:40:49 -05:00
Goober5000 244a1aac26 fix initial positions of submodels in FRED (#3975)
The new animation system sets submodel initial positions on ship creation, but FRED was also indirectly setting them by calling the techroom method.  Initial positions will not work correctly if they are set twice.
2022-01-29 04:30:41 +00:00
Goober5000 4cafff10b9 Merge pull request #3972 from BMagnu/anim_4_fixes
Various Animation Fixes
2022-01-28 22:10:27 -05:00
Goober5000 023d8c0acc Merge pull request #3974 from Goober5000/fred_bbox_fix
use the whole submodel hierarchy in FRED
2022-01-28 22:05:04 -05:00
Birk Magnussen 43078c9d27 Fix moveable flicker by forcing recalculation outside of animation stepping 2022-01-29 11:30:29 +09:00
Birk Magnussen e58af85c03 Keep canonical_prev_orient correct 2022-01-29 11:21:20 +09:00
Goober5000 ac2f474581 use the whole submodel hierarchy in FRED
The `fredhtl_render_subsystem_bounding_box` function only handled one level of submodel positioning, which worked for turrets but not more complicated submodel stacks like the Ma'at.  This properly handles all submodels in the hierarchy.

Fixes #3971.
2022-01-28 21:20:32 -05:00
Birk Magnussen adfc8e0db9 Log addition of Can_move flag 2022-01-29 11:18:52 +09:00
Goober5000 d84ec680af Merge pull request #3970 from Goober5000/submodel_rotation_lod_fix
replicate submodels that aren't associated with subsystems
2022-01-28 10:53:43 -05:00
Birk Magnussen e862c2775e Tidy up 2022-01-28 16:34:39 +09:00
Birk Magnussen 4ce2d3e029 Fix various issues in vm_closest_angle_to_matrix 2022-01-28 16:30:59 +09:00
Birk Magnussen 3aa44671d5 Set can move flag for all submodels that have been requested by the animations 2022-01-28 16:30:27 +09:00
Goober5000 7674474bb9 make clang happy, and anticipate a potential problem in the collision code 2022-01-28 01:05:42 -05:00
Goober5000 68fc947832 replicate submodels that aren't associated with subsystems
There are a few related improvements here:

1) Add a new function for iterating over the submodel hierarchy
2) Add a counterpart to the `subobj_num` field so that a submodel can refer to its ship_info subsystem
3) Update `ship_model_replicate_submodels` to replicate all movable submodels, even the ones that aren't associated with subsystems

Fixes #3967
2022-01-28 00:09:13 -05:00
BMagnu c9da6156b4 Fix missing sound stop for non-flipped sound segments (#3969) 2022-01-27 23:14:51 -05:00
wookieejedi 1fb1368882 Add getHUDConfigShowStatus for scripting (#3961)
* Add view show status for HUD gauges in scripting

Many FSO mods use scripted HUD gauges, but previously the scripted HUD gauges were always forced to be on for the player, unlike retail gauges that can be toggled in the HUD Config screen. This PR allows scripters to view the show status of a HUD gauge, which is very useful for adding a check in the script to only show the gauge if a certain gauge is active. This is similar behavior to the getColor function, which allowed scripters to get the HUD Config colors of a given default gauge.

Tested and works as expected.

* appease clang
2022-01-27 11:17:38 +09:00
BMagnu 17bcaebd58 Add axis rotation Animation Segment (#3966)
* Add axis rotation segment

* Add axis rotation moveable

* Clang

* Fix clang tidy
2022-01-27 11:16:45 +09:00
wookieejedi 795947a606 Enable Use Cargo Icon for briefing icons (#3964) 2022-01-26 17:33:41 -05:00
BMagnu 21d4690ebb Inverse Kinematics for Animations (#3962)
* Add FABRIK IK solver

* Add IK constraints

* Finish IK table entry

* Add IK Moveable and fix some edge cases

* Clang Fixes

* Implement feedback
2022-01-26 19:56:39 +09:00
BMagnu 1b118e9b5e Fix lab animation triggers (#3965) 2022-01-26 16:08:31 +09:00
BMagnu 9352835a00 Fix reverse instant trigger edge case (#3956) 2022-01-24 21:46:47 +09:00
Allen A. Babb 64ae887d28 Fix/issue 3902 (#3947)
* Make a Big ol' Wall of Text which, hopefully, somebody might actually read.
* Address issue 3902 in plr.cpp
* Handle case when axis is not bound
* Appease Linus-X
* Make wall of text less wall-y
2022-01-23 17:15:00 -06:00
Goober5000 d8d571f01c Merge pull request #3950 from Goober5000/more_timestamp_fixes
some small timestamp fixes
2022-01-23 16:18:44 -05:00
Taylor Richards 554738c8ef Merge pull request #3949 from notimaginative/psnet_ip_mode_pref
add IP version preference troubleshooting options
2022-01-23 15:43:26 -05:00
Goober5000 73c96e0f63 Merge pull request #3953 from Goober5000/small_fixes
some small fixes
2022-01-23 14:31:21 -05:00
Goober5000 70039b0432 some small fixes
1) Fix set-scanned and set-unscanned to take multiple arguments as designed.
2) Fix documentation on the "perturb" scripting functions.

Fixes #3951
2022-01-23 02:49:00 -05:00
Goober5000 6cebcfc9ac some small timestamp fixes
A few assorted fixes for timestamps:

1) The pre-player delay should be fast-forwarded by 1/4 second per frame regardless of time compression
2) If time compression is very slow, there could be a 0-millisecond change in timestamps, so don't adjust this
3) Properly handle a change in soundtrack that occurs during a mission, not just when the mission is parsed
2022-01-22 23:47:17 -05:00
Goober5000 7d0188735a Merge pull request #3948 from Goober5000/fix_3946
fix arrival delays and other mission time wonkiness
2022-01-22 20:32:03 -05:00
Taylor Richards fd1cf53809 fix dumb coder thing 2022-01-22 20:23:52 -05:00
Taylor Richards e5613fab74 allow connection fallback for PXO mod ident timeout 2022-01-22 19:40:48 -05:00
Taylor Richards 6d932df744 add options to prefer either IPv4 or IPv6
This really only applies to DNS lookups, setting the preference to either
be for IPv4 or IPv6 addresses. This makes for a far less error prone
troubleshooting method than disabling one of them outright.
2022-01-22 19:40:48 -05:00
Goober5000 7058993a2b fix arrival delays and other mission time wonkiness
The `Timestamp_microseconds_at_mission_start` variable should not, in fact, be adjusted when the timer counter variables are adjusted.

Fixes #3946.
2022-01-22 18:46:35 -05:00
Goober5000 87631a4023 Merge pull request #3936 from Goober5000/dockpoint_moving_submodel
allow dockpoints to be anchored to submodels explicitly
2022-01-22 17:50:53 -05:00
Joshua Glatt 07ea13ccf0 Update links and edit text in FRED's and qtFRED's About dialogs (#3941) 2022-01-22 14:37:49 -08:00
BMagnu dc6cd40541 Clean up Player_orders (#3918)
* Merge all three comm_order arrays

Were Comm_orders, Sexp_comm_orders, and Player_orders. Now all Player_orders.

* Fix Warnings

* Fix erroneous order warning

* Update Int3 into a warning

* Fix missing location for warning
2022-01-22 22:09:49 +09:00
Goober5000 05f740f8ff Merge pull request #3945 from Goober5000/timestamp_debugging_hack
accommodate elapsed time during debugging
2022-01-22 00:45:23 -05:00
Goober5000 65cd5ef8da add cmdline option 2022-01-22 00:16:59 -05:00
Goober5000 420f75cfe0 fred stubs 2022-01-22 00:16:59 -05:00
Goober5000 408ff91894 initialize Last_frame_timestamp 2022-01-22 00:16:59 -05:00
Goober5000 f96ea31253 the variable should be nonzero by the time we get to mission stuff, but best to handle it anyway 2022-01-21 09:48:50 -05:00
Goober5000 a1bc06aeeb accommodate elapsed time during debugging
If a breakpoint is hit in the code, the SDL time will keep running even though FSO doesn't realize things are effectively, if not actually, paused.  Detect this situation and adjust the timestamp offset to compensate.
2022-01-20 21:13:52 -05:00
Goober5000 5a21d43cdd Merge pull request #3944 from notimaginative/fix_training_mission_stats_bug
fix training mission stats bug
2022-01-20 19:26:48 -05:00
Taylor Richards 8cb7ab1c50 fix training mission stats bug
Training missions don't save kills so make sure that we don't try to
back out kills by mistake when replaying a training mission.

Fixes #3916
2022-01-20 17:50:15 -05:00
Joshua Glatt 33fa58400d Remove unneeded/leaky code from sexp_list_item in FRED and QtFRED (#3942) 2022-01-19 21:19:51 -08:00
Goober5000 c002c19b93 Merge pull request #3943 from Goober5000/tbp_warp_fix
TBP warp fix
2022-01-19 22:23:09 -05:00
Goober5000 160b75bd9a make clang happy 2022-01-19 20:50:11 -05:00
Goober5000 a436d5f3d0 remove redundant externs for clang 2022-01-19 20:08:31 -05:00
Goober5000 6db1accdb8 remove this because it is handled elsewhere, and because ships can have this flag without serving this role 2022-01-19 19:32:25 -05:00
Goober5000 9e149ff467 set the flag if a ship uses a Knossos warpin or warpout effect 2022-01-19 19:31:28 -05:00
Taylor Richards 5562a4f684 update ffmpeg support for 5.0+ API changes (#3939)
Fixes #3926
2022-01-19 14:14:06 -05:00
Goober5000 32e1194575 change int to bool 2022-01-19 01:35:32 -05:00
Taylor Richards 6bdb3d8d2b Merge pull request #3923 from notimaginative/standalone_optimizations
Standalone fixes/optimizations
2022-01-19 00:55:21 -05:00
Joshua Glatt 83faf8de99 Remove unnecessary/leaky strdup() calls in sexp_list_item in FRED/QtFRED (#3940) 2022-01-18 21:41:53 -08:00
Goober5000 3d941ca3ef Merge pull request #3938 from Goober5000/notify_about_scroll_buttons
log whether command briefing is using scroll buttons
2022-01-19 00:14:35 -05:00
Goober5000 35eca2ae50 allow 3d warp to be enabled from the table 2022-01-18 12:09:54 -05:00
Goober5000 eab2401e9e Cmdline_3dwarp is now Fireball_use_3d_warp, apparently 2022-01-18 12:09:54 -05:00
Taylor Richards d0964d7380 use proper return for invalid particle effect 2022-01-18 10:04:02 -05:00
Taylor Richards f2a99117a6 always init path renderer
This is required for truetype fonts, otherwise it crashes during font
loading. It still wastes a good bit of memory however and will need
to be addressed with a more permanent solution in the future.
2022-01-18 06:39:50 -05:00
Taylor Richards ca73b4fefb fix crash on standalone from weapon trail cleanup
A standalone server can reset itself, which triggers game_level_close(),
before game_level_init() has been called. trails_level_close() didn't account
for not being inited first and would crash.
2022-01-18 06:39:50 -05:00
Taylor Richards e81ad7024e skip tracker init popup on standalone 2022-01-18 06:39:50 -05:00
Taylor Richards 0ba94a554b fix memory leak from libpcp context (undocumented) 2022-01-18 06:39:50 -05:00
Taylor Richards d75174992d release model interp data on level close for standalones 2022-01-18 06:39:50 -05:00
Taylor Richards 45b2d2a83a release memory from object update on level close 2022-01-18 06:39:50 -05:00
Taylor Richards 11d3348d64 enable/disable extra cmdline options for standalone 2022-01-18 06:39:50 -05:00
Taylor Richards a0769910f3 free loaded models after mission on standalone 2022-01-18 06:39:43 -05:00
Taylor Richards 5e2a4c05a3 make sure particles don't get processed on standalone 2022-01-18 06:38:35 -05:00
Taylor Richards 422c20d396 avoid initializing stuff that standalones don't need 2022-01-18 06:38:34 -05:00
Goober5000 0a4d589c17 log whether command briefing is using scroll buttons
Add a logging statement to let modders know that the command briefing is deliberately using, or not using, scroll buttons.

Fixes #3550.
2022-01-17 23:52:14 -05:00
Goober5000 5531de2b84 Merge pull request #3879 from Goober5000/timestamp_redesign
convert the FSO timestamp system to use SDL time
2022-01-17 20:54:12 -05:00
Taylor Richards 6ee6ddf49f fix missing texture bug on standalone (#3937)
The file used by bmp_load()/bm_load_animation() is a hardcoded
interface image on standalone servers. If the value of dir_type
isn't ALL or INTERFACE then it can't find the image. For ship
textures this can cause primary weapon hits to not register on
the server.
2022-01-17 20:39:26 -05:00
Goober5000 4ee84b71d7 refactor some names 2022-01-17 19:03:23 -05:00
Goober5000 dfd0614311 allow dockpoints to be anchored to submodels explicitly
By anchoring a dockpoint to a submodel, the dockpoint will move when the submodel moves.  Historically this has been done by inspecting the path associated with a dockpoint, but this method will not work if there is no path or no rotation mode specified.  Here is an alternate method that allows the submodel to be specified explicitly through a dockpoint property.
2022-01-17 17:31:51 -05:00
wookieejedi 53ecfa18ed Fix Bay Door Animations for Multi and Lone Player Ship (#3932)
For a long time, bay door animations would not trigger if the player was arriving from the bay as the the only ship in the wing. This was fixed by adding a check for the player. This check uses the `Player_obj` to check if the ship is as player, which does not work on standalones since the `Player_obj` is always the Standalone Ship.

This PR changes the check to check if the flag `Player_ship` is set, which is a common strategy used to make these kinds of checks work on standalones.

Tests show the old behavior still works as expected.
2022-01-16 23:19:31 -05:00
Goober5000 9c7a9a1c20 patch a hole in the pausing and make sure timer pause/unpause is always called 2022-01-16 15:24:43 -05:00
Goober5000 73a408043b time compression now works 2022-01-16 15:24:43 -05:00
Goober5000 18f4f490d0 time compression outline, static casts 2022-01-16 15:24:43 -05:00
Goober5000 97f9aa2259 move stuff here too 2022-01-16 15:24:43 -05:00
Goober5000 cf6a460422 move some stuff around 2022-01-16 15:24:43 -05:00
Goober5000 00de4c3e7e timestamps should be running just about all the time 2022-01-16 15:24:43 -05:00
Goober5000 e3b4171f06 no need to keep Debug_dump_frames anymore 2022-01-16 15:24:43 -05:00
Goober5000 a1dadb1c0b small refactor 2022-01-16 15:24:43 -05:00
Goober5000 0dc3c914d9 tweak the event music start so that missions will be consistent regardless of the player entry delay 2022-01-16 15:24:25 -05:00
Goober5000 8e33644a8f since we used to fast-forward at the rate of 1/4 second per frame, simulate the same thing with the timer 2022-01-16 15:20:57 -05:00
Goober5000 12363fe18d qtfred 2022-01-16 15:20:57 -05:00
Goober5000 88f4163ae3 always give the game priority when starting/stopping time 2022-01-16 15:20:57 -05:00
Goober5000 1b51225c51 convert the FSO timestamp system to use SDL time
Previously, the game used a dead-reckoning system for measuring time, where several time counters were incremented as long as time was running.  This unfortunately has no way to synchronize time in the long term, and therefore in-game time will tend to run faster or slower than real time by a few percent, depending on various factors.

This PR redesigns the timestamp system to use the SDL time counter which will always keep it in sync with real time.  However this necessarily involves a bit of clever handling when the game is paused and unpaused.  It also revealed several minor bugs in several places in the code where timestamps were handled.

This PR is currently in draft status until the design can be updated to handle time compression.  In all other respects it should be working.
2022-01-16 15:20:57 -05:00
Goober5000 aad7800ed8 Merge pull request #3931 from wookieejedi/revert-mission-music-change
Revert timestamp change for event music
2022-01-16 15:19:35 -05:00
wookieejedi ef5e549dca Revert timestamp change for event music
The timestamp fix/cleanup in #3878 revealed a longstanding bug with music timestamps--the timestamps were never set to something valid later.

This is a widespread issue in the code, fortunately Goober is modifying the timestamp code to accommodate invalid timestamps.

Tested and works as expected. Fixes #3930.
2022-01-16 14:35:56 -05:00
EatThePath baa696f643 Fix first person glows (#3882)
* Split glow current brightness calculation into a new function for reuse and clarity

* Readability cleanup pass on model_render_get_point_activation

* created a new code path to add the lights for the player's ships' glowpoints without rendering their sprites.

* cleaning up unused args from new glowpoint functions

* cleanup redundant externs

* Documentation and naming pass
2022-01-16 14:26:56 -05:00
BMagnu 4e0cb87b0c properly calc anim for instant (#3928) 2022-01-16 15:07:16 +09:00
Timo Gurr 84a333c787 FFmpeg deprecations fix for FFmpeg >= 5 (#3927)
FFmpeg commit e67e02d15672 [1] dropped avcodec.h from avformat.h includes hence
add an include for it to fix build after that commit.

[1]: https://github.com/FFmpeg/FFmpeg/commit/e67e02d15672a87da1b0566e197a1e19dc7e1e33
2022-01-15 22:37:17 -05:00
wookieejedi b383ceb8aa Allow AI flag for bay orientation to account for parent uvec (#3925)
* Allow AI flag for bay orientation to account for parent `uvec`

The previously added flag `Fighterbay_arrivals_use_carrier_orient` (#3698) incorporated the parent ship's `rvec`, which greatly helped align emerging ships from fighter bays. In parent some ships though, emerging ships still showed a `uvec` that did not match the parent ship (such as FotG's Star Destroyer). This PR allows the `Fighterbay_arrivals_use_carrier_orient` flag to take parent `uvec` into account.

Note, that departing the mission into a bay already has code to ensure a `wheels-down` landing.

PR is tested and works as expected/fixes `uvec` issue.

* only set uvec as lazy option
2022-01-15 22:36:48 -05:00
wookieejedi 77c7b0271e Fix incorrect net signature for wave ships (#3924)
Previously, multiplayer missions with wings with waves would incorrectly set the `net_signature` of ships in the initial wave. The code is supposed to only set the `net_signature` if it was past the initial wave. This is because original ships in the wave have their `net signature` set at mission parse.

This PR fixes that and has been confirmed to work via multiplayer tests.
2022-01-14 22:02:38 -05:00
The Force e8a19b7974 Implements Save (#3922) 2022-01-15 01:21:04 +09:00
Allen A. Babb 677ea7e46f Fix issue #3912 (#3914)
* Move dynamic XSTR stuff out of controlsconfig.cpp and move it into controlsconfigcommon.cpp.
- Needed because these strings are used in places other than the controls menu.
2022-01-12 19:14:51 -06:00
wookieejedi fef8959cff Add AI to Fix Negative Turret Ammo (#3913)
* Add AI to Fix Negative Turret Ammo

Previously, turrets with ammo would end up firing one extra shot, resulting in a -1 ammo.

This was because of the check `ammo[bank_to_fire] >= 0`, in `aiturret.cpp`. This PR adds an AI flag to have the turret only fire if the ammo is greater than 0 (`ammo[bank_to_fire] > 0`), as opposed to greater than or equal to 0.

Tested and the flag fix works as expected.

* feedback

* set to on for target 22
2022-01-12 07:32:10 -05:00
BMagnu dd7bd1fb72 Animation Rework, Phase 4: Moveables (#3904)
* Add C++11 std::any implementation

* Add basic moveable functionality

* Add rotation moveable

* Revise Segment Parsing Register

Because apparently, the linker and I disagree on which symbols should be discarded when linked into the final application...

* Fix small problems

* Address feedback

* Address feedback 2
2022-01-12 14:54:28 +09:00
Allen A. Babb 6b26df19d1 Merge pull request #3905 from z64555/fix/issue_3901
Fix #3901: Inverted Controls Don't Save
2022-01-09 15:21:48 -06:00
BMagnu 42c1957adc Properly handle negative case (#3910) 2022-01-10 04:01:21 +09:00
Goober5000 647316e83b Merge pull request #3880 from EatThePath/lt_lab
Add tonemapping options to lab render settings
2022-01-08 17:54:45 -05:00
Goober5000 eefb827171 Merge pull request #3885 from qazwsxal/lightshaft_fix
Fix shadow check on lightshafts
2022-01-08 17:54:38 -05:00
Goober5000 75ff1383c7 Merge pull request #3908 from wookieejedi/ttf-support-for-multi-screens
Fix text overflow on multi-related screen
2022-01-08 17:53:35 -05:00
Goober5000 e4c99b1df6 Merge pull request #3909 from Goober5000/fix_3907
fix 3907
2022-01-08 17:53:18 -05:00
Goober5000 94bd93343f fix 3907
Move the initialization of `used_weapons` to `weapon_init` since that's where it belongs.  Also call `weapon_level_init` in the lab since investigation revealed a few other things that needed to be done there.
2022-01-08 16:10:18 -05:00
wookieejedi 589da9648f add comment noting default font height 2022-01-08 16:08:51 -05:00
wookieejedi 0f3f19d5d8 fix spelling 2022-01-08 15:29:20 -05:00
wookieejedi 7f8957ba0d Fix text overflow on multi-related screen
Multiplayer screens such as PXO lobby, chat boxes, and multi-game setup screens had hard coded values for the number of lines to display. These would only work correctly with the default .vf font01 from retail. If a mod or user used a TTF or other .vf font than text would spill over. This PR makes these values take into the account the font used.

Tested and works as expected with TTF fonts and the retail fonts.  Marking as draft to see what others think.
2022-01-08 13:57:58 -05:00
z64555 d74c419295 Preset identification should only be invert agnostic when reading a CSG<7 file, for all other uses of control_config_get_current_preset(), it should be exact equality with the preset. 2022-01-08 10:15:00 -06:00
Goober5000 59442efbbf Merge pull request #3872 from notimaginative/dynamic_cfile_blocks
make cfile root and file blocks dynamic
2022-01-08 02:46:55 -05:00
JohnAFernandez 5740ee8eed Merge pull request #3900 from z64555/fix/issue_3892a
Fix 3892 Amendment
2022-01-06 13:11:16 -05:00
z64555 1dd347adb9 Use correct version var when inside CSG stuffs. 2022-01-06 11:42:02 -06:00
Goober5000 94b8c283e6 Merge pull request #3897 from Goober5000/fix_first_of
fix first-of to return the correct arguments
2022-01-05 21:47:51 -05:00
Allen A. Babb 41b3d0fdaf Merge pull request #3898 from z64555/fix/issue_3892
Fix 3892
2022-01-05 20:37:09 -06:00
z64555 2289976fa9 Add catches for edge cases when control_config_get_current_preset() returnes ::end() within csg and plr read/write.
* Add assertsions during csg and plr read/write to make sure the Controls_config is initialized.
2022-01-05 19:57:57 -06:00
Goober5000 ed54b79425 fix first-of to return the correct arguments
Change the threshold logic to return the correct elements from the beginning of the list, not the end.  Fixes #3896.
2022-01-05 19:03:55 -05:00
wookieejedi ce105df6c6 Revert timestamp changes for HUD (#3895) 2022-01-05 17:22:55 -05:00
BMagnu 61b87e682c Handle forgotten 0 case for new vecmat function (#3891)
* handle forgotten 0 case

* Reduce tolerances again
2022-01-06 02:01:28 +09:00
wookieejedi ca6a1045cb Fix Particle PageIn (V2) (#3893)
It turns out the particle preloading fix revealed a long standing bug in the particle `pageIn()` function--it should be calling `bm_page_in_texture()` instead of `bm_page_in_aabitmap()`. It's been wrong the entire time and we didn't notice because of the frame bug, which was fixed in #3884. Without this fix, when it's preloaded it locks the image as 8-bit, when it force loads it's 24-bit. Tested and works as expected.

Fixes #3890.

Massive thanks to taylor for spotting this!
2022-01-05 11:29:41 -05:00
1fa6e00f39 Controls 4 and 5 - Multi-joy and Preset Files (#2958)
* Updates the AxisInverted hooks to use the new CC_bind.  Currently assumes only Joy0, so this may need further tweaking or replacement

* * Add ability to claim up to 4 joysticks for player use, using the launcher (via registry or fs2_open.ini) or the new menu system
* Hack into existing control polling system to get the new primary/secondary binding schema to work.  This should be reworked into a reverse-lookup system.
* Finally break the mouse loose from overlapping with Joystick binidngs
* Fix bug where joy button wouldn't register on search function
* Fix bug with mousewheel not always decaying as it should.
* Fix rebase conflict with selecting item during search mode

* Fix bug where mouse buttons were incorrectly labeled.

* Move some enums around

* Fix bug with joy axis labels being displayed as buttons.
* Fix possible bug where Other conflict axis wouldn't clear
* Updated default joystick axis text. A new strings.tbl will need to be supplied for localization support

* Deprecate nAxisInverted ADE functions and replace with AxisInverted(int, int, bool)

* Merge Axis mappings into Control_config
* More utility functions for CC_bind and CCB
* Adds another ADE function for inverting the axis action, instead of individual bindings
* Hacks to get plr file to compile.  Currently slices out many of the new features like secondary axis and the mouse axis, and the additional joystick bindings (joy1, joy2, joy3)

* Fix bug with uncontrollable spin (slopily)
* Fix some warnings
* Add flags for Hats and Balls for future implementation

* Fix bug where inverting an axis would trigger an assert

* Fix bug where joy wasn't detected as present

* Most axis actions should be relative, instead of absolute
* Hopefully optimize joy_get_unscaled_reading
* Properly break out of double-for search function for search and bind modes in config menu
* Refactor control_get_axes_readings to provide more consistent behavior
* Use JOY_REL_THROTTLE instead of Action::REL_THROTTLE when indexing into Control_config

* Bank axis has a default binding, Throttle does not.

* Fix bug where conflicts weren't being detected.
Fix bug where default presets weren't being detectd

* Elegantly break out of double fors with goto.
Fix bug with bind mode not detecting axis

* Save new binding scheme to playerfile
* Add cid_assign() to standardize cid assignment with shorts
* Add write and read handlers for int8_t

* Remove saving controls to csg.  This will be replaced by presets.

* Fix bug with reading pilotfile

* Use "Joy-n" instead of "joystick n" to match default identifiers in config menu

* Fix bug with CC_TYPE_TRIGGER controls always marked as used, if not bound with a key.
Fix bug with Joy-0 btn 1 triggering multiple controls that are not bound to it.

* Improve readibility of the joy info output to log
* Message when a joystick connects and using legacy system.
* Fix bug where system joystick 0 was mapped in pJoystick that should've been nullptr

* Fix bug where *not* having a joystick will cause bind mode in the config menu to immediately cancel.

* Add reverse lookup functions for actions.  mActionToVal[] does string -> int, mValToAction() does int -> string

* Add the foundation for writing the presets files.
* Adds a bunch of reverse lookup functions to get the stringified version of various enums, etc.
* presets.h and presets.cpp are in something of a barebones at this point

* Add new subdir for preset files 'player/presets'
* add utility for finding the distance of a bitfield/bitmask.  Used to translate mouse button masks into mouse button id's
* Write PresetFileHandler as standalone, instead of a subclass.  Still mostly a copy of JSONFileHandler
* Make functions to map and reverse-map the bindings for use with the preset files and ultimately the ControlConfigDefaults.tbl as well

* Check presets from file to see if they are duplicate with an existing preset.

* Check for uniqueness of presets fron controlconfigdefaults.tbl before adding them, and warn the user if there are duplicates.

* Rename the test functions into proper load/save.
* save function has some standard checks
* load function is called on init
* make finding duplicates its own function outside of the preset label rendering function
* Initial draft of saving presets in-game

* Fix bug where all loaded presets were thought to be duplicate of defaults.

* Fix bug where preset cycling would get stuck on the first preset other than default

* Fix bug where saving a mouse button saves the wrong textified string.

* Prevent preset names from being too long.
* Crash still occurs if the name is too long, as if set outside of FSO
* Workaround text running off the popups in 640x480.  Doesn't look as nice, sadly

* CSG's now track preset names instead of containing bindings
* remake control_config_reset_defaults() into control_config_use_preset()
* provide a function to get the currently selected preset.

* Do PLR backward compatibility, hopefully.

* PLR now tracks presets instead of saving the bindings.

* On Loading pre PLR3 or CSG6 data, create a new preset.

* Strip off file extension before saving preset files. Jason.json.json just looks dumb

* Add "-joy_info" commandline option.  Will output SDL joystick info of all detected joysticks to stdout

* Fix non-standard behavior with registry_read_string().
* Returning NULL instead of the default value, or an empty string, will trigger an access violation with SCP_string and other string copy functions.

* Modify io::joystick::init() to take an optional param, no_register, to use with -joy_info

* Address CI complaints

* Address CI issues 2.

* Supress preset duplicate warning if in unit tests.

* Address scripting unittest failure due to incorrect argument type. (Ints don't technically exist in LUA)

* Use Mouse enums instead of Joy enums or magic numbers

* More signed/unsigned madness

* Address CI issues 3

* Address gcc-5 issues. (No auto in lambdas)
* Fix bug with bit_distance()

* Address gcc-5 issues 2

* Address clang issues

* Address clang-tidy issues

* Address clang-tidy issues in undosys.  May need to be cherry picked to Controls2.

* Address clang-tidy issues

* Improve logic of preset name prompt.

* Fix bug with selected presets not being saved

* No, a cstr is not a std::string.
* Can't use i there because its already defined.

* Fix bug where CSG's wouldn't save selected preset
* Fix bug where presets wouldn't be loaded correctly from player files
* Fix bug where loaded preset files would not update the preset cycle position correctly

* Some QoL changes for the preset name prompt

* Address Appveyor issues.

* Add forward compatibility for player file.  This is required because currently any "missing" data in the pilotfile will trigger an Error, and crash FSO.

* Fix bug where mouse X axis was unusable.
Apparently stating that MOUSE_Z_AXIS IS MOUSE_Z_AXIS doesn't get the point across.

* Address CI issues.

* Address CI issues.
* sel default assigned to -1
* static_cast enum to an int

* Assimilate -joy_info int -get_flags, replacing the existing method that launchers use to get joystick information.

* Add '\n' to PST log messages.

* Change logic of checking joystick .ini keys:  Should the multi-joy key not be found, try legacy joy key.

* Add some more missing '\n' to mprintf messages.

* Notify the player when converting to the new multi-joy system. (Using ReleaseWarning for now...)
* Warn the player if a preset defined in their .PLR could not be found.

* Actually disable control items without a valid tab, instead of relying on the fact that they're disabled  by default.

* Add CC_preset::is_duplicate_of() method to make checking for preset uniqueness less of a brain teaser.
* Doxy the first_override param of control_config_common_read_section

* Adds the os::dialogs::Information() method, which displays an information-only dialog in similar format to Warning and Error dialogs.  Does not throw Warning nor Error exceptions
* load_player now uses os::dialogs::Information() instead of ::ReleaseWarning, thus not halting unit tests.

* Breaks retail localization support for Joystick and Mice labels - This is because the new multi-joy axis end up very confusing "Joy-0 Joystick/Mouse X Axis"
* Renames Joy_axis_text to Axis_text, intended to be used both by joysticks and the mouse.
* Moves mouse axis and button labels into an array to ease future XSTR support
* Adds asserts to ensure indices are within the array sizes of label arrays
* Adds XSTR indices for Axis labels, mouse buttons, and mouse wheels.

* Seperates conflict check comparisons from equality comparisons.
*  Conflict checks can ignore certain combinations of CC_bind::flag's; i.e. an Axis bound to a different control but is inverted or relative will still cause a conflict with another control that has the same axis
*  Equality comparisons is exact equality, allowing presets to check if binds have the same binding and flag configurations.

* More UI string changes and localization
* Tweaks positioning of top button labels in CC menu
* Adds the following XSTR's:
1659 "Preset: %s"
1660 "Preset: custom"
1661 "Next Preset"

* Fix bug where mouse axis turned into mouse button when inverting control by its control name.
* Fix bug with the new conflict checking subroutine not working with non-axis controls

* Address CI issues.

* Don't trigger modal popups while in unit tests.

* Address clang tidy issues
* use nullptr
* be consistent with conditional style
* use booleans to stuff debug states, methods with just Assertions in it will trigger a false positive on clang tidy
* use string::empty() instead of checking for "".

* Remove dead code of -joy_info.  Functionality has been merged with -get_flags

* Address clang-tidy [readability-simplify-boolean-expr]
--z64 says "I don't like it!"

* fix axis check

* Implement revised axis action virtvars for scripting. Also protect against a control mismatch in the CSG file due to a script-inverted control

* Encapsulate CC_bind properly
* Add mouse and joystick cid's to AxisInverted description

* Update translate_key() and its user to correctly translate multijoy bindings for training messages.

* Prompt user trying to escape from config menu when they have changes.
* Remove dead function.

* Fix crash during training missions due to key translation that would overflow internal buffer.
* Went back with cstring as return value instead of SCP string, because caller would need a significant refactor
* Update doxy of the textify functions

* Unify textify_scancode() and textify_scancode_universal() to ensure common code path.

* Add "Multijoy" entry to json caps. (For Knossos)

* Make CI happy.
* Remove unused lambda captures.

* Instead of overwrite during plr2 => plr3 conversion, try to use the existing preset file.

* Fix conditional for checking if file exists within presets::save_preset_file()

* Revert Majority of PR#3739
* PLR and CSG versions are incremented past versions set by 3739
* Forward compatibility feature of #3739 (Only save sexp containers into the CSG if they are used) is removed

* Remove forward compatibilty of PLR file when going in between pre- and post-Controls5 FSO versions
* Add missing startSection() and endSection() for csg_write_controls()

* Fix clang-tidy error #1

* Fix clang-tidy error #2

* fix clandy tidy error #1 part 2/2

* Fix clang tidy error 3

Co-authored-by: Goober5000 <[email protected]>
Co-authored-by: Tyler Blount <[email protected]>
Co-authored-by: wookieejedi <[email protected]>
Co-authored-by: BMagnu <[email protected]>
2022-01-04 12:01:32 -06:00
Goober5000 62e9719712 Merge pull request #3888 from Goober5000/fs1_target_behavior
add game_settings flag to not target turrets
2022-01-03 19:16:10 -05:00
Goober5000 5c122a2913 add game_settings flag to not target turrets
In FS2, the HUD will automatically target the first turret on any BIG or HUGE ship.  In FS1, this did not happen.  This adds a flag to disable the new behavior.

The change is needed because the scan view cone is significantly constrained when any turrets or subsystems are targeted.  This makes Playing Judas quite a bit more difficult than it was designed to be.
2022-01-03 18:23:27 -05:00
Goober5000 a5318e45ae Merge pull request #3887 from notimaginative/file_load_fixes
file loading performance fixes
2022-01-03 18:08:21 -05:00
Taylor Richards c7de32d0af add dir_type to bm_load()
Modify bm_load() so that it will only search in intended paths,
improving performance of both fast and slow loading of image
files. Now matches behavior of the other bm_load_*() functions.
2022-01-03 16:59:05 -05:00
Taylor Richards d9b9607e14 fix broken cfile slow search optimization
By default cf_find_file_location*() will always hit the filesystem
for certain paths. The flag for this was not reset between different
paths so it ended up always hitting the filesystem.
2022-01-03 16:58:57 -05:00
Goober5000 8710b9fac7 Merge pull request #3886 from Goober5000/small_skybox_cleanup
move various skybox variables into the header file
2022-01-03 16:34:59 -05:00
Goober5000 b6706c8b3c move various skybox variables into the header file 2022-01-03 16:00:38 -05:00
wookieejedi 0a9a7a5eea Fix Particles pageIn to use nframes (#3884)
Previously the `bm_page_in_aabitmap` call in `ParticleProperties::pageIn()` used -1 as the number of frames. It seemed particles with more than 1 frame still worked correctly, but likely prevent preloading of particles. This PR fixes that to use the actual number of frames.
2022-01-03 15:53:28 -05:00
Unknown 73ed3e3bec Fix shadow check on lightshafts 2022-01-03 19:18:21 +00:00
BMagnu 1c19199df3 Animation Rework Phase 3, Turret fix (#3877)
* Change animation turret canonicalization to now correctly calculate the closest natual turret positon

* Add angle error to vm function for convenience

* Div by Zero safety for non IEEE compliant systems

* Incorporate style changes
2022-01-03 18:54:11 +00:00
JohnAFernandez 5116d3f1ca Merge pull request #3881 from EatThePath/ppc-safety
Added ppc calculation initial value bounding and calculation fixes
2022-01-03 13:43:44 -05:00
David Gibson 47f6da591f Readability and documentation pass on new tonemapper lab options 2022-01-03 12:38:17 -06:00
Goober5000 3143d9fdcc Merge pull request #3878 from Goober5000/timer_preliminary_cleanup
Timer preliminary cleanup
2022-01-03 01:12:59 -05:00
David Gibson fe1068630f style and documentation fixes 2022-01-02 15:38:27 -06:00
David Gibson 91fe2bfc90 Implemented ppc sliders 2022-01-02 15:20:49 -06:00
David Gibson 890756cc7d Added ppc calculation initial value bounding and calculation fixes 2022-01-02 15:18:53 -06:00
David Gibson f73d452d5d adjusted the range of exposure slider 2022-01-02 13:19:49 -06:00
David Gibson f9b104aecd Lab tonemapper selection implemented 2022-01-02 13:19:49 -06:00
Goober5000 5b3207f548 use the proper timestamp function 2022-01-02 01:50:49 -05:00
Goober5000 0c6169d384 remove old comment using private API 2022-01-02 01:03:52 -05:00
Goober5000 c9ac9a3635 use correct initialization for invalid timestamp 2022-01-02 01:03:52 -05:00
Goober5000 009abe22fe fix comment 2022-01-02 01:03:52 -05:00
Goober5000 93757bcc61 replace Int3() with UNREACHABLE 2022-01-02 01:03:52 -05:00
Goober5000 28c0d51def remove redundant weapon_level_init 2022-01-02 01:03:52 -05:00
EatThePath dc0f394afd Moved the PPC tonemapper intermediate calculations to C-side to clean up shader compatibility with older versions of opengl (#3857) 2021-12-31 21:27:46 -05:00
Taylor Richards 0d7689f495 add safety catch for min block sizes 2021-12-31 15:59:33 -05:00
Taylor Richards 4ee2c82976 switch to unique_ptr's 2021-12-31 15:58:23 -05:00
Asteroth 329efb8c3a clarity function for homing objects and fix scripting target setting (#3865) 2021-12-31 13:13:56 -05:00
Goober5000 b10a230f8f Merge pull request #3873 from Goober5000/nonfatal_sexp_errors
make certain SEXP errors nonfatal
2021-12-29 23:42:13 -05:00
Goober5000 31bbda0ec0 make certain SEXP errors nonfatal
Some SEXP errors, although they indicate real problems, will not prevent the mission from running.  Add these as exceptions.  Implemented per requests from users of Blue Planet and Solaris.
2021-12-29 23:07:06 -05:00
Taylor Richards 9f28ba2a37 make cfile root and file blocks dynamic 2021-12-29 22:47:59 -05:00
Goober5000 185ee57d13 Merge pull request #3871 from Goober5000/fix_fred_crash
fix a FRED crash caused by recent changes
2021-12-29 22:37:03 -05:00
Taylor Richards e0972d5e45 take pathtype extensions into account during file indexing (#3869)
The cfilesystem cleanup PR (3734) failed to take pathtype extension
filtering into account when indexing loose files. This adds back that
functionality to prevent extra/unknown files from being indexed.

Fixes #3863
2021-12-29 22:27:04 -05:00
Goober5000 ab9f034102 fix a FRED crash caused by recent changes
This bit of code shouldn't run in FRED, but it wasn't a problem until recent changes made it so.
2021-12-29 21:45:00 -05:00
Goober5000 e4099ca562 Merge pull request #3866 from notimaginative/fix_warnings_errors
Fix warnings/errors from clang and valgrind
2021-12-29 13:19:45 -05:00
Goober5000 0966a4925f Merge pull request #3867 from notimaginative/fix_object_collider_mem
reset object colliders after each mission
2021-12-29 13:18:39 -05:00
Goober5000 d13937b6ab Merge pull request #3868 from notimaginative/fix_awacs_team_mem
set up awacs team arrays just the once
2021-12-29 13:18:03 -05:00
Taylor Richards 2d7aaa576c set up awacs team arrays just the once
Awacs team arrays only need to be initialized once but were
expanded by Iff_info.size() every second of a mission and never
cleared.

(Also includes cleanup)
2021-12-29 07:12:59 -05:00
Taylor Richards 3e0d95eff8 reset object colliders after each mission 2021-12-29 07:12:03 -05:00
Taylor Richards 8bbf2814fb silence clang compiler warnings 2021-12-29 07:07:26 -05:00
Taylor Richards 39c21f3f6f fix valgrind error in stuff_float()
The *f variable isn't initialized except on success so it
shouldn't be referenced except in that case. Matches how
stuff_int() does it.
2021-12-29 07:07:16 -05:00
Taylor Richards 6e3b75c613 silence valgrind errors in SENDTO() 2021-12-29 07:07:02 -05:00
Goober5000 a52024c5eb Merge pull request #3864 from jg18/events-editor-esc-check
Add comment on why event_editor::OnCancel() is blank
2021-12-28 18:54:23 -05:00
Joshua Glatt 40b47ed8a8 tpo fix 2021-12-28 14:56:46 -08:00
Joshua Glatt be89d88313 revert change and add comment on why event_editor::OnCancel() is blank 2021-12-28 13:49:24 -08:00
Joshua Glatt 9d79c8f947 check for unsaved changes in Events Editor before closing with Esc key 2021-12-28 11:55:35 -08:00
Goober5000 69d1551ccd Merge pull request #3858 from notimaginative/fix_ship_subsys_mem_leak
fix memory leak when reallocating ship subsystems
2021-12-28 00:30:13 -05:00
JohnAFernandez 9f42116885 Merge pull request #3856 from Baezon/phys-info-ab-speed-display
Use phys_info for max AB speed display instead of ship_info
2021-12-27 17:55:19 -05:00
Taylor Richards 9ede53b406 fix memory leak when reallocating ship subsystems 2021-12-27 17:25:50 -05:00
Asteroth 1a39961d59 use players phys info for ab max speed instead of ship info 2021-12-27 15:54:47 -05:00
Asteroth c3c75ff880 Fix weapons with submodel rotation firing (#3850)
* remove vestigal code from 'remove 'stream' weapon handling

* unused variable
2021-12-26 13:26:58 -05:00
Asteroth 7bec61f195 Make secondaries use $energy consumed (#3847)
* secondaries can consume energy, and only flash energy bar if depleted energy

* tweaks

* fix weird spacing
2021-12-26 13:25:31 -05:00
Joshua Glatt c6ecf88aec karajorma's SEXP containers, Part 5: Sexp_nodes (#3495) 2021-12-24 17:49:36 -08:00
Goober5000 2218fde9b5 Merge pull request #3851 from Goober5000/custom_language_fix
fix language indexing for custom languages
2021-12-24 20:38:11 -05:00
Taylor Richards b74b6339a8 improve handling of PXO lobby banners: (#3819)
* improve handling of PXO lobby banners:

 - add custom banners support for mods
 - remove broken banner randomization code (from retail)
 - remove banner hover outline if it's not really clickable
 - randomly choose a new banner over time if user is in lobby long enough
2021-12-24 17:25:15 -05:00
Joshua Glatt ab5aa71628 Fix random selection of points for SphereShape particles (#3841) 2021-12-24 10:06:47 -08:00
BMagnu 9930d435a2 Animation Rework Phase 3 - Fixes for Multi (#3846)
* Switch Multimsg to use netsig for animations

* Unique-ify animation ID's

* Clang Tidy

* Implement first suggestions

* Implement suggestions 2

* Add get model instance safeguard
2021-12-25 03:01:13 +09:00
Goober5000 8a803d7aef fix language indexing for custom languages
One of my XSTR and localization fixes from last year did not account for the presence of custom languages.  This PR uses the correct threshold and also adds a warning in case some mod really wants to define more than 6 additional languages.
2021-12-23 19:27:55 -05:00
Taylor Richards 0e059459d8 improve PXO data validation code (#3817)
* add batch validation for tables
* add batch validation for missions
* handle server connection errors in a more useful way
2021-12-23 09:06:26 -05:00
Goober5000 7fe3b78f18 Merge pull request #3845 from Goober5000/fix_assert
remove a redundant assert that throws false positives
2021-12-23 01:36:13 -05:00
Goober5000 8b2a3ca253 remove a redundant assert that throws false positives 2021-12-23 01:06:14 -05:00
Goober5000 6cafd64e78 Merge pull request #3837 from Goober5000/sexp_error_location
improve SEXP error handling a bit
2021-12-22 23:09:58 -05:00
Joshua Glatt 6afb6226ea Clarify logging when loading thruster textures as static images (#3839) 2021-12-22 18:58:20 -08:00
Taylor Richards 6a91127394 Merge pull request #3844 from notimaginative/fix_awacs_multi_crash
fix multi awacs crash due to code init order
2021-12-22 21:10:53 -05:00
Goober5000 09cfc6e9e4 Merge pull request #3843 from Goober5000/polymodel_instance_update
update polymodel_instance to reference object
2021-12-22 20:35:01 -05:00
Taylor Richards a40dfd7756 fix multi awacs crash due to code init order 2021-12-22 19:35:30 -05:00
Goober5000 c3dd6eb113 update polymodel_instance to reference object
See title.  All references to `model_create_instance` have been updated to supply an object number or -1.
2021-12-22 18:29:00 -05:00
Goober5000 f2c858e2fa Merge pull request #3838 from EatThePath/fix-bad-const-uniforms
Removed consts being set from uniforms to fix #3821
2021-12-21 13:21:59 -05:00
Taylor Richards 007fe45fec Merge pull request #3820 from notimaginative/reduce_bsp_align_memory
reduce memory required for bsp alignment
2021-12-20 17:57:26 -05:00
David Gibson e7d0d15e81 Removed consts being set from uniforms to fix #3821 2021-12-20 16:54:22 -06:00
Goober5000 0e828080ac qtfred 2021-12-20 14:02:33 -05:00
Goober5000 e893d15000 improve SEXP error handling a bit
1) Sync formatting of each place SEXP errors are reported
2) Add error location (event or goal) if possible when mission is loaded

Note that the two FRED error dialogs already indicate the event or goal.
2021-12-20 13:57:17 -05:00
Taylor Richards 73994bb2d8 reduce memory required for bsp alignment
Previous code allocated 4x bsp_data_size for alignment, whether it was
needed or not. Now it should allocate slightly more than 2x and only if
alignment is required.
2021-12-18 19:43:57 -05:00
Goober5000 1f531b69f1 Merge pull request #3816 from Goober5000/fred_ui_updates
Fred UI updates
2021-12-14 18:45:53 -05:00
wookieejedi d2f15afcec Set Default Detail Levels to be Consistent at Ultra Settings (#3811)
By default, new pilots have `Model` and `Nebula` detail only set to 4/5 (all others are on 5/5). Furthermore, clicking `Very High` on the model presets options still does not increase the `Model` or `Nebula` detail, as they remain at 4/5. This occurs with making a new pilot in retail, along with making new pilots in mods with a game settings default detail level of `Ultra`.

Simply changing the default values in the code for `Model` and `Nebula` detail to match the other detail levels is the easiest and cleanest solution IMO. I would be happy to alter this though to use a game settings table flag instead, if that is preferred.

Tested and works as expected.
2021-12-14 12:43:16 -05:00
Goober5000 ef917998f7 restore the proper 'class' logic, which was broken in commit 3005e447d3 2021-12-12 02:33:51 -05:00
Goober5000 cdcb8a611c update CMakeLists 2021-12-12 02:19:34 -05:00
Goober5000 8f91d82a73 even more asteroid target fixes 2021-12-12 01:50:15 -05:00
Goober5000 e31518be71 make BackgroundChooser a bit more flexible 2021-12-11 23:00:07 -05:00
Goober5000 5a35c308fb wip asteroid field dialog modifications 2021-12-11 17:21:35 -05:00
Goober5000 51aaf8f5b2 fix this, which broke at some point previously 2021-12-11 16:34:48 -05:00
Goober5000 eb0610f818 this too 2021-12-11 16:20:26 -05:00
Goober5000 04141bc122 more tweaks for the custom closeup label 2021-12-11 16:18:55 -05:00
Goober5000 9db0c7179b closeup label fixes 2021-12-11 15:00:14 -05:00
Goober5000 2f832d2883 fred ui partial updates for briefing editor and asteroid field editor 2021-12-11 14:11:10 -05:00
Goober5000 5a080c94a5 Merge pull request #3814 from notimaginative/fix_hud_config_loading
add players directory to slow search
2021-12-11 13:03:29 -05:00
Goober5000 375cebf666 Merge pull request #3813 from notimaginative/fix_get-file-list_length_bug
fix file name getting trimmed in cf_get_file_list()
2021-12-11 13:01:54 -05:00
Taylor Richards 17e9d3c0af add players directory to slow search
Fixes new hud config files not being usable until after restart.
2021-12-11 08:28:20 -05:00
Taylor Richards 3755ffe835 fix file name getting trimmed in cf_get_file_list()
Fixes bug in the old dynamic cf_get_file_list() introduced by the
3734 PR. That PR used SDL_strlcpy() to copy the filename which
always null terminates the string, but was only given the length
of the string itself as the available space, so the last character
was removed.
2021-12-11 06:05:06 -05:00
BMagnu dbe60decb4 Expose OSWPT to Lua and allow for LuaSEXP argument (#3637)
* Expose OSWPT to Lua and allow for LuaSEXP argument

* Incorporate Feedback
2021-12-11 12:37:30 +09:00
BMagnu 79283d9002 Animation Rework: Phase 3 (#3793)
* Refactor submodel handling by animation code

* Add Animation Flags

* Add Codeowner for animations

* Add new Animation Table

* Time Fix

* Weapon Launched trigger + bugfixes

* cleanup rebase artifact

* Add WeaponFired triggers

* Table deprec

* Allow multiple animations on the same trigger

* Add Translation segment

* Integrate new Animation workflow

* Small Fixes

* Submodel not found safety

* Add Pause

* Also allow dockport name

* Update Animation SEXP/Scripting + fix change ship class issue

* Multi fix + disable old animation sexp

* Weapon Scripting Function

* Fix bugs and replace bind

* Add onspawn trigger type

* Fix issue on ship death

* Fix Absolute Rotation

* Fix erroneous application of animation, add random start phase

* Disable Translation

* Fix Clang

* Incorporate feedback

* Incorporate feedback 2
2021-12-10 14:44:13 +09:00
Goober5000 9002047523 Merge pull request #3799 from TheForce172/feature/PlayerOrdersDialog
QTFred Player Orders Dialog
2021-12-09 16:17:18 -05:00
Goober5000 ea03d183bc Merge branch 'master' into feature/PlayerOrdersDialog 2021-12-09 15:44:32 -05:00
Goober5000 f707bb6990 Merge pull request #3797 from TheForce172/feature/QTShipEditorSubdialogs2
QTFred: Special Stats Dialog
2021-12-09 15:41:24 -05:00
Goober5000 347c67b9c7 Merge pull request #3798 from TheForce172/feature/SubstituteShipLabel
Substitute Ship Label
2021-12-08 13:17:26 -05:00
Goober5000 869a5bf11c Merge pull request #3704 from Baezon/asteroid-arbitrary-targets
Allow for arbitrary asteroid targets in missions
2021-12-08 13:15:52 -05:00
Goober5000 2efbd6c1c1 Merge pull request #3800 from Kiloku/draw_objects_by_center
Add functions to draw rectangles and images by passing the center position
2021-12-08 13:15:15 -05:00
Fabian Woltermann 95890d9664 Merge pull request #3810 from EatThePath/lab-doc-fix
Fixed mistake in lab camera control help
2021-12-07 19:10:51 +01:00
wookieejedi 6ae4f55e91 Fix Default Sound Levels in Game Settings Table (#3809)
The game setting table allows  modders to set the default noise levels for new pilots, but the game did not actually use the values set in mod table. This PR fixes that and adds safety range checks, too. Tested and works as expected.
2021-12-06 21:39:42 -05:00
The Force 80db70d627 Retail compatibility 2021-12-07 00:39:09 +00:00
David Gibson 2c5c09addb Fixed mistake in lab camera control help 2021-12-05 17:29:32 -06:00
BMagnu 9d60eb615a Fix the tonemapper strings (#3806) 2021-12-05 02:32:57 +09:00
Asteroth 28aea0c36b consistent capitalization (#3805) 2021-12-02 20:55:15 +00:00
Asteroth 8161bdfb2f Expose turret re-targeting delay (#3803)
* check for enemies every frame

* expose turret target recheck time

* fix

* more fix
2021-12-02 15:13:29 -05:00
EatThePath c5410c6381 Lt22 (#3801)
* New configuration table for HDR tonemapping and related data.

* lighting profiles conslidation and cleanup

* Appease CI

* Lighting profiles parser now parses all tonemapping options

* simplified light profile parsing logic further

* Refrences for tonemapping functions added

* cleaned unused function definition

* Extra documentation for lighting tables

* Fixed lighting profile value label error

* Converted current_piecewise_values to const reference
2021-12-03 04:50:45 +09:00
Asteroth b54b402aa5 review tweaks 2021-11-28 22:52:21 -05:00
Kiloku 623b84dfb1 clean-up 2021-11-28 18:43:32 -02:00
Kiloku 50180168c0 Add centered image and rectangle functions 2021-11-28 18:02:43 -02:00
The Force b3e4e5e2b8 More gcc Apeaseing 2021-11-28 17:33:33 +00:00
The Force aa0a71709b Appease gcc 2021-11-28 17:27:46 +00:00
The Force 3a86d9ad19 Player Orders Dialog 2021-11-28 17:19:16 +00:00
The Force e5428ef309 Fix typo 2021-11-28 12:23:09 +00:00
The Force 8892ad0902 Create Files 2021-11-28 12:18:37 +00:00
The Force 6bfee19268 Add Field to Qtfred Briefing editor(currently nonfunctional) 2021-11-25 17:07:36 +00:00
The Force acc6fb4cfb #3757 Substitute Ship Label In Closeup View 2021-11-25 17:06:50 +00:00
The Force 29f80b5399 Appease Clang 2021-11-25 15:31:13 +00:00
The Force 42d324cdaa Make Dialog Modal 2021-11-25 14:33:30 +00:00
The Force 0c04ed7c7d Hits Side Complete 2021-11-25 14:27:26 +00:00
The Force 76a7cfd8fc Merge buttons and activate dialog 2021-11-25 13:28:33 +00:00
The Force d7aeb2ba32 Merge Master 2021-11-25 13:16:29 +00:00
The Force ec922610c0 Completed Special Exp Side 2021-11-25 13:11:56 +00:00
Asteroth 72cb381c86 fix 2021-11-25 01:12:49 -05:00
Asteroth 20c8a37ed0 even more fix 2021-11-25 00:48:31 -05:00
Asteroth 4cb4c214c2 more fix 2021-11-25 00:32:57 -05:00
Asteroth 8518084ecc bugfix 2021-11-25 00:28:44 -05:00
Asteroth 30672aa343 add a warning for no asteroid types 2021-11-24 23:08:03 -05:00
Asteroth b0b40deae7 add a better random asteroid type picker and some fred/qtfred support 2021-11-24 23:01:16 -05:00
BMagnu b30ee67387 load techroom model subsystems into seperate buffer (#3796) 2021-11-24 13:07:40 -05:00
Asteroth 8f3b5dd2c0 address some review feedback 2021-11-24 02:42:30 -05:00
Asteroth 2517025111 correctly position tail for laser head on glows (#3789) 2021-11-21 21:48:06 -05:00
Taylor Richards ce9214974a Merge pull request #3734 from notimaginative/cfilesystem_cleanup
clean up some inconsistencies in cfilesystem
2021-11-21 14:26:12 -05:00
BMagnu c1d3f655e0 Merge pull request #3791 from EatThePath/animation_safety2
guard against trying to animate non-existent submodels in more places.
2021-11-21 14:06:53 +09:00
David Gibson c3afeffe7f Style fix 2021-11-20 19:59:09 -06:00
David Gibson dba56a1fd9 guard against trying to animate non-existent submodels in more places. 2021-11-20 19:00:15 -06:00
Goober5000 1819265c65 Merge pull request #3777 from Kiloku/draw_rotated_images
Allow drawing rotated bitmaps
2021-11-20 18:08:07 -05:00
Goober5000 f12823b3a6 Merge pull request #3790 from Kiloku/rotated-rect-use-radians
Change rectangle rotation to use radians
2021-11-20 18:00:14 -05:00
Kiloku b557017b20 Fix documentation 2021-11-20 19:36:03 -02:00
Kiloku ad308757f4 Change rect rotation to use radians 2021-11-20 18:29:00 -02:00
Kiloku 67966cec9d Use radians rather than degrees for angles 2021-11-20 18:07:30 -02:00
Asteroth 327a65917d review fixes and tweaks 2021-11-20 00:02:55 -05:00
Asteroth 32cca98349 dont do passive lightning on destroyed subsystems (#3771) 2021-11-19 23:26:43 -05:00
Asteroth 62c97006f8 take into account glow size for glow head on (#3787) 2021-11-19 12:54:01 -05:00
Asteroth 496cef91c0 dont exclude primary targets from dead targeting (#3781) 2021-11-18 03:35:24 -05:00
Goober5000 479d28e4c9 Merge pull request #3774 from Goober5000/multiple_event_check
indicate ambiguous goal or event matches
2021-11-18 00:51:32 -05:00
Goober5000 d634ce6b62 Merge pull request #3786 from Goober5000/submodel_turn_accel
refactor submodel flags and add $rotate_accel
2021-11-17 22:16:25 -05:00
Goober5000 9d6eec939c refactor submodel flags and add $rotate_accel
1) Changes the submodel flags to use a flagset instead of several booleans
2) Adds `rotate_accel` to allow submodel rotation acceleration to be specified

Submodel acceleration can now be instant; dumb-rotating submodels always instantly accelerate (and have always done so)
2021-11-17 21:45:01 -05:00
Tyler Blount aa1dbc1b0e Merge pull request #3785 from scp-fs2open/revert-3749-refactor/ci
Revert "Refactor CI scripts to make release builds more robust and flexible"
2021-11-17 14:06:36 -07:00
Tyler Blount 052d3d32c7 Revert "Refactor CI scripts to make release builds more robust and flexible" 2021-11-17 12:03:53 -07:00
Tyler Blount 48597e7751 Merge pull request #3784 from scp-fs2open/revert-3779-fix/nightly-trigger-pat
Revert "Use PAT for nightly trigger"
2021-11-17 11:55:56 -07:00
Tyler Blount 9190ba0eb4 Merge pull request #3783 from scp-fs2open/revert-3780-fix/nightly-build-cond
Revert "Fix conditional in Build Nightly action"
2021-11-17 11:29:47 -07:00
Tyler Blount 2297899005 Revert "Use PAT for nightly trigger" 2021-11-17 10:54:48 -07:00
Tyler Blount ba1e0afd31 Revert "Fix conditional in Build Nightly action" 2021-11-17 10:53:12 -07:00
Tyler Blount 383f549e05 Merge pull request #3780 from scp-fs2open/fix/nightly-build-cond
Fix conditional in Build Nightly action
2021-11-16 13:19:24 -07:00
Asteroth 98749e19b3 add flag for toggling ship passive lightning (#3772) 2021-11-16 14:18:26 -05:00
Tyler Blount e477f898b2 Fix conditional in Build Nightly action 2021-11-15 23:50:35 -07:00
Tyler Blount dbb41d2cdd Merge pull request #3779 from scp-fs2open/fix/nightly-trigger-pat
Use PAT for nightly trigger
2021-11-15 11:42:02 -07:00
Tyler Blount 5afc98d809 Use PAT for nightly trigger 2021-11-15 10:41:28 -07:00
Kiloku 719c047714 Avoid uninitialized variable 2021-11-14 16:41:38 -02:00
Kiloku 3038269804 allow drawing rotated bitmaps 2021-11-14 16:26:00 -02:00
Goober5000 56e6870761 address feedback 2021-11-14 00:32:48 -05:00
Goober5000 805cf61a36 indicate ambiguous goal or event matches
Check for multiple matches, not just missing matches.  Also streamline the syntax checking a bit more.  Fixes #3766.
2021-11-13 00:18:37 -05:00
Goober5000 c3137b8ab4 Merge pull request #3765 from Goober5000/subtitle_line_height
allow subtitles to use different line spacing
2021-11-12 22:11:31 -05:00
Goober5000 4aa74523ab address feedback 2021-11-11 18:52:41 -05:00
Asteroth aaaec24000 Ai use lock status for optimum range choice (#3762)
* ai use lock status for optimum range choice

* shadowed variable
2021-11-10 21:16:31 -05:00
Asteroth d079d7fad2 Expose nebula visibility factors (#3676)
* Expose nebula visibility factors

* separately expose size factors

* naming changes
2021-11-10 13:07:04 -05:00
Goober5000 76c9219df3 Merge pull request #3715 from TaGenius/feature/QtInitialStatusEditor
Split From #3674 Initial Status Dialog
2021-11-09 14:26:42 -05:00
The Force e795d2a9d2 Merge branch 'master' into feature/QtInitialStatusEditor 2021-11-09 16:50:47 +00:00
Goober5000 eccc34d081 Merge pull request #3717 from TaGenius/feature/QtGoalsDialog
Split From #3674 Goals Dialog
2021-11-08 23:03:19 -05:00
Asteroth b625e36858 add destroy-instantly-with-debris (#3752) 2021-11-08 11:06:34 -05:00
Goober5000 9050427706 Merge pull request #3767 from Goober5000/sexp_variable_protecc
guard against CTD in sexp variables
2021-11-07 18:25:22 -05:00
Goober5000 2f573924a7 address feedback 2021-11-07 16:26:28 -05:00
Goober5000 2e83e5211e guard against CTD in sexp variables
Don't assign strings that are too long for the string variable capacity.
2021-11-07 16:26:28 -05:00
Goober5000 c3db0ed369 Merge pull request #3761 from Goober5000/fix_3758
polish sexp syntax checking
2021-11-07 14:19:42 -05:00
The Force e8a33201f8 Merge branch 'master' into feature/QtShipEditorSubdialogs2 2021-11-07 16:28:21 +00:00
The Force ec35b5815e Merge branch 'master' into feature/QtInitialStatusEditor 2021-11-07 15:55:12 +00:00
The Force ac12cc7a80 Merge branch 'master' into feature/QtGoalsDialog 2021-11-07 15:48:16 +00:00
The Force 151039540c Add missing include 2021-11-07 15:44:13 +00:00
The Force f4a1b9a7fb Appease Clang 2021-11-07 15:44:13 +00:00
The Force 32d0ee93d4 Fix Compiler Warnings 2021-11-07 15:44:13 +00:00
The Force 49ced359c7 Goals Editor 2021-11-07 15:44:13 +00:00
The Force 31602dbefe Goals ui
finalise ui
2021-11-07 15:44:13 +00:00
The Force 101dda7f28 Split From #3674 Ship Editor Bugfixes (#3716)
* Remove Duplicate function

* Ship Editor Bugfixes

* Bugfixes for Ship editor

* Fix Compiler Warnings

* Add Tristate Checkbox

* Appease Clang

* Actually fix class bug

* Capitalization error fix

* Remove reference to goals dialog

This shouldn't have been added
2021-11-05 23:11:32 -04:00
The Force 19b3c419a7 Split From #3674 Flags Dialog (#3714)
* Create Flags UI

* initial Ship Flags editor


Ship Flags Column One Complete


Ship Flag DIalog Complete

* Fix Compiler Warnings

* Appease Clang

* Fix Scannable Misspelling

* Spelling Fixes and loose semicolon
2021-11-05 23:11:13 -04:00
Goober5000 779e69c3b4 Merge pull request #3745 from Goober5000/target_spelling
spelling fixes
2021-11-05 23:04:32 -04:00
Goober5000 b15858f686 redo initialization 2021-11-05 01:19:48 -04:00
Goober5000 b4f87fe04b Merge pull request #3764 from Goober5000/fix_rand32f
fix a major bug in ba.rand32f
2021-11-05 00:41:41 -04:00
Goober5000 cbda26b4fb allow subtitles to use different line spacing
This adds an optional extra factor to `show-subtitle` and `show-subtitle-text` to adjust the line height.  Useful for double-spacing, 1.5-spacing, etc.
2021-11-04 23:19:45 -04:00
Goober5000 e01ae9fe6f match documentation 2021-11-04 23:02:36 -04:00
Goober5000 b3bb185489 fix a major bug in ba.rand32f
The function should return the random result, not the maximum value.

Also use `ade_set_args` for consistency.
2021-11-04 21:57:29 -04:00
Goober5000 71ff21c3d5 address feedback 2021-11-02 12:03:04 -04:00
Asteroth 594491aa78 Add head-on laser bitmaps (#3748)
* version1 of 'head-on'lasers

* version 2 of head on lasers

* better handling of radius/length

* more adjustments and manual switchover angle

* add switchover rate and glow head on

* bugfix

* allow for instant switchover

* clean up and documentation for PRing

* misc fixes

* more fixes

* more fixes
2021-11-01 15:46:04 -04:00
Tyler Blount 7b7bf598b4 Merge pull request #3749 from ngld/refactor/ci
Refactor CI scripts to make release builds more robust and flexible
2021-11-01 10:28:46 -06:00
Goober5000 f960a09539 Merge pull request #3743 from Goober5000/gamesnd_tweaks
make gamesnd a little more robust
2021-10-31 21:15:58 -04:00
Goober5000 a25363e564 address feedback 2021-10-31 17:55:33 -04:00
Goober5000 71be5b7b80 make gamesnd a little more robust
a) add a new method gamesnd_game_sound_exists
b) add script support for this new method
c) use this method when checking for existence of ballistic rearming sounds
d) prevent "empty" and "none" sounds from triggering warnings
2021-10-31 17:55:33 -04:00
Goober5000 9e0802d53e make sure bad nodes are accurate 2021-10-31 16:29:08 -04:00
Goober5000 c8b773a6dd polish sexp syntax checking
Some instances of the ship syntax checker will check other nodes in the sexp tree.  In those cases, make sure to accommodate special-arg nodes.

This also merges syntax checking for goal/event names and docker/dockee points since they are highly similar.

Fixes #3758.
2021-10-31 16:16:23 -04:00
The Force 15d70c30c7 Fix Crash On second opening of select box cause by #3634 (#3760) 2021-10-31 18:41:24 +00:00
Goober5000 91be1654a3 Merge pull request #3741 from Shivansps/missing_updatedata
fix: cmdbrief not saving current stage text by closing the window
2021-10-30 01:18:52 -04:00
Goober5000 8ddf878144 Merge pull request #3755 from Goober5000/script_eval_bool
add script-eval-bool
2021-10-30 01:10:25 -04:00
Goober5000 14123b1a04 Merge pull request #3750 from Goober5000/better_argument_syntax_checking
better syntax checking for the special argument
2021-10-30 00:11:53 -04:00
Goober5000 00208af898 add script-eval-bool 2021-10-29 23:54:32 -04:00
Taylor Richards fd2785a504 Merge pull request #3754 from notimaginative/fix_escort_list_stealth_cull
fix escort list cull test which removed friendly stealth ships by mistake
2021-10-27 18:59:21 -04:00
Taylor Richards 8d7fd6893e fix escort list cull test which removed friendly stealth ships by mistake 2021-10-27 00:04:57 -04:00
Goober5000 cfc5901488 better syntax checking for the special argument
Improves syntax checking in two ways...
1) Properly checks each sibling of a special argument, rather than skipping the whole list even if just one is a special argument
2) Throws a syntax error if a special argument is found without an argument operator higher in the sexp tree, which fixes #3740
2021-10-25 01:08:44 -04:00
ngld 53b14a0cfd Refactor CI scripts to make release builds more robust and flexible 2021-10-24 01:16:48 +02:00
Goober5000 58680f766e Merge pull request #3746 from Goober5000/scripting_neb2_awacs
add scripting virtvar for Neb2_awacs
2021-10-22 11:59:29 -04:00
BMagnu 2e35e051e3 Merge pull request #3697 from Baezon/animated-neb-poofs
Add animated nebula poofs
2021-10-22 16:16:30 +09:00
Asteroth 375e1caca9 Remove 'stream' weapon handling (#3720)
* remove stream handling

* unused variable

* turn stream' into an unused flag

* yes really whitespace changes just for clang tidy
2021-10-22 16:15:56 +09:00
BMagnu 0ba5754c30 Add nullptr safety for animations (#3738)
* Add nullptr safety

* Greatly simplify docking animation logic

* Fix warnings

* Address Feedback
2021-10-21 21:18:31 +00:00
BMagnu b7258f5fea Add Bomb-locking secondaries (#3588)
* Add Bomb-locking secondaries

* Change to different flag

* Address feedback
2021-10-21 20:09:50 +09:00
Goober5000 89d0a49bdc add scripting virtvar for Neb2_awacs 2021-10-20 22:24:07 -04:00
Goober5000 e27ed05127 spelling fixes 2021-10-20 15:31:23 -04:00
Goober5000 a52e85c760 Merge pull request #3736 from EatThePath/gr_set_lighting-cleanup
Removing dead code paths
2021-10-20 11:48:19 -04:00
Goober5000 e07e8341f2 Merge pull request #3724 from Goober5000/hud_gauge_expanded_check
make hud gauge checking more robust
2021-10-20 10:21:22 -04:00
Joshua Glatt 0708dd725b Bump PLR/CSG versions and preserve pre-containers compatibility (#3739) 2021-10-19 21:53:20 -07:00
Asteroth bc24ac3ebc Add 'passive' lightning arcs to ships (#3733)
* add passive lightning arcs

* fixes and cache submodel number

* range based loop
2021-10-19 12:51:05 +09:00
Shivansps eb3224c50e fix: cmdbrief not saving current stage text by closing the window 2021-10-18 23:47:56 -03:00
BMagnu 16580ac48a Merge pull request #3732 from EatThePath/safety-animation
Protected against trying to animate non-existant submodels
2021-10-18 20:17:27 +09:00
Goober5000 f625096281 Merge pull request #3735 from BMagnu/secondary_no_ammo_turret_fix
Fix Turrets using ammo broken by #3589
2021-10-18 00:29:22 -04:00
Goober5000 5b173c6060 Merge pull request #3731 from Goober5000/state_end_script_hooks
migrate and augment mission/state end hooks
2021-10-17 19:30:58 -04:00
David Gibson 1c2b83f6aa Removing dead code paths 2021-10-17 11:05:37 -05:00
Birk Magnussen c4994c7fdd Add forgotten negation 2021-10-17 22:56:53 +09:00
Taylor Richards 64e57821eb address clang-tidy issues 2021-10-17 09:35:19 -04:00
Taylor Richards 044f4ef0e0 clean up some inconsistencies in cfilesystem:
- simplify OS specific code
 - make sure loose files are always sorted the same regardless of OS or filesystem
 - reduce differing behavior in cf_get_file_list*() variants
 - refactor case-sensitive directory handling to work everywhere it's needed
2021-10-17 08:56:35 -04:00
David Gibson 2034a3e9e5 Protected against trying to animate non-existant submodels in at least one case 2021-10-16 21:18:28 -05:00
Goober5000 b0c3b4098e migrate and augment mission/state end hooks
1) migrate On Mission End and On State End to the new hook system
2) add On Mission About To End and On State About To End
2021-10-16 21:56:20 -04:00
Asteroth f91a5bfd00 Add +arrival rvec for ship bays (#3698)
* add ship bay arrival rvec

* unused variables

* add profile flag

* add corresponding departure flag

* revert accidental changes

* fix fallout from visual studio's dumb 'rename' feature

* swap parsing of departure and arrival rvec
2021-10-15 16:48:56 -04:00
Goober5000 8af833c984 Merge pull request #3728 from Goober5000/sexp_replace_texture_edits
upgrade the replace-texture sexp
2021-10-15 13:15:06 -04:00
Goober5000 754fcb3467 upgrade the replace-texture sexp
This PR allows the sexp to replace textures with "invisible" as well as to use animated textures.
2021-10-15 00:51:09 -04:00
Goober5000 ebd31c1bd0 Merge pull request #3726 from Goober5000/pre_translation_cleanup
pre-translation cleanup
2021-10-14 11:43:41 -04:00
Goober5000 df83882d39 Merge pull request #3722 from EatThePath/ShaderCleanup
Removed unused constants from Lighting.sdr.
2021-10-14 11:42:57 -04:00
Goober5000 8e857ddd4e nullptrs for clang 2021-10-13 20:28:47 -04:00
Brian Hernandez 08548ea517 Scale distant combat related effects so they stay visible (#3656)
* Scale distant combat related effects so they stay visible
- Effects scaled so that they always maintain a minimum pixel size
- Supports lasers, beams, all trails, muzzle flashes, and thrusters
- Disabled by default, but can be configured through the game_settings.tbl

* Added comments clarifying when min pixel size scaling happens.

* Convert some NULLs to nullptr to make CLANG happy
2021-10-13 19:46:01 -04:00
Goober5000 ae63f02829 rename intrinsic rotation to intrinsic motion 2021-10-13 19:39:16 -04:00
Goober5000 9afec1fd34 add a new in() function to streamline things a bit 2021-10-13 16:52:37 -04:00
Goober5000 47fb4c1d35 use sm and parent_sm instead of submodel array indexes 2021-10-13 16:04:26 -04:00
Goober5000 db7d634a37 make hud gauge checking more robust
1) When syntax checking for hud gauges, be sure to check all gauges available because the default ship may not be the ship chosen in the player loadout.
2) Add a warning to every hud gauge check if the gauge isn't found.
3) Don't report syntax errors for hud gauges in FSO, only FRED; because every place that use a gauge will fail gracefully.
2021-10-12 22:19:39 -04:00
David Gibson c3cba091f1 Removed unused constants from Lighting.sdr. 2021-10-12 19:46:49 -05:00
Joshua Glatt 16d75b981c karajorma's SEXP containers, Part 2: Persistence (#3462) 2021-10-11 18:58:00 -07:00
Goober5000 f09730d923 Merge pull request #3719 from Goober5000/adjust_rotator_flag
rename and adjust scope of Rotators_locked flag
2021-10-11 13:47:58 -04:00
Goober5000 e1f20be856 rename and adjust scope of Rotators_locked flag
The Rotators_locked flag was created specifically as a lab option that didn't affect animations or intrinsic rotations, so return it to that scope.  Also rename it to clarify that it applies to subsystems and to be future-proof for submodel translation.
2021-10-11 12:06:17 -04:00
The Force 5cfa47a63e Fix load order problems caused by Iff vectorization (#3718)
* Fix load order problems caused by Iff vectorization

* Use Resize rather than push
2021-10-11 20:13:44 +09:00
Goober5000 8a449eb8ec Merge pull request #3713 from Goober5000/submodel_rotate_reorg
reorganize submodel rotation
2021-10-10 14:10:19 -04:00
Asteroth 0f06bf279a Add velocity inheritance for particle effects (#3691)
* implement velocity inheritance for particles

* add vel inherit for single effects

* appease clang

* review feedback
2021-10-10 13:37:31 -04:00
The Force aa0713fae6 Appease gcc 2021-10-10 14:30:01 +01:00
The Force 726d4f5cc7 Remove Misplaced Addition From Another Pull request 2021-10-10 14:14:43 +01:00
The Force 111736d86d Capitalization error fix 2021-10-10 14:08:12 +01:00
The Force 42890a3338 Add Tristate Checkbox 2021-10-10 13:58:00 +01:00
The Force 5b54ef772c Appease Clang 2021-10-10 13:31:16 +01:00
The Force 8a89c5bb05 Fix Compiler warnings 2021-10-10 13:29:35 +01:00
The Force 91331d5d4a More Bugfixes 2021-10-10 13:27:02 +01:00
The Force 84eacedb7c Some bugfixes
Shield bugfix
2021-10-10 13:25:20 +01:00
The Force 86d2ba8ebd Initial Status Dialog 2021-10-10 13:24:04 +01:00
Kiloku 0548b2fa2f Custom data in tables, tackling #3699 (#3707)
* Add custom data to ship tables

* add index check to shipclass.cpp

* fix hasCustomData name to use the proper casing

* Add custom data to weapon tables

* Add validity checks and remove superfluous empty check

* Attempt to appease clang-tidy

* Use F_RAW as recommended by @BMagnu

* Creates a function to parse maps and uses it in ship.cpp and weapons.cpp

* another attempt to appease clang-tidy

* Remove superfluous using

* Small style and grammar fixes

* Accidentally forgot this change. Rename 'delimiter' to 'end_marker'
2021-10-10 18:26:54 +09:00
BMagnu ce22482023 Merge pull request #3702 from Baezon/use-real-names-cheats
Use real names for ships/weapons in cheat commands
2021-10-10 18:24:27 +09:00
Goober5000 575c050da4 reorganize submodel rotation
This moves submodel rotation out of the AI pipeline and into object movement.  With the exception of turret rotation (which remains in the AI code) this now allows all types of submodel rotation to happen in the same place.  Many associated functions have also been cleaned up.

In addition to making the code cleaner and clearer, this will make it much easier for intrinsic rotations and new animations to be applied to non-ship objects, such as weapons.
2021-10-10 02:29:34 -04:00
wookieejedi dfa1de5470 Add Per-Ship Class Wingmen Status Dot (#3711)
* Add Per-Ship Class Wingmen Status Dot

This PR adds a ship info value `$Wingmen Gauge Dot Override:`, which  allows modders to set wingmen status dots on a per-ship class basis. If no animation is specified then the default dot animation specified in the HUD table wingmen gauge is used.

Both EatThePath and Darius stated this feature would be useful, and it will also be useful for FotG.

Tested and works as expected, including on winged ships present at mission start and delayed winged ships.
2021-10-09 19:00:16 -04:00
Kiloku 3538c55dae Add getColor to lua gr library, which returns the active color (#3687)
* Adds the getColor() function to the Graphics lua library, allowing users to check what color is active for 2D drawing.

* Adds the getColor() function to the Graphics lua library, allowing users to check what color is active for 2D drawing.
2021-10-09 17:39:41 +09:00
wookieejedi 870666dfa3 Add New Options to Wingmen Gauge (#3703)
* Add New Options to Wingmen Gauge

This PR adds two new options for modders to use in the HUD table for the wingmen gauge:
1) `Use Full Wing Names:` which draws the full wing name and does not alter the capitalization.
2) `Use Expanded Colors:` which use red, yellow, or green color to designate wingmen health (green 1.0 to > 2/3, yellow 2/3 to > 1/3, and red <= 1/3.

Also adds the bright red option to dead wingmen, which seems like it was missing before(?).

Tested and everything works as expected.

* correct string copy length

* fix out of scope case variable
2021-10-09 17:38:03 +09:00
BMagnu 1da6f4a6a2 Simplistic Ship Transparency (#3436)
* Basic per-render-model + per-ship tools

* Tidy up settable transparency for standalone use

* Force Alpha Premultiplied on external Alphamult

* Fix sexp description.
2021-10-08 21:49:13 +09:00
Asteroth c57bea8b84 NULL -> nullptr 2021-10-08 00:58:21 -04:00
Asteroth d4c2bb3e22 allow for arbitrary asteroid targets 2021-10-08 00:29:22 -04:00
Goober5000 6166ec4ce9 Merge pull request #3608 from Goober5000/perform_actions_etc
enhance the perform-actions family of sexps
2021-10-07 16:28:11 -04:00
Asteroth 5137ec1f3c use real names for in cheat commands 2021-10-07 12:03:58 -04:00
BMagnu d0bcf86ecc Wrap Docking getTime in a timestamp (#3701) 2021-10-07 06:29:51 -04:00
Asteroth 8604f783fb add no evasion flag (#3677) 2021-10-06 12:39:04 -04:00
BMagnu 12be7576f7 Animation Overhaul: Phase 2 (#3609)
* Add Generic Rotation Segment

* SEXPd rotations work

* Fully replace old animation system

* Add sound segment

* Fixes

* Trigger Hangarbay doors for lone player without AI

* Address Warnings

* Fix Docking ANimations + some bugs

* Fix sound issue + docking bug

* fix bugs, add multi handling

* Change direction into enum class

* Address feedback

* Futher clean aicode

* Address feedback

* Add Multi packet constexprs

* Fix multi constexprs

* Clarify AIS_DOCK comments

* Address multi issues

* Clang somehow detects issues where there are none...
2021-10-06 08:50:58 +09:00
Goober5000 47339e1561 Merge pull request #3671 from Goober5000/moar_sexp_documentation
expand some sexp documentation
2021-10-05 13:33:18 -04:00
Asteroth 2703fe865b Fix warnings concerning ballistic weapons (#3683)
* dont warn for provided pbank capacity but no ballistic weapons

* review feedback
2021-10-05 04:13:26 -04:00
Asteroth dbd5652eb8 add animation for nebula poofs 2021-10-05 03:01:52 -04:00
Goober5000 5364d65ec5 Merge pull request #3696 from Baezon/fix-secondary-has-ammo
Fix a possible crash with `ship_secondary_bank_has_ammo`
2021-10-04 22:17:52 -04:00
Goober5000 e5973e09ca Merge pull request #3695 from Baezon/fix-visibility-initialization
Initialize team visibility before using it
2021-10-04 22:15:08 -04:00
JohnAFernandez efeb0ee1f2 Actually fix the goal's target being sent (#3665) 2021-10-04 21:21:13 -04:00
Asteroth ca690c267c verify secondary_bank_weapons before usage 2021-10-04 18:56:51 -04:00
Asteroth 95de9e3ff5 initialize awacs data in post mission parse 2021-10-04 18:33:11 -04:00
Asteroth a1ae1d80a9 Safety for replace-texture (#3694)
* dont add replacement texture if unable to find original texture

* NULL -> nullptr
2021-10-04 01:07:38 -04:00
Allen A. Babb 64b2469235 Merge pull request #3688 from z64555/fix/issue_3685
Fix issue 3685
2021-10-02 23:57:22 -05:00
BMagnu 2b63097c12 Exclude dead subsys from targeting (#3614)
* Exclude dead subsys from targeting

* Put behaviour behind flags

* Make ML lock disappear when subsys dies

* Flip flag to change default behaviour
2021-10-03 03:57:40 +09:00
z64555 ea0ad0935d Cease Targeting properly, without going out of array bounds. Should fix issue #3685. 2021-10-02 13:54:28 -05:00
Kiloku ecea40e38f Allow Lua Scripts to draw rotated rectangles (#3623)
* Adds the angle parameter to gr.DrawRectangle, allowing scripters to draw arbitrarily rotated rectangles.

* Revert "Adds the angle parameter to gr.DrawRectangle, allowing scripters to draw arbitrarily rotated rectangles."

This reverts commit b1a0480f32.

* Adds the angle parameter to gr.DrawRectangle, allowing scripters to draw arbitrarily rotated rectangles.

* fix wrong vertex position for unfilled rotated rectangles

* Adds a @param entry to gr_rect explaining the angle parameter.

* Attempt to fix operations with int to float conversions.

* Fix parameters in documentation string

* Change NULL to nullptr to satisfy modern coding standards

* Trying to make code a bit cleaner
2021-10-02 13:11:35 -04:00
BMagnu a6093dd8c4 Add ammoless secondaries (#3589)
* Add ammoless secondaries

* Macroify 'ammo>0 || no ammo' check
2021-10-02 04:40:03 +09:00
Goober5000 2b74ba1d30 Merge pull request #3684 from Goober5000/on_death_started
add OnShipDeathStarted scripting hook
2021-10-01 14:03:00 -04:00
Asteroth 76046d8aee Clean up beam type naming scheme (#3670)
* clean up beam type naming scheme

* appease clang tidy

* cast to int for printing

* address feedback
2021-10-02 02:42:21 +09:00
Goober5000 ebcd4135a7 additional fixes, including a bugfix for #3679 2021-10-01 11:46:48 -04:00
Goober5000 6575cf6887 add OnShipDeathStarted scripting hook
This occurs at the beginning of the ship death routine, similarly to OnDepartureStarted occurring at the beginning of the ship departure routine.
2021-09-30 22:42:15 -04:00
Goober5000 470466e8c7 Merge pull request #3679 from Goober5000/killer_fixes
patch up scripted kills
2021-09-30 22:41:32 -04:00
BMagnu f0f6cabe84 Add full team option to change-iff SEXP (#3632)
* Add full Team option to change-iff

* Fix help text
2021-10-01 05:09:00 +09:00
BMagnu 37a52dcb41 Merge pull request #3630 from Kiloku/lua_expose_weapon_radius
Expose Outer and Inner Radii to the Lua API in the weaponclass type
2021-10-01 04:17:06 +09:00
BMagnu 391de411ee Vectorize IFF Defs for unlimited IFFs (#3634)
* make IFF limit a vector

* Also change QTFred

* Warnings

* remove decltypes, wrap arrays in unique_ptr
2021-09-30 14:17:28 +09:00
Goober5000 f8c0d30ee1 Merge pull request #3660 from BMagnu/Lua_ship_iter
LUA: Add iterator over ships in mission
2021-09-29 21:45:17 -04:00
The Force 9fc778d7d8 Special Stats Dialog 2021-09-29 11:04:02 +01:00
Goober5000 30d4455417 patch up scripted kills
When a ship is killed via scripting, the killer should be credited for the kill in the mission log and the correct hull percentage should be used.  Also, the script should work with either the ship or its weapon passed as the killer parameter.
2021-09-29 01:41:36 -04:00
Goober5000 a9b46f6bd3 Merge pull request #3678 from Goober5000/update_version_21.5.x
bump version to 21.5.x
2021-09-29 00:59:37 -04:00
Goober5000 8487323175 bump version to 21.5.x 2021-09-29 00:05:36 -04:00
the-maddin 5eb4c35572 clang msvc
(cherry picked from commit 6faa6d41d87fdca6c9acc24b080451cd3fbfce59)
2021-09-28 22:46:30 +02:00
the-maddin 15752d1729 Integrate branch buttons into context menu
(cherry picked from commit fb986ea29efd7e9612d76e0722733d33a2f95aa3)
2021-09-28 20:23:13 +02:00
the-maddin 413842c84a Branch moving & branch UI misc
(cherry picked from commit 9ecb5b734de149ad85e2ad3c4409a20714b4f96a)
2021-09-28 20:23:13 +02:00
the-maddin e41bde6dad Fix branch sexptree popup menu part 3
(cherry picked from commit 4cd06c05b56518ac92ca0d63203437a7fa38de6c)
2021-09-28 20:23:13 +02:00
the-maddin e37ca8fd8e Model data access fix
(cherry picked from commit
effea261ecb607c09422ec9973522b02821bee6e)
2021-09-28 20:23:13 +02:00
the-maddin e2099271c6 Fix branch sexptree popup menu part 2
(cherry picked from commit 53d5d25c3a21876b3246af3eeff91ded7c37b678)
2021-09-28 20:23:13 +02:00
the-maddin 19817f4cda reorder model impl and lazy init some constants
(cherry picked from commit f2b2385a27b52a2088421c203560309e38444fcd)
2021-09-28 20:23:13 +02:00
the-maddin c41e5c9d7f Always replace corrupted model after load attempt
(cherry picked from commit ed8be26f81e80b72e147ea54b54b7440606e302c)
2021-09-28 20:23:13 +02:00
the-maddin b08109c2fe Fix branch sexptree popup menu part 1
(cherry picked from commit 17319ea5deb48e4ac27af804033dabc5907e781f)
2021-09-28 20:23:13 +02:00
the-maddin 30b484b276 Use AssociatedPlainTextDocument
(cherry picked from commit 5abb00e4382840e04474905f1477121173bd986a)
2021-09-28 20:23:13 +02:00
the-maddin 2989034394 Dialog cleanup
(cherry picked from commit 024be9d0e6d3c447c6b2bc972be4dddc9b31bfc2)
2021-09-28 20:23:13 +02:00
the-maddin eec2ce1713 Model structure and TextEdit cleanup
(cherry picked from commit 306de2da527128583841f0cb73363fb5ca222b16)
2021-09-28 20:23:13 +02:00
the-maddin 439f633364 Add branches & conditions in model
(cherry picked from commit 730bf0d9d5ff55b1b0e99c73c79ce12e5af67d48)
2021-09-28 20:23:13 +02:00
the-maddin 458d2f5e12 custom mission selection & linking context menu
(cherry picked from commit 31d2b9d0e02c803fa06b369772d754da70187c3c)
2021-09-28 20:23:13 +02:00
the-maddin 2f361340fc Parse eligible & campaign missions for event names
(cherry picked from commit 62a6ae9f6fc8cb7955b7804aeb951564c5bd3bd0)
2021-09-28 20:23:13 +02:00
the-maddin 41d65630f8 validate and use current branch index
(cherry picked from commit 072796d1f76325ec5e9be38c899951420d3ea781)
2021-09-28 20:23:13 +02:00
the-maddin d309ddef1e Simplify QPlainTextEdit (#3600) 2021-09-28 13:50:04 -04:00
Goober5000 d3b37efb7d Merge pull request #3647 from Goober5000/hidden_mission_log_flag
add hide-in-mission-log ship flag
2021-09-28 11:48:21 -04:00
EatThePath a8bbe23800 Fix homing child weapons in niche circumstances (#3661)
* Deleted a line that blanked target_num on homing weapons but still let them home

* This whole block of code about missiles missing turns out to be a logical dead end anyway, ripped it out by the roots.
2021-09-28 01:42:18 -04:00
Goober5000 edf7d6cccf expand some sexp documentation
Adds important information to `ship-guardian` and `show-subtitle-image`.  Fixes #3669.
2021-09-22 22:34:49 -04:00
the-maddin 5e57094f8e Merge branch 'master' into qt-campaign-editor 2021-09-19 14:27:07 +02:00
Birk Magnussen 07abcf2238 secure iterators against ships being removed from them while still iterating 2021-09-17 01:40:31 +09:00
Birk Magnussen 491946bfd0 Add explanation 2021-09-17 01:18:22 +09:00
Birk Magnussen 2306faa7cd Add iterator over ships 2021-09-16 22:58:33 +09:00
Goober5000 e81001f6a6 Merge pull request #3648 from Goober5000/ai_ignore_documentation
add some SEXP documentation
2021-09-15 10:03:03 -04:00
Goober5000 945427a849 Merge pull request #3657 from Goober5000/fix_3654
fix the cancel behavior when FRED is closed
2021-09-15 10:02:45 -04:00
Goober5000 9d1c93041e turns out you can actually embed numbers in strings in the preprocessor 2021-09-15 02:19:05 -04:00
Goober5000 5fb9a6f0c6 fix the cancel behavior when FRED is closed
Explicitly check whether the mission has been saved, because the automatic check doesn't provide a way to detect that it has been cancelled.

Fixes #3654.
2021-09-15 01:35:25 -04:00
Goober5000 e2a359b546 Merge pull request #3655 from brihernandez/mod_table_is_game_settings_comment
Added comment to clarify that the mod_table is about game_settings.tbl
2021-09-14 19:03:45 -04:00
Brian e48011d175 Added comment to clarify that the mod_table is about game_settings.tbl 2021-09-14 11:26:13 -04:00
Fabian Woltermann 8766c642fe Merge pull request #3652 from qazwsxal/master
Anti-glint shader trick to reduce glimmer on distant objects
2021-09-14 14:24:00 +02:00
Adam Leach 565f4d469c Anti-glint shader trick to reduce glimmer on distant objects 2021-09-14 10:26:33 +01:00
Goober5000 8e7476c1b8 Merge pull request #3651 from Goober5000/lua_gc
use public API call for Lua garbage collector
2021-09-14 02:16:54 -04:00
Goober5000 d41020222e use public API call for Lua garbage collector
As described in #3650.
2021-09-13 19:36:24 -04:00
Fabian Woltermann 9c1cf58f8d Merge pull request #3649 from Goober5000/techroom_fix
fix lab variables
2021-09-13 08:21:50 +02:00
Goober5000 183db641d7 fix lab variables 2021-09-13 01:51:13 -04:00
Goober5000 10a5a0d29a add some SEXP documentation
Per request, add some more documentation to ai-ignore and ai-ignore-new (and ai-play-dead while we're at it).

Fixes #3612.
2021-09-13 00:37:34 -04:00
Goober5000 8cf8d451a8 allow ship creation to not be visible in the mission log 2021-09-12 16:29:17 -04:00
Goober5000 49bab8fe83 add hide-in-mission-log ship flag
This flag causes any events involving this ship to not show up in the mission log.
2021-09-11 23:43:30 -04:00
JohnAFernandez 830ecf2ea2 Merge pull request #3646 from BMagnu/fix_lab_turrets
Fix Turrets in Lab
2021-09-11 12:54:45 -04:00
Birk Magnussen 472fd6f20f Fix Turrets in Lab 2021-09-12 01:30:33 +09:00
Goober5000 262e4d4489 Merge pull request #3645 from Goober5000/shipname_fix
correct shipname return type
2021-09-08 21:33:00 -04:00
Goober5000 c9d71ce1ab correct shipname return type
The return type of "shipname" is a string, so if the ship can't be found, return an empty string instead of an invalid ship.
2021-09-08 20:57:09 -04:00
Goober5000 e742bd108a Merge pull request #3635 from Goober5000/gc_on_mission_start
run Lua garbage collector on mission start
2021-09-07 14:15:58 -04:00
Goober5000 990d0b7784 run Lua garbage collector on mission start
This might fix #2961.  By explicitly running the garbage collector before a mission starts, this will ensure each mission begins with a clean slate.
2021-09-07 13:50:08 -04:00
Goober5000 7c5371af1a Merge pull request #3624 from Goober5000/fred2_cancel_confirm
confirm cancel in Event Editor
2021-09-05 14:45:14 -04:00
Goober5000 99972a17c6 Merge pull request #3625 from Goober5000/duplicate_squadron_wings
match wing names and aliases on the status gauge
2021-09-05 14:43:27 -04:00
Joshua Glatt 2e743d9cd6 Apply adjust-audio-volume SEXP for effects to looping 3D sounds (#3638) 2021-09-05 11:39:37 -07:00
Goober5000 b7681cfee9 Merge pull request #3636 from Baezon/fix-turret-resetting
Fix turrets not resetting sometimes
2021-09-05 14:31:17 -04:00
Goober5000 5eb924cedc Merge pull request #3639 from Goober5000/handle_invalid_gamesnds
handle invalid gamesnds
2021-09-05 14:29:17 -04:00
Goober5000 d561cd87c4 Merge pull request #3641 from Goober5000/fix_3619
fix nebula range in mission-set-nebula
2021-09-05 14:12:49 -04:00
Goober5000 562522e098 match wing names and aliases on the status gauge
If a wing has a hash symbol, it needs to match the squadron status gauge for the equivalent name without the hash.  This could happen for in-mission jumps or cases where a wing leaves and comes back.

Also remove an obsolete function.
2021-09-05 14:12:08 -04:00
Goober5000 f7bfd637d8 comments 2021-09-05 13:44:02 -04:00
Goober5000 235857ca10 add back fred support 2021-09-05 13:15:34 -04:00
Goober5000 f529fbc633 expand comments 2021-09-05 13:11:33 -04:00
Goober5000 22b16c32d4 Merge pull request #3631 from Goober5000/rewrite_xstr
rewrite XSTR to be more robust
2021-09-05 13:04:41 -04:00
Goober5000 b1298c2b68 address feedback 2021-09-04 18:43:46 -04:00
Goober5000 2ec18afe02 CI 2021-09-04 17:16:33 -04:00
Goober5000 7f742a2145 fix nebula range in mission-set-nebula
The mission-set-nebula sexp never initialized the nebula range, which is usually done in the background editor.  This PR allows the range to be specified, and sets it to 3000 (the same default as in the background editor) if not specified.

Fixes #3619.
2021-09-04 16:37:49 -04:00
Goober5000 b96d9f6e62 address feedback 2021-09-04 15:46:03 -04:00
Goober5000 eaa3fe0979 address feedback 2021-09-03 23:56:46 -04:00
Goober5000 1cd16b7281 string length tweak 2021-09-03 23:16:40 -04:00
Goober5000 44ce5e9b00 handle invalid gamesnds
If an entry in a game sound fails to load, mark the sound as invalid and don't try to load it afterwards.  This is the "permanent fail" fix for #3388.
2021-09-03 19:10:31 -04:00
Asteroth 13b922207b comment cleanup 2021-09-03 00:14:58 -04:00
Asteroth efc686db2d unused variable 2021-09-01 14:33:57 -04:00
Asteroth 2738919cc9 fix turrets not resetting sometimes 2021-09-01 14:29:57 -04:00
Goober5000 7e9121ed8e use blocks instead of goto; avoids skipping over initialization 2021-08-29 22:56:37 -04:00
Goober5000 f0712cfb41 rewrite XSTR to be more robust
The old XSTR parsing code was a bit of a mess and did not even properly enforce its format.  These new routines enforce the actual XSTR format and warn when it is malformed, which is helpful for catching table errors as early as possible.  This fixes #3627 and also catches mismatched quotes and other common XSTR errors.  No more wondering why comments are being mysteriously parsed instead of ignored!
2021-08-29 21:47:15 -04:00
Kiloku 15e1de386c Exposes Outer Radius and Inner Radius to the Lua API in the weaponclass object type. 2021-08-29 14:47:46 -03:00
Goober5000 af8422cf7b confirm cancel in Event Editor
This syncs up the Close and Cancel behavior.  In both cases, if there are any changes, FRED will display a prompt.
2021-08-26 16:32:18 -04:00
Asteroth 39a16019e3 Single target multilock missiles should use targeted_subsys (#3618)
* use targeted_subsys if available
2021-08-24 19:45:34 -04:00
Asteroth bbca518524 no chase cam slewing during hyperspace (#3620) 2021-08-24 19:44:07 -04:00
Goober5000 bb28c37829 Merge pull request #3616 from Goober5000/look_at_updates
fixes to look_at and intrinsic rotation
2021-08-22 22:57:26 -04:00
Goober5000 ad2335cfbf fixes to look_at and intrinsic rotation
1) Make sure the `PM_FLAG_HAS_INTRINSIC_ROTATE` flag is only set after submodels pass validation and checking
2) Maintain compatibility with old models that used `$look_at` with the submodel number instead of name
2021-08-22 22:09:18 -04:00
Allen A. Babb 7bf7bf5c1d Merge pull request #3617 from z64555/fix/axis_backups_move_too_much
Fixes a typo in controlconfig that causes an issue with std::move.
2021-08-22 16:18:20 -05:00
z64555 99b7c89883 Fixes a typo that caused an issue for some builds when trying to move the axis binding backups into the bindings during the exit state of the controls config menu. 2021-08-22 15:39:20 -05:00
Goober5000 370419b1a2 Merge pull request #3610 from Goober5000/some_ai_profiles_fixes
some ai_profiles fixes
2021-08-21 21:40:46 -04:00
Goober5000 17d1924897 make CI happy 2021-08-21 20:18:08 -04:00
Goober5000 a351e72895 some ai_profiles fixes
1) Several AI profiles options were getting reset on every iteration through the loop.  They should only be reset when the profile is initially created.
2) Keeping track of AI hits on the player ship was added by Sushi in 9246a2f74d and needs to be guarded by a flag.  This flag has been enabled for mods that set the required FSO version.
2021-08-21 19:53:46 -04:00
Asteroth cd4c6e483a add a few mor cases for checking targeting restrictions (#3605) 2021-08-20 16:11:18 -04:00
Goober5000 4dad58af6e CI fixes 2021-08-20 11:53:32 -04:00
Goober5000 91789c2251 add functional-when 2021-08-19 23:30:52 -04:00
Goober5000 03531a7932 make a distinction between perform-actions-bool-first and perform-actions-bool-last, and deprecate perform-actions 2021-08-18 23:59:17 -04:00
Asteroth 82c36b1c59 fix shockwave rotation (#3604) 2021-08-18 14:55:14 -04:00
Asteroth 47f84846e3 fix collision retiming to never be in the future (#3599) 2021-08-12 17:21:22 -04:00
Goober5000 2fe789f87b Merge pull request #3595 from Goober5000/ship_logging
improve logging of ship creation and cleanup
2021-08-11 16:17:09 -04:00
BMagnu f850725c14 Merge pull request #3597 from Baezon/fix-poof-density
Fix for 'anemic' poofs
2021-08-12 01:12:26 +09:00
Goober5000 344eb5a7ed Merge pull request #3596 from Goober5000/fix_fs1_import
fix icon on FS1 mission import
2021-08-11 12:07:24 -04:00
Goober5000 10b357172a improve and expand logging 2021-08-11 02:50:07 -04:00
Asteroth 4892ac7b01 unused param 2021-08-11 00:07:56 -04:00
Asteroth 4474b0087d comments 2021-08-10 23:41:35 -04:00
Goober5000 ee1b6263ba fix icon on FS1 mission import
The SD Demon doesn't use the support ship icon anymore, and hasn't since FSPort switched from FS2-style icons to FS1-style icons.
2021-08-10 23:26:47 -04:00
Baezon 73ced78633 fix poof density 2021-08-10 21:44:02 -04:00
Goober5000 50266c5065 Merge pull request #3580 from JohnAFernandez/qtFRED-CommandBrief-Dialog
qtFRED Command Breifing
2021-08-10 13:55:53 -04:00
JohnAFernandez 00f4797b45 qtFRED Command Breifing
Adds a fully functioning Command Briefing Dialog to qtFRED
2021-08-09 14:23:23 -04:00
BMagnu 2377b5dff2 Merge pull request #3594 from BMagnu/anim_rework_1_perf
Animation Rework Phase 1 Fixes 4 / Performance Issues
2021-08-10 01:33:53 +09:00
Goober5000 f8c41ac377 improve logging of ship creation and cleanup
It's useful for *all* ship cleanup to be logged, not just big/huge ships.  And by extension, it's also useful for ship creation to be logged.
2021-08-09 01:43:07 -04:00
Birk Magnussen aee9dc6910 Fixed bad stepAnimations call, added initial-type optimizations 2021-08-09 14:36:57 +09:00
ngld 2e5a6871c5 Merge pull request #3593 from Goober5000/wrap_no-float16
add a version guard for MSVC compiler bug fix
2021-08-08 11:29:11 +02:00
Goober5000 535b0857b6 add a version guard for MSVC compiler bug fix
Per ngld's suggestion, this adds a version check around the disabling of the qfloat16 overloads.

Follow-up to #3557.
2021-08-07 19:19:02 -04:00
Allen A. Babb 2fa7ddc552 Merge pull request #3481 from MageKing17/bugfix/mainhall-misc-apng-animations
Fix APNG misc mainhall animations.
2021-08-07 13:09:37 -05:00
BMagnu a6f821daee Merge pull request #3592 from Baezon/type-5-targetless-turrets
Handle turret fired type 5 beams without targets properly
2021-08-08 01:47:10 +09:00
Baezon 360198b99f handle turret fired beams without targets properly 2021-08-07 12:20:11 -04:00
Asteroth 7fe62aabcd Add some chase view Improvements (#3571)
* improve chase view cam

* fix comment

* comment description of acceleration
2021-08-05 11:09:08 -04:00
Goober5000 d2859f4979 Merge pull request #3585 from Goober5000/dynamic_fred_poofs
handle nebula poofs dynamically in FRED
2021-08-04 16:58:52 -04:00
Goober5000 643a87a7f1 Merge pull request #3586 from Goober5000/fred_and_teams_and_mantis_2053
ships, wings, etc. can share names with teams
2021-08-04 16:42:09 -04:00
Goober5000 d1d78c980e Merge pull request #3564 from Goober5000/turn_off_wireframe
add Draw Outlines on Selected Ships option
2021-08-04 02:12:21 -04:00
Goober5000 148df94e50 use original intent of colors 2021-08-04 01:42:42 -04:00
Goober5000 d443e9e7d0 might as well fix this too 2021-08-03 22:23:04 -04:00
Goober5000 e1bbbf9f9a ships, wings, etc. can share names with teams
Partial revert of Mantis #2053:
http://scp.indiegames.us/mantis/view.php?id=2053

The patch was speculative and there was never a confirmed bug.  By contrast, there are plenty of existing missions that use Unknown as a ship, wing, or jump node name and work just fine.
2021-08-03 22:06:57 -04:00
Goober5000 fdafe21684 handle nebula poofs dynamically in FRED
Inspired by #3584, this properly saves and restores any number of nebula poofs handled by the game.  FRED will only display checkboxes for the first six, since it still uses the static UI, but everything else is handled behind the scenes.
2021-08-03 21:21:42 -04:00
BMagnu 7ccd13bbce Merge pull request #3584 from BMagnu/fred_poof_clear
FRED: Don't clear poof flags for poof 7 and after
2021-08-04 09:41:56 +09:00
Birk Magnussen 9f45f49ec1 Only clear settable poof bitflags 2021-08-04 00:57:07 +09:00
BMagnu 6b5124a8ad Merge pull request #3582 from BMagnu/anim_rework_1_fixes_3
Animation Rework Phase 1 Fixes #3
2021-08-03 11:15:46 +09:00
Birk Magnussen 1187ebbc2c GCC Warnings 2021-08-02 23:33:26 +09:00
Birk Magnussen d92fab80ef Find turrets by sip name (since index can change) and make pointers shared 2021-08-02 22:35:41 +09:00
BMagnu 1b9dd78233 Merge pull request #3507 from Baezon/poof-overhaul
Overhaul nebula poof system
2021-08-02 18:35:40 +09:00
Baezon ebb5ed9ba6 review tweaks 2021-08-01 13:08:11 -04:00
BMagnu dabdc871a6 Merge pull request #3579 from BMagnu/anim_rework_1_fixes_2
Animation Rework Phase 1 Fixes #2
2021-08-01 14:39:38 +09:00
Birk Magnussen 77a255af63 GCC Warnigns 2021-07-30 18:05:46 +09:00
Birk Magnussen 45c904c25e Fixed memory issue and turret-specific animation handling cases 2021-07-30 17:08:24 +09:00
BMagnu 3d0bd54980 Merge pull request #3578 from BMagnu/anim_rework_1_fixes_1
Anim Rework Phase 1 Fixes
2021-07-30 03:27:39 +09:00
Birk Magnussen 7228244f0c Add forced animation start mode 2021-07-29 20:46:37 +09:00
Birk Magnussen f0f5679731 Fix flipped turret values 2021-07-29 20:21:01 +09:00
Asteroth 1306a23fd4 Merge pull request #3568 from Baezon/fix-turret-flags-no-parse-object
Move some flag setting to subsys_set()
2021-07-28 03:15:58 -04:00
Goober5000 f067a19583 Merge pull request #3576 from Goober5000/override_all_briefing_icons
allow custom briefing icons to always override standard icons
2021-07-28 00:40:42 -04:00
Goober5000 8ad52cd8e0 Merge pull request #3577 from notimaginative/fix_cmdline_password_bug
fix error with -password cmdline option
2021-07-28 00:40:22 -04:00
Taylor Richards a27976bf9a fix error with -password cmdline option 2021-07-27 19:41:01 -04:00
Goober5000 deefbf0860 allow custom briefing icons to always override standard icons
Adds the `$Custom briefing icons always override standard icons:` option to game_settings.tbl.  Implements #3575.
2021-07-27 14:16:58 -04:00
Goober5000 c0f9ad7b3c Merge pull request #3574 from Goober5000/fix_time_to_goal
fix Time To: Unknown on the HUD
2021-07-25 18:17:25 -04:00
Goober5000 482cc7d7a6 fix Time To: Unknown on the HUD
PR #3064 inadvertently caused all goals to display Time To: Unknown, even though time was only supplied for docking and waypoints.  This restores the original behavior where the Time To: line simply wasn't displayed.
2021-07-25 15:29:24 -04:00
JohnAFernandez 18754fafc1 Force Portable Initial Changes (#3562)
Allows us to at least try to use a file path with a unicode character

Typo

Fixup

Update osapi.cpp
2021-07-25 14:18:45 -04:00
Baezon d05b3fa637 handle beam free all in subsys_set 2021-07-25 11:15:01 -04:00
Goober5000 a26367db5f qtfred support 2021-07-24 14:15:06 -04:00
Goober5000 e3617169ca add Draw Outlines on Selected Ships option
This option is helpful because the mesh outlines will often obscure important information like submodel names and turret weapons.
2021-07-24 14:15:06 -04:00
Goober5000 3c487f81f3 Merge pull request #3570 from Goober5000/weapon_list_type_fix
fix WEAPON_LIST_TYPE parsing for -1
2021-07-24 14:12:33 -04:00
Goober5000 878dd4b313 this makes sense too 2021-07-23 20:59:37 -04:00
Goober5000 74d95f01bc fix WEAPON_LIST_TYPE parsing for -1
When an empty string is encountered in the weapon list, it's valid, but the -1 should actually be stored, not skipped.

This bug was preventing ship weapons from being explicitly set to None.
2021-07-23 20:52:29 -04:00
BMagnu 226d51c214 Merge pull request #3500 from BMagnu/anim_rework_1
Animation Overhaul: Phase 1
2021-07-23 23:59:26 +09:00
Asteroth 9855062732 Merge pull request #3567 from Baezon/fix-null-parse-object
Fix a nullptr bug with change_ship_type
2021-07-23 01:01:08 -04:00
Birk Magnussen 5709e24e9a save by PMI id not PMI*, rename 'time' variable 2021-07-23 13:17:11 +09:00
JohnAFernandez 13c410e864 Remove extra AI Profiles call (#3566)
This function has to be called on game/FRED/qtFRED start, and does nothing once it is called.  So there is no reason for it to be hear on mission close.
2021-07-22 22:51:11 -04:00
Birk Magnussen 5f4729bddb Remove Variable Shadowing 2021-07-23 04:38:23 +09:00
Baezon 65fa916cba move some flag setting to subsys_set 2021-07-22 15:29:22 -04:00
Birk Magnussen 473acced54 Apply new initial animations for techroom instances 2021-07-23 04:27:43 +09:00
Birk Magnussen b58b60b555 Fix Constructor Order 2021-07-23 03:31:06 +09:00
BMagnu 9c3b90f403 Merge branch 'master' into anim_rework_1 2021-07-23 03:18:32 +09:00
Birk Magnussen 3b0e02545e Move Animations from ship* to pmi* 2021-07-23 03:12:54 +09:00
Baezon 9e6e1ef123 clang tidy 2021-07-22 12:00:00 -04:00
Baezon 2e4e9855bc ensure p_objp is not null 2021-07-22 01:59:26 -04:00
Asteroth 9adc89a5a2 Merge pull request #3441 from Baezon/ballistic-beams
Add support for ballistic beams
2021-07-21 15:58:09 -04:00
Goober5000 8faa521df9 Merge pull request #3565 from Goober5000/fix_briefing_icon_override
fix briefing icons changing to ships unexpectedly
2021-07-21 12:33:59 -04:00
Baezon a3513c38b6 Merge branch 'master' into ballistic-beams 2021-07-21 02:59:33 -04:00
Goober5000 15901e430f fix briefing icons changing to ships unexpectedly
If the briefing icon doesn't actually show a ship, then don't use the ship icon override.
2021-07-20 23:21:11 -04:00
Asteroth 37584f576c Merge pull request #3561 from Baezon/no-generic-debris-for-subsystems
Minor improvement for generic debris on subsystems
2021-07-19 19:55:44 -04:00
Baezon 3863d9b5a9 dont use generic debris for subsystems 2021-07-17 20:20:54 -04:00
Goober5000 5318fba077 Merge pull request #3558 from Goober5000/qtfred_menu_update
Qtfred menu update
2021-07-17 19:54:06 -04:00
Asteroth d187a6ae99 Merge pull request #3555 from Baezon/firepoints-burst-shots
Add "num firepoints for burst shots" flag
2021-07-17 19:40:04 -04:00
Asteroth 30b35b483b Merge pull request #3556 from Baezon/audiostream-set-volume
Add setVolume function for audio_stream objects
2021-07-17 19:39:33 -04:00
Goober5000 f7f0c2ba21 Merge pull request #3559 from Goober5000/training_message_preservation
Training message preservation
2021-07-17 00:10:51 -04:00
Goober5000 f1362a694d Merge pull request #3560 from Goober5000/log_lcl_weirdness
log when missions are skipped due to XSTR mismatch
2021-07-17 00:09:34 -04:00
Baezon db55349f70 some extra safety and warning for super huge numbers of poofs 2021-07-16 22:30:39 -04:00
Baezon 2d84fdf5c6 Merge remote-tracking branch 'upstream/master' into poof-overhaul 2021-07-16 22:29:56 -04:00
Goober5000 5e7a6ece52 log when missions are skipped due to XSTR mismatch
As a follow-up to #2343, users might wonder why their mission isn't showing up in the tech room, so log a friendly message.
2021-07-16 22:17:36 -04:00
Goober5000 ff62ea010e training messages have additional idiosyncrasies 2021-07-16 22:09:11 -04:00
Goober5000 a14a746a4f don't pre-empt training messages before they finish playing 2021-07-16 20:56:33 -04:00
Goober5000 d4c0c45595 whoops 2021-07-16 00:09:37 -04:00
Goober5000 06eaeca9d7 add Move Ships When Undocking menu option 2021-07-15 23:50:20 -04:00
Goober5000 dd5c92a910 move the show teams code to the right spot and remove the todo 2021-07-15 23:49:27 -04:00
Goober5000 2de1776308 reorder misc menu and fix a couple captions 2021-07-15 23:13:12 -04:00
Goober5000 833b51e423 sync shortcut keys to what they are in FRED 2021-07-15 22:46:57 -04:00
Goober5000 726d66d0ad add the Highlight Selectable Subsystems menu item 2021-07-15 22:17:05 -04:00
Goober5000 c7e2b3c78f add the Clone Marked Objects menu item 2021-07-15 22:15:26 -04:00
Goober5000 97a93162f8 Merge pull request #3557 from Goober5000/qtbug_72073
work around MSVC 2015 and 2017 compiler bug
2021-07-15 00:03:51 -04:00
Goober5000 1fa270ad66 work around MSVC 2015 and 2017 compiler bug
This macro bypasses a compiler bug where MSVC can't distinguish the division symbol.  See https://bugreports.qt.io/browse/QTBUG-72073
2021-07-14 20:13:11 -04:00
Baezon 5b316a562d clarifying comments 2021-07-14 00:22:46 -04:00
Baezon 9c14717b81 use macro version of true/false return 2021-07-14 00:14:08 -04:00
Baezon 0b8bbb3f47 add set volume for audio streams 2021-07-13 15:29:07 -04:00
Goober5000 314833ae61 Merge pull request #3554 from Goober5000/fred_turret_info
FRED turret info
2021-07-11 21:39:46 -04:00
Goober5000 4a4d07872a Merge pull request #3553 from Goober5000/loop_mission_tweak
fix campaign loop in certain cases
2021-07-11 16:10:39 -04:00
Goober5000 fdc33d8ab5 some fixes 2021-07-11 03:52:01 -04:00
Goober5000 c0430f0b55 add menu option to display info for all turrets 2021-07-11 03:42:24 -04:00
Goober5000 0d2d94a49b display weapons along with turrets 2021-07-11 03:33:43 -04:00
Goober5000 4f46fff48c fix campaign loop in certain cases
If the loop mission and the next mission are the same, then don't show the campaign loop screen.  This prevents the campaign from getting into a campaign loop state if it shouldn't, and also allows campaign loops to be conditionally accessible.
2021-07-11 00:49:09 -04:00
Goober5000 1b1d864c59 Merge pull request #3552 from Baezon/fix-secondary-range-check
Fix a secondary range bug from AI multilock
2021-07-09 15:21:32 -04:00
Baezon f1ddfafdf3 fix a bug from ai multilock 2021-07-09 01:55:35 -04:00
Baezon 3481032ae5 add num_firepoints_burst_shots flag 2021-07-08 17:08:56 -04:00
Asteroth 3a4e5d75a3 move the event flag reset to the top of the function to avoid restting anything we just applied (#3551) 2021-07-07 03:44:17 +00:00
PhantomHoover 84b25b52d7 Be smarter about when we try to run scripting hooks: don't even bother trying if no scripts are even registered to run on them. (#3538) 2021-07-02 22:50:53 -04:00
the-maddin ae9b604f44 Merge branch 'master' into qt-campaign-editor 2021-06-29 23:31:08 +02:00
the-maddin 8db39a6c61 WIP note
(cherry picked from commit fdd2b54af8c4a9ca7f1370dfba09f277a78edc3c)
2021-06-29 23:27:58 +02:00
the-maddin ec84c7183e comboBox tweak
(cherry picked from commit cf0232f33f20b27ffa03ff2ee4ed6590822f149c)
2021-06-29 23:27:54 +02:00
Taylor Richards f2d3aaaf20 Merge pull request #3544 from notimaginative/fix_gtrack_packet_size
bump tracker packet sizes to match server
2021-06-29 00:57:24 -04:00
the-maddin 16a5b1ccc7 Improve mission list robustness 2021-06-29 01:14:11 +02:00
the-maddin 856726d000 pick pulled model changes 2021-06-29 01:14:07 +02:00
the-maddin dd2c5a22a4 Comboboxes for loop brief & anim
also cmbBox cleanup
2021-06-29 01:12:35 +02:00
the-maddin b97129da86 Cleanup mission list loading, drop mission object 2021-06-29 01:10:56 +02:00
the-maddin a7badba0d8 cleanup 2021-06-29 01:10:52 +02:00
the-maddin 93a1f3e6b4 Use finer UI update control instead of modelChanged 2021-06-29 01:10:29 +02:00
the-maddin b19399021d load and display loop data 2021-06-29 01:08:38 +02:00
JohnAFernandez ffbcdab9da Remove Buggy Function and Let Debris End Naturally (#3540)
* Remove Buggy Function and Let Debris end natrually

Removes this retail function that was actually perpetually postponing the death of debris at long distances instead of removing them.  Debris lifetime is suitably short for the small, non-hull pieces (only a few seconds), while large pieces are supposed to be permanent.   It also culls based on player position, which is not the correct approach, since the camera can be free from the player ship.

* Remove Vestigial Variables

These variables are no longer checked for anything now that we allow debris to go through its lifetime.
2021-06-28 08:11:10 -04:00
Goober5000 8db2f374f2 Merge pull request #3545 from Goober5000/fix_3539
fix 3539
2021-06-28 00:58:48 -04:00
Goober5000 46959276f5 fix 3539
If a bad token is found in a string list, just advance the parser until the next token or EOLN.
2021-06-27 21:24:44 -04:00
Taylor Richards d5afd8d79b bump tracker packet sizes to match server
- allow for size of IPv6 game list packet (fixes #3543)

These larger packet sizes aren't required for
FS2/FS2_Open, but just keeps the code in sync.
2021-06-27 13:43:19 -04:00
Goober5000 2a8064a3e9 Merge pull request #3536 from Goober5000/lua_sexp_help
allow characters in SEXP help
2021-06-26 17:41:01 -04:00
Goober5000 9741b36442 allow characters in SEXP help
Certain characters (especially the semicolon) couldn't be used in SEXP help.  By using the same character replacement as in briefings and messages, now they can.
2021-06-25 22:38:31 -04:00
PhantomHoover 0fe59e10ad Inline matrix multiplication ops for performance improvements (#3535) 2021-06-25 22:19:42 -04:00
Asteroth e287c575ce Merge pull request #3534 from Baezon/bugfix-initial-shield-strength
Initialize `n_quadrants` before setting shield strength
2021-06-25 14:24:01 -04:00
Asteroth b14a27cdff fix model point shield handling for mini target shields (#3531) 2021-06-25 00:44:39 -04:00
Baezon 63b0f0a373 bug fix initialize n_quadrants before setting shield strength 2021-06-24 18:44:25 -04:00
Asteroth c464a1cd4c Merge pull request #3532 from Baezon/bugfix-ai-multilock-no-dumbfire
Bugfix with ai multilock and no dumbfire
2021-06-24 18:28:50 -04:00
Asteroth 6889ee856f Merge pull request #3533 from Baezon/bugfix-shield-hit-delay
Initialize shield regen hit delay
2021-06-24 18:28:29 -04:00
Baezon 292f1547c4 initialize shield regen hit delay 2021-06-24 17:38:00 -04:00
PhantomHoover a687fe0aef Reimplement matrix3 multiplication based on a common overloaded operator (#3470) 2021-06-24 17:26:51 +00:00
Baezon 31fa21bbf1 bugfix ai multilock and no dumbfire 2021-06-24 01:29:11 -04:00
Asteroth be6a7f552a Merge pull request #3443 from Baezon/trails-optimize
Optimize trail rendering
2021-06-23 16:59:51 -04:00
Baezon 93da6616f7 Merge remote-tracking branch 'upstream/master' into trails-optimize 2021-06-23 16:04:13 -04:00
Asteroth 4aeaabf337 Merge pull request #3529 from Baezon/shield-regen-hit-delay
Add shield regen hit delay
2021-06-23 16:02:15 -04:00
Asteroth 589071ac46 Merge pull request #3183 from Baezon/ai-multilock
Add AI support for multilock
2021-06-23 02:15:07 -04:00
wookieejedi ccf0e7eb04 Merge pull request #3510 from wookieejedi/add-extra-script-sound-enums
Add More Options to Scripted Persistent Sounds
2021-06-22 18:37:20 -04:00
Baezon adb7d9d195 review tweaks 2021-06-22 16:46:13 -04:00
BMagnu 7a2a4b6640 Merge pull request #3526 from BMagnu/luasexp_subcat_fix
Allow non-unique sexp subcategories
2021-06-22 22:52:10 +09:00
Goober5000 e4f9ca05c5 clang 2021-06-22 02:05:26 -04:00
Taylor Richards 0160fac2ff Refactor hud escort list to be less crazy (#2922)
* refactor hud escort list to be less crazy

 - don't keep rebuilding list
 - add and remove ships more efficiently
 - better handling of player ships in multi (fixes #1674)

* fix sorting issues

 - incomplete priority sort
 - reversed alpha sort

* fix additional sorting issue

* improve safety check in list sort function

* add safety checks to hud_add_ship_to_escort()

this wasn't meant to be used outside of the module so
it was not really safe to use with sexps previously

* remove entries properly in hud_add_remove_ship_escort()
2021-06-22 01:34:06 -04:00
Goober5000 cc2d06d37c correctly handle non-looping sounds when they have finished playing 2021-06-22 01:24:39 -04:00
wookieejedi c5b29c62c6 incorporate feedback
More modifications are still needed though, so keeping in draft status
2021-06-22 00:11:28 -04:00
Baezon 8e2d93211c add shield regen hit delay 2021-06-21 21:01:51 -04:00
Joshua Glatt eca6647dbf Fix leaking of game objects and memory in F3 lab (#3512) 2021-06-21 17:12:51 -07:00
Goober5000 b6e214a4d4 Merge pull request #3528 from Goober5000/language_sexp
add is-language
2021-06-21 15:57:03 -04:00
Goober5000 841a4b8cea add is-language
Checks whether the game is running in the specified language.  Since the fiction viewer doesn't use XSTR-style localization, this SEXP can be used to display different stages for different languages.
2021-06-21 15:00:28 -04:00
m!m 19bc18cb32 Merge pull request #3525 from asarium/build/ccacheTest
Use ccache to speed up some PR builds
2021-06-21 17:50:49 +02:00
Goober5000 823c76ec22 Merge pull request #3064 from z64555/feature/time_to_goal
Feature/time to goal
2021-06-21 11:48:05 -04:00
Goober5000 a75ad91518 Merge pull request #3469 from Goober5000/external_submodel_offset
Add external weapon model angle offset
2021-06-21 11:17:00 -04:00
Birk Magnussen bdefb55ec9 Allow non-unique sexp subcategories 2021-06-21 15:16:17 +09:00
Baezon 00f7f13371 Merge remote-tracking branch 'upstream/master' into ballistic-beams 2021-06-20 22:09:16 -04:00
Baezon 1441cc8e85 review tweaks for ballistic beams 2021-06-20 21:50:11 -04:00
Goober5000 a8a9127d81 Merge pull request #3504 from Goober5000/tstring_check_fix
maintain a copy of the default translations to check against untranslated strings
2021-06-20 21:25:32 -04:00
Joshua Glatt 028168d395 Add in-game options menu options for lightshafts and bloom (#3501)
* Add in-game options menu options for lightshafts and bloom

* move impl of new PostProcessingManager functions to .cpp file
2021-06-20 21:04:34 -04:00
Taylor Richards 7dae8940d7 support opening of web urls on PXO screens (#3485)
* support opening of web urls on PXO screens

(copied out of icculus.org version)

* add delay before allowing more clicks on links

* fix clang-tidy issues
2021-06-20 20:58:55 -04:00
Asteroth 814d44c986 Add weapon optimum range for AI fighters (#3457)
* add weapon optimum range

* review tweaks
2021-06-20 20:52:02 -04:00
Asteroth 99fb2c00ab fix shooter scaling offsets (#3521) 2021-06-20 18:30:09 -04:00
m!m f7c3ab85d3 Merge pull request #3524 from asarium/build/removeDeprecatedCMakeStuff
Remove usage of deprecated CMake module
2021-06-20 18:27:14 +02:00
asarium d03a1007df Use ccache to speed up some PR builds
This sets up ccache to speed up some builds. I hope this also works with
forks since I don't know if those are allowed to use the main repo
cache.
2021-06-20 14:24:11 +02:00
asarium b6fe676072 Remove usage of deprecated CMake module
Also removed all checks for C++11 support since we only support
compilers that have this already.
2021-06-20 12:56:20 +02:00
the-maddin c95fe1c9d1 clang
(cherry picked from commit 488dcdb1cc762d51826409df6d239fbad978a1e6)
2021-06-20 12:54:51 +02:00
Goober5000 07f4f4716b handle clang 2021-06-20 02:47:19 -04:00
Asteroth 30e48c1b03 Merge pull request #3511 from Baezon/beam-attenuation-bugfix
Bugfix for beam attenuation damage
2021-06-20 02:31:48 -04:00
Asteroth 352fd3cdfc Merge pull request #3514 from Baezon/negative-hull-repair-kill
Properly handle death due to negative hull repair rate
2021-06-20 02:31:38 -04:00
Goober5000 1becca7cbe accommodate mismatches 2021-06-20 00:45:39 -04:00
Goober5000 07312ff4c0 add code for actually rotating the external models 2021-06-20 00:45:38 -04:00
Goober5000 f9c73e81f2 add code for loading external model angle offset from POF file 2021-06-20 00:45:34 -04:00
Goober5000 e2585a9a0e change secondary_point_reload_pct to be dynamic and to not rely on MAX_SLOTS 2021-06-19 23:23:53 -04:00
Goober5000 d6c65d5139 Merge pull request #3489 from Goober5000/POF_version_adjustment
add some more sophisticated POF version handling
2021-06-19 23:14:00 -04:00
Goober5000 c3551f4361 Merge pull request #3520 from Baezon/downgrade-parse-severity
Restore original error handling of stuff_int_list
2021-06-19 21:43:32 -04:00
Goober5000 d787bd7c6f Merge pull request #3522 from EatThePath/fix-hook-conditions-i-broke
Moved script initialization to take place after all table loads
2021-06-19 21:42:47 -04:00
the-maddin f405496791 Clang-tidy fixes 2021-06-20 01:21:32 +02:00
the-maddin 33b63e5b6c Implement FRED-Mission button 2021-06-20 00:56:10 +02:00
the-maddin b64bd789b6 Some more clang fixes 2021-06-20 00:56:10 +02:00
the-maddin 9011319e2f Use new CheckedDataListModel 2021-06-20 00:56:10 +02:00
the-maddin 3fd825b1de SaveAs shortcut 2021-06-20 00:56:10 +02:00
the-maddin b21d380240 Handle branch tree selection 2021-06-20 00:56:10 +02:00
the-maddin c2e8ba9fa6 Use campaign branch sexp_tree and load formulas 2021-06-20 00:56:10 +02:00
the-maddin 61fb9c5dd1 CMission Data: use combo boxes where possible 2021-06-20 00:56:10 +02:00
the-maddin f7ecb85df6 CampaignMissionData: load cmission, display
editable cmission data

Also make CheckedDataList construction translator
callbacks explicitly const.
2021-06-20 00:56:10 +02:00
the-maddin 144ae46ccc model initialisation cleanup 2021-06-20 00:56:10 +02:00
the-maddin 1a81682472 Show player number of multi campaigns
according to first mission.
2021-06-20 00:56:10 +02:00
the-maddin 3349c99a0a Clean up data entry widget signalling 2021-06-20 00:56:10 +02:00
the-maddin 6e2723a313 Update widgets on mission selection change 2021-06-20 00:56:10 +02:00
the-maddin 9241c49f32 Warn before dropping unloadable missionDropped
because it won't be shown for re-selection after
next load of campaign
2021-06-20 00:56:10 +02:00
the-maddin 80fc7a5cbf gcc11: add missing include
(cherry picked from commit 9959cdad5535abf56a156f1924d260a64e688d57)
2021-06-20 00:56:10 +02:00
the-maddin ca982fa1ae Immutable campaignType, file load & menu changes
Since the campaign type determines the compatible
missions, changing it would require invalidating
the mission list. So I'm restricting it to being
set on campaign creation.
2021-06-20 00:56:10 +02:00
the-maddin 20fc9d629c Create available mission list
Unlike FRED, I'm using a checked list of all
missions, not a simple list of the unused ones.
I'm showing uneditable / packaged missions
in yellow, missing / unloadable missions in red.
Also keeping missions loaded.
2021-06-20 00:56:10 +02:00
the-maddin 881f47670c Use CheckedDataListModel improvements
Make necessary changes and improvements
in model usage.
2021-06-20 00:56:10 +02:00
the-maddin 54a64cb91e Deal with windows filenames in CFile
(cherry picked from commit 0ed5a18fd9883166bbef8360ae9f2cfed3ae7f69)
2021-06-20 00:56:10 +02:00
the-maddin 232eb2a099 Allow full-length paths for campaign files
so qtfred can load them fro outside the cfile tree.
2021-06-20 00:56:10 +02:00
Baezon 7dd454f563 review changes 2021-06-19 18:39:35 -04:00
Goober5000 f1deee8566 Merge pull request #3354 from Goober5000/gs_state_invalid
actually use GS_STATE_INVALID
2021-06-19 17:49:38 -04:00
David Gibson b24289e918 Moved script initialization to take place after all table loading to facilitate script condition caching. 2021-06-19 12:34:16 -05:00
Baezon 94b1d11f47 restore original error handling of sutff_int_list 2021-06-19 02:58:20 -04:00
Goober5000 c541ac91db Merge pull request #3513 from the-maddin/qt-checked-list-3
Rewrite of CheckedDataListModel
2021-06-19 00:37:40 -04:00
the-maddin eb6f7fb013 Fix some clang stuff 2021-06-18 23:10:56 +02:00
Baezon d2c24efeff properly handle death due to negative hull repair rate 2021-06-18 16:50:55 -04:00
Goober5000 318fed546f Merge pull request #3509 from BMagnu/briefing_shadows
Add shadow map generation for briefing
2021-06-18 15:54:29 -04:00
the-maddin 474f225672 be explicit for msvc
(cherry picked from commit 97e2028337265a5529d0b0a5fb76bb52e1a4ab37)
2021-06-18 20:33:34 +02:00
the-maddin 14337c22b0 Rewrite CheckedDataListModel
for better flexibility & efficiency
2021-06-18 20:21:28 +02:00
Baezon 647334f4ff redundant fwd declaration 2021-06-17 18:39:46 -04:00
wookieejedi 03d51ba400 appease clangtidy 2021-06-17 17:23:01 -04:00
Baezon 3767758ae5 bugfix beam attenuation damage 2021-06-17 17:10:35 -04:00
wookieejedi def814fa4e fix typo 2021-06-17 17:01:53 -04:00
wookieejedi 11c5af39d8 Add More Options to Scripted Persistent Sounds
This adds two new enums to persistent sounds which can be utilized by scripts.
1. OS_PLAY_ON_PLAYER, which allows persistent sounds to play on the player's ship.
2. OS_LOOPING_DISABLED, which allows the scripter to set the sound to play once and not have to then call `removeSound` later. Very handy for playing an assigned sound once with one line.

Tested and everything works as expected.
2021-06-17 16:58:25 -04:00
Birk Magnussen c6b75d3561 Add forgotten Animation Instancing 2021-06-18 04:09:03 +09:00
Goober5000 866a7c40df Merge pull request #3497 from JohnAFernandez/fix-pause-locking
fix missiles locking during pause
2021-06-17 14:58:48 -04:00
Goober5000 5076066627 Merge pull request #3508 from Goober5000/enum_bitops
add bitwise operations with enums
2021-06-17 14:53:37 -04:00
Goober5000 70546b68a5 add bitwise operations with enums
This adds `EnumAND` and `EnumOR` which will return new enums based on the specified operations.  These are handy for enums that correspond to bit fields, such as those used for object persistent sounds.
2021-06-17 14:17:16 -04:00
Baezon a6084ba707 change from radians to degrees 2021-06-17 14:04:47 -04:00
Baezon 27650ef45d proper poof toggling support 2021-06-17 13:15:07 -04:00
Birk Magnussen 4f5fb48f79 Add shadow map generation for briefing 2021-06-17 14:45:54 +09:00
Goober5000 c1d2920526 Merge pull request #3506 from Goober5000/enhance_bitops
some bitwise operation enhancements
2021-06-16 12:17:38 -04:00
Baezon 90558a5858 Merge branch 'master' into poof-overhaul 2021-06-16 03:26:58 -04:00
Birk Magnussen 390f979b7c Small parse improvement + english fixes 2021-06-16 13:51:55 +09:00
wookieejedi 7258861791 Merge pull request #3505 from wookieejedi/add-save-as-shortcut
Add Keyboard Shortcut for `Save As` in FRED
2021-06-15 20:15:22 -04:00
Goober5000 76b944e01d fix tests 2021-06-15 19:53:28 -04:00
Goober5000 8006baec65 Merge pull request #3498 from JohnAFernandez/fix-scripts-crashing-with-bad-mission-data-when-pressing-esc
Add Menu and Mission resetting to scripting state.
2021-06-15 18:15:01 -04:00
Goober5000 443e148869 some bitwise operation enhancements
Allow AND and OR to take up to 10 arguments.  Deprecate addBit and replace with setBit, and add unsetBit.
2021-06-15 17:56:49 -04:00
wookieejedi f9265301af Add Keyboard Shortcut for Save As in FRED
Finally got around to adding in the `Ctrl+Shit+S` shortcut for Save As in FRED. Tested and works as expected.
2021-06-15 16:03:02 -04:00
Birk Magnussen bd6dae97a7 Fixed Code for GCC and C++11 2021-06-16 02:10:30 +09:00
JohnAFernandez 74c6b0c3cb Add escape character for < and > in html output (#3499) 2021-06-15 12:51:40 -04:00
Goober5000 3685a78ea9 make clang happy, and fix a bug in the English handling 2021-06-15 12:40:41 -04:00
Birk Magnussen d0948e67e3 Tidy up some new code into separate functions 2021-06-15 13:27:08 +09:00
JohnAFernandez 3660761d7c Add Menu and Mission resetting to scripting state. 2021-06-14 23:16:10 -04:00
JohnAFernandez e6579fca09 fix missiles locking during pause 2021-06-14 22:37:32 -04:00
Goober5000 da0459feeb Merge pull request #3494 from Baezon/adjust-waypoint-turnrate
Bugfix for waypoint turnrate
2021-06-14 15:07:25 -04:00
Goober5000 b428899d5b Merge pull request #3496 from Goober5000/ui_cutscene
add a scripting function for playing cutscenes in the UI
2021-06-14 14:25:31 -04:00
Goober5000 00ec3431b7 add a scripting function for playing cutscenes in the UI
Implements `common_maybe_play_cutscene` as a scripting function.  Partial fix for #3367.
2021-06-14 13:48:31 -04:00
Goober5000 353d66c17d maintain a copy of the default translations to check against untranslated strings
Bug #3471 occurs because the game only keeps a translation table for the current language.  Since the mission list needs to compare untranslated strings against English strings, this adds a duplicate table for English.  However, it only keeps strings that are NAME_LENGTH or less, because the comparison only needs to be run against mission names.ssss

Fixes #3471.
2021-06-14 02:43:28 -04:00
Goober5000 84ceae724c Merge pull request #3493 from Goober5000/objsnd_bugfix
fix to #3476
2021-06-13 19:27:36 -04:00
Joshua Glatt c47518ec6e karajorma's SEXP containers, Part 3: 'Add/Modify Container' FRED dialog (#3463) 2021-06-13 15:16:27 -07:00
Baezon 76c9583e45 bugfix for waypoint turnrate 2021-06-13 16:33:57 -04:00
Goober5000 131fadfab3 fix to #3476
The default sound position should be the zero-vector, not nullptr.  Also, this adds a bit of extra type safety.
2021-06-13 15:35:44 -04:00
Goober5000 74233c029c Merge pull request #3487 from Goober5000/move_engine_sound
center the persistent sound by default
2021-06-13 00:18:47 -04:00
Goober5000 c1d8834d81 make clang happy 2021-06-11 18:46:03 -04:00
Goober5000 7b69c10e56 add some more sophisticated POF version handling
This adds additional version definitions so that features can be added which support both the aligned and non-aligned POF formats.
2021-06-11 17:53:56 -04:00
Goober5000 c0bb5bc8eb Merge pull request #3326 from Shivansps/arm_fixes_v2
POF 2118 and SLC2 support
2021-06-11 17:43:28 -04:00
m!m 2e56b3ca61 Merge pull request #3382 from asarium/build/readdClang9
Fix missing clang-9 binary in build image
2021-06-11 21:51:12 +02:00
asarium 3c3f79bc8f Fix missing clang-9 binary in build image 2021-06-11 20:54:09 +02:00
Goober5000 462a234e81 Merge pull request #3488 from Goober5000/model_version_warning
add warning for supported POF file versions
2021-06-11 11:33:26 -04:00
Goober5000 eaf14760c4 add warning for supported POF file versions
With several upcoming POF format enhancements (byte alignment, external weapon rotation, submodel translation) it makes sense to warn users if they happen to load an unsupported POF file.
2021-06-11 10:40:21 -04:00
Birk Magnussen a9e5505a7c Added Comments, light refactoring 2021-06-11 13:39:55 +09:00
Asteroth 1525b520d7 Merge pull request #3483 from Baezon/better-damage-type-handling
Improve damage type handling when dealing damage
2021-06-10 18:53:39 -04:00
Goober5000 1843f76d04 center the persistent sound by default
The assumed location of a ship's "EngineSnd" is at its rearmost extent, which is fine for ships with engines, but not suitable for stationary objects such as space stations and comm nodes.  If the ship doesn't have an "engine" subsystem, place the persistent sound in the center.
2021-06-10 18:44:46 -04:00
Goober5000 41cf0b3d52 Merge pull request #3486 from Goober5000/3476_followup
small followup fix for #3476
2021-06-10 17:11:33 -04:00
Goober5000 990b5a3908 small followup fix for #3476
Missed changing the argument type when I changed from int to enum.
2021-06-10 16:38:41 -04:00
Asteroth e4661b00b1 Add Type 5 beams (#2817)
* wip

* basics are working

* turret case is handled

* better fighter beam handling

* missing commit?

* handle missile spawn

* clean up, commenting and ssb handling

* random in sphere and per burst rot counts for "share random" flag

* clean up, clarity and comments

* accidental whitespace changes

* bugfix

* NULL -> nullptr

* more efficiency/clarity

* review tweaks and bugfixes
2021-06-09 18:53:53 -04:00
Baezon 4457471ec5 Merge remote-tracking branch 'upstream/master' into better-damage-type-handling 2021-06-09 17:24:11 -04:00
Goober5000 128107ea43 Merge pull request #3476 from Goober5000/script_obj_sound
add scripting functions to control sounds assigned to objects
2021-06-09 16:00:53 -04:00
Asteroth c840d3e032 Add No_shield_damage_from_ship_collisions flag (#3480)
* add All_ships_take_hull_damage_from_collisions flag

* rename flag and apply flag to debris and asteroid hits
2021-06-09 15:49:35 -04:00
Goober5000 35a09527e5 another #include 2021-06-09 11:52:00 -04:00
Goober5000 20e5f35fb4 include definitions 2021-06-09 11:16:17 -04:00
Goober5000 d217873281 update flags with enums 2021-06-09 10:44:40 -04:00
Baezon 37c5041c03 improve damage type handling when dealing damage 2021-06-09 03:30:52 -04:00
Birk Magnussen fb657c081c Turret fix 2021-06-09 16:04:59 +09:00
Birk Magnussen 7945baa751 Fix turret detection 2021-06-09 15:56:28 +09:00
Birk Magnussen e9a2ff0ebf Fix proper duration handling of segments and full anims 2021-06-09 15:03:46 +09:00
Asteroth 4328b66a28 fix offset initialization (#3468) 2021-06-09 01:38:09 -04:00
Asteroth 11c5bcda74 Merge pull request #3479 from Baezon/improve-particle-alpha
Improve particle alpha handling for small particles
2021-06-08 18:21:52 -04:00
MageKing17 43f9a48cb9 Get a pointer to the generic_anim.
Whoops.
2021-06-08 13:30:21 -07:00
MageKing17 c6e79a61ea Add current_frame safety check to main_hall_mouse_release_region().
There's a similar safety check for opening doors, so we should check here as well.
2021-06-08 12:28:59 -07:00
MageKing17 5d58d9ca7a Reset APNG misc animations properly (fixes #3399).
Changes the `current_frame` checks in generic.cpp so that the last frame can actually be reached (allows the mainhall code to tell the misc animation has finished), and adds a `generic_anim_reset()` function that gets called instead of manually setting `current_frame` and `anim_time` to 0. This should fix #3399.
2021-06-08 12:27:15 -07:00
Birk Magnussen 384b2e20c7 Integrate Initial Type animations 2021-06-08 21:28:15 +09:00
Birk Magnussen 20e742ed61 Generate Animations for initial-type animations 2021-06-08 14:45:35 +09:00
Baezon 29846e2101 make particle alpha distance fade be based in part on radius 2021-06-07 20:50:12 -04:00
Goober5000 a1635cdd76 Merge pull request #3301 from Baezon/beam-substitution
Implement substitution for beams
2021-06-07 11:59:34 -04:00
Goober5000 c80144ce44 Merge pull request #3473 from jg18/sexp-container-1-fixes
A few small fixes to SEXP container definition
2021-06-07 11:23:16 -04:00
Fabian Woltermann 6e11f356ea Merge pull request #3477 from Baezon/fix-accel-weapon-cull
Fix collision culling for accelerating weapons... again
2021-06-07 14:58:14 +02:00
Joshua Glatt 7e4190b97e add any() and none() for ContainerType 2021-06-06 19:41:14 -07:00
Goober5000 65e65b01b6 Merge pull request #3478 from Goober5000/fix_subsystem_stricmp
fix bug in subsystem_stricmp
2021-06-06 14:42:17 -04:00
Joshua Glatt f3773388b9 make ContainerType's '&' overload return ContainerType instead of bool 2021-06-06 11:35:54 -07:00
Goober5000 b05132a64f fix bug in subsystem_stricmp
Here's a bug that's been around ever since version 3.6.  If the subsystem names were not essentially the same, the function wouldn't do the expected string comparison.
2021-06-06 13:59:51 -04:00
Baezon 6c399ccace fix accelerating weapons culling 2021-06-06 12:23:02 -04:00
Goober5000 373a8b940a add scripting functions to assign and remove sounds on objects 2021-06-05 20:03:35 -04:00
Joshua Glatt b4d0db8846 finish implementing bitwise operations for ContainerType 2021-06-05 16:42:55 -07:00
Goober5000 9c0575f173 Merge pull request #3060 from EatThePath/range-aware-secondary-selection
Range aware secondary selection
2021-06-05 19:23:12 -04:00
Goober5000 64f5ad925b Merge pull request #3466 from Baezon/weapon-no-collide
Add "no collide" for weapons
2021-06-05 19:22:52 -04:00
Goober5000 81b06fec41 Merge pull request #3475 from MageKing17/bugfix/superfluous-child-warning
Remove superfluous warning about missing "child" flag.
2021-06-05 19:22:46 -04:00
Goober5000 3c553665aa remove the 'main' argument from obj_snd_assign 2021-06-05 17:40:58 -04:00
MageKing17 f252473b84 Remove superfluous warning about missing "child" flag.
If a weapon has "inherit parent target" but not "child", a Warning will be generated. However, there is no dependency between the two flags; the weapon will function as the modder presumably expects. The Warning even seems to indicate this, by saying "No changes in behavior will occur" (as opposed to other similar warnings, which generally indicate that a flag will be ignored). Since the situation being warned about does not actually cause any issues, the Warning is entirely superfluous. As such, I've removed it outright.
2021-06-05 13:05:40 -07:00
Goober5000 1caf54e909 Merge pull request #3472 from Goober5000/deprecate_script_eval
deprecate script-eval
2021-06-04 21:44:27 -04:00
Birk Magnussen 6aecc4660d Add forced caching of submodelID 2021-06-04 15:52:08 +09:00
Birk Magnussen c915bfd474 Appropriate refactoring of ModelAnimationSubSYSTEM -> model 2021-06-04 15:48:05 +09:00
Birk Magnussen bd2356600f Actually use new constructor 2021-06-04 15:42:31 +09:00
Birk Magnussen 9c6cc422ac Improve Code. Operate on Submodels, not subsystems. 2021-06-04 15:36:32 +09:00
Joshua Glatt 7bd74b2a7b A few small fixes to SEXP container definition 2021-06-03 21:45:16 -07:00
Asteroth 9d5eeb6e08 Merge pull request #3461 from Baezon/random-homing-target-acquisition
Add random homing target acquisition
2021-06-03 20:10:21 -04:00
Goober5000 5ffc05fa85 deprecate script-eval
The script-eval SEXP evaluates all arguments as individual script commands, which is not ideal because most FREDders expect the arguments to be concatenated.  Since the script-eval-block SEXP handles its arguments this way, it makes sense to hide the script-eval SEXP in FRED to prevent confusion.
2021-06-03 19:07:28 -04:00
MageKing17 8ae77e0356 Fix calling split_str() with a maximum line length of 0. (#3465)
Commit 6c2ebab01c (#3439) added a `max_line_length` argument to `split_str()`, but one call had the extra argument added in the wrong spot, and so a previously-pointless-but-harmless `ignored_char` of 0 became a `max_line_length` of 0, resulting (ultimately) in an exception in the unicode code when the iterator tried to decrement at the beginning of a ship's description. This gets rid of the argument entirely, rather than reordering them, because ignoring null characters doesn't really do anything anyway.

I've also added `Assertion`s to check `max_line_length` that should prevent this specific problem from occurring again in the future.
2021-06-03 15:30:34 -04:00
Birk Magnussen a113897c88 Fix some startup logic 2021-06-03 16:51:57 +09:00
Birk Magnussen 4ee04f2492 Fix oversight for ModelAnimationSubsystem 2021-06-03 16:51:56 +09:00
Birk Magnussen 093a471602 Beginnings of new System 2021-06-03 16:51:48 +09:00
Asteroth 22be402de5 remove glowpoint 'depth' (#3455) 2021-06-02 12:54:10 -04:00
Asteroth 84133c42a8 fix ai_aims_from_center flag (#3467) 2021-06-02 12:53:45 -04:00
Joshua Glatt df1c518c3b Validate user-provided values passed to Random::next() (#3464)
* Validate user-provided values passed to Random::next()

* return low value on invalid range

* call LuaError() instead of Warning() in rand32() script function
2021-06-02 12:52:30 -04:00
Asteroth 8ac4c54d43 actually limit based on player like the comment says (#3460) 2021-06-01 22:23:14 -04:00
Asteroth 1445e778f0 Add volume effects (#3446) 2021-06-01 22:20:42 -04:00
Asteroth 2b6041f766 uncouple launch sound from loop sound (#3450) 2021-06-01 22:19:30 -04:00
Baezon 59d30157d8 add no collide for weapons 2021-05-31 22:50:00 -04:00
Joshua Glatt 552201884b karajorma's SEXP containers, Part 1: Definition, parsing, and saving (#3449) 2021-05-31 09:15:48 -07:00
Baezon e053d06a5f add random homing target acquisition 2021-05-30 22:24:24 -04:00
David Gibson f677767846 added safety check assert as requested. 2021-05-30 19:32:23 -05:00
David Gibson 9b35a4e653 Nullpointer and variable name fixes for range aware selection, and moved default weapon max range into a define. 2021-05-30 19:32:23 -05:00
David Gibson 6c0bfd4df5 Tied range aware secondary selection to an aiprofiles flag 2021-05-30 18:58:46 -05:00
David Gibson 102bc28424 Added functionality to get_available_secondary_weapons to screen weapons by range. Controlling flag to be added. 2021-05-30 18:58:46 -05:00
David Gibson 081e34815c corrected misleading comment on get_subsystem_pos 2021-05-30 18:58:46 -05:00
Baezon 6cf5553147 review tweaks 2021-05-30 16:55:50 -04:00
Asteroth 80f4f1abde add weapon ambient sound (#3452) 2021-05-30 16:02:24 -04:00
Taylor Richards 2e30674823 Merge pull request #3386 from notimaginative/add_firewall_status
add firewall status
2021-05-30 10:15:43 -04:00
ngld 448d0457c8 Merge pull request #3454 from ngld/feat/betterPofParserErrors 2021-05-30 01:31:19 +02:00
JohnAFernandez 9d7acbcc9d Update Function Name and comment to describe what it actually is (#3451)
Change find_player_id to find_player_index, since that is what it does
2021-05-29 19:21:36 -04:00
ngld c8cee4cdb1 Provide better error messages for invalid vec3ds in POF files. 2021-05-30 00:21:09 +02:00
the-maddin 21aa608eb6 whitespace cleanup (#3453)
replace spaces with tabs to fix
-Wmisleading-indentation
2021-05-29 21:59:44 +00:00
Goober5000 d6a0d9fb02 Merge pull request #3447 from the-maddin/qt-checked-list-2
qtFred: improvements to my checked list
2021-05-28 22:55:56 -04:00
Asteroth edcdbd02b6 fix bug where shields could be pierced (#3448) 2021-05-28 11:10:18 -04:00
Asteroth d49e24fa0c Add healing weapons (#2873)
* basic proof of concept: healing weapons

* implement healing weapons

* remove unused parameter

* travis

* more travis

* endless travis

* earlier multi client return

* update find_submodel_instance_world_point

* review tweaks
2021-05-25 23:03:20 -04:00
the-maddin e74ebe6b84 fix type warning 2021-05-26 00:56:54 +02:00
the-maddin c197755c0e Improve CheckedDataListModel
Add text coloring support
Add contains/add functions
Row construction efficiency fixes
Whitespace cleanup
2021-05-26 00:06:41 +02:00
Goober5000 ec4de81a79 Merge pull request #3370 from Goober5000/hud_gauge_parameter_type
Hud gauge parameter type
2021-05-24 17:58:05 -04:00
Asteroth c10d6ececf optimize motion debris rendering (#3444) 2021-05-24 17:42:16 -04:00
BMagnu 6c2ebab01c Fix erroneous line break generation for non-ASCII string and high resolutions (#3439)
* Added a byte limit for line length in split function

* Fix call error

* Ádd missing limits import

* Change hardcoded values into defines

* Cleanup default argument
2021-05-24 17:38:58 -04:00
JohnAFernandez 9a682ea32f Fix ai update danger weapon and Add guardrails for other checks (#3387)
* Make sure incoming index is valid.

* Some Extra Guardrails

* One more guardrail

* Fix Typos

Nonsense not nonesense
2021-05-24 21:30:41 +00:00
Goober5000 a5f501b58a Merge pull request #3350 from Baezon/fog-setup-fixes
Some fixes to nebula fog set up
2021-05-24 16:07:11 -04:00
Asteroth 5f8cdb37bd 'const vel' is the important quality here, not 'laser' (#3442) 2021-05-22 22:48:56 -04:00
JohnAFernandez f998215b07 Fix AI targeting itself during EMP (#3431)
To keep the AI code from going crazy, we should keep the AI from targeting itself during/after EMP
2021-05-22 22:37:36 -04:00
Baezon 106b16d5eb initialize variables 2021-05-22 21:17:23 -04:00
Asteroth 61faa3fa9a improve numerical pecision (#3440) 2021-05-21 23:36:17 -04:00
Baezon 3a960db633 optimize trail drawing 2021-05-21 18:23:35 -04:00
Baezon b89d395578 unused variable 2021-05-21 17:23:38 -04:00
Baezon f33b42085e add support for ballistic beams 2021-05-21 14:57:23 -04:00
BMagnu 87f449415f Self-Shadow on 3D-Cockpits (#3437)
* Improve wookieejedi's cockpit shadows

* Rename stray bool

* Make shadow's eye pos explicit

* Tidy up stub declaration

* Add configurable shadows + requests by m!m

* make variable lowercase
2021-05-21 08:15:20 +00:00
wookieejedi a59bb99fc6 Merge pull request #3435 from wookieejedi/expose-shadow-values
Expose Shadow Cascade Distances
2021-05-18 22:20:47 -04:00
wookieejedi ca6cc21be8 incorporate feedback/extra checks 2021-05-18 09:04:56 -04:00
the-maddin b52ab8bd4e gcc11: add missing include (#3434) 2021-05-18 01:27:31 -04:00
Asteroth a5a2f9e3df add extra check for nullptr (#3433) 2021-05-18 01:11:59 -04:00
wookieejedi 40840ee3f9 specify as float tuple 2021-05-17 17:56:48 -04:00
wookieejedi 76af0129f3 Expose Shadow Cascade Distances
The shadows distances were tuned/added by swifty with the following logic:
`// these cascade distances are a result of some arbitrary tuning to give a good balance of quality and banding.`

Mods, especially TCs, may have very different sized ships compared to FS, and as such desire more precise control over shadow cascade distances.

This PR exposes those values with settings in the `game_settings.tbl`.

PR is tested and works as expected.
2021-05-17 17:17:55 -04:00
Goober5000 f91d3dbe17 Merge pull request #3421 from Goober5000/fix_add_data_for_variables
fix add-data for variable names
2021-05-17 11:53:02 -04:00
Goober5000 5ad373502c Merge pull request #3428 from z64555/fix/issue_3427
Fix/issue 3427
2021-05-16 23:22:17 -04:00
Goober5000 37c9ecd0e3 fix add-data for variable names
This properly handles variable additions by calling the replace-variable code on the new variable node immediately after the variable is added.  It's a bolted-on hack but it's the simplest way to fix the issue.  A better fix would be to completely redesign the way the sexp tree handles variables (and everything, really) but that would be a major undertaking.

Fixes #3298.
2021-05-16 23:15:19 -04:00
Tyler Blount b92cbaff64 Merge pull request #3432 from the-maddin/qtfred-win-fixes
Qtfred win fixes
2021-05-16 18:12:31 -06:00
the-maddin ed69a1584b qtfred/win32: Later SCP_mspdbcs_Cleanup (fix crash on shutdown) 2021-05-16 18:25:57 +02:00
the-maddin 789243ea06 qtfred: Replace '/' with platform specific
separator
2021-05-16 18:25:57 +02:00
Fabian Woltermann 2701b557b8 Merge pull request #3426 from The-E/feature/disable_reflect_maps_in_lab
Add an option to switch off reflect maps in the lab
2021-05-14 11:35:11 +02:00
z64555 b4fe5c9cbe * Use temp vars for readibility.
* when using gr_printf_menu, Use format string and va_list instead of the buffer string directly
2021-05-13 16:55:02 -05:00
z64555 f1ee621624 Use menu resolution instead of screen width for positioning the "Conflict!" message. 2021-05-13 13:24:21 -05:00
z64555 bcf87e8a02 When overriding a key, the key should first load in the default binding so that legacy ccfg.tbl's can toggle a modifier (shift or alt) without corrupting the bind. 2021-05-13 13:10:04 -05:00
Fabian Woltermann 3d6fe919da Add a flag to the Lab's render settings to allow Reflect maps to be toggled on or off 2021-05-13 16:02:49 +02:00
Goober5000 2e272cce2d Merge pull request #3360 from EatThePath/stricmp-begone
Remove string comparisons and switch to vector in script conditions
2021-05-10 19:58:20 -04:00
Asteroth 309bfd7825 better beam index warning (#3376) 2021-05-10 18:17:15 -04:00
Goober5000 308794801c Merge pull request #3423 from Goober5000/xstr_id_buf_bump
bump the buffer holding the XSTR id
2021-05-08 17:42:00 -04:00
the-maddin 0b26662755 Qtfred runtime fixes (#3418)
* qtfred: fix crash on shutdown

run shutdown code sooner (lastWindowClosed) to
avoid deallocating invalid glsync

* qtfred: Fix blurry sky background and startup
warning

Only render when window surface is exposed, ensure
first correct frame is rendered asap.

* fix msvc warning

initialize variable

* Clarify comment
2021-05-08 21:31:08 +00:00
Goober5000 8fe55fa659 bump the buffer holding the XSTR id
Turns out some mods really do use XSTR ids higher than 9999.  This bumps the capacity from 4 digits to 7 digits.

Fixes #3422.
2021-05-08 16:35:56 -04:00
Goober5000 9f1e556031 Merge pull request #3420 from Goober5000/fix_3419
remove unneeded warning
2021-05-08 02:13:32 -04:00
Goober5000 d77554767d remove unneeded warning
As pointed out in #3419, subsystems can in fact have 0% maximum hull.

Fixes #3419.
2021-05-07 22:35:13 -04:00
Goober5000 52e2cda4a0 Merge pull request #3416 from Goober5000/fix_3413
use the proper range check
2021-05-05 22:31:36 -04:00
Goober5000 3a888906c5 use the proper range check
The ship index was being checked against the weapon limit.

Fixes #3413.
2021-05-05 21:34:42 -04:00
MageKing17 638a25ea0d Merge pull request #3415 from Goober5000/update_version
bump version to 21.3.x
2021-05-05 17:16:58 -07:00
Goober5000 6d60647a2a bump version to 21.3.x 2021-05-05 19:35:26 -04:00
the-maddin fc65df048f Register initial... lists changes 2021-05-06 00:48:37 +02:00
the-maddin f2cfac14b3 Fix compile issue, correct reload behaviour 2021-05-06 00:37:10 +02:00
the-maddin 5cbe64c793 Implement initial ships/weapons lists, intialize
model by loading campaign file
2021-05-06 00:03:15 +02:00
the-maddin e2b9a5a1a2 Initial campaign loading & trivial uiUpdate
functionality
2021-05-06 00:03:08 +02:00
the-maddin da83c3aa41 Tie campaignmodel to campaign file, use QStrings in
model

String conversion should happen on load/save, not
every UI update/cahnge
2021-05-06 00:02:58 +02:00
the-maddin 30237c8988 initial updateUI, explicit model modification
flagging
2021-05-06 00:02:56 +02:00
the-maddin ca23d30c99 File ops UI logic, cleanup 2021-05-06 00:02:43 +02:00
the-maddin 53e30ba771 Connect some more signals/slots 2021-05-06 00:00:46 +02:00
the-maddin c4f84ea9f5 alternative layout 2021-05-05 23:58:50 +02:00
the-maddin 7acd4c6491 sync changes to model (initial) 2021-05-05 23:58:50 +02:00
the-maddin 04c136f59e add model with initial functionality 2021-05-05 23:58:50 +02:00
the-maddin 3768473270 Add more slots 2021-05-05 23:58:50 +02:00
the-maddin 52427a7ec3 Add initial CampaignEditorDialog
ui with most basic functionality
2021-05-05 23:58:50 +02:00
Goober5000 cd2e69eb3b Merge pull request #3411 from the-maddin/qt-checked-list
QtFred: Model for ListView of checkboxes
2021-05-05 17:37:03 -04:00
Goober5000 e92ba1849b Merge pull request #3410 from the-maddin/qtfred-fix-warnings-05-21
Fix some qtfred warnings
2021-05-05 17:33:52 -04:00
Taylor Richards ce9a0d5e08 add new popup type to handle mission/table validation (#3380)
* add new popup type to handle mission/table validation

* fix error handling when popup gets canceled

* use bool and get rid of Int3()

* use proper Game_mode check to test for standalone
2021-05-05 00:53:57 -04:00
Asteroth d971f34ee2 make all asinf and acosf safe (#3384) 2021-05-05 00:53:24 -04:00
JohnAFernandezandAsteroth 47f6d2b368 Add guardrails to object cleanup during object creation (#3371)
* Prevent Crashes from Weapons being deleted during the collision process

This puts in some safety checks to keep FSO from crashing while doing collision detection when close to the object limit.

* Remove Problematic Assertions and INT3's

Keeps FSO from crashing when low on Object slots from failed weapon and beam creations.

* Simplify Code with a good suggestion

Co-authored-by: Asteroth <[email protected]>

Co-authored-by: Asteroth <[email protected]>
2021-05-05 00:52:11 -04:00
Joshua Glatt 144d484c85 Replace rand() calls with a Random class (#3332) 2021-05-04 18:26:06 -07:00
the-maddin 3c809a9bb5 Fix qtfred runtime warning
Initialize QApplication before call to
QCoreApplication::applicationDirPath as requested
in warning
2021-05-04 17:05:00 +02:00
the-maddin 1c1ee910fb Create model for ListView of Checkboxes
which contain additional undisplayed data. For
example the initialShips/initialWeapons lists,
which refer to the internal indices of player
ships/weapons.
2021-05-04 15:19:10 +02:00
the-maddin 6f2e707f5a Fix qtfred deprecations 2021-05-04 12:49:28 +02:00
the-maddin 3a427d923b Fix deprecation warning
(cherry picked from commit ffa0ac90b8769ba3ac6575fdc2aaad34b195e85e)
2021-05-04 12:48:53 +02:00
Goober5000 a663a7d916 Merge pull request #3408 from Goober5000/for_sexps_known_fix
tweak short-circuiting on the for-* sexps
2021-05-03 11:41:05 -04:00
Goober5000 42d96d967e Merge pull request #3397 from Goober5000/handle_weapon_none
handle weapon "None" properly
2021-05-03 11:40:54 -04:00
Goober5000 a3c5186635 add missing newlines in several mprintf statements (#3409)
Fixes #3407, and I used a regex search to find what I hope are all other examples.
2021-05-02 23:53:40 -04:00
Joshua Glatt cf7fa02e6d Fix variable replacement in text in briefings and debriefings (#3385)
* fix variable replacement in briefings/debriefings
* remove unused local variables
* multi server-side cleanup
* add client-side text replacement in multi
2021-05-02 20:46:56 -07:00
Goober5000 72aa1eebc9 tweak short-circuiting on the for-* sexps
If the `for-players` collection has no valid arguments, don't short-circuit, just to be on the safe side.

Don't short-circuit at all for the `for-ship-*` sexps, because ships can arrive and depart.
2021-04-29 23:52:21 -04:00
Goober5000 28f60df7fa Merge pull request #3406 from MageKing17/bugfix/avoid-negative-lookup-in-loadout
Avoid negative lookup when parsing loadouts.
2021-04-25 19:00:44 -04:00
MageKing17 bed18012d6 Avoid negative lookup when parsing loadouts.
#3271 changed the logic of `stuff_token_list()` in such a way that the supplied index being used to access an array was no longer skipped if it was invalid; naturally, this means that this warning was now being inevitably followed up by an out-of-bounds array access. Adding a `!skip_this_entry` check should hopefully fix the problem while still allowing the loadout count parsing code below it to run, which was presumably the reason the `continue` statement was replaced with the `skip_this_entry` variable in the first place. Fixes #3405.
2021-04-25 11:10:55 -07:00
Goober5000 d43f30053d Merge pull request #3404 from scp-fs2open/revert-3400-apng_fix
Revert "Fix APNG Animation Framecounter"
2021-04-24 22:43:40 -04:00
MageKing17 76dccbe07d Revert "Fix APNG Animation Framecounter" 2021-04-24 18:53:52 -07:00
Goober5000 3eafcde138 Merge pull request #3403 from MageKing17/bugfix/avoid-shiphit-negative-array-access
Avoid out-of-bounds array access if killed by a parentless weapon.
2021-04-24 21:13:38 -04:00
Goober5000 ca7065df46 Merge pull request #3400 from BMagnu/apng_fix
Fix APNG Animation Framecounter
2021-04-24 18:39:39 -04:00
Goober5000 cedf66cb31 Merge pull request #3402 from Baezon/fix-edge-checks
Fix fov_edge_checks
2021-04-24 18:39:32 -04:00
Baezon 03a3fbdc1c fix fov edge checks 2021-04-24 17:10:20 -04:00
MageKing17 9c6661e0e8 Avoid out-of-bounds array access if killed by a parentless weapon.
While there's code to avoid accessing the parent object of a parentless beam, there's no equivalent code to avoid accessing the parent object of a parentless weapon. This fixes this inconsistency.
2021-04-24 13:11:35 -07:00
Birk Magnussen 6bea921fbe Add short explanation 2021-04-24 23:04:00 +09:00
Birk Magnussen 79f5eda0d6 Fix APNG Animation Framecounter 2021-04-24 16:00:09 +09:00
Baezon 4e4c8449fd Merge remote-tracking branch 'upstream/master' into poof-overhaul 2021-04-22 00:06:03 -04:00
Baezon 7980891b48 overhaul poof handling 2021-04-22 00:05:22 -04:00
Goober5000 3aa61dfccb Merge pull request #3396 from Goober5000/is_visible_tweak
make is-ship-visible default to the first player
2021-04-20 00:00:31 -04:00
Goober5000 a6a7482467 handle weapon "None" properly
If the secondary weapon selection is None, the ammo count will be based on an incorrect weapon.  So guard against that.

Fixes #3393.
2021-04-19 23:38:08 -04:00
Tyler Blount 0febfb3545 Merge pull request #3394 from JohnAFernandez/Fix-that-annoying-fred-freezes-when-open-too-long-bug
Keep Fred from freezing
2021-04-19 21:18:48 -06:00
Goober5000 e1c8f5d2ed make is-ship-visible default to the first player
To be more user-friendly, and to accommodate buggy retail missions, make the one-argument version of `is-ship-visible` default to the first player in multiplayer mode..  Also, change the warning to an mprintf.
2021-04-19 23:04:27 -04:00
Goober5000 6ce2a445fe retail -> builtin 2021-04-19 22:28:29 -04:00
Goober5000 96ae629ec6 qtfred 2021-04-19 22:28:29 -04:00
Goober5000 1b9577eb85 add OPF_CUSTOM_HUD_GAUGE and apply it to relevant sexps 2021-04-19 22:28:29 -04:00
Goober5000 beeb18b46c Merge the argument list for OPF_HUD_GAUGE and OPF_HUD_GAUGE_NAME. Call it OPF_RETAIL_HUD_GAUGE. 2021-04-19 22:28:29 -04:00
JohnAFernandez 44343f8d1e Put a bandaid on Fred freezing
Could be because of variable overflows or from `thistime` somehow being much smaller than `lasttime`.

Hard to find the root cause, but manually setting the memory to bad values will no longer cause the freezing with this patch.
2021-04-19 22:00:46 -04:00
Taylor Richards 424c69d1e5 Merge pull request #3379 from notimaginative/fix_chat_error_handling
address issues with error handling in chat_api
2021-04-18 19:46:39 -04:00
JohnAFernandez 6d1354f1f6 Explicitly check that the type is a ship. (#3389)
Not all ships in the ships array are ships (if they were turned into observers), so we need to explicitly check that they are ships.
2021-04-18 05:11:30 +00:00
Tyler Blount d5c4f3e5c7 Merge pull request #3348 from TRBlount/fix/display_name_regression
Strip hashes from explicitly defined display names in tables.
2021-04-17 23:03:54 -06:00
JohnAFernandez 89bd64f4ab Make sure the Netgame state is set to prevent a crash (#3339)
If the client tries to respawn a player when the server is trying to end the game it will lead to a crash on the client side.  This sets the client's game to the correct state when an end game packet is received and adds extra checks before respawning.
2021-04-17 23:49:54 -04:00
Tyler Blount 417739665c Strip hashes from explicitly defined ship and weapon display names 2021-04-17 17:07:41 -06:00
Taylor Richards 11f2920b4f add variant of game update packet to tell PXO we want firewall status 2021-04-17 17:47:15 -04:00
Taylor Richards 9e4ab292ac fix game announcement issue causing first firewall check to fail 2021-04-16 18:35:46 -04:00
Taylor Richards 51addab005 add notification for PXO firewall test 2021-04-16 18:34:48 -04:00
MageKing17 e236a79773 Make an invalid variable name throw an error. (#3373)
There were a few assertions in the SEXP code that would trip if an invalid variable name were specified in a SEXP, but nothing that actually stopped a Release build from performing an out-of-bounds array access if someone made a typo in notepad. Since, as far as I could tell, everything should go through `get_sexp_text_for_variable()` first, I changed its `Assert()` into an `Error()` that should hopefully ensure that we avoid ever doing anything with `Sexp_variables[-1]`.
2021-04-14 21:26:11 -04:00
JohnAFernandez d523f0aef3 Make Sure Special Shield Hitpoint Max Gets Transferred (#3383)
Since the shield strength of the ships is being copied, you need to copy the special shield hitpoints, too, just like for hull.
2021-04-14 21:07:31 -04:00
Taylor Richards 697c009fb3 address issues with error handling in chat_api:
- detect server connection error messages before blindly
   moving to user login (crash fix)
 - detect read errors and fail accordingly (crash fix)
 - allow server disconnect to run even if we aren't connected (cleanup & reset)
2021-04-12 12:59:04 -04:00
JohnAFernandez 1f918fd4c6 Allow Fred to Edit and Allow Command briefs in FRED (#3372)
* Allow Fred to Edit and Allow Command briefs in FRED

They are currently allowed in the game, but not being allowed in Fred was an oversight of mine.

* Allow Command brief saving in qtFRED
2021-04-11 13:50:25 -04:00
Asteroth 3ea7a6d1ba Merge pull request #3369 from Baezon/cull-generic-debris
Properly cull generic debris
2021-04-10 21:44:56 -04:00
David Gibson 743989525b Implemented index caching for hooks refering to ship or weapon info objects. 2021-04-10 20:41:22 -05:00
David Gibson 5bca1417c2 Vectorized the hook condition lists and began chaching information inside the hook at creation to avoid string comparisons in play. CHC_VERSION, CHC_STATE, and CHC_APPLICATION converted. 2021-04-10 20:18:29 -05:00
Baezon 633cd88e83 modernize use nullptr 2021-04-10 19:38:18 -04:00
Baezon 7431aba995 properly cull generic debris 2021-04-09 21:35:26 -04:00
JohnAFernandez 328bebe83a Fix event parsing by setting flags to zero before loading. (#3363) 2021-04-07 23:41:14 -04:00
Goober5000 94e4f3d4cd Merge pull request #3362 from Baezon/no-ship-subsys-lookup
Remove unecessary ship_get_subsys in model_rotate_gun
2021-04-06 10:48:09 -04:00
Baezon b57573c439 remove unecessary ship-get-subsys 2021-04-06 02:24:05 -04:00
Goober5000 0b1d1eed56 Merge pull request #3357 from notimaginative/fix_briefing_music_reset
Only close common_select when we should
2021-04-05 23:52:35 -04:00
Goober5000 123feba557 Merge pull request #3353 from Goober5000/escape_exclamation
make double-character consolidation reusable, and reuse it
2021-04-05 23:50:39 -04:00
Taylor Richards 8c64d73a18 Merge pull request #3358 from notimaginative/fix_main_hall_sounds_in_multi
fix main hall sounds/music not getting stopped on multi clients
2021-04-04 08:19:43 -04:00
Taylor Richards e156f15561 fix main hall sounds/music not getting stopped on multi clients 2021-04-03 11:08:28 -04:00
Taylor Richards 3e1d89ba53 only close common_select when we should 2021-04-03 10:22:11 -04:00
Asteroth 4f7bad2a5c Merge pull request #3347 from Baezon/fireball-lod-fix
Make fireballs default to 1 LOD
2021-04-02 16:01:39 -04:00
Goober5000 dd621e8904 Merge pull request #3351 from PhantomHoover/feature/profile-script-hooks
Add profiling trace for scripting hooks
2021-04-02 15:07:17 -04:00
Goober5000 396d2c55a9 make double-character consolidation reusable, and reuse it
This moves the ## to # escape sequence logic from `mission_process_alt_types` to its own function where it can be used elsewhere (such as for ship class and weapon class display names that need to do the same thing).  Also, this introduces a !! escape sequence for exclamation points that is needed for exclamation points to be used in scripts, as @naomimyselfandi pointed out.
2021-04-02 00:16:19 -04:00
Goober5000 8f5064b353 actually use GS_STATE_INVALID
Make `gameseq_get_state` return GS_STATE_INVALID if the stack is invalid.

With this change, the check for stack validity can be removed in `gr_flip`.
2021-04-02 00:11:45 -04:00
Phantom Hoover 782f6f100d Add profiling trace for scripting hooks 2021-04-01 11:54:09 +01:00
Baezon 6ec1f45997 neb fog set up fixes 2021-04-01 02:17:49 -04:00
Baezon 4f76c441d6 default to 1 lod 2021-03-31 18:00:00 -04:00
Asteroth a2bd895b7b Merge pull request #3344 from Baezon/fix-huge-targeting-regression
Fix regression with huge/small only targeting
2021-03-31 16:47:17 -04:00
JohnAFernandez a4cf53694d Merge pull request #3346 from JohnAFernandez/Fix-3007
Add a safety check to the $On Frame: Hook
2021-03-31 16:46:11 -04:00
JohnAFernandez 6bd7a43e3d Add a safety check to the $On Frame: Hook
So #3007 is a larger bug than just trying to access the player's target.  The real problem is that the game state is not changed from `GS_STATE_GAME_PLAY` during the mission load when restarting the mission.  So the script thinks it's in the mission, tries to access the target and then crashes.  But this won't be the only bug.  Any script that tries to access data on Frame will run into possible problems on mission restart.
2021-03-31 15:25:38 -04:00
Baezon fffc0ebf8b fix name of class #3344 2021-03-30 22:03:25 -04:00
Goober5000 f2426de80b Merge pull request #3340 from Goober5000/num_valid_arguments_fix
make num-valid-arguments work for the for-* sexps
2021-03-30 19:32:26 -04:00
Goober5000 27f6088117 make num-valid-arguments work for the for-* sexps
This adds a hook into the for-* handlers to return the number of valid arguments.  Fixes a bug reported on Discord.
2021-03-30 18:51:24 -04:00
Goober5000 30c76f36ce Merge pull request #3342 from Goober5000/message_list_saving
modify saving of edited messages
2021-03-30 18:42:39 -04:00
Goober5000 35094851f2 modify saving of edited messages
Instead of saving based on the m_cur_msg index, which may have been reset to -1, save on the most recent positive index.  This should keep track of modified text and dropdowns even when m_cur_msg is set to -1 when the message list loses focus.

Fixes #3308.
2021-03-30 17:32:02 -04:00
Fabian Woltermann b562cf822e Merge pull request #3345 from Baezon/fix-strafing-bug
My kingdom for a semicolon!
2021-03-30 09:15:42 +02:00
Baezon 62942557d5 typo 2021-03-30 00:19:53 -04:00
Baezon 4d68bed436 fix huge targeting regression 2021-03-29 22:42:50 -04:00
Asteroth 19d5b8e68e Merge pull request #3329 from PhantomHoover/feature/split-profile-columns
Split frame profile trace into two onscreen columns if needed
2021-03-29 15:34:55 -04:00
Goober5000 9dc50706a7 Merge pull request #3309 from Baezon/turret-alt-math-fix
Update Turret_alt_math for moving subsystems
2021-03-28 18:06:05 -04:00
Goober5000 f2a0e35959 Merge pull request #3333 from Goober5000/no_xstr_entry_suppress
log missing XSTR strings only once
2021-03-28 15:17:24 -04:00
JohnAFernandez e637eea2fb Merge pull request #3337 from JohnAFernandez/Interpolation-Bug
Fix a rare but eventual crash in the interpolation code.
2021-03-28 10:00:47 -04:00
Fabian Woltermann f3e3769056 Merge pull request #3266 from The-E/fix/3250_dynamic_nebula_detail
Make nebula poof detail settings partially dynamic
2021-03-28 13:18:26 +02:00
JohnAFernandez e218f687a9 Fix a rare but eventual crash in the interpolation code.
I don't know when this was introduced but the bug is extremely obvious once someone hit the crash.  It should just be using the timestamp that the packet was received, not trying to put that timestamp into a vector whose index is server frame numbers.
2021-03-28 05:07:27 -04:00
Baezon 5e10fccdbf Merge remote-tracking branch 'upstream/master' into turret-alt-math-fix 2021-03-27 21:12:30 -04:00
Goober5000 12672d0c2b Merge pull request #3310 from Baezon/fix-fov-edge-checks
Fix Fov_edge_checks
2021-03-27 17:22:37 -04:00
Goober5000 de7081fbb3 Merge pull request #3335 from Goober5000/missing_hud_gauge_warning
change reticle log statements to warnings
2021-03-27 15:19:47 -04:00
Goober5000 d73e4d4dec change reticle log statements to warnings
Most guages in hud_guages.tbl will display a Warning if they can't be loaded, but the reticle is an exception - it only prints a log statement.  This PR changes it to be consistent with the rest of the HUD gauges.

Fixes #3090.
2021-03-27 14:19:59 -04:00
Fabian Woltermann aeefcb4657 Remove an unused constant 2021-03-27 16:23:35 +01:00
Fabian Woltermann 023dcfca76 Use the screen size as the break value, remove it from the Neb detail settings 2021-03-27 16:22:20 +01:00
Fabian Woltermann c6e9f954f0 Use the screen size as the break_* value 2021-03-27 16:11:26 +01:00
Fabian Woltermann 961d5eb171 Use bitmap height * 2 to make sure only completely off-screen poofs are culled 2021-03-27 16:11:26 +01:00
Fabian Woltermann 1a66c97c2e After loading the nebula poofs, resize the break_x and break_y values so they are equal to the largest poof bitmap in use.
Also reduce the break alpha value by 90% for all detail levels.
2021-03-27 16:11:26 +01:00
Goober5000 00e2c2ad52 log missing XSTR strings only once
The "No XSTR entry in strings.tbl for index %d" message was previously printed to the log every time the string was accessed, which for commonly-used strings will clutter up the log.  This makes the message only appear once per missing index.
2021-03-26 23:22:06 -04:00
JohnAFernandez 8991fc67cd Merge pull request #3331 from JohnAFernandez/Fix-Multi-Gamestate-Bug
Check for these states
2021-03-26 20:47:40 -04:00
JohnAFernandez 7641abf41c Check for these states
Because GS_STATE_MULTI_MISSION_SYNC is actually shared for a few different multi screens.
2021-03-26 20:18:39 -04:00
Phantom Hoover 871f7a822e Split frame profile trace into two onscreen columns if needed 2021-03-26 20:33:01 +00:00
m!m ca66664eac Merge pull request #3327 from Shivansps/over_alloc_fix
fix over alloc to store lz4 offsets
2021-03-26 18:33:21 +01:00
m!m 4c1b3551b4 Merge pull request #3328 from ngld/fix/keep_stdout
Add FSO_KEEP_STDOUT env var to skip the AttachConsole() call
2021-03-26 18:32:34 +01:00
Asteroth 07d47cb984 Merge pull request #3319 from Baezon/add-fog-color
Allow for setting of nebula fog color explicitly
2021-03-25 21:20:55 -04:00
Allen A. Babb ce9ee8c264 Merge pull request #3324 from z64555/fix/issue_3322
Fixes #3322
2021-03-25 18:43:15 -05:00
ngld 8039650248 Add FSO_KEEP_STDOUT env var to skip the AttachConsole() call
Fixes #3317
2021-03-26 00:03:51 +01:00
Shivansps cd2b578a1b fix over alloc to store offsets 2021-03-25 19:57:48 -03:00
Shivansps 052879b3e4 POF 2118 and SLC2 support 2021-03-25 19:13:12 -03:00
z64555 85ec8251e3 When in bind mode, identify mouse as CID_JOY0 instead of CID_MOUSE. Fixes #3322. 2021-03-25 09:41:37 -05:00
JohnAFernandez 7e51a13c3a Merge pull request #3296 from Shivansps/compressed-files
LZ4 Compressed files Support
2021-03-25 07:08:06 -04:00
Baezon 538b2c6c95 handle lab and use empty string #3319 2021-03-24 13:25:16 -04:00
wookieejedi d3a70e8ed6 Merge pull request #3320 from wookieejedi/disable-spew-whole-ship
Add `no impact debris` for whole ship
2021-03-24 00:56:09 -04:00
Baezon 9dc68849d6 unused variable 2021-03-23 23:59:05 -04:00
wookieejedi b6bab87601 restore original comment 2021-03-23 23:44:03 -04:00
wookieejedi b8d868f828 restore comment 2021-03-23 23:43:31 -04:00
wookieejedi 01e6a57aaa remove un-needed section 2021-03-23 23:41:57 -04:00
wookieejedi e0fe9227aa clarify whitespace 2021-03-23 23:21:40 -04:00
Baezon 803751959a rename variable for no shadowing 2021-03-23 23:20:11 -04:00
wookieejedi 9597b5962e clarify ship override for subsystems debris 2021-03-23 23:16:59 -04:00
wookieejedi 792f74b33e Add no impact debris flag for entire ship model
Previously `no impact debris` flag was only an option for use on subsystems. This PR adds that flag for the entire ship. It also turns off the impact spew of debris for all subsystems if enabled on the ship.
2021-03-23 23:04:08 -04:00
Baezon 5181e71dab Add explicit fog color 2021-03-23 22:57:54 -04:00
JohnAFernandez 3d0e0f80ae One more hiccup 2021-03-23 20:31:04 -04:00
JohnAFernandez 251125913a How many mistakes is it now? No idea. 2021-03-23 20:31:04 -04:00
JohnAFernandez 89d2d6ed46 Fix missile indicators not going away
Add the should be dead flag, in order to properly make the missiles go away, and not just detonate.
2021-03-23 20:31:04 -04:00
JohnAFernandez 06f198afc1 Forgot one 2021-03-23 20:31:04 -04:00
JohnAFernandez 19a289539a More Whitepsace and Dealing with Crazy old CI 2021-03-23 20:31:04 -04:00
JohnAFernandez c14653b391 Whitespace Adjustments 2021-03-23 20:31:04 -04:00
JohnAFernandez 2527bf31c7 Upgrade velocity compression in OO packet
Previously, the velocity could be off by up to 1 m/s.  This gives that packing function one more byte to work with, so that we have a lot more accuracy to work with.
2021-03-23 20:31:04 -04:00
JohnAFernandez 184107283a Properly Set net_signatures for wing ships
Previously wing ships were being given a net signature that was one too large.
2021-03-23 20:31:04 -04:00
JohnAFernandez 42c19cdfee Fix Missile Syncing Between Server and Client 2021-03-23 20:31:04 -04:00
JohnAFernandez 3830534978 Fix implementation of multi_pack_unpack_desired_vel_and_desired_rotvel 2021-03-23 20:31:04 -04:00
JohnAFernandez 48eef6566d Multi Version bump for 21_2
since many of the fixes and features require a multi bump.
2021-03-23 20:31:04 -04:00
the-maddin b253442545 Add -pilot cmdline flag (#3316)
* Cmdline parsing for `-pilot "<name>"`

Add cmdline parameter `-pilot` with required
argument name and export name as global var
`Cmdline_pilot`.

* Expose to scripting `isAutoselect`

Setting `-pilot` flag sets `ui.isAutoselect()` true
(as does `-benchmark_mode`).

* Skip pilot selection

and call `player_finish_select` with the given
player instead.

* More useful error message on pilot load error

Also display callsign

* Add pilot name as scripting variable

* Don't expose pilot flag to launchers

* make stored flag param `const`
2021-03-22 21:14:57 +00:00
Baezon 26314c9b97 Merge remote-tracking branch 'upstream/master' into poof-overhaul 2021-03-22 00:37:17 -04:00
Baezon 5ebb12e47c overhaul poof system 2021-03-22 00:35:31 -04:00
JohnAFernandez 1d5e9794d6 Merge pull request #3263 from BMagnu/fix_unicode_stringstbl
Fix strings.tbl in unicode mode
2021-03-21 17:41:55 -04:00
Asteroth b7a9f545fd Merge pull request #3304 from BMagnu/weapon_penetrate_flag
Add pierce ship weapon flag
2021-03-21 15:12:45 -04:00
JohnAFernandez 9541e244d1 Make sure objects and ships get cleared if leaving mission sync (#3314)
This properly clears ships if you are leaving the sync state for any other state besides the gameplay state.
2021-03-21 14:54:32 -04:00
Asteroth f12d202afe Merge pull request #3278 from Baezon/exponential-fog
Switch to exponential fog and other nebula visibility improvements
2021-03-20 16:45:24 -04:00
Goober5000 507a5f1de8 Merge pull request #3312 from Goober5000/per_mission_chase_view
add mission flag for starting missions in chase view
2021-03-20 15:36:11 -04:00
Baezon 3810b039f5 Merge remote-tracking branch 'upstream/master' into exponential-fog 2021-03-20 10:39:41 -04:00
Baezon 827754d6de minor fixes 2021-03-20 02:31:47 -04:00
Goober5000 d455e17e34 add mission flag for starting missions in chase view
Follow-up to #3305.  Some mods may want one or two missions to start in chase view without having every single mission default to chase view.  So this adds a mission flag (with FRED and qtFRED support) that will enable this on a per-mission basis.
2021-03-20 00:21:27 -04:00
Baezon 7a7999ca56 Merge remote-tracking branch 'upstream/master' into poof-overhaul 2021-03-19 20:43:17 -04:00
Shivansps db360820a9 fix build check 2021-03-19 20:51:09 -03:00
Baezon 804a222041 unused variable 2021-03-19 19:44:11 -04:00
Shivansps 6dab1e464f Merge branch 'compressed-files' of https://github.com/Shivansps/fs2open.github.com into compressed-files 2021-03-19 20:21:02 -03:00
Shivansps 86c45309e8 requested changes and simplified if on random access function 2021-03-19 20:20:58 -03:00
Birk Magnussen 4f4690a482 Fix Names and spawn on destruct 2021-03-20 03:52:54 +09:00
Baezon 1ca60e1d2f fix fov_edge_checks 2021-03-19 11:48:15 -04:00
JohnAFernandez 420c7ec171 Play directive completion sounds for clients (#2900)
* Allow Text to show failure on Clients

Function was accidentally returning false before sending an update on failure.

* Play directive sounds for clients

This adds a short client version of the function that initiates the directive completion sound.

* forgot to remove a failed experiment
2021-03-19 05:39:05 -04:00
Birk Magnussen 011f7e4d6c Change flag to Table entry 2021-03-19 18:30:39 +09:00
Asteroth 8b94e58596 Merge pull request #3284 from Baezon/fix-rand-circle-sphere-bias
Fix probability distribution of vm_vec_random_in_circle/sphere
2021-03-19 02:23:31 -04:00
Asteroth b304ccbe96 Merge pull request #3305 from Strygon/chaseviewtest
Adding "Start missions in Chase View by default" flag in game_settings.tbl
2021-03-19 02:23:08 -04:00
Baezon eb538ffba8 update turret_alt_math for moving subsystems 2021-03-19 02:13:20 -04:00
JohnAFernandez 5bb934119c Limit instances of Client Collisions to Avoid Instant Death (#3164)
* Limit instances of Client Collisions to Avoid Instant Death

* Set timestamps correctly (take 2)

* Handle server check the same everywhere

* Clearer Logic Here
2021-03-18 17:24:08 -04:00
Fabian Woltermann 8c7a8e42b2 Merge pull request #3307 from The-E/fix/3206_submodel_property_parsing
Fix for #3306
2021-03-18 17:29:10 +01:00
Fabian Woltermann 9a06e0727c Make sure we check for any carriage return characters that may sneak in too 2021-03-18 16:52:15 +01:00
Strygon 08603009fb removed the redundancy 2021-03-17 20:40:02 +01:00
JohnAFernandez 609ed4ed94 Remove the fireball limit (#3224)
* Remove the fireball limit

* Handle Feedback

(Without the main PC, so really hoping I don't do any typos)
2021-03-17 14:21:06 -04:00
Strygon 3ab9f85a7a ditto 2021-03-17 17:50:19 +01:00
Strygon 45db675c35 Renaming the bool 2021-03-17 17:49:43 +01:00
Strygon 5b01a68352 Adding a few forgotten parts of the ChaseViewDefault code 2021-03-17 17:39:27 +01:00
Strygon 67cc6a66eb Adding ChaseView Flag functionality
This is where the game would put the player into chaseview/third person if the flag for it is set in game_settings.tbl
2021-03-17 17:38:32 +01:00
Strygon 842c84da7d Adding the actual flag for default chase view 2021-03-17 17:36:25 +01:00
Strygon 6598c25fda Adding support for Chase View flag 2021-03-17 17:35:39 +01:00
Birk Magnussen 2a73fb340f Add pierce ship weapon flag 2021-03-17 17:39:04 +09:00
Baezon edee63491d Merge remote-tracking branch 'upstream/master' into poof-overhaul 2021-03-17 00:46:38 -04:00
Goober5000 d716433848 Merge pull request #3300 from Baezon/fix-flak-substitute-assert
Fix assert with combining flak and non-flak using substitute
2021-03-17 00:34:14 -04:00
Baezon 5bd351d42a initial poof overhaul 2021-03-16 11:33:34 -04:00
Shivansps ad60240eb6 Updated comment header. Feature Complete. 2021-03-16 10:11:48 -03:00
Baezon 29b03cd49f implement beam substitution 2021-03-15 23:16:05 -04:00
Shivansps f8df97b489 fix seek_end on comp_fseek
This where causing the pcx issues
2021-03-15 23:59:39 -03:00
Asteroth 95235b353b Merge pull request #2885 from Baezon/expose-huge-small-targeting
Expose ability to be targeted by 'huge' and 'small only' weapons
2021-03-15 22:32:22 -04:00
Shivansps d5feddfb8a fixed comp_fseek return 2021-03-15 20:08:58 -03:00
Baezon ce1907c52a flak should use normal mflash methods 2021-03-15 18:30:47 -04:00
JohnAFernandez 895dbdddb8 Merge pull request #3295 from Goober5000/spacebar_popup
add text to context popup
2021-03-15 09:44:00 -04:00
Baezon f5e32fa1a2 Merge remote-tracking branch 'upstream/master' into exponential-fog 2021-03-15 02:27:22 -04:00
Shivansps 9fa3baa458 fix typo 2021-03-14 23:43:22 -03:00
Shivansps 4b3760dfb4 more build fixes 2021-03-14 21:17:07 -03:00
Shivansps 142d586a1c and even more build check fixes 2021-03-14 20:29:26 -03:00
Shivansps 95103dfcb8 more build check fixes 2021-03-14 19:57:04 -03:00
Shivansps f50ea26051 Change CI struct name to upper case 2021-03-14 19:36:20 -03:00
Shivansps 983dd0b6ca changes for build check errors 2021-03-14 19:21:13 -03:00
Shivansps 3bdc5e0c27 Merge branch 'master' into compressed-files 2021-03-14 17:57:53 -03:00
Baezon 643cb6a2be update scripting functions 2021-03-14 15:37:43 -04:00
MageKing17 2348d4db64 Merge pull request #3297 from MageKing17/bugfix/sexp-ammo-safety-regression
Fix ammo safety regressions.
2021-03-14 11:45:04 -07:00
MageKing17 77534926c8 Comment clarification. 2021-03-14 11:16:54 -07:00
Shivansps ba6a471054 comment debug statements 2021-03-14 14:55:20 -03:00
MageKing17 47c409a3d5 Fix ammo safety regressions.
When various SEXP functions related to ammo were consolidated back in June (in commit 54409ec928), certain safety catches meant to avoid having too much ammo or the wrong ammo capacity after changing weapons were lost. This commit adds code that should be functionally equivalent.
2021-03-14 10:43:06 -07:00
Shivansps ce44e3522b updated header 2021-03-14 14:35:04 -03:00
Goober5000 593fbdbf21 add text to context popup
The Space Bar is a valid shortcut, so indicate as such.  Fixes #3289.
2021-03-14 12:47:15 -04:00
Shivansps c1b87bc2b6 Add missing CAP to comp goal position.
It should not be needed but at least this stops crashing when you use a unsupported format in compression (like, audio and pcx)
2021-03-14 13:34:13 -03:00
Shivansps 1f164dbb64 Removed isCompressed from compression_info 2021-03-14 11:12:00 -03:00
Shivansps 1275cbfd83 Proper lz4 reference and added position checks
LZ4 moved to lib folder and added cmakelists.
Added several position check to match cfilearchive ones for compressed files.
Changed header check to int.
2021-03-14 10:47:11 -03:00
Goober5000 69be3c8f35 Merge pull request #3293 from Goober5000/hotkey_range_check
simple hotkey range check
2021-03-14 00:04:14 -05:00
Goober5000 85fc1f7cea simple hotkey range check
This prevents the message from firing if the wing index is -1 which would cause an array underflow.  Fixes #3280.
2021-03-13 23:15:16 -05:00
Goober5000 59a5a343c8 Merge pull request #3291 from Baezon/fix-contrail-a_decay_exponent
Peoperly initialize alpha decay exponent for contrails
2021-03-13 22:14:38 -05:00
Baezon a3ce01f250 properly initialize a_decay_exponent 2021-03-13 20:33:54 -05:00
Shivansps 20cccdbf20 Updated Implementation
Moved the compression functions to separated files, added dynamic blocksize support for LZ4 and a decoder buffer to make sure every block is only read from file and decoded only once.
2021-03-13 17:15:04 -03:00
Asteroth 4b64c43ef8 Merge pull request #3274 from Baezon/shooter-damaging-weapons
Add shooter damaging weapons
2021-03-13 15:03:52 -05:00
Asteroth 4307d12762 Merge pull request #3285 from Baezon/fix-fit-and-set-obj-facing
Bugfix for FIT with set-object-facing
2021-03-13 14:59:52 -05:00
Asteroth 0d3d336d65 Merge pull request #3287 from Baezon/fix-aburn-trail
Properly initialize trail alpha exponents for afterburner trails
2021-03-13 14:59:24 -05:00
Shivansps 077338086a Improved implementation
Model load and tech room now works, it crashes at mission load.
2021-03-12 19:58:49 -03:00
Birk Magnussen 0b2ee5f76b Modify other file reading method for new encoding conversion 2021-03-13 07:50:41 +09:00
Baezon 256a047fab fix rand circle and sphere probability distribution 2021-03-12 16:13:52 -05:00
Baezon 222799b1a1 initialize trail alpha exponents for aburn trails 2021-03-12 16:03:50 -05:00
Fabian Woltermann 649fe7e3ce Merge pull request #3286 from Baezon/fix-to-the-fixed-fog
Fix for nebula fogging distance
2021-03-12 10:54:50 +01:00
Baezon 2e5e25dc09 revert #2222 and fix comment 2021-03-11 23:28:23 -05:00
Shivansps 3f9218e671 1st attempt at implementation
I just dumped everything into cfilearchive to avoid a fight with the includes that i cant win for now.

It dosent work, DDS utils complains about DDS filecode.
2021-03-11 20:51:28 -03:00
Birk Magnussen 3003d0589d Change validation to own function 2021-03-12 06:34:27 +09:00
Birk Magnussen 4bd15d43da Fix Warning due to enum class 2021-03-12 06:04:10 +09:00
Birk Magnussen 8df62e99f5 Change Enum to Enum Class 2021-03-12 05:54:25 +09:00
Birk Magnussen d93c9c4220 Adapt parsing exceptions 2021-03-12 05:45:09 +09:00
Birk Magnussen 1b5fd3c5fd Move Conversion functions to util/unicode 2021-03-12 05:42:44 +09:00
Baezon 0612a72c2f fix FIT with set-object-facing 2021-03-11 15:41:55 -05:00
Baezon 22f7ff3443 fix bias from random_circle/sphere 2021-03-11 03:02:24 -05:00
Goober5000 5105f35a31 Merge pull request #3271 from Goober5000/better_parse_lists
rewrite stuffing of lists
2021-03-10 19:19:39 -05:00
Goober5000 f025572110 rewrite stuffing of lists
Consolidate all the functions which parse lists of data.  They're almost the same except for the data itself, so use templates.

As for the templated function which handles the list, boost the robustness by adding additional checking and error messages.
2021-03-10 18:50:12 -05:00
Goober5000 ed2cc47093 Merge pull request #3269 from Goober5000/annotation_fix
Various annotation fixes
2021-03-10 18:49:39 -05:00
Goober5000 4486b9ee10 Merge pull request #2923 from z64555/controls3
Controls3 - Primary/Secondary Bindings
2021-03-10 15:53:52 -05:00
Asteroth e8603e1617 Merge pull request #3247 from Baezon/better-subsys-attacking
Add improved subsystem attacking
2021-03-10 12:21:53 -05:00
Goober5000 f67860a502 Merge pull request #3283 from Goober5000/fix_isdigit_type
fix character type for isdigit
2021-03-10 11:37:54 -05:00
Goober5000 497a0e0805 fix character type for isdigit
Just like the `std::toupper` and `std::tolower` functions (see PR #3226), `std::isdigit` is designed to work with regular `char`, not `unsigned char`.
2021-03-10 10:51:56 -05:00
Goober5000 470a996b11 Merge pull request #3281 from Goober5000/beam_range_fxi
a few turret fixes
2021-03-09 23:09:59 -05:00
Goober5000 5bb9f427b4 a few turret fixes
This correctly calculates the turret position from the center (zero position) of its submodel instead of using the offset from the main model.

This patches a few more parts of the code and also adds a missing locale argument.
2021-03-09 22:39:13 -05:00
Goober5000 52df877ed9 Merge pull request #3276 from Goober5000/special_arg_fix
add small fix from SEXP containers PR
2021-03-09 21:43:28 -05:00
Shivansps 8292d8c44a Revert "Merge branch 'arm_fixes'"
This reverts commit 2ee128cd88, reversing
changes made to a2b349855e.
2021-03-09 20:44:43 -03:00
Asteroth 0eefd352d9 Merge pull request #3264 from Baezon/32-poofs
Increase max nebula poofs to 32
2021-03-08 14:44:26 -05:00
Baezon cf2e3e8641 lightning even with 0 poofs 2021-03-08 10:50:27 -05:00
Baezon 78c79ac88d debug clean up 2021-03-08 01:37:00 -05:00
Baezon 6e54ed3dfc more exponential fog 2021-03-08 00:09:42 -05:00
Baezon f60d2d8e30 comment changes 2021-03-07 23:06:30 -05:00
Goober5000 a12a33b189 Merge pull request #3277 from Goober5000/movable_turret_fov_fix
Turrets on movable submodels
2021-03-07 21:29:28 -05:00
Baezon cf3ce54038 comment clarity 2021-03-07 14:20:55 -05:00
Goober5000 483a632c7f Merge pull request #3243 from Baezon/decouple-asteroids-species
Decouple asteroids from species
2021-03-07 13:13:13 -05:00
Goober5000 9a3fc507d6 Merge pull request #3261 from BMagnu/lua_campaignswitch
Lua add campaign switch function
2021-03-07 13:10:01 -05:00
z64555 19c0f64736 Upgrade a few Assert()'s into Assertion()'s with error messages 2021-03-07 09:56:21 -06:00
z64555 78ac82d6eb Replace Int3()'s with UNREACHABLE
* control_config_bind_btn uses UNREACHABLE macro when an unknown order is passed to it
2021-03-07 09:20:34 -06:00
Baezon 2dd40bcbd8 typo 2021-03-07 02:00:58 -05:00
JohnAFernandez 5da44a9d72 Merge pull request #3178 from Baezon/generic-debris-enhancement
Generic debris expansion and configuration
2021-03-07 00:19:25 -05:00
Goober5000 d75b0f4b4b additional minor cleanup 2021-03-06 20:03:59 -05:00
z64555 5c9582aefc Fix bug where "Clear Conflict" button was disabled on Ship tab unless the conflicted items included an axis. 2021-03-06 12:52:48 -06:00
Goober5000 ab478c4a0e Merge pull request #3275 from Goober5000/uoffset_addendum
addendum to u_offset
2021-03-05 22:44:00 -05:00
Goober5000 01daf25fe9 addendum to u_offset
This improves PR #3257 by updating the frametime after the beam fires, not before, so that the first frame will always be at offset zero
2021-03-05 22:15:55 -05:00
Goober5000 db73c27a53 add small fix from SEXP containers PR
While skimming the differencs in jg18's branch of PR #3253...
https://github.com/jg18/fs2open.github.com/tree/feature/sexp-containers-revised

...I noticed a TODO that is almost certainly a genuine bugfix.  As such, it deserves its own PR.  The line in question was last modified in 2012 by karajorma, and the bugfix should test for the special-arg in the entire actions tree rather than just the first action.
2021-03-05 22:00:51 -05:00
Baezon 3c53b74e5e switch to exponential nebula fog 2021-03-04 23:02:24 -05:00
Birk Magnussen 829e0b8b7c remove bad type modifier 2021-03-04 22:17:16 +09:00
Birk Magnussen 4b60ca467c Refactor encoding functions 2021-03-04 22:08:50 +09:00
Baezon d972f353f1 better species name handling and XSTR 2021-03-03 22:05:12 -05:00
Baezon 9c1d1e64cc better self kill text 2021-03-03 20:22:50 -05:00
Goober5000 abc153e21e Merge pull request #3273 from NovachenFS2/TranslatedAsteroids
Translateable Asteroid Name in Asteroid Fields
2021-03-03 15:26:30 -05:00
Jenna Trassa 9385206e0e Feedback & lowercase debris code 2021-03-03 20:56:24 +01:00
Goober5000 3674f06400 Merge pull request #3272 from NovachenFS2/AsteroidTimer
Translateable Asteroid Impact Time
2021-03-03 14:36:14 -05:00
Goober5000 be780af04d Merge pull request #3268 from BMagnu/replace-texture-sexp
Add replace-texture SEXP
2021-03-03 14:33:21 -05:00
Goober5000 ec1d2e091e Merge pull request #3262 from Goober5000/enable_multi_for_two_sexps
allow two SEXPs to be used in multiplayer that previously couldn't be
2021-03-03 13:59:21 -05:00
Goober5000 106da3c95f allow two SEXPs to be used in multiplayer that previously couldn't be
1) The ship-vanish SEXP (and script function) was already multiplayer-ready
2) The is-ship-visible SEXP was enhanced to add a second argument, which defaults to the player's ship in single-player mode
2021-03-03 13:22:50 -05:00
Jenna Trassa 34649c7543 Translated Asteroid Name in Asteroid Fields 2021-03-03 17:25:37 +01:00
Baezon 0fcfe68164 add self-damaging weapons 2021-03-03 11:08:04 -05:00
Jenna Trassa 8b0e79703a A translateable Asteroid Impact Time 2021-03-03 14:55:29 +01:00
Baezon c3c4c21fc2 typo 2021-03-03 02:26:23 -05:00
Birk Magnussen 8471b8e444 Change Preload Error to Warning 2021-03-03 15:48:47 +09:00
Baezon 8a5483db0b retail name compatability 2021-03-03 01:08:15 -05:00
Baezon 708de001f3 Merge remote-tracking branch 'upstream/master' into decouple-asteroids-species 2021-03-02 19:55:00 -05:00
Birk Magnussen 6cdbb8159b Change SEXP Syntax, and allow Wings 2021-03-03 06:00:47 +09:00
Goober5000 03dbdf7f09 don't display unmodified annotations 2021-03-02 15:09:28 -05:00
m!m 1561a75b13 Merge pull request #3260 from BMagnu/simulatedspeedoverrides_tb
Add scripting API for accessing registered Simulated Speech Overrides
2021-03-02 17:51:49 +01:00
Goober5000 aff1ad40f3 better handling of unexpected characters that come after numbers 2021-03-02 11:31:16 -05:00
Birk Magnussen 19f48e3a10 Tidy up leftover code 2021-03-02 22:17:06 +09:00
Birk Magnussen 2c27707e00 Add replace-texture SEXP 2021-03-02 22:03:28 +09:00
BMagnuandm!m 9a854a7066 Add change to correct typecast
Co-authored-by: m!m <[email protected]>
2021-03-02 17:09:20 +09:00
Asteroth 897492e228 Merge pull request #3257 from BMagnu/beam_reset_offset
Add flag for beams to track uoffset individually
2021-03-02 03:08:02 -05:00
Asteroth 72d7b1bc9c Merge pull request #3259 from BMagnu/lssm_warpeffect
Added flag to select the warp effect type of LSSM's
2021-03-02 03:07:43 -05:00
Goober5000 14a8db0dda check for all possible strings 2021-03-01 21:01:01 -05:00
Goober5000 258ffdf56d a token consisting of a single + or - is not a valid number 2021-03-01 21:00:48 -05:00
Baezon bd5f709e14 must be 32 bits!!! 2021-03-01 12:14:13 -05:00
Baezon b6c29e3ffd increase max poofs to 32 2021-03-01 12:00:37 -05:00
Birk Magnussen b45cb19f3c Add changes to the parse exceptions to work with utf8 encoding 2021-03-02 00:05:12 +09:00
Birk Magnussen e30c919286 Add encoding conversion helpers 2021-03-02 00:03:36 +09:00
Goober5000 c4374d11a9 replace world_to_turret_matrix 2021-03-01 00:02:44 -05:00
Goober5000 3b1aac26e8 remove most of turret_matrix stuff 2021-02-28 23:41:56 -05:00
Birk Magnussen bbc0f08541 Fix Warpout being affected as well. Fix Messages. Fix Init 2021-03-01 13:36:05 +09:00
Goober5000 d4c6c3e145 turret_norm should now be calculated properly 2021-02-28 21:48:15 -05:00
Goober5000 66b7b011c9 Merge pull request #3256 from Goober5000/switch_sexp
add switch and functional-switch operators
2021-02-28 18:00:59 -05:00
Birk Magnussen 2233d2eb9b Reflect used player object 2021-03-01 01:32:13 +09:00
Birk Magnussen e9b2047769 Add function to switch campaign 2021-03-01 01:27:14 +09:00
Birk Magnussen 781aa5c638 Fix warning 2021-03-01 00:55:05 +09:00
m!m b5212d69e4 Merge pull request #3258 from BMagnu/lua_file_cleanup
Changed File not closed error to a warning and automatic file close
2021-02-28 16:44:58 +01:00
Birk Magnussen 03eb74e616 Add scripting API for accessing registeres sso's 2021-03-01 00:32:42 +09:00
Birk Magnussen f0d5c5a499 Remove redundant close 2021-03-01 00:13:49 +09:00
Birk Magnussen 335f2476f9 Added flag to select the warp effect type of lssm's 2021-03-01 00:06:15 +09:00
Birk Magnussen 530916e0fa Changed File not closed error to a warning and automatic file close 2021-02-28 23:47:07 +09:00
Birk Magnussen b4791b3b10 Add flag for beams to track uoffset individually 2021-02-28 14:40:25 +09:00
Baezon 4bdb9165ea bugfix 2021-02-27 22:33:21 -05:00
Goober5000 8d4976dd95 add switch and functional-switch operators
Like the C equivalent, these SEXPs allow one action to be taken, or one value to be returned, based on a numeric expression.
2021-02-27 21:56:51 -05:00
m!m e393503eb2 Merge pull request #3244 from the-maddin/default_volume_issue
Set default volume on audiostream creation
2021-02-27 22:41:03 +01:00
JohnAFernandez 9c4d8f175b Merge pull request #3255 from Baezon/bugfix-trail-texture
Properly initialize trail texture stretch
2021-02-27 14:31:12 -05:00
m!m 002b8a69b1 Merge pull request #3251 from asarium/fix/actionsCompile
Add a CMake platform check for proper non-copyable type support
2021-02-27 20:08:05 +01:00
Baezon 529ba78c04 review tweak 2021-02-27 13:48:26 -05:00
Baezon 772eaa634a properly initialize texture stretch 2021-02-27 13:41:24 -05:00
asarium 7c909c6d69 Fix Visual Studio compilation around non-copyable type
This works around a compiler bug present in most older versions of MSVC
where it absolutely wanted to use a deleted copy constructor even if a
move constructor was available.

This just moves the relevant code into the default constructor.
2021-02-27 19:39:29 +01:00
JohnAFernandez a22f44ce01 Merge pull request #3187 from Baezon/swarm-cleanup
Give swarm missile handling a well-deserved makeover
2021-02-27 00:01:58 -05:00
JohnAFernandez 09671d9907 Merge pull request #3245 from Baezon/disabled-repair-fix
Bugfix for disabled fighters interupting their own support calls
2021-02-26 23:59:03 -05:00
Goober5000 da4b6b2f67 Merge pull request #3252 from Goober5000/main_hall_parsing_fix
when we're finished parsing a main hall, the next main hall should be a new one
2021-02-26 21:55:13 -05:00
the-maddin c0f351d92e fix indents 2021-02-27 00:01:08 +01:00
m!m 8700645d21 Merge pull request #3067 from asarium/lua/fullTypeCoverage
Add full type coverage for return types and variables
2021-02-26 23:06:55 +01:00
Goober5000 3fe59717c5 when we're finished parsing a main hall, the next main hall should be a new one
With modular tables, we might have modified an entry in the middle of the vector, in which case the next index would be an existing main hall.  If the next modular table then created a brand new main hall, it would overwrite that entry.  This makes sure the code always assumes the next main hall will come at the end of the list.
2021-02-26 16:47:05 -05:00
asarium 0fb712ed39 Add full type coverage for return types and variables
This introduces type parsing for all types used within the scripting
documentation. This improves the generated JSON output and also
validates new code via the unit test.
2021-02-26 22:37:37 +01:00
the-maddin 003fa68582 Remove leftover default setting 2021-02-26 22:23:46 +01:00
Baezon e3acb2c56b ai fighter support 2021-02-25 23:45:42 -05:00
Baezon 789f78aefd Merge remote-tracking branch 'upstream/master' into expose-huge-small-targeting 2021-02-25 23:36:59 -05:00
Baezon ec323a3960 combine flags 2021-02-25 23:15:29 -05:00
Baezon 86d01a3b0f Merge remote-tracking branch 'upstream/master' into disabled-repair-fix 2021-02-25 21:22:18 -05:00
Baezon a685b6f051 Merge remote-tracking branch 'upstream/master' into better-subsys-attacking 2021-02-25 21:20:51 -05:00
Goober5000 2ac85f3172 Merge pull request #3246 from Goober5000/back_inserter_include
add missing #include
2021-02-25 15:14:48 -05:00
Goober5000 18a15eed29 add missing #include
On some setups the hierarchy of #include files doesn't catch an <iterator>, so #include it explicitly.
2021-02-25 13:45:07 -05:00
m!m 413633855f Merge pull request #3248 from asarium/build/fixQt
Force aqt to a known good version
2021-02-25 19:11:01 +01:00
asarium ac5eb11c39 Force aqt to a known good version
There was another break in that package so this should hopefully make
our builds more stable.
2021-02-25 18:37:44 +01:00
m!m ca5ab260c9 Merge pull request #3242 from asarium/feature/actionExpression
Add dynamic expression support for actions
2021-02-25 18:17:34 +01:00
Baezon 80ba3b9e9c Merge remote-tracking branch 'upstream/master' into better-subsys-attacking 2021-02-25 02:30:18 -05:00
Baezon 81c771b8ea clean up 2021-02-25 02:13:02 -05:00
Baezon d86723ef07 bugfix disabled fighters calling for support 2021-02-24 16:10:04 -05:00
asarium d589234648 Some final changes 2021-02-24 18:04:19 +01:00
the-maddin 26aab09b8e Update scripting documentation audio_stream:play()
to reflect what the implementation actually does.
2021-02-24 02:16:01 +01:00
JohnAFernandez 55b8f3f642 More cleanup and Int3() refactors (#2744)
* Clean Up ai_attack_object()

There was an unused parameter, and no one has added subsystem targeting (at least to this function) in the past 20 years, so it's time to remove it and make it more readable.  Probably better to adjust that behavior somewhere else anyway.

Also changes an Int3() into

* More Int3 cleaning

Refactor a few Int3()'s in the AI code

* Feedback on is_ignore_object_sub

* Feedback, remove duplicate check, add documentation to preserve why it was there
2021-02-23 19:51:43 -05:00
the-maddin 063854384f Set sane default volumes on audiostream creation.
Looking throughthe code, it appears that
sound volumes are typically set when calling
the "play" function for in-engine uses of sounds.
No default values were, in fact, set explicitly at
creation, so they were initialized to 0.0f.

Scripting documentation, however, refers to
default volumes per type where no volume is
passed. New engine functionality should also
be able to rely on this.

I'm setting sane values found in other
parts of the sound system at stream creation,
to be used or overwritten later.
2021-02-24 01:45:05 +01:00
the-maddin 9ffcd780e9 Deduplicate stream creation code 2021-02-24 01:45:05 +01:00
the-maddin 4125d0bdba Fix stream slot leak
A wrong stream type could lead to a stream handle
being marked as used although no stream is created
2021-02-24 01:44:10 +01:00
the-maddin af29243157 Merge remote-tracking branch 'refs/remotes/upstream/master' 2021-02-23 20:52:40 +01:00
Fabian Woltermann 659d68e9b9 Merge pull request #3167 from EatThePath/cylinder-only-tube-lights
Cylinder only tube lights
2021-02-23 19:11:22 +01:00
m!m 3d856b77d9 Merge pull request #3229 from the-maddin/master
Scripting&Sound: Load sound from memory
2021-02-23 17:57:32 +01:00
Baezon f447fd4e23 unused variables 2021-02-23 01:13:08 -05:00
Baezon 8088cf0ab4 ints to floats 2021-02-23 00:53:10 -05:00
Baezon a69046000e cast to int 2021-02-23 00:12:29 -05:00
Baezon 881da211a2 misc tweaks 2021-02-22 23:23:49 -05:00
Baezon 622a28236e decouple species from asteroids 2021-02-22 22:55:34 -05:00
the-maddin d0edab2c74 Better instance preparation; no MIN macro 2021-02-23 00:47:13 +01:00
Martin Merget c715cf5c65 Merge remote-tracking branch 'refs/remotes/upstream/master' 2021-02-23 00:04:54 +01:00
z64555 1fca306fc9 Address clang-tidy issues. 2021-02-22 14:24:26 -06:00
asarium 02b1e38cd7 Add variables concept to expressions
This also includes the necessary setup work for using "position" and
"direction" in action expressions.
2021-02-22 18:39:06 +01:00
asarium 851a7663a8 Rework actions to use definitions
This introduces action definitions which can then be instantiated to
form actual actions with expressions as their parameters.
2021-02-22 18:02:22 +01:00
asarium bcaa7934c6 Allow implicit conversion from int to float
This is generally a safe operation and will make the system a bit easier
to use.
2021-02-22 18:02:22 +01:00
asarium 1d6052e81e Rework function handling 2021-02-22 18:02:22 +01:00
asarium a5a91b5acf Add Action expressions
This is a parser for a very simple language to allow for execution of
dynamic expressions with return values for use as action parameters. The
only "dynamic" part this currently supports are random ranges but more
features are planned for the future.
2021-02-22 18:02:22 +01:00
asarium aa7ea238b9 Update GTest 2021-02-22 18:02:22 +01:00
m!m 8b23ccdf2e Merge pull request #3061 from asarium/feature/actionSystem
Add dynamic action programming system
2021-02-22 18:00:58 +01:00
Baezon 5004f6ab32 Merge remote-tracking branch 'upstream/master' into ai-multilock 2021-02-21 22:15:31 -05:00
Baezon adea41e690 clarity edits 2021-02-21 21:56:34 -05:00
Baezon d463db3742 Merge remote-tracking branch 'upstream/master' into generic-debris-enhancement 2021-02-21 21:31:59 -05:00
Martin Merget 4305aed38d Factor out duplicate creation/opening code 2021-02-22 01:39:55 +01:00
z64555 f51502e4ae Make qtFred and Fred changes consistent with each other. 2021-02-21 18:16:55 -06:00
the-maddin 34eed12988 Extract shared code from AudioStream::Create and CreateMem
Also cleaned up control flow on failure as far as used macros allow.
2021-02-22 00:58:41 +01:00
the-maddin 60775e73b5 Fix MSVC builds v2 2021-02-21 22:30:17 +01:00
the-maddin e55b246756 Fix MSVC builds 2021-02-21 22:14:39 +01:00
the-maddin 438f48c835 Fix compiler/type issue 2021-02-21 21:51:34 +01:00
asarium 8f88801646 Add dynamic action programming system
This system adds the code necessary for letting content creators specify
complex events by specifying a simple, program-like sequence of
operations that will be executed by the engine when a certain event is
triggered.
2021-02-21 21:29:02 +01:00
the-maddin afc9e8132a renamed memfile functions & struct 2021-02-21 20:53:52 +01:00
the-maddin 371aaa1107 Moved, documented and renamed struct MemFileCursor 2021-02-21 20:46:55 +01:00
the-maddin ab7e6cbbe1 add LuaErrors for invalid input, fix off-by-one 2021-02-21 20:37:02 +01:00
m!m 340edd5ec0 Merge pull request #3239 from asarium/build/updateBuildImage
Update Linux build image and make consistent
2021-02-21 14:36:27 +01:00
asarium 88e6469fb4 Update Linux build image and make consistent
For some reason the last update of the PR pipeline did not update the
other workflows as well so we had some minor inconsistencies.

This should hopefully fix the nightly build issues for real this time.
2021-02-21 14:02:32 +01:00
BMagnu fd60dd342f Add vanish Lua function to some objects (#3238)
* Add vanish function to some objects

* Modify vanish function return. Modify fireball access

* Remove dedunant check for ship vanish
2021-02-21 11:59:49 +00:00
Asteroth dcd38539c2 Merge pull request #3237 from Baezon/fix-turret-inaccuracy
Bugfix to turret_inaccuracy
2021-02-21 00:19:39 -05:00
Baezon 70265c6f63 bugfix turret inaccuracy 2021-02-20 23:41:30 -05:00
JohnAFernandez 19b3f85eea Merge pull request #3220 from Baezon/turret-inaccuracy
Add turret-set-inaccuracy SEXP
2021-02-20 21:07:47 -05:00
JohnAFernandez 873ec133b4 Merge pull request #3204 from Baezon/icons-parsing-overhaul
Overhaul briefing icon parsing
2021-02-20 20:57:47 -05:00
Goober5000 88f6312fd8 Merge pull request #3234 from Goober5000/sim_hull_scripting
add SimHitpointsLeft
2021-02-20 16:51:11 -05:00
Goober5000 69c1398368 add SimHitpointsLeft 2021-02-20 16:13:14 -05:00
m!m 043b1d34c8 Merge pull request #3232 from asarium/fix/linuxNightly
Try to fix linux nightly builds
2021-02-20 21:34:51 +01:00
m!m 1226c894ed Merge pull request #3233 from asarium/build/githubRegistry
Store standalone image on GitHub
2021-02-20 21:34:40 +01:00
asarium 0fb7143f12 Store standalone image on GitHub
Docker Hub is going into a weird direction with their rate limits and
the GitHub Container Registry is better in that regard.

Old images will stay in Docker Hub for the time being though.
2021-02-20 18:34:25 +01:00
Fabian Woltermann 57c593f74e Merge pull request #3231 from Goober5000/fix_eval_numeric_sexp
fix mn.evaluateNumericSEXP
2021-02-20 14:54:53 +01:00
asarium cf3faa35cd Try to fix linux nightly builds
The default Python version appears to be too recent so let's try to have
this action use the python package that is installed in our build image.
2021-02-20 14:44:01 +01:00
Goober5000 2429b99184 fix mn.evaluateNumericSEXP
This is a follow-up to #2687.  The final implementation of evaluateNumericSEXP different from the testing implementation in a small but crucial way that prevented it from actually working.  Since it used `eval_num`, it didn't evaluate the specified SEXP node but rather the CAR (first element) of the node list.  This fixes that by putting the node in a temporary SEXP list so that `eval_num` will look in the right place.
2021-02-20 01:40:55 -05:00
Shivansps 2ee128cd88 Merge branch 'arm_fixes' 2021-02-19 21:02:53 -03:00
Shivansps a2b349855e Merge pull request #1 from scp-fs2open/master
Update fork
2021-02-19 20:53:22 -03:00
Baezon 0f451e6190 more comments 2021-02-19 10:45:32 -05:00
the-maddin 366a96bdd4 Expose audiostreams from memory to LUA
Allow scripts to play any LUA binary string containing valid WAV data.
Useful for TTS data passed in via LUASockets.
2021-02-19 01:22:24 +01:00
the-maddin 8770ad74f8 Add support for audiostream from in-memory sound 2021-02-19 01:19:05 +01:00
the-maddin 68d5467e2a Add support for in memory sound 2021-02-19 01:16:39 +01:00
the-maddin ac2fa61f6e Add support for in-memory sound
Using the memory backend, treat sound in memory like sound in cfiles.
2021-02-19 01:14:40 +01:00
the-maddin 2060a1dabe Add backend for in-memory audio
FFmpegContext can now also hold a cursor over a vector of bytes instead of a cfile to store sound data in it.
Appropriate creation, reading seeking functions included.
2021-02-19 01:10:43 +01:00
Fabian Woltermann b561156f09 Merge pull request #3226 from Goober5000/tocase
additional case functions and checks
2021-02-18 14:08:34 +01:00
Goober5000 f3bca4384f additional case functions and checks
This refactors the tolower/toupper code to use standards-conformant logic, and also adds some helpful utility functions.  Regular tolower/toupper must be supplied a value that can be represented as `unsigned char`, but the std:: functions are a bit more robust.
2021-02-18 04:23:08 -05:00
Fabian Woltermann c00ff88a5a Merge pull request #3223 from Goober5000/case_insensitive_ships
make the ship lookup case insensitive
2021-02-18 09:10:57 +01:00
Goober5000 866b64ff8d maybe this works better 2021-02-17 12:12:17 -05:00
Goober5000 3acd74e894 make the ship lookup case insensitive
Does what it says on the tin.  Fixes #3221.
2021-02-17 11:31:45 -05:00
Goober5000 ffa6e594e7 Merge pull request #3222 from Goober5000/perform_actions_documentation
add clarification
2021-02-16 19:27:30 -05:00
Goober5000 39f9df11f7 add clarification 2021-02-16 18:35:11 -05:00
Baezon a606f2cafa modernize-use-auto 2021-02-16 10:52:56 -05:00
Baezon 592855c35d NULL -> nullptr 2021-02-16 02:27:11 -05:00
Baezon 3797171fb0 Merge remote-tracking branch 'upstream/master' into turret-inaccuracy 2021-02-16 02:23:45 -05:00
Baezon 028e40a43b add turret-set-inaccuracy sexp 2021-02-16 02:21:54 -05:00
Goober5000 36ea4c225b Merge pull request #3219 from Goober5000/model_instance_in_fred
add model instance support to FRED rendering
2021-02-15 09:33:55 -05:00
Goober5000 24df0efb6e add model instance support to FRED rendering
This changes FRED to properly initialize a model instance on ship creation and also use that instance when rendering the ship.  This prevents destroyed submodels from appearing.  Fixes #3212.
2021-02-15 08:34:12 -05:00
Fabian Woltermann db2eba92d5 Merge pull request #3213 from Goober5000/message_list_chain
add send-message-chain
2021-02-15 10:50:05 +01:00
Fabian Woltermann dd0bb3ceca Merge pull request #3214 from Goober5000/fix_event_editor_closing
fix event editor closing on key press
2021-02-15 10:15:18 +01:00
Fabian Woltermann f9da8c7db2 Merge pull request #3217 from Goober5000/fix_event_editor_delete
fix event node deletion behavior
2021-02-15 10:14:51 +01:00
Goober5000 82a93e9e47 fix event node deletion behavior
The defensive coding in #3191 against illegal cut/delete operations was a little too defensive.  This properly allows deletion of events when necessary, and it still guards against a Cut operation being improperly called due to a shortcut key press.

Fixes #3216.
2021-02-14 17:12:22 -05:00
z64555 754f0ea876 Removed unused local variable. 2021-02-14 10:33:49 -06:00
z64555 9145922cb1 Fix default_item to use default_bindings. 2021-02-14 09:59:36 -06:00
z64555 47e19207f9 Merge branch 'master' into controls3
Resolved Conflicts:
	code/controlconfig/controlsconfig.cpp
	code/controlconfig/controlsconfig.h
2021-02-14 09:48:55 -06:00
Goober5000 41f9dbb003 fix event editor closing on key press
Restores the MFC functions that were taken out in #3073.  These functions appeared redundant, but they were actually necessary to intercept the MFC handling of Enter and Escape.  In addition to fixing that behavior, this PR also adds some clarifying comments and renames some functions to prevent confusion.
2021-02-14 01:32:03 -05:00
Goober5000 c067651498 add send-message-chain
Implements send-message-chain as described in issue #3185.  Also fixes the default argument for message priority, and mirrors the default argument fix to qtFRED.
2021-02-14 00:23:57 -05:00
JohnAFernandez 2361152399 Merge pull request #3211 from JohnAFernandez/Messaging_Switch_to_Normal
Make "Normal" the default option for Messages
2021-02-13 23:28:47 -05:00
JohnAFernandez 0318e3f851 Make "Normal" the default option for Messages
Moves messages to the more suitable default of normal.  Also adds clarifying documentation.
2021-02-13 15:56:09 -05:00
Goober5000 d21f7b8915 Merge pull request #3208 from PhantomHoover/fix/misc-rand-sizes
Properly fix static_rand()'s range and account for this in functions that were misusing it
2021-02-13 14:32:18 -05:00
Phantom Hoover 640640b4b4 Properly fix static_rand()'s range and account for this in functions that were misusing it 2021-02-13 16:06:47 +00:00
Fabian Woltermann f87cf7df23 Merge pull request #3207 from Baezon/waypoint-complete-fit-bugfix
Fix for waypoint completion with FIT
2021-02-13 17:01:25 +01:00
Asteroth 616e6a9bc0 Merge pull request #3180 from Baezon/split-collision-light-width
Split beam width for collision purposes and lighting purposes
2021-02-13 02:15:17 -05:00
Goober5000 303787d97c Merge pull request #3206 from Goober5000/retail_hybrid_translation_behavior
restore retail behavior of XSTR
2021-02-12 17:48:23 -05:00
MageKing17 db2bd97669 Merge pull request #3205 from MageKing17/bugfix/controlconfigoverride-default-preset
If the first #ControlConfigOverride isn't named, use "default".
2021-02-12 14:29:01 -08:00
Baezon 5e38f3c0d4 fit waypoint bugfix 2021-02-12 11:12:24 -05:00
Goober5000 1e756d1a67 restore retail behavior of XSTR
This is a follow-up to #2390.  Retail used a weird hybrid approach where internal strings were translated but external strings were not.  This restores that behavior by adding another language, LCL_RETAIL_HYBRID, which is the default.  The game can still be run in completely untranslated or completely translated mode.

All three modes have been tested and translate strings, or not, as expected.  The `$Use tabled strings for the default language:` flag has also been tested and still works.
2021-02-11 19:47:12 -05:00
Baezon ec274d58db clang-tidy 2021-02-10 21:49:49 -05:00
Baezon 682c15d6b1 clang-tidy curse you 2021-02-10 21:41:37 -05:00
MageKing17 29fbebde16 If the first #ControlConfigOverride isn't named, use "default".
This causes it to replace the first preset in the list, which more closely approximates the old behavior.
2021-02-10 17:58:08 -08:00
JohnAFernandez bd7450c4e6 Merge pull request #3198 from Baezon/landmark-logging
Add 'landmark' logging
2021-02-10 20:40:40 -05:00
Baezon b843a5be3a clean up 2021-02-10 18:15:48 -05:00
Baezon be44e287ee overhaul brief icon parsing 2021-02-10 17:36:37 -05:00
Goober5000 af16a6bc42 Merge pull request #3191 from Goober5000/fred_indents_and_colors
Additional FRED features
2021-02-10 09:45:07 -05:00
Fabian Woltermann 6b7429ab5d Merge pull request #3192 from Baezon/turret-forced-target
Add turret-set-forced-target SEXP
2021-02-10 11:39:16 +01:00
Fabian Woltermann d4be72c49b Merge pull request #3203 from JohnAFernandez/Really-fix-hud-config-crash
Actually fix radar range turning to -1 after hud gauge config
2021-02-10 11:36:30 +01:00
JohnAFernandez 86308bbf34 Actually fix radar range turning to -1 after hud gauge config
Problem was caused by negative array index write in this section of code.
2021-02-10 00:05:27 -05:00
Goober5000 3d6124c7ad Merge pull request #3144 from Goober5000/fix_look_at
reimplement look_at
2021-02-09 21:48:52 -05:00
Baezon 6357c2a856 clang tidy 2021-02-07 23:40:14 -05:00
Allen A. Babb 0f1c5e0a42 Merge pull request #3201 from z64555/unhide_chocolate
Unhide chocolate - Revert default-disable of controls unusable with retail data.
2021-02-07 17:02:32 -06:00
z64555 cb692b22ba Add note comment to the CCI_builder. Controls that don't work in retail should be default disabled, but this relies on the coders making them to get it set the first time. 2021-02-07 14:23:44 -06:00
z64555 0b03c3f672 Add me to the cool kids club. Wait, no, not that one. 2021-02-07 14:15:35 -06:00
z64555 15d3dde5fa Unhide non-retail controls by default. Even though retail data can't make use of most of them, some mods may count on their visibility. 2021-02-07 14:06:27 -06:00
Baezon 24947b64d7 split light and collision width 2021-02-06 22:00:45 -05:00
Goober5000 61bb44d07b Merge pull request #3200 from wookieejedi/test-rotation-fix
Fix Bug with Reading Turret Rotation Axes
2021-02-06 14:44:07 -05:00
Goober5000 aa3eb4d42c Merge pull request #3199 from Goober5000/vecmat_projecc
add useful function
2021-02-06 14:19:36 -05:00
wookieejedi 2cdc74264c Fix Bug with Reading Turret Rotation Axes
Multipart turrets that have no rotation specified in PCS don't have `movement_type` assigned properly within `modelread.cpp`, which eventually leads to a fatal crash. This two line fixe properly specifies the `movement_type` and fixes the crash. Tested and confirmed. Thanks to @Goober5000 for the assistance and troubleshooting.
2021-02-06 13:59:23 -05:00
Goober5000 dd92a0f0bb add vm_vec_is_normalized and use it in several places 2021-02-06 13:46:54 -05:00
Goober5000 e699d991d1 add useful function 2021-02-06 00:19:57 -05:00
wookieejedi ede8c6a172 Merge pull request #3197 from wookieejedi/expose-countermeasure-firewait
Expose Additional Countermeasure Options to Modders
2021-02-06 00:08:36 -05:00
JohnAFernandez ba9205cd35 Make sure to pull from the bounds of the vector. 2021-02-05 23:40:24 -05:00
Baezon b7bd8d6fbb moar tweaks 2021-02-05 15:28:14 -05:00
Baezon 7015818ea5 review tweaks 2021-02-05 12:56:03 -05:00
wookieejedi c831235cd3 add warnings 2021-02-05 11:39:50 -05:00
Baezon a6b19706eb 'landmark' logging 2021-02-05 03:49:39 -05:00
wookieejedi de17df207a specify values for AI and use multipliers for fail and succeed 2021-02-04 22:38:06 -05:00
wookieejedi 5116471d8d simplify logic 2021-02-04 13:40:23 -05:00
wookieejedi e01bd28e79 Expose Additional Countermeasure Options to Modders
This PR provides modders with additional options to alter countermeasure values. Previously, countermeasures had a fixed, hardcoded fire wait time of 333 milliseconds, regardless of what `$Fire Wait:` was specified. Also, the AI would wait a fixed delay between firing of failed countermeasure launches and successful countermeasure launches. For successful launches the AI would double the fire wait. Also, Friendly ships would only use a fixed constant value for countermeasure firing chance, and not the value based on their class specific AI profile.

This PR exposes those values with the following options:
•	Add main AI table flag: `Friendly Ships Use AI Profile Countermeasures Firing Chance`. This will allow Friendly ships to use their AI class profile countermeasure firing chance instead of the default fixed value from main AI table.
•	Add value in CM section of weapons table: Countermeasures use fire wait time `+Use Fire Wait`. This is a boolean that allows the countermeasure’s fire wait to actually use what is specified in the `$Fire Wait:` section of that weapon.
•	Add value in CM section weapons table: `+Fail Delay Equals Fire Wait`. The delay between failed countermeasure launches is set to use the fire wait value.
•	Add value in CM section weapons table: `+Successful Launch Delay Multiplier`. This allows modders to set the value that is multiplied to fire wait for successful countermeasure launches.
2021-02-04 13:12:02 -05:00
Asteroth 994e42a27d Merge pull request #3175 from Baezon/trail-decay-exponent
Non-linear Trail decay and Texture stretch
2021-02-04 12:09:22 -05:00
wookieejedi 74c9139c1c Merge pull request #3195 from wookieejedi/fix-retail-cap-ship-speed
Fix speed differential for retail cap ships
2021-02-03 19:26:19 -05:00
wookieejedi 1d7070cf12 add claryifying parentheses 2021-02-03 18:18:04 -05:00
JohnAFernandez 19c19f1262 Remove the Unused Just_updated Flag
This flag is vestigal.  It was likely used in the FS1 codebase and then was not removed by the rushed FS2 multi team.  Whether or not an object uses physics_sim is determined earlier in `multi_oo_is_interp_object()`
2021-02-03 18:00:16 -05:00
wookieejedi 754f4a309c add deprecation check 2021-02-03 17:46:06 -05:00
Asteroth 83bd14586f Merge pull request #3179 from Baezon/empty-sound-fix
Don't search for empty sound names
2021-02-03 17:41:08 -05:00
wookieejedi 828a993eb6 Fix speed differential for retail cap ships
As astuetly determined by @Baezon `the speed differential for retail cap ships is caused by 'ships with no shields can manage ETS', being part of the bugfixes with target version`. This PR adds two flags per Discord suggestion, one for all ships and one for only small ships.
2021-02-03 17:14:39 -05:00
Asteroth 69b319a7d6 Merge pull request #2591 from Baezon/homing-primaries
Add homing primaries
2021-02-02 21:48:16 -05:00
Baezon 6414172898 Merge remote-tracking branch 'upstream/master' into homing-primaries 2021-02-02 21:15:05 -05:00
Baezon e78fccc294 unused variables 2021-02-02 20:49:33 -05:00
Baezon 54f1a86a5a clena up and finalization of subsys targeting 2021-02-02 20:06:40 -05:00
Baezon 8c387d7507 tentative subsys targeting 2021-02-02 11:31:05 -05:00
Baezon 476e916945 Merge remote-tracking branch 'upstream/master' into turret-forced-target 2021-02-01 22:12:50 -05:00
Asteroth 1d131403d5 Merge pull request #3176 from Baezon/damage-incidence-angle
Angle-based damage multiplier
2021-02-01 20:54:20 -05:00
Baezon e7cab7cb42 clang-tidy dont hurt me no mo 2021-02-01 14:24:44 -05:00
Baezon 7b2c8304ff typo 2021-02-01 13:25:44 -05:00
Goober5000 b6314feb29 add comment 2021-02-01 02:24:54 -05:00
Goober5000 a124722966 qtfred 2021-02-01 00:46:17 -05:00
Goober5000 47543ac7d4 implement keyboard shortcuts, implement mission saving for bg color 2021-02-01 00:46:17 -05:00
Goober5000 262b45188a resizable Event Editor 2021-02-01 00:46:17 -05:00
Goober5000 c0446cd03c color stuff works pretty well 2021-02-01 00:46:17 -05:00
Goober5000 bc37fda89e reorganize event annotations a bit
preliminary work for background color and changing indent
implement a sort-of-working background color change
2021-02-01 00:46:17 -05:00
Goober5000 275a439091 Merge pull request #3190 from Goober5000/quick_annotation_fix
mission save bugfix
2021-02-01 00:43:55 -05:00
Goober5000 f475ea4d25 mission save bugfix
Somehow during the annotation merge the save got borked.  This fixes mission saving.
2021-02-01 00:09:55 -05:00
Goober5000 72d2f9f1a1 reimplement look_at
This PR re-implements the look_at feature, which has been broken for many years.  A look-at rotation is a type of intrinsic_rotation, just like dumb-rotations. The same code handles both; the only difference is whether submodel_rotate or submodel_look_at is called to apply the actual movement.

The previous look_at parsing code has been optimized by performing the name-to-submodel resolution when the model is actually parsed, instead of when the first look-at rotation is called.  This avoids the need to store a name in the submodel struct and also avoids cluttering the look_at function.

This PR is essentially bookkeeping, except for the submodel_look_at method.  This method takes advantage of the submodel rotation upgrade and calculates angles in almost the same way as the new turret rotation code.  It's much more elegant, much less hackish, and works for all detail levels.
2021-01-31 14:31:40 -05:00
Goober5000 8ab3cf240b Merge pull request #3189 from Goober5000/fix_compilation_error
fix compilation
2021-01-31 14:30:16 -05:00
Goober5000 450900d2b5 fix compilation
Quick hotfix due to two branches being merged that were both compatible with master but not with each other.
2021-01-31 13:57:12 -05:00
Goober5000 68b6795d5a Merge pull request #3079 from Goober5000/stuff_number
convert float parsing to use strtof
2021-01-31 13:18:27 -05:00
Goober5000 868715867d Merge pull request #3056 from Goober5000/model_rotation_arbitrary_axis
Allow submodels to rotate around an arbitrary axis
2021-01-31 13:17:27 -05:00
Baezon 9b7cc77b55 revert multi compatability :( 2021-01-31 13:11:27 -05:00
Baezon d3355b0783 experimental multi compatability 2021-01-31 12:29:25 -05:00
m!m 6f382ce0d9 Merge pull request #3188 from asarium/fix/stdApiCrash
Fix crash in server REST API when omitting framecap
2021-01-31 17:02:19 +01:00
asarium dbfb5b9d34 Fix crash in server REST API when omitting framecap
Since the return value of the json library is null in that case it
crashed the server when no value was specified.
2021-01-31 16:08:33 +01:00
Allen A. Babb b3edc683fc Merge pull request #2907 from z64555/feature/controls2
Controls 0, 1, and 2 - Vectorize Controls_config, Refactor Control Presets, and Use Undosys for undo/redo actions done in the Controls configuration menu.
2021-01-30 10:04:58 -06:00
Asteroth f1ff6ebf55 Merge pull request #2870 from Baezon/armor-types-beam-weapon
Use armor/damage types for beam-weapon damage
2021-01-30 02:33:13 -05:00
Baezon f95e51b047 dont search for empty names 2021-01-30 00:05:17 -05:00
wookieejedi 213d20f7ef Merge pull request #3177 from Baezon/better-missile-avoid
Improved missile avoidance
2021-01-29 22:47:01 -05:00
Goober5000 a10e456de3 Merge pull request #3073 from Goober5000/fred_comments
Fred comments
2021-01-29 17:38:31 -05:00
Goober5000 5187ea5041 Revert "Disable Qt projects since downloads are broken"
This reverts commit 4aa33c7b3e from PR #3160.
2021-01-29 16:57:05 -05:00
z64555 9b42819dce Address Clang-Tidy issues. 2021-01-29 15:09:54 -06:00
z64555 c1d1a965c6 Think I got all of the index swapped. *Scrolls right* oh. 2021-01-29 04:40:58 -06:00
Baezon 89a8cbcbae review tweaks 2021-01-29 01:04:15 -05:00
z64555 b97e804123 Address signed/unsigned complaint. 2021-01-28 23:54:44 -06:00
Asteroth e0dd807bb4 Merge pull request #3145 from EatThePath/fix-type-d-beam-pulse-lighting
Stop including tube lights between anti-fighter beam pulses
2021-01-29 00:39:27 -05:00
Baezon 888c14aeaf flip max and min 2021-01-28 23:45:06 -05:00
Baezon ab64183981 Merge remote-tracking branch 'upstream/master' into generic-debris-enhancement 2021-01-28 22:57:42 -05:00
Baezon 055784dcff clean up swarm missiles 2021-01-28 22:33:01 -05:00
Baezon 4b3a1a8d84 unused variables 2021-01-28 20:39:29 -05:00
Baezon 91be428596 missing '$' 2021-01-28 20:27:36 -05:00
Baezon 0c0a9e4f26 typo 2021-01-28 20:24:54 -05:00
z64555 d6672d01cf Don't count an item in the reset check if the item is disabled.
* Remove errant Assert()
* Drop leading whitespace of preset $Name field
* Fix do_reset behavior due to incorrect default binding check.  Fix is possibly a backport.
* When $Text is specified for a bind item, set the XStr index to 0.
2021-01-28 19:16:07 -06:00
Goober5000 43ae0e3575 qtfred 2021-01-28 19:59:20 -05:00
Goober5000 2be4818d24 tweak parsing since we want to read annotations generally 2021-01-28 19:17:08 -05:00
Goober5000 9bebdbb575 rename event_comment to event_annotation 2021-01-28 18:56:15 -05:00
Goober5000 04cf220f2d comment capability for FRED
Add FRED comments. These aren't the typical source-code style comments that are embedded in mission or table files; these are regular strings that are stored as mission data. You might think of them as annotations. Right-click on any node in the event tree and click on Edit Comment to add one. The tree node will then show a different icon and the comment will be visible as a tooltip when you mouse over the node text.
2021-01-28 18:25:19 -05:00
Goober5000 61c7cc2856 Merge pull request #3141 from JohnAFernandez/Hud-config-screen-is-weird
Make sure the Hud_config_inited is reset when the screen is exited.
2021-01-28 14:29:29 -05:00
Baezon 824c537bd2 Merge remote-tracking branch 'upstream/master' into ai-multilock 2021-01-28 12:25:35 -05:00
Asteroth d1f0f5002f Merge pull request #2775 from Baezon/burst-seed
Implement Beam Flags and some adjustments to burst handling
2021-01-28 11:51:30 -05:00
Baezon d3d016602d rename beam_flags -> beam_info_flags 2021-01-28 02:46:40 -05:00
Baezon f9e44f545e ignore empty sounds 2021-01-27 23:31:38 -05:00
Baezon 52f57df064 NULL -> nullptr 2021-01-27 23:25:19 -05:00
Baezon 61931520d1 Merge remote-tracking branch 'upstream/master' into generic-debris-enhancement 2021-01-27 23:06:45 -05:00
Baezon 229dd4c63c clean up 2021-01-27 20:59:01 -05:00
Baezon 7515422979 clarity parentheses 2021-01-27 20:14:33 -05:00
Baezon eb1d748907 safety 2021-01-27 17:25:28 -05:00
Baezon b87d3c65a0 Merge remote-tracking branch 'upstream/master' into better-missile-avoid 2021-01-27 15:11:08 -05:00
Baezon 8d841fa1cc clean up 2021-01-27 14:48:41 -05:00
Goober5000 537c4b6f24 Merge pull request #3172 from BMagnu/hotfix_keynames
Fix special char hex codes for utf8
2021-01-27 13:52:15 -05:00
Goober5000 f9a6c86cad Merge pull request #3162 from Goober5000/ship_create_display_name
default display names for script/sexp-created ships
2021-01-27 13:40:16 -05:00
Goober5000 db466048ea Merge pull request #3168 from Goober5000/debris_colgroup_check
add collision group checks to debris
2021-01-27 13:40:05 -05:00
m!m 6952b58846 Merge pull request #3174 from asarium/build/bumpVersion
Bump version
2021-01-27 19:12:45 +01:00
Baezon 284ad2941c Merge remote-tracking branch 'upstream/master' into better-missile-avoid 2021-01-27 12:53:24 -05:00
Baezon 76d295d2bc Merge remote-tracking branch 'upstream/master' into damage-incidence-angle 2021-01-27 12:47:55 -05:00
Baezon 66c38c43c6 clean up 2021-01-27 12:43:32 -05:00
asarium 2161ab563d Bump version 2021-01-27 17:55:37 +01:00
Baezon 6cd5510bd1 clean up 2021-01-27 10:49:32 -05:00
Birk Magnussen 25cca192db Switch Key Names from internal encoding to unicode in utf8 mode 2021-01-26 19:09:20 +09:00
Birk Magnussen e6067f756a Fix special char hex codes for utf8 2021-01-26 13:53:25 +09:00
Goober5000 6d9e9a2e3d add collision group checks to debris
Collision groups were checked between ships, weapons, and beams, but not debris.  This adds debris.
2021-01-24 01:07:11 -05:00
David Gibson 373d119f1a modernize nullptr for tidy 2021-01-23 21:58:47 -06:00
David Gibson 7cb2338325 removed now-superflous element counting loop from gr_opengl_deferred_lighting_finish 2021-01-23 21:10:54 -06:00
David Gibson ddcc94b0da Extended the tube light cylinder volumes for deferred lighting to encompass the end cap spheres, removed those spheres, and adjusted the shader handling of tube lights to account for this. 2021-01-23 20:56:07 -06:00
David Gibson 9a866434b8 Removed the end light volumes from the defered lighting setup for tubelights. 2021-01-23 17:31:12 -06:00
Goober5000 37e92e01b6 default display names for script/sexp-created ships
Now that the hash truncation logic is part of the ship display name, ships created by script or sexp should check this as well.
2021-01-22 23:06:48 -05:00
m!m 60047116fd Merge pull request #3160 from asarium/ci/disableQt
Disable Qt projects since downloads are broken
2021-01-22 16:54:54 +01:00
asarium 4aa33c7b3e Disable Qt projects since downloads are broken 2021-01-22 16:26:44 +01:00
m!m 373dbeb63f Merge pull request #3159 from Baezon/previous-bank-fix
Fix a bug with previous_bank and ship class swapping
2021-01-21 22:06:30 +01:00
m!m 361cc76c30 Merge pull request #3154 from Goober5000/redo_3149
fix a rare crash in the tech room
2021-01-21 21:47:53 +01:00
Baezon 3f27183d6d also reset previous bank 2021-01-21 01:04:13 -05:00
Baezon 4e5c74d729 add trail alpha decay exponent 2021-01-19 22:44:08 -05:00
Goober5000 3d976f53b4 fix a rare crash in the tech room
The tech room loop checked that all the lines could fit in the available screen real estate, but it didn't check to see that the number of lines was less than the array capacity.  Normally this never happened, but certain mods which use smaller fonts will overflow the limit.  This adds a proper bounds check and also increases the bounds so that more of the smaller lines can be used.
2021-01-17 11:21:41 -05:00
m!m e5af389803 Merge pull request #3150 from scp-fs2open/revert-3149-fix_techroom_crash
Revert "fix a rare crash in the tech room"
2021-01-17 17:14:30 +01:00
m!m ba0f2e7f83 Revert "fix a rare crash in the tech room" 2021-01-17 11:55:59 +01:00
Goober5000 f0987a4ad1 Merge pull request #3149 from Goober5000/fix_techroom_crash
fix a rare crash in the tech room
2021-01-17 02:15:55 -05:00
Goober5000 61dd4356f0 fix a rare crash in the tech room
The tech room loop checked that all the lines could fit in the available screen real estate, but it didn't check to see that the number of lines was less than the array capacity.  Normally this never happened, but certain mods which use smaller fonts will overflow the limit.  This adds a proper bounds check and also increases the bounds so that more of the smaller lines can be used.
2021-01-17 01:21:52 -05:00
David Gibson d9895455cd Addressed feedback and tidy issues with AA beam pulse lighting fixes 2021-01-15 13:09:43 -06:00
Baezon d9a7e786b5 Merge remote-tracking branch 'upstream/master' into burst-seed 2021-01-15 12:52:25 -05:00
David Gibson 40e7ce012e =Added some important brackets I negligently omitted 2021-01-15 00:28:59 -06:00
David Gibson 31227c659a added a check in beam_move_all_post() to avoid adding tube lights when anti-fighter beams are between pulses. Also added documenting comments to beam_type_b_get_status 2021-01-14 23:59:13 -06:00
JohnAFernandez 679f7f20d7 Switch the correct ammo variable.
The previous pr was supposed to fix what ammo capacity the ship was reloaded to, but instead it was changing how much ammo was in the magazine.
2021-01-14 09:23:52 -05:00
JohnAFernandez ff9b2fd6cd Make sure the Hud_config_inited is reset when the screen is exited. 2021-01-13 21:20:27 -05:00
Fabian Woltermann a939a73c14 Merge pull request #3139 from z64555/hud_config
More safety checks for the HUD_config struct
2021-01-13 22:20:43 +01:00
Goober5000 487aad8bbe a bit of cleanup and reorganization/simplification 2021-01-13 14:01:34 -05:00
Goober5000 554bbb884d remove angles from the submodel instance 2021-01-13 14:01:34 -05:00
Goober5000 020f14fb51 allow rotating submodels to rotate around an arbitrary axis 2021-01-13 14:01:28 -05:00
Goober5000 98e501acc7 remove the orientation field for submodels
Change the `orientation` field to `frame_of_reference` and remove it from submodel instance calculations.
2021-01-13 13:52:48 -05:00
Goober5000 3f5ad1239d Merge pull request #3140 from Goober5000/techroom_update
make model_set_up_techroom_instance a bit more robust
2021-01-13 13:51:47 -05:00
z64555 4e715352c9 Increment int strikes per CSG warning, as done in PLR code
* Use ReleaseWarnring instead of Warning
* Use correct upper boundry check logic on HUD_config::mail_color
2021-01-13 12:48:24 -06:00
Goober5000 5f538fa514 make model_set_up_techroom_instance a bit more robust
Follow-up to #3137.  I missed two important details in the first implementation: the triggered animation needs to be an "initial position" type, and `model_update_instance` needs to be run on all subobjects, not just turrets.

This should really fix #3123.  I still can't see the destroyed collector, but the Rahu no longer flickers when it spins around.
2021-01-13 13:17:31 -05:00
Goober5000 506ba911d0 Merge pull request #3137 from Goober5000/tech_room_instance
properly use model instances for tech room and briefing popups
2021-01-13 11:03:25 -05:00
z64555 f44cfa06c8 Adds more safety checks for PLR and CSG reading for the HUD_config structure.
* Adds a #define for the HC_color array size
* Doxy's the HUD_config struct
2021-01-12 23:12:20 -06:00
Goober5000 eeb6f5b091 properly use model instances for tech room and briefing popups
These two situations mostly relied on the obsolete model code which didn't include model instances.  Data for submodel positions and for whether a submodel is blown off are now stored exclusively in model instances, not the model itself.

This fixes #3124.
2021-01-12 23:15:37 -05:00
Fabian Woltermann 18cb07dc72 Merge pull request #3134 from EatThePath/tube-light-attenuation-recalc
Properly recalculate tube light attenuation
2021-01-11 20:28:19 +01:00
JohnAFernandez 3a4df0d89a Send them to Github instead of Mantis 2021-01-11 14:06:03 -05:00
JohnAFernandez d33f9db1f0 Move Standalone Running statement to after the init of Debug Statements 2021-01-11 14:05:01 -05:00
JohnAFernandez 75b26ef94b Fix unfocused multi interpolation inaccuracies (#3129)
Remove One Source of Client and Server having Different Timing

Multiplayer *must not* have its time affected by being in the background, because their clocks will come out of sync and movement from an out of focus multiplayer instance will appear to move in slow motion.  This fixes the timing discrepancy by only doing os_sleep when unfocused when in single player.
2021-01-11 14:04:23 -05:00
JohnAFernandez 398f4d9053 Remove Unused ClientDamage Commandline Option (#3132)
This option was likely part of an attempt to fix multi that never went anywhere. We now have rollback, which is on by default.
2021-01-11 14:02:52 -05:00
David Gibson 069947e397 Added a recalculation of tube light attenuation in fragment shader after proper distance is determined. fixes slash beam and penetration lighting issues 2021-01-11 11:55:45 -06:00
Fabian Woltermann 580d67eca7 Merge pull request #3133 from Baezon/slow-weapon-collide-fix
Fix collision culling for slow/accelerating weapons
2021-01-11 09:15:53 +01:00
Baezon 4bf93e08df fix collision culling for slow weapons 2021-01-11 00:45:42 -05:00
Fabian Woltermann 6c475130d1 Merge pull request #3126 from The-E/fix/ambient_light_in_lab
When setting the ambient factor in the lab, recalculate ambient lighting
2021-01-10 20:11:13 +01:00
Fabian Woltermann 6f0dec4169 When setting the ambient factor in the lab, recalculate ambient lighting 2021-01-10 19:44:24 +01:00
Goober5000 3b99402a0a Merge pull request #3121 from Goober5000/background_warning
make FRED validate all backgrounds, not just the active one
2021-01-10 09:21:45 -05:00
Fabian Woltermann 6c6ade116f Merge pull request #3120 from Goober5000/fix_3101
fix 3101
2021-01-10 12:43:47 +01:00
Fabian Woltermann 4f6c834587 Merge pull request #3122 from Baezon/glowpoint-timing-fix
Fix a bug with glowpoint timing
2021-01-10 12:42:42 +01:00
Baezon c486843e5f fix a bug with glowpoint timing 2021-01-10 03:11:25 -05:00
Goober5000 ec93ac4c0e fix 3101
Always update the ship class and loadout information in a ship's parse object, even if it is present at mission start.
2021-01-10 01:53:14 -05:00
Goober5000 2307d05086 make FRED validate all backgrounds, not just the active one
The background validation checks are somewhat convoluted, and misleading with multiple backgrounds, so this PR disables the standard main-background check if FRED is running.  It then adds a new FRED-specific background check that covers all backgrounds.

Additionally, this PR fixes a bug in an error message in `stars_get_first_valid_background`.

Fixes #3116.
2021-01-10 01:48:43 -05:00
Goober5000 d3d48ee6fa Merge pull request #3093 from Baezon/script-target-bracket-fix
Fix a crash with scripted targeting brackets
2021-01-08 18:13:44 -05:00
Baezon ac7bdbf269 fix bug in scripted targeting brackets 2021-01-08 17:30:28 -05:00
Goober5000 ddf00588d6 Merge pull request #3076 from Goober5000/hash_stuff
preprocess alt names before mission start
2021-01-08 16:03:10 -05:00
Goober5000 365ba2029e remove temporary function 2021-01-08 09:53:11 -05:00
Goober5000 02cdb106ba convert number parsing to use atoi and strtof
One small detail that was overlooked in PR #3021... KeldorKatarn's old code used `strtod` while the new code used `stuff_float`.  This wouldn't be a problem except that a couple MVP models use annoyingly formatted floats like 8.9e-08.  So I decided to convert `stuff_float` to use `strtof` and do some more upgrades while I was at it.
2021-01-08 09:25:25 -05:00
m!m 85a2a8f11e Merge pull request #3092 from Goober5000/strtof_patch
interim patch for get_user_vec3d_value
2021-01-08 10:47:42 +01:00
Goober5000 e76fdea8b9 interim patch for get_user_vec3d_value
As described in #3079, the old parsing of fvec and uvec used strtod and some POFs rely on this format.  This is a quickfix that uses the new parsing method for only `get_user_vec3d_value`.
2021-01-07 18:08:27 -05:00
Goober5000 726ce953c7 Merge pull request #3089 from Goober5000/fix_submodel_debris
de-parent live debris
2021-01-07 15:24:49 -05:00
JohnAFernandez a545a4ec27 Merge pull request #3087 from Baezon/lock-restriction-safety
Safety for lock restriction handling
2021-01-07 15:01:31 -05:00
Fabian Woltermann fc0662a9c4 Merge pull request #3080 from JohnAFernandez/Vectorize-Tech-Lists
Vectorize tech lists
2021-01-07 15:16:09 +01:00
JohnAFernandez e5685ded86 Keep the lists from being cleared early by removing unneeded the loops. 2021-01-07 00:33:21 -05:00
JohnAFernandez 226cbf1204 The true fix, check the correct value 2021-01-07 00:32:52 -05:00
Goober5000 043466309a de-parent live debris
It appears that live debris is not supposed to have a parent submodel; see the retail NTF Boadicea.  This removes the parent from any live debris that might have it.

This should fix #3078.
2021-01-07 00:02:49 -05:00
Baezon 766624600d update name 2021-01-06 18:04:59 -05:00
Baezon dab9a41f45 remove redundant check 2021-01-06 17:45:32 -05:00
m!m 51d8ab13d8 Merge pull request #3088 from EatThePath/fix-empty-secondaries-locking
off-by-one fix in early exit update_aspect_lock_information()
2021-01-06 23:25:53 +01:00
Baezon b93d30e12b unused variable 2021-01-06 14:46:44 -05:00
David Gibson 945db25578 corrected off-by-one issue in the early exit condition of update_aspect_lock_information() 2021-01-06 13:46:05 -06:00
Baezon 67de007ecb lock restrictions safety 2021-01-06 14:28:27 -05:00
JohnAFernandez e9a9b3b978 Merge pull request #3085 from Baezon/docking-collision-bugfix
Safety for check_for_docking_collision
2021-01-06 14:03:00 -05:00
Baezon e10522a2c7 safety for check_for_docking_collision 2021-01-06 13:18:27 -05:00
JohnAFernandez 9f33b432fc Simply this check 2021-01-05 00:07:07 -05:00
JohnAFernandez 7a0578a797 Ok CI, I'll use nullptr 2021-01-04 22:14:36 -05:00
JohnAFernandez b81825326c Signed Vs Unsigned
AKA C'Mon CI!
2021-01-03 21:54:31 -05:00
JohnAFernandez b8c2c975c0 Change to a pointer
So that we can release bitmaps and animations properly.
2021-01-03 21:36:50 -05:00
JohnAFernandez dc0272e664 Fixes Part 1 2021-01-03 20:56:30 -05:00
JohnAFernandez 3e329d64dd Check the correct value in the animation code 2021-01-03 15:15:51 -05:00
JohnAFernandez 882ac2b1a1 Possibly Fix Memory Corruption Issue
Remove Unused Var
2021-01-03 15:14:11 -05:00
Goober5000 b3153df6be preprocess alt names before mission start
For compatibility purposes some mods want alt names to truncate at the hash symbol. But we can't actually do that at mission load,
since we have to save them again in FRED. So this commit processes the names just before the mission starts.

To further complicate things, some mods actually want the hash to be displayed. So this commit introduces the double-hash as an escape sequence for a single hash.
2021-01-02 14:31:59 -05:00
z64555 bc8e16b37b Address change requst. 2021-01-01 22:41:43 -06:00
z64555 79e4c9b4e3 Satisfy change requests 2021-01-01 19:14:20 -06:00
z64555 70969c4475 Address requests by Goober5000 2020-12-31 15:39:21 -06:00
z64555 ecbb6a12f8 update feature to use eval_ship() instead of sexp_get_ship_from_node() 2020-12-31 14:58:33 -06:00
z64555 218059ffbb Merge branch 'add_ai_seconds_to_waypoint_sexp' of https://github.com/tcrayford/fs2open.github.com into feature/time_to_goal 2020-12-31 13:15:35 -06:00
Baezon c65ae50b81 version 1 of generic debris enhancements 2020-12-17 01:58:00 -05:00
Baezon 95de0c6833 version 1 of ai multilock 2020-12-14 20:41:06 -05:00
Baezon ab2c08392e in-progress 2020-12-14 04:29:55 -05:00
z64555 89a2c4dbcb Missed another break. 2020-12-12 14:47:15 -06:00
z64555 2cd557e483 Expletives and default breaks. 2020-12-12 14:20:07 -06:00
z64555 e5df64ab75 Address uninitialized variable issue. 2020-12-12 12:20:54 -06:00
z64555 52b0b19d11 Update qtFred sexp_tree::get_listing_opf_keypress 2020-12-12 11:39:47 -06:00
z64555 36a2355e86 Address exceedingly frivolous signed/unsigned mismatch errors. 2020-12-11 17:44:45 -06:00
z64555 351e8e0c44 Address short/int size mismatches. 2020-12-11 15:59:31 -06:00
z64555 91e0d8f578 QoL: Highlight/select the found key, be it primary or secondary, should the search mode find it. 2020-12-11 12:41:46 -06:00
z64555 f8f26e3b23 Fix bug where search mode wouldn't detect joy buttons correclty.
* Fix bug where joy hats were ignored.
2020-12-11 12:41:46 -06:00
z64555 873a3c3442 Fix bug with displaying joy button text
* Fix a number of warnings
2020-12-11 12:41:46 -06:00
z64555 1318b814d3 Fix out-of-bounds error due to axis controls index. 2020-12-11 12:41:45 -06:00
z64555 4c8f5f789c Grey out empty/unbound items
* Joy axis bindings now use the same color logic as the keys and buttons
2020-12-11 12:41:45 -06:00
z64555 b9b922b235 Fix bug where int conflict wasn't incremented for unselected items.
* Fix color highlighting of mouse-over lines
* Fix color highlighting of selected bindings
* Fix bug when trying to select an item while the selected line is an axis control
* Allow user to select an empty item
* Expand hitbox of items so players aren't required to click exactly on the text to select it.
2020-12-11 12:41:45 -06:00
z64555 716b4a3205 Moves the listbox draw function out of do_frame()
* Adjusts listbox positioning and widths of the binding columns for better display.
* Adds DCF tools to adjust the text positioning in the listbox
2020-12-11 12:41:44 -06:00
z64555 3c592b799f Fix bug where the "disallowed key" popup would spam you, blocking you from doing a meaningful bind. 2020-12-11 12:41:44 -06:00
z64555 c8c8a8d896 Fix bug where unbound items were flagged as conflicted.
* Fix bug where Cc_lines was accessed after being cleared. (Incorrectly assumed control_config_cancel_exit() was an exit point)
2020-12-11 12:41:43 -06:00
z64555 12b19a32bd Fix bug where unbound joy buttons would persist as a valid binding. 2020-12-11 12:41:43 -06:00
z64555 40e114351c Miscellaneous fixes to allow building.
* declare CCB before CC_bind.
* update various functions to use new binding aggregate classes.
2020-12-11 12:41:43 -06:00
z64555 704c600ef0 update control_config_clear() 2020-12-11 12:41:42 -06:00
z64555 5dde26fc33 Update check_control_used() to use primary and secondary. 2020-12-11 12:41:42 -06:00
z64555 cb5f80b0d5 Complete refactor of control_config_do_frame()
* Add textify method to CC_bind
* Replace string printing of key and joy bindings with primary and secondary bindings.
2020-12-11 12:41:42 -06:00
z64555 32636968bd Refactor browse mode in control_config_do_frame()
* Allow joy button presses to dismiss help overlay while in browse mode
* Refactor selected item cycling
2020-12-11 12:41:41 -06:00
z64555 e546a75c6b Fix possible bug where joy btn was ignored in bind mode
* Refactor search mode in control_config_do_frame()
* Dismiss help overlay in search mode when joy button is pressed
* Fix possible bug where nav buttons were not reset in search mode
2020-12-11 12:41:41 -06:00
z64555 9b0aab3f82 replace CCI::joy_id and ::key_id with ::primary and ::secondary (through inheritance of CCB)
* Add convenience methods to CCB
* Convert CC_bind into a class and define convenience methods
* Set underlying type of enum CID to short
* controlconfigdefaults.tbl: Should the CCI be disabled by an override, clear its binding.
* Control config menu: Should the help overlay be active during bind mode, dismiss it, don't bind anything, and stay in bind mode (fixes inconstant behavior)
* Refactor bind mode handling in control_config_do_frame()
2020-12-11 12:41:40 -06:00
z64555 7f2baec387 Remove Control_config::key_default and ::joy_default, redirect calls to the default presets 2020-12-11 12:41:40 -06:00
z64555 392148f84b Fix crash in unit tests due to uninitialized Control_config vector. 2020-12-11 12:33:45 -06:00
z64555 577ae95026 Use ints instead of size_t because CI said so. 2020-12-11 07:40:42 -06:00
z64555 968d76431f Missing an amp. 2020-12-11 07:40:42 -06:00
z64555 c2408839d1 Fix out of bounds error due to dynamic containers cleared at wrong spot. 2020-12-11 07:40:41 -06:00
z64555 a03af2e4a9 Re-enables the undo feature in the controls config menu. 2020-12-11 07:40:41 -06:00
z64555 aec7589b94 Tweak Undo_item::save to correctly save a reference as a pointer
* Remove two uncessary Assets.  operator new should throw an exception should it fail.
* Move template functions into .h.  This resolves instancing problems when trying to define them in a .cpp
* Add Undo_system::empty() and ::empty_redo() for checking if an ::undo() or ::redo() is possible.
2020-12-11 07:40:41 -06:00
z64555 e1974d1b57 Fix potential issue where Undo_stacks delete tracked items when going out of scope, even after the items were passed onto an Undo_system 2020-12-11 07:40:40 -06:00
z64555 bc7809de43 Undo_system::save_stack() now ignores empty stacks passed to it. No need to check for stack size before saving.
* Implement Undo_stack::size()
* Spellcheck in undosys.h
2020-12-11 07:40:40 -06:00
z64555 f23a72e228 Minor changes 2020-12-11 07:40:40 -06:00
z64555 45a45a4eff Remove licensing. 2020-12-11 07:40:39 -06:00
z64555 7e9ce1c9f7 Initial draft of the instruction documentation
Fix two typos

Adds Undo_system::clear()

Whoops! Can't just simply clear the stacks,gotta clean stuff off the heap first.
2020-12-11 07:40:39 -06:00
z64555 dce37d529c Adds ability to save a stack of undo operations as a single undo-op within the system 2020-12-11 07:40:39 -06:00
z64555 f528b3caa5 Changes the system so that the undo() and redo() functions return references to the changed item and its container (if it was specified at launch). This should allow client code to quickly find and access it on its end by comparing pointer values.
Since the pair is returned instead of the size of the undo/redo stacks, stack size information has been moved to their own getter functions.
2020-12-11 07:40:38 -06:00
z64555 492320f8d3 z64555's Undo system! This is a generic undo system, so you can save any single item type (not C arrays) and do undo/redo stuff on them. 2020-12-11 07:40:38 -06:00
z64555 636b4b12e4 Vectorize control_config::Conflicts 2020-12-11 07:40:14 -06:00
z64555 93c96b8943 Re-enable display of current selected preset. 2020-12-11 07:40:14 -06:00
z64555 d1f94c7b92 Fix overwrite check.
Add check for cfile open correctly.
2020-12-11 07:40:13 -06:00
z64555 74ffcb2db8 Print "NONE" instead of "-1" For unbound keys. 2020-12-11 07:40:13 -06:00
z64555 c7112fd897 Adds function to write controlconfigdefaults.tbl using the default preset at time of call.
* Adds DC function 'write_ccd' to write the .tbl
* Adds DC function 'load_ccd' to reload the .tbl
2020-12-11 07:40:13 -06:00
z64555 1bb9ed8832 Remove unused variable for catch clause. 2020-12-11 07:40:13 -06:00
z64555 23f85da586 Move typedef after the declaration of the struct it uses. 2020-12-11 07:40:12 -06:00
z64555 f163f56c10 Cleanup controlsconfig.h and refactor some loops. 2020-12-11 07:40:12 -06:00
z64555 9c03e8c069 Remove dead comment. 2020-12-11 07:40:12 -06:00
z64555 92a76c05ee Adds ability for mod devs to change the naming of a control as it shows up in the config menu.
* Presets start from a clean slate, while Overrides inherite from hardcode defaults
2020-12-11 07:40:11 -06:00
z64555 730ab835a8 Add #ControlConfigPreset section to controlconfigdefault.tbl and allow multiple sections in the .tbl
* This is a section that only configures the bindings for a preset.  Allowing mod devs to add presets instead of just the overrides
* Added ability to resume parsing should a Binding not be found
2020-12-11 07:40:11 -06:00
z64555 ef89a4aa38 Refactor and cleanup control_config_common_load_overrides.
* Mod devs now have the option to override hardcoded defaults
2020-12-11 07:40:11 -06:00
z64555 f9474cf773 Refactor defaults.
* Hardcoded default bindings are now a preset
* rename controls_config_init_bindings() to control_config_common_init_bindings() for consistancy
2020-12-11 07:40:10 -06:00
z64555 96382b47e2 Initial work on presets and default keybinds. Defaults will be moved into a preset instead of lingering in the bindings vector, this may cause issues with training messages that reference controls by default keybinds. 2020-12-11 07:40:10 -06:00
z64555 99dfdf07a2 Refactor control_config_list_prepare()
Default Disable Non-retail controls
Expand CC_lines buffer to include NUM_JOY_AXIS_ACTIONS
2020-12-11 07:39:30 -06:00
z64555 62fa76d65e Fix wrong reference to array size.
Init Cc_lines, which is now dynamic
De-init Cc_lines and Control_config_backup when closing the menu.
2020-12-11 07:39:30 -06:00
z64555 1a482cab4a Remove Joy_table declaration for later PR.. 2020-12-11 07:39:30 -06:00
z64555 ec61af7e1c Revert obliteration of magic number. 2020-12-11 07:39:29 -06:00
z64555 d8d4e9ed2c Disable Presets and Undo capabilities. Only reset_all was spared.
* Revert Joy_axis_action_index changes.  Feature to be added later
* Strip out most of the preset and undo capability.  Only the backup ability survived.
2020-12-11 07:39:29 -06:00
z64555 38df849e6e Change Control_config array to an SCP_vector
* Hardcoded bindings are done at run-time instead of assignment
* Created a map that should retain backward compatibility with controlconfigdefaults.tbl and playerfiles, since a reorganization of the controls in the code is planned and would break compatibility.
2020-12-11 07:39:28 -06:00
Baezon d06eedf13c testing 2020-12-10 18:49:05 -05:00
Baezon a3d3be11fb initial testing version 2020-12-10 18:41:36 -05:00
Baezon be76cd727a implement turret-forced-target 2020-12-08 00:07:23 -05:00
Baezon 641cf48073 implement damage incidence angle 2020-12-01 12:37:22 -05:00
Baezon 2dbaf53e49 no more travis wooo 2020-11-20 14:10:27 -05:00
Baezon 849b4c57b6 no warning 2020-11-20 12:03:34 -05:00
Baezon de0933e1b9 expose targeting sizes 2020-11-20 12:03:34 -05:00
Baezon 8c9a6d049e use armor types for beam-weapon damage 2020-11-06 23:40:02 -05:00
Baezon 799fa27d36 clarity comment 2020-10-02 23:14:45 -04:00
Baezon 01cd5a34b9 travis 2020-10-02 12:04:45 -04:00
Baezon 9b3905a4bb v1 2020-10-02 02:53:13 -04:00
Shivansps 1239ec47e3 Smart pointers and disabled some messages
Added smart pointers to bsp_in, bsp_out, sldc_tree and slc2_tree as requested.

I also changed the #error to #pragma message in a attempt to remove the false positive error.

Also did minor code indent fixes-
2020-08-30 13:45:43 -03:00
Shivansps eb1814e303 SLC2 and POF version 2118 support
Changed SLDC system to SLC2, this replaced the char at the beginning of the node for an int in order for the tree to be aligned.
Added BSP_Defpoints data alignment and SLDC to SLC2 conversion for pof version < 2118.
2020-08-27 20:10:29 -03:00
Baezon b4ec1b32ba better subtype determiner 2020-08-05 01:54:47 -04:00
Baezon 27544e781a Revert "no homing when out of range"
This reverts commit eebfb7eadb.
2020-07-23 21:12:51 -04:00
Baezon eebfb7eadb no homing when out of range 2020-07-23 12:30:28 -04:00
Baezon e6938bd14d verison 1 2020-07-22 23:48:53 -04:00
Tom Crayford 6ce29b5c6a add seconds-to-goal
returns the number of seconds between a designated ship and its goal.
Uses `ship_return_seconds_to_goal`, but only returns 0 in the invalid
cases.
2019-09-23 11:12:18 +01:00
Tom Crayford bc99331d47 refactor ship_return_time_to_goal to be more general 2019-09-22 22:00:13 +01:00
1859 changed files with 350192 additions and 148078 deletions

No files matched your search

+3 -5
View File
@@ -1,8 +1,6 @@
cmake/ @asarium
ci/ @asarium @z64555
code/executor/ @asarium
code/controlconfig/ @z64555
code/scpui/ @asarium
code/scripting/ @asarium
code/model/modelanimation*.* @bmagnu
+177 -51
View File
@@ -6,7 +6,7 @@ on:
- 'nightly_*'
env:
QT_VERSION: 5.12.9
QT_VERSION: 5.12.12
jobs:
build_linux:
@@ -15,21 +15,8 @@ jobs:
configuration: [FastDebug, Release]
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-a8ca321
container: ghcr.io/scp-fs2open/linux_build:sha-1ff82e8
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
- uses: actions/checkout@v1
name: Checkout
with:
@@ -37,7 +24,8 @@ jobs:
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
COMPILER: gcc-9
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
@@ -57,7 +45,7 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/install/*.AppImage
@@ -73,12 +61,12 @@ jobs:
submodules: true
fetch-depth: '0'
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: linux-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: linux-FastDebug
path: builds
@@ -107,31 +95,36 @@ jobs:
name: Checkout
with:
submodules: true
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
# - name: Cache Qt
# id: cache-qt-win
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt (32 bit)
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.arch == 'Win32' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win32_msvc2017
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
# - name: Install Qt (64 bit)
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.arch == 'x64' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win64_msvc2017_64
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
@@ -142,11 +135,19 @@ jobs:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
if [ "$ARCHITECTURE" = "Win32" ]; then
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -DFSO_BUILD_WITH_VULKAN="OFF" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
else
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
fi
- name: Compile
working-directory: ./build
env:
@@ -163,7 +164,7 @@ jobs:
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}
path: ${{ github.workspace }}/build/install/*
@@ -183,12 +184,12 @@ jobs:
submodules: true
fetch-depth: '0'
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
@@ -208,3 +209,128 @@ jobs:
DATACORDER_USER: ${{ secrets.DATACORDER_USER }}
DATACORDER_SSHPASS: ${{ secrets.DATACORDER_PASSWORD }}
run: $GITHUB_WORKSPACE/ci/linux/upload_dist_package.sh nightly
build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64, arm64]
name: Mac
runs-on: macos-latest
steps:
# - name: Cache Qt
# id: cache-qt-mac
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
# setup-python: 'false'
# aqtversion: ==1.1.3
# py7zrversion: '==0.19.*'
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Set up test version
shell: bash
run: |
[[ "${{ github.ref }}" =~ ^refs\/heads\/test\/(.*)$ ]]
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR ${BASH_REMATCH[1]})" > "version_override.cmake"]
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Sign builds
working-directory: ./build/bin
run: |
# make sure OpenAL framework is signed
find . -name OpenAL -type f | while read xx; do codesign --force -s - $xx; done
find . -name OpenAL.framework -type d | while read xx; do codesign --force -s - $xx; done
# make sure dylibs are signed
find . -name \*.dylib -type f | while read xx; do codesign --force -s - $xx; done
# sign binaries
find . -perm +111 -type f | grep MacOS | while read xx; do codesign --force -s - $xx; done
# sign apps
find . -name \*.app -maxdepth 1 | while read xx; do codesign --force -s - $xx; done
- name: Package build result
working-directory: ./build/bin
# Use GNU tar here (part of runner image) to avoid weird corruption bug with bsdtar
# Ref: https://github.com/actions/runner-images/issues/2619
run: gtar -cvzf macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz *.app
- name: Upload build result
uses: actions/upload-artifact@v3
with:
name: mac-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/bin/macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v3
with:
name: mac-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v3
with:
name: mac-FastDebug-${{ matrix.arch }}
path: builds
- name: Unpack builds
working-directory: ./builds
run: |
tar -xvzf macos-build-Release-${{ matrix.arch }}.tgz
tar -xvzf macos-build-FastDebug-${{ matrix.arch }}.tgz
- name: Create Distribution package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
working-directory: ./builds
env:
INDIEGAMES_USER: ${{ secrets.INDIEGAMES_USER }}
INDIEGAMES_SSHPASS: ${{ secrets.INDIEGAMES_PASSWORD }}
DATACORDER_USER: ${{ secrets.DATACORDER_USER }}
DATACORDER_SSHPASS: ${{ secrets.DATACORDER_PASSWORD }}
run: $GITHUB_WORKSPACE/ci/linux/upload_dist_package.sh nightly
+252 -94
View File
@@ -6,7 +6,7 @@ on:
- 'release_*'
env:
QT_VERSION: 5.12.9
QT_VERSION: 5.12.12
jobs:
create_release:
@@ -16,6 +16,17 @@ jobs:
- name: Create Release
id: create_release
uses: actions/create-release@v1
# Creates a release package page on github
# create_release.inputs: (notable inputs)
# allowUpdates=false if true, update an existing release if it exists
# artifactErrorsFailBuild=false if true, fails the build should artifact read/write errors occur
# artifacts optional set of paths to artifacts to upload to the release. comma delimited.
# removeArtifacts=false if true, remove existing artifacts
# replaceArtifacts=false if true, replace/overwrite existing artifacts
# create_release.outputs:
# id id of the created release
# html_url HTML URL of the release
# upload_url FTP URL of the release where assets are uploaded
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
@@ -23,45 +34,29 @@ jobs:
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- name: Store upload URL
run: |
echo -n "${{ steps.create_release.outputs.upload_url }}" > upload_url
- name: Persist upload URL
uses: actions/upload-artifact@v2
with:
name: upload_url
path: ${{ github.workspace }}/upload_url
build_linux:
strategy:
matrix:
# Run this job for each configuration
# The current config running is accesible with `matrix.configuration`
configuration: [FastDebug, Release]
name: Linux
needs: create_release
needs: create_release # Don't run this job until create_release is done and successful
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-a8ca321
container: ghcr.io/scp-fs2open/linux_build:sha-1ff82e8
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
- uses: actions/checkout@v1
# checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
name: Checkout
with:
submodules: true
submodules: true # `true` to checkout submodules, `recursive` to recursively checkout submodules
ref: '${{ github.ref }}'
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
COMPILER: gcc-9
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
@@ -81,7 +76,16 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
# Upload the url file for use with other runners
# upload-artifact.inputs:
# if-no-files-found=warn What to do if path fails to find any files.
# warn Display a warning but do not fail the action
# error Display an error and fail the action
# ignore No display, No fail
# retention-days=0 Days to keep the artifact.
# 0 Use default retention policy of the repo
# 1~90 Min 1, Max 90 days to keep the artifact unless changed by repo settings page
with:
name: linux-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/install/*.AppImage
@@ -95,38 +99,38 @@ jobs:
name: Checkout
with:
submodules: true
fetch-depth: '0'
- name: Download upload URL
uses: actions/download-artifact@v1
with:
name: upload_url
path: .
- name: Extract upload URL
id: extractUploadUrl
run: echo "::set-output name=upload_url::$(cat upload_url)"
fetch-depth: '0' # value 0 to fetch all history and tags for all branches
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v1
# Grab the release builds
uses: actions/download-artifact@v3
with:
name: linux-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
# Grab the debug builds
uses: actions/download-artifact@v3
with:
name: linux-FastDebug
path: builds
- name: Create Distribution package
# Zip both builds together
id: generate_package
working-directory: ./builds
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux
- name: Upload result package
uses: actions/upload-release-asset@v1
# Stash the result to artifact filespace
uses: actions/upload-artifact@v3
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Publish result package
# publish the zipped result
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.extractUploadUrl.outputs.upload_url }}
asset_path: ${{ steps.generate_package.outputs.package_path }}
asset_name: ${{ steps.generate_package.outputs.package_name }}
asset_content_type: ${{ steps.generate_package.outputs.package_mime }}
files: ${{ steps.generate_package.outputs.package_path }}
build_windows:
strategy:
@@ -139,34 +143,44 @@ jobs:
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
# Checkout repo
name: Checkout
with:
submodules: true
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
ref: '${{ github.ref }}'
# - name: Cache Qt
# # Cache Qt
# id: cache-qt-win
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt (32 bit)
# # Install Qt 32bit if matrix.arch == Win32
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.arch == 'Win32' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win32_msvc2017
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
# - name: Install Qt (64 bit)
# # Install Qt 64bit if matrix.arch == x64
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.arch == 'x64' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win64_msvc2017_64
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
@@ -177,11 +191,19 @@ jobs:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
if [ "$ARCHITECTURE" = "Win32" ]; then
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -DFSO_BUILD_WITH_VULKAN="OFF" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
else
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
fi
- name: Compile
working-directory: ./build
env:
@@ -198,43 +220,41 @@ jobs:
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}
path: ${{ github.workspace }}/build/install/*
windows_zip:
name: Build Windows distribution zip
needs: build_windows
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
strategy:
fail-fast: false # Run the other jobs in the matrix instead of failing them
matrix:
arch: [Win32, x64]
simd: [SSE2, AVX]
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: '0'
- name: Download upload URL
uses: actions/download-artifact@v1
with:
name: upload_url
path: .
- name: Extract upload URL
id: extractUploadUrl
run: echo "::set-output name=upload_url::$(cat upload_url)"
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Create Distribution package
id: generate_package
working-directory: ./builds
@@ -243,21 +263,159 @@ jobs:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
uses: actions/upload-release-asset@v1
uses: actions/upload-artifact@v3
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Upload debug package
uses: actions/upload-artifact@v3
with:
name: ${{ steps.generate_package.outputs.debug_name }}
path: ${{ steps.generate_package.outputs.debug_path }}
- name: Publish packages
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.extractUploadUrl.outputs.upload_url }}
asset_path: ${{ steps.generate_package.outputs.package_path }}
asset_name: ${{ steps.generate_package.outputs.package_name }}
asset_content_type: ${{ steps.generate_package.outputs.package_mime }}
- name: Upload debug symbols
uses: actions/upload-release-asset@v1
files: |
${{ steps.generate_package.outputs.package_path }}
${{ steps.generate_package.outputs.debug_path }}
build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64, arm64]
name: Mac
needs: create_release
runs-on: macos-latest
steps:
# - name: Cache Qt
# id: cache-qt-mac
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
# setup-python: 'false'
# aqtversion: ==1.1.3
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
ref: '${{ github.ref }}'
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Sign builds
working-directory: ./build/bin
run: |
# make sure OpenAL framework is signed
find . -name OpenAL -type f | while read xx; do codesign --force -s - $xx; done
find . -name OpenAL.framework -type d | while read xx; do codesign --force -s - $xx; done
# make sure dylibs are signed
find . -name \*.dylib -type f | while read xx; do codesign --force -s - $xx; done
# sign binaries
find . -perm +111 -type f | grep MacOS | while read xx; do codesign --force -s - $xx; done
# sign apps
find . -name \*.app -maxdepth 1 | while read xx; do codesign --force -s - $xx; done
- name: Package build result
working-directory: ./build/bin
# Use GNU tar here (part of runner image) to avoid weird corruption bug with bsdtar
# Ref: https://github.com/actions/runner-images/issues/2619
run: gtar -cvzf macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz *.app
- name: Upload build result
uses: actions/upload-artifact@v3
with:
name: mac-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/bin/macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v3
with:
name: mac-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v3
with:
name: mac-FastDebug-${{ matrix.arch }}
path: builds
- name: Unpack builds
working-directory: ./builds
run: |
tar -xvzf macos-build-Release-${{ matrix.arch }}.tgz
tar -xvzf macos-build-FastDebug-${{ matrix.arch }}.tgz
- name: Create Distribution package
id: generate_package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
uses: actions/upload-artifact@v3
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Publish result package
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.extractUploadUrl.outputs.upload_url }}
asset_path: ${{ steps.generate_package.outputs.debug_path }}
asset_name: ${{ steps.generate_package.outputs.debug_name }}
asset_content_type: ${{ steps.generate_package.outputs.debug_mime }}
files: ${{ steps.generate_package.outputs.package_path }}
post_build:
name: Post builds to Nebula and Forum
needs: [linux_zip, windows_zip, mac_zip]
uses: ./.github/workflows/post-build-release.yaml
with:
linux_result: ${{ needs.linux_zip.result }}
windows_result: ${{ needs.windows_zip.result }}
mac_result: ${{ needs.mac_zip.result }}
releaseTag: ${{ github.ref_name }}
secrets: inherit
+53
View File
@@ -0,0 +1,53 @@
name: Publish Standalone docker image
on:
push:
tags:
- 'nightly_*'
- 'release_*'
jobs:
build_images:
if: github.repository == 'scp-fs2open/fs2open.github.com'
strategy:
matrix:
configuration: [FastDebug, Release]
include:
- configuration: FastDebug
tag_suffix: -debug
- configuration: Release
tag_suffix: ""
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ghcr.io/scp-fs2open/standalone_server
tag-latest: false
- name: Login to GitHub Docker Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.CR_PAT }}
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
context: .
file: ./docker/standalone/Dockerfile
push: true
tags: ${{ steps.docker_meta.outputs.tags }}${{ matrix.tag_suffix }}
labels: ${{ steps.docker_meta.outputs.labels }}
build-args: |
build_type=${{ matrix.configuration }}
+176 -51
View File
@@ -6,7 +6,7 @@ on:
- 'test/*'
env:
QT_VERSION: 5.12.9
QT_VERSION: 5.12.12
jobs:
build_linux:
@@ -15,21 +15,8 @@ jobs:
configuration: [FastDebug, Release]
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-a8ca321
container: ghcr.io/scp-fs2open/linux_build:sha-1ff82e8
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
- uses: actions/checkout@v1
name: Checkout
with:
@@ -43,7 +30,8 @@ jobs:
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
COMPILER: gcc-9
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
@@ -63,7 +51,7 @@ jobs:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: linux-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/install/*.AppImage
@@ -80,12 +68,12 @@ jobs:
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: linux-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: linux-FastDebug
path: builds
@@ -120,31 +108,36 @@ jobs:
[[ "${{ github.ref }}" =~ ^refs\/heads\/test\/(.*)$ ]]
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR ${BASH_REMATCH[1]})" > "version_override.cmake"
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
# - name: Cache Qt
# id: cache-qt-win
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt (32 bit)
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.arch == 'Win32' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win32_msvc2017
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
# - name: Install Qt (64 bit)
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.arch == 'x64' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win64_msvc2017_64
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
@@ -155,11 +148,19 @@ jobs:
mkdir build
cd build
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=ON -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
if [ "$ARCHITECTURE" = "Win32" ]; then
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -DFSO_BUILD_WITH_VULKAN="OFF" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
else
cmake -DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_USE_SPEECH="ON" \
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$SIMD" \
-DFSO_BUILD_QTFRED=OFF -DFSO_BUILD_TESTS=ON \
-DFSO_INSTALL_DEBUG_FILES="ON" -A "$ARCHITECTURE" \
-G "Visual Studio 16 2019" -T "v142" ..
fi
- name: Compile
working-directory: ./build
env:
@@ -176,7 +177,7 @@ jobs:
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Upload build result
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: windows-${{ matrix.configuration }}-${{ matrix.arch }}-${{ matrix.simd }}
path: ${{ github.workspace }}/build/install/*
@@ -197,12 +198,12 @@ jobs:
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v1
uses: actions/download-artifact@v3
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
uses: actions/download-artifact@v3
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
@@ -222,3 +223,127 @@ jobs:
DATACORDER_USER: ${{ secrets.DATACORDER_USER }}
DATACORDER_SSHPASS: ${{ secrets.DATACORDER_PASSWORD }}
run: $GITHUB_WORKSPACE/ci/linux/upload_dist_package.sh test
build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64, arm64]
name: Mac
runs-on: macos-latest
steps:
# - name: Cache Qt
# id: cache-qt-mac
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
# setup-python: 'false'
# aqtversion: ==1.1.3
# py7zrversion: '==0.19.*'
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Set up test version
shell: bash
run: |
[[ "${{ github.ref }}" =~ ^refs\/heads\/test\/(.*)$ ]]
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR ${BASH_REMATCH[1]})" > "version_override.cmake"
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Sign builds
working-directory: ./build/bin
run: |
# make sure OpenAL framework is signed
find . -name OpenAL -type f | while read xx; do codesign --force -s - $xx; done
find . -name OpenAL.framework -type d | while read xx; do codesign --force -s - $xx; done
# make sure dylibs are signed
find . -name \*.dylib -type f | while read xx; do codesign --force -s - $xx; done
# sign binaries
find . -perm +111 -type f | grep MacOS | while read xx; do codesign --force -s - $xx; done
# sign apps
find . -name \*.app -maxdepth 1 | while read xx; do codesign --force -s - $xx; done
- name: Package build result
working-directory: ./build/bin
# Use GNU tar here (part of runner image) to avoid weird corruption bug with bsdtar
# Ref: https://github.com/actions/runner-images/issues/2619
run: gtar -cvzf macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz *.app
- name: Upload build result
uses: actions/upload-artifact@v3
with:
name: mac-${{ matrix.configuration }}-${{ matrix.arch }}
path: ${{ github.workspace }}/build/bin/macos-build-${{ matrix.configuration }}-${{ matrix.arch }}.tgz
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
strategy:
matrix:
arch: [x86_64, arm64]
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v3
with:
name: mac-Release-${{ matrix.arch }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v3
with:
name: mac-FastDebug-${{ matrix.arch }}
path: builds
- name: Unpack builds
working-directory: ./builds
run: |
tar -xvzf macos-build-Release-${{ matrix.arch }}.tgz
tar -xvzf macos-build-FastDebug-${{ matrix.arch }}.tgz
- name: Create Distribution package
working-directory: ./builds
env:
ARCH: ${{ matrix.arch }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Mac
- name: Upload result package
working-directory: ./builds
env:
INDIEGAMES_USER: ${{ secrets.INDIEGAMES_USER }}
INDIEGAMES_SSHPASS: ${{ secrets.INDIEGAMES_PASSWORD }}
DATACORDER_USER: ${{ secrets.DATACORDER_USER }}
DATACORDER_SSHPASS: ${{ secrets.DATACORDER_PASSWORD }}
run: $GITHUB_WORKSPACE/ci/linux/upload_dist_package.sh test
+56
View File
@@ -0,0 +1,56 @@
name: Build caches for master
on:
push:
branches:
- master
env:
QT_VERSION: 5.12.12
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-9, gcc-13, clang-16]
cmake_options: [""]
include:
# Also include configurations that check if the code compiles without the graphics backends
- configuration: Debug
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
- configuration: Release
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-1ff82e8
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}
- name: Configure ccache
run: |
ccache --set-config=sloppiness=pch_defines,time_macros
ccache -p
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
CCACHE_PATH: /usr/local/bin/ccache
ENABLE_QTFRED: ON
Qt5_DIR: /qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt5
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
- name: Show CCache statistics
run: ccache --show-stats
+82
View File
@@ -0,0 +1,82 @@
name: Post Release builds
on:
workflow_call:
# Trigger when called by other workflows
inputs:
linux_result: # job.result; either success, failure, canceled or skipped
required: true
type: string
windows_result: # job.result
required: true
type: string
mac_result: # job.result
required: true
type: string
releaseTag:
required: true
type: string
workflow_dispatch:
# Trigger manually from Github
inputs:
releaseTag:
description: Release Tag
required: true
type: string
env:
GITHUB_REPO: ${{ github.repository }} # repo this workflow was called from
INDIEGAMES_USER: ${{ secrets.INDIEGAMES_USER }}
INDIEGAMES_SSHPASS: ${{ secrets.INDIEGAMES_PASSWORD }}
NEBULA_USER: ${{ secrets.NEBULA_USER }}
NEBULA_PASSWORD: ${{ secrets.NEBULA_PASSWORD }}
HLP_API: ${{ secrets.HLP_API }}
HLP_KEY: ${{ secrets.HLP_KEY }}
RELEASE_TAG: ${{ inputs.releaseTag }}
jobs:
post_builds:
name: Post builds on Nebula and the forums
runs-on: ubuntu-latest
steps:
- name: Caller
# Name of what called this yaml. Used to debug auto/manual step being triggered
run: echo "github.event_name= ${{ github.event_name }}"
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: '0'
ref: ${{ env.RELEASE_TAG }}
- name: Install Python dependencies
run: pip install -r ci/post/requirements.txt
- name: Post Builds (Auto trigger)
if: ${{ (github.event_name == 'workflow_call') || (github.event_name == 'push') }}
env:
LINUX_RESULT: ${{ inputs.linux_result }}
WINDOWS_RESULT: ${{ inputs.windows_result }}
MAC_RESULT: ${{ inputs.mac_result }}
GITHUB_REPO: ${{ github.repository }} # repo this workflow was called from
INDIEGAMES_USER: ${{ secrets.INDIEGAMES_USER }}
INDIEGAMES_SSHPASS: ${{ secrets.INDIEGAMES_PASSWORD }}
NEBULA_USER: ${{ secrets.NEBULA_USER }}
NEBULA_PASSWORD: ${{ secrets.NEBULA_PASSWORD }}
HLP_API: ${{ secrets.HLP_API }}
HLP_KEY: ${{ secrets.HLP_KEY }}
RELEASE_TAG: ${{ inputs.releaseTag }}
run: python ci/post/main.py release
- name: Post Builds (Manual trigger)
if: ${{ github.event_name == 'workflow_dispatch' }}
# assume user knows what they're doing...
env:
LINUX_RESULT: success
WINDOWS_RESULT: success
MAC_RESULT: success
run: |
echo "releaseTag= ${{ env.RELEASE_TAG }}"
echo "repository= ${{ github.repository }}"
python ci/post/main.py release
-152
View File
@@ -1,152 +0,0 @@
name: Check a pull request
on: [pull_request]
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-5, gcc-10, clang-9]
cmake_options: [""]
include:
# Also include configurations that check if the code compiles without the graphics backends
- configuration: Debug
compiler: gcc-10
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
- configuration: Release
compiler: gcc-10
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-e977d36
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Run Clang Tidy
# Clang-tidy reuses the precompiled headers so this only makes sense for the clang compilers
if: startsWith(matrix.compiler, 'clang-')
run: $GITHUB_WORKSPACE/ci/linux/clang_tidy.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Process clang-tidy warnings
if: startsWith(matrix.compiler, 'clang-')
uses: asarium/clang-tidy-action@v1
with:
fixesFile: clang-fixes.yaml
build_windows:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [MSVC]
arch: [Win32, x64]
name: Windows
runs-on: windows-2019
steps:
- name: Prepare Environment
run: choco install ninja
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Cache Qt
id: cache-qt-win
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt (32 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.compiler == 'MSVC' && matrix.arch == 'Win32' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win32_msvc2017
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Install Qt (64 bit)
uses: jurplel/install-qt-action@v2
if: ${{ matrix.compiler == 'MSVC' && matrix.arch == 'x64' }}
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
arch: win64_msvc2017_64
cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
aqtversion: ==0.8
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
shell: bash
run: |
mkdir build
cd build
if [ "$COMPILER" = "MinGW" ]; then
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" ..
else
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "Visual Studio 16 2019" \
-DFSO_BUILD_QTFRED=ON -T "v142" -A "$ARCHITECTURE" ..
fi
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
if [ "$COMPILER" = "MinGW" ]; then
cmake --build . --config "$CONFIGURATION"
else
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
fi
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
if [ "$COMPILER" = "MinGW" ]; then
./bin/unittests --gtest_shuffle
else
"./bin/$CONFIGURATION/unittests" --gtest_shuffle
fi
@@ -1,48 +0,0 @@
name: Publish Standalone docker image
on:
push:
tags:
- '*'
jobs:
build_images:
strategy:
matrix:
configuration: [FastDebug, Release]
include:
- configuration: FastDebug
latest_tag: latest_debug
nightly_tag: nightly_debug
release_tag: release_debug
- configuration: Release
latest_tag: latest
nightly_tag: nightly
release_tag: release
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Docker login
run: echo ${{ secrets.DOCKER_ACCESSTOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Docker build
run: docker build --build-arg build_type=${{ matrix.configuration }} -f docker/standalone/Dockerfile -t ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} .
- name: Push latest tag
run: |
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }}
- name: Push nightly tag
if: contains(github.ref, 'refs/tags/nightly_')
run: |
docker tag ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.nightly_tag }}
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.nightly_tag }}
- name: Push release tag
if: contains(github.ref, 'refs/tags/release_')
run: |
docker tag ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.release_tag }}
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.release_tag }}
+236
View File
@@ -0,0 +1,236 @@
name: Check a pull request
on: [pull_request]
env:
QT_VERSION: 5.12.12
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-9, gcc-13, clang-16]
cmake_options: [""]
include:
# Also include configurations that check if the code compiles without the graphics backends
- configuration: Debug
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
- configuration: Release
compiler: gcc-13
cmake_options: -DFSO_BUILD_WITH_OPENGL=OFF -DFSO_BUILD_WITH_VULKAN=OFF
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-1ff82e8
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}
save: false # Caches are created by a separate job and only restored for PRs
verbose: 1
- name: Configure ccache
run: ccache --set-config=sloppiness=pch_defines,time_macros
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
CCACHE_PATH: /usr/local/bin/ccache
ENABLE_QTFRED: ON
Qt5_DIR: /qt/${{ env.QT_VERSION }}/gcc_64/lib/cmake/Qt5
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Show CCache statistics
run: ccache --show-stats
- name: Run Clang Tidy
# Clang-tidy reuses the precompiled headers so this only makes sense for the clang compilers
if: startsWith(matrix.compiler, 'clang-')
run: $GITHUB_WORKSPACE/ci/linux/clang_tidy.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Process clang-tidy warnings
if: startsWith(matrix.compiler, 'clang-')
uses: asarium/clang-tidy-action@v1
with:
fixesFile: clang-fixes.yaml
build_windows:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [MSVC]
arch: [Win32, x64]
name: Windows
runs-on: windows-2019
steps:
- name: Prepare Environment
run: choco install ninja
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
# - name: Cache Qt
# id: cache-qt-win
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-${{ matrix.arch }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt (32 bit)
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.compiler == 'MSVC' && matrix.arch == 'Win32' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win32_msvc2017
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
# - name: Install Qt (64 bit)
# uses: jurplel/install-qt-action@v2
# if: ${{ matrix.compiler == 'MSVC' && matrix.arch == 'x64' }}
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# arch: win64_msvc2017_64
# cached: ${{ steps.cache-qt-win.outputs.cache-hit }}
# aqtversion: ==0.8
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
shell: bash
run: |
mkdir build
cd build
if [ "$COMPILER" = "MinGW" ]; then
if [ "$ARCHITECTURE" = "Win32" ]; then
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -DFSO_BUILD_WITH_VULKAN="OFF" -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" ..
else
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -DCMAKE_BUILD_TYPE=$CONFIGURATION -G "Ninja" ..
fi
else
if [ "$ARCHITECTURE" = "Win32" ]; then
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -DFSO_BUILD_WITH_VULKAN="OFF" -G "Visual Studio 16 2019" \
-DFSO_BUILD_QTFRED=OFF -T "v142" -A "$ARCHITECTURE" ..
else
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "Visual Studio 16 2019" \
-DFSO_BUILD_QTFRED=OFF -T "v142" -A "$ARCHITECTURE" ..
fi
fi
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
if [ "$COMPILER" = "MinGW" ]; then
cmake --build . --config "$CONFIGURATION"
else
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
fi
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
if [ "$COMPILER" = "MinGW" ]; then
./bin/unittests --gtest_shuffle
else
"./bin/$CONFIGURATION/unittests" --gtest_shuffle
fi
build_mac:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [clang]
arch: [x86_64, arm64]
cmake_options: [""]
name: Mac
runs-on: macos-latest
steps:
# - name: Cache Qt
# id: cache-qt-mac
# uses: actions/cache@v1
# with:
# path: ${{ github.workspace }}/../Qt
# key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
# - name: Install Qt
# uses: jurplel/install-qt-action@v2
# with:
# version: ${{ env.QT_VERSION }}
# dir: ${{ github.workspace }}/..
# cached: ${{ steps.cache-qt-mac.outputs.cache-hit }}
# setup-python: 'false'
# aqtversion: ==1.1.3
# py7zrversion: '==0.19.*'
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- name: ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: ${{ runner.os }}-${{ matrix.configuration }}-${{ matrix.compiler }}-${{ matrix.arch }}
save: false # Caches are created by a separate job and only restored for PRs
- name: Prepare Vulkan SDK
uses: humbletim/[email protected]
with:
vulkan-query-version: 1.3.204.0
vulkan-components: Vulkan-Headers, Vulkan-Loader
vulkan-use-cache: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
JOB_CMAKE_OPTIONS: ${{ matrix.cmake_options }}
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
run: LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH ninja all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCH: ${{ matrix.arch }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Run Clang Tidy
# Clang-tidy reuses the precompiled headers so this only makes sense for the clang compilers
if: startsWith(matrix.compiler, 'clang-')
run: $GITHUB_WORKSPACE/ci/linux/clang_tidy.sh ${{ github.event.pull_request.base.sha }} ${{ github.event.pull_request.head.sha }}
- name: Process clang-tidy warnings
if: startsWith(matrix.compiler, 'clang-')
uses: asarium/clang-tidy-action@v1
with:
fixesFile: clang-fixes.yaml
@@ -0,0 +1,68 @@
name: Weekly Coverity Scan for Freespace Open
# adapted from code by "albert-github" on the doxygen repository
# many thanks for figuring this out first so it could be less painful for us!
#This mode is for testing
#on: [push, pull_request]
# In production, push on a specific schedule
on:
schedule:
- cron: "5 0 * * 5" # Run once per a week on Friday morning (midnight UTC, 4 AM EST), to avoid Coverity's submission limits
env:
QT_VERSION: 5.12.12
coverity_email: [email protected]
coverity_token: ${{ secrets.COVERITY_TOKEN }}
jobs:
build:
name: Build FSO With Coverity Wrapper
runs-on: ${{ matrix.config.os }}
container: ghcr.io/scp-fs2open/linux_build:sha-1ff82e8
strategy:
fail-fast: false
matrix:
config:
- { name: "GCC on ubuntu", os: ubuntu-latest, build_type: "Release" }
steps:
- name: Checkout
uses: actions/checkout@v1
with:
submodules: recursive # `true` to checkout submodules, `recursive` to recursively checkout submodules
# pipe results of wget to a log file because it's very verbose and rarely fails
- name: Install Coverity
run: |
wget -o wgetlog.txt -q https://scan.coverity.com/download/cxx/linux64 --post-data "token=${{ env.coverity_token }}&project=scp-fs2open/fs2open.github.com" -O coverity_tool.tgz
mkdir cov-scan
tar ax -f coverity_tool.tgz --strip-components=1 -C cov-scan
- name: Setup Environment
run: |
echo "$(pwd)/cov-scan/bin" >> $GITHUB_PATH
echo "NPROC=$(getconf _NPROCESSORS_ONLN)" >> $GITHUB_ENV
- name: Configure CMake for FSO
env:
CONFIGURATION: Release
compiler: gcc-9
ENABLE_QTFRED: OFF
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Build FSO with Coverity Wrapper
working-directory: ./build
env:
CONFIGURATION: Release
run: cov-build --dir cov-int ninja -k 20 all
- name: Compress Results
working-directory: ./build
run: tar zcf cov-scan.tgz cov-int
#Comment this out when testing to keep from running into upload limits
- name: Upload to Coverity
run: |
cd build
curl --form token=${{ env.coverity_token }} --form email=${{ env.coverity_email }} --form [email protected] --form version="$(git rev-parse HEAD)" --form description="Automatic GHA scan" 'https://scan.coverity.com/builds?project=scp-fs2open/fs2open.github.com'
+1
View File
@@ -250,6 +250,7 @@ documentation/doxygen/*
projects/*
/.vs
CMakeSettings.json
CMakePresets.json
# Weird files created by Linux
.fuse_hidden*
+1
View File
@@ -4,3 +4,4 @@
[submodule "lib/libRocket"]
path = lib/libRocket
url = https://github.com/asarium/libRocket.git
-175
View File
@@ -1,175 +0,0 @@
language: bash
sudo: required
dist: xenial
cache:
directories:
- $HOME/cmake-3.8
- $HOME/.ccache
- $HOME/curl_cache
addons:
apt:
packages: &global_deps
- ninja-build
- libopenal-dev
- libreadline6-dev
- libpng12-dev
- libjpeg62-dev
- liblua5.1-0-dev
- libjansson-dev
- libsdl2-dev
- libfreetype6-dev
- qt57base
coverity_scan:
project:
name: "scp-fs2open/fs2open.github.com"
notification_email: [email protected]
build_command: "ci/travis/script.sh"
# must match TRAVIS_BRANCH check below
branch_pattern: coverity_scan
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
# also note that fork's don't get access to secure keys
# you have to test using a branch in the main repo
- secure: "C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk="
# These declarations set INDIEGAMES_USER and INDIEGAMES_PASSWORD for uploading nightly builds to the indiegames server
- secure: "lUuRu8XIi8MKNf1ebOfyC4iVEpPyASojJIDWXRo2bNqEF4ILAljXdkVeXeN6H5yKCHD52cxCNTtyePIG/o3p3QEuGSVud9bDS3D7LaQicLETGGrsw3l07U49gF2OKHXGopg0MzBbZUU9QmhoFTAe8t6PV9NDuEayYCheqvTqjZg="
- secure: "E/DHLYcPK/hBUqxBYYlUqp5sjgvIqY5A0qRHyQ4bmjsB+WB/Xx71bGCSiF7hk6lTxar1ZI1i5RAXXh9AIvNVaYAIdEOlCP+q3gvwCYuc5naZEKmkxlUCf0oEL4O9Fye93A/3VkFHuBdC1TGPYYf69m4W5r4367wWO9dPRIdWpJA="
# These declarations set DATACORDER_USER and DATACORDER_PASSWORD
- secure: "dpBH/dDN3bmU/NFlh+2v9isNx9wX0ocoRy+W+kBXRH32sosUGp26REhMqgVRpBNP5oxPBU8ic5bEogxAYWCB+0xUygBbkxAwyMPgoA34s0OXdTCY/ofw14ni8qqV2Ffy7fQJbP/jkMURyiMHx3kBTxNv3YjxKJqLnOuOMlQLpT8="
- secure: "tLMRBD1Ufp5iKNwlqPDVbbuczgusaXNoBJyAnPATpJq2YwlkW4j3PqP9rW5vd85+52xam2EOP20w9PoBR5J6FLdiXRu4Lf7yCEhSHFAgowVqQj8QcJpPlyXr90bM4emFGrGqpdxVwxyQ5AFhKwLuEZKsI14GYLN+UMEwpNCMing="
deploy:
- provider: releases
api_key:
secure: "q619+eQTe7lv8UVphK4OIzU8Jw84KBbVkuprN2sWIubRcV3IbZr2+WahJoUMt+nyhiy3YjDYtstO2ZgkxupwnZgwGUBVIiD1c4SPuyy+HTjNMOtiVsEUHT2hf+xPAemWpTlK5HcwhMmHAOh6rt6dEj57QOg0gcmGiwD/tCbEriA="
skip_cleanup: true
file_glob: true
file: "/tmp/builds/*"
on:
condition: '"$RELEASE_BUILD" == true'
tags: true
- provider: script
script: bash ci/travis/ftp_deploy.sh
on:
condition: '"$NIGHTLY_BUILD" == true'
tags: true
- provider: script
skip_cleanup: true
script: bash ci/travis/ftp_deploy.sh
on:
condition: $TEST_BUILD = true
all_branches: true
matrix:
include:
# note that gcc Debug MUST be 1st for Coverity
- os: linux
env: CONFIGURATION="Debug" CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Debug" CC=gcc-9 CXX=g++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- g++-9
- *global_deps
- os: linux
env: CONFIGURATION="Debug" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
- os: osx
env: CONFIGURATION="Debug"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141 CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: linux
env: CONFIGURATION="Release" CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Release" CC=gcc-9 CXX=g++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- g++-9
- *global_deps
- os: linux
env: CONFIGURATION="Release" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
- os: osx
env: CONFIGURATION="Release"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141 CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
# There is a GCC compiler bug with MinGW that causes compilation failures on Windows at the moment
allow_failures:
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
fast_finish: true
before_install:
# ugly hack; if running a coverity scan abort all except the 1st build
# see note re gcc compiler above needing to be 1st
# also note that branch_pattern & the TRAVIS_BRANCH check must match
# unfortunately COVERITY_SCAN_BRANCH isn't defined until later in the
# build process
- if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi
- source "./ci/travis/check_release.sh"
- "./ci/travis/before_install.sh"
install:
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PATH="/c/Program Files/CMake/bin":$PATH; fi
- "./ci/travis/install.sh"
- export PATH=$HOME/cmake-3.6/bin:$PATH
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then QT_ENV_SCRIPT=$(find /opt -name 'qt*-env.sh'); source $QT_ENV_SCRIPT; fi
- "./ci/travis/before_script.sh"
script:
- if [ "$BUILD_DEPLOYMENT" = true ] ; then ./ci/travis/release.sh ; else ./ci/travis/script.sh ; fi
+18 -16
View File
@@ -39,21 +39,14 @@ endif(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
# Override standard CMake configurations
set(CMAKE_CONFIGURATION_TYPES Debug Release FastDebug CACHE STRING "Available configurations" FORCE)
PROJECT(FS2_Open)
set(FSO_LANGUAGES C CXX)
find_program(CCACHE_PROGRAM ccache)
# Currently only GCC support ccache properly without generating additional warnings
if(CCACHE_PROGRAM AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
if(NOT CMAKE_C_COMPILER_LAUNCHER)
message(STATUS "Using ccache for C compilation: ${CCACHE_PROGRAM}")
SET(CMAKE_C_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
endif()
if(NOT CMAKE_CXX_COMPILER_LAUNCHER)
message(STATUS "Using ccache for C++ compilation: ${CCACHE_PROGRAM}")
SET(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE_PROGRAM})
endif()
if(APPLE)
set(FSO_LANGUAGES ${FSO_LANGUAGES} OBJC OBJCXX)
endif()
PROJECT(FS2_Open LANGUAGES ${FSO_LANGUAGES})
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_EXE_DIR "IMPORT_EXE_DIR-NOTFOUND" CACHE FILEPATH "Required for a cross compiling build, point to binary directory of a cmake build for the real OS")
INCLUDE(${IMPORT_EXE_DIR}/ImportExecutables.cmake)
@@ -82,9 +75,11 @@ IF(RESET_INSTALL_PREFIX)
ENDIF(NOT $ENV{FS2PATH} STREQUAL "")
ENDIF(RESET_INSTALL_PREFIX)
IF (WIN32)
OPTION(FSO_USE_SPEECH "Use Windows specific text-to-speach libraries" ON)
IF(WIN32 OR APPLE)
OPTION(FSO_USE_SPEECH "Use text-to-speach libraries" ON)
ENDIF(WIN32 OR APPLE)
IF (WIN32)
OPTION(FSO_USE_VOICEREC "Enable voice recognition support" ON)
OPTION(FSO_BUILD_FRED2 "Build FRED2 binary" ON)
@@ -128,8 +123,11 @@ option(FSO_RELEASE_LOGGING "Enable logging output for release builds" OFF)
OPTION(FSO_BUILD_WITH_FFMPEG "Enable the usage of FFmpeg for sound and custscenes" ON)
OPTION(FSO_BUILD_WITH_OPENGL "Enable compilation of the OpenGL renderer" ON)
OPTION(FSO_BUILD_WITH_OPENGL_DEBUG "Enables debug option for OpenGL" OFF)
OPTION(FSO_BUILD_WITH_VULKAN "Enable compilation of the Vulkan renderer" ON)
OPTION(FSO_BUILD_WITH_VULKAN "Enable compilation of the Vulkan renderer" OFF)
OPTION(FSO_BUILD_WITH_OPENXR_DEBUG "Enables debug option for OpenXR" OFF)
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
@@ -142,7 +140,9 @@ mark_as_advanced(FORCE ENABLE_COTIRE)
mark_as_advanced(FORCE FSO_RELEASE_LOGGING)
mark_as_advanced(FORCE FSO_BUILD_WITH_FFMPEG)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENGL)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENGL_DEBUG)
mark_as_advanced(FORCE FSO_BUILD_WITH_VULKAN)
mark_as_advanced(FORCE FSO_BUILD_WITH_OPENXR_DEBUG)
# Include cotire file from https://github.com/sakra/cotire/
include(cotire)
@@ -207,8 +207,10 @@ include(package)
include(doxygen)
# Print used options to log
IF (WIN32)
IF(WIN32 OR APPLE)
message(STATUS "Using text to speech: ${FSO_USE_SPEECH}")
ENDIF()
IF (WIN32)
message(STATUS "Using voice recogition: ${FSO_USE_VOICEREC}")
message(STATUS "Building FRED2: ${FSO_BUILD_FRED2}")
elseif(UNIX)
+617
View File
@@ -3,6 +3,618 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
## [23.2.0] - 2023-06-16
### Changes
<details><summary> <b>Big Feature: MSAA</b> </summary>
> The return of a long forgotten feature, with optimizations and improvements
> Noticeable reduction to artifacts caused by subpixel geometry and glinting.
</details>
<details><summary> <b>Big Feature: SCPUI</b> </summary>
> A modernized approach to defining menus in FS
> Tired of having your Menus in FSO be at a resolution of potato? Use SCPUI to have them rendered from Fake-HTML to the actual screensize as opposed to a prebuilt graphics!
> Tired of being limited to whatever people in the SCP hardcoded in for buttons? Use SCPUI to define buttons and all other manner of shenanigans as Lua-code just as you like.
> Tired of needing to replace a bajillion interface graphics to reskin FSO? Use SCPUI, and especially Mjn's existing collection of Lua, CSS, Fake-HTML and images, and you only need to replace about 250 graphics.
</details>
<details><summary> <b>Big Feature: Localized Volumetric Nebulae</b> </summary>
> Allows specifying a POF as the "hull" of a nebula, which will be rendered using ray marching
> Further details can be found on the [GitHub Pull Request](https://github.com/scp-fs2open/fs2open.github.com/pull/5231)
> Note: As this is a new feature, many improvements and optimizations remain to be made
> Adapted from Andrew Schneider's 2015 SIGGRAPH talk "The real-time volumetric cloudscapes of Horizon: Zero Dawn"
</details>
<details><summary>Game: </summary>
- Per bank autoaim
</details>
<details><summary>Animation: </summary>
- Fix CTD on bad legacy animation data
- Add proper time wrapping for Animations
- Actually handle a mssing `Fade_anim` properly
</details>
<details><summary>Controls: </summary>
- Organize and map additional keys to librocket
- Catch when SDL fails to open a joystick that is enumerated by the OS
</details>
<details><summary>FRED: </summary>
- Add SpaceMouse support
- Add pre-parse enums support
- Add music player to FRED
- Enhanced SEXP comments
- FRED Dialog for Volumetrics
- QoL improvements to Object Editor
- Add FRED support for the "required weapon" feature
- SEXP Tree search and filter
</details>
<details><summary>QtFRED: </summary>
- Campaign Editor
- Add SpaceMouse support
- Make 'player starts in chase view' a toggle
</details>
<details><summary>Graphics: </summary>
- "The other great shader flag removal effort"
- Enhance handling of motion debris
- Expose texture filtering as a built-in option
- Improved particle culling and performance
- Optimized trail renderer
- Beam Particles
- Multiple lighting profiles
- Use volume particles for poofs
- Optimize for simple trails
- Kink shamed the laser bitmaps
</details>
<details><summary>HUD: </summary>
- Flag to apply HUD shudder to chase view
- Add missing HUD gauges
- Explicitly do not split lines when making the message log
</details>
<details><summary>Localization: </summary>
- Add some XSTR entries
</details>
<details><summary>Modding: </summary>
- Mapify built-in strings
- Allow `gameplay_profiles.tbl` to be an alias of `ai_profiles.tbl`
- Modular rank table
- Toggle auto-assigning personas
- Add some parameters for corkscrew starting angle
- Add clip planes to `game_settings.tbl`
- Add `+Use ship` as a Template
- Modular messages table
- Add arbitrary curves support
- Traitor overrides
- Add support for loose lz4 compressed files
- Add per-species warp effects
</details>
<details><summary>Models: </summary>
- Fix submodel sanity check
- Fix techroom modelnum references
- Adjust movement sanity checks to account for more situations
- Modular POF Features 2
- Add fov values to .pof models
- Add a Translation Moveable
- Remove model octants
- Fix glowpoints on animated submodels
- Update type_flags when dock name changes
- Add additional checks for Animation List handling of nonexistent polymodel instances
- Virtual POFs: Modify Subsystems
- Validate chunk size to avoid alignment crash and add align skip flag
</details>
<details><summary>Multiplayer: </summary>
- Generic Lua Multiplayer RPC
</details>
<details><summary>Performance: </summary>
- Increase sound update rate
- Add `line of sight` as an optional AI override
</details>
<details><summary>SEXPs: </summary>
- `turret-fired-since`, returns `true` if the specified turret has fired in the last `N` milliseconds
- `is-ship-emp-active`, returns `true` if the specified ship or list of ships is currently under an EMP effect
- `turret-has-primary` and `turret-has-secondary`, returns `true` if the specified turret contains the specified weapon
- `has-armor-type`, returns `true` if the specified ship or subsystem has the specified armor type
- `OPF_ANY_HUD_GAUGE` and `OPF_EVENT_NAME`, new Lua SEXP parameters
- Enhance Dynamic SEXPs with parent parameters
- Add "afterburn hard" AI goal flag
</details>
<details><summary>Scripting: </summary>
- Add option to deprecate hooks
- Get audiostream duration in float seconds
- Lua method to check if the game has focus
- `On warp complete` hook
- Allow Lua to set the Discord presence to custom strings
- Add virtvars for goal satisfaction and score
- Allow scripts to read and add LuaEnums
- Funcs and virtvars for SCPUI pause screen
- Expose pausing weapon sounds
- Make collision_group_id accessible to parse objects
- Pass shortcut key character to Lua as a hook variable
- Lua method to free all loaded models
- `On Asteroid Created` hook
- SCPUI methods required for handling closeup briefing icons
- Expose some Nebula settings to Lua
- SCPUI mission log
- SCPUI APIsfor the Game Help UI, medals access, and control config
- Force expand wings instead of toggle for SCPUI
- Add misc. validity checks
- Convert hotkey types to enum
- Finalize SCPUI API
- Blocking `On Frame` executor
- SCPUI Hud Config API
- Configurable restriction for ships that accept Lua player orders
- Add `ship::isPlayer()`
- Lua access to default countermeasures class
- Flag to check if a ship or weapon class is player allowed
- Add hooks for comm menu opening/closing
</details>
<details><summary>Technical: </summary>
- Improve CFLAGS handling
</details>
## [22.2.0] - 2022-08-06
```
Changelog note:
As of this version, in an attempt to make the changelog easier to navigate and read,
each section will have collapsible subsections, ordered alphabetically by topic.
Headlining features will always be on top.
```
### Added
<details><summary> <b>Big Feature: SEXP Containers</b> </summary>
> As opposed to a SEXP variable, which stores only one value, a SEXP container stores a collection of values.
> Consequently, containers allow for handling data in much more sophisticated ways than variables.
> Containers come in two types:
> * List container - an ordered sequence of values, sort of a cross between Python lists and deques
> * Map container - pairs of keys associated with data, like Lua tables or Python dictionaries
> Further details in the [SEXP Containers announcement thread](https://www.hard-light.net/forums/index.php?topic=98209.0)
</details>
<details><summary> <b>Big Feature: LuaAI</b> </summary>
> LuaAI allows scripters to add a new AI Goal (like ai-chase) that will run script instead of internal logic.
> Adding a Lua AI section in a -sexp.tbm and a few functions to a corresponding -sct.tbm to define the AI logic in certain conditions. More documentation on these functions is available in the LuaAISEXP-Object of the Scripting Docs.
</details>
<details><summary>AI:</summary>
- `$AI ignores aspect lock for leading:` Flag, which lets AI continue to lead their target while performing an Aspect Lock
</details>
<details><summary>Animation: </summary>
- `pause on reverse` Flag
</details>
<details><summary>Controls: </summary>
- Handle international keyboard layouts
- Re-Add `-joy-info` command line flag, for slightly quicker Joystick GUID retrieval
- Add `-controlconfig_tbl` command line flag to print out a template controlconfigdefaults.tbl
</details>
<details><summary>FRED: </summary>
- Support the full number of nebula poofs using a multi-select list
- Add the ability to edit nebula fog colors, since that previously was not part of the FRED UI
- Flags `same-arrival-warp-when-docked` and `same-departure-warp-when-docked` to allow docked ships to still use custom warp parameters
- Allow highlighting custom-colored events by drawing a border on them
- Can now rotate objects relative to other objects in the Object Editor
- Dialog to calculate relative distance and orientation between ships
- Flag "Point using uvec" to point ships while incorporating the ship's uvec
- `ai-attackable-if-no-collide` flag, which prevents turrets from ignoring a target with `no_collide`
</details>
<details><summary>QtFRED: </summary>
- Reinforcements Dialog
- Implemented Replace Data for Number and String
- Texture Replacement Dialog
- TBL Viewer in the Ship Editor
</details>
<details><summary>Graphics: </summary>
- Allow particles to use a random chance for spawning through the `+Chance` parameter
- Command-line parameter `-fov_cockpit` which allows setting an FoV for the cockpit model separately from the viewport FoV. This allows using custom FoVs without distorting the cockpit
- Allow user to export environment map to a PNG from the F3 Lab by pressing M
- Weapon lights: Configurable lighting data for weapons, both on a per-weapon basis and globally via lighting profiles
- Implemented debug sphere queuing and rendering
</details>
<details><summary>Localization: </summary>
- Make strings for Match Speed Indicator, Glide Indicator, and Afterburner Indicator translateable
</details>
<details><summary>Modding: </summary>
- `game_settings.tbl` setting `$Supernova hits at zero:`, which causes Supernovae to hit when the timer gets to 0, instead of the default of hitting 5 seconds before the time is up
- `game_settings.tbl` settings `$Show-subtitle uses pixels:` and `$Show-subtitle base resolution:`, which can be used in conjunction to scale subtitles
- `game_settings.tbl` setting `$Always warn player about unbound keys used in Directives Gauge:`, to show such warning to players when needed (without it these warnings only apply to Training Missions)
- Ship flags `fail-sound-locked-primary` and `fail-sound-locked-secondary` to allow the firing fail sound to play if the player tries to fire weapons that are locked
- Subsystem Flag "hide turret from loadout stats"
- Allow weapon to override turret name with `$Turret Name:`
</details>
<details><summary>Multiplayer: </summary>
- Save PXO stats to local pilot file
</details>
<details><summary>Performance: </summary>
- Preload subspace tunnel if the `mission-set-subspace` SEXP is used in the mission
</details>
<details><summary>SEXPs: </summary>
- `cancel-future-waves`, for stopping wings that still had waves queued from spawning
- Added optional flag to `show-subtitle-text` and `show-subtitle-image` to not change the subtitle aspect ratio
- `set-nav-color` and `set-nav-visited-color`, which allows setting custom colors to Navpoints in a mission
</details>
<details><summary>Scripting: </summary>
- Support for decals (see `decaldefinition` in the Scripting documentation)
- Missile list iterator: `mn.getMissileList()`
- Campaign Start hook: `On Campaign Begin`
- Player Loaded hook: `On Player Loaded`
- Added a few functions to get information on HUD gauges (check `HudGauge` in the Scripting documentation)
- Function `ship.checkVisibility` which checks if a ship can appear on the viewer's radar
- Function `hu.flashTargetBox` which causes the target box to flash
- Function `hu.getTargetDistance` to return the distance to target as reported by the HUD
- Function `mn.hasLineOfSight` which checks if one point has line of sight to the other
- Function `mn.getLineOfSightFirstIntersect` which checks for line of sight and returns the distance of the first interruption if not
- Variable `gr.CurrentResizeMode`, which can get or set the scaling mode to be used by the `gr.*` drawing methods
- Function `gr.draw3dLine`, which draws a line in space between two points
- Allow SCPUI to run `$On Briefing Stage:` hooks
- New bindings to allow proper hooking into control actions based on the control's enumeration name
- Allow scripted controls to override hardcoded functionality
- Fennel script support
- Lua BitOp 1.0.2 extension library, allowing the usage of bit operations
</details>
<details><summary>Technical: </summary>
- Class encapsulation for Volition's linked list
- Improve a debug console message to be more informative
- Type-safe `TIMESTAMP` class
- Add `timestamp_since()` function
- Add methods to compare timestamps, calculate deltas from an existing timestamp and a number of milliseconds, and to calculate deltas between timestamps
- Create a command line option for logging data packets
- Add more information to Multi-related debug logging
- Enable Doxygen for QTFred
- Set up Mac builds on CI, allowing builds to be published automatically for Mac
- Add some logging to `waitAsync`
</details>
### Changed
<details><summary>Game: </summary>
- Only display one popup when the player gets to the main hall
- Allow an unlimited number of ship flags to be parsed at once
</details>
<details><summary>AI: </summary>
- Improve Player Orders to allow for a nearly unlimited number of player orders, as opposed to the 32 before
- Update `ai_turn_towards_vector` to use a target velocity for banking
</details>
<details><summary>Audio: </summary>
- Allow unlimited soundtracks and spooled music (Previously limited to 30 and 50 respectively)
- Allow unlimited sound effects
- Dynamically set the maximum number of audio channels based on how many the user's system can support
</details>
<details><summary>FRED: </summary>
- CTRL+V is now add-paste (used to be CTRL+P)
- CTRL+SHIFT+V is now overwrite-paste (used to be CTRL+V)
- Replace `Always_show_goals` with `Toggle_showing_goals` which toggles whether the goals are shown, and works in any mission (instead of only Training Missions)
- No longer disable icon dropdowns for models that have their own icons
- No longer change the ship class when the icon type is a special popup
- Make the number of player orders FRED can handle dynamic
- Restore original Error Checking behavior where the function would exit after one check (for consistency)
- Exclude player ships from Error Checking for ships in a wing sharing the same orders
- Split "No subsystems found" and "Not all subsystems have a record in ships.tbl" warnings into two different warning flags
</details>
<details><summary>Graphics: </summary>
- Improved light attenuation to look more real
- Increase POF vertex limit, allowing up to `2^32 - 1` vertices to be used by a single subobject
</details>
<details><summary>Performance: </summary>
- Delay `ai_new_maybe_reposition_attack_subsys` to only run once a second. Before this change, it could take around 13% of runtime in crowded missions
- Cached subsystem indexing, speeding up subsystem lookups, which run for multiple ships, multiple times per frame
</details>
<details><summary>Scripting: </summary>
- Enhance help text for Lua SEXPs
- Converted the following Lua Hooks to the new format to add documentation: `On Death`, `On Game Init`, `On Ship Collision`
</details>
<details><summary>Technical: </summary>
- Turn `insertion_sort` into a templated function that uses assignment
- CMake: Update `PREBUILT_VERSION_NAME` to latest (mac libs)
- Optimized space used in the new POF version
- Cleanup model code
- Cleanup beam light functions by consolidating some duplicated code and removing unreachable logic
- Cleanup wing wave code
- Move special parsing functions into new `parsehi.cpp` and `parsehi.h` files
- Actually clear delayed SSM parsing data when it's no longer needed
- Allow C++ to interact more with LuaTables, allowing it to extract userdata like objects or ships from them
- Use `SCP_string` for constructing multi/event log lines
- Replace `+Orders Accepted:` Bitfield with flag list
- Handle deprecated command line flags programmatically, avoiding lots of code duplication
- Set up debug_filter.cfg to have default filters that can be turned off
</details>
### Removed
<details><summary>FRED: </summary>
- Remove the `Allow Daisy-Chained Docking` mission flag
- Remove "Delete Item" from the right-click menu in the Event Editor
</details>
<details><summary>Technical: </summary>
- Remove light filtering data which didn't work and increased code complexity
- Remove a pointless assert that checked if `SEXP_NODE_INCREMENT` (a define, set at 250) was greater than zero
</details>
### Fixed
<details><summary>Game: </summary>
- Missing whitespace in credits
- Stopped destroyed submodels from showing in Techroom
- Prevent a crash when an object dies in the same frame as their goal
- Always record primary bank ammo capacity during ship creation, preventing situations where a ballistic weapon would accidentally be set to zero ammo
- Properly remove ships from the Techroom when they're not in the Tech Database
- Load the correct Techroom data after a Tech Database Reset
- Don't tick Supernova timer while the game is paused
- Make `set-camera-facing` use default identity orientation when the `$Use host orientation` flag is active and no host is present
- When a hotkey text replacement string refers to an unbound control, use the name of the binding instead of "none"
- Fix usage of default tech database flags
- Prevent a crash in the loadout screen with a weapons-locked ship
- Fix two crashes in the F3 lab
- End the campaign properly when a mission is skipped, preventing crashing in some situations
- Prevent a crash when a message is sent from an invalid source
- Prevent a broken campaign state if the player quits the game from the options menu during the debriefing
- Add some checks before converting a message to Command
- Prevent accidentally skipping cutscenes caused by hitting the spacebar during a loading screen
- Fixed an issue where ships would start with the wrong hull values in Red Alert missions
</details>
<details><summary>AI: </summary>
- Fix turret swarm weapons by removing a few checks that are no longer valid
- Fix a few issues with maneuvers
</details>
<details><summary>Animations: </summary>
- Fix broken turret animations in the Techroom
</details>
<details><summary>Audio: </summary>
- Fix cockpit engine sound volume changing unexpectedly
- Fix a timing bug that would sometimes prevent music from being initialized when re-playing a mission
- Check all possible extensions for audio files
</details>
<details><summary>Controls: </summary>
- Flush the mouse state after toggling between `Use_mouse_to_fly` states, preventing situations where a stale mouse state would be used
- Fix a conflict between Free Look View controls and directional thrust controls
</details>
<details><summary>FRED: </summary>
- Prevent Ship Select Dialog from crashing if there are too many IFFs
- Support saving nebula fog colors
- Properly save `nav-carry-status` flag
- Don't treat a bare `<argument>` as an error
- Prevent adding duplicated variables and display an error to the user when they try
- Clean up some parse problems
- Fix assignment of alt-name when using the hash
- Guard against off-by-one errors in `replace_one` and `replace_all`
- Improve error checking of campaign loop branches
- Improve error reporting for bad SEXP nodes
- Prevent a crash with paste/add-paste when the clipboard was empty
- Prevent rounding/conversion issues that caused FRED to think an angle or position was modified when it wasn't
- Skip absent ships or wings when running `clear-goals`, instead of stopping the whole operation
</details>
<details><summary>Graphics: </summary>
- Disable Lightshafts while the Supernova glare effect is active. This partial fix ensures the glare shows up with the correct brightness
- Update and correctly load environment maps in F3 Lab
- Correctly set textures and Team Colors with `change-ship-class`
- Fixes Team Colors not working with `show-ship`
- Correct positioning and angles for background bitmaps and suns
- Clean up ship arrival and departure effects
- Fix clearing a skybox model when it isn't the mission default
- Fix an assertion with Fireball LODs which would wrongly trigger if the number of LODs was the same as the maximum
</details>
<details><summary>HUD: </summary>
- Make HUD Target distance consistent
- Fix a crash with scripted HUDs
- Correctly update RTT Cockpit Gauges with `change-ship-class`
- Ignore HUD brackets with a size of zero or less (instead of just crashing)
- Squad menu wasn't scrolling properly with PageDown in some cases
- Fix issues with loading of hud config presets
- Fix parsing issues with HUD color presets
- Continue parsing remaining gauges if one isn't found
- Use translated strings both when saving and loading
- Fix an issue where a target's orders would be displayed wrongly in the target box
- Fix asteroid brackets disappearing or displaying wrong values
</details>
<details><summary>Modding: </summary>
- Delay processing `$Player Weapon Precedence:` until after parsing, avoiding ships starting with the wrong weapons in some situations
- Make the `$Player Weapon Precedence:` list actually give precedence
- Empty `+Orders Accepted List:` entries were causing the ship to accept the default orders, instead of no orders as would be correct
- Show a Warning if a turret submodel is not an immediate child of the base object and handle it as a single-part object to prevent a crash
</details>
<details><summary>Multiplayer: </summary>
- Limit client collisions to prevent bugs, such as flinging players with high pings who collided multiple times between packet updates
- Fix multiple timestamp issues
- Multi messaging and multi pause screen
- Make sure maintenance stuff (pings, voice, file xfer, etc.) isn't affected by pausing or time compression
- Sync issues caused by options menu and screenshots
- Prevent an error with long messages in PXO Chat by using proper buffer size
- Fix some issues with Multiplayer SEXPs
- Try to handle incompatible sexp packets better
- Fix operator name issue with debug messages
- Enable the new show-subtitle-text options
- Improve interpolation, fixing the jerkiness that used to occur when the interpolation code basically guessed the timing on when packets were coming in
- Fix rollback primary collisions, vastly improving accuracy on moving targets even at high pings
- Fix the standalone ship being added to ship list
- Stop non-printable keys adding text to multi message buffer
- Prevent the standalone from crashing if a player tried to switch secondaries in a ship that doesn't have secondaries
- Fix a standalone crash from disabled uniform buffer manager
- Prevent a crash related to Observer-type players
- Fix network issues on MacOS
</details>
<details><summary>Scripting: </summary>
- Make hook conditions consistent and handle combinations that didn't work properly before
- Fix `maybePlayCutscene` arguments
- Add `isActive` checks for new-style script hooks
- Sync the two `VIRTVAR`s for Orientation in subsystems and submodel instances, which behaved in different ways
- Fixed a few timing and framerate related issues for playing movies via script
- Ensure the Lua interpreter has enough space in its stack, and allow reserving more space if necessary
- Fixed an memory leak in the Lua interpreter caused by string-eval sexps, which never cleaned up the generated code
</details>
<details><summary>SEXPs: </summary>
- Avoid setting .rest for `Locked_sexp_true/false` with malformed SEXPs
- Fix some memory management problems in the `for-*` operators, avoiding a memory leak
- Fix crash when removing form-on-wing order with `remove-goal`
- Fix `show-subtitle` SEXP which was missing the `width` argument
- Reset volumes changed via `adjust-audio-volume` when the mission closes
- Prevent too many dynamic SEXPs from breaking the SEXP system
</details>
<details><summary>Technical: </summary>
- Check if index is valid before accessing `Weapon_info`, preventing CTDs under certain conditions
- When `weapon_create` was called while `MAX_WEAPONS` was reached, the previous algorithm didn't achieve desired results, and simply locked up the game. Instead, we now simply won't allow a new weapon to be created in such condition
- Refactored Supernova code and fixed some state transition issues in it
- Prevent crashes in the event of a subsystem mismatch during `change_ship_type`
- Change include order to fix compilation of unit tests on Mac
- Patch freeing of SEXP nodes, preventing a crash in certain conditions
- Fix a memory leak in model code
- Fix a crash in the Ship Creation code if a ship's name was exactly the maximum allowed length
- Removed vestigial bit-depth asserts for aabitmaps, preventing crashes with certain image types
- Prevent a crash when Escort Priority was parsed for a ship not present in the Escort List
- Fix a bunch of graphics functions to respect GR_STUB, preventing problems in standalone server
- Clean up line endings in several files (replaced CRLF with LF basically everywhere)
- Fixed a timestamp issue which helps lay the groundwork to add In-Game Joining to multiplayer
- Prevent pilot and campaign files from having invalid values, by clamping them within the expected ranges when saving and loading
- Also warn the player if such an invalid value was detected, telling them which setting had the wrong value and what it was reset to
- Try to avoid assertions by preventing invalid types from being handled by `obj_team()`
- Shut down the SEXP system before the Scripting system, otherwise a crash could happen if the SEXP system held references to Lua
</details>
----
## [22.0.0] - 2022-04-01 ([Thread](https://www.hard-light.net/forums/index.php?topic=98125.0))
### Changed
- Controls5 PR (aka multi-joy)
- Timing system upgrade
- Model animation code upgrades
## [21.4.0] - 2021-09-27 ([Thread](https://www.hard-light.net/forums/index.php?topic=97802.0))
### Changed
- Multiple features; see thread
- Multiple bugfixes; see thread
### Deprecations
- `script-eval` has been deprecated in favor of `script-eval-block`
- renamed `hud-set-retail-gauge-active` to `hud-set-builtin-gauge-active`
## [21.2.0] - 2021-05-02 ([Thread](https://www.hard-light.net/forums/index.php?topic=97561.0))
### Changed
- Added a dynamic action system for more modder control of effects
- Removed fireball limit
- Fixed bomb intercept in multiplayer
- Changed nebula fog distance from a linear to exponential model
- Turrets on moving subobjects enabled
- LZ4 Compression added for game files
## [21.0.0] - 2021-01-27 ([Thread](https://www.hard-light.net/forums/index.php?topic=97293.0))
### Changed
- More OpenGL optimizations
- Full type information output for Lua documentation. Very useful for writing Lua scripts.
- A new -weaponspew command-line option for printing MediaVP-style statistics, plus a weapon comparison spreadsheet, to the debug log.
- Improved ship lookup behavior in SEXPs for improved performance.
- BPTC/BC7 texture compression support
- Refactoring and new features for the ship lab.
- Missile multi-lock. It's finally in an official build!
- Enhancements to the model code in preparation for cool features in 21.2.
- IPv6 support for multiplayer
- A lot of general fixes for multiplayer.
### Deprecated
- Dropped support for Windows XP
- Scripting:
- `ba.getFrametime()`: The parameter value was used incorrectly inside the implementation. To avoid breaking existing scripts and to improve readability this has been split into `ba.getMissionFrametime()` and `ba.getRealFrametime()`.
- `gr.drawMonochromeImage()`: `gr.drawImage()` got a new parameter for drawing monochrome images and is more flexible in general so the monochrome variant is no longer needed.
## [19.0.0] - 2020-01-25 ([Thread](https://www.hard-light.net/forums/index.php?topic=96226.0))
### Meta
- With this release we decided to drop the "`3.Major_revision.Minor_revision`" versioning scheme in favor of a year based scheme since the Major and Minor versions did not have much meaning anymore. Instead the scheme will now be "`<year>.<number that is incremented every release>.0`". The last 0 is still there because some of our systems expect that. It will be gone at some point.
@@ -25,6 +637,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- Refactored bitmap slot handling and removed the fixed upper limit on the number of bitmaps. No more bmpman corruption!
## [3.8.0] - 2017-08-22 ([Release Thread](https://www.hard-light.net/forums/index.php?topic=93812.0))
### Added
- Support for APNG animations: [APNG](https://en.wikipedia.org/wiki/APNG) is a variant of the established PNG format which allows to store animations instead of single frames in a PNG file. This change allows to use these animation files in FSO which significantly improves usability for modders since they no longer have to store all individual frames as separate images.
@@ -49,6 +662,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Fixed
- "Tons" of bugfixes
## [3.7.2] - 2015-04-23 ([Release thread](http://www.hard-light.net/forums/index.php?topic=89597.0))
### Added
- MediaVPS 2014 Support
@@ -79,16 +693,19 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Raised the per-model debris limit to 48 (previously 32).
- Increased the per-frame debris limit to 96 (previously 64)
## [3.6.18] - 2013-03-01 ([Release thread](http://www.hard-light.net/forums/index.php?topic=83889.0))
### Fixed
- Critical damage bug which caused heavy balance issues in the game
## [3.6.16] - 2013-01-31 ([Release thread](http://www.hard-light.net/forums/index.php?topic=83577.0))
### Added
- Diaspora TC support
### Changed
- Performance Improvements
## [3.6.14] - 2012-10-23 - ([Release thread](https://www.hard-light.net/forums/index.php?topic=82648.0))
### Added
- Objecttype tables support for deciding how enemies respond to ship classes when disabled
-2
View File
@@ -1,7 +1,5 @@
FreeSpace2 *S*ource *C*ode *P*roject
==
[![Travis-CI Build Status](https://travis-ci.org/scp-fs2open/fs2open.github.com.svg?branch=master)](https://travis-ci.org/scp-fs2open/fs2open.github.com)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/scp-fs2open/fs2open.github.com?branch=master&svg=true)](https://ci.appveyor.com/project/SirKnightly/fs2open-github-com/branch/master)
[![Coverity](https://img.shields.io/coverity/scan/870.svg)](https://scan.coverity.com/projects/870)
Building
-62
View File
@@ -1,62 +0,0 @@
version: 1.0.0.{build}
image: Visual Studio 2015
configuration:
- Debug
- Release
clone_depth: 10
environment:
matrix:
- BuildID: 0
CMAKE_GENERATOR: Visual Studio 14 2015
PlatformToolset: v140
QT_DIR: C:\Qt\5.9\msvc2015
- BuildID: 1
CMAKE_GENERATOR: Visual Studio 14 2015 Win64
PlatformToolset: v140
QT_DIR: C:\Qt\5.9\msvc2015_64
before_build:
- git submodule update --init --recursive
build_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/build.ps1
test_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/test.ps1
deploy:
- provider: GitHub
auth_token:
secure: h55Scpy+3vmo1Yb7WlSIGA4d9DRnsbzUYc2LYsQdByQHZHbqrqjBpicH0D2FFLEO
on:
ReleaseBuild: true # deploy on release push only
- provider: FTP
protocol: sftp
host: scp.indiegames.us
username:
secure: SFivQZfatqWHXK1ijYK3GQ==
password:
secure: q6Zk/412o1ri+NEya1dl1Q==
folder: public_html/builds/nightly/$(VersionName)
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: sftp
host: porphyrion.feralhosting.com
username:
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
password:
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly/$(VersionName)
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: sftp
host: porphyrion.feralhosting.com
username:
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
password:
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$(VersionName)
on:
TestBuild: true # deploy on test build push only
-164
View File
@@ -1,164 +0,0 @@
class BuildConfig {
[string]$Generator
[string]$PackageType
[string]$Toolset
[string]$SimdType
[string]$QtDir
[Bool]$SourcePackage
}
$NightlyConfigurations = @(
# [BuildConfig]@{
# Generator="Visual Studio 14 2015 Win64";
# PackageType="Win64";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015_64";
# SourcePackage=$false;
# },
# [BuildConfig]@{
# Generator="Visual Studio 14 2015";
# PackageType="Win32";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015";
# SourcePackage=$false;
# }
)
$ReleaseConfigurations = @(
# [BuildConfig]@{
# Generator="Visual Studio 14 2015";
# PackageType="Win32";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015";
# SourcePackage=$true;
# }
# [BuildConfig]@{
# Generator="Visual Studio 14 2015";
# PackageType="Win32-AVX";
# Toolset="v140";
# SimdType="AVX";
# QtDir="C:\Qt\5.9\msvc2015";
# SourcePackage=$false;
# }
# [BuildConfig]@{
# Generator="Visual Studio 14 2015 Win64";
# PackageType="Win64";
# Toolset="v140";
# SimdType="SSE2";
# QtDir="C:\Qt\5.9\msvc2015_64";
# SourcePackage=$false;
# }
# [BuildConfig]@{
# Generator="Visual Studio 14 2015 Win64";
# PackageType="Win64-AVX";
# Toolset="v140";
# SimdType="AVX";
# QtDir="C:\Qt\5.9\msvc2015_64";
# SourcePackage=$false;
# }
)
$BuildConfigurations = $null
# Default values
$ReleaseBuild = $false
$NightlyBuild = $false
$TestBuild = $false
# Set to true to test either the release or the nightly part of this script
$ReleaseTest = $false
$NightlyTest = $false
$TestBuildTest = $false
if ($ReleaseTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)"))) {
# Tag matches
$ReleaseBuild = $true
$PackageName = "fs2_open_$($matches[1])"
$BuildConfigurations = $ReleaseConfigurations
}
if ($NightlyTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)"))) {
# Tag matches
$NightlyBuild = $true
$PackageName = "nightly_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
$BuildConfigurations = $NightlyConfigurations
}
if ($TestBuildTest -Or ([System.Convert]::ToInt32($env:APPVEYOR_PULL_REQUEST_NUMBER) -le 0 -And ("$env:APPVEYOR_REPO_BRANCH" -match "^test\/(.*)"))) {
# Tag matches
$TestBuild = $true
$PackageName = "test_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
$BuildConfigurations = $NightlyConfigurations
# Override the revision string so that the builds are named correctly
[System.IO.File]::WriteAllLines("$env:APPVEYOR_BUILD_FOLDER/version_override.cmake", "set(FSO_VERSION_REVISION_STR $env:VersionName)")
}
# Multiply by 2 so that we can add 0 or 1 for debug or release Configs
$buildID = [convert]::ToInt32($env:BuildID) * 2
if ($Env:Configuration -eq "Release") {
$buildID = $buildID + 1
}
$DeployBuild = $false
if ($ReleaseBuild -Or $NightlyBuild -Or $TestBuild) {
$DeployBuild = $true
}
Set-AppveyorBuildVariable 'ReleaseBuild' "$ReleaseBuild"
Set-AppveyorBuildVariable 'NightlyBuild' "$NightlyBuild"
Set-AppveyorBuildVariable 'TestBuild' "$TestBuild"
New-Item build -type directory
Set-Location -Path build
if ($DeployBuild) {
# Release build
if ($buildID -ge $BuildConfigurations.Length) {
# Not needed
exit 0
}
$buildConfig = $BuildConfigurations[$buildID]
if ($buildConfig.SourcePackage -eq $True) {
7z a -xr'!.git' "$($PackageName)-source-Win.zip" "$env:APPVEYOR_BUILD_FOLDER"
Push-AppveyorArtifact "$($PackageName)-source-Win.zip"
}
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$($buildConfig.SimdType)" `
-DQT5_INSTALL_ROOT="$($buildConfig.QtDir)" -DFSO_BUILD_QTFRED=ON `
-DFSO_INSTALL_DEBUG_FILES="ON" `
-G "$($buildConfig.Generator)" -T "$($buildConfig.Toolset)" ..
$Configs = @("Release", "FastDebug")
foreach ($config in $Configs) {
cmake --build . --config "$config" --target INSTALL -- /verbosity:minimal
if (! ($?)) {
Add-AppveyorMessage "A release build failed!"
exit 1
}
}
7z a -xr'!*.pdb' "$($PackageName)-builds-$($buildConfig.PackageType).zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
Push-AppveyorArtifact "$($PackageName)-builds-$($buildConfig.PackageType).zip"
7z a "$($PackageName)-debug-$($buildConfig.PackageType).7z" "$env:APPVEYOR_BUILD_FOLDER/../install/*.pdb"
Push-AppveyorArtifact "$($PackageName)-debug-$($buildConfig.PackageType).7z"
} else {
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="ON" -DFSO_BUILD_TESTS="ON" -DMSVC_SIMD_INSTRUCTIONS=SSE2 `
-DFSO_BUILD_QTFRED=ON -DQT5_INSTALL_ROOT="$env:QT_DIR" -DFSO_BUILD_FRED2="ON" `
-G "$Env:CMAKE_GENERATOR" -T "$Env:PlatformToolset" ..
cmake --build . --config "$Env:CONFIGURATION" -- /verbosity:minimal
if (! ($?)) {
exit 1
}
}
-13
View File
@@ -1,13 +0,0 @@
if ([System.Convert]::ToBoolean($env:ReleaseBuild) -Or [System.Convert]::ToBoolean($env:NightlyBuild) -Or [System.Convert]::ToBoolean($env:TestBuild)) {
# Skip tests for deployment
exit 0
} else {
write "Running unit tests..."
# Run unit tests
&"$pwd\bin\$Env:CONFIGURATION\unittests.exe" --gtest_shuffle 2>&1
if (! ($?)) {
exit 1
}
}
+1 -1
View File
@@ -19,5 +19,5 @@ BASE_COMMIT=$(git merge-base $1 $2)
echo "Running clang-tidy on changed files"
git diff -U0 --no-color "$BASE_COMMIT..$2" | \
$HERE/clang-tidy-diff.py -path "$(pwd)/build" -p1 \
-regex '(code(?!\/graphics\/shaders\/compiled)|freespace2|qtfred|test|build|tools)\/.*\.(cpp|h)' \
-regex '(code(?!((\/graphics\/shaders\/compiled)|(\/globalincs\/windebug)))|freespace2|qtfred|test|build|tools)\/.*\.(cpp|h)' \
-clang-tidy-binary /usr/bin/clang-tidy-9 -j$(nproc) -export-fixes "$(pwd)/clang-fixes.yaml"
+38 -15
View File
@@ -1,26 +1,41 @@
#!/usr/bin/env bash
if [ "$COMPILER" = "gcc-5" ]; then
export CC=gcc-5
export CXX=g++-5
if [ "$COMPILER" = "gcc-9" ]; then
export CC=gcc-9
export CXX=g++-9
fi
if [ "$COMPILER" = "gcc-10" ]; then
export CC=gcc-10
export CXX=g++-10
if [ "$COMPILER" = "gcc-13" ]; then
export CC=gcc-13
export CXX=g++-13
fi
if [ "$COMPILER" = "clang-9" ]; then
# Work around bug in clang that uses the wrong installation directory: https://bugs.llvm.org/show_bug.cgi?id=47460
export CC=$(readlink -f $(which clang-9))
export CXX=$(readlink -f $(which clang++-9))
if [ "$COMPILER" = "clang-16" ]; then
export CC=clang-16
export CXX=clang++-16
fi
LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
if [ "$RUNNER_OS" = "macOS" ]; then
CXXFLAGS="-mtune=generic -pipe -Wno-unknown-pragmas"
CFLAGS="-mtune=generic -pipe -Wno-unknown-pragmas"
# TODO: Vulkan support is disabled on MacOS due to issues with the test suite not linking correctly
PLATFORM_CMAKE_OPTIONS="-DFSO_BUILD_WITH_VULKAN=OFF"
export CMAKE_OSX_ARCHITECTURES="$ARCHITECTURE"
else
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas -static-libstdc++"
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
PLATFORM_CMAKE_OPTIONS="-DFSO_BUILD_APPIMAGE=ON"
fi
CMAKE_OPTIONS="$JOB_CMAKE_OPTIONS"
if [[ "$COMPILER" =~ ^clang.*$ ]]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCLANG_USE_LIBCXX=ON"
# force clang to silently allow -static-libstdc++ flag
CXXFLAGS="$CXXFLAGS -Qunused-arguments"
fi
if [ ! "$CCACHE_PATH" = "" ]; then
echo "Using ccache at $CCACHE_PATH"
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_C_COMPILER_LAUNCHER=$CCACHE_PATH -DCMAKE_CXX_COMPILER_LAUNCHER=$CCACHE_PATH"
fi
mkdir build
@@ -30,6 +45,14 @@ export CXXFLAGS
export CFLAGS
export LD_LIBRARY_PATH
cmake -G Ninja -DFSO_FATAL_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $CMAKE_OPTIONS \
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DFSO_BUILD_APPIMAGE=ON -DCMAKE_BUILD_TYPE=$CONFIGURATION \
-DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=ON ..
if [ "$RUNNER_OS" = "macOS" ]; then
brew install ninja
fi
# CMAKE_JOB_POOLS and CMAKE_JOB_POOL_LINK ensure that when using ninja, link operations are done sequentially
# we have some build rules that do not play nice with parallel invocation and that fixes these issues
cmake -G Ninja -DFSO_FATAL_WARNINGS=ON -DCMAKE_EXPORT_COMPILE_COMMANDS=ON $CMAKE_OPTIONS $PLATFORM_CMAKE_OPTIONS \
-DCMAKE_INSTALL_PREFIX="$(pwd)/install" -DCMAKE_BUILD_TYPE=$CONFIGURATION \
-DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=${ENABLE_QTFRED:-OFF} \
-DSHADERS_ENABLE_COMPILATION=ON -DCMAKE_JOB_POOLS=link=1 -DCMAKE_JOB_POOL_LINK=link ..
+15 -9
View File
@@ -10,21 +10,27 @@ source $HERE/dist_functions.sh
if [ "$OS" = "Linux" ]; then
tar -cvzf "$(get_package_name)-builds-Linux.tar.gz" *
echo "::set-output name=package_path::$(pwd)/$(get_package_name)-builds-Linux.tar.gz"
echo "::set-output name=package_name::$(get_package_name)-builds-Linux.tar.gz"
echo "::set-output name=package_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Linux.tar.gz")"
echo "package_path=$(pwd)/$(get_package_name)-builds-Linux.tar.gz" >> $GITHUB_OUTPUT
echo "package_name=$(get_package_name)-builds-Linux.tar.gz" >> $GITHUB_OUTPUT
echo "package_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Linux.tar.gz")" >> $GITHUB_OUTPUT
elif [ "$OS" = "Windows" ]; then
7z a -xr'!*.pdb' "$(get_package_name)-builds-$ARCH-$SIMD.zip" "*"
echo "::set-output name=package_path::$(pwd)/$(get_package_name)-builds-$ARCH-$SIMD.zip"
echo "::set-output name=package_name::$(get_package_name)-builds-$ARCH-$SIMD.zip"
echo "::set-output name=package_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-$ARCH-$SIMD.zip")"
echo "package_path=$(pwd)/$(get_package_name)-builds-$ARCH-$SIMD.zip" >> $GITHUB_OUTPUT
echo "package_name=$(get_package_name)-builds-$ARCH-$SIMD.zip" >> $GITHUB_OUTPUT
echo "package_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-$ARCH-$SIMD.zip")" >> $GITHUB_OUTPUT
7z a "$(get_package_name)-debug-$ARCH-$SIMD.7z" "*.pdb"
echo "::set-output name=debug_path::$(pwd)/$(get_package_name)-debug-$ARCH-$SIMD.7z"
echo "::set-output name=debug_name::$(get_package_name)-debug-$ARCH-$SIMD.7z"
echo "::set-output name=debug_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-debug-$ARCH-$SIMD.7z")"
echo "debug_path=$(pwd)/$(get_package_name)-debug-$ARCH-$SIMD.7z" >> $GITHUB_OUTPUT
echo "debug_name=$(get_package_name)-debug-$ARCH-$SIMD.7z" >> $GITHUB_OUTPUT
echo "debug_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-debug-$ARCH-$SIMD.7z")" >> $GITHUB_OUTPUT
elif [ "$OS" = "Mac" ]; then
tar -cvzf "$(get_package_name)-builds-Mac-$ARCH.tar.gz" *.app
echo "package_path=$(pwd)/$(get_package_name)-builds-Mac-$ARCH.tar.gz" >> $GITHUB_OUTPUT
echo "package_name=$(get_package_name)-builds-Mac-$ARCH.tar.gz" >> $GITHUB_OUTPUT
echo "package_mime=$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Mac-$ARCH.tar.gz")" >> $GITHUB_OUTPUT
else
echo "Invalid OS: $OS"
fi
+8 -1
View File
@@ -5,7 +5,14 @@ HERE=$(dirname "$SCRIPT")
export LD_LIBRARY_PATH=$(pwd)/bin/lib:$LD_LIBRARY_PATH
if [ "$CONFIGURATION" = "Debug" ]; then
# if on mac and building for architecture that doesn't match host
# then unittests will fail so we just need to skip it (for now)
if [ "$RUNNER_OS" = "macOS" ] && [ "$ARCH" != "$(uname -m)" ]; then
echo "Skipping tests due to architecture mismatch!"
exit 0
fi
if [ "$CONFIGURATION" = "Debug"] && [[ "$RUNNER_OS" != "macOS" ]] ; then
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$HERE/valgrind.supp" ./bin/unittests --gtest_shuffle
else
+13 -3
View File
@@ -10,11 +10,21 @@ HERE=$(dirname "$SCRIPT")
source $HERE/dist_functions.sh
if [ "$UPLOAD_TYPE" = "nightly" ]; then
SSHPASS=$INDIEGAMES_SSHPASS upload_files_to_sftp "$INDIEGAMES_USER@scp.indiegames.us" "public_html/builds/nightly"
any_success=false
if SSHPASS=$INDIEGAMES_SSHPASS upload_files_to_sftp "$INDIEGAMES_USER@scp.indiegames.us" "public_html/builds/nightly"; then
any_success=true
fi
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@porphyrion.feralhosting.com" "www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly"
if SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@perses.feralhosting.com" "www/datacorder.perses.feralhosting.com/public_html/builds/nightly"; then
any_success=true
fi
if [ "$any_success" = "false" ]; then
echo "All uploads failed"
exit 1
fi
elif [ "$UPLOAD_TYPE" = "test" ]; then
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@porphyrion.feralhosting.com" "www/datacorder.porphyrion.feralhosting.com/public_html/builds/test"
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@perses.feralhosting.com" "www/datacorder.perses.feralhosting.com/public_html/builds/test"
else
echo "Unknown upload type $UPLOAD_TYPE"
exit 1
+169
View File
@@ -0,0 +1,169 @@
# Retrives a log of commit messages and attempts to pretty them into a human-readbile format
import argparse
import os
import re
import requests
import sys
from datetime import datetime
from subprocess import check_output
MAX_PAGES = 100 # maximum number of PR pages to go through
warnings = 0
def get_last_page(response: requests.Response) -> int:
"""
@brief Extract the last page number from the response header
@param[in] response The response from a GET call
@returns The page number of the last page, or MAX_PAGES
"""
# The link header is a dictionary in string form, and for that matter the
# value is in front of the key. It is of the form '<<url1>>; rel=<key1>, <url2>, <key2>'
link = response.headers['link']
link = link.split(',')
for x in link:
y = x.split(';') # <url>; rel=<key>
if "last" not in y[1]: # look for rel='last'
continue
# grab the page number from the URL
# group(0) is `page=123`, group(1) is `123`
last_page = int( re.search(r'page=(\d+)', y[0]).group(1) )
if not last_page:
print("Error: Could not find page number in url! URL: %s", y[0])
sys.exit(1)
if last_page > MAX_PAGES:
return MAX_PAGES
else:
return last_page
def main():
parser = argparse.ArgumentParser(description="Retrieves a log of commit messages and attempts to pretty them into a human-readable format")
parser.add_argument("start_date",
help="Day of the earliest commit to add to the log.")
parser.add_argument("-u", "--user", nargs=2, metavar=("NAME", "TOKEN"), default=["", ""],
help="Github username and token/password")
args = parser.parse_args()
os.chdir(os.path.dirname(__file__)) # Change working directory to this file's directory
start_date = datetime.strptime(args.start_date, "%Y-%m-%d")
print("start_date: {}".format(start_date))
# Retrive the git log for master, since start date, order by date, in ascending order, use YYYY-MM-DD date format,
# each line is of the form "<author short date> | <message>", only grab commits from master,
# output to `fsofordigest.txt`,
# check_output(("git log master", "--after=2021-09-15", "--date-order", "--reverse", "--date=short",
# "--pretty=\"%as | %s\"", "--first-parent",
# "--output fsofordigest.txt"), text=True)
# The commit messages are either of the form "<body> (#<PR_number>)" or "Merge pull request #<PR_number> from <source_repo>"
# For our purposes, we want them be all of the form "<body> (#<PR_number>)"
# Typically, the second form does not have a usable body, so we'll have to pull the PR title from github
# Github's REST API allows us to retrieve PR's, but due to it being HTTP requests it has to page in the data.
# We can loop over the GET request and check for a merge date.
# The GET request doesn't have sorting by merge date, but does have sorting by the last time it was updated... which is usually
# also the merge date but not always.
# Key attributes within the PR JSON objects:
# "merged_at: <date>" # Date the PR was merged in
# "merged: <bool>" # If the PR was merged yet
# "html_url: <string>" # URL of the PR's HEAD commit, used by some clients to pull in the PR branch
# "number: <int>" # The PR id number
# "title: <string>" # Title of the PR
# "body: <string>" # The body paragraph detailing the PR
# "labels: [label_object]" # All labels attached to this PR
changelog = {}
url = "https://api.github.com/repos/scp-fs2open/fs2open.github.com/pulls"
page = 1
last_page = MAX_PAGES
while page <= last_page:
# GET <url>?base=master&sort=updated&direction=desc&state=closed&page=1
response = requests.get(url,
auth=(args.user[0], args.user[1]),
params={
"base": "master",
"direction": "desc",
"page": page,
"state": "closed",
"sort": "updated"
})
# Check if good response
if (response.status_code != 200) :
print("Error: ", response.status_code)
print(response.json()['message'])
sys.exit(1)
else:
print("Request successful: 200")
print("page={}".format(page))
# Update the last_page index at first iteration and possibly last iteration
# This should cover the edge case of a new PR being added to the database before this script is finished
if (page == 1) or (page == last_page):
last_page = get_last_page(response)
print("last_page={}".format(last_page))
# assume pulls are organized from newest to oldest
for pull in response.json():
if (pull['state'] != 'closed'):
# This pull is not merged, so ignore
print("Found irrelevant pull, skipping...")
print("state: {}; number: {}".format(pull['state'], pull['number']))
continue
if (pull['merged_at'] == None):
# This pull wasn't merged, skip
print("Found closed pull #{} ({}), skipping...".format(pull['number'], pull['closed_at']))
continue
merge_date = datetime.strptime(pull['merged_at'], "%Y-%m-%dT%H:%M:%SZ")
updated_date = datetime.strptime(pull['updated_at'], "%Y-%m-%dT%H:%M:%SZ")
if (merge_date < start_date) and (updated_date >= start_date):
# This pull is too old, but was updated within our timeframe. skip
print("Found old pull #{} ({}), skipping...".format(pull['number'], pull['merged_at']))
continue
if (updated_date < start_date):
# This pull is too old
print("Found old pull #{} ({}), stopping loop...".format(pull['number'], pull['updated_at']))
page = last_page + 1
break
# Add the pull to the changelog, indexed by its pull.number
if pull['number'] not in changelog:
# only add if the key isn't there already
changelog[pull['number']] = {
"date": merge_date,
"title": pull['title'],
"labels": pull['labels'],
"url": pull['html_url']
}
print("Added pull #{} ({})".format(pull['number'], merge_date))
# Else, silently ignore duplicate (for now...)
page += 1 # iterate to next page
# Write the changelog to file
# 2021-09-28 | (#3661) Fix homing child weapons in niche circumstances
print("Writing to change.log...")
str = ''
for key, value in changelog.items():
str += "{} | (#{}) {} \n".format(value['date'].strftime("%Y-%m-%d"), key, value['title'])
with open("change.log", "w") as file:
file.write(str)
print("Done!")
main()
+228
View File
@@ -0,0 +1,228 @@
import re # regex module
from ftplib import FTP, error_perm
from itertools import groupby
from typing import List, Tuple, Dict
import requests # HTTP requests module
from util import retry_multi, GLOBAL_TIMEOUT # from util.py
class ReleaseFile:
"""! Class representing a Released file on Nebula
`name`: str
Mod (or build) name,
`url`: str
Primary host URL,
`group`: str
Mod group string,
`subgroup`: str
Mod subgroup string,
`mirrors`: List[str]
List of URL's of FTP mirrors
"""
def __init__(self, name, url, group, subgroup=None, mirrors=None):
if mirrors is None:
mirrors = []
self.mirrors = mirrors
self.subgroup = subgroup
self.group = group
self.url = url
self.name = name
self.base_url = "/".join(url.split('/')[0:-1]) + "/"
self.filename = url.split('/')[-1]
# A list of tuples of (filename, hash)
self.content_hashes = None
self.hash = None
self.size = 0
def __repr__(self):
return repr((self.name))
class SourceFile:
"""! Class represeting a source file
`name`: str
File name,
`url`: str
FTP URL,
`group`
<unknown>
@details More details
"""
def __init__(self, name, url, group):
self.group = group
self.url = url
self.name = name
class FileGroup:
"""! Represents a file group
`name`: str
Name of this group
`files`: List[ReleaseFile]
List of files within this group
`mainFile`: str
If this FileGroup has a subgroup, `mainFile` is the head of that group
`subFiles`: List[ReleaseFile]
Files within a subgroup
"""
def __init__(self, name, files: List[ReleaseFile]):
self.files = files
self.name = name
if len(files) == 1:
self.mainFile = files[0]
self.subFiles = {}
else:
self.mainFile = None
subFiles = []
for file in files:
# We only have subcategories for Windows where SSE2 is the main group
if file.subgroup == "SSE2":
self.mainFile = file
else:
subFiles.append(file)
self.subFiles = dict(((x[0], next(x[1])) for x in groupby(subFiles, lambda f: f.subgroup)))
def get_release_files(tag_name, config) -> Tuple[List[ReleaseFile], Dict[str, SourceFile]]:
"""! Brief Gets the binary and source files from the Github Release server
@param[in] `tag_name` Git tag of the current release
@param[in] `config` confi metadata set in main.py
@returns `List[ReleaseFile]` List of release files
@returns `Dict[str, SourceFile]` Dictionary of source files
@details Sends an `HTTP GET` request to github using their REST API to retrieve metadata. The files are not
actually downloaded here, just their metadata is gathered and organized in their respective container for later
use.
"""
@retry_multi(5) # retry at most 5 times
def execute_request(path):
"""!
@brief Performs a GET request with the given path. To be used with Github's REST API.
@returns If successful, returns a .JSON object
"""
headers = {
"Accept": "application/vnd.github.v3+json"
}
url = "https://api.github.com" + path
# GET https://api.github.com/<path> Accept: "application/vnd.github.v3+json"
response = requests.get(url, headers=headers, timeout=GLOBAL_TIMEOUT)
response.raise_for_status() # Raise a RequestException if we failed, and trigger retry
return response.json()
build_group_regex = re.compile("fs2_open_.*-builds-([^.-]*)(-([^.]*))?.*") # regex for matching binary .zip's and .7z's
source_file_regex = re.compile("fs2_open_.*-source-([^.]*)?.*") # regex for matching source .zip's and .7z's
# Get the github release metadata of the given tag name
response = execute_request(
"/repos/{}/releases/tags/{}".format(config["github"]["repo"], tag_name))
# Extract the binary and source files from the response["asset"] metadata
binary_files = []
source_files = {}
for asset in response["assets"]:
url = asset["browser_download_url"]
name = asset["name"]
group_match = build_group_regex.match(name)
if group_match is not None:
platform = group_match.group(1)
# x64 is the Visual Studio name but for consistency we need Win64
if platform == "x64":
platform = "Win64"
binary_files.append(ReleaseFile(name, url, platform, group_match.group(3)))
else:
group_match = source_file_regex.match(name)
if group_match is None:
continue
group = group_match.group(1)
source_files[group] = SourceFile(name, url, group)
binary_files.sort(key=lambda ReleaseFile: ReleaseFile.name)
return binary_files, source_files
def get_ftp_files(build_type, tag_name, config) -> List[ReleaseFile] :
"""!
@brief Gets file metadata for nightlies hosted on FTP, as determined by config["ftp"] attributes
@param [in] `build_type` Unknown str
@param [in] `tag_name` Github tag name of the release
@param [in] `config` config metadata set in main.py
"""
tag_regex = re.compile("nightly_(.*)")
build_group_regex = re.compile("nightly_.*-builds-([^.]+).*")
files = []
try:
with FTP(config["ftp"]["host"], config["ftp"]["user"], config["ftp"]["pass"]) as ftp:
# extract version
version_str = tag_regex.match(tag_name).group(1)
# extract filepath w/ version
# then list all ftp hits with that path
path_template = config["ftp"]["path"]
path = path_template.format(type=build_type, version=version_str)
file_entries = list(ftp.mlsd(path, ["type"]))
# get all ftp hits of type file
for entry in file_entries:
if entry[1]["type"] == "file":
files.append(entry[0])
except error_perm:
print("Received permanent FTP error!")
return []
out_data = []
for file in files:
# from the file list, extract only nightly files
file_match = build_group_regex.match(file)
if file_match is None:
print("Ignoring non nightly file '{}'".format(file))
continue
group_match = file_match.group(1)
primary_url = None
mirrors = []
# x64 is the name Visual Studio uses but Win64 works better for us since that gets displayed in the nightly post
if "x64" in group_match:
group_match = group_match.replace("x64", "Win64")
# construct the download URL list for all mirrors. The first listed ftp location is taken as the Primary
for mirror in config["ftp"]["mirrors"]:
download_url = mirror.format(type=build_type, version=version_str, file=file)
if primary_url is None:
primary_url = download_url
else:
mirrors.append(download_url)
# Form the List[ReleaseFile] list with the download URL links
out_data.append(ReleaseFile(file, primary_url, group_match, None, mirrors))
return out_data
+103
View File
@@ -0,0 +1,103 @@
from typing import List
import requests
import semantic_version
from mako.template import Template
from file_list import ReleaseFile
class ForumAPI:
POST_SIZE_MAX = 50000
"""!
Maximum number of characters allowed in a post, including BBCode (03/17/2022)
Check with HLP admins occasionally to verify this limit, they can set it in the forum's admin panel
"""
def __init__(self, config):
self.config = config
def create_post(self, title, content, board):
"""!
@brief Create a post on the forums
@param[in] title Title of the post
@param[in] content Body of the post
@param[in] board Which board/forum to post to
@returns { "thread_url": <url_of_created_thread> }
"""
if (self.config["hlp"]["api"] == "") or (self.config["hlp"]["key"] == ""):
print("Post failed! No API or API_KEY given!")
return
resp = requests.post(self.config["hlp"]["api"], data={
"api_key": self.config["hlp"]["key"],
"board": str(board),
"subject": title,
"body": content
})
if resp.status_code != 200:
print("Post failed! Response: %s" %resp.text)
return resp.json()
def post_nightly(self, date, revision, files, log, success):
"""!
@brief Post a new Nightly topic on the forums using nightly.mako
@param[in] date The date to use
@param[in] version The build's version
@param[in] groups dict[Any, file_list.FileGroup]; FileGroups of SSE2, AVX, etc.
@param[in] sources URL's of builds on github or fs2net
"""
print("Posting nightly thread...")
title = "Nightly: {} - Revision {}".format(date, revision)
template = Template(filename=self.config["templates"]["nightly"])
rendered = template.render_unicode(**{
"date": date,
"revision": revision,
"files": files,
"log": log,
"success": success
})
print("Creating post...")
self.create_post(title, rendered, self.config["nightly"]["hlp_board"])
def post_release(self, date, version: semantic_version.Version, groups, sources):
"""!
@brief Post a new Release topic on the forums using release.mako.
@param[in] date The date to use
@param[in] version The build's version
@param[in] groups dict[Any, file_list.FileGroup]; FileGroups of SSE2, AVX, etc.
@param[in] sources URL's of builds on github or fs2net
@returns If Successful, the URL of the created post
"""
print("Posting release thread...")
title = "Release: {}".format(version)
template = Template(
filename=self.config["templates"]["release"].format(major=version.major, minor=version.minor),
module_directory='/tmp/mako_modules')
rendered = template.render_unicode(**{
"date": date,
"version": version,
"groups": groups,
"sources": sources
}).strip("\n")
print("Creating post...")
json = self.create_post(title, rendered, self.config["release"]["hlp_board"])
return json["thread_url"]
+85
View File
@@ -0,0 +1,85 @@
# Class for use with interfacing with github via HTTP requests
import requests
from util import retry_multi, GLOBAL_TIMEOUT
class GithubAPI:
headers = {
"Accept": "application/vnd.github.v3+json"
}
url_root = "https://api.github.com"
def __init__(self, config):
self.config = config
@retry_multi(5)
def get(self, path):
"""!
@brief Performs a GET request with the given path. To be used with Github's REST API.
@returns If successful, returns a .JSON object
"""
url = self.url_root + path
# GET https://api.github.com/<path> Accept: "application/vnd.github.v3+json"
response = requests.get(url, headers=self.headers, timeout=GLOBAL_TIMEOUT)
response.raise_for_status() # Raise a RequestException if we failed, and trigger retry
return response.json()
def get_release(self, tag_name):
"""!
@brief Retrieves the Github Release metadata as a JSON object
@see https://docs.github.com/en/rest/reference/releases#get-a-release-by-tag-name
"""
return self.get("/repos/{}/releases/tags/{}".format(self.config["github"]["repo"], tag_name))
def patch(self, path, data):
"""!
@brief Performs a PATCH request with the given path and body data (as dictionary)
@returns If successful, returns a .JSON object
"""
url = self.url_root + path
response = requests.patch(url, headers=self.headers, timeout=GLOBAL_TIMEOUT, data=data)
response.raise_for_status()
return response.json()
def update_release(self, release_id, tag_name="", name="", body="", draft=None, prerelease=None):
"""!
@brief Updates a Github Release
@param[in] release_id The id of the release, as obtained by get_release()
@param[in] tag_name (optional) The git tag this release is associated with
@param[in] name (optional) The name of the release
@param[in] body (optional) Body text describing the release
@param[in] draft (optional) If true, the release is marked as a "draft"
@param[in] prerelease (optional) If true, the release is marked as a "prerelease"
@note If an optional argument is not provided, then its associated data is not changed
"""
path = "/repos/{}/releases/{}".format(self.config["github"]["repo"], release_id)
# Add to the data JSON if options are specified
data = {}
if tag_name != "":
data["tag_name"] = tag_name
if name != "":
data["name"] = name
if body != "":
data["body"] = body
if draft != None:
data["draft"] = data
if prerelease != None:
data["prerelease"] = prerelease
self.patch(path, data)
+88
View File
@@ -0,0 +1,88 @@
import os
import hashlib
import tarfile
import traceback
import zipfile
from tempfile import NamedTemporaryFile
from zipfile import ZipFile
import requests
import sys
from mako.template import Template
from file_list import ReleaseFile
from util import GLOBAL_TIMEOUT
def _download_file(url, dest_file, session):
print("Downloading " + url)
# NOTE the stream=True parameter
r = session.get(url, stream=True, timeout=GLOBAL_TIMEOUT)
for chunk in r.iter_content(chunk_size=1024):
if chunk: # filter out keep-alive new chunks
dest_file.write(chunk)
dest_file.flush()
def _gen_hash(fileobj, hash_alg):
h = hashlib.new(hash_alg)
while True:
data = fileobj.read(4096)
if not data:
break
h.update(data)
return h.hexdigest()
def get_hashed_file_list(file: ReleaseFile, session: requests.Session = None, hash_alg: str = "sha256"):
if session is None:
session = requests.Session()
with NamedTemporaryFile('w+b', suffix=file.filename) as local_file:
_download_file(file.url, local_file, session)
filename = local_file.name
hash_list = []
local_file.seek(0)
file.hash = _gen_hash(local_file, hash_alg)
file.size = os.stat(filename).st_size
try:
if tarfile.is_tarfile(filename):
with tarfile.open(filename) as archive:
for entry in archive:
if not entry.isfile():
continue
print("Computing hash for " + entry.name)
fileobj = archive.extractfile(entry)
hash_list.append((entry.path, _gen_hash(fileobj, hash_alg)))
elif zipfile.is_zipfile(filename):
with ZipFile(filename) as archive:
for entry in archive.infolist():
# Python 3.6 has is_dir but that version is relatively new so we'll use the "safe" version here
if entry.filename.endswith('/'):
continue
print("Computing hash for " + entry.filename)
with archive.open(entry) as fileobj:
hash_list.append((entry.filename, _gen_hash(fileobj, hash_alg)))
else:
raise NotImplementedError("Unsupported archive type!")
except:
traceback.print_exception(*sys.exc_info())
return
file.content_hashes = hash_list
def render_installer_config(version, groups, config):
template = Template(filename=config["templates"]["installer"], module_directory='/tmp/mako_modules')
return template.render(**{
"version": version,
"groups": groups,
}).strip("\n")
+309
View File
@@ -0,0 +1,309 @@
# Post-build python script
# Uploads build packages to Nebula and creates a forum post on https://www.hard-light.net
# Uses the following environment variables (Set by the github action workflow before execution)
# FSO versioning
# FSO_VERSION_MAJOR
# FSO_VERSION_MINOR
# FSO_VERSION_BUILD
# Credentials into IndieGames file host
# INDIEGAMES_USER:
# INDIEGAMES_SSHPASS:
# Credentials into Nebula Mod Database
# NEBULA_USER:
# NEBULA_PASSWORD:
# Credentials into hard-light.net for forum post
# HLP_API:
# HLP_KEY:
# LINUX_RESULT: bool, if the linux builds were successfully uploaded
# WINDOWS_RESULT: bool, if the windows builds were successfully uploaded
import sys
import os
import re
from subprocess import check_output
from datetime import datetime
from itertools import groupby
import semantic_version
# local .py files
import file_list
import installer
import nebula
import forum
# Compile regexes for extracting version components
MAJOR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_MAJOR (\d+)\)")
MINOR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_MINOR (\d+)\)")
BUILD_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_BUILD (\d+)\)")
REVISION_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_REVISION (\d+)\)")
REVISION_STR_VERSION_PATTERN = re.compile("(?:set_if_not_defined|set)\(FSO_VERSION_REVISION_STR (\w*)\)")
LOG_FORMAT = """
------------------------------------------------------------------------%n
commit %h%nAuthor: %an <%ad>%n
Commit: %cn <%cd>%n%n %s
"""
DATEFORMAT_VERSION = "%Y%m%d"
DATEFORMAT_FORUM = "%d %B %Y"
def _match_version_number(text, regex):
"""! Extracts the version component represented by `regex` from `text`
@param [in] `text` Filename with version string 'MAJOR.MINOR.BUILD'
@param [in] `regex` Regex pattern of component to look for
@return The version component as integer
"""
match = regex.search(text)
return int(match.group(1))
def _match_version_str(text, regex):
"""! Extracts the version component represented by `regex` from `text`
@param [in] `text` Filename with version string 'MAJOR.MINOR.BUILD'
@param [in] `regex` Regex pattern of component to look for
@return The version component as integer
"""
match = regex.search(text)
return match.group(1)
def get_source_version(date_version: datetime, tag_name: str) -> semantic_version.Version:
"""! Retrieves the version string from version_override.cmake (and version.cmake)
@param[in] `date_version` Date this build is published for release
@param[in] `tag_name` Tag of this release, used to determine if release, rc, or nightly
@return If release: `FSO_VERSION_MAJOR.FSO_VERSION_MINOR.FSO_VERSION_BUILD`
@return If rc: `FSO_VERSION_MAJOR.FSO_VERSION_MINOR.FSO_VERSION_BUILD-FSO_VERSION_REVISION_STR`
@return If nightly: `FSO_VERSION_MAJOR.FSO_VERSION_MINOR.FSO_VERSION_BUILD-FSO_VERSION_REVISION_STR` (uses both version_override.cmake and version.cmake)
@note This is the version used to identify in Nebula and the forums. version_override.cmake is used for the builds
made by CI tools and version.cmake is used for builds made by devs.
"""
with open(os.path.join("..", "..", "version_override.cmake"), "r") as f:
filetext = f.read()
major = _match_version_number(filetext, MAJOR_VERSION_PATTERN)
minor = _match_version_number(filetext, MINOR_VERSION_PATTERN)
build = _match_version_number(filetext, BUILD_VERSION_PATTERN)
# revision = _match_version_number(filetext, REVISION_VERSION_PATTERN)
revision_str = _match_version_str(filetext, REVISION_STR_VERSION_PATTERN)
print("Parsing version_override.cmake...")
if "rc" in tag_name.lower():
version = semantic_version.Version("{}.{}.{}-{}".format(major, minor, build, revision_str))
elif "release" in tag_name.lower():
version = semantic_version.Version("{}.{}.{}".format(major, minor, build))
elif "nightly" in tag_name.lower():
# Nightly's version_override.cmake only has FSO_VERSION_REVISION and FSO_VERSION_REVISION_STR set
# So, we have to pull the rest of the version string from version.cmake
print("Parsing version.cmake...")
with open(os.path.join("..", "..", "cmake", "version.cmake"), "r") as f:
major = _match_version_number(filetext, MAJOR_VERSION_PATTERN)
minor = _match_version_number(filetext, MINOR_VERSION_PATTERN)
build = _match_version_number(filetext, BUILD_VERSION_PATTERN)
version = semantic_version.Version("{}.{}.{}-{}".format(major, minor, build, revision_str))
else:
print(" ERROR: malformed tag_name %s" % tag_name)
sys.exit(1)
print(" version: {}".format(version))
print(" version.prerelease: {}".format(version.prerelease))
return version
def main():
os.chdir(os.path.dirname(__file__)) # Change working directory to this file's directory
# Aggregate configuration data in a dictionary
config = {
"github": {
"repo": os.environ["GITHUB_REPO"],
},
"ftp": {
"host": "scp.indiegames.us",
"user": os.environ["INDIEGAMES_USER"],
"pass": os.environ["INDIEGAMES_SSHPASS"],
"path": "public_html/builds/{type}/{version}/",
"mirrors": (
"https://perses.feralhosting.com/datacorder/builds/{type}/{version}/{file}",
"https://scp.indiegames.us/builds/{type}/{version}/{file}",
),
},
"nebula": {
"user": os.environ["NEBULA_USER"],
"password": os.environ["NEBULA_PASSWORD"],
},
"hlp": {
"api": os.environ["HLP_API"],
"key": os.environ["HLP_KEY"],
},
"templates": {
"nightly": "nightly.mako",
"release": "release.mako",
},
"nightly": {
"hlp_board": 173,
},
"release": {
"hlp_board": 50,
},
}
# bail if this script is run from a workflow that doesn't identify as a release or nightly
if sys.argv[1] not in ("release", "nightly"):
print("ERROR: Invalid release mode %s passed. Expected release or nightly!" % sys.argv[1])
sys.exit(1)
linux_success = os.environ["LINUX_RESULT"] == "success"
windows_success = os.environ["WINDOWS_RESULT"] == "success"
if (sys.argv[1] == "release"):
if not (linux_success and windows_success):
# bail if this is a release and either build workflow failed
print("ERROR: One or more builds failed to publish! Cannot post release.")
sys.exit(1)
else:
if not (linux_success or windows_success):
# bail if this is a nightly build and both build workflows failed
print("ERROR: All builds failed to publish! Cannot post nightly.")
sys.exit(1)
# bail if tag_name doesn't match with sys.argv[1]
tag_name = os.environ["RELEASE_TAG"] ##!< commit tag string
if (sys.argv[1] == "release") and (not tag_name.startswith("release_")):
print("ERROR: Invalid tag name detected. Expected release_ prefix for release builds but found %s (full ref = %s)" % tag_name, os.environ["GITHUB_REF"])
sys.exit(1)
if (sys.argv[1] == "nightly") and (not tag_name.startswith("nightly_")):
print("ERROR: Invalid tag name detected. Expected nightly_ prefix for nightly builds but found %s (full ref = %s)" % tag_name, os.environ["GITHUB_REF"])
sys.exit(1)
# bail if tag_name does not exist in the repo
if not check_output(("git", "show-ref", "--tags", "refs/tags/%s" % tag_name), text=True):
print("ERROR: Couldn't find tag %s in repo (git show-ref)!" % tag_name)
sys.exit(1)
# Populate version and date
date = datetime.now() ##!< current date
version = get_source_version(date.strftime(DATEFORMAT_VERSION), tag_name) ##!< form full version string
# find the previous tag release (used by nightly)
tags = check_output(("git", "for-each-ref", "--sort=-taggerdate", "--format='%(tag)'", "refs/tags"), text=True).splitlines() # retrieve all tags in the repo by using git on the shell
# NOTE: check_output returns canonical string representation. use repr() on strings its being compared to
previous_tag = None
found = False
for tag in tags:
if found:
# Look for the "previous" tag with the same configuration ('release_' or 'nightly_')
# Assumes older tags have a higher index than newer
if tag.startswith("\'" + sys.argv[1] + "_"):
previous_tag = tag
break
elif tag == repr(tag_name):
# Ok, found the tag
found = True
if not found:
# couldn't find tag, bail
print("ERROR: Couldn't find tag %s in repo! (git for-each-ref)" % tag_name)
sys.exit(1)
if (sys.argv[1] == "nightly") and (not previous_tag):
# couldn't find previous tag, bail
print("ERROR: Could not find a previous tag for %s!" % tag_name)
sys.exit(1)
if sys.argv[1] == "release":
# Release specific action
print("Retrieving file list...")
files, sources = file_list.get_release_files(tag_name, config)
print("Hashing files...")
for file in files:
installer.get_hashed_file_list(file)
# Construct the file groups
# split the file list into a dictionary of {group: files} pairs using `groupby()`
# Since `groupby()` returns a iterator reference to the original files list, we have to do a weird hand toss
# to save it as a dictionary
## NOTE z64: files need to be sorted or else key duplication will occur!
groups = {key: file_list.FileGroup(key, list(group)) for key, group in groupby(files, lambda g: g.group)}
# Error check for all group keys and subkeys to be used in the mako. Do this here for better debugging QoL
if "Win32" in groups.keys():
if "AVX" not in groups["Win32"].subFiles.keys():
print("ERROR: No Win32-AVX builds were detected!")
sys.exit(1)
else:
print("ERROR: No Win32 builds were detected!")
sys.exit(1)
if "Win64" in groups.keys():
if "AVX" not in groups["Win64"].subFiles.keys():
print("ERROR: No x64-AVX builds were detected!")
sys.exit(1)
else:
print("ERROR: No x64 builds were detected!")
sys.exit(1)
if "Linux" not in groups.keys():
print("ERROR: No Linux builds were detected!")
sys.exit(1)
if "Mac" not in groups.keys():
print("ERROR: No Mac builds were detected!")
sys.exit(1)
# z64: What dose this do???
# print(installer.render_installer_config(version, groups, config))
# Publish release builds to Nebula
print("Publishing to Nebula...")
nebula.submit_release(
nebula.render_nebula_release(version, "rc" if version.prerelease else "stable", files, config),
config)
# Publish forum post, using the release.mako template
print("Publishing to Hard-light.net...")
fapi = forum.ForumAPI(config)
fapi.post_release(date.strftime(DATEFORMAT_FORUM), version, groups, sources)
else:
# Dead for now, nightly publish is done elsewhere
# Nightly specific action
print("Retrieving file list...")
files = file_list.get_ftp_files("nightly", tag_name, config)
print("Hashing files...")
for file in files:
installer.get_hashed_file_list(file)
print("Publishing to Nebula...")
nebula.submit_release(
nebula.render_nebula_release(version, "nightly", files, config),
config)
# Compile commit messages into a log with all commits between this nightly and the previous nightly
log = check_output(("git", "log", "%s^..%s^" % (previous_tag, tag_name), "--no-merges", "--stat", "--pretty=format:\"%s\"" % LOG_FORMAT.strip()))
# Publish forum post, using the nighty.mako template
print("Publishing to Hard-light.net...")
fapi = forum.ForumAPI(config)
fapi.post_nightly(date.strftime(DATEFORMAT_FORUM), os.environ["GITHUB_SHA"], files, log, (linux_success and windows_success))
print("Done!")
if __name__ == "__main__":
main()
+252
View File
@@ -0,0 +1,252 @@
import os.path
import sys
import traceback
import requests
from file_list import ReleaseFile
from util import retry_multi, GLOBAL_TIMEOUT
LINUX_KEY = "Linux"
MACOSX_X64_KEY = "Mac-x86_64"
MACOSX_ARM64_KEY = "Mac-arm64"
WIN32_SSE2_KEY = "Win32-SSE2"
WIN64_SSE2_KEY = "Win64-SSE2"
WIN32_AVX_KEY = "Win32-AVX"
WIN64_AVX_KEY = "Win64-AVX"
metadata = {
'type': 'engine',
'title': 'FSO',
'notes': '',
'banner': 'https://fsnebula.org/storage/0d/e7/bf64bcdea9a9c115969cfb784e1ca457d24a7c2da4fc6f213521c3bb6abb.png',
'screenshots': [],
'videos': [],
'first_release': '2017-09-24',
'cmdline': '',
'mod_flag': ['FSO'],
'tile': 'https://fsnebula.org/storage/ec/cc/0bf23e028c26d5175ff52d003bff85b0a17b0ddfc1130d65bdf6d36f6324.png',
'logo': None,
'release_thread': None,
'description': '',
'id': 'FSO',
'packages': [],
}
platforms = {
LINUX_KEY: 'linux',
MACOSX_X64_KEY: 'macosx',
MACOSX_ARM64_KEY: 'macosx',
WIN32_SSE2_KEY: 'windows',
WIN64_SSE2_KEY: 'windows',
WIN32_AVX_KEY: 'windows',
WIN64_AVX_KEY: 'windows'
}
envs = {
LINUX_KEY: 'linux && x86_64', # Linux only has 64bit builds
MACOSX_X64_KEY: 'macosx && x86_64',
MACOSX_ARM64_KEY: 'macosx && arm64',
WIN32_SSE2_KEY: 'windows',
WIN64_SSE2_KEY: 'windows && x86_64',
WIN32_AVX_KEY: 'windows && avx',
WIN64_AVX_KEY: 'windows && avx && x86_64'
}
subdirs = {
WIN32_SSE2_KEY: 'x86',
WIN64_SSE2_KEY: 'x64',
WIN32_AVX_KEY: 'x86_avx',
WIN64_AVX_KEY: 'x64_avx'
}
def render_nebula_release(version, stability, files, config):
meta = metadata.copy()
meta['version'] = str(version)
meta['stability'] = stability # This can be one of ('stable', 'rc', 'nightly')
for file in files:
if file.content_hashes is None:
# The extraction probably failed which is why we don't have any hashes
continue
group = file.group
# release.py sets subgroup but nightly.py doesn't which means we have to normalize group here.
if file.subgroup:
group += '-' + file.subgroup
pkg = {
'name': group,
'notes': '',
'is_vp': False,
'files': [{
'dest': platforms[group] + '/' + subdirs.get(group, ''),
'filesize': file.size,
'checksum': ['sha256', file.hash],
'urls': [file.url] + file.mirrors,
'filename': file.name
}],
'environment': envs.get(group),
'filelist': [],
'status': 'required',
'folder': None,
'dependencies': [],
'executables': []
}
for fn, checksum in file.content_hashes:
if group in subdirs:
dest_fn = subdirs[group] + '/' + fn
else:
dest_fn = fn
# If the group is a known platform then we put the binaries into a separate subfolder for each platform
if group in platforms:
dest_fn = platforms[group] + '/' + dest_fn
pkg['filelist'].append({
'orig_name': fn,
'checksum': ('sha256', checksum),
'archive': file.name,
'filename': dest_fn
})
if group == LINUX_KEY and fn.endswith('.AppImage'):
if 'qtfred' in fn:
if '-FASTDBG' in fn:
label = 'QtFRED Debug'
else:
label = 'QtFRED'
else:
if '-FASTDBG' in fn:
label = 'Fast Debug'
else:
label = None
props = {
"x64": True, # All Linux builds are 64-bit
"sse2": True, # Linux builds are forced to compile with SSE2 but not AVX
"avx": False,
"avx2": False,
}
pkg['executables'].append({
'file': dest_fn,
'label': label,
'properties': props,
})
elif group.startswith('Mac') and fn.startswith(os.path.basename(fn) + '.app/'):
if 'qtfred' in fn:
if '-FASTDBG' in fn:
label = 'QtFRED Debug'
else:
label = 'QtFRED'
else:
if '-FASTDBG' in fn:
label = 'Fast Debug'
else:
label = None
props = {
"arm64": "arm64" in fn,
"x64": "x64" in fn,
"sse2": True, # There are no forced options on mac but 64-bit always implies SSE2 so we set that here
"avx": False,
"avx2": False,
}
pkg['executables'].append({
'file': dest_fn,
'label': label,
'properties': props,
})
elif group.startswith('Win') and fn.endswith('.exe'):
if 'fred2' in fn:
if '-FASTDBG' in fn:
label = 'FRED2 Debug'
else:
label = 'FRED2'
elif 'qtfred' in fn:
if '-FASTDBG' in fn:
label = 'QtFRED Debug'
else:
label = 'QtFRED'
else:
if '-FASTDBG' in fn:
label = 'Fast Debug'
else:
label = None
props = {
"x64": "x64" in fn,
"sse2": "SSE2" in fn or "AVX" in fn, # AVX implies SSE2
"avx": "AVX" in fn, # This conveniently also covers the AVX2 case since AVX2 implies AVX
"avx2": "AVX2" in fn,
}
pkg['executables'].append({
'file': dest_fn,
'label': label,
'properties': props,
})
meta["packages"].append(pkg)
return meta
@retry_multi(5)
def nebula_request(session, kind, path, **kwargs):
uri = "https://fsnebula.org/api/1/{}".format(path)
request_args = {
"timeout": GLOBAL_TIMEOUT
}
request_args.update(kwargs)
return session.request(kind, uri, **request_args)
def submit_release(meta, config):
try:
with requests.Session() as session:
print('Logging into Nebula...')
result = nebula_request(session, 'post', 'login', data={
'user': config['nebula']['user'],
'password': config['nebula']['password']
})
if result.status_code != 200:
print('Login failed!')
return False
data = result.json()
if not data['result']:
print('Login failed!')
return False
print('Submitting release...')
result = nebula_request(session, 'post', 'mod/release', headers={
'X-KN-TOKEN': data['token']
}, json=meta)
if result.status_code != 200:
print('Request failed!')
return False
data = result.json()
if not data['result']:
print('ERROR: ' + data['reason'])
return False
print('Success!')
return True
except Exception:
exc_type, exc_value, exc_traceback = sys.exc_info()
traceback.print_exception(exc_type, exc_value, exc_traceback)
return False
+27
View File
@@ -0,0 +1,27 @@
Here is the nightly for ${date} - Revision ${revision}
% if not success:
[b][color=red]At least one of the nightly builds failed![/color][/b]
% endif
% for file in files:
Group: ${file.group}
[url=${file.url}]${file.name}[/url] \
%for mirror in file.mirrors:
%if loop.first:
(\
%endif
[url=${mirror}]Mirror[/url]\
%if loop.last:
)\
%else:
, \
%endif
%endfor
% endfor
[code]
${log}
[/code]
+76
View File
@@ -0,0 +1,76 @@
<%def name="build(file)">[url=${file.url}]${file.filename}[/url]</%def>
[b]Change log:[/b] (chronologically ordered)
PLACEHOLDER
[b]Deprecations:[/b]
PLACEHOLDER
Deprecations are a mechanism in FSO where a certain feature or aspect of the engine has changed or is no longer supported. Since this would normally break existing mods, we have the mod table feature "[tt]$Target Version:[/tt]" with which a mod can specify what version of FSO it was developed with. Any features listed under Deprecations will be removed or changed when the target version of a mod is at least the version released in this post.
[size=5pt]Previous [url=https://www.hard-light.net/forums/index.php?topic=99166.0]24.0.0 Release Thread[/url][/size]
Launchers, if you don't have one already:
[b]All platforms: [/b] For every day use, we recommend [url=https://knossosnet.github.io/Knossos-Release-Page/]Knossos.NET[/url], an integrated solution for downloading and launching mods.
[hidden=Alternative Launchers]
Cross-platform: [url=https://www.hard-light.net/forums/index.php?topic=89162]wxLauncher 0.12.x Test Build[/url] (legacy project for a unified launcher)
[b]Important:[/b] For best compatibility with FSO 3.8 and later you should use at least wxLauncher 0.12.
Windows: [url=http://scp.fsmods.net/builds/Launcher55g.zip]Launcher 5.5g[/url] ([url=https://scp.indiegames.us/builds/Launcher55g.zip]Mirror[/url]) ([url=https://www.mediafire.com/?wdvzn7hhhzh418m]Mirror[/url]) Not compatible with Windows 8+, use wxLauncher above
OS X: Soulstorm's [url=https://www.hard-light.net/forums/index.php/topic,51391.0.html]OS X Launcher 3.0[/url]
Linux: [url=https://www.hard-light.net/forums/index.php/topic,53206.0.html]YAL[/url] or [url=https://www.hard-light.net/wiki/index.php/Fs2_open_on_Linux/Graphics_Settings]by hand[/url] or whatever you can figure out.[/hidden]
[img]https://scp.indiegames.us/img/windows-icon.png[/img] [color=green][size=12pt]Windows (32/64-bit)[/size][/color]
[size=8pt]Compiled using GitHub Actions on Windows Server 2019 (10.0.17763), Visual Studio Enterprise 2019[/size]
[b]64-bit:[/b] ${build(groups["Win64"].mainFile)}
[b]32-bit:[/b] ${build(groups["Win32"].mainFile)}
[size=8pt]This one is based on the SSE2 Optimizations from the MSVC Compiler.[/size]
[hidden=Alternative builds]
[b]64-bit AVX:[/b] ${build(groups["Win64"].subFiles["AVX"])}
[size=8pt]This one is based on the AVX Optimizations from the MSVC Compiler (fastest build if your CPU supports AVX instructions).[/size]
[b]32-bit AVX:[/b] ${build(groups["Win32"].subFiles["AVX"])}
[size=8pt]This one is based on the AVX Optimizations from the MSVC Compiler.[/size]
[b]What are those SSE, SSE2 and AVX builds I keep seeing everywhere?[/b]
[url=https://www.hard-light.net/forums/index.php?topic=65628.0]Your answer is in this topic.[/url]
Don't want to deal with that? Use [url=https://knossosnet.github.io/Knossos-Release-Page/]Knossos.NET[/url] and it will download the best build specifically for your PC!
[/hidden]
[img]https://scp.indiegames.us/img/linux-icon.png[/img] [color=green][size=12pt]Linux 64-bit[/size][/color]
[size=8pt]Compiled with Ubuntu 16.04 LTS 64-bit, GCC 5[/size]
${build(groups["Linux"].mainFile)}
These builds use a mechanism called [url=https://appimage.org/]AppImage[/url] which should allow these builds to run on most Linux distributions. However, we recommend that you compile your own builds which will result in less issues.
Alternatively, if there is a package in your software repository then you should use that. If you are the maintainer of such a package for a distribution then let us know and we will include that here.
[img]https://scp.indiegames.us/img/mac-icon.png[/img] [color=green][size=12pt]macOS[/size][/color]
[size=8pt]macOS 10.9+[/size]
[b]Intel (64-bit):[/b] ${build(groups["Mac"].subFiles["x86_64"])}
[b]Apple Silicon:[/b] ${build(groups["Mac"].subFiles["arm64"])}
These builds are not signed and so by default will fail to launch. To run them simply right-click on the app, click open, then click open again on the security confirmation dialog. You should only have to do this once for each app.
If running the game through Knossos or Knossos.NET this step should not be necessary.
[size=8pt][color=red][b]NOTE:[/b][/color] macOS builds currently have limited support and may exhibit issues not present on other platforms.[/size]
[hidden=TrackIR Users]
[size=12pt]Important!![/size]
An external DLL is required for FSO to use TrackIR functions. The following DLL is simply unpacked in to your main FreeSpace2 root dir.
TrackIR is only supported on Windows.
[url=https://www.mediafire.com/download.php?4zw024zrh44etse]TrackIR SCP DLL[/url] ([url=http://scp.fsmods.net/builds/scptrackir.zip]Mirror[/url]) ([url=https://scp.indiegames.us/builds/scptrackir.zip]Mirror[/url])[/hidden]
Known issues:
[list]
[li][url=https://github.com/scp-fs2open/fs2open.github.com/issues]Github issues[/url] and [url=https://github.com/scp-fs2open/fs2open.github.com/pulls]pending pull requests[/url][/li]
[li]See the list of [url=https://github.com/scp-fs2open/fs2open.github.com/projects/8]bugs ranked by priority[/url][/li]
[/list]
+3
View File
@@ -0,0 +1,3 @@
Mako==1.2.2
requests==2.31.0
semantic-version==2.8.5
+46
View File
@@ -0,0 +1,46 @@
# miscellaneous utilities
import os
import time
from functools import wraps
from requests import RequestException
GLOBAL_TIMEOUT = 30
def retry_multi(max_retries):
"""!
@brief Decorator - Retry a function `max_retries` times.
@param [in] `max_retries` Maximum number of times to retry the decorated function before giving up
@details Intended for use with functions from the `request` module, only catches `RequestException`'s
@note This has been copied from https://stackoverflow.com/a/23892489
"""
def retry(func):
@wraps(func)
def wrapper(*args, **kwargs):
num_retries = 0
while num_retries <= max_retries:
try:
ret = func(*args, **kwargs)
break
except RequestException:
if num_retries == max_retries:
raise
num_retries += 1
time.sleep(5)
return ret
return wrapper
return retry
def expand_config_vars(config):
"""
@brief Expands the shell variable for the repo string from `config`
"""
config["git"]["repo"] = os.path.expandvars(config["git"]["repo"])
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
set -ex
if [ "$NIGHTLY_BUILD" = true ]; then
echo "Generating bintray config..."
sed -e "s/\$VERSION_NAME/$VERSION_NAME/" ci/bintray.template.json > ci/bintray.json
fi
-20
View File
@@ -1,20 +0,0 @@
#!/usr/bin/env sh
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export DEBIAN_FRONTEND=noninteractive
sudo add-apt-repository -y "ppa:msulikowski/valgrind" # For fixing a bug with valgrind 3.11 which does not recognize the rdrand instruction
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo add-apt-repository -y 'deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-9 main'
sudo apt-get -yq update
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Nothing to do here
:
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
# Nothing to do here
:
fi
-50
View File
@@ -1,50 +0,0 @@
#!/usr/bin/env bash
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
mkdir -p /tmp/builds
if [ "$RELEASE_BUILD" = true ]; then
# Package the source code in release builds
PARENT_DIR="$(basename "$PWD")"
(cd .. && tar -czvf /tmp/builds/$PACKAGE_NAME-source-Unix.tar.gz --exclude-vcs "$PARENT_DIR")
fi
fi
mkdir -p build
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
if [ "$BUILD_DEPLOYMENT" = true ]; then
for config in $BUILD_CONFIGS
do
mkdir -p $config
cd $config
eval $CMAKE -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_BUILD_TYPE=$config -DCMAKE_INSTALL_PREFIX="/tmp/release/$config" \
-DFSO_BUILD_APPIMAGE=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_QTFRED=OFF ../..
cd ..
done
else
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=ON ..
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ "$BUILD_DEPLOYMENT" = true ]; then
cmake -G "Xcode" -DFSO_FATAL_WARNINGS=ON -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_INSTALL_PREFIX="/tmp/release" ..
else
cmake -G "Xcode" $CMAKE_OPTIONS ..
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
if [ "$CMAKE_GENERATOR" = "Ninja" ]; then
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -G "$CMAKE_GENERATOR" ..
else
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "$CMAKE_GENERATOR" -T "$CMAKE_TOOLSET" ..
fi
fi
-74
View File
@@ -1,74 +0,0 @@
#!/usr/bin/env sh
RELEASE_BUILD=false
NIGHTLY_BUILD=false
TEST_BUILD=false
BUILD_DEPLOYMENT=false
BUILD_CONFIGS="Release FastDebug"
VERSION_NAME=""
PACKAGE_NAME=""
RELEASE_PATTERN="^release_(.*)$"
NIGHTLY_PATTERN="^nightly_(.*)$"
TEST_BUILD_PATTERN="^test\/(.*)$"
# These are for testing
NIGHTLY_TEST=false
RELEASE_TEST=false
TEST_BUILD_TEST=false
if [ "$RELEASE_TEST" = true ] || [[ "$TRAVIS_TAG" =~ $RELEASE_PATTERN ]]; then
echo "This is a release tag!";
RELEASE_BUILD=true;
PACKAGE_NAME="fs2_open_${BASH_REMATCH[1]}";
fi
if [ "$NIGHTLY_TEST" = true ] || [[ "$TRAVIS_TAG" =~ $NIGHTLY_PATTERN ]]; then
echo "This is a nightly tag!";
NIGHTLY_BUILD=true;
VERSION_NAME="${BASH_REMATCH[1]}";
PACKAGE_NAME="nightly_${BASH_REMATCH[1]}";
fi
if [ "$TEST_BUILD_TEST" = true ] || [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" =~ $TEST_BUILD_PATTERN ]]; then
echo "This is a test build branch!";
TEST_BUILD=true;
if [ "$TEST_BUILD_TEST" = true ]; then
VERSION_NAME="test";
PACKAGE_NAME="test_test";
else
VERSION_NAME="${BASH_REMATCH[1]}";
PACKAGE_NAME="test_${BASH_REMATCH[1]}";
fi
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR $VERSION_NAME)" > "$TRAVIS_BUILD_DIR/version_override.cmake"
fi
if ([ "$RELEASE_BUILD" = true ] || [ "$NIGHTLY_BUILD" = true ] || [ "$TEST_BUILD" = true ]); then
BUILD_DEPLOYMENT=true;
fi
if [ "$BUILD_DEPLOYMENT" = true ]; then
if ([ "$TRAVIS_OS_NAME" = "linux" ] && (! [[ "$CC" =~ ^gcc-5.*$ ]])); then
echo "Skipping non-release compiler";
exit 0;
fi
if ([[ "$CONFIGURATION" == "Debug" ]]); then
echo "Skipping non-release configuration";
exit 0;
fi
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
echo "Skipping non-release platform"
exit 0
fi
fi
export RELEASE_BUILD
export NIGHTLY_BUILD
export TEST_BUILD
export BUILD_DEPLOYMENT
export BUILD_CONFIGS
export VERSION_NAME
export PACKAGE_NAME
-89
View File
@@ -1,89 +0,0 @@
#!/usr/bin/env bash
set -e
set -u
if [[ ! "$(curl -V)" == *"sftp"* ]]; then
# Before
echo "Before:"
curl -V
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ -f ~/curl_cache/curl*.deb ]; then
cd ~/curl_cache
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
else
# Since the Travis CI people are not capable of enabling SSH/SCP support for their libcurl we need to build that manually...
# These commands are based on the tutorial from here: http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
mkdir /tmp/curl
cd /tmp/curl
sudo apt-get update
sudo apt-get install build-essential debhelper libssh2-1-dev libgnutls-dev libidn11-dev libkrb5-dev libldap2-dev libnss3-dev librtmp-dev libtool openssh-server quilt
apt-get source curl
sudo apt-get build-dep curl
cd curl-*
export DEB_BUILD_OPTIONS="nocheck"
sudo dpkg-buildpackage -uc -us -j"$(grep -c ^processor /proc/cpuinfo)"
cd ..
dpkg -l | grep curl
ls -al
if [ ! -d ~/curl_cache ]; then
mkdir ~/curl_cache
fi
cp libcurl3*.deb curl*.deb ~/curl_cache
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install libssh2
if [ -d ~/curl_cache/curl ]; then
cd ~/curl_cache/curl
sudo make install
else
mkdir /tmp/curl
cd /tmp/curl
curl -LO "https://curl.haxx.se/download/curl-7.64.0.tar.bz2"
tar -xjf curl-7.64.0.tar.bz2
cd curl-7.64.0
./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --with-libssh2 --with-darwinssl --without-ca-bundle --without-ca-path
make -j"$(sysctl hw.logicalcpu | cut -d " " -f 2)"
if [ ! -d ~/curl_cache ]; then
mkdir ~/curl_cache
fi
cp -a . ~/curl_cache/curl
sudo make install
fi
export PATH=/usr/local/bin:$PATH
fi
# After
echo "After:"
curl -V
fi
cd /tmp/builds
for file in *; do
if [ "$TEST_BUILD" = true ]; then
# Upload to datacorder
curl -k "sftp://porphyrion.feralhosting.com/www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$VERSION_NAME/" --user "$DATACORDER_USER:$DATACORDER_PASSWORD" -T "$file" --ftp-create-dirs
else
# Upload to indiegames
curl -k "sftp://scp.indiegames.us/~/public_html/builds/nightly/$VERSION_NAME/" --user "$INDIEGAMES_USER:$INDIEGAMES_PASSWORD" -T "$file" --ftp-create-dirs
# Upload to datacorder
curl -k "sftp://porphyrion.feralhosting.com/~/www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly/$VERSION_NAME/" --user "$DATACORDER_USER:$DATACORDER_PASSWORD" -T "$file" --ftp-create-dirs
fi
done
-47
View File
@@ -1,47 +0,0 @@
#!/usr/bin/env bash
set -ex
FILENAME=
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
export DEBIAN_FRONTEND=noninteractive
if [ ! -d "$HOME/cmake-3.8/bin" ]; then
# If the cache does not currently contain CMake then download and install it
mkdir -p $HOME/cmake-3.8/
wget -O /tmp/cmake.tar.gz --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake-3.8/ --strip-components=1
fi
export PATH=$HOME/cmake-3.8/bin:$PATH
cd $HOME
if [ "${BUILD_DEPLOYMENT}" = true ]; then
wget -O appimagetool -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" # (64-bit)
chmod a+x ./appimagetool
wget -O linuxdeployqt -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" # (64-bit)
chmod a+x ./linuxdeployqt
fi
sudo apt-get -yq install valgrind
if [[ "$CC" = "clang-9" ]]; then
sudo apt-get -yq install clang-9 clang-tidy-9
fi
if [[ "$CC" = "clang-4.0" ]]; then
# Fix a header bug present in ubuntu...
sudo ln -s /usr/include/libcxxabi/__cxxabi_config.h /usr/include/c++/v1/__cxxabi_config.h
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
gem install xcpretty
brew update
brew outdated cmake || brew upgrade cmake
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
choco install mingw ninja
fi
cmake --version
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env sh
set -ex
mkdir -p /tmp/builds
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
cd build
for config in $BUILD_CONFIGS
do
cd "$config"
# Compile all targets
ninja all
# Install Freespace2 targets
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/fso -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/fso -DCOMPONENT=Freespace2 -P cmake_install.cmake
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
FILENAME="$(find /tmp/release/$config/fso/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
$HOME/appimagetool -n /tmp/release/$config/fso "/tmp/release/$config/fso/$FILENAME"
: <<'END'
# Install qtFRED targets
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/qtfred/usr -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/qtfred/usr -DCOMPONENT=qtFRED -P cmake_install.cmake
PREV="$(pwd)"
cd /tmp/release/$config/qtfred
unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH
$HOME/linuxdeployqt usr/qtfred.desktop -bundle-non-qt-libs
# Move our AppRun script to the right location
mv usr/AppRun AppRun
echo "Embed newer libstdc++ for distros that don't come with it (ubuntu 14.04)";
mkdir -p usr/optional/; mkdir -p usr/optional/libstdc++/;
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./usr/optional/libstdc++/;
$HOME/appimagetool -n . "$(find /tmp/release/$config/qtfred/usr/bin -name 'qtfred_*' -type f -printf "%f\n").AppImage"
cd "$PREV"
END
cd ..
done
cp `find /tmp/release -name '*.AppImage' -print` /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-Linux.tar.gz *.AppImage)
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cd build
for config in $BUILD_CONFIGS
do
cmake --build . --config "$config" --target install | tee build.log \
| xcpretty
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://transfer.sh/build.log.tar.gz"
exit $XCODE_RET
fi
done
ls -al /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-MacOSX.tar.gz *)
fi
-30
View File
@@ -1,30 +0,0 @@
#!/usr/bin/env sh
set -e
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ninja -k 20 all
if [ "$CONFIGURATION" = "Debug" ]; then
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$TRAVIS_BUILD_DIR/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
else
./bin/unittests --gtest_shuffle
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cmake --build . --config "$CONFIGURATION" | tee build.log | xcpretty
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://keep.sh"
exit $XCODE_RET
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
if [ "$CMAKE_GENERATOR" = "Ninja" ]; then
cmake --build . --config "$CONFIGURATION"
else
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
fi
fi
+16
View File
@@ -0,0 +1,16 @@
buildType:
default: release
description: R
choices:
release:
short: Release
long: Release builds
buildType: Release
fastDebug:
short: FastDebug
long: Debug with optimizations
buildType: FastDebug
debug:
short: Debug
long: Debug without optimizations
buildType: Debug
-12
View File
@@ -1,15 +1,3 @@
include(WriteCompilerDetectionHeader)
set(CMAKE_CXX_STANDARD_REQUIRED 11)
set(CMAKE_CXX_STANDARD 11)
get_property(CMAKE_CXX_KNOWN_FEATURES GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
write_compiler_detection_header(
FILE "${GENERATED_SOURCE_DIR}/scp_compiler_detection.h"
PREFIX SCP
COMPILERS AppleClang Clang GNU MSVC
FEATURES ${CMAKE_CXX_KNOWN_FEATURES}
VERSION 3.2
)
+1 -1
View File
@@ -8,7 +8,7 @@ if(DOXYGEN_FOUND)
FILE(TO_NATIVE_PATH ${OUTPUT_DIR} OUTPUT_DIR)
SET(OUTPUT_DIR \"${OUTPUT_DIR}\")
SET(INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/code" "${CMAKE_CURRENT_SOURCE_DIR}/freespace2" "${CMAKE_CURRENT_SOURCE_DIR}/fred2" "${CMAKE_CURRENT_SOURCE_DIR}/wxfred2")
SET(INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/code" "${CMAKE_CURRENT_SOURCE_DIR}/freespace2" "${CMAKE_CURRENT_SOURCE_DIR}/fred2" "${CMAKE_CURRENT_SOURCE_DIR}/wxfred2" "${CMAKE_CURRENT_SOURCE_DIR}/qtfred")
SET(INPUT_DIRS)
FOREACH(DIR IN LISTS INPUTS)
+2
View File
@@ -9,6 +9,8 @@ if (WIN32)
if (NOT HAVE_SAPI_H)
message(SEND_ERROR "sapi.h could not be found on your platform. Please disable speech support.")
endif()
elseif(APPLE)
# it should just work
else()
message(SEND_ERROR "Text to Speech is not supported on this platform!")
endif()
+6
View File
@@ -7,3 +7,9 @@ if (CMAKE_SIZEOF_VOID_P EQUAL 8)
else()
set(IS_64BIT FALSE)
endif()
if(CMAKE_SYSTEM_PROCESSOR MATCHES "^(aarch64|arm64|ARM64)")
set(IS_ARM64 TRUE)
else()
set(IS_ARM64 FALSE)
endif()
+8
View File
@@ -22,6 +22,14 @@ SET(LIBRAY_DESTINATION "../Frameworks")
set(PLATFORM_MAC TRUE CACHE INTERNAL "" FORCE)
# Maybe override arm64 setting if we are compiling for different architecture
# If not specified, or if it's a universal build, then this should do nothing
if(CMAKE_OSX_ARCHITECTURES MATCHES "arm64")
set(IS_ARM64 TRUE)
elseif(CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
set(IS_ARM64 FALSE)
endif()
# Generate and don't strip debug symbols
# These settings don't seem to generate debug symbols for code and Freespace2
# so those settings are set manually in code and Freespace2's CMakeLists.txt files
+1
View File
@@ -10,6 +10,7 @@ SET(WIN32_LIBS
winmm
ws2_32
psapi
shlwapi
)
IF (MINGW)
-2
View File
@@ -21,8 +21,6 @@ endif()
set(CMAKE_EXTRA_INCLUDE_FILES "cstddef")
CHECK_TYPE_SIZE("std::max_align_t" STD_MAX_ALIGN_T LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES "type_traits")
CHECK_TYPE_SIZE("std::is_trivially_copyable<int>" STD_IS_TRIVIALLY_COPYABLE LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES)
CHECK_TYPE_SIZE("char32_t" CHAR32_T LANGUAGE CXX)
+1 -2
View File
@@ -8,9 +8,8 @@
#cmakedefine SCP_HAVE_MAX_ALIGN_T
#cmakedefine SCP_HAVE_STD_MAX_ALIGN_T
#cmakedefine01 HAVE_STD_IS_TRIVIALLY_COPYABLE
#cmakedefine01 IS_64BIT
#cmakedefine01 IS_ARM64
#cmakedefine01 SCP_HAVE_STRCASECMP
#cmakedefine01 SCP_HAVE_STRNCASECMP
+3 -3
View File
@@ -4,7 +4,7 @@ MESSAGE(STATUS "Doing configuration specific to Apple Clang...")
# TODO: Actually add Mac specific flags here...
# Suppress specific warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -fsigned-char -Wno-unknown-pragmas")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fsigned-char -Wno-unknown-pragmas")
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
@@ -13,6 +13,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused-variable")
set(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_DEBUG "-Wextra -Wshadow -Wno-unused-parameter")
set(CMAKE_CXX_FLAGS_DEBUG "-Og -g -Wshadow")
+35 -10
View File
@@ -33,7 +33,7 @@ set(COMPILER_FLAGS "")
_enable_extra_compiler_warnings_flags()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsigned-char -Wno-unknown-pragmas")
# Omit "argument unused during compilation" when clang is used with ccache.
if(${CMAKE_CXX_COMPILER} MATCHES "ccache")
@@ -83,23 +83,48 @@ if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-shift-negative-value")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-parameter")
# Check if there is a user-set optimisation flag
string(REGEX MATCH "-O[a-zA-Z|0-9]+" CXX_OPT_FLAG ${CXX_BASE_FLAGS})
string(REGEX MATCH "-O[a-zA-Z|0-9]+" C_OPT_FLAG ${C_BASE_FLAGS})
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# If no user-set opt flag, set -O2 and -Og
if ("${CXX_OPT_FLAG}" STREQUAL "")
set(CXX_OPT_FLAG_RELEASE "-O2")
set(CXX_OPT_FLAG_DEBUG "-Og")
else()
set(CXX_OPT_FLAG_RELEASE "${CXX_OPT_FLAG}")
set(CXX_OPT_FLAG_DEBUG "${CXX_OPT_FLAG}")
endif()
if ("${C_OPT_FLAG}" STREQUAL "")
set(C_OPT_FLAG_RELEASE "-O2")
set(C_OPT_FLAG_DEBUG "-Og")
else()
set(C_OPT_FLAG_RELEASE "${C_OPT_FLAG}")
set(C_OPT_FLAG_DEBUG "${C_OPT_FLAG}")
endif()
# Always use the base flags and add our compiler flags at the bacl
set(CXX_FLAGS_RELEASE "${CXX_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-parameter")
set(C_FLAGS_RELEASE "${C_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-parameter")
set(CXX_FLAGS_DEBUG "${CXX_OPT_FLAG_DEBUG} -g -Wshadow")
set(C_FLAGS_DEBUG "${C_OPT_FLAG_DEBUG} -g -Wshadow")
# Always use the base flags and add our compiler flags at the back
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${C_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_RELEASE ${CXX_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${C_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${CXX_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${C_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
if(DEFINED ENV{LDFLAGS})
set(CMAKE_EXE_LINKER_FLAGS $ENV{LDFLAGS})
endif()
if (CLANG_USE_LIBCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc++abi")
endif()
@@ -116,7 +141,7 @@ if (FSO_FATAL_WARNINGS)
target_compile_options(compiler INTERFACE "-Werror")
endif()
# Always define this to make sure that the fixed width format macros are available
# Always define this to make sure that the fixed-width format macros are available
target_compile_definitions(compiler INTERFACE __STDC_FORMAT_MACROS)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW)
+35 -8
View File
@@ -27,6 +27,11 @@ endif()
set(COMPILER_FLAGS "")
set(LINKER_FLAGS "")
# Don't ignore user-set LDFLAGS
if(DEFINED ENV{LDFLAGS})
set(LINKER_FLAGS $ENV{LDFLAGS})
endif()
if (GCC_USE_GOLD)
OPTION(GCC_INCREMENTAL_LINKING "Use incremental linking" OFF)
set(LINKER_FLAGS "${LINKER_FLAGS} -fuse-ld=gold")
@@ -40,7 +45,7 @@ endif()
_enable_extra_compiler_warnings_flags()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fsigned-char -Wno-unknown-pragmas")
if (NOT GCC_INCREMENTAL_LINKING)
# Place each function and data in its own section so the linker can
@@ -108,19 +113,41 @@ if(SUPPORTS_STRINGOP_TRUNCATION)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-stringop-overflow")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
# Check if there is a user-set optimisation flag
string(REGEX MATCH "-O[a-zA-Z|0-9]+" CXX_OPT_FLAG ${CXX_BASE_FLAGS})
string(REGEX MATCH "-O[a-zA-Z|0-9]+" C_OPT_FLAG ${C_BASE_FLAGS})
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# If no user-set opt flag, set -O2 and -Og
if ("${CXX_OPT_FLAG}" STREQUAL "")
set(CXX_OPT_FLAG_RELEASE "-O2")
set(CXX_OPT_FLAG_DEBUG "-Og")
else()
set(CXX_OPT_FLAG_RELEASE "${CXX_OPT_FLAG}")
set(CXX_OPT_FLAG_DEBUG "${CXX_OPT_FLAG}")
endif()
if ("${C_OPT_FLAG}" STREQUAL "")
set(C_OPT_FLAG_RELEASE "-O2")
set(C_OPT_FLAG_DEBUG "-Og")
else()
set(C_OPT_FLAG_RELEASE "${C_OPT_FLAG}")
set(C_OPT_FLAG_DEBUG "${C_OPT_FLAG}")
endif()
set(CXX_FLAGS_RELEASE "${CXX_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
set(C_FLAGS_RELEASE "${C_OPT_FLAG_RELEASE} -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
set(CXX_FLAGS_DEBUG "${CXX_OPT_FLAG_DEBUG} -g -Wshadow")
set(C_FLAGS_DEBUG "${C_OPT_FLAG_DEBUG} -g -Wshadow")
# Always use the base flags and add our compiler flags at the back
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${C_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_RELEASE ${CXX_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${C_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS_DEBUG ${CXX_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${C_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}")
@@ -160,7 +187,7 @@ if (FSO_FATAL_WARNINGS)
target_compile_options(compiler INTERFACE "-Werror")
endif()
# Always define this to make sure that the fixed width format macros are available
# Always define this to make sure that the fixed-width format macros are available
target_compile_definitions(compiler INTERFACE __STDC_FORMAT_MACROS=1)
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW)
+30 -17
View File
@@ -67,30 +67,43 @@ ENDIF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
ENDFUNCTION(EP_CHECK_FILE_EXISTS)
MACRO(COPY_FILE_TO_TARGET _target _file)
if(UNIX)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND cp -a "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
)
if (IS_DIRECTORY "${_file}")
get_filename_component(_dirName "${_file}" NAME)
if (PLATFORM_MAC AND ("${_file}" MATCHES ".framework$"))
# This is stupid, but it preserves symlinks, unlike copy_directory_if_different.
# Otherwise we end up creating duplicate files in the copied framework.
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND rsync -rlq "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}"
COMMENT "copying '${_file}'..."
VERBATIM
)
else()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/${_dirName}"
COMMENT "copying '${_file}'..."
VERBATIM
)
endif()
else()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
VERBATIM
)
endif()
endmacro(COPY_FILE_TO_TARGET)
MACRO(COPY_FILES_TO_TARGET _target)
if(UNIX)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND mkdir -p "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "Creating '$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/'..."
)
endif()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "Creating '$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/'..."
VERBATIM
)
FOREACH(file IN LISTS TARGET_COPY_FILES)
COPY_FILE_TO_TARGET("${_target}" "${file}")
ENDFOREACH(file)
+5 -3
View File
@@ -6,8 +6,8 @@ if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
endif()
set_if_not_defined(FSO_VERSION_MAJOR 20)
set_if_not_defined(FSO_VERSION_MINOR 1)
set_if_not_defined(FSO_VERSION_MAJOR 23)
set_if_not_defined(FSO_VERSION_MINOR 3)
set_if_not_defined(FSO_VERSION_BUILD 0)
# A numeric revision e.g. the CI build number
@@ -35,7 +35,9 @@ ELSE()
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}_${FSO_VERSION_REVISION_STR}")
ENDIF()
IF(IS_64BIT)
IF(IS_ARM64)
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_arm64")
ELSEIF(IS_64BIT)
# This is a 64-bit builds
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_x64")
ENDIF()
+44 -5
View File
@@ -20,12 +20,20 @@ TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR}/code)
if (FSO_BUILD_WITH_OPENGL)
target_link_libraries(code PUBLIC OpenGL)
if(FSO_BUILD_WITH_OPENGL_DEBUG)
add_definitions(-DFS_OPENGL_DEBUG)
endif()
endif()
if(FSO_BUILD_WITH_OPENXR_DEBUG)
add_definitions(-DFS_OPENXR_DEBUG)
endif()
TARGET_LINK_LIBRARIES(code PUBLIC openal)
TARGET_LINK_LIBRARIES(code PUBLIC ${LUA_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC lz4)
TARGET_LINK_LIBRARIES(code PUBLIC sdl2)
@@ -46,10 +54,6 @@ target_link_libraries(code PUBLIC libRocket)
target_link_libraries(code PUBLIC pcp)
if (FSO_BUILD_WITH_VULKAN)
target_link_libraries(code PUBLIC vulkan-hpp)
endif()
target_link_libraries(code PUBLIC parsers)
target_link_libraries(code PUBLIC mdns)
@@ -63,6 +67,29 @@ ENDIF(FSO_USE_SPEECH)
TARGET_LINK_LIBRARIES(code PUBLIC jansson)
target_link_libraries(code PUBLIC variant)
target_link_libraries(code PUBLIC any)
target_link_libraries(code PUBLIC optional)
target_link_libraries(code PUBLIC anl)
target_link_libraries(code PUBLIC hidapi::hidapi)
target_link_libraries(code PUBLIC imgui)
IF(NOT APPLE)
target_link_libraries(code PUBLIC OpenXR::openxr_loader)
target_include_directories(code PUBLIC OpenXR::Headers)
ENDIF()
IF(CMAKE_SYSTEM_NAME MATCHES "Linux")
# On Linux, we need to access X11 window data.
# On Windows, SDL already provides everything, so no need to do anything
find_package(X11)
target_link_libraries(code PUBLIC ${X11_LIBRARIES})
ENDIF()
# Headers for standalone "gui" on UNIX
IF(UNIX)
TARGET_LINK_LIBRARIES(code PUBLIC ${MONGOOSE_LIBS})
@@ -85,7 +112,16 @@ if (FSO_BUILD_WITH_OPENGL)
target_compile_definitions(code PUBLIC WITH_OPENGL)
endif()
if (FSO_BUILD_WITH_VULKAN)
target_compile_definitions(code PUBLIC WITH_VULKAN)
find_package(Vulkan REQUIRED)
if (Vulkan_FOUND)
target_compile_definitions(code PUBLIC WITH_VULKAN)
target_link_libraries(code PRIVATE Vulkan::Vulkan)
target_compile_definitions(code PUBLIC WITH_VULKAN VULKAN_HPP_DISPATCH_LOADER_DYNAMIC=1 VK_NO_PROTOTYPES)
else()
message(WARNING "FSO_BUILD_WITH_VULKAN was set, but the package was unable to be found. Forcing OFF.")
set(FSO_BUILD_WITH_VULKAN OFF CACHE BOOL "Enable compilation of the Vulkan renderer" FORCE)
endif()
endif()
include(shaders.cmake)
@@ -101,3 +137,6 @@ set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYM
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_COPY_PHASE_STRIP[variant=Debug] "NO")
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT[variant=Debug] "NO")
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN[variant=Debug] "NO")
# Prevent GCC warnings in third-party BitOp... see GitHub #4366
suppress_file_warnings(scripting/lua/bitop/bit.c)
+8
View File
@@ -0,0 +1,8 @@
#include "Action.h"
namespace actions {
Action::~Action() = default;
}
+23
View File
@@ -0,0 +1,23 @@
#pragma once
#include "common.h"
namespace actions {
enum class ActionResult
{
Finished,
Errored,
Wait
};
class Action {
public:
virtual ~Action() = 0;
virtual ActionResult execute(ProgramLocals& locals) const = 0;
virtual std::unique_ptr<Action> clone() const = 0;
};
} // namespace actions
+21
View File
@@ -0,0 +1,21 @@
#include "ActionDefinition.h"
namespace actions {
ActionDefinition::ActionDefinition(SCP_string name, SCP_vector<ActionParameter> parameters)
: m_name(std::move(name)), m_parameters(std::move(parameters))
{
}
ActionDefinition::~ActionDefinition() = default;
const SCP_string& ActionDefinition::getName() const
{
return m_name;
}
const SCP_vector<ActionParameter>& ActionDefinition::getParameters() const
{
return m_parameters;
}
} // namespace actions
+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include "Action.h"
#include "actions/expression/ActionExpression.h"
#include "actions/expression/Value.h"
namespace actions {
struct ActionParameter {
SCP_string name;
expression::ValueType type;
};
class ActionDefinition {
public:
ActionDefinition(SCP_string name, SCP_vector<ActionParameter> parameters);
virtual ~ActionDefinition();
const SCP_string& getName() const;
const SCP_vector<actions::ActionParameter>& getParameters() const;
virtual flagset<ProgramContextFlags> getRequiredContext() const = 0;
virtual std::unique_ptr<Action> createAction(
const SCP_unordered_map<SCP_string, expression::ActionExpression>& parameterExpressions) const = 0;
private:
SCP_string m_name;
SCP_vector<ActionParameter> m_parameters;
};
} // namespace actions
+145
View File
@@ -0,0 +1,145 @@
#include "ActionDefinitionManager.h"
#include "BuiltinActionDefinition.h"
#include "actions/types/MoveToSubmodel.h"
#include "actions/types/ParticleEffectAction.h"
#include "actions/types/PlaySoundAction.h"
#include "actions/types/SetDirectionAction.h"
#include "actions/types/SetPositionAction.h"
#include "actions/types/WaitAction.h"
#include "utils/join_string.h"
namespace actions {
namespace {
void parseActionParameters(const SCP_vector<ActionParameter>& params,
SCP_unordered_map<SCP_string, expression::ActionExpression>& parameterExpressions,
const expression::ParseContext& context)
{
// We do not impose a set order of the parameters so we need to do something similar to the outer loop and
// check for every possibility in a loop.
for (size_t i = 0; i < params.size(); ++i) {
// We might be doing some empty loops here in case of errors but there is a bound so this will finish
// eventually
for (const auto& parameter : params) {
// Do not check for parameters which we already found
if (parameterExpressions.find(parameter.name) != parameterExpressions.end()) {
continue;
}
const auto paramString = "+" + parameter.name + ":";
if (!optional_string(paramString.c_str())) {
continue;
}
// We found our parameter!
parameterExpressions[parameter.name] =
expression::ActionExpression::parseFromTable(parameter.type, context);
break;
}
}
}
} // namespace
const ActionDefinitionManager& ActionDefinitionManager::instance()
{
static const ActionDefinitionManager manager;
return manager;
}
void ActionDefinitionManager::addDefinition(std::unique_ptr<ActionDefinition> def)
{
m_definitions.push_back(std::move(def));
}
std::unique_ptr<Action> ActionDefinitionManager::parseAction(const flagset<ProgramContextFlags>& context_flags,
const expression::ParseContext& context) const
{
// We search through all definitions for every time we want to check for an action. This is not the most efficient
// way to handle this since it results in an O(n^2) runtime. A better alternative would be to either construct a
// regex with all the accepted actions as alternatives (although runtime of this is also doubtful) or peek at the
// next token, extract the relevant part (The stuff between "+" and ":") and then look that up in a map. Then we
// would get down to O(n).
// Since this only happens at parse time, this is good enough for now.
for (const auto& actionDef : m_definitions) {
const auto parseString = "+" + actionDef->getName() + ":";
if (!optional_string(parseString.c_str())) {
continue;
}
SCP_unordered_map<SCP_string, expression::ActionExpression> parameterExpressions;
const auto& params = actionDef->getParameters();
if (params.size() == 1) {
// Single parameters are expected to be placed directly after the action name
parameterExpressions[params.front().name] =
expression::ActionExpression::parseFromTable(params.front().type, context);
} else {
parseActionParameters(params, parameterExpressions, context);
if (parameterExpressions.size() != params.size()) {
SCP_vector<ActionParameter> missingParameters;
std::copy_if(params.cbegin(),
params.cend(),
std::back_inserter(missingParameters),
[&parameterExpressions](const ActionParameter& param) {
const auto iter = parameterExpressions.find(param.name);
return iter == parameterExpressions.cend();
});
SCP_vector<SCP_string> missingParameterNames;
std::transform(missingParameters.cbegin(),
missingParameters.cend(),
std::back_inserter(missingParameterNames),
[](const ActionParameter& param) { return "+" + param.name; });
const auto namesList = util::join_container(missingParameterNames, ", ");
error_display(0, "Missing parameters for action '%s': %s", parseString.c_str(), namesList.c_str());
// Fix up the parameter list so that we can continue parsing
for (const auto& missingParam : missingParameters) {
parameterExpressions[missingParam.name] = expression::ActionExpression();
}
}
}
auto actionInstance = actionDef->createAction(parameterExpressions);
const auto requiredFlags = actionDef->getRequiredContext();
if ((context_flags & requiredFlags) != requiredFlags) {
// We are missing at least one context flag so this action is not valid here. We still return the action
// here though since that is the only way we can keep parsing the table without throwing random error
// messages at the user. However, this will trigger an Assertion (in debug) or crashes when the action is
// actually run later.
error_display(0,
"The action %s is not available in the current context. This will lead to an Assertion failure when "
"this action is triggered.",
parseString.c_str());
}
return actionInstance;
}
return std::unique_ptr<Action>();
}
ActionDefinitionManager::ActionDefinitionManager()
{
addDefinition(
std::unique_ptr<ActionDefinition>(new BuiltinActionDefinition<types::MoveToSubmodel>("Move To Subobject")));
addDefinition(std::unique_ptr<ActionDefinition>(
new BuiltinActionDefinition<types::ParticleEffectAction>("Start Particle Effect")));
addDefinition(
std::unique_ptr<ActionDefinition>(new BuiltinActionDefinition<types::PlaySoundAction>("Play 3D Sound")));
addDefinition(
std::unique_ptr<ActionDefinition>(new BuiltinActionDefinition<types::SetDirectionAction>("Set Direction")));
addDefinition(
std::unique_ptr<ActionDefinition>(new BuiltinActionDefinition<types::SetPositionAction>("Set Position")));
addDefinition(std::unique_ptr<ActionDefinition>(new BuiltinActionDefinition<types::WaitAction>("Wait")));
}
} // namespace actions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include "ActionDefinition.h"
namespace actions {
class ActionDefinitionManager {
public:
// This type is supposed to be global so it may not be copied
ActionDefinitionManager(const ActionDefinitionManager&) = delete;
ActionDefinitionManager& operator=(const ActionDefinitionManager&) = delete;
ActionDefinitionManager(ActionDefinitionManager&&) noexcept = default;
ActionDefinitionManager& operator=(ActionDefinitionManager&&) noexcept = default;
std::unique_ptr<Action> parseAction(const flagset<ProgramContextFlags>& context_flags,
const expression::ParseContext& context) const;
static const ActionDefinitionManager& instance();
private:
ActionDefinitionManager();
void addDefinition(std::unique_ptr<ActionDefinition> def);
SCP_vector<std::unique_ptr<ActionDefinition>> m_definitions;
};
} // namespace actions
+37
View File
@@ -0,0 +1,37 @@
#pragma once
#include "ActionDefinition.h"
#include "expression/Value.h"
namespace actions {
template <typename TAction>
class BuiltinActionDefinition : public ActionDefinition {
using ActionValueType = typename TAction::ValueType;
public:
BuiltinActionDefinition(SCP_string name)
: ActionDefinition(std::move(name), {{"parameter", expression::ValueTypeTraits<ActionValueType>::type}})
{
}
~BuiltinActionDefinition() override = default;
flagset<ProgramContextFlags> getRequiredContext() const override
{
return flagset<ProgramContextFlags>(TAction::getRequiredExecutionContextFlags());
}
std::unique_ptr<Action> createAction(
const SCP_unordered_map<SCP_string, expression::ActionExpression>& parameterExpressions) const override
{
const auto paramIter = parameterExpressions.find("parameter");
// This should have been caught earlier
Assertion(paramIter != parameterExpressions.cend(), "Could not find built-in parameter!");
return std::unique_ptr<Action>(new TAction(paramIter->second.template asTyped<ActionValueType>()));
}
};
} // namespace actions
+174
View File
@@ -0,0 +1,174 @@
#include "Program.h"
#include "Action.h"
#include "actions/ActionDefinitionManager.h"
#include "executor/global_executors.h"
#include "tracing/Monitor.h"
#include "tracing/categories.h"
#include "tracing/tracing.h"
namespace {
using namespace actions;
tracing::Monitor<int> RunningProgramsMonitor("RunningPrograms", 0);
struct ProgramRunner {
tracing::RunningCounter runningCounter{RunningProgramsMonitor};
ProgramInstance instance;
explicit ProgramRunner(const ProgramInstance& _instance) : instance(_instance) {}
executor::Executor::CallbackResult operator()()
{
TRACE_SCOPE(tracing::ProgramStepOne);
auto res = instance.step();
switch (res) {
case ProgramState::Running:
// If the program is still running then we need to reschedule our execution
return executor::Executor::CallbackResult::Reschedule;
case ProgramState::Done:
case ProgramState::Errored:
default:
return executor::Executor::CallbackResult::Done;
}
}
};
} // namespace
namespace actions {
ProgramInstance::ProgramInstance(const actions::Program* program) : _program(program) {}
ProgramState ProgramInstance::step()
{
if (!_locals.host.IsValid()) {
return ProgramState::Done;
}
auto& actions = _program->getActions();
for (; _currentInstruction < actions.size(); ++_currentInstruction) {
auto& action = actions[_currentInstruction];
auto result = action->execute(_locals);
if (result == ActionResult::Errored) {
return ProgramState::Errored;
}
if (result == ActionResult::Wait) {
// Action is not done yet, call again next frame
return ProgramState::Running;
}
// Action finished, run next action in program
}
// End of program reached, we are done now
return ProgramState::Done;
}
ProgramLocals& ProgramInstance::locals()
{
return _locals;
}
const ProgramLocals& ProgramInstance::locals() const
{
return _locals;
}
const SCP_vector<std::unique_ptr<actions::Action>>& Program::getActions() const
{
return _actions;
}
Program::Program() = default;
ProgramInstance Program::newInstance() const
{
return ProgramInstance(this);
}
void Program::parseActions(const flagset<ProgramContextFlags>& context_flags, const expression::ParseContext& context)
{
while (true) {
auto action = ActionDefinitionManager::instance().parseAction(context_flags, context);
if (!action) {
break;
}
_actions.push_back(std::move(action));
}
}
Program::Program(const Program& other) { *this = other; }
Program& Program::operator=(const Program& other)
{
_actions.clear();
_actions.reserve(other._actions.size());
for (auto& action : other._actions) {
_actions.emplace_back(action->clone());
}
return *this;
}
Program& Program::operator=(Program&&) noexcept = default;
Program::Program(Program&&) noexcept = default;
bool ProgramSet::isEmpty() const
{
return _programs.empty();
}
ProgramSet::ProgramSet() = default;
ProgramSet::ProgramSet(const flagset<ProgramContextFlags>& context_flags) : _contextFlags(context_flags) {}
void ProgramSet::start(object* objp, const vec3d* local_pos, const matrix* local_orient, int submodel) const
{
if (_contextFlags[ProgramContextFlags::HasObject]) {
Assertion(objp != nullptr, "Invalid object pointer supplied.");
}
if (_contextFlags[ProgramContextFlags::HasSubobject]) {
Assertion(submodel >= 0, "Invalid subobject supplied.");
}
for (const auto& prog : _programs) {
auto instance = prog.newInstance();
instance.locals().host = object_h(objp);
instance.locals().localPosition = *local_pos;
instance.locals().localOrient = *local_orient;
instance.locals().hostSubobject = submodel;
instance.locals().variables = getDefaultTableVariables();
// Just use the executor system to take care of running this program
executor::OnSimulationExecutor->post(ProgramRunner(instance));
}
}
ProgramSet ProgramSet::parseProgramSet(const char* tag, const flagset<ProgramContextFlags>& context_flags)
{
ProgramSet set(context_flags);
const auto parseContext = getTableParseContext();
while (optional_string(tag)) {
Program p;
p.parseActions(context_flags, parseContext);
set._programs.push_back(std::move(p));
}
return set;
}
} // namespace actions
+112
View File
@@ -0,0 +1,112 @@
#pragma once
#include "globalincs/pstypes.h"
#include "Action.h"
#include "common.h"
namespace actions {
class Program;
class ProgramSet;
enum class ProgramState
{
Running,
Done,
Errored
};
/**
* @brief An instance of a program execution
*
* A program instance contains all information related to a single execution of a program. A program instance is
* independent from other instances. Local variables used by actions are stored in a specific structure which can be
* used by actions to keep track of state in this specific instance.
*/
class ProgramInstance {
size_t _currentInstruction = 0;
ProgramLocals _locals;
const Program* _program = nullptr;
public:
explicit ProgramInstance(const Program* program);
ProgramState step();
ProgramLocals& locals();
const ProgramLocals& locals() const;
};
/**
* @brief A program specified in a table
*
* A program is a sequential collection of Actions which are executed in sequence.
*/
class Program {
SCP_vector<std::unique_ptr<Action>> _actions;
public:
Program();
Program(const Program& other);
Program& operator=(const Program& other);
Program(Program&& other) noexcept;
Program& operator=(Program&& other) noexcept;
const SCP_vector<std::unique_ptr<actions::Action>>& getActions() const;
/**
* @brief Creates a new program instance from this program
*
* The program instance is initialized to its initial values.
*
* @return The new program instance
*/
ProgramInstance newInstance() const;
void parseActions(const flagset<ProgramContextFlags>& context_flags, const expression::ParseContext& context);
};
/**
* @brief A set of parsed programs
*
* Programs are parsed in sets of zero or more programs to make it possible for the content creator to split up
* programs.
*/
class ProgramSet {
flagset<ProgramContextFlags> _contextFlags;
SCP_vector<Program> _programs;
public:
ProgramSet();
explicit ProgramSet(const flagset<ProgramContextFlags>& context_flags);
bool isEmpty() const;
/**
* @brief Starts the execution of all programs within this set with the specified parameters
* @param objp The object on which this program is executed
* @param local_pos The local position relative to the object or the subsystem if specified
* @param local_orien The local orientation relative to the object or the subsystem if specified
* @param submodel The submodel of the model to which this program is attached to.
*/
void start(object* objp, const vec3d* local_pos, const matrix* local_orient, int submodel = -1) const;
/**
* @brief Parses a program set of zero or more programs
*
* The tag is entirely optional and if it doesn't appear in the current table then an empty set will be returned
* which does nothing if started.
*
* @param tag The tag which is required before a program can be specified
* @param context_flags A set of flags which specify in which environment the program will be used. This is used
* mainly for validating the used actions.
* @return The parsed program set.
*/
static ProgramSet parseProgramSet(const char* tag, const flagset<ProgramContextFlags>& context_flags = {});
};
} // namespace actions
+27
View File
@@ -0,0 +1,27 @@
#include "common.h"
namespace actions {
expression::ParseContext getTableParseContext()
{
expression::ParseContext ctx;
auto& locals = ctx.variables.addScope("locals");
locals.addMember("position", expression::ValueType::Vector);
locals.addMember("direction", expression::ValueType::Vector);
return ctx;
}
expression::ProgramVariables getDefaultTableVariables()
{
expression::ProgramVariables vars;
vars.setValue({"locals", "position"}, expression::Value(vmd_zero_vector));
vars.setValue({"locals", "direction"}, expression::Value(vmd_zero_vector));
return vars;
}
} // namespace actions
+59
View File
@@ -0,0 +1,59 @@
#pragma once
#include "globalincs/flagset.h"
#include "actions/expression/ParseContext.h"
#include "actions/expression/ProgramVariables.h"
#include "math/vecmat.h"
#include "object/object.h"
class object;
class ship_subsys;
namespace actions {
struct ProgramLocals {
object_h host;
vec3d localPosition = vmd_zero_vector;
matrix localOrient = vmd_identity_matrix;
int hostSubobject = -1;
TIMESTAMP waitTimestamp = TIMESTAMP::invalid();
expression::ProgramVariables variables;
};
/**
* @brief A list of flags for altering the program parsing behavior
*
* This should be used for differentiating between different program environments when validating the program (e.g. a
* particle effect requires an object host).
*/
// clang-format off
FLAG_LIST(ProgramContextFlags) {
HasObject = 0, //!< The program will be started with an object host
HasSubobject, //!< The program will be started with a subobject host
NUM_VALUES
};
// clang-format on
/**
* @brief Constructs the "table" parse context
*
* This is the context that is available when parsing a program from an external table (e.g. ships or weapons).
*
* @return The parse context
*/
expression::ParseContext getTableParseContext();
/**
* @brief Gets a program variables instance initialized with the default values
*
* The values are consistent with what is required for the default table parse context;
*
* @return The program variables
*/
expression::ProgramVariables getDefaultTableVariables();
} // namespace actions
@@ -0,0 +1,66 @@
#include "ActionExpression.h"
#include "ExpressionParser.h"
#include "TypeDefinition.h"
#include "actions/expression/nodes/AbstractExpression.h"
namespace actions {
namespace expression {
namespace {
SCP_string getTypeName(ValueType type)
{
const auto& typeDef = TypeDefinition::forValueType(type);
return typeDef.getName();
}
} // namespace
ActionExpression ActionExpression::parseFromTable(ValueType expectedReturnType, const ParseContext& context)
{
SCP_string expressionText;
stuff_string(expressionText, F_NAME);
ExpressionParser parser(expressionText);
auto expression = parser.parse(context);
if (!expression) {
error_display(0, "Failed to parse action expression:\n%s", parser.getErrorText().c_str());
return ActionExpression();
}
auto type = expression->getExpressionType();
// Check if the type this evaluates to matches what we expect
if (!checkTypeWithImplicitConversion(type, expectedReturnType)) {
error_display(0,
"Expression evaluates to type <%s> but <%s> was expected!",
getTypeName(type).c_str(),
getTypeName(expectedReturnType).c_str());
return ActionExpression();
}
// Everything is valid
return ActionExpression(expression);
}
Value ActionExpression::execute(const ProgramVariables& variables) const
{
// Do not crash on invalid expressions
if (!isValid()) {
return Value();
}
return m_expression->execute(variables);
}
bool ActionExpression::isValid() const
{
return m_expression != nullptr;
}
} // namespace expression
} // namespace actions
@@ -0,0 +1,83 @@
#pragma once
#include "ParseContext.h"
#include "ProgramVariables.h"
#include "TypeDefinition.h"
#include "parse/parselo.h"
namespace actions {
namespace expression {
namespace nodes {
class AbstractExpression;
}
template <typename T>
class TypedActionExpression;
/**
* @brief An expression that can be executed to compute a value at runtime
*
* This is the basis of having dynamic values in actions by allowing mods to specify complex expressions that make use
* of variables and functions for computing their values at runtime.
*/
class ActionExpression {
public:
ActionExpression() = default;
Value execute(const ProgramVariables& variables) const;
bool isValid() const;
template <typename T>
TypedActionExpression<T> asTyped() const;
static ActionExpression parseFromTable(ValueType expectedReturnType, const ParseContext& context);
protected:
explicit ActionExpression(std::shared_ptr<nodes::AbstractExpression> expression)
: m_expression(std::move(expression))
{
}
std::shared_ptr<nodes::AbstractExpression> m_expression;
};
/**
* @brief An action expression with a specific type specified at compile time
*
* This is most useful for built-in actions that have the required type fixed at compile time.
*
* @tparam T The type of the expression value.
*/
template <typename T>
class TypedActionExpression {
public:
explicit TypedActionExpression(ActionExpression expression) : m_expression(std::move(expression)) {}
T execute(const ProgramVariables& variables) const
{
// Do not crash on invalid expressions
if (!m_expression.isValid()) {
return T();
}
return m_expression.execute(variables).template get<T>();
}
static TypedActionExpression<T> parseFromTable(const ParseContext& context)
{
return ActionExpression::parseFromTable(ValueTypeTraits<T>::type, context).template asTyped<T>();
}
private:
ActionExpression m_expression;
};
template <typename T>
TypedActionExpression<T> ActionExpression::asTyped() const
{
return TypedActionExpression<T>(*this);
}
} // namespace expression
} // namespace actions
@@ -0,0 +1,194 @@
#include "ExpressionParser.h"
#include "actions/expression/nodes/FunctionCallExpression.h"
#include "actions/expression/nodes/LiteralExpression.h"
#include "actions/expression/nodes/RandomRangeExpression.h"
#include "actions/expression/nodes/VariableReferenceExpression.h"
#include "actions/expression/nodes/VectorConstructorExpression.h"
#include "libs/antlr/ErrorListener.h"
PUSH_SUPPRESS_WARNINGS
#include "action_expression/generated/ActionExpressionLexer.h"
#include "action_expression/generated/ActionExpressionParser.h"
#include "action_expression/generated/ActionExpressionVisitor.h"
POP_SUPPRESS_WARNINGS
namespace actions {
namespace expression {
namespace {
class ExpressionBuilderVisitor : public ActionExpressionVisitor {
public:
antlrcpp::Any visitExpression_main(ActionExpressionParser::Expression_mainContext* context) override
{
return visit(context->expression());
}
antlrcpp::Any visitExpression(ActionExpressionParser::ExpressionContext* context) override
{
if (context->value_expression() != nullptr) {
return visit(context->value_expression());
}
if (context->parenthesis_expression()) {
return visit(context->parenthesis_expression());
}
if (context->random_range_expression()) {
return visit(context->random_range_expression());
}
if (context->variable_reference_expression()) {
return visit(context->variable_reference_expression());
}
// This is an operator so treat it as one.
antlr4::Token* operatorTok;
SCP_string operatorText;
if (context->PLUS() != nullptr) {
operatorTok = context->PLUS()->getSymbol();
operatorText = context->PLUS()->getText();
} else {
operatorTok = context->MINUS()->getSymbol();
operatorText = context->MINUS()->getText();
}
const auto leftExpr = visit(context->expression(0)).as<std::shared_ptr<nodes::AbstractExpression>>();
const auto rightExpr = visit(context->expression(1)).as<std::shared_ptr<nodes::AbstractExpression>>();
auto operatorExpression = std::make_shared<nodes::FunctionCallExpression>(operatorTok,
true,
std::move(operatorText),
SCP_vector<std::shared_ptr<nodes::AbstractExpression>>{leftExpr, rightExpr});
return std::static_pointer_cast<nodes::AbstractExpression>(operatorExpression);
}
antlrcpp::Any visitVariable_reference_expression(
ActionExpressionParser::Variable_reference_expressionContext* context) override
{
const auto identifiers = context->IDENTIFIER();
SCP_vector<SCP_string> partNames;
partNames.reserve(identifiers.size());
std::transform(identifiers.begin(),
identifiers.end(),
std::back_inserter(partNames),
[](antlr4::tree::TerminalNode* node) { return node->getText(); });
SCP_vector<antlr4::Token*> partTokens;
partTokens.reserve(identifiers.size());
std::transform(identifiers.begin(),
identifiers.end(),
std::back_inserter(partTokens),
[](antlr4::tree::TerminalNode* node) { return node->getSymbol(); });
auto expression =
std::make_shared<nodes::VariableReferenceExpression>(std::move(partNames), std::move(partTokens));
return std::static_pointer_cast<nodes::AbstractExpression>(expression);
}
antlrcpp::Any visitRandom_range_expression(ActionExpressionParser::Random_range_expressionContext* context) override
{
auto expression = std::make_shared<nodes::RandomRangeExpression>(context->RAND_L_PAREN()->getSymbol(),
visit(context->expression(0)).as<std::shared_ptr<nodes::AbstractExpression>>(),
visit(context->expression(1)).as<std::shared_ptr<nodes::AbstractExpression>>());
return std::static_pointer_cast<nodes::AbstractExpression>(expression);
}
antlrcpp::Any visitLiteral_expression(ActionExpressionParser::Literal_expressionContext* context) override
{
std::shared_ptr<nodes::LiteralExpression> expression;
if (context->FLOAT() != nullptr) {
expression = std::make_shared<nodes::LiteralExpression>(context->FLOAT()->getSymbol(),
Value(std::stof(context->FLOAT()->getText())));
} else if (context->INT() != nullptr) {
expression = std::make_shared<nodes::LiteralExpression>(context->INT()->getSymbol(),
Value(std::stoi(context->INT()->getText())));
} else {
const auto idText = context->STRING()->getText();
// Cut off the first and last characters since those are the < > braces
expression = std::make_shared<nodes::LiteralExpression>(context->STRING()->getSymbol(),
Value(idText.substr(1, idText.size() - 2)));
}
return std::static_pointer_cast<nodes::AbstractExpression>(expression);
}
antlrcpp::Any visitParenthesis_expression(ActionExpressionParser::Parenthesis_expressionContext* context) override
{
return visit(context->expression());
}
antlrcpp::Any visitValue_expression(ActionExpressionParser::Value_expressionContext* context) override
{
return visitChildren(context);
}
antlrcpp::Any visitVec3d_constructor(ActionExpressionParser::Vec3d_constructorContext* context) override
{
auto xExpression = visit(context->expression(0)).as<std::shared_ptr<nodes::AbstractExpression>>();
auto yExpression = visit(context->expression(1)).as<std::shared_ptr<nodes::AbstractExpression>>();
auto zExpression = visit(context->expression(2)).as<std::shared_ptr<nodes::AbstractExpression>>();
auto expression = std::make_shared<nodes::VectorConstructorExpression>(context->L_PAREN()->getSymbol(),
xExpression,
yExpression,
zExpression);
return std::static_pointer_cast<nodes::AbstractExpression>(expression);
}
};
} // namespace
ExpressionParser::ExpressionParser(SCP_string expressionText) : m_expressionText(std::move(expressionText)) {}
std::shared_ptr<nodes::AbstractExpression> ExpressionParser::parse(const ParseContext& context)
{
antlr4::ANTLRInputStream input(m_expressionText);
ActionExpressionLexer lexer(&input);
antlr4::CommonTokenStream tokens(&lexer);
::ActionExpressionParser parser(&tokens);
// By default we log to stderr which we do not want
parser.removeErrorListeners();
libs::antlr::ErrorListener errListener;
parser.addErrorListener(&errListener);
antlr4::tree::ParseTree* tree = parser.expression_main();
std::shared_ptr<nodes::AbstractExpression> exprReturn;
if (errListener.diagnostics.empty()) {
// Only do semantic checking if syntax is valid
ExpressionBuilderVisitor builder;
exprReturn = tree->accept(&builder).as<std::shared_ptr<nodes::AbstractExpression>>();
if (!exprReturn->validate(&parser, context)) {
exprReturn = nullptr;
} else {
exprReturn->validationDone();
}
}
if (!errListener.diagnostics.empty()) {
SCP_stringstream outStream;
for (const auto& diag : errListener.diagnostics) {
SCP_string tokenUnderline;
if (diag.tokenLength > 1) {
tokenUnderline = SCP_string(diag.tokenLength - 1, '~');
}
outStream << m_expressionText << "\n"
<< SCP_string(diag.columnInLine, ' ') << "^" << tokenUnderline << "\n"
<< diag.errorMessage << "\n";
}
m_errorText = outStream.str();
return nullptr;
}
return exprReturn;
}
const SCP_string& ExpressionParser::getErrorText() const
{
return m_errorText;
}
} // namespace expression
} // namespace actions
@@ -0,0 +1,27 @@
#pragma once
#include "actions/expression/nodes/AbstractExpression.h"
#include "globalincs/pstypes.h"
#include "ParseContext.h"
namespace actions {
namespace expression {
class ExpressionParser {
public:
ExpressionParser(SCP_string expressionText);
std::shared_ptr<nodes::AbstractExpression> parse(const ParseContext& context);
const SCP_string& getErrorText() const;
private:
SCP_string m_expressionText;
SCP_string m_errorText;
};
} // namespace expression
} // namespace actions
@@ -0,0 +1,90 @@
#include "FunctionManager.h"
#include "TypeDefinition.h"
#include "math/vecmat.h"
namespace actions {
namespace expression {
namespace {
template <typename T>
Value value_plus(const SCP_vector<Value>& parameters)
{
return Value(parameters[0].get<T>() + parameters[1].get<T>());
}
template <typename T>
Value value_minus(const SCP_vector<Value>& parameters)
{
return Value(parameters[0].get<T>() - parameters[1].get<T>());
}
} // namespace
const FunctionManager& FunctionManager::instance()
{
static const FunctionManager manager;
return manager;
}
void FunctionManager::addOperator(const SCP_string& name,
std::initializer_list<ValueType> parameterTypes,
ValueType returnType,
FunctionImplementation implementation)
{
m_operators[name].push_back({name, parameterTypes, returnType, std::move(implementation)});
}
const FunctionDefinition* FunctionManager::findOperator(const SCP_string& name,
const SCP_vector<ValueType>& parameters) const
{
const auto iter = m_operators.find(name);
if (iter == m_operators.end()) {
return nullptr;
}
// Prefer exact matches
for (const auto& funcDef : iter->second) {
if (funcDef.parameterTypes == parameters) {
return &funcDef;
}
}
// Now check if there are matches with implicit conversions
for (const auto& funcDef : iter->second) {
// Reject functions with different amount of elements
if (funcDef.parameterTypes.size() != parameters.size()) {
continue;
}
auto funcParamIter = funcDef.parameterTypes.cbegin();
auto actualParamIter = parameters.cbegin();
bool match = true;
for (; funcParamIter != funcDef.parameterTypes.cend(); ++funcParamIter, ++actualParamIter) {
if (!checkTypeWithImplicitConversion(*actualParamIter, *funcParamIter)) {
// Also doesn't match with implicit conversions
match = false;
break;
}
}
if (match) {
return &funcDef;
}
}
return nullptr;
}
FunctionManager::FunctionManager()
{
addOperator("+", {ValueType::Integer, ValueType::Integer}, ValueType::Integer, value_plus<int>);
addOperator("+", {ValueType::Float, ValueType::Float}, ValueType::Float, value_plus<float>);
addOperator("+", {ValueType::Vector, ValueType::Vector}, ValueType::Vector, value_plus<vec3d>);
addOperator("-", {ValueType::Integer, ValueType::Integer}, ValueType::Integer, value_minus<int>);
addOperator("-", {ValueType::Float, ValueType::Float}, ValueType::Float, value_minus<float>);
addOperator("-", {ValueType::Vector, ValueType::Vector}, ValueType::Vector, value_minus<vec3d>);
}
} // namespace expression
} // namespace actions
+45
View File
@@ -0,0 +1,45 @@
#pragma once
#include "Value.h"
namespace actions {
namespace expression {
using FunctionImplementation = std::function<Value(const SCP_vector<Value>& parameters)>;
struct FunctionDefinition {
SCP_string name;
SCP_vector<ValueType> parameterTypes;
ValueType returnType;
FunctionImplementation implementation;
};
class FunctionManager {
public:
// This type is supposed to be global so it may not be copied
FunctionManager(const FunctionManager&) = delete;
FunctionManager& operator=(const FunctionManager&) = delete;
FunctionManager(FunctionManager&&) noexcept = default;
FunctionManager& operator=(FunctionManager&&) noexcept = default;
void addOperator(const SCP_string& name,
std::initializer_list<ValueType> parameterTypes,
ValueType returnType,
FunctionImplementation implementation);
const FunctionDefinition* findOperator(const SCP_string& name, const SCP_vector<ValueType>& parameterTypes) const;
static const FunctionManager& instance();
private:
FunctionManager();
SCP_unordered_map<SCP_string, SCP_vector<FunctionDefinition>> m_operators;
};
} // namespace expression
} // namespace actions
+13
View File
@@ -0,0 +1,13 @@
#pragma once
#include "ProgramVariables.h"
namespace actions {
namespace expression {
struct ParseContext {
ProgramVariablesDefinition variables;
};
} // namespace expression
} // namespace actions
@@ -0,0 +1,61 @@
#include "ProgramVariables.h"
namespace actions {
namespace expression {
ProgramVariablesDefinition& ProgramVariablesDefinition::addScope(const SCP_string& name)
{
auto scope = std::unique_ptr<ProgramVariablesDefinition>(new ProgramVariablesDefinition());
auto scopePtr = scope.get();
m_scopes.insert(std::make_pair(name, std::move(scope)));
return *scopePtr;
}
void ProgramVariablesDefinition::addMember(const SCP_string& name, ValueType type)
{
m_memberTypes[name] = type;
}
ProgramVariablesDefinition* ProgramVariablesDefinition::getScope(const SCP_string& name) const
{
const auto iter = m_scopes.find(name);
if (iter == m_scopes.cend()) {
return nullptr;
}
return iter->second.get();
}
ValueType ProgramVariablesDefinition::getMemberType(const SCP_string& name) const
{
const auto iter = m_memberTypes.find(name);
if (iter == m_memberTypes.cend()) {
return ValueType::Invalid;
}
return iter->second;
}
Value ProgramVariables::getValue(std::initializer_list<const char*> memberPathParts) const
{
return getValue<decltype(memberPathParts)>(memberPathParts);
}
void ProgramVariables::setValue(std::initializer_list<const char*> memberPathParts, Value value)
{
setValue<decltype(memberPathParts)>(memberPathParts, std::move(value));
}
Value ProgramVariables::getValue(const SCP_string& fullMemberName) const
{
const auto iter = m_values.find(fullMemberName);
// This should have been validated earlier
Assertion(iter != m_values.end(), "Could not find member %s in variables!", fullMemberName.c_str());
return iter->second;
}
} // namespace expression
} // namespace actions
@@ -0,0 +1,61 @@
#pragma once
#include "Value.h"
#include "utils/join_string.h"
namespace actions {
namespace expression {
struct ProgramVariables {
public:
template <typename TContainer>
static SCP_string getMemberName(const TContainer& memberPathParts)
{
return util::join_container(memberPathParts, ".");
}
template <typename TContainer>
Value getValue(const TContainer& memberPathParts) const
{
const auto name = getMemberName(memberPathParts);
return getValue(name);
}
Value getValue(std::initializer_list<const char*> memberPathParts) const;
Value getValue(const SCP_string& fullMemberName) const;
template <typename TContainer>
void setValue(const TContainer& memberPathParts, Value value)
{
const auto name = getMemberName(memberPathParts);
m_values[name] = std::move(value);
}
void setValue(std::initializer_list<const char*> memberPathParts, Value value);
private:
SCP_unordered_map<SCP_string, Value> m_values;
};
class ProgramVariablesDefinition {
public:
ProgramVariablesDefinition& addScope(const SCP_string& name);
void addMember(const SCP_string& name, ValueType type);
ProgramVariablesDefinition* getScope(const SCP_string& name) const;
ValueType getMemberType(const SCP_string& name) const;
private:
SCP_unordered_map<SCP_string, std::unique_ptr<ProgramVariablesDefinition>> m_scopes;
SCP_unordered_map<SCP_string, ValueType> m_memberTypes;
};
} // namespace expression
} // namespace actions
@@ -0,0 +1,60 @@
#include "TypeDefinition.h"
namespace actions {
namespace expression {
// Integers can be safely converted to floats (for the most part)
TypeDefinition TypeDefinition::s_integer("Integer", {ValueType::Float});
// No implicit conversions here
TypeDefinition TypeDefinition::s_float("Float", {});
TypeDefinition TypeDefinition::s_vector("Vector", {});
// Identifiers are a technicality needed for making non-math values work but they have no further use other than their
// string content
TypeDefinition TypeDefinition::s_identifier("Identifier", {});
TypeDefinition::TypeDefinition(SCP_string name, SCP_vector<actions::expression::ValueType> allowedImplicitConversion)
: m_name(std::move(name)), m_allowedImplicitConversions(std::move(allowedImplicitConversion))
{
}
const SCP_string& TypeDefinition::getName() const
{
return m_name;
}
const SCP_vector<actions::expression::ValueType>& TypeDefinition::getAllowedImplicitConversions() const
{
return m_allowedImplicitConversions;
}
const TypeDefinition& TypeDefinition::forValueType(ValueType type)
{
switch (type) {
case ValueType::Integer:
return s_integer;
case ValueType::Float:
return s_float;
case ValueType::Vector:
return s_vector;
case ValueType::String:
return s_identifier;
default:
UNREACHABLE("Invalid value type!");
return s_integer; // Make compiler happy
}
}
bool checkTypeWithImplicitConversion(ValueType currentType, ValueType expectedType)
{
if (currentType == expectedType) {
// No need to consider implicit conversions;
return true;
}
const auto& currentTypeDef = TypeDefinition::forValueType(currentType);
const auto& allowedConversions = currentTypeDef.getAllowedImplicitConversions();
// For now, no transitiv conversions are allowed
return std::find(allowedConversions.cbegin(), allowedConversions.cend(), expectedType) != allowedConversions.cend();
}
} // namespace expression
} // namespace actions
+40
View File
@@ -0,0 +1,40 @@
#pragma once
#include "Value.h"
namespace actions {
namespace expression {
class TypeDefinition {
public:
TypeDefinition(SCP_string name, SCP_vector<actions::expression::ValueType> allowedImplicitConversion);
const SCP_string& getName() const;
const SCP_vector<actions::expression::ValueType>& getAllowedImplicitConversions() const;
static const TypeDefinition& forValueType(ValueType type);
// This type is supposed to be global so it may not be copied
TypeDefinition(const TypeDefinition&) = delete;
TypeDefinition& operator=(const TypeDefinition&) = delete;
TypeDefinition(TypeDefinition&&) = delete;
TypeDefinition& operator=(TypeDefinition&&) = delete;
private:
SCP_string m_name;
// The types this type is allowed to implicitly convert to
SCP_vector<ValueType> m_allowedImplicitConversions;
static TypeDefinition s_integer;
static TypeDefinition s_float;
static TypeDefinition s_vector;
static TypeDefinition s_identifier;
};
bool checkTypeWithImplicitConversion(ValueType currentType, ValueType expectedType);
} // namespace expression
} // namespace actions
+80
View File
@@ -0,0 +1,80 @@
#include "Value.h"
#include "math/vecmat.h"
namespace actions {
namespace expression {
Value::Value(int val) : m_value(val) {}
Value::Value(float val) : m_value(val) {}
Value::Value(const vec3d& val) : m_value(val) {}
Value::Value(SCP_string val) : m_value(std::move(val)) {}
ValueType actions::expression::Value::getType() const
{
switch (m_value.index()) {
case 1:
return ValueType::Integer;
case 2:
return ValueType::Float;
case 3:
return ValueType::Vector;
case 4:
return ValueType::String;
default:
return ValueType::Invalid;
}
}
int Value::getInteger() const
{
return get<int>();
}
float Value::getFloat() const
{
return get<float>();
}
vec3d Value::getVector() const
{
return get<vec3d>();
}
SCP_string Value::getIdentifier() const
{
return get<SCP_string>();
}
bool operator==(const Value& lhs, const Value& rhs)
{
return lhs.m_value == rhs.m_value;
}
bool operator!=(const Value& lhs, const Value& rhs)
{
return !(rhs == lhs);
}
std::ostream& operator<<(std::ostream& os, const Value& value)
{
os << "Value<";
switch (value.getType()) {
case ValueType::Invalid:
os << "INVALID";
break;
case ValueType::Integer:
os << value.get<int>();
break;
case ValueType::Float:
os << value.get<float>();
break;
case ValueType::Vector:
os << value.get<vec3d>();
break;
case ValueType::String:
os << value.get<SCP_string>();
break;
}
os << ">";
return os;
}
} // namespace expression
} // namespace actions
+104
View File
@@ -0,0 +1,104 @@
#pragma once
#include "globalincs/pstypes.h"
#include <mpark/variant.hpp>
namespace actions {
namespace expression {
namespace detail {
template <typename ToType>
struct implicit_conversion {
template <typename T>
ToType operator()(const T&)
{
throw std::runtime_error("Invalid implicit conversion.");
}
};
template<>
struct implicit_conversion<float> {
inline float operator()(int val) {
return i2fl(val);
}
template <typename T>
float operator()(const T&)
{
throw std::runtime_error("Invalid implicit conversion.");
}
};
} // namespace detail
enum class ValueType
{
Invalid,
Integer,
Float,
Vector,
String,
};
template <typename T>
struct ValueTypeTraits;
template <>
struct ValueTypeTraits<int> {
static constexpr ValueType type = ValueType::Integer;
};
template <>
struct ValueTypeTraits<float> {
static constexpr ValueType type = ValueType::Float;
};
template <>
struct ValueTypeTraits<vec3d> {
static constexpr ValueType type = ValueType::Vector;
};
template <>
struct ValueTypeTraits<SCP_string> {
static constexpr ValueType type = ValueType::String;
};
class Value {
public:
Value() = default;
explicit Value(int val);
explicit Value(float val);
explicit Value(const vec3d& val);
explicit Value(SCP_string val);
ValueType getType() const;
int getInteger() const;
float getFloat() const;
vec3d getVector() const;
SCP_string getIdentifier() const;
template <typename T>
T get() const
{
const auto currentType = getType();
const auto expectedType = ValueTypeTraits<T>::type;
if (currentType == expectedType) {
// No conversion necessary
return mpark::get<T>(m_value);
}
return mpark::visit(detail::implicit_conversion<T>{}, m_value);
}
friend bool operator==(const Value& lhs, const Value& rhs);
friend bool operator!=(const Value& lhs, const Value& rhs);
friend std::ostream& operator<<(std::ostream& os, const Value& value);
private:
mpark::variant<mpark::monostate, int, float, vec3d, SCP_string> m_value;
};
} // namespace expression
} // namespace actions
@@ -0,0 +1,31 @@
#include "AbstractExpression.h"
namespace actions {
namespace expression {
namespace nodes {
AbstractExpression::AbstractExpression(antlr4::Token* token) : m_token(token) {}
AbstractExpression::~AbstractExpression() = default;
antlr4::Token* AbstractExpression::getToken() const
{
return m_token;
}
ValueType AbstractExpression::getExpressionType() const
{
// Since expressions are immutable, caching this will be more efficient
if (m_cachedType == ValueType::Invalid) {
m_cachedType = determineReturnType();
}
return m_cachedType;
}
void AbstractExpression::validationDone()
{
// This pointer will become invalid after this so reset it now to avoid issues
m_token = nullptr;
}
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,38 @@
#pragma once
#include <Parser.h>
#include <Token.h>
#include "actions/expression/ParseContext.h"
#include "actions/expression/Value.h"
namespace actions {
namespace expression {
namespace nodes {
class AbstractExpression {
public:
AbstractExpression(antlr4::Token* token);
virtual ~AbstractExpression();
virtual Value execute(const ProgramVariables& variables) const = 0;
virtual bool validate(antlr4::Parser* parser, const ParseContext& context) = 0;
virtual void validationDone();
ValueType getExpressionType() const;
antlr4::Token* getToken() const;
protected:
virtual ValueType determineReturnType() const = 0;
antlr4::Token* m_token = nullptr;
mutable ValueType m_cachedType = ValueType::Invalid;
};
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,95 @@
#include "FunctionCallExpression.h"
#include "actions/expression/TypeDefinition.h"
namespace actions {
namespace expression {
namespace nodes {
FunctionCallExpression::FunctionCallExpression(antlr4::Token* token,
bool isOperator,
SCP_string functionName,
SCP_vector<std::shared_ptr<AbstractExpression>> parameterExpressions)
: AbstractExpression(token), m_isOperator(isOperator), m_functionName(std::move(functionName)),
m_parameterExpressions(std::move(parameterExpressions))
{
}
FunctionCallExpression::~FunctionCallExpression() = default;
Value FunctionCallExpression::execute(const ProgramVariables& variables) const
{
SCP_vector<Value> parameterValues;
parameterValues.reserve(m_parameterExpressions.size());
std::transform(m_parameterExpressions.cbegin(),
m_parameterExpressions.cend(),
std::back_inserter(parameterValues),
[&variables](const std::shared_ptr<AbstractExpression>& expression) { return expression->execute(variables); });
return m_functionDef->implementation(parameterValues);
}
bool FunctionCallExpression::validate(antlr4::Parser* parser, const ParseContext& context)
{
bool valid = true;
for (const auto& paramExpression : m_parameterExpressions) {
valid &= paramExpression->validate(parser, context);
}
if (!valid) {
// Exit early if there were errors since the values below are meaningless otherwise
return false;
}
Assertion(m_isOperator, "Non-operator functions are not supported yet!");
SCP_vector<ValueType> parameterTypes;
std::transform(m_parameterExpressions.cbegin(),
m_parameterExpressions.cend(),
std::back_inserter(parameterTypes),
[](const std::shared_ptr<AbstractExpression>& expression) { return expression->getExpressionType(); });
const auto functionDef = FunctionManager::instance().findOperator(m_functionName, parameterTypes);
if (functionDef == nullptr) {
SCP_stringstream paramListStream;
if (!parameterTypes.empty()) {
paramListStream << "<" << TypeDefinition::forValueType(parameterTypes.front()).getName() << ">";
for (auto iter = parameterTypes.cbegin() + 1; iter != parameterTypes.cend(); ++iter) {
paramListStream << ", <" << TypeDefinition::forValueType(*iter).getName() << ">";
}
}
parser->notifyErrorListeners(m_token,
SCP_string("Could not find a definition for the ") + (m_isOperator ? "operator" : "function") + " '" +
m_functionName + "' with parameters (" + paramListStream.str() + ")",
nullptr);
return false;
}
m_functionDef = functionDef;
return true;
}
ValueType FunctionCallExpression::determineReturnType() const
{
return m_functionDef->returnType;
}
void FunctionCallExpression::validationDone()
{
AbstractExpression::validationDone();
// We no longer need this so we can save some memory
m_functionName.clear();
m_functionName.shrink_to_fit();
for (const auto& paramExpression : m_parameterExpressions) {
paramExpression->validationDone();
}
}
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,38 @@
#pragma once
#include "AbstractExpression.h"
#include "actions/expression/FunctionManager.h"
#include "actions/expression/Value.h"
namespace actions {
namespace expression {
namespace nodes {
class FunctionCallExpression : public AbstractExpression {
public:
FunctionCallExpression(antlr4::Token* token,
bool isOperator,
SCP_string functionName,
SCP_vector<std::shared_ptr<AbstractExpression>> parameterExpressions);
~FunctionCallExpression() override;
Value execute(const ProgramVariables& variables) const override;
bool validate(antlr4::Parser* parser, const ParseContext& context) override;
void validationDone() override;
protected:
ValueType determineReturnType() const override;
private:
bool m_isOperator;
SCP_string m_functionName;
const FunctionDefinition* m_functionDef = nullptr;
SCP_vector<std::shared_ptr<AbstractExpression>> m_parameterExpressions;
};
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,30 @@
#include "LiteralExpression.h"
namespace actions {
namespace expression {
namespace nodes {
LiteralExpression::LiteralExpression(antlr4::Token* token, Value literalValue)
: AbstractExpression(token), m_literalValue(std::move(literalValue))
{
}
LiteralExpression::~LiteralExpression() = default;
Value LiteralExpression::execute(const ProgramVariables& /*variables*/) const
{
return m_literalValue;
}
bool LiteralExpression::validate(antlr4::Parser* /*parser*/, const ParseContext& /*context*/)
{
// Literals are always valid
return true;
}
ValueType LiteralExpression::determineReturnType() const
{
return m_literalValue.getType();
}
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,28 @@
#pragma once
#include "AbstractExpression.h"
#include "actions/expression/Value.h"
namespace actions {
namespace expression {
namespace nodes {
class LiteralExpression : public AbstractExpression {
public:
LiteralExpression(antlr4::Token* token, Value literalValue);
~LiteralExpression() override;
Value execute(const ProgramVariables& variables) const override;
bool validate(antlr4::Parser* parser, const ParseContext& context) override;
protected:
ValueType determineReturnType() const override;
private:
Value m_literalValue;
};
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,108 @@
#include "RandomRangeExpression.h"
#include "actions/expression/TypeDefinition.h"
#include "utils/RandomRange.h"
namespace actions {
namespace expression {
namespace nodes {
namespace {
template <typename T>
Value executeHelper(const Value& leftVal, const Value& rightVal)
{
auto leftContentVal = leftVal.get<T>();
auto rightContentVal = rightVal.get<T>();
if (leftContentVal == rightContentVal) {
// no need to do random stuff here
return Value(rightContentVal);
}
if (rightContentVal < leftContentVal) {
// We can fix this issue
std::swap(leftContentVal, rightContentVal);
}
// Might be a bit inefficient not to cache this somehow but the bounds can be dynamic
return Value(util::UniformRange<T>(leftContentVal, rightContentVal).next());
}
} // namespace
RandomRangeExpression::RandomRangeExpression(antlr4::Token* token,
std::shared_ptr<AbstractExpression> leftExpression,
std::shared_ptr<AbstractExpression> rightExpression)
: AbstractExpression(token), m_leftExpression(std::move(leftExpression)),
m_rightExpression(std::move(rightExpression))
{
}
RandomRangeExpression::~RandomRangeExpression() = default;
Value RandomRangeExpression::execute(const ProgramVariables& variables) const
{
const auto leftVal = m_leftExpression->execute(variables);
const auto rightVal = m_rightExpression->execute(variables);
if (leftVal.getType() == ValueType::Integer) {
return executeHelper<int>(leftVal, rightVal);
} else {
return executeHelper<float>(leftVal, rightVal);
}
}
bool RandomRangeExpression::validate(antlr4::Parser* parser, const ParseContext& context)
{
bool valid = true;
valid &= m_leftExpression->validate(parser, context);
valid &= m_rightExpression->validate(parser, context);
if (!valid) {
// Exit early if there were errors since the values below are meaningless otherwise
return false;
}
const auto leftType = m_leftExpression->getExpressionType();
const auto rightType = m_rightExpression->getExpressionType();
const auto& leftTypedef = TypeDefinition::forValueType(leftType);
const auto& rightTypedef = TypeDefinition::forValueType(rightType);
// Both values must be the same
if (leftType != rightType) {
parser->notifyErrorListeners(m_rightExpression->getToken(),
"Inconsistent types for random range. Must be the same but got <" + leftTypedef.getName() + "> and <" +
rightTypedef.getName() + ">.",
nullptr);
return false;
}
// And we only support floats or integers
if (leftType != ValueType::Float && leftType != ValueType::Integer) {
parser->notifyErrorListeners(m_leftExpression->getToken(),
"Invalid parameter type for random range. Must be <Float> or <Integer> but got <" + leftTypedef.getName() +
">.",
nullptr);
return false;
}
// Everything is fine.
return true;
}
ValueType RandomRangeExpression::determineReturnType() const
{
// Return type is the same as the contained return types
return m_leftExpression->getExpressionType();
}
void RandomRangeExpression::validationDone()
{
AbstractExpression::validationDone();
m_leftExpression->validationDone();
m_rightExpression->validationDone();
}
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,30 @@
#pragma once
#include "AbstractExpression.h"
namespace actions {
namespace expression {
namespace nodes {
class RandomRangeExpression : public AbstractExpression {
public:
RandomRangeExpression(antlr4::Token* token,
std::shared_ptr<AbstractExpression> leftExpression,
std::shared_ptr<AbstractExpression> rightExpression);
~RandomRangeExpression() override;
Value execute(const ProgramVariables& variables) const override;
bool validate(antlr4::Parser* parser, const ParseContext& context) override;
void validationDone() override;
protected:
ValueType determineReturnType() const override;
private:
std::shared_ptr<AbstractExpression> m_leftExpression;
std::shared_ptr<AbstractExpression> m_rightExpression;
};
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,69 @@
#include "VariableReferenceExpression.h"
namespace actions {
namespace expression {
namespace nodes {
VariableReferenceExpression::VariableReferenceExpression(SCP_vector<SCP_string> references,
SCP_vector<antlr4::Token*> referenceTokens)
: AbstractExpression(referenceTokens.back()), m_references(std::move(references)),
m_referenceTokens(std::move(referenceTokens))
{
}
VariableReferenceExpression::~VariableReferenceExpression() = default;
Value VariableReferenceExpression::execute(const ProgramVariables& variables) const
{
return variables.getValue(m_fullVariablePath);
}
bool VariableReferenceExpression::validate(antlr4::Parser* parser, const ParseContext& context)
{
// Start out in the global scope
auto currentScope = &context.variables;
SCP_string currentScopeName("<global>");
for (size_t i = 0; i < m_references.size() - 1; ++i) {
const auto nextScope = currentScope->getScope(m_references[i]);
if (nextScope == nullptr) {
parser->notifyErrorListeners(m_referenceTokens[i],
"Could not find scope " + m_references[i] + " in scope " + currentScopeName + ".",
nullptr);
return false;
}
currentScope = nextScope;
currentScopeName = m_references[i];
}
auto variableType = currentScope->getMemberType(m_references.back());
if (variableType == ValueType::Invalid) {
parser->notifyErrorListeners(m_referenceTokens.back(),
"Could not find variable " + m_references.back() + " in scope " + currentScopeName + ".",
nullptr);
return false;
}
// Cache this so we don't duplicate all this code in determineReturnType()
m_variableType = variableType;
m_fullVariablePath = ProgramVariables::getMemberName(m_references);
return true;
}
ValueType VariableReferenceExpression::determineReturnType() const
{
return m_variableType;
}
void VariableReferenceExpression::validationDone()
{
AbstractExpression::validationDone();
// Clear these since they are not necessary anymore
m_references.clear();
m_referenceTokens.clear();
}
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,32 @@
#pragma once
#include "AbstractExpression.h"
namespace actions {
namespace expression {
namespace nodes {
class VariableReferenceExpression : public AbstractExpression {
public:
VariableReferenceExpression(const SCP_vector<SCP_string> references,
SCP_vector<antlr4::Token*> referenceTokens);
~VariableReferenceExpression() override;
Value execute(const ProgramVariables& variables) const override;
bool validate(antlr4::Parser* parser, const ParseContext& context) override;
void validationDone() override;
protected:
ValueType determineReturnType() const override;
private:
ValueType m_variableType = ValueType::Invalid;
SCP_string m_fullVariablePath;
SCP_vector<SCP_string> m_references;
SCP_vector<antlr4::Token*> m_referenceTokens;
};
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,87 @@
#include "VectorConstructorExpression.h"
#include "actions/expression/TypeDefinition.h"
namespace actions {
namespace expression {
namespace nodes {
VectorConstructorExpression::VectorConstructorExpression(antlr4::Token* token,
std::shared_ptr<AbstractExpression> xExpression,
std::shared_ptr<AbstractExpression> yExpression,
std::shared_ptr<AbstractExpression> zExpression)
: AbstractExpression(token), m_xExpression(std::move(xExpression)), m_yExpression(std::move(yExpression)),
m_zExpression(std::move(zExpression))
{
}
VectorConstructorExpression::~VectorConstructorExpression() = default;
Value VectorConstructorExpression::execute(const ProgramVariables& variables) const
{
auto xValue = m_xExpression->execute(variables);
auto yValue = m_yExpression->execute(variables);
auto zValue = m_zExpression->execute(variables);
vec3d vecVal;
vecVal.xyz.x = xValue.getFloat();
vecVal.xyz.y = yValue.getFloat();
vecVal.xyz.z = zValue.getFloat();
return Value(vecVal);
}
bool VectorConstructorExpression::validate(antlr4::Parser* parser, const ParseContext& context)
{
bool valid = true;
valid &= m_xExpression->validate(parser, context);
valid &= m_yExpression->validate(parser, context);
valid &= m_zExpression->validate(parser, context);
if (!valid) {
// Exit early if there were errors since the values below are meaningless otherwise
return false;
}
if (!checkTypeWithImplicitConversion(m_xExpression->getExpressionType(), ValueType::Float)) {
const auto& typeDef = TypeDefinition::forValueType(m_xExpression->getExpressionType());
parser->notifyErrorListeners(m_xExpression->getToken(),
"Invalid value type for vector constructor. Expected <Float>, got <" + typeDef.getName() + ">",
nullptr);
valid = false;
}
if (!checkTypeWithImplicitConversion(m_yExpression->getExpressionType(), ValueType::Float)) {
const auto& typeDef = TypeDefinition::forValueType(m_yExpression->getExpressionType());
parser->notifyErrorListeners(m_yExpression->getToken(),
"Invalid value type for vector constructor. Expected <Float>, got <" + typeDef.getName() + ">",
nullptr);
valid = false;
}
if (!checkTypeWithImplicitConversion(m_zExpression->getExpressionType(), ValueType::Float)) {
const auto& typeDef = TypeDefinition::forValueType(m_zExpression->getExpressionType());
parser->notifyErrorListeners(m_zExpression->getToken(),
"Invalid value type for vector constructor. Expected <Float>, got <" + typeDef.getName() + ">",
nullptr);
valid = false;
}
return valid;
}
ValueType VectorConstructorExpression::determineReturnType() const
{
// No need to look at the expressions here since we will always be a vector
return ValueType::Vector;
}
void VectorConstructorExpression::validationDone()
{
AbstractExpression::validationDone();
m_xExpression->validationDone();
m_yExpression->validationDone();
m_zExpression->validationDone();
}
} // namespace nodes
} // namespace expression
} // namespace actions
@@ -0,0 +1,34 @@
#pragma once
#include "AbstractExpression.h"
#include "actions/expression/Value.h"
namespace actions {
namespace expression {
namespace nodes {
class VectorConstructorExpression : public AbstractExpression {
public:
VectorConstructorExpression(antlr4::Token* token,
std::shared_ptr<AbstractExpression> xExpression,
std::shared_ptr<AbstractExpression> yExpression,
std::shared_ptr<AbstractExpression> zExpression);
~VectorConstructorExpression() override;
Value execute(const ProgramVariables& variables) const override;
bool validate(antlr4::Parser* parser, const ParseContext& context) override;
void validationDone() override;
protected:
ValueType determineReturnType() const override;
private:
std::shared_ptr<AbstractExpression> m_xExpression;
std::shared_ptr<AbstractExpression> m_yExpression;
std::shared_ptr<AbstractExpression> m_zExpression;
};
} // namespace nodes
} // namespace expression
} // namespace actions
+79
View File
@@ -0,0 +1,79 @@
#include "MoveToSubmodel.h"
#include "math/vecmat.h"
#include "parse/parselo.h"
#include "ship/ship.h"
#include <utility>
namespace actions {
namespace types {
flagset<ProgramContextFlags> MoveToSubmodel::getRequiredExecutionContextFlags()
{
return flagset<ProgramContextFlags>{ProgramContextFlags::HasObject, ProgramContextFlags::HasSubobject};
}
MoveToSubmodel::MoveToSubmodel(expression::TypedActionExpression<ValueType> subObjectExpression)
: m_subObjectExpression(std::move(subObjectExpression))
{
}
MoveToSubmodel::~MoveToSubmodel() = default;
ActionResult MoveToSubmodel::execute(ProgramLocals& locals) const
{
// The calling code should ensure that this never happens
Assertion(locals.hostSubobject >= 0, "Did not have a valid host subobject.");
auto instance = object_get_model_instance(locals.host.objp);
Assertion(instance != -1, "Model instances are required if a host subobject is specified.");
auto pmi = model_get_instance(instance);
auto pm = model_get(pmi->model_num);
const auto destinationSubObject = m_subObjectExpression.execute(locals.variables);
bool goToParent = false;
if (destinationSubObject == "<parent>") {
goToParent = true;
}
if (goToParent) {
// Special case when we simply want to go to our parent without explicitly specifying its name
auto parentSubobject = pm->submodel[locals.hostSubobject].parent;
if (parentSubobject < 0) {
Warning(LOCATION,
"Current program subobject %s on model %s has no parent!",
pm->submodel[locals.hostSubobject].name,
pm->filename);
return ActionResult::Errored;
}
// We have a valid parent so this move will work properly
locals.hostSubobject = parentSubobject;
return ActionResult::Finished;
}
// We need to do a linear search for the right subobject
for (int i = 0; i < pm->n_models; ++i) {
const auto submodel = pm->submodel[i];
if (subsystem_stricmp(destinationSubObject.c_str(), submodel.name) == 0) {
// Found something!
locals.hostSubobject = i;
return ActionResult::Finished;
}
}
Warning(LOCATION, "Could not find subobject %s in model %s!", destinationSubObject.c_str(), pm->filename);
return ActionResult::Errored;
}
std::unique_ptr<Action> MoveToSubmodel::clone() const
{
return std::unique_ptr<Action>(new MoveToSubmodel(*this));
}
} // namespace types
} // namespace actions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include "globalincs/flagset.h"
#include "actions/Action.h"
#include "actions/expression/ActionExpression.h"
namespace actions {
namespace types {
class MoveToSubmodel : public Action {
public:
using ValueType = SCP_string;
static flagset<ProgramContextFlags> getRequiredExecutionContextFlags();
explicit MoveToSubmodel(expression::TypedActionExpression<ValueType> subObjectExpression);
~MoveToSubmodel() override;
ActionResult execute(ProgramLocals& locals) const override;
std::unique_ptr<Action> clone() const override;
private:
expression::TypedActionExpression<ValueType> m_subObjectExpression;
};
} // namespace types
} // namespace actions
@@ -0,0 +1,76 @@
#include "ParticleEffectAction.h"
#include "math/vecmat.h"
#include "parse/parselo.h"
#include "ship/ship.h"
#include <utility>
namespace actions {
namespace types {
flagset<ProgramContextFlags> ParticleEffectAction::getRequiredExecutionContextFlags()
{
return flagset<ProgramContextFlags>{ProgramContextFlags::HasObject};
}
ParticleEffectAction::ParticleEffectAction(expression::TypedActionExpression<ValueType> effectExpression)
: m_effectExpression(std::move(effectExpression))
{
}
ParticleEffectAction::~ParticleEffectAction() = default;
ActionResult ParticleEffectAction::execute(ProgramLocals& locals) const
{
auto effectIdx = particle::ParticleManager::get()->getEffectByName(m_effectExpression.execute(locals.variables));
if (!effectIdx.isValid()) {
// In case the parsing code failed
return ActionResult::Errored;
}
using namespace particle;
auto source = ParticleManager::get()->createSource(effectIdx);
vec3d local_pos;
matrix local_orient;
if (locals.hostSubobject != -1) {
auto instance = object_get_model_instance(locals.host.objp);
Assertion(instance != -1, "Model instances are required if a host subobject is specified.");
auto pmi = model_get_instance(instance);
auto pm = model_get(pmi->model_num);
model_instance_local_to_global_point_orient(&local_pos,
&local_orient,
&locals.localPosition,
&locals.localOrient,
pm,
pmi,
locals.hostSubobject);
} else {
local_pos = locals.localPosition;
local_orient = locals.localOrient;
}
local_pos += locals.variables.getValue({"locals", "position"}).getVector();
auto direction = locals.variables.getValue({"locals", "direction"}).getVector();
source.moveToObject(locals.host.objp, &local_pos);
source.setOrientationFromNormalizedVec(&direction, true);
source.finish();
return ActionResult::Finished;
}
std::unique_ptr<Action> ParticleEffectAction::clone() const
{
return std::unique_ptr<Action>(new ParticleEffectAction(*this));
}
} // namespace types
} // namespace actions
+29
View File
@@ -0,0 +1,29 @@
#pragma once
#include "actions/Action.h"
#include "actions/expression/ActionExpression.h"
#include "particle/ParticleManager.h"
namespace actions {
namespace types {
class ParticleEffectAction : public Action {
public:
using ValueType = SCP_string;
static flagset<ProgramContextFlags> getRequiredExecutionContextFlags();
explicit ParticleEffectAction(expression::TypedActionExpression<ValueType> effectExpression);
~ParticleEffectAction() override;
ActionResult execute(ProgramLocals& locals) const override;
std::unique_ptr<Action> clone() const override;
private:
expression::TypedActionExpression<ValueType> m_effectExpression;
};
} // namespace types
} // namespace actions
+65
View File
@@ -0,0 +1,65 @@
//
//
#include "PlaySoundAction.h"
#include "ship/ship.h"
#include <utility>
namespace actions {
namespace types {
flagset<ProgramContextFlags> PlaySoundAction::getRequiredExecutionContextFlags()
{
return flagset<ProgramContextFlags>{ProgramContextFlags::HasObject};
}
PlaySoundAction::PlaySoundAction(expression::TypedActionExpression<ValueType> soundIdExpression)
: m_soundIdExpression(std::move(soundIdExpression))
{
}
PlaySoundAction::~PlaySoundAction() = default;
ActionResult PlaySoundAction::execute(ProgramLocals& locals) const
{
vec3d local_pos;
matrix local_orient;
if (locals.hostSubobject != -1) {
auto instance = object_get_model_instance(locals.host.objp);
Assertion(instance != -1, "Model instances are required if a host subobject is specified.");
auto pmi = model_get_instance(instance);
auto pm = model_get(pmi->model_num);
model_instance_local_to_global_point_orient(&local_pos,
&local_orient,
&locals.localPosition,
&locals.localOrient,
pm,
pmi,
locals.hostSubobject);
} else {
local_pos = locals.localPosition;
local_orient = locals.localOrient;
}
local_pos += locals.variables.getValue({"locals", "position"}).getVector();
vec3d global_pos;
vm_vec_unrotate(&global_pos, &local_pos, &locals.host.objp->orient);
global_pos += locals.host.objp->pos;
const auto soundId = gamesnd_get_by_name(m_soundIdExpression.execute(locals.variables).c_str());
// Sound is not attached to the host but the object sound system currently only supports persistent sounds
snd_play_3d(gamesnd_get_game_sound(soundId), &global_pos, &Eye_position);
return ActionResult::Finished;
}
std::unique_ptr<Action> PlaySoundAction::clone() const
{
return std::unique_ptr<Action>(new PlaySoundAction(*this));
}
} // namespace types
} // namespace actions
Loaded 100 of 1859 files, more files were not shown because too many files have changed in this diff. Show more