Compare commits

..
Author SHA1 Message Date
Cliff Gordon 7040c4c17e [json_export] Preliminary support for outputting table data to JSON. Includes some defaults for constants that might not be defined in older versions of Jansson on platforms not using the bundled version. 2015-04-08 12:07:33 -05:00
Cliff Gordon 7727b00f76 [json_export] Eliminate some redundancy with ship allowed weapon parsing. 2015-04-08 12:05:49 -05:00
Cliff Gordon 24b15298b6 [json_export] Update OS X project to work with updated Jansson. 2015-04-08 12:00:03 -05:00
Cliff Gordon 26dcfd9fbb [json_export] Upgrade Jansson to 2.7. 2015-04-08 11:59:13 -05:00
m_m 9ad5d09c0a From LotF and me: Fix for Mantis 3146: Crash when pressing enter key in empty region of main hall
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11296 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-31 18:58:28 +10:00
MageKing17 b61779e852 Fix mantis #3154.
Adds ON_CLBN_CHKCHANGE to the message map for the ships and weapons lists so that hitting spacebar to change the checked/unchecked status of a ship or weapon also updates the availability count.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11295 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-31 18:40:28 +10:00
m_m 2d82f7652d Fix "Callsigns still don't work when messages come from capships" issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11294 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-30 17:29:39 +10:00
The_E 9284264885 Patch to add MSVC2015 support. Also fixes a few warnings its compiler threw.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11292 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-29 11:05:02 +10:00
niffiwan 3e9c19c5c7 Fix mantis 3151
Implement case insensitive -mod dir search on *nix

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11291 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-28 11:12:25 +10:00
z64555 cd8595cf0f Fix for Mantis 3152: Moves the trail origin to the mathematical center of a laser bolt, if the weapon's render type is a laser.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11290 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-28 08:53:10 +10:00
The_E 1199555321 Adds a new debug output filter, "CFileDebug", which if enabled via debug_filter.cfg will print the absolute path to any file requested by the engine.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11289 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-22 13:04:55 +10:00
The_E 0808c3459f If a text file to be read by the engine is in Unicode, abort. Could be something important we're missing.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11288 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-22 13:04:55 +10:00
niffiwan b5fe481ab2 add script-eval-block sexp
This is a workaround to the sexp TOKEN_LENGTH limit
The script can be split across multiple arguments to allow scripts
longer than 32 chars (i.e. current TOKEN_LENGTH)
e.g.
( script-eval
  "ba.warning('foo"
  " more and more and more"
  " and the rest')"
)
Kudos to Axem for suggesting the idea
(And to zookeeper for reminding me to actually commit it!)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11286 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-21 11:41:49 +10:00
zookeeper 44b786c171 Fixed a mistake in $Model Point Shield Controls.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11285 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-19 16:40:17 +10:00
MageKing17 21cbf82196 Fix mantis 3147. From Admiral MS and myself.
From Admiral MS: Avoid bashing orientation if trying to avoid a collision.
From myself: Bash orientation if aspect seekers are equipped.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11284 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-18 18:21:21 +10:00
zookeeper ae32159408 Moved the fix in r11279 to a slightly more logical place.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11280 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-17 11:20:24 +10:00
zookeeper 56f694dc43 Check for and fix rare but possible discrepancy between sip->model_num and sip->subsystems[].model_num which can lead to model index collision errors.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11279 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-17 08:30:08 +10:00
zookeeper 95145a4f3f Slightly clarified variable use.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11276 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-07 09:39:26 +10:00
MageKing17 e0527d9bc7 Fix mantis #1929.
Makes the IDC_OLD_TEXTURE_LIST dropdown list use the same sorting as the old_texture_name[] array, and should also so that multiple old texture replacements for the same ship are properly erased.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11274 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-04 22:43:03 +10:00
MageKing17 4742378d50 Followup to r11266; let code use hardcoded defaults.
Presumably, the use of use_default_pos in load_gauge_radar_dradis() is the result of a copy&paste job, but removing it allows the default values to be used to compute coords.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11273 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-04 22:43:03 +10:00
zookeeper a2e15f4c61 Tweaks to the argument documentation of a bunch of scripting functions.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11272 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-03 16:22:51 +10:00
zookeeper 77b245eed2 Fixed shield handle not returning correct quads when indexing with the SHIELD_* enums.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11270 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-03 16:22:51 +10:00
niffiwan a1979e704e Coverity 1244962 Uninitialized scalar variable
Set default DRADIS coords to 0,0

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11266 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan 23fbcb1a2f Add indentation for previous commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11265 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan dc02e70716 Coverity 1093719 Negative array index read
Check current_bank is > -1 before using it
Note: did not alter indentation in this commit in order to make
relevant changes easier to see

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11264 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan 170614f150 Coverity 1093718 Negative array index read
Create swip after checking that its index is > -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11263 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan 5c8a6234a1 Coverity 1093705 Negative array index read
Probably not an issue, but to be safe removing the unused pointer anyway
i.e. the check that instance >= 0 suggests there's a possiblilty that the
pointer could contains a negative array index read

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11262 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
niffiwan aadc41a40a Coverity 1093495+1093498 Missing break in switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11261 387891d4-d844-0410-90c0-e4c51a9137d3
2015-03-01 11:02:15 +10:00
zookeeper 2203c1e9a8 Ported r11232 from zookeeper branch: Set the Sender hook variable to nil in On Message Received hooks if message not coming from a ship.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11257 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-21 11:34:30 +10:00
MageKing17 40a9025aeb Fixes hardpoint gauge not rendering outline.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11247 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-12 17:13:54 +10:00
MageKing17 14bd62147c Adding a "$Briefing Grid:" interface color to colors.tbl.
Requested by Axem.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11245 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-12 17:13:54 +10:00
m_m 70d735ceb4 Added "On HUD Message Received" scripting hook which is invoked when the HUD receives message text to display.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11242 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-09 17:22:03 +10:00
niffiwan 7d92b1cecf Fix mantis 3138: remove spurious warning
Don't warn about low rotational velocities disabling collisions for
no_collide ships

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11238 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-03 17:08:58 +10:00
zookeeper 8a50f844b0 Improved warnings text and clarified variable use in turret modelread code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11236 387891d4-d844-0410-90c0-e4c51a9137d3
2015-02-02 17:21:53 +10:00
zookeeper 35d6a9654d Ported r11100 from zookeeper branch: Fix various issues with $Acceleration Time.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11234 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-27 18:27:41 +10:00
zookeeper c47233ca3c Ported r11085 from zookeeper branch: Fixed weapon particle spews not taking launch velocity properly into account if $Acceleration Time is used.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11233 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-27 18:27:40 +10:00
MageKing17 d01856d992 Fix a potential crash during ships.tbl parsing.
Makes parse_ship() use ship_info_lookup_sub() instead of ship_info_lookup() (shouldn't be jumping through those hoops during table parsing if they're for FS1 mission conversion), and more importantly, added an error check to ship_info_lookup() to avoid sprintf() exceeding the length of the char array.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11230 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-24 09:22:32 +10:00
chief1983 ec758aa108 Fix for Mantis 3036: This unifies the cf_exists function to behave like the other functions in the cf_exists* family, and simultaneously addresses the bug.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11222 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-23 18:35:55 +10:00
MageKing17 f5c1b6608d Reverting r4959 per discussion on #scp and the forums.
Adding every "#"-variant was causing spurious errors when switching from the MediaVPs to no mod. See http://www.hard-light.net/forums/index.php?topic=88982.0 for details.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11221 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-20 18:50:38 +10:00
chief1983 7df12ebd75 Experimental flag to apply lighting to briefing window model popups. Flag should be removed and behavior made default if no issues arise after next release.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11218 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-16 18:58:02 +10:00
zookeeper 4422aaa311 Fixed an issue with disabled binds getting matched in key translation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11215 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:44 +10:00
chief1983 9ebcc3e437 Added OpenBSD to what is now a multi-BSD check.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11214 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 4f53f07681 minor modifications to mission cutscenes: change cutscene_name field to filename, because it's actually the filename of the cutscene make struct a plain old data object (no constructor) make parsing a little tidier, and make the SEXP formula and closing #end tag optional
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11213 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 61df0f18b1 add warning if a cutscene is specified that isn't in cutscenes.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11212 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 87e8170268 add optional_string_one_of, which is useful to have
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11211 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 b9a6a9f23e instead of an Int3(), use a Warning that's only displayed once
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11210 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
MageKing17 6a77d128c9 Fixing weird problem with snd_update_3d_pos() that, honestly, baffles me as to how the code ever worked on any system.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11208 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
zookeeper 20218b0924 Added support for NONE as a value for $Key Default, for making a key unbound by default.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11206 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
zookeeper b1f1756dd1 Fixed breakage of $Category and $Type from r10843.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11205 387891d4-d844-0410-90c0-e4c51a9137d3
2015-01-14 17:29:43 +10:00
Goober5000 7250cd13a6 add ship class texture replacement using a simplified method that doesn't require the texture_set code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11204 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-23 18:15:11 +10:00
MageKing17 b23aea5a41 Fix mantis #3068.
Make hitting the "delete" key in the pilot-selection menu do the same thing as clicking on the "remove" button.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11202 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-22 18:01:31 +10:00
niffiwan a49eb75c6e Add warning for very fast ship-rotation values
Otherwise rotational collision detection is disabled for the ship
(and an int3() triggers in debug)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11201 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-20 11:54:49 +10:00
MageKing17 c8b48e4a36 Change m_badge_earned into a vector.
This makes it so that getting enough kills to cross the threshold for more than one badge simultaneously grants all of them (with the debriefing showing only the last one) and backs out all of them if the scoring is backed out.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11198 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-16 19:57:49 +10:00
Goober5000 709f483617 PAUSE ALL THE STREAMS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11197 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-12 16:12:16 +10:00
MageKing17 ffd74fa60b Adding "+Available From Start:" to Medals.tbl.
Requested by MjnMixael.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11196 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-12 16:12:16 +10:00
Goober5000 1c826d366e add the pauseMusic scripting function, requested by MjnMixael
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11195 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-11 18:15:36 +10:00
Goober5000 1c464864c3 fix Mantis #3132 (is-iff returns true when the target is destroyed)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11193 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-10 16:37:43 +10:00
MageKing17 a03f96ca01 Related to r11189: avoid calling factor_table::getNextSlots() if the ship doesn't have the dynamic linking flag.
Basically, hitting "o" on any ship with more than 6 slots in a bank could crash FSO, even without the flag. Reported by Spoon.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11192 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-10 16:37:43 +10:00
MageKing17 15fad7f58b Correct copy-paste error in check_sexp_syntax() from the armor types commit.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11191 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-09 14:09:29 +10:00
Goober5000 f01c4bf952 fix Mantis #3135: account for the case when the game is paused before being minimized
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11190 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-08 17:14:57 +10:00
MageKing17 1d7c01181e Fix mantis #3133. Fixes logic errors in factor_table not being sure if it's supposed to be 0-based or 1-based at different times.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11189 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-08 17:14:57 +10:00
Goober5000 0162cab8bd move this around for more logical flow
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11188 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-08 17:14:57 +10:00
Goober5000 b02af2ef6e a more future-proof way to keep track of explicitly paused audio
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11187 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-04 16:39:40 +10:00
Goober5000 4eb1726004 this should fix Mantis #2888 (allow for head.ani files without letter suffixes)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11186 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-04 16:39:40 +10:00
Goober5000 2f734daf0d when the game returns from a paused state, don't unpause the music paused by sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11185 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 20:31:32 +10:00
Goober5000 a516b88803 it's good to check whether the music is paused, for bulletproof-ness
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11184 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 20:31:31 +10:00
Goober5000 9f12e1f56b added a sexp to pause and unpause music that is currently playing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11183 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 20:31:31 +10:00
Goober5000 255c2912cb minor reorganization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11182 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-03 16:23:42 +10:00
Goober5000 ac25da1bd9 remove the Error (originally Assert) from r1675 and add back the comment removed in r8005
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11181 387891d4-d844-0410-90c0-e4c51a9137d3
2014-12-01 20:37:52 +10:00
Goober5000 872bbe2a11 improve sexp code for obtaining pitch/bank/heading with the following changes: 1) use an alternate algorithm for extracting angles from an orientation matrix 2) properly round floats to integers when converting to degrees
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11180 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-29 19:53:19 +10:00
Goober5000 f7353121e6 m!m's fix for Mantis #3131: contrary to the xt change from r11138, NULL is only returned on vm_malloc failure (so should never happen in normal execution)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11179 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-25 19:15:56 +10:00
MageKing17 f64afbecfb From The_E, niffiwan, m_m, and myself: Fix Mantis 2404.
Makes "$Weapon Model Draw Distance:" actually stop external weapon models from being drawn beyond that distance (modified by detail level).

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11178 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-22 08:47:11 +10:00
niffiwan c05845cb9d Fix mantis 3114
Change turret-tagged-only behaviour back to retail
Add AI profiles flag to allow use of newer behaviour (i.e. stricter)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11177 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 19:26:53 +10:00
niffiwan a73404dbd5 Error needs LOCATION :)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11176 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 19:26:53 +10:00
The_E fbd590cd77 Improvement for this error message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11175 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 18:43:52 +10:00
MageKing17 e4072d6e51 Adding area-of-effect capability to Electronics weapons.
By adding an "+Area Of Effect" line after "+New Style:" or "+Old Style:", it causes every ship caught in the weapon's shockwave or blast to suffer electronics disruption. Requested by Black Wolf.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11173 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-21 18:43:52 +10:00
MageKing17 0417b4c335 Ensure that the debriefing code sets the font before wordwrapping.
Also, explicitly set the font instead of relying on Debrief_ui_window.draw() doing it implicitly.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11172 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-18 18:09:08 +10:00
MageKing17 b14b590ab1 Adding "interceptable", "turret interceptable", and "fighter interceptable" weapon flags.
These allow munitions to be attacked by the AI without needing to set the "bomb" flag; "turret interceptable" means it can be attacked by turrets, "fighter interceptable" means it can be shot down by fighters, and "interceptable" sets both flags simultaneously. Requested by Rheyah.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11171 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-10 17:45:58 +10:00
m_m de57f043da From MageKing17 and me: Fix for Mantis 3128: Docking related crash - dock_list isn't initialized This patch makes the copy constructor and the assignment operator of the object class private as it contains members that should not be copied.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11170 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-08 10:57:03 +10:00
niffiwan 487f764764 Redo Coverity 1215458 Uninitialized pointer field
Includes more robust checks of cmdline_parm data

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11169 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-02 19:52:04 +10:00
m_m 86510572bf With help from MageKing17: Fix for Mantis 3123: Virtual variables and indexers that return nil break the scripting system
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11168 387891d4-d844-0410-90c0-e4c51a9137d3
2014-11-02 11:22:29 +10:00
MageKing17 e604125e5d Minor followup to r11150.
The regular parsing code not using the same broken logic as parse_comments() is not the same thing as it "ignoring" too high versions, and searching for repetitions of the same token would result in just finding the first one over and over again (the likelihood of this actually mattering to anyone is minuscule, but I needed something to test commit access, and this code has been tested).

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11167 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-30 13:23:58 +10:00
Swifty 33776fc4be gr_opengl_string retooled to use glDrawArrays. Should be a bit faster now.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11165 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-29 18:47:04 +10:00
zookeeper c13c35ec25 Fixed a FRED crash when using $Flight controls follow eyepoint orientation (patch by MageKing17).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11163 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-29 18:47:04 +10:00
zookeeper 83d6456c6a Clarified how to set a new variable with mn.SEXPVariables.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11161 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-28 22:04:56 +10:00
zookeeper 1d55b98017 Added a little extra info to two bmpman errors.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11160 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-28 22:04:56 +10:00
m_m bd602cc1a3 Revert 11158 as it breaks FRED compilation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11159 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:23:02 +10:00
m_m 89cd36a242 Fix a crash reported by Axem related to freeing the dock list of an object. This was caused by freeing the dock list from the destructor of an object which meant that copies of an object would corrupt the original object instance. To make sure that doesn't happen again the copy constructor and assignment operator of object have been made private.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11158 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:23:02 +10:00
Goober5000 414daaaed8 Mantis #3127: fix the spatial check in the rewritten algorithm
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11157 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:23:02 +10:00
The_E 4295cd3edb Corrects an unwanted change in formatting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11155 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:22:42 +10:00
The_E 6c48551fb3 From MageKing17: Make the lua doManeuver command behave the same way as the sexp.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11154 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-27 18:22:42 +10:00
niffiwan 866667a977 Fix mantis 3126 (from MageKing17)
Remove limit of 32 tbms being loaded for any given table type
2014-10-24 19:35:47 +10:00
niffiwan d1aa2e1c37 Set 1024x768 32bit as default res on *nix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11153 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-24 19:06:22 +10:00
niffiwan 07e1679138 Partial revert of r11145
A fake subsystem used as the firing point for fighter beams. It's
re-used for every fire point so the turret is supposed to only have 1
firepoint. i.e. energy consumption was already correctly calculated

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11152 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-24 19:06:21 +10:00
niffiwan 16f0ff1959 Allow fonts to set/change special char indexes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11151 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-24 19:06:21 +10:00
Goober5000 6cc96ce0c5 MageKing17 has done yeoman's work in fixing the version-specific commenting system. Thanks, MageKing17!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11150 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:40 +10:00
Goober5000 9161158996 xt branch: load stuff from the correct location
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11149 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:35 +10:00
Goober5000 557ef07079 xt branch: memset a bunch of weapons strings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11148 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:33 +10:00
Goober5000 130165af9f xt branch: WIF_MFLASH is unnecessary because we can check whether there is a muzzle flash index
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11147 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:32 +10:00
Goober5000 6e56b2970f xt branch: minor tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11146 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:31 +10:00
Goober5000 5a31e0b38e xt branch: 1) the number of beam firing points should be the same as the number of ship firing points, because that's how we're calculating the expenditure of weapon energy 2) clear out Ship_type information when we exit the game
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11145 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:29 +10:00
Goober5000 3234a8360c refine the calculation of effective_primary_banks... 1) optimization from xt branch: don't calculate if we only actually have one bank on our ship 2) make sure to count the current bank that we're firing, to avoid an edge case where we might have a negative fire penalty 3) make the condition logic a little clearer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11144 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:26 +10:00
Goober5000 14dfb5e73d xt branch: minor ship.cpp fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11143 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:21 +10:00
Goober5000 d734f76369 xt branch: "Nothing major here, just added the same basic stuff from the nebula code to make beam glows fade out depending on how close to the eye they are. The primary reason for this was for beams on fighters, since the muzzle glows tend to block your view when they show up. Having them fade out still gives you the visual effect, but allows you to see through them as well."
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11142 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:16 +10:00
Goober5000 871bb0b19a xt branch: minor optimizations in beam.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11141 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-17 18:25:14 +10:00
Goober5000 4f06fd2435 additional string safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11140 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-15 18:22:57 +10:00
Goober5000 e9f5c531e0 heh... Microsoft's implementation of snprintf doesn't conform to the standard!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11139 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-15 06:23:18 +10:00
Goober5000 dff2156c18 xt branch: more string safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11138 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:41 +10:00
Goober5000 f23a3c5843 SCP_string is useful here too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11137 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:40 +10:00
Goober5000 ff38449a46 string printing safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11136 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:39 +10:00
Goober5000 1318ccfa91 wut? defaulting to NULL here will cause these to never log anything...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11135 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:38 +10:00
Goober5000 65265f8ab8 fix a compile error (d'oh) and use type safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11134 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:37 +10:00
Goober5000 a541a22239 xt branch: optimize objectsort.cpp by not calculating some things every loop iteration
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11133 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:35 +10:00
Goober5000 aee1305841 according to the C standard... "The functions snprintf() and vsnprintf() write at most size bytes (including the trailing null byte ('\0')) to str." ...so we have that going for us, which is nice
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11132 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:33 +10:00
Goober5000 e43dacdcc3 xt branch: use CLAMP here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11131 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:32 +10:00
Goober5000 8e4d98bd4f xt branch: minor tweaks to glow_points
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11130 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 18:23:31 +10:00
Goober5000 f6e2f1d236 xt branch: optimizations in modelcollide.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11129 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:25 +10:00
Goober5000 e22a4b0b5b xt branch: add capability for custom identifiers in build names (e.g. Xt-0314)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11128 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:24 +10:00
Goober5000 11855ed3d8 xt branch: having a float version of gr_opengl_string makes text scrolling nice and smooth at high nonstandard resolutions (also, looks like quad rendering works just fine here; no need to convert to tris)
convert credits.cpp to use float version of gr_opengl_string; eventually Taylor wanted to make the float version standard

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11127 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:23 +10:00
Goober5000 fe775aeedf xt branch: optimizations in fvi.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11126 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:22 +10:00
Goober5000 5c0bc126bb xt branch: tweaks to vecmat.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11125 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:20 +10:00
Goober5000 c6364987b3 we don't need to cast because mod is a float
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11124 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-13 12:24:17 +10:00
Goober5000 b8a05e30a0 xt: sprintf length safety
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11123 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:14 +10:00
Goober5000 5f3600dc79 probably good to change the comment too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11122 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:13 +10:00
Goober5000 f2d8277452 xt branch: additional optimizations using RAND_MAX_1f
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11121 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:12 +10:00
Goober5000 31562ba811 xt branch tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11120 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 18:22:10 +10:00
Goober5000 4200bb55d7 from xt branch: remove unneeded parameters, tweak some assets, minor optimization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11119 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 12:21:51 +10:00
Goober5000 bffdef1ce5 from xt branch: add some hysteresis to asteroid fields to prevent "popping" when an asteroid exceeds the bounds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11118 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 06:22:25 +10:00
Goober5000 4dafc8ff5f this too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11117 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 06:22:24 +10:00
Goober5000 d5e81757b0 some turret changes from the XT branch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11116 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-12 06:22:22 +10:00
Goober5000 61c97871f0 technically, this is better
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11115 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 18:21:40 +10:00
Goober5000 50f16b7d02 better method of appending ellipsis (nb: strncpy pads with 0 if string is shorter than len)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11114 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 18:21:37 +10:00
Goober5000 8688b05c91 related to Mantis #3121, make SEXP parsing more robust, and remove some old debug/unused code in get_sexp_main()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11113 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 18:21:35 +10:00
chief1983 9a90a43801 Wrong variable type, may work in MSVC but not on clang or gcc.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11112 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-09 06:21:40 +10:00
Goober5000 15c6f18c74 remove unused debug function
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11111 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-08 18:22:27 +10:00
Goober5000 5552fbcbd9 related to Mantis #3121, add parentheses if the string passed to runSEXP doesn't have them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11110 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-08 18:22:24 +10:00
Goober5000 a3b7eec214 make flag checking more efficient and prevent an Int3() on bad data
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11109 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:11 +10:00
Goober5000 2d14ca7539 Parias's patch for Mantis #3102 (make show-subtitle-text positioning consistent on MP clients)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11108 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:10 +10:00
Goober5000 88abaf6de4 I forget who requested this, but this change now causes FRED to allow numeric sexps to be used for OPF_WEAPON_BANK_NUMBER
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11107 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:08 +10:00
Goober5000 3b90b65547 allow sexps which reference sounds to use either the table index or the entry name as the reference (based on a patch by m!m, see http://www.hard-light.net/forums/index.php?topic=86293.0)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11106 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 18:22:07 +10:00
zookeeper 4e0beccfc9 Reverted r10944 and r10945 for now, with the exception of the GL_TRIANGLE_STRIP->GL_QUADS fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11105 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-07 12:21:56 +10:00
Goober5000 cc76884514 well ok, revert that
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11104 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-06 18:20:08 +10:00
Goober5000 c3bcfc6303 don't enable nav system always... that's not how this is supposed to work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11103 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-06 18:20:06 +10:00
m_m 478bb022c7 Fixed a bug reported by Axem: The scripting API used the wrong functions to determine if a hud gauge is a custom hud gauge.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11102 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-06 12:20:50 +10:00
Goober5000 4037d3be68 tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11101 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-05 18:20:10 +10:00
Goober5000 85872114ee related to Mantis #2971: properly reset shield info when we have a null objp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11099 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 93c7775109 stupid missing parenthesis >.>
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11098 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 e15cd38a88 Between the Ashes HPC request: extend ai-chase-same-team to ai-disarm, ai-disable, and ai-destroy-subsys too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11097 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 416af26244 and on the subject of Mantis #3110: fix the multi_sexp_deal_with_ship_flag issue that MageKing17 noticed, and tweak a sexp to be more clear
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11096 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:44 +10:00
Goober5000 cd2996f01d MageKing17's patch for Mantis #3110: Message Brackets not displayed with 'Invisible to Friendlies' flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11095 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
Goober5000 f7e3bef9b7 Between the Ashes HPC request: allow ships to attack others on the same team
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11094 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
Goober5000 31716a9348 use the OBJ_INDEX macro, because that's why we have it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11093 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
z64555 ec60984483 From MageKing17, Makes the $CD: token for cutscenes.tbl optional. Useful, since a majority of assets no longer require physical CD's.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11092 387891d4-d844-0410-90c0-e4c51a9137d3
2014-10-04 13:45:43 +10:00
chief1983 5e94b75354 Fix Mantis 3109: Revert r11079 and reopen #2888 since I didn't realize that Fred messages also often use built-in suffix appending. Need to either use FUBAR's original solution or re-engineer something else.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11090 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-29 06:19:41 +10:00
niffiwan 484b518760 Fix mantis 2804: beams can use damage factors
Add game_setting.tbl option that allows beams to use weapons table
Armor/Shield/Subsystem damage factors

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11089 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-27 18:20:18 +10:00
niffiwan df3435cadd Fix mantis 3108 (from Yarn)
Make parsing of DRADIS and custom hud gauges consistent with the rest
of the hud gauges

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11087 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-27 00:19:25 +10:00
Goober5000 7917b9885d fix Mantis #2987 (AddressSanitizer: global-buffer-overflow in message_queue_process())
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11084 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
Goober5000 e0aaa83513 CommanderDJ's patch for Mantis #2899 (AddressSanitizer: heap-buffer-overflow in snd_play() sound.cpp)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11083 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
Goober5000 435b078157 Yarn's patch for Mantis #3107 (Parts of the interface code assume a font size of 10)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11082 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-25 16:40:34 +10:00
Goober5000 a3e83aacfe CommanderDJ's patch for Mantis #3050 (Custom mainhall text is limited to 10 chars in the campaign editor)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11081 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-24 20:08:21 +10:00
Goober5000 62a2fb3c00 Yarn's patch for Mantis #3106 (Font parameter in hud_gauges.tbl not parsed correctly)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11080 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-24 20:08:21 +10:00
chief1983 946d7a45af Fix for Mantis 2888 - add Suffix support to disable suffixes for messages on a per message basis in messages.tbl. See the wiki.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11079 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-24 20:08:21 +10:00
niffiwan ab3ebebc9c Parts of mantis 3103 (From MageKing17)
Points 3-5 from the mantis ticket
i.e. use OPF_SSM_CLASS in appropriate places

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11078 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-22 20:17:36 +10:00
m_m 5b79ed3ea5 Fix for Mantis 3093: mn.getMissionFilenname() doesn't return a value if in GS_STATE_BRIEFING
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11077 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-22 19:59:03 +10:00
m_m dd4c91f8b6 From Parias: Fix for Mantis 3094: Request for new scripting function: ts.playCutscene()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11076 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-18 19:11:16 +10:00
niffiwan fc9f570374 Update .gitignore for new autoconf & libtool
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11075 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-13 14:03:50 +10:00
niffiwan fb2ce33802 Fix mantis 3105 (from MageKing17)
Use a pointer for reading radar IFF info, not an object copy

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11074 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-13 13:52:21 +10:00
niffiwan d9a4320dbb Add missing \n to mod_table mprintf
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11073 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-13 13:52:21 +10:00
niffiwan cd7b271b3b Tweak autotools
Use libtool, remove warnings about subdirs, DIE if autogen.sh pre-reqs
aren't met

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11072 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 1ac06f8b1c substitue main hall for displaying MjnMixael's main halls in fsport
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11046 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 7cd97633b6 Yarn's patch for Polish localization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11044 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 603e96865f VC6 compatibility
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11043 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 5e2046c44b use class declarations since these contain SCP_string
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11042 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 d2a6beaacc that variable isn't actually a buffer, so change the misleading name
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11041 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 cd76a257c1 subtitles can now be as long as messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11040 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 6052d9c4a4 since we can replace variables in SCP_string, use that instead of an arbitrary char[256] buffer also const-correctness in the constructor
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11039 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 c866ff0061 Karajorma missed an Opps :p
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11038 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 dd353a74d8 add an Assertion about a buffer overflow vulnerability in split_str
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11037 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
karajorma b05303fa63 Opps. Only need that defined once!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11036 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
karajorma 23d5913e9d The previously committed version of multi-eval did not include the code to allow it to determine if client side scripts should also be executed on the server. This version does but will break any previously created missions.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11035 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
karajorma 04fe7fb64a Fix Mantis 3077 (Subtitles including a message will crash multiplayer games).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11034 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
niffiwan 3052565490 Revert "Silence GCC warning variable ‘max_size’ set but not used"
Based on chief1983's comment that this code is still used, I'll take
the safer route of just telling gcc to shaddupaboudit

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11029 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 b63fd9a86a Mantis #3101: check for presence of support dockpoints in all builds, not just release
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11028 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
Goober5000 a7d6891520 MageKing17's patch: add door keys and quick start region, and fix single player / multiplayer description toggling also fix two warnings regarding int and boolean conversions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11027 387891d4-d844-0410-90c0-e4c51a9137d3
2014-09-09 20:37:02 +10:00
niffiwan 9b37d1e0f4 Fix gcc warnings in hudconfig.cpp
declaration of ‘color’ shadows a global declaration [-Wshadow] (x2)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11021 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 0bebe6f98a Partial fix for mantis 2932 (cutscenes)
Convert campaign viewed cutscenes

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11020 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 743a27b82f Partial fix for mantis 2932 (RA wep idx)
Ensure pilot conversion RA weapon indexes are always valid

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11019 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 57faea2bef Fix mantis 3099 (from Yarn)
Make HCF parsing more flexible

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11018 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 15:42:09 +10:00
niffiwan 1a3336e9bd Silence GCC warning variable ‘max_size’ set but not used
Code seems redundant as dscap_get_raw_data checks for a max size
anyway. And AFAIK the entire voice capture code is non-functional anyway

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11017 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:06 +10:00
niffiwan b88edd53bc Followup fix for mantis 2883 (from Yarn)
Set Lcl_special_chars when changing fonts
Change some copyright chars to use Lcl_special_chars

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11016 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:06 +10:00
Echelon9 cba4cc9943 Fix cppcheck (performance) Prefer prefix ++/-- operators for non-primitive types.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11015 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:06 +10:00
Echelon9 aa4b76d990 Fix cppcheck (style) Consecutive return, break, continue, goto or throw statements are unnecessary.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11014 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
Echelon9 44dc398b19 Fix cppcheck (style) Same expression on both sides of ||.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11013 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
Echelon9 85427ec76a Fix cppcheck (warning) Logical conjunction always evaluates to false: logfile_type < 0 && logfile_type >= 2.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11012 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan 75e8f8642c Fix mantis 3020 (pilot stats issue)
Reset pilot stats when we're creating a new CSG file. Otherwise stats
from the current pilot or campaign will be inherited by the new pilot /
campaign

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11011 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan e6b8a433f1 Fix mantis 3097 (valgrind)
Don't read past the start of the string

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11009 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan c603d42b61 Followup fix for mantis 3049 (from Yarn)
Revert an Error back to a Warning
Prevent an out-of-bounds read of the Lcl_ext_str array

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11008 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-23 13:05:05 +10:00
niffiwan 179c2ceb82 Fix mantis 3065 (clear RA data)
Clear red alert data when resetting campaign progress, changing
campaigns and switching pilots
In CSG read, move RA data clear from the read RA section to the data
reset function (i.e. clear if CSG is valid, not if section contains
data)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11007 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 21cee81a2a Fix Coverity 1093622 Array compared against 0 in process_new_player_packet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11006 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 0f77e0aa34 Fix Coverity 1093621 Array compared against 0 in send_accept_packet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11005 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 f3a1589d42 Fix Coverity 1093619 Array compared against 0 in delete_player()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11004 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:12 +10:00
Echelon9 01df45e37e Fix Coverity 1093613 Negative array index read in stuff_loadout_list()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11003 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:11 +10:00
Echelon9 1484f93590 Fix Coverity 1093599 Negative array index read in hud_query_order_issued()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11002 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:11 +10:00
niffiwan b29868aea7 Followup fix for mantis 3016 (FRED Briefing window FOV)
Make FRED icons & labels respect the Briefing_window_FOV

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@11001 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-17 18:50:11 +10:00
niffiwan 2427c9cfe3 Fix mantis 3092 (from Yarn)
Fix certain key string parsing in German & French

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10995 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:57 +10:00
niffiwan bfa3397dbd Fix mantis 2985 (from Yarn)
Fix float-to-int rounding errors in gr_[re|un]size_screen_pos

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10990 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:57 +10:00
niffiwan 3d8554b41f Followup fix to mantis 2887 (from MageKing17)
no-collide ship classes would collide unless the no-collide flag was set
in the mission file

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10989 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:57 +10:00
niffiwan 3c81c02829 oops - recommit r10986
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10988 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-16 12:31:56 +10:00
niffiwan 167739ed95 Fix gcc warning
declaration of ‘brief_line’ shadows a global declaration [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10987 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 5bcbad1e3a Fix mantis 3091 (from Yarn)
Treat non-ASCII chars above unsigned index 127 as word separators when
ending retail style colorisation

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10986 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
Zacam 060bc97360 From Axem: adds isInCampaign() lua function to tell when a mission is being played in a campaign (as opposed to via Techroom)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10985 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan a2fd4aa519 Fix mantis 3088 (from Yarn)
Fix two German keys not displaying in controls config

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10984 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 4b7a69f34e Fix mantis 3089 (From MageKing17)
Move 3D ship select model drawing earlier so that the help overlay is
drawn over the top, not underneath

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10983 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan ce8ed29326 From Coverity ID 1230636 Improper use of negative value
false positive; but add comment explaining why

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10982 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 43f3b6ade9 Fix Coverity ID 1230635 Unchecked return value
Check return code from lua EvalString on mainhall doors

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10981 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
Echelon9 0ed6dee427 Fix Mantis 3090: Valgrind: Conditional jump or move depends on uninitialised value(s) in webserverApiRequest()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10980 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
niffiwan 335b05c82a Fix input lag with some ATI cards on Linux
From electrojustin; adds cmdline option to force a gl_finish call
prior to swapping buffers.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10979 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:05 +10:00
m_m f8ff3be1fe From MageKing17: Fix for Mantis 3085: Unhelpful error reporting in hud_gauges.tbl if an invalid gauge type is specified.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10978 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
niffiwan 7defc6aeeb Fix mantis 3086 (from Yarn)
Add special case to avoid crash from mismatched quotes in
tstrings.tbl German text

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10977 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
niffiwan b725ec527a Fix mantis 3087 (from Yarn)
Readd translation support for default escort gauge header text

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10976 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
Goober5000 5cbb9d991b Additional tweak for Mantis #2887 and follow-up to r10181: when modifying OF_COLLIDE, need to call obj_set_flags for collision code support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10974 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
m_m 27e824c215 Revert accidentally committed project file changes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10973 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-11 18:54:04 +10:00
niffiwan 8e7a936c08 Fix line-endings in fred2/fred.rc
(somehow these got messed up in the git repo)
2014-08-06 19:41:46 +10:00
Goober5000 439b2c8cad add additional lookup for GTSC Faustus for next version of FSPort
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10972 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:35 +10:00
m_m 3db76adf40 From karajorma: Adds the multi-eval SEXP WARNING: This SEXP is subject to change and will likely be removed or changed in a future version, use with caution. Also fixes Mantis 3079: Add multi-eval to list of available SEXPs (.patch included)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10971 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:35 +10:00
m_m 8e4235a86e From ngld and Parias: Fix for Mantis 3084: Bitmaps loaded with gr.loadTexture() are never released.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10970 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:35 +10:00
m_m 9689711149 From FUBAR-BDHR, chief1983, m!m and MageKing17: Fix for Mantis 2887: Additional workaround for mantis 2693
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10969 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-06 19:39:34 +10:00
Zacam b562ebe1f5 From Axem: adds getFrametimeOverall() lua function for timing purposes outside of gameplay
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10967 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
Zacam c03fad72cd Since we updated libpng, might as well update zlib as well. Now v1.2.8.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10966 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
niffiwan 1a813db618 Fix mantis 3078 (From Yarn)
Don't set / reset unscaled screen area when rendering to texture
Also fix a pre-10844 bug where scaling down a cockpit gauge would
cause the gauge to be improperly clipped if it was close enough to the
right or bottom edge of the texture.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10965 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
niffiwan b39b23c3f6 "Fix" gcc warnings in Control_config[]
warning: missing initializer for member 'config_item::BLAH'
[-Wmissing-field-initializers]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10964 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
Zacam e6f92ddcd9 Fix Mantis 3075 : Upgrades libpng from 1.5.7 to 1.6.12
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10963 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:23 +10:00
The_E 04f2c365f8 Fix for Mantis 3080 from MjnMixael: Fix for inadvertently changed parsing order for mainhall tables.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10962 387891d4-d844-0410-90c0-e4c51a9137d3
2014-08-05 18:47:22 +10:00
niffiwan 1291e0ad82 Fix mantis 3073: Additional Mainhall capabilities (from ngld)
Adds two new mainhall.tbl options:
1) "+Misc anim over doors:" (misc anim rendered after doors)
2) "+Cheat String:" (exchanges misc anim when cheat is entered)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10961 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
zookeeper 774ec066a4 Fix a render target bug by disabling environment mapping when doing full-scene RTT.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10959 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
niffiwan 9f768b8cff Doh! Assign, not equality!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10958 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
niffiwan f730df6c1a Fix Coverity ID 1093805 Uninitialized scalar variable
1st use of fbfire_info.bfi_flags so assign instead of |=

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10957 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:21 +10:00
niffiwan 5daa8d87d2 Fix Coverity 1093822 Uninitialized scalar variable
Set sensible looking defaults for the elems added to the beam_collision
struct since retail

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10956 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-30 20:41:20 +10:00
niffiwan 9314dc89da Fix gcc warnings in hud/hudtarget.cpp
declaration of ‘gauge_object’ shadows a member of 'this'
declaration of ‘esct’ shadows a global declaration [-Wshadow]
variable ‘srange’ set but not used [-Wunused-but-set-variable]
variable ‘ship_is_ballistic’ set but not used

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10955 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:18 +10:00
niffiwan 3cccc7cb13 Fix gcc warnings in hud/hud.cpp
declaration of ‘render’ shadows a member of 'this'
declaration of ‘font’ shadows a global declaration [-Wshadow]
variable ‘flags’ set but not used [-Wunused-but-set-variable]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10954 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:18 +10:00
niffiwan 71faaf3137 From MageKing17: tweak team colors
While we're looking at the Team Color code, let's have a warning if
someone tries to name a team 'none', and avoid pushing duplicate teams
to the Team_Names vector.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10953 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:18 +10:00
niffiwan 1a0ef281ed Fix gcc warning in io/keycontrol.cpp
suggest parentheses around ‘+’ in operand of ‘&’ [-Wparentheses]
This code previously worked only by fluke!

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10952 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 20:39:17 +10:00
z64555 021a0bd3a7 From MageKing17: Followup to r10914. Makes the name check ignore case.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10951 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan e2eddea231 Fix gcc warnings in globalincs/alphacolors.cpp
warning: declaration of ‘i’ shadows a previous local [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10950 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan 2b191eef2d Fix Coverity 1228854 Copy-paste error
Check pof_file_hud for "$POF target file:" not pof_file ("$POF file:")

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10949 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan e93c1e94b6 Fix Coverity ID 1228858 Missing varargs init or cleanup
In required_string_one_of(int arg_count, ...)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10948 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper 751861c397 Fixed bits missing from r10946.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10947 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper ae1c4435cf Turned the required SEXP variable arguments for add-background-bitmap and add-sun-bitmap into optional arguments.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10946 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper a23438f590 Fixed inverted normals in RTT if post-processing is on.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10945 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
zookeeper 6b404f1daa Fixed RTT bugs: 1) inverted geometry, 2) the output being mirrored both ways and a quarter of the output missing if post-processing is off.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10944 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
niffiwan 2838afdd60 Fix several gcc warnings in code/graphics/gropengldraw.cpp
variable ‘clipped’ set but not used [-Wunused-but-set-variable]
variable ‘swapped’ set but not used [-Wunused-but-set-variable]
the address of ‘Distortion_texture’ will always evaluate as ‘true’
[-Waddress]
declaration of ‘vertex’ shadows a global declaration [-Wshadow]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10943 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
Goober5000 0bd67304c4 a tweaked version of ngld's patch for additional main hall capabilities (see Mantis #3071)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10941 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:04 +10:00
Goober5000 6249638c5a use static casts to make our intentions clear and prevent compiler warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10940 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
Goober5000 5eeb6dd219 some const-correctness in preparation for the Mantis #3071 patch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10939 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
Goober5000 d04ae65f8b for Mantis #2064: remove ship template feature which never worked without crashing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10938 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
Goober5000 a30269bd3c for Mantis #2651: revert r10933, per forum discussion: http://www.hard-light.net/forums/index.php?topic=88047.0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10937 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
niffiwan 60bad89060 Fix gcc warning: ordered comparison of pointer with integer zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10935 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-27 13:03:03 +10:00
niffiwan ca31f9a402 Fix mantis 2651: from ZekeSulastin
Add support for up to 98 joystick buttons

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10933 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:29 +10:00
Goober5000 469e566b20 another localization patch by Yarn: disable character remapping when the game is running in Polish
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10932 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:29 +10:00
Goober5000 e13e37245e MageKing17's tweaks, with a couple of my own
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10931 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:29 +10:00
Goober5000 038ccffdaa Mantis #2999 - add docking log entries for support ships
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10930 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
niffiwan b19622cf96 Fix gcc warning in hud/hud.cpp
the address of ‘Hud_text_flash’ will always evaluate as ‘true’ [-Waddress]

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10929 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E 96e8e77f4e Fix for Mantis 3064 from MageKing17: Followup fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10928 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E b178fd0cbc Fix for Mantis 3076 from MageKing17: Fixes behaviour of animated textures on skyboxes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10927 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E d3ef69848c Fix for Mantis 3064 from MageKing17: Adds more functionality to colors.tbl. * "#Start Colors" is now optional; no more need for a blank section at the start of a colors.tbl just to define some team colors. * "#Interface Colors" section added for redefining various colors used by the interface. * "#Color Tags" section added for redefining or adding your own text color tags. * "#Default Text Color" section for choosing what color tag is the baseline default for various different screens. * And the big one, support for *-clr.tbm modular table files.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10926 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
The_E a5a1a0ff3b Patch for Mantis 3069 by MageKing17: Fixes help.tbl error reporting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10925 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:28 +10:00
Goober5000 6f80088695 for Mantis #2153: MageKing17's FRED support for error messages when wingmen have illegal weapons
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10924 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
Goober5000 905f0999c2 Yarn's patch which allows FreeSpace fonts to support all characters that exist in both Code Page 437 and Windows-1252
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10923 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
The_E 3eaf02c022 Fixes an unintended linebreak removal in previous commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10922 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
The_E 5bff2754c2 From MageKing17: Fixes for a couple of clang warnings.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10921 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
The_E 5e6746af43 From MageKing17: Improves sexp help text to clear up possible confusion about indexes that are zero-based.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10920 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
niffiwan d2cbf65e1e Fix mantis3054 (from ngld)
In weapon select screen check weapon model index is != -1 before drawing it

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10918 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-24 19:45:27 +10:00
m_m fca002ada8 From Axem: Add ba.getGameDifficulty() scripting function to get the current difficulty level.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10916 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E d3089bb406 Fix for Mantis 2882 by Mageking17 (change-team-color with None color results in error)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10914 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E b96b0e87d8 Removes nonfunctional debug code left over from the :V: days
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10911 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E 3d3fa6a749 Moving an assignment out of an if statement for better readability
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10910 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
The_E 514a8c3557 PVS Studio fix: Make the logic responsible for sending the builtin rearm messages behave as intended.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10909 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:32 +10:00
Goober5000 fe4b949c06 fix Mantis #3072 (crashes when using different languages)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10908 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
chief1983 ae351d2924 Fix Mantis 2886 - Option to render External weapon models, besides Tech models, in Weapon lab, from FUBAR.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10907 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
chief1983 4854087a18 Fix Mantis 2885 - SEXP flag to enable/disable primitive sensors, from FUBAR.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10906 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 831e0f3be7 Address clang warning: parameter 'x,' not found in the function declaration [-Wdocumentation]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10904 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 307923e8dd Address clang warning: unknown command tag name 'brieft'; did you mean 'brief'? [-Wdocumentation]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10903 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 eacf4d4e6e Address clang warning: parameter [x] not found in the function declaration [-Wdocumentation]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10902 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 2859e74ac9 Address clang warning: extra ';' after member function definition [-Wextra-semi]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10901 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Goober5000 98a6166956 follow-up to r7163: this makes the text display properly in-game, no Unicode support needed (thanks to Yarn for the patch)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10900 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 07cad23aed Address clang warning: commas at the end of enumerator lists are a C++11 extension
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10899 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 255fef6e47 Address clang warning: unused variable
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10898 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Echelon9 fc1b587cb6 Address clang warning: declaration shadows a field of 'HudGaugeRadarDradis' [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10897 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Goober5000 8cdfb029d3 add mod_table option for red-alert for delayed ships (Mantis #3055)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10895 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
Goober5000 2fe0ec8ef0 Yarn's patch for Mantis #3049 (character remapping in tstrings.tbl)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10894 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:31 +10:00
The_E 75f533a6fe Fix for Mantis 2960: Actually make sure that we're not performing invalid operations on a vector.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10887 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
The_E d6e0a731db From MageKing17: Patch for Mantis 3074: Correct mismatch between mission write and mission parse
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10886 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 327c67ff1d Address clang warnings - hud/hud.cpp:1310:3: warning: delete called on 'HudGauge' that has virtual functions but non-virtual destructor [-Wdelete-non-virtual-dtor]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10885 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 80e1ecee69 Address clang warning - hud/hudtarget.cpp:7224:12: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10884 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 02aa18c260 Address clang warning - io/keycontrol.cpp:2504:7: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10883 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
The_E 53e78033c6 Fix unintended linebreak removal from 10880
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10882 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 bc568a9149 Address clang warning - lab/lab.cpp:912:8: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10881 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
The_E 0d9cc00ba8 From MageKing17: Removes redundant function call
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10880 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:30 +10:00
Echelon9 46288483c9 Address clang warning - menuui/mainhallmenu.cpp:2141:9: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10879 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
The_E 580330c224 From MageKing17: Patch for a small issue in briefing text color spans
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10878 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 3f645215ad Address clang warning - object/collideshipweapon.cpp:258:17: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10877 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 d3f914a404 Address clang warning - ./ui/ui.h:291:7: warning: private field 'ignore_escape' is not used [-Wunused-private-field]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10876 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 7f9d879d7b Address clang warning - ./ship/shipfx.h:202:6: warning: private field 'stage' is not used [-Wunused-private-field]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10875 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 54de592835 Address clang warning - debugconsole/console.cpp:169:13: warning: declaration shadows a local variable [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10874 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 03c32c1648 Further tweak fix for Coverity 1093783 Uninitialized scalar variable, and remove redundant variable in opengl_light structure
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10873 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
Echelon9 713e291bdc Partially re-add the secure coding aspects of 10806 (which was rolled back in 10857). Fundamentally, the code in theora_open is written in a non-secure manner prior to this fix. That the callers currently appear per Goober to use it correctly is not the issue. There is no way of enforcing that contract as to length of the string unless it is internally handled in the function. Also Goober's comment that all callers use string lengths of MAX_FILENAME_LEN is incorrect. Examples trivially found that use the separate define NAME_LENGTH, which could be changed in future.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10872 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-14 19:02:29 +10:00
chief1983 137eb7e4d4 Fix Mantis #2790, Easy options should be just that again.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10869 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
chief1983 f89d864756 Fix Mantis #3070, courtesy of Yarn.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10868 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 7a56e7ff4a Fix Clang warnings about incorrect type given different pointer sizes for the architecture. Use the standard compliant ptrdiff_t
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10867 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 a0ed86d6bc Remove a tautological Assert(), which cannot be triggered due to the type
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10866 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Goober5000 475e4d5d35 Yarn's fix for Mantis #2362 (scale images properly with show-subtitle-image)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10865 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Goober5000 3743449a42 from MageKing17: choose alt_names and callsigns by array index instead of substring; fixes Mantis #2934
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10864 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Goober5000 79b73f241b MageKing17's patch for callsigns not resetting when the mission is cleared (Mantis #2934)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10863 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 2da2527207 Quieten a number of warnings related to UI_USERBOX without a declaration yet. Added TODO.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10862 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 f8ef768bbf Address Clang warnings are overloaded virtual functions in UI_GADET. Also opportunity to simplify code by making the most of inherited polymorphism. Docs cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10861 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:09 +10:00
Echelon9 522eb962ff Fix a range of issue identified via clang warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10860 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 ad761f980f fix a bug introduced by r10852: MAX_OBJECTS is not a valid object index
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10859 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 41d7f2408c fix a bug introduced by r10837: 0 is a valid path index
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10858 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 7c07151e26 roll back r10806 because 1) all callers to this function have names which are MAX_FILENAME_LEN in size; and 2) the memset already sets all characters to 0, so there's no need to add a null terminator
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10857 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Goober5000 05e0af6ebd the minimum macro is defined as MIN in FSO to avoid conflicts; no need to #undef (since rev 10796 uses MIN anyway)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10856 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 d37e4c567d Fix Coverity #1093706 Negative array index read in scoring_eval_kill_on_weapon()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10855 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 130ed7c7e3 Fix Coverity #1093707 Negative array index read in start_ship_animation()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10854 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 8d6e82c3bc Fix Coverity #1093711 Negative array index read in event_music_enemy_arrival()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10853 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 823c144ecc Fix Coverity #1093715 Negative array index read in maybe_weapon_detonate()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10852 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 abc0fd11b5 Fix Coverity #1093720 Negative array index read in ai_big_maybe_follow_subsys_path()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10851 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:08 +10:00
Echelon9 c3494516bd Fix Coverity #1093544 Negative array index read in multi_ts_handle_mouse()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10850 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
Echelon9 9cbd23d2e9 Fix Coverity #1093783 Uninitialized scalar variable in gr_opengl_set_center_alpha()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10849 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
Echelon9 8cbb46f40c Fix Coverity #1224006 Uninitialized scalar variable in nebl_generate_section()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10848 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
Echelon9 c85caef631 Fix Coverity #1224005 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10847 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
The_E 3545cacda0 From MageKing17: Patch for Mantis 761(!): Text color tags do not work in debriefings. Also allows color spans in text to cover line breaks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10846 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
The_E 7be5b03c62 From MageKing17: Patch form Mantis 3067 (Nebula flashing not following player view point)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10845 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
niffiwan 027f218f7f Allow any resolution for mainhalls (From Yarn)
Also includes support for more than two mainhall resolutions, zooming
so one mainhall can adapt to multiple resolutions, setting new mainhall
fonts, help overlays for all resolutions and adjustable tooltip padding.
Also allows preload screens to be any resolution & aspect ratio.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10844 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:07 +10:00
z64555 cdb954f333 Fixes mantis 2877: $Type and $Category entries in controlconfigdefaults.tbl would not properly parse. #defines and enumerated names in the controls code (Such as TAB_SHIP and the various CC_TYPE's) may now be used in the .tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10843 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:06 +10:00
The_E 8c1bef0415 From FUBAR: Patch for Mantis 2842 (Adds new section to game_settings.tbl called "#FRED SETTINGS". Also adds a parameter for it, "$Disable Hard Coded Message Head Ani Files:", a boolean value that controls whether FRED fills the head ani selection in the Event Editor with the retail head ani names)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10842 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:06 +10:00
The_E c07d792e4e From FUBAR: Patch for Mantis 2872 (Make FRED emit a warning for invalid ship classes in a mission file)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10841 387891d4-d844-0410-90c0-e4c51a9137d3
2014-07-05 10:38:06 +10:00
niffiwan 545fd5e6ac Fix mantis 3056
In redalert loadout, only store the current number of banks in use by
ships, not all banks where the weapon idx is -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10840 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 18:54:31 +10:00
Echelon9 c837a21f0d Now that standalone server is support on more than Windows, ensure its features are applied as consistently as possible
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10839 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 666f53e44b Fix Coverity #1093598 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10838 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 edad644595 Fix Coverity #1093597 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10837 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 82058a8c99 Fix Coverity #1093552 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10836 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 ae6365bc35 Fix Coverity #1093545 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10835 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
Echelon9 c2122f9767 Fix Coverity #1093544 Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10834 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
zookeeper 8e0304a58f Fixed a bug in normal maps caused by a redundant and float-inaccurate calculation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10833 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
niffiwan 2740cf5ea2 Allow missions to exit to mainhall on successful completion
Activate with either a mission flag, or the 3rd parameter to the
end-mission sexp. Covers ending via the debrief, skipped from dying
5x times or skipped training mission
Does NOT work for redalert missions or multi (yet)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10832 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-26 16:54:17 +10:00
niffiwan 322d1f39e0 Fix mantis 2945 (From MageKing17)
Don't set PF_PROJECTED in g3_transfer_vertex() as it's not projecting
the vertex
Note: displaying nebula emp/lightning used to depend on unitialised data!

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10828 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
Zacam cc36ac9faf Follow-up to r10793, missed a spot of [more]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10827 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
m_m a45e930047 Fix for Mantis 3063: Animation code-related sound entries doesn't use new sound format
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10826 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
The_E 83ffa764b5 Fix for Mantis 3016 part 2 (Make FRED respect the Briefing Window FOV setting in game_settings.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10825 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:54 +10:00
The_E 54787e8402 Fix for Mantis 3016 (Briefing window FOV different from retail). Also adds a new setting to game_settings.tbl, "$Briefing Window FOV:" under Graphics, which takes a single float argument to set the FOV of the briefing window.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10824 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E 8da0ac791e From MageKing17: Patch for Mantis 3060 (Beam particles not generated correctly in certain cases)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10823 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E 971192ab30 From MageKing17: Patch for Mantis 3061 (Turrets can't have an initial rotation defined)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10822 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E 505e1e77f5 From MageKing17: Patch for Mantis 3012 (Various issues with ships in nebula)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10821 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
The_E cba1eb07db Fix for Mantis 2982: Removes superfluous Assert.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10820 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
CommanderDJ 358e2ab4fc Fix Mantis 2773: Models turn black when full nebula enabled in FRED.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10819 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
niffiwan f5199ea122 Fix mantis 2929
Save shortcut rank to the csg flags & bump csg version
Add function to read the csg rank during pilotfile::verify()
Reorder 'find pilots' call so that Game_mode is valid for verify

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10818 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-19 20:12:53 +10:00
niffiwan 603a4086f5 Fix mantis 2920: prevent pilots switching languages
In other words, a pilot can only be used in the same language it was
created with. Checks both the initial selection screen and in the
barracks.
Also fixes issue with PLR version being ignored in pilotfile::verify()

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10817 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
niffiwan 05adea0e25 Fix mantis 2923
Backout all_time and multi_stats from the pilotfile stats as
required

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10816 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 3f752b9a40 Address Coverity 1093687 Resource leak in os_init_cmdline() that would occur when the -parse_cmdline_only flag was set. Refactored to improve readability at the same time. Order of precedence remains data/cmdline_fso.cfg, per-user cmdline_fso.cfg (on Linux and Mac), then actual commandline. The presence of -parse_cmdline_only will ignore all settings in on-disk cmdline_fso.cfg files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10815 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 55f34b1b58 Address Coverity 1093378 and 1093379 Resource leaks in object ChttpGet::ChttpGet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10814 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 a0f31e6dc5 Address Coverity 1093380 Resource leak in object CFtpGet::CFtpGet()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10813 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 f5a9d32d14 Address Coverity 1093781 and 1093782 Uninitialized scalar variables in cftp.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10812 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 d0b786fe87 Address Coverity 1093635 Out-of-bounds read in multi_team_report()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10811 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 d8e26c8e02 Address Coverity 1212011 Unchecked return value in DCF(multi oo)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10810 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 05991a9fbf Address Coverity 1107318 Logically dead code in outwnd_print(), check for NULL id has already occurred
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10809 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 55af81050d Fix Mantis 3059: Coverity 1204289 String not null terminated in cf_search_root_pack()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10808 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 27495abda6 Address Coverity 1093373 Copy-paste error in vm_find_bounding_sphere()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10807 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:36 +10:00
Echelon9 129a2d0d85 Address Coverity 1204290 Copy into fixed size buffer - strncpy() should be restricted by length to that of the target string, and does not guarantee null termination if the source string overran
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10806 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:35 +10:00
Echelon9 1883fcb8ae Address Coverity 1093663: Out-of-bounds access with memcpy() in multi_oo_pack_data() for clients only
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10805 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:35 +10:00
niffiwan 2ea048ee51 Fix mantis 3005: add arg so end-campaign sexp can ignore the death screen
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10804 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 20:29:35 +10:00
niffiwan c4978d3661 Fix r10801 (thanks to MageKing17 for noticing this)
Really avoid using -1 as an array index

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10803 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
chief1983 d2ffd40d67 Fix an assertion logic reversal in r10797, spotted by MageKing17.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10802 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
niffiwan e86d0c573d Fix pilot conversion issue (followup to r9630)
-1 is a valid weapon index, but avoid indexing the array with it

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10801 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Zacam 1d6e173023 Fix for Mantis 3058: On warp out, glowpoints still stay "on" and in mission space without a ship; from MageKing17
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10799 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Zacam 2db5a3b991 Fix for Mantis 2725: Beam sounds not panning correctly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10798 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Zacam 3e22cc0d54 Fix for Mantis 3057: Loadout (Ship/Weapon Select effect) rendering black models or no effect. Also corrects wireframe color for FS2 effect from black to blue. Committed on behalf of MageKing17.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10797 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
m_m 3390ba23a0 Fix for Mantis issue 2891: gr.drawString text box height irregular
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10796 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
niffiwan 1f246b7de1 Coverity ID 1093586 Negative array index read
Shouldn't be able to occur since when artillery_objnum is set to -1,
artillery_lock_time is also set to 0.0f. BUT, protect the array
access anyway in case the surrounding code changes in future.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10794 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
Goober5000 35096fd957 use the [more] color, per MageKing17's previous changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10793 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:20 +10:00
niffiwan 1bd98325bd Coverity ID 1093722 Negative array index read
Move -1 check to before the convinience ptr is created & used

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10788 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-14 13:07:19 +10:00
niffiwan 06b0eb8d35 Fix mantis 3051 (From MageKing17)
Only store CPVs on accepting mission results
Add copy of CPVs to missioncampaign and pilot .csg so redalert missions
can rollback the CPVs if required

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10786 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:53 +10:00
niffiwan 5801bd47ea Coverity ID 1093538 Negative array index read
Change unknown +Default Ship index (-1) to 1st ship index (0)
Fix loop iteration
Change Assert to Assertion

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10774 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:53 +10:00
niffiwan a545580a5a Coverity ID 1093533 Negative array index read
This negative read occurs regularly, but it'd be very very rare for that
random read value to evaluate to OBJ_WEAPON and cause further issues.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10773 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:53 +10:00
niffiwan 3b77e65f5f Raise MAX_PATH_LEN to 256 so FSO can run in long paths
Specifically avoid one issue with running FSO in the default Steam dir
Converted some magic 128/127 numbers to MAX_PATH_LEN
Convert some Int3() into more friendly errors
Stopgap measure until proper fix added with compressed VP support
Fix mantis 3028

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10772 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
zookeeper 3a3e8599df Removed an assert checking for a condition which can rarely be false (presumably due to inaccuracy in vector normalization) but which doesn't actually need to be true.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10766 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
niffiwan 9da72db80e Coverity 1221482: Dereference after null check
Stop Ctrl-PgUp/PgDown crashing when a briefing icon is not in closeup mode

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10764 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
niffiwan e3ebdd3ce9 Coverity ID 1221483: Missing break in switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10763 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-09 13:48:52 +10:00
niffiwan 8baa713ef8 Fix a few gcc compile errors introduced by r10756
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10760 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-07 12:37:26 +10:00
The_E 147bf23067 Catch a lua error that apparently can happen
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10759 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-07 12:37:26 +10:00
niffiwan fdd8666524 Fix mantis 3048 (From MageKing17)
Fix "more" & offsets in [cmd|de|]briefings

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10758 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-07 12:37:26 +10:00
m_m d84d9d31aa Added multiple scripting features related to messaging as requested by Axem.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10756 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:18 +10:00
m_m 6d5b5ddde1 Add support for voice acting in fiction viewer.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10755 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:18 +10:00
niffiwan f54429d49f Fix mantis 3041
Allow set-skybox-model to set skybox flags (with FRED support - thanks
m!m)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10754 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 8e1c4be1b6 quotes can span multiple lines as well, so let's keep track of that flag (fixes Mantis #3001)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10753 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 e10550cdbd fix a bug in the when-argument sexp that managed to escape detection from its original design! spotted by MageKing17, fixes Mantis #3052
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10748 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 a1e5d76c02 roll back r10741 pending further code review; see Mantis #3052
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10743 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
Goober5000 cf8c06f850 follow-up to r10734: in the event of any SND_F flags being added in the future, this is more future-proof
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10742 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
The_E c562e34516 From MageKing17: Fix for Mantis 3502 (Flush the sexp result tree after argument evaluation to avert accidental short-circuit results)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10741 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-06 16:51:17 +10:00
niffiwan 28c31c9ba2 Fix mantis 3053 (From MageKing17)
Check KEY_DEBUGGED1 to allow event.log snapshot to trigger when using
release+cheats

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10740 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:30:00 +10:00
niffiwan e926d6bad0 Fix mantis 2812 (From Yarn)
Add modular help tables and allow more than 2 help overlays

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10739 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:30:00 +10:00
The_E 52331f89a2 Stopgap fix to avert a crash in get_subsystem_world_pos later on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10738 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 f995298abf Fix Coverity 1093663: Out-of-bounds access in multi_oo_pack_data()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10737 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 62b9833bf0 Fix Coverity 1093638, 1093640 and 1093667: Out-of-bounds access in tcp_client.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10736 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 0279040e80 Fix Coverity 1093799 Uninitialized scalar variable -- initialise array contents to zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10735 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 ff38404cac Fix Coverity 1093788 Uninitialized scalar variable - no need for bitwise AND when value is so far unset
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10734 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 a779ee3ed4 Fix Coverity 1093783 Uninitialized scalar variable with opengl_light structure in gr_opengl_set_center_alpha()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10733 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
Echelon9 4033465143 Fix Coverity reports of Uninitialized scalar variable with the vertex struct. Should vertex ever be converted to a class from a struct, these memsets as well as the pre-existing ones will need to be removed in favour of a proper constructor of the then vertex class.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10732 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:59 +10:00
niffiwan e7d041c332 Fix mantis 2940
Only reset pilotfile stats when the local Player is reset

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10722 387891d4-d844-0410-90c0-e4c51a9137d3
2014-06-02 18:29:58 +10:00
m_m c1b2d7c1ee Fix for Mantis 3045: gr.drawImage()'s UV arguments aren't working properly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10721 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
Goober5000 53e5ba5913 remove Import Weapon Loadouts feature, which was mainly used for versions of FSPort prior to 3.0 and was broken from r2768 to r10718 anyway
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10720 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
The_E 154a1a6c76 Removing dead and potentially confusing code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10719 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
Goober5000 9fdfde9ae6 restore a strcpy that was accidentally removed in r2768 (fixes Mantis #3046)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10718 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
The_E d5388ad4bf Fixes crash in the texture replacement editor: Erasing the end element of a size 0 vector is probably not a safe thing to do
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10717 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-25 19:03:50 +10:00
niffiwan c27079fb7a Fix Coverity ID 1215457 Out-of-bounds write
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10716 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-24 09:35:04 +10:00
niffiwan e037571170 Fix Coverity ID 1215458 Uninitialized pointer field
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10715 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-24 09:35:04 +10:00
z64555 d5e81f4561 Fixes 3039: C++ STL was having data race issues with instantiating the debug_commands and the vector that was supposed to reference them. Seems like ✌️ ran into this issue a few times before...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10712 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-23 22:04:59 +10:00
The_E 003d5e5a2a Amendment to 10706: INT, FLOAT and STRING are already defined symbols on Windows, I've changed them to AT_INT etc so that compilation can happen.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10710 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-22 20:49:29 +10:00
niffiwan e31a8be138 Fix mantis 3026
Update Linux --help option to show all cmdline options
Added data/checks for expected args to cmdline options
Add extra const-ness per m!m review

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10706 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
m_m a6a41efa84 Add support for countermeasures that will pull aspect seekers away from their previous targets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10705 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
The_E 3344f554f9 More ship flag/ship info flag confusion cleared up
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10704 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
The_E 2c59a39bf6 See 10701, same issue here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10702 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
The_E 3e1d0082c4 Checking a ship_info flag against a ship flag isn't going to work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10701 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
chief1983 b4785ea039 Add some lib locations for Solaris for software installed from OpenCSW.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10695 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-20 19:12:37 +10:00
asarium 6c16d0a890 Revert "Add support for countermeasures that will pull aspect seekers away from their previous targets."
This reverts commit 263ed7f05d.
2014-05-17 22:17:57 +02:00
asarium 263ed7f05d Add support for countermeasures that will pull aspect seekers away from their previous targets. 2014-05-17 22:12:37 +02:00
niffiwan 8da9a68d31 Fix assertion when entering barracks in debug
Assert that there's one more line free, not number-of-ships lines

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10689 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
The_E c22fd46f18 Change the "Report Bug" button's URL to scp.indiegames.us
In other news, did you know that FRED has a "Report Bug" button in its About dialog?

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10666 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan bd64590ec1 Fix mantis 2981
Read & write pilot loop data in the same order

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10665 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan ec90cae8d9 Fix Coverity ID 1212016 Copy into fixed size buffer
replace strcpy with strcpy_s

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10662 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan e199a928c4 Fix Coverity ID 1212017 Copy into fixed size buffer
replace strcpy with strcpy_s

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10661 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan 3890ca6928 Fix Coverity ID 1212013 Macro compares unsigned to 0
Use MAX instead of CLAMP

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10660 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:12 +10:00
niffiwan 6b955bb7b8 Fix Coverity ID 1212014. Unsigned compared against 0
Removed the >= 0 check

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10659 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:11 +10:00
niffiwan cc21af0d08 Fix Coverity ID 1212015.
Check the pointers value vs '\0', not the pointer

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10658 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:11 +10:00
z64555 153cb7dc79 Debug console. Now with more intuitive pagination from the help list!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10654 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-15 18:24:11 +10:00
niffiwan 5ccfbe1119 Remove GCC Warning (unused-variable)
Since token_str is only used in 1x .cpp, move the declaration from
the .h to the .cpp

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10653 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:38 +10:00
z64555 2903bbee1f Resolves complaints from VC6 about several instances of find_if that were not scoped properly. None of the other compilers seemed to have noticed...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10647 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:38 +10:00
z64555 c6e9736c18 Resolves some warnings concerning signed/unsigned comparisons. Fixes a typo with a DCF_BOOL output message. Fixes compiling on MSVS 6.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10646 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:38 +10:00
zookeeper 9b822a3fa7 Fixed gr.drawOffscreenIndicator() returning wrongly scaled coordinates.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10645 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
The_E cc8f3d2b21 Fixes another C4800: Conversion from int to bool warning
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10632 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
The_E e3421897b9 fixes a bunch of C4800 warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10631 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
zookeeper 90c0e77250 Fixed missing closing tags.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10629 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 5e21ff72b9 Revert some accidental solution file changes from the debug console commit.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10627 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 f11188246b Fix debug console compiling error on Linux.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10626 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 5b8728411f Add debugconsole files to makefile. Also, remove lingering reference to dbugfile.h which was deleted in r7857.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10625 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 4dcf6a62ee Add debugconsole to Xcode 3 project.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10624 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
chief1983 92d9b8b308 Redo the LastUpgradeVersion part of r10558.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10623 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
z64555 8d5fbab768 z64555's debug console. Take 2. Includes changes to most (not Xcode) project files to include the added files of r10621
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10622 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:37 +10:00
z64555 f18f8a9ea7 debug console amendment, these files got ignored, somehow.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10621 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:36 +10:00
The_E 98355da7d5 Revert 10619: Missing files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10620 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:36 +10:00
z64555 2b2ba832f8 z64555's debug console.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10619 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:36 +10:00
zookeeper edc515e681 Fixed Mantis #3037; surface shields will again check for a shield mesh collision before hull collision.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10618 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:35 +10:00
zookeeper c80484f890 Clarified documentation of gr.drawPolygon and gr.drawSphere.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10616 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-08 19:18:35 +10:00
niffiwan b42f468552 Fix issues added in r10587
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10611 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:23 +10:00
niffiwan a861372efc Add lua campaign lib & functions to retrieve mission filenames
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10602 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:23 +10:00
niffiwan 7c3631002b From Yarn: Fix mantis 3031
Use PF_USE_AFFIRMATIVE_ICON where necessary

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10601 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:23 +10:00
Echelon9 67ccdfb6d3 Fix Mantis Issue #2976: AddressSanitizer: global-buffer-overflow in firing_aspect_seeking_bomb()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10596 387891d4-d844-0410-90c0-e4c51a9137d3
2014-05-04 20:52:22 +10:00
karajorma bb7e894107 Output how much of the player's score comes from the currently displayed list of kills by ship type in the barracks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10595 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 8267319073 Resolve build errors reported on MSVC in beam_ok_to_fire()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10594 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 c1fdd9a58c Correct the cast to size_t in buffer_data constructors
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10593 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 a7e1390397 Fix Mantis Issue 3035: AddressSanitizer: double-free in interp_configure_vertex_buffers() of memory contained in buffer_data object. Add a copy-constructor and copy-assignment operator which are required as we manage our own memory in buffer_data
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10592 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:45 +10:00
Echelon9 ceeabbf805 Reverse commit in r10558. Given we regularly have users provide Debug logs, this will prevent that small subset with only 32bit Mac's from running a Debug build
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10588 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-25 16:04:44 +10:00
niffiwan b1ca9a33da Fix mantis 2950: make shields-on/shields-off multi compatible
Fix multi player for alter-ship-flag

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10587 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 974bf06237 Fix Coverity 1093381: Resource leak in object due to absence of destructor. Provided that release() has already been called, which would mean memory has been cleaned up on most paths, this destructor will be in essence a NOP (or close to it). If memory has typically not been cleaned up already, this addition will improve memory usage over time.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10581 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 b36f1c1709 Fix Coverity 1093306: Whilst the return value was not checked in beam.cpp, the correct fix is to convert the function to void given no location actually checks the return value.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10580 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 bdd192a17d Fix Coverity 1093302: Unchecked return value. This is the only occasion where the return value of ship_get_by_signature() is not checked. Likely oversight.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10579 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 5268ef1916 Related to Coverity 1093623: The self-assignment at present has no effect
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10578 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 26ee96a012 Fix Coverity 1093493: Missing break in switch statement. No logical reason why LE_ORDER_EVADE should fall through to LE_ORDER_STAY_NEAR. Only switch statement in block without a break statement further indicates an oversight.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10577 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 389f4b3dfb Fix Coverity 1093376: Copy-paste error in ade_table_entry::OutputMeta()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10576 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:26 +10:00
Echelon9 1205336fee Fix Coverity 1194949: Copy-paste error in gr_opengl_bitmap_ex()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10575 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
chief1983 0bb037bb85 Removes the DS_Store hidden files from the Xcode4 Frameworks archive.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10572 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
chief1983 46c61fcbcf Unify all the revision placeholders out to 6 digits for increased regex replacement reliablity.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10570 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
chief1983 f903da75e3 Increase Xcode and Xcode4 version and filename consistency with other platforms.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10569 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
Echelon9 3c155fd888 Fix Mantis Issue #3033: AddressSanitizer: global-buffer-overflow in shockwave_move()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10568 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
Echelon9 308179256a Fix Mantis Issue 3032: AddressSanitizer: SEGV on unknown address 0x00000000f000 in texture_info::LoadTexture()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10567 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:25 +10:00
zookeeper a20f54957c Ported r10282 from zookeeper branch: added a new #SOUND SETTINGS section to game_settings.tbl and in it overrides for the default sound, music and voice volume.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10563 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:24 +10:00
zookeeper 1f2f6d8d8e Ported r10395 from zookeeper branch: made the Shields handle support non-quadrant shields.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10562 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:24 +10:00
zookeeper 636f903f72 Ported r10442 from zookeeper branch: increased the arrival/departure paths restriction dialog's width by 100px so even longer path names will be fully visible.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10561 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-22 19:22:24 +10:00
Echelon9 01d718f8e9 Project files in Xcode4 folder adopt latest suggested project file settings from Xcode 5.1.1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10558 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
Echelon9 7e47598eb9 Fix issue 3030: Clang warning: semantic issue, '&&' within '||' in gr_[re|un]size_screen_pos() and gr_[re|un]size_screen_posf()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10557 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
Echelon9 7aaa5fa4a1 Fix Mantis 3029: Clang warning: expression result unused in multi_pinfo_blit_squadron_logo()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10556 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
m_m 77d7871266 Fix for Mantis 3027: Crash if ship AI is forced to change target
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10552 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
m_m d3dde35341 Fix for an invalid index crash.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10550 387891d4-d844-0410-90c0-e4c51a9137d3
2014-04-14 19:40:17 +10:00
niffiwan 3a113e6176 Remove gcc warnings (unused)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10548 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-31 17:28:25 +10:00
The_E 6e91857745 From Yarn: Fixes interface graphics scaling issues. If, for some reason, you want to have the interface graphics stretched, use the -stretch_menu commandline flag.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10544 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan c5417c1909 Fix mantis 3025: pass lua HookVar integer data as an integer, not a struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10543 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Goober5000 d195c97056 Yarn's fix for Mantis #3024
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10531 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Goober5000 c5a7223943 this will likely fix Mantis #3013
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10530 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
The_E 4f39ef2e07 Fix for Mantis 3023 by Yarn: Make sure the vasudan mainhall fun cheat works again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10519 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
The_E 07980be92e Fix for Mantis 3015: Makes sure rotation values are always in the 0-359 degree range
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10518 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 08280e3d9e Remove gcc warnings (unused & shadow)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10517 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan ca17188572 Fix mantis 2921: start mainhall music when leaving the credits state
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10507 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Goober5000 d7b6a1ac6f add briefing icons for ship-with-cargo and wing-with-cargo
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10506 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
zookeeper 7099170497 Changed the label of the "Broadcast Locally" multiplayer option from "/multidata" to "Broadcast Locally".
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10498 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 7f1a2c734f From Axem: fix newly added hud gauge sexps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10497 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
karajorma 2356f04f04 Yarn's fix for Mantis 3017 (Certain HUD elements don't work after the changes to strings.tbl). Not very happy with the way it fixes thing (it only solves problems for French, German and Polish, which kinda makes the changes to strings.tbl in r9761 somewhat pointless) but it makes sense to wait for SDL and truetype support and then fix everything properly then.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10496 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
niffiwan 55bec33861 From Axem & niffiwan: stop briefing/credits/mainhall music with scripting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10495 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
m_m 626269d4a4 Fix for Mantis 3018: Setting a weapon's Target/HomingObject/HomingPosition etc doesn't work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10494 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-30 12:39:54 +10:00
Fabian Woltermann 083905b4f8 Merge pull request #16 from asarium/fix/hudmessage
Fix a crash with invalid iterators
2014-03-16 22:57:45 +01:00
asarium 31d6ca5a0e Fix a crash with invalid iterators 2014-03-16 22:32:10 +01:00
niffiwan 3f349849d6 Fix mantis 3019: flush bitmap to prevent alpha-additive-blend shenanigans with lua drawRectangle
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10493 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:32 +10:00
Goober5000 ff675c3653 New method of handling quotes and comments that examines lines character by character like most languages do, instead of just searching for the start of a comment. If a comment character is inside a quoted string, it will not kick off a new comment. (This actually fixes the core design flaw that caused semicolons to truncate messages, so the $semicolon tag is technically no longer necessary. It will still be kept, of course.) Fixes Mantis #3001.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10492 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:32 +10:00
Goober5000 0eb5606527 the #define already has a (char)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10491 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
niffiwan 2f22873e35 From Axem: add hud-set-custom-gauge-active and hud-set-retail-gauge active
Deprecates hud-set-active-gauge and hud-activate-gauge-type in favor of hud-set-custom-gauge-active and hud-set-retail-gauge active, which are clearer to understand and now accept INT_MAX number of gauges, instead of just 1.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10489 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
Goober5000 03144d3846 going through old revisions, r8540 is wrong, since it was like that in trunk -- memsetting the whole struct to -1 sets all integers and floats to -1 (so let's go back to the old way in case some old retail code relied on model_instance_num, model_num, or submodel_num being set to -1)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10481 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
m_m 638ad77a21 Add a scripting hook variable that specifies the mouse buttons. This variable is named MouseButton and is a bit field which uses the MOUSE_* defines (index 0 for right, 1 for left, 2 for middle).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10477 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
niffiwan 4e98285d2a Followup to mantis 3009; missed the Lead Sight gauge in the 1st fix
Rechecked all other gauges that set slew=true in their contructors
(vs 1st pass which checked gauges that set slew=true in hudparse.cpp)
I think I got them all now...

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10476 387891d4-d844-0410-90c0-e4c51a9137d3
2014-03-14 19:50:31 +10:00
karajorma a7428c5a72 Bigger (and better?) Briefing and Debriefing editors courtesy of Axem.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10475 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-26 21:37:14 +10:00
zookeeper 6f906561bb Fixed oversight in r10430: the $Weapon class hook condition didn't work on $Weapon Collision hooks if the other object was an asteroid.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10474 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:02 +10:00
Zacam 3ef41e164c I think we can allow for 32bit Color Depth to be the default option now.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10473 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:02 +10:00
karajorma 159d8e7107 Fix a bug where you couldn't press g to start a mission in debug builds.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10471 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma b4dad30c77 Add a SEXP for checking the current state of ship flags.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10470 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma 64efaddaab Make the Mission Objectives editor a little larger. Cause why not?
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10469 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma ebfdf4e901 Fix a bug with the event.log where SEXPs which weren't in events would also write data to the log.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10467 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
karajorma 5dc4bfea97 Fix a bug with the multiplayer SEXP code. The callback functions write to the packet and thus can also make it go out of bounds.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10466 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
m_m 05702504c4 Fix for Coverity 1107332: Negative array index read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10464 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
m_m 08dad5b3af Add -no_unfocused_pause option.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10463 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-23 13:41:01 +10:00
niffiwan a2b42bf5f1 Fix mantis 3009: set slew correctly for hud gauges
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10462 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:35 +10:00
m_m 3490ac3a9c Add lua function to get a handle of the current player
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10446 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
The_E 37ded5589d Adds set-motion-debris-override sexp. This can be used to control the presence of motion debris, and overrides any user choice made through the -nomotiondebris commandline flag.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10445 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
zookeeper cef02e7b9f Clarified which time units are expected by camera.setOrientation() and camera.setPosition().
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10431 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
zookeeper a72f0f9d62 Allowed the $Weapon class hook condition to work on $Weapon Collision hooks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10430 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 6d5e026a3e Mantis #3004: don't remove subspace drives from support ships
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10429 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 df73bacb9e Mantis #3004: standardize checks for whether ships can depart to docking bays, and whether departure goals are achievable, and whether a ship can be commanded to depart; also fix the default behavior if a ship attempts to warp out but is unable to
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10428 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
m_m d97f31d034 Fix for Coverity Issue 1166829: Dereference before null check
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10411 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 a880bcb9c2 Mantis #3004: ship_get_ship_with_dock_bay was written in such a way that it allowed a negative array index to create all sorts of havoc
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10407 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 dbe5f61dd6 following up from r10000 and r10004, fix the hud squad message display for support ship aborts (and in the process optimize things slightly)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10406 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 0a9063a525 wing names with the hash at the beginning aren't subject to the name bashing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10405 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:34 +10:00
Goober5000 827286ec95 only warn once, because old missions tended to have a *lot* of these broken +Team values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10404 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
karajorma aeb089b216 If we've already written the content of CTEXT(n) to a variable, we should use that, rather than calling CTEXT(n) 500+ times.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10403 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
m_m 5fa9a5c946 Fix for Coverity 1147623: Out-of-bounds access
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10393 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
m_m 0d54630e83 Fix for Coverity 1107329: Improper use of negative value
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10392 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-20 18:27:33 +10:00
Echelon9 f97e478c6d Fix Coverity 1093576 Improper use of negative value: In model_collide_flatpoly(unsigned char *): Negative value can be returned from function is not being checked before being used improperly (CWE-394). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10391 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 3b19fab1c1 Fix Coverity 1093446 Dereference after null check: In obj_snd_stop_all(): Pointer is checked against null but then dereferenced anyway (CWE-476). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10390 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 6d52a7c2b2 Fix Coverity 1093407 Logically dead code: In model_interp_sub(void *, polymodel *, bsp_info *, int): Code can never be reached because of a logical contradiction (CWE-561). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10389 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 0288075eb0 Fix Coverity 1093392 Logically dead code: In obj_snd_assign(int, int, vec3d *, int, int, ship_subsys *): Code can never be reached because of a logical contradiction (CWE-561). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10388 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 cf0928ab8c Fix Coverity 1129278 Uninitialized scalar field: In object::object(): A scalar field is not initialized by the constructor (CWE-457). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10387 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 b2231f28d1 Fix Coverity 1102734 Uninitialized scalar field: In collider_pair::collider_pair(): A scalar field is not initialized by the constructor (CWE-457). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10386 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 846cdad098 Fix Coverity 1107319 Copy-paste error: In collide_weapon_weapon(obj_pair *): A copied piece of code is inconsistent with the original (CWE-398). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10385 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:50 +10:00
Echelon9 64dad52741 Fix Coverity 1093455 Dereference after null check: In read_model_file(polymodel *, char *, int, model_subsystem *, int): Pointer is checked against null but then dereferenced anyway (CWE-476). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10384 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 2936dde64f Fix Coverity 1093728 Allocation size mismatch: In model_allocate_interp_data(int, int, int): Allocation size is not a multiple of the target pointer's pointed-to type (CWE-131). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10383 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 f02cba4090 Fix Coverity 1093413 Logically dead code: In model_collide_sub(void *): Code can never be reached because of a logical contradiction (CWE-561). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10382 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 7241a6b686 Fix Coverity 1093669 Out-of-bounds access: In triggered_rotation::add_queue(queued_animation *, int): Out-of-bounds access to a buffer (CWE-119). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10381 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 0572c25aa1 Fix Coverity 1093859: Uninitialized scalar field In mst_info::​mst_info(): A scalar field is not initialized by the constructor (CWE-457). From Flaming_Sword.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10380 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 d503d1d42e Expand the .gitignore exclusions to cover modern Xcode project local files. Based off StackOverflow suggestions as documented.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10379 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
Echelon9 0b494959e1 Fix Mantis 2997: Make +Bitmap a required table item if a weapon trail has been set
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10378 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
karajorma f9f2b1e8d7 There was some confusion about the old help text.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10377 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
The_E e4009799c6 Remove a pointless, ✌️ original assert (All ships should be able to send messages regardless of whether they're flyable; checking whether they are accomplishes literally nothing)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10376 387891d4-d844-0410-90c0-e4c51a9137d3
2014-02-02 10:52:49 +10:00
The_E d36fc2a88e Remove per-campaign detail settings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10351 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
The_E 6b39db6b12 Remove a superfluous $ sign from gauge_load_common, which was messing up hud_gauges tables that defined differing fonts for hud gauges.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10350 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
zookeeper 6e8a90fbbc Fixed targethit1 -> targhit1 in an error message.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10349 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
zookeeper 0794dcded3 Another little Lua documentation fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10348 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
zookeeper dc37d2e5de Two small Lua documentation fixes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10347 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:26:00 +10:00
m_m 5050494c45 Fix for Coverity 1135848
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10311 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
niffiwan c08aaf1ec2 Coverity ID 1093440: Evaluation order violation in weapon_create()
Related to weapon substitution code
Also a gcc warning (sequence point)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10301 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
m_m 8fb2a7ffad Add -profile_write_file options to write frame times to a file. See Wiki for more information.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10299 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
zookeeper 0cac254b04 Fixed Mantis #3000.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10298 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-31 17:25:59 +10:00
niffiwan 9f67d2e337 From Admiral MS: add scripting function to get the waypoint-list of a waypoint
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10297 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
niffiwan 2605583be6 From Admiral MS: add scripting function to get the wing of a ship
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10296 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
niffiwan e1711a326e From Admiral MS: scripting access to ship orders; also allows modifying some order values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10295 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 270d3d9248 Fixed breakage from r10254: key tokens in messages weren't getting translated right.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10293 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 7f74ce48a6 Fixed +Spread From LOD not working.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10290 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper 31ab1cff2c Ported "no homing speed ramp" weapon flag from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10289 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper dbded13fa4 Ported $Acceleration Time weapons table option from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10288 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
zookeeper ef94f4bb04 Ported $Velocity Inherit weapons table option from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10287 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:46 +10:00
karajorma 1adabef7bd X3N0-Life-Form's Call-SSM-Strike SEXP.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10286 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
karajorma c27f75cd5a Add support for replaying briefing and command briefing cutscenes. The go back a stage and go to first stage buttons will now count these as a briefing stage.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10280 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
karajorma 7ef94f084b Allow training missions to also show mission goals.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10279 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
karajorma cd9c2f851b Make it easier to distinguish the events in the mission log
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10278 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 2c34ca0218 fix Mantis #2994: a model can have initial animation states even if it doesn't have animations
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10277 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan cecc445e8b Move $Scale Gauges: token before $Reticle Style: to avoid breaking parsing when both are specified
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10275 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 7f05cca670 Ensure Offset & Origin are used together (hud gauges)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10274 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 4d7c218d59 Tweak HUD so that retail gauge scale/no-scale can be set in a minimalistic hud gauges table
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10273 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 770cd66755 Add scaling option to Yarns hud gauges
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10272 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 0b4f71c84d Mantis #2951: fix memory corruption issues by changing weapon substitution patterns to use C-style arrays rather than SCP_vectors
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10270 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 b090ea1f68 revert r10082 temporarily while substitute pattern feature is modified
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10269 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
niffiwan 84728de587 Add cmdline flag to disable use of pixel buffer objects
Workaround a bug/deficiency in recent linux intel video drivers

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10268 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 a04e83ab01 red-alert will now work with ships that appear at some point subsequent to mission start
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10267 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:45 +10:00
Goober5000 180115feba correct ammo for red-alerted ballistic primaries
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10257 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:44 +10:00
zookeeper e93e27fc0d Improved the calculation for how many segments to use for drawing circles and arcs.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10255 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:44 +10:00
zookeeper 61d9ce895b Ported the $On Action and $On Action Stopped scripting hooks from zookeeper branch. Also bumps the char limit for conditions from 32 to 64.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10254 387891d4-d844-0410-90c0-e4c51a9137d3
2014-01-14 20:24:44 +10:00
niffiwan 0115235de7 Add lua on-collision hooks for beams: from Axem & Wanderer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10253 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
z64555 63ab561e59 Mantis 2977 - Fixes some scripting hooks and references broken by r9549
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10252 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
The_E 9ff8f21b1f Adds a check to see if the model actually has a defined viewpoint; We can't generate the firepoint display if it doesn't
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10251 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
karajorma 69749cdaee Add the was-destroyed-delay SEXP by the WCS team. Add support to alter-ship-flag for hiding ship names.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10250 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
m_m 9cd218a595 Fix Mantis 2978: Off by 1 error with getShipClassIndex()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10249 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 5875b4f3a3 Fix Coverity CID 1093619: Array compared against 0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10247 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 08f36eb32c Fix Coverity CID 1109072: Copy into fixed size buffer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10246 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 f834aa80a9 Fix Coverity CID 1093375: Copy-paste error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10245 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 b35ba0e419 Fix Coverity CID 1093368 - Copy-paste error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10244 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:16 +10:00
Echelon9 d753954bcb Fix Coverity CIDs 1107320, 1107321, 1107322, 1107323 - Copy paste coding corrected
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10243 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 5664773a29 Allow game_settings.tbl to define the FS2NetD port, so TCs can work out of the box on *nix, etc.
http://www.hard-light.net/forums/index.php?topic=86317.0

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10242 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
niffiwan 8105d2a372 Fix Coverity ID 1093819: Uninitialized scalar variable in (template) class ade_obj::GetPtr()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10241 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
niffiwan 34b1f276f3 Fix Coverity ID 1093784Y: Uninitialized scalar variable in struct order_h
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10240 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 975f94f207 USHRT_MAX is in limits.h on Linux.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10239 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
Goober5000 d9b45b0eb2 just minor tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10237 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
Goober5000 1ff223687d when new subsystem entries are inserted, make sure the blank subsystem gets saved and inserted at the proper spot so that we don't use stale data (fixes Mantis #2979)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10236 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 a45af2f019 Found the constant USHRT_MAX I was looking for just a little too late.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10235 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 da4b191160 Saner parsing all around for webapi port number.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10233 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
chief1983 459e2bd469 Fix a warning when copying the webapi port token int into its destination ushort.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10232 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-22 19:05:15 +10:00
niffiwan 9e73870862 add wxfred2 execs to .gitignore
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10225 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan c5c7e58507 autotools: use autoreconf & m4 dir to make it easier to add/manage macros
add m4/wxwin.m4 macro file from wxWidgets 2.9.5 (previously pasted into acinclude.m4)
remove obsolete WX* macros from acinclude.m4
move acinclude to m4/fso.m4

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10224 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
zookeeper 6d3b183373 Ported parts of r9727 from zookeeper branch: Added support for multiple control presets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10223 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan d904a4d516 Fix Coverity ID 1093569: Negative array index read in create_wings()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10222 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan def53398bc Fix Coverity ID 1093574: Negative array index read in sexp_change_player_score()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10221 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 620f6aaf3d Fix Coverity ID 1093581: Negative array index read in sexp_clear_ship_goals()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10220 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 3ffe479cca Fix Coverity ID 1093579: Negative array index write in sexp_damage_escort_list()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10219 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 7d846defa5 Coverity 110733[01]: Negative array index read in get_string_or_variable()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10218 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan aa60c5acec Coverity ID 109381[456]: Uninitialized scalar variable in load_gauge_target_monitor()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10217 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 336db15246 Coverity ID 1093808: Uninitialized scalar variable in init_ai_target_priorities()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10216 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:02 +10:00
niffiwan 6d402f43aa Coverity ID 1093550: Negative array index write in multi_voice_release_token()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10215 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:01 +10:00
niffiwan 9480b079ca Coverity ID 1093508: Negative array index write in observer_create()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10214 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:01 +10:00
niffiwan 7b9f485a34 Coverity ID 1135850: Out-of-bounds read in hud_target_change_check()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10213 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-15 12:23:01 +10:00
zookeeper d13236e0e4 Ported r9704 from zookeeper branch: Added scripting function for drawing filled and unfilled arcs and made drawCircle able to draw unfilled circles.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10211 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan a3256bbf88 Fix two issues found by Yarn
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10210 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan 0402e46f89 Merge Yarn adaptable hud with m!m common hud parse
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10209 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan 706152c7d5 Add common parsing function for hud tables (originally from m!m with updates from me)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10208 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:14 +10:00
niffiwan e6d4b83907 update .gitignore to ignore codeblocks layout files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10207 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-11 18:52:13 +10:00
Echelon9 45d6f9be21 Fix Mantis 2975: AddressSanitizer: global-buffer-overflow in HudGaugeLeadSight::render()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10205 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Echelon9 ce41e56f46 Fix Mantis 2896: AddressSanitizer: global-buffer-overflow in hud_lock_reset() hudlock.cpp (v2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10204 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Goober5000 3eedfc7853 don't freak out if we don't have a beam texture
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10203 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Goober5000 645ee9a2ba make warning messages friendlier
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10202 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Echelon9 be08468a81 Fix Mantis 2974: WebUI interface: Chat tab does not print messages sent from WebUI
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10201 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:58 +10:00
Goober5000 ab1b8912b7 Sushi (or maybe LPine) broke Shield_Hit_Ani for modular tables when coding a Diaspora feature
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10200 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Echelon9 e75a09d203 Update Jansson library to upstream v2.5 -- http://www.digip.org/blog/2013/09/jansson-2.5-released.html
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10199 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Goober5000 f3c902c39b add wing_bash_ship_name, which handles the hash symbol thing, accommodates Blue Planet's capship trick, and works in FRED and while we're at it, do a little bit of const'ing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10198 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Goober5000 6804e5ae7d a spelling fix, and also clarify a sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10197 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
niffiwan 6443005f5c Tweak insignia limits again per Oddgrim's recommendations
http://www.hard-light.net/forums/index.php?topic=86195.msg1722757#msg1722757

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10196 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
niffiwan 07dbfed088 Fix compile issue on Linux re: INT_MAX / <limits.h>
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10195 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
zookeeper 7ff59d0559 Enabled fighterbay door animations to better define which bay path must be used or not used for the animation to trigger using +sub_type. Fixes the (undocumented) current numbering of fighterbay +sub_types to be 1-based instead of 0-based. Turns the SUBTYPE_CHECK macro to a proper function.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10194 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
zookeeper 9f65775702 Made +delay and +acceleration in animation code optional and default to 0.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10192 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Goober5000 1e78f8c6e1 fix hidden divide-by-zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10190 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
zookeeper 1c74472423 Added an $On Ship Arrive scripting hook.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10188 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:57 +10:00
Echelon9 49c56eea91 Fix Mantis 2970: AddressSanitizer: global-buffer-overflow in show_ship_subsys_count()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10187 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
Echelon9 9d6fdb07ba Fix Mantis 2969: AddressSanitizer: global-buffer-overflow in ai_do_objects_repairing_stuff()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10186 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
zookeeper 54a4f26146 Replaced shield_hit_info in escort_info with its own simple set of timer variables. Fixes Mantis #2966 and makes the code simpler and safer.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10185 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
niffiwan 41fee37f3f Bump model insignia faces/vertexes limits
(so that newer more detailed ships can have proper insignia)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10184 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-08 19:52:56 +10:00
niffiwan 4c93092045 Add warning for model insignia specifying an invalid LOD
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10183 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Echelon9 14fc0cfd88 Fix Mantis 2800: Particles not removed on standalone
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10182 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 c19ac5df9d when changing ship types, make sure the collision flags propagate
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10181 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 1467b0ef16 for wing names with hash symbols, put the ship number before the hash
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10180 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 3bc14442c5 just make this block similar to the other one
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10179 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
niffiwan 668e67c52d Fix Coverity 1093549: Negative array index write
(practically impossible to occur, but lets be safe in case multi_voice_get_stream() changes in future)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10178 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
zookeeper 4b7543361b Added initialization of render box and sphere offsets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10177 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
niffiwan e58cbc159b Fix mantis 2967: use Medals array instead of Ranks (from Yarn)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10176 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Echelon9 da6c95b8c4 Fix Mantis 2968: AddressSanitizer: global-buffer-overflow in shield_info_reset() - relates to hud_target_change_check()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10175 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:50 +10:00
Goober5000 69c7ee68f5 don't Int3() because this can happen when a ship is missing from a mod (i.e. when it turns into the GTF Ulysses)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10174 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 af9b12e448 Resolve compilation failure introduced by r10170
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10171 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
zookeeper b7a7bb968e Fixed some improper initialization of escort list hit_infos.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10170 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
zookeeper 85e39497cd More fixes to potentially uninitialized shield_hit_infos.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10168 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 b6b3a24e05 General clean up of commented out #ifndef NDEBUG blocks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10166 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 cb446460e4 General cleanup of commented out code in beam.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10165 387891d4-d844-0410-90c0-e4c51a9137d3
2013-12-03 21:12:49 +10:00
Echelon9 396afcacf8 Ensure compliance with the usual form of test in the FS2_Open codebase for running in Debug mode
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10164 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 20:12:54 +10:00
niffiwan 7f20857796 Honour ships' "no lighting" flag in the techroom (from Axem)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10162 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:38 +10:00
zookeeper a59be2e7c7 Allowed shield_info_reset() to initialize shield_hit_info to empty values if it's not associated with a ship, as required by hudescort.cpp. Might fix Mantis #2961.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10161 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
niffiwan 1a3fc26bfe Move set-ets-values sexp to the correct category (thanks to Axem for finding this)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10160 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 ad1bef5344 some things don't need to be re-inited every time you pause the game
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10159 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 0fb563b241 set ballistic HUD gauge any time HUD is changed -- fixes Mantis #2962
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10158 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 9ec027641d add quotes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10157 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 92435f7217 fix some things that FreeBSD complained about
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10156 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Wanderer 141f6bc121 fix issue with burst firing secondaries - thanks to Goober for finding it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10150 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Wanderer 96cc3c017d feature commit: excluding weapons from linked fire penalty (per request)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10147 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
chief1983 4e54350dcc Fix #2959. Framebuffer explosions need framebuffer objects, or it seems we assert later in the code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10145 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
chief1983 04e7b4c288 Recommit the ship.h part of 10082 as the OBO fixes seem to have fixed #2958.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10144 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Echelon9 3bbd389420 LLVM/Clang warns that a dangling else can occur without one level of braces
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10143 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 4611a77dbd re-commit r10082, except for ship.h, because it's the size of the ship_weapon struct that's causing the mysterious crashes (Mantis #2958)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10141 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 9ca44d8ce4 fix an off-by-one error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10140 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 40c4583792 fix Echelon9's fix >:( also add a judicious Assert for Mantis #2958
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10139 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
Goober5000 724e7816e4 Fix an actual Volition bug. This has AI balance implications, but it's already in the "pick a random weapon" section, so it will probably be all right.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10138 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:37 +10:00
zookeeper 204ebfca63 Remember to initialize shield_point_augment_ctrls.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10137 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 70d05d3815 scramble messages on a per-ship basis
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10136 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
zookeeper 8cd19aa588 Merged model point shields from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10135 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 1cb031c190 Fix #2959 by reverting r10082. I can probably talk zookeeper into converting the troublesome SCP_vectors into static variables so this isn't causing memset issues.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10132 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 f6a92e0972 allow modder to specify countermeasure type on a per-species basis
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10131 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
karajorma bad6af8a3a Yarn's fix for Mantis 2941 (Strings.tbms without the current language crash the game).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10130 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 b2167c61a3 Fix #2957 - FreeBSD RAND_MAX is 0x7ffffffd, not 0x7fffffff, so we can't always assume that it's the latter. Also move the check earlier in the code, if it's going to break at all, break immediately on any non-conforming platform so we can fine tune this some more.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10129 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 e8a7c8cf57 medal_stuff passes the duck test, so make it an official class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10128 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 6470f9043f make init_ship_entry actually init all the fields in ship_info make draw_weapon_models a ship flag instead of a boolean remove the MAX_SHIP_FLAGS #define because it didn't mean what everybody thought it meant
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10127 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan da21b44d07 fix gcc warning: declaration of ‘ship_obj’ shadows a global declaration [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10125 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan 4581ed9aa2 Persona-specific promotion debriefings (from Yarn)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10124 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 5ceabf1e8b Add support for the framecap menu option.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10121 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
chief1983 5ebd06bb29 Fix WebUI server name changes updating in clients and FS2NetD.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10120 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 858afb0cef turns out gcc doesn't like the two angled brackets adjacent to one another
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10119 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 13c8f95046 let's not make expensive copies of all these SCP_strings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10118 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 8179453ffa fix Mantis #2955: crash when trying to join multiplayer server, caused by trying to memcpy an integer into a ushort (also add some sanity asserts)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10117 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Goober5000 389a2c6955 fix Mantis #2933: don't output alt ship class information using fout_version
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10116 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
Echelon9 9cdd329f11 Webui: Resolve bug that was causing standalone game name to not appear
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10115 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:36 +10:00
niffiwan da92a1a709 Add stub for std_init_os() so that *nix can compile
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10114 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
niffiwan f01eefe832 According to the medal_stuff class, some of these should be MAX_FILENAME_LEN, not NAME_LENGTH
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10113 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
karajorma f4a7a117e4 Fix Mantis 2954 (Standalone can't find default language)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10112 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Goober5000 7585aed83b clarify help... OP_AND will actually evaluate all arguments
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10111 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Goober5000 f8dcbffab8 rather than piggy-back the perform-actions sexp on top of the when sexp, it works better to make it its own operator (fixes Mantis #2956)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10110 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Echelon9 e5115993bf AddressSanitizer: alloc-dealloc-mismatch (operator new vs free) in hud_close()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10109 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Echelon9 ea93153446 Remove this memory event, as clear() is called after loop, which will call the destructor of each item. Picked up by AddressSanitizer as this was attempting to free() memory allocated with new()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10108 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-25 19:29:35 +10:00
Goober5000 70f84212df we can just use the STL methods here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10095 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:44 +10:00
Goober5000 a739c172f4 add an important note
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10094 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:44 +10:00
niffiwan b4ab0f3a44 fix gcc warning: declaration of ‘shipp’ shadows a previous local [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10092 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 7a1b8d5be1 Coverity 1129269: Dereference after null check
add checks to deal with parent_objp == NULL

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10091 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan ed49e0786b Coverity 1129274: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10090 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan e5260a381a Coverity 1129270: Negative array index read
weapon_create can return -1
(& oops, r10087 was 1129271, not 1129270)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10089 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 95ab88de98 remove gcc warning: [-Wunused-but-set-variable]
(ret_val earmarked for future use)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10088 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan ae429e756e Coverity 1129270: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10087 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 442f3fb846 Coverity 1129272: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10086 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan 1dad7f799e Coverity 1129273: Negative array index read
weapon_create can return -1

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10085 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
niffiwan b2958b5e4a Remove a magic number
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10084 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 fa7cf7a910 "new" shouldn't really ever fail
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10083 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 33b871d29d remove non-working and non-supported $substitute feature for weapons (Mantis #2951)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10082 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 6bc71834ec this exited_ship constructor is redundant and interferes with the POD-ness of the struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10081 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 35347262d4 make man_thruster a POD struct, and initialize maneuvering thrusters in ship_info initialization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10080 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 de792bc0ca memset initialized the wrong level of pointer :-/
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10079 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 ed04c7788b these memsets aren't needed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10078 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:43 +10:00
Goober5000 e9fc00df0c now that we have queued_animation_init, we can rewrite this properly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10077 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 551ba6ba1a ugh, neither the constructor nor the memsets are actually needed here
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10076 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 fcb31d94c1 change p_dock_function_info to a class as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10075 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 b7db596f12 change dock_function_info to a class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10074 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 13513588df turn p_object into a class ensure that p_object dock instances are cleared between missions, not just when the game exits handle Player_start_pobject in a saner way the p_object Reset method is nice, but it turns out we don't need it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10060 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 6b97f368e8 sync functions for freeing dock instances
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10059 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 d310647bfe clear dock lists when objects are deleted, and redundantly clear them between missions and when object instances are destroyed (Mantis #2952)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10058 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 ed06a01897 restore r10051, this time allocating triggered_rotation instances when we need them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10057 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
Goober5000 7413a7a7d2 don't unnecessarily retime collision checks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10056 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
niffiwan 0299c7e42b fix gcc warning: [-Wreorder]
‘game_snd::flags’ will be initialised after ‘uint game_snd::signature’

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10055 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:42 +10:00
The_E c0a3d69ed2 Revert revision 10051: If we're going to use a global vector to store animation info, we need to fill it (and the references to it) too.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10054 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
niffiwan 3b89290cd8 fix gcc warning: [-Wreorder]
‘campaign::variables’ will be initialised after ‘int campaign::num_missions’

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10052 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 d11c7ccc2f ship subsystems should reference an index in a global Triggered_rotations vector rather than maintaining their own class object, which wastes space
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10051 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 afe08580c0 make cmission and campaign into full-fledged classes since they contain non-POD types remove a memset which hoses the multi campaign class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10050 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 3aeee91f14 better assignment of vec3d and matrix (matrix should be set to identity, not all-0)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10049 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Goober5000 e0fa46a185 more memset refactoring... turn texture_replace back into a POD struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10048 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-17 20:24:41 +10:00
Echelon9 cc8310a491 Webui: Clarify the use of branching if statements, to be consistent with existing code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10046 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 0e34a25207 Webui: Support setting an alternative port than 8080 to host the webui on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10045 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 d9ac71740a Webui: Support the setting of a non-default username and password in multi.cfg. These settings are +webapi_username and +webapi_password
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10044 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 8009d34928 Webui: support writing to fs2_standalone.log on Unix or Mac OS X when running a standalone server
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10043 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 07e35d7bd1 LLVM warning: Initialization of pointer of type 'bool *' to null from a constant boolean expression
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10042 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 2d9dfebae3 Re-enable -Wno-shorten-64-to-32 for Xcode. There remains code in the project, including third party, that assumes implicit 64->32 casts are permitted, which the expectation of overflow. We'll need to re-enable this warning later and revisit specific cases in question, either adding an explicit cast, or handling any cases where overflow is theoretically possible and undersired.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10041 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 93e3461748 Xcode 4/5 project file cleanup. These are redundant settings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10040 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 5c8d8f6ded Xcode 4/5 project file cleanup. Further deprecated settings related to cfilearchiver
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10039 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 fa1403f9a9 Further Xcode 4/5 project file cleanup. Install setting not required as we build an .app bundle
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10038 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 af81604303 Further cleanup Xcode 4/5 project file. Promote settings to top level where possible, remove redundant GCC settings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10037 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
Echelon9 eefa00cb19 Clean up Xcode4/5 project file. Remove blank overrides at the lower level of specific projects
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10036 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
niffiwan 196bfa25d3 Revert "oops - using the right pointer helps (from r10032)" (too hasty)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10035 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
niffiwan a2fe09fe6c oops - using the right pointer helps (from r10032)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10034 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:59 +10:00
The_E 184df2fb9e Make sure is-facing does not blow up id OSWPT_TYPE_NONE is encountered
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10033 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
niffiwan 1f2005ab02 Fix mantis 2946 part C: when enabling sheields, only rebalance ETS if the shields were previously off
Also fix same issue in alter-ship-flag ( "no-shields" ... )

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10032 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer 6f3e773359 Fix for Mantis #2807 - not particularly elegant fix but enough to prevent the reported null vec issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10031 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer e4f63a227c Solution to issues mentioned in Mantis #2949
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10030 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E 25d5cf17f0 Small performance improvement: Only call opengl_shader_t::uniforms::end() once, not every iteration.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10029 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer db183e021c Continued on Mantis #2806
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10028 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E 521e31d766 ...aaand cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10027 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E ec56e7771a Ooops, small buffer collision. Need to load the depth buffer to texture unit 2.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10026 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
The_E 551a539fe8 Adds depth buffer access to post processing shaders (via use of the depth_tex uniform)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10025 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer 0d4cc04cd6 Fix for Mantis #2352 - Turret reset when idle woes and other limited rotation turret woes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10024 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
niffiwan 9525d19b89 Fix mantis 2946 part B: set defaults ets when calling shields-on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10023 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Wanderer ca0bcd5dbf Fix for Mantis #2806 - added option to rotate the turrets according to 'initial' state animation code in the lab - option enabled by default but can be toggled via render options
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10022 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Goober5000 6836199eeb ship_subsys is now a class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10021 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:58 +10:00
Goober5000 f883a4bc09 make script_hook behave as a POD object, and fix some parameter passing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10020 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 90e7709da5 fix warning and mismatched line endings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10019 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Wanderer 8a8c338409 Fix for Mantis #2784
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10018 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Wanderer f571d2336f Assert to trap lua getSignature access to objects with invalid signature.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10017 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Wanderer 6cbc4f78c4 Fix to prevent invalid weapon bitmap references from being created in the lab.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10016 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
The_E e6a77d8a34 Moves game_settings.tbl parsing up a few lines so that it takes place before graphics are initialized (Necessary due to the table deciding whether to load external shaders or not)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10015 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
niffiwan 6e265e7e96 Fix mantis 2946: set ets shield index to zero when sexp shields-off is called
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10014 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 39024965b8 promptly change the icon type when the wing checkbox is checked load icons.tbl earlier in FRED so that briefing icons work correctly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10013 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 5d73931b6d this should now allow wing icons to be specified too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10012 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:57 +10:00
Goober5000 686088fa90 store briefing icons in a master list rather than in species_def allow ship classes to specify their own briefing icon to override normal icon
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10011 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 7e6cb331bf game_snd has a STL field, so it is properly a class and consequently species_info needs to be a class as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10010 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E 45791f371d Make sure we only write to the event log if the buffer to do this actually exists
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10009 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E b5e0647d54 Adds a check to the mn.Debris table in lua to check for invalid debris pieces
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10008 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E 7b0f6b310b Make sure entries in the Debris[] array get cleared properly upon deletion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10007 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
The_E d20df5b4c9 Adds a safety check to model_render_glow_points to stop it from blowing up when a glowpoint texture is for some reason not available
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10006 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 1ab4286a25 some calculations will be above 999999, so just do it this way; the end result doesn't matter anyway as we just need the minimum
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10005 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 80320485c1 fix some more loose ends in the revised support ship code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10004 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 f8b3d75fa4 fail
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10003 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 4bf48943d4 oh come on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10002 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:56 +10:00
Goober5000 c17fd1af7d fix somebody's spelling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10001 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 6a8bc0a5ed make support ship deployment more robust, and prevent an edge case where too many support ships could be in the mission at one time
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@10000 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
niffiwan f3318caef7 some updates to r9885 per discussion with Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9999 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
niffiwan fa04b7c412 Fix mantis 2905: lead sight for secondaries uses subsys distance when targeting a subsys
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9998 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 941fcf34ef and that shouldn't have been committed in r9995
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9997 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 522299eadf the game doesn't like it when you do an Assertion while it's shutting down
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9996 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
Goober5000 5aa3bddf70 change object from a struct to a class, since it contains the objsnd_num field :-/
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9995 387891d4-d844-0410-90c0-e4c51a9137d3
2013-11-10 18:28:55 +10:00
niffiwan f301cefe2c redo r9978 with BUF-1 instead of x[BUF+1]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9994 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
zookeeper 3df8818635 Fixed subtle breakage I caused to surface shields in r9794.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9993 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
Goober5000 758bf662e7 valid timestamps are actually > 0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9992 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 629ca0cdc0 Fix mantis 2938: ship.time_first_tagged should be initialised to 0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9989 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan aa3f9080d9 From X3N0-Life-Form: add custom sound for SSM strikes
(I updated the patch to use parse_sound instead of the missing stuff_sound)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9988 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 617e4472a2 Remove stuff_sound declaration - was never implemented
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9987 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 2c03139f97 Fix mantis 2889: add sexps's ets-get-value & ets-set-values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9986 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
niffiwan 797ffdf0f4 Fix mantis 2883
update hud_num_make_mono (& callers) to handle the font number
add partial support for specifying special char indexes for individual fonts

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9985 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
Goober5000 7b3a2ddeb5 Mantis #2944: add a hack to remember the color we faded out to
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9984 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:03 +10:00
The_E 575bc3bcce From Axem: Allow secondaries to cause shudder effects through use of the Shudder flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9983 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-31 19:25:02 +10:00
niffiwan 7f7f857559 Add the Polish font01.vf checksum
Sourced from https://svn.icculus.org/freespace2/trunk

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9982 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:50 +10:00
niffiwan e39c972f3d Coverity 1112867: Buffer not null terminated
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9981 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:50 +10:00
niffiwan 24e7810b24 Coverity fixes from Flaming_Sword
Uninitialized scalar field 1093859 1093917 1093810
Out-of-bounds read/access 1093669 1093670
Logically dead code 1093413 1093396 1093407 1093408 1093409 1093410 1093423 1093427 1093390
Allocation size mismatch 1093729 1093728
Unused pointer value 1093921 1093922
Wrong sizeof argument 1093732 1093731
Operands don't affect result 1093365
Dereference after null check/return value 1093475 1093455 1093627

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9979 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:50 +10:00
niffiwan f5757f8591 Coverity 1093664: Out-of-bounds write
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9978 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 0e561c822a Coverity 1093500: Missing break in switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9977 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
The_E a43062a426 Makes the following changes to the FRED project for MSVC2013: -Set WINVER and _WIN32_WINNT to 0x501
In combination with this download: http://go.microsoft.com/?linkid=9832071 this will enable FRED building on that compiler.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9976 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 aaab9f2f00 Fix FreeBSD since it doesn't have libdl and doesn't need to include it to build currently. May break Solaris but it doesn't work yet anyway.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9973 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 eb1cfc9ef7 Fix Unix building on several platforms breaking from the new WebUI standalone code. See http://www.hard-light.net/forums/index.php?topic=85859
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9972 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 5f5d13f2b6 Remove 2 unused hudbrackets functions (only with "#if 0" for now)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9971 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 93992f55ff Coverity 1093668: Out-of-bounds access in fs2netd/tcp_client.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9970 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
zookeeper 5586cd14b0 Port r9959 from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9968 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
The_E 4a422d3398 Updated for released version of VS2013. Note that FRED building is currently not supported on this platform due to MS deprecating Multibyte Charset for MFC, and haven't provided a workaround at this time.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9967 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 2615ca9ab0 Coverity 1107315: Buffer not null terminated
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9966 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 6002874610 Coverity 1107314: Buffer not null terminated
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9965 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 b790092b50 This will actually fix the webui code to support jansson 2.2.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9964 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 63de4932f8 Ubuntu LTS still uses jansson 2.2.1 in their repo and the code does in fact support 2.2. The libs change was definitely my fault though, I forgot all about r7939.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9963 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan df6f8b5292 And tweak it again, for some reason 2.4 != 2.4.0 :rolleyes:
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9962 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
niffiwan 9df9586ef0 Fix new standalone builds
Bumped jansson required version to 2.4.0 since that's the version included with our source

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9960 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:49 +10:00
chief1983 8d371f9e94 From Eli2: WebUI-based standalone/dedicated server code for all supported non-Windows platforms. See WIP documentation at http://www.hard-light.net/wiki/index.php/FS2_WebUI_Standalone.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9957 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:48 +10:00
chief1983 22cfa72250 One more Solaris tweak. No malloc_size or malloc_usable_size on Sun kit. Still can't get it to link though.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9949 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-27 13:51:48 +10:00
Goober5000 c1aaefea08 patch for Mantis #2937
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9946 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
Goober5000 bce047db1e fix handling of multi-line comments, and add !* and *! as a possible option
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9945 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 92712f5579 Port 9940-9941 from zookeeper branch: Made the targeting box render the target relative to player's eyepoint orientation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9942 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 9ed68b129d Port r9936 from zookeeper branch: Fixed possible crashes related to the eyepoint orientation features.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9939 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 5312b47983 Typo fix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9938 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
Goober5000 a81491161e allow setting of background and mask bitmaps for the medal case
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9935 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
zookeeper 81a40458c2 Fixed -misc maps being dependent on LOD and lighting levels.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9929 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
The_E ea6edd3f8c Catch a rare error condition where shield_hit_tri was -1 for some reason
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9927 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:02 +10:00
niffiwan 6b3c7bd83e more fixes for wxfred all-lowercase filenames
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9926 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 7343c92c23 spelling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9925 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan 7298f50b7a From Admiral MS: Add a scripting function to check if a ship is in the field of view of a turret.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9924 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
m_m 6021fb4bea Some new scripting functions as requested by Axem: Access to the CargoSize of a weapon class Access to the AltName of a ship class Access to the actual capacity of a weapon bank Access to the callsign of a ship Access to the alternate ship type of a ship Access to the maximum velocity of a ship with respect to its engine energy level
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9923 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan 184cda8e58 remove gcc warnings [-Wunused-but-set-variable] in ship/shiphit.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9922 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan e725bfc7a1 remove gcc warnings [-Wshadow] in ship/shiphit.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9921 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
niffiwan af56b43beb Coverity 1093367: logical vs bitwise operator in stars_draw_background()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9920 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 762045168a merp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9918 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 73ebcda173 additional memory management improvements
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9917 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
Goober5000 2359bd5c7a more clarification of structs vs. classes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9916 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:01 +10:00
chief1983 75148a3f76 Upgrade Xcode4 project file to...Xcode 5, turning on recommend compiler warnings. Feel free to disable them if they were off for a reason.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9915 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 a0c510e1c6 fix Mantis #2931: don't prematurely exit the model_interp_tmappoly method if we're drawing outlines
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9913 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 595a4c44c5 initialize this just to prevent loose ends
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9912 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 8dc043ae23 WMC has a screwy way of destroying his jumpnode class, so we need a screwy workaround to avoid hitting an Assert...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9911 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 22d491e50b add copy-variable-from-index and copy-variable-between-indexes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9910 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 0a7409c7a8 better ranges are also good
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9909 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
Goober5000 f77dd3c219 change sexp operator names for clarity, make sure mprintfs have newlines, and fix typo
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9908 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
chief1983 ae169ebb39 Add .svn folders to .gitignore.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9907 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:46:00 +10:00
niffiwan 92e5d5bee3 Coverity 1093637: "fix" out of bounds read of Weapon_info[Weapons[other_obj->instance].weapon_info_index].subtype
(fix for release, at least, Assert probably handles this in debug)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9906 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-16 19:45:59 +10:00
niffiwan 01629bd946 Redo 9903 - this is a more robust solution
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9905 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:32 +10:00
niffiwan 7348b9b08d remove gcc warnings [-Wunused-but-set-variable] in network/psnet2.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9904 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:32 +10:00
niffiwan 2fe56e6780 Coverity 1093639: fix out of bounds access (ip_addr.sin_addr with proto TCP)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9903 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan e991f7b3ac remove gcc warnings [-Wshadow] in mission/missionlog.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9902 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan 14058b834d Coverity 1093641: fix out of bounds write (Log_line_timestamps[Num_log_lines])
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9901 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan a7c074e5c3 Coverity 1093645 (out of bounds read): fix 2nd case & correct previous "fix"
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9900 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Echelon9 d0d932fb43 Fix Coverity 1093773: Uninitialized scalar variable - hostaddr.sin_zero
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9899 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan a2b7935a15 remove gcc warnings [-Wunused-but-set-variable] in fs2netd/fs2netd_client.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9898 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan 02afed1d78 Coverity: more out-of-bounds fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9897 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 2f573aeb29 fix ship sounds when in observer mode (bug was introduced in revision 7923)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9896 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 26f8b5fed1 make collider_pair an actual class since its constructor is called by hash_map
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9891 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 9e8356b72c setting to 0 is better because -1 triggers an Int3() on the first swarm entry
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9890 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan e68d8097cd Fix waaay too short char * var for hostname
(this was a buffer overrun for every fs2netd game until coverity complained)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9889 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 5531c0d6b4 resolve issues with ship-templates and memcpy by deprecating ship-copy
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9888 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
niffiwan 0c4c9ec9c9 Fix mantis 2906
reset stats in Pilot (i.e. .plr) on new pilot create/clone

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9887 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 3e3714fb8d fix declaration
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9886 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 0f1971c5aa change the ship struct to a class, and remove use of memcpy and memset for setting/copying the entire ship class
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9885 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:31 +10:00
Goober5000 bdc0767bb0 change strcpy to strcpy_s (left over from r9832)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9884 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
Goober5000 d3e0a2b904 improved error messaging for icons.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9883 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
Echelon9 96e2f96f1a Fix Coverity 1093931 and 1093932: Missing varargs init or cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9882 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
Echelon9 4d63d6ea05 Fix Coverity 1093734: Copy into fixed size buffer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9881 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
z64555 ee1711ed0b Fixed spelling error with 2 filenames. Updated MSVC project and filters to reflect previous changes with filenames.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9880 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan b26ec341bd Coverity: more out-of-bounds errors (& fix mistakes in previous "fixes")
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9879 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 1861195702 add .gitignore file :D
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9878 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 576baed1d3 add Coverity modeling file
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9877 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 019c18fab4 Coverity: fix some out-of-bounds access/read/write issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9876 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan d7cc54b324 Change Assert -> Assertion (plus removed some trailing whitespace)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9875 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 910d4bd293 Coverity: fix some out-of-bounds access issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9874 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:30 +10:00
niffiwan 5f0351c72b Coverity: buffer not null terminated issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9873 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
niffiwan 7e1ad3dd5b Coverity: potential array out of bounds read in ade_set_object_with_breed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9872 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
niffiwan a02b97b25a remove GCC warnings in lua.cpp [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9871 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
z64555 f44356a4c5 Looks like I missed 2 files for renaming.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9870 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
z64555 63df481478 Compliance modifications. EOL to Unix style (LF only), files renamed to only lowercase
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9869 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
zookeeper f1d0d36647 Port r9734 from zookeeper branch: Added scripting function to enable/disable tips of the day in mainhall.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9868 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
zookeeper 40af858593 Port r9823 from zookeeper branch: Added an option to make pitch and yaw axes be determined by eyepoint orientation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9867 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:29 +10:00
zookeeper ad1c2f0ecd Port r9738 from zookeeper branch: Forgot this from r9728; makes changing eyepoint orientation affect chase view as well.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9866 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
zookeeper e8a15e7b22 Port r9728 from zookeeper branch: Made eyepoints match the orientation of their parent submodel.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9865 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
zookeeper f164e30b0b Port r9725 from zookeeper branch: Added a Lua function for drawing offscreen indicators. Includes refactoring of some of HudGaugeOffscreen gauge code to separate the position finding and drawing logic.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9864 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
niffiwan a2ac3497b8 (redo 9781) remove GCC warnings in sexp.cpp [-Wunused-but-set-variable]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9863 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
niffiwan 5135771062 Update ChangeLog, 1st time since 2002...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9862 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
CommanderDJ 5022356faa Fix a couple of typos.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9861 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
Goober5000 55c2f4b156 well crap, looks like I broke XSTR in r9809
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9859 387891d4-d844-0410-90c0-e4c51a9137d3
2013-10-07 20:02:28 +10:00
niffiwan 7adf66330d Coverity CID 1093820: read of uninitialised var in beam_render_muzzle_glow(beam *b)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9858 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
niffiwan 8b78abd7a6 Coverity CID 1093930: read from pointer after free in GUIScreen::Add(GUIObject* new_gauge)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9857 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
niffiwan 5ec75bdd06 Coverity CID 1093821: use of an uninitialised variable in ship_select_blit_ship_info()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9856 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
z64555 79415c262a Fixes mantis 2925 and 2926. Errors with declaring wxFlexGridSizer item sizes in wxFormBuilder.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9855 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
Goober5000 3e4eca4104 reintegrate Goober5000 branch into trunk: adds STLport support and fixes MSVC6 compatibility with SCP_hash_map (part 2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9854 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:23 +10:00
Goober5000 82fbd9a7c1 reintegrate Goober5000 branch into trunk: adds STLport support and fixes MSVC6 compatibility with SCP_hash_map (part 1)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9853 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
Goober5000 67b171612d proper class/struct distinction and use of vector over list are A-1 SUPAR
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9851 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
Goober5000 69e1d4e36b the adjustment should be fixed this way, since most people don't count from 0 to n-1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9846 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
The_E 52381d05db Small adjustment to the error message here to minimize confusion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9844 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
The_E 16e60920cf Changes an Assert to an Assertion in order to provide better feedback in case stuff_int_list fails due to too many entries in the passed list of integers
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9843 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
niffiwan 62d06cfcd9 Coverity multiple CID: fix potential not null terminated strings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9842 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:22 +10:00
niffiwan ece9b2034b Coverity CID 1093804: init member raw8 of color struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9841 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-29 22:12:21 +10:00
niffiwan 05a298c68d Coverity CID 1099443: fix out of bounds access
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9840 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:24 +10:00
Goober5000 8a72823839 turn hud_anim back into an actual struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9834 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 c7f6394d6c polymodel code now has basic class management in place and no longer uses memset
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9833 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 8e096f5c15 remove bad use of memcpy by assigning player class using an actual assign() method (part 2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9832 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 52edd5b112 remove bad use of memcpy by assigning player class using an actual assign() method
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9831 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
Goober5000 52e9c4a8e0 allow fade-in and fade-out with any color, not just black, white, and red
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9830 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
z64555 5c0a97db80 Allows compiling of wxFred2 on *Nix machines. Includes niffiwan's autocools, fixes some referencing issues with button graphics, and includes graphics for the program and application icons.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9829 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-28 11:47:23 +10:00
niffiwan cebded3acb Tweak autotools compilation
Add -pipe to potentially speed up compiles
Change -mtune to generic to clarify intent
(people compiling executables for their own use (i.e. not for distribution)
should set CXXFLAGS="-march=native" before running autogen.sh)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9824 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:36 +10:00
Goober5000 7e5b2aee52 turn mc_info into a plain data struct, part 2
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9822 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:36 +10:00
Goober5000 4a9d457154 turn mc_info back into a plain data struct, part 1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9821 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 c46c0d1412 derp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9820 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 444d4b801a make engine_wash_info a struct again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9819 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 2ee1b24b65 queued_animation uses a mess of memcpy and memset, so make sure it's a plain struct!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9818 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 fe934190ac clarify that some structs should now be treated as classes change shockwave_create_info back to being a struct fix some missing shockwave_create_info initialization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9817 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 b4cc5d72f4 use an index rather than an iterator into the waypoint list so that ai_info is again a plain old data object
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9816 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Echelon9 e7cbe63a08 Resovle a few const char build errors for non-Windows platforms
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9815 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 f0830b6d64 scoring_level_init is only supposed to initialize a subset of the stats
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9814 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Goober5000 7248acc004 use a copy method rather than memcpy to clone stats (Mantis #2922)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9813 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:35 +10:00
Swifty 4a1e2cb4c5 From Kobrar: Make sure we normalize when normal mapping is off.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9812 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
Goober5000 fc191a40f2 whoops
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9811 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
Goober5000 97e18cd758 various fixes for pilotfile stats
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9810 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
Goober5000 4bd10888ff make localization more robust with additional checks on string length, more consting, and stronger typing and make XSTR const, since we don't want to modify the strings it translates and then CONST ALL THE THINGS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9809 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
chief1983 d8e4b8de55 Add profiling.cpp to the Makefile.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9808 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
chief1983 d1ac95963f Add profiling file to Xcode projects, and remove the wxfred2 files from their code.lib targets.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9807 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:34 +10:00
The_E e2281c39cb Adds Swifty's frame profiling code. In order to activate it, use the -profile_frame_time commandline parameter. ATTENTION PLATFORM MAINTAINERS:
This adds a new file to the source tree named profiling.cpp, add this to the respective project files (I've already done it for the various MSVS projects)

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9806 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
Goober5000 2e779e8bef MOAR const!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9805 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
Goober5000 38ae06e97d derp... apply consting to FRED
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9804 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
The_E 3f6f498340 Fix a function call that got broken in all the consting.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9803 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-26 18:51:33 +10:00
Goober5000 8cf10e86f8 remove Bobboau's "better error messages" which were never fully implemented and are more distracting than helpful
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9802 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:46:41 +10:00
Goober5000 886018d28f here a const, there a const, everywhere a const const
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9801 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:46:41 +10:00
Goober5000 0dfcea3b22 make MAX_MEDALS dynamic (missed a file)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9800 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:27:08 +10:00
Goober5000 7f90f5c674 make MAX_MEDALS dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9799 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:27:03 +10:00
Goober5000 fcf6d56774 fix tech-add-intel-xstr to actually localize from tstrings.tbl (Mantis #2919)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9798 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
Goober5000 ebe1043a13 add tech-add-intel-xstr, and modify intel_info_lookup to properly translate intel entries (fixes Mantis #2919)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9797 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
chief1983 cc0caf5e55 The last remaining code change (I think) blocking Solaris compatibility.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9796 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
The_E c0919e0777 Admiral MS' AI flag to enable the AI to be smarter when using afterburners. flag name is "free-afterburner-use". See http://www.hard-light.net/forums/index.php?topic=83818.0 for reference
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9795 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
zookeeper d993c3e1f5 Merge auto spread shields from zookeeper branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9794 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
zookeeper 46ad62f831 Clarified a warning about missing glowpoint textures.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9791 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:19 +10:00
Goober5000 b3798527a0 allow medals.tbl to specify images for debriefing views of medals, not just medal case views
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9789 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:18 +10:00
The_E 81c5c06218 Experimental Configurations to make AVX builds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9788 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-20 19:23:18 +10:00
Goober5000 6d6c82c652 make localization names consistent, and move medal localization into localize.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9787 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:33 +10:00
niffiwan e19e9d1afd Allow the use of __attribute__ (GCC specific syntax) In particular, __attribute__((__unused__)) to shush compiler warning -Wunused-but-set-variable
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9786 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:33 +10:00
z64555 32bd62bc18 wxFred2: whoops, forgot some resource files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9785 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
z64555 ec02c3c972 wxFred progress: GUI elements designed, organized code/wxfred2, work begun on main fred viewport.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9784 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
Goober5000 138e6b853f yeesh... a veritable cascade of const-correctness
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9783 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
chief1983 0a1379159d Revert r9781 until it can be implemented without breaking MSVC.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9782 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
niffiwan 809ee2483d remove GCC warnings in sexp.cpp [-Wunused-but-set-variable]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9781 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:32 +10:00
niffiwan 9a602777bd Fix mantis 2911: stop (de)activate-glow-point-bank sexp from processing the 1st arg twice
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9780 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
The_E 41af7e5ec0 Project files vor MSVS 2013. Please note that in order to build FRED, you need to install the Multibyte MFC library from http://www.microsoft.com/en-us/download/confirmation.aspx?id=39309
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9779 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
niffiwan 5a6493fa62 remove GCC warnings in sexp.cpp [-Wshadow]
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9778 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
zookeeper 143463b478 Port r9723 from zookeeper branch to trunk: Made is-facing able to check for target objects other than ships.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9777 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
zookeeper f98030b122 Port r9705 from zookeeper branch to trunk: Exposed a ship's autoaim FOV to Lua and allowed $Autoaim FOV to take floats rather than just ints.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9776 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
zookeeper fd21b9054b Port r9701 from zookeeper branch to trunk: Added a Lua function to check whether a ship is warp-capable.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9775 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 d5f03daa6b spelling, hehe
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9774 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 96587dd2ab allow specification of medal, callsign, and label coordinates
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9773 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 0debee3c51 pretty sure this needs to be 0, per line 325
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9772 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 3550b720cb remove requirement that game_settings.tbl should specify a campaign filename with an extension
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9771 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 42d096a3c2 allow a user-specified number of credit images
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9770 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 a921665872 add missing newline
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9769 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:31 +10:00
Goober5000 52413c944f what's this? a Volition bug?
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9768 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:30 +10:00
karajorma 602e608065 Fix Mantis 2883 (All the 1's have vanished since r9761)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9767 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-13 20:18:30 +10:00
The_E 06900df8df As requested by Axem, adds "player-is-cheating" sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9766 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
chief1983 6c88f96cc0 Bump version to 3.7.1 for nightlies.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9765 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
niffiwan 7fad36e90c Fix for mantis 2907: In red alert missions that skip briefings, use the red alert "continue" button, not the ship/weapon select "commit" button.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9764 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
niffiwan 3d1edee29a Fix for mantis 2878: LUA playMusic uses players music volume, not the requested volume
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9763 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 0b0b3fdf70 Allow event.log to snapshot all events that are checked this frame. Allow event.log to record the status of the event the previous time it was checked in addition to its status this frame.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9762 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 2691085f9f Add support for other languages beyond French, German and Polish. Any non-unicode language should work now.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9761 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 800602701a Add alter-ship-flag support for several more flags
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9760 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
karajorma 18ca1c08db Add the toggle-subsystem-scanning option to the alter-ship-flag SEXP
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9759 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:26 +10:00
Goober5000 8f7320119e show-subtitle-text will now display subtitles from a message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9758 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
Goober5000 d7fc8372aa Number 3 from Axem's "A triplet of small patches", http://www.hard-light.net/forums/index.php?topic=82749.0
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9757 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
karajorma f38b90f431 Fix Mantis Mantis 2913 (Time Compression SEXPs do not work in multiplayer)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9756 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
karajorma c251c031f0 Fix Mantis 2903 (Spinners in the Object Editor point in the wrong direction).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9753 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
The_E 7b53a46e88 From m|m: Fix for Mantis 2914 (AmmoLeft and AmmoMax return strange things in scripting)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9752 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
chief1983 5b7c056cb1 Revert 9749 until after 3.7.0.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9751 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
karajorma 53d0129e8f Fix Mantis 2912 (Hud-set-max-targeting-range doesn't work on multiplayer clients).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9750 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
The_E 6524a2140f As requested by Aesaar, raise the per-model debris limit to 48 (previously 32). Also increases the per-frame debris limit to 96 (previously 64)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9749 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
z64555 134b0dd757 fix for mantis 2874: Pilot conversion not preserving axis mappings. Also adds a warning that is activated whenever the pilot loading process has to skip bytes of "extra/unknown data" in a section.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9748 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan 315373e952 Fix mantis 2908: finally get "richer" pilot conversion exceptions data working correctly THANK YOU Tony D @stackoverflow! http://stackoverflow.com/questions/6248404/c-exceptions-is-throwing-c-string-as-an-exception-bad
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9747 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan 99ef01ff6d Fix 3 for 2901: remove long/short read warning by making mainhall(csg flags), cutscenes(csg flags) & is_multi(plr flags) consistent between pilot conversion and normal save/loads
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9746 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan d619d86976 Fix 2 for mantis 2901: 7 weapon slots (not 12) for pilot conversions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9745 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan d60a930dc2 2808 accidentally clobbered 2810: change 3.6.18 last played pilot name before loading the pilot for the 1st time
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9744 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
The_E 4eb1787e4e Fix for Mantis 2898: Reverting r8627 to reinstate -img2dds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9742 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
Echelon9 0f7d8ec579 Fix Mantis 2847: Assert: (team != -1) -- due to aicode issues tracking destroyed weapons
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9741 387891d4-d844-0410-90c0-e4c51a9137d3
2013-09-03 21:01:25 +10:00
niffiwan 878a7a1921 Fix for mantis 2904: redalert wingmen without RA data are treated as destroyed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9740 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:15 +10:00
niffiwan 12de1de128 Fix MSVC warning (int to char conversion): thanks to zookeeper for noticing this
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9739 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:15 +10:00
zookeeper cf4fa30f0f Fixed bug in RotationalVelocityDesired documentation.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9737 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:14 +10:00
Echelon9 fb33fe020b Resolve a series of Xcode (LLVM compiler) warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9735 387891d4-d844-0410-90c0-e4c51a9137d3
2013-08-06 22:55:14 +10:00
niffiwan 59762a4db7 add some red alert doco
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9733 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:31 +10:00
niffiwan d4d10dedd9 add more data to pilot (csg) conversion error messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9732 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:31 +10:00
Echelon9 e776f8e5dd Fix issue where switch statement would fall through for TS_MOVE_PLAYER, which would then not get pushed to other hosts
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9731 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
niffiwan f8a74ae5c9 Partial fix for 2901: pilot conversion needs to read the ubyte mainhall from <= 3.6.18
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9730 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
m_m f410440604 Fix for Mantis 2884: Team colors not displayed on player ship.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9720 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
The_E bccd0533bd Removes a console command that basically amounted to being a more elaborate way of causing an Int3()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9719 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
The_E c6397750e0 Fix for Mantis 2861: Make sure we switch off shader-based effect rendering if the GPU can't handle it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9718 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 f5f42f65fa this is required for strict const-correctness
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9715 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 ce118c232c add a missing #include
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9714 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 509f509347 MSVC6 compatibility
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9710 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 bda6c72d31 remove an unused function, per Echelon9's detective work (Mantis #2900)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9709 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 b5f278c91c a modified version of Echelon9's fix for Mantis #2897 (heap corruption due to object indexes being too large for the object dock bitstring)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9708 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Echelon9 17c7d0be26 Documentation cleanup of object.cpp pursuant to Mantis 2897 bug-hunting.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9706 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Echelon9 90a6702ede Fix Mantis 2896: AddressSanitizer: global-buffer-overflow in hud_lock_reset() hudlock.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9699 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:30 +10:00
Goober5000 54875d1de8 fix Mantis #2893 (invalid characters in sexp tokens weren't replaced)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9698 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:29 +10:00
Goober5000 4e2ee8bece Mantis #2852: commit the newest version of the patch, based on discussion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9697 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:29 +10:00
Goober5000 693448eb99 Mantis #2852: good catch, but I'd rather not modify the damage variable... and also, there's the danger of divide-by-zero which wasn't checked
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9696 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:29 +10:00
Echelon9 773ada0084 Fix Mantis 2852: AddressSanitizer: global-buffer-overflow in shockwave_move() shockwave.cpp:359
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9695 387891d4-d844-0410-90c0-e4c51a9137d3
2013-07-26 08:14:29 +10:00
The_E b7cd4e3c67 oops, broke something
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9693 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
The_E f860e040b2 Fix for Mantis 2882: "None" team color setting causes errors. Also fixes a few other oversights.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9692 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
niffiwan 46796a59c8 Fix for mantis 1326: add & handle "not present" state for red alert ships
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9689 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
niffiwan 049b3205ef Fix for mantis 2880: handle -1 red alert departed ship indexes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9688 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
The_E 658c6c5aa8 From Axem: Patch for Mantis 2870 (hook variable for On Death: scripting hook is not always set correctly)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9687 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
karajorma 5708875eda We only need to see this error once in FS2. Ensure that this instance only appears in FRED.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9686 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
karajorma 856c593a2c Better error reporting for this issue (in order to help track down a Diaspora bug).
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9685 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:17 +10:00
karajorma d1ec691f62 Assign the debris signature correctly.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9684 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
karajorma 99948813c1 Fix for Mantis 1863 (Ships with an arrival cue of true and a delay do not arrive on the standalone). Might possibly fix Mantis 1815 too.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9683 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
niffiwan d04130c453 Fix for mantis 2879: clear/reset *everything* in Campaign struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9682 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
niffiwan 194300dc94 Fix for mantis 2864: correctly init message_extra struct
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9681 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Backslash 14aa992f6c Small fix to selection set / multitarget / hotkey wing behavior. If a set is not active and something is targeted that is in a set, pressing THAT set's key will not change targets, but just activate the set.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9680 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
niffiwan c5bdbe268e Fix for mantis 2868: clear all mission completed flags when changing campaigns
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9679 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
niffiwan 793cd89ad3 Fix for mantis 2801 from Mr_Maniac: increase buffer size to correctly handle localisation strings > 1024 chars
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9678 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Echelon9 4cbe3903d7 Fix Mantis 2837: AddressSanitizer: heap-buffer-overflow in sexp_get_damage_caused()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9677 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Goober5000 b9d06a1e58 fix for Mantis #2856 - combine all the has-[un]docked[-delay] sexp functions and make adjustments for the order of ship checks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9675 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Echelon9 af5928aa70 Fix Mantis 2859: Game crashes if mod is changed with the same pilot in use. From niffiwan.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9673 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Echelon9 3d2c85f623 Fix Mantis 2862: Crash exiting game from command briefing on newly created pilot, caused by double free in cutscenes.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9672 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Echelon9 9d85779875 Fix Mantis 2819: AddressSanitizer: stack-buffer-overflow in l_File_read_f()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9671 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Zacam ca90ec8e75 Fix for Mantis 0002860: Tostring function for enumerations returns invalid for highest enumeration index From: Admiral MS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9670 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Zacam 23faeda404 Fix for Mantis 2829: If it doesn't like trying to @param a double stuffed func, then don't. We have the @params defined in the original draw_func_ptr anyway.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9669 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
niffiwan 46a3f5483a Fix for mantis 2802: when restoring last missions loadout, ignore weapons on absent ships Also clear ship weapons & weapon-counts when clearing loadout slots
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9668 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Zacam b2e1f1d211 From z64555; a better version of r9666's Doxygen comments.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9667 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
Zacam c49d1a1e6a Doxygen and clean-up start for making the controls more robust. Doxygen additions: z64555 Tab/Whitespace cleanup: My fault.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9666 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:16 +10:00
The_E b991499620 From Plombo: Make the FXAA shaders conform to the (absolutely braindead, I might add) GLSL specs. Also makes Mesa happy.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9665 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
niffiwan 9c5fd447fc Fix for mantis 2855: fix off-by-one, add negative index check, empty invalid slots & enable mprintfs
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9664 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
niffiwan 504fb153db Revert "Fix for mantis 2802: when restoring last missions loadout, ignore weapons on absent ships" Wrong patch you git!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9663 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
niffiwan 97d228947a Fix for mantis 2802: when restoring last missions loadout, ignore weapons on absent ships Also clear ship weapons & weapon-counts when clearing loadout slots
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9662 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
m_m d2cc75561d Fix for Mantis 2846: Problems with mission loop animations
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9661 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
The_E cb1f812cef Fix for Mantis 2857: We need to tell generic_anim_load what to load, really. Otherwise this whole exercise is kinda pointless :P
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9660 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Echelon9 316308cc40 Fix for Mantis 2833: AddressSanitizer: heap-buffer-overflow in get_char_width()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9659 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
niffiwan e67daf2afc Remove a duplicate line in r9657 - thanks to Echelon9 for noticing this
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9658 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
niffiwan 78cb7cc039 Fix mantis 2753: save csg just before mission starts read loadout indexes into int instead of uint & ensure -1 is not used as array index initialise Player_loadout struct during FSO start
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9657 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Zacam 90151d3e0a Fix for Mantis 2841: From CommanderDJ, Allows FRED to select/set Main Hall by string input, not just integers.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9656 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Echelon9 74b89d9fc5 Extra logging functionality for BMPMAN. This helped localise the fix in r9654.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9655 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Echelon9 aa463ca772 Fix for loading of AVIs in BP. As discussed with The_E on IRC, this bug may have had a range of unintended consequences, although not clear why it hasn't been picked up already.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9654 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Echelon9 fc555177fd Fix Mantis 2850: AddressSanitizer: global-buffer-overflow in emp_randomize_chars()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9653 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
niffiwan b8c625d589 log the correct CSG version
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9652 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
The_E 20abba69dc Fix my fix from revision 9305: Properly check for null pointer dereference
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9651 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
FUBAR-BDHR 0457fcc9ad From Yarn fix for Mantis 2849 +Flags: does not select main halls
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9650 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:15 +10:00
Echelon9 0a7fcfc0a5 Fix Mantis 2854: AddressSanitizer: global-buffer-overflow in do_subobj_hit_stuff()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9649 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 51c14de891 Fix Mantis 2853: AddressSanitizer: heap-buffer-overflow in change_ship_type()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9648 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 e0ed2fa45f Let form follow substance; when using indentation around if() ensure the approach is clear
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9647 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 83bb931baf Fix for Mantis 2821: AddressSanitizer: global-buffer-overflow in ship_get_secondary_weapon_range()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9646 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 7d76471b03 Fix Mantis 2834: AddressSanitizer: global-buffer-overflow in get_max_ammo_count_for_bank()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9645 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 690460df8e Fix Mantis 2824: AddressSanitizer: global-buffer-overflow in obj_snd_delete_all()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9644 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Goober5000 b1191f53d5 code cleanup related to Mantis #2845... straighten out and standardize the differences between the various OPF_SHIP_WING_* argument types make sure all ships using an OPF_SHIP_WING_* type actually specify and handle the type they need to (removing the ones that don't make sense, e.g. you can't set the orientation of a waypoint) enforce type safety by clarifying the distinction between "any ship on a team" and "every ship on a team", and splitting the OSWPT_TYPE_TEAM type to accommodate this (which maintains compatibility with the original OPF_SHIP_WING_TEAM type)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9643 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Goober5000 f865ab85b5 fix the is-in-box sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9642 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Goober5000 381f54663b the fix for Mantis #2845 in isolation
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9641 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Goober5000 8926a4de06 Yarn's patch to make version checking work correctly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9640 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
chief1983 f5903f771d More missed filename renames.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9636 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
chief1983 51abff326d This was probably not letting linking work correctly.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9634 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Zacam 34b7dbe233 Revert r9631: If you are going to make a fix, commit just the fix, not a slew of "oh, also" stuff that ends up breaking things. Especially not immediately preceding an RC phase, kthx.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9632 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Goober5000 be86442006 cleanup due to Mantis #2845... straighten out and standardize the differences between the various OPF_SHIP_WING_* argument types make sure all ships using an OPF_SHIP_WING_* type actually specify and handle the type they need to (removing the ones that don't make sense, e.g. you can't set the orientation of a waypoint) fix num-ships-in-battle and is-in-box which were both broken and make sure the sexp lookup for IFFs uses sexp_determine_team rather than iff_lookup (which is the actual fix for Mantis #2845)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9631 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 e773a0a94e Fix for Mantis 2844: AddressSanitizer: heap-buffer-overflow in pilotfile_convert::csg_import_red_alert csg_convert.cpp:438
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@9630 387891d4-d844-0410-90c0-e4c51a9137d3
2013-06-11 19:22:14 +10:00
Echelon9 709f914867 Fix Mantis 2825: AddressSanitizer: global-buffer-overflow in turret_weapon_has_flags() aiturret.cpp:316
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9629 387891d4-d844-0410-90c0-e4c51a9137d3
2013-04-14 13:00:35 +10:00
713 changed files with 98337 additions and 69501 deletions

No files matched your search

+268
View File
@@ -0,0 +1,268 @@
*.o
*.a
.dirstamp
libtool
ltmain.sh
m4/libtool.m4
m4/ltoptions.m4
m4/ltsugar.m4
m4/ltversion.m4
m4/lt~obsolete.m4
compile
.deps/
code/.deps/
Makefile
Makefile.in
aclocal.m4
autom4te.cache/
config.*
code/fs2_open_*
code/wxFRED2_*
configure
depcomp
install-sh
missing
.svn
*.layout
projects/Xcode4/Frameworks/
projects/Xcode/Frameworks/
#========
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.unsuccessfulbuild
ipch/
[Oo]bj/
[Bb]in
[Dd]ebug*/
[Rr]elease*/
Ankh.NoLoad
#MonoDevelop
*.pidb
*.userprefs
#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache
#Project files
[Bb]uild/
#Subversion files
.svn
# Office Temp Files
~$*
# vim Temp Files
*~
#NuGet
packages/
*.nupkg
#ncrunch
*ncrunch*
*crunch*.local.xml
# visual studio database projects
*.dbmdl
#Test files
*.testsettings
#===========
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.1
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
# - added line-by-line explanations for EVERYTHING (some were missing)
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################
#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
.DS_Store
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
.Trashes
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
*.swp
# *.lock - this is used and abused by many editors for many different things.
# For the main ones I use (e.g. Eclipse), it should be excluded
# from source-control, but YMMV
*.lock
#
# profile - REMOVED temporarily (on double-checking, this seems incorrect; I can't find it in OS X docs?)
#profile
####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
*~.nib
####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"
DerivedData/
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"
build/
#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"
# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html
*.pbxuser
# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
*.mode1v3
# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
*.mode2v3
# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file
*.perspectivev3
# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
# throw away ALL personal settings (including custom schemes!
# - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata
# OPTION 2: ---------------------------------
# get rid of ALL personal settings, but KEEP SOME OF THEM
# - NB: you must manually uncomment the bits you want to keep
#
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
# or manually install git over the top of the OS X version
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*
# (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*
####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
# /(project-name).xcodeproj/
# project.pbxproj
# /project.xcworkspace/
# contents.xcworkspacedata
# /xcuserdata/
# /(your name)/xcuserdatad/
# UserInterfaceState.xcuserstate
# /xcsshareddata/
# /xcschemes/
# (shared scheme name).xcscheme
# /xcuserdata/
# /(your name)/xcuserdatad/
# (private scheme).xcscheme
# xcschememanagement.plist
#
#
####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!
*.moved-aside
# .xccheckout
#
# Per http://stackoverflow.com/questions/18340453/should-xccheckout-files-in-xcode5-be-ignored-under-vcs
#
*.xccheckout
+21 -1
View File
@@ -1,6 +1,26 @@
ChangeLog for fs2_open. All times are UTC.
Updated 2002-10-31 03:46
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...)
==================================================================
2002-10-30 22:57 randomtiger
+3 -1
View File
@@ -2,7 +2,9 @@
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = code
ACLOCAL_AMFLAGS = -I m4
SUBDIRS = mongoose code
EXTRA_DIST = \
+7 -7
View File
@@ -110,19 +110,19 @@ do
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
echo "Running $ACLOCAL $aclocalinclude ..."
"$ACLOCAL" $aclocalinclude
echo "Running $AUTOMAKE --add-missing --copy --foreign $am_opt ..."
"$AUTOMAKE" --add-missing --copy --foreign $am_opt
echo "Running autoconf..."
autoconf
echo "Running autoreconf..."
autoreconf --install
)
# DIE if the subshell failed
if [ $? -ne 0 ]; then
exit 1
fi
fi
done
+87 -14
View File
@@ -185,10 +185,15 @@ EXTRA_DIST = \
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I../mongoose
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
if BUILD_WXFRED
LIBCODE=
else
LIBCODE=libcode.a
endif
noinst_LIBRARIES = $(LIBCODE)
bin_PROGRAMS = @FS2_BINARY@
EXTRA_PROGRAMS = fs2_open_@PACKAGE_VERSION@ \
@@ -258,7 +263,10 @@ FS2_SOURCES = \
debris/debris.cpp \
debris/debris.h \
debugconsole/console.cpp \
debugconsole/dbugfile.h \
debugconsole/console.h \
debugconsole/consolecmds.cpp \
debugconsole/consoleparse.cpp \
debugconsole/consoleparse.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
exceptionhandler/exceptionhandler.cpp \
@@ -294,6 +302,7 @@ FS2_SOURCES = \
globalincs/fsmemory.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/profiling.cpp \
globalincs/pstypes.h \
globalincs/safe_strings.cpp \
globalincs/safe_strings.h \
@@ -812,8 +821,8 @@ fs2_open_@PACKAGE_VERSION@_DEBUG_SOURCES = \
fs2_open_@PACKAGE_VERSION@_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a
fs2_open_@PACKAGE_VERSION@_LDADD = libcode.a
fs2_open_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a ../mongoose/libmongoose.a
fs2_open_@PACKAGE_VERSION@_LDADD = libcode.a ../mongoose/libmongoose.a
##
## End MAIN binary
@@ -826,12 +835,79 @@ fs2_open_@PACKAGE_VERSION@_LDADD = libcode.a
##
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/fredframe.cpp \
wxfred2/fredframe.h \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
wxfred2/res/select.png.h \
wxfred2/res/constz.png.h \
wxfred2/res/constx.png.h \
wxfred2/res/selectrot.png.h \
wxfred2/res/constyz.png.h \
wxfred2/res/constxy.png.h \
wxfred2/res/wingform.png.h \
wxfred2/res/zoomsel.png.h \
wxfred2/res/constxz.png.h \
wxfred2/res/consty.png.h \
wxfred2/res/wingdisband.png.h \
wxfred2/res/showdist.png.h \
wxfred2/res/orbitsel.png.h \
wxfred2/res/zoomext.png.h \
wxfred2/res/rotlocal.png.h \
wxfred2/res/selectmove.png.h \
wxfred2/res/selectlock.png.h \
wxfred2/res/selectlist.png.h \
wxfred2/base/wxfred_base.h \
wxfred2/base/wxfred_base.cpp \
wxfred2/editors/dlgobjecteditor.h \
wxfred2/editors/dlgobjecteditor.cpp \
wxfred2/editors/dlgvoiceactingmanager.h \
wxfred2/editors/frmdebriefingeditor.h \
wxfred2/editors/dlgbackgroundeditor.cpp \
wxfred2/editors/dlgmissionobjectiveseditor.cpp \
wxfred2/editors/frmbriefingeditor.cpp \
wxfred2/editors/frmteamloadouteditor.h \
wxfred2/editors/dlgmissionobjectiveseditor.h \
wxfred2/editors/dlgmissionspecseditor.h \
wxfred2/editors/frmdebriefingeditor.cpp \
wxfred2/editors/dlgfictionviewer.cpp \
wxfred2/editors/dlgvoiceactingmanager.cpp \
wxfred2/editors/dlgsoundenvironment.cpp \
wxfred2/editors/frmcommandbriefingeditor.cpp \
wxfred2/editors/frmbriefingeditor.h \
wxfred2/editors/dlgshieldsystemeditor.h \
wxfred2/editors/dlgreinforcementseditor.h \
wxfred2/editors/dlgeventseditor.h \
wxfred2/editors/frmteamloadouteditor.cpp \
wxfred2/editors/frmcommandbriefingeditor.h \
wxfred2/editors/frmwaypointeditor.h \
wxfred2/editors/dlgasteroidfieldeditor.h \
wxfred2/editors/dlgsetglobalshipflagseditor.cpp \
wxfred2/editors/dlgshieldsystemeditor.cpp \
wxfred2/editors/frmshipseditor.h \
wxfred2/editors/dlgfictionviewer.h \
wxfred2/editors/dlgreinforcementspicker.cpp \
wxfred2/editors/frmcampaigneditor.cpp \
wxfred2/editors/dlgasteroidfieldeditor.cpp \
wxfred2/editors/dlgreinforcementspicker.h \
wxfred2/editors/dlgreinforcementseditor.cpp \
wxfred2/editors/frmcampaigneditor.h \
wxfred2/editors/dlgbackgroundeditor.h \
wxfred2/editors/frmshipseditor.cpp \
wxfred2/editors/dlgeventseditor.cpp \
wxfred2/editors/dlgsetglobalshipflagseditor.h \
wxfred2/editors/frmwingeditor.h \
wxfred2/editors/frmwingeditor.cpp \
wxfred2/editors/frmwaypointeditor.cpp \
wxfred2/editors/dlgsoundenvironment.h \
wxfred2/editors/dlgmissionspecseditor.cpp \
wxfred2/glcviewport.h \
wxfred2/misc/dlgmissionstats.h \
wxfred2/misc/dlgmissionstats.cpp \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/help/dlgsexphelp.h \
wxfred2/help/dlgsexphelp.cpp \
wxfred2/help/dlgaboutbox.h \
wxfred2/help/dlgaboutbox.cpp \
wxfred2/frmfred2.h \
wxfred2/frmfred2.cpp
wxFRED2_@PACKAGE_VERSION@_DEBUG_SOURCES = \
${wxFRED_SOURCES}
@@ -839,9 +915,6 @@ wxFRED2_@PACKAGE_VERSION@_DEBUG_SOURCES = \
wxFRED2_@PACKAGE_VERSION@_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a
wxFRED2_@PACKAGE_VERSION@_LDADD = libcode.a
##
## End wxFRED2 binary
##
+11 -9
View File
@@ -20,9 +20,9 @@
#include "object/waypoint.h"
struct ship_weapon;
struct ship_subsys;
struct object;
struct ship_info;
class ship_subsys;
class object;
class ship_info;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
@@ -32,7 +32,7 @@ typedef struct ai_flag_name {
int flag_list;
} ai_flag_name;
#define MAX_AI_FLAG_NAMES 1
#define MAX_AI_FLAG_NAMES 2
extern ai_flag_name Ai_flag_names[];
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
@@ -64,6 +64,8 @@ extern ai_flag_name Ai_flag_names[];
#define AIF_UNLOAD_PRIMARIES (1 << 24) // Fire primaries as fast as possible!
#define AIF_TRYING_UNSUCCESSFULLY_TO_WARP (1 << 25) // Trying to warp, but can't warp at the moment
#define AIF_FREE_AFTERBURNER_USE (1 << 26) // Use afterburners while following waypoints or flying towards objects
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
#define AIF_FORMATION (AIF_FORMATION_WING | AIF_FORMATION_OBJECT)
@@ -107,6 +109,7 @@ extern ai_flag_name Ai_flag_names[];
#define AIGF_PURGE (1<<5) // purge this goal next time we process
#define AIGF_GOALS_PURGED (1<<6) // this goal has already caused other goals to get purged
#define AIGF_DEPART_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
#define AIGF_TARGET_OWN_TEAM (1<<8) // Goober5000 - removes standard precautions against AI ships taking traitorous actions
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
@@ -366,10 +369,10 @@ typedef struct ai_info {
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
waypoint_list *wp_list; // waypoint list being followed
SCP_list<waypoint>::iterator wp_index; // waypoint index in list
waypoint_list *wp_list; // waypoint list being followed
size_t wp_index; // waypoint index in list
int wp_flags; // waypoint flags, see WPF_xxxx
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
// Path following information
int path_start; // Index into global array, start of path.
@@ -587,7 +590,7 @@ extern char** Ai_class_names;
extern int Num_ai_classes;
extern int Ai_firing_enabled;
extern char *Skill_level_names(int skill_level, int translate = 1);
extern const char *Skill_level_names(int skill_level, int translate = 1);
extern int Ai_goal_signature;
// need access to following data in AiBig.cpp
@@ -622,7 +625,6 @@ extern void ai_ignore_object(object *ignorer, object *ignored, int ignore_new);
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int dock_type);
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
extern void ai_set_default_behavior(object *obj, int classnum);
extern void ai_do_default_behavior(object *obj);
extern void ai_start_waypoints(object *objp, waypoint_list *wp_list, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_quadrant, vec3d *hit_normal);
+4 -9
View File
@@ -67,7 +67,7 @@ int ai_path_type_match(char *p)
return -1;
}
void parse_ai_profiles_tbl(char *filename)
void parse_ai_profiles_tbl(const char *filename)
{
int i, rval;
char profile_name[NAME_LENGTH];
@@ -75,13 +75,9 @@ void parse_ai_profiles_tbl(char *filename)
char *saved_Mp = NULL;
char buf[NAME_LENGTH];
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
{
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default ai_profiles.tbl>", rval));
lcl_ext_close();
return;
}
@@ -467,6 +463,8 @@ void parse_ai_profiles_tbl(char *filename)
set_flag(profile, "$fix ai path order bug:", AIPF2_FIX_AI_PATH_ORDER_BUG, AIP_FLAG2);
set_flag(profile, "$strict turret-tagged-only targeting:", AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING, AIP_FLAG2);
// ----------
// compatibility
@@ -512,11 +510,8 @@ void parse_ai_profiles_tbl(char *filename)
required_string("#End");
// add tbl/tbm to multiplayer validation list
extern void fs2netd_add_table_validation(char *tblname);
extern void fs2netd_add_table_validation(const char *tblname);
fs2netd_add_table_validation(filename);
// close localization
lcl_ext_close();
}
void ai_profiles_init()
+1
View File
@@ -65,6 +65,7 @@
#define AIPF2_ASPECT_LOCK_COUNTERMEASURE (1 << 11)
#define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING (1 << 12)
#define AIPF2_FIX_AI_PATH_ORDER_BUG (1 << 13)
#define AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING (1 << 14)
// AI Path types
#define AI_PATH_MODE_NORMAL 0
+109 -70
View File
@@ -171,6 +171,8 @@ done_1:
}
mc_info mc;
mc_info_init(&mc);
mc.model_instance_num = Ships[objp->instance].model_instance_num;
mc.model_num = sip->model_num;
mc.orient = &objp->orient;
@@ -367,9 +369,13 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
object *target_objp;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
if ( aip->target_objnum < 0 )
return 0;
target_objp = &Objects[aip->target_objnum];
if ( (aip->targeted_subsys != NULL) && (aip->target_objnum >= 0) && (aip->targeted_subsys->system_info->path_num >= 0) ) {
if ( (aip->targeted_subsys != NULL) && (aip->targeted_subsys->system_info->path_num >= 0) ) {
int subsys_path_num, subsys_in_sight, checked_sight;
float dist;
@@ -597,11 +603,15 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
// see if Pl_objp needs to reposition to get a good shot at subsystem which is being attacked
if ( ai_big_maybe_follow_subsys_path() ) {
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
return;
}
vec3d *rel_pos, vec_to_enemy;
float weapon_travel_dist;
vec3d *rel_pos;
vec3d vec_to_enemy;
float weapon_travel_dist;
start_bank = Ships[aip->shipnum].weapons.current_primary_bank;
@@ -626,11 +636,25 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
weapon_travel_dist = ai_get_weapon_dist(&Ships[Pl_objp->instance].weapons);
if ( aip->targeted_subsys != NULL ) {
if (dist_to_enemy > (weapon_travel_dist-20))
if (dist_to_enemy > (weapon_travel_dist-20)) {
accelerate_ship(aip, 1.0f);
else {
ship *shipp = &Ships[Pl_objp->instance];
if ((aip->ai_flags & AIF_FREE_AFTERBURNER_USE) && !(shipp->flags2 & SF2_AFTERBURNER_LOCKED) && (dot_to_enemy > 0.75f)) {
if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
afterburners_start(Pl_objp);
aip->afterburner_stop_time = Missiontime + 3*F1_0;
}
} else if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
} else {
// AL 12-31-97: Move at least as quickly as your target is moving...
accelerate_ship(aip, MAX(1.0f - dot_to_enemy, Objects[aip->target_objnum].phys_info.fspeed/sip->max_speed));
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
}
} else {
@@ -651,10 +675,22 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float d
if (dist_to_enemy < ATTACK_STOP_DISTANCE) {
// accelerate_ship(aip, accel * 0.5f);
accelerate_ship(aip, -1.0f);
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
} else {
accelerate_ship(aip, accel);
}
ship *shipp = &Ships[Pl_objp->instance];
if ((aip->ai_flags & AIF_FREE_AFTERBURNER_USE) && !(shipp->flags2 & SF2_AFTERBURNER_LOCKED) && (accel > 0.95f)) {
if (ai_maybe_fire_afterburner(Pl_objp, aip)) {
afterburners_start(Pl_objp);
aip->afterburner_stop_time = Missiontime + 3*F1_0;
}
} else if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
}
}
}
}
@@ -711,86 +747,75 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
}
if (tswp->num_secondary_banks > 0) {
int priority1, priority2;
priority1 = -1;
priority2 = -1;
// Maybe favor selecting a bomb.
// Note, if you're firing a bomb, if it's aspect seeking, the firing conditions can be looser.
if (Ship_info[Ships[En_objp->instance].ship_info_index].flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))
if (En_objp->phys_info.speed * dist_to_enemy < 5000.0f) // Don't select a bomb if enemy moving fast relative to distance
priority1 = WIF_BOMB;
if (!(En_objp->flags & OF_PROTECTED) || (aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP))) {
//ai_select_secondary_weapon(Pl_objp, tswp, priority1, priority2); // Note, need to select to get weapon speed and lifetime
if(aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) {
priority1 = WIF_PUNCTURE;
}
ai_choose_secondary_weapon(Pl_objp, aip, En_objp);
int current_bank = tswp->current_secondary_bank;
weapon_info *swip = &Weapon_info[tswp->secondary_bank_weapons[current_bank]];
if (current_bank > -1) {
weapon_info *swip = &Weapon_info[tswp->secondary_bank_weapons[current_bank]];
if(!(En_objp->flags & OF_PROTECTED) || ((aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) && swip->wi_flags & WIF_PUNCTURE )) { //override lockdown on protected ships when using anti subsystem weapons - Valathil
// If ship is protected and very low on hits, don't fire missiles.
if ((current_bank > -1) && (!(En_objp->flags & OF_PROTECTED) || (En_objp->hull_strength > 10*swip->damage))) {
if (aip->ai_flags & AIF_UNLOAD_SECONDARIES) {
if (timestamp_until(swp->next_secondary_fire_stamp[current_bank]) > swip->fire_wait*1000.0f) {
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (swip->fire_wait*1000.0f));
}
}
if (timestamp_elapsed(swp->next_secondary_fire_stamp[current_bank])) {
float firing_range;
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
firing_range=swip->lssm_lock_range;
else
firing_range = MIN((swip->max_speed * swip->lifetime), swip->weapon_range);
// reduce firing range of secondaries in nebula
extern int Nebula_sec_range;
if ((The_mission.flags & MISSION_FLAG_FULLNEB) && Nebula_sec_range) {
firing_range *= 0.8f;
if(!(En_objp->flags & OF_PROTECTED) || ((aip->goals[0].ai_mode & (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)) && swip->wi_flags & WIF_PUNCTURE )) { //override lockdown on protected ships when using anti subsystem weapons - Valathil
// If ship is protected and very low on hits, don't fire missiles.
if (!(En_objp->flags & OF_PROTECTED) || (En_objp->hull_strength > 10*swip->damage)) {
if (aip->ai_flags & AIF_UNLOAD_SECONDARIES) {
if (timestamp_until(swp->next_secondary_fire_stamp[current_bank]) > swip->fire_wait*1000.0f) {
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (swip->fire_wait*1000.0f));
}
}
float t = 0.25f; // default delay in seconds until next fire.
if (timestamp_elapsed(swp->next_secondary_fire_stamp[current_bank])) {
float firing_range;
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
firing_range=swip->lssm_lock_range;
else
firing_range = MIN((swip->max_speed * swip->lifetime), swip->weapon_range);
// reduce firing range of secondaries in nebula
extern int Nebula_sec_range;
if ((The_mission.flags & MISSION_FLAG_FULLNEB) && Nebula_sec_range) {
firing_range *= 0.8f;
}
if (dist_to_enemy < firing_range*1.0f) {
float t = 0.25f; // default delay in seconds until next fire.
if (dist_to_enemy < firing_range*1.0f) {
//vm_vec_scale_add(&future_enemy_pos, enemy_pos, enemy_vel, dist_to_enemy/swip->max_speed);
//if (vm_vec_dist_quick(&future_enemy_pos, firing_pos) < firing_range * 0.8f) {
if (ai_fire_secondary_weapon(Pl_objp)) {
if ((aip->ai_flags & AIF_UNLOAD_SECONDARIES) || (swip->burst_flags & WBF_FAST_FIRING)) {
if (swip->burst_shots > swp->burst_counter[current_bank]) {
t = swip->burst_delay;
swp->burst_counter[current_bank]++;
} else {
t = swip->fire_wait;
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank] = myrand() % swip->burst_shots;
//vm_vec_scale_add(&future_enemy_pos, enemy_pos, enemy_vel, dist_to_enemy/swip->max_speed);
//if (vm_vec_dist_quick(&future_enemy_pos, firing_pos) < firing_range * 0.8f) {
if (ai_fire_secondary_weapon(Pl_objp)) {
int current_bank_adjusted = MAX_SHIP_PRIMARY_BANKS + current_bank;
if ((aip->ai_flags & AIF_UNLOAD_SECONDARIES) || (swip->burst_flags & WBF_FAST_FIRING)) {
if (swip->burst_shots > swp->burst_counter[current_bank_adjusted]) {
t = swip->burst_delay;
swp->burst_counter[current_bank_adjusted]++;
} else {
swp->burst_counter[current_bank] = 0;
t = swip->fire_wait;
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank_adjusted] = myrand() % swip->burst_shots;
} else {
swp->burst_counter[current_bank_adjusted] = 0;
}
}
}
} else {
if (swip->burst_shots > swp->burst_counter[current_bank]) {
t = set_secondary_fire_delay(aip, temp_shipp, swip, true);
swp->burst_counter[current_bank]++;
} else {
t = set_secondary_fire_delay(aip, temp_shipp, swip, false);
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank] = myrand() % swip->burst_shots;
if (swip->burst_shots > swp->burst_counter[current_bank_adjusted]) {
t = set_secondary_fire_delay(aip, temp_shipp, swip, true);
swp->burst_counter[current_bank_adjusted]++;
} else {
swp->burst_counter[current_bank] = 0;
t = set_secondary_fire_delay(aip, temp_shipp, swip, false);
if ((swip->burst_shots > 0) && (swip->burst_flags & WBF_RANDOM_LENGTH)) {
swp->burst_counter[current_bank_adjusted] = myrand() % swip->burst_shots;
} else {
swp->burst_counter[current_bank_adjusted] = 0;
}
}
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
//}
//}
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
swp->next_secondary_fire_stamp[current_bank] = timestamp((int) (t*1000.0f));
}
}
}
@@ -861,6 +886,9 @@ void ai_big_chase()
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered (i.e. MODE start time)
aip->submode = AIS_STRAFE_AVOID;
aip->submode_start_time = Missiontime;
if (Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) {
afterburners_stop(Pl_objp);
}
return;
}
}
@@ -901,8 +929,12 @@ void ai_big_chase()
case SM_ATTACK:
case SM_SUPER_ATTACK:
if (vm_vec_dist_quick(&Pl_objp->pos, &predicted_enemy_pos) > 100.0f + En_objp->radius * 2.0f) {
if (maybe_avoid_big_ship(Pl_objp, En_objp, aip, &predicted_enemy_pos, 10.0f))
if (maybe_avoid_big_ship(Pl_objp, En_objp, aip, &predicted_enemy_pos, 10.0f)) {
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
return;
}
}
if (aip->target_time < 2.0f)
@@ -918,6 +950,13 @@ void ai_big_chase()
//
// Set turn and acceleration based on submode.
//
if (((aip->submode != SM_ATTACK) && (aip->submode != SM_SUPER_ATTACK) && (aip->submode != SM_ATTACK_FOREVER) && (aip->submode != SM_EVADE_WEAPON)) || (aip->mode == AIM_STRAFE)){
if ((Pl_objp->phys_info.flags & PF_AFTERBURNER_ON) && !(aip->ai_flags & AIF_KAMIKAZE)) {
afterburners_stop(Pl_objp);
}
}
switch (aip->submode) {
case SM_CONTINUOUS_TURN:
ai_big_chase_ct();
+2 -2
View File
@@ -12,10 +12,10 @@
#ifndef __AIBIG_H__
#define __AIBIG_H__
struct object;
class object;
struct ai_info;
struct vec3d;
struct ship_subsys;
class ship_subsys;
void ai_big_ship(object *objp);
void ai_big_chase();
+537 -180
View File
File diff suppressed because it is too large. Load diff
+23 -9
View File
@@ -93,7 +93,7 @@ int Num_ai_goals = sizeof(Ai_goal_names) / sizeof(ai_goal_list);
// HUD what a ship's current orders are. If the AI goal doesn't correspond to something that
// ought to be printable, then NULL is used.
// JAS: Converted to a function in order to externalize the strings
char *Ai_goal_text(int goal)
const char *Ai_goal_text(int goal)
{
switch(goal) {
case 1:
@@ -979,6 +979,16 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp, char *actor_name )
aigp->priority = MAX_GOAL_PRIORITY;
}
// Goober5000 - we now have an extra optional chase argument to allow chasing our own team
if ( op == OP_AI_CHASE || op == OP_AI_CHASE_WING || op == OP_AI_DISABLE_SHIP || op == OP_AI_DISARM_SHIP ) {
if ((CDDDR(node) != -1) && is_sexp_true(CDDDR(node)))
aigp->flags |= AIGF_TARGET_OWN_TEAM;
}
if ( op == OP_AI_DESTROY_SUBSYS ) {
if ((CDDDDR(node) != -1) && is_sexp_true(CDDDDR(node)))
aigp->flags |= AIGF_TARGET_OWN_TEAM;
}
// Goober5000 - since none of the goals act on the actor,
// don't assign the goal if the actor's goal target is itself
if (aigp->target_name != NULL && !strcmp(aigp->target_name, actor_name))
@@ -1374,13 +1384,17 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
if (!(shipp->flags2 & SF2_NO_SUBSPACE_DRIVE))
return AI_GOAL_ACHIEVABLE;
// if no subspace drive, only valid if there's somewhere to depart to
// if no subspace drive, only valid if our mothership is present
// locate a capital ship on the same team:
if (ship_get_ship_with_dock_bay(shipp->team) >= 0)
return AI_GOAL_ACHIEVABLE;
else
return AI_GOAL_NOT_KNOWN;
// 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;
}
return AI_GOAL_NOT_KNOWN;
}
@@ -2340,7 +2354,7 @@ void ai_update_goal_references(ai_goal *goals, int type, const char *old_name, c
}
}
int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name)
int query_referenced_in_ai_goals(ai_goal *goals, int type, const char *name)
{
int i, mode, flag;
@@ -2405,7 +2419,7 @@ int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name)
return 0;
}
char *ai_add_dock_name(char *str)
char *ai_add_dock_name(const char *str)
{
char *ptr;
int i;
+3 -3
View File
@@ -86,7 +86,7 @@ extern int Num_ai_goals;
extern int Num_ai_dock_names;
extern char Ai_dock_names[MAX_AI_DOCK_NAMES][NAME_LENGTH];
extern char *Ai_goal_text(int goal);
extern const char *Ai_goal_text(int goal);
// extern function definitions
extern void ai_post_process_mission();
@@ -118,8 +118,8 @@ extern void ai_mission_goal_complete( ai_info *aip );
extern void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp );
extern void ai_update_goal_references(ai_goal *goals, int type, const char *old_name, const char *new_name);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name);
extern char *ai_add_dock_name(char *str);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, const char *name);
extern char *ai_add_dock_name(const char *str);
extern int ai_query_goal_valid( int ship, int ai_goal );
+104 -32
View File
@@ -22,6 +22,7 @@
#include "iff_defs/iff_defs.h"
#include "weapon/muzzleflash.h"
#include "parse/scripting.h"
#include "debugconsole/console.h"
#include <limits.h>
@@ -38,8 +39,7 @@
float Lethality_range_const = 2.0f;
DCF(lethality_range, "N for modifying range: 1 / (1+N) at 100")
{
dc_get_arg(ARG_FLOAT);
Lethality_range_const = Dc_arg_float;
dc_stuff_float(&Lethality_range_const);
}
float Player_lethality_bump[NUM_SKILL_LEVELS] = {
@@ -354,6 +354,54 @@ bool turret_weapon_has_flags2(ship_weapon *swp, int flags)
return false;
}
/**
* Just gloms all the flags from all the weapons into one variable. More efficient if all you need to do is test for the existence of a flag.
*/
int turret_weapon_aggregate_flags(ship_weapon *swp)
{
Assert(swp != NULL);
int i = 0, flags = 0;
for (i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] >= 0) {
flags |= Weapon_info[swp->primary_bank_weapons[i]].wi_flags;
}
}
for (i = 0; i < swp->num_secondary_banks; i++)
{
if (swp->secondary_bank_weapons[i] >= 0) {
flags |= Weapon_info[swp->secondary_bank_weapons[i]].wi_flags;
}
}
return flags;
}
/**
* Just gloms all the flags from all the weapons into one variable. More efficient if all you need to do is test for the existence of a flag.
*/
int turret_weapon_aggregate_flags2(ship_weapon *swp)
{
Assert(swp != NULL);
int i = 0, flags2 = 0;
for (i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] >= 0) {
flags2 |= Weapon_info[swp->primary_bank_weapons[i]].wi_flags2;
}
}
for (i = 0; i < swp->num_secondary_banks; i++)
{
if (swp->secondary_bank_weapons[i] >= 0) {
flags2 |= Weapon_info[swp->secondary_bank_weapons[i]].wi_flags2;
}
}
return flags2;
}
/**
* Returns true if any of the weapons in swp have the subtype specified
*
@@ -479,7 +527,7 @@ int valid_turret_enemy(object *objp, object *turret_parent)
}
// don't shoot at ships without collision check
if (sip->flags & SIF_NO_COLLIDE) {
if (!(objp->flags & OF_COLLIDES)) {
return 0;
}
@@ -501,7 +549,11 @@ int valid_turret_enemy(object *objp, object *turret_parent)
weapon *wp = &Weapons[objp->instance];
weapon_info *wip = &Weapon_info[wp->weapon_info_index];
if ( (!(wip->wi_flags & WIF_BOMB) && !(Ai_info[Ships[turret_parent->instance].ai_index].ai_profile_flags & AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY) ) ) {
if (wip->subtype == WP_LASER && !(wip->wi_flags3 & WIF3_TURRET_INTERCEPTABLE)) { // If the thing can't be shot down, don't try. -MageKing17
return 0;
}
if ( (!((wip->wi_flags & WIF_BOMB) || (wip->wi_flags3 & WIF3_TURRET_INTERCEPTABLE)) && !(Ai_info[Ships[turret_parent->instance].ai_index].ai_profile_flags & AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY) ) ) {
return 0;
}
@@ -598,9 +650,15 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
}
}
// check if turret flagged to only target tagged ships
// check if turret flagged to only target tagged ships
// Note: retail behaviour was turrets with tagged-only could fire at bombs
// and could fire their spawn weapons
// this check is almost redundant; see the almost identical check in ai_fire_from_turret
// however if this is removed turrets still track targets but don't fire at them (which looks silly)
if (eeo->eeo_flags & EEOF_TAGGED_ONLY) {
if (!ship_is_tagged(objp)) {
if (!ship_is_tagged(objp) &&
( (The_mission.ai_profile->flags2 & AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING) ||
( !(objp->type == OBJ_WEAPON) && !(turret_weapon_has_flags(&eeo->turret_subsys->weapons, WIF_SPAWN))) )) {
return;
}
}
@@ -1049,7 +1107,7 @@ int get_nearest_turret_objnum(int turret_parent_objnum, ship_subsys *turret_subs
objp = &Objects[mo->objnum];
Assert(objp->type == OBJ_WEAPON);
if (Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags & WIF_BOMB)
if ((Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags & WIF_BOMB) || (Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags3 & WIF3_TURRET_INTERCEPTABLE))
{
evaluate_obj_as_target(objp, &eeo);
}
@@ -1319,7 +1377,7 @@ void turret_ai_update_aim(ai_info *aip, object *En_Objp, ship_subsys *ss)
*/
int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object *objp, object *lep, vec3d *predicted_enemy_pos, vec3d *gvec)
{
int ret_val = 0;
int ret_val __attribute__((__unused__)) = 0; // to be used in future, see comment @ end of function
if (ss->turret_enemy_objnum != -1) {
model_subsystem *tp = ss->system_info;
@@ -1365,7 +1423,7 @@ int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object
//Try to guess where the enemy will be, and store that spot in predicted_enemy_pos
if (The_mission.ai_profile->flags & AIPF_USE_ADDITIVE_WEAPON_VELOCITY) {
vm_vec_sub2(&target_moving_direction, &objp->phys_info.vel);
vm_vec_scale_sub2(&target_moving_direction, &objp->phys_info.vel, wip->vel_inherit_amount);
}
set_predicted_enemy_pos_turret(predicted_enemy_pos, &gun_pos, objp, &enemy_point, &target_moving_direction, wip->max_speed, ss->turret_time_enemy_in_range * (weapon_system_strength + 1.0f)/2.0f);
@@ -1466,10 +1524,16 @@ ship_subsys *aifft_list[MAX_AIFFT_TURRETS];
float aifft_rank[MAX_AIFFT_TURRETS];
int aifft_list_size = 0;
int aifft_max_checks = 5;
DCF(mf, "")
DCF(mf, "Adjusts the maximum number of tries an AI may do when trying to pick a subsystem to attack (Default is 5)")
{
dc_get_arg(ARG_INT);
aifft_max_checks = Dc_arg_int;
dc_stuff_int(&aifft_max_checks);
if (aifft_max_checks <= 0) {
dc_printf("Value must be a non-negative, non-zero integer\n");
dc_printf("aifft_max_checks set to default value of 5\n");
aifft_max_checks = 5;
}
}
@@ -1820,8 +1884,7 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
}
// now do anything else
else {
for (int i=0; i < wip->shots; i++)
{
for (int i = 0; i < wip->shots; i++) {
// zookeeper - Firepoints should cycle normally between shots,
// so we need to get the position info separately for each shot
ship_get_global_turret_gun_info(&Objects[parent_objnum], turret, turret_pos, turret_fvec, 1, NULL);
@@ -1829,13 +1892,12 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
weapon_objnum = weapon_create( turret_pos, &turret_orient, turret_weapon_class, parent_objnum, -1, 1, 0,0.0f, turret);
weapon_set_tracking_info(weapon_objnum, parent_objnum, turret->turret_enemy_objnum, 1, turret->targeted_subsys);
objp=&Objects[weapon_objnum];
wp=&Weapons[objp->instance];
wip=&Weapon_info[wp->weapon_info_index];
//nprintf(("AI", "Turret_time_enemy_in_range = %7.3f\n", ss->turret_time_enemy_in_range));
if (weapon_objnum != -1) {
objp = &Objects[weapon_objnum];
wp = &Weapons[objp->instance];
wip = &Weapon_info[wp->weapon_info_index];
parent_ship->last_fired_turret = turret;
turret->last_fired_weapon_info_index = wp->weapon_info_index;
@@ -1847,7 +1909,7 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
Script_system.RunCondition(CHA_ONTURRETFIRED, 0, NULL, &Objects[parent_objnum]);
// if the gun is a flak gun
if(wip->wi_flags & WIF_FLAK){
if (wip->wi_flags & WIF_FLAK) {
// show a muzzle flash
flak_muzzle_flash(turret_pos, turret_fvec, &Objects[parent_ship->objnum].phys_info, turret_weapon_class);
@@ -1863,8 +1925,10 @@ bool turret_fire_weapon(int weapon_num, ship_subsys *turret, int parent_objnum,
{
flak_set_range(objp, flak_range_override);
}
} else if(wip->muzzle_flash > -1) {
mflash_create(turret_pos, turret_fvec, &Objects[parent_ship->objnum].phys_info, Weapon_info[turret_weapon_class].muzzle_flash);
}
// otherwise just do mflash if the weapon has it
else if (wip->muzzle_flash >= 0) {
mflash_create(turret_pos, turret_fvec, &Objects[parent_ship->objnum].phys_info, wip->muzzle_flash);
}
// in multiplayer (and the master), then send a turret fired packet.
@@ -1954,6 +2018,11 @@ void turret_swarm_fire_from_turret(turret_swarm_info *tsi)
Weapons[Objects[weapon_objnum].instance].turret_subsys = tsi->turret;
Weapons[Objects[weapon_objnum].instance].target_num = tsi->turret->turret_enemy_objnum;
// muzzle flash?
if (Weapon_info[tsi->weapon_class].muzzle_flash >= 0) {
mflash_create(&turret_pos, &turret_fvec, &Objects[tsi->parent_objnum].phys_info, Weapon_info[tsi->weapon_class].muzzle_flash);
}
// maybe sound
if ( Weapon_info[tsi->weapon_class].launch_snd != -1 ) {
// Don't play turret firing sound if turret sits on player ship... it gets annoying.
@@ -1961,8 +2030,7 @@ void turret_swarm_fire_from_turret(turret_swarm_info *tsi)
snd_play_3d( &Snds[Weapon_info[tsi->weapon_class].launch_snd], &turret_pos, &View_position );
}
}
if(Weapon_info[tsi->weapon_class].muzzle_flash > -1)
mflash_create(&turret_pos, &turret_fvec, &Objects[tsi->parent_objnum].phys_info, Weapon_info[tsi->weapon_class].muzzle_flash);
// in multiplayer (and the master), then send a turret fired packet.
if ( MULTIPLAYER_MASTER && (weapon_objnum != -1) ) {
int subsys_index;
@@ -2049,7 +2117,7 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
// (NOTE: this will probably get changed by other parts of the code (swarming, beams, etc) to be
// a more accurate time, but we need to give it a long enough time for the other parts of the code
// to change the timestamp before it gets acted upon - taylor)
ss->turret_animation_done_time = timestamp(1000);
ss->turret_animation_done_time = timestamp(200);
} else {
return;
}
@@ -2219,6 +2287,8 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
}
}
bool tagged_only = ((wip->wi_flags2 & WIF2_TAGGED_ONLY) || (ss->weapons.flags & SW_FLAG_TAGGED_ONLY));
if (lep->type == OBJ_SHIP) {
// Check if we're targeting a protected ship
if (lep->flags & OF_PROTECTED) {
@@ -2251,14 +2321,16 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
ss->turret_time_enemy_in_range = 0.0f;
continue;
}
// Check if weapon or turret is set to tagged-only
// must check here in case turret has multiple weapons and not all are tagged-only
else if (!ship_is_tagged(lep) && tagged_only) {
continue;
}
}
else
{
//can't tag anything else, other than asteroids
//but we don't want to waste this type of
//weaponary on asteroids now do we?
if ((wip->wi_flags2 & WIF2_TAGGED_ONLY) || (ss->weapons.flags & SW_FLAG_TAGGED_ONLY))
{
// check tagged-only for non-ship targets
if (tagged_only && (!(lep->type == OBJ_WEAPON) || (The_mission.ai_profile->flags2 & AIPF2_STRICT_TURRET_TAGGED_ONLY_TARGETING))) {
continue;
}
}
@@ -2484,11 +2556,11 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
if ( ok_to_fire && (tp->flags & MSS_FLAG_TURRET_HULL_CHECK) ) {
int model_num = Ship_info[shipp->ship_info_index].model_num;
mc_info hull_check;
vec3d end;
vm_vec_scale_add(&end, &gpos, &gvec, model_get_radius(model_num));
mc_info hull_check;
mc_info_init(&hull_check);
hull_check.model_instance_num = shipp->model_instance_num;
hull_check.model_num = model_num;
hull_check.orient = &objp->orient;
+10 -6
View File
@@ -196,8 +196,8 @@ anim_instance *anim_play(anim_play_struct *aps)
}
if(aps->base_w < 0 || aps->base_h < 0) {
instance->base_w = gr_screen.max_w_unscaled;
instance->base_h = gr_screen.max_h_unscaled;
instance->base_w = gr_screen.max_w_unscaled_zoomed;
instance->base_h = gr_screen.max_h_unscaled_zoomed;
} else {
instance->base_w = aps->base_w;
instance->base_h = aps->base_h;
@@ -488,16 +488,20 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
// determine x,y to display the bitmap at
if ( instance->world_pos == NULL ) {
int old_max_w_unscaled = gr_screen.max_w_unscaled;
int old_max_h_unscaled = gr_screen.max_h_unscaled;
int old_max_w_unscaled_zoomed = gr_screen.max_w_unscaled_zoomed;
int old_max_h_unscaled_zoomed = gr_screen.max_h_unscaled_zoomed;
gr_set_screen_scale(instance->base_w, instance->base_h);
gr_set_clip(0, 0, instance->base_w, instance->base_h, false);
gr_set_clip(0, 0, instance->base_w, instance->base_h, GR_RESIZE_MENU);
if ( instance->aa_color == NULL ) {
gr_bitmap(instance->x, instance->y);
gr_bitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
}
else {
gr_set_color_fast( (color*)instance->aa_color );
gr_aabitmap(instance->x, instance->y);
gr_aabitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
}
gr_reset_screen_scale();
gr_set_screen_scale(old_max_w_unscaled, old_max_h_unscaled, old_max_w_unscaled_zoomed, old_max_h_unscaled_zoomed);
gr_reset_clip();
}
else {
-2
View File
@@ -301,7 +301,6 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
Assert(packed_size == (save-dest_start) );
return packed_size;
break;
}
default:
@@ -467,7 +466,6 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
Assert(packed_size == (save-dest_start) );
return packed_size;
break;
}
default:
+11 -29
View File
@@ -39,6 +39,8 @@
#include "network/multimsgs.h"
#include "network/multi.h"
#include "parse/scripting.h"
#include "debugconsole/console.h"
#include <algorithm>
#include "globalincs/compatibility.h"
@@ -859,7 +861,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
if ((dot < 0.7f) || (dist > 3000.0f)) {
if ( (dot < 0.7f) || (dist > asfieldp->bound_rad) ) {
if (Num_asteroids > MAX_ASTEROIDS-10) {
objp->flags |= OF_SHOULD_BE_DEAD;
} else {
@@ -867,12 +869,11 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
asteroid_wrap_pos(objp, asfieldp);
Asteroids[objp->instance].target_objnum = -1;
vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
dist = vm_vec_dist_quick(&objp->pos, &Eye_position);
if (( dot > 0.7f) && (dist < 3000.0f)) {
// player would see asteroid pop out other side, so reverse velocity instead of wrapping
if ( (dot > 0.7f) && (dist < (asfieldp->bound_rad * 1.3f)) ) {
// player would see asteroid pop out other side, so reverse velocity instead of wrapping
objp->pos = old_asteroid_pos;
vm_vec_copy_scale(&objp->phys_info.vel, &old_vel, -1.0f);
objp->phys_info.desired_vel = objp->phys_info.vel;
@@ -914,6 +915,7 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vec3d *hitpos
}
mc_info mc;
mc_info_init(&mc);
int num, asteroid_subtype;
Assert( pasteroid->type == OBJ_ASTEROID );
@@ -1403,23 +1405,8 @@ void asteroid_level_close()
Asteroid_field.num_initial_asteroids=0;
}
DCF(asteroids,"Turns asteroids on/off")
{
if ( Dc_command ) {
dc_get_arg(ARG_TRUE|ARG_FALSE|ARG_NONE);
if ( Dc_arg_type & ARG_TRUE )
Asteroids_enabled = 1;
else if ( Dc_arg_type & ARG_FALSE )
Asteroids_enabled = 0;
else if ( Dc_arg_type & ARG_NONE )
Asteroids_enabled ^= 1;
}
if ( Dc_help )
dc_printf( "Usage: asteroids [bool]\nTurns asteroid system on/off. If nothing passed, then toggles it.\n" );
if ( Dc_status )
dc_printf( "asteroids are %s\n", (Asteroids_enabled?"ON":"OFF") );
}
DCF_BOOL2(asteroids, Asteroids_enabled, "enables or disables asteroids", "Usage: asteroids [bool]\nTurns asteroid system on/off. If nothing passed, then toggles it.\n");
void hud_target_asteroid()
{
@@ -1641,6 +1628,7 @@ void asteroid_test_collide(object *asteroid_obj, object *ship_obj, mc_info *mc,
int asteroid_will_collide(object *asteroid_obj, object *escort_objp)
{
mc_info mc;
mc_info_init(&mc);
asteroid_test_collide(asteroid_obj, escort_objp, &mc);
@@ -1771,6 +1759,7 @@ float asteroid_time_to_impact(object *asteroid_objp)
float time=-1.0f, total_dist, speed;
asteroid *asp;
mc_info mc;
mc_info_init(&mc);
asp = &Asteroids[asteroid_objp->instance];
@@ -1906,12 +1895,8 @@ void asteroid_parse_tbl()
"are no species for them to belong to."
);
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", "asteroid.tbl", rval));
lcl_ext_close();
return;
}
@@ -2040,9 +2025,6 @@ void asteroid_parse_tbl()
} else {
Asteroid_icon_closeup_zoom = 0.5f; // magic number from retail
}
// close localization
lcl_ext_close();
}
/**
+12 -6
View File
@@ -16,8 +16,8 @@
#include "globalincs/globals.h" // for NAME_LENGTH
struct object;
struct polymodel;
class object;
class polymodel;
struct collision_info_struct;
#define MAX_ASTEROIDS 512
@@ -52,7 +52,8 @@ typedef struct asteroid_split_info {
int max;
} asteroid_split_info;
class asteroid_info {
class asteroid_info
{
public:
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // POF files to load/associate with ship
@@ -79,10 +80,14 @@ public:
fireball_radius_multiplier( -1 )
{
name[ 0 ] = 0;
memset( pof_files, 0, sizeof( pof_files ) );
memset( detail_distance, 0, sizeof( detail_distance ) );
memset( modelp, 0, sizeof( modelp ) );
memset( model_num, -1, sizeof( model_num ) );
for (int i = 0; i < NUM_DEBRIS_POFS; i++)
{
modelp[i] = NULL;
model_num[i] = -1;
pof_files[i][0] = 0;
}
}
};
@@ -119,6 +124,7 @@ typedef enum {
typedef struct asteroid_field {
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
float bound_rad;
int has_inner_bound;
vec3d inner_min_bound;
vec3d inner_max_bound;
+44 -46
View File
@@ -209,7 +209,7 @@ bool CanAutopilot(vec3d targetPos, bool send_msg)
// check for support ships
// cannot autopilot if support ship present
if ( ship_find_repair_ship(Player_obj) != NULL ) {
if ( ship_find_repair_ship(Player_obj) != 0 ) {
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_PRESENT);
return false;
@@ -231,32 +231,43 @@ bool StartAutopilot()
{
// Check for support ship and dismiss it if it is not doing anything.
// If the support ship is doing something then tell the user such.
bool done = false;
while (!done) {
object* support_ship_op = ship_find_repair_ship(Player_obj);
if ( support_ship_op == NULL ) {
// no more
done = true;
break;
for ( object *objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) )
{
if ((objp->type == OBJ_SHIP) && !(objp->flags & OF_SHOULD_BE_DEAD))
{
Assertion((objp->instance >= 0) && (objp->instance < MAX_SHIPS),
"objp does not have a valid pointer to a ship. Pointer is %d, which is smaller than 0 or bigger than %d",
objp->instance, MAX_SHIPS);
ship *shipp = &Ships[objp->instance];
if (shipp->team != Player_ship->team)
continue;
Assertion((shipp->ship_info_index >= 0) && (shipp->ship_info_index < MAX_SHIP_CLASSES),
"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, MAX_SHIP_CLASSES);
ship_info *sip = &Ship_info[shipp->ship_info_index];
if ( !(sip->flags & SIF_SUPPORT) )
continue;
// don't deal with dying or departing support ships
if ( shipp->flags & (SF_DYING | SF_DEPARTING) )
continue;
Assert(shipp->ai_index != -1);
ai_info* support_ship_aip = &(Ai_info[Ships[objp->instance].ai_index]);
// is support ship trying to rearm-repair
if ( ai_find_goal_index( support_ship_aip->goals, AI_GOAL_REARM_REPAIR ) == -1 ) {
// no, so tell it to depart
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_WARP, -1, NULL, support_ship_aip );
} else {
// yes
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_WORKING);
return false;
}
}
Assert( support_ship_op->type == OBJ_SHIP );
Assert( support_ship_op->instance >= 0 );
Assert( support_ship_op->instance < MAX_SHIPS );
Assert( Ships[support_ship_op->instance].ai_index != -1 );
ai_info* support_ship_aip = &(Ai_info[Ships[support_ship_op->instance].ai_index]);
// is support ship trying to rearm-repair
if ( ai_find_goal_index( support_ship_aip->goals, AI_GOAL_REARM_REPAIR ) == -1 ) {
// no, so tell it to depart
ai_add_ship_goal_player( AIG_TYPE_PLAYER_SHIP, AI_GOAL_WARP, -1, NULL, support_ship_aip );
} else {
// yes
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_WORKING);
return false;
}
}
if (!CanAutopilot())
return false;
@@ -1201,7 +1212,7 @@ void NavSystem_Do()
void send_autopilot_msgID(int msgid)
{
if (msgid < 0 || msgid > NP_NUM_MESSAGES)
if (msgid < 0 || msgid >= NP_NUM_MESSAGES)
return;
send_autopilot_msg(NavMsgs[msgid].message, NavMsgs[msgid].filename);
@@ -1240,7 +1251,9 @@ void send_autopilot_msg(char *msg, char *snd)
// Inits the Nav System
void NavSystem_Init()
{
memset((char *)&Navs, 0, sizeof(Navs));
for (int i = 0; i < MAX_NAVPOINTS; i++)
Navs[i].clear();
AutoPilotEngaged = false;
CurrentNav = -1;
audio_handle = -1;
@@ -1261,13 +1274,9 @@ void parse_autopilot_table(char *filename)
int rval;
SCP_vector<SCP_string> lines;
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
{
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default autopilot.tbl>", rval));
lcl_ext_close();
return;
}
@@ -1324,9 +1333,6 @@ void parse_autopilot_table(char *filename)
required_string("#END");
// close localization
lcl_ext_close();
}
@@ -1343,13 +1349,6 @@ int FindNav(char *Nav)
return -1;
}
// ********************************************************************************************
// Set A Nav point to "ZERO"
void ZeroNav(int i)
{
memset((char *)&Navs[i], 0, sizeof(NavPoint));
}
// ********************************************************************************************
// Removes a Nav
bool DelNavPoint(char *Nav)
@@ -1360,7 +1359,6 @@ bool DelNavPoint(char *Nav)
}
bool DelNavPoint(int nav)
{
if (nav != -1)
@@ -1373,7 +1371,7 @@ bool DelNavPoint(int nav)
}
}
ZeroNav(MAX_NAVPOINTS-1);
Navs[MAX_NAVPOINTS-1].clear();
return true;
}
@@ -1401,7 +1399,7 @@ bool AddNav_Ship(char *Nav, char *TargetName, int flags)
// Create the NavPoint struct
NavPoint tnav;
strncpy(tnav.m_NavName, Nav, 32);
strcpy_s(tnav.m_NavName, Nav);
tnav.flags = NP_SHIP | flags;
Assert(!(tnav.flags & NP_WAYPOINT));
@@ -1447,7 +1445,7 @@ bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags)
// Create the NavPoint struct
NavPoint tnav;
strncpy(tnav.m_NavName, Nav, TOKEN_LENGTH);
strcpy_s(tnav.m_NavName, Nav);
tnav.flags = NP_WAYPOINT | flags;
Assert(!(tnav.flags & NP_SHIP));
+11 -1
View File
@@ -25,8 +25,9 @@
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
struct NavPoint
class NavPoint
{
public:
char m_NavName[32];
int flags;
@@ -35,6 +36,15 @@ struct NavPoint
vec3d *GetPosition();
char* GetInternalName();
void clear()
{
m_NavName[0] = 0;
flags = 0;
target_obj = NULL;
waypoint_num = -1;
}
};
+124 -98
View File
@@ -37,6 +37,7 @@
#include "jpgutils/jpgutils.h"
#include "parse/parselo.h"
#include "network/multiutil.h"
#include "debugconsole/console.h"
#define BMPMAN_INTERNAL
#include "bmpman/bm_internal.h"
@@ -72,7 +73,7 @@ int Bm_max_ram = 0; //16*1024*1024; // Only use 16 MB for textures
static int Bm_ignore_duplicates = 0;
static int Bm_ignore_load_count = 0;
#define EFF_FILENAME_CHECK { if ( be->type == BM_TYPE_EFF ) strncpy( filename, be->info.ani.eff.filename, MAX_FILENAME_LEN ); else strncpy( filename, be->filename, MAX_FILENAME_LEN ); }
#define EFF_FILENAME_CHECK { if ( be->type == BM_TYPE_EFF ) strcpy_s( filename, be->info.ani.eff.filename ); else strcpy_s( filename, be->filename ); }
@@ -416,7 +417,7 @@ int bm_create( int bpp, int w, int h, void *data, int flags )
*
* @return -1 if it could not be found index into ext_list[] if it was found as a file, fills img_cfg if available
*/
int bm_load_sub_slow(char *real_filename, const int num_ext, const char **ext_list, CFILE **img_cfp = NULL, int dir_type = CF_TYPE_ANY)
int bm_load_sub_slow(const char *real_filename, const int num_ext, const char **ext_list, CFILE **img_cfp = NULL, int dir_type = CF_TYPE_ANY)
{
char full_path[MAX_PATH];
int size = 0, offset = 0;
@@ -445,7 +446,7 @@ int bm_load_sub_slow(char *real_filename, const int num_ext, const char **ext_li
* Given a raw filename, try and find a bitmap that's already loaded
* @return 0 if it could not be found, 1 if it already exists, fills in handle
*/
int bm_load_sub_fast(char *real_filename, int *handle, int dir_type = CF_TYPE_ANY, bool animated_type = false)
int bm_load_sub_fast(const char *real_filename, int *handle, int dir_type = CF_TYPE_ANY, bool animated_type = false)
{
if (Bm_ignore_duplicates)
return 0;
@@ -485,7 +486,7 @@ int bm_load_sub_fast(char *real_filename, int *handle, int dir_type = CF_TYPE_AN
* @return A negative number if it couldn't load the bitmap.
* @return On success, it returns the bitmap number.
*/
int bm_load( char *real_filename )
int bm_load( const char *real_filename )
{
int i, free_slot = -1;
int w, h, bpp = 8;
@@ -611,7 +612,7 @@ Done:
*/
int bm_load(const SCP_string& filename)
{
return bm_load(const_cast<char*> (filename.c_str()));
return bm_load(filename.c_str());
}
/**
@@ -620,7 +621,7 @@ int bm_load(const SCP_string& filename)
* This is useful because in some cases we need to have a bitmap which is locked in screen format
* _and_ texture format, such as pilot pics and squad logos
*/
int bm_load_duplicate(char *filename)
int bm_load_duplicate(const char *filename)
{
int ret;
@@ -643,7 +644,7 @@ int bm_load_duplicate(char *filename)
* @return negative if the given handle doesn't exist, the filename was empty or the slot is still locked
* @return the bitmap_handle on success
*/
int bm_reload(int bitmap_handle, char* filename)
int bm_reload(int bitmap_handle, const char* filename)
{
if ( !bm_inited )
bm_init();
@@ -663,52 +664,59 @@ int bm_reload(int bitmap_handle, char* filename)
return -1;
}
strncpy(bm_bitmaps[bitmapnum].filename, filename, MAX_FILENAME_LEN);
strcpy_s(bm_bitmaps[bitmapnum].filename, filename);
return bitmap_handle;
}
DCF(bm_frag,"Shows BmpMan fragmentation")
{
if ( Dc_command ) {
if (dc_optional_string_either("help", "--help")) {
dc_printf("Displays a graphic showing the BmpMan fragmentation. Color key:\n");
dc_printf("\tGray : NONE\n");
dc_printf("\tRed : PCXn");
dc_printf("\tGreen : USER, TGA, PNG, DDS\n");
dc_printf("\tBlue : ANI, EFF\n\n");
gr_clear();
dc_printf("Once done reviewing the graphic, press any key to return to the console\n");
return;
}
gr_clear();
int x=0, y=0;
int xs=2, ys=2;
int w=4, h=4;
for (int i=0; i<MAX_BITMAPS; i++ ) {
switch( bm_bitmaps[i].type ) {
case BM_TYPE_NONE:
gr_set_color(128,128,128);
break;
case BM_TYPE_PCX:
gr_set_color(255,0,0);
break;
case BM_TYPE_USER:
case BM_TYPE_TGA:
case BM_TYPE_PNG:
case BM_TYPE_DDS:
gr_set_color(0,255,0);
break;
case BM_TYPE_ANI:
case BM_TYPE_EFF:
gr_set_color(0,0,255);
break;
}
gr_rect( x+xs, y+ys, w, h );
x += w+xs+xs;
if ( x > 639 ) {
x = 0;
y += h + ys + ys;
}
int x=0, y=0;
int xs=2, ys=2;
int w=4, h=4;
for (int i=0; i<MAX_BITMAPS; i++ ) {
switch( bm_bitmaps[i].type ) {
case BM_TYPE_NONE:
gr_set_color(128,128,128);
break;
case BM_TYPE_PCX:
gr_set_color(255,0,0);
break;
case BM_TYPE_USER:
case BM_TYPE_TGA:
case BM_TYPE_PNG:
case BM_TYPE_DDS:
gr_set_color(0,255,0);
break;
case BM_TYPE_ANI:
case BM_TYPE_EFF:
gr_set_color(0,0,255);
break;
}
gr_flip();
key_getch();
gr_rect( x+xs, y+ys, w, h );
x += w+xs+xs;
if ( x > 639 ) {
x = 0;
y += h + ys + ys;
}
}
gr_flip();
key_getch();
}
static int find_block_of(int n)
@@ -737,7 +745,7 @@ static int find_block_of(int n)
return -1;
}
int bm_load_and_parse_eff(char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type)
int bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type)
{
int frames = 0, fps = 30, keyframe = 0, rval;
char ext[8];
@@ -825,7 +833,7 @@ int bm_load_and_parse_eff(char *filename, int dir_type, int *nframes, int *nfps,
*
* @returns Bitmap number of first frame in the animation
*/
int bm_load_animation( char *real_filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
int bm_load_animation( const char *real_filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
{
int i, n;
anim the_anim;
@@ -1075,7 +1083,7 @@ int bm_load_animation( char *real_filename, int *nframes, int *fps, int *keyfram
return bm_bitmaps[n].handle;
}
int bm_load_either(char *filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
int bm_load_either(const char *filename, int *nframes, int *fps, int *keyframe, int can_drop_frames, int dir_type)
{
if(nframes != NULL)
*nframes = 0;
@@ -1191,7 +1199,7 @@ ubyte bm_get_type(int handle)
return bm_bitmaps[bitmapnum].type;
}
static void bm_convert_format( int bitmapnum, bitmap *bmp, ubyte bpp, ubyte flags )
static void bm_convert_format( bitmap *bmp, ubyte flags )
{
int idx;
@@ -1270,7 +1278,7 @@ void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
bmp->flags = 0;
bm_convert_format( bitmapnum, bmp, bpp, flags );
bm_convert_format( bmp, flags );
}
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags )
@@ -1382,7 +1390,7 @@ void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
memcpy(dptr, sptr, size);
}
bm_convert_format( first_frame+i, bm, bpp, flags );
bm_convert_format( bm, flags );
// Skip a frame
if ( (i < nframes-1) && can_drop_frames ) {
@@ -1434,7 +1442,7 @@ void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, uby
break;
}
bm_convert_format( bitmapnum, bmp, bpp, flags );
bm_convert_format( bmp, flags );
}
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags )
@@ -1493,7 +1501,7 @@ void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
bmp->flags = 0;
bm_convert_format( bitmapnum, bmp, bpp, flags );
bm_convert_format( bmp, flags );
}
/**
@@ -1794,7 +1802,7 @@ void bm_unlock( int handle )
Assert(be->ref_count >= 0); // Trying to unlock data more times than lock was called!!!
}
char *bm_get_filename(int handle)
const char *bm_get_filename(int handle)
{
int n;
@@ -2018,10 +2026,6 @@ int bm_unload_fast( int handle, int clear_render_targets )
be = &bm_bitmaps[n];
bmp = &be->bm;
if ( !clear_render_targets && ((be->type == BM_TYPE_RENDER_TARGET_STATIC) || (be->type == BM_TYPE_RENDER_TARGET_DYNAMIC)) ) {
return -1;
}
if ( be->type == BM_TYPE_NONE ) {
return -1; // Already been released
}
@@ -2030,6 +2034,10 @@ int bm_unload_fast( int handle, int clear_render_targets )
return -1;
}
if ( !clear_render_targets && ((be->type == BM_TYPE_RENDER_TARGET_STATIC) || (be->type == BM_TYPE_RENDER_TARGET_DYNAMIC)) ) {
return -1;
}
// If it is locked, cannot free it.
if (be->ref_count != 0) {
nprintf(("BmpMan", "Tried to unload_fast %s that has a lock count of %d.. not unloading\n", be->filename, be->ref_count));
@@ -2068,48 +2076,52 @@ void bm_unload_all()
DCF(bmpman,"Shows/changes bitmap caching parameters and usage")
{
if ( Dc_command ) {
dc_get_arg(ARG_STRING);
if ( !strcmp( Dc_arg, "flush" )) {
dc_printf( "Total RAM usage before flush: %d bytes\n", bm_texture_ram );
int i;
for (i = 0; i < MAX_BITMAPS; i++) {
if ( bm_bitmaps[i].type != BM_TYPE_NONE ) {
bm_free_data(i);
}
}
dc_printf( "Total RAM after flush: %d bytes\n", bm_texture_ram );
} else if ( !strcmp( Dc_arg, "ram" )) {
dc_get_arg(ARG_INT);
Bm_max_ram = Dc_arg_int*1024*1024;
} else {
// print usage, not stats
Dc_help = 1;
}
if ( dc_optional_string_either("help", "--help")) {
dc_printf( "Usage: BmpMan [arg]\nWhere arg can be any of the following:\n" );
dc_printf( "\tflush Unloads all bitmaps.\n" );
dc_printf( "\tram [x] Sets max mem usage to x MB. (Set to 0 to have no limit.)\n" );
dc_printf( "\t? Displays status of Bitmap manager.\n" );
return;
}
if ( Dc_help ) {
dc_printf( "Usage: BmpMan keyword\nWhere keyword can be in the following forms:\n" );
dc_printf( "BmpMan flush Unloads all bitmaps.\n" );
dc_printf( "BmpMan ram x Sets max mem usage to x MB. (Set to 0 to have no limit.)\n" );
dc_printf( "\nUse '? BmpMan' to see status of Bitmap manager.\n" );
Dc_status = 0; // don't print status if help is printed. Too messy.
}
if ( Dc_status ) {
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) {
dc_printf( "Total RAM usage: %d bytes\n", bm_texture_ram );
if ( Bm_max_ram > 1024*1024 )
dc_printf( "Max RAM allowed: %.1f MB\n", i2fl(Bm_max_ram)/(1024.0f*1024.0f) );
else if ( Bm_max_ram > 1024 )
dc_printf( "Max RAM allowed: %.1f KB\n", i2fl(Bm_max_ram)/(1024.0f) );
else if ( Bm_max_ram > 0 )
dc_printf( "Max RAM allowed: %d bytes\n", Bm_max_ram );
else
dc_printf( "No RAM limit\n" );
if (Bm_max_ram > 1024*1024) {
dc_printf( "\tMax RAM allowed: %.1f MB\n", i2fl(Bm_max_ram)/(1024.0f*1024.0f) );
} else if ( Bm_max_ram > 1024 ) {
dc_printf( "\tMax RAM allowed: %.1f KB\n", i2fl(Bm_max_ram)/(1024.0f) );
} else if ( Bm_max_ram > 0 ) {
dc_printf( "\tMax RAM allowed: %d bytes\n", Bm_max_ram );
} else {
dc_printf( "\tNo RAM limit\n" );
}
return;
}
if (dc_optional_string("flush")) {
dc_printf( "Total RAM usage before flush: %d bytes\n", bm_texture_ram );
int i;
for (i = 0; i < MAX_BITMAPS; i++) {
if ( bm_bitmaps[i].type != BM_TYPE_NONE ) {
bm_free_data(i);
}
}
dc_printf( "Total RAM after flush: %d bytes\n", bm_texture_ram );
} else if (dc_optional_string("ram")) {
dc_stuff_int(&Bm_max_ram);
if (Bm_max_ram > 0) {
dc_printf("BmpMan limited to %i, MB's\n", Bm_max_ram);
Bm_max_ram *= 1024 * 1024;
} else if (Bm_max_ram == 0) {
dc_printf("!!BmpMan memory is unlimited!!\n");
} else {
dc_printf("Illegal value. Must be non-negative.");
}
} else {
dc_printf("<BmpMan> No argument given\n");
}
}
@@ -2370,6 +2382,7 @@ int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
{
int n = bitmap_id % MAX_BITMAPS;
Assert( n >= 0 );
Assert( bm_bitmaps[n].handle == bitmap_id ); // INVALID BITMAP HANDLE
bitmap_entry *be = &bm_bitmaps[n];
@@ -2536,6 +2549,8 @@ void bm_get_filename(int bitmapnum, char *filename)
int n = bitmapnum % MAX_BITMAPS;
Assert( n >= 0 );
// return filename
strcpy(filename, bm_bitmaps[n].filename);
}
@@ -2552,8 +2567,8 @@ int bm_is_compressed(int num)
if (!Use_compressed_textures)
return 0;
Assert( (n >= 0) && (n < MAX_BITMAPS) );
Assert(num == bm_bitmaps[n].handle);
Assert( n >= 0 );
Assert( num == bm_bitmaps[n].handle);
type = bm_bitmaps[n].comp_type;
@@ -2588,7 +2603,7 @@ int bm_has_alpha_channel(int handle)
{
int n = handle % MAX_BITMAPS;
Assert( (n >= 0) && (n < MAX_BITMAPS) );
Assert( n >= 0 );
Assert( handle == bm_bitmaps[n].handle );
// assume that PCX never has a real alpha channel (it may be 32-bit, but without any alpha)
@@ -2616,8 +2631,8 @@ int bm_get_size(int num)
{
int n = num % MAX_BITMAPS;
Assert( (n >= 0) && (n < MAX_BITMAPS) );
Assert(num == bm_bitmaps[n].handle);
Assert( n >= 0 );
Assert( num == bm_bitmaps[n].handle );
return bm_bitmaps[n].mem_taken;
}
@@ -2626,7 +2641,7 @@ int bm_get_num_mipmaps(int num)
{
int n = num % MAX_BITMAPS;
Assert( (n >= 0) && (n < MAX_BITMAPS) );
Assert( n >= 0 );
Assert( num == bm_bitmaps[n].handle );
if (bm_bitmaps[n].num_mipmaps == 0)
@@ -2649,6 +2664,7 @@ int bm_convert_color_index_to_BGR(int num, ubyte **out_data)
int index = 0, mult = 3;
Assert( out_data != NULL );
Assert( n >= 0 );
Assert( num == bm_bitmaps[n].handle );
if ( num != bm_bitmaps[n].handle )
@@ -2824,7 +2840,8 @@ int bm_is_render_target(int bitmap_id)
{
int n = bitmap_id % MAX_BITMAPS;
Assert(bitmap_id == bm_bitmaps[n].handle);
Assert( n >= 0 );
Assert( bitmap_id == bm_bitmaps[n].handle );
if ( !((bm_bitmaps[n].type == BM_TYPE_RENDER_TARGET_STATIC) || (bm_bitmaps[n].type == BM_TYPE_RENDER_TARGET_DYNAMIC)) ) {
return 0;
@@ -2855,6 +2872,9 @@ int bm_set_render_target(int handle, int face)
gr_screen.save_max_w_unscaled = gr_screen.max_w_unscaled;
gr_screen.save_max_h_unscaled = gr_screen.max_h_unscaled;
gr_screen.save_max_w_unscaled_zoomed = gr_screen.max_w_unscaled_zoomed;
gr_screen.save_max_h_unscaled_zoomed = gr_screen.max_h_unscaled_zoomed;
}
if (n < 0) {
@@ -2863,12 +2883,18 @@ int bm_set_render_target(int handle, int face)
gr_screen.max_w_unscaled = gr_screen.save_max_w_unscaled;
gr_screen.max_h_unscaled = gr_screen.save_max_h_unscaled;
gr_screen.max_w_unscaled_zoomed = gr_screen.save_max_w_unscaled_zoomed;
gr_screen.max_h_unscaled_zoomed = gr_screen.save_max_h_unscaled_zoomed;
} else {
gr_screen.max_w = bm_bitmaps[n].bm.w;
gr_screen.max_h = bm_bitmaps[n].bm.h;
gr_screen.max_w_unscaled = bm_bitmaps[n].bm.w;
gr_screen.max_h_unscaled = bm_bitmaps[n].bm.h;
gr_screen.max_w_unscaled_zoomed = bm_bitmaps[n].bm.w;
gr_screen.max_h_unscaled_zoomed = bm_bitmaps[n].bm.h;
}
gr_screen.rendering_to_face = face;
+8 -8
View File
@@ -88,13 +88,13 @@ extern int bm_texture_ram;
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number.
int bm_load(char * filename);
int bm_load(const char* filename);
int bm_load(const SCP_string& filename);
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
// _and_ texture format, such as pilot pics and squad logos
int bm_load_duplicate(char *filename);
int bm_load_duplicate(const char *filename);
// Creates a bitmap that exists in RAM somewhere, instead
// of coming from a disk file. You pass in a pointer to a
@@ -124,10 +124,10 @@ int bm_release( int n, int clear_render_targets = 0 );
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number of the first frame and nframes is set.
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
extern int bm_load_animation( const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
//Loads either animation (bm_load_animation) or still image (bm_load)
extern int bm_load_either(char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
extern int bm_load_either(const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
// This locks down a bitmap and returns a pointer to a bitmap
// that can be accessed until you call bm_unlock. Only lock
@@ -154,7 +154,7 @@ extern int bm_is_valid(int handle);
int bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL );
// get filename
extern void bm_get_filename(int bitmapnum, char *filename);
extern void bm_get_filename(int bitmapnum, char *filename);
// call to load all data for all bitmaps that have been requested to be loaded
extern void bm_gfx_load_all();
@@ -173,7 +173,7 @@ void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *
void bm_get_frame_usage(int *ntotal, int *nnew);
// Reload a different image into an existing bmpman slot
int bm_reload(int bitmap_handle, char* filename);
int bm_reload(int bitmap_handle, const char* filename);
/*
* Example on using bm_create
@@ -248,7 +248,7 @@ int bm_page_out( int handle );
// 2 = Debug low memory ( only use first frame of each ani )
void bm_set_low_mem( int mode );
char *bm_get_filename(int handle);
const char *bm_get_filename(int handle);
void BM_SELECT_SCREEN_FORMAT();
void BM_SELECT_TEX_FORMAT();
@@ -284,5 +284,5 @@ int bm_make_render_target( int width, int height, int flags );
int bm_is_render_target(int bitmap_id);
int bm_set_render_target(int handle, int face = -1);
int bm_load_and_parse_eff(char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type);
int bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type);
#endif
+14 -14
View File
@@ -540,8 +540,10 @@ void warp_camera::get_info(vec3d *position, matrix *orientation)
//*************************subtitle*************************
#define MAX_SUBTITLE_LINES 64
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim, float in_display_time, float in_fade_time, color *in_text_color, int in_text_fontnum, bool center_x, bool center_y, int in_width, int in_height, bool in_post_shaded)
subtitle::subtitle(int in_x_pos, int in_y_pos, const char* in_text, const char* in_imageanim, float in_display_time, float in_fade_time, const color *in_text_color, int in_text_fontnum, bool center_x, bool center_y, int in_width, int in_height, bool in_post_shaded)
{
SCP_string text_buf;
// basic init, this always has to be done
memset( imageanim, 0, sizeof(imageanim) );
memset( &text_pos, 0, 2*sizeof(int) );
@@ -551,17 +553,16 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
if ( ((in_text != NULL) && (strlen(in_text) <= 0)) && ((in_imageanim != NULL) && (strlen(in_imageanim) <= 0)) )
return;
char text_buf[256];
if (in_text != NULL && in_text[0] != '\0')
{
strcpy_s(text_buf, in_text);
sexp_replace_variable_names_with_values(text_buf, 256);
in_text = text_buf;
text_buf = in_text;
sexp_replace_variable_names_with_values(text_buf);
in_text = text_buf.c_str();
}
int num_text_lines = 0;
char *text_line_ptrs[MAX_SUBTITLE_LINES];
const char *text_line_ptrs[MAX_SUBTITLE_LINES];
int text_line_lens[MAX_SUBTITLE_LINES];
//Setup text
@@ -569,11 +570,10 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
int split_width = (in_width > 0) ? in_width : 200;
num_text_lines = split_str(in_text, split_width, text_line_lens, text_line_ptrs, MAX_SUBTITLE_LINES);
SCP_string temp_str;
for(int i = 0; i < num_text_lines; i++)
{
temp_str.assign(text_line_ptrs[i], text_line_lens[i]);
text_lines.push_back(temp_str);
text_buf.assign(text_line_ptrs[i], text_line_lens[i]);
text_lines.push_back(text_buf);
}
}
@@ -718,7 +718,7 @@ void subtitle::do_frame(float frametime)
for(SCP_vector<SCP_string>::iterator line = text_lines.begin(); line != text_lines.end(); ++line)
{
gr_string(x, y, (char*)line->c_str(), false);
gr_string(x, y, (char*)line->c_str(), GR_RESIZE_NONE);
y += font_height;
}
@@ -739,18 +739,18 @@ void subtitle::do_frame(float frametime)
vec3d scale;
bm_get_info(image_id, &orig_w, &orig_h);
scale.xyz.x = image_pos.w / (float) orig_w;
scale.xyz.y = image_pos.h / (float) orig_h;
scale.xyz.x = (image_pos.w > 0) ? (image_pos.w / (float) orig_w) : 1.0f;
scale.xyz.y = (image_pos.h > 0) ? (image_pos.h / (float) orig_h) : 1.0f;
scale.xyz.z = 1.0f;
gr_push_scale_matrix(&scale);
gr_bitmap(image_pos.x, image_pos.y, false);
gr_bitmap(fl2i(image_pos.x / scale.xyz.x), fl2i(image_pos.y / scale.xyz.y), GR_RESIZE_NONE);
gr_pop_scale_matrix();
}
// no scaling
else
{
gr_bitmap(image_pos.x, image_pos.y, false);
gr_bitmap(image_pos.x, image_pos.y, GR_RESIZE_NONE);
}
}
+2 -2
View File
@@ -137,8 +137,8 @@ private:
bool post_shaded;
public:
subtitle(int in_x_pos, int in_y_pos, char* in_text = NULL, char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, color *in_text_color = NULL, int in_text_fontnum = -1,
subtitle(int in_x_pos, int in_y_pos, const char* in_text = NULL, const char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, const color *in_text_color = NULL, int in_text_fontnum = -1,
bool center_x = false, bool center_y = false, int in_width = 0, int in_height = 0, bool post_shaded=false);
~subtitle();
+29 -35
View File
@@ -35,7 +35,6 @@
#include "osapi/osapi.h"
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
#ifdef SCP_UNIX
char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
@@ -100,7 +99,7 @@ char Cfile_stack[CFILE_STACK_MAX][CFILE_ROOT_DIRECTORY_LEN];
Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
CFILE Cfile_list[MAX_CFILE_BLOCKS];
char *Cfile_cdrom_dir = NULL;
const char *Cfile_cdrom_dir = NULL;
//
// Function prototypes for internally-called functions
@@ -123,7 +122,7 @@ void cfile_close()
}
// determine if the given path is in a root directory (c:\ or c:\freespace2.exe or c:\fred2.exe etc)
int cfile_in_root_dir(char *exe_path)
int cfile_in_root_dir(const char *exe_path)
{
int token_count = 0;
char path_copy[CFILE_ROOT_DIRECTORY_LEN] = "";
@@ -167,7 +166,7 @@ int cfile_in_root_dir(char *exe_path)
// returns: success ==> 0
// error ==> non-zero
//
int cfile_init(char *exe_dir, char *cdrom_dir)
int cfile_init(const char *exe_dir, const char *cdrom_dir)
{
int i;
@@ -314,17 +313,17 @@ int cfile_push_chdir(int type)
}
int cfile_chdir(char *dir)
int cfile_chdir(const char *dir)
{
int e;
char OriginalDirectory[CFILE_ROOT_DIRECTORY_LEN];
char *Path = NULL;
const char *Path = NULL;
char NoDir[] = "\\.";
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
#ifdef _WIN32
char *colon_pos = strchr(dir, ':');
const char *colon_pos = strchr(dir, ':');
if (colon_pos) {
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
return 1;
@@ -429,7 +428,7 @@ int cfile_flush_dir(int dir_type)
// filename = name of filename or filepath to process
// ext = extension to add. Must start with the period
// Returns: new filename or filepath with extension.
char *cf_add_ext(char *filename, char *ext)
char *cf_add_ext(const char *filename, const char *ext)
{
int flen, elen;
static char path[MAX_PATH_LEN];
@@ -447,7 +446,7 @@ char *cf_add_ext(char *filename, char *ext)
}
// Deletes a file. Returns 0 if an error occurs, 1 on success
int cf_delete(char *filename, int dir_type)
int cf_delete(const char *filename, int dir_type)
{
char longname[MAX_PATH_LEN];
@@ -478,7 +477,7 @@ int cf_delete(char *filename, int dir_type)
// Same as _access function to read a file's access bits
int cf_access(char *filename, int dir_type, int mode)
int cf_access(const char *filename, int dir_type, int mode)
{
char longname[MAX_PATH_LEN];
@@ -492,29 +491,23 @@ int cf_access(char *filename, int dir_type, int mode)
// Returns 1 if the file exists, 0 if not.
// Checks only the file system.
int cf_exists(char *filename, int dir_type)
// cf_find_file_location checks the filesystem before VPs
// If offset is 0, it was found in the filesystem, so offset is boolean false
// If offset equates to boolean true, it was found in a VP and the logic will negate the function return
int cf_exists(const char *filename, int dir_type)
{
char longname[MAX_PATH_LEN];
int offset = 1;
Assert(CF_TYPE_SPECIFIED(dir_type));
if ( (filename == NULL) || !strlen(filename) )
return 0;
cf_create_default_path_string(longname, sizeof(longname) - 1, dir_type, filename);
FILE *fp = fopen(longname, "rb");
if (fp)
{
// Goober5000 - these were switched, causing the fclose to be unreachable
fclose(fp);
return 1;
}
return 0;
return (cf_find_file_location(filename, dir_type, 0, NULL, &offset, NULL) && !offset);
}
// Goober5000
// Returns !0 if the file exists, 0 if not.
// Checks both the file system and the VPs.
int cf_exists_full(char *filename, int dir_type)
int cf_exists_full(const char *filename, int dir_type)
{
if ( (filename == NULL) || !strlen(filename) )
return 0;
@@ -523,7 +516,7 @@ int cf_exists_full(char *filename, int dir_type)
}
// same as the above, but with extension check
int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const char **ext_list)
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list)
{
if ( (filename == NULL) || !strlen(filename) )
return 0;
@@ -535,7 +528,7 @@ int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const ch
}
#ifdef _WIN32
void cf_attrib(char *filename, int set, int clear, int dir_type)
void cf_attrib(const char *filename, int set, int clear, int dir_type)
{
char longname[MAX_PATH_LEN];
@@ -554,7 +547,7 @@ void cf_attrib(char *filename, int set, int clear, int dir_type)
}
#endif
int cf_rename(char *old_name, char *name, int dir_type)
int cf_rename(const char *old_name, const char *name, int dir_type)
{
Assert( CF_TYPE_SPECIFIED(dir_type) );
@@ -634,7 +627,7 @@ extern int game_cd_changed();
// error ==> NULL
//
CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize)
CFILE *cfopen(const char *file_path, const char *mode, int type, int dir_type, bool localize)
{
/* Bobboau, what is this doing here? 31 is way too short... - Goober5000
if( strlen(file_path) > 31 )
@@ -736,6 +729,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
if ( cf_find_file_location( copy_file_path, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize ) ) {
// Fount it, now create a cfile out of it
nprintf(("CFileDebug", "Requested file %s found at: %s\n", file_path, longname));
if ( type & CFILE_MEMORY_MAPPED ) {
@@ -788,7 +782,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
// returns: success ==> address of CFILE structure
// error ==> NULL
//
CFILE *cfopen_special(char *file_path, char *mode, const int size, const int offset, int dir_type)
CFILE *cfopen_special(const char *file_path, const char *mode, const int size, const int offset, int dir_type)
{
if ( !cfile_inited) {
Int3();
@@ -1337,7 +1331,7 @@ int cfwrite_char(char b, CFILE *file)
return cfwrite( &b, sizeof(b), 1, file);
}
int cfwrite_string(char *buf, CFILE *file)
int cfwrite_string(const char *buf, CFILE *file)
{
if ( (!buf) || (buf && !buf[0]) ) {
return cfwrite_char(0, file);
@@ -1475,7 +1469,7 @@ int cfputc(int c, CFILE *cfile)
// returns: success ==> non-negative value
// error ==> EOF
//
int cfputs(char *str, CFILE *cfile)
int cfputs(const char *str, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return EOF;
@@ -1693,7 +1687,7 @@ int cf_chksum_do(CFILE *cfile, ushort *chk_short, uint *chk_long, int max_size)
}
// get the chksum of a pack file (VP)
int cf_chksum_pack(char *filename, uint *chk_long, bool full)
int cf_chksum_pack(const char *filename, uint *chk_long, bool full)
{
const int safe_size = 2097152; // 2 Meg
const int header_offset = 32; // skip 32bytes for header (header is currently smaller than this though)
@@ -1762,7 +1756,7 @@ int cf_chksum_pack(char *filename, uint *chk_long, bool full)
return 1;
}
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_short(char *filename, ushort *chksum, int max_size, int cf_type)
int cf_chksum_short(const char *filename, ushort *chksum, int max_size, int cf_type)
{
int ret_val;
CFILE *cfile = NULL;
@@ -1812,7 +1806,7 @@ int cf_chksum_short(CFILE *file, ushort *chksum, int max_size)
}
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_long(char *filename, uint *chksum, int max_size, int cf_type)
int cf_chksum_long(const char *filename, uint *chksum, int max_size, int cf_type)
{
int ret_val;
CFILE *cfile = NULL;
+25 -25
View File
@@ -99,7 +99,7 @@ typedef struct {
// callback function used for get_file_list() to filter files to be added to list. Return 1
// to add file to list, or 0 to not add it.
extern int (*Get_file_list_filter)(char *filename);
extern int (*Get_file_list_filter)(const char *filename);
// extra check for child directory under CF_TYPE_*
// NOTE: if specified cf_get_file_list() will not search pack files!
@@ -115,7 +115,7 @@ extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
//================= LOW-LEVEL FUNCTIONS ==================
// Call this once at the beginning of the program
int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL);
// Call this if pack files got added or removed or the
// cdrom changed. This will refresh the list of filenames
@@ -123,18 +123,18 @@ int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
void cfile_refresh();
// add an extension to a filename if it doesn't already have it
char *cf_add_ext(char *filename, char *ext);
char *cf_add_ext(const char *filename, const char *ext);
// return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
int cf_get_dir_type(CFILE *cfile);
// Opens the file. If no path is given, use the extension to look into the
// default path. If mode is NULL, delete the file.
CFILE *cfopen(char *filename, char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
CFILE *cfopen(const char *filename, const char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
// like cfopen(), but it accepts a fully qualified path only (ie, the result of a cf_find_file_location() call)
// NOTE: only supports reading files!!
CFILE *cfopen_special(char *file_path, char *mode, const int size, const int offset, int dir_type = CF_TYPE_ANY);
CFILE *cfopen_special(const char *file_path, const char *mode, const int size, const int offset, int dir_type = CF_TYPE_ANY);
// Flush the open file buffer
int cflush(CFILE *cfile);
@@ -149,21 +149,21 @@ void cf_set_version( CFILE * cfile, int version );
void cf_set_max_read_len(CFILE *cfile, size_t len);
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete(char *filename, int dir_type);
int cf_delete(const char *filename, int dir_type);
// Same as _access function to read a file's access bits
int cf_access(char *filename, int dir_type, int mode);
int cf_access(const char *filename, int dir_type, int mode);
// Returns 1 if the file exists, 0 if not.
// Checks only the file system.
int cf_exists(char *filename, int dir_type);
int cf_exists(const char *filename, int dir_type);
// Goober5000
// Returns 1 if the file exists, 0 if not.
// Checks both the file system and the VPs.
int cf_exists_full(char *filename, int dir_type);
int cf_exists_full(const char *filename, int dir_type);
// check num_ext worth of ext_list extensions
int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const char **ext_list);
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list);
// ctmpfile() opens a temporary file stream. File is deleted automatically when closed
CFILE *ctmpfile();
@@ -197,7 +197,7 @@ int cftell(CFILE *fp);
int cfputc(int c, CFILE *cfile);
// cfputs() writes a string to a file
int cfputs(char *str, CFILE *cfile);
int cfputs(const char *str, CFILE *cfile);
// cfgetc() reads a character to a file
int cfgetc(CFILE *cfile);
@@ -212,20 +212,20 @@ int cfeof(CFILE *cfile);
void *cf_returndata(CFILE *cfile);
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_short(char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
int cf_chksum_short(const char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_long(char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
int cf_chksum_long(const char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
int cf_chksum_pack(char *filename, uint *chk_long, bool full = false);
int cf_chksum_pack(const char *filename, uint *chk_long, bool full = false);
// convenient for misc checksumming purposes ------------------------------------------
@@ -238,16 +238,16 @@ uint cf_add_chksum_long(uint seed, ubyte *buffer, int size);
// convenient for misc checksumming purposes ------------------------------------------
//================= HIGH LEVEL FUNCTIONS ==================
int cfexist(char *filename); // Returns true if file exists on disk (1) or in hog (2).
int cfexist(const char *filename); // Returns true if file exists on disk (1) or in hog (2).
// rename a file, utilizing the extension to determine where file is.
#define CF_RENAME_SUCCESS 0 // successfully renamed the file
#define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
int cf_rename(char *old_name, char *name, int type = CF_TYPE_ANY );
int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
// changes the attributes of a file
void cf_attrib(char *name, int set, int clear, int type);
void cf_attrib(const char *name, int set, int clear, int type);
// flush (delete all files in) the passed directory (by type), return the # of files deleted
// NOTE : WILL NOT DELETE READ-ONLY FILES
@@ -294,7 +294,7 @@ int cfwrite_vector(vec3d *vec, CFILE *file);
int cfwrite_angles(angles *ang, CFILE *file);
// writes variable length, null-termined string.
int cfwrite_string(char *buf, CFILE *file);
int cfwrite_string(const char *buf, CFILE *file);
/**
* @brief Write a fixed length string (not including its null terminator), with the length stored in file
@@ -304,9 +304,9 @@ int cfwrite_string(char *buf, CFILE *file);
*/
int cfwrite_string_len(const char *buf, CFILE *file);
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter, int sort = CF_SORT_NONE, SCP_vector<file_list_info> *info = NULL );
int cf_get_file_list( int max, char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, const char *filter, int sort = CF_SORT_NONE, SCP_vector<file_list_info> *info = NULL );
int cf_get_file_list( int max, char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, const char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info = NULL );
@@ -319,7 +319,7 @@ void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns 0.
int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize = false);
int cf_find_file_location( const char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize = false);
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files. Searches all locations in order for first filename using ext filter list.
@@ -333,10 +333,10 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns -1, else returns offset into ext_list.
// (NOTE: This function is exponentially slow, so don't use it unless truely needed!!)
int cf_find_file_location_ext(char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out = 0, char *pack_filename = NULL, int *size = NULL, int *offset = NULL, bool localize = false);
int cf_find_file_location_ext(const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out = 0, char *pack_filename = NULL, int *size = NULL, int *offset = NULL, bool localize = false);
// Functions to change directories
int cfile_chdir(char *dir);
int cfile_chdir(const char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
@@ -387,6 +387,6 @@ namespace cfile
}
};
};
}
#endif /* __CFILE_H__ */
+22 -20
View File
@@ -366,7 +366,7 @@ void cf_build_pack_list( cf_root *root )
}
void cf_build_root_list(char *cdrom_dir)
void cf_build_root_list(const char *cdrom_dir)
{
Num_roots = 0;
Num_path_roots = 0;
@@ -388,7 +388,7 @@ void cf_build_root_list(char *cdrom_dir)
// truncated string check
if ( (strlen(Cfile_user_dir) + strlen(str_temp) + 1) >= CF_MAX_PATHNAME_LENGTH ) {
Int3();
Error(LOCATION, "Home directory plus mod directory exceeds CF_MAX_PATHNAME_LENGTH\n");
}
root = cf_create_root();
@@ -444,7 +444,7 @@ void cf_build_root_list(char *cdrom_dir)
// truncated string check
if ( (strlen(root->path) + strlen(str_temp) + 1) >= CF_MAX_PATHNAME_LENGTH ) {
Int3();
Error(LOCATION, "Installed path plus mod directory exceeds CF_MAX_PATHNAME_LENGTH\n");
}
path_len = strlen(root->path);
@@ -503,11 +503,11 @@ void cf_build_root_list(char *cdrom_dir)
// Given a lower case list of file extensions
// separated by spaces, return zero if ext is
// not in the list.
int is_ext_in_list( char *ext_list, char *ext )
int is_ext_in_list( const char *ext_list, const char *ext )
{
char tmp_ext[128];
strncpy( tmp_ext, ext, 127 );
strcpy_s( tmp_ext, ext);
strlwr(tmp_ext);
if ( strstr(ext_list, tmp_ext )) {
return 1;
@@ -695,6 +695,7 @@ void cf_search_root_pack(int root_index)
find.offset = INTEL_INT( find.offset ); //-V570
find.size = INTEL_INT( find.size ); //-V570
find.write_time = INTEL_INT( find.write_time ); //-V570
find.filename[sizeof(find.filename)-1] = '\0';
if ( find.size == 0 ) {
int search_path_len = strlen(search_path);
@@ -766,7 +767,7 @@ void cf_build_file_list()
}
void cf_build_secondary_filelist(char *cdrom_dir)
void cf_build_secondary_filelist(const char *cdrom_dir)
{
int i;
@@ -833,7 +834,7 @@ void cf_free_secondary_filelist()
*
* @return If not found returns 0.
*/
int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize )
int cf_find_file_location( const char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize )
{
int i;
uint ui;
@@ -1024,7 +1025,7 @@ int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack
}
// -- from parselo.cpp --
extern char *stristr(const char *str, const char *substr);
extern char *stristr(char *str, const char *substr);
/**
* Searches for a file.
@@ -1044,7 +1045,7 @@ extern char *stristr(const char *str, const char *substr);
*
* @return If not found returns -1, else returns offset into ext_list.
*/
int cf_find_file_location_ext( char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize )
int cf_find_file_location_ext( const char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize )
{
int cur_ext, i;
uint ui;
@@ -1318,9 +1319,10 @@ int cf_find_file_location_ext( char *filename, const int ext_num, const char **e
// Returns true if filename matches filespec, else zero if not
int cf_matches_spec(char *filespec, char *filename)
int cf_matches_spec(const char *filespec, const char *filename)
{
char *src_ext, *dst_ext;
const char *src_ext;
const char *dst_ext;
src_ext = strrchr(filespec, '*');
if(!src_ext)
@@ -1353,7 +1355,7 @@ int cf_matches_spec(char *filespec, char *filename)
}
}
int (*Get_file_list_filter)(char *filename) = NULL;
int (*Get_file_list_filter)(const char *filename) = NULL;
const char *Get_file_list_child = NULL;
int Skip_packfile_search = 0;
@@ -1382,7 +1384,7 @@ static bool verify_file_list_child()
return true;
}
static int cf_file_already_in_list( SCP_vector<SCP_string> &list, char *filename )
static int cf_file_already_in_list( SCP_vector<SCP_string> &list, const char *filename )
{
char name_no_extension[MAX_PATH_LEN];
size_t i, size = list.size();
@@ -1410,7 +1412,7 @@ static int cf_file_already_in_list( SCP_vector<SCP_string> &list, char *filename
// 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.
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter, int sort, SCP_vector<file_list_info> *info )
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, const char *filter, int sort, SCP_vector<file_list_info> *info )
{
char *ptr;
uint i;
@@ -1587,7 +1589,7 @@ int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter,
return (int)list.size();
}
int cf_file_already_in_list( int num_files, char **list, char *filename )
int cf_file_already_in_list( int num_files, char **list, const char *filename )
{
int i;
@@ -1611,7 +1613,7 @@ int cf_file_already_in_list( int num_files, char **list, char *filename )
// 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.
int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort, file_list_info *info )
int cf_get_file_list( int max, char **list, int pathtype, const char *filter, int sort, file_list_info *info )
{
char *ptr;
uint i;
@@ -1786,7 +1788,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
return num_files;
}
int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME_LEN], char *filename )
int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME_LEN], const char *filename )
{
int i;
@@ -1810,7 +1812,7 @@ int cf_file_already_in_list_preallocated( int num_files, char arr[][MAX_FILENAME
// 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.
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int pathtype, char *filter, int sort, file_list_info *info )
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int pathtype, const char *filter, int sort, file_list_info *info )
{
int num_files = 0, own_flag = 0;
@@ -1997,7 +1999,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if the result would be too long (invalid result)
int cf_create_default_path_string( char *path, uint path_max, int pathtype, char *filename, bool localize )
int cf_create_default_path_string(char *path, uint path_max, int pathtype, const char *filename, bool localize )
{
#ifdef SCP_UNIX
if ( filename && strpbrk(filename,"/") ) {
@@ -2069,7 +2071,7 @@ int cf_create_default_path_string( char *path, uint path_max, int pathtype, char
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if the result would be too long (invalid result)
int cf_create_default_path_string( SCP_string &path, int pathtype, char *filename, bool localize )
int cf_create_default_path_string( SCP_string &path, int pathtype, const char *filename, bool localize )
{
#ifdef SCP_UNIX
if ( filename && strpbrk(filename,"/") ) {
+3 -3
View File
@@ -15,7 +15,7 @@
#include "cfile/cfile.h"
// Builds a list of all the files
void cf_build_secondary_filelist( char *cdrom_path );
void cf_build_secondary_filelist( const char *cdrom_path );
void cf_free_secondary_filelist();
// Internal stuff
@@ -39,7 +39,7 @@ extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if result would be too long (invalid result)
int cf_create_default_path_string( char *path, uint path_max, int pathtype, char *filename=NULL, bool localize = false);
int cf_create_default_path_string( SCP_string &path, int pathtype, char *filename=NULL, bool localize = false );
int cf_create_default_path_string( char *path, uint path_max, int pathtype, const char *filename=NULL, bool localize = false);
int cf_create_default_path_string( SCP_string &path, int pathtype, const char *filename=NULL, bool localize = false );
#endif //_CFILESYSTEM_H
+383 -230
View File
@@ -29,22 +29,40 @@
#ifdef SCP_UNIX
#include "osapi/osapi.h"
#include <dirent.h>
#endif
#include <string.h>
#include <stdlib.h>
enum cmdline_arg_type
{
AT_NONE =0,
AT_INT,
AT_FLOAT,
AT_STRING
};
// values and order MUST match cmdline_arg_type
const char *cmdline_arg_types[] =
{
"NONE",
"INT",
"FLOAT",
"STRING",
};
// variables
class cmdline_parm {
public:
cmdline_parm *next, *prev;
char *name; // name of parameter, must start with '-' char
char *help; // help text for this parameter
bool stacks; // whether this arg stacks with each use or is replaced by newest use (should only be used for strings!!)
char *args; // string value for parameter arguements (NULL if no arguements)
const char *name; // name of parameter, must start with '-' char
const char *help; // help text for this parameter
const bool stacks; // whether this arg stacks with each use or is replaced by newest use (should only be used for strings!!)
char *args; // string value for parameter arguments (NULL if no arguments)
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(char *name, char *help, bool stacks = false);
cmdline_parm(const char *name, const char *help, const int arg_type, const bool stacks = false);
~cmdline_parm();
int found();
int get_int();
@@ -53,12 +71,11 @@ public:
bool check_if_args_is_valid();
};
static cmdline_parm Parm_list(NULL, NULL);
static cmdline_parm Parm_list(NULL, NULL, AT_NONE);
static int Parm_list_inited = 0;
extern int Show_framerate; // from freespace.cpp
enum
{
// DO NOT CHANGE ANYTHING ABOUT THESE FIRST TWO OR WILL MESS UP THE LAUNCHER
@@ -83,7 +100,7 @@ enum
typedef struct
{
// DO NOT CHANGE THE SIZE OF THIS STRING!
// DO NOT CHANGE THE SIZE OF THIS AT_STRING!
char name[32];
} EasyFlag;
@@ -113,21 +130,24 @@ typedef struct
// Please group them by type, ie graphics, gameplay etc, maximum 20 different types
Flag exe_params[] =
{
{ "-nospec", "Disable specular", true, 0, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-spec", },
{ "-noglow", "Disable glow maps", true, 0, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-glow", },
{ "-noenv", "Disable environment maps", true, 0, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-env", },
{ "-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", },
{ "-missile_lighting", "Apply lighting to missiles" , true, EASY_ALL_ON, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-missile_lighting", },
{ "-nonormal", "Disable normal maps", true, 0, EASY_DEFAULT_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-normal" },
{ "-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" },
{ "-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, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-post_process" },
{ "-soft_particles", "Enable soft particles", true, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-soft_particles" },
{ "-fxaa", "Enable FXAA anti-aliasing", true, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fxaa" },
{ "-nolightshafts", "Disable lightshafts", true, 0, EASY_DEFAULT, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-flightshaftsoff"},
{ "-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_MEM, "Graphics", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-fxaa" },
{ "-nolightshafts", "Disable lightshafts", true, EASY_DEFAULT, EASY_ALL_ON, "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", },
{ "-img2dds", "Compress non-compressed images", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-img2dds", },
{ "-no_vsync", "Disable vertical sync", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_vsync", },
{ "-no_fps_capping", "Don't limit frames-per-second", true, 0, EASY_DEFAULT, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_fps_capping", },
{ "-cache_bitmaps", "Cache bitmaps between missions", true, 0, EASY_DEFAULT_MEM, "Game Speed", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-cache_bitmaps", },
{ "-dualscanlines", "Add another pair of scanning lines", true, 0, EASY_DEFAULT, "HUD", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-dualscanlines", },
@@ -141,6 +161,7 @@ Flag exe_params[] =
{ "-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", },
{ "-snd_preload", "Preload mission game sounds", true, EASY_MEM_ALL_ON, EASY_DEFAULT_MEM, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-snd_preload", },
{ "-nosound", "Disable all sound", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound", },
@@ -163,20 +184,22 @@ Flag exe_params[] =
{ "-noibx", "Don't use cached index buffers (IBX)", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-noibx", },
{ "-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", },
{ "-no_glsl", "Disable GLSL (shader) support", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-no_glsl", },
{ "-ati_swap", "Fix colour issues on some ATI cards", true, 0, EASY_DEFAULT, "Troubleshoot", "http://scp.indiegames.us/mantis/view.php?id=1669", },
{ "-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", },
{ "-disable_glsl_model","Don't use shaders for model rendering", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_glsl_model", },
{ "-mipmap", "Enable mipmapping", true, 0, EASY_DEFAULT_MEM, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-mipmap", },
#ifndef SCP_UNIX
{ "-disable_di_mouse", "Don't use DirectInput for mouse control", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-disable_di_mouse", "Don't use DirectInput for mouse control", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-disable_di_mouse", },
#endif
{ "-use_gldrawelements","Don't use glDrawRangeElements", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-old_collision", "Use old collision detection system", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-use_gldrawelements","Don't use glDrawRangeElements", true, 0, EASY_DEFAULT, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-use_gldrawelements", },
{ "-old_collision", "Use old collision detection system", true, EASY_DEFAULT, EASY_ALL_ON, "Troubleshoot", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-old_collision", },
{ "-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", },
{ "-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", },
{ "-fb_explosions", "Enable Framebuffer Shockwaves", true, 0, EASY_DEFAULT, "Experimental", "", },
{ "-brief_lighting", "Enable lighting on briefing models", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-brief_lighting", },
{ "-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", },
{ "-pos", "Show position of camera", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pos", },
@@ -187,43 +210,50 @@ Flag exe_params[] =
{ "-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", },
{ "-show_mem_usage", "Show memory usage", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-show_mem_usage", },
{ "-pofspew", "", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pofspew", },
{ "-tablecrcs", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-tablecrcs", },
{ "-missioncrcs", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-missioncrcs", },
{ "-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", },
{ "-output_json_data", "Output table objects to [table].json", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-output_json_data", },
{ "-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", },
{ "-debug_window", "Display debug window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-debug_window", },
{ "-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", },
#ifdef SCP_UNIX
{ "-nograb", "Don't grab mouse/keyboard in a window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nograb", },
#endif
{ "-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", },
{ "-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_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", },
{ "-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", },
};
// forward declaration
const char * get_param_desc(const char *flag_name);
// here are the command line parameters that we will be using for FreeSpace
// RETAIL options ----------------------------------------------
cmdline_parm connect_arg("-connect", NULL); // Cmdline_connect_addr
cmdline_parm gamename_arg("-gamename", NULL); // Cmdline_game_name
cmdline_parm gamepassword_arg("-password", NULL); // Cmdline_game_password
cmdline_parm allowabove_arg("-allowabove", NULL); // Cmdline_rank_above
cmdline_parm allowbelow_arg("-allowbelow", NULL); // Cmdline_rank_below
cmdline_parm standalone_arg("-standalone", NULL);
cmdline_parm nosound_arg("-nosound", NULL); // Cmdline_freespace_no_sound
cmdline_parm nomusic_arg("-nomusic", NULL); // Cmdline_freespace_no_music
cmdline_parm startgame_arg("-startgame", NULL); // Cmdline_start_netgame
cmdline_parm gameclosed_arg("-closed", NULL); // Cmdline_closed_game
cmdline_parm gamerestricted_arg("-restricted", NULL); // Cmdline_restricted_game
cmdline_parm port_arg("-port", NULL);
cmdline_parm multilog_arg("-multilog", NULL); // Cmdline_multi_log
cmdline_parm client_dodamage("-clientdamage", NULL); // Cmdline_client_dodamage
cmdline_parm pof_spew("-pofspew", NULL); // Cmdline_spew_pof_info
cmdline_parm mouse_coords("-coords", NULL); // Cmdline_mouse_coords
cmdline_parm timeout("-timeout", NULL); // Cmdline_timeout
cmdline_parm bit32_arg("-32bit", NULL); // (only here for retail compatibility reasons, doesn't actually do anything)
cmdline_parm connect_arg("-connect", "Automatically connect to multiplayer IP:PORT", AT_STRING); // Cmdline_connect_addr
cmdline_parm gamename_arg("-gamename", "Set multiplayer game name", AT_STRING); // Cmdline_game_name
cmdline_parm gamepassword_arg("-password", "Set multiplayer game password", AT_STRING); // Cmdline_game_password
cmdline_parm allowabove_arg("-allowabove", "Ranks above this can join multi", AT_STRING); // Cmdline_rank_above
cmdline_parm allowbelow_arg("-allowbelow", "Ranks below this can join multi", AT_STRING); // Cmdline_rank_below
cmdline_parm standalone_arg("-standalone", NULL, AT_NONE);
cmdline_parm nosound_arg("-nosound", NULL, AT_NONE); // Cmdline_freespace_no_sound
cmdline_parm nomusic_arg("-nomusic", NULL, AT_NONE); // Cmdline_freespace_no_music
cmdline_parm startgame_arg("-startgame", NULL, AT_NONE); // Cmdline_start_netgame
cmdline_parm gameclosed_arg("-closed", NULL, AT_NONE); // Cmdline_closed_game
cmdline_parm gamerestricted_arg("-restricted", NULL, AT_NONE); // Cmdline_restricted_game
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 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)
char *Cmdline_connect_addr = NULL;
char *Cmdline_game_name = NULL;
@@ -250,31 +280,32 @@ int Cmdline_use_last_pilot = 0;
// FSO options -------------------------------------------------
// Graphics related
cmdline_parm spec_exp_arg("-spec_exp", NULL); // comand line FOV -Bobboau
cmdline_parm clip_dist_arg("-clipdist", NULL); // Cmdline_clip_dist
cmdline_parm fov_arg("-fov", NULL); // Cmdline_fov -- comand line FOV -Bobboau
cmdline_parm ogl_spec_arg("-ogl_spec", NULL); // Cmdline_ogl_spec
cmdline_parm spec_static_arg("-spec_static", NULL);
cmdline_parm spec_point_arg("-spec_point", NULL);
cmdline_parm spec_tube_arg("-spec_tube", NULL);
cmdline_parm ambient_factor_arg("-ambient_factor", NULL); // Cmdline_ambient_factor
cmdline_parm env("-noenv", NULL); // Cmdline_env
cmdline_parm missile_lighting_arg("-missile_lighting", NULL); // Cmdline_missile_lighting
cmdline_parm glow_arg("-noglow", NULL); // Cmdline_glow -- use Bobs glow code
cmdline_parm nomotiondebris_arg("-nomotiondebris", NULL); // Cmdline_nomotiondebris -- Removes those ugly floating rocks -C
cmdline_parm noscalevid_arg("-noscalevid", NULL); // Cmdline_noscalevid -- disable video scaling that fits to window
cmdline_parm spec_arg("-nospec", NULL); // Cmdline_spec --
cmdline_parm noemissive_arg("-no_emissive_light", NULL); // Cmdline_no_emissive -- don't use emissive light in OGL
cmdline_parm normal_arg("-nonormal", NULL); // Cmdline_normal -- disable normal mapping
cmdline_parm height_arg("-noheight", NULL); // Cmdline_height -- enable support for parallax mapping
cmdline_parm enable_3d_shockwave_arg("-3dshockwave", NULL);
cmdline_parm softparticles_arg("-soft_particles", NULL);
cmdline_parm postprocess_arg("-post_process", NULL);
cmdline_parm bloom_intensity_arg("-bloom_intensity", NULL);
cmdline_parm fxaa_arg("-fxaa", NULL);
cmdline_parm fxaa_preset_arg("-fxaa_preset", NULL);
cmdline_parm fb_explosions_arg("-fb_explosions", NULL);
cmdline_parm flightshaftsoff_arg("-nolightshafts", NULL);
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);
cmdline_parm ambient_factor_arg("-ambient_factor", "Adjusts ambient light applied to all parts of a ship", AT_INT); // Cmdline_ambient_factor
cmdline_parm missile_lighting_arg("-missile_lighting", NULL, AT_NONE); // Cmdline_missile_lighting
cmdline_parm env("-noenv", NULL, AT_NONE); // Cmdline_env
cmdline_parm glow_arg("-noglow", NULL, AT_NONE); // Cmdline_glow -- use Bobs glow code
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 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 fb_explosions_arg("-fb_explosions", NULL, AT_NONE);
cmdline_parm flightshaftsoff_arg("-nolightshafts", NULL, AT_NONE);
cmdline_parm brieflighting_arg("-brief_lighting", NULL, AT_NONE);
float Cmdline_clip_dist = Default_min_draw_distance;
float Cmdline_fov = 0.75f;
@@ -299,12 +330,13 @@ int Cmdline_fxaa_preset = 6;
extern int Fxaa_preset_last_frame;
bool Cmdline_fb_explosions = 0;
extern bool ls_force_off;
bool Cmdline_brief_lighting = 0;
// Game Speed related
cmdline_parm cache_bitmaps_arg("-cache_bitmaps", NULL); // Cmdline_cache_bitmaps
cmdline_parm img2dds_arg("-img2dds", NULL); // Cmdline_img2dds
cmdline_parm no_fpscap("-no_fps_capping", NULL); // Cmdline_NoFPSCap
cmdline_parm no_vsync_arg("-no_vsync", NULL); // Cmdline_no_vsync
cmdline_parm cache_bitmaps_arg("-cache_bitmaps", NULL, AT_NONE); // Cmdline_cache_bitmaps
cmdline_parm img2dds_arg("-img2dds", NULL, AT_NONE); // Cmdline_img2dds
cmdline_parm no_fpscap("-no_fps_capping", "Don't limit frames-per-second", AT_NONE); // Cmdline_NoFPSCap
cmdline_parm no_vsync_arg("-no_vsync", NULL, AT_NONE); // Cmdline_no_vsync
int Cmdline_cache_bitmaps = 0; // caching of bitmaps between missions (faster loads, can hit swap on reload with <512 Meg RAM though) - taylor
int Cmdline_img2dds = 0;
@@ -312,11 +344,11 @@ int Cmdline_NoFPSCap = 0; // Disable FPS capping - kazan
int Cmdline_no_vsync = 0;
// HUD related
cmdline_parm ballistic_gauge("-ballistic_gauge", NULL); // Cmdline_ballistic_gauge
cmdline_parm dualscanlines_arg("-dualscanlines", NULL); // Cmdline_dualscanlines -- Change to phreaks options including new targeting code
cmdline_parm orb_radar("-orbradar", NULL); // Cmdline_orb_radar
cmdline_parm rearm_timer_arg("-rearm_timer", NULL); // Cmdline_rearm_timer
cmdline_parm targetinfo_arg("-targetinfo", NULL); // Cmdline_targetinfo -- Adds ship name/class to right of target box -C
cmdline_parm ballistic_gauge("-ballistic_gauge", NULL, AT_NONE); // Cmdline_ballistic_gauge
cmdline_parm dualscanlines_arg("-dualscanlines", NULL, AT_NONE); // Cmdline_dualscanlines -- Change to phreaks options including new targeting code
cmdline_parm orb_radar("-orbradar", NULL, AT_NONE); // Cmdline_orb_radar
cmdline_parm rearm_timer_arg("-rearm_timer", NULL, AT_NONE); // Cmdline_rearm_timer
cmdline_parm targetinfo_arg("-targetinfo", NULL, AT_NONE); // Cmdline_targetinfo -- Adds ship name/class to right of target box -C
int Cmdline_ballistic_gauge = 0; // WMCoolmon's gauge thingy
int Cmdline_dualscanlines = 0;
@@ -325,39 +357,41 @@ int Cmdline_rearm_timer = 0;
int Cmdline_targetinfo = 0;
// Gameplay related
cmdline_parm use_3dwarp("-3dwarp", NULL); // Cmdline_3dwarp
cmdline_parm ship_choice_3d_arg("-ship_choice_3d", NULL); // Cmdline_ship_choice_3d
cmdline_parm weapon_choice_3d_arg("-weapon_choice_3d", NULL); // Cmdline_weapon_choice_3d
cmdline_parm use_warp_flash("-warp_flash", NULL); // Cmdline_warp_flash
cmdline_parm allow_autpilot_interrupt("-no_ap_interrupt", NULL); // Cmdline_warp_flash
cmdline_parm use_3dwarp("-3dwarp", NULL, AT_NONE); // Cmdline_3dwarp
cmdline_parm ship_choice_3d_arg("-ship_choice_3d", NULL, AT_NONE); // Cmdline_ship_choice_3d
cmdline_parm weapon_choice_3d_arg("-weapon_choice_3d", NULL, AT_NONE); // Cmdline_weapon_choice_3d
cmdline_parm use_warp_flash("-warp_flash", NULL, AT_NONE); // Cmdline_warp_flash
cmdline_parm allow_autpilot_interrupt("-no_ap_interrupt", NULL, AT_NONE);
cmdline_parm stretch_menu("-stretch_menu", NULL, AT_NONE); // Cmdline_stretch_menu
int Cmdline_3dwarp = 0;
int Cmdline_ship_choice_3d = 0;
int Cmdline_weapon_choice_3d = 0;
int Cmdline_warp_flash = 0;
int Cmdline_autopilot_interruptable = 1;
int Cmdline_stretch_menu = 0;
// Audio related
cmdline_parm query_speech_arg("-query_speech", NULL); // Cmdline_query_speech
cmdline_parm snd_preload_arg("-snd_preload", NULL); // Cmdline_snd_preload
cmdline_parm voice_recognition_arg("-voicer", NULL); // Cmdline_voice_recognition
cmdline_parm query_speech_arg("-query_speech", NULL, AT_NONE); // Cmdline_query_speech
cmdline_parm snd_preload_arg("-snd_preload", NULL, AT_NONE); // Cmdline_snd_preload
cmdline_parm voice_recognition_arg("-voicer", NULL, AT_NONE); // Cmdline_voice_recognition
int Cmdline_query_speech = 0;
int Cmdline_snd_preload = 0; // preload game sounds during mission load
int Cmdline_voice_recognition = 0;
// MOD related
cmdline_parm mod_arg("-mod", NULL, true); // Cmdline_mod -- DTP modsupport
cmdline_parm mod_arg("-mod", "List of folders to overwrite/add-to the default data", AT_STRING, true); // Cmdline_mod -- DTP modsupport
char *Cmdline_mod = NULL; //DTP for mod arguement
char *Cmdline_mod = NULL; //DTP for mod argument
// Multiplayer/Network related
cmdline_parm almission_arg("-almission", NULL); // Cmdline_almission -- DTP for autoload Multi mission
cmdline_parm ingamejoin_arg("-ingame_join", NULL); // Cmdline_ingamejoin
cmdline_parm mpnoreturn_arg("-mpnoreturn", NULL); // Cmdline_mpnoreturn -- Removes 'Return to Flight Deck' in respawn dialog -C
cmdline_parm missioncrcspew_arg("-missioncrcs", NULL); // Cmdline_spew_mission_crcs
cmdline_parm tablecrcspew_arg("-tablecrcs", NULL); // Cmdline_spew_table_crcs
cmdline_parm objupd_arg("-cap_object_update", NULL);
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);
char *Cmdline_almission = NULL; //DTP for autoload multi mission.
int Cmdline_ingamejoin = 0;
@@ -367,21 +401,24 @@ char *Cmdline_spew_table_crcs = NULL;
int Cmdline_objupd = 3; // client object updates on LAN by default
// Troubleshooting
cmdline_parm loadallweapons_arg("-loadallweps", NULL); // Cmdline_load_all_weapons
cmdline_parm htl_arg("-nohtl", NULL); // Cmdline_nohtl -- don't use HT&L
cmdline_parm noibx_arg("-noibx", NULL); // Cmdline_noibx
cmdline_parm nomovies_arg("-nomovies", NULL); // Cmdline_nomovies -- Allows video streaming
cmdline_parm no_set_gamma_arg("-no_set_gamma", NULL); // Cmdline_no_set_gamma
cmdline_parm no_vbo_arg("-novbo", NULL); // Cmdline_novbo
cmdline_parm no_fbo_arg("-disable_fbo", NULL); // Cmdline_no_fbo
cmdline_parm noglsl_arg("-no_glsl", NULL); // Cmdline_noglsl -- disable GLSL support in OpenGL
cmdline_parm mipmap_arg("-mipmap", NULL); // Cmdline_mipmap
cmdline_parm atiswap_arg("-ati_swap", NULL); // Cmdline_atiswap - Fix ATI color swap issue for screenshots.
cmdline_parm no3dsound_arg("-no_3d_sound", NULL); // Cmdline_no_3d_sound - Disable use of full 3D sounds
cmdline_parm no_glsl_models_arg("-disable_glsl_model", NULL); // Cmdline_no_glsl_model_rendering -- switches model rendering to fixed pipeline
cmdline_parm no_di_mouse_arg("-disable_di_mouse", NULL); // Cmdline_no_di_mouse -- Disables directinput use for mouse control
cmdline_parm no_drawrangeelements("-use_gldrawelements", NULL); // Cmdline_drawelements -- Uses glDrawElements instead of glDrawRangeElements
cmdline_parm keyboard_layout("-keyboard_layout", NULL);
cmdline_parm loadallweapons_arg("-loadallweps", NULL, AT_NONE); // Cmdline_load_all_weapons
cmdline_parm htl_arg("-nohtl", NULL, AT_NONE); // Cmdline_nohtl -- don't use HT&L
cmdline_parm noibx_arg("-noibx", NULL, AT_NONE); // Cmdline_noibx
cmdline_parm nomovies_arg("-nomovies", NULL, AT_NONE); // Cmdline_nomovies -- Allows video streaming
cmdline_parm no_set_gamma_arg("-no_set_gamma", NULL, AT_NONE); // Cmdline_no_set_gamma
cmdline_parm no_vbo_arg("-novbo", NULL, AT_NONE); // Cmdline_novbo
cmdline_parm no_fbo_arg("-disable_fbo", NULL, AT_NONE); // Cmdline_no_fbo
cmdline_parm no_pbo_arg("-disable_pbo", NULL, AT_NONE); // Cmdline_no_pbo
cmdline_parm noglsl_arg("-no_glsl", NULL, AT_NONE); // Cmdline_noglsl -- disable GLSL support in OpenGL
cmdline_parm mipmap_arg("-mipmap", NULL, AT_NONE); // Cmdline_mipmap
cmdline_parm atiswap_arg("-ati_swap", NULL, AT_NONE); // Cmdline_atiswap - Fix ATI color swap issue for screenshots.
cmdline_parm no3dsound_arg("-no_3d_sound", NULL, AT_NONE); // Cmdline_no_3d_sound - Disable use of full 3D sounds
cmdline_parm no_glsl_models_arg("-disable_glsl_model", NULL, AT_NONE); // Cmdline_no_glsl_model_rendering -- switches model rendering to fixed pipeline
cmdline_parm no_di_mouse_arg("-disable_di_mouse", "Disable DirectInput mouse code (Windows only)", AT_NONE); // Cmdline_no_di_mouse -- Disables directinput use for mouse control
cmdline_parm no_drawrangeelements("-use_gldrawelements", NULL, AT_NONE); // Cmdline_drawelements -- Uses glDrawElements instead of glDrawRangeElements
cmdline_parm keyboard_layout("-keyboard_layout", "Specify keyboard layout (qwertz or azerty)", AT_STRING);
cmdline_parm old_collision_system("-old_collision", NULL, AT_NONE); // Cmdline_old_collision_sys
cmdline_parm gl_finish ("-gl_finish", NULL, AT_NONE);
int Cmdline_load_all_weapons = 0;
int Cmdline_nohtl = 0;
@@ -390,6 +427,7 @@ int Cmdline_nomovies = 0;
int Cmdline_no_set_gamma = 0;
int Cmdline_novbo = 0; // turn off OGL VBO support, troubleshooting
int Cmdline_no_fbo = 0;
int Cmdline_no_pbo = 0;
int Cmdline_noglsl = 0;
int Cmdline_ati_color_swap = 0;
int Cmdline_no_3d_sound = 0;
@@ -397,32 +435,35 @@ int Cmdline_no_glsl_model_rendering = 0;
int Cmdline_no_di_mouse = 0;
int Cmdline_drawelements = 0;
char* Cmdline_keyboard_layout = NULL;
bool Cmdline_gl_finish = false;
// Developer/Testing related
cmdline_parm start_mission_arg("-start_mission", NULL); // Cmdline_start_mission
cmdline_parm old_collision_system("-old_collision", NULL); // Cmdline_new_collision
cmdline_parm dis_collisions("-dis_collisions", NULL); // Cmdline_dis_collisions
cmdline_parm dis_weapons("-dis_weapons", NULL); // Cmdline_dis_weapons
cmdline_parm noparseerrors_arg("-noparseerrors", NULL); // Cmdline_noparseerrors -- turns off parsing errors -C
cmdline_parm start_mission_arg("-start_mission", "Skip mainhall and run this mission", AT_STRING); // Cmdline_start_mission
cmdline_parm dis_collisions("-dis_collisions", NULL, AT_NONE); // Cmdline_dis_collisions
cmdline_parm dis_weapons("-dis_weapons", NULL, AT_NONE); // Cmdline_dis_weapons
cmdline_parm noparseerrors_arg("-noparseerrors", NULL, AT_NONE); // Cmdline_noparseerrors -- turns off parsing errors -C
#ifdef Allow_NoWarn
cmdline_parm nowarn_arg("-no_warn", NULL); // Cmdline_nowarn
cmdline_parm nowarn_arg("-no_warn", "Disable warnings (not recommended)", AT_NONE); // Cmdline_nowarn
#endif
cmdline_parm extra_warn_arg("-extra_warn", NULL); // Cmdline_extra_warn
cmdline_parm fps_arg("-fps", NULL); // Cmdline_show_fps
cmdline_parm show_mem_usage_arg("-show_mem_usage", NULL); // Cmdline_show_mem_usage
cmdline_parm pos_arg("-pos", NULL); // Cmdline_show_pos
cmdline_parm stats_arg("-stats", NULL); // Cmdline_show_stats
cmdline_parm save_render_targets_arg("-save_render_target", NULL); // Cmdline_save_render_targets
cmdline_parm debug_window_arg("-debug_window", NULL); // Cmdline_debug_window
cmdline_parm window_arg("-window", NULL); // Cmdline_window
cmdline_parm fullscreen_window_arg("-fullscreen_window",NULL);
cmdline_parm res_arg("-res", NULL); // Cmdline_lores
cmdline_parm verify_vps_arg("-verify_vps", NULL); // Cmdline_verify_vps -- spew VP crcs to vp_crcs.txt
cmdline_parm parse_cmdline_only(PARSE_COMMAND_LINE_STRING, NULL);
cmdline_parm extra_warn_arg("-extra_warn", "Enable 'extra' warnings", AT_NONE); // Cmdline_extra_warn
cmdline_parm fps_arg("-fps", NULL, AT_NONE); // Cmdline_show_fps
cmdline_parm show_mem_usage_arg("-show_mem_usage", NULL, AT_NONE); // Cmdline_show_mem_usage
cmdline_parm pos_arg("-pos", NULL, AT_NONE); // Cmdline_show_pos
cmdline_parm stats_arg("-stats", NULL, AT_NONE); // Cmdline_show_stats
cmdline_parm save_render_targets_arg("-save_render_target", NULL, AT_NONE); // Cmdline_save_render_targets
cmdline_parm debug_window_arg("-debug_window", NULL, AT_NONE); // Cmdline_debug_window
cmdline_parm window_arg("-window", NULL, AT_NONE); // Cmdline_window
cmdline_parm fullscreen_window_arg("-fullscreen_window", "Fullscreen/borderless window (Windows only)", AT_NONE);
cmdline_parm res_arg("-res", "Resolution, formatted like 1600x900", AT_STRING);
cmdline_parm verify_vps_arg("-verify_vps", NULL, AT_NONE); // Cmdline_verify_vps -- spew VP crcs to vp_crcs.txt
cmdline_parm parse_cmdline_only(PARSE_COMMAND_LINE_STRING, "Ignore any cmdline_fso.cfg files", AT_NONE);
#ifdef SCP_UNIX
cmdline_parm no_grab("-nograb", NULL); // Cmdline_no_grab
cmdline_parm no_grab("-nograb", NULL, AT_NONE); // Cmdline_no_grab
#endif
cmdline_parm reparse_mainhall_arg("-reparse_mainhall", NULL); //Cmdline_reparse_mainhall
cmdline_parm reparse_mainhall_arg("-reparse_mainhall", NULL, AT_NONE); //Cmdline_reparse_mainhall
cmdline_parm frame_profile_arg("-profile_frame_time", NULL, AT_NONE); //Cmdline_frame_profile
cmdline_parm frame_profile_write_file("-profile_write_file", NULL, AT_NONE); // Cmdline_profile_write_file
cmdline_parm no_unfocused_pause_arg("-no_unfocused_pause", NULL, AT_NONE); //Cmdline_no_unfocus_pause
char *Cmdline_start_mission = NULL;
int Cmdline_old_collision_sys = 0;
@@ -446,19 +487,25 @@ int Cmdline_verify_vps = 0;
int Cmdline_no_grab = 0;
#endif
int Cmdline_reparse_mainhall = 0;
bool Cmdline_frame_profile = false;
bool Cmdline_profile_write_file = false;
bool Cmdline_no_unfocus_pause = false;
// Other
cmdline_parm get_flags_arg("-get_flags", NULL);
cmdline_parm output_sexp_arg("-output_sexps", NULL); //WMC - outputs all SEXPs to sexps.html
cmdline_parm output_scripting_arg("-output_scripting", NULL); //WMC
cmdline_parm get_flags_arg("-get_flags", "Output the launcher flags file", AT_NONE);
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_json_data_arg("-output_json_data", "Output table objects to [table].json", AT_NONE); //chief1983, Cmdline_output_json_data
bool Cmdline_output_json_data = false;
// Deprecated flags - CommanderDJ
cmdline_parm deprecated_spec_arg("-spec", NULL);
cmdline_parm deprecated_glow_arg("-glow", NULL);
cmdline_parm deprecated_normal_arg("-normal", NULL);
cmdline_parm deprecated_env_arg("-env", NULL);
cmdline_parm deprecated_tbp_arg("-tbp", NULL);
cmdline_parm deprecated_jpgtga_arg("-jpgtga", NULL);
cmdline_parm deprecated_spec_arg("-spec", "Deprecated", AT_NONE);
cmdline_parm deprecated_glow_arg("-glow", "Deprecated", AT_NONE);
cmdline_parm deprecated_normal_arg("-normal", "Deprecated", AT_NONE);
cmdline_parm deprecated_env_arg("-env", "Deprecated", AT_NONE);
cmdline_parm deprecated_tbp_arg("-tbp", "Deprecated", AT_NONE);
cmdline_parm deprecated_jpgtga_arg("-jpgtga", "Deprecated", AT_NONE);
int Cmdline_deprecated_spec = 0;
int Cmdline_deprecated_glow = 0;
@@ -622,7 +669,7 @@ void parm_stuff_args(cmdline_parm *parm, char *cmdline)
}
// internal function - parse the command line, extracting parameter arguements if they exist
// internal function - parse the command line, extracting parameter arguments if they exist
// cmdline - command line string passed to the application
void os_parse_parms(char *cmdline)
{
@@ -692,7 +739,7 @@ void os_validate_parms(char *cmdline)
#ifdef _WIN32
// Changed this to MessageBox, this is a user error not a developer
char buffer[128];
sprintf(buffer,"Unrecogzined command line parameter %s, continue?",token);
sprintf(buffer,"Unrecognized command line parameter %s, continue?",token);
if( MessageBox(NULL, buffer, "Warning", MB_OKCANCEL | MB_ICONQUESTION) == IDCANCEL)
exit(0);
#elif defined(APPLE_APP)
@@ -728,11 +775,19 @@ void os_validate_parms(char *cmdline)
// not the prettiest thing but the job gets done
static const int STR_SIZE = 25; // max len of exe_params.name + 5 spaces
int p=0, sp=0;
while (exe_params[p].name[0] == '-') {
sp = strlen(exe_params[p].name);
printf(" [ %s ]%*s- %s\n", exe_params[p].name, (STR_SIZE - sp - 1), NOX(" "), exe_params[p].desc);
p++;
const int AT_SIZE = 8; // max len of cmdline_arg_types[] + 2 spaces
int sp=0, atp=0;
for (parmp = GET_FIRST(&Parm_list); parmp !=END_OF_LIST(&Parm_list); parmp = GET_NEXT(parmp) ) {
// don't output deprecated flags
if (stricmp("deprecated", parmp->help)) {
sp = strlen(parmp->name);
if (parmp->arg_type != AT_NONE) {
atp = strlen(cmdline_arg_types[parmp->arg_type]);
printf(" [ %s ]%*s[ %s ]%*s- %s\n", parmp->name, (STR_SIZE - sp -1), NOX(" "), cmdline_arg_types[parmp->arg_type], AT_SIZE-atp, NOX(" "), parmp->help);
} else {
printf(" [ %s ]%*s- %s\n", parmp->name, (STR_SIZE - sp -1 +AT_SIZE+4), NOX(" "), parmp->help);
}
}
}
printf("\n");
@@ -755,113 +810,119 @@ void os_validate_parms(char *cmdline)
void os_init_cmdline(char *cmdline)
{
FILE *fp;
bool parse_config = true;
if (strstr(cmdline, PARSE_COMMAND_LINE_STRING) != NULL) {
parse_config = false;
}
if (strstr(cmdline, PARSE_COMMAND_LINE_STRING) == NULL) {
// read the cmdline.cfg file from the data folder, and pass the command line arguments to
// the the parse_parms and validate_parms line. Read these first so anything actually on
// the command line will take precedence
// read the cmdline_fso.cfg file from the data folder, and pass the command line arguments to
// the the parse_parms and validate_parms line. Read these first so anything actually on
// the command line will take precedence
#ifdef _WIN32
fp = fopen("data\\cmdline_fso.cfg", "rt");
fp = fopen("data\\cmdline_fso.cfg", "rt");
#elif defined(APPLE_APP)
char resolved_path[MAX_PATH], data_path[MAX_PATH_LEN];
char resolved_path[MAX_PATH], data_path[MAX_PATH_LEN];
GetCurrentDirectory(MAX_PATH_LEN-1, data_path);
snprintf(resolved_path, MAX_PATH, "%s/data/cmdline_fso.cfg", data_path);
GetCurrentDirectory(MAX_PATH_LEN-1, data_path);
snprintf(resolved_path, MAX_PATH, "%s/data/cmdline_fso.cfg", data_path);
fp = fopen(resolved_path, "rt");
fp = fopen(resolved_path, "rt");
#else
fp = fopen("data/cmdline_fso.cfg", "rt");
fp = fopen("data/cmdline_fso.cfg", "rt");
#endif
// if the file exists, get a single line, and deal with it
if ( fp && parse_config ) {
char *buf, *p;
// if the file exists, get a single line, and deal with it
if ( fp ) {
char *buf, *p;
size_t len = filelength( fileno(fp) ) + 2;
buf = new char [len];
size_t len = filelength( fileno(fp) ) + 2;
buf = new char [len];
fgets(buf, len-1, fp);
fgets(buf, len-1, fp);
// replace the newline character with a NULL
if ( (p = strrchr(buf, '\n')) != NULL ) {
*p = '\0';
// replace the newline character with a NULL
if ( (p = strrchr(buf, '\n')) != NULL ) {
*p = '\0';
}
#ifdef SCP_UNIX
// append a space for the os_parse_parms() check
strcat_s(buf, len, " ");
#endif
os_parse_parms(buf);
os_validate_parms(buf);
delete [] buf;
fclose(fp);
}
#ifdef SCP_UNIX
// append a space for the os_parse_parms() check
strcat_s(buf, len, " ");
#endif
// parse user specific cmdline_fso config file (will supersede options in global file)
char cmdname[MAX_PATH];
os_parse_parms(buf);
os_validate_parms(buf);
delete [] buf;
fclose(fp);
}
#ifdef SCP_UNIX
// parse user specific cmdline config file (will supersede options in global file)
char cmdname[MAX_PATH];
snprintf(cmdname, MAX_PATH, "%s/%s/data/cmdline_fso.cfg", detect_home(), Osreg_user_dir);
fp = fopen(cmdname, "rt");
if ( !fp ) {
// try for non "_fso", for older code versions
snprintf(cmdname, MAX_PATH, "%s/%s/data/cmdline.cfg", detect_home(), Osreg_user_dir);
snprintf(cmdname, MAX_PATH, "%s/%s/data/cmdline_fso.cfg", detect_home(), Osreg_user_dir);
fp = fopen(cmdname, "rt");
}
// if the file exists, get a single line, and deal with it
if ( fp ) {
char *buf, *p;
size_t len = filelength( fileno(fp) ) + 2;
buf = new char [len];
fgets(buf, len-1, fp);
// replace the newline character with a NULL
if ( (p = strrchr(buf, '\n')) != NULL ) {
*p = '\0';
if ( !fp ) {
// try for non "_fso", for older code versions
snprintf(cmdname, MAX_PATH, "%s/%s/data/cmdline.cfg", detect_home(), Osreg_user_dir);
fp = fopen(cmdname, "rt");
}
// append a space for the os_parse_parms() check
strcat_s(buf, len, " ");
// if the file exists, get a single line, and deal with it
if ( fp ) {
char *buf, *p;
os_parse_parms(buf);
os_validate_parms(buf);
delete [] buf;
fclose(fp);
}
size_t len = filelength( fileno(fp) ) + 2;
buf = new char [len];
fgets(buf, len-1, fp);
// replace the newline character with a NULL
if ( (p = strrchr(buf, '\n')) != NULL ) {
*p = '\0';
}
// append a space for the os_parse_parms() check
strcat_s(buf, len, " ");
os_parse_parms(buf);
os_validate_parms(buf);
delete [] buf;
fclose(fp);
}
#endif
} // If cmdline included PARSE_COMMAND_LINE_STRING
// By parsing cmdline last, anything actually on the command line will take precedence.
os_parse_parms(cmdline);
os_validate_parms(cmdline);
}
// arg constructor
// name_ - name of the parameter, must start with '-' character
// help_ - help text for this parameter
cmdline_parm::cmdline_parm(char *name_, char *help_, bool stacks_)
/*
* arg constructor
*
* @param name_ name of the parameter, must start with '-' character
* @param help_ help text for this parameter
* @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_):
name(name_), help(help_), stacks(stacks_), arg_type(arg_type_)
{
name = name_;
help = help_;
stacks = stacks_;
args = NULL;
name_found = 0;
if (Parm_list_inited == 0) {
list_init(&Parm_list);
Assertion(&Parm_list == this, "Coding error! 1st initialised cmdline_parm must be static Parm_list\n");
list_init(this);
Parm_list_inited = 1;
}
if (name != NULL) {
} else {
Assertion(name, "Coding error! cmdline_parm's must have a non-NULL name\n");
Assertion(name[0] == '-', "Coding error! cmdline_parm's must start with a '-'\n");
// not in the static Parm_list init, so lookup the NULL help args
if (help == NULL) {
help = get_param_desc(name);
}
list_append(&Parm_list, this);
}
}
@@ -900,9 +961,10 @@ int cmdline_parm::found()
return name_found;
}
// returns - the interger representation for the parameter arguement
// returns - the interger representation for the parameter argument
int cmdline_parm::get_int()
{
Assertion(arg_type == AT_INT, "Coding error! Cmdline arg (%s) called cmdline_parm::get_int() with invalid arg_type (%s)", name, cmdline_arg_types[arg_type]);
check_if_args_is_valid();
int offset = 0;
@@ -911,7 +973,7 @@ int cmdline_parm::get_int()
// first off, DON'T STACK NON-STRINGS!!
Int3();
// secondly, we still need to get it right for the users sake...
// secondly, we still need to get it right for the user's sake...
char *moron = strstr(args, ",");
if ( moron && ((strlen(moron) + 1) < strlen(args)) ) {
@@ -924,9 +986,10 @@ int cmdline_parm::get_int()
}
// returns - the float representation for the parameter arguement
// returns - the float representation for the parameter argument
float cmdline_parm::get_float()
{
Assertion(arg_type == AT_FLOAT, "Coding error! Cmdline arg (%s) called cmdline_parm::get_float() with invalid arg_type (%s)", name, cmdline_arg_types[arg_type]);
check_if_args_is_valid();
int offset = 0;
@@ -935,7 +998,7 @@ float cmdline_parm::get_float()
// first off, DON'T STACK NON-STRINGS!!
Int3();
// secondly, we still need to get it right for the users sake
// secondly, we still need to get it right for the user's sake
char *moron = strstr(args, ",");
if ( moron && ((strlen(moron) + 1) < strlen(args)) ) {
@@ -948,9 +1011,10 @@ float cmdline_parm::get_float()
}
// returns - the string value for the parameter arguement
// returns - the string value for the parameter argument
char *cmdline_parm::str()
{
Assertion(arg_type == AT_STRING, "Coding error! Cmdline arg (%s) called cmdline_parm::str() with invalid arg_type (%s)", name, cmdline_arg_types[arg_type]);
check_if_args_is_valid();
return args;
@@ -1218,12 +1282,6 @@ bool SetCmdlineParams()
if(mod_arg.found() ) {
Cmdline_mod = mod_arg.str();
// be sure that this string fits in our limits
/* This has to be disabled because the max size is going to be mods*MAX_FILENAME_LEN
if ( strlen(Cmdline_mod) > MAX_FILENAME_LEN ) {
Cmdline_mod[MAX_FILENAME_LEN-1] = '\0';
}*/
// strip off blank space it it's there
if ( Cmdline_mod[strlen(Cmdline_mod)-1] == ' ' ) {
Cmdline_mod[strlen(Cmdline_mod)-1] = '\0';
@@ -1235,7 +1293,49 @@ bool SetCmdlineParams()
memset( modlist, 0, len + 2 );
strcpy_s(modlist, len+2, Cmdline_mod);
//modlist[len]= '\0'; // double null termination at the end
#ifdef SCP_UNIX
// for case sensitive filesystems (e.g. Linux/BSD) perform case-insensitive dir matches
DIR *dp;
dirent *dirp;
char *cur_pos, *temp;
char cur_dir[CF_MAX_PATHNAME_LENGTH], delim[] = ",";
SCP_vector<SCP_string> temp_modlist;
size_t total_len = 0;
if ( !_getcwd(cur_dir, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
for (cur_pos = strtok(modlist, delim); cur_pos != NULL; cur_pos = strtok(NULL, delim))
{
if ((dp = opendir(cur_dir)) == NULL) {
Error(LOCATION, "Can't open directory '%s' -- %d", cur_dir, errno );
}
while ((dirp = readdir(dp)) != NULL) {
if (!stricmp(dirp->d_name, cur_pos)) {
temp_modlist.push_back(dirp->d_name);
total_len += (strlen(dirp->d_name) + 1);
}
}
(void)closedir(dp);
}
// create new char[] to replace modlist
char *new_modlist = new char[total_len+1];
memset( new_modlist, 0, total_len + 1 );
SCP_vector<SCP_string>::iterator ii, end = temp_modlist.end();
for (ii = temp_modlist.begin(); ii != end; ++ii) {
strcat_s(new_modlist, total_len+1, ii->c_str());
strcat_s(new_modlist, total_len+1, ","); // replace later with NUL
}
// make the rest of the function unaware that anything happened here
temp = modlist;
modlist = new_modlist;
delete [] temp;
len = total_len;
#endif
// null terminate each individual
for (int i = 0; i < len; i++)
@@ -1300,6 +1400,10 @@ bool SetCmdlineParams()
if ( allow_autpilot_interrupt.found() ) {
Cmdline_autopilot_interruptable = 0;
}
if ( stretch_menu.found() ) {
Cmdline_stretch_menu = 1;
}
// specular comand lines
if ( spec_exp_arg.found() ) {
specular_exponent_value = spec_exp_arg.get_float();
@@ -1409,11 +1513,21 @@ bool SetCmdlineParams()
output_sexps("sexps.html");
}
if ( output_json_data_arg.found() )
{
Cmdline_output_json_data = true;
}
if ( no_vbo_arg.found() )
{
Cmdline_novbo = 1;
}
if ( no_pbo_arg.found() )
{
Cmdline_no_pbo = 1;
}
if ( no_drawrangeelements.found() )
{
Cmdline_drawelements = 1;
@@ -1424,6 +1538,11 @@ bool SetCmdlineParams()
Cmdline_keyboard_layout = keyboard_layout.str();
}
if (gl_finish.found())
{
Cmdline_gl_finish = true;
}
if ( snd_preload_arg.found() )
{
Cmdline_snd_preload = 1;
@@ -1506,6 +1625,11 @@ bool SetCmdlineParams()
Cmdline_fb_explosions = 1;
}
if ( brieflighting_arg.found() )
{
Cmdline_brief_lighting = 1;
}
if ( postprocess_arg.found() )
{
Cmdline_postprocess = 1;
@@ -1526,6 +1650,22 @@ bool SetCmdlineParams()
Cmdline_reparse_mainhall = 1;
}
if (frame_profile_arg.found() )
{
Cmdline_frame_profile = true;
}
if (frame_profile_write_file.found())
{
Cmdline_frame_profile = true;
Cmdline_profile_write_file = true;
}
if (no_unfocused_pause_arg.found())
{
Cmdline_no_unfocus_pause = true;
}
//Deprecated flags - CommanderDJ
if( deprecated_spec_arg.found() )
{
@@ -1603,3 +1743,16 @@ int parse_cmdline(char *cmdline)
// I did this because of fred2_parse_cmdline()
return SetCmdlineParams();
}
const char * get_param_desc(const char *flag_name)
{
int i;
int flag_size = sizeof(Flag);
int num_flags = sizeof(exe_params) / flag_size;
for (i = 0; i < num_flags; ++i) {
if (!strcmp(flag_name, exe_params[i].name)) {
return exe_params[i].desc;
}
}
return "UNKNOWN - FIXME!";
}
+7
View File
@@ -96,6 +96,7 @@ extern int Cmdline_ship_choice_3d;
extern int Cmdline_weapon_choice_3d;
extern int Cmdline_warp_flash;
extern int Cmdline_autopilot_interruptable;
extern int Cmdline_stretch_menu;
// Audio related
extern int Cmdline_query_speech;
@@ -120,6 +121,7 @@ extern int Cmdline_nomovies; // WMC Toggles movie playing support
extern int Cmdline_no_set_gamma;
extern int Cmdline_novbo;
extern int Cmdline_no_fbo;
extern int Cmdline_no_pbo;
extern int Cmdline_noglsl;
extern int Cmdline_mipmap;
extern int Cmdline_ati_color_swap;
@@ -128,6 +130,7 @@ extern int Cmdline_no_glsl_model_rendering;
extern int Cmdline_no_di_mouse;
extern int Cmdline_drawelements;
extern char* Cmdline_keyboard_layout;
extern bool Cmdline_gl_finish;
// Developer/Testing related
extern char *Cmdline_start_mission;
@@ -149,5 +152,9 @@ extern int Cmdline_verify_vps;
extern int Cmdline_no_grab;
#endif
extern int Cmdline_reparse_mainhall;
extern bool Cmdline_frame_profile;
extern bool Cmdline_profile_write_file;
extern bool Cmdline_no_unfocus_pause;
extern bool Cmdline_output_json_data;
#endif
+1 -1
View File
@@ -15,7 +15,7 @@
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
struct object;
class object;
#define CMEASURE_WAIT 333 // delay in milliseconds between countermeasure firing.
+154 -75
View File
@@ -28,6 +28,8 @@
#include "globalincs/alphacolors.h"
#include "network/multi_pmsg.h"
#include "network/multiutil.h"
#include "parse/scripting.h"
#include "debugconsole/console.h"
#ifndef NDEBUG
@@ -124,7 +126,7 @@ int Conflict_bright = 0;
static int Num_cc_lines;
static struct {
char *label;
const char *label;
int cc_index; // index into Control_config of item
int y; // Y coordinate of line
int kx, kw, jx, jw; // x start and width of keyboard and joystick bound text
@@ -135,6 +137,7 @@ struct config_item_undo {
int size;
int *index; // array (size) of Control_config indices of replaced elements
config_item *list; // array (size) of original elements
int reset_to_preset; // if >=0, then we ignore the above list and simply reset to the given preset instead
config_item_undo *next;
};
@@ -174,6 +177,9 @@ static int Background_bitmap;
static int Conflicts_tabs[NUM_TABS];
static UI_BUTTON List_buttons[LIST_BUTTONS_MAX]; // buttons for each line of text in list
static UI_WINDOW Ui_window;
static unsigned int Defaults_cycle_pos; // the controls preset that was last selected
int Control_config_overlay_id;
static struct {
int key; // index of other control in conflict with this one
@@ -345,7 +351,7 @@ int Config_allowed[] = {
#ifndef NDEBUG
int Show_controls_info = 0;
DCF_BOOL(show_controls_info, Show_controls_info)
DCF_BOOL(show_controls_info, Show_controls_info);
#endif
static int Axes_origin[JOY_NUM_AXES];
@@ -534,6 +540,8 @@ config_item_undo *get_undo_block(int size)
ptr->list = NULL;
}
ptr->reset_to_preset = -1;
return ptr;
}
@@ -566,41 +574,45 @@ int control_config_undo_last()
return -1;
}
if (Config_item_undo->index[0] & JOY_AXIS) {
tab = SHIP_TAB;
if (Config_item_undo->reset_to_preset > -1) {
control_config_reset_defaults(Config_item_undo->reset_to_preset);
} else {
tab = Control_config[Config_item_undo->index[0]].tab;
}
for (i=1; i<Config_item_undo->size; i++) {
if (Config_item_undo->index[i] & JOY_AXIS) {
if (tab != SHIP_TAB) {
tab = -1;
}
if (Config_item_undo->index[0] & JOY_AXIS) {
tab = SHIP_TAB;
} else {
if (Control_config[Config_item_undo->index[i]].tab != tab) {
tab = -1;
tab = Control_config[Config_item_undo->index[0]].tab;
}
for (i=1; i<Config_item_undo->size; i++) {
if (Config_item_undo->index[i] & JOY_AXIS) {
if (tab != SHIP_TAB) {
tab = -1;
}
} else {
if (Control_config[Config_item_undo->index[i]].tab != tab) {
tab = -1;
}
}
}
}
if (tab >= 0) {
Tab = tab;
}
if (tab >= 0) {
Tab = tab;
}
for (i=0; i<Config_item_undo->size; i++) {
z = Config_item_undo->index[i];
if (z & JOY_AXIS) {
config_item *ptr;
for (i=0; i<Config_item_undo->size; i++) {
z = Config_item_undo->index[i];
if (z & JOY_AXIS) {
config_item *ptr;
z &= ~JOY_AXIS;
ptr = &Config_item_undo->list[i];
Axis_map_to[z] = ptr->joy_id;
Invert_axis[z] = ptr->used;
z &= ~JOY_AXIS;
ptr = &Config_item_undo->list[i];
Axis_map_to[z] = ptr->joy_id;
Invert_axis[z] = ptr->used;
} else {
Control_config[z] = Config_item_undo->list[i];
} else {
Control_config[z] = Config_item_undo->list[i];
}
}
}
@@ -860,10 +872,25 @@ int control_config_do_reset()
int i, j, total = 0;
config_item_undo *ptr;
config_item item;
config_item *preset;
bool cycling_presets = false;
// If there are presets, then we'll cycle to the next preset and reset to that
if (Control_config_presets.size() >= 1) {
cycling_presets = true;
if (++Defaults_cycle_pos >= Control_config_presets.size())
Defaults_cycle_pos = 0;
preset = Control_config_presets[Defaults_cycle_pos];
} else {
// If there are no presets, then we'll always reset to the hardcoded defaults
preset = Control_config;
}
// first, determine how many bindings need to be changed
for (i=0; i<CCFG_MAX; i++) {
if ((Control_config[i].key_id != Control_config[i].key_default) || (Control_config[i].joy_id != Control_config[i].joy_default)) {
if ((Control_config[i].key_id != preset[i].key_default) || (Control_config[i].joy_id != preset[i].joy_default)) {
total++;
}
}
@@ -874,7 +901,7 @@ int control_config_do_reset()
}
}
if (!total) {
if (!total && !cycling_presets) {
gamesnd_play_iface(SND_GENERAL_FAIL);
return -1;
}
@@ -882,7 +909,7 @@ int control_config_do_reset()
// now, back up the old bindings so we can undo if we want to
ptr = get_undo_block(total);
for (i=j=0; i<CCFG_MAX; i++) {
if ((Control_config[i].key_id != Control_config[i].key_default) || (Control_config[i].joy_id != Control_config[i].joy_default)) {
if ((Control_config[i].key_id != preset[i].key_default) || (Control_config[i].joy_id != preset[i].joy_default)) {
ptr->index[j] = i;
ptr->list[j] = Control_config[i];
j++;
@@ -901,23 +928,43 @@ int control_config_do_reset()
j++;
}
}
Assert(j == total);
control_config_reset_defaults();
if (cycling_presets)
control_config_reset_defaults(Defaults_cycle_pos);
else
control_config_reset_defaults();
control_config_conflict_check();
control_config_list_prepare();
gamesnd_play_iface(SND_RESET_PRESSED);
return 0;
}
// This sets all the controls to their default values
void control_config_reset_defaults()
// This sets all the controls to the default values in the given preset
// If no preset is given, the hardcoded defaults of Control_config are used
void control_config_reset_defaults(int presetnum)
{
int i;
config_item *preset;
if (presetnum >= 0)
preset = Control_config_presets[presetnum];
else
preset = Control_config;
// Reset keyboard defaults
for (i=0; i<CCFG_MAX; i++) {
Control_config[i].key_id = Control_config[i].key_default;
Control_config[i].joy_id = Control_config[i].joy_default;
// Note that key_default and joy_default are NOT overwritten here;
// they should retain the values of the first preset because
// for example the key-pressed SEXP works off the defaults of the first preset
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].type = preset[i].type;
Control_config[i].disabled = preset[i].disabled;
}
for (i=0; i<NUM_JOY_AXIS_ACTIONS; i++) {
@@ -1216,7 +1263,7 @@ void control_config_button_pressed(int n)
}
}
char *control_config_tooltip_handler(char *str)
const char *control_config_tooltip_handler(const char *str)
{
int i;
@@ -1241,14 +1288,16 @@ void control_config_init()
Control_config_backup[i] = Control_config[i];
}
Defaults_cycle_pos = 0;
common_set_interface_palette(NOX("ControlConfigPalette")); // set the interface palette
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
Ui_window.set_mask_bmap(Conflict_background_bitmap_mask_fname[gr_screen.res]);
Ui_window.tooltip_handler = control_config_tooltip_handler;
// load in help overlay bitmap
help_overlay_load(CONTROL_CONFIG_OVERLAY);
help_overlay_set_state(CONTROL_CONFIG_OVERLAY,0);
Control_config_overlay_id = help_overlay_get_index(CONTROL_CONFIG_OVERLAY);
help_overlay_set_state(Control_config_overlay_id,gr_screen.res,0);
// reset conflict flashing
Conflict_stamp = -1;
@@ -1338,9 +1387,6 @@ void control_config_close()
while (Config_item_undo){
free_undo_block();
}
// unload the overlay bitmap
help_overlay_unload(CONTROL_CONFIG_OVERLAY);
if (Background_bitmap){
bm_release(Background_bitmap);
@@ -1392,7 +1438,8 @@ void control_config_close()
void control_config_do_frame(float frametime)
{
char buf[256], *str, *jptr;
const char *str;
char buf[256], *jptr;
int i, j, k, w, x, y, z, len, line, conflict;
int font_height = gr_get_font_height();
int select_tease_line = -1; // line mouse is down on, but won't be selected until button released
@@ -1451,7 +1498,7 @@ void control_config_do_frame(float frametime)
}
} else {
if (help_overlay_active(CONTROL_CONFIG_OVERLAY)) {
if (help_overlay_active(Control_config_overlay_id)) {
CC_Buttons[gr_screen.res][HELP_BUTTON].button.reset_status();
Ui_window.set_ignore_gadgets(1);
}
@@ -1461,14 +1508,14 @@ void control_config_do_frame(float frametime)
Ui_window.process(0);
if ( (k > 0) || B1_JUST_RELEASED ) {
if (help_overlay_active(CONTROL_CONFIG_OVERLAY)) {
help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
if (help_overlay_active(Control_config_overlay_id)) {
help_overlay_set_state(Control_config_overlay_id, gr_screen.res, 0);
Ui_window.set_ignore_gadgets(0);
k = 0;
}
}
if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( !help_overlay_active(Control_config_overlay_id) ) {
Ui_window.set_ignore_gadgets(0);
}
@@ -1495,7 +1542,7 @@ void control_config_do_frame(float frametime)
}
if ((k > 0) && !Config_allowed[k & KEY_MASK]) {
popup(0, 1, POPUP_OK, XSTR( "That is a non-bindable key. Please try again.", 207));
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR( "That is a non-bindable key. Please try again.", 207));
k = 0;
}
@@ -1562,7 +1609,7 @@ void control_config_do_frame(float frametime)
}
} else if (Search_mode) {
if (help_overlay_active(CONTROL_CONFIG_OVERLAY)) {
if (help_overlay_active(Control_config_overlay_id)) {
CC_Buttons[gr_screen.res][HELP_BUTTON].button.reset_status();
Ui_window.set_ignore_gadgets(1);
}
@@ -1572,14 +1619,14 @@ void control_config_do_frame(float frametime)
Ui_window.process(0);
if ( (k > 0) || B1_JUST_RELEASED ) {
if ( help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
if ( help_overlay_active(Control_config_overlay_id) ) {
help_overlay_set_state(Control_config_overlay_id, gr_screen.res, 0);
Ui_window.set_ignore_gadgets(0);
k = 0;
}
}
if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( !help_overlay_active(Control_config_overlay_id) ) {
Ui_window.set_ignore_gadgets(0);
}
@@ -1673,7 +1720,7 @@ void control_config_do_frame(float frametime)
CC_Buttons[gr_screen.res][UNDO_BUTTON].button.enable(Config_item_undo != NULL);
if ( help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( help_overlay_active(Control_config_overlay_id) ) {
CC_Buttons[gr_screen.res][HELP_BUTTON].button.reset_status();
Ui_window.set_ignore_gadgets(1);
}
@@ -1681,14 +1728,14 @@ void control_config_do_frame(float frametime)
k = Ui_window.process();
if ( (k > 0) || B1_JUST_RELEASED ) {
if ( help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
help_overlay_set_state(CONTROL_CONFIG_OVERLAY, 0);
if ( help_overlay_active(Control_config_overlay_id) ) {
help_overlay_set_state(Control_config_overlay_id, gr_screen.res, 0);
Ui_window.set_ignore_gadgets(0);
k = 0;
}
}
if ( !help_overlay_active(CONTROL_CONFIG_OVERLAY) ) {
if ( !help_overlay_active(Control_config_overlay_id) ) {
Ui_window.set_ignore_gadgets(0);
}
@@ -1794,7 +1841,7 @@ void control_config_do_frame(float frametime)
GR_MAYBE_CLEAR_RES(Background_bitmap);
if (Background_bitmap >= 0) {
gr_set_bitmap(Background_bitmap);
gr_bitmap(0, 0);
gr_bitmap(0, 0, GR_RESIZE_MENU);
}
// highlight tab with conflict
@@ -1828,7 +1875,7 @@ void control_config_do_frame(float frametime)
int sw, sh;
gr_get_string_size(&sw, &sh, conflict_str);
gr_string((gr_screen.max_w / 2) - (sw / 2), Conflict_warning_coords[gr_screen.res][1], conflict_str);
gr_string((gr_screen.max_w / 2) - (sw / 2), Conflict_warning_coords[gr_screen.res][1], conflict_str, GR_RESIZE_MENU);
gr_set_font(FONT1);
} else {
@@ -1884,7 +1931,7 @@ void control_config_do_frame(float frametime)
if (t % 2) {
gr_set_color_fast(&Color_text_normal);
gr_get_string_size(&w, NULL, XSTR( "?", 208));
gr_printf(x - w / 2, y - font_height / 2, XSTR( "?", 208));
gr_printf_menu(x - w / 2, y - font_height / 2, XSTR( "?", 208));
}
} else if (!(z & JOY_AXIS) && ((Conflicts[z].key >= 0) || (Conflicts[z].joy >= 0))) {
@@ -1896,7 +1943,7 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(&Color_text_normal);
str = XSTR( "Control conflicts with:", 209);
gr_get_string_size(&w, NULL, str);
gr_printf(x - w / 2, y - font_height, str);
gr_printf_menu(x - w / 2, y - font_height, str);
if (Control_config[i].hasXSTR) {
strcpy_s(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
@@ -1906,12 +1953,12 @@ void control_config_do_frame(float frametime)
gr_force_fit_string(buf, 255, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
gr_get_string_size(&w, NULL, buf);
gr_printf(x - w / 2, y, buf);
gr_printf_menu(x - w / 2, y, buf);
} else if (*bound_string) {
gr_set_color_fast(&Color_text_normal);
gr_get_string_size(&w, NULL, bound_string);
gr_printf(x - w / 2, y - font_height / 2, bound_string);
gr_printf_menu(x - w / 2, y - font_height / 2, bound_string);
if (timestamp_elapsed(bound_timestamp)) {
*bound_string = 0;
}
@@ -1919,7 +1966,7 @@ void control_config_do_frame(float frametime)
if (Cc_lines[Num_cc_lines - 1].y + font_height > Cc_lines[Scroll_offset].y + Control_list_coords[gr_screen.res][CONTROL_H_COORD]) {
gr_set_color_fast(&Color_white);
gr_printf(Control_more_coords[gr_screen.res][CONTROL_X_COORD], Control_more_coords[gr_screen.res][CONTROL_Y_COORD], XSTR( "More...", 210));
gr_printf_menu(Control_more_coords[gr_screen.res][CONTROL_X_COORD], Control_more_coords[gr_screen.res][CONTROL_Y_COORD], XSTR( "More...", 210));
}
conflict = 0;
@@ -1945,7 +1992,7 @@ void control_config_do_frame(float frametime)
if (Cc_lines[line].label) {
strcpy_s(buf, Cc_lines[line].label);
gr_force_fit_string(buf, 255, Control_list_ctrl_w[gr_screen.res]);
gr_printf(Control_list_coords[gr_screen.res][CONTROL_X_COORD], y, buf);
gr_printf_menu(Control_list_coords[gr_screen.res][CONTROL_X_COORD], y, buf);
}
if (!(z & JOY_AXIS)) {
@@ -1957,7 +2004,7 @@ void control_config_do_frame(float frametime)
if ((k < 0) && (j < 0)) {
gr_set_color_fast(&Color_grey);
gr_printf(x, y, XSTR( "None", 211));
gr_printf_menu(x, y, XSTR( "None", 211));
} else {
if (k >= 0) {
@@ -1977,7 +2024,7 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(c);
}
gr_printf(x, y, buf);
gr_printf_menu(x, y, buf);
len = strlen(buf);
Cc_lines[line].kx = x - Control_list_coords[gr_screen.res][CONTROL_X_COORD];
@@ -1987,7 +2034,7 @@ void control_config_do_frame(float frametime)
if (j >= 0) {
gr_set_color_fast(&Color_text_normal);
gr_printf(x, y, XSTR( ", ", 212));
gr_printf_menu(x, y, XSTR( ", ", 212));
gr_get_string_size(&w, NULL, XSTR( ", ", 212));
x += w;
}
@@ -2011,7 +2058,7 @@ void control_config_do_frame(float frametime)
}
gr_force_fit_string(buf, 255, Control_list_key_w[gr_screen.res] + Control_list_key_x[gr_screen.res] - x);
gr_printf(x, y, buf);
gr_printf_menu(x, y, buf);
Cc_lines[line].jx = x - Control_list_coords[gr_screen.res][CONTROL_X_COORD];
gr_get_string_size(&Cc_lines[line].jw, NULL, buf);
@@ -2027,7 +2074,7 @@ void control_config_do_frame(float frametime)
if (j < 0) {
gr_set_color_fast(&Color_grey);
gr_printf(x, y, XSTR( "None", 211));
gr_printf_menu(x, y, XSTR( "None", 211));
} else {
if (Conflicts_axes[z & ~JOY_AXIS] >= 0) {
@@ -2046,7 +2093,7 @@ void control_config_do_frame(float frametime)
gr_set_color_fast(c);
}
gr_string(x, y, Joy_axis_text[j]);
gr_string(x, y, Joy_axis_text[j], GR_RESIZE_MENU);
}
}
@@ -2061,7 +2108,7 @@ void control_config_do_frame(float frametime)
}
// blit help overlay if active
help_overlay_maybe_blit(CONTROL_CONFIG_OVERLAY);
help_overlay_maybe_blit(Control_config_overlay_id, gr_screen.res);
gr_flip();
}
@@ -2086,6 +2133,8 @@ float check_control_timef(int id)
// first, see if control actually used (makes sure modifiers match as well)
if (!check_control(id)) {
Control_config[id].continuous_ongoing = false;
return 0.0f;
}
@@ -2100,6 +2149,11 @@ float check_control_timef(int id)
}
if (t1 + t2) {
// We want to set this to true only after visiting control_used() (above)
// to allow it to tell the difference between an ongoing continuous action
// started before and a continuous action being started right now.
Control_config[id].continuous_ongoing = true;
return t1 + t2;
}
@@ -2111,7 +2165,7 @@ void control_check_indicate()
#ifndef NDEBUG
if (Show_controls_info) {
gr_set_color_fast(&HUD_color_debug);
gr_printf(490, 15, NOX("Ctrls checked: %d"), Control_check_count);
gr_printf_no_resize(gr_screen.max_w - 154, 5, NOX("Ctrls checked: %d"), Control_check_count);
}
#endif
@@ -2205,6 +2259,17 @@ int check_control(int id, int key)
return 1;
}
if (Control_config[id].continuous_ongoing) {
// If we reach this point, then it means this is a continuous control
// which has just been released
Script_system.SetHookVar("Action", 's', Control_config[id].text);
Script_system.RunCondition(CHA_ONACTIONSTOPPED, '\0', NULL, NULL, id);
Script_system.RemHookVar("Action");
Control_config[id].continuous_ongoing = false;
}
return 0;
}
@@ -2260,6 +2325,7 @@ void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
return;
}
int Last_frame_timestamp;
void control_used(int id)
{
// if we have set this key to be ignored, ignore it
@@ -2267,7 +2333,20 @@ void control_used(int id)
return;
}
Control_config[id].used = timestamp();
// This check needs to be done because the control code might call this function more than once per frame,
// and we don't want to run the hooks more than once per frame
if (Control_config[id].used < Last_frame_timestamp) {
if (!Control_config[id].continuous_ongoing) {
Script_system.SetHookVar("Action", 's', Control_config[id].text);
Script_system.RunCondition(CHA_ONACTION, '\0', NULL, NULL, id);
Script_system.RemHookVar("Action");
if (Control_config[id].type == CC_TYPE_CONTINUOUS)
Control_config[id].continuous_ongoing = true;
}
Control_config[id].used = timestamp();
}
}
void control_config_clear_used_status()
+130 -124
View File
@@ -5,9 +5,11 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
*/
#include "globalincs/pstypes.h"
#ifndef CONTROLS_CONFIG_H
#define CONTROLS_CONFIG_H
@@ -67,6 +69,7 @@ typedef struct config_item {
short joy_id; //!< joystick button bound to action
int used; //!< has control been used yet in mission? If so, this is the timestamp
bool disabled; //!< whether this action should be available at all
bool continuous_ongoing;//!< whether this action is a continuous one and is currently ongoing
} config_item;
/*!
@@ -74,203 +77,203 @@ typedef struct config_item {
* This is the value of the id field in config_item
* The first group of items are ship targeting.
*/
enum IoActionId {
TARGET_NEXT =0, //!< target next
TARGET_PREV =1, //!< target previous
TARGET_NEXT_CLOSEST_HOSTILE =2, //!< target the next hostile target
TARGET_PREV_CLOSEST_HOSTILE =3, //!< target the previous closest hostile
TOGGLE_AUTO_TARGETING =4, //!< toggle auto-targeting
TARGET_NEXT_CLOSEST_FRIENDLY =5, //!< target the next friendly ship
TARGET_PREV_CLOSEST_FRIENDLY =6, //!< target the closest friendly ship
TARGET_SHIP_IN_RETICLE =7, //!< target ship closest to center of reticle
TARGET_CLOSEST_SHIP_ATTACKING_TARGET =8, //!< target the closest ship attacking current target
TARGET_LAST_TRANMISSION_SENDER =9, //!< TARGET_LAST_TRANMISSION_SENDER
STOP_TARGETING_SHIP =10, //!< stop targeting ship
enum IoActionId {
TARGET_NEXT =0, //!< target next
TARGET_PREV =1, //!< target previous
TARGET_NEXT_CLOSEST_HOSTILE =2, //!< target the next hostile target
TARGET_PREV_CLOSEST_HOSTILE =3, //!< target the previous closest hostile
TOGGLE_AUTO_TARGETING =4, //!< toggle auto-targeting
TARGET_NEXT_CLOSEST_FRIENDLY =5, //!< target the next friendly ship
TARGET_PREV_CLOSEST_FRIENDLY =6, //!< target the closest friendly ship
TARGET_SHIP_IN_RETICLE =7, //!< target ship closest to center of reticle
TARGET_CLOSEST_SHIP_ATTACKING_TARGET =8, //!< target the closest ship attacking current target
TARGET_LAST_TRANMISSION_SENDER =9, //!< TARGET_LAST_TRANMISSION_SENDER
STOP_TARGETING_SHIP =10, //!< stop targeting ship
//!< @n
//!< Targeting a Ship's Subsystem
//!< ------------------------------
TARGET_SUBOBJECT_IN_RETICLE =11, //!< target ships subsystem in reticle
TARGET_NEXT_SUBOBJECT =12, //!< target next subsystem on current target
TARGET_PREV_SUBOBJECT =13, //!< TARGET_PREV_SUBOBJECT
STOP_TARGETING_SUBSYSTEM =14, //!< stop targeting subsystems on ship
TARGET_SUBOBJECT_IN_RETICLE =11, //!< target ships subsystem in reticle
TARGET_NEXT_SUBOBJECT =12, //!< target next subsystem on current target
TARGET_PREV_SUBOBJECT =13, //!< TARGET_PREV_SUBOBJECT
STOP_TARGETING_SUBSYSTEM =14, //!< stop targeting subsystems on ship
//!< @n
//!< Speed Matching
//!< ----------------
MATCH_TARGET_SPEED =15, //!< match target speed
TOGGLE_AUTO_MATCH_TARGET_SPEED =16, //!< toggle auto-match target speed
MATCH_TARGET_SPEED =15, //!< match target speed
TOGGLE_AUTO_MATCH_TARGET_SPEED =16, //!< toggle auto-match target speed
//!< @n
//!< Weapons
//!< ---------
FIRE_PRIMARY =17, //!< FIRE_PRIMARY
FIRE_SECONDARY =18, //!< FIRE_SECONDARY
CYCLE_NEXT_PRIMARY =19, //!< cycle to next primary weapon
CYCLE_PREV_PRIMARY =20, //!< cycle to previous primary weapon
CYCLE_SECONDARY =21, //!< cycle to next secondary weapon
CYCLE_NUM_MISSLES =22, //!< cycle number of missiles fired from secondary bank
LAUNCH_COUNTERMEASURE =23, //!< LAUNCH_COUNTERMEASURE
FIRE_PRIMARY =17, //!< FIRE_PRIMARY
FIRE_SECONDARY =18, //!< FIRE_SECONDARY
CYCLE_NEXT_PRIMARY =19, //!< cycle to next primary weapon
CYCLE_PREV_PRIMARY =20, //!< cycle to previous primary weapon
CYCLE_SECONDARY =21, //!< cycle to next secondary weapon
CYCLE_NUM_MISSLES =22, //!< cycle number of missiles fired from secondary bank
LAUNCH_COUNTERMEASURE =23, //!< LAUNCH_COUNTERMEASURE
//!< @n
//!< Controls
//!< ----------
FORWARD_THRUST =24, //!< FORWARD_THRUST
REVERSE_THRUST =25, //!< REVERSE_THRUST
BANK_LEFT =26, //!< BANK_LEFT
BANK_RIGHT =27, //!< BANK_RIGHT
PITCH_FORWARD =28, //!< PITCH_FORWARD
PITCH_BACK =29, //!< PITCH_BACK
YAW_LEFT =30, //!< YAW_LEFT
YAW_RIGHT =31, //!< YAW_RIGHT
FORWARD_THRUST =24, //!< FORWARD_THRUST
REVERSE_THRUST =25, //!< REVERSE_THRUST
BANK_LEFT =26, //!< BANK_LEFT
BANK_RIGHT =27, //!< BANK_RIGHT
PITCH_FORWARD =28, //!< PITCH_FORWARD
PITCH_BACK =29, //!< PITCH_BACK
YAW_LEFT =30, //!< YAW_LEFT
YAW_RIGHT =31, //!< YAW_RIGHT
//!< @n
//!< Throttle Control
//!< ------------------
ZERO_THROTTLE =32, //!< ZERO_THROTTLE
MAX_THROTTLE =33, //!< MAX_THROTTLE
ONE_THIRD_THROTTLE =34, //!< ONE_THIRD_THROTTLE
TWO_THIRDS_THROTTLE =35, //!< TWO_THIRDS_THROTTLE
PLUS_5_PERCENT_THROTTLE =36, //!< PLUS_5_PERCENT_THROTTLE
MINUS_5_PERCENT_THROTTLE =37, //!< MINUS_5_PERCENT_THROTTLE
ZERO_THROTTLE =32, //!< ZERO_THROTTLE
MAX_THROTTLE =33, //!< MAX_THROTTLE
ONE_THIRD_THROTTLE =34, //!< ONE_THIRD_THROTTLE
TWO_THIRDS_THROTTLE =35, //!< TWO_THIRDS_THROTTLE
PLUS_5_PERCENT_THROTTLE =36, //!< PLUS_5_PERCENT_THROTTLE
MINUS_5_PERCENT_THROTTLE =37, //!< MINUS_5_PERCENT_THROTTLE
//!< @n
//!< Squadmate Messaging Keys
//!< --------------------------
ATTACK_MESSAGE =38, //!< wingman message: attack current target
DISARM_MESSAGE =39, //!< wingman message: disarm current target
DISABLE_MESSAGE =40, //!< wingman message: disable current target
ATTACK_SUBSYSTEM_MESSAGE =41, //!< wingman message: disable current target
CAPTURE_MESSAGE =42, //!< wingman message: capture current target
ENGAGE_MESSAGE =43, //!< wingman message: engage enemy
FORM_MESSAGE =44, //!< wingman message: form on my wing
IGNORE_MESSAGE =45, //!< IGNORE_MESSAGE
PROTECT_MESSAGE =46, //!< wingman message: protect current target
COVER_MESSAGE =47, //!< wingman message: cover me
WARP_MESSAGE =48, //!< wingman message: warp out
REARM_MESSAGE =49, //!< REARM_MESSAGE
TARGET_CLOSEST_SHIP_ATTACKING_SELF =50, //!< target closest ship that is attacking player
ATTACK_MESSAGE =38, //!< wingman message: attack current target
DISARM_MESSAGE =39, //!< wingman message: disarm current target
DISABLE_MESSAGE =40, //!< wingman message: disable current target
ATTACK_SUBSYSTEM_MESSAGE =41, //!< wingman message: disable current target
CAPTURE_MESSAGE =42, //!< wingman message: capture current target
ENGAGE_MESSAGE =43, //!< wingman message: engage enemy
FORM_MESSAGE =44, //!< wingman message: form on my wing
IGNORE_MESSAGE =45, //!< IGNORE_MESSAGE
PROTECT_MESSAGE =46, //!< wingman message: protect current target
COVER_MESSAGE =47, //!< wingman message: cover me
WARP_MESSAGE =48, //!< wingman message: warp out
REARM_MESSAGE =49, //!< REARM_MESSAGE
TARGET_CLOSEST_SHIP_ATTACKING_SELF =50, //!< target closest ship that is attacking player
//!< @n
//!< Views
//!< -------
VIEW_CHASE =51, //!< VIEW_CHASE
VIEW_EXTERNAL =52, //!< VIEW_EXTERNAL
VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK =53, //!< VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK
VIEW_SLEW =54, //!< VIEW_SLEW
VIEW_OTHER_SHIP =55, //!< VIEW_OTHER_SHIP
VIEW_DIST_INCREASE =56, //!< VIEW_DIST_INCREASE
VIEW_DIST_DECREASE =57, //!< VIEW_DIST_DECREASE
VIEW_CENTER =58, //!< VIEW_CENTER
PADLOCK_UP =59, //!< PADLOCK_UP
PADLOCK_DOWN =60, //!< PADLOCK_DOWN
PADLOCK_LEFT =61, //!< PADLOCK_LEFT
PADLOCK_RIGHT =62, //!< PADLOCK_RIGHT
VIEW_CHASE =51, //!< VIEW_CHASE
VIEW_EXTERNAL =52, //!< VIEW_EXTERNAL
VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK =53, //!< VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK
VIEW_SLEW =54, //!< VIEW_SLEW
VIEW_OTHER_SHIP =55, //!< VIEW_OTHER_SHIP
VIEW_DIST_INCREASE =56, //!< VIEW_DIST_INCREASE
VIEW_DIST_DECREASE =57, //!< VIEW_DIST_DECREASE
VIEW_CENTER =58, //!< VIEW_CENTER
PADLOCK_UP =59, //!< PADLOCK_UP
PADLOCK_DOWN =60, //!< PADLOCK_DOWN
PADLOCK_LEFT =61, //!< PADLOCK_LEFT
PADLOCK_RIGHT =62, //!< PADLOCK_RIGHT
//!< @n
//!< Misc Controls 1
//!< -----------------
RADAR_RANGE_CYCLE =63, //!< cycle to next radar range
SQUADMSG_MENU =64, //!< toggle the squadmate messaging menu
SHOW_GOALS =65, //!< show the mission goals screen
END_MISSION =66, //!< end the mission
TARGET_TARGETS_TARGET =67, //!< target your target's target
AFTERBURNER =68, //!< AFTERBURNER
RADAR_RANGE_CYCLE =63, //!< cycle to next radar range
SQUADMSG_MENU =64, //!< toggle the squadmate messaging menu
SHOW_GOALS =65, //!< show the mission goals screen
END_MISSION =66, //!< end the mission
TARGET_TARGETS_TARGET =67, //!< target your target's target
AFTERBURNER =68, //!< AFTERBURNER
//!< @n
//!< ETS
//!< -----
INCREASE_WEAPON =69, //!< increase weapon recharge rate
DECREASE_WEAPON =70, //!< decrease weapon recharge rate
INCREASE_SHIELD =71, //!< increase shield recharge rate
DECREASE_SHIELD =72, //!< decrease shield recharge rate
INCREASE_ENGINE =73, //!< increase energy to engines
DECREASE_ENGINE =74, //!< decrease energy to engines
ETS_EQUALIZE =75, //!< equalize recharge rates
SHIELD_EQUALIZE =76, //!< equalize shield energy to all quadrants
SHIELD_XFER_TOP =77, //!< transfer shield energy to front
SHIELD_XFER_BOTTOM =78, //!< transfer shield energy to rear
SHIELD_XFER_LEFT =79, //!< transfer shield energy to left
SHIELD_XFER_RIGHT =80, //!< transfer shield energy to right
XFER_SHIELD =81, //!< transfer energy to shield from weapons
XFER_LASER =82, //!< transfer energy to weapons from shield
INCREASE_WEAPON =69, //!< increase weapon recharge rate
DECREASE_WEAPON =70, //!< decrease weapon recharge rate
INCREASE_SHIELD =71, //!< increase shield recharge rate
DECREASE_SHIELD =72, //!< decrease shield recharge rate
INCREASE_ENGINE =73, //!< increase energy to engines
DECREASE_ENGINE =74, //!< decrease energy to engines
ETS_EQUALIZE =75, //!< equalize recharge rates
SHIELD_EQUALIZE =76, //!< equalize shield energy to all quadrants
SHIELD_XFER_TOP =77, //!< transfer shield energy to front
SHIELD_XFER_BOTTOM =78, //!< transfer shield energy to rear
SHIELD_XFER_LEFT =79, //!< transfer shield energy to left
SHIELD_XFER_RIGHT =80, //!< transfer shield energy to right
XFER_SHIELD =81, //!< transfer energy to shield from weapons
XFER_LASER =82, //!< transfer energy to weapons from shield
//!< @n
//!< Misc Controls 2
//!< -----------------
GLIDE_WHEN_PRESSED =83, //!< GLIDE_WHEN_PRESSED
GLIDE_WHEN_PRESSED =83, //!< GLIDE_WHEN_PRESSED
//!< @remark Backslash -- this was a convenient place for Glide When Pressed, since Show Damage Popup isn't used
BANK_WHEN_PRESSED =84, //!< BANK_WHEN_PRESSED
SHOW_NAVMAP =85, //!< SHOW_NAVMAP
ADD_REMOVE_ESCORT =86, //!< ADD_REMOVE_ESCORT
ESCORT_CLEAR =87, //!< ESCORT_CLEAR
BANK_WHEN_PRESSED =84, //!< BANK_WHEN_PRESSED
SHOW_NAVMAP =85, //!< SHOW_NAVMAP
ADD_REMOVE_ESCORT =86, //!< ADD_REMOVE_ESCORT
ESCORT_CLEAR =87, //!< ESCORT_CLEAR
TARGET_NEXT_ESCORT_SHIP =88, //!< TARGET_NEXT_ESCORT_SHIP
TARGET_CLOSEST_REPAIR_SHIP =89, //!< target the closest repair ship
TARGET_NEXT_UNINSPECTED_CARGO =90, //!< TARGET_NEXT_UNINSPECTED_CARGO
TARGET_PREV_UNINSPECTED_CARGO =91, //!< TARGET_PREV_UNINSPECTED_CARGO
TARGET_NEWEST_SHIP =92, //!< TARGET_NEWEST_SHIP
TARGET_NEXT_ESCORT_SHIP =88, //!< TARGET_NEXT_ESCORT_SHIP
TARGET_CLOSEST_REPAIR_SHIP =89, //!< target the closest repair ship
TARGET_NEXT_UNINSPECTED_CARGO =90, //!< TARGET_NEXT_UNINSPECTED_CARGO
TARGET_PREV_UNINSPECTED_CARGO =91, //!< TARGET_PREV_UNINSPECTED_CARGO
TARGET_NEWEST_SHIP =92, //!< TARGET_NEWEST_SHIP
TARGET_NEXT_LIVE_TURRET =93, //!< TARGET_NEXT_LIVE_TURRET
TARGET_PREV_LIVE_TURRET =94, //!< TARGET_PREV_LIVE_TURRET
TARGET_NEXT_LIVE_TURRET =93, //!< TARGET_NEXT_LIVE_TURRET
TARGET_PREV_LIVE_TURRET =94, //!< TARGET_PREV_LIVE_TURRET
TARGET_NEXT_BOMB =95, //!< TARGET_NEXT_BOMB
TARGET_PREV_BOMB =96, //!< TARGET_PREV_BOMB
TARGET_NEXT_BOMB =95, //!< TARGET_NEXT_BOMB
TARGET_PREV_BOMB =96, //!< TARGET_PREV_BOMB
//!< @n
//!< Multiplayer messaging keys
//!< ----------------------------
MULTI_MESSAGE_ALL =97, //!< message all netplayers
MULTI_MESSAGE_FRIENDLY =98, //!< message all friendlies
MULTI_MESSAGE_HOSTILE =99, //!< message all hostiles
MULTI_MESSAGE_TARGET =100, //!< message targeted ship (if player)
MULTI_MESSAGE_ALL =97, //!< message all netplayers
MULTI_MESSAGE_FRIENDLY =98, //!< message all friendlies
MULTI_MESSAGE_HOSTILE =99, //!< message all hostiles
MULTI_MESSAGE_TARGET =100, //!< message targeted ship (if player)
//!< @n
//!< Multiplayer misc keys
//!< -----------------------
MULTI_OBSERVER_ZOOM_TO =101, //!< if i'm an observer, zoom to my targeted object
MULTI_OBSERVER_ZOOM_TO =101, //!< if i'm an observer, zoom to my targeted object
TIME_SPEED_UP =102, //!< TIME_SPEED_UP
TIME_SLOW_DOWN =103, //!< TIME_SLOW_DOWN
TIME_SPEED_UP =102, //!< TIME_SPEED_UP
TIME_SLOW_DOWN =103, //!< TIME_SLOW_DOWN
TOGGLE_HUD_CONTRAST =104, //!< toggle between high and low HUD contrast
TOGGLE_HUD_CONTRAST =104, //!< toggle between high and low HUD contrast
MULTI_TOGGLE_NETINFO =105, //!< toggle network info
MULTI_TOGGLE_NETINFO =105, //!< toggle network info
MULTI_SELF_DESTRUCT =106, //!< self destruct (multiplayer only)
MULTI_SELF_DESTRUCT =106, //!< self destruct (multiplayer only)
//!< @n
//!< Misc Controls 3
//!< -----------------
TOGGLE_HUD =107, //!< TOGGLE_HUD
RIGHT_SLIDE_THRUST =108, //!< RIGHT_SLIDE_THRUST
LEFT_SLIDE_THRUST =109, //!< LEFT_SLIDE_THRUST
UP_SLIDE_THRUST =110, //!< UP_SLIDE_THRUST
DOWN_SLIDE_THRUST =111, //!< DOWN_SLIDE_THRUST
HUD_TARGETBOX_TOGGLE_WIREFRAME =112, //!< HUD_TARGETBOX_TOGGLE_WIREFRAME
VIEW_TOPDOWN =113, //!< VIEW_TOPDOWN
VIEW_TRACK_TARGET =114, //!< VIEW_TRACK_TARGET
TOGGLE_HUD =107, //!< TOGGLE_HUD
RIGHT_SLIDE_THRUST =108, //!< RIGHT_SLIDE_THRUST
LEFT_SLIDE_THRUST =109, //!< LEFT_SLIDE_THRUST
UP_SLIDE_THRUST =110, //!< UP_SLIDE_THRUST
DOWN_SLIDE_THRUST =111, //!< DOWN_SLIDE_THRUST
HUD_TARGETBOX_TOGGLE_WIREFRAME =112, //!< HUD_TARGETBOX_TOGGLE_WIREFRAME
VIEW_TOPDOWN =113, //!< VIEW_TOPDOWN
VIEW_TRACK_TARGET =114, //!< VIEW_TRACK_TARGET
//!< @n
//!< AutoPilot - Kazan
//!< -------------------
AUTO_PILOT_TOGGLE =115, //!< Autopilot key control
NAV_CYCLE =116, //!< NAV_CYCLE
AUTO_PILOT_TOGGLE =115, //!< Autopilot key control
NAV_CYCLE =116, //!< NAV_CYCLE
//!< @n
//!< Gliding
//!< ---------
TOGGLE_GLIDING =117, //!< TOGGLE_GLIDING
TOGGLE_GLIDING =117, //!< TOGGLE_GLIDING
//!< @n
//!< Additional weapon controls
//!< ----------------------------
CYCLE_PRIMARY_WEAPON_SEQUENCE =118, //!< cycle num primaries to fire at once
CYCLE_PRIMARY_WEAPON_SEQUENCE =118, //!< cycle num primaries to fire at once
/*!
* This must always be below the last defined item
*/
CCFG_MAX //!< The total number of defined control actions (or last define + 1)
CCFG_MAX //!< The total number of defined control actions (or last define + 1)
};
extern int Failed_key_index;
@@ -285,7 +288,10 @@ extern int Axis_map_to[];
extern int Invert_axis[];
extern int Invert_axis_defaults[];
extern int Control_config_overlay_id;
extern config_item Control_config[]; //!< Stores the keyboard configuration
extern SCP_vector<config_item*> Control_config_presets; // tabled control presets; pointers to config_item arrays
extern char **Scan_code_text;
extern char **Joy_button_text;
@@ -297,8 +303,8 @@ void control_config_close();
void control_config_cancel_exit();
void control_config_reset_defaults();
int translate_key_to_index(char *key);
void control_config_reset_defaults(int presetnum=-1);
int translate_key_to_index(const char *key, bool find_override=true);
char *translate_key(char *key);
char *textify_scancode(int code);
float check_control_timef(int id);
File diff suppressed because it is too large. Load diff
+15 -19
View File
@@ -55,12 +55,8 @@ void cutscene_init()
int rval;
cutscene_info cutinfo;
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", "cutscenes.tbl", rval));
lcl_ext_close();
return;
}
@@ -76,8 +72,6 @@ void cutscene_init()
while ( required_string_either("#End", "$Filename:") )
{
memset(&cutinfo, 0, sizeof(cutscene_info));
required_string("$Filename:");
stuff_string( cutinfo.filename, F_PATHNAME, MAX_FILENAME_LEN );
@@ -90,8 +84,12 @@ void cutscene_init()
compact_multitext_string(buf);
cutinfo.description = vm_strdup(buf);
required_string("$cd:");
stuff_int( &cutinfo.cd );
if (optional_string("$cd:"))
stuff_int( &cutinfo.cd );
else
cutinfo.cd = 0;
cutinfo.viewable = false;
if (isFirstCutscene) {
isFirstCutscene = false;
@@ -103,14 +101,10 @@ void cutscene_init()
stuff_boolean(&cutinfo.viewable);
}
Cutscenes.push_back(cutinfo);
}
required_string("#End");
// close localization
lcl_ext_close();
}
// function to return 0 based index of which CD a particular movie is on
@@ -156,6 +150,8 @@ void cutscene_mark_viewable(char *filename)
}
i++;
}
Warning(LOCATION, "Could not find cutscene '%s' in listing; cannot mark it viewable...", filename);
}
#define NUM_BUTTONS 8
@@ -254,7 +250,7 @@ int Cutscene_max_text_lines[GR_NUM_RESOLUTIONS] = {
static int Text_size;
static int Text_offset = 0;
static int Text_line_size[MAX_TEXT_LINES];
static char *Text_lines[MAX_TEXT_LINES];
static const char *Text_lines[MAX_TEXT_LINES];
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
@@ -262,7 +258,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
int cd_present = 0;
int cd_drive_num;
int cd_mve_is_on;
char volume_name[128];
char volume_name[MAX_PATH_LEN];
int num_attempts = 0;
@@ -322,7 +318,7 @@ void cutscenes_screen_play()
strcpy_s(name, Cutscenes[which_cutscene].filename );
// full_name = cf_add_ext(name, NOX(".mve"));
main_hall_stop_music();
main_hall_stop_music(true);
main_hall_stop_ambient();
int rval = movie_play(name);
main_hall_start_music();
@@ -335,7 +331,7 @@ void cutscenes_screen_play()
else
sprintf(str, XSTR("Unable to play movie %s.", 204), Cutscenes[which_cutscene].name);
popup(0, 1, POPUP_OK, str );
popup(PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, str );
}
}
@@ -582,7 +578,7 @@ void cutscenes_screen_do_frame()
GR_MAYBE_CLEAR_RES(Background_bitmap);
if (Background_bitmap >= 0) {
gr_set_bitmap(Background_bitmap);
gr_bitmap(0, 0);
gr_bitmap(0, 0, GR_RESIZE_MENU);
}
Ui_window.draw();
@@ -612,7 +608,7 @@ void cutscenes_screen_do_frame()
gr_set_color_fast(&Color_text_normal);
}
gr_printf(Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1] + y, Cutscenes[Cutscene_list[z]].name);
gr_printf_menu(Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1] + y, Cutscenes[Cutscene_list[z]].name);
y += font_height;
z++;
@@ -651,7 +647,7 @@ void cutscenes_screen_do_frame()
strncpy(line, Text_lines[z], len);
line[len] = 0;
gr_string(Cutscene_desc_coords[gr_screen.res][0], Cutscene_desc_coords[gr_screen.res][1] + y, line);
gr_string(Cutscene_desc_coords[gr_screen.res][0], Cutscene_desc_coords[gr_screen.res][1] + y, line, GR_RESIZE_MENU);
y += font_height;
z++;
-4
View File
@@ -14,10 +14,6 @@
#include "globalincs/pstypes.h"
typedef struct cutscene_info {
cutscene_info() :
viewable(false)
{}
char filename[MAX_FILENAME_LEN];
char name[NAME_LENGTH];
char *description;
+1 -1
View File
@@ -614,7 +614,7 @@ void mve_video_display()
// DDOI - This is probably really fricking slow
int bitmap = bm_create (16, g_screenWidth, g_screenHeight, pixelbuf, 0);
gr_set_bitmap (bitmap);
gr_bitmap ((int)g_screenX, (int)g_screenY, true);
gr_bitmap ((int)g_screenX, (int)g_screenY, GR_RESIZE_FULL);
bm_release (bitmap);
}
+1 -1
View File
@@ -797,7 +797,7 @@ THEORAFILE *theora_open(char *filename)
// lower case filename for checking
memset( lower_name, 0, sizeof(lower_name) );
strncpy( lower_name, filename, strlen(filename) );
strncpy( lower_name, filename, sizeof(lower_name)-1 );
strlwr(lower_name);
char *p = strchr( lower_name, '.' );
+3 -3
View File
@@ -27,7 +27,7 @@ static inline int is_power_of_two(int w, int h)
}
int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int *bpp, int *compression_type, int *levels, int *size, ubyte *palette)
int dds_read_header(const char *filename, CFILE *img_cfp, int *width, int *height, int *bpp, int *compression_type, int *levels, int *size, ubyte *palette)
{
DDSURFACEDESC2 dds_header;
int code = 0;
@@ -272,7 +272,7 @@ Done:
}
//reads pixel info from a dds file
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp, int cf_type)
int dds_read_bitmap(const char *filename, ubyte *data, ubyte *bpp, int cf_type)
{
int retval;
int w,h,ct,lvl;
@@ -321,7 +321,7 @@ int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp, int cf_type)
// save some image data as a DDS image
// NOTE: we only support, uncompressed, 24-bit RGB and 32-bit RGBA images here!!
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data, int cubemap, char *filename)
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data, int cubemap, const char *filename)
{
DDSURFACEDESC2 dds_header;
char real_filename[MAX_FILENAME_LEN];
+3 -3
View File
@@ -138,14 +138,14 @@ typedef struct _DDSURFACEDESC2
//reads a dds header
//returns one of the error values
//'compression_type' comes back as one of the DDS_DXTC* defines
int dds_read_header(char *filename, CFILE *img_cfp = NULL, int *width = 0, int *height = 0, int *bpp = 0, int *compression_type = 0, int *levels = 0, int *size = 0, ubyte *palette = NULL);
int dds_read_header(const char *filename, CFILE *img_cfp = NULL, int *width = 0, int *height = 0, int *bpp = 0, int *compression_type = 0, int *levels = 0, int *size = 0, ubyte *palette = NULL);
//reads bitmap
//size of the data it stored in size
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp = NULL, int cf_type = CF_TYPE_ANY);
int dds_read_bitmap(const char *filename, ubyte *data, ubyte *bpp = NULL, int cf_type = CF_TYPE_ANY);
// writes a DDS file using given data
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data = NULL, int cubemap = 0, char *filename = NULL);
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data = NULL, int cubemap = 0, const char *filename = NULL);
//returns a string from a DDS error code
const char *dds_error_string(int code);
+6 -3
View File
@@ -101,6 +101,7 @@ void debris_init()
for (i=0; i<MAX_DEBRIS_PIECES; i++ ) {
Debris[i].flags = 0;
Debris[i].sound_delay = 0;
Debris[i].objnum = -1;
}
Num_hull_pieces = 0;
@@ -237,6 +238,7 @@ void debris_delete( object * obj )
}
db->flags = 0;
db->objnum = -1;
Num_debris_pieces--;
}
@@ -524,11 +526,11 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d
// Create Debris piece n!
if ( hull_flag ) {
if (rand() < RAND_MAX/6) // Make some pieces blow up shortly after explosion.
db->lifeleft = 2.0f * ((float) myrand()/(float) RAND_MAX) + 0.5f;
db->lifeleft = 2.0f * (myrand() * RAND_MAX_1f) + 0.5f;
else
db->lifeleft = -1.0f; // large hull pieces stay around forever
} else {
db->lifeleft = (i2fl(myrand())/i2fl(RAND_MAX))*2.0f+0.1f;
db->lifeleft = (myrand() * RAND_MAX_1f) * 2.0f + 0.1f;
}
}
@@ -805,6 +807,7 @@ void debris_hit(object *debris_obj, object *other_obj, vec3d *hitpos, float dama
int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, collision_info_struct *debris_hit_info)
{
mc_info mc;
mc_info_init(&mc);
int num;
Assert( pdebris->type == OBJ_DEBRIS );
@@ -834,7 +837,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, co
weapon *wp = &Weapons[other_obj->instance];
wp->collisionOccured = true;
wp->collisionInfo = mc_info(mc);
memcpy(&wp->collisionInfo, &mc, sizeof(mc_info));
return mc.num_hits;
}
+1 -1
View File
@@ -14,7 +14,7 @@
#include "globalincs/pstypes.h"
struct object;
class object;
struct CFILE;
#define MAX_DEBRIS_ARCS 8 // Must be less than MAX_ARC_EFFECTS in model.h
File diff suppressed because it is too large. Load diff
+279
View File
@@ -0,0 +1,279 @@
#ifndef _CONSOLE_H
#define _CONSOLE_H
/*
* z64555's debug console, created for the FreeSpace Source Code project
*
* Portions of this source code are based on works by Volition, Inc. circa 1999. You may not sell or otherwise
* commercially exploit the source or things you created based on the source.
*/
/**
* @file console.h
* @brief An overhauled/updated debug console to allow monitoring, testing, and general debugging of new features.
*
* @details
* Of key interest is Volition's DCF macro, which adds the function argument to the available command list in the
* debug console. These functions may be defined in the .cpp file that they are related to, but it is recommended
* that they be in their own .cpp if they have multiple sub-arguments (ex: Git has its sub-arguments delimited by
* a pair of -'s, or --)
*/
#include "debugconsole/consoleparse.h"
#include "globalincs/pstypes.h"
#include "globalincs/vmallocator.h"
#define DC_MAX_COMMANDS 300
class debug_command;
/**
* @def DCF
*
* @brief The potent DCF macro, used to define new debug commands for the console.
*
* @param function_name[in] The name of the function, as shown in the debug console
* @param help_txt[in] The short-help text, as shown as listed from the 'help' command
*
* @details
* Each DCF is responsible for getting data from the debug console's command line. The parsing functions for the
* command line have been set up to have similar syntax and usage as the parselo commands. (see consoleparse.h)
* Most, if not all, argument and subcommand strings should be parsed by the dc_optional_string functions.
* Usage example:
* DCF(toggle_it, "description")
* {
* if (dc_optional_string_either("help", "--help")) {
* dc_printf("Usage: sample. Toggles This_var on/off\n");
*
* } else if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) {
* dc_printf("This_var is %s\n", (This_var ? "ON" : "OFF"));
*
* } else {
* This_var = !This_var;
*
* }
* }
*
* In the console, the command would be listed as 'toggle_it', and dcf_help would display it as:
* toggle_it - Usage: sample. Toggles This_var on/off.
* Note: The only allowed function type is a void fn( void )
*/
#define DCF(function_name, help_text) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, help_text, dcf_##function_name); \
void dcf_##function_name()
/**
* @def Shortcut for debug commands that toggle a bool, such as Show_lightning
*
* @param [in] function_name Name of the function, as shown in the debug console
* @param [in] bool_variable Name of the variable to allow toggling.
*/
#define DCF_BOOL(function_name, bool_variable) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, "Sets or toggles the boolean: "#bool_variable, dcf_##function_name ); \
void dcf_##function_name() { \
bool bool_tmp = bool_variable != 0; \
if (dc_optional_string_either("help", "--help")) { \
dc_printf( "Usage: %s [bool]\nSets %s to true or false. If nothing passed, then toggles it.\n", #function_name, #bool_variable ); \
return; \
} \
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) { \
dc_printf("%s = %s\n", #bool_variable, (bool_variable ? "TRUE" : "FALSE")); \
return; \
} \
if (!dc_maybe_stuff_boolean(&bool_tmp)) { \
if (bool_variable != 0) \
bool_variable = 0; \
else \
bool_variable = 1; \
} else { \
if (bool_tmp) \
bool_variable = 1; \
else \
bool_variable = 0; \
} \
dc_printf("%s set to %s\n", #bool_variable, (bool_variable != 0 ? "TRUE" : "FALSE")); \
}
/**
* @def Same as DCF_BOOL, but with custom help strings
*
* @param [in] function_name Name of the function, as shown in the debug console
* @param [in] bool_variable Name of the variable to allow toggling.
*/
#define DCF_BOOL2(function_name, bool_variable, short_help, long_help) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, short_help, dcf_##function_name ); \
void dcf_##function_name() { \
if (dc_optional_string_either("help", "--help")) { \
dc_printf( #long_help ); \
return; \
} \
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) { \
dc_printf("%s = %s\n", #function_name, (bool_variable ? "TRUE" : "FALSE")); \
return; \
} \
if (!dc_maybe_stuff_boolean(&bool_variable)) { \
bool_variable = !bool_variable; \
} \
}
/**
* @def Shortcut for single-variable setters/monitors
*
* @param [in] function_name
* @param [in] float_variable
* @param [in] short_help
*/
#define DCF_FLOAT(function_name, float_variable, short_help) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, short_help, dcf_##function_name ); \
void dcf_##function_name() { \
float value; \
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) { \
dc_printf("%s = %f\n", #float_variable, float_variable); \
return; \
} \
dc_stuff_float(&value); \
float_variable = value; \
dc_printf("%s set to %f\n", #float_variable, float_variable); \
}
/**
* @def Shortcut for single-variable setters/monitors with lower/upper bounds clamping
*
* @param [in] function_name
* @param [in] float_variable
* @param [in] lower_bounds
* @param [in] upper_bounds
* @param [in] short_help
*/
#define DCF_FLOAT2(function_name, float_variable, lower_bounds, upper_bounds, short_help) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, short_help, dcf_##function_name ); \
void dcf_##function_name() { \
float value; \
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) { \
dc_printf("%s = %f\n", #float_variable, float_variable); \
return; \
} \
dc_stuff_float(&value); \
CLAMP(float_variable, lower_bounds, upper_bounds); \
float_variable = value; \
dc_printf("%s set to %f\n", #float_variable, float_variable); \
}
/**
* @def Shortcut for single-variable setters/monitors
*
* @param [in] function_name
* @param [in] int_variable
* @param [in] short_help
*/
#define DCF_INT(function_name, int_variable, short_help) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, short_help, dcf_##function_name ); \
void dcf_##function_name() { \
int value; \
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) { \
dc_printf("%s = %i\n", #int_variable, int_variable); \
return; \
} \
dc_stuff_int(&value); \
int_variable = value; \
dc_printf("%s set to %i\n", #int_variable, int_variable); \
}
/**
* @def Shortcut for single-variable setters/monitors with lower/upper bounds clamping
*
* @param [in] function_name
* @param [in] int_variable
* @param [in] lower_bounds
* @param [in] upper_bounds
* @param [in] short_help
*/
#define DCF_INT2(function_name, int_variable, lower_bounds, upper_bounds, short_help) \
void dcf_##function_name(); \
debug_command dcmd_##function_name(#function_name, short_help, dcf_##function_name ); \
void dcf_##function_name() { \
int value; \
if (dc_optional_string_either("status", "--status") || dc_optional_string_either("?", "--?")) { \
dc_printf("%s = %i\n", #int_variable, int_variable); \
return; \
} \
dc_stuff_int(&value); \
CLAMP(int_variable, lower_bounds, upper_bounds); \
int_variable = value; \
dc_printf("%s set to %i\n", #int_variable, int_variable); \
}
/**
* @class debug_command
* @brief Class to aggregate a debug command with its name (as shown in the console) and short help.
*
* @details
* Note: Long help, as evoked by '<command> help', should be handled by the function itself. It is recommended
* that arguments that have sub-arguments be in their own function, so as to aide in organization and to keep the
* size of the command function down.
*/
class debug_command {
public:
const char *name; //!< The name of the command, as shown in the debug console
const char *help; //!< The short help string, as shown by 'help <command>'
void (*func)(); //!< Pointer to the function that to run when this command is evoked
debug_command();
/**
* @brief Adds a debug command to the debug_commands map, if it isn't in there already.
*
* @details The DCF macro more or less guarantees that a command won't be duplicated on compile time. But no harm in
* some extra caution.
*/
debug_command(const char *name, const char *help, void (*func)());
};
/**
* @class is_dcmd
* @brief Predicate class used to search for a dcmd by name
*/
class is_dcmd {
public:
const char *name;
is_dcmd(const char *_name) : name(_name) {}
bool operator() (debug_command* dcmd)
{
return (strcmp(name, dcmd->name) == 0);
}
};
extern bool Dc_debug_on;
extern int dc_commands_size;
extern uint lastline;
extern SCP_string dc_command_str; // The rest of the command line, from the end of the last processed arg on.
/**
* @brief Pauses the output of a command and allows user to scroll through the output history.
*
* @details Returns true if user has pressed Esc, returns false otherwise. Use this in your function to (safely?) break
* out of the loop it's presumably in.
*/
bool dc_pause_output(void);
/**
* @brief Prints the given char string to the debug console
* @details See the doc for std::printf() for formating and more details
*/
void dc_printf(const char *format, ...);
/**
* @brief Opens and processes the debug console. (Blocking call)
* @details TODO: Make this a non-blocking call so that the game can still run while the debug console is open.
*/
void debug_console(void (*func)(void) = NULL);
#endif // _CONSOLE_H
+162
View File
@@ -0,0 +1,162 @@
/*
* z64555's debug console
* Created for the FreeSpace Source Code project
*
* Portions of this source code are based on works by Volition, Inc. circa
* 1999. You may not sell or otherwise commercially exploit the source or things you
* created based on the source
*/
/**
* @file consolecmds.cpp
*
* @brief This file contains the "built-in" commands for the debug console, and is listed by the 'help' and '?' commands
*
* @details
* All other debug commands should be in their respective files and added to the console with the DCF macro. For
* further documentation, please see console.h
*/
#include "debugconsole/console.h"
#include "debugconsole/consoleparse.h"
#include "globalincs/pstypes.h"
#include "globalincs/vmallocator.h"
#include "io/key.h"
#include <algorithm>
// ========================= GLOBALS =========================
debug_command *dc_commands[DC_MAX_COMMANDS];
int dc_commands_size = 0;
// ========================= LOCALS ==========================
// dcf_shell commands
void dc_shell_font( void );
void dc_shell_resize( void );
void dc_shell_resize_buf( void );
// =================== class debug_command ===================
debug_command::debug_command()
: name(""), help(""), func(NULL) {
};
debug_command::debug_command(const char *_name, const char *_help, void(*_func)())
: name(_name), help(_help), func(_func) {
int i = 0;
int ret = 0;
if (dc_commands_size >= DC_MAX_COMMANDS) {
Error(LOCATION, "Too many debug console commands! Please inform a coder to increase DC_MAX_COMMANDS.");
return;
}
// Start the insertion sort by finding where to stick the debug command
for (; i < dc_commands_size; ++i) {
ret = stricmp(dc_commands[i]->name, _name);
if (ret == 0) {
Error(LOCATION, "Debug Command %s already exists! Please inform a coder immediately.", _name);
return;
} else if (ret > 0) {
// Insert the command here
break;
} // Else, do nothing
}
// Then, do the insertion
if (i < dc_commands_size) {
for (int j = dc_commands_size; j > i; --j) {
dc_commands[j] = dc_commands[j - 1];
}
dc_commands[i] = this;
dc_commands_size++;
} else {
dc_commands[dc_commands_size] = this;
dc_commands_size++;
}
}
// ============================== IMPLEMENTATIONS =============================
DCF(debug, "Runs a command in debug mode.")
{
int i;
SCP_string command = "";
Dc_debug_on = true;
dc_stuff_string_white(command);
if (command == "") {
dc_printf("<debug> No command given\n");
return;
} // Else, command is present.
for (i = 0; i < dc_commands_size; ++i) {
if (stricmp(dc_commands[i]->name, command.c_str()) == 0) {
break;
} // Else, continue
}
if (i == dc_commands_size) {
dc_printf("<debug> Command not found: '%s'\n", command.c_str());
return;
} // Else, we found our command
dc_printf("<debug> Executing command: '%s'\n", command.c_str());
// try {
dc_commands[i]->func();
// } catch {
// }
Dc_debug_on = false;
}
DCF(help, "Displays the help list." )
{
extern uint DROWS;
int i;
SCP_string command = "";
dc_maybe_stuff_string_white(command);
if ((command == "help") || (command == "man"))
{
// Moron filter :D
dc_printf("GTVA Command: Sorry pilot. You're on your own.\n");
return;
} else if (command != "") {
for (i = 0; i < dc_commands_size; ++i) {
if (stricmp(dc_commands[i]->name, command.c_str()) == 0) {
break;
} // Else, continue
}
if (i == dc_commands_size) {
dc_printf("Command not found: '%s'\n", command.c_str());
return;
} // Else, we found our command
dc_printf("%s\n", dc_commands[i]->help);
return;
} // Else, command line is empty, print out the help list
dc_printf("FreeSpace Open Debug Console\n");
dc_printf(" These commands are defined internally.\n");
dc_printf(" Typing 'help function_name' will give the short help on the function.\n");
dc_printf(" Some functions may have detailed help, try passing \"help\" or \"--help\" to them.");
dc_printf(" F3 selects last command line. Up and Down arrow keys scroll through the command history\n");
dc_printf("\n");
dc_printf(" Available commands:\n");
for (i = 0; i < dc_commands_size; ++i) {
if (((lastline % DROWS) == 0) && (lastline != 0)) {
dc_pause_output();
}
dc_printf(" %s - %s\n", dc_commands[i]->name, dc_commands[i]->help);
}
}
debug_command dc_man("man", "Also displays the help list", dcf_help);
File diff suppressed because it is too large. Load diff
+459
View File
@@ -0,0 +1,459 @@
#ifndef _CONSOLEPARSE_H
#define _CONSOLEPARSE_H
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Command-line parsing functions for z64555's debug console, created for the FreeSpace Source Code project
//
// Portions of this source code are based on works by Volition, Inc. circa 1999. You may not sell or otherwise
// commercially exploit the source or things you created based on the source.
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/**
* @file consoleparse.h
* @brief Parsing functions for the command line. Previously known as the command line scanner
*
* @details A lot of functions here are blatently copied from parselo.h :D
*/
#include "globalincs/pstypes.h"
#include <cstdarg>
#define MAX_CLI_LEN 512
#define MAX_TOKEN_LENGTH 255
enum dc_token {
DCT_NONE = 0, //!< No token
DCT_STRING, //!< String
DCT_FLOAT, //!< Floating point
DCT_INT, //!< Integral
DCT_UINT, //!< Unsigned Integral
DCT_BYTE, //!< Integral with values between -128 and 127
DCT_UBYTE, //!< Integral with values between 0 and 255
DCT_BOOL, //!< Integral or string evaluated as a boolean
DCT_MAX_ITEMS //!< Maximum number of dc_token elements. Primarily used as an end value in loops
};
/**
* @class errParse
*
* @brief Class thrown when a required token is not found
*
* @details This is a basic parser error, it contains the token (a single word) that was found, and the expected token
* type. Some DCT's, such as the DCT_STRING's, have their own specific requirements for error handling, and as
* such get their own class derived from errParse. The catching routines should be able to catch the derived error
* objects, but if not, they can be caught by a routine looking for the base class and then be casted to their
* proper type.
*/
class errParse {
public:
SCP_string found_token;
dc_token expected_type;
/**
* @brief Invalid/Unexpected token constructor
* @param [in] found_str The token that was found
* @param [in] expected_dct The token type that was expected
*/
errParse(const char *found_str, dc_token expected_dct)
: found_token(found_str), expected_type(expected_dct)
{
}
};
/**
* @class errParseString
*
* @brief Class thrown when an expected string was not found. Can/should contain all of the expected strings.
*/
class errParseString : public errParse
{
public:
SCP_vector<SCP_string> expected_tokens;
/**
* @brief Invalid/Unexpected token constructor.
*
* @param [in] found_str The string that was found
* @param [in] str The token that was expected
*/
errParseString(const char *found_str, char *str)
: errParse(found_str, DCT_STRING)
{
expected_tokens.push_back(str);
}
/**
* @brief Invalid/Unexpected token constructor.
*
* @param [in] found_str The string that was found
* @param [in] str1 The first token that was expected
* @param [in] str2 The second token that was expected
*/
errParseString(const char *found_str, char *str1, char *str2)
: errParse(found_str, DCT_STRING)
{
expected_tokens.push_back(str1);
expected_tokens.push_back(str2);
}
/**
* @brief Invalid/Unexpected token constructor.
*
* @param [in] found_str The string that was found
* @param [in] strings The strings that were expected
*/
errParseString(const char *found_str, SCP_vector<SCP_string> &strings)
: errParse(found_str, DCT_STRING), expected_tokens(strings)
{
}
};
/**
* @class errParseOverflow
*
* @brief Class thrown when the parsed string or token could not be stuffed into the smaller destination container
*
* @var found_str Contains the first 'len' valid characters.
*/
class errParseOverflow : public errParse
{
public:
size_t len; //!< The size of the destination container
errParseOverflow(const char *found_str, size_t _len)
: errParse(found_str, DCT_STRING), len(_len)
{
}
};
/**
* @brief Initializes the DC command line parser
*/
void dc_parse_init(SCP_string &str);
/**
* @brief Advances the parser past whitespace characters
*/
void dc_ignore_white_space(void);
/**
* @brief Advances the parser past grayspace characters
*/
void dc_ignore_gray_space(void);
// Required/Optional Token
/**
* @brief Searches for a specified required string, throwing an errParse if not found.
*
* @param[in] pstr The string to search for
*
* @throws errParseString with the required string
*/
void dc_required_string(char *pstr);
/**
* @brief Searchs for either of the specified required strings, throwing an errParse if neither are found
*
* @param[in] str1 The first string to search for
* @param[in] str2 The second string to search for
*
* @retval 0 if str1 was found, or
* @retval 1 if str2 was found
*
* @throws errParseString with the required strings
*/
int dc_required_string_either(char *str1, char *str2);
/**
* @brief Searches for specified required strings
*
* @param[in] n The number of char[] or c_str's given
* @param[in] ... A comma delimited list of one or more required strings.
*
* @returns The index of the specified required strings (as if they were an array)
*
* @throws errParseString with the required strings
*/
uint dc_required_string_any(const uint n, ...);
/**
* @brief Searches for an optional string
*
* @param[in] pstr The char[] to look for
*
* @retval true if the string was found,
* @retval false otherwise
*/
bool dc_optional_string(const char *pstr);
/**
* @brief Searches for an optional string and it's alias
*
* @param[in] str1 The char[] to look for
* @param[in] str2 The alternative char[] to look for
*
* @retval true if the string was found,
* @retval false otherwise
*/
bool dc_optional_string_either(const char *str1, const char *str2);
// ==========================
// Stuffers
// ==========================
/**
* @brief Stuffs a float to the given variable.
*
* @param[in] f The float variable to stuff to
*
* @throws errParse if an unexpected or otherwise malformed float string is found.
* @throws errParse if nothing was found
*/
void dc_stuff_float(float *f);
/**
* @brief Stuffs an int to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats
*
* @param[in] i The int variable to stuff to
*
* @details The binary, hexadecimal, and octal formats must be prefixed by their associated string.
* Ex: "0xDEADBEEF" would be parsed properly while "DEADBEEF" would throw an error
*
* @throws errParse if an unexpected or otherwise malformed float string is found.
* @throws errParse if nothing was found
*/
void dc_stuff_int(int *i);
/**
* @brief Stuffs an unsigned int to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats
*
* @param[in] i The unsigned int variable to stuff to
*
* @details The binary, hexadecimal, and octal formats must be prefixed by their associated string.
* Ex: "0xDEADBEEF" would be parsed properly while "DEADBEEF" would throw an error
*
* @throws errParse if an unexpected or otherwise malformed float string is found.
* @throws errParse if nothing was found
*/
void dc_stuff_uint(uint *i);
/**
* @brief Stuffs an unsigned byte to the given variable. Supports binary (0b), hexadecimal (0x), and octal (0o) formats
*
* @param[in] i The ubyte variable to stuff to
*
* @details The binary, hexadecimal, and octal formats must be prefixed by their associated string.
* Ex: "0x0F" would be parsed properly while "0F" would throw an error
*
* @throws errParse if an unexpected or otherwise malformed float string is found.
* @throws errParse if nothing was found
*/
void dc_stuff_ubyte(ubyte *i);
/**
* @brief stuffs a boolean evaluated integer or string into the given variable.
*
* @param[in] b The bool variable to stuff to
*
* @details Supports a number of literal strings as true and false, including "true", "false", "yes", "no" and the
* yes/no equivalents in other languages supported in localization.
* TODO: Make a static string map to handle this instead of being hard-coded
*
* @throws errParse if an unexpected or otherwise malformed float string is found.
* @throws errParse if nothing was found
*/
void dc_stuff_boolean(bool *b);
/**
* @brief stuffs a boolean evaluated integer or string into the given variable.
*
* @param[in] i The int variable to stuff to. 0 is false, 1 is true
*
* @details Supports a number of literal strings as true and false, including "true", "false", "yes", "no" and the
* yes/no equivalents in other languages supported in localization.
* TODO: Make a static string map to handle this instead of being hard-coded
*
* @throws errParse if an unexpected or otherwise malformed float string is found.
* @throws errParse if nothing was found
*/
void dc_stuff_boolean(int *i);
/**
* @brief Stuffs a string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string
* @param[in] maxlen Maximum length to copy. (maxlen <= sizeof(str)) && (maxlen <= MAX_TOKEN_LENGTH)
*
* @throws errParse when nothing left was found on the command line
* @throws errParseOverflow when parser cannot stuff the entirety of the found string into out_str
*/
void dc_stuff_string(char *str, size_t maxlen);
/**
* @brief Stuffs a string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string
*
* @throws errParse when nothing left was found on the command line
*/
void dc_stuff_string(SCP_string &str);
/**
* @brief Stuffs a whitespace delimited string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string
* @param[in] len Maximum length to copy. (len <= sizeof(str)) && (len <= MAX_TOKEN_LENGTH)
*
* @throws errParse when nothing left was found on the command line
* @throws errParseOverflow when parser cannot stuff the entirety of the found string into out_str
*/
void dc_stuff_string_white(char *str, size_t len);
/**
* @brief Stuffs a whitespace delimited string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string
*
* @throws errParse when nothing left was found on the command line
*/
void dc_stuff_string_white(SCP_string &str);
/**
* @brief Tries to stuff a float from the Command_string.
*
* @param[in] f The float variable to maybe stuff.
*
* @details
* If there's nothing on the command line, *f = 0 and false is returned
*
* If there's something on the command line, and we're able to convert it, *f = the converted value, true is
* returned, and the parser is advanced past the token
*
* If there's something on command line, but we can't convert it, an errParse is thrown
*/
bool dc_maybe_stuff_float(float *f);
/**
* @brief Tries to stuff an int from the Command_string.
*
* @param[in] i The int variable to maybe stuff.
*
* @details
* If there's nothing on the command line, *i = 0 and false is returned
*
* If there's something on the command line, and we're able to convert it, *i = the converted value, true is
* returned, and the parser is advanced past the token
*
* If there's something on command line, but we can't convert it, an errParse is thrown
*/
bool dc_maybe_stuff_int(int *i);
/**
* @brief Tries to stuff an uint from the Command_string.
*
* @param[in] i The uint variable to maybe stuff.
*
* @details
* If there's nothing on the command line, *i = 0 and false is returned
*
* If there's something on the command line, and we're able to convert it, *i = the converted value, true is
* returned, and the parser is advanced past the token
*
* If there's something on command line, but we can't convert it, an errParse is thrown
*/
bool dc_maybe_stuff_uint(uint *i);
/**
* @brief Tries to stuff an ubyte from the Command_string.
*
* @param[in] i The ubyte variable to maybe stuff.
*
* @details
* If there's nothing on the command line, *i = 0 and false is returned
*
* If there's something on the command line, and we're able to convert it, *i = the converted value, true is
* returned, and the parser is advanced past the token
*
* If there's something on command line, but we can't convert it, an errParse is thrown
*/
bool dc_maybe_stuff_ubyte(ubyte *i);
/**
* @brief Tries to stuff a bool from the Command_string.
*
* @param[in] b The bool variable to maybe stuff.
*
* @details
* If there's nothing on the command line, *b = false and false is returned
*
* If there's something on the command line, and we're able to convert it, *b = the converted value, true is
* returned, and the parser is advanced past the token
*
* If there's something on command line, but we can't convert it, an errParse is thrown
*/
bool dc_maybe_stuff_boolean(bool *b);
/**
* @brief Tries to stuff an int with a bool value from the Command_string.
*
* @param[in] i The int variable to maybe stuff.
*
* @details
* If there's nothing on the command line, *i = 0 and false is returned
*
* If there's something on the command line, and we're able to convert it, *i = the converted value, true is
* returned, and the parser is advanced past the token
*
* If there's something on command line, but we can't convert it, an errParse is thrown
*/
bool dc_maybe_stuff_boolean(int *i);
/**
* @brief Tries to stuff a string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string. If nothing was found, str = ""
* @param[in] len Maximum length to copy. (len <= sizeof(str)) && (len <= MAX_TOKEN_LENGTH)
*
* @retval true if the operation was successful,
* @retval false otherwise
*
* @throws errParseOverflow when parser cannot stuff the entirety of the found string into out_str
*/
bool dc_maybe_stuff_string(char *str, size_t len);
/**
* @brief Tries to stuff a string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string. If nothing was found, str = ""
*
* @retval true if the operation was successful,
* @retval false otherwise
*/
bool dc_maybe_stuff_string(SCP_string &str);
/**
* @brief Tries to stuff a whitespace delimited string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string. If nothing was found, str = ""
* @param[in] len Maximum length to copy. (maxlen <= sizeof(str)) && (maxlen <= MAX_TOKEN_LENGTH)
*
* @retval true if the operation was successful,
* @retval false otherwise
*
* @throws errParseOverflow when parser cannot stuff the entirety of the found string into out_str
*/
bool dc_maybe_stuff_string_white(char *str, size_t len);
/**
* @brief Tries to stuff a whitespace delimited string to out_str from the command line, stopping at the end of the command line
*
* @param[out] str Destination string. If nothing was found, str = ""
*
* @retval true if the operation was successful,
* @retval false otherwise
*/
bool dc_maybe_stuff_string_white(SCP_string &str);
#endif // _CONSOLEPARSE_H
+12 -12
View File
@@ -4,7 +4,7 @@
* You may not sell or otherwise commercially exploit the source or things you
* created based on the source.
*
*/
*/
/*
* This module is intended as a debug tool to measure the speed of blocks of code and display
@@ -23,7 +23,7 @@
// Internal structure for handling frame data
typedef struct
typedef struct
{
LARGE_INTEGER start_value;
LARGE_INTEGER total_value;
@@ -101,7 +101,7 @@ void timerbar_start_frame()
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
draw_func_ptr = NULL;
}
@@ -125,8 +125,8 @@ void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
{
float fxpos = (float) xpos;
float fxwidth = (float) xwidth;
draw_func_ptr(colour,
draw_func_ptr(colour,
fxpos / WIDTHF,
yrow * 0.01f,
fxwidth / WIDTHF,
@@ -151,8 +151,8 @@ void timerbar_end_frame()
for(int i = 0; i < MAX_NUM_TIMERBARS; i++)
{
// Nothing to render this frame
{
// Nothing to render this frame
if(profiles[i].frame_total.QuadPart == 0)
{
continue;
@@ -206,22 +206,22 @@ void timerbar_switch_type(int num)
LARGE_INTEGER now;
if(QueryPerformanceCounter(&now) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
profiles[timerbar_current_profile].frame_total.QuadPart +=
(now.QuadPart - timerbar_last_start_value.QuadPart);
(now.QuadPart - timerbar_last_start_value.QuadPart);
if(num != -1)
{
// Switch to new profile
timerbar_current_profile = num;
timerbar_current_profile = num;
}
// Update time to count from
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
}
@@ -234,6 +234,6 @@ void timerbar_switch_type(int num)
*/
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
{
draw_func_ptr = new_draw_func_ptr;
draw_func_ptr = new_draw_func_ptr;
}
+4 -9
View File
@@ -157,18 +157,14 @@ static void fireball_set_default_color(int idx)
*
* NOTE: we can't be too trusting here so a tbm will only modify the LOD count, not add an entry
*/
void parse_fireball_tbl(char *filename)
void parse_fireball_tbl(const char *filename)
{
int rval;
lod_checker lod_check;
color fb_color;
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", filename, rval));
lcl_ext_close();
return;
}
@@ -241,9 +237,6 @@ void parse_fireball_tbl(char *filename)
}
required_string("#End");
// close localization
lcl_ext_close();
}
void fireball_parse_tbl()
@@ -381,7 +374,9 @@ void fireball_render(object * obj)
MONITOR_INC( NumFireballsRend, 1 );
num = obj->instance;
memset(&p, 0, sizeof(p));
num = obj->instance;
fb = &Fireballs[num];
if ( Fireballs[num].current_bitmap < 0 )
+2 -2
View File
@@ -14,8 +14,8 @@
#include "globalincs/pstypes.h"
struct object;
struct ship_info;
class object;
class ship_info;
class asteroid_info;
// values correspond to the fireball render types
+1
View File
@@ -58,6 +58,7 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
vm_vec_scale_add( &center, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
memset(verts, 0, sizeof(verts));
if (Warp_glow_bitmap >= 0) {
float r = radius;
+1 -1
View File
@@ -176,7 +176,7 @@ void AltShipClassDlg::alt_class_list_rebuild()
m_alt_class_list.AddString(Ship_info[alt_class_pool[i].ship_class].name);
}
else {
m_alt_class_list.AddString("Invalid Ship Class");
m_alt_class_list.AddString("Invalid Ship Class");
Int3();
}
}
+6 -2
View File
@@ -22,6 +22,7 @@ FictionViewerDlg::FictionViewerDlg(CWnd* pParent /*=NULL*/)
//{{AFX_DATA_INIT(FictionViewerDlg)
m_story_file = _T("");
m_font_file = _T("");
m_voice_file = _T("");
m_fiction_music = 0;
//}}AFX_DATA_INIT
}
@@ -33,6 +34,7 @@ void FictionViewerDlg::DoDataExchange(CDataExchange* pDX)
//{{AFX_DATA_MAP(FictionViewerDlg)
DDX_Text(pDX, IDC_STORY_FILE, m_story_file);
DDX_Text(pDX, IDC_FONT_FILE, m_font_file);
DDX_Text(pDX, IDC_VOICE_FILE, m_voice_file);
DDX_CBIndex(pDX, IDC_FICTION_MUSIC, m_fiction_music);
//}}AFX_DATA_MAP
}
@@ -60,6 +62,7 @@ BOOL FictionViewerDlg::OnInitDialog()
// init variables
m_story_file = _T(fiction_file());
m_font_file = _T(fiction_font());
m_voice_file = _T(fiction_voice());
m_fiction_music = Mission_music[SCORE_FICTION_VIEWER] + 1;
CDialog::OnInitDialog();
@@ -73,7 +76,7 @@ void FictionViewerDlg::OnOK()
// load it up
fiction_viewer_reset();
fiction_viewer_load((char *)(LPCSTR) m_story_file, (char *)(LPCSTR) m_font_file);
fiction_viewer_load((const char *)(LPCSTR)m_story_file, (const char *)(LPCSTR)m_font_file, (const char *)(LPCSTR)m_voice_file);
// set music
Mission_music[SCORE_FICTION_VIEWER] = m_fiction_music - 1;
@@ -111,5 +114,6 @@ void FictionViewerDlg::OnClose()
int FictionViewerDlg::query_modified()
{
return strcmp(m_story_file, fiction_file()) || strcmp(m_font_file, fiction_font()) || m_fiction_music != (Mission_music[SCORE_FICTION_VIEWER] + 1);
return strcmp(m_story_file, fiction_file()) || strcmp(m_font_file, fiction_font()) ||
strcmp(m_voice_file, fiction_voice()) || m_fiction_music != (Mission_music[SCORE_FICTION_VIEWER] + 1);
}
+1
View File
@@ -24,6 +24,7 @@ public:
enum { IDD = IDD_FICTION_VIEWER };
CString m_story_file;
CString m_font_file;
CString m_voice_file;
int m_fiction_music;
//}}AFX_DATA
+9
View File
@@ -233,6 +233,15 @@ void bg_bitmap_dlg::create()
m_skybox_bank = (int) fl_degrees(skybox_angles.b);
m_skybox_heading = (int) fl_degrees(skybox_angles.h);
//make sure angle values are in the 0-359 degree range
if (m_skybox_pitch < 0)
m_skybox_pitch = m_skybox_pitch + 359;
if (m_skybox_bank < 0)
m_skybox_bank = m_skybox_bank + 359;
if (m_skybox_heading < 0)
m_skybox_heading = m_skybox_heading + 359;
for(i=0; i<MAX_NEB2_BITMAPS; i++){
if(strlen(Neb2_bitmap_filenames[i]) > 0){ //-V805
((CComboBox*)GetDlgItem(IDC_NEB2_TEXTURE))->AddString(Neb2_bitmap_filenames[i]);
+53 -10
View File
@@ -76,6 +76,8 @@ briefing_editor_dlg::briefing_editor_dlg(CWnd* pParent /*=NULL*/)
m_cut_prev = FALSE;
m_current_briefing = -1;
m_flipicon = FALSE;
m_use_wing = FALSE;
m_use_cargo = FALSE;
//}}AFX_DATA_INIT
m_voice_id = -1;
m_cur_stage = 0;
@@ -109,6 +111,8 @@ void briefing_editor_dlg::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_CUT_NEXT, m_cut_next);
DDX_Check(pDX, IDC_CUT_PREV, m_cut_prev);
DDX_Check(pDX, IDC_FLIP_ICON, m_flipicon);
DDX_Check(pDX, IDC_USE_WING_ICON, m_use_wing);
DDX_Check(pDX, IDC_USE_CARGO_ICON, m_use_cargo);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_voice, MAX_FILENAME_LEN - 1);
@@ -131,6 +135,7 @@ BEGIN_MESSAGE_MAP(briefing_editor_dlg, CDialog)
ON_BN_CLICKED(IDC_SAVE_VIEW, OnSaveView)
ON_CBN_SELCHANGE(IDC_ICON_IMAGE, OnSelchangeIconImage)
ON_CBN_SELCHANGE(IDC_TEAM, OnSelchangeTeam)
ON_CBN_SELCHANGE(IDC_SHIP_TYPE, OnSelchangeShipType)
ON_BN_CLICKED(IDC_PROPAGATE_ICONS, OnPropagateIcons)
ON_WM_INITMENU()
ON_BN_CLICKED(IDC_LINES, OnLines)
@@ -141,6 +146,8 @@ BEGIN_MESSAGE_MAP(briefing_editor_dlg, CDialog)
ON_BN_CLICKED(IDC_COPY_VIEW, OnCopyView)
ON_BN_CLICKED(IDC_PASTE_VIEW, OnPasteView)
ON_BN_CLICKED(IDC_FLIP_ICON, OnFlipIcon)
ON_BN_CLICKED(IDC_USE_WING_ICON, OnWingIcon)
ON_BN_CLICKED(IDC_USE_CARGO_ICON, OnCargoIcon)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -181,7 +188,7 @@ void briefing_editor_dlg::create()
CDialog::Create(IDD);
theApp.init_window(&Briefing_wnd_data, this);
box = (CComboBox *) GetDlgItem(IDC_ICON_IMAGE);
for (i=0; i<MAX_BRIEF_ICONS; i++)
for (i=0; i<MIN_BRIEF_ICONS; i++)
box->AddString(Icon_names[i]);
box = (CComboBox *) GetDlgItem(IDC_TEAM);
@@ -432,6 +439,7 @@ void briefing_editor_dlg::update_data(int update)
}
strcpy_s(ptr->icons[m_last_icon].label, buf);
if ( m_hilight )
ptr->icons[m_last_icon].flags |= BI_HIGHLIGHT;
else
@@ -442,30 +450,40 @@ void briefing_editor_dlg::update_data(int update)
else
ptr->icons[m_last_icon].flags &= ~BI_MIRROR_ICON;
if (m_use_wing)
ptr->icons[m_last_icon].flags |= BI_USE_WING_ICON;
else
ptr->icons[m_last_icon].flags &= ~BI_USE_WING_ICON;
if (m_use_cargo)
ptr->icons[m_last_icon].flags |= BI_USE_CARGO_ICON;
else
ptr->icons[m_last_icon].flags &= ~BI_USE_CARGO_ICON;
if ((ptr->icons[m_last_icon].type != m_icon_image) && !m_change_local) {
set_modified();
reset_icon_loop(m_last_stage);
while (get_next_icon(m_id))
iconp->type = m_icon_image;
}
ptr->icons[m_last_icon].type = m_icon_image;
if ((ptr->icons[m_last_icon].team != m_icon_team) && !m_change_local) {
set_modified();
reset_icon_loop(m_last_stage);
while (get_next_icon(m_id))
iconp->team = m_icon_team;
}
ptr->icons[m_last_icon].team = m_icon_team;
if ((ptr->icons[m_last_icon].ship_class != m_ship_type) && !m_change_local) {
set_modified();
reset_icon_loop(m_last_stage);
while (get_next_icon(m_id))
iconp->ship_class = m_ship_type;
}
MODIFY(ptr->icons[m_last_icon].ship_class, m_ship_type);
deconvert_multiline_string(buf2, m_icon_text, MAX_ICON_TEXT_LEN);
/*
if (stricmp(ptr->icons[m_last_icon].text, buf2) && !m_change_local) {
@@ -544,6 +562,8 @@ void briefing_editor_dlg::update_data(int update)
if ((m_cur_stage >= 0) && (m_cur_icon >= 0) && (m_cur_icon < ptr->num_icons)) {
m_hilight = (ptr->icons[m_cur_icon].flags & BI_HIGHLIGHT)?1:0;
m_flipicon = (ptr->icons[m_cur_icon].flags & BI_MIRROR_ICON)?1:0;
m_use_wing = (ptr->icons[m_cur_icon].flags & BI_USE_WING_ICON)?1:0;
m_use_cargo = (ptr->icons[m_cur_icon].flags & BI_USE_CARGO_ICON)?1:0;
m_icon_image = ptr->icons[m_cur_icon].type;
m_icon_team = ptr->icons[m_cur_icon].team;
m_icon_label = ptr->icons[m_cur_icon].label;
@@ -555,6 +575,8 @@ void briefing_editor_dlg::update_data(int update)
} else {
m_flipicon = FALSE;
m_hilight = FALSE;
m_use_wing = FALSE;
m_use_cargo = FALSE;
m_icon_image = -1;
m_icon_team = -1;
m_ship_type = -1;
@@ -564,12 +586,23 @@ void briefing_editor_dlg::update_data(int update)
enable = FALSE;
}
// see if icon is overridden by ships.tbl
// if so, disable the icon type box
int sip_bii_ship = (m_ship_type >= 0) ? Ship_info[m_ship_type].bii_index_ship : -1;
int sip_bii_wing = (sip_bii_ship >= 0) ? Ship_info[m_ship_type].bii_index_wing : -1;
int sip_bii_cargo = (sip_bii_ship >= 0) ? Ship_info[m_ship_type].bii_index_ship_with_cargo : -1;
GetDlgItem(IDC_USE_WING_ICON) -> ShowWindow(sip_bii_wing >= 0);
GetDlgItem(IDC_USE_CARGO_ICON) -> ShowWindow(sip_bii_cargo >= 0);
GetDlgItem(IDC_ICON_TEXT) -> EnableWindow(enable);
GetDlgItem(IDC_ICON_LABEL) -> EnableWindow(enable);
GetDlgItem(IDC_ICON_IMAGE) -> EnableWindow(enable);
GetDlgItem(IDC_ICON_IMAGE) -> EnableWindow(enable && (sip_bii_ship < 0));
GetDlgItem(IDC_SHIP_TYPE) -> EnableWindow(enable);
GetDlgItem(IDC_HILIGHT) -> EnableWindow(enable);
GetDlgItem(IDC_FLIP_ICON) -> EnableWindow(enable);
GetDlgItem(IDC_USE_WING_ICON) -> EnableWindow(enable);
GetDlgItem(IDC_USE_CARGO_ICON) -> EnableWindow(enable);
GetDlgItem(IDC_LOCAL) -> EnableWindow(enable);
GetDlgItem(IDC_TEAM) -> EnableWindow(enable);
GetDlgItem(IDC_ID) -> EnableWindow(enable);
@@ -1201,6 +1234,11 @@ void briefing_editor_dlg::OnSelchangeTeam()
update_data(1);
}
void briefing_editor_dlg::OnSelchangeShipType()
{
update_data(1);
}
int briefing_editor_dlg::check_mouse_hit(int x, int y)
{
int i;
@@ -1399,10 +1437,15 @@ void briefing_editor_dlg::OnPasteView()
void briefing_editor_dlg::OnFlipIcon()
{
// if (m_flipicon)
// Briefing->stages[m_cur_stage].icons[m_cur_icon].flags |= BI_MIRROR_ICON;
// else
// Briefing->stages[m_cur_stage].icons[m_cur_icon].flags &= ~BI_MIRROR_ICON;
update_data(1);
}
void briefing_editor_dlg::OnWingIcon()
{
update_data(1);
}
void briefing_editor_dlg::OnCargoIcon()
{
update_data(1);
}
+5
View File
@@ -66,6 +66,8 @@ public:
BOOL m_cut_prev;
int m_current_briefing;
BOOL m_flipicon;
BOOL m_use_wing;
BOOL m_use_cargo;
//}}AFX_DATA
CBitmap m_play_bm;
@@ -120,6 +122,7 @@ protected:
afx_msg void OnSaveView();
afx_msg void OnSelchangeIconImage();
afx_msg void OnSelchangeTeam();
afx_msg void OnSelchangeShipType();
afx_msg void OnPropagateIcons();
afx_msg void OnInitMenu(CMenu* pMenu);
afx_msg void OnLines();
@@ -130,6 +133,8 @@ protected:
afx_msg void OnCopyView();
afx_msg void OnPasteView();
afx_msg void OnFlipIcon();
afx_msg void OnWingIcon();
afx_msg void OnCargoIcon();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
+1 -3
View File
@@ -246,7 +246,6 @@ void campaign_editor::initialize( int init_files )
void campaign_editor::mission_selected(int num)
{
CEdit *bc_dialog, *bc_hall, *bc_persona;
char mainhalltext[10];
char personatext[10];
bc_dialog = (CEdit *) GetDlgItem(IDC_BRIEFING_CUTSCENE);
@@ -259,8 +258,7 @@ void campaign_editor::mission_selected(int num)
bc_dialog->SetWindowText(Campaign.missions[num].briefing_cutscene);
// new main hall stuff
sprintf(mainhalltext, "%s", const_cast<char*>(Campaign.missions[num].main_hall.c_str()));
bc_hall->SetWindowText(CString(mainhalltext));
bc_hall->SetWindowText(Campaign.missions[num].main_hall.c_str());
// new debriefing persona stuff
sprintf(personatext, "%d", Campaign.missions[num].debrief_persona_index);
+28 -25
View File
@@ -20,6 +20,7 @@
#include "cfile/cfile.h"
#include "sound/audiostr.h"
#include "localization/localize.h"
#include "mod_table/mod_table.h"
#ifdef _DEBUG
#undef THIS_FILE
@@ -61,12 +62,12 @@ event_editor::event_editor(CWnd* pParent /*=NULL*/)
m_wave_id = -1;
m_log_true = 0;
m_log_false = 0;
m_log_always_true = 0;
m_log_always_false = 0;
m_log_1st_repeat = 0;
m_log_last_repeat = 0;
m_log_1st_trigger = 0;
m_log_last_trigger = 0;
m_log_state_change = 0;
}
void event_editor::DoDataExchange(CDataExchange* pDX)
@@ -90,12 +91,12 @@ void event_editor::DoDataExchange(CDataExchange* pDX)
DDX_LBIndex(pDX, IDC_MESSAGE_LIST, m_cur_msg);
DDX_Check(pDX, IDC_MISSION_LOG_TRUE, m_log_true);
DDX_Check(pDX, IDC_MISSION_LOG_FALSE, m_log_false);
DDX_Check(pDX, IDC_MISSION_LOG_ALWAYS_TRUE, m_log_always_true);
DDX_Check(pDX, IDC_MISSION_LOG_ALWAYS_FALSE, m_log_always_false);
DDX_Check(pDX, IDC_MISSION_LOG_1ST_REPEAT, m_log_1st_repeat);
DDX_Check(pDX, IDC_MISSION_LOG_LAST_REPEAT, m_log_last_repeat);
DDX_Check(pDX, IDC_MISSION_LOG_1ST_TRIGGER, m_log_1st_trigger);
DDX_Check(pDX, IDC_MISSION_LOG_LAST_TRIGGER, m_log_last_trigger);
DDX_Check(pDX, IDC_MISSION_LOG_STATE_CHANGE, m_log_state_change);
// m_team == -1 maps to 2
@@ -222,21 +223,23 @@ BOOL event_editor::OnInitDialog()
}
}
// add new heads, if not already in
maybe_add_head(box, "Head-TP2");
maybe_add_head(box, "Head-VC2");
maybe_add_head(box, "Head-TP4");
maybe_add_head(box, "Head-TP5");
maybe_add_head(box, "Head-TP6");
maybe_add_head(box, "Head-TP7");
maybe_add_head(box, "Head-TP8");
maybe_add_head(box, "Head-VP2");
maybe_add_head(box, "Head-VP2");
maybe_add_head(box, "Head-CM2");
maybe_add_head(box, "Head-CM3");
maybe_add_head(box, "Head-CM4");
maybe_add_head(box, "Head-CM5");
maybe_add_head(box, "Head-BSH");
if (!Disable_hc_message_ani) {
maybe_add_head(box, "Head-TP2");
maybe_add_head(box, "Head-VC2");
maybe_add_head(box, "Head-TP4");
maybe_add_head(box, "Head-TP5");
maybe_add_head(box, "Head-TP6");
maybe_add_head(box, "Head-TP7");
maybe_add_head(box, "Head-TP8");
maybe_add_head(box, "Head-VP2");
maybe_add_head(box, "Head-VP2");
maybe_add_head(box, "Head-CM2");
maybe_add_head(box, "Head-CM3");
maybe_add_head(box, "Head-CM4");
maybe_add_head(box, "Head-CM5");
maybe_add_head(box, "Head-BSH");
}
/*
box->AddString("Head-VC"); // force it in, since Sandeep wants it and it's not used in built-in messages
@@ -900,8 +903,6 @@ void event_editor::save_event(int e)
m_events[e].mission_log_flags |= MLF_SEXP_TRUE;
if (m_log_false)
m_events[e].mission_log_flags |= MLF_SEXP_FALSE;
if (m_log_always_true)
m_events[e].mission_log_flags |= MLF_SEXP_KNOWN_TRUE;
if (m_log_always_false)
m_events[e].mission_log_flags |= MLF_SEXP_KNOWN_FALSE;
if (m_log_1st_repeat)
@@ -912,6 +913,8 @@ void event_editor::save_event(int e)
m_events[e].mission_log_flags |= MLF_FIRST_TRIGGER_ONLY;
if (m_log_last_trigger)
m_events[e].mission_log_flags |= MLF_LAST_TRIGGER_ONLY;
if (m_log_state_change)
m_events[e].mission_log_flags |= MLF_STATE_CHANGE;
// Search for item to update
@@ -1046,11 +1049,6 @@ void event_editor::update_cur_event()
}else {
m_log_false = FALSE;
}
if (m_events[cur_event].mission_log_flags & MLF_SEXP_KNOWN_TRUE) {
m_log_always_true = TRUE;
}else {
m_log_always_true = FALSE;
}
if (m_events[cur_event].mission_log_flags & MLF_SEXP_KNOWN_FALSE) {
m_log_always_false = TRUE;
}else {
@@ -1076,6 +1074,11 @@ void event_editor::update_cur_event()
}else {
m_log_last_trigger = FALSE;
}
if (m_events[cur_event].mission_log_flags & MLF_STATE_CHANGE) {
m_log_state_change = TRUE;
}else {
m_log_state_change = FALSE;
}
UpdateData(FALSE);
}
@@ -1231,7 +1234,7 @@ int event_editor::save_message(int num)
}
string_copy(m_messages[num].message, m_message_text, MESSAGE_LENGTH - 1);
lcl_fred_replace_stuff(m_messages[num].message, MESSAGE_LENGTH);
lcl_fred_replace_stuff(m_messages[num].message, MESSAGE_LENGTH - 1);
if (m_messages[num].avi_info.name){
free(m_messages[num].avi_info.name);
}
+1 -1
View File
@@ -73,12 +73,12 @@ public:
int m_last_message_node;
int m_log_true;
int m_log_false;
int m_log_always_true;
int m_log_always_false;
int m_log_1st_repeat;
int m_log_last_repeat;
int m_log_1st_trigger;
int m_log_last_trigger;
int m_log_state_change;
//}}AFX_DATA
CBitmap m_play_bm;
+1 -1
View File
@@ -676,7 +676,7 @@ void CFREDApp::record_window_data(window_data *wndd, CWnd *wnd)
void CAboutDlg::OnBug()
{
char *path = "http://mgo.maxgaming.net/mantis/login_page.php";
char *path = "http://scp.indiegames.us/mantis/";
char buffer[MAX_PATH];
sprintf(buffer,"explorer.exe \"%s\"", path);
+234 -221
View File
File diff suppressed because it is too large. Load diff
+1 -85
View File
@@ -79,7 +79,6 @@ BEGIN_MESSAGE_MAP(CFREDDoc, CDocument)
ON_COMMAND(ID_EDIT_UNDO, OnEditUndo)
ON_COMMAND(ID_FILE_PREFERENCES, OnFilePreferences)
ON_COMMAND(ID_FILE_IMPORT_FSM, OnFileImportFSM)
ON_COMMAND(ID_FILE_IMPORT_WEAPONS, OnFileImportWeapons)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -404,7 +403,7 @@ int CFREDDoc::load_mission(char *pathname, int flags)
// fix old ship names for ships in wings if needed
while (j--) {
if ( (Objects[wing_objects[i][j]].type == OBJ_SHIP) || (Objects[wing_objects[i][j]].type == OBJ_START) ) { // don't change player ship names
sprintf(name, "%s %d", Wings[i].name, j + 1);
wing_bash_ship_name(name, Wings[i].name, j + 1);
old_name = Ships[Wings[i].ship_index[j]].ship_name;
if (stricmp(name, old_name)) { // need to fix name
update_sexp_references(old_name, name);
@@ -1015,89 +1014,6 @@ void CFREDDoc::OnFileImportFSM()
recreate_dialogs();
}
void restore_default_weapons(char *ships_tbl);
void CFREDDoc::OnFileImportWeapons()
{
int rval;
CString ships_tbl_mfc;
char ships_tbl[MAX_PATH_LEN];
char *ships_tbl_text;
char *ships_tbl_text_raw;
char *ch;
char temp[MAX_PATH_LEN];
char error_str[1024];
// set up import dialog
CFileDialog dlg(TRUE, "tbl", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR, "FreeSpace Tables (*.tbl)|*.tbl|All files (*.*)|*.*||");
dlg.m_ofn.lpstrTitle = "Specify the ships.tbl with the required loadouts";
// set initial path
strcpy_s(temp, Fred_exe_dir);
if ((ch = stristr(temp, "FreeSpace2")) != NULL)
{
strcpy(ch, "FreeSpace\\Data\\Tables");
dlg.m_ofn.lpstrInitialDir = temp;
}
// get ships.tbl
if (dlg.DoModal() != IDOK)
return;
ships_tbl_mfc = dlg.GetPathName();
if (strlen(ships_tbl_mfc) > MAX_PATH_LEN - 1)
{
MessageBox(NULL, "Path name is too long", "Error", MB_OK);
return;
}
if (!strlen(ships_tbl_mfc))
return;
strcpy_s(ships_tbl, ships_tbl_mfc);
// allocate junk
ships_tbl_text = (char *) malloc(sizeof(char) * MISSION_TEXT_SIZE);
ships_tbl_text_raw = (char *) malloc(sizeof(char) * MISSION_TEXT_SIZE);
if (!ships_tbl_text || !ships_tbl_text_raw)
{
free(ships_tbl_text);
free(ships_tbl_text_raw);
Error(LOCATION, "Not enough memory to import weapons.");
return;
}
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("FREDDOC: Unable to parse '%s'! Error code = %i.\n", ships_tbl, rval));
sprintf(error_str, "Could not parse file: %s", ships_tbl);
MessageBox(NULL, error_str, "Unable to import weapon loadouts!", MB_ICONERROR | MB_OK);
lcl_ext_close();
return;
}
// load the other table and convert, freeing memory after use
read_file_text(ships_tbl, CF_TYPE_ANY, ships_tbl_text, ships_tbl_text_raw);
free(ships_tbl_text_raw);
restore_default_weapons(ships_tbl_text);
free(ships_tbl_text);
// close localization
lcl_ext_close();
// we haven't saved it yet
set_modified(TRUE);
// error check and notify
if (!Fred_view_wnd->global_error_check())
Fred_view_wnd->MessageBox("Weapon loadouts successfully imported with no errors.", "Woohoo!");
}
void CFREDDoc::recreate_dialogs()
{
if(Briefing_dialog)
-1
View File
@@ -89,7 +89,6 @@ protected:
afx_msg void OnFileNew();
afx_msg void editor_init_mission();
afx_msg void OnFileImportFSM();
afx_msg void OnFileImportWeapons();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
+14 -4
View File
@@ -53,6 +53,7 @@
#include "graphics/font.h"
#include "cmdline/cmdline.h"
#include "iff_defs/iff_defs.h"
#include "mod_table/mod_table.h"
extern float flFrametime;
extern subsys_to_render Render_subsys;
@@ -141,7 +142,7 @@ color colour_yellow;
void fred_enable_htl()
{
if (!Briefing_dialog) gr_set_proj_matrix( (4.0f/9.0f) * PI * FRED_DEFAULT_HTL_FOV, gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, 1.0f, FRED_DEAFULT_HTL_DRAW_DIST);
if (Briefing_dialog) gr_set_proj_matrix( (4.0f/9.0f) * PI * FRED_BRIEFING_HTL_FOV, gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, 1.0f, FRED_DEAFULT_HTL_DRAW_DIST);
if (Briefing_dialog) gr_set_proj_matrix( Briefing_window_FOV, gr_screen.aspect*(float)gr_screen.clip_width/(float)gr_screen.clip_height, 1.0f, FRED_DEAFULT_HTL_DRAW_DIST);
gr_set_view_matrix(&Eye_position, &Eye_matrix);
}
@@ -407,7 +408,7 @@ void render_waypoints(void)
vertex v;
SCP_list<waypoint_list>::iterator ii;
SCP_list<waypoint>::iterator jj;
SCP_vector<waypoint>::iterator jj;
for (ii = Waypoint_lists.begin(); ii != Waypoint_lists.end(); ++ii)
{
@@ -1488,7 +1489,11 @@ void render_frame()
gr_set_font(FONT1);
light_reset();
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);
if (Briefing_dialog) {
g3_set_view_matrix(&eye_pos, &eye_orient, Briefing_window_FOV);
} else {
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);
}
Viewer_pos = eye_pos; // for starfield code
fred_enable_htl();
@@ -1593,7 +1598,11 @@ void render_frame()
gr_set_clip(0, 0, True_rw, True_rh);
g3_start_frame(0); // ** Accounted for
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);
if (Briefing_dialog) {
g3_set_view_matrix(&eye_pos, &eye_orient, Briefing_window_FOV);
} else {
g3_set_view_matrix(&eye_pos, &eye_orient, 0.5f);
}
}
void game_do_frame()
@@ -1857,6 +1866,7 @@ void draw_asteroid_field()
int object_check_collision(object *objp, vec3d *p0, vec3d *p1, vec3d *hitpos)
{
mc_info mc;
mc_info_init(&mc);
if ((objp->type == OBJ_NONE) || (objp->type == OBJ_POINT))
return 0;
+3 -3
View File
@@ -31,7 +31,7 @@ int Multi_ping_timestamp = -1;
int Sun_drew = 0;
int Networking_disabled = 0;
void init_ets(struct object*){}
void init_ets(class object*){}
control_info PlayerControls;
@@ -157,7 +157,7 @@ char demo_read_char() { return 0; }
int red_alert_default_status() {return 0;}
void send_ship_kill_packet(struct object *,struct object *,float,unsigned char) {}
void send_ship_kill_packet(class object *,class object *,float,unsigned char) {}
void send_debris_create_packet( object *objp, ushort net_sig, int model_num, vec3d pos) {}
int Game_subspace_effect;
@@ -209,7 +209,7 @@ int game_hacked_data(){return 0;}
int game_single_step;
int last_single_step;
void get_version_string_short(char *){}
void game_tst_mark(struct object *, struct ship *){}
void game_tst_mark(class object *, class ship *){}
int tst;
//int Player_multi_died_check;
int Show_framerate = 0;
+46 -4
View File
@@ -1095,7 +1095,7 @@ void CFREDView::OnLButtonUp(UINT nFlags, CPoint point)
Assert(objp->type == OBJ_SHIP);
ship = objp->instance;
Assert(Ships[ship].wingnum == -1);
sprintf(Ships[ship].ship_name, "%s %d", Wings[Duped_wing].name,
wing_bash_ship_name(Ships[ship].ship_name, Wings[Duped_wing].name,
Wings[Duped_wing].wave_count + 1);
Wings[Duped_wing].ship_index[Wings[Duped_wing].wave_count] = ship;
@@ -2688,6 +2688,46 @@ int CFREDView::global_error_check()
internal_error("Invalid dockee point (\"%s\" initially docked with \"%s\")", Ships[i].ship_name, Ships[ship].ship_name);
}
}
wing = Ships[i].wingnum;
bool is_in_loadout_screen = (ptr->type == OBJ_START);
if (!is_in_loadout_screen && wing >= 0) {
if ( multi && The_mission.game_type & MISSION_TYPE_MULTI_TEAMS )
{
for (n = 0; n < MAX_TVT_WINGS; n++) {
if (!strcmp(Wings[wing].name, TVT_wing_names[n])) {
is_in_loadout_screen = true;
break;
}
}
} else {
for (n = 0; n < MAX_STARTING_WINGS; n++) {
if (!strcmp(Wings[wing].name, Starting_wing_names[n])) {
is_in_loadout_screen = true;
break;
}
}
}
}
if (is_in_loadout_screen) {
int illegal = 0;
z = Ships[i].ship_info_index;
for (n = 0; n < MAX_SHIP_PRIMARY_BANKS; n++){
if (Ships[i].weapons.primary_bank_weapons[n] >= 0 && !Ship_info[z].allowed_weapons[Ships[i].weapons.primary_bank_weapons[n]]){
illegal++;
}
}
for (n = 0; n < MAX_SHIP_SECONDARY_BANKS; n++){
if (Ships[i].weapons.secondary_bank_weapons[n] >= 0 && !Ship_info[z].allowed_weapons[Ships[i].weapons.secondary_bank_weapons[n]]){
illegal++;
}
}
if (illegal && error("%d illegal weapon(s) found on ship \"%s\"", illegal, Ships[i].ship_name)) {
return 1;
}
}
}
}
@@ -2721,7 +2761,7 @@ int CFREDView::global_error_check()
if ((Objects[obj].type == OBJ_SHIP) || (Objects[obj].type == OBJ_START)) {
ship = Objects[obj].instance;
sprintf(buf, "%s %d", Wings[i].name, j + 1);
wing_bash_ship_name(buf, Wings[i].name, j + 1);
if (stricmp(buf, Ships[ship].ship_name)){
return internal_error("Ship \"%s\" in wing should be called \"%s\"", Ships[ship].ship_name, buf);
}
@@ -3267,8 +3307,9 @@ int CFREDView::error(const char *msg, ...)
va_list args;
va_start(args, msg);
vsprintf(buf, msg, args);
vsnprintf(buf, sizeof(buf)-1, msg, args);
va_end(args);
buf[sizeof(buf)-1] = '\0';
g_err = 1;
if (MessageBox(buf, "Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDOK)
@@ -3283,8 +3324,9 @@ int CFREDView::internal_error(const char *msg, ...)
va_list args;
va_start(args, msg);
vsprintf(buf, msg, args);
vsnprintf(buf, sizeof(buf)-1, msg, args);
va_end(args);
buf[sizeof(buf)-1] = '\0';
g_err = 1;
+1 -1
View File
@@ -540,7 +540,7 @@ void initial_status::OnOK()
if (m_team_color_setting.IsWindowEnabled() && m_team_color_setting.GetCurSel() > 0)
Ships[m_ship].team_name = Team_Names[m_team_color_setting.GetCurSel() - 1];
else
Ships[m_ship].team_name = "None";
Ships[m_ship].team_name = "none";
update_docking_info();
+1 -1
View File
@@ -571,7 +571,7 @@ void url_launch(char *url)
r = (int) ShellExecute(NULL, "open", url, NULL, NULL, SW_SHOW);
if (r < 32) {
char *txt = NULL;
const char *txt = NULL;
switch (r) {
case 0: txt = XSTR("The operating system is out of memory or resources.", 1107); break;
+34 -59
View File
@@ -64,6 +64,7 @@
#include "iff_defs/iff_defs.h"
#include "menuui/techmenu.h"
#include "missionui/fictionviewer.h"
#include "mod_table/mod_table.h"
#include <direct.h>
#include "cmdline/cmdline.h"
@@ -72,6 +73,8 @@
#define UNKNOWN_USER "Unknown"
extern void ssm_init(); // Need this to populate Ssm_info so OPF_SSM_CLASS does something. -MageKing17
int cur_wing = -1;
int cur_wing_index;
int cur_object_index = -1;
@@ -253,29 +256,16 @@ void parse_medal_tbl()
}
*/
// an atexit() call!!
void fred_close()
{
if (Fred_texture_replacements != NULL) {
delete[] Fred_texture_replacements;
Fred_texture_replacements = NULL;
}
}
void parse_init(bool basic = false);
void brief_init_colors();
void fred_preload_all_briefing_icons()
{
uint i,j;
for (i = 0; i < Species_info.size(); i++)
for (SCP_vector<briefing_icon_info>::iterator ii = Briefing_icon_info.begin(); ii != Briefing_icon_info.end(); ++ii)
{
for (j = 0; j < MAX_BRIEF_ICONS; j++)
{
generic_anim_load(&Species_info[i].icon_bitmaps[j]);
hud_anim_load(&Species_info[i].icon_fade_anims[j]);
hud_anim_load(&Species_info[i].icon_highlight_anims[j]);
}
generic_anim_load(&ii->regular);
hud_anim_load(&ii->fade);
hud_anim_load(&ii->highlight);
}
}
@@ -321,11 +311,14 @@ bool fred_init()
exit(1);
}
// Load game_settings.tbl
mod_table_init();
// initialize localization module. Make sure this is done AFTER initialzing OS.
// NOTE : Fred should ALWAYS run in English. Otherwise it might swap in another language
// when saving - which would cause inconsistencies when externalizing to tstrings.tbl via Exstr
// trust me on this :)
lcl_init(LCL_ENGLISH);
lcl_init(FS2_OPEN_DEFAULT_LANGUAGE);
// Goober5000 - force init XSTRs (so they work, but only work in English, based on above comment)
extern int Xstr_inited;
@@ -384,10 +377,10 @@ bool fred_init()
iff_init(); // Goober5000
species_init(); // Kazan
brief_parse_icon_tbl();
// for fred specific replacement texture stuff
//Fred_texture_replacements = (texture_replace*) vm_malloc( sizeof(texture_replace) * MAX_SHIPS * MAX_REPLACEMENT_TEXTURES );
Fred_texture_replacements = new texture_replace[MAX_SHIPS*MAX_REPLACEMENT_TEXTURES];
atexit(fred_close);
Fred_texture_replacements.clear();
// Goober5000
for (i = 0; i < MAX_IFFS; i++)
@@ -406,9 +399,7 @@ bool fred_init()
hud_init_comm_orders(); // Goober5000
if (!new_alpha_colors_init()) {
old_alpha_colors_init();
}
alpha_colors_init();
gamesnd_parse_soundstbl(); // needs to be loaded after species stuff but before interface/weapon/ship stuff - taylor
mission_brief_common_init();
@@ -431,14 +422,14 @@ bool fred_init()
create_new_mission();
neb2_init(); // fullneb stuff
stars_init();
ssm_init(); // The game calls this after stars_init(), and we need Ssm_info initialized for OPF_SSM_CLASS. -MageKing17
brief_init_colors();
brief_parse_icon_tbl();
fred_preload_all_briefing_icons(); //phreak. This needs to be done or else the briefing icons won't show up
event_music_init();
fiction_viewer_reset();
cmd_brief_reset();
Show_waypoints = TRUE;
Campaign.filename[0] = 0; // indicate initialized state
mission_campaign_clear();
stars_post_level_init();
@@ -510,8 +501,8 @@ void fix_ship_name(int ship)
int create_ship(matrix *orient, vec3d *pos, int ship_type)
{
// Save the Current Working dir to restore in a minute - fred is being stupid
char pwd[128];
getcwd(pwd, 128); // get the present working dir - probably <fs2path>[/modpapth]/data/missions/
char pwd[MAX_PATH_LEN];
getcwd(pwd, MAX_PATH_LEN); // get the present working dir - probably <fs2path>[/modpapth]/data/missions/
int obj, z1, z2;
@@ -941,8 +932,8 @@ void clear_mission()
event_music_reset_choices();
clear_texture_replacements();
// alternate ship type names
mission_parse_reset_alt();
mission_parse_reset_alt(); // alternate ship type names
mission_parse_reset_callsign();
strcpy(Cargo_names[0], "Nothing");
Num_cargo = 1;
@@ -1365,8 +1356,16 @@ int common_object_delete(int obj)
if(jnp->GetSCPObject() == &Objects[obj])
break;
}
// come on, WMC, we don't want to call obj_delete twice...
// fool the destructor into not calling obj_delete yet
Objects[obj].type = OBJ_NONE;
// now call the destructor
Jump_nodes.erase(jnp);
// now restore the jump node type so that the below unmark and obj_delete will work
Objects[obj].type = OBJ_JUMP_NODE;
}
unmark_object(obj);
@@ -1454,7 +1453,7 @@ int delete_ship_from_wing(int ship)
wing_objects[wing][i] = wing_objects[wing][end];
Wings[wing].ship_index[i] = Wings[wing].ship_index[end];
if (Objects[wing_objects[wing][i]].type == OBJ_SHIP) {
sprintf(name, "%s %d", Wings[wing].name, i + 1);
wing_bash_ship_name(name, Wings[wing].name, i + 1);
rename_ship(Wings[wing].ship_index[i], name);
}
}
@@ -1474,28 +1473,6 @@ int delete_ship_from_wing(int ship)
return 0;
}
// What does this do?
void add_ship_to_wing()
{
int org_object = cur_object_index;
vec3d tvec;
set_cur_object_index();
if (Objects[org_object].type == OBJ_NONE) {
vm_vec_make(&tvec, 10.0f, 10.0f, 10.0f);
create_object(&tvec);
} else {
Objects[cur_object_index] = Objects[org_object];
Objects[cur_object_index].pos.xyz.x += 3.0f;
Objects[cur_object_index].pos.xyz.y += 3.0f;
physics_init(&Objects[cur_object_index].phys_info);
Objects[cur_object_index].orient = Objects[org_object].orient;
}
set_modified();
}
// Return true if current object is valid and is in a wing.
// Else return false.
int query_object_in_wing(int obj)
@@ -1972,7 +1949,7 @@ void ai_update_goal_references(int type, const char *old_name, const char *new_n
ai_update_goal_references(Wings[i].ai_goals, type, old_name, new_name);
}
int query_referenced_in_ai_goals(int type, char *name)
int query_referenced_in_ai_goals(int type, const char *name)
{
int i;
@@ -2642,11 +2619,9 @@ void stuff_special_arrival_anchor_name(char *buf, int anchor_num, int retail_for
// Goober5000
void update_texture_replacements(const char *old_name, const char *new_name)
{
int i;
for (i = 0; i < Fred_num_texture_replacements; i++)
for (SCP_vector<texture_replace>::iterator ii = Fred_texture_replacements.begin(); ii != Fred_texture_replacements.end(); ++ii)
{
if (!stricmp(Fred_texture_replacements[i].ship_name, old_name))
strcpy_s(Fred_texture_replacements[i].ship_name, new_name);
if (!stricmp(ii->ship_name, old_name))
strcpy_s(ii->ship_name, new_name);
}
}
+1 -2
View File
@@ -90,7 +90,6 @@ void delete_marked();
void delete_reinforcement(int num);
int delete_ship_from_wing(int ship = cur_ship);
int find_free_wing();
void add_ship_to_wing();
int query_object_in_wing(int obj = cur_object_index);
void mark_object(int obj);
void unmark_object(int obj);
@@ -114,7 +113,7 @@ int get_ship_from_obj(int obj);
int get_ship_from_obj(object *objp);
void set_valid_dock_points(int ship, int type, CComboBox *box);
void ai_update_goal_references(int type, const char *old_name, const char *new_name);
int query_referenced_in_ai_goals(int type, char *name);
int query_referenced_in_ai_goals(int type, const char *name);
int advanced_stricmp(char *one, char *two);
int reference_handler(char *name, int type, int obj);
int orders_reference_handler(int code, char *msg);
+18
View File
@@ -72,6 +72,8 @@ CMissionNotesDlg::CMissionNotesDlg(CWnd* pParent /*=NULL*/) : CDialog(CMissionNo
m_autpilot_cinematics = FALSE;
m_no_autpilot = FALSE;
m_2d_mission = FALSE;
m_always_show_goals = FALSE;
m_end_to_mainhall = FALSE;
m_max_hull_repair_val = 0.0f;
m_max_subsys_repair_val = 100.0f;
m_contrail_threshold = CONTRAIL_THRESHOLD_DEFAULT;
@@ -122,6 +124,8 @@ void CMissionNotesDlg::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_USE_AUTOPILOT_CINEMATICS, m_autpilot_cinematics);
DDX_Check(pDX, IDC_2D_MISSION, m_2d_mission);
DDX_Check(pDX, IDC_DEACTIVATE_AUTOPILOT, m_no_autpilot);
DDX_Check(pDX, IDC_ALWAYS_SHOW_GOALS, m_always_show_goals);
DDX_Check(pDX, IDC_END_TO_MAINHALL, m_end_to_mainhall);
DDX_Text(pDX, IDC_MAX_HULL_REPAIR_VAL, m_max_hull_repair_val);
DDV_MinMaxFloat(pDX, m_max_hull_repair_val, 0, 100);
DDX_Text(pDX, IDC_MAX_SUBSYS_REPAIR_VAL, m_max_subsys_repair_val);
@@ -346,6 +350,19 @@ void CMissionNotesDlg::OnOK()
} else {
The_mission.flags &= ~MISSION_FLAG_DEACTIVATE_AP;
}
// always show mission goals
if ( m_always_show_goals ) {
The_mission.flags |= MISSION_FLAG_ALWAYS_SHOW_GOALS;
} else {
The_mission.flags &= ~MISSION_FLAG_ALWAYS_SHOW_GOALS;
}
if ( m_end_to_mainhall ) {
The_mission.flags |= MISSION_FLAG_END_TO_MAINHALL;
} else {
The_mission.flags &= ~MISSION_FLAG_END_TO_MAINHALL;
}
if ( flags != The_mission.flags ){
set_modified();
@@ -437,6 +454,7 @@ BOOL CMissionNotesDlg::OnInitDialog()
m_autpilot_cinematics = (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) ? 1 : 0;
m_2d_mission = (The_mission.flags & MISSION_FLAG_2D_MISSION) ? 1 : 0;
m_no_autpilot = (The_mission.flags & MISSION_FLAG_DEACTIVATE_AP) ? 1 : 0;
m_always_show_goals = (The_mission.flags & MISSION_FLAG_ALWAYS_SHOW_GOALS) ? 1 : 0;
m_loading_640=_T(The_mission.loading_screen[GR_640]);
m_loading_1024=_T(The_mission.loading_screen[GR_1024]);
+2
View File
@@ -63,6 +63,8 @@ public:
BOOL m_autpilot_cinematics;
BOOL m_no_autpilot;
BOOL m_2d_mission;
BOOL m_always_show_goals;
BOOL m_end_to_mainhall;
float m_max_hull_repair_val;
float m_max_subsys_repair_val;
BOOL m_contrail_threshold_flag;
+132 -88
View File
@@ -133,10 +133,10 @@ int CFred_mission_save::save_mission_file(char *pathname)
err = -3;
// else if (save_briefing_info())
// err = -4;
else if (save_fiction())
err = -3;
else if (save_cutscenes())
err = -4;
else if (save_fiction())
err = -3;
else if (save_cmd_briefs())
err = -4;
else if (save_briefing())
@@ -384,13 +384,13 @@ int CFred_mission_save::save_mission_info()
fout(" %d", The_mission.num_respawns);
if ( Format_fs2_open != FSO_FORMAT_RETAIL ) {
fso_comment_push(";;FSO 3.6.11;;");
if (optional_string_fred("+Max Respawn Time:"))
parse_comments(2);
else {
fso_comment_push(";;FSO 3.6.11;;");
fout_version("\n+Max Respawn Time:");
fso_comment_pop();
}
fso_comment_pop();
fout(" %d", The_mission.max_respawn_delay);
}
@@ -561,29 +561,29 @@ int CFred_mission_save::save_mission_info()
if (period != NULL)
*period = 0;
fso_comment_push(";;FSO 3.6.0;;");
if (optional_string_fred("$Skybox Model:")) {
parse_comments(2);
fout(" %s.pof", out_str);
} else {
fso_comment_push(";;FSO 3.6.0;;");
fout_version("\n\n$Skybox Model: %s.pof", out_str);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.0;; $Skybox Model:");
}
// orientation?
if ((strlen(The_mission.skybox_model) > 0) && !vm_matrix_same(&vmd_identity_matrix, &The_mission.skybox_orientation)) {
fso_comment_push(";;FSO 3.6.14;;");
if (optional_string_fred("+Skybox Orientation:")) {
parse_comments(1);
save_matrix(The_mission.skybox_orientation);
} else {
fso_comment_push(";;FSO 3.6.14;;");
fout_version("\n+Skybox Orientation:");
save_matrix(The_mission.skybox_orientation);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.14;; +Skybox Orientation:");
}
@@ -591,14 +591,14 @@ int CFred_mission_save::save_mission_info()
// are skybox flags in use?
if (The_mission.skybox_flags != DEFAULT_NMODEL_FLAGS) {
//char out_str[4096];
fso_comment_push(";;FSO 3.6.11;;");
if (optional_string_fred("+Skybox Flags:")) {
parse_comments(1);
fout( " %d", The_mission.skybox_flags);
} else {
fso_comment_push(";;FSO 3.6.11;;");
fout_version("\n+Skybox Flags: %d", The_mission.skybox_flags);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.11;; +Skybox Flags:");
}
@@ -607,14 +607,14 @@ int CFred_mission_save::save_mission_info()
int profile_index = (The_mission.ai_profile - Ai_profiles);
Assert(profile_index >= 0 && profile_index < MAX_AI_PROFILES);
fso_comment_push(";;FSO 3.6.9;;");
if (optional_string_fred("$AI Profile:")) {
parse_comments(2);
fout(" %s", The_mission.ai_profile->profile_name);
} else {
fso_comment_push(";;FSO 3.6.9;;");
fout_version("\n\n$AI Profile: %s", The_mission.ai_profile->profile_name);
fso_comment_pop();
}
fso_comment_pop();
// sound environment (EFX/EAX) - taylor
sound_env *m_env = &The_mission.sound_environment;
@@ -714,7 +714,7 @@ int CFred_mission_save::save_cutscenes()
}
for (uint i = 0; i < The_mission.cutscenes.size(); i++) {
if ( strlen(The_mission.cutscenes[i].cutscene_name) ) {
if ( strlen(The_mission.cutscenes[i].filename) ) {
// determine the name of this cutscene type
switch (The_mission.cutscenes[i].type) {
case MOVIE_PRE_FICTION:
@@ -742,10 +742,10 @@ int CFred_mission_save::save_cutscenes()
if (optional_string_fred(type)) {
parse_comments();
fout(" %s", The_mission.cutscenes[i].cutscene_name);
fout(" %s", The_mission.cutscenes[i].filename);
}
else {
fout_version("%s %s\n", type, The_mission.cutscenes[i].cutscene_name);
fout_version("%s %s\n", type, The_mission.cutscenes[i].filename);
}
required_string_fred("+formula:");
@@ -795,6 +795,18 @@ int CFred_mission_save::save_fiction()
}
else
optional_string_fred("$Font:");
// save voice
if (strlen(fiction_voice()) > 0) //-V805
{
if (optional_string_fred("$Voice:"))
parse_comments();
else
fout("\n$Voice:");
fout(" %s", fiction_voice());
}
else
optional_string_fred("$Voice:");
}
else
{
@@ -993,6 +1005,13 @@ int CFred_mission_save::save_briefing()
fout(" %d", (bi->flags & BI_MIRROR_ICON)?1:0 );
}
if ((Format_fs2_open != FSO_FORMAT_RETAIL) && (bi->flags & BI_USE_WING_ICON))
{
required_string_fred("$use wing icon:");
parse_comments();
fout(" %d", (bi->flags & BI_USE_WING_ICON)?1:0 );
}
required_string_fred("$multi_text");
parse_comments();
@@ -1165,6 +1184,13 @@ int CFred_mission_save::save_players()
int var_idx;
int used_pool[MAX_WEAPON_TYPES];
if (optional_string_fred("#Alternate Types:")) { // Make sure the parser doesn't get out of sync
required_string_fred("#end");
}
if (optional_string_fred("#Callsigns:")) {
required_string_fred("#end");
}
// write out alternate name list
if(Mission_alt_type_count > 0){
fout("\n\n#Alternate Types:\n");
@@ -1351,7 +1377,7 @@ void CFred_mission_save::save_single_dock_instance(ship *shipp, dock_instance *d
int CFred_mission_save::save_objects()
{
SCP_string sexp_out;
int i, j, k, z;
int i, j, z;
ai_info *aip;
object *objp;
ship *shipp;
@@ -1385,22 +1411,19 @@ int CFred_mission_save::save_objects()
//alt classes stuff
if (Format_fs2_open != FSO_FORMAT_RETAIL) {
if ((int)shipp->s_alt_classes.size()) {
for (k = 0; k < (int)shipp->s_alt_classes.size() ; k++) {
// is this a variable?
if (shipp->s_alt_classes[k].variable_index != -1) {
fout_version("\n;;FSO 3.6.10;; $Alt Ship Class: @%s", Sexp_variables[shipp->s_alt_classes[k].variable_index].variable_name);
}
else {
fout_version("\n;;FSO 3.6.10;; $Alt Ship Class: \"%s\"", Ship_info[shipp->s_alt_classes[k].ship_class].name);
}
// default class?
if (shipp->s_alt_classes[k].default_to_this_class) {
fout_version("\n;;FSO 3.6.10;; +Default Class:");
}
for (SCP_vector<alt_class>::iterator ii = shipp->s_alt_classes.begin(); ii != shipp->s_alt_classes.end(); ++ii) {
// is this a variable?
if (ii->variable_index != -1) {
fout("\n$Alt Ship Class: @%s", Sexp_variables[ii->variable_index].variable_name);
}
else {
fout("\n$Alt Ship Class: \"%s\"", Ship_info[ii->ship_class].name);
}
// default class?
if (ii->default_to_this_class) {
fout("\n+Default Class:");
}
}
}
@@ -1724,6 +1747,10 @@ int CFred_mission_save::save_objects()
fout(" \"ship-locked\"");
if (shipp->flags2 & SF2_WEAPONS_LOCKED)
fout(" \"weapons-locked\"");
if (shipp->flags2 & SF2_SCRAMBLE_MESSAGES)
fout(" \"scramble-messages\"");
if (!(objp->flags & OF_COLLIDES))
fout(" \"no-collide\"");
fout(" )");
}
// -----------------------------------------------------------
@@ -1743,6 +1770,7 @@ int CFred_mission_save::save_objects()
// special explosions
if (Format_fs2_open != FSO_FORMAT_RETAIL) {
if (shipp->use_special_explosion) {
fso_comment_push(";;FSO 3.6.13;;");
if (optional_string_fred("$Special Explosion:", "$Name:")) {
parse_comments();
@@ -1768,7 +1796,7 @@ int CFred_mission_save::save_objects()
fout(" %d", shipp->special_exp_shockwave_speed);
}
else {
bypass_comment(";;FSO 3.6.13;; +Special Exp Shockwave Speed:");
bypass_comment(";;FSO 3.6.13;; +Special Exp Shockwave Speed:", "$Name:");
}
if (shipp->special_exp_deathroll_time > 0) {
@@ -1777,11 +1805,10 @@ int CFred_mission_save::save_objects()
fout(" %d", shipp->special_exp_deathroll_time);
}
else {
bypass_comment(";;FSO 3.6.13;; +Special Exp Death Roll Time:");
bypass_comment(";;FSO 3.6.13;; +Special Exp Death Roll Time:", "$Name:");
}
}
else {
fso_comment_push(";;FSO 3.6.13;;");
fout_version("\n$Special Explosion:");
fout_version("\n+Special Exp Damage:");
@@ -1806,12 +1833,12 @@ int CFred_mission_save::save_objects()
fout(" %d", shipp->special_exp_deathroll_time);
}
fso_comment_pop();
}
fso_comment_pop();
}
else {
bypass_comment(";;FSO 3.6.13;; +Special Exp Shockwave Speed:");
bypass_comment(";;FSO 3.6.13;; +Special Exp Death Roll Time:");
bypass_comment(";;FSO 3.6.13;; +Special Exp Shockwave Speed:", "$Name:");
bypass_comment(";;FSO 3.6.13;; +Special Exp Death Roll Time:", "$Name:");
}
}
// retail format special explosions
@@ -1839,33 +1866,33 @@ int CFred_mission_save::save_objects()
if (Format_fs2_open != FSO_FORMAT_RETAIL)
{
if (shipp->special_hitpoints) {
fso_comment_push(";;FSO 3.6.13;;");
if (optional_string_fred("+Special Hitpoints:", "$Name:")) {
parse_comments();
} else {
fso_comment_push(";;FSO 3.6.13;;");
fout_version("\n+Special Hitpoints:");
fso_comment_pop();
}
fso_comment_pop();
fout(" %d", shipp->special_hitpoints);
}
else {
bypass_comment(";;FSO 3.6.13;; +Special Hitpoints:");
bypass_comment(";;FSO 3.6.13;; +Special Hitpoints:", "$Name:");
}
if (shipp->special_shield >= 0) {
fso_comment_push(";;FSO 3.6.13;;");
if (optional_string_fred("+Special Shield Points:", "$Name:")) {
parse_comments();
} else {
fso_comment_push(";;FSO 3.6.13;;");
fout_version("\n+Special Shield Points:");
fso_comment_pop();
}
fso_comment_pop();
fout(" %d", shipp->special_shield);
}
else {
bypass_comment(";;FSO 3.6.13;; +Special Shield Points:");
bypass_comment(";;FSO 3.6.13;; +Special Shield Points:", "$Name:");
}
}
// -----------------------------------------------------------
@@ -1964,16 +1991,16 @@ int CFred_mission_save::save_objects()
// always write out the score to ensure backwards compatibility. If the score is the same as the value
// in the table write out a flag to tell the game to simply use whatever is in the table instead
if (Ship_info[shipp->ship_info_index].score == shipp->score ) {
fso_comment_push(";;FSO 3.6.10;;");
if ( optional_string_fred("+Use Table Score:", "$Name:") ) {
parse_comments();
} else {
fso_comment_push(";;FSO 3.6.10;;");
fout_version("\n+Use Table Score:");
fso_comment_pop();
}
fso_comment_pop();
}
else {
bypass_comment(";;FSO 3.6.10;; +Use Table Score:");
bypass_comment(";;FSO 3.6.10;; +Use Table Score:", "$Name:");
}
if (optional_string_fred("+Score:", "$Name:"))
@@ -1985,18 +2012,18 @@ int CFred_mission_save::save_objects()
if (Format_fs2_open != FSO_FORMAT_RETAIL && shipp->assist_score_pct != 0) {
fso_comment_push(";;FSO 3.6.10;;");
if ( optional_string_fred("+Assist Score Percentage:") ) {
parse_comments();
} else {
fso_comment_push(";;FSO 3.6.10;;");
fout_version("\n+Assist Score Percentage:");
fso_comment_pop();
}
fso_comment_pop();
fout(" %f", shipp->assist_score_pct);
}
else {
bypass_comment(";;FSO 3.6.10;; +Assist Score Percentage:");
bypass_comment(";;FSO 3.6.10;; +Assist Score Percentage:", "$Name:");
}
// deal with the persona for this ship as well.
@@ -2010,17 +2037,16 @@ int CFred_mission_save::save_objects()
}
// Goober5000 - deal with texture replacement ----------------
k = 0;
if (Fred_num_texture_replacements > 0) {
if (!Fred_texture_replacements.empty()) {
bool needs_header = true;
fso_comment_push(";;FSO 3.6.8;;");
while (k < Fred_num_texture_replacements) {
if ( !stricmp(shipp->ship_name, Fred_texture_replacements[k].ship_name) ) {
for (SCP_vector<texture_replace>::iterator ii = Fred_texture_replacements.begin(); ii != Fred_texture_replacements.end(); ++ii) {
if ( !stricmp(shipp->ship_name, ii->ship_name) ) {
if (needs_header) {
if (optional_string_fred("$Texture Replace:")) {
parse_comments(1);
} else {
fso_comment_push(";;FSO 3.6.8;;");
fout_version("\n$Texture Replace:");
}
@@ -2030,25 +2056,23 @@ int CFred_mission_save::save_objects()
// write out this entry
if (optional_string_fred("+old:")) {
parse_comments(1);
fout(" %s", Fred_texture_replacements[k].old_texture);
fout(" %s", ii->old_texture);
} else {
fout_version("\n+old: %s", Fred_texture_replacements[k].old_texture);
fout_version("\n+old: %s", ii->old_texture);
}
if (optional_string_fred("+new:")) {
parse_comments(1);
fout(" %s", Fred_texture_replacements[k].new_texture);
fout(" %s", ii->new_texture);
} else {
fout_version("\n+new: %s", Fred_texture_replacements[k].new_texture);
fout_version("\n+new: %s", ii->new_texture);
}
}
k++; // increment down the list of texture replacements
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.8;; $Texture Replace:");
bypass_comment(";;FSO 3.6.8;; $Texture Replace:", "$Name:");
}
// end of texture replacement -------------------------------
@@ -2665,7 +2689,7 @@ int CFred_mission_save::save_waypoints()
int CFred_mission_save::save_waypoint_list(waypoint_list *wp_list)
{
Assert(wp_list != NULL);
SCP_list<waypoint>::iterator ii;
SCP_vector<waypoint>::iterator ii;
for (ii = wp_list->get_waypoints().begin(); ii != wp_list->get_waypoints().end(); ++ii)
{
@@ -2769,11 +2793,16 @@ int CFred_mission_save::save_matrix(matrix &m)
// Goober5000 - move past the comment without copying it to the output file
// (used for special FSO comment tags)
void CFred_mission_save::bypass_comment(char *comment)
void CFred_mission_save::bypass_comment(const char *comment, const char *end)
{
char *ch = strstr(raw_ptr, comment);
if (ch != NULL)
{
if (end != NULL) {
char *ep = strstr(raw_ptr, end);
if (ep != NULL && ep < ch)
return;
}
char *writep = ch;
char *readp = strchr(writep, '\n');
@@ -2795,6 +2824,7 @@ void CFred_mission_save::parse_comments(int newlines)
{
char *comment_start = NULL;
int state = 0, same_line = 0, first_comment = 1, tab = 0, flag = 0;
bool version_added = false;
if (newlines < 0) {
newlines = -newlines;
@@ -2808,12 +2838,13 @@ void CFred_mission_save::parse_comments(int newlines)
while (newlines-- > 0)
fout("\n");
if (tab)
if (tab && token_found)
fout_version("\t%s", token_found);
else if (token_found)
fout_version("%s", token_found);
else if (tab)
fout("\t");
if (token_found)
fout("%s", token_found);
return;
}
@@ -2826,12 +2857,19 @@ void CFred_mission_save::parse_comments(int newlines)
fout("\n");
if (tab) {
fout("\t");
fout_version("\t");
fout("%s", token_found);
} else {
fout("%s", token_found);
fout_version("%s", token_found);
}
// If you have a bunch of lines that all start with the same token (like, say, "+Subsystem:"),
// this makes it so it won't just repeatedly match the first one. -MageKing17
raw_ptr++;
if (version_added)
fso_comment_pop();
return;
}
@@ -2855,9 +2893,9 @@ void CFred_mission_save::parse_comments(int newlines)
s_num = 3;
}
if ( (s_num == 3) && (major <= FS_VERSION_MAJOR) && (minor <= FS_VERSION_MINOR) && (build <= FS_VERSION_BUILD) ) {
if ( (s_num == 3) && ((major < FS_VERSION_MAJOR) || ((major == FS_VERSION_MAJOR) && ((minor < FS_VERSION_MINOR) || ((minor == FS_VERSION_MINOR) && (build <= FS_VERSION_BUILD))))) ) {
state = 3;
} else if ( (s_num == 4) && (major <= FS_VERSION_MAJOR) && (minor <= FS_VERSION_MINOR) && (build <= FS_VERSION_BUILD) && (revis <= FS_VERSION_REVIS) ) {
} else if ( (s_num == 4) && ((major < FS_VERSION_MAJOR) || ((major == FS_VERSION_MAJOR) && ((minor < FS_VERSION_MINOR) || ((minor == FS_VERSION_MINOR) && ((build < FS_VERSION_BUILD) || ((build == FS_VERSION_BUILD) && (revis <= FS_VERSION_REVIS))))))) ) {
state = 3;
} else {
state = 4;
@@ -2923,7 +2961,10 @@ void CFred_mission_save::parse_comments(int newlines)
if ( (*raw_ptr == ';') && (raw_ptr[1] == ';') && (state == 3) ) {
state = raw_ptr[2];
raw_ptr[2] = 0;
fso_comment_pop();
if (version_added)
fso_comment_pop();
else
version_added = true;
fso_comment_push(comment_start);
raw_ptr[2] = (char)state;
state = first_comment = flag = 0;
@@ -2934,6 +2975,9 @@ void CFred_mission_save::parse_comments(int newlines)
raw_ptr++;
}
if (version_added)
fso_comment_pop();
return;
}
@@ -3336,13 +3380,13 @@ int CFred_mission_save::save_events()
}
if (Format_fs2_open != FSO_FORMAT_RETAIL && Mission_events[i].trigger_count != 1 ) {
fso_comment_push(";;FSO 3.6.11;;");
if ( optional_string_fred("+Trigger Count:", "$Formula:")){
parse_comments();
} else {
fso_comment_push(";;FSO 3.6.11;;");
fout_version("\n+Trigger Count:");
fso_comment_pop();
}
fso_comment_pop();
fout(" %d", Mission_events[i].trigger_count);
}
@@ -3407,13 +3451,13 @@ int CFred_mission_save::save_events()
}
if (Format_fs2_open != FSO_FORMAT_RETAIL && Mission_events[i].mission_log_flags != 0 ) {
fso_comment_push(";;FSO 3.6.11;;");
if ( optional_string_fred("+Event Log Flags: (", "$Formula:")){
parse_comments();
} else {
fso_comment_push(";;FSO 3.6.11;;");
fout_version("\n+Event Log Flags: (");
fso_comment_pop();
}
fso_comment_pop();
for (j = 0; j < MAX_MISSION_EVENT_LOG_FLAGS ; j++) {
add_flag = 1 << j;
@@ -3563,10 +3607,10 @@ int CFred_mission_save::save_bitmaps()
bool tag = (i < Num_backgrounds - 1);
background_t *background = &Backgrounds[i];
fso_comment_push(";;FSO 3.6.9;;");
if (optional_string_fred("$Bitmap List:")) {
parse_comments(2);
} else {
fso_comment_push(";;FSO 3.6.9;;");
fout_version("\n\n$Bitmap List:");
}
@@ -3632,14 +3676,14 @@ int CFred_mission_save::save_bitmaps()
// taylor's environment map thingy
if (strlen(The_mission.envmap_name) > 0) { //-V805
fso_comment_push(";;FSO 3.6.9;;");
if (optional_string_fred("$Environment Map:")) {
parse_comments(2);
fout(" %s", The_mission.envmap_name);
} else {
fso_comment_push(";;FSO 3.6.9;;");
fout_version("\n\n$Environment Map: %s", The_mission.envmap_name);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.9;; $Environment Map:");
}
@@ -3758,14 +3802,14 @@ int CFred_mission_save::save_music()
// Goober5000 - save using the special comment prefix
if (stricmp(The_mission.substitute_event_music_name, "None")) {
fso_comment_push(";;FSO 3.6.9;;");
if (optional_string_fred("$Substitute Event Music:")) {
parse_comments(1);
fout(" %s", The_mission.substitute_event_music_name);
} else {
fso_comment_push(";;FSO 3.6.9;;");
fout_version("\n$Substitute Event Music: %s", The_mission.substitute_event_music_name);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.9;; $Substitute Event Music:");
}
@@ -3779,14 +3823,14 @@ int CFred_mission_save::save_music()
// Goober5000 - save using the special comment prefix
if (stricmp(The_mission.substitute_briefing_music_name, "None")) {
fso_comment_push(";;FSO 3.6.9;;");
if (optional_string_fred("$Substitute Briefing Music:")) {
parse_comments(1);
fout(" %s", The_mission.substitute_briefing_music_name);
} else {
fso_comment_push(";;FSO 3.6.9;;");
fout_version("\n$Substitute Briefing Music: %s", The_mission.substitute_briefing_music_name);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.9;; $Substitute Briefing Music:");
}
@@ -3822,14 +3866,14 @@ int CFred_mission_save::save_music()
// Goober5000 - save using the special comment prefix
if (mission_has_fiction() && Mission_music[SCORE_FICTION_VIEWER] >= 0) {
fso_comment_push(";;FSO 3.6.11;;");
if (optional_string_fred("$Fiction Viewer Music:")) {
parse_comments(1);
fout(" %s", Spooled_music[Mission_music[SCORE_FICTION_VIEWER]].name);
} else {
fso_comment_push(";;FSO 3.6.11;;");
fout_version("\n$Fiction Viewer Music: %s", Spooled_music[Mission_music[SCORE_FICTION_VIEWER]].name);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.11;; $Fiction Viewer Music:");
}
@@ -4026,14 +4070,14 @@ int CFred_mission_save::save_campaign_file(char *pathname)
}
if ( Campaign.missions[m].debrief_persona_index > 0 ) {
fso_comment_push(";;FSO 3.6.8;;");
if (optional_string_fred("+Debriefing Persona Index:")) {
parse_comments(1);
fout(" %d", Campaign.missions[m].debrief_persona_index);
} else {
fso_comment_push(";;FSO 3.6.8;;");
fout_version("\n+Debriefing Persona Index: %d", Campaign.missions[m].debrief_persona_index);
fso_comment_pop();
}
fso_comment_pop();
} else {
bypass_comment(";;FSO 3.6.8;; +Debriefing Persona Index:");
}
@@ -4212,10 +4256,10 @@ void CFred_mission_save::fso_comment_push(char *ver)
elem1 = elem2 = 3;
}
if ( (elem1 == 3) && ((major > in_major) || (minor > in_minor) || (build > in_build)) ) {
if ( (elem1 == 3) && ((major > in_major) || ((major == in_major) && ((minor > in_minor) || ((minor == in_minor) && (build > in_build))))) ) {
// the push'd version is older than our current version, so just push a copy of the previous version
fso_ver_comment.push_back( before );
} else if ( (elem1 == 4) && ((major > in_major) || (minor > in_minor) || (build > in_build) || (revis > in_revis)) ) {
} else if ( (elem1 == 4) && ((major > in_major) || ((major == in_major) && ((minor > in_minor) || ((minor == in_minor) && ((build > in_build) || ((build == in_build) || (revis > in_revis))))))) ) {
// the push'd version is older than our current version, so just push a copy of the previous version
fso_ver_comment.push_back( before );
} else {
+1 -1
View File
@@ -80,7 +80,7 @@ public:
void fso_comment_pop(bool pop_all = false);
// Goober5000
void bypass_comment(char *comment);
void bypass_comment(const char *comment, const char *end = NULL);
};
#endif
+2
View File
@@ -65,7 +65,9 @@ BEGIN_MESSAGE_MAP(player_start_editor, CDialog)
//{{AFX_MSG_MAP(player_start_editor)
ON_WM_INITMENU()
ON_LBN_SELCHANGE(IDC_SHIP_LIST, OnSelchangeShipList)
ON_CLBN_CHKCHANGE(IDC_SHIP_LIST, OnSelchangeShipList)
ON_LBN_SELCHANGE(IDC_WEAPON_LIST, OnSelchangeWeaponList)
ON_CLBN_CHKCHANGE(IDC_SHIP_LIST, OnSelchangeWeaponList)
ON_EN_UPDATE(IDC_SHIP_POOL, OnUpdateShipPool)
ON_EN_UPDATE(IDC_WEAPON_POOL, OnUpdateWeaponPool)
ON_LBN_SELCHANGE(IDC_SHIP_VARIABLES_LIST, OnSelchangeShipVariablesList)
+12 -3
View File
@@ -963,6 +963,7 @@
#define IDC_MAX_RESPAWN_DELAY_SPIN 1487
#define IDC_NAV_NEEDSLINK 1488
#define IDC_OBJ_TEAM 1489
#define IDC_SCRAMBLE_MESSAGES 1489
#define IDC_CAMPAIGN_TYPE 1491
#define IDC_SUPPORT_ALLOWED 1492
#define IDC_SUBSPACE 1493
@@ -1056,7 +1057,11 @@
#define IDC_USE_AUTOPILOT_CINEMATICS 1547
#define IDC_2D_MISSION 1548
#define IDC_LABEL1 1549
#define IDC_2D_MISSION2 1549
#define IDC_ALWAYS_SHOW_GOALS 1549
#define IDC_LABEL2 1550
#define IDC_ALWAYS_SHOW_GOALS2 1550
#define IDC_END_TO_MAINHALL 1550
#define IDC_NEW_TEXTURE 1551
#define IDC_TEXTURES 1552
#define IDC_OLD_TEXTURE_LIST 1553
@@ -1109,8 +1114,10 @@
#define IDC_FLIP_ICON 1578
#define IDC_DISABLE_BUILTIN_SHIP 1579
#define IDC_OTHER 1579
#define IDC_USE_WING_ICON 1579
#define IDC_DISABLE_BUILTIN_COMMAND_MSGS 1580
#define IDC_LBL_OTHER_SUFFIX 1580
#define IDC_USE_CARGO_ICON 1580
#define IDC_PRIMARIES_LOCKED 1581
#define IDC_EXPORT 1581
#define IDC_SECONDARIES_LOCKED 1582
@@ -1147,6 +1154,8 @@
#define IDC_FONT_FILE 1619
#define IDC_FICTION_MUSIC 1620
#define IDC_SOUND_ENVIRONMENT_LABEL 1621
#define IDC_FONT_FILE2 1621
#define IDC_VOICE_FILE 1621
#define IDC_SOUND_ENVIRONMENT_VOLUME_LABEL 1622
#define IDC_SOUND_ENVIRONENT_DAMPING_LABEL 1623
#define IDC_SOUND_ENVIRONMENT_DECAY_LABEL 1624
@@ -1164,12 +1173,13 @@
#define IDC_NEB_FAR_MULTIPLIER 1634
#define IDC_MISSION_LOG_TRUE 1635
#define IDC_MISSION_LOG_FALSE 1636
#define IDC_MISSION_LOG_ALWAYS_TRUE 1637
#define IDC_MISSION_LOG_STATE_CHANGE 1637
#define IDC_MISSION_LOG_ALWAYS_FALSE 1638
#define IDC_MISSION_LOG_1ST_REPEAT 1639
#define IDC_MISSION_LOG_LAST_REPEAT 1640
#define IDC_MISSION_LOG_1ST_TRIGGER 1641
#define IDC_MISSION_LOG_LAST_TRIGGER 1642
#define IDC_NO_COLLIDE 1643
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1434,7 +1444,6 @@
#define ID_FORMAT_FS1_RETAIL 33072
#define ID_EDITORS_SET_GLOBAL_SHIP_FLAGS 33073
#define ID_FILE_IMPORT_FSM 33074
#define ID_FILE_IMPORT_WEAPONS 33075
#define ID_VIEW_LIGHTING 33079
#define ID_EDITORS_VOICE 33080
#define ID_SHOW_IFF_0 33081
@@ -1463,7 +1472,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
#define _APS_NEXT_CONTROL_VALUE 1643
#define _APS_NEXT_CONTROL_VALUE 1644
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
+147 -87
View File
@@ -96,7 +96,7 @@ sexp_tree::sexp_tree()
}
// clears out the tree, so all the nodes are unused.
void sexp_tree::clear_tree(char *op)
void sexp_tree::clear_tree(const char *op)
{
mprintf(("Resetting dynamic tree node limit from %d to %d...\n", tree_nodes.size(), 0));
@@ -121,7 +121,7 @@ void sexp_tree::reset_handles()
}
// initializes and creates a tree from a given sexp startpoint.
void sexp_tree::load_tree(int index, char *deflt)
void sexp_tree::load_tree(int index, const char *deflt)
{
int cur;
@@ -440,7 +440,7 @@ void sexp_tree::free_node2(int node)
}
// initialize the data for a node. Should be called right after a new node is allocated.
void sexp_tree::set_node(int node, int type, char *text)
void sexp_tree::set_node(int node, int type, const char *text)
{
Assert(type != SEXPT_UNUSED);
Assert(tree_nodes[node].type != SEXPT_UNUSED);
@@ -532,7 +532,7 @@ void sexp_tree::add_sub_tree(int node, HTREEITEM root)
}
// construct tree nodes for an sexp, adding them to the list and returning first node
int sexp_tree::load_sub_tree(int index, bool valid, char *text)
int sexp_tree::load_sub_tree(int index, bool valid, const char *text)
{
int cur;
@@ -719,6 +719,12 @@ void sexp_tree::right_clicked(int mode)
type = tree_nodes[first_arg].type;
}
}
// Goober5000 - certain types accept both integers and a list of strings
if (op_type == OPF_GAME_SND || op_type == OPF_WEAPON_BANK_NUMBER)
{
type = SEXPT_NUMBER | SEXPT_STRING;
}
if ( (type & SEXPT_STRING) || (type & SEXPT_NUMBER) ) {
@@ -741,7 +747,8 @@ void sexp_tree::right_clicked(int mode)
if ( Sexp_variables[idx].type & SEXP_VARIABLE_STRING ) {
flag &= ~MF_GRAYED;
}
} else if ( type & SEXPT_NUMBER ) {
}
if ( type & SEXPT_NUMBER ) {
if ( Sexp_variables[idx].type & SEXP_VARIABLE_NUMBER ) {
flag &= ~MF_GRAYED;
}
@@ -823,12 +830,16 @@ void sexp_tree::right_clicked(int mode)
case OP_GRANT_MEDAL:
case OP_TECH_ADD_SHIP:
case OP_TECH_ADD_WEAPON:
case OP_TECH_ADD_INTEL:
case OP_TECH_ADD_INTEL_XSTR:
case OP_TECH_RESET_TO_DEFAULT:
#endif*/
// unlike the above operators, these are deprecated
case OP_HITS_LEFT_SUBSYSTEM:
case OP_CUTSCENES_SHOW_SUBTITLE:
case OP_ORDER:
case OP_TECH_ADD_INTEL:
case OP_HUD_GAUGE_SET_ACTIVE:
case OP_HUD_ACTIVATE_GAUGE_TYPE:
j = Num_op_menus; // don't allow these operators to be visible
break;
}
@@ -861,12 +872,16 @@ void sexp_tree::right_clicked(int mode)
case OP_GRANT_MEDAL:
case OP_TECH_ADD_SHIP:
case OP_TECH_ADD_WEAPON:
case OP_TECH_ADD_INTEL:
case OP_TECH_ADD_INTEL_XSTR:
case OP_TECH_RESET_TO_DEFAULT:
#endif*/
// unlike the above operators, these are deprecated
case OP_HITS_LEFT_SUBSYSTEM:
case OP_CUTSCENES_SHOW_SUBTITLE:
case OP_ORDER:
case OP_TECH_ADD_INTEL:
case OP_HUD_GAUGE_SET_ACTIVE:
case OP_HUD_ACTIVATE_GAUGE_TYPE:
j = Num_submenus; // don't allow these operators to be visible
break;
}
@@ -1091,15 +1106,20 @@ void sexp_tree::right_clicked(int mode)
} else if (type == OPF_NULL) { // takes operator that doesn't return a value
replace_type = OPR_NULL;
// Goober5000
} else if (type == OPF_FLEXIBLE_ARGUMENT) {
replace_type = OPR_FLEXIBLE_ARGUMENT;
} else if (type == OPF_AI_GOAL) {
replace_type = OPR_AI_GOAL;
}
// Goober5000
else if (type == OPF_FLEXIBLE_ARGUMENT) {
replace_type = OPR_FLEXIBLE_ARGUMENT;
}
// Goober5000
else if (type == OPF_GAME_SND || type == OPF_WEAPON_BANK_NUMBER) {
// enable number even though we are also going to default to string
menu.EnableMenuItem(ID_REPLACE_NUMBER, MF_ENABLED);
}
// default to string
if (replace_type == OPR_STRING) {
menu.EnableMenuItem(ID_REPLACE_STRING, MF_ENABLED);
@@ -1392,7 +1412,7 @@ int sexp_tree::query_node_argument_type(int node)
int sexp_tree::end_label_edit(TVITEMA &item)
{
HTREEITEM h = item.hItem;
char *str = item.pszText;
char *str = item.pszText;
int len, r = 1;
bool update_node = true;
uint node;
@@ -1421,12 +1441,12 @@ int sexp_tree::end_label_edit(TVITEMA &item)
Assert(node < tree_nodes.size());
if (tree_nodes[node].type & SEXPT_OPERATOR) {
str = match_closest_operator(str, node);
if (!str) return 0; // Goober5000 - avoids crashing
const char *op = match_closest_operator(str, node);
if (!op) return 0; // Goober5000 - avoids crashing
SetItemText(h, str);
SetItemText(h, op);
item_index = node;
int op_num = get_operator_index(str);
int op_num = get_operator_index(op);
if (op_num >= 0 ) {
add_or_replace_operator(op_num, 1);
}
@@ -1478,10 +1498,10 @@ int sexp_tree::end_label_edit(TVITEMA &item)
// number of it. What operators are valid is determined by 'node', and an operator is valid
// if it is allowed to fit at position 'node'
//
char *sexp_tree::match_closest_operator(char *str, int node)
const char *sexp_tree::match_closest_operator(const char *str, int node)
{
int z, i, op, arg_num, opf, opr;
char *sub_best = NULL, *best = NULL;
const char *sub_best = NULL, *best = NULL;
z = tree_nodes[node].parent;
if (z < 0) {
@@ -2069,7 +2089,7 @@ void sexp_list_item::set_op(int op_num)
// initialize node, type data
// Defaults: t = SEXPT_STRING
//
void sexp_list_item::set_data(char *str, int t)
void sexp_list_item::set_data(const char *str, int t)
{
op = -1;
text = str;
@@ -2079,7 +2099,7 @@ void sexp_list_item::set_data(char *str, int t)
// initialize node, type data, allocating memory for the text
// Defaults: t = SEXPT_STRING
//
void sexp_list_item::set_data_dup(char *str, int t)
void sexp_list_item::set_data_dup(const char *str, int t)
{
op = -1;
text = strdup(str);
@@ -2105,7 +2125,7 @@ void sexp_list_item::add_op(int op_num)
// add a node to end of list
// Defaults: t = SEXPT_STRING
//
void sexp_list_item::add_data(char *str, int t)
void sexp_list_item::add_data(const char *str, int t)
{
sexp_list_item *item, *ptr;
@@ -2158,7 +2178,7 @@ void sexp_list_item::destroy()
while (ptr) {
ptr2 = ptr->next;
if (ptr->flags & SEXP_ITEM_F_DUP)
free(ptr->text);
free((void *) ptr->text);
delete ptr;
ptr = ptr2;
@@ -2174,8 +2194,7 @@ int sexp_tree::add_default_operator(int op, int argnum)
h = item_handle;
index = item_index;
item.text = buf;
if (get_default_value(&item, op, argnum))
if (get_default_value(&item, buf, op, argnum))
return -1;
if (item.type & SEXPT_OPERATOR) {
@@ -2195,7 +2214,9 @@ int sexp_tree::add_default_operator(int op, int argnum)
(argnum == 2 && Operators[op].value == OP_STRING_CONCATENATE) ||
(argnum == 1 && Operators[op].value == OP_INT_TO_STRING) ||
(argnum == 3 && Operators[op].value == OP_STRING_GET_SUBSTRING) ||
(argnum == 4 && Operators[op].value == OP_STRING_SET_SUBSTRING))
(argnum == 4 && Operators[op].value == OP_STRING_SET_SUBSTRING) ||
(argnum == 1 && Operators[op].value == OP_COPY_VARIABLE_FROM_INDEX) ||
(argnum == 1 && Operators[op].value == OP_SCRIPT_EVAL_STRING))
{
int sexp_var_index = get_index_sexp_variable_name(item.text);
@@ -2217,8 +2238,7 @@ int sexp_tree::add_default_operator(int op, int argnum)
char buf2[256];
Assert(argnum == 1);
sexp_list_item temp_item;
temp_item.text = buf2;
get_default_value(&temp_item, op, 0);
get_default_value(&temp_item, buf2, op, 0);
int sexp_var_index = get_index_sexp_variable_name(temp_item.text);
Assert(sexp_var_index != -1);
@@ -2242,7 +2262,7 @@ int sexp_tree::add_default_operator(int op, int argnum)
return 0;
}
int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
int sexp_tree::get_default_value(sexp_list_item *item, char *text_buf, int op, int i)
{
char *str = NULL;
int type, index;
@@ -2312,9 +2332,6 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
case 7:
temp = 100;
break;
case 10:
temp = SND_SHIP_EXPLODE_1;
break;
case 11:
temp = (int)EMP_DEFAULT_INTENSITY;
break;
@@ -2343,12 +2360,6 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
case 7:
temp = 10;
break;
case 8:
temp = SND_CAPITAL_WARP_IN;
break;
case 9:
temp = SND_CAPITAL_WARP_OUT;
break;
default:
temp = 0;
break;
@@ -2411,6 +2422,32 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
}
return 0;
// Goober5000 - special cases that used to be numbers but are now hybrids
case OPF_GAME_SND:
int sound_index = -1;
if ( (Operators[op].value == OP_EXPLOSION_EFFECT) )
{
sound_index = SND_SHIP_EXPLODE_1;
}
else if ( (Operators[op].value == OP_WARP_EFFECT) )
{
sound_index = (i == 8) ? SND_CAPITAL_WARP_IN : SND_CAPITAL_WARP_OUT;
}
if (sound_index >= 0)
{
game_snd *snd = &Snds[sound_index];
if (can_construe_as_integer(snd->name.c_str()))
item->set_data(snd->name.c_str(), (SEXPT_NUMBER | SEXPT_VALID));
else
item->set_data(snd->name.c_str(), (SEXPT_STRING | SEXPT_VALID));
return 0;
}
// if no hardcoded default, just use the listing default
break;
}
list = get_listing_opf(type, index, i);
@@ -2425,20 +2462,24 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
list = list->next;
if (first_ptr->flags & SEXP_ITEM_F_DUP)
free(first_ptr->text);
free((void *) first_ptr->text);
delete first_ptr;
}
if (list) {
char *ptr;
ptr = item->text;
if (list)
{
// copy the information from the list to the passed-in item
*item = *list;
item->text = ptr;
strcpy(item->text, list->text);
// but use the provided text buffer
strcpy(text_buf, list->text);
item->text = text_buf;
// get rid of the list, since we're done with it
list->destroy();
item->next = NULL;
return 0;
}
@@ -2623,6 +2664,7 @@ int sexp_tree::query_default_argument_available(int op, int i)
case OPF_FLEXIBLE_ARGUMENT:
case OPF_ANYTHING:
case OPF_SKYBOX_MODEL_NAME:
case OPF_SKYBOX_FLAGS:
case OPF_SHIP_OR_NONE:
case OPF_SUBSYSTEM_OR_NONE:
case OPF_SHIP_WING_POINT_OR_NONE:
@@ -2649,6 +2691,9 @@ int sexp_tree::query_default_argument_available(int op, int i)
case OPF_ANIMATION_TYPE:
case OPF_SHIP_FLAG:
case OPF_NEBULA_PATTERN:
case OPF_NAV_POINT:
case OPF_TEAM_COLOR:
case OPF_GAME_SND:
return 1;
case OPF_SHIP:
@@ -2687,10 +2732,7 @@ int sexp_tree::query_default_argument_available(int op, int i)
return 0;
case OPF_PERSONA:
if (Num_personas)
return 1;
return 0;
return (Num_personas > 0) ? 1 : 0;
case OPF_POINT:
case OPF_WAYPOINT_PATH:
@@ -2752,29 +2794,13 @@ int sexp_tree::query_default_argument_available(int op, int i)
return 0;
case OPF_VARIABLE_NAME:
if (sexp_variable_count() > 0) {
return 1;
} else {
return 0;
}
case OPF_NAV_POINT:
return 1;
return (sexp_variable_count() > 0) ? 1 : 0;
case OPF_SSM_CLASS:
if (Ssm_info_count > 0)
return 1;
else
return 0;
return (Ssm_info_count > 0) ? 1 : 0;
case OPF_MISSION_MOOD:
if (Builtin_moods.empty())
return 0;
else
return 1;
case OPF_TEAM_COLOR:
return 1;
return Builtin_moods.empty() ? 0 : 1;
default:
Int3();
@@ -2845,7 +2871,7 @@ void sexp_tree::merge_operator(int node)
}
// add a data node under operator pointed to by item_index
int sexp_tree::add_data(char *data, int type)
int sexp_tree::add_data(const char *data, int type)
{
int node;
@@ -2860,7 +2886,7 @@ int sexp_tree::add_data(char *data, int type)
}
// add a (variable) data node under operator pointed to by item_index
int sexp_tree::add_variable_data(char *data, int type)
int sexp_tree::add_variable_data(const char *data, int type)
{
int node;
@@ -2877,7 +2903,7 @@ int sexp_tree::add_variable_data(char *data, int type)
// add an operator under operator pointed to by item_index. Updates item_index to point
// to this new operator.
void sexp_tree::add_operator(char *op, HTREEITEM h)
void sexp_tree::add_operator(const char *op, HTREEITEM h)
{
int node;
@@ -3089,7 +3115,7 @@ int sexp_tree::verify_tree(int node, int *bypass)
*/
// display an error message and position to point of error (a node)
int sexp_tree::node_error(int node, char *msg, int *bypass)
int sexp_tree::node_error(int node, const char *msg, int *bypass)
{
char text[512];
@@ -3249,7 +3275,8 @@ void sexp_tree::verify_and_fix_arguments(int node)
(arg_num == 2 && Operators[op].value == OP_STRING_CONCATENATE) ||
(arg_num == 1 && Operators[op].value == OP_INT_TO_STRING) ||
(arg_num == 3 && Operators[op].value == OP_STRING_GET_SUBSTRING) ||
(arg_num == 4 && Operators[op].value == OP_STRING_SET_SUBSTRING))
(arg_num == 4 && Operators[op].value == OP_STRING_SET_SUBSTRING) ||
(arg_num == 1 && Operators[op].value == OP_COPY_VARIABLE_FROM_INDEX))
{
// make text_ptr to start - before '('
get_variable_name_from_sexp_tree_node_text(tree_nodes[item_index].text, default_variable_text);
@@ -3365,7 +3392,7 @@ void sexp_tree::verify_and_fix_arguments(int node)
flag--;
}
void sexp_tree::replace_data(char *data, int type)
void sexp_tree::replace_data(const char *data, int type)
{
int node;
HTREEITEM h;
@@ -3429,7 +3456,7 @@ void sexp_tree::replace_variable_data(int var_idx, int type)
void sexp_tree::replace_operator(char *op)
void sexp_tree::replace_operator(const char *op)
{
int node;
HTREEITEM h;
@@ -3826,7 +3853,7 @@ HTREEITEM sexp_tree::handle(int node)
return tree_nodes[node].handle;
}
char *sexp_tree::help(int code)
const char *sexp_tree::help(int code)
{
int i;
@@ -3863,7 +3890,7 @@ int sexp_tree::get_type(HTREEITEM h)
void sexp_tree::update_help(HTREEITEM h)
{
char *str;
const char *str;
int i, j, z, c, code, index, sibling_place;
CString text;
@@ -3917,14 +3944,14 @@ void sexp_tree::update_help(HTREEITEM h)
char buffer[10240] = {""};
//Get the help for the current operator
char *helpstr = help(code);
const char *helpstr = help(code);
bool display_number = true;
//If a help string exists, try to display it
if(helpstr != NULL)
{
char searchstr[32];
char *loc=NULL, *loc2=NULL;
const char *loc=NULL, *loc2=NULL;
if(loc == NULL)
{
@@ -4022,7 +4049,7 @@ void sexp_tree::update_help(HTREEITEM h)
// find list of sexp_tree nodes with text
// stuff node indices into find[]
int sexp_tree::find_text(char *text, int *find)
int sexp_tree::find_text(const char *text, int *find)
{
uint i;
int find_count;
@@ -4335,6 +4362,10 @@ sexp_list_item *sexp_tree::get_listing_opf(int opf, int parent_node, int arg_ind
list = get_listing_opf_skybox_model();
break;
case OPF_SKYBOX_FLAGS:
list = get_listing_opf_skybox_flags();
break;
case OPF_BACKGROUND_BITMAP:
list = get_listing_opf_background_bitmap();
break;
@@ -4435,6 +4466,10 @@ sexp_list_item *sexp_tree::get_listing_opf(int opf, int parent_node, int arg_ind
list = get_listing_opf_nebula_patterns();
break;
case OPF_GAME_SND:
list = get_listing_opf_game_snds();
break;
default:
Int3(); // unknown OPF code
list = NULL;
@@ -5628,12 +5663,13 @@ sexp_list_item *sexp_tree::get_listing_opf_medal_name()
int i;
sexp_list_item head;
for (i=0; i<MAX_ASSIGNABLE_MEDALS; i++)
for (i=0; i<Num_medals; i++)
{
// don't add Rank or the Ace badges
if ((i == Rank_medal_index) || (Medals[i].kills_needed > 0))
continue;
head.add_data(Medals[i].name);
// also add SOC crest (index 17) and Wings (index 13)
head.add_data(Medals[13].name);
head.add_data(Medals[17].name);
}
return head.next;
}
@@ -5778,6 +5814,17 @@ sexp_list_item *sexp_tree::get_listing_opf_skybox_model()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_skybox_flags()
{
sexp_list_item head;
int i;
for (i = 0; i < Num_skybox_flags; ++i) {
head.add_data(Skybox_flags[i]);
}
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_background_bitmap()
{
sexp_list_item head;
@@ -5785,7 +5832,7 @@ sexp_list_item *sexp_tree::get_listing_opf_background_bitmap()
for (i=0; i < stars_get_num_entries(false, true); i++)
{
head.add_data( (char*)stars_get_name_FRED(i, false) );
head.add_data( stars_get_name_FRED(i, false) );
}
return head.next;
@@ -5798,7 +5845,7 @@ sexp_list_item *sexp_tree::get_listing_opf_sun_bitmap()
for (i=0; i < stars_get_num_entries(true, true); i++)
{
head.add_data( (char*)stars_get_name_FRED(i, true) );
head.add_data( stars_get_name_FRED(i, true) );
}
return head.next;
@@ -5974,7 +6021,20 @@ sexp_list_item *sexp_tree::get_listing_opf_nebula_patterns()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_game_snds()
{
sexp_list_item head;
head.add_data(SEXP_NONE_STRING);
for (SCP_vector<game_snd>::iterator iter = Snds.begin(); iter != Snds.end(); ++iter) {
if (!can_construe_as_integer(iter->name.c_str())) {
head.add_data(iter->name.c_str());
}
}
return head.next;
}
// Deletes sexp_variable from sexp_tree.
// resets tree to not include given variable, and resets text and type
+25 -20
View File
@@ -97,19 +97,22 @@ class sexp_list_item
public:
int type;
int op;
char *text;
const char *text;
int flags;
sexp_list_item *next;
sexp_list_item() : flags(0), next(NULL) {}
void set_op(int op_num);
void set_data(char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void set_data_dup(char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void set_data(const char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void set_data_dup(const char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void add_op(int op_num);
void add_data(char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void add_data(const char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void add_data_dup(const char *str, int t = (SEXPT_STRING | SEXPT_VALID));
void add_list(sexp_list_item *list);
void shallow_copy(const sexp_list_item *src);
void destroy();
};
@@ -118,19 +121,19 @@ class sexp_tree : public CTreeCtrl
public:
sexp_tree();
int find_text(char *text, int *find);
int find_text(const char *text, int *find);
int query_restricted_opf_range(int opf);
void verify_and_fix_arguments(int node);
void post_load();
void update_help(HTREEITEM h);
char *help(int code);
const char *help(int code);
HTREEITEM insert(LPCTSTR lpszItem, int image = BITMAP_ROOT, int sel_image = BITMAP_ROOT, HTREEITEM hParent = TVI_ROOT, HTREEITEM hInsertAfter = TVI_LAST);
HTREEITEM handle(int node);
int get_type(HTREEITEM h);
void setup(CEdit *ptr = NULL);
int query_false(int node = -1);
int add_default_operator(int op, int argnum);
int get_default_value(sexp_list_item *item, int op, int i);
int get_default_value(sexp_list_item *item, char *text_buf, int op, int i);
int query_default_argument_available(int op);
int query_default_argument_available(int op, int i);
void swap_roots(HTREEITEM one, HTREEITEM two);
@@ -139,13 +142,13 @@ public:
void copy_branch(HTREEITEM source, HTREEITEM parent = TVI_ROOT, HTREEITEM after = TVI_LAST);
void setup_selected(HTREEITEM h = NULL);
void add_or_replace_operator(int op, int replace_flag = 0);
void replace_one_arg_operator(char *op, char *data, int type);
void replace_operator(char *op);
void replace_data(char *data, int type);
// void replace_one_arg_operator(const char *op, const char *data, int type);
void replace_operator(const char *op);
void replace_data(const char *data, int type);
void replace_variable_data(int var_idx, int type);
void link_modified(int *ptr);
void ensure_visible(int node);
int node_error(int node, char *msg, int *bypass);
int node_error(int node, const char *msg, int *bypass);
void expand_branch(HTREEITEM h);
void expand_operator(int node);
void merge_operator(int node);
@@ -156,23 +159,23 @@ public:
void right_clicked(int mode = 0);
int ctree_size;
virtual void build_tree();
void set_node(int index, int type, char *text);
void set_node(int index, int type, const char *text);
void free_node(int node, int cascade = 0);
int allocate_node(int parent, int after = -1);
int allocate_node();
int find_free_node();
void clear_tree(char *op = NULL);
void clear_tree(const char *op = NULL);
void reset_handles();
int save_tree(int node = -1);
void load_tree(int index, char *deflt = "true");
void add_one_arg_operator(char *op, char *data, int type);
void add_operator(char *op, HTREEITEM h = TVI_ROOT);
int add_data(char *data, int type);
int add_variable_data(char *data, int type);
void load_tree(int index, const char *deflt = "true");
void add_one_arg_operator(const char *op, const char *data, int type);
void add_operator(const char *op, HTREEITEM h = TVI_ROOT);
int add_data(const char *data, int type);
int add_variable_data(const char *data, int type);
void add_sub_tree(int node, HTREEITEM root);
int load_sub_tree(int index, bool valid, char *text);
int load_sub_tree(int index, bool valid, const char *text);
void hilite_item(int node);
char *match_closest_operator(char *str, int node);
const char *match_closest_operator(const char *str, int node);
void delete_sexp_tree_variable(const char *var_name);
void modify_sexp_tree_variable(const char *old_name, int sexp_var_index);
int get_item_index_to_var_index();
@@ -233,6 +236,7 @@ public:
sexp_list_item *get_listing_opf_variable_names();
sexp_list_item *get_listing_opf_variable_type();
sexp_list_item *get_listing_opf_skybox_model();
sexp_list_item *get_listing_opf_skybox_flags();
sexp_list_item *get_listing_opf_background_bitmap();
sexp_list_item *get_listing_opf_sun_bitmap();
sexp_list_item *get_listing_opf_nebula_storm_type();
@@ -272,6 +276,7 @@ public:
sexp_list_item *get_listing_opf_ship_flags();
sexp_list_item *get_listing_opf_team_colors();
sexp_list_item *get_listing_opf_nebula_patterns();
sexp_list_item *get_listing_opf_game_snds();
int m_mode;
int item_index;
+2 -2
View File
@@ -471,7 +471,7 @@ void ship_select::OnSelchangeWingList()
if (z != wing_sel_last[i]) {
waypoint_list *wp_list = find_waypoint_list_at_index(wing_index[i]);
Assert(wp_list != NULL);
SCP_list<waypoint>::iterator jj;
SCP_vector<waypoint>::iterator jj;
for (j = 0, jj = wp_list->get_waypoints().begin(); jj != wp_list->get_waypoints().end(); ++j, ++jj) {
for (k=0; k<list_size; k++) {
if ((obj_index[k]->type == OBJ_WAYPOINT) && (obj_index[k]->instance == calc_waypoint_instance(wing_index[i], j))) {
@@ -518,7 +518,7 @@ void ship_select::OnSelchangeShipList()
for (i=wlist_size; i<wplist_size; i++) {
waypoint_list *wp_list = find_waypoint_list_at_index(wing_index[i]);
Assert(wp_list != NULL);
SCP_list<waypoint>::iterator jj;
SCP_vector<waypoint>::iterator jj;
count = 0;
for (j = 0, jj = wp_list->get_waypoints().begin(); jj != wp_list->get_waypoints().end(); ++j, ++jj) {
+17 -25
View File
@@ -1164,7 +1164,7 @@ int CShipEditorDlg::update_data(int redraw)
break;
Assert(i < Wings[wing].wave_count);
sprintf(old_name, "%s %d", Wings[wing].name, i + 1);
wing_bash_ship_name(old_name, Wings[wing].name, i + 1);
if (strcmp(old_name, m_ship_name)) {
if (bypass_errors)
return 0;
@@ -2037,7 +2037,7 @@ void CShipEditorDlg::OnSpecialExp()
// alternate ship name stuff
void CShipEditorDlg::ship_alt_name_init(int base_ship)
{
int idx;
int idx, sel_idx;
CComboBox *ptr = (CComboBox*)GetDlgItem(IDC_SHIP_ALT);
if(ptr == NULL){
Int3();
@@ -2054,21 +2054,17 @@ void CShipEditorDlg::ship_alt_name_init(int base_ship)
// reset the combobox and add all relevant strings
ptr->ResetContent();
ptr->AddString("<none>");
sel_idx = (base_ship < 0 || !strlen(Fred_alt_names[base_ship])) ? -1 : -2;
for(idx=0; idx<Mission_alt_type_count; idx++){
ptr->AddString(Mission_alt_types[idx]);
if (sel_idx == -2 && !strcmp(Mission_alt_types[idx], Fred_alt_names[base_ship])) {
sel_idx = idx;
}
}
Assertion(sel_idx >= -1, "Alt name exists but can't be found in Mission_alt_types; get a coder!\n");
// "none"
if(base_ship < 0){
ptr->SetCurSel(0);
}
// otherwise look his stuff up
if(strlen(Fred_alt_names[base_ship])){
ptr->SelectString(0, Fred_alt_names[base_ship]);
} else {
ptr->SetCurSel(0);
}
sel_idx += 1;
ptr->SetCurSel(sel_idx);
}
void CShipEditorDlg::ship_alt_name_close(int base_ship)
@@ -2137,7 +2133,7 @@ void CShipEditorDlg::ship_alt_name_close(int base_ship)
// callsign stuff
void CShipEditorDlg::ship_callsign_init(int base_ship)
{
int idx;
int idx, sel_idx;
CComboBox *ptr = (CComboBox*)GetDlgItem(IDC_SHIP_CALLSIGN);
if(ptr == NULL){
Int3();
@@ -2154,21 +2150,17 @@ void CShipEditorDlg::ship_callsign_init(int base_ship)
// reset the combobox and add all relevant strings
ptr->ResetContent();
ptr->AddString("<none>");
sel_idx = (base_ship < 0 || !strlen(Fred_callsigns[base_ship])) ? -1 : -2;
for(idx=0; idx<Mission_callsign_count; idx++){
ptr->AddString(Mission_callsigns[idx]);
if (sel_idx == -2 && !strcmp(Mission_callsigns[idx], Fred_callsigns[base_ship])) {
sel_idx = idx;
}
}
Assertion(sel_idx >= -1, "Callsign exists but can't be found in Mission_callsigns; get a coder!\n");
// "none"
if(base_ship < 0){
ptr->SetCurSel(0);
}
// otherwise look his stuff up
if(strlen(Fred_callsigns[base_ship])){
ptr->SelectString(0, Fred_callsigns[base_ship]);
} else {
ptr->SetCurSel(0);
}
sel_idx += 1;
ptr->SetCurSel(sel_idx);
}
void CShipEditorDlg::ship_callsign_close(int base_ship)
+63 -4
View File
@@ -74,7 +74,9 @@ void ship_flags_dlg::DoDataExchange(CDataExchange* pDX)
DDX_Control(pDX, IDC_HIDE_SHIP_NAME, m_hide_ship_name);
DDX_Control(pDX, IDC_DISABLE_ETS, m_disable_ets);
DDX_Control(pDX, IDC_CLOAKED, m_cloaked);
DDX_Control(pDX, IDC_NO_COLLIDE, m_no_collide);
DDX_Control(pDX, IDC_SET_CLASS_DYNAMICALLY, m_set_class_dynamically);
DDX_Control(pDX, IDC_SCRAMBLE_MESSAGES, m_scramble_messages);
//}}AFX_DATA_MAP
if (pDX->m_bSaveAndValidate) { // get dialog control values
@@ -138,6 +140,8 @@ BEGIN_MESSAGE_MAP(ship_flags_dlg, CDialog)
ON_BN_CLICKED(IDC_SET_CLASS_DYNAMICALLY, OnSetClassDynamically)
ON_BN_CLICKED(IDC_DISABLE_ETS, OnDisableETS)
ON_BN_CLICKED(IDC_CLOAKED, OnCloaked)
ON_BN_CLICKED(IDC_SCRAMBLE_MESSAGES, OnScrambleMessages)
ON_BN_CLICKED(IDC_NO_COLLIDE, OnNoCollide)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -158,8 +162,8 @@ BOOL ship_flags_dlg::OnInitDialog()
int hidden_from_sensors = 0, primitive_sensors = 0, no_subspace_drive = 0, affected_by_gravity = 0;
int toggle_subsystem_scanning = 0, scannable = 0, kamikaze = 0, no_dynamic = 0, red_alert_carry = 0;
int special_warpin = 0, disable_messages = 0, guardian = 0, vaporize = 0, stealth = 0, friendly_stealth_invisible = 0;
int no_death_scream = 0, always_death_scream = 0;
int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0;
int no_death_scream = 0, always_death_scream = 0, scramble_messages = 0;
int nav_carry = 0, nav_needslink = 0, hide_ship_name = 0, set_class_dynamically = 0, no_ets = 0, cloaked = 0, no_collide = 0;
object *objp;
ship *shipp;
@@ -207,6 +211,8 @@ BOOL ship_flags_dlg::OnInitDialog()
hide_ship_name = (shipp->flags2 & SF2_HIDE_SHIP_NAME) ? 1 : 0;
no_ets = (shipp->flags2 & SF2_NO_ETS) ? 1 : 0;
cloaked = (shipp->flags2 & SF2_CLOAKED) ? 1 : 0;
scramble_messages = (shipp->flags2 & SF2_SCRAMBLE_MESSAGES) ? 1 : 0;
no_collide = (objp->flags & OF_COLLIDES) ? 0 : 1;
destroy_before_mission = (shipp->flags & SF_KILL_BEFORE_MISSION) ? 1 : 0;
m_destroy_value.init(shipp->final_death_time);
@@ -266,6 +272,8 @@ BOOL ship_flags_dlg::OnInitDialog()
hide_ship_name = tristate_set(shipp->flags2 & SF2_HIDE_SHIP_NAME, hide_ship_name);
no_ets = tristate_set(shipp->flags2 & SF2_NO_ETS, no_ets);
cloaked = tristate_set(shipp->flags2 & SF2_CLOAKED, cloaked);
scramble_messages = tristate_set(shipp->flags2 & SF2_SCRAMBLE_MESSAGES, scramble_messages);
no_collide = tristate_set(!(objp->flags & OF_COLLIDES), no_collide);
// check the final death time and set the internal variable according to whether or not
// the final_death_time is set. Also, the value in the edit box must be set if all the
@@ -339,6 +347,8 @@ BOOL ship_flags_dlg::OnInitDialog()
m_hide_ship_name.SetCheck(hide_ship_name);
m_disable_ets.SetCheck(no_ets);
m_cloaked.SetCheck(cloaked);
m_scramble_messages.SetCheck(scramble_messages);
m_no_collide.SetCheck(no_collide);
m_kdamage.setup(IDC_KDAMAGE, this);
m_destroy_value.setup(IDC_DESTROY_VALUE, this);
@@ -956,6 +966,22 @@ void ship_flags_dlg::update_ship(int shipnum)
break;
}
switch (m_no_collide.GetCheck()) {
case 1:
if ( objp->flags & OF_COLLIDES )
set_modified();
objp->flags &= ~OF_COLLIDES;
break;
case 0:
if (!(objp->flags & OF_COLLIDES))
set_modified();
objp->flags |= OF_COLLIDES;
break;
}
switch (m_guardian.GetCheck()) {
case 1:
if ( !(shipp->ship_guardian_threshold) )
@@ -1020,6 +1046,23 @@ void ship_flags_dlg::update_ship(int shipnum)
break;
}
switch (m_scramble_messages.GetCheck()) {
case 1:
if ( !(shipp->flags2 & SF2_SCRAMBLE_MESSAGES) )
set_modified();
shipp->flags2 |= SF2_SCRAMBLE_MESSAGES;
break;
case 0:
if ( shipp->flags2 & SF2_SCRAMBLE_MESSAGES )
set_modified();
shipp->flags2 &= ~SF2_SCRAMBLE_MESSAGES;
break;
}
shipp->respawn_priority = 0;
if(The_mission.game_type & MISSION_TYPE_MULTI) {
m_respawn_priority.save(&shipp->respawn_priority);
@@ -1362,8 +1405,6 @@ void ship_flags_dlg::OnHideShipName()
}
}
void ship_flags_dlg::OnDisableETS()
{
if (m_disable_ets.GetCheck() == 1) {
@@ -1381,3 +1422,21 @@ void ship_flags_dlg::OnCloaked()
m_cloaked.SetCheck(1);
}
}
void ship_flags_dlg::OnScrambleMessages()
{
if (m_scramble_messages.GetCheck() == 1) {
m_scramble_messages.SetCheck(0);
} else {
m_scramble_messages.SetCheck(1);
}
}
void ship_flags_dlg::OnNoCollide()
{
if (m_no_collide.GetCheck() == 1) {
m_no_collide.SetCheck(0);
} else {
m_no_collide.SetCheck(1);
}
}
+5
View File
@@ -65,7 +65,10 @@ public:
CButton m_hide_ship_name;
CButton m_disable_ets;
CButton m_cloaked;
CButton m_no_collide;
CButton m_set_class_dynamically;
CButton m_scramble_messages;
CSpinButtonCtrl m_destroy_spin;
numeric_edit_control m_kdamage;
numeric_edit_control m_destroy_value;
@@ -123,6 +126,8 @@ protected:
afx_msg void OnSetClassDynamically();
afx_msg void OnDisableETS();
afx_msg void OnCloaked();
afx_msg void OnScrambleMessages();
afx_msg void OnNoCollide();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
+37 -41
View File
@@ -54,7 +54,7 @@ END_MESSAGE_MAP()
void CShipTexturesDlg::OnOK()
{
int i, k, write_index, z, not_found, temp_bmp, temp_frames, temp_fps;
int i, z, not_found, temp_bmp, temp_frames, temp_fps;
CString missing_files, message;
char buf[10];
@@ -119,43 +119,40 @@ void CShipTexturesDlg::OnOK()
// re-sort according to old
sort_textures();
// overwrite old stuff
k = 0;
write_index = 0;
while (k<(MAX_SHIPS * MAX_REPLACEMENT_TEXTURES))
// overwrite all the old entries that refer to this ship
SCP_vector<texture_replace>::iterator ii, end;
end = Fred_texture_replacements.end();
for (ii = Fred_texture_replacements.begin(); ii != end; ++ii)
{
//WMC - This loop will go on for a REALLY LONG TIME
//I don't think we need to copy empty entries.
if(!strlen(Fred_texture_replacements[k].ship_name))
break;
if (stricmp(Fred_texture_replacements[k].ship_name, Ships[self_ship].ship_name))
if (!stricmp(ii->ship_name, Ships[self_ship].ship_name))
{
// move up, but when copying, src and dest can't be the same
if (k != write_index)
{
texture_set(&Fred_texture_replacements[write_index], &Fred_texture_replacements[k]);
}
write_index++;
do {
end--;
} while (end != ii && !stricmp(end->ship_name, Ships[self_ship].ship_name));
if (end == ii)
break;
texture_set(&(*ii), &(*end));
}
k++;
}
Fred_num_texture_replacements = write_index;
// finally, assign duplicate textures to Fred array
if (end != Fred_texture_replacements.end())
Fred_texture_replacements.erase(end, Fred_texture_replacements.end());
// now put the new entries on the end of the list
for (i=0; i<texture_count; i++)
{
// make sure there is an entry
if (strlen(new_texture_name[i]))
{
// assign to global FRED array
strcpy_s(Fred_texture_replacements[Fred_num_texture_replacements].old_texture, old_texture_name[i]);
strcpy_s(Fred_texture_replacements[Fred_num_texture_replacements].new_texture, new_texture_name[i]);
strcpy_s(Fred_texture_replacements[Fred_num_texture_replacements].ship_name, Ships[self_ship].ship_name);
texture_replace tr;
// increment
Fred_num_texture_replacements++;
strcpy_s(tr.old_texture, old_texture_name[i]);
strcpy_s(tr.new_texture, new_texture_name[i]);
strcpy_s(tr.ship_name, Ships[self_ship].ship_name);
tr.new_texture_id = -1;
// assign to global FRED array
Fred_texture_replacements.push_back(tr);
}
}
} // skipped here if nothing modified
@@ -222,42 +219,41 @@ BOOL CShipTexturesDlg::OnInitDialog()
// make old texture lowercase
strlwr(texture_file);
// now add it to the box
z = box->AddString(texture_file);
// and add it to the field as well
// add it to the field
strcpy_s(old_texture_name[texture_count], texture_file);
// increment
texture_count++;
// sort
sort_textures();
}
}
// now sort the filenames
sort_textures();
// and add them to the box
for (i=0; i<texture_count; i++) {
z = box->AddString(old_texture_name[i]);
}
// now look for new textures
k=0;
while (k < Fred_num_texture_replacements)
for (SCP_vector<texture_replace>::iterator ii = Fred_texture_replacements.begin(); ii != Fred_texture_replacements.end(); ++ii)
{
if (!stricmp(Ships[self_ship].ship_name, Fred_texture_replacements[k].ship_name))
if (!stricmp(Ships[self_ship].ship_name, ii->ship_name))
{
// look for corresponding old texture
for (i=0; i<texture_count; i++)
{
// if match
if (!stricmp(old_texture_name[i], Fred_texture_replacements[k].old_texture))
if (!stricmp(old_texture_name[i], ii->old_texture))
{
// assign new texture
strcpy_s(new_texture_name[i], Fred_texture_replacements[k].new_texture);
strcpy_s(new_texture_name[i], ii->new_texture);
// we found one, so no more to check
break;
}
}
}
k++; // increment down the list of texture replacements
}
// end of new texture check
+5 -6
View File
@@ -52,8 +52,7 @@ void text_view_dlg::set(int ship_class)
{
char line[256], line2[256], file_text[82];
int i, j, n, found = 0, comment = 0, num_files = 0;
char tbl_file_arr[MAX_TBL_PARTS][MAX_FILENAME_LEN];
char *tbl_file_names[MAX_TBL_PARTS];
SCP_vector<SCP_string> tbl_file_names;
CFILE *fp;
if (ship_class < 0)
@@ -112,12 +111,12 @@ void text_view_dlg::set(int ship_class)
// done with ships.tbl, so now check all modular ship tables...
num_files = cf_get_file_list_preallocated(MAX_TBL_PARTS, tbl_file_arr, tbl_file_names, CF_TYPE_TABLES, NOX("*-shp.tbm"), CF_SORT_REVERSE);
num_files = cf_get_file_list(tbl_file_names, CF_TYPE_TABLES, NOX("*-shp.tbm"), CF_SORT_REVERSE);
for (n = 0; n < num_files; n++){
strcat(tbl_file_names[n], ".tbm");
tbl_file_names[n] += ".tbm";
fp = cfopen(tbl_file_names[n], "r");
fp = cfopen(tbl_file_names[n].c_str(), "r");
Assert(fp);
memset( line, 0, sizeof(line) );
@@ -160,7 +159,7 @@ void text_view_dlg::set(int ship_class)
if (!stricmp(line2 + i, Ship_info[ship_class].name)) {
memset( file_text, 0, sizeof(file_text) );
snprintf(file_text, sizeof(file_text)-1, "-- %s -------------------------------\r\n", tbl_file_names[n]);
snprintf(file_text, sizeof(file_text)-1, "-- %s -------------------------------\r\n", tbl_file_names[n].c_str());
m_edit += file_text;
found = 1;
}
+1 -1
View File
@@ -389,7 +389,7 @@ void VoiceActingManager::OnGenerateFileNames()
// notify user that we are done and how many filenames were changed
char message[128] = { '\0' };
snprintf(message, sizeof(message), "File name generation complete. Modified %u messages.", modified_filenames);
snprintf(message, sizeof(message)-1, "File name generation complete. Modified %u messages.", modified_filenames);
MessageBox(message, "Woohoo!");
}
+2 -107
View File
@@ -189,7 +189,7 @@ void remove_ship_from_wing(int ship, int min)
obj = wing_objects[wing][i] = wing_objects[wing][end];
Wings[wing].ship_index[i] = Wings[wing].ship_index[end];
if (Objects[obj].type == OBJ_SHIP) {
sprintf(buf, "%s %d", Wings[wing].name, i + 1);
wing_bash_ship_name(buf, Wings[wing].name, i + 1);
rename_ship(Wings[wing].ship_index[i], buf);
}
}
@@ -383,7 +383,7 @@ int create_wing()
remove_player_from_wing(ptr->instance);
}
sprintf(msg, "%s %d", Wings[wing].name, i + 1);
wing_bash_ship_name(msg, Wings[wing].name, i + 1);
rename_ship(ship, msg);
Wings[wing].ship_index[i] = ship;
@@ -512,108 +512,3 @@ int get_free_objnum(void)
return -1;
}
// Create a wing.
// wing_type is the type of wing from the Wing_formations array to create.
// leader_index is the index in Objects of the leader object. This object must
// have a position and an orientation.
// *wingmen is a list of indices of existing ships to be added to the wing.
// The wingmen list is terminated by -1.
// max_size is the maximum number of ships to add to the wing
// fill_flag is set if more ships are to be added to fill out the wing to max_size
void create_wing(int wing_type, int leader_index, int *wingmen, int max_size, int fill_flag)
{
int num_placed, num_vectors, cur_vec_index;
object *lobjp = &Objects[leader_index];
formation *wingp;
object *parent;
int wing_list[MAX_OBJECTS];
matrix rotmat;
initialize_wings();
Assert((wing_type >= 0) && (wing_type < MAX_WING_FORMATIONS));
Assert(Wing_formations[wing_type].num_vectors > 0);
Assert(Wing_formations[wing_type].num_vectors < MAX_WING_VECTORS);
Assert(Objects[leader_index].type != OBJ_NONE);
Assert(max_size < MAX_SHIPS_PER_WING);
num_placed = 0;
wingp = &Wing_formations[wing_type];
num_vectors = wingp->num_vectors;
cur_vec_index = 0;
parent = lobjp;
vm_copy_transpose_matrix(&rotmat, &lobjp->orient);
while (num_placed < max_size) {
vec3d wvec;
int curobj;
if (*wingmen == -1) {
if (!fill_flag)
break;
else {
curobj = get_free_objnum();
Assert(curobj != -1);
Objects[curobj].type = lobjp->type;
Assert(Wings[cur_wing].wave_count < MAX_SHIPS_PER_WING);
// JEH Wings[cur_wing].ship_list[Wings[cur_wing].count] = curobj;
Wings[cur_wing].wave_count++;
}
} else
curobj = *wingmen++;
Objects[curobj] = *lobjp;
vm_vec_rotate(&wvec, &wingp->offsets[cur_vec_index], &rotmat);
cur_vec_index = (cur_vec_index + 1) % num_vectors;
if (num_placed < num_vectors)
parent = lobjp;
else
parent = &Objects[wing_list[num_placed - num_vectors]];
wing_list[num_placed] = curobj;
vm_vec_add(&Objects[curobj].pos, &parent->pos, &wvec);
num_placed++;
}
}
// Create a wing.
// cur_object_index becomes the leader.
// If count == -1, then all objects of wing cur_wing get added to the wing.
// If count == +n, then n objects are added to the wing.
void test_form_wing(int count)
{
int i, wingmen[MAX_OBJECTS];
int j, fill_flag;
j = 0;
Assert(cur_object_index != -1);
Assert(Objects[cur_object_index].type != OBJ_NONE);
Assert(get_wingnum(cur_object_index) != -1);
get_wingnum(cur_object_index);
wingmen[0] = -1;
for (i=1; i<MAX_OBJECTS; i++)
if ((get_wingnum(i) == cur_wing) && (Objects[i].type != OBJ_NONE))
if (i != cur_object_index)
wingmen[j++] = i;
wingmen[j] = -1;
fill_flag = 0;
if (count > 0) {
fill_flag = 1;
j += count;
}
set_wingnum(cur_object_index, cur_wing);
create_wing(0, cur_object_index, wingmen, j, fill_flag);
}
+1 -1
View File
@@ -693,7 +693,7 @@ int wing_editor::update_data(int redraw)
for (i=0; i<Wings[cur_wing].wave_count; i++) {
if ((Objects[wing_objects[cur_wing][i]].type == OBJ_SHIP) || (Objects[wing_objects[cur_wing][i]].type == OBJ_START)) {
sprintf(buf, "%s %d", str, i + 1);
wing_bash_ship_name(buf, str, i + 1);
rename_ship(Wings[cur_wing].ship_index[i], buf);
}
}
File diff suppressed because it is too large. Load diff
+2
View File
@@ -36,6 +36,8 @@ extern fix Frametime;
extern float flRealframetime;
extern float flFrametime;
extern fix Missiontime;
extern int Last_frame_timestamp; // A timestamp for when the previous frame ended
extern fix Skybox_timestamp; // A timestamp for animated skyboxes -MageKing17
// 0 - 4
extern int Game_skill_level;
+4 -4
View File
@@ -336,8 +336,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,7,0,9755
PRODUCTVERSION 3,7,0,9755
FILEVERSION 3,7,1,000000
PRODUCTVERSION 3,7,1,000000
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -354,12 +354,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Volition Inc."
VALUE "FileDescription", "FreeSpace 2 Open"
VALUE "FileVersion", "3.7.0.9755"
VALUE "FileVersion", "3.7.1.000000"
VALUE "InternalName", "FreeSpace 2 Open"
VALUE "LegalCopyright", "Copyright © 1998"
VALUE "OriginalFilename", "fs2.exe"
VALUE "ProductName", "FreeSpace 2 Open"
VALUE "ProductVersion", "3.7.0"
VALUE "ProductVersion", "3.7.1"
END
END
BLOCK "VarFileInfo"
+27 -17
View File
@@ -32,6 +32,7 @@
#include "cmdline/cmdline.h"
#include "cfile/cfilesystem.h"
#include "network/multimsgs.h"
#include "mod_table/mod_table.h"
#ifndef WIN32
#include <cstdio>
@@ -51,7 +52,7 @@
extern int Multi_debrief_stats_accept_code;
extern void HUD_printf(char *format, ...);
extern void HUD_printf(const char *format, ...);
extern int game_hacked_data();
@@ -122,8 +123,19 @@ void fs2netd_options_config_init()
}
if ( !strlen(Multi_options_g.tracker_port) ) {
ml_printf("NOTICE: Port for game/user trackers not specified, using default instead (%s).", FS2NETD_DEFAULT_PORT);
strncpy( Multi_options_g.tracker_port, FS2NETD_DEFAULT_PORT, STD_NAME_LEN );
if ( FS2NetD_port >= 1024 && FS2NetD_port <= USHRT_MAX ) {
ml_printf("NOTICE: User override for game/user tracker port not specified, using game_settings.tbl override (%i).", FS2NetD_port);
int result;
result = sprintf(Multi_options_g.tracker_port, "%i", FS2NetD_port);
Assertion( result > 0, "Copying port %i to tracker_port failed\n", FS2NetD_port );
}
else {
if ( FS2NetD_port != 0 ) {
ml_printf("ERROR: game_settings.tbl override for game/user tracker port '%i' must be between %i and %i.", FS2NetD_port, 1024, USHRT_MAX);
}
ml_printf("NOTICE: Port for game/user trackers not specified, using default instead (%s).", FS2NETD_DEFAULT_PORT);
strncpy( Multi_options_g.tracker_port, FS2NETD_DEFAULT_PORT, STD_NAME_LEN );
}
} else {
long port_tmp = strtol(Multi_options_g.tracker_port, (char**)NULL, 10);
@@ -725,7 +737,7 @@ static void fs2netd_handle_messages()
case PCKT_SLIST_REPLY: {
int numServers = 0;
int svr_flags;
int svr_flags __attribute__((__unused__)); // gcc [-Wunused-but-set-variable] doesn't like MACROs
ushort svr_port;
char svr_ip[16];
active_game ag;
@@ -1539,7 +1551,7 @@ int fs2netd_update_valid_tables()
return hacked;
}
void fs2netd_add_table_validation(char *tblname)
void fs2netd_add_table_validation(const char *tblname)
{
uint chksum = 0;
@@ -1560,7 +1572,7 @@ void fs2netd_add_table_validation(char *tblname)
crc_valid_status tbl_crc;
strncpy(tbl_crc.name, tblname, NAME_LENGTH);
strcpy_s(tbl_crc.name, tblname);
tbl_crc.crc32 = chksum;
tbl_crc.valid = 0;
@@ -1583,9 +1595,6 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
new_plr.reset();
strncpy( new_plr.callsign, callsign, CALLSIGN_LEN );
// initialize the stats to default values
init_scoring_element( &new_plr.stats );
out_plr->reset();
Local_timeout = timer_get_seconds() + 30;
@@ -1612,7 +1621,7 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
}
if (rc == 0) {
memcpy( out_plr, &new_plr, sizeof(player) );
out_plr->assign(&new_plr);
In_process = false;
Local_timeout = -1;
}
@@ -1637,7 +1646,7 @@ void fs2netd_close()
FS2NetD_ban_list.clear();
}
void fs2netd_update_game_count(char *chan_name)
void fs2netd_update_game_count(const char *chan_name)
{
if ( !Logged_in ) {
return;
@@ -1653,7 +1662,6 @@ void fs2netd_update_game_count(char *chan_name)
void fs2netd_spew_table_checksums(char *outfile)
{
char full_name[MAX_PATH_LEN];
int count;
FILE *out = NULL;
char description[512] = { 0 };
char filename[65] = { 0 };
@@ -1676,7 +1684,7 @@ void fs2netd_spew_table_checksums(char *outfile)
p = Cmdline_spew_table_crcs;
while (*p && (offset < sizeof(description))) {
if (*p == '"') {
if (*p == '"' && offset < sizeof(description)-1) {
description[offset++] = '"';
description[offset++] = '"';
} else {
@@ -1689,15 +1697,13 @@ void fs2netd_spew_table_checksums(char *outfile)
// header
fprintf(out, "filename,CRC32,description\r\n");
count = (int)Table_valid_status.size();
// do all the checksums
for (SCP_vector<crc_valid_status>::iterator tvs = Table_valid_status.begin(); tvs != Table_valid_status.end(); ++tvs) {
offset = 0;
p = tvs->name;
while (*p && (offset < sizeof(filename))) {
if (*p == '"') {
if (*p == '"' && offset < sizeof(filename)-1) {
filename[offset++] = '"';
filename[offset++] = '"';
} else {
@@ -1707,7 +1713,11 @@ void fs2netd_spew_table_checksums(char *outfile)
p++;
}
filename[offset] = '\0';
if (offset < sizeof(filename)) {
filename[offset] = '\0';
} else {
filename[sizeof(filename)-1] = '\0';
}
fprintf(out, "\"%s\",%u,\"%s\"\r\n", filename, tvs->crc32, description);
}
+3 -3
View File
@@ -15,7 +15,7 @@
#include "network/multi.h"
struct net_addr;
struct player;
class player;
// channel to associate when creating a server
extern char Multi_fs_tracker_channel[];
@@ -77,8 +77,8 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
void fs2netd_options_config_init();
void fs2netd_add_table_validation(char *tblname);
void fs2netd_add_table_validation(const char *tblname);
void fs2netd_update_game_count(char *chan_name);
void fs2netd_update_game_count(const char *chan_name);
#endif // _FS2NETD_CLIENT_H
+11 -11
View File
@@ -131,7 +131,6 @@ int FS2NetD_SendPlayerData(const char *player_name, player *pl, bool do_send)
}
Assert( (num_type_kills >= 0) && (num_type_kills < USHRT_MAX) );
PXO_ADD_USHORT( (ushort)num_type_kills );
for (i = 0; i < MAX_SHIP_CLASSES; i++) {
@@ -141,10 +140,11 @@ int FS2NetD_SendPlayerData(const char *player_name, player *pl, bool do_send)
}
}
PXO_ADD_USHORT( (ushort)MAX_MEDALS );
Assert( (Num_medals >= 0) && (Num_medals < USHRT_MAX) );
PXO_ADD_USHORT( (ushort)Num_medals );
for (i = 0; i < MAX_MEDALS; i++) {
PXO_ADD_INT( pl->stats.medals[i] );
for (i = 0; i < Num_medals; i++) {
PXO_ADD_INT( pl->stats.medal_counts[i] );
}
DONE_PACKET();
@@ -249,7 +249,7 @@ int FS2NetD_GetPlayerData(const char *player_name, player *pl, bool can_create,
}
// make sure that we get the entire packet
while ( (rc_total < (uint)buffer_size) && (rc_total <= sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
while ( (rc_total < (uint)buffer_size) && (rc_total < sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
if ( FS2NetD_DataReady() ) {
rc = FS2NetD_GetData(buffer+rc_total, sizeof(buffer) - rc_total);
@@ -303,8 +303,8 @@ int FS2NetD_GetPlayerData(const char *player_name, player *pl, bool can_create,
PXO_GET_USHORT( num_medals );
for (idx = 0; (idx < MAX_MEDALS) && (idx < num_medals); idx++) {
PXO_GET_INT( pl->stats.medals[idx] );
for (idx = 0; (idx < Num_medals) && (idx < num_medals); idx++) {
PXO_GET_INT( pl->stats.medal_counts[idx] );
}
return (int)reply_type;
@@ -361,7 +361,7 @@ int FS2NetD_GetBanList(SCP_vector<SCP_string> &mask_list, bool do_send)
}
// make sure that we get the entire packet
while ( (rc_total < (uint)buffer_size) && (rc_total <= sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
while ( (rc_total < (uint)buffer_size) && (rc_total < sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
if ( FS2NetD_DataReady() ) {
rc = FS2NetD_GetData(buffer+rc_total, sizeof(buffer) - rc_total);
@@ -435,7 +435,7 @@ int FS2NetD_GetMissionsList(SCP_vector<file_record> &m_list, bool do_send)
}
// make sure that we get the entire packet
while ( (rc_total < (uint)buffer_size) && (rc_total <= sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
while ( (rc_total < (uint)buffer_size) && (rc_total < sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
if ( FS2NetD_DataReady() ) {
rc = FS2NetD_GetData(buffer+rc_total, sizeof(buffer) - rc_total);
@@ -735,7 +735,7 @@ int FS2NetD_ValidateTableList(bool do_send)
}
// make sure that we get the entire packet
while ( (rc_total < (uint)buffer_size) && (rc_total <= sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
while ( (rc_total < (uint)buffer_size) && (rc_total < sizeof(buffer)) && (timer_get_fixed_seconds() <= end_time) ) {
if ( FS2NetD_DataReady() ) {
rc = FS2NetD_GetData(buffer+rc_total, sizeof(buffer) - rc_total);
@@ -773,7 +773,7 @@ int FS2NetD_ValidateTableList(bool do_send)
return 0;
}
void FS2NetD_GameCountUpdate(char *chan_name)
void FS2NetD_GameCountUpdate(const char *chan_name)
{
int buffer_size;
char buffer[MAX_PATH+BASE_PACKET_SIZE+10];
+2 -2
View File
@@ -22,7 +22,7 @@
#include <string>
struct player;
class player;
struct netgame_info;
@@ -47,7 +47,7 @@ void FS2NetD_SendServerDisconnect();
void FS2NetD_RequestServerList();
void FS2NetD_GameCountUpdate(char *chan_name);
void FS2NetD_GameCountUpdate(const char *chan_name);
void FS2NetD_Ping();
void FS2NetD_Pong(int tstamp);
+2 -2
View File
@@ -62,7 +62,7 @@ void FS2NetD_Disconnect()
int FS2NetD_ConnectToServer(const char *host, const char *port)
{
struct hostent *my_host = NULL;
char host_str[5];
char host_str[254]; // 253 is max domain name length: http://en.wikipedia.org/wiki/Domain_Name_System#Domain_name_syntax
#ifdef SCP_UNIX
int my_error = 0;
#endif
@@ -113,7 +113,7 @@ int FS2NetD_ConnectToServer(const char *host, const char *port)
// want to keep this as clean and simple as possible and that means
// using an actual standard :)
strncpy( host_str, host, sizeof(host_str) );
strcpy_s( host_str, host );
// check that we aren't in a dotted format, some gethostbyname() implementations don't like that
// (NOTE: Yes, I'm aware that this is problematic if a host name uses an initial digit)
File diff suppressed because it is too large. Load diff
+21 -28
View File
@@ -16,44 +16,37 @@
// Help overlays
//
// Adding a help overlay: 1) Add a #define that uniquely identifies your help overlay
// 2) Increment MAX_HELP_OVERLAYS
// 3) Add the filename for the help overlay to Help_overlays[] array in ContextHelp.cpp
//
#define MAX_HELP_OVERLAYS 16 // Must be kept current
#define MAX_HELP_OVERLAYS 30
#define SS_OVERLAY 0 // ship selection help
#define WL_OVERLAY 1 // weapons loadout help
#define BR_OVERLAY 2 // briefing help
#define MH_OVERLAY 3 // main hall help
#define BARRACKS_OVERLAY 4 // barracks help
#define CONTROL_CONFIG_OVERLAY 5 // control config help
#define DEBRIEFING_OVERLAY 6 // debriefing help
#define MULTI_CREATE_OVERLAY 7 // multi create game help
#define MULTI_START_OVERLAY 8 // multi start game help overlay
#define MULTI_JOIN_OVERLAY 9 // join game help overlay
#define MH2_OVERLAY 10 // main hall 2 help overlay
#define HOTKEY_OVERLAY 11 // hotkey assignment help overlay
#define CAMPAIGN_ROOM_OVERLAY 12 // campaign room help overlay
#define SIM_ROOM_OVERLAY 13 // sim room help overlay
#define TECH_ROOM_OVERLAY 14 // tech room (general) help overlay
#define CMD_BRIEF_OVERLAY 15 // command briefing help overlay
//#define FS2OX_OVERLAY 16 // Chat help overlay
#define SS_OVERLAY "ship" // ship selection help
#define WL_OVERLAY "weapon" // weapons loadout help
#define BR_OVERLAY "briefing" // briefing help
#define MH_OVERLAY "main" // main hall help
#define BARRACKS_OVERLAY "barracks" // barracks help
#define CONTROL_CONFIG_OVERLAY "control" // control config help
#define DEBRIEFING_OVERLAY "debrief" // debriefing help
#define MULTI_CREATE_OVERLAY "multicreate" // multi create game help
#define MULTI_START_OVERLAY "multistart" // multi start game help overlay
#define MULTI_JOIN_OVERLAY "multijoin" // join game help overlay
#define MH2_OVERLAY "main2" // main hall 2 help overlay
#define HOTKEY_OVERLAY "hotkey" // hotkey assignment help overlay
#define CAMPAIGN_ROOM_OVERLAY "campaign" // campaign room help overlay
#define SIM_ROOM_OVERLAY "simulator" // sim room help overlay
#define TECH_ROOM_OVERLAY "tech" // tech room (general) help overlay
#define CMD_BRIEF_OVERLAY "command" // command briefing help overlay
// other help overlay constants
#define HELP_MAX_ITEM 50 // max number of screen elements per element type per overlay
#define HELP_PADDING 1 //
#define HELP_MAX_NAME_LENGTH 32 // max string length for overlay name
#define HELP_MAX_STRING_LENGTH 128 // max string length for text overlay element
#define HELP_MAX_PLINE_VERTICES 21 // good for 20 segments, can prolly reduce this (FIXME)
#define HELP_PLINE_THICKNESS 2
#define HELP_OVERLAY_FILENAME "help.tbl"
// help overlay calls
int help_overlay_get_index(const char* overlay_name);
int help_overlay_active(int overlay_id);
void help_overlay_set_state(int overlay_id, int state);
void help_overlay_load(int overlay_id);
void help_overlay_unload(int overlay_id);
void help_overlay_maybe_blit(int overlay_id);
void help_overlay_set_state(int overlay_id, int resolution_index, int state);
void help_overlay_maybe_blit(int overlay_id, int resolution_index);
void context_help_init(); // called once at game startup
void context_help_grey_screen(); // call to grey out a screen (normally when applying a help overlay)
+12 -12
View File
@@ -169,29 +169,29 @@ void gameplay_help_blit_control_line(int x, int y, int id)
strcpy_s(buf, XSTR( "no binding", 130));
}
gr_string(x,y,buf);
gr_string(x,y,buf,GR_RESIZE_MENU);
// gr_string(x+KEY_DESCRIPTION_OFFSET,y,ci->text);
gr_string(x+KEY_DESCRIPTION_OFFSET, y, XSTR(ci->text, CONTROL_CONFIG_XSTR + id));
// gr_string(x+KEY_DESCRIPTION_OFFSET,y,ci->text,GR_RESIZE_MENU);
gr_string(x+KEY_DESCRIPTION_OFFSET, y, XSTR(ci->text, CONTROL_CONFIG_XSTR + id), GR_RESIZE_MENU);
}
void gameplay_help_blit_control_line_raw(int x, int y, char *control_text, char *control_description)
void gameplay_help_blit_control_line_raw(int x, int y, const char *control_text, const char *control_description)
{
gr_string(x,y,control_text);
gr_string(x+KEY_DESCRIPTION_OFFSET,y,control_description);
gr_string(x,y,control_text,GR_RESIZE_MENU);
gr_string(x+KEY_DESCRIPTION_OFFSET,y,control_description,GR_RESIZE_MENU);
}
// game_play_help_set_title() will display the title for the help screen and
// set the font for the rest of the screen
void gameplay_help_set_title(char *title)
void gameplay_help_set_title(const char *title)
{
int sy=TITLE_Y;
char buf[128];
gr_set_color_fast(&Color_bright);
gr_printf(0x8000,sy,title);
gr_printf_menu(0x8000,sy,title);
sprintf(buf, XSTR( "Page %d of %d", 132), Current_help_page+1, Gp_last_screen+1);
gr_printf(0x8000,sy+gr_get_font_height()+2,buf);
gr_printf_menu(0x8000,sy+gr_get_font_height()+2,buf);
gr_set_color_fast(&Color_normal);
}
@@ -364,7 +364,7 @@ void gameplay_help_draw_text()
y_offset += separation;
gr_set_color_fast(&Color_bright);
gr_printf(0x8000,y_offset,XSTR( "Function Keys", 134));
gr_printf_menu(0x8000,y_offset,XSTR( "Function Keys", 134));
gr_set_color_fast(&Color_normal);
y_offset += separation;
@@ -755,7 +755,7 @@ void gameplay_help_draw_text()
// ingame messaging
gr_set_color_fast(&Color_bright);
gr_printf(0x8000,y_offset,XSTR( "Ingame messaging keys (tap for text, hold for voice)", 168));
gr_printf_menu(0x8000,y_offset,XSTR( "Ingame messaging keys (tap for text, hold for voice)", 168));
gr_set_color_fast(&Color_normal);
y_offset += separation;
@@ -804,7 +804,7 @@ void gameplay_help_do_frame(float frametime)
GR_MAYBE_CLEAR_RES(Background_bitmap);
if (Background_bitmap >= 0) {
gr_set_bitmap(Background_bitmap);
gr_bitmap(0, 0);
gr_bitmap(0, 0, GR_RESIZE_MENU);
}
Ui_window.draw();
+11 -7
View File
@@ -42,7 +42,7 @@ static int state_in_event_processer = 0;
script_hook GS_state_hooks[GS_NUM_STATES];
// Text of state, corresponding to #define values for GS_STATE_*
// Text of state, corresponding to enum values for GS_STATE_*
//XSTR:OFF
char *GS_event_text[] =
{
@@ -106,19 +106,19 @@ char *GS_event_text[] =
"GS_EVENT_RED_ALERT",
"GS_EVENT_SIMULATOR_ROOM",
"GS_EVENT_END_CAMPAIGN",
"GS_EVENT_LOOP_BRIEF",
"GS_EVENT_LOOP_BRIEF", // 60
"GS_EVENT_CAMPAIGN_CHEAT",
"GS_EVENT_PXO",
"GS_EVENT_LAB",
"GS_EVENT_PXO_HELP", // 65
"GS_EVENT_FICTION_VIEWER",
"GS_EVENT_PXO_HELP",
"GS_EVENT_FICTION_VIEWER", // 65
"GS_EVENT_SCRIPTING"
};
//XSTR:ON
int Num_gs_event_text = sizeof(GS_event_text)/sizeof(char*);
// Text of state, corresponding to #define values for GS_STATE_*
// Text of state, corresponding to enum values for GS_STATE_*
//XSTR:OFF
char *GS_state_text[] =
{
@@ -171,8 +171,8 @@ char *GS_state_text[] =
"GS_STATE_GAMEPLAY_HELP",
"GS_STATE_LOOP_BRIEF",
"GS_STATE_PXO",
"GS_STATE_LAB", // 50
"GS_STATE_PXO_HELP",
"GS_STATE_LAB",
"GS_STATE_PXO_HELP", // 50
"GS_STATE_START_GAME",
"GS_STATE_FICTION_VIEWER",
"GS_STATE_SCRIPTING"
@@ -193,6 +193,10 @@ void gameseq_init()
gs[i].queue_head=0;
}
for (i=0; i<GS_NUM_STATES; i++ ) {
script_hook_init(&GS_state_hooks[i]);
}
gs_current_stack = 0;
state_reentry = 0;
state_processing_event_post = 0;
Loaded 100 of 713 files, more files were not shown because too many files have changed in this diff. Show more