Compare commits

..
1096 Commits
Author SHA1 Message Date
Goober5000 00d7cd8a17 Top secret side project by Goober5000, Swifty, and Sushi. 2010-06-16 03:35:53 +00:00
Goober5000 33f47d53c7 add awesome logical operators
(I wonder why nobody added these until now)
2010-06-16 02:38:24 +00:00
Goober5000 db2e20e59a add mission-time-msecs 2010-06-16 02:10:48 +00:00
The_E 67e89bdd8d Fix for Mantis 2212 (Interface animations start at frame 1, not 0) 2010-06-15 17:24:03 +00:00
The_E c0e55de8f0 Fix for Mantis 2210 (Ship models in ship selection do not always show up properly) 2010-06-15 12:04:50 +00:00
Echelon9 0d2c96ba09 Project file update to include bitarray.h 2010-06-14 14:12:45 +00:00
The_E 02e76c00e9 Project file update to include bitarray.h 2010-06-14 07:36:07 +00:00
Goober5000 7b8c035320 revert portej05's removal of the bitstring code 2010-06-14 06:56:52 +00:00
The_E d41fa67715 Don't increase the total number of loaded menu music files if a tbm with +nocreate is loaded.
This also neatly fixes the somewhat screwed up music selection list in FRED (remember all those empty lines?), albeit not completely.
2010-06-14 01:59:15 +00:00
Goober5000 7cfdf27b78 sync file for proper string length 2010-06-12 21:23:56 +00:00
Goober5000 5cc6f5e4fd sync case 2010-06-12 20:47:22 +00:00
Wanderer 4b66b6e42c related to mantis 2187 - fix to improve autoaim accuracy if additive velocity is enabled 2010-06-12 16:10:31 +00:00
The_E 8edeb00886 Some stuff for wxFRED. Slowly making progress. 2010-06-10 01:29:17 +00:00
Wanderer c01b067c1a better handling of 'dying' weapons for lua scripting.cpp
added lua controls for accessing beams
2010-06-09 16:49:20 +00:00
Goober5000 9940f9a752 add OPF_SOUND_ENVIRONMENT for Taylor's sexps
also, some tweaks for sexp checks and for SEXP_NONE_STRING
2010-06-09 07:38:27 +00:00
Wanderer 9d75c04e99 fix for target priorities and sif2 flags issue 2010-06-09 05:19:54 +00:00
The_E 56c1699aee Project File for wxFRED. 2010-06-09 05:18:45 +00:00
Wanderer a9e043f156 fixes for the external weapons patch (accidentally uploaded outdated patch) 2010-06-07 12:48:53 +00:00
Wanderer 2296b885b5 changes to external weapon model handling 2010-06-07 12:22:54 +00:00
The_E 36f1acb0ae Not quite sure how this one went broken for so long....( FSO specific .libs were not loaded on non-SSE2 configurations, leading to broken builds.) 2010-06-07 11:10:11 +00:00
Wanderer add696869b mantis 1988 - error checking for the targeting priorities 2010-06-07 10:53:34 +00:00
Goober5000 a6066d79a9 ignore generated file 2010-06-07 07:02:18 +00:00
Goober5000 bbeba26c70 adjust coordinates for The E's latest 640x480 art 2010-06-07 06:35:40 +00:00
Goober5000 b59580e84c FUBAR's feature for LOD naming: http://www.hard-light.net/forums/index.php?topic=68901.0 2010-06-07 03:58:47 +00:00
Goober5000 a992f0687c tweak fiction viewer coordinates 2010-06-07 02:13:44 +00:00
The_E 5d5b377ad8 A missing ) is bad for parsing. 2010-06-06 18:12:29 +00:00
taylor a971f3d768 make sure to stop deathroll effect too (Mantis #2215) 2010-06-06 14:50:38 +00:00
taylor 5e943b843c add some missing safety checks for Snds[] (Mantis #2216) 2010-06-06 14:50:36 +00:00
Echelon9 67a5d89d47 Removed defined but unused variables 2010-06-06 08:35:19 +00:00
taylor f80dcd4a87 make sure to always close context and device when searching through valid devices 2010-06-06 03:10:40 +00:00
taylor 96d93607dd fix OS X compile issue 2010-06-06 03:10:38 +00:00
The_E 03d0b66214 Same here. 2010-06-05 02:45:13 +00:00
The_E 719eb41cd8 Remove unused files from the project file 2010-06-05 02:36:41 +00:00
Goober5000 f37ff6da68 minor fix to the -wcs flag removal 2010-06-03 06:28:06 +00:00
karajorma 3005e447d3 Kill the -wcs flag. Should have done this years ago. 2010-06-02 12:01:13 +00:00
The_E 1dbe105933 Fix for Mantis 2214 (toparc2 and toparc3 hud anis [The Enemy Missile threat and Enemy Missile lock indicators] may have a length > 2 now, instead of being fixed at 3 frames) 2010-06-02 11:49:24 +00:00
taylor 04cac71fe9 revert r6151
Per source doppler factor is part of the EFX spec, which means all full 1.1 implementations.
2010-06-01 02:44:15 +00:00
The_E 4bee746897 According to the OpenAL programmer's guide, AL_DOPPLER_FACTOR is not a valid parameter for alSourcef 2010-05-31 10:38:00 +00:00
Wanderer 4b34460f06 Certain fixes for Bobs animation code issues. Please report if this renders any current anims invalid. 2010-05-30 19:28:21 +00:00
Echelon9 af574dacff codec1.cpp and codec1.h included in Xcode project file when no such source files present 2010-05-30 05:14:00 +00:00
The_E e101736d8f Project file update for new sound code. 2010-05-30 02:17:21 +00:00
taylor f06ef36ca6 more sane memory reserve 2010-05-29 15:53:28 +00:00
taylor 1491795451 fix endless loop 2010-05-29 15:53:27 +00:00
taylor 0a17554c4f disable doppler for the time being 2010-05-29 15:53:24 +00:00
taylor b287ecfef9 new sound code
- Mantis #58
 - Mantis #1769
 - many other fixes and improvements
2010-05-29 15:53:18 +00:00
taylor a7bac8679c fix view skew math issue (Mantis #2213) 2010-05-29 14:55:04 +00:00
taylor f72d0a4cd5 bah! remove debug code that slipped in with safety fixes 2010-05-29 10:55:33 +00:00
taylor d3e750edf7 support for newer versions of automake (Mantis #2145) 2010-05-29 10:55:30 +00:00
The_E 7f9df9c09e Fictionviewer interface adjusted for new, official interface art found here: http://blueplanet.fsmods.net/E/FictionViewer.7z 2010-05-28 20:07:05 +00:00
Wanderer 89d7a512af add read access for lua to weapon and ship info index. enable to check 'weapon_armed' status 2010-05-28 19:15:05 +00:00
karajorma 61af589c21 Swap the engage enemies messages over. 2010-05-28 06:09:53 +00:00
Sushi 270734b6f3 Fixed a parsing bug in AI.tbl that scaled Glide Attack Percent, Glide Strafe Percent, Circle Strafe Percent, and Random Sidethrust percent between 0 and 1 instead of 0 and 100 (as is the case for AI profiles.tbl) 2010-05-25 18:09:59 +00:00
Sushi 5704dce248 Fix a bug where additive weapon velocity would sometimes cause primary shots to pass through a target 2010-05-25 16:25:41 +00:00
The_E f993f7ced1 Altered the project file to allow FRED release compilation on VS2010 2010-05-25 01:11:46 +00:00
Goober5000 04436d634f remove message from queue the correct way, thus fixing the training message crash 2010-05-19 04:28:43 +00:00
Sushi e63505510b Added $Random Sidethrust Percent to AI Profiles and AI.tbl. Allows ships with sidethrust capability to sometimes randomly use it in dogfighting situations to make life more miserable for the player. 2010-05-17 19:10:34 +00:00
Goober5000 c5e3600bef reverted fix. It has problems, which is why I'm going over it first. 2010-05-16 22:26:58 +00:00
The_E acdc56272b Committing IssMneur's fix for Mantis 2183. 2010-05-16 15:40:11 +00:00
Goober5000 7a44b33152 better handling of missing models 2010-05-15 22:53:41 +00:00
Goober5000 ec2542fa1e misc silly fixes 2010-05-15 21:48:23 +00:00
Goober5000 1eb544da58 fix subsystem alignment on ship class change (Mantis #1181)
fix a bug with Bobboau's external missiles feature
2010-05-15 21:31:32 +00:00
Sushi 71ba95081c Added $No extra collision avoidance vs player flag. Makes the AI less likely to didder around like an idiot at close range. 2010-05-14 20:43:32 +00:00
Sushi b01b4a1778 Small fix for circle strafe 2010-05-14 18:57:58 +00:00
Sushi e46ba43891 Fix for Mantis 2099 2010-05-12 19:40:09 +00:00
The_E e2c5ff679c Swarm weapons should respect "$Free flight time" as well 2010-05-10 17:17:49 +00:00
The_E 132ba60085 Patch for Mantis 2202 (Children of swarm weapons do not inherit parent target) 2010-05-09 14:53:29 +00:00
Echelon9 fdb7de88da Remove commented out code (still in SVN history if needed) and the overhead of an empty function call every frame 2010-05-09 06:12:06 +00:00
Echelon9 44886e1ba5 Benefit from our use of STL vectors be removing a now unnecessary variable in cutscenes.cpp and making code cleaner and easier to read 2010-05-08 15:09:08 +00:00
Sushi 63b9efeb3a Some fixes/updates for the Circle Strafe behavior. The AI should use it a bit more effectively now. 2010-05-07 17:03:23 +00:00
chief1983 e702ce2267 Quick fix for the WarningEx breakage on *nix 2010-05-05 16:47:12 +00:00
karajorma de0c889d10 Fix compilation under OSX and Linux with WarningEx 2010-05-04 12:34:05 +00:00
The_E e2fbbb5e19 Genghis' fix for Mantis 2162 (Thruster cones have collision detection) 2010-05-03 12:32:42 +00:00
karajorma 27f58de890 Add the (in)validate-all-arguments SEXPs 2010-05-03 12:03:57 +00:00
karajorma c07d555346 Genghis' fix for Mantis 2159 (Certain parsing errors are never reported) 2010-05-02 10:24:48 +00:00
karajorma 2f635ad879 Genghis' fix for Mantis 2157 (Invalid subsystems not properly detected on mission parse). 2010-05-02 06:00:50 +00:00
karajorma 10d6940145 GencGenghis' fix for Mantis 2155 (No error checking for certain ship problems in the lab that FRED does pick up). 2010-05-02 05:54:26 +00:00
karajorma c6b8d515a4 Genghis' fix for Mantis 2151 (No error checking for incorrect engine wash entries). 2010-05-02 05:53:02 +00:00
Sushi 34c61a7caa Reverted commit 5656, due to side effect of changing AI behavior (see mantis 1982) 2010-05-01 20:39:41 +00:00
Goober5000 39d5580651 prevent HUD formatting from destroying subsystem names - Mantis #2195
also made hud_targetbox_truncate_subsys_name return void to lessen the chance of people making the mistake in the future
2010-04-30 06:33:38 +00:00
Goober5000 0d75839a9d fix rounding formula (Mantis #2194) 2010-04-30 04:03:24 +00:00
karajorma 35ac7d6afa Fix Mantis 2194 (FRED incorrectly calculates the wrong number used in wings). 2010-04-30 03:24:30 +00:00
Sushi b48b7f76ac Fix for bug causing AI to not fire secondaries, as well as a fix for other minor AI bugs 2010-04-29 18:56:11 +00:00
karajorma a2afa2b67a Switch to using the Macros for Multiplayer modes whenever possible. 2010-04-27 13:42:59 +00:00
Sushi 0889d77f9f Fix for Dynamic Glide Cap so that the cap ramps max speed in the same way as normal flight when turning afterburners on/off or changing the overclock (what it should have done in the first place). Also removed some old, unused glide code. 2010-04-26 13:38:36 +00:00
Sushi b72514fbaa Fix for 6057 (game sometimes crashes if $Turret Max Aim Update Delay not set) 2010-04-26 13:36:08 +00:00
The_E 475853afa3 Fix for Mantis 2189 (camera FOV may get corrupted by malformed commandline argument) 2010-04-21 21:14:08 +00:00
karajorma 047ae70637 FUBAR's Fix to allow Explosion-Effect to use any explosion in fireball.tbl 2010-04-20 13:05:29 +00:00
Goober5000 2e58278eba make sure Fred knows its base directory before loading the command line... this will allow it to load cmdline_fso.cfg which will allow Fred to recognize mods (Mantis #2185) 2010-04-20 05:37:34 +00:00
Goober5000 26f33cba24 fix parsing of miss factors (Mantis #2185) 2010-04-20 04:37:44 +00:00
chief1983 7846af6c24 No 2-arg asserts on Linux. 2010-04-19 23:32:52 +00:00
Goober5000 aa0c39cb7d add beam miss factor by team, requested by Blue Planet 2010-04-19 05:17:57 +00:00
Goober5000 63909095f5 merge Iss_Mneur's fix for Mantis #2173 (better error message in cmdline.cpp) 2010-04-19 03:51:05 +00:00
Goober5000 e537b1e133 merge Iss_Mneur's fix for Mantis #2178 (Assertion in missiontraining.cpp) 2010-04-19 03:49:09 +00:00
Goober5000 09602a9ffa merge The E's fix for Mantis #2182 (NaN propagation leading to rendering wonkiness) 2010-04-19 03:40:13 +00:00
Sushi f7ebd3c636 Added $Turret Max Aim Update Delay (same as $Max Aim Update Delay, but affecting turrets instead). 2010-04-15 20:03:01 +00:00
chief1983 52fb26169c Add a VS2010 project file, made from VS2010 Ultimate RC1. Added tweaks after conversion from 2008 to make the output file names and target names more dynamic. This should be the basis for getting FRED release builds to compile. The three other executables per config work fine. 2010-04-14 20:07:08 +00:00
karajorma ff7f028e0e Fix the end-mission SEXP to make it possible to test if the player is alive or not. 2010-04-13 11:15:18 +00:00
karajorma 1362e16c4c Remove a hack which wouldn't allow players to skip the penultimate FS2 mission if they failed it 5 times. 2010-04-13 11:14:20 +00:00
karajorma 4178c4b65c Iss Mneur's mission-set-subspace and hud-display-gauge SEXPs 2010-04-13 11:12:28 +00:00
Goober5000 f59fd543c9 fix Mantis #1953 (departure locations and anchors destroyed by ship editor dialog) 2010-04-13 06:51:06 +00:00
Goober5000 0dddfbca74 consolidate and fix the resetting of time compression (Mantis #2180) 2010-04-13 03:54:30 +00:00
Sushi 0c025d96f6 Fixes a bug where paths generated by exit paths aren't garbage collected. This can cause the game to crash in missions where a lot of ships launch from fighterbays. 2010-04-11 18:36:30 +00:00
Goober5000 4b662a3649 prevent an endless loop if someone tries to assign a variable to itself 2010-03-31 20:31:02 +00:00
Goober5000 d6d69d9ac7 IssMneur's patch for Mantis 2161 2010-03-31 05:33:55 +00:00
Goober5000 59c7c56dd4 The E's patch to apply capital+ to secondary weapons 2010-03-31 05:31:23 +00:00
Goober5000 c2a2f0727f patch some holes in the handling of string variables 2010-03-29 09:39:26 +00:00
karajorma a5078ce0aa Fix Mantis 2000 (Skip Mission Dialog appears even when mission is successfully completed). 2010-03-24 10:49:28 +00:00
Echelon9 36f2e4fd73 Fix Mantis 2158: Increase Intelligence limit from species.tbl 2010-03-21 06:22:35 +00:00
Goober5000 0458d83f94 a couple of small but important fixes to the subtitle code, including (finally) the complete fix for Mantis #2152 2010-03-20 06:37:26 +00:00
Echelon9 c66a0b8e05 Fix Mantis 2156: Crash within outwnd_printf2(char*, ...) on non-Windows platforms 2010-03-20 00:20:47 +00:00
Goober5000 725b48d2b9 handle variables in show-subtitle 2010-03-19 07:39:51 +00:00
Goober5000 b7f4d00358 Genghis's fix for too many cargo names (Mantis 2132) 2010-03-19 06:45:05 +00:00
Goober5000 5a3fa6f576 allow specification of fonts via show-subtitle 2010-03-19 06:31:15 +00:00
Goober5000 28d23c56c0 sexp help now scrolls 2010-03-19 05:47:56 +00:00
Goober5000 7181e3d602 a few things here...
--add space for font argument which will be in post-3.6.12 builds
--fix round-off error in coordinate conversion, discovered by genghis
--use is_sexp_true() instead of WMC's comparison
--fix images not appearing in show-subtitle (Mantis #2152)
--fix invalid character in change-soundtrack sexp help
2010-03-19 04:03:49 +00:00
Goober5000 774f34dea4 approximate the beam whack from retail FS2 2010-03-16 06:43:05 +00:00
Goober5000 7fa0a70c9e this is a long-overdue rewrite of WMC's show-subtitle sexps 2010-03-15 01:55:40 +00:00
Goober5000 27f70fe135 move the -post_process flag to the experimental section 2010-03-14 22:38:37 +00:00
Echelon9 1530e3556b Fix Diaspora Mantis 537: Successfully killing a ship hidden from sensors should count towards your kill count 2010-03-12 23:19:42 +00:00
karajorma b6914428ad Fix Mantis 2140 (Set-primary-ammo/weapon result in the ammo being set to 0 in some mods) 2010-03-10 14:49:50 +00:00
taylor d36f675f50 no comment. (nothing nice to say) 2010-03-10 10:05:42 +00:00
karajorma ca90928e08 Refactoring the Special Explosion and Special Hitpoints/Shield code and saving methods. 2010-03-10 08:50:28 +00:00
Wanderer f19a74b5c2 mantis 2122, fix for hud_gauge string comparison problems. 2010-03-09 07:09:40 +00:00
Wanderer e8d72f5a50 mantis 2138, fix game crashing if using ships with secondaries but without primaries, allow ai ships armed only with secondaries to attack & shoot 2010-03-08 14:53:48 +00:00
Wanderer be06149719 mantis 2113, make autoaim independent from lead indicator status 2010-03-08 14:52:24 +00:00
Wanderer d0b3d8fe30 feature commit - alternate lead indicator based on komet's code changes. 2010-03-06 14:23:13 +00:00
Goober5000 46ea3669d5 allow multiple interface patterns (FS2 plus WCS) to be used in fiction viewer 2010-03-06 11:39:11 +00:00
Wanderer 96c365ca86 Fix for mantis 2131:
prevent for time compression caused vector scaling errors
changed time compression related beam assert into nprintf.
2010-03-05 11:48:19 +00:00
Wanderer f93e369d73 Fubars fix for mantis 2141 2010-03-05 05:47:23 +00:00
Wanderer 5983a47bc4 fix for mantis 2125 2010-03-04 20:34:52 +00:00
Wanderer c4df09934c fix for mantis 2105 2010-03-04 19:39:48 +00:00
Wanderer 3b1597f2d9 fix to attach muzzleflashes on ship to weapon firing points - mantis 2135.
also related fixes - fix attached particle rendering, allow all particles to exists at least 1 frame
2010-03-04 10:10:57 +00:00
taylor 56102ad328 use system versions of JPEG, PNG and LUA (per Mantis #1663 discussion) 2010-03-04 05:58:54 +00:00
taylor 8d2b02efb7 add detection of OpenAL and OpenGL (Mantis #1663) 2010-03-04 05:58:53 +00:00
taylor de60dfe106 fix memory issues with arg parsing 2010-03-04 05:58:52 +00:00
taylor 7b293cd972 reduce minimum sound volume value for OpenAL compatibility (Mantis #1854) 2010-03-04 05:58:50 +00:00
taylor 1ad8db2238 cycle back to normal music is hostile ships leave without battle (Mantis #1632) 2010-03-04 05:58:49 +00:00
taylor bce97dae91 updated Ogg/Vorbis/Theora libs 2010-03-04 05:58:45 +00:00
taylor 721e71f860 handle cmdline_fso.cfg files of any size 2010-03-04 05:58:18 +00:00
taylor a8510f8a51 clean up launcher flags
- update easy flag settings (Mantis #2074)
 - remove -res, it requires an option
2010-03-04 05:58:17 +00:00
taylor f818572382 properly close out mission when end-mission sexp is used (Mantis #2144) 2010-03-04 05:58:16 +00:00
karajorma 64d3a85dfa Fix an issue with the multi_sexp system if you ever had to send two full packets in a single frame. 2010-03-03 14:11:59 +00:00
Swifty b9baca78ed Fix frame buffer objects from rendering upside down after calling gr_opengl_set_clip and gr_opengl_set_projection_matrix. 2010-03-03 12:47:08 +00:00
karajorma e12b4c3840 Remove "disarm or disable cause global ai goal effects:" from AI_Profiles as promised and replace it with a new object types table setting. 2010-03-01 15:59:47 +00:00
karajorma b464f2a558 Fix Mantis 2137 (Play-Sound-From-File doesn't loop correctly). 2010-03-01 13:44:25 +00:00
karajorma abd020529d Ironically OF_REFERENCED isn't referenced anywhere in the code. 2010-02-28 14:07:49 +00:00
karajorma d4b6ae7b8d FRED should base the list on the selected object and not simply the first marked one. 2010-02-24 09:13:47 +00:00
Goober5000 5a92218ce6 fix bugs in VC2005 project files, probably caused by VC6 import 2010-02-24 05:11:22 +00:00
karajorma 38a42dd2e4 Change an assertion into a warning and auto-fix the data in release builds. 2010-02-23 01:53:55 +00:00
Zacam e7b0c695ea For 3.6.12 RC: resolves the text "Monitoring" not showing on the HUD Escort monitor box. [Mantis 2133] 2010-02-20 22:24:28 +00:00
chief1983 a77a92b8f0 Get rid of one place we have to update the version. 2010-02-19 20:41:19 +00:00
Zacam bfdf0c5b48 Increase Trunk tagging and version to 3.6.13. 2010-02-19 19:57:22 +00:00
chief1983 5fc6743d4c SVN will ignore .git and .gitignore files now. 2010-02-18 03:55:41 +00:00
Goober5000 b124ff648b reconvert MSVC_2005 project from MSVC_6 2010-02-17 10:27:23 +00:00
Goober5000 5c032efc72 remove MSVC_6_Release which is now redundant, and MSVC_2003 and MSVC_2005 which are old and need fixing 2010-02-17 10:16:33 +00:00
Goober5000 01a242f269 sync with MSVC6_Release 2010-02-17 10:13:54 +00:00
chief1983 e96e973a54 Fix VS 2008 compiling of FRED. 2010-02-16 05:22:14 +00:00
Zacam cebcd67cfc Some *nix compilers (and potentially Mac in the near future) are dying on the build process regarding this comma. 2010-02-15 22:04:45 +00:00
taylor 41adc2f68b fix coop kill limit check when set to none (Mantis #2014)
cleanup coop validation checks a little, particularly if future checks are added
2010-02-15 19:53:33 +00:00
taylor f7126d9c9c Merge branch 'misc' 2010-02-15 19:01:14 +00:00
Goober5000 4efaaf4523 clarify difference between knossos warpin and warpout in the code -- this should fix Mantis #2128
"mabye" -> "maybe"
2010-02-15 11:01:29 +00:00
Goober5000 ba9c45714a add Fiction Viewer dialog
FRED will now save fiction viewer information properly
FRED will now also save "hidden" debriefing information properly
2010-02-15 10:22:20 +00:00
Goober5000 99aa1e74a0 sync png and zlib changes with MSVC6 2010-02-15 10:08:20 +00:00
Zacam 3761e36f4c Well, this is embarrassing. Forgot to apply "is_a_word_separator" in the briefing text coloring fix for Mantis 1992. As a result, it wasn't stopping coloring unless and until a whitespace was being hit, instead of stopping on valid word separators like it should have been. 2010-02-14 00:46:13 +00:00
Echelon9 271044cb70 Mantis 2108 Fix (Mac Inferno build configurations do not correctly set INF_BUILD in Xcode) 2010-02-13 12:07:00 +00:00
karajorma 7d4f9f0fb5 FUBAR's Mantis 2053 fix (Fix a few holes where invalid names could leak through.) 2010-02-13 09:10:40 +00:00
Wanderer 8651bb3a0b fix for potential (and real) null vec issue caused by sexped explosions 2010-02-13 09:01:07 +00:00
chief1983 1a4917ca2b Fixes for Mantis #2071: Color inheritance and child gauge IDs, per KK. 2010-02-12 17:42:31 +00:00
karajorma 9d705df121 Better fix for Mantis 2106 (set-object-position crashing multiplayer) 2010-02-12 11:23:23 +00:00
karajorma ceebf42868 Bump the server version (should have done this when I broke the packet earlier this week). 2010-02-12 11:19:56 +00:00
karajorma a1f100d0a3 Whoever designed a comparison function that reports false when the arguments are the same should be shot! 2010-02-12 07:42:23 +00:00
karajorma 8555140cf6 Deprecate <any support ship class> in favour of something that does exactly what it says on the tin. 2010-02-12 07:14:34 +00:00
karajorma 77dacf4307 Fix Mantis 2094 (Set-Support-ship results in support ships that can't rearm even though present in the mission). Thanks to FUBAR for the spading on this. 2010-02-12 06:42:19 +00:00
Zacam 6dffec5d23 Patch for Mantis #2001: Primary weapon loadouts with text names no longer show # or anything to the right. Works with $Alt Name: as well. 2010-02-11 16:47:19 +00:00
chief1983 14e0a7f257 Patch for Mantis #2071: color inheritance and pan or static option for custom gauges 2010-02-11 16:32:45 +00:00
chief1983 9473a345fc Fix Mantis #2120: is-primary-selected now returns true for any bank when primaries are linked. 2010-02-11 16:31:25 +00:00
Zacam 20d6d6116f Potential Fix for Mantis 2114 as suggested by The_E and tested by myself. Not only set "static int bm_next_handle" to 0, but also conditioned the Asserts (hopefully) a bit better and cleared out commented code blocks.
(Note: It seems I got Notepad++ to convert ushort and uint into "unsigned" short and int. Doesn't break anything and frankly, I hate unnecessary typedefs anyway).
2010-02-11 02:12:15 +00:00
Zacam e226c8e7f4 Resolves "conditional within an assignment" warnings that could cause problems. 2010-02-11 01:42:36 +00:00
Wanderer c2a1ff57c9 Commit of lua debug patch. 2010-02-10 21:50:15 +00:00
Wanderer 3b84da5af0 commit of beam piercing patch (allow beam tooling to occur simultaneously to the effects) 2010-02-10 21:38:01 +00:00
Zacam ab17ff4d40 From The_E: "This adds the optional string "$End Campaign Cutscene:" to the list of possible cutscenes; once end-campaign is called, all of those scenes will be played if their requisite trigger conditions are met, in the order in which they are defined in the mission file". 2010-02-09 20:03:57 +00:00
Zacam 6a6a3ac822 From The_E: Capital+ flag "AI will not use this weapon on fighters or bombers" for use against Capital class Targets ( SIF_BIG_SHIP | SIF_HUGE_SHIP ). 2010-02-09 20:01:54 +00:00
karajorma 47faa1c364 Fix for Mantis 2106 (Set-object-position crashes in multiplayer). 2010-02-06 11:20:32 +00:00
karajorma b2a443a225 Packet breaking fix for Mantis 2011 (Send-Message-List sends all messages at once for clients). 2010-02-06 11:19:31 +00:00
Echelon9 6d4fb01f67 Updated Xcode project file to reflect the non-inclusion of some redundant png source code files that weren't actually needed in Antipodes 5 2010-02-06 06:52:12 +00:00
Zacam 7096cd3d11 From Antipodes #5: PNG File Format support.
Adds PNG to Maps (should only be used for Nameplates), Interface, Effects, HUD (still needs HUD Rewrite to implement), Player/Squad Images, Multi Players, Multi Cache, CB Anims and Intel Anims.
LIBPNG: Version 1.2.42, current and highest usable version (MAX_VERSION), Linux can use any 1.2.2x-1.2.42, but should NOT use 1.4.0 under any platform for ANY reason (will require rewriting pngutils)
ZLIB: Version 1.2.3.
2010-02-06 02:35:41 +00:00
taylor 05f95e05ee fix damage lightning (from Xt tree) 2010-02-06 01:02:24 +00:00
Wanderer 1cc80c2841 fix couple of model handle related bugs in lua.cpp 2010-02-05 23:14:34 +00:00
Wanderer 17decc5654 allow armor entries exists even without any calculations. 2010-02-05 19:04:12 +00:00
Wanderer e3e7bbfd05 fix for mantis 2110 2010-02-04 21:18:19 +00:00
Zacam e8e37e8620 Multi-platform resolution for "signed/unsigned mismatch" warning on aiturret.cpp via ship.h 2010-02-04 05:36:04 +00:00
Zacam 10d94a24e8 Not multi-platform, but it doesn't break other platforms and removes 11 warnings from nebula.cpp. 2010-02-04 05:02:07 +00:00
Zacam 6d273e9495 Multi-platform resolution for "unused variable" warning on shiphit.cpp 2010-02-04 04:44:42 +00:00
Zacam 650c8010bc Multi-platform resolution for "signed/unsigned mismatch" warning on ship.cpp 2010-02-04 04:42:04 +00:00
Zacam 1f9d15d20e Multi-platform resolution for "signed/unsigned mismatch" warning on gropenglstate.cpp 2010-02-04 04:27:43 +00:00
Zacam b40359cd30 Fix for cutscene.cpp "signed/unsigned mismatch" multi-platform warning. 2010-02-04 04:12:45 +00:00
Zacam 40f0b0b279 Proper fix for Mantis 2039. Nebula poof debris ANI usage now based on using any ANI/EFF on nebdeb01-nebdeb04. Doesn't exist on retail but also doesn't conflict or break Retail as these (nor the original "Neb01-64") actually exist, but allows for the same flexible range for the effect as non-nebula has for motion debris. 2010-02-04 04:04:17 +00:00
taylor 4b40d32f3d particle updates from the Xt code base 2010-02-03 02:18:22 +00:00
karajorma a4f587110d FUBAR's special hits fix. 2010-02-01 04:49:09 +00:00
karajorma 32f4c944e6 FUBAR's bump for the number of docks a ship can have in FRED. 2010-02-01 04:35:29 +00:00
karajorma 8f8a8486a1 FUBAR's Corkscrew Limit bump 2010-02-01 04:15:23 +00:00
Zacam 99c4490bb0 Crap. Fixes SparK's Reverse AB. Now with a ship defined with Reverse AB, forward AB still responds as normal. 2010-02-01 03:37:14 +00:00
Zacam 76d4ba4479 From Antipodes #5: Corrections for errors and warnings to SPHelper.h for speech compiling for WSVC (specifically 2008), especially when done on Vista/Win 7. 2010-01-31 01:22:56 +00:00
Zacam 6cc6bd9119 From Antipodes #5: new TBM option '$Alt name:'
For ships and weapon tbms - renaming existing tbl entries in mods
2010-01-31 01:19:58 +00:00
Wanderer 05b47ecfec bah, bah, bah, bah - fix my own stupid bug in lua raycollision function 2010-01-30 11:45:22 +00:00
Zacam 5ddd75b11e SparK's Reverse Afterburner code, for FringeSpace (Tachyon) project Feature Request. 2010-01-30 03:38:53 +00:00
Goober5000 96d93caf1b Zacam's project fixes 2010-01-30 00:50:08 +00:00
Goober5000 7630b1669c change the other DSPs too 2010-01-30 00:12:45 +00:00
Goober5000 0e7bdf926d fix the MSVC6 project files 2010-01-30 00:04:54 +00:00
chief1983 274aa3cf93 Fix a VC6 compiling issue with multiple declarations of i 2010-01-29 22:21:33 +00:00
Wanderer 38c1682975 The_E's fix for preventing lua On HUD Draw hook from being run when HUD is not visible 2010-01-28 20:28:29 +00:00
Wanderer 170266436b adding 'retail' type piercing (no piercing effect, but normal beam tooling effect) 2010-01-28 20:24:39 +00:00
Wanderer 13a3308e23 added improved controls for piercing effects. fixed shield armor type bug. 2010-01-28 16:05:15 +00:00
Wanderer a3ca4f4ef7 lua function for checking the state of a ship when the ship is dying 2010-01-28 08:05:43 +00:00
Wanderer b0e8ce130e Lua additions/bugfixes, fixed drawmodeloor function for drawing models in game, new model loading helper functions (slow). 2010-01-28 07:37:31 +00:00
Sushi d89a92c6e7 Added $Damage Lightning Type and +Lightning Arc Percent (under $Debris) to ships.tbl. Allows damage lightning effect to be changed (current options are default and none) on a per-ship basis. The percentage of debris pieces with lightning arcs can also be controlled via +Lightning Arc Percent. 2010-01-27 18:55:37 +00:00
Goober5000 51ef10452c remove redundant definitions from modelinterp.cpp 2010-01-26 01:47:35 +00:00
Goober5000 4d643bfe6b thanks to Zacam for noticing the edge case; max flags should actually be 31 2010-01-26 01:47:29 +00:00
Wanderer ffaca21fdd fix for certain lua control problems, data was read and copied at 'wrong' time. 2010-01-25 12:01:01 +00:00
Goober5000 ec0a7e930e Mantis #1992 - enhanced briefing token support; credit to Pedro with modifications by Zacam 2010-01-25 03:25:41 +00:00
Goober5000 fba4e77284 bump MAX_SHIP_BAY_PATHS per Mantis #1917 2010-01-24 21:50:57 +00:00
Goober5000 b53a2b9cd3 trackIR change for MSVC6 project file 2010-01-24 21:50:29 +00:00
chief1983 266737ff84 Fix for Mantis #1936: Third time's a a charm. Let's see if this doesn't help things a bit. Per KK. 2010-01-24 18:45:16 +00:00
chief1983 d5829ad173 Fix for Mantis #1936 part 2: Some stuff that was fixed exposed more broken stuff. Now should be fixed too. Per KK. 2010-01-23 21:58:57 +00:00
Wanderer 8279944008 separate beam flash from dinky explosion (was not a good idea). Enable beam width setting to affect all beams. 2010-01-23 19:34:59 +00:00
Wanderer 8549f3c71a fix to lua escort ship indexer 2010-01-23 09:02:32 +00:00
Wanderer 1375bab654 fix for the new effects with shield impacts and with missiles exploding without impacting 2010-01-23 07:58:31 +00:00
Wanderer f514d2b25a some changes to beam pierce effect, blob pierce effect, new settings for them both 2010-01-22 15:50:54 +00:00
Wanderer 27ac3b0c05 fury's request, option for huge beams not to draw impact effects when hitting specified type of ship. 2010-01-19 14:28:50 +00:00
Wanderer afbb428349 more chase view mode fixes 2010-01-19 07:28:17 +00:00
chief1983 ed5cd1d06b Fix for Mantis #1936: Per ship gauges should now work properly. From KK. 2010-01-18 16:06:35 +00:00
Wanderer 1de215abd5 potential fix for mantis 2041 2010-01-18 14:58:45 +00:00
Wanderer f7d04a9311 weapon info flags: targetable weapon, show weapon on radar, show friendly weapon on radar 2010-01-17 13:52:34 +00:00
Echelon9 d30cc69e36 Provide a simpler way to set the CFBundleName key in the Xcode project file. 2010-01-16 18:26:05 +00:00
Echelon9 47869f4f32 Add to Xcode project file LSMinimumSystemVersion key for future work 2010-01-16 17:55:10 +00:00
Echelon9 03c24467ea Simplify the Xcode project file's CFBundleExecutable key to be truly extensible 2010-01-16 16:51:43 +00:00
Wanderer 74225ecac9 enable another bitfield for ai profile flags, add ai profiles fix for turrets targeting too distant enemies in certain cases. 2010-01-16 16:14:21 +00:00
Wanderer 8546cac0c0 fix for issue when ai is selecting big attack points 2010-01-16 16:06:32 +00:00
Wanderer dbf5d60ab2 Lua control for getting the full button control data 2010-01-16 13:10:55 +00:00
Wanderer 834e4321a7 fixes for various lua wings and wing ship indexer bugs. 2010-01-14 18:05:48 +00:00
Echelon9 2db4d1c9c2 Cleanup Xcode project file 2010-01-13 09:12:41 +00:00
portej05 8694bb1a29 trackir static library no longer needed 2010-01-13 06:53:31 +00:00
Sushi 9e9b6ada2d Added "$Expl Visual Rad" to ships.tbl. This controls the visual size of the main fireball for ship explosions. 2010-01-12 18:51:36 +00:00
Wanderer c18119c729 make sure the debug data is only used in debug builds (not initialized in release builds) 2010-01-11 21:15:27 +00:00
Wanderer d41514c78e Enable missing controls lua control info. Force fireprimary lua function to work regardless of stream status of the weapons. 2010-01-11 10:39:40 +00:00
Wanderer 9a8202cfd0 Fix for subsystem existing without table entries. Rewrote old disabled warnings related to this issue. 2010-01-11 10:38:00 +00:00
Wanderer e2cfb8017a lua access & related functions to enable player button controls to be operated via scripting 2010-01-10 20:59:31 +00:00
Echelon9 e12839e11e With the removal of final Direct3D references, there are no remaining uses of the NO_DIRECT3D definition in the code base 2010-01-10 08:08:26 +00:00
Wanderer f168b7aab7 fix for a case when player dies before his weapons hit the target (target hit by ghost) 2010-01-09 20:12:03 +00:00
Echelon9 cfec9106be Complete reversion 2010-01-07 17:30:44 +00:00
Echelon9 9824b21218 Revert r5760 training_message_queue changes 2010-01-07 17:21:44 +00:00
Wanderer 0eca97a967 model:checkRayCollision lua function to allowed certain collision checks be done with lua 2010-01-07 15:23:25 +00:00
chief1983 abfb3b7298 Fix Xcode compiling for reals, tested to currently work. 2010-01-07 04:48:25 +00:00
chief1983 9f4b691a98 Fix for Mantis #1934: Secondaries now work when changing from a ship that had none, and FRED won't complain when you can't equip secondaries to a ship. 2010-01-07 04:16:44 +00:00
taylor 951ec34a36 fix broken trackir compiling on non-Windows
eol fixage
2010-01-07 02:48:31 +00:00
portej05 680edc2da3 Remove trackir directory from VS2008 solutions 2010-01-06 17:03:13 +00:00
Echelon9 3085dd4b1c Complete update to Xcode project file 2010-01-06 12:10:24 +00:00
Goober5000 d5ab81c947 add external_dll files to VC6 project
alphabetize the project modules at the same time
2010-01-06 01:21:35 +00:00
Goober5000 9ead43eccd change ExternalDLL to external_dll for cross-platform friendliness
(yes there aren't any errors currently, but this has been a convention since the beginning of cross-platform compatibility)
vcproj and xcode projects are updated accordingly
2010-01-06 01:18:31 +00:00
Wanderer cd15f39847 lua handled collision groups and lua bitwise ops library 2010-01-05 18:00:01 +00:00
Hery c0b2e1b1ec Fix for bloom using outdated mipmaps 2010-01-05 17:51:57 +00:00
Hery 1f40c55c1a Fix for mantis 2078, two pass bilinear downscaling in order to reduce artifacts 2010-01-05 12:56:33 +00:00
Wanderer 3572226340 Fix for mantis 2063 from warfull 2010-01-05 09:41:35 +00:00
Wanderer 93524920bd fix for mantis 2077 2010-01-04 11:21:56 +00:00
Goober5000 cdb6ceb1f1 location oops 2010-01-03 20:20:49 +00:00
portej05 99be9d044d Fix TrackIR compile errors 2010-01-03 14:27:39 +00:00
Echelon9 65fc924f92 Update Xcode project file for portej05's code 2010-01-03 09:46:14 +00:00
Echelon9 8116b15105 Update Xcode project file to reflect removed .cpp/.h source code files 2010-01-03 08:52:46 +00:00
Goober5000 169e4e8518 hooray for function prototypes 2010-01-03 05:55:17 +00:00
portej05 2cc225ba3f TrackIR DLL loading implementation. You need scptrackir.dll in order to run (on internal beta at present). 2010-01-02 14:12:22 +00:00
Echelon9 c2b601bd5c Rename function to correctly reflect what it does 2010-01-02 13:32:43 +00:00
Echelon9 67b86f7377 Make Training_Message_Queue dynamic with SCP_vector 2010-01-02 13:28:56 +00:00
Echelon9 3c6f77811a 2010 2010-01-02 06:33:49 +00:00
Echelon9 dce9388543 Some how the removal of the OpenAL.Framework to address GCC 4.2 issues got reverted 2010-01-01 20:02:47 +00:00
Goober5000 5f7684a795 Zacam's extra colors for briefings (Mantis #2059) 2010-01-01 08:30:53 +00:00
Goober5000 05b509d813 Zacam's fix for Int3 in mission briefing (Mantis #2059) 2010-01-01 08:27:25 +00:00
Goober5000 ba9353ee54 adjust number of lines according to font, per KeldorKatarn 2010-01-01 07:52:22 +00:00
Goober5000 21c28412e3 fix ui window using the same font as fiction_viewer 2009-12-30 21:04:58 +00:00
Goober5000 407c670e74 fix mission load error message
remove deleted files from project
2009-12-30 21:04:00 +00:00
Echelon9 155907b7d0 Update SDL from 1.2.13 to 1.2.14. The changelog can be found at http://www.libsdl.org/release/changes-1.2.html 2009-12-30 19:14:05 +00:00
portej05 442ea06112 safe_strings requires you to specify the size of the destination buffer in some way. (fix build for all non-VC6 builds) 2009-12-30 18:09:39 +00:00
Goober5000 770095c84c allow up to two additional fonts using fonts.tbl
allow specification of fiction viewer font
2009-12-30 08:02:37 +00:00
Sushi 4edb31de72 Fixed a problem in the glide code where thrust was not proportional to framerate. Also made glide ramping more consistent in behavior with normal speed ramping. 2009-12-29 23:10:26 +00:00
portej05 345f7b4bc3 ifdef trackir pending new trackir interface code 2009-12-28 18:06:36 +00:00
Wanderer 44b04ddb93 table defined support ship shield, hull and subsystem repair rates 2009-12-28 16:10:11 +00:00
Hery bce99b342e shader manager and post-procesing files need svn:eol-style set to LF 2009-12-27 16:35:39 +00:00
portej05 2449c9abb4 Locking for PDB_DEBUGGING (multithreadedness will need it) 2009-12-27 15:14:55 +00:00
Hery bc369d5566 fix problems with nebula background 2009-12-27 13:20:51 +00:00
Hery 6939a6c05b fix problems with lua scripts and post-processing 2009-12-27 13:01:42 +00:00
Hery 41156280df fix for mantis 2081 2009-12-27 12:42:11 +00:00
portej05 7b730af602 Remove NEW_MALLOC code
Add strcpy_s where needed in vm_strdup
2009-12-26 07:59:01 +00:00
Echelon9 22869bd825 Complete the removal of the now redundant Info-debug.plist 2009-12-24 08:06:38 +00:00
Echelon9 b8af21a85b Fix Mantis 2079. This change utilised Xcode's Info.plist Preprocessor Definitions to consolidate the .plist files into one; which is dynamically generated for the chosen Build Configuration (Release, Debug, Inferno_Release, Inferno_Debug) 2009-12-24 08:02:27 +00:00
Goober5000 1b7863f1d3 clean out some old font stuff 2009-12-24 04:52:56 +00:00
chief1983 a386e6ae74 Fix the makefile to work with the new executable filenames 2009-12-23 06:45:43 +00:00
chief1983 45b6069d74 Update Linux makefile with recently added/deleted files from post processing and the vampire list 2009-12-22 21:50:06 +00:00
Echelon9 b3bc073a73 Reduced size of Frameworks.tgz by removing the unused OpenAL.Framework (it is linked from the system version, this one was redundant). Mac developers will have to reextract the Frameworks folder to take effect. Preparation for the pending update of out of date SDL, Ogg, Theora and Vorbis frameworks for OS X. 2009-12-22 15:18:41 +00:00
Echelon9 9d342e4133 Remove the Xcode project's references to Makefiles 2009-12-22 14:31:46 +00:00
Echelon9 86b9f2f1f8 Hopefully last step to resolve OS X issues from Hery 2009-12-21 20:03:54 +00:00
portej05 de4d3ea105 Updated to VC6 release files for code commit removing empty sound code files 2009-12-21 11:42:07 +00:00
portej05 b8c080bb8e Mantis 1900 patch from Hery 2009-12-21 11:28:16 +00:00
Echelon9 0dbed68b2a Cleanup Xcode project file for *.cpp/*.h that have been previously removed 2009-12-21 09:23:45 +00:00
portej05 5b633a3342 Removal of empty files/unused files (sine OpenAL is now used in all builds) 2009-12-21 09:12:56 +00:00
Goober5000 0c1a0951d7 rewrite code to bypass bizarre internal compiler error 2009-12-21 03:19:13 +00:00
Goober5000 dfd4f33c1f VC6 project file updates 2009-12-21 03:18:45 +00:00
Echelon9 8822a79e42 Commit of Hery's update to the new shader code to address GCC/Xcode compilation issues 2009-12-19 18:39:32 +00:00
Sushi fc26bd16da Fix for mantis 2031 2009-12-18 17:22:01 +00:00
Wanderer f69d5881ed Patch from FUBAR - set armor type sexp 2009-12-18 10:11:48 +00:00
Wanderer 80545a8a96 Patch from FUBAR - turret direction preference, turret optimum range & turret target priorities sexps 2009-12-18 09:34:23 +00:00
Wanderer c2a526db7d fix to portej's fix to particle code 2009-12-18 07:43:43 +00:00
portej05 e67a50beca Make particles go a lot faster! (until a better system is implemented) 2009-12-18 04:28:13 +00:00
Wanderer c0d76ee6c9 weapon based targeting priorities for turrets 2009-12-17 11:45:08 +00:00
Wanderer 02414bc9d6 making countermeasures function like retail countermeasures. 2009-12-16 07:29:56 +00:00
Echelon9 94a1b2d275 MIN() is defined as capitalised at pstypes.h:274 2009-12-15 06:16:04 +00:00
portej05 5f636a00f1 Potential fix for mac issues caused by inclusion of postprocessing in trunk 2009-12-15 02:56:15 +00:00
portej05 8ccf735e27 Resolve macro definition warning for MAX_MONITORS (renamed MAX_VARIABLE_MONITORS in FSO) 2009-12-15 02:23:23 +00:00
portej05 016d01c345 Woops - missed the two important files! 2009-12-14 17:17:29 +00:00
portej05 cf3a4975da Antipodes #4 - Post Processing from Hery 2009-12-14 13:57:33 +00:00
Goober5000 6993a136c0 the reason for the return statement no longer exists 2009-12-14 05:28:06 +00:00
Goober5000 cc4fb68ea6 fix warnings Zacam noticed 2009-12-13 07:24:59 +00:00
Wanderer 54ebd3ad25 hery's patch for mantis 1945 2009-12-11 08:38:39 +00:00
Wanderer 11c87b9934 make the +override option use the flags set during the current parse tbm event 2009-12-10 14:54:13 +00:00
Wanderer 22586a2fb4 commit of aardwolf's clearOrders sexp function 2009-12-08 18:32:40 +00:00
Wanderer 6120956cd6 Fix for mantis 1998 2009-12-08 18:25:50 +00:00
Wanderer d9808e04f6 Added proper functions and warnings as requested for mantis 2018. 2009-12-08 09:59:05 +00:00
Wanderer 97c7fb934d added a warning to prevent issues like mantis 1946 2009-12-06 10:32:11 +00:00
Goober5000 a679a8f597 remove ai_get_subsystem_type as it's redundant
clean up all sorts of subsystem stuff in sexp.cpp (in particular, use ship_get_subsys when possible)
weapon / sensor subsystem types should work for "weapon" and "sensor", not "weapons" and "sensors" to be consistent
2009-12-06 10:06:51 +00:00
Goober5000 62575f7e23 add hits-left-subsystem-generic and hits-left-subsystem-specific
deprecate hits-left-subsystem
2009-12-06 08:48:03 +00:00
karajorma 66e3333392 Fix an issue with the client side section of sexp_deal_with_ship_flag. 2009-12-06 07:15:36 +00:00
Goober5000 434059b5a2 commit the revision patch originally inspired by Zacam 2009-12-05 22:53:04 +00:00
Wanderer cbdca14ea4 fix for mantis 1976. 2009-12-05 19:15:31 +00:00
Wanderer 0db2ca515f fix for mantis 2016 2009-12-05 12:01:03 +00:00
Goober5000 0b2c715162 project file fixes 2009-12-05 07:17:18 +00:00
portej05 17391ffc18 Turns out enableWindowsKey/disableWindowsKey isn't defined for all platforms 2009-12-05 00:50:09 +00:00
portej05 2560ae1109 MSPDB fix for VC6 users. 2009-12-04 06:58:22 +00:00
Goober5000 4c16a66ba9 fix for Mantis #2044 2009-12-04 06:19:02 +00:00
portej05 031f448be2 Fix "SymRefreshModuleList" symbol not found error on platforms without dbghelp.dll v6.5+ (we really should distribute that monster) 2009-12-03 10:23:59 +00:00
portej05 54f63a1357 Running as standalone no longer disables windows key (Mantis #2047) 2009-12-03 07:01:48 +00:00
portej05 7445380789 Commit to update PDB_DEBUGGING in preparation for new allocator system 2009-12-02 17:16:33 +00:00
Wanderer b9fc819ce2 fix to make sure turret matrices (and turret normals) are properly setup from the start 2009-12-01 08:58:40 +00:00
Goober5000 c092173f36 fix a bunch of problems where sexps with multiple arguments might not work on all of them
fix problem with beam-free-all and beam-lock-all only working on the first ship in a list
2009-11-28 19:15:53 +00:00
Wanderer b98c4e8b75 fix to prevent formation of badly setup turret rotation matrices. 2009-11-27 10:09:20 +00:00
chief1983 34179e931a Change the filename for Linux Inferno builds. 2009-11-25 06:20:19 +00:00
chief1983 cc3e1fd071 Set the Inferno configs to output a different filename than the regular counterparts. 2009-11-24 20:05:06 +00:00
chief1983 0bf1baac94 The_E's 720p hi-res interface art patch. Use hi-res interface stuff at vertical res of 600 and higher instead of 768 and higher. 2009-11-24 03:19:19 +00:00
portej05 02b5fd1496 Remove bitarray.h and substitute with simpler functions (tested via Zacam, Flaming_Sword and portej05) 2009-11-23 12:12:09 +00:00
portej05 583e03890f Strip missed CVS comment 2009-11-23 06:11:24 +00:00
karajorma af7ba40eb4 Add the ability to specify ships or wings to the num-ships-in-battle SEXP (In collaboration with FUBAR). 2009-11-23 04:57:42 +00:00
portej05 67e79b3177 Fix for Mantis 2042 2009-11-23 04:45:51 +00:00
Goober5000 554de8e375 warning fixage 2009-11-23 03:41:40 +00:00
Goober5000 5c88548cab more warning fixage 2009-11-23 03:24:10 +00:00
Goober5000 aac68877ec spacing
fix build warning
2009-11-23 03:23:11 +00:00
portej05 b9a95040f7 Remove name concatenation issue from cfilesystem (hopefully mantis 2042 solved, but that callstack changes depending on whether dbg_filter.cfg is there) 2009-11-22 15:05:33 +00:00
Goober5000 9a98a31b1b fix Mantis #2043 - variable-array-set needed extra sexp_tree management
also, improve type safety for checking for sexp operators (compare the constants rather than using stricmp on the names)
2009-11-22 11:55:40 +00:00
chief1983 c90151f94a Fix for fix for #1945 and #1768: Previous fixes didn't play nicely together. Per Hery. 2009-11-19 17:31:48 +00:00
chief1983 65a31a1676 Fix for #1768: cutscene bars should now be fully functional again. Something about cubemaps, ask Hery :) 2009-11-19 06:06:52 +00:00
chief1983 1435ef0752 Fix for #1914: Add a Skybox CLAMP flag to FRED that forces clamped textures instead of tiling. 2009-11-19 05:51:26 +00:00
chief1983 2cc02d72e3 Fix for #1945: Finish adding the proper rectangle drawing code. Cutscenes now combine FOV change + rectangles. From Hery. 2009-11-19 05:49:23 +00:00
Goober5000 6008752531 bump MAX_ASTEROIDS (I can't believe nobody else has yet) 2009-11-18 09:33:31 +00:00
Goober5000 aeb5fd2789 add two awesome sexps that allow treating sexp variables as arrays 2009-11-18 09:17:01 +00:00
Goober5000 33203d244a add useful parselo function 2009-11-18 08:59:35 +00:00
Goober5000 6f3a91c53f remove unused variable 2009-11-18 08:17:26 +00:00
Goober5000 769d3a4d89 sexp subcategorization 2009-11-18 06:34:09 +00:00
chief1983 2da096f845 Add back in:
_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0; 
until we can fix the code that is visibly broken by removing those.  Per Zacam.
2009-11-18 05:58:11 +00:00
Goober5000 f33a638c61 Zacam's "oops" patch 2009-11-17 04:41:35 +00:00
Goober5000 12033c664b fix knossos animations rendering backwards for ships warping out in certain orientations
(taylor's hack isn't actually needed; the parent_obj can - and probably should, for consistency - be the warping ship, not the knossos)
2009-11-16 07:04:06 +00:00
Goober5000 9ee90c41b7 remove this extra friendly-stealth-invisible check; it's redundant and incorrect 2009-11-16 07:01:49 +00:00
karajorma e900e56e1a Trim out some warning messages. 2009-11-14 11:57:35 +00:00
karajorma 39550294bd Pedro's Mantis 1982 Fix (Afterburners are used from several places in the code for ships with no afterburners). 2009-11-14 09:51:24 +00:00
karajorma b323aa89b9 FUBAR's percent-ships-arrived SEXP. 2009-11-14 09:13:45 +00:00
portej05 35aaf68496 FRED Learns to write in its own log file! 2009-11-14 04:11:16 +00:00
chief1983 c178b00fc1 VS2008 remembers how to build
Zacam fixed the broken merge from Antipodes of the project file updates.
2009-11-13 23:35:08 +00:00
portej05 7e65e47acc Fix for issues caused by memset and _HAS_ITERATOR_DEBUGGING.
Some ugliness involved (placement new - yuck!), however given that a lot of our structures are allocated with vm_malloc, I haven't got a better way around this at present.
2009-11-13 18:06:27 +00:00
portej05 cbaf0e5cc3 Fix more incorrect uses of memset causing crashes 2009-11-13 13:22:59 +00:00
portej05 5fd345352e Fix mistake with globally defined symbols (_SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0)
Add PDB_DEBUGGING to default 'code' builds
2009-11-13 10:09:10 +00:00
Goober5000 9c85ac2835 fix Mantis #1967 (spurious warning about custom wing names) 2009-11-13 08:26:12 +00:00
Goober5000 28120ca20c allow changing of case for ship, wing, waypoint, and reinforcement names per Mantis #2017 2009-11-13 08:07:48 +00:00
portej05 6011414dcc Remove _HAS_ITERATOR_DEBUGGING=0;
Remove _SECURE_SCL=0;
Remove _CRT_SECURE_NO_DEPRECATE;
Add Zacams icons patch
2009-11-12 16:40:27 +00:00
Goober5000 52a939531a load hi-res cbanis, if we have them (Mantis #2029) 2009-11-11 06:33:26 +00:00
karajorma 18933d071a Change the Galactica warp effect name to a more neutral term. 2009-11-09 02:18:34 +00:00
portej05 03c0f38796 Added SCP_string, SCP_stringstream, SCP_map, SCP_multimap and allocator equality operators to vmallocator.h (Hery) 2009-11-08 10:28:35 +00:00
Sushi 771571be7e AI Profiles entries in AI.tbl are now overrides instead of multipliers. 2009-11-05 22:46:54 +00:00
karajorma 74d1c139ed Doh x2 2009-11-05 06:16:15 +00:00
portej05 3aaf81208b Fix for memory debugging functions.
Totals are now more accurate!
2009-11-04 13:03:02 +00:00
portej05 b37058615f Fix Assert in WMCGUI.cpp (Vector subscript out of range) 2009-11-03 07:28:25 +00:00
portej05 25e3fe0f80 Fix stupid VC6 variable scoping for for loop in memory debugging routines 2009-11-02 08:00:58 +00:00
karajorma 133a331fc8 Switch to a more neutral name (which fits better with the others too) for the BSG warpout effect.
Add FUBAR's fix for a radius issue affecting BSG style jumps.
2009-11-02 06:28:28 +00:00
karajorma 6d4a7ec889 FUBAR's bump for MULTI_PXO_MAX_PAGES (it was causing issues for Diaspora). 2009-11-02 06:25:23 +00:00
karajorma 2e8a49a05b Minor unused variable clean up. 2009-11-02 03:44:57 +00:00
karajorma 9f44258319 Bump MAX_OBJECTS, WEAPONS, SPLIT_PLANES, and SWARM_MISSILES. This stuff has been tested by Diaspora for months now so it should be fine. 2009-11-02 03:37:36 +00:00
Goober5000 32450e2984 remove constructors as the init functions will always be called
make sure init functions init all struct fields
fix keyframes for weird FS1 anims
remove "dodgy frame skipping code" since frames should be skipped in certain circumstances
2009-11-02 03:10:19 +00:00
karajorma 5e968aac93 Might as well improve this message while fixing Respawn Delay. 2009-11-02 02:24:08 +00:00
karajorma 3d98b9aeae Error message is back to front. 2009-11-02 02:23:16 +00:00
karajorma 38682babc3 Fix Max Respawn Delay properly. 2009-11-02 02:21:42 +00:00
Goober5000 b43417882f Zacam's & Flaming_Sword's patch for ANI streaming, audited by Goober5000 2009-11-02 01:45:26 +00:00
Goober5000 47e03f4a32 removed an unused variable
fixed saving of mission fiction
2009-11-01 09:52:04 +00:00
Goober5000 fbcb83b9db fix FRED choking on respawn delay by making it default to 0 instead of -1; this does not appear to break anything 2009-11-01 09:51:36 +00:00
taylor de43cc3488 spew table/mission crcs to CSV 2009-10-21 11:12:36 +00:00
Wanderer e1df65d0e4 2009-10-12 14:46:54 +00:00
Sushi 56ff4f45c6 Fixed bomb-firing delay scale bug (actually applied to all secondaries) 2009-10-10 19:25:04 +00:00
portej05 983d9cb94a Fixup debug_int3 (until a better solution can be found) 2009-10-06 10:53:08 +00:00
karajorma f0b8f077d5 Fix for Mantis 1996 (Missing support ship builtin messages) 2009-10-01 06:45:02 +00:00
Sushi f4bd24d720 Moving the ships.tbl +Use Newtonian Dampening flag out of the $Glide flag's tree. 2009-09-28 23:00:04 +00:00
Sushi b12b60d577 Fixed a bug that caused the AI to use afterburner too much (in the past 50 revisions or so) 2009-09-28 22:18:35 +00:00
Goober5000 94038d3822 pretty sure the parent objects here have to be -1, not 0 2009-09-28 01:55:14 +00:00
Goober5000 076cbcf818 don't create duplicate waypoints 2009-09-28 01:54:06 +00:00
Goober5000 f3fa70b18b major goof from me a while ago; ship_info data isn't supposed to be modified 2009-09-27 20:53:23 +00:00
portej05 7a3b09e132 Fix for error introduced in Antipodes 3 which caused animations not to repeat 2009-09-26 11:22:26 +00:00
portej05 0383415a3b Antipodes 3 from Flaming_Sword 2009-09-26 05:52:17 +00:00
Sushi 6542269c77 Fix decade-old AI class bug... including AI_Profiles.tbl flag ($fix AI class bug) to avoid breaking retail compatibility. 2009-09-24 20:40:56 +00:00
Goober5000 e516f97d49 improved some retarded setup code in aicode.cpp
moved create_waypoints() into waypoints.cpp and called it at mission post-process
2009-09-20 08:30:50 +00:00
Goober5000 d4f1e1132c remove python files from MSVC6 project 2009-09-20 08:28:44 +00:00
Goober5000 664df3af89 remove an entirely redundant check that WMC added that has the unfortunate side-effect of screwing up any disabled ship that warps in 2009-09-20 08:03:01 +00:00
Goober5000 2a1b807bdb fix compilation problems 2009-09-20 00:39:42 +00:00
Wanderer 27e87c6a0f fotg request - lua support for reading turret fovs and turret matrix 2009-09-19 08:03:07 +00:00
Wanderer 06f0b169e4 wanderer's ai control system setup (both sexps and lua) 2009-09-17 21:27:45 +00:00
Sushi 2e833278ea Fix for Linux build bug reported by Shadow95 2009-09-17 17:43:14 +00:00
karajorma f2158a72fa Add the remove-weapons SEXP. Fix add-waypoint-nav to work properly in multiplayer missions. 2009-09-15 13:47:38 +00:00
karajorma c81d8fdeec Add the option to set a maximum delay before a player is automatically respawned in multiplayer games. 2009-09-15 13:43:13 +00:00
portej05 5e92431d02 Removal of ASSUME macro behaviour 2009-09-13 15:46:34 +00:00
portej05 057ef78c09 Fix to make the stubs error function have a const parameter 2009-09-12 14:43:11 +00:00
Wanderer 2ee628829a fixes to various things listed in the prefast log 2009-09-11 15:52:18 +00:00
portej05 1a8acd364b ifdefing out of global exception handler pending removal. 2009-09-10 15:53:07 +00:00
portej05 be79cb4991 _asm int 3; replaced with DebugBreak for MSVC users 2009-09-10 15:49:56 +00:00
portej05 6cf641cb96 If -fps is specified, the framerate should always be shown. 2009-09-10 15:49:13 +00:00
portej05 884de6da24 ASSUME macro for preFAST noise suppression and optimisation hints (through Assert macros) for VS2005+ 2009-09-10 15:44:25 +00:00
portej05 44f8eab341 Change to make safe_strings show asserts in release.
safe_strings is now used regardless of whether the CRT supports it (except if you're using VC6).
2009-09-10 07:44:08 +00:00
Wanderer 976b86d607 fixing a logic error from the previous fix 2009-09-09 15:41:07 +00:00
Wanderer f53e3a9143 commit for glowpoint issue reported by darius 2009-09-09 15:26:28 +00:00
portej05 585981e24b post-frame-shaded subtitles! Pass an argument 13 which is either (true) or (false) in order to make use of this.
Fix for multimonitor focus loss issue associated with the mouse at the initialisation of the mainhall
2009-09-09 11:52:42 +00:00
Wanderer b91c8cd616 add lua functions to get and set individual HUD gauge color 2009-09-09 09:19:33 +00:00
Sushi 01c5a62b1a Fixed an oversight in my last commit 2009-09-09 04:44:23 +00:00
Sushi 890b1bee36 Added $Max Aim Update Delay to AI_Profiles.tbl (and AI.tbl). $Max Aim Update Delay allows AI aim to "lag" somewhat, making it more possible to evade high-velocity weapons. 2009-09-08 23:32:03 +00:00
Wanderer 780f5e9d09 re-enable both interface and game sound playing from audio lib. 2009-09-08 15:33:34 +00:00
Wanderer f675bde3db fix for detonation_radius issue reported by FUBAR_BDHR 2009-09-08 06:57:05 +00:00
Wanderer 5b1ceed359 from prefast log.. add missing casts 2009-09-07 16:15:35 +00:00
portej05 2e08994ede preFAST noise reduction - these will get optimised out in a release build. 2009-09-07 11:40:02 +00:00
portej05 49ce1e23a5 Fullscreen window request from QuantumDelta 2009-09-07 11:39:32 +00:00
portej05 07b1ea4a3a Logic bugs - ((state != blah) || (state != blah2) ) is always true, so that || should be a &&, and !blah.state & flag != !(blah.state & flag) 2009-09-07 11:13:52 +00:00
Wanderer db1a9508b6 reverting code change - seems only to make things worse 2009-09-06 15:16:23 +00:00
Wanderer c9adb19837 fix for mantis 1944 2009-09-06 13:40:01 +00:00
Wanderer 84c2ad3461 FUBAR-BDHR's fix for 'knossos device' string appearing twice as 'knossos device device' in default objecttypes table 2009-09-06 08:25:37 +00:00
Wanderer 0b742d2301 fix to allow missiles not fired directly at the enemy to home on random spots on the target ships hull. 2009-09-06 08:21:57 +00:00
portej05 0de4a7d9ae Fix for WiH crashes - I reckon this might be the cause of a few peoples problems (using bitwise & instead of logical &&) 2009-09-06 07:41:14 +00:00
Wanderer cf2ef994e9 option to prevent missiles from losing lifetime if they miss their targets 2009-09-04 17:08:24 +00:00
Wanderer d21f8d106f fix for occasional turret locking issue 2009-09-04 17:07:47 +00:00
Echelon9 087f141218 Correct grammar 2009-09-04 08:36:46 +00:00
Wanderer f6fbd4aa1d commit of 'turret direction preference' (int - percentage) - meant to allow turrets to prefer targeting the targets close to the previous target. 2009-09-02 18:17:21 +00:00
Wanderer 7678d0b0c8 weapon flag to allow weapons (including player weapons) not to home on subsystems 2009-09-02 18:14:46 +00:00
Wanderer 5e9bf597c5 debris hitpoints (min/max), debris ship collision damage multiplier. 2009-09-02 08:32:43 +00:00
Wanderer 0715c8d504 Change to collision prediction when using additive weapon velocity. Change to allow 'arm_radius' to sue homing position instead of homing object pos as distance measuring point. Allow weapons with arm_radius to count as armed if they collide with intended target. 2009-09-02 08:13:39 +00:00
Wanderer 468fd91442 Optimum range setting for turrets to help with turrets re-targeting objects inside their minimum range 2009-09-02 08:09:18 +00:00
Wanderer 9eb42469a9 fix for debugging CTD in clean_filename function 2009-09-02 05:17:30 +00:00
Echelon9 822828f412 Force GCC 4.0 as the compiler (for those who've updated to Snow Leopard and Xcode 3.2) while we sort out GCC 4.2 deprecation 2009-09-01 08:16:44 +00:00
Wanderer a92e6bfb1d fix for shockwave and 'carry no damage' flag - addition of 'carry shockwave' flag for subsystems 2009-08-31 17:13:58 +00:00
Wanderer 4ce4880c70 improvements to how subsystems and armor interact 2009-08-30 21:16:48 +00:00
portej05 fb3c9dd696 Fix for interface weirdness in the multi ui (Props to Flaming_Sword and The_E) 2009-08-30 12:09:46 +00:00
Wanderer f1e808aa62 fix for a null vec issue which fubar hit. 2009-08-30 07:51:55 +00:00
karajorma 78deb06ea2 Fix Mantis 1987 (Too many calls to good-secondary-time causes an Int3() ) 2009-08-30 04:24:09 +00:00
karajorma cf949cc6ad Fix a typo, remove some unreachable code, add some missing casts. 2009-08-29 09:32:36 +00:00
Sushi 8b8f325e71 Updates to ai.tbl to allow AI behavior to NOT use the index of the AI class in its logic. In other words, added stuff so that you can create AI classes where their order in the file doesn't affect how they perform.
AI now uses the (previously unused) "Patience" attribute to determine how quickly to break out of a "stalemate" situation (higher patience means willing to endure stalemate for longer). Only matters if the stalemate detection stuff is used as well.
2009-08-29 01:20:11 +00:00
Wanderer 24c94fc72c option to always allow hull armor type to be used (fix for mantis 1973) 2009-08-28 13:48:24 +00:00
portej05 5294e3e1ee Hery's shader unification patch (from Antipodes #2) 2009-08-28 13:16:53 +00:00
karajorma 72af11bb6d Allow bombs to use their actual radius when working out collisions rather than doubling it. 2009-08-28 07:59:31 +00:00
Wanderer ccda696429 runsexp debug console functions - runsexp lua scripting functions 2009-08-28 07:53:45 +00:00
karajorma 8a10fb3181 Don't bother with any other AI checks for afterburner use when the ship doesn't even have an afterburner. Might fix Mantis 1982. 2009-08-28 00:04:25 +00:00
Wanderer 9a1bfaf9c1 Fix for mantis 1986 2009-08-27 15:34:51 +00:00
karajorma 1fb668de99 FUBAR's Fix to make debugging message errors a little easier. 2009-08-26 08:39:41 +00:00
karajorma 5180dc1146 Fix Mantis 1984 (Using sexp_deal_with_ship_flag() on anything ship-vanished causes an Int3() ) 2009-08-26 06:03:11 +00:00
karajorma cb5bcc3369 Fix an issue with the location of the Number Used In Wings label. 2009-08-25 14:49:40 +00:00
karajorma 8edf0d43ed Fix Mantis 1974 (Muzzleflashes don't show up in 3.6.11 builds). 2009-08-25 14:48:18 +00:00
taylor 1529b99932 ensure init_scoring_element() initializes properly (Mantis #1827) 2009-08-25 01:09:32 +00:00
taylor 85920f2151 fix resetting of mission stats when reconnect of FS2NetD happens 2009-08-25 01:09:30 +00:00
taylor a1259d02a8 remove libreadline dependency since we don't need it and can't use it anyway (redo of r.4603) 2009-08-25 01:09:28 +00:00
chief1983 867a8a643f portej's safe strings fix for OS X problem 2009-08-24 16:58:46 +00:00
Sushi 9990637240 Fix so that checking subsystems that are allowed cargo is case-insensitive 2009-08-24 16:05:32 +00:00
Sushi 95a8b8c730 Fix for bug reported by Spoon (http://www.hard-light.net/forums/index.php?topic=65285.0) 2009-08-24 14:16:55 +00:00
Wanderer 75a514b5f9 split 'is_vec_null' macro into normal and 'safe to square' macros. 2009-08-23 11:36:44 +00:00
Wanderer b559c0959b fix for code trying assign 'light laser' and 'rockeye missile' to the weaponbanks if ship class didn't have enough weapons defined for it 2009-08-23 09:33:48 +00:00
Wanderer 48cc61733c option to force beam turrets to use same FOV limits as the rest of the turrets 2009-08-22 09:25:34 +00:00
Wanderer b77b9adf39 turret fov check improvements 2009-08-22 09:00:33 +00:00
Wanderer 8124f3d81d commit of set of vm_vec_normalize_safe functions to modelread.cpp 2009-08-22 08:41:53 +00:00
Wanderer 23521c1e3b nuke's scripting and submodel animation changes 2009-08-22 06:32:11 +00:00
Wanderer 064ab52578 lots of fixes to the earlier burst fire mode 2009-08-21 18:20:28 +00:00
Wanderer 09db476623 fix for shield armor issue reported by Qent 2009-08-19 17:19:37 +00:00
karajorma 3d02219bd7 Bump the number of manoeuvring thrusters again. This probably should be made dynamic at some point. 2009-08-19 06:58:46 +00:00
Sushi eb4b7c03e9 Major expansion of AI.tbl. AI.tbl now allows per-AI-class changes to AI settings in AI Profiles. Numerical values (such as $Glide Attack Percent or $Predict Position Delay) are handled as multipliers. YES/NO flags are overridden if set for a specific AI class. All of these multipliers and overrides are optional, and only active if explicitly specified for an AI class. 2009-08-18 04:32:40 +00:00
Wanderer 02718dd5eb fix for low res medals screen (by flaming sword) 2009-08-17 11:41:59 +00:00
portej05 6d7343b17d Another offsets fix from Flaming_Sword (optionsmenumulti.cpp Line 471 20->31)
What appears to be an indexing error (cheers wanderer!)
2009-08-15 16:40:29 +00:00
portej05 6a1d3d3862 Flaming_Swords Interface Fixes "fixed popup dialog button errors" 2009-08-14 15:42:19 +00:00
portej05 06ef9910c4 Windoze->Windows
(Another) Fix (Attempt) for Mantis 1090. Make the IS_VEC_NULL now check small ranges, not just == 0.f
2009-08-14 12:18:58 +00:00
Wanderer ed0821391e lua virtvar to check and control hud draw status 2009-08-14 11:39:30 +00:00
Wanderer 8826c47460 fix for the support ship issue 2009-08-13 17:23:23 +00:00
Echelon9 3810491748 Modified version of blowfish's FSAA implementation for OS X. Enabled in ~/Library/FS2_Open/fs2_open.ini with OGL_AntiAliasSamples 2009-08-13 12:41:47 +00:00
portej05 6c2aea0db5 Quick update to mspdb_callstack.cpp to handle 64bit windows more correctly (I think - nobody has actually managed to compile FSO on 64bit windows successfully yet.)
Offset fix from Flaming_Sword for the music slider in optionsmenu.cpp (281->279 on line 189)
2009-08-13 04:25:50 +00:00
karajorma 560ab1a5b0 That really needs to be more than just an assertion. 2009-08-09 11:49:21 +00:00
Echelon9 35a8b8bb08 Proposed change for a OpenGL GLint fix in Snow Leopard 2009-08-08 06:02:00 +00:00
Sushi 66db559d2c Some fixes/improvements to AI glide stuff, cleaned up some comments and notes 2009-08-05 05:36:45 +00:00
portej05 1a70dbca7a Get rid of confusing magic numbers and boolean logic that is confusing on non-0 or not numbers. 2009-08-03 15:31:36 +00:00
Wanderer 8fc13dc9d7 Fix for the 'carry-no-damage' subsystem flag, feature commit of shield armor types and shield armor type based piercing percentage setting. 2009-08-02 12:56:26 +00:00
Wanderer cc624e61cd fix to allow live debris from static subsystems 2009-08-02 12:20:36 +00:00
portej05 aa25b5a591 Fix for pdb debugging not showing the symbols on subsequent warnings. 2009-08-02 09:22:40 +00:00
portej05 be186cd01d Fix crash when no cutscenes are defined (NULL pointer dereference through vector [] overload) 2009-08-02 06:32:38 +00:00
Wanderer c19d78f82f variable lead prediction missiles & untargeted heat seekers (aka 'primitive sensor' heat seekers) 2009-07-31 17:26:55 +00:00
Wanderer 0dc516368a commit of target highlighting options mostly for radar icons 2009-07-31 17:25:29 +00:00
portej05 0b1bfe8003 ifdef logic correction for safe_strings (VS2008 release build)
Full logic description is included in comments - please check!
2009-07-31 15:02:56 +00:00
Echelon9 2706a10aca Well yes, but the issue is that strcpy_s was out of scope though 2009-07-31 11:07:10 +00:00
portej05 dcafaa6780 Update to asserts that come from safe_strings - now they print out what they're trying to concatenate - still some ways to go on how pretty they are though (strcat_s will not show the current contents of the buffer, so a short filename might appear to cause the assert, but it's being concatenated with a very long directory structure - the buffer size shown is the full buffer size, not the remaining size) 2009-07-31 09:45:50 +00:00
portej05 dac9c92928 safe_strings is actually safe here (copying stack buffer to stack buffer) 2009-07-31 09:30:03 +00:00
Wanderer e7ff18e13d fix for BP assert due arm_radius 2009-07-30 12:40:52 +00:00
portej05 9bafc782f9 Change taylors change for readability in version.cpp (char buffer initialisation)
safe_strings now spits more, but can be turned off using NO_SAFE_STRINGS (spits during build)
2009-07-29 16:03:15 +00:00
taylor 8cd76d8d41 fix strcpy_s() changes where they didn't need to be or just can't be used 2009-07-29 15:13:34 +00:00
portej05 98f337f701 safe_strings - from Antipodes build #1 2009-07-27 16:06:24 +00:00
portej05 fe7ff55ea2 Restrict semantics for VC2005+ and GCC (not actually used anywhere yet) 2009-07-26 10:13:39 +00:00
karajorma 8a811104b5 Add support for ammo low builtin messages when there is no support ship in the mission. 2009-07-25 16:31:51 +00:00
karajorma f848621a1b Ugly hack for the player ordered disarm/disable issue WCS have been experiencing. 2009-07-25 14:58:25 +00:00
Echelon9 414ce88c58 Clarify a code comment re:GCC 2009-07-24 17:26:43 +00:00
portej05 25e3cd89c4 Fix mistake in extended safe_strings for VS2008 macro expansion 2009-07-24 07:54:35 +00:00
Echelon9 11034e3376 Cleanup Xcode project file post DirectX purge 2009-07-22 14:46:35 +00:00
Echelon9 aadd6ca7c1 Fix use of uninitialised variable reported by valgrind 2009-07-22 09:48:01 +00:00
Echelon9 3bf44ae5b1 Reflect the change to 3.6.11 in Xcode 2009-07-22 09:13:25 +00:00
portej05 673ac40dba Fix for Rodos long, single-word hud message issues. Seems that hudmessage.cpp didn't correctly handle all the possible return values from split_str_once 2009-07-22 05:08:49 +00:00
taylor 737496d65c bump buffer to allow for more tables (99 minimum) during validation 2009-07-22 02:21:24 +00:00
chief1983 95ab9dffa9 Add Zacam's changes (slightly modified) to the VC2008 config - adds Inferno configs and cleans out some kruft 2009-07-21 22:52:19 +00:00
Sushi 7c0008c211 Changed ranges for "$Glide Attack Percent," "$Circle Strafe Percent," "$Glide Strafe Percent", and "$Vaporize Percent Chance" to be between 0-100 instead of 0-1. 2009-07-20 19:52:41 +00:00
chief1983 2f1ca39df8 VC6 updates - add safe_strings, remove Python, remove other vestigial non-existent D3D files 2009-07-20 17:56:01 +00:00
chief1983 060cfbc7ae Fix odd VC6 complaint about a string that was too long. Guess that's what all those double quotes are for. 2009-07-20 17:55:06 +00:00
chief1983 c1a599ac0f Likely unnecessary removal of non-existent files from makefile. 2009-07-20 15:56:41 +00:00
chief1983 90d350816c Add safe_strings to linux makefile. 2009-07-20 15:53:07 +00:00
Wanderer 014b7e4300 Commit of thruster effects for ship and weapon flame and for weapon glow effects 2009-07-19 16:07:23 +00:00
portej05 4c350109dd More safe_strings fixes. 2009-07-19 15:54:59 +00:00
portej05 90943b80c2 Update to safe_strings to give information while in debug mode under VS2005+ (uses scp_str*_s instead of str*_s in debug mode) 2009-07-19 11:15:33 +00:00
portej05 013997a0dd Missed another one. 2009-07-19 08:07:48 +00:00
portej05 9fce479b91 Missed a buffer. 2009-07-19 07:57:39 +00:00
portej05 c5ee5f5e33 Bump buffers causing safe_strings asserts 2009-07-19 07:56:04 +00:00
chief1983 a1699f9edd Port from 3.6.10 branch of fix for dropping issues in the mod warning system, r5458. 2009-07-18 21:34:31 +00:00
Echelon9 89f4e8985b Small fix 2009-07-18 18:13:52 +00:00
portej05 7db0e1c4f1 Debug versions of safe_strings now show where the error occurred 2009-07-18 18:02:58 +00:00
portej05 41bf8dd1d4 Added some new strcpy_s calls 2009-07-18 17:15:17 +00:00
karajorma ee761c8dfc GUI and mission saving stuff for Chief's Force-Shields-On Parse flag. 2009-07-17 21:18:22 +00:00
portej05 86fd3cc17d Some VC6 builds apparently borked by SCP_vm_allocator. VC6 now uses std::vector without a custom allocator. 2009-07-17 12:10:36 +00:00
Echelon9 cfb53105be Apply some of portej05's recent changes to the Xcode project file 2009-07-17 08:15:40 +00:00
chief1983 c9ca0cab25 Add the phrases.xml and its file configuration so that grammar.h and phrases.cfg get generated for VC2008 builds.
This is a necessary step for FS2_VOICER builds to be built, even by 2008 Pro.
2009-07-16 19:58:51 +00:00
portej05 3ac9167ac7 Some safe_strings in use!
Note that I couldn't figure out the buffer size for some of them, so they haven't been changed. The buffer size should be passed as a function argument in future.
2009-07-16 15:18:11 +00:00
portej05 23fcd2968e Fix for embarrassing bug in safe_strings. 2009-07-16 12:48:11 +00:00
portej05 51968f1a77 Fix possible compile error on VC6 platform 2009-07-16 10:14:58 +00:00
portej05 e7db3e6bef Fix the broken comment in safe_strings.h
Add safe_strings.h to pstypes.h
2009-07-16 10:00:50 +00:00
portej05 76ddbc8c2a Checkin of files related to safe_strings, and adding to the project tree (VS2008) 2009-07-16 09:50:34 +00:00
karajorma 0bde3e5d8f Fix a couple of typos other people made. One minor, one not so minor. 2009-07-15 21:49:15 +00:00
Sushi f20e481ba2 Added $Vaporize Percent Chance flag to objecttypes.tbl and ships.tbl. This flag (which takes a value between 0 and 1) allows ships to sometimes explode instantly instead of going through a death roll. 2009-07-15 21:23:46 +00:00
Sushi d4cc6c215e Added burst-fire for ballistic primaries (controlled with the $Primary Ammo Burst Multiplier flag in AI_Profiles). 2009-07-15 19:29:49 +00:00
karajorma 2ffc8487c4 Really need to remove the mission stuff from those too. 2009-07-15 15:19:31 +00:00
Echelon9 4e5c2a89d8 Ensure Sushi's latest AI changes work with gcc, as well as Visual Studio 2009-07-13 20:33:43 +00:00
Sushi 9246a2f74d Additional AI code, including stuff taking advantage of glide and sidethrust. Includes: Flag for allowing fighters to dodge vertically as well as horizontally, "stalemate detection" to help AI break out of circle fights and other stalemate situations, "glide attack" where AI fighters will use glide to fly away while shooting back at you, "circle strafe" where AI fighters will use sidethrusters to jink around while shooting, and an (incomplete) version of "glide strafe" that allows fighters/bombers to use glide to attack capital ships. All new stuff is off by default, and can be turned on with AI_Profiles flags. 2009-07-13 20:08:32 +00:00
portej05 915a9270c9 NEW_HUD Removal commit 2009-07-13 15:48:38 +00:00
portej05 29abf1f51c Python Stripping. Can't promise to have gotten the whole lot though. 2009-07-13 14:11:24 +00:00
chief1983 b0b03a7f7d Fix 1959, the shockwave flag. Again. Hopefully this one doesn't have any other repurcussions. 2009-07-13 01:20:36 +00:00
Echelon9 7af7b91b56 Another instance of std::vector, converted to SCP_vector 2009-07-12 09:36:31 +00:00
karajorma c77a70bfda A couple more vectors that slipped the net. 2009-07-11 17:52:33 +00:00
karajorma 1e80a663af Make messages dynamic. 2009-07-11 17:40:46 +00:00
karajorma fcd9f2b8fb Looks like one SCP_Vector was missed. 2009-07-11 14:18:29 +00:00
portej05 6a8d45c93d Replace most instances of std::vector with SCP_vector. Memory is now all run through vm_malloc and vm_free.
Watch it go up AND down in mission.
2009-07-11 07:07:57 +00:00
karajorma a9179e2db4 Add the Get-throttle-speed SEXP. 2009-07-10 17:07:07 +00:00
Echelon9 c91bf775bb Reflect 3.6.11 version string in Xcode 2009-07-09 12:43:36 +00:00
portej05 5d6b9be53c Removal of DirectX from the codebase.
VC6 and VC2008 solutions have been updated.
2009-07-09 11:35:43 +00:00
portej05 ba4d5c7132 Fix VC6 string too long compile error (props to Flaming_Sword) 2009-07-09 11:16:49 +00:00
karajorma 48d8822bd9 Fix Mantis 1957 (Too many subsystems crash FRED). 2009-07-09 10:55:13 +00:00
Wanderer 657eed8106 Non-swarm type burst fire firing mode commit 2009-07-07 17:08:50 +00:00
Wanderer a5f5e912c3 ai profiles flag to allow turrets to ignore hardcoded fov limits 2009-07-06 20:49:51 +00:00
karajorma 81c1002211 Fix the Primary/secondary-fired-since SEXPs 2009-07-06 17:36:44 +00:00
Wanderer 94ddf755da moved ai's missiles fired at player limit to ai_profiles.tbl 2009-07-06 15:40:21 +00:00
karajorma 31d6469fde Can't say for certain this will cause a speed up but it definitely places the faster check first. 2009-07-06 13:28:33 +00:00
karajorma 5efb4abb9f Looks like the previous SEXP code optimisation didn't take into account the fact that the game tramped values as well as operators through that function so it could call eval_num(). Fixing that gets rid of another few million needless calls to stricmp. 2009-07-06 11:27:31 +00:00
karajorma bc633ce96e Allow clients to pass variable changes to the server (when using lua). 2009-07-06 10:04:19 +00:00
karajorma d121b449d3 Change the way the game figures out the current SEXP Operator in-game as the old method was a massive slowdown. 2009-07-06 10:03:03 +00:00
Goober5000 772865c027 documentation per KeldorKatarn's request 2009-07-06 05:57:17 +00:00
portej05 963fcf87b4 Fix bug in vmallocator. 2009-07-05 15:03:05 +00:00
portej05 720391f8f4 Fix potential undefined behaviour bug. 2009-07-05 06:53:29 +00:00
portej05 d14ace67b0 Customised STL allocator (uses vm_malloc and vm_free) - not actually used anywhere in this commit. 2009-07-05 04:21:55 +00:00
portej05 85eab173d2 Removed more memset(this ... ) statements. 2009-07-04 14:48:16 +00:00
portej05 bdd1f5ff9f Missed a few! (CVS Comment blocks) 2009-07-04 13:39:58 +00:00
portej05 e704b86f72 Browse information turned off for VS2008.
Doesn't affect intellisense, only affects View->Object Browser (not commonly used)
2009-07-03 17:49:01 +00:00
chief1983 d973756d7f KeldorKatarn's fix for Fire Down Normals flag. 2009-07-03 17:08:33 +00:00
portej05 ee5e08868d Fix for Mantis 1949 - Aardwolf has tested this patch. 2009-07-03 15:37:31 +00:00
portej05 3e9707bd0b Got rid of the memset(this,0,sizeof(species_info)) in species_info - defined constructors for a bunch of structs that species_info depends on 2009-07-03 14:29:58 +00:00
chief1983 8b7917d084 No primary linking ship flag. Good thing Kara did 5395 or this would be one more that caused problems. 2009-07-02 23:23:55 +00:00
karajorma f24633cba2 New bug uncovers old bug. Neither particularly serious but both were annoying Diaspora debug builds. 2009-07-02 17:32:32 +00:00
portej05 aebae0185a Warning now makes sense when it is displayed. 2009-07-01 14:31:32 +00:00
Echelon9 4808e4557a Addition of get-fov SEXP 2009-07-01 11:09:06 +00:00
Goober5000 b6e4ccfd05 remove the three additional options from possible squad msgs for support ships; but thanks to WMC's feature they can be added for mods
synchronize comments on the comm menu and flags
2009-07-01 03:47:54 +00:00
karajorma 9df31c7d79 Colour in the ship names in FRED since no one uses wireframe mode to see what is marked these days. 2009-06-30 22:01:39 +00:00
karajorma 5992a55a77 Well that shouldn't have always been saved! 2009-06-30 22:00:24 +00:00
portej05 6281b057ee Fix the FRED crashing on startup problem 2009-06-30 20:18:21 +00:00
Echelon9 948ccf959e Cleanup sexp_set_fov() 2009-06-30 10:39:54 +00:00
Goober5000 f1cc46a562 fix for Mantis #1942 (support ship message using wrong persona)
made the message selection more robust and cleaner while I was at it
this also fixes Kara's multiple-builtin-message feature, as I don't think it would have worked properly in the previous revision :D
(it would have bailed after finding the first message match)
2009-06-30 04:24:15 +00:00
Goober5000 f67596bc5e better checking of wingmen persona headz
fix Mantis #1874 (Command messages check for existence of ship)
2009-06-30 03:34:26 +00:00
Sushi fe87aed445 Added "$nocollide_this_only" and "$collide_invisible" submodel flags. The first one is like $no_collisions, but not recursive on submodels. The second one allows weapon impacts on the special "invisible" texture (normally only ship collisions are allowed). These two flags can be combined to implement invisible collision meshes, which can save a lot of FPS for complex models. 2009-06-29 18:55:20 +00:00
karajorma c9631721c5 This should only have caused problems with corrupt missions but given that it does that with the final FS2 mission it should be fixed. 2009-06-27 08:15:40 +00:00
chief1983 7015ffa0b2 Complete the gutting of safe_strings. 2009-06-24 17:27:09 +00:00
portej05 be743859c0 Removal of safe_strings code - not VC6 compatible :P 2009-06-24 16:56:11 +00:00
portej05 0ebf630314 KeldorKatarns Shield Checking Code. 2009-06-24 16:17:46 +00:00
chief1983 7a37841292 Fix a Lua function so the scripted mainhall works with multiplayer 2009-06-22 23:23:07 +00:00
portej05 0c93ba4501 This simple change means that speech works under VC2008.
I suggest getting the PSDK (rather than relying on the files in /speech/), and defining FS2_SPEECH in both code and Freespace2.
Then you're good to go!
2009-06-22 16:09:27 +00:00
portej05 b91be33343 Just->Error in windebug 2009-06-22 06:37:32 +00:00
Echelon9 0cc4ebc9ef Adopt Assertion in safe_strings.h 2009-06-21 19:09:02 +00:00
Echelon9 7f79f08d32 Update Xcode project file for safe_strings.* 2009-06-21 18:52:21 +00:00
Echelon9 4c55c88b22 Cleanup includes 2009-06-21 18:36:34 +00:00
Echelon9 0666011353 Small change to safe_strings.cpp 2009-06-21 18:22:40 +00:00
Echelon9 015f4a5ef6 Updating portej05 str*_s implementation 2009-06-21 18:01:11 +00:00
portej05 5ad2dcf4b5 Add safe_strings to pstypes.h - forgot to do it in the last checkin 2009-06-21 17:27:24 +00:00
portej05 5b4c5f388c Fixed up some indentation in pstypes.h - the assert section is now readable
Added a space after the ! in the stack tracing using DbgHelp
Added the str*_s basic functions. Note the licence in the top. (also, this only updates the VC2008 project)
2009-06-21 17:08:18 +00:00
portej05 cb51bf1eb5 Callstacks now work under VC2008 - define PDB_DEBUGGING to use. (you need the PSDK to make this work)
See the post in SCP for what/why.
2009-06-21 15:39:13 +00:00
chief1983 9103c5f217 Zacam's enhancement for briefing text colors. 2009-06-20 18:28:13 +00:00
karajorma 18f82eab12 KeldorKatarn's Capship screams fix. 2009-06-20 16:50:18 +00:00
karajorma 7d08f2fecb Add the Trigger Count setting to allow events to repeat a certain number of times rather than simply be tested as with Repeat Count. 2009-06-20 11:27:50 +00:00
Echelon9 98f27b88dd Fix for required_string_4() and readability in ship.cpp 2009-06-20 09:59:04 +00:00
portej05 719825f80d The big CVS comment removal. This chops approx. 3.5mb off a full checkout.
I've tested this through compiling and through hand checking. 
Normalises line endings in ALL files to \n.
2009-06-20 08:08:20 +00:00
portej05 af37fc1b1b Fix for mantis 1933. Despite the huge ugly looking changes, there's only really 2 lines of code changed and indentation has been added. 2009-06-20 07:40:04 +00:00
portej05 8b43ed823c Fix for Mantis 1938. Has been tested against plain mediavps and blueplanet by Sushi 2009-06-20 07:38:02 +00:00
portej05 2f307a06fe Fix one of the static analysis errors Wanderer reported (leaking handle in cfilearchiver.cpp write_index) 2009-06-20 07:36:40 +00:00
portej05 da4d3ce2af remove-goals sexp commit. This has received testing, however it hasn't been pushed to the limit.
http://www.hard-light.net/forums/index.php/topic,63249.0.html
2009-06-20 07:24:46 +00:00
portej05 f7a8bf844b Fix the CTD in aicode.cpp when autopilot is engaged, but not in AP_CINEMATIC and wing_leader == NULL. Probably does not fix all the autopilot woes. 2009-06-20 07:21:41 +00:00
karajorma 9abc540362 Plug a memory leak. 2009-06-19 18:43:20 +00:00
Goober5000 dfb8d4cadf clean-up the end-campaign sexp logic and fix the end-of-campaign movie playing
this leaves room for possible future specification of end-of-campaign movies
2009-06-16 04:14:27 +00:00
karajorma 286a7fca3e Commit Sushi's improved glide changes. 2009-06-14 15:57:45 +00:00
Wanderer 77a8ab89e8 move the bomb delay timer to its proper place in internal ai_profiles.tbl 2009-06-14 09:38:49 +00:00
karajorma 5e3ca2f514 A few minor fixes. 2009-06-13 18:08:54 +00:00
Wanderer c817826d45 commit of Nuke's and Aardwolf's lua functions 2009-06-12 11:38:18 +00:00
chief1983 87fa567516 Whoops. 2009-06-11 04:30:13 +00:00
chief1983 5bd74f4ab3 intrinsic no shields flag for ships.
force-shields-on p_obj flag for mission ship object (overrides intrinsic no shields, don't use with no shields).
No FRED checkbox yet for force-shields-on yet.
2009-06-10 20:19:01 +00:00
Wanderer 79adc6dde8 Echelon9's update to bring lua to version 5.1.4 2009-06-10 09:46:20 +00:00
Wanderer 16db9601ac change mouse_force_pos call to mouse_set_pos call in forceMousePosition lua function 2009-06-10 07:54:52 +00:00
karajorma 15fe7f2ffe Commit Echelon9's flag to prevent the addition of noise to thrusters. 2009-06-06 10:46:10 +00:00
Goober5000 7121dd75d5 clarify op_submenu comment (it had been moved from sexp_tree.cpp to sexp.cpp)
reorder weapon, shield, and engine sexps for consistency
2009-06-03 04:11:42 +00:00
Goober5000 1e4447111a fix bug found by RedDwarf which would overflow the array if (e.g.) Alpha wing ever had six ships 2009-06-03 03:59:50 +00:00
Wanderer dbd42fca7c joystick sensitivity change to improve the accuracy of the controls 2009-06-01 20:33:32 +00:00
chief1983 6d999b5b9d Add the new FRED files to the VC6 projects too. 2009-05-30 21:54:52 +00:00
karajorma cd5faf4e8c Fix yet another VC6 only issue. 2009-05-30 21:22:05 +00:00
chief1983 0c8b78505f Add multi_sexp files to Xcode project 2009-05-29 15:47:55 +00:00
chief1983 a482a9a4a5 Add multi_sexp files to the VC6 projects. 2009-05-29 15:28:04 +00:00
chief1983 f0feac6f70 Committing for Karajorma since he's occupied - fixes Assertion code from breaking Linux now 2009-05-28 21:32:46 +00:00
karajorma 96852832cc Fix compilation of Assertion on MSVC 6 and compilation of multi_sexp stuff on Mac OS X 2009-05-28 13:00:26 +00:00
Wanderer 84423fbcf3 fixing vector rotation issue in subsystem targeting 2009-05-25 21:16:00 +00:00
karajorma 8bdc2c1a9f Portej05's second set of preFAST fixes. 2009-05-24 21:38:22 +00:00
Wanderer 875b735417 fix for the release build crash reported by HT 2009-05-24 07:09:16 +00:00
Wanderer de5f86bd79 fixing the number of lua enumerations 2009-05-23 19:22:05 +00:00
Wanderer eb1bd98ee8 merge from wanderer branch - additional options for lua mouse control 2009-05-23 07:29:56 +00:00
Wanderer 2a69aaa23b merge from wanderer branch - lua flight control option 2009-05-23 07:06:11 +00:00
karajorma 24de2cb225 Bobboau's Skybox flags code (via Wanderer then me) 2009-05-21 14:57:33 +00:00
karajorma 77d60f603c A piece of WMC's warp code that somehow missed being committed. 2009-05-21 14:15:41 +00:00
Wanderer 1302964fbf merge from wanderer branch - trail & contrail leading edge fade out option 2009-05-21 08:50:31 +00:00
Wanderer 7f36e6dc8f merge from wanderer branch - emp protection option for weapon, emp resistant option for ships 2009-05-21 08:37:48 +00:00
Goober5000 8fcee4ebe2 add Taylor's fix for Mantis 1768 (cutscene bars) 2009-05-21 08:33:02 +00:00
Goober5000 e79c4fd923 fix ship-to-ship collisions; they should be disabled iff the ship has a no_collide flag, not iff the ship is a navbuoy
(fortunately, in retail, all navbuoys also have no_collide flags)
2009-05-21 08:31:31 +00:00
Wanderer 943969aac1 merge from wanderer branch - fix inconsistencies with subobj_name and name 2009-05-21 08:19:51 +00:00
Wanderer 7cc7000f88 merge from wanderer branch - additions to alt subsys name from r5125 2009-05-21 08:05:46 +00:00
Wanderer 629b7558f7 merge from wanderer branch - alt subsys name for damage popup 2009-05-21 07:31:43 +00:00
Wanderer 2036fb95cc merge from wanderer branch - turret target priorities setup 2009-05-20 20:43:01 +00:00
Wanderer e05276ea1e merge from wanderer branch.
option to allow all hitpointed weapons to be hit.
allow 'safe from weapons' time of bombs be set.
2009-05-20 20:11:15 +00:00
Wanderer fdb2de32e7 fix swarm issue - again 2009-05-20 19:44:18 +00:00
Wanderer b4eb17bd7f merge from wanderer branch - limited rotation turrets, reset idle turrets option 2009-05-20 18:03:14 +00:00
Wanderer 0920dc10ed addition to the rotate sound to toggle it on if rotation is re-enabled via sexps 2009-05-20 14:23:19 +00:00
Wanderer fa24bc0b39 merge from wanderer branch - autoaim/convergence improvements and variants 2009-05-20 14:13:58 +00:00
Wanderer 4cd2a011db merge from wanderer branch - fixed firingpoint and 'fire on target' subsystem flags 2009-05-20 13:24:57 +00:00
Wanderer cb3085e58c merge from wanderer branch - subsys/turret sounds 2009-05-20 12:24:45 +00:00
Wanderer d320ebf724 merge from wanderer branch - no subsystem targeting flag for turrets 2009-05-20 09:46:45 +00:00
chief1983 01cb760ae5 Bump linux version to 3.6.11 2009-05-19 22:13:12 +00:00
chief1983 3c64b07134 Convert these to UNIX again, hope they compile this time... 2009-05-19 22:02:48 +00:00
Wanderer 9c7b1a1292 merge from wanderer branch - alt iff colors 2009-05-19 21:17:48 +00:00
Wanderer d7f721f3b1 merge from wanderer branch - phreak's inherit parent target weapon flag 2009-05-19 19:40:06 +00:00
Wanderer b399e066f7 merge from wanderer branch - smart spawn weapon flag 2009-05-19 19:29:41 +00:00
chief1983 4def2aebce Add SEXP stuff to Linux Makefile.am 2009-05-19 18:17:31 +00:00
Wanderer fc2f05c747 merge from wanderer branch '$Turrets prioritize ship target:' objecttypes flag 2009-05-19 17:20:18 +00:00
Wanderer ea1cc6ca27 quick jury rigging to prevent stream of null vec warnings caused by r5261 2009-05-19 16:53:05 +00:00
Wanderer cabc75bfe5 merge from wanderer branch. 2d and 3d radar images support 2009-05-18 22:08:13 +00:00
karajorma 3b912c0ca3 Fix Mantis 1926 (Piranha submunitions home in on the ship that fired them in dogfight mode) 2009-05-18 22:00:01 +00:00
Wanderer ab316e895f initial merge from wanderer branch - fixes to corkscrew missile effects 2009-05-18 20:36:11 +00:00
karajorma 5c1a6ef841 Fix Mantis 1925 (Loadout lists may contain ships and weapons which are not been flagged as player allowed). 2009-05-17 12:35:52 +00:00
karajorma a4e623db23 Portej05's preFAST warning fixes. 2009-05-17 11:50:48 +00:00
karajorma d599cc1d6b Commit Wanderer's Salvo Fire mode changes. 2009-05-16 19:41:05 +00:00
chief1983 67406e5952 Update Xcode's Info.plist to 3.6.11 2009-05-16 19:09:55 +00:00
karajorma 3ac6b9aa80 WMC's shipFX changes. Some other minor fixes. 2009-05-16 18:01:08 +00:00
karajorma 2f33c72ba7 AddAdd support for multiple builtins of the same type and new builtin message types Praise Self, High Praise and Primaries Low 2009-05-16 17:32:53 +00:00
karajorma 1a1f81f86d Switch network variables over to the SEXP packet except for when called from lua 2009-05-16 16:58:22 +00:00
karajorma 9f9f4dae6c Add the set-ambient-light SEXP 2009-05-16 16:38:49 +00:00
karajorma 5d9af246c5 Allow multi-docking in multiplayer. 2009-05-16 16:29:41 +00:00
karajorma 7c70f212ba More minor fixes. 2009-05-16 16:20:45 +00:00
karajorma f95777ebe3 Add a ship and parse flag to lock all turrets initially. Fix the Lock Primary/Secondary checkboxes to work for multi-selection. Add a checkbox for lock afterburner. Add the weapon fired since SEXPs 2009-05-16 14:06:23 +00:00
karajorma fc12d0a5b7 Break up the status SEXPs into sub-categories. 2009-05-16 13:03:59 +00:00
karajorma 0a4ca2f858 Fix a bug where the order of SEXP arguments was reversed. 2009-05-16 12:56:26 +00:00
karajorma fbf44b51e0 Add SEXPs to set weapon, shield and afterburner energy. 2009-05-16 12:55:11 +00:00
karajorma 321c1cd30e Echelon 9's fix for a potential buffer overrun. 2009-05-16 12:32:46 +00:00
karajorma e63ea3738b Auto-expand branches after pasting, add-pasting or replacing SEXPs. I really don't know why someone didn't get rid of that petty annoyance years ago. 2009-05-15 18:38:24 +00:00
karajorma 0adb576247 Fix an assertion that crops up when you have no selected message but click on delete message. Has the side effect of making the message editor much less annoying too. 2009-05-15 18:36:47 +00:00
karajorma b67289e52a Commit the SEXP packet code.
Add the set-respawns SEXP.
2009-05-15 18:32:46 +00:00
karajorma 1ea70f7122 Move the repair penalty to an AI profile setting. 2009-05-15 17:53:38 +00:00
karajorma 0512409e18 Looks like that icon was needed after all. 2009-05-15 17:34:46 +00:00
karajorma 39adc73583 Add the validate-argument SEXP.
Fix a minor initialisation error with the ship-tag SEXP.
Fix Mantis 1907 (Error in the get-damage-caused description)
2009-05-14 17:12:23 +00:00
karajorma 4bd18224fe Fix Mantis 1859 (FRED crashes if an unknown ship type is detected in the loadout). 2009-05-14 16:52:56 +00:00
karajorma 961c88132b Due to a merge, delete a file which was never in trunk anyway. 2009-05-14 16:38:02 +00:00
karajorma ba4e5132ef Add new sexps to determine the amount of afterburner and weapon energy remaining. 2009-05-14 16:37:11 +00:00
karajorma 251285cacc Add support for cutscenes before the various briefing and debriefing sections (FRED support for this feature will come later, but it will load and save correctly for now). 2009-05-14 16:27:36 +00:00
karajorma a9219ca129 Fix a bug where the log displays incorrect percentages for kills. 2009-05-14 16:26:37 +00:00
karajorma 616b19772e Changes to allow more data to be used from exited_ship. Make ship_exited dynamic too.
Get-Damage-Caused SEXP and a couple of functions for counting the number of variables of a certain type. 
Commit the new team loadout code and FRED changes to support it.
2009-05-14 15:06:52 +00:00
karajorma 4485f12c24 A couple of new parsing functions for dealing with variables in fields that previously only accepted integers or strings. 2009-05-14 14:08:07 +00:00
Wanderer fe352da2a2 tweak to keep all 3d radar dots inside the retail radar bitmap area - Mantis 1908 2009-05-13 22:03:30 +00:00
karajorma 1d8f54cf29 Allow wireframe for the targetbox to be set from hud_gauges.tbl. 2009-05-12 22:05:43 +00:00
karajorma 5ec562973b Allow the boilerplate traitor debrief to be turned off even if the player did turn traitor. 2009-05-12 22:03:39 +00:00
karajorma dc934368ab Fix Mantis 1538 (special hitpoints not updated properly on deletion) 2009-05-12 21:55:49 +00:00
karajorma b33f468e38 Fix Mantis 1913 (Characters after # are visible in the wings and reinforcements comms menu) 2009-05-12 21:53:12 +00:00
karajorma 428e5d67c9 Fix the FictionViewer truncating anything with more than 70 lines. 2009-05-12 21:49:41 +00:00
karajorma 6a5bf64aeb Allow players to filter who they send messages to when using the chatbox 2009-05-12 21:30:17 +00:00
karajorma 5a919c3e49 Fix Mantis 1911 (Add Data doesn't show the <argument> option)
Fix Mantis 1813 (Negative number constants could be added in FRED for SEXPs which expected OPF_POSITIVE, often resulting in crashes).
Fix (part of) Mantis 1677 (cap-subsys-cargo-known-delay doesn't list the correct ships)
Fix Mantis 1909 (Can't paste variables in FRED)
2009-05-11 09:00:40 +00:00
karajorma 2c8d1795e6 Fix a typo in disable-builtin-messages 2009-05-11 08:54:52 +00:00
karajorma be03d7e3f1 Fix Mantis 1884 (Entering the name of an invalid operator in any dialog other than events editor would crash FRED) 2009-05-11 08:54:28 +00:00
karajorma ad31fc80be Fix Mantis 1910 (Assist Percentage resets itself when ships are multi selected) 2009-05-11 08:48:05 +00:00
karajorma 63f00de6e0 Fix an issue with homing capship missiles not tracking correctly in multiplayer. 2009-05-11 08:45:58 +00:00
karajorma c35da651ea Fix Mantis 1753 (Using " or ; in briefings and messages causes them to either vanish or truncate the message)
Fix a bug that prevented lcl_replace_stuff() working properly when a message had two or more replacements of the same type.
2009-05-11 08:41:51 +00:00
karajorma 6ba239d6a0 Allow beams on any player ship to count for kills. Not just fighters and bombers. 2009-05-11 08:41:09 +00:00
Wanderer edd046798a fix for mantis 1902 2009-05-10 19:09:21 +00:00
karajorma 09adeaea8a Fix compile issue with GCC. 2009-05-10 13:03:41 +00:00
karajorma 62b5d676cd Bump version to 3.6.11. Bump debug warning level to 4 2009-05-10 09:52:05 +00:00
karajorma 61d9326eb8 Fix Mantis 1371 (Can target target's target even if it is stealthed or hidden from sensors). 2009-05-10 09:06:00 +00:00
karajorma 5e54017f15 Fix Mantis 1916 (Can't change the dockpoint a ship is initially docked to without undocking it) 2009-05-10 08:58:16 +00:00
karajorma 0cb0206db2 Add the Assertion Macro as an alternative to Assert.
Switch a couple of Asserts to Assertions.
2009-05-10 08:53:57 +00:00
karajorma d4f6ec98b9 Fix Mantis 1883 (spaces at the end of ship and wing names can cause errors) 2009-05-10 08:32:08 +00:00
karajorma 35dbaac407 Fix Mantis 1620 (Replace Number/String don't work in FRED) 2009-05-10 08:26:17 +00:00
Wanderer c695230883 Fix for mantis 1915 and related collision detection issues 2009-05-09 10:45:04 +00:00
karajorma e2f1229d79 Nope. That won't fix the error. Reverting. 2009-05-04 13:43:48 +00:00
karajorma bdb1569898 Maybe fix a crash in the voice recognition code. Maybe fix a lock when going into the option menu while respawning. 2009-05-01 17:48:15 +00:00
chief1983 4f18bbd624 Nobody here but us chickens (really I don't think anyone uses this but FotG) 2009-05-01 16:14:32 +00:00
Goober5000 b78f77f0a0 fix bug in voice messaging 2009-04-30 23:55:42 +00:00
Goober5000 3427549f9b activate voice recognition 2009-04-30 23:45:14 +00:00
chief1983 f711df0fd1 This is why we can't have nice things. 2009-04-18 19:37:20 +00:00
chief1983 5119664e14 Pretty FRED icon (and new 256x256 FS2 icon to boot) courtesy of Axem 2009-04-13 20:50:59 +00:00
Goober5000 6e4021888d add apostrophes to contractions, lol 2009-04-10 07:49:12 +00:00
chief1983 03123b1437 Add Inferno configs to Xcode project 2009-04-08 17:48:46 +00:00
Goober5000 47060c5c9b add warning system for mods with bad data files 2009-04-08 04:58:12 +00:00
chief1983 0c628834c5 Manual inspection to make sure my new VC6 project was essentially the same as the old one, and wouldn't you know, I found a bug in the wxFred project too :) 2009-04-02 21:57:12 +00:00
chief1983 b4a20998e1 Amazing what you can learn from reading SVN logs. Really. Old. SVN logs. 2009-04-02 21:32:15 +00:00
chief1983 b4d35f6afe This MSVC6 project has additional defines to build Inferno builds, and also utilizes the speech SDK by default which was previously committed. I'm committing this so that anyone with VC6 can make a release build with little to no hassle. 2009-04-01 21:05:12 +00:00
chief1983 144a30b20f We include every other SDK just about...why not speech 2009-04-01 20:29:09 +00:00
chief1983 fe5c1f3bad Missing comma revealed with FS2_VOICER 2009-04-01 20:25:49 +00:00
chief1983 763f714864 Grammar fix 2009-03-31 18:32:09 +00:00
Wanderer 26217893fd fix for mantis 1899 2009-03-31 06:11:09 +00:00
Wanderer ce24e12816 fix for mantis 1900 2009-03-26 08:18:46 +00:00
Goober5000 570755309c final tweak to callsign feature 2009-03-26 01:43:26 +00:00
Goober5000 4f22d45411 change warning 2009-03-26 01:42:47 +00:00
karajorma 26db4ff799 Bit of a hack but it should stop the function from going over MAX_PACKET_SET_SIZE 2009-03-25 00:49:21 +00:00
karajorma aa49d10143 Made this change in my branch but it never made it over here. 2009-03-21 23:06:37 +00:00
karajorma d5168e3592 Fix Mantis 1661 (Ships leaving via the fighter bay don't disappear on multiplayer clients). 2009-03-17 20:28:41 +00:00
karajorma d8a1a68c16 Fix multiplayer for Inferno builds. 2009-03-17 20:25:36 +00:00
karajorma 70ecaa5d86 Various fixes needed to allow multiplayer to use over 255 weapons. 2009-03-17 20:20:48 +00:00
karajorma bdf9f7008b Fix Mantis 1486 (Pressing F4 crashes multiplayer) 2009-03-17 20:14:31 +00:00
karajorma 1637424c35 Fix a series of bugs with generic subsystem types and non-standard names in the ship model. 2009-03-17 17:44:28 +00:00
karajorma 26b7f17c41 Fix Mantis 1729 (Pressing glide keys while warping out locks up the game) 2009-03-16 22:22:48 +00:00
karajorma fff260ae8e Fix Mantis 1838 (Latency information obscures the messaging menu) 2009-03-15 17:19:45 +00:00
karajorma 5dcf9f7880 Fix Mantis 1898 (Names with a # are not truncated correctly in the message menu). 2009-03-12 20:25:09 +00:00
karajorma bf6391e4c2 Fix Mantis 1896 (Two support ships crash the game) 2009-03-10 21:24:07 +00:00
karajorma 87774d9ce8 Doh! x2 2009-03-09 11:50:38 +00:00
karajorma b4abe9f24d Doh! 2009-03-09 11:46:44 +00:00
karajorma 3f1880d22c Fix Mantis 1872 (Fiction Viewer crashes/locks up.)
Allow FRED to save fiction if the mission file already has some.
2009-03-07 22:53:07 +00:00
karajorma 9e61bb1df9 On reflection Mantis 1861 is also going to affect creating a new mission as well. Might as well fix that too. 2009-03-06 20:53:26 +00:00
karajorma 26dfa5f47f Fix Mantis 1861 (Texture Replacements don't initialise properly in FRED). 2009-03-06 19:03:51 +00:00
Wanderer e302a90a1e add 'missing' casts 2009-03-06 15:08:16 +00:00
karajorma bec2409fba Fix a warning where ai_do_objects_docked_stuff was being called twice on clients during multiplayer mission load. 2009-03-05 20:43:34 +00:00
karajorma 812e480bb3 That should only be called once per mission. 2009-03-02 20:41:31 +00:00
karajorma d704a450cb Some minor fixes including getting rid of the vestigial Determination setting from everything except the mission file itself. 2009-02-25 15:41:23 +00:00
Wanderer 4ea1424e64 possible fix for the missing thruster glow names.
changed phrasing of unrecognized type subsystem issue to less severe.
forced game to warn only once if exceeding max ship classes.
2009-02-25 14:50:59 +00:00
chief1983 0272c785dd Taylor's fix for the OpenGL error in the debug log
http://www.hard-light.net/forums/index.php/topic,61170.msg1207696/topicseen.html#msg1207696
2009-02-23 17:10:14 +00:00
Wanderer 8e83b3f502 fix for mantis 1862 2009-02-03 13:42:30 +00:00
karajorma 2d495a3c15 Serves me right for saying it was working. 2009-02-03 00:12:18 +00:00
karajorma e57d4ff5f2 Argument SEXPs shouldn't be included when searching the tree for arguments. 2009-02-02 17:17:31 +00:00
Wanderer 6e0200d27e fix for mantis 1875 2009-02-01 13:13:18 +00:00
karajorma 38eff95a7f Fix a bug with in-sequence and invalidate-argument. 2009-01-28 22:41:57 +00:00
karajorma d6f28ceb97 Fix Mantis 1867 (String-equals didn't work with nested arguments) 2009-01-24 22:36:45 +00:00
Goober5000 b8375fa785 being meticulous 2009-01-20 05:49:27 +00:00
phreak d5f2b68044 Cutscene bars fix, try #2 2009-01-20 05:19:35 +00:00
Goober5000 afd60862ab fix for Mantis #1851 2009-01-20 04:18:14 +00:00
Goober5000 deaad91241 possible fix for Mantis #1853 2009-01-20 03:46:49 +00:00
Goober5000 6842f9d910 don't CTD on sexps that are too long (Mantis #1852) 2009-01-20 03:38:09 +00:00
Goober5000 eb862504f4 preserve texture replacement upon name change (Mantis #1695) 2009-01-20 00:35:58 +00:00
Goober5000 ec427000eb hopefully final revision of the callsign code 2009-01-19 20:56:36 +00:00
phreak 87dd770d93 Cutscene bars fix using gr_set_clip instead of gr_rect. 2009-01-19 03:48:45 +00:00
Goober5000 39efcaf386 just for sanity's sake, default to 0% limit for support ships repairing hull 2009-01-18 04:01:09 +00:00
Goober5000 a58ae3d02e revert changes to close out issue #1870 2009-01-18 04:00:15 +00:00
karajorma 2f0c86dd01 Get rid of the ping message when the HUD is turned off 2009-01-15 21:33:32 +00:00
phreak 98e1d6b56f Fix for Mantis #1870 2009-01-15 01:07:35 +00:00
karajorma 6d8ca2c14b Make the player orders error message a little clearer. 2009-01-05 17:51:02 +00:00
karajorma d448ff3632 Mantis 1633 (No orders for player ships) appears to have been due to two different bugs. This should fix the one I missed earlier. 2009-01-04 17:10:51 +00:00
karajorma 978f5f363f Add a 3rd save format to FRED thereby making the current forward compatibility of save game optional. 2009-01-03 14:54:15 +00:00
chief1983 51a6901dae OpenGL tweaks from Taylor's 3610 patch and a big fix for OS X graphics - Thanks Echelon9! 2009-01-03 02:39:11 +00:00
chief1983 da0dbe84b3 Standalone GUI minimize from Taylor's 3610 patch 2009-01-03 02:37:45 +00:00
chief1983 6fc6267fca Fix for movie playback from Taylor's 3610 patch 2009-01-03 02:36:59 +00:00
chief1983 f5f0713345 Fix for fighter beams from Taylor's 3610 patch 2009-01-03 02:36:22 +00:00
karajorma 054d745ece Fix a bug whereby initial orders were being ignored on the standalone. Maybe fix Mantis 1815 (Starting wings play dead on standalone). 2008-12-30 21:33:35 +00:00
phreak 53492408c9 Change FRED version and title bar from 3.6.9 to 3.6.10 2008-12-25 04:13:43 +00:00
Goober5000 506ee1f517 choose the last persona found as the Command persona, not the first, since that's how retail does it 2008-12-22 05:30:21 +00:00
Goober5000 58b171ce76 bah 2008-12-21 21:36:42 +00:00
Goober5000 673f10485b this ought to fix bomber+ according to the way $smart secondary weapon selection was set up 2008-12-21 21:34:37 +00:00
Goober5000 1323b85c9d roll back Wanderer's fix 2008-12-21 21:18:00 +00:00
Wanderer f80572c172 fix mantis 1802
fix possible issue with subsystem fixup
fix - via ai_profiles - AI with bomber+ flag
2008-12-21 19:46:38 +00:00
karajorma 25c6d6340c Use fout_version for +Use Table Score and +Assist Score Percentage 2008-12-21 13:08:12 +00:00
Goober5000 33034e581b we probably only want to use fout_version when we have actually pushed a FSO version
(hopefully this should fix the sprawling version-specific commenting)
2008-12-21 07:45:38 +00:00
karajorma 88f71ef237 Fix a multiplayer bug where names like Alphabet were assumed to be in Alpha wing 2008-12-20 22:10:29 +00:00
Goober5000 69b0a7a250 skybox model should be 3.6, not 3.6.10 2008-12-20 19:53:55 +00:00
phreak cd7ce4e88b Fix crash due to revision 5006 2008-12-20 16:54:24 +00:00
Wanderer c37055ea42 possible fix for Mantis 1802 2008-12-19 22:23:31 +00:00
chief1983 b7a51a86b5 Commit WMC's fix for icon briefing lines that don't get deleted (Mantis 1763). 2008-12-17 07:54:55 +00:00
chief1983 af9eea721c Revert changes done to fix bug 1645 (it'll have to wait) 2008-12-17 07:38:38 +00:00
phreak 6ba6544036 Made the cutscene list dynamic 2008-12-16 22:07:21 +00:00
karajorma 2835c6950b Restore Assist Score Percentage saving. 2008-12-15 22:11:57 +00:00
Wanderer 0562982e02 warn the user of 'div by 0' issue 2008-12-15 20:25:49 +00:00
karajorma 3dd6ce5bb7 That's probably had a rather large knock on effect with the version saving code. 2008-12-15 18:47:43 +00:00
phreak 04f77b4e7c Add code project as a depedency of the Freespace2 project 2008-12-14 21:44:27 +00:00
phreak be97108d6c Fix a bad memset 2008-12-14 21:33:53 +00:00
Goober5000 adbb60d8bc fix algorithms for any-of, every-of, and number-of to align with or and and, respectively 2008-12-14 08:47:27 +00:00
phreak 28a408deee Possible fix for mantis #1843 2008-12-14 08:11:14 +00:00
Goober5000 6208959b49 whoever made this change forgot about operator precedence 2008-12-14 07:20:56 +00:00
phreak ee75c69ab9 Edit workspace file to use relative paths 2008-12-13 17:25:16 +00:00
karajorma 548faf84bc Fix the <argument> option not appearing when there were no other options on the list 2008-12-13 10:09:59 +00:00
karajorma 90ea4099fb Fix a bug where you could supply add-background-bitmap or add-sun-bitmap with a string variable which then couldn't be used. 2008-12-12 17:38:23 +00:00
phreak e1416453a8 This stops the crashing as demonstrated by Mantis #1844, but I don't know why or if it is correct. Could someone please look at this? 2008-12-12 14:38:28 +00:00
chief1983 d18a78ef05 Must have fatfingered some keys when I wasn't paying attention. 2008-12-10 17:48:29 +00:00
chief1983 8406bfada6 Hopefully this will actually let it load the 2d without breaking WCS again 2008-12-09 23:51:13 +00:00
phreak 23742e8261 Turning an Int3() into a Warning() 2008-12-09 13:02:30 +00:00
chief1983 f75be11102 Only PCX and DDS work for Squad Logos.
Slight tweak of the open file dialogs.
2008-12-08 16:45:07 +00:00
phreak 1d453b80f2 Add code::blocks support. To compile you will need to install the following library packages SDL, openal, ogg, vorbis, vorbisfile, theora, lua5.1, jpeg, GL, GLU. Currently, it has two types of outputs: Debug (standard debug build), and Release, which optimizes using -O3 and -march=core2 (because my laptop is a core2). Probably could experiment with additional compiler options to improve speed. 2008-12-06 21:24:14 +00:00
chief1983 b290f5281a Add Ship Choice 3d for TBP flag as well since lack of will crash debug builds, and fixed whitespace on that particular section of code. 2008-12-06 20:23:24 +00:00
chief1983 89a7c1e0f4 Force 3d Shockwave and 3d Weapon Selection command line option when The Babylon Project command line option is on, since their default launcher.ini does not have those and not having these options breaks things in TBP. 2008-12-06 00:44:44 +00:00
karajorma 6f32344d45 Fix the FRED undo function. 2008-12-05 23:06:17 +00:00
chief1983 fb37f654f0 Allow DDS, TGA and JPEG files for squad logos (TGA and JPEG need testing) 2008-12-04 23:15:18 +00:00
chief1983 9c0dbb7acb Add 3d Shockwave to All Features On and Default Off lists 2008-12-04 20:47:45 +00:00
chief1983 5c12c0ef48 Redo that fix again - tolower wins, but don't chdrive on non-Windows platforms
Made a variable more semantically correct
2008-12-04 20:17:51 +00:00
karajorma e55577111e Fix Mantis 1835 2008-12-04 19:32:21 +00:00
chief1983 61891ed5ec Fix the cause of the problem in Mantis #1748 in both chdir functions in case it becomes a problem elsewhere down the line 2008-12-04 17:56:53 +00:00
chief1983 84e6b6eabe Rest of the different fix for 1278 (only my second commit and I already goofed) 2008-12-04 17:40:28 +00:00
chief1983 1f5444b850 Different fix for 1278 - It's a bit more flexible. Use ai_profiles to allow/disallow entering multi with no primaries or secondaries 2008-12-04 17:38:11 +00:00
chief1983 d12f0c7ae9 Fix for disabled 3d shockwave flag when 2d shockwave doesn't exist - fallback to 3d anyway 2008-12-04 17:27:26 +00:00
phreak 3736999bdc Possible fix for mantis #1748 (FRED2 Crashes when squad logo button is pressed). 2008-12-03 05:40:35 +00:00
karajorma 93bb980ff3 Fix gibberish entries in file dialogs. Maybe fix Mantis 1748 2008-12-02 21:42:04 +00:00
karajorma 4862747454 Since the player ship is the default for most of these SEXPs they should not be greyed out just cause it is a player start rather than a ship 2008-12-02 21:14:23 +00:00
karajorma 42b5befef0 Fix Mantis 1733 (String variables required a valid default value when used in SEXPs even if that value would never be used) 2008-12-01 22:34:38 +00:00
karajorma 78cda09d2c Fix Mantis 1822 (Cannot use variables in add-background-bitmap or add-sun-bitmap) 2008-12-01 17:29:24 +00:00
karajorma b06a4a5349 Widen the primary and secondary combos in the weapons editor. 2008-11-30 20:00:02 +00:00
karajorma 21d258925d Typo 2008-11-30 14:56:45 +00:00
karajorma d6399427ff Print an error to the log when too many messages are in the queue rather than breakpointing. 2008-11-30 14:55:58 +00:00
phreak 4bf6b83e93 whoops 2008-11-30 14:13:28 +00:00
karajorma 07d6f2bff9 Fix add-background-bitmap and add-sun-bitmap to display a list of bitmaps from the tables properly. 2008-11-30 13:01:30 +00:00
phreak 1bc83969ac fix the message variable parsing the right way (mantis #1831) 2008-11-27 01:38:28 +00:00
karajorma aa7fc2d713 Fix Mantis 1825 (Int3() when trying to change a ship flag on a ship which self destructed) 2008-11-26 23:19:31 +00:00
phreak 4a4268e77d Fix Mantis #1831 2008-11-25 22:05:39 +00:00
Goober5000 66019a11ca add ai_profiles flag for Mantis #1422 2008-11-24 02:35:20 +00:00
Goober5000 219c7541f8 if a ship or weapon is allowed, allow all its # equivalents (further insurance against the Interceptor#Weak problem) 2008-11-24 02:13:13 +00:00
Goober5000 09d116f667 prevent form-on-wing goals from overriding everything else
this should fix the AI bug that revision 2170 applied to all wings (not just starting wings)
this should also fix the bug where Alpha wing couldn't be issued orders via sexp, even in retail
2008-11-24 00:01:00 +00:00
phreak 8c521c771b Add some preprocessor macros to aid in debugging. Nothing is on by default, but when enabled, the macros will force windowed mode at various resolutions. 2008-11-22 20:56:30 +00:00
karajorma cfa7e2d7c8 Fix Mantis 1823 (Rand SEXP only has 16-bit precision) 2008-11-20 20:03:14 +00:00
phreak 6d13cce780 Apply the time limit check when starting a co-op game to the kill limit as well. 2008-11-19 23:45:43 +00:00
phreak d1f6caaaaa Fixed Mantis #1675 2008-11-19 16:12:05 +00:00
phreak 871b316add Fix Mantis #1278 2008-11-19 15:31:30 +00:00
karajorma 9eb55188d5 Fix Mantis 1824 (Cargo containers disappear when using change-ship-class SEXPs) 2008-11-19 08:00:05 +00:00
phreak 9b7fff7e99 more fixes that deal with mantis 1564 2008-11-18 03:30:13 +00:00
karajorma 53143dee9c Allow AI-goals to be assigned to a ship represented by an <argument> 2008-11-17 17:57:45 +00:00
karajorma a6bae2c557 Fix the Decline error message that crops up in multiplayer sometimes and get rid of the PAIN! entry in the log. 2008-11-14 09:15:19 +00:00
karajorma 55aea5cf13 Fix Mantis 1633 (Initial orders for multiplayer Player Starts that end up AI controlled are ignored). 2008-11-13 21:21:00 +00:00
taylor 643a1aa230 standalone changes:
- add score/kill values to Player Info tab
 - add multi.log out to the Debug tab
 - add minimize-to-tray functionality
 - fix messaging problem with property sheet handled messages
2008-11-11 01:09:01 +00:00
taylor fe03b667cd remove bad checks for loadout info (we are screwed if the info is bad regardless, so making it Assert() is cleaner)
fix bug that screwed up TVT if more than 4 ships on team
2008-11-11 01:03:38 +00:00
taylor 570e4cb1e6 make sure that a positive hull precentage doesn't hit 0 due to rounding error (Mantis #1720) 2008-11-11 00:59:19 +00:00
taylor 2c45dbbb5f give multi clients a short delay on briefing music to reevaluate goals if needed (should fix/reduce Mantis #1465) 2008-11-11 00:58:19 +00:00
phreak 307106f983 Got rid of goto statements 2008-11-11 00:09:30 +00:00
karajorma 68c51f242a Fix Mantis 1812 (Ship-Deaths reported incorrectly for player starts controlled by AI ships) 2008-11-10 19:31:07 +00:00
taylor ad1c5055d4 address some rounding issues with integer based percent values (Mantis #1807) 2008-11-09 05:09:51 +00:00
taylor 3abccfa76c sync up to current FS2NetD code (fixes so many little problems/issues that it's not even funny) 2008-11-09 05:08:19 +00:00
karajorma 42683318f7 Fix Mantis 1044 (Campaign Editor crashes in release builds but not in debug) 2008-11-06 20:42:23 +00:00
phreak f4ba5d0bb2 Apply Spicious' patch from http://www.hard-light.net/forums/index.php/topic,57573.0.html 2008-11-04 05:21:00 +00:00
phreak 8d70f8c15f Mantis #1800, take 2 2008-11-03 00:04:26 +00:00
karajorma 73f924163c Surprised this wasn't committed before. 2008-10-30 20:39:47 +00:00
phreak 83a57be996 Possible fix for mantis #1800. Don't ask me how I came up with the numbers I used, I'm not too sure myself. 2008-10-30 04:04:54 +00:00
taylor 50cc1331ae put a 1/2 sec delay on the next secondary so we don't fire immediately after respawn (Mantis #1118) 2008-10-28 18:18:12 +00:00
taylor 1b5f722967 make disband wing work properly (Mantis #1680) 2008-10-28 18:16:08 +00:00
taylor 33ab6d34ef fix weapons carry check to work properly for multi (Mantis #1624) 2008-10-26 14:42:03 +00:00
phreak d7fd6b4454 Possible fix for mantis #1564 2008-10-26 02:57:36 +00:00
Goober5000 028bfecc70 fix another spawning weapon bug 2008-10-24 22:57:40 +00:00
Goober5000 e6b801595b fix bugs caused by missing parent when weapon-create creates missiles 2008-10-24 22:17:02 +00:00
Goober5000 d3f38e26bc fix a bug in weapon-create argument validation 2008-10-24 21:14:24 +00:00
karajorma d4305fbd85 Set the type correctly for modify-variable (it used to assume all variables were numbers). Fix setting string variable to the value of another string variable (again). Solve a couple of other minor assertions and crashes. 2008-10-24 16:54:59 +00:00
taylor 70059a94d6 make sure that we update our subsystem in-use count when removing subsystems
(fixes bug where it just keeps wanting more memory but doesn't really need it)
2008-10-24 09:05:54 +00:00
taylor 262c3178e9 more if-statement fixing
fix the fix so that it's actually fixed (re: Mantis #1676)
2008-10-24 09:03:46 +00:00
Wanderer 91dd16167b patch to improve turret subsystem targeting 2008-10-23 15:38:57 +00:00
taylor 862d6f43db mode if statement fixage 2008-10-23 13:27:21 +00:00
taylor 966ec358e9 fix bogus ml_printf strings
use ml_string over ml_printf where possible
remove newlines from ml_* calls, since it gets added already
2008-10-23 13:26:35 +00:00
taylor 6ed6ecbfb8 be sure that we sort the mission list properly for a host that isn't the master (for consistency with host-master behavior) 2008-10-23 13:25:19 +00:00
taylor 1062040fbf output warnings, errors and asserts to debug log for Linux/OSX
allow -no_warn to skip asserts like it does on Windows builds (for consistent behavior)
2008-10-23 13:23:45 +00:00
taylor 0f01a1bd4c this assert will happen during normal multi play, nothing ingame related 2008-10-23 13:22:11 +00:00
taylor 0b1ea9a58d restart sounds/music on game browser screen (Mantis #1279) 2008-10-23 13:21:02 +00:00
taylor 19c1520dba final part of the fighter beam fix; freaky as it is, it actually managed to not break anything :D (Mantis #1795) 2008-10-23 13:00:21 +00:00
Wanderer 3032a0f5d9 added 2 missing newlines to debug spew 2008-10-23 10:09:12 +00:00
Wanderer fbe14f5a5e improved readability per taylor's suggestion 2008-10-23 06:47:12 +00:00
taylor c4b763680c fix stupid bug that messed up last flight date (Mantis #1274) 2008-10-23 04:51:02 +00:00
taylor 60fca98974 set player speed after respawn to be initial velocity specified in mission (Mantis #1198) 2008-10-23 04:49:24 +00:00
taylor 15dbb9e8b4 basic fixing for cmeasure handling over the network, not 100% without packet breaking though (Mantis #1098) 2008-10-23 04:47:41 +00:00
taylor 9bce69ef79 ingame join related crash fix (the correct value is put in after mission sync) 2008-10-23 04:44:25 +00:00
taylor fdcaebfad3 pass correct object to primary cycling (fix for multiplayer) 2008-10-23 04:43:19 +00:00
taylor ef0c0e994b fix V's "hack" so that it actually works and doesn't leave unused objects hanging around 2008-10-23 04:41:19 +00:00
taylor 249b8496e3 fix some NaN that gave invalid values in the standalone UI 2008-10-23 04:39:54 +00:00
taylor 7c944ed2a3 fix some weird signature checks from retail code 2008-10-23 04:38:17 +00:00
Wanderer aab688222c allow option to prevent turrets from targeting too distant bombs 2008-10-23 04:30:09 +00:00
Wanderer acc7fa2b16 fix for surface shields selecting wrong hit quadrant 2008-10-22 13:56:19 +00:00
Goober5000 1ccfa433d6 one last fix 2008-10-21 21:37:37 +00:00
Goober5000 a832c11585 hopefully this should be the last on Mantis #1785 (the callsigns) 2008-10-21 06:17:44 +00:00
Goober5000 10340678cb Keldor's fix for callsigns not getting translated 2008-10-21 06:05:30 +00:00
Goober5000 a82b7862d8 fix a warning 2008-10-21 02:20:18 +00:00
Wanderer 2ccbedd071 added +noreplace to ships flags to allow adding flags
added +override to muzzleflash.tbl
added +override to weapon flags
2008-10-20 18:51:51 +00:00
Goober5000 280b979d09 try to keep up with Nature producing bigger idiots :( 2008-10-19 20:25:30 +00:00
Backslash 8a2af2b13b My bad. No need to cap the ammo here. I had used the wrong variable anyway. Fixed. 2008-10-17 10:12:48 +00:00
phreak 400e950190 Fix Mantis #1799: Crash on "Mystery of the Trinity" 2008-10-16 04:09:38 +00:00
taylor 36ac0cb908 make sure that we don't re-save a deleted pilot in the barracks (Mantis #1794)
fix pilot deletion proceedure to not provide useless failure handling (if it fails to delete once, it will fail every time)
2008-10-16 00:41:35 +00:00
taylor ae062bcc0b make debris render properly in wireframe mode in hud targetbox and in ships lab (Mantis #1797) 2008-10-15 22:15:24 +00:00
Backslash 4d0f978e1c Fix 'cycle' behavior when $Shots is more than 1. 2008-10-15 06:31:18 +00:00
taylor 4f7744cf36 fix bug where changing turret_targeting_order[] to have asteroids earlier in the order would skip further checks 2008-10-14 17:09:09 +00:00
taylor acf1aa60ac get rid of some useless/annoying debug messages 2008-10-14 16:58:26 +00:00
taylor e44de24957 fix for fighter beams in multi (Mantis #1795) 2008-10-14 16:57:23 +00:00
taylor 6e42152761 better version of the earlier ab_count fix 2008-10-14 16:42:33 +00:00
taylor 251f52796c when sorting the mission/campaign list be sure that we keep our current selection
when loading the mission/campaign list for the first time make sure that we always select the first element in the list
2008-10-14 16:40:42 +00:00
taylor c5f9ba424c add exports to map file
generate program database for release builds (doesn't make build bigger, .PDB allows finding of source/line given error address)
2008-10-14 16:38:39 +00:00
taylor d23e80bdef fix some bad if statements 2008-10-14 16:35:49 +00:00
taylor ddd6ce2cf6 update to build with current code (Mantis #1796) 2008-10-14 08:30:54 +00:00
taylor f2e2297e9f disable const string warning (that thing was just plain annoying) 2008-10-13 06:38:03 +00:00
taylor 0253d298e9 only load tbls from tables/ (Mantis #1725) 2008-10-13 06:34:48 +00:00
taylor f6d26f915a bunch of out-of-bounds fixage 2008-10-13 05:57:57 +00:00
Goober5000 941faf9ab9 fixed a number of bugs with Electronics missiles that were present ever since 2003 :( 2008-10-12 21:57:40 +00:00
Goober5000 d0af5c2169 move the Electronics tag to its proper place 2008-10-12 19:44:27 +00:00
Goober5000 05769b3ffe fixed "bastion" debug console command to work for all main halls
added "medals" debug console command for testing
2008-10-12 19:44:06 +00:00
phreak 6a3cf80be0 Add additional filename extension filters to fix Mantis #1484 2008-10-11 12:08:09 +00:00
karajorma 55c8720e90 Fix Mantis 1791 (invalidate-argument did not work with multiple matching arguments) 2008-10-09 21:13:26 +00:00
Turey e461625622 Mantis 1584: Enabled F(n) keys during popups. 2008-10-08 03:02:15 +00:00
taylor f598aafeb0 more class_type fixage from r4638 2008-10-07 20:47:03 +00:00
taylor 71e948278b don't call gr_activate() in Assert macro
log asserts properly when using the -no_warn flag
(though asserts aren't really warnings and should not be turned off, it could be argued that many of our asserts don't belong)
2008-10-07 20:31:04 +00:00
taylor ee57fa59ca make sure that we reset the state properly after an ident failure (Mantis #1735) 2008-10-07 16:28:22 +00:00
Wanderer dbe8e071bb fix for ab_count crash issue on mission reload 2008-10-06 18:05:37 +00:00
taylor 27f2f168dc fix fs2netd shutdown/cleanup code to work better (gets rid of various little issues) 2008-10-06 05:52:25 +00:00
taylor beafe688bb don't really need to bother with MAX_SERVERS any longer since it's ultimately dynamic 2008-10-06 05:51:20 +00:00
Goober5000 01c783e27d if ship names are hidden but a callsign is supplied, use the callsign 2008-10-05 21:58:16 +00:00
Goober5000 c7b8cd7021 alt names should now work in FRED (including the voice acting manager) 2008-10-05 21:29:45 +00:00
Wanderer 6ca5bdcffa Added warning to help preventing invalid ship types. 2008-10-05 13:50:44 +00:00
taylor 18b2922455 a fix/workaround for Mantis #1692
bunch of standalone fixage for error reporting and various little signon issues
fix heartbeats for standalone servers
make proper use of +pxo in multi.cfg for standalone so that games can show up in the lobby
client-side fix for getting pilot stats in lobby (Mantis #1652)
2008-10-05 13:31:35 +00:00
taylor de28613166 add separate standalone options for setting FS2NetD login/password (gets around FS2NetD server game listing issue) 2008-10-05 13:24:06 +00:00
taylor 9a3a1b051e no magic numbers 2008-10-05 13:19:13 +00:00
taylor 8650ee98bd start up mainhall music/ambient when in the lobby (Mantis #1761) 2008-10-05 13:16:42 +00:00
taylor a4889e49e9 fix standalone crash when server name/password is too long in multi.cfg 2008-10-05 13:15:10 +00:00
taylor fcb28b51f1 better error handling for when TCP socket is already in use (Mantis #1626)
fix missing protocol XSTR that used the wrong tstring for display
2008-10-05 01:17:45 +00:00
taylor 7938c36df2 you are never guaranteed a valid class_type (fixes Mantis #1742) 2008-10-04 20:48:07 +00:00
Swifty ceea88037c Fix the rest of the Visual Studio project files such that FRED can compile. 2008-10-03 00:04:52 +00:00
phreak d17ea1d102 Update fred to include trackir libs 2008-10-02 17:32:54 +00:00
Swifty db5767b18a Added missing semi-colons. 2008-10-02 06:50:15 +00:00
Swifty 04fc426d90 Statically link TrackIR support; FS2_TrackIR.dll no longer required at run-time. 2008-10-02 05:58:01 +00:00
phreak 4524583f06 Disable the mouse when lost focus in windowed mode. 2008-10-02 00:57:10 +00:00
phreak f445aedaf1 Get rid of some repeated code. 2008-10-01 22:50:13 +00:00
phreak 666cbd4bc5 Get rid of windows system ding sound when pressing ALT and another key while windowed mode is active. 2008-10-01 05:36:40 +00:00
phreak 99446022fc It may be a hack, but this seems to fix that one pixel line seen on the bottom and right side of the screen when faded to a solid color. 2008-10-01 04:04:39 +00:00
Goober5000 d37828e00a fix linked primary behavior to be based on percentage, not absolute value, as expected (Mantis #1778) 2008-10-01 00:44:11 +00:00
Goober5000 818b6a40ac re-bump alt names
fix hidden ship names for voice acting manager
2008-09-30 23:50:14 +00:00
karajorma 3bc9a692af Fix Mantis 1774 (when-argument within when does nothing) 2008-09-30 17:36:12 +00:00
karajorma 9ef6d889d3 Fix compiling on OSX...apparently. 2008-09-30 15:52:53 +00:00
Goober5000 a0344aefae uninitialized pointer bugfix and cleanup to hud_stuff_ship_name / hud_stuff_ship_class
send messages with ship class rather than ship name if ship name is hidden
2008-09-29 04:47:23 +00:00
Goober5000 f0e53971f6 redo the callsign feature to be independent of the alt name
(fixes Mantis #1785)
2008-09-28 23:05:03 +00:00
Goober5000 8340ed5943 add Keldor's fix for Mantis #1779 2008-09-28 20:58:28 +00:00
Goober5000 89d3b62524 make CAR and CDR fail-safe 2008-09-28 19:28:22 +00:00
Goober5000 fdd2daebad don't hide information when displaying ship callsign
clean up hud_render_target_ship_info a bit
2008-09-28 01:53:54 +00:00
Goober5000 d3509e1aba fix for Mantis #1783 (voice acting manager message senders) 2008-09-28 01:16:07 +00:00
Goober5000 52c04fdf18 add KeldorKatarn's fix for AI afterburning too long 2008-09-28 00:26:56 +00:00
phreak 42b5c942f5 Allow .jpg files to be loaded out of VPs when in the "interface" subdirectory. 2008-09-26 04:59:12 +00:00
phreak b2f21047da Add KeldorKatarn's patch for mantis #1776 2008-09-25 03:55:24 +00:00
phreak c3e32613d7 Fix for Mantis #1767: Fix invisible ships upon knossos warpin 2008-09-25 03:45:57 +00:00
phreak 146d3cdd8f Fix for mantis #1773. Check null pointers 2008-09-25 01:58:40 +00:00
phreak 16a3ed9f4b Seperate 3d ship and weapons selection into their own command line options. 2008-09-25 01:15:30 +00:00
phreak b5cc4e46fb Render the lens flare even if the parent sun is off screen as some lens flares are much larger than their parent star and they magically disappear as soon as the center of the star leaves the FOV. 2008-09-18 00:33:59 +00:00
phreak 485a98ac3e Fix radar orb rendering (It was using the incorrect rotation matrix). Also enable alpha blending on the orb axes. 2008-09-18 00:30:54 +00:00
WMCoolmon 4e872096b1 Fixed secondaries using the laser renderer 2008-09-17 00:10:05 +00:00
phreak 0248c6988a Ensure the larger keyframe is chosen when looping the weapon loadout animations. 2008-09-16 04:51:36 +00:00
phreak 3189278d43 Do the same thing for ships that the previous commit did 2008-09-15 23:21:41 +00:00
phreak 9278f421ad Honor the keyframe value in the weapon loadout animations. If less than 2 keyframes are defined (first frame and return frame), then the animation will treat "52" as the keyframe value (retail default).
All 1024x768 weapon loadout animations have 0 and 52 set as the keyframes so they render properly.
2008-09-15 23:05:05 +00:00
phreak 0f13bcee06 Fix for Mantis #1562: Lens flares visible if sun behind asteroids. 2008-09-15 01:51:20 +00:00
phreak f78749be88 Ensure target_engines pointer is initialized. 2008-09-14 21:55:34 +00:00
Goober5000 b784bb6cff revert changes from 4801 (Phreak's fix for >4GB memory reporting)
c.f. http://www.hard-light.net/forums/index.php/topic,56409.0.html
2008-09-14 20:29:03 +00:00
Goober5000 0ae4939981 re-fix WMC's bug to be compatible with expected behavior 2008-09-14 19:29:07 +00:00
phreak 2c34c391d2 Fixed nebula render bug for Mantis #1765 2008-09-14 19:05:30 +00:00
phreak 14c478376b cleanup find_homing_object() 2008-09-14 18:51:38 +00:00
phreak 8bf826793a Change output executables to 3_6_10 2008-09-14 17:05:59 +00:00
karajorma 58fc12fc57 KeldorKatarn's afterburner lock SEXPs 2008-09-13 22:21:38 +00:00
taylor 61ef271683 update with current official SDL framework (should fix Mantis #1727) 2008-09-13 14:41:57 +00:00
taylor 81811ff842 if max shield strength is 0 then disable shields (rest of Mantis #1645) 2008-09-13 14:40:06 +00:00
karajorma 455180fa4a Fix Mantis 1088 (Extra call to ai_do_objects_docked_stuff() )
Remove the banks_fired Assert. WMC is correct. We don't need it anyway.
2008-09-10 11:24:00 +00:00
phreak 25b56bfac6 Add updated freespace2 icons 2008-09-08 23:01:22 +00:00
Swifty 7e047b5c98 WMC's fix for RTT indexing and fix unnecessary slewing for 3D HUD elements. 2008-09-06 07:51:50 +00:00
Wanderer ac4fb52604 Fix for mantis 1736 2008-09-05 21:59:55 +00:00
Swifty 57fbb21c62 Fix for Mantis 1743: Targets don't shudder with the rest of the HUD. 2008-09-05 07:57:40 +00:00
phreak 21aa72ae2f Fix memory detection for systems with > 4GB of RAM. 2008-09-04 20:40:57 +00:00
karajorma 04e4095b36 Arguments within arguments (again). It should work this time round. 2008-09-04 20:38:14 +00:00
phreak 38abe31509 Possible fix for Mantis #1669 2008-09-01 03:09:00 +00:00
karajorma 3b6e62805f Fix Mantis 1545 & 1754 (Order SEXP doesn't work with wings or destroy subsystems properly)
Add the Query-Orders SEXP 
Deprecate the Order SEXP
2008-08-31 21:04:44 +00:00
WMCoolmon 4bff232cad Change set-fov back to a global override 2008-08-30 19:48:20 +00:00
WMCoolmon ddf75fc7e0 Final scripting, camera code updates. 2008-08-30 11:05:48 +00:00
WMCoolmon b4b2f7d54f Fix for mantis 0001211 2008-08-30 11:04:12 +00:00
WMCoolmon e71d060984 Core all-RTT code. 2008-08-30 11:03:03 +00:00
WMCoolmon c9e3d746d4 Added object_get_model; moved object_h to object.h 2008-08-30 11:02:36 +00:00
WMCoolmon 9d4bad1c7f Input updates for scripting 2008-08-30 11:00:11 +00:00
WMCoolmon 74a6636bc6 Attempted HUD shake fixes 2008-08-30 10:59:10 +00:00
WMCoolmon 19ed659d6b Minor idiotproofs 2008-08-30 10:58:44 +00:00
WMCoolmon 48d8f030b3 Better compatibility with avoiding the main hall 2008-08-30 10:57:27 +00:00
WMCoolmon 7ef7959d77 all-texture replacement code 2008-08-30 10:56:28 +00:00
WMCoolmon 6c7ccad82f Attempted HUD shake fixes 2008-08-30 10:56:04 +00:00
WMCoolmon 36e44e7f2b hud_get_draw, custom subsystem names in HUD subsystem damage list 2008-08-30 10:54:44 +00:00
WMCoolmon 6cfab94ef0 New camera code 2008-08-30 10:52:32 +00:00
WMCoolmon 9764ce9ea8 Replace Assert with smooth failure. 2008-08-30 10:52:08 +00:00
WMCoolmon d0808e2bf0 New camera code, cutscene bar fixes 2008-08-30 10:51:21 +00:00
WMCoolmon d2e4d0d6ee Support for all-texture-type texture replacement. 2008-08-30 10:50:49 +00:00
WMCoolmon 699ac0f2bd FRED support for new camera code and texture replacement of all texture types 2008-08-30 10:49:22 +00:00
WMCoolmon 39d623c7c2 ship_wing_point_or_none SEXP type 2008-08-30 10:48:46 +00:00
WMCoolmon 5404b776aa Support for custom warp sounds 2008-08-30 10:47:50 +00:00
WMCoolmon 5a72f40f62 Fix unneeded use of doubles 2008-08-30 10:47:16 +00:00
WMCoolmon 525e45db77 Updated objsnd API 2008-08-30 10:46:23 +00:00
WMCoolmon 3f02f79b3d New camera code, warp code updates, debris attributes, fix large numbers of ships being created at the same time, delta bank. 2008-08-30 10:45:41 +00:00
WMCoolmon 9360d3b580 Prevent "Alt-Alt" from textify_scancode 2008-08-30 10:43:37 +00:00
WMCoolmon f51a8cf3c0 New camera code core commit, delta bank code. 2008-08-30 10:42:27 +00:00
WMCoolmon 743c9eb82d Update to use new camera code. 2008-08-30 10:41:31 +00:00
WMCoolmon 752bff94cc Updated to use new texture map class. 2008-08-30 10:41:01 +00:00
WMCoolmon fd7cbf5750 - Fixed bug involving too many goals being assigned to a ship from wing orders 2008-08-30 10:37:51 +00:00
WMCoolmon 13eb0e77e4 Fix for mantis 0001737 2008-08-30 01:21:54 +00:00
WMCoolmon 896b61f2fe Fix glowpoint option in lab not working (thanks blowfish) 2008-08-30 00:24:10 +00:00
Goober5000 1859ae688e Mantis #1755: stars should not be drawn when there's a skybox 2008-08-26 01:28:30 +00:00
phreak 943ee9b8a2 Add Fred to the list of executables automatically built in debug mode. 2008-08-22 15:05:12 +00:00
karajorma 81a851e33a Revert argument changes till I can figure out why they crashing VC6 builds but not 2005 ones. 2008-08-20 20:45:45 +00:00
phreak 97951efa9d Fix alt-tab and FS2 trying to regain focus. 2008-08-20 04:22:39 +00:00
karajorma 672e34c166 Fix the -argument SEXPs to allow them to cope with conditionals being used within them.
Clean up some code from in-sequence that never worked anyway.
2008-08-19 19:00:54 +00:00
phreak 4ea2ca2b64 Applied blowfish's patch for Mantis #1714. 2008-08-18 23:33:34 +00:00
taylor 61dbdc24b3 fix broken commit from partial Xt merge 2008-08-18 05:56:46 +00:00
phreak 2d79e4eee4 Don't flash the screen red when damaged while invulnerable (either through cheat or sexp). 2008-08-17 22:26:59 +00:00
phreak 1a3e5f28af Fix beam damage when time compression is active. 2008-08-17 21:55:03 +00:00
karajorma 69b61ceaa4 Hmmmmmm. Using a VC2005 keyword as a variable name is just asking for trouble. 2008-08-16 08:13:43 +00:00
Goober5000 ca0df1f2b0 fix a few bugs by rolling back the non-ship-template code from revision 4636
this also fixes the ship spinny thing (which both argv[-1] and Backslash had noticed and fixed previously)
2008-08-16 05:06:38 +00:00
phreak 3f48553935 Add a check to see if the complete escort list is full before adding an additional ship. 2008-08-15 01:37:38 +00:00
karajorma cb6dbe5214 Fix Mantis 1745 (TvT scoring for players kills scales with difficulty) 2008-08-12 20:29:36 +00:00
phreak 52829ea14e Remove check for no-collide-invisible ships when checking to see if a weapon passed it's target. Changed FOV check to allow for missiles with FOV half-angles greater than 90 degrees. 2008-08-11 04:11:46 +00:00
phreak 4e1fdc6c8b Fix for mantis #1744 2008-08-10 21:17:00 +00:00
phreak f419106805 Possible fix for mantis #1728 2008-08-10 21:16:22 +00:00
karajorma bfe417ff2f Add builtin messages for support ships back into TvT missions. 2008-08-10 10:37:20 +00:00
WMCoolmon 3a54776c6b ATTN: Swifty - Mantis #0001707. Update to fix what looks like basic math error on my part. 2008-08-07 01:35:17 +00:00
karajorma 6de7ba0deb Fix Mantis 1605 (Support ships are forever marked as abort on clients after initially called in).
Fix a bug where support messages were sent from the client and the server so they played twice.
2008-08-05 21:25:55 +00:00
WMCoolmon da6fa5a429 Update MSVC2003 project files 2008-08-04 22:54:03 +00:00
karajorma a70c5ffb1d Fix the Run Freespace option in FRED. Still not 100% but it should get a valid name more often than not. 2008-08-04 09:56:40 +00:00
karajorma bcdc1c1589 Fix Mantis 1731 (CTEXT reporting the variable value if a block variable of the same name existed) 2008-08-03 11:39:05 +00:00
karajorma 9a28c24f70 Fix Mantis 1232 (Can't use Zeta in Coop or Beta/Gamma in TvT) 2008-08-02 19:20:58 +00:00
karajorma 4374fcd1ce Fix Mantis 1734 (Block variables appearing in modify_variable menu and SEXP) 2008-08-02 16:53:09 +00:00
karajorma 90e30ee37e Fix a problem with the assertion logging fix I added earlier if the stack trace was too long. Will now log errors too. 2008-07-29 19:25:34 +00:00
WMCoolmon bf23eb17c8 add isPXOEnabled scripting function to Testing library 2008-07-29 04:21:58 +00:00
phreak e10379ad18 Disable UAC for the other project types (debug, and non-sse2 release builds). 2008-07-28 22:14:18 +00:00
phreak d094476101 Remove UAC when building the executables. 2008-07-28 02:51:36 +00:00
karajorma 0a9903f48d Print the stacktrace to the debug log on hitting an assertion. 2008-07-24 20:25:42 +00:00
karajorma a05b1ef11f Allow the player to score from assists and kills in a variety of new ways. 2008-07-24 20:23:52 +00:00
karajorma b3d7dba2a4 Let TvT games use all the skill levels 2008-07-24 20:10:29 +00:00
karajorma a360a8e606 Allow multi_find_player_by_ship_name() to deal with respawning players too 2008-07-24 20:09:21 +00:00
karajorma e44f2c1911 Fix Mantis 1732 (Ship-Guardianing ships destroyed before mission start)
Add change-player/team-score SEXPs
2008-07-24 20:01:30 +00:00
karajorma 5b05ce6028 Update 2005 solution with the shader stuff. 2008-07-24 19:56:27 +00:00
taylor 952c057ff9 add ARB_shader_texture_lod to the stupid SM3.0 test (for OS X mainly) 2008-07-22 15:50:01 +00:00
taylor e1044c578d 2d poofs are supposed to be default (forgot that since I didn't commit the new neb2 code :)) 2008-07-22 12:59:58 +00:00
phreak bba43b5a79 Updated to add new files to the VS2008 project. 2008-07-18 20:26:27 +00:00
taylor f2f6bef1fa damn, forgot these 2008-07-16 07:50:58 +00:00
taylor 9231692e48 basic commit of a few Xt tree changes
- updated OpenGL code (basic shader support, etc.)
 - new ships lab code
 - scripting RTT fixes
 - don't let FRED hog CPU time
2008-07-16 02:49:19 +00:00
karajorma 6e3aa4a33a A bandaid on the gaping wound that is the current score code for ships. Should stop the missions corrupting themselves with ;;FSO 3.6.10;; messages but missions won't open in 3.6.9 now. 2008-07-14 18:25:41 +00:00
taylor 663ff9d0b1 add part of the Xt texture replacement code which fixed texture page-in issues for late arrivals
(rest of the missing thruster fix)
2008-07-14 03:11:11 +00:00
phreak a9c8558507 Updated to a newer version of glext.h from SGI 2008-07-10 11:34:50 +00:00
taylor d5e1312e19 total_time fixage (it should never be allowed to be zero) 2008-07-10 06:15:56 +00:00
taylor 2494bd0291 various thruster fixage from the Xt tree (should fix Mantis #1450) 2008-07-10 05:58:51 +00:00
taylor 6c255cf1c9 fix HB being sent after server disconnect (made games show up for up to 10 minutes after they had ended)
make the chat channel count update more than once, since that didn't appear to work very well
fix compile error with GCC 4.3
2008-07-10 05:10:31 +00:00
Goober5000 16f8087433 the second half of the Mantis #1271 fix 2008-07-10 03:44:45 +00:00
Swifty 14c7b2c4c8 Mantis 1707: fix for FTL warp effect going out of bounds. 2008-07-08 16:17:49 +00:00
Goober5000 9d5d21c39d d'oh -- fix Mantis #1271 2008-07-08 08:03:31 +00:00
karajorma 466d3a2811 Couple of small changes to make the Standalone work again. 2008-07-07 08:46:17 +00:00
Goober5000 b57c41c6f7 fix incompatibility in sexps between retail and SCP 2008-06-26 21:18:46 +00:00
phreak ebc331324d Properly autocenter the missile models in the techroom. 2008-06-26 02:52:51 +00:00
Wanderer ccbdf0ead1 added startMission lua function 2008-06-24 12:27:49 +00:00
phreak 0fff5c7da0 Fix mantis #1710 2008-06-23 22:09:04 +00:00
karajorma 78d512002e Allow capship beams to take full credit for their kills if a flag is set. 2008-06-23 20:47:26 +00:00
karajorma 7ce2d59bce Doh! 2008-06-23 19:01:08 +00:00
karajorma a10ea210b3 Fix a bug that meant players sometimes didn't get an assist is someone had already earned one.
Make it possible to decide what percentage of the damage a ship receives earns you a kill.
2008-06-23 16:27:14 +00:00
WMCoolmon 89f5949071 The new scripting hooks for mouse/keyboard. 2008-06-23 07:50:47 +00:00
Swifty 1746c4ce94 Even more accurate HUD reticle offset calculations. 2008-06-23 07:39:01 +00:00
phreak 4a2b028463 Get rid of my mixed case old username. 2008-06-23 01:58:02 +00:00
phreak 468bcc6441 Fixed filename cases in the code, fred2, and freespace2 project files. The files were originally mixed-case (from fs2-public) and the mixed-case names would be restored when saving the files. This didn't sit too well with SVN. 2008-06-23 01:54:33 +00:00
karajorma 73aaa87bd3 Change No Debrief to Toggle Debrief. It will now turn on debriefings for dogfight missions (Which otherwise get the kills matrix). 2008-06-22 16:57:35 +00:00
karajorma ea02c08748 Add the Hide-ship-name ship flag 2008-06-22 16:55:29 +00:00
Swifty 87b4f5ef8d Fixed inaccurate slewing HUD reticle as pointed out by Goober. 2008-06-22 08:24:57 +00:00
Goober5000 1dcb42aa5d added missing TrackIR offsets in FS1 HUD code
disabled the entire HUD nose offset system until Swifty can fix the centering algorithm
2008-06-22 04:02:07 +00:00
taylor 0c1d218fb4 fix compiling on F9 (per the standard, limits.h isn't implicitly included) 2008-06-19 04:36:26 +00:00
karajorma d9432e7e82 I'm fairly sure FRED shouldn't be calling that function. Certainly not for BtRL at least as it was causing a crash. 2008-06-18 22:24:56 +00:00
124 changed files with 9935 additions and 26287 deletions

No files matched your search

+175
View File
@@ -712,3 +712,178 @@ int main ()
AC_SUBST(THEORA_LIBS)
rm -f conf.theoratest
])
dnl AM_PATH_OPENAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for OpenAL, and define OPENAL_CFLAGS and OPENAL_LIBS
dnl
AC_DEFUN([AM_PATH_OPENAL],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(openal,[ --with-openal=PFX Prefix where OpenAL is installed (optional)], openal_prefix="$withval", openal_prefix="")
AC_ARG_WITH(openal-libraries,[ --with-openal-libraries=DIR Directory where OpenAL library is installed (optional)], openal_libraries="$withval", openal_libraries="")
AC_ARG_WITH(openal-includes,[ --with-openal-includes=DIR Directory where OpenAL header files are installed (optional)], openal_includes="$withval", openal_includes="")
AC_ARG_ENABLE(openaltest, [ --disable-openaltest Do not try to compile and run a test OpenAL program],, enable_openaltest=yes)
if test "x$openal_libraries" != "x" ; then
OPENAL_LIBS="-L$openal_libraries"
elif test "x$openal_prefix" != "x" ; then
OPENAL_LIBS="-L$openal_prefix/lib"
elif test "x$prefix" != "xNONE"; then
OPENAL_LIBS="-L$libdir"
fi
OPENAL_LIBS="$OPENAL_LIBS -lopenal"
if test "x$openal_includes" != "x" ; then
OPENAL_CFLAGS="-I$openal_includes"
elif test "x$openal_prefix" != "x" ; then
OPENAL_CFLAGS="-I$openal_prefix/include"
elif test "x$prefix" != "xNONE"; then
OPENAL_CFLAGS=""
fi
AC_MSG_CHECKING(for OpenAL)
no_openal=""
if test "x$enable_openaltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"
dnl
dnl Now check if the installed OpenAL is sufficiently new.
dnl
rm -f conf.openaltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <AL/al.h>
#include <AL/alc.h>
int main ()
{
#ifdef AL_VERSION_1_1
alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT");
system("touch conf.openaltest");
return 0;
#else
printf("\n*** OpenAL version 1.1 or greater is required.\n");
return 1;
#endif
}
],, no_openal=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_openal" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.openaltest ; then
:
else
echo "*** Could not run OpenAL test program, checking why..."
CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <AL/al.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding OpenAL or finding the wrong"
echo "*** version of OpenAL. If it is not finding OpenAL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means OpenAL was incorrectly installed"
echo "*** or that you have moved OpenAL since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OPENAL_CFLAGS=""
OPENAL_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENAL_CFLAGS)
AC_SUBST(OPENAL_LIBS)
rm -f conf.openaltest
])
dnl AM_PATH_OPENGL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for OpenGL, and define OPENGL_CFLAGS and OPENGL_LIBS
dnl
AC_DEFUN([AM_PATH_OPENGL],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(opengl,[ --with-opengl=PFX Prefix where OpenGL is installed (optional)], opengl_prefix="$withval", opengl_prefix="")
AC_ARG_WITH(opengl-libraries,[ --with-opengl-libraries=DIR Directory where OpenGL library is installed (optional)], opengl_libraries="$withval", opengl_libraries="")
AC_ARG_WITH(opengl-includes,[ --with-opengl-includes=DIR Directory where OpenGL header files are installed (optional)], opengl_includes="$withval", opengl_includes="")
AC_ARG_ENABLE(opengltest, [ --disable-opengltest Do not try to compile and run a test OpenGL program],, enable_opengltest=yes)
if test "x$opengl_libraries" != "x" ; then
OPENGL_LIBS="-L$opengl_libraries"
elif test "x$opengl_prefix" != "x" ; then
OPENGL_LIBS="-L$opengl_prefix/lib"
elif test "x$prefix" != "xNONE"; then
OPENGL_LIBS="-L$libdir"
fi
OPENGL_LIBS="$OPENGL_LIBS -lGL -lGLU"
if test "x$opengl_includes" != "x" ; then
OPENGL_CFLAGS="-I$opengl_includes"
elif test "x$opengl_prefix" != "x" ; then
OPENGL_CFLAGS="-I$opengl_prefix/include"
elif test "x$prefix" != "xNONE"; then
OPENGL_CFLAGS=""
fi
no_opengl=""
if test "x$enable_opengltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OPENGL_CFLAGS"
LIBS="$LIBS $OPENGL_LIBS"
AC_CHECK_LIB(GL, glPushMatrix,
[AC_CHECK_HEADER(GL/gl.h,
[AC_CHECK_LIB(GLU, gluPerspective,
[AC_CHECK_HEADER(GL/glu.h, ,
dnl NOTE: this is a failure
no_opengl=yes
)]
)]
)]
)
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_opengl" = "x" ; then
ifelse([$1], , :, [$1])
else
OPENGL_CFLAGS=""
OPENGL_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENGL_CFLAGS)
AC_SUBST(OPENGL_LIBS)
])
+1 -1
View File
@@ -88,7 +88,7 @@ char *ai_get_goal_ship_name(char *name, int *index)
}
Assert(Total_goal_ship_names < MAX_GOAL_SHIP_NAMES);
Assertion(strlen(name) < NAME_LENGTH - 1, "Ship name %s is too long. Needs to be 31 characters or less.", name);
Assert(strlen(name) < NAME_LENGTH - 1);
i = Total_goal_ship_names++;
strcpy_s(Goal_ship_names[i], name);
*index = i;
-6
View File
@@ -21,7 +21,6 @@
struct ship_weapon;
struct ship_subsys;
struct object;
struct ship_info;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
@@ -640,7 +639,6 @@ extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, i
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index );
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int subsys_path=0);
extern int ai_find_goal_index( ai_goal* aigp, int mode, int submode = -1, int priority = -1 );
// Goober5000
extern void ai_do_safety(object *objp);
@@ -703,8 +701,4 @@ void init_aip_from_class_and_profile(ai_info *aip, ai_class *aicp, ai_profile_t
//SUSHI: Updating AI aim
void ai_update_aim(ai_info *aip, object* En_Objp);
//SUSHI: Random evasive sidethrust
void do_random_sidethrust(ai_info *aip, ship_info *sip);
#endif
+1 -3
View File
@@ -49,6 +49,7 @@ void set_flag(ai_profile_t *profile, char *name, int flag, int type)
void parse_ai_profiles_tbl(char *filename)
{
int i, rval;
bool no_create = false;
char profile_name[NAME_LENGTH];
ai_profile_t dummy_profile;
char *saved_Mp = NULL;
@@ -83,7 +84,6 @@ void parse_ai_profiles_tbl(char *filename)
{
ai_profile_t *profile = &dummy_profile;
ai_profile_t *previous_profile = NULL;
bool no_create = false;
// get the name
required_string("$Profile Name:");
@@ -393,8 +393,6 @@ void parse_ai_profiles_tbl(char *filename)
set_flag(profile, "$perform less checks for death screams:", AIPF2_PERFORM_LESS_SCREAM_CHECKS, AIP_FLAG2);
set_flag(profile, "$all ships manage shields:", AIPF2_ALL_SHIPS_MANAGE_SHIELDS, AIP_FLAG2);
// if we've been through once already and are at the same place, force a move
if ( saved_Mp && (saved_Mp == Mp) )
Mp++;
-1
View File
@@ -54,7 +54,6 @@
#define AIPF2_TURRETS_IGNORE_TARGET_RADIUS (1 << 0)
#define AIPF2_NO_SPECIAL_PLAYER_AVOID (1 << 1)
#define AIPF2_PERFORM_LESS_SCREAM_CHECKS (1 << 2)
#define AIPF2_ALL_SHIPS_MANAGE_SHIELDS (1 << 3)
#define MAX_AI_PROFILES 5
+1 -15
View File
@@ -694,7 +694,7 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *f
ship_weapon *tswp = &temp_shipp->weapons;
if ( tswp->num_primary_banks > 0 ) {
Assertion(tswp->current_primary_bank < tswp->num_primary_banks, "AI tried to select primary bank %d. Might be a model error\n", tswp->current_primary_bank);
Assert(tswp->current_primary_bank < tswp->num_primary_banks);
weapon_info *wip = &Weapon_info[tswp->primary_bank_weapons[tswp->current_primary_bank]];
if (dist_to_enemy < MIN((wip->max_speed * wip->lifetime), wip->weapon_range)){
@@ -1640,20 +1640,6 @@ void ai_big_strafe()
Int3(); // Illegal submode for AIM_STRAFE
break;
}
//Maybe apply random sidethrust, depending on the current submode
//The following are valid targets for random sidethrust (circle strafe uses it too, but that is handled separately)
if (aip->submode == AIS_STRAFE_ATTACK ||
aip->submode == AIS_STRAFE_AVOID ||
aip->submode == AIS_STRAFE_RETREAT1 ||
aip->submode == AIS_STRAFE_RETREAT2 ||
aip->submode == AIS_STRAFE_POSITION)
{
//Re-roll for random sidethrust every 2 seconds
if (static_randf((Missiontime + static_rand(aip->shipnum)) >> 17) < aip->ai_random_sidethrust_percent) {
do_random_sidethrust(aip, &Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index]);
}
}
}
// See if Pl_objp should enter strafe mode (This is called from maybe_evade_dumbfire_weapon(), and the
+422 -196
View File
@@ -304,9 +304,6 @@ typedef struct {
// Move to a position relative to a dock bay using thrusters.
float dock_orient_and_approach(object *docker_objp, int docker_index, object *dockee_objp, int dockee_index, int dock_mode, rotating_dockpoint_info *rdinfo = NULL);
// The object that is declared to be the leader of the group formation for
// the "autopilot"
object *Autopilot_flight_leader = NULL;
// ai_set_rearm_status takes a team (friendly, hostile, neutral) and a time. This function
// sets the timestamp used to tell is it is a good time for this team to rearm. Once the timestamp
@@ -769,8 +766,6 @@ void parse_ai_class()
set_aic_flag(aicp, "$allow vertical dodge:", AIPF_ALLOW_VERTICAL_DODGE, AIP_FLAG);
set_aic_flag(aicp, "$no extra collision avoidance vs player:", AIPF2_NO_SPECIAL_PLAYER_AVOID, AIP_FLAG2);
set_aic_flag(aicp, "$all ships manage shields:", AIPF2_ALL_SHIPS_MANAGE_SHIELDS, AIP_FLAG2);
}
void reset_ai_class_names()
@@ -1316,6 +1311,40 @@ if (!((objp->type == OBJ_WEAPON) && (Weapon_info[Weapons[objp->instance].weapon_
// If new target (objnum) is different than old target, reset target_time.
int set_target_objnum(ai_info *aip, int objnum)
{
/*
char old_name[32], new_name[32];
if (!timestamp_elapsed(aip->ok_to_target_timestamp))
return aip->target_objnum;
if (Player_ship && (Ships[aip->shipnum].team == Player_ship->team)) {
if (aip->target_objnum == -1)
strcpy_s(old_name, "none");
else
strcpy_s(old_name, Ships[Objects[aip->target_objnum].instance].ship_name);
if (objnum == -1)
strcpy_s(new_name, "none");
else
strcpy_s(new_name, Ships[Objects[objnum].instance].ship_name);
nprintf(("AI", "Ship %s changing target from %s to %s\n", Ships[aip->shipnum].ship_name, old_name, new_name));
}
*/
// AL 2-25-97: Ensure that a protected ship isn't being set as a target (for non-players only)
/*
if ( objnum >= 0 ) {
if ( !(Objects[Ships[aip->shipnum].objnum].flags & OF_PLAYER_SHIP) ) {
if ( Objects[objnum].flags & OF_PROTECTED ) {
// AL 2-26-97: removing Int3() until issue with setting OF_PROTECTED in ai_set_attack_subsystem()
//Int3(); // this should not happen
return aip->target_objnum; // don't change targets
}
}
}
*/
if ((aip != Player_ai) && (!timestamp_elapsed(aip->ok_to_target_timestamp))) {
return aip->target_objnum;
}
@@ -1417,6 +1446,7 @@ void adjust_accel_for_docking(ai_info *aip)
// make sure we at least some velocity
if (ratio < 0.1f) {
// Int3();
ratio = 0.1f;
}
@@ -1819,6 +1849,52 @@ float get_wing_lowest_max_speed(object *objp)
return lowest_max_speed;
}
/*
// Tell everyone to ignore object objnum.
void set_global_ignore_object(int objnum)
{
int i;
Assert(Objects[objnum].type == OBJ_SHIP);
nprintf(("AI", "Telling everyone to ignore object %s\n", Ships[Objects[objnum].instance].ship_name));
for (i=0; i<MAX_IGNORE_OBJECTS; i++) {
if (Ignore_objects[i].objnum == -1) {
Ignore_objects[i].objnum = objnum;
Ignore_objects[i].signature = Objects[objnum].signature;
break;
}
}
if (i == MAX_IGNORE_OBJECTS) {
// Couldn't find a free slot, but maybe one of these objects has died.
for (i=0; i<MAX_IGNORE_OBJECTS; i++) {
int o = Ignore_objects[i].objnum;
if (Objects[o].type != OBJ_SHIP)
break; // Not a ship, so use this slot.
if (Objects[o].signature != Ignore_objects[i].signature)
break; // Signatures don't match, so use this slot.
}
if (i != MAX_IGNORE_OBJECTS) {
Ignore_objects[i].objnum = objnum;
Ignore_objects[i].signature = Objects[objnum].signature;
} else {
nprintf(("Warning", "Ignore_objects buffer full. Stealing a slot to ignore object #%i\n"));
Int3();
int r;
r = objnum % MAX_IGNORE_OBJECTS;
Ignore_objects[r].objnum = objnum;
Ignore_objects[r].signature = Objects[objnum].signature;
}
}
}
*/
// Goober5000 - fixed up a bit
// Determine if object objnum is supposed to be ignored by object with ai_info *aip.
@@ -4098,13 +4174,13 @@ void ai_safety()
// --------------------------------------------------------------------------
// make Pl_objp fly to its target's position
// optionally returns true if Pl_objp (pl_done_p) has reached the target position (can be NULL)
// optionally returns true if Pl_objp's (pl_treat_as_ship_p) fly to order was issued to him directly,
// or if the order was issued to his wing (returns false) (can be NULL, and result is only
// valid if Pl_done_p was not NULL and was set true by function.
void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl_treat_as_ship_p=NULL)
// make Pl_objp fly tword a ship
// Goal created by Kazan
// code adapted from waypoints
void ai_fly_to_ship()
{
vec3d *target_pos;
float dot, dist_to_goal, speed;
ship *shipp = &Ships[Pl_objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
@@ -4114,25 +4190,30 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
float prev_dot_to_goal;
vec3d temp_vec;
vec3d *slop_vec;
int j;
Assert( target_pos != NULL );
if ( pl_done_p != NULL ) {
// initialize this to false now incase we leave early so that that
// the caller of this function doesn't get any funny ideas about
// the status of the waypoint
*pl_done_p = false;
}
int target_object=-1;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
/* I shouldn't be flying to position for what ever called me any more.
Set mode to none so that default dynamic behaviour gets started up again. */
if ( (aip->active_goal == AI_GOAL_NONE) || (aip->active_goal == AI_ACTIVE_GOAL_DYNAMIC) ) {
aip->mode = AIM_NONE;
int i,j ;
for (i = 0; i < MAX_AI_GOALS && target_object == -1; i++)
{
if (aip->goals[i].ai_mode == AIM_FLY_TO_SHIP || aip->goals[i].ai_mode == AI_GOAL_FLY_TO_SHIP)
{
for (j = 0; j < MAX_SHIPS; j++)
{
if (Ships[j].objnum != -1 && !stricmp(aip->goals[i].ship_name, Ships[j].ship_name))
{
target_object = Ships[j].objnum;
break;
}
}
}
}
target_pos = &Objects[target_object].pos;
speed = Pl_objp->phys_info.speed;
dist_to_goal = vm_vec_dist_quick(&Pl_objp->pos, target_pos);
@@ -4166,54 +4247,53 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
// If a wing leader, take turns more slowly, based on size of wing.
int scale;
if (aip->wing >= 0) {
scale = Wings[aip->wing].current_count;
if (Ai_info[Ships[Pl_objp->instance].ai_index].wing >= 0) {
scale = Wings[Ai_info[Ships[Pl_objp->instance].ai_index].wing].current_count;
scale = (int) ((scale+1)/2);
} else {
scale = 1;
}
// ----------------------------------------------
// if in autopilot mode make sure to not collide
// and "keep reasonable distance"
// this needs to be done for ALL SHIPS not just capships STOP CHANGING THIS
// ----------------------------------------------
object *wing_leader = get_wing_leader(aip->wing);
vec3d perp, goal_point;
bool carry_flag = ((shipp->flags2 & SF2_NAVPOINT_CARRY) || ((shipp->wingnum >= 0) && (Wings[shipp->wingnum].flags & WF_NAV_CARRY)));
if (AutoPilotEngaged
&& timestamp_elapsed(LockAPConv)
&& carry_flag
&& ((The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) || (Pl_objp != Autopilot_flight_leader)) )
if (AutoPilotEngaged && timestamp_elapsed(LockAPConv) && carry_flag
&& ((The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) || (Pl_objp != wing_leader)) )
{
Assertion( Autopilot_flight_leader != NULL, "When under autopilot there must be a flight leader" );
// snap wings into formation them into formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) {
if (aip->wing != -1) {
int wing_index = get_wing_index(Pl_objp, aip->wing);
object *wing_leader = get_wing_leader(aip->wing);
if (wing_leader != Pl_objp) {
// not wing leader.. get my position relative to wing leader
// not leader.. get our position relative to leader
get_absolute_wing_pos_autopilot(&goal_point, wing_leader, wing_index, aip->ai_flags & AIF_FORMATION_OBJECT);
} else {
// Am wing leader.. get the wings position relative to the flight leader
j = 1+int( (float)floor(double(autopilot_wings[aip->wing]-1)/2.0) );
switch (autopilot_wings[aip->wing] % 2) {
case 1: // back-left
vm_vec_copy_normalize(&perp, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_copy_normalize(&perp, &Player_obj->orient.vec.rvec);
vm_vec_scale(&perp, -166.0f*j); // 166m is supposedly the optimal range according to tolwyn
vm_vec_add(&goal_point, &Autopilot_flight_leader->pos, &perp);
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
break;
default: //back-right
case 0:
vm_vec_copy_normalize(&perp, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_copy_normalize(&perp, &Player_obj->orient.vec.rvec);
vm_vec_scale(&perp, 166.0f*j);
vm_vec_add(&goal_point, &Autopilot_flight_leader->pos, &perp);
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
break;
}
@@ -4222,10 +4302,10 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
Pl_objp->pos = goal_point;
}
vm_vec_sub(&perp, Navs[CurrentNav].GetPosition(), &Autopilot_flight_leader->pos);
vm_vec_sub(&perp, Navs[CurrentNav].GetPosition(), &Player_obj->pos);
vm_vector_2_matrix(&Pl_objp->orient, &perp, NULL, NULL);
} else {
vm_vec_scale_add(&perp, &Pl_objp->pos, &Autopilot_flight_leader->phys_info.vel, 1000.0f);
vm_vec_scale_add(&perp, &Pl_objp->pos, &wing_leader->phys_info.vel, 1000.0f);
ai_turn_towards_vector(&perp, Pl_objp, flFrametime, sip->srotation_time*3.0f*scale, slop_vec, NULL, 0.0f, 0);
}
} else {
@@ -4240,6 +4320,8 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
dot = vm_vec_dot_to_point(&nvel_vec, &Pl_objp->pos, target_pos);
aip->prev_dot_to_goal = dot;
// nprintf(("AI", "Wp #%i, dot = %6.3f, next dot = %6.3f, dist = %7.2f\n", wp_index, dot, dot_to_next, dist_to_goal));
if (Pl_objp->phys_info.speed < 0.0f) {
accelerate_ship(aip, 1.0f/32);
} else if (prev_dot_to_goal > dot+0.01f) {
@@ -4301,11 +4383,13 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
r = find_nearest_point_on_line(&nearest_point, &Pl_objp->last_pos, &Pl_objp->pos, target_pos);
if ( (vm_vec_dist_quick(&Pl_objp->pos, target_pos) < (MIN_DIST_TO_WAYPOINT_GOAL + fl_sqrt(Pl_objp->radius) + vm_vec_dist_quick(&Pl_objp->pos, &Pl_objp->last_pos)))
|| (((r >= 0.0f) && (r <= 1.0f)) && (vm_vec_dist_quick(&nearest_point, target_pos) < (MIN_DIST_TO_WAYPOINT_GOAL + fl_sqrt(Pl_objp->radius)))))
{
if ( (vm_vec_dist_quick(&Pl_objp->pos, target_pos) < (MIN_DIST_TO_WAYPOINT_GOAL + fl_sqrt(Pl_objp->radius) + vm_vec_dist_quick(&Pl_objp->pos, &Pl_objp->last_pos))) ||
((r >= 0.0f) && (r <= 1.0f)) && (vm_vec_dist_quick(&nearest_point, target_pos) < (MIN_DIST_TO_WAYPOINT_GOAL + fl_sqrt(Pl_objp->radius)))) {
int treat_as_ship;
// when not repeating waypoints -- mark the goal as done and put and entry into the mission log
// we must be careful when dealing with wings. A ship in a wing might be completing
// a waypoint for for the entire wing, or it might be completing a goal for itself. If
// for itself and in a wing, treat the completion as we would a ship
@@ -4313,6 +4397,15 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
if ( Ships[Pl_objp->instance].wingnum != -1 ) {
int type;
// I don't think that you can fly waypoints as dynamic goals!!!
// -- This is legal, just stupid. -- Assert( (aip->active_goal != AI_GOAL_NONE) && (aip->active_goal != AI_ACTIVE_GOAL_DYNAMIC) );
// Clean up from above Assert, just in case we ship without fixing it. (Encountered by JimB on 2/9/98)
if ( (aip->active_goal == AI_GOAL_NONE) || (aip->active_goal == AI_ACTIVE_GOAL_DYNAMIC) ) {
aip->mode = AIM_NONE;
Int3(); // Look at the ship, find out of it's supposed to be flying waypoints. -- MK.
}
type = aip->goals[aip->active_goal].type;
if ( (type == AIG_TYPE_EVENT_WING) || (type == AIG_TYPE_PLAYER_WING) ) {
treat_as_ship = 0;
@@ -4320,20 +4413,20 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
treat_as_ship = 1;
}
}
// setup out parameters
if ( pl_done_p != NULL ) {
*pl_done_p = true;
if ( pl_treat_as_ship_p != NULL ) {
if ( treat_as_ship ) {
*pl_treat_as_ship_p = true;
} else {
*pl_treat_as_ship_p = false;
}
}
// if the ship is not in a wing, remove the goal and continue on
if ( treat_as_ship ) {
ai_mission_goal_complete( aip ); // this call should reset the AI mode
//mission_log_add_entry(LOG_WAYPOINTS_DONE, Ships[Pl_objp->instance].ship_name, wpl->name, -1 );
} else {
Assertion( pl_treat_as_ship_p != NULL,
"pl_done_p cannot be NULL while pl_treat_as_ship_p is not NULL" );
// this ship is in a wing. We must mark the goal as being completed for all ships
// in the wing. We will also mark an entry in the log that the wing completed the goal
// not the individual ship.
ai_mission_wing_goal_complete( Ships[Pl_objp->instance].wingnum, &(aip->goals[aip->active_goal]) );
//mission_log_add_entry( LOG_WAYPOINTS_DONE, Wings[Ships[Pl_objp->instance].wingnum].name, wpl->name, -1 );
}
//wp_index = wpl->count-1;
}
}
}
@@ -4343,8 +4436,18 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
void ai_waypoints()
{
int wp_index;
ai_info *aip;
vec3d *wp_cur, *wp_next;
float dot, dist_to_goal, dist_to_next, speed, dot_to_next;
ship *shipp = &Ships[Pl_objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
waypoint_list *wpl;
ai_info *aip;
vec3d nvel_vec;
float mag;
float prev_dot_to_goal;
vec3d temp_vec;
vec3d *slop_vec;
int j;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
@@ -4358,111 +4461,236 @@ void ai_waypoints()
wpl = &Waypoint_lists[aip->wp_list];
Assert(wpl->count > 0); // What? Is this zero? Probably wp_index never got initialized!
Assert(wpl->count); // What? Is this zero? Probably wp_index never got initialized!
bool done, treat_as_ship;
ai_fly_to_target_position(&(wpl->waypoints[wp_index]), &done, &treat_as_ship);
wp_cur = &wpl->waypoints[wp_index];
wp_next = &wpl->waypoints[(wp_index+1) % wpl->count];
speed = Pl_objp->phys_info.speed;
if ( done ) {
aip->wp_index++; // go on to next waypoint in path
if ( (aip->wp_index >= wpl->count) ) {
// have reached the last waypoint. Do I?
if ( ((aip->wp_flags & WPF_REPEAT) > 0) ) {
aip->wp_index = 0; // go back to the start.
} else {
aip->wp_index = (wpl->count - 1); // stay on the last waypoint
// Log a message that the wing or ship reached his waypoint and
// remove the goal from the AI goals of the ship pr wing, respectively.
// Wether or not we should treat this as a ship or a wing is determined by
// ai_fly_to_target_position when it marks the AI directive as complete
if ( treat_as_ship ) {
ai_mission_goal_complete( aip ); // this call should reset the AI mode
mission_log_add_entry( LOG_WAYPOINTS_DONE, Ships[Pl_objp->instance].ship_name, wpl->name, -1 );
} else {
ai_mission_wing_goal_complete( Ships[Pl_objp->instance].wingnum, &(aip->goals[aip->active_goal]) );
mission_log_add_entry( LOG_WAYPOINTS_DONE, Wings[Ships[Pl_objp->instance].wingnum].name, wpl->name, -1 );
}
}
}
}
}
dist_to_goal = vm_vec_dist_quick(&Pl_objp->pos, wp_cur);
dist_to_next = vm_vec_dist_quick(&Pl_objp->pos, wp_next);
// --------------------------------------------------------------------------
// make Pl_objp fly toward a ship
void ai_fly_to_ship()
{
ai_info *aip;
object* target_p = NULL;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
if ( aip->mode != AIM_FLY_TO_SHIP ) {
Warning(LOCATION,
"ai_fly_to_ship called for '%s' when ai_info.mode not equal to AIM_FLY_TO_SHIP. Is actually '%d'",
Ships[Pl_objp->instance].ship_name,
aip->mode);
aip->mode = AIM_NONE;
return;
}
if ( aip->active_goal < 0 || aip->active_goal >= MAX_AI_GOALS ) {
Warning(LOCATION,
"'%s' is trying to fly-to a ship without an active AI_GOAL\n\n"
"Active ai mode is '%d'",
Ships[Pl_objp->instance].ship_name,
aip->active_goal);
aip->mode = AIM_NONE;
return;
}
Assert( aip->goals[aip->active_goal].ship_name != NULL );
if ( strlen(aip->goals[aip->active_goal].ship_name) == 0 ) {
Warning(LOCATION,
"'%s' is trying to fly-to a ship without a name for the ship",
Ships[Pl_objp->instance].ship_name);
aip->mode = AIM_NONE;
ai_remove_ship_goal( aip, aip->active_goal ); // function sets aip->active_goal to NONE for me
return;
}
for (int j = 0; j < MAX_SHIPS; j++)
{
if (Ships[j].objnum != -1 && !stricmp(aip->goals[aip->active_goal].ship_name, Ships[j].ship_name))
{
target_p = &Objects[Ships[j].objnum];
break;
}
}
if ( target_p == NULL ) {
#ifndef NDEBUG
for (int i = 0; i < MAX_AI_GOALS; i++)
{
if (aip->mode == AIM_FLY_TO_SHIP || aip->goals[i].ai_mode == AI_GOAL_FLY_TO_SHIP)
{
mprintf(("Ship '%s' told to fly to target ship '%s'",
Ships[Pl_objp->instance].ship_name,
aip->goals[i].ship_name));
}
}
#endif
Warning(LOCATION, "Ship '%s' told to fly to a ship but none of the ships it was told to fly to exist.\n"
"See log before this message for list of ships set as fly-to tagets",
Ships[Pl_objp->instance].ship_name);
aip->mode = AIM_NONE;
ai_remove_ship_goal( aip, aip->active_goal ); // function sets aip->active_goal to NONE for me
return;
// Can't use fvec, need to use velocity vector because we aren't necessarily
// moving in the direction we're facing.
// AL 23-3-98: Account for very small velocities by checking result of vm_vec_mag().
// If we don't vm_vec_copy_normalize() will think it is normalizing a null vector.
// if (IS_VEC_NULL(&Pl_objp->phys_info.vel)) {
if ( vm_vec_mag_quick(&Pl_objp->phys_info.vel) < AICODE_SMALL_MAGNITUDE ) {
mag = 0.0f;
vm_vec_zero(&nvel_vec);
} else {
bool done, treat_as_ship;
ai_fly_to_target_position(&(target_p->pos), &done, &treat_as_ship);
mag = vm_vec_copy_normalize(&nvel_vec, &Pl_objp->phys_info.vel);
}
if ( done ) {
// remove the goal from the AI goals of the ship pr wing, respectively.
// Wether or not we should treat this as a ship or a wing is determined by
// ai_fly_to_target when it marks the AI directive as complete
if ( treat_as_ship ) {
ai_mission_goal_complete( aip ); // this call should reset the AI mode
} else {
ai_mission_wing_goal_complete( Ships[Pl_objp->instance].wingnum, &(aip->goals[aip->active_goal]) );
// If moving not-very-slowly and sliding, then try to slide at goal, rather than
// point at goal.
slop_vec = NULL;
if (mag < 1.0f) {
nvel_vec = Pl_objp->orient.vec.fvec;
} else if (mag > 5.0f) {
float nv_dot;
nv_dot = vm_vec_dot(&Pl_objp->orient.vec.fvec, &nvel_vec);
if ((nv_dot > 0.5f) && (nv_dot < 0.97f)) {
slop_vec = &temp_vec;
vm_vec_sub(slop_vec, &nvel_vec, &Pl_objp->orient.vec.fvec);
}
}
// If a wing leader, take turns more slowly, based on size of wing.
int scale;
if (aip->wing >= 0) {
scale = Wings[aip->wing].current_count;
scale = (int) ((scale+1)/2);
} else {
scale = 1;
}
// ----------------------------------------------
// if in autopilot mode make sure to not collide
// and "keep reasonable distance"
// this needs to be done for ALL SHIPS not just capships STOP CHANGING THIS
// ----------------------------------------------
object *wing_leader = get_wing_leader(aip->wing);
vec3d perp, goal_point;
bool carry_flag = ((shipp->flags2 & SF2_NAVPOINT_CARRY) || ((shipp->wingnum >= 0) && (Wings[shipp->wingnum].flags & WF_NAV_CARRY)));
if (AutoPilotEngaged && timestamp_elapsed(LockAPConv) && carry_flag
&& ((The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) || (Pl_objp != wing_leader)) )
{
// snap wings into formation them into formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) {
if (aip->wing != -1) {
int wing_index = get_wing_index(Pl_objp, aip->wing);
if (wing_leader != Pl_objp) {
// not leader.. get our position relative to leader
get_absolute_wing_pos_autopilot(&goal_point, wing_leader, wing_index, aip->ai_flags & AIF_FORMATION_OBJECT);
} else {
j = 1+int( (float)floor(double(autopilot_wings[aip->wing]-1)/2.0) );
switch (autopilot_wings[aip->wing] % 2) {
case 1: // back-left
vm_vec_copy_normalize(&perp, &Player_obj->orient.vec.rvec);
vm_vec_scale(&perp, -166.0f*j); // 166m is supposedly the optimal range according to tolwyn
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
break;
default: //back-right
case 0:
vm_vec_copy_normalize(&perp, &Player_obj->orient.vec.rvec);
vm_vec_scale(&perp, 166.0f*j);
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
break;
}
}
Pl_objp->pos = goal_point;
}
vm_vec_sub(&perp, Navs[CurrentNav].GetPosition(), &Player_obj->pos);
vm_vector_2_matrix(&Pl_objp->orient, &perp, NULL, NULL);
} else {
if ( !wing_leader )
wing_leader = Pl_objp;
vm_vec_scale_add(&perp, &Pl_objp->pos, &wing_leader->phys_info.vel, 1000.0f);
ai_turn_towards_vector(&perp, Pl_objp, flFrametime, sip->srotation_time*3.0f*scale, slop_vec, NULL, 0.0f, 0);
}
} else {
if (dist_to_goal > 0.1f) {
ai_turn_towards_vector(wp_cur, Pl_objp, flFrametime, sip->srotation_time*3.0f*scale, slop_vec, NULL, 0.0f, 0);
}
}
// ----------------------------------------------
prev_dot_to_goal = aip->prev_dot_to_goal;
dot = vm_vec_dot_to_point(&nvel_vec, &Pl_objp->pos, wp_cur);
dot_to_next = vm_vec_dot_to_point(&nvel_vec, &Pl_objp->pos, wp_next);
aip->prev_dot_to_goal = dot;
// If there is no next point on the path, don't care about dot to next.
if (wp_index + 1 >= wpl->count) {
dot_to_next = dot;
}
// nprintf(("AI", "Wp #%i, dot = %6.3f, next dot = %6.3f, dist = %7.2f\n", wp_index, dot, dot_to_next, dist_to_goal));
if (Pl_objp->phys_info.speed < 0.0f) {
accelerate_ship(aip, 1.0f/32);
} else if (prev_dot_to_goal > dot+0.01f) {
// We are further from pointing at our goal this frame than last frame, so slow down.
set_accel_for_target_speed(Pl_objp, Pl_objp->phys_info.speed * 0.95f);
} else if (dist_to_goal < 100.0f) {
float slew_dot = vm_vec_dot(&Pl_objp->orient.vec.fvec, &nvel_vec);
if (fl_abs(slew_dot) < 0.9f) {
accelerate_ship(aip, 0.0f);
} else if (dot < 0.88f + 0.1f*(100.0f - dist_to_goal)/100.0f) {
accelerate_ship(aip, 0.0f);
} else {
accelerate_ship(aip, 0.5f * dot * dot);
}
} else {
float dot1;
if (dist_to_goal < 250.0f) {
dot1 = dot*dot*dot; // Very important to be pointing towards goal when nearby. Note, cubing preserves sign.
} else {
if (dot > 0.0f) {
dot1 = dot*dot;
} else {
dot1 = dot;
}
}
if (dist_to_goal > 100.0f + Pl_objp->radius * 2) {
if (dot < 0.2f) {
dot1 = 0.2f;
}
}
if (sip->flags & SIF_SMALL_SHIP) {
set_accel_for_target_speed(Pl_objp, dot1 * dist_to_goal/5.0f);
} else {
set_accel_for_target_speed(Pl_objp, dot1 * dist_to_goal/10.0f);
}
}
// Make sure not travelling too fast for someone to keep up.
float max_allowed_speed = 9999.9f;
if (shipp->wingnum != -1) {
max_allowed_speed = 0.9f * get_wing_lowest_max_speed(Pl_objp);
}
// check if waypoint speed cap is set and adjust max speed
if (aip->waypoint_speed_cap > 0) {
max_allowed_speed = (float) aip->waypoint_speed_cap;
}
if (aip->prev_accel * shipp->current_max_speed > max_allowed_speed) {
accelerate_ship(aip, max_allowed_speed / shipp->current_max_speed);
}
if ( (dist_to_goal < MIN_DIST_TO_WAYPOINT_GOAL) || (vm_vec_dist_quick(&Pl_objp->last_pos, &Pl_objp->pos) > 0.1f) ) {
vec3d nearest_point;
float r;
r = find_nearest_point_on_line(&nearest_point, &Pl_objp->last_pos, &Pl_objp->pos, wp_cur);
if ( (vm_vec_dist_quick(&Pl_objp->pos, wp_cur) < (MIN_DIST_TO_WAYPOINT_GOAL + fl_sqrt(Pl_objp->radius) + vm_vec_dist_quick(&Pl_objp->pos, &Pl_objp->last_pos))) ||
((r >= 0.0f) && (r <= 1.0f)) && (vm_vec_dist_quick(&nearest_point, wp_cur) < (MIN_DIST_TO_WAYPOINT_GOAL + fl_sqrt(Pl_objp->radius)))) {
wp_index++;
if (wp_index >= wpl->count)
if (aip->wp_flags & WPF_REPEAT) {
wp_index = 0;
} else {
int treat_as_ship;
// when not repeating waypoints -- mark the goal as done and put and entry into the mission log
// we must be careful when dealing with wings. A ship in a wing might be completing
// a waypoint for for the entire wing, or it might be completing a goal for itself. If
// for itself and in a wing, treat the completion as we would a ship
treat_as_ship = 1;
if ( Ships[Pl_objp->instance].wingnum != -1 ) {
int type;
// I don't think that you can fly waypoints as dynamic goals!!!
// -- This is legal, just stupid. -- Assert( (aip->active_goal != AI_GOAL_NONE) && (aip->active_goal != AI_ACTIVE_GOAL_DYNAMIC) );
// Clean up from above Assert, just in case we ship without fixing it. (Encountered by JimB on 2/9/98)
if ( (aip->active_goal == AI_GOAL_NONE) || (aip->active_goal == AI_ACTIVE_GOAL_DYNAMIC) ) {
aip->mode = AIM_NONE;
//Int3(); // Look at the ship, find out of it's supposed to be flying waypoints. -- MK.
}
type = aip->goals[aip->active_goal].type;
if ( (type == AIG_TYPE_EVENT_WING) || (type == AIG_TYPE_PLAYER_WING) ) {
treat_as_ship = 0;
} else {
treat_as_ship = 1;
}
}
// if the ship is not in a wing, remove the goal and continue on
if ( treat_as_ship ) {
ai_mission_goal_complete( aip ); // this call should reset the AI mode
mission_log_add_entry(LOG_WAYPOINTS_DONE, Ships[Pl_objp->instance].ship_name, wpl->name, -1 );
} else {
// this ship is in a wing. We must mark the goal as being completed for all ships
// in the wing. We will also mark an entry in the log that the wing completed the goal
// not the individual ship.
ai_mission_wing_goal_complete( Ships[Pl_objp->instance].wingnum, &(aip->goals[aip->active_goal]) );
mission_log_add_entry( LOG_WAYPOINTS_DONE, Wings[Ships[Pl_objp->instance].wingnum].name, wpl->name, -1 );
}
//wp_index = wpl->count-1;
}
aip->wp_index = wp_index;
}
}
}
@@ -5170,6 +5398,7 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
{
// this can be NULL in the case of a target death and attacker weapon
// change. using notification message instead of a fault
// Int3();
mprintf(("'other_objpp == NULL' in ai_select_primary_weapon()\n"));
return -1;
}
@@ -5221,7 +5450,7 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
// ##UnknownPlayer## - removed.
}
if ( (other_objp->type == OBJ_SHIP) && (Ship_info[Ships[other_objp->instance].ship_info_index].flags & (SIF_BIG_SHIP|SIF_HUGE_SHIP) ) )
if ( Ship_info[Ships[other_objp->instance].ship_info_index].flags & ( SIF_BIG_SHIP | SIF_HUGE_SHIP))
{
//Check if we have a capital+ weapon on board
for (int i = 0; i < swp->num_primary_banks; i++)
@@ -5247,20 +5476,16 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
int i;
float i_hullfactor_prev = 0; // Previous weapon bank hull factor (this is the safe way to do it)
int i_hullfactor_prev_bank = -1; // Bank which gave us this hull factor
// Find the weapon with the highest hull * damage / fire delay factor
for (i = 0; i < swp->num_primary_banks; i++)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
{
if ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
if (((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev) && (!(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS) && !( Ship_info[Ships[other_objp->instance].ship_info_index].flags & ( SIF_BIG_SHIP | SIF_HUGE_SHIP))) )
{
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS) )
{
// This weapon is the new candidate
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
i_hullfactor_prev_bank = i;
}
// This weapon is the new candidate
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].armor_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
i_hullfactor_prev_bank = i;
}
}
}
@@ -5272,16 +5497,15 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
return i_hullfactor_prev_bank; // Return
}
//if the shields are above lets say 10% definitely use a pierceing weapon if there are any-Bobboau
if (enemy_remaining_shield >= 0.10f)
{
//if the shields are above lets say 10% defanantly use a pierceing weapon if there are any-Bobboau
if (enemy_remaining_shield >= 0.10f){
if (swp->current_primary_bank >= 0)
{
int bank_index;
bank_index = swp->current_primary_bank;
if ((Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags2 & WIF2_PIERCE_SHIELDS) && !(Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags2 & WIF2_CAPITAL_PLUS))
if ((Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags2 & WIF2_PIERCE_SHIELDS) && !(Weapon_info[swp->primary_bank_weapons[bank_index]].wi_flags2 & WIF2_CAPITAL_PLUS)&& !( Ship_info[Ships[other_objp->instance].ship_info_index].flags & ( SIF_BIG_SHIP | SIF_HUGE_SHIP)))
{
return swp->current_primary_bank;
}
@@ -5294,7 +5518,7 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
if (weapon_info_index > -1)
{
if ((Weapon_info[weapon_info_index].wi_flags2 & WIF2_PIERCE_SHIELDS) && !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS))
if ((Weapon_info[weapon_info_index].wi_flags2 & WIF2_PIERCE_SHIELDS) && !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS)&& !( Ship_info[Ships[other_objp->instance].ship_info_index].flags & ( SIF_BIG_SHIP | SIF_HUGE_SHIP)))
{
swp->current_primary_bank = i;
return i;
@@ -5315,14 +5539,11 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
{
if ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
if (((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev ) && !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS)&& !( Ship_info[Ships[other_objp->instance].ship_info_index].flags & ( SIF_BIG_SHIP | SIF_HUGE_SHIP)))
{
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS) )
{
// This weapon is the new candidate
i_hullfactor_prev = ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait));
i_hullfactor_prev_bank = i;
}
// This weapon is the new candidate
i_hullfactor_prev = ((((Weapon_info[swp->primary_bank_weapons[i]].armor_factor + Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait));
i_hullfactor_prev_bank = i;
}
}
}
@@ -5344,14 +5565,11 @@ int ai_select_primary_weapon(object *objp, object *other_objp, int flags)
{
if (swp->primary_bank_weapons[i] > -1) // Make sure there is a weapon in the bank
{
if ((((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev)
if (((((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * Weapon_info[swp->primary_bank_weapons[i]].damage) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait) > i_hullfactor_prev ) && !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS)&& !( Ship_info[Ships[other_objp->instance].ship_info_index].flags & ( SIF_BIG_SHIP | SIF_HUGE_SHIP)))
{
if ( !(Weapon_info[swp->primary_bank_weapons[i]].wi_flags2 & WIF2_CAPITAL_PLUS) )
{
// This weapon is the new candidate
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
i_hullfactor_prev_bank = i;
}
// This weapon is the new candidate
i_hullfactor_prev = ( ((Weapon_info[swp->primary_bank_weapons[i]].shield_factor) * (Weapon_info[swp->primary_bank_weapons[i]].damage)) / Weapon_info[swp->primary_bank_weapons[i]].fire_wait );
i_hullfactor_prev_bank = i;
}
}
}
@@ -5520,7 +5738,7 @@ int ai_fire_primary_weapon(object *objp)
if (aip->target_objnum != -1){
enemy_objp = &Objects[aip->target_objnum];
enemy_sip = (enemy_objp->type == OBJ_SHIP) ? &Ship_info[Ships[enemy_objp->instance].ship_info_index] : NULL;
enemy_sip = &Ship_info[Ships[enemy_objp->instance].ship_info_index];
} else {
enemy_objp = NULL;
enemy_sip = NULL;
@@ -5557,7 +5775,7 @@ int ai_fire_primary_weapon(object *objp)
//SUSHI: Burst-fire for ballistic primaries.
if (The_mission.ai_profile->primary_ammo_burst_mult[Game_skill_level] > 0 && //Make sure we are using burst fire
enemy_objp != NULL && enemy_sip != NULL && //We need a target, obviously
enemy_objp != NULL && //We need a target, obviously
(enemy_objp->phys_info.speed >= 1.0f) && //Only burst for moving ships
(enemy_sip->flags & (SIF_SMALL_SHIP | SIF_TRANSPORT)) && //Only burst for small ships (transports count)
swp->primary_bank_start_ammo[swp->current_primary_bank] > 0 && //Prevent div by 0
@@ -6209,6 +6427,7 @@ float ai_get_weapon_dist(ship_weapon *swp)
// If weapon_num is illegal, return a reasonable value. A valid weapon
// will get selected when this ship tries to fire.
if (weapon_num == -1) {
// Int3();
return 1000.0f;
}
@@ -6226,6 +6445,7 @@ float ai_get_weapon_speed(ship_weapon *swp)
weapon_num = swp->primary_bank_weapons[bank_num];
if (weapon_num == -1) {
//Int3();
return 100.0f;
}
@@ -7879,6 +8099,14 @@ void ai_cruiser_chase()
ship *shipp = &Ships[Pl_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];
//WMC - We don't need/want this anymore.
/*
if (!(sip->flags & (SIF_BIG_SHIP | SIF_HUGE_SHIP))) {
Int3(); // Hmm, not a very big ship, how did we get in this function?
aip->mode = AIM_NONE;
return;
}*/
if (En_objp->type != OBJ_SHIP) {
Int3();
return;
@@ -8268,14 +8496,10 @@ void ai_chase()
aip->submode == SM_SUPER_ATTACK ||
aip->submode == SM_EVADE_SQUIGGLE ||
aip->submode == SM_EVADE ||
aip->submode == SM_GET_AWAY ||
aip->submode == AIS_CHASE_GLIDEATTACK)
aip->submode == SM_GET_AWAY)
{
//Re-roll for random sidethrust every 2 seconds
//Also, only do this if we've recently been hit or are in current primary weapon range of target
float current_weapon_range = Weapon_info[swp->primary_bank_weapons[swp->current_primary_bank]].weapon_range;
if (static_randf((Missiontime + static_rand(aip->shipnum)) >> 17) < aip->ai_random_sidethrust_percent &&
((Missiontime - aip->last_hit_time < i2f(5) && aip->hitter_objnum >= 0) || dist_to_enemy < current_weapon_range))
if (static_randf((Missiontime + static_rand(aip->shipnum)) >> 17) < aip->ai_random_sidethrust_percent)
{
do_random_sidethrust(aip, sip);
}
@@ -8353,7 +8577,8 @@ void ai_chase()
aip->submode_start_time = Missiontime;
aip->submode_parm0 = SM_SF_AHEAD;
} else if (dist_to_enemy < CIRCLE_STRAFE_MAX_DIST + En_objp->radius &&
(En_objp->phys_info.speed < MAX(sip->max_vel.xyz.x, sip->max_vel.xyz.y) * 1.5f) &&
(En_objp->phys_info.speed < MAX(sip->max_vel.xyz.x, sip->max_vel.xyz.y)) &&
(dot_to_enemy > 0.33) &&
(static_randf((Missiontime + static_rand(aip->shipnum)) >> 19) < aip->ai_circle_strafe_percent)) {
aip->submode = AIS_CHASE_CIRCLESTRAFE;
aip->submode_start_time = Missiontime;
@@ -8468,7 +8693,8 @@ void ai_chase()
aip->submode_start_time = Missiontime;
aip->submode_parm0 = SM_SF_AHEAD;
} else if (dist_to_enemy < CIRCLE_STRAFE_MAX_DIST + En_objp->radius &&
(En_objp->phys_info.speed < MAX(sip->max_vel.xyz.x, sip->max_vel.xyz.y) * 1.5f) &&
(En_objp->phys_info.speed < MAX(sip->max_vel.xyz.x, sip->max_vel.xyz.y)) &&
(dot_to_enemy > 0.33) &&
(static_randf((Missiontime + static_rand(aip->shipnum)) >> 19) < aip->ai_circle_strafe_percent)) {
aip->submode = AIS_CHASE_CIRCLESTRAFE;
aip->submode_start_time = Missiontime;
@@ -12233,7 +12459,7 @@ void ai_manage_shield(object *objp, ai_info *aip)
// set timestamp
aip->shield_manage_timestamp = timestamp((int) (delay * 1000.0f));
if (sip->flags & SIF_SMALL_SHIP || (aip->ai_profile_flags2 & AIPF2_ALL_SHIPS_MANAGE_SHIELDS)) {
if (sip->flags & SIF_SMALL_SHIP) {
if (Missiontime - aip->last_hit_time < F1_0*10)
ai_transfer_shield(objp, aip->last_hit_quadrant);
else
@@ -15037,7 +15263,7 @@ void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_
objp_hitter = &Objects[hitter_objnum];
// lets not check hits by ghosts any further either
if(objp_hitter->type == OBJ_GHOST)
if(objp_hitter->type & OBJ_GHOST)
return;
// Hit by a protected ship, don't attack it.
+1 -1
View File
@@ -1008,7 +1008,7 @@ void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp, char *actor_name )
* Pass -1 in priority to ignore priority when searching
* Returns -1 if not found, or [0, MAX_AI_GOALS)
*/
int ai_find_goal_index( ai_goal* aigp, int mode, int submode, int priority )
int ai_find_goal_index( ai_goal* aigp, int mode, int submode = -1, int priority = -1 )
{
Assert( aigp != NULL );
for ( int i = 0; i < MAX_AI_GOALS; i++ )
+24 -24
View File
@@ -26,35 +26,35 @@ struct ai_goal;
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
// WMC - Oh and add them to Ai_goal_names plz. TY! :)
#define AI_GOAL_CHASE (1<<1) // 0x00000002
#define AI_GOAL_DOCK (1<<2) // 0x00000004 // used for undocking as well
#define AI_GOAL_WAYPOINTS (1<<3) // 0x00000008
#define AI_GOAL_WAYPOINTS_ONCE (1<<4) // 0x00000010
#define AI_GOAL_WARP (1<<5) // 0x00000020
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6) // 0x00000040
#define AI_GOAL_FORM_ON_WING (1<<7) // 0x00000080
#define AI_GOAL_UNDOCK (1<<8) // 0x00000100
#define AI_GOAL_CHASE_WING (1<<9) // 0x00000200
#define AI_GOAL_GUARD (1<<10) // 0x00000400
#define AI_GOAL_DISABLE_SHIP (1<<11) // 0x00000800
#define AI_GOAL_DISARM_SHIP (1<<12) // 0x00001000
#define AI_GOAL_CHASE_ANY (1<<13) // 0x00002000
#define AI_GOAL_IGNORE (1<<14) // 0x00004000
#define AI_GOAL_GUARD_WING (1<<15) // 0x00008000
#define AI_GOAL_EVADE_SHIP (1<<16) // 0x00010000
#define AI_GOAL_CHASE (1<<1)
#define AI_GOAL_DOCK (1<<2) // used for undocking as well
#define AI_GOAL_WAYPOINTS (1<<3)
#define AI_GOAL_WAYPOINTS_ONCE (1<<4)
#define AI_GOAL_WARP (1<<5)
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6)
#define AI_GOAL_FORM_ON_WING (1<<7)
#define AI_GOAL_UNDOCK (1<<8)
#define AI_GOAL_CHASE_WING (1<<9)
#define AI_GOAL_GUARD (1<<10)
#define AI_GOAL_DISABLE_SHIP (1<<11)
#define AI_GOAL_DISARM_SHIP (1<<12)
#define AI_GOAL_CHASE_ANY (1<<13)
#define AI_GOAL_IGNORE (1<<14)
#define AI_GOAL_GUARD_WING (1<<15)
#define AI_GOAL_EVADE_SHIP (1<<16)
// the next goals are for support ships only
#define AI_GOAL_STAY_NEAR_SHIP (1<<17) // 0x00020000
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18) // 0x00040000
#define AI_GOAL_REARM_REPAIR (1<<19) // 0x00080000
#define AI_GOAL_STAY_NEAR_SHIP (1<<17)
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18)
#define AI_GOAL_REARM_REPAIR (1<<19)
// resume regular goals
#define AI_GOAL_STAY_STILL (1<<20) // 0x00100000
#define AI_GOAL_PLAY_DEAD (1<<21) // 0x00200000
#define AI_GOAL_CHASE_WEAPON (1<<22) // 0x00400000
#define AI_GOAL_STAY_STILL (1<<20)
#define AI_GOAL_PLAY_DEAD (1<<21)
#define AI_GOAL_CHASE_WEAPON (1<<22)
#define AI_GOAL_FLY_TO_SHIP (1<<23) // 0x00800000
#define AI_GOAL_IGNORE_NEW (1<<24) // 0x01000000
#define AI_GOAL_FLY_TO_SHIP (1<<23) // kazan
#define AI_GOAL_IGNORE_NEW (1<<24) // Goober5000
// now the masks for ship types
+6 -14
View File
@@ -1905,8 +1905,8 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
if(num_valid < 1)
ss->turret_enemy_objnum = -1;
// Maybe pick a new enemy, unless targeting has been taken over by scripting
if ( turret_should_pick_new_target(ss) && !ss->scripting_target_override) {
// Maybe pick a new enemy.
if ( turret_should_pick_new_target(ss) ) {
Num_find_turret_enemy++;
int objnum = find_turret_enemy(ss, parent_objnum, &gpos, &gvec, ss->turret_enemy_objnum);
//Assert(objnum < 0 || is_target_beam_valid(tp, objnum));
@@ -2141,12 +2141,6 @@ void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum)
turret_fire_weapon(valid_weapons[0], ss, parent_objnum, &gpos, &tv2e, &predicted_enemy_pos);
else
turret_fire_weapon(valid_weapons[i], ss, parent_objnum, &gpos, &tv2e, &predicted_enemy_pos);
} else {
// make sure salvo fire mode does not turn into autofire
if ((tp->flags & MSS_FLAG_TURRET_SALVO) && ((i + 1) == number_of_firings)) {
ai_info *parent_aip = &Ai_info[Ships[Objects[parent_objnum].instance].ai_index];
turret_set_next_fire_timestamp(valid_weapons[0], wip, ss, parent_aip);
}
}
// moved this here so we increment the fire pos only after we have fired and not during it
ss->turret_next_fire_pos++;
@@ -2219,16 +2213,14 @@ bool turret_adv_fov_test(ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mo
if (((dot + size_mod) > tp->turret_fov) && ((dot - size_mod) <= tp->turret_max_fov)) {
vec3d of_dst;
vm_vec_rotate( &of_dst, v2e, &ss->world_to_turret_matrix );
vm_vec_normalize(&of_dst);
if ((of_dst.xyz.x == 0) && (of_dst.xyz.y == 0)) {
return true;
} else {
of_dst.xyz.z = 0;
if (!IS_VEC_NULL_SQ_SAFE(&of_dst)) {
vm_vec_normalize(&of_dst);
// now we have 2d vector with lenght of 1 that points at the targets direction after being rotated to turrets FOR
if ((-of_dst.xyz.y + size_mod) > tp->turret_y_fov)
return true;
}
// now we have 2d vector with lenght of 1 that points at the targets direction after being rotated to turrets FOR
if ((-of_dst.xyz.y + size_mod) > tp->turret_y_fov)
return true;
}
}
return false;
+5 -3
View File
@@ -1085,9 +1085,11 @@ void anim_reverse_direction(anim_instance *ai)
{
int temp;
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
// The God of Delta-RLE demands it be thus.
Assertion( ai->parent->flags & ANF_ALL_KEYFRAMES, "Ani was set to play backwards. In order to enable this, all frames of the animation MUST be keyframes.");
if(!(ai->parent->flags & ANF_ALL_KEYFRAMES)){
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
// The God of Delta-RLE demands it be thus.
Int3();
}
// flip the animation direction
if(ai->direction == ANIM_DIRECT_FORWARD){
+149 -1
View File
@@ -168,6 +168,154 @@ ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap
return inst->frame;
}
// --------------------------------------------------------------------
// anim_get_frame()
//
// Get a bitmap id from the anim_instance for the specified frame_num
//
// input: *inst => pointer to anim instance
// frame_num => frame number to get (first frame is 0)
// xlate_pal => DEFAULT PARM (value 1): whether to translate the palette
// to the current game palette
//
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal)
{
/*
int bm, bitmap_flags, key = 0, offset = 0;
int idx;
if ((frame_num < 0) || (frame_num >= inst->parent->total_frames)) // illegal frame number
return -1;
int need_reset = 0;
if ( anim_instance_is_streamed(inst) ) {
if ( inst->file_offset < 0 ) {
need_reset = 1;
}
} else {
if ( !inst->data ) {
need_reset = 1;
}
}
if (need_reset || (inst->frame_num >= inst->parent->total_frames)) { // reset to valid info
inst->data = inst->parent->data;
inst->file_offset = inst->parent->file_offset;
inst->frame_num = 0;
}
bitmap_flags = 0;
if (inst->parent->flags & ANF_XPARENT) {
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
}
if ( inst->frame_num == frame_num ) {
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
bm_unload(bm);
return bm;
}
if (inst->parent->flags & ANF_XPARENT){
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
} else {
bitmap_flags = 0;
}
idx = 0;
key = 0;
while(idx < inst->parent->num_keys){
if (( (inst->parent->keys[idx].frame_num-1) <= frame_num) && ( (inst->parent->keys[idx].frame_num-1) > key)) { // find closest key
key = inst->parent->keys[idx].frame_num - 1;
offset = inst->parent->keys[idx].offset;
if ( key == frame_num )
break;
}
idx++;
}
if ( key == frame_num ) {
inst->frame_num = key;
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = inst->parent->file_offset + offset;
} else {
inst->data = inst->parent->data + offset;
}
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal ){
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
} else {
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
} else {
if ( xlate_pal ){
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
} else {
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
}
goto create_bitmap;
}
if (key > inst->frame_num) // best key is closer than current position
{
inst->frame_num = key;
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = inst->parent->file_offset + offset;
} else {
inst->data = inst->parent->data + offset;
}
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal )
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
} else {
if ( xlate_pal )
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
}
while (inst->frame_num != frame_num) {
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal )
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
} else {
if ( xlate_pal )
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
inst->frame_num++;
}
create_bitmap:
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
bm_unload(bm);
return bm;
*/
Int3();
return -1;
}
// frame = frame pixel data to pack
// save = memory to store packed data to
// size = number of bytes to pack
@@ -1025,7 +1173,7 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
}
else {
// unknown packing method
// Int3(); // unknown packing method
return -1;
}
+1
View File
@@ -106,6 +106,7 @@ void anim_init();
anim_instance *init_anim_instance(anim *ptr, int bpp);
void free_anim_instance(anim_instance *inst);
int anim_get_next_frame(anim_instance *inst);
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal=1);
ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap, int bpp);
void anim_set_palette(anim *a);
void anim_check_for_palette_change(anim_instance *inst);
+143 -200
View File
@@ -39,7 +39,6 @@ extern int Cmdline_autopilot_interruptable;
// Module variables
bool AutoPilotEngaged;
bool UseCutsceneBars;
bool LockWeaponsDuringAutopilot;
int CurrentNav;
float ramp_bias;
NavPoint Navs[MAX_NAVPOINTS];
@@ -56,9 +55,6 @@ bool CinematicStarted, CameraMoving;
vec3d cameraPos, cameraTarget;
std::map<int,int> autopilot_wings;
int AutopilotMinEnemyDistance;
int AutopilotMinAsteroidDistance;
// used for ramping time compression;
int start_dist;
@@ -153,7 +149,12 @@ char* NavPoint::GetInteralName()
}
// ********************************************************************************************
bool CanAutopilot(vec3d targetPos, bool send_msg)
// Tell us if autopilot is allowed
// This needs:
// * Nav point selected
// * No enemies within X distance
// * Destination > 1,000 meters away
bool CanAutopilot(bool send_msg)
{
if (CurrentNav == -1)
{
@@ -161,69 +162,99 @@ bool CanAutopilot(vec3d targetPos, bool send_msg)
send_autopilot_msgID(NP_MSG_FAIL_NOSEL);
return false;
}
if (object_get_gliding(Player_obj))
{
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_GLIDING);
return false;
}
// You cannot autopilot if you're within 1000 meters of your destination nav point
if (vm_vec_dist_quick(&targetPos, Navs[CurrentNav].GetPosition()) < 1000) {
if (vm_vec_dist_quick(&Player_obj->pos, Navs[CurrentNav].GetPosition()) < 1000)
{
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_TOCLOSE);
return false;
}
if ( AutopilotMinEnemyDistance > 0 ) {
// see if any hostiles are nearby
for (ship_obj *so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so))
// see if any hostiles are nearby
for (ship_obj *so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so))
{
object *other_objp = &Objects[so->objnum];
// attacks player?
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO))
{
object *other_objp = &Objects[so->objnum];
// attacks player?
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO)) // ignore cargo
// Cannot autopilot if enemy within 5,000 meters
if (vm_vec_dist_quick(&Player_obj->pos, &other_objp->pos) < 5000)
{
// Cannot autopilot if enemy within AutopilotMinEnemyDistance meters
if (vm_vec_dist_quick(&targetPos, &other_objp->pos) < AutopilotMinEnemyDistance) {
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_HOSTILES);
return false;
}
}
}
}
if ( AutopilotMinAsteroidDistance > 0 ) {
//check for asteroids
for (int n=0; n<MAX_ASTEROIDS; n++)
{
// asteroid
if (Asteroids[n].flags & AF_USED)
{
// Cannot autopilot if asteroid within AutopilotMinAsteroidDistance meters
if (vm_vec_dist_quick(&targetPos, &Objects[Asteroids[n].objnum].pos) < AutopilotMinAsteroidDistance) {
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_HAZARD);
return false;
}
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_HOSTILES);
return false;
}
}
}
// check for support ships
// cannot autopilot if support ship present
if ( ship_find_repair_ship(Player_obj) != NULL ) {
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_SUPPORT_PRESENT);
//check for asteroids
for (int n=0; n<MAX_ASTEROIDS; n++)
{
// asteroid
if (Asteroids[n].flags & AF_USED)
{
// Cannot autopilot if asteroid within 1,000 meters
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[Asteroids[n].objnum].pos) < 1000)
{
if (send_msg)
send_autopilot_msgID(NP_MSG_FAIL_HAZARD);
return false;
}
}
}
return true;
}
// ********************************************************************************************
// Tell us if autopilot is allowed at a certain position (only performs checks based on that position)
// This needs:
// * Nav point selected
// * No enemies within X distance
// * Destination > 1,000 meters away
bool CanAutopilotPos(vec3d targetPos)
{
// You cannot autopilot if you're within 1000 meters of your destination nav point
if (vm_vec_dist_quick(&targetPos, Navs[CurrentNav].GetPosition()) < 1000)
return false;
// see if any hostiles are nearby
for (ship_obj *so = GET_FIRST(&Ship_obj_list); so != END_OF_LIST(&Ship_obj_list); so = GET_NEXT(so))
{
object *other_objp = &Objects[so->objnum];
// attacks player?
if (iff_x_attacks_y(obj_team(other_objp), obj_team(Player_obj))
&& !(Ship_info[Ships[other_objp->instance].ship_info_index].flags & SIF_CARGO)) // ignore cargo
{
// Cannot autopilot if enemy within 5,000 meters
if (vm_vec_dist_quick(&targetPos, &other_objp->pos) < 5000)
return false;
}
}
//check for asteroids
for (int n=0; n<MAX_ASTEROIDS; n++)
{
// asteroid
if (Asteroids[n].flags & AF_USED)
{
// Cannot autopilot if asteroid within 1,000 meters
if (vm_vec_dist_quick(&targetPos, &Objects[Asteroids[n].objnum].pos) < 1000)
return false;
}
}
return true;
}
extern object* Autopilot_flight_leader;
// ********************************************************************************************
// Engages autopilot
// This does:
@@ -232,54 +263,13 @@ extern object* Autopilot_flight_leader;
// * Lock time compression -WMC
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
bool StartAutopilot()
void 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;
}
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;
return;
AutoPilotEngaged = true;
// find the ship that is "leading" all of the ships when the player starts
// autopilot
// by default the ship that is leading the autopilot session the player's
// wing leader (if the player is the wing leader then it will be the
// player).
// TODO:implement a way to allow a FREDer to say a different ship is leader
Autopilot_flight_leader = get_wing_leader(Player_ship->wingnum);
if ( Autopilot_flight_leader == NULL ) {
// force player to be the leader if he doesn't have a wing
Autopilot_flight_leader = Player_obj;
}
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
LockAPConv = timestamp(); // lock convergence instantly
else
@@ -338,20 +328,10 @@ bool StartAutopilot()
}
}
// damp speed_cap to 90% of actual -- to make sure ships stay in formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS)
speed_cap = 0.90f * speed_cap;
if ( speed_cap < 1.0f ) {
/* We need to deal with this so that incorrectly flagged ships will not
cause the engine to fail to limit all the ships speeds correctly. */
Warning(LOCATION, "Ship speed cap is way too small (%f)!\n"
"This is normally caused by a ship that has nav-carry-status set, but cannot move itself (like a Cargo container).\n"
"Speed cap has been set to 1.0 m/s.",
speed_cap);
speed_cap = 1.0f;
}
ramp_bias = speed_cap/50.0f;
// assign ship goals
@@ -417,10 +397,10 @@ bool StartAutopilot()
vm_vector_2_matrix(&Objects[Ships[i].objnum].orient, &norm1, NULL, NULL);
}
// snap wings into formation
// snap wings into formation them into formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS && // only if using cinematics
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY) // only if in a wing
&& Autopilot_flight_leader != &Objects[Ships[i].objnum]) //only if not flight leader's object
&& Player_obj != &Objects[Ships[i].objnum]) //only if not player object
{
ai_info *aip = &Ai_info[Ships[i].ai_index];
int wingnum = aip->wing, wing_index = get_wing_index(&Objects[Ships[i].objnum], wingnum);
@@ -439,34 +419,33 @@ bool StartAutopilot()
switch (wcount % 2)
{
case 1: // back-left
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
//vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.fvec);
vm_vec_normalize(&perp);
vm_vec_scale(&perp, -166.0f*j); // 166m is supposedly the optimal range according to tolwyn
vm_vec_add(&goal_point, &Autopilot_flight_leader->pos, &perp);
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
break;
default: //back-right
case 0:
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
//vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.fvec);
vm_vec_normalize(&perp);
vm_vec_scale(&perp, 166.0f*j);
vm_vec_add(&goal_point, &Autopilot_flight_leader->pos, &perp);
vm_vec_add(&goal_point, &Player_obj->pos, &perp);
break;
}
autopilot_wings[wingnum] = wcount;
wcount++;
}
Objects[Ships[i].objnum].pos = goal_point;
if (vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos) > distance)
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos) > distance)
{
distance = vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos);
distance = vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos);
}
}
// lock primary and secondary weapons
if ( LockWeaponsDuringAutopilot )
Ships[i].flags2 |= (SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
//Ships[i].flags2 |= (SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
// clear the ship goals and cap the waypoint speed
ai_clear_ship_goals(&Ai_info[Ships[i].ai_index]);
@@ -561,9 +540,9 @@ bool StartAutopilot()
vec3d right, front, up, offset;
for (i = 0; i < (int)capIndexes.size(); i++)
{
vm_vec_add(&right, &Autopilot_flight_leader->orient.vec.rvec, &zero);
vm_vec_add(&front, &Autopilot_flight_leader->orient.vec.fvec, &zero);
vm_vec_add(&up, &Autopilot_flight_leader->orient.vec.uvec, &zero);
vm_vec_add(&right, &Player_obj->orient.vec.rvec, &zero);
vm_vec_add(&front, &Player_obj->orient.vec.fvec, &zero);
vm_vec_add(&up, &Player_obj->orient.vec.uvec, &zero);
vm_vec_add(&offset, &zero, &zero);
if (Ship_info[Ships[capIndexes[i]].ship_info_index].flags & (SIF_CAPITAL | SIF_SUPERCAP))
{
@@ -631,7 +610,7 @@ bool StartAutopilot()
vm_vec_scale(&up, (1+((float)floor((float)capship_placed[1]/3))));
// move ourselves up and out of the way of the smaller ships
vm_vec_add(&perp, &Autopilot_flight_leader->orient.vec.uvec, &zero);
vm_vec_add(&perp, &Player_obj->orient.vec.uvec, &zero);
vm_vec_scale(&perp, capship_spreads[2]);
vm_vec_add(&up, &up, &perp);
@@ -686,7 +665,7 @@ bool StartAutopilot()
vm_vec_scale(&front, 2*(1+((float)floor((float)capship_placed[2]/3))));
// move "out" by 166*(wcount-1) so we don't bump into fighters
vm_vec_add(&perp, &Autopilot_flight_leader->orient.vec.rvec, &zero);
vm_vec_add(&perp, &Player_obj->orient.vec.rvec, &zero);
vm_vec_scale(&perp, 166.0f*float(wcount-1));
if ( (capship_placed[2] % 2) == 0)
vm_vec_add(&right, &right, &perp);
@@ -708,16 +687,16 @@ bool StartAutopilot()
// global scale the position by 50%
//vm_vec_scale(&offset, 1.5);
vm_vec_add(&Objects[Ships[capIndexes[i]].objnum].pos, &Autopilot_flight_leader->pos, &offset);
vm_vec_add(&Objects[Ships[capIndexes[i]].objnum].pos, &Player_obj->pos, &offset);
if (vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos) > distance)
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos) > distance)
{
distance = vm_vec_dist_quick(&Autopilot_flight_leader->pos, &Objects[Ships[i].objnum].pos);
distance = vm_vec_dist_quick(&Player_obj->pos, &Objects[Ships[i].objnum].pos);
}
}
}
ftemp = floor(Autopilot_flight_leader->phys_info.max_vel.xyz.z/speed_cap);
ftemp = floor(Player_obj->phys_info.max_vel.xyz.z/speed_cap);
if (ftemp >= 2.0f && ftemp < 4.0f)
tc_factor = 2;
else if (ftemp >= 4.0f && ftemp < 8.0f)
@@ -729,11 +708,11 @@ bool StartAutopilot()
tpos = *Navs[CurrentNav].GetPosition();
// determine distance toward nav at which camera will be
vm_vec_sub(&pos, &tpos, &Autopilot_flight_leader->pos);
vm_vec_sub(&pos, &tpos, &Player_obj->pos);
vm_vec_normalize(&pos); // pos is now a unit vector in the direction we will be moving the camera
//norm1 = pos;
vm_vec_scale(&pos, 5*speed_cap*tc_factor); // pos is now scaled by 5 times the speed (5 seconds ahead)
vm_vec_add(&pos, &pos, &Autopilot_flight_leader->pos); // pos is now 5*speed cap in front of player ship
vm_vec_add(&pos, &pos, &Player_obj->pos); // pos is now 5*speed cap in front of player ship
switch (myrand()%24)
// 8 different ways of getting perp points
@@ -744,74 +723,74 @@ bool StartAutopilot()
case 9:
case 16:
if (capship_placed[0] == 0)
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.uvec);
else
{ // become up-left
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_sub(&perp, &perp, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.uvec);
vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.rvec);
}
break;
case 2: // up
case 10:
case 23:
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
if (capshipPresent) // become up-right
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.rvec);
break;
case 3: // left
case 11:
case 22:
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.rvec);
break;
case 4: // up-left
case 12:
case 21:
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.rvec);
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
break;
case 5: // up-right
case 13:
case 20:
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
break;
case 6: // down-left
case 14:
case 19:
vm_vec_sub(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_sub(&perp, &zero, &Player_obj->orient.vec.rvec);
if (capship_placed[0] < 2)
vm_vec_sub(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.uvec);
else
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
break;
case 7: // down-right
case 15:
case 18:
vm_vec_add(&perp, &zero, &Autopilot_flight_leader->orient.vec.rvec);
vm_vec_add(&perp, &zero, &Player_obj->orient.vec.rvec);
if (capship_placed[0] < 1)
vm_vec_sub(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_sub(&perp, &perp, &Player_obj->orient.vec.uvec);
else
vm_vec_add(&perp, &perp, &Autopilot_flight_leader->orient.vec.uvec);
vm_vec_add(&perp, &perp, &Player_obj->orient.vec.uvec);
break;
default:
case 0: // right
case 8:
case 17:
perp = Autopilot_flight_leader->orient.vec.rvec;
perp = Player_obj->orient.vec.rvec;
break;
}
vm_vec_normalize(&perp);
//vm_vec_scale(&perp, 2*radius+distance);
vm_vec_scale(&perp, Autopilot_flight_leader->radius+radius);
vm_vec_scale(&perp, Player_obj->radius+radius);
// randomly scale up/down by up to 20%
j = 20-myrand()%40; // [-20,20]
@@ -851,8 +830,16 @@ bool StartAutopilot()
camMovingTime = int(4.5*float(tc_factor));
set_time_compression((float)tc_factor);
}
}
return true;
// ********************************************************************************************
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 10,000 meters away
// * Enemy < 10,000 meters
bool Autopilot_AutoDiable()
{
return !CanAutopilot();
}
// ********************************************************************************************
@@ -865,8 +852,6 @@ void EndAutoPilot()
{
AutoPilotEngaged = false;
Autopilot_flight_leader = NULL;
set_time_compression(1);
lock_time_compression(false);
Player_use_ai = 0;
@@ -914,10 +899,8 @@ void EndAutoPilot()
)
{
//unlock their weaponry
if ( LockWeaponsDuringAutopilot )
Ships[i].flags2 &= ~(SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
//Ships[i].flags2 &= ~(SF2_PRIMARIES_LOCKED | SF2_SECONDARIES_LOCKED);
Ai_info[Ships[i].ai_index].waypoint_speed_cap = -1; // uncap their speed
Ai_info[Ships[i].ai_index].mode = AIM_NONE; // make AI re-evaluate current ship mode
for (j = 0; j < MAX_AI_GOALS; j++)
{
@@ -992,54 +975,34 @@ camera* nav_get_set_camera()
void nav_warp(bool prewarp=false)
{
/* ok... find our end distance - norm1 is still a unit vector in the
direction from the flight leader to the navpoint */
vec3d targetPos, tpos=Autopilot_flight_leader->pos, pos, velocity;
/* calculate a vector that we can use to make a path from the flight
leader's location to the nav point */
vm_vec_sub(&pos, Navs[CurrentNav].GetPosition(), &Autopilot_flight_leader->pos);
// ok... find our end distance - norm1 is still a unit vector in the direction from the player to the navpoint
vec3d targetPos, tpos=Player_obj->pos, pos;
vm_vec_sub(&pos, Navs[CurrentNav].GetPosition(), &Player_obj->pos);
vm_vec_normalize(&pos);
velocity = pos; // make a copy for later when we do setup veleocity vector
vm_vec_scale(&pos, 250.0f); // we move by increments of 250
/* using the vector of the flight leaders's path, simulate moving the
flight along this path by checking the autopilot conditions as specific
intervals along the path*/
while (CanAutopilot(tpos))
while (CanAutopilotPos(tpos))
{
vm_vec_add(&tpos, &tpos, &pos);
}
vm_vec_sub(&targetPos, &tpos, &Autopilot_flight_leader->pos);
/* targetPos is actually a vector that describes the exact 3D movement that
the flgith leader needs to execute to reach the location that the auto
pilot is to shut off */
vm_vec_sub(&targetPos, &tpos, &Player_obj->pos); //targetPos is actually a projection in a the direction toward the nav
// Check if we are actually just setting up for the cinimatic shot of the
// flight flying on autopilot. Only jump halfway. Also we also need to
// put the camera in the correct position to show the player this cinimatic
if (prewarp)
{
vm_vec_scale(&targetPos, 0.5);
vm_vec_add(&cameraPos, &cameraPos, &targetPos);
}
/* calcuate the speed that everyone is supposed to be going so that there
is no need for anyone to accelerate or decelerate (most obvious with
the player's fighter slowing down as it changes the camera pan speed). */
Assert( Ai_info[Ships[Autopilot_flight_leader->instance].ai_index].waypoint_speed_cap > 0 );
vm_vec_scale(&velocity, (float)Ai_info[Ships[Autopilot_flight_leader->instance].ai_index].waypoint_speed_cap);
// Find all ships that are supposed to autopilot with the player and move them
// to the cinimatic location or the final destination
for (int i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1
&& (Ships[i].flags2 & SF2_NAVPOINT_CARRY
|| (Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)))
if (Ships[i].objnum != -1 &&
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
)
)
{
vm_vec_add(&Objects[Ships[i].objnum].pos, &Objects[Ships[i].objnum].pos, &targetPos);
Objects[Ships[i].objnum].phys_info.vel = velocity;
}
}
@@ -1078,7 +1041,7 @@ void NavSystem_Do()
}
if (timestamp() >= EndAPCinematic || !CanAutopilot())
if (timestamp() >= EndAPCinematic || Autopilot_AutoDiable())
{
nav_warp();
EndAutoPilot();
@@ -1097,7 +1060,7 @@ void NavSystem_Do()
if(cam != NULL)
{
cam->set_position(&cameraPos);
cam->set_rotation_facing(&Autopilot_flight_leader->pos);
cam->set_rotation_facing(&Player_obj->pos);
}
CinematicStarted = true;
@@ -1105,7 +1068,7 @@ void NavSystem_Do()
}
else
{
if (!CanAutopilot())
if (Autopilot_AutoDiable())
EndAutoPilot();
}
@@ -1178,10 +1141,7 @@ void NavSystem_Do()
}
}
/* Link in any ships that need to be linked in when the player gets close
enough. Always done by the player because: "making sure the AI fighters
are where they're supposed to be at all times is like herding cats" -Woolie Wool
*/
// autopilot linking
for (int i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 && Ships[i].flags2 & SF2_NAVPOINT_NEEDSLINK)
@@ -1231,7 +1191,7 @@ void send_autopilot_msg(char *msg, char *snd)
// send/play
if (audio_handle != -1)
{
audiostream_play(audio_handle, (Master_event_music_volume * aav_music_volume), 0);
audiostream_play(audio_handle, Master_event_music_volume, 0);
}
if (strlen(msg) != 0 && strcmp(msg, "none"))
@@ -1287,21 +1247,6 @@ void parse_autopilot_table(char *filename)
required_string("$Link Distance:");
stuff_int(&NavLinkDistance);
if (optional_string("$Interrupt autopilot if enemy within distance:"))
stuff_int(&AutopilotMinEnemyDistance);
else
AutopilotMinEnemyDistance = 5000;
if (optional_string("$Interrupt autopilot if asteroid within distance:"))
stuff_int(&AutopilotMinAsteroidDistance);
else
AutopilotMinAsteroidDistance = 1000;
if (optional_string("$Lock Weapons During Autopilot:"))
stuff_boolean(&LockWeaponsDuringAutopilot);
else
LockWeaponsDuringAutopilot = false;
// optional no cutscene bars
if (optional_string("+No_Cutscene_Bars"))
UseCutsceneBars = false;
@@ -1310,9 +1255,7 @@ void parse_autopilot_table(char *filename)
Cmdline_autopilot_interruptable = 0;
// No Nav selected message
char *msg_tags[] = { "$No Nav Selected:", "$Gliding:",
"$Too Close:", "$Hostiles:", "$Linked:", "$Hazard:",
"$Support Present:", "$Support Working:" };
char *msg_tags[] = { "$No Nav Selected:", "$Gliding:", "$Too Close:", "$Hostiles:", "$Linked:", "$Hazard:" };
for (int i = 0; i < NP_NUM_MESSAGES; i++)
{
required_string(msg_tags[i]);
+13 -17
View File
@@ -8,7 +8,6 @@
#define _AUTOPILOT_H_
#include "globalincs/pstypes.h"
#include "object/object.h"
#include <map>
// milliseconds between updates
@@ -38,15 +37,13 @@ struct NavPoint
};
#define NP_NUM_MESSAGES 6
#define NP_MSG_FAIL_NOSEL 0
#define NP_MSG_FAIL_GLIDING 1
#define NP_MSG_FAIL_TOCLOSE 2
#define NP_MSG_FAIL_HOSTILES 3
#define NP_MSG_MISC_LINKED 4
#define NP_MSG_FAIL_HAZARD 5
#define NP_MSG_FAIL_SUPPORT_PRESENT 6
#define NP_MSG_FAIL_SUPPORT_WORKING 7
#define NP_NUM_MESSAGES 8
struct NavMessage
{
@@ -65,28 +62,27 @@ extern std::map<int,int> autopilot_wings;
bool Sel_NextNav();
// Tell us if autopilot is allowed
// Tell us is autopilot is allow
// This needs:
// * Nav point selected
// * No enemies within AutopilotMinEnemyDistance meters
// * No asteroids within AutopilotMinAsteroidDistance meters
// * No enemies within 5,000 meters
// * Destination > 1,000 meters away
// * Support ship not present or is actively leaving
bool CanAutopilot(vec3d targetPos, bool send_msg=false);
// Check if autopilot is allowed at player's current position
// See CanAutopilot(vec3d, bool) for more information
inline bool CanAutopilot(bool send_msg=false) { return CanAutopilot(Player_obj->pos, send_msg); }
bool CanAutopilot(bool send_msg=false);
bool CanAutopilotPos(vec3d targetPos);
// Engages autopilot
// This does:
// * Checks if Autopilot is allowed. See CanAutopilot() for conditions.
// * Control switched from player to AI
// * Time compression to 32x
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
// Returns false if autopilot cannot be started. True otherwise.
bool StartAutopilot();
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
void StartAutopilot();
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 1,000 meters away
// * Enemy < 5,000 meters
bool Autopilot_AutoDiable();
// Disengages autopilot
// this does:
+11 -5
View File
@@ -534,7 +534,7 @@ int bm_load( char *real_filename )
}
if (free_slot < 0) {
Assertion(free_slot < 0, "Could not find free BMPMAN slot for bitmap: %s", real_filename);
Int3();
goto Done;
}
@@ -1046,7 +1046,7 @@ int bm_get_info( int handle, int *w, int * h, ubyte * flags, int *nframes, int *
}
#endif
Assertion( bm_bitmaps[bitmapnum].handle == handle, "Invalid bitmap handle %d passed to bm_get_info().\nThis might be due to an invalid animation somewhere else.\n", handle ); // INVALID BITMAP HANDLE!
Assert( bm_bitmaps[bitmapnum].handle == handle ); // INVALID BITMAP HANDLE!
if ( (bm_bitmaps[bitmapnum].type == BM_TYPE_NONE) || (bm_bitmaps[bitmapnum].handle != handle) ) {
if (w) *w = 0;
@@ -1089,7 +1089,7 @@ unsigned int bm_get_signature(int handle)
if ( !bm_inited ) bm_init();
int bitmapnum = handle % MAX_BITMAPS;
Assertion( bm_bitmaps[bitmapnum].handle == handle, "Invalid bitmap handle %d passed to bm_get_signature().\nThis might be due to an invalid animation somewhere else.\n", handle ); // INVALID BITMAP HANDLE!
Assert( bm_bitmaps[bitmapnum].handle == handle ); // INVALID BITMAP HANDLE
return bm_bitmaps[bitmapnum].signature;
}
@@ -1100,7 +1100,7 @@ ubyte bm_get_type(int handle)
if ( !bm_inited ) bm_init();
int bitmapnum = handle % MAX_BITMAPS;
Assertion( bm_bitmaps[bitmapnum].handle == handle, "Invalid bitmap handle %d passed to bm_get_type().\nThis might be due to an invalid animation somewhere else.\n", handle ); // INVALID BITMAP HANDLE!
Assert( bm_bitmaps[bitmapnum].handle == handle ); // INVALID BITMAP HANDLE
return bm_bitmaps[bitmapnum].type;
}
@@ -1597,7 +1597,13 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
int bitmapnum = handle % MAX_BITMAPS;
Assertion( bm_bitmaps[bitmapnum].handle == handle, "Invalid handle %d passed to bm_lock. This might be due to an animation elsewhere in the code being too short.\n", handle ); // INVALID BITMAP HANDLE
#ifndef NDEBUG
if(bm_bitmaps[bitmapnum].handle != handle) {
mprintf(("bm_lock - %s: bm_bitmaps[%d].handle = %d, handle = %d\n", bm_bitmaps[bitmapnum].filename, bitmapnum, bm_bitmaps[bitmapnum].handle, handle));
}
#endif
Assert( bm_bitmaps[bitmapnum].handle == handle ); // INVALID BITMAP HANDLE
// flags &= (~BMP_RLE);
+49 -7
View File
@@ -147,14 +147,9 @@ int cfile_in_root_dir(char *exe_path)
token_count++;
tok = strtok(NULL, DIR_SEPARATOR_STR);
} while(tok != NULL);
#ifdef SCP_UNIX
// /freespace works, / does not
if(token_count <= 1) {
#else
// C:/freespace works, C:/ does not
// root directory if we have <= 1 slash
if(token_count <= 2){
#endif
return 1;
}
@@ -818,6 +813,53 @@ CFILE *cfopen_special(char *file_path, char *mode, const int size, const int off
// it's a normal file
return cf_open_fill_cfblock(fp, dir_type);
}
/* char longname[_MAX_PATH];
if ( !cfile_inited ) {
Int3();
return NULL;
}
//================================================
// Check that all the parameters make sense
Assert( file_path && strlen(file_path) );
Assert( mode != NULL );
if ( (ext_num <= 0) || (!ext_list) ) {
Int3();
return NULL;
}
// cfopen_ext() only supports reading files, not creating them
if ( strchr(mode, 'w') ) {
Int3();
return NULL;
}
//================================================
// Search for file on disk, on cdrom, or in a packfile
int offset, size;
char copy_file_path[MAX_PATH_LEN]; // FIX change in memory from cf_find_file_location
strcpy_s(copy_file_path, file_path);
if ( cf_find_file_location_ext(copy_file_path, ext_num, ext_list, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize) ) {
// Fount it, now create a cfile out of it
FILE *fp = fopen( longname, "rb" );
if ( fp ) {
if ( offset ) {
// Found it in a pack file
return cf_open_packed_cfblock(fp, dir_type, offset, size );
} else {
// Found it in a normal file
return cf_open_fill_cfblock(fp, dir_type);
}
}
}
return NULL;*/
}
+16 -4
View File
@@ -136,6 +136,8 @@ 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", },
{ "-tbp", "Toggle features for The Babylon Project", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-tbp", }, // TBP warp effects -Et1
{ "-wcsaga", "Toggle features for Wing Commander Saga", true, 0, EASY_DEFAULT, "Gameplay", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-wcsaga", },
{ "-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 sound and music", false, 0, EASY_DEFAULT, "Audio", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-nosound", },
@@ -173,7 +175,7 @@ Flag exe_params[] =
{ "-pos", "Show position of camera", false, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-pos", },
{ "-window", "Run in window", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-window", },
{ "-fullscreen_window", "Run in fullscreen window", false, 0, EASY_DEFAULT, "Dev Tool", "", },
{ "-timerbar", "", true, 0, EASY_DEFAULT, "Dev Tool", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-timerbar", },
{ "-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", },
@@ -333,8 +335,10 @@ int Cmdline_voice_recognition = 0;
// MOD related
cmdline_parm mod_arg("-mod", NULL, true); // Cmdline_mod -- DTP modsupport
cmdline_parm tbp("-tbp", NULL); // Cmdline_tbp -- TBP warp effects -Et1
char *Cmdline_mod = NULL; //DTP for mod arguement
int Cmdline_tbp = 0;
// Multiplayer/Network related
cmdline_parm almission_arg("-almission", NULL); // Cmdline_almission -- DTP for autoload Multi mission
@@ -916,9 +920,7 @@ bool SetCmdlineParams()
}
if (timerbar_arg.found()) {
#ifdef WIN32
MessageBox(NULL, "the timerbar has been disabled in builds after August 31, 2010. Please remove the \"-timerbar\" command line from the launcher to prevent this message from appearing the the future.", "", MB_OK | MB_ICONINFORMATION);
#endif
Cmdline_timerbar = 1;
}
if ( missioncrcspew_arg.found() ) {
@@ -1180,6 +1182,16 @@ bool SetCmdlineParams()
Cmdline_orb_radar = 1;
}
// TBP warp effects -Et1
// Chief1983 - Add 3d shockwave, ship choice 3d and weapon choice 3d if TBP is checked
if( tbp.found() )
{
Cmdline_tbp = 1;
Cmdline_enable_3d_shockwave = 1;
Cmdline_ship_choice_3d = 1;
Cmdline_weapon_choice_3d = 1;
}
if ( use_3dwarp.found() ) {
Cmdline_3dwarp = 1;
}
+2
View File
@@ -104,6 +104,8 @@ extern int Cmdline_voice_recognition;
// MOD related
extern char *Cmdline_mod; // DTP for mod support
extern int Cmdline_tbp;
// Multiplayer/Network related
extern char *Cmdline_almission; // DTP for autoload mission (for multi only)
extern int Cmdline_ingamejoin;
+1 -3
View File
@@ -922,9 +922,7 @@ int fireball_create( vec3d * pos, int fireball_type, int render_type, int parent
}
if ( fb->fireball_render_type == FIREBALL_WARP_EFFECT ) {
Assert( warp_lifetime >= 4.0f ); // Warp lifetime must be at least 4 seconds!
if ( warp_lifetime < 4.0f )
warp_lifetime = 4.0f;
Assert( warp_lifetime > 4.0f ); // Warp lifetime must be at least 4 seconds!
fb->total_time = warp_lifetime; // in seconds
} else {
fb->total_time = i2fl(fl->num_frames) / fl->fps; // in seconds
+2 -37
View File
@@ -28,8 +28,6 @@
#include "debugconsole/dbugfile.h"
#include "globalincs/mspdb_callstack.h"
#include "AFXADV.H"
#ifdef NDEBUG
#ifndef FRED
#error macro FRED is not defined when trying to build release Fred. Please define FRED macro in build settings in all Fred projects
@@ -82,12 +80,12 @@ window_data Mission_notes_wnd_data;
BEGIN_MESSAGE_MAP(CFREDApp, CWinApp)
//{{AFX_MSG_MAP(CFREDApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
ON_COMMAND(ID_FILE_OPEN, OnFileOpen)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
@@ -238,23 +236,9 @@ BOOL CFREDApp::InitInstance()
*str_end = '\0';
// Goober5000 - figure out where the FRED file dialog should go
if ((m_pRecentFileList != NULL) && (m_pRecentFileList->GetSize() > 0))
{
// use the most recently opened file to supply the default folder
m_sInitialDir = m_pRecentFileList->operator[](0); // lol syntax
}
else
{
// use FRED's own directory to search for missions
m_sInitialDir = Fred_base_dir;
m_sInitialDir += "\\data\\missions";
}
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
ParseCommandLine(cmdInfo);
m_nCmdShow = Main_wnd_data.p.showCmd;
@@ -325,25 +309,6 @@ void CFREDApp::OnAppAbout()
aboutDlg.DoModal();
}
// G5K - from http://www.experts-exchange.com/Programming/System/Windows__Programming/MFC/Q_20155824.html
void CFREDApp::OnFileOpen()
{
// use the initial dir the first time we prompt for a file
// name. after a successful open, the file name will be
// changed to be the empty string and the default dir
// will be supplied by the CFileDialog internal memory
if(!DoPromptFileName(m_sInitialDir, AFX_IDS_OPENFILE, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST, TRUE, NULL))
{
// open cancelled
return;
}
AfxGetApp()->OpenDocumentFile(m_sInitialDir);
// if returns NULL, the user has already been alerted
// now erase the initial dir since we only want to use it once
m_sInitialDir.Empty();
}
/////////////////////////////////////////////////////////////////////////////
// CFREDApp commands
-2
View File
@@ -52,7 +52,6 @@ typedef struct window_data {
class CFREDApp : public CWinApp
{
int app_init;
CString m_sInitialDir;
public:
void record_window_data(window_data *wndd, CWnd *wnd);
@@ -76,7 +75,6 @@ public:
//{{AFX_MSG(CFREDApp)
afx_msg void OnAppAbout();
afx_msg void OnFileOpen();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
+5 -9
View File
@@ -2457,18 +2457,17 @@ BEGIN
WS_TABSTOP
LTEXT "Example",IDC_LBL_EXAMPLE,17,158,31,10
EDITTEXT IDC_EXAMPLE,49,156,77,12,ES_AUTOHSCROLL | ES_READONLY
CONTROL "Include sender name in filename",IDC_INCLUDE_SENDER,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,175,112,10
CONTROL "Don't replace existing file names",IDC_NO_REPLACE,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,186,112,10
PUSHBUTTON "Generate File Names",IDC_GENERATE_FILE_NAMES,12,198,120,14
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,14,175,112,10
PUSHBUTTON "Generate File Names",IDC_GENERATE_FILE_NAMES,12,190,120,
14
GROUPBOX "Script Options",IDC_SCRIPT_OPTIONS,143,7,257,204
GROUPBOX "Script Entry Format",IDC_ENTRY,149,17,246,76
EDITTEXT IDC_ENTRY_FORMAT,154,28,109,56,ES_MULTILINE |
ES_AUTOHSCROLL | ES_WANTRETURN
LTEXT "$filename - name of the message file\r\n$message - text of the message\r\n$persona - persona of the sender\r\n$sender - name of the sender\r\n\r\nNote that $persona and $sender will only appear for the Message section.",
IDC_STATIC,270,28,120,58
GROUPBOX "Export",IDC_EXPORT,149,98,119,83
GROUPBOX "Export",IDC_EXPORT,149,98,119,64
CONTROL "Everything",IDC_EXPORT_EVERYTHING,"Button",
BS_AUTORADIOBUTTON,153,108,99,9
CONTROL "Just Command Briefings",IDC_EXPORT_COMMAND_BRIEFINGS,
@@ -2480,9 +2479,6 @@ BEGIN
CONTROL "Just Messages",IDC_EXPORT_MESSAGES,"Button",
BS_AUTORADIOBUTTON,153,148,99,9
PUSHBUTTON "Generate Script",IDC_GENERATE_SCRIPT,149,190,120,14
CONTROL "Group send-message-list messages before others",
IDC_GROUP_MESSAGES,"Button",BS_AUTOCHECKBOX | BS_TOP |
BS_MULTILINE | WS_TABSTOP,166,159,100,19
END
IDD_BRIEFING_PERSONAS DIALOG DISCARDABLE 0, 0, 320, 201
@@ -2563,7 +2559,7 @@ END
IDD_SOUND_ENVIRONMENT DIALOGEX 0, 0, 315, 89
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Sound Environment"
FONT 8, "MS Sans Serif", 0, 0, 0x1
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_SOUND_ENVIRONMENT,75,9,117,30,CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP
+1
View File
@@ -188,6 +188,7 @@ int Framerate_delay;
void game_start_time(){}
void game_stop_time(){}
int game_get_default_skill_level(){return 0;}
void game_load_palette(){}
float FreeSpace_gamma;
int set_cdrom_path(int){return 0;}
int find_freespace_cd(char*){return 0;}
+1 -3
View File
@@ -1139,8 +1139,6 @@
#define IDC_SOUND_ENVIRONMENT_DECAY 1625
#define IDC_SOUND_ENVIRONMENT_BUTTON 1626
#define IDC_SOUND_ENVIRONMENT_TEST 1627
#define IDC_GROUP_MESSAGES 1628
#define IDC_INCLUDE_SENDER 1629
#define ID_FILE_MISSIONNOTES 32771
#define ID_DUPLICATE 32774
#define ID_VIEW_ROTATE 32775
@@ -1434,7 +1432,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_COMMAND_VALUE 33098
#define _APS_NEXT_CONTROL_VALUE 1629
#define _APS_NEXT_CONTROL_VALUE 1628
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
+1 -49
View File
@@ -2576,11 +2576,6 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
case OPF_FONT:
str = Fonts[0].filename;
break;
case OPF_AUDIO_VOLUME_OPTION:
str = "Music";
break;
default:
str = "<new default required!>";
@@ -2665,9 +2660,6 @@ int sexp_tree::query_default_argument_available(int op, int i)
case OPF_HUD_ELEMENT:
case OPF_SOUND_ENVIRONMENT:
case OPF_SOUND_ENVIRONMENT_OPTION:
case OPF_EXPLOSION_OPTION:
case OPF_AUDIO_VOLUME_OPTION:
case OPF_WEAPON_BANK_NUMBER:
return 1;
case OPF_SHIP:
@@ -4377,18 +4369,6 @@ sexp_list_item *sexp_tree::get_listing_opf(int opf, int parent_node, int arg_ind
list = get_listing_opf_sound_environment_option();
break;
case OPF_AUDIO_VOLUME_OPTION:
list = get_listing_opf_adjust_audio_volume();
break;
case OPF_EXPLOSION_OPTION:
list = get_listing_opf_explosion_option();
break;
case OPF_WEAPON_BANK_NUMBER:
list = get_listing_opf_weapon_banks();
break;
default:
Int3(); // unknown OPF code
list = NULL;
@@ -5254,26 +5234,6 @@ sexp_list_item *sexp_tree::get_listing_opf_sound_environment_option()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_adjust_audio_volume()
{
sexp_list_item head;
for (int i = 0; i < Num_adjust_audio_options; i++)
head.add_data(Adjust_audio_options[i]);
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_explosion_option()
{
sexp_list_item head;
for (int i = 0; i < Num_explosion_options; i++)
head.add_data(Explosion_option[i]);
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_waypoint_path()
{
int i;
@@ -5504,7 +5464,7 @@ sexp_list_item *sexp_tree::get_listing_opf_string()
{
sexp_list_item head;
head.add_data(SEXP_ANY_STRING);
head.add_data("<any string>");
return head.next;
}
@@ -5771,14 +5731,6 @@ sexp_list_item *sexp_tree::get_listing_opf_hud_elements()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_weapon_banks()
{
sexp_list_item head;
head.add_data(SEXP_ALL_BANKS_STRING);
return head.next;
}
// Deletes sexp_variable from sexp_tree.
// resets tree to not include given variable, and resets text and type
void sexp_tree::delete_sexp_tree_variable(const char *var_name)
-3
View File
@@ -260,9 +260,6 @@ public:
sexp_list_item *get_listing_opf_hud_elements();
sexp_list_item *get_listing_opf_sound_environment();
sexp_list_item *get_listing_opf_sound_environment_option();
sexp_list_item *get_listing_opf_explosion_option();
sexp_list_item *get_listing_opf_adjust_audio_volume();
sexp_list_item *get_listing_opf_weapon_banks();
int m_mode;
int item_index;
+55 -317
View File
@@ -2,18 +2,14 @@
//
#include "stdafx.h"
#include <string.h>
#include "fred.h"
#include "fred2/freddoc.h"
#include "VoiceActingManager.h"
#include "missionui/missioncmdbrief.h"
#include "mission/missionbriefcommon.h"
#include "mission/missionmessage.h"
#include "mission/missiongoals.h"
#include "hud/hudtarget.h"
#include "parse/sexp.h"
#include "iff_defs/iff_defs.h"
#include "mission/missiongoals.h"
#include <math.h>
#ifdef _DEBUG
@@ -22,8 +18,6 @@
static char THIS_FILE[] = __FILE__;
#endif
#define INVALID_MESSAGE ((MMessage*)0xFFFFFFFF)
// to keep track of data
char Voice_abbrev_briefing[NAME_LENGTH];
char Voice_abbrev_campaign[NAME_LENGTH];
@@ -34,7 +28,6 @@ char Voice_abbrev_mission[NAME_LENGTH];
bool Voice_no_replace_filenames;
char Voice_script_entry_format[NOTES_LENGTH];
int Voice_export_selection;
bool Voice_group_messages;
/////////////////////////////////////////////////////////////////////////////
@@ -51,7 +44,6 @@ VoiceActingManager::VoiceActingManager(CWnd* pParent /*=NULL*/)
m_abbrev_debriefing = _T("");
m_abbrev_message = _T("");
m_abbrev_mission = _T("");
m_use_sender_in_filename = FALSE;
m_example = _T("");
m_no_replace = FALSE;
m_script_entry_format = _T("");
@@ -60,7 +52,6 @@ VoiceActingManager::VoiceActingManager(CWnd* pParent /*=NULL*/)
m_export_briefings = FALSE;
m_export_debriefings = FALSE;
m_export_messages = FALSE;
m_group_messages = FALSE;
//}}AFX_DATA_INIT
}
@@ -77,14 +68,12 @@ void VoiceActingManager::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_ABBREV_MISSION, m_abbrev_mission);
DDX_Text(pDX, IDC_EXAMPLE, m_example);
DDX_Check(pDX, IDC_NO_REPLACE, m_no_replace);
DDX_Check(pDX, IDC_INCLUDE_SENDER, m_use_sender_in_filename);
DDX_Text(pDX, IDC_ENTRY_FORMAT, m_script_entry_format);
DDX_Check(pDX, IDC_EXPORT_EVERYTHING, m_export_everything);
DDX_Check(pDX, IDC_EXPORT_COMMAND_BRIEFINGS, m_export_command_briefings);
DDX_Check(pDX, IDC_EXPORT_BRIEFINGS, m_export_briefings);
DDX_Check(pDX, IDC_EXPORT_DEBRIEFINGS, m_export_debriefings);
DDX_Check(pDX, IDC_EXPORT_MESSAGES, m_export_messages);
DDX_Check(pDX, IDC_GROUP_MESSAGES, m_group_messages);
//}}AFX_DATA_MAP
}
@@ -109,12 +98,6 @@ BEGIN_MESSAGE_MAP(VoiceActingManager, CDialog)
ON_BN_CLICKED(IDC_NO_REPLACE, OnChangeNoReplace)
ON_BN_CLICKED(IDC_GENERATE_FILE_NAMES, OnGenerateFileNames)
ON_BN_CLICKED(IDC_GENERATE_SCRIPT, OnGenerateScript)
ON_BN_CLICKED(IDC_EXPORT_EVERYTHING, OnExportEverything)
ON_BN_CLICKED(IDC_EXPORT_COMMAND_BRIEFINGS, OnExportCommandBriefings)
ON_BN_CLICKED(IDC_EXPORT_BRIEFINGS, OnExportBriefings)
ON_BN_CLICKED(IDC_EXPORT_DEBRIEFINGS, OnExportDebriefings)
ON_BN_CLICKED(IDC_EXPORT_MESSAGES, OnExportMessages)
ON_BN_CLICKED(IDC_INCLUDE_SENDER, OnBnClickedIncludeSender)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -150,10 +133,6 @@ BOOL VoiceActingManager::OnInitDialog()
m_export_messages = TRUE;
else
m_export_everything = TRUE;
m_group_messages = Voice_group_messages;
CButton *button = ((CButton *) GetDlgItem(IDC_GROUP_MESSAGES));
button->EnableWindow(m_export_everything || m_export_messages);
UpdateData(FALSE);
@@ -171,7 +150,7 @@ void VoiceActingManager::OnClose()
strcpy_s(Voice_abbrev_debriefing, m_abbrev_debriefing);
strcpy_s(Voice_abbrev_message, m_abbrev_message);
strcpy_s(Voice_abbrev_mission, m_abbrev_mission);
Voice_no_replace_filenames = (m_no_replace == TRUE) ? true : false;
Voice_no_replace_filenames = m_no_replace == TRUE ? true : false;
// save data for script
strcpy_s(Voice_script_entry_format, m_script_entry_format);
@@ -185,7 +164,6 @@ void VoiceActingManager::OnClose()
Voice_export_selection = 4;
else
Voice_export_selection = 0;
Voice_group_messages = (m_group_messages == TRUE) ? true : false;
CDialog::OnClose();
}
@@ -235,10 +213,10 @@ void VoiceActingManager::build_example(CString section)
return;
}
m_example = generate_filename(section, 1, 2, INVALID_MESSAGE);
m_example = generate_filename(section, 1, 2);
}
CString VoiceActingManager::generate_filename(CString section, int number, int digits, MMessage *message)
CString VoiceActingManager::generate_filename(CString section, int number, int digits)
{
if (section == "")
return "none.wav";
@@ -263,52 +241,9 @@ CString VoiceActingManager::generate_filename(CString section, int number, int d
}
str = str + num;
const CString suffix = get_suffix();
// append sender name if supposed to and I have been passed a message
// to get the sender from
if ( message != NULL && m_use_sender_in_filename ) {
size_t allow_to_copy = NAME_LENGTH - suffix.GetLength() - str.GetLength();
char sender[NAME_LENGTH];
if ( message == INVALID_MESSAGE ) {
strcpy_s(sender, "Alpha 1");
} else {
get_valid_sender(sender, sizeof(sender), message);
}
// truncate sender to that we don't overflow filename
sender[allow_to_copy] = '\0';
size_t j;
for( j = 0; sender[j] != '\0'; j++ ) {
// lower case letter
sender[j] = (char)tolower(sender[j]);
// replace any non alpha numeric with a underscore
if ( !isalnum( sender[j] ) )
sender[j] = '_';
}
// flatten muliple underscores
j = 1;
while( sender[j] != '\0' ) {
if ( sender[j-1] == '_' && sender[j] == '_' ) {
size_t k;
for (k = j + 1; sender[k] != '\0'; k++ )
sender[k - 1] = sender[k];
sender[k - 1] = '\0';
} else {
// only increment on rounds when I am not moving the string down
j++;
}
}
str = str + sender;
}
// suffix
str = str + get_suffix();
Assert( str.GetLength() < NAME_LENGTH );
return str;
}
@@ -316,7 +251,6 @@ void VoiceActingManager::OnGenerateFileNames()
{
int i;
int digits;
size_t modified_filenames = 0;
// stuff data to variables
UpdateData(TRUE);
@@ -328,10 +262,9 @@ void VoiceActingManager::OnGenerateFileNames()
char *filename = Cmd_briefs[0].stage[i].wave_filename;
// generate only if we're replacing or if it has a replaceable name
if (!m_no_replace || !strlen(filename) || message_filename_is_generic(filename))
if (!m_no_replace || !strlen(filename) || !strnicmp(filename, "none.wav", 4) || message_filename_is_generic(filename))
{
strcpy(filename, LPCTSTR(generate_filename(m_abbrev_command_briefing, i + 1, digits)));
modified_filenames++;
}
}
@@ -342,10 +275,9 @@ void VoiceActingManager::OnGenerateFileNames()
char *filename = Briefings[0].stages[i].voice;
// generate only if we're replacing or if it has a replaceable name
if (!m_no_replace || !strlen(filename) || message_filename_is_generic(filename))
if (!m_no_replace || !strlen(filename) || !strnicmp(filename, "none.wav", 4) || message_filename_is_generic(filename))
{
strcpy(filename, LPCTSTR(generate_filename(m_abbrev_briefing, i + 1, digits)));
modified_filenames++;
}
}
@@ -356,10 +288,9 @@ void VoiceActingManager::OnGenerateFileNames()
char *filename = Debriefings[0].stages[i].voice;
// generate only if we're replacing or if it has a replaceable name
if (!m_no_replace || !strlen(filename) || message_filename_is_generic(filename))
if (!m_no_replace || !strlen(filename) || !strnicmp(filename, "none.wav", 4) || message_filename_is_generic(filename))
{
strcpy(filename, LPCTSTR(generate_filename(m_abbrev_debriefing, i + 1, digits)));
modified_filenames++;
}
}
@@ -368,30 +299,21 @@ void VoiceActingManager::OnGenerateFileNames()
for (i = 0; i < Num_messages - Num_builtin_messages; i++)
{
char *filename = Messages[i + Num_builtin_messages].wave_info.name;
MMessage *message = &Messages[i + Num_builtin_messages];
// generate only if we're replacing or if it has a replaceable name
if (!m_no_replace || !strlen(filename) || !strlen(filename) || message_filename_is_generic(filename))
if (!m_no_replace || !filename || !strlen(filename) || !strnicmp(filename, "none.wav", 4) || message_filename_is_generic(filename))
{
// free existing filename
if (filename != NULL)
free(filename);
// allocate new filename
Messages[i + Num_builtin_messages].wave_info.name = strdup(LPCTSTR(generate_filename(m_abbrev_message, i + 1, digits, message)));
modified_filenames++;
Messages[i + Num_builtin_messages].wave_info.name = strdup(LPCTSTR(generate_filename(m_abbrev_message, i + 1, digits)));
}
}
if ( modified_filenames > 0 ) {
// Tell FRED that we actually modified something
set_modified(TRUE);
}
// 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 %d messages.", modified_filenames);
MessageBox(message, "Woohoo!");
// notify
MessageBox("File name generation complete.", "Woohoo!");
}
void VoiceActingManager::OnGenerateScript()
@@ -480,27 +402,56 @@ void VoiceActingManager::OnGenerateScript()
{
fout("\n\nMessages\n--------\n\n");
if (m_group_messages)
for (i = 0; i < Num_messages - Num_builtin_messages; i++)
{
SCP_vector<int> message_indexes;
for (i = 0; i < Num_messages - Num_builtin_messages; i++)
message_indexes.push_back(i + Num_builtin_messages);
CString entry = m_script_entry_format;
entry.Replace("\r\n", "\n");
group_message_indexes(message_indexes);
MMessage *message = &Messages[i + Num_builtin_messages];
for (i = 0; i < message_indexes.size(); i++)
// replace file name
entry.Replace("$filename", message->wave_info.name);
// determine and replace persona
entry.Replace("$message", message->message);
if (message->persona_index >= 0)
entry.Replace("$persona", Personas[message->persona_index].name);
else
entry.Replace("$persona", "<none>");
// determine sender
char sender[NAME_LENGTH+1];
strcpy_s(sender, get_message_sender(message->name));
int shipnum = ship_name_lookup(sender);
if (shipnum >= 0)
{
MMessage *message = &Messages[message_indexes[i]];
export_one_message(message);
}
}
else
{
for (i = 0; i < Num_messages - Num_builtin_messages; i++)
{
MMessage *message = &Messages[i + Num_builtin_messages];
export_one_message(message);
ship *shipp = &Ships[shipnum];
// we may have to use the callsign
if (*Fred_callsigns[shipnum])
{
hud_stuff_ship_callsign(sender, shipp);
}
// account for hidden ship names
else if ( ((Iff_info[shipp->team].flags & IFFF_WING_NAME_HIDDEN) && (shipp->wingnum != -1)) || (shipp->flags2 & SF2_HIDE_SHIP_NAME) )
{
hud_stuff_ship_class(sender, shipp);
}
// use the regular sender text
else
{
end_string_at_first_hash_symbol(sender);
}
}
// replace sender (but print #Command as Command)
if (*sender == '#')
entry.Replace("$sender", &sender[1]);
else
entry.Replace("$sender", sender);
fout("%s\n\n\n", (char *) (LPCTSTR) entry);
}
}
@@ -510,76 +461,6 @@ void VoiceActingManager::OnGenerateScript()
MessageBox("Script generation complete.", "Woohoo!");
}
void VoiceActingManager::export_one_message(MMessage *message)
{
CString entry = m_script_entry_format;
entry.Replace("\r\n", "\n");
// replace file name
entry.Replace("$filename", message->wave_info.name);
// determine and replace persona
entry.Replace("$message", message->message);
if (message->persona_index >= 0)
entry.Replace("$persona", Personas[message->persona_index].name);
else
entry.Replace("$persona", "<none>");
// determine sender
char sender[NAME_LENGTH+1];
get_valid_sender(sender, sizeof(sender), message);
// replace sender (but print #Command as Command)
if (*sender == '#')
entry.Replace("$sender", &sender[1]);
else
entry.Replace("$sender", sender);
fout("%s\n\n\n", (char *) (LPCTSTR) entry);
}
/** Passed sender string will have either have the senders name
or '<none>'*/
void VoiceActingManager::get_valid_sender(char *sender, size_t sender_size, MMessage *message) {
Assert( sender != NULL );
Assert( message != NULL );
strncpy(sender, get_message_sender(message->name), sender_size);
// strip hash if present
if ( sender[0] == '#' ) {
size_t i = 1;
for(; sender[i] != '\0'; i++ ) {
sender[i-1] = sender[i];
}
sender[i-1] = '\0';
}
int shipnum = ship_name_lookup(sender, 1); // The player's ship is valid for this search.
if (shipnum >= 0)
{
ship *shipp = &Ships[shipnum];
// we may have to use the callsign
if (*Fred_callsigns[shipnum])
{
hud_stuff_ship_callsign(sender, shipp);
}
// account for hidden ship names
else if ( ((Iff_info[shipp->team].flags & IFFF_WING_NAME_HIDDEN) && (shipp->wingnum != -1)) || (shipp->flags2 & SF2_HIDE_SHIP_NAME) )
{
hud_stuff_ship_class(sender, shipp);
}
// use the regular sender text
else
{
end_string_at_first_hash_symbol(sender);
}
}
}
void VoiceActingManager::OnSetfocusAbbrevBriefing()
{
UpdateData(TRUE);
@@ -786,146 +667,3 @@ char *VoiceActingManager::get_message_sender(char *message)
return "<none>";
}
void VoiceActingManager::group_message_indexes(SCP_vector<int> &message_indexes)
{
int i;
#ifndef NDEBUG
int initial_size = message_indexes.size();
#endif
SCP_vector<int> temp_message_indexes = message_indexes;
message_indexes.clear();
// add all messages found in send-message-list or send-random-message node trees
for (i = 0; i < Num_mission_events; i++)
{
mission_event *event = &Mission_events[i];
group_message_indexes_in_tree(event->formula, temp_message_indexes, message_indexes);
}
// add remaining messages
for (i = 0; i < temp_message_indexes.size(); i++)
message_indexes.push_back(temp_message_indexes[i]);
#ifndef NDEBUG
if (initial_size > message_indexes.size())
{
Warning(LOCATION, "Initial size is greater than size after sorting!");
}
else if (initial_size < message_indexes.size())
{
Warning(LOCATION, "Initial size is less than size after sorting!");
}
#endif
}
void VoiceActingManager::group_message_indexes_in_tree(int node, SCP_vector<int> &source_list, SCP_vector<int> &destination_list)
{
int i, op, n;
if (node < 0)
return;
if (Sexp_nodes[node].type == SEXP_NOT_USED)
return;
// stuff
op = get_operator_const(Sexp_nodes[node].text);
n = CDR(node);
if (op == OP_SEND_MESSAGE_LIST)
{
// check the argument list
while (n != -1)
{
// the third argument is a message
char *message_name = Sexp_nodes[CDDR(n)].text;
// check source messages
for (i = 0; i < source_list.size(); i++)
{
if (!strcmp(message_name, Messages[source_list[i]].name))
{
// move it from source to destination
destination_list.push_back(source_list[i]);
source_list.erase(source_list.begin() + i);
break;
}
}
// iterate along the list
n = CDDDDR(n);
}
}
else if (op == OP_SEND_RANDOM_MESSAGE)
{
// check the argument list
n = CDDR(n);
while (n != -1)
{
// each argument from this point on is a message
char *message_name = Sexp_nodes[n].text;
// check source messages
for (i = 0; i < source_list.size(); i++)
{
if (!strcmp(message_name, Messages[source_list[i]].name))
{
// move it from source to destination
destination_list.push_back(source_list[i]);
source_list.erase(source_list.begin() + i);
break;
}
}
// iterate along the list
n = CDR(n);
}
}
// iterate on first element
group_message_indexes_in_tree(CAR(node), source_list, destination_list);
// iterate on rest of elements
group_message_indexes_in_tree(CDR(node), source_list, destination_list);
}
void VoiceActingManager::OnExportEverything()
{
CButton *button = ((CButton *) GetDlgItem(IDC_GROUP_MESSAGES));
button->EnableWindow(TRUE);
}
void VoiceActingManager::OnExportCommandBriefings()
{
CButton *button = ((CButton *) GetDlgItem(IDC_GROUP_MESSAGES));
button->EnableWindow(FALSE);
}
void VoiceActingManager::OnExportBriefings()
{
CButton *button = ((CButton *) GetDlgItem(IDC_GROUP_MESSAGES));
button->EnableWindow(FALSE);
}
void VoiceActingManager::OnExportDebriefings()
{
CButton *button = ((CButton *) GetDlgItem(IDC_GROUP_MESSAGES));
button->EnableWindow(FALSE);
}
void VoiceActingManager::OnExportMessages()
{
CButton *button = ((CButton *) GetDlgItem(IDC_GROUP_MESSAGES));
button->EnableWindow(TRUE);
}
void VoiceActingManager::OnBnClickedIncludeSender()
{
UpdateData(TRUE);
build_example();
UpdateData(FALSE);
}
+1 -15
View File
@@ -7,8 +7,6 @@
// VoiceActingManager.h : header file
//
#include "mission/missionmessage.h"
/////////////////////////////////////////////////////////////////////////////
// VoiceActingManager dialog
@@ -27,7 +25,6 @@ public:
CString m_abbrev_debriefing;
CString m_abbrev_message;
CString m_abbrev_mission;
BOOL m_use_sender_in_filename;
CString m_example;
BOOL m_no_replace;
CString m_script_entry_format;
@@ -36,7 +33,6 @@ public:
BOOL m_export_briefings;
BOOL m_export_debriefings;
BOOL m_export_messages;
BOOL m_group_messages;
//}}AFX_DATA
@@ -54,12 +50,8 @@ protected:
int calc_digits(int size);
void build_example();
void build_example(CString section);
CString generate_filename(CString section, int number, int digits, MMessage *message=NULL);
CString generate_filename(CString section, int number, int digits);
char *get_message_sender(char *message);
void export_one_message(MMessage *message);
void get_valid_sender(char *sender, size_t sender_size, MMessage *message);
void group_message_indexes(SCP_vector<int> &message_indexes);
void group_message_indexes_in_tree(int node, SCP_vector<int> &source_list, SCP_vector<int> &destination_list);
CFILE *fp;
int fout(char *format, ...);
@@ -85,12 +77,6 @@ protected:
afx_msg void OnChangeNoReplace();
afx_msg void OnGenerateFileNames();
afx_msg void OnGenerateScript();
afx_msg void OnExportEverything();
afx_msg void OnExportCommandBriefings();
afx_msg void OnExportBriefings();
afx_msg void OnExportDebriefings();
afx_msg void OnExportMessages();
afx_msg void OnBnClickedIncludeSender();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
+39 -5
View File
@@ -1132,7 +1132,8 @@ void game_level_init(int seed)
supernova_level_init();
cam_init();
subtitles_init();
snd_aav_init();
// multiplayer dogfight hack
dogfight_blown = 0;
@@ -1192,6 +1193,32 @@ void game_do_networking()
}
}
// Loads the best palette for this level, based
// on nebula color and hud color. You could just call palette_load_table with
// the appropriate filename, but who wants to do that.
void game_load_palette()
{
char palette_filename[1024];
// We only use 3 hud colors right now
// Assert( HUD_config.color >= 0 );
// Assert( HUD_config.color <= 2 );
Assert( Mission_palette >= 0 );
Assert( Mission_palette <= 98 );
// if ( The_mission.flags & MISSION_FLAG_SUBSPACE ) {
strcpy_s( palette_filename, NOX("gamepalette-subspace") );
// } else {
// sprintf( palette_filename, NOX("gamepalette%d-%02d"), HUD_config.color+1, Mission_palette+1 );
// }
mprintf(( "Loading palette %s\n", palette_filename ));
// palette_load_table(palette_filename);
}
// An estimate as to how high the count passed to game_loading_callback will go.
// This is just a guess, it seems to always be about the same. The count is
// proportional to the code being executed, not the time, so this works good
@@ -1238,7 +1265,7 @@ void game_loading_callback(int count)
game_do_networking();
Assert( Game_loading_callback_inited==1 );
Assertion( Game_loading_ani.num_frames > 0, "Load Screen animation %s not found, or corrupted. Needs to be an animation with at least 1 frame.", Game_loading_ani.filename );
Assert( Game_loading_ani.num_frames > 0 );
int do_flip = 0;
@@ -1355,7 +1382,7 @@ void game_loading_callback_init()
strcpy(Game_loading_ani.filename, Game_loading_ani_fname[gr_screen.res]);
generic_anim_init(&Game_loading_ani, Game_loading_ani.filename);
generic_anim_load(&Game_loading_ani);
Assertion( Game_loading_ani.num_frames > 0, "Load Screen animation %s not found, or corrupted. Needs to be an animation with at least 1 frame.", Game_loading_ani.filename );
Assert( Game_loading_ani.num_frames > 0 );
Game_loading_callback_inited = 1;
Mouse_hidden = 1;
@@ -1590,6 +1617,14 @@ int game_start_mission()
extern void stop_parse();
stop_parse();
//WMC - *sigh* more mprintf clutter. It was commented out when I got here
/*
// the standalone server in multiplayer doesn't do any rendering, so we will not even bother loading the palette
if ( !(Game_mode & GM_STANDALONE_SERVER) ) {
mprintf(( "=================== LOADING GAME PALETTE ================\n" ));
// game_load_palette();
}*/
game_busy( NOX("** starting game_post_level_init() **") );
load_post_level_init = (uint) time(NULL);
game_post_level_init();
@@ -4987,7 +5022,7 @@ void game_set_frametime(int state)
}
#endif
Assertion( Framerate_cap > 0, "Framerate cap %d is too low. Needs to be a positive, non-zero number", Framerate_cap );
Assert( Framerate_cap > 0 );
// Cap the framerate so it doesn't get too high.
if (!Cmdline_NoFPSCap)
@@ -6060,7 +6095,6 @@ void game_leave_state( int old_state, int new_state )
if ( (Game_mode & GM_MULTIPLAYER) && (new_state == GS_STATE_MAIN_MENU) ){
multi_quit_game(PROMPT_NONE);
}
snd_aav_init();
freespace_stop_mission();
}
+5
View File
@@ -192,6 +192,11 @@ void big_explosion_flash(float flash);
// flash effect to 0.
void game_flash_diminish();
// Loads the best palette for this level, based
// on nebula color and hud color. You could just call palette_load_table with
// the appropriate filename, but who wants to do that.
void game_load_palette();
//================================================================
// Call at the beginning of each frame
+37 -74
View File
@@ -66,8 +66,7 @@ static bool do_full_packet = true;
static int Local_timeout = -1;
static int Next_gameserver_update = -1;
static int Ping_timestamp = -1;
static int Last_activity = -1;
static int Last_pong = -1;
static int Login_retry_time = -1;
static SCP_vector<file_record> FS2NetD_file_list;
@@ -93,8 +92,7 @@ static void fs2netd_reset_state()
do_full_packet = true;
Local_timeout = -1;
Next_gameserver_update = -1;
Last_activity = -1;
Ping_timestamp = -1;
Last_pong = -1;
Duplicate_login_detected = false;
Login_retry_time = -1;
}
@@ -169,38 +167,19 @@ void fs2netd_reset_connection()
FS2NetD_Disconnect();
fs2netd_reset_state();
// wait a little to allow for the port to clear
Sleep(500);
Sleep(250);
fs2netd_reset_state();
// try to reinit the server connection
fs2netd_login();
Sleep(250);
if ( reset_gameserver && fs2netd_is_online() ) {
if (reset_gameserver) {
fs2netd_gameserver_start();
}
}
void fs2netd_disconnect()
{
if ( !Is_connected ) {
return;
}
if (Net_player->flags & NETINFO_FLAG_MT_CONNECTED) {
fs2netd_gameserver_disconnect();
}
FS2NetD_Disconnect();
fs2netd_reset_state();
Sleep(500);
}
static int fs2netd_connect_do()
{
int retval = FS2NetD_ConnectToServer(Multi_options_g.game_tracker_ip, Multi_options_g.tracker_port);
@@ -328,10 +307,6 @@ int fs2netd_login_do()
return 2;
}
if (do_full_packet) {
ml_printf("FS2NetD MSG: Requesting login pilot stats for '%s' ...", Players[Player_num].callsign);
}
int rescode = FS2NetD_GetPlayerData(Players[Player_num].callsign, &Players[Player_num], true, do_full_packet);
do_full_packet = false;
@@ -494,9 +469,6 @@ bool fs2netd_login()
if (retval) {
Logged_in = true;
sprintf(Multi_tracker_id_string, "%d", Multi_tracker_id);
} else {
// clear and reset connection, for the next time we try...
fs2netd_disconnect();
}
if (Is_standalone) {
@@ -508,13 +480,11 @@ bool fs2netd_login()
static void fs2netd_handle_ping()
{
static int CONN_check = -1;
// if we didn't get a pong within 30 seconds of a ping then assume that the
// server connection must of have dropped or is otherwise unresponsive
if ( (Ping_timestamp != -1) && ((timer_get_seconds() - Ping_timestamp) > 30) ) {
Ping_timestamp = -1;
static int Next_ping = -1;
bool reset = false;
// if we didn't get a PONG within 4 minutes the server connection must have dropped
if ( (Last_pong != -1) && ((Next_ping - Last_pong) > 240) ) {
ml_string("FS2NetD WARNING: Lost connection to server!");
fs2netd_reset_connection();
@@ -526,11 +496,11 @@ static void fs2netd_handle_ping()
}
ml_string("FS2NetD ERROR: Lost connection to the FS2NetD server!");
FS2NetD_Disconnect();
fs2netd_reset_state();
fs2netd_disconnect();
ml_string("FS2NetD MSG: Will attempt an automatic reconnect to server in 5 minutes...");
Login_retry_time = timer_get_seconds() + 300;
ml_string("FS2NetD MSG: Will attempt an automatic reconnect to server in 30 minutes...");
Login_retry_time = timer_get_seconds() + 1800;
return;
} else {
@@ -538,24 +508,24 @@ static void fs2netd_handle_ping()
}
}
// send out a ping after 5 minutes of no other activity to make sure the server
// is still responding (probably not though)
if ( (Ping_timestamp == -1) && (timer_get_seconds() >= (Last_activity + 300)) ) {
Ping_timestamp = timer_get_seconds();
FS2NetD_Ping();
ml_string("FS2NetD sent PING");
if (Last_activity < 0) {
Last_activity = timer_get_seconds();
// send out ping every 90 seconds
if ( (Next_ping == -1) || (timer_get_seconds() >= Next_ping) ) {
// if we have seen a long period of time between pings then reset the pong time too
if ( (timer_get_seconds() - Next_ping) > 120 ) {
reset = true;
}
}
// check for a valid connection (SID, duplicate login, etc.)
if ( (CONN_check == -1) || (timer_get_seconds() >= CONN_check) ) {
// every 3 minutes
CONN_check = timer_get_seconds() + 180;
Next_ping = timer_get_seconds() + 90;
// session ID check
// we go ahead and set the initial Last_pong here, even though we haven't gotten a pong yet
if ( (Last_pong == -1) || reset ) {
Last_pong = Next_ping;
reset = false;
}
FS2NetD_Ping();
// also send out a ID check to keep our login verified
if ( FS2NetD_CheckValidID() < 0 ) {
ml_string("FS2NetD WARNING: Unable to validate login!");
fs2netd_reset_connection();
@@ -568,11 +538,11 @@ static void fs2netd_handle_ping()
}
ml_string("FS2NetD ERROR: Lost connection to the FS2NetD server!");
FS2NetD_Disconnect();
fs2netd_reset_state();
fs2netd_disconnect();
ml_string("FS2NetD MSG: Will attempt an automatic reconnect to server in 5 minutes...");
Login_retry_time = timer_get_seconds() + 300;
ml_string("FS2NetD MSG: Will attempt an automatic reconnect to server in 30 minutes...");
Login_retry_time = timer_get_seconds() + 1800;
return;
} else {
@@ -585,7 +555,7 @@ static void fs2netd_handle_ping()
FS2NetD_CheckDuplicateLogin();
}
ml_string("FS2NetD sent IDENT check");
ml_string("FS2NetD sent PING/IDENT");
}
}
@@ -614,8 +584,6 @@ static void fs2netd_handle_messages()
return;
}
Last_activity = timer_get_seconds();
buffer_offset = 0;
while (buffer_offset+BASE_PACKET_SIZE <= bytes_read) {
@@ -644,8 +612,7 @@ static void fs2netd_handle_messages()
ml_printf("FS2NetD PONG: %d ms", timer_get_milliseconds() - itemp);
// reset timestamp, since the ping was successful
Ping_timestamp = -1;
Last_pong = timer_get_seconds();
break;
}
@@ -772,8 +739,8 @@ void fs2netd_do_frame()
fs2netd_login();
if ( !Logged_in ) {
// bah! try again in another 5 minutes
Login_retry_time = timer_get_seconds() + 300;
// bah! try again in another 30 minutes
Login_retry_time = timer_get_seconds() + 1800;
} else {
Login_retry_time = -1;
}
@@ -1583,10 +1550,6 @@ int fs2netd_get_pilot_info(const char *callsign, player *out_plr, bool first_cal
In_process = true;
}
if (first_call) {
ml_printf("FS2NetD MSG: Requesting pilot stats for '%s' ...", callsign);
}
int rc = FS2NetD_GetPlayerData(callsign, &new_plr, false, first_call);
// some sort of failure
-1
View File
@@ -47,7 +47,6 @@ extern tracker_game_data Multi_tracker_game_data;
bool fs2netd_is_online();
void fs2netd_reset_connection();
void fs2netd_disconnect();
void fs2netd_close();
+2 -2
View File
@@ -265,8 +265,8 @@ int FS2NetD_GetPlayerData(const char *player_name, player *pl, bool can_create,
PXO_GET_DATA( reply_type );
// if we weren't retrieved then bail out now
if (reply_type != 0) {
// if we weren't retrieved or created then bail out now
if (reply_type > 1) {
return (int)reply_type;
}
+8 -4
View File
@@ -368,13 +368,17 @@ void help_overlay_init()
{
// load right_bracket bitmap
help_right_bracket_bitmap = bm_load("right_bracket");
// we failed to load the bitmap - this is very bad
Assertion( help_right_bracket_bitmap >= 0, "Failed to load bitmap right_bracket for help overlay\n");
if(help_right_bracket_bitmap < 0){
// we failed to load the bitmap - this is very bad
Int3();
}
// load left_bracket bitmap
help_left_bracket_bitmap = bm_load("left_bracket");
// we failed to load the bitmap - this is very bad
Assertion( help_left_bracket_bitmap >= 0, "Failed to load bitmap left_bracket for help overlay\n");
if(help_left_bracket_bitmap < 0){
// we failed to load the bitmap - this is very bad
Int3();
}
atexit(close_help);
// parse help.tbl
+11 -7
View File
@@ -407,7 +407,7 @@ void event_music_force_switch()
return; // invalid pattern
Assert(new_pattern >= 0 && new_pattern < MAX_PATTERNS);
audiostream_play(Patterns[new_pattern].handle, (Master_event_music_volume * aav_music_volume), 0); // no looping
audiostream_play(Patterns[new_pattern].handle, Master_event_music_volume, 0); // no looping
audiostream_set_sample_cutoff(Patterns[new_pattern].handle, fl2i(Patterns[new_pattern].num_measures * Patterns[new_pattern].samples_per_measure) );
Patterns[Current_pattern].next_pattern = Patterns[Current_pattern].default_next_pattern;
Patterns[Current_pattern].force_pattern = FALSE;
@@ -440,7 +440,7 @@ void event_music_do_frame()
if ( Current_pattern != -1 && Patterns[Current_pattern].handle >= 0) {
//WMC - removed in favor of if
//Assert(Patterns[Current_pattern].handle >= 0 );
audiostream_play(Patterns[Current_pattern].handle, (Master_event_music_volume * aav_music_volume), 0); // no looping
audiostream_play(Patterns[Current_pattern].handle, Master_event_music_volume, 0); // no looping
audiostream_set_sample_cutoff(Patterns[Current_pattern].handle, fl2i(Patterns[Current_pattern].num_measures * Patterns[Current_pattern].samples_per_measure) );
}
}
@@ -462,7 +462,7 @@ void event_music_do_frame()
audiostream_stop(pat->handle); // stop current and rewind
pat->loop_for--;
if ( pat->loop_for > 0 ) {
audiostream_play(pat->handle, (Master_event_music_volume * aav_music_volume), 0); // no looping
audiostream_play(pat->handle, Master_event_music_volume, 0); // no looping
audiostream_set_sample_cutoff(Patterns[Current_pattern].handle, fl2i(Patterns[Current_pattern].num_measures * Patterns[Current_pattern].samples_per_measure) );
}
else {
@@ -924,7 +924,7 @@ int event_music_friendly_arrival()
// Goober5000 - I didn't touch this part... for some reason, FS2 only has one
// arrival music pattern, and this is it
Assert(Patterns[SONG_AARV_1].handle >= 0 );
audiostream_play(Patterns[SONG_AARV_1].handle, (Master_event_music_volume * aav_music_volume), 0); // no looping
audiostream_play(Patterns[SONG_AARV_1].handle, Master_event_music_volume, 0); // no looping
audiostream_set_sample_cutoff(Patterns[SONG_AARV_1].handle, fl2i(Patterns[SONG_AARV_1].num_measures * Patterns[SONG_AARV_1].samples_per_measure) );
}
// don't overlay
@@ -1198,7 +1198,9 @@ void parse_soundtrack()
}
//Track doesn't exist and has nocreate, so don't create it
Assertion(skip_to_start_of_string_either("#SoundTrack Start", "#Menu Music Start") || skip_to_string("#SoundTrack End"), "Couldn't find #Soundtrack Start, #Menu Music Start or #Soundtrack End. Music.tbl or -mus.tbm is invalid.\n");
if ( !skip_to_start_of_string_either("#SoundTrack Start", "#Menu Music Start") && !skip_to_string("#SoundTrack End")) {
Int3();
}
return;
}
@@ -1334,7 +1336,9 @@ void parse_menumusic()
Warning(LOCATION, "Could not load spooled music file after '%s' as maximum number of spooled music was reached (Max is %d)", Spooled_music[Num_music_files - 1].name, MAX_SPOOLED_MUSIC);
}
Assertion(skip_to_start_of_string_either("$Name:", "#Menu Music End"), "Couldn't find $Name or #Menu Music End. Music.tbl or -mus.tbm is invalid.\n");
if(!skip_to_start_of_string_either("$Name:", "#Menu Music End")) {
Int3();
}
return;
}
@@ -1587,7 +1591,7 @@ void event_music_unpause()
Assert( Current_pattern >= 0 && Current_pattern < MAX_PATTERNS );
if ( audiostream_is_paused(Patterns[Current_pattern].handle) == TRUE ) {
audiostream_play(Patterns[Current_pattern].handle, (Master_event_music_volume * aav_music_volume), 0); // no looping
audiostream_play(Patterns[Current_pattern].handle, Master_event_music_volume, 0); // no looping
audiostream_set_sample_cutoff(Patterns[Current_pattern].handle, fl2i(Patterns[Current_pattern].num_measures * Patterns[Current_pattern].samples_per_measure) );
}
}
+66 -82
View File
@@ -14,13 +14,14 @@
#include "species_defs/species_defs.h"
#include "parse/parselo.h"
#include "sound/ds.h"
#include <limits.h>
SCP_vector<game_snd> Snds;
int Num_game_sounds = 0;
game_snd *Snds = NULL;
SCP_vector<game_snd> Snds_iface;
SCP_vector<int> Snds_iface_handle;
int Num_iface_sounds = 0;
game_snd *Snds_iface = NULL;
int *Snds_iface_handle = NULL;
#define GAME_SND 0
#define IFACE_SND 1
@@ -38,8 +39,7 @@ void gamesnd_play_iface(int n)
//WMC - now ignores file extension.
int gamesnd_get_by_name(char* name)
{
Assert( Snds.size() <= INT_MAX );
for(int i = 0; i < (int)Snds.size(); i++)
for(int i = 0; i < Num_game_sounds; i++)
{
char *p = strrchr( Snds[i].filename, '.' );
if(p == NULL)
@@ -57,31 +57,6 @@ int gamesnd_get_by_name(char* name)
return -1;
}
int gamesnd_get_by_tbl_index(int index)
{
Assert( Snds.size() <= INT_MAX );
for(int i = 0; i < (int)Snds.size(); i++) {
if ( Snds[i].sig == index )
{
return i;
}
}
return -1;
}
int gamesnd_get_by_iface_tbl_index(int index)
{
Assert( Snds_iface.size() <= INT_MAX );
Assert( Snds_iface.size() == Snds_iface_handle.size() );
for(int i = 0; i < (int)Snds_iface.size(); i++) {
if ( Snds_iface[i].sig == index )
{
return i;
}
}
return -1;
}
//Takes a tag, a sound index destination, and the object name being parsed
//tag and object_name are mostly so that we can debug stuff
//This also means you shouldn't use optional_string or required_string,
@@ -99,18 +74,12 @@ void parse_sound(char* tag, int *idx_dest, char* object_name)
if(idx != -1)
(*idx_dest) = idx;
else
{
idx = gamesnd_get_by_tbl_index(atoi(buf));
if (idx != -1)
(*idx_dest) = idx;
}
(*idx_dest) = atoi(buf);
Assert( Snds.size() <= INT_MAX );
//Ensure sound is in range
if((*idx_dest) < -1 || (*idx_dest) >= (int)Snds.size())
if((*idx_dest) < -1 || (*idx_dest) >= Num_game_sounds)
{
(*idx_dest) = -1;
Warning(LOCATION, "%s sound index out of range on '%s'. Must be between 0 and %d. Forcing to -1 (Nonexistant sound).\n", tag, object_name, Snds.size());
Warning(LOCATION, "%s sound index out of range on '%s'. Must be between 0 and %d. Forcing to -1 (Nonexistant sound).\n", tag, object_name, Num_game_sounds);
}
}
}
@@ -128,8 +97,7 @@ void gamesnd_preload_common_sounds()
if ( !Sound_enabled )
return;
Assert( Snds.size() <= INT_MAX );
for ( i = 0; i < (int)Snds.size(); i++ ) {
for ( i = 0; i < Num_game_sounds; i++ ) {
gs = &Snds[i];
if ( gs->filename[0] != 0 && strnicmp(gs->filename, NOX("none.wav"), 4) ) {
if ( gs->preload ) {
@@ -153,8 +121,7 @@ void gamesnd_load_gameplay_sounds()
if ( !Sound_enabled )
return;
Assert( Snds.size() <= INT_MAX );
for ( i = 0; i < (int)Snds.size(); i++ ) {
for ( i = 0; i < Num_game_sounds; i++ ) {
gs = &Snds[i];
if ( gs->filename[0] != 0 && strnicmp(gs->filename, NOX("none.wav"), 4) ) {
if ( !gs->preload ) { // don't try to load anything that's already preloaded
@@ -175,8 +142,7 @@ void gamesnd_unload_gameplay_sounds()
int i;
game_snd *gs;
Assert( Snds.size() <= INT_MAX );
for ( i = 0; i < (int)Snds.size(); i++ ) {
for ( i = 0; i < Num_game_sounds; i++ ) {
gs = &Snds[i];
if ( gs->id != -1 ) {
snd_unload( gs->id );
@@ -198,8 +164,7 @@ void gamesnd_load_interface_sounds()
if ( !Sound_enabled )
return;
Assert( Snds_iface.size() < INT_MAX );
for ( i = 0; i < (int)Snds_iface.size(); i++ ) {
for ( i = 0; i < Num_iface_sounds; i++ ) {
gs = &Snds_iface[i];
if ( gs->filename[0] != 0 && strnicmp(gs->filename, NOX("none.wav"), 4) ) {
gs->id = snd_load(gs);
@@ -217,8 +182,7 @@ void gamesnd_unload_interface_sounds()
int i;
game_snd *gs;
Assert( Snds_iface.size() < INT_MAX );
for ( i = 0; i < (int)Snds_iface.size(); i++ ) {
for ( i = 0; i < Num_iface_sounds; i++ ) {
gs = &Snds_iface[i];
if ( gs->id != -1 ) {
snd_unload( gs->id );
@@ -292,8 +256,7 @@ void gamesnd_parse_soundstbl()
// Parse the gameplay sounds section
required_string("#Game Sounds Start");
while (required_string_either("#Game Sounds End","$Name:")) {
Assert( Snds.size() < INT_MAX );
Assert( num_game_sounds < (int)Snds.size() );
Assert( num_game_sounds < Num_game_sounds);
gamesnd_parse_line( &Snds[num_game_sounds], "$Name:" );
num_game_sounds++;
gamesnd_add_sound_slot( GAME_SND, num_game_sounds );
@@ -303,8 +266,7 @@ void gamesnd_parse_soundstbl()
// Parse the interface sounds section
required_string("#Interface Sounds Start");
while (required_string_either("#Interface Sounds End","$Name:")) {
Assert( Snds_iface_handle.size() < INT_MAX );
Assert( num_iface_sounds < (int)Snds_iface.size() );
Assert( num_iface_sounds < Num_iface_sounds);
gamesnd_parse_line(&Snds_iface[num_iface_sounds], "$Name:");
num_iface_sounds++;
gamesnd_add_sound_slot( IFACE_SND, num_iface_sounds );
@@ -505,7 +467,6 @@ void gamesnd_parse_soundstbl()
//
void gamesnd_init_struct(game_snd *gs)
{
gs->sig = -1;
gs->filename[0] = 0;
gs->id = -1;
gs->id_sig = -1;
@@ -521,26 +482,33 @@ void gamesnd_init_sounds()
{
int i;
Snds.clear();
Snds.resize(MIN_GAME_SOUNDS);
if (Snds == NULL) {
Snds = (game_snd *) vm_malloc (sizeof(game_snd) * MIN_GAME_SOUNDS);
Verify( Snds != NULL );
Num_game_sounds = MIN_GAME_SOUNDS;
}
Assert( Snds.size() > 0 );
Assert( Num_game_sounds > 0 );
Assert( Snds.size() <= INT_MAX );
// init the gameplay sounds
for ( i = 0; i < (int)Snds.size(); i++ ) {
for ( i = 0; i < Num_game_sounds; i++ ) {
gamesnd_init_struct(&Snds[i]);
}
Snds_iface.clear();
Snds_iface.resize(MIN_INTERFACE_SOUNDS);
Snds_iface_handle.resize(MIN_INTERFACE_SOUNDS);
Assert( Snds_iface.size() > 0 );
if (Snds_iface == NULL) {
Snds_iface = (game_snd *) vm_malloc (sizeof(game_snd) * MIN_INTERFACE_SOUNDS);
Verify( Snds_iface != NULL );
Num_iface_sounds = MIN_INTERFACE_SOUNDS;
Assert( Snds_iface_handle == NULL );
Snds_iface_handle = (int *) vm_malloc (sizeof(int) * Num_iface_sounds);
Verify( Snds_iface_handle != NULL );
}
Assert( Num_iface_sounds > 0 );
Assert( Snds_iface.size() < INT_MAX );
// init the interface sounds
for ( i = 0; i < (int)Snds_iface.size(); i++ ) {
for ( i = 0; i < Num_iface_sounds; i++ ) {
gamesnd_init_struct(&Snds_iface[i]);
Snds_iface_handle[i] = -1;
}
@@ -549,9 +517,20 @@ void gamesnd_init_sounds()
// close out gamesnd, ONLY CALL FROM game_shutdown()!!!!
void gamesnd_close()
{
Snds.clear();
Snds_iface.clear();
Snds_iface_handle.clear();
if (Snds != NULL) {
vm_free(Snds);
Snds = NULL;
}
if (Snds_iface != NULL) {
vm_free(Snds_iface);
Snds_iface = NULL;
}
if (Snds_iface_handle != NULL) {
vm_free(Snds_iface_handle);
Snds_iface_handle = NULL;
}
}
// callback function for the UI code to call when the mouse first goes over a button.
@@ -573,14 +552,16 @@ void gamesnd_add_sound_slot(int type, int num)
switch (type) {
case GAME_SND:
{
Assert( Snds.size() <= INT_MAX );
Assert( num < ((int)Snds.size() + increase_by) );
Assert( Snds != NULL );
Assert( num < (Num_game_sounds + increase_by) );
if (num >= (int)Snds.size()) {
Snds.resize(Snds.size() + increase_by);
if (num >= Num_game_sounds) {
Snds = (game_snd *) vm_realloc (Snds, sizeof(game_snd) * (Num_game_sounds + increase_by));
Verify( Snds != NULL );
Num_game_sounds += increase_by;
// default all new entries
for (i = ((int)Snds.size() - increase_by); i < (int)Snds.size(); i++) {
for (i = (Num_game_sounds - increase_by); i < Num_game_sounds; i++) {
gamesnd_init_struct(&Snds[i]);
}
}
@@ -589,17 +570,20 @@ void gamesnd_add_sound_slot(int type, int num)
case IFACE_SND:
{
Assert( Snds_iface.size() < INT_MAX );
Assert( num < ((int)Snds_iface.size() + increase_by) );
Assert( Snds_iface != NULL );
Assert( num < (Num_game_sounds + increase_by) );
if (num >= (int)Snds_iface.size()) {
Snds_iface.resize(Snds_iface.size() + increase_by);
if (num >= Num_iface_sounds) {
Snds_iface = (game_snd *) vm_realloc (Snds_iface, sizeof(game_snd) * (Num_iface_sounds + increase_by));
Verify( Snds_iface != NULL );
Num_iface_sounds += increase_by;
Snds_iface_handle.resize(Snds_iface.size());
Assert( Snds_iface.size() < INT_MAX );
Assert( Snds_iface_handle != NULL );
Snds_iface_handle = (int *) vm_realloc (Snds_iface_handle, sizeof(int) * Num_iface_sounds);
Verify( Snds_iface_handle != NULL );
// default all new entries
for (i = ((int)Snds_iface_handle.size() - increase_by); i < (int)Snds_iface_handle.size(); i++) {
for (i = (Num_iface_sounds - increase_by); i < Num_iface_sounds; i++) {
gamesnd_init_struct(&Snds_iface[i]);
Snds_iface_handle[i] = -1;
}
+5 -4
View File
@@ -27,8 +27,6 @@ void gamesnd_preload_common_sounds();
void gamesnd_play_iface(int n);
void gamesnd_play_error_beep();
int gamesnd_get_by_name(char* name);
int gamesnd_get_by_tbl_index(int index);
int gamesnd_get_by_iface_tbl_index(int index);
//This should handle NO_SOUND just fine since it doesn't directly access lowlevel code
//Does all parsing for a sound
@@ -42,8 +40,11 @@ void common_play_highlight_sound();
#define MIN_GAME_SOUNDS 202
#define MIN_INTERFACE_SOUNDS 70
extern SCP_vector<game_snd> Snds;
extern SCP_vector<game_snd> Snds_iface;
extern int Num_game_sounds;
extern int Num_iface_sounds;
extern game_snd *Snds;
extern game_snd *Snds_iface;
// symbolic names for misc. game sounds. The order here must match the order in
+1 -1
View File
@@ -30,7 +30,7 @@ color *Color_netplayer[20] = {
&Color_bright_blue,
&Color_green,
&Color_bright_green,
&Color_pink,
&Color_black,
&Color_grey,
&Color_silver,
&Color_white,
-10
View File
@@ -990,10 +990,6 @@ $no extra collision avoidance vs player: NO \n\
;; before making it give a death scream \n\
$perform less checks for death screams: NO \n\
\n\
;; If set, allows shield management for all ships \n\
;; (including capships). \n\
$all ships manage shields: NO \n\
\n\
#End \n\
";
@@ -1025,12 +1021,6 @@ $Linked: \n\
+Snd File: none \n\
$Hazard: \n\
+Msg: Cannot engage autopilot: Hazard Near \n\
+Snd File: none \n\
$Support Present: \n\
+Msg: Cannot engage autopilot: Support Ship Present \n\
+Snd File: none \n\
$Support Working: \n\
+Msg: Cannot engage autopilot: Support Ship is rearming or repairing a ship \n\
+Snd File: none \n\
\n\
#END \n\
+1 -1
View File
@@ -230,7 +230,7 @@ extern int Global_error_count;
// Assertion can only use its proper fuctionality in compilers that support variadic macro
# ifndef _MSC_VER // non MS compilers
# define Assertion(x, y, ...) do { if (!(x)){ WinAssert(#x,__FILE__,__LINE__, y , ##__VA_ARGS__ ); } } while (0)
# define Assertion(x, y, ...) do { if (!(x)){ WinAssert(#x,__FILE__,__LINE__, y, __VA_ARGS__ ); } } while (0)
# else
# if _MSC_VER >= 1400 // VC 2005 or greater
# define Assertion(x, y, ...) do { if (!(x)){ WinAssert(#x,__FILE__,__LINE__, y, __VA_ARGS__ ); } ASSUME(x); } while (0)
-49
View File
@@ -1,5 +1,4 @@
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "bmpman/bmpman.h"
#include "graphics/generic.h"
#include "graphics/2d.h"
@@ -20,54 +19,6 @@
//we check background type to avoid messed up colours for ANI
#define ANI_BPP_CHECK (ga->ani.bg_type == BM_TYPE_PCX) ? 16 : 32
// Goober5000
int generic_anim_init_and_stream(generic_anim *anim, char *anim_filename, ubyte bg_type, bool attempt_hi_res)
{
int stream_result = -1;
char filename[NAME_LENGTH];
char *p;
Assert(anim != NULL);
Assert(anim_filename != NULL);
// hi-res support
if (attempt_hi_res && (gr_screen.res == GR_1024)) {
// attempt to load a hi-res animation
memset(filename, 0, NAME_LENGTH);
strcpy_s(filename, "2_");
strncat(filename, anim_filename, NAME_LENGTH - 3);
// remove extension
p = strchr(filename, '.');
if(p) {
*p = '\0';
}
// attempt to stream the hi-res ani
generic_anim_init(anim, filename);
anim->ani.bg_type = bg_type;
stream_result = generic_anim_stream(anim);
}
// we failed to stream hi-res, or we aren't running in hi-res, so try low-res
if (stream_result < 0) {
strcpy_s(filename, anim_filename);
// remove extension
p = strchr(filename, '.');
if(p) {
*p = '\0';
}
// attempt to stream the low-res ani
generic_anim_init(anim, filename);
anim->ani.bg_type = bg_type;
stream_result = generic_anim_stream(anim);
}
return stream_result;
}
// Goober5000
void generic_anim_init(generic_anim *ga, char *filename)
{
+1 -1
View File
@@ -52,7 +52,7 @@ typedef struct generic_bitmap {
int bitmap_id;
} generic_bitmap;
int generic_anim_init_and_stream(generic_anim *anim, char *anim_filename, ubyte bg_type, bool attempt_hi_res);
void generic_anim_init(generic_anim *ga, char *filename = NULL);
void generic_bitmap_init(generic_bitmap *gb, char *filename = NULL);
int generic_anim_load(generic_anim *ga);
+2 -2
View File
@@ -11,7 +11,7 @@
#include "graphics/2d.h"
#include "cmdline/cmdline.h"
#include "render/3d.h"
#include "bmpman/bmpman.h"
geometry_batcher::~geometry_batcher()
{
@@ -618,7 +618,7 @@ int batch_add_bitmap(int texture, int tmap_flags, vertex *pnt, int orient, float
int index = find_good_batch_item(texture);
Assert( index >= 0 );
Assertion( (geometry_map[index].laser == false), "Particle effect %s used as laser glow or laser bitmap\n", bm_get_filename(texture) );
Assert( geometry_map[index].laser == false );
geometry_map[index].tmap_flags = tmap_flags;
geometry_map[index].alpha = alpha;
+2 -2
View File
@@ -147,7 +147,7 @@ ogl_extension GL_Extensions[NUM_OGL_EXTENSIONS] =
{ false, false, 1, { "GL_ARB_fragment_shader" }, 0, { NULL } },
// shader version 3.0 detection extensions (if any of these extensions exist then we should have a SM3.0 compatible card, hopefully)
{ false, false, 2, { "GL_ARB_shader_texture_lod", "GL_NV_vertex_program" }, 0, { NULL } }
{ false, false, 3, { "GL_ARB_shader_texture_lod", "GL_NV_vertex_program3", "GL_ATI_shader_texture_lod" }, 0, { NULL } }
};
// ogl_funcion is:
@@ -370,7 +370,7 @@ void opengl_extensions_init()
// }
if ( !Cmdline_noglsl && Is_Extension_Enabled(OGL_ARB_SHADER_OBJECTS) && Is_Extension_Enabled(OGL_ARB_FRAGMENT_SHADER)
&& Is_Extension_Enabled(OGL_ARB_VERTEX_SHADER) /*&& Is_Extension_Enabled(OGL_SM30)*/ )
&& Is_Extension_Enabled(OGL_ARB_VERTEX_SHADER) && Is_Extension_Enabled(OGL_SM30) )
{
Use_GLSL = 1;
}
+3
View File
@@ -687,6 +687,7 @@ void hud_config_synch_sliders(int i)
// reset some ui components based on HUD config data
void hud_config_synch_ui()
{
// game_load_palette();
HUD_init_hud_color_array();
// HC_sliders[gr_screen.res][HC_BRIGHTNESS_SLIDER].slider.pos = HUD_color_alpha-3; // convert to value from 0-10
@@ -1013,6 +1014,8 @@ void hud_config_set_color(int color)
hud_config_record_color(color);
// game_load_palette();
HUD_init_hud_color_array();
// apply the color to all gauges
-6
View File
@@ -12,7 +12,6 @@
#include "graphics/2d.h"
#include "localization/localize.h"
#include "hud/hud.h"
#include "mission/missiontraining.h" //for Max_directives
#include "hud/hudescort.h"
//#include "weapon/emp.h"
#include "hud/hudparse.h" //Duh.
@@ -524,11 +523,6 @@ void parse_hud_gauges_tbl(char *filename)
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
if(optional_string("$Max Directives:"))
{
stuff_int(&Max_directives);
}
if(optional_string("$Max Escort Ships:"))
{
stuff_int(&Max_escort_ships);
+2 -27
View File
@@ -2026,7 +2026,7 @@ void hud_squadmsg_call_reinforcement(int reinforcement_num, int player_num)
// function to display a list of reinforcements available to the player
void hud_squadmsg_reinforcement_select()
{
int i, k, wingnum;
int i, k;
reinforcements *rp;
if ( Num_menu_items == -1 ) {
@@ -2042,32 +2042,7 @@ void hud_squadmsg_reinforcement_select()
// don't put items which are not on my team
if((Player_ship != NULL) && (ship_get_reinforcement_team(i) != Player_ship->team)){
continue;
}
// check the arrival cue sexpression of the ship/wing of this reinforcement.
// Goober5000 - if it can't arrive, it doesn't count. This should check
// for SEXP_FALSE as well as SEXP_KNOWN_FALSE, otherwise you end up with
// a reinforcement menu containing no valid selections.
if ( (wingnum = wing_name_lookup(rp->name, 1)) != -1 ) {
Assert ( Wings[wingnum].arrival_cue >= 0 );
if ( Sexp_nodes[Wings[wingnum].arrival_cue].value == SEXP_FALSE
|| Sexp_nodes[Wings[wingnum].arrival_cue].value == SEXP_KNOWN_FALSE ){
continue;
}
} else {
p_object *p_objp;
p_objp = mission_parse_get_arrival_ship( rp->name );
if ( p_objp != NULL ) {
if ( Sexp_nodes[p_objp->arrival_cue].value == SEXP_FALSE
|| Sexp_nodes[p_objp->arrival_cue].value == SEXP_KNOWN_FALSE ){
continue;
}
} else {
Int3(); // allender says bogus! reinforcement should be here since it wasn't a wing!
continue;
}
}
}
Assert ( Num_menu_items < MAX_MENU_ITEMS );
strcpy_s( MsgItems[Num_menu_items].text, rp->name );
+2 -2
View File
@@ -1809,8 +1809,8 @@ void hud_target_live_turret(int next_flag, int auto_advance, int only_player_tar
} else if (turret_weapon_has_subtype(&A->weapons, WP_LASER)) {
ent[num_live_turrets].type = TYPE_FACING_LASER;
} else {
//Turret not live, bail
continue;
Int3();
ent[num_live_turrets].type = TYPE_FACING_LASER;
}
}
+7 -3
View File
@@ -1671,13 +1671,13 @@ void game_process_keys()
}
//If topdown view in non-2D mission, go back to cockpit view.
if ( (Viewer_mode & VM_TOPDOWN) && !(The_mission.flags & MISSION_FLAG_2D_MISSION) && !(Perspective_locked) ) {
if ( (Viewer_mode & VM_TOPDOWN) && !(The_mission.flags & MISSION_FLAG_2D_MISSION)) {
Viewer_mode &= ~VM_TOPDOWN;
break;
}
// if in external view or chase view, go back to cockpit view
if ( (Viewer_mode & (VM_EXTERNAL|VM_CHASE|VM_OTHER_SHIP)) && !(Perspective_locked) ) {
if ( Viewer_mode & (VM_EXTERNAL|VM_CHASE|VM_OTHER_SHIP) ) {
Viewer_mode &= ~(VM_EXTERNAL|VM_CHASE|VM_OTHER_SHIP);
break;
}
@@ -2846,7 +2846,11 @@ int button_function(int n)
}
else
{
if (!StartAutopilot())
if (CanAutopilot(true))
{
StartAutopilot();
}
else
gamesnd_play_iface(SND_GENERAL_FAIL);
}
}
-2
View File
@@ -25,7 +25,6 @@
#include "mission/missionparse.h"
#include "species_defs/species_defs.h"
#include "playerman/managepilot.h"
#include "object/objectsnd.h"
// flags
#define LAB_FLAG_NORMAL (0) // default
@@ -1849,7 +1848,6 @@ void labviewer_change_ship_lod(Tree* caller)
The_mission.ai_profile = &Ai_profiles[Default_ai_profile];
int test_idx = ship_create(&vmd_identity_matrix, &vmd_zero_vector, ship_index);
obj_delete(test_idx);
obj_snd_level_close();
}
Lab_last_selected_ship = Lab_selected_index;
-3
View File
@@ -35,9 +35,6 @@ int static_rand(int num)
{
int a, b, c;
if (num < 0)
num *= -1;
if (!Semirand_inited)
init_semirand();
+1 -5
View File
@@ -1630,11 +1630,7 @@ void vm_matrix_to_rot_axis_and_angle(matrix *m, float *theta, vec3d *rot_axis)
rot_axis->xyz.x = (m->vec.uvec.xyz.z - m->vec.fvec.xyz.y);
rot_axis->xyz.y = (m->vec.fvec.xyz.x - m->vec.rvec.xyz.z);
rot_axis->xyz.z = (m->vec.rvec.xyz.y - m->vec.uvec.xyz.x);
if (IS_VEC_NULL_SQ_SAFE(rot_axis)) {
vm_vec_make(rot_axis, 1.0f, 0.0f, 0.0f);
} else {
vm_vec_normalize(rot_axis);
}
vm_vec_normalize(rot_axis);
} else { // angle is PI within limits
*theta = PI;
+30 -33
View File
@@ -33,42 +33,41 @@
// This is the fs2_open credit list, please only add yourself if you have actually contributed code
// Rules!
char *fs2_open_credit_text =
"SOURCE CODE PROJECT STAFF:\n"
"SOURCE CODE PROJECT STAFF:\n"
"\n"
"Project Leaders:\n"
"\n"
"Cliff \"chief1983\" Gordon"
"\n"
"Senior Advisors:\n"
"\n"
"Taylor Richards\n"
"Ian \"Goober5000\" Warfield\n"
"Taylor Richards\n"
"\n"
"Senior Advisor\n"
"\n"
"Edward \"Inquisitor\" Gardner\n"
"\n"
"Programmers:\n"
"\n"
"Hassan \"Karajorma\" Kazmi\n"
"Derek \"Kazan\" Meek\n"
"Nick \"phreak\" Iannetta\n"
"Mike \"Bobboau\" Abegg\n"
"Backslash\n"
"Echelon9\n"
"Flaming_Sword\n"
"FUBAR\n"
"Iss Mneur\n"
"kkmic\n"
"Michael \"Zacam\" LaFleur\n"
"Shade\n"
"Soulstorm\n"
"Sushi\n"
"Swifty\n"
"Wanderer\n"
"Fabian \"The E\" Woltermann\n"
"\n"
"Dennis \"DTP\" Pedersen\n"
"\"EdrickV\"\n"
"Derek \"Kazan\" Meek\n"
"Ian \"Goober5000\" Warfield\n"
"\"Mysterial\"\n"
"Joe \"Righteous1\" Dowd\n"
"Jon \"Sesquipedalian\" Stovell\n"
"Matt \"Sticks\" Nischan\n"
"Mike \"penguin\" Harris\n"
"Nick \"phreak\" Iannetta\n"
"Thomas \"RandomTiger\" Whittaker\n"
"Taylor Richards\n"
"Will \"##Unknown Player##\" Rousnel\n"
"\"WMCoolmon\"\n"
"Hassan \"Karajorma\" Kazmi\n"
"\n"
"Readme Staff:\n"
"\n"
"\"Bottomfan\"\n"
"Peter \"Flipside\" Dibble\n"
"Jonathan \"Redmenace\" Willsher\n"
"\n"
"Web Support:\n"
"\n"
@@ -78,10 +77,12 @@ char *fs2_open_credit_text =
"\n"
"Special thanks to:\n"
"\n"
"portej05\n"
"Hery\n"
"QuantumDelta\n"
"Fury\n"
"\"Maeglamor\"\n"
"for donating a graphics card!\n"
"\n"
"\"Lightspeed\"\n"
"\"DaBrain\"\n"
"for helping out with the graphics enhancements\n"
"\n"
"Linux and OSX version with the support of\n"
"the icculus.org FreeSpace2 project:\n"
@@ -101,12 +102,8 @@ char *fs2_open_credit_text =
"\n"
"Ogg Vorbis - (C) 2005, Xiph.Org Foundation\n"
"JPEG - Independent JPEG Group, (C) 1991-1998, Thomas G. Lane\n"
"libpng - Copyright (C) 1998-2010 Glenn Randers-Pehrson\n"
"liblua - Copyright (C) 1994–2008 Lua.org, PUC-Rio\n"
"zlib - Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler\n"
"\n"
"\n"
"\n";
"\n\n"
"\n\n";
char *unmodified_credits = "ORIGINAL VOLITION STAFF:\n\n\n";
char *mod_check = "Design:";
+7 -8
View File
@@ -50,7 +50,11 @@ static char *Demo_title_bitmap_filename = NOX("DemoTitle1");
// PLAYER SELECT defines
//
int Max_lines; //Max number of pilots displayed in Window. Gets set in player_select_draw_list()
//#define MAX_PLAYER_SELECT_LINES 8 // max # of pilots displayed at once
int Player_select_max_lines[GR_NUM_RESOLUTIONS] = { // max # of pilots displayed at once
8, // GR_640
15 // GR_1024
};
// button control defines
#define NUM_PLAYER_SELECT_BUTTONS 8 // button control defines
@@ -914,7 +918,7 @@ void player_select_scroll_list_down()
gamesnd_play_iface(SND_GENERAL_FAIL);
}
if (Player_select_pilot >= (Player_select_list_start + Max_lines)){
if (Player_select_pilot >= (Player_select_list_start + Player_select_max_lines[gr_screen.res])){
Player_select_list_start++;
}
}
@@ -1060,12 +1064,7 @@ void player_select_draw_list()
{
int idx;
if (gr_screen.res == 1)
Max_lines = 145/gr_get_font_height(); //Make the max number of lines dependent on the font height. 145 and 85 are magic numbers, based on the window size in retail.
else
Max_lines = 85/gr_get_font_height();
for (idx=0; idx<Max_lines; idx++) {
for (idx=0; idx<Player_select_max_lines[gr_screen.res]; idx++) {
// only draw as many pilots as we have
if ((idx + Player_select_list_start) == Player_select_num_pilots)
break;
+11 -9
View File
@@ -244,6 +244,7 @@ static int Techroom_ship_modelnum;
static float Techroom_ship_rot;
static UI_BUTTON List_buttons[LIST_BUTTONS_MAX]; // buttons for each line of text in list
//static int Anim_playing_id = -1;
//static int anim_done = 0;
static int Palette_bmp;
//static int ShipWin01;
//static int ShipWin02;
@@ -392,14 +393,12 @@ void techroom_select_new_entry()
Techroom_ship_modelnum = -1;
Trackball_mode = 0;
// load animation here, we now only have one loaded
int stream_result = generic_anim_init_and_stream(&Current_list[Cur_entry].animation, Current_list[Cur_entry].tech_anim_filename, bm_get_type(Tech_background_bitmap), true);
if (stream_result >= 0) {
//load animation here, we now only have one loaded
generic_anim_init(&Current_list[Cur_entry].animation, Current_list[Cur_entry].tech_anim_filename);
Current_list[Cur_entry].animation.ani.bg_type = bm_get_type(Tech_background_bitmap);
if(generic_anim_stream(&Current_list[Cur_entry].animation) != -1){
Current_list[Cur_entry].has_anim = 1;
} else {
// we've failed to load any animation
// load an image and treat it like a 1 frame animation
Current_list[Cur_entry].bitmap = bm_load(Current_list[Cur_entry].tech_anim_filename);
}
}
@@ -729,7 +728,7 @@ void tech_ship_scroll_capture()
techroom_unload_animation();
techroom_select_new_entry();
}
}
void techroom_anim_render(float frametime)
{
@@ -809,7 +808,7 @@ void techroom_change_tab(int num)
Ship_list[Ship_list_size].index = i;
Ship_list[Ship_list_size].animation.num_frames = 0; // no anim for ships
Ship_list[Ship_list_size].has_anim = 0; // no anim for ships
Ship_list[Ship_list_size].name = *Ship_info[i].tech_title ? Ship_info[i].tech_title : (*Ship_info[i].alt_name ? Ship_info[i].alt_name : Ship_info[i].name);
Ship_list[Ship_list_size].name = (Ship_info[i].alt_name[0]) ? Ship_info[i].alt_name : Ship_info[i].name;
Ship_list[Ship_list_size].desc = Ship_info[i].tech_desc;
Ship_list[Ship_list_size].model_num = -1;
Ship_list[Ship_list_size].textures_loaded = 0;
@@ -872,11 +871,14 @@ void techroom_change_tab(int num)
Weapon_list[Weapon_list_size].index = i;
Weapon_list[Weapon_list_size].desc = Weapon_info[i].tech_desc;
Weapon_list[Weapon_list_size].has_anim = 1;
Weapon_list[Weapon_list_size].name = *Weapon_info[i].tech_title ? Weapon_info[i].tech_title : Weapon_info[i].name;
Weapon_list[Weapon_list_size].name = Weapon_info[i].tech_title;
Weapon_list[Weapon_list_size].bitmap = -1;
Weapon_list[Weapon_list_size].animation.num_frames = 0;
Weapon_list[Weapon_list_size].model_num = -1;
Weapon_list[Weapon_list_size].textures_loaded = 0;
if (Weapon_list[Weapon_list_size].name[0] == 0) {
Weapon_list[Weapon_list_size].name = Weapon_info[i].name;
}
// copy the weapon animation filename
strncpy(Weapon_list[Weapon_list_size].tech_anim_filename, Weapon_info[i].tech_anim_filename, MAX_FILENAME_LEN - 1);
+25 -81
View File
@@ -181,11 +181,6 @@ char *Persona_type_names[MAX_PERSONA_TYPES] =
int Default_command_persona;
// Goober5000
// NOTE - these are truncated filenames, i.e. without extensions
SCP_vector<SCP_string> generic_message_filenames;
///////////////////////////////////////////////////////////////////
// used to distort incoming messages when comms are damaged
///////////////////////////////////////////////////////////////////
@@ -424,6 +419,7 @@ void message_parse(bool importing_from_fsm)
void parse_msgtbl()
{
char *p1, *p2, *p3;
int i, j;
// open localization
@@ -439,19 +435,27 @@ void parse_msgtbl()
Num_messages = 0;
Num_personas = 0;
// Goober5000 - ugh, ugly hack to fix the FS2 retail tables
char *pVawacs25 = strstr(Mp, "Vawacs25.wav");
if (pVawacs25)
// Goober5000 - ugh, nasty nasty hack to fix the FS2 retail tables
p1 = strstr(Mp, "#End");
*(p1+4)=0;
p1 = strstr(Mp, "2926");
if (p1)
{
char *pAwacs75 = strstr(pVawacs25, "Awacs75.wav");
if (pAwacs75)
p2 = strstr(p1, "Vawacs25.wav");
p3 = strstr(p1, "$Name");
if (p2 && p3 && (p2 < p3))
{
// move the 'V' from the first filename to the second, and adjust the 'A' case
*pVawacs25 = 'A';
for (i = 1; i < (pAwacs75 - pVawacs25) - 1; i++)
pVawacs25[i] = pVawacs25[i+1];
pAwacs75[-1] = 'V';
pAwacs75[0] = 'a';
replace_one(p2, "Vawacs25.wav", "Awacs25.wav", 500);
}
}
p1 = strstr(Mp, "2927");
if (p1)
{
p2 = strstr(p1, "Awacs75.wav");
p3 = strstr(p1, "$Name");
if (p2 && p3 && (p2 < p3))
{
replace_one(p2, "Awacs75.wav", "Vawacs75.wav", 500);
}
}
@@ -485,50 +489,6 @@ void parse_msgtbl()
}
}
// additional table part!
generic_message_filenames.clear();
generic_message_filenames.push_back("none");
generic_message_filenames.push_back("cuevoice");
generic_message_filenames.push_back("emptymsg");
generic_message_filenames.push_back("generic");
generic_message_filenames.push_back("msgstart");
if (optional_string("#Simulated Speech Overrides"))
{
char filename[MAX_FILENAME_LEN];
while (required_string_either("#End", "$File Name:"))
{
required_string("$File Name:");
stuff_string(filename, F_NAME, MAX_FILENAME_LEN);
// get extension
char *ptr = strchr(filename, '.');
if (ptr == NULL)
{
Warning(LOCATION, "Simulated speech override file '%s' was provided with no extension!", filename);
continue;
}
// test extension
if (stricmp(ptr, ".ogg") && stricmp(ptr, ".wav"))
{
Warning(LOCATION, "Simulated speech override file '%s' was provided with an extension other than .wav or .ogg!", filename);
continue;
}
// truncate extension
*ptr = '\0';
// add truncated file name
generic_message_filenames.push_back(filename);
}
required_string("#End");
}
// close localization
lcl_ext_close();
}
@@ -899,26 +859,10 @@ void message_load_wave(int index, const char *filename)
// Goober5000
bool message_filename_is_generic(char *filename)
{
int i;
char truncated_filename[MAX_FILENAME_LEN];
// truncate any file extension
strcpy(truncated_filename, filename);
char *ptr = strchr(truncated_filename, '.');
// extension must be a recognized sound file
if ((ptr == NULL) || (stricmp(ptr, ".ogg") && stricmp(ptr, ".wav")))
return false;
// truncate it
*ptr = '\0';
// test against the list
for (i = 0; i < generic_message_filenames.size(); i++)
{
if (!stricmp(generic_message_filenames[i].c_str(), truncated_filename))
return true;
}
if (!strnicmp(filename, "cuevoice.wav", 8)) return true;
if (!strnicmp(filename, "emptymsg.wav", 8)) return true;
if (!strnicmp(filename, "generic.wav", 7)) return true;
if (!strnicmp(filename, "msgstart.wav", 8)) return true;
return false;
}
@@ -2026,7 +1970,7 @@ void message_maybe_distort()
snd_set_volume(Playing_messages[i].wave, 0.0f);
} else {
if ( was_muted )
snd_set_volume(Playing_messages[i].wave, (Master_sound_volume * aav_voice_volume));
snd_set_volume(Playing_messages[i].wave, Master_sound_volume);
}
}
}
+6 -14
View File
@@ -74,7 +74,6 @@ typedef struct {
char Training_buf[TRAINING_MESSAGE_LENGTH];
char *Training_lines[MAX_TRAINING_MESSAGE_LINES]; // Training message split into lines
char Training_voice_filename[NAME_LENGTH];
int Max_directives = TRAINING_OBJ_DISPLAY_LINES;
int Training_message_timestamp;
int Training_line_sizes[MAX_TRAINING_MESSAGE_LINES];
int Training_message_method = 1;
@@ -174,8 +173,8 @@ void training_obj_display()
offset = 0;
end = Training_obj_num_lines;
if (end > Max_directives) {
end = Max_directives;
if (end > TRAINING_OBJ_DISPLAY_LINES) {
end = TRAINING_OBJ_DISPLAY_LINES;
offset = Training_obj_num_lines - end;
}
@@ -303,9 +302,6 @@ void training_mission_init()
Training_obj_num_lines = 0;
Training_message_queue_count = 0;
Training_failure = 0;
if (Max_directives > TRAINING_OBJ_LINES) {
Max_directives = TRAINING_OBJ_LINES;
}
for (i=0; i<TRAINING_OBJ_LINES; i++)
Training_obj_lines[i] = -1;
@@ -365,7 +361,7 @@ void sort_training_objectives()
// get the index of the first directive that will be displayed
// if less than 0, display all lines
offset = Training_obj_num_lines - Max_directives;
offset = Training_obj_num_lines - TRAINING_OBJ_DISPLAY_LINES;
if (offset <= 0) {
return;
@@ -451,7 +447,7 @@ void sort_training_objectives()
// find first slot that can be bumped
// look at the last (N-4 to N) positions
for (slot_idx=0; slot_idx<Max_directives; slot_idx++) {
for (slot_idx=0; slot_idx<TRAINING_OBJ_DISPLAY_LINES; slot_idx++) {
if ( Training_obj_lines[i+offset] & TRAINING_OBJ_STATUS_KNOWN ) {
break;
}
@@ -730,7 +726,7 @@ int message_play_training_voice(int index)
Training_voice_type = 1;
if (Training_voice_handle >= 0)
audiostream_play(Training_voice_handle, (Master_voice_volume * aav_voice_volume), 0);
audiostream_play(Training_voice_handle, Master_voice_volume, 0);
Training_voice = index;
return Training_voice;
@@ -918,11 +914,7 @@ void message_training_display()
Training_message_visible = 0;
message_training_queue_check();
if ( !hud_disabled_except_messages() ) {
training_obj_display();
}
training_obj_display();
if (Training_failure){
return;
-1
View File
@@ -9,7 +9,6 @@
extern int Max_directives;
extern int Training_message_method;
extern int Training_num_lines;
extern int Training_message_visible;
+43 -2
View File
@@ -193,6 +193,7 @@ static int Voice_ended_time;
//static anim_instance *Cur_anim_instance = NULL;
static generic_anim Cur_Anim;
static char *Cur_anim_filename = "~~~~";
static int anim_done = 0;
static int Cmd_brief_last_voice;
static int Cmd_brief_paused = 0;
@@ -319,6 +320,9 @@ void cmd_brief_stop_anim(int id)
void cmd_brief_new_stage(int stage)
{
char *p;
char filename[NAME_LENGTH];
if (stage < 0) {
cmd_brief_stop_anim(-1);
Cur_stage = -1;
@@ -334,6 +338,11 @@ void cmd_brief_new_stage(int stage)
// load a new animation if it's different to what's already playing
if (strcmp(Cur_anim_filename, Cur_cmd_brief->stage[stage].ani_filename) != 0) {
// set stuff up
int stream_result = -1;
ubyte bg_type = bm_get_type(Cmd_brief_background_bitmap);
anim_done = 0;
// unload the previous anim
if(Cur_Anim.num_frames > 0) {
generic_anim_unload(&Cur_Anim);
@@ -342,8 +351,40 @@ void cmd_brief_new_stage(int stage)
// save new filename
Cur_anim_filename = Cur_cmd_brief->stage[stage].ani_filename;
// try to load the new anim in either high or low res
int stream_result = generic_anim_init_and_stream(&Cur_Anim, Cur_anim_filename, bm_get_type(Cmd_brief_background_bitmap), true);
// hi-res support
if (gr_screen.res == GR_1024) {
// attempt to load a hi-res animation
memset(filename, 0, NAME_LENGTH);
strcpy_s(filename, "2_");
strncat(filename, Cur_anim_filename, NAME_LENGTH - 3);
// remove extension
p = strchr(filename, '.');
if(p) {
*p = '\0';
}
// attempt to stream the hi-res ani
generic_anim_init(&Cur_Anim, filename);
Cur_Anim.ani.bg_type = bg_type;
stream_result = generic_anim_stream(&Cur_Anim);
}
// we failed to stream hi-res, or we aren't running in hi-res, so try low-res
if (stream_result < 0) {
strcpy_s(filename, Cur_anim_filename);
// remove extension
p = strchr(filename, '.');
if(p) {
*p = '\0';
}
// attempt to stream the low-res ani
generic_anim_init(&Cur_Anim, filename);
Cur_Anim.ani.bg_type = bg_type;
stream_result = generic_anim_stream(&Cur_Anim);
}
// we've failed to load any animation
if (stream_result < 0) {
+4 -4
View File
@@ -2728,11 +2728,11 @@ void ss_load_icons(int ship_class)
{
int first_frame, num_frames, i;
first_frame = bm_load_animation(sip->icon_filename, &num_frames);
Assertion(first_frame != -1, "Failed to load icon %s\n", sip->icon_filename); // Could not load in icon frames.. get Alan
if (first_frame == -1)
if ( first_frame == -1 ) {
Int3(); // Could not load in icon frames.. get Alan
return;
}
for ( i = 0; i < num_frames; i++ ) {
icon->icon_bmaps[i] = first_frame+i;
}
+4 -4
View File
@@ -601,10 +601,10 @@ void red_alert_store_subsys_status(red_alert_ship_status *ras, ship *shipp)
ss = GET_FIRST(&shipp->subsys_list);
while ( ss != END_OF_LIST( &shipp->subsys_list ) ) {
Assertion((count < MAX_RED_ALERT_SUBSYSTEMS), "Too many subsystems in ship %s with red-alert-carry status. Tried to store %d, maximum is %d\n", shipp->ship_name, count, MAX_RED_ALERT_SUBSYSTEMS);
if ( count >= MAX_RED_ALERT_SUBSYSTEMS )
break; //Ran out of systems, better bail
if ( count >= MAX_RED_ALERT_SUBSYSTEMS ) {
Int3(); // ran out of subsystems
break;
}
ras->subsys_current_hits[count] = ss->current_hits;
+2 -3
View File
@@ -107,7 +107,6 @@ typedef struct submodel_instance_info {
#define MSS_FLAG_TURRET_ALT_MATH (1 << 18) // tells the game to use additional calculations should turret have a defined y fov
#define MSS_FLAG_DUM_ROTATES (1 << 19) // Bobboau
#define MSS_FLAG_CARRY_SHOCKWAVE (1 << 20) // subsystem - even with 'carry no damage' flag - will carry shockwave damage to the hull
#define MSS_FLAG_ALLOW_LANDING (1 << 21) // This subsystem can be landed on
// definition of stepped rotation struct
typedef struct stepped_rotation {
@@ -399,8 +398,8 @@ typedef struct model_path {
} model_path;
typedef struct model_tmap_vert {
ushort vertnum;
ushort normnum;
short vertnum;
short normnum;
float u,v;
} model_tmap_vert;
+1 -4
View File
@@ -1593,9 +1593,6 @@ void standalone_main_init()
// if this is a tracker game then we have some extra tasks to perform
if (MULTI_IS_TRACKER_GAME) {
// disconnect and prepare for reset if we are already connected
fs2netd_disconnect();
// login (duh!)
if ( fs2netd_login() ) {
// validate missions
@@ -1662,7 +1659,7 @@ void multi_standalone_reset_all()
delete_player( idx );
}
}
// make sure we go to the proper state.
if(gameseq_get_state() == GS_STATE_STANDALONE_MAIN){
standalone_main_init();
+1 -1
View File
@@ -1901,7 +1901,7 @@ void multi_join_send_join_request(int as_observer)
return;
}
nprintf(("Network", "Password : %s\n", Multi_join_request.passwd));
nprintf(("Password : %s\n",Multi_join_request.passwd));
}
// fill out the join request struct
+2 -2
View File
@@ -61,7 +61,7 @@ int collide_debris_ship( obj_pair * pair )
vec3d hitpos;
// create and initialize ship_ship_hit_info struct
collision_info_struct debris_hit_info;
init_collision_info_struct(&debris_hit_info);
memset( &debris_hit_info, -1, sizeof(collision_info_struct) );
if ( pdebris->phys_info.mass > pship->phys_info.mass ) {
debris_hit_info.heavy = pdebris;
@@ -218,7 +218,7 @@ int collide_asteroid_ship( obj_pair * pair )
vec3d hitpos;
// create and initialize ship_ship_hit_info struct
collision_info_struct asteroid_hit_info;
init_collision_info_struct(&asteroid_hit_info);
memset( &asteroid_hit_info, -1, sizeof(collision_info_struct) );
if ( pasteroid->phys_info.mass > pship->phys_info.mass ) {
asteroid_hit_info.heavy = pasteroid;
+54 -173
View File
@@ -22,16 +22,20 @@
#include "io/joy_ff.h"
#include "io/timer.h"
#include "asteroid/asteroid.h"
#include "debris/debris.h"
#include "playerman/player.h"
#include "object/objectdock.h"
#include "object/objectshield.h"
#include "parse/scripting.h"
//#pragma optimize("", off)
//#pragma auto_inline(off)
#define COLLISION_FRICTION_FACTOR 0.0
#define COLLISION_ROTATION_FACTOR 0.2
#define SEP_VEL 5.0f // separation velocity between two ships that collide on same team.
#define COLLIDE_DEBUG
#undef COLLIDE_DEBUG
@@ -120,9 +124,6 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
ship *heavy_shipp = &Ships[heavy_obj->instance];
ship *light_shipp = &Ships[light_obj->instance];
ship_info *heavy_sip = &Ship_info[heavy_shipp->ship_info_index];
ship_info *light_sip = &Ship_info[light_shipp->ship_info_index];
// AL 12-4-97: we use the player_involved flag to ensure collisions are always
// done with the player, regardless of team.
if ( heavy_obj == Player_obj || light_obj == Player_obj ) {
@@ -180,11 +181,11 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
}
// If either of these objects doesn't get collision checks, abort.
if (heavy_sip->flags & SIF_NO_COLLIDE) {
if (Ship_info[heavy_shipp->ship_info_index].flags & SIF_NO_COLLIDE) {
return 0;
}
if (light_sip->flags & SIF_NO_COLLIDE) {
if (Ship_info[light_shipp->ship_info_index].flags & SIF_NO_COLLIDE) {
return 0;
}
@@ -195,7 +196,7 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
// vec3d submodel_hit;
// Do in heavy object RF
mc.model_num = heavy_sip->model_num; // Fill in the model to check
mc.model_num = Ship_info[heavy_shipp->ship_info_index].model_num; // Fill in the model to check
mc.orient = &heavy_obj->orient; // The object's orient
vec3d zero, p0, p1;
@@ -227,7 +228,7 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
// Set up collision info
mc.pos = &zero; // The object's position
mc.p1 = &p1; // Point 2 of ray to check
mc.radius = model_get_core_radius(light_sip->model_num);
mc.radius = model_get_core_radius(Ship_info[light_shipp->ship_info_index].model_num);
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE); // flags
// Only check invisible face polygons for ship:ship of different teams.
@@ -474,7 +475,7 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
if (heavy_shipp->team == light_shipp->team) {
// If a couple of small ships, just move them apart.
if ((heavy_sip->flags & SIF_SMALL_SHIP) && (light_sip->flags & SIF_SMALL_SHIP)) {
if ((Ship_info[heavy_shipp->ship_info_index].flags & SIF_SMALL_SHIP) && (Ship_info[light_shipp->ship_info_index].flags & SIF_SMALL_SHIP)) {
if ((heavy_obj->flags & OF_PLAYER_SHIP) || (light_obj->flags & OF_PLAYER_SHIP)) {
/*
vec3d h2l_vec;
@@ -526,10 +527,8 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
vm_vec_scale_add(&perp_rel_vel, &rel_vel_h, &h_to_l_vec, -mag);
vm_vec_normalize(&perp_rel_vel);
vm_vec_scale_add2(&heavy_obj->phys_info.vel, &perp_rel_vel,
heavy_sip->collision_physics.both_small_bounce * light_obj->phys_info.mass / mass_sum);
vm_vec_scale_add2(&light_obj->phys_info.vel, &perp_rel_vel,
-(light_sip->collision_physics.both_small_bounce) * heavy_obj->phys_info.mass / mass_sum);
vm_vec_scale_add2(&heavy_obj->phys_info.vel, &perp_rel_vel, SEP_VEL * light_obj->phys_info.mass / mass_sum);
vm_vec_scale_add2(&light_obj->phys_info.vel, &perp_rel_vel, -SEP_VEL * heavy_obj->phys_info.mass / mass_sum);
vm_vec_rotate( &heavy_obj->phys_info.prev_ramp_vel, &heavy_obj->phys_info.vel, &heavy_obj->orient );
vm_vec_rotate( &light_obj->phys_info.prev_ramp_vel, &light_obj->phys_info.vel, &light_obj->orient );
@@ -542,11 +541,9 @@ int ship_ship_check_collision(collision_info_struct *ship_ship_hit_info, vec3d *
rel_vel = 1.0f;
}
float mass_sum = heavy_obj->phys_info.mass + light_obj->phys_info.mass;
vm_vec_scale_add2( &heavy_obj->phys_info.vel, &ship_ship_hit_info->light_rel_vel,
heavy_sip->collision_physics.bounce*light_obj->phys_info.mass/(mass_sum*rel_vel) );
vm_vec_scale_add2( &heavy_obj->phys_info.vel, &ship_ship_hit_info->light_rel_vel, SEP_VEL*light_obj->phys_info.mass/(mass_sum*rel_vel) );
vm_vec_rotate( &heavy_obj->phys_info.prev_ramp_vel, &heavy_obj->phys_info.vel, &heavy_obj->orient );
vm_vec_scale_add2( &light_obj->phys_info.vel, &ship_ship_hit_info->light_rel_vel,
-(light_sip->collision_physics.bounce)*heavy_obj->phys_info.mass/(mass_sum*rel_vel) );
vm_vec_scale_add2( &light_obj->phys_info.vel, &ship_ship_hit_info->light_rel_vel, -SEP_VEL*heavy_obj->phys_info.mass/(mass_sum*rel_vel) );
vm_vec_rotate( &light_obj->phys_info.prev_ramp_vel, &light_obj->phys_info.vel, &light_obj->orient );
}
}
@@ -605,21 +602,6 @@ int check_special_cruiser_asteroid_collision(object *heavy, object *light, float
return 0;
}
//Find the subobject corresponding to the submodel hit
bool check_subsystem_landing_allowed(ship_info *heavy_sip, collision_info_struct *ship_ship_hit_info) {
if (!(heavy_sip->flags2 & SIF2_ALLOW_LANDINGS))
return false;
for (int i = 0; i < heavy_sip->n_subsystems; i++) {
if (heavy_sip->subsystems[i].flags & MSS_FLAG_ALLOW_LANDING &&
heavy_sip->subsystems[i].subobj_num == ship_ship_hit_info->submodel_num)
{
return true;
}
}
return false;
}
// ------------------------------------------------------------------------------------------------
// input: ship_ship_hit => structure containing ship_ship hit info
// (includes) A, B => objects colliding
@@ -643,13 +625,6 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
object *heavy = ship_ship_hit_info->heavy;
object *light = ship_ship_hit_info->light;
// gurgh... this includes asteroids and debris too
Assert(heavy->type == OBJ_SHIP || heavy->type == OBJ_ASTEROID || heavy->type == OBJ_DEBRIS);
Assert(light->type == OBJ_SHIP || light->type == OBJ_ASTEROID || light->type == OBJ_DEBRIS);
ship_info *light_sip = (light->type == OBJ_SHIP) ? &Ship_info[Ships[light->instance].ship_info_index] : NULL;
ship_info *heavy_sip = (heavy->type == OBJ_SHIP) ? &Ship_info[Ships[heavy->instance].ship_info_index] : NULL;
// make cruiser/asteroid collision softer on cruisers.
int special_cruiser_asteroid_collision;
int cruiser_light = 0;
@@ -694,18 +669,7 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
if (ship_ship_hit_info->submodel_rot_hit == 1) {
bool set_model = false;
polymodel *pm;
if (heavy->type == OBJ_SHIP) {
pm = model_get(heavy_sip->model_num);
} else if (heavy->type == OBJ_ASTEROID) {
pm = Asteroid_info[Asteroids[heavy->instance].asteroid_type].modelp[Asteroids[heavy->instance].asteroid_subtype];
} else if (heavy->type == OBJ_DEBRIS) {
pm = model_get(Debris[heavy->instance].model_num);
} else {
// we should have caught this already
Int3();
pm = NULL;
}
polymodel *pm = model_get(Ship_info[Ships[heavy->instance].ship_info_index].model_num);
// be sure model is set
if (pm->submodel[ship_ship_hit_info->submodel_num].sii == NULL) {
@@ -781,31 +745,6 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
v_rel_normal_m = -v_rel_normal_m;
}
//Maybe treat the current collision as a landing
vec3d light_local_vel;
float light_uvec_dot_norm;
float light_fvec_dot_norm;
float light_rvec_dot_norm;
bool subsys_landing_allowed = light->type == OBJ_SHIP && heavy->type == OBJ_SHIP && check_subsystem_landing_allowed(heavy_sip, ship_ship_hit_info);
if (subsys_landing_allowed) {
vm_vec_rotate(&light_local_vel, &ship_ship_hit_info->light_rel_vel, &light->orient);
light_uvec_dot_norm = vm_vec_dot(&ship_ship_hit_info->collision_normal, &light->orient.vec.uvec);
light_fvec_dot_norm = vm_vec_dot(&ship_ship_hit_info->collision_normal, &light->orient.vec.fvec);
light_rvec_dot_norm = vm_vec_dot(&ship_ship_hit_info->collision_normal, &light->orient.vec.rvec);
}
if (subsys_landing_allowed &&
light_local_vel.xyz.z < light_sip->collision_physics.landing_max_z &&
light_local_vel.xyz.z > light_sip->collision_physics.landing_min_z &&
light_local_vel.xyz.y > light_sip->collision_physics.landing_min_y &&
abs(light_local_vel.xyz.x) < light_sip->collision_physics.landing_max_x &&
light_uvec_dot_norm > 0 &&
light_fvec_dot_norm < light_sip->collision_physics.landing_max_angle &&
light_fvec_dot_norm > light_sip->collision_physics.landing_min_angle &&
abs(light_rvec_dot_norm) < light_sip->collision_physics.landing_max_rot_angle)
{
ship_ship_hit_info->is_landing = true;
}
vec3d rotational_impulse_heavy, rotational_impulse_light, delta_rotvel_heavy, delta_rotvel_light;
vec3d delta_vel_from_delta_rotvel_heavy, delta_vel_from_delta_rotvel_light, impulse;
float impulse_mag, heavy_denom, light_denom;
@@ -819,8 +758,7 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
impulse = ship_ship_hit_info->collision_normal;
vm_vec_projection_onto_plane(&v_rel_parallel_m, &v_rel_m, &ship_ship_hit_info->collision_normal);
collision_speed_parallel = vm_vec_normalize_safe(&v_rel_parallel_m);
float friction = (light->type == OBJ_SHIP) ? light_sip->collision_physics.friction : COLLISION_FRICTION_FACTOR;
parallel_mag = float(-friction) * collision_speed_parallel / vm_vec_mag(&v_rel_m);
parallel_mag = float(-COLLISION_FRICTION_FACTOR) * collision_speed_parallel / vm_vec_mag(&v_rel_m);
vm_vec_scale_add2(&impulse, &v_rel_parallel_m, parallel_mag);
// calculate the effect on the velocity of the collison point per unit impulse
@@ -833,8 +771,7 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
vm_vec_crossprod(&rotational_impulse_heavy, &ship_ship_hit_info->r_heavy, &impulse);
get_I_inv(&heavy_I_inv, &heavy->phys_info.I_body_inv, &heavy->orient);
vm_vec_rotate(&delta_rotvel_heavy, &rotational_impulse_heavy, &heavy_I_inv);
float rotation_factor = (heavy->type == OBJ_SHIP) ? heavy_sip->collision_physics.rotation_factor : COLLISION_ROTATION_FACTOR;
vm_vec_scale(&delta_rotvel_heavy, rotation_factor); // hack decrease rotation (delta_rotvel)
vm_vec_scale(&delta_rotvel_heavy, float(COLLISION_ROTATION_FACTOR)); // hack decrease rotation (delta_rotvel)
vm_vec_crossprod(&delta_vel_from_delta_rotvel_heavy, &delta_rotvel_heavy , &ship_ship_hit_info->r_heavy);
heavy_denom = vm_vec_dotprod(&delta_vel_from_delta_rotvel_heavy, &ship_ship_hit_info->collision_normal);
if (heavy_denom < 0) {
@@ -854,8 +791,7 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
vm_vec_crossprod(&rotational_impulse_light, &ship_ship_hit_info->r_light, &impulse);
get_I_inv(&light_I_inv, &light->phys_info.I_body_inv, &light->orient);
vm_vec_rotate(&delta_rotvel_light, &rotational_impulse_light, &light_I_inv);
float rotation_factor = (light->type == OBJ_SHIP) ? light_sip->collision_physics.rotation_factor : COLLISION_ROTATION_FACTOR;
vm_vec_scale(&delta_rotvel_light, rotation_factor); // hack decrease rotation (delta_rotvel)
vm_vec_scale(&delta_rotvel_light, float(COLLISION_ROTATION_FACTOR)); // hack decrease rotation (delta_rotvel)
vm_vec_crossprod(&delta_vel_from_delta_rotvel_light, &delta_rotvel_light, &ship_ship_hit_info->r_light);
light_denom = vm_vec_dotprod(&delta_vel_from_delta_rotvel_light, &ship_ship_hit_info->collision_normal);
if (light_denom < 0) {
@@ -873,43 +809,17 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
nprintf(("Physics", "negative impulse mag -- Get Dave A if not Descent Physics\n"));
impulse_mag = -impulse_mag;
}
// update the physics info structs for heavy and light objects
// since we have already calculated delta rotvel for heavy and light in world coords
// physics should not have to recalculate this, just change into body coords (done in collide_whack)
vm_vec_scale(&impulse, impulse_mag);
//Assert(impulse_mag < 20e6);
vm_vec_scale(&delta_rotvel_light, impulse_mag);
physics_collide_whack(&impulse, &delta_rotvel_light, &light->phys_info, &light->orient, ship_ship_hit_info->is_landing);
physics_collide_whack(&impulse, &delta_rotvel_light, &light->phys_info, &light->orient);
vm_vec_negate(&impulse);
vm_vec_scale(&delta_rotvel_heavy, -impulse_mag);
physics_collide_whack(&impulse, &delta_rotvel_heavy, &heavy->phys_info, &heavy->orient, true);
// If within certain bounds, we want to add some more rotation towards the "resting orientation" of the ship
// These bounds are defined separately from normal "landing" bounds so that they can be more generous:
// we can have crash landings that still re-orient the ship.
if (subsys_landing_allowed &
light_local_vel.xyz.z < light_sip->collision_physics.reorient_max_z &&
light_local_vel.xyz.z > light_sip->collision_physics.reorient_min_z &&
light_local_vel.xyz.y > light_sip->collision_physics.reorient_min_y &&
abs(light_local_vel.xyz.x) < light_sip->collision_physics.reorient_max_x &&
light_uvec_dot_norm > 0 &&
light_fvec_dot_norm < light_sip->collision_physics.reorient_max_angle &&
light_fvec_dot_norm > light_sip->collision_physics.reorient_min_angle &&
abs(light_rvec_dot_norm) < light_sip->collision_physics.reorient_max_rot_angle)
{
vec3d landing_delta_rotvel;
landing_delta_rotvel.xyz.x = (light_fvec_dot_norm * light_sip->collision_physics.reorient_mult)
- light_sip->collision_physics.landing_rest_angle;
// For yaw, use the dot product between vel vector (normalized) and orientation on the xz plane
// This reduces to the following math
// We also clamp to reduce huge nose swings at low speeds
float xzVelMag = sqrt(light_local_vel.xyz.x * light_local_vel.xyz.x + light_local_vel.xyz.z * light_local_vel.xyz.z);
float xzVelDotOrient = MIN(MAX((xzVelMag > 0 ? (light_local_vel.xyz.x / xzVelMag) : 0), -0.5f), 0.5f);
landing_delta_rotvel.xyz.y = (xzVelMag > 2) ? (xzVelDotOrient * light_sip->collision_physics.reorient_mult) : 0;
landing_delta_rotvel.xyz.z = light_rvec_dot_norm * light_sip->collision_physics.reorient_mult * -1;
vm_vec_add2( &light->phys_info.rotvel, &landing_delta_rotvel );
}
physics_collide_whack(&impulse, &delta_rotvel_heavy, &heavy->phys_info, &heavy->orient);
// Find final positions
// We will try not to worry about the left over time in the frame
@@ -925,18 +835,11 @@ void calculate_ship_ship_collision_physics(collision_info_struct *ship_ship_hit_
Assert( !vm_is_vec_nan(&direction_light) );
vm_vec_scale_add2(&heavy->pos, &direction_light, 0.2f * light->phys_info.mass / (heavy->phys_info.mass + light->phys_info.mass));
vm_vec_scale_add2(&light->pos, &direction_light, -0.2f * heavy->phys_info.mass / (heavy->phys_info.mass + light->phys_info.mass));
vm_vec_scale_add2(&heavy->pos, &ship_ship_hit_info->collision_normal, -0.1f * light->phys_info.mass / (heavy->phys_info.mass + light->phys_info.mass));
//For landings, we want minimal movement on the light ship (just enough to keep the collision detection honest)
//TODO: Solution that works reliably landing on a moving ship
if (ship_ship_hit_info->is_landing) {
vm_vec_scale_add2(&light->pos, &ship_ship_hit_info->collision_normal, LANDING_POS_OFFSET);
}
else {
vm_vec_scale_add2(&light->pos, &direction_light, -0.2f * heavy->phys_info.mass / (heavy->phys_info.mass + light->phys_info.mass));
vm_vec_scale_add2(&light->pos, &ship_ship_hit_info->collision_normal, 0.1f * heavy->phys_info.mass / (heavy->phys_info.mass + light->phys_info.mass));
}
vm_vec_scale_add2(&light->pos, &ship_ship_hit_info->collision_normal, 0.1f * heavy->phys_info.mass / (heavy->phys_info.mass + light->phys_info.mass));
// restore mass in case of special cruiser / asteroid collision
// restore mass in case of special cruuiser / asteroid collision
if (special_cruiser_asteroid_collision) {
if (cruiser_light) {
light->phys_info.mass = copy_mass;
@@ -1220,13 +1123,11 @@ int collide_ship_ship( obj_pair * pair )
}
}
ship_info *light_sip = &Ship_info[Ships[LightOne->instance].ship_info_index];
// create ship_ship_or_debris_hit
// inputs obj A, obj B
// outputs hitpos, impulse (for damage), shield hit tri (for quadrant)
collision_info_struct ship_ship_hit_info;
init_collision_info_struct(&ship_ship_hit_info);
memset(&ship_ship_hit_info, -1, sizeof(collision_info_struct));
ship_ship_hit_info.heavy = HeavyOne; // heavy object, generally slower moving
ship_ship_hit_info.light = LightOne; // light object, generally faster moving
@@ -1313,8 +1214,7 @@ int collide_ship_ship( obj_pair * pair )
// }
// }
#endif
//Only flash the "Collision" text if not landing
if ( player_involved && !ship_ship_hit_info.is_landing) {
if ( player_involved ) {
hud_start_text_flash(XSTR("Collision", 1431), 2000);
}
}
@@ -1323,23 +1223,7 @@ int collide_ship_ship( obj_pair * pair )
// vm_vec_add(&world_hit_pos, &ship_ship_hit_info.heavy->pos, &ship_ship_hit_info.hit_pos);
//If this is a landing, play a different sound
if (ship_ship_hit_info.is_landing) {
if (vm_vec_mag(&ship_ship_hit_info.light_rel_vel) > MIN_LANDING_SOUND_VEL) {
if ( player_involved ) {
if ( !snd_is_playing(Player_collide_sound) ) {
Player_collide_sound = snd_play_3d( &Snds[light_sip->collision_physics.landing_sound_idx], &world_hit_pos, &View_position );
}
} else {
if ( !snd_is_playing(AI_collide_sound) ) {
AI_collide_sound = snd_play_3d( &Snds[light_sip->collision_physics.landing_sound_idx], &world_hit_pos, &View_position );
}
}
}
}
else {
collide_ship_ship_do_sound(&world_hit_pos, A, B, player_involved);
}
collide_ship_ship_do_sound(&world_hit_pos, A, B, player_involved);
// check if we should do force feedback stuff
if (player_involved && (ship_ship_hit_info.impulse > 0)) {
@@ -1374,38 +1258,35 @@ int collide_ship_ship( obj_pair * pair )
// nprintf(("AI", "Ship:ship collision: %s and %s.\n", Ships[A->instance].ship_name, Ships[B->instance].ship_name));
//Only do damage if not a landing
if (!ship_ship_hit_info.is_landing) {
// Scale damage based on skill level for player.
if ((LightOne->flags & OF_PLAYER_SHIP) || (HeavyOne->flags & OF_PLAYER_SHIP)) {
damage *= (float) (Game_skill_level*Game_skill_level+1)/(NUM_SKILL_LEVELS+1);
} else if (Ships[LightOne->instance].team == Ships[HeavyOne->instance].team) {
// Decrease damage if non-player ships and not large.
// Looks dumb when fighters are taking damage from bumping into each other.
if ((LightOne->radius < 50.0f) && (HeavyOne->radius <50.0f)) {
damage /= 4.0f;
}
// Scale damage based on skill level for player.
if ((LightOne->flags & OF_PLAYER_SHIP) || (HeavyOne->flags & OF_PLAYER_SHIP)) {
damage *= (float) (Game_skill_level*Game_skill_level+1)/(NUM_SKILL_LEVELS+1);
} else if (Ships[LightOne->instance].team == Ships[HeavyOne->instance].team) {
// Decrease damage if non-player ships and not large.
// Looks dumb when fighters are taking damage from bumping into each other.
if ((LightOne->radius < 50.0f) && (HeavyOne->radius <50.0f)) {
damage /= 4.0f;
}
float dam2 = (100.0f * damage/LightOne->phys_info.mass);
int quadrant_num = get_ship_quadrant_from_global(&world_hit_pos, ship_ship_hit_info.heavy);
//nprintf(("AI", "Ship %s hit in quad #%i\n", Ships[ship_ship_hit_info.heavy->instance].ship_name, quadrant_num));
if ((ship_ship_hit_info.heavy->flags & OF_NO_SHIELDS) || !ship_is_shield_up(ship_ship_hit_info.heavy, quadrant_num) ) {
quadrant_num = -1;
}
ship_apply_local_damage(ship_ship_hit_info.heavy, ship_ship_hit_info.light, &world_hit_pos, 100.0f * damage/HeavyOne->phys_info.mass, quadrant_num, CREATE_SPARKS, ship_ship_hit_info.submodel_num, &ship_ship_hit_info.collision_normal);
hud_shield_quadrant_hit(ship_ship_hit_info.heavy, quadrant_num);
//nprintf(("AI", "Ship %s hit in quad #%i\n", Ships[ship_ship_hit_info.light->instance].ship_name, quadrant_num));
// don't draw sparks (using sphere hitpos)
ship_apply_local_damage(ship_ship_hit_info.light, ship_ship_hit_info.heavy, &world_hit_pos, dam2, MISS_SHIELDS, NO_SPARKS, -1, &ship_ship_hit_info.collision_normal);
hud_shield_quadrant_hit(ship_ship_hit_info.light, quadrant_num);
maybe_push_little_ship_from_fast_big_ship(ship_ship_hit_info.heavy, ship_ship_hit_info.light, ship_ship_hit_info.impulse, &ship_ship_hit_info.collision_normal);
//nprintf(("AI", "Damage to %s = %7.3f\n", Ships[LightOne->instance].ship_name, dam2));
}
float dam2 = (100.0f * damage/LightOne->phys_info.mass);
int quadrant_num = get_ship_quadrant_from_global(&world_hit_pos, ship_ship_hit_info.heavy);
//nprintf(("AI", "Ship %s hit in quad #%i\n", Ships[ship_ship_hit_info.heavy->instance].ship_name, quadrant_num));
if ((ship_ship_hit_info.heavy->flags & OF_NO_SHIELDS) || !ship_is_shield_up(ship_ship_hit_info.heavy, quadrant_num) ) {
quadrant_num = -1;
}
ship_apply_local_damage(ship_ship_hit_info.heavy, ship_ship_hit_info.light, &world_hit_pos, 100.0f * damage/HeavyOne->phys_info.mass, quadrant_num, CREATE_SPARKS, ship_ship_hit_info.submodel_num, &ship_ship_hit_info.collision_normal);
hud_shield_quadrant_hit(ship_ship_hit_info.heavy, quadrant_num);
//nprintf(("AI", "Ship %s hit in quad #%i\n", Ships[ship_ship_hit_info.light->instance].ship_name, quadrant_num));
// don't draw sparks (using sphere hitpos)
ship_apply_local_damage(ship_ship_hit_info.light, ship_ship_hit_info.heavy, &world_hit_pos, dam2, MISS_SHIELDS, NO_SPARKS, -1, &ship_ship_hit_info.collision_normal);
hud_shield_quadrant_hit(ship_ship_hit_info.light, quadrant_num);
maybe_push_little_ship_from_fast_big_ship(ship_ship_hit_info.heavy, ship_ship_hit_info.light, ship_ship_hit_info.impulse, &ship_ship_hit_info.collision_normal);
//nprintf(("AI", "Damage to %s = %7.3f\n", Ships[LightOne->instance].ship_name, dam2));
}
if(!(b_override && !a_override))
-9
View File
@@ -1071,12 +1071,3 @@ void set_hit_struct_info(collision_info_struct *hit, mc_info *mc, int submodel_r
hit->submodel_rot_hit = submodel_rot_hit;
}
//Previously, this was done with
//memset(&ship_ship_hit_info, -1, sizeof(collision_info_struct));
//All those -1s are to replicate that logic
void init_collision_info_struct(collision_info_struct *cis)
{
memset(cis, -1, sizeof(collision_info_struct));
cis->is_landing = false;
}
-7
View File
@@ -35,14 +35,8 @@ typedef struct collision_info_struct {
int submodel_num; // submodel of heavy object that is hit
int edge_hit; // if edge is hit, need to change collision normal
int submodel_rot_hit; // if collision is against rotating submodel
bool is_landing; //SUSHI: Maybe treat current collision as a landing
} collision_info_struct;
//Collision physics constants
#define COLLISION_FRICTION_FACTOR 0.0f //Default value if not set in ships.tbl
#define COLLISION_ROTATION_FACTOR 0.2f //Default value if not set in ships.tbl
#define MIN_LANDING_SOUND_VEL 2.0f
#define LANDING_POS_OFFSET 0.05f
//===============================================================================
// GENERAL COLLISION DETECTION HELPER FUNCTIONS
@@ -144,5 +138,4 @@ int get_ship_quadrant_from_global(vec3d *global_pos, object *objp);
int reject_due_collision_groups(object *A, object *B);
void init_collision_info_struct(collision_info_struct *cis);
#endif
+2 -2
View File
@@ -779,8 +779,8 @@ void obj_move_call_physics(object *objp, float frametime)
if (shipp->weapons.num_secondary_banks > 0) {
polymodel *pm = model_get(Ship_info[shipp->ship_info_index].model_num);
Assertion( pm != NULL, "No polymodel found for ship %s", Ship_info[shipp->ship_info_index].name );
Assertion( pm->missile_banks != NULL, "Ship %s has %d secondary banks, but no missile banks could be found.\n", Ship_info[shipp->ship_info_index].name, shipp->weapons.num_secondary_banks );
Assert( pm != NULL );
Assert( pm->missile_banks != NULL );
for (int i = 0; i < shipp->weapons.num_secondary_banks; i++) {
//if there are no missles left don't bother
-4
View File
@@ -673,10 +673,6 @@ int obj_snd_assign(int objnum, int sndnum, vec3d *pos, int main, int flags, ship
if ( Obj_snd_enabled == FALSE )
return -1;
//Initialize object sound list, if not initialized
if (!Obj_snd_level_inited)
obj_snd_level_init();
obj_snd *snd = NULL;
object *objp = &Objects[objnum];
int idx, sound_index;
+4 -123
View File
@@ -3248,17 +3248,6 @@ ADE_FUNC(getScreenCoords, l_Vector, NULL, "Gets screen cordinates of a world vec
return ade_set_args(L, "ff", vtx.sx, vtx.sy);
}
ADE_FUNC(getNormalized, l_Vector, NULL, "Returns a normalized version of the vector", "vector", "Normalized Vector, or NIL if invalid")
{
vec3d v3;
if(!ade_get_args(L, "o", l_Vector.Get(&v3)))
return ADE_RETURN_NIL;
vm_vec_normalize(&v3);
return ade_set_args(L, "o", l_Vector.Set(v3));
}
//**********HANDLE: material
static const int THT_INDEPENDENT = 0;
static const int THT_OBJECT = 1;
@@ -4102,69 +4091,6 @@ ADE_VIRTVAR(CollisionGroups, l_Object, "number", "Collision group data", "number
return ade_set_args(L, "i", objh->objp->collision_group_id);
}
ADE_FUNC(getfvec, l_Object, "[boolean normalize]", "Returns the objects' current fvec.", "vector", "Objects' forward vector, or nil if invalid. If called with a true argument, vector will be normalized.")
{
object_h *objh = NULL;
object *obj = NULL;
bool normalize = false;
if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) {
return ADE_RETURN_NIL;
}
if(!objh->IsValid())
return ADE_RETURN_NIL;
obj = objh->objp;
vec3d v1 = obj->orient.vec.fvec;
if (normalize)
vm_vec_normalize(&v1);
return ade_set_args(L, "o", l_Vector.Set(v1));
}
ADE_FUNC(getuvec, l_Object, "[boolean normalize]", "Returns the objects' current uvec.", "vector", "Objects' up vector, or nil if invalid. If called with a true argument, vector will be normalized.")
{
object_h *objh = NULL;
object *obj = NULL;
bool normalize = false;
if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) {
return ADE_RETURN_NIL;
}
if(!objh->IsValid())
return ADE_RETURN_NIL;
obj = objh->objp;
vec3d v1 = obj->orient.vec.uvec;
if (normalize)
vm_vec_normalize(&v1);
return ade_set_args(L, "o", l_Vector.Set(v1));
}
ADE_FUNC(getrvec, l_Object, "[boolean normalize]", "Returns the objects' current rvec.", "vector", "Objects' rvec, or nil if invalid. If called with a true argument, vector will be normalized.")
{
object_h *objh = NULL;
object *obj = NULL;
bool normalize = false;
if (!ade_get_args(L, "o|b", l_Object.GetPtr(&objh), &normalize)) {
return ADE_RETURN_NIL;
}
if(!objh->IsValid())
return ADE_RETURN_NIL;
obj = objh->objp;
vec3d v1 = obj->orient.vec.fvec;
if (normalize)
vm_vec_normalize(&v1);
return ade_set_args(L, "o", l_Vector.Set(v1));
}
ADE_FUNC(checkRayCollision, l_Object, "vector Start Point, vector End Point, [boolean Local]", "Checks the collisions between the polygons of the current object and a ray", "vector Position", "World collision point (local if boolean is set to true), nil if no collisions")
{
object_h *objh = NULL;
@@ -4179,27 +4105,20 @@ ADE_FUNC(checkRayCollision, l_Object, "vector Start Point, vector End Point, [bo
return ADE_RETURN_NIL;
obj = objh->objp;
int flags = 0;
int submodel = -1;
switch(obj->type) {
case OBJ_SHIP:
model_num = Ship_info[Ships[obj->instance].ship_info_index].model_num;
flags = (MC_CHECK_MODEL | MC_CHECK_RAY);
break;
case OBJ_WEAPON:
model_num = Weapon_info[Weapons[obj->instance].weapon_info_index].model_num;
flags = (MC_CHECK_MODEL | MC_CHECK_RAY);
break;
case OBJ_DEBRIS:
model_num = Debris[obj->instance].model_num;
flags = (MC_CHECK_MODEL | MC_CHECK_RAY | MC_SUBMODEL);
submodel = Debris[obj->instance].submodel_num;
break;
case OBJ_ASTEROID:
temp = Asteroids[obj->instance].asteroid_subtype;
model_num = Asteroid_info[Asteroids[obj->instance].asteroid_type].model_num[temp];
flags = (MC_CHECK_MODEL | MC_CHECK_RAY);
break;
default:
return ADE_RETURN_NIL;
@@ -4211,12 +4130,11 @@ ADE_FUNC(checkRayCollision, l_Object, "vector Start Point, vector End Point, [bo
mc_info hull_check;
hull_check.model_num = model_num;
hull_check.submodel_num = submodel;
hull_check.orient = &obj->orient;
hull_check.pos = &obj->pos;
hull_check.p0 = v3a;
hull_check.p1 = v3b;
hull_check.flags = flags;
hull_check.flags = MC_CHECK_MODEL | MC_CHECK_RAY;
if ( !model_collide(&hull_check) ) {
return ADE_RETURN_NIL;
@@ -5603,7 +5521,7 @@ ADE_VIRTVAR(SecondaryBanks, l_Subsystem, "weaponbanktype", "Array of secondary w
}
ADE_VIRTVAR(Target, l_Subsystem, "object", "Object targetted by this subsystem. If used to set a new target, AI targeting will be switched off.", "object", "Targeted object, or invalid object handle if subsystem handle is invalid")
ADE_VIRTVAR(Target, l_Subsystem, "object", "Object targetted by this subsystem", "object", "Targeted object, or invalid object handle if subsystem handle is invalid")
{
ship_subsys_h *sso;
object_h *objh;
@@ -5620,28 +5538,11 @@ ADE_VIRTVAR(Target, l_Subsystem, "object", "Object targetted by this subsystem.
ss->turret_enemy_objnum = OBJ_INDEX(objh->objp);
ss->turret_enemy_sig = objh->sig;
ss->targeted_subsys = NULL;
ss->scripting_target_override = true;
}
return ade_set_object_with_breed(L, ss->turret_enemy_objnum);
}
ADE_FUNC(targetingOverride, l_Subsystem, "boolean", "If set to true, AI targeting for this turret is switched off. If set to false, the AI will take over again.", "boolean", "Returns true if successful, false otherwise")
{
bool targetOverride = false;
ship_subsys_h *sso;
if(!ade_get_args(L, "ob", l_Subsystem.GetPtr(&sso), &targetOverride))
return ADE_RETURN_FALSE;
if(!sso->IsValid())
return ADE_RETURN_FALSE;
ship_subsys *ss = sso->ss;
ss->scripting_target_override = targetOverride;
return ADE_RETURN_TRUE;
}
ADE_FUNC(hasFired, l_Subsystem, NULL, "Determine if a subsystem has fired", "boolean", "true if if fired, false if not fired, or nil if invalid. resets fired flag when called.")
{
ship_subsys_h *sso;
@@ -6346,7 +6247,6 @@ ADE_FUNC(hasShipExploded, l_Ship, NULL, "Checks if the ship explosion event has
if (shipp->pre_death_explosion_happened == 1) {
return ade_set_args(L, "i", 1);
}
return ade_set_args(L, "i", 3);
}
return ade_set_args(L, "i", 0);
@@ -6806,25 +6706,6 @@ ADE_FUNC(isWarpingIn, l_Ship, NULL, "Checks if ship is warping in", "boolean", "
return ADE_RETURN_FALSE;
}
ADE_FUNC(getEMP, l_Ship, NULL, "Returns the current emp effect strength acting on the object", "number", "Current EMP effect strength or NIL if object is invalid")
{
object_h *objh = NULL;
object *obj = NULL;
if (!ade_get_args(L, "o", l_Ship.GetPtr(&objh))) {
return ADE_RETURN_NIL;
}
if(!objh->IsValid())
return ADE_RETURN_NIL;
obj = objh->objp;
ship *shipp = &Ships[obj->instance];
return ade_set_args(L, "f", shipp->emp_intensity);
}
//**********HANDLE: Weapon
ade_obj<object_h> l_Weapon("weapon", "Weapon handle", &l_Object);
@@ -8259,7 +8140,7 @@ ADE_FUNC(playGameSound, l_Audio, "Sound index, [Panning (-1.0 left to 1.0 right)
if(vol > 100.0f)
vol = 100.0f;
idx = snd_play(&Snds[gamesnd_get_by_tbl_index(idx)], pan, vol*0.01f, pri, voice_msg);
idx = snd_play(&Snds[idx], pan, vol*0.01f, pri, voice_msg);
return ade_set_args(L, "b", idx > -1);
}
@@ -8270,7 +8151,7 @@ ADE_FUNC(playInterfaceSound, l_Audio, "Sound index", "Plays a sound from #Interf
if(!ade_get_args(L, "i", &idx))
return ade_set_error(L, "b", false);
gamesnd_play_iface(gamesnd_get_by_iface_tbl_index(idx));
gamesnd_play_iface(idx);
return ade_set_args(L, "b", idx > -1);
}
+1 -3
View File
@@ -2365,9 +2365,7 @@ int stuff_loadout_list (int *ilp, int max_ints, int lookup_type)
}
else if ((lookup_type == MISSION_LOADOUT_WEAPON_LIST) && (!(Weapon_info[index].wi_flags & WIF_PLAYER_ALLOWED)) ) {
clean_loadout_list_entry();
nprintf(("Warning", "Warning: Weapon type %s found in loadout of mission file. This class is not marked as a player allowed weapon...skipping\n", str));
if ( !Is_standalone )
Warning(LOCATION, "Weapon type \"%s\" found in loadout of mission file. This class is not marked as a player allowed weapon...skipping", str);
Warning(LOCATION, "Weapon type \"%s\" found in loadout of mission file. This class is not marked as a player allowed weapon...skipping", str);
continue;
}
+114 -807
View File
File diff suppressed because it is too large. Load diff
+6 -25
View File
@@ -117,9 +117,6 @@ struct ship;
#define OPF_HUD_ELEMENT 71 // A magic name of a specific HUD element
#define OPF_SOUND_ENVIRONMENT 72 // Goober5000 - one of EFX_presets, per Taylor
#define OPF_SOUND_ENVIRONMENT_OPTION 73 // Goober5000 - one of Taylor's options
#define OPF_EXPLOSION_OPTION 74 // Goober5000
#define OPF_AUDIO_VOLUME_OPTION 75 // The E
#define OPF_WEAPON_BANK_NUMBER 76 // Karajomra - The number of a primary/secondary/tertiary weapon bank or all of them
// Operand return types
#define OPR_NUMBER 1 // returns number
@@ -341,8 +338,6 @@ struct ship;
#define OP_GET_THROTTLE_SPEED (0x003a | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_HITS_LEFT_SUBSYSTEM_GENERIC (0x003b | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_HITS_LEFT_SUBSYSTEM_SPECIFIC (0x003c | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_HAS_PRIMARY_WEAPON (0x003d | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
#define OP_HAS_SECONDARY_WEAPON (0x003e | OP_CATEGORY_STATUS | OP_NONCAMPAIGN_FLAG) // Karajorma
// conditional sexpressions
@@ -473,7 +468,7 @@ struct ship;
#define OP_CLOSE_SOUND_FROM_FILE (0x0064 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_HUD_DISABLE (0x0065 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_KAMIKAZE (0x0066 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-Sesquipedalian
#define OP_MISSION_SET_SUBSPACE (0x0067 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG)
#define OP_NOT_KAMIKAZE (0x0067 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //-Sesquipedalian
#define OP_TURRET_TAGGED_SPECIFIC (0x0068 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //phreak
#define OP_TURRET_TAGGED_CLEAR_SPECIFIC (0x0069 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) //phreak
#define OP_LOCK_ROTATING_SUBSYSTEM (0x006a | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
@@ -589,13 +584,10 @@ struct ship;
#define OP_SET_ARMOR_TYPE (0x00d2 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // FUBAR
#define OP_CUTSCENES_SHOW_SUBTITLE_TEXT (0x00d3 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_CUTSCENES_SHOW_SUBTITLE_IMAGE (0x00d4 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_HUD_DISPLAY_GAUGE (0x00d5 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG)
#define OP_SET_SOUND_ENVIRONMENT (0x00d6 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Taylor
#define OP_UPDATE_SOUND_ENVIRONMENT (0x00d7 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Taylor
#define OP_SET_EXPLOSION_OPTION (0x00d8 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Goober5000
#define OP_ADJUST_AUDIO_VOLUME (0x00d9 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // The E
#define OP_SHIP_CHANGE_CALLSIGN (0x00da | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // FUBAR
#define OP_IS_FACING (0x00db | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // The E
#define OP_MISSION_SET_SUBSPACE (0x00d5 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG)
#define OP_HUD_DISPLAY_GAUGE (0x00d6 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG)
#define OP_SET_SOUND_ENVIRONMENT (0x00d7 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Taylor
#define OP_UPDATE_SOUND_ENVIRONMENT (0x00d8 | OP_CATEGORY_CHANGE | OP_NONCAMPAIGN_FLAG) // Taylor
/* made obsolete by Goober5000
// debugging sexpressions
@@ -695,13 +687,11 @@ struct ship;
// defines for string constants
#define SEXP_HULL_STRING "Hull"
#define SEXP_SIM_HULL_STRING "Simulated Hull"
#define SEXP_SHIELD_STRING "Shields"
#define SEXP_ALL_ENGINES_STRING "<all engines>"
#define SEXP_ALL_TURRETS_STRING "<all turrets>"
#define SEXP_ARGUMENT_STRING "<argument>"
#define SEXP_NONE_STRING "<none>"
#define SEXP_ANY_STRING "<any string>"
#define SEXP_ALL_BANKS_STRING "<all weapon banks>"
#define SEXP_SHIELD_STRING "Shields"
// macros for accessing sexpression atoms
#define CAR(n) ((n < 0) ? -1 : Sexp_nodes[n].first)
@@ -866,7 +856,6 @@ char *CTEXT(int n);
#define SEXP_CHECK_INVALID_HUD_ELEMENT -143
#define SEXP_CHECK_INVALID_SOUND_ENVIRONMENT -144
#define SEXP_CHECK_INVALID_SOUND_ENVIRONMENT_OPTION -145
#define SEXP_CHECK_INVALID_EXPLOSION_OPTION -146
#define TRAINING_CONTEXT_SPEED (1<<0)
#define TRAINING_CONTEXT_FLY_PATH (1<<1)
@@ -1072,14 +1061,6 @@ void multi_sexp_eval();
extern int Num_sound_environment_options;
extern char *Sound_environment_option[];
// Goober5000
extern int Num_explosion_options;
extern char *Explosion_option[];
//The E
extern int Num_adjust_audio_options;
extern char *Adjust_audio_options[];
/** Global state variables for the hud-display-gauge sexp.
They all should be named Sexp_hud_display_*;
They all should follow the following symantics for the value of the
+4 -6
View File
@@ -1074,7 +1074,7 @@ void physics_apply_shock(vec3d *direction_vec, float pressure, physics_info *pi,
// Warning: Do not change ROTVEL_COLLIDE_WHACK_CONST. This will mess up collision physics.
// If you need to change the rotation, change COLLISION_ROTATION_FACTOR in collide_ship_ship.
#define ROTVEL_COLLIDE_WHACK_CONST 1.0
void physics_collide_whack( vec3d *impulse, vec3d *world_delta_rotvel, physics_info *pi, matrix *orient, bool is_landing )
void physics_collide_whack( vec3d *impulse, vec3d *world_delta_rotvel, physics_info *pi, matrix *orient )
{
vec3d body_delta_rotvel;
@@ -1095,11 +1095,9 @@ void physics_collide_whack( vec3d *impulse, vec3d *world_delta_rotvel, physics_i
update_reduced_damp_timestamp( pi, vm_vec_mag(impulse) );
// find time for shake from weapon to end
if (!is_landing) {
int dtime = timestamp_until(pi->afterburner_decay);
if (dtime < WEAPON_SHAKE_TIME) {
pi->afterburner_decay = timestamp( WEAPON_SHAKE_TIME );
}
int dtime = timestamp_until(pi->afterburner_decay);
if (dtime < WEAPON_SHAKE_TIME) {
pi->afterburner_decay = timestamp( WEAPON_SHAKE_TIME );
}
pi->flags |= PF_REDUCED_DAMP;
+1 -1
View File
@@ -132,7 +132,7 @@ extern void physics_sim_vel(vec3d * position, physics_info * pi, float sim_time,
extern void physics_sim_rot(matrix * orient, physics_info * pi, float sim_time );
extern void physics_apply_whack(vec3d *force, vec3d *pos, physics_info *pi, matrix *orient, float mass);
extern void physics_apply_shock(vec3d *direction_vec, float pressure, physics_info *pi, matrix *orient, vec3d *min, vec3d *max, float radius);
extern void physics_collide_whack(vec3d *impulse, vec3d *delta_rotvel, physics_info *pi, matrix *orient, bool is_landing);
extern void physics_collide_whack(vec3d *impulse, vec3d *delta_rotvel, physics_info *pi, matrix *orient);
int check_rotvel_limit( physics_info *pi );
+1 -1
View File
@@ -1498,7 +1498,7 @@ int player_inspect_cargo(float frametime, char *outstr)
Assert ( cargo_sip->flags & (SIF_CARGO|SIF_TRANSPORT) );
if ( cargo_name[0] == '#' )
sprintf(outstr, XSTR( "passengers: %s", 83), cargo_name+1 );
sprintf(outstr, XSTR( "passengers:\n %s", 83), cargo_name+1 );
else
sprintf(outstr,XSTR( "cargo: %s", 84), cargo_name );
} else {
+7 -7
View File
@@ -100,7 +100,7 @@ int png_read_header(char *real_filename, CFILE *img_cfp, int *w, int *h, int *bp
{
mprintf(("png_read_header: error creating info struct\n"));
cfclose(png_file);
png_destroy_read_struct(&png_ptr, NULL, NULL);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return PNG_ERROR_READING;
}
@@ -108,7 +108,7 @@ int png_read_header(char *real_filename, CFILE *img_cfp, int *w, int *h, int *bp
{
mprintf(("png_read_header: something went wrong\n"));
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
cfclose(png_file);
/* If we get here, we had a problem reading the file */
return PNG_ERROR_READING;
@@ -128,7 +128,7 @@ int png_read_header(char *real_filename, CFILE *img_cfp, int *w, int *h, int *bp
png_file = NULL;
}
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
return PNG_ERROR_NONE;
}
@@ -183,7 +183,7 @@ int png_read_bitmap(char *real_filename, ubyte *image_data, ubyte *bpp, int dest
{
mprintf(("png_read_bitmap: info_ptr went wrong\n"));
cfclose(png_file);
png_destroy_read_struct(&png_ptr, NULL, NULL);
png_destroy_read_struct(&png_ptr, png_infopp_NULL, png_infopp_NULL);
return PNG_ERROR_READING;
}
@@ -191,7 +191,7 @@ int png_read_bitmap(char *real_filename, ubyte *image_data, ubyte *bpp, int dest
{
mprintf(("png_read_bitmap: something went wrong\n"));
/* Free all of the memory associated with the png_ptr and info_ptr */
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
cfclose(png_file);
/* If we get here, we had a problem reading the file */
return PNG_ERROR_READING;
@@ -199,7 +199,7 @@ int png_read_bitmap(char *real_filename, ubyte *image_data, ubyte *bpp, int dest
png_set_read_fn(png_ptr, &png_file, png_scp_read_data);
png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_BGR | PNG_TRANSFORM_EXPAND, NULL);
png_read_png(png_ptr, info_ptr, PNG_TRANSFORM_BGR | PNG_TRANSFORM_EXPAND, png_voidp_NULL);
len = png_get_rowbytes(png_ptr, info_ptr);
row_pointers = png_get_rows(png_ptr, info_ptr);
@@ -212,7 +212,7 @@ int png_read_bitmap(char *real_filename, ubyte *image_data, ubyte *bpp, int dest
memcpy(&image_data[i * len], row_pointers[i], len);
}
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
png_destroy_read_struct(&png_ptr, &info_ptr, png_infopp_NULL);
cfclose(png_file);
return PNG_ERROR_NONE;
+1 -5
View File
@@ -312,11 +312,7 @@ void radar_plot_object_orb( object *objp )
return;
}
if (IS_VEC_NULL_SQ_SAFE(&pos)) {
vm_vec_make(&pos, 1.0f, 0.0f, 0.0f);
} else {
vm_vec_normalize(&pos);
}
vm_vec_normalize(&pos);
float scale = dist / Radar_bright_range;
if (scale > 1.25f) scale = 1.25f;
+1 -1
View File
@@ -112,7 +112,7 @@ void load_shield_hit_bitmap()
if ( Shield_ani[i].first_frame < 0 )
Int3();
*/
Assertion((Species_info[i].shield_anim.first_frame >= 0), "Error while loading shield hit ani: %s for species: %s\n", Species_info[i].shield_anim.filename, Species_info[i].species_name);
Assert(Species_info[i].shield_anim.first_frame >= 0);
}
#endif
+57 -247
View File
@@ -72,9 +72,7 @@
#include "iff_defs/iff_defs.h"
#include "network/multiutil.h"
#include "network/multimsgs.h"
#include "autopilot/autopilot.h"
#include "cmdline/cmdline.h"
#include "object/objcollide.h"
@@ -107,6 +105,8 @@ extern void fs2netd_add_table_validation(char *tblname);
//#define MIN_COLLISION_MOVE_DIST 5.0
//#define COLLISION_VEL_CONST 0.1
#define COLLISION_FRICTION_FACTOR 0.0 // ratio of maximum friction impulse to repulsion impulse
#define COLLISION_ROTATION_FACTOR 1.0 // increase in rotation from collision
#define SHIP_REPAIR_SUBSYSTEM_RATE 0.01f
int Ai_render_debug_flag=0;
@@ -235,8 +235,7 @@ flag_def_list Subsystem_flags[] = {
{ "no subsystem targeting", MSS_FLAG_NO_SS_TARGETING, 0 },
{ "fire on target", MSS_FLAG_FIRE_ON_TARGET, 0 },
{ "reset when idle", MSS_FLAG_TURRET_RESET_IDLE, 0 },
{ "carry shockwave", MSS_FLAG_CARRY_SHOCKWAVE, 0 },
{ "allow landing", MSS_FLAG_ALLOW_LANDING, 0 }
{ "carry shockwave", MSS_FLAG_CARRY_SHOCKWAVE, 0 }
};
int Num_subsystem_flags = sizeof(Subsystem_flags)/sizeof(flag_def_list);
@@ -284,7 +283,6 @@ flag_def_list Ship_flags[] = {
{ "no thruster geometry noise", SIF2_NO_THRUSTER_GEO_NOISE, 1 },
{ "intrinsic no shields", SIF2_INTRINSIC_NO_SHIELDS, 1 },
{ "no primary linking", SIF2_NO_PRIMARY_LINKING, 1 },
{ "no pain flash", SIF2_NO_PAIN_FLASH, 1 },
// to keep things clean, obsolete options go last
{ "ballistic primaries", -1, 255 }
@@ -567,8 +565,6 @@ void parse_engine_wash(bool replace)
char *Warp_types[] = {
"Default",
"Knossos",
"Babylon5",
"Galactica",
"Homeworld",
"Hyperspace",
@@ -629,7 +625,6 @@ void init_ship_entry(ship_info *sip)
sip->type_str = sip->maneuverability_str = sip->armor_str = sip->manufacturer_str = NULL;
sip->desc = NULL;
sip->tech_title[0] = 0;
sip->tech_desc = NULL;
sip->ship_length = NULL;
sip->gun_mounts = NULL;
@@ -703,30 +698,6 @@ void init_ship_entry(ship_info *sip)
strcpy_s(sip->shockwave_name,"");*/
sip->collision_damage_type_idx = -1;
sip->collision_physics.both_small_bounce = 5.0; //Retail default collision physics
sip->collision_physics.bounce = 5.0;
sip->collision_physics.friction = COLLISION_FRICTION_FACTOR;
sip->collision_physics.rotation_factor = COLLISION_ROTATION_FACTOR;
// Default landing parameters
sip->collision_physics.landing_max_z = 0.0f;
sip->collision_physics.landing_min_z = 0.0f;
sip->collision_physics.landing_min_y = 0.0f;
sip->collision_physics.landing_max_x = 0.0f;
sip->collision_physics.landing_max_angle = 0.0f;
sip->collision_physics.landing_min_angle = 0.0f;
sip->collision_physics.landing_max_rot_angle = 0.0f;
sip->collision_physics.reorient_max_z = 0.0f;
sip->collision_physics.reorient_min_z = 0.0f;
sip->collision_physics.reorient_min_y = 0.0f;
sip->collision_physics.reorient_max_x = 0.0f;
sip->collision_physics.reorient_max_angle = 0.0f;
sip->collision_physics.reorient_min_angle = 0.0f;
sip->collision_physics.reorient_max_rot_angle = 0.0f;
sip->collision_physics.reorient_mult = 1.0f;
sip->collision_physics.landing_rest_angle = 0.0f;
sip->collision_physics.landing_sound_idx = -1;
sip->debris_min_lifetime = -1.0f;
sip->debris_max_lifetime = -1.0f;
sip->debris_min_speed = -1.0f;
@@ -1163,10 +1134,6 @@ int parse_ship_values(ship_info* sip, bool isTemplate, bool first_time, bool rep
}
if (optional_string("+Tech Title:")) {
stuff_string(sip->tech_title, F_NAME, NAME_LENGTH);
}
if (optional_string("+Tech Description:")) {
stuff_malloc_string(&sip->tech_desc, F_MULTITEXT, NULL, SHIP_MULTITEXT_LENGTH);
}
@@ -1362,88 +1329,6 @@ int parse_ship_values(ship_info* sip, bool isTemplate, bool first_time, bool rep
}
}
if(optional_string("$Collision Physics:"))
{
if(optional_string("+Bounce:")) {
stuff_float(&sip->collision_physics.bounce);
}
if(optional_string("+Both Small Bounce:")) {
stuff_float(&sip->collision_physics.both_small_bounce);
}
if(optional_string("+Friction:")) {
stuff_float(&sip->collision_physics.friction);
}
if(optional_string("+Rotation Factor:")) {
stuff_float(&sip->collision_physics.friction);
}
if(optional_string("+Landing Max Forward Vel:")) {
stuff_float(&sip->collision_physics.landing_max_z);
}
if(optional_string("+Landing Min Forward Vel:")) {
stuff_float(&sip->collision_physics.landing_min_z);
}
if(optional_string("+Landing Max Descent Vel:")) {
stuff_float(&sip->collision_physics.landing_min_y);
sip->collision_physics.landing_min_y *= -1;
}
if(optional_string("+Landing Max Horizontal Vel:")) {
stuff_float(&sip->collision_physics.landing_max_x);
}
if(optional_string("+Landing Max Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.landing_max_angle = cos(ANG_TO_RAD(90 - degrees));
}
if(optional_string("+Landing Min Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.landing_min_angle = cos(ANG_TO_RAD(90 - degrees));
}
if(optional_string("+Landing Max Rotate Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.landing_max_rot_angle = cos(ANG_TO_RAD(90 - degrees));
}
if(optional_string("+Reorient Max Forward Vel:")) {
stuff_float(&sip->collision_physics.reorient_max_z);
}
if(optional_string("+Reorient Min Forward Vel:")) {
stuff_float(&sip->collision_physics.reorient_min_z);
}
if(optional_string("+Reorient Max Descent Vel:")) {
stuff_float(&sip->collision_physics.reorient_min_y);
sip->collision_physics.reorient_min_y *= -1;
}
if(optional_string("+Reorient Max Horizontal Vel:")) {
stuff_float(&sip->collision_physics.reorient_max_x);
}
if(optional_string("+Reorient Max Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.reorient_max_angle = cos(ANG_TO_RAD(90 - degrees));
}
if(optional_string("+Reorient Min Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.reorient_min_angle = cos(ANG_TO_RAD(90 - degrees));
}
if(optional_string("+Reorient Max Rotate Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.reorient_max_rot_angle = cos(ANG_TO_RAD(90 - degrees));
}
if(optional_string("+Reorient Speed Mult:")) {
stuff_float(&sip->collision_physics.reorient_mult);
}
if(optional_string("+Landing Rest Angle:")) {
float degrees;
stuff_float(&degrees);
sip->collision_physics.landing_rest_angle = cos(ANG_TO_RAD(90 - degrees));
}
parse_sound("+Landing Sound:", &sip->collision_physics.landing_sound_idx, sip->name);
}
if(optional_string("$Debris:"))
{
if(optional_string("+Min Lifetime:")) {
@@ -2942,7 +2827,7 @@ strcpy_s(parse_error_text, temp_error);
sp->engine_wash_pointer = get_engine_wash_pointer(name_tmp);
if(sp->engine_wash_pointer == NULL)
WarningEx(LOCATION,"Invalid engine wash name %s specified for subsystem %s in ship class %s", name_tmp, sp->subobj_name, sip->name);
Warning(LOCATION,"Invalid engine wash name %s specified for subsystem %s in ship class %s", name_tmp, sp->subobj_name, sip->name);
}
parse_sound("$AliveSnd:", &sp->alive_snd, sp->subobj_name);
@@ -3026,10 +2911,6 @@ strcpy_s(parse_error_text, temp_error);
if (optional_string("$Flags:")) {
parse_string_flag_list((int*)&sp->flags, Subsystem_flags, Num_subsystem_flags);
//If we've set any subsystem as landable, set a ship-info flag as a shortcut for later
if (sp->flags & MSS_FLAG_ALLOW_LANDING)
sip->flags2 |= SIF2_ALLOW_LANDINGS;
}
if (optional_string("+non-targetable")) {
@@ -3780,7 +3661,7 @@ void ship_parse_post_cleanup()
// ultra stupid compatbility handling for the once broken "generate hud" flag.
// it was previously testing the afterburner flag, so that's what we check for that
if ( (sip->shield_icon_index == 255) && (sip->flags & SIF_AFTERBURNER)
&& !(sip->flags2 & SIF2_GENERATE_HUD_ICON) && (sip->flags & SIF_PLAYER_SHIP) )
&& !(sip->flags2 & SIF2_GENERATE_HUD_ICON) )
{
Warning(LOCATION, "Compatibility warning:\nNo shield icon specified for '%s' but the \"generate icon\" flag is not specified.\nEnabling flag by default.\n", sip->name);
sip->flags2 |= SIF2_GENERATE_HUD_ICON;
@@ -4249,8 +4130,6 @@ void ship_set_warp_effects(object *objp, ship_info *sip)
switch(sip->warpin_type)
{
case WT_DEFAULT:
case WT_KNOSSOS:
case WT_DEFAULT_THEN_KNOSSOS:
shipp->warpin_effect = new WE_Default(objp, WD_WARP_IN);
break;
case WT_IN_PLACE_ANIM:
@@ -4272,8 +4151,6 @@ void ship_set_warp_effects(object *objp, ship_info *sip)
switch(sip->warpout_type)
{
case WT_DEFAULT:
case WT_KNOSSOS:
case WT_DEFAULT_THEN_KNOSSOS:
shipp->warpout_effect = new WE_Default(objp, WD_WARP_OUT);
break;
case WT_IN_PLACE_ANIM:
@@ -4973,7 +4850,6 @@ int subsys_set(int objnum, int ignore_subsys_info)
ship_system->turret_time_enemy_in_range = 0.0f;
ship_system->disruption_timestamp=timestamp(0);
ship_system->turret_pick_big_attack_point_timestamp = timestamp(0);
ship_system->scripting_target_override = false;
vm_vec_zero(&ship_system->turret_big_attack_point);
for(j = 0; j < NUM_TURRET_ORDER_TYPES; j++)
{
@@ -5528,14 +5404,13 @@ void ship_render(object * obj)
//it is specified
//it isn't assigned already
//start sound doesn't exist or has finished
if (!Cmdline_freespace_no_sound)
if(mtp->loop_snd >= 0
&& shipp->thrusters_sounds[i] < 0
&& (mtp->start_snd < 0 || (snd_get_duration(mtp->start_snd) < timestamp() - shipp->thrusters_start[i]))
)
{
shipp->thrusters_sounds[i] = obj_snd_assign(OBJ_INDEX(obj), mtp->loop_snd, &mtp->pos, 1);
}
if(mtp->loop_snd >= 0
&& shipp->thrusters_sounds[i] < 0
&& (mtp->start_snd < 0 || (snd_get_duration(mtp->start_snd) < timestamp() - shipp->thrusters_start[i]))
)
{
shipp->thrusters_sounds[i] = obj_snd_assign(OBJ_INDEX(obj), mtp->loop_snd, &mtp->pos, 1);
}
//Draw graphics
//Skip invalid ones
@@ -7796,9 +7671,9 @@ void ship_set_default_weapons(ship *shipp, ship_info *sip)
for ( i = sip->num_primary_banks; i < pm->n_guns; i++ ) {
// Make unspecified weapon for bank be a laser
for ( j = 0; j < Num_player_weapon_precedence; j++ ) {
Assertion((Player_weapon_precedence[j] > 0), "Error reading player weapon precedence list. Check weapons.tbl for $Player Weapon Precedence entry, and correct as necessary.\n");
Assert(Player_weapon_precedence[j] > 0);
int weapon_id = Player_weapon_precedence[j];
if ( (Weapon_info[weapon_id].subtype == WP_LASER) || (Weapon_info[weapon_id].subtype == WP_BEAM) ) {
if (Weapon_info[weapon_id].subtype & (WP_LASER || WP_BEAM)) {
swp->primary_bank_weapons[i] = weapon_id;
break;
}
@@ -7821,7 +7696,7 @@ void ship_set_default_weapons(ship *shipp, ship_info *sip)
for ( j = 0; j < Num_player_weapon_precedence; j++ ) {
Assert(Player_weapon_precedence[j] > 0);
int weapon_id = Player_weapon_precedence[j];
if (Weapon_info[weapon_id].subtype == WP_MISSILE) {
if (Weapon_info[weapon_id].subtype & WP_MISSILE) {
swp->secondary_bank_weapons[i] = weapon_id;
break;
}
@@ -8354,7 +8229,6 @@ void change_ship_type(int n, int ship_type, int by_sexp)
ship_info *sip_orig;
ship *sp;
ship_weapon *swp;
ship_subsys *ss;
object *objp;
p_object *p_objp;
float hull_pct, shield_pct;
@@ -8366,71 +8240,37 @@ void change_ship_type(int n, int ship_type, int by_sexp)
swp = &sp->weapons;
sip_orig = &Ship_info[sp->ship_info_index];
objp = &Objects[sp->objnum];
ph_inf = objp->phys_info;
// Goober5000 - maintain the original hull, shield, and subsystem percentages... gah
// hull
if (sp->special_hitpoints) {
hull_pct = objp->hull_strength / sp->ship_max_hull_strength;
} else {
Assert( Ship_info[sp->ship_info_index].max_hull_strength > 0.0f );
hull_pct = objp->hull_strength / Ship_info[sp->ship_info_index].max_hull_strength;
}
// extra check
Assert(hull_pct > 0.0f && hull_pct <= 1.0f);
if (hull_pct <= 0.0f) hull_pct = 0.1f;
if (hull_pct > 1.0f) hull_pct = 1.0f;
// shield
if (sp->special_shield > 0) {
shield_pct = shield_get_strength(objp) / sp->ship_max_shield_strength;
} else if (Ship_info[sp->ship_info_index].max_shield_strength > 0.0f) {
shield_pct = shield_get_strength(objp) / Ship_info[sp->ship_info_index].max_shield_strength;
} else {
shield_pct = 0.0f;
}
// extra check
Assert(shield_pct >= 0.0f && shield_pct <= 1.0f);
if (shield_pct < 0.0f) shield_pct = 0.0f;
if (shield_pct > 1.0f) shield_pct = 1.0f;
// subsystems
int num_saved_subsystems = 0;
char **subsys_names = new char *[sip_orig->n_subsystems];
float *subsys_pcts = new float[sip_orig->n_subsystems];
ss = GET_FIRST(&sp->subsys_list);
while ( ss != END_OF_LIST(&sp->subsys_list) )
// Goober5000 - maintain the original hull and shield percentages when called by sexp
if (by_sexp)
{
if (num_saved_subsystems == sip_orig->n_subsystems)
{
Error(LOCATION, "Subsystem mismatch while changing ship class from '%s' to '%s'!", sip_orig->name, sip->name);
break;
// hull
if (sp->special_hitpoints) {
hull_pct = objp->hull_strength / sp->ship_max_hull_strength;
} else {
Assert( Ship_info[sp->ship_info_index].max_hull_strength > 0.0f );
hull_pct = objp->hull_strength / Ship_info[sp->ship_info_index].max_hull_strength;
}
// save subsys information
subsys_names[num_saved_subsystems] = new char[NAME_LENGTH];
strcpy(subsys_names[num_saved_subsystems], ss->system_info->subobj_name);
// shield
if (sp->special_shield > 0) {
shield_pct = shield_get_strength(objp) / sp->ship_max_shield_strength;
} else if (Ship_info[sp->ship_info_index].max_shield_strength > 0.0f) {
shield_pct = shield_get_strength(objp) / Ship_info[sp->ship_info_index].max_shield_strength;
} else {
shield_pct = 0.0f;
}
if (ss->max_hits > 0.0f)
subsys_pcts[num_saved_subsystems] = ss->current_hits / ss->max_hits;
else
subsys_pcts[num_saved_subsystems] = ss->max_hits;
// extra check
Assert(subsys_pcts[num_saved_subsystems] >= 0.0f && subsys_pcts[num_saved_subsystems] <= 1.0f);
if (subsys_pcts[num_saved_subsystems] < 0.0f) subsys_pcts[num_saved_subsystems] = 0.0f;
if (subsys_pcts[num_saved_subsystems] > 1.0f) subsys_pcts[num_saved_subsystems] = 1.0f;
num_saved_subsystems++;
ss = GET_NEXT(ss);
// physics
ph_inf = objp->phys_info;
}
// set to 100% otherwise
else
{
hull_pct = 1.0f;
shield_pct = 1.0f;
}
// make sure that shields are disabled/enabled if they need to be - Chief1983
if (!Fred_running) {
p_objp = mission_parse_get_parse_object(sp->ship_name);
@@ -8446,6 +8286,15 @@ void change_ship_type(int n, int ship_type, int by_sexp)
}
}
// Goober5000 - extra checks
Assert(hull_pct > 0.0f && hull_pct <= 1.0f);
Assert(shield_pct >= 0.0f && shield_pct <= 1.0f);
if (hull_pct <= 0.0f) hull_pct = 0.1f;
if (hull_pct > 1.0f) hull_pct = 1.0f;
if (shield_pct < 0.0f) shield_pct = 0.0f;
if (shield_pct > 1.0f) shield_pct = 1.0f;
// point to new ship data
ship_model_change(n, ship_type);
sp->ship_info_index = ship_type;
@@ -8497,36 +8346,8 @@ void change_ship_type(int n, int ship_type, int by_sexp)
// fix up the subsystems
subsys_set( sp->objnum );
// Goober5000 - restore the subsystem percentages
ss = GET_FIRST(&sp->subsys_list);
while ( ss != END_OF_LIST(&sp->subsys_list) )
{
for (i = 0; i < num_saved_subsystems; i++)
{
if (!subsystem_stricmp(ss->system_info->subobj_name, subsys_names[i]))
{
ss->current_hits = ss->max_hits * subsys_pcts[i];
break;
}
}
ss = GET_NEXT(ss);
}
ship_recalc_subsys_strength(sp);
// now free the memory
for (i = 0; i < sip_orig->n_subsystems; i++)
delete[] subsys_names[i];
delete [] subsys_names;
delete [] subsys_pcts;
// DONE WITH PERCENTAGE STUFF
sp->afterburner_fuel = MAX(0, sip->afterburner_fuel_capacity - (sip_orig->afterburner_fuel_capacity - sp->afterburner_fuel));
sp->cmeasure_count = MAX(0, sip->cmeasure_max - (sip_orig->cmeasure_max - sp->cmeasure_count));
// avoid cases where either of these are 0
@@ -11104,7 +10925,7 @@ void ship_model_start(object *objp)
case SUBSYSTEM_ACTIVATION:
break;
case SUBSYSTEM_TURRET:
Assertion( !(psub->flags & MSS_FLAG_ROTATES), "Turret %s on ship %s has the $rotate or $triggered subobject property defined. Please fix the model.\n", psub->name, Ship_info[shipp->ship_info_index].name ); // Turrets can't rotate!!! See John!
Assert( !(psub->flags & MSS_FLAG_ROTATES) ); // Turrets can't rotate!!! See John!
break;
default:
Error(LOCATION, "Illegal subsystem type.\n");
@@ -12046,7 +11867,6 @@ int ship_do_rearm_frame( object *objp, float frametime )
// function which is used to find a repair ship to repair requester_obj. the way repair ships will work
// is:
// if repair ship present and ordered to depart, return NULL.
// if repair ship present and available, return pointer to that object.
// If repair ship present and busy, possibly return that object if he can satisfy the request soon enough.
// If repair ship present and busy and cannot satisfy request, return NULL to warp a new one in if below max number
@@ -12095,14 +11915,6 @@ object *ship_find_repair_ship( object *requester_obj )
continue;
}
/* Ship has been ordered to warpout but has not had a chance to
process the order.*/
Assert( Ships[objp->instance].ai_index != -1 );
ai_info* aip = &(Ai_info[Ships[objp->instance].ai_index]);
if ( ai_find_goal_index( aip->goals, AI_GOAL_WARP ) != -1 ) {
continue;
}
dist = vm_vec_dist_quick(&objp->pos, &requester_obj->pos);
if (!(Ai_info[shipp->ai_index].ai_flags & AIF_REPAIRING))
@@ -13042,10 +12854,12 @@ int ship_return_subsys_path_normal(ship *shipp, ship_subsys *ss, vec3d *gsubpos,
pm = model_get(Ship_info[shipp->ship_info_index].model_num);
Assert( pm != NULL );
// possibly a bad model?
Assertion(ss->system_info->path_num <= pm->n_paths, "Too many paths in '%s'! Max is %i and the requested path was %i for subsystem '%s'!\n", pm->filename, pm->n_paths, ss->system_info->path_num, ss->system_info->subobj_name);
if (ss->system_info->path_num > pm->n_paths)
if (ss->system_info->path_num > pm->n_paths) {
// possibly a bad model?
mprintf(("WARNING: Too many paths in '%s'! Max is %i and the requested path was %i for subsystem '%s'!\n", pm->filename, pm->n_paths, ss->system_info->path_num, ss->system_info->subobj_name));
// Int3();
return 1;
}
mp = &pm->paths[ss->system_info->path_num];
if ( mp->nverts >= 2 ) {
@@ -14917,10 +14731,6 @@ int is_support_allowed(object *objp)
{
// check updated mission conditions to allow support
// If running under autopilot support is not allowed
if ( AutoPilotEngaged )
return 0;
// none allowed
if (The_mission.support_ships.max_support_ships == 0)
return 0;
+7 -53
View File
@@ -259,7 +259,6 @@ typedef struct ship_subsys {
float optimum_range;
float favor_current_facing;
ship_subsys *targeted_subsys; // subsystem this turret is attacking
bool scripting_target_override;
int turret_pick_big_attack_point_timestamp; // Next time to pick an attack point for this turret
vec3d turret_big_attack_point; // local coordinate of point for this turret to attack on enemy
@@ -816,10 +815,8 @@ extern int ship_find_exited_ship_by_signature( int signature);
#define SIF2_NO_THRUSTER_GEO_NOISE (1 << 8) // Echelon9 - No thruster geometry noise.
#define SIF2_INTRINSIC_NO_SHIELDS (1 << 9) // Chief - disables shields for this ship even without No Shields in mission.
#define SIF2_NO_PRIMARY_LINKING (1 << 10) // Chief - slated for 3.7 originally, but this looks pretty simple to implement.
#define SIF2_NO_PAIN_FLASH (1 << 11) // The E - disable red pain flash
#define SIF2_ALLOW_LANDINGS (1 << 12) // SUSHI: Automatically set if any subsystems allow landings (as a shortcut)
// !!! IF YOU ADD A FLAG HERE BUMP MAX_SHIP_FLAGS !!!
#define MAX_SHIP_FLAGS 13 // Number of distinct flags for flags field in ship_info struct
#define MAX_SHIP_FLAGS 11 // Number of distinct flags for flags field in ship_info struct
#define SIF_DEFAULT_VALUE 0
#define SIF2_DEFAULT_VALUE 0
@@ -982,51 +979,10 @@ typedef struct man_thruster {
} man_thruster;
//Warp type defines
#define WT_DEFAULT 0
#define WT_KNOSSOS 1
#define WT_DEFAULT_THEN_KNOSSOS 2
#define WT_IN_PLACE_ANIM 3
#define WT_SWEEPER 4
#define WT_HYPERSPACE 5
// Holds variables for collision physics (Gets its own struct purely for clarity purposes)
// Most of this only really applies properly to small ships
typedef struct ship_collision_physics {
// Collision physics definitions: how a ship responds to collisions
float both_small_bounce; // Bounce factor when both ships are small
// This currently only comes into play if one ship is the player...
// blame retail for that.
float bounce; // Bounce factor for all other cases
float friction; // Controls lateral velocity lost when colliding with a large ship
float rotation_factor; // Affects the rotational energy of collisions... TBH not sure how.
// Speed & angle constraints for a smooth landing
// Note that all angles are stored as a dotproduct between normalized vectors instead. This saves us from having
// to do a lot of dot product calculations later.
float landing_max_z;
float landing_min_z;
float landing_min_y;
float landing_max_x;
float landing_max_angle;
float landing_min_angle;
float landing_max_rot_angle;
// Speed & angle constraints for a "rough" landing (one with normal collision consequences, but where
// the ship is still reoriented towards its resting orientation)
float reorient_max_z;
float reorient_min_z;
float reorient_min_y;
float reorient_max_x;
float reorient_max_angle;
float reorient_min_angle;
float reorient_max_rot_angle;
// Landing response parameters
float reorient_mult; // How quickly the ship will reorient towards it's resting position
float landing_rest_angle; // The vertical angle where the ship's orientation comes to rest
int landing_sound_idx; //Sound to play on successful landing collisions
} ship_collision_physics;
#define WT_DEFAULT 0
#define WT_IN_PLACE_ANIM 1
#define WT_SWEEPER 2
#define WT_HYPERSPACE 3
// The real FreeSpace ship_info struct.
typedef struct ship_info {
@@ -1042,7 +998,6 @@ typedef struct ship_info {
char *manufacturer_str; // string used by tooltips
char *desc; // string used by tooltips
char *tech_desc; // string used by tech database
char tech_title[NAME_LENGTH]; // ship's name (in tech database)
char *ship_length; // string used by multiplayer ship desc
char *gun_mounts; // string used by multiplayer ship desc
@@ -1098,8 +1053,7 @@ typedef struct ship_info {
float max_speed, min_speed, max_accel;
//Collision
int collision_damage_type_idx;
ship_collision_physics collision_physics;
int collision_damage_type_idx;
// ship explosion info
shockwave_create_info shockwave;
+13 -13
View File
@@ -3853,14 +3853,18 @@ int WE_Default::warpStart()
HUD_printf(NOX("Subspace drive engaged"));
}
int portal_objnum;
if (direction == WD_WARP_IN)
portal_objnum = shipp->special_warpin_objnum;
else if (direction == WD_WARP_OUT)
portal_objnum = shipp->special_warpout_objnum;
else
portal_objnum = -1;
portal_objp = NULL;
if ((direction == WD_WARP_IN) && shipfx_special_warp_objnum_valid(shipp->special_warpin_objnum))
if(portal_objnum >= 0 && shipfx_special_warp_objnum_valid(portal_objnum))
{
portal_objp = &Objects[shipp->special_warpin_objnum];
}
else if ((direction == WD_WARP_OUT) && shipfx_special_warp_objnum_valid(shipp->special_warpout_objnum))
{
portal_objp = &Objects[shipp->special_warpout_objnum];
portal_objp = &Objects[portal_objnum];
}
float warpout_speed = 0.0f;
@@ -3892,7 +3896,7 @@ int WE_Default::warpStart()
if (direction == WD_WARP_OUT)
{
// maybe special warpout
int fireball_type = ((portal_objp != NULL) || (sip->warpout_type == WT_KNOSSOS) || (sip->warpout_type == WT_DEFAULT_THEN_KNOSSOS)) ? FIREBALL_KNOSSOS : FIREBALL_WARP;
int fireball_type = ((portal_objp != NULL) || Cmdline_tbp) ? FIREBALL_KNOSSOS : FIREBALL_WARP;
// create fireball
warp_objnum = fireball_create(&pos, fireball_type, FIREBALL_WARP_EFFECT, OBJ_INDEX(objp), radius, 1, NULL, warp_time, shipp->ship_info_index, NULL, 0, 0, sip->warpout_snd_start, sip->warpout_snd_end);
@@ -3900,7 +3904,7 @@ int WE_Default::warpStart()
else if (direction == WD_WARP_IN)
{
// maybe special warpin
int fireball_type = ((portal_objp != NULL) || (sip->warpin_type == WT_KNOSSOS)) ? FIREBALL_KNOSSOS : FIREBALL_WARP;
int fireball_type = (portal_objp != NULL) ? FIREBALL_KNOSSOS : FIREBALL_WARP;
// create fireball
warp_objnum = fireball_create(&pos, fireball_type, FIREBALL_WARP_EFFECT, OBJ_INDEX(objp), radius, 0, NULL, warp_time, shipp->ship_info_index, NULL, 0, 0, sip->warpin_snd_start, sip->warpin_snd_end);
@@ -3918,11 +3922,8 @@ int WE_Default::warpStart()
return 0;
}
fvec = Objects[warp_objnum].orient.vec.fvec;
// G5K 6/26/2010 this should no longer be needed
/*
// maybe negate if special warp effect
fvec = Objects[warp_objnum].orient.vec.fvec;
if (portal_objp != NULL)
{
float dot = vm_vec_dotprod(&fvec, &objp->orient.vec.fvec);
@@ -3933,7 +3934,6 @@ int WE_Default::warpStart()
vm_vec_negate(&fvec);
}
}
*/
stage_time_start = total_time_start = timestamp();
if(direction == WD_WARP_IN)
+1 -1
View File
@@ -1910,7 +1910,7 @@ static void ship_do_damage(object *ship_obj, object *other_obj, vec3d *hitpos, f
// apply pain to me
// Goober5000: make sure other_obj doesn't cause a read violation!
if (other_obj && !(Ship_info[Ships[Player_obj->instance].ship_info_index].flags2 & SIF2_NO_PAIN_FLASH))
if (other_obj)
{
// For the record, ship_hit_pain seems to simply be the red flash that appears
// on the screen when you're hit.
+9 -110
View File
@@ -14,7 +14,6 @@
#include "sound/audiostr.h"
#include "cmdline/cmdline.h"
#include "osapi/osapi.h"
#include "globalincs/vmallocator.h"
#include "gamesnd/gamesnd.h"
#include "globalincs/alphacolors.h"
@@ -56,20 +55,6 @@ float Master_voice_volume = 0.7f; // range is 0 -> 1, used for all voice playbac
unsigned int SND_ENV_DEFAULT = 0;
//For the adjust-audio-volume sexp
float aav_voice_volume = 1.0f;
float aav_music_volume = 1.0f;
float aav_effect_volume = 1.0f;
struct aav {
float start_volume;
float delta;
float start_time;
int delta_time;
};
aav aav_data[3];
// min volume to play a sound after all volume processing (range is 0.0 -> 1.0)
#define MIN_SOUND_VOLUME 0.05f
@@ -137,8 +122,6 @@ int snd_init()
mprintf(("Could not initialize the OGG vorbis converter.\n"));
}
snd_aav_init();
// Init the audio streaming stuff
audiostream_init();
@@ -197,7 +180,7 @@ void snd_spew_debug_info()
int message_sounds = 0;
int interface_sounds = 0;
int done = 0;
size_t s_idx;
int s_idx;
if(!Sound_spew){
return;
@@ -212,7 +195,7 @@ void snd_spew_debug_info()
done = 0;
// what kind of sound is this
for(s_idx=0; s_idx < Snds.size(); s_idx++){
for(s_idx=0; s_idx<Num_game_sounds; s_idx++){
if(!stricmp(Snds[s_idx].filename, Sounds[idx].filename)){
game_sounds++;
done = 1;
@@ -220,7 +203,7 @@ void snd_spew_debug_info()
}
if(!done){
for(s_idx=0; s_idx < Snds.size(); s_idx++){
for(s_idx=0; s_idx<Num_game_sounds; s_idx++){
if(!stricmp(Snds_iface[s_idx].filename, Sounds[idx].filename)){
interface_sounds++;
done = 1;
@@ -512,9 +495,9 @@ int snd_play( game_snd *gs, float pan, float vol_scale, int priority, bool is_vo
volume = gs->default_volume * vol_scale;
if ( gs->flags&GAME_SND_VOICE ) {
volume *= (Master_voice_volume * aav_voice_volume);
volume *= Master_voice_volume;
} else {
volume *= (Master_sound_volume * aav_effect_volume);
volume *= Master_sound_volume;
}
if ( volume > 1.0f )
volume = 1.0f;
@@ -634,7 +617,7 @@ int snd_play_3d(game_snd *gs, vec3d *source_pos, vec3d *listen_pos, float radius
}
}
volume *= (Master_sound_volume * aav_effect_volume);
volume *= Master_sound_volume;
if ( (volume < MIN_SOUND_VOLUME) && !force) {
return -1;
}
@@ -652,7 +635,7 @@ int snd_play_3d(game_snd *gs, vec3d *source_pos, vec3d *listen_pos, float radius
handle = ds_play(snd->sid, gs->id_sig, ds_priority(priority), volume / gs->default_volume, pan, looping);
} else {
handle = ds3d_play(snd->sid, gs->id_sig, source_pos, source_vel, min_range, max_range, looping, (max_volume*Master_sound_volume*aav_effect_volume), volume, ds_priority(priority));
handle = ds3d_play(snd->sid, gs->id_sig, source_pos, source_vel, min_range, max_range, looping, (max_volume*Master_sound_volume), volume, ds_priority(priority));
}
return handle;
@@ -801,7 +784,7 @@ int snd_play_looping( game_snd *gs, float pan, int start_loop, int stop_loop, fl
return -1;
volume = gs->default_volume * vol_scale;
volume *= (Master_sound_volume * aav_effect_volume);
volume *= Master_sound_volume;
if ( volume > 1.0f )
volume = 1.0f;
@@ -858,7 +841,7 @@ void snd_set_volume( int sig, float volume )
return;
}
new_volume = volume * (Master_sound_volume * aav_effect_volume);
new_volume = volume * Master_sound_volume;
ds_set_volume( channel, new_volume );
}
@@ -1037,11 +1020,6 @@ int snd_get_duration(int snd_id)
if ( snd_id < 0 )
return 0;
Assert( !Sounds.empty() );
if ( Sounds.empty() )
return 0;
return Sounds[snd_id].duration;
}
@@ -1346,13 +1324,8 @@ int sound_env_supported()
// Called once per game frame
//
void adjust_volume_on_frame(float* volume_now, aav* data);
void snd_do_frame()
{
adjust_volume_on_frame(&aav_music_volume, &aav_data[AAV_MUSIC]);
adjust_volume_on_frame(&aav_voice_volume, &aav_data[AAV_VOICE]);
adjust_volume_on_frame(&aav_effect_volume, &aav_data[AAV_EFFECTS]);
ds_do_frame();
}
@@ -1393,77 +1366,3 @@ int snd_get_samples_per_measure(char *filename, float num_measures)
// ok, now return the samples per measure (which is half of bytes_per_measure)
return (bytes_per_measure / 2);
}
void snd_adjust_audio_volume(int type, float percent, int time)
{
Assert( type >= 0 && type < 4 );
switch (type) {
case AAV_MUSIC:
aav_data[type].start_volume = aav_music_volume;
if (percent < aav_music_volume)
aav_data[type].delta = (aav_music_volume - percent) * -1.0f;
else
aav_data[type].delta = percent - aav_music_volume;
break;
case AAV_VOICE:
aav_data[type].start_volume = aav_voice_volume;
if (percent < aav_voice_volume)
aav_data[type].delta = (aav_voice_volume - percent) * -1.0f;
else
aav_data[type].delta = percent - aav_voice_volume;
break;
case AAV_EFFECTS:
aav_data[type].start_volume = aav_effect_volume;
if (percent < aav_effect_volume)
aav_data[type].delta = (aav_effect_volume - percent) * -1.0f;
else
aav_data[type].delta = percent - aav_effect_volume;
break;
}
aav_data[type].delta_time = time;
aav_data[type].start_time = (f2fl(Missiontime) * 1000);
}
void adjust_volume_on_frame(float* volume_now, aav* data)
{
if (Missiontime == 0){
return;
}
if (*volume_now == (data->start_volume + data->delta))
return;
float msMissiontime = (f2fl(Missiontime) * 1000);
if ( msMissiontime > ( data->start_time + data->delta_time) ) {
*volume_now = data->start_volume + data->delta;
return;
}
float done = 0.0f;
//How much change do we need?
if (data->delta_time == 0)
done = 1.0f;
else
done =(float) (msMissiontime - data->start_time)/data->delta_time;
//apply change
*volume_now = data->start_volume + (data->delta * done);
CLAMP(*volume_now, 0.0f, 1.0f);
}
void snd_aav_init()
{
aav_music_volume = 1.0f;
aav_voice_volume = 1.0f;
aav_effect_volume = 1.0f;
for (int i = 0; i < 3; i++) {
aav_data[i].delta = 0.0f;
aav_data[i].start_volume = 1.0f;
aav_data[i].delta_time = 0;
aav_data[i].start_time = 0.0f;
}
}
+2 -14
View File
@@ -28,14 +28,9 @@
#define SND_PRIORITY_DOUBLE_INSTANCE 2
#define SND_PRIORITY_TRIPLE_INSTANCE 3
//For the adjust-audio-volume sexp
#define AAV_MUSIC 0
#define AAV_VOICE 1
#define AAV_EFFECTS 2
typedef struct game_snd
{
int sig; // index number of sound in as specified in sounds.tbl
int sig; // number of sound in sounds.tbl (not used)
char filename[MAX_FILENAME_LEN];
float default_volume; // range: 0.0 -> 1.0
int min, max; // min: distance at which sound will stop getting louder max: distance at which sound is inaudible
@@ -67,9 +62,6 @@ extern float Master_sound_volume; // 0 -> 1.0
extern float Master_voice_volume; // 0 -> 1.0
extern int Snd_sram; // System memory consumed by sound data
extern int Snd_hram; // Soundcard memory consumed by sound data
extern float aav_voice_volume;
extern float aav_music_volume;
extern float aav_effect_volume;
//int snd_load( char *filename, int hardware=0, int three_d=0, int *sig=NULL );
int snd_load( game_snd *gs, int allow_hardware_load = 0);
@@ -145,7 +137,6 @@ int snd_num_playing();
int snd_get_data(int handle, char *data);
int snd_size(int handle, int *size);
void snd_do_frame();
void snd_adjust_audio_volume(int type, float percent, int time);
// repositioning of the sound buffer pointer
void snd_rewind(int snd_handle, game_snd *sg, float seconds); // rewind N seconds from the current position
@@ -169,7 +160,4 @@ int sound_env_get(sound_env *se, int preset = -1);
int sound_env_disable();
int sound_env_supported();
// adjust-audio-volume
void snd_aav_init();
#endif
#endif
+2 -2
View File
@@ -424,9 +424,9 @@ int targa_read_header(char *real_filename, CFILE *img_cfp, int *w, int *h, int *
cfclose(targa_file);
targa_file = NULL;
}
if ( (header.pixel_depth != 16) && (header.pixel_depth != 24) && (header.pixel_depth != 32) ) {
Assertion( (header.pixel_depth != 16) && (header.pixel_depth != 24) && (header.pixel_depth != 32), "Invalid colour depth (%d) in header of tga file %s\n", header.pixel_depth, real_filename );
Int3();
return TARGA_ERROR_READING;
}
+1 -1
View File
@@ -2763,7 +2763,7 @@ void beam_handle_collisions(beam *b)
}
if (wi->wi_flags & WIF_HUGE) {
if (Objects[target].type == OBJ_SHIP) {
if (Objects[target].type & OBJ_SHIP) {
ship_type_info *sti;
sti = ship_get_type_info(&Objects[target]);
if (sti->weapon_bools & STI_WEAP_NO_HUGE_IMPACT_EFF)
+2 -2
View File
@@ -184,8 +184,8 @@ void mflash_page_in(bool load_all)
// blobs
for ( idx = 0; idx < Mflash_info[i].blobs.size(); idx++) {
Mflash_info[i].blobs[idx].anim_id = bm_load_either(Mflash_info[i].blobs[idx].name, &num_frames, &fps, NULL, 1);
Assertion( (Mflash_info[i].blobs[idx].anim_id >= 0), "Failed to load muzzle flash animation %s\n", Mflash_info[i].blobs[idx].name );
Mflash_info[i].blobs[idx].anim_id = bm_load_animation(Mflash_info[i].blobs[idx].name, &num_frames, &fps, NULL, 1);
Assert( Mflash_info[i].blobs[idx].anim_id >= 0 );
bm_page_in_xparent_texture( Mflash_info[i].blobs[idx].anim_id );
}
}
+1 -17
View File
@@ -350,19 +350,10 @@ void shockwave_move(object *shockwave_objp, float frametime)
}
// blast ships and asteroids
// And (some) weapons
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if ( (objp->type != OBJ_SHIP) && (objp->type != OBJ_ASTEROID) && (objp->type != OBJ_WEAPON)) {
if ( (objp->type != OBJ_SHIP) && (objp->type != OBJ_ASTEROID) ) {
continue;
}
if ( objp->type == OBJ_WEAPON ) {
// only apply to missiles with hitpoints
weapon_info* wip = &Weapon_info[Weapons[objp->instance].weapon_info_index];
if (wip->weapon_hitpoints <= 0 || !(wip->wi_flags2 & WIF2_TAKES_SHOCKWAVE_DAMAGE))
continue;
}
if ( objp->type == OBJ_SHIP ) {
// don't blast navbuoys
@@ -401,13 +392,6 @@ void shockwave_move(object *shockwave_objp, float frametime)
case OBJ_ASTEROID:
asteroid_hit(objp, NULL, NULL, damage);
break;
case OBJ_WEAPON:
objp->hull_strength -= damage;
if (objp->hull_strength < 0.0f) {
Weapons[objp->instance].lifeleft = 0.01f;
Weapons[objp->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
}
break;
default:
Int3();
break;
-2
View File
@@ -104,8 +104,6 @@ extern int Num_weapon_subtypes;
#define WIF2_CAPITAL_PLUS (1 << 23) // AI will not use this weapon on fighters or bombers
#define WIF2_EXTERNAL_WEAPON_FP (1 << 24) // will try to use external models FPs if possible
#define WIF2_EXTERNAL_WEAPON_LNCH (1 << 25) // render external secondary as a launcher
#define WIF2_TAKES_BLAST_DAMAGE (1 << 26) // This weapon can take blast damage
#define WIF2_TAKES_SHOCKWAVE_DAMAGE (1 << 27) // This weapon can take shockwave damage
#define WIF_HOMING (WIF_HOMING_HEAT | WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
#define WIF_LOCKED_HOMING (WIF_HOMING_ASPECT | WIF_HOMING_JAVELIN)
+7 -21
View File
@@ -632,10 +632,6 @@ void parse_wi_flags(weapon_info *weaponp, int wi_flags, int wi_flags2)
weaponp->wi_flags2 |= WIF2_EXTERNAL_WEAPON_FP;
else if (!stricmp(NOX("external model launcher"), weapon_strings[i]))
weaponp->wi_flags2 |= WIF2_EXTERNAL_WEAPON_LNCH;
else if (!stricmp(NOX("takes blast damage"), weapon_strings[i]))
weaponp->wi_flags2 |= WIF2_TAKES_BLAST_DAMAGE;
else if (!stricmp(NOX("takes shockwave damage"), weapon_strings[i]))
weaponp->wi_flags2 |= WIF2_TAKES_SHOCKWAVE_DAMAGE;
else
Warning(LOCATION, "Bogus string in weapon flags: %s\n", weapon_strings[i]);
}
@@ -5383,6 +5379,11 @@ int weapon_area_calc_damage(object *objp, vec3d *pos, float inner_rad, float out
{
float dist, max_dist, min_dist;
// only blast ships and asteroids
if ( (objp->type != OBJ_SHIP) && (objp->type != OBJ_ASTEROID)) {
return -1;
}
max_dist = objp->radius + outer_rad;
dist = vm_vec_dist_quick(&objp->pos, pos);
if ( (dist > max_dist) || (dist > (limit+objp->radius)) ) {
@@ -5476,19 +5477,11 @@ void weapon_do_area_effect(object *wobjp, shockwave_create_info *sci, vec3d *pos
Assert(sci->inner_rad != 0);
// only blast ships and asteroids
// And (some) weapons
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if ( (objp->type != OBJ_SHIP) && (objp->type != OBJ_ASTEROID) && (objp->type != OBJ_WEAPON) ) {
if ( (objp->type != OBJ_SHIP) && (objp->type != OBJ_ASTEROID) ) {
continue;
}
if ( objp->type == OBJ_WEAPON ) {
// only apply to missiles with hitpoints
weapon_info* wip = &Weapon_info[Weapons[objp->instance].weapon_info_index];
if (wip->weapon_hitpoints <= 0 || !(wip->wi_flags2 & WIF2_TAKES_BLAST_DAMAGE))
continue;
}
if ( objp->type == OBJ_SHIP ) {
// don't blast navbuoys
if ( ship_get_SIF(objp->instance) & SIF_NAVBUOY ) {
@@ -5511,13 +5504,6 @@ void weapon_do_area_effect(object *wobjp, shockwave_create_info *sci, vec3d *pos
case OBJ_ASTEROID:
asteroid_hit(objp, NULL, NULL, damage);
break;
case OBJ_WEAPON:
objp->hull_strength -= damage;
if (objp->hull_strength < 0.0f) {
Weapons[objp->instance].lifeleft = 0.01f;
Weapons[objp->instance].weapon_flags |= WF_DESTROYED_BY_WEAPON;
}
break;
default:
Int3();
break;
@@ -5897,7 +5883,7 @@ void weapons_page_in()
}
default:
Assertion(wip->render_type != WRT_POF && wip->render_type != WRT_LASER, "Weapon %s does not have a valid rendering type. Type passed: %d\n", wip->name, wip->render_type); // Invalid weapon rendering type.
Int3(); // Invalid weapon rendering type.
}
wip->external_model_num = -1;
+1 -2
View File
@@ -11,7 +11,6 @@
// Goober5000 - now these warnings will only be disabled when compiling with MSVC :)
#if defined _MSC_VER
// 4002 is too many actual parameters for macro 'Assertion'
// 4100 is unreferenced formal parameters,
// 4127 is constant conditional (assert)
// 4201 nonstandard extension used: nameless struct/union (happens a lot in Windows include headers)
@@ -29,7 +28,7 @@
// So to disable this, I add in a stub function at the top of each module that does nothing.
// 4786 is identifier truncated to 255 characters (happens all the time in Microsoft #includes) -- Goober5000
// 4996 deprecated strcpy, strcat, sprintf, etc. (from MSVC 2005) - taylor
#pragma warning(disable: 4002 4100 4127 4201 4390 4410 4511 4512 4514 4611 4663 4710 4711 4725 4786 4996)
#pragma warning(disable: 4100 4127 4201 4390 4410 4511 4512 4514 4611 4663 4710 4711 4725 4786 4996)
#endif
+3760 -22983
View File
File diff suppressed because it is too large. Load diff
-86
View File
@@ -1,86 +0,0 @@
## libjpeg/Makefile.am for fs2_open
##
## $Id: Makefile.am,v 1.4 2005-07-07 16:36:58 taylor Exp $
EXTRA_DIST = README
# D_ variants are defaults and should always be used
AM_CFLAGS = @D_CFLAGS@ -Wno-main
AM_LDFLAGS = @D_LDFLAGS@
noinst_LIBRARIES = libjpeg.a
###############################################################################
##
## Begin JPEG library
##
libjpeg_a_SOURCES = \
cderror.h \
cdjpeg.h \
jcapimin.c \
jcapistd.c \
jccoefct.c \
jccolor.c \
jcdctmgr.c \
jchuff.c \
jchuff.h \
jcinit.c \
jcmainct.c \
jcmarker.c \
jcmaster.c \
jconfig_lnx.h \
jconfig_vc.h \
jcomapi.c \
jcparam.c \
jcphuff.c \
jcprepct.c \
jcsample.c \
jctrans.c \
jdapimin.c \
jdapistd.c \
jdatadst.c \
jdatasrc.c \
jdcoefct.c \
jdcolor.c \
jdct.h \
jddctmgr.c \
jdhuff.c \
jdhuff.h \
jdinput.c \
jdmainct.c \
jdmarker.c \
jdmaster.c \
jdmerge.c \
jdphuff.c \
jdpostct.c \
jdsample.c \
jdtrans.c \
jerror.c \
jerror.h \
jfdctflt.c \
jfdctfst.c \
jfdctint.c \
jidctflt.c \
jidctfst.c \
jidctint.c \
jidctred.c \
jinclude.h \
jmemansi.c \
jmemmgr.c \
jmemsys.h \
jmorecfg.h \
jpegint.h \
jpeglib.h \
jquant1.c \
jquant2.c \
jutils.c \
jversion.h \
transupp.h
##
## End JPEG library
##
###############################################################################
-77
View File
@@ -1,77 +0,0 @@
## lua/Makefile.am for fs2_open
##
## $Id: Makefile.am,v 1.2 2007-01-07 12:39:30 taylor Exp $
# D_ variants are defaults and should always be used
AM_CFLAGS = @D_CFLAGS@
AM_LDFLAGS = @D_LDFLAGS@
noinst_LIBRARIES = liblua.a
###############################################################################
##
## Begin Lua library
##
liblua_a_SOURCES = \
lapi.c \
lapi.h \
lauxlib.c \
lauxlib.h \
lbaselib.c \
lcode.c \
lcode.h \
ldblib.c \
ldebug.c \
ldebug.h \
ldo.c \
ldo.h \
ldump.c \
lfunc.c \
lfunc.h \
lgc.c \
lgc.h \
linit.c \
liolib.c \
llex.c \
llex.h \
llimits.h \
lmathlib.c \
lmem.c \
lmem.h \
loadlib.c \
lobject.c \
lobject.h \
lopcodes.c \
lopcodes.h \
loslib.c \
lparser.c \
lparser.h \
lstate.c \
lstate.h \
lstring.c \
lstring.h \
lstrlib.c \
ltable.c \
ltable.h \
ltablib.c \
ltests.c \
ltm.c \
ltm.h \
luaconf.h \
lua.h \
lua.c \
lualib.h \
lundump.c \
lundump.h \
lvm.c \
lvm.h \
lzio.c \
lzio.h \
print.c
##
## End Lua library
##
###############################################################################
+9 -15
View File
@@ -1,5 +1,5 @@
/*
** $Id: lcode.c,v 2.25.1.4 2009/06/15 14:12:25 roberto Exp $
** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $
** Code generator for Lua
** See Copyright Notice in lua.h
*/
@@ -544,18 +544,15 @@ void luaK_goiftrue (FuncState *fs, expdesc *e) {
pc = NO_JUMP; /* always true; do nothing */
break;
}
case VFALSE: {
pc = luaK_jump(fs); /* always jump */
break;
}
case VJMP: {
invertjump(fs, e);
pc = e->u.s.info;
break;
}
case VFALSE: {
if (!hasjumps(e)) {
pc = luaK_jump(fs); /* always jump */
break;
}
/* else go through */
}
default: {
pc = jumponcond(fs, e, 0);
break;
@@ -575,17 +572,14 @@ static void luaK_goiffalse (FuncState *fs, expdesc *e) {
pc = NO_JUMP; /* always false; do nothing */
break;
}
case VTRUE: {
pc = luaK_jump(fs); /* always jump */
break;
}
case VJMP: {
pc = e->u.s.info;
break;
}
case VTRUE: {
if (!hasjumps(e)) {
pc = luaK_jump(fs); /* always jump */
break;
}
/* else go through */
}
default: {
pc = jumponcond(fs, e, 1);
break;
+1 -2
View File
@@ -1,5 +1,5 @@
/*
** $Id: ldblib.c,v 1.104.1.4 2009/08/04 18:50:18 roberto Exp $
** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $
** Interface from Lua to its debug API
** See Copyright Notice in lua.h
*/
@@ -45,7 +45,6 @@ static int db_setmetatable (lua_State *L) {
static int db_getfenv (lua_State *L) {
luaL_checkany(L, 1);
lua_getfenv(L, 1);
return 1;
}
+2 -5
View File
@@ -1,5 +1,5 @@
/*
** $Id: liolib.c,v 2.73.1.4 2010/05/14 15:33:51 roberto Exp $
** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $
** Standard I/O (and system) library
** See Copyright Notice in lua.h
*/
@@ -276,10 +276,7 @@ static int read_number (lua_State *L, FILE *f) {
lua_pushnumber(L, d);
return 1;
}
else {
lua_pushnil(L); /* "result" to be removed */
return 0; /* read fails */
}
else return 0; /* read fails */
}
Loaded 100 of 124 files, more files were not shown because too many files have changed in this diff. Show more