Compare commits

...
4843 Commits
Author SHA1 Message Date
SirKnightly 017c502894 Automated build commit 2022-08-06 23:23:14 +00: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
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
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
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
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 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 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 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
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
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
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 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 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
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
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
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
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
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
JohnAFernandez 7cf2832113 Merge pull request #4389 from JohnAFernandez/Remove-pointless-Asserts
Remove a pointless assert
2022-06-11 23:08:46 -04: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
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
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
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
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
EatThePath 13db223f03 Merge branch 'master' into debug-viz-sphere 2022-06-03 14:51:16 -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
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
David Gibson dc31a9f663 Corrected copy and paste error in light profile value setting 2022-05-22 10:14:34 -05: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
Taylor Richards 5e79021da3 use SCP_string for constructing multi/event log lines (#4284) 2022-05-18 13:56:37 -04: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
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 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
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
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
Goober5000 4c948569c8 address feedback 2022-05-03 22:22:25 -04: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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
Goober5000 bdccb25b6e Merge pull request #3083 from Baezon/comment-delta-ang
Improve comment on vm_vec_delta_ang
2021-01-04 23:06:27 -05:00
Goober5000 6a049cc7f1 Merge pull request #3082 from JohnAFernandez/Update-Submodel-Comments
Update Comments for #548
2021-01-04 22:18:04 -05:00
JohnAFernandez 7a0578a797 Ok CI, I'll use nullptr 2021-01-04 22:14:36 -05:00
m!m 9879ef4abd Merge pull request #2388 from h3xx/fix-ccache-usage
Use CMAKE_*_COMPILER_LAUNCHER to run ccache
2021-01-04 19:18:29 +01:00
Dan Church fec72db558 Use CMAKE_*_COMPILER_LAUNCHER to run ccache
This is the recommended way to set this up.

Using this technique allows the user to replace the launcher with any
number of combinations of solutions such as
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache:distcc

Supported since CMake 3.4. On previous versions of CMake, it will just
ignore this setting.
2021-01-04 11:46:34 -06:00
Baezon fc7e1f0e40 improve comment on delta_ang 2021-01-03 22:51:17 -05:00
JohnAFernandez ecf2dfb8f9 Update Comments for #548 2021-01-03 22:28:18 -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 39abec6dfb Merge pull request #3077 from Goober5000/fix_model_instance
fix model_update_instance to handle LODs
2021-01-02 15:03:55 -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
Goober5000 b0fbf93055 fix model_update_instance to handle LODs
Add back the copying of model instance information to submodels in other LODs.  This was inadvertently removed in commit 88c1d8a02a.
2021-01-02 14:26:59 -05:00
Goober5000 2d942989e6 Merge pull request #3075 from JohnAFernandez/Fixing-Small-Fred-Mission_Save-Bug
Keep fred from adding extra texture replacements to mission file
2021-01-02 02:47:35 -05:00
JohnAFernandez 47dd186796 Standardize my ! 2021-01-02 02:11:40 -05:00
Goober5000 1fcfa82184 Merge pull request #3072 from JohnAFernandez/Add-Starting-Amoo-to-Scripting-Functions
Make sure that scripting changes the starting ammo as well as the weapon
2021-01-02 02:09:27 -05:00
Goober5000 6fc3d3cafe Merge pull request #3074 from Goober5000/fix_arc_type
fix a couple of issues
2021-01-02 01:52:35 -05:00
JohnAFernandez c7ea110652 Remove whitespace change 2021-01-02 01:41:15 -05:00
JohnAFernandez 8a81b18200 Keep fred from adding extra texture replacements to mission file 2021-01-02 01:37:37 -05:00
Goober5000 4182ea7fae fix a couple of issues
Prevent model instances from being overridden when they conflict with the model.  Fixes #3062.

Also fixes another spot that might be a problem.
2021-01-02 01:08:54 -05:00
z64555 bc8e16b37b Address change requst. 2021-01-01 22:41:43 -06:00
JohnAFernandez 04f668651b Make sure that scripting changes the starting ammo as well as the weapon 2021-01-01 22:22:56 -05:00
z64555 79e4c9b4e3 Satisfy change requests 2021-01-01 19:14:20 -06:00
m!m 71576c7784 Merge pull request #3066 from asarium/fix/releaseDebugUpload
Fix release debug file name
2021-01-01 15:59:16 +01:00
asarium 619e19268b Fix debug file name 2021-01-01 15:20:19 +01:00
m!m b372fb3655 Merge pull request #3065 from asarium/fix/modTableTestVersion
Increase test engine version to fix 21.0 tests
2021-01-01 13:28:07 +01:00
asarium ae7ac6d87d Increase test engine version to fix 21.0 tests
I just tried building 21.0 which is a higher version than the one used
in the test data which broke this test.

This should be a high enough version to not break any time soon...
2021-01-01 13:02:02 +01: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
m!m e1a2fe0313 Merge pull request #3059 from JohnAFernandez/Fix-Missile-Capacity-Bug
Fix the support ship refilling ships to the wrong secondary capacity
2020-12-31 12:04:31 +01:00
JohnAFernandez 521430fb9a Fix the support ship refilling ships to the wrong secondary capacity 2020-12-30 23:37:49 -05:00
Goober5000 3108b2f117 Merge pull request #3058 from Goober5000/weaponspew_fixes
weaponspew fixes
2020-12-30 11:02:00 -05:00
JohnAFernandez a764b3463c Warn the User About a Probable Incoming crash (#3011)
If SDL completely fails to get its preference path, at least warn the user so that it doesn't crash straight to the desktop without creating a debug build.
2020-12-30 10:37:58 -05:00
Goober5000 cb4f6f5250 Merge pull request #3057 from Goober5000/minor_model_fixes
some bugfixes from the submodel rotation branch
2020-12-30 01:12:00 -05:00
Goober5000 9f8fe77956 weaponspew fixes
Add calculations for the `puncture` flag, and handle beam damage factors appropriately.

Fixes #3044.
2020-12-30 01:10:31 -05:00
Goober5000 cda9967d9c add vecmat function 2020-12-30 00:35:22 -05:00
Goober5000 7a09a3d0c4 some bugfixes from the submodel rotation branch
Some things that clang noticed, plus a small usability improvement to the parsing of vectors in submodel properties.
2020-12-30 00:31:58 -05:00
m!m 839d3517b3 Merge pull request #3040 from asarium/test/ciTestBuilds
Add GitHub actions test build support
2020-12-29 09:56:40 +01:00
asarium a6b90a3780 Add GitHub actions test build support 2020-12-28 21:43:48 +01:00
m!m 05a778e542 Merge pull request #3037 from asarium/ci/uploadDebug
Also upload debug symbols to GitHub release
2020-12-28 21:08:26 +01:00
JohnAFernandez 573db31ba5 Set target name in ai goals to avoid an assert (#3041) 2020-12-28 15:04:47 -05:00
m!m 2727880fae Merge pull request #3039 from asarium/fix/2928
Apply particle source hack to correct vector
2020-12-28 20:21:17 +01:00
asarium 92e5f2f35d Apply particle source hack to correct vector
In the particle effect code there is a small hack required for getting
some constant pointers in a vector. However, there is another mechanism
where sources are not added to the sources vector if the sources are
currently being iterated through. That is necessary to avoid
accidentally invalidating the iterators.

The issue here was that the vector resizing hack was not applied to the
correct vector when we were currently iterating. This fixes that.

This fixes #2928.
2020-12-28 17:58:20 +01:00
m!m f4c11a42ec Merge pull request #3038 from SelfGamer/fix_ctd_on_death_with_support
Fix CTD on death while support is trying to dock
2020-12-28 14:46:36 +01:00
Birk Magnussen 4bc3ac8bee More Assertions 2 2020-12-28 19:34:30 +09:00
Birk Magnussen 5b12b84c57 More Assertions 2020-12-28 19:32:05 +09:00
Birk Magnussen f6b8e8e0ff nulltpr 2020-12-28 19:18:58 +09:00
Birk Magnussen 66aed78dd4 Add quickfix 2020-12-28 19:16:38 +09:00
Fabian Woltermann a5de6f8570 Merge pull request #3019 from SelfGamer/exactlos_update
Changed require exact los to track from the exact firing point instead of center
2020-12-28 10:16:40 +01:00
asarium fc744c78c7 Also upload debug symbols to GitHub release 2020-12-28 10:03:21 +01:00
m!m bc6b341eea Merge pull request #3036 from Goober5000/vec3d_props_dox
add documentation to get_user_vec3d_value
2020-12-28 09:53:33 +01:00
Goober5000 55b902382c add documentation 2020-12-28 01:19:44 -05:00
Goober5000 3a5e49b0c3 Merge pull request #3021 from Goober5000/turret_refactor
some refactor and cleanup
2020-12-27 09:33:49 -05:00
Goober5000 aef21cbe1b Merge pull request #3025 from JohnAFernandez/fix-nullptrs-in-turret-packet
Prevent Fire_turret from using null values
2020-12-27 09:16:13 -05:00
Goober5000 a3a26c781c Merge pull request #3035 from asarium/fix/luaDeprecationVersion
Update deprecation version of drawMonochromeImage
2020-12-27 09:15:14 -05:00
m!m aa222c4206 Merge pull request #3029 from JohnAFernandez/bypass-multi-when-using-start_mission
Keep incompatible commandline options from running simultaneously
2020-12-27 11:58:46 +01:00
asarium 57f73ab8dc Update deprecation version of drawMonochromeImage
This was 20.1 since I erronously thought that the "current" nightly
version was lower than that. This updates the version to a release that
has not been built yet.
2020-12-27 11:53:10 +01:00
JohnAFernandez d41d397e33 Keep nullptrs from crashing the fire flak packet. 2020-12-27 01:36:10 -05:00
JohnAFernandez b8e9b3c0ec Prevent Fire_turret from using null values 2020-12-27 01:36:10 -05:00
JohnAFernandez f088e12cb3 Keep incompatible commandline options from running simultaneously 2020-12-27 01:03:36 -05:00
Goober5000 7990691e83 Merge pull request #3026 from MageKing17/bugfix/capital-plus-secondary-regression
Fix capital+ regression in AI code for secondary weapon selection.
2020-12-26 20:53:42 -05:00
MageKing17 ac86dbae2f Fix capital+ regression in AI code for secondary weapon selection.
When weapon info flags were changed to the flagset model in #851 (commit 127976cd74), two instances where `WIF2_CAPITAL_PLUS` was either actively desired or passively not prohibited were lost in the transition; this commit restores looking for `Weapon::Info_Flags::Capital_plus` when targeting a big ship, and no longer prohibits capital+ weapons from being selected if a bomber+ weapon is sought and smart secondary weapon selection is enabled.
2020-12-26 12:45:32 -08:00
JohnAFernandez 7ac832f84f Merge pull request #3022 from asarium/fix/betterRand
Make model point picking more flexible
2020-12-25 11:20:13 -05:00
asarium 522fa1ac6a Make model point picking more flexible
This works around the Windows only limitation where the standard random
function only returns up to 2^15 which limits how many vertices in the
model can be picked.

Since we already have a function that handles this properly and returns
values in the entire integer range, using that fixes that low limit.
2020-12-25 15:36:25 +01:00
Goober5000 21f6591be2 some refactor and cleanup
1) modify and prune some turret function definitions
2) clean up KeldorKatarn's submodel orientation parsing
2020-12-24 22:50:49 -05:00
Birk Magnussen d1e1d79bca make require exact los respected by primaries 2020-12-25 04:20:03 +09:00
Birk Magnussen f0313fc68a Fix bad assertion 2020-12-25 03:19:47 +09:00
JohnAFernandez de7d0c79d3 Merge pull request #2214 from notimaginative/multi_packet_fixes
Multi packet fixes
2020-12-24 12:16:29 -05:00
Birk Magnussen 32c63963ea Changed require exact los to track from the exact firing point instead of center 2020-12-25 00:49:09 +09:00
m!m 77adaa6d86 Merge pull request #3004 from asarium/scripting/monochromeUv
Add AA bitmap support for standard gr.drawImage
2020-12-24 16:14:44 +01:00
m!m 92d1328e0f Merge pull request #3010 from asarium/lua/cmdBriefColors
Add scripting API to access briefing color tags
2020-12-24 16:10:50 +01:00
Taylor Richards 5f7b7ef702 fix issues discovered during beam test
- fix incorrect assertions for fighter beams
 - fix subsystem handling for spawned/floating beams
2020-12-24 09:45:17 -05:00
Taylor Richards 80d68ccc27 address issues raised during code review 2020-12-24 09:45:17 -05:00
Taylor Richards fdf3778014 bump multi version to 53 2020-12-24 09:45:17 -05:00
Taylor Richards ff5cb3cdf8 update turret_fired_packet() and flak_fired_packet()
- send pitch and heading as floats
 - use proper weapon id rather than guessing (fixes #2877)
2020-12-24 09:45:07 -05:00
Taylor Richards 5d410416c9 fix issues with client_update_packet()
- use correct macro for player_id
 - support more subsystems
 - optimize size of secondary weapon info
 - handle future compatibility issues with secondary ammo
2020-12-24 09:42:05 -05:00
Taylor Richards 5395cabdb3 support larger number of subsystems in various packets
secondary_fired_packet()
 turret_fired_packet()
 player_order_packet()
 homing_weapon_info()
 flak_fired_packet()
2020-12-24 09:41:59 -05:00
Taylor Richards 3a58940d35 update multi_capaign_*() packets
- add additional safety checks
 - allow for USHRT_MAX ship and weapon types
 - allow for USHRT_MAX mission events
 - optimize storage of mission count/num (int -> ubyte)
 - break campaign mission names into nice sized packets
2020-12-24 09:38:23 -05:00
Taylor Richards da37e363ae fix comparison warnings in ADD/GET macros with debug builds 2020-12-24 09:38:23 -05:00
Taylor Richards 0e55c36877 update netgame_descript_packet()
(based on PR 2109 by Cyborg17)

 - support compaign descriptions (Mantis 1826)
 - allow sending multiple packets to get entire description
 - update description of selected game on join screen if needed
2020-12-24 09:38:23 -05:00
Taylor Richards 9b97821616 optimize sexp_packet()
- chnage op count data type to short
   (can't have more space than that anyway)
 - get rid of some loops in favor of plain memcpy()
 - fewer magic numbers
 - use SEXP_MAX_PACKET_SIZE to fix packet size discrepancy
2020-12-24 09:38:23 -05:00
Taylor Richards 42cdd06b7d add ADD/GET_DATA_BLOCK() macros
These macros will grab a known sized block of data without
any manipulation. Should only be used with data which is
serialized/deserialized in another part of the code.
2020-12-24 09:38:23 -05:00
Taylor Richards 088f4422db set HEADER_LENGTH to a fixed size
This should *never* be something that can be changed
at runtime
2020-12-24 09:38:23 -05:00
Taylor Richards f989cf2c3a update beam_fired_packet()
- add bfi_flags
 - add proper bank/point data for fighters
 - allow for more than 255 subsystems
 - add data for targeted subsystem
 - add support for TARGETING_COORDS flag
 - add support for FLOATING_BEAM flag
 - add fire method
 - add initial packet support for type F beams
2020-12-24 09:38:23 -05:00
Taylor Richards dc1128d327 fix issues with wss_slots_data_packet()
- don't depend on hard-coded limits
 - store weapon and counts together
 - fix incorrect ship_class assignment
2020-12-24 09:38:23 -05:00
Taylor Richards 88e8d61816 optimize size of wss_update_packet() 2020-12-24 09:38:23 -05:00
Taylor Richards 97c4bcba61 support SHRT_MAX ship types in pslot_update_packet 2020-12-24 09:38:23 -05:00
Taylor Richards c4eecf9a0d fix multiple issues with wss data packet
- use standard ADD/GET macros
 - better detection of size issues
 - support SHRT_MAX ship types
 - support SHRT_MAX weapon types
 - use MAX_WSS_SLOTS & MAX_SHIP_WEAPONS safely
 - support sound indexes higher than 254
2020-12-24 09:38:23 -05:00
Taylor Richards 3de39b6274 tweak stats block packet to handle certain limits better 2020-12-24 09:38:23 -05:00
Taylor Richards a48b5e8203 scale MAX_SHIPS_PER_PACKET with packet size 2020-12-24 09:38:23 -05:00
Taylor Richards e91234cac0 remove network cutoff when more than retail ship limit
It's fixed now, so no reason to keep this
2020-12-24 09:38:23 -05:00
Taylor Richards 43a1952142 allow SHRT_MAX ship types in wss_slots_data_packet() 2020-12-24 09:38:23 -05:00
Taylor Richards af45954bab fix issues with post_sync_data_packet()
- allow for SHRT_MAX ship types
 - support total number of primary weapon banks
 - support total number of secondary weapon banks
2020-12-24 09:38:23 -05:00
Taylor Richards 796609b851 optimize size of player_settings_packet() 2020-12-24 09:38:23 -05:00
Taylor Richards 495efde52f optimize size of netplayer_slot_packet() 2020-12-24 09:38:23 -05:00
Taylor Richards 67d17e2c28 optimize size of ship_create_packet() 2020-12-24 09:38:23 -05:00
Taylor Richards 5fb1bbbb43 fix issues with multi options packets
- don't send structs
 - big endian compatible
2020-12-24 09:38:23 -05:00
Taylor Richards 8e40c14a49 optimize size of several player packets
player num/index should always be in 0-11 range
so only 1 byte is required
2020-12-24 09:38:23 -05:00
Taylor Richards 69fd25b376 optimize size of game_chat_packet()
server_msg is 0-2, which doesn't need 4 bytes
2020-12-24 09:38:22 -05:00
Taylor Richards 752f985433 optimize size of host_captain_change_packet()
don't need 4 bytes for a true/false
2020-12-24 09:38:22 -05:00
Taylor Richards 9e7a6eaee2 small optimization of process_game_query() 2020-12-24 09:38:22 -05:00
Taylor Richards 0a3465b4aa avoid breaking ship_status_packet() with new controls 2020-12-24 09:38:22 -05:00
Taylor Richards 454ddce232 fix join_request data
- tightly packed
 - better cross-platform compatibility
2020-12-24 09:38:22 -05:00
Taylor Richards c943600ee3 adjust *_STRING() macros to save space
- ADD/GET_STRING() will use 1-byte lengths (up to 255 chars)
 - ADD/GET_STRING_16() will use 2-byte lengths (up to 65,535 chars)
 - ADD/GET_STRING_32() added for compatiblity (game_active packet only!)
2020-12-24 09:38:22 -05:00
asarium c2f4d5f2b6 Use correct generic anim function to get hi-res support 2020-12-24 12:54:09 +01:00
asarium 4af292af5a Add scripting API to access briefing color tags 2020-12-24 12:54:09 +01:00
Goober5000 a3135497f1 Merge pull request #3015 from Goober5000/gun_rotation_fix2
move gun_submodel_rotation from model to instance
2020-12-23 18:53:17 -05:00
SelfGamer a47cfb7e7c Expose disposing FBO's to scripting (#3003)
* Expose disposing FBO's (with the option to keep the Bitmap Alive) to scripting

* Modernize nullptr

* Moved RenderTarget clearing to own public API

* Fixed Obsolete Comment

* Fix bad deletion of FBOs

* Resolve Memory Leak

* Change FBO cleanup to not reuse old ID's

* FIx oversight

* FIx oversight 2
2020-12-23 21:54:03 +01:00
m!m 4f4e02beb5 Merge pull request #3018 from asarium/feature/captureSdlLogs
Capture SDL logs to our standard logging output
2020-12-23 21:53:22 +01:00
m!m 55e502417a Merge pull request #3017 from asarium/ci/fixClangTidyDiff
Fix clang tidy commit range
2020-12-23 21:53:06 +01:00
asarium 0f220d2ecf Capture SDL logs to our standard logging output
This can be useful when SDL produces log output that helps with
debugging an issue.
2020-12-23 14:03:24 +01:00
asarium 2f24a131c7 Fix shell script 2020-12-23 12:07:43 +01:00
asarium c9dc17cb79 Fix workflow names 2020-12-23 11:43:01 +01:00
asarium fa7994f691 Fix clang tidy commit range
By only looking at the HEADs of the respective branches, we included
irrelevant changes in the diff passed to clang-tidy-diff so it was
possible to generate irrelevant warnings in a PR.
2020-12-23 11:39:30 +01:00
Goober5000 4b200586e6 Merge pull request #3014 from Goober5000/fix_3013
properly restore turret angles after calculating matrix
2020-12-23 02:34:57 -05:00
Goober5000 8ef92c944d move gun_submodel_rotation from model to instance
Since instance-specific fields have been moved to polymodel_instance and submodel_instance, the gun_submodel_rotation field should also be moved.  This is also reworked a bit to keeping track of the rotation via the normal submodel instance angles.

This removes an unnecessary look_at field as well.
2020-12-23 00:45:31 -05:00
Goober5000 78c957c6bb properly restore turret angles after calculating matrix
Since angles are no longer written in three redundant places, the temporary hijacking of the turret angles in `model_make_turret_matrix` was overwriting the turret's proper position.  So this PR just saves the angles and restores them when the calculation is done.
2020-12-22 22:14:12 -05:00
Goober5000 66280ee4d1 Merge pull request #3012 from Goober5000/submodel_null_check
additional null checks
2020-12-22 21:32:15 -05:00
Goober5000 b7b0d3a257 Merge pull request #3000 from Goober5000/model_instance_followup
another model to model_instance refactor
2020-12-22 21:31:14 -05:00
Goober5000 8cf900b6ad additional null checks
Some subsystem code was being run for submodels when the subsystem didn't necessarily have a submodel attached.
2020-12-22 15:28:44 -05:00
Goober5000 3ef527a04d Merge pull request #2988 from z64555/fix/issue_2966
In windows, attach to the console we're being evoked from and reopen STDIO streams.
2020-12-22 14:24:58 -05:00
Goober5000 6f8a297cf1 Merge pull request #3008 from Goober5000/submodel_bugfix
additional null checks
2020-12-22 14:24:22 -05:00
m!m 04135df1bf Merge pull request #3009 from asarium/ci/fixFtpWildcard
Fix nightly build FTP wildcard
2020-12-22 12:36:19 +01:00
Goober5000 0c5b04c427 additional null checks
Found a null pointer CTD in modelanim that slipped through initial testing.  Also added some defense-in-depth null checks to scripting.
2020-12-22 04:22:10 -05:00
asarium ec79fdea68 Fix nightly build FTP wildcard 2020-12-22 10:09:52 +01:00
JohnAFernandez 508b420f07 Set correct time stamp for already-locked indicators. (#3002) 2020-12-21 09:07:05 -05:00
asarium f25d98cebd Add AA bitmap support for standard gr.drawImage
Since that function already has full support for UV scaling it makes
sense to unify the behavior in one function instead of having a separate
monochrome function that does weird things.

Also deprecates that function since all its use cases are now covered by
drawImage.
2020-12-21 12:48:58 +01:00
m!m 4b7013ff86 Merge pull request #3001 from asarium/ci/githubReleaseBuilds
Add GitHub workflow for building releases
2020-12-21 10:20:42 +01:00
z64555 ea97272613 In windows, attach to the console we're being evoked from and reopen STDIO streams. 2020-12-20 18:19:12 -06:00
asarium 10d7417815 Add GitHub workflow for building releases
This uses GitHub actions for building Linux and Windows builds for
release tags.

Appveyor is now no longer used for building distribution packages and is
also not used for anything relevant anymore. If this works properly we
can disable that PR check to get better PR scalability.
2020-12-20 22:33:14 +01:00
m!m ded3131587 Merge pull request #2999 from asarium/build/extractBuildScripts
Extract build scripts into separate files
2020-12-20 22:30:21 +01:00
Goober5000 fe4661ec9f Merge pull request #2997 from SelfGamer/missionAwarenessAPI
Add Scripting API isNebula and isSubspace
2020-12-20 14:53:15 -05:00
Goober5000 c18b1b63fd another model to model_instance refactor
Remove arc information from bsp_info and move it to submodel_instance.  Add a model instance to each debris chunk to keep track of it.
2020-12-20 14:51:05 -05:00
Goober5000 bcf4b07a28 Merge pull request #2992 from Goober5000/model_instance_consolidation
consolidate model instance code
2020-12-20 13:23:14 -05:00
asarium 9fb47d22b5 Extract build scripts into separate files
This makes the workflows easier to manage, makes those build steps
reusable, and allows for easier migration to other CI services should
that be required at some point.
2020-12-20 18:26:05 +01:00
Fabian Woltermann c7c5592884 Merge pull request #2998 from The-E/fix/pof_name_in_lab
Fix oversight in the new lab HUD
2020-12-20 16:59:53 +01:00
Fabian Woltermann c2a76c7354 Print the model filename in the bottom right when a ship or modelled weapon is being displayed in the lab 2020-12-20 13:39:29 +01:00
Birk Magnussen dfe6858b21 Fix Type 2020-12-20 21:14:30 +09:00
Birk Magnussen 64b35534de Modernize functions 2020-12-20 21:03:05 +09:00
Birk Magnussen ce614d330d Modernize nullptr 2020-12-20 20:46:22 +09:00
Birk Magnussen 20bc769daa Add Scripting API isNebula and isSubspace 2020-12-20 20:17:34 +09:00
Goober5000 efe2d8476a 1) it's no longer necessary to call model_clear_instance before collision detection
2) call appropriate functions in collision detection because models might have instances
2020-12-18 13:46:49 -05:00
m!m 486d66ad28 Merge pull request #2993 from asarium/build/fixUploadGlob
Fix upload glob
2020-12-18 18:59:17 +01:00
asarium f10c40f873 Fix upload glob
The glob pattern was not correct. This should fix the nightly build
again.
2020-12-18 16:53:23 +01:00
Goober5000 88c1d8a02a consolidate model instance code 2020-12-18 01:32:43 -05:00
Goober5000 d80c43d6d9 Merge pull request #2989 from Goober5000/lab_destroy_subsystem
subobjects destroyed in the lab should stop spinning
2020-12-18 01:07:18 -05:00
Goober5000 d6e95360e0 subobject destroyed in the lab should stop spinning
The lab code didn't set subsystem strength for destroyed submodels.  This fixes that.
2020-12-17 20:10:38 -05:00
m!m 636aa35d7c Merge pull request #2987 from asarium/build/windowsBuilds
Build Windows nightlies with GitHub actions
2020-12-17 21:54:13 +01:00
asarium cdeac0c762 Build Windows nightlies with GitHub actions
This is much faster since all build variations can be compiled at the
same time. Only applies to nightly builds for now.
2020-12-17 18:28:10 +01:00
m!m e7a5492061 Merge pull request #2977 from asarium/build/datacoderUpload
Enable upload to datacorder for Linux builds
2020-12-17 09:30:03 +01:00
Baezon c65ae50b81 version 1 of generic debris enhancements 2020-12-17 01:58:00 -05:00
Goober5000 4491b842c9 Merge pull request #2983 from Goober5000/header_refactoring
hoist model_get and model_get_instance out of a bunch of functions
2020-12-16 15:33:29 -05:00
m!m f2a8295399 Merge pull request #2982 from asarium/build/clangTidyGithub
Use special GitHub action for clang-tidy
2020-12-16 19:11:04 +01:00
Goober5000 7c92dd9f7c hoist model_get and model_get_instance out of a bunch of functions 2020-12-16 11:55:31 -05:00
Goober5000 5fe8f00cb3 Merge pull request #2985 from Goober5000/turret_fix
fix a bit of improper referencing in rotateTurret
2020-12-16 11:43:19 -05:00
Goober5000 41851bbd1e fix a bit of improper referencing in rotateTurret
The object `instance` field is the index into Ships, not Objects.  In any case, position and orientation can be referenced directly.
2020-12-16 02:23:18 -05:00
Goober5000 ada08157a8 Merge pull request #2984 from Goober5000/fix_lab_crash
fix a CTD with the no-pain-flash flag
2020-12-15 22:03:07 -05:00
Goober5000 c457f24d67 fix two more crashes 2020-12-15 19:46:12 -05:00
Goober5000 4ddc2565d5 fix a CTD with the no-pain-flash flag
There were null checks for `Player_obj`, but whoever added the `No_pain_flash` flag bypassed them by dereferencing `Player_obj` in the top-level if() block.  This caused a crash when self-destructing ships in the F3 lab.

This PR moves the `Player_obj` check to the top-level block (which is also an implicit null check because `ship_objp` is not null by this point) which fixes the crash and also is more efficient.
2020-12-15 19:16:42 -05:00
asarium 8319940f92 Use special GitHub action for clang-tidy
This action should bring the clang-tidy issues in a better format by
displaying them inline in the diff.
2020-12-15 20:08:16 +01: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
asarium 92cd894de2 Enable upload to datacorder for Linux builds
Also run distribution builds in container. This uses the same container
for building PRs and distribution packages to ensure consistency
between them.

Also tries to fix an issue with a missing environment variable for the
tests.
2020-12-13 22:14:36 +01:00
m!m 3d792dcb1d Merge pull request #2978 from asarium/build/ghActions/clangTidy
Add clang-tidy checking to GitHub actions
2020-12-13 22:12:04 +01:00
m!m 53b73ca048 Merge pull request #2979 from Baezon/multilock-fix-los
Fix line-of-sight checking for multilock
2020-12-13 14:00:03 +01:00
Baezon 602dd45c10 fix los for multilock 2020-12-13 00:03:43 -05:00
asarium 451eab5b38 Add clang-tidy checking to GitHub actions
This just introduces the previously Travis integration and moves it to
GitHub actions.

This also found various issues around our libc++ support so I fixed that
as well.
2020-12-12 22:11:35 +01: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
Goober5000 ca7dda09b0 Merge pull request #2971 from Goober5000/model_preliminary_edits
Model preliminary edits
2020-12-10 15:06:48 -05:00
m!m aec33b2bd8 Merge pull request #2976 from asarium/build/linuxContainer
Use container for Linux building
2020-12-10 12:21:56 +01:00
m!m 36900f056f Merge pull request #2975 from asarium/build/githubRelease
Build Linux nightlies with GitHub actions
2020-12-09 20:19:06 +01:00
asarium c644ccba98 Use container for Linux building
This will make our builds independent of the underlying system and allow
for more reproducible builds since everything uses the same compilers
and environments.
2020-12-09 20:10:22 +01:00
asarium 22d8184ad2 Build Linux nightlies with GitHub actions
This creates a new workflow which will build linux binaries for
FastDebug and Release, combine them in a second step, and then upload
them.
2020-12-09 18:19:43 +01:00
Taylor Richards c5356c6af7 Merge pull request #2895 from notimaginative/mdns
Replace multicast code with mDNS/DNS-SD
2020-12-08 20:32:28 -05:00
JohnAFernandez f9e0ff5db6 Make sure lock indicators are done even if hud is disabled (#2970)
Someone already did the work.  Just making sure this function always runs even if the hud is diabled. (it just makes sense to)
2020-12-08 20:29:16 -05:00
Goober5000 b40833d76e CI fixes 2020-12-08 19:54:31 -05:00
Goober5000 b803b9f15c consolidate functions 2020-12-08 19:54:31 -05:00
Goober5000 b90fc2b3ad numeric to boolean 2020-12-08 19:54:31 -05:00
Goober5000 f0799d245e tweaks 2020-12-08 19:54:24 -05:00
Goober5000 f54ac8fc22 Merge pull request #2972 from SelfGamer/master
When Fullscreen, dialogs have no parent now. Should fix #2949
2020-12-08 16:36:21 -05:00
JohnAFernandez c98dd53c76 Fix fred control crash (#2969)
* Keep ships that we are centered on from moving

This prevents NAN from appearing from obscure vector math somewhere in the depths of fred.

* Also fix movement of centered objects in qtFRED
2020-12-08 16:26:29 -05:00
Birk Magnussen 6a68300fcc Moved Dialog Parent Window detection to function + small explanation 2020-12-09 04:13:36 +09:00
Birk Magnussen 21eefe5133 When Fullscreen, dialogs have no parent now. Should fix #2949 2020-12-09 03:34:01 +09:00
Goober5000 3fdc5a3784 cur_turn_rate -> current_turn_rate 2020-12-08 12:33:29 -05:00
JohnAFernandez 20ffa59a31 Merge pull request #2965 from Baezon/beam-init-width-fix
Fix an assert with 0 initial beam width
2020-12-08 00:59:58 -05:00
Baezon be76cd727a implement turret-forced-target 2020-12-08 00:07:23 -05:00
Goober5000 9b2f924109 Merge pull request #2967 from z64555/fix/issue_2960
Save fade-out color, even if its black.
2020-12-07 22:18:51 -05:00
z64555 761f50989e Partially revert refactoring.
*  Can't simply use the previous fade_out color as the default, because of an edge-case with legacy usage.  The refactor would disallow setting the fadout to black.
2020-12-07 17:07:17 -06:00
Goober5000 fa0043f93b Merge pull request #2962 from SelfGamer/master
Add flag for AI to only fire Turrets / Secondaries when having clear Line of Sight
2020-12-07 17:47:32 -05:00
z64555 464c867bb5 Save fade-out color, even if its black.
Refactor sexp_fade, and make the Fade_out color init to black on mission load, instead of init on game start.
2020-12-07 16:33:29 -06:00
Goober5000 8c27d60f0a Merge pull request #2957 from SelfGamer/fireball-scripting
Adds Fireball as a new Object Subclass to scripting
2020-12-07 16:43:41 -05:00
Baezon 663a070f06 no 0 initial width 2020-12-07 02:21:59 -05:00
Birk Magnussen 1e5652ea07 Adapt change requests by Goober for Fireballclass 2020-12-07 07:04:09 +09:00
Goober5000 a6f5f4c09c Merge pull request #2959 from Goober5000/some_turret_fixes
some fixes to aiturret code
2020-12-06 08:57:42 -05:00
Birk Magnussen 08fee6f807 Added more lua erros for bad warp effects 2020-12-06 20:48:49 +09:00
Birk Magnussen 16c4097992 Added error when using too short duration for warp effect 2020-12-06 20:42:19 +09:00
Birk Magnussen ccb6e52475 Simplify Early Out calculation for LoS calculation 2020-12-06 17:34:22 +09:00
Goober5000 bfb7631ad5 Merge pull request #2955 from PhantomHoover/feature/default-fit
Turn framerate-independent turning on by default
2020-12-05 22:44:18 -05:00
Goober5000 0dd12473a4 address feedback 2020-12-05 22:40:51 -05:00
Birk Magnussen 18d17b18e0 Added earlier outs for los detection 2020-12-06 11:08:02 +09:00
Birk Magnussen f10fd36706 Modernized function, iterate over used objects instead of all 2020-12-06 06:47:44 +09:00
Birk Magnussen d4e9958f0f Tidy Code. Add AI Flag for firing requires exact los 2020-12-06 05:48:17 +09:00
Birk Magnussen d72ea2c213 Add require exact los weapon flag 2020-12-06 04:05:40 +09:00
Goober5000 ed7eddc873 comment 2020-12-05 13:54:43 -05:00
Goober5000 c0e5d810be fix flak not jittering if it had the fire-down-normals flag 2020-12-05 13:43:41 -05:00
Birk Magnussen 042cd0682d Fixed Warning due to unused variable 2020-12-05 08:48:45 +09:00
Birk Magnussen 2fa8d1e23b Fixed Error in createWarpeffect, added createExplosion 2020-12-05 08:32:04 +09:00
Birk Magnussen 67ebbddb09 Added Fireball lua API + added createWarpeffect 2020-12-05 07:23:14 +09:00
Goober5000 e0bbdf5d17 Merge pull request #2954 from SelfGamer/master
Modified Ship-Ship Collision Overrides to fit other Ship-X collision Overrides
2020-12-04 15:28:08 -05:00
Phantom Hoover 83df3a003c Turn framerate-independent turning on by default 2020-12-04 17:38:09 +00:00
Goober5000 62a66a0e20 patch player sound issue; adjust code comment and variable scope 2020-12-03 21:19:57 -05:00
Goober5000 0ad267a6dd remove superfluous function 2020-12-03 21:19:57 -05:00
Goober5000 7eb18dddca clean up the second half, and remove an unused field 2020-12-03 21:19:53 -05:00
Goober5000 54343a0eee clean up the top half of ai_fire_from_turret 2020-12-03 21:18:16 -05:00
Birk Magnussen effe18c629 Added Comments to indicate moved code block for ship-ship collision override change 2020-12-04 10:40:08 +09:00
Goober5000 ec06843ac5 Merge pull request #2950 from Baezon/fire-down-normal-fix
Allow normal weapons to use 'fire down normals'
2020-12-03 19:30:21 -05:00
Birk Magnussen 90b4079746 Remove now unused parameter from ship_ship_check_collision due to warning 2020-12-04 08:07:45 +09:00
Birk Magnussen 3268e1d49b Modified Ship-Ship Collision Overrides to fit other Ship-X collision Overrides 2020-12-04 07:36:01 +09:00
Baezon e8fb55fafa shoot_vector -> pointer 2020-12-03 12:27:35 -05:00
Baezon 2d516ef3ac allow normal weapons to use 'fire down normals' 2020-12-02 20:18:24 -05:00
m!m 37ea2bdaf4 Merge pull request #2946 from SelfGamer/master
Scripting Bugfix: previous HUD set/get gauge color referred to config instead of ingame gauge
2020-12-02 18:04:53 +01:00
Goober5000 5f87f1da47 Merge pull request #2948 from MageKing17/bugfix/turret-change-weapon-4th-bank-fix
Fix turret-change-weapon comparing sec_slot to max primary banks.
2020-12-02 00:24:54 -05:00
Goober5000 8252d39bcf Merge pull request #2947 from Goober5000/short_circuiting_update
don't flush the tree when evaluating the *-argument conditionals
2020-12-02 00:24:36 -05:00
MageKing17 edcc3b7d59 Fix turret-change-weapon comparing sec_slot to max primary banks.
We should compare `sec_slot` to `MAX_SHIP_SECONDARY_BANKS`, not `MAX_SHIP_PRIMARY_BANKS`.
2020-12-01 18:36:02 -08:00
Goober5000 958237f95c don't flush the tree when evaluating the *-argument conditionals
This is a follow-up to PR #2942.  Given that the short-circuiting is now explicitly skipped for node trees containing the special argument, it should no longer be necessary to flush the conditional branch of the sexp tree.  (The .cache field is already skipped for special-arg nodes.)

The sexp tree is still explicitly flushed for `every-time` and `every-time-argument`.
2020-12-01 16:31:11 -05:00
Goober5000 bd3b0fc893 Merge pull request #2938 from MageKing17/feature/first-of-sexp
Add "first-of" SEXP that behaves like "any-of" with a cap.
2020-12-01 16:22:33 -05:00
Goober5000 9261b9b5d2 Merge pull request #2942 from PhantomHoover/fix/unsound-short-circuit
Don't short circuit eval_sexp on nodes which contain the special argument.
2020-12-01 16:20:41 -05:00
Birk Magnussen 4def488a11 Fixed new HUD Scripting API Variable for Gauge Count 2020-12-02 05:35:00 +09:00
Birk Magnussen 47af4b5652 Fixed Warning in new HUD API 2020-12-02 05:30:39 +09:00
Birk Magnussen f2d013ae0d Updated HUD Scripting API Docs Again 2020-12-02 05:03:27 +09:00
Birk Magnussen a30a289f68 Updated HUD Scripting API Docs 2020-12-02 03:36:35 +09:00
Birk Magnussen dacf61cf80 Moved HUD-Scripting API changes to newe function 2020-12-02 03:34:03 +09:00
Birk Magnussen b0db9e3aea Merge branch 'master' of https://github.com/scp-fs2open/fs2open.github.com 2020-12-02 02:53:57 +09:00
Birk Magnussen 76c28ddccc Fixed HUD set Color call to use in game HUD instead of configs 2020-12-02 02:52:42 +09:00
Baezon 641cf48073 implement damage incidence angle 2020-12-01 12:37:22 -05:00
Phantom Hoover 909f4e9642 Don't short circuit eval_sexp on nodes which contain the special argument. 2020-11-29 20:49:12 +00:00
MageKing17 29e6aa1f17 Merge pull request #2941 from Baezon/another-copy-paste-error
Fix a small copy paste error in weapon parsing
2020-11-29 12:34:24 -08:00
Baezon 63f16b3fec fix a copy paste error 2020-11-28 20:38:25 -05:00
MageKing17 017bef3721 Merge pull request #2903 from JohnAFernandez/Adjust-timestamp-warning
Slightly alter when a timestamp warning is written to the log.
2020-11-28 12:02:44 -08:00
Fabian Woltermann 743bd306fe Merge pull request #2934 from PhantomHoover/fix/allow-treason-broken
Remove erroneous call to CDR.
2020-11-28 09:28:29 +01:00
Fabian Woltermann af08485286 Merge pull request #2929 from The-E/feature/expose_power_output
Expose the power output in the ship class to sexps and scripting
2020-11-28 09:27:59 +01:00
MageKing17 764b141175 Add "first-of" SEXP that behaves like "any-of" with a cap.
It takes a number as a maximum number of arguments that can be evaluated in a single call, but otherwise behaves very similarly to `any-of`; alternatively, if the number is 1, it's like an `in-sequence` that also skips arguments that don't satisfy the condition instead of just invalid ones.
2020-11-27 17:18:34 -08:00
JohnAFernandez f104bdef7e Merge pull request #2933 from asarium/fix/particleEdgeCase
Cover edge case in particle code
2020-11-27 15:05:33 -05:00
Fabian Woltermann 7be6f8adf4 Remove extraneous call to CDR 2020-11-27 19:30:13 +01:00
Phantom Hoover 2f9e64ed17 Remove erroneous call to CDR. 2020-11-27 18:14:12 +00:00
asarium 9766cc28d8 Cover edge case in particle code
There are some possibilities where we could get an expired pointer when
we create a persistent particle. This adds a check for that to avoid
crashing the engine in those case.

This is related to #2928.
2020-11-27 18:55:19 +01:00
Fabian Woltermann 0a4f9d5673 Evaluate the ship_entry correctly 2020-11-27 09:43:16 +01:00
Asteroth 20efcf04a1 Merge pull request #2924 from Baezon/big-ship-deathroll
Death roll for big ships and a death roll multiplier
2020-11-26 18:26:46 -05:00
Asteroth 93ea987a34 Merge pull request #2925 from Baezon/ship-split
Separate ship splitting explosions from propagating explosions
2020-11-26 18:26:32 -05:00
Fabian Woltermann 6423cc6001 Do not short-circuit evaluation here 2020-11-26 22:38:14 +01:00
JohnAFernandez 5e4c42426f Cleaner of Multi stats (#2918) 2020-11-26 12:13:35 -05:00
Fabian Woltermann 6f8763346c Expose the power output in the ship class to sexps and scripting 2020-11-26 16:36:19 +01:00
Goober5000 b0ef7859c8 Merge pull request #2915 from JohnAFernandez/Warn-About-Invalid-Squadron-Wings
Warn about and correct invalid squadron wings in multi
2020-11-26 00:14:51 -05:00
Baezon 1f7aca8cff cast to bool 2020-11-25 23:00:34 -05:00
Asteroth c0f7289880 Merge pull request #2927 from Baezon/no-docking-jitter
Reduce docking 'jitter'
2020-11-25 22:54:01 -05:00
JohnAFernandez 4a54370a5c Slightly alter when a timestamp warning is written to the log. 2020-11-25 22:46:53 -05:00
JohnAFernandez dcfd3aa8a9 feedback 2020-11-25 22:07:21 -05:00
Baezon a37d5f579f unused parameter 2020-11-25 17:04:01 -05:00
Baezon d367f2312b reduce docking jitter 2020-11-25 15:19:37 -05:00
Allen A. Babb 4671dbfdd5 Merge pull request #2911 from PhantomHoover/fix/dropped-hotkeys
Only save hotkeys if the player has actually added to the group, otherwise leave mission defaults in place
2020-11-24 17:46:19 -06:00
Taylor Richards 3e7fedd997 avoid doing mdns stuff in incompatible states 2020-11-24 10:06:27 -05:00
Baezon 79524e46d1 separate ship splitting explosions 2020-11-24 02:27:47 -05:00
Baezon 3fde7bb076 cat forget clone and move 2020-11-24 02:04:24 -05:00
Baezon d534c68f54 big ship death roll and deathroll multiplier 2020-11-24 00:04:29 -05:00
Goober5000 d31003afea Merge pull request #2909 from PhantomHoover/feature/tune-transfer
Add ships.tbl flags to tune most aspects of ETS behaviour
2020-11-23 13:14:34 -05:00
Goober5000 6c0d63f84a Merge pull request #2916 from Baezon/no-override-maneuver
Add 'Dont_override_old_maneuvers' flag to maneuvers
2020-11-23 13:09:32 -05:00
Phantom Hoover a4977f1a62 Only save hotkeys between missions if the player has added to them 2020-11-23 17:41:06 +00:00
Baezon 4024ff197d separate rotational and lateral maneuvers 2020-11-23 00:30:19 -05:00
Goober5000 ae9fdad600 Merge pull request #2902 from Baezon/lock-restrct-enhancements
Add IFF to missile lock restrictions, and now all missiles can use them
2020-11-22 12:49:06 -05:00
Baezon c90171d8a3 add no_override flag to maneuvers 2020-11-22 11:58:15 -05:00
Phantom Hoover 0151f1b5a8 Add ships.tbl flags to tune most aspects of ETS behaviour. 2020-11-21 23:07:21 +00:00
JohnAFernandez 515e1a2d26 Make Anti-Rubberbanding less aggressive to keep the client from showing nonsense (#2901) 2020-11-21 10:19:32 -05:00
JohnAFernandez caef2aecf0 Make sure that the oswpt object will have the correct status for an exited ship (#2913) 2020-11-21 09:57:19 -05:00
JohnAFernandez 2c43b7b506 Allow mission loading to circumvent multi Squadron bug 2020-11-21 09:54:08 -05:00
JohnAFernandez 97df2f3472 Merge pull request #2843 from Baezon/better-warp-collide
Fix some issues with warp collision
2020-11-21 01:03:32 -05:00
JohnAFernandez f61787b38a Merge pull request #2910 from notimaginative/fix_standalone_host_change
Update host pointer on standalone after host switch
2020-11-21 00:59:40 -05:00
Taylor Richards ce6c10535e address various ci warnings/errors 2020-11-21 00:57:03 -05:00
Taylor Richards cd5e1c297b replace old multicast code with mdns/dns-sd 2020-11-21 00:57:03 -05:00
Taylor Richards feadceef55 add mdns library 2020-11-21 00:57:03 -05:00
Goober5000 f8c9050da8 Merge pull request #2905 from Goober5000/weaponspew_tweak
adjust weapon calculations based on Discord analysis
2020-11-20 20:21:07 -05:00
Taylor Richards 29e9b1f109 update host pointer on standalone after host switch
fixes Mantis 1892
2020-11-20 14:43:46 -05:00
Baezon fe17aec76d no more travis wooo 2020-11-20 14:11:13 -05:00
Baezon 2dbaf53e49 no more travis wooo 2020-11-20 14:10:27 -05:00
Baezon 734314494f no more travis wooo 2020-11-20 14:07:55 -05:00
Baezon 96bd94dfa5 lock restriction enhancements 2020-11-20 12:04:03 -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 f2a367b75e NULL -> nullptr 2020-11-20 12:02:13 -05:00
Baezon 27b388eb7f a whitespace change yes really because travis hates me 2020-11-20 12:02:13 -05:00
Baezon 76a1b557b9 review tweaks and copy paste errors 2020-11-20 12:02:13 -05:00
Baezon bbd145410d big ship can exceed tabled velocity during warp too 2020-11-20 12:02:13 -05:00
Baezon 69c86c4733 more travis 2020-11-20 12:02:13 -05:00
Baezon 9959d8a671 travis 2020-11-20 12:02:13 -05:00
Baezon e203426230 missing warp_effect checks 2020-11-20 12:02:13 -05:00
Baezon 47dfdcb4c1 WHOOPS dont forget the remove your debug changes kids 2020-11-20 12:02:13 -05:00
Baezon aa8849f4e5 improved warp collision 2020-11-20 12:02:13 -05:00
Goober5000 2f38131cfd adjust weapon calculations based on Discord analysis 2020-11-19 00:37:55 -05:00
Goober5000 02a77d077d Merge pull request #2906 from Goober5000/fix_build
fix some sort of build problem in the continuous integration
2020-11-19 00:37:18 -05:00
Goober5000 ef0197971f fix some sort of build problem in the continuous integration 2020-11-18 21:11:09 -05:00
Goober5000 0f8a88bce9 Merge pull request #2904 from Baezon/fix-shock-damage-parse
Fix a bug with shockwave damage parsing
2020-11-18 18:19:40 -05:00
Goober5000 51decebf27 Merge pull request #2899 from notimaginative/fix_multi_loadout_team
Prevent loadout issues in multi due to iff changes
2020-11-18 13:55:38 -05:00
Baezon b70a28bfaa fix shockwave damage parsing 2020-11-18 13:26:18 -05:00
m!m 08297ddbb9 Merge pull request #2863 from jg18/freetype_prebuilt_for_mac
Use prebuilt FreeType library on Mac
2020-11-18 17:47:24 +01:00
Taylor Richards 22e13f88ba prevent loadout issues in multi due to iff changes 2020-11-17 04:20:16 -05:00
JohnAFernandez 383c821968 Remove the unused shield_integrity field (#2898) 2020-11-17 01:22:12 -05:00
Asteroth fd3ce9d6cd Merge pull request #2897 from Baezon/fix-lssm-trails
Update no-pspew-lssm with recent changes
2020-11-16 15:09:30 -05:00
Baezon b002cff3ee fix trail update oversight 2020-11-16 11:03:46 -05:00
Asteroth bee6c04c26 Merge pull request #2865 from Baezon/no-pspew-lssm
Some visual fixes to local ssms
2020-11-16 00:41:36 -05:00
Asteroth 0909855087 Merge pull request #2888 from Baezon/model-anim-fix
Fix a bug with model animation
2020-11-15 19:05:47 -05:00
Taylor Richards 042cb256de Merge pull request #2896 from notimaginative/fix_multi_cutscene_crash
Call common_select_init() before cutscenes where needed
2020-11-15 19:01:07 -05:00
Taylor Richards cad56bd533 call common_select_init() before cutscenes where needed
Fixes crashing in multi where ships are locked by host while a
client is on fiction viewer, command brief, red alert, or cutscene
2020-11-15 15:49:32 -05:00
Goober5000 2d291106d9 Merge pull request #2891 from Goober5000/message_sanity
don't access invalid memory if the shipnum is -1
2020-11-15 11:23:33 -05:00
JohnAFernandez 398985f97c Merge pull request #2880 from Baezon/afterburner-enhancements
Add some new afterburner options
2020-11-15 09:04:49 -05:00
JohnAFernandez 6d6f4446aa Merge pull request #2883 from Baezon/trail-spread
Add trail 'spread'
2020-11-15 09:03:01 -05:00
Baezon 18bf11b715 yes really just a whitespace change because travis hates me 2020-11-15 00:13:16 -05:00
Goober5000 32583f7216 don't access invalid memory if the shipnum is -1
This resolves #2887, even though that issue is really a case of bad data.
2020-11-14 22:24:49 -05:00
JohnAFernandez ce1858c4b6 Merge pull request #2890 from notimaginative/fix_multi_mission_closeout
Close out mission when returning to multi screens
2020-11-14 21:44:18 -05:00
JohnAFernandez b46c5f3e63 Merge pull request #2881 from Baezon/weapon-state-fixes
Two fixes to weapon states
2020-11-14 21:40:19 -05:00
Taylor Richards 0b41ee547b make sure mission is closed out when returning to multi screens 2020-11-14 19:57:58 -05:00
Baezon d4c5693e97 fix animation 2020-11-13 14:22:49 -05:00
JohnAFernandez 573746f229 Merge pull request #2759 from notimaginative/fix_multi_screen_timeouts
Fix multi screen timeouts
2020-11-13 02:33:50 -05:00
Baezon 8dba8f612e better comment 2020-11-12 14:28:14 -05:00
Baezon 89c1610ad7 better names 2020-11-12 00:21:46 -05:00
Baezon d4ac06fe81 comment for trail_add_segment and use vm_vec_zero 2020-11-11 23:39:04 -05:00
JohnAFernandez 455b839c27 Merge pull request #2876 from Baezon/scripting-frametime-fix
Fix 'getFrametime' scripting function
2020-11-11 21:07:55 -05:00
Baezon ec39f6c43b mandatory orient 2020-11-11 19:02:54 -05:00
Baezon e321b0c727 comment mistake 2020-11-11 18:52:08 -05:00
Baezon 8c640fb736 more comments 2020-11-11 17:24:14 -05:00
Baezon 048ee13269 implement trail "spread" 2020-11-11 16:56:22 -05:00
Baezon 899f03c8ff review tweaks 2020-11-11 01:32:22 -05:00
Baezon 2d9fdbe830 weapon state fixes 2020-11-11 01:20:22 -05:00
JohnAFernandez 433f170f52 AI Edge Case Fix (#2871) 2020-11-10 20:17:07 -05:00
Baezon 4b28f56edb actually deprecate old function 2020-11-10 12:53:51 -05:00
Baezon a4a281a0b8 move setting of flag 2020-11-10 02:41:58 -05:00
Baezon 23f8062346 add some afterburner fields 2020-11-10 01:44:00 -05:00
Taylor Richards 54a5e57181 clean up popupdead_do_frame() just a bit
- remove duplicate code block
 - use UNREACHABLE()
2020-11-09 20:00:47 -05:00
Taylor Richards 2c57ef119d Merge pull request #2878 from notimaginative/fix_pilot_file_issues
Fix pilot file data loss
2020-11-09 10:35:17 -05:00
Taylor Richards f11c12afe6 avoid verify() resetting data that it shouldn't
This fixes stats, variables, and techroom data for the
active pilot getting reset upon entering the barracks
2020-11-09 03:43:06 -05:00
Taylor Richards 0fc206ab97 fix invalid array in pilot file 2020-11-09 03:37:26 -05:00
JohnAFernandez b44a45cfa3 Should fix some crahes and inaccuracies at high pings (#2872)
* Should fix some crahes and inaccuracies at high pings

Feeding the wrong index to the rollback struct is a bad idea....  That's late night coding for you.

* Forgot one correction

* Also update the comment.
2020-11-09 00:11:49 -05:00
Goober5000 a0e5b8fc4d Merge pull request #2874 from The-E/feature/player_hook_var_in_huddraw
Add the "Player" hook variable to the CHA_HUDDRAW scripting trigger
2020-11-08 23:30:28 -05:00
Asteroth 5dbda7efd0 Merge pull request #2858 from Baezon/multi-beam-prep
Add beam parameter validation
2020-11-08 22:43:58 -05:00
Baezon 08f590b383 fix frametime 2020-11-08 22:32:21 -05:00
Fabian Woltermann 045a57745a Add the "Player" hook variable to the CHA_HUDDRAW scripting trigger 2020-11-08 14:38:33 +01:00
Taylor Richards 8950417c9e fix some timing problems
- account for frametime during movie playback to avoid sync issues
 - avoid incrementing timestamp more than once per frame in multi
2020-11-07 16:45:22 -05:00
Taylor Richards fb249d35cc add new NETPLAYER states
- Cutscenes
 - Fiction Viewer
 - Command Briefings
 - Red Alert
2020-11-07 16:44:11 -05:00
Taylor Richards ef648b313a confirm user wants to quit on respawn popup 2020-11-07 16:44:06 -05:00
Taylor Richards 0c66a3b33c fix crash on fiction viewer and cmd brief screens 2020-11-07 16:44:06 -05:00
Taylor Richards 9a913b5f35 prevent cutscenes from passing keyboard events to current state 2020-11-07 16:44:06 -05:00
Taylor Richards 3326874270 avoid replaying cutscene on briefing 2020-11-07 16:44:06 -05:00
Taylor Richards 05f4d36c52 stop common_music when exiting cmd brief and fiction viewer
This is necessary for multi to ensure that music is stopped.
common_select_close() would do this, but it's never inited for
these screens. So we need to manually do it if we aren't
transitioning to a screen with common_music.
2020-11-07 16:44:06 -05:00
Taylor Richards 153b6bbd6a handle multi quit properly in cmd brief and fiction viewer 2020-11-07 16:44:06 -05:00
Taylor Richards 463ca5ed01 allow multi clients to proceed to fiction viewer and cmd brief 2020-11-07 16:44:06 -05:00
Taylor Richards daa2da6a4a give time to network during playback loop if we should 2020-11-07 16:44:06 -05:00
JohnAFernandez 3238ce1614 Add CYCLE_PREIMARY_WEAPON_SEQUENCE to Multi controls sent to server. (#2866) 2020-11-07 14:23:34 -05:00
Baezon 8c9a6d049e use armor types for beam-weapon damage 2020-11-06 23:40:02 -05:00
jg18 d5c59d083c update prebuilt lib hash 2020-11-05 12:28:22 -08:00
Asteroth 498f82b0c4 Merge pull request #2823 from Baezon/continuous-spawn
Allow for continuously spawning weapons
2020-11-05 13:36:22 -05:00
Baezon 1359776651 no fb fire info fire method 2020-11-05 11:56:23 -05:00
Baezon 9034e4e043 revert and only do beam validation 2020-11-04 13:31:09 -05:00
Baezon 33805f1e37 travis 2020-11-04 00:24:15 -05:00
JohnAFernandez f21b1a7ace Multiplayer Resimulation for Client Fired Linear Weapons (Rollback) (#2788)
* Multiplayer Dumbfire Rollback

This creates a packet that sends the relative position and orientation info for a primary or dumbfire missle shot.  The client creates this packet when firing those two types of weapons and sends it to the server.  The server goes back to the frame that the client fired the weapon and quicky resimulates all the frames in-between.

This includes collision detection, restoring positions, orientations and veloicties, but not subsystem orientations.

* Address Feedback

* allow clients to send subsystem info

* Check for object number not weapon number

* Readability Adjustment
2020-11-03 22:56:25 -05:00
Baezon 64fa75d53e fix lssm trails 2020-11-03 12:42:06 -05:00
Joshua Glatt c733afc6bd Merge pull request #2857 from jg18/update_libpng_to_1.6.37
Update libpng to version 1.6.37
2020-11-03 08:52:30 -08:00
MageKing17 40dc4e9b74 Merge pull request #2862 from MageKing17/bugfix/display-name-template-fix
Don't perform automatic hash truncation before template-copying.
2020-11-03 01:22:25 -08:00
Baezon 729d515ea7 no pspew under lssm 3 2020-11-03 01:55:13 -05:00
jg18 e2675d4892 Use prebuilt FreeType library on Mac 2020-11-02 21:59:11 -08:00
MageKing17 b83f815dbb Don't perform automatic hash truncation before template-copying.
In commit 3b2af702f7, the hash truncation was changed so that instead of being part of the HUD, it's stored as the class's display name. However, this action was performed before `+Use Template:` was parsed, which would then overwrite the display name and clear the `Has_display_name` flag. I've moved it so that it now happens after the copy operation (and added a check for an existing display name, in case the template defines one). I use a new boolean variable to indicate that default display name creation needs to happen rather than duplicate that code.
2020-11-02 16:35:01 -08:00
Asteroth 5b0bbd5cde Merge pull request #2861 from Baezon/fix-collision-radius
Fix a bug with collision_radius_override
2020-11-02 16:59:41 -05:00
Baezon 53fdde6aea initialize collision_radius_override 2020-11-02 11:46:23 -05:00
jg18 31236b57cf update libpng to version 1.6.37 2020-11-01 09:56:21 -08:00
JohnAFernandez 42e29a96dd Merge pull request #2853 from JohnAFernandez/Fix-AutoAim-In-Multi
Allow polish_position() to use any player's position in multi
2020-10-31 22:39:26 -04:00
JohnAFernandez ee2560ac0f Merge pull request #2851 from Baezon/no-warn-radius-double
Don't warn for "no radius doubling" if the weapon isn't a bomb
2020-10-31 22:38:49 -04:00
Tyler Blount a92994fda5 Merge pull request #2840 from PhantomHoover/fix/slow-model-loads
Cache bitmap lookup buffers to avoid wasteful copying
2020-10-31 17:12:50 -06:00
Asteroth 2a9e33904c Merge pull request #2835 from Baezon/beam-no-parent-collide
Better excluding of beam-weapon collisions with the same parent
2020-10-31 17:18:20 -04:00
JohnAFernandez eb7a956a1e Allow polish_position() to use any player's position in multi 2020-10-31 16:46:50 -04:00
Baezon 7add73f27f rename hard_target_bomb and only warn for not interceptable 2020-10-31 01:12:30 -04:00
JohnAFernandez c4da36df52 Merge pull request #2847 from Baezon/radius-override
Add '$Collision Radius Override' to weapons
2020-10-30 20:13:08 -04:00
Phantom Hoover 7bcc18c622 Cache bitmap lookup buffers to avoid wasteful copying 2020-10-30 20:00:47 +00:00
Tyler Blount bd2c20fdc2 Merge pull request #2846 from TRBlount/new-licensing
Update terms of Licensing
2020-10-30 10:50:03 -06:00
Baezon ef34ce3883 0.f -> 0.0f 2020-10-30 11:50:47 -04:00
Baezon b3a71e9cf3 add radius override 2020-10-30 02:10:56 -04:00
Tyler Blount 9c75078026 Update terms of Licensing 2020-10-29 21:24:42 -06:00
Goober5000 0390f4abba Merge pull request #2845 from z64555/fix/mouse_buttons
Fixes #2844 where mouse buttons X1 and X2 were not detected.
2020-10-29 22:35:45 -04:00
z64555 9a2d996b53 Fixes #2844 where mouse buttons X1 and X2 were not detected. 2020-10-29 10:58:34 -05:00
Goober5000 4546c8784d Merge pull request #2842 from Goober5000/fix_debris_expiration
fix debris expiration
2020-10-28 23:18:06 -04:00
Goober5000 2aed10ee7f Merge pull request #2839 from Goober5000/fix_lock_indicator
redo the locking animations for multilock
2020-10-28 21:17:08 -04:00
Goober5000 b989492ef4 fix debris expiration
Fixes #2834, a bug where non-capital ships did not generate debris pieces from their hull.  It turns out this bug was introduced in #2416.  If the `DoesNotExpire` flag is substituted for the `lifeleft` variable , it should be done in all locations.
2020-10-28 19:35:50 -04:00
wookieejedi fea8086647 Merge pull request #2838 from Baezon/reset-burst-flag
Add "resets" burst flag
2020-10-28 15:54:05 -04:00
wookieejedi 97c801f7cc Merge pull request #2836 from wookieejedi/add-choose-random-bitmap-particle-effects
Add 'Choose Random Bitmap' for particle effects
2020-10-28 09:24:32 -04:00
Baezon 8dee9d8103 better delay handling 2020-10-27 23:35:19 -04:00
wookieejedi d23f995a58 optimize 2020-10-27 16:57:44 -04:00
wookieejedi 482b691f76 more appeasement 2020-10-27 14:49:27 -04:00
wookieejedi 04dc2aef57 appease travis 2020-10-27 08:07:08 -04:00
Goober5000 9eaa7bf024 redo the locking animations for multilock
The multilock patch did not handle `Lock_anim` in the best way, and handled `Lock_gauge` in a very bizarre way, despite the fact that they are two simple hud animations.  This changes the `lock_info` struct to track the correct `time_elapsed` value for both, and changes the locking code to use the values in the correct way.

Additionally, this properly loops the lock triangles on the FS1 lock indicator.  Strangely, even prior to the multilock merge it appears that the triangles wouldn't have animated more than a quarter turn.

Finally, this prevents the FS1 lock indicator from blinking, since in retail FS1 it didn't blink.

Tested with FSPort and no-mods.  Fixes #2826.
2020-10-27 02:55:36 -04:00
Goober5000 af83eda19a Merge pull request #2837 from Goober5000/fix_typo
fix typo and elaborate sexp help
2020-10-27 02:32:47 -04:00
Baezon 3db3dade77 implement "resets" burst flag 2020-10-27 01:39:35 -04:00
wookieejedi 34d6f5e44e and one more unit type fix 2020-10-26 23:18:06 -04:00
wookieejedi 20e65c0dbb remove unneeded int conversion 2020-10-26 22:55:13 -04:00
wookieejedi d762578fe0 incorporate feedback 2020-10-26 22:38:15 -04:00
Goober5000 283bcaf607 fix typo and elaborate sexp help 2020-10-26 20:51:00 -04:00
wookieejedi 032430d126 specify size_t type 2020-10-26 16:31:51 -04:00
wookieejedi 4b39f50b84 fix up 2020-10-26 16:05:58 -04:00
wookieejedi 879e7119d5 clean up redundancies 2020-10-26 15:54:40 -04:00
wookieejedi 8bc1c4c797 use pushback function 2020-10-26 14:08:14 -04:00
wookieejedi 01cc444836 Add 'Choose Random Bitmap' for Particle Effects 2020-10-26 13:47:26 -04:00
m!m a819d1860f Merge pull request #2827 from asarium/graphics/typesafeBufferHandles
Add type safe handle for graphics buffers
2020-10-26 17:59:18 +01:00
Baezon 858356cfd3 some fixes to beam collision 2020-10-26 11:43:10 -04:00
Goober5000 a8e1f02984 Merge pull request #2833 from Baezon/remote-detonate-fix
Fix `remote_detonaters_active` decrementing
2020-10-26 10:34:24 -04:00
Baezon f2e019d7fb review tweak 2020-10-25 21:36:31 -04:00
Baezon 62a1dae3b4 multi warning and no shadowing 2020-10-25 21:05:08 -04:00
Baezon c93c8e0bd7 fix remote_detonaters_active decrementing 2020-10-25 16:14:43 -04:00
Fabian Woltermann 339a33b0b7 Merge pull request #2832 from The-E/fix/2831_lab_crashes
Remove material editor, add exit button in the lab
2020-10-25 15:47:56 +01:00
Fabian Woltermann 33ce3f96f5 Remove material editor, add exit button 2020-10-25 13:03:38 +01:00
asarium 9da5cc17a3 Add type safe handle for graphics buffers
This converts the previous plain-int type for a buffer handle to an
instance of our ID class which provides type safety.
2020-10-25 12:16:05 +01:00
Baezon 3a83475c15 some fixes, added delay and minimum spawn interval 2020-10-25 00:44:14 -04:00
Tyler Blount 45417a0093 Merge pull request #2830 from PhantomHoover/fix/missile-locked-sexp
Avoid resetting player_has_lock unless they've actually lost their lock
2020-10-24 16:43:48 -06:00
Fabian Woltermann 0e5fbb1396 Fix a number of crash issues 2020-10-25 00:08:52 +02:00
Phantom Hoover 9a5186f637 Avoid resetting player_has_lock unless they've actually lost their lock 2020-10-24 20:26:55 +01:00
m!m dbcc60b359 Merge pull request #2829 from asarium/fix/2824
Make removing non-existent hook-vars a no-op
2020-10-24 17:33:39 +02:00
asarium 633d13a02e Make removing non-existent hook-vars a no-op
There are some usages where a hook variable is removed blindly which
caused issues in multi.

This fixes #2824.
2020-10-24 13:39:04 +02:00
Baezon dbf0d0de0d accurate total spawn count 2020-10-23 20:43:53 -04:00
wookieejedi 369f902d41 Merge pull request #2814 from bangstk/bugfix-hud-bg
Fix missing background color in paletted HUD gauges
2020-10-23 17:01:29 -04:00
Fabian Woltermann 23ea4eca43 Merge pull request #2517 from The-E/feature/lab_v2
Rewrite the lab
2020-10-23 18:01:47 +02:00
Fabian Woltermann fff5207d6c Disable the readability-non-const-parameter check on this line 2020-10-23 15:40:39 +02:00
Fabian Woltermann 4ad8f257bf Remove circular dependency 2020-10-23 08:18:23 +02:00
JohnAFernandez 2235a62cda Merge pull request #2810 from Baezon/better-collide-avoid
Improved collision avoidance for fighters
2020-10-22 22:06:34 -04:00
JohnAFernandez 4bd827f248 Merge pull request #2819 from notimaginative/fix_psnet_init
Address issues that can arise if psnet fails to init properly
2020-10-22 21:24:21 -04:00
JohnAFernandez c2b6a35196 Merge pull request #2813 from Baezon/fix-to-the-fix
Fix to the fix to initial missile physics set-up
2020-10-22 21:21:00 -04:00
Baezon 454c8f6bc3 no shadowing 2020-10-22 20:01:31 -04:00
Baezon a55e331302 spawn_chance for detonate_spawn too 2020-10-22 18:48:58 -04:00
Baezon 1926fcc5cb total_children_spawned -> total_detonation_children_spawned 2020-10-22 17:58:43 -04:00
Baezon 6506d0a49c v1 2020-10-22 14:32:20 -04:00
Fabian Woltermann 4e455913b9 Use a getter for the labmanager 2020-10-22 19:26:00 +02:00
m!m 51c8b22905 Merge pull request #2809 from asarium/graphics/2dFuncObs
Change graphics interface to function objects
2020-10-22 19:24:09 +02:00
Goober5000 6d8ab32971 Merge pull request #2822 from Baezon/bracket-deathroll-bug
Fix a bug with hud brackets during target deathroll
2020-10-22 11:22:09 -04:00
Fabian Woltermann 30436568f2 I don't even know 2020-10-22 08:04:01 +02:00
Baezon 7b6488aba2 array safety 2020-10-21 23:23:23 -04:00
Baezon 6808101e4a much cleaner this way 2020-10-21 23:10:35 -04:00
Baezon eae514a269 v1 2020-10-21 22:57:08 -04:00
Goober5000 f32f227db0 Merge pull request #2815 from Baezon/better-remote-detonate
Fix some inconsistencies with remote detonation
2020-10-21 14:21:16 -04:00
Fabian Woltermann d93d8e0e5e More CI fixes 2020-10-21 17:13:30 +02:00
Taylor Richards 7864a2891d abort if psnet failed to init on standalone 2020-10-21 10:57:24 -04:00
JohnAFernandez 04a4f98ced Merge pull request #2818 from JohnAFernandez/Fix-Silly-Ai-Debugging-Code
Add Missing Entries to Submode_text array
2020-10-21 05:54:56 -04:00
JohnAFernandez afc4fad4db And related comments 2020-10-20 23:48:08 -04:00
JohnAFernandez 1257396a1b Add Missing Entries to Submode_text array 2020-10-20 23:32:46 -04:00
Fabian Woltermann 52f0b7dbc6 Merge pull request #2802 from PhantomHoover/feature/screenshake-flag
Add -no_screenshake flag to optionally disable screen shaking effects…
2020-10-20 17:51:28 +02:00
Baezon ef65914129 v1 2020-10-19 13:40:25 -04:00
bangstk 01f4fb3f15 Fix missing HUD gauge backgrounds
Code was moved around between 3.8.0 and 19.0.0 which broke the colored backgrounds of paletted HUD gauges.

Palette index 15 is used by the HUD gauge graphics to indicate background area of HUD gauges. When the code to remap palette indexes to alpha values was moved to packunpack.cpp, palette index 15 was mistakenly mapped to the alpha for index 0 (nothing) rather than index 1 (what retail/3.8.0 code maps it to) causing all HUD gauges to be missing their dark transparent backgrounds.

Also: the code maps palette indexes [0, 15] to alpha values [0, 255]. But due to an oversight (palette index 15 not being part of this gradient] alpha value 255 is never used so the range of alpha values for HUD gauges ended up being [0, 238]. Conversion math tweaked to make the alpha range [0, 252] which is very close to 255.
2020-10-19 03:31:01 -04:00
Baezon d2de3b6b82 v1 2020-10-18 22:43:57 -04:00
Phantom Hoover 68385e7658 Disable no screenshake flag in multi 2020-10-18 20:22:03 +01:00
Fabian Woltermann 1ad6b78950 More CI things 2020-10-18 19:58:56 +02:00
Baezon baa1f23bdc travis appeasement 2020-10-18 12:43:07 -04:00
Taylor Richards 424840eabf fix issues with psnet init 2020-10-18 05:31:24 -04:00
Fabian Woltermann 1e406ae5d2 Another CI warning fix 2020-10-18 10:43:30 +02:00
Baezon a9bc56fd13 v1 2020-10-18 00:30:41 -04:00
m!m 395b4300f6 Merge pull request #2800 from asarium/vulkan/shaders
Add first basic rendering with Vulkan
2020-10-17 20:38:46 +02:00
Fabian Woltermann c5447966c2 More CI fxes 2020-10-17 17:53:30 +02:00
Fabian Woltermann b94b5475b6 actually remove the old lab code 2020-10-17 16:54:51 +02:00
Fabian Woltermann eebd5cdd4d Fix CI warnings 2020-10-17 16:50:47 +02:00
Fabian Woltermann 13cd2d3326 Make the AO flag work 2020-10-17 16:07:33 +02:00
Fabian Woltermann 241ba1e4e7 Fix crash on exit 2020-10-17 15:58:34 +02:00
asarium 287b843839 Change graphics interface to function objects
This will make it easier to have a graphics interface without relying on
global objects since the object can be kept alive in the function
object. No other functional changes since the existing syntax is also
valid for function objects.
2020-10-17 15:15:33 +02:00
Phantom Hoover 67e9a4263a NULL to nullptr to appease travis' caprice 2020-10-17 13:50:01 +01:00
m!m ede19df94d Merge pull request #2808 from JohnAFernandez/Add-buffer-to-object-update-packet
stop needs more space so as not to crash during really busy scenes
2020-10-17 13:00:15 +02:00
Goober5000 d771d499dd Merge pull request #2804 from Baezon/physics-missile-fixes
Two fixes to initial missile physics set-up
2020-10-17 01:35:06 -04:00
Goober5000 c7666faf08 Merge pull request #2807 from Goober5000/directive_lines_fix
properly handle directives with long words
2020-10-17 01:09:33 -04:00
JohnAFernandez 93a9a2ab51 stop needs more space so as not to crash during really busy scenes 2020-10-17 00:07:18 -04:00
Goober5000 f7b3322537 Merge pull request #2806 from TRBlount/fix/multilock-cs-swarm
Fix #2767
2020-10-16 21:14:51 -04:00
Goober5000 a4d10a3fe4 properly handle directive with long words
A follow-up of sorts to #2801, but independent of it.  If a directive line is not split, the HUD should handle it properly rather than Asserting and displaying the same line twice.
2020-10-16 21:02:36 -04:00
Tyler Blount 2f07c0785e Add comment for clarification 2020-10-16 17:34:05 -06:00
Tyler Blount 8090f60940 Don't clear locks for swarm/corkscrew missiles until the last missile needs to be fired 2020-10-16 16:15:48 -06:00
Goober5000 4be145999e Merge pull request #2803 from Goober5000/fix_special_exp_initialization
fix a very special case with ship field initialization
2020-10-16 13:42:35 -04:00
Baezon 39d28a14e8 travis 2020-10-16 12:53:22 -04:00
Baezon 1459f4bbcf v1 2020-10-16 01:52:47 -04:00
Goober5000 785cabfc4c fix a very special case with ship field initialization
If you create a kamikaze ship with ship-create, it won't work properly, because the explosion values are not initialized to -1 as expected.  This fixes that.
2020-10-15 22:13:06 -04:00
Phantom Hoover a137fa496f Add -no_screenshake flag to optionally disable screen shaking effects for afterburner/cannon/shockwaves 2020-10-15 21:23:23 +01:00
Goober5000 278370b0d6 Merge pull request #2801 from Goober5000/tweak_message_string_splitting
improve message string splitting for outlier cases
2020-10-15 12:39:00 -04:00
asarium 4a0a8463ee Add first basic rendering with Vulkan
This is basically the tutorial from vulkan-tutorial.com adapted to using
VulkanHpp and with some refactorings that extract some locigally
self-contained code.

Currently only draws a simple colored triangle.
2020-10-14 22:21:45 +02:00
Goober5000 455e2f9d8c improve message string splitting for outlier cases
If a message string contained a word that was too long, on its own, for the available screen real estate, the function wouldn't split the string at all.  The new behavior is to split the string even if the split location is suboptimal, since it's better to have as much of the message visible as possible.

Quoting from the code:

```
// only update the line break if:
// a) we don't have a line break yet;
// b) we're still within the required real estate
// (basically we want the latest line break that doesn't go off the edge of the screen,
// but if the *first* line break is off the end of the screen, we want that)
```
2020-10-14 15:57:09 -04:00
m!m bfe76fbf44 Merge pull request #2795 from Baezon/laser-particles
Allow for 'laser-style' particles
2020-10-14 20:21:50 +02:00
Goober5000 fbca15ae71 Merge pull request #2799 from Goober5000/invalidate_argument_default
the default for the argument sexps should be the most frequently-used case
2020-10-13 19:45:02 -04:00
Goober5000 4ecddc0408 the default for the invalidate-argument sexp should be the most frequently-used case 2020-10-13 16:16:41 -04:00
Goober5000 105137dc94 fix bug in ships with no allowed weapons list (#2796)
Phantom Hoover noticed this bug in Vassago's dirge.  For ships with no allowed weapons list (like Shivan ships) weapon culling would cause a crash.
2020-10-12 21:22:15 -04:00
Fabian Woltermann 83d499b999 master rebase 2020-10-12 21:41:44 +02:00
Fabian Woltermann 41afb6e32d ... 2020-10-12 21:01:42 +02:00
Fabian Woltermann c914a131ab small fix 2020-10-12 21:01:42 +02:00
Fabian Woltermann 98085d5281 more fixes 2020-10-12 21:01:42 +02:00
Fabian Woltermann 515a8e95c5 More stupid bugfixes 2020-10-12 21:01:42 +02:00
Fabian Woltermann 80c9af4c57 More fixings 2020-10-12 21:01:42 +02:00
Fabian Woltermann 06428448b3 Various fixes 2020-10-12 21:01:42 +02:00
Fabian Woltermann ca8f9e9adf small bugfixes 2020-10-12 21:01:42 +02:00
Fabian Woltermann 298f6c5aa9 fix typo 2020-10-12 21:01:42 +02:00
Fabian Woltermann 18aa525ce2 Make model rendering work again 2020-10-12 21:01:42 +02:00
Fabian Woltermann 7e98ed7990 Get more rendering in here 2020-10-12 21:01:42 +02:00
Fabian Woltermann 396fdc88f9 Start on the renderer 2020-10-12 21:01:42 +02:00
Fabian Woltermann 440045d017 Make it possible to exit the lab 2020-10-12 21:01:42 +02:00
Fabian Woltermann c650cec3da Add the missing dialogs 2020-10-12 21:01:42 +02:00
Fabian Woltermann 1c5621b89b Add weapons list 2020-10-12 21:01:41 +02:00
Fabian Woltermann 77a832f8f4 bugfixes 2020-10-12 21:01:41 +02:00
Fabian Woltermann 56140e5c9c Fix more CI warnings 2020-10-12 21:01:41 +02:00
Fabian Woltermann 305c0b915e Fix CI 2020-10-12 21:01:41 +02:00
Fabian Woltermann 8e45f3cf29 wip 2020-10-12 21:01:41 +02:00
m!m f7dd996a40 Merge pull request #2793 from asarium/lua/varargsDocs
Support vararg specifiers in Lua documentation
2020-10-12 19:45:02 +02:00
Baezon 13f911528f no implicit magic number, and initialize 0 2020-10-12 13:39:05 -04:00
asarium bb0631ab6e Support vararg specifiers in Lua documentation
This was the last thing that was missing for complete support of all
function parameter declarations.

To ensure parameter lists stay valid a unit test was added that will
validate the argument lists and cause the test to fail if they cannot be
parsed.
2020-10-12 17:59:57 +02:00
Baezon 773d6f9710 v1 2020-10-12 01:13:29 -04:00
JohnAFernandez 7d8dd55ec8 Merge pull request #2791 from Baezon/missile-turn-accel
Add 'Turning Acceleration Time' to missiles
2020-10-11 21:41:14 -04:00
Baezon 3bd999ee8e warn once for no flag 2020-10-11 19:30:33 -04:00
m!m 75ca28ea86 Merge pull request #2794 from wookieejedi/fix-non-shielded-ships-manage-ets
Fix to Non Shielded Ships Manage ETS
2020-10-11 19:12:18 +02:00
wookieejedi 950f248b03 Fix to Non Shielded Ships Manage ETS
This one line fix properly specifies which ship to use for ETS managment. The recent merge of `Non-shielded ships manage ETS` had a object reference error, so this rectifies that. Thanks to Axem for finding this!
2020-10-11 11:23:14 -04:00
Baezon b360435719 v1 2020-10-11 02:34:59 -04:00
m!m f54ad876aa Merge pull request #2789 from Baezon/respect-turntime-rotdamp
Add 'AI respect tabled turn time and rotdamp' flag
2020-10-10 18:49:26 +02:00
m!m 587c4f7cd1 Merge pull request #2790 from Baezon/ai-use-bank-const
Fix banking constant not applying to AI
2020-10-10 18:47:34 +02:00
Baezon 3eda3d9315 increase fudge to maintain retail 2020-10-09 23:37:28 -04:00
Baezon 53d2d6c028 v1 2020-10-09 23:19:41 -04:00
Baezon 01d2657532 v1 2020-10-09 23:00:21 -04:00
Goober5000 465af93dcd fix display names for wings (#2787)
Fix wing name generation, when using hash symbols, to use the new display name method.
2020-10-08 22:48:30 -04:00
JohnAFernandez 186fe51344 Object update packet upgrade (#2752)
* Object Update Refactor

    1. Keeps the object update packet aligned, even if the ship is dying or has not yet arrived on the client.
    2. Properly handles model point shields (yes, that's what was causing multi to crash the most!)
    3. Reworks positional interpolation timing and adds rotational interpolation, by sending timing information with every object update packet in a header shared between objects.
    4. Saves a lot of bandwidth by only sending data that is changing. (no more sending all subsystems once per second!)
    5. Better handles out of order packets (but can still use their information if recent enough!)
    6. Builds the basis for Rollback by beginning to record the positions and orientations and velocities of ships for the last 30 frames.
    7. Adds subsystem rotation -- Yeah, you saw that right, subsystems will now spin in multi.
    8. Waypoint movement is now enabled via sexp, and time to arrival of waypoints is updated on the target info gauge.

* Fix edge case crash and Incorporate feedback

* Clean Up Interpolate Angles Quick

* Restrain the client

* How was this still here???

* Make sure every part of OO uses OOC_INDEX_NULLPTR_SUBSYSTEM define

* Fix Way to Store Return Values

* Ok travis, we get it

* Ok travis.........
2020-10-08 15:29:06 -04:00
wookieejedi 8961b3cc8e Merge pull request #2783 from wookieejedi/allow-non-shielded-to-manage-ETS
Flag to allow ships with no shields to manage ETS
2020-10-06 16:18:06 -04:00
Goober5000 23b3aadf9b Message size fix (#2784)
* Fix underline length calculation in message scrollback
* Use SCP_string for message source (which allows ships with long display names to work without crashing) and message text
* Upgrade assorted functions to work with SCP_string
2020-10-06 14:31:03 -04:00
wookieejedi 443b3cd217 fix copy paste error 2020-10-06 14:07:19 -04:00
wookieejedi dabe025967 feedback and cleanup 2020-10-05 21:43:46 -04:00
wookieejedi 31d7a16e54 make capitalization consistent 2020-10-05 20:40:40 -04:00
wookieejedi 886e7f4f18 Flag to allow ships with no shields to manage ETS
Using the `No_shields` flag for ships is common usage in multiple mods, and as it turns out ships with that flag set will not have the AI manage ETS values due to an early return in the `ai_manage_ets` function. This PR adds an AI flag to allow ships with no shields to manage ETS regarding weapons and engines. This flag was tested and works as expected.
2020-10-05 19:57:09 -04:00
m!m a52f35fd28 Merge pull request #2782 from asarium/build/fixReleaseToolset
Fix toolset for Windows nightly and release builds
2020-10-04 12:26:54 +02:00
asarium fbdcf7cf50 Fix toolset for Windows nightly and release builds 2020-10-03 21:16:04 +02:00
m!m dc977f18ba Merge pull request #2781 from asarium/scripting/hookVarStack
Use a stack for scripting hook variables
2020-10-03 20:54:15 +02:00
asarium f71a86f2db Use a stack for scripting hook variables
Previously, if a script called a function that called another scripting
hook, some hook variables might be removed. This was the case since
after executing the hook the code would remove the set hook variables
again. If these variables had the same name as previously set variables,
they would overwrite and corrupt the state the original script expected.

This was unexpected behavior for script writers so this puts values on a
stack and only adds or removes from the stack instead of overwriting
values. This should make the hook variable state consistent for scripts
even if scripting hooks are called indirectly.
2020-10-03 15:37:20 +02:00
Goober5000 83666a0660 Merge pull request #2779 from Goober5000/weapon_sparks
add No_impact_spew weapon flag
2020-10-03 09:31:34 -04:00
m!m 6b946ed857 Merge pull request #2776 from asarium/fix/2773
Fix GCC-10 warnings
2020-10-03 11:26:06 +02:00
m!m 56f51f58e7 Merge pull request #2780 from Goober5000/fix_kill_crash
fix CTD when running ship:kill() with no parameters
2020-10-03 09:51:20 +02:00
Goober5000 53ad0ea163 fix CTD when running ship:kill() with no parameters 2020-10-03 00:02:46 -04:00
Baezon 799fa27d36 clarity comment 2020-10-02 23:14:45 -04:00
Goober5000 672ad1a489 Merge pull request #2778 from Baezon/javelin-fix
Fix a CTD with Javelin missiles
2020-10-02 22:14:23 -04:00
Goober5000 18c93f2b5a add No_impact_spew weapon flag
If you want to make a weapon that doesn't generate smoke particles on impact.
2020-10-02 22:12:59 -04:00
Baezon 06dd153f80 v1 2020-10-02 16:11:40 -04:00
asarium b4350a1d1e Fix GCC-10 warnings
This fixes some warnings reported by GCC 10 and enables that compiler to
be used by our CI pipelines.

This fixes #2773.
2020-10-02 18:49:01 +02:00
Baezon 01cd5a34b9 travis 2020-10-02 12:04:45 -04:00
Goober5000 fa72fa463b Merge pull request #2774 from Goober5000/flag_fixes
fix flags in ships.tbl and weapons.tbl
2020-10-02 10:16:20 -04:00
Baezon 9b3905a4bb v1 2020-10-02 02:53:13 -04:00
Goober5000 15061d5daf fix flags in ships.tbl and weapons.tbl
When flags are parsed, they can be reset.  This is a problem for flags that are set based on lines elsewhere in the entry, so each table uses its own method to get around it.  However, not all flags used this method - particularly the new Has_display_name flag.  This brings the flag management up to date.
2020-10-02 00:53:33 -04:00
Goober5000 39d77d891c Merge pull request #2770 from Baezon/improve-docked-shockwave
Improve shockwave handling for docked ships
2020-09-30 20:58:47 -04:00
Goober5000 2c3ad93f82 Merge pull request #2772 from Goober5000/warpout_fix
fix several places where the wrong matrix function was used
2020-09-30 20:06:07 -04:00
Goober5000 2be97cfde9 fix several places where the wrong matrix function was used 2020-09-30 15:17:43 -04:00
m!m 3e226f85e0 Merge pull request #2768 from asarium/opengl/spirvShaders
Add support for using Vulkan GLSL code with OpenGL
2020-09-29 22:57:11 +02:00
Goober5000 5f4124ee83 Merge pull request #2771 from Goober5000/for_player
add for-players sexp
2020-09-27 10:40:52 -04:00
asarium 56dc373bb9 Add support for using Vulkan GLSL code with OpenGL
This is an effort to be able to use the same GLSL code for both Vulkan
and OpenGL. This is done by first compiling the Vulkan GLSL code to
SPIR-V and then using a custom tool (which uses SPIRV-Cross) to convert
that back into GLSL 1.50 compatible code.

The required tool will be downloaded by CMake when glslc is found in the
path. This is included in the Vulkan SDK. To avoid having a hard
dependency on this, the generated files are included in the VCS and are
only regenerated when glslc is found on the system.
2020-09-27 12:45:05 +02:00
Goober5000 bfbc1389ab add for-players sexp
Useful for multiplayer missions.  Lists all currently valid player ships in the mission.  Works in both singleplayer and multiplayer.
2020-09-26 22:38:20 -04:00
m!m a3a27e9ad3 Merge pull request #2735 from Baezon/beam-collide-improve
Improve beam collision optimization
2020-09-26 23:01:30 +02:00
m!m 94fd9051d1 Merge pull request #2769 from Baezon/no-shield-print
Suppress "Too many triangles in shield hit" log spam
2020-09-26 22:57:53 +02:00
Baezon 470327933f v1 2020-09-25 23:05:44 -04:00
Baezon 540d200bec doing two PRs on the same area at the same time as always confusing 2020-09-25 22:47:33 -04:00
Baezon 7f46a3868d keep get_widest function 2020-09-25 21:28:25 -04:00
Baezon 5b6dd4d452 travis 2020-09-25 21:28:25 -04:00
Baezon 3370adc918 cleanup 2020-09-25 21:28:25 -04:00
Baezon ed8a89b68e collision optimize 2020-09-25 21:28:25 -04:00
Baezon d6442a096b store width 2020-09-25 21:28:25 -04:00
wookieejedi 0a88d5068e Merge pull request #2765 from Baezon/no-player-mflash
Suppress muzzle flashes from the player (and add a flag to re-enable it)
2020-09-25 21:19:39 -04:00
Baezon 414ad4a553 v1 2020-09-25 20:40:58 -04:00
Baezon cf270771f0 re enable muzzle flashes flag 2020-09-25 13:59:15 -04:00
Baezon 3cf9bc250a v1 2020-09-25 13:58:07 -04:00
Goober5000 2791acbd0c Merge pull request #2766 from Baezon/finished-growing-flag
Put beam->finished_growing into beam->flags
2020-09-24 22:13:28 -04:00
m!m 350ace3952 Merge pull request #2756 from asarium/rocket/documentEnvironment
Give Lua libRockets documents their own environment
2020-09-24 21:19:39 +02:00
m!m cfbce2a6cf Merge pull request #2762 from asarium/cmake/embeddedFilesRefactor
Refactor embedded files CMake code
2020-09-24 21:11:01 +02:00
Goober5000 58a9075002 Merge pull request #2740 from Baezon/no-framerate-dependance
Remove turning framerate dependence for AI
2020-09-24 14:45:10 -04:00
Baezon ed87b158c2 v1 2020-09-24 14:42:49 -04:00
Baezon b7ceb29be9 clarity comments 2020-09-24 01:00:21 -04:00
Baezon 60f20d055c review changes 2020-09-24 01:00:21 -04:00
Baezon 82b8f1726e travis cleanliness appeasement 2020-09-24 01:00:21 -04:00
Baezon 86a63f10b8 no shadowing 2020-09-24 01:00:21 -04:00
Baezon 232035e45d handle shockwaves and renaming 2020-09-24 01:00:21 -04:00
Baezon 7accd387a3 v2 2020-09-24 01:00:21 -04:00
Baezon 58ce531ec6 v1
V2
2020-09-24 01:00:21 -04:00
Goober5000 fa5bbf8531 Merge pull request #2764 from Goober5000/turret_fix
make the scripted turret firing code a bit more robust
2020-09-23 22:55:48 -04:00
JohnAFernandez 2e9a6c8ad6 Merge pull request #2763 from wookieejedi/specify-weapons-ss-threshold-turrent-inaccuracy
Expose Weapons SS Damage Threshold for Turret Inaccuracy
2020-09-23 22:14:34 -04:00
MageKing17 4778c7bbcc Merge pull request #2741 from Baezon/beam-grow
Add beam 'growth' in addition to shrinkage
2020-09-23 18:54:01 -07:00
JohnAFernandez 4cdab81ebb Merge pull request #2761 from Baezon/improve-homeworld-warp
Improve Homeworld warp effect
2020-09-23 21:33:19 -04:00
Goober5000 df53e49abf make the scripted turret firing code a bit more robust
The scripted code previously didn't check to see if a weapon bank was valid before firing it, which could have led to memory problems and starting March 15 would actually crash the game.  This adds a few safety checks.
2020-09-23 21:24:41 -04:00
wookieejedi 65bf014693 and another syntax fix... 2020-09-23 16:36:21 -04:00
wookieejedi 13325ef81a one more cleanup 2020-09-23 16:24:57 -04:00
wookieejedi 74b3374fe6 fix syntax issue 2020-09-23 16:00:18 -04:00
wookieejedi 984ee93d75 Expose Weapons SS Damage Threshold for Turret Inaccuracy
This PR adds a table entry that allows modders to specify the damage threshold for when turrents become less accurate due to weapon subsystem damage. A Game table setting is easier to set once and tune, thus this PR allows that efficent exposure to the modder and does not require a large change or complex table entry.
2020-09-23 15:25:16 -04:00
Baezon 2efe876fbd #define -> const float, and adjusted_progress for stage 3 2020-09-23 13:15:46 -04:00
asarium 0f2787639b Refactor embedded files CMake code
I have been thinking about some shader related techniques for the Vulkan
renderer and for that we will need to add embedded files in a different
environment than they are right now since the actual shader code will
not be needed in the engine.

For this reason, I extracted the "default file" mechanism to be more
generic so that all that is necessary to include a file is to just call
a custom CMake command and the function keeps track of what needs to be
done.

Also, since the "generic" code has worked pretty well so far I see no
reason to keep around two systems which just increases the amount of
code we need to maintain. So, I just removed the windows exclusive
implementation. Now all platforms use the same "generic" way of
embedding files.
2020-09-23 13:38:54 +02:00
Baezon 8d7536855b fix HW warp orient (always follows the ship's) 2020-09-23 01:49:53 -04:00
Baezon 9cbbb96880 timing re-adjusted for MAXIMUM accuracy 2020-09-23 01:21:41 -04:00
Goober5000 b22d9ce3c8 Merge pull request #2760 from Goober5000/play_sound_type_safety
polish some SEXPs
2020-09-23 00:21:21 -04:00
Baezon d9913d5b9e v1 2020-09-22 23:26:14 -04:00
Goober5000 147be6815c polish some SEXPs
Update SEXP help regarding variable types, and also add them to the SEXP syntax checker.

Fixes #2758.
2020-09-22 22:06:14 -04:00
Goober5000 410ab1ee5e Merge pull request #2757 from Goober5000/loadout_memory_optimization
optimze memory usage by weapon loadout
2020-09-22 13:33:16 -04:00
Goober5000 46691badb8 CI stuff 2020-09-21 22:05:00 -04:00
Goober5000 5a3c8d262c optimze memory usage by weapon loadout
The weapon loadout arrays wasted a ton of memory in several ways.  First, only friendly fighters and bombers have weapon loadouts; most ship classes do not need this storage.  Second, as DahBlount noticed, only 8 bits are needed for the flags, while the fields were using standard 32-bit ints.  Third, there are currently 500 weapon types but most loadouts only provide a dozen or so options.

This refactors the loadout storage to keep a short vector of weapon-flag pairs for each bank, and the bank storage is allocated only when needed.  The new `allowed_weapon_bank` class provides `operator[]` implementations so that the new API is almost completely compatible with the old one.  The only things that require the new API are assignments, since `operator[]` is read-only.  (A writable `operator[]` would not be able to tell when a flag value of 0 should be stored or not.)
2020-09-21 16:54:34 -04:00
asarium 9d9083ab52 Give Lua libRockets documents their own environment
This gives every document their own environment instead of using the
global environment. Previously it was necessary to store variables in
the global namespace since otherwise they could not be accessed by event
listeners.

This creates a separate environment table for every document so that all
<script> blocks and event handlers share the same "global" environment.
2020-09-21 21:07:00 +02:00
JohnAFernandez 3384699086 Merge pull request #2712 from Goober5000/red_alert_multi_sexp_support
add multi support for red-alert sexp
2020-09-21 11:34:34 -04:00
JohnAFernandez a043a14d69 Merge pull request #2631 from notimaginative/fix_multi_red-alert
Make redalert missions work better in multi
2020-09-21 11:34:13 -04:00
JohnAFernandez ee5336ed42 Merge pull request #2755 from notimaginative/fix_multi_weapon_crash
Fix multi crash when ship has less than two primary weapons
2020-09-21 09:43:51 -04:00
JohnAFernandez 6be2c665f0 Merge pull request #2754 from TRBlount/fix/multilock_aspect_loss
Fix #2724
2020-09-21 01:36:25 -04:00
Taylor Richards 9ca02e9e1a Merge pull request #2753 from notimaginative/fix_reliable_socket_memory_error
Fix memory error which broke reliable sockets
2020-09-20 23:57:10 -04:00
Taylor Richards 21642d5b75 fix multi crash when ship has < 2 primary weapons 2020-09-20 22:26:23 -04:00
Tyler Blount fe5eff2cee Fix #2724 2020-09-20 19:05:42 -06:00
Taylor Richards 46bc4e2e8c fix memory error which broke reliable sockets 2020-09-20 20:49:25 -04:00
Goober5000 49858825ac Merge pull request #2737 from Goober5000/credits_update
update credits
2020-09-20 14:21:48 -04:00
Taylor Richards 83116bbd11 disable replay mission button on red alert brief when multi 2020-09-20 13:30:03 -04:00
Taylor Richards 7c3906da00 always consider loadout locked on red-alert 2020-09-20 13:30:03 -04:00
Taylor Richards fe3069b94b make sure clients can proceed to red-alert brief 2020-09-20 13:30:03 -04:00
Taylor Richards 6795e0a940 handle exiting red-alert brief properly on multi 2020-09-20 13:30:03 -04:00
Taylor Richards eacc91ac8e fix issues with red-alert + multi
- support sync state before entering mission
 - return to briefing for sync and stats saving
 - handle campaign progression properly
 - initialize net_player state properly (fixes #2560)
2020-09-20 13:30:03 -04:00
JohnAFernandez 27faf89baa Fix Change IFF Multi Sexp 2020-09-20 09:53:47 -04:00
Taylor Richards f5a2cae122 Merge pull request #2608 from notimaginative/ipv6
IPv6 support
2020-09-20 09:46:44 -04:00
Baezon c143f9f6ec copy paste error 2020-09-19 22:10:01 -04:00
Taylor Richards b14122425a use newer define for multicast group joining 2020-09-19 06:35:19 -04:00
asarium bda31cd84f Use different hoster for build log
transfer.sh shut down some time ago and the output of the Mac build
tools is completely useless.
2020-09-19 11:40:13 +02:00
asarium ac6ed66c45 Disable XP toolset 2020-09-19 10:32:29 +02:00
JohnAFernandez f5a8556e54 Fix special Char crash
When I wrote the original change to a vector instead of an array, I was working on the assumption that this section of code was parsed after some other code that had already made sure that the special_char_indexes vector was at least three entries.  Further testing has revealed this is not true, and this fix keeps it from crashing.
2020-09-17 16:06:09 -04:00
Goober5000 33b4f1b5cc Merge pull request #2748 from JohnAFernandez/Enhance-ai-check-to-fix-crash
Fix an ai check
2020-09-17 12:41:04 -04:00
JohnAFernandez ce9fa02bc3 Fix an ai check
Keep multi from crashing from an out of bound check when trying ti set up a formation for a respawning ship.
2020-09-17 07:49:15 -04:00
wookieejedi fa7ad6a764 Merge pull request #2747 from wookieejedi/countermeasure-script-hook
Add Scripting Hook `On Countermeasure Fire`
2020-09-16 17:11:13 -04:00
wookieejedi 167e1430ee Clarify doc and add countermeasure object to hook 2020-09-16 15:35:11 -04:00
wookieejedi e544e1d081 Update ship.cpp
This PR adds a scripting hook which triggers when a ship fires a countermeasure. It has two variables, the ship firing the countermeasure and the number of countermeasures remaining. I have tested and it works as expected. This new hook complements the preexistsing `On Secondary Fire` and `On Primary Fire` hooks.
2020-09-16 12:58:34 -04:00
Goober5000 9b3f45ea1c Merge pull request #2745 from Goober5000/frheadding
make fred popup match the conventional pitch/bank/heading
2020-09-15 21:14:52 -04:00
Goober5000 34da5093bf make fred popup match the conventional pitch/bank/heading 2020-09-15 13:27:05 -04:00
Baezon 1a6f01c8d8 copy paste error 2020-09-15 13:06:35 -04:00
Goober5000 8a3556b648 Merge pull request #2738 from Goober5000/file_fixes
fix getPath() and add getName()
2020-09-15 11:55:07 -04:00
Goober5000 d1af5ed467 shut up clang, this wasn't even part of the PR 2020-09-15 04:12:29 -04:00
MageKing17 ad8fc46224 Merge pull request #2743 from Goober5000/special_char_index_tweak
don't break the parser in Unicode mode
2020-09-14 23:45:28 -07:00
Goober5000 a485e29b24 use DIR_SEPARATOR_CHAR 2020-09-15 02:36:32 -04:00
JohnAFernandez 87de1d1d77 Remove Int3()'s from ai.cpp and aibig.cpp 2020-09-14 20:53:31 -04:00
JohnAFernandez 8d41f5bcc6 Replace INT3's in Freespace.cpp 2020-09-14 20:53:31 -04:00
Goober5000 460f00a23e don't break the parser in Unicode mode
If a mod is running in Unicode mode, ignore Special Character Index if the table happens to supply it.
2020-09-14 19:25:33 -04:00
Goober5000 472babbb30 Merge pull request #2725 from JohnAFernandez/fix-special-characters-correctly
Minor Refactor of Special Character Index Handling
2020-09-14 19:22:22 -04:00
Goober5000 30a0946e47 update cf_find_file_location based on Taylor's patch 2020-09-14 19:16:35 -04:00
m!m 2a90d1f823 Merge pull request #2717 from asarium/lua/serializer
Add Lua API for serializing values
2020-09-14 22:25:26 +02:00
m!m 8ce8c061b2 Merge pull request #2742 from asarium/github/codeowners
Add basic code owners file
2020-09-14 19:34:28 +02:00
Goober5000 b821dc5798 CI pointed out memory leaks, so let's just use SCP_string 2020-09-13 23:19:37 -04:00
Goober5000 ca2a9b8721 address feedback and use an alternate separator method 2020-09-13 17:02:56 -04:00
Goober5000 12fad41962 fix getPath() and add getName()
The getPath() function would crash if the id was -1.  Also, there was no function for getting the file name.
2020-09-13 17:02:56 -04:00
Goober5000 07b975ee76 Merge pull request #2739 from Goober5000/ship_types_scripting
add tb.ShipTypes
2020-09-13 12:27:19 -04:00
asarium b3e7d03d78 Add basic code owners file 2020-09-13 14:58:12 +02:00
Baezon f66bd71a21 v1 2020-09-13 02:44:31 -04:00
Goober5000 f4924971f7 patch ship type lookup 2020-09-13 02:10:41 -04:00
Goober5000 8b3b15b4b2 add tb.ShipTypes
Add ShipTypes as a collection to complement ShipClasses.

Also check the correct init variable.
2020-09-13 00:46:28 -04:00
asarium cf4fe8accc Add Lua API for serializing values
This can be used by script code for reliably storing Lua values without
having to build a custom serialization format.

The C++ code can also be used by other code modules that want to
serialize data. The new classes simply return a byte array with an
unspecified format.

At the moment this uses a plain JSON encoding but could be extended in
the future to include either compression or BSON encoding if necessary.
The format is future compatible by using a simple header to identify
different kinds of formats.
2020-09-12 14:28:16 +02:00
Goober5000 e451ac5a96 updates 2020-09-12 00:58:48 -04:00
Goober5000 b96ff92671 update credits 2020-09-12 00:16:16 -04:00
Goober5000 ebe9694dd0 Merge pull request #2736 from Goober5000/fix_display_name
fix display name
2020-09-11 23:44:03 -04:00
Goober5000 09af27d194 fix display name
PR #2718 introduced the Has_display_name flag, but for mission parsing, the parse object flags were cleared subsequent to their assignment.  This moves the flag reset earlier in the function.
2020-09-11 21:03:37 -04:00
JohnAFernandez e29c172f27 Call send_ship before destroying it to avoid a crash. 2020-09-11 08:34:56 -04:00
Goober5000 0104a27795 clean up fiction viewer dialog a bit
Rampage noticed that the dialog would save a fiction viewer entry in some cases even if there was no story file.  This makes the handling a bit more robust.
2020-09-10 22:29:20 -04:00
Goober5000 daf890c080 Merge pull request #2728 from Goober5000/collision_hitpos
add Hitpos as a hook variable for all collision hooks
2020-09-10 12:09:25 -04:00
JohnAFernandez 332183d2e6 Fix declation of waypoint function so it can be used 2020-09-10 01:16:38 -04:00
Goober5000 d61b12bbf1 Merge pull request #2719 from Baezon/ai-store-slotnum
Store and reuse formation object slotnum
2020-09-09 20:47:47 -04:00
Goober5000 de0a9ca9c1 add Hitpos as a hook variable for all collision hooks
Also slightly optimizes some of the hooks because the adding/removing of hook variables should be guarded by the same if() block that controls execution.
2020-09-09 20:04:58 -04:00
Baezon 779ef46e22 s'more tweaks 2020-09-09 19:12:20 -04:00
Goober5000 41d6a46062 Merge pull request #2723 from Baezon/extern-camera-fixes
Two small fixes to the external camera
2020-09-09 14:37:34 -04:00
Goober5000 0cfd11f458 Merge pull request #2726 from Goober5000/fix_lab_ctd
fix a lab CTD
2020-09-09 14:36:58 -04:00
JohnAFernandez 1edf617537 Minor Refactor of Special Character Index Handling
1. Stores the filename from the table Parser into the font struct so we can lookup fonts via their filename.
2. Allow "+Special Character Font:" to specify the first entry with the same filename's special character index for their own special character index, provide a default if not, and allow the moddert to specify them manually, but do not override already recorded values if the default is picked in order to protect retail behavior.
3. Vectorize Special Character Indexes, so that we don't have a table limit that will randomly crash FSO based on what table you happened to write! Woohoo!
2020-09-09 09:05:15 -04:00
Goober5000 2b8687ff6a fix a lab CTD
Only ships have subobjects.
2020-09-09 02:24:50 -04:00
Goober5000 9476a68579 Merge pull request #2722 from scp-fs2open/revert-2706-Get-rid-of-LCL_MAX_FONTS-limitation
Revert "Change special_char_indexes to a vector"
2020-09-08 22:10:20 -04:00
Baezon 5586718e00 review tweaks 2020-09-08 22:05:52 -04:00
Baezon cb0f3461aa v1 2020-09-08 21:42:42 -04:00
Goober5000 c5c65a7031 Merge pull request #2720 from Goober5000/wing_formation_tweak
make wing formation parsing a little more robust
2020-09-08 20:21:59 -04:00
Goober5000 7c2e0ff01e Merge pull request #2718 from Goober5000/fix_zero_length_display_name
support zero-length display names
2020-09-08 20:21:39 -04:00
Goober5000 885e26feb0 Revert "Change special_char_indexes to a vector" 2020-09-08 20:20:21 -04:00
Goober5000 4bf6aaeddc make wing formation parsing a little more robust 2020-09-08 17:31:00 -04:00
Baezon bf4cc21951 v1 2020-09-08 03:05:42 -04:00
Goober5000 f6ca9cddfa support zero-length display names
Previously the code assumed that an empty display name was the same as no display name.  This adds a flag so that empty names are allowed.
2020-09-07 14:38:16 -04:00
Goober5000 4a218ab17a Merge pull request #2706 from JohnAFernandez/Get-rid-of-LCL_MAX_FONTS-limitation
Change special_char_indexes to a vector
2020-09-05 12:28:17 -04:00
Goober5000 0efe912daf Merge pull request #2710 from Goober5000/display_name_save_fix
don't save display name if it's auto-generated
2020-09-05 12:20:18 -04:00
Goober5000 2a77e8300d Merge pull request #2702 from Goober5000/prevent_duplicate_intel
prevent duplicate entries in the Intel room
2020-09-05 12:20:02 -04:00
Goober5000 9b750231d8 Merge pull request #2714 from Baezon/fix-formation-object
Fix a bug with form-on-wing on a object outside the wing
2020-09-05 03:30:17 -04:00
Goober5000 b51b03fca9 Merge pull request #2713 from Baezon/better-extern-camera
Add some quality of life improvements to external camera
2020-09-05 02:02:34 -04:00
Baezon 6e4ee916a0 aip->wingnum instead of shipp->wingnum 2020-09-05 01:38:53 -04:00
Baezon 62465a24f5 swap wingnum and index, moar MAX_SHIPS_PER_WING 2020-09-04 23:29:56 -04:00
Baezon c225cf7b90 autopilot argument 2020-09-04 23:09:59 -04:00
Baezon 303ee3fca1 const objp for object_get_model 2020-09-04 22:29:31 -04:00
Baezon d3eacb1a0f v1 2020-09-04 21:35:40 -04:00
Baezon c2cd958ce6 unused frame_times 2020-09-04 18:04:51 -04:00
Baezon 4df4987b81 v2 2020-09-04 17:36:53 -04:00
Goober5000 68888ef857 made this a little more robust 2020-09-04 13:34:32 -04:00
Goober5000 ceac6ddff2 add multi support for red-alert sexp
This makes the red-alert SEXP execute properly in multiplayer.

Note, this is just the SEXP.  Multi-knowledgeable people will need to evaluate `red_alert_start_mission` and `red_alert_maybe_move_to_next_mission` to make sure those functions will work properly in multiplayer.
2020-09-04 13:15:49 -04:00
Goober5000 1a32680440 patch tests 2020-09-04 01:12:20 -04:00
Goober5000 4e61c16bcd prevent duplicate entries in the Intel room 2020-09-04 01:12:20 -04:00
Goober5000 2f69429ba9 Merge pull request #2703 from Goober5000/audio_pause_unpause_for_f2
handle audio pause/unpause for all of the F2 screens
2020-09-04 00:55:03 -04:00
JohnAFernandez 50e6756bf7 Merge pull request #2707 from Goober5000/fix_mainhall_name
fix main hall indexing in modular tables
2020-09-04 00:32:02 -04:00
JohnAFernandez 69c0954198 Change special_char_indexes to a vector
LCL_MAX_FONTS is kept around just to facilitate parsing of the hardcoded table
2020-09-04 00:03:44 -04:00
Goober5000 b0776a3afa Merge pull request #2711 from asarium/fix/hookVars
Allow overwriting hook variables
2020-09-03 16:09:10 -04:00
Baezon f60e0950e7 v1 2020-09-03 15:24:49 -04:00
asarium 492fe461b0 Allow overwriting hook variables
The previous version used the wrong function for the map and so values
added later were not written to the map and so not available to Lua.

This fixes that by using the simple array operator.
2020-09-03 20:24:22 +02:00
Goober5000 774421a7f4 Merge pull request #2709 from notimaginative/fix_last_pilot_multi
properly set multi flag when using last multi pilot
2020-09-03 09:28:46 -04:00
Goober5000 4de0d8f7e9 don't save display name if it's auto-generated
Follow-up to PR #2674.  The auto-generated display name shouldn't be saved to the mission file.
2020-09-03 09:24:22 -04:00
Goober5000 2251ff5eb9 Merge pull request #2708 from Flip-Sandwich/master
removes int3 in turret firing code
2020-09-03 07:47:10 -04:00
faceman 96fd3889bc changes turret code to log instead of int3 when turret tries to fire on protected ship 2020-09-03 19:41:46 +10:00
Taylor Richards 51692f185b properly set multi flag when using last multi pilot
fixes following cmdline options:
 -connect
 -startgame
 -almission
2020-09-03 05:38:34 -04:00
Goober5000 ce3ca5cf0b Merge pull request #2701 from JohnAFernandez/Fix-miscelaneous-Multi-Bugs
Fix Two Multi Crash Points
2020-09-01 22:39:07 -04:00
Goober5000 9d15b2b02c fix main hall indexing in modular tables
This is a follow-up to #2675 which fixes the main hall naming for halls which have custom names and are not the first resolution.
2020-09-01 21:17:58 -04:00
JohnAFernandez 8bad12d8a2 Fix Two Multi Crash Points 2020-09-01 21:01:35 -04:00
Goober5000 0e1dfa7ab0 Merge pull request #2692 from Baezon/species-wing-positions
Allow for arbitrary wingmate relative positions
2020-09-01 14:38:23 -04:00
Goober5000 91502032e4 Merge pull request #2704 from chief1983/sun/gc-sections-workaround
Don't add --gc-sections linker arg on SunOS
2020-09-01 14:37:58 -04:00
Taylor Richards 3e04e955a4 fix build issues on FreeBSD 2020-09-01 14:36:10 -04:00
Goober5000 8964af428f Merge pull request #2705 from JohnAFernandez/Fix-Shockwave-Damage-Application
Fix 2526 and Add Two Game_setting.tbl flags
2020-09-01 09:02:54 -04:00
JohnAFernandez 6ba811ec6c Fix 2526 and Add Two Game_setting.tbl flags
Fixes 2526 by making the array a vector and also adds a Shockwaves always damage bombs game_setting.tbl setting and a Shockwaves_consistently_apply_damage game_settings.tbl setting.  The second one keeps bombs and asteroids from being hit more than once by shockwaves, like ships do!
2020-09-01 01:47:33 -04:00
Cliff 02cdcae848 gc-sections is misbehaving on SunOS since #2669, so skip the part that adds it to restore old behavior unless a proper fix can be found. 2020-08-31 21:09:07 -05:00
Goober5000 acb0c4cfd8 fix comment 2020-08-31 18:59:38 -04:00
Goober5000 48ea203b7b handle audio pause/unpause for all of the F2 screens
This is a follow-up to #2100.  Don't pause/unpause the audio if we are moving from/to the Control Config or HUD Config screens.  We could hit F2 and move around a bit before resuming the game, so we don't want the audio to resume until we're ready.
2020-08-31 18:02:28 -04:00
Goober5000 782898fba9 mmf 2020-08-31 16:59:58 -04:00
Goober5000 381df6eeb8 formation should now work in fred. 2020-08-31 16:21:30 -04:00
Goober5000 bf949f1ff0 move formations from species_defs.tbl to ships.tbl 2020-08-31 15:44:02 -04:00
Goober5000 9314781932 remove vestigial fred formation code (!) 2020-08-31 15:43:43 -04:00
Goober5000 d82dc93457 update fred dialog rc 2020-08-31 14:48:35 -04:00
Baezon a73c1de7b9 size_t MAX_SHIPS_PER_WING 2020-08-31 00:06:41 -04:00
Goober5000 a710aac4d4 Merge pull request #2593 from JohnAFernandez/Fix-Broken-Could-Be-Player_AI
Change MP Initial Player Wing Ship Behavior to Match SP
2020-08-30 22:01:53 -04:00
Goober5000 d5a7acc4a5 Merge pull request #2700 from Goober5000/more_vector_scripting
add some vector scripting functions
2020-08-30 13:26:45 -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
Goober5000 67ea05fefd add some vector scripting functions
createRandomVector
perturb (for vectors)
perturb (for matrixes)
randomInCircle
randomInSphere
2020-08-30 09:36:24 -04:00
Goober5000 2fee91cd4c Merge pull request #2674 from Goober5000/display_name
refactor display_name for ships, ship classes, and weapon classes
2020-08-30 09:21:32 -04:00
m!m 01f11470f3 Merge pull request #2699 from JohnAFernandez/Fix-Multi-Loadout-Bug
Fix the loadout memory bug
2020-08-30 14:55:44 +02:00
Baezon 1fc32dacf5 max ships in wing -1 instead of 5 2020-08-30 00:12:01 -04:00
Taylor Richards d30c0a2024 fix various errors from travis/appveyor 2020-08-30 00:03:14 -04:00
Taylor Richards ff01dc02a7 adjust data type to avoid header conflict 2020-08-30 00:03:14 -04:00
Taylor Richards e401f96cc3 add option to prefer IPv4 DNS addresses 2020-08-30 00:03:14 -04:00
Taylor Richards 9bb9aedc2a add a more robust filter for traffic from ourselves 2020-08-30 00:03:14 -04:00
Taylor Richards dd376b19d9 handle IPv4+IPv6 capable machines in a better way 2020-08-30 00:03:14 -04:00
Taylor Richards 52721dec06 report whether psnet socket is IPv6-only or dual-stack 2020-08-30 00:03:14 -04:00
Taylor Richards 459263b35f fix issues with reliable socket logging
- better error handling for ip string
 - port number in proper byte order
 - anonymize ip address
2020-08-30 00:03:14 -04:00
Taylor Richards 72dd631520 anonymize logged IP addresses 2020-08-30 00:03:14 -04:00
Taylor Richards 83d6d0fd53 bind psnet socket to any address
fixes issue where an IPv6 internet connection would fail
to connect properly if socket is only bound to a local
IPv4 interface
2020-08-30 00:03:14 -04:00
Taylor Richards 3e1b90b8c2 support IPv6 servers from game tracker 2020-08-30 00:03:14 -04:00
Taylor Richards 01ee4d077b make sure we are dual-stack by default (everywhere else) 2020-08-30 00:03:14 -04:00
Taylor Richards 90dbc8f2c3 deal with compiler errors and warnings on Windows 2020-08-30 00:03:14 -04:00
Taylor Richards 426b032882 clean up broadcast_game_query() 2020-08-30 00:03:14 -04:00
Taylor Richards e5044ee6ec port cftp to IPv6 2020-08-30 00:01:00 -04:00
Taylor Richards cff9cdc57d port chttpget to IPv6 2020-08-30 00:01:00 -04:00
Taylor Richards e06026f622 port PXO chat client to IPv6 2020-08-30 00:01:00 -04:00
Taylor Richards db0d0efd55 port PXO tracker client code to IPv6 2020-08-30 00:01:00 -04:00
Taylor Richards 92be33ad9c first pass at IPv6 support 2020-08-30 00:01:00 -04:00
Goober5000 46f410b921 Merge pull request #2698 from EatThePath/free-flight-rename
Renamed free flight speed related tag and variable for clarity and safety
2020-08-29 21:51:26 -04:00
Baezon 518c60dd08 review fixes 2020-08-29 21:50:42 -04:00
JohnAFernandez 143ce0da44 Fix the loadout memory bug 2020-08-29 21:34:02 -04:00
Goober5000 c3febbe01b Merge pull request #2687 from Goober5000/various_colgroup_fixes
various collision group fixes
2020-08-29 18:11:55 -04:00
Goober5000 f756b2a353 Merge pull request #2686 from Baezon/axial-turnrate-differences
Add "$respect ship axial turnrate differences:" flag (and fix a bug with 2673)
2020-08-29 16:49:14 -04:00
Baezon 67d1135c4f cast size() to int 2020-08-29 14:48:37 -04:00
Goober5000 8f7fcc0387 Merge pull request #2683 from TaGenius/feature/qtShipedit
Add ShipEditor to QtFred
2020-08-29 14:34:14 -04:00
Baezon 0aa0c80af8 more than one formation 2020-08-29 14:32:49 -04:00
David Gibson c38b989bb7 Renamed free flight speed related tag and variable for clarity and safety 2020-08-29 13:20:51 -05:00
Goober5000 6f774ccab1 various collision group fixes
Collision groups as previously coded were unusable due to Lua 5.1's lack of support for bitwise operators.  This fixes that deficiency in two ways:
1) Objects now have the functions `addToCollisionGroup` and `removeFromCollisionGroup`
2) An `evaluateNumericSEXP` function has been added for returning SEXP results as numbers (so that the bitwise SEXP operators can be used)
2020-08-29 13:49:36 -04:00
Goober5000 3d734948da Merge branch 'master' into display_name 2020-08-29 13:47:21 -04:00
Goober5000andm!m 05044290df Update code/scripting/api/objs/ship.cpp
Co-authored-by: m!m <[email protected]>
2020-08-29 13:45:30 -04:00
m!m 415151fddc Merge pull request #2641 from EatThePath/free-flight-restoration
Restoring the free flight speed missile table value to functioning
2020-08-29 17:10:07 +02:00
m!m 6953c6a3f5 Merge pull request #2585 from asarium/build/improvePCH
Add pstypes.h to precompiled header
2020-08-29 16:46:55 +02:00
m!m 382f2bdcd2 Merge pull request #2678 from asarium/lua/betterHookVars
Improve scripting hook variable system
2020-08-29 14:20:11 +02:00
Fabian Woltermann 44345fd71c Merge pull request #2696 from The-E/fix/light_from_turret_fired_weapons
Allow non-beam weapons fired from capships to cast lights
2020-08-29 12:54:34 +02:00
asarium b6dc287427 Add pstypes.h to precompiled header
At least on my system that saved ~25% of the compile time (2:01 to 1:33)
so it appears that this is indeed something that help compile
performance.

Also does some house cleaning by using the new PCH command of CMake if
it is available which reduces our dependencies.
2020-08-29 11:26:16 +02:00
asarium 2303785717 Improve scripting hook variable system
The previous system was kind of hacky and made things a bit inflexible.
This improves that system quite a bit and also adds unit tests for the
hook variable functionality.
2020-08-29 10:27:41 +02:00
Fabian Woltermann b01c6d2a82 Weapons fired from turrets have their group_id set to -1 by default and thus would never actually cast any lights 2020-08-29 09:05:08 +02:00
Fabian Woltermann 4f27585878 Merge pull request #2695 from Goober5000/debris_list_fix
handle Hull_debris_list for dynamic debris
2020-08-29 09:04:45 +02:00
Goober5000 d7d986f920 a bit of cleanup, and we only need to run the soft limit check once 2020-08-29 00:28:05 -04:00
Goober5000 eefbc543a0 handle Hull_debris_list for dynamic debris
With dynamic debris, as soon as the Debris vector was reallocated it invalidated the `prev` and `next` pointers.  I figured out how to dispense with the actual list entirely, since we mainly need to know how many hull debris pieces there are and whether an individual piece is on the "list".

This is a follow-up to #2649.
2020-08-29 00:18:39 -04:00
Goober5000 32cad9c1ec Merge pull request #2694 from Goober5000/more_debris_sounds
add more debris sounds
2020-08-28 17:49:45 -04:00
Goober5000 bdf7b23c3a Merge pull request #2693 from Goober5000/case_insensitive_sound_lookup
make sound lookup case-insensitive
2020-08-28 14:33:57 -04:00
Goober5000 1913d8cde2 add more debris sounds
Sounds for debris collision and explosion.
2020-08-28 12:50:40 -04:00
Goober5000 20913a5a90 Merge pull request #2675 from Goober5000/main_hall_override
add the ability to override main halls with modular tables
2020-08-28 11:44:37 -04:00
Goober5000 41df46a14e make sound lookup case-insensitive 2020-08-28 10:32:24 -04:00
Goober5000 9816a80b66 Merge pull request #2681 from Goober5000/more_for_counter_sexps
add for-ship-team and for-ship-species sexps
2020-08-28 09:49:03 -04:00
Goober5000 71ce8229d5 Merge pull request #2682 from Goober5000/fix_name_alignment
fix alignments in the hud gauge parsing
2020-08-28 09:37:29 -04:00
Baezon c1a2cc3959 v1 2020-08-28 00:50:49 -04: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 2501b178d7 squash flag arguments and handle formation flying better 2020-08-27 16:50:55 -04:00
Goober5000 64f7b19ca0 Merge pull request #2690 from TRBlount/fix/multilock_ai_lock_set
Properly fix #2685
2020-08-27 16:38:16 -04:00
Cranston 2a669de730 Fix Clang
SOme More

Maybe The Last?

Workaround for false positive
2020-08-27 21:21:11 +01:00
Cranston f08433c106 More Linux FIxes and Name Labels/Layouts
Why is GCC So Fussy?
2020-08-27 21:20:53 +01:00
Cranston 2f4e052cd8 Main Dialog Complete
Try and Fix non windows compile errors

Fix Linux complete error(Hopefully)

More Linux fixes

Nearly There

Maybe?

Why were these in the original? They're never used?
2020-08-27 21:20:04 +01:00
Cranston 697eba8389 Add All form controls 2020-08-27 21:20:00 +01:00
Cranston 7af1eefa2b Enable/Disable Ship UI 2020-08-27 21:19:59 +01:00
Cranston eba1bd9fe6 Initial QTFred Ship Editor
Initial QTFred Ship Editor. Ui is nearly done first column has it core code
2020-08-27 21:19:59 +01:00
Goober5000 82292e4e2b Merge pull request #2679 from Goober5000/misc_enhancements
miscellaneous scripting and ship-destruction enhancements
2020-08-27 13:54:26 -04:00
Goober5000 321a67521f Merge pull request #2684 from Goober5000/some_fred_tweaks
Some fred enhancements
2020-08-27 13:54:10 -04:00
Tyler Blount a8148940be Properly fix #2685 2020-08-27 11:08:31 -06:00
Goober5000 1ce3680259 Merge pull request #2688 from TRBlount/fix/multilock_ai_lock_set
Set ai_info lock variable if the player has any lock slots firing
2020-08-27 12:59:17 -04:00
Tyler Blount c2e9c99ab5 Set ai_info lock variable if the player has any lock slots firing 2020-08-27 00:22:37 -06:00
Goober5000 19922ebf77 put the monitor tracing statements in a better spot 2020-08-27 01:35:02 -04:00
Baezon 6476596b7e less sips, adjusted slow_bank 2020-08-27 00:21:33 -04:00
Baezon 9abc253023 v1 2020-08-26 23:27:34 -04:00
Goober5000 5c19aebf16 add cloning in-place 2020-08-26 00:21:30 -04:00
Goober5000 ef93caa87c update menus, clarify some help stuff, reorder some stuff, get the dock move option working 2020-08-25 18:05:07 -04:00
Goober5000 d8c29faf1b let's try it this way 2020-08-25 17:15:10 -04:00
Goober5000 a606731c40 shut up, clang 2020-08-25 15:11:23 -04:00
Goober5000 1deaa36e07 fix alignments in the hud gauge parsing
Admiral Nelson led me to discover that the HUD gauges expected "right" or no string at all for the gauge alignment.  I added basic recognition of LEFT and RIGHT alignment.  Someone more familiar with the HUD than me can flesh it out more.
2020-08-25 14:52:56 -04:00
Goober5000 a3c32d929f add for-ship-team and for-ship-species sexps
This builds on the previous for-ship-class and for-ship-type sexps.
2020-08-25 13:25:42 -04:00
Goober5000 a19e163a32 Merge pull request #2680 from Baezon/epsilon-fix
Fix usage of float instead of int epsilon
2020-08-25 12:26:37 -04:00
Baezon 8ac2568a7b derp 2020-08-25 00:46:00 -04:00
Goober5000 13bb92348f Merge pull request #2640 from Baezon/orthogonalize
Improve vm_orthogonalize_matrix safety
2020-08-25 00:42:25 -04:00
Goober5000 afc2e51327 Merge pull request #2668 from Baezon/forward-matrix-interpolate
Overhaul forward and matrix_interpolate
2020-08-25 00:40:50 -04:00
Baezon dc413f2168 history comments 2020-08-24 01:01:37 -04:00
Baezon 32665e0028 overshoot padding 2020-08-24 00:50:42 -04:00
Baezon 132bcda055 comments for old names 2020-08-24 00:50:42 -04:00
Baezon 338e049cb1 renaming of functions 2020-08-24 00:50:42 -04:00
Baezon 29b30ab7ad just about ready 2020-08-24 00:50:42 -04:00
Baezon d5b70260e7 almost there 2020-08-24 00:50:00 -04:00
Baezon 0fada393fc wip
version 1

version 2
2020-08-24 00:50:00 -04:00
Baezon c5cf8621a2 expose maybe_normalize and use machine epsilon 2020-08-24 00:11:20 -04:00
Goober5000 d8012d4ff0 miscellaneous scripting and ship-destruction enhancements 2020-08-23 20:44:25 -04:00
David Gibson 69b5f3feb1 Addressed review feedback 2020-08-23 17:23:19 -05:00
Goober5000 2444115b80 Merge pull request #2673 from Baezon/ai-turning-fix
Fix AI banking when in formation
2020-08-23 16:56:32 -04:00
Goober5000 114b0198c3 Merge pull request #2676 from TRBlount/fix/heat_subsys_target
Set target info correctly if the weapon is a HEAT seeker
2020-08-23 16:41:05 -04:00
Goober5000 7bd46265ec Merge pull request #2677 from Goober5000/hook_variable_tweak
temporary hack to increase flexibility of hook variables
2020-08-23 16:21:43 -04:00
Goober5000 788245c33c temporary hack to increase flexibility of hook variables
This allows the coder to test for the existence of a hook variable by comparing it to `nil`.  The engine will currently error out and crash if you try to access a nonexistent table field, which is useful for catching typos, but has the disadvantage of disallowing a perfectly reasonable Lua coding practice.  So this change checks whether the missing field is part of `HookVariables`, and if so, rather than throwing an error, it just prints a message to the log.
2020-08-23 14:18:10 -04:00
Tyler Blount 85a0e92a4f Set target info correctly if the weapon is a HEAT seeker 2020-08-22 22:22:58 -06:00
Goober5000 77bac7a10f Merge pull request #2586 from Baezon/swamers-lead
Add '$Swarmers Lead Targets:' to game_settings.tbl
2020-08-22 08:38:28 -04:00
Fabian Woltermann 1012420370 Merge pull request #2664 from asarium/vulkan/mooooooreSetup
Add more Vulkan setup code
2020-08-22 11:10:14 +02:00
Goober5000 fc786b0473 Merge branch 'master' into swamers-lead 2020-08-21 22:50:25 -04:00
Goober5000 8999a9d633 add the ability to override main halls with modular tables
This adds full modular table support to mainhall.tbl, allowing subsequent tables to override previous main halls, and enabling use of the +nocreate option.
2020-08-21 20:56:59 -04:00
Goober5000 ea32b7ba2e Merge pull request #2667 from Goober5000/overlay_bump
make help overlays dynamic
2020-08-21 19:47:31 -04:00
Goober5000 0bfe80a4ec NULL to nullptr 2020-08-21 11:55:09 -04:00
Goober5000 6c1d29c3ed Merge pull request #2672 from rfht/master
clang 10 build: fix std::unique_lock<Mutex>::unique_lock syntax
2020-08-21 11:48:45 -04:00
Goober5000 10d2f8001c qtfred 2020-08-21 01:03:33 -04:00
Goober5000 3b2af702f7 refactor display_name for ships, ship classes, and weapon classes
Several things going on here:
1) refactor `get_display_string()` to `get_display_name()` to be more precise
2) likewise, refactor `alt_name` to `display_name`
3) automatically generate display names when parsing the ship, ship class, and weapon class for the first time
4) remove the on-the-fly truncation of names with hash symbols

Basically this subsumes the `end_string_at_first_hash_symbol` logic into the display name.  Rather than truncate the name every time it's displayed, truncate it once when it's parsed.  This takes advantage of the previous display name infrastructure, since display names are a superset of the case of truncating the hash symbol.

This also has the benefit of now allowing hash symbols within display names.  When updating Destiny of Peace, I noticed that "Lockheed Shuttle #4" would no longer display properly; and it was not previously possible to fix this even with display names.

I could pull out the `get_display_string()` and `alt_name` renaming into a separate PR if desired.
2020-08-21 00:15:38 -04:00
Baezon ad6e5f9289 nullptr 2020-08-21 00:06:34 -04:00
Baezon 2d1325c9d2 clean up unused variables 2020-08-20 21:28:59 -04:00
Baezon 0857f67875 v1 2020-08-20 20:50:04 -04:00
thfrwn 55a388f96b try_lock -> try_to_lock to fix clang 10 build 2020-08-20 11:37:44 -06:00
asarium fbdb25a10d Add more Vulkan setup code
This adds the Vulkan code for choosing a physical device, creating a
logical device from that and then initializing a swap chain.

This also contains code for filling out the graphics API pointers with
stub functions so that the API functions can be developed gradually.
These changes allow FSO to "run" with Vulkan but nothing is rendered
yet.
2020-08-20 19:08:02 +02:00
m!m 72a853cd39 Merge pull request #2669 from asarium/build/incrementalLinking
Improve Linux linking performance
2020-08-20 19:02:07 +02:00
MageKing17 148392023f Merge pull request #2670 from MageKing17/cleanup/hudartillery-parse-error-reporting
Improve error reporting related to SSM strikes.
2020-08-19 21:21:28 -07:00
Goober5000 b66620e974 Merge pull request #2671 from TRBlount/fix/multilock_snd_loop
Fix missile track loop playing infinitely
2020-08-19 23:57:03 -04:00
Tyler Blount 70bf31fbf6 Fix missile track loop playing infinitely 2020-08-19 20:20:26 -06:00
MageKing17 54f276c6be Improve error reporting related to SSM strikes.
First, in hudartillery.cpp, change some errors to warnings (actually error_display(1, ...) to error_display(0, ...), but same difference).

Second, change a Warning to an error_display(0, ...), and make it actually name the SSM strike instead of just reporting the name of the weapon it's using.

Third, do the weapon_info_lookup() earlier so we can use error_display() to point to the right line, and tell the modder that an invalid weapon invalidates the entire SSM strike (instead of just silently discarding the whole thing at the end).

Finally, in weapons.cpp, change validate_SSM_entries() to mention if Ssm_info is empty (instead of, say, telling the modder that the index needs to be between 0 and 4294967295—or, rather, -1 expressed as an unsigned 32-bit integer, since Ssm_info.size() - 1 is, indeed, -1 when the vector is empty).
2020-08-19 17:08:02 -07:00
asarium 5e1615da58 Improve Linux linking performance
This does two things:
 1. Use thin archives which speeds up static library creation by only
    storing references to the object files instead of copying them all
 2. Allow to use the gold linker with GCC along with an option for
    incremental linking. Since this is undesirable for non-development
    builds it is disabled by default.
2020-08-19 21:16:36 +02:00
Goober5000 0a35d257ca Merge pull request #2665 from TRBlount/fix/multilock_banks
Don't trigger ship_start/stop_secondary_fire assert on empty bank
2020-08-19 14:54:31 -04:00
Tyler Blount 1edba8d795 Handle empty banks correctly 2020-08-19 11:11:13 -06:00
Goober5000 cb76db0402 Merge pull request #2663 from Goober5000/intel_stuff
make Intel stuff dynamic
2020-08-18 19:42:06 -04:00
Goober5000 abed6f503e make help overlays dynamic
With a lot of main hall entries, the MAX_HELP_OVERLAYS limit will get hit.  Pretty simple to just make it dynamic.
2020-08-18 17:12:51 -04:00
Goober5000 8ff676ab1b Merge pull request #2612 from JohnAFernandez/Fix-Client-MP-Campaign-Crash
Patch a Crash Point
2020-08-18 15:10:06 -04:00
Goober5000 9144e161de address feedback and fix tests 2020-08-18 14:53:01 -04:00
Goober5000 88d397a6fc test stuff 2020-08-18 14:53:01 -04:00
Goober5000 1534cc9b2e and fred 2020-08-18 14:53:01 -04:00
Goober5000 b6998a3e21 make Intel stuff dynamic
1) Make Intel_info a vector instead of a fixed-size array
2) Make intel descriptions SCP_string so they can be any length
2020-08-18 14:53:01 -04:00
Goober5000 097b7714a2 Merge pull request #2666 from Goober5000/localization_fix
synchronize localization
2020-08-18 14:52:17 -04:00
Goober5000 e5dec42773 fix tests 2020-08-17 22:03:36 -04:00
Goober5000 cc9733760d match case-insensitive comparison 2020-08-17 21:25:25 -04:00
Goober5000 012ec2ac7a fix localization synchronization
Back in PR #2390, I fixed translation behavior in `lcl_ext_localize_sub` for SCP_string, but neglected to also fix it for `char*`.  This PR remedies that.

I also added `!=0` to the string compare to match the `!=0` used with `strcmp`.
2020-08-17 21:10:48 -04:00
Tyler Blount 4e5631ef70 Merge pull request #2660 from scp-fs2open/revert-2658-revert-2652-update_dds_utils
Revert "Revert "Update DDS Utilities to DX10 Standard""
2020-08-17 16:55:28 -06:00
Goober5000 bedc199dbd Merge pull request #2662 from Goober5000/dockpoint_warning
add warning for duplicate dockpoints
2020-08-17 13:11:06 -04:00
wookieejedi 5c1d49b561 Merge pull request #2622 from Baezon/second-order-lead
Allow for second-order lead indicator prediction
2020-08-17 12:49:44 -04:00
Goober5000 8f469dd00c add warning for duplicate dockpoints
Just for sanity's sake.  This just displays a Warning without modifying the dockpoint name.  I considered an nprintf but figured a Warning was more appropriate.
2020-08-17 00:49:23 -04:00
Tyler Blount 0b3ba445ea Fix WinAPI warnings 2020-08-16 17:35:31 -06:00
Tyler Blount c3c323acd6 Revert "Revert "Update DDS Utilities to DX10 Standard"" 2020-08-15 14:13:11 -06:00
m!m 4362af668a Merge pull request #2656 from asarium/build/optionalOpenGL
Make the OpenGL backend an optional component
2020-08-15 22:06:55 +02:00
Tyler Blount d789be22e3 Merge pull request #2658 from scp-fs2open/revert-2652-update_dds_utils
Revert "Update DDS Utilities to DX10 Standard"
2020-08-15 12:54:11 -06:00
Tyler Blount 5779117e30 Revert "Update DDS Utilities to DX10 Standard" 2020-08-15 12:52:25 -06:00
Tyler Blount 82280b472b Merge pull request #2652 from TRBlount/update_dds_utils
Update DDS Utilities to DX10 Standard
2020-08-15 12:47:49 -06:00
Goober5000 d284ba7241 Merge pull request #2657 from Goober5000/ship_create_protecc
ship-create protecc
2020-08-15 13:16:20 -04:00
m!m bac4d07469 Merge pull request #2655 from asarium/fix/adeDocMemLeak
Fix memory leak in scripting documentation
2020-08-15 12:41:46 +02:00
Tyler Blount 376e67b9ce Fix CI errors 2020-08-14 15:30:06 -06:00
Goober5000 1f4ff04890 handle SEXP_NAN_FOREVER 2020-08-14 16:25:11 -04:00
Goober5000 e4cd5675d0 handle SEXP_KNOWN_* 2020-08-14 15:53:02 -04:00
Tyler Blount ccb6bdc08d Make capability system outputs user friendly 2020-08-14 13:15:47 -06:00
Tyler Blount d35199e5bb Add system for checking mod required rendering features 2020-08-14 11:58:38 -06:00
asarium 4568172287 Make the OpenGL backend an optional component
This can be used for producing even leaner builds for standalone
servers. It also provides a nice architecture verification since now
using internal OpenGL functions will cause a compilation or linking
failure.
2020-08-14 18:52:14 +02:00
asarium dc0e5713e3 Fix memory leak in scripting documentation 2020-08-14 18:38:22 +02:00
Tyler Blount 613913f10f Fix clang-tidy errors 2020-08-14 10:35:28 -06:00
Goober5000 c099ca1abc Merge pull request #2654 from Goober5000/luasexp_soundentry
add LuaSEXP support for soundentry (OPF_GAME_SND)
2020-08-14 11:45:43 -04:00
Goober5000 49e6289d38 Merge pull request #2653 from Goober5000/buffer_fix
use SCP_string instead of fixed buffer
2020-08-14 11:43:49 -04:00
Goober5000 b6b7487db1 add LuaSEXP support for soundentry (OPF_GAME_SND) 2020-08-14 01:18:34 -04:00
Goober5000 8cde06370a Merge pull request #2634 from Baezon/species-class-multilock
Allow multilock missiles to restrict lock based on class or species
2020-08-14 00:46:55 -04:00
Goober5000 cf42e1db68 use SCP_string instead of fixed buffer
With very long mods, this error message can overflow the buffer.  So I changed it to a SCP_string.
2020-08-14 00:07:16 -04:00
Tyler Blount 94f3e1ec77 BC7 now loads correctly
Includes changes to bitmap flags and compiler related fixes
2020-08-13 21:51:11 -06:00
Tyler Blount 2ba7e339b5 Update GLAD and remove old headers 2020-08-13 21:51:11 -06:00
Tyler Blount 2ddfa00670 Add DX11 DDS Header information 2020-08-13 21:51:11 -06:00
Goober5000 ca73feb36b Merge pull request #2651 from Goober5000/for_ship_class
add for-ship-class and for-ship-type sexps
2020-08-13 22:16:59 -04:00
Goober5000 e01c799cc1 Merge pull request #2649 from Goober5000/debris_enhancements
Debris enhancements
2020-08-13 14:21:16 -04:00
Goober5000 de8164aa9c add for-ship-class and for-ship-type sexps
These sexps work just like for-counter, supplying arguments for when-argument.  They will list all ships that are present in the mission and are of a certain class or type.
2020-08-13 14:15:25 -04:00
Goober5000 51ea05068e make the no-disappear flag really prevent the subobject from being blown off, as opposed to blowing it off and then restoring it 2020-08-13 00:38:10 -04:00
Goober5000 2dec0af410 add code to tell if debris is one of those tiny models
make Debris dynamic, and use a soft limit at 64 pieces (the old MAX)
add per-class specification of death roll sounds
2020-08-12 23:51:39 -04:00
Baezon 1f62919a46 cleaner temp lists 2020-08-12 20:56:19 -04:00
m!m 6c3dc57ce4 Merge pull request #2645 from asarium/rocket/moreCmdBriefApis
Add more scripting APIs for the command briefing
2020-08-12 15:41:01 +02:00
asarium 8d8f304514 Add more scripting APIs for the command briefing
This covers the various APIs needed for getting the last parts of the
new command briefing UI to work.
2020-08-12 09:43:09 +02:00
m!m 72bd948852 Merge pull request #2648 from asarium/fix/unbalancedLuaStack
Fix various issues of an unbalanced Lua stack
2020-08-12 09:38:10 +02:00
m!m e9d193f12e Merge pull request #2644 from asarium/scripting/customExecutionContext
Add scripting API for custom execution context
2020-08-12 09:37:50 +02:00
Goober5000 74a8e4b6aa Merge pull request #2639 from Goober5000/secondary_bank_fix
fix crash from multilock merge
2020-08-11 12:55:55 -04:00
asarium b94f12092b Fix various issues of an unbalanced Lua stack
This fixes three issues where the Lua stack was not cleaned up properly:
- On hook execution, the return value was left on the stack
- For ADE initialization, the global tables were left on the stack
- In libRocket, a metatable was left on the stack
2020-08-11 09:45:25 +02:00
asarium 8fcb05bfd0 Add scripting API for custom execution context
This allows a script to create its own execution context so that it can
control when a coroutine is valid to play based on custom data.

Also adds a function which causes a coroutine to end in an error.
2020-08-11 09:38:39 +02:00
Goober5000 be472686f2 Merge pull request #2647 from Goober5000/fireball_filenames
clean up fireball filename init
2020-08-11 02:44:32 -04:00
Goober5000 85d57f56fc Merge pull request #2646 from Baezon/no-black-void
Banish the Black Void
2020-08-11 01:17:48 -04:00
Goober5000 8a607369be clean up fireball filename init
GCC 10.1.0 complained about the filename overwriting itself in the old version of the code.  This was a false positive, but the code wasn't terribly clear, so I cleaned it up a bit.
2020-08-10 22:57:27 -04:00
Baezon 666c2a4402 bool valid vec 2020-08-10 22:31:44 -04:00
Baezon c1942c5359 bool! not int 2020-08-10 22:15:54 -04:00
JohnAFernandez c512eea234 Set Campaign Type For Multiplayer Clients
This allows us to correctly check for campaign type if needed and fixes a variable bug.
2020-08-10 21:27:20 -04:00
Baezon 73d64d9460 review changes 2020-08-10 21:23:27 -04:00
Baezon 573c8b8892 bool return 2020-08-10 19:50:40 -04:00
Baezon d48559d455 double the doubles 2020-08-10 19:09:17 -04:00
m!m 3e7868b663 Merge pull request #2643 from asarium/lua/fixSkipArgs
Capture Ade skip arguments locally
2020-08-10 21:48:55 +02:00
m!m 3596ec5820 Merge pull request #2637 from asarium/build/luaApiExport
Enable dllexport for Lua API
2020-08-10 21:48:32 +02:00
Baezon d92c7a8ea3 doubles for inverting 2020-08-10 15:02:12 -04:00
David Gibson c432c1cce1 Reinstituted freeflight speed parsing and implemented it's use. 2020-08-10 11:18:44 -05:00
Goober5000 514ca1bda9 Merge pull request #2642 from Goober5000/debris_ambient
Several small sound-related enhancements
2020-08-10 09:50:14 -04:00
m!m 4272c2eea5 Merge pull request #2636 from asarium/rocket/scrollingText
Add scrolling text element for libRocket
2020-08-10 12:04:34 +02:00
asarium 31dfa49ebc Capture Ade skip arguments locally
These variables can be used for changing the behavior of the ade_ API
functions. However, they apply to all the ade_get calls so if there is a
call to ade_get_args from an ade_get_args call then it will reuse the
previously set values and produce incorrect results.

This captures those variables as soon as possible and then resets them
so that subsequent calls start with the default values for those
variables.
2020-08-10 09:39:08 +02:00
asarium f12a8ff432 Add scrolling text element for libRocket
This emulates the "scrolling text" effect that is present in briefings.
It is not exactly the same since it just goes pixel wise and not by
character but it looks good enough.
2020-08-10 09:38:30 +02:00
Goober5000 b419d3fac5 Merge pull request #2632 from EatThePath/fix-freeflight
Restored retail-like handling of speed during freeflight time.
2020-08-09 21:34:30 -04:00
Goober5000 00e1a5fcba add collision sounds 2020-08-09 16:58:38 -04:00
Goober5000 83d9d352ff Merge pull request #2604 from Baezon/consistent-apply-whack-args
Supply world coordinates in whack function calls
2020-08-09 15:32:41 -04:00
Goober5000 c9fcbb10da Merge branch 'master' into swamers-lead 2020-08-09 13:53:07 -04:00
Goober5000 e3368be15c Merge pull request #2635 from chief1983/update/libRocket
update/libRocket: Update libRocket to latest master.
2020-08-09 13:03:38 -04:00
Baezon 7e42b36d4a nullptr 2020-08-08 23:26:21 -04:00
Baezon 2b92e10e15 clean up 2020-08-08 21:58:40 -04:00
Baezon 48313c826f v2 2020-08-08 21:16:43 -04:00
m!m 95ebb62de5 Merge pull request #2638 from asarium/lua/audioStreamApi
Add generic audio stream API
2020-08-08 22:22:49 +02:00
Baezon c8cb3d45fc orthogonalize safety 2020-08-08 15:55:33 -04:00
Goober5000 a1a0bd3e0e fix crash from multilock merge
After the multilock PR #2207, ships without secondary weapons will crash the game.  This can easily be seen in the very first training mission of the FS2 main campaign, and it is due to an invalid bank access in `ship_stop_secondary_fire`.  The `current_secondary_bank` is 0, but there are 0 secondary banks.  The Assert catches this, but that's not enough.

This change fixes the crash, as it initializes the current banks to -1 instead of 0.  However I'm not familiar with the new multilock way of doing things so I can't say if that is correct in all cases.
2020-08-08 13:50:31 -04:00
Goober5000 06c6434d44 debris ambient sounds, optional ship sounds, begin collision sounds 2020-08-08 13:49:06 -04:00
asarium 1001bfb760 Add generic audio stream API
The previous API only allowed very limited access to the audio stream
system. These changes add full support for playing all types of audio
streams via a dedicated API.
2020-08-08 19:36:39 +02:00
asarium 646a5d60f8 Enable dllexport for Lua API
This allows external libraries to load the Lua API from our executable
even if it is linked statically. This is useful for a Lua debugger which
needs to interact with the Lua API.
2020-08-08 18:00:52 +02:00
Baezon 847f3229e0 gonna be here all night 2020-08-08 00:48:28 -04:00
Baezon 5a89cac8d1 more c++ 11 2020-08-08 00:21:57 -04:00
Baezon 314e231778 c++ 11-ify 2020-08-08 00:00:38 -04:00
Baezon 6927b5cef1 objectify 2020-08-07 23:28:43 -04:00
Cliff Gordon 5e168bee5f update/libRocket: Update libRocket to latest master. 2020-08-07 09:20:41 -05:00
Baezon ededcd8156 v1 2020-08-07 03:20:26 -04:00
Goober5000 fb4b71c935 Merge pull request #2613 from Baezon/ai-before-physics
Add 'Process AI before Physics' flag
2020-08-06 23:22:58 -04:00
Baezon 860423b577 wip 2020-08-06 20:48:16 -04:00
David Gibson 9ec972f9c4 Restored retail-like handling of speed during freeflight time. 2020-08-05 18:15:03 -05:00
Goober5000 fa6f996827 Merge pull request #2594 from JohnAFernandez/Keep-Connectionless-Players-Out-Of-Multi
Keeps players From Accessing Multi Screens When No Connection Available.
2020-08-05 14:45:05 -04:00
Goober5000 6ac9161469 Merge pull request #2611 from notimaginative/libpcp_solaris
Changes for libpcp to work on Solaris/OpenIndiana
2020-08-05 14:41:35 -04:00
Goober5000 67f4b53c12 Merge pull request #2599 from JohnAFernandez/Fix-Connecting-To-Non-PXO-Games-Specific
Fix Non-Standalone Servers Failing to Switch Between PXO and Non-PXO
2020-08-05 14:40:42 -04:00
m!m 0a970690ec Merge pull request #2623 from asarium/scripting/redAlertMission
Add Lua function for checking for a red alert mission
2020-08-05 18:31:33 +02:00
Baezon b4ec1b32ba better subtype determiner 2020-08-05 01:54:47 -04:00
Baezon 1e56ad942c clarity comment 2020-08-05 01:40:07 -04:00
Baezon f2dae734a3 better comment 2020-08-04 15:41:03 -04:00
Baezon 5b6c7f5d64 assertions
and also if the object isnt a ship it should bail before trying to index Ships[] or compare to MAX_SHIPS
2020-08-04 14:44:32 -04:00
Goober5000 38a3679f37 Merge pull request #2621 from Goober5000/luasexp_modification
add the ability to use multiple sexp parameter variants
2020-08-04 13:57:50 -04:00
asarium 8e108f7745 Add Lua function for checking for a red alert mission
Also fixes a bug in the function that is used by the libRocket pilot
selection UI.
2020-08-04 17:28:01 +02:00
Goober5000 10d98f38bd Merge pull request #2618 from The-E/fix/init_aa_preset_correctly
Make sure gr_aa_preset_last_frame is initialized correctly
2020-08-04 01:20:28 -04:00
Goober5000 d47c4ebff5 Merge pull request #2620 from EatThePath/wep-limit-bump
increased weapon type limit from 300 to 500, matching ship class limit
2020-08-04 01:19:53 -04:00
Baezon fd1204e491 version 2 2020-08-04 00:30:10 -04:00
Baezon c9784bc538 version 1 2020-08-03 23:57:45 -04:00
wookieejedi d411bc9c2d Merge pull request #2619 from wookieejedi/add-extra-primary-link-check
Fix Missing Check for Primary Linking
2020-08-03 22:54:26 -04:00
Goober5000 0ed13a69e7 add the ability to use multiple sexp parameter variants
This is specifically for OPF_SHIP.  Currently if you specify a LuaSEXP with OPF_SHIP, it only works for ships that are present in the mission when the SEXP is called.  This is my attempt at a LuaSEXP parameter variant that will return a valid ship name regardless of the ship status.  It required a bit of finagling the existing API.
2020-08-03 21:26:39 -04:00
David Gibson b601065328 increased weapon type limit from 300 to 500, matching ship class limit 2020-08-03 15:15:23 -05:00
Goober5000 d9b4fab691 Merge pull request #2615 from Goober5000/colgroup2
add new versions of the collision group sexps
2020-08-03 16:13:56 -04:00
wookieejedi eaa419610f Fix Missing Check for Primary Linking
Previously, `ai_link_energy_levels_always` or `ai_link_ammo_levels_maybe` could allow a ship to link weapons even if the `No_primary_linking` flag was setfor that ship. This PR fixes that by added a check for `No_primary_linking` before `ai_link_energy_levels_always` or `ai_link_ammo_levels_maybe` is evaluated.
2020-08-03 16:00:42 -04:00
Tyler Blount bb8bc3b773 Merge pull request #2617 from TRBlount/fix/multilock_snd_banks
Fix for #2616
2020-08-03 11:53:30 -06:00
Fabian Woltermann 657c3b55e2 Make sure gr_aa_preset_last_frame is initialized correctly 2020-08-03 19:46:48 +02:00
Tyler Blount 0caea780a3 Clear locks on successful secondary bank change 2020-08-02 21:38:52 -06:00
Tyler Blount 671301a936 Fix lock sounds not playing correctly with multilock 2020-08-02 16:14:20 -06:00
Goober5000 0177ebd66f add new versions of the collision group sexps
In most cases you have one group to/from which you are adding or removing several ships, but the existing sexps are designed for one ship and many groups.  This adds new sexps designed for one group and many ships.
2020-08-01 00:15:52 -04:00
Goober5000 27940d2f55 Merge pull request #2614 from Goober5000/orientation_editor
Allow actually editing orientations in the orientation editor
2020-08-01 00:14:30 -04:00
Baezon f6603514b1 default value 2020-07-31 23:01:00 -04:00
Baezon a4f7d10391 review changes + functions 2020-07-31 22:20:07 -04:00
Goober5000 b06eac63c8 this threshold makes more sense 2020-07-31 20:13:29 -04:00
Goober5000 53ef41856c add orientation editing 2020-07-31 18:35:01 -04:00
Goober5000 cd04ce24f1 reorder controls for tabbing 2020-07-31 18:33:11 -04:00
Taylor Richards 069e1eea0f clean up defines to avoid multiple lookup types 2020-07-31 18:27:25 -04:00
Goober5000 1bc26c4da1 fred.rc and resource.h changes 2020-07-31 16:32:58 -04:00
Baezon 626c1fc42f travis appeasement 2020-07-30 23:23:10 -04:00
Baezon 385ae2c0b3 travis appeasement 2020-07-30 23:21:08 -04:00
Goober5000 d841d2a91b Merge pull request #2603 from Goober5000/on_debris_created
more complete scripting support for debris
2020-07-30 21:42:05 -04:00
Baezon 4ef217121e flag 2020-07-30 21:23:37 -04:00
Goober5000 46673a6277 Merge pull request #2610 from asarium/doc/makeNewHooksObvious
Add comment about new hooks system to legacy hook list
2020-07-30 16:44:53 -04:00
Taylor Richards cdd50bfc15 make libpcp work on Solaris/OpenIndiana 2020-07-30 16:05:48 -04:00
Goober5000 c868178cc0 Merge pull request #2600 from Goober5000/scripting_rand32
add several more scripting functions
2020-07-30 15:28:01 -04:00
Baezon 20acea31f2 review changes 2020-07-30 15:06:36 -04:00
Goober5000 f2ea3e24b1 use new script hook API 2020-07-30 12:18:52 -04:00
Goober5000 c768d13f33 address feedback 2020-07-30 11:57:09 -04:00
Goober5000 516040c96d Merge pull request #2609 from Goober5000/lua_argument_sanity
add sanity check to Lua SEXP arguments
2020-07-30 11:51:20 -04:00
asarium 33f3b72be1 Add comment about new hooks system to legacy hook list
Since the old system is deprecated it needs to be made obvious that new
hooks should not be added using that system.
2020-07-30 17:15:53 +02:00
Goober5000 2fde6aa69c add sanity check 2020-07-29 21:27:38 -04:00
Goober5000 2dddbaa6ae add some more useful functions 2020-07-29 21:26:16 -04:00
Tyler Blount a212a6042c Merge pull request #2605 from JohnAFernandez/Multilock_Multiplayer_Patch_Final
Multilock Patch
2020-07-29 14:27:48 -06:00
Goober5000 7e8520f375 Merge pull request #2607 from notimaginative/fix_pxo_lobby_crash
Fix pilot info bug and crash in PXO chat lobby
2020-07-29 10:05:19 -04:00
Taylor Richards b5dc556412 fix pinfo crash and bug in PXO chat lobby 2020-07-29 01:22:20 -04:00
JohnAFernandez e979b07ce1 Remove Sneaky Rollback Logic for Dumbfires 2020-07-28 22:01:56 -04:00
JohnAFernandez 9383510388 Multilock Patch 2020-07-28 21:50:55 -04:00
Goober5000 9b7549213d might as well add these too 2020-07-27 13:38:44 -04:00
JohnAFernandez fd18a21482 Fix Non-Standalone Servers Failing to Switch Between PXO and Non-PXO
Add a function to check if PXO is in use rather than just initialized, so that a very important flag can be properly set.
2020-07-27 13:29:58 -04:00
JohnAFernandez cb048132cf Change MP Initial Ship Behavior to Match SP 2020-07-27 13:18:06 -04:00
Baezon f95f48448e world coords for all whacks 2020-07-27 01:11:00 -04:00
Tyler Blount bc4c9f6bea Merge pull request #2207 from TRBlount/multilock_maintain
Merge Multilock
2020-07-26 22:31:18 -06:00
Goober5000 83d2ac8818 more complete scripting support for debris
Adds a hook for debris creation, and adds DoNotExpire and LifeLeft virtual variables for controlling debris removal.
2020-07-26 22:02:51 -04:00
Tyler Blount 530f3e22ac Bump Multiplayer Version
A multiplayer version bump is required as missiles no longer function due to multilock. This will be remedied asap.
2020-07-26 18:38:57 -06:00
Tyler Blount f03f97bbcd Fix Travis CI errors 2020-07-26 18:38:57 -06:00
Tyler Blount c749f41d7f Fix incorrect capitalization for Ships_inited variable 2020-07-26 18:38:57 -06:00
Tyler Blount 02249c5650 Don't reset target restrictions during table load
Prevents an issue with load order causing target restrictions to be reset.
2020-07-26 18:38:57 -06:00
Tyler Blount f64e0396bf Remove unneeded code and some style changes 2020-07-26 18:38:57 -06:00
Tyler Blount b969b45b68 Correctly implement fixes from #73 2020-07-26 18:38:57 -06:00
Tyler Blount 9dbdf06c89 CI and Lock fixes 2020-07-26 18:38:57 -06:00
Tyler Blount eaac6ccfbb Use correct comparison 2020-07-26 18:38:57 -06:00
Tyler Blount 4bdded6650 Fix some CI errors 2020-07-26 18:38:57 -06:00
Tyler Blount 25f0f3fca1 Finally fix no dumbfire
also some miscellaneous changes
2020-07-26 18:38:56 -06:00
Tyler Blount 8413da3352 Perhaps this works? 2020-07-26 18:38:56 -06:00
Tyler Blount a283b93e85 No Dumbfire fix
Another fix for MLMs associated with the No Dumbfire flag.
2020-07-26 18:38:56 -06:00
Tyler Blount f089404520 More fixes
Contains changes related to failed CI builds and feedback.
2020-07-26 18:38:56 -06:00
Tyler Blount 2610bc632a Lost fixes
These were lost during a rebase at one point. Will leave this commit as separate to avoid issues in the future.
2020-07-26 18:38:56 -06:00
Swifty 32c38e696d Initial commit of multilock missile features. 2020-07-26 18:38:56 -06:00
Goober5000 d10fa93c3c Merge pull request #2601 from Baezon/fix-recoil
Fix usage of ship_recoil_modifier
2020-07-26 14:43:29 -04:00
Goober5000 4e5a29454f Merge pull request #2602 from Goober5000/add_otf
add OTF fonts
2020-07-26 11:13:36 -04:00
Goober5000 7f47132e78 add OTF fonts
There are fonts with an .otf extension that are similar to .ttf, and in fact can be opened with our TTF code.  So this adds support for that extension.
2020-07-26 02:10:49 -04:00
Baezon 22a3d57894 add recoil to clone and move 2020-07-26 00:52:21 -04:00
Goober5000 57e4fcd901 trololol... 2020-07-26 00:29:28 -04:00
Goober5000 8bc57c3cd2 add several more scripting functions
Add ba.rand32() and ba.rand32f(), and gr.clear(); enhance streaminganim:process(); fix streaminganim:timeLeft().
2020-07-25 23:21:40 -04:00
Goober5000 2c7fee1c93 Merge pull request #2595 from chief1983/fix/sun_fionbio
fix/sun_fionbio: Load filio.h on Sun for FIONBIO
2020-07-25 11:05:58 -04:00
Goober5000 c860a0e14a Merge pull request #2597 from chief1983/fix/sun_sun
fix/sun_sun: Use 'bgsun' instead of 'sun'
2020-07-25 11:05:50 -04:00
Goober5000 40862bb781 Merge pull request #2598 from Goober5000/fix_special_ship
adjust special_ship index if a ship exits a wing
2020-07-25 11:05:40 -04:00
Goober5000 66ee735ebe Merge pull request #2596 from chief1983/fix/sun_renderdoc
fix/sun_renderdoc: Make Solaris a recognized platform for renderdoc.
2020-07-25 11:04:50 -04:00
Goober5000 673a0c60a2 adjust special_ship index if a ship exits a wing
If a ship is destroyed or departed, the special_ship index would get out of sync.  This fixes that.
2020-07-24 23:45:57 -04:00
chief1983 ce7ba67843 fix/sun_sun: 'sun' is a reserved keyword on Sun, so use bgsun here instead. 2020-07-24 17:49:50 -05:00
chief1983 387c9e4a9c fix/sun_renderdoc: Make Solaris a recognized platform for renderdoc. 2020-07-24 17:48:10 -05:00
chief1983 fd5fba62aa fix/sun_fionbio: This include is needed on Sun platforms for it to have access to FIONBIO. 2020-07-24 17:45:16 -05:00
JohnAFernandez 58b35f9348 Keeps players From Accessing Multi Screens When No Connection Available.
Leaving the ability to go onto the multi screens will cause undesired behavior and asserts. (like trying to validate the tables when there is no connection in the first place.)  Also only sets the game state to multi once we're sure that we're going to enter a multi game.
2020-07-24 13:17:31 -04:00
Goober5000 fdc160807f Merge pull request #2581 from Goober5000/dont_bank_ship_flag
add ship-maneuver flags to ship_info
2020-07-24 12:35:43 -04:00
Goober5000 91007d9f83 Merge pull request #2592 from Goober5000/fix_get_line_num
fix line number counting
2020-07-24 01:29:28 -04:00
Goober5000 8ca10d46be fix line number counting
When I rewrote `strip_comments()` to take quotes into account, I didn't correspondingly update `get_line_num()`.  This fixes that.  I discovered that a Lua file with a lot of semicolons inside quotes was erroneously getting the past-EOF warning.

Also, in the event that the warning *is* tripped, this exits the loop instead of repeatedly displaying the warning.
2020-07-23 23:46:12 -04:00
Baezon 27544e781a Revert "no homing when out of range"
This reverts commit eebfb7eadb.
2020-07-23 21:12:51 -04:00
Goober5000 207227038f Merge pull request #2587 from Goober5000/additional_vecmat_scripting
Additional scripting enhancements
2020-07-23 16:49:28 -04:00
Goober5000 6e40248490 add vector interpolation, sexp variable name, and joystick axis inversion
add several more vecmat functions to scripting
2020-07-23 14:43:02 -04:00
Baezon eebfb7eadb no homing when out of range 2020-07-23 12:30:28 -04:00
m!m a302d1ac00 Merge pull request #2588 from asarium/build/optionalVulkan
Make Vulkan an optional component
2020-07-23 17:55:14 +02:00
Baezon e6938bd14d verison 1 2020-07-22 23:48:53 -04:00
Baezon 1f1d7065cd v1 2020-07-22 23:26:06 -04:00
Goober5000 f1cd5be6ed Merge pull request #2543 from Goober5000/fix_sexp_hint
fix sexp auto-complete for manually-entered text
2020-07-22 15:20:50 -04:00
asarium bc0ea7d929 Make Vulkan an optional component
This makes it possible to still compile FSO on platforms that are not
supported by the Vulkan headers.
2020-07-22 18:20:59 +02:00
Goober5000 cd2a0437e0 Merge pull request #2573 from Goober5000/tech_db_scripting_vars
cleanup of tech room, and scripting stuff
2020-07-21 22:38:58 -04:00
Goober5000 e499e651c7 Merge pull request #2583 from Goober5000/orientation_enhancements
add scripting function to create matrix from vectors
2020-07-21 17:26:42 -04:00
Goober5000 fd30238743 Merge pull request #2555 from Baezon/whack-fix
Fix physics whack for docked ships
2020-07-21 15:30:16 -04:00
Baezon 8bd033705f swarmers lead targets 2020-07-21 14:48:24 -04:00
Goober5000 7634f55ae9 Merge pull request #2584 from JohnAFernandez/Fix_Retail_Weapon_Energy_UBER_BUG
Move unsetting of Wep Cheat to Gamestate code
2020-07-21 14:48:24 -04:00
Goober5000 709208bff4 address feedback 2020-07-21 14:46:06 -04:00
Goober5000 096218a324 address feedback 2020-07-21 14:36:57 -04:00
Goober5000 3833881f8e Merge pull request #2411 from notimaginative/fix_pxo_stats
fix various issues with PXO stats
2020-07-21 01:59:00 -04:00
JohnAFernandez fd7af0bdf8 Move unsetting of Wep Cheat to Gamestate code
Where it belongs.
2020-07-21 01:52:02 -04:00
Goober5000 0071fbde1a add scripting function to create matrix from vectors 2020-07-20 21:58:02 -04:00
Goober5000 712bb1fe89 add ship-maneuver flags to ship_info 2020-07-19 22:27:38 -04:00
Baezon a6f060e128 clarity edits 2020-07-19 15:06:29 -04:00
Baezon 34b04b1ca8 PR review fixes 2020-07-18 22:28:51 -04:00
Goober5000 f03df9e7cc Merge pull request #2579 from JohnAFernandez/Return-To-PXO-After-Re-enable
Go back to login if you're trying to use PXO
2020-07-18 13:34:47 -04:00
Goober5000 192272a914 Merge pull request #2450 from JohnAFernandez/Fix_Ai_messaging
Allow Team Leaders to Send Messages
2020-07-18 13:33:50 -04:00
Fabian Woltermann fd2f9cc326 Merge pull request #2570 from Goober5000/vm_vec_mag_quicker
make _quick quicker
2020-07-18 18:55:57 +02:00
Fabian Woltermann 714514533b Merge pull request #2580 from JohnAFernandez/Fix-minor-pxo-screen-rendering-bug
Fix sidebars retaining old rendering from mission quick exit
2020-07-18 18:54:45 +02:00
Baezon 6e7908833a more fix 2020-07-17 23:40:51 -04:00
JohnAFernandez b7d7ebe6cf Allow Team Leaders to Send Messages and use ship registry to look up the team and slot
Team Leader function was returning 0 instead of 1 when the team captain was messaging AI.

This optimizes, cleans up, and gets rid of edge-case buggy behaviour.  Thank you ship_registry!
2020-07-17 22:44:24 -04:00
JohnAFernandez 185d12859c Fix sidebars retaining old rendering from mission quick exit
And also a minor typo
2020-07-17 22:26:57 -04:00
Baezon c49cf7fd6a bugfix 2020-07-17 21:00:26 -04:00
Baezon 06322bb977 better names and const fix 2020-07-17 20:07:09 -04:00
JohnAFernandez f832b5baf1 Go back to login if you're trying to use PXO 2020-07-16 22:33:47 -04:00
Goober5000 2191bf9265 Merge pull request #2577 from notimaginative/inputbox_paste
Allow pasting clipboard contents into input boxes
2020-07-16 21:21:11 -04:00
Goober5000 559e38d0cf Merge pull request #2575 from Baezon/fix-moi-init
Improve physics_ship_init safety
2020-07-16 21:21:02 -04:00
Goober5000 d9dd116199 Merge pull request #2578 from Goober5000/fix_show_subtitle
fix show-subtitle
2020-07-16 21:20:28 -04:00
Goober5000 f8f6bbc53c fix show-subtitle
For older campaigns which used show-subtitle, the eval_num conversion inadvertently changed the rgb to default to 0, instead of 255.  This restores the default to 255.
2020-07-16 15:30:52 -04:00
Taylor Richards d778c5864d paste from clipboard into inputbox 2020-07-16 11:52:36 -04:00
Fabian Woltermann 90d3a275ea Merge pull request #2576 from notimaginative/pxo_query_bomb_fix
Fix query bomb in PXO game tracker
2020-07-16 13:58:39 +02:00
Taylor Richards a03cd49d0c fix loop to use reference 2020-07-16 03:20:15 -04:00
Baezon 2d1ae42db0 more specific comments 2020-07-15 23:47:32 -04:00
Baezon ef42b545cf initial commit 2020-07-15 18:15:21 -04:00
Goober5000 e0437727dc Merge pull request #2568 from notimaginative/pxo_game_tracker_cleanup
Clean up PXO client-side game tracker
2020-07-15 13:28:02 -04:00
Goober5000 31fa2ac444 cleanup of tech room, and scripting stuff
1) Upgrade the pilot file code to correctly save flags whether entries are added *or* removed
2) Make the tech-db/tech-db-multi ship flag handling consistent
3) Add scripting support for intel entries
4) Add scripting support for adding and removing entries from the tech room
5) Minor cleanup
2020-07-15 13:27:27 -04:00
Goober5000 e4f7bc8c57 Merge pull request #2572 from Baezon/shockwave-fix
Randomized weapon shockwave orientations
2020-07-15 13:08:59 -04:00
Goober5000 a5667010e1 Merge pull request #2574 from Baezon/no-infinity
Add infinity to invalid vector criteria
2020-07-15 13:01:43 -04:00
Baezon 8de1248713 no infinite vectors allowed 2020-07-15 01:10:47 -04:00
Baezon 8fdc11180f cleaner tau 2020-07-14 12:06:42 -04:00
Goober5000 92bd872caf Merge pull request #2562 from JohnAFernandez/Fix-Standalone-Interactive-Dialog-Crashes
Fix Standalone Crashes
2020-07-14 09:41:00 -04:00
Goober5000 8ffdbba488 Merge pull request #2571 from Baezon/no-docking-collision
Prevent indrectly docked ships from colliding
2020-07-14 09:40:41 -04:00
Goober5000 28c8c3000f Merge pull request #2569 from Goober5000/robustify_json_string
some UTF-8 improvements
2020-07-14 09:40:07 -04:00
Baezon de80a3bacc better name 2020-07-14 01:42:22 -04:00
Baezon 12d6422556 no collision for dockING ships either 2020-07-13 23:51:05 -04:00
Baezon 3adf6e4553 No indirect docking collision 2020-07-13 21:50:07 -04:00
Goober5000 d6b3d8cba7 remove old tests 2020-07-13 20:52:26 -04:00
Goober5000 815de46c6d make _quick quicker
The functions derived from `vm_vec_mag_quick` run *slower* than `vm_vec_mag`, according to @Baezon who did some testing.  So this PR makes all calls to the _quick functions use their more accurate counterparts.
2020-07-13 20:49:50 -04:00
Baezon 5fa9d17cc5 randomized shockwave orientations 2020-07-13 20:15:20 -04:00
Goober5000 8b310a3e08 Merge pull request #2564 from Baezon/cargo-no-recover
Prevent cargo containers from recovering from a collision
2020-07-13 16:05:36 -04:00
Goober5000 4bd49c2b95 address feedback 2020-07-13 15:43:47 -04:00
Goober5000 c13a3330f6 some UTF-8 improvements
1) Write all non-UTF-8 strings to JSON, either by converting or truncating
2) Add `coerce_to_utf8` function
3) Tweak `read_raw_file_text` because the function returns length on success, not 0
2020-07-13 14:33:28 -04:00
Goober5000 7744e177c5 Merge pull request #2567 from Baezon/quick-dist-fix
Relative error for mag and dist_quick, and seeded vecmat tests
2020-07-12 14:33:17 -04:00
Taylor Richards 7db6662978 avoid querying tracker at LAN refresh internals 2020-07-12 14:00:57 -04:00
Taylor Richards 72a610574e set and update game data properly 2020-07-12 13:30:18 -04:00
Baezon 1512e7c8c2 moar bugfix 2020-07-12 12:53:05 -04:00
Goober5000 b49ea7b4c2 Merge pull request #2566 from Goober5000/fix_fred_node_correction
fix FRED's verify_and_fix_arguments
2020-07-12 12:33:34 -04:00
Baezon 96239d4117 formatting 2020-07-12 12:28:19 -04:00
Taylor Richards 4220a426d6 fix gtrack updates to work more reliably 2020-07-12 12:12:59 -04:00
Baezon e0e74c8277 bugfix 2020-07-12 03:51:31 -04:00
Baezon a5a41e8ea6 Review adjustments 2020-07-12 03:14:01 -04:00
Baezon c497aa32d5 relative error for mag and dist_quick, and seeded tests 2020-07-12 00:33:13 -04:00
Goober5000 412c0310d3 Merge pull request #2565 from Goober5000/fix_destroy_before_mission
sometimes the FSO code is like Jenga
2020-07-12 00:28:09 -04:00
Goober5000 42314e5a58 fix FRED's verify_and_fix_arguments
This was a fun one.  Volition used a bizarre and very poorly named "flag" static variable to track iterations through the `verify_and_fix_arguments` function.  I'm not sure how this actually works, but on comparing with the original public source code I see that @asarium didn't quite fix the "declaration masks class variable" compiler warning the right way.  This rolls back that 2016 change and fixes it properly.

The effect of this fix is so that FRED will correctly handle arguments when node data types change, such as when the modify-variable argument is changed from a numeric variable to a string variable.
2020-07-11 23:44:24 -04:00
Goober5000 b12d0986c5 sometimes the FSO code is like Jenga
The #2528 fix broke ships destroyed before mission start because their arrival delay was *already* set up (as a bogus timestamp).  So this change adds a special exception for that.
2020-07-11 22:34:09 -04:00
Baezon c6cbb1f380 Cargo containers won't recover from collisions 2020-07-11 20:18:24 -04:00
Goober5000 ecc678c1e5 Merge pull request #2561 from Goober5000/traitor_cleanup
traitor table addendum
2020-07-11 11:10:07 -04:00
Baezon abe17c7885 comment fix 2020-07-11 02:01:17 -04:00
Baezon 17613e0612 Only one whack
re-factored so that only the 'dock root' is whacked, all other docked ships will adjust to match the root
2020-07-11 00:05:10 -04:00
Baezon b6f1ceeabd PR review changes 2020-07-11 00:05:10 -04:00
Baezon eb64241355 Assert -> Assertion and made a bunch of them 2020-07-11 00:04:48 -04:00
Baezon 3178ef593e NULL -> nullptr 2020-07-11 00:04:48 -04:00
Baezon 47418008f4 unused variable clean up 2020-07-11 00:04:48 -04:00
Baezon 9b33685598 Fix physics whack for docked ships
Properly whacks all ships that are docked together when any are whacked, makes everything more consistent by calling ship_apply_whack instead of physics_apply_whack, whacking in general now unrotates its hit pos to get a world pos like physics whack was expecting and adds a few matrix helper functions.
2020-07-11 00:04:48 -04:00
Goober5000 cc3ebaf965 Merge pull request #2556 from Baezon/vecmat
Addition of matrix3 functions in vecmat
2020-07-10 23:54:05 -04:00
JohnAFernandez 48ccd37d09 Fix Standalone Crashes
Standalones would crash if they had an error dialog pop up because of a nullptr.  This just checks for the nullptr and returns early to prevent the crash.
2020-07-10 23:44:01 -04:00
Goober5000 587abefb45 upon further consideration, the text is what depends on the persona 2020-07-10 21:21:03 -04:00
Goober5000 5951d05587 Merge pull request #2559 from Goober5000/debriefing_persona_enhancements
Debriefing persona enhancements
2020-07-10 21:03:04 -04:00
Baezon 32baf3dc5c Even more appveyor appeasement 2020-07-10 20:23:36 -04:00
Baezon da9442261a more appeasing of appveyor 2020-07-10 13:31:33 -04:00
Baezon 81980e3486 make dist_quick slightly more permissive 2020-07-09 22:42:37 -04:00
Baezon b9fd69285d remove unused variable 2020-07-09 21:54:57 -04:00
Baezon 453a3f213d Merge The_E's vector test functions 2020-07-09 20:39:19 -04:00
Goober5000 baa1bd2a18 Merge pull request #2558 from Goober5000/fix_skipmemymissionyo
fix skipmemymissionyo
2020-07-09 13:50:53 -04:00
Goober5000 a5b8c7b376 add debriefing persona sexp and make a few additional tweaks 2020-07-09 12:49:38 -04:00
Goober5000 26f4531300 fix skipmemymissionyo 2020-07-09 11:47:07 -04:00
Goober5000 1304a36c96 parse traitor.tbl at game launch, and select persona-specific text 2020-07-09 11:18:40 -04:00
Baezon 82c13da494 Added vecmat test
also trying to placate appveyor by using a variable instead of a literal i guess?
2020-07-09 00:34:25 -04:00
Goober5000 e40e54abc0 Merge pull request #2557 from Goober5000/fix_numeric_arguments
Fix numeric arguments
2020-07-08 16:52:32 -04:00
Goober5000 d4053ea2e9 fix <argument> in numeric nodes, and also fix more error printing 2020-07-08 14:51:52 -04:00
Goober5000 4250a4e2bb fix error variable printing 2020-07-08 13:50:12 -04:00
Baezon f4794341bb bugfix 2020-07-08 01:32:49 -04:00
Baezon f1a3ac449e Addition of matrix3 functions in vecmat
Added inverse, add, add2, sub, sub2 and a ZERO_MATRIX.
2020-07-08 00:51:06 -04:00
Goober5000 d7922c843a Merge pull request #2553 from Goober5000/fix_has_xstr
fix XSTR lookup for $Has XSTR:
2020-07-07 18:18:52 -04:00
Goober5000 b319d97b2a fix XSTR lookup for $Has XSTR:
If we specify an XSTR index, we want the internal control lookup to happen regardless of whether the game is running in untranslated mode or not.
2020-07-07 13:34:53 -04:00
Goober5000 07c8f0945b Merge pull request #2547 from Goober5000/event_flags_polishing
lazily write the flag list to prevent empty flag lists
2020-07-07 12:02:51 -04:00
Fabian Woltermann 4819f25c58 Merge pull request #2551 from Goober5000/fix_mantis_2871
fix Mantis 2871
2020-07-07 16:06:19 +02:00
Goober5000 101a1573fa Merge pull request #2550 from Goober5000/fix_mantis_2181
fix Mantis 2181
2020-07-06 23:38:23 -04:00
Goober5000 0c53682ab8 fix Mantis 2871
There was an AI class validity check for the pilot, but not for turret weapons.  This fixes that.

Also, the p_object parameter to this functino was named `objp`, which is misleading because that's usually used for object.  I renamed it p_objp.
2020-07-06 21:39:10 -04:00
Goober5000 36bd7d4c61 Merge pull request #2542 from Goober5000/clear_debris_sexp
add clear-debris sexp
2020-07-06 21:10:17 -04:00
Goober5000 392d9f6dbb fix Mantis 2181
This just uses vm_vec_normalize_safe.  If two objects spawn on top of each other, the code will now sort them properly without printing a null vec3d warning.
2020-07-06 21:04:24 -04:00
Goober5000 5480c004f5 Merge pull request #2548 from Goober5000/fix_endgame
fix the special-warpout-name sexp
2020-07-06 20:29:30 -04:00
Goober5000 d7832b4b39 fix the special-warpout-name sexp
grrr...
2020-07-06 18:42:35 -04:00
Goober5000 4b45a8602d Merge pull request #2546 from Goober5000/fix_get_damage_caused
fix copy-paste mistake
2020-07-05 11:45:38 -04:00
Goober5000 f3672ad12f lazily write the flag list to prevent empty flag lists 2020-07-04 16:44:30 -04:00
Goober5000 4e85009596 fix copy-paste mistake 2020-07-04 15:09:56 -04:00
Goober5000 7a9bd1cfaa blah 2020-07-03 16:48:05 -04:00
Goober5000 d293a9c18b api compatibility 2020-07-03 16:33:49 -04:00
Goober5000 9337c8a4b3 fix compilation 2020-07-03 16:09:59 -04:00
Goober5000 d1e0112cd2 Merge pull request #2541 from Goober5000/background_fix
fix background bug when loading subsequent missions
2020-07-03 16:05:40 -04:00
Goober5000 1a928632e0 fix sexp auto-complete for manually-entered text
The old way of finding the closest match of sexp text to entered text didn't work very well.  This method uses Levenstein distance.
2020-07-03 16:00:43 -04:00
m!m 7cd9359dec Merge pull request #2519 from asarium/feature/externalSexps
Add system for adding SEXPs externally
2020-07-03 19:56:11 +02:00
Goober5000 ef1f462c3b add clear-debris sexp
Simiar to the clear-weapons sexp (renamed from remove-weapons).
2020-07-03 13:34:39 -04:00
Goober5000 cc707264ae fix background bug when loading subsequent missions
FRED's handling of mission loading and creation is a bit wonky.  The `stars_post_level_init()` function should run for each new mission, not just once when FRED is started.  That fixes a background editor crash and I also did a bit of other cleanup.
2020-07-03 12:44:43 -04:00
asarium 62d6b3c834 Add system for adding SEXPs externally
This adds a "clear-debris" SEXP with a new system for declaring SEXPs
outside of sexp.cpp. This makes it easier to keep code modules self
contained since they do not need to export previously private
functionality just for having missiong being able to interface with it.

This is mostly a proof-of-concept which only supports basic parameter
types (booleans and integers).
2020-07-03 18:13:47 +02:00
Goober5000 cb9803a20a Merge pull request #2540 from Goober5000/dock_leader_message
clarify these warnings based on feedback
2020-07-02 18:43:54 -04:00
Goober5000 4a21436b9a Merge pull request #2536 from Goober5000/change_background_sexp
allow switching between multiple backgrounds
2020-07-02 14:56:22 -04:00
Goober5000 d2625be6d8 clarify these warnings based on feedback 2020-07-02 14:25:23 -04:00
Goober5000 42e2c71ca1 Merge pull request #2538 from Goober5000/fix_ship_registry
fix ship registry in regards to wings with multiple waves
2020-07-02 11:47:21 -04:00
Goober5000 e34506d40d Merge pull request #2537 from Goober5000/fix_missing_sexp_error_checks
fill in two missing error checks, and tweak a few others
2020-07-02 01:29:54 -04:00
Goober5000 d440d29d21 fix ship registry in regards to wings with multiple waves
The ship registry previously stored the ship name as a pointer, but that pointer was reused when subsequent waves of a wing overwrote a p_object from the first wave.  So, the name is now copied into an array.

Additionally, subsequent waves of a wing are now "eagerly" stored in the ship registry so that the p_object reference can be stored as well.
2020-07-02 01:23:55 -04:00
Goober5000 69234e3a3c make qtfred happy 2020-07-02 00:46:12 -04:00
Goober5000 595a2f884a make clang happy 2020-07-01 23:53:19 -04:00
Goober5000 c3f58c3cf5 fill in two missing error checks, and tweak a few others 2020-07-01 23:46:38 -04:00
Goober5000 7e947e522e allow switching between multiple backgrounds
For quite some time missions have had the ability to edit more than one background.  This was previously used for fallback loading in case the first background's bitmaps were not available, but I realized it would be very handy to allow switching between backgrounds for in-mission jumps.

The FRED background dialog can now add and remove backgrounds from the list.  Additionally, a new `change-background` sexp can instantly switch between backgrounds without messing around with bitmap references.
2020-07-01 23:32:12 -04:00
Goober5000 48080abbb5 Merge pull request #2534 from Goober5000/fix_hud_message_offset
fix HUD message offset for messages that come from [none]
2020-06-30 17:57:37 -04:00
Goober5000 9359362ea6 make clang happy 2020-06-30 14:23:18 -04:00
Goober5000 a8d0123d63 Merge pull request #2522 from CasparKielwein/ck/cleanup_sexp.cpp
small cleanup in  sexp.cpp
2020-06-30 13:33:07 -04:00
Goober5000 65cdb0232d fix HUD message offset for messages that come from [none]
Tracked down another Volition bug, first reported by recead.  When messages do not have the ": " substring (which only happens when they are from MSG_SOURCE_NONE), they would calculate the wrong string size.  This is because the two-character offset was added to the pointer *before* the pointer was checked for null, and so non-matches were considered matches with strings beginning at memory offset 2.
2020-06-30 13:13:48 -04:00
Goober5000 16bfeee6e1 Merge pull request #2529 from Goober5000/patch_exited_sexps
handle vanished ships for sexps that check exited_index
2020-06-30 02:12:36 -04:00
Goober5000 ec7bac99b5 handle vanished ships for sexps that check exited_index
When ships vanish, they are in the EXITED state but their `exited_index` is -1 *and* their `shipp` pointer is null.  So check for this.
2020-06-29 22:43:32 -04:00
Goober5000 d9ea352dab Merge pull request #2528 from Goober5000/fix_arrival_delay_handling
fix arrival delay handling
2020-06-29 22:13:55 -04:00
Goober5000 36d93db0a4 fix arrival delay handling
Volition's arrival code used eager evaluation of arrival cues even before the mission was finished parsing.  With the new sexp optimization code, this can fail because the sexps can depend on ships which are not even parsed yet and thus are not in the ship registry.  So I moved the arrival_delay initialization and added some comprehensive comments explaining what is going on.
2020-06-29 18:29:00 -04:00
CasparKielwein a8398629d7 in Sexp add to uncalled functions to list of multi_sexp_* calls.
Fix: Call multi_sexp_reset_time_compression instead of non-multi version
2020-06-29 21:58:45 +02:00
CasparKielwein cbb3fda960 in sexp.cpp use make indentation consistent using tabs 2020-06-29 21:58:45 +02:00
CasparKielwein cb5a406204 In sexp.cpp a bit of trivial cleanup as requested by clang-tidy. 2020-06-29 21:58:45 +02:00
CasparKielwein ad0b0ba07a In sexp.cpp remove a few unused functions and variable declarations.
Only code was removed where no reference in the whole project could be found.
Redundant declarations are already imported through inludes.
2020-06-29 21:58:45 +02:00
Goober5000 90163e8208 Merge pull request #2524 from Goober5000/does_not_move_ai
a few fixes for ships which shouldn't move
2020-06-29 00:12:04 -04:00
Goober5000 b5f59c7efc a few fixes for ships which shouldn't move
1) Prevent ships from turning in `ai_turn_towards_vector` if they have the `immobile` flag.  This was missed because it is a rotation that doesn't originate in `obj_move_call_physics`.
2) Prevent ships from evading shockwaves if they're playing dead.

Also there is a small conversion of an int to a bool.
2020-06-28 20:08:29 -04:00
Fabian Woltermann f755af02b9 Merge pull request #2521 from The-E/fix/local_ssms
Fix issue with local ssms not actually working correctly when being fired from a turret
2020-06-28 18:36:53 +02:00
Fabian Woltermann 064fe31df7 When resolving targets for local ssms, check both the weapon's target_num _and_ it's tracking info. 2020-06-28 10:20:46 +02:00
CasparKielwein 4f384d56ef in sexp.cpp replace NULL with nulltpr 2020-06-27 20:58:24 +02:00
Goober5000 c44e681c58 Merge pull request #2518 from Goober5000/constify_ctext
constify CTEXT
2020-06-27 12:16:10 -04:00
wookieejedi a065b7b967 Merge pull request #2514 from wookieejedi/min-range-ai
Allow AI Flag Use Primary Range to work with Min Range Too
2020-06-27 09:29:06 -04:00
Goober5000 7bb5a1d0fc fix CI complaints 2020-06-26 16:04:12 -04:00
Goober5000 51864a08ae reorder functions 2020-06-26 14:47:40 -04:00
Goober5000 5bc1d9da30 constify_ctext 2020-06-26 14:47:39 -04:00
Goober5000 3fc8b307f0 Merge pull request #2513 from Goober5000/more_sexp_caching
giant refactor of sexps to use caching for ships and wings
2020-06-26 14:40:48 -04:00
Goober5000 498ee4ca2d Merge pull request #2515 from Goober5000/fix_2512
better handling of non-truncated hotspot sounds
2020-06-26 12:59:57 -04:00
Goober5000 39858fdfe0 giant refactor of sexps to use caching for ships and wings 2020-06-26 12:59:31 -04:00
Goober5000 921ee8668b better handling of non-trucated hotspot sounds
The cause of the #2512 bug was using the new main hall to look up sounds from the old main hall, which would crash in several cases.  The lookup was performed when testing whether or not to truncate a door sound when changing screens or states.  Dan Wentz requested that "glowy" sounds not be truncated, so this preserves that check.  Rather than test the indexes of the door regions, this tests the indexes of the sounds in sounds.tbl.

Right now the retail sound indexes are hard-coded, but it would be easy to make this configurable from mainhall.tbl if modders wanted that ability.

This fixes #2512.
2020-06-25 17:51:43 -04:00
wookieejedi f390829e91 Allow AI Flag Use Primary Range to work with Min Range Too
The ship table value `+Weapon Min Range:` was ever used for turret firing calculations. This PR adds it as part of the cacluation for other instances, but only if the AI flag `Use_actual_primary_range` is used.
2020-06-25 17:23:55 -04:00
Goober5000 a9122b7e93 Merge pull request #2511 from Goober5000/upgrade_misc_sexps_5
upgrade yet more miscellaneous sexps
2020-06-25 11:17:40 -04:00
Goober5000 233c86b0d4 Merge pull request #2506 from Goober5000/subsys_rotation
upgrade sexps affecting rotating submodels
2020-06-25 11:17:20 -04:00
niffiwan 647081a547 Merge pull request #2492 from asarium/feature/scriptingTypesValidation
Validate scripting documentation type names
2020-06-25 17:05:38 +10:00
Goober5000 0099e0a1c9 Merge pull request #2504 from Goober5000/upgrade_misc_sexps
upgrade misc sexps
2020-06-24 18:23:03 -04:00
Goober5000 6001065901 smol tweak 2020-06-24 14:06:56 -04:00
Goober5000 6d2e653dd1 upgrade yet more miscellaneous sexps 2020-06-24 14:05:27 -04:00
Goober5000 137090fd81 Merge pull request #2510 from Goober5000/upgrade_misc_sexps_4
upgrade some more miscellaneous sexps
2020-06-24 13:53:33 -04:00
Goober5000 5f92d4f3cd Merge pull request #2509 from Goober5000/upgrade_weapon_create_and_ship_effect
upgrade weapon-create and ship-effect
2020-06-24 13:50:31 -04:00
Goober5000 5dca2a95a8 Merge pull request #2508 from Goober5000/upgrade_misc_sexps_3
upgrade armor/damage and arrival/departure sexps
2020-06-24 13:47:04 -04:00
Goober5000 7a37218fd6 Merge branch 'master' into subsys_rotation 2020-06-24 11:53:19 -04:00
asarium 0d7ade0ca8 Validate scripting documentation type names
This will check if the type names specified in the argument lists of
scripting functions actually refer to valid type scripting names.
2020-06-24 17:52:33 +02:00
Goober5000 72a5eb0c49 Merge pull request #2507 from Goober5000/upgrade_misc_2
upgrade more misc sexps
2020-06-24 11:46:14 -04:00
Goober5000 44d29908c2 Merge pull request #2505 from Goober5000/upgrade_visibility_sexps
upgrade sexps affecting ship visibility
2020-06-24 11:39:31 -04:00
Goober5000 8394d0d623 upgrade misc sexps
last-order-time, set-player-orders, ship-vanish, shield-quad-low
2020-06-24 11:30:17 -04:00
wookieejedi 050e9ad67a Merge pull request #2503 from wookieejedi/add-shield-weapon-recharge-to-ship-object
Add Shield and Weapon Regen Rates to Ship Object and Expose to Scripting
2020-06-23 22:17:22 -04:00
Goober5000 2bb4152aab Merge pull request #2502 from Goober5000/exited_ship_tweak
fix exited ship mismatch
2020-06-23 18:52:45 -04:00
Fabian Woltermann c2b7374dc3 Merge pull request #2493 from The-E/feature/more_lab_things
Animations in the lab and code cleanup
2020-06-23 22:44:45 +02:00
Fabian Woltermann 96551f4990 Fix FRED too 2020-06-23 18:19:15 +02:00
Goober5000 698ab9ec07 upgrade some more miscellaneous sexps 2020-06-23 12:07:25 -04:00
Goober5000 3513b2d075 upgrade weapon-create and ship-effect 2020-06-23 12:02:47 -04:00
Goober5000 5ad73b5ead upgrade armor/damage and arrival/departure sexps 2020-06-23 11:58:56 -04:00
Goober5000 15d8c962e9 upgrade more misc sexps 2020-06-23 11:53:26 -04:00
Fabian Woltermann 7487fc3042 Address review comments 2020-06-23 17:44:52 +02:00
Goober5000 cb44c66642 upgrade sexps affecting rotating submodels 2020-06-23 11:42:30 -04:00
Goober5000 06478cd64a upgrade sexps affecting ship visibility 2020-06-23 11:38:28 -04:00
wookieejedi 52030b1cc6 Add Shield and Weapon Regen Rates to Ship Object and Expose to Scripting
Previously a ship's shields and weapon regeneration per second rates were only stored in the ship_info strut, thus they should not be changed during a mission or via scripting (see #2236 and and #2239). There are many precedents for taking a ship_info value ans copying it to a ship_object value so the value can be changed on a per ship basis in mission (auto aim FOV is one of many examples). This PR thus copies the shield and weapon recharge values to the ship_object and exposes those new values to scripting.
2020-06-23 10:45:45 -04:00
Goober5000 f67026e7f5 Merge pull request #2500 from Goober5000/upgrade_docking_sexps
upgrade various docking and cargo sexps
2020-06-23 10:41:58 -04:00
Goober5000 7cfa4d8d7c fix exited ship mismatch 2020-06-23 10:40:32 -04:00
Goober5000 8c18c0cf33 Merge pull request #2497 from Goober5000/num_ships
upgrade num-in-battle, num-in-wing, num-in-box
2020-06-23 09:00:47 -04:00
Goober5000 10705235ed Merge pull request #2498 from Goober5000/escort_list
upgrade add-remove-escort, damaged-escort-priority, and damaged-escort-priority-all
2020-06-23 08:58:01 -04:00
Goober5000 c257e30c49 Merge pull request #2496 from Goober5000/weapon_selected
upgrade weapon_selected and related sexps
2020-06-23 08:45:00 -04:00
Goober5000 01cda9874e Merge pull request #2499 from Goober5000/turret_sexps_1
upgrade various turret sexps
2020-06-23 08:37:12 -04:00
Goober5000 ad54976711 upgrade various docking and cargo sexps 2020-06-23 08:24:58 -04:00
Fabian Woltermann d8aa134c9a Merge pull request #2494 from wookieejedi/expose-damp-to-scripting
Expose 'Damp' to Scripting
2020-06-23 10:40:42 +02:00
Goober5000 89242bc213 upgrade various turret sexps 2020-06-22 18:22:15 -04:00
Goober5000 c845e6ca3d upgrade add-remove-escort, damaged-escort-priority, and damaged-escort-priority-all 2020-06-22 18:13:47 -04:00
Goober5000 16c80bb0bb upgrade num-in-battle, num-in-wing, num-in-box 2020-06-22 18:10:33 -04:00
Goober5000 61a3ab10a3 upgrade weapon_selected and related sexps
primary/secondary weapon selected, energy percent, shields-left
2020-06-22 18:03:47 -04:00
Goober5000 dc28840fd2 Merge pull request #2495 from Goober5000/subsys_fixes
fix a few things with subsystem sexp operations
2020-06-22 18:01:12 -04:00
Goober5000 352a50775a fix a few things with subsystem sexp operations
1) Something wookieejedi noticed: destroying all turrets didn't trigger the DISARMED mission log event.  This is because a code ordering decision intended to accommodate the destroyed check caused the hitpoints to not be correct when they were checked within `do_subobj_destroyed_stuff`.  Instead I changed the blow-up check to use the same code for set-strength as for sabotage-strength.  This handles destruction properly and also tracks hitpoints properly.
2) Aggregate points were being recalculated for every subsystem operation where they only needed to be recalculated at the end of the sexp, so I moved that.
2020-06-22 14:43:41 -04:00
Fabian Woltermann b2306753cd more fixes.... 2020-06-22 18:13:07 +02:00
Fabian Woltermann 4c923d799e Travis demands sacrifice 2020-06-22 18:05:38 +02:00
Fabian Woltermann 3df8b6adee Just kidding, travis is never happy 2020-06-22 14:58:40 +02:00
Fabian Woltermann 3d76c5dde0 Use modern loops to make travis happy 2020-06-22 11:07:13 +02:00
Fabian Woltermann 94e392033e Get scripted animation triggers 2020-06-22 09:04:53 +02:00
Fabian Woltermann 2cb4320072 Code cleanup 2020-06-22 08:48:24 +02:00
Fabian Woltermann bb30c90568 More qtFred fixes 2020-06-22 08:38:42 +02:00
Fabian Woltermann cdc582c196 Fix FRED and QtFred issues 2020-06-21 23:04:01 +02:00
wookieejedi dd31579397 Update info 2020-06-21 15:25:36 -04:00
Fabian Woltermann 977a675a67 Add a default route to this particular switch 2020-06-21 21:22:21 +02:00
Fabian Woltermann 3bc5e7a729 Correct a casting error 2020-06-21 21:12:52 +02:00
Goober5000 13ea38fe2f Merge pull request #2490 from Goober5000/upgrade_subsys_sexps
upgrade the hits-left-subsystem sexps
2020-06-21 15:08:50 -04:00
Goober5000 cfa209530b Merge pull request #2491 from Goober5000/upgrade_iff_sexps
upgrade the iff sexps
2020-06-21 15:07:38 -04:00
Fabian Woltermann 898eabd725 Reorganizes the animation menu to be clearer and filterable 2020-06-21 20:49:36 +02:00
wookieejedi 21342f83c4 Expose 'Damp' to Scripting
Many physics values are exposed to scripting, including rotational damp. This PR exposes the linear damp to scripting. Note that in the code the linear damp is called `side_slip_time_const`.
2020-06-21 14:23:37 -04:00
Fabian Woltermann 74c87e2304 Trigger turret firing and turret fired anims 2020-06-21 19:25:50 +02:00
Fabian Woltermann 2b2d687bc7 Animations! 2020-06-21 18:19:04 +02:00
Fabian Woltermann ec494f0229 Change the model anim type enums to a enum class 2020-06-21 14:51:43 +02:00
Goober5000 c398b1dc73 Merge pull request #2488 from Goober5000/upgrade_ai_class_sexps
upgrade is- and change- ai-class
2020-06-20 23:23:19 -04:00
Goober5000 4034e73438 Merge pull request #2487 from Goober5000/upgrade_subsys_strength_sexps
upgrade subsys strength sexps
2020-06-20 22:13:00 -04:00
Goober5000 a24ba07e1e Merge pull request #2486 from Goober5000/upgrade_guardian_sexps
upgrade guardian sexps
2020-06-20 20:01:45 -04:00
Goober5000 09fe728c76 Merge pull request #2485 from Goober5000/message_and_ets
upgrade message function and ets sexps
2020-06-20 18:42:41 -04:00
Goober5000 d3e06effa1 Merge pull request #2480 from Goober5000/ammo_sexps
Ammo sexps
2020-06-20 17:33:51 -04:00
m!m 31c47509e8 Merge pull request #2483 from asarium/feature/cmdBriefApi
Add support for libRocket command briefing
2020-06-20 21:32:36 +02:00
Goober5000 883d048447 fix logical check 2020-06-20 14:23:09 -04:00
asarium ef395640d3 Add support for libRocket command briefing
This adds access to the command briefing data parsed from the mission
file to the scripting API so it can be used by the UI scripts for the
high res UI.

Also switches the animation support to using the generic anim to use
streaming to improve performance.
2020-06-20 18:17:01 +02:00
Goober5000 fd45163157 Merge pull request #2484 from asarium/build/fixQtInstall
Fix GitHub actions Qt install
2020-06-20 12:16:01 -04:00
Fabian Woltermann 7952622a79 wuip 2020-06-20 15:38:29 +02:00
Fabian Woltermann dd7e0576d4 Initial menus 2020-06-20 15:38:29 +02:00
Fabian Woltermann 1811f6c273 Code cleanup, grouping for primary weapons 2020-06-20 15:38:29 +02:00
asarium 980a9a2e96 Fix GitHub actions Qt install
Seems like there is a bug in aqtinstall in the newest version. 0.8 was
the last version to work correctly.
2020-06-20 10:21:19 +02:00
Goober5000 208198f327 upgrade message function and ets sexps 2020-06-19 16:48:17 -04:00
Goober5000 05784d28e1 upgrade guardian sexps 2020-06-19 16:45:03 -04:00
Goober5000 4e72c93523 upgrade subsys strength sexps 2020-06-19 16:41:23 -04:00
Goober5000 d3454b0486 upgrade is- and change- ai-class 2020-06-19 16:38:59 -04:00
Goober5000 3ffe294f5c upgrade the iff sexps 2020-06-19 16:37:30 -04:00
Goober5000 edc9fd0de4 upgrade the hits-left-subsystem sexps 2020-06-19 16:24:37 -04:00
Goober5000 803363f364 Merge pull request #2482 from Goober5000/fix_argument_detection
fix argument detection in sexps
2020-06-17 19:30:52 -04:00
Goober5000 3c17765ba0 fix argument detection in sexps
The previous method worked for FSO, but not FRED.  This method works for both.
2020-06-17 16:07:22 -04:00
Goober5000 187edb4679 Merge pull request #2481 from wookieejedi/fix-disarmed-delay
Fix new version of `disarmed-delay`
2020-06-17 15:38:12 -04:00
wookieejedi f5c8126783 Fix new version of disarmed-delay
Boolean needs to be false not true since `disarmed-delay` is not checking disabled status.
2020-06-17 12:32:52 -04:00
wookieejedi 4bb3132ebb Merge pull request #2474 from wookieejedi/add-large-path-radius-AI-option
Add Large Radius Option as AI Flag for Following Subsystem Path Points
2020-06-16 17:40:35 -04:00
Goober5000 b7e4f5c3c6 Merge pull request #2475 from Goober5000/time_docked_and_cargo
upgrade time-docked and various cargo sexps
2020-06-16 15:33:44 -04:00
wookieejedi 88866efe97 make min a variable 2020-06-16 15:00:35 -04:00
wookieejedi eab6eb639e update comments 2020-06-16 14:45:08 -04:00
wookieejedi 6ebc378827 incorporate comments 2020-06-16 14:39:37 -04:00
Goober5000 899e0c9967 Merge pull request #2476 from Goober5000/weapons_depleted
some more sexp upgrades
2020-06-16 14:15:12 -04:00
Goober5000 aadd7ecbf1 Merge pull request #2479 from Goober5000/objective_sexp_fix
fix some sexps
2020-06-15 22:56:35 -04:00
Goober5000 54409ec928 upgrade and merge the various ammo sexps 2020-06-15 22:54:38 -04:00
wookieejedi 03adff7e42 update logic 2020-06-15 22:22:29 -04:00
Goober5000 3a5884e2c2 fix some sexps
Fix the waypoints-done-delay sexp to work for both ships and wings.

Also, fix the set-object-speed sexp (which is deprecated anyhow) to work for all ships in a wing, not just the wing leader.
2020-06-15 21:13:01 -04:00
wookieejedi 3d77340917 fix missing print call 2020-06-15 10:49:54 -04:00
wookieejedi addbb683fc incorporate comments 2020-06-15 10:17:08 -04:00
Goober5000 e026558b21 some more sexp upgrades
* Merge primary and secondary weapons depleted
* Upgrade the nav/autopilot sexps
2020-06-15 01:32:13 -04:00
Goober5000 a034c3e8da upgrade time-docked and various cargo sexps 2020-06-15 00:33:49 -04:00
Goober5000 7f1d21e69a Merge pull request #2472 from Goober5000/time_sexps
merge and upgrade the time sexps
2020-06-14 23:43:55 -04:00
Goober5000 dc30a7834a Merge pull request #2470 from Goober5000/combine_goal_sexps
combine goal sexps
2020-06-14 23:25:46 -04:00
Goober5000 095a392d5d Merge pull request #2471 from Goober5000/combine_other_sexps
combine and upgrade more sexps
2020-06-14 22:24:31 -04:00
Goober5000 133d73f14e Merge pull request #2473 from asarium/fix/2468
Completely remove santlr4_shared target
2020-06-14 22:13:30 -04:00
Goober5000 fc36b7ce2c Merge pull request #2469 from Goober5000/ship_flag_check
small sexp upgrades
2020-06-14 21:59:44 -04:00
wookieejedi a4f4670b6d remove print statement 2020-06-14 16:40:01 -04:00
wookieejedi 34dd460efb Update naming 2020-06-14 16:39:10 -04:00
wookieejedi 683b433733 fix name 2020-06-14 16:06:43 -04:00
wookieejedi 217778e165 Add Large Raduis Option as AI Flag for Following Path Points
Previously, the default distance for determining if a ship had finished a point in a model path was only 5. This worked fine for ships with low damp or no Newtonian physics. However, it did not work well with ships that use higher damps or Newtonian physics, becuase those ships contiunatlly overshoot that 5 meter distance and get stuck flying in a large circle trying to reach that point. This fix allows modders to set an AI flag to specify that the path distance check uses a larger value of 775 for points that are not the last point in the path. If desired I can add a game settings option that allows modders to set this value.
2020-06-14 16:03:51 -04:00
asarium 56f82479f8 Completely remove santlr4_shared target
This fixes #2468.
2020-06-14 21:25:59 +02:00
Goober5000 aedf541e37 combine hits-left and sim-hits-left 2020-06-14 14:35:15 -04:00
Goober5000 426498efa4 merge and upgrade the time sexps 2020-06-14 14:29:45 -04:00
Goober5000 63d40b7edc combine and upgrade more sexps
This combines the alt-name and callsign sexps, as well as the ship-class and ship-type sexps.
2020-06-14 14:21:31 -04:00
Goober5000 75d8116451 combine goal sexps 2020-06-14 14:12:36 -04:00
Goober5000 b59da60027 also combine gse_recharge 2020-06-14 14:07:37 -04:00
Goober5000 63ccb84299 combine is_ship_stealthy and is_friendly_stealth_invisible, and fix a spelling mistake 2020-06-14 14:02:05 -04:00
Fabian Woltermann e440b978e7 Merge pull request #2467 from EatThePath/spew-more
Extend weaponspew to handle burst weapons and beam weapons
2020-06-14 12:30:26 +02:00
Fabian Woltermann 47afe9303d Merge pull request #2449 from Goober5000/upgrade_objective_sexps_2
upgrade the objective sexps 2
2020-06-14 12:29:25 +02:00
m!m ae3ea33a8a Merge pull request #2465 from asarium/feature/parameterDocumentation
Add capability to have comments in scripting args
2020-06-14 11:55:29 +02:00
m!m 194bd79029 Merge pull request #2466 from asarium/fix/antlrInstall
Fix Antlr installation step
2020-06-14 11:53:33 +02:00
Goober5000 1861065495 add these tweaks to keep the major merges in optimum shape 2020-06-13 21:37:13 -04:00
David Gibson ed5f6a260f Adjusted spacing on weapon descriptions for beams to match formatting for non-beams 2020-06-13 18:58:57 -05:00
David Gibson e9a5bb3250 Restores mvp-style range and velocity handling, and adapts it properly to consider beam weapons. 2020-06-13 18:22:25 -05:00
David Gibson a5ba2ceba9 Corrected comment inaccuracies 2020-06-13 18:13:06 -05:00
David Gibson 0ad15fd3ef Accounted for the differences in range/velocity handling for beams 2020-06-13 17:05:06 -05:00
David Gibson 930b3fe699 Second pass on burst and beam spew for accuracy 2020-06-13 16:14:59 -05:00
David Gibson ffcb4b8c99 first pass of including beam and burst weapons 2020-06-13 14:48:01 -05:00
Goober5000 3ecc0062ab small tweak 2020-06-13 15:16:59 -04:00
Goober5000 a458a0f608 Merge pull request #2409 from Goober5000/weaponspew_tweak
expand -weaponspew to all non-beam weapons
2020-06-13 15:11:33 -04:00
asarium 54b3b9c05e Fix Antlr installation step
This will remove the installation rules for Antlr since they are not
relevant for us.
2020-06-13 21:07:41 +02:00
Goober5000 ff1e328c60 tweak sexp name 2020-06-13 15:07:32 -04:00
Goober5000 bfc8075226 upgrade the objective sexps 2
There's another chunk of objective sexps farther down in sexp.cpp, so this PR addresses those.
2020-06-13 15:06:21 -04:00
asarium 15db77d7fe Add capability to have comments in scripting args
Putting something between /* and */ behind a parameter will make that
appear in the HTML and JSON output now.
2020-06-13 21:03:22 +02:00
Goober5000 ec31c969a0 Merge pull request #2448 from Goober5000/upgrade_objective_sexps
upgrade the objective sexps
2020-06-13 14:59:15 -04:00
Goober5000 8b0e64fa39 Merge pull request #2464 from Goober5000/shut_up_wesley
fix a couple things with mainhall intercom sounds
2020-06-13 14:55:05 -04:00
Goober5000 6771462206 Merge pull request #2452 from Goober5000/upgrade_distance_sexps
fix the way SEXPs check ship distances
2020-06-13 14:50:29 -04:00
m!m f4a8cfcfa0 Merge pull request #2463 from asarium/feature/unifyLuaDoc
Unify and clean up Lua documentation generation
2020-06-13 20:33:35 +02:00
asarium 4a6628e16f Unify and clean up Lua documentation generation
I added a pretty generic container structure for the scripting
documentation when adding JSON output. However, I did not use that new
structure for the HTML output since that was just too much work.

This moves the HTML output over to the new structure so now the
scripting API handling code is independent from how the resulting
documentation is generated. I also moved that code out of the main
scripting code which removes quite a lot of clutter in those files.

This is mostly a straight port of the old code with no significant
changes (except the changes to make it use the new data).
2020-06-13 16:46:26 +02:00
Goober5000 0d1c0e359c silence door and misc sounds too 2020-06-13 01:31:26 -04:00
Goober5000 0ab274dae8 also stop ambient sounds if we're switching campaigns 2020-06-13 00:02:40 -04:00
Goober5000 67ed3a4c7b fix a couple things with mainhall intercom sounds
As noticed in issue #2458, intercom sounds did not stop when pausing the game or loading a mission.  I fixed this by augmenting `main_hall_stop_ambient()` to also stop the intercom.

Additionally, it turns out that the intercom delays were not being calculated correctly due to a very bizarre random number formula.  I overloaded `rand32()` to add a min/max variant and used this instead.
2020-06-12 23:13:11 -04:00
niffiwan f417a87e98 Merge pull request #2461 from asarium/fix/scriptingExit
Remove debug exit
2020-06-13 13:05:34 +10:00
Goober5000 388e4734c5 Merge pull request #2460 from Goober5000/cache_argument_node
cache on the argument node
2020-06-12 17:09:43 -04:00
Fabian Woltermann 0f551fada7 Merge pull request #2459 from The-E/feature/lab_weapons_display
Allow weapons in the lab
2020-06-12 22:59:49 +02:00
Fabian Woltermann e967bd0d68 Use a subsystem index instead of the subobject number to blow up subsystems 2020-06-12 22:36:10 +02:00
asarium d0a642903b Remove debug exit 2020-06-12 21:19:48 +02:00
Goober5000 1d54eb1755 do not cache argument nodes because the action nodes aren't flushed 2020-06-12 14:55:38 -04:00
Fabian Woltermann bf8416d0cf Merge pull request #2456 from JohnAFernandez/Prevent-Edge-Case-Multi-Crash
Prevent Standalone Crash
2020-06-12 17:01:23 +02:00
Fabian Woltermann 43cc6c458a Merge pull request #2457 from asarium/feature/antlrArgParser
Use Antlr for generating argument list parser
2020-06-12 16:13:16 +02:00
Fabian Woltermann 701a2b8c91 More code cleanup 2020-06-12 09:28:15 +02:00
Fabian Woltermann 9f4aab01ea Defer weapon loading until we actually need them
Small code cleanup
2020-06-12 09:24:53 +02:00
Goober5000 49801a152e move from sexp.h to sexp.cpp, and friendlier-ize arg_item 2020-06-12 00:51:50 -04:00
Goober5000 d182b2d951 cache on the argument node
When special arguments are used, the current node cannot be cached because it always contains "<argument>".  So this feature adds the ability to forward the caching to the SEXP node that contains the value being referenced.  To enable this, the internal argument list now contains both the argument text and the node being referenced.  (If there is no node to reference, such as with `for-counter`, the reference will be -1.)
2020-06-12 00:26:31 -04:00
asarium ca27ae16f2 Use Antlr for generating argument list parser
This adds an Antlr grammar for parsing argument lists instead of using a
hand written parser. This allows to write much more complicated syntax
constructs and have all the code being auto-generated. It will also
produce a much more correct parser instead of having all those hacks in
the hand-written one.

This also adds (in addition to supporting the previous syntax) support
for function types along with support for them in HTML and JSON output
formats.

The ANTLR generated parser is included in source form so that it is not
necessary to have an ANTLR installation around if you are not going to
change the grammar. Also includes the necessary runtime code from Antlr.
2020-06-11 21:57:52 +02:00
Fabian Woltermann df99d49681 Make travis happy..... 2020-06-11 18:09:12 +02:00
Fabian Woltermann cf119d241e Initialize Beams too 2020-06-11 16:37:09 +02:00
Fabian Woltermann c19cfccdfa Remove more unused variables 2020-06-11 16:30:41 +02:00
Fabian Woltermann 531cb27254 Make weapon firing more elegant 2020-06-11 16:20:56 +02:00
Fabian Woltermann 69c511497d Remove unused variable 2020-06-11 14:47:34 +02:00
Fabian Woltermann 0c5040e6e1 Avoid int comparison warnings 2020-06-11 14:39:57 +02:00
Fabian Woltermann 779b45417c Use the correct import path 2020-06-11 14:28:55 +02:00
Fabian Woltermann 9f30736a1a Put the action window submenus into separate windows to avoid overlapping menu items. 2020-06-11 13:41:20 +02:00
Fabian Woltermann 1904979006 Get the external weapons display function back
Add action to switch loadouts
Add action to fire weapons
2020-06-11 11:18:08 +02:00
JohnAFernandez c794bef328 Prevent Standalone Crash
If a standalone has only one player connected in a dogfight mission it will crash.  Not fully sure why this doesn't crash in other circumstances, but this check should just be here, anyway.
2020-06-09 23:37:55 -04:00
Goober5000 8a3a40a617 Merge pull request #2455 from Goober5000/fix_compact_multitext
fix compact_multitext_string
2020-06-09 20:40:00 -04:00
Goober5000 f962804b30 fix compact_multitext_string
This is a follow-up to PR #2373.  Tomimaki noticed that the first character was truncated in the cutscene description, and it turned out that the algorithm was slightly wrong.
2020-06-09 19:11:34 -04:00
Fabian Woltermann 84ee31f12a Merge pull request #2441 from EatThePath/min-angles
Settable minimum spawn angles.
2020-06-08 19:52:57 +02:00
Goober5000 8c60e6c5a8 Merge pull request #2453 from Goober5000/xstr_tweak
match strings.tbl
2020-06-08 13:48:20 -04:00
Goober5000 dcbb528d04 change sexp names 2020-06-08 11:52:16 -04:00
Goober5000 92ffff7fac match strings.tbl 2020-06-08 00:18:58 -04:00
Goober5000 1ba8c66a3a tweak the api 2020-06-07 22:47:13 -04:00
Goober5000 156bc2c5d4 fix the way SEXPs check ship distances
Retail has a hud_find_target_distance function that returns the distance between the player position and a bounding box.  This is useful for the HUD because it shows the distance to the perimeter of an object like a jump node or a large ship.  However, this function was re-used for the `distance` SEXP, resulting in the awkward situation where the distance is measured from one ship's center to another ship's bounding box.  This can lead to unexpected results and it also means that the SEXP returns a different distance when the arguments are swapped.

This PR deprecates the original SEXP and introduces the new SEXPs `center-distance` and `bbox-distance` which use consistent methods for both ships.  It also renames the `distance-ship-subystem` SEXP to `center-distance-subsystem` and adds a new `bbox-distance-subsystem` SEXP.
2020-06-07 22:36:46 -04:00
m!m 25d16c3102 Merge pull request #2446 from asarium/feature/scriptingArgParsing
Add parser for scripting argument documentation
2020-06-07 12:06:28 +02:00
m!m c3ac0a3461 Merge pull request #2421 from asarium/feature/luaExecutors
Add feature to execute Lua coroutines at specific points
2020-06-07 12:04:44 +02:00
Goober5000 f0fea13d04 address parameter shadowing noticed by clang 2020-06-07 01:00:29 -04:00
Goober5000 2eea3d3aa8 this is good to have as well 2020-06-07 00:43:18 -04:00
Goober5000 af187f7fbf add the change in function calls 2020-06-07 00:40:20 -04:00
Goober5000 09183fee12 upgrade the objective sexps
Another - hopefully bite-size - sexp upgrade stage.  This takes the objective SEXPs (those which are primarily concerned with the mission log) and upgrades them to use the ship registry.
2020-06-07 00:22:33 -04:00
Goober5000 fa4743a341 Merge pull request #2438 from Goober5000/get_player_from_ship_node
upgrade get_player_from_ship_node
2020-06-06 23:31:33 -04:00
asarium d54d7d41e6 Output parameter information to JSON
Also fixes the parameter strings which currently could not be parsed by
the argument parser.
2020-06-06 23:45:36 +02:00
asarium 614a636ed5 Fix clang-tidy issues
Not sure why travis saw these since I didn't change anything there but
fixing these is also good.
2020-06-06 23:24:08 +02:00
wookieejedi 812452c492 Merge pull request #2447 from The-E/fix/lab_issues
Fix a lab issue and add more explosions
2020-06-06 16:32:03 -04:00
asarium 016c07dc3a Add feature to execute Lua coroutines at specific points
This adds a mechanism for running generic operations at specific points
of the frame execution. This can be used by any part of the code an not
just Lua since it simply executes std::functions. It also adds an
"execution context" concept that specifies in which situation an
operation should be executed.

This is then used by the Lua Coroutines code for resuming coroutines at
specific points instead of always when the awaited promise resolves.
2020-06-06 21:29:48 +02:00
Goober5000 3a8569daad this is now needed 2020-06-06 14:31:36 -04:00
David Gibson 536e97592d minor style fixes 2020-06-06 13:17:12 -05:00
Goober5000 e38a973e80 use enum class 2020-06-06 14:15:55 -04:00
Goober5000 f0cf899787 This expands -weaponspew to optionally list all non-beam weapons. 2020-06-06 14:15:55 -04:00
Goober5000 716cd15281 address feedback 2020-06-06 13:55:00 -04:00
Goober5000 56f3ffae11 convert to p_objp to be consistent 2020-06-06 13:55:00 -04:00
Goober5000 6d53697725 upgrade get_player_from_ship_node
This PR upgrades the function, and the sexps that use it, to take advantage of the new sexp caching.  It also makes `script_eval_multi` more robust in the face of players who might be respawning.
2020-06-06 13:54:59 -04:00
Goober5000 1b11d0d6a9 Merge pull request #2437 from Goober5000/oswpt_and_ship_flag_refactor
another stage of the sexp refactor
2020-06-06 13:53:42 -04:00
m!m 9eb7b4a27b Merge pull request #2445 from asarium/fix/ensureLuaFunctionState
Ensure Lua functions are executed in correct state
2020-06-06 18:59:28 +02:00
Fabian Woltermann 3ee7200ccd Make Travis happy, maybe? 2020-06-06 17:31:46 +02:00
David Gibson 025cf3c7b9 converted some NULL pointers to nullptr as travis commands 2020-06-06 10:11:46 -05:00
Fabian Woltermann c7d08eead3 Add an action to destroy individual subsystems 2020-06-06 15:00:49 +02:00
asarium 367564733e Add parser for scripting argument documentation
This adds a simple parser that takes the existing argument
documentations and parses them so that better documentation can be
generated from that information. This should be sufficient for providing
proper documentation generation for the most common and simple cases of
argument lists (type, name, possible default value, and optional
groups).
2020-06-06 14:02:33 +02:00
asarium 04174e00f8 Ensure Lua functions are executed in correct state
This will ensure that Lua functions will always be executed in the
correct Lua state. Since we now have multiple threads (which are
different lua_State objects) it is possible that the current code could
execute a Lua function in the main state instead of the thread that is
currently executing. This can lead to weird behavior and probably also
to issues inside Lua.
2020-06-06 14:00:23 +02:00
m!m 9e11710369 Merge pull request #2444 from asarium/feature/luaTracing
Add scripting API for tracing custom code
2020-06-06 13:54:11 +02:00
David Gibson b7aeb763f3 fixed my misunderstanding of the const changes in static_rand_cone 2020-06-05 21:38:06 -05:00
David Gibson 9ec63f0882 fixed inconsistent constness in the new overload for static_rand_cone, and added constness to the existing version. 2020-06-05 21:38:06 -05:00
David Gibson 64f61df93f added multiplayer versionof min angle spawn logic 2020-06-05 21:38:06 -05:00
David Gibson a20096abfa added min-angle supporting version of static_rand_cone 2020-06-05 21:38:06 -05:00
David Gibson bb76e2fdcd Implemented minimum angle option for spawned weapons, single player only currently. 2020-06-05 21:38:06 -05:00
Goober5000 13acf77f5a address feedback 2020-06-05 21:34:50 -04:00
Goober5000 5536fbf13b Merge pull request #2443 from Goober5000/refine_exited_state
refine ShipStatus::EXITED state
2020-06-05 20:36:29 -04:00
Goober5000 05d1262abe Merge pull request #2442 from Goober5000/update_clang_tidy
update .clang-tidy based on Discord comments
2020-06-05 20:26:21 -04:00
asarium e8e549ff08 Add scripting API for tracing custom code
This can be used by Lua code to trace the runtime of their code in the
same way the engine already is capable of doing for most in-mission and
mission loading code.

Also adds some tracing scopes to the libRocket code
2020-06-05 22:14:55 +02:00
Goober5000 5f1957a9f8 Merge pull request #2439 from wookieejedi/fix-armor-string-function
Fix minor mis-setting of script function for displaying armor string
2020-06-05 14:23:55 -04:00
Goober5000 d0f1519f60 refine ShipStatus::EXITED state
There is a slight discontinuity where ships that are destroyed have their mission log entries added a bit before `ship_cleanup` is called.  This addresses that.
2020-06-05 14:20:35 -04:00
Goober5000 fdf2bf6ba2 update .clang-tidy based on Discord comments
This removes `readability-avoid-const-params-in-decls` from the list of things clang checks.  Function declarations and headers should be the same, so it makes no sense to warn about `const` in one but not the other.

This also alphabetizes the exceptions for easier reading.
2020-06-05 13:57:24 -04:00
Fabian Woltermann 67d048aa6c further improvements 2020-06-05 16:26:57 +02:00
wookieejedi 59073533a8 Fix minor missetting of script function for displaying armor string
Previosuly, using the script function ArmorClass did not properly display the actual armor class, instead it always displayed -1. This PR fixes that. I have tested these changes and they now proprely display the armor class.
2020-06-04 18:06:03 -04:00
Goober5000 f7b43e5fd0 convert to p_objp to be consistent 2020-06-04 13:06:06 -04:00
m!m 2e8fc3264d Merge pull request #2430 from asarium/feature/libRocketCampaign
Make the campaign room API available to scripting
2020-06-04 16:55:27 +02:00
wookieejedi 8ce3f1e365 Merge pull request #2436 from wookieejedi/fix-weapon-loading
Fix Pilot and Subsystem Weapon Loading
2020-06-04 10:04:43 -04:00
Goober5000 77d26970ff and another one 2020-06-04 01:58:35 -04:00
Goober5000 57d2cb2871 deal with clang 2020-06-04 01:28:21 -04:00
Goober5000 a5be6ed2ea another stage of the sexp refactor
This PR uses `eval_ship` and `eval_wing` to optimize `object_ship_wing_point_team` and `sexp_deal_with_ship_flags`.  The API changed a bit, but to ensure compatibility, there are fields and functions to support the old behavior.  These are temporary and will be removed when all changes have been merged via PRs.
2020-06-04 00:44:32 -04:00
wookieejedi b2489eff7d add comments 2020-06-04 00:31:10 -04:00
wookieejedi e850f043f7 Fix Pilot and Subsytem Weapon Loading
This PR fixes the logic for setting weapon amounts for both the pilot and subsystems of a ship. Previoisly in #PR 2318 this distinction was not checked, so this PR properly adds that check and distinction.
2020-06-03 23:35:27 -04:00
asarium bf521f1c6b Make the campaign room API available to scripting
This makes the necessary campaign room API available to the scripting
API so that it can be implemented using libRocket. Also adds an
engine.sleep function which I needed for making my Lua debugger work
reliably.
2020-06-03 17:49:15 +02:00
Fabian Woltermann ee3da1cb55 Merge pull request #2435 from Goober5000/constify_autopilot
add const-correctness to the autopilot API
2020-06-03 10:40:31 +02:00
Goober5000 70ee8461ab add const-correctness to the autopilot API
This was suggested by the sexp overhaul but is useful on its own too.  Some of the `const` changes cascade a bit.
2020-06-02 23:06:48 -04:00
Tyler Blount 4b49f49206 Merge pull request #2434 from TRBlount/fix/thruster_depth
Temporary fix for thrusters rendering through ship geometry
2020-06-02 15:28:17 -06:00
Goober5000 f948687ce7 Merge pull request #2429 from Goober5000/beam_turret_sexp_consolidation
consolidate several sexps related to beams and turrets
2020-06-02 17:07:48 -04:00
Goober5000 d1214a0164 Merge pull request #2431 from Goober5000/sexp_overhaul_infrastructure
additional infrastructure for sexp caching and ship registry
2020-06-02 16:08:19 -04:00
Tyler Blount 37bf779e77 Remove unused variable 2020-06-02 13:02:48 -06:00
Tyler Blount 28fd52aa51 Change tertiary thruster depth 2020-06-02 11:52:29 -06:00
Tyler Blount 8a6b784d5f Merge pull request #2433 from The-E/fix/thrusters_in_lab
Switch on the physics system when displaying thrusters
2020-06-02 11:32:51 -06:00
Fabian Woltermann dd2e01d9a9 Also make sure that weapon thrusters work 2020-06-02 08:44:19 +02:00
Fabian Woltermann e566dc2f30 Switch on the physics system when displaying thrusters 2020-06-02 08:34:24 +02:00
Goober5000 ff3939b437 add a couple things to bump the CI build 2020-06-02 00:44:58 -04:00
Goober5000 80f0663cfa shut up, clang 2020-06-01 23:11:29 -04:00
Goober5000 ed5360899e add back the send_ship(shipnum) funcion, and also add the sim-hull fix 2020-06-01 21:29:18 -04:00
Goober5000 6354e5d2ce add non-sexp.cpp (and minimal sexp.cpp changes) from overhaul wip 2020-06-01 21:14:10 -04:00
Goober5000 e47540b47a deal with shadowed declaration 2020-06-01 18:22:50 -04:00
Goober5000 289664dea2 consolidate several sexps related to beams and turrets
This is part of the ongoing sexp overhaul relating to performance and caching.  This PR combines functions for several sexps that are very similar, and it also uses the `eval_ship` speedy lookup function.  As a bonus, it allows `turret-tagged-only` and `turret-tagged-clear` to run for multiple ships at a time.
2020-06-01 00:19:10 -04:00
Goober5000 a782fc560e Merge pull request #2427 from Goober5000/tree_lookup_speedup
optimize sexp tree lookup
2020-05-31 16:49:37 -04:00
wookieejedi 9ad57ee9e3 Merge pull request #2426 from wookieejedi/toggle-intel-entries
Adds `tech-remove-intel-xstr` sexp
2020-05-31 16:48:24 -04:00
wookieejedi 2526fa70dc Add in commented sections 2020-05-31 14:09:31 -04:00
wookieejedi 9109876de7 Fix overlapping ID 2020-05-31 13:53:10 -04:00
wookieejedi 79f98a223d and one more spacing fix 2020-05-31 13:48:46 -04:00
wookieejedi f3a37494f6 Fix last missing character 2020-05-31 13:47:50 -04:00
wookieejedi 855048e126 fix missing character 2020-05-31 13:45:40 -04:00
Goober5000 3663c3f9e9 optimize sexp tree lookup
The `special_argument_appears_in_sexp_tree` function can run multiple times per event, especially for repeating events, so it's a good idea to cache the result.  This avoids the need to iterate through potentially the entire tree, checking every single node.
2020-05-31 13:39:17 -04:00
wookieejedi aa502c4b81 Incorporate feedback 2020-05-31 13:30:48 -04:00
wookieejedi 4ecb35b97f Adds tech-remove-intel-xstr sexp
In regards to @MjnMixael's request in #2425, this PR adds the sexp `tech-remove-intel-xstr`, which simply toggles off the specified intel entry.
2020-05-31 09:35:29 -04:00
Goober5000 c41d9bbf5a Merge pull request #2424 from The-E/fix/weapon_crashes_lab
Fix a crash in the Lab when viewing bombs
2020-05-30 22:35:37 -04:00
Fabian Woltermann 65a8f39479 Remove unnecessary comment 2020-05-30 21:05:11 +02:00
Fabian Woltermann 922b06fe3b These checks are not necessary 2020-05-30 21:04:24 +02:00
Fabian Woltermann fd37e21a11 Clean up objects and particle effects when switching models.
Also pause physics when we do not need them.
2020-05-30 21:01:47 +02:00
Fabian Woltermann b6dceaf692 Do not do any radar processing nonsense while in the lab 2020-05-30 20:46:50 +02:00
Goober5000 3851aba765 Merge pull request #2420 from Goober5000/use_get_operator_optimizations
use get_operator_* optimizations
2020-05-30 12:42:10 -04:00
Goober5000 52be12f262 tweak 2020-05-30 01:19:46 -04:00
Goober5000 a039b41c3b use get_operator_* optimizations
Awhile back, the get_operator_const and get_operator_index functions were enhanced to cache the result of the operator lookup.  But this only works when called on the node itself, not the text.  So let's call these functions on the node whenever possible.
2020-05-30 00:58:29 -04:00
m!m c37ea59cbd Merge pull request #2419 from asarium/fix/mainHallOutOfRange
Fix out of range memory access in main hall
2020-05-29 16:27:27 +02:00
m!m 408fe27c32 Merge pull request #2397 from asarium/feature/luaPromises
Add Lua API for promises and async coroutines
2020-05-29 16:27:15 +02:00
wookieejedi ab0f7d853d Merge pull request #2404 from wookieejedi/fix-draw-offscreen-indicator-lua-call
Fixes gr.drawOffscreenIndicator
2020-05-28 13:29:53 -04:00
asarium 74cc1d4c92 Fix out of range memory access in main hall
If you press a key such as Ctrl the code gets a bitfield with a high bit
set so when the key code is used as an index it produces an out of range
error.

Thank you AddressSanitizer!
2020-05-28 18:03:01 +02:00
wookieejedi 6a36babf54 move restore out of if block 2020-05-28 10:01:13 -04:00
Fabian Woltermann e4f5771420 Merge pull request #2418 from The-E/fix/debris_creation
Make sure that large ship debris is correctly markes as not expiring
2020-05-27 20:34:15 +02:00
Fabian Woltermann 1055d026f6 Make sure that large ship debris is correctly markes as not expiring 2020-05-27 18:20:45 +02:00
Goober5000 d5e7b7ffed Merge pull request #2410 from notimaginative/silence_debug_spew
remove super annoying debug spew on console
2020-05-27 10:38:50 -04:00
Goober5000 27afbed6e1 Merge pull request #2399 from wookieejedi/fix-ai-guard-this
Fix 'Guard Attack This' Behavior with AI Flag
2020-05-26 17:52:46 -04:00
Goober5000 b773ed8fd7 Merge pull request #2416 from The-E/fix/debris_deletion
Fix a bug in the debris deletion code
2020-05-26 17:16:37 -04:00
Fabian Woltermann 9907c98fe2 Fix unintentional behaviour change, add comment about the purpose of the Hull_debris_list 2020-05-26 21:11:55 +02:00
Fabian Woltermann 0c9bbe5223 Fix a bug in the debris deletion code introduced by the lab explosion feature commit. This also makes the debris code use the new flag system to mark debris pieces as nondeleteable instead of relying on a magic lifeleft value. 2020-05-26 16:55:45 +02:00
asarium 08c6e0d072 Introduce error state of promises
This is necessary after all to properly clean up resources if an
operation becomes invalid.

Also bumps Visual Studio version to 2017 on Appveyor.
2020-05-24 22:07:09 +02:00
Goober5000 5cfc3cf059 Merge pull request #2413 from Goober5000/fred_loadout_fix
fix incorrect consolidation
2020-05-24 13:11:43 -04:00
Goober5000 bec5d02750 Merge pull request #2414 from Goober5000/fix_retail_save_format
fix corrupted retail save format
2020-05-24 13:11:29 -04:00
wookieejedi 38e3c425c5 remove flag 2020-05-24 09:00:26 -04:00
asarium ebcf686cf7 Add Lua API for promises and async coroutines
This adds a Lua API for representing asynchronous operations and running
coroutines based on those operations comfortably. This is very similar
to features other languages have introduced such as C# or JavaScript. In
fact, the whole "promise" thing is derived from how JavaScript
represents these operations.

This is the initial and very basic system for supporting async
coroutines in Lua. There is no native support for running these
operations at specific points (they run whenever the awaited promise
resolved) or making sure they do not leak through different game states.
2020-05-24 12:36:01 +02:00
Goober5000 2d3fef4cf2 fix corrupted retail save format
This is a follow-up to #2348.  One part of the change wasn't tested, and it turned out to be important.
2020-05-24 01:11:19 -04:00
Goober5000 89be07116b fix incorrect consolidation
In PR #2318, I consolidated the code a little too much.  The partial-loadout checks should not have been under the `SUBSYS_STATUS_NO_CHANGE` check, because this would cause partial loadouts to fail if the percentage was adjusted but the actual weapon in the loadout was not changed.

Thanks to @wookieejedi for spotting this bug.
2020-05-24 00:22:13 -04:00
Goober5000 96bee4a4fa Merge pull request #2405 from Goober5000/xstr_tweak
tweak some untranslated internal XSTR strings
2020-05-21 23:35:19 -04:00
Goober5000 98d7a9f6f6 tweak some untranslated internal XSTR strings
This is a minor follow-up to PR #2390.  There are a few minor differences between untranslated strings and the internal strings in strings.tbl; this PR fixes them.
2020-05-21 19:09:03 -04:00
Goober5000 3e638bbe9e Merge pull request #2406 from asarium/build/fixQtCache
Use architecture specific cache for Qt
2020-05-21 19:08:31 -04:00
asarium e4d10fd127 Use architecture specific cache for Qt
Otherwise 32-bit might bet binaries for 64-bit or the other way around.
2020-05-21 23:17:54 +02:00
wookieejedi 47e6162eba update so check includes wing section 2020-05-21 15:29:26 -04:00
m!m 7c3e5bc4fc Merge pull request #2403 from asarium/build/githubQt
Install Qt in GitHub actions
2020-05-21 17:34:14 +02:00
Goober5000 539662fd28 Merge pull request #2402 from Goober5000/sexp_data_caching
SEXP data caching
2020-05-21 10:45:04 -04:00
Goober5000 57b534c554 extra insurance 2020-05-20 21:42:00 -04:00
wookieejedi 0b0a78cb06 cleanup whitespace diff 2020-05-20 12:25:25 -04:00
Goober5000 6ec28f6de5 Merge pull request #2389 from Goober5000/ai_goal_target_name_fix
make Goal_target_names dynamic
2020-05-19 23:27:40 -04:00
wookieejedi 94689972b6 refactor function per discussion 2020-05-19 16:28:27 -04:00
wookieejedi 6143953dd9 Fixes gr.drawOffscreenIndicator
Previously the scripting call `gr.drawOffscreenIndicator` did not properly draw the indicator and/or return coordinates. After some bug hunting it turns out it is because there gauge was not being set to active. This PR adds that line and retores the intended functionality. Tested and works as expected.
2020-05-19 15:31:18 -04:00
Goober5000 e265727ea1 add catch based on feedback 2020-05-19 14:50:42 -04:00
Goober5000 fb27a8a599 or this 2020-05-19 13:48:47 -04:00
Goober5000 b4843b466d use default member initializers and non-shadowy parameter names 2020-05-19 13:48:47 -04:00
Goober5000 ee953aa270 don't remove the parse object because it's still valid 2020-05-19 13:48:47 -04:00
Goober5000 9923c87bc1 cache ships, numeric literals, and variables 2020-05-19 13:48:47 -04:00
Goober5000 cf7f8446b2 wip 2020-05-19 13:48:47 -04:00
Goober5000 8667891fc2 use dynamic strings 2020-05-19 13:48:06 -04:00
Goober5000 5f74388790 add newline 2020-05-19 13:48:06 -04:00
Goober5000 067b250be9 make Goal_target_names dynamic
If ever there were more than 100 goal targets in a mission, the old version of ai_get_goal_target_name would start corrupting memory.  Rather than making a hacky workaround, this just makes it dynamic.
2020-05-19 13:48:06 -04:00
Goober5000 775984ae36 Merge pull request #2390 from Goober5000/xstr_revert
clean up handling of translated vs. untranslated English
2020-05-19 12:51:41 -04:00
Goober5000 3a7e604af9 Merge pull request #2401 from Goober5000/small_sexp_fix
make some debug code only run in debug
2020-05-19 12:50:19 -04:00
Goober5000 d4c429f3b1 Merge pull request #2394 from Goober5000/weapon_stats
Weapon statistics for comparison and extended descriptions
2020-05-19 12:49:35 -04:00
Goober5000 933f20efaa Merge pull request #2392 from Goober5000/modify_weapons_loadout_check
modify weapons loadout check
2020-05-19 12:48:59 -04:00
wookieejedi 5155e23430 Add as default to version 20 and up 2020-05-19 11:38:02 -04:00
asarium e3b1beb187 Install Qt in GitHub actions
This allows building QtFred on Windows which was the last thing missing
to achieve parity with Appveyor.
2020-05-19 17:11:05 +02:00
m!m 6ca29a79ba Merge pull request #2400 from asarium/build/clangReadability
Enable sensible clang readability checks
2020-05-19 17:04:29 +02:00
Taylor Richards 95690b1e11 properly update stats info in chat lobby 2020-05-19 04:15:06 -04:00
Taylor Richards 4f2765fdf2 compensate for ignored pad value in stats struct size 2020-05-19 04:15:06 -04:00
Taylor Richards 899997d1c1 fix sizing issues in stats conversion
These issues caused the stats packet to keep growing during
every conversion between network and game structs causing
memory issues and data corruption. These bugs were hidden by
the fact that stats packets were discarded by the server due
to another bug.
2020-05-19 04:15:06 -04:00
Taylor Richards 4e8fa1253b remove super annoying debug spew on console 2020-05-19 04:13:40 -04:00
Goober5000 498e5ef42e make some debug code only run in debug
This code is highly inefficient (find_parent_operator() is O(n) for Num_sexp_nodes, and it runs every frame for all sexps with negative values) and should not actually be necessary.  But it is useful as a debug tool, so I added some #ifdef's.
2020-05-18 21:05:41 -04:00
asarium d29e236250 Enable sensible clang readability checks
This enables the clang readability checks that I found to be sensible. I
disabled a few that would have caused a lot of unnecessary warnings in
our code.
2020-05-18 20:57:19 +02:00
wookieejedi 584db57cce Fix 'Guard Attack This' Behaviow with AI Flag
This PR allows the setting `Guards Attack This` in `objecttype.tbl` to actually work.

Background: there are two instances in the code where AI that is patrolloing/guarding a ship decideds to go attack guardees attacker. One case is if the guardee is hit, and the other case if there are just hostile ships present (ie it scans the mission every so often).
The `Guards Attack This` check was only applied to the scna the mission case, and not the guardee hit case. Thus if the guardee was hit by a ship that had the  `Guards Attack This` setting off, the guard would still attack since that check was never being performed for that guard case. By default all object types hae `Guards Attack This` set to `true.` But if a modder didn't want fighters guarding a ship to go off and try to kill a large captial ship then they may think setting this value would be a good way to do that. Unforunately this wouldn't work, for the reasons outlined above.

Chnage: this PR adds the `Guards Attack This` check into the guardee is hit case, estentally making the behavior work as expected by a modder. Given this is a AI behavior change I have added an optional AI flag to toggle this fix on. I have tested this and it works as expected.
2020-05-18 09:00:38 -04:00
Goober5000 880005f758 or this 2020-05-16 14:22:46 -04:00
Goober5000 ec1a35f624 better variable name 2020-05-16 14:22:46 -04:00
Goober5000 575573334b modify weapons loadout check
Based on feedback, this PR now allows gaps in weapon loadouts, but if any gaps exist they must come at the bottom.
2020-05-16 14:22:46 -04:00
Goober5000 82b9a392e1 fix CI thing 2020-05-16 14:22:00 -04:00
Goober5000 ab2a2d46d6 make cmdline-friendly 2020-05-16 14:22:00 -04:00
Goober5000 b0f812b808 some fixes 2020-05-16 14:22:00 -04:00
Goober5000 7e8ffcec86 also list weapons whose base weapon is player-allowed 2020-05-16 14:22:00 -04:00
Goober5000 7a9bebecf6 fix multiplier based on new info 2020-05-16 14:22:00 -04:00
Goober5000 c005aa5ce2 tweak 2020-05-16 14:22:00 -04:00
Goober5000 1d00c296dd include additional missiles 2020-05-16 14:22:00 -04:00
Goober5000 dd4036d8df add useful comment 2020-05-16 14:22:00 -04:00
Goober5000 4b42829aa0 MVP weapon stats, and fix shockwave determination 2020-05-16 14:22:00 -04:00
Goober5000 7f8eaa275c weapon stats for spreadsheet 2020-05-16 14:22:00 -04:00
Goober5000 329fd023ec Merge pull request #2396 from Goober5000/2298_followup
revert the clang-tidy changes from #2298
2020-05-16 14:20:04 -04:00
Goober5000 2e0a84010e revert the clang-tidy changes from #2298
These are far too pedantic, and were not related to the feature in #2298 anyway.
2020-05-16 00:01:06 -04:00
Goober5000 9e0c37364c Merge pull request #2298 from asarium/feature/pureLuaScriptTable
Add capability to have a pure lua script
2020-05-15 15:39:46 -04:00
Goober5000 d83d1b41ee make clang happy 2020-05-15 15:34:54 -04:00
Goober5000 d26a12464c clean up handling of translated vs. untranslated English
Since the original release of FS2, internal strings have been translated to their English entries in strings.tbl but external strings have not been translated to their English entries in tstrings.tbl.  It appears that string translation was universal until it was disabled via a hack, probably due to FRED idiosyncrasies (see comment in `fred_init()`), and then not re-enabled for release.  PR #2343 re-enabled it, but this turned out to have undesirable side-effects since many mods used incorrect XSTR indexes for external strings.

This PR restores the previous behavior and also cleanly separates localization into translated and untranslated modes.  FRED will always run in untranslated mode.  FSO will run in translated mode for all languages except English, where it will run in untranslated mode UNLESS the new option `$Use tabled strings for the default language` is enabled in game_settings.tbl.
2020-05-14 19:19:52 -04:00
Goober5000 f80693213c Merge pull request #2387 from Goober5000/fix_improper_ai_get_goal_target_name
fix improper usage of ai_get_goal_target_name
2020-05-14 19:08:21 -04:00
Goober5000 dbc26548f5 Merge pull request #2377 from wookieejedi/fix-warp-flag-issues
Fix warp flag and code issues
2020-05-13 23:41:31 -04:00
Goober5000 1ef90d79c4 Apply suggestions from code review
some comment tweaks
2020-05-13 20:15:36 -04:00
Goober5000 caf3eaad98 fix improper usage of ai_get_goal_target_name
The ship goals dialog was incorrectly assigning a goal target name for every dockpoint, which could quickly cause the limit to be exceeded if the FREDder browsed a lot of dockpoints.

This also indicates a need to fix the goal target name system as the counter is never decremented.  That will be in a subsequent PR.
2020-05-13 03:05:17 -04:00
Goober5000 efbace48b8 Merge pull request #2332 from Goober5000/mantis_3147_flag
add an ai-profiles flag to govern the Mantis 3147 fix
2020-05-13 00:48:44 -04:00
Goober5000 d961fa1bb6 use mod_supports_version 2020-05-12 21:46:19 -04:00
Tyler Blount c6a999ab7a Merge pull request #2384 from TRBlount/fix/weapon_render_type
Make sure modular tables can overwrite weapon model info
2020-05-12 00:20:01 -06:00
wookieejedi 5df12322e5 Incorporate feedback 2020-05-11 18:05:21 -04:00
wookieejedi f7d474cb77 Merge branch 'master' into fix-warp-flag-issues 2020-05-11 16:35:37 -04:00
Tyler Blount 764a74dbd2 Make sure modular tables can overwrite weapon model info 2020-05-11 13:54:50 -06:00
Goober5000 1d471e254b Merge pull request #2342 from Goober5000/mantis_1947
implement Mantis 1947, treat ship comm systems the same as player comm systems
2020-05-10 15:36:45 -04:00
Goober5000 771d0c7a38 Merge pull request #2383 from wookieejedi/update-pow)-to-multiply
Update cases of pow(x,2) to just multiply values
2020-05-10 14:45:47 -04:00
wookieejedi 94bfb2fe75 Update cases of pow(x,2) to just multiply values
Having recalled that other SCP folks stated pow shoud not be used to do simple squaring, I figured it might be a good idea to update the two instances I found where that was the case.
2020-05-10 13:17:03 -04:00
Fabian Woltermann 8fd2813ddd Merge pull request #2382 from The-E/fix/particles_in_lab
do on-frame processing for particle effects in the lab
2020-05-10 17:38:11 +02:00
Fabian Woltermann a0180fc004 Init the particle system and use the correct frametime counter 2020-05-10 15:29:28 +02:00
Fabian Woltermann 7a6aa5334d do on-frame processing for particle effects in the lab 2020-05-10 13:20:18 +02:00
Goober5000 d8f388996d Merge pull request #2376 from The-E/feature/kill_ship_in_lab
Make explosions happen in the lab
2020-05-10 00:31:56 -04:00
wookieejedi da55499817 Merge pull request #2381 from wookieejedi/fix-texture-replace-with-showship
Fixes texture replace not working with show ship
2020-05-09 23:32:21 -04:00
wookieejedi e1dbcf4dd6 Add back in disabled check for future use of the engines ok function 2020-05-09 17:18:31 -04:00
wookieejedi cb5a1000a6 Fixes texture replace not working with show ship
This PR allows the `ship_render_show_ship_cockpit` function to properly detect replacement textures. Fortunately just a one line fix.
2020-05-09 15:48:34 -04:00
Fabian Woltermann 94bd8da5db Merge pull request #2373 from Goober5000/parse_tweaks
some code tweaks from an old branch
2020-05-09 20:21:01 +02:00
Fabian Woltermann 03926b8dde Merge pull request #2379 from The-E/fix/naked_int3_in_missionmessage
Remove naked int3() call in missionmessage
2020-05-09 18:44:18 +02:00
Fabian Woltermann 764bbac99f The original Volition code called Int3() here; since there is a way out that does not require us to crash, we should just not crash. 2020-05-09 10:43:13 +02:00
wookieejedi 280ff2d4f0 Incorporate feedback 2020-05-08 22:40:58 -04:00
wookieejedi 45775a0d97 One more update to the scripting function calls 2020-05-08 11:29:07 -04:00
wookieejedi c4d405e33e change to nullptr 2020-05-08 11:14:53 -04:00
wookieejedi 86e1ebaf08 fixed copy paste error with new script function 2020-05-08 10:34:20 -04:00
wookieejedi 82921467a5 Update ship.cpp 2020-05-08 09:58:35 -04:00
wookieejedi c2820f10c8 Updates and fixes multiple warp out related code 2020-05-08 09:53:32 -04:00
Goober5000 d52bddf0dc Merge pull request #2347 from EatThePath/disable-doublefire-take-2
Disable doublefire take 2
2020-05-08 02:01:40 -04:00
Fabian Woltermann cd88663a92 Avoid a signed/unsigned comparison 2020-05-08 07:56:08 +02:00
Goober5000 0e9a72a37b make clang happy 2020-05-07 21:57:18 -04:00
Fabian Woltermann 1c10479d2f Pause the AI while in the lab 2020-05-07 22:27:47 +02:00
David Gibson b88ccfb924 added an explanatory comment. Also reunited some related code I'd inadvertantly pushed apart, per review. 2020-05-07 15:09:19 -05:00
Fabian Woltermann 11e9fa27c6 REdo a few things 2020-05-07 22:00:19 +02:00
Fabian Woltermann f4f6e74456 Add new "Actions" window to the lab viewer and add a "Destroy Ship" action to make explosions happen 2020-05-07 21:35:25 +02:00
Fabian Woltermann de2e9ada72 WIP 2020-05-07 21:34:12 +02:00
Fabian Woltermann 4005a60b32 Merge pull request #2375 from The-E/fix/damage_lightning_in_lab
Make the lab's "show damage lightning" flag work again.
2020-05-07 21:31:48 +02:00
Fabian Woltermann 2e6306d85f Merge pull request #2374 from The-E/fix/texture_replacement_in_lab
Apply tabled texture replacements when loading ships in the F3 lab
2020-05-07 20:36:16 +02:00
Fabian Woltermann e1f231fcf0 Use the tabled max hull strength instead of a constant 2020-05-07 19:01:36 +02:00
Fabian Woltermann 86e898c9ea Use modern loops 2020-05-07 16:04:06 +02:00
Fabian Woltermann df1491fd9e Make the lab's "show damage lightning" flag work again.
Note that it may take a few frames for lightning to disappear when unchecking that checkbox.
2020-05-07 15:18:56 +02:00
Fabian Woltermann 0b8f203371 Apply tabled texture replacements when loading ships in the F3 lab 2020-05-07 14:48:14 +02:00
wookieejedi 1d152fcc73 Merge pull request #2371 from wookieejedi/on-depature-started-hook
Add `On Departure Started` Hook
2020-05-06 22:48:42 -04:00
Goober5000 c9fb046024 update header 2020-05-06 14:38:40 -04:00
Goober5000 c4b8020ebc some code tweaks from an old branch
Minor edits from an obsolete branch that are still useful in cleaning up the code.
2020-05-06 14:25:08 -04:00
wookieejedi a2c7a344da Add On Departure Started Hook
This PR adds a scripting hook which triggers when a ship begins it's departure process. It has one variable that is the ship. I have tested and it works as expected. This new hook is very useful for triggering events whenever a ship needs an alteration to it's departure methods. For example, in Fate of the Galaxy we require ships to warp out along a certain vector. This hook allows us to see when the ship is begining that depature and then break the ship's warp, order the ship to instead follow a waypoint path, and then jump out.
2020-05-06 09:25:10 -04:00
Goober5000 f8e5c9f7a3 Merge pull request #2343 from Goober5000/fix_mantis_2942
implement XSTR check as described in Mantis 2942
2020-05-05 22:28:20 -04:00
wookieejedi bebb69e28f Merge pull request #2369 from wookieejedi/pain-flash-hook
Adds `On Pain Flash` Scripting Hook
2020-05-05 16:59:45 -04:00
Goober5000 aef4c1ba3c address feedback 2020-05-05 14:38:50 -04:00
Goober5000 801a6031e3 Merge pull request #2367 from Goober5000/aiturret_fix
fix some code rot
2020-05-05 14:01:34 -04:00
Goober5000 4c573e2989 Merge pull request #2368 from Goober5000/support_ship_override
add two useful cheat keys
2020-05-05 14:00:59 -04:00
wookieejedi aa4e300153 switch to correct hook type 2020-05-05 13:55:57 -04:00
wookieejedi 3695f0ff93 remove unneeded CHAPAINFLASH 2020-05-05 13:51:36 -04:00
wookieejedi 7dc38f7752 Update to new script format 2020-05-05 13:46:53 -04:00
Goober5000 5ab611a8b1 this reason is only applicable in debug builds 2020-05-05 12:08:22 -04:00
Goober5000 0577b69d69 address CI complaint 2020-05-05 11:48:46 -04:00
wookieejedi 6897024b29 Adds On Pain Flash Scripting Hook
This PR adds a scripting hook which triggers when the pain flash is shown. It has one variable that lists what type of flash was shown, shield with `Pain_Type == 0` and hull with `Pain_Type == 1` .  I have tested and it works as expected.
2020-05-05 10:03:48 -04:00
Fabian Woltermann ffd5fdc764 Merge pull request #2366 from wookieejedi/carry-glowmap-status
Updates glowmap settings for a ship to also apply to ship's cockpit
2020-05-05 10:21:53 +02:00
Goober5000 e985961ed5 add two useful cheat keys
`+Shift+R will enable or disable support ships

`+Shift+U will scan or unscan the targeted ship, or ship subsystem
2020-05-05 01:02:17 -04:00
Goober5000 89a722d41a placeholder for future feature implementation 2020-05-05 00:14:16 -04:00
Goober5000 3ca187127d move comment 2020-05-05 00:01:30 -04:00
Goober5000 35e67d4574 possibly fix some code rot 2020-05-04 23:33:06 -04:00
wookieejedi 8b7253cfc1 Updates glowmap settings for a ship to also apply to ship's cockpit
The sexps that activate and deactive glowmaps are very useful for ships, though previously the glowmap status was not passed to the ship's cockpit. This PR adds the ability for glowmap status to carry to this ship's cockpit (if it has one).
2020-05-04 22:07:49 -04:00
Goober5000 7ec425f341 Merge pull request #2345 from Goober5000/fix_mantis_2791
Fix mantis 2791
2020-05-04 20:27:29 -04:00
Goober5000 e4b2791c4e Merge pull request #2353 from Goober5000/support_ship_cleanup
clean up the support ship code a bit
2020-05-04 16:13:06 -04:00
Fabian Woltermann e5c2b76469 Merge pull request #2363 from The-E/fix/post_process_aa_cmdline
Unify the way post-process antialiasing is switched on
2020-05-04 22:12:39 +02:00
Goober5000 4c5bc1fa6c Merge pull request #2360 from Goober5000/fix_2335
fix issue 2335
2020-05-04 16:12:18 -04:00
Fabian Woltermann 857a622caa Make Travis happy 2020-05-04 21:29:53 +02:00
Fabian Woltermann bdc6145b2c Deprecates the -fxaa and -smaa cmdline parameters in favour of a more generalized -aa; This also ensures that the smaa render targets are always initialized. 2020-05-04 18:30:11 +02:00
wookieejedi 07ce8a9c70 Merge pull request #2362 from wookieejedi/fix-glowmap-explode-flag
Fix Glowmap flag not carrying over to final ship explosion
2020-05-04 07:35:36 -04:00
wookieejedi e42ed47c61 Previously if a ship's glowmaps were deactivated via sexp, then the glowmaps would reaactivie at the ship's final explosinos. This PR fixes that by carrying that flag into the ship explosion FX code.
Previously if a ship's glowmaps were deactivated via sexp, then the glowmaps would reaactivie at the ship's final explosinos. This PR fixes that by carrying that flag into the ship explosion FX code.
2020-05-03 23:36:42 -04:00
Goober5000 ce3b9b62b1 Merge pull request #2336 from Goober5000/hotkey_fixes
add +Hotkey Team: to override IFF designation in hotkey list
2020-05-03 17:29:35 -04:00
Goober5000 794863c5e7 Merge pull request #2348 from Goober5000/mantis_2867
bring save format up to date (Mantis 2867)
2020-05-03 15:42:48 -04:00
asarium 544029f66f Add capability to have a pure lua script
This adds the capability to have a Lua script that does not need to use
our table syntax at all but instead defines the hooks by calling API
functions. This also makes it possible to add hook functions at runtime
if the script requires that.

Also clean up some unused debug stuff.
2020-05-03 14:33:42 +02:00
Goober5000 38e04b6151 Merge pull request #2354 from Goober5000/cue_voice_tweak
add overlooked generic file
2020-05-02 16:48:56 -04:00
Goober5000 3c76cc6524 add overlooked generic file
It turns out that the extant placeholder wav has an underscore in the filename, so add that to the list.
2020-05-02 13:54:13 -04:00
niffiwan 3c7f73f4d8 Merge pull request #2349 from Goober5000/allow_empty_weapons_on_locked_ships
allow empty weapons on locked ships
2020-05-02 20:01:23 +10:00
Fabian Woltermann 5366073356 Merge pull request #2358 from The-E/fix/aa_shader_unloading
A followup to the recent SMAA fixes
2020-05-01 13:30:56 +02:00
Fabian Woltermann 23fbdf7e64 Clean up the aa shader loading/unloading code to handle cases where we switch between FXAA and SMAA correctly 2020-05-01 10:55:20 +02:00
Goober5000 5135cded94 Merge pull request #2357 from chief1983/datacorder
Use full path  in SFTP, unlike the FTP one this was modified from.
2020-04-30 22:42:12 -04:00
Cliff 519d1f59f8 Use full path in SFTP, unlike the FTP one this was modified from. 2020-04-30 16:02:03 -05:00
Fabian Woltermann b9be2ad85e Merge pull request #2356 from The-E/fix/smaa_presets
Fix bug in SMAA application
2020-04-30 13:05:58 +02:00
Fabian Woltermann 7121a3f748 Update the last_frame AA mode during cmdline parsing. 2020-04-30 11:08:25 +02:00
Fabian Woltermann 7439cf2cc3 wording 2020-04-30 10:57:54 +02:00
Fabian Woltermann 570dc5f3de Make sure the SMAA presets are actually passed to the shader stages and that the SMAA shader is recompiled at runtime if the preset changes. 2020-04-30 10:55:24 +02:00
Cliff Gordon 620fdbde08 Merge pull request #2352 from chief1983/datacorder
Fix Travis secure var declaration (use travis encrypt VAR='value')
2020-04-29 17:21:57 -05:00
Cliff fdb7e41ed4 Fix Travis secure var declaration (use travis encrypt VAR='value') 2020-04-29 14:32:08 -05:00
Goober5000 4cb3b393da clean up the support ship code a bit
Due to code rot, the support ship hull repair code was a bit more tangled than it should have been, so I tidied it up.  I also fixed a bug Sarn noticed where a support ship would think all subsystems were repaired if the hull repair rate was set to 0.
2020-04-29 01:39:18 -04:00
Goober5000 9c44e77da0 allow empty weapons on locked ships
As noticed in Discord, in loop1-2 some of your wingmen have missing weapons, but as the ships are locked it's impossible for the player to modify them.  These ships should not be part of the check.
2020-04-28 23:51:37 -04:00
Goober5000 d9d372121a missed one 2020-04-28 23:24:13 -04:00
Goober5000 f286363748 Merge pull request #2346 from EatThePath/ai_linkage_rot_cleanup
Set_primary_weapon_linkage cleanup as requested by Goober5000
2020-04-28 23:22:04 -04:00
Goober5000 6df90a8ec7 newline 2020-04-28 23:12:51 -04:00
Goober5000 289defdeff smol fix 2020-04-28 23:11:33 -04:00
Goober5000 a54ebc3114 bring save format up to date (Mantis 2867)
FSO-specific features should now all be properly marked off with checks for retail format.
2020-04-28 23:02:10 -04:00
David Gibson 4a5ff2860b now check doublefire validity flags before drawing doublefire HUD indicator 2020-04-28 16:06:20 -05:00
David Gibson f8f1b44405 Check doublefire flag validity before firing any missile 2020-04-28 14:50:33 -05:00
David Gibson f13faf4cba added new flags and flag loading for the doublefire disabling options 2020-04-28 13:57:44 -05:00
David Gibson 1520a21062 Code cleanup and rerodering in set_primary_weapon_linkage as requested by Goober5000 2020-04-28 13:02:47 -05:00
Fabian Woltermann cdc831b163 Merge pull request #2344 from chief1983/datacorder
Use datacorder in CI instead of fs2downloads
2020-04-28 16:34:25 +02:00
niffiwan 18718aee74 Merge pull request #2341 from wookieejedi/add_target_box_zoom
Adds Scaling for Target Box Models Separate from Techroom
2020-04-28 17:01:47 +10:00
Cliff c8a5ebe45c Since this is sftp now we don't need the alt ftp functionality. 2020-04-27 23:51:46 -05:00
Goober5000 9dd6bcf81d warn if there is a gap in the path sequence 2020-04-28 00:39:46 -04:00
Goober5000 3356edff2b warn if model paths do not have unique names 2020-04-28 00:16:06 -04:00
Goober5000 07acdde69a fix Mantis 2791
This is a pretty easy fix; sorry it took seven years!

Instead of firing an Int3() when a ship has no arrival paths, just log it and continue.  And change the upstream warnings, which should have been more visible, from WarningEx to Warning.
2020-04-27 23:43:45 -04:00
Cliff 29dd3e1057 Update Travis and AppVeyor CI to use our Datacorder account on FeralHosting instead of the swc.fs2downloads.com server, since it is having issues with uploads now. 2020-04-27 22:26:31 -05:00
Goober5000 c89ea8e8dd update test case 2020-04-27 23:22:34 -04:00
Goober5000 d6c1a3dec4 implement XSTR check as described in Mantis 2942
Certain mods provide their own tstrings.tbl, but this runs into trouble when you localize data meant for one mod using a tstrings.tbl meant for another mod.  See the Mantis ticket:
http://scp.indiegames.us/mantis/view.php?id=2942
and also the HLP post:
http://www.hard-light.net/forums/index.php?topic=85041.msg1716600#msg1716600

This PR adds an optional flag that will check the untranslated string against the "default language" translated string.  The two strings should be identical.  If they aren't, the code assumes there is a tstrings.tbl mismatch.

I modified the mission listing code to enable this check when localizing mission info (titles and descriptions), and to avoid adding the mission to the list if there is a mismatch.  Fortunately, I think mission listing is the only place where this bug is likely to happen.
2020-04-27 22:42:13 -04:00
Goober5000 30d41eff8b fix issue 2335
Modify the early-out condition to remain in the function if we still need to render a dumbfire lead indicator.

Fixes #2335.
2020-04-27 20:32:45 -04:00
Goober5000 cc39cfe6f2 don't send builtin messages for ships with damaged comms, and don't select them when looking for unsilenced ships either 2020-04-27 16:32:43 -04:00
wookieejedi bca6f95621 add first time checks and use copy by assignment 2020-04-27 13:16:14 -04:00
wookieejedi e2010aeda1 Adds Scaling for Target Box Models Seperate from Techroom
Currently `$Closeup_Pos:` and `$Closeup_Zoom:` control the camera zoom and position values for the techroom, briefing and HUD Target Box. Unfortunately, with very large ships this results in an issue, to fit the view of an entire big ship in the HUD Target Box the zoom and position must be set a certain way which results in the ship looking very far away when viewed in the techroom. This PR adds two new fields that control camera postion and zoom but only for the HUD Target Box, thus modders can now set values for both and have the ships look good in both the Techroom and HUD Target Box. The new hud target box values are optional, and if not specifed they default to the values for `$Closeup_Pos:` and `$Closeup_Zoom:` .
2020-04-27 10:25:15 -04:00
Goober5000 d0daa43ccf since the code assumes all subsystems are dead if the ship is dying, add some flag checks to allow death messages to play (and be scrambled appropriately) if we have the ai_profiles flag active 2020-04-27 02:30:42 -04:00
Goober5000 e0cd2806f8 move quick-abort checks to before message priority checking
From the comments:

	// Do some checks to see if we are actually going to play this message at all.  These checks have been moved above the
	// "if ( Num_messages_playing )" block because we don't want to cancel an existing message if we have nothing to replace it with.

Additionally, by not incrementing `Num_playing_messages` if the code skips to `all_done`, this prevents messages that aren't playing from delaying messages in the queue that are actually valid and should play.
2020-04-27 02:24:26 -04:00
Goober5000 4f026a66ab fix small bug where speech was stopped when it wasn't supposed to be 2020-04-27 02:17:42 -04:00
Goober5000 28df82a03f fix bug where scramble status overrode subystem status 2020-04-27 02:13:08 -04:00
Goober5000 06f1b7d872 fix some int/bool stuff 2020-04-26 18:16:08 -04:00
Goober5000 1dfe3a8d9f implement Mantis 1947 feature request
This adds an ai_profiles flag that checks comm systems for non-player ships.  If their comm system is damaged, they will not send messages and you will not be able to issue squadmsg orders.

See also:
http://scp.indiegames.us/mantis/view.php?id=1947
2020-04-26 18:08:28 -04:00
Goober5000 aa46ae6639 add version-specific enabling of bugfix flags 2020-04-26 17:13:13 -04:00
Fabian Woltermann 22f3463397 Merge pull request #2339 from TRBlount/fix/lab_bg_smaa
Small F3 lab fixes
2020-04-25 18:59:48 +02:00
Goober5000 283e1555ba Merge pull request #2340 from JohnAFernandez/vmd-expansion
Add an angles version of zero vector and identity matrix
2020-04-25 11:54:23 -04:00
JohnAFernandez fe8ce74037 Use a constant for declaring angles with no measure 2020-04-25 09:54:40 -04:00
JohnAFernandez c43fa8c9a8 Add an angles version of zero vector and identity matrix 2020-04-25 00:45:34 -04:00
Tyler Blount 5c7fce41f1 Some lab fixes 2020-04-23 23:51:30 -06:00
Fabian Woltermann 0985091f6a Merge pull request #2338 from wookieejedi/music-restart-fix
Reinstates necessary soundtrack function call on level load
2020-04-21 18:33:43 +02:00
wookieejedi 2da7c4e761 Reinstates necessary check for soundtrack on level load
This updates #2299 and restores the use of `event_music_level_start(-1)` in `freespace.cpp`. This call was removed in #2299 because it was thought to be redundant but removal of that call resulted in music not playing upon mission restarts. This PR restores that call and fixes that issue.
2020-04-21 11:00:49 -04:00
m!m 6f109508d0 Merge pull request #2322 from asarium/feature/hookDocumentation
Add extended scripting hook system
2020-04-19 11:28:35 +02:00
Goober5000 e84919fa88 Merge pull request #2331 from Goober5000/interval_msecs
allow intervals and chain delays to use milliseconds
2020-04-18 15:32:17 -04:00
Goober5000 684354c8bd Merge pull request #2334 from Goober5000/fix_2333
fix loading of capship custom weapons
2020-04-16 15:09:36 -04:00
Goober5000 c8b1f56a09 missed one 2020-04-16 13:37:36 -04:00
Goober5000 8cc9eb2352 change to bool, for great C++ justice 2020-04-16 13:20:39 -04:00
Goober5000 3d08119734 add +Hotkey Team: to override IFF designation in hotkey list
This is in response to Mantis 1424:
http://scp.indiegames.us/mantis/view.php?id=1424

Since retail, the hotkey lists have been determined based on what attacks the player.  Mod makers may want to change this, so this PR adds the following options:

Default - retail behavior
Friendly/Enemy (or Hostile) - display in the specified list regardless of who attacks whom
None - don't display in the hotkey list at all

This PR also slightly cleans up the hotkey list function with a small optimization and a few tweaky fixes for edge cases.
2020-04-15 13:47:11 -04:00
Goober5000 45c3ee0b3c this probably makes more sense 2020-04-14 23:52:14 -04:00
Goober5000 89eea8e5d3 this pilot-specific logic should only run for the Pilot subsystem 2020-04-14 23:32:02 -04:00
Goober5000 6f5e500a1e add an ai-profiles flag to govern the Mantis 3147 fix 2020-04-14 17:50:16 -04:00
Goober5000 32730fc362 Merge pull request #2330 from Goober5000/check_no_briefing
actually fix the weapon-bank check
2020-04-14 17:19:11 -04:00
Goober5000 1c8f07b012 allow intervals and chain delays to use milliseconds
This adds the titular feature, as well as FRED support.  There are also some associated minor UI fixes in FRED and some cleanup in missiongoals.cpp.  And "Event Flags" are now a thing in case we want to add any other flags in the future.
2020-04-14 16:28:57 -04:00
Goober5000 892f0a831a actually fix the weapon-bank check
Ships which do not have the maximum number of primary and secondary banks (3 and 4) will have gaps in the loadout slots, so be sure to only check the weapon slots that the ship class is actually equipped with.
2020-04-14 14:38:18 -04:00
Goober5000 6b573bdbf6 Merge pull request #2329 from Goober5000/check_no_briefing
add a missing edge case to the weapon bank check
2020-04-14 12:07:20 -04:00
Goober5000 0e9ad8623b Merge pull request #2323 from Goober5000/fix_2314
sanity check missing numeric sexp arguments
2020-04-14 11:51:37 -04:00
Goober5000 f5edccd98f add a missing edge case to the weapon bank check
Yet another obscure edge case from Aftermath: Reboot.  The FREDder ought not to create this situation in the first place, but if he does, don't enter an endless loop.
2020-04-14 02:49:08 -04:00
Goober5000 007e7118f2 Merge pull request #2327 from Goober5000/jump_node_hud_distance
use consistent jump node distances on HUD
2020-04-13 18:34:27 -04:00
Goober5000 ae41e355ac reduce duplicate code 2020-04-13 16:56:18 -04:00
Goober5000 43d51792f2 apply formatter 2020-04-13 16:56:18 -04:00
Goober5000 f739a3e5c1 fix clang complaint 2020-04-13 16:56:18 -04:00
Goober5000 33c3f556a4 sanity check missing numeric sexp arguments
In the SEXP parser, zero-length strings are valid, as are zero-length operators.  But zero-length numbers are interpreted as missing arguments, since their only syntactic separators are spaces and the parser skips over whitespace.  And in any case, zero-length numbers are not semantically valid anyway.  This PR adds a sanity check to intercept all zero-length numbers, as well as malformed numbers, and convert them to 0.

This fixes issue #2314.
2020-04-13 16:56:17 -04:00
Goober5000 490464b656 Merge pull request #2324 from Goober5000/fix_Mantis_3171
Fix Mantis 3171
2020-04-13 16:54:56 -04:00
Goober5000 d526300483 Merge pull request #2325 from Goober5000/fix_Mantis_2715
prevent player leaving the loadout screen with incomplete weapons
2020-04-13 14:59:01 -04:00
Goober5000 3f3b284dcf use consistent jump node distances on HUD
There is a special function, `hud_find_target_distance`, which is used in most places for target distance.  However it wasn't used for jump nodes in this location.

Incidentally, the player's target's distance is cached, and this distance will always be current for the target box, so we can use the cached value and save a function call.
2020-04-13 14:53:28 -04:00
Goober5000 e0992ed88e add qtfred support 2020-04-13 12:29:02 -04:00
Goober5000 3997237a11 bump XSTR_SIZE and add NOLINT 2020-04-13 11:50:04 -04:00
asarium 1c12349990 Add extended scripting hook system
This moves towards defining the hooks in the code module that executes
them. Also provides the API necessary for better documentation of hooks.
This only covers a few hooks as a test and demonstration of the new API.
If no issues are found with this it can be extended in the future.
2020-04-13 14:45:19 +02:00
Goober5000 5f10b68118 Merge pull request #2326 from fjelliott/improved-subsystem-box-rendering
Cleaned up code that renders subsystem target boxes. (Follow-up to #2315)
2020-04-13 02:02:26 -04:00
Frans Elliott 91edcc4b8c Added a comment to describe the mathematics of subobj_find_2d_bound.
Broke up the projection function to aid in clarity.
2020-04-12 23:43:12 -05:00
Frans Elliott 4139cd890c Cleaned up subsystem bounding box code. 2020-04-12 21:24:13 -05:00
Goober5000 8fa96aeaf3 prevent player leaving the loadout screen with incomplete weapons
This is the best way to address Mantis 2715.  I took a look at allowing empty banks in the course of working on PR #2318, and it was completely intractable.  But in order to prevent certain "funnies" such as violation of bank restrictions, it's a good idea to ensure all banks are populated.

This PR adds a new XSTR for a popup message, and incidentally adds another XSTR to a message that should have had one already but didn't.
2020-04-12 21:34:00 -04:00
Goober5000 282ca0b0dd fix Mantis 3171 2020-04-12 20:39:16 -04:00
Goober5000 d3b1871837 remove Asserts that never worked because they checked invalid iterators 2020-04-12 20:39:16 -04:00
Goober5000 6f7ca147dd Merge pull request #2318 from Goober5000/additional_weapon_fix
simplify and fix the subsystem weapon loading code
2020-04-11 11:49:28 -04:00
Goober5000 ee391940d2 simplify and fix the subsystem weapon loading code
If ships have less than their full allocation of weapons, the code is supposed to compact the array so that these weapons all appear at the beginning.  This is done for small ships (fighters and bombers), but was not done for capital ships.  There was also a lot of code duplication with small ships getting extra error checking than capital ships.  This commit removes the duplicate code, makes the error checking more robust, and incidentally fixes the weapon array compacting for capital ships.
2020-04-08 12:31:43 -04:00
Goober5000 23dbfa5655 Merge pull request #2319 from Goober5000/weapon_info_scripting_fix
fix yet another issue uncovered by vectorization
2020-04-08 12:30:26 -04:00
Goober5000 8f1f308591 fix yet another issue uncovered by vectorization 2020-04-07 23:31:16 -04:00
Goober5000 cc456855e5 Merge pull request #2317 from Goober5000/weapon_bugfixes
Weapon bugfixes
2020-04-07 13:57:13 -04:00
Goober5000 0853c5bf7a clean up these functions in the same way as the weapon cheat functions 2020-04-07 02:20:56 -04:00
Goober5000 96de072bff add a useful assertion 2020-04-07 02:20:41 -04:00
Goober5000 2f0f2d7669 prevent access of out-of-range weapons, and at the same time sync primary and secondary capacity calculations 2020-04-07 02:02:22 -04:00
Goober5000 1c5a361d50 Merge pull request #2315 from fjelliott/master
Force subsystem targetting reticle to be square, even on non-square aspect ratios.
2020-04-06 01:11:56 -04:00
Frans Elliott 44072c026c Force subsystem targetting reticle to be square, even on non-square aspect ratios. 2020-04-05 21:21:37 -05:00
MageKing17 8cb9d311d7 Merge pull request #2312 from JohnAFernandez/target-signature-rename
Clarify Variable Names
2020-03-30 11:47:04 -07:00
MageKing17 bdec29f247 Merge pull request #2308 from Goober5000/vasudan_cheat_tweak
improve detection of vasudan main hall for cheats
2020-03-30 11:38:34 -07:00
JohnAFernandez 4e1b366f9f Clarify Variable Names
Use target_net_signature when talking about net_signature, but leave it at target_signature when talking about ai.target_signature.
2020-03-29 08:02:16 -04:00
Fabian Woltermann de2d1ec602 Merge pull request #2311 from asarium/fix/2310
Fix wrong matrix function calls
2020-03-29 13:37:19 +02:00
asarium 50e365a66c Fix wrong matrix function calls
This was using the wrong functions which caused videos not to show up
properly. This fixes #2310.
2020-03-29 12:19:00 +02:00
Tyler Blount a954a04cf8 Merge pull request #2309 from JohnAFernandez/Fix-ADE-invalid-defaults
Make sure aip->net_signature always defaults to -1 for no target.
2020-03-28 00:16:20 -06:00
Tyler Blount 030bbeb622 Merge pull request #2306 from Goober5000/flyby_sounds_refactor
refactor parsing of flyby sounds to make them optional
2020-03-28 00:15:33 -06:00
JohnAFernandez 6b7df053fa Make sure aip->net_signature always defaults to -1 for no target.
Although not used very often, ai_info.target_signature should be set to -1 whenever no target is specified, just like everywhere else to make sure that the code is as predictable as possible.

(Found while trying to figure out why the heck would the Object update packet send this at all??)
2020-03-27 23:11:19 -04:00
Goober5000 b8c135d162 improve detection of vasudan main hall for cheats 2020-03-25 14:24:37 -04:00
Fabian Woltermann b067e1ac66 Merge pull request #2307 from Goober5000/lab_weapon_bugfix
fix small error in lab
2020-03-24 21:34:58 +01:00
Goober5000 eabead6d41 fix small error in lab 2020-03-24 01:02:50 -04:00
Goober5000 ec50baa9d1 okay then 2020-03-24 00:11:36 -04:00
Goober5000 66f7bc4f50 add newline at end of file 2020-03-23 21:00:02 -04:00
Goober5000 44b7d5a4bd refactor parsing of flyby sounds to make them optional 2020-03-23 20:27:28 -04:00
Goober5000 caebad7077 Merge pull request #2302 from Goober5000/xmt_remove
Xmt remove feature
2020-03-18 09:48:42 -04:00
Goober5000 0caa65a74f address feedback 2020-03-17 17:22:27 -04:00
Goober5000 ff05816e11 add parse blacklist 2020-03-15 20:31:28 -04:00
Goober5000 da326f31f6 additional tweaks after rebase 2020-03-15 17:52:34 -04:00
Goober5000 376a01e82b wip 2020-03-15 17:42:57 -04:00
Goober5000 dc2ce094fc wip 2020-03-15 17:39:21 -04:00
Goober5000 74a0346e0d Merge pull request #2301 from Goober5000/static_cast_tweak
add functions to remove the clutter of static casts for ship and weapon info vectors
2020-03-15 15:08:42 -04:00
Goober5000 3b0d20aaf2 fix clang complaint 2020-03-15 01:35:12 -04:00
Goober5000 a0951f4e28 derp 2020-03-15 00:28:07 -04:00
Goober5000 3da2b99144 maybe these need to be extern'd 2020-03-14 15:13:44 -04:00
Goober5000 c9df8a13f1 add functions to remove the clutter of static casts for ship and weapon info vectors 2020-03-14 13:02:12 -04:00
Goober5000 247d5c453c Merge pull request #2294 from Goober5000/weapon_info_vector
Turn Weapon_info into a vector
2020-03-14 12:30:45 -04:00
Goober5000 5b8e89f37d address feedback 2020-03-14 09:56:56 -04:00
Fabian Woltermann f6083b680a Merge pull request #2299 from The-E/fix/2296_actually_fix_2292
As it turns out, the soundtrack reset issue is a bit more complicated…
2020-03-12 20:29:33 +01:00
Goober5000 fde7fdd854 address feedback 2020-03-07 13:35:17 -05:00
Fabian Woltermann 64531798e7 As it turns out, the soundtrack reset issue is a bit more complicated than I initially thought. The force_soundtrack check I previously removed was apparently vital; without it, calling event_music_level_init() (which in actuality is used to start soundtrack playback!) will result in the music being stopped, as the current soundtrack is set to -1.
This PR refactors the function's name to something more indicative of what it actually does, and removes a call made to it from within freespace.cpp which, due to changes in how the soundtrack system works, is now redundant and doesn't actually do anything anymore.
2020-03-07 19:04:01 +01:00
m!m ecd1cfe59c Merge pull request #2297 from asarium/fix/monoSoundAssert
Fix assertion when playing downsampled sounds
2020-03-07 15:34:09 +01:00
asarium 638bcacb71 Fix assertion when playing downsampled sounds
The sound was passed the data from before the resampling took place so
it though it would be playing a stereo sound and rightly cause an
assertion. This fixes that by refreshing the properties after appliying
the resampling properties.
2020-03-07 13:30:30 +01:00
Fabian Woltermann 4fc82ba334 Merge pull request #2295 from Goober5000/fix_weapon_info_pointer
fix an incorrect optimization
2020-03-07 12:59:23 +01:00
Goober5000 7ebd00e6f5 another fix for CI 2020-03-06 15:48:50 -05:00
Goober5000 fc41984a75 yet another fix for CI 2020-03-06 14:28:39 -05:00
Goober5000 45b5399f08 another fix for CI 2020-03-06 14:03:33 -05:00
Goober5000 fe15752f5e another fix for CI 2020-03-06 12:53:08 -05:00
Goober5000 c0a7be50b4 fixes for CI 2020-03-06 12:23:40 -05:00
Goober5000 bb8fcd428e address feedback 2020-03-06 03:11:31 -05:00
Goober5000 641aa329a5 fix an incorrect optimization 2020-03-05 22:58:00 -05:00
Goober5000 d86332a9d9 fix references 2020-03-05 22:46:07 -05:00
Goober5000 d8e88c1644 oof 2020-03-05 22:31:13 -05:00
Goober5000 1926d3c341 oof, more changes 2020-03-05 20:49:16 -05:00
MageKing17 c502d9bdf7 Merge pull request #2293 from scp-fs2open/fix/2292_reset_soundtrack_index_on_mission_close
Reset the current soundtrack during mission shutdown
2020-03-05 17:02:07 -08:00
Goober5000 20835adef6 convert Weapon_info to a SCP_vector 2020-03-05 19:12:43 -05:00
Fabian Woltermann af5e834250 Also make sure that Current_soundtrack_num is reset whenever event_music_level_init is called 2020-03-05 20:34:00 +01:00
MageKing17 e9051933b9 Merge pull request #2291 from Goober5000/remove_cloakmap
remove CLOAKMAP
2020-03-05 11:21:03 -08:00
Fabian Woltermann bb48ea9c61 Reset the current soundtrack during mission shutdown 2020-03-05 20:15:20 +01:00
Goober5000 939be80c30 wip 2020-03-05 00:01:03 -05:00
Goober5000 732ada474b remove CLOAKMAP 2020-03-04 23:47:22 -05:00
Goober5000 23b5320ec4 Merge pull request #2289 from MageKing17/bugfix/fred-rc-version-refix
Restore fred.rc version fix.
2020-03-02 08:56:34 -05:00
Goober5000 e3f67146b1 Merge pull request #2290 from Goober5000/log_newline
add newlines to mprintf and nprintf
2020-03-02 08:55:24 -05:00
Goober5000 cacee6e5b8 a few more 2020-03-02 01:07:17 -05:00
Goober5000 90c6c91e4f add newlines to mprintf and nprintf 2020-03-02 00:51:58 -05:00
MageKing17 0748ac191c Restore fred.rc version fix.
PR #1514 made this change to avoid having to constantly update fred.rc with new FSO versions, but it was inadvertently reverted in commit 9ac97f24223a7446d4364acfdb451c90697d6577; this also reverts PR #2286, since that's a somewhat more hackish solution to the same problem.
2020-03-01 18:10:23 -08:00
Goober5000 98cb4b6400 Merge pull request #2287 from Goober5000/briefing_stage_1_based
change briefing stage hook to 1-based
2020-03-01 15:36:47 -05:00
m!m 48d1797009 Merge pull request #2288 from asarium/docker-buildOnTagPush
Build docker standalone image on tag push
2020-03-01 16:14:54 +01:00
asarium 50ea017e59 Build docker standalone image on tag push 2020-03-01 14:48:47 +01:00
m!m c42cd25b89 Merge pull request #2284 from asarium/build/makeFFmpegOptional
Make FFmpeg an optional requirement
2020-03-01 11:55:01 +01:00
Goober5000 75099171ef Merge pull request #2286 from Goober5000/fred2_version_small_fix
Fred2 version small fix
2020-02-29 21:57:12 -05:00
Goober5000 809d11e1a8 change to 1-based 2020-02-29 19:21:21 -05:00
Goober5000 dadc65178d update the version number 2020-02-29 13:45:26 -05:00
m!m 52b17c3f8a Merge branch 'master' into build/makeFFmpegOptional 2020-02-29 18:48:13 +01:00
Goober5000 28722d7402 update the version number 2020-02-29 12:34:46 -05:00
m!m bf4243c0b0 Merge pull request #2285 from asarium/docker/fixEventHandling
Fix standalone signal handling
2020-02-29 18:33:46 +01:00
m!m 9dd6d9c874 Merge pull request #2278 from asarium/feature/betterScriptingDeprecation
Improve error message for deprecated functions
2020-02-29 18:33:31 +01:00
m!m 53a3b2b1c7 Merge pull request #2279 from asarium/fix/docker_stuff
Add compile time option to enable logging in release builds
2020-02-29 18:20:26 +01:00
asarium 2dc2295a59 Make FFmpeg an optional requirement
This does some refactoring to make it possible to cimpile and run FSO
without needing to link to FFmpeg. Since that eliminates support for
cutscenes or sound this is mostly useful for running a standalone server
which has no need for this anyway.

This reduces the image size of the standalone Docker image to only 20MB
and also resolves any licensing issues that might have existed.
2020-02-29 17:24:56 +01:00
asarium 582c144cf7 Fix standalone signal handling
The standalone did not initialize SDL and so did not receive the quit
signal when it was sent SIGTERM or SIGINT. This fixes that by making the
standalone server just use the normal os initialization code.

Also includes some other code cleanup and some more logging to make it
more apparent in the log what is currently happening at standalone
startup.
2020-02-29 17:09:55 +01:00
m!m e32cadd06a Merge pull request #2280 from asarium/docker/standalone-image
Add Dockerfile for compiling minimal standalone image
2020-02-27 18:12:30 +01:00
asarium ed6ac7060e Add Dockerfile for compiling minimal standalone image
This adds a Dockerfile which compiles FSO for the alpine Linux
distribution and then creates a standalone image based on those
binaries. That sidesteps the problem that existed with trying to use the
AppImage binaries on that distribution.

This produces a much smaller image (78MB instead of 230MB) so it should
be a bit more managable. Building can be done like this:
docker build --build-arg build_type=FastDebug -t scpfs2open/fso-standalone -f docker/standalone/Dockerfile .
2020-02-26 20:01:31 +01:00
asarium 7029e4a10f Add compile time option to enable logging in release builds
This mostly meant for special docker standalone server builds where it
might be useful to have full release performance but also have the logs
available if necessary. This now always compiles the log statements but
enables or disables them with a constexpr so they should not appear in
actual release binaries.
2020-02-24 18:54:55 +01:00
m!m 4d2cf1d2e0 Merge pull request #2263 from asarium/vulkan/test
Add Vulkan instance and surface creation code
2020-02-23 17:52:56 +01:00
asarium d31b2a971b Improve error message for deprecated functions
This will provide a proper error message when such a function is called
that will mention the name of the function and that it is deprecated and
cannot be used anymore in the targetted engine version.
2020-02-23 16:40:54 +01:00
m!m 74cf0b839d Merge pull request #2276 from asarium/fix/docker_stuff
Add option for logging to stdout
2020-02-23 14:32:08 +01:00
asarium 7f286b726d Add option for logging to stdout
This will make it easier to get logs from FSO running in a docker
container since logging to stdout is the easiest solution there.

Also includes some other changes that will make this work better in
Docker containers.
2020-02-23 13:09:51 +01:00
Goober5000 b0da0ea404 Merge pull request #2272 from Goober5000/briefing_stage_hook
add scripting hook for briefing stage
2020-02-18 14:38:24 -05:00
Goober5000 ca301fdb04 small adjustments 2020-02-18 01:18:07 -05:00
Goober5000 04244ec1ee Merge pull request #2273 from asarium/fix/2269
Handle invalid standard deviation properly
2020-02-17 15:26:56 -05:00
asarium 84b15afa8a Handle invalid standard deviation properly
If anything less than or equal to 0 was specified it would trigger some
kind of an assert in the standard library since that is not a valid
value for a normal distribution. Now a parse warning is generated and a
safe default value is used.

This fixes #2269.
2020-02-17 13:52:25 +01:00
Goober5000 a7063152b7 add scripting hook for briefing stage 2020-02-17 00:58:56 -05:00
Goober5000 5f938169af Merge pull request #2271 from asarium/fix/2266_again
Actually fix shader compilation error
2020-02-16 16:17:03 -05:00
asarium 8763b06c77 Actually fix shader compilation error
And actually compile the shader this time to check if the changes
actually fixed the error.
2020-02-16 13:02:25 +01:00
m!m 90a97021f5 Merge pull request #2267 from asarium/fix/2266
Fix compilation error in shader
2020-02-11 22:00:55 +01:00
asarium 3c6015f6b0 Fix compilation error in shader 2020-02-11 18:05:18 +01:00
Cliff Gordon ca4fcc84ea Merge pull request #2252 from pkubaj/patch-1
Fix build on FreeBSD
2020-02-11 09:35:09 -06:00
Cliff Gordon 94e74cb15f Merge pull request #2264 from pkubaj/patch-2
Fix build on big-endian architectures
2020-02-11 09:32:30 -06:00
pkubaj 3daa819042 Fix build on some LE platforms
Some platforms don't like those variables being unused.
2020-02-11 13:58:26 +01:00
pkubaj 4bb31f4e1b Fix build on big-endian architectures
swap_bsp_data() and swap_sldc_data() use those.
2020-02-10 15:49:52 +01:00
pkubaj 87c5544b7b Change to SCP_BSD 2020-02-10 15:47:17 +01:00
pkubaj 4914c4a452 Change to SCP_BSD 2020-02-10 15:46:56 +01:00
pkubaj 0b33a44004 Change to SCP_BSD 2020-02-10 15:46:30 +01:00
pkubaj 1f98551b12 Change to SCB_BSD 2020-02-10 15:45:57 +01:00
Goober5000 463caecf03 Merge pull request #2262 from niffiwan/fix/issue2261
make small bombs appear smaller in hud targetbox
2020-02-09 14:24:49 -05:00
asarium 2f3f061e75 Add Vulkan instance and surface creation code
This adds a new graphics type for the Vulkan graphics API. All this does
is to create a vulkan instance and a presentation surface with the help
of SDL.
2020-02-09 17:06:21 +01:00
niffiwan 0c0c4ddaef make small bombs appear smaller in hud targetbox
Also cleaned up the code slightly, the factor variable was only used
when missile_view was false
2020-02-09 21:07:04 +10:00
m!m 3fb2f97b43 Merge pull request #2133 from asarium/feature/moreOptionsUI
Add more features for the new Options UI
2020-02-09 11:39:18 +01:00
Goober5000 66daf6ba24 Merge pull request #2259 from Goober5000/update_wiki_cmdling
bring cmdline listing up to date with wiki (update links etc)
2020-02-09 00:55:42 -05:00
asarium a13b503b83 Add more features for the new Options UI
The largest new feature is that it is now possible to include other
files into the RML by using the "include" tag. This is useful for making
markup files more modular.

Also added some more options for existing things (e.g. built-in detail
options).
2020-02-08 13:28:53 +01:00
Goober5000 43a29b4dec address feedback 2020-02-07 12:00:01 -05:00
niffiwan 1c2d8a3b47 Merge pull request #2257 from asarium/gr/genericUniformBlock
Add generic uniform block for low frequency data
2020-02-07 18:06:40 +10:00
MageKing17 aa0a1ae3ed Merge pull request #2253 from scp-fs2open/bump_version
Update Version to 20.1.0
2020-02-05 11:39:11 -08:00
Goober5000 1d12157a07 bring cmdline listing up to date with wiki (update links etc) 2020-02-02 15:46:50 -05:00
asarium ae026f83ca Add generic uniform block for low frequency data
This elimiates all of the remaining "old style" uniforms from our
shaders. This might not be optimal for all situations but I have
confirmed that it is at least not worse at the moment.
2020-02-01 19:18:14 +01:00
Goober5000 facf17a222 Merge pull request #2254 from Kiloku/master
Update changelog with 19.0.0 release
2020-01-29 14:08:46 -05:00
Kiloku bf99541c58 Merge pull request #2 from scp-fs2open/master
Update
2020-01-29 13:32:25 -03:00
Kiloku 34391ebe21 Update changelog with 19.0.0 release 2020-01-29 13:30:49 -03:00
Fabian Woltermann 93f71ec202 Merge pull request #2247 from asarium/gr/matrixUniforms
Use uniform blocks for matrices
2020-01-29 11:04:22 +01:00
m!m e504f6b59e Set minor version to 1
This should be a bit more consistent with how we did versioning before.
2020-01-28 21:29:09 +01:00
m!m 133821952f Update Version to 20.0.0 2020-01-28 21:21:36 +01:00
asarium d7602ec9d1 Disable MinGW in GitHub actions
It fails with the same message as Travis CI :(
2020-01-28 18:20:47 +01:00
asarium fe5dbeccaa Use uniform blocks for matrices
This is a generic way to get matrix data to shaders without using
(old-school) uniforms. This is another step towards more compatibility
with how new APIs (Vulkan) do things to increase the odds for a Vulkan
port at some point.
2020-01-28 18:20:47 +01:00
pkubaj d7e40d2bcc Fix build on FreeBSD
sys/socket.h is needed for AF_INET.
2020-01-28 16:31:23 +01:00
pkubaj 0251fd347f Fix build on FreeBSD
sys/socket.h is necessary for AF_INET.
2020-01-28 16:30:53 +01:00
pkubaj 1cce2d70a3 Fix build on FreeBSD
sys/socket.h is necessary for AF_INET.
2020-01-28 16:30:23 +01:00
pkubaj 68f5b7d524 Fix build on FreeBSD
FreeBSD is similar to Linux and MacOS here.
2020-01-28 16:28:45 +01:00
niffiwan 036d5ed780 Merge pull request #2244 from JohnAFernandez/More-Multi-Cleanup
CleanUp Unused Function
2020-01-28 19:58:09 +10:00
niffiwan c109562c40 Merge pull request #2251 from wookieejedi/fix-rtt-target-display
Fixes RTT Target Box Scaling
2020-01-28 19:56:24 +10:00
niffiwan 0334b3c287 Merge pull request #2249 from wookieejedi/fix-hasfilter-on-weapons-hud
Fix weapon names not filtering # in HUD gauge
2020-01-28 07:06:57 +10:00
wookieejedi 9039081fa7 formatting 2020-01-27 12:23:15 -05:00
wookieejedi 73a5ac7665 specify floats 2020-01-27 12:17:26 -05:00
wookieejedi 6c2e419825 Fixes RTT Target Box Scaling
It seems that when RTT for cockpits was added that the scaling of ships in the target box fell through the cracks. Properly specifying the `clip_aspect` fixes the issue. This PR fixes issue #2250.
2020-01-27 10:04:57 -05:00
wookieejedi c2c2042a38 remove unneeded string filtering 2020-01-27 08:33:41 -05:00
wookieejedi da08ba5932 remove unneeded line 2020-01-26 15:10:32 -05:00
wookieejedi bc14149e84 Fix weapon names not filtering # in HUD gauge
Weapon names with a `#` should not display text after that `#` in the HUD. For the most part this works, but there were a few cases this didn't (such as primaries using the weapon name). This PR fixes two spots that fell between the cracks.
2020-01-26 14:08:28 -05:00
Goober5000 6ceb2a276c Merge pull request #2243 from wookieejedi/allow-engine-wash-intensity
Allows Modders to Actually Use Engine Wash Intensity
2020-01-25 16:32:12 -05:00
m!m d8537843ab Merge pull request #1600 from asarium/opengl/persistentlyMappedBuffer
Add persistent buffer mapping support for uniform data
2020-01-25 21:44:47 +01:00
wookieejedi 539cad66e7 change placement and add reset values 2020-01-20 12:31:18 -05:00
JohnAFernandez b042b27310 Remove Another Unused Multi Function
This function used to help with the sequence number of packets, but that is now done in the object packet functions themselves.
2020-01-20 00:42:56 -05:00
JohnAFernandez 8ee447d8c2 CleanUp Unused Function
This function does not have any contents and should be removed.
2020-01-20 00:28:28 -05:00
wookieejedi 8a36fc138c Allows Modders to Actually Use Engine Wash Intensity
Previously, Engine Wash Intensity didn't actually do anything in the code. This adds a game table setting that let's modders specify to the game to actually take the intensity value into account when calculating engine wash effects.
2020-01-19 16:54:58 -05:00
m!m a86322c49d Merge pull request #2242 from asarium/feature/deprecatedPostProcess
Add -post_process to deprecated flags section
2020-01-19 16:07:00 +01:00
asarium b19d7def54 Add -post_process to deprecated flags section
This should avoid causing warnings to pop up when users still have this
in their command line.
2020-01-19 12:28:06 +01:00
m!m 34577df2ea Merge pull request #2240 from Goober5000/post_processing
Clean up launcher settings a bit
2020-01-18 15:58:08 +01:00
Allen A. Babb b56c0d8bff Merge pull request #2241 from wookieejedi/fix-default_disabled_control-setting
Fix overriding the default values in control table for `disabled`
2020-01-17 21:19:08 -06:00
wookieejedi 48164e447d Fix overriding the default values in control table for disabled
For some reason my repro had some critical issues and I was unable to comitt to the PR #2210. I have closed that PR and opened this one given the discussion in #2210. The result of that discussion was `but omit line 594`. That is what this PR does.
2020-01-17 19:49:05 -05:00
Goober5000 1f4867a640 Clean up launcher settings a bit
Three main changes in this PR:

1) The enums for the "easy settings" launcher options are now clearer and more explicit, and the enum assignments for a lot of graphics options are now fixed, as they were incorrect due to code rot.

2) Some of the command-line flags options have been recategorized: -window, -fullscreen_window, -nomotiondebris and -noscalevid are now Gameplay; and -fps is now HUD.

3) Since post-processing is required for nebula fading, it now defaults to on, and the flag has been changed to -no_post_process.
2020-01-16 18:14:03 -05:00
wookieejedi 648598c729 Merge pull request #2239 from scp-fs2open/revert-2236-add-scripting-support-gun_convergence
Revert "Adds Scripting Support for the Ship Flag `gun convergence`"
2020-01-14 18:22:19 -05:00
wookieejedi 0b6a642a17 Revert "Adds Scripting Support for the Ship Flag gun convergence" 2020-01-13 23:32:03 -05:00
m!m 939492b981 Merge pull request #2196 from JohnAFernandez/Mantis#2129
Mantis#2129 Address Rare Multi Crash
2020-01-13 20:44:11 +01:00
Goober5000 69393f9104 Merge pull request #2236 from wookieejedi/add-scripting-support-gun_convergence
Adds Scripting Support for the Ship Flag `gun convergence`
2020-01-13 14:38:57 -05:00
Goober5000 3a2c680caa Merge pull request #2238 from scp-fs2open/fix/no_emissive_light_flag_behaviour
Update cmdline.cpp
2020-01-13 11:18:50 -05:00
Fabian Woltermann db71f3d550 Update cmdline.cpp
This fixes #2237
2020-01-13 08:58:38 +01:00
asarium 0b2695e9e4 Some more security checks 2020-01-12 22:23:13 +01:00
wookieejedi 51bbb0c1d2 Adds Scripting Support for the Ship Flag Gun Convergence 2020-01-12 15:37:31 -05:00
asarium 362645ce27 Reformat code with clang-format 2020-01-12 12:57:00 +01:00
asarium 10ab4a00f5 Fix clang-tidy issues 2020-01-12 11:59:23 +01:00
asarium 5ce6c251ff Add persistent mapping support
Persistent buffer mapping is an OpenGL technique where the contents of a
buffer object are mapped to a persistent pointer instead of having to
map and unmap a buffer every time it is modified.

This decreases the overhead for updating data in a uniform buffer object
which now only consists of a memcpy and a flush call.
2020-01-12 11:59:23 +01:00
asarium a3651026b1 Improve how the engine handles uniform buffers
This is in preparation for using persistently mapped buffers for uniform
buffers. Since that functionality is not available in the OpenGL version
we are targetting I implemented a fall-back which simply uses
glBufferSubData.

I did a benchmark with these changes and there was no change in
performance to the current master version.
2020-01-12 11:59:23 +01:00
Goober5000 6f18d93a23 Merge pull request #2234 from asarium/fix/warningsInParselo
Replace Warning with error_display in parselo
2020-01-11 18:38:52 -05:00
asarium 8e767bb613 Replace Warning with error_display in parselo
error_display shows the line where the error was detected. Warning
itself is pretty useless for parsing related errors so I replaced all
Warnings (where appropriate) with an equivalent error_display.
2020-01-11 21:57:52 +01:00
Goober5000 06df419429 Merge pull request #2233 from wookieejedi/cleanup-debuglog-output
Proposal to cleanup debug log statement regarding turret fire
2020-01-10 02:10:44 -05:00
Goober5000 98bafefc32 Merge pull request #2231 from JohnAFernandez/Fix-Interpolation
Better Timing For Interpolation Calc
2020-01-10 02:01:02 -05:00
wookieejedi 45e34797ae remove entirely 2020-01-09 23:29:23 -05:00
Goober5000 9eb7884968 Merge pull request #2232 from wookieejedi/fix-random-delay-firerate-calculation
Fixes calculations for random fire rates when using min and max delays
2020-01-09 21:51:13 -05:00
JohnAFernandez 2bdcd1bf04 Better Timing For Interpolation Calc
Does this by refactoring how the timing is calculated.  It also removes the Next Arrival Time Array, which does not actually do a good job of calculating it, anyway.  We can now rely on the other oo_arrive_time arrays exclusively by subtracting from current time.

Squashed Commits:
1. Use function to pull FrametimeOverall to keep from breaking Fred.
2. Remove unsed parameter from multi_oo_calc_interp_splines
3. And also fix the corresponding declarations and functions calls.
2020-01-09 19:34:54 -05:00
wookieejedi 00e750c120 Proposal to cleanup debug log statment regarding turret fire
In aiturret.cpp there is a mprintf, `mprintf(("nothing ok to fire\n"));` which greatly pollutes the debug log in missions with turreted ships. I'm not sure what this message helps debug, thus I propose commenting it out.
2020-01-09 18:03:21 -05:00
wookieejedi 6b872ef93c Fixes calculations for random fire rates when using min and max delays
Previously, using max and min delays resulted in guns firing that were not within the specified range. This PR fixes that while also simplfying the code. `frand_range` is already using in each of those functions so I figured it would be fine to use it and also simplify the code. That, instead of `next_fire_delay = (((float)rand()) / (((float)RAND_MAX + 1.0f) * (winfo_p->max_delay - winfo_p->min_delay + 1.0f) + winfo_p->min_delay))`.
2020-01-09 17:56:02 -05:00
Goober5000 07231d74e6 Merge pull request #2229 from wookieejedi/additional-initial-velocity-fixes
Cleanup Reaming Issues with Initial Velocity
2020-01-08 22:47:42 -05:00
Goober5000 78f113e806 Merge pull request #2230 from JohnAFernandez/Optimize-Multi-in-Debug-Builds
Remove Debilitating Debug Function Calls
2020-01-08 22:31:45 -05:00
wookieejedi da05fa18c5 use nullptr 2020-01-07 12:58:42 -05:00
wookieejedi 89576232a5 Few additional cleanups to hyperspace warpins with initial velocity 2020-01-07 11:08:06 -05:00
JohnAFernandez a73ccee28d Remove Debilitating Debug Functions
These function have been around since retail.  What they were supposed to do was allow the V team to get a baseline of how much data object updating would use without the limiting system.

However, the way that multi_rate_add work, is that they say to the limting system, "The client is getting a lot of data, so limit it some more." And that eventually causes debug build object updates to slow to a crawl.
2020-01-06 21:55:03 -05:00
wookieejedi 15b494b765 Cleanup Remaing Issues with Initial Velocity
This PR tidies up the comments in the initial velocity setting, properly sets the player's throttle, and cleans up issues with initial velocity setting and hyperspace warpin types.

Note the removed code block for hyperspace warpin ending was removed becuase it is not needed, as physics calculatios already handles that. Also the calculations that were there did not properly account for initial ship velocity setting.
2020-01-06 11:29:09 -05:00
Fabian Woltermann 49559c047f Merge pull request #2220 from wookieejedi/fix-min_max-firewait-oversight-for-turrets
Fix Min and Max Delays for Fire-rate not working for Turrets
2020-01-06 13:44:43 +01:00
Fabian Woltermann c6af310178 Merge pull request #2223 from wookieejedi/fix-setting-of-initial-velocity
Fix Setting of Initial Velocity
2020-01-06 13:43:21 +01:00
m!m 3013b76a46 Merge pull request #2224 from JohnAFernandez/Vector-Math-Description-Cleanup
vecmat.cpp quick cleanup
2020-01-06 12:13:08 +01:00
wookieejedi b32f2856fc consolidate variables 2020-01-05 22:57:22 -05:00
wookieejedi 1fdf2876d0 update comment 2020-01-05 21:34:36 -05:00
JohnAFernandez 790949b527 vecmat.cpp quick cleanup
A few early on descriptions in this file are inconsistent or even plain wrong.  This should correct that.

Also, rename vm_vec_imag() to vm_vec_inv_mag_quick() to better describe what it is.
2020-01-05 20:29:59 -05:00
wookieejedi 7d1acf0b08 Fix Setting Initial Velocity
It turns out that the code that set initial ship velocities did not account for local ship rotation changes. This bug is only noticeable when ships are very high speeds, high initial velocities, and have high drift values thus it was never recognized before. This PR fixes that by ensuring that the velocity vectors are set appropriately. As discussed with Goober on Discord, this fixed behaviour is indistingushable when using FS ships and most mods, this the behavipur will be on by default.
2020-01-05 16:45:24 -05:00
Goober5000 1d9eb94726 Merge pull request #2213 from Goober5000/verify_and_load_cleanup
Minor cleanup to Verify and loading bar
2020-01-04 13:51:02 -05:00
Goober5000 4503fc05d5 Merge pull request #2222 from asarium/fix/fogDepth
Fix fog depth computation
2020-01-04 11:52:58 -05:00
asarium 42953b0f0d Fix fog depth computation
This was previously using the wrong direction of the conversion so it
produced wrong values. This should fix that and should hopefully bring
the nebula experience back to how it is supposed to look.
2020-01-04 12:04:26 +01:00
wookieejedi a69e6b1e8e Fix Min and Max Delays for Firerate not working for Turrets
When the `+Max Delay:` and `+Min Delay` for `Fire Wait` were added they were only added to primary firing and not turret firing. Specifically, `turret_set_next_fire_timestamp` uses only `winfo_p->fire_wait` while `ship_fire_primary` uses the delays. Checking with the original author DahBlount they specified it was an oversight, thus this PR fixes that and allows the delays to now work properly with turret firerates.
2020-01-03 13:40:17 -05:00
Goober5000 072105a9c3 Merge pull request #2219 from wookieejedi/restore-3d-weapon-icons
Restore 3D Weapon Icons when Flag Used
2020-01-03 12:57:51 -05:00
wookieejedi 1578e4eab4 Restore 3D Weapon Icons when Flag Used
Overview: This PR restores all expected functionalility of the 3D weapon select flag while also providing modders with a way to use both 3D models and custom weapon icons.

PR #2055 provided a way for modders to use 3D weapons while still using specified weapon icons. Unfortunately that resulted in weapon icons not changing to an image of the 3D model when the 3d weapon selection flag was used. It was requested on the forum that this behaviour be restored. This PR restores that behaviour while still allowing modders to use 3D weapon models and their own weapon icons. Instead of the approach taken in PR #2055, this PR will automatically show a 3D weapon model if there is not weapon animation specified and if a weapon tech model is specified. Thus, if a modder wants to use their custom weapon icon but also have a 3D weapon model shown, they simply do not specify a model animation but do specify a tech model for the weapon (the 3d weapon selection flag does not need to be checked). If the 3d weapon selection flag is checked then the 3D weapon model will of course still be used, but the weapon icons will now show the image of the 3D model instead of any custom weapon icons the modder specified. In other words, the flag acts exactly as expected for the player.

I also tested this for each case and it works as desribed above.
2020-01-02 23:18:32 -05:00
m!m 1c23d90846 Merge pull request #2218 from asarium/cleanup/grDefs
Cleanup some unused functions in the graphics subsystem
2020-01-02 21:33:42 +01:00
asarium bfe507a53a Cleanup some unused functions in the graphics subsystem 2020-01-02 17:05:26 +01:00
MageKing17 bf82ffdf4b Merge pull request #2217 from Goober5000/fix_builtin_messages_sexp
fix disable/enable builtin messages for wingmen
2020-01-02 04:42:24 -08:00
Goober5000 0c26ad40e9 fix disable/enable builtin messages for wingmen
In the case of "any wingman", the sexp logic was flipped.
2019-12-30 18:55:09 -05:00
FSCyborg 56fd6f504a Mantis#2129 Address Rare Multi Crash
Should fix rare multi crash where reserving net signatures for spawened munitions would cause an ushort overflow, triggering an assert in multi_set_network_signature.

Turns out we can just remove the assert, and just guarantee that signature is going to be in the required range.

Squash history:
1. Improve Assertions (as per Taylor's suggestion) and reconfigure Int3
2. Wording change on last assertion
2019-12-28 00:50:35 -05:00
Goober5000 2521228666 accidentally a # 2019-12-27 15:25:41 -05:00
Goober5000 db6520c072 make the loading bar a bit more accurate by updating the count estimate to a recent 'real count' 2019-12-27 14:24:16 -05:00
Goober5000 09f06dc1ed rename VerifyEx to Verification and remove old MSVC 2005 checks 2019-12-27 14:22:44 -05:00
Goober5000 aee6ecb974 Merge pull request #2212 from JohnAFernandez/Fix-Multi_Crash
Urgent Multi Fix
2019-12-27 14:01:41 -05:00
JohnAFernandez b06761bc66 Urgent Multi Fix
Any server build created this year will crash any client connected to it because it will send a packet cotaining hull updating information, but accidentally unset the flag for new hull info. The client was therefore unaligned with the packet, causing the local subsystem_update array to go bonkers.
2019-12-27 11:35:25 -05:00
Goober5000 20e78143ee Merge pull request #2211 from JohnAFernandez/MultiUtil-Cleanup
Multiutil.cpp cleanup#1
2019-12-27 01:06:59 -05:00
JohnAFernandez 861eb14865 Clean Up Error Handling in multitutil.cpp
Removes about half of the Int3()'s in multiutil.cpp by making Assertions more robust, changing two functions to void type (because there was no way to get an error value from them, anyway), and adding two Verify()'s in case we ever decide to start using the multi variable change functions.

Squash History:
1) Forgot to change one Assert to Assertion
2) Change Verify to Assertion, because of better argument support.
3) Fix a couple copy paste errors
2019-12-26 07:59:14 -05:00
JohnAFernandez e34e3378a2 Modernize NULL to nullptr in Multiutil.cpp 2019-12-25 22:51:25 -05:00
FSCyborg 03125df50c Multiutil Minor Cleanup
Just a quick PR to make multiutil slightly more readable by removing one unused function (whose functionality is already in the object update packet), two globals which we only increment and we do nothing with, and some defines that have been commented out because the size returned can actually vary.
2019-12-25 22:06:38 -05:00
Goober5000 67613bbba0 Merge pull request #2209 from wookieejedi/fix-key-numbers-for-multi
Fixes accidental break with multi due to max key numbers
2019-12-23 17:42:10 -05:00
wookieejedi 4f5f3e859e remove keys 5-9 and 0 2019-12-23 16:05:35 -05:00
Goober5000 10bec9ff00 Merge pull request #2208 from CasparKielwein/ck/bitmanip_with_unsigned
make internal variables in static_rand unsigned.
2019-12-23 12:23:12 -05:00
wookieejedi a7e4a72622 add to button_function_critical() 2019-12-23 10:41:42 -05:00
wookieejedi 3167623e31 Fixes accidental break with multi due to key numbers
This PR reduces the number of custom controls back down to 127 so as to keep multi compatibility.
2019-12-23 10:36:23 -05:00
CasparKielwein c3a51296f8 make internal variables in static rand unsigned.
several of the bitwise manipulations on signed integers are technically undefined behaviour.
I made the internal variables unsigned and the results are then converted to signed ints as before.
This should not actually change any observable results.

Did some cleanup as well, while I was at it.
2019-12-23 10:52:33 +01:00
Goober5000 084cd65e97 Merge pull request #2202 from notimaginative/fix_trails_memory_bug
fix Trails.next pointing to invalid address
2019-12-22 12:09:52 -05:00
Goober5000 158448401a Merge pull request #2203 from notimaginative/fix_end_mission_on_death
avoid ending mission on death unless we should
2019-12-22 12:09:22 -05:00
MageKing17 bc5425166c Merge pull request #2206 from FSCyborg/Fix-Multi-Backend
Fix Multiple Multi Backend Issues
2019-12-21 19:25:01 -08:00
MageKing17 3da2bdc0ad Merge pull request #2205 from CasparKielwein/ck/clean_main_file
Refactore: cleanup freespace.cpp
2019-12-21 19:17:33 -08:00
FSCyborg b37c6b9052 Fix Multiple Multi Backend Issues
This fixes string comparison of ship names in multi.  Any respawned ship would be given a default name and would return false for any future name comparison.

The most visible affect of this was being given the default loadout and fighter on respawn instead of the fighter and weapons you selected, but Taylor was spotting a lot of potential other break points as he looked through other unrelated multi issues on mantis.

Squash History:
1) Fix comments and warning to be clearer.
2) Replace NULL with nullptr
2019-12-21 18:17:34 -05:00
CasparKielwein ca3dc4277f made lopps in freespace.cpp range based as per clang tidies request
in test_sound remove the redundant reset of the array lopp.
2019-12-21 21:03:21 +01:00
CasparKielwein 0f65314dd9 in labviewer_close_flags_window call vector.clear instead of empty.
Intent probably was to empty the vectors and not check for state empty.
This was most likely a bug, which was called by the no_discard attribute on the function.
2019-12-21 11:02:15 +01:00
CasparKielwein abaa891b00 cleanup of freespace.cpp replace NULL with nullptr and declare variables at use 2019-12-21 11:02:15 +01:00
CasparKielwein 176de9e928 remove unused code behind TIMER_TEST, it asks to get matt, who is long gone :) 2019-12-19 21:54:36 +01:00
CasparKielwein 84fb5e7610 remove unsused JOHNS_DEBUG_CODE 2019-12-19 21:54:36 +01:00
CasparKielwein 977a8aff91 remove unused compiler flag DYN_CLIP_DIST 2019-12-19 21:54:36 +01:00
CasparKielwein 06ead7c051 removed unused turret debug function in freespace.cpp 2019-12-19 21:53:55 +01:00
CasparKielwein 3d485af4cc remove framerate_check code in freespace.cpp which didn't do anything anymore. 2019-12-19 21:50:16 +01:00
CasparKielwein 7cde541390 remove unused functions in freespace.h
also remove the define STAMPER_PROGRAM, which the author
considered "yuck" in 1997, so lets do him the favor.
2019-12-19 21:50:16 +01:00
CasparKielwein 8b7b9627ed removed unused variables and outcommented code in freespace.cpp 2019-12-19 21:50:15 +01:00
Taylor Richards 7e2193ef2d avoid ending mission on death unless we should
should fix Mantis 2377 and probably several other issues
2019-12-18 09:55:15 -05:00
Taylor Richards f536b0cda2 fix Trails.next pointing to invalid address 2019-12-18 09:54:18 -05:00
Goober5000 58992cfd3a Merge pull request #2201 from MageKing17/bugfix/undinky-shockwaves
Make Dinky Shockwaves not dinky by default.
2019-12-17 02:50:20 -05:00
Goober5000 d9dfce3c25 Merge pull request #2147 from asarium/feature/luaParseObjects
Add Lua access to not yet arrived ships
2019-12-17 02:35:14 -05:00
MageKing17 440162ab24 Use a float multiplier instead of a boolean.
Also, I forgot to initialize the variable in mod_table_reset() before.
2019-12-16 21:43:21 -08:00
MageKing17 c9e38fedd2 Make Dinky Shockwaves not dinky by default.
Adds a new mod table option "$Default Dinky Shockwaves:" that toggles the behavior. See issue #774 for more information.
2019-12-16 17:46:27 -08:00
Goober5000 2856ae3583 Merge pull request #2197 from wookieejedi/update-fred-key-pressed-tree
Allow sexp-tree for `key-pressed` to actually show what the mod will use
2019-12-15 20:14:27 -05:00
Allen A. Babb bb2f19c176 Merge pull request #2198 from FSCyborg/Mark-VM_EXTERNAL_CAMERA_LOCK-Deprecated
Add deprecation warning for VM_EXTERNAL_CAMERA_LOCKED
2019-12-15 18:53:16 -06:00
FSCyborg d16a3fa5cf Add deprecation warning for VM_EXTERNAL_CAMERA_LOCKED
Previously deprecated enum for hasViewmode() lua function didn't have a warning.  This fixes that.

Also, I am adding a check to ignore it while writing scripting.hmtl.
2019-12-15 15:03:00 -05:00
wookieejedi b07a3282ad adjust position of function call 2019-12-15 14:50:34 -05:00
Goober5000 83370f6219 Merge pull request #2194 from wookieejedi/add-default-keys-custom-controls
Allows the custom controls to work with `key-pressed` sexp
2019-12-15 14:39:55 -05:00
asarium 3960af6ba5 Add Lua access to not yet arrived ships 2019-12-15 15:42:07 +01:00
wookieejedi b0edc12985 cleanup whitespace diff 2019-12-15 00:51:08 -05:00
wookieejedi 83c72ec9ae modify location and add to qtfred 2019-12-15 00:39:37 -05:00
Goober5000 d3c5eb3894 Merge pull request #2142 from notimaginative/auto_port_forwarding
Auto port forwarding
2019-12-14 23:51:03 -05:00
wookieejedi 82a53d8fef Allow sexp-tree for key-pressed to actually show what the mod will use
This PR allows modders/FREDers to actually see what default controls available are in FRED and not the hard coded ones from `Control_config` that may not be relevant for their mod. For example, a mod may disable many controls and change the default key for many controls in the table, but that is not reflected in FRED since FRED simply checks the hard coded ones from `Control_config`.

Example:
Previously, if the modder specifies a default key for, say, `Enter Subspace (End Mission)` as `Enter` instead of `Alt-J` in `Controlconfigdefaults.tbl` then the game will only look for if `Enter` was pressed, whereas the `key-pressed` tree in FRED will not show that and will still show `Alt-J`. Then if the FREDer uses `Alt-J` it won't ever actually trigger in-game since the control table has switched it to `Enter`. This PR would allow FRED to properly show `Enter` instead of `Alt-J` in the sexp tree for `key-pressed`.

Background:
1) Game reads the hardcoded values for each key and saves in `Control_config`
2) Game parses `Controlconfigdefaults.tbl` and updates the default keys in `Control_config` with any that are specified in that table.
3) Now the key defaults have been changed, and when `key-pressed` is called it searches for it's argument in the updated `Control_config` array, but only searches for the default. Thus even if the player changed the key, it will still find it and properly convert it.

All of that works well and as expected. But FRED never goes beyond step 1, so when FREDing I don't use the drop down tree for `key-pressed` since it doesn't actually match what the game will know when it parses `Controlconfigdefaults.tbl` in step 2.
2019-12-14 16:16:32 -05:00
wookieejedi 7d60ee882b add keys 0 and 5-9 2019-12-14 15:20:31 -05:00
Goober5000 f958116a64 Merge pull request #2190 from MitoPL/MitoPL-patch-1
Hide FPS counter with the rest of HUD
2019-12-14 15:05:32 -05:00
Goober5000 4b51ac5987 Merge pull request #2184 from FSCyborg/Fix-JumpNode-Briefing-Bug
Fix Crashes In Briefing Screen
2019-12-14 11:57:29 -05:00
Goober5000 d06a3ca72c Merge pull request #2195 from Goober5000/fix_mantis_2542
apply fix for model_anim_get_time_type (Mantis 2542)
2019-12-14 11:31:03 -05:00
m!m fdf37dcb35 Merge pull request #2052 from asarium/feature/scriptingModelPaths
Add scripting API support for model paths
2019-12-14 12:36:18 +01:00
asarium b825f57bf4 Add scripting API support for model paths
This adds a scripting API for querying the paths of a model.
2019-12-14 09:15:44 +01:00
Goober5000 d664f13f97 Merge pull request #2192 from FSCyborg/Fix_FSO_Launch_From_FRED
Open FSO from FRED Using FRED's Directory
2019-12-14 00:47:16 -05:00
Goober5000 a069eb62f9 apply fix for model_anim_get_time_type (Mantis 2542)
This patch was posted in 2011 but never applied.  Here's a PR to remedy that.

Mantis ticket:
http://scp.indiegames.us/mantis/view.php?id=2542

Original thread:
http://www.hard-light.net/forums/index.php?topic=79068.0
2019-12-14 00:39:58 -05:00
wookieejedi 3bc878db9a Allows the custom controls to work with key-pressed sexp
This expands the functionality of the cusotm controls to work with rebindings when using the sexp `key-pressed`. A key default value must be specified in `controlsconfigcommon.cpp` for the sexp `key-pressed` to track key binding changes. This PR adds that functionality by assigning default keys that were not in use (alt shift 1-5).
2019-12-13 23:27:35 -05:00
FSCyborg 0e31be10f5 Switch to nullptr in this function 2019-12-13 21:19:56 -05:00
Goober5000 e96f9400e1 Merge pull request #2193 from The-E/fix/remove_unused_cmdline_flags
Remove the -ogl_spec and -spec_exp cmdline arguments
2019-12-13 13:46:20 -05:00
Fabian Woltermann d703d61cba Remove the -ogl_spec and -spec_exp cmdline arguments, as they are no longer used by anything 2019-12-13 12:37:36 +01:00
FSCyborg f00be46211 Open FSO from FRED Using FRED's Directory
According to the CreateProcess() documentation, passing NULL in the eighth argument starts a process in the same directory as the original process, which is what we're trying to do.

Please note this is a Windows only solution, and cannot be ported to QTFred

Addresses 1775, already tested on Release and Debug
2019-12-12 21:36:18 -05:00
Taylor Richards 826a92745d clean up logging just a bit 2019-12-12 08:06:59 -05:00
Taylor Richards f573706d07 allow for unicast (gateway) route type
this fixes an issue where the default gateway
isn't in the main routing table but is instead
the primary unicast route

(ChromeOS, maybe others)
2019-12-12 08:06:59 -05:00
Taylor Richards 9ae62e9db8 remove some cruft from previous attempts 2019-12-12 08:06:59 -05:00
Taylor Richards 7da6276f07 fix type issue with XP compat code 2019-12-12 08:06:59 -05:00
Taylor Richards c286c4c2ce add support for automatic port forwarding 2019-12-12 08:06:59 -05:00
Goober5000 820d4452d8 Merge pull request #2191 from notimaginative/fix_multi_mode_switch
properly save single/multi mode setting
2019-12-12 03:07:16 -05:00
MitoPL e8a07b6972 Update freespace.cpp
A quick update that should allow for the FPS gauge to be hidden together with the rest of the HUD. Sounds useful for anyone wanting to take clean screenshots.
Also, thanks @wookiejedi for showing me how to do this.
(Will that even work? that's my first real meeting with GitHub so I'm a bit anxious.)
2019-12-12 01:19:34 +01:00
Taylor Richards 7ede543ca7 properly save single/multi mode setting 2019-12-11 17:48:48 -05:00
Goober5000 da1634cdc2 Merge pull request #2158 from Goober5000/never_viewable
add $Never Viewable flag for cutscenes
2019-12-11 12:49:59 -05:00
Goober5000 1183140dc2 Merge pull request #2169 from notimaginative/pxo_banners
fix PXO banners (and inetgetfile stuff)
2019-12-11 12:47:37 -05:00
Allen A. Babb fc29960b3b Merge pull request #2189 from wookieejedi/add-custom-controls-for-modders
Add Extra, Empty Controls for Modders to Use.
2019-12-11 07:59:10 -06:00
wookieejedi 2e3f0e2f80 Add Extra, Empty Controls for Modders to Use
Many mods and scripts use custom features that are triggered by key press. Currently, those keypresses cannot be changed by the player. I want to add 5 controls that do nothing and thus can be used for scripts/modding purposes. This way the modder could add new features/controls easily and have them show up in the controls menu and be bindable. As opposed to using a script which triggers via a keypress, and that keypress cannot be changed by the player in game (and may be bound to another control).

Also, Axem has expressed he would find this feature and Fate of the Galaxy certainly will.
2019-12-10 19:59:04 -05:00
Goober5000 d9bb6625fd Merge pull request #2188 from asarium/fix/1481
Fix #1481: Use a lower default specular factor
2019-12-10 19:07:12 -05:00
Goober5000 d2c9afc853 Merge pull request #2187 from wookieejedi/specify-string-index-via-xstr
Method to fix controls translation issue
2019-12-10 19:06:43 -05:00
wookieejedi 8535c3cbea clarify variable is int 2019-12-10 13:51:03 -05:00
wookieejedi 8fdd8624e4 fix struct issue 2019-12-10 13:44:21 -05:00
asarium c294433741 Fix #1481: Use a lower default specular factor
This is a fix for models with no spec map since the current default
factor looks very odd for retail models.
2019-12-10 19:40:18 +01:00
wookieejedi e89fb04b8c test fix troubleshooting 2019-12-10 13:24:52 -05:00
wookieejedi de0a43940f update comment with correct type 2019-12-10 13:20:28 -05:00
wookieejedi 02aab6cfdf Method to fix controls translation issue
This PR adds functionality to `Has Xstr:` in `controlconfiguredefaults.tbl`. Previously this value was use as a boolean, 0 or 1 to specify if the string should be used. This PR treats that field as an integer, and thus allows modders to specify which string to use for the control. If the value is 0 (default) then the string is not used, if the value is 1 then the defautl string is used and if the value is greater then 1 the game will use that specified index in strings.tbl.

This allows modders to properly translate all control names.  Specifially, six controls overlaped with pre-existing string.tbl indexes adn thus could not be translated properly. These are VIEW_TOPDOWN, VIEW_TRACK_TARGET, AUTO_PILOT_TOGGLE, NAV_CYCLE, TOGGLE_GLIDING, and CYCLE_PRIMARY_WEAPON_SEQUENCE.

This PR will allow modders to now proerly have full control name translations. It also provides a fix for issue #1629.
2019-12-10 12:57:31 -05:00
FSCyborg d0bee3a3ac Fix Crashes In Briefing Screen
Fixes the following:
1. Crash from creating an icon from a jumpnode
2. Crash from creating an icon from a waypoint
3. Waypoint would become a jumpnode icon in briefing screen.

This line is the cause:

                iconp->ship_class = (int)std::distance(Ship_info.cbegin(), it);

The main purpose of this commit is to change iconp to biconp, like the rest of the function uses.

The other change is how it checks for a jumpnode so that it is only true if there *is* a jumpnode.
2019-12-09 21:48:16 -05:00
Goober5000 2049778da8 Merge pull request #2171 from Kiloku/master
Add Documentation Update instructions and moves Building info from Readme to wiki
2019-12-09 16:19:43 -05:00
Goober5000 2972fdc1cf Merge pull request #2186 from wookieejedi/deprecate-set-object-speed
Deprecates `set-object-speed` in favor of `ship-maneuver`
2019-12-09 16:18:48 -05:00
wookieejedi b0dfca91c5 hide set-object-speed in FRED 2019-12-09 14:37:59 -05:00
wookieejedi 55e5351214 Deprecates set-object-position in favor of // wookieejedi - this sexp is deprecated in favor of ship-maneuver`
Per dicussion on Discord and and Github, `set-object-position`  does not work properly and the fix would involve making it act the same way as `ship-maneuver`. With discussions with Goober (who originally made it), we have decided to deprecate the sexp. I have talked with folks who have used it thus I am not removing it from FRED with this PR but I am open to discussion on that point.
2019-12-09 14:15:38 -05:00
MageKing17 2789d143bb Merge pull request #2185 from MageKing17/cleanup/objecttypes-nocreate-behavior
Standardize nonstandard "+nocreate" behavior in objecttypes.tbl
2019-12-09 01:31:40 -08:00
MageKing17 8935075af9 Make clang-tidy happy by changing NULL to nullptr. 2019-12-08 19:25:24 -08:00
MageKing17 90467f8f41 Standardize nonstandard "+nocreate" behavior in objecttypes.tbl
If you modified an existing ship type without using +nocreate, it would both modify it and add it to the vector again, leading to (at the very least) wasted memory. I copied over some more standard behavior from other parsing functions to hopefully avoid problems with modular objecttypes.
2019-12-08 18:53:19 -08:00
Goober5000 4d6ec5c431 Merge pull request #2182 from wookieejedi/fix-rtt-ss-bracket-bug
Fix RTT Subsystem Bracket Bug
2019-12-08 15:08:02 -05:00
wookieejedi 9184ed4224 Fix RTT Subsystem Bracket Bug
Previosuly, subsystem brackets in the target ship gauge were not always drawn in the correct location when using RTT with the gauge. This PR fixes that.
2019-12-07 23:56:54 -05:00
Goober5000 599313da81 Merge pull request #2179 from asarium/fix/ciStuff
Fix some CI issues
2019-12-07 11:26:58 -05:00
Goober5000andMageKing17 f8bdfa2d0b Update code/cutscene/cutscenes.cpp
Slightly compactify flag check

Co-Authored-By: MageKing17 <[email protected]>
2019-12-05 12:22:16 -05:00
asarium f817538567 Fix some CI issues
First one is to allow MinGW failures since that is unreliable at the
moment. Second one is a fix for the regex used by clang-tidy so that it
doesn't try to analyze CMake files.
2019-12-05 18:16:59 +01:00
Goober5000 8bde99654f Merge pull request #2178 from FSCyborg/Free_Look_X_Inversion_bug
Fix Free look turning in the wrong directions
2019-12-05 11:48:30 -05:00
Taylor Richards 7552b50a2e address clang-tidy issues 2019-12-05 01:30:18 -05:00
Taylor Richards f4883401e9 const all the chars 2019-12-05 01:30:18 -05:00
Taylor Richards d223aee4e7 fix PXO banners (and inetgetfile stuff) 2019-12-05 01:30:18 -05:00
FSCyborg d6ec51235b Fix Free look turning in the wrong directions
Free look will now move in the same directions as ship controls, whether pitch or yaw, and whether using keyboard or mouse/joystick.

Also, remove an inaccurate comment, and add a clarifying one.
2019-12-04 23:50:39 -05:00
Goober5000 d84231642d Merge pull request #2177 from MageKing17/bugfix/surround-front-speakers
Make 2D sounds play from front speakers instead of rear.
2019-12-04 22:14:14 -05:00
Goober5000 0f020abf3d use a flagset 2019-12-04 21:26:05 -05:00
MageKing17 39bd7cfdce Make 2D sounds play from front speakers instead of rear.
The Z coordinate, from negative to positive, means "front to back", so a Z value of 1.0 (with relative playback, which is what 2D sounds use) means "as far back as possible", i.e. the rear speakers. It's hard to know if this was intentional or not, but feedback from an actual user with a surround setup is that the opposite is preferable.
2019-12-04 17:10:23 -08:00
MageKing17 4cad3d4fc2 Merge pull request #2174 from Goober5000/repeat_count_fix
better sanity-checking for repeat_count, and also check trigger_count
2019-12-04 14:59:38 -08:00
Goober5000 0eb0cc87d1 correction 2019-12-04 00:57:02 -05:00
MageKing17 520f8f4e04 Merge pull request #2175 from Goober5000/fix_2063_bug
fix set-object-facing for wings not present
2019-12-02 23:05:46 -08:00
Goober5000 85e955a58f fix set-object-facing for wings not present
There was a small but serious bug in PR #2063 that would cause a crash.  This fixes it.
2019-12-02 23:36:28 -05:00
Goober5000 c01e30e393 address CI complaint 2019-12-02 23:09:03 -05:00
Goober5000 52f709a2db address feedback 2019-12-02 18:11:29 -05:00
Goober5000 425a6e67d5 add $Never Viewable flag for cutscenes
There are now three states for cutscenes: always viewable, where they will appear no matter what; never viewable, where they will never appear; and viewable, which can be modified during the campaign.  Currently cutscenes will go from not-viewable to viewable, but organizing the flags this way will allow a future feature to make cutscenes not-viewable, if that is desired.

There's also a small edit to csv_convert to guard against array overflows.  Not directly related to the feature but it's in the same place and affects the same code.
2019-12-02 18:11:29 -05:00
Goober5000 3c7c8486eb better sanity-checking for repeat_count, and also check trigger_count
Sanity checking for repeat counts shouldn't crash the game, so change from Error to Warning and use a sensible default.  Also copy the check (with minor modification) to also check trigger counts.
2019-12-02 17:56:51 -05:00
Goober5000 fadcaa0ca1 Merge pull request #2051 from asarium/feature/genericLuaDocumentation
Make Lua documentation generation more generic
2019-12-02 17:53:14 -05:00
Goober5000 e885203683 Revert "try this compiler flag, per https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin"
This reverts commit 013f6007f3.
2019-12-02 16:05:04 -05:00
Goober5000 013f6007f3 try this compiler flag, per https://stackoverflow.com/questions/43152633/invalid-register-for-seh-savexmm-in-cygwin 2019-12-02 14:54:19 -05:00
Goober5000 65ced1279d change to nullptr 2019-12-02 10:20:15 -05:00
Goober5000 383b3b7ca9 Merge pull request #2163 from Goober5000/revisiting_1450
don't restart if we are switching to a previously finished campaign
2019-12-01 14:07:53 -05:00
Goober5000 8204de3854 Merge pull request #2172 from wookieejedi/fix-on-goals-cleared
Fix FRED not working
2019-12-01 14:06:27 -05:00
Goober5000 c4a7a234ae Merge branch 'master' into feature/genericLuaDocumentation 2019-12-01 14:01:09 -05:00
Goober5000 8808e26f06 Merge pull request #2170 from Goober5000/small_fixes
Two small fixes
2019-12-01 13:57:30 -05:00
wookieejedi 10150c0640 fix int return 2019-12-01 12:07:44 -05:00
wookieejedi 674b6cd4fb Adds valid scripting state checks to functions that it was missing in 2019-12-01 11:59:15 -05:00
wookieejedi d271e33cca Fix fred not working
The `On Goals Cleared` scripting hook would result in FRED not working, thus this PR adds a check for scripting state to the hook and will only run if the scripting state is active. Now FRED will run proprerly.
2019-12-01 11:32:30 -05:00
Kiloku d340d96202 Formatting fixes 2019-12-01 09:58:53 -02:00
asarium 4ca589a61c Make Lua documentation generation more generic
This adds JSON as an additional scripting documentation output format.
This can be used by external tools to examine the scripting
documentation and generate interface declarations or documentation for
any language. The existing documentation code is left largely in place.
2019-12-01 12:53:51 +01:00
Kiloku 4ae495437b Moved most of the Readme to the wiki and linked it 2019-12-01 09:51:31 -02:00
Goober5000 8ed68efc34 Merge pull request #2154 from FSCyborg/Fix-sexp-set-weapon
Keep set-secondary-weapon from using nonsense
2019-12-01 00:37:30 -05:00
Goober5000 1a8dcb1be9 maybe this instead 2019-12-01 00:35:36 -05:00
Goober5000 821f90c5db add explicit cast to fix CI warning 2019-11-30 23:01:02 -05:00
Goober5000 775359c636 Merge pull request #2168 from notimaginative/multi_config_pxo
sanitize parsed multi.cfg settings for PXO
2019-11-30 22:59:23 -05:00
Goober5000 2d7c4de268 set Shadow_quality to default value 2019-11-30 22:55:20 -05:00
Goober5000 16b4c36cc0 Merge pull request #2167 from wookieejedi/fix-get-pitch-from-matrix
Fixes the extraction of pitch
2019-11-30 21:45:01 -05:00
FSCyborg 0008c5bacb Keeps set-secondary-weapon from using nonsense
Set-secondary-weapon and set-secondary-ammo have been up to know been allowed to exceed tabled cargo sizes, as long as you didn't put a value for requested_ammo in the sexp.

The limits would be inherited from the last secondary weapon in the slot, definitely not idea behavior.

Now includes matching changes to set-primary-ammo
2019-11-30 15:58:11 -05:00
Taylor Richards f518e277f1 sanitize parsed multi.cfg settings for PXO 2019-11-30 15:32:13 -05:00
Goober5000 0ff32b3f3e Merge pull request #2146 from scp-fs2open/feature/1587-new_lighting_defaults
Makes slight adjustments to the lighting defaults.
2019-11-30 12:57:54 -05:00
Fabian Woltermann 6abd8b0b60 Change the link associated with the -emissive_light flag 2019-11-30 15:02:21 +01:00
Goober5000 903e1563ce Merge pull request #2164 from FSCyborg/Mission_Campaign_Duplicate
Only Try To Load a Campaign Once
2019-11-29 17:51:02 -05:00
wookieejedi e519646e28 Optimized a bit
Tried a few different things and still can't find a way to remove the square-root unforuntealy.
2019-11-29 17:49:22 -05:00
Goober5000 4f89dd3c2f Merge pull request #2165 from chief1983/fix/line_ending_tomfoolery
Fix Line Ending Tomfoolery
2019-11-29 17:48:30 -05:00
wookieejedi 48773e3099 Fixes the extraction of pitch
It turns out that `angles_2_matrix ` would return a pitch value that was not the actual pitch from the 3x3 matrix. The pitch line in the code is uses a modifed `cosp` as the demoninator to calculate the pitch angle. I looked up online what the caclulation should be and found a more accurate way than using the modifed cosp, is to use ( fvec.xyz.x^2 + fvec.xyz.z^2 )^0.5 I tested using the new calculation throughouly and in each test it returned the proper pitch value from the 3x3 orientation matrix.
2019-11-29 16:31:41 -05:00
Cliff 5f234426b1 fix/line_ending_tomfoolery: Making everything auto globally is causing more problems than it might be trying to solve. 2019-11-29 10:40:08 -06:00
FSCyborg 7b2e8340c6 Only Try To Load a Campaign Once
Correct me if I'm wrong, but there's no need to try to load the default campaign twice.
2019-11-29 00:50:40 -05:00
Goober5000 1d4dea29d1 Merge pull request #2162 from Goober5000/small_play_sound_fix
very small fix to multi_sexp_close_sound_from_file
2019-11-29 00:29:02 -05:00
Goober5000 bd5fef4861 actually, there is one case where we still need to reset the tech db 2019-11-28 14:40:37 -05:00
Goober5000 1b533d5c7e don't restart if we are switching to a previously finished campaign
This is a follow-up to #1450, based on feedback and preference.  Instead of always resetting campaign progress, just switch to the campaign.  The player can then explore the tech room database or the finished missions if he chooses.

This also fixes a few bugs:

1) Ever since the tech-database-reset feature was introduced in 2003 or so, the game incorrectly checked the campaign being unselected, not the campaign being selected.  This is now obsolete since neither the tech database nor the campaign progress are reset.
2) Not all campaign loading failure types were recorded in `mission_load_campaign`.
2019-11-28 14:03:29 -05:00
Goober5000 c5ae4ca2b9 very small fix to multi_sexp_close_sound_from_file
The default fade argument is `true`, as specified by the sexp help, not false.  This probably doesn't matter here as the multi packet should receive all sexp arguments anyway, but better to be consistent.
2019-11-28 13:00:21 -05:00
Goober5000 9abcd55f23 Merge pull request #2159 from wookieejedi/add-on-goals-cleared-hook
Add `On Goals Cleared` Scripting Hook
2019-11-28 12:00:33 -05:00
Kiloku 88fdae1863 Merge branch 'master' of https://github.com/Kiloku/fs2open.github.com 2019-11-28 00:30:44 -02:00
Kiloku 4c9454274f Merge pull request #1 from scp-fs2open/master
Updating
2019-11-27 23:30:09 -03:00
Kiloku 4fc13dcb72 Added a bit more info to the checklist 2019-11-28 00:11:09 -02:00
Kiloku ceb592b182 Added a simple checklist to help keep the documentation updated 2019-11-28 00:05:23 -02:00
Goober5000 54455522b2 Merge pull request #2156 from Kiloku/master
Tackles most of #711
2019-11-26 22:24:30 -05:00
wookieejedi ea021c6fe3 Add On Goals Cleared Scripting Hook
Adds 'On Goals Cleared' hook variable for scripting system. Previosly there was not scripting or sexp method to determine if a ship had all of it's goals cleared.
2019-11-25 21:12:40 -05:00
Goober5000 ccb7480b53 Merge pull request #2155 from wookieejedi/improve-on-waypoints-done-hook
Add waypoint-path hook variable to `On Waypoints Done` Hook
2019-11-25 00:47:08 -05:00
wookieejedi 06a783cce4 Use more consistent naming with Waypointlist 2019-11-24 23:11:23 -05:00
wookieejedi d56ce4cb56 add missing space 2019-11-24 21:13:56 -05:00
wookieejedi a93be36740 simplify waypointpath set 2019-11-24 18:17:37 -05:00
wookieejedi 3926ee39dd Add waypoint path name to On Waypoints Done Hook
Originall the scripting hook `On Waypoints Done` only provided the ship or wing. This PR adds the waypoint path that was completed as an additional hook variable.
2019-11-24 15:16:11 -05:00
Kiloku 44c9fc2ec9 Corrected formatting in Copying.md 2019-11-24 18:13:42 -02:00
Kiloku b06f6476c9 Add youtube link 2019-11-24 18:12:12 -02:00
Kiloku 8278007cdb Merge branch 'master' of https://github.com/Kiloku/fs2open.github.com 2019-11-24 18:09:55 -02:00
Kiloku c5d201ba67 Linked updated video (1999/2019) and reworded comparison line 2019-11-24 18:09:37 -02:00
Kiloku 30326cb67e Rename COPYING.md to Copying.md 2019-11-24 17:07:13 -03:00
Kiloku d4c960fa13 Added FSU comparison video link to About.md 2019-11-24 18:05:49 -02:00
Kiloku 78c7f375cc Remove FS2OpenSCPReadMe.doc file, which was severely outdated. 2019-11-24 17:59:21 -02:00
Kiloku 851899418e Add About.md file, giving general information meant more for newcomers 2019-11-24 17:58:40 -02:00
Kiloku 58bd966f54 Removed outdated INSTALL file 2019-11-24 17:27:20 -02:00
Kiloku 5dbefc99d0 Changed Authors to a markdown file, updated the information in it 2019-11-24 17:27:09 -02:00
Kiloku d60929cd53 Changed COPYING to MarkDown format, added a link to the FSO's Licensing page at wiki in github 2019-11-24 17:13:39 -02:00
Kiloku fdca5ffeed Added a separator before the Older Changes section 2019-11-24 17:08:03 -02:00
Kiloku 9ac5c7e041 Minor formatting change 2019-11-24 17:07:11 -02:00
Kiloku 75d925e8e8 Re-ordered the sections in 3.6.14 2019-11-24 17:05:04 -02:00
Kiloku bec81ed752 Merged old changelog into the new changelog 2019-11-24 17:03:18 -02:00
Kiloku 0a61706368 Added links to some relevant info and added a section explaining the version number scheme change 2019-11-24 16:59:25 -02:00
Kiloku 368194a23e Added more changes found through some extra sleuthing 2019-11-24 16:54:10 -02:00
Kiloku ff520dbfa4 Added changes all the way to 3.6.14 (2012) 2019-11-24 16:46:06 -02:00
Kiloku e2c6fc3cc2 Increased conformity with Keep A Changelog 2019-11-24 15:54:18 -02:00
Kiloku 6d770c8bc5 Added 2019 RC1 to changelog 2019-11-24 15:44:02 -02:00
Goober5000 6200b380d7 Merge pull request #2144 from notimaginative/winsock2
switch to using winsock2
2019-11-23 09:25:11 -05:00
Goober5000 ea7c454e6a Merge pull request #2149 from FSCyborg/Patch_N-Gon_Radar
Patch n gon radar
2019-11-23 09:23:57 -05:00
Fabian Woltermann 7d40cbb241 Merge pull request #2148 from notimaginative/fix_audiostr_looping
avoid full stream reset when looping music
2019-11-23 11:32:00 +01:00
Fabian Woltermann 6c356692b2 Merge pull request #2152 from FSCyborg/Fix-The-Pirates
Bring Pirates of the FSO Back by
2019-11-23 11:30:18 +01:00
Fabian Woltermann 400440ca63 Merge pull request #2153 from FSCyborg/Fix-1992
Fix#1992
2019-11-23 11:27:56 +01:00
Fabian Woltermann 5ae9623f9e Switches the behaviour of the Lab emissive lighting switch to be in line with the other changes. 2019-11-23 11:06:38 +01:00
Goober5000 166a88d4a6 Merge pull request #2139 from FSCyborg/Fix#1886
Fix#1886 by Upgrading to SDL 2.0.10
2019-11-22 20:25:21 -05:00
Taylor Richards 0dcea8f93e fix building of qtFRED 2019-11-20 22:57:41 -05:00
FSCyborg 4c2a3450f8 Fix 1992
Send the ship to the actual initial position once the engine knows where the ship should end up.
2019-11-18 22:16:33 -05:00
FSCyborg 51d362e447 Bring Pirates of the FSO Back by
Preventing a nullptr deep within shipfx_warpin_start()

Add Assertions to check for nullptr Warp Effect
2019-11-18 21:40:16 -05:00
Taylor Richards 70b14a5c2c fix PORT command
was in wrong order before, did this code
ever work? ...
2019-11-18 17:04:02 -05:00
Taylor Richards e9cf9ac10d deal with type warnings on Windows 2019-11-18 12:00:26 -05:00
Taylor Richards 990820cad8 prevent excess headers being included on Windows 2019-11-18 11:59:19 -05:00
FSCyborg 623be80e48 Move Creation of Hud Gauge to Accomodate gauge_load_common()
We didn't realize that Gauge_load_common had some assumptions about where Origin: and Offset: are, so we accidentally broke custom radars.  Moving this section up forces modders to have an odd order for their entries, but based on the way the code was written, there really doesn't seem to be another choice.
2019-11-17 21:22:22 -05:00
Taylor Richards 6b3f5051ea avoid full stream reset when looping music
fixes #2097
2019-11-17 16:00:38 -05:00
Fabian Woltermann 7451fb36d9 Actually set the bloom intensity 2019-11-17 18:07:33 +01:00
Fabian 9e5cd347be Makes slight adjustments to the lighting defaults.
This commit disables emissive lighting on objects by default (as the new HDR process makes it unnecessary) and switches the -no-emissive commandline parameter to -emissive; Setting that parameter will restore the old behaviour. The -no-emissive parameter is retained to avoid user-facing error messages.
In addition, this commit sets the default bloom value to 25.
2019-11-17 13:38:24 +01:00
FSCyborg 1f41d98e2a Fix#1886 by Upgrading to SDL 2.0.10
This should fix #1886.  I built it and it fixes the immediate problem.

Only two of the documentation files we have in the codebase were actually updated.

Verison name in prebuilt.cmake also needed to be changed due to prebuild SDL version changing during upgrade to the prebuild repository.
2019-11-16 16:39:12 -05:00
Goober5000 1c77ffe07f Merge pull request #1211 from z64555/feature/ngon_radar_vector
[Feature] Ngon Radar
2019-11-16 14:46:43 -05:00
Goober5000 29b853de0c Merge pull request #2028 from Goober5000/clang_tidy_upgrade
upgrade clang-tidy to 8.0, the latest stable release
2019-11-16 13:53:35 -05:00
Goober5000 48c67b563a Merge pull request #2145 from asarium/fix/referenceNullError
Handle invalid Lua reference correctly
2019-11-16 13:52:28 -05:00
asarium 4ccccb526e Upgrade Travis to Xenial to support newer clang-tidy versions 2019-11-16 17:11:57 +01:00
asarium a61324f559 Handle invalid Lua reference correctly
This should never have worked but was only discovered by the recent
switch to the default copy constructors for some reason.
2019-11-16 17:08:34 +01:00
Goober5000 a3d2ca5724 add additional configuration per github comments 2019-11-16 15:46:05 +01:00
Goober5000 97ace6fa8c upgrade clang-tidy to 8.0, the latest stable release 2019-11-16 15:46:05 +01:00
m!m 7a11e247f3 Merge pull request #1740 from asarium/build/clangXstrFinder
Add tool for extracting XSTR calls
2019-11-16 15:36:43 +01:00
Taylor Richards 29ce72f66f switch to using winsock2
also removes some obsolete win32 #ifdef's and
cleans up some windows #include's
2019-11-15 23:33:35 -05:00
Goober5000 a94c4e46a1 Merge pull request #2136 from FSCyborg/dumb_rotate
Fix Dumb_Rotate Regression
2019-11-13 01:15:12 -05:00
Goober5000 e262878add Merge pull request #2143 from wookieejedi/fix_3d_weaponselect
Fixes 3D Weapon Selection Bug
2019-11-12 23:06:57 -05:00
wookieejedi c499cfb192 Fixes 3D Weapon Selection Bug
Fixes 3D weapon selection not working when an animation is already specified.
2019-11-12 21:34:20 -05:00
FSCyborg 2238c0af63 Move Default Values to Class Define
Part of modernizing the code base, Travis, at least, prefers defaults to be in the class definition instead of having multiple constructor functions have the same default values.
2019-11-12 16:58:41 -05:00
Goober5000 6a0023da4b Merge pull request #2141 from FSCyborg/fix_rearm_increment
Set Ballistic Primaries ream increment no matter what
2019-11-11 15:52:43 -05:00
FSCyborg bb19d69b7b Set Ballistic Primaries if not Missiles no matter what
Fix the rearm by not depending on flags that haven't been set yet....
2019-11-11 12:39:20 -05:00
FSCyborg e62b64bac8 Fix Dumb_Rotate Regression
Allows jump nodes to use instrinsic/dumb rotation again by exposing the jump node class to the model instancing code and adding a check for it in modelread.
2019-11-11 11:22:13 -05:00
FSCyborg a17f5031bf Fix the unique pointer and constructor
Unique pointers need to be constructed in very particular ways, but so did this NGON radar class, so we just had to put the constructor function inside unique pointer constructor.

And to keep that special pointer from going out of scope, we switched to the ternery operator.

Also made these changes:
Change to hypotf()
Fix Shadowing, Zero Vector macro not working at all.
Offset changed to offset_incoming
blip changed to blip_instance
Offset changed to = {} to initialize the struct without a problem.
clampBlip() required an override
Give offset a default initializer.
Switch to <cmath>
(Apparently <math.h> was deprecated and needs to be replaced with <cmath>.)
One last complaint from travis about a redundant default value.

Thank you Travis!
2019-11-10 13:49:31 -05:00
z64555 1fb194a729 Use vmd_zero_vector instead of ZERO_VECTOR in places that expect an actual vector.
Refactor plotBlip() a bit.
Rename the variable 'blip' in clampBlip() to the more generic 'b'
Use 'hypotf' instead of '_hypotf'
2019-11-10 13:49:30 -05:00
z64555 f0f72b25a5 Add the ngon source files so cmake can find them. Update doxy of find_intersection. 2019-11-10 13:49:29 -05:00
z64555 f8f9bce7da Adds Ngon radar. This is a standard 2D radar, but uses a polygonal plot area instead of the std's oval.
* Modders can specify how many sides the radar can have (as few as 3) with "Ngon Sides:" and can also define an optional twist angle with "Ngon Offset:".

* Also refactors the standard radar code a bit
2019-11-10 13:49:28 -05:00
z64555 082304a4b8 Adds function to find the intersection of two lines 2019-11-10 13:49:27 -05:00
Goober5000 6614b6cd9a Merge pull request #2138 from notimaginative/fix_std_user_config_reset
fix standalone causing user config reset on *nix
2019-11-10 13:45:13 -05:00
Goober5000 3450a39e75 Merge pull request #2137 from notimaginative/fix_pxo_std_mod_detect
init tracker when attempting to validate game data
2019-11-10 13:44:30 -05:00
Taylor Richards 58ada6cf05 fix standalone causing user config reset on *nix 2019-11-10 00:47:02 -05:00
Taylor Richards 4369f1b555 init tracker when attempting to validate game data 2019-11-09 19:43:28 -05:00
Goober5000 8e94880c7f Merge pull request #2135 from Goober5000/goal_achievable_tweak
Two subsystem-related fixes
2019-11-08 16:06:10 -05:00
Goober5000 0a1bd5be5c Merge pull request #2127 from notimaginative/pxo
replace FS2NetD with PXO
2019-11-08 10:16:32 -05:00
Taylor Richards bd9880bc9b replace FS2NetD with PXO 2019-11-08 02:07:14 -05:00
Goober5000 6433181607 correctly set and recalculate subsystem info when using subsys-set-random 2019-11-07 19:20:25 -05:00
Goober5000 28ce16ba6b make goal-achievable dependent on actual status of subsystem 2019-11-07 19:19:51 -05:00
Goober5000 1b69015b50 Merge pull request #2129 from asarium/build/gcc9
Update Travis to GCC 9 and fix warnings
2019-11-07 15:36:34 -05:00
asarium be24f7f574 Switch back to int 2019-11-07 18:45:09 +01:00
asarium afc7c671d2 Remove Mac actions again
This fails for some obscure reason right after merging it. I don't care
enough about Mac to attempt to fix it so I'll just remove it...
2019-11-07 18:40:03 +01:00
asarium e31e68cba0 Update Travis to GCC 9 and fix warnings
Only one warning type this time, the implicit copy operator for types
with a copy constructor has been deprecated so we need to delcare them
ourself.
2019-11-06 18:22:50 +01:00
m!m b5663cfd89 Merge pull request #2134 from asarium/build/ghActions
Add Mac GitHub Actions
2019-11-05 18:44:15 +01:00
Goober5000 3ec94338d3 Merge pull request #2132 from FSCyborg/Coverity1370825
Coverity1370825
2019-11-04 22:51:05 -05:00
FSCyborg 627294039f Coverity1370825
Covertity is complaining about portions of the verts array being uninitialized, so this is just a quick change to initialize the array first before doing anything else.
2019-11-04 20:13:36 -05:00
Kiloku 86a12c0654 Initial changelog improvement 2019-11-04 21:41:41 -02:00
Goober5000 c5805bcd8d Merge pull request #2131 from FSCyborg/Covertiy-1297186,187,188,190
Address Coverity 1297186,187,188, 190
2019-11-03 20:27:46 -05:00
FSCyborg 601fa75d50 Change while(0) to while(false)
Travis is complaining about while(0), so we're getting it off of our back by switching to while(false).
2019-11-03 16:27:23 -05:00
Goober5000 68df93ccff Merge pull request #2130 from Goober5000/fix_missionnotes_flags
add missing lines for flags
2019-11-03 10:15:40 -05:00
FSCyborg 5084fdd189 Address Coverity 1297186,187,188, 190
These coverity issues are all caused by the same code being copy and pasted in three different places.

There does not seem to be danger of the negative array access, but the changes that "fix" it are also slight optimizations (assuming the compiler hasn't been catching them).

In short, I am basically just moving code around to avoid duiplicate checks and in other places checking for the negative array index explicitly.

Suggested style corrections now included.
2019-11-03 09:37:27 -05:00
asarium 256e5028a1 Add tool for extracting XSTR calls
This uses clangs LibTooling for parsing the FSO source files to ASTs
which can then be used for extracing the strings used in XSTR calls.
This supports both standard XSTR calls and UI_XSTR definitions and
writes the resulting information in the strings.tbl format to stdout.
It also detects duplicate translation id usages with different text
values.
2019-11-03 15:17:05 +01:00
asarium 327ee0fccb Add Mac GitHub Actions
Also separate windows tests into it's own step.
2019-11-03 13:09:30 +01:00
Goober5000 efb3d08494 add missing lines for flags 2019-11-02 00:28:45 -04:00
Allen A. Babb 2e5da03e86 Merge pull request #2128 from Goober5000/backwards_maneuver_fix
fix an oversight with dont-clamp-max-velocity
2019-10-31 10:53:18 -05:00
Goober5000 3a4bd86153 fix an oversight with dont-clamp-max-velocity 2019-10-29 19:59:53 -04:00
Goober5000 f0526e3f7c Merge pull request #2126 from asarium/build/ghActions
Add Windows Checks for GitHub Actions
2019-10-26 21:16:45 -04:00
asarium 963db03f3e Add Windows Checks for GitHub Actions
This will test compilation and tests on Windows as compiled by Visual
Studio and MinGW.
2019-10-26 22:23:48 +02:00
Goober5000 a8cf7f2c69 Merge pull request #2118 from Goober5000/maneuver_flags
Enhanced ship maneuvers
2019-10-26 14:10:40 -04:00
Goober5000 99c23b11cd Merge pull request #2115 from Goober5000/play_sound_from_file_improvements
allow multiple simultaneous sexp-controlled audio streams
2019-10-26 14:09:25 -04:00
Goober5000 8b7e99c4cb Merge pull request #2122 from Goober5000/small_sexp_h_fix
add OP_NONCAMPAIGN_FLAG to a couple sexps
2019-10-26 14:09:14 -04:00
Goober5000 515b0062f4 Merge pull request #2125 from Goober5000/matrix_from_vectors
create matrixes from vectors
2019-10-26 14:08:58 -04:00
Goober5000 ae1e0c90fa address feedback 2019-10-26 11:47:13 -04:00
MageKing17 edad20d562 Merge pull request #2121 from FSCyborg/fix-2120
Fix-2120
2019-10-25 19:15:30 -07:00
MageKing17 481be44713 Merge pull request #2076 from FSCyborg/#1848-Ballistic-Rearm_Time
For Issue #1848 - Add option to change default rearm values
2019-10-25 19:10:12 -07:00
Goober5000 d3c2b17ae9 actually this is correct 2019-10-25 15:01:02 -04:00
m!m f34e76bd55 Merge pull request #2123 from asarium/build/ghActions
Add more GitHub actions configurations
2019-10-25 19:57:53 +02:00
Goober5000 8a388accec create matrixes from vectors 2019-10-25 01:12:10 -04:00
asarium 8379a5c1f5 Add more GitHub actions configurations
This adds more Linux configurations for testing different compilers.
2019-10-24 20:33:54 +02:00
FSCyborg aef0e1f78a For Issue #1848 - Add option to change default rearm values
Although not technically a bug, several mods have been misled by the description of the "$Rearm Rate:" weapons table setting, and specifying an initial ammo value that is less than 100 for ballistic primaries would force the ballistic ammo to be loaded all at once, with "$Rearm Rate:" just specifying how long that one load would take.

This allows modders to use more realistic behavior for things like anti-turret ballistic primaries, where initial ammo could be in the thirties so that any number above zero can be added per load.
2019-10-24 01:10:52 -04:00
FSCyborg 4eac2e0cbc Fix-2120
Move the bottom text reset to inside the if so that it isn't kept empty by accident.

Let me know if I should move the comment around at all.
2019-10-23 23:26:15 -04:00
m!m 404c11e4a5 Merge pull request #2119 from asarium/fix/luaObjectHooks
Clear object events when Lua state is shut down
2019-10-23 18:18:22 +02:00
Goober5000 fc3ae5f93d add OP_NONCAMPAIGN_FLAG to a couple sexps that shouldn't be used in campaign files 2019-10-22 19:57:42 -04:00
asarium 0649f9abaa Clear object events when Lua state is shut down
Since the Lua state is destroyed before all the object events, this was
causing issues. This should fix that by clearing the events when the lua
state is destroyed.
2019-10-22 18:09:57 +02:00
m!m 17c9547d83 Merge pull request #2117 from asarium/build/ghActions
Add GitHub Actions workflow for pull requests
2019-10-21 18:12:00 +02:00
Goober5000 5f8192d1ee actually figure out instantaneous acceleration, and refactor a bit 2019-10-20 16:30:38 -04:00
Goober5000 2bea31dab0 Merge pull request #2116 from asarium/fix/2086-detect_unsupported_pref_chars
Fix #2086: Detect unsupported characters in root paths
2019-10-20 12:38:21 -04:00
asarium a22ef2e19d Add GitHub Actions workflow for pull requests
This currently only does the GCC Linux compilation but it's a good start
to check out how this works and if it will work for us.
2019-10-20 15:06:24 +02:00
asarium cf8fa26187 Fix #2086: Detect unsupported characters in root paths
Since FSO does not support Unicode characters in filesystem paths on
Windows yet, it is necessary to catch these issues early on and display
an appropriate error message. These changes do that by going through the
path with our UTF-8 decoder and detecting any characters that are out of
the ASCII range.
2019-10-20 12:46:00 +02:00
Goober5000 ab3388f397 add sexp and script support for maneuvers with new CIF_ flags 2019-10-20 00:59:43 -04:00
Goober5000 a80e4ba56e add some very useful control flags for ship maneuvers 2019-10-19 00:28:52 -04:00
Goober5000 3a9855ac69 allow multiple simultaneous sexp-controlled audio streams
Enhances play-sound-from-file, etc. to allow more than one audio stream to be played at the same time, provided all stream are referenced by audio handles contained in variables.
2019-10-18 23:23:00 -04:00
MageKing17 cced7e9e3f Merge pull request #2114 from MageKing17/cleanup/misc-typos
Correcting a couple debug typos.
2019-10-17 20:37:10 -07:00
MageKing17 323debfb91 Merge pull request #2113 from MageKing17/cleanup/png-warnings
Give PNG warnings their own category, so they're hidden by default.
2019-10-17 20:10:46 -07:00
MageKing17 4a464b2e8e Merge pull request #2112 from MageKing17/bugfix/csg-radar-range-check
Make .csg loading code check rp_dist, just like .plr loading does.
2019-10-17 20:10:34 -07:00
MageKing17 7a0a9ea475 Merge pull request #2111 from MageKing17/bugfix/filesystem-sort-order
Move filename sort in cf_get_file_list() to before packfile search.
2019-10-17 19:48:59 -07:00
MageKing17 8f619871e6 Move filename sort in cf_get_file_list() to before packfile search.
The intent behind this sort (added in #2094) was to make the order of files returned by the filesystem consistent across platforms; however, the sort occurred not only after the filesystem search, but after the packfile search, which changed the order files load in on all filesystems instead of making it consistent. This moves the sort to be after the filesystem search but before the packfile search, hopefully making load order consistent once more.
2019-10-17 14:14:31 -07:00
MageKing17 52fdb393ae Give PNG warnings their own category, so they're hidden by default.
This probably isn't the kind of information that should appear in the average debug log, since it's unlikely to be of use in standard troubleshooting.
2019-10-17 13:44:02 -07:00
MageKing17 9770d7f59b Make .csg loading code check rp_dist, just like .plr loading does.
When loading a .plr file, HUD_config.rp_dist is loaded and then sanity-checked; if the value is out of bounds, a Warning is generated and RR_INFINITY assigned. HUD_config.rp_dist is also loaded when loading a .csg file, however the sanity check isn't present; this copies the block over so the behavior is identical.
2019-10-17 13:41:12 -07:00
MageKing17 c1e6aca72b Correcting a couple debug typos.
"glowpoint present" should be "glowpoint preset", and there is no "op_num function".
2019-10-17 13:38:11 -07:00
MageKing17 40d3f5d38f Merge pull request #2110 from Goober5000/copy_text_until_errormsg_fix
fix bug in copy_text_until error message
2019-10-17 11:14:01 -07:00
Goober5000 58a4825d9b fix bug in copy_text_until error message
This bug has been around since the original public source code release!

The error message character calculation did not agree with the actual error check.  This PR fixes that.  Thanks to Novachen on Discord for discovering this.
2019-10-15 14:21:22 -04:00
Goober5000 3811eafee6 Merge pull request #2107 from Goober5000/fix_1138
fix FreeBSD warning in stubs.cpp
2019-10-14 00:56:03 -04:00
Goober5000 7703b27e64 Merge pull request #2105 from Goober5000/grant_medal_xstr
miscellaneous XSTR cleanup
2019-10-14 00:55:56 -04:00
Goober5000 18e9746792 formatting tweak, mainly to try to get the builds to trigger 2019-10-13 15:58:15 -04:00
Goober5000 334f392eb1 change token string, per m!m's review 2019-10-13 13:50:37 -04:00
Goober5000 d3d6e2ea41 add informative comment 2019-10-13 13:44:28 -04:00
Goober5000 db1da25272 Merge pull request #2100 from Goober5000/fix_2099
Handle pausing and unpausing music in certain screens
2019-10-13 13:37:11 -04:00
Goober5000 01102e14be Merge pull request #2102 from Goober5000/fix_for_counter
fix default loop increment in for-counter
2019-10-13 13:36:06 -04:00
Goober5000 2be44008da Merge pull request #2104 from Goober5000/fix_issue_1221
fix issue #1221
2019-10-13 13:35:00 -04:00
Goober5000 93effdd31b Merge pull request #2106 from Goober5000/command_sender_enhancement
implement Mantis 3204
2019-10-13 13:30:17 -04:00
Goober5000 aa2cc618d3 Merge pull request #2108 from Goober5000/arrival_departure_pr_from_595
Only update arrival/departure location if ship is not part of a wing
2019-10-13 13:28:04 -04:00
Goober5000 a5d63654fc Merge pull request #2103 from Goober5000/persistent_variable_errormsg_fix
this error message should report the variable name
2019-10-13 13:26:41 -04:00
Goober5000 09f1de6efe ohcomeon.gif 2019-10-12 16:21:09 -04:00
Goober5000 b4a4d70ff4 additional change suggested by MageKing17 2019-10-12 14:33:58 -04:00
Goober5000 c6c2e5b17e add the changes from downwash's PR 2019-10-12 14:25:00 -04:00
Goober5000 15c9533089 Merge pull request #1540 from z64555/enchancement/parse_bookmarks
Extends the existing parse pausing system (used by bmpman) to use a
2019-10-12 13:17:47 -04:00
Goober5000 2de323eb5d fix const conflict 2019-10-12 13:12:41 -04:00
Goober5000 2f00b3a081 fix FreeBSD warning in stubs.cpp
Use m!m's suggestion to fix issue #1138
2019-10-12 13:04:04 -04:00
Goober5000 6895276aea implement Mantis 3204
This adds a mission flag to use the Command Sender as the source of any messages sent from #Command.
2019-10-12 12:53:09 -04:00
Goober5000 ff31bebc9c now CTEXT will never be NULL 2019-10-12 11:46:57 -04:00
Goober5000 6006670439 restore the original grant-medal and was-medal-granted sexps 2019-10-12 11:27:32 -04:00
Goober5000 e91ee3dd4f the variable can never be uninitialized here, but Travis is too dumb to realize it 2019-10-12 01:26:11 -04:00
Goober5000 53ec0d45cb this isn't actually needed 2019-10-11 23:51:18 -04:00
Goober5000 a34d696c29 add xstr capability for medals
The grant-medal and was-medal-granted sexps will now translate medal names, in the same way that tech-add-intel-xstr translates intel entries.  There is also some minor cleanup and the specifying of correct default -1 numbers for the xstr-capable sexps.
2019-10-11 21:51:16 -04:00
Goober5000 ce57c52faf fix issue #1221
Make -get_flags imply -parse_cmdline_only, per asarium's comment
2019-10-11 16:56:06 -04:00
Goober5000 0db66e776a this error message should report the variable name 2019-10-11 01:22:22 -04:00
Goober5000 f9e4a4bb2a fix default loop increment in for-counter
The default loop increment is 1, not 0.  When for-counter was converted to use eval_nums in PR #2035, this was inadvertently broken.
2019-10-11 01:17:31 -04:00
Goober5000 8cb39c424b properly resume music; also properly restore subspace ambient sound 2019-10-08 22:57:29 -04:00
Goober5000 15346dad16 reactivate old code to pause and unpause audio, but this time add the proper check 2019-10-08 22:44:56 -04:00
Goober5000 de501fb3f1 pause and unpause the event music in the ESC dialog, just like we do in the pause screen, and just like the subspace sound was fixed 2019-10-08 22:20:46 -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
m!m 81a827dda9 Merge pull request #2094 from tcrayford/fix_modular_table_load_order_on_non_windows
fix modular table loading errors on non windows
2019-09-13 20:09:06 +02:00
Tom Crayford f7f537ff77 fix mod loading errors on non windows
When running a mod on non-windows, that isn't packed into VP files, the
mod can break when loading. On non-windows filesystems, the file
order isn't guaranteed to be alphabetical (but it is on Windows).
As a result, we load tables in an effectively random order.

Lots of mods rely on the filesystem ordering to e.g. implement a very
loose dependency system for their lua scripts.

Referenced on the forum here:
https://www.hard-light.net/forums/index.php?topic=95750.msg1885275#msg1885275

Here's a log from Solaris failing to run:

https://fsnebula.org/log/5d7b4414cb0d332b466b5ee2#True-138

Instead, always sort filesystem listing by name *before* applying the
provided sort order.

I've built a few different versions of this patch, and like this one the
best. The other ones I tried:
1. Adding a `CF_SORT_REVERSE_NAME` and using it everywhere that
`CF_SORT_REVERSE` is used, and replacing all uses of `CF_SORT_NONE` with
`CF_SORT_NAME`. I didn't like this as it was a much larger diff.
2. Adding a `CF_SORT_REVERSE_NAME` to the `scripting.cpp` call for
loading tables. I didn't like this one because this bug can in theory
impact non scripting tables.

Here's a log from Solaris working with the new build:
https://fsnebula.org/log/5d7b4f37cb0d332b3d6b5ed3#True-138

While it might be a reasonable enhancement in the future to build a proper dependency system for lua scripts and tables,
this is a much smaller and easier change, and doesn't require any work from modders.
2019-09-13 17:22:15 +02:00
Goober5000 e1a0a8a2fb Merge pull request #2093 from tcrayford/update_object_facing_help_strings
update set-object-facing and set-object-facing-object sexp help
2019-09-07 15:20:49 -04:00
Tom Crayford 1cd22ba827 update set-object-facing and set-object-facing-object sexp help
As per the discussion in https://github.com/scp-fs2open/fs2open.github.com/issues/2092,
if you specify the turn time, these can behave quite weirdly.
Some mods that we don't want to break backwards compatability with use
that mode, but at least we can note the pitfalls in help.
2019-09-07 18:36:35 +02:00
m!m 4f884b5035 Merge pull request #2091 from asarium/fix/crashInJoystick
Fix crash in joystick code
2019-09-03 22:07:16 +02:00
asarium 894228cc7c Fix crash in joystick code
Not sure why we didn't catch this earlier but this should hopefully fix
the crash. The cause was that we constructed an SCP_string from a null
pointer instead of using the empty string as the default.
2019-09-03 19:53:04 +02:00
Goober5000 8f8afbc189 Merge pull request #2087 from asarium/feature/crashdumps
Write Minidumps when a crash occurs
2019-08-29 14:18:58 -04:00
Cliff Gordon f4bfec5029 Merge pull request #2089 from asarium/build/fixTravisGitHubToken
Update Travis GitHub token
2019-08-28 12:45:13 -05:00
asarium c18f775962 Update Travis GitHub token
The token used by Travis was also out of date so here is a new one. This
is a token created by the SirKnightly user.
2019-08-28 18:14:49 +02:00
Goober5000 608dcb6b44 Merge pull request #2088 from asarium/build/fixAppveyorGitHubToken
Update GitHub token used for AppVeyor release building
2019-08-26 15:10:35 -04:00
asarium b4b23e266b Update GitHub token used for AppVeyor release building
For some reason the old token was removed from the AppVeyor GitHub
account which made the release build fail.
2019-08-26 17:58:12 +02:00
asarium c41eef517b Write Minidumps when a crash occurs
This will write Mini dumps in the event that the executable causes a
crash. This will allow us to take a closer look at any crashes without
having to reproduce them.
2019-08-25 20:22:23 +02:00
m!m 65e2aa88b3 Merge pull request #2059 from asarium/build/travisWindowsAlways
Do not allow failure for Windows Travis builds anymore
2019-08-24 13:11:29 +02:00
asarium fe0c6a629a Do not allow failure for Windows Travis builds anymore 2019-08-22 17:36:28 +02:00
MageKing17 730c62af81 Merge pull request #2085 from Goober5000/issue_2081_actual_fix
Issue 2081 actual fix
2019-08-19 23:52:40 -07:00
Goober5000 13d4ebaceb leave a 'node' variable pointing to the beginning of the sexp node list so that we can manipulate it later 2019-08-19 23:35:55 -04:00
Goober5000 ed6a780898 Revert "fix for issue #2081" 2019-08-19 23:19:30 -04:00
Goober5000 f0b9929cd3 Merge pull request #2083 from Goober5000/eval_nums_redo
fix for issue #2081
2019-08-19 18:13:45 -04:00
Goober5000 f315caad95 fix a bug, and use Error instead of Warning since this indicates a programming error 2019-08-19 16:29:49 -04:00
Goober5000 b5a47e651f fix for issue #2081
This re-implements the eval_nums function to use C varargs, instead of C++11 template parameter packs.  This is necessary because Visual Studio has a bug where template parameter packs corrupt heap memory somehow.
2019-08-19 16:19:53 -04:00
m!m d49299225c Merge pull request #2080 from tcrayford/de_fault_is_in_de_spelling
fix typo: defualt->default
2019-08-11 14:33:32 +02:00
Tom Crayford 3b0bb79d79 fix typo: defualt->default 2019-08-11 11:09:13 +01:00
Goober5000 daacdc0035 Merge pull request #2078 from FSCyborg/Fix-#1433-
Fix 1433 Take two
2019-08-10 22:41:03 -04:00
FSCyborg 39df9ef90e Fix 1433 Take two
Have FSO check for subspace and start the loop up again when subspace is being used.
2019-08-09 22:21:33 -04:00
Goober5000 fc080cccbd Merge pull request #2075 from FSCyborg/fix#1916
"Fix" 1916
2019-07-30 22:59:47 -04:00
FSCyborg 0c07ad9d71 "Fix" 1916
Adds a check to see if the subsystem is the same before restting aspect lock.

More of an enhancement to expected behavior than a bugfix.
2019-07-30 17:58:52 -04:00
Goober5000 7d329bbbc6 Merge pull request #2074 from FSCyborg/fix#1974
Fix#1974
2019-07-30 12:33:40 -04:00
m!m 17a449529f Merge pull request #2060 from Mithi83/bug/1987-lab-thrusters
fix bug #1987: thruster rendering in lab
2019-07-30 11:59:36 +02:00
FSCyborg 73f0addc42 Fix#1974
"Cloning" failure was actually being caused by the pilot verification function resetting all pilot info and then not loading controls from the file to replace them.

The Control_Config array would all be set to -1 and then would get written into the file the next time the player was saved, making it seem that the controls were not being copied.

The original and current code would reset controls to defaults when a pilot was created.  And it would just let the old controls remain in case of a clone. The above problem would occur just as you hit accept on the bottom of the baracks screen.
2019-07-29 21:25:50 -04:00
Goober5000 0ba1583d90 Merge pull request #2035 from Goober5000/patch_nan_handling
when evaluating numeric SEXPs, handle NaN properly
2019-07-28 01:03:11 -04:00
Goober5000 2436697f2c Merge pull request #2071 from FSCyborg/Fix#2067
Fix#2067
2019-07-27 22:51:24 -04:00
FSCyborg 0e10100aad Fix#2067
Original behavior in Fred was accidentally removed when upgrading the FSO mission parser to keep it from crashing FSO from a bad sexp.  But returning false is only necessary in FSO since in FRED, we can fix the error once we know about it.
2019-07-27 21:21:33 -04:00
Goober5000 60bcdefac0 remove unneeded header 2019-07-25 15:14:45 -04:00
Goober5000 5d8ac3cc11 bring up to date with another eval_num 2019-07-25 15:14:45 -04:00
Goober5000 e0bc2f188b help the compiler out a bit, per Gasbow's suggestion 2019-07-25 15:14:45 -04:00
Goober5000 d13bbdd534 move eval-num derivatives out of the header file 2019-07-25 15:14:45 -04:00
Goober5000 44b09d137f let's try a function pointer instead of std::function 2019-07-25 15:14:45 -04:00
Goober5000 4439edcb4d more complaints 2019-07-25 15:14:45 -04:00
Goober5000 a9ddeda40e edits and clang-tidy 2019-07-25 15:14:45 -04:00
Goober5000 d606e4d952 complaints and stuff 2019-07-25 15:14:44 -04:00
Goober5000 2fa8a0bd84 that const crept back in again 2019-07-25 15:14:44 -04:00
Goober5000 f9d178d46b additional small fixes 2019-07-25 15:14:44 -04:00
Goober5000 989235936e when evaluating numeric SEXPs, handle NaN properly
NaN should propagate through the SEXP tree, but not all SEXPs do this properly.  The problem was made worse after I introducted `eval_num()` which silently ignored NaN values.  This commit adds new boolean arguments to `eval_num()` to flag NaN results, and changes all calls of `eval_num()` to properly handle the new arguments.  Additionally, this adds `eval_nums()` and `eval_array()` functions to more smoothly handle cases where many numbers appear in a row.
2019-07-25 15:14:44 -04:00
Goober5000 6df9c73a4c Merge pull request #2063 from Goober5000/modify_set_object_position
Allow positioning sexps to work on ships yet to arrive
2019-07-25 14:13:38 -04:00
Goober5000 d794eb6e77 Merge pull request #2070 from FSCyborg/Coverity#1093387
Coverity 1093387
2019-07-20 20:31:01 -04:00
Goober5000 e5c06c9554 Merge pull request #2069 from FSCyborg/Cyborg-Coverity-Fixes
Coverity 1093370
2019-07-20 18:14:38 -04:00
FSCyborg bc00b79922 Coverity 1093387
We already verify that the variable will not be null in the previous code block.
2019-07-20 16:12:45 -04:00
Goober5000 e1e86667b3 Merge pull request #2068 from FSCyborg/Fix#1791
Fix#1791 ChangeIFF & Laser_Flag
2019-07-20 01:05:33 -04:00
FSCyborg 881f787ac8 Fix#1791 ChangeIFF & Laser_Flag
Extremely rare bug caused by use of multiple protect from weapon flags. One of the Ai-Turret functions was setting only one of the flags because "else if" was typed instead of "if".
2019-07-19 21:21:58 -04:00
FSCyborg 88d5bed064 Coverity 1093370
Copy paste error, I can think of no reason to compare Max y and Min z
2019-07-19 09:11:14 -04:00
m!m d9b1659efc Merge pull request #2064 from asarium/fix/scriptingDeprecation
Move deprecation of createParticle to the next version
2019-07-15 19:46:50 +02:00
Goober5000 f6408113f2 fix stuffing of vector pointer 2019-07-15 13:15:21 -04:00
asarium 6075c17255 Move deprecation of createParticle to the next version
This should fix a problem with the MVPs.
2019-07-15 17:54:41 +02:00
Goober5000 da9f71dac0 might as well do set-object-facing and set-object-facing-object as well 2019-07-14 23:26:18 -04:00
Goober5000 03f1344794 might as well do set-object-orientation too 2019-07-14 21:24:22 -04:00
Goober5000 59e9d7cb0c add missing break to case 2019-07-14 21:20:33 -04:00
Goober5000 910595880a Allow set-object-position to work on ships yet to arrive
This adds `set-object-position` functionality for ships and wingmen still on the arrival list.  Requested by JSRNerdo.
2019-07-13 14:24:06 -04:00
MageKing17 9f07e43455 Merge pull request #2020 from asarium/feature/scriptingDeprecation
Add deprecation feature for the scripting API
2019-07-11 15:08:45 -07:00
m!m 7b8c156980 Merge pull request #2022 from asarium/opengl/smaa
Add SMAA post processing step
2019-07-11 18:02:47 +02:00
Thomas Jansen f8c11ccd2e fix bug #1987: thruster rendering in lab
Lab_selected_index must remain unchanged until labviewer_change_model is
called. There the variable is used to determine if a new ship must be
created and updated afterwards.
2019-07-07 08:36:55 +02:00
Goober5000 7e36dc8afe Merge pull request #2058 from FSCyborg/master
Coverity 1093382
2019-07-05 12:25:53 -04:00
FSCyborg b1ad89a9fa Update chttpget.cpp 2019-07-04 10:14:07 -04:00
FSCyborg 4d9b1a7674 Update chttpget.cpp 2019-07-03 15:03:34 -04:00
FSCyborg 72f3871b7b Update chttpget.cpp 2019-07-03 10:14:24 -04:00
FSCyborg 7906ff460a Coverity 1093382
Coverity spotted this dead code.  Looks like the original coder forgot that they had checked for !p already or was a case of mindless copy-pasting code..

Because of
pcode = strchr(p,' ')+1;
it looks like it really is safe to remove.
2019-07-02 23:18:13 -04:00
asarium 1eb1923751 Add SMAA 2019-06-30 13:28:05 +02:00
asarium 6d1931bf99 Add function for drawing full screen using oversized triangles
This replaces the current instances where two triangles are used for
drawing a full screen quad.
2019-06-30 13:08:45 +02:00
asarium f75cb1edd3 Add deprecation feature for the scripting API
This allows to mark certain functions or virtvars to be declared as
"deprecated" starting with a specific engine version. What this means is
that a special message will be added to the documentation stating since
when the function is deprecated and can contain an optional message. The
actual enforcement of the deprecation depends on the target version of
the mod so that we can stay backwards compatible.

If the mod supports the version since when the function is deprecated,
it will not be added to the Lua state which means that it doesn't exist
for the calling script. If the targetted version is before the stated
version, the function will still be added to the Lua state.

As the first function to use this feature, I have deprecated
createParticle in the testing library and moved it to the graphics
library with a new name reflecting that it creates a persistent
particle. I also added the corresponding function for adding a
non-persistent particle.
2019-06-30 11:31:32 +02:00
Goober5000 48586bc857 Merge pull request #2055 from wookieejedi/fix_weapon_icon_override
Bug fix: adds missing conditional when using weapon icons and 3D weapon selection
2019-06-28 18:29:07 -04:00
Goober5000 3adb861640 Merge pull request #2057 from wookieejedi/fix_blownoff_bug
Fix blown_off bug for good
2019-06-28 18:17:34 -04:00
wookieejedi 7b1f407c22 Fix blown_off bug for good
Thanks for @SamuelCho for telling me what to put to fix this bug for good. This PR fixes #2046 (for good it seems!).
2019-06-28 15:33:29 -04:00
Goober5000 ed5b4b9b5a Merge pull request #2054 from Goober5000/itld_bugfix
properly indicate that player ships have departed at the end of a mission
2019-06-27 15:21:09 -04:00
niffiwan b63ddf08bb Merge pull request #2056 from SamuelCho/subsys_destroyed_fix
Make sure various model rendering/collision code reference submodel instances instead of the prototype data
2019-06-27 20:39:19 +10:00
SamuelCho 816d8e5415 Make sure various model rendering/collision code reference submodel instances instead of the prototype data. 2019-06-25 22:33:52 -07:00
Goober5000 e7e43e9466 Merge pull request #2044 from niffiwan/fix/capitalplus_vs_shields
Fix AI selection of capital+ weps vs shields
2019-06-25 22:19:49 -04:00
wookieejedi 48e630dfd1 Add () to fix travis error 2019-06-25 17:17:02 -04:00
wookieejedi 00f2ddc8da Bug fix: adds missing conditional when using custom icons and 3D weapon selection
Previously if the 3D_weapon flag was used it would always create a weapon icon and overrride any pre-existing icons the modder would specify. This PR fixes that by adding an extra set of conditionals, which specify if a weapon has an icon file name then it should be used, and if the weapon does not have an `$Anim:` but does have a model then that model should be used if the 3D_weapon flag is enabled.
2019-06-25 16:20:13 -04:00
Goober5000 c6d93275c2 address clang complaint 2019-06-24 13:03:38 -04:00
Goober5000 e2ce0bea9b tweak comment 2019-06-24 02:13:19 -04:00
Goober5000 a98fd2cb54 use the new 'mission_check_ship_yet_to_arrive' function when appropriate 2019-06-24 02:11:35 -04:00
Goober5000 5444e81fab add new function for properly evaluating ship arrivals 2019-06-24 01:28:07 -04:00
Goober5000 83276a355d if ship is departing to jump node, add that to the script hook 2019-06-23 16:05:36 -04:00
m!m 98606b37e4 Merge pull request #2053 from wookieejedi/arc_color-options
Adds Table Option to Modify Arc Colors
2019-06-23 09:17:00 +02:00
wookieejedi c4a7e9694f Fix error message vars 2019-06-22 20:50:29 -04:00
wookieejedi 2db1758ec2 Use stuff_int_list
Incorporate m!m feedback
2019-06-22 17:59:59 -04:00
wookieejedi cff070dc07 Update to using tuples and error checks
Incorporates m!m's feedback.
2019-06-22 16:07:55 -04:00
wookieejedi 7b3ad77f36 Adds Table Option to Modify Arc Colors
This PR adds a table entry that allows modders to specify the RGBI values for the damage and emp arc colors (which were previosuly hardcoded).

This option adds the table entry to `Game_settings.tbl` under `#Graphic Settings` with the lines:
```
$EMP Arc Color:
	+Primary Color Option 1: rgb
	+Primary Color Option 2: rgb
	+Secondary Color Option 1: rgb

$Damage Arc Color:
	+Primary Color Option 1: rgb
	+Primary Color Option 2: rgb
	+Secondary Color Option 1: rgb
```
2019-06-21 14:58:05 -04:00
Goober5000 d67e79a44b Merge pull request #2042 from Goober5000/nested_subsys_destruction
properly handle destruction/repair of subsystem tree
2019-06-06 01:48:03 -04:00
niffiwan 977190b358 Address review feedback
Make wip an actual pointer!
Rename some vars to better reflect their usage (vs previous copy-pasta)
2019-06-04 18:39:21 +10:00
m!m ba3237604e Merge pull request #2048 from wookieejedi/per_shipclass_help_threshold
Add per ship class options for when AI sends "Help Me" message
2019-05-29 18:44:46 +02:00
Goober5000 a94550ee1a Merge pull request #2049 from plieblang/MapIteratorCleanup
Clean up map::iterator usage
2019-05-25 00:45:46 -04:00
wookieejedi d55a6632ca and one more float to specify 2019-05-24 23:58:52 -04:00
wookieejedi 680cb580cd specify rest of floats 2019-05-24 23:49:19 -04:00
wookieejedi 2f74940f6a specify float 2019-05-24 23:00:55 -04:00
plieblang 3dbe27e772 Clean up map::iterator usage 2019-05-24 13:43:04 -07:00
wookieejedi 72d876bd4b Switch to const and add error checks
Incorporatea ll of m!m's feedback.
2019-05-23 15:35:59 -04:00
wookieejedi e22398bec8 Add per ship class options for when AI sends "Help Me" message
This PR allows modders to set, on a per-ship class basis, the fields for what hull and shiled integrity the AI wingmen send the "Help" message at. One good use case is when ships have low hitpoints, thus now the modder can set AI can call for help sooner then at simply 30% hull.
2019-05-23 13:19:30 -04:00
Goober5000 11661db6ab oops -- get distance before setting it to 9999999 2019-05-17 14:31:16 -04:00
Goober5000 6164004df3 repair parent submodel if it needs repairing 2019-05-17 14:31:16 -04:00
Goober5000 505aa3cdd1 organize subsystem modification sexps to all call one function 2019-05-17 14:31:16 -04:00
Goober5000 cfeb8da3d3 don't reuse subsystems that are skipped 2019-05-17 14:31:15 -04:00
Goober5000 ec7945276a handle child subobjects being destroyed 2019-05-17 14:31:15 -04:00
Goober5000 2bf19afb94 make sure all instances of ship_recalc_subsys_strength happen after do_subobj_destroyed_stuff 2019-05-17 14:31:15 -04:00
Goober5000 34b38f63fa remove unneeded function 2019-05-17 14:31:15 -04:00
m!m 8f11d2e11c Merge pull request #2037 from Goober5000/on_subsystem_destroyed
add $On Subsystem Destroyed scripting hook
2019-05-17 19:47:11 +02:00
Goober5000 e4036b9e5a Merge pull request #2045 from MageKing17/bugfix/multi-sexp-flag-validity
Check flags are valid in multi_sexp_deal_with_ship_flag().
2019-05-17 13:42:09 -04:00
MageKing17 c86e94a4e7 Correct NULL to nullptr so clang-tidy is happy. 2019-05-17 09:13:02 -07:00
MageKing17 a6475f59f0 Check flags are valid in multi_sexp_deal_with_ship_flag().
In single-player, or while running as a server, sexp_deal_with_ship_flag() makes sure that object_flag, ship_flag, and p_object_flag aren't NUM_VALUES (i.e. not set) before trying to call flags.set() with them. However, the client code in multi_sexp_deal_with_ship_flag() had no such security checks, and as such would try to set NUM_VALUES, which is outside the range of valid flags; this led to a crash in Release builds and an Assertion otherwise.
2019-05-13 12:29:54 -07:00
Goober5000 69ebdd0417 Merge pull request #2043 from wookieejedi/add_gethotkey_sexp
Adds `get-hotkey` sexp
2019-05-13 13:32:21 -04:00
niffiwan 9444b9ff9f Merge pull request #2024 from CasparKielwein/collision_cleanup_ck
Refactoring of objcollision
2019-05-13 19:41:38 +10:00
niffiwan 4c7470fbf2 Fix AI selection of capital+ weps vs shields
Current the AI always selects capital+ weapons vs big/huge ships. This
makes the AI take shields into accounts, and not use the weapon if
either the shields are still up, or the weapon isn't good vs shields.

I don't greatly like the magic number 1.33 to determine if a weapon is
good vs shields, I'm happy to take alternative suggestions. I have
checked DE, WoD & BP tables and I don't think this change will affect
any of them (picked them because their either use capital+ weapons or
have shielded capships)

There's one DE weapon that the AI won't select anymore while shields
are up; however its fluff says it's bad vs shields and suggests a
paired shield-breaker so think it should be OK.
2019-05-12 15:50:13 +10:00
wookieejedi 8d3eeec238 Updated description 2019-05-11 14:03:15 -04:00
Goober5000 da0ff33fcb address feedback and implement asarium's suggestion 2019-05-11 13:06:21 -04:00
wookieejedi 764b4b8422 Improve comments and description 2019-05-11 10:38:40 -04:00
m!m a5d22589ec Merge pull request #2036 from wookieejedi/class_flyby_sounds
Adds per-class flyby sounds
2019-05-11 12:28:09 +02:00
wookieejedi 6a6940e0f0 Adds get-hotkey sexp
This PR adds a sexp that returns the integer value of a ship or wing hotkey. No hotkey returns -1, F5 returns 0, F6 returns 1, ... and the sexp takes one arguemnt, the ship or wing name.
2019-05-10 23:09:00 -04:00
niffiwan 2dfd9936d8 Merge pull request #2041 from niffiwan/fix/issue2040
Don't link if ship has 'no primary linking' flag
2019-05-11 10:19:29 +10:00
Goober5000 fb0847f4b5 Merge pull request #2038 from wookieejedi/add_sethotkey_sexp
Add new sexp: `add-remove-hotkey`
2019-05-10 17:50:48 -04:00
wookieejedi 7b959b09d2 Incorporate Goober's feedback 2019-05-10 15:34:05 -04:00
wookieejedi f4b713c56c Add bool arg 2019-05-10 15:12:49 -04:00
wookieejedi d32d3f55d1 Updated name and function
Incorporated all revisions and suggestions
2019-05-10 09:32:15 -04:00
niffiwan 1ebb72ee88 Don't link if ship has 'no primary linking' flag
Also adds/enhances some handy nprintf debug statements.
Fixes #2040
2019-05-10 23:06:16 +10:00
wookieejedi a988d0e972 Adds a new sexp, set-hotkey
This new sexp allows a FREDer to set a hotkey for a ship or wing. The sexp takes 2 or more arguemnts, the integer of the hotkey to set (F5=0, F6=1, ... F12=7) and the names of the ship(s) and/or wing(s).
2019-05-09 13:46:21 -04:00
Goober5000 8aa2f3b099 tweak spacing 2019-05-08 20:04:19 -04:00
Goober5000 8365f0abb7 add $On Subsystem Destroyed scripting hook
Implements the feature request from issue #610.

As an aside, this PR also patches the `ship_set_subsystem_strength` function (which is only used by the debug console and in the event you fire at your training instructor) to use the same code as the `set-subystem-strength` sexp.  This properly handles submodels blown off, sounds, etc.
2019-05-08 19:55:03 -04:00
wookieejedi 4afe739cbb Clean and shorten per request
Fixes spelling error in comment, uses proper flyby_snd and makes code more concise.
2019-05-08 14:14:01 -04:00
wookieejedi 2c469e0c88 Adds per-class flyby sounds
Previosuly, flyby sounds were only specified on a per-species basis. This PR allows each ship class to use a specific flyby sound. This will allow modders to set the custom sound in ships.tbl, just like any other per-class sound.
2019-05-08 14:00:28 -04:00
MageKing17 822e61665d Merge pull request #2026 from Goober5000/some_sexp_fixes
various sexp formatting and cleanup changes
2019-05-07 07:18:28 -07:00
niffiwan 5f5616c0fa Merge pull request #2030 from niffiwan/feature/deathroll_customisation
Allow death max rotation to be set per ship
2019-05-07 19:28:54 +10:00
Goober5000 b38f6aa014 HA! 2019-05-06 14:07:11 -04:00
Goober5000 d88e6f5a88 Merge pull request #2034 from niffiwan/fix/issue2033
Null wp_list on setting order, same as for sexps
2019-05-06 14:01:58 -04:00
niffiwan 760b601a95 Null wp_list on setting order, same as for sexps
Making wp_list null lets ai_mission_goal_achievable reset the waypoints
list correctly, otherwise it thinks the waypoints are ok when in fact
something has invalidated them
2019-05-06 18:30:38 +10:00
Fabian Woltermann 0bf116b0cc Merge pull request #2032 from The-E/fix/2031_copy_paste_error_in_lua_vecmath
Fix for error in validation of matrices accessed by lua
2019-05-06 07:51:40 +02:00
The_E 2180296f9c When setting individual elements of a matrix through lua, we need to mark the matrix as either having out of date angles or out of date vectors. 2019-05-05 20:06:28 +02:00
niffiwan b84fe72778 address feedback
This moves DEATHROLL_ROTVEL_CAP to shiphit.h & converts it to a
constexpr float
2019-05-05 22:13:32 +10:00
niffiwan c5e460a90d Allow death max rotation to be set per ship
This allows modders to restrict the amount of rotation in a death roll.
It's fairly simple to fit in with the existing code which has a lot of
hard coded constants. The intended use case is to restrict pitch &
heading changes so there's less chance of rapid forward rolls or flat
spins, especially with faster-than-FS2 ships.

I'd almost rather rewrite the entire code to dynamically use ships mass
& velocity except for retail compatibility issues.
2019-05-05 10:07:21 +10:00
CasparKielwein 271d3f97bd remove unused functions obj_add_pair and obj_add_pairs in object code.
These functions where not used anymore and probably made redundant
by swifties changes to the collision system in 2012.
2019-05-04 11:30:54 +02:00
CasparKielwein e70d6a89ee objcollide cleanup: declare local variables at point of first use
made some loops range based.
removed some typedef struct, as it is c++.
2019-05-04 11:30:16 +02:00
Goober5000 d1a8e66fce Merge pull request #2029 from niffiwan/fix/qtfred_mission_load_failure
Allow qtFred to open missions again
2019-05-04 01:58:58 -04:00
niffiwan 964f8f5ef1 Allow qtFred to open missions again
Minor miss from 9332311b57
Also has trivial comment fix
2019-05-04 14:02:50 +10:00
Goober5000 8ebe012e12 more complaints 2019-05-03 15:24:16 -04:00
Goober5000 92f142452a even more complaints 2019-05-03 14:07:13 -04:00
Goober5000 cfb80cfd16 fix modulo 2019-05-03 13:59:48 -04:00
Goober5000 39313ed8d7 Address feedback. Also fix a few things github complained about. Also fix depart-node-delay by correctly handling the 'delay' parameter as a value of type 'fix', just like the other *-delay sexps. 2019-05-03 13:06:51 -04:00
MageKing17 1da2c03cef Merge pull request #2016 from Goober5000/a_few_good_sexps
Three sexps and some sexp improvements
2019-05-01 20:13:11 -07:00
Goober5000 f9dbe4941b various sexp formatting and cleanup changes 2019-05-01 22:45:59 -04:00
Goober5000 46319f1b4e Merge pull request #2025 from Mithi83/bug/1827-targeting-brackets
fix bug #1827: targeting brackets stuck in top left corner
2019-05-01 14:31:47 -04:00
Thomas Jansen 8653d824cd fix bug #1827: targeting brackets stuck in top left corner
Every g3_start_frame must have a matching g3_end_frame. Thus, a return
in the middle of a function after an opening g3_start_frame must make
sure to call g3_end_frame before it leaves to avoid a dangling frame
context.

As described in the bug report at
https://github.com/scp-fs2open/fs2open.github.com/issues/1827
a floating point rounding issue could be the trigger for the problem.
2019-05-01 18:32:26 +02:00
CasparKielwein 3e7e7cde00 made functions from objcollide, which are only used in .cpp local to compilation unit 2019-05-01 10:41:27 +02:00
CasparKielwein f63667b29e Cleanup in objcollide: Remove code that was commented out 2019-05-01 10:07:35 +02:00
CasparKielwein b42fc2122a Cleanup in object collide code.
A bit of small cleanups in preparation of larger scale refactoring.

remove unused member heavy_collision_cm_pos of collision info struct,
which was set in several places but never used.
2019-05-01 09:44:19 +02:00
Goober5000 3ca4ba16fe Merge pull request #1892 from asarium/feature/optionsUI
Add new options system
2019-04-29 17:16:21 -04:00
Goober5000 36c14e21e8 Merge pull request #2021 from asarium/feature/axemWantsLuaAudioAPIs
Add unload function for freeing audio memory of a soundfile handle
2019-04-29 17:07:48 -04:00
asarium ce1ea75714 Add unload function for freeing audio memory of a soundfile handle
This can be used by scripts for explicitly freeing up some memory when
necessary.
2019-04-27 08:53:07 +02:00
Goober5000 30373e9138 Merge pull request #2019 from wookieejedi/clean_fix_showship_detailbox_bug
Cleaner fix for show-ship bug with detail_box calculations
2019-04-22 19:15:56 -04:00
wookieejedi 9e460332a6 add ship check
per Goober's request added a ship check
2019-04-22 17:53:07 -04:00
wookieejedi 473e2588bf Cleaner fix for show-ship bug with detail_box calculations
This provides a cleaner fix for the bug where using show ship caused detail_box calculations to incorrectly work on the player's ship.

It also reverts the changes made by PR #2018.
2019-04-22 10:28:41 -04:00
niffiwan 6350110b21 Merge pull request #2018 from wookieejedi/fix_detailbox_with_showship
Fix `detail_box` calculations when using `show ship`
2019-04-21 18:49:16 +10:00
wookieejedi 0c92134de5 fix detailbox using show ship
This PR fixes issue #2015, which is a bug where using `show ship` caused detail_box calculations to incorrectly use world coordinates for submodels on the player's ship, rather then the correct local coordinates.
2019-04-20 20:45:14 -04:00
Goober5000 681dd9b871 Merge pull request #1993 from niffiwan/fix/blackdetailboxes
detail boxes can ignore default distance scaling
2019-04-19 13:43:51 -04:00
Goober5000 213422076e KNOWN_ values aren't returned after all, derp 2019-04-19 00:34:39 -04:00
Goober5000 41aff9d094 ooooooops 2019-04-19 00:14:53 -04:00
Goober5000 337ca94b53 write out the full word 'number' 2019-04-18 01:18:05 -04:00
Goober5000 13f5037b0c add is-nan, nan-t-num, and functional-if-then-else 2019-04-18 01:12:00 -04:00
Goober5000 221d96f5d6 defensively check both regular and known sexp boolean values 2019-04-18 01:11:19 -04:00
Goober5000 bd6441004b optimize eval_sexp by not reconciling positive/negative if we have a magic number 2019-04-18 01:09:36 -04:00
Goober5000 14b6e86e5d made the SEXP_ numbers even more unlikely, in case someone wants to use large negative numbers 2019-04-17 12:32:51 -04:00
m!m 4824428971 Merge pull request #2014 from MageKing17/feature/ssm-strike-warp-effect-field
Add "+WarpEffect:" field to ssm.tbl.
2019-04-14 13:01:52 +02:00
MageKing17 6af8d4ccbd Add "+WarpEffect:" field to ssm.tbl.
Allows subspace strikes to choose which fireball to use for the warp effect. If absent, FIREBALL_WARP is used as the default (which was the previous hardcoded behavior).

"+WarpEffect:" can be specified as either an index or using the fireball's unique ID.
2019-04-13 20:35:52 -07:00
niffiwan d2d730138f Merge pull request #2013 from chief1983/fix/revert_nightly_test
Revert "Test the upload"
2019-04-08 02:38:22 +10:00
Cliff 7d67d16094 Revert "Test the upload"
This reverts commit 5fa5a199bf.
2019-04-07 09:15:41 -05:00
niffiwan 3f4eb05f3e Merge pull request #2012 from chief1983/fix/travis_uploads
Make sure to use a path that contains the new curl binary
2019-04-07 08:54:36 +10:00
Cliff Gordon 49f8660f7a fix/travis_uploads: Make sure to use a path that contains the new curl binary. 2019-04-06 13:20:35 -05:00
niffiwan 2833ae150f detail boxes can ignore default distance scaling
Add a submodel property that overrides the hard-coded distance
multipliers applied to the distances at which details boxes & spheres
are rendered. The distance multipliers are set by the "model detail"
setting in the options screen. Note that this is different to the LOD
distance multipliers which are not hard-coded.

This allows some more creative uses of detail boxes & spheres, e.g. to
stop models subobjects from being rendered when they're out of player
view. Past testing showed a reasonable performance improvement with
complicated models.

This is a submodel property rather than global, or a ship flag, to allow
flexibility, i.e. a single model could choose this option only for the
submodels that want to use detail boxes/spheres in this fashion, which
other detail boxes/spheres use the conventional approach.

Code & ideas originally from zookeeper, I've just packaged it up for
the PR.

This has been rebased & squashed based on feedback in the PR
2019-04-06 15:24:27 +10:00
niffiwan 8470548376 Merge pull request #2011 from wookieejedi/fix_drawRect_for_scripted_gauge
Fixes minor bug with `drawRectangle` for scripted HUD gauges
2019-04-05 20:20:12 +10:00
wookieejedi ea6bd1d9a4 Update hudgauge.cpp
Fixes a minor bug that incorrectly draws Rectangles to a scripted HUD gauge. The third and fourht arguments needed to be width and heigth, not x2 and y2.
2019-04-04 16:03:45 -04:00
m!m 18c0314652 Merge pull request #2010 from wookieejedi/Add_more_draw_functions_toScriptedGauge
Add more draw functions to scripted gauge
2019-03-30 21:22:28 +01:00
wookieejedi 98165dbce5 Fix typo, drawCirle -> drawCircle 2019-03-30 13:55:12 -04:00
wookieejedi 60bf6dec2c Merge branch 'Add_more_draw_functions_toScriptedGauge' of https://github.com/wookieejedi/fs2open.github.com into Add_more_draw_functions_toScriptedGauge 2019-03-30 09:54:35 -04:00
wookieejedi 252ab4e282 Follw m!m request for optional arg 2019-03-30 09:54:01 -04:00
wookieejedi bd93c8e661 Merge pull request #2 from wookieejedi/master
Rebase
2019-03-30 09:50:35 -04:00
wookieejedi 0e4056f795 Merge pull request #1 from scp-fs2open/master
Rebase
2019-03-30 09:49:10 -04:00
wookieejedi 8f877d3826 Fixed typo 2019-03-29 09:36:10 -04:00
wookieejedi 6025ab8318 Update drawCircle too to match gr.drawCircle 2019-03-29 08:57:54 -04:00
wookieejedi 679cbe2526 Made the draw functions more consistent with gr draw functions 2019-03-29 08:53:37 -04:00
m!m fa0140fea7 Merge pull request #2009 from wookieejedi/Add_drawImage_toScriptGauge
Add `drawImage` to Scripted Gauge
2019-03-29 10:57:31 +01:00
wookieejedi 5343503385 Add more draw functions to scripted gauge
This adds the following functions to the scripted gauge API: drawCircle, drawRect, and drawLine. Also note that I created an additional function, for HUDGauge:renderCircle_unfilled, becuase the precedent shown by having two functions for `gr_unfilled_circle` and `gr_circle` and adding a fourth argument to `renderCircle` seemed to affect a lot of other functions.
2019-03-28 16:58:25 -04:00
wookieejedi edd2cb89c7 Removed unneeded include 2019-03-28 13:44:54 -04:00
wookieejedi 6a2327088f Add drawImage to Scripted Gauge
Adds an additional draw function, `drawImage` to the new Scripted Gauge API.
2019-03-28 09:53:19 -04:00
niffiwan f798c5b916 Merge pull request #2007 from asarium/feature/scriptedHudGauges
Add new HUD gauge type for scripted gauges
2019-03-28 21:31:47 +10:00
m!m 76115122a0 Merge pull request #2003 from Goober5000/abort_processing_missions_which_failed_to_parse
cancel mission load when a syntax error is found
2019-03-27 17:58:00 +01:00
MageKing17 b4cb602e31 Merge pull request #2008 from NovachenFS2/new-strings
New translateable strings for the strings.tbl
2019-03-23 09:13:07 -07:00
m!mandNovachenFS2 d26b5310e7 Update code/controlconfig/controlsconfigcommon.cpp
Suggestion

Co-Authored-By: NovachenFS2 <[email protected]>
2019-03-23 14:14:36 +01:00
niffiwan cdb65c154c Merge pull request #2004 from wookieejedi/chase_displays
Add `Chase View Only` Option for HUD Gauges
2019-03-23 10:58:25 +10:00
Jenna Trassa fd0b612c64 New translateable strings for the strings.tbl
This commit adds new id for existing strings, so that they are translateable through the strings.tbl.
The following is translateable now:
- The 'or' seperator in the Keypress Directive gauge, if one function is bound to two keys.
- The Supernova warning.
- The error message that is displayed prior the pilot selection screen, if something is wrong with the loaded modification.
2019-03-22 22:44:35 +01:00
MageKing17 07d83d473c Merge pull request #1999 from asarium/cleanup/cleanupCfileType
Unify Cfile blocks and CFILE handles
2019-03-21 09:02:57 -07:00
asarium 1662a3c317 Add new HUD gauge type for scripted gauges
The new gauge can be accessed by the scripting API with which a function
can be set which will be called when this gauge is rendered. This can be
used for exposing the HUD gauge positioning and RTT options to the
scripting API without a lot of work needed for the script writer.

There is currently only one rendering function implemented since this is
only a proof of concept.
2019-03-17 09:27:58 +01:00
Goober5000 c70e4a0e7e Merge pull request #1991 from niffiwan/fix/issue1867
Fix issues with docked ships warping
2019-03-12 12:53:47 -04:00
niffiwan d82479fb14 tweak variable name for clarity 2019-03-12 21:13:02 +10:00
niffiwan be90059b65 fix documentation & var-name issue
Thanks to Goober5000 for noticing a very confusing var-name & errors in
the comments. Also switch to using bool check without '=='
2019-03-11 19:05:00 +10:00
niffiwan 04abbf55ed address feedback
Switch from 3x specific is_arriving functions to a single with params
Change flag names; replace "ndl" with "dock_follower"
Change dock-arrival helpers to not set follower flag on leaders
2019-03-10 09:26:12 +10:00
niffiwan 1bc925ee9b Merge pull request #2005 from wookieejedi/fix_font_lua_bug
Fixes bug with lua font handle
2019-03-09 10:12:04 +10:00
wookieejedi d558c2d632 Fixes bug with lua font handle
This PR fixes a bug where an invalid lua font handle would not be properly returned as invalid. An invalid handle is returned properly if the font name is invalid, but not if the index is invalid, thus this PR fixes that.
2019-03-08 17:07:21 -05:00
asarium 1c799653ce Unify Cfile blocks and CFILE handles
The only thing a CFILE contained was a version field which isn't used
anymore so that could be removed which basically meant that CFILE was
just an indirection to a Cfile_block which I then just renamed to CFILE.
The CFILE type is an opaque handle now since the contents are not
relevant to a user of Cfile.
2019-03-08 18:34:00 +01:00
wookieejedi 35af3a8b73 Place in correct order 2019-03-07 18:27:00 -05:00
wookieejedi 8586a319b0 Attempt Travis to rebuild 2019-03-07 18:10:30 -05:00
wookieejedi 15748adfda Adding Chase View Only Option for HUD Gauges
Currently, the player is unable to see a RTT hud gauge if in chase view. This adds an option in the hud_gauges.tbl that tells the game whether to draw a gauge based on if chase view is the active view. So for example, a modder using RTT mapped gauges can now make a HUD that displays on the interior of the ship (ie RTT with the cockpit model) and a HUD that displays when the player switches to chase view.
2019-03-07 16:06:51 -05:00
Cliff Gordon 6b0f73e427 Merge pull request #1990 from ngld/fix/curl-mac-upload
Compile curl ourselves on macOS and cache the result
2019-03-06 11:55:46 -06:00
Goober5000 1d744d347c add changes for qtfred 2019-03-06 00:18:40 -05:00
Goober5000 9332311b57 change C-style 0 on success, nonzero on failure to true on success, false on failure 2019-03-05 16:27:06 -05:00
Goober5000 47e9c01ce6 cancel mission load when a syntax error is found 2019-03-05 11:00:57 -05:00
MageKing17 5f176173bd Merge pull request #2000 from asarium/build/luaNatvis
Add natvis file for Lua
2019-03-04 19:48:20 -08:00
MageKing17 8d6538d7a9 Merge pull request #2002 from Goober5000/detroy
spelling fix
2019-03-04 19:39:13 -08:00
Goober5000 cc9e0a1096 spelling fix
now that all troys have been removed from all subsystems, this word can be changed
2019-03-04 17:32:29 -05:00
Goober5000 223e78926f Merge pull request #1998 from Goober5000/fix_missing_weapon_hook_variable
make sure to set all hook variables when the script hook is called
2019-03-04 17:09:31 -05:00
Goober5000 6679b623e4 same script stuff in beam.cpp 2019-03-03 15:20:45 -05:00
Goober5000 8aa2d0e212 a bit of minor housekeeping 2019-03-03 15:02:47 -05:00
Goober5000 1dc449ffa6 standardize order of parameters 2019-03-03 14:39:53 -05:00
Goober5000 6369cdec7c standardize comment 2019-03-03 14:39:25 -05:00
Goober5000 31fe15c4f4 remove hook variables immediately 2019-03-03 14:34:36 -05:00
Goober5000 dd384e7f1d standardize order of parameters 2019-03-03 14:32:54 -05:00
Goober5000 c8fa5803b9 set all hook variables (and unset them immediately after) for debris and asteroids 2019-03-03 14:24:50 -05:00
Goober5000 b57a608177 set all hook variables (and unset them immediately after) for debris and asteroids 2019-03-03 14:20:25 -05:00
Goober5000 f9f7a23b4d clearer invocation of the script hook 2019-03-03 14:11:29 -05:00
asarium 7e88feff16 Add natvis file for Lua
This should make debugging issues with Lua easier by providing a better
view on how the Lua state looks like.
2019-03-03 12:57:40 +01:00
Goober5000 c6bf5e927b make sure to set all hook variables when the script hook is called
In this block of code, the conditions were checked with a set of four hook variables but then subsequently run with only two.  This adds all four previously used variables.  More importantly, it adds the hook variables with expected and user-friendly names, since 'self' and 'object' are not necessarily intuitive.
2019-03-02 21:16:00 -05:00
asarium ad1ede7b74 Add new options system
This is a system for storing arbitrary data in the config file and then
easily retrieving it later on. This has full Lua support for exposing
the available options in a custom UI and changing the values of the
options. This ported some of the existing command line options over to
the new system which is opt-in for the moment by using a mod_table flag.
2019-03-02 14:02:21 +01:00
niffiwan 3c812915e4 add dock-related is_arriving helper functions
Address feedback from PR; reduce the number of hardcoded flags
2019-03-01 19:26:02 +10:00
Goober5000 62963d23ec Merge pull request #1908 from asarium/feature/scriptingFileAutoClose
Add scripting file handle auto-closing and error message
2019-02-27 22:47:18 -05:00
asarium dc71bb47d7 Add scripting file handle auto-closing and error message
This adds some auto-closing code to the scripting API of the CFile
system. If a file has to be auto-closed then an error will be displayed
to let the the script writer know that something is wrong.

This should not break existing scripts since causing file handle leaks
should never happen and if it does, this will make it easier to find
these issues.
2019-02-27 21:16:30 +01:00
m!m b79a3385a1 Merge pull request #1994 from asarium/build/circleci
Add CircleCI config file
2019-02-27 18:05:10 +01:00
asarium dfac2e98e9 Add CircleCI config file 2019-02-26 19:53:11 +01:00
niffiwan 37f2c8249d Fix issues with docked ships warping
There's a number of issues fixed here:
* Radar blips of docked ships were the wrong colour in stage 1
* You could target docked ships in stage 1
* Docked ships thrusters were visible in stage 1
* Hyperspace warptype ship could initially appear at their
warp-destination, then spring back to the correct location to complete
the rest of their warpin (because a docked ship had higher speed than
the dock leader)

There may also be a number of other subtle bugs with docked warpin;
e.g. I suspect (but haven't tested) that AI turrets could fire on
docked ships during warpin
These should also be fixed

Lastly, fixes issue #1867
2019-02-24 09:20:57 +10:00
ngld 5fa5a199bf Test the upload 2019-02-21 19:18:29 +01:00
ngld c00a2897f4 Compile curl ourselves on macOS and cache the result (for Linux as well).
We need to build our own curl binary since Homebrew doesn't support
 --with-libssh2 anymore.
I've also added caching to both the Linux and macOS code to avoid
rebuilding curl for each nightly.
2019-02-21 19:14:41 +01:00
Goober5000 ad4b1ca965 Merge pull request #1988 from niffiwan/fix/isdockedsingle
make is-docked work with a single argument
2019-02-17 11:13:40 -05:00
niffiwan f1f784f237 make is-docked work with a single argument
Currently is-docked always returns true if only a single argument is
supplied. This is probably as designed (except for not erroring on a
single arg) however it's quite easy to update to work for a single
argument and this case is useful for FotG, and might be useful for
others.
2019-02-17 19:19:03 +10:00
Goober5000 2c307ef5d3 Merge pull request #1983 from Goober5000/ship_initialization_tweaks
some tweaks and minor improvements to ship initialization
2019-02-07 14:40:58 -05:00
Goober5000 6f24d8d079 never mind, this is handled in the preloader 2019-02-05 02:23:58 -05:00
Goober5000 9fc94ab873 reconcile script and sexp 2019-02-05 02:21:20 -05:00
Goober5000 728ee2921f move ship_assign_sound into ship_create. also only assign sounds on change_ship_type if Fred is not running 2019-02-05 02:14:05 -05:00
MageKing17 caea0f56ed Merge pull request #1984 from Goober5000/ship_info_flag_fix
fix some flag information
2019-02-04 08:16:10 -08:00
niffiwan 94c9e1b494 Merge pull request #1985 from wookieejedi/AddWaypointHook
Add 'On Waypoints Done' Hook
2019-02-04 19:01:48 +10:00
wookieejedi 7dd1788aee Add 'On Waypoint Done' Hook
Adds 'On Waypoint Done' hook variable for scripting system.
2019-02-03 13:26:35 -05:00
Goober5000 77934c7215 actually it's better to document this 2019-02-02 23:32:57 -05:00
Goober5000 4a7c69082e ¯\_(ツ)_/¯ 2019-02-02 23:27:08 -05:00
Goober5000 74c4075aa6 address clang complaint 2019-01-29 23:43:28 -05:00
Goober5000 008d66c706 fix some flag information
Somewhere along the line, "sentry gun" was replaced with "escape pod" in the inverted is_flyable check.  This made the game think an escape pod wasn't flyable and therefore things like waypoint orders were not displayed.  This PR fixes that.

Additionally, I fixed a potential bug in weapons.cpp where the HUGE flag should really check against HUGE ships.  And there's a no-op formatting change in hudtargetbox.cpp.
2019-01-29 23:35:37 -05:00
Goober5000 1c385901cb prune a bit 2019-01-27 22:27:31 -05:00
Goober5000 5b9b06ab84 some tweaks and minor improvements to ship initialization
The core bug fixed here is #1982.  After ship_create sets up the ship, parse_object_create_sub does further initialization by copying some values from the parse object.  In most cases there are sensible defaults, but a few special cases require some post-processing...

- ship sounds
- the new way of initializing warp effects to allow per-ship customization
- intrinsic-no-shields
- an arrival entry in the mission log
- script hooks

I also took a further look at normal ship creation and tweaked some things...

- initialize ai mode in ai_object_init
- remove redundant assigment of ship name from parse_object_create_sub (it's also done in ship_create)
- remove redundant goal clearing from parse_object_create_sub (it's also done in ai_clear_ship_goals via ship_create)
- avoid overwriting the initial ai mode if the fix-ai-class-bug flag is set
- make the code slightly more efficient by not redundantly setting flags while searching for subsystems
2019-01-27 22:13:14 -05:00
MageKing17 f8da2cdc83 Merge pull request #1979 from MageKing17/bugfix/lua-control-info-player-nullptr-checks
Add checks for Player being nullptr to l_Control_Info.
2019-01-23 06:36:50 -08:00
niffiwan b790d6a388 Merge pull request #1978 from MageKing17/bugfix/lua-useButtonControl-command-definition
Use modulo instead of division in Lua useButtonControl() function.
2019-01-23 19:16:50 +10:00
niffiwan a7ba3fa373 Merge pull request #1977 from MageKing17/bugfix/lua-setButtonControlMode-additive-override-swap
Swap back return values for lua setButtonControlMode() function.
2019-01-23 17:55:25 +10:00
niffiwan 6d7c786a38 Merge pull request #1976 from MageKing17/bugfix/special-messages-skip-lookup
Avoid ship name lookup when sending "special" messages.
2019-01-23 17:54:54 +10:00
MageKing17 49d5356043 Add checks for Player being nullptr to l_Control_Info.
If various functions on l_Control_Info were called while Player was nullptr, FSO would CTD due to a null pointer dereference. This commit adds nullptr checks to avoid the problem.
2019-01-22 20:21:28 -08:00
MageKing17 572565c7bc Swap back return values for lua setButtonControlMode() function.
When setting LUA_ADDITIVE_BUTTON_CONTROL, the setButtonControlMode() function (in l_Base) would return "LUA OVERRIDE BUTTON CONTROL", and when setting LUA_OVERRIDE_BUTTON_CONTROL, "LUA ADDITIVE BUTTON CONTROL" would be returned. This commit simply swaps these back so that the appropriate return value is with the corresponding enum value.
2019-01-22 20:19:14 -08:00
MageKing17 c090ee5405 Use modulo instead of division in Lua useButtonControl() function.
When using a string to define the appropriate control in the useButtonControl() function (in l_Control_Info), the command definition was being divided by 32 when the appropriate mathematical operator was modulo; as a result, the only controls that could actually wind up being referenced are these four: TARGET_NEXT, MAX_THROTTLE, END_MISSION, and MULTI_MESSAGE_HOSTILE. By using the modulo operator, the string lookup now appropriately references the relevant button.
2019-01-22 20:15:46 -08:00
MageKing17 5597b56139 Avoid ship name lookup when sending "special" messages.
MESSAGE_SOURCE_SPECIAL indicates messages whose sender starts with "#", indicating that it's not a ship; however, the code was looking up the source as a ship name regardless, and if the message had a persona set, failing to find that ship name would result in the message failing to send. Commit f67596bc5e (a.k.a. SVN revision 5383) was supposed to fix this, however it was checking if q->source was MESSAGE_SOURCE_SPECIAL when q->source was one of the HUD_SOURCE_* #defines (specifically, MESSAGE_SOURCE_SPECIAL resulted in HUD_SOURCE_TERRAN_CMD). It turned out there was an unused HUD_SOURCE_* #define which behaves identically to HUD_SOURCE_TERRAN_CMD, namely HUD_SOURCE_IMPORTANT. By making MESSAGE_SOURCE_SPECIAL use HUD_SOURCE_IMPORTANT and changing the conditional to compare q->source to HUD_SOURCE_IMPORTANT, the intent behind the original fix can be carried out with minimal effort.

This also fixes issue #1706, which is basically the same as the original mantis issue.
2019-01-22 20:06:22 -08:00
MageKing17 c72a062a84 Merge pull request #1975 from asarium/feature/effectsPerSecond
Add support for "Effects per second" feature
2019-01-21 10:53:23 -08:00
asarium 422753976f Add support for "Effects per second" feature
This allows specifying how many times per second an effect should be
triggered for a particle source instead of triggering the effect every
frame. This will allow modders to achieve more consistent particle
effects regardless of FPS.
2019-01-19 13:56:45 +01:00
Goober5000 374383bacb Merge pull request #1973 from Goober5000/more_lenient_subsys_set_random
replace most Errors in sexp.cpp with Warnings
2019-01-17 23:16:37 -05:00
Goober5000 adfce4ec60 replace most Errors in sexp.cpp with Warnings
This is a follow-up to commit 1614384a6a.  `Error` is to be avoided if possible because almost all sexp problems are recoverable, and we don't want to bring the entire game to a halt.

Also add some more information to warnings about sexp operators on strings.
2019-01-17 12:52:17 -05:00
MageKing17 08faf52871 Merge pull request #1962 from asarium/fix/1961
Update internal NanoVG bitmap data buffer when updating texture
2019-01-14 02:43:08 -08:00
MageKing17 d99121cd52 Merge pull request #1970 from Goober5000/per_ship_warp_type_fixes
fix some bugs with the per_ship_warp_type feature
2019-01-14 01:56:47 -08:00
MageKing17 6ff292a43c Merge pull request #1971 from MageKing17/bugfix/dont-repeatedly-set-selection-effect
Don't repeatedly set selection_effect in parse_ship_values().
2019-01-13 23:26:26 -08:00
Goober5000 09f4f63be4 preserve warp params if we are parsing a TBM 2019-01-14 00:53:51 -05:00
MageKing17 2d67fd3ef8 Don't repeatedly set selection_effect in parse_ship_values().
Every time an entry for a ship was parsed (e.g. every time it showed up in a .tbm), the selection effect would be reset to the default. Since it's already set to the default in the ship_info constructor, this was both redundant and would make it extremely difficult to actually use a selection effect other than the default without constantly setting it in every .tbm.
2019-01-13 21:52:24 -08:00
Goober5000 5666eb5014 tweak comment 2019-01-13 23:51:30 -05:00
Goober5000 8542e9e113 fix some bugs with the per_ship_warp_type feature
Since FRED and FS2 load mission data slightly differently, the warp effect loading code had to be slightly reorganized in order for the warp effects to not be based on invalid data.  Additionally, the warp effects had to be initialized a little bit later so that it could accommodate a new set of warp parameters from the parse object.  As a bonnus, this PR also handles warp effects being reassigned in change_ship_class.
2019-01-13 23:40:59 -05:00
Goober5000 699c9e8d52 Merge pull request #1966 from Goober5000/per_ship_warp_type
per-ship warp type
2019-01-12 13:27:43 -05:00
Goober5000 5b45a89287 restore missing caption 2019-01-12 02:36:32 -05:00
Goober5000 741fc311cd fix comment rot 2019-01-12 02:31:09 -05:00
Goober5000 aaa9c779c0 remove spurious newline; word choice 2019-01-12 01:18:14 -05:00
Goober5000 bfae614189 fix bug: only reverse the warp effect when the ship is warping out; and while we're at it, change that parameter to bool 2019-01-12 01:05:19 -05:00
Fabian Woltermann cb956961f6 Merge pull request #1968 from MageKing17/bugfix/replacement-textures-initialization
Remember to initialize Replacement_textures array after allocation.
2019-01-11 19:24:59 +01:00
MageKing17 6d2ebd1ed7 Remember to initialize Replacement_textures array after allocation.
In commit 9e4c6df219 (PR #1265), the model_render_params::set_replacement_textures() override that accepts a vector of texture replacements was added, which includes allocating its own Replacement_textures array. However, unlike its counterpart from missionparse.cpp, this array doesn't then have all of its elements set to -1. Since it works just fine there, I copied that code here so both versions should behave the same.
2019-01-11 05:21:22 -08:00
Goober5000 d7e6187ba8 Merge pull request #1967 from MageKing17/bugfix/glow-texture-assert-data-check
Avoid using Asserts for data security in modelread properties-reading code.
2019-01-11 00:32:12 -05:00
MageKing17 62f6ee86ef Remove redundant length check, remove asserts from ID_FUEL case.
The (length > base_length) conditional was redundant with the other conditions. Additionally, the code from the ID_FUEL case (thruster points) checking for "$engine_subsystem=" was making the exact same mistake, so I made the same changes there.
2019-01-10 17:58:46 -08:00
Goober5000 56ae91c973 maybe it will work now 2019-01-09 16:08:05 -05:00
Goober5000 dfc8cbd1c9 okay this is pretty stupid 2019-01-09 11:01:32 -05:00
Goober5000 77e61af23c add new files to the project 2019-01-09 09:30:47 -05:00
Goober5000 7b80b0c564 minor header reorganization 2019-01-09 01:44:19 -05:00
Goober5000 a98d3bb064 more clang complaints 2019-01-09 00:59:12 -05:00
Goober5000 741ee07249 address warnings 2019-01-09 00:17:20 -05:00
Goober5000 04cefad927 inherit from ship_info warp params instead of resetting to default 2019-01-09 00:00:53 -05:00
Goober5000 3d68476505 remove WD_ prefix 2019-01-08 23:44:09 -05:00
Goober5000 81c63929b5 stage 3: add FRED2 support 2019-01-08 23:03:37 -05:00
Goober5000 d6d03fbb14 format saves using two-decimal floats, and insert missing newlines 2019-01-08 23:03:37 -05:00
Goober5000 9acd25bc28 create a new convenience function 2019-01-08 23:03:37 -05:00
Goober5000 7e00a8b10f stage 2: allow individual ships to also use Warp_params; implement loading and saving 2019-01-08 23:03:36 -05:00
Goober5000 bb0df2dc43 stage 1: replace individual parameters with an index into Warp_params 2019-01-08 23:03:36 -05:00
Goober5000 38f858198b Merge pull request #1964 from Goober5000/warp_direction_enum
create WarpDirection enum
2019-01-08 22:35:38 -05:00
MageKing17 a83307402a Avoid using Asserts for data security in glow texture reading code.
In a Release build, there was absolutely no code making sure that the text "$glow_texture=" was actually present in the properties field of a glow point bank, beyond a simple strlen() check. Even in Debug builds, there was no guarantee that the text was at the start of the properties field; it was just assumed (without even an assertion verifying it). Now, the assertions have been removed and the appropriate conditions are checked in both Release and Debug.
2019-01-08 15:04:42 -08:00
Goober5000 097148c2c2 remove WD_ prefix 2019-01-07 12:01:17 -05:00
Goober5000 fbf8a931c4 fix warning 2019-01-06 22:38:31 -05:00
Goober5000 32d951b27a create WarpDirection enum 2019-01-06 17:33:47 -05:00
Goober5000 630e6c3e96 Merge pull request #1963 from CasparKielwein/enable_wunusedfunction
enable Warnings for unused functions
2019-01-02 00:12:52 -05:00
CasparKielwein 72ed33502b remove unused and undeclared function hatEnumToIdx in joy-sdl 2018-12-31 16:06:37 +01:00
CasparKielwein d3806b2107 remove unused graphics function is_power_of_two. There is a generic one in ddutils. 2018-12-31 16:05:34 +01:00
CasparKielwein c9a481f4f3 wrapped function only used in debug mode in ifndef NDEBUG in ffmeg 2018-12-31 16:03:15 +01:00
CasparKielwein 0a02f677fe remove unused (and undeclared) function get_subsys_bounding_rect in qtfred 2018-12-31 16:03:15 +01:00
CasparKielwein d55e4343f9 enable Warnings for unused functions in gcc and clang toolchain files. 2018-12-31 14:28:25 +01:00
m!m e902934e89 Merge pull request #1958 from CasparKielwein/dead_code_remove_ck5
remove unused functions O to R
2018-12-31 11:54:18 +01:00
m!m 26395f7c12 Merge pull request #1959 from CasparKielwein/dead_code_remove_ck3
Remove unused Code S to Z
2018-12-30 15:08:15 +01:00
asarium de92fe25e3 Update internal NanoVG bitmap data buffer when updating texture
This was causing issues since the new bitmap data was never stored in
the internal buffer FSO uses for getting the image data. Instead, it was
only uploaded to the GPU texture which could be deleted at any time.
This was the case when changing the "3D Hardware Texture" setting which
causes a texture flush.

This fixes #1961.
2018-12-30 14:00:09 +01:00
CasparKielwein c72fa0917b remove unused functions in render code.
Left those functions in 3dmath alone, as it is more of a library.
2018-12-29 16:45:47 +01:00
CasparKielwein bc0f47269d remove unused functions in radar 2018-12-29 16:45:47 +01:00
CasparKielwein 94469dc43f remove unused functions in playerman 2018-12-29 16:45:47 +01:00
CasparKielwein ce335dbcc2 remove unused functions in physics 2018-12-29 16:45:47 +01:00
CasparKielwein 6660d21f7e remove unused and commented out functions in pcxutils. 2018-12-29 16:45:47 +01:00
CasparKielwein e622d81e89 remove unused functions and defines in object/code 2018-12-29 16:45:47 +01:00
CasparKielwein 10c8e16cda remove unused function in nebula code 2018-12-29 16:45:47 +01:00
CasparKielwein 25029bfdf1 remove unused functions and defines in weapon code 2018-12-29 16:41:23 +01:00
CasparKielwein 2255616ed5 remove unused functions in stats 2018-12-29 16:41:23 +01:00
CasparKielwein 62ab705d75 remove unused and not implemented functions in starfield. 2018-12-29 16:41:23 +01:00
CasparKielwein 77fc335580 remove unused functions in ship/shield and afterburner 2018-12-29 16:41:23 +01:00
CasparKielwein 981b01eea2 remove unused functions in ship/shipfx 2018-12-29 16:41:23 +01:00
CasparKielwein 366dc3749c remove unused functions and variables in ship/ship.cpp and .h 2018-12-29 16:41:23 +01:00
CasparKielwein e693367dd0 remove unused functions in sound 2018-12-29 16:41:23 +01:00
m!m da53960003 Merge pull request #1960 from asarium/fix/cppLuaHandlesPointer
Add Lua state destruction event
2018-12-28 18:46:18 +01:00
Goober5000 687c1ba4f7 Merge pull request #1957 from CasparKielwein/dead_code_remove_ck4
remove unused functions I to O
2018-12-28 11:52:24 -05:00
CasparKielwein d901470880 remove unused functions in model/ code. 2018-12-28 10:29:22 +01:00
CasparKielwein 7e74153a3d remove unused functions in mission code.
There where serval relics of prior refactorings like unimplemented functions.
2018-12-28 10:29:22 +01:00
CasparKielwein 6cf75b77dc remove unused functions in localization code. 2018-12-28 10:29:21 +01:00
CasparKielwein 3ec0a9c35e remove unused functions in lighting code. 2018-12-28 10:29:21 +01:00
CasparKielwein 519f60a63b remove unused globals and functions in mouse support io code 2018-12-28 10:29:21 +01:00
CasparKielwein 252da89782 remove unused function in keyboard support io code 2018-12-28 10:29:21 +01:00
CasparKielwein 0f1b3fd6c2 remove unused function in joystick support code. 2018-12-28 10:29:21 +01:00
CasparKielwein 58722425a3 remove unused function in osapi/dialog.cpp 2018-12-28 10:29:21 +01:00
asarium 211110d415 Add Lua state destruction event
This can be used by the various subsystems for cleaning up Lua
references before the Lua state is destroyed. This avoids having
dangling references to the Lua state which would cause segfaults later
on.

The first subsystem to use this is the dynamic SEXP system which had
dangling references due to keeping Lua references to the SEXP functions.

This fixes #1954.
2018-12-27 14:14:34 +01:00
m!m 61a8aa5592 Merge pull request #1956 from CasparKielwein/unused_function_ck2
remove unused Functions D to H
2018-12-27 13:50:52 +01:00
CasparKielwein 0692286bba Remove dead code in hud directory.
Removed a lot of unused functions.
This is mostly a cleanup of a prior refactoring.
There where a lot of unimplemented functions remaining from renaming.
Removed several outcommented parts of code.
2018-12-26 20:40:20 +01:00
CasparKielwein 72dae916a9 remove dead code in gamessnd/eventmusik
remove unused functions.
remove some uncommented code.
remove unused global variables.
2018-12-26 20:40:20 +01:00
CasparKielwein 189ad9f694 remove two unused functions in gamesequence 2018-12-26 20:40:20 +01:00
CasparKielwein b9f9fa0f73 remove unused function in gameplayhelp: gameplay_help_close 2018-12-26 20:40:20 +01:00
CasparKielwein dc7e88c888 remove unused deinfe in fireball.cpp and unused function fireball_render_plane 2018-12-26 20:40:20 +01:00
CasparKielwein b5dae2a56e remove dead code in debugconsole
remove unused functions.
Remove some unused defines and an unused class in console.h
2018-12-26 20:40:20 +01:00
CasparKielwein 969bfd0bdd remove unused functions in debris 2018-12-26 20:40:20 +01:00
m!m 63e8ae53c5 Merge pull request #1953 from plieblang/SupportDontAddPrimaries
AI profile flag for support to not equip new primary
2018-12-26 14:09:54 +01:00
m!m d57aaac8e4 Merge pull request #1952 from CasparKielwein/dead_code_remove_ck
remove unused functions A to C
2018-12-26 14:02:36 +01:00
plieblang ab981bd415 Document why the flag exists 2018-12-22 14:22:58 -08:00
CasparKielwein df7c91f3e7 remove some unused functions in ai code.
There is a lot of dead code left, but my IDE failds on the 15k file.
2018-12-22 20:10:56 +01:00
CasparKielwein ee73694cc8 remove unused functions on anim
Functionality related to pausing animations was not being used anymore.
2018-12-22 20:10:56 +01:00
CasparKielwein 65dcfe0a7c remove unused functions in autopilot 2018-12-22 20:10:56 +01:00
CasparKielwein ae8f8baade remove unused functions in cutscene 2018-12-22 20:10:56 +01:00
CasparKielwein 86fcdb1502 remove unused functions and variables in controlconfig 2018-12-22 20:10:56 +01:00
CasparKielwein b71fc4595c remove unused functions in cmeasures 2018-12-22 20:10:56 +01:00
CasparKielwein 471402ec5d remove unused functions in cfile 2018-12-22 20:10:56 +01:00
CasparKielwein 97fdca6b52 remove unused functions in camera 2018-12-22 20:10:56 +01:00
CasparKielwein b50833e6fb remove unused or unread variables in bmpman.
Global variables, function pointers and fields,
that where either unused or only set and never read.
2018-12-22 20:10:56 +01:00
CasparKielwein 4429cbb21c remove unused functions in bmpman 2018-12-22 20:10:56 +01:00
plieblang 4a6d8573a0 AI profile flag for support to not equip new primary 2018-12-21 13:26:32 -08:00
m!m 2c6039759c Merge pull request #1951 from Goober5000/fix_comment_rot
fix comment rot in speech.h
2018-12-18 17:42:41 +01:00
Goober5000 f3a0d56a85 remove comment that is no longer applicable 2018-12-18 00:07:40 -05:00
Goober5000 243aac1667 Merge pull request #1934 from plieblang/LabLightingSlidersResetView
Set initial slider values to the command line parameters and add functionality to reset view
2018-12-17 23:58:29 -05:00
Goober5000 19fbe05cee Merge pull request #1949 from Goober5000/small_collision_optimization
simple optimization for obj_sort_and_collide
2018-12-17 16:00:50 -05:00
Goober5000 e581a3b8a3 make these variables global 2018-12-16 14:28:47 -05:00
m!m 67a2d99a9b Merge pull request #1950 from asarium/fix/particleEffectParsing
Improve particle parsing code
2018-12-16 19:12:23 +01:00
asarium 569f1ee237 Improve particle parsing code
This makes some general changes to the particle parsing code. It moves
the trail effect option to the end of the options list to remove an
ambiguity in the resulting parsing code. This is done in a backwards
compatible manner so existing tables will not be broken by this.

This also introduces support for specifying single number ranges
without the parentheses to make that easier to use.
2018-12-16 14:23:22 +01:00
Goober5000 e9a8b9d8a2 make vectors static, per discussion on Discord 2018-12-15 16:45:58 -05:00
m!m 0efb98d4a9 Merge pull request #1948 from MageKing17/bugfix/sexp-nonexistent-AI-class
Don't rely on Assert to check for a valid AI class in SEXP code.
2018-12-13 20:10:34 +01:00
MageKing17 ec99bf9c03 Don't rely on Assert to check for a valid AI class in SEXP code.
Bad data can cause the name search to fail, and if change-ai-class was called with an invalid AI class, it could cause later invalid array accesses (using an index of -1).
2018-12-13 07:00:17 -08:00
plieblang bd6ff021fd Hopefully fix compilation bug 2018-12-09 12:14:43 -06:00
MageKing17 69213c3338 Merge pull request #1947 from asarium/fix/audiofile_play_api_fix
Add missing parameters to soundfile:play
2018-12-08 10:09:03 -08:00
asarium 0bffac7615 Add missing parameters to soundfile:play
This was missing from the API code and was uncovered by the new
scripting API changes.
2018-12-08 17:32:49 +01:00
niffiwan ba089bd95e Merge pull request #1945 from asarium/fix/1944
Fix move constructor of streaminganim_h
2018-12-08 16:17:35 +10:00
m!m 0a1519284f Merge pull request #1943 from TheMatthew/fast-path-microoptimization
Add a cache map for shaders in order to accelerate shader lookup
2018-12-07 18:09:08 +01:00
Matthew Khouzam 877a138192 Update gropenglshader.cpp 2018-12-06 22:53:42 -05:00
m!mandTheMatthew 8a34ceef91 Update code/graphics/opengl/gropenglshader.cpp
Co-Authored-By: TheMatthew <[email protected]>
2018-12-06 22:51:35 -05:00
niffiwan d638cacc51 Merge pull request #1932 from Goober5000/fix_warp_clipping
Fix warp clipping
2018-12-07 07:56:33 +10:00
asarium 871317b5bd Fix move constructor of streaminganim_h
The move constructor was written wrongly which caused issues when moving
the value into the Lua memory. This fixes that issue.

This fixes #1944.
2018-12-06 19:53:50 +01:00
m!mandTheMatthew 9b7a87d4c5 Update code/graphics/opengl/gropenglshader.cpp
Co-Authored-By: TheMatthew <[email protected]>
2018-12-03 20:04:30 -05:00
Matthew Khouzam 3b07636a16 Add a cache map for shaders in order to accelerate shader lookup
Shaders lookup in opengl_get_shader_idx performance reduces from
O(n) shader to O(1).

Signed-off-by: Matthew Khouzam <[email protected]>
2018-12-03 20:03:25 -05:00
m!m 8840d238d7 Merge pull request #1942 from TRBlount/lua/WeaponCreatedHook
Add On Weapon Created Hook
2018-12-03 17:58:03 +01:00
TRBlount 95128dd734 Fix Travis Errors 2018-12-02 01:10:22 -07:00
TRBlount 30866afbd6 Add On Weapon Created Hook 2018-12-02 01:10:22 -07:00
plieblang 2b43677c82 Improve UpdateSlider and add help text 2018-12-01 19:18:36 -06:00
Goober5000 94a542a2a3 Merge pull request #1940 from TheMatthew/minor_cleanup
objectsort: remove useless check
2018-11-29 02:02:44 -05:00
Matthew Khouzam 5c064afd95 Update objectsort.cpp 2018-11-28 23:12:55 -05:00
Matthew Khouzam 6ee41c06d8 Update objectsort.cpp 2018-11-28 23:12:34 -05:00
Matthew Khouzam 58fa411ad3 Update objectsort.cpp 2018-11-28 23:11:57 -05:00
Matthew Khouzam 08c2449672 Update objectsort.cpp 2018-11-28 23:11:27 -05:00
Matthew Khouzam 726af82c56 objectsort: remove useless check
if an object is a ship, it is a model. No need
to check twice.
2018-11-28 20:41:45 -05:00
m!m c11dce4a92 Merge pull request #1939 from TheMatthew/clean-fast-path
objectsort: Move nebula detection to common area
2018-11-28 19:11:56 +01:00
Matthew Khouzam 0121eb6123 objectsort: Move nebula detection to common area
Run nebula test once per frame rather than once
per object.

Use a common function to avoid drifting errors.
2018-11-27 23:45:09 -05:00
niffiwan 8a325362f6 Merge pull request #1938 from asarium/fix/optionalScriptingParameters
Check optional scripting parameters before using them
2018-11-27 20:07:29 +10:00
asarium 4eb0e41142 Check optional scripting parameters before using them
These were all cases where the parameter was the new value when setting
a variable. The variables should always be initialized when that code is
reached but it is still better to check the pointers before using them.

These were found by @niffiwan.
2018-11-26 18:50:12 +01:00
Goober5000 5528e4e42d Merge pull request #1933 from Goober5000/multi_sexp_destroy_and_subsys
multi capability for destroy-instantly and destroy-subsys-instantly
2018-11-25 13:41:33 -05:00
Goober5000 968695f851 fix handling of multiplayer packets 2018-11-25 00:27:14 -05:00
Goober5000 8f00c6e842 since we switched from a while-loop to a for-loop, don't repeat the CDR 2018-11-25 00:27:14 -05:00
Goober5000 8a9edb1215 remove error_bypass from new function 2018-11-25 00:27:14 -05:00
Goober5000 1c9e47ad3d address clang-tidy complaints 2018-11-25 00:26:29 -05:00
Goober5000 74fd3c0637 multi capability for destroy-instantly and destroy-subsys-instantly
Previously, these two SEXPs could only be used in single-player; now they can be used in multiplayer.  (This now allows Admiral MS's ship save/load script to work in multiplayer too.)

Inspired by Parias's patch included in the FSPort Co-Op Mod Beta (https://www.hard-light.net/forums/index.php?topic=88385.0) though with some modifications.
2018-11-25 00:26:29 -05:00
Goober5000 fe0f0558c2 Merge pull request #1937 from Goober5000/remove_error_bypass
remove error bypass in subsys functions
2018-11-25 00:20:34 -05:00
Goober5000 11ded47bd5 qtfred too 2018-11-24 14:57:38 -05:00
Goober5000 f8801446db fix function references 2018-11-24 14:11:26 -05:00
Goober5000 7492615a31 remove error_bypass 2018-11-24 14:05:37 -05:00
m!m 53cfc1eae4 Merge pull request #1936 from niffiwan/fix/issue1935
Fixes issue #1935
2018-11-24 09:25:06 +01:00
niffiwan 252facb6c4 Merge pull request #1927 from asarium/fix/decalObjectTypeChanges
Add additional validity check for decals
2018-11-24 10:52:18 +10:00
niffiwan 65417be571 Fixes issue #1935
If the optional arg isn't present; just pass -1 to bm_set_render_target
2018-11-24 09:04:12 +10:00
Goober5000 0da41b3943 address clang-tidy complaint 2018-11-22 16:07:00 -05:00
plieblang 97f9a6c91b Set default lighting to cmdline params and add reset view 2018-11-22 13:40:05 -06:00
m!m 10cd82456d Merge pull request #1914 from Goober5000/small_collision_optimization
only recompute collision pairs if we moved a colliding object
2018-11-21 18:59:08 +01:00
Goober5000 7878ba0d19 only recompute collision pairs if we moved a colliding object
The code already only recomputed collisions if we moved a ship or a wing, but this further optimizes things so that only ships or wings that can collide will cause a recomputation.
2018-11-20 13:54:39 -05:00
Goober5000 a6879a1b40 remove warning 2018-11-20 13:49:50 -05:00
Goober5000 cf7706eb1c might as well add the extents functionality too 2018-11-20 13:49:50 -05:00
Goober5000 09ed127d06 fix typo 2018-11-20 13:49:50 -05:00
Goober5000 77c3c79143 update special-warp-dist 2018-11-20 13:49:50 -05:00
Goober5000 62b74b8743 upgrade position_ship_for_knossos_warpin 2018-11-20 13:49:50 -05:00
Goober5000 4d99a3b8b3 fix determination of dist_to_plane 2018-11-20 13:49:49 -05:00
Goober5000 3a9a840633 forgot one of these 2018-11-20 13:49:49 -05:00
Goober5000 86f67c3c84 warp should be pretty much working correctly now
precalculate warp values before beginning warp, and use them throughout the warp instead of recalculating in every function
standardize on always using the entire docked assembly for length and half-length calculation, instead of some places the assembly and some places just the dock leader
consolidate and simplify the compute_warpout* functions in light of the above
2018-11-20 13:49:49 -05:00
Goober5000 28bb3bf914 rewrite dock_calc_docked_center to find the true physical center of the docked assembly 2018-11-20 13:49:49 -05:00
Goober5000 bd4b116188 this should fix the warpin/warpout distances for regular warpin 2018-11-20 13:49:49 -05:00
Tyler Blount 0a429e8a32 Merge pull request #1931 from asarium/fix/qtAppveyorNightlies
Also fix Appveyor Qt path for nightly builds
2018-11-18 16:59:09 -07:00
asarium f70253e219 Also fix Appveyor Qt path for nightly builds 2018-11-18 19:45:32 +01:00
m!m e901e44418 Merge pull request #1881 from asarium/cleanup/adeSignature
Add proper class support to Lua API
2018-11-18 19:09:45 +01:00
asarium 651268eeea Fix rvalue reference issue in SetHookVar 2018-11-18 12:43:39 +01:00
asarium 9b7c32d0c1 Fix merge issue 2018-11-18 12:43:39 +01:00
asarium d014e53505 Fix clang-tidy issues 2018-11-18 12:43:39 +01:00
asarium 00b0a80ad9 Call scripting handle destructor when Lua collects garbage
This will automatically call the destructor of a type of Lua calls the
garbage collector for an object of that type. This is the last step
towards fully supporting non-trivial objects in the Lua API and all
previous workarounds have been removed.
2018-11-18 12:43:39 +01:00
asarium 4a7109e1d5 Convert scripting value getting to templates
This is pretty much similar to the value setting changes. This is a much
safer solution for getting values out of the scripting system which has
compile time validation for move-only types.
2018-11-18 12:43:39 +01:00
asarium 1484ddbe77 Convert scripting value setting to using placement-new
This commit changes the way the scripting API works by properly using
the newly available type information for moving the FSO resources into
the memory supplied by lua. This has full support for rvalue references
which will make it possible to use move-only types with the scripting
API.

This also makes the API much safer to use since it doesn't use pointers
to local values anymore which made it very hard to use the API in a
different context without causing issues.

This only covers writing the FSO values to Lua. Getting values back is
not covered yet.
2018-11-18 12:43:39 +01:00
asarium 48b03a1789 Remove ADE signature from scripting API
This was previously used for allowing scripts to set arbitrary values on
scripting objects. However, it was used by only a few scripting
functions and, as far as I know, no script uses this features.

This removes that feature which simplifies the code ade_index_handler
of.

This also simplifies the code that handles the userdata for libraries
provided by FSO.
2018-11-18 12:43:39 +01:00
asarium e790cf209a Add additional validity check for decals
This tracks the original object type of a decal and marks a decal as
invalid if the type changes. This should fix a bug reported by Spoon.
2018-11-18 12:41:55 +01:00
Tyler Blount 1eea298fe1 Merge pull request #1929 from TRBlount/fix/lab_insignia
Fix oversights when a mod has zero Insignias
2018-11-13 19:08:43 -07:00
TRBlount 1de63cc881 Make sure having no insignias doesn't trigger asserts and prevent insignias from being rendered 2018-11-13 14:57:22 -07:00
Tyler Blount c7be4734d3 Merge pull request #1930 from asarium/build/appveyorDebug
Fix Appveyor Qt directory
2018-11-13 14:55:19 -07:00
asarium fbc2a2dab2 Fix Appveyor Qt directory
They updated their Qt version and didn't update the documentation page.
This fixes the recent build errors by using the 5.9 symlink which is
linked to the most recent version.
2018-11-13 18:27:02 +01:00
Tyler Blount e5be2372e1 Merge pull request #1928 from TRBlount/fix/share_fire_dir_access
Fix access violation in ship_get_global_turret_gun_info
2018-11-12 21:06:21 -07:00
TRBlount 9c69e11fe5 Add requested changes 2018-11-12 17:56:50 -07:00
TRBlount 0173f44070 Fix access violation in share_fire_direction code path 2018-11-11 16:09:05 -07:00
Fabian Woltermann 45559c13a9 Merge pull request #1912 from asarium/cleanup/noOldCollision
Remove -old_collision command line option
2018-11-10 17:52:17 +01:00
Fabian Woltermann 34888cb1a6 Merge pull request #1923 from asarium/cleanup/speechAPI
Cleanup the speech API code a bit
2018-11-10 17:51:32 +01:00
Fabian Woltermann b77b425f2f Merge pull request #1920 from The-E/feature/lab_camera_controls
Make the lab camera better
2018-11-10 17:40:51 +01:00
Fabian Woltermann 49b5c10295 Addresses feedback, switches default rotation mode to "Both" 2018-11-07 17:13:11 +01:00
niffiwan 0396d5670b Merge pull request #1924 from tomimaki/fix-incomplete-fb-attachment
Fix for incomplete attachment in shadow framebuffer
2018-11-07 07:54:12 +10:00
tomimaki bb6c00a516 Update gropengltnl.cpp 2018-11-06 15:13:59 +01:00
Fabian Woltermann 4d0703ad98 Remove the "disabled" rotation mode 2018-11-04 12:06:00 +01:00
asarium 27e91d8f6c Cleanup the speech API code a bit
This replaces the previously used defines with inline functions which
fixes a few warnings if the macros were ever used. This also changes
fsspeech.cpp so it is compiled always since it has no dependency on the
underlying speech system.
2018-11-03 14:54:29 +01:00
Fabian Woltermann 3c4ab2eef1 Add roll controls 2018-11-03 10:34:17 +01:00
Fabian Woltermann 4e7f29ea88 MORE CI fixes 2018-11-03 10:34:17 +01:00
Fabian Woltermann 793a3d8dd3 Even more CI fixes 2018-11-03 10:34:16 +01:00
Fabian Woltermann 49abb88385 Avoid CI errors 2018-11-03 10:33:06 +01:00
Fabian Woltermann 4c2ed1501e Switch the model rotation controls to a "turntable" model, add constraints, make speed configurable 2018-11-03 10:33:06 +01:00
Fabian Woltermann 6b425c1e6b Merge pull request #1922 from asarium/fix/1921
Fix cubemap offset computation for texture uploads
2018-11-03 10:27:58 +01:00
m!m 978a58dba2 Merge pull request #1917 from plieblang/LabArrowScrolling
Add arrow key scrolling to the lab
2018-11-03 09:07:20 +01:00
plieblang 3de05aefef Fire the item's existing function when selected 2018-11-03 01:21:47 -05:00
asarium da951e8be4 Fix cubemap offset computation for texture uploads
The changes from #1752 changed how the offset was computed but the
cubemap code did not update the initial offset computation to account
for this.

This fixes #1921.
2018-11-02 17:33:16 +01:00
m!m 483a6096bb Merge pull request #1885 from ngld/fix/rocketUI/tooMuchSound
Only play UI sounds if the event is triggered on the element where the property is set.
2018-10-31 19:14:19 +01:00
ngld 0ac810e7f0 Only play UI sounds if the event is triggered on the element where the property is set. 2018-10-31 06:46:27 +01:00
plieblang 0de1e55fb7 CI feedback 2018-10-28 17:25:43 -05:00
plieblang 3827bb9783 Fix nullptr crash and use vectors for *_list_endpoints 2018-10-28 12:59:36 -05:00
plieblang 69013f1d41 Add arrow key scrolling to the lab 2018-10-28 12:31:12 -05:00
m!m 3ac7864ac6 Merge pull request #1752 from asarium/opengl/baseLevelImprovement
Only upload mipmap levels that are actually needed
2018-10-28 18:22:01 +01:00
asarium 35a654660f Only upload mipmap levels that are actually needed
Previously, the game uploaded all mipmap levels found in the image files
and then selected which ones it will use by using GL_TEXTURE_BASE_LEVEL.
This unnecessarily used additional GPU memory which is especially bad if
the player already needs to use a lower detail level. This fixes that by
only uploading the necessary mipmap levels.
2018-10-28 14:57:00 +01:00
Goober5000 f975edd343 Merge pull request #1911 from asarium/feature/noSubsystemSparks
Add option for disabling spark spawning for subsystem
2018-10-27 12:50:50 -04:00
asarium 9219712ff0 Add option for disabling impact debris spawning 2018-10-27 16:37:42 +02:00
plieblang ead6cd9825 Separate ships by species properly 2018-10-26 00:21:08 -05:00
Goober5000 a32c5dad27 Merge pull request #1913 from Goober5000/whack_from_center_of_mass
calculate physics whack from docked center-of-mass, not docked center
2018-10-25 15:42:25 -04:00
plieblang 34d4ed5dba Scroll through ships/weapons with up/down keys 2018-10-25 11:50:16 -05:00
Goober5000 eb012584d6 Merge pull request #1880 from Goober5000/play_dead_persistent
add ai-play-dead-persistent
2018-10-24 14:50:40 -04:00
Goober5000 7cadce113d calculate physics whack from docked center-of-mass, not docked center 2018-10-24 00:17:10 -04:00
asarium 15dc45cc0a Remove -old_collision command line option
The new system has been tested pretty thoroughly so I think it is time
to remove this option.
2018-10-21 18:36:59 +02:00
asarium 3c41b56449 Add option for disabling spark spawning for subsystem
This adds the "no sparks" flag for subsystems which disables the
generation of spark sources for that subsystem when it is hit.

This was requested by Axem.
2018-10-21 18:03:48 +02:00
Goober5000 c667668c17 don't override play-dead goals 2018-09-27 01:33:44 -04:00
Goober5000 8d4643bc7a add ai-play-dead-persistent
This adds a new AI goal which is equivalent to play-dead except that it "sticks".  It doesn't clear the goal list
so it will continue playing dead until the goal is removed or another goal with a higher priority is added.
2018-09-27 00:48:57 -04:00
z64555 ef0381d29f Extends the existing parse pausing system (used by bmpman) to use a bookmark stack. 2017-12-22 03:25:40 -06:00
1840 changed files with 315687 additions and 76234 deletions

No files matched your search

+182
View File
@@ -0,0 +1,182 @@
version: 2
references:
container_config: &container_config
docker:
- image: "debian:stretch"
working_directory: /root/build
restore_repo: &restore_repo
restore_cache:
keys:
- source-repo-{{ .Branch }}-{{ .Revision }}
- source-repo-{{ .Branch }}
- source-repo
cmake_configure: &cmake_configure
run:
name: Creating Build Files
command: |
mkdir build
cd build
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 [[ "$CC" =~ ^clang.*$ ]]; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi
eval $CC --version
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON ..
compile: &compile
run:
name: Compiling Source code
command: |
cd build
ninja -k 20 all
run_tests: &run_tests
run:
name: Run unit tests
command: |
./build/bin/unittests --gtest_shuffle
compile_steps: &compile_steps
steps:
- *restore_repo
- *cmake_configure
- *compile
- *run_tests
jobs:
checkout_code:
<<: *container_config
steps:
- run:
name: Installing Git
command: 'apt-get update && apt-get -yq install git'
- *restore_repo
- checkout
- run:
name: Updating submodules
command: 'git submodule update --init --recursive'
- save_cache:
key: source-repo-{{ .Branch }}-{{ .Revision }}
paths:
- .
build_gcc_lowest_debug:
docker:
- image: asarium/fso_compile:gcc-lowest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Debug
<<: *compile_steps
build_gcc_lowest_release:
docker:
- image: asarium/fso_compile:gcc-lowest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Release
<<: *compile_steps
build_gcc_latest_debug:
docker:
- image: asarium/fso_compile:gcc-latest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Debug
<<: *compile_steps
build_gcc_latest_release:
docker:
- image: asarium/fso_compile:gcc-latest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Release
<<: *compile_steps
build_clang_latest_debug:
docker:
- image: asarium/fso_compile:clang-latest
working_directory: /root/build
environment:
CC: clang-8
CXX: clang++-8
CONFIGURATION: Debug
<<: *compile_steps
build_clang_latest_release:
docker:
- image: asarium/fso_compile:clang-latest
working_directory: /root/build
environment:
CC: clang-8
CXX: clang++-8
CONFIGURATION: Release
<<: *compile_steps
build_clang_lowest_debug:
docker:
- image: asarium/fso_compile:clang-lowest
working_directory: /root/build
environment:
CC: clang
CXX: clang++
CONFIGURATION: Debug
<<: *compile_steps
build_clang_lowest_release:
docker:
- image: asarium/fso_compile:clang-lowest
working_directory: /root/build
environment:
CC: clang
CXX: clang++
CONFIGURATION: Release
<<: *compile_steps
workflows:
version: 2
build_test:
jobs:
- checkout_code
- build_gcc_lowest_debug:
requires:
- checkout_code
- build_gcc_lowest_release:
requires:
- checkout_code
- build_gcc_latest_debug:
requires:
- checkout_code
- build_gcc_latest_release:
requires:
- checkout_code
- build_clang_latest_debug:
requires:
- checkout_code
- build_clang_latest_release:
requires:
- checkout_code
- build_clang_lowest_debug:
requires:
- checkout_code
- build_clang_lowest_release:
requires:
- checkout_code
+22 -17
View File
@@ -1,25 +1,28 @@
---
Language: Cpp
Standard: Cpp11
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignAfterOpenBracket: DontAlign
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowAllArgumentsOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BraceWrapping:
AfterClass: false
AfterControlStatement: false
@@ -47,17 +50,20 @@ Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^(<.*\.(h|hh|hpp)>)$' # Includes of external libraries
Priority: 4
- Regex: '^(<.*>)$' # standard library includes (won't match deprecated C headers)
Priority: 5
- Regex: '^"[^/]*\.(h)"$' # Local includes
- Regex: '^(<.*>)$' # standard library includes (won't match deprecated C headers)
Priority: 6
- Regex: '^"globalincs\/.*\.h"$' # globalincs always come first
Priority: 1
- Regex: '^".*\.(h)"$' # standard engine includes
- Regex: '^"[^/]*\.(h)"$' # Local includes
Priority: 2
- Regex: '.*' # Catch all in case something is unhandled above
- Regex: '^".*\.(h)"$' # standard engine includes
Priority: 3
- Regex: '.*' # Catch all in case something is unhandled above
Priority: 4
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
@@ -92,8 +98,7 @@ SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation
UseTab: ForContinuationAndIndentation
...
+20 -3
View File
@@ -1,16 +1,31 @@
---
Checks: "-*,\
modernize-*,\
-modernize-raw-string-literal,\
-modernize-use-using,\
-modernize-avoid-c-arrays,\
-modernize-make-unique,\
-modernize-raw-string-literal,\
-modernize-use-trailing-return-type,\
-modernize-use-using,\
performance-*,\
-performance-type-promotion-in-math-fn,\
misc-*,\
-misc-macro-parentheses,\
-misc-misplaced-widening-cast,\
-misc-non-private-member-variables-in-classes,\
-misc-static-assert,\
-modernize-make-unique,\
-misc-unused-parameters,\
readability-*,\
-readability-avoid-const-params-in-decls,\
-readability-else-after-return,\
-readability-function-size,\
-readability-identifier-naming,\
-readability-implicit-bool-conversion,\
-readability-inconsistent-declaration-parameter-name,\
-readability-isolate-declaration,\
-readability-magic-numbers,\
-readability-named-parameter,\
-readability-qualified-auto,\
-readability-uppercase-literal-suffix,\
"
WarningsAsErrors: ''
HeaderFilterRegex: 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$'
@@ -20,5 +35,7 @@ CheckOptions:
value: 'assert,Assert,Assertion'
- key: 'modernize-use-emplace.ContainersWithPushBack'
value: 'std::vector;std::deque;std::list;SCP_vector;SCP_deque;SCP_list'
- key: 'readability-braces-around-statements.ShortStatementLines'
value: '4' # Avoid flagging simple if (...) return false; statements
...
+2
View File
@@ -0,0 +1,2 @@
/build
/.git
+8
View File
@@ -5,3 +5,11 @@ indent_style = tab
[*.sdr]
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[*.sh]
indent_style = space
indent_size = 4
+7
View File
@@ -0,0 +1,7 @@
# Default for everything
# * text=auto
# For the test data and built-in files to make them consistent on all platforms
*.tbl text eol=lf
*.tbm text eol=lf
*.sdr text eol=lf
+14
View File
@@ -0,0 +1,14 @@
cmake/ @asarium
ci/ @asarium @z64555
code/executor/ @asarium
code/scpui/ @asarium
code/scripting/ @asarium
code/controlconfig/ @z64555
code/model/modelanimation*.* @bmagnu
+305
View File
@@ -0,0 +1,305 @@
name: Build Nightly package
on:
push:
tags:
- 'nightly_*'
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [FastDebug, Release]
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
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'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
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: Generate AppImage
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
with:
name: linux-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/install/*.AppImage
linux_zip:
name: Build Linux distribution zip
needs: build_linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: '0'
- name: Download Release builds
uses: actions/download-artifact@v1
with:
name: linux-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: linux-FastDebug
path: builds
- name: Create Distribution package
working-directory: ./builds
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux
- 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
build_windows:
strategy:
matrix:
configuration: [FastDebug, Release]
arch: [Win32, x64]
simd: [SSE2]
name: Windows
runs-on: windows-2019
steps:
- 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.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: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
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" ..
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target INSTALL -- /verbosity:minimal
ls -alR "$(pwd)/install"
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Upload build result
uses: actions/upload-artifact@v2
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:
matrix:
arch: [Win32, x64]
simd: [SSE2]
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: '0'
- name: Download Release builds
uses: actions/download-artifact@v1
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Create Distribution package
working-directory: ./builds
shell: bash
env:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
working-directory: ./builds
shell: bash
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
build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64]
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
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- 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 }}
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 }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Package build result
working-directory: ./build
run: cd bin && tar -cvzf macos-build.tar *.app
- name: Upload build result
uses: actions/upload-artifact@v2
with:
name: mac-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/bin/macos-build.tar
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v2
with:
name: mac-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: mac-FastDebug
path: builds
- name: Create Distribution package
working-directory: ./builds
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
+320
View File
@@ -0,0 +1,320 @@
name: Build Release package
on:
push:
tags:
- 'release_*'
env:
QT_VERSION: 5.12.9
jobs:
create_release:
name: Create GitHub release
runs-on: ubuntu-latest
steps:
- 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:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
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 # Don't run this job until create_release is done and successful
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
steps:
- name: Cache Qt
id: cache-qt-lin
uses: actions/cache@v1
# cache the Qt directory so we don't have to reinstall it every time
# cache.inputs:
# path - A list of files, directories, and wildcard patterns to cache and restore. See @actions/glob for supported patterns.
# key - An explicit key for restoring and saving the cache
# restore-keys - An ordered list of keys to use for restoring the cache if no cache hit occurred for key
# cache.outputs:
# cache-hit true when an exact match was found for the key, false otherwise.
with:
path: ${{ github.workspace }}/../Qt
key: ${{ runner.os }}-QtCache-${{ env.QT_VERSION }}
- name: Install Qt
uses: jurplel/install-qt-action@v2
# installs Qt in the action workflow
# install-qt-action.inputs:
# version desired qt version to install
# host Host platform of Qt, default to platform used by runs-on
# target target platform of Qt, default to desktop
# arch target architecture of Qt, only used for windows or android builds
# dir root dir Qt will be installed to
# install-deps if true, auto-install dependencies on linux. Default true
# modules whitespace delimited list string of additional addon modules to install
# archives whitespace delimited list string of Qt archives to install
# cached if true, Don't download Qt but set ENVARs; use with cache.outputs.cache-hit
# setup-python Set to false to skip using setup-python to find/download a valid python version
# set-env if true, set ENVARs; default = false
# aqtversion version of aqtinstall to use; default = 2.0.0
# py7zrversion version of py7zr to use; default = 0.16.1
# extra additional arguments to pass to aqinstall
# ENVARS set:
# Qt5_DIR / Qt6_DIR
# Qt bin dir appended to PATH
# QT_PLUGIN_PATH, QML2_IMPORT_PATH, PKG_CONFIG_PATH, LD_LIBRARY_PATH
with:
version: ${{ env.QT_VERSION }}
dir: ${{ github.workspace }}/..
cached: ${{ steps.cache-qt-lin.outputs.cache-hit }}
setup-python: 'false'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
# checks-out your repository under $GITHUB_WORKSPACE, so your workflow can access it.
name: Checkout
with:
submodules: true # `true` to checkout submodules, `recursive` to recursively checkout submodules
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: gcc-5
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
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: Generate AppImage
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
# 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
linux_zip:
name: Build Linux distribution zip
needs: build_linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: '0' # value 0 to fetch all history and tags for all branches
- name: Download Release builds
# Grab the release builds
uses: actions/download-artifact@v2
with:
name: linux-Release
path: builds
- name: Download FastDebug builds
# Grab the debug builds
uses: actions/download-artifact@v2
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
# Stash the result to artifact filespace
uses: actions/upload-artifact@v2
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:
files: ${{ steps.generate_package.outputs.package_path }}
build_windows:
strategy:
matrix:
configuration: [FastDebug, Release]
arch: [Win32, x64]
simd: [SSE2, AVX]
needs: create_release
name: Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
# Checkout repo
name: Checkout
with:
submodules: true
- 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: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
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" ..
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target INSTALL -- /verbosity:minimal
ls -alR "$(pwd)/install"
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Upload build result
uses: actions/upload-artifact@v2
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 Release builds
uses: actions/download-artifact@v2
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Create Distribution package
id: generate_package
working-directory: ./builds
shell: bash
env:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
uses: actions/upload-artifact@v2
with:
name: ${{ steps.generate_package.outputs.package_name }}
path: ${{ steps.generate_package.outputs.package_path }}
- name: Upload debug package
uses: actions/upload-artifact@v2
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:
files: |
${{ steps.generate_package.outputs.package_path }}
${{ steps.generate_package.outputs.debug_path }}
post_build:
name: Post builds to Nebula and Forum
needs: [linux_zip, windows_zip]
uses: ./.github/workflows/post-build-release.yaml
with:
linux_result: ${{ needs.linux_zip.result }}
windows_result: ${{ needs.windows_zip.result }}
releaseTag: ${{ github.ref_name }}
+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 }}
+318
View File
@@ -0,0 +1,318 @@
name: Build Test package
on:
push:
branches:
- 'test/*'
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [FastDebug, Release]
name: Linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/linux_build:sha-8a6bbbe
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'
aqtversion: ==1.1.3
- uses: actions/checkout@v1
name: Checkout
with:
submodules: 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: gcc-5
run: $GITHUB_WORKSPACE/ci/linux/configure_cmake.sh
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
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: Generate AppImage
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: $GITHUB_WORKSPACE/ci/linux/generate_appimage.sh $GITHUB_WORKSPACE/build/install
- name: Upload build result
uses: actions/upload-artifact@v2
with:
name: linux-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/install/*.AppImage
linux_zip:
name: Build Linux distribution zip
needs: build_linux
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v1
with:
name: linux-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: linux-FastDebug
path: builds
- name: Create Distribution package
working-directory: ./builds
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Linux
- 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
build_windows:
strategy:
matrix:
configuration: [FastDebug, Release]
arch: [Win32, x64]
simd: [SSE2]
name: Windows
runs-on: windows-2019
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: 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: 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: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
ARCHITECTURE: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
shell: bash
run: |
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" ..
- name: Compile
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
shell: bash
run: |
cmake --build . --config "$CONFIGURATION" --target INSTALL -- /verbosity:minimal
ls -alR "$(pwd)/install"
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
shell: bash
run: ./bin/$CONFIGURATION/unittests --gtest_shuffle
- name: Upload build result
uses: actions/upload-artifact@v2
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:
matrix:
arch: [Win32, x64]
simd: [SSE2]
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v1
with:
name: windows-Release-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: windows-FastDebug-${{ matrix.arch }}-${{ matrix.simd }}
path: builds
- name: Create Distribution package
working-directory: ./builds
shell: bash
env:
ARCH: ${{ matrix.arch }}
SIMD: ${{ matrix.simd }}
run: $GITHUB_WORKSPACE/ci/linux/create_dist_pack.sh Windows
- name: Upload result package
working-directory: ./builds
shell: bash
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
build_mac:
strategy:
matrix:
configuration: [FastDebug, Release]
compiler: [clang]
arch: [x86_64]
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
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
fetch-depth: 0
- 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 }}
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 }}
XDG_RUNTIME_DIR: /root
run: $GITHUB_WORKSPACE/ci/linux/run_tests.sh
- name: Package build result
working-directory: ./build
run: cd bin && tar -cvzf macos-build.tar *.app
- name: Upload build result
uses: actions/upload-artifact@v2
with:
name: mac-${{ matrix.configuration }}
path: ${{ github.workspace }}/build/bin/macos-build.tar
mac_zip:
name: Build Mac distribution zip
needs: build_mac
runs-on: ubuntu-latest
container: ghcr.io/scp-fs2open/sftp_upload:sha-748b19d
steps:
- uses: actions/checkout@v2
name: Checkout
with:
submodules: true
fetch-depth: '0'
ref: '${{ github.ref }}'
- name: Download Release builds
uses: actions/download-artifact@v2
with:
name: mac-Release
path: builds
- name: Download FastDebug builds
uses: actions/download-artifact@v2
with:
name: mac-FastDebug
path: builds
- name: Create Distribution package
working-directory: ./builds
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
+62
View File
@@ -0,0 +1,62 @@
name: Build caches for master
on:
push:
branches:
- master
env:
QT_VERSION: 5.12.9
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-5, gcc-10]
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-8a6bbbe
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'
aqtversion: ==1.1.3
- 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 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
+69
View File
@@ -0,0 +1,69 @@
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
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 }}
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
run: |
echo "releaseTag= ${{ env.RELEASE_TAG }}"
echo "repository= ${{ github.repository }}"
python ci/post/main.py release
+219
View File
@@ -0,0 +1,219 @@
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-8a6bbbe
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'
aqtversion: ==1.1.3
- 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 }}
- 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
build_mac:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [clang]
arch: [x86_64]
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
- 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 }}
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
ARCHITECTURE: ${{ matrix.arch }}
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 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
+1
View File
@@ -257,3 +257,4 @@ CMakeSettings.json
# This gets ignored by one of the rules above for some reason...
!/code/scripting/lua/LuaConvert.h
!/code/debugconsole/
!/docker/build
+26 -32
View File
@@ -1,10 +1,11 @@
language: bash
sudo: required
dist: trusty
dist: xenial
cache:
directories:
- $HOME/cmake-3.8
- $HOME/.ccache
- $HOME/curl_cache
addons:
apt:
packages: &global_deps
@@ -17,7 +18,6 @@ addons:
- libjansson-dev
- libsdl2-dev
- libfreetype6-dev
- valgrind
- qt57base
coverity_scan:
project:
@@ -36,13 +36,13 @@ env:
# 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 FS2DOWNLOADS_USER and FS2DOWNLOADS_PASSWORD
- secure: "h6GbMX2jLsW1bS9fCM9fthOSJ1nfQQIRWi6EUH2p8u4NFLD5Bfi/C8JhQPKHUzyo3wvKkSHl+PsW7bgr1oXLusRwAur/dtv2N3imqvtbfIz305b00hZlsvbcYmQmUzQFSAdOGShK57JJ5aKQKccaUBP25KqB7Q+JaqBRdaMBS54="
- secure: "fUDAPAUUaaYZy8I4zU3SJ0JcK7aw4eb6eTdaEr7LyNyTMSfPgwY6P1MrbSQC0lJNQIUQ5ffjdxE5g7D7OYpoJF9L14ni4UY8t2QASt7kmpgcYihmjeuYy8FQXgmFG8CTxiWBPKTybZJ7voQcvIvRaNG7b2wM9PMfc5lRIondB6c="
# 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: "Wdt4Ccefo7a0ZDjEJQJgpghh7n72FtNJuKSAPUvoz4gtEX6Ct9J8yJI1t9V3jE3CTbbLJ21/Q6eZRDfT7UfNJe5DdepoJsP9DeFhKMWqQCq+AChqQWlm0KeZAffJoJreL8vXYhnRYcLT9ceZHEH6AqwN9TPV+xJziGPISAkYNZ8="
secure: "q619+eQTe7lv8UVphK4OIzU8Jw84KBbVkuprN2sWIubRcV3IbZr2+WahJoUMt+nyhiy3YjDYtstO2ZgkxupwnZgwGUBVIiD1c4SPuyy+HTjNMOtiVsEUHT2hf+xPAemWpTlK5HcwhMmHAOh6rt6dEj57QOg0gcmGiwD/tCbEriA="
skip_cleanup: true
file_glob: true
file: "/tmp/builds/*"
@@ -72,33 +72,30 @@ matrix:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Debug" CC=gcc-8 CXX=g++-8
env: CONFIGURATION="Debug" CC=gcc-9 CXX=g++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- g++-8
- g++-9
- *global_deps
- os: linux
env: CONFIGURATION="Debug" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
env: CONFIGURATION="Debug" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- clang-4.0
- clang-tidy-4.0
- libc++-dev
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
@@ -106,7 +103,7 @@ matrix:
env: CONFIGURATION="Debug"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141 CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
@@ -116,47 +113,44 @@ matrix:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Release" CC=gcc-8 CXX=g++-8
env: CONFIGURATION="Release" CC=gcc-9 CXX=g++-9
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- g++-8
- g++-9
- *global_deps
- os: linux
env: CONFIGURATION="Release" CC=clang-4.0 CXX=clang++-4.0
env: CONFIGURATION="Release" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- clang-4.0
- libc++-dev
- 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_xp CMAKE_GENERATOR="Visual Studio 15 2017"
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141 CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
# As long as Windows is still experimental on Travis CI, allow failures
# 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=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
fast_finish: true
-29
View File
@@ -1,29 +0,0 @@
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
Modifications by the FreeSpace Source Code Project (FSSCP)
http://fs2source.warpcore.org
FS2_OPEN STAFF:
Project leader:
Edward "Inquisitor" Gardner
Programmers:
"Bobboau"
Dennis "DTP" Pedersen
Ian "Goober5000" Warfield
Joe "Righteous1" Dowd
Mike "penguin" Harris
"Mysterial"
"PhReAk"
Thomas "Random Tiger" Whittaker
Will "Unknown PLayer" Rousnel
"WMCoolmon"
Web support:
Icefire and the staff at Volitionwatch.com
Alex "Thunder" Avery and the staff at Hard Light Productions
Special thanks to:
Volition for making FS2 such a great game
Dave Baranec for giving us the code and keeping us sanity checked
+41
View File
@@ -0,0 +1,41 @@
## FreeSpace
FreeSpace: The Great War (Released 1998) and FreeSpace 2 (1999) are mission-based space combat simulators, like X-Wing/TIE Fighter and Wing Commander. Among the greatest games of the genre, they were also effectively the last.
The FreeSpace series follows humanity and their Vasudan allies as they fight to withstand the xenocidal, enigmatic Shivans, a species of unknown origin, vast technological capability, and seemingly limitless malice.
## FreeSpace Open
Thanks to Volition's generosity, we've continued development of FreeSpace 2 as FreeSpace Open, building graphical enhancements to bring the original games up to modern standards, telling new stories set in the FreeSpace universe and original worlds, and creating spectacular total conversions that let players fly in the beloved universes of Babylon 5, Battlestar Galactica, Wing Commander, and Star Wars.
## Hard-Light Productions
HLP is a fan community built on love and open-source code. We're dedicated to bringing modders together and giving them a place to share their own hard work and draw inspiration from the work of others. Thanks to Volition's generosity, we've continued development of FreeSpace 2 as FreeSpace Open, building graphical enhancements to bring the original games up to modern standards, telling new stories set in the FreeSpace universe and original worlds, and creating spectacular total conversions that let players fly in the beloved universes of Babylon 5, Battlestar Galactica, Wing Commander, and Star Wars.
Find us at:
- Our [website](http://www.hard-light.net/) and [forums](http://www.hard-light.net/forums/)
- [Discord](https://discord.gg/YNVP3WR)
- [Facebook](https://www.facebook.com/groups/Hardlightproductions/)
- [Youtube](https://www.youtube.com/channel/UCxKkd609hDtY6yNetR1iT4w)
- [Reddit](https://www.reddit.com/r/freespace/)
- [Twitter](https://twitter.com/hardlightpro)
- [IRC](irc://irc.esper.net/hard-light)
## How to get the game
FreeSpace Open requires a retail installation of FreeSpace 2, which is available at the following stores:
- [GOG.com](https://www.gog.com/game/freespace_2)
- [Steam](https://store.steampowered.com/app/273620/Freespace_2/)
After installing retail FS2, use [Knossos](https://fsnebula.org/knossos/) to upgrade to the most recent release of FSO. Knossos is an advanced mod manager and launcher for FSO.
## Improvements
The new open source game engine has several distingushing features including:
- Linux and Mac OS X support
- OpenGL support
- OpenAL audio support
- Easy mod installation
- OGG support
- Hardware transform, clipping, and lighting
## The FreeSpace Upgrade Project
While the SCP improves the code of the game engine to enable new and exciting features, the FreeSpace Upgrade Project (FSU) creates material that takes advantage of the improved game engine.
The FSU improves the ships, effects, and background elements of FreeSpace 2. Every now and then these improvements are released as a pack called MediaVPs. These assorted improvements enhance the graphics of the game.
While the best way to experience the FSU is by playing the game with it, you can watch this [comparison video](https://www.youtube.com/watch?v=RM1YC_gK-qo) between 1999 and 2019 to have an idea of how much more beautiful FSU makes the game.
^(Much of this content was pulled from existing sources, such as InsaneBaron's "What Is Hard Light Productions" [thread](https://www.hard-light.net/forums/index.php?topic=86650.0), the Wiki's [Getting Started article](https://wiki.hard-light.net/index.php/Getting_started) and more.)
+8
View File
@@ -0,0 +1,8 @@
Original source (Freespace 2) by Volition, Inc.; see "`credits.tbl`"
Modifications by the FreeSpace 2 Source Code Project [(FSO SCP)](https://www.hard-light.net/forums/index.php?board=50.0)
[Project Contributors](https://github.com/scp-fs2open/fs2open.github.com/graphs/contributors)
Special thanks to:
Volition for making FS2 such a great game
Dave Baranec for giving us the code and keeping us sanity checked
+30 -5
View File
@@ -8,9 +8,10 @@ if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
endif()
include(cmake/util.cmake)
include(cmake/embed_file.cmake)
# Set a few policies
set_policy(CMP0051 OLD)
set_policy(CMP0051 NEW)
set_policy(CMP0053 NEW)
set_policy(CMP0054 NEW)
@@ -42,10 +43,16 @@ PROJECT(FS2_Open)
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")
message(STATUS "Using ccache for compilation: ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}")
# Enable ccache on Mac even for clang
if(CCACHE_PROGRAM AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR APPLE))
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()
endif()
IF(CMAKE_CROSSCOMPILING)
@@ -117,6 +124,14 @@ option(FSO_INSTALL_DEBUG_FILES "Install some debug files (currently only PDB fil
option(ENABLE_COTIRE "Enable cotire for faster compilation. Enabled by default." ON)
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_VULKAN "Enable compilation of the Vulkan renderer" ON)
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
@@ -125,6 +140,10 @@ MARK_AS_ADVANCED(FORCE FSO_DEVELOPMENT_MODE)
MARK_AS_ADVANCED(FORCE FSO_FATAL_WARNINGS)
mark_as_advanced(FORCE FSO_INSTALL_DEBUG_FILES)
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_VULKAN)
# Include cotire file from https://github.com/sakra/cotire/
include(cotire)
@@ -151,6 +170,8 @@ ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(parsers)
ADD_SUBDIRECTORY(code)
ADD_SUBDIRECTORY(freespace2)
@@ -197,3 +218,7 @@ ENDIF()
message(STATUS "Building FSO tools: ${FSO_BUILD_TOOLS}")
message(STATUS "Building qtFRED: ${FSO_BUILD_QTFRED}")
message(STATUS "Fatal warnings: ${FSO_FATAL_WARNINGS}")
message(STATUS "Release logging: ${FSO_RELEASE_LOGGING}")
message(STATUS "With FFmpeg: ${FSO_BUILD_WITH_FFMPEG}")
message(STATUS "With OpenGL: ${FSO_BUILD_WITH_OPENGL}")
message(STATUS "With Vulkan: ${FSO_BUILD_WITH_VULKAN}")
-14
View File
@@ -1,14 +0,0 @@
Volition Copyright (applies to original FreeSpace2 source code
developed and released by Volition):
"Copyright (C) Volition, Inc. 1999. All rights reserved.
All source code herein is the property of Volition, Inc. You may not
sell or otherwise commercially exploit the source or things you
created based on the source."
Modifications by members of the FreeSpace Source Code Project are
released under whatever terms the individual authors choose, but the
above notice continues to apply to all fs2_open code.
+566 -19
View File
@@ -1,23 +1,569 @@
# Changelog
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/).
## [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.
### Added
- Full Unicode text support: You can now use non-ASCII characters without having to worry about special fonts and special characters. This is an opt-in mod flag.
- Translation features for making it easier to only distribute one version of a mod which includes all languages.
- OpenAL Soft is included by default in binary distributions of FSO now.
- System for dynamically adding new SEXPs. With this a Lua script can expose functionality to the mission which can be used exactly the same as a standard SEXP with all the usual editing features in FRED.
- Support for displaying decals on the surface of an object.
- Integrated support for the [Discord Rich Presence API](https://discordapp.com/rich-presence).
- New markup based user interface system using [libRocket](https://github.com/libRocket/libRocket).
### Changed
- Exposed the movie player to the scripting API for advanced display features
- Various OpenGL optimizations for better graphics performance:
- Animations now use texture arrays
- Model uniforms get sent to the GPU using uniform buffers for less overhead
- Various other minor changes
- Converted pilot files from custom binary format to JSON
- Replaced Blinn-Phong BRDF with GGX BRDF
### 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.
- Physically-Based Rendering (PBR): This upgrade of our rendering engine allows to use [PBR](https://en.wikipedia.org/wiki/Physically_based_rendering) assets to make models look more realistic and allow more artistic freedom for modders since they have more control over how a model looks. This also added support for HDR lighting which should improve the overall graphics experience.
- Native particle systems: Particles have always been supported by FSO but the effects that could be created by them were very limited. There were some attempts to fix this by using Lua scripting for more advanced features but that suffered from performance issues. With these new particle systems that feature has been integrated directly into the engine which should improve performance and allow for better effects in the future.
- TrueType Font support: [TrueType](https://en.wikipedia.org/wiki/TrueType) fonts improve the text rendering capabilities of FSO by allowing to use freely scaleable font faces instead of the previous bitmap fonts.
### Changed
- We now use SDL2 on all platforms: SDL is a library for abstracting away the differences between different platforms. We now use SDL2 for all platforms which reduces the amount of platform-specific code tremendously and should result in better usability on all platforms. This was a major change that has been in development for several years. Here are a few key features that were added:
- Pilot and configuration data is now stored in the correct location across all platforms (this allows to run FSO on Windows from the Program Files directory without administrator rights)
- All platforms now use the ini files for storing settings. This fixes a lot of issues with the registry on Windows.
- Better support for input devices. Since SDL handles keyboard, mouse and joystick input we now have better support on newer OS versions. Note: This does not mean that we support multiple joysticks (yet). There is ongoing development effort to support this but this release does not have that yet.
- CMake build system generation: This isn't relevant for players but we are now using [CMake](https://en.wikipedia.org/wiki/CMake) for handling compiling our builds. This improves cross-platform support and allows to implement advanced compilation features across multiple platforms. Modders will like the new "FastDebug" builds which are like the previous "Debug" builds but are compiled with all the optimizations of normal Release builds. That should make modding a lot easier since you can now debug your mod with almost the same performance as a Release build.
- Improved shield effects: Rendering of the shields is now handled by special shaders which improves the overall quality of the effects and allows more freedom for future effects.
- Use OpenGL Core Profile for rendering: This is another major graphical upgrade which adds support for the OpenGL Core profile across all platforms (this was also made possible by the SDL2 integration). This upgrade allows us to use more modern rendering techniques and is especially useful for our Linux users who use the open-source Mesa drivers since our shaders failed to compile with those drivers. Now everyone will be able to enjoy the new graphical features added in this and previous releases. This also made some internal changes to how we handle rendering which improves the usability of our rendering engine within our code.
- Use FFmpeg for video & audio decoding: [FFmpeg](https://www.ffmpeg.org/) is a multi-media library which exposes functionality for decoding video and audio files to their raw form so that we can use that data. Thanks to this library we can now play 1080p cutscenes without any stuttering or frame-timing issues. It also allows to use more advanced audio and video codecs such as H.264 for video or Opus for audio.
## [3.7.4] - 2016-07-04 ([Release thread](http://www.hard-light.net/forums/index.php?topic=92181.0))
### Changed
- Major graphics update including deferred lighting and shadows
- Enhanced sound (up to 128 channels)
### 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
- Autospread on model point shields
- WebUI based multiplayer standalone server (for non-Windows platforms)
- Toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the `alter-ship-flag` SEXP
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization!
- `player-is-cheating` SEXP
- New ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the `free-afterburner-use` flag with `alter-ship-flag`)
- Experimental configurations to make AVX builds (see [this post](http://www.hard-light.net/forums/index.php?topic=85566.0) for more explanations)
- Frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders)
### Changed
- Unstretched interface screens
- Automatically non stretched HUD gauges and simpler modder options for placing HUD gauges
- `show-subtitle-text` can now display messages as well as raw text
- Allow a user-specified number of credit images
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state
- Allow the specification of the positions of medals, callsigns and labels on the medal screen.
- The number of medals is now dynamic!
- `is-facing` now works for things that aren't ships (like waypoints!)
- allowing `fade-in` and `fade-out` sexps to use any color, not just black, white and red.
## [3.7.0] - 2013-08-31 ([Release thread](http://www.hard-light.net/forums/index.php?topic=85435.0))
### Major Change
- New Flexible Pilot Save File Code (combines single/multi pilots & allows safe switching between unfinished campaigns)
### Changed
- 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
- Allow modders to set a [mood](http://www.hard-light.net/forums/index.php?topic=81991.msg1639770#msg1639770) for builtin messages and then switch the mood for the mission on the fly using a SEXP
- Allow modders to set the chance of builtin messages being sent, how many will be sent per mission and how long is the delay between two messages
- Allow campaigns to be hidden in the campaign and tech rooms ([Game settings.tbl](https://wiki.hard-light.net/index.php/Game_settings.tbl#.23Ignored_Campaign_File_Names))
- Allow mods to set a default campaign ([Game settings.tbl](https://wiki.hard-light.net/index.php/Game_settings.tbl#.24Default_Campaign_File_Name:))
- New SEXPs
- `set-player-orders`
- `is-event\goal-true\false-msecs-delay`
- `get\set-num-countermeasures`
- `directive-value`
- `invalidate-all-arguments`
- `validate-all-arguments`
- `has-primary-weapon`
- `has-secondary-weapon`
- [`hud-display-gauge`](http://www.hard-light.net/forums/index.php?topic=68837.msg1361711#msg1361711)
- `get-object-speed-x`
- `get-object-speed-y`
- `get-object-speed-z`
### Changed
- Major HUD gauges overhaul
- Split the Locked flag so that you can lock Ships or Weapons on the game loadout screen independently
- Mixed ammo for primary and secondary weapons - [`$Substitute`](http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Substitute:) - Allows you to have a weapon that fires other weapon ammo in a specific pattern (say a Gatling gun with tracers).
- [`show-subtitle`](https://wiki.hard-light.net/index.php/SCP_SEXPs#show-subtitle) SEXP supports custom fonts
- The active support ship limit per side is now dynamic. See [`set-support-ship`](https://wiki.hard-light.net/index.php/SCP_SEXPs#set-support-ship) for more info.
### Fixed
- Various multiplayer SEXP fixes
- `rotating-subsys-set-time` now accelerates properly
- [Fixed a whole heap of memory, logic and coding errors](http://www.hard-light.net/forums/index.php?topic=78044.0) -- using PVS-Studio: C/C++ source code analysis and checking tool
----
## [Older Changes] - Unformatted
```
ChangeLog for fs2_open. All times are UTC.
Features: September 2013
http://www.hard-light.net/forums/index.php?topic=85700.0
- show-subtitle-text can now display messages as well as raw text - Goober5000
- toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the alter-ship-flag sexp - karajorma
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization! - karajorma
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state - karajorma
- added a player-is-cheating sexp - The E
- allow a user-specified number of credit images - Goober5000
- allow the specification of the positions of medals, callsigns and labels on the medal screen. - Goober5000
- lua function to check if a ship is warp capable, and access to a ship's auto-aim FOV - zookeeper
- is-facing now works for things that aren't ships (like waypoints!) - zookeeper
- experimental configurations to make AVX builds (see this post for more explainations) - The E
- new ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the free-afterburner-use flag with alter-ship-flag) - Admiral MS
- the number of medals is now dynamic! - Goober5000
- frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders) - Swifty + The E
- allowing fade-in and fade-out sexps to use any color, not just black, white and red. - Goober5000
==================================================================
( massive gap in updates, maybe this will be filled in someday...)
==================================================================
@@ -351,7 +897,7 @@ http://www.hard-light.net/forums/index.php?topic=85700.0
(2.1.2.4), weapon/weapons.cpp (2.1.2.2):
Sorted out some bits and pieces. The background nebula blends now
which is nice. – RT
which is nice. – RT
2002-09-28 12:20 randomtiger
@@ -1886,3 +2432,4 @@ NOTE:
# generated by cvs2cl.pl
# cvs2cl.pl -r -S --utc -f ChangeLog2
```
+22
View File
@@ -0,0 +1,22 @@
Volition Copyright (applies to original FreeSpace2 source code
developed and released by Volition):
>Copyright (C) Volition, Inc. 1999. All rights reserved.
>
>All source code herein is the property of Volition, Inc. You may not
sell or otherwise commercially exploit the source or things you
created based on the source.
Modifications by members of the FreeSpace Source Code Project are
released under whatever terms the individual authors choose, but the
above notice continues to apply to all fs2_open code.
All modifications made on or after November 1, 2020, shall be released under
the terms within [Unlicense](Unlicense.md). Modifications made before said date are released
under the previous terms with the exception of modifications made by members
of the FreeSpace Source Code Project that opt-in to the terms of Unlicense. Additionally,
a list of contributors who have opted in to the Unlicense terms can be found
in [**Licensing**](https://github.com/scp-fs2open/fs2open.github.com/wiki/Licensing).
See [**Licensing**](https://github.com/scp-fs2open/fs2open.github.com/wiki/Licensing) for more information.
Binary file not shown.
-29
View File
@@ -1,29 +0,0 @@
This is still in pretty rough form.
=== for people building fs2_open:
Win32-MSVC:
Use the Freespace2.dsw workspace and build within the IDE.
Win32-MinGW:
make
Linux and other unix variants (NOT YET COMPLETE)
./configure [options]
make
=== for the project maintainers (people who need to
=== keep the makefiles up to date) and those building
=== from CVS:
./autogen.sh (should only has to be done once)
./configure [options]
make
automake v1.6.1+ and
autoconf v2.54+ are required
+1 -32
View File
@@ -7,36 +7,5 @@ FreeSpace2 *S*ource *C*ode *P*roject
Building
--
Before you do anything, make sure you have updated your git submodules, either by running `git submodule update --init --recursive` or by cloning the repository with the `--recursive` flag.<br/>
<br/>
For building you will need [CMake](http://www.cmake.org/cmake/resources/software.html). Version 3.4 is required. Once you have installed CMake you should create a build directory where the project/make files should be created, **do not create them inside the source tree!**<br>
<br>
On Windows you can use the `cmake-gui` executable to get a nice GUI, on Unix just use `cmake`. Use the newly created directory as build directory (change to this directory on Unix) and run cmake. On Windows this can be done by clicking the `Configure` button. Choose your compiler version and hit `Generate` when configuring is done. <br>
Depending on the makefile generator used build the `all` or `ALL_BUILD` target to compile the project.<br>
### Available variables to control the build
* `FSO_BUILD_WXFRED2`: Build the wxfred2 project, requires wxWidgets
* `FSO_FREESPACE_PATH`: Sets the path of your FreeSpace install, can be used to automatically run the generated executables with the correct working directory, this is an optional variable. By default this will use the value of the `FS2PATH` environment variable.
* `FSO_BUILD_TOOLS`: Build some tools related to FSO
* `CMAKE_BUILD_TYPE`: Sets the binary build type between `Debug` and `Release` (default)
#### Windows only variables
* `FSO_BUILD_FRED2`: Build FRED2, requires a Visual Studio version that ships with MFC
* `FSO_USE_SPEECH`: Build a binary with text-to-speech support
* `FSO_USE_VOICEREC`: Build a binary with voice recognition support
#### Advanced variables
You should only use these variables if you know what you're doing
* `FSO_CMAKE_DEBUG`: Print CMake debugging informations
* `FSO_BUILD_INCLUDED_LIBS`: Build libraries from the included source
* `FSO_USE_OPENALSOFT`: Use [OpenALSoft](http://kcat.strangesoft.net/openal.html) for OpenAL support
* `FSO_USE_LUAJIT`: Use [luajit](http://luajit.org/) as a replacement for lua
* `FSO_DEVELOPMENT_MODE`: Toggles some development behavior, only use if you really need it.
* `FSO_RUN_ARGUMENTS`: If you run an executable from within the project, these arguments will also be passed to the executable
* `FSO_BUILD_POSTFIX`: Sets a postfix to be added to the executable name, may be useful for release candidates.
#### Visual Studio specific variables
* `MSVC_USE_RUNTIME_DLL`: Use the DLL version of the runtime, experimental and not well tested.
* `MSVC_SIMD_INSTRUCTIONS`: The instruction set the executables will be optimized for.
### Generating an installation package
CMake can automatically generate installation packages of the project. To do this you will just need to run the `package` target of the build system and the package will be placed inside your build directory. On Windows you will have to install [NSIS](http://nsis.sourceforge.net/Main_Page) to use this.
The main instructions for building can be found at our github wiki, on the [Building](https://github.com/scp-fs2open/fs2open.github.com/wiki/Building) page.
+24
View File
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
For more information, please refer to [**Unlicense**](https://unlicense.org).
+18
View File
@@ -0,0 +1,18 @@
#Updating Documentation
####The goal of this file is simply to offer a comprehensive checklist of things we must check when updating the documentation.
1. Changelog:
- Is [Changelog.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Changelog.md) up-to-date with the latest release?
- Is it in the proper [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) format?
2. Build instructions:
- If a programmer who never built FSO before read the build instruction at [Readme.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Readme.md), would they manage to build FSO?
- Is the information in the file up-to-date regarding other matters (such as versions of tools mentioned, links to other guides, etc.)?
- Is the information in the [Building](https://github.com/scp-fs2open/fs2open.github.com/wiki/Building) article, and its sub-articles, still up-to-date?
3. Forums:
- Does the [Forum](https://www.hard-light.net/forums/index.php?board=50.0) contain enough clear information to help a new developer find their way into the up-to-date instructions?
- Is there anything that might mislead a new developer to stumble onto old tools, dead links and/or old versions of the project?
4. General documentation files:
- Is the information in the following files up-to-date?
- [About.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/About.md) (Should contain general information about FS, FS2, HLP, FSO and FSU)
- [Authors.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Authors.md) (Should contain information about the original developers, a way to see FSO's contributors, and special thanks to Volition and Dave Baranec)
- [Copying.md](https://github.com/scp-fs2open/fs2open.github.com/blob/master/Copying.md) (Should contain Volition's Copyright terms and a way to check FSO's Licensing info)
+17 -19
View File
@@ -8,12 +8,12 @@ environment:
matrix:
- BuildID: 0
CMAKE_GENERATOR: Visual Studio 14 2015
PlatformToolset: v140_xp
QT_DIR: C:\Qt\5.9.5\msvc2015
PlatformToolset: v140
QT_DIR: C:\Qt\5.9\msvc2015
- BuildID: 1
CMAKE_GENERATOR: Visual Studio 14 2015 Win64
PlatformToolset: v140_xp
QT_DIR: C:\Qt\5.9.5\msvc2015_64
PlatformToolset: v140
QT_DIR: C:\Qt\5.9\msvc2015_64
before_build:
- git submodule update --init --recursive
build_script:
@@ -24,7 +24,7 @@ test_script:
deploy:
- provider: GitHub
auth_token:
secure: 3kV4efHXwRnfXzmJPRAOs8D7+MhwXUXYeayI/P5y114L09kJa6b6L70beXdW7yYr
secure: h55Scpy+3vmo1Yb7WlSIGA4d9DRnsbzUYc2LYsQdByQHZHbqrqjBpicH0D2FFLEO
on:
ReleaseBuild: true # deploy on release push only
@@ -40,25 +40,23 @@ deploy:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: ftp
host: swc.fs2downloads.com
username:
secure: EXg2ADoKzMduZF90ip2Q0g==
protocol: sftp
host: porphyrion.feralhosting.com
username:
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
password:
secure: x0LL0uY9yBAQ7JTARhQ6AA==
folder: swc.fs2downloads.com/builds/nightly/$(VersionName)
beta: true
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: ftp
host: swc.fs2downloads.com
username:
secure: EXg2ADoKzMduZF90ip2Q0g==
protocol: sftp
host: porphyrion.feralhosting.com
username:
secure: 36+bVD8eJgI0BVbi7TZ4zQ==
password:
secure: x0LL0uY9yBAQ7JTARhQ6AA==
folder: swc.fs2downloads.com/builds/test/$(VersionName)
beta: true
secure: CrzmDVca8AGG08iWPA1gOD4Ge06+wJ3rcBagBGclwYQ=
folder: www/datacorder.porphyrion.feralhosting.com/public_html/builds/test/$(VersionName)
on:
TestBuild: true # deploy on test build push only
+53 -49
View File
@@ -9,56 +9,56 @@ class BuildConfig {
}
$NightlyConfigurations = @(
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015_64";
SourcePackage=$false;
},
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\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";
# 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_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015";
SourcePackage=$true;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32-AVX";
Toolset="v140_xp";
SimdType="AVX";
QtDir="C:\Qt\5.9.5\msvc2015";
SourcePackage=$false;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015_64";
SourcePackage=$false;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64-AVX";
Toolset="v140_xp";
SimdType="AVX";
QtDir="C:\Qt\5.9.5\msvc2015_64";
SourcePackage=$false;
}
# [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
@@ -134,6 +134,7 @@ if ($DeployBuild) {
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")
@@ -145,8 +146,11 @@ if ($DeployBuild) {
}
}
7z a "$($PackageName)-builds-$($buildConfig.PackageType).zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
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" `
+268
View File
@@ -0,0 +1,268 @@
#!/usr/bin/env python3
#
#===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===#
#
# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#
#===------------------------------------------------------------------------===#
r"""
ClangTidy Diff Checker
======================
This script reads input from a unified diff, runs clang-tidy on all changed
files and outputs clang-tidy warnings in changed lines only. This is useful to
detect clang-tidy regressions in the lines touched by a specific patch.
Example usage for git/svn users:
git diff -U0 HEAD^ | clang-tidy-diff.py -p1
svn diff --diff-cmd=diff -x-U0 | \
clang-tidy-diff.py -fix -checks=-*,modernize-use-override
"""
import argparse
import glob
import json
import multiprocessing
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import traceback
try:
import yaml
except ImportError:
yaml = None
is_py2 = sys.version[0] == '2'
if is_py2:
import Queue as queue
else:
import queue as queue
def run_tidy(task_queue, lock, timeout):
watchdog = None
while True:
command = task_queue.get()
try:
proc = subprocess.Popen(command,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
if timeout is not None:
watchdog = threading.Timer(timeout, proc.kill)
watchdog.start()
stdout, stderr = proc.communicate()
with lock:
sys.stdout.write(stdout.decode('utf-8'))
sys.stdout.flush()
if stderr:
sys.stderr.write(stderr.decode('utf-8'))
sys.stderr.flush()
except Exception as e:
with lock:
sys.stderr.write('Failed: ' + str(e) + ': '.join(command) + '\n')
finally:
with lock:
if (not timeout is None) and (not watchdog is None):
if not watchdog.is_alive():
sys.stderr.write('Terminated by timeout: ' +
' '.join(command) + '\n')
watchdog.cancel()
task_queue.task_done()
def start_workers(max_tasks, tidy_caller, task_queue, lock, timeout):
for _ in range(max_tasks):
t = threading.Thread(target=tidy_caller, args=(task_queue, lock, timeout))
t.daemon = True
t.start()
def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey = "Diagnostics"
merged = []
for replacefile in glob.iglob(os.path.join(tmpdir, '*.yaml')):
content = yaml.safe_load(open(replacefile, 'r'))
if not content:
continue # Skip empty files.
merged.extend(content.get(mergekey, []))
if merged:
# MainSourceFile: The key is required by the definition inside
# include/clang/Tooling/ReplacementsYaml.h, but the value
# is actually never used inside clang-apply-replacements,
# so we set it to '' here.
output = { 'MainSourceFile': '', mergekey: merged }
with open(mergefile, 'w') as out:
yaml.safe_dump(output, out)
else:
# Empty the file:
open(mergefile, 'w').close()
def main():
parser = argparse.ArgumentParser(description=
'Run clang-tidy against changed files, and '
'output diagnostics only for modified '
'lines.')
parser.add_argument('-clang-tidy-binary', metavar='PATH',
default='clang-tidy',
help='path to clang-tidy binary')
parser.add_argument('-p', metavar='NUM', default=0,
help='strip the smallest prefix containing P slashes')
parser.add_argument('-regex', metavar='PATTERN', default=None,
help='custom pattern selecting file paths to check '
'(case sensitive, overrides -iregex)')
parser.add_argument('-iregex', metavar='PATTERN', default=
r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc)',
help='custom pattern selecting file paths to check '
'(case insensitive, overridden by -regex)')
parser.add_argument('-j', type=int, default=1,
help='number of tidy instances to be run in parallel.')
parser.add_argument('-timeout', type=int, default=None,
help='timeout per each file in seconds.')
parser.add_argument('-fix', action='store_true', default=False,
help='apply suggested fixes')
parser.add_argument('-checks',
help='checks filter, when not specified, use clang-tidy '
'default',
default='')
parser.add_argument('-path', dest='build_path',
help='Path used to read a compile command database.')
if yaml:
parser.add_argument('-export-fixes', metavar='FILE', dest='export_fixes',
help='Create a yaml file to store suggested fixes in, '
'which can be applied with clang-apply-replacements.')
parser.add_argument('-extra-arg', dest='extra_arg',
action='append', default=[],
help='Additional argument to append to the compiler '
'command line.')
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
action='append', default=[],
help='Additional argument to prepend to the compiler '
'command line.')
parser.add_argument('-quiet', action='store_true', default=False,
help='Run clang-tidy in quiet mode')
clang_tidy_args = []
argv = sys.argv[1:]
if '--' in argv:
clang_tidy_args.extend(argv[argv.index('--'):])
argv = argv[:argv.index('--')]
args = parser.parse_args(argv)
# Extract changed lines for each file.
filename = None
lines_by_file = {}
for line in sys.stdin:
match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
if match:
filename = match.group(2)
if filename is None:
continue
if args.regex is not None:
if not re.match('^%s$' % args.regex, filename):
continue
else:
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
continue
match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
if match:
start_line = int(match.group(1))
line_count = 1
if match.group(3):
line_count = int(match.group(3))
if line_count == 0:
continue
end_line = start_line + line_count - 1
lines_by_file.setdefault(filename, []).append([start_line, end_line])
if not any(lines_by_file):
print("No relevant changes found.")
sys.exit(0)
max_task_count = args.j
if max_task_count == 0:
max_task_count = multiprocessing.cpu_count()
max_task_count = min(len(lines_by_file), max_task_count)
tmpdir = None
if yaml and args.export_fixes:
tmpdir = tempfile.mkdtemp()
# Tasks for clang-tidy.
task_queue = queue.Queue(max_task_count)
# A lock for console output.
lock = threading.Lock()
# Run a pool of clang-tidy workers.
start_workers(max_task_count, run_tidy, task_queue, lock, args.timeout)
# Form the common args list.
common_clang_tidy_args = []
if args.fix:
common_clang_tidy_args.append('-fix')
if args.checks != '':
common_clang_tidy_args.append('-checks=' + args.checks)
if args.quiet:
common_clang_tidy_args.append('-quiet')
if args.build_path is not None:
common_clang_tidy_args.append('-p=%s' % args.build_path)
for arg in args.extra_arg:
common_clang_tidy_args.append('-extra-arg=%s' % arg)
for arg in args.extra_arg_before:
common_clang_tidy_args.append('-extra-arg-before=%s' % arg)
for name in lines_by_file:
line_filter_json = json.dumps(
[{"name": name, "lines": lines_by_file[name]}],
separators=(',', ':'))
# Run clang-tidy on files containing changes.
command = [args.clang_tidy_binary]
command.append('-line-filter=' + line_filter_json)
if yaml and args.export_fixes:
# Get a temporary file. We immediately close the handle so clang-tidy can
# overwrite it.
(handle, tmp_name) = tempfile.mkstemp(suffix='.yaml', dir=tmpdir)
os.close(handle)
command.append('-export-fixes=' + tmp_name)
command.extend(common_clang_tidy_args)
command.append(name)
command.extend(clang_tidy_args)
task_queue.put(command)
# Wait for all threads to be done.
task_queue.join()
if yaml and args.export_fixes:
print('Writing fixes to ' + args.export_fixes + ' ...')
try:
merge_replacement_files(tmpdir, args.export_fixes)
except:
sys.stderr.write('Error exporting fixes.\n')
traceback.print_exc()
if tmpdir:
shutil.rmtree(tmpdir)
if __name__ == '__main__':
main()
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/env bash
set -e
SCRIPT=$(readlink -f "$0")
HERE=$(dirname "$SCRIPT")
COMMIT_RANGE=$1..$2
if ! git rev-list $COMMIT_RANGE 2>&1 >/dev/null; then
echo "\$COMMIT_RANGE ($COMMIT_RANGE) is not valid for this build (probably caused by a rebase)."
exit 0
fi
# In order to get a proper diff without irrelevant changes, we need to determine where we branched off from the base
# branch
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)|(\/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"
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env bash
if [ "$COMPILER" = "gcc-5" ]; then
export CC=gcc-5
export CXX=g++-5
fi
if [ "$COMPILER" = "gcc-10" ]; then
export CC=gcc-10
export CXX=g++-10
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))
fi
LD_LIBRARY_PATH=$Qt5_DIR/lib:$LD_LIBRARY_PATH
if [ "$RUNNER_OS" = "macOS" ]; then
CXXFLAGS="-mtune=generic -pipe -Wno-unknown-pragmas"
CFLAGS="-mtune=generic -pipe -Wno-unknown-pragmas"
PLATFORM_CMAKE_OPTIONS=""
export CMAKE_OSX_ARCHITECTURES="$ARCHITECTURE"
else
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
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"
fi
mkdir build
cd build
export CXXFLAGS
export CFLAGS
export LD_LIBRARY_PATH
if [ "$RUNNER_OS" = "macOS" ]; then
brew install ninja
fi
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=ON \
-DSHADERS_ENABLE_COMPILATION=ON ..
+36
View File
@@ -0,0 +1,36 @@
#!/usr/bin/env bash
SCRIPT=$(readlink -f "$0")
HERE=$(dirname "$SCRIPT")
OS="$1"
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")"
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")"
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")"
elif [ "$OS" = "Mac" ]; then
tar -cvzf "$(get_package_name)-builds-Mac.tar.gz" *
echo "::set-output name=package_path::$(pwd)/$(get_package_name)-builds-Mac.tar.gz"
echo "::set-output name=package_name::$(get_package_name)-builds-Mac.tar.gz"
echo "::set-output name=package_mime::$(file -b --mime-type "$(pwd)/$(get_package_name)-builds-Mac.tar.gz")"
else
echo "Invalid OS: $OS"
fi
+70
View File
@@ -0,0 +1,70 @@
function get_package_name() {
if git describe --match 'nightly_*' --exact-match 2>/dev/null >/dev/null; then
echo -n "$(git describe --match "nightly_*" --exact-match)"
return
fi
if git describe --match 'release_*' --exact-match 2>/dev/null >/dev/null; then
echo -n "$(git describe --match "release_*" --exact-match | sed 's/release_/fs2_open_/i')"
return
fi
if [[ "$(git branch --show-current)" =~ ^test\/(.*)$ ]]; then
echo -n "test_${BASH_REMATCH[1]}"
return
fi
echo "unknown_config"
}
function get_version_name() {
if git describe --match 'nightly_*' --exact-match 2>/dev/null >/dev/null; then
local tag_name=$(git describe --match "nightly_*" --exact-match)
# Use the bash regex matching for getting the relevant part of the tag name
[[ $tag_name =~ ^nightly_(.*)$ ]]
echo -n "${BASH_REMATCH[1]}"
return
fi
if git describe --match 'release_*' --exact-match 2>/dev/null >/dev/null; then
local tag_name=$(git describe --match "release_*" --exact-match)
# Use the bash regex matching for getting the relevant part of the tag name
[[ $tag_name =~ ^release_(.*)$ ]]
echo -n "${BASH_REMATCH[1]}"
return
fi
if [[ "$(git branch --show-current)" =~ ^test\/(.*)$ ]]; then
echo -n "${BASH_REMATCH[1]}"
return
fi
echo "unknown_config"
}
function upload_files_to_sftp() {
# We need empty glob patterns to "disappear" in the for loop below since this will be run for different configurations
# where it may be possible that some of the file patterns will not be present
shopt -s nullglob
echo "cd $2/" > sftp_batch
echo "mkdir $(get_version_name)" >> sftp_batch
# Create directory but do not cause an error if it already exists
sshpass -e sftp -oBatchMode=no -o "StrictHostKeyChecking no" -b sftp_batch $1 || true
echo "cd $2/$(get_version_name)/" > sftp_batch
for file in *.tar.gz *.7z *.zip; do
echo "put $file" >> sftp_batch
done
echo "bye" >> sftp_batch
sshpass -e sftp -oBatchMode=no -o "StrictHostKeyChecking no" -b sftp_batch $1
rm sftp_batch
}
+14
View File
@@ -0,0 +1,14 @@
#!/usr/bin/env bash
INSTALL_FOLDER=$1
# Install Freespace2 targets
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=$INSTALL_FOLDER -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 $INSTALL_FOLDER/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
appimagetool -n $INSTALL_FOLDER "$INSTALL_FOLDER/$FILENAME"
chmod +x "$INSTALL_FOLDER/$FILENAME"
ls -al $INSTALL_FOLDER
+13
View File
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
SCRIPT=$(readlink -f "$0")
HERE=$(dirname "$SCRIPT")
export LD_LIBRARY_PATH=$(pwd)/bin/lib:$LD_LIBRARY_PATH
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
./bin/unittests --gtest_shuffle
fi
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/env bash
set -e
UPLOAD_TYPE=$1
SCRIPT=$(readlink -f "$0")
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"
SSHPASS=$DATACORDER_SSHPASS upload_files_to_sftp "$DATACORDER_USER@porphyrion.feralhosting.com" "www/datacorder.porphyrion.feralhosting.com/public_html/builds/nightly"
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"
else
echo "Unknown upload type $UPLOAD_TYPE"
exit 1
fi
+163
View File
@@ -0,0 +1,163 @@
{
liblsan Invalid read
Memcheck:Addr8
obj:/usr/lib64/liblsan.so.0.0.0
obj:/usr/lib64/liblsan.so.0.0.0
obj:/usr/lib64/liblsan.so.0.0.0
obj:*
obj:*
obj:*
}
{
Travis memleak
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_signal_error
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
obj:/usr/lib/x86_64-linux-gnu/libmirclient.so.7
fun:call_init.part.0
fun:call_init
fun:_dl_init
fun:dl_open_worker
fun:_dl_catch_error
}
{
CLang Lua unitialized value error
Memcheck:Cond
...
fun:luaH_get
fun:lua_rawget
fun:_ZN12_GLOBAL__N_117ade_index_handlerEP9lua_State
}
{
False-positive uninitialized variable warning
Memcheck:Cond
fun:_Z23cf_check_location_flagsjj
fun:_Z29cf_create_default_path_stringPcjiPKcbj
...
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:_Znwm
obj:*
obj:*
obj:*
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
fun:_Z7gr_initOSt10unique_ptrIN2os18GraphicsOperationsESt14default_deleteIS1_EEiiii
fun:_ZN4test13FSTestFixture5SetUpEv
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
fun:_ZN7testing4Test3RunEv
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:_Znwm
obj:*
obj:*
obj:*
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
fun:_Z7gr_initOSt10unique_ptrIN2os18GraphicsOperationsESt14default_deleteIS1_EEiiii
fun:_ZN4test13FSTestFixture5SetUpEv
fun:_ZN8FontTest5SetUpEv
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_Znwm
obj:*
obj:*
obj:*
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
fun:_Z7gr_initONSt3__110unique_ptrIN2os18GraphicsOperationsENS_14default_deleteIS2_EEEEiiii
fun:_ZN4test13FSTestFixture5SetUpEv
fun:_ZN8FontTest5SetUpEv
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_Znwm
obj:*
obj:*
obj:*
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
fun:_Z7gr_initONSt3__110unique_ptrIN2os18GraphicsOperationsENS_14default_deleteIS2_EEEEiiii
fun:_ZN4test13FSTestFixture5SetUpEv
fun:_ZN8FontTest5SetUpEv
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_Znwm
obj:*
obj:*
obj:*
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
obj:/usr/lib/x86_64-linux-gnu/libSDL2-2.0.so.0.4.0
fun:_Z7gr_initONSt3__110unique_ptrIN2os18GraphicsOperationsENS_14default_deleteIS2_EEEEiiii
fun:_ZN4test13FSTestFixture5SetUpEv
fun:_ZN7testing8internal38HandleSehExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
fun:_ZN7testing8internal35HandleExceptionsInMethodIfSupportedINS_4TestEvEET0_PT_MS4_FS3_vEPKc
}
{
<insert_a_suppression_name_here>
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_signal_error
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
obj:*
obj:*
fun:call_init.part.0
fun:call_init
fun:_dl_init
fun:dl_open_worker
}
{
dlopen leak
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_exception_create
fun:_dl_signal_error
fun:_dl_map_object
fun:dl_open_worker
fun:_dl_catch_exception
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_exception
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
}
+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.text != "OK":
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")
+305
View File
@@ -0,0 +1,305 @@
# 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 sucessfully 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://porphyrion.feralhosting.com/datacorder/builds/{type}/{version}/{file}",
"http://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)
# 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()
+241
View File
@@ -0,0 +1,241 @@
import os.path
import sys
import traceback
import requests
from file_list import ReleaseFile
from util import retry_multi, GLOBAL_TIMEOUT
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': 'linux',
'MacOSX': 'macosx',
'Win32-SSE2': 'windows',
'Win64-SSE2': 'windows',
'Win32-AVX': 'windows',
'Win64-AVX': 'windows'
}
envs = {
'Linux': 'linux && x86_64', # Linux only has 64bit builds
'MacOSX': 'macosx',
'Win32-SSE2': 'windows',
'Win64-SSE2': 'windows && x86_64',
'Win32-AVX': 'windows && avx',
'Win64-AVX': 'windows && avx && x86_64'
}
subdirs = {
'Win32-SSE2': 'x86',
'Win64-SSE2': 'x64',
'Win32-AVX': 'x86_avx',
'Win64-AVX': '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' 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 == 'MacOSX' 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 = {
"x64": True, # All Mac builds are 64-bit
"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]
+68
View File
@@ -0,0 +1,68 @@
<%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. The features listed above 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=97293.0]21.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://www.hard-light.net/forums/index.php?topic=94068.0]Knossos[/url], an integrated solution for downloading and launching mods.
[hidden=Alternative Launchers]
Cross-platform: [url=http://www.hard-light.net/forums/index.php?topic=89162]wxLauncher 0.12.x Test Build[/url] (ongoing project for a unified launcher, you should upgrade to the latest RC/test build if you have not yet)
[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/files/Launcher55g.zip]Launcher 5.5g[/url] ([url=http://scp.indiegames.us/builds/Launcher55g.zip]Mirror[/url]) ([url=http://www.mediafire.com/?wdvzn7hhhzh418m]Mirror[/url]) Not compatible with Windows 8+, use wxLauncher above
OS X: Soulstorm's [url=http://www.hard-light.net/forums/index.php/topic,51391.0.html]OS X Launcher 3.0[/url]
Linux: [url=http://www.hard-light.net/forums/index.php/topic,53206.0.html]YAL[/url] or [url=http://www.hard-light.net/wiki/index.php/Fs2_open_on_Linux/Graphics_Settings]by hand[/url] or whatever you can figure out.[/hidden]
[img]http://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=http://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://www.hard-light.net/forums/index.php?topic=94068.0]Knossos[/url] and it will download the best build specifically for your PC!
[/hidden]
[img]http://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=http://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]http://scp.indiegames.us/img/mac-icon.png[/img] [color=green][size=12pt]OS X[/size][/color]
[b][color=red]Not available[/color][/b] We recently lost access to our Mac CI environment which we usually used for compiling these builds so for the time being, there will be no builds for this OS.
[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=http://www.mediafire.com/download.php?4zw024zrh44etse]TrackIR SCP DLL[/url] ([url=http://scp.fsmods.net/builds/scptrackir.zip]Mirror[/url]) ([url=http://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=http://scp.indiegames.us/mantis/search.php?project_id=1&status_id%5B%5D=10&status_id%5B%5D=20&status_id%5B%5D=30&status_id%5B%5D=40&status_id%5B%5D=50&priority_id%5B%5D=40&priority_id%5B%5D=50&priority_id%5B%5D=60&sticky_issues=on&sortby=last_updated&dir=DESC&per_page=200&hide_status_id=-2]Fix for next release[/url] bugs - mark a bug as an elevated priority (high, urgent, immediate) to get it included in that filter.[/li]
[/list]
+3
View File
@@ -0,0 +1,3 @@
Mako==1.1.5
requests==2.26.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 -2
View File
@@ -3,8 +3,14 @@
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Nothing to do here
:
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
:
-4
View File
@@ -18,10 +18,6 @@ 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"
if [[ "$CC" =~ ^clang.*$ ]]; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
-141
View File
@@ -1,141 +0,0 @@
#!/usr/bin/env python
#
#===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
r"""
ClangTidy Diff Checker
======================
This script reads input from a unified diff, runs clang-tidy on all changed
files and outputs clang-tidy warnings in changed lines only. This is useful to
detect clang-tidy regressions in the lines touched by a specific patch.
Example usage for git/svn users:
git diff -U0 HEAD^ | clang-tidy-diff.py -p1
svn diff --diff-cmd=diff -x-U0 | \
clang-tidy-diff.py -fix -checks=-*,modernize-use-override
"""
import argparse
import json
import re
import subprocess
import sys
def main():
parser = argparse.ArgumentParser(description=
'Run clang-tidy against changed files, and '
'output diagnostics only for modified '
'lines.')
parser.add_argument('-clang-tidy-binary', metavar='PATH',
default='clang-tidy',
help='path to clang-tidy binary')
parser.add_argument('-p', metavar='NUM', default=0,
help='strip the smallest prefix containing P slashes')
parser.add_argument('-regex', metavar='PATTERN', default=None,
help='custom pattern selecting file paths to check '
'(case sensitive, overrides -iregex)')
parser.add_argument('-iregex', metavar='PATTERN', default=
r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc)',
help='custom pattern selecting file paths to check '
'(case insensitive, overridden by -regex)')
parser.add_argument('-fix', action='store_true', default=False,
help='apply suggested fixes')
parser.add_argument('-checks',
help='checks filter, when not specified, use clang-tidy '
'default',
default='')
parser.add_argument('-path', dest='build_path',
help='Path used to read a compile command database.')
parser.add_argument('-extra-arg', dest='extra_arg',
action='append', default=[],
help='Additional argument to append to the compiler '
'command line.')
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
action='append', default=[],
help='Additional argument to prepend to the compiler '
'command line.')
parser.add_argument('-quiet', action='store_true', default=False,
help='Run clang-tidy in quiet mode')
clang_tidy_args = []
argv = sys.argv[1:]
if '--' in argv:
clang_tidy_args.extend(argv[argv.index('--'):])
argv = argv[:argv.index('--')]
args = parser.parse_args(argv)
# Extract changed lines for each file.
filename = None
lines_by_file = {}
for line in sys.stdin:
match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
if match:
filename = match.group(2)
if filename == None:
continue
if args.regex is not None:
if not re.match('^%s$' % args.regex, filename):
continue
else:
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
continue
match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
if match:
start_line = int(match.group(1))
line_count = 1
if match.group(3):
line_count = int(match.group(3))
if line_count == 0:
continue
end_line = start_line + line_count - 1;
lines_by_file.setdefault(filename, []).append([start_line, end_line])
if len(lines_by_file) == 0:
print("No relevant changes found.")
sys.exit(0)
line_filter_json = json.dumps(
[{"name" : name, "lines" : lines_by_file[name]} for name in lines_by_file],
separators = (',', ':'))
quote = "";
if sys.platform == 'win32':
line_filter_json=re.sub(r'"', r'"""', line_filter_json)
else:
quote = "'";
# Run clang-tidy on files containing changes.
command = [args.clang_tidy_binary]
command.append('-line-filter=' + quote + line_filter_json + quote)
if args.fix:
command.append('-fix')
if args.checks != '':
command.append('-checks=' + quote + args.checks + quote)
if args.quiet:
command.append('-quiet')
if args.build_path is not None:
command.append('-p=%s' % args.build_path)
command.extend(lines_by_file.keys())
for arg in args.extra_arg:
command.append('-extra-arg=%s' % arg)
for arg in args.extra_arg_before:
command.append('-extra-arg-before=%s' % arg)
command.extend(clang_tidy_args)
sys.exit(subprocess.call(' '.join(command), shell=True))
if __name__ == '__main__':
main()
-24
View File
@@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
if ! git rev-list $TRAVIS_COMMIT_RANGE 2>1 >/dev/null; then
echo "\$TRAVIS_COMMIT_RANGE ($TRAVIS_COMMIT_RANGE) is not valid for this build (probably caused by a rebase)."
exit 0
fi
cd "$TRAVIS_BUILD_DIR"
echo "Running clang-tidy on changed files"
git diff -U0 --no-color $TRAVIS_COMMIT_RANGE | \
$TRAVIS_BUILD_DIR/ci/travis/clang-tidy-diff.py -path "$TRAVIS_BUILD_DIR/build" -p1 \
-regex 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$|tools/.*' \
-clang-tidy-binary /usr/bin/clang-tidy-4.0 2>/dev/null | \
tee clang-tidy-output.txt
if [[ -n $(grep "warning: " clang-tidy-output.txt) ]] || [[ -n $(grep "error: " clang-tidy-output.txt) ]]; then
echo "Errors or warnings were detected in the clang-tidy output!"
exit 1
else
echo -e "\033[1;32m\xE2\x9C\x93 passed:\033[0m clang-tidy test succeeded";
fi
+57 -22
View File
@@ -10,27 +10,62 @@ if [[ ! "$(curl -V)" == *"sftp"* ]]; then
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# 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
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 curl-*
export DEB_BUILD_OPTIONS="nocheck"
sudo dpkg-buildpackage -uc -us -j"$(grep -c ^processor /proc/cpuinfo)"
cd ..
dpkg -l | grep curl
ls -al
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
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 curl --with-libssh2
export PATH="/usr/local/opt/curl/bin:$PATH"
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
@@ -42,13 +77,13 @@ cd /tmp/builds
for file in *; do
if [ "$TEST_BUILD" = true ]; then
# Upload to fs2downloads
curl -k "ftp://swc.fs2downloads.com/swc.fs2downloads.com/builds/test/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_PASSWORD" -T "$file" --ftp-create-dirs
# 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 fs2downloads
curl -k "ftp://swc.fs2downloads.com/swc.fs2downloads.com/builds/nightly/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_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
+15 -2
View File
@@ -1,9 +1,11 @@
#!/usr/bin/env sh
#!/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/
@@ -11,7 +13,7 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
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
export PATH=$HOME/cmake-3.8/bin:$PATH
cd $HOME
@@ -22,6 +24,17 @@ if [ "$TRAVIS_OS_NAME" = "linux" ]; then
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
+1 -2
View File
@@ -7,7 +7,6 @@ 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
@@ -19,7 +18,7 @@ elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
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"
curl --upload-file build.log.tar.gz "https://keep.sh"
exit $XCODE_RET
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
-43
View File
@@ -1,43 +0,0 @@
{
liblsan Invalid read
Memcheck:Addr8
obj:/usr/lib64/liblsan.so.0.0.0
obj:/usr/lib64/liblsan.so.0.0.0
obj:/usr/lib64/liblsan.so.0.0.0
obj:*
obj:*
obj:*
}
{
Travis memleak
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_signal_error
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
obj:/usr/lib/x86_64-linux-gnu/libmirclient.so.7
fun:call_init.part.0
fun:call_init
fun:_dl_init
fun:dl_open_worker
fun:_dl_catch_error
}
{
CLang Lua unitialized value error
Memcheck:Cond
...
fun:luaH_get
fun:lua_rawget
fun:_ZN12_GLOBAL__N_117ade_index_handlerEP9lua_State
}
{
False-positive uninitialized variable warning
Memcheck:Cond
fun:_Z23cf_check_location_flagsjj
fun:_Z29cf_create_default_path_stringPcjiPKcbj
...
}
+1 -1
View File
@@ -1,4 +1,4 @@
#!/bin/sh
HERE=$(dirname $(readlink -f "${0}"))
export LD_LIBRARY_PATH="${HERE}"/lib:"$LD_LIBRARY_PATH"
"${HERE}"/bin/$<TARGET_FILE_NAME:Freespace2> $@
exec "${HERE}"/bin/$<TARGET_FILE_NAME:Freespace2> $@
-14
View File
@@ -1,17 +1,3 @@
include(WriteCompilerDetectionHeader)
set(CMAKE_CXX_STANDARD_REQUIRED 11)
set(CMAKE_CXX_STANDARD 11)
set(REQUIRED_CXX_FEATURES cxx_rvalue_references cxx_nullptr)
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)
+114
View File
@@ -0,0 +1,114 @@
set(_EMBEDD_FILE_BASE_DIR "${CMAKE_CURRENT_LIST_DIR}")
function(target_embed_files _target)
set(options)
set(oneValueArgs RELATIVE_TO PATH_TYPE_PREFIX)
set(multiValueArgs FILES)
cmake_parse_arguments(EMBED "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if (NOT DEFINED EMBED_RELATIVE_TO)
set(EMBED_RELATIVE_TO "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
if (NOT IS_ABSOLUTE "${EMBED_RELATIVE_TO}")
get_filename_component(EMBED_RELATIVE_TO "${EMBED_RELATIVE_TO}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
endif()
foreach (file ${EMBED_FILES})
get_filename_component(_absoluteFile "${file}" ABSOLUTE BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
file(RELATIVE_PATH _pathType "${EMBED_RELATIVE_TO}" "${_absoluteFile}")
get_filename_component(_pathType ${_pathType} DIRECTORY)
if (DEFINED EMBED_PATH_TYPE_PREFIX)
if (_pathType)
set(_pathType "${EMBED_PATH_TYPE_PREFIX}/${_pathType}")
else()
# Avoid trailing / when we are in the same directory
set(_pathType "${EMBED_PATH_TYPE_PREFIX}")
endif()
endif()
if (NOT _pathType)
# If it is still empty then we need to work around yet another annoying CMake behavior where it ignores
# "empty" property strings
set(_pathType ".")
endif()
set_property(TARGET ${_target} APPEND PROPERTY EMBEDDED_FILES "${_absoluteFile}")
set_property(TARGET ${_target} APPEND PROPERTY EMBEDDED_FILES_BASE_DIR "${EMBED_RELATIVE_TO}")
set_property(TARGET ${_target} APPEND PROPERTY EMBEDDED_FILES_PATH_TYPE "${_pathType}")
endforeach()
endfunction()
function(handle_embedded_files _target)
get_target_property(_filesToEmbed ${_target} EMBEDDED_FILES)
get_target_property(_baseDirs ${_target} EMBEDDED_FILES_BASE_DIR)
get_target_property(_pathTypes ${_target} EMBEDDED_FILES_PATH_TYPE)
SET(DEF_OUT_FILES)
set(INCLUDE_LIST)
set(ARRAY_ELEMENTS)
list(LENGTH _filesToEmbed _numFiles)
FOREACH(i RANGE ${_numFiles})
# Why must CMake always do the unexpected thing? The foreach variant includes the last index as opposed to every
# other sensible language which does not include it...
if (i GREATER_EQUAL _numFiles)
break()
endif()
list(GET _filesToEmbed ${i} _filePath)
list(GET _baseDirs ${i} _baseDir)
list(GET _pathTypes ${i} _pathType)
if (_pathType STREQUAL ".")
# Handle the workaround we had to do for empty path types
set(_pathType "")
endif()
file(RELATIVE_PATH _relativeFilePath "${_baseDir}" "${_filePath}")
SET(_outputBasePath "${CMAKE_CURRENT_BINARY_DIR}/embedded_files/${_relativeFilePath}")
# For some reason this is needed...
get_filename_component(_outputDirectory ${_outputBasePath} DIRECTORY)
file(MAKE_DIRECTORY ${_outputDirectory})
# Retrieve the path type name from the relative path
file(TO_NATIVE_PATH "${_pathType}" _pathType)
if (MINGW)
# There is a bug in CMake where it thinks MinGW uses forward slashes for paths but we need backslashes for Windows builds
string(REPLACE "/" "\\" _pathType "${_pathType}")
endif()
# Properly escape back slashes in strings
string(REPLACE "\\" "\\\\" _pathType "${_pathType}")
get_filename_component(FILE_NAME "${_relativeFilePath}" NAME)
string(MAKE_C_IDENTIFIER "${_relativeFilePath}" FIELD_NAME)
set(HEADER_FILE "${_outputBasePath}.h")
set(SOURCE_FILE "${_outputBasePath}.cpp")
set(ALL_OUTPUTS "${HEADER_FILE}" "${SOURCE_FILE}")
set(FIELD_NAME "Embedded_${FIELD_NAME}")
set(INCLUDE_LIST "${INCLUDE_LIST}\n#include \"${HEADER_FILE}\"")
set(ARRAY_ELEMENTS "${ARRAY_ELEMENTS}\n\t{ \"${_pathType}\", \"${FILE_NAME}\" , ${FIELD_NAME} , ${FIELD_NAME}_size },")
add_custom_command(
OUTPUT ${ALL_OUTPUTS}
COMMAND embedfile "${_filePath}" "${_outputBasePath}" "${FIELD_NAME}"
MAIN_DEPENDENCY "${_filePath}"
COMMENT "Generating string file for ${_filePath}"
)
list(APPEND DEF_OUT_FILES ${ALL_OUTPUTS})
ENDFOREACH()
configure_file("${_EMBEDD_FILE_BASE_DIR}/embedded_files.inc.in" "${CMAKE_CURRENT_BINARY_DIR}/embedded_files/embedded_files.inc")
target_include_directories(${_target} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/embedded_files")
target_sources(${_target} PRIVATE ${DEF_OUT_FILES})
source_group("Generated Files\\Embedded Files" FILES ${DEF_OUT_FILES})
endfunction()
+1 -1
View File
@@ -3,7 +3,7 @@ INCLUDE(util)
MESSAGE(STATUS "Configuring UNIX specific things and stuff...")
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL)
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL _REENTRANT)
# Set RPATH
set(CMAKE_SKIP_BUILD_RPATH TRUE)
+3 -3
View File
@@ -8,7 +8,7 @@ SET(WIN32_LIBS
odbccp32
vfw32
winmm
wsock32
ws2_32
psapi
)
@@ -20,8 +20,8 @@ target_link_libraries(platform INTERFACE ${WIN32_LIBS})
target_compile_definitions(platform INTERFACE WIN32 USE_OPENAL _WINDOWS)
# Specify minimum Windows version for the headers (currently this is XP)
target_compile_definitions(platform INTERFACE NTDDI_VERSION=0x05010000 _WIN32_WINNT=0x0501)
# Specify minimum Windows version for the headers (currently this is Vista)
target_compile_definitions(platform INTERFACE NTDDI_VERSION=0x06000000 _WIN32_WINNT=0x0600)
SET(EXE_GUI_TYPE WIN32)
set(PLATFORM_WINDOWS TRUE CACHE INTERNAL "" FORCE)
+9 -12
View File
@@ -10,8 +10,8 @@ include(CheckSymbolExists)
include(CheckCXXSymbolExists)
include(CheckTypeSize)
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE_CXX("cxxabi.h" HAVE_CXXAPI_H)
CHECK_INCLUDE_FILE("execinfo.h" SCP_HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE_CXX("cxxabi.h" SCP_HAVE_CXXAPI_H)
CHECK_TYPE_SIZE("max_align_t" MAX_ALIGN_T)
@@ -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)
@@ -31,18 +29,17 @@ CHECK_TYPE_SIZE("U'b'" UNICODE_CHAR_LITERAL LANGUAGE CXX)
set(CMAKE_REQUIRED_FLAGS)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
CHECK_FUNCTION_EXISTS(strcasecmp SCP_HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strncasecmp SCP_HAVE_STRNCASECMP)
CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
CHECK_FUNCTION_EXISTS(_stricmp SCP_HAVE__STRICMP)
CHECK_FUNCTION_EXISTS(_strnicmp SCP_HAVE__STRNICMP)
CHECK_FUNCTION_EXISTS(strlwr HAVE_STRLWR)
CHECK_FUNCTION_EXISTS(strlwr SCP_HAVE_STRLWR)
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
CHECK_INCLUDE_FILE("strings.h" SCP_HAVE_STRINGS_H)
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
check_symbol_exists(_snprintf "stdio.h" HAVE__SNPRINTF)
check_symbol_exists(snprintf "stdio.h" SCP_HAVE_SNPRINTF)
set(PLATFORM_CHECK_HEADER "${GENERATED_SOURCE_DIR}/platformChecks.h")
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/platformChecks.h.in "${PLATFORM_CHECK_HEADER}")
+12 -15
View File
@@ -3,29 +3,26 @@
#define __PLATFORM_CHECKS_H__
#pragma once
#cmakedefine HAVE_EXECINFO_H
#cmakedefine HAVE_CXXAPI_H
#cmakedefine HAVE_MAX_ALIGN_T
#cmakedefine HAVE_STD_MAX_ALIGN_T
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE_ARRAY
#cmakedefine SCP_HAVE_EXECINFO_H
#cmakedefine SCP_HAVE_CXXAPI_H
#cmakedefine SCP_HAVE_MAX_ALIGN_T
#cmakedefine SCP_HAVE_STD_MAX_ALIGN_T
#cmakedefine01 IS_64BIT
#cmakedefine01 HAVE_STRCASECMP
#cmakedefine01 HAVE_STRNCASECMP
#cmakedefine01 HAVE__STRICMP
#cmakedefine01 HAVE__STRNICMP
#cmakedefine01 SCP_HAVE_STRCASECMP
#cmakedefine01 SCP_HAVE_STRNCASECMP
#cmakedefine01 SCP_HAVE__STRICMP
#cmakedefine01 SCP_HAVE__STRNICMP
#cmakedefine01 HAVE_STRLWR
#cmakedefine01 SCP_HAVE_STRLWR
#cmakedefine01 HAVE_STRINGS_H
#cmakedefine01 SCP_HAVE_STRINGS_H
#cmakedefine01 HAVE_CHAR32_T
#cmakedefine01 HAVE_UNICODE_CHAR_LITERAL
#cmakedefine01 HAVE_SNPRINTF
#cmakedefine01 HAVE__SNPRINTF
#cmakedefine01 SCP_HAVE_SNPRINTF
#cmakedefine01 SCP_HAVE__SNPRINTF
#endif // __PLATFORM_CHECKS_H__
-2
View File
@@ -9,8 +9,6 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -fsigned-char -Wno-
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
+26 -2
View File
@@ -7,6 +7,8 @@ MESSAGE(STATUS "Doing configuration specific to clang...")
option(CLANG_ENABLE_LEAK_CHECK "Enable -fsanitize=leak" OFF)
option(CLANG_ENABLE_ADDRESS_SANITIZER "Enable -fsanitize=address" OFF)
option(CLANG_USE_LIBCXX "Use libc++" OFF)
# These are the default values
set(C_BASE_FLAGS "-march=native -pipe")
set(CXX_BASE_FLAGS "-march=native -pipe")
@@ -19,6 +21,11 @@ if(DEFINED ENV{CFLAGS})
set(C_BASE_FLAGS $ENV{CFLAGS})
endif()
if (CLANG_USE_LIBCXX)
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -stdlib=libc++")
target_link_libraries(compiler INTERFACE "c++" "c++abi")
endif()
# Initialize with an empty string to make sure we always get a clean start
set(COMPILER_FLAGS "")
@@ -66,8 +73,6 @@ set(COMPILER_FLAGS "${COMPILER_FLAGS} ${SANITIZE_FLAGS}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wformat-security")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-function")
# Dear Clang, please tell us if a function does not return a value since that part of the standard is stupid!
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wreturn-type")
@@ -95,6 +100,14 @@ set(CMAKE_C_FLAGS_DEBUG ${COMPILER_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()
if (SANITIZE_FLAGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}")
endif()
@@ -109,3 +122,14 @@ endif()
# 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)
# GNU ar: Create thin archive files.
# Requires binutils-2.19 or later.
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
target_link_libraries(compiler INTERFACE m)
+44 -10
View File
@@ -8,6 +8,8 @@ MESSAGE(STATUS "Doing configuration specific to gcc...")
option(GCC_ENABLE_LEAK_CHECK "Enable -fsanitize=leak" OFF)
option(GCC_ENABLE_ADDRESS_SANITIZER "Enable -fsanitize=address" OFF)
option(GCC_ENABLE_SANITIZE_UNDEFINED "Enable -fsanitize=undefined" OFF)
option(GCC_USE_GOLD "Use the gold linker instead of the standard linker" OFF)
option(GCC_GENERATE_GDB_INDEX "Adds linker option to generate the gdb index for debug builds" OFF)
# These are the default values
set(C_BASE_FLAGS "-march=native -pipe")
@@ -23,6 +25,21 @@ endif()
# Initialize with an empty string to make sure we always get a clean start
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")
if (GCC_INCREMENTAL_LINKING)
set(LINKER_FLAGS "${LINKER_FLAGS} -fno-use-linker-plugin -Wl,-z,norelro -Wl,--incremental")
endif()
endif()
# This is a slight hack since our flag setup is a bit more complicated
_enable_extra_compiler_warnings_flags()
@@ -30,9 +47,11 @@ set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
# Place each function and data in its own section so the linker can
# perform dead code elimination
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdata-sections -ffunction-sections")
if (NOT GCC_INCREMENTAL_LINKING)
# Place each function and data in its own section so the linker can
# perform dead code elimination
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdata-sections -ffunction-sections")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# Force color diagnostics for Ninja generator
@@ -78,8 +97,6 @@ set(COMPILER_FLAGS "${COMPILER_FLAGS} ${SANITIZE_FLAGS}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wformat-security")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-function")
# Dear GCC, please tell us if a function does not return a value since that part of the standard is stupid!
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wreturn-type")
@@ -100,7 +117,7 @@ set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-but-set-variabl
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# Always use the base flags and add our compiler flags at the bacl
# 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}")
@@ -110,7 +127,7 @@ 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_EXE_LINKER_FLAGS "")
set(CMAKE_EXE_LINKER_FLAGS "${LINKER_FLAGS}")
IF (MINGW)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++ -Wl,--enable-auto-import")
@@ -123,17 +140,25 @@ endif()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g")
if (GCC_GENERATE_GDB_INDEX)
# For pure debug binaries, generate a gdb index for better debugging
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wl,--gdb-index")
endif()
IF(NOT MINGW)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic")
# Allow the linker to perform dead code elimination; this is considered
# experimental for COFF and PE formats and thus disabled for Windows builds
# (https://sourceware.org/binutils/docs/ld/Options.html)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
if (NOT GCC_INCREMENTAL_LINKING AND NOT ${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
endif()
ENDIF(NOT MINGW)
IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-zignore")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-zignore")
ENDIF()
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
@@ -142,3 +167,12 @@ endif()
# 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)
# GNU ar: Create thin archive files.
# Requires binutils-2.19 or later.
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> qcTP <TARGET> <LINK_FLAGS> <OBJECTS>")
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> qTP <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
+7 -7
View File
@@ -37,21 +37,23 @@ set(WARNING_FLAGS
$<$<CONFIG:Release>:/wd4101> # In release mode there are unreferenced variables because debug needs them
/wd4995 # "'vsprintf': name was marked as #pragma deprecated" is being caused by our custom definition of vsprintf. I have no idea what causes this or how to fix it - m!m
/wd4723 # "potential divide by 0" is caused by some code that definitely will not divide by zero - m!m
/wd4121 # "alignment of a member was sensitive to packing" happens in a Windows header - m!m
)
target_compile_options(compiler INTERFACE ${WARNING_FLAGS})
# Base
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /DYNAMICBASE:NO /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
set(CMAKE_STATIC_LINKER_FLAGS "")
# Release
set(CMAKE_C_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_CXX_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO")
set(CMAKE_C_FLAGS_RELEASE "/GL /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_CXX_FLAGS_RELEASE "/GL /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
# /DEBUG:FULL so that we get PDBs which is needed for debugging crashdumps
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO /DEBUG:FULL")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
globally_enable_extra_compiler_warnings()
@@ -63,8 +65,6 @@ if (MSVC_RELEASE_DEBUGGING)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zo")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zo")
endif()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
endif()
IF(MSVC_USE_RUNTIME_DLL)
+3
View File
@@ -17,6 +17,9 @@ ELSE("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
MESSAGE(STATUS "No special handling for this compiler present, good luck!")
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
find_package(Threads REQUIRED)
target_link_libraries(compiler INTERFACE Threads::Threads)
# Copy release settings to FastDebug
set(CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_RELEASE}")
+43 -7
View File
@@ -140,14 +140,34 @@ macro(set_if_not_defined VAR VALUE)
endif()
endmacro(set_if_not_defined)
macro(configure_cotire target)
if(ENABLE_COTIRE)
# Disable unity build as it doesn't work well for us
set_target_properties(${target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
function(set_precompiled_header _target _headerPath)
if (COMMAND target_precompile_headers)
target_compile_definitions(${_target} PRIVATE CMAKE_PCH)
target_precompile_headers(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:${_headerPath}>")
else()
if (ENABLE_COTIRE)
message("${_headerPath}")
set_target_properties(${_target} PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${_headerPath}")
cotire(${target})
# Disable unity build as it doesn't work well for us
set_target_properties(${_target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${_target})
else()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/FI ${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
target_compile_options(${_target} PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${_headerPath}>")
ELSE()
MESSAGE("Unknown compiler for global includes. This will probably break the build.")
ENDIF()
endif()
endif()
endmacro(configure_cotire)
endfunction()
macro(add_target_copy_files)
foreach(file ${ARGN})
@@ -184,7 +204,7 @@ function(detect_simd_instructions _out_var)
endfunction()
function (check_linker_flag _flag _out_var)
SET(CMAKE_REQUIRED_FLAGS "${_flag}")
SET(CMAKE_REQUIRED_LINK_OPTIONS "${_flag}")
CHECK_C_COMPILER_FLAG("" ${_out_var})
endfunction(check_linker_flag)
@@ -198,6 +218,22 @@ function(suppress_warnings _target)
endif()
endfunction(suppress_warnings)
# Suppresses warnings for the specified files
function(suppress_file_warnings)
if (MSVC)
set_source_files_properties(
${ARGN}
PROPERTIES
COMPILE_FLAGS "/W0")
else()
# Assume everything else uses GCC style options
set_source_files_properties(
${ARGN}
PROPERTIES
COMPILE_FLAGS "-w")
endif()
endfunction(suppress_file_warnings)
function(list_target_dependencies _target _out_var)
set(out_list)
+4 -4
View File
@@ -6,9 +6,9 @@ if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
endif()
set_if_not_defined(FSO_VERSION_MAJOR 3)
set_if_not_defined(FSO_VERSION_MINOR 8)
set_if_not_defined(FSO_VERSION_BUILD 1)
set_if_not_defined(FSO_VERSION_MAJOR 22)
set_if_not_defined(FSO_VERSION_MINOR 1)
set_if_not_defined(FSO_VERSION_BUILD 0)
# A numeric revision e.g. the CI build number
set_if_not_defined(FSO_VERSION_REVISION 0)
@@ -49,4 +49,4 @@ IF (NOT "${FSO_BUILD_POSTFIX}" STREQUAL "")
ENDIF()
set(CONFIG_POSTFIX "$<$<CONFIG:Release>:>$<$<CONFIG:Debug>:-DEBUG>$<$<CONFIG:FastDebug>:-FASTDBG>")
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
+46 -22
View File
@@ -1,13 +1,12 @@
include(util)
INCLUDE(source_groups.cmake)
INCLUDE(voice_rec.cmake)
ADD_LIBRARY(code STATIC ${source_files} ${VOICE_REC_FILES})
target_compile_features(code PUBLIC ${REQUIRED_CXX_FEATURES})
INCLUDE(default_files.cmake)
target_compile_features(code PUBLIC cxx_std_11)
if (MSVC)
target_compile_definitions(code PUBLIC "PDB_DEBUGGING=1")
@@ -19,16 +18,21 @@ TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${FREESPACE_HEADERS})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR}/code)
target_link_libraries(code PUBLIC OpenGL)
if (FSO_BUILD_WITH_OPENGL)
target_link_libraries(code PUBLIC OpenGL)
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)
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
if (FSO_BUILD_WITH_FFMPEG)
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
endif()
TARGET_LINK_LIBRARIES(code PUBLIC utfcpp)
@@ -41,6 +45,16 @@ target_link_libraries(code PUBLIC discord-rpc)
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)
enable_clang_tidy(code)
IF (FSO_USE_SPEECH)
@@ -50,6 +64,10 @@ ENDIF(FSO_USE_SPEECH)
TARGET_LINK_LIBRARIES(code PUBLIC jansson)
target_link_libraries(code PUBLIC variant)
target_link_libraries(code PUBLIC any)
# Headers for standalone "gui" on UNIX
IF(UNIX)
TARGET_LINK_LIBRARIES(code PUBLIC ${MONGOOSE_LIBS})
@@ -61,27 +79,33 @@ IF(FSO_BUILD_TOOLS)
ADD_SUBDIRECTORY(cfileextractor)
ENDIF(FSO_BUILD_TOOLS)
if (ENABLE_COTIRE)
set_target_properties(code PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h")
else()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/FI ${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
ELSE()
MESSAGE("Unknown compiler for global includes. This will probably break the build.")
ENDIF()
if (FSO_RELEASE_LOGGING)
target_compile_definitions(code PUBLIC SCP_RELEASE_LOGGING)
endif()
include(util)
configure_cotire(code)
if (FSO_BUILD_WITH_FFMPEG)
target_compile_definitions(code PUBLIC WITH_FFMPEG)
endif()
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)
endif()
include(shaders.cmake)
target_embed_files(code FILES ${default_files_files} RELATIVE_TO "def_files")
handle_embedded_files(code)
set_precompiled_header(code "${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h")
# Ensure that Xcode generates debug symbols on macOS for Debug builds
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES")
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;
int waitTimestamp = 0;
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
Loaded 100 of 1840 files, more files were not shown because too many files have changed in this diff. Show more