Compare commits

..
148 Commits
Author SHA1 Message Date
taylor 00828e8410 various FS2NetD fixes:
- increase sleep time during reconnect
 - better handling of disconnects from connection errors
 - proper disconnect in case of login failure
 - log stats request calls
 - don't try to read stats from packet when there aren't any to read
 - allow proper connection resetting with standalone
 - change auto-reconnect timeout from 30 minutes to 5
 - count server traffic among activity instead of just client traffic
 - reduce uneccessary client->server traffic
2010-08-03 08:30:46 +00:00
taylor 898760e237 fix debug message 2010-08-03 08:30:43 +00:00
chief1983 b76a1e779c Remove /DEBUG in 3.6.12 builds like r6335 and r6336 2010-07-30 19:57:53 +00:00
chief1983 59553db975 Backport of r6334: Patch for issue with ai-waypoints not working correctly. The ship's goals were accidentally cleared after a single run through the waypoint path. 2010-07-30 16:30:16 +00:00
chief1983 aad8c85e51 Backport of r6329: Fix/Workaround for Mantis 2272 (Int3() in hudtarget.cpp) 2010-07-30 16:28:43 +00:00
chief1983 3a2e0f2c4e Backport of r6325: Fix for reinforcement menu bug - Mantis 2246 2010-07-30 16:27:42 +00:00
chief1983 8fc0593dca Backport of r6322: Should allow INT_MAX to be visible on POSIX-compliant systems 2010-07-21 18:53:41 +00:00
chief1983 388fe6b029 Backport of r5930: Get rid of extra hardcoded version string. 2010-07-21 17:01:44 +00:00
chief1983 e6dc61fec8 Backport of r6316: Per IssMneur, fix the root directory detection on *nix systems. 2010-07-20 22:09:35 +00:00
chief1983 1ec9395914 Backport of r6315: Fix for the 'is-ai-class' sexp. Previously, the sexp would compare the given AI class against the ship class' tbl default AI class, which produced erroneous results. 2010-07-20 22:08:48 +00:00
chief1983 fca80c1a83 Backport of r6317: IssMneur's fix for Mantis #2240, allow gaps after the hardcoded retail sound entries. 2010-07-20 22:05:57 +00:00
chief1983 7985dc1bb5 Backport of r6313:
No wonder it didn't really work. I was looking in the wrong array.
2010-07-18 02:35:12 +00:00
chief1983 d7936867c7 Backport of r6301:
Bump to MAX_SHIP_FLAGS and a subtle reminder for posterity
2010-07-17 23:12:10 +00:00
chief1983 0034a4ccee Backport of r6300:
One more autopilot fix for 3.6.12, per IssMneur
2010-07-17 23:11:14 +00:00
chief1983 22d4de689b Backport of r6299:
Fix for Mantis 2263 (Objectives list is still displayed despite disable-hud-except-messages being active)
2010-07-17 23:10:20 +00:00
chief1983 80c2b908ce Backport of r6297:
Slight cockup on my part here. Pain flashes were not supposed to be gone for everyone.
2010-07-17 23:09:29 +00:00
chief1983 63514f47b6 Backport of r6296:
Updated the credits after god knows how long
2010-07-17 23:08:26 +00:00
chief1983 aad9dd77c1 Backport of r6292:
Fix an Assertion usage issue on *nix platforms.
2010-07-17 23:06:15 +00:00
chief1983 da0e3676c1 Backport of r6291:
IssMneur's autopilot fixes (hooray!)
2010-07-17 23:04:13 +00:00
chief1983 88ed177663 Backport of r6289:
Patch for Mantis 2205 (Division by zero in do_random_sidethrust())
2010-07-17 23:02:31 +00:00
chief1983 51c6b581cb Backport of r6279:
Introducing new SIF2 flag ("no pain flash") to turn off the pain flash. I guess all the peeps who want to do capship missions can rejoice now.
2010-07-17 22:58:07 +00:00
chief1983 d4084ce89d Backport of r6278:
Update Lua interpreter to 5.1.4 (patch 2) to fix the following bugs http://www.lua.org/bugs.html#5.1.4
2010-07-17 22:56:58 +00:00
chief1983 af56b471c1 Backport of r6265:
use 2_ animations in the tech room, just as in the command brief (Mantis #2231)
2010-07-17 22:53:44 +00:00
Goober5000 3cb841101c fix a bug noticed by The_E: object types are not bitfields 2010-07-05 05:43:18 +00:00
chief1983 f25a1448be Get rid of RC1 references. 2010-07-01 15:51:52 +00:00
chief1983 00a62e93a4 Backport of r6263: Add a Directives: option to hud_gauges.tbl -- works just like Escort Ships 2010-06-28 18:20:11 +00:00
chief1983 b8fca97f43 Backport of r6262: fix for potential null vec issue when using limited base rotation turrets 2010-06-28 18:19:41 +00:00
chief1983 e7a7d75ccc Backport of r6261: fix for salvo + check hull bug found by fubar 2010-06-28 18:19:08 +00:00
chief1983 14f81c7b63 Backport of r6260: Removed unpopular circle strafe changes to make circle-strafing AI more aggressive (like in RC2) 2010-06-28 18:18:21 +00:00
chief1983 7dfc67e9be Backport of r6259: this is just a bit cleaner 2010-06-28 18:17:42 +00:00
chief1983 6ac52660b6 Backport of r6257: fix for Mantis #2056 (sexps may not want to process every ship)
also, account for the fact that Command may not be "#Command"
2010-06-28 18:16:46 +00:00
Goober5000 bf9766e1ef backport of commit 6267:
make FRED be intelligent about mission directory (Mantis #2236)
2010-06-27 08:35:24 +00:00
chief1983 ac9ad20924 Backport of r6070: fix parsing of miss factors (Mantis #2185) 2010-06-22 21:16:37 +00:00
chief1983 eb663c01d3 Backport of r6067: add beam miss factor by team, requested by Blue Planet 2010-06-22 20:47:11 +00:00
chief1983 7ced087af7 Backport of r6250:
Fix for null vec3d error mentioned in Mantis 1888 by Woolie Wool
2010-06-22 03:46:59 +00:00
chief1983 54f37f82ae Backport of r6248:
allow lua to track if ship is 'dying' during the frame (bugfix for flashy deaths script)
2010-06-22 03:46:21 +00:00
chief1983 4963b751b0 Backport of r6246:
fix for the ai profile issue (mantis 2228)
2010-06-22 03:45:47 +00:00
chief1983 a4fe0df027 Backport of r6244: Fix the Assertion to not break Macs and Linux. 2010-06-21 17:13:20 +00:00
chief1983 ec5c83a56e Backport of r6242: IssMneur's fix for #1888 (finally): Much better autopilot behavior. 2010-06-21 15:05:34 +00:00
chief1983 ce731986ae Backport of r6232:
Fix lua ray collision checks against debris pieces
2010-06-20 19:45:57 +00:00
chief1983 c061d53614 Backport of r6231:
add a null vec check - hit by fubar
2010-06-20 19:45:31 +00:00
chief1983 485d173906 Backport of r6198:
better handling of 'dying' weapons for lua scripting.cpp
added lua controls for accessing beams
2010-06-20 19:44:50 +00:00
chief1983 4b2da1591e Backport of r6223:
Stopgap fix for Mantis 2224 (Black text is unreadable in the multiplayer chat). Turned black into pink (as that colour wasn't used before).
2010-06-19 17:00:45 +00:00
chief1983 eed55a1925 Backport of r6222:
Remove the -tbp command line.
2010-06-19 17:00:13 +00:00
chief1983 a91b666702 Backport of r6221:
Commit of PNG Data fix as suggested and supplied by Armchair Commander and marvn.
(Read: http://www.hard-light.net/forums/index.php?topic=68405.0)
2010-06-19 16:59:18 +00:00
chief1983 9262e8bb0b Backport of r6214:
Fix for Mantis 2212 (Interface animations start at frame 1, not 0)
2010-06-19 16:58:45 +00:00
chief1983 787f58abfd Backport of r6213:
Fix for Mantis 2210 (Ship models in ship selection do not always show up properly)
2010-06-19 16:55:20 +00:00
chief1983 f66a232b8c Backport of r6196:
fix for target priorities and sif2 flags issue
2010-06-19 16:47:51 +00:00
chief1983 f7057f970f Backport of r6186:
mantis 1988 - error checking for the targeting priorities
2010-06-19 16:47:21 +00:00
Goober5000 e0af8bf08e backport of my commit 6180:
FUBAR's feature for LOD naming: http://www.hard-light.net/forums/index.php?topic=68901.0
2010-06-14 07:25:49 +00:00
Goober5000 8250a303ec backport of The E's commit 6207:
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 07:19:13 +00:00
Goober5000 cdb14a005b merge Sushi's revision 6099, plus some sync'ing with trunk 2010-06-12 21:24:30 +00:00
chief1983 040252c2ea No one will be maintaining this for 3.6.12 2010-06-08 04:36:38 +00:00
chief1983 34bc9b17d8 Backport of 6123: 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-06-07 16:30:51 +00:00
chief1983 653a201993 Backport of 6122: Fix a bug where additive weapon velocity would sometimes cause primary shots to pass through a target 2010-06-07 16:28:02 +00:00
chief1983 8affc3c984 Backport of 6098: Small fix for circle strafe 2010-06-07 16:26:39 +00:00
chief1983 16a1013a0b Backport of 6083: Reverted commit 5656, due to side effect of changing AI behavior (see mantis 1982) 2010-06-07 16:21:34 +00:00
Goober5000 0c9739a2ef ignore a generated file 2010-06-07 07:01:19 +00:00
Goober5000 4cedbe3c66 backport of The E's commit 6153:
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-07 07:00:36 +00:00
Goober5000 4fa32baf8b sync fictionviewer again 2010-06-07 06:36:19 +00:00
Goober5000 8fa09e962a sync fiction viewer with trunk 2010-06-07 02:16:28 +00:00
taylor bfd88b192e backport The_E's commit 6176:
A missing ) is bad for parsing.
2010-06-06 18:49:53 +00:00
taylor f4053eb18b make sure to stop deathroll effect too (Mantis #2215) 2010-06-06 14:50:17 +00:00
taylor 8374a8be75 add some missing safety checks for Snds[] (Mantis #2216) 2010-06-06 14:50:16 +00:00
Goober5000 8a79889583 backport of Sushi's commit 6092:
Some fixes/updates for the Circle Strafe behavior. The AI should use it a bit more effectively now.
2010-06-04 06:12:02 +00:00
Goober5000 6316b4639f backport of Sushi's commit 6118:
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-06-04 06:06:20 +00:00
Goober5000 8bf974973e minor fix to the -wcs flag removal 2010-06-03 06:28:51 +00:00
Goober5000 749548cacb backport of karajorma's commit 6154:
Kill the -wcs flag. Should have done this years ago.
2010-06-03 06:26:37 +00:00
Goober5000 db0c0a6e6b backport of Wanderer's commit 6134:
add read access for lua to weapon and ship info index. enable to check 'weapon_armed' status
2010-06-03 06:22:03 +00:00
Goober5000 4300a67da3 backport of Wanderer's commit 6150:
Certain fixes for Bobs animation code issues. Please report if this renders any current anims invalid.
2010-06-03 05:58:26 +00:00
Goober5000 75410b1465 backport of karajorma's commit 6133:
Swap the engage enemies messages over.
2010-06-03 05:55:23 +00:00
Goober5000 eaf516756f add latest MSVC 2010 files 2010-06-03 05:54:00 +00:00
Goober5000 fc88ab03a5 backport of Sushi's commit 6057:
Added $Turret Max Aim Update Delay (same as $Max Aim Update Delay, but affecting turrets instead).
2010-06-03 05:50:27 +00:00
Goober5000 8da643a5db backport of Sushi's commit 6074:
Fix for 6057 (game sometimes crashes if $Turret Max Aim Update Delay not set)
2010-06-03 05:47:53 +00:00
Goober5000 ea3e865836 backport of Sushi's revision 6075:
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-06-03 05:46:13 +00:00
taylor d24e2985d2 more sane memory reserve 2010-05-29 15:52:38 +00:00
taylor eb4e65fc6e fix endless loop 2010-05-29 15:52:34 +00:00
taylor 1185261974 fix view skew math issue (Mantis #2213) 2010-05-29 14:55:31 +00:00
taylor 336fd14f8b bah! remove debug code that slipped in with safety fixes 2010-05-29 10:55:12 +00:00
taylor 042b4ce0db support for newer versions of automake (Mantis #2145) 2010-05-29 10:55:11 +00:00
Goober5000 0c513e053a remove message from queue the correct way, thus fixing the training message crash 2010-05-19 04:29:09 +00:00
Goober5000 c32b39a247 backport of my commit 6102:
better handling of missing models
2010-05-16 00:35:34 +00:00
Goober5000 e610de3516 backport of my commits 6100-6101:
fix subsystem alignment on ship class change (Mantis #1181)
fix a bug with Bobboau's external missiles feature
2010-05-16 00:34:58 +00:00
Goober5000 ef63b44a16 backport of Sushi's commit 6097:
Fix for Mantis 2099
2010-05-16 00:24:22 +00:00
Goober5000 e17526eb89 backport of karajorma's commit 6090 and chief1983's commit 6091:
Fix compilation under OSX and Linux with WarningEx
2010-05-16 00:22:58 +00:00
Goober5000 f0544cb485 backport of The_E's commit 6089:
Genghis' fix for Mantis 2162 (Thruster cones have collision detection)
2010-05-16 00:21:50 +00:00
Goober5000 b1741d2b49 backport of karajorma's commit 6087:
Genghis' fix for Mantis 2159 (Certain parsing errors are never reported)
2010-05-16 00:21:10 +00:00
Goober5000 8a1cac238f backport of karajorma's commit 6086:
Genghis' fix for Mantis 2157 (Invalid subsystems not properly detected on mission parse).
2010-05-16 00:20:33 +00:00
Goober5000 c5e346b72b backport of karajorma's commit 6085:
GencGenghis' fix for Mantis 2155 (No error checking for certain ship problems in the lab that FRED does pick up).
2010-05-16 00:20:05 +00:00
Goober5000 da999df482 backport of karajorma's commit 6084:
Genghis' fix for Mantis 2151 (No error checking for incorrect engine wash entries).
2010-05-16 00:19:41 +00:00
Goober5000 80fddda455 backport of The_E's commit 6073:
Fix for Mantis 2189 (camera FOV may get corrupted by malformed commandline argument)
2010-05-16 00:14:56 +00:00
Goober5000 d14d3b3b6c backport of my commit 6071:
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-05-16 00:13:05 +00:00
Goober5000 cabf5068e2 backport of The_E's commits 6095-6096:
Patch for Mantis 2202 (Children of swarm weapons do not inherit parent target)
Swarm weapons should respect "$Free flight time" as well
2010-05-16 00:12:03 +00:00
Goober5000 a90b70d7f9 backport Sushi's commitbackport of Sushi's commit 6077:
Fix for bug causing AI to not fire secondaries, as well as a fix for other minor AI bugs
2010-05-16 00:10:12 +00:00
Goober5000 578aced1a5 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:35:33 +00:00
Goober5000 876743b40e fix Mantis #2194 2010-04-30 04:06:05 +00:00
chief1983 7a796e13a4 Backport of r6068:
No 2-arg asserts on Linux.
2010-04-19 23:38:16 +00:00
Goober5000 ba52d6bbc0 backport of karajorma's commit 6053:
Iss Mneur's mission-set-subspace and hud-display-gauge SEXPs
2010-04-19 03:54:44 +00:00
Goober5000 1880beca07 merge Iss_Mneur's fix for Mantis #2173 (better error message in cmdline.cpp) 2010-04-19 03:51:12 +00:00
Goober5000 0ceb9dc04b merge Iss_Mneur's fix for Mantis #2178 (Assertion in missiontraining.cpp) 2010-04-19 03:49:17 +00:00
Goober5000 dc8e8c1270 merge The E's fix for Mantis #2182 (NaN propagation leading to rendering wonkiness) 2010-04-19 03:40:21 +00:00
Goober5000 2007614ace backport of Sushi's commit 6049:
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-19 03:34:16 +00:00
Goober5000 cf05b699a3 backport of karajorma's commit 6001:
Refactoring the Special Explosion and Special Hitpoints/Shield code and saving methods.
2010-04-19 03:24:36 +00:00
Goober5000 8f3144c5c4 fix Mantis #1953 (departure locations and anchors destroyed by ship editor dialog) 2010-04-13 06:53:03 +00:00
Goober5000 928858d48e prevent an endless loop if someone tries to assign a variable to itself
also, sync some formatting from trunk
2010-03-31 20:31:33 +00:00
Goober5000 9b03393fa8 The E's patch to apply capital+ to secondary weapons 2010-03-31 05:31:20 +00:00
Goober5000 b9f7c4501b backport of karajorma's commit 6028:
Fix Mantis 2000 (Skip Mission Dialog appears even when mission is successfully completed).
2010-03-31 05:28:58 +00:00
Goober5000 2c6adfd3ef backport of Echelon9's commit 6026:
Fix Mantis 2158: Increase Intelligence limit from species.tbl
2010-03-31 05:28:17 +00:00
Goober5000 dac5af56e0 backport of Echelon9's commit 6023:
Fix Mantis 2156: Crash within outwnd_printf2(char*, ...) on non-Windows platforms
2010-03-31 05:27:45 +00:00
Goober5000 9fa0cbe8c5 backport of karajorma's commit 6004:
Fix Mantis 2140 (Set-primary-ammo/weapon result in the ammo being set to 0 in some mods)
2010-03-31 05:26:45 +00:00
Goober5000 c0e3b6699c backport of Wanderer's commit 6000:
mantis 2122, fix for hud_gauge string comparison problems.
2010-03-31 05:24:31 +00:00
Goober5000 631fbc5094 backport of Wanderer's commit 5999:
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-31 05:23:43 +00:00
Goober5000 fb02c34646 backport of Wanderer's commit 5998:
mantis 2113, make autoaim independent from lead indicator status
2010-03-31 05:23:13 +00:00
Goober5000 e136784952 backport of Wanderer's commit 5997:
feature commit - alternate lead indicator based on komet's code changes.
2010-03-31 05:22:38 +00:00
Goober5000 a6986b7598 backport of Wanderer's commit 5994:
Fix for mantis 2131:
prevent for time compression caused vector scaling errors
changed time compression related beam assert into nprintf.
2010-03-31 05:21:18 +00:00
Goober5000 5d32313599 backport of Wanderer's commit 5993:
Fubars fix for mantis 2141
2010-03-31 05:20:32 +00:00
Goober5000 12fdf1e4fa backport of Wanderer's commit 5991:
fix for mantis 2105
2010-03-31 05:18:33 +00:00
Goober5000 6c82fcce32 backport of Wanderer's commit 5990:
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-31 05:17:53 +00:00
Goober5000 28c573d47b patch some holes in the handling of string variables 2010-03-29 09:39:34 +00:00
Goober5000 845d8472c4 a couple of small but important fixes to the subtitle code, including (finally) the complete fix for Mantis #2152 2010-03-20 06:37:11 +00:00
Goober5000 09cca0f12b handle variables in show-subtitle 2010-03-19 07:39:55 +00:00
Goober5000 93ff4c441b Genghis's fix for too many cargo names (Mantis 2132) 2010-03-19 06:45:02 +00:00
Goober5000 6753656848 sexp help now scrolls 2010-03-19 05:48:02 +00:00
Goober5000 29eb3a8866 whitespace happiness 2010-03-19 04:04:20 +00:00
Goober5000 7b0bcfc8ae 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:01:58 +00:00
Goober5000 eb47335e1e approximate the beam whack from retail FS2 2010-03-16 06:43:01 +00:00
Goober5000 05b3645062 this is a long-overdue rewrite of WMC's show-subtitle sexps 2010-03-15 01:55:56 +00:00
Goober5000 f325afcd54 cross-patch a bug-fix 2010-03-15 01:49:20 +00:00
Goober5000 8551b19697 move the -post_process flag to the experimental section 2010-03-14 22:38:45 +00:00
taylor 1b930557cd no comment. (nothing nice to say) 2010-03-10 10:04:09 +00:00
Goober5000 586f419413 merge fiction viewer changes to 3.6.12 2010-03-06 11:43:10 +00:00
taylor f985b10eb7 properly close out mission when end-mission sexp is used (Mantis #2144) 2010-03-04 06:08:19 +00:00
taylor 5fb12eebf4 clean up launcher flags
- update easy flag settings (Mantis #2074)
 - remove -res, it requires an option
2010-03-04 06:08:16 +00:00
taylor c0ed3c79e3 handle cmdline_fso.cfg files of any size 2010-03-04 06:08:03 +00:00
taylor dc12a13ff8 updated Ogg/Vorbis/Theora libs 2010-03-04 06:07:56 +00:00
taylor b2c6a52ae4 cycle back to normal music is hostile ships leave without battle (Mantis #1632) 2010-03-04 06:07:23 +00:00
taylor fc41b260af reduce minimum sound volume value for OpenAL compatibility (Mantis #1854) 2010-03-04 06:07:21 +00:00
taylor 5c7bd6494e fix memory issues with arg parsing 2010-03-04 06:07:15 +00:00
chief1983 e8aad6f979 Backport r5969 - fix for two full packets in a frame - to 3.6.12 2010-03-03 23:40:40 +00:00
chief1983 af01576b82 Backport r5968 - upsidedown FBO rendering - to 3.6.12 2010-03-03 23:39:38 +00:00
chief1983 3c606b90ab Backport r5959 - Mantis 2137 play-sound-from-file not looping - to 3.6.12 2010-03-03 23:38:04 +00:00
chief1983 b2adf4c326 Backport r5945 - FRED dialog fix - to 3.6.12 2010-02-25 16:19:13 +00:00
chief1983 c666741e93 Backport r5931 - Mantis 2133 Monitoring text - to 3.6.12 2010-02-25 16:09:06 +00:00
chief1983 8b67b33a08 Backport r5935 - afterburner assert - to 3.6.12 2010-02-25 16:06:18 +00:00
Goober5000 d585439096 upgrade the branched VC6 and VC2005 project files to match the trunk ones 2010-02-19 06:51:27 +00:00
Goober5000 f3f6548293 delete the obsolete branched project folders 2010-02-19 06:50:16 +00:00
chief1983 7231b32c99 Update versioning and filenames for RC1 2010-02-18 01:41:26 +00:00
Goober5000 38aac6bd3a branch for 3.6.12 2010-02-17 09:08:34 +00:00
365 changed files with 47496 additions and 82285 deletions

No files matched your search

+1 -1
View File
@@ -2,7 +2,7 @@
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = code
SUBDIRS = libjpeg lua code
EXTRA_DIST = \
-175
View File
@@ -712,178 +712,3 @@ 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)
])
+52 -43
View File
@@ -185,7 +185,7 @@ EXTRA_DIST = \
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I../lua
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
@@ -258,6 +258,8 @@ FS2_SOURCES = \
debugconsole/dbugfile.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
decals/decals.cpp \
decals/decals.h \
demo/demo.cpp \
demo/demo.h \
exceptionhandler/exceptionhandler.cpp \
@@ -281,18 +283,12 @@ FS2_SOURCES = \
gamehelp/gameplayhelp.h \
gamesequence/gamesequence.cpp \
gamesequence/gamesequence.h \
gamesnd/eventmusic.cpp \
gamesnd/eventmusic.h \
gamesnd/gamesnd.cpp \
gamesnd/gamesnd.h \
globalincs/alphacolors.cpp \
globalincs/alphacolors.h \
globalincs/crypt.cpp \
globalincs/crypt.h \
globalincs/def_files.cpp \
globalincs/def_files.h \
globalincs/fsmemory.cpp \
globalincs/fsmemory.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/pstypes.h \
@@ -576,8 +572,6 @@ FS2_SOURCES = \
object/object.h \
object/objectshield.cpp \
object/objectshield.h \
object/objectsnd.cpp \
object/objectsnd.h \
object/objectsort.cpp \
object/parseobjectdock.cpp \
object/parseobjectdock.h \
@@ -640,30 +634,6 @@ FS2_SOURCES = \
ship/shiphit.cpp \
ship/shiphit.h \
ship/subsysdamage.h \
sound/audiostr.cpp \
sound/audiostr.h \
sound/acm.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/dscap.cpp \
sound/dscap.h \
sound/fsspeech.cpp \
sound/fsspeech.h \
sound/openal.cpp \
sound/openal.h \
sound/rtvoice.cpp \
sound/rtvoice.h \
sound/sound.cpp \
sound/sound.h \
sound/speech.cpp \
sound/speech.h \
sound/voicerec.cpp \
sound/voicerec.h \
sound/ogg/ogg.cpp \
sound/ogg/ogg.h \
species_defs/species_defs.cpp \
species_defs/species_defs.h \
starfield/nebula.cpp \
@@ -737,6 +707,44 @@ JOY_SOURCES = \
io/joy-unix.cpp
endif
## sound support sources
if FS2_SOUND
SOUND_SOURCES = \
gamesnd/eventmusic.cpp \
gamesnd/eventmusic.h \
gamesnd/gamesnd.cpp \
gamesnd/gamesnd.h \
object/objectsnd.cpp \
object/objectsnd.h \
sound/ogg/ogg.cpp \
sound/ogg/ogg.h \
sound/audiostr-openal.cpp \
sound/audiostr.cpp \
sound/audiostr.h \
sound/acm-openal.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/dscap.cpp \
sound/dscap.h \
sound/rbaudio.cpp \
sound/rbaudio.h \
sound/rtvoice.cpp \
sound/rtvoice.h \
sound/sound.cpp \
sound/sound.h \
vcodec/codec1.cpp \
vcodec/codec1.h \
sound/fsspeech.cpp \
sound/fsspeech.h \
sound/speech.cpp \
sound/speech.h \
sound/voicerec.cpp \
sound/voicerec.h
endif
## Win32-specific sources
if FS2_OS_WIN32
WIN32_SOURCES = \
@@ -747,6 +755,7 @@ WIN32_SOURCES = \
directx/vdplay.h \
directx/vdplobby.h \
directx/vdsetup.h \
directx/vdsound.h \
directx/vdvp.h \
globalincs/windebug.cpp \
graphics/gl/GLAUX.H \
@@ -778,8 +787,8 @@ endif
## libcode.a
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${WIN32_SOURCES} \
${UNIX_SOURCES}
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
${WIN32_SOURCES} ${UNIX_SOURCES}
##
## End CODE library
@@ -809,10 +818,10 @@ fs2_open_INF_d_SOURCES = \
fs2_open_INF_r_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_d_LDADD = libcode.a
fs2_open_r_LDADD = libcode.a
fs2_open_INF_d_LDADD = libcode.a
fs2_open_INF_r_LDADD = libcode.a
fs2_open_d_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
fs2_open_r_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
fs2_open_INF_d_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
fs2_open_INF_r_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
##
## End MAIN binary
@@ -844,10 +853,10 @@ wxFRED2_INF_d_SOURCES = \
wxFRED2_INF_r_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_d_LDADD = libcode.a
wxFRED2_r_LDADD = libcode.a
wxFRED2_INF_d_LDADD = libcode.a
wxFRED2_INF_r_LDADD = libcode.a
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_INF_d_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_INF_r_LDADD = libcode.a ../libjpeg/libjpeg.a
##
## End wxFRED2 binary
+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;
-5
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)
@@ -703,8 +702,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
+2 -6
View File
@@ -383,6 +383,8 @@ void parse_ai_profiles_tbl(char *filename)
set_flag(profile, "$allow vertical dodge:", AIPF_ALLOW_VERTICAL_DODGE, AIP_FLAG);
set_flag(profile, "$disarm or disable cause global ai goal effects:", AIPF_GLOBAL_DISARM_DISABLE_EFFECTS, AIP_FLAG);
set_flag(profile, "$force beam turrets to use normal fov:", AIPF_FORCE_BEAM_TURRET_FOV, AIP_FLAG);
set_flag(profile, "$fix ai class bug:", AIPF_FIX_AI_CLASS_BUG, AIP_FLAG);
@@ -393,12 +395,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, "$advanced turret fov edge checks:", AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS, AIP_FLAG2);
set_flag(profile, "$require turrets to have target in fov:", AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV, 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++;
+3 -6
View File
@@ -47,17 +47,14 @@
#define AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY (1 << 26)
#define AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS (1 << 27)
#define AIPF_ALLOW_VERTICAL_DODGE (1 << 28) //Allows AI ships to evade weapons vertically as well as horizontally
#define AIPF_FORCE_BEAM_TURRET_FOV (1 << 29)
#define AIPF_FIX_AI_CLASS_BUG (1 << 30)
#define AIPF_GLOBAL_DISARM_DISABLE_EFFECTS (1 << 29)
#define AIPF_FORCE_BEAM_TURRET_FOV (1 << 30)
#define AIPF_FIX_AI_CLASS_BUG (1 << 31)
// flags2
#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 AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS (1 << 4)
#define AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV (1 << 5)
#define MAX_AI_PROFILES 5
+3 -22
View File
@@ -376,12 +376,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
float dist;
pm = model_get( Ship_info[Ships[Pl_objp->instance].ship_info_index].model_num );
//Necessary sanity check
polymodel *pm_t;
pm_t = model_get(Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].model_num);
Assertion(aip->targeted_subsys->system_info->path_num <= pm_t->n_paths, "Invalid Path number %d for subsystem %s on ship %s (Model: %s)\n", aip->targeted_subsys->system_info->path_num, aip->targeted_subsys->system_info->name, Ship_info[Ships[Objects[aip->target_objnum].instance].ship_info_index].name, pm_t->filename );
if (aip->targeted_subsys->system_info->path_num > pm_t->n_paths)
return 0;
// If attacking a subsystem, ensure that we have an unobstructed line of sight... if not, then move
// towards path linked to subsystem
subsys_in_sight = 0; // assume Pl_objp doesn't have line of sight to subys
@@ -425,7 +420,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
aip->path_goal_dist = 5;
subsys_path_num = aip->targeted_subsys->system_info->path_num;
if ( ((aip->path_start) == -1 || (aip->mp_index != subsys_path_num)) && subsys_path_num <= pm->n_paths ) {
if ( (aip->path_start) == -1 || (aip->mp_index != subsys_path_num) ) {
// maybe create a new path
if ( subsys_path_num >= 0 ) {
Assert(aip->target_objnum >= 0);
@@ -699,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)){
@@ -1645,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
+129 -59
View File
@@ -769,8 +769,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 +1314,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 +1449,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 +1852,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.
@@ -2900,7 +2979,7 @@ void ai_find_path(object *pl_objp, int objnum, int path_num, int exit_flag, int
if(pm->n_paths <= path_num)
Error(LOCATION,"ai_find_path tring to find a path (%d) that doesn't exist, on ship %s", path_num, shipp->ship_name);
// Assert(pm->n_paths > path_num);
aip->goal_objnum = objnum;
aip->goal_objnum = objp-Objects;
aip->goal_signature = objp->signature;
if (exit_flag)
create_model_exit_path(pl_objp, objp, path_num);
@@ -4188,7 +4267,7 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
&& carry_flag
&& ((The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) || (Pl_objp != Autopilot_flight_leader)) )
{
Assertion( Autopilot_flight_leader != NULL, "When under autopilot there must be a flight leader" );
Assertion( Autopilot_flight_leader != NULL, "When under autopliot there must be a flight leader", Autopilot_flight_leader );
// snap wings into formation them into formation
if (The_mission.flags & MISSION_FLAG_USE_AP_CINEMATICS) {
if (aip->wing != -1) {
@@ -4332,7 +4411,8 @@ void ai_fly_to_target_position(vec3d* target_pos, bool* pl_done_p=NULL, bool* pl
}
} else {
Assertion( pl_treat_as_ship_p != NULL,
"pl_done_p cannot be NULL while pl_treat_as_ship_p is not NULL" );
"pl_done_p cannot be NULL while pl_treat_as_ship_p is not NULL",
pl_treat_as_ship_p );
}
}
}
@@ -5170,6 +5250,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 +5302,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 +5328,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 +5349,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 +5370,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 +5391,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 +5417,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 +5590,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 +5627,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 +6279,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 +6297,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;
}
@@ -6316,7 +6388,7 @@ void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, vec3d *e
// Make it take longer for enemies to get player's allies in range based on skill level.
// but don't bias team v. team missions
if ( !(MULTI_TEAM) )
if ( !((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_TEAM)) )
{
if (iff_x_attacks_y(shipp->team, Player_ship->team))
range_time += The_mission.ai_profile->in_range_time[Game_skill_level];
@@ -6507,14 +6579,8 @@ void do_random_sidethrust(ai_info *aip, ship_info *sip)
//This means that we get the same random values for a little bit.
//Using static_rand(shipnum) as a crude hash function to make sure that the seed is different for each ship and direction
//The *2 ensures that y and x stay separate.
if (strafeHoldDirAmount > 0) { //This may look unnecessary, but we're apparently still getting div by zero errors on Macs here.
side_vec.x = static_randf_range((((Missiontime + static_rand(aip->shipnum)) >> 16) / strafeHoldDirAmount) , -1.0f, 1.0f);
side_vec.y = static_randf_range((((Missiontime + static_rand(aip->shipnum)) >> 16) / strafeHoldDirAmount) * 2, -1.0f, 1.0f);
} else {
Warning(LOCATION, "Division by zero in do_random_sidethrust averted. Please tell a coder.\n");
side_vec.x = 1.0f;
side_vec.y = 1.0f;
}
side_vec.x = static_randf_range((((Missiontime + static_rand(aip->shipnum)) >> 16) / strafeHoldDirAmount) , -1.0f, 1.0f);
side_vec.y = static_randf_range((((Missiontime + static_rand(aip->shipnum)) >> 16) / strafeHoldDirAmount) * 2, -1.0f, 1.0f);
//Scale it up so that the longest dimension is length 1.0. This ensures we are always getting as much use out of sidethrust as possible.
vm_vec_boxscale(&side_vec, 1.0f);
@@ -6579,13 +6645,13 @@ void attack_set_accel(ai_info *aip, ship_info *sip, float dist_to_enemy, float d
if (!( Pl_objp->phys_info.flags & PF_AFTERBURNER_ON )) {
float percent_left;
ship *shipp;
ship_info *sip_local;
ship_info *sip;
shipp = &Ships[Pl_objp->instance];
sip_local = &Ship_info[shipp->ship_info_index];
sip = &Ship_info[shipp->ship_info_index];
if (sip_local->afterburner_fuel_capacity > 0.0f) {
percent_left = 100.0f * shipp->afterburner_fuel / sip_local->afterburner_fuel_capacity;
if (sip->afterburner_fuel_capacity > 0.0f) {
percent_left = 100.0f * shipp->afterburner_fuel / sip->afterburner_fuel_capacity;
if (percent_left > 30.0f + ((Pl_objp-Objects) & 0x0f)) {
afterburners_start(Pl_objp);
if (aip->ai_profile_flags & AIPF_SMART_AFTERBURNER_MANAGEMENT) {
@@ -6595,11 +6661,11 @@ void attack_set_accel(ai_info *aip, ship_info *sip, float dist_to_enemy, float d
float ab_time;
// Max afterburner speed - make sure we don't devide by 0 later
max_ab_vel = sip_local->afterburner_max_vel.xyz.z > 0.0f ? sip_local->afterburner_max_vel.xyz.z : sip_local->max_vel.xyz.z;
max_ab_vel = sip->afterburner_max_vel.xyz.z > 0.0f ? sip->afterburner_max_vel.xyz.z : sip->max_vel.xyz.z;
max_ab_vel = max_ab_vel > 0.0f ? max_ab_vel : 0.0001f;
// Time to exhaust 25% of the remaining fuel
time_to_exhaust_25pct_fuel = shipp->afterburner_fuel * 0.25f / sip_local->afterburner_burn_rate;
time_to_exhaust_25pct_fuel = shipp->afterburner_fuel * 0.25f / sip->afterburner_burn_rate;
// Time to fly 75% of the distance to the target
time_to_fly_75pct_of_distance = dist_to_enemy * 0.75f / max_ab_vel;
@@ -7885,6 +7951,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;
@@ -8274,14 +8348,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);
}
@@ -10685,6 +10755,8 @@ void ai_dock()
// model_anim_start_type(shipp, TRIGGER_TYPE_DOCKED, aip->dockee_index, 1);
// model_anim_start_type(shipp, TRIGGER_TYPE_DOCKED, 1);
snd_play_3d( &Snds[SND_DOCK_ATTACH], &Pl_objp->pos, &View_position );
hud_maybe_flash_docking_text(Pl_objp);
hud_maybe_flash_docking_text(goal_objp);
// ai_dock_shake(Pl_objp, goal_objp);
if ((Pl_objp == Player_obj) || (goal_objp == Player_obj))
@@ -12237,7 +12309,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
@@ -13296,8 +13368,6 @@ void ai_warp_out(object *objp)
// flag us as trying to warp so that this function keeps getting called
// (in other words, if we can't warp just yet, we want to warp at the first
// opportunity)
if (aip->mode != AIM_WARP_OUT)
aip->mode = AIM_WARP_OUT;
aip->submode = AIS_WARP_1;
aip->ai_flags |= AIF_TRYING_UNSUCCESSFULLY_TO_WARP;
+33 -45
View File
@@ -43,8 +43,9 @@
// Goober5000 - okay, this seems really stupid. If any ship in the mission is assigned a goal
// in PURGE_GOALS_ALL_SHIPS, *every* other ship will have certain goals purged. So I added
// PURGE_GOALS_ONE_SHIP for goals which should only purge other goals in the one ship.
#define PURGE_GOALS_ALL_SHIPS (AI_GOAL_IGNORE | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)
#define PURGE_GOALS_ALL_SHIPS (AI_GOAL_IGNORE)
#define PURGE_GOALS_ONE_SHIP (AI_GOAL_IGNORE_NEW)
#define PURGE_GOALS_DISARM_DISABLE (AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP)
// goals given from the player to other ships in the game are also handled in this
// code
@@ -393,9 +394,9 @@ void ai_mission_goal_complete( ai_info *aip )
// which are destroy, etc, should get removed. goal list is the list of goals to purge. It is
// always MAX_AI_GOALS in length. This function will only get called when the goal which causes
// purging becomes valid.
void ai_goal_purge_invalid_goals( ai_goal *aigp, ai_goal *goal_list, ai_info *aip, int ai_wingnum )
void ai_goal_purge_invalid_goals( ai_goal *aigp, ai_goal *goal_list )
{
int i, j;
int i;
ai_goal *purge_goal;
char *name;
int mode, ship_index, wingnum;
@@ -448,33 +449,11 @@ void ai_goal_purge_invalid_goals( ai_goal *aigp, ai_goal *goal_list, ai_info *ai
purge_goal->flags |= AIGF_PURGE;
break;
// disarm/disable goals should remove attacks from certain ships types
case AI_GOAL_DISARM_SHIP:
// disarm/disable goals should remove any general attack
case AI_GOAL_DISABLE_SHIP:
if ( purge_ai_mode & (AI_GOAL_CHASE | AI_GOAL_CHASE_WING) ) {
int ai_ship_type;
// for wings we grab the ship type of the wing leader
if (ai_wingnum >= 0) {
ai_ship_type = Ship_info[Ships[Wings[ai_wingnum].special_ship].ship_info_index].class_type;
}
// otherwise we simply grab it from the ship itself
else {
Assert(aip != NULL);
ai_ship_type = Ship_info[Ships[aip->shipnum].ship_info_index].class_type;
}
// grab the ship type of the ship that is being disarmed/disabled
ship_type_info *crippled_ships_type = &Ship_types[Ship_info[Ships[ship_index].ship_info_index].class_type];
// work through all the ship types which to see if the class matching our ai ship must ignore the ship
// being disarmed/disabled
for ( j=0 ; j < (int)crippled_ships_type->ai_cripple_ignores.size(); j++) {
if (crippled_ships_type->ai_cripple_ignores[j] == ai_ship_type) {
purge_goal->flags |= AIGF_PURGE;
}
}
}
case AI_GOAL_DISARM_SHIP:
if ( purge_ai_mode & (AI_GOAL_CHASE | AI_GOAL_CHASE_WING) )
purge_goal->flags |= AIGF_PURGE;
break;
}
}
@@ -487,19 +466,22 @@ void ai_goal_purge_all_invalid_goals(ai_goal *aigp)
ship_obj *sop;
// only purge goals if a new goal is one of the types in next statement
if (!(aigp->ai_mode & PURGE_GOALS_ALL_SHIPS))
if (!((aigp->ai_mode & PURGE_GOALS_ALL_SHIPS) || (aigp->ai_mode & PURGE_GOALS_DISARM_DISABLE)))
return;
if ((aigp->ai_mode & PURGE_GOALS_DISARM_DISABLE) && (!(The_mission.ai_profile->flags & AIPF_GLOBAL_DISARM_DISABLE_EFFECTS)))
return;
for (sop = GET_FIRST(&Ship_obj_list); sop != END_OF_LIST(&Ship_obj_list); sop = GET_NEXT(sop))
{
ship *shipp = &Ships[Objects[sop->objnum].instance];
ai_goal_purge_invalid_goals(aigp, Ai_info[shipp->ai_index].goals, &Ai_info[shipp->ai_index], -1);
ai_goal_purge_invalid_goals(aigp, Ai_info[shipp->ai_index].goals);
}
// we must do the same for the wing goals
for (i = 0; i < Num_wings; i++)
{
ai_goal_purge_invalid_goals(aigp, Wings[i].ai_goals, NULL, i);
ai_goal_purge_invalid_goals(aigp, Wings[i].ai_goals);
}
}
@@ -1613,12 +1595,16 @@ int ai_mission_goal_achievable( int objnum, ai_goal *aigp )
// Goober5000 - see note at PURGE_GOALS_ALL_SHIPS... this is bizarre
if ((status == SHIP_STATUS_ARRIVED) && !(aigp->flags & AIGF_GOALS_PURGED))
{
if (aigp->ai_mode & PURGE_GOALS_ALL_SHIPS) {
if ((aigp->ai_mode & PURGE_GOALS_ALL_SHIPS) ||
((aigp->ai_mode & PURGE_GOALS_DISARM_DISABLE) && (The_mission.ai_profile->flags & AIPF_GLOBAL_DISARM_DISABLE_EFFECTS)))
{
ai_goal_purge_all_invalid_goals(aigp);
aigp->flags |= AIGF_GOALS_PURGED;
}
else if (aigp->ai_mode & PURGE_GOALS_ONE_SHIP) {
ai_goal_purge_invalid_goals(aigp, aip->goals, aip, -1);
else if ((aigp->ai_mode & PURGE_GOALS_ONE_SHIP) ||
((aigp->ai_mode & PURGE_GOALS_DISARM_DISABLE) && (!(The_mission.ai_profile->flags & AIPF_GLOBAL_DISARM_DISABLE_EFFECTS))))
{
ai_goal_purge_invalid_goals(aigp, aip->goals);
aigp->flags |= AIGF_GOALS_PURGED;
}
}
@@ -2188,18 +2174,20 @@ void ai_process_mission_orders( int objnum, ai_info *aip )
other_obj = &Objects[Ships[shipnum].objnum];
ai_attack_object( objp, other_obj, NULL);
ai_set_attack_subsystem( objp, current_goal->ai_submode ); // submode stored the subsystem type
if (current_goal->ai_mode != AI_GOAL_DESTROY_SUBSYSTEM) {
if (aip->target_objnum != -1) {
// Only protect if _not_ a capital ship. We don't want the Lucifer accidentally getting protected.
if (Ship_types[Ship_info[Ships[shipnum].ship_info_index].class_type].ai_bools & STI_AI_PROTECTED_ON_CRIPPLE)
Objects[aip->target_objnum].flags |= OF_PROTECTED;
}
} else // Just in case this ship had been protected, unprotect it.
if (aip->target_objnum != -1)
Objects[aip->target_objnum].flags &= ~OF_PROTECTED;
if (The_mission.ai_profile->flags & AIPF_GLOBAL_DISARM_DISABLE_EFFECTS) {
if (current_goal->ai_mode != AI_GOAL_DESTROY_SUBSYSTEM) {
if (aip->target_objnum != -1) {
// Only protect if _not_ a capital ship. We don't want the Lucifer accidentally getting protected.
if (!(Ship_info[Ships[shipnum].ship_info_index].flags & SIF_HUGE_SHIP))
Objects[aip->target_objnum].flags |= OF_PROTECTED;
}
} else // Just in case this ship had been protected, unprotect it.
if (aip->target_objnum != -1)
Objects[aip->target_objnum].flags &= ~OF_PROTECTED;
}
break;
}
}
case AI_GOAL_CHASE_WING:
wingnum = wing_name_lookup( current_goal->ship_name );
+13 -162
View File
@@ -100,101 +100,6 @@ int object_in_turret_fov(object *objp, ship_subsys *ss, vec3d *tvec, vec3d *tpos
return 0;
}
bool is_object_radius_in_turret_fov(object *objp, ship_subsys *ss, vec3d *tvec, vec3d *tpos, vec3d *v2e, vec3d *predicted_pos, float distance)
{
float target_dist = distance;
if (distance == 0.0f)
target_dist = vm_vec_dist(predicted_pos,tpos);
if (object_in_turret_fov(objp, ss, tvec, tpos, target_dist + objp->radius)) {
// so the targeted spot in not in fov but the enemy + radius is
// lets align the darn gun and try shooting there
vec3d temp_vec;
float multiplier = 0;
model_subsystem *tp = ss->system_info;
// project v2e_from_turret to turret normal
// substract resultant vector from the temp_vec (v2e_from_turret)
// adjust z component as necessary
// calculate multiplier for the resultant vector
// use multiplier and the z component and compose a new vector
float dot = vm_vec_dot(v2e, tvec);
vm_vec_scale_add(&temp_vec, v2e, tvec, -dot);
if (IS_VEC_NULL_SQ_SAFE(&temp_vec)) {
// return false, target is perfectly aligned over or below the turret
// safe bet is to allow turret to reacquire better target
return false;
}
// normalize the vec, it needs to be done regardless
vm_vec_normalize(&temp_vec);
bool fix_elevation = false;
bool fix_base_rot = false;
if (dot < tp->turret_fov) {
dot = tp->turret_fov;
fix_elevation = true;
}
if (dot > tp->turret_max_fov) {
dot = tp->turret_max_fov;
fix_elevation = true;
}
if (tp->flags & MSS_FLAG_TURRET_ALT_MATH) {
vec3d temp_vec2;
vm_vec_rotate(&temp_vec2, &temp_vec, &ss->world_to_turret_matrix);
// now in turrets frame of reference
// check if math is actually possible
if (!((temp_vec2.xyz.x == 0) && (temp_vec2.xyz.y == 0))) {
float temp_z = temp_vec2.xyz.z;
temp_vec2.xyz.z = 0.0f;
// make sure null vecs wont happen
if (!IS_VEC_NULL_SQ_SAFE(&temp_vec2)) {
vm_vec_normalize(&temp_vec2);
// only do this if it actually is required
if (-temp_vec2.xyz.y < tp->turret_y_fov) {
float check_pos = 1;
fix_base_rot = true;
temp_vec2.xyz.y = -tp->turret_y_fov;
if (temp_vec2.xyz.x < 0)
check_pos = -1;
temp_vec2.xyz.x = check_pos * sqrtf(1 - (temp_vec2.xyz.y*temp_vec2.xyz.y));
// restore z component
float scaler = sqrtf(1 - (temp_z*temp_z));
vm_vec_scale(&temp_vec2,scaler);
temp_vec2.xyz.z = temp_z;
// back to world frame
vm_vec_unrotate(&temp_vec, &temp_vec2, &ss->world_to_turret_matrix);
}
}
}
}
if (fix_elevation || fix_base_rot) {
if (fix_elevation) {
multiplier = sqrtf(1 - (dot*dot));
// keep the temp_vec scaled with the tweaked vector
vm_vec_scale(&temp_vec, multiplier);
}
vm_vec_scale_add(v2e, &temp_vec, tvec, dot);
// and we are done with v2e...
vm_vec_scale_add(predicted_pos, tpos, v2e, target_dist);
// and we are done with predicted position
return true;
} else {
mprintf(("Warning: Function 'is_object_radius_in_turret_fov' was called\nwithout need to fix turret alignments\n"));
return false;
}
}
// outside of the expanded radii, unable to align, return false
return false;
}
// return 1 if bomb_objp is headed towards ship_objp
int bomb_headed_towards_ship(object *bomb_objp, object *ship_objp)
{
@@ -452,10 +357,9 @@ extern int Player_attacking_enabled;
void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
{
object *turret_parent_obj = &Objects[eeo->turret_parent_objnum];
ship *shipp;
ship *shipp;
ship_subsys *ss = eeo->turret_subsys;
float dist, dist_comp;
bool turret_has_no_target = false;
// Don't look for bombs when weapon system is not ok
if (objp->type == OBJ_WEAPON && !eeo->weapon_system_ok) {
@@ -572,10 +476,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
if ((objp->type == OBJ_WEAPON) && check_weapon) {
if ( Weapons[objp->instance].homing_object == &Objects[eeo->turret_parent_objnum] ) {
if ( dist_comp < eeo->nearest_homing_bomb_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
if ( (eeo->current_enemy == -1) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
eeo->nearest_homing_bomb_dist = dist_comp;
eeo->nearest_homing_bomb_objnum = OBJ_INDEX(objp);
}
@@ -583,10 +484,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
// if not homing, check if bomb is flying towards ship
} else if ( bomb_headed_towards_ship(objp, &Objects[eeo->turret_parent_objnum]) ) {
if ( dist_comp < eeo->nearest_bomb_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
if ( (eeo->current_enemy == -1) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
eeo->nearest_bomb_dist = dist_comp;
eeo->nearest_bomb_objnum = OBJ_INDEX(objp);
}
@@ -642,10 +540,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
// maybe update nearest attacker
if ( dist_comp < eeo->nearest_attacker_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
if ( (eeo->current_enemy == -1) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
// nprintf(("AI", "Nearest enemy = %s, dist = %7.3f, dot = %6.3f, fov = %6.3f\n", Ships[objp->instance].ship_name, dist, vm_vec_dot(&v2e, tvec), tp->turret_fov));
eeo->nearest_attacker_dist = dist_comp;
eeo->nearest_attacker_objnum = OBJ_INDEX(objp);
@@ -660,10 +555,7 @@ void evaluate_obj_as_target(object *objp, eval_enemy_obj_struct *eeo)
dist_comp *= 0.9f + (0.01f * asteroid_time_to_impact(objp));
if (dist_comp < eeo->nearest_dist ) {
if (!(ss->flags & SSF_FOV_REQUIRED) && (eeo->current_enemy == -1)) {
turret_has_no_target = true;
}
if ( (turret_has_no_target) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
if ( (eeo->current_enemy == -1) || object_in_turret_fov(objp, ss, eeo->tvec, eeo->tpos, dist + objp->radius) ) {
eeo->nearest_dist = dist_comp;
eeo->nearest_objnum = OBJ_INDEX(objp);
}
@@ -1053,13 +945,7 @@ int find_turret_enemy(ship_subsys *turret_subsys, int objnum, vec3d *tpos, vec3d
dist = vm_vec_normalized_dir(&v2e, &Objects[aip->target_objnum].pos, tpos);
in_fov = turret_fov_test(turret_subsys, tvec, &v2e);
if (turret_subsys->flags & SSF_FOV_EDGE_CHECK) {
if (in_fov == false)
if (object_in_turret_fov(&Objects[aip->target_objnum], turret_subsys, tvec, tpos, dist + Objects[aip->target_objnum].radius))
in_fov = true;
}
// MODIFY FOR ATTACKING BIG SHIP
// MODIFY FOR ATTACKING BIG SHIP
// dot += (0.5f * Objects[aip->target_objnum].radius / dist);
if (in_fov) {
return aip->target_objnum;
@@ -1122,9 +1008,7 @@ void ship_get_global_turret_gun_info(object *objp, ship_subsys *ssp, vec3d *gpos
vm_vec_normalized_dir(gvec, targetp, gpos);
}
ship_model_stop(objp);
// per firingpoint based changes go here for turrets
ship_model_stop(objp);
}
//Update turret aiming data based on max turret aim update delay
@@ -1220,11 +1104,6 @@ int aifft_rotate_turret(ship *shipp, int parent_objnum, ship_subsys *ss, object
in_fov = turret_fov_test(ss, gvec, &v2e);
if (ss->flags & SSF_FOV_EDGE_CHECK) {
if (in_fov == false)
in_fov = is_object_radius_in_turret_fov(&Objects[ss->turret_enemy_objnum], ss, gvec, &gun_pos, &v2e, predicted_enemy_pos, 0.0f);
}
if (in_fov) {
ret_val = model_rotate_gun(Ship_info[shipp->ship_info_index].model_num,
tp, &Objects[parent_objnum].orient,
@@ -1458,7 +1337,7 @@ void turret_set_next_fire_timestamp(int weapon_num, weapon_info *wip, ship_subsy
{
// make side even for team vs. team
if (MULTI_TEAM) {
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_TEAM)) {
// flak guns need to fire more rapidly
if (wip->wi_flags & WIF_FLAK) {
wait *= aip->ai_ship_fire_delay_scale_friendly * 0.5f;
@@ -1500,9 +1379,6 @@ void turret_set_next_fire_timestamp(int weapon_num, weapon_info *wip, ship_subsy
wait *= frand_range(0.9f, 1.1f);
}
if(turret->rof_scaler != 1.0f)
wait /= get_adjusted_turret_rof(turret);
(*fs_dest) = timestamp((int)wait);
}
@@ -2027,8 +1903,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));
@@ -2328,7 +2204,7 @@ bool turret_std_fov_test(ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mo
{
model_subsystem *tp = ss->system_info;
float dot = vm_vec_dot(v2e, gvec);
if (((dot + size_mod) >= tp->turret_fov) && ((dot - size_mod) <= tp->turret_max_fov))
if (((dot + size_mod) > tp->turret_fov) && ((dot - size_mod) <= tp->turret_max_fov))
return true;
return false;
@@ -2338,7 +2214,7 @@ bool turret_adv_fov_test(ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mo
{
model_subsystem *tp = ss->system_info;
float dot = vm_vec_dot(v2e, gvec);
if (((dot + size_mod) >= tp->turret_fov) && ((dot - size_mod) <= tp->turret_max_fov)) {
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 );
if ((of_dst.xyz.x == 0) && (of_dst.xyz.y == 0)) {
@@ -2348,7 +2224,7 @@ bool turret_adv_fov_test(ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mo
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)
if ((-of_dst.xyz.y + size_mod) > tp->turret_y_fov)
return true;
}
}
@@ -2366,28 +2242,3 @@ bool turret_fov_test(ship_subsys *ss, vec3d *gvec, vec3d *v2e, float size_mod)
return in_fov;
}
float get_adjusted_turret_rof(ship_subsys *ss)
{
float tempf = ss->rof_scaler;
// optional reset switch (negative value)
if (tempf < 0) {
ss->rof_scaler = 1.0f;
return 1.0f;
}
if (tempf == 0) {
// special case returning the number of firingpoints
ss->rof_scaler = (float) ss->system_info->turret_num_firing_points;
tempf = ss->rof_scaler;
// safety check to avoid div/0 issues
if (tempf == 0) {
ss->rof_scaler = 1.0f;
return 1.0f;
}
}
return tempf;
}
+6 -18
View File
@@ -112,13 +112,11 @@ MONITOR(NumANIPlayed)
// Setup an anim_play_struct for passing into anim_play(). Will fill in default values, which you
// can then change before calling anim_play().
//
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int base_w, int base_h)
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y)
{
aps->anim_info = a_info;
aps->x = x;
aps->y = y;
aps->base_w = base_w;
aps->base_h = base_h;
aps->start_at = 0;
aps->stop_at = a_info->total_frames - 1;
aps->screen_id = 0;
@@ -221,14 +219,6 @@ anim_instance *anim_play(anim_play_struct *aps)
instance->xlate_pal = 0;
}
if(aps->base_w < 0 || aps->base_h < 0) {
instance->base_w = gr_screen.max_w_unscaled;
instance->base_h = gr_screen.max_h_unscaled;
} else {
instance->base_w = aps->base_w;
instance->base_h = aps->base_h;
}
// determining the start_at frame is more complicated, since it must be a key-frame.
// Futhermore, need to subtract 1 from key-frame number, since frame number is always
// incremented the first time anim_show_next_frame() is called
@@ -531,8 +521,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
// determine x,y to display the bitmap at
if ( instance->world_pos == NULL ) {
gr_set_screen_scale(instance->base_w, instance->base_h);
gr_set_clip(0, 0, instance->base_w, instance->base_h, false);
if ( instance->aa_color == NULL ) {
gr_bitmap(instance->x, instance->y);
}
@@ -540,8 +528,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
gr_set_color_fast( (color*)instance->aa_color );
gr_aabitmap(instance->x, instance->y);
}
gr_reset_screen_scale();
gr_reset_clip();
}
else {
g3_rotate_vertex(&image_vertex,instance->world_pos);
@@ -1099,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){
+1 -3
View File
@@ -24,8 +24,6 @@ typedef struct {
anim *anim_info;
int x;
int y;
int base_w;
int base_h;
int start_at;
int stop_at;
int screen_id;
@@ -52,7 +50,7 @@ void anim_level_init();
void anim_level_close();
void anim_render_all(int screen_id, float frametime);
void anim_render_one(int screen_id, anim_instance *ani, float frametime);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int max_x = -1, int max_y = -1);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y);
anim_instance *anim_play(anim_play_struct *aps);
void anim_ignore_next_frametime();
int anim_stop_playing(anim_instance* anim_instance);
+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 -1
View File
@@ -71,7 +71,6 @@ typedef struct anim {
typedef struct anim_instance {
anim_instance *next, *prev;
int x,y; // coordinates anim is played at (top left corner of anim)
int base_w, base_h; // coordinate scale this anim is played in.
vec3d *world_pos; // world (x,y,z) position of explosion
float radius; // radius of image, needed for scaling
int frame_num; // current frame, or last frame if between frames (first frame is 0)
@@ -107,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);
+18 -5
View File
@@ -1584,7 +1584,7 @@ void asteroid_update_collide_flag(object *asteroid_objp)
asp->collide_objsig = -1;
// multiplayer dogfight
if(MULTI_DOGFIGHT){
if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)){
return;
}
@@ -1935,10 +1935,23 @@ void asteroid_show_brackets()
g3_rotate_vertex(&asteroid_vertex,&asteroid_objp->pos);
g3_project_vertex(&asteroid_vertex);
if ( Cmdline_targetinfo ) {
hud_target_add_display_list(asteroid_objp, &asteroid_vertex, &asteroid_objp->pos, 0, NULL, NULL, TARGET_DISPLAY_DIST | TARGET_DISPLAY_LEAD);
} else {
hud_target_add_display_list(asteroid_objp, &asteroid_vertex, &asteroid_objp->pos, 0, NULL, NULL, TARGET_DISPLAY_DIST);
if (!(asteroid_vertex.flags & PF_OVERFLOW)) {
gr_set_color_fast(iff_get_color(IFF_COLOR_SELECTION, 1));
hud_show_brackets(asteroid_objp, &asteroid_vertex);
if ( Cmdline_targetinfo ) {
hud_show_lead_indicator_quick(&asteroid_objp->pos, asteroid_objp);
}
}
// if asteroid is not on screen, draw an offscreen indicator
if ( hud_gauge_active(HUD_OFFSCREEN_INDICATOR) ) {
if (asteroid_vertex.codes != 0) {
float dist;
// dist = vm_vec_dist_quick(&Player_obj->pos, &asteroid_objp->pos);
dist = hud_find_target_distance( asteroid_objp, Player_obj );
gr_set_color_fast(iff_get_color(IFF_COLOR_SELECTION, 1));
hud_draw_offscreen_indicator(&asteroid_vertex, &asteroid_objp->pos, dist);
}
}
}
}
+1 -1
View File
@@ -1231,7 +1231,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"))
+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);
+2 -41
View File
@@ -9,7 +9,6 @@
#include "model/model.h" //polymodel, model_get
#include "playerman/player.h" //player_get_padlock_orient
#include "ship/ship.h" //compute_slew_matrix
#include "graphics/font.h"
//*************************IMPORTANT GLOBALS*************************
float VIEWER_ZOOM_DEFAULT = 0.75f; // Default viewer zoom, 0.625 as per multi-lateral agreement on 3/24/97
@@ -616,7 +615,7 @@ void warp_camera::get_info(vec3d *position, matrix *orientation)
//*************************subtitle*************************
#define MAX_SUBTITLE_LINES 64
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim, float in_display_time, float in_fade_time, color *in_text_color, int in_text_fontnum, bool center_x, bool center_y, int in_width, int in_height, bool in_post_shaded)
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim, float in_display_time, float in_fade_time, color *in_text_color, bool center_x, bool center_y, int in_width, int in_height, bool in_post_shaded)
{
// basic init, this always has to be done
memset( imageanim, 0, sizeof(imageanim) );
@@ -658,7 +657,6 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
text_color = *in_text_color;
else
gr_init_alphacolor(&text_color, 255, 255, 255, 255);
text_fontnum = in_text_fontnum;
//Setup display and fade time
display_time = fl_abs(in_display_time);
@@ -677,18 +675,6 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
int w=0, h=0, tw=0, th=0;
if(center_x || center_y)
{
// switch font because we need to measure it
int old_fontnum;
if (text_fontnum >= 0)
{
old_fontnum = gr_get_current_fontnum();
gr_set_font(text_fontnum);
}
else
{
old_fontnum = -1;
}
//Get text size
for(int i = 0; i < num_text_lines; i++)
{
@@ -700,12 +686,6 @@ subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, char* in_imageanim
th += h;
}
// restore old font
if (old_fontnum >= 0)
{
gr_set_font(old_fontnum);
}
//Get image size
if(image_id != -1)
{
@@ -775,18 +755,6 @@ void subtitle::do_frame(float frametime)
gr_set_color_fast(&text_color);
// save old font and set new font
int old_fontnum;
if (text_fontnum >= 0)
{
old_fontnum = gr_get_current_fontnum();
gr_set_font(text_fontnum);
}
else
{
old_fontnum = -1;
}
int font_height = gr_get_font_height();
int x = text_pos.x;
int y = text_pos.y;
@@ -797,13 +765,7 @@ void subtitle::do_frame(float frametime)
y += font_height;
}
// restore old font
if (old_fontnum >= 0)
{
gr_set_font(old_fontnum);
}
if(image_id >= 0)
if(image_id != -1)
{
gr_set_bitmap(image_id, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, text_color.alpha/255.0f);
@@ -848,7 +810,6 @@ void subtitle::clone(const subtitle &sub)
for (i = 0; i < sub.text_lines.size(); i++) {
text_lines.push_back(sub.text_lines[i]);
}
text_fontnum = sub.text_fontnum;
// copy the structs
text_pos = sub.text_pos;
+1 -2
View File
@@ -130,7 +130,6 @@ private:
float display_time;
float fade_time;
color text_color;
int text_fontnum;
//Done with set
char imageanim[MAX_FILENAME_LEN];
@@ -146,7 +145,7 @@ private:
bool post_shaded;
public:
subtitle(int in_x_pos, int in_y_pos, char* in_text = NULL, char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, color *in_text_color = NULL, int in_text_fontnum = -1,
float in_display_time = 0, float in_fade_time = 0.0f, color *in_text_color = NULL,
bool center_x = false, bool center_y = false, int in_width = 0, int in_height = 0, bool post_shaded=false);
~subtitle();
+48 -1
View File
@@ -78,7 +78,7 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
{ CF_TYPE_SQUAD_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx .png .dds", CF_TYPE_PLAYERS },
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".pl2 .cs2 .plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_PLAYERS },
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .bx", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .ibx .tsb", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .png .dds .fs2 .txt", CF_TYPE_DATA },
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
@@ -818,6 +818,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;*/
}
+21 -39
View File
@@ -77,9 +77,6 @@ enum
#define BUILD_CAP_OPENAL (1<<0)
#define BUILD_CAP_NO_D3D (1<<1)
#define BUILD_CAP_NEW_SND (1<<2)
#define PARSE_COMMAND_LINE_STRING "-parse_cmdline_only"
typedef struct
{
@@ -165,8 +162,6 @@ Flag exe_params[] =
{ "-disable_fbo", "Disable OpenGL RenderTargets", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-no_glsl", "Disable GLSL (shader) support", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-ati_swap", "Fix Color issues on some ATI cards", true, 0, EASY_DEFAULT, "Troubleshoot", "http://scp.indiegames.us/mantis/view.php?id=1669", },
{ "-no_3d_sound", "Use only 2D/stereo for sound effects", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-disable_glsl_model","Don't use shaders for model rendering", true, 0, EASY_DEFAULT, "Troubleshoot", "", },
{ "-ingame_join", "Allows ingame joining", true, 0, EASY_DEFAULT, "Experimental", "http://www.hard-light.net/wiki/index.php/Command-Line_Reference#-ingame_join", },
{ "-voicer", "Voice recognition", true, 0, EASY_DEFAULT, "Experimental", "", },
@@ -176,7 +171,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", },
@@ -253,6 +248,7 @@ cmdline_parm spec_point_arg("-spec_point", NULL);
cmdline_parm spec_tube_arg("-spec_tube", NULL);
cmdline_parm ambient_factor_arg("-ambient_factor", NULL); // Cmdline_ambient_factor
cmdline_parm cell_arg("-cell", NULL); // Cmdline_cell
cmdline_parm decals("-decals", NULL); // Cmdline_decals
cmdline_parm env("-env", NULL); // Cmdline_env
cmdline_parm mipmap_arg("-mipmap", NULL); // Cmdline_mipmap
cmdline_parm missile_lighting_arg("-missile_lighting", NULL); // Cmdline_missile_lighting
@@ -272,6 +268,7 @@ float Cmdline_fov = 0.75f;
float Cmdline_ogl_spec = 80.0f;
int Cmdline_ambient_factor = 128;
int Cmdline_cell = 0;
int Cmdline_decals = 0;
int Cmdline_env = 0;
int Cmdline_mipmap = 0;
int Cmdline_missile_lighting = 0;
@@ -364,8 +361,6 @@ cmdline_parm safeloading_arg("-safeloading", NULL); // Cmdline_safeloading -- U
cmdline_parm no_fbo_arg("-disable_fbo", NULL); // Cmdline_no_fbo
cmdline_parm noglsl_arg("-no_glsl", NULL); // Cmdline_noglsl -- disable GLSL support in OpenGL
cmdline_parm atiswap_arg("-ati_swap", NULL); // Cmdline_atiswap - Fix ATI color swap issue for screenshots.
cmdline_parm no3dsound_arg("-no_3d_sound", NULL); // Cmdline_no_3d_sound - Disable use of full 3D sounds
cmdline_parm no_glsl_models_arg("-disable_glsl_model", NULL); // Cmdline_no_glsl_model_rendering -- switches model rendering to fixed pipeline
int Cmdline_d3d_lesstmem = 0;
int Cmdline_load_all_weapons = 0;
@@ -378,8 +373,6 @@ int Cmdline_safeloading = 0;
int Cmdline_no_fbo = 0;
int Cmdline_noglsl = 0;
int Cmdline_ati_color_swap = 0;
int Cmdline_no_3d_sound = 0;
int Cmdline_no_glsl_model_rendering = 0;
// Developer/Testing related
cmdline_parm start_mission_arg("-start_mission", NULL); // Cmdline_start_mission
@@ -399,7 +392,6 @@ cmdline_parm window_arg("-window", NULL); // Cmdline_window
cmdline_parm fullscreen_window_arg("-fullscreen_window",NULL);
cmdline_parm res_arg("-res", NULL); // Cmdline_lores
cmdline_parm verify_vps_arg("-verify_vps", NULL); // Cmdline_verify_vps -- spew VP crcs to vp_crcs.txt
cmdline_parm parse_cmdline_only(PARSE_COMMAND_LINE_STRING, NULL);
#ifdef SCP_UNIX
cmdline_parm no_grab("-nograb", NULL); // Cmdline_no_grab
#endif
@@ -608,8 +600,8 @@ void os_validate_parms(char *cmdline)
char *token;
int parm_found;
token = strtok(cmdline, seps);
while(token != NULL) {
token = strtok(cmdline, seps);
while(token != NULL) {
if (token[0] == '-') {
parm_found = 0;
@@ -682,12 +674,6 @@ void os_init_cmdline(char *cmdline)
{
FILE *fp;
bool parse_config = true;
if (strstr(cmdline, PARSE_COMMAND_LINE_STRING) != NULL) {
parse_config = false;
}
// read the cmdline.cfg file from the data folder, and pass the command line arguments to
// the the parse_parms and validate_parms line. Read these first so anything actually on
// the command line will take precedence
@@ -712,7 +698,7 @@ void os_init_cmdline(char *cmdline)
#endif
// if the file exists, get a single line, and deal with it
if ( fp && parse_config ) {
if ( fp ) {
char *buf, *p;
size_t len = filelength( fileno(fp) ) + 2;
@@ -926,9 +912,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() ) {
@@ -949,11 +933,9 @@ bool SetCmdlineParams()
}
}
if (!Fred_running) { //There is no standalone FRED
// is this a standalone server??
if (standalone_arg.found()) {
Is_standalone = 1;
}
// is this a standalone server??
if (standalone_arg.found()) {
Is_standalone = 1;
}
// object update control
@@ -1264,10 +1246,6 @@ bool SetCmdlineParams()
Cmdline_noglsl = 1;
}
if (no_glsl_models_arg.found() ) {
Cmdline_no_glsl_model_rendering = 1;
}
if ( img2dds_arg.found() )
Cmdline_img2dds = 1;
@@ -1327,10 +1305,10 @@ bool SetCmdlineParams()
ubyte build_caps = 0;
/* portej05 defined this always */
build_caps |= BUILD_CAP_OPENAL;
build_caps |= BUILD_CAP_NO_D3D;
build_caps |= BUILD_CAP_NEW_SND;
#ifdef USE_OPENAL
build_caps |= BUILD_CAP_OPENAL;
#endif
fwrite(&build_caps, 1, 1, fp);
}
@@ -1364,6 +1342,13 @@ bool SetCmdlineParams()
Cmdline_env = 1;
}
if ( decals.found() ) {
#ifdef WIN32
MessageBox(NULL, "Decals have been disabled in builds after May 4, 2006. Please remove the \"-decals\" command line from the launcher to prevent this message from appearing the the future.", "", MB_OK | MB_ICONINFORMATION);
#endif
}
if ( ballistic_gauge.found() ) {
Cmdline_ballistic_gauge = 1;
}
@@ -1415,9 +1400,6 @@ bool SetCmdlineParams()
if ( verify_vps_arg.found() )
Cmdline_verify_vps = 1;
if ( no3dsound_arg.found() )
Cmdline_no_3d_sound = 1;
if ( atiswap_arg.found() )
{
Cmdline_ati_color_swap = 1;
@@ -1483,4 +1465,4 @@ int parse_cmdline(char *cmdline)
// If you're looking for the list of if (someparam.found()) { cmdline_someparam = something; } look above at this function
// I did this because of fred2_parse_cmdline()
return SetCmdlineParams();
}
}
+1 -2
View File
@@ -63,6 +63,7 @@ extern float static_point_factor;
extern float static_tube_factor;
extern int Cmdline_ambient_factor;
extern int Cmdline_cell;
extern int Cmdline_decals;
extern int Cmdline_env;
extern int Cmdline_mipmap;
extern int Cmdline_missile_lighting;
@@ -123,8 +124,6 @@ extern int Cmdline_safeloading;
extern int Cmdline_no_fbo;
extern int Cmdline_noglsl;
extern int Cmdline_ati_color_swap;
extern int Cmdline_no_3d_sound;
extern int Cmdline_no_glsl_model_rendering;
// Developer/Testing related
extern char *Cmdline_start_mission;
+23 -12
View File
@@ -35,6 +35,7 @@ char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
"2_ViewFootage-m"
};
size_t Num_cutscenes;
int Cutscenes_viewable;
int Description_index;
SCP_vector<cutscene_info> Cutscenes;
@@ -42,7 +43,7 @@ SCP_vector<cutscene_info> Cutscenes;
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
void cutscene_close()
{
for(size_t i = 0; i < Cutscenes.size(); i++)
for(size_t i = 0; i < Num_cutscenes; i++)
{
if(Cutscenes[i].description)
{
@@ -72,7 +73,7 @@ void cutscene_init()
reset_parse();
// parse in all the cutscenes
Cutscenes.clear();
Num_cutscenes = 0;
skip_to_string("#Cutscenes");
ignore_white_space();
@@ -96,6 +97,7 @@ void cutscene_init()
stuff_int( &cutinfo.cd );
Cutscenes.push_back(cutinfo);
Num_cutscenes++;
}
required_string("#End");
@@ -113,8 +115,9 @@ int cutscenes_get_cd_num( char *filename )
#if defined(OEM_BUILD)
return 0; // only 1 cd for OEM
#else
size_t i;
for (size_t i = 0; i < Cutscenes.size(); i++ ) {
for (i = 0; i < Num_cutscenes; i++ ) {
if ( !stricmp(Cutscenes[i].filename, filename) ) {
return (Cutscenes[i].cd - 1);
}
@@ -127,6 +130,7 @@ int cutscenes_get_cd_num( char *filename )
// marks a cutscene as viewable
void cutscene_mark_viewable(char *filename)
{
size_t i;
char cut_file[MAX_FILENAME_LEN];
char file[MAX_FILENAME_LEN];
@@ -142,7 +146,7 @@ void cutscene_mark_viewable(char *filename)
// change to lower case
strlwr(file);
for (size_t i = 0; i < Cutscenes.size(); i++ ) {
for (i = 0; i < Num_cutscenes; i++ ) {
// change the cutscene file name to lower case
strcpy_s(cut_file, Cutscenes[i].filename);
strlwr(cut_file);
@@ -167,6 +171,7 @@ void cutscene_mark_viewable(char *filename)
#define PLAY_BUTTON 6
#define EXIT_BUTTON 7
static int Num_files;
static SCP_vector<int> Cutscene_list;
//static int Stats_scroll_offset; // not used - taylor
static int Selected_line = 0; // line that is currently selected for binding
@@ -330,7 +335,7 @@ void cutscenes_screen_play()
char name[MAX_FILENAME_LEN]; // *full_name
int which_cutscene;
Assert( (Selected_line >= 0) && (Selected_line < (int)Cutscene_list.size()) );
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
which_cutscene = Cutscene_list[Selected_line];
strcpy_s(name, Cutscenes[which_cutscene].filename );
@@ -371,7 +376,7 @@ void cutscenes_screen_scroll_line_down()
{
int h;
if (Selected_line < (int)Cutscene_list.size() - 1) {
if (Selected_line < Num_files - 1) {
Selected_line++;
gamesnd_play_iface(SND_SCROLL);
@@ -408,7 +413,7 @@ void cutscenes_screen_scroll_screen_down()
int h;
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
if (Scroll_offset + h < (int)Cutscene_list.size()) {
if (Scroll_offset + h < Num_files) {
Scroll_offset++;
if (Selected_line < Scroll_offset){
Selected_line = Scroll_offset;
@@ -463,6 +468,7 @@ int cutscenes_screen_button_pressed(int n)
void cutscenes_screen_init()
{
int i;
size_t j;
ui_button_info *b;
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
@@ -506,10 +512,12 @@ void cutscenes_screen_init()
// if (All_movies_enabled)
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
Num_files = 0;
Cutscene_list.clear();
for (size_t j = 0; j < Cutscenes.size(); j++ ) {
for ( j = 0; j < Num_cutscenes; j++ ) {
if ( Cutscenes_viewable & (1<<j) ) {
Cutscene_list.push_back((int)j);
Num_files++;
}
}
}
@@ -525,6 +533,7 @@ void cutscenes_screen_close()
void cutscenes_screen_do_frame()
{
int i, k, y, z;
size_t t;
int font_height = gr_get_font_height();
int select_tease_line = -1;
@@ -567,9 +576,11 @@ void cutscenes_screen_do_frame()
// the "show-all" hotkey
case KEY_CTRLED | KEY_SHIFTED | KEY_S:
{
Num_files = 0;
Cutscene_list.clear();
for (size_t t = 0; t < Cutscenes.size(); t++) {
for (t = 0; t < Num_cutscenes; t++) {
Cutscene_list.push_back((int)t);
Num_files++;
}
break;
@@ -587,14 +598,14 @@ void cutscenes_screen_do_frame()
if (List_region.button_down()) {
List_region.get_mouse_pos(NULL, &y);
z = Scroll_offset + y / font_height;
if ((z >= 0) && (z < (int)Cutscene_list.size()))
if ((z >= 0) && (z < Num_files))
select_tease_line = z;
}
if (List_region.pressed()) {
List_region.get_mouse_pos(NULL, &y);
z = Scroll_offset + y / font_height;
if ((z >= 0) && (z < (int)Cutscene_list.size()))
if ((z >= 0) && (z < Num_files))
Selected_line = z;
}
@@ -619,7 +630,7 @@ void cutscenes_screen_do_frame()
y = 0;
z = Scroll_offset;
while (y + font_height <= Cutscene_list_coords[gr_screen.res][3]) {
if (z >= (int)Cutscene_list.size()){
if (z >= Num_files){
break;
}
+1
View File
@@ -27,6 +27,7 @@ typedef struct cutscene_info
} cutscene_info;
extern SCP_vector<cutscene_info> Cutscenes;
extern size_t Num_cutscenes;
extern int Cutscenes_viewable;
// initializa table data
+4
View File
@@ -1,5 +1,7 @@
#ifdef USE_OPENAL
static int audio_exp_table[256] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@ -55,3 +57,5 @@ void mveaudio_uncompress(short *buffer, unsigned char *data, int length)
sendWord(&buffer, nCurOffsets[1]);
processSwath(buffer, data, swath, nCurOffsets);
}
#endif
+13 -5
View File
@@ -19,7 +19,7 @@
#include "osapi/osapi.h"
#include "io/timer.h"
#include "sound/sound.h"
#include "sound/openal.h"
#include "sound/ds.h"
#include "bmpman/bmpman.h"
//#include "sound/audiostr.h"
@@ -45,6 +45,7 @@ static int mve_audio_canplay = 0;
static int mve_audio_compressed = 0;
static int audiobuf_created;
#ifdef USE_OPENAL
// struct for the audio stream information
typedef struct MVE_AUDIO_T {
ALenum format;
@@ -60,6 +61,7 @@ mve_audio_t *mas; // mve_audio_stream
// audio decompressor
extern void mveaudio_uncompress(short *buffer, unsigned char *data, int length);
#endif // USE_OPENAL
// video variables
int g_width, g_height;
@@ -225,6 +227,7 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
return;
}
#ifdef USE_OPENAL
int flags, desired_buffer, sample_rate;
mas = (mve_audio_t *) vm_malloc ( sizeof(mve_audio_t) );
@@ -275,6 +278,7 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
OpenAL_ErrorPrint( alSourcef(mas->source_id, AL_GAIN, 1.0f) );
memset(mas->audio_buffer, 0, MVE_AUDIO_BUFFERS * sizeof(ALuint));
#endif // USE_OPENAL
mve_audio_buffer_tail = 0;
@@ -285,6 +289,7 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
void mve_audio_play()
{
if (mve_audio_canplay) {
#ifdef USE_OPENAL
ALint status, bqueued;
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_SOURCE_STATE, &status), return );
@@ -296,6 +301,7 @@ void mve_audio_play()
if (status != AL_PLAYING && bqueued > 0) {
OpenAL_ErrorPrint( alSourcePlay(mas->source_id) );
}
#endif // USE_OPENAL
}
}
@@ -305,6 +311,7 @@ static void mve_audio_stop()
if (!audiobuf_created)
return;
#ifdef USE_OPENAL
ALint p = 0;
mve_audio_playing = 0;
@@ -325,6 +332,7 @@ static void mve_audio_stop()
vm_free(mas);
mas = NULL;
}
#endif // USE_OPENAL
}
int mve_audio_data(ubyte major, ubyte *data)
@@ -334,6 +342,7 @@ int mve_audio_data(ubyte major, ubyte *data)
int nsamp;
if (mve_audio_canplay) {
#ifdef USE_OPENAL
chan = mve_get_ushort(data + 2);
nsamp = mve_get_ushort(data + 4);
@@ -400,6 +409,7 @@ int mve_audio_data(ubyte major, ubyte *data)
mprintf(("MVE: Buffer overrun: Queue full\n"));
}
}
#endif // USE_OPENAL
}
return 1;
@@ -668,10 +678,8 @@ int mve_video_init(ubyte *data)
GL_state.SetAlphaBlendMode(ALPHA_BLEND_NONE);
GL_state.SetZbufferType(ZBUFFER_TYPE_NONE);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GL_state.Texture.SetWrapS(GL_CLAMP_TO_EDGE);
GL_state.Texture.SetWrapT(GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_RGB5_A1, wp2, hp2, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
+3 -5
View File
@@ -20,7 +20,7 @@
#include "io/key.h"
#include "osapi/osapi.h"
#include "sound/sound.h"
#include "sound/openal.h"
#include "sound/ds.h"
#include "bmpman/bmpman.h"
#include "cutscene/oggplayer.h"
#include "io/timer.h"
@@ -360,10 +360,8 @@ static void OGG_video_init(theora_info *tinfo)
GL_state.SetAlphaBlendMode(ALPHA_BLEND_NONE);
GL_state.SetZbufferType(ZBUFFER_TYPE_NONE);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GL_state.Texture.SetWrapS(GL_CLAMP_TO_EDGE);
GL_state.Texture.SetWrapT(GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_RGB8, wp2, hp2, 0, GL_BGR, GL_UNSIGNED_BYTE, NULL);
+1 -1
View File
@@ -42,7 +42,7 @@ typedef struct debris {
vec3d arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
int arc_timestamp[MAX_DEBRIS_ARCS]; // When this times out, the spark goes away. -1 is not used
int arc_frequency; // Starts at 0, gets bigger
int parent_alt_name;
char parent_alt_name;
float damage_mult;
} debris;
File diff suppressed because it is too large. Load diff
+129
View File
@@ -0,0 +1,129 @@
//header file for making decals-Bobboau
#ifndef _DECAL_H
#define _DECAL_H
#include "object/object.h"
#include "globalincs/pstypes.h"
//#include "ship/ship.h"
#ifdef ENABLE_DECALS
#define MAX_DECAL_POLY 40
#define MAX_DECAL_POLY_POINT 10
#define MAX_DECAL_DEFPOINTS 10000
#define MAX_DECAL_POINT 10
#define MAX_SHIP_DECALS 25
#define MAX_GLOBAL_DECAL_POLYS 11000
#define QUICKFIND_SUBDIVISION 100
#define QUICKFIND_SEGMENT_LENGTH (MAX_GLOBAL_DECAL_POLYS/QUICKFIND_SUBDIVISION)
#define MAX_GLOBAL_DECALS 5000
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
#endif // ENABLE_DECALS
struct decal;
struct decal_list;
struct decal_list_controle;
struct decal_poly{
vec3d norm[3];
vertex point[3];
decal_poly *next;
decal* parent;
int idx;
};
struct decal{
int n_poly;
int timestamp; //when this decal was created
int burn_time; //how long it takes for the glow texture to fade
int vertex_buffer_start; //were is the start of this decal's polys in the vertex buffer
decal_poly* poly;
decal_poly* add_poly();
decal_poly* get_last_poly();
void remove_last_poly();
decal_list_controle *parent;
};
struct decal_list{
decal dec;
decal_list *next;
};
struct decal_item{
decal_list dec;
bool used;
};
struct decal_list_controle{
int n_decals;
int buffer;
int texture;
int n_poly;
int burn_texture;
int glow_texture;
bool modifyed;
decal_list *d_list;
decal_list *end;
decal_list *add_new();
void trim();
void clear();
~decal_list_controle();
decal_list_controle();
};
struct decal_system{
decal_list_controle *decals;
int n_decal_textures;
bool decals_modified;
int max_decals;
decal_system():decals(NULL),n_decal_textures(0),decals_modified(false){};
};
//this is used to give all the data to the generation data to the functions that make them
struct decal_point{
vec3d pnt;
matrix orient;
float radius;
};
#ifdef ENABLE_DECALS
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000);//makes the decal
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
void decal_render_all(object * obj); //renders all decals
int decal_create_sub(void *model_ptr);
void clear_decals(decal_system *system);
void init_decals();
#else // ENABLE_DECALS
inline int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000)
{
return 0;
}
#define decal_create_simple(a, b, c) (0)
#define decal_render_all(a)
#define decal_create_sub(a) (0);
#define clear_decals(a)
#define init_decals()
#endif // ENABLE_DECALS
#endif // _DECAL_H
+864
View File
@@ -0,0 +1,864 @@
/*==========================================================================;
*
* Copyright (C) 1995,1996 Microsoft Corporation. All Rights Reserved.
*
* File: dsound.h
* Content: DirectSound include file
*
**************************************************************************/
#ifndef __DSOUND_INCLUDED__
#define __DSOUND_INCLUDED__
#include "directx/vd3dtypes.h"
#define COM_NO_WINDOWS_H
#include <objbase.h>
#define _FACDS 0x878
#define MAKE_DSHRESULT(code) MAKE_HRESULT(1, _FACDS, code)
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
// Direct Sound Component GUID {47D4D946-62E8-11cf-93BC-444553540000}
DEFINE_GUID(CLSID_DirectSound, 0x47d4d946, 0x62e8, 0x11cf, 0x93, 0xbc, 0x44, 0x45, 0x53, 0x54, 0x0, 0x0);
// DirectSound Capture Component GUID {B0210780-89CD-11d0-AF08-00A0C925CD16}
DEFINE_GUID(CLSID_DirectSoundCapture, 0xb0210780, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
//
// Structures
//
#ifdef __cplusplus
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
struct IDirectSound;
struct IDirectSoundBuffer;
struct IDirectSound3DListener;
struct IDirectSound3DBuffer;
struct IDirectSoundCapture;
struct IDirectSoundCaptureBuffer;
struct IDirectSoundNotify;
#endif // __cplusplus
typedef struct IDirectSound *LPDIRECTSOUND;
typedef struct IDirectSoundBuffer *LPDIRECTSOUNDBUFFER;
typedef struct IDirectSound3DListener *LPDIRECTSOUND3DLISTENER;
typedef struct IDirectSound3DBuffer *LPDIRECTSOUND3DBUFFER;
typedef struct IDirectSoundCapture *LPDIRECTSOUNDCAPTURE;
typedef struct IDirectSoundCaptureBuffer *LPDIRECTSOUNDCAPTUREBUFFER;
typedef struct IDirectSoundNotify *LPDIRECTSOUNDNOTIFY;
typedef struct _DSCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwMinSecondarySampleRate;
DWORD dwMaxSecondarySampleRate;
DWORD dwPrimaryBuffers;
DWORD dwMaxHwMixingAllBuffers;
DWORD dwMaxHwMixingStaticBuffers;
DWORD dwMaxHwMixingStreamingBuffers;
DWORD dwFreeHwMixingAllBuffers;
DWORD dwFreeHwMixingStaticBuffers;
DWORD dwFreeHwMixingStreamingBuffers;
DWORD dwMaxHw3DAllBuffers;
DWORD dwMaxHw3DStaticBuffers;
DWORD dwMaxHw3DStreamingBuffers;
DWORD dwFreeHw3DAllBuffers;
DWORD dwFreeHw3DStaticBuffers;
DWORD dwFreeHw3DStreamingBuffers;
DWORD dwTotalHwMemBytes;
DWORD dwFreeHwMemBytes;
DWORD dwMaxContigFreeHwMemBytes;
DWORD dwUnlockTransferRateHwBuffers;
DWORD dwPlayCpuOverheadSwBuffers;
DWORD dwReserved1;
DWORD dwReserved2;
} DSCAPS, *LPDSCAPS;
typedef const DSCAPS *LPCDSCAPS;
typedef struct _DSBCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwUnlockTransferRate;
DWORD dwPlayCpuOverhead;
} DSBCAPS, *LPDSBCAPS;
typedef const DSBCAPS *LPCDSBCAPS;
typedef struct _DSBUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
} DSBUFFERDESC, *LPDSBUFFERDESC;
typedef const DSBUFFERDESC *LPCDSBUFFERDESC;
typedef struct _DS3DBUFFER
{
DWORD dwSize;
D3DVECTOR vPosition;
D3DVECTOR vVelocity;
DWORD dwInsideConeAngle;
DWORD dwOutsideConeAngle;
D3DVECTOR vConeOrientation;
LONG lConeOutsideVolume;
D3DVALUE flMinDistance;
D3DVALUE flMaxDistance;
DWORD dwMode;
} DS3DBUFFER, *LPDS3DBUFFER;
typedef const DS3DBUFFER *LPCDS3DBUFFER;
typedef struct _DS3DLISTENER
{
DWORD dwSize;
D3DVECTOR vPosition;
D3DVECTOR vVelocity;
D3DVECTOR vOrientFront;
D3DVECTOR vOrientTop;
D3DVALUE flDistanceFactor;
D3DVALUE flRolloffFactor;
D3DVALUE flDopplerFactor;
} DS3DLISTENER, *LPDS3DLISTENER;
typedef const DS3DLISTENER *LPCDS3DLISTENER;
typedef struct _DSCCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwFormats;
DWORD dwChannels;
} DSCCAPS, *LPDSCCAPS;
typedef const DSCCAPS *LPCDSCCAPS;
typedef struct _DSCBUFFERDESC
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
LPWAVEFORMATEX lpwfxFormat;
} DSCBUFFERDESC, *LPDSCBUFFERDESC;
typedef const DSCBUFFERDESC *LPCDSCBUFFERDESC;
typedef struct _DSCBCAPS
{
DWORD dwSize;
DWORD dwFlags;
DWORD dwBufferBytes;
DWORD dwReserved;
} DSCBCAPS, *LPDSCBCAPS;
typedef const DSCBCAPS *LPCDSCBCAPS;
typedef struct _DSBPOSITIONNOTIFY
{
DWORD dwOffset;
HANDLE hEventNotify;
} DSBPOSITIONNOTIFY, *LPDSBPOSITIONNOTIFY;
typedef const DSBPOSITIONNOTIFY *LPCDSBPOSITIONNOTIFY;
//
// Compatibility typedefs
//
typedef LPDIRECTSOUND *LPLPDIRECTSOUND;
typedef LPDIRECTSOUNDBUFFER *LPLPDIRECTSOUNDBUFFER;
typedef LPDIRECTSOUND3DLISTENER *LPLPDIRECTSOUND3DLISTENER;
typedef LPDIRECTSOUND3DBUFFER *LPLPDIRECTSOUND3DBUFFER;
typedef LPDIRECTSOUNDCAPTURE *LPLPDIRECTSOUNDCAPTURE;
typedef LPDIRECTSOUNDCAPTUREBUFFER *LPLPDIRECTSOUNDCAPTUREBUFFER;
typedef LPDIRECTSOUNDNOTIFY *LPLPDIRECTSOUNDNOTIFY;
typedef LPVOID *LPLPVOID;
typedef const WAVEFORMATEX *LPCWAVEFORMATEX;
//
// DirectSound API
//
typedef BOOL (CALLBACK *LPDSENUMCALLBACKW)(LPGUID, LPCWSTR, LPCWSTR, LPVOID);
typedef BOOL (CALLBACK *LPDSENUMCALLBACKA)(LPGUID, LPCSTR, LPCSTR, LPVOID);
extern HRESULT WINAPI DirectSoundCreate(LPGUID, LPDIRECTSOUND *, LPUNKNOWN);
extern HRESULT WINAPI DirectSoundEnumerateW(LPDSENUMCALLBACKW, LPVOID);
extern HRESULT WINAPI DirectSoundEnumerateA(LPDSENUMCALLBACKA, LPVOID);
extern HRESULT WINAPI DirectSoundCaptureCreate(LPGUID, LPDIRECTSOUNDCAPTURE *, LPUNKNOWN);
extern HRESULT WINAPI DirectSoundCaptureEnumerateW(LPDSENUMCALLBACKW, LPVOID);
extern HRESULT WINAPI DirectSoundCaptureEnumerateA(LPDSENUMCALLBACKA, LPVOID);
#ifdef UNICODE
#define LPDSENUMCALLBACK LPDSENUMCALLBACKW
#define DirectSoundEnumerate DirectSoundEnumerateW
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateW
#else // UNICODE
#define LPDSENUMCALLBACK LPDSENUMCALLBACKA
#define DirectSoundEnumerate DirectSoundEnumerateA
#define DirectSoundCaptureEnumerate DirectSoundCaptureEnumerateA
#endif // UNICODE
//
// IDirectSound
//
DEFINE_GUID(IID_IDirectSound, 0x279AFA83, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
#undef INTERFACE
#define INTERFACE IDirectSound
DECLARE_INTERFACE_(IDirectSound, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSound methods
STDMETHOD(CreateSoundBuffer) (THIS_ LPCDSBUFFERDESC, LPDIRECTSOUNDBUFFER *, LPUNKNOWN) PURE;
STDMETHOD(GetCaps) (THIS_ LPDSCAPS) PURE;
STDMETHOD(DuplicateSoundBuffer) (THIS_ LPDIRECTSOUNDBUFFER, LPDIRECTSOUNDBUFFER *) PURE;
STDMETHOD(SetCooperativeLevel) (THIS_ HWND, DWORD) PURE;
STDMETHOD(Compact) (THIS) PURE;
STDMETHOD(GetSpeakerConfig) (THIS_ LPDWORD) PURE;
STDMETHOD(SetSpeakerConfig) (THIS_ DWORD) PURE;
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSound_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->lpVtbl->CreateSoundBuffer(p,a,b,c)
#define IDirectSound_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->lpVtbl->DuplicateSoundBuffer(p,a,b)
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->lpVtbl->SetCooperativeLevel(p,a,b)
#define IDirectSound_Compact(p) (p)->lpVtbl->Compact(p)
#define IDirectSound_GetSpeakerConfig(p,a) (p)->lpVtbl->GetSpeakerConfig(p,a)
#define IDirectSound_SetSpeakerConfig(p,b) (p)->lpVtbl->SetSpeakerConfig(p,b)
#define IDirectSound_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSound_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound_AddRef(p) (p)->AddRef()
#define IDirectSound_Release(p) (p)->Release()
#define IDirectSound_CreateSoundBuffer(p,a,b,c) (p)->CreateSoundBuffer(a,b,c)
#define IDirectSound_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSound_DuplicateSoundBuffer(p,a,b) (p)->DuplicateSoundBuffer(a,b)
#define IDirectSound_SetCooperativeLevel(p,a,b) (p)->SetCooperativeLevel(a,b)
#define IDirectSound_Compact(p) (p)->Compact()
#define IDirectSound_GetSpeakerConfig(p,a) (p)->GetSpeakerConfig(a)
#define IDirectSound_SetSpeakerConfig(p,b) (p)->SetSpeakerConfig(b)
#define IDirectSound_Initialize(p,a) (p)->Initialize(a)
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IDirectSoundBuffer
//
DEFINE_GUID(IID_IDirectSoundBuffer, 0x279AFA85, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
#undef INTERFACE
#define INTERFACE IDirectSoundBuffer
DECLARE_INTERFACE_(IDirectSoundBuffer, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSoundBuffer methods
STDMETHOD(GetCaps) (THIS_ LPDSBCAPS) PURE;
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD) PURE;
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD) PURE;
STDMETHOD(GetVolume) (THIS_ LPLONG) PURE;
STDMETHOD(GetPan) (THIS_ LPLONG) PURE;
STDMETHOD(GetFrequency) (THIS_ LPDWORD) PURE;
STDMETHOD(GetStatus) (THIS_ LPDWORD) PURE;
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUND, LPCDSBUFFERDESC) PURE;
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
STDMETHOD(Play) (THIS_ DWORD, DWORD, DWORD) PURE;
STDMETHOD(SetCurrentPosition) (THIS_ DWORD) PURE;
STDMETHOD(SetFormat) (THIS_ LPCWAVEFORMATEX) PURE;
STDMETHOD(SetVolume) (THIS_ LONG) PURE;
STDMETHOD(SetPan) (THIS_ LONG) PURE;
STDMETHOD(SetFrequency) (THIS_ DWORD) PURE;
STDMETHOD(Stop) (THIS) PURE;
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(Restore) (THIS) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundBuffer_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSoundBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
#define IDirectSoundBuffer_GetVolume(p,a) (p)->lpVtbl->GetVolume(p,a)
#define IDirectSoundBuffer_GetPan(p,a) (p)->lpVtbl->GetPan(p,a)
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->lpVtbl->GetFrequency(p,a)
#define IDirectSoundBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->lpVtbl->Play(p,a,b,c)
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->lpVtbl->SetCurrentPosition(p,a)
#define IDirectSoundBuffer_SetFormat(p,a) (p)->lpVtbl->SetFormat(p,a)
#define IDirectSoundBuffer_SetVolume(p,a) (p)->lpVtbl->SetVolume(p,a)
#define IDirectSoundBuffer_SetPan(p,a) (p)->lpVtbl->SetPan(p,a)
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->lpVtbl->SetFrequency(p,a)
#define IDirectSoundBuffer_Stop(p) (p)->lpVtbl->Stop(p)
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
#define IDirectSoundBuffer_Restore(p) (p)->lpVtbl->Restore(p)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundBuffer_AddRef(p) (p)->AddRef()
#define IDirectSoundBuffer_Release(p) (p)->Release()
#define IDirectSoundBuffer_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
#define IDirectSoundBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
#define IDirectSoundBuffer_GetVolume(p,a) (p)->GetVolume(a)
#define IDirectSoundBuffer_GetPan(p,a) (p)->GetPan(a)
#define IDirectSoundBuffer_GetFrequency(p,a) (p)->GetFrequency(a)
#define IDirectSoundBuffer_GetStatus(p,a) (p)->GetStatus(a)
#define IDirectSoundBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
#define IDirectSoundBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
#define IDirectSoundBuffer_Play(p,a,b,c) (p)->Play(a,b,c)
#define IDirectSoundBuffer_SetCurrentPosition(p,a) (p)->SetCurrentPosition(a)
#define IDirectSoundBuffer_SetFormat(p,a) (p)->SetFormat(a)
#define IDirectSoundBuffer_SetVolume(p,a) (p)->SetVolume(a)
#define IDirectSoundBuffer_SetPan(p,a) (p)->SetPan(a)
#define IDirectSoundBuffer_SetFrequency(p,a) (p)->SetFrequency(a)
#define IDirectSoundBuffer_Stop(p) (p)->Stop()
#define IDirectSoundBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
#define IDirectSoundBuffer_Restore(p) (p)->Restore()
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IDirectSound3DListener
//
DEFINE_GUID(IID_IDirectSound3DListener, 0x279AFA84, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
#undef INTERFACE
#define INTERFACE IDirectSound3DListener
DECLARE_INTERFACE_(IDirectSound3DListener, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID FAR *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSound3D methods
STDMETHOD(GetAllParameters) (THIS_ LPDS3DLISTENER) PURE;
STDMETHOD(GetDistanceFactor) (THIS_ LPD3DVALUE) PURE;
STDMETHOD(GetDopplerFactor) (THIS_ LPD3DVALUE) PURE;
STDMETHOD(GetOrientation) (THIS_ LPD3DVECTOR, LPD3DVECTOR) PURE;
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
STDMETHOD(GetRolloffFactor) (THIS_ LPD3DVALUE) PURE;
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DLISTENER, DWORD) PURE;
STDMETHOD(SetDistanceFactor) (THIS_ D3DVALUE, DWORD) PURE;
STDMETHOD(SetDopplerFactor) (THIS_ D3DVALUE, DWORD) PURE;
STDMETHOD(SetOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
STDMETHOD(SetRolloffFactor) (THIS_ D3DVALUE, DWORD) PURE;
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
STDMETHOD(CommitDeferredSettings) (THIS) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound3DListener_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound3DListener_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->lpVtbl->GetDistanceFactor(p,a)
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->lpVtbl->GetDopplerFactor(p,a)
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->lpVtbl->GetOrientation(p,a,b)
#define IDirectSound3DListener_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->lpVtbl->GetRolloffFactor(p,a)
#define IDirectSound3DListener_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->lpVtbl->SetDistanceFactor(p,a,b)
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->lpVtbl->SetDopplerFactor(p,a,b)
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->lpVtbl->SetOrientation(p,a,b,c,d,e,f,g)
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->lpVtbl->SetRolloffFactor(p,a,b)
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->lpVtbl->CommitDeferredSettings(p)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSound3DListener_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound3DListener_AddRef(p) (p)->AddRef()
#define IDirectSound3DListener_Release(p) (p)->Release()
#define IDirectSound3DListener_GetAllParameters(p,a) (p)->GetAllParameters(a)
#define IDirectSound3DListener_GetDistanceFactor(p,a) (p)->GetDistanceFactor(a)
#define IDirectSound3DListener_GetDopplerFactor(p,a) (p)->GetDopplerFactor(a)
#define IDirectSound3DListener_GetOrientation(p,a,b) (p)->GetOrientation(a,b)
#define IDirectSound3DListener_GetPosition(p,a) (p)->GetPosition(a)
#define IDirectSound3DListener_GetRolloffFactor(p,a) (p)->GetRolloffFactor(a)
#define IDirectSound3DListener_GetVelocity(p,a) (p)->GetVelocity(a)
#define IDirectSound3DListener_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
#define IDirectSound3DListener_SetDistanceFactor(p,a,b) (p)->SetDistanceFactor(a,b)
#define IDirectSound3DListener_SetDopplerFactor(p,a,b) (p)->SetDopplerFactor(a,b)
#define IDirectSound3DListener_SetOrientation(p,a,b,c,d,e,f,g) (p)->SetOrientation(a,b,c,d,e,f,g)
#define IDirectSound3DListener_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
#define IDirectSound3DListener_SetRolloffFactor(p,a,b) (p)->SetRolloffFactor(a,b)
#define IDirectSound3DListener_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
#define IDirectSound3DListener_CommitDeferredSettings(p) (p)->CommitDeferredSettings()
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IDirectSound3DBuffer
//
DEFINE_GUID(IID_IDirectSound3DBuffer, 0x279AFA86, 0x4981, 0x11CE, 0xA5, 0x21, 0x00, 0x20, 0xAF, 0x0B, 0xE5, 0x60);
#undef INTERFACE
#define INTERFACE IDirectSound3DBuffer
DECLARE_INTERFACE_(IDirectSound3DBuffer, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSoundBuffer3D methods
STDMETHOD(GetAllParameters) (THIS_ LPDS3DBUFFER) PURE;
STDMETHOD(GetConeAngles) (THIS_ LPDWORD, LPDWORD) PURE;
STDMETHOD(GetConeOrientation) (THIS_ LPD3DVECTOR) PURE;
STDMETHOD(GetConeOutsideVolume) (THIS_ LPLONG) PURE;
STDMETHOD(GetMaxDistance) (THIS_ LPD3DVALUE) PURE;
STDMETHOD(GetMinDistance) (THIS_ LPD3DVALUE) PURE;
STDMETHOD(GetMode) (THIS_ LPDWORD) PURE;
STDMETHOD(GetPosition) (THIS_ LPD3DVECTOR) PURE;
STDMETHOD(GetVelocity) (THIS_ LPD3DVECTOR) PURE;
STDMETHOD(SetAllParameters) (THIS_ LPCDS3DBUFFER, DWORD) PURE;
STDMETHOD(SetConeAngles) (THIS_ DWORD, DWORD, DWORD) PURE;
STDMETHOD(SetConeOrientation) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
STDMETHOD(SetConeOutsideVolume) (THIS_ LONG, DWORD) PURE;
STDMETHOD(SetMaxDistance) (THIS_ D3DVALUE, DWORD) PURE;
STDMETHOD(SetMinDistance) (THIS_ D3DVALUE, DWORD) PURE;
STDMETHOD(SetMode) (THIS_ DWORD, DWORD) PURE;
STDMETHOD(SetPosition) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
STDMETHOD(SetVelocity) (THIS_ D3DVALUE, D3DVALUE, D3DVALUE, DWORD) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSound3DBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSound3DBuffer_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->lpVtbl->GetAllParameters(p,a)
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->lpVtbl->GetConeAngles(p,a,b)
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->lpVtbl->GetConeOrientation(p,a)
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->lpVtbl->GetConeOutsideVolume(p,a)
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->lpVtbl->GetPosition(p,a)
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->lpVtbl->GetMinDistance(p,a)
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->lpVtbl->GetMaxDistance(p,a)
#define IDirectSound3DBuffer_GetMode(p,a) (p)->lpVtbl->GetMode(p,a)
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->lpVtbl->GetVelocity(p,a)
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->lpVtbl->SetAllParameters(p,a,b)
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->lpVtbl->SetConeAngles(p,a,b,c)
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->lpVtbl->SetConeOrientation(p,a,b,c,d)
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->lpVtbl->SetConeOutsideVolume(p,a,b)
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->lpVtbl->SetPosition(p,a,b,c,d)
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->lpVtbl->SetMinDistance(p,a,b)
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->lpVtbl->SetMaxDistance(p,a,b)
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->lpVtbl->SetMode(p,a,b)
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->lpVtbl->SetVelocity(p,a,b,c,d)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSound3DBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSound3DBuffer_AddRef(p) (p)->AddRef()
#define IDirectSound3DBuffer_Release(p) (p)->Release()
#define IDirectSound3DBuffer_GetAllParameters(p,a) (p)->GetAllParameters(a)
#define IDirectSound3DBuffer_GetConeAngles(p,a,b) (p)->GetConeAngles(a,b)
#define IDirectSound3DBuffer_GetConeOrientation(p,a) (p)->GetConeOrientation(a)
#define IDirectSound3DBuffer_GetConeOutsideVolume(p,a) (p)->GetConeOutsideVolume(a)
#define IDirectSound3DBuffer_GetPosition(p,a) (p)->GetPosition(a)
#define IDirectSound3DBuffer_GetMinDistance(p,a) (p)->GetMinDistance(a)
#define IDirectSound3DBuffer_GetMaxDistance(p,a) (p)->GetMaxDistance(a)
#define IDirectSound3DBuffer_GetMode(p,a) (p)->GetMode(a)
#define IDirectSound3DBuffer_GetVelocity(p,a) (p)->GetVelocity(a)
#define IDirectSound3DBuffer_SetAllParameters(p,a,b) (p)->SetAllParameters(a,b)
#define IDirectSound3DBuffer_SetConeAngles(p,a,b,c) (p)->SetConeAngles(a,b,c)
#define IDirectSound3DBuffer_SetConeOrientation(p,a,b,c,d) (p)->SetConeOrientation(a,b,c,d)
#define IDirectSound3DBuffer_SetConeOutsideVolume(p,a,b)(p)->SetConeOutsideVolume(a,b)
#define IDirectSound3DBuffer_SetPosition(p,a,b,c,d) (p)->SetPosition(a,b,c,d)
#define IDirectSound3DBuffer_SetMinDistance(p,a,b) (p)->SetMinDistance(a,b)
#define IDirectSound3DBuffer_SetMaxDistance(p,a,b) (p)->SetMaxDistance(a,b)
#define IDirectSound3DBuffer_SetMode(p,a,b) (p)->SetMode(a,b)
#define IDirectSound3DBuffer_SetVelocity(p,a,b,c,d) (p)->SetVelocity(a,b,c,d)
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IDirectSoundCapture
//
DEFINE_GUID(IID_IDirectSoundCapture, 0xb0210781, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
#undef INTERFACE
#define INTERFACE IDirectSoundCapture
DECLARE_INTERFACE_(IDirectSoundCapture, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSoundCapture methods
STDMETHOD(CreateCaptureBuffer) (THIS_ LPCDSCBUFFERDESC, LPDIRECTSOUNDCAPTUREBUFFER *, LPUNKNOWN) PURE;
STDMETHOD(GetCaps) (THIS_ LPDSCCAPS ) PURE;
STDMETHOD(Initialize) (THIS_ LPGUID) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundCapture_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundCapture_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->lpVtbl->CreateCaptureBuffer(p,a,b,c)
#define IDirectSoundCapture_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundCapture_Initialize(p,a) (p)->lpVtbl->Initialize(p,a)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundCapture_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundCapture_AddRef(p) (p)->AddRef()
#define IDirectSoundCapture_Release(p) (p)->Release()
#define IDirectSoundCapture_CreateCaptureBuffer(p,a,b,c) (p)->CreateCaptureBuffer(a,b,c)
#define IDirectSoundCapture_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundCapture_Initialize(p,a) (p)->Initialize(a)
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IDirectSoundCaptureBuffer
//
DEFINE_GUID(IID_IDirectSoundCaptureBuffer, 0xb0210782, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
#undef INTERFACE
#define INTERFACE IDirectSoundCaptureBuffer
DECLARE_INTERFACE_(IDirectSoundCaptureBuffer, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSoundCaptureBuffer methods
STDMETHOD(GetCaps) (THIS_ LPDSCBCAPS ) PURE;
STDMETHOD(GetCurrentPosition) (THIS_ LPDWORD, LPDWORD ) PURE;
STDMETHOD(GetFormat) (THIS_ LPWAVEFORMATEX, DWORD, LPDWORD ) PURE;
STDMETHOD(GetStatus) (THIS_ LPDWORD ) PURE;
STDMETHOD(Initialize) (THIS_ LPDIRECTSOUNDCAPTURE, LPCDSCBUFFERDESC) PURE;
STDMETHOD(Lock) (THIS_ DWORD, DWORD, LPVOID *, LPDWORD, LPVOID *, LPDWORD, DWORD) PURE;
STDMETHOD(Start) (THIS_ DWORD) PURE;
STDMETHOD(Stop) (THIS) PURE;
STDMETHOD(Unlock) (THIS_ LPVOID, DWORD, LPVOID, DWORD) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundCaptureBuffer_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->lpVtbl->GetCaps(p,a)
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->lpVtbl->GetCurrentPosition(p,a,b)
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->lpVtbl->GetFormat(p,a,b,c)
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->lpVtbl->GetStatus(p,a)
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->lpVtbl->Initialize(p,a,b)
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->lpVtbl->Lock(p,a,b,c,d,e,f,g)
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->lpVtbl->Start(p,a)
#define IDirectSoundCaptureBuffer_Stop(p) (p)->lpVtbl->Stop(p)
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->lpVtbl->Unlock(p,a,b,c,d)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundCaptureBuffer_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundCaptureBuffer_AddRef(p) (p)->AddRef()
#define IDirectSoundCaptureBuffer_Release(p) (p)->Release()
#define IDirectSoundCaptureBuffer_GetCaps(p,a) (p)->GetCaps(a)
#define IDirectSoundCaptureBuffer_GetCurrentPosition(p,a,b) (p)->GetCurrentPosition(a,b)
#define IDirectSoundCaptureBuffer_GetFormat(p,a,b,c) (p)->GetFormat(a,b,c)
#define IDirectSoundCaptureBuffer_GetStatus(p,a) (p)->GetStatus(a)
#define IDirectSoundCaptureBuffer_Initialize(p,a,b) (p)->Initialize(a,b)
#define IDirectSoundCaptureBuffer_Lock(p,a,b,c,d,e,f,g) (p)->Lock(a,b,c,d,e,f,g)
#define IDirectSoundCaptureBuffer_Start(p,a) (p)->Start(a)
#define IDirectSoundCaptureBuffer_Stop(p) (p)->Stop()
#define IDirectSoundCaptureBuffer_Unlock(p,a,b,c,d) (p)->Unlock(a,b,c,d)
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IDirectSoundNotify
//
DEFINE_GUID(IID_IDirectSoundNotify, 0xb0210783, 0x89cd, 0x11d0, 0xaf, 0x8, 0x0, 0xa0, 0xc9, 0x25, 0xcd, 0x16);
#undef INTERFACE
#define INTERFACE IDirectSoundNotify
DECLARE_INTERFACE_(IDirectSoundNotify, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IDirectSoundNotify methods
STDMETHOD(SetNotificationPositions) (THIS_ DWORD, LPCDSBPOSITIONNOTIFY) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectSoundNotify_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectSoundNotify_Release(p) (p)->lpVtbl->Release(p)
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->lpVtbl->SetNotificationPositions(p,a,b)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectSoundNotify_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectSoundNotify_AddRef(p) (p)->AddRef()
#define IDirectSoundNotify_Release(p) (p)->Release()
#define IDirectSoundNotify_SetNotificationPositions(p,a,b) (p)->SetNotificationPositions(a,b)
#endif // !defined(__cplusplus) || defined(CINTERFACE)
//
// IKsPropertySet
//
#ifndef _IKsPropertySet_
#define _IKsPropertySet_
#ifdef __cplusplus
// 'struct' not 'class' per the way DECLARE_INTERFACE_ is defined
struct IKsPropertySet;
#endif // __cplusplus
typedef struct IKsPropertySet *LPKSPROPERTYSET;
#define KSPROPERTY_SUPPORT_GET 0x00000001
#define KSPROPERTY_SUPPORT_SET 0x00000002
DEFINE_GUID(IID_IKsPropertySet, 0x31efac30, 0x515c, 0x11d0, 0xa9, 0xaa, 0x00, 0xaa, 0x00, 0x61, 0xbe, 0x93);
#undef INTERFACE
#define INTERFACE IKsPropertySet
DECLARE_INTERFACE_(IKsPropertySet, IUnknown)
{
// IUnknown methods
STDMETHOD(QueryInterface) (THIS_ REFIID, LPVOID *) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
// IKsPropertySet methods
STDMETHOD(Get) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG, PULONG) PURE;
STDMETHOD(Set) (THIS_ REFGUID, ULONG, LPVOID, ULONG, LPVOID, ULONG) PURE;
STDMETHOD(QuerySupport) (THIS_ REFGUID, ULONG, PULONG) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IKsPropertySet_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IKsPropertySet_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IKsPropertySet_Release(p) (p)->lpVtbl->Release(p)
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->lpVtbl->Get(p,a,b,c,d,e,f,g)
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->lpVtbl->Set(p,a,b,c,d,e,f)
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->lpVtbl->QuerySupport(p,a,b,c)
#else // !defined(__cplusplus) || defined(CINTERFACE)
#define IKsPropertySet_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IKsPropertySet_AddRef(p) (p)->AddRef()
#define IKsPropertySet_Release(p) (p)->Release()
#define IKsPropertySet_Get(p,a,b,c,d,e,f,g) (p)->Get(a,b,c,d,e,f,g)
#define IKsPropertySet_Set(p,a,b,c,d,e,f) (p)->Set(a,b,c,d,e,f)
#define IKsPropertySet_QuerySupport(p,a,b,c) (p)->QuerySupport(a,b,c)
#endif // !defined(__cplusplus) || defined(CINTERFACE)
#endif // _IKsPropertySet_
//
// Return Codes
//
#define DS_OK 0
// The call failed because resources (such as a priority level)
// were already being used by another caller.
#define DSERR_ALLOCATED MAKE_DSHRESULT(10)
// The control (vol,pan,etc.) requested by the caller is not available.
#define DSERR_CONTROLUNAVAIL MAKE_DSHRESULT(30)
// An invalid parameter was passed to the returning function
#define DSERR_INVALIDPARAM E_INVALIDARG
// This call is not valid for the current state of this object
#define DSERR_INVALIDCALL MAKE_DSHRESULT(50)
// An undetermined error occured inside the DirectSound subsystem
#define DSERR_GENERIC E_FAIL
// The caller does not have the priority level required for the function to
// succeed.
#define DSERR_PRIOLEVELNEEDED MAKE_DSHRESULT(70)
// Not enough free memory is available to complete the operation
#define DSERR_OUTOFMEMORY E_OUTOFMEMORY
// The specified WAVE format is not supported
#define DSERR_BADFORMAT MAKE_DSHRESULT(100)
// The function called is not supported at this time
#define DSERR_UNSUPPORTED E_NOTIMPL
// No sound driver is available for use
#define DSERR_NODRIVER MAKE_DSHRESULT(120)
// This object is already initialized
#define DSERR_ALREADYINITIALIZED MAKE_DSHRESULT(130)
// This object does not support aggregation
#define DSERR_NOAGGREGATION CLASS_E_NOAGGREGATION
// The buffer memory has been lost, and must be restored.
#define DSERR_BUFFERLOST MAKE_DSHRESULT(150)
// Another app has a higher priority level, preventing this call from
// succeeding.
#define DSERR_OTHERAPPHASPRIO MAKE_DSHRESULT(160)
// This object has not been initialized
#define DSERR_UNINITIALIZED MAKE_DSHRESULT(170)
// The requested COM interface is not available
#define DSERR_NOINTERFACE E_NOINTERFACE
//
// Flags
//
#define DSCAPS_PRIMARYMONO 0x00000001
#define DSCAPS_PRIMARYSTEREO 0x00000002
#define DSCAPS_PRIMARY8BIT 0x00000004
#define DSCAPS_PRIMARY16BIT 0x00000008
#define DSCAPS_CONTINUOUSRATE 0x00000010
#define DSCAPS_EMULDRIVER 0x00000020
#define DSCAPS_CERTIFIED 0x00000040
#define DSCAPS_SECONDARYMONO 0x00000100
#define DSCAPS_SECONDARYSTEREO 0x00000200
#define DSCAPS_SECONDARY8BIT 0x00000400
#define DSCAPS_SECONDARY16BIT 0x00000800
#define DSBPLAY_LOOPING 0x00000001
#define DSBSTATUS_PLAYING 0x00000001
#define DSBSTATUS_BUFFERLOST 0x00000002
#define DSBSTATUS_LOOPING 0x00000004
#define DSBLOCK_FROMWRITECURSOR 0x00000001
#define DSBLOCK_ENTIREBUFFER 0x00000002
#define DSSCL_NORMAL 0x00000001
#define DSSCL_PRIORITY 0x00000002
#define DSSCL_EXCLUSIVE 0x00000003
#define DSSCL_WRITEPRIMARY 0x00000004
#define DS3DMODE_NORMAL 0x00000000
#define DS3DMODE_HEADRELATIVE 0x00000001
#define DS3DMODE_DISABLE 0x00000002
#define DS3D_IMMEDIATE 0x00000000
#define DS3D_DEFERRED 0x00000001
#define DS3D_MINDISTANCEFACTOR 0.0f
#define DS3D_MAXDISTANCEFACTOR 10.0f
#define DS3D_DEFAULTDISTANCEFACTOR 1.0f
#define DS3D_MINROLLOFFFACTOR 0.0f
#define DS3D_MAXROLLOFFFACTOR 10.0f
#define DS3D_DEFAULTROLLOFFFACTOR 1.0f
#define DS3D_MINDOPPLERFACTOR 0.0f
#define DS3D_MAXDOPPLERFACTOR 10.0f
#define DS3D_DEFAULTDOPPLERFACTOR 1.0f
#define DS3D_DEFAULTMINDISTANCE 1.0f
#define DS3D_DEFAULTMAXDISTANCE 1000000000.0f
#define DS3D_MINCONEANGLE 0
#define DS3D_MAXCONEANGLE 360
#define DS3D_DEFAULTCONEANGLE 360
#define DS3D_DEFAULTCONEOUTSIDEVOLUME 0
#define DSBCAPS_PRIMARYBUFFER 0x00000001
#define DSBCAPS_STATIC 0x00000002
#define DSBCAPS_LOCHARDWARE 0x00000004
#define DSBCAPS_LOCSOFTWARE 0x00000008
#define DSBCAPS_CTRL3D 0x00000010
#define DSBCAPS_CTRLFREQUENCY 0x00000020
#define DSBCAPS_CTRLPAN 0x00000040
#define DSBCAPS_CTRLVOLUME 0x00000080
#define DSBCAPS_CTRLPOSITIONNOTIFY 0x00000100
#define DSBCAPS_CTRLDEFAULT 0x000000E0
#define DSBCAPS_CTRLALL 0x000001F0
#define DSBCAPS_STICKYFOCUS 0x00004000
#define DSBCAPS_GLOBALFOCUS 0x00008000
#define DSBCAPS_GETCURRENTPOSITION2 0x00010000
#define DSBCAPS_MUTE3DATMAXDISTANCE 0x00020000
#define DSCBCAPS_WAVEMAPPED 0x80000000
#define DSSPEAKER_HEADPHONE 0x00000001
#define DSSPEAKER_MONO 0x00000002
#define DSSPEAKER_QUAD 0x00000003
#define DSSPEAKER_STEREO 0x00000004
#define DSSPEAKER_SURROUND 0x00000005
#define DSSPEAKER_GEOMETRY_MIN 0x00000005 // 5 degrees
#define DSSPEAKER_GEOMETRY_NARROW 0x0000000A // 10 degrees
#define DSSPEAKER_GEOMETRY_WIDE 0x00000014 // 20 degrees
#define DSSPEAKER_GEOMETRY_MAX 0x000000B4 // 180 degrees
#define DSSPEAKER_COMBINED(c, g) ((DWORD)(((BYTE)(c)) | ((DWORD)((BYTE)(g))) << 16))
#define DSSPEAKER_CONFIG(a) ((BYTE)(a))
#define DSSPEAKER_GEOMETRY(a) ((BYTE)(((DWORD)(a) >> 16) & 0x00FF))
#define DSCCAPS_EMULDRIVER 0x00000020
#define DSCBLOCK_ENTIREBUFFER 0x00000001
#define DSCBSTATUS_CAPTURING 0x00000001
#define DSCBSTATUS_LOOPING 0x00000002
#define DSCBSTART_LOOPING 0x00000001
#define DSBFREQUENCY_MIN 100
#define DSBFREQUENCY_MAX 100000
#define DSBFREQUENCY_ORIGINAL 0
#define DSBPAN_LEFT -10000
#define DSBPAN_CENTER 0
#define DSBPAN_RIGHT 10000
#define DSBVOLUME_MIN -10000
#define DSBVOLUME_MAX 0
#define DSBSIZE_MIN 4
#define DSBSIZE_MAX 0x0FFFFFFF
#define DSBPN_OFFSETSTOP 0xFFFFFFFF
#ifdef __cplusplus
};
#endif // __cplusplus
#endif // __DSOUND_INCLUDED__
+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
-1
View File
@@ -36,7 +36,6 @@ struct ship_info;
#define FIREBALL_NUM_LARGE_EXPLOSIONS 2
extern int fireball_used[MAX_FIREBALL_TYPES];
extern int Num_fireball_types;
// all this moved here by Goober5000 because it makes more sense in the H file
typedef struct fireball_lod {
+1
View File
@@ -14,6 +14,7 @@
#include "ship/ship.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -8,6 +8,7 @@
#include "gamesnd/eventmusic.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -16,6 +16,7 @@
#include "parse/sexp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -15,6 +15,7 @@
#include "mission/missiongrid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -19,6 +19,7 @@
#include "species_defs/species_defs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -7,6 +7,7 @@
#include "ship/ship.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -26,6 +26,7 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -30,6 +30,7 @@
#include "localization/localize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -23,6 +23,7 @@
#include "mission/missiongoals.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -19,6 +19,7 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -18,6 +18,7 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -22,6 +22,7 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -17,6 +17,7 @@
#include "localization/localize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -20,6 +20,7 @@
#include "iff_defs/iff_defs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -7,6 +7,7 @@
#include "ship/ship.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -20,6 +20,7 @@
#include "localization/localize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -14,6 +14,7 @@
#include "dialog1.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -27,6 +27,7 @@
#include "weapon/weapon.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+9 -11
View File
@@ -22,6 +22,7 @@
#include "localization/localize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -81,17 +82,15 @@ void event_editor::DoDataExchange(CDataExchange* pDX)
DDX_CBString(pDX, IDC_WAVE_FILENAME, m_wave_filename);
DDX_LBIndex(pDX, IDC_MESSAGE_LIST, m_cur_msg);
// m_team == -1 maps to 2
if(m_team == -1){
m_team = MAX_TVT_TEAMS;
m_team = 2;
}
DDX_CBIndex(pDX, IDC_EVENT_TEAM, m_team);
// m_message_team == -1 maps to 2
if(m_message_team == -1){
m_message_team = MAX_TVT_TEAMS;
m_message_team = 2;
}
DDX_CBIndex(pDX, IDC_MESSAGE_TEAM, m_message_team);
//}}AFX_DATA_MAP
@@ -571,7 +570,7 @@ void event_editor::update_cur_message()
m_persona = 0;
}
if(m_messages[m_cur_msg].multi_team >= MAX_TVT_TEAMS){
if(m_messages[m_cur_msg].multi_team >= 2){
m_message_team = -1;
m_messages[m_cur_msg].multi_team = -1;
} else {
@@ -716,7 +715,6 @@ void event_editor::reset_event(int num, HTREEITEM after)
m_events[num].chain_delay = -1;
m_events[num].objective_text = NULL;
m_events[num].objective_key_text = NULL;
m_events[num].team = -1;
m_sig[num] = -1;
m_event_tree.item_index = -1;
@@ -1176,7 +1174,7 @@ int event_editor::save_message(int num)
// box list.
m_messages[num].persona_index = m_persona - 1;
if(m_message_team >= MAX_TVT_TEAMS){
if(m_message_team >= 2){
m_messages[num].multi_team = -1;
m_message_team = -1;
} else {
@@ -1411,8 +1409,8 @@ void event_editor::OnSelchangeTeam()
UpdateData(TRUE);
// If the team isn't valid mark it as such.
if((m_team >= MAX_TVT_TEAMS) || (m_team < -1) ){
// team == 2, means no team
if(m_team == 2){
m_team = -1;
}
@@ -1428,8 +1426,8 @@ void event_editor::OnSelchangeMessageTeam()
UpdateData(TRUE);
// If the team isn't valid mark it as such.
if((m_message_team>= MAX_TVT_TEAMS) || (m_message_team < -1) ) {
// team == 2, means no team
if(m_message_team == 2){
m_message_team = -1;
}
+2 -1
View File
@@ -37,6 +37,7 @@
#endif
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -126,7 +127,7 @@ BOOL CFREDApp::InitInstance()
// disable the debug memory stuff
// _CrtSetDbgFlag(~(_CRTDBG_ALLOC_MEM_DF) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
_CrtSetDbgFlag(~(_CRTDBG_ALLOC_MEM_DF) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG));
// Standard initialization
// If you are not using these features and wish to reduce the size
+13 -56
View File
@@ -634,7 +634,7 @@ CAPTION "About FRED2"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,10,17,20,20,SS_REALSIZEIMAGE
LTEXT "FRED2_OPEN - FreeSpace Editor, Version 3.6.13 OpenGL",
LTEXT "FRED2_OPEN - FreeSpace Editor, Version 3.6.12 OpenGL",
IDC_STATIC,39,8,184,10,SS_NOPREFIX
LTEXT "Copyright © 1999 Volition, Inc. All Rights Reserved",
IDC_STATIC,39,17,164,8
@@ -878,10 +878,10 @@ BEGIN
IDC_STATIC,60,183,307,11
END
IDD_MISSION_NOTES DIALOG DISCARDABLE 0, 0, 479, 349
IDD_MISSION_NOTES DIALOGEX 0, 0, 479, 349
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mission Specs"
FONT 8, "MS Sans Serif"
FONT 8, "MS Sans Serif", 0, 0, 0x1
BEGIN
RTEXT "Title",IDC_STATIC,7,10,29,8
EDITTEXT IDC_MISSION_TITLE,41,7,109,14,ES_AUTOHSCROLL
@@ -1003,8 +1003,6 @@ BEGIN
CONTROL "",IDC_MAX_RESPAWN_DELAY_SPIN,"msctls_updown32",
UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
UDS_ARROWKEYS,136,112,11,14
PUSHBUTTON "Sound Environment",IDC_SOUND_ENVIRONMENT_BUTTON,158,244,
140,15
END
IDD_PREFERENCES DIALOG DISCARDABLE 0, 0, 333, 81
@@ -1529,7 +1527,7 @@ END
IDD_EVENT_EDITOR DIALOGEX 0, 0, 437, 431
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Mission Event Edit"
FONT 8, "MS Sans Serif", 0, 0, 0x1
FONT 8, "MS Sans Serif"
BEGIN
CONTROL "Tree1",IDC_EVENT_TREE,"SysTreeView32",TVS_HASBUTTONS |
TVS_HASLINES | TVS_LINESATROOT | TVS_EDITLABELS |
@@ -2457,18 +2455,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 +2477,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
@@ -2560,32 +2554,6 @@ BEGIN
WS_VSCROLL | WS_TABSTOP
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
BEGIN
COMBOBOX IDC_SOUND_ENVIRONMENT,75,9,117,30,CBS_DROPDOWN |
WS_VSCROLL | WS_TABSTOP
EDITTEXT IDC_SOUND_ENVIRONMENT_VOLUME,75,31,76,12,ES_AUTOHSCROLL
EDITTEXT IDC_SOUND_ENVIRONMENT_DAMPING,75,48,76,12,ES_AUTOHSCROLL
EDITTEXT IDC_SOUND_ENVIRONMENT_DECAY,75,64,76,12,ES_AUTOHSCROLL
DEFPUSHBUTTON "OK",IDOK,258,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,258,24,50,14
LTEXT "Environment:",IDC_SOUND_ENVIRONMENT_LABEL,28,13,42,8
LTEXT "Volume:",IDC_SOUND_ENVIRONMENT_VOLUME_LABEL,42,35,26,8
LTEXT "Damping:",IDC_SOUND_ENVIRONENT_DAMPING_LABEL,37,52,31,8
LTEXT "Decay Time:",IDC_SOUND_ENVIRONMENT_DECAY_LABEL,27,68,41,
8
LTEXT "range: 0.0 .. 1.0",IDC_STATIC,157,32,55,8,WS_DISABLED
LTEXT "range: 0.1 .. 2.0",IDC_STATIC,157,50,55,8,WS_DISABLED
LTEXT "range: 0.1 .. 20.0",IDC_STATIC,157,66,62,11,WS_DISABLED
GROUPBOX "Preview",IDC_SOUND_ENVIRONMENT_TEST,229,50,79,32
PUSHBUTTON "Browse",IDC_BROWSE_WAVE,258,62,44,15
PUSHBUTTON "IDB_PLAY",IDC_PLAY,235,62,17,15,BS_BITMAP,
WS_EX_TRANSPARENT
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
@@ -2594,8 +2562,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 3,6,13,0
PRODUCTVERSION 3,6,13,0
FILEVERSION 3,6,12,0
PRODUCTVERSION 3,6,12,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@@ -2612,12 +2580,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Volition Inc.\0"
VALUE "FileDescription", "Fred 2 Open\0"
VALUE "FileVersion", "3.6.13.0000\0"
VALUE "FileVersion", "3.6.12.0\0"
VALUE "InternalName", "Fred 2 Open\0"
VALUE "LegalCopyright", "Copyright © 1998\0"
VALUE "OriginalFilename", "fred2.exe\0"
VALUE "ProductName", "Fred 2 Open\0"
VALUE "ProductVersion", "3.6.13\0"
VALUE "ProductVersion", "3.6.12.0\0"
END
END
BLOCK "VarFileInfo"
@@ -3007,17 +2975,6 @@ BEGIN
TOPMARGIN, 7
BOTTOMMARGIN, 59
END
IDD_SOUND_ENVIRONMENT, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 308
VERTGUIDE, 70
VERTGUIDE, 151
VERTGUIDE, 157
TOPMARGIN, 7
BOTTOMMARGIN, 82
END
END
#endif // APSTUDIO_INVOKED
@@ -3190,7 +3147,7 @@ IDC_CURSOR2 CURSOR DISCARDABLE "res\\cursor2.cur"
STRINGTABLE DISCARDABLE
BEGIN
IDR_MAINFRAME "FRED2_OPEN 3.6.13 - FreeSpace2 Mission Editor\nUntitled\nFRED2\nFreeSpace2 Missions (*.fs2)\n.fs2\nFreeSpace2Mission\nFreeSpace2 Mission"
IDR_MAINFRAME "FRED2_OPEN 3.6.12 - FreeSpace2 Mission Editor\nUntitled\nFRED2\nFreeSpace2 Missions (*.fs2)\n.fs2\nFreeSpace2Mission\nFreeSpace2 Mission"
END
STRINGTABLE DISCARDABLE
+4 -3
View File
@@ -50,6 +50,7 @@
extern int Num_objects;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -426,7 +427,7 @@ int CFREDDoc::load_mission(char *pathname, int flags)
generate_weaponry_usage_list(i, used_pool);
for (j=0; j<Team_data[i].num_weapon_choices; j++) {
// The amount used in wings is always set by a static loadout entry so skip any that were set by Sexp variables
if ( (!strlen(Team_data[i].weaponry_pool_variable[j])) && (!strlen(Team_data[i].weaponry_amount_variable[j])) ) {
if ((Team_data[i].weaponry_pool_variable[j] == -1) && (Team_data[i].weaponry_amount_variable[j] == -1) ) {
// convert weaponry_pool to be extras available beyond the current ships weapons
Team_data[i].weaponry_count[j] -= used_pool[Team_data[i].weaponry_pool[j]];
if (Team_data[i].weaponry_count[j] < 0) {
@@ -445,8 +446,8 @@ int CFREDDoc::load_mission(char *pathname, int flags)
// add the weapon as a new entry
Team_data[i].weaponry_pool[Team_data[i].num_weapon_choices] = j;
Team_data[i].weaponry_count[Team_data[i].num_weapon_choices] = used_pool[j];
strcpy_s(Team_data[i].weaponry_amount_variable[Team_data[i].num_weapon_choices], "");
strcpy_s(Team_data[i].weaponry_pool_variable[Team_data[i].num_weapon_choices++], "");
Team_data[i].weaponry_amount_variable[Team_data[i].num_weapon_choices] = -1;
Team_data[i].weaponry_pool_variable[Team_data[i].num_weapon_choices++] = -1;
}
}
}
+1
View File
@@ -58,6 +58,7 @@ extern float flFrametime;
extern subsys_to_render Render_subsys;
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+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
View File
@@ -65,6 +65,7 @@
#include "gl/glu.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -18,6 +18,7 @@
#include "editor.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -16,6 +16,7 @@
#include "globalincs/linklist.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -18,6 +18,7 @@
#include "weapon/weapon.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -19,6 +19,7 @@
#include "object/objectdock.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -26,6 +26,7 @@
#include "iff_defs/iff_defs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+5 -8
View File
@@ -381,7 +381,7 @@ bool fred_init()
}
*/
snd_init();
snd_init(0, 0, 44100, 16);
// Not ready for this yet
// Cmdline_nospec = 1;
@@ -999,9 +999,9 @@ void clear_mission()
for ( j = 0; j < MAX_SHIP_CLASSES; j++ ) {
if (Ship_info[j].flags & SIF_DEFAULT_PLAYER_SHIP) {
Team_data[i].ship_list[count] = j;
strcpy_s(Team_data[i].ship_list_variables[count], "");
Team_data[i].ship_list_variables[count] = -1;
Team_data[i].ship_count[count] = 5;
strcpy_s(Team_data[i].ship_count_variables[count++], "");
Team_data[i].ship_count_variables[count++] = -1;
}
}
Team_data[i].num_ship_choices = count;
@@ -1015,8 +1015,8 @@ void clear_mission()
Team_data[i].weaponry_count[count] = 500;
}
Team_data[i].weaponry_pool[count] = j;
strcpy_s(Team_data[i].weaponry_pool_variable[count], "");
strcpy_s(Team_data[i].weaponry_amount_variable[count++], "");
Team_data[i].weaponry_pool_variable[count] = -1;
Team_data[i].weaponry_amount_variable[count++] = -1;
}
}
Team_data[i].num_weapon_choices = count;
@@ -1092,9 +1092,6 @@ void clear_mission()
strcpy_s(The_mission.skybox_model, "");
strcpy_s(The_mission.envmap_name, "");
// no sound environment
The_mission.sound_environment.id = -1;
ENVMAP = -1;
set_modified(FALSE);
+1
View File
@@ -19,6 +19,7 @@
#include "mission/missionmessage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -25,6 +25,7 @@
#define ID_REPLACE_WINGS 15000
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1 -12
View File
@@ -14,7 +14,6 @@
#include "FREDDoc.h"
#include "MissionNotesDlg.h"
#include "CustomWingNames.h"
#include "soundenvironmentdlg.h"
#include "Management.h"
#include "gamesnd/eventmusic.h"
#include "cfile/cfile.h"
@@ -22,6 +21,7 @@
#include "mission/missionmessage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -143,7 +143,6 @@ BEGIN_MESSAGE_MAP(CMissionNotesDlg, CDialog)
ON_BN_CLICKED(IDC_LOADING_SCREEN_BUTTON1024, OnLoad1024)
ON_BN_CLICKED(IDC_CONTRAIL_THRESHOLD_CHECK, OnToggleContrailThreshold)
ON_BN_CLICKED(IDC_CUSTOM_WING_NAMES, OnCustomWingNames)
ON_BN_CLICKED(IDC_SOUND_ENVIRONMENT_BUTTON, OnSoundEnvironment)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -726,13 +725,3 @@ void CMissionNotesDlg::OnCustomWingNames()
UpdateData(FALSE);
}
void CMissionNotesDlg::OnSoundEnvironment()
{
UpdateData(TRUE);
SoundEnvironment dlg;
dlg.DoModal();
UpdateData(FALSE);
}
-1
View File
@@ -98,7 +98,6 @@ protected:
afx_msg void OnLoad1024();
afx_msg void OnToggleContrailThreshold();
afx_msg void OnCustomWingNames();
afx_msg void OnSoundEnvironment();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
public:
+13 -44
View File
@@ -44,8 +44,6 @@
#include "iff_defs/iff_defs.h"
#include "missionui/fictionviewer.h"
#include "globalincs/version.h"
#include "sound/sound.h"
#include "sound/ds.h"
void CFred_mission_save::convert_special_tags_to_retail(char *text, int max_len)
@@ -591,30 +589,6 @@ int CFred_mission_save::save_mission_info()
fso_comment_pop();
}
// sound environment (EFX/EAX) - taylor
sound_env *m_env = &The_mission.sound_environment;
if ( (m_env->id >= 0) && (m_env->id < (int)EFX_presets.size()) ) {
EFXREVERBPROPERTIES *prop = &EFX_presets[m_env->id];
fso_comment_push(";;FSO 3.6.12;;");
fout_version("\n\n$Sound Environment: %s", prop->name.c_str());
if (m_env->volume != prop->flGain) {
fout_version("\n+Volume: %f", m_env->volume);
}
if (m_env->damping != prop->flDecayHFRatio) {
fout_version("\n+Damping: %f", m_env->damping);
}
if (m_env->decay != prop->flDecayTime) {
fout_version("\n+Decay Time: %f", m_env->decay);
}
fso_comment_pop();
}
return err;
}
@@ -1135,7 +1109,6 @@ int CFred_mission_save::save_variables()
int CFred_mission_save::save_players()
{
int i, j;
int var_idx;
int used_pool[MAX_WEAPON_TYPES];
// write out alternate name list
@@ -1180,22 +1153,20 @@ int CFred_mission_save::save_players()
for (j=0; j<Team_data[i].num_ship_choices; j++) {
// Check to see if a variable name should be written for the class rather than a number
if (strlen(Team_data[i].ship_list_variables[j])) {
var_idx = get_index_sexp_variable_name(Team_data[i].ship_list_variables[j]);
Assert (var_idx > -1 && var_idx < MAX_SEXP_VARIABLES);
if (Team_data[i].ship_list_variables[j] != -1) {
Assert (Team_data[i].ship_list_variables[j] > -1 && Team_data[i].ship_list_variables[j] < MAX_SEXP_VARIABLES);
fout("\t@%s\t", Sexp_variables[var_idx].variable_name);
fout("\t@%s\t", Sexp_variables[Team_data[i].ship_list_variables[j]].variable_name);
}
else {
fout("\t\"%s\"\t", Ship_info[Team_data[i].ship_list[j]].name);
}
// Now check if we should write a variable or a number for the amount of ships available
if (strlen(Team_data[i].ship_count_variables[j])) {
var_idx = get_index_sexp_variable_name(Team_data[i].ship_count_variables[j]);
Assert (var_idx > -1 && var_idx < MAX_SEXP_VARIABLES);
if (Team_data[i].ship_count_variables[j] != -1) {
Assert (Team_data[i].ship_count_variables[j] > -1 && Team_data[i].ship_count_variables[j] < MAX_SEXP_VARIABLES);
fout("@%s\n", Sexp_variables[var_idx].variable_name);
fout("@%s\n", Sexp_variables[Team_data[i].ship_count_variables[j]].variable_name);
}
else {
fout("%d\n", Team_data[i].ship_count[j]);
@@ -1214,11 +1185,10 @@ int CFred_mission_save::save_players()
generate_weaponry_usage_list(i, used_pool);
for (j=0; j<Team_data[i].num_weapon_choices; j++) {
// first output the weapon name or a variable that sets it
if (strlen(Team_data[i].weaponry_pool_variable[j])) {
var_idx = get_index_sexp_variable_name(Team_data[i].weaponry_pool_variable[j]);
Assert (var_idx > -1 && var_idx < MAX_SEXP_VARIABLES);
if (Team_data[i].weaponry_pool_variable[j] != -1) {
Assert (Team_data[i].weaponry_pool_variable[j] > -1 && Team_data[i].weaponry_pool_variable[j] < MAX_SEXP_VARIABLES);
fout("\t@%s\t", Sexp_variables[var_idx].variable_name);
fout("\t@%s\t", Sexp_variables[Team_data[i].weaponry_pool_variable[j]].variable_name);
}
else {
fout("\t\"%s\"\t", Weapon_info[Team_data[i].weaponry_pool[j]].name);
@@ -1227,14 +1197,13 @@ int CFred_mission_save::save_players()
// now output the amount of this weapon or a variable that sets it. If this weapon is in the used pool and isn't
// set by a variable we should add the amount of weapons used by the wings to it and zero the entry so we know
// that we have dealt with it
if (strlen(Team_data[i].weaponry_amount_variable[j])) {
var_idx = get_index_sexp_variable_name(Team_data[i].weaponry_amount_variable[j]);
Assert (var_idx > -1 && var_idx < MAX_SEXP_VARIABLES);
if (Team_data[i].weaponry_amount_variable[j] != -1) {
Assert (Team_data[i].weaponry_amount_variable[j] > -1 && Team_data[i].weaponry_amount_variable[j] < MAX_SEXP_VARIABLES);
fout ("@%s\n", Sexp_variables[var_idx].variable_name);
fout ("@%s\n", Sexp_variables[Team_data[i].weaponry_amount_variable[j]].variable_name);
}
else {
if (strlen(Team_data[i].weaponry_pool_variable[j])) {
if (Team_data[i].weaponry_pool_variable[j] != -1) {
fout ("%d\n", Team_data[i].weaponry_count[j]);
}
else {
+1
View File
@@ -16,6 +16,7 @@
#include "parse/sexp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -14,6 +14,7 @@
#include "OperatorArgTypeSelect.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -17,6 +17,7 @@
#include "FREDView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+21 -46
View File
@@ -19,6 +19,7 @@
#include "weapon/weapon.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -94,32 +95,22 @@ BOOL player_start_editor::OnInitDialog()
for(idx=0; idx<Team_data[i].num_ship_choices; idx++)
{
// do we have a variable for this entry? if we don't....
if (!strlen(Team_data[i].ship_list_variables[idx]))
if (Team_data[i].ship_list_variables[idx] == -1)
{
// This pool is set to hold the number of ships available at an index corresponding to the Ship_info array.
static_ship_pool[i][Team_data[i].ship_list[idx]] = Team_data[i].ship_count[idx];
// This pool is set to hold whether a ship at a Ship_info index has been set by a variable (and the
// variables index in Sexp_variables) if it has).
if (strlen(Team_data[i].ship_count_variables[idx])) {
static_ship_variable_pool[i][Team_data[i].ship_list[idx]] = get_index_sexp_variable_name(Team_data[i].ship_count_variables[idx]);
}
else {
static_ship_variable_pool[i][Team_data[i].ship_list[idx]] = -1;
}
static_ship_variable_pool[i][Team_data[i].ship_list[idx]] = Team_data[i].ship_count_variables[idx];
}
// if we do....
else
{
// This pool is set to hold the number of ships available at an index corresponding to the Sexp_variables array
dynamic_ship_pool[i][get_index_sexp_variable_name(Team_data[i].ship_list_variables[idx])] = Team_data[i].ship_count[idx];
dynamic_ship_pool[i][Team_data[i].ship_list_variables[idx]] = Team_data[i].ship_count[idx];
// This pool is set to hold whether a ship at a Ship_info index has been set by a variable (and the
// variables index in Sexp_variables) if it has).
if (strlen(Team_data[i].ship_count_variables[idx])) {
dynamic_ship_variable_pool[i][get_index_sexp_variable_name(Team_data[i].ship_list_variables[idx])] = get_index_sexp_variable_name(Team_data[i].ship_count_variables[idx]);
}
else {
dynamic_ship_variable_pool[i][get_index_sexp_variable_name(Team_data[i].ship_list_variables[idx])] = -1;
}
dynamic_ship_variable_pool[i][Team_data[i].ship_list_variables[idx]] = Team_data[i].ship_count_variables[idx];
}
}
}
@@ -134,26 +125,16 @@ BOOL player_start_editor::OnInitDialog()
for(idx=0; idx<Team_data[i].num_weapon_choices; idx++)
{
// do we have a variable for this entry?
if (!strlen(Team_data[i].weaponry_pool_variable[idx]))
if (Team_data[i].weaponry_pool_variable[idx] == -1)
{
static_weapon_pool[i][Team_data[i].weaponry_pool[idx]] = Team_data[i].weaponry_count[idx];
if (strlen(Team_data[i].weaponry_amount_variable[idx])) {
static_weapon_variable_pool[i][Team_data[i].weaponry_pool[idx]] = get_index_sexp_variable_name(Team_data[i].weaponry_amount_variable[idx]);
}
else {
static_weapon_variable_pool[i][Team_data[i].weaponry_pool[idx]] = -1;
}
static_weapon_variable_pool[i][Team_data[i].weaponry_pool[idx]] = Team_data[i].weaponry_amount_variable[idx];
}
// if we do....
else
{
dynamic_weapon_pool[i][get_index_sexp_variable_name(Team_data[i].weaponry_pool_variable[idx])] = Team_data[i].weaponry_count[idx];
if (strlen(Team_data[i].weaponry_amount_variable[idx])) {
dynamic_weapon_variable_pool[i][get_index_sexp_variable_name(Team_data[i].weaponry_pool_variable[idx])] = get_index_sexp_variable_name(Team_data[i].weaponry_amount_variable[idx]);
}
else {
dynamic_weapon_variable_pool[i][get_index_sexp_variable_name(Team_data[i].weaponry_pool_variable[idx])] = -1;
}
dynamic_weapon_pool[i][Team_data[i].weaponry_pool_variable[idx]] = Team_data[i].weaponry_count[idx];
dynamic_weapon_variable_pool[i][Team_data[i].weaponry_pool_variable[idx]] = Team_data[i].weaponry_amount_variable[idx];
}
}
}
@@ -779,24 +760,18 @@ void player_start_editor::OnOK()
// Copy the variable to Team_data
if (idx != -1) {
Assert (idx < MAX_SEXP_VARIABLES);
strcpy_s(Team_data[i].ship_list_variables[num_choices], Sexp_variables[idx].variable_name);
}
else {
strcpy_s(Team_data[i].ship_list_variables[num_choices], "");
}
Team_data[i].ship_list_variables[num_choices] = idx;
Team_data[i].ship_list[num_choices] = -1;
// Now we need to set the number of this type available
if (dynamic_ship_variable_pool[i][idx] == -1) {
Team_data[i].ship_count[num_choices] = dynamic_ship_pool[i][idx];
strcpy_s(Team_data[i].ship_count_variables[num_choices], "");
Team_data[i].ship_count_variables[num_choices] = -1;
}
else {
Assert (Sexp_variables[dynamic_ship_variable_pool[i][idx]].type & SEXP_VARIABLE_NUMBER);
strcpy_s(Team_data[i].ship_count_variables[num_choices], Sexp_variables[dynamic_ship_variable_pool[i][idx]].variable_name);
Team_data[i].ship_count_variables[num_choices] = dynamic_ship_variable_pool[i][idx];
Team_data[i].ship_count[num_choices] = atoi(Sexp_variables[dynamic_ship_variable_pool[i][idx]].text);
}
@@ -810,17 +785,17 @@ void player_start_editor::OnOK()
// if we have ships here
if(static_ship_pool[i][idx] > 0 || static_ship_variable_pool[i][idx] > -1) {
Team_data[i].ship_list[num_choices] = idx;
strcpy_s(Team_data[i].ship_list_variables[num_choices], "");
Team_data[i].ship_list_variables[num_choices] = -1;
// Now set the number of this class available
if (static_ship_variable_pool[i][idx] == -1) {
Team_data[i].ship_count[num_choices] = static_ship_pool[i][idx];
strcpy_s(Team_data[i].ship_count_variables[num_choices], "");
Team_data[i].ship_count_variables[num_choices] = -1;
}
else {
Assert (Sexp_variables[static_ship_variable_pool[i][idx]].type & SEXP_VARIABLE_NUMBER);
strcpy_s(Team_data[i].ship_count_variables[num_choices], Sexp_variables[static_ship_variable_pool[i][idx]].variable_name);
Team_data[i].ship_count_variables[num_choices] = static_ship_variable_pool[i][idx];
Team_data[i].ship_count[num_choices] = atoi(Sexp_variables[static_ship_variable_pool[i][idx]].text);
}
@@ -855,20 +830,20 @@ void player_start_editor::OnOK()
}
// Copy the variable to Team_data
strcpy_s(Team_data[i].weaponry_pool_variable[num_choices], Sexp_variables[idx].variable_name);
Team_data[i].weaponry_pool_variable[num_choices] = idx;
Team_data[i].weaponry_pool[num_choices] = -1;
// Now we need to set the number of this class available
if (dynamic_weapon_variable_pool[i][idx] == -1)
{
Team_data[i].weaponry_count[num_choices] = dynamic_weapon_pool[i][idx];
strcpy_s(Team_data[i].weaponry_amount_variable[num_choices], "");
Team_data[i].weaponry_amount_variable[num_choices] = -1;
}
else
{
Assert (Sexp_variables[dynamic_weapon_variable_pool[i][idx]].type & SEXP_VARIABLE_NUMBER);
strcpy_s(Team_data[i].weaponry_amount_variable[num_choices], Sexp_variables[dynamic_weapon_variable_pool[i][idx]].variable_name);
Team_data[i].weaponry_amount_variable[num_choices] = dynamic_weapon_variable_pool[i][idx];
Team_data[i].weaponry_count[num_choices] = atoi(Sexp_variables[dynamic_weapon_variable_pool[i][idx]].text);
}
@@ -884,19 +859,19 @@ void player_start_editor::OnOK()
if(static_weapon_pool[i][idx] > 0 || static_weapon_variable_pool[i][idx] > -1)
{
Team_data[i].weaponry_pool[num_choices] = idx;
strcpy_s(Team_data[i].weaponry_pool_variable[num_choices], "");
Team_data[i].weaponry_pool_variable[num_choices] = -1;
// Now set the number of this class available
if (static_weapon_variable_pool[i][idx] == -1)
{
Team_data[i].weaponry_count[num_choices] = static_weapon_pool[i][idx];
strcpy_s(Team_data[i].weaponry_amount_variable[num_choices], "");
Team_data[i].weaponry_amount_variable[num_choices] = -1;
}
else
{
Assert (Sexp_variables[static_weapon_variable_pool[i][idx]].type & SEXP_VARIABLE_NUMBER);
strcpy_s(Team_data[i].weaponry_amount_variable[num_choices], Sexp_variables[static_weapon_variable_pool[i][idx]].variable_name);
Team_data[i].weaponry_amount_variable[num_choices] = static_weapon_variable_pool[i][idx];
Team_data[i].weaponry_count[num_choices] = atoi(Sexp_variables[static_weapon_variable_pool[i][idx]].text);
}
+1
View File
@@ -16,6 +16,7 @@
#include "FREDView.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -22,6 +22,7 @@
#define ID_WING_DATA 9000
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+4 -17
View File
@@ -1,6 +1,6 @@
//{{NO_DEPENDENCIES}}
// Microsoft Developer Studio generated include file.
// Used by FRED.rc
// Microsoft Visual C++ generated include file.
// Used by fred.rc
//
#define IDC_SAVE_DEFAULT_PREFS 3
#define ID_DELETE_VARIABLE 3
@@ -123,7 +123,6 @@
#define IDB_DATA_90 314
#define IDB_DATA_95 315
#define IDD_FICTION_VIEWER 318
#define IDD_SOUND_ENVIRONMENT 319
#define IDC_SHIP_CLASS 1003
#define IDC_SHIP_WING 1004
#define IDC_SOUND_CLIP_NAME 1007
@@ -532,7 +531,6 @@
#define IDC_ASCT1_CLASS_COMBO1 1188
#define IDC_SHIP_VARIABLES_COMBO 1188
#define IDC_SUFFIX 1188
#define IDC_SOUND_ENVIRONMENT 1188
#define IDC_CREATED 1189
#define IDC_DEPARTURE_TARGET 1189
#define IDC_SBITMAP 1189
@@ -779,7 +777,6 @@
#define IDC_SPECIAL_INNER_RAD 1343
#define IDC_SQUAD_LOGO 1343
#define IDC_SQUADRON_WING_NAME_1 1343
#define IDC_SOUND_ENVIRONMENT_DAMPING 1343
#define IDC_EDIT3 1344
#define IDC_AMMO3 1344
#define IDC_TIME 1344
@@ -793,7 +790,6 @@
#define IDC_ABBREV_CAMPAIGN 1344
#define IDC_TVT_WING_NAME_1 1344
#define IDC_ASSIST_SCORE 1344
#define IDC_SOUND_ENVIRONMENT_VOLUME 1344
#define IDC_EDIT4 1345
#define IDC_AMMO4 1345
#define IDC_VOICE 1345
@@ -1132,15 +1128,6 @@
#define IDC_STORY_FILE 1618
#define IDC_FONT_FILE 1619
#define IDC_FICTION_MUSIC 1620
#define IDC_SOUND_ENVIRONMENT_LABEL 1621
#define IDC_SOUND_ENVIRONMENT_VOLUME_LABEL 1622
#define IDC_SOUND_ENVIRONENT_DAMPING_LABEL 1623
#define IDC_SOUND_ENVIRONMENT_DECAY_LABEL 1624
#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
@@ -1432,9 +1419,9 @@
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 320
#define _APS_NEXT_RESOURCE_VALUE 319
#define _APS_NEXT_COMMAND_VALUE 33098
#define _APS_NEXT_CONTROL_VALUE 1629
#define _APS_NEXT_CONTROL_VALUE 1621
#define _APS_NEXT_SYMED_VALUE 105
#endif
#endif
+1
View File
@@ -13,6 +13,7 @@
#include "model/model.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -6,6 +6,7 @@
#include "SetGlobalShipFlags.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+12 -117
View File
@@ -43,8 +43,6 @@
#include "iff_defs/iff_defs.h"
#include "mission/missionmessage.h"
#include "graphics/gropenglshader.h"
#include "graphics/gropenglpostprocessing.h"
#include "sound/ds.h"
#define TREE_NODE_INCREMENT 100
@@ -57,6 +55,7 @@
// note: stay below 0xe000 so we don't collide with MFC defines..
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -2574,14 +2573,6 @@ int sexp_tree::get_default_value(sexp_list_item *item, int op, int i)
str = "<persona name>";
break;
case OPF_FONT:
str = Fonts[0].filename;
break;
case OPF_AUDIO_VOLUME_OPTION:
str = "Music";
break;
default:
str = "<new default required!>";
break;
@@ -2661,13 +2652,7 @@ int sexp_tree::query_default_argument_available(int op, int i)
case OPF_POST_EFFECT:
case OPF_TARGET_PRIORITIES:
case OPF_ARMOR_TYPES:
case OPF_FONT:
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:
@@ -4359,36 +4344,12 @@ sexp_list_item *sexp_tree::get_listing_opf(int opf, int parent_node, int arg_ind
case OPF_POST_EFFECT:
list = get_listing_opf_post_effect();
break;
case OPF_FONT:
list = get_listing_opf_font();
break;
break;
case OPF_HUD_ELEMENT:
list = get_listing_opf_hud_elements();
break;
case OPF_SOUND_ENVIRONMENT:
list = get_listing_opf_sound_environment();
break;
case OPF_SOUND_ENVIRONMENT_OPTION:
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;
@@ -5187,18 +5148,6 @@ sexp_list_item *sexp_tree::get_listing_opf_persona()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_font()
{
int i;
sexp_list_item head;
for (i = 0; i < Num_fonts; i++) {
head.add_data(Fonts[i].filename);
}
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_who_from()
{
object *ptr;
@@ -5230,50 +5179,6 @@ sexp_list_item *sexp_tree::get_listing_opf_priority()
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_sound_environment()
{
sexp_list_item head;
head.add_data(SEXP_NONE_STRING);
for (int i = 0; i < (int)EFX_presets.size(); i++) {
// ugh
char *text = const_cast<char*>(EFX_presets[i].name.c_str());
head.add_data(text);
}
return head.next;
}
sexp_list_item *sexp_tree::get_listing_opf_sound_environment_option()
{
sexp_list_item head;
for (int i = 0; i < Num_sound_environment_options; i++)
head.add_data(Sound_environment_option[i]);
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 +5409,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;
}
@@ -5694,7 +5599,7 @@ sexp_list_item *sexp_tree::get_listing_opf_nebula_storm_type()
sexp_list_item head;
int i;
head.add_data(SEXP_NONE_STRING);
head.add_data("none");
for (i=0; i < Num_storm_types; i++)
{
@@ -5732,11 +5637,9 @@ sexp_list_item *sexp_tree::get_listing_opf_post_effect()
{
unsigned int i;
sexp_list_item head;
SCP_vector<SCP_string> ppe_names;
get_post_process_effect_names(ppe_names);
for (i=0; i < ppe_names.size(); i++) {
head.add_data(const_cast<char*>(ppe_names[i].c_str()));
}
SCP_vector<opengl::post_effect> &ppe_names = opengl::post_shader::get_effects();
for (i=0; i < ppe_names.size(); i++)
head.add_data(const_cast<char*>(ppe_names[i].name.c_str()));
return head.next;
}
@@ -5773,14 +5676,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)
@@ -5921,20 +5816,20 @@ int sexp_tree::get_loadout_variable_count(int var_index)
for (int i=0; i < MAX_TVT_TEAMS; i++) {
for(idx=0; idx<Team_data[i].num_ship_choices; idx++) {
if (!strcmp(Team_data[i].ship_list_variables[idx], Sexp_variables[var_index].variable_name)) {
if (var_index == Team_data[i].ship_list_variables[idx]) {
count++;
}
if (!strcmp(Team_data[i].ship_count_variables[idx], Sexp_variables[var_index].variable_name)) {
count++;
if (var_index == Team_data[i].ship_count_variables[idx]) {
count++;
}
}
for (idx=0; idx<Team_data[i].num_weapon_choices; idx++) {
if (!strcmp(Team_data[i].weaponry_pool_variable[idx], Sexp_variables[var_index].variable_name)) {
if (var_index == Team_data[i].weaponry_pool_variable[idx]) {
count++;
}
if (!strcmp(Team_data[i].weaponry_amount_variable[idx], Sexp_variables[var_index].variable_name)) {
if (var_index == Team_data[i].weaponry_amount_variable[idx]) {
count++;
}
}
+2 -6
View File
@@ -236,6 +236,7 @@ public:
sexp_list_item *get_listing_opf_sun_bitmap();
sexp_list_item *get_listing_opf_nebula_storm_type();
sexp_list_item *get_listing_opf_nebula_poof();
// Goober5000 ----------------------------------------------
sexp_list_item *get_listing_opf_cargo();
sexp_list_item *get_listing_opf_ai_class();
sexp_list_item *get_listing_opf_support_ship_class();
@@ -255,14 +256,9 @@ public:
sexp_list_item *get_listing_opf_armor_types();
sexp_list_item *get_listing_opf_turret_target_priorities();
sexp_list_item *get_listing_opf_persona();
sexp_list_item *get_listing_opf_font();
// ---------------------------------------------------------
sexp_list_item *get_listing_opf_post_effect();
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;
+1
View File
@@ -17,6 +17,7 @@
#include "iff_defs/iff_defs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -22,6 +22,7 @@
#define ACTIVITY_WING 2
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -14,6 +14,7 @@
#include "ShipClassEditorDlg.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -47,6 +47,7 @@
#define NO_PERSONA_INDEX 999
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -16,6 +16,7 @@
#include "globalincs/linklist.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -28,6 +28,7 @@
#define DATA_MASK 0x0fff
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -18,6 +18,7 @@
#include "FREDDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -9,6 +9,7 @@
#include "FREDDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -8,6 +8,7 @@
#include "bmpman/bmpman.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
-246
View File
@@ -1,246 +0,0 @@
// soundenvironmentdlg.cpp : implementation file
//
#include "stdafx.h"
#include "fred.h"
#include "soundenvironmentdlg.h"
#include "sound/audiostr.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "cfile/cfile.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// SoundEnvironment dialog
SoundEnvironment::SoundEnvironment(CWnd* pParent /*=NULL*/)
: CDialog(SoundEnvironment::IDD, pParent)
{
//{{AFX_DATA_INIT(SoundEnvironment)
m_environment = -1;
m_damping = 0.0f;
m_decay_time = 0.0f;
m_volume = 0.0f;
m_wave_filename = _T("");
m_wave_id = -1;
//}}AFX_DATA_INIT
}
void SoundEnvironment::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SoundEnvironment)
DDX_CBIndex(pDX, IDC_SOUND_ENVIRONMENT, m_environment);
DDX_Text(pDX, IDC_SOUND_ENVIRONMENT_DAMPING, m_damping);
DDV_MinMaxFloat(pDX, m_damping, 0.1f, 2.0f);
DDX_Text(pDX, IDC_SOUND_ENVIRONMENT_DECAY, m_decay_time);
DDV_MinMaxFloat(pDX, m_decay_time, 0.1f, 20.0f);
DDX_Text(pDX, IDC_SOUND_ENVIRONMENT_VOLUME, m_volume);
DDV_MinMaxFloat(pDX, m_volume, 0.0f, 1.0f);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SoundEnvironment, CDialog)
//{{AFX_MSG_MAP(SoundEnvironment)
ON_CBN_SELCHANGE(IDC_SOUND_ENVIRONMENT, OnSelChangeSoundEnvironment)
ON_BN_CLICKED(IDC_BROWSE_WAVE, OnBrowseWave)
ON_BN_CLICKED(IDC_PLAY, OnPlay)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// SoundEnvironment message handlers
BOOL SoundEnvironment::OnInitDialog()
{
m_play_bm.LoadBitmap(IDB_PLAY);
((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm);
// fill environment list ...
CComboBox *box = (CComboBox *) GetDlgItem(IDC_SOUND_ENVIRONMENT);
// add empty default string (for no environment set)
box->AddString("");
for (size_t i = 0; i < EFX_presets.size(); i++) {
box->AddString(EFX_presets[i].name.c_str());
}
// set values ...
sound_env *m_env = &The_mission.sound_environment;
// make sure we are set by default to mission values
if (m_env->id >= 0) {
m_environment = m_env->id + 1;
m_volume = m_env->volume;
m_damping = m_env->damping;
m_decay_time = m_env->decay;
// make it active
sound_env_set(m_env);
} else {
m_environment = 0;
m_volume = 0.0f;
m_damping = 0.1f;
m_decay_time = 0.1f;
sound_env_disable();
}
CDialog::OnInitDialog();
UpdateData(FALSE);
return TRUE;
}
void SoundEnvironment::OnOK()
{
UpdateData(TRUE);
sound_env *m_env = &The_mission.sound_environment;
int env_id = m_environment - 1;
// save anything if we need to
if (env_id >= 0) {
m_env->id = env_id;
m_env->volume = m_volume;
m_env->damping = m_damping;
m_env->decay = m_decay_time;
} else {
m_env->id = -1;
}
CDialog::OnOK();
}
void SoundEnvironment::OnCancel()
{
CDialog::OnCancel();
}
void SoundEnvironment::OnClose()
{
int z;
UpdateData(TRUE);
if (query_modified()) {
z = MessageBox("Do you want to keep your changes?", "Close", MB_ICONQUESTION | MB_YESNOCANCEL);
if (z == IDCANCEL) {
return;
}
if (z == IDYES) {
OnOK();
return;
}
}
CDialog::OnClose();
}
int SoundEnvironment::query_modified()
{
int env_id = m_environment - 1;
sound_env *m_env = &The_mission.sound_environment;
return ( (env_id != m_env->id) || (m_volume != m_env->volume) || (m_damping != m_env->damping)
|| (m_decay_time != m_env->decay) );
}
void SoundEnvironment::OnSelChangeSoundEnvironment()
{
UpdateData(TRUE);
int index = m_environment - 1;
if (index >= 0) {
m_volume = EFX_presets[index].flGain;
m_damping = EFX_presets[index].flDecayHFRatio;
m_decay_time = EFX_presets[index].flDecayTime;
} else {
m_volume = 0.0f;
m_damping = 0.1f;
m_decay_time = 0.1f;
}
UpdateData(FALSE);
}
BOOL SoundEnvironment::DestroyWindow()
{
sound_env_disable();
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
m_play_bm.DeleteObject();
return CDialog::DestroyWindow();
}
void SoundEnvironment::OnPlay()
{
sound_env m_env;
if ( !sound_env_supported() ) {
MessageBox("Sound environment effects are not available! Unable to preview!", "Error", MB_OK | MB_ICONEXCLAMATION);
return;
}
if (m_wave_id < 0) {
OnBrowseWave();
return;
}
UpdateData(TRUE);
if (m_environment > 0) {
m_env.id = m_environment - 1;
m_env.volume = m_volume;
m_env.damping = m_damping;
m_env.decay = m_decay_time;
sound_env_set(&m_env);
}
audiostream_play(m_wave_id, 1.0f, 0);
}
void SoundEnvironment::OnBrowseWave()
{
int z;
if (m_wave_id >= 0) {
audiostream_close_file(m_wave_id, 0);
m_wave_id = -1;
}
UpdateData(TRUE);
m_wave_filename = _T("");
z = cfile_push_chdir(CF_TYPE_DATA);
CFileDialog dlg(TRUE, "wav", m_wave_filename, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR,
"Voice Files (*.ogg, *.wav)|*.ogg;*.wav|Ogg Vorbis Files (*.ogg)|*.ogg|Wave Files (*.wav)|*.wav||");
if (dlg.DoModal() == IDOK) {
m_wave_filename = dlg.GetFileName();
m_wave_id = audiostream_open((char *)(LPCSTR) m_wave_filename, ASF_SOUNDFX);
}
if ( !z ) {
cfile_pop_dir();
}
}
-63
View File
@@ -1,63 +0,0 @@
#if !defined(AFX_SOUNDENVIRONMENTDLG_H__C27DA258_9C66_4987_8D20_AEEB260644A8__INCLUDED_)
#define AFX_SOUNDENVIRONMENTDLG_H__C27DA258_9C66_4987_8D20_AEEB260644A8__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// soundenvironmentdlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// SoundEnvironment dialog
class SoundEnvironment : public CDialog
{
// Construction
public:
SoundEnvironment(CWnd* pParent = NULL); // standard constructor
int query_modified();
void OnOK();
void OnCancel();
// Dialog Data
//{{AFX_DATA(SoundEnvironment)
enum { IDD = IDD_SOUND_ENVIRONMENT };
int m_environment;
float m_damping;
float m_decay_time;
float m_volume;
CString m_wave_filename;
//}}AFX_DATA
CBitmap m_play_bm;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(SoundEnvironment)
public:
virtual BOOL DestroyWindow();
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(SoundEnvironment)
virtual BOOL OnInitDialog();
afx_msg void OnClose();
afx_msg void OnSelChangeSoundEnvironment();
afx_msg void OnBrowseWave();
afx_msg void OnPlay();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int m_wave_id;
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SOUNDENVIRONMENT_H__C27DA258_9C66_4987_8D20_AEEB260644A8__INCLUDED_)
+1
View File
@@ -16,6 +16,7 @@
#include "FREDDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -16,6 +16,7 @@
#include "cfile/cfile.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+56 -317
View File
@@ -2,27 +2,22 @@
//
#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
#define new DEBUG_NEW
#undef THIS_FILE
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];
@@ -33,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;
/////////////////////////////////////////////////////////////////////////////
@@ -50,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("");
@@ -59,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
}
@@ -76,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
}
@@ -108,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()
@@ -149,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);
@@ -170,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);
@@ -184,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();
}
@@ -234,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";
@@ -262,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;
}
@@ -315,7 +251,6 @@ void VoiceActingManager::OnGenerateFileNames()
{
int i;
int digits;
size_t modified_filenames = 0;
// stuff data to variables
UpdateData(TRUE);
@@ -327,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++;
}
}
@@ -341,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++;
}
}
@@ -355,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++;
}
}
@@ -367,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()
@@ -479,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);
}
}
@@ -509,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);
@@ -785,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()
};
+1
View File
@@ -27,6 +27,7 @@
#define ID_WAYPOINT_MENU 9000
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -20,6 +20,7 @@
#define BLANK_FIELD -99
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -30,6 +30,7 @@
#define MULTI_WING 999999
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1
View File
@@ -27,6 +27,7 @@
#define ID_WING_MENU 9000
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
Loaded 100 of 365 files, more files were not shown because too many files have changed in this diff. Show more