Compare commits

...
Author SHA1 Message Date
Tyler Blount 6b7fc0b6a3 Don't reset target restrictions during table load
Prevents an issue with load order causing target restrictions to be reset.
2020-05-20 14:45:24 -06:00
Tyler Blount 2e4bef0d09 Remove unneeded code and some style changes 2020-05-20 12:25:13 -06:00
Tyler Blount 172952cb0f Correctly implement fixes from #73 2020-05-20 12:25:13 -06:00
Tyler Blount 72c27bdbe8 CI and Lock fixes 2020-05-20 12:25:13 -06:00
Tyler Blount bd4de16007 Use correct comparison 2020-05-20 12:25:13 -06:00
Tyler Blount 2e560f2ddb Fix some CI errors 2020-05-20 12:25:12 -06:00
Tyler Blount d35d3d25f8 Finally fix no dumbfire
also some miscellaneous changes
2020-05-20 12:25:12 -06:00
Tyler Blount 2d5111f14b Perhaps this works? 2020-05-20 12:25:12 -06:00
Tyler Blount d95754d6b4 No Dumbfire fix
Another fix for MLMs associated with the No Dumbfire flag.
2020-05-20 12:25:12 -06:00
Tyler Blount 5e3d4c6cfd More fixes
Contains changes related to failed CI builds and feedback.
2020-05-20 12:25:12 -06:00
Tyler Blount deca820c9e Lost fixes
These were lost during a rebase at one point. Will leave this commit as separate to avoid issues in the future.
2020-05-20 12:25:12 -06:00
Swifty 21c298271b Initial commit of multilock missile features. 2020-05-20 12:25:11 -06: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
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
m!m 6ca29a79ba Merge pull request #2400 from asarium/build/clangReadability
Enable sensible clang readability checks
2020-05-19 17:04:29 +02: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
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
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
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
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
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
z64555 ef0381d29f Extends the existing parse pausing system (used by bmpman) to use a bookmark stack. 2017-12-22 03:25:40 -06:00
620 changed files with 133517 additions and 14199 deletions

No files matched your search

+16 -13
View File
@@ -1,25 +1,27 @@
---
Language: Cpp
Standard: Cpp11
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignEscapedNewlines: Left
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowAllArgumentsOnNextLine: false
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
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
@@ -50,15 +52,17 @@ 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
@@ -93,8 +97,7 @@ SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation
UseTab: ForContinuationAndIndentation
...
+17 -1
View File
@@ -4,13 +4,27 @@ modernize-*,\
-modernize-raw-string-literal,\
-modernize-use-using,\
-modernize-make-unique,\
-modernize-use-trailing-return-type,\
-modernize-avoid-c-arrays,\
performance-*,\
-performance-type-promotion-in-math-fn,\
misc-*,\
-misc-macro-parentheses,\
-misc-misplaced-widening-cast,\
-misc-static-assert,\
-modernize-make-unique,\
-misc-unused-parameters,\
-misc-non-private-member-variables-in-classes,\
readability-*,\
-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,\
-readability-else-after-return,\
"
WarningsAsErrors: ''
HeaderFilterRegex: 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$'
@@ -20,5 +34,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
+4
View File
@@ -5,3 +5,7 @@ indent_style = tab
[*.sdr]
indent_style = tab
[*.{yml,yaml}]
indent_style = space
indent_size = 2
+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
+130
View File
@@ -0,0 +1,130 @@
name: Check a pull request
on: [pull_request]
jobs:
build_linux:
strategy:
matrix:
configuration: [Debug, Release]
compiler: [gcc-5, gcc-9, clang-4.0]
name: Linux
runs-on: ubuntu-16.04
steps:
- name: Prepare Environment
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo add-apt-repository ppa:beineri/opt-qt571-xenial
sudo add-apt-repository ppa:msulikowski/valgrind # For fixing a bug with valgrind 3.11 which does not recognize the rdrand instruction
sudo apt-get -yq update
sudo apt-get -yq install cmake ninja-build libopenal-dev libreadline6-dev libpng12-dev libjpeg62-dev liblua5.1-0-dev libjansson-dev libsdl2-dev libfreetype6-dev valgrind qt57base g++-5 g++-9 clang-4.0 clang-tidy-4.0 libc++-dev libc++abi-dev
# Fix a header bug present in ubuntu...
sudo ln -s /usr/include/libcxxabi/__cxxabi_config.h /usr/include/c++/v1/__cxxabi_config.h
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Configure CMake
env:
CONFIGURATION: ${{ matrix.configuration }}
COMPILER: ${{ matrix.compiler }}
run: |
if [ "$COMPILER" = "gcc-5" ]; then
export CC=gcc-5
export CXX=g++-5
fi
if [ "$COMPILER" = "gcc-9" ]; then
export CC=gcc-9
export CXX=g++-9
fi
if [ "$COMPILER" = "clang-4.0" ]; then
export CC=clang-4.0
export CXX=clang++-4.0
fi
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
mkdir build
cd build
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 -DFSO_BUILD_QTFRED=ON ..
- name: Compile
working-directory: ./build
run: ninja -k 20 all
- name: Run Tests
working-directory: ./build
env:
CONFIGURATION: ${{ matrix.configuration }}
run: |
if [ "$CONFIGURATION" = "Debug" ]; then
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$GITHUB_WORKSPACE/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
else
./bin/unittests --gtest_shuffle
fi
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: 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" -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
@@ -0,0 +1,48 @@
name: Publish Standalone docker image
on:
push:
tags:
- '*'
jobs:
build_images:
strategy:
matrix:
configuration: [FastDebug, Release]
include:
- configuration: FastDebug
latest_tag: latest_debug
nightly_tag: nightly_debug
release_tag: release_debug
- configuration: Release
latest_tag: latest
nightly_tag: nightly
release_tag: release
fail-fast: false
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
name: Checkout
with:
submodules: true
- name: Docker login
run: echo ${{ secrets.DOCKER_ACCESSTOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
- name: Docker build
run: docker build --build-arg build_type=${{ matrix.configuration }} -f docker/standalone/Dockerfile -t ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} .
- name: Push latest tag
run: |
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }}
- name: Push nightly tag
if: contains(github.ref, 'refs/tags/nightly_')
run: |
docker tag ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.nightly_tag }}
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.nightly_tag }}
- name: Push release tag
if: contains(github.ref, 'refs/tags/release_')
run: |
docker tag ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.latest_tag }} ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.release_tag }}
docker push ${{ secrets.DOCKER_REPOSITORY }}:${{ matrix.release_tag }}
+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
+45 -26
View File
@@ -1,6 +1,6 @@
language: bash
sudo: required
dist: trusty
dist: xenial
cache:
directories:
- $HOME/cmake-3.8
@@ -18,7 +18,6 @@ addons:
- libjansson-dev
- libsdl2-dev
- libfreetype6-dev
- valgrind
- qt57base
coverity_scan:
project:
@@ -37,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/*"
@@ -73,33 +72,43 @@ 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-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCLANG_USE_LIBCXX=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- llvm-toolchain-xenial-8
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- clang-4.0
- clang-tidy-4.0
- libc++-dev
- libc++abi-dev
- os: linux
env: CONFIGURATION="Debug" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
@@ -117,32 +126,46 @@ 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-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCLANG_USE_LIBCXX=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
- llvm-toolchain-xenial-8
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- clang-4.0
- libc++-dev
- libc++abi-dev
- os: linux
env: CONFIGURATION="Release" CC=clang-9 CXX=clang++-9 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-xenial'
packages:
- *global_deps
- g++-9
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
- os: osx
env: CONFIGURATION="Release"
@@ -150,14 +173,10 @@ matrix:
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141_xp 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
+9 -1
View File
@@ -10,7 +10,7 @@ endif()
include(cmake/util.cmake)
# Set a few policies
set_policy(CMP0051 OLD)
set_policy(CMP0051 NEW)
set_policy(CMP0053 NEW)
set_policy(CMP0054 NEW)
@@ -117,6 +117,10 @@ 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)
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
@@ -125,6 +129,8 @@ 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)
# Include cotire file from https://github.com/sakra/cotire/
include(cotire)
@@ -197,3 +203,5 @@ 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}")
+128 -19
View File
@@ -1,23 +1,131 @@
# 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/).
## [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 +459,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 +1994,4 @@ NOTE:
# generated by cvs2cl.pl
# cvs2cl.pl -r -S --utc -f ChangeLog2
```
+5 -4
View File
@@ -1,14 +1,15 @@
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
>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."
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.
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.
+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)
+13 -15
View File
@@ -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
+5 -1
View File
@@ -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" `
+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"
+226 -99
View File
@@ -2,10 +2,9 @@
#
#===- 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.
# 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
#
#===------------------------------------------------------------------------===#
@@ -25,117 +24,245 @@ Example usage for git/svn users:
"""
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 = 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('--')]
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)
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
# 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
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])
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)
if len(lines_by_file) == 0:
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)
line_filter_json = json.dumps(
[{"name" : name, "lines" : lines_by_file[name]} for name in lines_by_file],
separators = (',', ':'))
tmpdir = None
if yaml and args.export_fixes:
tmpdir = tempfile.mkdtemp()
quote = "";
if sys.platform == 'win32':
line_filter_json=re.sub(r'"', r'"""', line_filter_json)
else:
quote = "'";
# Tasks for clang-tidy.
task_queue = queue.Queue(max_task_count)
# A lock for console output.
lock = threading.Lock()
# 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)
# 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)
sys.exit(subprocess.call(' '.join(command), shell=True))
if __name__ == '__main__':
main()
main()
+2 -2
View File
@@ -12,8 +12,8 @@ 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 | \
-regex '(code|freespace2|qtfred|testsrc|build|tools)\/.*\.(cpp|h)' \
-clang-tidy-binary /usr/bin/clang-tidy-9 -j$(nproc) -quiet 2>/dev/null | \
tee clang-tidy-output.txt
if [[ -n $(grep "warning: " clang-tidy-output.txt) ]] || [[ -n $(grep "error: " clang-tidy-output.txt) ]]; then
+4 -4
View File
@@ -77,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
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
+121
View File
@@ -41,3 +41,124 @@
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
}
{
<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
}
+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> $@
+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)
+1 -1
View File
@@ -8,7 +8,7 @@ SET(WIN32_LIBS
odbccp32
vfw32
winmm
wsock32
ws2_32
psapi
)
+10 -10
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)
@@ -31,18 +31,18 @@ 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)
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}")
+13 -14
View File
@@ -3,29 +3,28 @@
#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 SCP_HAVE_EXECINFO_H
#cmakedefine SCP_HAVE_CXXAPI_H
#cmakedefine SCP_HAVE_MAX_ALIGN_T
#cmakedefine SCP_HAVE_STD_MAX_ALIGN_T
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE_ARRAY
#cmakedefine01 HAVE_STD_IS_TRIVIALLY_COPYABLE
#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__
+10
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,10 @@ if(DEFINED ENV{CFLAGS})
set(C_BASE_FLAGS $ENV{CFLAGS})
endif()
if (CLANG_USE_LIBCXX)
set(CXX_BASE_FLAGS "${CXX_BASE_FLAGS} -stdlib=libc++")
endif()
# Initialize with an empty string to make sure we always get a clean start
set(COMPILER_FLAGS "")
@@ -93,6 +99,10 @@ set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
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()
+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)
+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 20)
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}")
+15 -1
View File
@@ -28,7 +28,9 @@ TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
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 +43,10 @@ target_link_libraries(code PUBLIC discord-rpc)
target_link_libraries(code PUBLIC libRocket)
target_link_libraries(code PUBLIC pcp)
target_link_libraries(code PUBLIC vulkan-hpp)
enable_clang_tidy(code)
IF (FSO_USE_SPEECH)
@@ -77,6 +83,14 @@ else()
ENDIF()
endif()
if (FSO_RELEASE_LOGGING)
target_compile_definitions(code PUBLIC SCP_RELEASE_LOGGING)
endif()
if (FSO_BUILD_WITH_FFMPEG)
target_compile_definitions(code PUBLIC WITH_FFMPEG)
endif()
include(util)
configure_cotire(code)
+15 -13
View File
@@ -18,8 +18,7 @@
#include "ship/ship.h"
int Total_goal_target_names = 0;
char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH];
SCP_vector<char *> Goal_target_names;
ai_info Ai_info[MAX_AI_INFO];
ai_info *Player_ai;
@@ -82,22 +81,25 @@ void set_wingnum(int objnum, int wingnum)
Ai_info[ai_index].wing = wingnum;
}
char *ai_get_goal_target_name(const char *name, int *index)
const char *ai_get_goal_target_name(const char *name, int *index)
{
Assert(name != NULL);
Assert(index != NULL);
int i;
Assertion(name != nullptr && index != nullptr, "Arguments cannot be null!");
for (i=0; i < Total_goal_target_names; i++)
for (int i = 0; i < static_cast<int>(Goal_target_names.size()); ++i) {
if (!stricmp(name, Goal_target_names[i])) {
*index = i;
return Goal_target_names[i];
}
}
Assert(Total_goal_target_names < MAX_GOAL_TARGET_NAMES);
Assertion(strlen(name) <= NAME_LENGTH - 1, "Goal target name %s is too long. Needs to be 31 characters or less.", name);
i = Total_goal_target_names++;
strcpy_s(Goal_target_names[i], name);
*index = i;
return Goal_target_names[i];
*index = static_cast<int>(Goal_target_names.size());
Goal_target_names.push_back(vm_strdup(name));
return Goal_target_names[*index];
}
void ai_clear_goal_target_names()
{
for (auto ptr : Goal_target_names)
vm_free(ptr);
Goal_target_names.clear();
}
+5 -8
View File
@@ -83,7 +83,7 @@ typedef struct ai_goal {
fix time; // time at which this goal was issued.
int priority; // how important is this goal -- number 0 - 100
char *target_name; // name of the thing that this goal acts upon
const char *target_name; // name of the thing that this goal acts upon
int target_name_index; // index of goal_target_name in Goal_target_names[][]
waypoint_list *wp_list; // waypoints that this ship might fly.
int target_instance; // instance of thing this ship might be chasing (currently only used for weapons; note, not the same as objnum!)
@@ -93,19 +93,17 @@ typedef struct ai_goal {
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
// these are the dockpoints used on the docker and dockee ships, not the ships themselves
union {
char *name;
const char *name;
int index;
} docker;
union {
char *name;
const char *name;
int index;
} dockee;
} ai_goal;
#define MAX_GOAL_TARGET_NAMES 100
#define AIM_CHASE 0
#define AIM_EVADE 1
#define AIM_GET_BEHIND 2
@@ -513,8 +511,6 @@ typedef struct {
#define BURST_DURATION 500 // decay time over which Player->damage_this_burst falls from MAX_BURST_DAMAGE to 0
extern int Mission_all_attack; // !0 means all teams attack all teams.
extern int Total_goal_target_names;
extern char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH];
extern void update_ai_info_for_hit(int hitter_obj, int hit_obj);
extern void ai_frame_all(void);
@@ -556,7 +552,8 @@ void ai_process( object * obj, int ai_index, float frametime );
int get_wingnum(int objnum);
void set_wingnum(int objnum, int wingnum);
char *ai_get_goal_target_name(const char *name, int *index);
const char *ai_get_goal_target_name(const char *name, int *index);
void ai_clear_goal_target_names();
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, ship_subsys *ssp, int ship_info_index = -1);
+13 -4
View File
@@ -51,14 +51,19 @@ namespace AI {
};
FLAG_LIST(Maneuver_Override_Flags) {
Full, // Full sexp control
Full_rot, // full sexp control over pitch/bank/heading rotation
Roll, // Sexp forced roll maneuver
Pitch, // Sexp forced pitch change
Heading, // Sexp forced heading change
Full_lat, // full control over up/side/forward movement
Up, // vertical movement
Sideways, // horizontal movement
Forward, // forward movement
Up, // Sexp forced vertical movement
Sideways, // Sexp forced horizontal movement
Forward, // Sexp forced forward movement
Dont_bank_when_turning, // maps to CIF_DONT_BANK_WHEN_TURNING
Dont_clamp_max_velocity, // maps to CIF_DONT_CLAMP_MAX_VELOCITY
Instantaneous_acceleration, // maps to CIF_INSTANTANEOUS_ACCELERATION
Never_expire, // don't clear the maneuver when the timestamp is up
NUM_VALUES
};
@@ -79,13 +84,17 @@ namespace AI {
Assist_scoring_scales_with_damage,
Beams_damage_weapons,
Big_ships_can_attack_beam_turrets_on_untargeted_ships,
Check_comms_for_non_player_ships,
Disable_linked_fire_penalty,
Disable_player_secondary_doublefire,
Disable_ai_secondary_doublefire,
Disable_weapon_damage_scaling,
Dont_insert_random_turret_fire_delay,
Fix_ai_class_bug,
Fix_ai_path_order_bug,
Fix_heat_seeker_stealth_bug,
Fix_linked_primary_bug,
Fix_ramming_stationary_targets_bug,
Force_beam_turret_fov,
Free_afterburner_use,
Glide_decay_requires_thrust,
+28 -6
View File
@@ -7,11 +7,11 @@
#include "globalincs/pstypes.h"
#include "def_files/def_files.h"
#include "ai/ai_profiles.h"
#include "def_files/def_files.h"
#include "globalincs/pstypes.h"
#include "localization/localize.h"
#include "mod_table/mod_table.h"
#include "parse/parselo.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
@@ -371,10 +371,16 @@ void parse_ai_profiles_tbl(const char *filename)
set_flag(profile, "$navigation subsystem governs warpout capability:", AI::Profile_Flags::Navigation_subsys_governs_warp);
set_flag(profile, "$check communications for non-player ships:", AI::Profile_Flags::Check_comms_for_non_player_ships);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AI::Profile_Flags::No_min_dock_speed_cap);
set_flag(profile, "$disable linked fire penalty:", AI::Profile_Flags::Disable_linked_fire_penalty);
set_flag(profile, "$disable player secondary doublefire:", AI::Profile_Flags::Disable_player_secondary_doublefire);
set_flag(profile, "$disable ai secondary doublefire:", AI::Profile_Flags::Disable_ai_secondary_doublefire);
set_flag(profile, "$disable weapon damage scaling:", AI::Profile_Flags::Disable_weapon_damage_scaling);
set_flag(profile, "$use additive weapon velocity:", AI::Profile_Flags::Use_additive_weapon_velocity);
@@ -391,6 +397,8 @@ void parse_ai_profiles_tbl(const char *filename)
set_flag(profile, "$fix linked primary weapon decision bug:", AI::Profile_Flags::Fix_linked_primary_bug);
set_flag(profile, "$fix ramming stationary targets bug:", AI::Profile_Flags::Fix_ramming_stationary_targets_bug);
set_flag(profile, "$prevent turrets targeting too distant bombs:", AI::Profile_Flags::Prevent_targeting_bombs_beyond_range);
set_flag(profile, "$smart subsystem targeting for turrets:", AI::Profile_Flags::Smart_subsystem_targeting_for_turrets);
@@ -517,10 +525,6 @@ void parse_ai_profiles_tbl(const char *filename)
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", (filename) ? filename : "<default ai_profiles.tbl>", e.what()));
return;
}
// add tbl/tbm to multiplayer validation list
extern void fs2netd_add_table_validation(const char *tblname);
fs2netd_add_table_validation(filename);
}
void ai_profiles_init()
@@ -628,4 +632,22 @@ void ai_profile_t::reset()
for (int i = 0; i <= MAX_DETAIL_LEVEL; ++i) {
detail_distance_mult[i] = 0;
}
// via Github #2332, enable bugfixes if we are targeting version 20 and up
if (mod_supports_version(20, 0, 0)) {
flags.set(AI::Profile_Flags::Huge_turret_weapons_ignore_bombs);
flags.set(AI::Profile_Flags::Fix_linked_primary_bug);
flags.set(AI::Profile_Flags::Prevent_targeting_bombs_beyond_range);
flags.set(AI::Profile_Flags::Fix_heat_seeker_stealth_bug);
flags.set(AI::Profile_Flags::Allow_vertical_dodge);
flags.set(AI::Profile_Flags::Fix_ai_class_bug);
flags.set(AI::Profile_Flags::Ai_guards_specific_ship_in_wing);
flags.set(AI::Profile_Flags::Fix_ai_path_order_bug);
flags.set(AI::Profile_Flags::Aspect_invulnerability_fix);
flags.set(AI::Profile_Flags::Use_actual_primary_range);
}
// this flag has been enabled ever since 3.7.2
if (mod_supports_version(3, 7, 2)) {
flags.set(AI::Profile_Flags::Fix_ramming_stationary_targets_bug);
}
}
+148 -104
View File
@@ -58,6 +58,7 @@
#include "physics/physics.h"
#include "playerman/player.h"
#include "render/3d.h"
#include "scripting/api/objs/waypoint.h"
#include "scripting/api/objs/wing.h"
#include "scripting/scripting.h"
#include "ship/afterburner.h"
@@ -65,6 +66,7 @@
#include "ship/ship.h"
#include "ship/shipfx.h"
#include "ship/shiphit.h"
#include "ship/subsysdamage.h"
#include "weapon/beam.h"
#include "weapon/flak.h"
#include "weapon/swarm.h"
@@ -273,7 +275,7 @@ typedef struct {
int team;
int weapon_index;
int max_fire_count;
char *shipname;
const char *shipname;
} huge_fire_info;
SCP_vector<huge_fire_info> Ai_huge_fire_info;
@@ -1314,7 +1316,9 @@ ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int pare
}
if ( aip == Player_ai ) {
hud_lock_reset(0.5f);
if (aip->last_subsys_target != aip->targeted_subsys) {
hud_lock_reset(0.5f);
}
}
} else {
@@ -4592,8 +4596,9 @@ void ai_waypoints()
// adds scripting hook for 'On Waypoints Done' --wookieejedi
Script_system.SetHookObject("Ship", &Objects[Ships[Pl_objp->instance].objnum]);
Script_system.SetHookVar("Wing", 'o', scripting::api::l_Wing.Set(Ships[Pl_objp->instance].wingnum));
Script_system.SetHookVar("Waypointlist", 'o', scripting::api::l_WaypointList.Set(scripting::api::waypointlist_h(aip->wp_list)));
Script_system.RunCondition(CHA_ONWAYPOINTSDONE);
Script_system.RemHookVars(2, "Ship", "Wing");
Script_system.RemHookVars(3, "Ship", "Wing", "Waypointlist");
}
}
}
@@ -4648,7 +4653,7 @@ void ai_fly_to_ship()
{
if (aip->mode == AIM_FLY_TO_SHIP || aip->goals[i].ai_mode == AI_GOAL_FLY_TO_SHIP)
{
mprintf(("Ship '%s' told to fly to target ship '%s'",
mprintf(("Ship '%s' told to fly to target ship '%s'\n",
Ships[Pl_objp->instance].ship_name,
aip->goals[i].target_name));
}
@@ -5222,7 +5227,7 @@ static int ai_select_primary_weapon_OLD(const object *objp, Weapon::Info_Flags f
ship *shipp = &Ships[objp->instance];
ship_weapon *swp = &shipp->weapons;
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
if (flags == Weapon::Info_Flags::Puncture) {
if (swp->current_primary_bank >= 0) {
@@ -5311,16 +5316,14 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
return ai_select_primary_weapon_OLD(objp, flags);
}
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
//made it so it only selects puncture weapons if the active goal is to disable something -Bobboau
if ((flags == Weapon::Info_Flags::Puncture) && (Ai_info[shipp->ai_index].goals[0].ai_mode & (AI_GOAL_DISARM_SHIP | AI_GOAL_DISABLE_SHIP)))
{
if (swp->current_primary_bank >= 0)
{
int bank_index;
bank_index = swp->current_primary_bank;
int bank_index = swp->current_primary_bank;
if (Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags[Weapon::Info_Flags::Puncture])
{
@@ -5329,11 +5332,9 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
}
for (int i=0; i<swp->num_primary_banks; i++)
{
int weapon_info_index;
int weapon_info_index = swp->primary_bank_weapons[i];
weapon_info_index = swp->primary_bank_weapons[i];
if (weapon_info_index > -1)
if (weapon_info_index >= 0)
{
if (Weapon_info[weapon_info_index].wi_flags[Weapon::Info_Flags::Puncture])
{
@@ -5344,44 +5345,51 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
}
}
if ( (other_objp->type == OBJ_SHIP) && (Ship_info[Ships[other_objp->instance].ship_info_index].is_big_or_huge() ) )
auto other_is_ship = (other_objp->type == OBJ_SHIP);
float enemy_remaining_shield = get_shield_pct(other_objp);
if ( other_is_ship && (Ship_info[Ships[other_objp->instance].ship_info_index].is_big_or_huge() ) )
{
//Check if we have a capital+ weapon on board
for (int i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
{
if (Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus])
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
if (wip->wi_flags[Weapon::Info_Flags::Capital_plus])
{
swp->current_primary_bank = i;
nprintf(("AI", "%i: Ship %s selecting weapon %s (capital+) vs target %s\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i]].name, Ships[other_objp->instance].ship_name));
return i;
// handle shielded big/huge ships (non FS-verse)
// only pick capital+ if the target has no shields; or the weapon is an ok shield-breaker anyway
if (enemy_remaining_shield <= 0.05f || (wip->shield_factor * 1.33f > wip->armor_factor))
{
swp->current_primary_bank = i;
nprintf(("AI", "%i: Ship %s selecting weapon %s (capital+) vs target %s\n", Framecount, Ships[objp->instance].ship_name, wip->name, Ships[other_objp->instance].ship_name));
return i;
}
}
}
}
}
float enemy_remaining_shield = get_shield_pct(other_objp);
// Is the target shielded by say only 5%?
if (enemy_remaining_shield <= 0.05f)
{
// Then it is safe to start using a heavy hull damage weapon such as the maxim
int i;
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
// Find the weapon with the highest hull * damage / fire delay factor
for (i = 0; i < swp->num_primary_banks; i++)
for (int i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
{
if ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
if ((((wip->armor_factor) * (wip->damage)) / wip->fire_wait) > i_hullfactor_prev)
{
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]) )
if ( !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]) )
{
// This weapon is the new candidate
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
i_hullfactor_prev = ( ((wip->armor_factor) * (wip->damage)) / wip->fire_wait );
i_hullfactor_prev_bank = i;
}
}
@@ -5392,7 +5400,7 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
i_hullfactor_prev_bank = 0; // Just switch to the first one
}
swp->current_primary_bank = i_hullfactor_prev_bank; // Select the best weapon
nprintf(("AI", "%i: Ship %s selecting weapon %s (no shields) vs target %s\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name, (other_objp->type == OBJ_SHIP ? Ships[other_objp->instance].ship_name : "non-ship") ));
nprintf(("AI", "%i: Ship %s selecting weapon %s (no shields) vs target %s\n", Framecount, shipp->ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name, (other_is_ship ? Ships[other_objp->instance].ship_name : "non-ship") ));
return i_hullfactor_prev_bank; // Return
}
@@ -5401,28 +5409,23 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
{
if (swp->current_primary_bank >= 0)
{
int bank_index;
auto wip = &Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]];
bank_index = swp->current_primary_bank;
if ((Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags[Weapon::Info_Flags::Capital_plus]))
if ((wip->wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]))
{
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[bank_index]].name));
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, shipp->ship_name, wip->name));
return swp->current_primary_bank;
}
}
for (int i=0; i<swp->num_primary_banks; i++)
{
int weapon_info_index;
weapon_info_index = swp->primary_bank_weapons[i];
if (weapon_info_index > -1)
if (swp->primary_bank_weapons[i] >= 0)
{
if ((Weapon_info[weapon_info_index].wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]))
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
if ((wip->wi_flags[Weapon::Info_Flags::Pierce_shields]) && !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]))
{
swp->current_primary_bank = i;
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i]].name));
nprintf(("AI", "%i: Ship %s selecting weapon %s (>10%% shields)\n", Framecount, shipp->ship_name, wip->name));
return i;
}
}
@@ -5432,63 +5435,63 @@ int ai_select_primary_weapon(object *objp, object *other_objp, Weapon::Info_Flag
// Is the target shielded by less then 50%?
if (enemy_remaining_shield <= 0.50f)
{
// Should be using best balanced shield gun
int i;
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
// Should be using best balanced shield/hull gun
float i_balancedfactor_prev = 0; // Previous weapon bank "balanced" factor (this is the safe way to do it)
int i_balancedfactor_prev_bank = -1; // Bank which gave us this "balanced" factor
// Find the weapon with the highest average hull and shield * damage / fire delay factor
for (i = 0; i < swp->num_primary_banks; i++)
for (int i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
{
if ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
if ((((wip->armor_factor + wip->shield_factor) * wip->damage) / wip->fire_wait) > i_balancedfactor_prev)
{
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]) )
if ( !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]) )
{
// This weapon is the new candidate
i_hullfactor_prev = ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait));
i_hullfactor_prev_bank = i;
i_balancedfactor_prev = ((((wip->armor_factor + wip->shield_factor) * wip->damage) / wip->fire_wait));
i_balancedfactor_prev_bank = i;
}
}
}
}
if (i_hullfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
if (i_balancedfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
{
i_hullfactor_prev_bank = 0; // Just switch to the first one
i_balancedfactor_prev_bank = 0; // Just switch to the first one
}
swp->current_primary_bank = i_hullfactor_prev_bank; // Select the best weapon
nprintf(("AI", "%i: Ship %s selecting weapon %s (<50%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name));
return i_hullfactor_prev_bank; // Return
swp->current_primary_bank = i_balancedfactor_prev_bank; // Select the best weapon
nprintf(("AI", "%i: Ship %s selecting weapon %s (<50%% shields)\n", Framecount, shipp->ship_name, Weapon_info[swp->primary_bank_weapons[i_balancedfactor_prev_bank]].name));
return i_balancedfactor_prev_bank; // Return
}
else
{
// Should be using best shield destroying gun
int i;
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
float i_shieldfactor_prev = 0; // Previous weapon bank shield factor (this is the safe way to do it)
int i_shieldfactor_prev_bank = -1; // Bank which gave us this shield factor
// Find the weapon with the highest average hull and shield * damage / fire delay factor
for (i = 0; i < swp->num_primary_banks; i++)
for (int i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
if (swp->primary_bank_weapons[i] >= 0) // Make sure there is a weapon in the bank
{
if ((((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
auto wip = &Weapon_info[swp->primary_bank_weapons[i]];
if ((((wip->shield_factor) * wip->damage) / wip->fire_wait) > i_shieldfactor_prev)
{
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags[Weapon::Info_Flags::Capital_plus]) )
if ( !(wip->wi_flags[Weapon::Info_Flags::Capital_plus]) )
{
// This weapon is the new candidate
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
i_hullfactor_prev_bank = i;
i_shieldfactor_prev = ( ((wip->shield_factor) * (wip->damage)) / wip->fire_wait );
i_shieldfactor_prev_bank = i;
}
}
}
}
if (i_hullfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
if (i_shieldfactor_prev_bank == -1) // In the unlikely instance we don't find at least 1 candidate weapon
{
i_hullfactor_prev_bank = 0; // Just switch to the first one
i_shieldfactor_prev_bank = 0; // Just switch to the first one
}
swp->current_primary_bank = i_hullfactor_prev_bank; // Select the best weapon
nprintf(("AI", "%i: Ship %s selecting weapon %s (>50%% shields)\n", Framecount, Ships[objp->instance].ship_name, Weapon_info[swp->primary_bank_weapons[i_hullfactor_prev_bank]].name));
return i_hullfactor_prev_bank; // Return
swp->current_primary_bank = i_shieldfactor_prev_bank; // Select the best weapon
nprintf(("AI", "%i: Ship %s selecting weapon %s (>50%% shields)\n", Framecount, shipp->ship_name, Weapon_info[swp->primary_bank_weapons[i_shieldfactor_prev_bank]].name));
return i_shieldfactor_prev_bank; // Return
}
}
@@ -5504,33 +5507,35 @@ void set_primary_weapon_linkage(object *objp)
weapon_info *wip;
shipp = &Ships[objp->instance];
if (Num_weapons > (int) (MAX_WEAPONS * 0.75f)) {
if (shipp->flags[Ship::Ship_Flags::Primary_linked]) {
nprintf(("AI", "Frame %i, ship %s: Unlinking primaries.\n", Framecount, shipp->ship_name));
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
}
return; // If low on slots, don't link.
}
sip = &Ship_info[shipp->ship_info_index];
aip = &Ai_info[shipp->ai_index];
swp = &shipp->weapons;
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
// AL: ensure target is a ship!
if ( (aip->target_objnum != -1) && (Objects[aip->target_objnum].type == OBJ_SHIP) ) {
// If trying to destroy a big ship (i.e., not disable/disarm), always unleash all weapons
if ( Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].is_big_ship() ) {
if ( aip->targeted_subsys == NULL ) {
if ( aip->targeted_subsys == nullptr ) {
if (!sip->flags[Ship::Info_Flags::No_primary_linking] ) {
shipp->flags.set(Ship::Ship_Flags::Primary_linked);
}
shipp->flags.set(Ship::Ship_Flags::Secondary_dual_fire);
shipp->flags.set(Ship::Ship_Flags::Secondary_dual_fire);
return;
}
}
}
if (Num_weapons > (int) (MAX_WEAPONS * 0.75f) || sip->flags[Ship::Info_Flags::No_primary_linking]) {
if (shipp->flags[Ship::Ship_Flags::Primary_linked])
nprintf(("AI", "Frame %i, ship %s: Unlinking primaries.\n", Framecount, shipp->ship_name));
shipp->flags.remove(Ship::Ship_Flags::Primary_linked);
return; // If low on slots or primary linking disallowed, don't link.
}
// AL 2-11-98: If ship has a disarm or disable goal, don't link unless both weapons are
// puncture weapons
if ( (aip->active_goal != AI_GOAL_NONE) && (aip->active_goal != AI_ACTIVE_GOAL_DYNAMIC) )
@@ -5632,7 +5637,7 @@ int ai_fire_primary_weapon(object *objp)
ai_info *aip;
object *enemy_objp;
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
aip = &Ai_info[shipp->ai_index];
@@ -5670,7 +5675,16 @@ int ai_fire_primary_weapon(object *objp)
float dot;
vec3d v2t;
if ( !(vm_vec_mag_quick(&G_predicted_pos) < AICODE_SMALL_MAGNITUDE ) && !(aip->submode == SM_AVOID) ) {
bool condition;
if (The_mission.ai_profile->flags[AI::Profile_Flags::Fix_ramming_stationary_targets_bug]) {
// fixed by Mantis 3147 - Avoid bashing orientation if trying to avoid a collision.
condition = !(vm_vec_mag_quick(&G_predicted_pos) < AICODE_SMALL_MAGNITUDE) && (aip->submode != SM_AVOID);
} else {
// retail behavior
condition = !(vm_vec_mag_quick(&G_predicted_pos) < AICODE_SMALL_MAGNITUDE);
}
if ( condition ) {
if ( vm_vec_cmp(&G_predicted_pos, &G_fire_pos) ) {
vm_vec_normalized_dir(&v2t, &G_predicted_pos, &G_fire_pos);
dot = vm_vec_dot(&v2t, &objp->orient.vec.fvec);
@@ -6058,7 +6072,7 @@ int ai_fire_secondary_weapon(object *objp)
shipp = &Ships[objp->instance];
swp = &shipp->weapons;
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < static_cast<int>(Ship_info.size()));
Assert( shipp->ship_info_index >= 0 && shipp->ship_info_index < ship_info_size());
// Select secondary weapon.
current_bank = swp->current_secondary_bank;
@@ -8220,9 +8234,15 @@ void ai_chase()
if ((real_dot_to_enemy < 0.25f) || (aip->target_time < 1.0f)) {
predicted_enemy_pos = enemy_pos;
} else if (aip->ai_flags[AI::AI_Flags::Seek_lock]) {
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &aip->last_aim_enemy_pos, &aip->last_aim_enemy_vel, aip); // Set G_fire_pos
predicted_enemy_pos = enemy_pos;
G_predicted_pos = predicted_enemy_pos;
if (The_mission.ai_profile->flags[AI::Profile_Flags::Fix_ramming_stationary_targets_bug]) {
// fixed by Mantis 3147 - Bash orientation if aspect seekers are equipped.
set_predicted_enemy_pos(&predicted_enemy_pos, Pl_objp, &aip->last_aim_enemy_pos, &aip->last_aim_enemy_vel, aip); // Set G_fire_pos
predicted_enemy_pos = enemy_pos;
G_predicted_pos = predicted_enemy_pos;
} else {
// retail behavior
predicted_enemy_pos = enemy_pos;
}
} else {
// Set predicted_enemy_pos.
// See if attacking a subsystem.
@@ -10681,7 +10701,7 @@ void ai_dock()
char *goal_dock_path_name = model_get(goal_sip->model_num)->paths[aip->mp_index].name;
mprintf(("Ship class %s has only %i points on dock path \"%s\". Recommended minimum number of points is 4. "\
"Docking along that path will look strange. You may wish to edit the model.", goal_ship_class_name, aip->path_length, goal_dock_path_name));
"Docking along that path will look strange. You may wish to edit the model.\n", goal_ship_class_name, aip->path_length, goal_dock_path_name));
}
aip->submode = AIS_DOCK_1;
@@ -12548,13 +12568,13 @@ int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, int allowed_path_
polymodel *pm = model_get( Ship_info[parent_shipp->ship_info_index].model_num );
ship_bay *bay = pm->ship_bay;
if ( bay == NULL ) {
WarningEx(LOCATION, "Ship %s was set to arrive from fighter bay on object %s, but no fighter bay exists on that ships' model (%s).\n", shipp->ship_name, parent_shipp->ship_name, pm->filename);
if ( bay == nullptr ) {
Warning(LOCATION, "Ship %s was set to arrive from fighter bay on object %s, but no fighter bay exists on that ships' model (%s).\n", shipp->ship_name, parent_shipp->ship_name, pm->filename);
return -1;
}
if ( bay->num_paths <= 0 ) {
WarningEx(LOCATION, "Ship %s was set to arrive from fighter bay on object %s, but no fighter bay paths exist on that ships' model (%s).\n", shipp->ship_name, parent_shipp->ship_name, pm->filename);
Warning(LOCATION, "Ship %s was set to arrive from fighter bay on object %s, but no fighter bay paths exist on that ships' model (%s).\n", shipp->ship_name, parent_shipp->ship_name, pm->filename);
return -1;
}
@@ -14077,53 +14097,74 @@ void ai_frame(int objnum)
}
}
static void ai_control_info_check(ai_info *aip)
static void ai_control_info_check(ai_info *aip, physics_info *pi)
{
if(aip->ai_override_flags.none_set())
if (aip->ai_override_flags.none_set())
return;
if(timestamp_elapsed(aip->ai_override_timestamp)) {
if (!aip->ai_override_flags[AI::Maneuver_Override_Flags::Never_expire] && timestamp_elapsed(aip->ai_override_timestamp))
{
aip->ai_override_flags.reset();
} else {
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Full])
}
else
{
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Full_rot])
{
AI_ci.pitch = aip->ai_override_ci.pitch;
AI_ci.heading = aip->ai_override_ci.heading;
AI_ci.bank = aip->ai_override_ci.bank;
} else {
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Pitch])
}
else
{
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Pitch])
{
AI_ci.pitch = aip->ai_override_ci.pitch;
}
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Heading])
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Heading])
{
AI_ci.heading = aip->ai_override_ci.heading;
}
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Roll])
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Roll])
{
AI_ci.bank = aip->ai_override_ci.bank;
}
}
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Full_lat])
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Full_lat])
{
AI_ci.vertical = aip->ai_override_ci.vertical;
AI_ci.sideways = aip->ai_override_ci.sideways;
AI_ci.forward = aip->ai_override_ci.forward;
} else {
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Up])
}
else
{
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Up])
{
AI_ci.vertical = aip->ai_override_ci.vertical;
}
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Sideways])
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Sideways])
{
AI_ci.sideways = aip->ai_override_ci.sideways;
}
if(aip->ai_override_flags[AI::Maneuver_Override_Flags::Forward])
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Forward])
{
AI_ci.forward = aip->ai_override_ci.forward;
}
}
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Dont_bank_when_turning])
AI_ci.control_flags |= CIF_DONT_BANK_WHEN_TURNING;
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Dont_clamp_max_velocity])
AI_ci.control_flags |= CIF_DONT_CLAMP_MAX_VELOCITY;
if (aip->ai_override_flags[AI::Maneuver_Override_Flags::Instantaneous_acceleration])
AI_ci.control_flags |= CIF_INSTANTANEOUS_ACCELERATION;
}
// set physics flag according to whether we are instantaneously accelerating
if (AI_ci.control_flags & CIF_INSTANTANEOUS_ACCELERATION)
pi->flags |= PF_NO_DAMP;
else
pi->flags &= ~PF_NO_DAMP;
}
int Last_ai_obj = -1;
@@ -14178,7 +14219,7 @@ void ai_process( object * obj, int ai_index, float frametime )
if (rfc == 1) {
// Wanderer - sexp based override goes here - only if rfc is valid though
ai_control_info_check(aip);
ai_control_info_check(aip, &obj->phys_info);
vec3d copy_desired_rotvel = obj->phys_info.rotvel;
physics_read_flying_controls( &obj->orient, &obj->phys_info, &AI_ci, frametime);
// if obj is in formation and not flight leader, don't update rotvel
@@ -14505,6 +14546,9 @@ void process_friendly_hit_message( int message, object *objp )
if (Ships[objp->instance].flags[Ship::Ship_Flags::No_builtin_messages]) {
index = -1;
}
if (The_mission.ai_profile->flags[AI::Profile_Flags::Check_comms_for_non_player_ships] && hud_communications_state(&Ships[objp->instance]) <= COMM_DAMAGED) {
index = -1;
}
// Karajorma - pick a random ship to send Command messages if command is silenced.
if (index < 0 && (The_mission.flags[Mission::Mission_Flags::No_builtin_command]) ) {
+47 -19
View File
@@ -21,6 +21,7 @@
#include "object/waypoint.h"
#include "parse/sexp.h"
#include "playerman/player.h"
#include "scripting/scripting.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
@@ -268,6 +269,12 @@ void ai_clear_ship_goals( ai_info *aip )
{
ai_do_default_behavior( &Objects[Ships[aip->shipnum].objnum] );
}
// add scripting hook for 'On Goals Cleared' --wookieejedi
Script_system.SetHookObject("Ship", &Objects[Ships[aip->shipnum].objnum]);
Script_system.RunCondition(CHA_ONGOALSCLEARED);
Script_system.RemHookVars(1, "Ship");
}
void ai_clear_wing_goals( int wingnum )
@@ -303,7 +310,7 @@ void ai_clear_wing_goals( int wingnum )
void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp )
{
int mode, submode, priority, i;
char *name;
const char *name;
ai_goal *aigp;
wing *wingp;
@@ -381,7 +388,7 @@ void ai_goal_purge_invalid_goals( ai_goal *aigp, ai_goal *goal_list, ai_info *ai
{
int i, j;
ai_goal *purge_goal;
char *name;
const char *name;
int mode, ship_index, wingnum;
// get locals for easer access
@@ -1369,7 +1376,7 @@ void ai_copy_mission_wing_goal( ai_goal *aigp, ai_info *aip )
}
if (j >= MAX_AI_GOALS) {
mprintf(("Unable to assign wing goal to ship %s; the ship goals are already filled to capacity", Ships[aip->shipnum].ship_name));
mprintf(("Unable to assign wing goal to ship %s; the ship goals are already filled to capacity\n", Ships[aip->shipnum].ship_name));
}
}
@@ -1406,21 +1413,17 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
{
ship *shipp = &Ships[objp->instance];
// always valid if has subspace drive
if (!(shipp->flags[Ship::Ship_Flags::No_subspace_drive]))
// always valid if has working subspace drive, not disabled, and not limited by subsystem strength
if ( ship_can_warp_full_check(shipp) )
return AI_GOAL_ACHIEVABLE;
// if no subspace drive, only valid if our mothership is present
// check that we have a mothership and that we can depart to it
if (shipp->departure_location == DEPART_AT_DOCK_BAY)
{
int anchor_shipnum = ship_name_lookup(Parse_names[shipp->departure_anchor]);
if (anchor_shipnum >= 0 && ship_useful_for_departure(anchor_shipnum, shipp->departure_path_mask))
return AI_GOAL_ACHIEVABLE;
// if we can't warp, we can only depart if the ship (or its wing) departs to a fighter bay and the mothership is present
if (ship_can_bay_depart(shipp)) {
return AI_GOAL_ACHIEVABLE;
}
else {
return AI_GOAL_NOT_KNOWN;
}
return AI_GOAL_NOT_KNOWN;
}
@@ -1499,7 +1502,8 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
Assert ( aigp->ai_submode >= 0 );
ssp = ship_get_indexed_subsys( &Ships[sindex], aigp->ai_submode );
if (ssp != NULL) {
status = mission_log_get_time( LOG_SHIP_SUBSYS_DESTROYED, aigp->target_name, ssp->system_info->subobj_name, NULL );
// see MWA 3/20/97 comment above - instead of checking the mission log, check the current hits
status = (ssp->current_hits <= 0.0f) ? 1 : 0;
} else {
// not supposed to ever happen, but could if there is a mismatch between the table and model subsystems
nprintf(("AI", "Couldn't find subsystem %d for ship %s\n", aigp->ai_submode, Ships[sindex].ship_name));
@@ -1509,12 +1513,36 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
}
case AI_GOAL_DISABLE_SHIP:
status = mission_log_get_time( LOG_SHIP_DISABLED, aigp->target_name, NULL, NULL );
{
// shipnum could be -1 depending on if the ship hasn't arrived or died. only look for subsystem
// destroyed when shipnum is valid
sindex = ship_name_lookup(aigp->target_name);
// can't determine the status of this goal if ship not valid
if (sindex < 0) {
status = 0;
} else {
// see MWA 3/20/97 comment above - instead of checking the mission log, check the current hits
status = (Ships[sindex].subsys_info[SUBSYSTEM_ENGINE].aggregate_current_hits <= 0.0f) ? 1 : 0;
}
break;
}
case AI_GOAL_DISARM_SHIP:
status = mission_log_get_time( LOG_SHIP_DISARMED, aigp->target_name, NULL, NULL );
{
// shipnum could be -1 depending on if the ship hasn't arrived or died. only look for subsystem
// destroyed when shipnum is valid
sindex = ship_name_lookup(aigp->target_name);
// can't determine the status of this goal if ship not valid
if (sindex < 0) {
status = 0;
} else {
// see MWA 3/20/97 comment above - instead of checking the mission log, check the current hits
status = (Ships[sindex].subsys_info[SUBSYSTEM_TURRET].aggregate_current_hits <= 0.0f) ? 1 : 0;
}
break;
}
// to guard or ignore a ship, the goal cannot continue if the ship being guarded is either destroyed
// or has departed.
@@ -1626,7 +1654,7 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
status = SHIP_STATUS_ARRIVED;
}
// goal ship is still on the arrival list
else if ( mission_parse_get_arrival_ship(aigp->target_name) )
else if ( mission_check_ship_yet_to_arrive(aigp->target_name) )
{
status = SHIP_STATUS_NOT_ARRIVED;
}
+16 -18
View File
@@ -856,11 +856,11 @@ int get_nearest_turret_objnum(int turret_parent_objnum, ship_subsys *turret_subs
// flags for weapon types
if (beam_flag)
eeo.eeo_flags |= EEOF_BEAM;
else if (flak_flag)
if (flak_flag)
eeo.eeo_flags |= EEOF_FLAK;
else if (laser_flag)
if (laser_flag)
eeo.eeo_flags |= EEOF_LASER;
else if (missile_flag)
if (missile_flag)
eeo.eeo_flags |= EEOF_MISSILE;
eeo.enemy_team_mask = enemy_team_mask;
@@ -1678,7 +1678,12 @@ void turret_set_next_fire_timestamp(int weapon_num, weapon_info *wip, ship_subsy
wait *= wip->burst_delay;
turret->weapons.burst_counter[weapon_num]++;
} else {
wait *= wip->fire_wait;
// Random fire delay (DahBlount) used in ship_fire_primary(), added here by wookieejedi to correct oversight
if (wip->max_delay != 0.0f && wip->min_delay != 0.0f) {
wait *= frand_range(wip->min_delay, wip->max_delay);
} else {
wait *= wip->fire_wait;
}
if ((wip->burst_shots > 0) && (wip->burst_flags[Weapon::Burst_Flags::Random_length])) {
turret->weapons.burst_counter[weapon_num] = (myrand() % wip->burst_shots);
} else {
@@ -1807,7 +1812,7 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
parent_aip = &Ai_info[Ships[Objects[parent_objnum].instance].ai_index];
parent_ship = &Ships[Objects[parent_objnum].instance];
wip = get_turret_weapon_wip(&turret->weapons, weapon_num);
int turret_weapon_class = WEAPON_INFO_INDEX(wip);
int turret_weapon_class = weapon_info_get_index(wip);
#ifndef NDEBUG
// moved here from check_ok_to_fire
@@ -2539,7 +2544,6 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
// Ok, the turret is lined up... now line up a particular gun.
bool ok_to_fire = false;
bool something_was_ok_to_fire=false;
vec3d tv2e; //so flak can get their jitter without screwing up other guns
if (in_fov ) {
@@ -2576,7 +2580,9 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
ss->turret_next_fire_pos = ffp_pos;
}
ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
// We're ready to fire... now get down to specifics, like where is the
// actual gun point and normal, not just the one for whole turret.
ship_get_global_turret_gun_info(&Objects[parent_objnum], ss, &gpos, &gvec, use_angles, &predicted_enemy_pos);
// Fire in the direction the turret is facing, not right at the target regardless of turret dir.
vm_vec_sub(&v2e, &predicted_enemy_pos, &gpos);
@@ -2587,12 +2593,6 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
wip = get_turret_weapon_wip(&ss->weapons, valid_weapons[0]);
else
wip = get_turret_weapon_wip(&ss->weapons, valid_weapons[i]);
// We're ready to fire... now get down to specifics, like where is the
// actual gun point and normal, not just the one for whole turret.
// moved here as if there are two weapons with indentical fire stamps
// they would have shared the fire point.
tv2e = gvec;
// make sure to reset this for current weapon
ok_to_fire = false;
@@ -2600,7 +2600,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
// if the weapon is a flak gun, add some jitter to its aim so it fires in a "cone"
// to make a cool visual effect and make them less lethal
if(wip->wi_flags[Weapon::Info_Flags::Flak]){
flak_jitter_aim(&tv2e, dist_to_enemy, ship_get_subsystem_strength(shipp, SUBSYSTEM_WEAPONS), wip);
flak_jitter_aim(&v2e, dist_to_enemy, ship_get_subsystem_strength(shipp, SUBSYSTEM_WEAPONS), wip);
}
// Fire if:
@@ -2711,9 +2711,9 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
//Pass along which gun we are using
if (tp->flags[Model::Subsystem_Flags::Turret_salvo])
turret_fire_weapon(valid_weapons[0], ss, parent_objnum, &gpos, &tv2e, &predicted_enemy_pos);
turret_fire_weapon(valid_weapons[0], ss, parent_objnum, &gpos, &v2e, &predicted_enemy_pos);
else
turret_fire_weapon(valid_weapons[i], ss, parent_objnum, &gpos, &tv2e, &predicted_enemy_pos);
turret_fire_weapon(valid_weapons[i], ss, parent_objnum, &gpos, &v2e, &predicted_enemy_pos);
} else {
// make sure salvo fire mode does not turn into autofire
if ((tp->flags[Model::Subsystem_Flags::Turret_salvo]) && ((i + 1) == number_of_firings)) {
@@ -2726,8 +2726,6 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
if(!something_was_ok_to_fire)
{
mprintf(("nothing ok to fire\n"));
if (ss->turret_best_weapon >= 0) {
//Impose a penalty on turret accuracy for losing site of its goal, or just not being able to fire.
turret_update_enemy_in_range(ss, -4*Weapon_info[ss->turret_best_weapon].fire_wait);
+3 -3
View File
@@ -478,7 +478,7 @@ static void asteroid_load(int asteroid_info_index, int asteroid_subtype)
}
else
{
nprintf(("Warning", "For asteroid '%s', detail level mismatch (POF needs %d)", asip->name, pm->n_detail_levels));
nprintf(("Warning", "For asteroid '%s', detail level mismatch (POF needs %d)\n", asip->name, pm->n_detail_levels));
}
}
// Stuff detail level distances.
@@ -1937,11 +1937,11 @@ static void asteroid_parse_tbl()
if (tally != max_asteroids)
{
#ifndef NDEBUG
mprintf(("Asteroid.tbl as parsed:\n"));
for (SCP_vector<SCP_string>::iterator iter = parsed_asteroids.begin();
iter != parsed_asteroids.end(); ++iter)
{
mprintf(("Asteroid.tbl as parsed:\n"));
mprintf(("%s", iter->c_str()));
mprintf(("%s\n", iter->c_str()));
}
#endif
Error(LOCATION,
+2 -2
View File
@@ -218,9 +218,9 @@ bool StartAutopilot()
if (shipp->team != Player_ship->team)
continue;
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < static_cast<int>(Ship_info.size())),
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < ship_info_size()),
"Ship '%s' does not have a valid pointer to a ship class. Pointer is %d, which is smaller than 0 or bigger than %d",
shipp->ship_name, shipp->ship_info_index, static_cast<int>(Ship_info.size()));
shipp->ship_name, shipp->ship_info_index, ship_info_size());
ship_info *sip = &Ship_info[shipp->ship_info_index];
if ( !(sip->flags[Ship::Info_Flags::Support]) )
+1 -4
View File
@@ -10,12 +10,9 @@
#define BMPMAN_NDEBUG
#endif
#define WIN32_LEAN_AND_MEAN
#define BMPMAN_INTERNAL
#ifdef _WIN32
#include <windows.h>
#endif
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "bmpman/bm_internal.h"
+1 -1
View File
@@ -57,7 +57,7 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl .tbm", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl .tbm .lua", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS, "data" DIR_SEPARATOR_STR "sounds", ".wav .ogg", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS_8B22K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "8b22k", ".wav .ogg", CF_TYPE_SOUNDS },
{ CF_TYPE_SOUNDS_16B11K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "16b11k", ".wav .ogg", CF_TYPE_SOUNDS },
+4
View File
@@ -291,6 +291,10 @@ uint cf_add_chksum_long(uint seed, ubyte *buffer, size_t size);
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
// Creates the directory path if it doesn't exist. Even creates all its
// parent paths.
void cf_create_directory(int dir_type, uint32_t location_flags = CF_LOCATION_ALL);
// changes the attributes of a file
void cf_attrib(const char *name, int set, int clear, int type);
+34 -5
View File
@@ -556,17 +556,40 @@ void cf_search_root_path(int root_index)
int i;
int num_files = 0;
cf_root *root = cf_get_root(root_index);
cf_root* root = cf_get_root(root_index);
mprintf(( "Searching root '%s' ... ", root->path ));
mprintf(("Searching root '%s' ... ", root->path));
#ifndef WIN32
try {
auto current = root->path;
const auto prefPathEnd = root->path + strlen(root->path);
while (current != prefPathEnd) {
const auto cp = utf8::next(current, prefPathEnd);
if (cp > 127) {
// On Windows, we currently do not support Unicode paths so catch this early and let the user
// know
const auto invalid_end = current;
utf8::prior(current, root->path);
Error(LOCATION,
"Trying to use path \"%s\" as a data root. That path is not supported since it "
"contains a Unicode character (%s). If possible, change this path to something that only uses "
"ASCII characters.",
root->path, std::string(current, invalid_end).c_str());
}
}
} catch (const std::exception& e) {
Error(LOCATION, "UTF-8 error while checking the root path \"%s\": %s", root->path, e.what());
}
#endif
char search_path[CF_MAX_PATHNAME_LENGTH];
#ifdef SCP_UNIX
// This map stores the mapping between a specific path type and the actual path that we use for it
// This map stores the mapping between a specific path type and the actual path that we use for it
SCP_unordered_map<int, SCP_string> pathTypeToRealPath;
#endif
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
for (i = CF_TYPE_ROOT; i < CF_MAX_PATH_TYPES; i++) {
// we don't want to add player files to the cache - taylor
if ( (i == CF_TYPE_SINGLE_PLAYERS) || (i == CF_TYPE_MULTI_PLAYERS) ) {
@@ -1556,6 +1579,9 @@ static int cf_file_already_in_list( SCP_vector<SCP_string> &list, const char *fi
// This one has a 'type', which is a CF_TYPE_* value. Because this specifies the directory
// location, 'filter' only needs to be the filter itself, with no path information.
// See above descriptions of cf_get_file_list() for more information about how it all works.
// Note that filesystem listing is always sorted by name *before* sorting by the
// provided sort order. This isn't strictly needed on NTFS, which always provides the list
// sorted by name. But on mac/linux it's always needed.
int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* filter, int sort,
SCP_vector<file_list_info>* info, uint32_t location_flags)
{
@@ -1678,6 +1704,10 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* fil
}
#endif
// tcrayford: sort the filesystem listing by name by default to ensure
// a stable order across filesystems
cf_sort_filenames( list, CF_SORT_NAME, info );
bool skip_packfiles = false;
if ( (pathtype == CF_TYPE_PLAYERS) || (pathtype == CF_TYPE_SINGLE_PLAYERS) || (pathtype == CF_TYPE_MULTI_PLAYERS) ) {
skip_packfiles = true;
@@ -1743,7 +1773,6 @@ int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* fil
}
}
if (sort != CF_SORT_NONE) {
cf_sort_filenames( list, sort, info );
}
+237 -160
View File
@@ -82,8 +82,8 @@ public:
int name_found; // true if parameter on command line, otherwise false
const int arg_type; // from enum cmdline_arg_type; used for help
cmdline_parm(const char *name, const char *help, const int arg_type, const bool stacks = false);
~cmdline_parm();
cmdline_parm(const char *name, const char *help, const int arg_type, const bool stacks = false) noexcept;
~cmdline_parm() noexcept;
int found();
int get_int();
float get_float();
@@ -100,17 +100,13 @@ extern int Show_framerate; // from freespace.cpp
enum
{
// DO NOT CHANGE ANYTHING ABOUT THESE FIRST TWO OR WILL MESS UP THE LAUNCHER
EASY_DEFAULT = 1 << 1,
EASY_ALL_ON = 1 << 2,
EASY_DEFAULT = 1 << 1, // Default FS2 (All features off)
EASY_ALL_ON = 1 << 2, // All features on
EASY_MEM_ON = 1 << 3,
EASY_MEM_OFF = 1 << 4,
EASY_HI_MEM_ON = 1 << 3, // High memory usage features on
EASY_HI_MEM_OFF = 1 << 4, // High memory usage features off
// Add new flags here
// Combos
EASY_MEM_ALL_ON = EASY_ALL_ON | EASY_MEM_ON,
EASY_DEFAULT_MEM = EASY_DEFAULT | EASY_MEM_OFF
};
enum BuildCaps
@@ -122,6 +118,7 @@ enum BuildCaps
};
#define PARSE_COMMAND_LINE_STRING "-parse_cmdline_only"
#define GET_FLAGS_STRING "-get_flags"
typedef struct
{
@@ -145,109 +142,116 @@ typedef struct
char name[20]; // The actual flag
char desc[40]; // The text that will appear in the launcher (unless its blank, other name is shown)
bool fso_only; // true if this is a fs2_open only feature
int on_flags; // Easy flag which will turn this feature on
int off_flags; // Easy flag which will turn this feature off
int on_flags; // "Easy setting" which will turn this option on
int off_flags; // "Easy setting" which will turn this option off
char type[16]; // Launcher uses this to put flags under different headings
char web_url[256]; // Link to documentation of feature (please use wiki or somewhere constant)
} Flag;
// clang-format off
// Please group them by type, ie graphics, gameplay etc, maximum 20 different types
Flag exe_params[] =
{
{ "-nospec", "Disable specular", true, EASY_DEFAULT_MEM, EASY_MEM_ALL_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-spec", },
{ "-noglow", "Disable glow maps", true, EASY_DEFAULT_MEM, EASY_MEM_ALL_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-glow", },
{ "-noenv", "Disable environment maps", true, EASY_DEFAULT_MEM, EASY_MEM_ALL_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-env", },
{ "-nomotiondebris", "Disable motion debris", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomotiondebris",},
{ "-noscalevid", "Disable scale-to-window for movies", true, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noscalevid", },
{ "-nonormal", "Disable normal maps", true, EASY_DEFAULT_MEM, EASY_MEM_ALL_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-normal" },
{ "-no_emissive_light", "Disable emissive light from ships", true, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_emissive_light" },
{ "-noheight", "Disable height/parallax maps", true, EASY_DEFAULT_MEM, EASY_MEM_ALL_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-height" },
{ "-3dshockwave", "Enable 3D shockwaves", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dshockwave" },
{ "-post_process", "Enable post processing", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-post_process" },
{ "-soft_particles", "Enable soft particles", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-soft_particles" },
{ "-fxaa", "Enable FXAA anti-aliasing", true, EASY_MEM_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fxaa" },
{ "-nolightshafts", "Disable lightshafts", true, EASY_DEFAULT, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-flightshaftsoff"},
{ "-fb_explosions", "Enable Framebuffer Shockwaves", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fb_explosions", },
{ "-fb_thrusters", "Enable Framebuffer Thrusters", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fb_thrusters", },
{ "-no_deferred", "Disable Deferred Lighting", true, EASY_DEFAULT_MEM, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_deferred"},
{ "-enable_shadows", "Enable Shadows", true, EASY_MEM_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_shadows"},
{ "-no_vsync", "Disable vertical sync", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_vsync", },
{ "-nospec", "Disable specular", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nospec", },
{ "-noglow", "Disable glow maps", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noglow", },
{ "-noenv", "Disable environment maps", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noenv", },
{ "-nonormal", "Disable normal maps", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nonormal" },
{ "-emissive_light", "Enable emissive light from ships", true, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-emissive_light" },
{ "-noheight", "Disable height/parallax maps", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noheight" },
{ "-3dshockwave", "Enable 3D shockwaves", true, EASY_ALL_ON | EASY_HI_MEM_ON, EASY_DEFAULT | EASY_HI_MEM_OFF, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dshockwave" },
{ "-no_post_process", "Disable post-processing", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_post_process" },
{ "-soft_particles", "Enable soft particles", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-soft_particles" },
{ "-aa", "Enable Post-process anti-aliasing", true, EASY_ALL_ON | EASY_HI_MEM_ON, EASY_DEFAULT | EASY_HI_MEM_OFF, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-aa" },
{ "-nolightshafts", "Disable lightshafts", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nolightshafts"},
{ "-fb_explosions", "Enable Framebuffer Shockwaves", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fb_explosions", },
{ "-fb_thrusters", "Enable Framebuffer Thrusters", true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fb_thrusters", },
{ "-no_deferred", "Disable Deferred Lighting", true, EASY_DEFAULT | EASY_HI_MEM_OFF, EASY_ALL_ON | EASY_HI_MEM_ON, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_deferred"},
{ "-enable_shadows", "Enable Shadows", true, EASY_ALL_ON | EASY_HI_MEM_ON, EASY_DEFAULT | EASY_HI_MEM_OFF, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-enable_shadows"},
{ "-dualscanlines", "Add another pair of scanning lines", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dualscanlines", },
{ "-targetinfo", "Enable info next to target", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-targetinfo", },
{ "-orbradar", "Enable 3D radar", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-orbradar", },
{ "-rearm_timer", "Enable rearm/repair completion timer", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-rearm_timer", },
{ "-ballistic_gauge", "Enable analog ballistic ammo gauge", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ballistic_gauge", },
{ "-no_vsync", "Disable vertical sync", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_vsync", },
{ "-ship_choice_3d", "Use 3D models for ship selection", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ship_choice_3d", },
{ "-weapon_choice_3d", "Use 3D models for weapon selection", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-weapon_choice_3d", },
{ "-3dwarp", "Enable 3D warp", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dwarp", },
{ "-warp_flash", "Enable flash upon warp", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-warp_flash", },
{ "-no_ap_interrupt", "Disable interrupting autopilot", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_ap_interrupt", },
{ "-stretch_menu", "Stretch interface to fill screen", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-stretch_menu", },
{ "-fps", "Show frames per second on HUD", false, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fps", },
{ "-dualscanlines", "Add another pair of scanning lines", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dualscanlines", },
{ "-targetinfo", "Enable info next to target", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-targetinfo", },
{ "-orbradar", "Enable 3D radar", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-orbradar", },
{ "-rearm_timer", "Enable rearm/repair completion timer", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-rearm_timer", },
{ "-ballistic_gauge", "Enable analog ballistic ammo gauge", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ballistic_gauge", },
{ "-nosound", "Disable all sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound", },
{ "-nomusic", "Disable music", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomusic", },
{ "-no_enhanced_sound", "Disable enhanced sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_enhanced_sound", },
{ "-window", "Run in window", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-window", },
{ "-fullscreen_window", "Run in fullscreen window", false, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fullscreen_window", },
{ "-stretch_menu", "Stretch interface to fill screen", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-stretch_menu", },
{ "-noscalevid", "Disable scale-to-window for movies", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noscalevid", },
{ "-nomotiondebris", "Disable motion debris", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomotiondebris",},
{ "-ship_choice_3d", "Use 3D models for ship selection", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ship_choice_3d", },
{ "-weapon_choice_3d", "Use 3D models for weapon selection", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-weapon_choice_3d", },
{ "-3dwarp", "Enable 3D warp", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-3dwarp", },
{ "-warp_flash", "Enable flash upon warp", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-warp_flash", },
{ "-no_ap_interrupt", "Disable interrupting autopilot", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_ap_interrupt", },
{ "-portable_mode", "Store config in portable location", false, 0, EASY_DEFAULT, "Launcher", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-portable_mode", },
{ "-nosound", "Disable all sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound", },
{ "-nomusic", "Disable music", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomusic", },
{ "-no_enhanced_sound", "Disable enhanced sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_enhanced_sound", },
{ "-standalone", "Run as standalone server", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-standalone", },
{ "-startgame", "Skip mainhall and start hosting", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-startgame", },
{ "-closed", "Start hosted server as closed", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-closed", },
{ "-restricted", "Host confirms join requests", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-restricted", },
{ "-multilog", "", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-multilog", },
{ "-clientdamage", "", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-clientdamage", },
{ "-mpnoreturn", "Disable flight deck option", true, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-mpnoreturn", },
{ "-portable_mode", "Store config in portable location", false, 0, EASY_DEFAULT, "Launcher", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-portable_mode", },
{ "-no_set_gamma", "Disable setting of gamma", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_set_gamma", },
{ "-nomovies", "Disable video playback", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomovies", },
{ "-noparseerrors", "Disable parsing errors", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noparseerrors", },
{ "-loadallweps", "Load all weapons, even those not used", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-loadallweps", },
{ "-disable_fbo", "Disable OpenGL RenderTargets", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_fbo", },
{ "-disable_pbo", "Disable OpenGL Pixel Buffer Objects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_pbo", },
{ "-ati_swap", "Fix colour issues on some ATI cards", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ati_swap", },
{ "-no_3d_sound", "Use only 2D/stereo for sound effects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_3d_sound", },
{ "-mipmap", "Enable mipmapping", true, 0, EASY_DEFAULT_MEM, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-mipmap", },
{ "-use_gldrawelements","Don't use glDrawRangeElements", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-use_gldrawelements", },
{ "-gl_finish", "Fix input lag on some ATI+Linux systems", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gl_finish", },
{ "-no_geo_effects", "Disable geometry shader for effects", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-set_cpu_affinity", "Sets processor affinity to config value", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-nograb", "Disables mouse grabbing", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nograb", },
{ "-noshadercache", "Disables the shader cache", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noshadercache", },
{ "-standalone", "Run as standalone server", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-standalone", },
{ "-startgame", "Skip mainhall and start hosting", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-startgame", },
{ "-closed", "Start hosted server as closed", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-closed", },
{ "-restricted", "Host confirms join requests", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-restricted", },
{ "-multilog", "", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-multilog", },
{ "-clientdamage", "", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-clientdamage", },
{ "-mpnoreturn", "Disable flight deck option", true, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-mpnoreturn", },
{ "-gateway_ip", "Set gateway IP address", false, 0, EASY_DEFAULT, "Multiplayer", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gateway_ip", },
{ "-no_set_gamma", "Disable setting of gamma", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_set_gamma", },
{ "-nomovies", "Disable video playback", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nomovies", },
{ "-noparseerrors", "Disable parsing errors", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noparseerrors", },
{ "-loadallweps", "Load all weapons, even those not used", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-loadallweps", },
{ "-disable_fbo", "Disable OpenGL RenderTargets", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_fbo", },
{ "-disable_pbo", "Disable OpenGL Pixel Buffer Objects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_pbo", },
{ "-ati_swap", "Fix colour issues on some ATI cards", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ati_swap", },
{ "-no_3d_sound", "Use only 2D/stereo for sound effects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_3d_sound", },
{ "-mipmap", "Enable mipmapping", true, 0, EASY_DEFAULT | EASY_HI_MEM_OFF, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-mipmap", },
{ "-use_gldrawelements","Don't use glDrawRangeElements", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-use_gldrawelements", },
{ "-gl_finish", "Fix input lag on some ATI+Linux systems", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gl_finish", },
{ "-no_geo_effects", "Disable geometry shader for effects", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_geo_effects", },
{ "-set_cpu_affinity", "Sets processor affinity to config value", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-set_cpu_affinity", },
{ "-nograb", "Disables mouse grabbing", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nograb", },
{ "-noshadercache", "Disables the shader cache", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noshadercache", },
#ifdef WIN32
{ "-fix_registry", "Use a different registry path", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-fix_registry", "Use a different registry path", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fix_registry", },
#endif
{ "-ingame_join", "Allow in-game joining", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ingame_join", },
{ "-voicer", "Enable voice recognition", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-voicer", },
{ "-ingame_join", "Allow in-game joining", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ingame_join", },
{ "-voicer", "Enable voice recognition", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-voicer", },
{ "-fps", "Show frames per second on HUD", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fps", },
{ "-bmpmanusage", "Show how many BMPMAN slots are in use", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-bmpmanusage", },
{ "-pos", "Show position of camera", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pos", },
{ "-window", "Run in window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-window", },
{ "-fullscreen_window", "Run in fullscreen window", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fullscreen_window", },
{ "-stats", "Show statistics", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-stats", },
{ "-coords", "Show coordinates", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-coords", },
{ "-pofspew", "Generate all ibx files immediately", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pofspew", },
{ "-tablecrcs", "Dump table CRCs for multi validation", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-tablecrcs", },
{ "-missioncrcs", "Dump mission CRCs for multi validation", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-missioncrcs", },
{ "-dis_collisions", "Disable collisions", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dis_collisions", },
{ "-dis_weapons", "Disable weapon rendering", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dis_weapons", },
{ "-output_sexps", "Output SEXPs to sexps.html", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_sexps", },
{ "-output_scripting", "Output scripting to scripting.html", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_scripting", },
{ "-save_render_target", "Save render targets to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-save_render_target", },
{ "-verify_vps", "Spew VP CRCs to vp_crcs.txt", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-verify_vps", },
{ "-reparse_mainhall", "Reparse mainhall.tbl when loading halls", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-reparse_mainhall", },
{ "-profile_write_file", "Write profiling information to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_write_file", },
{ "-no_unfocused_pause","Don't pause if the window isn't focused", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_unfocused_pause", },
{ "-benchmark_mode", "Puts the game into benchmark mode", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-benchmark_mode", },
{ "-noninteractive", "Disables interactive dialogs", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noninteractive", },
{ "-json_profiling", "Generate JSON profiling output", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-json_profiling", },
{ "-profile_frame_time","Profile engine subsystems", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_frame_timings", },
{ "-debug_window", "Enable the debug window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window", },
{ "-bmpmanusage", "Show how many BMPMAN slots are in use", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-bmpmanusage", },
{ "-pos", "Show position of camera", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pos", },
{ "-stats", "Show statistics", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-stats", },
{ "-coords", "Show coordinates", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-coords", },
{ "-pofspew", "Dump model information to pofspew.txt", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pofspew", },
{ "-weaponspew", "Dump weapon stats and spreadsheets", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-weaponspew", },
{ "-tablecrcs", "Dump table CRCs for multi validation", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-tablecrcs", },
{ "-missioncrcs", "Dump mission CRCs for multi validation", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-missioncrcs", },
{ "-dis_collisions", "Disable collisions", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dis_collisions", },
{ "-dis_weapons", "Disable weapon rendering", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dis_weapons", },
{ "-output_sexps", "Output SEXPs to sexps.html", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_sexps", },
{ "-output_scripting", "Output scripting to scripting.html", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_scripting", },
{ "-output_script_json", "Output scripting doc to scripting.json", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_script_json", },
{ "-save_render_target", "Save render targets to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-save_render_target", },
{ "-verify_vps", "Spew VP CRCs to vp_crcs.txt", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-verify_vps", },
{ "-reparse_mainhall", "Reparse mainhall.tbl when loading halls", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-reparse_mainhall", },
{ "-noninteractive", "Disables interactive dialogs", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noninteractive", },
{ "-no_unfocused_pause","Don't pause if the window isn't focused", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_unfocused_pause", },
{ "-benchmark_mode", "Puts the game into benchmark mode", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-benchmark_mode", },
{ "-profile_frame_time","Profile frame time", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_frame_time", },
{ "-profile_write_file", "Write profiling information to file", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-profile_write_file", },
{ "-json_profiling", "Generate JSON profiling output", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-json_profiling", },
{ "-debug_window", "Enable the debug window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window", },
{ "-gr_debug", "Output graphics debug information", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-gr_debug", },
};
// clang-format on
// forward declaration
const char * get_param_desc(const char *flag_name);
@@ -271,6 +275,7 @@ cmdline_parm port_arg("-port", "Multiplayer network port", AT_INT);
cmdline_parm multilog_arg("-multilog", NULL, AT_NONE); // Cmdline_multi_log
cmdline_parm client_dodamage("-clientdamage", NULL, AT_NONE); // Cmdline_client_dodamage
cmdline_parm pof_spew("-pofspew", NULL, AT_NONE); // Cmdline_spew_pof_info
cmdline_parm weapon_spew("-weaponspew", nullptr, AT_NONE); // Cmdline_spew_weapon_stats
cmdline_parm mouse_coords("-coords", NULL, AT_NONE); // Cmdline_mouse_coords
cmdline_parm timeout("-timeout", "Multiplayer network timeout (secs)", AT_INT); // Cmdline_timeout
cmdline_parm bit32_arg("-32bit", "Deprecated", AT_NONE); // (only here for retail compatibility reasons, doesn't actually do anything)
@@ -292,6 +297,7 @@ int Cmdline_multi_stream_chat_to_file = 0;
int Cmdline_network_port = -1;
int Cmdline_restricted_game = 0;
int Cmdline_spew_pof_info = 0;
bool Cmdline_spew_weapon_stats = false;
int Cmdline_start_netgame = 0;
int Cmdline_timeout = -1;
int Cmdline_use_last_pilot = 0;
@@ -302,8 +308,6 @@ int Cmdline_use_last_pilot = 0;
// Graphics related
cmdline_parm fov_arg("-fov", "Vertical field-of-view factor", AT_FLOAT); // Cmdline_fov -- comand line FOV -Bobboau
cmdline_parm clip_dist_arg("-clipdist", "Changes the distance from the viewpoint for the near-clipping plane", AT_FLOAT); // Cmdline_clip_dist
cmdline_parm spec_exp_arg("-spec_exp", "Adjusts the size of shiny spots on ships", AT_FLOAT);
cmdline_parm ogl_spec_arg("-ogl_spec", "Shininess of specular light", AT_FLOAT); // Cmdline_ogl_spec
cmdline_parm spec_static_arg("-spec_static", "Adjusts suns contribution to specular highlights", AT_FLOAT);
cmdline_parm spec_point_arg("-spec_point", "Adjusts laser weapons contribution to specular highlights", AT_FLOAT);
cmdline_parm spec_tube_arg("-spec_tube", "Adjusts beam weapons contribution to specular highlights", AT_FLOAT);
@@ -313,15 +317,19 @@ cmdline_parm glow_arg("-noglow", NULL, AT_NONE); // Cmdline_glow -- use B
cmdline_parm nomotiondebris_arg("-nomotiondebris", NULL, AT_NONE); // Cmdline_nomotiondebris -- Removes those ugly floating rocks -C
cmdline_parm noscalevid_arg("-noscalevid", NULL, AT_NONE); // Cmdline_noscalevid -- disable video scaling that fits to window
cmdline_parm spec_arg("-nospec", NULL, AT_NONE); // Cmdline_spec --
cmdline_parm noemissive_arg("-no_emissive_light", "Disable emissive light from ships", AT_NONE); // Cmdline_no_emissive -- don't use emissive light in OGL
cmdline_parm emissive_arg("-emissive_light", "Enable emissive light from ships", AT_NONE); // Cmdline_no_emissive -- don't use emissive light in OGL
cmdline_parm normal_arg("-nonormal", NULL, AT_NONE); // Cmdline_normal -- disable normal mapping
cmdline_parm height_arg("-noheight", NULL, AT_NONE); // Cmdline_height -- enable support for parallax mapping
cmdline_parm enable_3d_shockwave_arg("-3dshockwave", NULL, AT_NONE);
cmdline_parm softparticles_arg("-soft_particles", NULL, AT_NONE);
cmdline_parm postprocess_arg("-post_process", NULL, AT_NONE);
cmdline_parm bloom_intensity_arg("-bloom_intensity", "Set bloom intensity, requires -post_process", AT_INT);
cmdline_parm fxaa_arg("-fxaa", NULL, AT_NONE);
cmdline_parm fxaa_preset_arg("-fxaa_preset", "FXAA quality (0-9), requires -post_process and -fxaa", AT_INT);
cmdline_parm no_postprocess_arg("-no_post_process", "Disables post-processing", AT_NONE);
cmdline_parm bloom_intensity_arg("-bloom_intensity", "Set bloom intensity, requires post-processing", AT_INT);
cmdline_parm post_process_aa_arg("-aa", "Enables post-process antialiasing", AT_NONE);
cmdline_parm post_process_aa_preset_arg("-aa_preset", "Sets the AA effect to use. See the wiki for details", AT_INT);
cmdline_parm deprecated_fxaa_arg("-fxaa", nullptr, AT_NONE);
cmdline_parm deprecated_fxaa_preset_arg("-fxaa_preset", "FXAA quality (0-2), requires post-processing and -fxaa", AT_INT);
cmdline_parm deprecated_smaa_arg("-smaa", nullptr, AT_NONE);
cmdline_parm deprecated_smaa_preset_arg("-smaa_preset", "SMAA quality (0-3), requires post-processing and -smaa", AT_INT);
cmdline_parm fb_explosions_arg("-fb_explosions", NULL, AT_NONE);
cmdline_parm fb_thrusters_arg("-fb_thrusters", NULL, AT_NONE);
cmdline_parm flightshaftsoff_arg("-nolightshafts", NULL, AT_NONE);
@@ -331,19 +339,18 @@ cmdline_parm no_deferred_lighting_arg("-no_deferred", NULL, AT_NONE); // Cmdline
cmdline_parm anisotropy_level_arg("-anisotropic_filter", NULL, AT_INT);
float Cmdline_clip_dist = Default_min_draw_distance;
float Cmdline_ogl_spec = 80.0f;
int Cmdline_ambient_factor = 128;
int Cmdline_env = 1;
int Cmdline_mipmap = 0;
int Cmdline_glow = 1;
int Cmdline_noscalevid = 0;
int Cmdline_spec = 1;
int Cmdline_no_emissive = 0;
int Cmdline_emissive = 0;
int Cmdline_normal = 1;
int Cmdline_height = 1;
int Cmdline_enable_3d_shockwave = 0;
int Cmdline_softparticles = 0;
int Cmdline_bloom_intensity = 75;
int Cmdline_bloom_intensity = 25;
extern bool ls_force_off;
int Cmdline_no_deferred_lighting = 0;
int Cmdline_aniso_level = 0;
@@ -398,16 +405,14 @@ char *Cmdline_mod = NULL; //DTP for mod argument
cmdline_parm almission_arg("-almission", "Autoload multiplayer mission", AT_STRING); // Cmdline_almission -- DTP for autoload Multi mission
cmdline_parm ingamejoin_arg("-ingame_join", NULL, AT_NONE); // Cmdline_ingamejoin
cmdline_parm mpnoreturn_arg("-mpnoreturn", NULL, AT_NONE); // Cmdline_mpnoreturn -- Removes 'Return to Flight Deck' in respawn dialog -C
cmdline_parm missioncrcspew_arg("-missioncrcs", NULL, AT_STRING); // Cmdline_spew_mission_crcs
cmdline_parm tablecrcspew_arg("-tablecrcs", NULL, AT_STRING); // Cmdline_spew_table_crcs
cmdline_parm objupd_arg("-cap_object_update", "Multiplayer object update cap (0-3)", AT_INT);
cmdline_parm gateway_ip_arg("-gateway_ip", "Set gateway IP address", AT_STRING);
char *Cmdline_almission = NULL; //DTP for autoload multi mission.
int Cmdline_ingamejoin = 0;
int Cmdline_mpnoreturn = 0;
char *Cmdline_spew_mission_crcs = NULL;
char *Cmdline_spew_table_crcs = NULL;
int Cmdline_objupd = 3; // client object updates on LAN by default
char *Cmdline_gateway_ip = nullptr;
// Launcher related options
cmdline_parm portable_mode("-portable_mode", NULL, AT_NONE);
@@ -478,6 +483,8 @@ cmdline_parm json_profiling("-json_profiling", NULL, AT_NONE); //Cmdline_json_pr
cmdline_parm show_video_info("-show_video_info", NULL, AT_NONE); //Cmdline_show_video_info
cmdline_parm frame_profile_arg("-profile_frame_time", NULL, AT_NONE); //Cmdline_frame_profile
cmdline_parm debug_window_arg("-debug_window", NULL, AT_NONE); // Cmdline_debug_window
cmdline_parm graphics_debug_output_arg("-gr_debug", nullptr, AT_NONE); // Cmdline_graphics_debug_output
cmdline_parm log_to_stdout_arg("-stdout_log", nullptr, AT_NONE); // Cmdline_log_to_stdout
char *Cmdline_start_mission = NULL;
@@ -507,11 +514,14 @@ bool Cmdline_json_profiling = false;
bool Cmdline_frame_profile = false;
bool Cmdline_show_video_info = false;
bool Cmdline_debug_window = false;
bool Cmdline_graphics_debug_output = false;
bool Cmdline_log_to_stdout = false;
// Other
cmdline_parm get_flags_arg("-get_flags", "Output the launcher flags file", AT_STRING);
cmdline_parm get_flags_arg(GET_FLAGS_STRING, "Output the launcher flags file", AT_STRING);
cmdline_parm output_sexp_arg("-output_sexps", NULL, AT_NONE); //WMC - outputs all SEXPs to sexps.html
cmdline_parm output_scripting_arg("-output_scripting", NULL, AT_NONE); //WMC
cmdline_parm output_script_json_arg("-output_script_json", nullptr, AT_NONE); // m!m
// Deprecated flags - CommanderDJ
cmdline_parm deprecated_spec_arg("-spec", "Deprecated", AT_NONE);
@@ -525,6 +535,8 @@ cmdline_parm deprecated_brieflighting_arg("-brief_lighting", "Deprecated", AT_NO
cmdline_parm deprecated_sndpreload_arg("-snd_preload", "Deprecated", AT_NONE);
cmdline_parm deprecated_missile_lighting_arg("-missile_lighting", "Deprecated", AT_NONE);
cmdline_parm deprecated_cache_bitmaps_arg("-cache_bitmaps", "Deprecated", AT_NONE);
cmdline_parm deprecated_no_emissive_arg("-no_emissive_light", "Deprecated", AT_NONE);
cmdline_parm deprecated_postprocess_arg("-post_process", "Deprecated", AT_NONE);
int Cmdline_deprecated_spec = 0;
int Cmdline_deprecated_glow = 0;
@@ -536,6 +548,7 @@ int Cmdline_deprecated_nohtl = 0;
bool Cmdline_deprecated_brief_lighting = 0;
bool Cmdline_deprecated_missile_lighting = false;
bool Cmdline_deprecated_cache_bitmaps = false;
bool Cmdline_deprecated_postprocess = false;
#ifndef NDEBUG
// NOTE: this assumes that os_init() has already been called but isn't a fatal error if it hasn't
@@ -610,6 +623,10 @@ void cmdline_debug_print_cmdline()
if (Cmdline_deprecated_cache_bitmaps) {
mprintf(("Deprecated flag '-cache_bitmaps' found. Please remove from your cmdline.\n"));
}
if (Cmdline_deprecated_postprocess) {
mprintf(("Deprecated flag '-post_process' found. Please remove from your cmdline.\n"));
}
}
#endif
@@ -914,11 +931,11 @@ void os_process_cmdline(char* cmdline)
delete[] argv;
}
bool has_cmdline_only_flag(int argc, char *argv[])
bool has_cmdline_only_or_get_flags(int argc, char *argv[])
{
for (int i = 0; i < argc; ++i)
{
if (!strcmp(argv[i], PARSE_COMMAND_LINE_STRING))
if (!strcmp(argv[i], PARSE_COMMAND_LINE_STRING) || !strcmp(argv[i], GET_FLAGS_STRING))
{
return true;
}
@@ -950,7 +967,9 @@ void os_init_cmdline(int argc, char *argv[])
FILE *fp;
if (!has_cmdline_only_flag(argc, argv)) {
// Don't parse any command-line config files if we specified PARSE_COMMAND_LINE_STRING (to explicitly prevent it),
// or GET_FLAGS_STRING (because the engine is going to do a quick exit and for GitHub issue #1221)
if (!has_cmdline_only_or_get_flags(argc, argv)) {
// Only parse the config file in the current directory if we are in legacy config mode
if (os_is_legacy_mode()) {
// read the cmdline_fso.cfg file from the data folder, and pass the command line arguments to
@@ -1015,7 +1034,7 @@ void os_init_cmdline(int argc, char *argv[])
fclose(fp);
}
}
} // If cmdline included PARSE_COMMAND_LINE_STRING
} // If cmdline included PARSE_COMMAND_LINE_STRING or GET_FLAGS_STRING
// By parsing cmdline last, anything actually on the command line will take precedence.
os_parse_parms(argc, argv);
@@ -1031,7 +1050,7 @@ void os_init_cmdline(int argc, char *argv[])
* @param arg_type_ parameters arguement type (if any)
* @param stacks_ can the parameter be stacked
*/
cmdline_parm::cmdline_parm(const char *name_, const char *help_, const int arg_type_, const bool stacks_):
cmdline_parm::cmdline_parm(const char *name_, const char *help_, const int arg_type_, const bool stacks_) noexcept:
name(name_), help(help_), stacks(stacks_), arg_type(arg_type_)
{
args = NULL;
@@ -1054,7 +1073,7 @@ cmdline_parm::cmdline_parm(const char *name_, const char *help_, const int arg_t
// destructor - frees any allocated memory
cmdline_parm::~cmdline_parm()
cmdline_parm::~cmdline_parm() noexcept
{
#ifndef FRED
if (args) {
@@ -1460,7 +1479,7 @@ static void write_flags_file() {
}
static flag_output_type get_flags_output_type() {
Assertion(get_flags_arg.found(), "This function is only valid if -get_flags is present!");
Assertion(get_flags_arg.found(), "This function is only valid if " GET_FLAGS_STRING " is present!");
if (!get_flags_arg.has_param()) {
// Default to binary mode
@@ -1535,24 +1554,6 @@ bool SetCmdlineParams()
Cmdline_extra_warn = 1;
}
if ( missioncrcspew_arg.found() ) {
Cmdline_spew_mission_crcs = missioncrcspew_arg.str();
// strip off blank space at end if it's there
if ( Cmdline_spew_mission_crcs[strlen(Cmdline_spew_mission_crcs)-1] == ' ' ) {
Cmdline_spew_mission_crcs[strlen(Cmdline_spew_mission_crcs)-1] = '\0';
}
}
if ( tablecrcspew_arg.found() ) {
Cmdline_spew_table_crcs = tablecrcspew_arg.str();
// strip off blank space at end if it's there
if ( Cmdline_spew_table_crcs[strlen(Cmdline_spew_table_crcs)-1] == ' ' ) {
Cmdline_spew_table_crcs[strlen(Cmdline_spew_table_crcs)-1] = '\0';
}
}
if (!Fred_running) { //There is no standalone FRED
// is this a standalone server??
if (standalone_arg.found()) {
@@ -1643,6 +1644,11 @@ bool SetCmdlineParams()
Cmdline_network_port = port_arg.get_int();
}
// get IP address of gateway, for auto port forwarding
if ( gateway_ip_arg.found() ) {
Cmdline_gateway_ip = gateway_ip_arg.str();
}
// the connect argument specifies to join a game at this particular address
if ( connect_arg.found() ) {
Cmdline_use_last_pilot = 1;
@@ -1665,6 +1671,11 @@ bool SetCmdlineParams()
Cmdline_spew_pof_info = 1;
}
// spew weapon stats
if (weapon_spew.found()) {
Cmdline_spew_weapon_stats = true;
}
// mouse coords
if(mouse_coords.found()){
Cmdline_mouse_coords = 1;
@@ -1825,11 +1836,8 @@ bool SetCmdlineParams()
if ( stretch_menu.found() ) {
Cmdline_stretch_menu = 1;
}
// specular comand lines
if ( spec_exp_arg.found() ) {
specular_exponent_value = spec_exp_arg.get_float();
}
// specular comand lines
if ( spec_point_arg.found() ) {
static_point_factor = spec_point_arg.get_float();
}
@@ -1864,24 +1872,41 @@ bool SetCmdlineParams()
if ( height_arg.found() ) {
Cmdline_height = 0;
}
if (fxaa_arg.found() ) {
Gr_aa_mode = AntiAliasMode::FXAA_Medium;
if (fxaa_preset_arg.found()) {
auto val = fxaa_preset_arg.get_int();
if (val > 6) {
Gr_aa_mode = AntiAliasMode::FXAA_High;
} else if (val > 3) {
Gr_aa_mode = AntiAliasMode::FXAA_Medium;
} else {
if (post_process_aa_arg.found() || post_process_aa_preset_arg.found()) {
Gr_aa_mode = AntiAliasMode::SMAA_Low;
if (post_process_aa_preset_arg.found()) {
switch (post_process_aa_preset_arg.get_int()) {
case 0:
Gr_aa_mode = AntiAliasMode::FXAA_Low;
break;
case 1:
Gr_aa_mode = AntiAliasMode::FXAA_Medium;
break;
case 2:
Gr_aa_mode = AntiAliasMode::FXAA_High;
break;
case 3:
Gr_aa_mode = AntiAliasMode::SMAA_Low;
break;
case 4:
Gr_aa_mode = AntiAliasMode::SMAA_Medium;
break;
case 5:
Gr_aa_mode = AntiAliasMode::SMAA_High;
break;
case 6:
Gr_aa_mode = AntiAliasMode::SMAA_Ultra;
break;
}
}
Gr_aa_mode_last_frame = Gr_aa_mode;
}
// If any of the AA presets were chosen, update the _last_frame AA mode to avoid an unnecessary
// shader recompile.
Gr_aa_mode_last_frame = Gr_aa_mode;
if ( glow_arg.found() )
Cmdline_glow = 0;
@@ -1904,6 +1929,9 @@ bool SetCmdlineParams()
if ( output_scripting_arg.found() )
Output_scripting_meta = true;
if (output_script_json_arg.found() )
Output_scripting_json = true;
if (output_sexp_arg.found() ) {
Cmdline_output_sexp_info = true;
}
@@ -1977,14 +2005,8 @@ bool SetCmdlineParams()
Cmdline_no_fbo = 1;
}
if ( noemissive_arg.found() ) {
Cmdline_no_emissive = 1;
}
if ( ogl_spec_arg.found() ) {
Cmdline_ogl_spec = ogl_spec_arg.get_float();
CLAMP(Cmdline_ogl_spec, 0.0f, 128.0f);
if ( emissive_arg.found() ) {
Cmdline_emissive = 1;
}
if ( rearm_timer_arg.found() )
@@ -2024,9 +2046,9 @@ bool SetCmdlineParams()
Gr_framebuffer_effects.set(FramebufferEffects::Thrusters, true);
}
if ( postprocess_arg.found() )
if ( no_postprocess_arg.found() )
{
Gr_post_processing_enabled = true;
Gr_post_processing_enabled = false;
}
if ( bloom_intensity_arg.found() )
@@ -2118,6 +2140,14 @@ bool SetCmdlineParams()
Cmdline_debug_window = true;
}
if (graphics_debug_output_arg.found()) {
Cmdline_graphics_debug_output = true;
}
if (log_to_stdout_arg.found()) {
Cmdline_log_to_stdout = true;
}
if (show_video_info.found())
{
Cmdline_show_video_info = true;
@@ -2173,6 +2203,53 @@ bool SetCmdlineParams()
Cmdline_deprecated_cache_bitmaps = true;
}
if (deprecated_no_emissive_arg.found()) {
Cmdline_emissive = 0;
}
if (deprecated_postprocess_arg.found()) {
Cmdline_deprecated_postprocess = true;
}
if (deprecated_fxaa_arg.found() ) {
Gr_aa_mode = AntiAliasMode::FXAA_Medium;
if (deprecated_fxaa_preset_arg.found()) {
auto val = deprecated_fxaa_preset_arg.get_int();
if (val > 6) {
Gr_aa_mode = AntiAliasMode::FXAA_High;
} else if (val > 3) {
Gr_aa_mode = AntiAliasMode::FXAA_Medium;
} else {
Gr_aa_mode = AntiAliasMode::FXAA_Low;
}
}
}
if (deprecated_smaa_arg.found()) {
Gr_aa_mode = AntiAliasMode::SMAA_Medium;
if (deprecated_smaa_preset_arg.found()) {
switch (deprecated_smaa_preset_arg.get_int()) {
case 0:
Gr_aa_mode = AntiAliasMode::SMAA_Low;
break;
case 1:
Gr_aa_mode = AntiAliasMode::SMAA_Medium;
break;
case 2:
Gr_aa_mode = AntiAliasMode::SMAA_High;
break;
case 3:
Gr_aa_mode = AntiAliasMode::SMAA_Ultra;
break;
default:
Gr_aa_mode = AntiAliasMode::SMAA_Ultra;
break;
}
}
}
return true;
}
+6 -5
View File
@@ -53,9 +53,7 @@ extern char *Cmdline_center_res;
// FSO OPTIONS -------------------------------------------------
// Graphics related
extern double specular_exponent_value;
extern float Cmdline_clip_dist;
extern float Cmdline_ogl_spec;
extern float static_light_factor;
extern float static_point_factor;
extern float static_tube_factor;
@@ -70,7 +68,7 @@ extern int Cmdline_enable_3d_shockwave;
extern int Cmdline_softparticles;
extern int Cmdline_bloom_intensity;
extern int Cmdline_no_deferred_lighting;
extern int Cmdline_no_emissive;
extern int Cmdline_emissive;
extern int Cmdline_aniso_level;
// Game Speed related
@@ -102,9 +100,8 @@ extern char *Cmdline_mod; // DTP for mod support
extern char *Cmdline_almission; // DTP for autoload mission (for multi only)
extern int Cmdline_ingamejoin;
extern int Cmdline_mpnoreturn;
extern char *Cmdline_spew_mission_crcs;
extern char *Cmdline_spew_table_crcs;
extern int Cmdline_objupd;
extern char *Cmdline_gateway_ip;
// Launcher related options
extern bool Cmdline_portable_mode;
@@ -150,5 +147,9 @@ extern bool Cmdline_json_profiling;
extern bool Cmdline_frame_profile;
extern bool Cmdline_show_video_info;
extern bool Cmdline_debug_window;
extern bool Cmdline_graphics_debug_output;
extern bool Cmdline_log_to_stdout;
extern bool Cmdline_spew_weapon_stats;
#endif
+8 -4
View File
@@ -516,7 +516,9 @@ void control_config_list_prepare()
Num_cc_lines = y = z = 0;
while (z < CCFG_MAX) {
if (Control_config[z].tab == Tab && !Control_config[z].disabled) {
if (Control_config[z].hasXSTR) {
if (Control_config[z].indexXSTR > 1) {
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, Control_config[z].indexXSTR);
} else if (Control_config[z].indexXSTR == 1) {
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
} else {
Cc_lines[Num_cc_lines].label = Control_config[z].text;
@@ -999,7 +1001,7 @@ void control_config_reset_defaults(int presetnum)
Control_config[i].key_id = preset[i].key_default;
Control_config[i].joy_id = preset[i].joy_default;
Control_config[i].tab = preset[i].tab;
Control_config[i].hasXSTR = preset[i].hasXSTR;
Control_config[i].indexXSTR = preset[i].indexXSTR;
Control_config[i].type = preset[i].type;
Control_config[i].disabled = preset[i].disabled;
}
@@ -1982,7 +1984,9 @@ void control_config_do_frame(float frametime)
gr_get_string_size(&w, NULL, str);
gr_printf_menu(x - w / 2, y - font_height, "%s", str);
if (Control_config[i].hasXSTR) {
if (Control_config[i].indexXSTR > 1) {
strcpy_s(buf, XSTR(Control_config[i].text, Control_config[i].indexXSTR));
} else if (Control_config[i].indexXSTR == 1) {
strcpy_s(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
} else {
strcpy_s(buf, Control_config[i].text);
@@ -2300,7 +2304,7 @@ int check_control_used(int id, int key)
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) ||
((Control_config[id].joy_id >= 0) && (Control_config[id].joy_id < MOUSE_NUM_BUTTONS) && mouse_down_count(1 << Control_config[id].joy_id))) {
//mprintf(("Key used %d", key));
//mprintf(("Key used %d\n", key));
control_used(id);
return 1;
}
+10 -1
View File
@@ -62,7 +62,7 @@ typedef struct config_item {
short key_default; //!< default key bound to action
short joy_default; //!< default joystick button bound to action
char tab; //!< what tab (category) it belongs in
bool hasXSTR; //!< whether we should translate this with an XSTR
int indexXSTR; //!< what string index we should use to translate this with an XSTR
const char *text; //!< describes the action in the config screen
char type; //!< manner control should be checked in
short key_id; //!< actual key bound to action
@@ -270,6 +270,15 @@ enum IoActionId {
//!< ----------------------------
CYCLE_PRIMARY_WEAPON_SEQUENCE =118, //!< cycle num primaries to fire at once
//!< @n
//!< Custom control slots
//!< ----------------------------
CUSTOM_CONTROL_1 = 119,
CUSTOM_CONTROL_2 = 120,
CUSTOM_CONTROL_3 = 121,
CUSTOM_CONTROL_4 = 122,
CUSTOM_CONTROL_5 = 123,
/*!
* This must always be below the last defined item
*/
+149 -123
View File
@@ -17,6 +17,7 @@
#include "io/joy.h"
#include "io/key.h"
#include "localization/localize.h"
#include "options/Option.h"
#include "parse/parselo.h"
// z64: These enumerations MUST equal to those in controlsconfig.cpp...
@@ -32,8 +33,29 @@ int Failed_key_index;
// Joystick configuration
int Joy_dead_zone_size = 10;
auto DeadZoneOption =
options::OptionBuilder<int>("Input.JoystickDeadZone", "Deadzone", "The deadzone of the selected joystick.")
.category("Input")
.range(0, 45)
.level(options::ExpertLevel::Beginner)
.default_val(10)
.bind_to(&Joy_dead_zone_size)
.importance(1)
.finish();
int Joy_sensitivity = 9;
auto SensitivityOption =
options::OptionBuilder<int>("Input.JoystickSensitivity", "Sensitivity", "The sentitivity of the selected joystick.")
.category("Input")
.range(0, 9)
.level(options::ExpertLevel::Beginner)
.default_val(9)
.bind_to(&Joy_sensitivity)
.importance(2)
.finish();
int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
@@ -42,154 +64,159 @@ int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
//XSTR:OFF
config_item Control_config[CCFG_MAX + 1] = {
// targeting a ship
{ KEY_T, -1, TARGET_TAB, true, "Target Next Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, true, "Target Previous Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_H, 2, TARGET_TAB, true, "Target Next Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, true, "Target Previous Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, true, "Toggle Auto Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_F, -1, TARGET_TAB, true, "Target Next Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, true, "Target Previous Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_Y, 4, TARGET_TAB, true, "Target Ship in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_G, -1, TARGET_TAB, true, "Target Target's Nearest Attacker", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, true, "Target Last Ship to Send Transmission", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, true, "Turn Off Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_T, -1, TARGET_TAB, 1, "Target Next Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, 1, "Target Previous Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_H, 2, TARGET_TAB, 1, "Target Next Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, 1, "Target Previous Closest Hostile Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, 1, "Toggle Auto Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_F, -1, TARGET_TAB, 1, "Target Next Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, 1, "Target Previous Closest Friendly Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_Y, 4, TARGET_TAB, 1, "Target Ship in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_G, -1, TARGET_TAB, 1, "Target Target's Nearest Attacker", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, 1, "Target Last Ship to Send Transmission", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, 1, "Turn Off Targeting", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// targeting a ship's subsystem
{ KEY_V, -1, TARGET_TAB, true, "Target Subsystem in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_S, -1, TARGET_TAB, true, "Target Next Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, true, "Target Previous Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, true, "Turn Off Targeting of Subsystems", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_V, -1, TARGET_TAB, 1, "Target Subsystem in Reticle", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_S, -1, TARGET_TAB, 1, "Target Next Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, 1, "Target Previous Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, 1, "Turn Off Targeting of Subsystems", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// matching speed
{ KEY_M, -1, COMPUTER_TAB, true, "Match Target Speed", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_M, -1, COMPUTER_TAB, 1, "Match Target Speed", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, 1, "Toggle Auto Speed Matching", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// weapons
{ KEY_LCTRL, 0, WEAPON_TAB, true, "Fire Primary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SPACEBAR, 1, WEAPON_TAB, true, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PERIOD, -1, WEAPON_TAB, true, "Cycle Forward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_COMMA, -1, WEAPON_TAB, true, "Cycle Backward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Bank", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_X, 3, WEAPON_TAB, true, "Launch Countermeasure", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_LCTRL, 0, WEAPON_TAB, 1, "Fire Primary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SPACEBAR, 1, WEAPON_TAB, 1, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PERIOD, -1, WEAPON_TAB, 1, "Cycle Forward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_COMMA, -1, WEAPON_TAB, 1, "Cycle Backward Primary Weapon", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_DIVIDE, -1, WEAPON_TAB, 1, "Cycle Secondary Weapon Bank", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, 1, "Cycle Secondary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_X, 3, WEAPON_TAB, 1, "Launch Countermeasure", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// controls
{ KEY_A, -1, SHIP_TAB, true, "Forward Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_Z, -1, SHIP_TAB, true, "Reverse Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD7, -1, SHIP_TAB, true, "Bank Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD9, -1, SHIP_TAB, true, "Bank Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD8, -1, SHIP_TAB, true, "Pitch Forward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD2, -1, SHIP_TAB, true, "Pitch Backward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD4, -1, SHIP_TAB, true, "Turn Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD6, -1, SHIP_TAB, true, "Turn Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_A, -1, SHIP_TAB, 1, "Forward Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_Z, -1, SHIP_TAB, 1, "Reverse Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD7, -1, SHIP_TAB, 1, "Bank Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD9, -1, SHIP_TAB, 1, "Bank Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD8, -1, SHIP_TAB, 1, "Pitch Forward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD2, -1, SHIP_TAB, 1, "Pitch Backward", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD4, -1, SHIP_TAB, 1, "Turn Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD6, -1, SHIP_TAB, 1, "Turn Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
// throttle controls
{ KEY_BACKSP, -1, SHIP_TAB, true, "Set Throttle to Zero", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SLASH, -1, SHIP_TAB, true, "Set Throttle to Max", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_LBRACKET, -1, SHIP_TAB, true, "Set Throttle to One-Third", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_RBRACKET, -1, SHIP_TAB, true, "Set Throttle to Two-Thirds", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_EQUAL, -1, SHIP_TAB, true, "Increase Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_MINUS, -1, SHIP_TAB, true, "Decrease Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_BACKSP, -1, SHIP_TAB, 1, "Set Throttle to Zero", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SLASH, -1, SHIP_TAB, 1, "Set Throttle to Max", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_LBRACKET, -1, SHIP_TAB, 1, "Set Throttle to One-Third", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_RBRACKET, -1, SHIP_TAB, 1, "Set Throttle to Two-Thirds", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_EQUAL, -1, SHIP_TAB, 1, "Increase Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_MINUS, -1, SHIP_TAB, 1, "Decrease Throttle 5 Percent", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// squadmate messaging
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, true, "Attack My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, true, "Disarm My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, true, "Disable My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, true, "Attack My Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, true, "Capture My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Engage Enemy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, true, "Form on My Wing", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, true, "Ignore My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, true, "Protect My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, true, "Cover Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, true, "Return to Base", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, true, "Rearm Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, 1, "Attack My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, 1, "Disarm My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, 1, "Disable My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, 1, "Attack My Subsystem", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, 1, "Capture My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, 1, "Engage Enemy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, 1, "Form on My Wing", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, 1, "Ignore My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, 1, "Protect My Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, 1, "Cover Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, 1, "Return to Base", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, 1, "Rearm Me", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_R, 6, TARGET_TAB, true, "Target Closest Attacking Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_R, 6, TARGET_TAB, 1, "Target Closest Attacking Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// Views
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, true, "Chase View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PADPERIOD, -1, COMPUTER_TAB, true, "External View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PADENTER, -1, COMPUTER_TAB, true, "Toggle External Camera Lock", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PAD0, -1, COMPUTER_TAB, true, "Free Look View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false }, // Not in use anymore (Swifty)
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, true, "Current Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PADPLUS, -1, COMPUTER_TAB, true, "Increase View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PADMINUS, -1, COMPUTER_TAB, true, "Decrease View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD5, -1, COMPUTER_TAB, true, "Center View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 33, COMPUTER_TAB, true, "View Up", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 32, COMPUTER_TAB, true, "View Rear", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 34, COMPUTER_TAB, true, "View Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 35, COMPUTER_TAB, true, "View Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, 1, "Chase View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PADPERIOD, -1, COMPUTER_TAB, 1, "External View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PADENTER, -1, COMPUTER_TAB, 1, "Toggle External Camera Lock", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PAD0, -1, COMPUTER_TAB, 1, "Free Look View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, 1, "Current Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PADPLUS, -1, COMPUTER_TAB, 1, "Increase View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PADMINUS, -1, COMPUTER_TAB, 1, "Decrease View Distance", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_PAD5, -1, COMPUTER_TAB, 1, "Center View", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 33, COMPUTER_TAB, 1, "View Up", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 32, COMPUTER_TAB, 1, "View Rear", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 34, COMPUTER_TAB, 1, "View Left", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, 35, COMPUTER_TAB, 1, "View Right", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, true, "Cycle Radar Range", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_C, -1, COMPUTER_TAB, true, "Communications Menu", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, -1, true, "Show Objectives", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, true, "Enter Subspace (End Mission)", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_J, -1, TARGET_TAB, true, "Target Target's Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_TAB, 5, SHIP_TAB, true, "Afterburner", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, 1, "Cycle Radar Range", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_C, -1, COMPUTER_TAB, 1, "Communications Menu", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, -1, 1, "Show Objectives", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, 1, "Enter Subspace (End Mission)", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_J, -1, TARGET_TAB, 1, "Target Target's Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_TAB, 5, SHIP_TAB, 1, "Afterburner", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_INSERT, -1, COMPUTER_TAB, true, "Increase Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_DELETE, -1, COMPUTER_TAB, true, "Decrease Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_HOME, -1, COMPUTER_TAB, true, "Increase Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_END, -1, COMPUTER_TAB, true, "Decrease Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PAGEUP, -1, COMPUTER_TAB, true, "Increase Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, true, "Decrease Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, true, "Equalize Energy Settings", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_INSERT, -1, COMPUTER_TAB, 1, "Increase Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_DELETE, -1, COMPUTER_TAB, 1, "Decrease Weapon Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_HOME, -1, COMPUTER_TAB, 1, "Increase Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_END, -1, COMPUTER_TAB, 1, "Decrease Shield Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PAGEUP, -1, COMPUTER_TAB, 1, "Increase Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, 1, "Decrease Engine Energy", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, 1, "Equalize Energy Settings", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_Q, 7, COMPUTER_TAB, true, "Equalize Shields", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_UP, -1, COMPUTER_TAB, true, "Augment Forward Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_DOWN, -1, COMPUTER_TAB, true, "Augment Rear Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_LEFT, -1, COMPUTER_TAB, true, "Augment Left Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_RIGHT, -1, COMPUTER_TAB, true, "Augment Right Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Laser->Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Shield->Laser", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_Q, 7, COMPUTER_TAB, 1, "Equalize Shields", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_UP, -1, COMPUTER_TAB, 1, "Augment Forward Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_DOWN, -1, COMPUTER_TAB, 1, "Augment Rear Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_LEFT, -1, COMPUTER_TAB, 1, "Augment Left Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_RIGHT, -1, COMPUTER_TAB, 1, "Augment Right Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, 1, "Transfer Energy Laser->Shield", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, 1, "Transfer Energy Shield->Laser", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// { -1, -1, -1, true, "Show Damage Popup Window" },
{ -1, -1, SHIP_TAB, false, "Glide When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, -1, SHIP_TAB, 0, "Glide When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
//Backslash -- this was a convenient place for Glide When Pressed, as Show Damage Popup isn't used
{ -1, -1, SHIP_TAB, true, "Bank When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, -1, -1, true, "Show Nav Map", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, true, "Add or Remove Escort", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Clear Escort List", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_E, -1, TARGET_TAB, true, "Target Next Escort Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, true, "Target Closest Repair Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, SHIP_TAB, 1, "Bank When Pressed", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ -1, -1, -1, 1, "Show Nav Map", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, 1, "Add or Remove Escort", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, 1, "Clear Escort List", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_E, -1, TARGET_TAB, 1, "Target Next Escort Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, 1, "Target Closest Repair Ship", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_U, -1, TARGET_TAB, true, "Target Next Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, true, "Target Previous Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_N, -1, TARGET_TAB, true, "Target Newest Ship in Area", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_K, -1, TARGET_TAB, true, "Target Next Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, true, "Target Previous Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_U, -1, TARGET_TAB, 1, "Target Next Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, 1, "Target Previous Uninspected Cargo", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_N, -1, TARGET_TAB, 1, "Target Newest Ship in Area", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_K, -1, TARGET_TAB, 1, "Target Next Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, 1, "Target Previous Live Turret", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_B, -1, TARGET_TAB, true, "Target Next Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_B, -1, TARGET_TAB, 1, "Target Next Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, 1, "Target Previous Hostile Bomb or Bomber", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// multiplayer messaging keys
{ KEY_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, true, "(Multiplayer) Observer Zoom to Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, true, "Increase Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, true, "Decrease Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_L, -1, COMPUTER_TAB, true, "Toggle High HUD Contrast", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, true, "(Multiplayer) Toggle Network Info", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, true, "(Multiplayer) Self Destruct", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_1, -1, COMPUTER_TAB, 1, "(Multiplayer) Message All", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_2, -1, COMPUTER_TAB, 1, "(Multiplayer) Message Friendly", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_3, -1, COMPUTER_TAB, 1, "(Multiplayer) Message Hostile", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_4, -1, COMPUTER_TAB, 1, "(Multiplayer) Message Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, 1, "(Multiplayer) Observer Zoom to Target", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, 1, "Increase Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, 1, "Decrease Time Compression", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_L, -1, COMPUTER_TAB, 1, "Toggle High HUD Contrast", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, 1, "(Multiplayer) Toggle Network Info", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, 1, "(Multiplayer) Self Destruct", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
// Misc
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, true, "Toggle HUD", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, true, "Right Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, true, "Left Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, true, "Up Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, true, "Down Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, true, "Toggle HUD Wireframe Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, COMPUTER_TAB, false, "Top-Down View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, COMPUTER_TAB, false, "Target Padlock View", CC_TYPE_TRIGGER, -1, -1, 0, false, false }, // (Swifty) Toggle for VM_TRACK
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, 1, "Toggle HUD", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, 1, "Right Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, 1, "Left Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, 1, "Up Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, 1, "Down Thrust", CC_TYPE_CONTINUOUS, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, 1, "Toggle HUD Wireframe Target View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, COMPUTER_TAB, 0, "Top-Down View", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, COMPUTER_TAB, 0, "Target Padlock View", CC_TYPE_TRIGGER, -1, -1, 0, false, false }, // (Swifty) Toggle for VM_TRACK
// Auto Navigation Systen
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, false, "Toggle Gliding", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_O, -1, WEAPON_TAB, false, "Cycle Primary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ -1, -1, -1, false, "", CC_TYPE_TRIGGER, -1, -1, 0, false, false }
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, 0, "Toggle Auto Pilot", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, 0, "Cycle Nav Points", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, 0, "Toggle Gliding", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_O, -1, WEAPON_TAB, 0, "Cycle Primary Weapon Firing Rate", CC_TYPE_TRIGGER, -1, -1, 0, false, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_1, -1, COMPUTER_TAB, 0, "Custom Control 1", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_2, -1, COMPUTER_TAB, 0, "Custom Control 2", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_3, -1, COMPUTER_TAB, 0, "Custom Control 3", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_4, -1, COMPUTER_TAB, 0, "Custom Control 4", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
{ KEY_ALTED | KEY_SHIFTED | KEY_5, -1, COMPUTER_TAB, 0, "Custom Control 5", CC_TYPE_TRIGGER, -1, -1, 0, true, false },
{ -1, -1, -1, 0, "", CC_TYPE_TRIGGER, -1, -1, 0, false, false }
};
const char *Scan_code_text_german[] = {
@@ -586,7 +613,6 @@ void control_config_common_load_overrides();
void control_config_common_init()
{
for (int i=0; i<CCFG_MAX; i++) {
Control_config[i].disabled = false;
Control_config[i].continuous_ongoing = false;
}
@@ -843,7 +869,7 @@ void control_config_common_load_overrides()
* short key_default;
* short joy_default;
* char tab;
* bool hasXSTR;
* int indexXSTR;
* char type;
*/
@@ -885,7 +911,7 @@ void control_config_common_load_overrides()
if (optional_string("$Has XStr:")) {
stuff_int(&iTemp);
r_ccConfig.hasXSTR = (iTemp == 1);
r_ccConfig.indexXSTR = iTemp;
}
if (optional_string("$Type:")) {
+18 -9
View File
@@ -83,24 +83,33 @@ void cutscene_init()
if (optional_string("$cd:"))
{
// Option isn't needed anymore. Consume the token and ignore it
// CD option isn't needed anymore. Consume the token and ignore it
int junk;
stuff_int(&junk);
}
cutinfo.viewable = false;
cutinfo.flags.reset();
if (isFirstCutscene)
{
isFirstCutscene = false;
// The original code assumes the first movie is the intro, so always viewable
cutinfo.viewable = true;
// The original code assumes the first movie is the intro, so make it viewable
cutinfo.flags.set(Cutscene::Cutscene_Flags::Viewable);
}
if (optional_string("$Always Viewable:"))
{
stuff_boolean(&cutinfo.viewable);
bool flag;
stuff_boolean(&flag);
if (flag)
cutinfo.flags.set(Cutscene::Cutscene_Flags::Always_viewable);
}
if (optional_string("$Never Viewable:"))
{
bool flag;
stuff_boolean(&flag);
if (flag)
cutinfo.flags.set(Cutscene::Cutscene_Flags::Never_viewable);
}
Cutscenes.push_back(cutinfo);
@@ -143,7 +152,7 @@ void cutscene_mark_viewable(const char* filename)
// see if the stripped filename matches the cutscene filename
if (strstr(cut_file, file) != NULL)
{
cut->viewable = true;
cut->flags.set(Cutscene::Cutscene_Flags::Viewable);
return;
}
i++;
@@ -441,9 +450,9 @@ void cutscenes_screen_init()
Cutscene_list.clear();
int u = 0;
for (SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut, u++)
for (auto cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut, ++u)
{
if ((*cut).viewable)
if (cut->flags[Cutscene::Cutscene_Flags::Viewable, Cutscene::Cutscene_Flags::Always_viewable] && !cut->flags[Cutscene::Cutscene_Flags::Never_viewable])
{
Cutscene_list.push_back(u);
}
+14 -1
View File
@@ -10,15 +10,28 @@
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#include "globalincs/flagset.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
namespace Cutscene
{
FLAG_LIST(Cutscene_Flags)
{
Viewable = 0,
Always_viewable,
Never_viewable,
NUM_VALUES
};
}
typedef struct cutscene_info
{
char filename[MAX_FILENAME_LEN];
char name[NAME_LENGTH];
char* description;
bool viewable;
flagset<Cutscene::Cutscene_Flags> flags;
} cutscene_info;
extern SCP_vector<cutscene_info> Cutscenes;
+1 -1
View File
@@ -126,7 +126,7 @@ void AudioDecoder::handleDecodedFrame(AVFrame* frame) {
auto ret = av_samples_alloc(m_outData, &m_outLinesize, OUT_NUM_CHANNELS, m_outNumSamples,
OUT_SAMPLE_FORMAT, 1);
if (ret < 0) {
mprintf(("FFMPEG: Failed to allocate samples!!!"));
mprintf(("FFMPEG: Failed to allocate samples!!!\n"));
return;
}
+2 -2
View File
@@ -286,7 +286,7 @@ std::unique_ptr<DecoderStatus> initializeStatus(std::unique_ptr<InputStream>& st
if (status->subtitleStream == nullptr) {
// We don't have an external subtitle stream or loading from that file has failed
auto& current_language = Lcl_languages[Lcl_current_lang];
auto& current_language = Lcl_languages[Lcl_current_lang == LCL_UNTRANSLATED ? LCL_DEFAULT : Lcl_current_lang];
for (uint32_t i = 0; i < ctx->nb_streams; ++i) {
auto test_stream = ctx->streams[i];
@@ -428,7 +428,7 @@ std::unique_ptr<InputStream> openInputStream(const SCP_string& name) {
std::unique_ptr<InputStream> openSubtitleStream(const SCP_string& name)
{
auto& current_language = Lcl_languages[Lcl_current_lang];
auto& current_language = Lcl_languages[Lcl_current_lang == LCL_UNTRANSLATED ? LCL_DEFAULT : Lcl_current_lang];
for (auto ext : CHECKED_SUBT_EXTENSIONS) {
SCP_string fileName;
+3 -1
View File
@@ -27,13 +27,15 @@ using namespace cutscene;
const int MAX_AUDIO_BUFFERS = 15;
std::unique_ptr<Decoder> findDecoder(const SCP_string& name, const PlaybackProperties& properties) {
std::unique_ptr<Decoder> findDecoder(__UNUSED const SCP_string& name, __UNUSED const PlaybackProperties& properties) {
#ifdef WITH_FFMPEG
{
std::unique_ptr<Decoder> ffmpeg(new ::cutscene::ffmpeg::FFMPEGDecoder());
if (ffmpeg->initialize(name, properties)) {
return ffmpeg;
}
}
#endif
return nullptr;
}
+5 -4
View File
@@ -240,11 +240,12 @@ void debris_process_post(object * obj, float frame_time)
MONITOR_INC(NumSmallDebris,1);
}
if ( db->lifeleft >= 0.0f) {
if (db->lifeleft >= 0.0f) {
db->lifeleft -= frame_time;
if ( db->lifeleft < 0.0f ) {
debris_start_death_roll(obj, db);
}
}
if ( db->lifeleft < 0.0f ) {
debris_start_death_roll(obj, db);
}
maybe_delete_debris(db); // Make this debris go away if it's very far away.
+1 -2
View File
@@ -468,10 +468,9 @@ void renderAll() {
return;
}
graphics::decal_draw_list draw_list;
auto mission_time = f2fl(Missiontime);
graphics::decal_draw_list draw_list(active_decals.size());
for (auto& decal : active_decals) {
int diffuse_bm = -1;
int glow_bm = -1;
File diff suppressed because it is too large. Load diff
+7 -1
View File
@@ -3,9 +3,15 @@
in vec4 fragTexCoord;
in vec4 fragColor;
out vec4 fragOut0;
uniform sampler2DArray baseMap;
uniform float intensity;
layout (std140) uniform genericData {
vec4 color;
float intensity;
};
void main()
{
+12 -3
View File
@@ -1,11 +1,20 @@
in vec4 vertPosition;
in vec4 vertTexCoord;
in vec4 vertColor;
out vec4 fragTexCoord;
out vec4 fragColor;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
uniform vec4 color;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
layout (std140) uniform genericData {
vec4 color;
float intensity;
};
void main()
{
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
+10 -3
View File
@@ -1,8 +1,15 @@
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2D bloomed;
uniform float bloom_intensity;
uniform int levels;
layout (std140) uniform genericData {
float bloom_intensity;
int levels;
};
void main() {
vec4 color_out = vec4(0.0, 0.0, 0.0, 1.0);
float factor = 0.0;
@@ -14,4 +21,4 @@ void main() {
color_out.rgb /= factor;
color_out.rgb *= bloom_intensity;
fragOut0 = color_out;
}
}
+15 -8
View File
@@ -1,9 +1,16 @@
out vec4 fragOut0;
uniform float texSize;
uniform float tapSize;
uniform int level;
in vec4 fragTexCoord;
uniform sampler2D tex;
const float TapSize = 1.0;
layout (std140) uniform genericData {
float texSize;
int level;
};
// Gaussian Blur
// 2 passes required
void main()
@@ -20,15 +27,15 @@ void main()
vec4 sum = textureLod(tex, fragTexCoord.xy, float(level)) * BlurWeights[0];
#ifdef PASS_0
for (int i = 1; i < 6; i++) {
sum += textureLod(tex, vec2(clamp(fragTexCoord.x - float(i) * (texSize) * tapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
sum += textureLod(tex, vec2(clamp(fragTexCoord.x + float(i) * (texSize) * tapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
sum += textureLod(tex, vec2(clamp(fragTexCoord.x - float(i) * (texSize) * TapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
sum += textureLod(tex, vec2(clamp(fragTexCoord.x + float(i) * (texSize) * TapSize, 0.0, 1.0), fragTexCoord.y), float(level)) * BlurWeights[i];
}
#endif
#ifdef PASS_1
for (int i = 1; i < 6; i++) {
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y - float(i) * (texSize) * tapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y + float(i) * (texSize) * tapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y - float(i) * (texSize) * TapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
sum += textureLod(tex, vec2(fragTexCoord.x, clamp(fragTexCoord.y + float(i) * (texSize) * TapSize, 0.0, 1.0)), float(level)) * BlurWeights[i];
}
#endif
fragOut0 = sum;
}
}
@@ -6,12 +6,23 @@ in vec4 fragColor;
out vec4 fragOut0;
uniform sampler2DArray baseMap;
uniform int baseMapIndex;
uniform int alphaTexture;
uniform int noTexturing;
uniform int srgb;
uniform float intensity;
uniform float alphaThreshold;
layout (std140) uniform genericData {
mat4 modelMatrix;
vec4 color;
vec4 clipEquation;
int baseMapIndex;
int alphaTexture;
int noTexturing;
int srgb;
float intensity;
float alphaThreshold;
bool clipEnabled;
};
void main()
{
@@ -0,0 +1,38 @@
in vec4 vertPosition;
in vec4 vertTexCoord;
in vec4 vertColor;
out vec4 fragTexCoord;
out vec4 fragColor;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
layout (std140) uniform genericData {
mat4 modelMatrix;
vec4 color;
vec4 clipEquation;
int baseMapIndex;
int alphaTexture;
int noTexturing;
int srgb;
float intensity;
float alphaThreshold;
bool clipEnabled;
};
void main()
{
fragTexCoord = vertTexCoord;
fragColor = vertColor * color;
gl_Position = projMatrix * modelViewMatrix * vertPosition;
if (clipEnabled) {
gl_ClipDistance[0] = dot(clipEquation, modelMatrix * vertPosition);
}
}
@@ -24,7 +24,6 @@ layout (std140) uniform globalDeferredData {
float middist;
float fardist;
float specFactor;
float invScreenWidth;
float invScreenHeight;
};
+5 -2
View File
@@ -2,8 +2,11 @@
#include "lighting.sdr"
in vec4 vertPosition;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
layout (std140) uniform lightData {
vec3 diffuseLightColor;
@@ -1,13 +1,20 @@
in vec4 fragTexCoord;
in vec4 fragColor;
in float fragOffset;
out vec4 fragOut0;
uniform sampler2DArray baseMap;
uniform sampler2D depthMap;
uniform float window_width;
uniform float window_height;
uniform sampler2D distMap;
uniform sampler2D frameBuffer;
layout (std140) uniform genericData {
float window_width;
float window_height;
float use_offset;
};
void main()
{
vec2 depthCoord = vec2(gl_FragCoord.x / window_width, gl_FragCoord.y / window_height);
@@ -5,9 +5,18 @@ in float vertRadius;
out vec4 fragTexCoord;
out vec4 fragColor;
out float fragOffset;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
uniform float use_offset;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
layout (std140) uniform genericData {
float window_width;
float window_height;
float use_offset;
};
void main()
{
gl_Position = projMatrix * modelViewMatrix * vertPosition;
@@ -1,21 +1,27 @@
#include "gamma.sdr"
uniform sampler2DArray baseMap;
uniform sampler2D depthMap;
uniform float window_width;
uniform float window_height;
uniform float nearZ;
uniform float farZ;
uniform int linear_depth;
uniform int srgb;
uniform int blend_alpha;
in float fragRadius;
in vec4 fragPosition;
in vec4 fragTexCoord;
in vec4 fragColor;
out vec4 fragOut0;
uniform sampler2DArray baseMap;
uniform sampler2D depthMap;
layout (std140) uniform genericData {
float window_width;
float window_height;
float nearZ;
float farZ;
int linear_depth;
int srgb;
int blend_alpha;
};
void main()
{
vec4 fragmentColor = texture(baseMap, fragTexCoord.xyz);
@@ -39,7 +45,7 @@ void main()
fragDepthLinear = ( 2.0 * farZ * nearZ ) / ( farZ + nearZ - gl_FragCoord.z * (farZ-nearZ) );
}
// assume UV of 0.5, 0.5 is the centroid of this sphere volume
float depthOffset = sqrt(pow(fragRadius, 2.0) - pow(offset_len, 2.0));
float depthOffset = sqrt((fragRadius*fragRadius) - (offset_len*offset_len));
float frontDepth = fragDepthLinear - depthOffset;
float backDepth = fragDepthLinear + depthOffset;
float intensity = smoothstep(max(nearZ, frontDepth), backDepth, sceneDepthLinear);
@@ -1,14 +1,21 @@
layout (points) in;
layout (triangle_strip, max_vertices = 4) out;
in vec3 geoUvec[];
in float geoRadius[];
in vec4 geoColor[];
in float geoArrayIndex[];
out float fragRadius;
out vec4 fragPosition;
out vec4 fragTexCoord;
out vec4 fragColor;
uniform mat4 projMatrix;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
void main(void)
{
vec3 forward_vec = vec3(0.0, 0.0, 1.0);
+21 -22
View File
@@ -1,7 +1,9 @@
in vec4 vertPosition;
in vec4 vertTexCoord;
in vec4 vertColor;
in float vertRadius;
#ifdef FLAG_EFFECT_GEOMETRY
in vec3 vertUvec;
out vec3 geoUvec;
@@ -14,28 +16,25 @@ in float vertRadius;
out vec4 fragTexCoord;
out vec4 fragColor;
#endif
#ifdef FLAG_EFFECT_DISTORTION
out float fragOffset;
uniform float use_offset;
#endif
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
void main()
{
#ifdef FLAG_EFFECT_GEOMETRY
geoRadius = vertRadius;
geoUvec = vertUvec;
gl_Position = modelViewMatrix * vertPosition;
geoColor = vertColor;
geoArrayIndex = vertTexCoord.z;
#else
fragRadius = vertRadius;
gl_Position = projMatrix * modelViewMatrix * vertPosition;
fragPosition = modelViewMatrix * vertPosition;
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
fragColor = vertColor;
#endif
#ifdef FLAG_EFFECT_DISTORTION
fragOffset = vertRadius * use_offset;
#endif
#ifdef FLAG_EFFECT_GEOMETRY
geoRadius = vertRadius;
geoUvec = vertUvec;
gl_Position = modelViewMatrix * vertPosition;
geoColor = vertColor;
geoArrayIndex = vertTexCoord.z;
#else
fragRadius = vertRadius;
gl_Position = projMatrix * modelViewMatrix * vertPosition;
fragPosition = modelViewMatrix * vertPosition;
fragTexCoord = vec4(vertTexCoord.xyz, 0.0);
fragColor = vertColor;
#endif
}
+10 -6
View File
@@ -2,16 +2,20 @@
#include "gamma.sdr"
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2D tex;
uniform sampler2D depth_tex;
uniform float fog_start;
uniform float fog_scale;
uniform vec3 fog_color;
uniform float zNear;
uniform float zFar;
layout (std140) uniform genericData {
vec3 fog_color;
float fog_start;
float fog_scale;
float zNear;
float zFar;
};
void main()
{
@@ -20,7 +24,7 @@ void main()
// If the scene is in fog then we change the color we operate on based on the depth of the pixel
float depth_val = texture(depth_tex, fragTexCoord.xy).x;
// Transform depth value from [-1, 1] to [0, 1]
float depth_normalized = 2.0 * depth_val - 1.0;
float depth_normalized = fma(depth_val, 0.5, 0.5);
// Now we compute the depth value in projection space using the clipping plane information
float view_depth = 2.0 * zNear * zFar / (zFar + zNear - depth_normalized * (zFar - zNear));
+7 -2
View File
@@ -1,9 +1,14 @@
in vec4 vertPosition;
uniform float rt_w;
uniform float rt_h;
out vec2 v_rcpFrame;
noperspective out vec2 v_pos;
layout (std140) uniform genericData {
float rt_w;
float rt_h;
};
void main() {
gl_Position = vertPosition;
v_rcpFrame = vec2(1.0/rt_w, 1.0/rt_h);
+2 -2
View File
@@ -8,7 +8,7 @@ const float SPEC_INTENSITY_POINT = 5.3 ;// Point light
const float SPEC_INTENSITY_DIRECTIONAL = 3.0 ;// Directional light
const float SPECULAR_FACTOR = 1.75;
const float SPECULAR_ALPHA = 0.1;
const float SPEC_FACTOR_NO_SPEC_MAP = 0.6;
const float SPEC_FACTOR_NO_SPEC_MAP = 0.1;
const float ENV_ALPHA_FACTOR = 0.3;
const float GLOW_MAP_INTENSITY = 1.5;
const float AMBIENT_LIGHT_BOOST = 1.0;
@@ -55,4 +55,4 @@ vec3 computeLighting(vec3 specColor, vec3 light, vec3 normal, vec3 halfVec, vec3
#else
return SpecularGGX(specColor, light, normal, halfVec, view, gloss, fresnelFactor, dotNL);
#endif
}
}
+14 -7
View File
@@ -1,13 +1,20 @@
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2D scene;
uniform sampler2D cockpit;
uniform vec2 sun_pos;
uniform float density;
uniform float weight;
uniform float falloff;
uniform float intensity;
uniform float cp_intensity;
layout (std140) uniform genericData {
vec2 sun_pos;
float density;
float weight;
float falloff;
float intensity;
float cp_intensity;
};
void main()
{
vec2 step = vec2( fragTexCoord.st - sun_pos.xy );
@@ -29,4 +36,4 @@ void main()
}
fragOut0 = sum * intensity;
fragOut0.a = 1.0;
}
}
@@ -4,9 +4,13 @@
in vec4 fragTexCoord;
in vec4 fragColor;
out vec4 fragOut0;
uniform sampler2D baseMap;
uniform int noTexturing;
uniform int srgb;
layout (std140) uniform genericData {
int noTexturing;
int srgb;
};
void main()
{
+5 -11
View File
@@ -3,21 +3,15 @@ in vec4 vertTexCoord;
in vec4 vertColor;
out vec4 fragTexCoord;
out vec4 fragColor;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
uniform vec4 color;
uniform mat4 modelMatrix;
uniform bool clipEnabled;
uniform vec4 clipEquation;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
void main()
{
fragTexCoord = vertTexCoord;
fragColor = vertColor * color;
fragColor = vertColor;
gl_Position = projMatrix * modelViewMatrix * vertPosition;
if (clipEnabled) {
gl_ClipDistance[0] = dot(clipEquation, modelMatrix * vertPosition);
}
}
+18 -29
View File
@@ -1,36 +1,25 @@
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2D tex;
uniform float timer;
#ifdef FLAG_DISTORT_NOISE
uniform float noise_amount;
#endif
#ifdef FLAG_SATURATION
uniform float saturation;
#endif
#ifdef FLAG_BRIGHTNESS
uniform float brightness;
#endif
#ifdef FLAG_CONTRAST
uniform float contrast;
#endif
#ifdef FLAG_GRAIN
uniform float film_grain;
#endif
#ifdef FLAG_STRIPES
uniform float tv_stripes;
#endif
#ifdef FLAG_CUTOFF
uniform float cutoff;
#endif
#ifdef FLAG_DITH
uniform float dither;
#endif
#ifdef FLAG_TINT
uniform vec3 tint;
#endif
uniform sampler2D blurred_tex;
uniform sampler2D depth_tex;
layout (std140) uniform genericData {
float timer;
float noise_amount;
float saturation;
float brightness;
float contrast;
float film_grain;
float tv_stripes;
float cutoff;
vec3 tint;
float dither;
};
void main()
{
#ifdef FLAG_DISTORT_NOISE
+1 -3
View File
@@ -1,10 +1,8 @@
in vec4 vertPosition;
in vec4 vertTexCoord;
out vec4 fragTexCoord;
out float blurSize;
uniform float bsize;
void main()
{
fragTexCoord = vertTexCoord;
gl_Position = vertPosition;
}
}
+8 -2
View File
@@ -4,9 +4,15 @@ in vec4 fragColor;
out vec4 fragOut0;
uniform bool textured;
uniform sampler2DArray baseMap;
uniform int baseMapIndex;
layout (std140) uniform genericData {
mat4 modelViewMatrix;
mat4 projMatrix;
bool textured;
int baseMapIndex;
};
void main() {
if (textured) {
+7 -2
View File
@@ -6,8 +6,13 @@ in vec2 vertTexCoord;
out vec2 fragTexCoord;
out vec4 fragColor;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
layout (std140) uniform genericData {
mat4 modelViewMatrix;
mat4 projMatrix;
bool textured;
int baseMapIndex;
};
void main()
{
@@ -1,10 +0,0 @@
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2DArray shadow_map;
//uniform sampler2D shadow_map;
uniform int index;
void main()
{
vec3 texcoord = vec3(fragTexCoord.xy, float(index));
fragOut0 = vec4(texture(shadow_map, texcoord).rgb,1.0);
}
@@ -1,8 +0,0 @@
in vec4 vertPosition;
in vec4 vertTexCoord;
out vec4 fragTexCoord;
void main()
{
fragTexCoord = vertTexCoord;
gl_Position = vertPosition;
}
@@ -1,14 +1,27 @@
#include "gamma.sdr"
const float EMISSIVE_GAIN = 2.0;
in vec4 fragImpactUV;
in float fragNormOffset;
uniform vec4 color;
uniform sampler2DArray shieldMap;
uniform int shieldMapIndex;
uniform int srgb;
out vec4 fragOut0;
#define EMISSIVE_GAIN 2.0
uniform sampler2DArray shieldMap;
layout (std140) uniform genericData {
mat4 shieldModelViewMatrix;
mat4 shieldProjMatrix;
vec3 hitNormal;
int srgb;
vec4 color;
int shieldMapIndex;
};
void main()
{
if(fragNormOffset < 0.0) discard;
@@ -1,12 +1,28 @@
in vec4 vertPosition;
in vec3 vertNormal;
out vec4 fragImpactUV;
out float fragNormOffset;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
uniform vec3 hitNormal;
uniform mat4 shieldModelViewMatrix;
uniform mat4 shieldProjMatrix;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
layout (std140) uniform genericData {
mat4 shieldModelViewMatrix;
mat4 shieldProjMatrix;
vec3 hitNormal;
int srgb;
vec4 color;
int shieldMapIndex;
};
void main()
{
gl_Position = projMatrix * modelViewMatrix * vertPosition;
@@ -15,4 +31,4 @@ void main()
fragImpactUV = shieldProjMatrix * shieldModelViewMatrix * vertPosition;
fragImpactUV += 1.0f;
fragImpactUV *= 0.5f;
}
}
@@ -0,0 +1,25 @@
layout (std140) uniform genericData {
vec2 smaa_rt_metrics;
};
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
#define SMAA_INCLUDE_VS 0
#define SMAA_INCLUDE_PS 1
#include "SMAA.sdr"
in vec2 fragTexCoord;
in vec2 fragPixcoord;
in vec4 fragOffset[3];
out vec4 fragOut0;
uniform sampler2D edgesTex;
uniform sampler2D areaTex;
uniform sampler2D searchTex;
void main() {
fragOut0 = SMAABlendingWeightCalculationPS(fragTexCoord, fragPixcoord, fragOffset, edgesTex, areaTex, searchTex, vec4(0.0));
}
@@ -0,0 +1,24 @@
layout (std140) uniform genericData {
vec2 smaa_rt_metrics;
};
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
#define SMAA_INCLUDE_VS 1
#define SMAA_INCLUDE_PS 0
#include "SMAA.sdr"
in vec4 vertPosition;
in vec2 vertTexCoord;
out vec2 fragTexCoord;
out vec2 fragPixcoord;
out vec4 fragOffset[3];
void main() {
gl_Position = vertPosition;
fragTexCoord = vertTexCoord;
SMAABlendingWeightCalculationVS(vertTexCoord, fragPixcoord, fragOffset);
}
@@ -0,0 +1,22 @@
layout (std140) uniform genericData {
vec2 smaa_rt_metrics;
};
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
#define SMAA_INCLUDE_VS 0
#define SMAA_INCLUDE_PS 1
#include "SMAA.sdr"
in vec2 fragTexCoord;
in vec4 fragOffset[3];
out vec4 fragOut0;
uniform sampler2D colorTex;
void main() {
fragOut0 = vec4(SMAALumaEdgeDetectionPS(fragTexCoord, fragOffset, colorTex), 0.0, 1.0);
}
@@ -0,0 +1,23 @@
layout (std140) uniform genericData {
vec2 smaa_rt_metrics;
};
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
#define SMAA_INCLUDE_VS 1
#define SMAA_INCLUDE_PS 0
#include "SMAA.sdr"
in vec4 vertPosition;
in vec2 vertTexCoord;
out vec2 fragTexCoord;
out vec4 fragOffset[3];
void main() {
gl_Position = vertPosition;
fragTexCoord = vertTexCoord;
SMAAEdgeDetectionVS(vertTexCoord, fragOffset);
}
@@ -0,0 +1,23 @@
layout (std140) uniform genericData {
vec2 smaa_rt_metrics;
};
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
#define SMAA_INCLUDE_VS 0
#define SMAA_INCLUDE_PS 1
#include "SMAA.sdr"
in vec2 fragTexCoord;
in vec4 fragOffset;
out vec4 fragOut0;
uniform sampler2D colorTex;
uniform sampler2D blendTex;
void main() {
fragOut0 = SMAANeighborhoodBlendingPS(fragTexCoord, fragOffset, colorTex, blendTex);
}
@@ -0,0 +1,23 @@
layout (std140) uniform genericData {
vec2 smaa_rt_metrics;
};
#define SMAA_RT_METRICS vec4(1.0 / smaa_rt_metrics, smaa_rt_metrics)
#define SMAA_INCLUDE_VS 1
#define SMAA_INCLUDE_PS 0
#include "SMAA.sdr"
in vec4 vertPosition;
in vec2 vertTexCoord;
out vec2 fragTexCoord;
out vec4 fragOffset;
void main() {
gl_Position = vertPosition;
fragTexCoord = vertTexCoord;
SMAANeighborhoodBlendingVS(vertTexCoord, fragOffset);
}
@@ -4,7 +4,11 @@
in vec4 fragTexCoord;
out vec4 fragOut0;
uniform sampler2D tex;
uniform float exposure;
layout (std140) uniform genericData {
float exposure;
};
vec3 Uncharted2Tonemapping(vec3 hdr_color)
{
float A = 0.15;
+7 -3
View File
@@ -1,10 +1,14 @@
in vec4 vertPosition;
in vec4 vertTexCoord;
out vec4 fragTexCoord;
uniform mat4 modelViewMatrix;
uniform mat4 projMatrix;
layout (std140) uniform matrixData {
mat4 modelViewMatrix;
mat4 projMatrix;
};
void main()
{
fragTexCoord = vertTexCoord;
gl_Position = projMatrix * modelViewMatrix * vertPosition;
}
}
+2 -1
View File
@@ -54,6 +54,7 @@ static auto WarpOption = options::OptionBuilder<bool>("Graphics.3dWarp", "3D War
.bind_to(&Fireball_use_3d_warp)
.importance(65)
.finish();
/**
* Play warp in sound for warp effect
*/
@@ -73,7 +74,7 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
if(fb->warp_open_sound_index.isValid()) {
sound_index = fb->warp_open_sound_index;
} else if ((ship_class >= 0) && (ship_class < static_cast<int>(Ship_info.size()))) {
} else if ((ship_class >= 0) && (ship_class < ship_info_size())) {
if ( Ship_info[ship_class].is_huge_ship() ) {
sound_index = gamesnd_id(GameSounds::CAPITAL_WARP_IN);
fb->flags |= FBF_WARP_CAPITAL_SIZE;
Loaded 100 of 620 files, more files were not shown because too many files have changed in this diff. Show more