Compare commits

...
Author SHA1 Message Date
taylor 43f715b401 move stable branch to the primary under trunk 2008-03-16 16:25:19 +00:00
WMCoolmon 55217fbc78 Fix bug with drawImage and drawMonochromeImage as reported by Wanderer 2008-03-16 06:41:34 +00:00
WMCoolmon 506e2389ef Update to optimize code and to enable proper use of standard bracket style. :P 2008-03-16 04:25:58 +00:00
WMCoolmon 2d1f34047f Allow warpout with Homeworld or other 0-warpout-speed effects. 2008-03-16 04:20:28 +00:00
WMCoolmon efe2bcd48a New warp code. See thread on the internal for details. 2008-03-15 09:24:57 +00:00
WMCoolmon 4e1bef60ed g3_draw_polygon, general purpose function that was really needed. Comes in matrix or normal direction variants. 2008-03-15 09:19:13 +00:00
WMCoolmon d57a2487ca Commit of bm_load_either, a function that automagically loads an animation or image, whichever exists, in that order. FPS etc. are filled in properly by the function. 2008-03-15 09:18:09 +00:00
WMCoolmon c37dbc318d Use change_ship_class rather than straight variable set (this is the proper way) 2008-03-15 09:16:34 +00:00
WMCoolmon db462d66b1 Initial commit of new files for main codebase. 2008-03-15 09:01:46 +00:00
WMCoolmon aff9382167 Commit of new files for the SDK 2008-03-15 09:01:23 +00:00
WMCoolmon a26e293923 *Drumroll* The official scripting system commit to the stable branch! 2008-03-15 08:56:43 +00:00
WMCoolmon c9682ff092 Lua SDK update commit (Not newest version, just the one I've been testing with) 2008-03-15 08:54:40 +00:00
WMCoolmon 23ecdbe685 Updated MSVC2003 Project files (TrackIR stuff) 2008-03-15 08:53:36 +00:00
Goober5000 97a1d86311 fix flag setting in modular tables 2008-03-14 23:00:04 +00:00
karajorma f383e0b1d1 Ensure that the chatbox is closed when going to debriefing.
Some general clean up.
2008-03-14 20:27:41 +00:00
karajorma 03164ce8c1 Quiet's traitor message changes. Should get rid of queued messages from send-message-list when a player turns traitor. 2008-03-14 20:21:43 +00:00
Backslash f15007e18c View slew, Target padlock and TrackIR patch by Swifty. Very nice!
Don't forget to add code/io/trackir.* to your projects!
2008-03-14 08:55:47 +00:00
karajorma 49027e4b14 Minor change for if we ever allow more than two TvT wings 2008-03-12 19:28:26 +00:00
Goober5000 0459435713 add ship-copy-damage, which clones damage stats (hitpoints and subsystem damage) from an existing ship onto another existing ship or a ship on the arrival list 2008-03-11 06:11:26 +00:00
Goober5000 324a096a46 Gah! Squash a nasty bug that was just waiting to happen. This only made sense before the docking conversion, when many objects were created as they were parsed. It was intended to free only the subsystem slots that were used by the most recently parsed object. Now that all objects are parsed before any are created, this line must be removed in order to prevent "memory leaks". 2008-03-11 05:38:43 +00:00
karajorma cbd712bea4 Fix Mantis 1612 2008-03-08 18:45:43 +00:00
karajorma 3353515c4a Fix Mantis 1621 2008-03-08 15:42:55 +00:00
karajorma c8f6ff3a49 Use iff_defs in dogfight mode rather than a hack which doesn't quite work anyway. 2008-03-08 15:40:13 +00:00
karajorma 850a0e976b Don't output the password in the multi.log 2008-03-08 15:32:10 +00:00
karajorma 4b58938b27 Fix Mantis 1621 2008-03-08 15:29:46 +00:00
karajorma b887bcf967 Fix Mantis 1618 2008-03-01 20:31:59 +00:00
karajorma 43eb524bf5 EaterOfPies fix to allow Windows speech to read out multiplayer in-game chat. 2008-03-01 20:27:31 +00:00
karajorma 8add719772 Fix ships remaining targeted after they are made invisible. 2008-03-01 20:25:02 +00:00
karajorma 5fc8a6a2fb Only blow up ships that have the traitor IFF at the start of a dogfight mission. 2008-03-01 20:19:33 +00:00
karajorma 59bb3acfc3 Fix a targeting bug when ships are disabled. 2008-03-01 20:17:22 +00:00
karajorma 240cffb41d Fix Mantis 1608 2008-02-25 11:17:41 +00:00
karajorma 7ac27089b9 Fix Mantis 1611 2008-02-24 20:39:55 +00:00
taylor ab6d5fa704 re-enable support for multi.cfg options
fix bug where a ping/pong issue would create a bad state loop due to static vars not getting reset
clean up ADD/GET_STRING to work a bit better/safer
2008-02-23 20:16:18 +00:00
taylor b000c7758f fix timeout that messed up Linux build chat connects
disable banners for now since it messes up Windows builds
various bits of cleanup and old debug code removal
2008-02-23 20:11:37 +00:00
taylor d22aed3a18 fix malloc/free/strdup to use vm_* versions 2008-02-23 20:09:50 +00:00
taylor 40b63230f0 enable PXO lobby by default 2008-02-23 19:59:33 +00:00
taylor 066bdab8ab shouldn't be able to target ourselves with target-last-message-sender (Mantis #1534) 2008-02-22 06:21:59 +00:00
taylor 484f827696 make sure that we always respect path restrictions on graphics file loads (prevents stupid load order bug) 2008-02-22 02:50:04 +00:00
taylor 20a32f238a deal with AI goals better with autopilot, particularly so that we don't wipe out AI goals at end of AP run (Mantis #1521) 2008-02-22 02:42:32 +00:00
taylor db6d996f09 this should allow a more graceful handling of 0-byte VP files so that they don't cause hangs/crashes 2008-02-22 02:40:30 +00:00
taylor 663a002314 add Murleen's prospective fix and revert r4421 (should cover Mantis #83, #1248, and everything loosely based on them) 2008-02-22 02:35:22 +00:00
taylor 22080b9f51 fix fighter beam weapon energy draw to work correctly (Mantis #1170)
setup fighter beams to work a bit better for players, with a good timestamp and a fail sound
2008-02-22 02:18:20 +00:00
taylor 046d5dd06a remove the error check for movies larger than 640x480 as the code was fixed the handle that a while back 2008-02-22 02:05:07 +00:00
taylor b97c49ec39 be sure to clean up if a mission load fails (Mantis #1576) 2008-02-22 02:03:16 +00:00
Goober5000 6cd100c5b9 fix Mantis #1592 and remove obsolete no-bank flag 2008-02-20 07:47:33 +00:00
Kazan 9c6cf0d42b better way of doing the SLDC endianity swapping according to taylor 2008-02-12 00:49:22 +00:00
Kazan 3b3badb3fb Endian-gender safety for SLDC, 1st part of $no_collide (need to make it not obscure objects behind such chunks) 2008-02-12 00:41:21 +00:00
Kazan ba442d4f52 Shield Collision Tree Support (POF Chunk SLDC) 2008-02-11 22:33:43 +00:00
WMCoolmon cd0b5eb2eb Added bm_is_valid() 2008-02-11 05:13:50 +00:00
Goober5000 65635433a8 revert the directory move 2008-02-09 21:33:46 +00:00
Goober5000 7525e1cd3a remove extraneous fs2_open folder from all branches and tags 2008-02-09 19:21:05 +00:00
karajorma 0dc2d8b137 Add some descriptions for a few multiplayer options. 2008-02-09 17:58:29 +00:00
karajorma d90e81f76c Fix a scoping issue with wingman names. 2008-02-09 17:51:11 +00:00
WMCoolmon 60bf328e4a Added -res command line; fix un/signed warning; fix bool warning. 2008-02-09 07:35:58 +00:00
Backslash 15cc4ee2af Ok, committing this patch again now that the EOL thing is cleared up. 2008-02-09 07:00:49 +00:00
Kazan 4f5c3ff034 commit my latest version after the update conflict 2008-02-09 03:18:54 +00:00
taylor b2f5c82b39 set eol-style to LF for all code
set eol-style to CRLF for MSVC6 project files (since Windows needs it this way to load them)
2008-02-09 03:07:56 +00:00
Kazan 030c694bbc back out Backslash's commit of Keldor's patch - busted line endings again 2008-02-08 21:41:11 +00:00
Kazan f3dea71c52 back out keldor's dynamic messages again, Goober said it was bad in ways i didn't catch 2008-02-08 21:38:33 +00:00
Kazan a7e1c11a19 Autopilot fixes: wing formation placement, capship formation creation 2008-02-08 17:44:35 +00:00
WMCoolmon 0001b8f8b4 Updated the MSVC 2003 project files to use a more sensible intermediate file structure than the MS default 2008-02-08 10:52:11 +00:00
Backslash 707447d4e6 Mantis #0001488. The cases are depreciated, wouldn't compile using newest SDK. 2008-02-08 07:30:18 +00:00
Kazan b25cf7bf6e recommiting Keldor's Dynamic Message Limit patch - this time with 100% less line ending busting 2008-02-08 04:37:17 +00:00
Kazan 9da9c3d12b forgot this fix again :D 2008-02-08 04:35:18 +00:00
Kazan 22b630020c recommiting keldor's javelin_hs patch without busting line endings 2008-02-08 04:34:18 +00:00
Kazan 46758c8e5c recommiting keldor's cutscene bars fix without busting line endings 2008-02-08 04:33:07 +00:00
Kazan 12a4c37ebf Recommit the autoaiming patch.. looks clean now 2008-02-08 03:04:41 +00:00
Kazan f70ddc7a8c oops 2008-02-08 03:04:12 +00:00
Kazan e734fb3f1f restore changeset 4411.. didn't actually need to revert it and i need those changes 2008-02-08 02:34:50 +00:00
Kazan ba58eedaab revert all my commits from today [revert codebase back to r4410] 2008-02-08 02:29:47 +00:00
Kazan 4f14925bd2 Keldor's Dynamic Message Limit fix - Approved by Kazan 2008-02-07 19:14:07 +00:00
Kazan ad06d48462 Fix small error in a function from Keldor's Javelin HS diff 2008-02-07 17:01:42 +00:00
Kazan 9ccc59685b Keldor's Javelin HS (new homing missile type) patch - approved by Kazan 2008-02-07 16:55:00 +00:00
Kazan 9784ad93c9 Keldor's Cutscene Bars temporary fix (until 3.7) - Approved by Kazan and Taylor 2008-02-07 16:46:33 +00:00
Kazan e405ef832c Keldor's Autoaiming patch - approved by Kazan 2008-02-07 16:45:16 +00:00
Kazan 9c6f152792 small autopilot fix 2008-02-07 16:44:28 +00:00
taylor b4d3c3d15a remove old ignore files from CVS conversion 2008-02-06 13:35:19 +00:00
kazan 0f914f73a3 flip these around the right way finally.. almost forgot 2008-02-03 21:16:25 +00:00
kazan 0bace98953 Fix autopilot sliding around finally i think :D Change how external camera is automatically determined by AP as well 2008-02-03 20:04:46 +00:00
Backslash 8890a1c704 Bump MAX_MISSION_EVENTS and MAX_WINGS limits.
Ideally someone can make this dynamic later... maybe me when I have time to learn how.
2008-02-01 08:02:50 +00:00
Goober5000 5d3458a796 allow FS1 hud to be displayed in FS2
(many thanks to the icculus project for blazing the way)
2008-01-24 03:53:36 +00:00
karajorma 1702405598 Fix for Mantis 1150 2008-01-20 17:18:06 +00:00
Goober5000 ecdf735282 implement the targeting cutoff properly (Mantis #1468) 2008-01-19 01:23:41 +00:00
Goober5000 eb79ba53d1 we all got led down the garden path there! revert all radar range modifications 2008-01-19 00:27:43 +00:00
karajorma eb8504e43b Fix Mantis 1516 2008-01-18 23:00:16 +00:00
Goober5000 1e282b84ee back out the MOI fix 2008-01-18 17:59:53 +00:00
Goober5000 188c449ca6 warn users when they run a campaign under the wrong mod 2008-01-17 07:44:43 +00:00
Backslash e8be84cd6f Fixed set-object-speed sexps. Thanks for the inspiration, Keldor! 2008-01-16 10:15:21 +00:00
karajorma c2ec85d312 Add SEXPs for determining the players score and how many respawns they've used. Add num-assists to this branch too. 2008-01-12 08:44:34 +00:00
Kazan 9854fea01b Apply KeldorKatarn's no autopilot mission flag patch (And a sexp to toggle it as it is a flag that can be dynamically toggled safely) "use-autopilot" is the SEXP [Applied KK's patch by hand]
Had to move things around and resize the mission specs editor - lots of MSVC2005 autogenerated garbage changes in this diff.
2008-01-08 17:24:24 +00:00
Kazan 1d9cacc995 helps to check the right value for the flag 2008-01-08 16:43:37 +00:00
Kazan 06018dc208 add chat/pxo files to MSVC 2005 project
Fix the autopilot cinematic wiggle, hopefully once and for all (every tick force all nav carry ship orientation and wing'ed-ship positions)
2008-01-08 01:41:13 +00:00
wmcoolmon 52e838fa9a Fix lighting and possibly clipping issues with separate-model cockpits 2007-12-31 06:44:23 +00:00
wmcoolmon 2d00070b2c Move cockpit model rendering to prevent unneeded projection matrix switching 2007-12-31 01:29:40 +00:00
wmcoolmon e420348cd5 Separate cockpit model support 2007-12-30 15:29:24 +00:00
wmcoolmon a3d87d2509 player.IsMulti 2007-12-30 13:44:40 +00:00
karajorma 0e4718236a Since you can't actually save a mission without this entry and FS2 crashes without it this probably shouldn't be optional. 2007-12-29 21:03:46 +00:00
Backslash fbf74f0d49 Backslash's "let's get this stuff into 3_6_9 as well" commit.
-gliding with thruster adjustments and speed cap
-glide_when_pressed control (right above bank_when_pressed)
-fixes to the thrusters sound and visuals while gliding
-don't show muzzle flashes in 1st person
-quick reticle for multitarget and asteroids
2007-12-28 02:10:38 +00:00
turey 7b2f9e4829 Bunch of stuff already in HEAD. Shouldn't break anything. 2007-12-20 01:57:45 +00:00
karajorma a7bc5d1318 FRED Changes to support alt name as callsign 2007-12-08 20:35:27 +00:00
karajorma 2ae027de6d Add the use alt as callsign option.
Add a few typo and comment fixes while I'm at it
2007-12-08 20:07:55 +00:00
Goober5000 f365d82080 patch hole in the state machine fix 2007-12-08 04:07:00 +00:00
Goober5000 4977bc3b03 catch invalid bounding boxes caused by buggy POF editors ;) 2007-12-03 04:47:02 +00:00
Goober5000 ce9c1b1fac watch out for bad MOI values 2007-12-02 08:21:50 +00:00
karajorma 75b75dae69 Turn a couple of things on by default. That's two less questions for FRED newbies to bother me with. 2007-11-29 11:29:14 +00:00
karajorma 9cd0a9006d Make the Run Freespace menu option work again 2007-11-29 11:26:51 +00:00
karajorma b44940de0e Change the way that score is parsed from mission files to make it easier on developers. 2007-11-28 21:00:34 +00:00
karajorma c410c5298f Fix Mantis 0397 2007-11-26 18:43:52 +00:00
wmcoolmon bb8e701822 Various minor sign/casting fixes 2007-11-24 04:33:50 +00:00
wmcoolmon c625bf559d Update MSVC2003 Project files 2007-11-24 04:33:29 +00:00
phreak b7be02d4e5 Change the device context variable name. 2007-11-22 17:51:35 +00:00
taylor 6b68884892 oops! not ready to commit that part just yet :D 2007-11-22 05:49:36 +00:00
taylor 2c33c746fb bump node allocation increment (when you are regularly realloc'ing 20-30 times, the increment is too low :)) 2007-11-22 05:36:06 +00:00
taylor dc4567b191 make sure that a missing ship anim doesn't lead us to a horrible death
minor cleanup
2007-11-22 05:31:39 +00:00
taylor 7c0b0950fb fix some missing cleanup 2007-11-22 05:25:22 +00:00
taylor ef94b0d067 fix campaign is missing then give player choice to switch campaigns, switch pilots, or exit 2007-11-22 05:23:44 +00:00
taylor 1adf9cf301 no reason to if-else the hud multiplier if it simply defaults to 1.0
add a little sanity checking for hud mutiplier tbl value
add missing multiplier for off-screen indicator
2007-11-22 05:19:47 +00:00
taylor e7adff269b try to deal better with gamma setting/resetting when minimizing/restoring the game (Mantis #1210) 2007-11-22 05:11:38 +00:00
taylor 41eb45c796 use the less dumb method 2007-11-22 05:04:07 +00:00
taylor bd660329bd minor fixes and cleanup for the warp effect
change scale of 3D warp effect to better match up with size of 2D effect
2007-11-22 05:02:44 +00:00
taylor 757fd455a9 add/remove some old, forgotten, and new files 2007-11-22 04:52:30 +00:00
taylor 904ff7b30e initial support for cursors that are larger than 32x32
fix bug where animated cursors would be constantly loaded/unloaded
2007-11-22 04:49:58 +00:00
taylor 9bd30c1199 cleanup/fixage for fade in/out function (Mantis #1186) 2007-11-22 04:43:47 +00:00
taylor a305007e79 be sure that we hide the game's mouse cursor (Mantis #1401) 2007-11-22 04:31:12 +00:00
Goober5000 a17c8eb39f add Wing Commander Saga's fiction viewer 2007-11-21 07:28:50 +00:00
Goober5000 3449d9c91a fix ship-type-destroyed 2007-11-20 04:58:25 +00:00
Goober5000 d04196a97d recognize a Vasudan main hall even when it isn't the second one; play the appropriate music as soon as the main hall switches 2007-11-20 01:11:13 +00:00
Goober5000 bffcd81423 clean up the state machine logic for starting games 2007-11-19 20:24:40 +00:00
Goober5000 1f12564d47 some minor enhancements to the skip mission cheat 2007-11-19 19:50:15 +00:00
Goober5000 d79a0f5cd7 remove warning... properly this time 2007-11-19 18:11:03 +00:00
Goober5000 16888b09cc clarify what this flag is actually for 2007-11-19 06:22:35 +00:00
Goober5000 1564096c3a use relative paths 2007-11-19 02:28:26 +00:00
Goober5000 abe749c89a fix for Mantis #1503 2007-11-18 07:43:15 +00:00
Goober5000 5966d5df96 gak -- stupid mistake 2007-11-18 06:57:40 +00:00
karajorma 3e1f7a3017 Fix peristent variables in missions played from the techroom 2007-11-14 13:49:31 +00:00
taylor 0af2fddddc fix out-of-bounds issue from retail (Mantis #1518) 2007-11-09 01:32:54 +00:00
taylor 933b4daebc make sound_buffers[] dynamic (part 1 of trying to better handle mods with lots of voice acting, like BtRL)
re-enable DirectSoundCapture for OpenAL builds, at least until I write the OpenAL version of capture (Mantis #1378)
2007-10-29 15:32:19 +00:00
karajorma c1fbc1734b This is better than the other way. 2007-10-29 11:32:22 +00:00
karajorma a4fc52d929 Add the hits-left-singe-subsystem SEXP 2007-10-28 18:10:45 +00:00
taylor 8385cc7e44 bump the buffer size used for Warning() and Error() messages 2007-10-28 16:46:36 +00:00
taylor d00ac67b8e fix volume-setting bug for menu music 2007-10-28 16:45:56 +00:00
taylor da04a2c8f2 fix anothing something that Valgrind complained about 2007-10-28 16:45:05 +00:00
taylor badfb2e5d3 cleanup and bug fixes for ship-guardian-threshold and ship-subsys-guardian-threshold (Mantis #1473) 2007-10-28 16:44:33 +00:00
taylor ab904f48ef always return the default value of osreg isn't initted yet 2007-10-28 16:42:54 +00:00
taylor f34949c84c slighly cleaner/faster version of object secondary fire control 2007-10-28 16:42:16 +00:00
taylor 8db0a4f862 minor code cleanup and better error handling 2007-10-28 16:39:58 +00:00
taylor 0cd2c7f064 fix a loadout bug where the current mission name would get substituted for the previous one by mistake 2007-10-28 16:39:17 +00:00
taylor 055ae2dfaa fix a bug that would crash after hitting ESC and trying to load a pilot (Mantis #1513)
some minor formatting cleanup
2007-10-28 16:38:13 +00:00
taylor 27a5f9b075 make sure that Warning()'s are sent to the debug log too, regardless of whether warning popup is enabled 2007-10-28 16:36:34 +00:00
taylor 428cb3f7cf add "2D Mission" checkbox to mission specs window (Mantis #1387) 2007-10-28 16:35:13 +00:00
taylor ed8321e3b0 freakish hack to allow FRED to run properly when executed from a terminal (and Wine under Linux) 2007-10-28 16:34:11 +00:00
taylor a0ebbfdf6d tisk tisk 2007-10-28 16:33:05 +00:00
taylor 571f8ce645 Valgrind was endlessly complaining about this 2007-10-28 16:32:06 +00:00
taylor 2aced7e9b9 reset Perspective_locked at the start of each mission so that view controls don't get locked until exit 2007-10-23 20:07:42 +00:00
Goober5000 80cf1bf437 fix a minor bug in the dockpoint system (affects sm2-07a in the Port) 2007-10-21 22:11:17 +00:00
taylor a6bd86a157 fix bug with +remove that made a beam section still appear partially valid
fix temp-var snaffu that hendered debugging
2007-10-21 03:40:41 +00:00
Kazan 6b70b0cdfa Enemy cargo containers should not prevent autopilot.
Fix build problem in parselo (strrchr returns const char* not char*, need to explicitly cast - raises error in MSVC2005)
Update MSVC2005 "code" project to reflect removal/addition of fs2netd related files
2007-10-20 23:28:49 +00:00
taylor 3ec5e05f75 change Warning() and Error() to use const format variables (can't remember who said to do this)
fix memory error when zero'ing buffers for error messages on non-Windows platforms
2007-10-17 21:03:06 +00:00
taylor 8142ec3254 since we are polling, "0" is a valid return and we need to wait until we actually get data (screwed up login packet order) 2007-10-17 21:01:33 +00:00
taylor 3f50a7685a sometimes the thread header needs to be specifically included since SDL.h doesn't always do it 2007-10-17 20:59:30 +00:00
taylor d80194ee19 fix mismatched parameters (Mantis #1470) 2007-10-17 20:58:25 +00:00
taylor e67400effa Oops, forgot that the v.2 daemon is still on the secondary IP :) 2007-10-15 08:18:33 +00:00
taylor ef326fd452 FS2NetD v.2 (still a work in progress, but is ~98% complete) 2007-10-15 06:43:23 +00:00
karajorma fef0f71612 Partial (?) fix for Mantis 1084. At least it shouldn't Int3() when the server exits any more. 2007-10-12 19:10:07 +00:00
karajorma 5ee909c583 I meant to remove this ages ago! 2007-10-12 18:57:16 +00:00
taylor e62899077f fix bugs in beam-*-all and turret-*-all that made them always trigger an Int3() 2007-10-04 16:26:43 +00:00
taylor 57848e4ff1 get rid of some old/obsolete items (Mantis #1489 and #1497) 2007-10-04 16:18:46 +00:00
Goober5000 159c82f029 another fix by razorjack... parent is -1 when created by sexp 2007-09-30 22:37:08 +00:00
Goober5000 044486f48f another patch by razorjack -- remove something that never worked 2007-09-30 22:28:29 +00:00
Goober5000 91423f4b63 a bugfix by razorjack 2007-09-30 19:01:18 +00:00
karajorma d50113a8f4 Fix x-builtin-messages so that the Any Wingman option works 2007-09-29 21:51:31 +00:00
karajorma 61a16f38d5 Upgrade the beam-x-all and turret-x-all SEXPs to accept more than one ship. 2007-09-29 15:21:33 +00:00
karajorma 3f4da2c205 Fix the double respawn bug (Mantis 788) and hopefully the corresponding server Int3 (Mantis 1213) 2007-09-29 13:58:45 +00:00
Goober5000 7c1f024ec7 fix the factoring on the shudder parameters (Mantis #1419) 2007-09-04 00:08:51 +00:00
Goober5000 29b8fbcc7e re-add the code to disable the Windows key... this time, without slowing the system to a crawl when FSO is in the background 2007-09-03 22:19:56 +00:00
Goober5000 d24a1714f1 roll back the windows key hook for now 2007-09-03 21:00:24 +00:00
Goober5000 508e8d3fca fix for 1471 2007-09-02 20:07:47 +00:00
Goober5000 00d4376b4e Shade's fix for #1329 (approximately) 2007-09-02 19:06:02 +00:00
Goober5000 71227a0d52 fix for #1455 plus a bit of cleanup 2007-09-02 18:53:24 +00:00
Backslash 22ce524056 2005 Project file cleanup. Changed a lot of paths to compiler macros.
Also gave Freespace2 project the inherited property sheet CoreWin.vsprops -- this lets Express Edition compile!
2007-09-02 12:02:28 +00:00
Goober5000 46fc91d26b that wasn't supposed to happen 2007-09-02 02:17:56 +00:00
Goober5000 a3ba239d97 added fixes for #1415 and #1483, made sure every read_file_text had a corresponding setjmp, and sync'd the parse error messages between HEAD and stable 2007-09-02 02:10:29 +00:00
Backslash a3298ac5cd The long-awaited HUD $Length Unit Multiplier setting! (With lots of help from KeldorKatarn)
Multiplies all speeds and distances displayed by the HUD by a given constant multiplier. The value is declared in hud_gauges.tbl (right after $Max Escort Ships) as
$Length Unit Multiplier: 5
2007-08-30 04:52:30 +00:00
phreak 99d12291ca destroyed-or-departed-delay needs to check for ships that have self destructed 2007-08-26 16:01:59 +00:00
phreak 7901fb12c4 Add WINVER define to the VC2005 project file so it shouldn't affect users of other compilers. 2007-08-25 15:37:43 +00:00
Goober5000 2dde884940 tweaky move 2007-08-20 02:55:12 +00:00
karajorma 3bb74b232e Fix for Mantis 1234 2007-08-19 22:15:41 +00:00
Goober5000 37dc07cf9b bring wxFRED project files up to date 2007-08-18 02:23:13 +00:00
Goober5000 a2fb4b52d8 generalize the way radar ranges are handled (inspired by Shade's fix) 2007-08-17 03:29:51 +00:00
phreak 2295ad112d Local SSMs shouldn't jump into subspace if they're not homing. 2007-08-16 00:45:54 +00:00
Goober5000 dc34695517 okay... let's not redefine the Windows version 2007-08-15 07:16:35 +00:00
Goober5000 fce9cdda46 fix problems with the mini help box
(interestingly this feature was committed to stable but not HEAD)
2007-08-15 06:57:00 +00:00
Kazan ba8e33324e forgot to cvs add these project files 2007-08-14 15:42:44 +00:00
Goober5000 bf839fa838 disable the Windows key while FreeSpace is running (thanks to jr2)
c.f. http://www.hard-light.net/forums/index.php/topic,48838.0.html
2007-08-13 23:07:35 +00:00
Goober5000 429486b26c some improvements to the pirate ship 2007-08-13 04:54:41 +00:00
Goober5000 4afd910bb2 some tweaks for a field that's mostly unused anyway 2007-08-11 16:52:02 +00:00
Goober5000 61bd2ab443 fix case-sensitive #include (Linux) 2007-08-04 22:30:02 +00:00
karajorma 4c68f9c96d Reinforcements Editor bug fixed Sucka! 2007-08-03 19:10:06 +00:00
Goober5000 af608534fd fix warning 2007-08-03 01:35:48 +00:00
Goober5000 5185800672 fix compilation issue 2007-08-03 01:17:10 +00:00
Goober5000 b67396b081 allow embedded dashes in command-line options 2007-07-29 03:11:01 +00:00
Goober5000 7302923cd7 apply some of Turey's changes to stable branch 2007-07-28 22:04:14 +00:00
Goober5000 7f46d67f46 this should really be capitalized 2007-07-28 21:31:11 +00:00
Goober5000 9219250d45 make the parse object array dynamic; also made the docking bitstrings dynamic 2007-07-28 21:17:56 +00:00
Goober5000 7abde24fd8 a couple of tweaks 2007-07-28 04:43:43 +00:00
Goober5000 b2f7eea91a AAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!! 2007-07-28 00:37:38 +00:00
Goober5000 09ca41f26d dork 2007-07-27 21:57:15 +00:00
Kazan 06fc0fcc29 I <3 making stupid bugs (return camera to normal when not using cutscene bars) 2007-07-25 20:45:16 +00:00
Kazan 33ab67c281 two-part autopilot warp, add +No_Cutscene_Bars optional flag to autopilot.tbl 2007-07-25 14:51:14 +00:00
Kazan a3e41b1c67 small tweak 2007-07-25 00:33:31 +00:00
Kazan 00338ff1fd oops 2007-07-24 20:31:00 +00:00
Kazan e9a394a42b Make asteroid/debris fields interrupt autopilot, add "hazards near" message to autopilot.tbl, add use-nav-cinematics sexp, fix mantis #1441 2007-07-24 20:08:31 +00:00
Kazan 3f7163c4be Resolve Mantis 1281 2007-07-24 13:04:11 +00:00
Goober5000 2a7ae53748 allow mission messages in dogfights (Mantis #1436) 2007-07-24 05:08:13 +00:00
Kazan 7f36f00f31 Autopilot updates, minor misc fixes, working MSVC2005 project files 2007-07-23 16:08:36 +00:00
Goober5000 ef429f53c7 Kazan's autopilot fix 2007-07-15 18:00:55 +00:00
Goober5000 8826356cfa fix and clean up the warpout conditions 2007-07-15 08:20:05 +00:00
Goober5000 e878123b13 restore WMC's ship flag 2007-07-15 06:29:56 +00:00
Goober5000 d32a5ac688 fix extremely minor bug 2007-07-15 04:45:42 +00:00
Goober5000 952ae3e813 partial commit of aldo's eyepoint feature
it will need a keystroke to be complete
2007-07-15 04:19:34 +00:00
Goober5000 80b5e9bbe6 fixed a small bug in the lab
moved WMC's no damage scaling flag to ai_profiles and made it work correctly
removed my old supercap damage scaling change
moved Turey's truefire flag to ai_profiles
2007-07-15 02:45:51 +00:00
Goober5000 cdbc4374ed fix a newline bug in the voice acting manager 2007-07-14 23:22:47 +00:00
Goober5000 59ee8da2d4 fix an off-by-one error 2007-06-30 23:32:25 +00:00
taylor 4f81c3e8da convert to LF EOL 2007-06-25 19:17:56 +00:00
Backslash 33c9552464 Cutscene subtitle positioning fix for resolutions other than 1024x768. Code by MikeStar. 2007-06-24 23:32:16 +00:00
karajorma 22440bbc4b Fix an issue with single character command line arguments 2007-06-24 17:59:17 +00:00
wmcoolmon 94d092566b Remove MSVC_7 directory from 3.6.9 branch 2007-06-09 00:57:36 +00:00
wmcoolmon 0bdf1a1697 Update MSVC_2003 directory with MSVC_7 files 2007-06-09 00:56:10 +00:00
Backslash e5c36022be Another Gliding fix for 3_6_9: Makes it so switching gliding back off doesn't make your ship instantly switch direction. 2007-06-04 03:09:51 +00:00
Backslash 0d568cf7b1 Here's the Gliding gauge for 3_6_9 as well. Simple but useful especially for mods that use it, like BtRL 2007-06-02 21:40:59 +00:00
taylor aebbd9b320 more resilient checking of stars.tbl and it's modular versions 2007-05-28 20:05:06 +00:00
taylor 3eef49ed1e various bits of clean up
make stats printing a bit more sane
printf out game version info to debug log (not very helpful, but might prove some use)
2007-05-28 20:00:17 +00:00
taylor fd6905b4a1 this is a bit cleaner way to do it :) 2007-05-28 19:47:46 +00:00
taylor 619fc376fa oops! the exit() was supposed to come /after/ the last printf() :) 2007-05-28 19:46:30 +00:00
taylor eeebd05daa make the chcksum spew in logs always have a full 8-set of values
skip over files found on system which are over the max filename length, prevents several crashes (partial for Mantis #1182)
2007-05-28 19:45:14 +00:00
taylor 544667ad2b various bits of cleanup
don't draw beam impact effect if we are hitting a shield
updated hit shield quadrant properly for player when a beam hits
set shield quadrant and exit_flag properly for collision info so that we don't count damage twice and handle no_pierce_shields properly
2007-05-28 19:41:47 +00:00
taylor fab10cf66d fix armor index bug for shockwaves 2007-05-28 19:38:10 +00:00
taylor 5882e1fec4 bump version to 3.6.10 2007-05-28 19:36:26 +00:00
wmcoolmon 7783406c92 Project file commit. These aren't specifically set up for CVS, but they will at least compile. 2007-05-28 18:28:32 +00:00
wmcoolmon 48cdd1e88c Added armor support for asteroid, debris, ship, and beam damage 2007-05-28 18:27:36 +00:00
Backslash aa09ac254a Now that I've figured out how to commit to the 3_6_9 branch, here's a cleanup and update to bring physics as close to HEAD as possible without breaking anything or adding my uberglide changes yet. This fixes:
-the reverse-thusters-not-working-at-full-throttle bug
-the fishtail-way-too-fast-sideslip at high Damp values problem
-the slide accel/decel damp inconsistency
Some of these fixes will be particularly noticable to the BtRL people, hopefully all in good ways.
Also fixed a bunch of typos and whitespace just to get it consistent with HEAD.
2007-05-26 15:36:38 +00:00
Goober5000 e7aac846ad add placeholder stuff for parsing ship-class texture replacements 2007-05-26 15:12:07 +00:00
Goober5000 7a6fef3897 that was weird 2007-05-26 15:11:15 +00:00
Goober5000 b91ff71edb when importing FS1 missions, account for the shuffled Head-TP4 2007-05-26 12:08:26 +00:00
Goober5000 edfbc7af3f the reinforcement comm menu will now correctly display according to whether or not reinforcements are available 2007-05-26 00:56:11 +00:00
taylor e812667660 add the rest of the texture page-in code changes that I skipped before (should fix Mantis #1389) 2007-05-25 13:49:39 +00:00
taylor 0911b85e31 make Linux just verbally ignore invalid cmdline options rather than it being fatal 2007-05-25 13:47:10 +00:00
wmcoolmon 4375309895 . 2007-05-20 21:24:09 +00:00
wmcoolmon f50c9fe2f5 FRED2 support for numbered SEXP operator arguments, minihelp box, fixed "Insert Event" when no events are present. 2007-05-20 21:21:35 +00:00
taylor e678132d09 fix stupid bugs in CF_SORT_REVERSE (should be as originally intended now) 2007-05-20 02:51:26 +00:00
taylor cf9509633e fix armor_parse_table() so that it will parse multiple entries properly
fix bug introduced from not closing down lcl_ext after parsing armor.tbl
2007-05-17 14:58:40 +00:00
Goober5000 496c9929d4 --grouped the shake/shudder code together a bit better
--added a sexp to generate shudder
--fixed a minor bug in lock-perspective
2007-05-14 23:13:51 +00:00
taylor 34824f224d add session open/close times to debug log 2007-05-11 03:16:01 +00:00
taylor 851a21ff57 properly handle invalid sound index case, fixes div-by-0 error 2007-05-11 03:14:02 +00:00
taylor 06bbb98a50 very minor optimization (mul is much faster than div) 2007-05-11 03:12:28 +00:00
taylor 29cc9a4186 fix debug message (using wrong name, spit out a bunch of garbage on Windows boxes) 2007-05-11 03:10:48 +00:00
taylor 0a1885e09f delete the .hdr file once we are done with it, since it's no longer useful 2007-05-11 03:09:21 +00:00
karajorma 59d5013b5b Doh! Missed the return type. 2007-04-26 18:59:36 +00:00
karajorma 408f785611 Fix a number of places where the player of a dogfight game could end up in the standard debrief. 2007-04-24 12:07:35 +00:00
karajorma 838738fc46 Add the knock feature from Tom's build. 2007-04-24 09:52:26 +00:00
karajorma 780b92a8f0 Remove the -fredhtl command line. 2007-04-17 17:15:31 +00:00
taylor 13d3da67be add Linux friendly icon 2007-04-15 12:46:43 +00:00
taylor 234aaf9be3 only add player-allowed flag on #Weak weapons when their non-weak versions also have the flag (Goober #73) 2007-04-14 23:44:08 +00:00
taylor 9da63c5c7e little cleanup
fix memory size fubar on trail vlist ptr
2007-04-14 23:42:20 +00:00
Goober5000 aeb8a5ed84 fixed a silly speech bug (Mantis #1238) 2007-04-13 03:23:12 +00:00
taylor a2ab858272 cleanup and initialize persona_index properly for general safety reasons
slight change to karajorma's NO_BUILTIN_MESSAGES check, now it will be properly compiled away in release builds rather than an empty function
2007-04-13 00:36:43 +00:00
taylor c524db4e45 use qsort() instead of insertion_sort() for light sorting, it should be better optimized and quicker in general for this use 2007-04-13 00:33:41 +00:00
taylor 969291cc24 some basic cleanup for the extension code
fix the old bug that didn't report a missing extension name properly
get rid of the message that says to use D3D, that's not normally going to be an option anyway
add ARB_point_sprite support, mostly for fun since no code will actually use it until after 3.6.10
2007-04-13 00:31:58 +00:00
taylor 10b28b5e2a clean out some old code we no longer use/need
change warning messages to not print out current tbl name, since at the point those messages show the tbl has long since been parsed
add an extra quick-check to ship_get_subsystem_strength() to avoid div if we don't need it
make Ship_subsystems[] dynamic (sort of), it's allocated in sized sets now, so we can easily change size while still working with the existing linked-list code
2007-04-13 00:28:00 +00:00
taylor a3a4a05cad this got chopped off of the previous commit for some reason 2007-04-11 18:23:01 +00:00
taylor 2526b893cf cleanup of chcksum stuff (works properly on 64-bit systems now)
add chksum support for VPs, both a startup in debug builds, and via cmdline option (-verify_vps)
little cleanup in cmdline.cpp (get rid of the remaining "fix bugs" crap)
2007-04-11 18:21:23 +00:00
taylor 472d4d7a09 cleanup error message
allow launch_snd from tbl to be used for beam weapon shot sound (Mantis #1263)
2007-04-11 18:17:26 +00:00
taylor 04b6094be1 add modular version of strings.tbl (*-lcl.tbm) (provides for Mantis #924) 2007-04-11 18:11:21 +00:00
taylor 875fc6de9f bm_unload_fast() should only unload the bitmap passed for animations, not the entire animation (fixes several issues) 2007-04-11 18:05:18 +00:00
taylor 0db9092fea get rid of stale NO_JOYSTICK define 2007-04-11 14:59:35 +00:00
taylor 053b335cd7 add extra safety check to make sure that we are going to do a wildcard search for modular tables 2007-04-11 14:58:07 +00:00
taylor fae4fa70ff get rid of (now) unused variables 2007-04-11 14:44:32 +00:00
taylor dd1020447f update to 3.6.9 release 2007-04-09 21:03:57 +00:00
taylor 4ce0241ef7 basic update to current frameworks (adding Theora) 2007-04-09 21:01:46 +00:00
taylor 086fbbe363 new icon from Foxer 2007-04-09 21:00:44 +00:00
taylor 9707877617 update to current settings/files 2007-04-09 20:59:25 +00:00
karajorma fa5d07d82a Fix for Mantis 1312 2007-04-09 18:25:31 +00:00
karajorma ac3a47c5b6 Make .wavs work again in the briefing editors. .ogg appears to be a bit harder. 2007-04-08 08:28:20 +00:00
karajorma 73042978a5 Add the -cap_object_update command line to force multiplayer clients to a more server friendly object update setting. 2007-04-06 12:55:57 +00:00
karajorma 72afd1326c Fix bug whereby clients who were gliding can't jump out at the end of the mission. Remove a couple of magic numbers that looked at me the wrong way. 2007-04-05 16:49:21 +00:00
karajorma c58ad4e0b3 A few minor fixes 2007-04-05 16:43:44 +00:00
karajorma 6e3056a679 What was I thinking? Fixed 2007-04-05 16:33:25 +00:00
karajorma 36dca50f20 Fail warpout if the player is in glide mode (They'd never get up to warp speed anyway half the time) 2007-04-05 16:29:25 +00:00
karajorma 9a7078e879 Remove message source boxes on friendly stealthed ships 2007-04-05 16:25:58 +00:00
karajorma 74e0ecf4b2 Makes little difference but I suppose I should zero that 2007-04-05 16:20:36 +00:00
karajorma 5df3f0b1e9 I could have sworn I committed this! Anyway, make the wingman complain when you shoot them instead of command. Send traitor messages from wingmen if command is silenced. 2007-04-05 15:59:44 +00:00
Goober5000 efaf783bf1 meh, space 2007-04-03 02:19:26 +00:00
Goober5000 64faed5160 fixed up some error messages 2007-04-03 01:39:31 +00:00
karajorma 0e0975b65c *** empty log message *** 2007-03-23 06:25:31 +00:00
taylor 038f28d04a forgot to remove -jpgtga from Launcher options previously
get rid of -fixbugs and -nocrash crap
2007-03-22 20:55:53 +00:00
taylor 9bc268c2b4 give a better msg when movies can't play because they are user-disabled with the cmdline option 2007-03-22 20:54:00 +00:00
taylor 2f0b6e9243 bump version to 3.6.10, it will be needed for new texture replacement stuff (tbl version commenting) 2007-03-22 20:52:38 +00:00
taylor d393e69364 some generic code cleanup 2007-03-22 20:50:28 +00:00
taylor a1a79ebefa make sure that we set/reset the red alert data properly (Mantis #1255) 2007-03-22 20:47:49 +00:00
taylor 6ea3ff64d3 cleanup and fix for weapon cycling (Mantis #1298) 2007-03-22 20:45:22 +00:00
taylor 185fdeb1c4 be sure to page in textures for change ship class sexp preload
add a ASF_MENUMUSIC type for things that aren't mission-based event music (since that is handled differently now)
make event music keep extension if it exists, so that the special data will be accurate
bits of cleanup from old MS code that we don't need
2007-03-22 20:35:45 +00:00
taylor 213abaa02c fix stupidness that screwed up RGB values (Mantis #1307) 2007-03-22 20:23:58 +00:00
taylor 7332293df0 a little better error handling for cf_exists_full()
add a cf_exists_full_ext() which can find a series of extensions and returns true if any of them exist
use cf_exists_full_ext() for eventmusic file checks (to check for ogg and wav)
get rid of SPM hack, it's wrong (just commented out for now though)
fix a bunch of bugs in cf_find_file_location_ext():
 - try to handle files with multiple periods a bit better (for the wav files like: blah_1.5.wav)
 - load issue with finding incorrect files by mistake
 - prevent finding different file types in various paths/roots
2007-03-22 20:22:45 +00:00
taylor c1921bfb6f various bits of bmpman cleanup
be sure to clean all three possible buffers with OGL init
fix a couple of bmpman loading bugs that messed up animations
fix bmpman bug that didn't properly account for free'd texture ram count with unload_fast
2007-03-22 20:14:17 +00:00
taylor 30306e9a7f old ✌️ snafu 2007-03-22 20:09:05 +00:00
taylor 5fcc713d64 when parsing a modular tbl, allow a duplicate sun entry to overwrite an existing one 2007-03-22 20:07:16 +00:00
taylor 5a93e4562a little bit of cleanup
set "#Weak" weapons to always get the "player allowed" flag (Mantis #1301)
2007-03-22 19:31:25 +00:00
taylor ab02eefab2 fix strange bug where a beams parent will die and the object reset before the beam gets the chance to fire 2007-03-22 19:30:00 +00:00
karajorma 905e16f825 Bump the number of debriefing stages.
Fix an annoying (and erroneous) warning in the campaign editor.
2007-03-21 20:54:25 +00:00
karajorma ce856d94c5 Turn off afterburner controls when player isn't in control 2007-03-11 22:55:32 +00:00
karajorma 9365ab68d6 Make .ogg selectable in FRED. 2007-03-07 22:36:52 +00:00
karajorma f77e27b606 It's perfectly legal to press the Target Target's Attacker key with no target. We should just play a failed sound instead. 2007-03-07 17:51:15 +00:00
Goober5000 ef3b4b29b3 add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty 2007-02-27 01:44:48 +00:00
Goober5000 d1719ac139 added vm_matrix_same() 2007-02-26 01:47:23 +00:00
Goober5000 72bdc71ec5 use dynamic memory instead of a static buffer for ship-specific replacement textures 2007-02-25 03:58:07 +00:00
Goober5000 69a5e72cd0 remove duplicate model texture replacement 2007-02-21 01:44:02 +00:00
Goober5000 67e673b810 wups 2007-02-20 04:53:11 +00:00
Goober5000 c9a16f9eb5 revert to retail behavior 2007-02-20 04:27:23 +00:00
Goober5000 ddf19cb2a1 the great big duplicate model removal commit 2007-02-20 04:20:38 +00:00
Goober5000 491c5f3e55 *** empty log message *** 2007-02-20 01:41:07 +00:00
taylor 1ff86bc6f0 forgot that too (like Bobboau did the first time :)) 2007-02-18 21:57:30 +00:00
Goober5000 774d4fd091 magic word 2007-02-18 21:26:52 +00:00
taylor 0406978de1 fix super-stupid bug :) 2007-02-18 08:59:03 +00:00
Goober5000 153fc41243 remove obsolete and misleading comments which should have been edited when the code was upgraded 2007-02-16 22:09:05 +00:00
karajorma 9a052f877a Thought I'd caught all of these months ago! Thanks to Wanderer for the heads up. 2007-02-16 18:48:42 +00:00
Goober5000 8fcc333dfe uhh... wrong? 2007-02-16 07:06:46 +00:00
Goober5000 df69c06b42 fix a hideous bug with the knossos special warp stuff
(how did this ever actually work correctly?)
2007-02-13 01:46:03 +00:00
taylor 7abcde7fa5 disable D3D by default for stable tree 2007-02-12 07:32:03 +00:00
taylor bf1757b2fe a little cleanup
handle issue where we don't deal with an error condition properly and hit a NULL ptr
2007-02-12 07:31:03 +00:00
taylor b9643a6e95 fix stupid bug (Mantis #1275) 2007-02-12 07:29:51 +00:00
taylor 4c46062338 fix a couple of things that I missed earlier 2007-02-12 02:19:45 +00:00
taylor a434918be5 make gr_create_shader() use ubyte's instead of float's, saves us the more expensive conversions since we already convert to ubyte anyway 2007-02-12 01:04:50 +00:00
taylor 8a7e865e30 make use of generic_anim and generic_bitmap where possible
bunch of cleanup and little optimizations
add "+remove" tbl option to completely get rid of particular beam sections
delayed loading of bitmaps, will only do it after all tbl/tbm have been parsed
if we are using a POF missile which isn't loaded yet, try and load it before going crazy
bug fix and optimization for laser color setting
2007-02-12 00:54:31 +00:00
taylor 18c778a8bb oops, forgot this bit 2007-02-12 00:48:43 +00:00
taylor b02f41b3bd bit of cleanup and minor performance tweaks
sync up with new generic_anim/bitmap and weapon delayed loading changes
with generic_anim, use Goober's animation timing for beam section and glow animations
make trail render list dynamic (as well as it can be)
2007-02-12 00:45:24 +00:00
taylor c77b979fbc bit of cleanup and minor performance tweaks
render ship insignia with a bit of alpha to help with blending/lighting
dynamic thruster particle limits
update for generic_bitmap/anim changes
make use of flag_def_list for ship flags rather than a ton of if-else statements
use generic_bitmap and generic_anim where possible to faciliate delayed graphics loading (after all ship related tbls are parsed)
use VALID_FNAME()
2007-02-12 00:41:38 +00:00
taylor eb2aecdf36 add back special "var" setting for flag_def_list and convert some of the lists to use it (more on the way) 2007-02-12 00:24:33 +00:00
taylor 78afc89e6c get rid of non-standard itoa(), make use of the proper sprintf() instead 2007-02-12 00:23:40 +00:00
taylor 991cf0ee52 some generic_bitmap fixes to go with new changes (not in CVS just yet, don't freak out)
make use of VALID_FNAME() where possible
fix an animation time issue (sub-second animation playback caused div-by-0)
2007-02-12 00:22:05 +00:00
taylor fbc5ad02c4 IBX version 2 support (includes Bobboau's earlier D3D fixes for it) 2007-02-12 00:19:48 +00:00
taylor b430fd4899 fix breakage (hehehe ;)) 2007-02-12 00:17:07 +00:00
Goober5000 1f82fd3589 fixage 2007-02-11 22:46:39 +00:00
Goober5000 de456e2fc1 change a number to a constant 2007-02-11 21:42:41 +00:00
Goober5000 daee540734 fix some breakage ;) 2007-02-11 20:26:00 +00:00
taylor 4fbc9380c9 fix a break from an earlier partial commit 2007-02-11 18:46:30 +00:00
taylor ab9d839402 cleanup and minor performance improvements
add support for new fireball specific lighting values from tbl
remove NO_SOUND
2007-02-11 10:04:46 +00:00
taylor ff56f00c12 remove some dead code
general cleanup
fix issues with texture state changes not affecting things properly
fix stupid texture addressing thing that I had done a long time ago
deal with -img2dds error issue
2007-02-11 10:03:29 +00:00
taylor c20f5996e4 remove cloakmap stuff, we'll need to redo this later on anyway
don't need the AVI movie hacks any longer, so remove it
deal better with a strange Windows buffer swap issue
various bits of cleanup and performance improvements
fix for gr_opengl_flash() that I had screwed up earlier
2007-02-11 10:01:11 +00:00
taylor 1defedc8b4 remove -pcx32 and -jpgtga
support for a couple of recent bmpman changes
2007-02-11 09:58:20 +00:00
taylor 93c253dcea support for new finding/loading of sound files
add support for automatically figuring out samples-per-measure based on Goober's explanation in the Wiki (not sure if it's actually right though)
remove NO_SOUND
2007-02-11 09:56:25 +00:00
taylor b0a2cffc36 support for tbl specified fireball explosion color ("$Light color:") 2007-02-11 09:53:33 +00:00
taylor 960b46b683 remove some dead code
better texture memory handling (a work in-progress)
new image finding/loading
get rid of -pcx32 and -jpgtga
change the game_busy() reporting during bitmap page-in to only catch one frame of an animation
fix numerous little bugs in gropenglbmpman relating to -img2dds
2007-02-11 09:51:21 +00:00
taylor c83c606e1e some minor performance improvements
remove NO_SOUND
2007-02-11 09:39:09 +00:00
taylor bffe468e45 add VALID_FNAME() macro and put it around a few places (more to come)
clean out some old variables
move CLAMP() macro from opengl header to global header
update COUNT_ESTIMATE to match new bmpman changes
2007-02-11 09:35:11 +00:00
taylor cd5e2d8da8 forgot to remove .avi and .mpg from CF_TYPE_ROOT 2007-02-11 09:32:19 +00:00
taylor 71337da2aa some CFILE cleanup and slight directory order reorg
add cfopen_special() for quickly opening files that have already been found with cf_find_file_location_ext()
remove NO_SOUND
2007-02-11 09:25:42 +00:00
taylor 4c9df346c4 remove -pcx32 and -jpgtga 2007-02-11 09:24:08 +00:00
taylor 164075331d remove AVI/MPG support, we now rely just on MVE/OGG 2007-02-11 09:23:14 +00:00
taylor 0d5718d3fc remove NO_SOUND
fix debris recycling
2007-02-11 09:22:29 +00:00
taylor bd3b2ecc35 little bit of cleanup
more fixage for hidden jumpnodes (Mantis #1149)
2007-02-11 09:12:12 +00:00
taylor 7bbc7ace68 fix simroom crash bug from Goober's rencent change
add NULL handling to make sure we don't crap out on sorting
2007-02-11 09:10:14 +00:00
taylor dd281588e9 little bit of debug message cleanup
don't bother dealing with message wav file if sound is disabled
2007-02-11 09:07:33 +00:00
taylor 011490349e if we are a dying ship then don't do collision detection against our own debris (slight performance boost to exploding ships) 2007-02-11 09:06:30 +00:00
taylor 793a69504e add WMC's strextcmp() from HEAD 2007-02-11 09:05:02 +00:00
Goober5000 6f62aac45b we probably don't need to play a sound when we equalize already-equalized shields, since we don't play one when we augment already-augmented quadrants 2007-02-11 07:36:43 +00:00
Goober5000 d6f1c9f937 when alphabetizing campaigns, ignore "the" at the beginning of a title 2007-02-11 06:38:56 +00:00
Goober5000 09681fcfe3 invert the do-collision flag into a don't-do-collision flag, plus fixed a wee lab bug 2007-02-11 06:19:08 +00:00
taylor abe216721b make sure that we don't set the 2d view matrix and then not reset it (Mantis #1269)
clean up some of the fullneb mess that was causing some initial setup issues (colors wrong, etc.)
2007-02-10 20:23:51 +00:00
Goober5000 61aacb38e9 sort campaigns by title, not by file name 2007-02-10 06:55:58 +00:00
Goober5000 8905f709c7 take all subsystems into account when displaying repair gauge 2007-02-10 05:01:11 +00:00
Goober5000 25f9cea088 prevent the AI from falling into the black hole of disarming a turretless ship 2007-02-10 04:49:23 +00:00
Goober5000 7b7013e16f small tweak 2007-02-10 03:20:43 +00:00
taylor ad204d2bef remove NO_SOUND 2007-02-10 00:18:22 +00:00
taylor 7f22a46272 phreak missed fixing this here when he fixed it in unstable 2007-02-10 00:16:57 +00:00
taylor 1a1b210017 remove NO_SOUND
fix glow bank sexp bug (Mantis #1250)
2007-02-10 00:15:32 +00:00
taylor 0f10a1b1df fix a mouse button issue (just an issue with newer SDL versions?) 2007-02-10 00:12:35 +00:00
taylor 9903df7e6c a quick debug test to catch an error and FRED doesn't catch on it's own yet 2007-02-10 00:10:31 +00:00
taylor 67cb35a2d2 performance optimizations:
- fvi_ray_boundingbox() is faster and should be less prone to compiler/optimization/platform specific issues
 - clean up or obj_check_all_collisions() which is a good bit faster now
2007-02-10 00:08:59 +00:00
taylor f5ed718e1a obsolete gluLookAt() in favor of doing it manually, should be slight faster and more precise 2007-02-10 00:05:48 +00:00
taylor 9cbe1a4b2b performance/accuracy optimization for the (un)size functions 2007-02-10 00:04:03 +00:00
taylor 22a3e0f710 make sure that our color is getting set properly (should properly fix the red/green tint problem, Mantis #1041)
slight optimization for Theora YUV->RGB converter
2007-02-10 00:02:18 +00:00
taylor 561efe84b4 add the "show all" hotkey to the cutscene viewer 2007-02-09 23:58:52 +00:00
taylor 436af79187 add the number of files that CFILE is going to try and use in each root to the debug info
optimizations for cf_find_file_location_ext()
2007-02-09 23:57:24 +00:00
taylor d597ba2b40 add better support for Ogg, Vorbis and Theora libs/includes 2007-02-09 23:54:00 +00:00
Goober5000 33f13744a2 merge the voice acting manager into the 3.6.9 (3.6.10?) branch 2007-02-09 05:40:40 +00:00
Goober5000 b04ce2c099 merge the WCS screaming feature into the 3.6.9 (3.6.10?) branch 2007-02-09 04:53:28 +00:00
Goober5000 93bcf9fe29 add a few ship flags that weren't on the dialog 2007-02-08 18:34:05 +00:00
Goober5000 77142be1e8 fix two bugs:
--default ship flags in the iff_defs table were not correctly translated from parse flags to ship/object flags
--ships were created with default allowed comm orders regardless of which team they were on
2007-02-08 07:39:35 +00:00
Goober5000 e30280306f Clean up the ship-weapon collision code for both conventional weapons and beams. Improved readability and clarity; untangled program flow; cleaned up sloppy enhancements. Fixed a few bugs too. 2007-02-07 07:35:01 +00:00
Goober5000 c88f10c883 remove obsolete and unused shield flag 2007-02-06 01:27:34 +00:00
Goober5000 bceb9a64be fix an old subtle bug 2007-02-03 23:16:41 +00:00
karajorma 7904cf3ebf Fix add-remove-escort to actually use a priority. 2007-01-27 18:39:09 +00:00
karajorma f2cab2c8c0 Add the reset-orders SEXP
Some general houskeeping to keep 3.6.9 and HEAD throwing up lots of annoying diffs that are just spacing issues.
2007-01-15 11:57:02 +00:00
Goober5000 3e9ff0e03d thanks to WMC for catching this -- it was a goof from back in 2003! 2007-01-15 01:55:46 +00:00
karajorma da685b067b Fix bug where orders you gve last mission are sill accessible to the Order SEXP. 2007-01-14 20:55:20 +00:00
Goober5000 e515d9c5b6 hmm... I guess when I fixed this back in 2004, I fixed it the wrong way :D 2007-01-12 04:33:50 +00:00
taylor c5353e61e5 fix escort positioning issue (Mantis #1179) 2007-01-07 13:18:32 +00:00
taylor 7b6575aeda safety check to make sure that we don't end up with non-player-usable weapons in the weaponselect pool (Mantis bug #1196) 2007-01-07 12:18:09 +00:00
taylor e755ddf376 fix a couple of memory leaks with modular tables 2007-01-07 12:16:31 +00:00
taylor 5935506685 be sure to page in skybox textures properly 2007-01-07 12:16:01 +00:00
taylor dd4b939f23 allow loading of ogg or wav based on which is found first rather than tbl filename (fixes crash when Theora movies end up in wav code by mistake) 2007-01-07 12:15:09 +00:00
taylor 959335c061 fix model vertex normal data that was being read/written incorrectly under OS X (still don't know why this was a problem, but this fixes it) 2007-01-07 12:13:57 +00:00
taylor 56e0f790ce fix NULL ptr reference when a weapon doesn't have a tech description 2007-01-07 12:12:46 +00:00
taylor a5418b848a rest of the weapon switch out-of-bounds/Assert() fix 2007-01-07 12:11:51 +00:00
taylor baa90ae0a4 we are only supposed to init 5 slots here, not 6 ;) (Mantis bug #1195) 2007-01-07 12:11:05 +00:00
taylor 6e5d03518c remove D3D support for Theora movies, make sure that it doesn't try to play them (since it wouldn't work properly anyway)
fix triple-buffer problem with page flipping (Mantis #1190)
2007-01-07 12:10:18 +00:00
taylor bde14dae68 fix bm_page_in_texture() so that it will load all frames of an animation (caused slowdowns in-game with it) 2007-01-07 12:07:40 +00:00
Goober5000 062c3f0490 don't display any error messages when there are no background bitmaps to load 2007-01-07 03:44:50 +00:00
Goober5000 c004068db2 fix bug where built-in lament messages were never played 2007-01-07 03:10:05 +00:00
Goober5000 505111ae75 taylor's bugfix 2007-01-06 23:56:43 +00:00
Goober5000 f8ec47089d gah, not this again 2007-01-04 04:51:57 +00:00
Goober5000 0eb1ddd6c5 fix spelling... *twitch* 2006-12-28 22:47:16 +00:00
Goober5000 521ec98a33 assume ships-with-bays which haven't yet entered the mission are valid for syntax checking 2006-12-28 02:07:49 +00:00
Goober5000 b14a884535 removed obsolete limits 2006-12-28 01:22:04 +00:00
karajorma 0079065ffd Altered the Warpin and Warpout types flag to match those in HEAD. 2006-12-27 10:27:10 +00:00
taylor b31d2ea5d9 fix OpenGL envmap "issues" (ie, stupid taylor stuff)
get rid of that RCS_Name thing, CVS kept changing it automatically and it was getting /really/ annoying
2006-12-27 09:26:21 +00:00
taylor e461e50eb2 wurrps, someone besides me might actually want to use that ;) 2006-12-27 09:24:31 +00:00
Goober5000 25afacc59b allow parsing of similar ship copy names properly (Mantis #1178) 2006-12-26 18:14:42 +00:00
taylor cf010a46f8 add Theora files/libs
add mapinfo stuff so that .map files are actually useful (wasn't this here before?)
add /y to the copy command, since it wasn't always copying over existing builds for me
2006-12-26 05:35:07 +00:00
taylor c055184c86 make weapon_expl info dynamic 2006-12-26 05:32:59 +00:00
taylor 582e5d2165 be sure to reset our skybox model properly, it can lead to a bad model unload bug on level load otherwise 2006-12-26 05:32:18 +00:00
taylor 0f43abd42a fix some sound state stuff that was leading to crashes in OS X and undefined behavior in Windows (this isn't all that pretty, but will handled properly in post-3.6.9 revised code) 2006-12-26 05:31:22 +00:00
taylor 2e1696e7c1 minor spelling fixage
make depreciated subsystem flag syntax be a debug log warning instead a popup warning (FOR 3.6.9 ONLY!)
2006-12-26 05:30:00 +00:00
taylor c0c2f9b552 remove unneeded header 2006-12-26 05:27:54 +00:00
taylor 75a0330a08 make sure that we don't target a hidden jumpnode, and if we do be sure to only detarget it rather than turning off auto-targetting 2006-12-26 05:27:15 +00:00
taylor 1bcd371184 remove some old stuff that we either don't use or don't need any longer 2006-12-26 05:26:12 +00:00
taylor 94089db6db lots of little cleanup, stale code removal, and small performance adjustments
get rid of the default combine texture state, we don't need it in general, and it can screw up fonts
get rid of the secondary color support, it doesn't do much in non-HTL mode, screws up various things, and has long since been obsolete but material setup
get rid of the old gamma setup, it actually conflicts with newer gamma support
default texture wrapping to edge clamp
do second gr_clear() on init to be sure and catch double-buffer
make sure that our active texture will always get reset to 0, rather than leaving it at whatever was used last
fixed that damn FBO bug from it hanging on textures and causing some rendering errors for various people
only lock verts once in HTL model rendering
2006-12-26 05:25:18 +00:00
taylor d884b96ec5 comment out some extensions that we either don't use or don't need to use 2006-12-26 05:18:14 +00:00
taylor 44647b0000 tweak emission light a little bit
various bits of cleanup that I've been meaning to do
2006-12-26 05:17:28 +00:00
taylor f5b043c42e support both "none" and "<none>" on filenames to skip (will do this better later, ran out of time) 2006-12-26 05:15:40 +00:00
taylor e58c1fd05d get rid of some stale vars that we don't use any longer
a little at-exit cleanup
handle rounding error on X/Y placement locations under Windows
2006-12-26 05:14:52 +00:00
taylor 846e355928 add support for Theora movies (the default format)
some little bits of cleanup
add second gr_clear() so that double-buffer'd visuals will work properly (ie, not flicker when playing MVE/OGG)
2006-12-26 05:13:29 +00:00
taylor d68d66c97d add .ogg files to movie locations 2006-12-26 05:11:57 +00:00
taylor 53592b24c9 add OGG Theora player to build list 2006-12-26 05:11:30 +00:00
taylor b36ac1779d add Theora libs 2006-12-26 05:11:01 +00:00
taylor 41d2475b7a initial OGG Theora movie support (likely to be rewritten at least in large part) 2006-12-25 21:44:11 +00:00
Goober5000 b6164cdb2e make chase view and external view toggles independent (Mantis #1087) 2006-12-25 18:54:15 +00:00
karajorma b50635bc81 Move the voice recognition init to stop Windows complaining and failing to init it. 2006-12-20 11:27:06 +00:00
Goober5000 8fbb51d8a3 fix Mantis #1163 2006-12-08 19:18:54 +00:00
taylor 905f8c669b cleanup shockwave code a bit
make Shockwave_info dynamic
lot of fixage to allow 2D and 3D shockwaves to work better
fix for Mantis bug #1148
properly handle both "none" and "<none>" for 2D and 3D shockwave names
better handling, preloading wise, of 3D shockwaves and their textures
2006-12-07 18:30:20 +00:00
taylor b2407d7d2f fix for new GCC versions (Fedora Core 6) 2006-12-07 18:26:48 +00:00
taylor 00257285e6 stupid of me to use a case-sensitive comparison there, but then it wasn't really a problem until Goober's bitmap list support ;) 2006-12-07 18:26:03 +00:00
taylor 53e2d33dce various sound fixes/changes, mainly for OS X fixage 2006-12-07 18:24:43 +00:00
taylor b9cf75b3f9 fix secondary thruster length stuff
- change thruster_glow_len_factor to thruster02_glow_len_factor so it's a bit more obvious
 - fix tbl entry so that it makes sense what you are setting :)
2006-12-07 18:23:38 +00:00
taylor af082e866c unbreak the breakage that I broke when I tried to fix breakage that wasn't broken the second time but initialy broke instead
(yeah, this one confused me ;))  (Mantis bug #1165)
2006-12-07 18:21:25 +00:00
taylor 9baca9bffa try and keep angles within PI2 (Bobboau's advice, since he knows more than I do about this stuff :)) 2006-12-07 18:19:23 +00:00
taylor 302c9c9dd7 add "$Weapons Energy Text:" to hud_gauges.tbl so that the low energy text can be positioned as well (Mantis bug #1166) 2006-12-07 18:17:19 +00:00
taylor afe1af5980 minor cleanups and speedups
when using lighting falloff, be sure to drop emissive light when falloff gets low enough (otherwise we still se everything fine)
2006-12-07 18:16:11 +00:00
taylor 372ea8b793 get rid of "vram_full", it can never actually be full the way the code works, so having this is redundant
comment out APPLE_client_storage extension usage, I think this was messing some stuff up on OS X and causing memory errors
fix handling of cubemap data so that they can be read properly (can't believe it took so long to notice to an obvious and stupid bug)
be sure to un-bind textures during preload to avoid freaky little errors later
ifdef an error message from the framebuffer error code, Apple doesn't have this one define in their headers for some reason
2006-12-07 18:14:49 +00:00
taylor 18e46db629 restore default ambient light values to retail-like settings (I based the previous values on default D3D, which was rather dumb of me)
restore lighting falloff capability from retail and non-HTL modes (only used for asteroids as far as I know)
various cleanups and speedups for dealing with lights
2006-12-07 18:10:16 +00:00
taylor 279ffdde01 get rid of GL_activate and GL_deactivate, it was just Glide ported stuff that we never used and never needed
handle window/fullscreen/minimize changes better, fixes cursor handling mostly (Mantis bug #1146)
don't flush on gamma change, we don't really need to any more
2006-12-07 18:07:51 +00:00
taylor 978e77213f remove now-dead code 2006-12-07 18:04:42 +00:00
taylor a69e9c7017 clean up warning code for Windows
handle messagebox popups better (until I done with even cooler code for handling that)
cleanup window state code a bit, and deal with activation and cursor handling better
handle WM_ERASEBKGND msg ourselves, prevents some flickering issues and gets rid of the need to self-paint the window to clear it
slightly better Win9x/WinME compatibility for the main window
2006-12-07 18:04:03 +00:00
taylor 70d70e3d3f these defines are all the same value, so it's safer to just have one set 2006-12-07 17:59:37 +00:00
taylor 99fd20aff4 comment out some stuff that isn't used
fix cleanup code which didn't really let go of things all the way
2006-12-07 17:58:37 +00:00
taylor 6addcd836d cleanup for movie init stuff (this will be even cleaner once the rest of the Theora code finally gets in)
get rid of the clear screen hack for Windows, we can handle that better now
2006-12-07 17:57:25 +00:00
taylor 0b6542af5a port over some Theora player stuff:
- support for GL_ARB_texture_rectangle
 - fix GL tear-down on movie exit
 - fix sound tear-down order issue on OS X
 - some speed increases, and get rid of the extra gr_clear() per-frame now that it's handled properly
 - proper support for widescreen resolutions
2006-12-07 17:55:51 +00:00
taylor 09481793cf a little clean up for bits of code that isn't used 2006-12-07 17:53:08 +00:00
taylor b794192c70 make fire-on-normal return value a little more obvious
fix the "infinite genius" move I made by breaking turret movements ;)
2006-12-07 17:51:39 +00:00
karajorma 6912ecc04d Fix for Stream weapons not appearing for clients when fired by AI ships in multiplayer. Actual work mostly done by Juke not me 2006-12-01 18:53:55 +00:00
Goober5000 54831f9237 make an error message more descriptive, and allow the new method of parsing subsystem flags 2006-11-28 05:51:03 +00:00
Goober5000 18337f6796 the grammar nazi strikes again!
(and sneaks an extra #define in there while he's at it!)
2006-11-28 05:48:21 +00:00
Goober5000 59bb6494fc prevent false positive while error checking 2006-11-26 03:22:45 +00:00
Goober5000 47337a7b5b if a wing of ships is docked to something, that entire wing must have an arrival cue of false 2006-11-25 07:07:52 +00:00
Goober5000 f317c6906b holy crap, this had the potential to mark the locked-true sexp as known-false, which would seriously screw a lot of stuff up 2006-11-25 06:37:06 +00:00
Goober5000 04e09700b3 this may have been an oversight 2006-11-25 06:33:22 +00:00
Goober5000 5b2d2d9f9d FRED again updates backgrounds while the user is editing them 2006-11-24 22:40:16 +00:00
karajorma 29eb05b140 Fix ammo and weapon SEXP changes not being passed on to the clients 2006-11-21 23:07:27 +00:00
taylor 629b729c2c handle knossos warp effect flip in a slightly better, slighter safer way (Mantis bug #1048, plus a couple that weren't filed) 2006-11-16 01:11:28 +00:00
taylor 1b417cf37a do no culling on the warp effect model_render call properly (doesn't appear to break anything now that it actually set to not cull) 2006-11-16 01:10:47 +00:00
Goober5000 558231662d a much better fix for built-in arrival messages... it needs a new feature to fully work for custom wings though 2006-11-15 04:02:31 +00:00
taylor 579e99c0aa updated outwnd code for both Windows and non-Windows:
- make print filters dynamic
 - fix various little bugs and issues
 - cleanup some non-used variables (non-Windows)
 - put everything under NDEBUG like it was, or should be
 - change to using data/fs2_open.log for log file (Windows)
 - change to using data/debug_filter.cfg (Windows)
 - make the extra debug window optional, and disabled by default (Windows)
 - fix some possible NULL references
 - clean up the SAFEPOINT() crap
2006-11-15 00:54:33 +00:00
taylor 5a99bdc469 handle the video registry entry better
support for new Windows window creation code
various bits of minor cleanup
2006-11-15 00:49:41 +00:00
taylor 015f631591 properly support the updated window create code (all told: should take of of Mantis bugs #542, #624, #1140, and possibly #962 and #1124) 2006-11-15 00:47:57 +00:00
taylor c18fd582b1 new window creation code for Windows (gets rid of some stupid :V: voodoo for the software/glide stuff)
use detect_home() on Windows too (needed for now outwnd code)
some bits of minor cleanup
2006-11-15 00:44:44 +00:00
taylor 3bf7a3f05e fix some "stupid-windows-coder-mistakes" (otherwise known as "putting-more-than-you-should-into-header-files")
(gets rid of some/many compiler warnings, C++ language violations, and strange little bugs/errors)
2006-11-15 00:40:59 +00:00
taylor 3629f70ae8 various bits of little cleanup
add the debug cmdline printer to FRED, so that we can make use of that info in the FRED-debug case too
2006-11-15 00:38:02 +00:00
taylor 44852556c8 various bits of little cleanup
get rid of some more compiler warnings
2006-11-15 00:36:08 +00:00
taylor d673cf06a8 add some needed wing leader checks to prevent Assert()'s and out-of-bounds problems when the leader is dead/dying (Mantis bug #1134) 2006-11-15 00:33:16 +00:00
taylor 5561878d97 clean up skybox model selection and usage to work better with FRED
make sure to go ahead and set the skybox model when it's set/changed in FRED
go ahead and load/set the envmap  when it's set/changed in FRED
get rid of extra envmap image types, only DDS is actually supported (not sure what the hell I was thinking there)
2006-11-15 00:30:10 +00:00
taylor 9f92a1cfee fix the stupid safe_string thing ("LogFile" was already closed by the time it tried to write) 2006-11-15 00:26:03 +00:00
taylor e58edf3358 clean up AVI movie stuff a bit:
- use the default black brush for clearing the screen, it's a little less stupid this way
 - have the AVI player send messages back to the game rather than trying to poll for that extra crap
 - remove the only DivX6 fix, there is better addressed by newer window handling code
2006-11-15 00:24:47 +00:00
taylor b387a086b1 clean up some cmdline options which were/weren't FSO only
add back the "-32bit" option, for retail compatibility (doesn't do anything, it's just there to avoid the unknown option message)
add "-debug_window" to turn on the Windows-only extra debug output window (it's off by default now, only logging to file instead)
2006-11-15 00:21:40 +00:00
taylor 08e6dc4420 fix stupid bay depart object animation bug (Mantis bug #1133, part 2) 2006-11-15 00:19:33 +00:00
phreak 8394c3bc48 two fixes:
1) Fix for mantis #1099, part 2.

2) when changing the player's ship using debug_cycle_player_ship(), initialize the
 primary bank starting capacity so the support ship will rearm it.
2006-11-13 23:29:11 +00:00
phreak 93fc329030 Don't copy parentheses to parse buffers if outside of quotation marks. Otherwise
the parsing syntax will be copied to said buffer and some warnings/errors would occur.
2006-11-13 23:23:26 +00:00
karajorma ad17c71fbe Dragoniz3r's fix for builtin messages not being sent when custom named wings arrive. 2006-11-13 23:09:59 +00:00
karajorma 4578e0feb3 Doh! 2006-11-12 17:52:21 +00:00
taylor 7b2ee718ae fix some of the envmap issues
- use proper hand-ness for OGL
 - fix distortion
 - get rid of extra index buffer requirement
change starfield bitmaps to use an instance matrix rather than going through all the trouble of resetting the view matrix
basic cleanup and get rid of a couple of struct/variable naming issues (compiler sanity)
make double sure that we aren't using culling of z-buffering when rendering starfield bitmaps
2006-11-06 05:26:38 +00:00
taylor 2f4d442616 enable/disable alpha test based on blend mode (found this hidden in an old tree, may help with blending the newer alphablend mode) 2006-11-06 05:21:32 +00:00
taylor 93cee5443e if a submodel anim fails to start then move directly to ready position flag (set it up to do this, just forgot to do it ;)) (fix for Mantis bug #1133) 2006-11-06 05:19:59 +00:00
Goober5000 17c8fa9cbf --prevent the ai from "forgetting" that it's attacking a wing (fix for Mantis #1131)
--move AI_CHASE_WING goal check so that it will properly short-circuit when appropriate (discussed in the same bug)
2006-11-06 03:38:32 +00:00
Goober5000 f4894b83e8 minor bugfixes 2006-11-06 02:20:00 +00:00
Goober5000 8183c6f943 fix is-event-x-delay optional argument type 2006-11-05 18:42:25 +00:00
Goober5000 3a93a75803 improve error message 2006-11-05 18:41:40 +00:00
Goober5000 3718ca3c63 improve error message 2006-11-04 17:22:54 +00:00
karajorma 7b0e4f0582 Fix for Mantis 1017. - Hope we've seen the end of that damn persona bug 2006-11-03 21:26:51 +00:00
Kazan e0671b9427 Absolute speed, not forward speed, for hud speed reticle - fixes the guage for gliding 2006-11-03 18:47:43 +00:00
Kazan 26c85cad93 prevent autopilot initialization while player is gliding 2006-11-03 18:45:11 +00:00
taylor 18aec5d529 Ooopps! ;) 2006-11-01 18:46:22 +00:00
taylor d76c5a0786 make glow_point array for thrusters and glow_point_banks dynamic (a proper fix for old Mantis bug #43) 2006-11-01 18:35:58 +00:00
taylor 88637c628e make "TBL Info" button in ships editor handle modular tables (Mantis bug #1130)
fix bugs where ship names with leading '@' or trailing whitespace didn't get compared properly in "TBL Info"
2006-11-01 15:55:25 +00:00
taylor 34d35592a2 remove Assert() on Viewer_obj for supernova sun processing, it's not really needed and a NULL obj is easily dealt with by the code 2006-11-01 06:15:25 +00:00
karajorma 78d518b748 Adding the network-variable option to SEXP variables. This change will revert variables to the same behaviour they displayed in retail (i.e they don't update for clients) unless a variable is set to be a network-variable. 2006-10-28 21:17:04 +00:00
karajorma d40552aacd Adding the network-variable option to SEXP variables. This change will revert variables to the same behaviour they displayed in retail (i.e they don't update for clients) unless a variable is set to be a network-variable. 2006-10-28 20:54:35 +00:00
taylor 084642b875 forgot to reset default value for Interp_warp_alpha when it was changed earlier
be sure that we are using the proper zbuffer setting when rendering thruster glows
2006-10-28 17:58:42 +00:00
taylor 5efc5af65d forgot this part of the render box fix (obviously no one ever really tried to use this feature, since it has never worked) 2006-10-28 04:01:33 +00:00
taylor a7b8823d82 ok, so apparently that did actually do something ;) 2006-10-28 04:00:09 +00:00
taylor d3b467f231 updated/fixed modelanim code 2006-10-27 21:41:22 +00:00
taylor b54365ddfc more cleanup of warp_global crap
scale render/detail box limits with detail level setting
make sure that we reset culling and zbuffer after each model buffer that gets rendered
2006-10-27 21:37:11 +00:00
taylor f35f3e6319 updated/fixed modelanim code
add ships.tbl subsystem flag ("+fire-down-normals") which will force a turret to fire down it's barrel line (Mantis bug #591)
2006-10-27 21:33:06 +00:00
taylor 12c70eeb33 updated/fixed modelanim code 2006-10-27 21:29:26 +00:00
taylor 906e2a414e add the part of the fix which actually did something ;) 2006-10-27 16:31:09 +00:00
Goober5000 1fff30dfff fix error line reporting (Mantis #1120) 2006-10-27 16:01:49 +00:00
taylor a8dc91f6fb grrr ... fix dos EOL chars 2006-10-27 06:44:35 +00:00
taylor ee5fbe7fce rename set_warp_globals() to model_set_warp_globals()
remove two old/unused MR flags (MR_ALWAYS_REDRAW, used for caching that doesn't work; MR_SHOW_DAMAGE, didn't do anything)
add MR_FULL_DETAIL to render an object regardless of render/detail box setting
change "model_current_LOD" to a global "Interp_detail_level" and the static "Interp_detail_level" to "Interp_detail_level_locked", a bit more descriptive
minor bits of cleanup
change a couple of vm_vec_scale_add2() calls to just vm_vec_add2() calls in ship.cpp, since that was the final result anyway
2006-10-27 06:42:30 +00:00
taylor 3fcb9f0973 add "Render full detail" support to the lab as well 2006-10-27 06:35:29 +00:00
taylor 131f455e53 fix compiler problem due to change in parse_init() function
fix dos EOL chars
2006-10-27 06:34:40 +00:00
taylor f139dd75e8 add a "Render full detail" view option to render models at their full detail for the LOD (for render/detail boxes, Mantis bug #1121) 2006-10-27 06:33:38 +00:00
taylor c555bc2ed4 give the standalone chat box a horizontal scroll capability, not terribly accurate but it's good enough for the purpose (Mantis bug #1095) 2006-10-26 15:46:35 +00:00
Goober5000 5017112221 moved some stuff around in the sexp menus 2006-10-25 01:01:55 +00:00
Goober5000 c400771cd2 clarified this; it was confusing before 2006-10-24 23:56:56 +00:00
Goober5000 db82460af8 make sure to only add the sexp callback once 2006-10-24 23:28:56 +00:00
taylor a5d621d866 add envmap selection to background editor
change skybox selection to be a text entry or browse instead of only text entry
allow envmap selected in background editor to be used by FRED
make texture replacement work in FRED for ships (Mantis bug #1068)
2006-10-24 13:44:54 +00:00
taylor 79d6f127a9 fix the cmdbrief editor deleting the wrong stage (Mantis bug #1115) 2006-10-24 13:41:54 +00:00
taylor 602329ae92 fix loading callback issue in standalone 2006-10-24 13:40:31 +00:00
taylor df0441ab8b don't require hardware GL if running FRED (this is mainly for my benefit since I always forget to add that locally) 2006-10-24 13:39:26 +00:00
taylor 56a01e79e6 fix the envmap-getting-rotated-by-turrets bug (though it did make me chuckle a bit when I first saw it ;))
try to reuse old view setup info, if we are using the same settings again (for speed up purposes, will be a bigger deal when bumpmapping gets here)
2006-10-24 13:38:23 +00:00
taylor baef95fac3 fix Personas memory leak (not really an issue, I just got tired of seeing it in the Valgrind reports) 2006-10-24 13:36:05 +00:00
taylor 80b0663e1b remove a basically useless debug message
fix parse_init() so that it doesn't absolutely have to init sexps (doesn't need them when getting basic info, and causes memory fragmentation otherwise)
fix multiplayer mission info getting to just get basic info (fixes a couple of minor multi issues that were already fixed in single)
2006-10-24 13:34:33 +00:00
taylor 9a9f66153e fix a memory leak that Valgrind was complaining about (happens mainly when you have a mission without a briefing) 2006-10-24 13:31:32 +00:00
taylor 46404f62f9 a LOT of cleanup:
* remove a bunch of old/dead code
 * some reformatting to help with readability
 * rearrange/rename some code so that it is a little clearer
 * move thruster glow code to it's own function (model_render_thrusters())
make HTL model buffers dynamic
fix detail boxes so that they actually work for the first time
2006-10-24 13:29:16 +00:00
taylor e932bffa88 various bits of cleanup (slight reformatting to help readability, remove old/dead code bits, etc.)
deal with a index_buffer memory leak that Valgrind has always complained about
make HTL model buffers dynamic (get rid of MAX_BUFFERS_PER_SUBMODEL)
get rid of MAX_BUFFERS
make D3D vertex buffers dynamic, like OGL has already done
2006-10-24 13:24:12 +00:00
taylor 68b3da5f24 fix for Mantis bug #1104 (can't use a ":" in chat) 2006-10-24 13:18:35 +00:00
taylor f341699255 various bits of cleanup (warning messages, things that Valgrind complained about, etc.)
fix an out-of-bounds issue on Sexp_nodes[] which was leading to stack corruption
2006-10-24 13:17:24 +00:00
karajorma 626e99fdd6 Fix Int3() with Set primary and Secondary ammo\weapons 2006-10-21 21:57:08 +00:00
wmcoolmon f9fd96a611 Fixx0r FRED 2006-10-20 20:37:42 +00:00
wmcoolmon 5ddcc40624 Fix extra jumpnode settings not saving. They still don't show up in FRED, unfortunately. 2006-10-15 22:03:16 +00:00
Goober5000 cd5419dff8 better safety check 2006-10-15 00:41:01 +00:00
wmcoolmon 2e6493ecbb Fix Freecamera forcing HUD draw bug. 2006-10-11 03:10:53 +00:00
Goober5000 4b35e5aa21 betterized some things with mission arrivals and departures 2006-10-09 20:50:13 +00:00
Goober5000 033166534f make sexp nodes dynamic 2006-10-09 05:25:18 +00:00
Goober5000 6e9d133cfe preliminary commit of sexp node bump... fred only, just changing some names for clarity 2006-10-09 04:44:58 +00:00
Goober5000 998c04d53f bah! 2006-10-08 05:24:03 +00:00
Goober5000 ff14e80d2b nitpick 2006-10-08 05:21:44 +00:00
Goober5000 412fbee155 fix forum links 2006-10-08 02:05:38 +00:00
Goober5000 f91892c415 bypass annoying warnings for nonexistent bitmaps 2006-10-07 02:43:46 +00:00
karajorma 4930324547 Fix for Mantis 1092 - (Support ships damage hull) 2006-10-06 15:12:55 +00:00
Goober5000 ca72d1b77e <nelson> Ha, ha! </nelson> 2006-10-06 13:41:41 +00:00
taylor 935b02bbfd handle another null vec warning which can happen during a multiplayer respawn or certain death sequences (Mantis bug #1090) 2006-10-06 10:04:03 +00:00
taylor 133b6ce817 clean up some old software rendering stuff that we don't use any longer
remove grzbuffer.*, since all it did was give us 3 variables, which were moved to 2d.*
2006-10-06 09:56:42 +00:00
taylor 93e4868abc For redalert stored data be sure that dead ships don't come back, and departed ships come back just as they left (Mantis bug #810) 2006-10-06 09:47:11 +00:00
taylor a96dfcc458 make sure that the armor stuff gets initted (should fix Mantis bug #1080) 2006-10-06 09:44:32 +00:00
wmcoolmon 960addaaa8 Fix OGG bug where sound files were always allocated 16 seconds of wavedata 2006-10-06 04:58:25 +00:00
taylor 2a19de72ae meant to do this before but forgot about it (just replaced "(4.0/9.0) * PI" with it's result) 2006-10-01 19:31:19 +00:00
taylor 8d55c6c862 if shockwaves weren't loaded then don't try to unload them (fixes standalone crash) 2006-10-01 19:29:35 +00:00
taylor 68f60a7b21 make sure Multi_create_bitmap is initialized properly since it might not be otherwise in standalone 2006-10-01 19:28:28 +00:00
taylor ac04873057 fix for the "branch" bug (still a minor usability issue however, see Mantis bug for details)
add a popup to the loopbrief screen when you press ESC, so that we can either accept or decline the loop offer
2006-10-01 19:27:28 +00:00
taylor 7eb4f0fa02 bit of cleanup (technically the vertex buffer stuff is part of a much larger change slated for post-3.6.9, but this should be a little faster) 2006-10-01 19:24:46 +00:00
taylor 61c9916549 re-fix this crap that I managed to break last time (was Mantis bug 1066 I think) 2006-10-01 19:22:15 +00:00
Goober5000 ddc7105a60 check that targetview model files exist as well 2006-10-01 18:53:59 +00:00
karajorma 71d93ce305 Fixing some ugliness when the popup appears 2006-10-01 08:34:43 +00:00
Goober5000 1b86d4cb62 more accurate message number 2006-10-01 06:18:36 +00:00
Goober5000 6291a459c0 fix crlf 2006-10-01 00:54:29 +00:00
Goober5000 3f2a102c57 more flexible checking of generic messages 2006-09-30 21:58:09 +00:00
Goober5000 2e6a771097 fix for Mantis #1070 2006-09-28 23:47:25 +00:00
taylor ac0dc14418 more standalone server fixes:
- add some basic bmpman functionality to grstub, since it needs to do something at least
 - add missing gr_* function ptrs to grstrub
 - (re-)enable radar and hud setup functions that used to crash (problems are fixed now)
 - deal with default pilot file properly (also caused a bmpman headache)
 - don't bother with Multi_common_icons[] in standalone mode (they don't load, so don't let them unload either)
2006-09-24 22:55:17 +00:00
taylor 364a550e43 clean up the function ptrs so that it's a bit easier to read 2006-09-24 22:54:24 +00:00
taylor f3c98b5780 move FS2NetD connection checks to *after* it tries to connect ;) (Mantis bug #1065) 2006-09-24 13:32:47 +00:00
taylor 2f3e898149 fix for deletion of multiplayer pilots (Mantis bug #1066) 2006-09-24 13:32:11 +00:00
taylor b2df61fb89 minor clean and code optimizations
clean up view/proj matrix fubar that made us need far more matrix levels that actually needed (partial fix for Mantis #563)
add debug safety check to make sure that we don't use more than 2 proj matrices (all that GL is required to support)
set up a texture matrix for the env map to that it doesn't move/look funky
2006-09-24 13:26:01 +00:00
taylor 4d11165168 fix SAFE_STRCAT() so that it can work in an if() statement that doesn't have braces 2006-09-24 13:22:38 +00:00
taylor 2fddb0e9fb small optimizations and code cleanup
use the real frametime for FPS counter stuff, no reason to deal with time compression there (Mantis bug #1058)
2006-09-24 13:21:33 +00:00
Goober5000 28ae8be436 more descriptive warning message for docking paths 2006-09-20 05:19:02 +00:00
taylor dc4ce7a415 add some extra FS2NetD safety checks around to prevent the code from doing stupid crash-happy things 2006-09-20 05:05:28 +00:00
taylor ef898c40c0 have the joystick thread prevent the display and network from going to sleep or activating the screensaver if you use only a joystick to play 2006-09-20 05:05:07 +00:00
taylor 32f199092a the resolution checks needed to be based on the unscaled res since you would have to include correct sizes for every single resolution otherwise (fixes a bug noticed in WCS) 2006-09-20 04:59:29 +00:00
taylor c29bd2128d some gamma ramp fixage, still hasn't gotten a steller review from DaBrain but it does work much better than before, so I'll tweak it later if need be 2006-09-20 04:58:13 +00:00
taylor 26ff7db6d1 neither of these two structs appear to be used anywhere, so lets just comment them out 2006-09-20 04:56:36 +00:00
taylor 6863c44747 some basic error message/handling fixage 2006-09-20 04:55:48 +00:00
taylor 2f30cd99d4 properly support 4gig of RAM, and don't totally freak out if user has more than that 2006-09-20 04:55:12 +00:00
taylor 8d158808a9 properly fix the new_recommendation_text FRED problem, plus some real cleanup for that code in general, and some memory leak fixes 2006-09-20 04:53:53 +00:00
taylor ae6796f8fd add default recommendation text for debriefing, it's either this or making sure that it's nul 2006-09-14 23:29:47 +00:00
taylor 3add53f2ed prevent FRED from hitting an Assert() that it shouldn't have had to hit in the first place 2006-09-14 18:48:17 +00:00
taylor 53ec81e9fe fix for Mantis bug #1006 2006-09-13 17:30:25 +00:00
taylor ed38b12b7b bah! stupid. 2006-09-13 03:50:07 +00:00
taylor 7e697a5780 might as well add this, just to be on the safe side (I haven't hit it anywhere, but it could be made into a warning if it starts getting hit) 2006-09-13 03:12:35 +00:00
taylor c1a80972a1 be sure to setup/reset ship team data too when moving to a red-alert mission (Mantis bug 1042)
(this will hopefully fix Mantis bug 860 as well, which is a separate but related issue)
2006-09-13 03:11:09 +00:00
taylor b3c6dc7618 be sure that we still try to play a movie if we get to the cmd/brief screen right from another mission without debrief (Mantis bug 1043) 2006-09-13 03:08:09 +00:00
taylor f46ac6cbf3 restore MAX_AIFTT_TURRETS to retail level, and add comment as to what it means for the next person that tries to change it 2006-09-13 03:06:46 +00:00
taylor a2dc76abf8 revert to retail behavior for turret_should_pick_new_target()
fix out-of-bounds issue
2006-09-11 09:43:35 +00:00
taylor 52d8b00c04 fixes for stuff_string() bounds checking 2006-09-11 01:17:07 +00:00
taylor cd33d9407a fixes for stuff_string() bounds checking
stict compiler build fixes
2006-09-11 01:12:50 +00:00
taylor ae21e32983 compiler warning fixes 2006-09-11 01:10:00 +00:00
taylor f54f5bd1de fix bug where set-object-speed-* could set speed subjectively if left to default 2006-09-11 01:09:33 +00:00
taylor 506c0da81e fixes for stuff_string() bounds checking
compiler warning and stict compiling fixes
2006-09-11 01:06:20 +00:00
taylor e548b8af47 fixes for stuff_string() bounds checking
compiler warning fixes
2006-09-11 01:04:20 +00:00
taylor 3c8ce6b305 fixes for stuff_string() bounds checking
make sure that default entries always get used in techroom if they don't otherwise have the techroom visibility flag
fix crash bug where the first entry in the various lists wasn't ever initialized if there is no ship/weapon/intel info to show
2006-09-11 01:03:23 +00:00
taylor f0a3f143c6 various small compiler warning and strict compiling fixes 2006-09-11 01:00:28 +00:00
taylor 38de07195b be sure to reset color and clear color before MVE playback (fix for Mantis bug #1041) 2006-09-09 21:28:19 +00:00
taylor 95bb40ca75 fix for vanishing FRED2 cursor (Mantis bug #997), plus a little cleanup 2006-09-09 04:07:57 +00:00
taylor 2399d31c55 fix things that strict compiling balked at (from compiling with -ansi and -pedantic) 2006-09-08 06:14:44 +00:00
taylor 70215ee67a fix for Mantis bug #1038 (glow point bank storage being wrong after changing ships in shipselect)
fix things that strict compiling balked at (from compiling with -ansi and -pedantic)
2006-09-08 06:13:29 +00:00
taylor e2a01035ea small optimization 2006-09-08 06:11:06 +00:00
taylor 5b705ad00c fix for Mantis bug #617 (with a very big assist from Shade who did most of the initial work on this) 2006-09-08 06:10:34 +00:00
taylor 0a837ae868 lower client/server version back to retail level, there was no reason to bump it in the first place 2006-09-08 06:09:05 +00:00
taylor d3828acd3e add support for a server name in fs2open_pxo.cfg, rather than just an IP address for the server 2006-09-08 06:07:59 +00:00
taylor 710be36ddf fix for Mantis bug #687 (at least until better swarming code can be written, post-3.6.9)
a quick speed/sanity check for turrets to be sure that they actually have a weapon to fire before processing them
2006-09-08 06:06:34 +00:00
Goober5000 34151d5f8d fix macros 2006-09-04 18:06:37 +00:00
Goober5000 67a394375d fix waypoint time to goal 2006-09-02 20:24:15 +00:00
Goober5000 dbf57b6464 remove unnecessary warning 2006-09-02 20:07:39 +00:00
taylor 86efe162a9 crap, there was supposed to be a multi check there 2006-08-29 21:32:25 +00:00
taylor 3777e3aca8 allow W32 init fallback if desktop depth is less than requested game depth (it may look like crap, but at least it will work) 2006-08-29 07:27:43 +00:00
taylor b33729d50f stupid, stupid, stupid...
- fix AVI/MPG movie playback
 - fix missing campaign craziness
2006-08-28 17:14:52 +00:00
taylor 1eaf51858f bah! got the post-it sitting in front of me, but still forgot to remove this 2006-08-28 06:19:56 +00:00
taylor 8de3f88319 make Species_info[] and Asteroid_info[] dynamic 2006-08-27 18:12:42 +00:00
taylor d601f0ae2f quite a few fixes to handle missing campaigns better
change load order for campaign loading to a full check: Player-specified -> BUILTIN_CAMPAIGN -> First Avaiable.
clean up the getting of a list of available campaigns
fix simroom issue where single missions, with the [V] icon, would display wrong (this was a retail bug, but it doesn't show normally)
fix bug where, if a campaign failed to load, it would still appear available for savefile useage
fix bug where, when resetting the campaign info, the num_missions var wasn't 0'd and it could cause a sexp Assert() during reset
2006-08-27 18:11:37 +00:00
taylor a8fcfcb58c fix a compiler warning/error on Squadmsg_history[] init 2006-08-27 18:04:24 +00:00
taylor 2b9333be28 forgot an extension check (was this the background corruption bug???) 2006-08-27 18:03:29 +00:00
taylor d2b67e868d switch to using cf_find_file_location_ext() when looking for movies 2006-08-27 18:02:26 +00:00
taylor b7aa349e26 various small cleanup and speedup changes
add a cf_find_file_location_ext() function, which you can pass a filename and a list of extensions and it will search for all of them at once
2006-08-27 18:01:45 +00:00
karajorma 1573a9c10e Fix TvT problem with scores appearing incorrectly.
Fix a CVS issue
2006-08-25 21:15:31 +00:00
karajorma f782577d47 Fix lack of Wingman Status indicator for Zeta wing in TvT games. 2006-08-25 21:09:59 +00:00
taylor 5bf20522d9 crap. 2006-08-23 16:15:46 +00:00
taylor 11abf5fe7f make muzzle flash info dynamic
add support for modular mflash tables (*-mfl.tbm)
2006-08-22 05:50:12 +00:00
taylor b4f4cf01be add font.h since the gr_set_font() function is only available from there now 2006-08-22 05:48:46 +00:00
taylor 0e261071e1 don't try to draw beam sections if there is no valid texture for it, or if there is no width 2006-08-22 05:47:51 +00:00
taylor 03ca395f74 make sure that we properly page in textures for 3d shockwave models 2006-08-22 05:47:00 +00:00
taylor 6bce1d5b20 compiler warning fixes 2006-08-22 05:45:39 +00:00
taylor 53ad9891a5 some fixes for the standalone server
- get init order correct for lcl and std init
 - turn off some cmdlines that are just graphics related when Is_standalone
 - skip radar_mission_init() (may need to rethink that though, it's bound to cause problems)
2006-08-22 05:45:15 +00:00
taylor b3512ee533 minor spelling/grammer fixes 2006-08-22 05:42:56 +00:00
taylor 2fdec305ab clean up the grstub mess (for work on standalone server, and just for sanity sake)
move color and shader functions to 2d.cpp since they are exactly the same everywhere
don't bother with the function pointer for gr_set_font(), it's the same everywhere anyway
2006-08-22 05:41:36 +00:00
Goober5000 cadfb87ab5 disable duplicate model texture replace 2006-08-19 21:46:05 +00:00
Goober5000 2109c1da8b if a modular table ship pof cannot be found, use the original one 2006-08-19 21:45:20 +00:00
taylor 302435b9f4 maybe optimize the (PI/2), (PI*2) and (RAND_MAX/2) stuff a little bit 2006-08-19 04:38:47 +00:00
taylor d2cc48b840 slight math optimizations
reduce COUNT_ESTIMATE since I added more game_busy() calls for models and it threw off the loading bar
2006-08-19 04:37:00 +00:00
taylor ea5f4031cc slight optimizations
fix AI shields to not get overly charged or overly drained when AI does equalize (it's closer to player now, but still within retail intent of function, I think)
2006-08-19 04:35:04 +00:00
taylor 04d516eab5 slight optimizations
compiler warning fixes
2006-08-19 04:33:00 +00:00
taylor 121f361e00 clean out some crap that we don't really need 2006-08-19 04:32:11 +00:00
taylor 642cff6cc3 cleanup
bugfixes
error-handling
(lots of crap got fixed to work better, and lets leave it at that, the commit log would be too long otherwise :))
2006-08-19 04:31:24 +00:00
taylor 0442052981 very slight speed optimization to avoid math that we really don't need to do anyway 2006-08-19 04:29:08 +00:00
taylor 8f0f69f677 add custom IP option to maybe help get around NAT issues (I haven't heard whether this actually works or not yet though, but it's been out for testing all week) 2006-08-19 04:28:22 +00:00
taylor bdfc210e99 add render option for no glowmaps
remove render option for fog (why was this even there??)
add tech model view for missiles with special tech models (will hopefully help spur some work towards fixing the currently broken models)
handle Z-buf issue that made the lab interface disappear when the transparent render option was ticked
2006-08-19 04:26:32 +00:00
taylor 276f3e2e5d OMG! MEMLEAK!!!! (maybe no one will notice that it was my fault ;)) 2006-08-19 04:23:56 +00:00
taylor debc5e556a an int wrap-around issue could (and was) make debris not have electrical arcs (or lighting or sounds) since it would always fail this check 2006-08-19 04:22:33 +00:00
taylor 5d18482d1d ever so slight speed up for bm_set_components_* (this crap is slow, and it's called a LOT) 2006-08-19 04:20:22 +00:00
taylor bc99b0ff2c "byte" was the same as "ubyte", but since "byte" has to be an extra #define on everything but Windows, lets just get rid of it 2006-08-19 04:16:49 +00:00
taylor 9abfea9299 add decoder for 8-bit MVEs
a basic fix for finding AVIs over MVEs, for mod dir stuff (this needs some CFILE support added to be a true fix, it's on the TODO list)
little bits of cleanup for old/unused code
make sure MVE filenames are correct in mvelib
2006-08-19 04:14:57 +00:00
karajorma 2cae7d55ca More typos revealed while trying to merge changes to the HEAD branch! 2006-08-18 17:48:39 +00:00
karajorma 08f7a66ae3 More cut & paste errors fixed and removal of the hardcoded warp out animation. Will now actually use the one specified in the table. 2006-08-18 17:21:10 +00:00
Goober5000 f41254ed81 better handling of ballistic rearm sounds
--Goober5000
2006-08-18 04:34:59 +00:00
karajorma d96b5729f0 Doh! Minor fix 2006-08-16 16:47:55 +00:00
karajorma 9d63024586 Another typo 2006-08-15 20:00:51 +00:00
karajorma 688a57f187 Fixed a silly typo which breaks team-score 2006-08-15 19:24:09 +00:00
Goober5000 cf847298b7 nitpick 2006-08-14 22:02:43 +00:00
Goober5000 2288100bb6 extremely minor optimizations 2006-08-14 21:59:14 +00:00
karajorma 3f1022da51 Fix a Multiplayer bug where anything that included the name of a player wing was automatically considered to be a part of that wing. 2006-08-14 19:58:42 +00:00
taylor 3755f79a2f some minor cleanup to anisotropy setting
only use negative lod bias when not using anisotropy to help avoid shimmering
stick lod bias setting in with anisotropy function
2006-08-12 13:14:45 +00:00
taylor 28e753cd53 default to 44100 sound sample rate (OpenAL tends to works much better with this) 2006-08-12 01:17:08 +00:00
karajorma 41c4c94302 Fix Mantis 1009 - A problem with using the Change-ship-model SEXP 2006-08-09 17:39:46 +00:00
taylor 3808d16349 fix for setting of texture lod bias 2006-08-09 14:42:24 +00:00
taylor 08d7b12ff5 very small math optimization 2006-08-09 14:41:44 +00:00
Goober5000 e97af1d7f9 fix spin control association
--Goober5000
2006-08-07 23:25:37 +00:00
karajorma 111116bf19 Fix a small problem with ballistic primary ammo. Forgot to upload this one earlier 2006-08-07 15:11:33 +00:00
Goober5000 c3750ca4f8 deprecate change-ship-model 2006-08-06 19:27:13 +00:00
Goober5000 1986983bbb make these consistent (pitch-bank-heading is the established order)
--Goober5000
2006-08-06 19:06:42 +00:00
Goober5000 21ce8a51cd add the multiple background feature
--Goober5000
2006-08-06 18:47:29 +00:00
karajorma fa020d32ca Hopefully plug the possible memory leaks from not calling common_select_close() in red alerts and when exiting mission briefings 2006-08-05 10:40:22 +00:00
karajorma db5d8f8c79 Remove common_select_close(). This should be handled in freespace.cpp 2006-08-05 10:37:51 +00:00
karajorma 7c6c047af2 Fix a multiplayer crash if the server committed before the 2nd team captain unlocked. 2006-08-04 19:13:38 +00:00
karajorma bfe1fe160a Stop multiplayer campaigns crashing if the campaign lacks a description 2006-08-03 17:55:01 +00:00
karajorma 62d1baedaa Added new packed to deal with a bug in multiplayer where using end-mission would only end the mission for the server and then force the clients to jump out. 2006-08-03 16:24:23 +00:00
karajorma 63c2b241d7 Let's try this again. - Added new packed to deal with a bug in multiplayer where using end-mission would only end the mission for the server and then force the clients to jump out. 2006-08-03 16:22:24 +00:00
karajorma 157ad27238 *** empty log message *** 2006-08-03 16:03:54 +00:00
Goober5000 3b2152daad add a second method for specifying ship copies, plus allow the parser to recognize ship class copy names that aren't consistent with the table
--Goober5000
2006-08-03 01:33:56 +00:00
Goober5000 0f7e26a03f fix display of ship copy class names in ship loadout screen
--Goober5000
2006-08-02 22:47:40 +00:00
Goober5000 2e5b7e0fbd fix display of ship copy class names in ship loadout screen
--Goober5000
2006-08-02 22:31:15 +00:00
karajorma 69c5de6c55 Fix for Mantis 1020.
ship-subsys-guardian-threshold will now include subsystems without you having to type them in.
2006-07-31 21:09:10 +00:00
Kazan 7db33a3767 resolve 1018 and an interface problem in fred2's ship editor 2006-07-30 20:01:56 +00:00
Goober5000 4533eba002 bah, revert 2006-07-30 02:20:17 +00:00
Goober5000 b6eb8e3934 stage 1 in multiple-background feature
--Goober5000
2006-07-30 00:23:30 +00:00
taylor 574fae25bd check first stage warp arrival against all docked objects so we can not render them all if even one is 1st stage 2006-07-28 02:46:10 +00:00
taylor 2f8109a58d when in external (non-control) view be sure to not include time compression speed in camera movement 2006-07-28 02:45:34 +00:00
taylor 321c9c6866 don't render extra lighting passes when fog is enabled, prevents fog fragment from getting added for each pass
wobble wobble no more!!
2006-07-28 02:45:10 +00:00
taylor 37a16df0b4 switch from Assert() to basic error fixage for end-of-string white space check 2006-07-28 02:44:40 +00:00
taylor 5aec701448 include CF_TYPE_PLAYERS in special pilot path consideration, prevents moddirs from always getting and empty data/players/ 2006-07-28 02:44:17 +00:00
taylor 7283c36acb don't lowercase the dir for chdir on non-Win32 since it could be, and probably is, case sensitive 2006-07-28 02:43:48 +00:00
Kazan bddd8fa81c Lock player primaries during autopilot 2006-07-27 19:17:59 +00:00
karajorma 92360994b3 Fixed an error in ballistic weapons where only the server got the correct number of bullets in multiplayer.
Fixed a rounding up error in get_max_ammo_count_for_primary_bank()
2006-07-27 10:37:43 +00:00
Kazan 8c9f862ff1 resolve SVN 1011 2006-07-26 15:04:04 +00:00
Kazan 6d8f59bf85 small optimization 2006-07-26 15:01:07 +00:00
Kazan 762b2df6fe Resolve Mantis #1010 2006-07-26 14:53:38 +00:00
taylor 1c6b32917c support for cmdline option stacking (a per option setting) so that things like "-mod derelict -mod mediavp" will end up as "-mod derelict,mediavp" to the game
fix bug where white space chars didn't get dropped from the end of a option string like they were supposed to
allow for something like "-ambient_factor 100 -ambient_factor 70" to use the proper value, the last one specified, rather than just accept the first instance
2006-07-25 16:26:24 +00:00
taylor 3bd7455567 minor cleanup/optimization to beam warmup glow rendering function
various lighting code cleanups
 - try to always make sure beam origin lights occur outside of model
 - make Static_lights[] dynamic
 - be sure to reset to first 8 lights when moving on to render spec related texture passes
 - add ambient color to point lights (helps warp effects)
 - sort lights to try and get more important and/or visible lights to always happen in initial render pass
2006-07-24 07:38:00 +00:00
Goober5000 2d4376fca9 fix a subtle and nasty bug
--Goober5000
2006-07-24 02:09:29 +00:00
Goober5000 03853bdbe3 fix for Mantis #1003
--Goober5000
2006-07-23 16:58:28 +00:00
taylor dbbba5a36a minor changes to game_busy() debug text
- don't alloc it for bmpman, and make sure to only call on textures that we are loading
 - add text for model loading, gets rid of the long-wait issue when it appears to not be doing anything early on
2006-07-21 16:08:32 +00:00
taylor f5d0ec735a little cleanup 2006-07-21 16:08:03 +00:00
Goober5000 9a3d8891bd add another method for calculating dimensions of docked objects, plus improve an existing one
--Goober5000
2006-07-21 05:41:10 +00:00
Goober5000 cc9432c556 fix help text
--Goober5000
2006-07-21 05:38:41 +00:00
karajorma c9ceea2a3d Fix for Mantis 996 2006-07-20 21:15:11 +00:00
karajorma 85d6ab8f28 Fix for Mantis 888. 2006-07-20 20:41:31 +00:00
Goober5000 88d1e28879 tweak control text
--Goober5000
2006-07-20 01:51:20 +00:00
Goober5000 a47246a577 add WCS screaming stuff to RC branch
--Goober5000
2006-07-20 00:41:26 +00:00
taylor 6256ddd4ba make glow point banks dynamic 2006-07-17 01:12:52 +00:00
taylor 59ee5a83b1 fix some missile autocentering issues
- use MR_AUTOCENTER and MR_IS_MISSILE flags to generate an autocenter for a missile if one doesn't already exist
 - don't try to autocenter loadout icons when rendered 3d
2006-07-17 01:12:19 +00:00
taylor 6278c4dd24 maybe this will finally shut-up some of the people who have complained about certain mipmap issues 2006-07-17 01:11:32 +00:00
taylor 51b8204608 only do i2fl() on the font bitmap once per string rather than doing it per-letter (basically unnoticable performance boost)
before doing alpha channel check, make sure the bitmap is valid, since it doesn't actually catch that until later in the texture code
2006-07-17 01:10:45 +00:00
Goober5000 8697299d25 move WMC's preload stuff into main preloader routine 2006-07-17 00:50:00 +00:00
Goober5000 4c42104c79 stage 2 of animation fix (add base frame time to each ship)
--Goober5000
2006-07-17 00:10:05 +00:00
taylor 71a113385a missed the extern apparently 2006-07-15 18:16:00 +00:00
taylor d00e5b4a48 we probably need to be processing the number of weapons here rather than the number of ships ;) (Mantis bug #988) 2006-07-15 15:51:19 +00:00
taylor 2ed50f6409 change clamp mode for font/interface graphics, don't want the border factored in for scaling/filtering 2006-07-15 06:11:27 +00:00
taylor e3c0980a8e add missing stub for game_get_overall_frametime() 2006-07-14 03:50:31 +00:00
taylor eed0bec6f7 fix for animated texture map issues (*part one*), this should be faster than before too, and fix inf-loop/div-by-0 issues 2006-07-13 22:11:37 +00:00
taylor e85a0afce3 change compiler optimizations a little for release builds, use "Maximize Speed" setting, since it's basically using debug optimizations otherwise 2006-07-13 22:09:21 +00:00
taylor f75d45cd60 fix for network afterburner support, this one should be compatible with all previous versions 2006-07-13 22:08:10 +00:00
taylor 7a0668b964 handle non-MVE movies a bit better in OpenGL (don't get freaky with the window, don't lose input, etc.)
some cleanup to OpenGL window handling, to fix min/max/full issues, and try to make shutdown a little nicer
2006-07-13 22:06:38 +00:00
Goober5000 e1aea79394 * better formatting for substitute music options
* better handling of all special FSO comment tags
--Goober5000
2006-07-13 06:11:52 +00:00
Goober5000 eb92ba75f1 prevent labels from overlapping widgets 2006-07-13 06:10:22 +00:00
taylor 803bdbbd97 fix the endless-loop fix ;) (this is what broke shield recharging btw) 2006-07-12 04:59:03 +00:00
karajorma f5cd36dbfa Fix afterburner trails in multiplayer (Mantis 895) 2006-07-11 23:17:03 +00:00
taylor 0d32c3eb56 fix undo system
restore the two autosave points that got removed for some reason (yes, these are needed for things to work properly)
2006-07-10 21:48:33 +00:00
Goober5000 7b43ad28d9 bah, make sure we're in the correct mode 2006-07-09 06:12:37 +00:00
Goober5000 85ff6cc9f8 tweak max speed function
--Goober5000
2006-07-09 06:07:20 +00:00
Goober5000 6297d0b9d2 ugh... FS2_VOICER isn't actually defined at this point, for some reason... but it looks like phrases.cfg will always be generated, so it should be okay to take these #ifdefs out
--Goober5000
2006-07-09 03:18:15 +00:00
Goober5000 2860b6c303 this shouldn't actually be in CVS; it's produced during the build process
--Goober5000
2006-07-09 02:36:05 +00:00
Goober5000 be18810cdb iff defs should allow specification of both flag fields
--Goober5000
2006-07-08 19:36:04 +00:00
taylor bd959e9193 remove -allslev
make CTRL-SHIFT-S hotkey work in mission simulator (it's a toggle, so you can turn it on or off while on the screen)
fix a bug where blank lines would show up in the campaign list for branch/alternate type missions that are otherwise marked as not completed
2006-07-08 18:11:33 +00:00
taylor 9d6c618203 require OpenAL 1.1 under Windows, I think it's causing problems for us to mix users with 1.0 and builds for 1.1
(having 1.0 is fatal to sound, but the game should still work, a corresponding Launcher change goes with this too)
clean up some of the error messages to not say "DirectSound" is doing this or that, just say "Audio" instead
2006-07-08 18:10:59 +00:00
taylor 4e1269283a debug-build-only issue, make sure that thrusters are properly enabled if needed for POF based weapons when using cheat keys 2006-07-08 11:30:40 +00:00
taylor 777915a444 hopefully this should get missile viewing working decently again 2006-07-08 11:30:13 +00:00
Goober5000 f329be0003 fix for Mantis #967
--Goober5000
2006-07-08 04:53:29 +00:00
taylor f45c9b51c6 make sure to reset the optional maps after each buffer render (little scary that this wasn't noticed a long time ago) 2006-07-07 16:26:44 +00:00
karajorma d82ddf511c Fix for Mantix #959. Campaign editor shouldn't crash on finding an empty mission list any more. 2006-07-06 23:48:43 +00:00
taylor b637dfe340 some better handling of OpenAL errors during init 2006-07-06 21:56:18 +00:00
taylor db2c7b2722 add some minor error catches for invalid values 2006-07-06 21:55:38 +00:00
taylor fcfac587c3 more big-endian fixage (seriously hope this is the last of it) 2006-07-06 21:54:59 +00:00
taylor 820543adde rest of the map/glow changes
- put glowmap activity back on a per-ship basis (via a SF2_* flag) rather than per-model
 - same for glowpoints, back on a per-ship basis
 - put specmaps and bumpmap back on a LOD0 and LOD1 affect (got changed to LOD0 only recently)
 - fix glowmaps for shockwaves again
 - add support for animated specmaps (mainly for TBP and Starfox mods)
some minor code cleanup and compiler warning fixes
2006-07-06 21:53:59 +00:00
taylor 12eff0ca31 add a render option to make the model not spin around, easier to work with in some cases, and better screenshots 2006-07-06 21:49:12 +00:00
taylor 98c53063bf newline fixage 2006-07-06 21:47:38 +00:00
Goober5000 10bf7f6742 fix ship type bug that Taylor mentioned
--Goober5000
2006-07-06 21:24:36 +00:00
Goober5000 6dcfedfa5e add CVS headers
--Goober5000
2006-07-06 21:23:28 +00:00
Goober5000 22ee5941ae fix dumb endless loop bug
--Goober5000
2006-07-06 18:19:59 +00:00
Goober5000 c90998d45b fix subtle change from retail... dunno if it's a bug, but best to stay on the safe side
--Goober5000
2006-07-06 06:04:51 +00:00
Goober5000 bcf98e9c53 fix for Mantis #856
--Goober5000
2006-07-06 05:35:13 +00:00
Goober5000 2ff42b3f8a commented annoying redundant warnings
--Goober5000
2006-07-06 05:29:57 +00:00
Goober5000 e8ef7b2dd3 GAH - repair a borked commit (plus a couple of typos)
--Goober5000
2006-07-06 04:20:34 +00:00
Goober5000 d6ad99d0a1 1) complete (almost) changeover to reorganized texture mapping system
2) finally fix texture animation; textures now animate at the correct speed
--Goober5000
2006-07-06 04:06:04 +00:00
Goober5000 167e8499ac fix for Mantis #571
--Goober5000/Backslash
2006-07-05 23:48:20 +00:00
Goober5000 65b1fbf5d6 spelling 2006-07-05 23:41:43 +00:00
Goober5000 c6e35651fc cvs comment tweaks 2006-07-05 23:37:13 +00:00
Goober5000 5803ad9715 forgot this yesterday 2006-07-04 22:22:52 +00:00
Goober5000 718558f853 --in preparation for fixing an annoying animated texture bug, reorganize the various texture structs and glow point structs and clarify several parts of the texture code :P
--this breaks animated glow maps, and animated regular maps still aren't fixed, but these will be remedied shortly
--Goober5000
2006-07-04 07:42:50 +00:00
karajorma af6451eedf Restore the Hostile Warning triangles and the "On your Six" warning messages. 2006-07-02 22:53:53 +00:00
Goober5000 8c0574c39e bah 2006-07-02 04:13:43 +00:00
Goober5000 3463f876f0 remove associated AI flags
--Goober5000
2006-07-02 03:39:55 +00:00
Goober5000 7f15c14405 okay, I have no idea what I was doing there
--Goober5000
2006-07-02 03:34:16 +00:00
Goober5000 43b9ada185 fix the "Game of TAG" bug; hopefully this won't unfix something else
--Goober5000
2006-07-01 00:30:51 +00:00
Goober5000 4d1031fb9c restore compatibility with retail ship types
--Goober5000
2006-06-28 00:46:00 +00:00
taylor f8733691bf add in Goober's new files 2006-06-27 04:22:26 +00:00
taylor 7999d2f5af account for some minor floating point error in the undock speed check 2006-06-27 04:22:03 +00:00
Goober5000 1fb53b1a5d add new files to project 2006-06-27 04:12:27 +00:00
Goober5000 9e41f2e4ba bah 2006-06-27 04:10:50 +00:00
Goober5000 da2a5368be cvs header tweak
--Goober5000
2006-06-27 04:10:49 +00:00
Goober5000 7729b09354 handle docked objects during death roll
--Goober5000
2006-06-27 04:10:48 +00:00
Goober5000 6d6689b72a fix comment in preparation for code commit
--Goober5000
2006-06-27 03:55:22 +00:00
taylor 29af4691e7 Repeat after me: "Test build before/after commit.", "Test build before/after commit."
(there's no reason this should have happened for yet a third time in as many weeks)
2006-06-27 03:10:26 +00:00
Goober5000 3fc20520b4 slight optimization
--Goober5000
2006-06-27 02:38:49 +00:00
Goober5000 64c1aa3279 change back to ubyte
--Goober5000
2006-06-26 17:31:49 +00:00
wmcoolmon d0ba556741 New function for scripting 2006-06-24 20:39:57 +00:00
wmcoolmon 657899dd70 Fix loadTexture; fix subsystem indexing; fix getNum() for weaponbanktype; improve missing function error reporting when using LUA_INDEXER 2006-06-24 20:38:36 +00:00
Goober5000 f4fe6a8eee doh! sorry for blaming this on you, WMC
--Goober5000
2006-06-24 18:02:02 +00:00
Goober5000 32e31632a5 cosmetics, plus revert an unnecessary if 2006-06-24 04:48:08 +00:00
Goober5000 85c06cceb8 make ai-chase-any-except revert to ai-chase-any
(since it never really worked properly in the first place)
--Goober5000
2006-06-24 01:53:53 +00:00
karajorma a8835d6273 Was feeling left out :) 2006-06-23 16:08:55 +00:00
Goober5000 0931ad7010 change build names here too
--Goober5000
2006-06-23 13:44:28 +00:00
Goober5000 43a97f9641 make the 3.6.9 branch create appropriately-named builds
--Goober5000
2006-06-23 13:39:48 +00:00
karajorma 30d57b0bf8 Make the ambient light sliders actually save their settings. 2006-06-23 09:17:02 +00:00
taylor 5cf86ef5fc be sure to properly reset fullscreen/minimized state vars as we switch between them 2006-06-23 09:01:07 +00:00
taylor e3c9fe88c6 fix various things that Valgrind has been complaining about 2006-06-22 14:59:45 +00:00
taylor e98b50d64e make sure we only do ship related setup on actual ships 2006-06-20 20:04:42 +00:00
taylor 7518068ec2 as a temporary measure, until I can figure out what is going on here:
- disable depth buffer for RTT, may be causing the ATI issues, should work ok without it for most things
  - disable mipmap generation for RTT, something strange is going on there, it's sometimes making black mipmap levels (even for the same texture)
2006-06-19 22:50:58 +00:00
taylor 411f21658f yeah, I'm not at the top of my game today ;) 2006-06-18 23:38:06 +00:00
taylor 5a6d901e2f address a strange resize error that triggers an Assert() in the texture code with mipmaps 2006-06-18 23:34:55 +00:00
taylor dab2c932f3 32-bit PCX conversion doesn't do a bit swizzle so be sure we get the transparent pixel right in the first place to avoid the green 2006-06-18 23:32:29 +00:00
taylor 2f6a35aa09 fix screenshots on big endian 2006-06-18 20:09:03 +00:00
taylor 09208d536c well, that was actually pretty stupid of me :) 2006-06-18 20:08:27 +00:00
taylor cd35ade32f add a -disable_fbo troubleshooting option for those ATI users having trouble with FBOs, but can still use envmapping otherwise 2006-06-18 17:21:49 +00:00
taylor a9f3431ac6 always try to use a mission specified envmap over the static-generated envmap (missed this commit a while ago) 2006-06-18 17:20:32 +00:00
taylor 8d64d64156 various compiler warning fixes 2006-06-18 16:54:36 +00:00
taylor 47eccc7299 make sure we don't process cmeasure homing more than once (this should also fix the incompatible network packet)
fix flag check to be sure that we properly detonate missiles tracking cmeasures
2006-06-18 16:53:59 +00:00
taylor e6ca865588 make sure we can report both AL and ALC errors
fix for ds_get_free_channel(), it shouldn't return -1 on an AL error
2006-06-18 16:52:04 +00:00
taylor 4b6bf8504a we don't use alc functions here so no real need for the header 2006-06-18 16:50:19 +00:00
taylor af3350e693 fix so that multiple FBOs can be used with different sizes (plus a few other minor adjustments) 2006-06-18 16:49:40 +00:00
taylor a4421ccfb7 bump package version
add/remove files so that 'make dist' works again
2006-06-18 16:48:29 +00:00
taylor df675154c5 apparently missed this commit a month or so ago with the other OS X fixes 2006-06-15 23:33:53 +00:00
Goober5000 4aae03f732 make warpout work properly even if the player is docked to something
--Goober5000
2006-06-15 06:18:43 +00:00
Goober5000 4772f2768d this is kinda superfluous 2006-06-15 01:36:01 +00:00
Goober5000 5e48d6a75e version bumpage 2006-06-15 01:35:11 +00:00
Goober5000 71cb0937e5 tweaked the version string
--Goober5000
2006-06-15 01:29:25 +00:00
Goober5000 094a1e90ee better handling for 'G' key press
--Goober5000
2006-06-15 00:47:21 +00:00
taylor a5780453cc remove previous attempts at the Y bug fix, it's now back to the retail code for that 2006-06-15 00:16:23 +00:00
taylor ff27a3a66f fix Assert() on value of face variable, it should be able to be -1 for non-cubemap images 2006-06-15 00:15:17 +00:00
Goober5000 6cfa10a77c remove /Og switch 2006-06-14 22:33:41 +00:00
wmcoolmon 251fb61efc Hopefully fix compilation 2006-06-14 01:33:37 +00:00
taylor e3eabee785 sync up current OpenAL changes
- "SoundDeviceOAL" reg option for user specified sound device (used instead of "Soundcard" for OpenAL)
 - reset current context when we are leaving, may be leaving drivers in a bad state, and it hasn't hung up in quite a while
 - if sound card (which DS or OAL) is set to "no sound" then be sure to disable both sound and music
2006-06-12 03:40:26 +00:00
taylor 8bbc0ae489 try to allow RAS VPN connects since they probably aren't dial-up and shouldn't be seen as such 2006-06-12 03:38:15 +00:00
taylor 6c1508bb69 sync current OGL changes:
- go back to using minimize mode which non-active, but doin't minimize when Fred_running
 - remove temporary cmdline options (-spec_scale, -env_scale, -alpha_alpha_blend)
 - change FBO renderbuffer link around a little to maybe avoid freaky drivers (or freaky code)
2006-06-12 03:37:24 +00:00
taylor ca86d35af0 bump version to 3.6.9 2006-06-12 03:34:46 +00:00
taylor d7270570ed remove temporary cmdline options (-spec_scale, -env_scale, -alpha_alpha_blend)
tack on an extra byte to the flags.lch file so that the launcher can easily detect if it's an OpenAL build or not
2006-06-12 03:34:18 +00:00
wmcoolmon affbfa2687 Tweak events support; fix a few of Wanderer's bugs; begin model support 2006-06-12 02:33:34 +00:00
Goober5000 a2584a3fbf fix parsing/handling of debriefing persona indexes
--Goober5000
2006-06-10 18:35:05 +00:00
Goober5000 94d149aef4 update credits 2006-06-08 06:48:13 +00:00
karajorma 8962c8f4cb Allow Change-Ship-Class to affect ships which haven't arrived yet (For BHX) 2006-06-07 20:50:56 +00:00
karajorma 87049e3eb4 Allow Change-Ship-Class to work with ships which haven't arrived yet (For BHX) 2006-06-07 20:47:53 +00:00
karajorma 2f798e8223 Fix bug with multiple uses of change-ship-class SEXP 2006-06-07 20:45:11 +00:00
karajorma 39f88c57b7 Limbo flag support; further scripting 3.6.9 update 2006-06-07 20:25:10 +00:00
wmcoolmon 9bebab4979 Fix the getScreenCoords function. 2006-06-07 07:49:43 +00:00
wmcoolmon 26fcce9cae Scripting system prep for 3.6.9 2006-06-07 03:54:29 +00:00
wmcoolmon 4fe0fe418e Scripting system prep for 3.6.9 2006-06-07 03:23:15 +00:00
wmcoolmon 388529b4c2 According to wikipedia, true does not equal false. Hopefully, this doesn't break backwards compatibility :P 2006-06-07 02:28:13 +00:00
taylor 47d61f1775 properly initialize a few entries that were left zero'd by mistake 2006-06-06 00:00:00 +00:00
taylor e0b6fe6482 don't Int3() here, it's actually going to happen in some cases when using -img2dds 2006-06-05 23:59:33 +00:00
taylor be17801664 this should hopefully fix cursor drift on multi-display configs 2006-06-05 23:59:11 +00:00
wmcoolmon 61bd149728 Remove $Collide Ship and $Collide Weapon options from 3.6.9, as these are not finalized 2006-06-04 17:57:00 +00:00
Goober5000 0719b335d3 add fighterbay restriction code
--Goober5000
2006-06-04 01:03:13 +00:00
Goober5000 a7233999d6 add capability for preloading special arguments
NB: it's disabled for now, and it needs to be moved after sexps are parsed to work
--Goober5000
2006-06-04 00:01:48 +00:00
taylor ab449bcc2b remove init_decals declaration, it's in the header now since we build without decal support 2006-06-03 11:57:13 +00:00
taylor 73a0ed832a be sure that we properly apply light to submodels (mainly for debris), looks *really* bad otherwise 2006-06-03 05:06:38 +00:00
Goober5000 ae2bc4b669 add karajorma's multi callback
--Goober5000
2006-06-03 04:46:39 +00:00
(no author) f722910e5f This commit was manufactured by cvs2svn to create branch
'fs2_open_3_6_9'.
2006-06-02 09:17:10 +00:00
taylor 99db7b2b18 some more buffer size strangeness (which I still don't understand) that makes certain sound formats not work properly 2006-06-02 08:05:33 +00:00
taylor c99fdf2c96 flip color/depth values, appears some are initting software GL again and this was the problem previously 2006-06-01 07:33:59 +00:00
taylor 17fd0ef9aa make sure to use software device rather than hardware since we don't currently handle source rotation/reuse properly between ds and audiostr code 2006-06-01 07:33:00 +00:00
taylor a23de790f4 make sure FORM_ON_WING goal is valid since it works for ships other than player now 2006-06-01 04:47:23 +00:00
taylor 46f7e597cb put back listener setup for each sound, doesn't make a difference under Linux but it may be hurting Windows for some reason 2006-06-01 04:46:18 +00:00
taylor 0a377e7f56 a little change to the order here, this should be safer in the long run and avoid some memory issues too 2006-06-01 04:45:19 +00:00
taylor f8d912a4c0 fix the scope issues that someone complained about in the forums 2006-06-01 04:44:19 +00:00
taylor 6c32756521 use vm_vec_normalize_safe(), a bit cheap as a fix, but it's really difficult to trace the VECMAT errors back from here 2006-06-01 04:43:49 +00:00
taylor d8835bdc16 put decals back under an #ifdef, until this is fixed it's just in the way 2006-06-01 04:41:43 +00:00
taylor 50005735a9 be sure to to reset ok_to_fire between weapon checks to make sure we don't count something by mistake 2006-06-01 04:40:41 +00:00
taylor a18ca79093 render strings a string at a time rather than a letter at the time (should be at least 3 times faster from state changes alone) 2006-05-31 04:02:05 +00:00
taylor 8d66781134 bah! this thing is crashing. disable for now until I can figure out what's going on 2006-05-31 04:01:13 +00:00
Goober5000 3fa1ee0451 whoops, didn't mean to commit that 2006-05-31 03:27:19 +00:00
Goober5000 7cdb7814d8 some cosmetic changes in preparation for bay arrival/departure code
--Goober5000
2006-05-31 03:05:43 +00:00
Goober5000 7f24e0f07f fix compiler warning
--Goober5000
2006-05-31 02:08:22 +00:00
karajorma c039805ba0 Got sick of seeing that compiler warning all the time! 2006-05-30 11:20:38 +00:00
Goober5000 20209bc1f6 fix up CVS headers
--Goober5000
2006-05-30 06:01:05 +00:00
Goober5000 19b6d0b52f I should probably add these files too
--Goober5000
2006-05-30 05:58:59 +00:00
Goober5000 4565e6f240 add capability to restrict arrival/departure paths
(FRED only; FS2 implementation to follow)
--Goober5000
2006-05-30 05:37:29 +00:00
taylor c2ea62e833 make sure we are locking those vars down in timer_get() to avoid thread issues (may fix hang on "timer rolled" message) 2006-05-30 03:55:09 +00:00
taylor 52c27a513b z-range for 2D ortho is -1.0 to 1.0, may help avoid some strangeness if we actually get that right. :)
minor cleanup of old code and default settings
try not to bother with depth test unless we are actually going to need it (small performance boost in some cases)
don't clear depth bit in flip(), while technically correct it's also a bit redundant (and comes with a slight performance hit)
2006-05-30 03:53:52 +00:00
Goober5000 fe2a3e03b6 add substitute music boxes to FRED, and reset music properly when mission is cleared
--Goober5000
2006-05-30 02:13:22 +00:00
Goober5000 6ae6742b1e add AI Profile box to FRED
--Goober5000
2006-05-30 01:36:24 +00:00
Goober5000 0e6208e044 add debriefing persona index to fred
--Goober5000
2006-05-30 01:08:10 +00:00
Goober5000 41e061bb92 removed small redundancy
--Goober5000
2006-05-29 19:14:30 +00:00
Goober5000 62df777a19 add Taylor's compile fix
--Goober5000
2006-05-29 02:02:17 +00:00
taylor 12410efb93 fix D3D white screen issue 2006-05-28 18:40:37 +00:00
taylor 969febfbd9 remove DX9 SDK since it's useless to us at this time 2006-05-28 17:57:29 +00:00
taylor 7c28b639b3 minor safety check 2006-05-27 17:22:04 +00:00
taylor 767b33f610 update proj/view matrix calls to use new values 2006-05-27 17:21:37 +00:00
taylor c376148d23 clean up BM_TYPE_* stuff so it's a little easier to tell what is what
bm_load_sub_fast() doesn't need to lowercase filenames, so don't
byte-swap 16-bit DDS on big endian (they still don't look right though)
update bm_has_alpha_channel() to be less dumb
2006-05-27 17:20:48 +00:00
taylor a2cdb99bb6 d'oh! that was supposed to be off by default! 2006-05-27 17:18:56 +00:00
taylor 3c9d4d9c3d few things:
- comment out that -fixbugs and -nocrash crap, that's just stupid
  - move -env off of the experimental list (since it's working pretty well in OGL)
  - remove -nobeampierce
  - remove -max_subdivide (didn't do anything)
  - remove -rt (didn't do anything, and per-coder cmdline options should never be in CVS)
  - move -cache_bitmaps to game speed rather than graphics
  - add options for env and spec map scaling for envmaps (temporary, to be removed before official 3.6.8)
  - add option for new alpha blend mode so that artists can still test with it but not mess up normal users with the bad MediaVPs
  - remove -d3d_particle (it's obsolete now)
2006-05-27 17:17:57 +00:00
taylor 7f1da984b7 add NO_DIRECT3D support 2006-05-27 17:13:22 +00:00
taylor fe22826ef5 NO_DIRECT3D support
clean up video init stuff to use D3D if specified but always OGL otherwise (using NO_DIRECT3D will force always force OGL)
if video card reg entry can't be found just use OGL rather than getting all freaky on people
change for geometry batcher update
2006-05-27 17:12:44 +00:00
taylor 08394a9e8c don't setup all of the sound stuff for a mission if sound is disabled 2006-05-27 17:09:43 +00:00
taylor 2a44b90d16 oops! 2006-05-27 17:08:50 +00:00
taylor f1638de72e remove grd3dparticle.* and grd3dbatch.*, they are obsolete
allow us to build without D3D support under Windows (just define NO_DIRECT3D)
clean up TMAP flags
fix a couple of minor OpenGL state change issues with spec and env map rendering
make sure we build again for OS X (OGL extension functions work a little different there)
render targets always need to be power-of-2 to avoid incomplete buffer issues in the code
when we disable culling in opengl_3dunlit be sure that we re-enable it on exit of function
re-fix screenshots
add true alpha blending support (with cmdline for now since the artwork has the catch up)
draw lines with float positioning, to be more accurate with resizing on non-standard resolutions
don't load cubemaps from file for D3D, not sure how to do it anyway
update geometry batcher code, memory fixes, dynamic stuff, basic fixage, etc.
2006-05-27 17:07:48 +00:00
taylor 312b19926f only display that "no wavefile for voice" message if sound is enabled 2006-05-27 17:00:02 +00:00
taylor 55f1ab1b3b comment out some code which used only if neither D3D nor OGL 2006-05-27 16:59:05 +00:00
taylor 5ee7f1b1ae comment out the model cache stuff, it's old and not actually used anyway
minor cleanup of some modelinterp.cpp code, to make it more readable
fix tertiary thruster batcher which had the radius value swapped
comment out a couple places where we were doing a D3D or OGL check (it's always true so why bother)
add more support for NO_DIRECT3D so that it can be used on Windows to build without D3D
2006-05-27 16:57:13 +00:00
taylor 785593361e lots of little cleanup and minor fixage
make Particles[] dynamic (appears to improve processing speed of two particle functions by about 30%)
move to completely using Bobboau's geometry batcher instead of the stale one that RandomTiger did
little change to PARTICLE_SMOKE to flip UV orient differently, may add some realism, or just look kinda neat
get rid of particle_emit() stuff what was hardcoded for MAX_DETAIL_LEVEL value
2006-05-27 16:52:50 +00:00
taylor e705951cdd comment out some pointless checks which look for not using either D3D or OGL
don't run through ships on level load setting up the sound environment if sound is disabled
minor cleanup
2006-05-27 16:49:05 +00:00
taylor 5131db0c80 remove some of the old batcher functions, nothing is using them now anyway
minor cleanup
add orient UV flipping to HTL drawing functions, like retail/non-HTL has support for
2006-05-27 16:47:12 +00:00
taylor b9c2f1858c some minor cleanup
remove -nobeampierce
update for geometry batcher changes
2006-05-27 16:45:11 +00:00
taylor cd935f2b66 fix slight freakiness with debris vclips (un)loading
comment out some code which was only used if neither D3D or OGL
fix dumb particle_emit() calls
2006-05-27 16:42:16 +00:00
taylor ac449637ff remove non-Windows timeSetEvent() functions
make PDWORD and LPDWORD int instead of long (64-bit issue) (thanks Spike)
fix 64-bit ptr issue with OpenAL audio streaming code (thanks Spike)
add start of device enumberation for OpenAL 1.1 (it just lists available devices now)
make sure we open the default OpenAL 1.1 device under Windows
comment out blank listener stuff, this may have been crashing under OS X
add support for AL_BYTE_OFFSET in OpenAL 1.1 for buffer positioning under Windows
2006-05-27 16:39:40 +00:00
taylor 4967c0fdd4 remove grd3dparticle.* and grd3dbatch.* since they are obsolete
update to current Xcode project file
update frameworks (header problems) used by OS X version
2006-05-27 16:34:57 +00:00
wmcoolmon 66bdc93df2 Fix for Mantis bug #0000922 2006-05-24 05:09:25 +00:00
Goober5000 ea224ed952 fix for Mantis #750
--Goober5000
2006-05-21 22:57:30 +00:00
Goober5000 ecd04a316e fix Mantis #834
--Goober5000
2006-05-21 03:58:58 +00:00
Goober5000 02d8e6fd1c fix for Mantis #827
--Goober5000
2006-05-21 02:12:21 +00:00
Goober5000 43539dfd98 and actually commit the uncorrupted file - grr...
--Goober5000
2006-05-20 03:00:06 +00:00
Goober5000 367dbec7b6 try changing the format again
--Goober5000
2006-05-20 02:56:11 +00:00
Goober5000 eac4702e2c fix for Mantis #755, plus make the missionlog #defines uniform
--Goober5000
2006-05-20 02:03:01 +00:00
Goober5000 b08377cd2c formatting and clarification, plus fix for Mantis #911
--Goober5000
2006-05-19 04:47:40 +00:00
taylor 0836646e80 fix bool compiler warning for MSVC 2006-05-18 14:56:02 +00:00
Goober5000 c7ffc5a00c fix for Mantis #875
--Goober5000
2006-05-16 15:54:39 +00:00
karajorma bb46d019a2 Fix the lack of a background in FRED 2006-05-16 12:45:20 +00:00
Goober5000 912c927c5e fix directory goof
--Goober5000
2006-05-15 17:42:35 +00:00
karajorma f0e16e290c no message 2006-05-14 16:02:02 +00:00
karajorma 141bab42d3 Checkboxes for locking primary and secondary weapons and for disabling builtin messages from command and individual pilots 2006-05-14 15:57:43 +00:00
karajorma d90c9283a7 Fixes for the Targetable-as-bomb error from Mantis 0000910 (amongst others) 2006-05-14 15:54:16 +00:00
karajorma 6ee483f9ac Fixes for the Invulnerability problems from Mantis - 0000910 2006-05-14 15:52:42 +00:00
taylor 15bb5dceed forgot to remove STRICT define before commit, gets rid of a Windows compiler warning 2006-05-14 05:22:43 +00:00
taylor e137882c77 OpenGL envmap support
newer OpenGL extension support
add GL_ARB_texture_rectangle support for non-power-of-2 textures as interface graphics
add cubemap reading and writing support to DDS loader
fix bug in DDS loader that made compressed images with mipmaps use more memory than they really required
add support for a default envmap named "cubemap.dds"
new mission flag "$Environment Map:" to use a pre-existing envmap
minor cleanup of compiler warning messages
get rid of wasteful math from gr_set_proj_matrix()
remove extra gr_set_*_matrix() calls from starfield.cpp as there was no longer a reason for them to be there
clean up bmpman flags in reguards to cubemaps and render targets
disable D3D envmap code until it can be upgraded to current level of code
remove bumpmap code from OpenGL stuff (sorry but it was getting in the way, if it was more than copy-paste it would be worth keeping)
replace gluPerspective() call with glFrustum() call, it's a lot less math this way and saves the extra function call
2006-05-13 07:29:52 +00:00
taylor 7706111156 get rid of some wasteful math for gr_set_proj_matrix() calls
fix check that broke praise of kills for player
fix knossos warpin effect that always seems to get rendered backwards (I couldn't find anything that broke with this but I suppose it's a mod could have an issue)
2006-05-13 07:15:51 +00:00
taylor 7032281eb3 make sure sound buffers are valid before trying to delete them (was causing crash issues on Windows and OS X) 2006-05-13 07:11:46 +00:00
taylor 345b8fef8b some Windows specific OpenAL changes
add MVE files to MSVC6 project
2006-05-13 07:10:37 +00:00
taylor dc422b24a6 minor cleanup and a couple extra error checks
get rid of some wasteful math from the gr_set_proj_matrix() calls
2006-05-13 07:09:25 +00:00
taylor 61bf47af51 Vodka, it's a killer ;) 2006-05-13 07:03:41 +00:00
taylor 2180996dd8 add lazy (ie, faster) checking of asteroid collisions for time-to-impact 2006-05-13 07:02:27 +00:00
taylor 9d11783b3b fix bug where anything that wasn't a ship was considered a non-goal 2006-05-13 07:01:17 +00:00
taylor 02c737e71b MVE player (audio only works with OpenAL builds!) 2006-05-13 06:59:48 +00:00
taylor 2303a827de add newest OpenAL SDK, this makes things easier as OpenAL is now the build default 2006-05-13 06:58:07 +00:00
taylor b87fbfe680 add some missing headers, got tired of doing this myself when I did a build under Windows 2006-05-13 06:55:54 +00:00
Goober5000 36f397948a fixed build bug under WinXP
--Goober5000
2006-05-10 23:49:46 +00:00
taylor f73633677f if in freecamera mode, or the hud is disabled, the don't draw scripted hud elements
(this is almost hackish, but the bug never got a comment from WMC, so he can fix it later if this is wrong)
2006-05-09 09:23:05 +00:00
taylor 3ae297733f fix incorrect button locations, it matches the correct layout of the other techroom screens now
(thought Backslash was going to fix this, but I got tired of waiting. :))
2006-05-09 09:21:15 +00:00
taylor bfd717361b remove SCP Lite build option, the rest of the code for it was long since removed
remove the glBindBufferARB lib check, the soon-to-be-committed extension code upgrade will handle the issue much better
2006-05-09 09:19:38 +00:00
phreak c5e593b5fc the -decal command line doesn't enable decals anymore, just pops up a messagebox in windows saying that decals are disabled from now on. 2006-05-04 21:25:12 +00:00
phreak bfb0763c7d You can now preview sounds again in the event editor. 2006-04-30 16:39:43 +00:00
Goober5000 e13a46012f tweak for yesterday's file name change 2006-04-20 17:38:25 +00:00
taylor 700d2580b8 makefile fixage 2006-04-20 16:24:48 +00:00
Goober5000 67e8f94a93 proper capitalization according to Volition 2006-04-20 06:32:30 +00:00
Goober5000 c0760fe0eb change animation.cpp to modelanim.cpp, add CVS info, and add the file to the VC6 project
--Goober5000
2006-04-20 05:42:05 +00:00
bobboau 1ebf49e128 bugfix for the animation system 2006-04-18 02:33:59 +00:00
bobboau 4148f915f3 bugfix for the animation system 2006-04-18 00:56:28 +00:00
phreak ce6bc0a4a2 fix FRED crashing if the user adds multiple waypoint paths then inserts more ships. 2006-04-18 00:08:23 +00:00
karajorma a45abe3803 Some how managed to fail to commit the primary-locked and secondary-locked ship flags.
No idea how. Oh well here they are.
2006-04-16 11:58:11 +00:00
taylor 6d62bbc1c0 extra safety check when creating a default path string, filename is optional be we need to available if root0 is missing (CFILE not initted yet)
fix that crazy compiler<->constructor<->linker<->server.txt deal caused by some bad code and a freaky link thing in freespace.cpp
2006-04-16 05:28:10 +00:00
taylor 68ef4fba9f compiler warning fix, missed this one previously 2006-04-16 05:24:58 +00:00
taylor f680a2cac7 probably doesn't need to be world readable, but certainly doesn't need to be world writeable
add Assert() to can when we are stupidly trying to allocate 0 or less size bytes in vm_malloc()
2006-04-16 05:24:16 +00:00
taylor 065d73228c some optimizations for *nix 2006-04-16 05:22:21 +00:00
taylor 732ab180fc forgot to add forward declaration for allocate_mission_text() (thanks karajorma ;)) 2006-04-15 19:00:52 +00:00
phreak 2da7ae9abe use gr_flash_alpha() for fade-in/fade-out effect.
just using gr_shade() will not work with the hud off or using an external camera.
2006-04-15 04:17:58 +00:00
phreak 71b7ae9015 gr_flash_alpha(), much like gr_flash(), but allows an alpha value to be passed 2006-04-15 00:13:22 +00:00
taylor e3d03fd212 Grrr! That was still stupid. Just going to revert it to retail and work out that bug it was supposed to fix at a later time. 2006-04-14 21:13:31 +00:00
taylor 52f8465347 that was rather stupid of me, fogetting this would not have been a good thing :) 2006-04-14 18:50:52 +00:00
taylor aeb1c904a1 remove all of the *_ex() parsing functions added for use by EFFs
add a pause/unpause for parsing so that we can safely start parsing something new then continue parsing something old
make Mission_text and Mission_text_raw only use the memory needed, and free it when it doesn't need to parse anymore
  (should work ok with FRED2, but I wasn't able to test it)
2006-04-14 18:44:16 +00:00
taylor 9987ec1d61 make sure that modular star tables actually work without going into an endless loop, or constantly complaining on you 2006-04-14 18:40:44 +00:00
taylor 4fba39d9cf something that Valgrind complained about 2006-04-14 18:39:38 +00:00
taylor cb267605ed giving a tbl name in this warning message is basically useless since there we can't tell which tbl this particular ship is in 2006-04-14 18:39:06 +00:00
taylor 4ff77f28a3 more checking to make sure that the malloc calls are actually needed 2006-04-14 18:37:06 +00:00
taylor d601a98198 I might have blamed this on sleep, if it wasn't a bold faced lie. ;)
- another part of the turret untargetting target bug
2006-04-14 18:36:11 +00:00
taylor a6eb24fa82 make sure we don't allocate any memory for turrets unless there are some, was causing a few various memory issues, mainly for debug builds
(there is more of this same checking on the way for the other malloc() calls during model loading, and vm_malloc() will be set to
   Assert() on a 0 or less size as well)
2006-04-13 12:19:33 +00:00
taylor 96ef2672ea deal with font rendering issue from float precision on non-standard resolutions. this is only about a 97% fix/hack
but I don't want people complaining about the bad issue until I can figure out a more appropriate solution with
  gr_set_clip(), which is the real source of the problem
2006-04-13 12:15:58 +00:00
taylor 5d7c6fb3df bah! forgot to add a blasted = on that check 2006-04-13 12:12:27 +00:00
taylor 7ec2cd5f5c compiler warning fixes to make GCC 4.1 shut the hell up 2006-04-12 22:23:41 +00:00
phreak 3624b1a7ab get jump nodes rendering again..... again. 2006-04-12 05:30:50 +00:00
phreak 7e4e0982a9 obj_delete() needs to be called for jump nodes since the slot the jump node
that used to reside in hasn't been marked as empty.  This leads to the node still appearing in fred
if the user tries to delete the "ghosted" jump node, fred crashes.
2006-04-12 05:07:00 +00:00
taylor d71387ba9b some cleanup and slight reorg
- remove special uv offsets for non-standard res, they were stupid anyway and don't actually fix the problem (which should actually be fixed now)
 - avoid some costly math where possible in the drawing functions
 - add opengl_error_string(), this is part of a later update but there wasn't a reason to not go ahead and commit this peice now
 - minor cleanup to Win32 extension defines
 - make opengl_lights[] allocate only when using OGL
 - cleanup some costly per-frame lighting stuff
 - clamp textures for interface and aabitmap (font) graphics since they shouldn't normally repeat anyway (the default)
   (doing this for D3D, if it doesn't already, may fix the blue-lines problem since a similar issue was seen with OGL)
2006-04-12 01:10:35 +00:00
taylor 8c121c59d8 more s/colour/color/ changes
throw in a couple of safety checks for some neb2 functions
2006-04-12 01:03:00 +00:00
taylor 3750db172a some small optimizations and cleanup
use floats for gr_bitmap() size and positions, mainly for non-standard resolutions since this allows proper resizing and positioning
  (the cast to float was happening later anyway so there should be not additional slowdown from that with standard resolutions)
change g3_draw_2d_poly_bitmap() to use floats instead of ints, gets rid of the extra cast and allows better resize values
2006-04-12 01:00:58 +00:00
taylor 5309150c35 that's a rather expensive function to call twice per frame, we should only need to call it once per mission and not ever have to reset it to some middle value 2006-04-12 00:55:16 +00:00
taylor d89ef03a18 DDS now works well on the interface, but I forgot to every commit the CFILE change so that they are actually usable :) 2006-04-12 00:53:26 +00:00
taylor 935b9bf981 keep forgetting to add this 2006-04-12 00:52:32 +00:00
phreak 743e183c39 undo mission list changes for now while taylor is out of town and unable to commit the rest of the codebase. 2006-04-09 19:50:19 +00:00
karajorma f4cb11fb88 Added SEXPs to lock and unlock the primary and secondary weapons 2006-04-07 20:17:33 +00:00
taylor 92c0c62c8d perhaps this will fix the white splash screen issue on Windows (been sitting on this, might as well commit it) 2006-04-06 23:25:17 +00:00
taylor 2d61680691 bits of cleanup
minor fixes for -img2dds
2006-04-06 23:23:56 +00:00
karajorma 93fdc17fa1 Damn spelling mistakes. And in the only place where it would be visible too! 2006-04-06 20:44:14 +00:00
Goober5000 f7b2ba59e3 small fix 2006-04-06 18:53:28 +00:00
wmcoolmon 7769e8f393 Better scripting team support. (Just a tad) 2006-04-06 05:28:30 +00:00
karajorma 9a17211b9c Bah! Silly error. 2006-04-05 19:59:11 +00:00
karajorma c0d4616aad Support added for the Enable/Disable-BuiltinMessages SEXP 2006-04-05 17:54:25 +00:00
karajorma 66cbc52e27 Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:56:57 +00:00
karajorma 1af353ba41 Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:46:40 +00:00
karajorma 9b945036cc Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:29:53 +00:00
karajorma a22a83f181 Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:14:04 +00:00
taylor 527f2729ac remove -tga16, it's obsolete now
add a temporary -no_emissive_light option to not use emission type light in OGL
2006-04-05 13:47:01 +00:00
taylor 103149396d correct some coding mistakes 2006-04-05 13:45:08 +00:00
taylor c49e421e76 fix linking, again. 2006-04-05 13:44:30 +00:00
wmcoolmon 7e6bab7efc Maneuvering hruster scaling, gun convergence 2006-04-04 11:38:07 +00:00
wmcoolmon 6b2844c13e Bump this, too 2006-04-03 09:07:34 +00:00
wmcoolmon 601f884ecd show-subtitle's got its groove back 2006-04-03 09:05:37 +00:00
wmcoolmon 1c39fb3916 Maneuvering thruster fixes 2006-04-03 08:09:32 +00:00
wmcoolmon cd6d006019 Miscellaneous minor changes, mostly related to addition of Current_camera variable 2006-04-03 07:48:03 +00:00
wmcoolmon 613e92d84a Scripting support for cameras, as well as for moving model subobjects 2006-04-03 07:47:07 +00:00
wmcoolmon f93d5e2cf9 gamesnd_get_by_name now ignores extensions, mostly for parse_sound reasons. 2006-04-03 07:45:43 +00:00
wmcoolmon 5bef6f400a camera code updates (Translation should be possible now) 2006-04-03 07:45:15 +00:00
wmcoolmon 76890e3683 $Warp time and $Warp speed vars 2006-04-01 01:21:58 +00:00
wmcoolmon c966f042c3 Prelim. BSG warpin effect stuff 2006-03-31 10:20:01 +00:00
Goober5000 acf908dc58 those were some bugs just waiting to happen 2006-03-30 04:18:40 +00:00
Goober5000 e77da0c908 hehe, grammar
--Goober5000
2006-03-30 04:15:20 +00:00
karajorma ec0f94d2f6 Added the set-primary-weapon and the set-secondary-weapon SEXPs. Updated the corresponding
set-x-ammo SEXPs to also accept a rearm limit.
2006-03-28 11:41:57 +00:00
taylor d6257e32df forgot to ever change this stuff
- version bump to 3.6.8 for configure file
 - the Frameworks package for OS X is now a tarball rather than a zip file
2006-03-26 10:31:02 +00:00
taylor 596a94c3ab make sure to only allow on screen save at the time (I don't like having it restricted but since it's not used for anything else there is little point) 2006-03-26 08:26:45 +00:00
taylor 15e691540a the bmpman release issues for the chatbox should be fixed now so we can go back to using bm_release() on the bitmaps
Chatbox_p_coords (the multi-pause background) should be at 0,0 (even though this isn't used I thought it was a good idea to go ahead and fix it)
2006-03-26 08:25:05 +00:00
taylor dffe83c331 split pause_*() and multi_pause_*() functions into individual single and multi versions (why it was hacked up like that I'll never know)
fix screen save in multi pause mode
address some bmpman issues from interface graphics getting released and then still used by something else
2006-03-26 08:23:06 +00:00
Goober5000 e38accf100 this should fix random-of
--Goober5000
2006-03-26 06:42:01 +00:00
taylor 80e294a5b2 fix model_allocate_interp_data() extern for OSX 2006-03-25 22:44:52 +00:00
taylor 21cbe12363 add OGL headers to CFLAGS for OSX 2006-03-25 22:44:04 +00:00
taylor b257727de4 the previous changes should prevent these things from happening, but drop in some more Assert()'s anyway 2006-03-25 22:38:15 +00:00
taylor 10c58da28c modelinterp.cpp: that little bit really isn't needed
popup.cpp:  GCC 4.1 warning fixes
2006-03-25 10:41:44 +00:00
taylor cb3acee35f don't run through game_shade_frame() every frame unless we are in a game-play state 2006-03-25 10:40:38 +00:00
taylor edefe13877 minor cleanup
address numerous out-of-bounds issues
add some better error checking and Assert()'s around
2006-03-25 10:38:44 +00:00
Goober5000 e5da8c3ec6 hopefully fix this :( 2006-03-24 18:40:13 +00:00
wmcoolmon a8a62b6a53 New subobject animation stuff and Lua functions. 2006-03-24 07:38:36 +00:00
Goober5000 2c443660d1 add nav flag to def_files
--Goober5000
2006-03-24 05:08:23 +00:00
Goober5000 897b7c5dff tweak karajorma's fixes... these should work exactly the same but are closer to my original intent 2006-03-24 05:08:19 +00:00
taylor 84637262ec address out-of-bounds issues for Sounds[] when unloading 2006-03-22 21:42:55 +00:00
taylor 252de388d3 minor warning fixage 2006-03-22 18:20:06 +00:00
taylor d288d1a25e if -mipmap is used with -img2dds to then have compressed image also contain mipmaps
use nicest hints for texture compression, should improve quality a little
when reporting compressed sizes to debug log make ani size be total, not per frame
2006-03-22 18:14:52 +00:00
taylor 0c40355fe0 minor cleanup 2006-03-22 18:12:50 +00:00
taylor f63964da82 don't really see the point of the Assert() here, just bail if it's an issue 2006-03-22 18:12:16 +00:00
taylor a950517602 GCC 4.1 barfed on this 2006-03-22 18:11:28 +00:00
karajorma c8a11c7606 Fixed Random-Of so that it finally works properly. and doesn't ignore the last items on the list.
Fixed Rand-Multiple so that when seeded it works the way I originally designed it to. Previously it was
working exactly the same as rand when seeded.
2006-03-22 16:24:20 +00:00
taylor dcc0bbee6f fix text subtitles that I so kindly broke not too long ago 2006-03-22 08:34:17 +00:00
karajorma 1eac27d093 Bah. More errors fixed. This time in in-sequence 2006-03-22 01:36:21 +00:00
karajorma bb8e8276a2 Added the In-Sequence conditional. 2006-03-21 17:19:01 +00:00
taylor 623b944400 add commands to view from and change target in viewer mode pause
also add reset ability to both view mode and hud state to return to pre-pause settings
2006-03-21 14:19:18 +00:00
Goober5000 a420a09f3b fix taylor's fix :p
--Goober5000
2006-03-21 02:50:59 +00:00
taylor f34a4c6035 some minor cleanup 2006-03-21 00:27:27 +00:00
taylor cfb9531877 fix target eval check for weapons so that friendly ships will stop shooting at friendly bombs 2006-03-21 00:08:18 +00:00
taylor f0633adb5b change wording to ease Goober's ulcer. ;) 2006-03-20 06:25:19 +00:00
taylor 4a7d3296c3 add ai_profiles flag to get rid of limit on minimum speed a docked ship can move
(not going to Int3() here from < 0.1 speed by default, a support ship actually hit it)
2006-03-20 06:19:04 +00:00
taylor 3a745df024 fix D3D/OGL test for asteroid rotations (I was far too excited about the result of this :() 2006-03-20 06:16:45 +00:00
taylor 5f29c82949 might as well do star antialiasing for OGL too 2006-03-20 06:13:35 +00:00
taylor 5c5ed650dd make sure the mission log doesn't modify stuff in Cargo_names[], since it shouldn't
have split_str_once() be sure to not split a word in half, it should end up on the second line instead
2006-03-19 05:05:59 +00:00
Goober5000 e010375e02 added set-death-message sexp
--Goober5000
2006-03-18 22:43:16 +00:00
Goober5000 46c934495b blast 2006-03-18 22:18:24 +00:00
Goober5000 14570cb8ff fix comm order initialization bug
--Goober5000
2006-03-18 22:00:43 +00:00
taylor fe21f898b1 add framerate var since it's contained in freespace.cpp and that's not used in a FRED2 compile 2006-03-18 21:23:38 +00:00
wmcoolmon 0f4afd3f04 Nitpicketiness 2006-03-18 20:24:54 +00:00
taylor 213ce40ba4 meh. 2006-03-18 10:28:58 +00:00
taylor d5b2634313 fix out-of-bounds problem in awacs checking (full neb missions may have been a bit freaky from this) 2006-03-18 10:28:25 +00:00
taylor 8d44bdaf4d make sure errors in rand_sexp() and rand_internal() are properly handled 2006-03-18 10:26:42 +00:00
taylor 439cfa5e45 some cleanup to the nebula debug console help messages 2006-03-18 10:25:45 +00:00
taylor 3347889a16 never try and load glow or shine maps if we don't have a base map for it
but WMC's bumpmap block in a BUMPMAPPING define since it useless most of the time
2006-03-18 10:25:05 +00:00
taylor b106442d33 make the main vital TMAP_MAX_VERTS stuff dynamic, should handle the major non-HTL related crashes 2006-03-18 10:23:46 +00:00
taylor ff2518fa25 we already have a variable to show the framerate so lets just use the one 2006-03-18 10:17:59 +00:00
wmcoolmon 9ac38958b0 Allow "none" in $Shockwave Model to disable shockwave 2006-03-18 09:25:55 +00:00
Goober5000 2bc810eaa7 add ship-subsys-targetable and ship-subsys-untargetable
--Goober5000
2006-03-18 07:12:08 +00:00
taylor c196e8c971 this should fix the secondary thruster effect flow direction problem 2006-03-17 18:26:40 +00:00
taylor 14c774ef95 beyond some possible out-of-bounds issues, I think this stuff was messing up non-HTL lighting too 2006-03-16 14:23:35 +00:00
taylor bad5c7caf6 make sure our event state doesn't get filled with things we should poll for (was waiting for the new input code, but really needed to get at least this in) 2006-03-15 17:35:24 +00:00
taylor a6d2bc92d9 couple of nitpicks 2006-03-15 17:33:05 +00:00
taylor 16d05bf4fd bump error msg buffer size a little (I'll probably just go dynamic with this since you hopefully won't get this too much anyway) 2006-03-15 17:32:13 +00:00
taylor d0cd9b7b2a remove alut headers, since we don't use any alut functions anyway (didn't I already do this a couple of months ago??) 2006-03-15 17:30:47 +00:00
taylor 429e6525ab bump sexp nodes to 4000 for TBP, really needs to go dynamic soon 2006-03-12 07:35:33 +00:00
taylor 8d278275c2 when I forget that I'm an idiot little things like this slip through (me == moron) 2006-03-12 07:34:39 +00:00
taylor abded996e4 gah, how stupid could I have been! gotta make sure that the symlinks are preserved (keeps file size down too). 2006-03-12 07:31:20 +00:00
taylor 939d60468f update Makefile.am for all of the project files changes, include Xcode stuff too
update code/Makefile.am with FRED2 stuff, might as well in case someone wants to do a winelib port or something
2006-03-08 05:24:11 +00:00
taylor 40006729ff remove asm from MulDiv() since Intel Mac doesn't like it very much, and it doesn't do exactly what it should anyway 2006-03-08 05:22:14 +00:00
taylor c04664849a add model_allocate_interp_data() extern for PPC machines 2006-03-08 05:15:20 +00:00
taylor 51b6d8b1b9 update project file with a bunch of cleanup and universal binary building support
add a Frameworks.zip which contains pre-made universal binary frameworks for Ogg, Vorbis and SDL
2006-03-08 05:13:10 +00:00
taylor 03fa91edb8 add Frameworks directory to the ignore list 2006-03-08 05:09:53 +00:00
taylor fdef4c6b80 don't need these with new project file and frameworks 2006-03-07 09:21:21 +00:00
taylor 0b161c6ae4 make filename length checks non-fatal 2006-03-06 16:30:06 +00:00
taylor 38da59fa62 various small cleanups, fixes, error checks 2006-03-05 21:45:12 +00:00
taylor dfa3724143 remove WMC's "speed increase" ;) (the math isn't right yet so the collision checks won't be correct, and fixing it to work right wouldn't be any faster) 2006-03-05 18:00:55 +00:00
karajorma 672aba310c Bah. Error in secondary and primary ammo SEXPs fixed 2006-03-04 11:05:47 +00:00
Goober5000 7db3ed83ec fix the random-of sexps to only choose valid arguments 2006-03-03 06:14:41 +00:00
Goober5000 0cddf00e4f took care of (hopefully) the rest of Karajorma's SEXP node handle conflicts, plus merged the random sexps with their multiple variants 2006-03-02 04:05:27 +00:00
karajorma daa8de6441 Fixed a bunch of bugs with Set-x-ammo and Rand SEXPs. 2006-03-01 23:22:25 +00:00
karajorma bf70b733fe Added the random-multiple-of SEXP and fixed random-of to work as designed 2006-03-01 20:54:35 +00:00
karajorma c2ea734c56 Changed text FRED displays for Fade-In and Fade-Out SEXPs 2006-03-01 14:53:15 +00:00
Goober5000 502fba611f fix comm message localization 2006-03-01 04:01:37 +00:00
Goober5000 1f3db839e8 not needed... and just an annoyance with > 2 main halls 2006-03-01 04:01:15 +00:00
Goober5000 8b8c6a2e86 oswpt wing fix 2006-03-01 03:14:22 +00:00
Goober5000 a8a1bfbfdb more FS1 import tweaks 2006-03-01 00:46:11 +00:00
wmcoolmon d87360e6ac Silly mistake 2006-02-28 07:52:04 +00:00
Goober5000 9241fc8043 fix another import bug 2006-02-28 07:37:12 +00:00
Goober5000 73af2a1fec cool stuff with main hall music tracks 2006-02-28 06:59:28 +00:00
Goober5000 22f2be0d3d fix the animation type triggers 2006-02-28 05:16:55 +00:00
Goober5000 0014e5f42b add log entry for jettison-cargo 2006-02-27 04:17:11 +00:00
wmcoolmon c47dbebae2 x != y, surprisingly enough 2006-02-27 01:21:03 +00:00
wmcoolmon 19b59199c3 Bump MAX_TFP to 10 2006-02-27 00:51:03 +00:00
wmcoolmon a6eebda3f9 Consistency in Lua 2D funcs; fix FRED2 loading screen images dialog boxes. 2006-02-27 00:40:34 +00:00
wmcoolmon 756a61f6db Afterburner & meta updates 2006-02-27 00:15:08 +00:00
wmcoolmon 57ef52f6ec Targetable as bomb SEXPs and dialog stuff; made invulnerable an object flag in both FRED and FS2. 2006-02-26 23:23:31 +00:00
Goober5000 3245346c91 wow, over a year later and I'm still finding docking bugs :p 2006-02-26 22:47:11 +00:00
wmcoolmon 91cd167d33 SF2_TARGETABLE_AS_BOMBER flag, Lua gr_bitmap_ex fix 2006-02-26 22:23:01 +00:00
Goober5000 9922355122 some more WCSaga stuff 2006-02-26 18:49:07 +00:00
taylor 71299f6f64 one friggin line, should have been able to notice that sooner 2006-02-26 11:09:31 +00:00
taylor c5d99f8837 another non-linear campaign fix, this one affected PVs 2006-02-26 08:06:57 +00:00
Goober5000 e3f020349e fix stupid bug 2006-02-26 05:32:55 +00:00
Goober5000 71f3acb329 guess this is still needed 2006-02-26 05:32:38 +00:00
Goober5000 32b340d20b bah 2006-02-26 01:32:23 +00:00
Goober5000 627b90b89b fix subsystems for get-object-* 2006-02-26 00:43:10 +00:00
Goober5000 cc7c096d32 some paring down of sexps 2006-02-26 00:22:15 +00:00
Goober5000 b2ad92daa5 import tweak 2006-02-25 22:06:57 +00:00
Goober5000 8747465d38 spelling 2006-02-25 21:47:19 +00:00
Goober5000 f504ecb5da fixes from last commit 2006-02-25 21:42:31 +00:00
Goober5000 584fb2a5b6 added function for retrieving a ship, wing, waypoint, or team from a sexp argument
--Goober5000
2006-02-25 20:18:14 +00:00
Goober5000 7cbc657454 some tweaks to the ignore code 2006-02-25 19:03:39 +00:00
karajorma 9774ddecc1 Added Seeding functions to Rand and Rand-Multiple SEXPs 2006-02-25 17:34:23 +00:00
wmcoolmon 1dc1aed65c Fix no text for splash screen scripting problem 2006-02-25 06:57:58 +00:00
taylor 71085ffcb4 try and make some sense out of that cmdline option mess, maybe it will stay sane for a few days at least :) 2006-02-24 07:36:49 +00:00
taylor 39e45eacb2 add v-sync support for OGL (I skimmped on this a bit but will go back to do something better, "special" extension wise, at a later date) 2006-02-24 07:35:48 +00:00
taylor 326f68ee82 fix custom loading screens that I manage to break yet again
add a "MaxFPS" registry/ini option to specify a FPS cap, useful if you can't make use of v-sync for some reason
2006-02-24 07:34:07 +00:00
taylor 7af3194685 vm_extract_angles_vector() doesn't do the same thing that this code used to so don't use it 2006-02-24 07:32:11 +00:00
taylor 6d121c1c3d clean up some of that FS2OpenPXO crap (can't wait to rip all this out for official PXO :)) 2006-02-24 07:31:18 +00:00
taylor eab464576f compiler warning fixage 2006-02-24 07:30:23 +00:00
wmcoolmon 74468eb153 Maybe fix ships-limit bug 2006-02-24 05:13:26 +00:00
Goober5000 9ab540efa8 remove my old anti-frustration thing since it's not what retail does
--Goober5000
2006-02-24 05:02:34 +00:00
wmcoolmon 6185fe9336 I love it when bugs are this easy to fix. ;) 2006-02-24 04:45:00 +00:00
taylor 69b80ad5b4 attempt to fix bad out-of-bounds (and related) issues when weaponchoice icon is missing
be sure to always initialize frame count and FPS with bm_load_animation() calls in case caller got lazy
2006-02-23 06:21:56 +00:00
karajorma 24a4b142bf Added the String-to-int SEXP. 2006-02-23 01:37:51 +00:00
taylor 4ae489e5d0 fix subsystem distance check from single ship to subsystem (this has been broken since day 1, over 3 years ago, so there could be other Mantis bugs relating to this) 2006-02-22 18:32:18 +00:00
karajorma 25904b40c6 Changed the set-secondary-ammo and set-primary-ammo SEXPs to use the banks
capacity rather than starting ammo.
2006-02-22 00:04:04 +00:00
karajorma 9aae6f74e3 Fixed the problems with set-primary-ammo and set-secondary-ammo SEXPs 2006-02-21 22:20:04 +00:00
karajorma c0bcbd8cd4 Added the get and set-primary-ammo SEXPs. The set-primary-ammo
and set-secondary-ammo SEXPs appear to be broken at the moment though
2006-02-21 21:40:25 +00:00
Goober5000 e6fd50c4a7 more true/false tweaks and redid the get-object-* and set-object-speed-* sexps to be more flexible and extensible
this will break compatibility with certain uses of these sexps in existing missions; I don't think there are any released campaigns
with the old versions so hopefully mission designers can simply update unreleased missions... however if it gets to be a problem
I will code in some reverse compatibility

--Goober5000
2006-02-21 09:08:10 +00:00
Goober5000 49059aaea0 add a bunch of tweaks to hopefully lessen the possibility of misinterpreting special return values (such as nan) as true or false
--Goober5000
2006-02-21 07:58:01 +00:00
taylor c547fd7352 make changed object type debug message a bit more useful 2006-02-21 07:12:59 +00:00
karajorma f56a087069 Added the num-ships-in-wing, get-secondary-ammo and set-secondary-ammo SEXPs 2006-02-20 20:53:11 +00:00
Goober5000 ed0ad344a9 fixed several more things in the new ignore code
--Goober5000
2006-02-20 07:59:26 +00:00
taylor e473e600b9 updated to newest dynamic starfield code
- this mainly is to just better support SEXP based starfield bitmap changes (preloading, better in-mission stuff loading)
 - also fixes index_buffer related double-free()
 - done waste memory for env index buffer if env is not enabled
 - address a couple of bm load/release issues and comment a little to tell why
2006-02-20 07:30:15 +00:00
taylor f9fe94ef49 div-by-0 bug fixage 2006-02-20 07:26:07 +00:00
taylor d3bf2d5b0f handle badly encoded (has short reads due to strange block/data size ratio) ADPCM files a little better in debug builds 2006-02-20 07:25:14 +00:00
taylor 2783f86320 start of some of the newer GL stuff
- initial support for dropping from fullscreen to windowed mode (will get more changes in another day or so, mainly because of FRED2)
 - a little cleanup
 - init change for WGL to be a little safer and to help report what it tried to use and what it got in the way of pixelformat
 - don't use global OGL_enabled to decide if GL is initialized or not (also getting more changes shortly)
 - make sure opengl_close() will always execute properly through atexit() (also getting changed later to not run through atexit())
2006-02-20 07:23:29 +00:00
Goober5000 1425f4774f hmm, remove one form of commenting 2006-02-20 05:54:44 +00:00
Goober5000 93d23f857a added ai-ignore-new which hopefully should fix the ignore bug
--Goober5000
2006-02-20 02:13:08 +00:00
Goober5000 acbd81cebe reduce confusion in naming
--Goober5000
2006-02-19 23:14:22 +00:00
Goober5000 c5b832dea2 restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
--Goober5000
2006-02-19 22:00:10 +00:00
Goober5000 197960047d rearrange some turret code to be more like retail
--Goober5000
2006-02-19 07:20:43 +00:00
Goober5000 0c25c442e2 fix stealth
--Goober5000
2006-02-19 03:17:01 +00:00
wmcoolmon 74306d9663 Oops 2006-02-19 02:04:40 +00:00
wmcoolmon 74ed40d63a Documentation consistency; remove unneeded check. 2006-02-19 02:01:24 +00:00
Goober5000 17773591a3 breathalyzer for WMC, stat!
--Goober5000
2006-02-19 00:59:49 +00:00
Goober5000 8278e0f44e fixed saving of special tags
--Goober5000
2006-02-19 00:49:41 +00:00
Goober5000 c3b3a75d19 additional error checking
--Goober5000
2006-02-19 00:32:47 +00:00
Goober5000 062aa69b38 center cbanis
--Goober5000
2006-02-19 00:29:39 +00:00
wmcoolmon 312cc178b6 Introducing draw_model_rotating; many improvements to weapon selection missile rendering 2006-02-18 00:42:51 +00:00
wmcoolmon 496395d498 Fix a silly bug 2006-02-17 21:47:47 +00:00
Goober5000 ba967dee96 bother those variables 2006-02-17 08:36:16 +00:00
Goober5000 6df44ceaa6 fix subtle bug
--Goober5000
2006-02-17 08:13:53 +00:00
wmcoolmon d4a7ff97bb Various updates for consistency in documentation 2006-02-16 06:00:49 +00:00
taylor 6be29e0fdf keep weapon model refcount correct (this is admittedly strange, but safer than before) 2006-02-16 05:48:48 +00:00
taylor 75727a19df I never did really like the old audiostr OpenAL change here, this just seems safer
initialize si->data and si->size before loading sound buffer (fixes OGG issue for plats that don't zero-initialize <vector>, this will be handled differently in the new code)
2006-02-16 05:47:32 +00:00
taylor 1b2721b088 remove reset of modelnums on level start (more properly moved to model_unload())
minor change ship class fixage to clear out old model
take better care to make sure that a ship model has the proper refcount (this needs further work, I don't like :V:'s crap here)
add <string> to includes in ship.h, fixes a compile issue that I forgot to fix properly before (thanks Jens)
2006-02-16 05:44:53 +00:00
taylor bf0eeb27b5 please stop modifying the passed node value in sexp functions, it makes it very difficult to debug problems 2006-02-16 05:40:58 +00:00
taylor d04ee2f2e0 some FS2NetD fixes
- timer/timeout issues
 - keep server heartbeats to a minimum in order to save some bandwidth
 - clean up some debug message a little
2006-02-16 05:39:13 +00:00
taylor c1f9b7efcf NULL vec warning fix (basically just setup as if it were NULL and skip the extra work if needed)
more bmpman related fixes, mainly addresses the condition where it would try to render textures that have been released
have model_unload() run through Ship_info[] and clear out modelnum's when they are free'd (makes more sense here than doing it on level load to keep counts right)
fix missing subsystem warning messages
2006-02-16 05:31:00 +00:00
taylor 4bd1a26311 should fix some of the model/bmpman errors off of the weaponchoice screen 2006-02-16 05:24:35 +00:00
taylor 146e2c192d I would say this is another selling point for the boozer-svn plugin, but I would have needed it too as I've missed this stuff several times 2006-02-16 05:19:46 +00:00
taylor 7e133609d3 all just getting basic info in parse_mission_info(), this fixes several parsing/warning issues that can show up
from going in the techroom and some similar FRED2 issues as this stuff doesn't get reset between get_mission_info() calls.
  this also should make the mission simulator screen load a bit faster
2006-02-16 05:18:48 +00:00
taylor 79050b101f fix strangeness with persona index thingy (ubyte can't be -1, this needs to be left like this or make an int)
address some pilot file corruption using non-linear campaigns, rather simple fix for something that took quite a while to track down
2006-02-16 05:15:48 +00:00
taylor d9752473af NULL vec warning fix (I don't really like this one that much so it may get replaced later) 2006-02-16 05:09:26 +00:00
taylor f1b2d2af86 minor 64-bit related fixage 2006-02-16 05:07:50 +00:00
taylor 6e8aab4827 various camera fixes (did this ever work properly?)
- handle basic init properly for those platforms that do/don't zero-initialize STL vector
 - allow text images without witten text
 - don't try to process text if it's NULL or of 0 length
 - don't get freaky with image handling
 - add clone/assignment operator so that push_back() will not screw up bmpman stuff
2006-02-16 05:07:08 +00:00
taylor 11830f47b7 various bmpman related fixes
- some new error checking (and fixes related to that) and cleanup
 - fix EFFs not getting released/unloaded properly (was in a local tree but apparently missed CVS)
 - minor fixes for bm_release() to produce a more properly cleaned slot
 - use fast unloading for page_in stuff since we don't actually want really want the load count changing for texture maps
   and to make sure that we free the memory usage regardless of load count
2006-02-16 05:00:01 +00:00
taylor 1e0c0f2235 couple more lighting value tweaks 2006-02-16 04:55:53 +00:00
taylor 1cd7e8f606 newline fixage 2006-02-16 04:55:14 +00:00
wmcoolmon 2981450fa2 Dodge an Assert 2006-02-15 07:30:54 +00:00
wmcoolmon 4d02e1217e Blah, pulled a Goober. 2006-02-15 07:26:52 +00:00
wmcoolmon f606fe7a5c Various weapon and team related scripting functions; $Collide Ship and $Collide Weapon hooks 2006-02-15 07:19:50 +00:00
Goober5000 01ecd46ee6 enabled modular tables for ai_profiles and added the default table to def_files
--Goober5000
2006-02-13 04:56:58 +00:00
Goober5000 fa4a39a8c7 nitpick 2006-02-13 03:11:19 +00:00
Goober5000 31bb6acc9d more tweaks, plus clarification of checks for the existence of files
--Goober5000
2006-02-13 00:20:46 +00:00
wmcoolmon 3d4295ca95 Remove initial corkscrew values from parse_weapon 2006-02-12 17:54:35 +00:00
Goober5000 7b31df805b allow specification of debriefing personas
--Goober5000
2006-02-12 10:42:25 +00:00
Goober5000 c5b61babeb whoops, forgot this 2006-02-12 08:39:32 +00:00
Goober5000 f5ba1e19b0 additional fixes and enhancements for substitute music
--Goober5000
2006-02-12 05:23:16 +00:00
Goober5000 2a061c3fdc more cool work on importing, music handling, etc.
--Goober5000
2006-02-12 01:27:47 +00:00
Goober5000 ca4e256101 bumped to 3.6.8 because of version-specific commenting
--Goober5000
2006-02-11 22:10:11 +00:00
Goober5000 cd26bde8e9 removed the FS1-specific music hack
--Goober5000
2006-02-11 22:08:56 +00:00
Goober5000 a986c1e2a2 this isn't needed now
--Goober5000
2006-02-11 21:24:05 +00:00
Goober5000 3405ad64de reworked how comments are parsed and added version-specific commenting
--Goober5000
2006-02-11 21:23:42 +00:00
wmcoolmon 606708f0e0 getWeaponClass->getWeaponClassByName, Linked/DualFire variables 2006-02-11 19:24:17 +00:00
Goober5000 6651e9f32d RT's bugfix 2006-02-11 07:34:25 +00:00
Goober5000 41f95a7f5e two things I missed before
--Goober5000
2006-02-11 07:31:55 +00:00
Goober5000 b99f6819c4 yet more various and sundry fixes
--Goober5000
2006-02-11 02:58:23 +00:00
Goober5000 c833458e9a more fixage
--Goober5000
2006-02-11 01:02:28 +00:00
Goober5000 4ee85f2ea7 more FS1 import goodness
--Goober5000
2006-02-11 00:13:55 +00:00
Goober5000 5d4852df2e fixed an old Volition bug unmasked by my parse changes
--Goober5000
2006-02-10 23:33:39 +00:00
wmcoolmon fc54469c0a Removed resize fields; fixed silly bug with RunBytecode 2006-02-09 05:07:02 +00:00
wmcoolmon ce8ec37de8 Maybe fix gliding insta-turn problem 2006-02-08 02:10:39 +00:00
wmcoolmon a956ebf70f WMC-Since we're abusing species_defs.tbl anyways, remove $NumSpecies 2006-02-06 02:29:17 +00:00
wmcoolmon 02eb2a16a1 Various fixes; very beginnings of Directives scripting support 2006-02-06 02:06:02 +00:00
Goober5000 ca1e2ae810 fixed several IFF bugs in FRED (plus one or two other bugs)
--Goober5000
2006-02-04 07:05:03 +00:00
taylor 41448cf7b0 fix sun flares that I had broken previously 2006-02-03 22:29:01 +00:00
taylor 3f2b3cb49f a couple of mvalid.cfg and tvalid.cfg file format changes to give them at least some readability
some cleanup, extra logging, and very slight speedup with mission and table validation checking
fix memory leak from mission and table validation checking
2006-02-03 22:28:10 +00:00
taylor 31a1c0b81f I don't like this being considered a fix without retail compatibility testing, but it should at the very least compile... 2006-02-03 22:25:18 +00:00
Goober5000 68f0190dc0 ugh, more ship/wing fixage
--Goober5000
2006-02-02 08:12:47 +00:00
Goober5000 d5de7aefec bah and double bah 2006-02-02 07:13:42 +00:00
Goober5000 8d5f3eb959 fixed what I broke for ship types :p
--Goober5000
2006-02-02 07:01:16 +00:00
Goober5000 e3ae13d7dd consolidated comm order stuff
--Goober5000
2006-02-02 07:00:29 +00:00
Goober5000 69e2beb10a replaced Fred_comm_orders with proper Comm_orders, just for WMC ;)
--Goober5000
2006-02-02 06:22:58 +00:00
Goober5000 a53e6c7b74 restore retail compatibility with comm orders: one logic bugfix, one cosmetic bugfix
--Goober5000
2006-02-02 06:04:02 +00:00
Goober5000 6338c13bae fixed a FRED problem brought on by the parse reordering
--Goober5000
2006-02-02 05:48:17 +00:00
phreak b976ebc8b9 Allow weapons to home in on countermeasures as well. The multiplayer code was only allowing bombs to be homed in on. 2006-02-01 23:43:34 +00:00
phreak fbaeb10cd2 -ingame should be -ingame_join 2006-02-01 23:35:31 +00:00
taylor c2c2b69a9d add local lua dir to includes 2006-02-01 13:30:12 +00:00
Goober5000 19dd7af5a4 now all the project files are working :)
--Goober5000
2006-02-01 08:05:47 +00:00
Goober5000 0e734baf44 try fixing this again 2006-02-01 05:40:44 +00:00
Goober5000 c5f879d372 bettered the ballistic primary check
--Goober5000
2006-02-01 05:11:25 +00:00
Goober5000 5e7b8e14d0 fixed project folder settings 2006-02-01 04:29:30 +00:00
taylor 47b8515aee oh the shame (/me imagines the big grin on Goober's face right now :p) 2006-01-31 17:19:20 +00:00
taylor 4e7473d94e remove USE_LUA 2006-01-31 15:44:55 +00:00
taylor 5a2cecb05e we need to skip to the start of the string, not the end 2006-01-31 15:44:29 +00:00
wmcoolmon fb23f6d361 Removed USE_LUA; Simulation hook; better debug messages for Lua; swapped out mounted weapon functions for variables 2006-01-31 06:46:14 +00:00
wmcoolmon 45760b32bf Compiler warning fix 2006-01-31 06:44:48 +00:00
wmcoolmon 65694ccf6e Debug warning; compiler warning fix. 2006-01-31 06:43:21 +00:00
wmcoolmon 1106a7af9a Removed USE_LUA 2006-01-31 06:42:28 +00:00
wmcoolmon 26c9b9c22d Scripting simulation hook; removed USE_LUA 2006-01-31 06:42:00 +00:00
wmcoolmon 90cf8fc7ef Fix hack for checking for ballistic primary ammo 2006-01-31 06:32:42 +00:00
Goober5000 a6ba03c9f4 stuff 2006-01-31 04:24:25 +00:00
Goober5000 dd0b86e564 oh noes! :( 2006-01-31 04:13:00 +00:00
Goober5000 f437c999a9 fix a potential problem with replacement range
--Goober5000
2006-01-31 02:02:33 +00:00
Goober5000 b00090cd29 update FSM import for FSPort v3.0
--Goober5000
2006-01-31 01:53:37 +00:00
taylor 985d861732 fix problem that made briefing voice repeat first second or two in OpenAL 2006-01-30 22:09:52 +00:00
taylor 4f28325994 some minor fixage 2006-01-30 22:08:59 +00:00
taylor de01dc405d and after all of my recent work fixing div-by-0 zero bugs, ya had to know this was coming :) 2006-01-30 19:37:33 +00:00
taylor 87a8b123a9 fix parsing of reinforcements 2006-01-30 19:35:41 +00:00
taylor d02d542fac make sure to init dest and dest_size for any calling functions that don't 2006-01-30 07:14:32 +00:00
taylor 3f599bcf26 fix endless loop when we've got too many weapons 2006-01-30 07:00:14 +00:00
taylor 2ecc191857 try and handle things like $$ and ## a bit better (this worked for what I threw at it but please double-check me here Goober) 2006-01-30 06:58:10 +00:00
taylor 96c6bdacec better lighting for OpenGL
remove some extra stuff that was from sectional bitmaps since we don't need it anymore
2006-01-30 06:52:15 +00:00
taylor 42c4cdd754 make MAX_LIGHTS global 2006-01-30 06:41:34 +00:00
taylor 25569bebcf better lighting for OpenGL
remove some extra stuff that was from sectional bitmaps since we don't need it anymore
some basic lighting code cleanup
2006-01-30 06:40:49 +00:00
taylor 5da0a66ddd clean up lighting stuff a little 2006-01-30 06:38:34 +00:00
taylor 4d63cf4769 account for a freaky wing issue (saw this in Derelict, or somewhere) 2006-01-30 06:37:49 +00:00
taylor cfd3d70987 handle Interp data allocation a little better 2006-01-30 06:36:35 +00:00
taylor b9c7b01ff6 minor warning fixage 2006-01-30 06:36:01 +00:00
taylor 60dd6b6ab3 minor fixage 2006-01-30 06:35:29 +00:00
taylor cade5bfea9 (possibly) better fix for some static/stuttering in certain wav files 2006-01-30 06:35:02 +00:00
taylor 4a34a158b0 try and detect some bad path info 2006-01-30 06:34:06 +00:00
taylor db36f73445 add transparent, cycling alpha, and no-light options for weapons 2006-01-30 06:33:19 +00:00
taylor 2e82436028 dynamic starfield bitmaps (if the thought it was freaky before, just take a look at the new and "improved" version ;)) 2006-01-30 06:31:30 +00:00
taylor 6965a6a84a dynamic starfield bitmaps 2006-01-30 06:30:03 +00:00
wmcoolmon bcad5469b8 Apologies, don't know how I missed this... 2006-01-29 18:01:04 +00:00
wmcoolmon 82b02677dc Make sure stuff is set up properly for ship kills 2006-01-29 07:42:49 +00:00
wmcoolmon fef970a13d Minor warning update 2006-01-29 07:41:57 +00:00
Goober5000 a6a7372c97 fix all teams at war IFF behavior
--Goober5000
2006-01-28 04:33:06 +00:00
Goober5000 fdbbc56725 fixed the bug where wings couldn't be initially docked to stuff
--Goober5000
2006-01-28 02:59:55 +00:00
Goober5000 532809a656 fixed a small incompatibility
--Goober5000
2006-01-28 00:23:36 +00:00
Goober5000 c0cd19b0a2 some tweaks for insertion sort
--Goober5000
2006-01-27 20:29:30 +00:00
Goober5000 ab1a0eeedf replace quick sort with insertion sort in many places
--Goober5000
2006-01-27 06:21:10 +00:00
Goober5000 411be31efc add an insertion sort function for small or almost-sorted arrays; it has the same prototype as stdlib's quick sort
--Goober5000
2006-01-27 06:03:41 +00:00
Goober5000 b388c2a9da a few project file fixes
--Goober5000
2006-01-27 04:06:31 +00:00
phreak 9d38626cb4 Grid zbuffering issue fix moved to the new fred project folder 2006-01-26 23:04:45 +00:00
Goober5000 fe552db39e spelling 2006-01-26 04:01:58 +00:00
taylor 01b5c513e8 first version of this sucked, this should be a bit better while working with both new and retail data
- get an average color from the palette rather than picking first (unoptimized palettes could have unused pixels in first entry)
  - slight cleanup, and s/colour/color/ (yeah, stupid American, deal with it! :))
2006-01-26 03:59:59 +00:00
Goober5000 1e2f2296e8 added variable replacement to command briefings, briefings, and debriefings
--Goober5000
2006-01-26 03:58:14 +00:00
Goober5000 2f9af7b19c pare down the pragmas some more
--Goober5000
2006-01-26 03:23:30 +00:00
Goober5000 48b4f603ac ugh; these scripting #defines really need to be kept up-to-date 2006-01-26 02:26:17 +00:00
taylor 3c9494535c quick and ugly hack to get aigoal sorting working on Windows again (temporary, should be replaced by better and permanent sorting function) 2006-01-25 22:51:07 +00:00
wmcoolmon 196e612ea1 Maybe fix G3_count error 2006-01-25 07:46:13 +00:00
phreak a762accd17 htl_lines should follow zbuffering rules 2006-01-25 03:11:52 +00:00
taylor 71a15f1b21 break out of error check loop after the first check in FRED since it doesn't like this for some reason 2006-01-24 13:38:30 +00:00
taylor b408734f17 another NaN/div-by-0 bug 2006-01-23 13:51:11 +00:00
taylor 75471226d5 fix d3d_bitmap_ex coloring (thanks Alpha0!) 2006-01-23 09:39:30 +00:00
taylor 867ab841c0 add fixes for capships that hit waypoints and just spin around
try and fix a big ship guard NaN error that is the result of an incredibly small forward speed value
2006-01-22 22:41:16 +00:00
wmcoolmon 3922659ee8 0...1...2...4? 2006-01-22 19:57:35 +00:00
taylor d71cd89d5f more class type name fixage (maybe an AltName: line for objettypes.tbl in the future?)
if a ship has no class_type in ai_chase() then assume it's ok to chase, but log it in debug
  (uncomment Int3() here after this has been tested a little more)
2006-01-22 14:09:01 +00:00
taylor 9d16c71b18 oops, didn't notice that was out of the wrong diff 2006-01-22 01:35:23 +00:00
taylor c691641dcf warning fixage
don't Int3() when trying to set ship speed via sexp if ship is not in mission yet, this shouldn't be fatal
2006-01-22 01:33:39 +00:00
taylor 073a792c67 newline fixage 2006-01-22 01:32:07 +00:00
taylor 5944464e20 no real need to cast these so just get it right in the first place 2006-01-22 01:31:44 +00:00
taylor 72c15efe38 clear depth buffer on each page flip (may give a slight speed increase)
change error check handling again, FRED may like this better but if it starts hanging again I have another fix
little safety checks for opengl_close()
fix atexit() call for OGL closeout
2006-01-22 01:30:33 +00:00
taylor 195b8688e1 handle NULL ptr ref in debug message (needs to be reconsidered as to whether the function should actually return here or not) 2006-01-22 01:28:06 +00:00
taylor 0d810f08d2 fix temp ptr warning, untested but could possibly be less error prone in some situations 2006-01-22 01:26:15 +00:00
wmcoolmon 8d0031dcd6 Texture replacement stuff 2006-01-21 09:36:58 +00:00
taylor bc89f95379 long way to go for a simple div-by-0 fix 2006-01-21 02:43:23 +00:00
wmcoolmon 7a40fe7cdc Scripting updates; Special scripting image list; Better operator meta; Orientation type; Wing type; Texture type. Fix for MSVC7 compiling. 2006-01-21 02:22:05 +00:00
taylor 53f2b228d0 that wasn't too smart of me, move extra anim filename size check to *after* we have found an anim 2006-01-21 01:56:58 +00:00
taylor 07807a9417 don't forcefully disable multisample still (part of an old ATI fix that didn't actually fix anything) 2006-01-21 00:14:25 +00:00
taylor d0ec8435f1 fix for LuaError change, *again* ;) 2006-01-21 00:11:51 +00:00
taylor 9b299e520b fix anim filename length check, they need at least 5 extra characters for the frame number on the filenames 2006-01-20 23:47:51 +00:00
wmcoolmon 3d8e063072 Lua unloadMission() 2006-01-20 17:37:38 +00:00
taylor 7ac46baa04 gr_*_bitmap_ex() stuff, D3D side is 100% untested to even compile
several other very minor changes as well
2006-01-20 17:15:16 +00:00
Goober5000 e59ea2686b remove unreferenced variable 2006-01-20 07:50:25 +00:00
Goober5000 672d33567c fix warning message
--Goober5000
2006-01-20 07:21:33 +00:00
Goober5000 5f61c6698c reordered #include files to quash Microsoft warnings
--Goober5000
2006-01-20 07:10:34 +00:00
Goober5000 392140a3d7 sorted the #include listing again
--Goober5000
2006-01-20 06:26:41 +00:00
Goober5000 05051081d1 added a missing file
--Goober5000
2006-01-20 06:24:28 +00:00
Goober5000 b8fb4ebf0b hopefully fix the Microsoft warnings
--Goober5000
2006-01-20 06:24:01 +00:00
wmcoolmon 6a50a28799 Updated FREDStubs.cpp to most current version 2006-01-20 05:35:59 +00:00
wmcoolmon 53f33c6529 Added FRED2 project file to CVS for MSVC7 2006-01-20 05:34:42 +00:00
Goober5000 2f7f66b429 fixed a sexp help message
--Goober5000
2006-01-20 04:33:21 +00:00
wmcoolmon 6032276576 GCC compile fixes 2006-01-20 03:48:35 +00:00
wmcoolmon 6f99c4e3f1 Faster object handles 2006-01-19 22:25:01 +00:00
wmcoolmon f4f8d28209 More Lua checks; added Lua vector object; better operator support. 2006-01-19 20:18:12 +00:00
wmcoolmon d5425998f9 Lua debugging stuff; gr_bitmap_ex stuff for taylor 2006-01-19 16:00:04 +00:00
taylor c954cf4088 don't attempt to draw glowpoints or engine glows when in wireframe mode (this may need to be a flag or something, but I'm not sure) 2006-01-19 14:06:33 +00:00
taylor 34bf938f98 better error handling for OGG Voris files 2006-01-19 11:49:12 +00:00
wmcoolmon 4c5e6bae52 Possible overflow check 2006-01-19 05:40:19 +00:00
phreak fc5414c2fc gr_render_buffer shouldn't be returning values if it's supposed to return void 2006-01-19 03:20:49 +00:00
phreak ddd208201e give repair-subsystem and set-subsystem-strength a fourth optional parameter used to possibly regenerate the submodel of a given subsystem
sabotage-subsystem should make the subsystems explode
2006-01-19 03:17:12 +00:00
phreak a09468be15 obj_script_set_global() should have an #ifdef/#endif USE_LUA pair in the function body. 2006-01-19 03:15:31 +00:00
Goober5000 4bbf5da5ba whoops, messed up the paths
--Goober5000
2006-01-19 02:51:00 +00:00
Goober5000 8645d371dc import FRED2 back into fs2_open module
--Goober5000
2006-01-19 02:27:38 +00:00
Goober5000 ffd76acd92 add lowercase .ico file 2006-01-19 02:00:39 +00:00
Goober5000 d6b7619ad1 remove uppercase .ico file 2006-01-19 02:00:00 +00:00
taylor 261ec77c66 this is probably going to end up doing something bad again when switching mods, hopefully it's not still necessary though 2006-01-18 17:45:01 +00:00
taylor 945d2e0f99 oops! :) 2006-01-18 16:36:32 +00:00
taylor 3228a365bb use HTL wireframe view if in HTL mode 2006-01-18 16:17:33 +00:00
taylor bf6ecae647 allow gr_render_buffer() to take TMAP flags
let gr_render_buffer() render untextured polys (OGL only until some D3D people fix it on their side)
add MR_SHOW_OUTLINE_HTL flag so we easily render using HTL mode for wireframe views
make Interp_verts/Interp_norms/etc. dynamic and get rid of the extra htl_* versions
2006-01-18 16:14:04 +00:00
taylor bc115d988e if a weapon model isn't loaded then be sure to load it in weapon_create() (catches a few weird weapon setups) 2006-01-18 16:02:26 +00:00
taylor b7832b7730 support only PCX for the nebula background graphics (given how it works that's the fastest and easiest way to get it done) 2006-01-18 16:01:14 +00:00
taylor 3ade8b5d0e show poly flag setting was reversed 2006-01-18 15:59:33 +00:00
wmcoolmon 5c51bb7c9e Various scripting updates 2006-01-18 06:13:18 +00:00
wmcoolmon c8c7be9b3f Switch ballistic weapon hudgauge to show "Energy" field in place of pure-energy weapons 2006-01-17 17:41:05 +00:00
wmcoolmon c451e89322 Better state handling; added GameInit hook 2006-01-17 07:28:39 +00:00
wmcoolmon 540cfa86c1 Various minor improvements 2006-01-17 07:10:01 +00:00
wmcoolmon c91c1d14e5 Removed #ifdef around Object_type_names extern 2006-01-17 04:11:26 +00:00
phreak 3d12a5038f Make sure the rearm eta isn't recalcuated until the player docks again with a support ship 2006-01-17 03:48:25 +00:00
phreak 70c843a92d Modified the formatting for the rearm countdown timer once docked. 2006-01-17 03:46:56 +00:00
phreak ffef71b0e0 Rearranged the rearming code so it doesn't potentially take 2 minutes to reload a single bomb. 2006-01-17 03:45:32 +00:00
wmcoolmon 1fba6643ff data/scripts directory 2006-01-17 02:33:20 +00:00
taylor 61513eda31 well that was super smart of me 2006-01-17 01:31:43 +00:00
wmcoolmon 1fd2e6183a Fix scripting; Tidy up scripting.html; Replace various functions with virtual variables 2006-01-17 01:31:20 +00:00
wmcoolmon 7152f462ac drawText => drawString 2006-01-16 23:29:06 +00:00
wmcoolmon 84509ecb1b Added support for setting handle variables with LUA_VAR; added support for array indexing with LUA_INDEXER; use LUA_SETTING_VAR to check whether in setting mode for both. Cleaned out older code 2006-01-16 21:26:19 +00:00
taylor d12146c399 some minor changes to model_should_render_engine_glow(), better safety checks, support for disrupted engines
check to see if a particular engine is disabled/destroyed/disrupted before making engine wash for it
2006-01-16 20:57:03 +00:00
taylor 788346132d compile fix 2006-01-16 20:54:58 +00:00
wmcoolmon 61b0961b1b Use obj_script_set_global for "plr" and "slf"; remove Lua variable if variable goes to NULL 2006-01-16 11:16:07 +00:00
wmcoolmon 76b72c21a1 Changed object's "getType" to "getBreed" to avoid confusion 2006-01-16 11:12:46 +00:00
wmcoolmon 566683d944 Can't forget #End! 2006-01-16 11:07:37 +00:00
wmcoolmon a532dfe749 Various warning fixes, scripting globals fix; added "plr" and "slf" global variables for in-game hooks; various lua functions; GCC fixes for scripting. 2006-01-16 11:02:23 +00:00
phreak 725f48d83f Only display the capped normal message in debug builds 2006-01-16 07:46:03 +00:00
Goober5000 22a6ee7e4b use IFF colors in escort list 2006-01-16 05:54:21 +00:00
taylor cb56528cd5 correct get/set sample math, it expects 8-bit sizes so we have to convert to/from actual 2006-01-15 21:22:22 +00:00
taylor f199e105d6 another NULL VEC3D warning fix 2006-01-15 18:56:45 +00:00
taylor 6822ac268e fix compile issues from bad constructor
make sure ai_actively_pursues gets filled for modular tables too
fix NULL ptr reference when parsing ship type which doesn't exist and is set to not create
2006-01-15 18:55:27 +00:00
taylor 2c49f2319e fix stuff_boolean() debug spew 2006-01-15 18:53:19 +00:00
Goober5000 6e32da638d fix some tweaky thing that isn't even used :p
--Goober5000
2006-01-15 01:02:01 +00:00
wmcoolmon 26cc1a7742 Special shockwave and moving capship bugfix, (even more) scripting stuff, slight rearrangement of level management functions to facilitate scripting access. 2006-01-14 19:54:55 +00:00
taylor 9d85cfe870 minor OGL lighting fix 2006-01-14 19:25:55 +00:00
wmcoolmon a05865d418 Allow RunByteCode to return an argument 2006-01-14 10:35:41 +00:00
wmcoolmon a113b16c2b New Lua feature - globals control. 2006-01-14 09:21:27 +00:00
taylor a8528fac46 make sure rship gets initialized before use 2006-01-14 06:25:11 +00:00
taylor 83f75aae47 get object vars correct 2006-01-14 06:24:27 +00:00
taylor b18cf46162 be sure to account for skipped mipmap levels in calculation of textures in VRAM 2006-01-14 06:23:39 +00:00
Goober5000 aa3218101d tweaky tweak
--Goober5000
2006-01-14 05:36:06 +00:00
phreak 01cacc1109 Tried to make the sphere size more uniform on opposite ends of the orb
Modified the radar disruption angle scale a bit.  Went from 200 degree to 20 degree disruption.  Otherwise, it was very confusing to find hidden objects.
2006-01-14 04:44:29 +00:00
phreak 0b6c4a0811 Make orb radar mode drawing again.
Clarify "fudge" variable used for viewing transformations
2006-01-14 03:28:29 +00:00
wmcoolmon a432a38e83 Grr...fix out-of-sync game states 2006-01-14 01:51:49 +00:00
wmcoolmon 22fa83c886 Added a few more functions 2006-01-14 01:20:16 +00:00
wmcoolmon bb2b1919f3 Oops 2006-01-14 01:15:11 +00:00
wmcoolmon 3523f2a381 Campaign scripting functions 2006-01-14 01:12:35 +00:00
taylor e2ce25bd66 move SDL autoconf checks up so we get the defines earlier
fix some Lua build problems on Linux (enabled by default now, but with configure option)
newline fixage
comment fixage
2006-01-13 14:19:34 +00:00
taylor 9a1462c758 hmm, didn't put much thought in that the first time, this should work closer to the original but still be cleaner 2006-01-13 13:06:15 +00:00
taylor 2f0bc312ea fix hud comm message screwups (missing support ship, no coverme, etc) that was part :V: bug and (bigger) part Ship_types related bug 2006-01-13 11:09:45 +00:00
taylor e8e2af7762 swap order of pilot read and reset-to-defaults so that the various entries in the pilot file don't get clobbered needlessly 2006-01-13 08:27:43 +00:00
wmcoolmon 8a8811b346 More scripting stuff 2006-01-13 04:46:17 +00:00
Goober5000 daedc76eba add a necessary #ifdef
--Goober5000
2006-01-13 04:36:21 +00:00
Goober5000 6070ee973e oops
--Goober5000
2006-01-13 04:12:23 +00:00
Goober5000 ce7cb583d8 remove FS2_VOICER define by default; this should really be kept in local copies
--Goober5000
2006-01-13 04:11:49 +00:00
Goober5000 af29186ae5 übercommit of custom IFF stuff :) 2006-01-13 03:31:20 +00:00
Goober5000 ad4da02782 formatting, meh
--Goober5000
2006-01-13 02:56:01 +00:00
wmcoolmon d6a9bc8b97 Even more scripting stuff. 2006-01-12 17:42:56 +00:00
wmcoolmon e348177e06 Finished committing codebase 2006-01-12 04:18:10 +00:00
wmcoolmon 0d61ee4b41 Oops, missed a file 2006-01-12 04:16:27 +00:00
wmcoolmon a579001520 Fix bug with float return; update scripting.html format 2006-01-11 22:09:41 +00:00
wmcoolmon a7f066cad7 More scripting functions, various scripting enhancements 2006-01-11 21:24:37 +00:00
wmcoolmon 92e7163230 Made turret handling code more descriptive 2006-01-11 21:23:43 +00:00
wmcoolmon 71b6357623 Somewhat better turret comments 2006-01-11 21:15:15 +00:00
taylor cc47681a4b allow for an equals value in qsort() comparison function, will hopefully fix Enif station bug and not cause any new problems 2006-01-11 05:42:17 +00:00
taylor c7b527fd64 use cf_find_file_location() check instead of cfopen() for is_spary_hi check 2006-01-11 05:40:59 +00:00
taylor 60ad956c3e newline fixage 2006-01-11 05:40:09 +00:00
taylor 2a0ff30b8e skip ourselves in hostile check, this isn't really needed since it's handled by the next check but for clarity sake it's here now 2006-01-11 05:39:49 +00:00
wmcoolmon 58df873315 Complete the HUD scripting hook. (Eight lines of code, and I still miss three of them. :P 2006-01-11 01:35:53 +00:00
randomtiger 0146194f66 Took demo compile flag off. 2006-01-10 18:39:40 +00:00
randomtiger 94503d5da6 Improvements to voice recognition system.
Also function put on -voicer launcher option.
2006-01-10 18:37:46 +00:00
phreak c7ed7640e1 Fixed a logic error when dealing with non-targetable subsystems 2006-01-10 01:23:09 +00:00
phreak dfd3306f4f Add the argument for alpha color when using set-jumpnode-color. This was defaulting to some junk value and making the jumpnode disappear. 2006-01-10 00:12:08 +00:00
phreak 9ef6ca64d1 Argument checking when setting jumpnode color. 2006-01-10 00:11:03 +00:00
phreak 9782a6b52e Remove tertiary weapons in their current form, I want something more flexable instead of what I had there. 2006-01-09 04:54:51 +00:00
phreak 69b36d1824 fix compile warnings. 2006-01-09 04:52:34 +00:00
taylor 89e4543401 newline fixage 2006-01-08 13:05:41 +00:00
taylor f8af83a132 make sure that thrusters will still render with a missing primary bitmap if they have a primary glow 2006-01-07 12:48:04 +00:00
taylor 38514b3511 I refuse to comment on my own stupidity! (fixes music interruption) 2006-01-06 11:25:29 +00:00
wmcoolmon 51f843c9ca turret-target-order SEXPs, ship thrusters 2006-01-06 04:18:55 +00:00
taylor 3ff670c687 make Split_ships[] dynamic (wouldn't have been a big deal to just bump the limit, but what the hell) 2006-01-05 11:34:44 +00:00
taylor 0be24fea31 add a .cvsignore file for lua so there isn't a worry of commiting something bad 2006-01-05 08:06:03 +00:00
wmcoolmon 01236d638f Fix supercap 2006-01-05 05:54:16 +00:00
taylor ea4659474f allow both +Pri style and original style (+Normal, etc) for species_defs TBMs
allow for "<none>" as a bitmap/anim name, to have no effect
fix ship/weapon thruster rendering to handle missing primary animation and/or glow graphics
2006-01-05 05:12:11 +00:00
wmcoolmon f3c13f173a Flak weapons only use detonation range if targets are further away than $Det range 2006-01-04 21:48:36 +00:00
taylor de4dadf744 fixes for regular texture replacement 2006-01-04 08:19:22 +00:00
taylor 3a90aac9aa fix files corrupted by RTs commit 2006-01-03 23:24:54 +00:00
taylor 6a6101a250 oops, should have been checking my logs on that one, fixes minor GL error 2006-01-03 22:46:52 +00:00
randomtiger b04f429d2b Fixed bad phrases path 2006-01-03 20:13:23 +00:00
randomtiger a150b020e2 Removed bad phrases.cfg reference 2006-01-03 18:09:31 +00:00
randomtiger 2ed66e92a0 Added voice recognition functionality for Visual C6 project only.
Currently still a work in progress.
2006-01-03 17:07:11 +00:00
taylor be24147515 weapon precedence wasn't getting read in on normal weapon.tbl parse, should fix the missing primary weapons in early retail missions 2006-01-03 06:02:59 +00:00
taylor 1081bfb4b1 fix freaky nan error on line drawing where model would get loaded on second entry into WS screen when it should be animation 2006-01-03 06:02:00 +00:00
taylor 5b2fc86332 fix a couple of minor mipmap problems
add resizing with mipmaps rather than a physical change in memory when detail levels dictate scaling (maybe this won't blow up)
2006-01-03 02:59:14 +00:00
taylor 277994cc42 can't overwrite node var here, it's original value is needed later and was throwing out NULL chars in the Warning()s 2006-01-02 21:28:52 +00:00
taylor e6fc6e112d remove ALUT headers, we don't it anyway and it's not included with OpenAL anymore 2006-01-02 07:26:43 +00:00
taylor f4eb204370 don't specify a read buffer, something with this is screwing up ATI cards, a debug string should satisfy a hunch
ifdef out the bumpmap stuff, it's very wrong anyway :)
2006-01-02 07:25:11 +00:00
taylor 6546209fca use cf_find_file_location() for objecttypes.tbl rather than a cfopen()
fix a few compiler warning messages
2006-01-02 07:16:43 +00:00
taylor cc0539bd2f make sure we clear out the vertex used to render a sun (just to be on the safe side)
use parse_modular_table() for -str.tbm
2006-01-02 07:13:38 +00:00
taylor 8937061e7c those blasted Windows programmers! ;) 2006-01-02 07:12:24 +00:00
taylor 24a51079f3 start of DDS volume/cube map support (rest of this needs code not ready for CVS but this will be needed later) 2006-01-02 07:11:41 +00:00
phreak bf8e759daf add def_files.h and def_files.cpp to code project. 2006-01-02 03:55:28 +00:00
phreak f763434e89 this should have an ifdef/define/endif block 2006-01-02 03:54:27 +00:00
wmcoolmon 29cea0d232 Changed num-within-box wing function 2005-12-31 01:49:53 +00:00
wmcoolmon bfd966dc45 num-within-box 2005-12-31 01:47:35 +00:00
taylor 4bfa879248 forgot to include autoconf/automake versions 2005-12-30 10:12:53 +00:00
taylor edd4729029 update Linux build steps 2005-12-30 10:11:02 +00:00
taylor 00531000b1 add def_files 2005-12-30 09:57:53 +00:00
wmcoolmon f9410e1ea3 Assert -> parse warning 2005-12-30 05:40:19 +00:00
wmcoolmon b6bf0aaba0 Updated MSVC projects 2005-12-30 00:53:00 +00:00
taylor d3e8f3a35e we are using gouraud lighting here so be sure to set the proper tmap flag (fixes D3D, corrects OGL) 2005-12-29 20:12:51 +00:00
wmcoolmon 2e77457f49 Fix(?) shiptypes.tbl crash on startup 2005-12-29 12:44:45 +00:00
wmcoolmon 0b858ba513 Codebase commit, most notably including objecttypes.tbl 2005-12-29 08:08:42 +00:00
taylor 1c1c50e39f add <gamedir>/screenshots support and save screenshot images in TGA rather than BMP format 2005-12-29 07:58:02 +00:00
taylor dbb52132e4 put texture filter debug message back (was commented out for some reason in phreak's commit) 2005-12-29 04:33:15 +00:00
phreak aa8c7e0331 loading code for flipped briefing icons. 2005-12-29 00:56:45 +00:00
phreak 460524986d mirror parameter in hud_anim_render(). only used when briefing icons are fading in. 2005-12-29 00:54:08 +00:00
phreak 40e4c92b1d changed around aabitmap calls to accept a "mirror" parameter. defaults to false, and is only true for mirrored briefing icons.
If the mirror param is true, then the picture is mirrored about the y-axis so left becomes right and vice versa.
2005-12-29 00:52:57 +00:00
phreak bd3320579e Briefing icons can now be mirrored so one can point them in the opposite direction. 2005-12-29 00:49:43 +00:00
taylor d04fe382b0 add support for a species_defs modular table with XMT support (*-sdf.tbm) 2005-12-29 00:01:29 +00:00
taylor 6e6ed4cd76 handle case where we make an atexit (on failure) flush call before the texture system is initted 2005-12-29 00:00:18 +00:00
taylor 17be7fd87e getting tired of having to ifdef the snprintf/_snprintf thing that Microsoft can't do right 2005-12-28 22:34:01 +00:00
taylor 97a4b4d4e8 properly deal with post-89 TGA images which have extra extension and developer info in the file 2005-12-28 22:32:37 +00:00
taylor 00452e781b unused variable (to make GCC shut up) 2005-12-28 22:31:03 +00:00
taylor 7b67285676 add fl_tan() for getting the tangent of a float since it's terribly inaccurate to just use tan() on a float 2005-12-28 22:30:24 +00:00
taylor f5bb9d1092 add support for glCompressedTexSubImage2D(), we don't use it yet but there is nothing wrong with adding it already
better support for mipmaps and mipmap filtering
add reg option "TextureFilter" to set bilinear or trilinear filter
clean up bitmap_id/bitmap_handle/texture_handle madness that made things difficult to understand
small fix for using 24-bit images on 16-bit bpp visual (untested)
2005-12-28 22:28:44 +00:00
taylor a44ddee6ad save screenshots into <gamedir>/screenshots/
another attempt at fixing popups with single colors (saves memory too, hope it doesn't blow up)
add a debug msg about mipmap filter in use
2005-12-28 22:24:48 +00:00
taylor 7e8f6f8643 clean up the EVENT and STATE names so we don't have to manually backtrack the number during debugging 2005-12-28 22:22:34 +00:00
taylor b93e2dfc4e Oops, bit of debug stuff I didn't mean to commit (but something similar is needed so you'll it again) 2005-12-28 22:21:04 +00:00
taylor d7b35bcd30 deal with cf_find_file_location() changes
add a central parse_modular_table() function which anything can use
fix up weapon_expl so that it can properly handle modular tables and LOD count changes
add support for for a fireball TBM (handled a little different than a normal TBM is since it only changes rather than adds)
2005-12-28 22:17:02 +00:00
taylor 07fd2703b8 properly deal with non-compressed images with mipmaps (image size didn't include mipmaps before 2005-12-28 22:07:46 +00:00
taylor bfdce36d7a fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;)) 2005-12-28 22:06:48 +00:00
taylor 9cc0ca14f8 allow for 24-bit user created bitmap images
make sure we have proper memory size requirements for non-DDS EFFs
2005-12-28 22:04:00 +00:00
taylor ce66dd2a79 fix a couple of beam section issues when using modular tables 2005-12-24 04:18:57 +00:00
taylor 3dab81ffd6 one more attempt to fix screenshots on Radeons. 2005-12-22 19:15:20 +00:00
taylor 38c055f375 changes to add Lua
don't use compatibility SDKs
2005-12-22 04:36:03 +00:00
taylor 06cc47cb8e more big-endian fixes
fix the totally retarded check I made for multi fighter beams (they really don't work right yet anyway) since it broke normal beams for clients
2005-12-22 04:35:04 +00:00
taylor c36a750528 MSVC6 was being a pain about this 2005-12-22 04:33:12 +00:00
taylor 9f5120bce0 GCC knows that fix == int so it hates the utility functions here, for sanity sake just rename them to type specific to avoid rampant casting 2005-12-22 04:32:44 +00:00
taylor 510e73bc4d add the name of the modular table about to be parsed to the debug log
a missing weapon_expl table should just be a note in the debug log rather than a popup warning
2005-12-21 08:27:37 +00:00
taylor 0fa789719a allow the show-all hotkey to work on all techroom tabs
address a couple of possible memory leak issues that could have come up in the future
2005-12-21 08:24:51 +00:00
wmcoolmon 6f7789c15f Swap beam fixed/animation image loading order 2005-12-18 20:13:26 +00:00
wmcoolmon 5708960152 Added +nocreate and more verbose index handling for beam sections 2005-12-17 00:59:48 +00:00
wmcoolmon 2df70ccbcc Better handling of beam overrides (bm_unload textures as they are replaced) 2005-12-17 00:50:55 +00:00
taylor a5ea507b3c ehh, didn't ever fix that to my satisfaction, bastardize it until more work can be done (so people don't start filing bug reports) 2005-12-16 16:34:35 +00:00
taylor 184f09346e apply at least some lighting to ship insignias rather than them being full bright 2005-12-16 06:54:10 +00:00
taylor 62f3fc0791 fix a NULL pointer crash from shipselect screen
make sure to reset "display_type" for weapon select since it would only render one ship correctly
  (still something wrong here WMC, try using models without -ship_choice_3d, everything is positioned too high on screen)
2005-12-16 06:51:31 +00:00
taylor ed324d0c54 "House Keeping!!"
- minor cleanup of things that have bothered me at one time or another
  - slight speedup from state switching
  - slightly better specmap handling, fixes a couple of (not frequent) strange and sorta random issues
  - make sure to only disable HTL arb stuff when in HTL mode
  - handle any extra lighting pass before spec pass so the light can be applied properly
2005-12-16 06:48:28 +00:00
wmcoolmon b4de1efa92 Keep a crash from happening if POF file isn't initially specified 2005-12-16 03:36:21 +00:00
taylor 2880736beb fix limits checking messages to actually be useful and hit sooner (wireframe view of some hi-poly models was going out-of-bounds from normals) 2005-12-15 16:31:03 +00:00
taylor 1d81f99bb8 make sure we always disable all VBO related elements to avoid crashing (new that was a problem, did it anyway, me == stupid) 2005-12-15 16:27:45 +00:00
taylor 79a49487a3 didn't mean for that to hit CVS, it makes neb missions work a little strange 2005-12-15 16:26:35 +00:00
phreak aba39cfc32 Countermeasres parameters. Lets users specify how easily missiles are spoofed by countermeasures
A missile is given a seeker strength.  Aspect default of 2.  Heat default of 3.  This is a missile's resistance to spoofage
A countermesaure is given an effectiveness for each type.  The defaults for countermeasure heat and aspect effectiveness are both 1.
Also gave the countermeasure an effective range.  Default is 300 meters.

A missiles chance of being spoofed is calculated by <cm type effectiveness>/<seeker strength>
So by default, 1/2 of aspect seekers will be fooled by a countermeasures, while 1/3 of heat seekers would be spoofed by default.

Also i gave the option of aspect missiles having a view cone different from 180 degrees.  This parameter is optional and doesn't effect anything already there.
2005-12-15 06:03:50 +00:00
phreak b39b8288e9 [V] can't spell 'turret' 2005-12-15 04:31:05 +00:00
wmcoolmon 5511b65084 Added script_lua_callback 2005-12-14 20:31:18 +00:00
taylor 105460ddf0 should have tested that better, it was still finding or ignoring options that it shouldn't if they were in the wrong order on
the same source (source being the two possible cmdline_fso.cfg files and the actual args passed on the cmdline)
2005-12-14 17:58:26 +00:00
phreak e29ef7266b Handling of exit explosions for beams when a ship is about to get destroyed, or according to the code: "tooled".
Bumped beam frame collisions to 10 to compensate.
2005-12-14 08:07:33 +00:00
wmcoolmon 3fbb2aa032 Ability to disable damage particle spew on ships 2005-12-13 22:32:30 +00:00
wmcoolmon 87131bd78a Grr, how did I miss this? 2005-12-13 21:50:20 +00:00
wmcoolmon 4d0f5fbc34 Music TBL to proper XMT file (-mus) 2005-12-13 21:48:39 +00:00
wmcoolmon 1ce86ebf14 Minor XMT-engine wash fix 2005-12-13 20:20:20 +00:00
taylor b6cf54c25c Hmm, .triggers isn't ever malloc'd for the Ships[] copy so don't try to free it since it's actully trying to free the Ship_info[] memory instead, which is bad :)
(newer glibc just starting going monkey over this, not sure why it didn't screw up before)
2005-12-13 18:15:26 +00:00
phreak bd8ee6108d various countermeasures related fixes. Special cases needed to be handled. 2005-12-13 05:27:36 +00:00
taylor b64ed1d334 make sure that the value of model_current_LOD stays with the detail_level value so that it's properly capped when used latter
undo the locked detail level change, all of the LOD textures are cached (or should be) so that really only hurt speed rather than helping
2005-12-12 22:04:19 +00:00
taylor 7a5f8a4169 allow use of a specific LOD for ship and weapon rendering in the hud targetbox 2005-12-12 21:32:14 +00:00
taylor ab2c7112fe double free and invalid ptr reference fixage 2005-12-12 05:29:59 +00:00
taylor 66e1060a5e switch the shockwave pof and normal names back to the correct spots, this was probably causing some
3-D shockwave usage issues since they wouldn't have rendered
2005-12-08 15:33:39 +00:00
taylor d3087989cd fix several bad crash related problems from WMC's commits on the 4th 2005-12-08 15:17:35 +00:00
taylor 4fbf8b61da a few game_busy() changes 2005-12-08 15:11:29 +00:00
taylor 3a1132516a add APPLE_client_storage support to improve texture performance and reduce memory usage a tiny bit on OS X 2005-12-08 15:10:07 +00:00
taylor 1f1d561250 signed->unsigned compiler warning fix 2005-12-08 15:08:39 +00:00
taylor 20f7523e73 remove GL_NO_HTL define since it's basically useless at this point and can produced non-functioning builds
minor cleanup and readability changes
get Apple GL version change in CVS finally, the capabilities of an Apple GL version don't neccessarily correspond to it's features
2005-12-08 15:07:57 +00:00
taylor 55659b0063 fix last bit of recent spec issue 2005-12-07 12:40:51 +00:00
taylor 9562408f1a partial spec fix, can't mass kill the pointers when they are still needed for the second pass (still something else wrong though)
forgot that the extra rangeelement optimization check isn't needed anymore, just look at indices since that's all we're using
2005-12-07 05:42:50 +00:00
taylor ba06d03663 bah, X sucks. I need to beef up error handling there in order to make all of the platforms happy. 2005-12-07 05:39:50 +00:00
taylor 30c4fc86f8 make sure with cmdline option check that it's the actual option (-spec was getting picked out of the -spec_* options by mistake) 2005-12-07 05:38:32 +00:00
taylor 63c52d70f9 15 individual commits, ya had know I was going to miss something :) 2005-12-06 17:53:25 +00:00
taylor efeb7bddf5 cleanup some debug log messages:
note that a nprintf() with "Warning" or "General" is basically the same thing as mprintf()
  make sure that OpenAL init failures always get to the debug log
2005-12-06 03:17:48 +00:00
taylor a2ff4d7ff5 add a couple of Assert()'s that it doesn't otherwise check for 2005-12-06 03:15:47 +00:00
taylor fb8cd02a10 fix for string overwrites with get_version_string() 2005-12-06 03:14:45 +00:00
taylor 0fd5616000 fix quite a few CFILE issues:
use #define's for path lengths when possible so it's easier to move between functions
  fix huge Cfile_stack[] issue (how the hell did that get through ✌️ QA?)
  add Int3() check on cfopen() so it's easier to know if it get's called before cfile is ready to use
  move path separators to pstypes.h
  fix possible string overruns when setting up CFILE roots
  make sure we don't try to init current directory again thinking it's a CD-ROM
  add the list of VP roots to debug log, this will undoubtedly be useful
when -nosound is use go ahead and set -nomusic too to both checks are correct
add list of cmdline options to debug log
fix possible overwrite issues with get_version_string() and remove '(fs2_open)' from string plus change OGL->OpenGL, D3D->Direct3D
2005-12-06 03:13:49 +00:00
taylor 6824ba9f02 add base support for 8-bit DDS images
clean up some DDS error messages and other minor bug/comment fixes
move bitmap stuff from pstypes.h, it makes more sense here anyway
start of 8-bit palette conversion, needs work but is here for WMCoolmon to look at and play with
2005-12-06 03:05:53 +00:00
taylor 8d84e56b7b move the pragma warnings here from pstypes.h for Windows
add indexed palette support for DDS images
2005-12-06 03:02:28 +00:00
taylor 2052e60d4f add a nomusic check to not get an error when eval on the change soundtrack sexp 2005-12-06 03:01:25 +00:00
taylor e68bc63754 get away from using CFILE here, needed this to change cfile init order 2005-12-06 03:00:09 +00:00
taylor 25a5ddc5bd sorry but the extra messages are somewhat annoying and already exist in another log anyway, disable by default 2005-12-06 02:59:10 +00:00
taylor d40b1fafed just to be on the safe side 2005-12-06 02:57:57 +00:00
taylor dcf437010a if for some reason we don't end up using a joystick then shut down the subsystem, saves a few cycles 2005-12-06 02:56:15 +00:00
taylor 06af0f80f8 little consolidation:
move path separator stuff here from cfile.h
  move the pragma warnings to config.h, since they produce warnings on anything that's not MSVC
  move the bmpman related stuff to bmpman.h, if you need this stuff you have to include bmpman.h anyway
2005-12-06 02:55:22 +00:00
taylor b912223f92 clean up some D3D debug messages to better match new OGL messages (for easier debugging)
remove D3D_32bit variable since it's basically useless and the same thing can be done another way
2005-12-06 02:53:02 +00:00
taylor 269675a79f clean up some init stuff and fix a minor SDL annoyance
make debug messages a bit more readable
clean up the debug console commands for minimize and anisotropic filter setting
make anisotropic filter actually work correctly and have it settable with a reg option
give opengl_set_arb() the ability to disable all features on all arbs at once so I don't have to everywhere
2005-12-06 02:50:41 +00:00
wmcoolmon e7ca24e86a Oops, arand should only be generated if it isn't passed to the function as well. 2005-12-05 09:09:53 +00:00
wmcoolmon b741ac411a "laser" and "missile" to "primary" and "secondary" 2005-12-05 01:54:16 +00:00
Goober5000 a31aff0d0a fix compiler error
--Goober5000
2005-12-04 22:44:00 +00:00
wmcoolmon 6e639560f3 Post-final commit 2005-12-04 19:12:53 +00:00
wmcoolmon 99cbbd5eee Final commit of codebase 2005-12-04 19:07:49 +00:00
wmcoolmon 0432da0970 Slightly better main hall error handling 2005-12-04 19:06:01 +00:00
wmcoolmon 34cb8f1554 Better weapon handling for techroom (more dynamic-limits friendly) 2005-12-04 19:05:06 +00:00
wmcoolmon fa4172c966 Better XMT beam section handling ("+Index:"); weapon shockwave armor support; countermeasures as weapons 2005-12-04 19:02:36 +00:00
wmcoolmon aae6ac2ff8 Attempt to fix OpenGL crash-on-debug-exit 2005-12-04 18:59:18 +00:00
wmcoolmon e945847322 subsystem + shockwave armor support; countermeasures as weapons 2005-12-04 18:58:07 +00:00
wmcoolmon 5328927b9b Better overhead-view handling 2005-12-04 18:55:42 +00:00
Goober5000 cbf6545219 bypass annoying warnings when loading optional models
--Goober5000
2005-12-01 07:45:21 +00:00
phreak fccd4a4a64 texturing shouldn't be on when drawing lines. 2005-11-30 03:07:54 +00:00
wmcoolmon 2a9c1bfd0f no message 2005-11-27 23:54:13 +00:00
Goober5000 9cfa585ba6 bah, forgot a colon
--Goober5000
2005-11-24 09:08:44 +00:00
Goober5000 46e1d51c6b * cleaned up mission_do_departure
* fixed a hidden crash (array index being -1; would only
be triggered for ships w/o subspace drives under certain conditions)
  * removed finding a new fighterbay target because it might screw up missions
  * improved clarity, code flow, and readability :)
* added custom AI flag for disabling warpouts if navigation subsystem fails
--Goober5000
2005-11-24 08:46:11 +00:00
taylor a2e607327a fix fred2 startup crash (we probably need to Assert() this case so it doesn't easily happen again) 2005-11-24 07:27:14 +00:00
phreak 887e1155b0 Added wiki help for -rearm_timer and -missile_lighting 2005-11-24 06:46:39 +00:00
phreak 17db6de95e Added -missile_lighting command line 2005-11-24 06:37:47 +00:00
phreak 3f9f76ca47 Apply lighting to missiles if -missile_lighting command line is set. 2005-11-24 06:37:17 +00:00
phreak cd38a1528a Forgot to add in the part where the rearm timer actually counts down. Minor oversight 2005-11-24 03:07:35 +00:00
taylor c7c3287184 yeah I know, I should have noticed that little jewel *before* the commit 2005-11-23 06:59:09 +00:00
taylor 2b6464dd6e make sure all weapons that will get used later in a mission get preloaded 2005-11-23 06:55:47 +00:00
taylor 67578d39df crash fix for using flak without having something targetted 2005-11-23 06:54:28 +00:00
taylor 35cb43c38a when using cheats be sure to properly load up all weapons that aren't already paged in 2005-11-23 06:53:22 +00:00
phreak a7013311e7 whoops i should test my code sometimes 2005-11-23 04:05:23 +00:00
phreak 91eccb9262 Added the function to estimate rearm and repair time. 2005-11-23 01:06:58 +00:00
phreak cff54cf6c9 Player repair rearm completion timer display added. 2005-11-23 00:49:51 +00:00
phreak 3073135022 Calculate player repair timer when the support ship docks to him. 2005-11-23 00:46:26 +00:00
phreak 9ddcfc01ea Command lines for rearm countdown timer. 2005-11-23 00:43:20 +00:00
taylor 2c8bd98cf8 yuck, ugly mistake on my part (thanks Goober!) 2005-11-22 04:50:52 +00:00
taylor ff90e21eca combine weapon_info_close() and weapon_close()
changes to allow use of weapon_expl.tbl and the modular table versions once more
 - the tables aren't required (but a warning will be produced if weapon_expl.tbl doesn't exist)
 - don't back load LODs, if it's not there then don't use it
 - handle a couple of error conditions a bit better
2005-11-22 00:01:11 +00:00
taylor 846ec383d7 some minor thruster cleanup, if you could actually use the term "clean" 2005-11-21 23:57:26 +00:00
taylor 10123cf66c move generic_* functions to their own file 2005-11-21 23:55:57 +00:00
taylor ec65c19f10 add generic.cpp and generic.h 2005-11-21 23:55:00 +00:00
taylor ac90d7c2ee little cleaner, lot more friendly to 64-bit archs (long type is usually 64-bit there) 2005-11-21 15:01:18 +00:00
taylor 06de274c17 add ai_profiles.cpp/.h 2005-11-21 14:57:08 +00:00
taylor 41c0baed84 i minus u ;) (should fix overzealous directives list) 2005-11-21 13:04:08 +00:00
Goober5000 85b947e158 remove old files
--Goober5000
2005-11-21 03:51:03 +00:00
Goober5000 163d3b715b bah and double bah
--Goober5000
2005-11-21 03:47:51 +00:00
Goober5000 4798d73423 and the project file
--Goober5000
2005-11-21 02:46:36 +00:00
Goober5000 c6acc068ff change from "setting" to "profile"; this way makes more sense
--Goober5000
2005-11-21 02:43:37 +00:00
Goober5000 367141fa5a add a flag to re-enable shockwaves damaging subsystems (from FS1)
--Goober5000
2005-11-21 01:53:57 +00:00
Goober5000 7ad17cb439 whoops
--Goober5000
2005-11-21 00:52:19 +00:00
Goober5000 8a66799d66 add ai_settings.tbl
--Goober5000
2005-11-21 00:50:02 +00:00
taylor 4105f02814 get rid of the while() loop, OGL doesn't stack errors (this killed FRED2 for some reason even though no error was present) 2005-11-18 13:13:47 +00:00
Goober5000 a16c0a96ec Wiki links updated; many thanks to StratComm :)
--Goober5000
2005-11-18 08:03:23 +00:00
Goober5000 5504a6a99e made arrival invalidation more efficient
(probably only a small speedup, but meh)
--Goober5000
2005-11-18 07:53:27 +00:00
taylor dbeca4632d fix for thruster glows (affecting TBP mainly but OC as well):
- thruster glows should always come from ship entry rather than species (it will be initted by the species entry at first)
 - this obviously needs some work done on it but that gets dangerously close to a rewrite and that isn't something I have time for
2005-11-17 20:52:02 +00:00
wmcoolmon df8100e85a Small fix for XMTs 2005-11-17 05:12:42 +00:00
taylor 5a949b253b fix crash on kamikaze deaths 2005-11-17 02:31:36 +00:00
taylor 9ed6849224 correct a little EFF fubar from my -img2dds commit
vocalize EFF loading errors so that they get noticed and fixed sooner
2005-11-17 02:30:49 +00:00
taylor 1220b2fa4c pretty sure my brain wasn't working that day 2005-11-17 02:29:21 +00:00
taylor 989e19c06a don't try to apply a shockwave force if there is no actual force to apply, avoids needless math and fixes a NULL vec3d warning 2005-11-16 21:27:31 +00:00
taylor 5ecaf658f4 switch from strchr() to strrchr() for extension checks in order to allow for multiple periods in a filename 2005-11-16 21:25:34 +00:00
taylor 8817a12cab allow for badly encoded ADPCM files if it was otherwise decoded properly 2005-11-16 09:16:24 +00:00
taylor 0a7c13004c umm, no one saw that, right? :) 2005-11-16 07:45:35 +00:00
taylor 232901ac61 bunch of error checking and code cleanup for the team stuff in ship/weapon select 2005-11-16 05:46:27 +00:00
taylor 41fec4840e didn't mean for that to hit CVS, stops FRED2 from crashing on exit 2005-11-14 08:39:00 +00:00
taylor 25bb1cf68c now able to build with OpenAL 1.0 and 1.1 thanks to newer OpenAL CVS changes (patch from icculus.org FS2 mailing list) 2005-11-14 05:12:01 +00:00
Goober5000 1fb4f808bc fix the icons.tbl bug
--Goober5000
2005-11-13 23:02:04 +00:00
Goober5000 4aab3c2c04 this should fix the no-warp-effect bug
--Goober5000
2005-11-13 22:27:17 +00:00
taylor 416eec60a0 cmdline option cleanup:
remove from launcher -pcx32, -cell, -UseNewAI
remove from game -loadonlyused, -dxt, -pcx2dds
rename -d3dmipmap, -d3d_no_vsync, -dnoshowvid to non API specific sounding names
add -nograb into help output under Linux/OSX
add -loadallweps and -img2dds
2005-11-13 06:55:38 +00:00
taylor da42be1b24 minor cleanup and comment cleanup about bpp usage 2005-11-13 06:52:06 +00:00
taylor ff5b2e3453 don't fail if not a starfield pof to load, regular starfield bitmaps don't hard fail so this shouldn't either 2005-11-13 06:50:57 +00:00
taylor 11c2f28b23 small big-endian fix 2005-11-13 06:49:32 +00:00
taylor 034170c1fa -loadonlyused in on by default now, can be turned off with -loadallweps 2005-11-13 06:49:05 +00:00
taylor 8d44e11441 make sure that we don't get "-transport" in with the transparent filename check (TBP bug) 2005-11-13 06:47:26 +00:00
taylor 4c720500fd some minor movie cleanup, not what I would like but enough for now 2005-11-13 06:46:10 +00:00
taylor 16c4614476 minor cleanup of old code and consolidate the texture compression checks into this one place 2005-11-13 06:45:24 +00:00
taylor 940b77cfc2 small bit of EFF cleanup
add -img2dds support
cleanup some D3D stuff (missing a lot since the old code is so unstable I couldn't get it working like I wanted)
some minor OGL cleanup and small performance changes
converge the various pcx_read_bitmap* functions into one
cleanup/rename/remove some cmdline options
2005-11-13 06:44:18 +00:00
taylor dfb2ca06fe add support for 8/16/24/32 bit output from ani frame decoder 2005-11-13 06:40:19 +00:00
taylor 7537edc256 remove Cmdline_cache_ani support, it only worked if not in a VP and only on streaming ani so it was pretty much useless 2005-11-13 06:39:38 +00:00
taylor 0b91ca7664 never did port this stupid thing to PPC 2005-11-13 06:38:04 +00:00
taylor 3c1271a338 always produce BGR ordered images rather than RGB 2005-11-13 06:37:24 +00:00
taylor f2d6ad844c add LUA building for MSVC6 2005-11-13 06:36:52 +00:00
phreak ec909ec855 LuaError() body should not be compiled into the code unless USE_LUA was defined in the project file. 2005-11-13 05:25:59 +00:00
wmcoolmon c8b032291d More warnings instead of Int3s/Asserts, better Lua scripting, weapons_expl.tbl is no longer needed nor read, added "$Disarmed ImpactSnd:", fire-beam fix 2005-11-08 01:04:02 +00:00
wmcoolmon e5eef67d24 Fixed capitalization 2005-11-05 11:00:50 +00:00
wmcoolmon a34135e05c Int3() --> Warning 2005-11-05 10:26:09 +00:00
unknownplayer 81a45606a3 Committed the DX9 December 2004 SDK. None of the DX9 changes have been committed however. This might break the MSVC 2003 build since DX9 and DX8 share the DX8 include files. Just eliminate one from the library paths if you have any problems. 2005-11-05 09:31:45 +00:00
wmcoolmon 982c662da0 Forgot the breathalyzer 2005-11-05 08:39:10 +00:00
wmcoolmon 74d081fd2f Fix for this old and silly bug. 2005-11-05 08:38:36 +00:00
phreak 32bd17ae17 add/remove-sun-bitmap. Also changed "Ship_arrival_list" to "ship_arrival_list" since the former technically doesn't exist due to the capital 'S'. 2005-11-05 07:42:09 +00:00
wmcoolmon 4a81216e3b Support for using Lua files for hooks 2005-11-05 05:13:05 +00:00
wmcoolmon 95dddca667 Fix(?) for checking whether a weapon is armed or not 2005-11-05 05:12:21 +00:00
wmcoolmon d961eb935a Slight optimization 2005-11-05 05:11:29 +00:00
wmcoolmon 24e9cd45ed Removed unneccessary casts 2005-11-05 05:08:58 +00:00
wmcoolmon 698a80d45a turret-change-weapon 2005-11-05 05:06:13 +00:00
Goober5000 f5b9a8636c remove unused commented stuff
--Goober5000
2005-10-31 09:12:16 +00:00
Goober5000 21fbc6eb9a bit of tweakage
--Goober5000
2005-10-31 09:09:41 +00:00
wmcoolmon 82b8c1cb49 Support for passing C pointers w/ LUA 2005-10-31 08:57:40 +00:00
wmcoolmon d098b84a0c Support for custom operators in Lua 2005-10-31 06:37:17 +00:00
Goober5000 791d40be45 stuff for comparing ship classes
--Goober5000
2005-10-30 23:45:45 +00:00
Goober5000 5628d1aabb added scripting stuff to MSVC project
--Goober5000
2005-10-30 21:05:24 +00:00
Goober5000 be3f085c96 fix the support ship spawning bug
--Goober5000
2005-10-30 20:42:45 +00:00
Goober5000 c5fa1e6a0b comment fixage 2005-10-30 20:20:44 +00:00
taylor d5de67114e add a bunch of Assert()'s and NULL checks to either help debug or avoid errors
fix Mantis bug #381
fix a small issue with the starfield bitmap removal sexp since it would read one past the array size
2005-10-30 20:03:40 +00:00
taylor 5c36f7b421 same basic cleanup and self-sanity changes
split up WinMain() and main() so it doesn't resemble ifdef hell
rename WinMainSub() to game_main() and move anything that should have been in WinMain() to WinMain()
2005-10-30 20:00:22 +00:00
wmcoolmon ab67577322 Display a special dialog if the player tries to continue a campaign with no missions 2005-10-30 19:22:31 +00:00
wmcoolmon 9bffa8b8dc Return an error if mission_campaign_next_mission() is called when the campaign has no missions 2005-10-30 19:21:45 +00:00
wmcoolmon ec299d0437 Fix scripting.html 2005-10-30 18:19:58 +00:00
taylor 1d53405076 add Lua support for automake/autoconf 2005-10-30 10:46:23 +00:00
taylor ef4203311c fix a couple of campaign savefile bugs for WMC 2005-10-30 10:45:19 +00:00
wmcoolmon 7dece4af61 Codebase commit - nebula.tbl, scripting, new dinky explosion/shockwave stuff, moving muzzle flashes 2005-10-30 07:10:20 +00:00
wmcoolmon c9b872df9f Codebase commit - nebula.tbl, scripting, new dinky explosion/shockwave stuff, moving muzzle flashes 2005-10-30 06:45:00 +00:00
Goober5000 643a4b15c4 multiple ship docking implemented for initially docked ships
--Goober5000
2005-10-29 22:09:31 +00:00
taylor 8151f7d80e Add some error checking and handling to better deal with possible problems, and to let us know what/where they are 2005-10-29 12:26:58 +00:00
taylor 07678a8f6e bullet-proof the loadout read a little bit (did this before and had it locally, must have missed CVS) 2005-10-29 12:25:49 +00:00
wmcoolmon 461332483d Safeguard against saved loadout and loadout changes. 2005-10-29 09:06:52 +00:00
wmcoolmon afb235d9cc Better alloc_block function 2005-10-29 09:02:13 +00:00
wmcoolmon 2a61be8fe8 Minor change to an assert 2005-10-29 09:00:41 +00:00
taylor f6c3b17374 hmm, didn't even notice that earlier 2005-10-28 14:52:26 +00:00
taylor 7f7cf7728a some minor cleanup and compiler warning fixes 2005-10-28 14:49:35 +00:00
taylor 2475a73098 don't do any decal processing if decals are not enabled 2005-10-28 14:48:26 +00:00
taylor e6988155c3 fix issue where GR_640 based non-standard resolutions (ie. 800x600) would use GR_1024 screen coordinates/sizes 2005-10-28 14:47:16 +00:00
taylor 8679d340f1 more TMAP_MAX_VERTS overflow protection for non-HTL usage (these are the things that need to be addressed to fix non-HTL)
fix some compiler warning messages
don't do any decal processing if decals are disabled, the math was a waste of CPU cycles in that case
2005-10-28 14:45:55 +00:00
Goober5000 78dd2bcaca nitpicked a rather dumb non-bug
--Goober5000
2005-10-28 06:10:07 +00:00
phreak e86478e0bf Added extra documentation for add-background-bitmap and add-sun-bitmap 2005-10-28 05:48:55 +00:00
phreak 976694a83b added implementation for add-background-bitmap and remove-background-bitmap 2005-10-28 05:25:27 +00:00
taylor 881eec7288 some minor fixes to message_translate_tokens(), fixes a bug and adds some out-of-bounds checks 2005-10-27 16:24:24 +00:00
taylor 1ae7853fdc go back to using abort() over exit() for Assert's and Int3's but close out SDL first this time, makes debugging much easier 2005-10-27 16:23:03 +00:00
taylor a4d405357f fix some automake errors with OSX 10.4's crappy AutoMake and a couple of other OS X related terminal compile fixage 2005-10-27 16:21:19 +00:00
taylor d60afee14d D3D missed the non-standard resolution updates for aabitmaps, should fix briefing icon positioning 2005-10-26 20:54:18 +00:00
taylor fb6be02afc convert Jpegs from RGB to BGR after read, OpenGL had a problem with this, D3D still works fine 2005-10-26 20:53:02 +00:00
taylor e541fc13ad update Xcode project with IFF stuff 2005-10-26 20:51:55 +00:00
taylor 94e211e84e make sure that XMTs don't try to still create an invalid entry when +nocreate is used 2005-10-26 00:43:06 +00:00
wmcoolmon ea0d07ea2f Bumped MAX_HOTKEY_TARGET_ITEMS 2005-10-25 01:21:52 +00:00
phreak 2cbfa525d4 implementation for nebula-change-storm and nebula-toggle-poof. looks like they're working 2005-10-24 23:28:37 +00:00
taylor 1000fd5527 init thruster stuff properly so that bmpman doesn't have a fit 2005-10-24 12:42:14 +00:00
Goober5000 c7d967b52d merge Bobboau's thruster code back in; hopefully this covers everything
--Goober5000
2005-10-24 07:13:05 +00:00
taylor 8190f89912 not sure what I was smoking there, max shininess value is 128, not 180 2005-10-24 04:48:14 +00:00
phreak 11254c3ecc Get the new nebula argument types working in fred. 2005-10-24 02:53:48 +00:00
wmcoolmon 1564e913c4 Removed max_overclock restriction related to warpout 2005-10-24 02:15:41 +00:00
taylor ee0a8f762b some cleanup, fix some general memory leaks, safety stuff and whatever else Valgrind complained about 2005-10-23 20:34:30 +00:00
taylor f0f41a4f4f fix crashes and minor slowdowns when sound is disabled (-nosound) 2005-10-23 19:08:01 +00:00
taylor 5f1e2e9f83 make AABITMAP use GL_ALPHA rather than GL_LUMINANCE_ALPHA (now 8-bit instead of 16-bit, fixes several minor rendering issues) 2005-10-23 19:07:18 +00:00
taylor d08479de39 minor cleanup to screenshot code
force front buffer reads for relevant glReadPixels() calls
2005-10-23 14:12:35 +00:00
taylor ec757ab001 add -ogl_shine to adjust the OGL shininess value so that people can play around and find the best value to use 2005-10-23 11:45:06 +00:00
taylor 636bc06e5b fix memory errors from new[]/delete[] mismatch 2005-10-23 11:44:07 +00:00
wmcoolmon a0f0735de9 Ack, missed testing compile under an Inferno build 2005-10-23 05:37:59 +00:00
wmcoolmon 55e36de866 *Fix* 2005-10-23 05:01:49 +00:00
phreak 5a329c572a add-background-bitmap and add-sun-bitmap needed scale values added
also their sexp functions should not return integers.
2005-10-23 04:48:26 +00:00
phreak 3ba27cb1e7 various background and nebula sexps
add-background-bitmap
add-sun-bitmap
remove-background-bitmap
remove-sun-bitmap
nebula-change-storm
nebula-toggle-poofs

All of these sexps are just stubs for now.
Just want to get in the commit before someone
else commits and i'll make a mess trying to merge.
Everything is compiling fine, so it shouldn't mess up anything.  But you know that murphy guy....

I've put these sexps in a new fred subcategory called "Backgrounds and Nebula"
along with the sexps "change-skybox-model" and "mission-set-nebula"
2005-10-23 04:18:23 +00:00
Goober5000 fee22cf735 made Cmdline_UseNewAI toggle the mission flag, plus fixed a few other flag-related potential bugs
--Goober5000
2005-10-22 22:25:23 +00:00
Goober5000 afde24171d rolled back UnknownPlayer's commit
--Goober5000
2005-10-22 22:22:41 +00:00
wmcoolmon 51cc626041 mission-set-nebula fixage; remainder of python code 2005-10-22 20:17:19 +00:00
taylor 172bf5db01 couple of changes to NULL vec fixes which better match what Volition would have done (makes both Goober and myself happier :))
keep track of what was an error (even if erroneous) and why with "VECMAT-ERROR" comment
2005-10-22 06:26:30 +00:00
unknownplayer b8822ebe66 Added -UseNewAI command line option to force the game to always use
the SCP AI changes. As of now there's some problem in gr_d3d_set_render_target
that crashes the game when it gets to a mission.
2005-10-22 04:28:17 +00:00
taylor a8e1459022 fix main NULL vec errors, still at least one left but these were those that happened most often:
modelinterp.cpp:parse_tmap() -> first IS_VEC_NULL() check would fail, wasn't a second on reassign
  aicode.cpp:ai_path() -> when (Pl_objp->pos == gcvp), fixed globally in vecmat.cpp:vm_vec_dot_to_point()
2005-10-21 11:32:15 +00:00
taylor b8beecfd70 fix player warpout
basic code cleanup (that previous braces change did nothing for readability)
spell "plyr" correctly
tweak warp shrink time to better match WMC's other changes and avoid the skipping during shrink
2005-10-20 17:50:03 +00:00
taylor bff09ca775 minor readability fix
plug a memmory leak and possible Polygon_models[] madness if a POF can't be found or is otherwise invalid
2005-10-20 15:33:44 +00:00
wmcoolmon 9bbe0ef033 More player warpout speed stuff 2005-10-20 06:38:18 +00:00
wmcoolmon 56b2035866 Oops, guess I didn't commit this stuff 2005-10-20 06:37:34 +00:00
taylor 57bc110209 fix some bugs with spawn type weapon assignments, particularly with TBMs 2005-10-19 20:54:06 +00:00
wmcoolmon ada07e972d Don't need this anymore 2005-10-19 04:23:05 +00:00
taylor 4e44ad6cbc make sure gamesnd_parse_soundstbl() doesn't inf-loop because of species problems
if we have missing species then report that before the end of table section check so we're sure to know what's missing
2005-10-18 14:57:32 +00:00
taylor 2cb97774ae lowercase filenames in model_load_textures()
turn texture loading debug messages back on but under "Maps" so they are easy to turn off if not wanted
2005-10-17 14:23:21 +00:00
unknownplayer 795b779779 Final update to the project files - all compile correctly on MSVC_2003
from the sources on the CVS.
2005-10-17 08:43:03 +00:00
unknownplayer 220d98fe1d Updated the files from the MSVC 6 projects - they seem to work better. 2005-10-17 08:38:17 +00:00
taylor d80d29981d dynamically allocate object collision pairs 2005-10-17 05:48:18 +00:00
unknownplayer 70eb3414b1 Added project files for MSVC_2003 - these are made from the MSVC_7 files. 2005-10-17 02:17:26 +00:00
wmcoolmon 6c1e1c13e5 Fix redmenace's compile problem 2005-10-17 02:09:29 +00:00
wmcoolmon 95bf16615a Make weapons clip less 2005-10-17 01:54:15 +00:00
wmcoolmon a9e8dc0665 Weapon models now shown in lab 2005-10-17 01:51:01 +00:00
wmcoolmon 5fb1ece53e Some cfile changes that slipped by 2005-10-17 00:13:28 +00:00
wmcoolmon 7037744bfd USE_OPENAL 2005-10-17 00:03:13 +00:00
wmcoolmon e4e606ae5c Change this back for MSVC.NET? 2005-10-17 00:02:46 +00:00
wmcoolmon 83ae7c42e9 CFile stuff 2005-10-17 00:02:09 +00:00
wmcoolmon 2b88dda60c Updated & fixed project files 2005-10-16 23:31:58 +00:00
wmcoolmon 4d6db9104b Hardened cfile against array overflows 2005-10-16 23:15:47 +00:00
wmcoolmon 67f9f87f6c Small fix for amor code 2005-10-16 23:15:13 +00:00
Goober5000 3904706464 I need to bone up on my bulletproofing
--Goober5000
2005-10-16 18:54:12 +00:00
taylor 0d948a3aae use unsigned index buffers 2005-10-16 11:20:43 +00:00
taylor 966335ce31 (NULL != (int)0); the size and type of NULL is platform and implementation dependant and should only be used for pointers!
fix naughty bug that would set the flyby sound filenames to NULL
2005-10-16 11:19:57 +00:00
taylor cc48b49fcf clean up a couple of things 2005-10-16 10:12:14 +00:00
Goober5000 6a479838f8 ship-create now generates a default name if you specify "<none>" for the ship name
--Goober5000
2005-10-16 00:32:30 +00:00
taylor e44735a96d properly handle cases where bm_make_render_target() might have failed 2005-10-15 20:53:29 +00:00
taylor 435514e90f make sure that bm_make_render_target will handle failure 2005-10-15 20:42:40 +00:00
taylor 9cfc9fc643 add error message in case the number of verts on a submodel is in excess of SHRT_MAX 2005-10-15 20:28:26 +00:00
taylor e04261ceb4 make some code a bit more readable
speed up index buffer generation just a tad (maybe 1/3rd)
2005-10-15 20:27:32 +00:00
Goober5000 d55bff80cc add weapon-create sexp
--Goober5000
2005-10-14 09:29:56 +00:00
Goober5000 730fd8491a removed an unneeded parameter and renamed some stuff
--Goober5000
2005-10-14 07:22:24 +00:00
Goober5000 f0d7b9de4c stuff for WMC: fix sexp description and three warnings; plus add some
bulletproofing to name-specified ship_create
--Goober5000
2005-10-14 07:06:59 +00:00
wmcoolmon b05a37bef0 armor.tbl work 2005-10-14 02:13:52 +00:00
wmcoolmon 86777d3528 Make ship_create not return a value 2005-10-13 23:23:32 +00:00
wmcoolmon 46804f90b7 Fixage for ship_create 2005-10-13 18:47:45 +00:00
taylor 7318a3750a new timer code that shouldn't suffer from multi-cpu (or dual core) systems
clean out all old Windows timer code since that was just a mess at this point
2005-10-12 05:45:35 +00:00
taylor 68fde5dcd5 temporary cmdline option, -y_bug_fix, to switch between original code (default) and previous attempt at the Y-bug fix 2005-10-12 05:43:40 +00:00
taylor 5c71e497e7 little cleaner since the two sets weren't needed 2005-10-11 12:24:04 +00:00
taylor 8bdf7224e6 fix memory freakage from dynamic spawn weapon types 2005-10-11 08:30:38 +00:00
wmcoolmon 3101fb61a7 Topdown updates 2005-10-11 07:43:10 +00:00
wmcoolmon 9c2e5dd3f4 Gliding 2005-10-11 05:24:34 +00:00
taylor 89621393c4 actual cmeasure fix, don't know why the hell it didn't end up other commit 2005-10-10 17:32:59 +00:00
taylor 95e056f6fd remove NO_NETWORK 2005-10-10 17:21:11 +00:00
taylor 229e448fed remove NO_NETWORK
little sanity on model_load() calls
fix cmeasure bug where a blank entry was getting added
2005-10-10 17:19:07 +00:00
taylor 24e8fa9416 remove NO_NETWORK
clean out some old debug messages that were littered about
2005-10-10 17:17:45 +00:00
taylor b256ad2aef remove NO_NETWORK
whether multi is disabled or not is now determined at runtime
clean out some crap and old debug messages that were littered about
2005-10-10 17:16:22 +00:00
taylor f56551d51b remove NO_NETWORK
fix controlconfig so that axes can be set to joystick/mouse using the mouse (required when no joystick attached)
2005-10-10 17:14:31 +00:00
wmcoolmon cb2912867e Tidied up code a bit 2005-10-10 01:14:11 +00:00
Kazan b29b104272 some weird character was on the head of weapons.cpp 2005-10-09 23:56:22 +00:00
wmcoolmon bc4c92b78f Added names to the 'limits reached' dialogs in ship/weapons.tbl 2005-10-09 17:38:49 +00:00
wmcoolmon a6e283db70 Added warpin/warpout speed values to the lab 2005-10-09 09:18:10 +00:00
wmcoolmon 0e16ea57cc Added warpin/warpout speed override values to ships.tbl 2005-10-09 09:13:29 +00:00
wmcoolmon 61a109dcb1 Minor update to ship-create description 2005-10-09 08:10:03 +00:00
wmcoolmon 3d57aefef6 New SEXP stuff 2005-10-09 08:03:21 +00:00
wmcoolmon 1e2783906d Added sexps set-object-speed-x, set-object-speed-y, set-object-speed-z,
and ship-create
2005-10-09 06:10:59 +00:00
wmcoolmon b0912a1082 Much better laser weapon/pof handling, removed a couple unneccessary
warnings (used to try and track down a bug)
2005-10-09 03:13:13 +00:00
wmcoolmon b686df2e87 Bumped MAX_PAIRS to prevent objects flying through other objects 2005-10-09 01:50:04 +00:00
wmcoolmon 0beedfa677 Extendable modular tables (XMTs); added weapon dialogs to the Lab 2005-10-09 00:43:09 +00:00
wmcoolmon d40bc8a817 Attempt to fix crash bug on 'Mystery of the Trinity' 2005-10-08 19:29:08 +00:00
wmcoolmon 4438ce571e Error checking for dock error 2005-10-08 18:46:38 +00:00
wmcoolmon 28041d497a Better readability for parse errors 2005-10-08 18:26:40 +00:00
wmcoolmon e473be185e These are no longer needed... 2005-10-08 18:25:41 +00:00
taylor f4d95bc9bb fix several asteroid problems, little code duplication but this actually works and is less error prone than the previous method 2005-10-08 15:37:26 +00:00
wmcoolmon e384b8ee28 Fix Int3() from ship-vanish 2005-10-08 05:41:09 +00:00
taylor 0c38c21ac1 make sure player death message works when using a NO_NETWORK build 2005-10-06 07:53:01 +00:00
Goober5000 a1e18b212d fixed the CTD when support is called for a ship lacking a rearming dockpoint
--Goober5000
2005-10-02 23:12:44 +00:00
Goober5000 f3f52618b7 removed a redundant action
--Goober5000
2005-10-02 23:01:17 +00:00
Goober5000 663994c0f7 juxtaposition for clarity
--Goober5000
2005-10-02 23:00:39 +00:00
taylor a71bf31824 remove -rlm, it's always on now since there was never a complaint and pretty much everyone uses it
add -cache_bitmaps and have bitmap caching between levels off by default
when -cache_bitmaps is used then use C-BMP for top-right memory listing, and just BMP otherwise
2005-09-30 09:47:06 +00:00
taylor f11038667a add iff stuff to makefile 2005-09-30 09:44:19 +00:00
Goober5000 2956626467 hooray for more work on the iff code
--Goober5000
2005-09-30 03:40:40 +00:00
Goober5000 89ba5a2e33 parsing stuff
--Goober5000
2005-09-30 03:19:57 +00:00
Goober5000 2b4a16ee61 parse fixage
--Goober5000
2005-09-29 04:26:09 +00:00
Goober5000 ed7ea880f9 fix debug warning
--Goober5000
2005-09-27 08:09:13 +00:00
Goober5000 8a3a2169e9 small fix, bah
--Goober5000
2005-09-27 06:39:23 +00:00
Goober5000 4f2b0db7ac added iff_defs to project
--Goober5000
2005-09-27 06:39:04 +00:00
Goober5000 7bb3e2fc44 initial commit of basic IFF code
--Goober5000
2005-09-27 05:25:19 +00:00
Goober5000 3423d8b641 betterizing
--Goober5000
2005-09-27 05:01:52 +00:00
Goober5000 0ed86295bb clarification
--Goober5000
2005-09-27 02:36:58 +00:00
Goober5000 ad411a41df this should fix the rest of the briefing icon bugs
--Goober5000
2005-09-26 06:00:59 +00:00
Goober5000 c90b03a218 small fix
--Goober5000
2005-09-26 05:24:25 +00:00
Goober5000 ab99d4877f moved these per taylor's recommendation
--Goober5000
2005-09-26 04:53:19 +00:00
Goober5000 887d687e09 some more cleanup
--Goober5000
2005-09-26 04:51:00 +00:00
Goober5000 633954fdf1 some more cleanup
--Goober5000
2005-09-26 04:08:54 +00:00
Goober5000 9a25153e9a okay, this should all be working :)
--Goober5000
2005-09-26 02:15:03 +00:00
Goober5000 fa303129e6 and again, gah
--Goober5000
2005-09-25 23:02:29 +00:00
Kazan 8c918ef816 my bad 2005-09-25 22:29:35 +00:00
Goober5000 dd63695d6a more fiddly stuff
--Goober5000
2005-09-25 22:24:22 +00:00
Kazan f560aff0c5 correct an error 2005-09-25 22:23:39 +00:00
taylor 08e1f23065 gah. 2005-09-25 21:00:40 +00:00
Goober5000 e52a9ae599 oh noes!
--Goober5000
2005-09-25 20:55:28 +00:00
Goober5000 c31f5ab505 taylor forgot something ;)
--Goober5000
2005-09-25 20:42:57 +00:00
Goober5000 a2e6884321 okay; everything should be good to go
--Goober5000
2005-09-25 20:31:42 +00:00
taylor 077b97f304 GCC fixage, my Whiffle Bat that was saved for Bobboau's constant breaking is currently getting "Goober5000" etched into it :) 2005-09-25 18:48:25 +00:00
taylor 37a7e70d39 fix Subsys_status leak, wasn't a problem in game but can be touchy on exit 2005-09-25 18:44:51 +00:00
Goober5000 29dda0a324 Okay, everything should now work again. :p Still have to do a little more with the asteroids.
--Goober5000
2005-09-25 08:25:16 +00:00
Goober5000 7adba91866 remove unneeded #include
--Goober5000
2005-09-25 08:23:38 +00:00
Goober5000 4ffb56ecb1 remove duplicate #include
--Goober5000
2005-09-25 08:21:54 +00:00
Goober5000 f7b61e5666 and again
--Goober5000
2005-09-25 07:27:33 +00:00
Goober5000 b56688e720 try to fix the headers
--Goober5000
2005-09-25 07:26:05 +00:00
Goober5000 0749cebaa1 partial commit; hang on
--Goober5000
2005-09-25 07:07:34 +00:00
Goober5000 d16a2f95e2 bah
--Goober5000
2005-09-25 05:26:13 +00:00
Goober5000 b23de6a2e2 hopefully complete species upgrade
--Goober5000
2005-09-25 05:13:07 +00:00
Goober5000 ff652edbd5 meh for consistency
--Goober5000
2005-09-25 02:15:02 +00:00
Goober5000 35188a2b9e cleaned up some more thruster stuff; honestly, the thruster code is such a
mess that it should probably be reverted to the retail version
--Goober5000
2005-09-24 07:45:31 +00:00
Goober5000 6e7756b455 fixage
--Goober5000
2005-09-24 07:18:15 +00:00
Goober5000 a2a5b2e952 another species overhaul
--Goober5000
2005-09-24 07:07:17 +00:00
Goober5000 30495588fa a fix
--Goober5000
2005-09-24 02:57:12 +00:00
Goober5000 47953947cf whoops
--Goober5000
2005-09-24 02:43:33 +00:00
Goober5000 058aa3b940 get rid of a whole bunch of Microsoft warnings
--Goober5000
2005-09-24 02:40:10 +00:00
Goober5000 6dfe488f6f bah
--Goober5000
2005-09-24 02:24:29 +00:00
Goober5000 a906f582f3 a bunch of support ship bulletproofing
--Goober5000
2005-09-24 01:50:10 +00:00
Goober5000 831dbe1e6a this isn't needed because of is_support_allowed
--Goober5000
2005-09-24 01:41:21 +00:00
Goober5000 19487cb111 bettered the web cursor bitmap error message
--Goober5000
2005-09-23 23:07:11 +00:00
Goober5000 b9090328d0 something for WCS
--Goober5000
2005-09-23 22:48:56 +00:00
taylor 714e71f51a fix screen update of pilot list when you delete one of them 2005-09-22 19:16:48 +00:00
taylor c10b06d937 entries for icon file
some general cleanup of the project file
use "Release" and "Debug" for the builds since that's the terminology we use
2005-09-22 11:22:52 +00:00
taylor 2543fdd5f7 delay for fox OS X, SDL messes up for some reason and though I don't like this, even Apple does it 2005-09-22 11:21:22 +00:00
taylor 5f16edd112 byte-swap for 32-bit uncompressed DDS images on big endian 2005-09-22 11:20:11 +00:00
taylor 113d67d6c0 ignore .DS_Store from OS X
add .cvsignore for Xcode project stuff
temporary placeholder for real FS2_Open icon file
2005-09-22 11:18:30 +00:00
Goober5000 e801840cac add option for warp flash; mess with the cmdlines a bit
--Goober5000
2005-09-21 03:55:32 +00:00
wmcoolmon 2f0ad1c35c New parsing functions that I'll be using for XMTs once I get them
working
2005-09-20 04:51:45 +00:00
wmcoolmon 791c7c39ea Oops. Breathalyzer standing by... 2005-09-20 04:51:01 +00:00
wmcoolmon 86539f252f Some work I did on the camera code 2005-09-20 04:48:52 +00:00
wmcoolmon c2c44c86b7 Fixed techroom crash if there are no entries to display; removed
unneeded MULTIPLAYER_BETA_BUILD define that disallowed supercaps
2005-09-20 04:37:01 +00:00
taylor b2937b2e08 fix a couple of things that Valgrind complained about 2005-09-20 02:48:37 +00:00
taylor b3f2c96435 make sure that any extra ship textures get loaded on a class change (that Ares bug which wasn't actually Ares specific) 2005-09-20 02:48:06 +00:00
taylor 4da393e6ce slight speedup for font rendering
fix a couple of things that Valgrind complained about
2005-09-20 02:46:53 +00:00
taylor ebfa7423fc bump version to 0.6
add a specified directory to output files to
2005-09-20 02:45:47 +00:00
736 changed files with 0 additions and 556568 deletions

No files matched your search

-15
View File
@@ -1,15 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
new_commit_prep Error checking out/updating CVSROOT/new_commit_prep
new_log_accum Error checking out/updating CVSROOT/new_log_accum
-17
View File
@@ -1,17 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
DEFAULT $CVSROOT/CVSROOT/new_commit_prep
CVSROOT $CVSROOT/CVSROOT/new_commit_prep
-14
View File
@@ -1,14 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
-23
View File
@@ -1,23 +0,0 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
-21
View File
@@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-30
View File
@@ -1,30 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
DEFAULT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
CVSROOT $CVSROOT/CVSROOT/new_log_accum -m [email protected] %{sVv}
-26
View File
@@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
-104
View File
@@ -1,104 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Script to store the last visited directory for newlogaccum.pl.
#
# $Id: new_commit_prep,v 1.1 2002-08-11 23:05:15 drevil Exp $
use strict;
# This routine removes everything in a directory
sub clear_dir {
my ($dir) = @_;
my ($file);
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
while ($file = readdir(DIR)) {
next
if ($file eq "." || $file eq "..");
$file = "$dir/$file";
if (-d $file) {
# It's a directory, recurse into it, then delete it.
clear_dir($file);
rmdir($file);
} else {
# It's a file, delete it.
unlink($file);
}
}
closedir(DIR);
}
# This routine prepares a temporary directory, hopefully in a secure
# fashion; it uses the process group to make secondary programs be able
# to find it.
sub tmpdir (;$) {
my ($clear) = @_;
my ($pgrp, $own, $mode, $tmpdir);
$pgrp = getpgrp();
die "Don't run $0 setuid!"
unless ($< == $>);
# Decide on the directory name, using various environment variables
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
"/.#cvs.$pgrp";
# Doesn't exist, but we can't create it...
die "Can't create temporary directory $tmpdir: $!"
unless (-e $tmpdir || mkdir($tmpdir, 0700));
die "Temporary directory $tmpdir is not a directory"
unless (-d $tmpdir);
# Check ownership and permissions
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
unless ($own == $<);
die "Temporary directory $tmpdir group-writable"
if ($mode & 0020);
die "Temporary directory $tmpdir other-writable"
if ($mode & 0002);
# If we're supposed to clear the directory, do so...
clear_dir($tmpdir)
if ($clear);
return $tmpdir;
}
# This routine writes a single line to a file
sub write_line ($$) {
my ($fname, $line) = @_;
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
print FILE "$line\n";
close(FILE);
}
# Create and empty the temporary directory
my ($tmpdir) = (tmpdir(1));
# Store the directory name
write_line("$tmpdir/lastdir", shift(@ARGV));
-757
View File
@@ -1,757 +0,0 @@
#!/usr/bin/perl -w
#
# Copyright (C) 2000 by Kevin L. Mitchell <[email protected]>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
#
# Script to accumulate log messages for an entire tree and send them along
# with the diffs; deals correctly with all manner of branching (I hope)
#
# $Id: new_log_accum,v 1.3 2003-09-07 12:46:59 drevil Exp $
#
use strict;
use vars qw($MAILER $CVS $debug $boundary);
use Digest::MD5;
# Set this to the full path of a mailer that takes a list
# of email addresses as arguments...
$MAILER = "/usr/sbin/sendmail -oi -oeq";
# Set this to the path of the CVS binary responsible for this tree...
$CVS = "/usr/bin/cvs";
# Don't touch this; use the -d command line option
$debug = 0;
# This is initialized by build_mailheader()
$boundary = '';
use POSIX qw(setsid);
# We have to dissociate from our parent, so that the CVS commit can
# complete, before we try to extract the diffs
sub daemonize {
defined(my $pid = fork()) || die "Can't fork: $!";
exit(0)
if $pid;
setsid() || die "Can't start a new session: $!";
}
# Debugging output
sub debug (@) {
print STDERR @_
if ($debug);
}
# Constants used in the FSM below for parsing the log message
sub STATE_NONE { 0 }
sub STATE_MODIFIED { 1 }
sub STATE_ADDED { 2 }
sub STATE_REMOVED { 3 }
sub STATE_LOG1 { 4 }
sub STATE_LOG2 { 5 }
# This routine removes everything in a directory
sub clear_dir {
my ($dir) = @_;
my ($file);
opendir(DIR, $dir) || die "Cannot clear directory $dir: $!";
while ($file = readdir(DIR)) {
next
if ($file eq "." || $file eq "..");
$file = "$dir/$file";
if (-d $file) {
# It's a directory, recurse into it, then delete it.
clear_dir($file);
rmdir($file);
} else {
# It's a file, delete it.
unlink($file);
}
}
closedir(DIR);
}
# This routine prepares a temporary directory, hopefully in a secure
# fashion; it uses the process group to make secondary programs be able
# to find it.
sub tmpdir (;$) {
my ($clear) = @_;
my ($pgrp, $own, $mode, $tmpdir);
$pgrp = getpgrp();
die "Don't run $0 setuid!"
unless ($< == $>);
# Decide on the directory name, using various environment variables
$tmpdir = ($ENV{TMPDIR} || $ENV{TMP} || $ENV{TEMP} || "/tmp") .
"/.#cvs.$pgrp";
# Doesn't exist, but we can't create it...
die "Can't create temporary directory $tmpdir: $!"
unless (-e $tmpdir || mkdir($tmpdir, 0700));
die "Temporary directory $tmpdir is not a directory"
unless (-d $tmpdir);
# Check ownership and permissions
(undef, undef, $mode, undef, $own, undef) = stat($tmpdir);
die "Temporary directory $tmpdir not owned by $< (owned by $own)"
unless ($own == $<);
die "Temporary directory $tmpdir group-writable"
if ($mode & 0020);
die "Temporary directory $tmpdir other-writable"
if ($mode & 0002);
# If we're supposed to clear the directory, do so...
clear_dir($tmpdir)
if ($clear);
return $tmpdir;
}
# Routine to remove the temporary directory when done
sub cleanup_dir ($) {
# If we're debugging, we may want to look at the contents...
return
if ($debug);
clear_dir($_[0]);
rmdir($_[0]);
}
# Retrieve a single line from a specified file
sub get_line ($) {
my ($fname) = @_;
open(FILE, "<$fname") || die "Cannot open file $fname for reading";
my $line = <FILE>;
close(FILE);
# Chomp off the \n
chomp $line;
return $line;
}
# Routine that only allows one value to be pushed on the array;
# implemented by making the first element of the array a hash-reference.
# When we add a new value, we also increment the count of an element in
# the hash with the key being the array value...
sub push_once (\@@) {
my ($array, @values) = @_;
# If the array is empty, create our hash ref
push @{$array}, {}
if (@{$array} == 0);
foreach my $value (@values) {
push @{$array}, $value
if (!exists($array->[0]{$value}));
$array->[0]{$value}++;
}
return @{$array} - 1;
}
# Filter //, /./, and remove leading ./ or / from filenames
sub fname_filter ($) {
my ($fname) = @_;
$fname =~ s,//,/,g;
$fname =~ s,/\./,/,g;
$fname =~ s,^\.?/,,g;
return $fname;
}
# Store file data in a temporary file
sub names_to_file ($$@) {
my ($fname, $dir, @names) = @_;
if (@names > 0) {
open(FILE, ">>$fname") || die "Cannot open file $fname for appending";
# Store the directory data
print FILE "D $dir\n";
foreach my $name (@names) {
# Mark record as a file...
print FILE "F ";
# Store the tag, if there is one...
print FILE "$name->{tag}"
if (defined($name->{tag}));
# Then store old revision, new revision, and file name
print FILE ":$name->{old}:$name->{new}:$name->{file}\n";
}
close(FILE);
}
}
# Retrieve file data from temporary file; updates branch tags with what it
# reads
sub file_to_names (\@$) {
my ($btags, $fname) = @_;
my ($dir) = (undef);
my (@names) = ();
debug "Reading file names from $fname...\n";
# We may not have, say, added a file in this subdirectory...
return ()
if (!-e $fname);
open(FILE, "<$fname");
while(<FILE>) {
chomp;
# Get record type...
my ($type, $data) = split(' ', $_, 2);
# ok, it's a directory, remember that...
if ($type eq "D") {
$dir = $data;
debug "Read directory $dir\n";
next;
}
debug "Read file $data\n";
# Get all the information about the file
my ($tag, $old, $new, $file) = split(':', $data);
# and store it all
push(@names, { tag => $tag, old => $old, new => $new, file => $file,
dir => $dir, name => fname_filter("$dir/$file") });
# Remember the tags...
push_once(@{$btags}, $tag)
if (defined($tag) && $tag ne "");
}
close(FILE);
return @names;
}
# Create a text-formatted list of names
sub name_to_list (\@@) {
my ($btags, @names) = @_;
my (@nlist, @nline) = ();
debug "Tags:", join(':', @{$btags}), "\n";
# We group them by tag
foreach my $tag ("", @{$btags}[1..$#{$btags}]) {
debug "Processing tag $tag...\n";
@nlist = ();
# Get a list of files by the tag...
foreach my $name (@names) {
debug "Processing $name->{file}...\n";
next
if ($name->{tag} ne $tag);
debug "Pushing $name->{name} on \@nlist...\n";
push(@nlist, $name->{name});
}
# If the tag is not the empty string, list the tag...
push(@nline, " Tag: $tag", " ")
if ($tag ne "");
# Now list each file name
foreach my $name (@nlist) {
# indent if we run past the end of line limit
push(@nline, " ")
if (@nline == 0 || ($nline[$#nline] ne " " &&
length($nline[$#nline]) + length($name) + 1 > 70));
# add the file name to the list
debug "Adding $name to \@nline...\n";
$nline[$#nline] .= " $name";
}
}
return @nline;
}
# write the log message to a temporary file
sub write_log ($@) {
my ($fname, @text) = @_;
open(FILE, ">$fname") || die "Cannot open file $fname for writing";
print FILE join("\n", @text), "\n";
close(FILE);
}
# Build the header of the commit message: CVSROOT, module name, any
# branch tags, and the commit time
sub build_header ($@) {
my ($module, $subject, $mailto, @branch_tags) = @_;
my (@text, @mailto);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
my ($user, $dummy);
my ($digest);
($user, $dummy, $dummy, $dummy, $dummy, $dummy, $dummy) = getpwuid($<);
@mailto = @{$mailto};
# generate a unique boundary by calculating the md5sum of the
# current time
$digest = new Digest::MD5;
$digest->reset();
$digest->add(time() . rand());
$boundary = "----=MIME." . unpack("H*", $digest->digest());
# Build the mail header
push(@text, 'From: [email protected]');
push(@text, "To: " . join(' ', @mailto));
push(@text, "Subject: $subject");
push(@text, "MIME-Version: 1.0");
push(@text, "Content-Type: multipart/mixed; boundary=\"$boundary\"");
push(@text, "");
push(@text, "This is a multipart message as defined by RFC2049 (MIME)");
push(@text, "");
push(@text, "--$boundary");
push(@text, "Content-Type: text/plain; charset=us-ascii");
push(@text, "Content-Disposition: inline");
push(@text, "");
# Build the commit message header
push(@text, "Commiter : $user");
push(@text, "CVSROOT : $ENV{CVSROOT}");
push(@text, "Module : $module");
push(@text, "Branch tags: " . join(' ', @branch_tags[1..$#branch_tags]))
if (@branch_tags > 0);
push(@text, sprintf("Commit time: %04d-%02d-%02d %02d:%02d:%02d UTC",
$year + 1900, $mon + 1, $mday, $hour, $min, $sec));
return @text, "";
}
# Send the mail message
sub send_mail {
my ($mailto, $text) = @_;
my (@mailto, @text);
# I <heart> perl
@mailto = @{$mailto};
@text = @{$text};
open(MAIL, "|$MAILER " . join(' ', @mailto));
push(@text, "--$boundary--", "");
print MAIL join("\n", @text), "\n";
close(MAIL);
}
# Find the tmp directory
my ($tmpdir) = (tmpdir());
my (@mailto) = ();
my (@files) = ();
my (@path) = ();
my ($modname, $repdir, $dir) = (undef, undef, undef);
# Process command line arguments
while (@ARGV > 0) {
my ($arg) = (shift(@ARGV));
if ($arg eq '-d') {
# Turn on debugging
$debug++;
} elsif ($arg eq '-M') {
# Module name explicitly set -- XXX Not tested, use at your own risk
die "Argument for -M missing"
unless (@ARGV > 0);
$modname = shift(@ARGV);
} elsif ($arg eq '-m') {
# An address to mail the notification to
die "Argument for -m missing"
unless (@ARGV > 0);
push(@mailto, shift(@ARGV));
} else {
# the list of filenames passed by CVS--you *must* use %{sVv}!
die "Too many arguments!"
unless (@files == 0);
@files = split(" ", $arg);
}
}
die "Nobody to mail to"
unless (@mailto > 0);
die "No files to process"
unless (@files > 1);
# The repository directory
$repdir = shift(@files);
# break it appart...
@path = split("/", $repdir);
# Now we know the module name, if it wasn't explicitly set
$modname = $path[0]
unless (defined($modname));
# Figure out what our directory is
if (@path == 1) {
$dir = ".";
} else {
$dir = join("/", @path[1..$#path]);
}
# append a / to it...
$dir .= "/";
debug "module = $modname\n";
debug "dir = $dir\n";
debug "path = ", join(":", @path), "\n";
debug "files = ", join(":", @files), "\n";
debug "tmpdir = $tmpdir\n";
my (%fversions);
# Unless its a new directory or imported sources, create file records
unless (defined($files[1]) && defined($files[2]) &&
(($files[1] eq "New" && $files[2] eq "directory") ||
($files[1] eq "Imported" && $files[2] eq "sources"))) {
foreach my $fname (@files) {
# You *must* use %{sVv} in the call in loginfo!
die "Invalid filenames"
unless ($fname =~ /^(.*),([0-9.]+|NONE),([0-9.]+|NONE)$/);
$fversions{$1} = {
old => ($2 eq "NONE" ? "0" : $2),
new => ($3 eq "NONE" ? "0" : $3),
};
}
}
# process log message
my ($state, $tag) = (STATE_NONE, undef);
my (@modified, @added, @removed, @log, @branch_tags) = ();
while (<STDIN>) {
chomp;
debug "State $state, line:$_\n";
# Ignore empty space at the beginning of the log message
next
if ($state == STATE_LOG1 && /^\s*$/);
# We're done ignoring empty space
if ($state == STATE_LOG1) {
$state = STATE_LOG2;
}
if ($state == STATE_LOG2) {
# Don't modify the lines at all if we're processing the log message
push(@log, $_);
next;
} else {
# Strip out leading and trailing space
s/^\s*(.*?)\s*$/$1/;
}
if (/^Modified Files/) {
# Collect list of modified files
debug "State switching to STATE_MODIFIED\n";
$state = STATE_MODIFIED;
$tag = undef;
next;
} elsif (/^Added Files/) {
# Collect list of added files
debug "State switching to STATE_ADDED\n";
$state = STATE_ADDED;
$tag = undef;
next;
} elsif (/^Removed Files/) {
# Collect list of removed files
debug "State switching to STATE_REMOVED\n";
$state = STATE_REMOVED;
$tag = undef;
next;
} elsif (/^Log Message/) {
# Collect log message
debug "State switching to STATE_LOG1\n";
$state = STATE_LOG1;
$tag = undef;
next;
} elsif (/^Revision\/Branch/) {
# Parse old-style Revision/Branch field
debug "Found a branch tag\n";
/^[^:]+:\s*(.*)/;
push_once(@branch_tags, $1);
warn "Tag == $tag"
if (defined($tag));
next;
}
# Ignore the stuff at the top of the commit report
next
if ($state == STATE_NONE);
if (/^Tag:\s*(.*)$/) {
# Remember the tag
debug "Setting tag to $1\n";
$tag = $1;
next;
}
my (@tfiles) = ();
# Find the file in our command line list of files
foreach my $file (split) {
die "Nothing known about file $file!"
unless (exists($fversions{$file}));
push @tfiles, {
file => $file,
tag => $tag,
old => $fversions{$file}{old},
new => $fversions{$file}{new},
};
}
# Store the file list in the correct array
push(@modified, @tfiles)
if ($state == STATE_MODIFIED);
push(@added, @tfiles)
if ($state == STATE_ADDED);
push(@removed, @tfiles)
if ($state == STATE_REMOVED);
}
# Remove trailing blank lines from the log message
while (@log > 0 && $log[$#log] =~ /^\s*$/) {
pop(@log);
}
# If a new directory was added, we're done...
if (defined($files[1]) && defined($files[2]) &&
$files[1] eq "New" && $files[2] eq "directory") {
my (@text) = ();
# If there was a sticky tag for the directory, make it a branch tag
if ($log[$#log] =~ /^--> Using per-directory sticky tag \`(.*)\'$/) {
push_once(@branch_tags, $1);
pop(@log);
}
# Build the message...
push(@text, build_header($modname, "Module $modname: New directory $dir",
\@mailto, @branch_tags));
push(@text, "Log message:", "", @log);
# and send it (synchronously)
send_mail(\@mailto, \@text);
# Clean up after ourselves and exit.
cleanup_dir($tmpdir);
exit(0);
}
# If an import was done, we're done...
if (defined($files[1]) && defined($files[2]) &&
$files[1] eq "Imported" && $files[2] eq "sources") {
my (@text) = ();
# Build the message...
push(@text, build_header($modname, "Module $modname: Imported $dir",
\@mailto, @branch_tags));
push(@text, "Log message:", "", @log);
# and send it (synchronously)
send_mail(\@mailto, \@text);
# Clean up after ourselves and exit.
cleanup_dir($tmpdir);
exit(0);
}
debug "Searching for log file index...";
my ($i);
# Look for an empty log file or one that matches our current log message
for ($i = 0; ; $i++) {
my (@text);
# found one that doesn't exist...
last
if (!-e "$tmpdir/logfile.$i");
# read in the log file
open(FILE, "<$tmpdir/logfile.$i");
while (<FILE>) {
chomp;
push(@text, $_);
}
close(FILE);
# If the log file was empty, use it
last
if (@text == 0);
# If the log messages are identical, use that
last
if (join(' ', @log) eq join(' ', @text));
}
debug "$tmpdir/logfile.$i\n";
# Store modified, added, and removed file lists, along with the log message
names_to_file("$tmpdir/modified.$i", $dir, @modified);
names_to_file("$tmpdir/added.$i", $dir, @added);
names_to_file("$tmpdir/removed.$i", $dir, @removed);
write_log("$tmpdir/logfile.$i", @log);
# Now check to see if we're at the end of our rope
my ($lastdir) = (get_line("$tmpdir/lastdir"));
debug "Checking $ENV{CVSROOT}/$repdir against lastdir $lastdir\n";
# Nope, exit instead of sending a message
exit(0)
if ($lastdir ne "$ENV{CVSROOT}/$repdir");
debug "At last, we've reached the end\n";
# We have to daemonize and sleep so that there isn't any lock hanging
# around when we get to the cvs rdiff below...
daemonize();
sleep(10);
# Build the mail message...
my (@text) = ();
@files = ();
@branch_tags = ();
for ($i = 0; ; $i++) {
# No more log files
last
if (!-e "$tmpdir/logfile.$i");
# read and insert the log message
open(FILE, "<$tmpdir/logfile.$i");
push(@text, "Log message:", "");
while (<FILE>) {
chomp;
push(@text, $_);
}
push(@text, "");
close(FILE);
# read modified list and list all modified files if non-empty
@modified = file_to_names(@branch_tags, "$tmpdir/modified.$i");
push(@text, "Modified files:", name_to_list(@branch_tags, @modified), "")
if (@modified > 0);
# read added list and list all added files if non-empty
@added = file_to_names(@branch_tags, "$tmpdir/added.$i");
push(@text, "Added files:", name_to_list(@branch_tags, @added), "")
if (@added > 0);
# read removed list and list all removed files if non-empty
@removed = file_to_names(@branch_tags, "$tmpdir/removed.$i");
push(@text, "Removed files:", name_to_list(@branch_tags, @removed), "")
if (@removed > 0);
# remember all the files we looked at
push(@files, @modified, @added, @removed);
}
# Now that name_to_list has rebuilt our list of branch tags, we can build the
# header and prepend it to the message
unshift(@text, build_header($modname, "Module $modname: Change committed",
\@mailto, @branch_tags));
# sort the files out for our diff
@files = sort { $a->{name} cmp $b->{name} } @files;
my ($user, $filename);
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = gmtime(time());
$user = getpwuid($<);
$filename = sprintf("%s.%04d%02d%02d.%02d%02d%02d.%s.diff", $modname,
$year + 1900, $mon + 1, $mday, $hour, $min, $sec, $user);
push(@text, "--$boundary");
push(@text, "Content-Type: text/plain; name=\"$filename\"");
push(@text, "Content-Disposition: attachment; filename=\"$filename\"");
push(@text, "Content-Transfer-Encoding: 8bit");
push(@text, "");
foreach my $file (@files) {
debug "Diffing file $file->{name}...\n";
# Run cvs rdiff, extracting a diff between the old version and the new
open(DIFF, "$CVS -Q rdiff -u -r $file->{old} -r $file->{new} " .
"$modname/$file->{name}|");
while (<DIFF>) {
chomp;
push(@text, $_);
}
close(DIFF);
}
# send the mail...
send_mail(\@mailto, \@text);
# and clean up after ourselves
cleanup_dir($tmpdir);
-12
View File
@@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
-19
View File
@@ -1,19 +0,0 @@
drevil:f76FWdDTUBG5c:fs2source
mysterial:f7nJUwoIhmSrg:fs2source
wmcoolmon:f7JRB.js9Q1sE:fs2source
inquisitor:f7BVkOvwjDlWk:fs2source
penguin:Jh.dOjaiO2jHk:fs2source
DTP:f7M92Z/6/uep.:fs2source
unknownplayer:f79BgAn.IzJs6:fs2source
phreak:f7WQyGiT/jzlM:fs2source
randomtiger:f7Way/xL9ic7o:fs2source
righteous1:f7fpcXiE0Ubao:fs2source
bobboau:f7jChSbXOIdWY:fs2source
sesquipedalian:f75AcAOV6TM6Q:fs2source
daveb:f7f2mVbMvbe.6:fs2source
Goober5000:f7Fc.gHzyrOL2:fs2source
dkharrat:f7odljbD5tm5k:fs2source
EdrickV:f7cDahmEbbAlg:fs2source
OldMan:f7N4NyUG5Ommw:fs2source
komet:f7fyoBN5r.m76:fs2source
anonymous:oIKtWP1q6GDt6:fs2source
-13
View File
@@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-20
View File
@@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-21
View File
@@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-18
View File
@@ -1,18 +0,0 @@
drevil
inquisitor
mysterial
DTP
randomtiger
wmcoolmon
unknownplayer
phreak
bobboau
righteous1
sesquipedalian
Goober5000
dkharrat
daveb
EdrickV
OldMan
komet
penguin
-25
View File
@@ -1,25 +0,0 @@
Makefile
Makefile.in
configure
FS2_Open.prj
FS2_Open.prj.bak
FS2_Open.pws
.tm_project.cache
config.guess
config.cache
config.log
config.status
config.sub
depcomp
install-sh
missing
mkinstalldirs
autom4te*
aclocal.m4
Freespace2.dsp
Freespace2.dsw
Freespace2.ncb
Freespace2.opt
Freespace2.plg
Release
Debug
-29
View File
@@ -1,29 +0,0 @@
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
Modifications by the FreeSpace Source Code Project (FSSCP)
http://fs2source.warpcore.org
FS2_OPEN STAFF:
Project leader:
Edward "Inquisitor" Gardner
Programmers:
"Bobboau"
Dennis "DTP" Pedersen
Ian "Goober5000" Warfield
Joe "Righteous1" Dowd
Mike "penguin" Harris
"Mysterial"
"PhReAk"
Thomas "Random Tiger" Whittaker
Will "Unknown PLayer" Rousnel
"WMCoolmon"
Web support:
Icefire and the staff at Volitionwatch.com
Alex "Thunder" Avery and the staff at Hard Light Productions
Special thanks to:
Volition for making FS2 such a great game
Dave Baranec for giving us the code and keeping us sanity checked
-14
View File
@@ -1,14 +0,0 @@
Volition Copyright (applies to original FreeSpace2 source code
developed and released by Volition):
"Copyright (C) Volition, Inc. 1999. All rights reserved.
All source code herein is the property of Volition, Inc. You may not
sell or otherwise commercially exploit the source or things you
created based on the source."
Modifications by members of the FreeSpace Source Code Project are
released under whatever terms the individual authors choose, but the
above notice continues to apply to all fs2_open code.
-1868
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
-27
View File
@@ -1,27 +0,0 @@
This is still in pretty rough form.
=== for people building fs2_open:
Win32-MSVC:
Use the Freespace2.dsw workspace and build within the IDE.
Win32-MinGW:
make
Linux and other unix variants (NOT YET COMPLETE)
./configure [options] (options tbd)
make -f makefile.linux
=== for the project maintainers (people who need to
=== keep the makefiles up to date):
aclocal
autoconf
automake
./configure
make
-68
View File
@@ -1,68 +0,0 @@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = libjpeg code
EXTRA_DIST = \
FS2OpenSCPReadMe.doc \
projects/MSVC_2005/Freespace2.sln \
projects/MSVC_2005/Freespace2.vcproj \
projects/MSVC_2005/code.vcproj \
projects/MSVC_6/Freespace2.dsp \
projects/MSVC_6/Freespace2.dsw \
projects/MSVC_6/code.dsp \
projects/MSVC_6/libjpeg.dsp \
projects/MSVC_6/wxFRED2.dsp \
projects/anjuta1/FS2_Open.prj \
projects/anjuta1/README
# D_ variants are defaults and should always be used
AM_CXXFLAGS = -I./code @D_CFLAGS@
AM_LDFLAGS = @D_LDFLAGS@
EXTRA_PROGRAMS = cfilearchiver cfileextractor cryptstring scramble
###############################################################################
##
## Begin utilitites
##
# cfilearchiver -- to create VPs
cfilearchiver_SOURCES = \
code/cfilearchiver/cfilearchiver.cpp
# cfileextractor -- to extract files from VPs
cfileextractor_SOURCES = \
code/cfileextractor/cfileextractor.cpp
# cryptstring -- to encrypt strings that are used as cheat codes
cryptstring_SOURCES = \
code/cryptstring/cryptstring.cpp
# scramble -- to encrypt tables
scramble_SOURCES = \
code/parse/encrypt.cpp \
code/scramble/scramble.cpp \
code/scramble/scramble.h
# catch all to build utilitites
tools: cfilearchiver cfileextractor cryptstring scramble
# cleaning
clean-tools:
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
##
## End utilitites
##
###############################################################################
# make sure we get this stuff cleaned up
clean-generic: clean-tools
-3
View File
@@ -1,3 +0,0 @@
This file is required to keep autoconf/automake from complaining.
See the ChangeLog for what's new.
-8
View File
@@ -1,8 +0,0 @@
The "projects" directory contains ready projects for:
Microsoft Visual C++ 6
Microsoft Visual C++ 2005
Anjuta 1 (please see README with project before using)
See the ChangeLog to see what's new.
See the INSTALL file for instructions on how to build fs2_open.
-382
View File
@@ -1,382 +0,0 @@
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_args="$sdl_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
AC_REQUIRE([AC_CANONICAL_TARGET])
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, 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 SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])
dnl ---------------------------------------------------------------------------
dnl Macros for wxWindows detection. Typically used in configure.in as:
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl ...
dnl AM_PATH_WXCONFIG(2.3.4, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWindows must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWindows libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWindows version is 2.3.4 or above.
dnl ])
dnl fi
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_OPTIONS_WXCONFIG
dnl
dnl adds support for --wx-prefix, --wx-exec-prefix and --wx-config
dnl command line options
dnl ---------------------------------------------------------------------------
AC_DEFUN([AM_OPTIONS_WXCONFIG],
[
AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,[ --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
AC_ARG_WITH(wx-config,[ --with-wx-config=CONFIG wx-config script to use (optional)],
wx_config_name="$withval", wx_config_name="")
])
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
dnl environment variable to override the default name of the wx-config script
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl ---------------------------------------------------------------------------
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXCONFIG],
[
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
WX_CONFIG_PATH="$WX_CONFIG_NAME"
AC_MSG_RESULT($WX_CONFIG_PATH)
else
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
no_wx=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_ver_ok=""
if test $wx_config_major_version -gt $wx_requested_major_version; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $wx_requested_major_version; then
if test $wx_config_minor_version -gt $wx_requested_minor_version; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $wx_requested_minor_version; then
if test $wx_config_micro_version -ge $wx_requested_micro_version; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
if test "x$wx_ver_ok" = x ; then
no_wx=yes
else
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
if test "x$wx_has_cppflags" = x ; then
dnl no choice but to define all flags like CFLAGS
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
fi
if test "x$no_wx" = x ; then
AC_MSG_RESULT(yes (version $WX_VERSION))
ifelse([$2], , :, [$2])
else
if test "x$WX_VERSION" = x; then
dnl no wx-config at all
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
ifelse([$3], , :, [$3])
fi
fi
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_CFLAGS_ONLY)
AC_SUBST(WX_CXXFLAGS_ONLY)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_VERSION)
])
-137
View File
@@ -1,137 +0,0 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
PKG_NAME="fs2_open"
# check the version of a package
check_version() {
COMMAND=$1
MAJOR=$2
MINOR=$3
MICRO=$4
($COMMAND --version) </dev/null >/dev/null 2>&1 || return 1
ver=`$COMMAND --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
major=`echo $ver | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
minor=`echo $ver | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
micro=`echo $ver | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
test -z "$major" && major=0
test -z "$minor" && minor=0
test -z "$micro" && micro=0
fail=0
if [ ! "$major" -gt "$MAJOR" ]; then
if [ "$major" -lt "$MAJOR" ]; then
fail=1
elif [ ! "$minor" -gt "$MINOR" ]; then
if [ "$minor" -lt "$MINOR" ]; then
fail=1
elif [ "$micro" -lt "$MICRO" ]; then
fail=1
fi
fi
fi
return "$fail"
}
AUTOMAKE=
ACLOCAL=
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
for AM in automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
(check_version "$AM" 1 6 1) && {
AUTOMAKE="$AM"
break
}
done
if [ -z "$AUTOMAKE" ]; then
echo
echo "**Error**: You must have \`automake' version 1.6.1 or greater"
echo "installed to compile $PKG_NAME. Download the appropriate package"
echo "for your distribution, or get the source tarball at"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
# if no automake, don't bother testing for aclocal
test -z "$AUTOMAKE" || {
for ACL in aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
(check_version "$ACL" 1 6 1) && {
ACLOCAL="$ACL"
break
}
done
if [ -z "$ACLOCAL" ]; then
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed seems to be outdated. Get a recent package from"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -name configure.ac -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
echo "Running $ACLOCAL $aclocalinclude ..."
"$ACLOCAL" $aclocalinclude
echo "Running $AUTOMAKE --add-missing --copy --foreign $am_opt ..."
"$AUTOMAKE" --add-missing --copy --foreign $am_opt
echo "Running autoconf..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME.
else
echo Skipping configure process.
fi
-5
View File
@@ -1,5 +0,0 @@
Makefile
Makefile.in
fs2_open_d
fs2_open_r
.deps
-672
View File
@@ -1,672 +0,0 @@
## code/Makefile.am for fs2_open
##
## $Id: Makefile.am,v 1.20 2005-07-18 03:37:35 taylor Exp $
EXTRA_DIST = \
freespace2/app_icon.ico \
freespace2/freespace.rc \
freespace2/freespaceresource.h \
freespace2/goal_com.bmp \
freespace2/goal_fail.bmp \
freespace2/goal_inc.bmp \
freespace2/goal_none.bmp \
freespace2/goal_ord.bmp \
wxfred2/res/FRED.ico \
wxfred2/wxfred.xrc
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
noinst_PROGRAMS = @FS2_BINARY@
EXTRA_PROGRAMS = fs2_open_r fs2_open_d wxFRED2_r wxFRED2_d
###############################################################################
##
## Begin CORE library
##
FS2_SOURCES = \
ai/ai.cpp \
ai/ai.h \
ai/aibig.cpp \
ai/aibig.h \
ai/aicode.cpp \
ai/aigoals.cpp \
ai/aigoals.h \
ai/aiinternal.h \
ai/ailocal.h \
ai/aiturret.cpp \
anim/animplay.cpp \
anim/animplay.h \
anim/packunpack.cpp \
anim/packunpack.h \
asteroid/asteroid.cpp \
asteroid/asteroid.h \
autopilot/autopilot.cpp \
autopilot/autopilot.h \
bmpman/bm_internal.h \
bmpman/bmpman.cpp \
bmpman/bmpman.h \
camera/camera.cpp \
camera/camera.h \
cfile/cfile.cpp \
cfile/cfile.h \
cfile/cfilearchive.cpp \
cfile/cfilearchive.h \
cfile/cfilelist.cpp \
cfile/cfilesystem.cpp \
cfile/cfilesystem.h \
cmdline/cmdline.cpp \
cmdline/cmdline.h \
cmeasure/cmeasure.cpp \
cmeasure/cmeasure.h \
controlconfig/controlsconfig.cpp \
controlconfig/controlsconfig.h \
controlconfig/controlsconfigcommon.cpp \
cutscene/cutscenes.cpp \
cutscene/cutscenes.h \
cutscene/movie.cpp \
cutscene/movie.h \
ddsutils/ddsutils.cpp \
ddsutils/ddsutils.h \
debris/debris.cpp \
debris/debris.h \
debugconsole/console.cpp \
debugconsole/dbugfile.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
decals/decals.cpp \
decals/decals.h \
demo/demo.cpp \
demo/demo.h \
exceptionhandler/exceptionhandler.cpp \
exceptionhandler/exceptionhandler.h \
fireball/fireballs.cpp \
fireball/fireballs.h \
fireball/warpineffect.cpp \
fs2open_pxo/Client.cpp \
fs2open_pxo/Client.h \
fs2open_pxo/TCP_Client.cpp \
fs2open_pxo/TCP_Socket.cpp \
fs2open_pxo/TCP_Socket.h \
fs2open_pxo/protocol.h \
fs2open_pxo/udpsocket.cpp \
fs2open_pxo/udpsocket.h \
gamehelp/contexthelp.cpp \
gamehelp/contexthelp.h \
gamehelp/gameplayhelp.cpp \
gamehelp/gameplayhelp.h \
gamesequence/gamesequence.cpp \
gamesequence/gamesequence.h \
globalincs/alphacolors.cpp \
globalincs/alphacolors.h \
globalincs/crypt.cpp \
globalincs/crypt.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/pstypes.h \
globalincs/systemvars.cpp \
globalincs/systemvars.h \
globalincs/version.cpp \
globalincs/version.h \
graphics/2d.cpp \
graphics/2d.h \
graphics/font.cpp \
graphics/font.h \
graphics/grbatch.cpp \
graphics/grbatch.h \
graphics/grinternal.h \
graphics/gropengl.cpp \
graphics/gropengl.h \
graphics/gropenglbmpman.cpp \
graphics/gropenglbmpman.h \
graphics/gropenglextension.cpp \
graphics/gropenglextension.h \
graphics/gropengllight.cpp \
graphics/gropengllight.h \
graphics/gropengltexture.cpp \
graphics/gropengltexture.h \
graphics/gropengltnl.cpp \
graphics/gropengltnl.h \
graphics/grstub.h \
graphics/grzbuffer.cpp \
graphics/grzbuffer.h \
graphics/line.h \
graphics/tmapper.h \
hud/hud.cpp \
hud/hud.h \
hud/hudartillery.cpp \
hud/hudartillery.h \
hud/hudbrackets.cpp \
hud/hudbrackets.h \
hud/hudconfig.cpp \
hud/hudconfig.h \
hud/hudescort.cpp \
hud/hudescort.h \
hud/hudets.cpp \
hud/hudets.h \
hud/hudgauges.h \
hud/hudlock.cpp \
hud/hudlock.h \
hud/hudmessage.cpp \
hud/hudmessage.h \
hud/hudnavigation.cpp \
hud/hudnavigation.h \
hud/hudobserver.cpp \
hud/hudobserver.h \
hud/hudparse.cpp \
hud/hudparse.h \
hud/hudresource.h \
hud/hudreticle.cpp \
hud/hudreticle.h \
hud/hudshield.cpp \
hud/hudshield.h \
hud/hudsquadmsg.cpp \
hud/hudsquadmsg.h \
hud/hudtarget.cpp \
hud/hudtarget.h \
hud/hudtargetbox.cpp \
hud/hudtargetbox.h \
hud/hudwingmanstatus.cpp \
hud/hudwingmanstatus.h \
io/key.cpp \
io/key.h \
io/keycontrol.cpp \
io/keycontrol.h \
io/mouse.cpp \
io/mouse.h \
io/timer.cpp \
io/timer.h \
irc/irc.cpp \
irc/irc.h \
jpgutils/jpgutils.cpp \
jpgutils/jpgutils.h \
jumpnode/jumpnode.cpp \
jumpnode/jumpnode.h \
lab/lab.cpp \
lab/lab.h \
lab/wmcgui.cpp \
lab/wmcgui.h \
lighting/lighting.cpp \
lighting/lighting.h \
localization/fhash.cpp \
localization/fhash.h \
localization/localize.cpp \
localization/localize.h \
math/bitarray.h \
math/fix.cpp \
math/fix.h \
math/floating.cpp \
math/floating.h \
math/fvi.cpp \
math/fvi.h \
math/spline.cpp \
math/spline.h \
math/staticrand.cpp \
math/staticrand.h \
math/vecmat.cpp \
math/vecmat.h \
menuui/barracks.cpp \
menuui/barracks.h \
menuui/credits.cpp \
menuui/credits.h \
menuui/fishtank.cpp \
menuui/fishtank.h \
menuui/mainhallmenu.cpp \
menuui/mainhallmenu.h \
menuui/mainhalltemp.cpp \
menuui/mainhalltemp.h \
menuui/optionsmenu.cpp \
menuui/optionsmenu.h \
menuui/optionsmenumulti.cpp \
menuui/optionsmenumulti.h \
menuui/playermenu.cpp \
menuui/playermenu.h \
menuui/readyroom.cpp \
menuui/readyroom.h \
menuui/snazzyui.cpp \
menuui/snazzyui.h \
menuui/storybook.cpp \
menuui/storybook.h \
menuui/techmenu.cpp \
menuui/techmenu.h \
menuui/trainingmenu.cpp \
menuui/trainingmenu.h \
mission/missionbriefcommon.cpp \
mission/missionbriefcommon.h \
mission/missioncampaign.cpp \
mission/missioncampaign.h \
mission/missiongoals.cpp \
mission/missiongoals.h \
mission/missiongrid.cpp \
mission/missiongrid.h \
mission/missionhotkey.cpp \
mission/missionhotkey.h \
mission/missionload.cpp \
mission/missionload.h \
mission/missionlog.cpp \
mission/missionlog.h \
mission/missionmessage.cpp \
mission/missionmessage.h \
mission/missionparse.cpp \
mission/missionparse.h \
mission/missiontraining.cpp \
mission/missiontraining.h \
missionui/chatbox.cpp \
missionui/chatbox.h \
missionui/missionbrief.cpp \
missionui/missionbrief.h \
missionui/missioncmdbrief.cpp \
missionui/missioncmdbrief.h \
missionui/missiondebrief.cpp \
missionui/missiondebrief.h \
missionui/missionloopbrief.cpp \
missionui/missionloopbrief.h \
missionui/missionpause.cpp \
missionui/missionpause.h \
missionui/missionrecommend.cpp \
missionui/missionrecommend.h \
missionui/missionscreencommon.cpp \
missionui/missionscreencommon.h \
missionui/missionshipchoice.cpp \
missionui/missionshipchoice.h \
missionui/missionstats.cpp \
missionui/missionstats.h \
missionui/missionweaponchoice.cpp \
missionui/missionweaponchoice.h \
missionui/redalert.cpp \
missionui/redalert.h \
model/model.h \
model/modelcollide.cpp \
model/modelinterp.cpp \
model/modelsinc.h \
model/modeloctant.cpp \
model/modelread.cpp \
nebula/neb.cpp \
nebula/neb.h \
nebula/neblightning.cpp \
nebula/neblightning.h \
network/fs2ox.cpp \
network/fs2ox.h \
network/multi.cpp \
network/multi.h \
network/multilag.h \
network/multimsgs.cpp \
network/multimsgs.h \
network/multiteamselect.cpp \
network/multiteamselect.h \
network/multiui.cpp \
network/multiui.h \
network/multiutil.cpp \
network/multiutil.h \
network/multi_campaign.cpp \
network/multi_campaign.h \
network/multi_data.cpp \
network/multi_data.h \
network/multi_dogfight.cpp \
network/multi_dogfight.h \
network/multi_endgame.cpp \
network/multi_endgame.h \
network/multi_ingame.cpp \
network/multi_ingame.h \
network/multi_kick.cpp \
network/multi_kick.h \
network/multi_log.cpp \
network/multi_log.h \
network/multi_obj.cpp \
network/multi_obj.h \
network/multi_observer.cpp \
network/multi_observer.h \
network/multi_oo.h \
network/multi_options.cpp \
network/multi_options.h \
network/multi_pause.cpp \
network/multi_pause.h \
network/multi_pinfo.cpp \
network/multi_pinfo.h \
network/multi_ping.cpp \
network/multi_ping.h \
network/multi_pmsg.cpp \
network/multi_pmsg.h \
network/multi_rate.cpp \
network/multi_rate.h \
network/multi_respawn.cpp \
network/multi_respawn.h \
network/multi_team.cpp \
network/multi_team.h \
network/multi_update.h \
network/multi_voice.cpp \
network/multi_voice.h \
network/multi_xfer.cpp \
network/multi_xfer.h \
network/psnet.cpp \
network/psnet.h \
network/psnet2.cpp \
network/psnet2.h \
object/collidedebrisship.cpp \
object/collidedebrisweapon.cpp \
object/collideshipship.cpp \
object/collideshipweapon.cpp \
object/collideweaponweapon.cpp \
object/objcollide.cpp \
object/objcollide.h \
object/objectdock.cpp \
object/objectdock.h \
object/object.cpp \
object/object.h \
object/objectsort.cpp \
observer/observer.cpp \
observer/observer.h \
palman/palman.cpp \
palman/palman.h \
parse/encrypt.cpp \
parse/encrypt.h \
parse/parselo.cpp \
parse/parselo.h \
parse/sexp.cpp \
parse/sexp.h \
particle/particle.cpp \
particle/particle.h \
pcxutils/pcxutils.cpp \
pcxutils/pcxutils.h \
physics/physics.cpp \
physics/physics.h \
playerman/managepilot.cpp \
playerman/managepilot.h \
playerman/player.h \
playerman/playercontrol.cpp \
popup/popup.cpp \
popup/popup.h \
popup/popupdead.cpp \
popup/popupdead.h \
radar/radar.cpp \
radar/radar.h \
radar/radarorb.cpp \
radar/radarorb.h \
radar/radarsetup.cpp \
radar/radarsetup.h \
render/3d.h \
render/3dclipper.cpp \
render/3ddraw.cpp \
render/3dinternal.h \
render/3dlaser.cpp \
render/3dmath.cpp \
render/3dsetup.cpp \
ship/afterburner.cpp \
ship/afterburner.h \
ship/awacs.cpp \
ship/awacs.h \
ship/shield.cpp \
ship/ship.cpp \
ship/ship.h \
ship/shipcontrails.cpp \
ship/shipcontrails.h \
ship/shipfx.cpp \
ship/shipfx.h \
ship/shiphit.cpp \
ship/shiphit.h \
ship/subsysdamage.h \
species_defs/species_defs.cpp \
species_defs/species_defs.h \
starfield/nebula.cpp \
starfield/nebula.h \
starfield/starfield.cpp \
starfield/starfield.h \
starfield/supernova.cpp \
starfield/supernova.h \
stats/medals.cpp \
stats/medals.h \
stats/scoring.cpp \
stats/scoring.h \
stats/stats.cpp \
stats/stats.h \
tgautils/tgautils.cpp \
tgautils/tgautils.h \
ui/button.cpp \
ui/checkbox.cpp \
ui/gadget.cpp \
ui/icon.cpp \
ui/inputbox.cpp \
ui/keytrap.cpp \
ui/listbox.cpp \
ui/radio.cpp \
ui/scroll.cpp \
ui/slider.cpp \
ui/slider2.cpp \
ui/ui.h \
ui/uidefs.h \
ui/uidraw.cpp \
ui/uimouse.cpp \
ui/window.cpp \
weapon/beam.cpp \
weapon/beam.h \
weapon/corkscrew.cpp \
weapon/corkscrew.h \
weapon/emp.cpp \
weapon/emp.h \
weapon/flak.cpp \
weapon/flak.h \
weapon/muzzleflash.cpp \
weapon/muzzleflash.h \
weapon/shockwave.cpp \
weapon/shockwave.h \
weapon/swarm.cpp \
weapon/swarm.h \
weapon/trails.cpp \
weapon/trails.h \
weapon/weapons.cpp \
weapon/weapon.h
## conditional includes follow:
## joystic support sources
if FS2_OS_WIN32
JOY_SOURCES = \
io/joy.cpp \
io/joy.h \
io/joy_ff.cpp \
io/joy_ff.h \
io/sw_error.hpp \
io/sw_force.h \
io/sw_guid.hpp \
io/swff_lib.cpp
endif
if FS2_OS_UNIX
JOY_SOURCES = \
io/joy.h \
io/joy-unix.cpp
endif
## networking support sources
if FS2_OS_WIN32
FS2_SOURCES += \
network/multilag.cpp \
network/stand_gui.cpp \
network/stand_gui.h
endif
if FS2_OS_UNIX
FS2_SOURCES += \
network/stand_gui-unix.cpp \
network/stand_gui.h
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.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/midifile.cpp \
sound/midifile.h \
sound/midiseq.h \
sound/rbaudio.cpp \
sound/rbaudio.h \
sound/rtvoice.cpp \
sound/rtvoice.h \
sound/sound.cpp \
sound/sound.h \
sound/winmidi.cpp \
sound/winmidi.h \
sound/winmidi_base.cpp \
vcodec/codec1.cpp \
vcodec/codec1.h \
sound/fsspeech.cpp \
sound/fsspeech.h \
sound/speech.cpp \
sound/speech.h
if FS2_OS_WIN32
SOUND_SOURCES += \
sound/dscap.cpp \
sound/dscap.h
endif
endif
## Win32-specific sources
if FS2_OS_WIN32
WIN32_SOURCES = \
directx/dx8show.cpp \
directx/dx8show.h \
directx/vasync.h \
directx/vd3dtypes.h \
directx/vddraw.h \
directx/vdinput.h \
directx/vdplay.h \
directx/vdplobby.h \
directx/vdsetup.h \
directx/vdsound.h \
directx/vdvp.h \
globalincs/windebug.cpp \
graphics/gl/GLAUX.H \
graphics/gl/GLU.H \
graphics/gl/Gl.h \
graphics/gl/Glext.h \
graphics/gl/wglext.h \
graphics/GrD3DParticle.cpp \
graphics/GrD3DParticle.h \
graphics/GrD3DStateBlock.cpp \
graphics/grd3d.cpp \
graphics/grd3d.h \
graphics/grd3dbatch.cpp \
graphics/grd3dbatch.h \
graphics/grd3dcalls.cpp \
graphics/grd3dbmpman.cpp \
graphics/grd3dbmpman.h \
graphics/grd3dinternal.h \
graphics/grd3dlight.cpp \
graphics/grd3dlight.h \
graphics/grd3drender.cpp \
graphics/grd3dsetup.cpp \
graphics/grd3dsetup.h \
graphics/grd3dtexture.cpp \
osapi/monopub.h \
osapi/osapi.cpp \
osapi/osapi.h \
osapi/osregistry.cpp \
osapi/osregistry.h \
osapi/outwnd.cpp \
osapi/outwnd.h
endif
## Unix-specific sources
if FS2_OS_UNIX
UNIX_SOURCES = \
osapi/osapi_unix.cpp \
osapi/osapi.h \
osapi/osregistry_unix.cpp \
osapi/osregistry.h \
osapi/outwnd_unix.cpp \
osapi/outwnd.h \
windows_stub/stubs.cpp \
windows_stub/config.h
endif
## libcode.a
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
${WIN32_SOURCES} ${UNIX_SOURCES}
##
## End CODE library
##
###############################################################################
###############################################################################
##
## Begin MAIN fs2 binary
##
FS2OPEN_SOURCES = \
freespace2/freespace.cpp \
freespace2/freespace.h \
freespace2/levelpaging.cpp \
freespace2/levelpaging.h
fs2_open_d_SOURCES = \
${FS2OPEN_SOURCES} \
${PLATFORM_SOURCES}
fs2_open_r_SOURCES = \
${FS2OPEN_SOURCES} \
${PLATFORM_SOURCES}
fs2_open_d_LDADD = libcode.a ../libjpeg/libjpeg.a
fs2_open_r_LDADD = libcode.a ../libjpeg/libjpeg.a
##
## End MAIN binary
##
###############################################################################
###############################################################################
##
## Begin wxFRED2 binary
##
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/fredframe.cpp \
wxfred2/fredframe.h \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
wxFRED2_d_SOURCES = \
${wxFRED_SOURCES} \
${PLATFORM_SOURCES}
wxFRED2_r_SOURCES = \
${wxFRED_SOURCES} \
${PLATFORM_SOURCES}
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
##
## End wxFRED2 binary
##
###############################################################################
-96
View File
@@ -1,96 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
// The code in here is just for bookeeping, allocating
// ai slots and linking them to ships.
// See AiCode.cpp for the actual AI code.
#include "ai/ai.h"
#include "object/object.h"
#include "ship/ship.h"
int Total_goal_ship_names = 0;
char Goal_ship_names[MAX_GOAL_SHIP_NAMES][NAME_LENGTH];
ai_info Ai_info[MAX_AI_INFO];
ai_info *Player_ai;
// Return index of free AI slot.
// Return -1 if no free slot.
int ai_get_slot(int shipnum)
{
int i;
for (i=0; i<MAX_AI_INFO ; i++)
if (Ai_info[i].shipnum == -1) {
Ai_info[i].shipnum = shipnum;
return i;
}
Warning( LOCATION, "Couldn't get AI slot" );
Int3();
return -1;
}
// Releases an AI slot to be used by someone else.
// Only modifies in Ai_info struct. Does not modify hook in ship.
void ai_free_slot(int ai_index)
{
Assert( (ai_index >= 0) && (ai_index < MAX_AI_INFO) );
Ai_info[ai_index].shipnum = -1;
}
int get_wingnum(int objnum)
{
int shipnum, ai_index;
shipnum = Objects[objnum].instance;
ai_index = Ships[shipnum].ai_index;
return Ai_info[ai_index].wing;
}
void set_wingnum(int objnum, int wingnum)
{
int shipnum, ai_index;
Assert(Objects[objnum].type == OBJ_SHIP);
shipnum = Objects[objnum].instance;
Assert((shipnum >= 0) && (shipnum < MAX_SHIPS));
ai_index = Ships[shipnum].ai_index;
Assert( (ai_index >= 0) && (ai_index < MAX_AI_INFO) );
Ai_info[ai_index].wing = wingnum;
}
char *ai_get_goal_ship_name(char *name, int *index)
{
int i;
for (i=0; i < Total_goal_ship_names; i++)
if (!stricmp(name, Goal_ship_names[i])) {
*index = i;
return Goal_ship_names[i];
}
Assert(Total_goal_ship_names < MAX_GOAL_SHIP_NAMES);
Assert(strlen(name) < NAME_LENGTH - 1);
i = Total_goal_ship_names++;
strcpy(Goal_ship_names[i], name);
*index = i;
return Goal_ship_names[i];
}
-868
View File
@@ -1,868 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Ship/ai.h $
* $Revision: 1.7 $
* $Date: 2005-07-27 17:22:22 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.6 2005/07/25 03:13:24 Goober5000
* various code cleanups, tweaks, and fixes; most notably the MISSION_FLAG_USE_NEW_AI
* should now be added to all places where it is needed (except the turret code, which I still
* have to to review)
* --Goober5000
*
* Revision 1.5 2005/07/24 20:12:55 Goober5000
* cleaned up some rotating submodel code
* --Goober5000
*
* Revision 1.4 2005/07/22 09:19:39 wmcoolmon
* Dynamic AI Class number commit. KNOWN BUG: When AI_CLASS_INCREMENT is hit and vm_realloc is called, memory corruption seems to
* result. Not at all sure what causes this; if this can't be resolved soon, we can always treat _INCREMENT like _MAX
*
* Revision 1.3 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 1.2 2005/04/05 05:53:13 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
*
* Revision 2.21 2005/02/20 23:13:00 wmcoolmon
* Trails stuff, moved ship docking func declaration so FRED could get to it.
*
* Revision 2.20 2005/01/28 09:01:04 Goober5000
* finished implementing docking to a rotating submodel
* --Goober5000
*
* Revision 2.19 2005/01/27 11:26:23 Goober5000
* dock points on rotating submodels is *almost* working
* --Goober5000
*
* Revision 2.18 2005/01/13 03:33:07 Goober5000
* hmm, rolled back one of my clarifications since it caused things to get messed up
* --Goober5000
*
* Revision 2.17 2005/01/11 21:38:48 Goober5000
* multiple ship docking :)
* don't tell anyone yet... check the SCP internal
* --Goober500
*
* Revision 2.16 2004/08/11 05:06:33 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.15 2004/07/25 00:31:30 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 2.14 2004/03/05 09:01:51 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.13 2004/01/26 23:07:43 phreak
* bumped MAX_AI_CLASSES to 30 if INF_BUILD is defined
*
* Revision 2.12 2003/11/11 02:15:40 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --Goober5000
*
* Revision 2.11 2003/09/13 06:02:03 Goober5000
* clean rollback of all of argv's stuff
* --Goober5000
*
* Revision 2.9 2003/03/30 04:34:37 Goober5000
* preliminary work on ai facing sexp
* --Goober5000
*
* Revision 2.8 2003/01/19 22:20:22 Goober5000
* fixed a bunch of bugs -- the support ship sexp, the "no-subspace-drive" flag,
* and departure into hangars should now all work properly
* --Goober5000
*
* Revision 2.7 2003/01/19 07:02:15 Goober5000
* fixed a bunch of bugs - "no-subspace-drive" should now work properly for
* all ships, and all ships who have their departure anchor set to a capital ship
* should exit to that ship when told to depart
* --Goober5000
*
* Revision 2.6 2003/01/07 20:06:44 Goober5000
* added ai-chase-any-except sexp
* --Goober5000
*
* Revision 2.5 2003/01/06 22:57:23 Goober5000
* implemented keep-safe-distance
* --Goober5000
*
* Revision 2.4 2003/01/03 21:58:07 Goober5000
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
* has primitive sensors it can't target anything and objects don't appear
* on radar if they're outside a certain range. This range can be modified
* via the sexp primitive-sensors-set-range.
* --Goober5000
*
* Revision 2.3 2002/12/10 05:43:33 Goober5000
* Full-fledged ballistic primary support added! Try it and see! :)
*
* Revision 2.2 2002/10/19 19:29:28 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.1 2002/08/01 01:41:09 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:28 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:12 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 12 8/29/99 4:18p Andsager
* New "burst" limit for friendly damage. Also credit more damage done
* against large friendly ships.
*
* 11 8/26/99 5:14p Andsager
*
* 10 7/26/99 12:14p Andsager
* Apply cap to how much slower a transport flies with cargo. Remove
* limit on waypoint speed for training. Enemy ai get stealth exact pos
* when stealth fires
*
* 9 7/02/99 10:56a Andsager
* Put in big ship - big ship attack mode. Modify stealth sweep ai.
*
* 8 6/30/99 5:53p Dave
* Put in new anti-camper code.
*
* 7 6/23/99 5:51p Andsager
* Add waypoint-cap-speed. Checkin stealth ai - inactive.
*
* 6 6/14/99 10:45a Dave
* Made beam weapons specify accuracy by skill level in the weapons.tbl
*
* 5 4/20/99 6:39p Dave
* Almost done with artillery targeting. Added support for downloading
* images on the PXO screen.
*
* 4 4/20/99 3:40p Andsager
* Changes to big ship ai. Uses bounding box as limit where to fly to
* when flying away.
*
* 3 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:51a Dave
*
* 186 6/09/98 5:15p Lawrance
* French/German localization
*
* 185 5/23/98 2:41p Mike
* Make Easy the default skill level and prevent old pilot's skill level
* from carrying into new pilot.
*
* 184 5/20/98 12:45a Mike
* Fix bug in support ships aborting rearm. Also, remove test code that
* made any ship whose name began, "Kami" a kamikaze.
*
* 183 5/18/98 1:58a Mike
* Make Phoenix not be fired at fighters (but yes bombers).
* Improve positioning of ships in guard mode.
* Make turrets on player ship not fire near end of support ship docking.
*
* 182 5/13/98 4:41p Mike
* Make big ships try a tiny bit to avoid collision with each other when
* attacking another big ship. Make ships a little less likely to collide
* into player when in formation, drop off if player flying wacky.
*
* 181 5/12/98 4:53p Mike
* Make ships recover from collisions with big ships, eventually flying
* around.
*
* 180 5/10/98 11:30p Mike
* Better firing of bombs, less likely to go into strafe mode.
*
* 179 4/12/98 2:02p Mike
* Make small ships avoid big ships.
* Turn on Collide_friendly flag.
*
* 178 4/10/98 11:02p Mike
* Make countermeasures less effective against aspect seekers than against
* heat seekers.
* Make AI ships match bank with each other when attacking a faraway
* target.
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
* target.
*
* 177 4/08/98 8:38a Mike
* Make ships avoid player when attacking or guarding a faraway object.
*
* 176 4/06/98 12:46a Allender
* bump max ai goals down to 5
*
* 175 4/01/98 9:20a Mike
* Reduce MAX_SHIPS, MAX_OBJECTS and make MAX_AI_INFO same as MAX_SHIPS
*
* 174 3/21/98 3:36p Mike
* Fix/optimize attacking of big ships.
*
* 173 3/17/98 12:50a Mike
* Improved kamikaze behavior.
*
* 172 3/16/98 8:27p Allender
* Fred support for two new AI flags -- kamikaze and no dynamic goals.
*
* 171 3/16/98 12:03a Mike
* Add support for kamikaze mode. Add AIF_NO_DYNAMIC which means
* relentlessly pursue current goal.
*
* 170 3/15/98 9:44p Lawrance
* Get secondary weapons for turrets working
*
* 169 3/13/98 8:34a Mike
* Intermediate checkin to resolve link errors. Working on detecting
* whether dock with player ship is obstructed by another ship
*
* 168 3/09/98 5:12p Mike
* Make sure Pl_objp uses are valid.
* Throw asteroids at ships in asteroid field, not "Gal"
* Support ships warp out if no goals after 30 seconds.
*
* 167 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 166 2/22/98 4:17p John
* More string externalization classification... 190 left to go!
*
* 165 2/18/98 10:34p Allender
* repair/rearm system (for single and multi) about finished.
* dock/undock and ai goals packets implemented for multiplayer
*
* 164 2/17/98 5:03p Allender
* major cdhanges to rearm repair code. All flag and variable setting
* done in one function. A little more work to do. Fix bug in squad
* messaging when hotkey was used on invalid target
*
* 163 2/16/98 10:13p Allender
* initial work on being able to target weapons (bombs specifically).
* Work on getting rearm/repair working under multiplayer
*
* $NoKeywords: $
*/
#ifndef _AI_H
#define _AI_H
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
struct ship_weapon;
struct ship_subsys;
struct object;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
#define AIF_AWAITING_REPAIR (1 << 1) // Awaiting a repair ship.
#define AIF_BEING_REPAIRED (1 << 2) // Currently docked with repair ship.
#define AIF_REPAIRING (1 << 3) // Repairing a ship (or going to repair a ship)
#define AIF_SEEK_LOCK (1 << 4) // set if should focus on gaining aspect lock, not hitting with lasers
#define AIF_FORMATION_OBJECT (1 << 5) // Fly in formation off a specific object.
#define AIF_TEMPORARY_IGNORE (1 << 6) // Means current ignore_objnum is only temporary, not an order from the player.
#define AIF_USE_EXIT_PATH (1 << 7) // Used by path code, to flag path as an exit path
#define AIF_USE_STATIC_PATH (1 << 8) // Used by path code, use fixed path, don't try to recreate
#define AIF_TARGET_COLLISION (1 << 9) // Collided with aip->target_objnum last frame. Avoid that ship for half a second or so.
#define AIF_UNLOAD_SECONDARIES (1 << 10) // Fire secondaries as fast as possible!
#define AIF_ON_SUBSYS_PATH (1 << 11) // Current path leads to a subsystem
#define AIF_AVOID_SHOCKWAVE_SHIP (1 << 12) // Avoid an existing shockwave from a ship.
#define AIF_AVOID_SHOCKWAVE_WEAPON (1 << 13) // Avoid an expected shockwave from a weapon. shockwave_object field contains object index.
#define AIF_AVOID_SHOCKWAVE_STARTED (1 << 14) // Already started avoiding shockwave, don't keep deciding whether to avoid.
#define AIF_ATTACK_SLOWLY (1 << 15) // Move slowly while attacking.
#define AIF_REPAIR_OBSTRUCTED (1 << 16) // Ship wants to be repaired, but path is obstructed.
#define AIF_KAMIKAZE (1 << 17) // Crash into target
#define AIF_NO_DYNAMIC (1 << 18) // Not allowed to get dynamic goals
#define AIF_AVOIDING_SMALL_SHIP (1 << 19) // Avoiding a player ship.
#define AIF_AVOIDING_BIG_SHIP (1 << 20) // Avoiding a large ship.
#define AIF_BIG_SHIP_COLLIDE_RECOVER_1 (1 << 21) // Collided into a big ship. Recovering by flying away.
#define AIF_BIG_SHIP_COLLIDE_RECOVER_2 (1 << 22) // Collided into a big ship. Fly towards big ship sphere perimeter.
#define AIF_STEALTH_PURSUIT (1 << 23) // Ai is trying to fight stealth ship
// Goober5000
#define AIF_UNLOAD_PRIMARIES (1 << 24) // Fire primaries as fast as possible!
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
#define AIF_FORMATION (AIF_FORMATION_WING | AIF_FORMATION_OBJECT)
// dock_orient_and_approach() modes.
#define DOA_APPROACH 1 // Approach the current point on the path (aip->path_cur)
#define DOA_DOCK 2 // Dock with goal object.
#define DOA_UNDOCK_1 3 // Begin undocking with goal object. Just move away.
#define DOA_UNDOCK_2 4 // Secondary undocking. Move away.
#define DOA_UNDOCK_3 5 // Tertiary undocking. Move away and orient away.
#define DOA_DOCK_STAY 6 // Rigidly maintain position in dock bay.
// Type values for ai_dock_with_object() dock_type parameter.
#define AIDO_DOCK 1 // Set goal of docking with object.
#define AIDO_DOCK_NOW 2 // Immediately move into dock position. For ships that start mission docked.
#define AIDO_UNDOCK 3 // Set goal of undocking with object.
// Submodes for seeking safety.
#define AISS_1 41 // Pick a spot to fly to.
#define AISS_2 42 // Flying to spot.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2
#define MAX_AI_GOALS 5
// types of ai goals -- tyese types will help us to determination on which goals should
// have priority over others (i.e. when a player issues a goal to a wing, then a seperate
// goal to a ship in that wing). We would probably use this type in conjunction with
// goal priority to establish which goal to follow
#define AIG_TYPE_EVENT_SHIP 1 // from mission event direct to ship
#define AIG_TYPE_EVENT_WING 2 // from mission event direct to wing
#define AIG_TYPE_PLAYER_SHIP 3 // from player direct to ship
#define AIG_TYPE_PLAYER_WING 4 // from player direct to wing
#define AIG_TYPE_DYNAMIC 5 // created on the fly
// flags for AI_GOALS
#define AIGF_DOCKER_INDEX_VALID (1<<0) // when set, index field for docker is valid
#define AIGF_DOCKEE_INDEX_VALID (1<<1) // when set, index field for dockee is valid
#define AIGF_GOAL_ON_HOLD (1<<2) // when set, this goal cannot currently be satisfied, although it could be in the future
#define AIGF_SUBSYS_NEEDS_FIXUP (1<<3) // when set, the subsystem index (for a destroy subsystem goal) is invalid and must be gotten from the subsys name stored in docker.name field!!
#define AIGF_GOAL_OVERRIDE (1<<4) // paired with AIG_TYPE_DYNAMIC to mean this goal overrides any other goal
#define AIGF_PURGE (1<<5) // purge this goal next time we process
#define AIGF_GOALS_PURGED (1<<6) // this goal has already caused other goals to get purged
#define AIGF_DOCK_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
// Flags to ai_turn_towards_vector().
#define AITTV_FAST (1<<0) // Turn fast, not slowed down based on skill level.
#define AITTV_VIA_SEXP (1<<1) // Goober5000 - via sexp
#define AITTV_IGNORE_BANK (1<<2) // Goober5000 - ignore bank when turning
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
// Goober5000, currently only used for the ai-chase-any-except behavior. This can never go
// above 32, because 32 is the maximum number of bits possible in a unit data type. If you
// need more, you're out of luck - you'll have to add a second special object array. :)
#define MAX_SPECIAL_OBJECTS 32
// structure for AI goals
typedef struct ai_goal {
int signature; // Unique identifier. All goals ever created (per mission) have a unique signature.
int ai_mode; // one of the AIM_* modes for this goal
int ai_submode; // maybe need a submode
int type; // one of the AIG_TYPE_* values above
int flags; // one of the AIGF_* values above
fix time; // time at which this goal was issued.
int priority; // how important is this goal -- number 0 - 100
char *ship_name; // name of the ship that this goal acts upon
int ship_name_index; // index of ship_name in Goal_ship_names[][]
int wp_index; // index into waypoints list of waypoints that this ship might fly.
int weapon_signature; // signature of weapon this ship might be chasing. Paired with above value to get target.
// Goober5000
char *special_object[MAX_SPECIAL_OBJECTS]; // name of ship (or wing) that this goal acts upon
int special_object_num[MAX_SPECIAL_OBJECTS]; // index of ship or wing in Ship[] or Wing[]
int special_object_index[MAX_SPECIAL_OBJECTS]; // index of special_object in Goal_ship_names[][]
uint special_object_flags;
int num_special_objects;
// unions for docking stuff.
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
// these are the dockpoints used on the docker and dockee ships, not the ships themselves
union {
char *name;
int index;
} docker;
union {
char *name;
int index;
} dockee;
} ai_goal;
#define MAX_GOAL_SHIP_NAMES 100
#define AIM_CHASE 0
#define AIM_EVADE 1
#define AIM_GET_BEHIND 2
#define AIM_STAY_NEAR 3 // Stay near another ship.
#define AIM_STILL 4 // Sit still. Don't move. Hold your breath. Don't blink.
#define AIM_GUARD 5 // Guard an object
#define AIM_AVOID 6 // Avoid an object
#define AIM_WAYPOINTS 7 // Fly waypoints
#define AIM_DOCK 8 // Dock with ship.
#define AIM_NONE 9 // Uh, do nothing.
#define AIM_BIGSHIP 10 // Like a capital ship, doesn't focus on one ship.
#define AIM_PATH 11 // Follow path on ship
#define AIM_BE_REARMED 12 // Allow self to be rearmed
#define AIM_SAFETY 13 // Seek safety at periphery of battle
#define AIM_EVADE_WEAPON 14 // Evade a weapon.
#define AIM_STRAFE 15 // attack a big ship by strafing it
#define AIM_PLAY_DEAD 16 // Play dead. Get it? Don't move, fire, etc.
#define AIM_BAY_EMERGE 17 // Emerging from a fighter bay, following path to do so
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
#define AIM_WARP_OUT 20 // Commence warp out sequence. Point in legal direction. Then call John's code.
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
#define MAX_AI_BEHAVIORS 22 // Number of AIM_xxxx types
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_WAYPOINT_LISTS 32
#define MAX_ENEMY_DISTANCE 2500.0f // maximum distance from which a ship will pursue an enemy.
// waypoint list flags bitmasks.
#define WL_MARKED 0x01
typedef struct waypoint_list {
char name[NAME_LENGTH];
int count;
char flags[MAX_WAYPOINTS_PER_LIST];
vec3d waypoints[MAX_WAYPOINTS_PER_LIST];
} waypoint_list;
#define AI_GOAL_NONE -1
#define AI_ACTIVE_GOAL_DYNAMIC 999
typedef struct ai_class {
char name[NAME_LENGTH];
float ai_accuracy[NUM_SKILL_LEVELS];
float ai_evasion[NUM_SKILL_LEVELS];
float ai_courage[NUM_SKILL_LEVELS];
float ai_patience[NUM_SKILL_LEVELS];
} ai_class;
// Submode definitions.
// Note: These need to be renamed to be of the form: AIS_mode_xxxx
#define SM_CONTINUOUS_TURN 1 // takes parm: vector_id {0..3 = right, -right, up, -up}
#define SM_ATTACK 2
#define SM_EVADE_SQUIGGLE 3
#define SM_EVADE_BRAKE 4
#define SM_EVADE 5
#define SM_SUPER_ATTACK 6
#define SM_AVOID 7
#define SM_GET_BEHIND 8
#define SM_GET_AWAY 9
#define SM_EVADE_WEAPON 10 // Evade incoming weapon
#define SM_FLY_AWAY 11 // Fly away from target_objnum
#define SM_ATTACK_FOREVER 12 // Engine subsystem destroyed, so attack, never evading, avoiding, etc.
#define SM_STEALTH_FIND 13 // Stealth ship is "targeted", but not visible, so try to find based on predicted pos
#define SM_STEALTH_SWEEP 14 // General sweep, looking for stealth after not visible for some time.
#define SM_BIG_APPROACH 15 // Big ship approaches another
#define SM_BIG_CIRCLE 16 // Big ship flies circle around other big ship to get good angle to go parallel
#define SM_BIG_PARALLEL 17 // Big ship flies parallel to another
// Submodes for docking behavior
#define AIS_DOCK_0 21
#define AIS_DOCK_1 22
#define AIS_DOCK_2 23
#define AIS_DOCK_3 24
//#define AIS_DOCK_3A 25
#define AIS_DOCK_4 26 // Only for rearm/repair.
#define AIS_DOCK_4A 27 // Only for not rearm/repair. MK, 7/15/97
#define AIS_UNDOCK_0 30
#define AIS_UNDOCK_1 31
#define AIS_UNDOCK_2 32
#define AIS_UNDOCK_3 33
#define AIS_UNDOCK_4 34
// Submodes for Guard behavior
#define AIS_GUARD_PATROL 101
#define AIS_GUARD_ATTACK 102
#define AIS_GUARD_2 103
#define AIS_GUARD_STATIC 104 // maintain current relative position to guard object, if possible
// Submodes for strafing big ships behavior (AIM_STRAFE)
#define AIS_STRAFE_ATTACK 201 // fly towards target and attack
#define AIS_STRAFE_AVOID 202 // fly evasive vector to avoid incoming fire
#define AIS_STRAFE_RETREAT1 203 // fly away from attack point
#define AIS_STRAFE_RETREAT2 204
#define AIS_STRAFE_POSITION 205 // re-position to resume strafing attack
#define WPF_REPEAT (1 << 0)
#define WPF_BACKTRACK (1 << 1)
#define PD_FORWARD 1
#define PD_BACKWARD -1
#define MIN_TRACKABLE_ASPECT_DOT 0.992f // dot of fvec and vec_to_enemy to progress towards aspect lock
// Submodes for warping out.
#define AIS_WARP_1 300 // Make sure there is no obstruction to warping out.
#define AIS_WARP_2 301
#define AIS_WARP_3 302
#define AIS_WARP_4 303
#define AIS_WARP_5 304
#define AIS_DEPART_TO_BAY 305
// A node on a path.
// Contains global location of point.
// Contains hooks back to original path information.
// This hook is used to extract information on the point such as whether it is
// protected by turrets.
typedef struct pnode {
vec3d pos;
int path_num; // path number from polymodel, ie in polymodel, paths[path_num]
int path_index; // index in original model path of point, ie in model_path, use verts[path_index]
} pnode;
#define MAX_PATH_POINTS 1000
extern pnode Path_points[MAX_PATH_POINTS];
extern pnode *Ppfp; // Free pointer in path points.
typedef struct ai_info {
int ai_flags; // Special flags for AI behavior.
int shipnum; // Ship using this slot, -1 means none.
int type; //
int wing; // Member of what wing? -1 means none.
int behavior; // AI Class. Doesn't change after initial setting.
int mode;
int previous_mode;
int mode_time; // timestamp at which current mode elapses.
int target_objnum; // object index of current target.
int target_signature; // Signature of current target.
int previous_target_objnum; // On 5/19/97, only used for player.
int stealth_last_cheat_visible_stamp; // when within 100m, always update pos and velocity, with error increasing for increasing time from last legal visible
int stealth_last_visible_stamp;
float stealth_sweep_box_size;
vec3d stealth_last_pos;
vec3d stealth_velocity;
float previous_dot_to_enemy; // dot(fvec, vec_to_enemy) last frame
float target_time; // Amount of time continuously targeting this ship.
int enemy_wing; // When picking an enemy wing, only allow to be in enemy_wing, unless == -1, in which case don't care.
int attacker_objnum;
int goal_objnum; // mode specific goal. In DOCK, ship to dock with.
int goal_signature;
int guard_objnum; // Ship to guard.
int guard_signature; // Signature of ship to guard.
int guard_wingnum; // Wing to guard. guard_objnum set to leader.
int ignore_objnum; // ship to be ignored, based on player order. UNUSED_OBJNUM if none. -(wing_num+1) if ignoring wing.
int ignore_signature; // signature of ship to be ignored
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
int wp_list; // waypoint list index
int wp_index; // waypoint index in list
int wp_flags; // waypoint flags, see WPF_xxxx
int wp_dir; // 1 or -1, amount to add to get to next waypoint index.
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
// Path following information
int path_start; // Index into global array, start of path.
int path_cur; // Index into global array, current location in path.
int path_length; // Number of links in this path.
int path_dir; // PD_FORWARD, PD_BACKWARD
int path_flags; // loop, backtrack, whatever else.
int path_objnum; // Object of interest. It's model contains the path.
int path_goal_obj_hash; // Hash value of goal object when global path created.
fix path_next_create_time; // Next time at which we'll create a global path.
vec3d path_create_pos; // Object's position at time of global path creation.
matrix path_create_orient; // Object's orientation at time of global path creation.
int mp_index; // Model path index. Index in polymodel:model_paths
fix path_next_check_time; // Last time checked to see if would collide with model.
int path_goal_dist; // minimum distance to first path point to consider path reached
int path_subsystem_next_check; // timestamp to next check if subsystem is still visible
int submode;
int previous_submode; // previous submode, get it?
float best_dot_to_enemy; // best dot product to enemy in last BEST_DOT_TIME seconds
float best_dot_from_enemy; // best dot product for enemy to player in last BEST_DOT_TIME seconds
fix best_dot_to_time; // time at which best dot occurred
fix best_dot_from_time; // time at which best dot occurred
fix submode_start_time; // time at which we entered the current submode
int submode_parm0; // parameter specific to current submode
fix next_predict_pos_time; // Next time to predict position.
ai_goal goals[MAX_AI_GOALS];
int active_goal; // index of active goal, -1 if none, AI_ACTIVE_GOAL_DYNAMIC if dynamic (runtime-created) goal
int goal_check_time; // timer used for processing goals for this ai object
vec3d last_predicted_enemy_pos; // Where he thought enemy was last time.
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
int last_hit_quadrant; // Shield section of last hit.
fix last_hit_target_time; // Missiontime of last time this ship successfully hit target.
int hitter_objnum; // Object index of ship that hit this ship last time.
int hitter_signature; // Signature of hitter. Prevents stupidity if hitter gets killed.
fix resume_goal_time; // Time at which to resume interrupted goal, if nothing else intervenes.
float prev_accel; // Acceleration last frame.
float prev_dot_to_goal; // dot of fvec to goal last frame, used to see if making progress towards goal.
vec3d goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
vec3d prev_goal_point; // Previous location of goal point, used at least for evading.
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
union {
float lead_scale; // Amount to lead current opponent by.
float stay_near_distance; // Distance to stay within for AIM_STAY_NEAR mode.
};
ship_subsys* targeted_subsys; // Targeted subobject on current target. NULL if none;
ship_subsys* last_subsys_target; // last known subsystem target
int targeted_subsys_parent; // Parent objnum of subobject, not necessarily targeted
float aspect_locked_time; // Time towards acquiring lock for current_target
// ship_subsys *targeted_subobject; // subsystem to attack
// int attack_subsystem_parent; // objnum of the object containing the attack_subsystem
// Goober5000
int support_ship_objnum; // objnum of support ship docking with us, or (if we're a support ship) object we're docking to
int support_ship_signature; // signature of the same
int danger_weapon_objnum; // Closest objnum of weapon fired at this ship.
int danger_weapon_signature; // Signature of object danger_weapon_objnum.
vec3d guard_vec; // vector to object being guarded, only used in AIS_GUARD_STATIC submode
int nearest_locked_object; // Nearest locked object.
float nearest_locked_distance; // Distance to nearest locked object.
float current_target_distance; // Distance of current target from player
int current_target_is_locked; // Flag to indicate whether the current target is locked for missile fire
int current_target_dist_trend; // Tracks whether distance to target is increasing or decreasing
int current_target_speed_trend; // Tracks whether speed of target is increasing or decreasing
float last_dist; // last frame's distance between player and target
float last_speed; // last frame's target speed
int last_secondary_index; // needed for secondary weapon change check
int last_target;
int rearm_first_missile; // flag to show that reloading of missilies hasn't begun yet
int rearm_first_ballistic_primary; // flag to show that reloading of ballistic primaries hasn't begun yet
int rearm_release_delay; // timestamp used to delay separation of ships after rearm complete
fix afterburner_stop_time; // Missiontime to turn off afterburner
int last_objsig_hit; // The object number signature of the ship last hit by this ship
int ignore_expire_timestamp; // Timestamp at which temporary ignore (AIF_TEMPORARY_IGNORE) expires.
int warp_out_timestamp; // Timestamp at which this ship is to warp out.
int next_rearm_request_timestamp; // Timestamp at which ship might next request rearm.
int primary_select_timestamp; // When to next select a primary weapon.
int secondary_select_timestamp; // When to next select a secondary weapon.
int scan_for_enemy_timestamp; // When to next look for enemy fighters if sitting still while pounding
// on a bigship. SCAN_FIGHTERS_INTERVAL is defined in AiBig.h
int choose_enemy_timestamp; // Time at which it is next legal to choose a new enemy (does not apply
// to special situations, like getting hit by a weapon)
int force_warp_time; // time at which to give up avoiding a ship and just warp out
int shockwave_object; // Object index of missile that will generate a shockwave. We will try to avoid.
int shield_manage_timestamp; // Time at which to next manage shield.
int self_destruct_timestamp; // Time at which to self-destruct, probably due to being disabled.
int ok_to_target_timestamp; // Time at which this ship can dynamically target.
float kamikaze_damage; // some damage value used to produce a shockwave from a kamikaze ship
vec3d big_attack_point; // Global point this ship is attacking on a big ship.
vec3d big_attack_surface_normal; // Surface normal at ship at big_attack_point;
int pick_big_attack_point_timestamp; // timestamp at which to pick a new point to attack on a big ship.
// Note: These three avoid_XX terms are shared between the code that avoids small (only player now) and large ships
// The bits in ai_flags determine which is occurring. AIF_AVOID_SMALL_SHIP, AIF_AVOID_BIG_SHIP
int avoid_ship_num; // object index of small ship to avoid
vec3d avoid_goal_point; // point to aim at when avoiding a ship
fix avoid_check_timestamp; // timestamp at which to next check for having to avoid ship
vec3d big_collision_normal; // Global normal of collision with big ship. Helps find direction to fly away from big ship. Set for each collision.
vec3d big_recover_pos_1; // Global point to fly towards when recovering from collision with a big ship, stage 1.
vec3d big_recover_pos_2; // Global point to fly towards when recovering from collision with a big ship, stage 2.
int big_recover_timestamp; // timestamp at which it's OK to re-enter stage 1.
int abort_rearm_timestamp; // time at which this rearm should be aborted in a multiplayer game.
// artillery targeting info
int artillery_objnum; // object currently being targeted for artillery lock/attack
int artillery_sig; // artillery object signature
float artillery_lock_time; // how long we've been locked onto this guy
vec3d artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
float lethality; // measure of how dangerous ship is to enemy BIG|HUGE ships (likelyhood of targeting)
} ai_info;
#define MAX_AI_INFO MAX_SHIPS
// SUBSYS_PATH_DIST is used as the distance that a subsystem path should terminate from the actual
// subsystem. We don't want to rely on the model path points for this, since we may need to be
// changed.
#define SUBSYS_PATH_DIST 500.0f
// Friendly damage defines
#define MAX_BURST_DAMAGE 20 // max damage that can be done in BURST_DURATION
#define BURST_DURATION 500 // decay time over which Player->damage_this_burst falls from MAX_BURST_DAMAGE to 0
extern int Mission_all_attack; // !0 means all teams attack all teams.
extern int Total_goal_ship_names;
extern char Goal_ship_names[MAX_GOAL_SHIP_NAMES][NAME_LENGTH];
extern void update_ai_info_for_hit(int hitter_obj, int hit_obj);
extern void ai_frame_all(void);
extern int find_guard_obj(void);
extern ai_info Ai_info[];
extern ai_info *Player_ai;
extern int Waypoints_created; // externed since needed for save/restore
extern ai_class *Ai_classes;
extern char** Ai_class_names;
extern int Num_ai_classes;
extern int Ai_firing_enabled;
extern char *Skill_level_names(int skill_level, int translate = 1);
extern int Skill_level_max_attackers[NUM_SKILL_LEVELS];
extern int Ai_goal_signature;
// need access to following data in AiBig.cpp
extern object *Pl_objp;
extern object *En_objp;
extern float AI_frametime;
// Return index of free AI slot.
// Return 0 if no free slot.
int ai_get_slot(int shipnum);
// Releases an AI slot to be used by someone else.
void ai_free_slot(int ai_index);
// call to init one ai object.. you can pass all sorts of
// stuff by adding new paramters.
void ai_object_init(object * obj, int ai_index);
// Called once a frame
void ai_process( object * obj, int ai_index, float frametime );
int get_wingnum(int objnum);
void set_wingnum(int objnum, int wingnum);
char *ai_get_goal_ship_name(char *name, int *index);
extern waypoint_list Waypoint_lists[MAX_WAYPOINT_LISTS];
extern int Num_waypoint_lists;
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, int priority, ship_subsys *ssp, int except = 0);
extern void ai_evade_object(object *evader, object *evaded, int priority);
extern void ai_ignore_object(object *ignorer, object *ignored, int priority);
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int priority, int dock_type);
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
extern void ai_set_default_behavior(object *obj, int classnum);
extern void ai_do_default_behavior(object *obj);
extern void ai_start_waypoints(object *objp, int waypoint_list_index, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_quadrant, vec3d *hit_normal);
extern void ai_ship_destroy(int shipnum, int method);
extern void ai_turn_towards_vector(vec3d *dest, object *objp, float frametime, float turn_time, vec3d *slide_vec, vec3d *rel_pos, float bank_override, int flags, vec3d *rvec = NULL, int sexp_flags = 0);
extern void init_ai_object(int objnum);
extern void ai_init(void); // Call this one to parse ai.tbl.
extern void ai_level_init(void); // Call before each level to reset AI
extern int ai_set_attack_subsystem(object *objp, int subnum);
extern int ai_issue_rearm_request(object *requester_objp); // Object requests rearm/repair.
extern int ai_abort_rearm_request(object *requester_objp); // Object aborts rearm/repair.
extern void ai_do_repair_frame(object *objp, ai_info *aip, float frametime); // Repair a ship object, player or AI.
extern void ai_update_danger_weapon(int objnum, int weapon_objnum);
// called externally from MissionParse.cpp to position ships in wings upon arrival into the
// mission.
extern void get_absolute_wing_pos( vec3d *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
// Interface from goals code to AI. Set ship to guard. *objp guards *other_objp
extern void ai_set_guard_object(object *objp, object *other_objp);
extern void ai_set_evade_object(object *objp, object *other_objp);
extern void ai_set_guard_wing(object *objp, int wingnum);
extern void ai_warp_out(object *objp, vec3d *vp);
extern void ai_attack_wing(object *attacker, int wingnum, int priority);
extern void ai_deathroll_start(object *ship_obj);
extern void ai_fly_in_formation(int wing_num); // Force wing to fly in formation.
extern void ai_disband_formation(int wing_num); // Force wing to disband formation flying.
extern int set_target_objnum(ai_info *aip, int objnum);
extern void ai_form_on_wing(object *objp, object *goal_objp);
extern void ai_do_stay_near(object *objp, object *other_obj, float dist);
extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int parent_objnum);
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index, int priority );
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int subsys_path=0);
// Goober5000
extern void ai_do_safety(object *objp);
// used to get path info for fighter bay emerging and departing
int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, vec3d *pos, vec3d *fvec);
int ai_acquire_depart_path(object *pl_objp, int parent_objnum);
// used by AiBig.cpp
extern void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vec3d *player_pos, vec3d *enemy_pos);
extern void accelerate_ship(ai_info *aip, float accel);
extern void turn_away_from_point(object *objp, vec3d *point, float bank_override);
extern float ai_endangered_by_weapon(ai_info *aip);
extern void update_aspect_lock_information(ai_info *aip, vec3d *vec_to_enemy, float dist_to_enemy, float enemy_radius);
extern void ai_chase_ct();
extern void ai_find_path(object *pl_objp, int objnum, int path_num, int exit_flag, int subsys_path=0);
extern float ai_path();
extern void evade_weapon();
extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enemy, float dist_to_enemy, float duration);
extern int ai_fire_primary_weapon(object *objp); //changed to return weather it fired-Bobboau
extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priority2 = -1);
extern float ai_get_weapon_dist(ship_weapon *swp);
extern void turn_towards_point(object *objp, vec3d *point, vec3d *slide_vec, float bank_override);
extern int ai_maybe_fire_afterburner(object *objp, ai_info *aip);
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
extern int is_instructor(object *objp);
extern int find_enemy(int objnum, float range, int max_attackers, int except = 0);
float ai_get_weapon_speed(ship_weapon *swp);
void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
// function to change rearm status for ai ships (called from sexpression code)
extern void ai_set_rearm_status( int team, int new_status );
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, char *shipname );
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point);
extern void ai_do_objects_undocked_stuff( object *docker, object *dockee );
extern void ai_do_objects_repairing_stuff( object *repaired_obj, object *repair_obj, int how );
extern int find_danger_weapon(object *sobjp, float dtime, float *atime, float dot_threshhold);
void ai_set_mode_warp_out(object *objp, ai_info *aip);
// prototyped by Goober5000
int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float range, int max_attackers, int except = 0);
// moved to header file by Goober5000
void ai_announce_ship_dying(object *dying_objp);
// added by kazan
void ai_start_fly_to_ship(object *objp, int shipnum);
void ai_fly_to_ship();
//Moved declaration here for player ship -WMC
void process_subobjects(int objnum);
#endif
File diff suppressed because it is too large. Load diff
-107
View File
@@ -1,107 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Ship/AiBig.h $
* $Revision: 1.3 $
* $Date: 2005-07-13 02:50:48 $
* $Author: Goober5000 $
*
* Header file for AI code related to large ships
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/04/05 05:53:13 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
*
* Revision 2.2 2004/08/11 05:06:34 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2004/03/05 09:01:51 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:28 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:12 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:51a Dave
*
* 13 4/29/98 5:01p Mike
* Large overhaul in how turrets fire.
*
* 12 4/27/98 11:59p Mike
* Intermediate checkin. Getting big ship turrets firing at big ships to
* use pick_big_attack_point.
*
* 11 3/21/98 3:36p Mike
* Fix/optimize attacking of big ships.
*
* 10 1/29/98 1:39p Mike
* Better heat seeking homing on big ships.
*
* 9 1/22/98 5:14p Lawrance
* clean up ai_big code, clear path info when stop attacking a subsystem
*
* 8 1/06/98 6:58p Lawrance
* Attack turrets (sometimes) when fired upon while attacking a ship.
*
* 7 12/15/97 7:16p Lawrance
* improving subsystem attacking
*
* 6 12/01/97 5:11p Lawrance
* make strafe mode more effective... slow down when approaching and use
* afterburner in avoids
*
* 5 10/30/97 9:17p Lawrance
* work on getting AIM_STRAFE working well with disable/disarm, try to
* balance
*
* 4 10/30/97 12:32a Lawrance
* further work on AIM_STRAFE
*
* 3 10/29/97 6:24p Lawrance
* extern ai_strafe()
*
* 2 10/26/97 3:24p Lawrance
* split off large ship ai code into AiBig.cpp
*
* $NoKeywords: $
*/
#ifndef __AIBIG_H__
#define __AIBIG_H__
struct object;
struct ai_info;
struct vec3d;
struct ship_subsys;
void ai_big_ship(object *objp);
void ai_big_chase();
void ai_big_subsys_path_cleanup(ai_info *aip);
// strafe functions
void ai_big_strafe();
int ai_big_maybe_enter_strafe_mode(object *objp, int weapon_objnum, int consider_target_only=0);
void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp);
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-278
View File
@@ -1,278 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
* $Revision: 1.2 $
* $Date: 2005-07-13 02:50:48 $
* $Author: Goober5000 $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2005/03/25 06:45:13 wmcoolmon
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
*
* Revision 2.6 2004/08/11 05:06:34 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.5 2004/07/25 00:31:31 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 2.4 2004/03/05 09:01:52 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.3 2003/01/07 20:06:44 Goober5000
* added ai-chase-any-except sexp
* --Goober5000
*
* Revision 2.2 2003/01/06 21:52:58 Goober5000
* allowed fighters and bombers to accept the stay-near-ship and
* keep-safe-distance orders
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:28 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:12 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 5 7/09/99 5:54p Dave
* Seperated cruiser types into individual types. Added tons of new
* briefing icons. Campaign screen.
*
* 4 3/26/99 4:49p Dave
* Made cruisers able to dock with stuff. Made docking points and paths
* visible in fred.
*
* 3 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:51a Dave
*
* 46 2/26/98 10:08p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 45 2/22/98 4:17p John
* More string externalization classification... 190 left to go!
*
* 44 2/16/98 10:13p Allender
* initial work on being able to target weapons (bombs specifically).
* Work on getting rearm/repair working under multiplayer
*
* 43 2/13/98 3:21p Lawrance
* Set up allowed goals for escape pods.
*
* 42 1/30/98 10:01a Allender
* made large ships able to attack other ships. Made goal code recognize
* when ships removed from wings during ship select
*
* 41 12/15/97 5:25p Allender
* fix problem with docked ships receiving another dock goal. They now
* properly undock
*
* 40 11/17/97 6:39p Lawrance
* add AI_goal_text[] array, used by HUD code to show text description of
* order
*
* 39 10/29/97 10:02p Allender
* be sure that player starting wings that arrive late also form on the
* players wing if there are no goals
*
* 38 10/23/97 4:41p Allender
* lots of new rearm/repair code. Rearm requests now queue as goals for
* support ship. Warp in of new support ships functional. Support for
* stay-still and play-dead.
*
* 37 10/22/97 1:44p Allender
* more work on stay-still and play-dead
*
* 36 10/22/97 11:07a Allender
* Hooked in form on my wing into Mikes AI code
*
* 35 10/22/97 10:33a Hoffoss
* Added AI_GOAL_PLAY_DEAD as a valid goal for all ships.
*
* 34 10/22/97 9:54a Allender
* added ai_goal_play_dead
*
* 33 10/10/97 5:03p Allender
* started work on ai-stay-still
*
* 32 9/23/97 4:35p Allender
* added two function to add "internal" goals to ships and wings. Used by
* AI when it needs to do something special
*
* 31 8/15/97 11:07a Hoffoss
* Added warning to help eliminate problems later on down the road.
*
* 30 8/15/97 9:59a Hoffoss
* Changed ai_query_goal_valid() again. I can't think of any time you
* wouldn't find it easier just to pass in a ship instead of a ship_info
* flag structure filtered of all flags that aren't ship type bits. Since
* I'll call this quite a few times, it will make my life easier.
*
* 29 8/14/97 10:00p Allender
* made ai goals bitfields so that we can have set of orders that certain
* ship types are allowed to receive. Added function for Hoffoss to check
* goal vs. ship type validity
*
* 28 8/12/97 1:55a Hoffoss
* Made extensive changes to object reference checking and handling for
* object deletion call.
*
* 27 8/08/97 1:30p Allender
* added commands (and ai goals) for support ships. stay near ship (which
* could be player or current target), and keep safe distance
*
* 26 8/06/97 9:41a Allender
* renamed from ai_goal function. made a function to remove a goal from a
* wing (used strictly for waypoints now). ai-chase-wing and
* ai-guard-wing now appear to user as ai-chase and ai-guard. Tidied up
* function which deals with sexpression goals
*
* 25 8/06/97 8:06a Lawrance
* add more stuff to save/restore
*
* 24 7/24/97 4:55p Allender
* added ai-evade-ship to fred and to Freespace
*
* 23 7/17/97 4:23p Allender
* ai-guard-wing now in both Fred and Freespace
*
* 22 7/15/97 11:57a Hoffoss
* Added a general ai goal reference update mode.
*
* 21 6/18/97 11:46a Hoffoss
* Fixed initial order object reference updating and added briefing dialog
* window tracking data.
*
* $NoKeywords: $
*/
#ifndef _AIGOALS_H
#define _AIGOALS_H
#include "globalincs/globals.h"
struct wing;
struct ai_info;
struct ai_goal;
// macros for goals which get set via sexpressions in the mission code
// IMPORTANT! If you add a new AI_GOAL_x define, be sure to update the functions
// ai_update_goal_references() and query_referenced_in_ai_goals() or else risk breaking
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
#define AI_GOAL_CHASE (1<<1)
#define AI_GOAL_DOCK (1<<2) // used for undocking as well
#define AI_GOAL_WAYPOINTS (1<<3)
#define AI_GOAL_WAYPOINTS_ONCE (1<<4)
#define AI_GOAL_WARP (1<<5)
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6)
#define AI_GOAL_FORM_ON_WING (1<<7)
#define AI_GOAL_UNDOCK (1<<8)
#define AI_GOAL_CHASE_WING (1<<9)
#define AI_GOAL_GUARD (1<<10)
#define AI_GOAL_DISABLE_SHIP (1<<11)
#define AI_GOAL_DISARM_SHIP (1<<12)
#define AI_GOAL_CHASE_ANY (1<<13)
#define AI_GOAL_IGNORE (1<<14)
#define AI_GOAL_GUARD_WING (1<<15)
#define AI_GOAL_EVADE_SHIP (1<<16)
// the next goals are for support ships only
#define AI_GOAL_STAY_NEAR_SHIP (1<<17)
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18)
#define AI_GOAL_REARM_REPAIR (1<<19)
#define AI_GOAL_STAY_STILL (1<<20)
#define AI_GOAL_PLAY_DEAD (1<<21)
#define AI_GOAL_CHASE_WEAPON (1<<22)
// Goober5000: new goals go here
// Goober5000: this new goal is special: it doesn't take the usual kind of argument; it takes
// many arguments, requiring a modification to the ai_goal data type. Therefore, I didn't
// add it to ai_update_goal_references() or ai_query_goal_references(). I also didn't add it
// to the list in Fred\Management.cpp, because it can't be specified as an initial order - it
// can only be specified through a sexp.
#define AI_GOAL_CHASE_ANY_EXCEPT (1<<23) // hey Hoffoss! I added a new goal! :p
#define AI_GOAL_FLY_TO_SHIP (1<<24) // kazan
// now the masks for ship types
// Goober5000: added AI_GOAL_STAY_NEAR_SHIP and AI_GOAL_KEEP_SAFE_DISTANCE as valid for fighters
#define AI_GOAL_ACCEPT_FIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_DESTROY_SUBSYSTEM | AI_GOAL_CHASE_WING | AI_GOAL_GUARD | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP | AI_GOAL_CHASE_ANY | AI_GOAL_IGNORE | AI_GOAL_GUARD_WING | AI_GOAL_EVADE_SHIP | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_CHASE_ANY_EXCEPT )
#define AI_GOAL_ACCEPT_BOMBER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_STEALTH ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_TRANSPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_CHASE_WING | AI_GOAL_DOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_UNDOCK | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD| AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_FREIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CRUISER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FREIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CORVETTE ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_GAS_MINER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_AWACS ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CAPITAL ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER & ~(AI_GOAL_DOCK | AI_GOAL_UNDOCK) | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_SUPERCAP ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CAPITAL | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_SUPPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_DOCK | AI_GOAL_UNDOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
#define AI_GOAL_ACCEPT_ESCAPEPOD ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT| AI_GOAL_STAY_NEAR_SHIP )
#define MAX_AI_DOCK_NAMES 25
extern int Num_ai_dock_names;
extern char Ai_dock_names[MAX_AI_DOCK_NAMES][NAME_LENGTH];
extern char *Ai_goal_text(int goal);
// extern function definitions
extern void ai_post_process_mission();
extern void ai_maybe_add_form_goal( wing *wingp );
extern void ai_process_mission_orders( int objnum, ai_info *aip );
// adds goals to ships/wing through sexpressions
extern void ai_add_ship_goal_sexp( int sexp, int type, ai_info *aip );
extern void ai_add_wing_goal_sexp( int sexp, int type, int wingnum );
extern void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp );
// adds goals to ships/sings through player orders
extern void ai_add_ship_goal_player( int type, int mode, int submode, char *shipname, ai_info *aip );
extern void ai_add_wing_goal_player( int type, int mode, int submode, char *shipname, int wingnum );
extern void ai_remove_ship_goal( ai_info *aip, int index );
extern void ai_clear_ship_goals( ai_info *aip );
extern void ai_clear_wing_goals( int wingnum );
extern void ai_copy_mission_wing_goal( ai_goal *aigp, ai_info *aip );
extern void ai_mission_goal_complete( ai_info *aip );
extern void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp );
extern int ai_get_subsystem_type( char *subsystem );
extern char *ai_get_subsystem_type_name(int type);
extern void ai_update_goal_references(ai_goal *goals, int type, char *old_name, char *new_name);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name);
extern char *ai_add_dock_name(char *str);
extern int ai_query_goal_valid( int ship, int ai_goal );
extern void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int docker_point, int dockee_point, int immediate = 1 );
extern void ai_add_goal_wing_internal( wing *wingp, int goal_type, char *name, int immediate = 1 );
#endif
-34
View File
@@ -1,34 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AIINTERNAL_H
#define _AIINTERNAL_H
//Returns the enemy team mask for the specified subobject
int get_enemy_team_mask(int objnum);
//Returns true if the specified object is a stealth ship, false if not
bool is_object_stealth_ship(object* objp);
//Number of live turrets on the object attacking
int num_turrets_attacking(object *turret_parent, int target_objnum);
//Determine whether an object is targetable within a nebula (checks for stealth)
int object_is_targetable(object *target, ship *viewer);
//Returns the number of enemy fighters within threshold of pos.
int num_nearby_fighters(int enemy_team_mask, vec3d *pos, float threshold);
//Returns true if OK for *aip to fire its current weapon at its current target.
int check_ok_to_fire(int objnum, int target_objnum, weapon_info *wip);
//Does all the stuff needed to aim and fire a turret.
void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum);
#endif
-16
View File
@@ -1,16 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AILOCAL_H
#define _AILOCAL_H
// -- Don't put anything in here --
// Put it in ai.h!
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-182
View File
@@ -1,182 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
* $Revision: 2.6 $
* $Date: 2005-07-13 02:50:48 $
* $Author: Goober5000 $
*
* Header file for playing back anim files
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.4 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.3 2003/12/08 22:30:02 randomtiger
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
* Fixed bug that caused fullscreen only crash with DXT textures
* Put dithering back in for tgas and jpgs
*
* Revision 2.2 2003/11/11 02:15:41 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:07 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 10/22/98 6:14p Dave
* Optimized some #includes in Anim folder. Put in the beginnings of
* parse/localization support for externalized strings and tstrings.tbl
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 11 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 10 4/27/98 3:36p Dave
*
* 9 3/25/98 8:43p Hoffoss
* Changed anim_play() to not be so complex when you try and call it.
*
* 8 12/24/97 8:57p Lawrance
* Added anim_ignore_next_frametime()
*
* 7 11/19/97 8:28p Dave
* Hooked in Main Hall screen. Put in Anim support for ping ponging
* animations as well as general reversal of anim direction.
*
* 6 8/30/97 2:11p Lawrance
* allow animations to loop
*
* 5 8/25/97 11:13p Lawrance
* support framerate independent playback with the option of now advancing
* more than one frame at a time
*
* 4 7/21/97 11:41a Lawrance
* make playback time of .ani files keyed of frametime
*
* 3 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 2 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 1 6/23/97 5:09p Lawrance
*
* 10 5/19/97 2:28p Lawrance
* changes some variables to flags
*
* 9 5/15/97 5:58p Lawrance
* fix some bugs that were present with animations when playing multiple
* missions
*
* 8 5/15/97 4:42p Lawrance
* suporting anims in-game
*
* 7 5/15/97 11:46a Lawrance
* add function to check if an anim is playing
*
* 6 2/28/97 12:17p Lawrance
* supporting mapping file to memory
*
* 5 2/25/97 11:06a Lawrance
* moved some higher level functions to from PackUnpack to AnimPlay
*
* 4 2/19/97 9:27p Lawrance
* added pause capability to anim playback
*
* 3 2/17/97 4:19p Lawrance
* using frame numbers instead of percentages for accessing keyframes
*
* 2 2/17/97 3:01p Lawrance
* code for playing back an anim
*
* $NoKeywords: $
*/
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
struct anim_instance;
struct CFILE;
// structure passed in when playing an anim. Talk about overkill..
typedef struct {
anim *anim_info;
int x;
int y;
int start_at;
int stop_at;
int screen_id;
vec3d *world_pos;
float radius;
int framerate_independent;
void *color;
int skip_frames;
int looped;
int ping_pong;
} anim_play_struct;
enum
{
PAGE_FROM_MEM = 0,
PAGE_FROM_DISK = 1,
PAGE_FROM_DISK_FORCED = 2,
};
extern int Anim_paused;
void anim_init();
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);
anim_instance *anim_play(anim_play_struct *aps);
void anim_ignore_next_frametime();
int anim_stop_playing(anim_instance* anim_instance);
int anim_show_next_frame(anim_instance *instance, float frametime);
void anim_release_all_instances(int screen_id = 0);
void anim_release_render_instance(anim_instance* instance);
anim *anim_load(char *name, int file_mapped = PAGE_FROM_MEM);
int anim_free(anim *ptr);
int anim_playing(anim_instance *ai);
int anim_write_frames_out(char *filename);
void anim_display_info(char *filename);
void anim_read_header(anim *ptr, CFILE *fp);
void anim_reverse_direction(anim_instance *ai); // called automatically for ping-ponging, and can also be called externally
void anim_pause(anim_instance *ai);
void anim_unpause(anim_instance *ai);
int anim_instance_is_streamed(anim_instance *ai);
unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
#endif /* __ANIMPLAY_H__ */
File diff suppressed because it is too large. Load diff
-269
View File
@@ -1,269 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
* $Revision: 2.5 $
* $Date: 2005-07-13 02:50:48 $
* $Author: Goober5000 $
*
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
* Anim files. Also handles Anim loading, creating Anim instances (for
* utilizing an Anim), and getting getting frames of the Anim.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.3 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.2 2004/03/05 09:01:53 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:07 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 7 7/16/99 1:49p Dave
* 8 bit aabitmaps. yay.
*
* 6 1/14/99 12:48a Dave
* Todo list bug fixes. Made a pass at putting briefing icons back into
* FRED. Sort of works :(
*
* 5 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 4 10/22/98 6:14p Dave
* Optimized some #includes in Anim folder. Put in the beginnings of
* parse/localization support for externalized strings and tstrings.tbl
*
* 3 10/16/98 3:42p Andsager
* increase MAX_WEAPONS and MAX_SHIPS and som header files
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 32 5/18/98 5:59p Hoffoss
* Made command briefing advanced now once the speech stops and animation
* has fully played once, whichever is longer.
*
* 31 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 30 1/14/98 6:43p Lawrance
* Add ref_count to anim struct, so we don't free multiple times
*
* 29 11/19/97 8:28p Dave
* Hooked in Main Hall screen. Put in Anim support for ping ponging
* animations as well as general reversal of anim direction.
*
* 28 8/30/97 2:11p Lawrance
* allow animations to loop
*
* 27 8/25/97 11:13p Lawrance
* support framerate independent playback with the option of now advancing
* more than one frame at a time
*
* 26 8/21/97 5:11p Lawrance
* frame numbering for ANI's now is from 0 -> total_frames-1.
*
* 25 7/28/97 10:42p Lawrance
* re-did interface to unpack_frame() to make more general
*
* 24 7/21/97 11:41a Lawrance
* make playback time of .ani files keyed of frametime
*
* 23 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 22 6/27/97 4:36p Lawrance
* update pal translation table when gr_screen.signature changes
*
* 21 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 20 6/25/97 3:03p Lawrance
* fix palette translation problem with anti-alised bitmaps
*
* 19 5/27/97 3:48p Lawrance
* don't re-create a bitmap if using the same frame of animation
*
* 18 5/21/97 11:06a Lawrance
* enabling a user-defined transparent value
*
* 17 5/19/97 3:21p Lawrance
* add fps parm, version num to anim header
*
* 16 5/19/97 2:28p Lawrance
* changes some variables to flags
*
* 15 5/15/97 4:42p Lawrance
* supporting animations in-game
*
* 14 3/01/97 2:08p Lawrance
* not using windows.h, since memory mapping details moved to cfile
*
* 13 2/28/97 12:17p Lawrance
* supporting mapping file to memory
*
* 12 2/25/97 11:06a Lawrance
* moved some higher level functions to from PackUnpack to AnimPlay
*
* 11 2/19/97 9:51p Lawrance
* made keyframe decompression more effecient, moved
* default anim FPS to header file
*
* 10 2/19/97 4:01p Lawrance
* load_anim returns int, not void
*
* 9 2/17/97 4:19p Lawrance
* changed stop and start to be actual frame numbers, not percentages
*
* 8 2/17/97 4:17p Hoffoss
* modified packing internal format and added random access function to an
* Anim frame.
*
* 7 2/17/97 2:59p Lawrance
* integrating into game
*
* 6 2/14/97 11:09p Hoffoss
* Made optimizations.
*
* 5 2/14/97 10:48p Hoffoss
* fixed bug.
*
* 4 2/14/97 10:38p Lawrance
* fixing bugs
*
* 3 2/14/97 3:29p Hoffoss
* Added header for MSDEV to fill in.
*
* $NoKeywords: $
*/
#ifndef __PACKUNPACK_H__
#define __PACKUNPACK_H__
#include "globalincs/pstypes.h"
struct CFILE;
#define ANI_STREAM_CACHE_SIZE 4096
#define PACKER_CODE 0xEE // Use'd by PACKING_METHOD_RLE
#define PACKING_METHOD_RLE 0 // Hoffoss's RLE format
#define PACKING_METHOD_RLE_KEY 1 // Hoffoss's key frame RLE format
#define PACKING_METHOD_STD_RLE 2 // Standard RLE format (high bit is count)
#define PACKING_METHOD_STD_RLE_KEY 3 // Standard RLE format key frame
#define STD_RLE_CODE 0x80
typedef struct key_frame {
int frame_num; // which frame number this key frame is
int offset; // offset from the start of data block
} key_frame;
#define ANF_MEM_MAPPED (1<<0) // animation is memory-mapped file
#define ANF_STREAMED (1<<1)
#define ANF_XPARENT (1<<2) // animation has transparency
#define ANF_ALL_KEYFRAMES (1<<3) // all the frames are keyframes (this is necessary if we want to play the file backwards)
typedef struct anim {
anim *next;
char name[MAX_PATH_LEN];
ubyte packer_code;
int width;
int height;
int total_frames;
int instance_count; // number of instances that are currently playing
int ref_count; // number of times this anim has been loaded
float time; // playback time in seconds
int num_keys;
key_frame *keys;
ubyte palette[768];
ubyte palette_translation[256];
ubyte *data; // points to compressed data
CFILE* cfile_ptr;
int version;
int fps;
ubyte xparent_r; // red component for the transparent color in source image
ubyte xparent_g; // green component for the transparent color in source image
ubyte xparent_b; // blue component for the transparent color in source image
int flags;
uint screen_sig;
int file_offset; // file offset to start of frame data
int cache_file_offset;
ubyte *cache;
} anim;
// the direction to play the anim (forwards or backwards)
#define ANIM_DIRECT_FORWARD 0
#define ANIM_DIRECT_REVERSE 1
typedef struct anim_instance {
anim_instance *next, *prev;
int x,y; // coordinates anim is played at (top left corner of anim)
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)
int last_frame_num;// last frame rendered
anim *parent; // pointer to anim structure, which holds compressed data
ubyte *data; // pointer to next frame's compressed data
ubyte *frame; // uncompressed frame
float time_elapsed; // how long the anim has played for (in seconds)
int start_at; // frame anim playing should start
int stop_at; // frame anim playing should stop
int framerate_independent; // animation should play back in same amount of time, regardless
int skip_frames; // should anim skip frames during framerate independent playback
int looped; // should anim keep playing over and over...
int stop_now; // flag to indicate time to stop the animation
int last_bitmap; // id of last bitmap that was rendered out from animation
int screen_id; // 0 means all screens should render, otherwise screen specific
void *aa_color; // anti-aliased bitmap color
int xlate_pal;
int direction; // playing forwards or backwards ?
int ping_pong; // should be played ping-pong style
int paused; // pause the anim
int file_offset; // current offset into frame (like data, put offset into file)
int loop_count; // starts at 0, and is incremented each time it loops
} anim_instance;
extern int packer_code;
int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_type);
int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, int compress_type);
ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp);
int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp);
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);
#endif /* __PACKUNPACK_H__ */
File diff suppressed because it is too large. Load diff
-276
View File
@@ -1,276 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
* $Revision: 2.9 $
* $Date: 2005-07-13 02:50:48 $
* $Author: Goober5000 $
*
* Header file for asteroids
*
* $Log: not supported by cvs2svn $
* Revision 2.8 2005/07/13 02:01:28 Goober5000
* fixed a bunch of "issues" caused by me with the species stuff
* --Goober5000
*
* Revision 2.7 2005/07/13 00:44:20 Goober5000
* improved species support and removed need for #define
* --Goober5000
*
* Revision 2.6 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.5 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.4 2004/03/05 09:01:53 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.3 2003/10/15 22:03:23 Kazan
* Da Species Update :D
*
* Revision 2.2 2003/04/29 01:03:22 Goober5000
* implemented the custom hitpoints mod
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 12 6/09/99 2:55p Andsager
* Allow multiple asteroid subtypes (of large, medium, small) and follow
* family.
*
* 11 6/07/99 1:18p Andsager
* Make asteroids choose consistent texture from large to small. Modify
* fireball radius of dying asteroids.
*
* 10 5/03/99 10:50p Andsager
* Make Asteroid_obj_list. Change get_nearest_turret_objnum() to use
* Asteroid_obj_list, Ship_obj_list and Missile_obj_list vs.
* obj_used_list.
*
* 9 4/16/99 2:34p Andsager
* Second pass on debris fields
*
* 8 4/15/99 5:00p Andsager
* Frist pass on Debris field
*
* 7 3/31/99 9:51a Andsager
* Add for generalization to debris field
*
* 6 2/07/99 8:51p Andsager
* Add inner bound to asteroid field. Inner bound tries to stay astroid
* free. Wrap when within and don't throw at ships inside.
*
* 5 1/20/99 6:04p Dave
* Another bit of stuff for beam weapons. Ships will properly use them
* now, although they're really deadly.
*
* 4 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 3 10/16/98 1:22p Andsager
* clean up header files
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 17 3/26/98 9:19a Lawrance
* Support multiple asteroid pofs
*
* 16 3/17/98 12:16a Allender
* asteroids in multiplayer -- minor problems with position being correct
*
* 15 3/14/98 1:44p Mike
* Todolist items 3365..3368. Make child asteroids collide properly.
* Make asteroid throwing less bunchy, toss asteroids earlier, make
* facing-ness not break mission balance.
*
* 14 3/11/98 12:13a Lawrance
* Auto-target asteroids if no hostile ships present
*
* 13 3/08/98 4:16p Hoffoss
*
* 12 3/07/98 3:48p Lawrance
* Show offscreen indicators for asteroids
*
* 11 3/04/98 11:59p Lawrance
* create an asteroid.tbl, read all asteroid data from there
*
* 10 3/04/98 4:11p Lawrance
* Have area effects affect asteroids, have asteroids cast an area effect,
* fix ship shockwaves
*
* 9 3/03/98 12:48a Lawrance
* Ensure collide_objnum is still valid each frame.
*
* 8 3/02/98 11:35p Lawrance
* Keep track of asteroids that will impact ships on the escort view.
*
* 7 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 6 2/26/98 4:22p Lawrance
* Change wrapping behavior, make vel random
*
* 5 2/20/98 8:31p Lawrance
* delay creation of sub-asteroids
*
* 4 2/19/98 4:33p Lawrance
* hook in new sounds and custom explosion animation
*
* 3 2/19/98 12:46a Lawrance
* Further work on asteroids.
*
* 2 2/10/98 6:43p Lawrance
* Moved asteroid code to a separate lib.
*
* 1 2/10/98 6:05p Lawrance
*
* $NoKeywords: $
*/
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "globalincs/pstypes.h"
#include "globalincs/globals.h" // for NAME_LENGTH
struct object;
struct polymodel;
struct collision_info_struct;
#define MAX_ASTEROIDS 256
#define ASTEROID_TYPE_SMALL 0
#define ASTEROID_TYPE_MEDIUM 1
#define ASTEROID_TYPE_BIG 2
// This is for the asteroid types plus DEBRIS_X_Y
// (X is each species and Y is SMALL, MEDIUM, and LARGE)
#define MAX_DEBRIS_TYPES ((MAX_SPECIES + 1) * 3)
// Data structure to track the active asteroids
typedef struct asteroid_obj {
asteroid_obj *next, *prev;
int flags, objnum;
} asteroid_obj;
extern asteroid_obj Asteroid_obj_list;
#define MAX_ASTEROID_POFS 3 // Max number of POFs per asteroid type
#define AF_USED (1<<0) // Set means used.
// Goober5000 - currently same as MAX_SHIP_DETAIL_LEVELS (put here to avoid an #include)
#define MAX_ASTEROID_DETAIL_LEVELS 5
typedef struct asteroid_info {
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[MAX_ASTEROID_POFS][NAME_LENGTH]; // POF files to load/associate with ship
int num_detail_levels; // number of detail levels for this ship
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
float max_speed; // cap on speed for asteroid
float inner_rad; // radius within which maximum area effect damage is applied
float outer_rad; // radius at which no area effect damage is applied
float damage; // maximum damage applied from area effect explosion
float blast; // maximum blast impulse from area effect explosion
float initial_asteroid_strength; // starting strength of asteroid
polymodel *modelp[MAX_ASTEROID_POFS];
int model_num[MAX_ASTEROID_POFS];
} asteroid_info;
typedef struct asteroid {
int flags;
int objnum;
int type; // In 0..Num_asteroid_types
int asteroid_subtype; // Which index into asteroid_info for modelnum and modelp
int check_for_wrap; // timestamp to check for asteroid wrapping around field
int check_for_collide; // timestamp to check for asteroid colliding with escort ships
int final_death_time; // timestamp to swap in new models after explosion starts
int collide_objnum; // set to objnum that asteroid will be impacting soon
int collide_objsig; // object signature corresponding to collide_objnum
vec3d death_hit_pos; // hit pos that caused death
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
} asteroid;
// TYPEDEF FOR DEBRIS TYPE
typedef enum {
DG_ASTEROID,
DG_SHIP
} debris_genre_t;
// TYPEDEF FOR FIELD TYPE
typedef enum {
FT_ACTIVE,
FT_PASSIVE
} field_type_t;
#define MAX_ACTIVE_DEBRIS_TYPES 3
typedef struct asteroid_field {
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
int has_inner_bound;
vec3d inner_min_bound;
vec3d inner_max_bound;
vec3d vel; // Average asteroid moves at this velocity.
float speed; // Average speed of field
int num_initial_asteroids; // Number of asteroids at creation.
field_type_t field_type; // active throws and wraps, passive does not
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
} asteroid_field;
extern asteroid_info Asteroid_info[MAX_DEBRIS_TYPES];
extern asteroid Asteroids[MAX_ASTEROIDS];
extern asteroid_field Asteroid_field;
extern int Num_asteroid_types;
extern int Num_asteroids;
extern int Asteroids_enabled;
void asteroid_init();
void asteroid_level_init();
void asteroid_level_close();
void asteroid_create_all();
void asteroid_render( object *asteroid_objp );
void asteroid_delete( object *asteroid_objp );
void asteroid_process_pre( object *asteroid_objp, float frame_time);
void asteroid_process_post( object *asteroid_objp, float frame_time);
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL );
void asteroid_hit( object *asteroid_objp, object *other_objp, vec3d *hitpos, float damage );
int asteroid_count();
int asteroid_collide_objnum(object *asteroid_objp);
float asteroid_time_to_impact(object *asteroid_objp);
void asteroid_show_brackets();
void asteroid_target_closest_danger();
int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger = 0);
// need to extern for multiplayer
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec);
void asteroid_frame();
#endif // __ASTEROID_H__
-839
View File
@@ -1,839 +0,0 @@
// Autopilot.cpp
// Derek Meek
// 4-30-2004
/*
* $Logfile: /Freespace2/code/Autopilot/Autopilot.cpp $
* $Revision: 1.22 $
* $Date: 2005-08-23 09:18:08 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.21 2005/07/23 16:25:32 Goober5000
* remove an extraneous extern
* --Goober5000
*
* Revision 1.20 2005/07/13 02:30:52 Goober5000
* removed autopilot #define
* --Goober5000
*
* Revision 1.19 2005/04/19 23:03:42 wmcoolmon
* Lock time compression when autopilot is engaged
*
* Revision 1.18 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 1.17 2005/03/25 06:57:32 wmcoolmon
* Big, massive, codebase commit. I have not removed the old ai files as the ones I uploaded aren't up-to-date (But should work with the rest of the codebase)
*
* Revision 1.16 2005/03/03 06:05:26 wmcoolmon
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
*
* Revision 1.15 2005/01/31 23:27:51 taylor
* merge with Linux/OSX tree - p0131-2
*
* Revision 1.14 2004/10/03 21:41:10 Kazan
* Autopilot convergence collision fix for ai_fly_to_ship() and ai_waypoints() -- mathematically expensive, only usable by autopilot
*
* Revision 1.13 2004/09/28 22:51:41 Kazan
* fix autopilot formation bug
*
* Revision 1.12 2004/09/28 19:54:31 Kazan
* | is binary or, || is boolean or - please use the right one
* autopilot velocity ramping biasing
* made debugged+k kill guardianed ships
*
* Revision 1.11 2004/07/29 23:41:21 Kazan
* bugfixes
*
* Revision 1.10 2004/07/27 18:52:10 Kazan
* squished another
*
* Revision 1.9 2004/07/27 18:04:09 Kazan
* i love it when bugs go crunch (autopilot ai fixup)
*
* Revision 1.8 2004/07/26 20:47:24 Kazan
* remove MCD complete
*
* Revision 1.7 2004/07/26 17:54:04 Kazan
* Autopilot system completed -- i am dropping plans for GUI nav map
* Fixed FPS counter during time compression
*
* Revision 1.6 2004/07/25 19:27:51 Kazan
* only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged
*
* Revision 1.5 2004/07/25 18:46:28 Kazan
* -fred_no_warn has become -no_warn and applies to both fred and fs2
* added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
* fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
* made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
*
* Revision 1.4 2004/07/25 00:31:27 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 1.3 2004/07/12 16:32:42 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 1.2 2004/07/01 16:38:18 Kazan
* working on autonav
*
* Revision 1.1 2004/05/07 23:50:14 Kazan
* Sorry Guys!
*
*
*
*
*/
#include "autopilot/autopilot.h"
#include "ai/ai.h"
#include "ai/aigoals.h"
#include "ship/ship.h"
#include "object/object.h"
#include "parse/sexp.h"
#include "freespace2/freespace.h"
// Extern functions/variables
extern int Player_use_ai;
extern int sexp_distance2(int obj1, char *subj);
// Module variables
bool AutoPilotEngaged;
int CurrentNav;
float ramp_bias;
NavPoint Navs[MAX_NAVPOINTS];
// used for ramping time compression;
int start_dist;
// ********************************************************************************************
void autopilot_ai_waypoint_goal_fixup(ai_goal* aigp)
{
// this function sets wp_index properly;
for (int i = 0; i < Num_waypoint_lists; i++)
{
if (!stricmp(aigp->ship_name, Waypoint_lists[i].name))
{
aigp->wp_index = i;
return;
}
}
}
// ********************************************************************************************
bool Sel_NextNav()
{
if (AutoPilotEngaged)
return false;
int i;
if (CurrentNav == -1)
{
for (i = 0; i < MAX_NAVPOINTS; i++)
{
if (Navs[i].flags & NP_VALIDTYPE && !(Navs[i].flags & NP_NOSELECT))
{
CurrentNav=i;
return true;
}
}
}
else
{
for (i = CurrentNav+1; i < MAX_NAVPOINTS+CurrentNav; i++)
{
if (Navs[i%MAX_NAVPOINTS].flags & NP_VALIDTYPE && !(Navs[i%MAX_NAVPOINTS].flags & NP_NOSELECT))
{
if (i != CurrentNav)
{
CurrentNav=i%MAX_NAVPOINTS;
return true;
}
}
}
}
return false;
}
// ********************************************************************************************
vec3d NavPoint::GetPosition()
{
vec3d position;
if (flags & NP_WAYPOINT)
{
position = ((waypoint_list*)target_obj)->waypoints[waypoint_num-1];
}
else
{
position = Objects[((ship*)target_obj)->objnum].pos;
}
return position;
}
char* NavPoint::GetInteralName()
{
char *NavName;
char strtmp[3];
if (flags & NP_WAYPOINT)
{
NavName = new char[strlen(((waypoint_list*)target_obj)->name)+5];
memset(NavName, 0, strlen(((waypoint_list*)target_obj)->name)+5);
strcpy(NavName, ((waypoint_list*)target_obj)->name);
strcat(NavName, ":");
strcat(NavName, itoa(waypoint_num, strtmp, 10));
}
else
{
NavName = new char[strlen(((ship*)target_obj)->ship_name)+1];
memset(NavName, 0, strlen(((ship*)target_obj)->ship_name)+1);
strcpy(NavName, ((ship*)target_obj)->ship_name);
}
return NavName;
}
// ********************************************************************************************
// Tell us is autopilot is allow
// This needs:
// * Nav point selected
// * No enemies within X distance
// * Destination > 1,000 meters away
bool CanAutopilot()
{
bool CanAuto = true;
CanAuto = CanAuto && CurrentNav != -1;
int dist = sexp_distance2(Player_ship->objnum, "<any hostile>");
CanAuto = CanAuto && (5000 <= dist || dist == SEXP_NAN);
if (CanAuto) // protect against no currentNav
{
char *name = Navs[CurrentNav].GetInteralName();
CanAuto = CanAuto && (1000 <= sexp_distance2(Player_ship->objnum, name));
delete[] name;
}
return CanAuto;
}
// ********************************************************************************************
// Engages autopilot
// This does:
// * Control switched from player to AI
// * Time compression to 32x
// * Lock time compression -WMC
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
void StartAutopilot()
{
if (!CanAutopilot())
return;
AutoPilotEngaged = true;
Player_use_ai = 1;
set_time_compression(1);
lock_time_compression(true);
// determine speed cap
int i,j;
float speed_cap = 1000000.0; // 1m is a safe starting point
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 &&
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
)
)
{
if (speed_cap > Ship_info[Ships[i].ship_info_index].max_vel.xyz.z)
speed_cap = Ship_info[Ships[i].ship_info_index].max_vel.xyz.z;
}
}
// damp speed_cap to 90% of actual -- to make sure ships stay in formation
speed_cap = 0.90f * speed_cap;
ramp_bias = speed_cap/50.0f;
// assign ship goals
// when assigning goals to individual ships only do so if Ships[shipnum].wingnum != -1
// we will assign wing goals below
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 &&
(Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY)
)
)
{
// clear the ship goals and cap the waypoint speed
ai_clear_ship_goals(&Ai_info[Ships[i].ai_index]);
Ai_info[Ships[i].ai_index].waypoint_speed_cap = (int)speed_cap;
// if they're not part of a wing set their goal
if (Ships[i].wingnum == -1)
{
if (Navs[CurrentNav].flags & NP_WAYPOINT)
{
ai_add_ship_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_WAYPOINTS_ONCE, -1, ((waypoint_list*)Navs[CurrentNav].target_obj)->name, &Ai_info[Ships[i].ai_index] );
//fixup has to wait until after wing goals
}
else
{
ai_add_ship_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_FLY_TO_SHIP, -1, ((ship*)Navs[CurrentNav].target_obj)->ship_name, &Ai_info[Ships[i].ai_index] );
}
}
}
}
// assign wing goals
for (i = 0; i < MAX_WINGS; i++)
{
if (Wings[i].flags & WF_NAV_CARRY )
{
//ai_add_ship_goal_player( int type, int mode, int submode, char *shipname, ai_info *aip );
//ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_STAY_NEAR_SHIP, 0, target_shipname, wingnum );
//ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_WAYPOINTS_ONCE, 0, target_shipname, wingnum );
//ai_clear_ship_goals( &(Ai_info[Ships[num].ai_index]) );
ai_clear_wing_goals( i );
if (Navs[CurrentNav].flags & NP_WAYPOINT)
{
ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_WAYPOINTS_ONCE, AIF_FORMATION_WING, ((waypoint_list*)Navs[CurrentNav].target_obj)->name, i );
// "fix up" the goal
for (j = 0; j < MAX_AI_GOALS; j++)
{
if (Wings[i].ai_goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
Wings[i].ai_goals[j].ai_mode == AIM_WAYPOINTS )
{
autopilot_ai_waypoint_goal_fixup(&(Wings[i].ai_goals[j]));
}
}
}
else
{
ai_add_wing_goal_player( AIG_TYPE_PLAYER_WING, AI_GOAL_FLY_TO_SHIP, AIF_FORMATION_WING, ((ship*)Navs[CurrentNav].target_obj)->ship_name, i );
}
}
}
// fixup has to go down here because ships are assigned goals during wing goals as well
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1)
{
if (Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY))
for (j = 0; j < MAX_AI_GOALS; j++)
{
if (Ai_info[Ships[i].ai_index].goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AIM_WAYPOINTS)
{
autopilot_ai_waypoint_goal_fixup( &(Ai_info[Ships[i].ai_index].goals[j]) );
// formation fixup
//ai_form_on_wing(&Objects[Ships[i].objnum], &Objects[Player_ship->objnum]);
}
}
}
}
start_dist = DistanceTo(CurrentNav);
}
// ********************************************************************************************
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 10,000 meters away
// * Enemy < 10,000 meters
bool Autopilot_AutoDiable()
{
return !CanAutopilot();
}
// ********************************************************************************************
// Disengages autopilot
// this does:
// * Time compression to 1x
// * Delete AI nav goal
// * Control switched from AI to player
void EndAutoPilot()
{
AutoPilotEngaged = false;
set_time_compression(1);
lock_time_compression(false);
Player_use_ai = 0;
//Clear AI Goals
// assign ship goals
// when assigning goals to individual ships only do so if Ships[shipnum].wingnum != -1
// we will assign wing goals below
int i,j;
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 &&
(
Ships[i].flags2 & SF2_NAVPOINT_CARRY ||
(Ships[i].wingnum != -1 && Wings[Ships[i].wingnum].flags & WF_NAV_CARRY )
)
)
{
Ai_info[Ships[i].ai_index].waypoint_speed_cap = -1; // uncap their speed
// old "dumb" routine
//ai_clear_ship_goals( &(Ai_info[Ships[i].ai_index]) );
for (j = 0; j < MAX_AI_GOALS; j++)
{
if (Ai_info[Ships[i].ai_index].goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AI_GOAL_FLY_TO_SHIP ||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AIM_WAYPOINTS ||
Ai_info[Ships[i].ai_index].goals[j].ai_mode == AIM_FLY_TO_SHIP)
{
ai_remove_ship_goal( &(Ai_info[Ships[i].ai_index]), j );
}
}
}
}
// assign wing goals
for (i = 0; i < MAX_WINGS; i++)
{
if (Wings[i].flags & WF_NAV_CARRY )
{
// old "dumb" routine
//ai_clear_wing_goals( i );
for (j = 0; j < MAX_AI_GOALS; j++)
{
if (Wings[i].ai_goals[j].ai_mode == AI_GOAL_WAYPOINTS_ONCE ||
Wings[i].ai_goals[j].ai_mode == AI_GOAL_FLY_TO_SHIP ||
Wings[i].ai_goals[j].ai_mode == AIM_WAYPOINTS ||
Wings[i].ai_goals[j].ai_mode == AIM_FLY_TO_SHIP)
{
Wings[i].ai_goals[j].ai_mode = AI_GOAL_NONE;
Wings[i].ai_goals[j].signature = -1;
Wings[i].ai_goals[j].priority = -1;
Wings[i].ai_goals[j].flags = 0;
}
}
}
}
}
// ********************************************************************************************
// Checks for changes every NPS_TICKRATE milliseconds
// Checks:
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
// * If we're current AutoNavigating it checks if we need to autodisengage
void NavSystem_Do()
{
static unsigned int last_update = 0;
if (clock () - last_update > NPS_TICKRATE)
{
if (AutoPilotEngaged)
if (Autopilot_AutoDiable())
EndAutoPilot();
// check if a NavPoints target has left, delete it if so
int i;
for (i = 0; i < MAX_NAVPOINTS; i++)
{
if ((Navs[i].flags & NP_SHIP) && (Navs[i].target_obj != NULL))
{
if (((ship*)Navs[i].target_obj)->objnum == -1)
DelNavPoint(i);
}
}
// check if we're reached a Node
for (i = 0; i < MAX_NAVPOINTS; i++)
{
if (Navs[i].target_obj != NULL)
{
if (Navs[i].flags & NP_VALIDTYPE && DistanceTo(i) < 1000)
Navs[i].flags |= NP_VISITED;
}
}
}
// ramp time compression
if (AutoPilotEngaged)
{
int dstfrm_start = start_dist - DistanceTo(CurrentNav);
// Ramp UP time compression
if (dstfrm_start < (3500*ramp_bias))
{
if (dstfrm_start >= (3000*ramp_bias) && DistanceTo(CurrentNav) > 30000)
set_time_compression(64);
else if (dstfrm_start >= (2000*ramp_bias))
set_time_compression(32);
else if (dstfrm_start >= (1600*ramp_bias))
set_time_compression(16);
else if (dstfrm_start >= (1200*ramp_bias))
set_time_compression(8);
else if (dstfrm_start >= (800*ramp_bias))
set_time_compression(4);
else if (dstfrm_start >= (400*ramp_bias))
set_time_compression(2);
}
// Ramp DOWN time compression
if (DistanceTo(CurrentNav) <= (7000*ramp_bias))
{
int dist = DistanceTo(CurrentNav);
if (dist >= (5000*ramp_bias))
set_time_compression(32);
else if (dist >= (4000*ramp_bias))
set_time_compression(16);
else if (dist >= (3000*ramp_bias))
set_time_compression(8);
else if (dist >= (2000*ramp_bias))
set_time_compression(4);
else if (dist >= (1000*ramp_bias))
set_time_compression(2);
}
}
}
// ********************************************************************************************
// Inits the Nav System
void NavSystem_Init()
{
memset((char *)&Navs, 0, sizeof(Navs));
AutoPilotEngaged = false;
CurrentNav = -1;
}
// ********************************************************************************************
// Finds a Nav point by name
int FindNav(char *Nav)
{
for (int i = 0; i < MAX_NAVPOINTS; i++)
{
if (!stricmp(Navs[i].NavName, Nav))
return i;
}
return -1;
}
// ********************************************************************************************
// Set A Nav point to "ZERO"
void ZeroNav(int i)
{
memset((char *)&Navs[i], 0, sizeof(NavPoint));
}
// ********************************************************************************************
// Removes a Nav
bool DelNavPoint(char *Nav)
{
int n = FindNav(Nav);
return DelNavPoint(n);
}
bool DelNavPoint(int nav)
{
if (nav != -1)
{
if (nav != MAX_NAVPOINTS-1)
{
for (int i = nav; i < MAX_NAVPOINTS-1; i++)
{
Navs[nav] = Navs[nav+1];
}
}
ZeroNav(MAX_NAVPOINTS-1);
return true;
}
return false;
}
// ********************************************************************************************
// adds a Nav
bool AddNav_Ship(char *Nav, char *TargetName, int flags)
{
// find an empty nav - should be the end
int empty = -1;
int i;
for (i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
{
if (Navs[i].flags == 0)
empty = i;
}
if (empty == -1) // no empty navpoint slots
return false;
// Create the NavPoint struct
NavPoint tnav;
strncpy(tnav.NavName, Nav, 32);
tnav.flags = NP_SHIP | flags;
Assert(!(tnav.flags & NP_WAYPOINT));
for (i = 0; i < MAX_SHIPS; i++)
{
if (Ships[i].objnum != -1 && !stricmp(TargetName, Ships[i].ship_name))
{
tnav.target_obj = (void *)&Ships[i];
}
}
tnav.waypoint_num = 0; // unused for NP_SHIP
// copy it into it's location
Navs[empty] = tnav;
return true;
}
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags)
{
// find an empty nav - should be the end
int empty = -1;
int i;
if (node == 0)
node = 1;
for (i = 0; i < MAX_NAVPOINTS && empty == -1; i++)
{
if (Navs[i].flags == 0)
empty = i;
}
if (empty == -1) // no empty navpoint slots
return false;
// Create the NavPoint struct
NavPoint tnav;
strncpy(tnav.NavName, Nav, 32);
tnav.flags = NP_WAYPOINT | flags;
Assert(!(tnav.flags & NP_SHIP));
for (i = 0; i < Num_waypoint_lists; i++)
{
if (!stricmp(WP_Path, Waypoint_lists[i].name))
{
tnav.target_obj = (void *)&Waypoint_lists[i];
}
}
tnav.waypoint_num = node;
// copy it into it's location
Navs[empty] = tnav;
return true;
}
// ********************************************************************************************
//Change Flags
bool Nav_Alt_Flags(char *Nav, int flags)
{
flags &= ~NP_VALIDTYPE; //clear the NP_SHIP and NP_WAYPOINT bits, make sure they haven't been set
int nav = FindNav(Nav);
if (nav != -1)
{
Navs[nav].flags &= NP_VALIDTYPE; // Clear all bits BUT NP_SHIP or NO_WAYPOINT
Navs[nav].flags |= flags; // merge
}
return (nav != -1);
}
//Get Flags
int Nav_Get_Flags(char *Nav)
{
int flags = 0;
int nav = FindNav(Nav);
if (nav != -1)
flags = Navs[nav].flags;
return flags;
}
// ********************************************************************************************
// Sexp Accessors
//Generic
bool Nav_Set_Flag(char *Nav, int flag)
{
Assert(!(flag & NP_VALIDTYPE));
int nav = FindNav(Nav);
if (nav != -1)
{
Navs[nav].flags |= flag;
return true;
}
return false;
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool Nav_UnSet_Flag(char *Nav, int flag)
{
Assert(!(flag & NP_VALIDTYPE));
int nav = FindNav(Nav);
if (nav != -1)
{
Navs[nav].flags &= ~flag;
return true;
}
return false;
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
//Named
bool Nav_Set_Hidden(char *Nav)
{
return Nav_Set_Flag(Nav, NP_HIDDEN);
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool Nav_Set_NoAccess(char *Nav)
{
return Nav_Set_Flag(Nav, NP_NOACCESS);
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool Nav_Set_Visited(char *Nav)
{
return Nav_Set_Flag(Nav, NP_VISITED);
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool Nav_UnSet_Hidden(char *Nav)
{
return Nav_UnSet_Flag(Nav, NP_HIDDEN);
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool Nav_UnSet_NoAccess(char *Nav)
{
return Nav_UnSet_Flag(Nav, NP_NOACCESS);
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool Nav_UnSet_Visited(char *Nav)
{
return Nav_UnSet_Flag(Nav, NP_VISITED);
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
unsigned int DistanceTo(char *nav)
{
int n = FindNav(nav);
return DistanceTo(n);
}
unsigned int DistanceTo(int nav)
{
if (nav > MAX_NAVPOINTS && nav < 0)
return 0xFFFFFFFF;
char *name = Navs[nav].GetInteralName();
if (name == NULL)
return 0xFFFFFFFF;
int distance = sexp_distance2(Player_ship->objnum, name);
delete[] name;
if (distance == SEXP_NAN)
return 0xFFFFFFFF;
return distance;
}
//+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
bool IsVisited(char *nav)
{
int n = FindNav(nav);
return IsVisited(n);
}
bool IsVisited(int nav)
{
if (nav > MAX_NAVPOINTS && nav < 0)
return 0;
if (Navs[nav].flags & NP_VISITED)
return 1;
return 0;
}
-152
View File
@@ -1,152 +0,0 @@
// Autopilot.h
// Derek Meek
// 4-30-2004
/*
* $Logfile: /Freespace2/code/Autopilot/Autopilot.h $
* $Revision: 1.8 $
* $Date: 2005-07-13 02:50:49 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.7 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 1.6 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 1.5 2004/07/27 18:52:10 Kazan
* squished another
*
* Revision 1.4 2004/07/25 19:27:51 Kazan
* only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged
*
* Revision 1.3 2004/07/25 00:31:27 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 1.2 2004/07/01 16:38:18 Kazan
* working on autonav
*
* Revision 1.1 2004/05/07 23:50:14 Kazan
* Sorry Guys!
*
*
*
*
*/
#if !defined(_AUTOPILOT_H_)
#define _AUTOPILOT_H_
#include "globalincs/pstypes.h"
// milliseconds between updates
#define NPS_TICKRATE 250
#define MAX_NAVPOINTS 8
#define NP_WAYPOINT 0x0001 // Nav Point is bound to the poistion of a single node of a waypoint path
#define NP_SHIP 0x0002 // Nav Point is bound to the poisiton of a certain ship
#define NP_HIDDEN 0x0004 // Nav Point doesn't show on map and isn't selectable
#define NP_NOACCESS 0x0008 // Nav Point isn't selectable
#define NP_VISITED 0x0100 // Whether we've been within 1,000 meters of this waypoint
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
struct NavPoint
{
char NavName[32];
int flags;
void *target_obj;
int waypoint_num; //only used when flags & NP_WAYPOINT
vec3d GetPosition();
char* GetInteralName();
};
extern bool AutoPilotEngaged;
extern int CurrentNav;
extern NavPoint Navs[MAX_NAVPOINTS];
// Cycles through the NavPoint List
bool Sel_NextNav();
// Tell us is autopilot is allow
// This needs:
// * Nav point selected
// * No enemies within 5,000 meters
// * Destination > 1,000 meters away
bool CanAutopilot();
// Engages autopilot
// This does:
// * Control switched from player to AI
// * Time compression to 32x
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
void StartAutopilot();
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 1,000 meters away
// * Enemy < 5,000 meters
bool Autopilot_AutoDiable();
// Disengages autopilot
// this does:
// * Time compression to 1x
// * Delete AI nav goal
// * Control switched from AI to player
void EndAutoPilot();
// Checks for changes every NPS_TICKRATE milliseconds
// Checks:
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
// * If we're current AutoNavigating it checks if we need to autodisengage
void NavSystem_Do();
// Inits the Nav System
void NavSystem_Init();
// Finds a Nav point by name
int FindNav(char *Nav);
// Set A Nav point to "ZERO"
void ZeroNav(int i);
// Removes a Nav
bool DelNavPoint(char *Nav);
bool DelNavPoint(int nav);
// adds a Nav
bool AddNav_Ship(char *Nav, char *TargetName, int flags);
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags);
//Change Flags
bool Nav_Alt_Flags(char *Nav, int flags);
// Sexp Accessors
bool Nav_Set_Flag(char *Nav, int flag);
bool Nav_UnSet_Flag(char *Nav, int flag);
bool Nav_Set_Hidden(char *Nav);
bool Nav_Set_NoAccess(char *Nav);
bool Nav_Set_Visited(char *Nav);
bool Nav_UnSet_Hidden(char *Nav);
bool Nav_UnSet_NoAccess(char *Nav);
bool Nav_UnSet_Visited(char *Nav);
// Useful functions
unsigned int DistanceTo(char *nav);
unsigned int DistanceTo(int nav);
bool IsVisited(char *nav);
bool IsVisited(int nav);
#endif
-140
View File
@@ -1,140 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
* $Revision: 2.3 $
* $Date: 2005-04-21 15:49:20 $
* $Author: taylor $
*
* bmpman info that's internal to bmpman related files only
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2005/03/03 14:29:37 bobboau
* fixed a small error from my earlier commit.
*
* Revision 2.1 2004/11/23 00:10:06 taylor
* try and protect the bitmap_entry stuff a bit better
* fix the transparent support ship, again, but correctly this time
*
*
* $NoKeywords: $
*/
#ifndef __BM_INTERNAL_H__
#define __BM_INTERNAL_H__
// extra check to make sure this stuff doesn't end up in normal files
// don't use any of this unless BMPMAN_INTERNAL is defined
#ifdef BMPMAN_INTERNAL
#include "globalincs/pstypes.h"
#include "bmpman/bmpman.h"
// keep this defined to use per-ship nondarkening pixels
#define BMPMAN_SPECIAL_NONDARK
#define BM_TYPE_NONE 0
#define BM_TYPE_PCX 1
#define BM_TYPE_USER 2
#define BM_TYPE_ANI 3 // in-house ANI format
#define BM_TYPE_EFF 4 // specifies any type of animated image, the EFF itself is just text
#define BM_TYPE_32_BIT_FORMATS 5 // everything after this could/should be 24/32-bit
#define BM_TYPE_TGA 6 // 16 or 32 bit targa
#define BM_TYPE_DDS 7 // generic identifier for DDS
#define BM_TYPE_DXT1 8 // 24 bit with switchable alpha (compressed)
#define BM_TYPE_DXT3 9 // 32 bit with 4 bit alpha (compressed)
#define BM_TYPE_DXT5 10 // 32 bit with 8 bit alpha (compressed)
#define BM_TYPE_JPG 11 // 32 bit jpeg
#define BM_TYPE_RENDER_TARGET 12 // 32 bit setup internaly as a render target
/// Moved from cpp file ///////////////////
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
typedef struct bm_extra_info {
struct {
// Stuff needed for animations
int first_frame; // used for animations -- points to index of first frame
ubyte num_frames; // used for animation -- number of frames in the animation
ubyte fps; // used for animation -- frames per second
} ani;
struct {
// Stuff needed for user bitmaps
void *data; // For user bitmaps, this is where the data comes from
ubyte bpp; // For user bitmaps, this is what format the data is
ubyte flags; // Flags passed to bm_create
} user;
struct {
// Stuff for static animations
ubyte type; // type for individual images
char filename[MAX_FILENAME_LEN]; // filename for individual images
} eff;
} bm_extra_info;
typedef struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
uint signature; // a unique signature identifying the data
uint palette_checksum; // checksum used to be sure bitmap is in current palette
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
int last_used; // When this bitmap was last used
ubyte type; // PCX, USER, ANI, etc
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
int dir_type; // which directory this was loaded from (to skip other locations with same name)
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
int num_mipmaps; // number of mipmap levels, we need to read all of them
// Stuff to keep track of usage
ubyte preloaded; // If set, then this was loaded from the lst file
int preload_count; // how many times this gets used in game, for unlocking
ubyte used_flags; // What flags it was accessed thru
int load_count;
// Bitmap info
bitmap bm;
// Data for animations and user bitmaps
bm_extra_info info;
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
int data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
#endif
} bitmap_entry;
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
// image specific lock functions
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
#endif // BMPMAN_INTERNAL
#endif // __BM_INTERNAL_H__
File diff suppressed because it is too large. Load diff
-595
View File
@@ -1,595 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
*
* $Revision: 2.25 $
* $Date: 2005-08-20 20:34:49 $
* $Author: taylor $
*
* Prototypes for Bitmap Manager functions
*
* $Log: not supported by cvs2svn $
* Revision 2.24 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.23 2005/06/19 02:28:55 taylor
* add a _fast version of bm_unload() to be used in modelinterp and future graphics API code
* clean up some modelinterp code to not use memcpy() everywhere so it's more platform compatible and matches old code (Jens Granseuer)
* NaN check to catch shards-of-death and prevent hitting an Assert() (Jens Granseuer)
* fix jumpnode code to catch model errors and close a memory leak
* make the call to bm_unload_all() after model_free_all() since we will get bmpman screwups otherwise
* don't show hardware sound RAM when using OpenAL build, it will always be 0
* print top-right memory figures in debug builds slighly further over when 1024+ res
*
* Revision 2.22 2005/04/24 12:56:42 taylor
* really are too many changes here:
* - remove all bitmap section support and fix problems with previous attempt
* ( code/bmpman/bmpman.cpp, code/bmpman/bmpman.h, code/globalincs/pstypes.h,
* code/graphics/2d.cpp, code/graphics/2d.h code/graphics/grd3dbmpman.cpp,
* code/graphics/grd3dinternal.h, code/graphics/grd3drender.cpp, code/graphics/grd3dtexture.cpp,
* code/graphics/grinternal.h, code/graphics/gropengl.cpp, code/graphics/gropengl.h,
* code/graphics/gropengllight.cpp, code/graphics/gropengltexture.cpp, code/graphics/gropengltexture.h,
* code/graphics/tmapper.h, code/network/multi_pinfo.cpp, code/radar/radarorb.cpp
* code/render/3ddraw.cpp )
* - use CLAMP() define in gropengl.h for gropengllight instead of single clamp() function
* - remove some old/outdated code from gropengl.cpp and gropengltexture.cpp
*
* Revision 2.21 2005/04/21 15:49:20 taylor
* update of bmpman and model bitmap management, well tested but things may get a bit bumpy
* - use VM_* macros for bmpman since it didn't seem to register the memory correctly (temporary)
* - a little "stupid" fix for dds bitmap reading
* - fix it so that memory is released properly on bitmap read errors
* - some cleanup to model texture loading
* - allow model textures to get released rather than just unloaded, saves bitmap slots
* - bump MAX_BITMAPS to 4750, should be able to decrease after public testing of new code
*
* Revision 2.20 2005/03/07 13:10:19 bobboau
* commit of render target code, d3d should be totaly functional,
* OGL still needs implementation.
*
* Revision 2.19 2005/02/10 14:38:50 taylor
* fix an issue with bm_set_components()
* abs is for ints fabsf is for floats (camera.cpp)
* make the in-cockpit stuff OGL friendly
*
* Revision 2.18 2004/11/23 00:10:06 taylor
* try and protect the bitmap_entry stuff a bit better
* fix the transparent support ship, again, but correctly this time
*
* Revision 2.17 2004/11/21 15:59:45 Kazan
* conflict res
*
* Revision 2.16 2004/10/31 21:26:27 taylor
* bmpman merge, EFF animation support, better page in stuff, dozen or so smaller fixes and cleanup
*
* Revision 2.15 2004/10/06 22:02:54 Kazan
* interface corruption fix - thanks taylor (MAX_BITMAPS upped to 7000)
*
* Revision 2.14 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.13 2004/05/06 22:35:26 taylor
* DDS mipmap reading, remove unneeded bm_unlock() during page in
*
* Revision 2.12 2004/04/01 15:31:20 taylor
* don't use interface anis as ship textures
*
* Revision 2.11 2004/03/05 09:01:54 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.10 2003/12/04 20:39:08 randomtiger
* Added DDS image support for D3D
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
* Hopefully have fixed D3D text batching bug that caused old values to appear
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
* Fixed jump nodes not showing
*
* Revision 2.9 2003/11/19 20:37:22 randomtiger
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
* Made some commandline variables fit the naming standard.
* Changed timerbar system not to run pushes and pops if its not in use.
* Put in a note about not uncommenting asserts.
* Fixed up a lot of missing POP's on early returns?
* Perhaps the motivation for Assert functionality getting commented out?
* Fixed up some bad asserts.
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
* Put in a special check for the signs of that D3D init bug I need to lock down.
*
* Revision 2.8 2003/11/07 18:31:01 randomtiger
* Fixed a nohtl call to htl funcs (crash with NULL pointer)
* Fixed a bug with 32bit PCX code.
* Fixed a bug in the d3d_string batch system that was messing up screen shaking.
* Added a couple of checks to try and stop timerbar push and pop overloads, check returns missing pops if you use the system.
* Put in a higher res icon until we get something better sorted out.
*
* Revision 2.7 2003/10/24 17:35:04 randomtiger
* Implemented support for 32bit TGA and JPG for D3D
* Also 32 bit PCX, but it still has some bugs to be worked out
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
*
* Revision 2.6 2003/08/16 03:52:22 bobboau
* update for the specmapping code includeing
* suport for seperate specular levels on lights and
* optional strings for the stars table
* code has been made more organised,
* though there seems to be a bug in the state selecting code
* resulting in the HUD being rendered incorectly
* and specmapping failing ocasionaly
*
* Revision 2.5 2003/08/12 03:18:32 bobboau
* Specular 'shine' mapping;
* useing a phong lighting model I have made specular highlights
* that are mapped to the model,
* rendering them is still slow, but they look real purdy
*
* also 4 new (untested) comand lines, the XX is a floating point value
* -spec_exp XX
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
* -spec_point XX
* -spec_static XX
* -spec_tube XX
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
* static is the local stars,
* point is weapons/explosions/warp in/outs,
* tube is beam weapons,
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
*
* Revision 2.4 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.3 2003/01/19 01:07:41 bobboau
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
*
* Revision 2.2 2003/01/18 19:55:16 phreak
* fixed around the bmpman system to now accept compressed textures
*
* Revision 2.1 2003/01/05 23:41:50 bobboau
* disabled decals (for now), removed the warp ray thingys,
* made some better error mesages while parseing weapons and ships tbls,
* and... oh ya, added glow mapping
*
* Revision 2.0.2.10 2002/11/04 21:24:59 randomtiger
*
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
* Cleaned up some more texture stuff enabled console debug for D3D.
*
* Revision 2.0.2.9 2002/11/04 16:04:20 randomtiger
*
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
*
* Revision 2.0.2.8 2002/11/04 03:02:28 randomtiger
*
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
*
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
*
* Rolled back to an old version of bumpman and made a few changes.
* Added new files: grd3dbumpman.cpp and .h
* Moved the bitmap init function to after the 3D engine is initialised
* Added includes where needed
* Disabled (for now) the D3D8 TGA loading - RT
*
* Revision 2.0.2.7 2002/10/26 01:24:22 randomtiger
* Fixed debug bitmap compiling bug.
* Fixed tga bug. - RT
*
* Revision 2.0.2.6 2002/10/22 17:46:17 randomtiger
* Fixed new TGA code texturing bug. - RT
*
* Revision 2.0.2.5 2002/10/21 16:33:40 randomtiger
* Added D3D only 32 bit TGA functionality. Will load a texture as big as your graphics card allows. Code not finished yet and will forge the beginnings of the new texture system. - RT
*
* Revision 2.0.2.4 2002/10/19 23:56:39 randomtiger
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
*
* Revision 2.0.2.3 2002/10/02 11:40:19 randomtiger
* Bmpmap has been reverted to an old non d3d8 version.
* All d3d8 code is now in the proper place.
* PCX code is now working to an extent. Problems with alpha though.
* Ani's work slowly with alpha problems.
* Also I have done a bit of tidying - RT
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 16 8/10/99 6:54p Dave
* Mad optimizations. Added paging to the nebula effect.
*
* 15 8/06/99 1:52p Dave
* Bumped up MAX_BITMAPS for the demo.
*
* 14 7/15/99 9:20a Andsager
* FS2_DEMO initial checkin
*
* 13 7/13/99 1:15p Dave
* 32 bit support. Whee!
*
* 12 6/29/99 10:35a Dave
* Interface polygon bitmaps! Whee!
*
* 11 6/16/99 4:06p Dave
* New pilot info popup. Added new draw-bitmap-as-poly function.
*
* 10 5/05/99 9:02p Dave
* Fixed D3D aabitmap rendering. Spiffed up nebula effect a bit (added
* rotations, tweaked values, made bitmap selection more random). Fixed
* D3D beam weapon clipping problem. Added D3d frame dumping.
*
* 9 2/08/99 5:07p Dave
* FS2 chat server support. FS2 specific validated missions.
*
* 8 2/05/99 12:52p Dave
* Fixed Glide nondarkening textures.
*
* 7 2/03/99 11:44a Dave
* Fixed d3d transparent textures.
*
* 6 12/06/98 2:36p Dave
* Drastically improved nebula fogging.
*
* 5 12/01/98 4:46p Dave
* Put in targa bitmap support (16 bit).
*
* 4 12/01/98 8:06a Dave
* Temporary checkin to fix some texture transparency problems in d3d.
*
* 3 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 32 4/16/98 6:31p Hoffoss
* Added function to get filename of a bitmap handle, which we don't have
* yet and I need.
*
* 31 4/02/98 11:40a Lawrance
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
*
* 30 3/30/98 4:02p John
* Made machines with < 32 MB of RAM use every other frame of certain
* bitmaps. Put in code to ke7ep track of how much RAM we've malloc'd.
*
* 29 3/29/98 4:05p John
* New paging code that loads everything necessary at level startup.
*
* 28 3/26/98 5:21p John
* Added new code to preload all bitmaps at the start of a level.
* Commented it out, though.
*
* 27 3/24/98 6:18p John
* Hacked MAX_BITMAPS up to 3500
*
* 26 3/10/98 4:18p John
* Cleaned up graphics lib. Took out most unused gr functions. Made D3D
* & Glide have popups and print screen. Took out all >8bpp software
* support. Made Fred zbuffer. Made zbuffer allocate dynamically to
* support Fred. Made zbuffering key off of functions rather than one
* global variable.
*
* 25 3/02/98 6:46p John
* Upped MAX_BITMAPS to 2000
*
* 24 3/02/98 6:00p John
* Moved MAX_BITMAPS into BmpMan.h so the stuff in the graphics code that
* is dependent on it won't break if it changes. Made ModelCache slots
* be equal to MAX_OBJECTS which is what it is.
*
* 23 2/06/98 8:25p John
* Added code for new bitmaps since last frame
*
* 22 2/06/98 8:10p John
* Added code to show amout of texture usage each frame.
*
* 21 1/29/98 11:48a John
* Added new counter measure rendering as model code. Made weapons be
* able to have impact explosion.
*
* 20 1/11/98 2:14p John
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
* not do callbacks, I put that in global code. Made only bitmaps that
* need to load for a level load.
*
* 19 9/03/97 4:19p John
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
* to bm_load functions not needed. Made bmpman keep track of palettes
* for bitmaps not mapped into game palettes.
*
* 18 8/25/97 11:14p Lawrance
* added support for .ani files in bm_load_animation()
*
* 17 7/16/97 3:07p John
*
* 16 6/17/97 8:58p Lawrance
* fixed bug with not nulling bm.data with USER bitmaps
*
* 15 6/12/97 2:44a Lawrance
* changed bm_unlock() to take an index into bm_bitmaps(). Added
* ref_count to bitmap_entry struct
*
* 14 5/20/97 10:36a John
* Fixed problem with user bitmaps and direct3d caching.
*
* 13 3/24/97 3:25p John
* Cleaned up and restructured model_collide code and fvi code. In fvi
* made code that finds uvs work.. Added bm_get_pixel to BmpMan.
*
* 12 2/17/97 5:18p John
* Added a bunch of RCS headers to a bunch of old files that don't have
* them.
*
* $NoKeywords: $
*/
#ifndef _BMPMAN_H
#define _BMPMAN_H
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#ifndef NDEBUG
#define BMPMAN_NDEBUG
#endif
// this is causing problems - let's UP IT -- Kazan
// bumped from 3500 to 4500 2004/09/21 - taylor
// bumped to 4750 2005/02/03 - taylor
//#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
#define MAX_BITMAPS 4750 // How many bitmaps the game can handle
// NOTE: MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's
// proper use even the largest missions should stay under this number. With the largest retail
// missions and wasteful content we should still have about 20% of the slots free. If it still
// goes over then it's something the artists need to fix. For instance the Terran Mara fighter,
// with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone. 111 of those is
// just for the glowmaps. This number can be greatly reduced if the number of ani frames for
// another LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little
// more than a waste of resources. Future reports of texture corruption should be initially
// approached with content as the cause and not code. If anything we could/should reduce
// MAX_BITMAPS in the future. Where it's at now should accomidate even the largest mods.
// -- Taylor
// 16 bit pixel formats
#define BM_PIXEL_FORMAT_ARGB 0 // for glide - can assume certain things, like 1555 LFB writes, whee!
#define BM_PIXEL_FORMAT_D3D 1 // d3d - card dependant. booo!
#define BM_PIXEL_FORMAT_ARGB_D3D 2 // this card has nice 1555 textures like Glide - ahhhhh!
extern int bm_inited;
extern int Bm_paging;
void bm_init();
void bm_close();
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames );
int bm_get_next_handle();
void *bm_malloc(int n, int size);
void bm_update_memory_used(int n, int size);
// 16 bit pixel formats
extern int Bm_pixel_format;
#define BYTES_PER_PIXEL(x) ((x+7)/8)
// how many bytes of textures are used.
extern int bm_texture_ram;
// This loads a bitmap so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number.
int bm_load(char * filename);
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
// _and_ texture format, such as pilot pics and squad logos
int bm_load_duplicate(char *filename);
// Creates a bitmap that exists in RAM somewhere, instead
// of coming from a disk file. You pass in a pointer to a
// block of data. The data can be in the following formats:
// 8 bpp (mapped into game palette)
// 32 bpp
// On success, it returns the bitmap number. You cannot
// free that RAM until bm_release is called on that bitmap.
// See example at bottom of this file
int bm_create( int bpp, int w, int h, void * data, int flags = 0);
// Frees up a bitmap's data, but bitmap number 'n' can
// still be used, it will just have to be paged in next
// time it is locked.
int bm_unload( int n, bool = false );
// like bm_unload() except that it's safe to use to free data without worrying about
// load_count so it's safe to use in relation to bm_release() and in gr_*_texture functions
int bm_unload_fast( int n, bool = false );
// Frees up a bitmap's data, and it's slot, so bitmap
// number 'n' cannot be used anymore, and bm_load or
// bm_create might reuse the slot.
void bm_release(int n);
// This loads a bitmap sequence so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number of the first frame and nframes is set.
extern int bm_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
// This locks down a bitmap and returns a pointer to a bitmap
// that can be accessed until you call bm_unlock. Only lock
// a bitmap when you need it! This will convert it into the
// appropriate format also.
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
// The signature is a field that gets filled in with
// a unique signature for each bitmap. The signature for each bitmap
// will also change when the bitmap's data changes.
extern uint bm_get_signature( int bitmapnum);
// Unlocks a bitmap
extern void bm_unlock( int bitmapnum );
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
extern void bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL );
// get filename
extern void bm_get_filename(int bitmapnum, char *filename);
// resyncs all the bitmap palette
extern void bm_update();
// call to load all data for all bitmaps that have been requested to be loaded
extern void bm_gfx_load_all();
extern void bm_unload_all();
// call to get the palette for a bitmap
void bm_get_palette(int n, ubyte *pal, char *name);
// Hacked function to get a pixel from a bitmap.
// Only works good in 8bpp mode.
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
// Returns number of bytes of bitmaps locked this frame
// ntotal = number of bytes of bitmaps locked this frame
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
void bm_get_frame_usage(int *ntotal, int *nnew);
/*
* Example on using bm_create
*
{
static int test_inited = 0;
static int test_bmp;
static uint test_bmp_data[128*64];
if ( !test_inited ) {
test_inited = 1;
// Create the new bitmap and fill in its data.
// When you're done with it completely, call
// bm_release to free up the bitmap handle
test_bmp = bm_create( 32, 128, 64, test_bmp_data );
int i,j;
for (i=0; i<64; i++ ) {
for (j=0; j<64; j++ ) {
uint r=i*4;
test_bmp_data[j+i*128] = r;
}
}
}
bm_unload(test_bmp); // this pages out the data, so that the
// next bm_lock will convert the new data to the
// correct bpp
// put in new data
int x,y;
gr_reset_clip();
for (y=0; y<64; y++)
for (x=0; x<128; x++ )
test_bmp_data[y*128+x] = 15;
// Draw the bitmap to upper left corner
gr_set_bitmap(test_bmp);
gr_bitmap( 0,0 );
}
*/
//============================================================================
// Paging stuff
//============================================================================
void bm_page_in_start();
void bm_page_in_stop();
// Paging code in a library should call these functions
// in its page in function.
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_texture( int bitmapnum, int num_frames=1 );
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_nondarkening_texture( int bitmap, int num_frames=1 );
// marks a texture as being a transparent textyre used for this level
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
// Marks an aabitmap as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
// unload a texture that was paged in
int bm_page_out( int handle );
//
// Mode: 0 = High memory
// 1 = Low memory ( every other frame of ani's)
// 2 = Debug low memory ( only use first frame of each ani )
void bm_set_low_mem( int mode );
char *bm_get_filename(int handle);
void BM_SELECT_SCREEN_FORMAT();
void BM_SELECT_TEX_FORMAT();
void BM_SELECT_ALPHA_TEX_FORMAT();
// set the rgba components of a pixel, any of the parameters can be NULL
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern void (*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_d3d(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
// get the rgba components of a pixel, any of the parameters can be NULL
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
int bm_is_compressed(int num);
int bm_get_tcache_type(int num);
int bm_get_size(int num);
int bm_get_num_mipmaps(int num);
void bm_print_bitmaps();
int bm_make_render_target( int &x_res, int &y_res, int flags );
bool bm_is_render_target(int bitmap_id);
bool bm_set_render_target(int handle, int face = -1);
#endif
-485
View File
@@ -1,485 +0,0 @@
#include "camera/camera.h"
#include "math/vecmat.h"
#include "graphics/2d.h"
#include "globalincs/alphacolors.h"
#include "parse/parselo.h"
//Some global vars
std::vector<subtitle> Subtitles;
std::vector<camera> Cameras;
//Preset cameras
camera* Free_camera = NULL;
//This is where the camera class beings! :D
camera::camera()
{
//These are our two pointers, new'd and delete'd only by this class
desired_position = NULL;
desired_orientation = NULL;
reset();
}
camera::~camera()
{
//Cleanup
if(desired_position != NULL)
delete desired_position;
if(desired_orientation != NULL)
delete desired_orientation;
}
void camera::reset()
{
position = vmd_zero_vector;
if(desired_position != NULL)
{
delete desired_position;
desired_position = NULL;
}
translation_velocity = translation_vel_limit = translation_acc_limit = vmd_zero_vector;
vm_set_identity(&orientation);
if(desired_orientation != NULL)
{
delete desired_orientation;
desired_orientation = NULL;
}
rotation_rate = rotation_vel_limit = rotation_acc_limit = vmd_zero_vector;
}
void camera::set_position(vec3d *in_position, float in_translation_time, float in_translation_acceleration_time)
{
position = *in_position;
}
void camera::set_translation_velocity(vec3d *in_velocity)
{
if(in_velocity == NULL)
translation_velocity = *in_velocity;
else
vm_vec_zero(&translation_velocity);
}
#define square(a) (a*a)
void camera::set_rotation(matrix *in_orientation, float in_rotation_time, float in_rotation_acceleration_time)
{
if(in_rotation_time > 0.0f || in_rotation_acceleration_time > 0.0f)
{
//Safeties
if(in_rotation_acceleration_time <= 0.0f)
in_rotation_acceleration_time = 1.0f;
if(in_rotation_time <= 0.0f)
in_rotation_time = 3.0f;
if(in_rotation_acceleration_time*2.0f > in_rotation_time)
in_rotation_acceleration_time = in_rotation_time/2.0f;
//Get the angles in radians
angles curr_orientation, new_orientation;
vm_extract_angles_matrix(&curr_orientation, &orientation);
vm_extract_angles_matrix(&new_orientation, in_orientation);
//Find the distance
angles d;
d.p = new_orientation.p - curr_orientation.p;
d.b = new_orientation.b - curr_orientation.b;
d.h = new_orientation.h - curr_orientation.h;
/*d.p = curr_orientation.p - new_orientation.p;
d.b = curr_orientation.b - new_orientation.b;
d.h = curr_orientation.h - new_orientation.h;*/
/*ad_dist = -(V/At)square((At));
((Xf - Xo) - ad_dist)/V*/
/*v.p = (-(in_rotation_time - 2.0f*(in_rotation_acceleration_time)) + sqrt(square(in_rotation_time-2.0f*(in_rotation_acceleration_time))) + 4.0f*(curr_orientation.p - new_orientation.p))/2;
v.b = (-(in_rotation_time - 2.0f*(in_rotation_acceleration_time)) + sqrt(square(in_rotation_time-2.0f*(in_rotation_acceleration_time))) + 4.0f*(curr_orientation.b - new_orientation.b))/2;
v.h = (-(in_rotation_time - 2.0f*(in_rotation_acceleration_time)) + sqrt(square(in_rotation_time-2.0f*(in_rotation_acceleration_time))) + 4.0f*(curr_orientation.h - new_orientation.h))/2;*/
/*v.p = (new_orientation.p - curr_orientation.p)/(in_rotation_time - in_rotation_acceleration_time);
v.b = (new_orientation.p - curr_orientation.p)/(in_rotation_time - in_rotation_acceleration_time);
v.h = (new_orientation.p - curr_orientation.p)/(in_rotation_time - in_rotation_acceleration_time);*/
/*
angles *U = &rotation_rate;
float At = in_rotation_acceleration_time;
float t = in_rotation_time; //- 2.0f*At*/
/*v.p = ((d.p/At - U->p)/t);
v.b = ((d.b/At - U->b)/t);
v.h = ((d.h/At - U->h)/t);*/
/*v.p = ((d.p - U->p*At)/t);
v.b = ((d.b - U->b*At)/t);
v.h = ((d.h - U->h*At)/t);*/
//Set the desired orientation
if(desired_orientation == NULL)
desired_orientation = new matrix;
if(in_orientation != NULL)
*desired_orientation = *in_orientation;
else
vm_set_identity(desired_orientation);
//Calculate the maximum acceleration speed
rotation_acc_limit.xyz.z = fabsf(d.p / ((in_rotation_time * in_rotation_acceleration_time) - square(in_rotation_acceleration_time)));
rotation_acc_limit.xyz.x = fabsf(d.b / ((in_rotation_time * in_rotation_acceleration_time) - square(in_rotation_acceleration_time)));
rotation_acc_limit.xyz.y = fabsf(d.h / ((in_rotation_time * in_rotation_acceleration_time) - square(in_rotation_acceleration_time)));
//Calculate the maximum velocity
rotation_vel_limit.xyz.x = fabsf(rotation_acc_limit.xyz.x * in_rotation_acceleration_time);
rotation_vel_limit.xyz.y = fabsf(rotation_acc_limit.xyz.y * in_rotation_acceleration_time);
rotation_vel_limit.xyz.z = fabsf(rotation_acc_limit.xyz.z * in_rotation_acceleration_time);
//rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time;
//rotation_rate_decel_time_til = in_rotation_time - in_rotation_acceleration_time;
//set_rotation_rate(&v, in_rotation_acceleration_time);
//rotation_rate_decel_time_til = in_rotation_time - in_rotation_acceleration_time;
}
else
{
if(in_orientation != NULL)
orientation = *in_orientation;
else
vm_set_identity(&orientation);
set_rotation_velocity(NULL);
}
}
void camera::set_rotation(angles *in_angles, float in_rotation_time, float in_rotation_acceleration_time)
{
matrix temp_matrix = IDENTITY_MATRIX;
if(in_angles != NULL)
vm_angles_2_matrix(&temp_matrix, in_angles);
set_rotation(&temp_matrix, in_rotation_time, in_rotation_acceleration_time);
}
void camera::set_rotation_facing(vec3d *in_target, float in_rotation_time, float in_rotation_acceleration_time)
{
matrix temp_matrix = IDENTITY_MATRIX;
if(in_target != NULL)
{
vec3d targetvec;
vm_vec_normalized_dir(&targetvec, in_target, &position);
vm_vector_2_matrix(&temp_matrix, &targetvec, NULL, NULL);
}
set_rotation(&temp_matrix, in_rotation_time, in_rotation_acceleration_time);
}
void camera::set_rotation_velocity(vec3d *in_rotation_rate)
{
if(in_rotation_rate != NULL)
rotation_rate = *in_rotation_rate;
else
vm_vec_zero(&rotation_rate);
/*if(in_rotation_rate == NULL)
{
rotation_rate.p = rotation_rate.b = rotation_rate.h = 0.0f;
rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time = 0.0f;
rotation_rate_decel_time_til = -1.0f;
return;
}
rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time;
rotation_rate_decel_time_til = -1.0f;
rotation_rate_delta.p = in_rotation_rate->p / in_rotation_acceleration_time;
rotation_rate_delta.b = in_rotation_rate->b / in_rotation_acceleration_time;
rotation_rate_delta.h = in_rotation_rate->h / in_rotation_acceleration_time;*/
}
void camera::do_frame(float in_frametime)
{
//float frametime, rot_frametime, trans_frametime;
//DO ROTATION STUFF
if(desired_orientation != NULL)
{
matrix ori_out;
vec3d vel_out;
vm_matrix_interpolate(desired_orientation, &orientation, &rotation_rate, in_frametime, &ori_out, &vel_out, &rotation_vel_limit, &rotation_acc_limit, 1);
orientation = ori_out;
rotation_rate = vel_out;
//TODO: Make this "if(*desired_orienation == orientation)"
//Note that this means we are finished rotating
if(vel_out.xyz.x == 0.0f && vel_out.xyz.y == 0.0f && vel_out.xyz.z == 0.0f)
{
delete desired_orientation;
desired_orientation = NULL;
rotation_rate = rotation_vel_limit = rotation_acc_limit = vmd_zero_vector;
}
}
else if(rotation_rate.xyz.x || rotation_rate.xyz.y || rotation_rate.xyz.z)
{
//TODO: Make this right.
angles new_orientation;
vm_angles_2_matrix(&orientation, &new_orientation);
new_orientation.p += rotation_rate.xyz.z;
new_orientation.b += rotation_rate.xyz.x;
new_orientation.h += rotation_rate.xyz.y;
vm_angles_2_matrix(&orientation, &new_orientation);
}
/* rot_frametime = trans_frametime = in_frametime;
do
{
frametime = rot_frametime;
if(rotation_rate_delta_time_left || rotation_rate_decel_time_til > 0.0f)
{
if(frametime > rotation_rate_delta_time_left && rotation_rate_delta_time_left)
frametime = rotation_rate_delta_time_left;
if(frametime > rotation_rate_decel_time_til && rotation_rate_decel_time_til > 0.0f)
frametime = rotation_rate_decel_time_til;
if(rotation_rate_delta_time_left)
{
rotation_rate.p += (rotation_rate_delta.p) * frametime;
rotation_rate.b += (rotation_rate_delta.b) * frametime;
rotation_rate.h += (rotation_rate_delta.h) * frametime;
}
//mprintf(("DX:%f DY:%f DZ:%f",rotation_rate_delta.p,rotation_rate_delta.b,rotation_rate_delta.h));
//mprintf(( " X:%f", rotation_rate.p));
//mprintf(( " Y:%f", rotation_rate.b));
//mprintf(( " Z:%f\n", rotation_rate.h));
if(rotation_rate_delta_time_left)
{
rotation_rate_delta_time_left -= frametime;
}
if(rotation_rate_decel_time_til > 0.0f)
{
rotation_rate_decel_time_til -= frametime;
if(rotation_rate_decel_time_til == 0.0f)
{
rotation_rate_delta.p *= -1.0f;
rotation_rate_delta.b *= -1.0f;
rotation_rate_delta.h *= -1.0f;
rotation_rate_delta_time_left = rotation_rate_delta_time;
rotation_rate_decel_time_til = -1.0f;
}
}
}
rot_frametime -= frametime;
} while(rot_frametime);*/
//DO TRANSLATION STUFF
// float frametime = in_frametime;
/*if(translation_time_left)
{
if(in_frametime > translation_time_left)
frametime = translation_time_left;
else
frametime = in_frametime;
vm_vec_scale_add2(&translation_velocity, &translation_velocity_delta, frametime);
translation_time_left -= frametime;
}*/
vm_vec_scale_add2(&position, &translation_velocity, in_frametime);
}
#define MAX_SUBTITLE_LINES 10
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim, float in_fade_time, color *in_text_color, bool center_x, bool center_y, int in_width)
{
//Setup text
int len = strlen(in_text);
if(len == 0)
return;
int num_text_lines;
char *text_line_ptrs[MAX_SUBTITLE_LINES];
int text_line_lens[MAX_SUBTITLE_LINES];
num_text_lines = split_str(in_text, in_width, text_line_lens, text_line_ptrs, MAX_SUBTITLE_LINES);
std::string temp_str;
for(int i = 0; i < num_text_lines; i++)
{
temp_str.assign(text_line_ptrs[i], text_line_lens[i]);
text_lines.push_back(temp_str);
}
//Setup text color
if(in_text_color)
text_color = *in_text_color;
else
gr_init_alphacolor(&text_color, 255, 255, 255, 255);
//Setup display and fade time
display_time = fl_abs(in_display_time);
fade_time = fl_abs(in_fade_time);
//Setup image
image_id = -1;
if(in_imageanim != NULL)
{
len = strlen(in_imageanim);
if(len != 0 && len < MAX_FILENAME_LEN)
{
image_id = bm_load(in_imageanim);
if(image_id != -1)
strcpy(imageanim, in_imageanim);
}
}
//Setup pos
int w=0, h=0, tw=0, th=0;
image_pos[0] = 0;
image_pos[1] = 0;
if(center_x || center_y)
{
//Get text size
for(int i = 0; i < num_text_lines; i++)
{
gr_get_string_size(&w, &h, text_line_ptrs[i], text_line_lens[i]);
if(w > tw)
tw = w;
th += h;
}
//Get image size
if(image_id != -1)
{
bm_get_info(image_id, &w, &h);
tw += w;
if(h > th)
th = h;
}
//Center it?
if(center_x)
image_pos[0] = (gr_screen.max_w - tw)/2;
if(center_y)
image_pos[0] = (gr_screen.max_h - th)/2;
}
if(in_x_pos < 0 && !center_x)
image_pos[0] += gr_screen.max_w + in_x_pos;
else
image_pos[0] += in_x_pos;
if(in_y_pos < 0 && !center_y)
image_pos[1] += gr_screen.max_h + in_y_pos;
else
image_pos[1] += in_y_pos;
if(image_id != -1)
text_pos[0] = image_pos[0] + w; //Still set from bm_get_info call
else
text_pos[0] = image_pos[0];
text_pos[1] = image_pos[1];
time_displayed = 0.0f;
time_displayed_end = 2.0f*fade_time + display_time;
}
void subtitle::do_frame(float frametime)
{
//Figure out how much alpha
if(time_displayed < fade_time)
{
text_color.alpha = (ubyte)fl2i(255.0f*(time_displayed/fade_time));
}
else if(time_displayed > time_displayed_end)
{
//We're finished
if(image_id != -1)
{
bm_unload(image_id);
image_id = -1;
}
return;
}
else if((time_displayed - fade_time) > display_time)
{
text_color.alpha = (ubyte)fl2i(255.0f*(1-(time_displayed - fade_time - display_time)/fade_time));
}
else
{
text_color.alpha = 255;
}
gr_set_color_fast(&text_color);
int font_height = gr_get_font_height();
int y = text_pos[1];
for(unsigned int i = 0; i < text_lines.size(); i++)
{
gr_string(text_pos[0], y, (char*)text_lines[i].c_str(), false);
y += font_height;
}
if(image_id != -1)
{
gr_set_bitmap(image_id, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, text_color.alpha/255.0f);
gr_bitmap(image_pos[0], image_pos[1], false);
}
time_displayed += frametime;
}
subtitle::~subtitle()
{
if(image_id != -1)
bm_unload(image_id);
}
void cameras_init()
{
camera handy_camera;
//Preset cameras
Cameras.push_back(handy_camera);
Free_camera = &Cameras[Cameras.size()-1];
}
void cameras_close()
{
Cameras.clear();
//Preset cameras
Free_camera = NULL;
}
void cameras_do_frame(float frametime)
{
unsigned int i,size=Cameras.size();
for(i = 0; i < size; i++)
{
Cameras[i].do_frame(frametime);
}
}
void subtitles_init()
{
//Do nothing!!
}
void subtitles_close()
{
Subtitles.clear();
}
void subtitles_do_frame(float frametime)
{
unsigned int i,size=Subtitles.size();
for(i = 0; i < size; i++)
{
Subtitles[i].do_frame(frametime);
}
}
-88
View File
@@ -1,88 +0,0 @@
#ifndef _CAMERA_H
#define _CAMERA_H
#include <string>
#include <vector>
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
class camera
{
private:
vec3d position;
vec3d *desired_position; //NULL unless we're trying to move somewhere
vec3d translation_velocity;
vec3d translation_vel_limit;
vec3d translation_acc_limit;
matrix orientation;
matrix *desired_orientation; //NULL unless we're trying to point somewhere
vec3d rotation_rate;
vec3d rotation_vel_limit;
vec3d rotation_acc_limit;
public:
camera();
~camera();
void reset();
//Set
void set_position(vec3d *in_position, float in_translation_time = 0.0f, float in_translation_acceleration_time = 0.0f);
void set_translation_velocity(vec3d *in_velocity);
void set_rotation(matrix *in_orientation, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
void set_rotation(angles *in_angles, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
void set_rotation_facing(vec3d *in_target, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f);
void set_rotation_velocity(vec3d *in_rotation_rate);
//Get
//These return values should never ever be changed, I do this in the interest of speed.
vec3d *get_position() {return &position;}
matrix *get_orientation() {return &orientation;}
//Do
void do_frame(float in_frametime);
};
class subtitle
{
private:
std::vector<std::string> text_lines;
int text_pos[2];
float display_time;
float fade_time;
color text_color;
//Done with set
char imageanim[MAX_FILENAME_LEN];
int image_id;
int image_pos[2];
//Time this has been displayed
float time_displayed;
//When to end it
float time_displayed_end;
public:
subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim = NULL, float in_fade_time = 0.0f, color *in_text_color = NULL, bool center_x = false, bool center_y = false, int in_width = 200);
~subtitle();
void do_frame(float frametime);
};
//Some global stuff
extern std::vector<subtitle> Subtitles;
extern std::vector<camera> Cameras;
//Preset cameras
extern camera* Free_camera;
//Helpful functions
void cameras_init();
void cameras_close();
void cameras_do_frame(float frametime);
void subtitles_init();
void subtitles_close();
void subtitles_do_frame(float frametime);
#endif // _CAMERA_H
File diff suppressed because it is too large. Load diff
-665
View File
@@ -1,665 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 2.12 $
* $Date: 2005-07-13 02:50:49 $
* $Author: Goober5000 $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 2.11 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.10 2005/01/30 12:50:08 taylor
* merge with Linux/OSX tree - p0130
*
* Revision 2.9 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.8 2004/05/26 21:02:26 wmcoolmon
* Added weapons_expl modular table, updated cfilesystem to work with modular tables, fixed loading order, fixed ship loading error messages
*
* Revision 2.7 2003/08/20 08:12:08 wmcoolmon
* Made cfile_delete return 0 on failure, 1 on success
*
* Revision 2.6 2002/11/10 16:29:53 DTP
* -DTP reworked mod support,
*
* Revision 2.5 2002/11/02 23:06:59 DTP
* DOh,uhmm, define error again, this is getting to me.
*
* Revision 2.4 2002/11/02 23:04:46 DTP
* DOh, fixed that define, learn to count DTP :)
*
* Revision 2.3 2002/10/27 23:59:28 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.3 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.2 2002/05/09 22:58:08 mharris
* Added ifdef WIN32 around change-drive functions
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 11 9/08/99 12:03a Dave
* Make squad logos render properly in D3D all the time. Added intel anim
* directory.
*
* 10 8/31/99 9:46a Dave
* Support for new cfile cbanims directory.
*
* 9 5/19/99 4:07p Dave
* Moved versioning code into a nice isolated common place. Fixed up
* updating code on the pxo screen. Fixed several stub problems.
*
* 8 3/28/99 5:58p Dave
* Added early demo code. Make objects move. Nice and framerate
* independant, but not much else. Don't use yet unless you're me :)
*
* 7 3/24/99 4:05p Dave
* Put in support for assigning the player to a specific squadron with a
* specific logo. Preliminary work for doing pos/orient checksumming in
* multiplayer to reduce bandwidth.
*
* 6 1/12/99 3:15a Dave
* Barracks screen support for selecting squad logos. We need real artwork
* :)
*
* 5 10/29/98 10:41a Dave
* Change the way cfile initializes exe directory.
*
* 4 10/13/98 9:19a Andsager
* Add localization support to cfile. Optional parameter with cfopen that
* looks for localized files.
*
* 3 10/12/98 9:54a Dave
* Fixed a few file organization things.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 84 9/09/98 5:53p Dave
* Put in new tracker packets in API. Change cfile to be able to checksum
* portions of a file.
*
* 83 8/12/98 4:53p Dave
* Put in 32 bit checksumming for PXO missions. No validation on the
* actual tracker yet, though.
*
* 82 5/19/98 1:19p Allender
* new low level reliable socket reading code. Make all missions/campaign
* load/save to data missions folder (i.e. we are rid of the player
* missions folder)
*
* 81 5/13/98 10:22p John
* Added cfile functions to read/write rle compressed blocks of data.
* Made palman use it for .clr files. Made alphacolors calculate on the
* fly rather than caching to/from disk.
*
* 80 5/01/98 10:21a John
* Added code to find all pack files in all trees. Added code to create
* any directories that we write to.
*
* 79 4/30/98 10:29p John
* Added code to refresh filelist if cd-rom changed or packfiles created
* or deleted.
*
* 78 4/30/98 10:06p John
* Started adding code for splitting the maps data tree for hardware
* textures.
*
* 77 4/30/98 9:43p John
* Restructured some stuff.
*
* 76 4/30/98 8:23p John
* Fixed some bugs with Fred caused by my new cfile code.
*
* 75 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 74 4/20/98 6:04p Dave
* Implement multidata cache flushing and xferring mission files to
* multidata. Make sure observers can't change hud config. Fix pilot image
* viewing in popup. Put in game status field. Tweaked multi options.
*
* 73 4/01/98 6:06p Hoffoss
* Added a command briefing directory for those voice files.
*
* 72 3/31/98 4:51p Dave
* Removed medals screen and multiplayer buttons from demo version. Put in
* new pilot popup screen. Make ships in mp team vs. team have proper team
* ids. Make mp respawns a permanent option saved in the player file.
*
* 71 3/26/98 6:01p Dave
* Put in file checksumming routine in cfile. Made pilot pic xferring more
* robust. Cut header size of voice data packets in half. Put in
* restricted game host query system.
*
* 70 3/10/98 2:27p Hoffoss
* Added change directory with history stack functions, so you can switch
* to a new directory, do something, and restore to what it was. useful
* for Fred.
*
* 69 3/07/98 3:48p Lawrance
* get save game working, allow restore from main menu
*
* 68 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 67 2/20/98 4:43p Dave
* Finished support for multiplayer player data files. Split off
* multiplayer campaign functionality.
*
* 66 2/19/98 6:26p Dave
* Fixed a few file xfer bugs. Tweaked mp team select screen. Put in
* initial support for player data uploading.
*
* 65 2/06/98 3:47p Allender
* subtitling for movies
*
* 64 2/05/98 10:15p Lawrance
* Add support for .svg filenames.
*
* 63 1/12/98 10:07p Hoffoss
* Made tab cycle properly in debriefing screen and put in aux. pilot
* image directory.
*
* 62 1/11/98 2:45p John
* Changed .lst to .clt
*
* 61 1/11/98 2:14p John
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
* not do callbacks, I put that in global code. Made only bitmaps that
* need to load for a level load.
*
* 60 1/02/98 4:41p Allender
* added new mission folder for "player" missions
*
* 59 12/28/97 12:42p John
* Put in support for reading archive files; Made missionload use the
* cf_get_file_list function. Moved demos directory out of data tree.
*
* 58 12/17/97 10:16p Allender
* implemented a "no callback" flag to tell the cfile code not to use the
* cf_callback on files which specify this flag
*
* 57 12/08/97 6:23p Lawrance
* add cflush()
*
* 56 12/07/97 4:30p John
* Fixed bug with cfile versioning if two files use it at once. Added
* code to cfile so I could display a loading box while loading.
*
* 55 11/24/97 9:28a Hoffoss
* Moved define of CF_TYPE_MULTI_PLAYERS so it's in order. I started to
* add it because I couldn't find it, so that's indication enough it
* needed it.
*
* 54 11/20/97 1:07a Lawrance
* add support for voice/debriefings directory
*
* 53 11/19/97 7:27p Hoffoss
* Added version checking read functions.
*
* 52 11/18/97 10:53a Hoffoss
*
* 51 11/17/97 6:07p Hoffoss
* Make get_file_list() allow filtering via a callback function.
*
* 50 11/16/97 2:29p John
* added versioning to nebulas; put nebula code into freespace.
*
* 49 11/15/97 6:10p Lawrance
* add in support for new voice directories
*
* 48 11/11/97 4:54p Dave
* Put in support for single vs. multiplayer pilots. Put in initial player
* selection screen (no command line option yet). Started work on
* multiplayer campaign file save gaming.
*
* 47 11/07/97 4:00p Hoffoss
* Capitalized directory names, changed the player/image directory to work
* like the rest, and forced the player/images directory to be created.
*
* 46 11/06/97 5:38p Hoffoss
* Added a new player image directory and added support for it.
*
* 45 11/04/97 7:46p Lawrance
* Add support for data\interface\HUD directory
*
* 44 10/29/97 6:22p Hoffoss
* Added some new file listing functions.
*
* 43 10/28/97 10:54a Lawrance
* support for 8b22k and 16b11k directories under the sound directory
*
* 42 10/14/97 11:34p Lawrance
* add function to get full path for a given filename
*
* 41 9/24/97 5:30p Lawrance
* add directory for voices
*
* 40 9/20/97 8:16a John
* Made .clr files go into the Cache directory. Replaced cfopen(name,NULL)
* to delete a file with cf_delete.
*
* 39 9/09/97 6:50p Hoffoss
* Fixed bug with mission saving.
*
* 38 9/05/97 4:52p Lawrance
* fix prototype for cfread_angles() and cfwrite_angles()
*
* 37 8/29/97 4:47p Dave
* Added an extension for state transfer status files.
*
* 36 8/21/97 12:14p Dave
* Changed demo file extension from .keg to .fsd
*
* 35 8/19/97 5:51p Hoffoss
* Fixes to cfopen to not check the default directory first, but check it
* last. Also tracks info as to where a file is located when opened.
*
* 34 8/17/97 10:22p Hoffoss
* Fixed several bugs in Fred with Undo feature. In the process, recoded
* a lot of CFile.cpp.
*
* 33 8/17/97 12:47p Hoffoss
* Changed code so I can force missions to load from the missions
* directory regardless of it's extension.
*
* 32 8/13/97 1:39p Adam
* make .ani files available in the data/effects directory
*
* 31 8/13/97 12:24p Lawrance
* Add support for effects directory
*
* 30 7/30/97 5:23p Dave
* Added file extensions for demo stuff
*
* 29 7/28/97 10:42p Lawrance
* added ctmpfile(), analog to tmpfile()
*
* 28 7/16/97 5:29p John
* added palette table caching and made scaler and liner no light tmapper
* do alpha blending in 8 bpp mode.
*
* 27 6/05/97 4:53p John
* First rev of new antialiased font stuff.
*
* 26 6/05/97 1:22p Allender
* added .ntl as an extension for nettest program
*
* 25 4/25/97 11:31a Allender
* Campaign state now saved in campaign save file in player directory.
* Made some global variables follow naming convention. Solidified
* continuing campaigns based on new structure
*
* 24 4/17/97 9:01p Allender
* start of campaign stuff. Campaigns now stored in external file (no
* filenames in code). Continuing campaign won't work at this point
*
* 23 4/03/97 4:26p Lawrance
* adding .wav search to music directory
*
* 22 4/01/97 9:26a Allender
* added support for descent style fonts although they are not used in the
* game yet
*
* 21 3/04/97 8:17a John
* Fixed movie code to not require a file handle. Used CFILE instead.
* Took cfile_get_handle or whatever out.
*
* 20 3/03/97 8:57a Lawrance
* took out cf_returnfp()
*
* 19 3/01/97 2:09p Lawrance
* supporting memory mapped files, moved cfile implementation details into
* .cpp file
*
* 18 2/17/97 3:00p Lawrance
* added .ani type to MAPS_EXT and INTERFACE_EXT
*
* 17 2/07/97 9:00a Lawrance
* added cfread_uint() and cwrite_uint()
*
* 16 2/04/97 9:29a Allender
* added cfwrite* functions
*
* 15 1/22/97 10:48a Lawrance
* supporting AVI playback
*
* 14 12/23/96 10:56a John
* Totally restructured the POF stuff to support multiple
* detail levels in one POF file.
*
*
* 13 11/20/96 10:00a Hoffoss
* Added cfile_chdir() function.
*
* 12 11/13/96 10:14a Allender
* added small routines to read basic data types. Also changed code to
* try to find extensions in more than 1 directory.
*
* 11 11/11/96 3:21p Allender
* added extension for movies
*
* $NoKeywords: $
*/
#ifndef __CFILE_H__
#define __CFILE_H__
#include <time.h>
#include "globalincs/pstypes.h"
#if defined _WIN32
#define DIR_SEPARATOR_CHAR '\\'
#define DIR_SEPARATOR_STR "\\"
#elif defined SCP_UNIX
#define DIR_SEPARATOR_CHAR '/'
#define DIR_SEPARATOR_STR "/"
#else
#error unknown OS
#endif
#define CF_EOF (-1)
#define CF_SEEK_SET (0)
#define CF_SEEK_CUR (1)
#define CF_SEEK_END (2)
typedef struct CFILE {
int id; // Index into cfile.cpp specific structure
int version; // version of this file
} CFILE;
// extra info that can be returned when getting a file listing
typedef struct {
time_t write_time;
} file_list_info;
#define CF_MAX_FILENAME_LENGTH 32 // Includes null terminater, so real length is 31
#define CF_MAX_PATHNAME_LENGTH 256 // Includes null terminater, so real length is 255
#define CF_TYPE_ANY -1 // Used to check in any directory
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MISSIONS 5
#define CF_TYPE_MODELS 6
#define CF_TYPE_TABLES 7
#define CF_TYPE_SOUNDS 8
#define CF_TYPE_SOUNDS_8B22K 9
#define CF_TYPE_SOUNDS_16B11K 10
#define CF_TYPE_VOICE 11
#define CF_TYPE_VOICE_BRIEFINGS 12
#define CF_TYPE_VOICE_CMD_BRIEF 13
#define CF_TYPE_VOICE_DEBRIEFINGS 14
#define CF_TYPE_VOICE_PERSONAS 15
#define CF_TYPE_VOICE_SPECIAL 16
#define CF_TYPE_VOICE_TRAINING 17
#define CF_TYPE_MUSIC 18
#define CF_TYPE_MOVIES 19
#define CF_TYPE_INTERFACE 20
#define CF_TYPE_FONT 21
#define CF_TYPE_EFFECTS 22
#define CF_TYPE_HUD 23
#define CF_TYPE_PLAYER_MAIN 24
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
#define CF_TYPE_CACHE 26
#define CF_TYPE_PLAYERS 27
#define CF_TYPE_SINGLE_PLAYERS 28
#define CF_TYPE_MULTI_PLAYERS 29
#define CF_TYPE_MULTI_CACHE 30
#define CF_TYPE_CONFIG 31
#define CF_TYPE_SQUAD_IMAGES_MAIN 32
#define CF_TYPE_DEMOS 33
#define CF_TYPE_CBANIMS 34
#define CF_TYPE_INTEL_ANIMS 35
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
// #define's for the type parameter in cfopen.
#define CFILE_NORMAL 0 // open file normally
#define CFILE_MEMORY_MAPPED (1<<0) // open file as a memory-mapped file
#define CF_SORT_NONE 0
#define CF_SORT_NAME 1
#define CF_SORT_TIME 2
#define CF_SORT_REVERSE 3
#define cfread_fix(file) (fix)cfread_int(file)
#define cfwrite_fix(i,file) cfwrite_int(i,file)
// callback function used for get_file_list() to filter files to be added to list. Return 1
// to add file to list, or 0 to not add it.
extern int (*Get_file_list_filter)(char *filename);
// cfile directory. valid after cfile_init() returns successfully
#define CFILE_ROOT_DIRECTORY_LEN 256
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
#ifdef SCP_UNIX
extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
#endif
//================= LOW-LEVEL FUNCTIONS ==================
// Call this once at the beginning of the program
int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
// Call this if pack files got added or removed or the
// cdrom changed. This will refresh the list of filenames
// stored in packfiles and on the cdrom.
void cfile_refresh();
// add an extension to a filename if it doesn't already have it
char *cf_add_ext(char *filename, char *ext);
// return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
int cf_get_dir_type(CFILE *cfile);
// Opens the file. If no path is given, use the extension to look into the
// default path. If mode is NULL, delete the file.
CFILE *cfopen(char *filename, char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
// Flush the open file buffer
int cflush(CFILE *cfile);
// version number of opened file. Will be 0 unless you put something else here after you
// open a file. Once set, you can use minimum version numbers with the read functions.
void cf_set_version( CFILE * cfile, int version );
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete( char *filename, int dir_type );
// Same as _access function to read a file's access bits
int cf_access( char *filename, int dir_type, int mode );
// Returns 1 if file exists, 0 if not.
int cf_exist( char *filename, int dir_type );
// ctmpfile() opens a temporary file stream. File is deleted automatically when closed
CFILE *ctmpfile();
// Closes the file
int cfclose(CFILE *cfile);
// Returns size of file...
int cfilelength(CFILE *fp);
// Reads data
int cfread(void *buf, int elsize, int nelem, CFILE *fp);
// cfwrite() writes to the file
int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile);
// Reads/writes RLE compressed data.
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile);
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile);
// Moves the file pointer
int cfseek(CFILE *fp, int offset, int where);
// Returns current position of file.
int cftell(CFILE *fp);
// cfputc() writes a character to a file
int cfputc(int c, CFILE *cfile);
// cfputs() writes a string to a file
int cfputs(char *str, CFILE *cfile);
// cfgetc() reads a character to a file
int cfgetc(CFILE *cfile);
// cfgets() reads a string from a file
char *cfgets(char *buf, int n, CFILE *cfile);
// cfeof() Tests for end-of-file on a stream
int cfeof(CFILE *cfile);
// Return the data pointer associated with the CFILE structure (for memory mapped files)
void *cf_returndata(CFILE *cfile);
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_short(char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_long(char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
// convenient for misc checksumming purposes ------------------------------------------
// update cur_chksum with the chksum of the new_data of size new_data_size
ushort cf_add_chksum_short(ushort seed, char *buffer, int size);
// update cur_chksum with the chksum of the new_data of size new_data_size
unsigned long cf_add_chksum_long(unsigned long seed, char *buffer, int size);
// convenient for misc checksumming purposes ------------------------------------------
//================= HIGH LEVEL FUNCTIONS ==================
int cfexist(char *filename); // Returns true if file exists on disk (1) or in hog (2).
// rename a file, utilizing the extension to determine where file is.
#define CF_RENAME_SUCCESS 0 // successfully renamed the file
#define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
int cf_rename(char *old_name, char *name, int type = CF_TYPE_ANY );
// changes the attributes of a file
void cf_attrib(char *name, int set, int clear, int type);
// flush (delete all files in) the passed directory (by type), return the # of files deleted
// NOTE : WILL NOT DELETE READ-ONLY FILES
int cfile_flush_dir(int type);
// functions for reading from cfile
// These are all high level, built up from
// cfread.
int cfgetc(CFILE *fp);
char *cfgets(char *buf, size_t n, CFILE *fp);
char cfread_char(CFILE *file, int ver = 0, char deflt = 0);
ubyte cfread_ubyte(CFILE *file, int ver = 0, ubyte deflt = 0);
short cfread_short(CFILE *file, int ver = 0, short deflt = 0);
ushort cfread_ushort(CFILE *file, int ver = 0, ushort deflt = 0);
int cfread_int(CFILE *file, int ver = 0, int deflt = 0);
uint cfread_uint(CFILE *file, int ver = 0, uint deflt = 0);
float cfread_float(CFILE *file, int ver = 0, float deflt = 0.0f);
void cfread_vector(vec3d *vec, CFILE *file, int ver = 0, vec3d *deflt = NULL);
void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
// Reads variable length, null-termined string. Will only read up
// to n characters.
void cfread_string(char *buf,int n, CFILE *file);
// Read a fixed length that is null-terminatedm, and has the length
// stored in file
void cfread_string_len(char *buf,int n, CFILE *file);
// functions for writing cfiles
int cfwrite_char(char c, CFILE *file);
int cfwrite_float(float f, CFILE *file);
int cfwrite_int(int i, CFILE *file);
int cfwrite_uint(uint i, CFILE *file);
int cfwrite_short(short s, CFILE *file);
int cfwrite_ushort(ushort s, CFILE *file);
int cfwrite_ubyte(ubyte u, CFILE *file);
int cfwrite_vector(vec3d *vec, CFILE *file);
int cfwrite_angles(angles *ang, CFILE *file);
// writes variable length, null-termined string.
int cfwrite_string(char *buf, CFILE *file);
// write a fixed length that is null-terminatedm, and has the length
// stored in file
int cfwrite_string_len(char *buf, CFILE *file);
int cf_get_file_list( int max, char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files.
// Input: filespace - Filename & extension
// pathtype - See CF_TYPE_ defines in CFILE.H
// Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns 0.
int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, int *size, int *offset, bool localize = false);
// Functions to change directories
int cfile_chdir(char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
#endif
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type);
// restore directory on top of the stack
int cfile_pop_dir();
#endif /* __CFILE_H__ */
-310
View File
@@ -1,310 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
* $Revision: 2.7 $
* $Date: 2005-07-24 18:31:17 $
* $Author: taylor $
*
* Low-level code for reading data out of large archive files or normal files. All
* reads/seeks come through here.
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2004/07/26 20:47:25 Kazan
* remove MCD complete
*
* Revision 2.5 2004/07/12 16:32:42 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.4 2004/03/05 09:01:54 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.3 2003/03/19 09:05:25 Goober5000
* more housecleaning, this time for debug warnings
* --Goober5000
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/29 19:17:21 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 4 2/22/99 10:31p Andsager
* Get rid of unneeded includes.
*
* 3 1/06/99 2:24p Dave
* Stubs and release build fixes.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 12 5/14/98 8:10p Lawrance
* Fix bug with trying to read past the end of a file (when from a
* packfile).
*
* 11 5/11/98 11:48a John
* fixed bug with memory mapped files
*
* 10 5/11/98 10:59a John
* added in debug code
*
* 9 5/11/98 10:59a John
* Moved the low-level file reading code into cfilearchive.cpp.
*
* 8 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 7 4/20/98 11:49a Hoffoss
* Fixed bug with directory name getting.
*
* 6 4/10/98 12:18a Hoffoss
* Make pilot image search in pack file possible.
*
* 5 1/19/98 9:37p Allender
* Great Compiler Warning Purge of Jan, 1998. Used pragma's in a couple
* of places since I was unsure of what to do with code.
*
* 4 12/30/97 5:31p Lawrance
* fixed problem for people that didn't have a VP file
*
* 3 12/30/97 4:31p Sandeep
* Changed pakfile format
*
* 2 12/28/97 12:42p John
* Put in support for reading archive files; Made missionload use the
* cf_get_file_list function. Moved demos directory out of data tree.
*
* 1 12/28/97 11:48a John
*
* $NoKeywords: $
*/
#define _CFILE_INTERNAL
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "cfile/cfile.h"
#include "cfile/cfilearchive.h"
#define CHECK_POSITION
// Called once to setup the low-level reading code.
void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
{
Assert(cfile != NULL);
Cfile_block *cb;
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
cb->lib_offset = offset;
cb->raw_position = 0;
cb->size = size;
if ( cb->fp ) {
if ( cb->lib_offset ) {
fseek( cb->fp, cb->lib_offset, SEEK_SET );
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
}
}
// cfeof() Tests for end-of-file on a stream
//
// returns a nonzero value after the first read operation that attempts to read
// past the end of the file. It returns 0 if the current position is not end of file.
// There is no error return.
int cfeof(CFILE *cfile)
{
Assert(cfile != NULL);
Cfile_block *cb;
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
int result;
result = 0;
// cfeof() not supported for memory-mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
if (cb->raw_position >= cb->size ) {
result = 1;
} else {
result = 0;
}
return result;
}
// cftell() returns offset into file
//
// returns: success ==> offset into the file
// error ==> -1
//
int cftell( CFILE * cfile )
{
Assert(cfile != NULL);
Cfile_block *cb;
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
// Doesn't work for memory mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
return cb->raw_position;
}
// cfseek() moves the file pointer
//
// returns: success ==> 0
// error ==> non-zero
//
int cfseek( CFILE *cfile, int offset, int where )
{
Assert(cfile != NULL);
Cfile_block *cb;
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
// TODO: seek to offset in memory mapped file
Assert( !cb->data );
Assert( cb->fp != NULL );
int goal_position;
switch( where ) {
case CF_SEEK_SET:
goal_position = offset+cb->lib_offset;
break;
case CF_SEEK_CUR:
{
goal_position = cb->raw_position+offset+cb->lib_offset;
}
break;
case CF_SEEK_END:
goal_position = cb->size+offset+cb->lib_offset;
break;
default:
Int3();
return 1;
}
int result = fseek(cb->fp, goal_position, SEEK_SET );
cb->raw_position = goal_position - cb->lib_offset;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset;
tmp_offset = (int)ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return result;
}
// cfread() reads from a file
//
// returns: returns the number of full elements read
//
//
int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
{
Assert(cfile != NULL);
Assert(buf != NULL);
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
Cfile_block *cb;
cb = &Cfile_block_list[cfile->id];
// cfread() not supported for memory-mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
int size = elsize*nelem;
Assert(nelem > 0);
Assert(elsize > 0);
Assert(size > 0);
if ( (cb->raw_position+size) > cb->size ) {
size = cb->size - cb->raw_position;
if ( size < 1 ) {
return 0;
}
//mprintf(( "CFILE: EOF encountered in file\n" ));
}
int bytes_read = fread( buf, 1, size, cb->fp );
if ( bytes_read > 0 ) {
cb->raw_position += bytes_read;
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return bytes_read / elsize;
}
-95
View File
@@ -1,95 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
* $Revision: 2.3 $
* $Date: 2005-07-13 02:50:49 $
* $Author: Goober5000 $
*
* External def's for CfileArchive.cpp. This should only be used
* internally by cfile stuff.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/17 02:56:19 mharris
* first crack at unix compatibity
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 4 5/11/98 10:59a John
* Moved the low-level file reading code into cfilearchive.cpp.
*
* 3 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 2 12/28/97 12:42p John
* Put in support for reading archive files; Made missionload use the
* cf_get_file_list function. Moved demos directory out of data tree.
*
* 1 12/28/97 11:48a John
*
* $NoKeywords: $
*/
#ifndef _CFILEARCHIVE_H
#define _CFILEARCHIVE_H
#ifndef _CFILE_INTERNAL
#error This file should only be included internally in CFILE!!
#endif
// The following Cfile_block data is private to cfile.cpp
// DO NOT MOVE the Cfile_block* information to cfile.h / do not extern this data
//
#define CFILE_BLOCK_UNUSED 0
#define CFILE_BLOCK_USED 1
typedef struct Cfile_block {
int type; // CFILE_BLOCK_UNUSED, CFILE_BLOCK_USED
int dir_type; // directory location
FILE *fp; // File pointer if opening an individual file
void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
#ifdef _WIN32
HANDLE hInFile; // Handle from CreateFile()
HANDLE hMapFile; // Handle from CreateFileMapping()
#else
// int fd; // file descriptor
size_t data_length; // length of data for mmap
#endif
int lib_offset;
int raw_position;
int size; // for packed files
} Cfile_block;
#define MAX_CFILE_BLOCKS 64
extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
// Called once to setup the low-level reading code.
void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size );
#endif
-528
View File
@@ -1,528 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
* $Revision: 2.6 $
* $Date: 2005-01-31 23:27:51 $
* $Author: taylor $
*
* Code for doing directory lists and sorts
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2004/07/26 20:47:25 Kazan
* remove MCD complete
*
* Revision 2.4 2004/07/17 09:26:00 taylor
* add CF_SORT_REVERSE to real sort routine, makes CF_SORT_TIME work again
*
* Revision 2.3 2004/07/12 16:32:42 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/29 19:37:21 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 2/22/99 10:31p Andsager
* Get rid of unneeded includes.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 6 5/13/98 10:22p John
* Added cfile functions to read/write rle compressed blocks of data.
* Made palman use it for .clr files. Made alphacolors calculate on the
* fly rather than caching to/from disk.
*
* 5 5/06/98 5:30p John
* Removed unused cfilearchiver. Removed/replaced some unused/little used
* graphics functions, namely gradient_h and _v and pixel_sp. Put in new
* DirectX header files and libs that fixed the Direct3D alpha blending
* problems.
*
* 4 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 3 4/10/98 12:18a Hoffoss
* Make pilot image search in pack file possible.
*
* 2 3/30/98 10:36p Allender
* be sure to call _findclose() when done reading a file list
*
* 1 12/28/97 11:48a John
*
* $NoKeywords: $
*/
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
// n = number of filenames in list to sort
// list = list of filenames to be sorted
// sort = sorting method to use (one of the CF_SORT_* defines)
// info = extra info for each file. Only required if sorting by time, however if you
// have extra file info, you should pass it as well to get it sorted too (so an
// index into list is the same index for info for that file
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
{
int i, j, incr;
char *t;
file_list_info tt;
if (sort == CF_SORT_NAME) {
incr = n / 2;
while (incr > 0) {
for (i=incr; i<n; i++) {
j = i - incr;
while (j >= 0) {
if (stricmp(list[j], list[j + incr]) > 0) {
t = list[j];
list[j] = list[j + incr];
list[j + incr] = t;
if (info) {
tt = info[j];
info[j] = info[j + incr];
info[j + incr] = tt;
}
j -= incr;
} else
break;
}
}
incr /= 2;
}
return;
} else if (sort == CF_SORT_TIME) {
Assert(info);
incr = n / 2;
while (incr > 0) {
for (i=incr; i<n; i++) {
j = i - incr;
while (j >= 0) {
if (info[j].write_time < info[j + incr].write_time) {
t = list[j];
list[j] = list[j + incr];
list[j + incr] = t;
tt = info[j];
info[j] = info[j + incr];
info[j + incr] = tt;
j -= incr;
} else
break;
}
}
incr /= 2;
}
return;
} else if (sort == CF_SORT_REVERSE) {
incr = n / 2;
char buffer[MAX_FILENAME_LEN];
for (i = 0; i < incr; i++) {
t = list[n - 1 - i];
if ( stricmp(list[i], t) > 0 ) {
strcpy(buffer, list[i]);
strcpy(list[i], t);
strcpy(t, buffer);
}
}
return;
}
nprintf(("Error", "Unknown sorting method %d passed to cf_sort_filenames()\n", sort));
}
#if (0) // these aren't used anywhere now
// cf_compress - Do Run Length Compression on a block of data. Targa format.
//
// Usage:
// out Buffer to write it out to
// in Buffer to compress
// bytecount Number of bytes input
int cf_compress(char *out, char *in, int bytecount )
{
int pixcount; // number of pixels in the current packet
char *inputpixel=NULL; // current input pixel position
char *matchpixel=NULL; // pixel value to match for a run
char *flagbyte=NULL; // location of last flag byte to set
int rlcount; // current count in r.l. string
int rlthresh; // minimum valid run length
char *copyloc; // location to begin copying at
// set the threshold -- the minimum valid run length
rlthresh = 2; // Require a 2 pixel span before rle'ing
// set the first pixel up
flagbyte = out; // place to put next flag if run
inputpixel = in;
pixcount = 1;
rlcount = 0;
copyloc = (char *)0;
// loop till data processing complete
do {
// if we have accumulated a 128-byte packet, process it
if ( pixcount == 129 ) {
*flagbyte = 127;
// set the run flag if this is a run
if ( rlcount >= rlthresh ) {
*flagbyte |= 0x80;
pixcount = 2;
}
// copy the data into place
++flagbyte;
memmove( flagbyte, copyloc, pixcount-1 );
flagbyte += pixcount-1;
pixcount = 1;
// set up for next packet
continue;
}
// if zeroth byte, handle as special case
if ( pixcount == 1 ) {
rlcount = 0;
copyloc = inputpixel; /* point to 1st guy in packet */
matchpixel = inputpixel; /* set pointer to pix to match */
pixcount = 2;
inputpixel += 1;
continue;
}
// assembling a packet -- look at next pixel
// current pixel == match pixel?
if ( *inputpixel == *matchpixel ) {
// establishing a run of enough length to
// save space by doing it
// -- write the non-run length packet
// -- start run-length packet
if ( ++rlcount == rlthresh ) {
// close a non-run packet
if ( pixcount > (rlcount+1) ) {
// write out length and do not set run flag
*flagbyte++ = (char)(pixcount - 2 - rlthresh);
memmove(flagbyte, copyloc, (pixcount-1-rlcount) );
flagbyte += (pixcount-1-rlcount);
copyloc = inputpixel;
pixcount = rlcount + 1;
}
}
} else {
// no match -- either break a run or continue without one
// if a run exists break it:
// write the bytes in the string (1+1)
// start the next string
if ( rlcount >= rlthresh ) {
*flagbyte++ = (char)(0x80 | rlcount);
memmove(flagbyte, copyloc, 1 );
flagbyte += 1;
pixcount = 1;
continue;
} else {
// not a match and currently not a run
// - save the current pixel
// - reset the run-length flag
rlcount = 0;
matchpixel = inputpixel;
}
}
pixcount++;
inputpixel += 1;
} while ( inputpixel < (in + bytecount));
// quit this buffer without loosing any data
if ( --pixcount >= 1 ) {
*flagbyte = (char)(pixcount - 1);
if ( rlcount >= rlthresh ) {
*flagbyte |= 0x80;
pixcount = 1;
}
// copy the data into place
++flagbyte;
memmove(flagbyte, copyloc, pixcount );
flagbyte += pixcount;
}
return(flagbyte-out);
}
// cf_decompress - Do Decompression on a run-length encoded block of data. Targa format.
//
// Usage:
// out Buffer to write it out to
// in Buffer to compress
// bytecount Number of bytes input
int cf_decompress(char *out, char *in )
{
int count;
char *param_out = out;
while(1) {
count = int(*in++);
int run_span = count & 0x80;
count &= (~0x80);
if ( count > 0 ) {
if ( run_span ) {
// RLE'd data
ubyte c = *in++;
memset( out, c, count );
out += count;
} else {
memmove( out, in, count );
in += count;
out += count;
}
}
}
return out - param_out;
}
#endif // 0
// cfread() reads from a file and decompresses it
//
// returns: returns the number of full elements read
//
//
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
{
char *out = (char *)buf;
while(1) {
byte count;
if ( cfread( &count, 1, 1, cfile ) != 1 ) {
break;
}
int run_span = count & 0x80;
count &= (~0x80);
count++;
if ( count > 0 ) {
if ( run_span ) {
// RLE'd data
byte c;
if ( cfread( &c, 1, 1, cfile ) != 1 ) {
break;
}
memset( out, c, count );
} else {
if ( cfread( out, 1, count, cfile ) != count ) {
break;
}
}
out += count;
if ( out >= (char *)buf + (elsize*nelem)) {
break;
}
} else {
break;
}
}
return (out - (char *)buf)/elsize;
}
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile)
{
char *in = (char *)param_buf;
int bytecount = (param_elsize * param_nelem );
int pixcount; // number of pixels in the current packet
char *inputpixel=NULL; // current input pixel position
char *matchpixel=NULL; // pixel value to match for a run
int rlcount; // current count in r.l. string
int rlthresh; // minimum valid run length
char *copyloc; // location to begin copying at
// set the threshold -- the minimum valid run length
rlthresh = 2; // Require a 2 pixel span before rle'ing
// set the first pixel up
inputpixel = in;
pixcount = 1;
rlcount = 0;
copyloc = (char *)0;
// loop till data processing complete
do {
// if we have accumulated a 128-byte packet, process it
if ( pixcount == 129 ) {
ubyte code = 127;
// set the run flag if this is a run
if ( rlcount >= rlthresh ) {
code |= 0x80;
pixcount = 2;
}
cfwrite( &code, 1, 1, cfile );
// copy the data into place
cfwrite( copyloc, 1, pixcount-1, cfile );
pixcount = 1;
// set up for next packet
continue;
}
// if zeroth byte, handle as special case
if ( pixcount == 1 ) {
rlcount = 0;
copyloc = inputpixel; /* point to 1st guy in packet */
matchpixel = inputpixel; /* set pointer to pix to match */
pixcount = 2;
inputpixel += 1;
continue;
}
// assembling a packet -- look at next pixel
// current pixel == match pixel?
if ( *inputpixel == *matchpixel ) {
// establishing a run of enough length to
// save space by doing it
// -- write the non-run length packet
// -- start run-length packet
if ( ++rlcount == rlthresh ) {
// close a non-run packet
if ( pixcount > (rlcount+1) ) {
// write out length and do not set run flag
ubyte code = (ubyte)(pixcount - 2 - rlthresh);
cfwrite( &code, 1, 1, cfile );
cfwrite( copyloc, 1, (pixcount-1-rlcount), cfile );
copyloc = inputpixel;
pixcount = rlcount + 1;
}
}
} else {
// no match -- either break a run or continue without one
// if a run exists break it:
// write the bytes in the string (1+1)
// start the next string
if ( rlcount >= rlthresh ) {
ubyte code = (ubyte)(0x80 | rlcount);
cfwrite( &code, 1, 1, cfile );
cfwrite( copyloc, 1, 1, cfile );
pixcount = 1;
continue;
} else {
// not a match and currently not a run
// - save the current pixel
// - reset the run-length flag
rlcount = 0;
matchpixel = inputpixel;
}
}
pixcount++;
inputpixel += 1;
} while ( inputpixel < (in + bytecount));
// quit this buffer without loosing any data
if ( --pixcount >= 1 ) {
ubyte code = ubyte(pixcount - 1);
// set the run flag if this is a run
if ( rlcount >= rlthresh ) {
code |= 0x80;
pixcount = 1;
}
cfwrite( &code, 1, 1, cfile );
// copy the data into place
cfwrite( copyloc, 1, pixcount, cfile );
}
return param_nelem;
}
File diff suppressed because it is too large. Load diff
-87
View File
@@ -1,87 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
* $Revision: 2.3 $
* $Date: 2005-07-13 02:50:49 $
* $Author: Goober5000 $
*
* Functions to keep track of and find files that can exist
* on the harddrive, cd-rom, or in a pack file on either of those.
* This keeps a list of all the files in packfiles or on CD-rom
* and when you need a file you call one function which then searches
* all those locations, inherently enforcing precedence orders.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2004/03/05 09:01:54 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 10/13/98 9:19a Andsager
* Add localization support to cfile. Optional parameter with cfopen that
* looks for localized files.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 5 5/01/98 10:21a John
* Added code to find all pack files in all trees. Added code to create
* any directories that we write to.
*
* 4 4/30/98 10:21p John
* Added code to cleanup cfilesystem
*
* $NoKeywords: $
*/
#ifndef _CFILESYSTEM_H
#define _CFILESYSTEM_H
#include "cfile/cfile.h"
// Builds a list of all the files
void cf_build_secondary_filelist( char *cdrom_path );
void cf_free_secondary_filelist();
// Internal stuff
typedef struct cf_pathtype {
int index; // To verify that the CF_TYPE define is correctly indexed into this array
char *path; // Path relative to Freespace root, has ending backslash.
char *extensions; // Extensions used in this pathtype, separated by spaces
int parent_index; // Index of this directory's parent. Used for creating directories when writing.
} cf_pathtype;
// During cfile_init, verify that Pathtypes[n].index == n for each item
extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
// Returns the default storage path for files given a
// particular pathtype. In other words, the path to
// the unpacked, non-cd'd, stored on hard drive path.
// If filename isn't null it will also tack the filename
// on the end, creating a completely valid filename.
// Input: pathtype - CF_TYPE_??
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
void cf_create_default_path_string( char *path, int pathtype, char *filename=NULL, bool localize = false);
#endif //_CFILESYSTEM_H
@@ -1,426 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
* $Revision: 2.3 $
* $Date: 2005-09-08 00:09:31 $
* $Author: taylor $
*
* Program to create an archive file for use with cfile stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2005/01/30 12:50:08 taylor
* merge with Linux/OSX tree - p0130
*
* Revision 2.1 2003/11/16 09:42:37 Goober5000
* clarified and pruned debug spew messages
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/23/98 6:15p Dave
*
* $NoKeywords: $
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
#include <direct.h>
#include <io.h>
#include <conio.h>
#else
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
static int data_error;
static int no_dir;
unsigned int Total_size=16; // Start with size of header
unsigned int Num_files =0;
FILE *fp_out = NULL;
FILE *fp_out_hdr = NULL;
typedef struct vp_header {
char id[4];
int version;
int index_offset;
int num_files;
} vp_header;
//vp_header Vp_header;
char archive_dat[1024];
char archive_hdr[1024];
#define BLOCK_SIZE (1024*1024)
#define VERSION_NUMBER 2;
char tmp_data[BLOCK_SIZE]; // 1 MB
void write_header()
{
fseek(fp_out, 0, SEEK_SET);
fwrite("VPVP", 1, 4, fp_out);
int ver = VERSION_NUMBER;
fwrite(&ver, 1, 4, fp_out);
fwrite(&Total_size, 1, 4, fp_out);
fwrite(&Num_files, 1, 4, fp_out);
}
int write_index(char *hf, char *df)
{
FILE *h = fopen(hf, "rb");
if (!h) return 0;
FILE *d = fopen(df, "a+b");
if (!d) return 0;
for (unsigned int i=0;i<Num_files;i++) {
fread(tmp_data, 32+4+4+4, 1, h);
fwrite(tmp_data, 32+4+4+4, 1, d);
}
fclose(h);
fclose(d);
return 1;
}
void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_write )
{
char path[1024];
if ( strstr( filename, ".vp" )) {
// Don't pack yourself!!
return;
}
if ( strstr( filename, ".hdr" )) {
// Don't pack yourself!!
return;
}
if ( filesize == 0 ) {
// Don't pack 0 length files, screws up directory structure!
return;
}
memset( path, 0, sizeof(path));
strcpy( path, filename );
if ( strlen(filename)>31 ) {
printf( "Filename '%s' too long\n", filename );
exit(1);
}
fwrite( &Total_size, 1, 4, fp_out_hdr );
fwrite( &filesize, 1, 4, fp_out_hdr );
fwrite( &path, 1, 32, fp_out_hdr );
fwrite( &time_write, 1, sizeof(_fs_time_t), fp_out_hdr);
Total_size += filesize;
Num_files++;
printf( "Packing %s%s%s...", filespec, DIR_SEPARATOR_STR, filename );
sprintf( path, "%s%s%s", filespec, DIR_SEPARATOR_STR, filename );
FILE *fp = fopen( path, "rb" );
if ( fp == NULL ) {
printf( "Error opening '%s'\n", path );
exit(1);
}
int nbytes, nbytes_read=0;
do {
nbytes = fread( tmp_data, 1, BLOCK_SIZE, fp );
if ( nbytes > 0 ) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_read += nbytes;
}
} while( nbytes > 0 );
fclose(fp);
printf( " %d bytes\n", nbytes_read );
}
// This function adds a directory marker to the header file
void add_directory( char * dirname)
{
char path[256];
char *pathptr = path;
char *tmpptr;
strcpy(path, dirname);
fwrite(&Total_size, 1, 4, fp_out_hdr);
int i = 0;
fwrite(&i, 1, 4, fp_out_hdr);
// strip out any directories that this dir is a subdir of
while ((tmpptr = strchr(pathptr, DIR_SEPARATOR_CHAR)) != NULL) {
pathptr = tmpptr+1;
}
fwrite(pathptr, 1, 32, fp_out_hdr);
fwrite(&i, 1, 4, fp_out_hdr); // timestamp = 0
Num_files++;
}
void pack_directory( char * filespec)
{
#ifdef _WIN32
int find_handle;
_finddata_t find;
#endif
char tmp[512];
char tmp1[512];
/*
char dir_name[512];
char *last_slash;
last_slash = strrchr(filespec, '\\');
if ( last_slash ) {
strcpy(dir_name, last_slash+1);
} else {
strcpy(dir_name, filespec);
}
if ( !stricmp(dir_name, "voice") ) {
return;
}
*/
char *ts;
// strip trailing slash
ts = filespec+(strlen(filespec)-1);
while(*ts == DIR_SEPARATOR_CHAR && ts > filespec)
*ts = '\0';
strcpy( tmp1, filespec );
add_directory(filespec);
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
printf( "In dir '%s'\n", tmp1 );
#ifdef _WIN32
find_handle = _findfirst( tmp1, &find );
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
}
}
#else
DIR *dirp;
struct dirent *dir;
dirp = opendir (filespec);
if ( dirp ) {
while ((dir = readdir(dirp)) != NULL) {
char fn[MAX_PATH];
snprintf(fn, MAX_PATH-1, "%s/%s", filespec, dir->d_name);
fn[MAX_PATH-1] = 0;
struct stat buf;
if (stat(fn, &buf) == -1) {
continue;
}
if ( (strcmp(dir->d_name, ".") == 0) || (strcmp(dir->d_name, "..") == 0) ) {
continue;
}
if (S_ISDIR(buf.st_mode)) {
strcpy( tmp, filespec );
strcat( tmp, "/" );
strcat( tmp, dir->d_name );
pack_directory(tmp);
} else {
pack_file( filespec, dir->d_name, buf.st_size, buf.st_mtime );
}
}
closedir(dirp);
} else {
printf("Error: Source directory does not exist!\n");
no_dir = 1;
}
#endif
add_directory("..");
}
int verify_directory( char *filespec )
{
char *ts;
char *dd;
// strip trailing '/'
ts = filespec+(strlen(filespec)-1);
while(*ts == DIR_SEPARATOR_CHAR && ts > filespec)
*ts = '\0';
// make sure last directory is named "data", ignoring case
dd = filespec+(strlen(filespec)-4);
if ( stricmp( dd, "data" ) )
data_error = 1;
return data_error;
}
void print_instructions()
{
printf( "Creates a vp archive out of a FreeSpace data tree.\n\n" );
printf( "Usage: cfilearchiver archive_name src_dir\n");
printf( "Example: cfilearchiver freespace /tmp/freespace/data\n\n");
printf( "Directory structure options:\n" );
printf( " Effects (.ani .pcx .neb .tga)\n" );
printf( " Fonts (.vf)\n" );
printf( " Hud (.ani .pcx .tga\n" );
printf( " Interface (.pcx .ani .tga)\n" );
printf( " Maps (.pcx .ani .tga)\n" );
printf( " Missions (.ntl .ssv), FS1(.fsm .fsc), FS2(.fs2 .fc2)\n" );
printf( " Models (.pof)\n" );
printf( " Music (.wav)\n" );
printf( " Sounds/8b22k (.wav)\n" );
printf( " Sounds/16b11k (.wav)\n" );
printf( " Tables (.tbl)\n" );
printf( " Voice/Briefing (.wav)\n" );
printf( " Voice/Command briefings (.wav)\n" );
printf( " Voice/Debriefing (.wav)\n" );
printf( " Voice/Personas (.wav)\n" );
printf( " Voice/Special (.wav)\n" );
printf( " Voice/Training (.wav)\n" );
exit(0);
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[] )
{
char archive[1024];
char *p;
if ( argc < 3 ) {
#ifdef _WIN32
printf( "Usage: %s archive_name src_dir\n", argv[0] );
printf( "Example: %s freespace c:\\freespace\\data\n", argv[0] );
printf( "Creates an archive named freespace out of the\nfreespace data tree\n" );
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
print_instructions();
#endif
}
strcpy( archive, argv[1] );
p = strchr( archive, '.' );
if (p) *p = 0; // remove extension
strcpy( archive_dat, archive );
strcat( archive_dat, ".vp" );
strcpy( archive_hdr, archive );
strcat( archive_hdr, ".hdr" );
fp_out = fopen( archive_dat, "wb" );
if ( !fp_out ) {
printf( "Couldn't open '%s'!\n", archive_dat );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(1);
#endif
}
fp_out_hdr = fopen( archive_hdr, "wb" );
if ( !fp_out_hdr ) {
printf( "Couldn't open '%s'!\n", archive_hdr );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(2);
#endif
}
if ( verify_directory( argv[2] ) != 0 ) {
printf("Warning! Last directory must be named \"data\" (not case sensitive)\n");
exit(3);
}
write_header();
pack_directory( argv[2] );
// in case the directory doesn't exist
if ( no_dir )
exit(4);
write_header();
fclose(fp_out);
fclose(fp_out_hdr);
printf( "Data files written, appending index...\n" );
if (!write_index(archive_hdr, archive_dat)) {
printf("Error appending index!\n");
#ifdef _WIN32
printf("Press any key to exit...\n");
getch();
#endif
return 1;
}
printf( "%d total KB.\n", Total_size/1024 );
return 0;
}
@@ -1,476 +0,0 @@
/*
* Copyright (C) 2005 Taylor Richards
*
*/
/*
* $Logfile: /Freespace2/code/cfileextractor/cfileextractor.cpp $
* $Revision: 1.6 $
* $Date: 2005-09-08 05:04:15 $
* $Author: taylor $
*
* Cross-platform cmdline extractor for VP files
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2005/09/08 00:09:31 taylor
* fix building/linking of command line tools under Linux/OSX
* add tools as targets to OSX project file
*
* Revision 1.4 2005/05/24 20:52:10 taylor
* make sure that we recursively create directories for Linux/OSX
* replace older recursive mkdir method in cfileextractor with new method
*
* Revision 1.3 2005/05/24 03:12:27 taylor
* get command sanity check right, fixes lowercase on extract too
*
* Revision 1.2 2005/05/18 01:57:54 taylor
* a few help text adjustments and fix some compiler warnings
*
* Revision 1.1 2005/05/17 21:00:57 taylor
* Initial import of cfileextractor, still needs some work but does what it needs to
*
*
* $NoKeywords: $
*/
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <ctime>
#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
// /////////////////////////////////////////////////////////////////////////////
//
// GLOBAL FUNCTIONS AND VARIABLES
//
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
// since it would require SDL which isn't used on WIN32 platforms
#if BYTE_ORDER == BIG_ENDIAN
#define INT_SWAP(x) ( \
(x << 24) | \
(((ulong)x) >> 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) \
)
#else
#define INT_SWAP(x) (x)
#endif
FILE *fp_in = NULL;
FILE *fp_out = NULL;
#define BLOCK_SIZE (1024*1024)
char tmp_data[BLOCK_SIZE]; // 1 MB
static int have_index = 0;
static int have_header = 0;
#define ERR_NO_FP_IN 0
#define ERR_NO_FP_OUT 1
#define ERR_INVALID_VP 2
#define ERR_NO_INDEX 3
#define ERR_NO_HEADER 4
typedef struct vp_header {
char id[4]; // 'VPVP'
int version;
int index_offset; // offset where the file index starts, also a total file data size count
int num_files; // number of files, including each step in the directory structure
} vp_header;
vp_header VP_Header;
typedef struct vp_fileinfo {
// stuff that is actually written to the VP
int offset; // offset of where this file is in the VP
int file_size; // size of file
char file_name[CF_MAX_FILENAME_LENGTH]; // filename
_fs_time_t write_time; // date/time in _fs_time_t type (a 32-bit version of time_t)
// not in the VP
char file_path[CF_MAX_PATHNAME_LENGTH]; // file path, generated here and not actually in the VP on a per file basis
vp_fileinfo() {
offset = 0;
file_size = 0;
file_name[0] = '\0';
file_path[0] = '\0';
write_time = 0;
}
~vp_fileinfo() {}
} vp_fileinfo;
std::vector<vp_fileinfo> VP_FileInfo;
// just like strlwr() but without actually including it here
void lowercase(char *s)
{
if (s == NULL)
return;
while (*s) {
*s = tolower(*s);
s++;
}
}
//
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
//
// The useful stuff...
//
void print_error(int err)
{
switch (err) {
case ERR_NO_FP_IN:
printf("ERROR: The input file (fp_in) is NULL! Exiting...\n");
break;
case ERR_NO_FP_OUT:
printf("ERROR: The output file (fp_out) is NULL! Exiting...\n");
break;
case ERR_INVALID_VP:
printf("ERROR: The specified VP file is invalid! Exiting...\n");
break;
case ERR_NO_INDEX:
printf("ERROR: No file index is available! Exiting...\n");
break;
case ERR_NO_HEADER:
printf("ERROR: No file header is available! Exiting...\n");
break;
default:
break;
}
exit(1);
}
void read_header()
{
fseek(fp_in, 0, SEEK_SET);
fread(&VP_Header.id, 1, 4, fp_in);
fread(&VP_Header.version, 1, sizeof(int), fp_in);
fread(&VP_Header.index_offset, 1, sizeof(int), fp_in);
fread(&VP_Header.num_files, 1, sizeof(int), fp_in);
VP_Header.version = INT_SWAP(VP_Header.version);
VP_Header.index_offset = INT_SWAP(VP_Header.index_offset);
VP_Header.num_files = INT_SWAP(VP_Header.num_files);
// check for a valid id (VPVP)
if ( (VP_Header.id[0] != 'V') && (VP_Header.id[1] != 'P') && (VP_Header.id[2] != 'V') && (VP_Header.id[3] != 'P') )
print_error(ERR_INVALID_VP);
// the index_offset needs to be greater than the size of vp_header at the very least and there should be at least one file
if ( !(VP_Header.index_offset > (int)sizeof(vp_header)) || !(VP_Header.num_files > 1) )
print_error(ERR_INVALID_VP);
have_header = 1;
}
void read_index(int lc = 0)
{
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
else if (!have_header)
print_error(ERR_NO_HEADER);
int i;
char path[CF_MAX_PATHNAME_LENGTH];
fseek(fp_in, VP_Header.index_offset, SEEK_SET);
memset(path, 0, CF_MAX_PATHNAME_LENGTH);
for ( i = 0; i < VP_Header.num_files; i++) {
vp_fileinfo vpinfo;
fread(&vpinfo.offset, 1, sizeof(int), fp_in);
fread(&vpinfo.file_size, 1, sizeof(int), fp_in);
fread(&vpinfo.file_name, 1, CF_MAX_FILENAME_LENGTH, fp_in);
fread(&vpinfo.write_time, 1, sizeof(_fs_time_t), fp_in);
vpinfo.offset = INT_SWAP(vpinfo.offset);
vpinfo.file_size = INT_SWAP(vpinfo.file_size);
vpinfo.write_time = INT_SWAP(vpinfo.write_time);
// check if it's a directory and if so then create a path to use for files
if (vpinfo.file_size == 0) {
// if we get a ".." then drop down in the path
if (!strcmp(vpinfo.file_name, "..")) {
char *s = strrchr(path, DIR_SEPARATOR_CHAR);
if (s)
*s = '\0';
// skip, we don't want to add the ".." to the path
continue;
}
// don't add the very first directory separator character, easier to clean later
if (path[0] != 0)
strcat( path, DIR_SEPARATOR_STR );
// always make directory names lower case for ease of use
lowercase( vpinfo.file_name );
strcat( path, vpinfo.file_name );
} // it's a file then
else {
// lowercase the filename if wanted
if (lc == 1)
lowercase( vpinfo.file_name );
strcpy( vpinfo.file_path, path );
VP_FileInfo.push_back(vpinfo);
}
}
have_index = 1;
}
void extract_all_files(char *file)
{
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
else if (!have_header)
print_error(ERR_NO_HEADER);
else if (!have_index)
print_error(ERR_NO_INDEX);
int status, m_error, nbytes, nbytes_remaining;
char path[CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1]; // path length + filename length + extra NULL
char *c;
printf("VP file extractor - version 0.01\n");
printf("\n");
printf("Extracting: %s...\n", file);
for (uint i = 0; i < VP_FileInfo.size(); i++) {
// save the file path to a temp location and recursively make the needed directories
sprintf(path, "%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR);
c = &path[0];
while (c++) {
c = strchr(c, DIR_SEPARATOR_CHAR);
if (c) {
*c = '\0'; // NULL at DIR_SEP char
#ifdef _WIN32
status = _mkdir(path);
#else
status = mkdir(path, 0777);
#endif
m_error = errno;
if (status && (m_error != EEXIST) ) {
printf("Cannot mkdir %s: %s\n", VP_FileInfo[i].file_path, strerror(m_error));
continue;
}
*c = DIR_SEPARATOR_CHAR; // replace DIR_SEP char
}
}
// start writing out the file
fseek(fp_in, VP_FileInfo[i].offset, SEEK_SET);
sprintf(path, "%s%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR, VP_FileInfo[i].file_name);
fp_out = fopen(path, "wb");
printf(" %s ... ", path);
if (fp_out == NULL) {
printf("can't create file!\n");
continue;
}
nbytes_remaining = VP_FileInfo[i].file_size;
while ( nbytes_remaining > 0 ) {
nbytes = fread( tmp_data, 1, MIN(BLOCK_SIZE, nbytes_remaining), fp_in );
if (nbytes > 0) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_remaining -= nbytes;
}
}
printf("done!\n");
fclose(fp_out);
fp_out = NULL;
}
printf("\n");
}
// TODO: the formatting of this is a bit loco but I don't care enough to make it better...
void list_all_files(char *file)
{
char out_time[20];
float one_k = 1024.0f;
float one_m = 1048576.0f;
char m;
float div_by;
time_t plat_time;
// if we don't have an index then bail
if (!have_index)
print_error(ERR_NO_INDEX);
printf("VP file extractor - version 0.01\n");
printf("\n");
printf("%s:\n", file);
printf("\n");
printf(" Name Size Offset Date/Time Path\n");
printf("-------------------------------------------------------------------------------\n");
for (uint i = 0; i < VP_FileInfo.size(); i++) {
plat_time = VP_FileInfo[i].write_time; // gets rid of some platform strangeness this way
strftime(out_time, 32, "%F %H:%M", localtime(&plat_time)); // YYYY-mm-dd HH:mm (ISO 8601 date format, 24-hr time)
if (VP_FileInfo[i].file_size > (int)one_m) {
m = 'M';
div_by = one_m;
} else {
m = 'K';
div_by = one_k;
}
int len = strlen( VP_FileInfo[i].file_name );
printf("%s %*.1f%c %10i %18s %3s%s\n", VP_FileInfo[i].file_name, 33 - len, (float)VP_FileInfo[i].file_size/div_by, m, VP_FileInfo[i].offset, out_time, DIR_SEPARATOR_STR, VP_FileInfo[i].file_path);
}
printf("\n");
// we use the vector size here since VP_Header.num_files would include each entry
// in the directory tree as well as individual files and that artificially inflates
// the number of files that we show or would extract
printf("Total files: %i\n", (int)VP_FileInfo.size());
// yeah, I'm just that cheap
if (VP_Header.index_offset > (int)one_m) {
m = 'M';
div_by = one_m;
} else {
m = 'K';
div_by = one_k;
}
printf("Total size: %.1f%c\n", (float)VP_Header.index_offset/div_by, m);
printf("\n");
}
void help()
{
printf("VP file extractor - version 0.5\n");
printf("\n");
printf("Usage: cfileextractor [-x | -l] [-L] <vp_filename>\n");
printf("\n");
printf(" Commands (only one at the time):\n");
printf(" -x | --extract Extract all files into current directory.\n");
printf(" -l | --list List all files in VP archive.\n");
printf(" -h | --help Show this help text.\n");
printf("\n");
printf(" Options:\n");
printf(" -L | --lowercase Force all filenames to be lower case.\n");
printf("\n");
printf(" (No command specified will list all files in the VP archive.)\n");
printf("\n");
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[])
{
int extract = 0, lc = 0, list = 0;
if (argc < 2) {
help();
return 0;
}
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
help();
return 0;
}
// the last option should always be the VP file that we want
fp_in = fopen(argv[argc-1], "rb");
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
// if the header is invalid then read_header() should exit us out
read_header();
// TODO: add filter based extraction
for (int i = 1; i < argc-1; i++) {
if (!strcmp(argv[i], "-x") || !strcmp(argv[i], "--extract")) {
if (list) {
help();
exit(0);
}
extract = 1;
} else if (!strcmp(argv[i], "-L") || !strcmp(argv[i], "--lowercase")) {
lc = 1;
} else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) {
if (extract) {
help();
exit(0);
}
list = 1;
} else {
help();
return 0;
}
}
// read the file index, make all filenames lowercase if wanted
read_index( lc );
if (extract) {
extract_all_files( argv[argc-1] );
return 0;
} else if (list) {
list_all_files( argv[argc-1] );
return 0;
} else {
// if only -L is specified or no command is specified then just list files
list_all_files( argv[argc-1] );
return 0;
}
return 0;
}
File diff suppressed because it is too large. Load diff
-605
View File
@@ -1,605 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.73 $
* $Date: 2005-07-25 05:24:16 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 2.72 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.71 2005/07/07 16:32:33 taylor
* compiler warning fixes
* add -noibx troubleshooting cmdline option to disable use of IBX files
* don't try to set thuster object number is only one thruster bank is specified (default method should go into affect)
*
* Revision 2.70 2005/06/29 18:46:13 taylor
* add option to not scale up movies to fit window/screen, default is to scale
* (arguably not a bug but I said I would get it in before 3.6.5 and forgot)
*
* Revision 2.69 2005/03/13 23:07:35 taylor
* enable 32-bit to 16-bit TGA conversion with -tga16 cmdline option (experimental)
* fix crash when upgrading from original campaign stats file to current
*
* Revision 2.68 2005/02/16 10:00:13 wmcoolmon
* "-ingame" command line option
*
* Revision 2.67 2005/01/30 12:50:08 taylor
* merge with Linux/OSX tree - p0130
*
* Revision 2.66 2005/01/29 16:30:46 phreak
* smart shield command line stuff. this will be changed in the future, but i want people to test it.
* -phreak
*
* Revision 2.65 2005/01/21 08:29:04 taylor
* add -rlm cmdline option to switch to local viewpoint lighting calculations (OGL only for now)
*
* Revision 2.64 2004/12/24 19:36:12 Goober5000
* resorted command-line options and added an option for WMC's ballistic gauge
* --Goober5000
*
* Revision 2.63 2004/11/23 19:29:13 taylor
* fix 2d warp in D3D, add cmdline option for 3d warp
*
* Revision 2.62 2004/09/10 13:51:20 et1
* Command line option for TBP for warp stuff, "-tbpwarpeffects"
*
* Revision 2.61 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.60 2004/08/02 22:40:59 phreak
* added -orbradar to enable orb rendering for the radar
*
* Revision 2.59 2004/08/01 02:31:18 phreak
* -phreak command line changed to -dualscanlines
*
* Revision 2.58 2004/07/25 18:46:28 Kazan
* -fred_no_warn has become -no_warn and applies to both fred and fs2
* added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
* fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
* made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
*
* Revision 2.57 2004/07/05 05:09:15 bobboau
* FVF code, only the data that is needed is sent off to the card,,
* OGL can take advantage of this if they want but it won't break
* anything if they don't. also state block code has been implemented,
* that's totaly internal to D3D no high level code is involved.
*
* Revision 2.56 2004/06/19 22:15:48 wmcoolmon
* Added -nomotion debris command line option; also re-ordered categories.
*
* Revision 2.55 2004/06/06 12:25:19 randomtiger
* Added new compression option -pcx32dds, build posted in RSB forum.
* Changed flag because of launcher bug, have fixed launcher bug, will distribute later.
* Also removed experimental flag from launcher flag list, stupid people were reporting bugs on unfinished code.
*
* Revision 2.54 2004/04/26 18:23:47 Kazan
* -no_fps_capping
*
* Revision 2.53 2004/04/26 00:23:26 taylor
* novbo and snd_preload cmdline options, fix moddir getting appended space
*
* Revision 2.52 2004/04/18 19:39:12 randomtiger
* Added -2d_poof command which allows access to 2D poof rendering
* Added -radar_reduce to launcher flag description structure
*
* Revision 2.51 2004/04/03 18:11:20 Kazan
* FRED fixes
*
* Revision 2.50 2004/03/20 14:47:12 randomtiger
* Added base for a general dynamic batching solution.
* Fixed NO_DSHOW_CODE code path bug.
*
* Revision 2.49 2004/03/19 14:51:54 randomtiger
* New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system.
*
* Revision 2.48 2004/03/19 11:44:04 randomtiger
* Removed -d3d_notmanaged param.
* Tided D3D texture code. Merged remaining section code into the rest of the system.
* Prepared for removal of code causing waste of memory for secondry store of textures.
*
* Revision 2.47 2004/02/27 04:09:55 bobboau
* fixed a Z buffer error in HTL submodel rendering,
* and glow points,
* and other stuff
*
* Revision 2.46 2004/02/16 11:47:31 randomtiger
* Removed a lot of files that we dont need anymore.
* Changed htl to be on by default, command now -nohtl
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
*
* Revision 2.45 2004/01/29 01:34:00 randomtiger
* Added malloc montoring system, use -show_mem_usage, debug exes only to get an ingame list of heap usage.
* Also added -d3d_notmanaged flag to activate non managed D3D path, in experimental stage.
*
* Revision 2.44 2004/01/24 14:31:27 randomtiger
* Added the D3D particle code, its not bugfree but works perfectly on my card and helps with the framerate.
* Its optional and off by default, use -d3d_particle to activiate.
* Also bumped up D3D ambient light setting, it was way too dark.
* Its now set to something similar to the original game.
*
* Revision 2.43 2003/12/08 22:30:02 randomtiger
* Put render state and other direct D3D calls repetition check back in, provides speed boost.
* Fixed bug that caused fullscreen only crash with DXT textures
* Put dithering back in for tgas and jpgs
*
* Revision 2.42 2003/12/04 20:39:09 randomtiger
* Added DDS image support for D3D
* Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
* Hopefully have fixed D3D text batching bug that caused old values to appear
* Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
* Fixed jump nodes not showing
*
* Revision 2.41 2003/12/03 19:27:00 randomtiger
* Changed -t32 flag to -jpgtga
* Added -query_flag to identify builds with speech not compiled and other problems
* Now loads up launcher if videocard reg entry not found
* Now offers to go online to download launcher if its not present
* Changed target view not to use lower res texture, hi res one is already chached so might as well use it
*
* Revision 2.40 2003/11/29 10:52:09 randomtiger
* Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
* Added stats command for ingame stats on memory usage.
* Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
* Added fix for fonts wrapping round in non standard hi res modes.
* Changed D3D mipmapping to a good value to suit htl mode.
* Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
*
* Revision 2.39 2003/11/19 20:37:23 randomtiger
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
* Made some commandline variables fit the naming standard.
* Changed timerbar system not to run pushes and pops if its not in use.
* Put in a note about not uncommenting asserts.
* Fixed up a lot of missing POP's on early returns?
* Perhaps the motivation for Assert functionality getting commented out?
* Fixed up some bad asserts.
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
* Put in a special check for the signs of that D3D init bug I need to lock down.
*
* Revision 2.38 2003/11/15 18:09:33 randomtiger
* Put TGA and JPG stuff on -t32 flag
* Put 32 bit PCX stuff on -pcx32 (still has bugs)
* Added multisample checking on device initialisation
* Changed unrecognised parameter message (as requested) to be more user friendly
* Speech now chooses voice based on reg value set by launcher v3.1
*
* Revision 2.37 2003/11/09 06:31:38 Kazan
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
* conflicts in cmdline and timerbar.h log entries
* cvs stopped acting like it was on crack obviously
*
* Revision 2.36 2003/11/09 04:09:18 Goober5000
* edited for language
* --Goober5000
*
* Revision 2.35 2003/11/08 22:25:47 Kazan
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
*
* Revision 2.34 2003/11/03 18:07:26 randomtiger
* Added -d3d_no_vsync command to make turning off vsync optional.
* Removed 32bit command, it doesnt do anything.
* Made aa multisample reg check safe.
*
* Revision 2.33 2003/10/27 23:04:20 randomtiger
* Added -no_set_gamma flags
* Fixed up some more non standard res stuff
* Improved selection of device type, this includes using a pure device when allowed which means dev should not use Get* functions in D3D
* Made fade in credits work
* Stopped a call to gr_reser_lighting() in non htl mode when the pointer was NULL, was causing a crash loading a fogged level
* Deleted directx8 directory content, has never been needed.
*
* Revision 2.32 2003/10/24 17:35:04 randomtiger
* Implemented support for 32bit TGA and JPG for D3D
* Also 32 bit PCX, but it still has some bugs to be worked out
* Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
*
* Revision 2.31 2003/10/17 17:18:42 randomtiger
* Big restructure for D3D and new modules grd3dlight and grd3dsetup
*
* Revision 2.30 2003/10/12 03:41:37 Kazan
* #Kazan# FS2NetD client code gone multithreaded, some Fred2 Open -mod stuff [obvious code.lib] including a change in cmdline.cpp, changed Stick's "-nohtl" to "-htl" - HTL is _OFF_ by default here (Bobboau and I decided this was a better idea for now)
*
* Revision 2.29 2003/09/25 21:12:22 Kazan
* ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
* Also D3D8 Screenshots work now.
*
* Revision 2.28 2003/09/23 02:42:52 Kazan
* ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able]
*
* Revision 2.27 2003/09/14 19:00:02 wmcoolmon
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
*
* Revision 2.26 2003/09/14 18:32:24 wmcoolmon
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
*
* Revision 2.25 2003/09/13 06:02:05 Goober5000
* clean rollback of all of argv's stuff
* --Goober5000
*
* Revision 2.23 2003/08/22 07:35:08 bobboau
* specular code should be bugless now,
* cell shadeing has been added activated via the comand line '-cell',
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
*
* Revision 2.22 2003/08/21 20:54:37 randomtiger
* Fixed switching - RT
*
* Revision 2.21 2003/08/12 03:18:33 bobboau
* Specular 'shine' mapping;
* useing a phong lighting model I have made specular highlights
* that are mapped to the model,
* rendering them is still slow, but they look real purdy
*
* also 4 new (untested) comand lines, the XX is a floating point value
* -spec_exp XX
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
* -spec_point XX
* -spec_static XX
* -spec_tube XX
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
* static is the local stars,
* point is weapons/explosions/warp in/outs,
* tube is beam weapons,
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
*
* Revision 2.20 2003/08/09 06:07:23 bobboau
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
*
* Revision 2.19 2003/03/29 09:42:05 Goober5000
* made beams default shield piercing again
* also added a beam no pierce command line flag
* and fixed something else which I forgot :P
* --Goober5000
*
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
*
* Revision 2.16 2002/12/21 13:39:25 DTP
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
*
* Revision 2.15 2002/12/17 03:08:18 DTP
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
*
* Revision 2.14 2002/12/17 02:22:34 DTP
* wrong name :)
*
* Revision 2.13 2002/12/17 02:21:06 DTP
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
*
* Revision 2.12 2002/11/10 16:30:53 DTP
* -DTP reworked mod support,
*
* Revision 2.11 2002/10/31 21:14:16 DTP
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
*
* Revision 2.10 2002/10/30 20:22:30 inquisitor
* Bad Committ, Rolling back
*
* Revision 2.7 2002/10/22 23:02:39 randomtiger
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
*
* Revision 2.6 2002/10/19 03:50:28 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.5 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.3.2.4 2002/11/10 11:32:29 randomtiger
*
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
* When on is now less blury. - RT
*
* Revision 2.3.2.3 2002/11/04 23:53:24 randomtiger
*
* Added new command line parameter -d3dlauncher which brings up the launcher.
* This is needed since FS2 DX8 now stores the last successful details in the registry and
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
*
* Revision 2.3.2.2 2002/11/04 21:24:59 randomtiger
*
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
* Cleaned up some more texture stuff enabled console debug for D3D.
*
* Revision 2.3.2.1 2002/08/27 13:19:02 penguin
* Moved to directx8 branch
*
* Revision 2.4 2002/08/18 19:48:28 randomtiger
* Added new lib files: strmiids and ddraw to get dshow working
* Added new command line parameter to active direct show movie play: -dshowvid
* Uncommented movie_play calls and includes
*
* Revision 2.3 2002/08/07 00:44:13 DTP
* Implented -GF4FIX commandline switch
*
* Revision 2.2 2002/07/29 06:35:15 DTP
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/08 17:29:17 mharris
* more port tweaks
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 8 8/26/99 8:51p Dave
* Gave multiplayer TvT messaging a heavy dose of sanity. Cheat codes.
*
* 7 7/15/99 3:07p Dave
* 32 bit detection support. Mouse coord commandline.
*
* 6 7/13/99 1:15p Dave
* 32 bit support. Whee!
*
* 5 6/22/99 9:37p Dave
* Put in pof spewing.
*
* 4 1/12/99 5:45p Dave
* Moved weapon pipeline in multiplayer to almost exclusively client side.
* Very good results. Bandwidth goes down, playability goes up for crappy
* connections. Fixed object update problem for ship subsystems.
*
* 3 11/17/98 11:12a Dave
* Removed player identification by address. Now assign explicit id #'s.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 27 9/15/98 4:04p Allender
* added back in the -ip_addr command line switch because it needs to be
* in the standalone server only executable
*
* 26 9/14/98 11:28a Allender
* support for server bashing of address when received from client. Added
* a cmdline.cfg file to process command line arguments from a file
*
* 25 9/08/98 2:20p Allender
* temporary code to force IP address to a specific value.
*
* 24 8/20/98 5:30p Dave
* Put in handy multiplayer logfile system. Now need to put in useful
* applications of it all over the code.
*
* 23 8/07/98 10:40a Allender
* new command line flags for starting netgames. Only starting currently
* works, and PXO isn't implemented yet
*
* 22 7/24/98 11:14a Allender
* start of new command line options for version 1.04
*
* 21 5/21/98 1:50a Dave
* Remove obsolete command line functions. Reduce shield explosion packets
* drastically. Tweak PXO screen even more. Fix file xfer system so that
* we can guarantee file uniqueness.
*
* 20 5/18/98 9:10p Dave
* Put in many new PXO features. Fixed skill level bashing in multiplayer.
* Removed several old command line options. Put in network config files.
*
* 19 5/09/98 7:16p Dave
* Put in CD checking. Put in standalone host password. Made pilot into
* popup scrollable.
*
* 18 4/23/98 8:27p Allender
* basic support for cutscene playback. Into movie code in place. Tech
* room can view cutscenes stored in CDROM_dir variable
*
* 17 3/14/98 2:48p Dave
* Cleaned up observer joining code. Put in support for file xfers to
* ingame joiners (observers or not). Revamped and reinstalled pseudo
* lag/loss system.
*
* 16 1/31/98 4:32p Dave
* Put in new support for VMT player validation, game logging in and game
* logging out.
*
* 15 12/10/97 4:45p Dave
* Added in more detailed support for multiplayer packet lag/loss. Fixed
* some multiplayer stuff. Added some controls to the standalone.
*
* 14 12/09/97 6:14p Lawrance
* add -nomusic flag
*
* 13 11/28/97 7:04p Dave
* Emergency checkin due to big system crash.
*
* 12 11/28/97 5:06p Dave
* Put in facilities for simulating multiplayer lag.
*
* 11 11/24/97 5:42p Dave
* Fixed a file xfer buffer free/malloc problem. Lengthened command line
* switch string parse length.
*
* 10 11/12/97 4:39p Dave
* Put in multiplayer campaign support parsing, loading and saving. Made
* command-line variables better named. Changed some things on the initial
* pilot select screen.
*
* 9 11/11/97 4:54p Dave
* Put in support for single vs. multiplayer pilots. Put in initial player
* selection screen (no command line option yet). Started work on
* multiplayer campaign file save gaming.
*
* 8 9/18/97 10:13p Dave
* Added -gimmemedals, which gives the current pilot all the medals in the
* game (debug)
*
* 7 9/18/97 9:20a Dave
* Minor modifications
*
* 6 9/15/97 11:40p Lawrance
* remove demo granularity switch
*
* 5 9/03/97 5:03p Lawrance
* add support for -nosound command line parm
*
* 4 8/21/97 4:55p Dave
* Added a switch for multiplayer chat streaming. Added a section for
* global command line vars.
*
* 3 8/06/97 2:26p Dave
* Made the command line parse more robust. Made it easier to add and
* process new command-line switches.
*
* 2 8/04/97 3:13p Dave
* Added command line functions. See cmdline.cpp for directions on adding
* new switches
*
* 1 8/04/97 9:58a Dave
*
* $NoKeywords: $
*/
#ifndef FS_CMDLINE_HEADER_FILE
#define FS_CMDLINE_HEADER_FILE
#ifdef _WIN32
int parse_cmdline(char *cmdline);
#else
int parse_cmdline(int argc, char *argv[]);
#endif
int fred2_parse_cmdline(int argc, char *argv[]);
// COMMAND LINE SETTINGS
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
//
// Add any extern definitions here and put the actual variables inside of cmdline.cpp for ease of use
// Also, check to make sure anything you add doesn't break Fred or TestCode
extern int Cmdline_multi_stream_chat_to_file;
extern int Cmdline_freespace_no_sound;
extern int Cmdline_freespace_no_music;
extern int Cmdline_gimme_all_medals;
extern int Cmdline_use_last_pilot;
extern int Cmdline_cd_check;
extern int Cmdline_start_netgame;
extern int Cmdline_closed_game;
extern int Cmdline_restricted_game;
extern int Cmdline_network_port;
extern char *Cmdline_game_name;
extern char *Cmdline_game_password;
extern char *Cmdline_rank_above;
extern char *Cmdline_rank_below;
extern char *Cmdline_connect_addr;
extern int Cmdline_multi_log;
extern int Cmdline_server_firing;
extern int Cmdline_client_dodamage;
extern int Cmdline_spew_pof_info;
extern int Cmdline_mouse_coords;
extern int Cmdline_timeout;
extern int Cmdline_SpewMission_CRCs;
extern int Cmdline_SpewTable_CRCs;
extern int Cmdline_window;
extern char *Cmdline_almission; //DTP for autoload mission
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
extern int Cmdline_allslev;
extern int Cmdline_dualscanlines;
extern int Cmdline_dnoshowvid; //WMC Toggles movie playing support
extern int Cmdline_noscalevid; // disables fit-to-window for movies - taylor
extern char *Cmdline_mod; //DTP for mod support
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
extern int Cmdline_show_stats;
extern int Cmdline_safeloading;
extern int Cmdline_nospec;
extern int Cmdline_orb_radar;
extern int Cmdline_TBPWarpEffects; // TBP warp effects -Et1
extern int Cmdline_cache_ani;
extern int Cmdline_d3dmipmap;
extern int Cmdline_beams_no_pierce_shields; // Goober5000
extern float Cmdline_fov;
extern float static_light_factor;
extern float static_tube_factor;
extern float static_point_factor;
extern double specular_exponent_value;
extern int Cmdline_cell;
extern int Cmdline_nohtl;
extern int Cmdline_dxt;
extern int Cmdline_jpgtga;
extern int Cmdline_no_set_gamma;
extern int Cmdline_d3d_no_vsync;
extern int Cmdline_pcx32;
extern int Cmdline_pcx32dds;
extern int Cmdline_nomotiondebris;
extern int Cmdline_rlm;
extern int Cmdline_noibx;
#ifdef SCP_UNIX
extern int Cmdline_no_grab;
#endif
extern int Cmdline_noglow;
extern int Cmdline_timerbar;
extern int Cmdline_query_speech;
extern int Cmdline_ship_choice_3d;
extern int Cmdline_d3d_particle;
extern int Cmdline_ambient_factor;
extern int Cmdline_show_mem_usage;
extern int Cmdline_rt;
extern int Cmdline_ingamejoin;
extern char *Cmdline_start_mission;
extern int Cmdline_d3d_lesstmem;
extern int Cmdline_batch_3dunlit;
extern int Cmdline_2d_poof;
extern int Cmdline_3dwarp;
extern int Cmdline_FRED2_htl;
extern int CmdLine_NoWarn;
extern int Cmdline_novbo;
extern int Cmdline_snd_preload;
extern int Cmdline_NoFPSCap;
extern float Cmdline_max_subdivide;
extern int Cmdline_alpha_env;
extern int Cmdline_env;
extern int Cmdline_decals;
extern int Cmdline_ballistic_gauge;
extern int Cmdline_smart_shields;
extern int Cmdline_tga16;
extern int Cmdline_wcsaga;
//extern char FreeSpace_Directory[]; // allievating a cfilesystem problem caused by fred -- Kazan
#endif
-488
View File
@@ -1,488 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
* $Revision: 2.6 $
* $Date: 2005-04-05 05:53:15 $
* $Author: taylor $
*
* Counter measures. Created by Mike Kulas, May 12, 1997.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2004/07/26 20:47:25 Kazan
* remove MCD complete
*
* Revision 2.4 2004/07/12 16:32:43 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.3 2004/03/05 09:01:57 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 5 9/05/99 11:25p Mikek
* Debug code (only on NDEBUG). Don't drop countermeasures if
* Ai_firing_enabled not set.
*
* 4 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 3 10/13/98 9:28a Dave
* Started neatening up freespace.h. Many variables renamed and
* reorganized. Added AlphaColors.[h,cpp]
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 44 4/29/98 9:36p Allender
* ingame join tweaks. added network message for countermeasures
*
* 43 4/13/98 5:11p Mike
* More improvement to countermeasure code.
*
* 42 4/13/98 2:14p Mike
* Countermeasure balance testing for Jim.
*
* 41 4/10/98 11:02p Mike
* Make countermeasures less effective against aspect seekers than against
* heat seekers.
* Make AI ships match bank with each other when attacking a faraway
* target.
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
* target.
*
* 40 3/31/98 5:11p John
* Removed demo/save/restore. Made NDEBUG defined compile. Removed a
* bunch of debug stuff out of player file. Made model code be able to
* unload models and malloc out only however many models are needed.
*
* 39 3/17/98 3:49p John
* Turned off lighting on counter measures.
*
* 38 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 37 2/23/98 5:44p Johnson
* Resolve build error.
*
* 36 2/23/98 4:30p Mike
* Make homing missiles detonate after they pass up their target. Make
* countermeasures less effective.
*
* 35 2/09/98 8:04p Lawrance
* Add objnum to cmeasure struct, correctly set source_objnum
*
* 34 2/05/98 11:20p Lawrance
* save/restore countermeasure data
*
* 33 2/05/98 12:51a Mike
* Early asteroid stuff.
*
* 32 2/04/98 12:20p Mike
* Make countermeasures detonate in a smaller radius. Make all in radius,
* not just homing one, detonate.
*
* 31 1/29/98 11:48a John
* Added new counter measure rendering as model code. Made weapons be
* able to have impact explosion.
*
* 30 1/29/98 11:11a John
* Put in code to show dummy counter measure object.
*
* 29 1/23/98 5:06p John
* Took L out of vertex structure used B (blue) instead. Took all small
* fireballs out of fireball types and used particles instead. Fixed some
* debris explosion things. Restructured fireball code. Restructured
* some lighting code. Made dynamic lighting on by default. Made groups
* of lasers only cast one light. Made fireballs not cast light.
*
* 28 1/23/98 9:43a Mike
* Debug-C to disallow countermeasure firing.
* Fix bug in countermeasure tracking by aspect seekers.
*
* 27 1/20/98 9:47a Mike
* Suppress optimized compiler warnings.
* Some secondary weapon work.
*
* 26 1/16/98 11:43a Mike
* Fix countermeasures.
*
* 25 12/30/97 6:44p John
* Made g3_Draw_bitmap functions account for aspect of bitmap.
*
* 24 11/29/97 2:05p John
* made g3_draw_bitmap and g3_draw_rotated bitmap take w&h, not w/2 & h/2,
* like they used to incorrectly assume. Added code to model to read in
* thruster radius's.
*
* 23 10/27/97 3:24p Lawrance
* ensure countermeasures keep their initial velocity
*
* 22 9/14/97 4:50p Lawrance
* added some demo debugging code
*
* 21 9/04/97 5:09p Andsager
* implement physics using moment of inertia and mass (from BSPgen).
* Added to phys_info struct. Updated ship_info, polymodel structs.
* Updated weapon ($Mass and $Force) and ship ($Mass -> $Density) tables
*
* 20 8/20/97 11:09a Mike
* Make countermeasure lifetime based on skill level.
*
* 19 8/13/97 9:50p Allender
* split *_move into *_process_pre and *_process_post functions.
* process_pre functions called before object is moved. _process_post
* functions called after object is moved. Reordered code in ship_post
* and weapon_post for multiplayer
*
* 18 8/13/97 4:45p Allender
* fixed ship_fire_primary and fire_secondary to not take parameter for
* determining whether to count ammo or not. Fixed countermeasure firing
* for multiplayer
*
* 17 8/13/97 12:06p Lawrance
* supporting multiple types of fireball explosions
*
* 16 8/11/97 6:03p Mike
* Make ships with no shields not claim to have shields in target box.
*
* 15 8/08/97 4:29p Allender
* countermeasure stuff for multiplayer
*
* 14 7/31/97 5:55p John
* made so you pass flags to obj_create.
* Added new collision code that ignores any pairs that will never
* collide.
*
* 13 7/15/97 12:03p Andsager
* New physics stuff
*
* 12 7/11/97 11:54a John
* added rotated 3d bitmaps.
*
* 11 6/24/97 10:04a Allender
* major multiplayer improvements. Better sequencing before game.
* Dealing with weapon/fireball/counter measure objects between
* client/host.
*
* 10 6/24/97 12:38a Lawrance
* fix minor bug with cycling cmeasure
*
* 9 6/05/97 1:37a Lawrance
* change syntax of a snd_play()
*
* 8 5/22/97 5:45p Mike
* Better countermeasure firing, key off availability, specify in
* weapons.tbl
*
* 7 5/22/97 12:06p Lawrance
* include Sound.h for playing sound fx
*
* 6 5/22/97 12:04p Lawrance
* added soundhook for cmeasure cycle
*
* 5 5/15/97 5:05p Mike
* In the midst of changing subsystem targetnig from type-based to
* pointer-based.
* Also allowed you to view a target while dead.
*
* 4 5/14/97 4:08p Lawrance
* removing my_index from game arrays
*
* 3 5/14/97 10:50a Mike
* More countermeasure stuff.
*
* 2 5/12/97 5:58p Mike
* Add countermeasures.
*
* 1 5/12/97 2:23p Mike
*
* $NoKeywords: $
*/
#include "globalincs/systemvars.h"
#include "cmeasure/cmeasure.h"
#include "freespace2/freespace.h"
#include "model/model.h"
#include "ship/ship.h"
#include "math/staticrand.h"
#include "object/object.h"
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
cmeasure Cmeasures[MAX_CMEASURES];
int Num_cmeasure_types = 0;
int Num_cmeasures = 0;
int Cmeasure_inited = 0;
int Cmeasures_homing_check = 0;
int Countermeasures_enabled = 1; // Debug, set to 0 means no one can fire countermeasures.
// This will get called at the start of each level.
void cmeasure_init()
{
int i;
if ( !Cmeasure_inited )
Cmeasure_inited = 1;
// Reset everything between levels
Num_cmeasures = 0;
for (i=0; i<MAX_CMEASURES; i++ ) {
Cmeasures[i].subtype = CMEASURE_UNUSED;
}
}
void cmeasure_render(object * objp)
{
// JAS TODO: Replace with proper fireball
cmeasure *cmp;
cmeasure_info *cmip;
cmp = &Cmeasures[objp->instance];
cmip = &Cmeasure_info[cmp->subtype];
if ( cmp->subtype == CMEASURE_UNUSED ) {
Int3(); // Hey, what are we doing in here?
return;
}
// float size = -1.0f;
// vertex p;
// g3_rotate_vertex(&p, &objp->pos );
// if ( rand() > RAND_MAX/2 ) {
// gr_set_color( 255, 0, 0 );
// } else {
// gr_set_color( 255, 255, 255 );
// }
// g3_draw_sphere(&p, 100.0f );
if ( cmip->model_num > -1 ) {
model_clear_instance(cmip->model_num);
model_render(cmip->model_num, &objp->orient, &objp->pos, MR_NO_LIGHTING );
} else {
mprintf(( "Not rendering countermeasure because model_num is negative\n" ));
}
/*
// JAS TODO: Replace with proper fireball
int framenum = -1;
float size = -1.0f;
vertex p;
cmeasure *cmp;
fireball_data *fd;
cmp = &Cmeasures[objp->instance];
fd = &Fireball_data[FIREBALL_SHIP_EXPLODE1];
switch (cmp->subtype) {
case CMEASURE_UNUSED:
Int3(); // Hey, what are we doing in here?
break;
default:
framenum = (int) (fd->num_frames * Cmeasures[objp->instance].lifeleft*4) % fd->num_frames;
size = objp->radius;
break;
}
Assert(framenum != -1);
Assert(size != -1.0f);
gr_set_bitmap(fd->bitmap_id + framenum);
g3_rotate_vertex(&p, &objp->pos );
g3_draw_bitmap(&p, 0, size*0.5f, TMAP_FLAG_TEXTURED );
*/
}
void cmeasure_delete( object * objp )
{
int num;
num = objp->instance;
// Assert( Cmeasures[num].objnum == OBJ_INDEX(objp));
Cmeasures[num].subtype = CMEASURE_UNUSED;
Num_cmeasures--;
Assert( Num_cmeasures >= 0 );
}
// broke cmeasure_move into two functions -- process_pre and process_post (as was done with
// all *_move functions). Nothing to do for process_pre
void cmeasure_process_pre( object *objp, float frame_time)
{
}
void cmeasure_process_post(object * objp, float frame_time)
{
int num;
num = objp->instance;
// Assert( Cmeasures[num].objnum == objnum );
cmeasure *cmp = &Cmeasures[num];
if ( cmp->lifeleft >= 0.0f) {
cmp->lifeleft -= frame_time;
if ( cmp->lifeleft < 0.0f ) {
objp->flags |= OF_SHOULD_BE_DEAD;
// demo_do_flag_dead(OBJ_INDEX(objp));
}
}
}
float Skill_level_cmeasure_life_scale[NUM_SKILL_LEVELS] = {3.0f, 2.0f, 1.5f, 1.25f, 1.0f};
// creates one countermeasure. A ship fires 1 of these per launch. rand_val is used
// in multiplayer. If -1, then create a random number. If non-negative, use this
// number for static_rand functions
int cmeasure_create( object * source_obj, vec3d * pos, int cm_type, int rand_val )
{
int n, objnum, parent_objnum, arand;
object * obj;
ship *shipp;
cmeasure *cmp;
cmeasure_info *cmeasurep;
#ifndef NDEBUG
if (!Countermeasures_enabled || !Ai_firing_enabled)
return -1;
#endif
Cmeasures_homing_check = 2; // Tell homing code to scan everything for two frames. If only one frame, get sync problems due to objects being created at end of frame!
parent_objnum = OBJ_INDEX(source_obj);
Assert( source_obj->type == OBJ_SHIP );
Assert( source_obj->instance >= 0 && source_obj->instance < MAX_SHIPS );
shipp = &Ships[source_obj->instance];
if ( Num_cmeasures >= MAX_CMEASURES)
return -1;
for (n=0; n<MAX_CMEASURES; n++ )
if ( Cmeasures[n].subtype == CMEASURE_UNUSED)
break;
if ( n == MAX_CMEASURES)
return -1;
nprintf(("Network", "Cmeasure created by %s\n", Ships[source_obj->instance].ship_name));
cmp = &Cmeasures[n];
cmeasurep = &Cmeasure_info[cm_type];
if ( pos == NULL )
pos = &source_obj->pos;
objnum = obj_create( OBJ_CMEASURE, parent_objnum, n, &source_obj->orient, pos, 1.0f, OF_RENDERS | OF_PHYSICS );
Assert( objnum >= 0 && objnum < MAX_OBJECTS );
// Create Debris piece n!
if ( rand_val == -1 )
arand = myrand(); // use a random number to get lifeleft, and random vector for displacement from ship
else
arand = rand_val;
cmp->lifeleft = static_randf(arand) * (cmeasurep->life_max - cmeasurep->life_min) / cmeasurep->life_min;
if (source_obj->flags & OF_PLAYER_SHIP){
cmp->lifeleft *= Skill_level_cmeasure_life_scale[Game_skill_level];
}
cmp->lifeleft = cmeasurep->life_min + cmp->lifeleft * (cmeasurep->life_max - cmeasurep->life_min);
// cmp->objnum = objnum;
cmp->team = shipp->team;
cmp->subtype = cm_type;
cmp->objnum = objnum;
cmp->source_objnum = parent_objnum;
cmp->source_sig = Objects[objnum].signature;
cmp->flags = 0;
nprintf(("Jim", "Frame %i: Launching countermeasure #%i\n", Framecount, Objects[objnum].signature));
obj = &Objects[objnum];
Num_cmeasures++;
vec3d vel, rand_vec;
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
static_randvec(arand+1, &rand_vec);
vm_vec_scale_add2(&vel, &rand_vec, 2.0f);
obj->phys_info.vel = vel;
vm_vec_zero(&obj->phys_info.rotvel);
// blow out his reverse thrusters. Or drag, same thing.
obj->phys_info.rotdamp = 10000.0f;
obj->phys_info.side_slip_time_const = 10000.0f;
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
obj->phys_info.max_vel.xyz.z = -25.0f;
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.vec.fvec, obj->phys_info.max_vel.xyz.z );
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
// obj->phys_info.flags |= PF_USE_VEL;
return arand; // need to return this value for multiplayer purposes
}
void cmeasure_select_next(object *objp)
{
ship *shipp;
Assert(objp->type == OBJ_SHIP);
shipp = &Ships[objp->instance];
shipp->current_cmeasure++;
if (shipp->current_cmeasure >= Num_cmeasure_types)
shipp->current_cmeasure = 0;
//snd_play( &Snds[SND_CMEASURE_CYCLE] );
mprintf(("Countermeasure type set to %i in frame %i\n", shipp->current_cmeasure, Framecount));
}
-188
View File
@@ -1,188 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
* $Revision: 2.5 $
* $Date: 2005-07-13 02:50:50 $
* $Author: Goober5000 $
*
* Counter measures. Created by Mike Kulas, May 12, 1997.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/04/05 05:53:15 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.3 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.2 2004/03/05 09:01:57 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 20 4/11/98 5:17p Jim
* Reduced countermeasure firing rate from 2 times per second to 3 times
* per second.
*
* 19 4/10/98 11:02p Mike
* Make countermeasures less effective against aspect seekers than against
* heat seekers.
* Make AI ships match bank with each other when attacking a faraway
* target.
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
* target.
*
* 18 4/01/98 5:34p John
* Made only the used POFs page in for a level. Reduced some interp
* arrays. Made custom detail level work differently.
*
* 17 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 16 2/23/98 4:30p Mike
* Make homing missiles detonate after they pass up their target. Make
* countermeasures less effective.
*
* 15 2/09/98 8:04p Lawrance
* Add objnum to cmeasure struct, correctly set source_objnum
*
* 14 2/05/98 11:20p Lawrance
* save/restore countermeasure data
*
* 13 1/29/98 11:48a John
* Added new counter measure rendering as model code. Made weapons be
* able to have impact explosion.
*
* 12 1/16/98 11:43a Mike
* Fix countermeasures.
*
* 11 8/13/97 9:50p Allender
* split *_move into *_process_pre and *_process_post functions.
* process_pre functions called before object is moved. _process_post
* functions called after object is moved. Reordered code in ship_post
* and weapon_post for multiplayer
*
* 10 8/13/97 4:45p Allender
* fixed ship_fire_primary and fire_secondary to not take parameter for
* determining whether to count ammo or not. Fixed countermeasure firing
* for multiplayer
*
* 9 8/08/97 4:29p Allender
* countermeasure stuff for multiplayer
*
* 8 7/09/97 12:04a Mike
* Error prevention in matrix_interpolate().
*
* 7 6/24/97 10:04a Allender
* major multiplayer improvements. Better sequencing before game.
* Dealing with weapon/fireball/counter measure objects between
* client/host.
*
* 6 5/22/97 5:45p Mike
* Better countermeasure firing, key off availability, specify in
* weapons.tbl
*
* 5 5/15/97 5:05p Mike
* In the midst of changing subsystem targetnig from type-based to
* pointer-based.
* Also allowed you to view a target while dead.
*
* 4 5/14/97 4:08p Lawrance
* removing my_index from game arrays
*
* 3 5/14/97 10:50a Mike
* More countermeasure stuff.
*
* 2 5/12/97 5:58p Mike
* Add countermeasures.
*
* 1 5/12/97 2:23p Mike
*
* $NoKeywords: $
*/
#ifndef _CMEASURE_H
#define _CMEASURE_H
#include "globalincs/globals.h"
struct object;
struct vec3d;
#define MAX_CMEASURES 64
// Goes in cmeasure.subtype
#define CMEASURE_UNUSED -1
#define MAX_CMEASURE_TYPES 3
#define CMEASURE_WAIT 333 // delay in milliseconds between countermeasure firing.
#define CMF_DUD_HEAT 0x01 // If set, this cmeasure is a dud to heat seekers. Set at create time.
#define CMF_DUD_ASPECT 0x02 // If set, this cmeasure is a dud to aspect seekers. Set at create time.
#define CMF_DUD (CMF_DUD_HEAT | CMF_DUD_ASPECT)
// Maximum distance at which a countermeasure can be tracked
// If this value is too large, missiles will always be tracking countermeasures.
#define MAX_CMEASURE_TRACK_DIST 300.0f
typedef struct cmeasure_info {
char cmeasure_name[NAME_LENGTH];
float max_speed; // launch speed, relative to ship
float fire_wait; // time between launches
float life_min, life_max; // lifetime will be in range min..max.
int launch_sound; // Sound played when launched.
char pof_name[NAME_LENGTH];
int model_num; // What this renders as
} cmeasure_info;
typedef struct cmeasure {
int flags; // You know, flag type things.
int subtype; // See CMEASURE_??? defines
int objnum;
int source_objnum; // What object this came from
int source_sig; // Signature of the source object
int team; // Team of the ship where the cmeasure came from
float lifeleft; // When 0 or less object dies
} cmeasure;
extern cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
extern cmeasure Cmeasures[MAX_CMEASURES];
extern int Num_cmeasure_types;
extern int Num_cmeasures;
extern int Cmeasures_homing_check;
extern void cmeasure_init();
extern void cmeasure_render( object * obj );
extern void cmeasure_delete( object * obj );
extern void cmeasure_process_pre( object * obj, float frame_time);
extern void cmeasure_process_post( object * obj, float frame_time);
extern int cmeasure_create( object * source_obj, vec3d *pos, int cm_type, int rand_val = -1 );
extern void cmeasure_select_next(object *objp);
#endif // _CMEASURE_H
File diff suppressed because it is too large. Load diff
@@ -1,548 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 2.13 $
* $Date: 2005-07-13 02:50:50 $
* $Author: Goober5000 $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.12 2005/07/13 02:30:52 Goober5000
* removed autopilot #define
* --Goober5000
*
* Revision 2.11 2005/03/03 06:05:27 wmcoolmon
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
*
* Revision 2.10 2005/01/16 22:39:08 wmcoolmon
* Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use.
*
* Revision 2.9 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.8 2004/07/25 00:31:28 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 2.7 2004/05/03 21:22:19 Kazan
* Abandon strdup() usage for mod list processing - it was acting odd and causing crashing on free()
* Fix condition where alt_tab_pause() would flipout and trigger failed assert if game minimizes during startup (like it does a lot during debug)
* Nav Point / Auto Pilot code (All disabled via #ifdefs)
*
* Revision 2.6 2004/04/06 03:09:01 phreak
* added a control config option for the wireframe hud targetbox i enabled ages ago
*
* Revision 2.5 2003/11/11 02:15:43 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --Goober5000
*
* Revision 2.4 2002/12/02 23:52:02 Goober5000
* fixed misspelling
*
* Revision 2.3 2002/12/02 20:47:28 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.2 2002/10/19 19:29:27 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.1 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 6 8/22/99 5:53p Dave
* Scoring fixes. Added self destruct key. Put callsigns in the logfile
* instead of ship designations for multiplayer players.
*
* 5 8/19/99 10:59a Dave
* Packet loss detection.
*
* 4 8/01/99 12:39p Dave
* Added HUD contrast control key (for nebula).
*
* 3 11/05/98 4:18p Dave
* First run nebula support. Beefed up localization a bit. Removed all
* conditional compiles for foreign versions. Modified mission file
* format.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 26 6/13/98 5:19p Hoffoss
* externalized control config texts.
*
* 25 5/15/98 8:37p Lawrance
* Add 'equalize recharge rates' and 'target ship that sent last
* transmission' key bindings
*
* 24 5/14/98 5:32p Hoffoss
* Improved axis binding code some more.
*
* 23 5/13/98 7:15p Hoffoss
* Fixed remaining bugs with axis binding.
*
* 22 5/13/98 1:17a Hoffoss
* Added joystick axes configurability.
*
* 21 4/30/98 9:43p Hoffoss
* Added new actions for free look movement which are default bounded to
* the hat.
*
* 20 4/25/98 1:59p Lawrance
* fix merge typo
*
* 19 4/25/98 1:24p Lawrance
* Add time compression keys to key config
*
* 18 4/25/98 12:43p Allender
* added new shortcut key for attack my subsystem
*
* 17 4/18/98 5:00p Dave
* Put in observer zoom key. Made mission sync screen more informative.
*
* 16 4/10/98 12:47p Allender
* changed working on replay popup. Don't reference repair in comm menu.
* Added Shift-R for repair me
*
* 15 4/08/98 11:11a Hoffoss
* Fixed some bugs that showed up due to fixing other bugs the other day
* with controls.
*
* 14 3/31/98 4:15p Hoffoss
* Disabled the show objectives action.
*
* 13 3/23/98 12:27p Hoffoss
* Whoops, changed order in list but forget to actually change the number.
*
* 12 3/23/98 11:35a Hoffoss
* Fixed #defines that were out of sync.
*
* 11 3/19/98 5:04p Dave
* Put in support for targeted multiplayer text and voice messaging (all,
* friendly, hostile, individual).
*
* 10 3/11/98 5:28p Hoffoss
* Added control config debug display info to possibly aid in tracking
* down a bug.
*
* 9 2/28/98 7:02p Lawrance
* overhaul on-line help
*
* 8 2/26/98 12:33a Lawrance
* Added back slew mode, lots of changes to external and chase views.
*
* 7 2/02/98 6:59p Lawrance
* Adding new targeting keys (bomb, uninspected cargo, new ship, live
* turrets).
*
* 6 1/30/98 10:40a Lawrance
* remove any binding references to hotkey screen
*
* 5 1/28/98 6:19p Dave
* Reduced standalone memory usage ~8 megs. Put in support for handling
* multiplayer submenu handling for endgame, etc.
*
* 4 1/22/98 4:53p Hoffoss
* Made training messages/directives display a joystick button in place of
* a keypress if there is no keypress bound to the action.
*
* 3 1/02/98 4:42p Allender
* removed unused key bindings from control config list
*
* 2 12/30/97 4:47p Allender
* work with ignore my target command. Added new keyboard hotkey. Made
* it work globally
*
* 1 12/24/97 11:59a Hoffoss
*
* 41 11/24/97 10:20p Lawrance
* Add key 'KEY_N' to target next ship on monitoring view
*
* 40 11/21/97 5:57p Hoffoss
* Fixed bug where timef type controls weren't checking joystick buttons.
*
* 39 11/20/97 1:08a Lawrance
* add support for 'R' key - target closest friendly repair ship
*
* 38 11/17/97 6:40p Lawrance
* Changed 'I' key to toggle of extended target info, moved target closest
* locked missile to 'L'
*
* 37 11/02/97 1:15p Hoffoss
* Externed an array I need elsewhere.
*
* 36 10/28/97 12:12a Lawrance
* remove unused keys (Alt-H and Alt-F)
*
* 35 10/24/97 11:00p Hoffoss
* Controls config screen much improved.
*
* 34 10/22/97 4:50p Hoffoss
* Disabled throttle by default.
*
* 33 10/21/97 7:05p Hoffoss
* Overhauled the key/joystick control structure and usage throughout the
* entire FreeSpace code. The whole system is very different now.
*
* 32 10/18/97 7:19p Hoffoss
* Added timestamp recording when a key is pressed.
*
* 31 9/14/97 10:24p Lawrance
* add damage screen popup window
*
* 30 9/10/97 6:02p Hoffoss
* Added code to check for key-pressed sexp operator in FreeSpace as part
* of training mission stuff.
*
* 29 9/09/97 9:18a Hoffoss
* Added message token translation (phase 1) to FreeSpace for training
* missions support.
*
* 28 8/31/97 6:38p Lawrance
* pass in frametime to do_frame loop
*
* 27 8/29/97 5:02p Sandeep
* fixed joystick support for shield config
*
* 26 8/25/97 12:24a Lawrance
* added keys for shield management
*
* 25 8/22/97 10:44p Sandeep
* Added Configurable support for energy management keys, keyboard and
* joystick
*
* 24 8/21/97 5:03p Sandeep
* Fixed joystick functions past "Target Closest Hostile Targeting Self"
* bug.
*
* 23 8/20/97 4:22p Sandeep
* Add support for joystick mapping to all keyboard configurable commands.
* Changed pilot file to allow support for new joystick, incompatible
* version 33
*
* 22 8/07/97 11:27p Lawrance
* add support for 4th joystick axis (rudder), add new option to roll ship
*
* 21 7/08/97 11:37a Lawrance
* add joystick support for afterburners
*
* 20 7/01/97 11:52a Lawrance
* add targeting key, allow player to clear all bindings
*
* 19 6/24/97 12:38a Lawrance
* added in some new joystick bindings
*
* 18 6/17/97 8:57p Lawrance
* added target previous hostile/friendly
*
* 17 6/03/97 1:39a Allender
* made macros for joystick button id's
*
* 16 5/28/97 9:53a Lawrance
* move goals keys and squadmate message key from function keys to
* assignable keys
*
* 15 5/26/97 5:49p Lawrance
* supporting max range on radar
*
* 14 5/26/97 3:31p Lawrance
* assign key bindings for view modes and view controls
*
* 13 5/14/97 10:50a Mike
* More countermeasure stuff.
*
* 12 4/24/97 2:40p Lawrance
* add key for targeting closest ship attacking self
*
* 11 4/05/97 3:46p Allender
* lots 'o messaging stuff. Make shortcut keys for squadmate messaging
* work. Make menus a little more dynamic
*
* 10 4/01/97 7:50p Lawrance
* added many new keys, don't allow Shft or Alt as action keys, only allow
* Ctrl as an action key
*
* 9 3/10/97 8:30a Lawrance
* changed -/+ 5% throttle keys to 1/3 2/3 throttle keys
*
* 8 12/18/96 6:09p Lawrance
* allowing shift+alt+ctrl modifiers on keyboard bindings
*
* 7 12/18/96 10:18a Lawrance
* integrating joystick axis configuration
*
* 6 12/17/96 11:10a Lawrance
* added targeting of subsystem in reticle
*
* 5 12/06/96 12:27a Lawrance
* adding support for joystick configuration
*
* 4 12/05/96 2:47p Lawrance
* changed how keyboard configuration was done to make code more easily
* changeable
*
* 3 12/03/96 10:11p Lawrance
* Integrating keyboard configuration
*
* 2 12/03/96 3:45p Lawrance
*
* $NoKeywords: $
*
*/
#ifndef CONTROLS_CONFIG_H
#define CONTROLS_CONFIG_H
#define CONTROL_CONFIG_XSTR 507
#define JOY_X_AXIS 0
#define JOY_Y_AXIS 1
#define JOY_Z_AXIS 2
#define JOY_RX_AXIS 3
#define JOY_RY_AXIS 4
#define JOY_RZ_AXIS 5
#define NUM_JOY_AXIS_ACTIONS 5
#define JOY_HEADING_AXIS 0
#define JOY_PITCH_AXIS 1
#define JOY_BANK_AXIS 2
#define JOY_ABS_THROTTLE_AXIS 3
#define JOY_REL_THROTTLE_AXIS 4
// --------------------------------------------------
// different types of controls that can be assigned
// --------------------------------------------------
#define CC_TYPE_TRIGGER 0
#define CC_TYPE_CONTINUOUS 1
typedef struct config_item {
short key_default; // default key bound to action
short joy_default; // default joystick button bound to action
char tab; // what tab (category) it belongs in
bool hasXSTR; // whether we should translate this with an XSTR
char *text; // describes the action in the config screen
char type; // manner control should be checked in
short key_id; // actual key bound to action
short joy_id; // joystick button bound to action
int used; // has control been used yet in mission? If so, this is the timestamp
} config_item;
// --------------------------------------------------
// Keyboard #defines for the actions
// This is the value of the id field in config_item
// --------------------------------------------------
// targeting a ship
#define TARGET_NEXT 0
#define TARGET_PREV 1
#define TARGET_NEXT_CLOSEST_HOSTILE 2
#define TARGET_PREV_CLOSEST_HOSTILE 3
#define TOGGLE_AUTO_TARGETING 4
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
#define TARGET_PREV_CLOSEST_FRIENDLY 6
#define TARGET_SHIP_IN_RETICLE 7
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
#define TARGET_LAST_TRANMISSION_SENDER 9
#define STOP_TARGETING_SHIP 10
// targeting a ship's subsystem
#define TARGET_SUBOBJECT_IN_RETICLE 11
#define TARGET_NEXT_SUBOBJECT 12
#define TARGET_PREV_SUBOBJECT 13
#define STOP_TARGETING_SUBSYSTEM 14
// speed matching
#define MATCH_TARGET_SPEED 15
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
// weapons
#define FIRE_PRIMARY 17
#define FIRE_SECONDARY 18
#define CYCLE_NEXT_PRIMARY 19
#define CYCLE_PREV_PRIMARY 20
#define CYCLE_SECONDARY 21
#define CYCLE_NUM_MISSLES 22
#define LAUNCH_COUNTERMEASURE 23
// controls
#define FORWARD_THRUST 24
#define REVERSE_THRUST 25
#define BANK_LEFT 26
#define BANK_RIGHT 27
#define PITCH_FORWARD 28
#define PITCH_BACK 29
#define YAW_LEFT 30
#define YAW_RIGHT 31
// throttle control
#define ZERO_THROTTLE 32
#define MAX_THROTTLE 33
#define ONE_THIRD_THROTTLE 34
#define TWO_THIRDS_THROTTLE 35
#define PLUS_5_PERCENT_THROTTLE 36
#define MINUS_5_PERCENT_THROTTLE 37
// squadmate messaging keys
#define ATTACK_MESSAGE 38
#define DISARM_MESSAGE 39
#define DISABLE_MESSAGE 40
#define ATTACK_SUBSYSTEM_MESSAGE 41
#define CAPTURE_MESSAGE 42
#define ENGAGE_MESSAGE 43
#define FORM_MESSAGE 44
#define IGNORE_MESSAGE 45
#define PROTECT_MESSAGE 46
#define COVER_MESSAGE 47
#define WARP_MESSAGE 48
#define REARM_MESSAGE 49
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
// Views
#define VIEW_CHASE 51
#define VIEW_EXTERNAL 52
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
#define VIEW_SLEW 54
#define VIEW_OTHER_SHIP 55
#define VIEW_DIST_INCREASE 56
#define VIEW_DIST_DECREASE 57
#define VIEW_CENTER 58
#define PADLOCK_UP 59
#define PADLOCK_DOWN 60
#define PADLOCK_LEFT 61
#define PADLOCK_RIGHT 62
#define RADAR_RANGE_CYCLE 63
#define SQUADMSG_MENU 64
#define SHOW_GOALS 65
#define END_MISSION 66
#define TARGET_TARGETS_TARGET 67
#define AFTERBURNER 68
#define INCREASE_WEAPON 69
#define DECREASE_WEAPON 70
#define INCREASE_SHIELD 71
#define DECREASE_SHIELD 72
#define INCREASE_ENGINE 73
#define DECREASE_ENGINE 74
#define ETS_EQUALIZE 75
#define SHIELD_EQUALIZE 76
#define SHIELD_XFER_TOP 77
#define SHIELD_XFER_BOTTOM 78
#define SHIELD_XFER_LEFT 79
#define SHIELD_XFER_RIGHT 80
#define XFER_SHIELD 81
#define XFER_LASER 82
#define SHOW_DAMAGE_POPUP 83 // AL: this binding should be removing next time the controls are reorganized
#define BANK_WHEN_PRESSED 84
#define SHOW_NAVMAP 85
#define ADD_REMOVE_ESCORT 86
#define ESCORT_CLEAR 87
#define TARGET_NEXT_ESCORT_SHIP 88
#define TARGET_CLOSEST_REPAIR_SHIP 89
#define TARGET_NEXT_UNINSPECTED_CARGO 90
#define TARGET_PREV_UNINSPECTED_CARGO 91
#define TARGET_NEWEST_SHIP 92
#define TARGET_NEXT_LIVE_TURRET 93
#define TARGET_PREV_LIVE_TURRET 94
#define TARGET_NEXT_BOMB 95
#define TARGET_PREV_BOMB 96
// multiplayer messaging keys
#define MULTI_MESSAGE_ALL 97
#define MULTI_MESSAGE_FRIENDLY 98
#define MULTI_MESSAGE_HOSTILE 99
#define MULTI_MESSAGE_TARGET 100
// multiplayer misc keys
#define MULTI_OBSERVER_ZOOM_TO 101
#define TIME_SPEED_UP 102
#define TIME_SLOW_DOWN 103
#define TOGGLE_HUD_CONTRAST 104
#define MULTI_TOGGLE_NETINFO 105
#define MULTI_SELF_DESTRUCT 106
#define TOGGLE_HUD 107
#define RIGHT_SLIDE_THRUST 108
#define LEFT_SLIDE_THRUST 109
#define UP_SLIDE_THRUST 110
#define DOWN_SLIDE_THRUST 111
#define HUD_TARGETBOX_TOGGLE_WIREFRAME 112
#define VIEW_TOPDOWN 113
#define VIEW_TRACK_TARGET 114
//AutoPilot - Kazan
#define AUTO_PILOT_TOGGLE 115
#define NAV_CYCLE 116
// this should be the total number of control action defines above (or last define + 1)
#define CCFG_MAX 117
extern int Failed_key_index;
extern int Invert_heading;
extern int Invert_pitch;
extern int Invert_roll;
extern int Invert_thrust;
extern int Disable_axis2;
extern int Disable_axis3;
extern int Axis_map_to[];
extern int Invert_axis[];
extern int Invert_axis_defaults[];
extern config_item Control_config[]; // stores the keyboard configuration
extern char **Scan_code_text;
extern char **Joy_button_text;
// initialize common control config stuff - call at game startup after localization has been initialized
void control_config_common_init();
void control_config_init();
void control_config_do_frame(float frametime);
void control_config_close();
void control_config_cancel_exit();
void control_config_reset_defaults();
int translate_key_to_index(char *key);
char *translate_key(char *key);
char *textify_scancode(int code);
float check_control_timef(int id);
int check_control(int id, int key = -1);
void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr);
void control_used(int id);
void control_config_clear();
void clear_key_binding(short key);
void control_check_indicate();
void control_config_clear_used_status();
#endif
@@ -1,923 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 2.12 $
* $Date: 2005-07-13 02:30:52 $
* $Author: Goober5000 $
*
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
*
* $Log: not supported by cvs2svn $
* Revision 2.11 2005/03/03 06:05:27 wmcoolmon
* Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure"
*
* Revision 2.10 2005/01/16 22:39:08 wmcoolmon
* Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use.
*
* Revision 2.9 2004/07/26 20:47:26 Kazan
* remove MCD complete
*
* Revision 2.8 2004/07/25 00:31:28 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 2.7 2004/07/12 16:32:43 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.6 2004/05/03 21:22:19 Kazan
* Abandon strdup() usage for mod list processing - it was acting odd and causing crashing on free()
* Fix condition where alt_tab_pause() would flipout and trigger failed assert if game minimizes during startup (like it does a lot during debug)
* Nav Point / Auto Pilot code (All disabled via #ifdefs)
*
* Revision 2.5 2004/04/06 03:09:01 phreak
* added a control config option for the wireframe hud targetbox i enabled ages ago
*
* Revision 2.4 2003/11/11 02:15:43 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --Goober5000
*
* Revision 2.3 2002/10/19 19:29:27 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam shield hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry
*
* Revision 2.2 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 14 11/01/99 3:36p Jefff
* had scan code texts for y and z in german swapped
*
* 13 11/01/99 2:16p Jefff
* minor key name change in german
*
* 12 10/29/99 6:10p Jefff
* squashed the y/z german issues once and for all
*
* 11 10/28/99 11:16p Jefff
* Changed some german key names. Made key translations always use the
* english table.
*
* 10 10/28/99 2:05a Jefff
* revised some german key names. changed some y/z switch stuff.
*
* 9 10/25/99 5:39p Jefff
* swap init binding for y and z keys in German builds
*
* 8 9/01/99 2:56p Jefff
* a few control key description changes
*
* 7 8/22/99 5:53p Dave
* Scoring fixes. Added self destruct key. Put callsigns in the logfile
* instead of ship designations for multiplayer players.
*
* 6 8/19/99 10:59a Dave
* Packet loss detection.
*
* 5 8/01/99 12:39p Dave
* Added HUD contrast control key (for nebula).
*
* 4 7/23/99 2:57p Andsager
* fix translate_key_to_index to work with localization
*
* 3 11/05/98 4:18p Dave
* First run nebula support. Beefed up localization a bit. Removed all
* conditional compiles for foreign versions. Modified mission file
* format.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 41 6/19/98 3:51p Lawrance
* localize control text
*
* 40 6/17/98 11:05a Lawrance
* localize the control config strings
*
* 39 5/24/98 2:28p Hoffoss
* Because we never really care about if the left or the right shift or
* alt key was used, but rather than either shift or alt was used, made
* both map to the left one. Solves some problems, causes none.
*
* 38 5/22/98 11:21a Hoffoss
* Added bank when pressed back in.
*
* 37 5/15/98 8:37p Lawrance
* Add 'equalize recharge rates' and 'target ship that sent last
* transmission' key bindings
*
* 36 5/13/98 7:15p Hoffoss
* Fixed remaining bugs with axis binding.
*
* 35 5/13/98 1:17a Hoffoss
* Added joystick axes configurability.
*
* 34 5/12/98 11:25a Hoffoss
* Disabled bank when pressed action.
*
* 33 5/09/98 10:48p Lawrance
* change text for view bindings
*
* 32 5/09/98 4:52p Lawrance
* Implement padlock view (up/rear/left/right)
*
* 31 4/30/98 9:43p Hoffoss
* Added new actions for free look movement which are default bounded to
* the hat.
*
* 30 4/25/98 1:25p Lawrance
* Add time compression keys to key config
*
* 29 4/25/98 12:43p Allender
* added new shortcut key for attack my subsystem
*
* 28 4/18/98 5:00p Dave
* Put in observer zoom key. Made mission sync screen more informative.
*
* 27 4/17/98 1:24a Lawrance
* fix spelling error
*
* 26 4/15/98 11:06a Lawrance
* fix bug with a multi key showing up in demo, remove obsolete bindings
* from demo and full version
*
* 25 4/10/98 12:47p Allender
* changed working on replay popup. Don't reference repair in comm menu.
* Added Shift-R for repair me
*
* 24 4/08/98 11:11a Hoffoss
* Fixed some bugs that showed up due to fixing other bugs the other day
* with controls.
*
* 23 4/07/98 4:06p Lawrance
* Change binding next for bomb targeting
*
* 22 4/07/98 1:52p Lawrance
* fix error in binding text for energy keys
*
* 21 4/06/98 11:17a Hoffoss
* Fixed num lock/pause interplay bug.
*
* 20 4/01/98 6:46p Lawrance
* change text for Alt+J
*
* 19 3/31/98 4:15p Hoffoss
* Disabled the show objectives action.
*
* 18 3/25/98 2:16p Dave
* Select random default image for newly created pilots. Fixed several
* multi-pause messaging bugs. Begin work on online help for multiplayer
* keys.
*
* 17 3/19/98 5:04p Dave
* Put in support for targeted multiplayer text and voice messaging (all,
* friendly, hostile, individual).
*
* 16 3/17/98 11:25a Hoffoss
* Fixed some of the action's names.
*
* 15 3/17/98 10:48a Hoffoss
* Allowed a special hack for "bank while pressed" action to use alt and
* shift keys standalone.
*
* 14 2/28/98 9:47p Lawrance
* change some binding text
*
* 13 2/28/98 7:02p Lawrance
* overhaul on-line help
*
* 12 2/26/98 12:33a Lawrance
* Added back slew mode, lots of changes to external and chase views.
*
* 11 2/23/98 11:25a Sandeep
* added default keys
*
* 10 2/22/98 6:27p Lawrance
* External mode takes precedence over chase mode. Fix bug with repair
* ships docking in chase mode.
*
* 9 2/22/98 12:19p John
* Externalized some strings
*
* 8 2/02/98 6:59p Lawrance
* Adding new targeting keys (bomb, uninspected cargo, new ship, live
* turrets).
*
* 7 1/27/98 4:24p Allender
* moved hotkey selection to F3 instead of X. Made palette flash
* disappear in multiplayer pause menu
*
* 6 1/22/98 4:53p Hoffoss
* Made training messages/directives display a joystick button in place of
* a keypress if there is no keypress bound to the action.
*
* 5 1/22/98 4:15p Hoffoss
* Added code to allow popup to tell player he needs to bind a key for the
* training mission.
*
* 4 1/02/98 4:42p Allender
* removed unused key bindings from control config list
*
* 3 12/30/97 4:47p Allender
* work with ignore my target command. Added new keyboard hotkey. Made
* it work globally
*
* 2 12/24/97 3:37p Hoffoss
* Moved control config stuff to seperate library to Fred can access it as
* well.
*
* 1 12/24/97 3:27p Hoffoss
*
* 1 12/24/97 11:58a Hoffoss
*
* 98 12/22/97 2:15p Hoffoss
* Fixed bug where joystick axis lines weren't being displayed.
*
* 97 12/16/97 2:44p Hoffoss
* Added clear button to control config screen.
*
* 96 12/12/97 3:07p Hoffoss
* Changed how deleting bindings work. Each control of an action can be
* deleted independently or both at once.
*
* 95 12/07/97 2:36p John
* Made warp out be Alt+J instead of J
*
* 94 12/03/97 4:59p Hoffoss
* Added reset sound and change control config sounds around.
*
* 93 12/03/97 4:16p Hoffoss
* Changed sound stuff used in interface screens for interface purposes.
*
* 92 12/01/97 5:25p Hoffoss
* Routed interface sound playing through a special function that will
* only allow one instance of the sound to play at a time, avoiding
* over-mixing problems.
*
* 91 12/01/97 3:38p Hoffoss
* Changed placement of 'More' indicator.
*
* 90 11/25/97 3:49p Hoffoss
* Changed subhilighting to happen when mouse is over line, rather than
* mouse button down but not up again yet.
*
* 89 11/24/97 10:20p Lawrance
* Add key 'KEY_N' to target next ship on monitoring view
*
* 88 11/24/97 6:15p Lawrance
* fix button scroll problem
*
* 87 11/23/97 6:15p Hoffoss
* Make exiting the controls config screen save the pilot, so changes keep
* even if programs crashes or something.
*
* 86 11/21/97 5:57p Hoffoss
* Fixed bug where timef type controls weren't checking joystick buttons.
*
* 85 11/21/97 4:06p Hoffoss
* Fixed bug with enabling of axis are reversed.
*
* 84 11/20/97 4:47p Hoffoss
* Swapped throttle and rudder, which apparently were backwards.
*
* 83 11/20/97 4:00p Lawrance
* set z to a valid value
*
* 82 11/20/97 3:52p Hoffoss
* Made "None" appear if no control is bound to function.
*
* 81 11/20/97 2:10p Hoffoss
* Added defaults for joystick buttons 2 and 3.
*
* 80 11/20/97 1:08a Lawrance
* add support for 'R' key - target closest friendly repair ship
*
* 79 11/19/97 8:33p Hoffoss
* New controls config screen baby!
*
* 78 11/17/97 7:09p Hoffoss
* Made chase view control a trigger type.
*
* 77 11/17/97 6:40p Lawrance
* Changed 'I' key to toggle of extended target info, moved target closest
* locked missile to 'L'
*
* 76 11/17/97 3:26p Jasen
* Adjusted coordinates for the help button .ani location
*
* 75 11/16/97 3:51p Hoffoss
* Added more button to config screen when scrolling allowed.
*
* 74 11/16/97 3:20p Hoffoss
* Added various suggestions from the Todolist.
*
* 73 11/14/97 4:33p Mike
* Change Debug key to backquote (from F11).
* Balance a ton of subsystems in ships.tbl.
* Change "Heavy Laser" to "Disruptor".
*
* 72 11/12/97 2:54p Hoffoss
* Made modifiers non-stand alone, added support for red tabs on
* conflicts.
*
* 71 10/30/97 6:01p Hoffoss
* Changed screen to utilize the new text color standards.
*
* 70 10/29/97 7:25p Hoffoss
* Added crude support for UI button double click checking.
*
* 69 10/29/97 6:32p Hoffoss
* Changed some interface apperances.
*
* 68 10/29/97 4:54p Hoffoss
* Changed scan_code_text element for Enter to 'Enter' instead of 'a' with
* a caret over it (what's that all about?)
*
* 67 10/28/97 10:42a Hoffoss
* Fixed handling of continuous controls that have modifiers to the key.
*
* 66 10/28/97 10:03a Hoffoss
* Fixed bug with continuous type controls not registering if pressed and
* released too quickly. Also some other little changes.
*
* 65 10/28/97 12:12a Lawrance
* remove unused keys (Alt-H and Alt-F)
*
* 64 10/27/97 12:23p Hoffoss
* Improved warning system and fixed coloring bug.
*
* 63 10/27/97 11:39a Hoffoss
* Added control conflicts checking.
*
* 62 10/26/97 3:20p Hoffoss
* Added many missing features to control config screen.
*
* 61 10/25/97 5:41p Hoffoss
* More functionality added to the controls config screen.
*
* 60 10/24/97 11:00p Hoffoss
* Controls config screen much improved.
*
* 59 10/22/97 4:50p Hoffoss
* Disabled throttle by default.
*
* 58 10/22/97 11:00a Hoffoss
* Changed VIEW_SLEW and VIEW_EXTERNAL to be continuous rather than
* trigger actions.
*
* 57 10/21/97 7:05p Hoffoss
* Overhauled the key/joystick control structure and usage throughout the
* entire FreeSpace code. The whole system is very different now.
*
* 56 10/18/97 7:19p Hoffoss
* Added timestamp recording when a key is pressed.
*
* 55 10/13/97 4:33p Hoffoss
* Made training messages go away after time.
*
* 54 10/13/97 3:24p Hoffoss
* Made it so training message text can be arbitrarily bolded.
*
* 53 9/24/97 4:52p Hoffoss
* Changed training message key token handling, and implemented a new
* training message system method to test out for a while.
*
* 52 9/14/97 10:24p Lawrance
* add damage screen popup window
*
* 51 9/10/97 6:02p Hoffoss
* Added code to check for key-pressed sexp operator in FreeSpace as part
* of training mission stuff.
*
* 50 9/09/97 3:39p Sandeep
* warning level 4 bugs
* $NoKeywords: $
*
*/
#include "controlconfig/controlsconfig.h"
#include "io/key.h"
#include "io/joy.h"
#include "localization/localize.h"
#define TARGET_TAB 0
#define SHIP_TAB 1
#define WEAPON_TAB 2
#define COMPUTER_TAB 3
int Failed_key_index;
// assume control keys are used as modifiers until we find out
int Shift_is_modifier;
int Ctrl_is_modifier;
int Alt_is_modifier;
int Axis_enabled[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
int Axis_enabled_defaults[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
// arrays which hold the key mappings. The array index represents a key-independent action.
//
//XSTR:OFF
config_item Control_config[CCFG_MAX + 1] = {
// targeting a ship
{ KEY_T, -1, TARGET_TAB, true, "Target Next Ship" },
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, true, "Target Previous Ship" },
{ KEY_H, 2, TARGET_TAB, true, "Target Next Closest Hostile Ship" },
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, true, "Target Previous Closest Hostile Ship" },
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, true, "Toggle Auto Targeting" },
{ KEY_F, -1, TARGET_TAB, true, "Target Next Closest Friendly Ship" },
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, true, "Target Previous Closest Friendly Ship" },
{ KEY_Y, 4, TARGET_TAB, true, "Target Ship in Reticle" },
{ KEY_G, -1, TARGET_TAB, true, "Target Target's Nearest Attacker" },
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, true, "Target Last Ship to Send Transmission" },
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, true, "Turn Off Auto-Targeting" },
// targeting a ship's subsystem
{ KEY_V, -1, TARGET_TAB, true, "Target Subsystem in Reticle" },
{ KEY_S, -1, TARGET_TAB, true, "Target Next Subsystem" },
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, true, "Target Previous Subsystem" },
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, true, "Turn Off Auto-Targeting of Subsystems" },
// matching speed
{ KEY_M, -1, COMPUTER_TAB, true, "Match Target Speed" },
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching" },
// weapons
{ KEY_LCTRL, 0, WEAPON_TAB, true, "Fire Primary Weapon", CC_TYPE_CONTINUOUS },
{ KEY_SPACEBAR, 1, WEAPON_TAB, true, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS },
{ KEY_PERIOD, -1, WEAPON_TAB, true, "Cycle Forward Primary Weapon" },
{ KEY_COMMA, -1, WEAPON_TAB, true, "Cycle Backward Primary Weapon" },
{ KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Bank" },
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Firing Rate" },
{ KEY_X, 3, WEAPON_TAB, true, "Launch Countermeasure" },
// controls
{ KEY_A, -1, SHIP_TAB, true, "Forward Thrust", CC_TYPE_CONTINUOUS },
{ KEY_Z, -1, SHIP_TAB, true, "Reverse Thrust", CC_TYPE_CONTINUOUS },
{ KEY_PAD7, -1, SHIP_TAB, true, "Bank Left", CC_TYPE_CONTINUOUS },
{ KEY_PAD9, -1, SHIP_TAB, true, "Bank Right", CC_TYPE_CONTINUOUS },
{ KEY_PAD8, -1, SHIP_TAB, true, "Pitch Forward", CC_TYPE_CONTINUOUS },
{ KEY_PAD2, -1, SHIP_TAB, true, "Pitch Backward", CC_TYPE_CONTINUOUS },
{ KEY_PAD4, -1, SHIP_TAB, true, "Turn Left", CC_TYPE_CONTINUOUS },
{ KEY_PAD6, -1, SHIP_TAB, true, "Turn Right", CC_TYPE_CONTINUOUS },
// throttle controls
{ KEY_BACKSP, -1, SHIP_TAB, true, "Set Throttle to Zero" },
{ KEY_SLASH, -1, SHIP_TAB, true, "Set Throttle to Max" },
{ KEY_LBRACKET, -1, SHIP_TAB, true, "Set Throttle to One-Third" },
{ KEY_RBRACKET, -1, SHIP_TAB, true, "Set Throttle to Two-Thirds" },
{ KEY_EQUAL, -1, SHIP_TAB, true, "Increase Throttle 5 Percent" },
{ KEY_MINUS, -1, SHIP_TAB, true, "Decrease Throttle 5 Percent" },
// squadmate messaging
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, true, "Attack My Target" },
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, true, "Disarm My Target" },
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, true, "Disable My Target" },
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, true, "Attack my Subsystem" },
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, true, "Capture My Target" },
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Engage Enemy" },
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, true, "Form on my Wing" },
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, true, "Ignore my Target" },
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, true, "Protect my Target" },
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, true, "Cover me" },
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, true, "Return to base" },
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, true, "Rearm me" },
{ KEY_R, 6, TARGET_TAB, true, "Target Closest Attacking Ship" },
// Views
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, true, "Chase View" },
{ KEY_PADPERIOD, -1, COMPUTER_TAB, true, "External View"},
{ KEY_PADENTER, -1, COMPUTER_TAB, true, "Toggle External Camera Lock"},
{ KEY_PAD0, -1, COMPUTER_TAB, true, "Free Look View", CC_TYPE_CONTINUOUS },
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, true, "Current Target View" },
{ KEY_PADPLUS, -1, COMPUTER_TAB, true, "Increase View Distance", CC_TYPE_CONTINUOUS },
{ KEY_PADMINUS, -1, COMPUTER_TAB, true, "Decrease View Distance", CC_TYPE_CONTINUOUS },
{ KEY_PAD5, -1, COMPUTER_TAB, true, "Center View", CC_TYPE_CONTINUOUS },
{ -1, 33, COMPUTER_TAB, true, "View Up", CC_TYPE_CONTINUOUS },
{ -1, 32, COMPUTER_TAB, true, "View Rear", CC_TYPE_CONTINUOUS },
{ -1, 34, COMPUTER_TAB, true, "View Left", CC_TYPE_CONTINUOUS },
{ -1, 35, COMPUTER_TAB, true, "View Right", CC_TYPE_CONTINUOUS },
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, true, "Cycle Radar Range" },
{ KEY_C, -1, COMPUTER_TAB, true, "Communications Menu" },
{ -1, -1, -1, true, "Show Objectives" },
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, true, "Enter Subspace (End Mission)" },
{ KEY_J, -1, TARGET_TAB, true, "Target Target's Target" },
{ KEY_TAB, 5, SHIP_TAB, true, "Afterburner", CC_TYPE_CONTINUOUS },
{ KEY_INSERT, -1, COMPUTER_TAB, true, "Increase Weapon Energy" },
{ KEY_DELETE, -1, COMPUTER_TAB, true, "Decrease Weapon Energy" },
{ KEY_HOME, -1, COMPUTER_TAB, true, "Increase Shield Energy" },
{ KEY_END, -1, COMPUTER_TAB, true, "Decrease Shield Energy" },
{ KEY_PAGEUP, -1, COMPUTER_TAB, true, "Increase Engine Energy" },
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, true, "Decrease Engine Energy" },
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, true, "Equalize Energy Settings" },
{ KEY_Q, 7, COMPUTER_TAB, true, "Equalize Shield" },
{ KEY_UP, -1, COMPUTER_TAB, true, "Augment Forward Shield" },
{ KEY_DOWN, -1, COMPUTER_TAB, true, "Augment Rear Shield" },
{ KEY_LEFT, -1, COMPUTER_TAB, true, "Augment Left Shield" },
{ KEY_RIGHT, -1, COMPUTER_TAB, true, "Augment Right Shield" },
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Laser->Shield" },
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Shield->Laser" },
{ -1, -1, -1, true, "Show Damage Popup Window" },
{ -1, -1, SHIP_TAB, true, "Bank When Pressed", CC_TYPE_CONTINUOUS },
{ -1, -1, -1, true, "Show NavMap" },
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, true, "Add or Remove Escort" },
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Clear Escort List" },
{ KEY_E, -1, TARGET_TAB, true, "Target Next Escort Ship" },
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, true, "Target Closest Repair Ship" },
{ KEY_U, -1, TARGET_TAB, true, "Target Next Uninspected Cargo" },
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, true, "Target Previous Uninspected Cargo" },
{ KEY_N, -1, TARGET_TAB, true, "Target Newest Ship In Area" },
{ KEY_K, -1, TARGET_TAB, true, "Target Next Live Turret" },
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, true, "Target Previous Live Turret" },
{ KEY_B, -1, TARGET_TAB, true, "Target Next Hostile Bomb or Bomber" },
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber" },
// multiplayer messaging keys
{ KEY_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All", CC_TYPE_CONTINUOUS },
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS },
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS },
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS },
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, true, "(Multiplayer) Observer zoom to target"},
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, true, "Increase time compression" },
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, true, "Decrease time compression" },
{ KEY_L, -1, COMPUTER_TAB, true, "Toggle high HUD contrast" },
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, true, "(Multiplayer) Toggle network info"},
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, true, "(Multiplayer) Self destruct"},
// Misc
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, true, "Toggle HUD"},
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, true, "Right Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, true, "Left Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, true, "Up Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, true, "Down Thrust", CC_TYPE_CONTINUOUS},
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, true, "Toggle HUD Wireframe Targetbox"},
{ -1, -1, COMPUTER_TAB, false, "Top-down View"},
{ -1, -1, COMPUTER_TAB, false, "Track targeted object", CC_TYPE_CONTINUOUS},
// Auto Navigation Systen
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot"},
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points"},
{ -1, -1, -1, false, "" }
};
char *Scan_code_text_german[] = {
"", "Esc", "1", "2", "3", "4", "5", "6",
"7", "8", "9", "0", "Akzent '", "\xE1", "R\x81""cktaste", "Tab",
"Q", "W", "E", "R", "T", "Z", "U", "I",
"O", "P", "\x9A", "+", "Eingabe", "Strg Links", "A", "S",
"D", "F", "G", "H", "J", "K", "L", "\x99",
"\xAE", "`", "Shift", "#", "Y", "X", "C", "V",
"B", "N", "M", ",", ".", "-", "Shift", "Num *",
"Alt", "Leertaste", "Hochstell", "F1", "F2", "F3", "F4", "F5",
"F6", "F7", "F8", "F9", "F10", "Pause", "Rollen", "Num 7",
"Num 8", "Num 9", "Num -", "Num 4", "Num 5", "Num 6", "Num +", "Num 1",
"Num 2", "Num 3", "Num 0", "Num ,", "", "", "", "F11",
"F12", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "Num Eingabe", "Strg Rechts", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "Num /", "", "Druck",
"Alt", "", "", "", "", "", "", "",
"", "", "", "", "", "Num Lock", "", "Pos 1",
"Pfeil Hoch", "Bild Hoch", "", "Pfeil Links", "", "Pfeil Rechts", "", "Ende",
"Pfeil Runter", "Bild Runter", "Einfg", "Entf", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
};
char *Joy_button_text_german[] = {
"Knopf 1", "Knopf 2", "Knopf 3", "Knopf 4", "Knopf 5", "Knopf 6",
"Knopf 7", "Knopf 8", "Knopf 9", "Knopf 10", "Knopf 11", "Knopf 12",
"Knopf 13", "Knopf 14", "Knopf 15", "Knopf 16", "Knopf 17", "Knopf 18",
"Knopf 19", "Knopf 20", "Knopf 21", "Knopf 22", "Knopf 23", "Knopf 24",
"Knopf 25", "Knopf 26", "Knopf 27", "Knopf 28", "Knopf 29", "Knopf 30",
"Knopf 31", "Knopf 32", "Hut Hinten", "Hut Vorne", "Hut Links", "Hut Rechts"
};
char *Scan_code_text_french[] = {
"", "\x90""chap", "1", "2", "3", "4", "5", "6",
"7", "8", "9", "0", "-", "=", "Fl\x82""che Ret.", "Tab",
"Q", "W", "E", "R", "T", "Y", "U", "I",
"O", "P", "[", "]", "Entr\x82""e", "Ctrl Gauche", "A", "S",
"D", "F", "G", "H", "J", "K", "L", ";",
"'", "`", "Maj.", "\\", "Z", "X", "C", "V",
"B", "N", "M", ",", ".", "/", "Maj.", "Pav\x82 *",
"Alt", "Espace", "Verr. Maj.", "F1", "F2", "F3", "F4", "F5",
"F6", "F7", "F8", "F9", "F10", "Pause", "Arret defil", "Pav\x82 7",
"Pav\x82 8", "Pav\x82 9", "Pav\x82 -", "Pav\x82 4", "Pav\x82 5", "Pav\x82 6", "Pav\x82 +", "Pav\x82 1",
"Pav\x82 2", "Pav\x82 3", "Pav\x82 0", "Pav\x82 .", "", "", "", "F11",
"F12", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "Pav\x82 Entr", "Ctrl Droite", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "Pav\x82 /", "", "Impr \x82""cran",
"Alt", "", "", "", "", "", "", "",
"", "", "", "", "", "Verr num", "", "Orig.",
"Fl\x82""che Haut", "Page Haut", "", "Fl\x82""che Gauche", "", "Fl\x82""che Droite", "", "Fin",
"Fl\x82""che Bas", "Page Bas", "Inser", "Suppr", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
};
char *Joy_button_text_french[] = {
"Bouton 1", "Bouton 2", "Bouton 3", "Bouton 4", "Bouton 5", "Bouton 6",
"Bouton 7", "Bouton 8", "Bouton 9", "Bouton 10", "Bouton 11", "Bouton 12",
"Bouton 13", "Bouton 14", "Bouton 15", "Bouton 16", "Bouton 17", "Bouton 18",
"Bouton 19", "Bouton 20", "Bouton 21", "Bouton 22", "Bouton 23", "Bouton 24",
"Bouton 25", "Bouton 26", "Bouton 27", "Bouton 28", "Bouton 29", "Bouton 30",
"Bouton 31", "Bouton 32", "Chapeau Arrière", "Chapeau Avant", "Chapeau Gauche", "Chapeau Droite"
};
// This is the text that is displayed on the screen for the keys a player selects
char *Scan_code_text_english[] = {
"", "Esc", "1", "2", "3", "4", "5", "6",
"7", "8", "9", "0", "-", "=", "Backspace", "Tab",
"Q", "W", "E", "R", "T", "Y", "U", "I",
"O", "P", "[", "]", "Enter", "Left Ctrl", "A", "S",
"D", "F", "G", "H", "J", "K", "L", ";",
"'", "`", "Shift", "\\", "Z", "X", "C", "V",
"B", "N", "M", ",", ".", "/", "Shift", "Pad *",
"Alt", "Spacebar", "Caps Lock", "F1", "F2", "F3", "F4", "F5",
"F6", "F7", "F8", "F9", "F10", "Pause", "Scroll Lock", "Pad 7",
"Pad 8", "Pad 9", "Pad -", "Pad 4", "Pad 5", "Pad 6", "Pad +", "Pad 1",
"Pad 2", "Pad 3", "Pad 0", "Pad .", "", "", "", "F11",
"F12", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "Pad Enter", "Right Ctrl", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "Pad /", "", "Print Scrn",
"Alt", "", "", "", "", "", "", "",
"", "", "", "", "", "Num Lock", "", "Home",
"Up Arrow", "Page Up", "", "Left Arrow", "", "Right Arrow", "", "End",
"Down Arrow", "Page Down", "Insert", "Delete", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
"", "", "", "", "", "", "", "",
};
char *Joy_button_text_english[] = {
"Button 1", "Button 2", "Button 3", "Button 4", "Button 5", "Button 6",
"Button 7", "Button 8", "Button 9", "Button 10", "Button 11", "Button 12",
"Button 13", "Button 14", "Button 15", "Button 16", "Button 17", "Button 18",
"Button 19", "Button 20", "Button 21", "Button 22", "Button 23", "Button 24",
"Button 25", "Button 26", "Button 27", "Button 28", "Button 29", "Button 30",
"Button 31", "Button 32", "Hat Back", "Hat Forward", "Hat Left", "Hat Right"
};
char **Scan_code_text = Scan_code_text_english;
char **Joy_button_text = Joy_button_text_english;
void set_modifier_status()
{
int i;
Alt_is_modifier = 0;
Shift_is_modifier = 0;
Ctrl_is_modifier = 0;
for (i=0; i<CCFG_MAX; i++) {
if (Control_config[i].key_id < 0)
continue;
if (Control_config[i].key_id & KEY_ALTED)
Alt_is_modifier = 1;
if (Control_config[i].key_id & KEY_SHIFTED)
Shift_is_modifier = 1;
if (Control_config[i].key_id & KEY_CTRLED) {
Assert(0); // get Alan
Ctrl_is_modifier = 1;
}
}
}
int translate_key_to_index(char *key)
{
int i, index = -1, alt = 0, shift = 0, max_scan_codes;
if (Lcl_gr) {
max_scan_codes = sizeof(Scan_code_text_german) / sizeof(char *);
} else if (Lcl_fr) {
max_scan_codes = sizeof(Scan_code_text_french) / sizeof(char *);
} else {
max_scan_codes = sizeof(Scan_code_text_english) / sizeof(char *);
}
// look for modifiers
Assert(key);
if (!strnicmp(key, "Alt", 3)) {
alt = 1;
key += 3;
if (*key)
key++;
}
char *translated_shift;
if(Lcl_gr){
translated_shift = "Shift";
} else if(Lcl_fr){
translated_shift = "Maj.";
} else {
translated_shift = "Shift";
}
if (!strnicmp(key, translated_shift, 5)) {
shift = 1;
key += 5;
if (*key)
key++;
}
// look up index for default key
if (*key) {
for (i=0; i<max_scan_codes; i++)
if (!stricmp(key, Scan_code_text_english[i])) {
index = i;
break;
}
if (i == max_scan_codes)
return -1;
if (shift)
index |= KEY_SHIFTED;
if (alt)
index |= KEY_ALTED;
// convert scancode to Control_config index
for (i=0; i<CCFG_MAX; i++) {
if (Control_config[i].key_default == index) {
index = i;
break;
}
}
if (i == CCFG_MAX)
return -1;
return index;
}
return -1;
}
// Given the system default key 'key', return the current key that is bound to the function
// Both are 'key' and the return value are descriptive strings that can be displayed
// directly to the user. If 'key' isn't a real key or not normally bound to anything,
// or there is no key current bound to the function, NULL is returned.
char *translate_key(char *key)
{
int index = -1, code = -1;
index = translate_key_to_index(key);
if (index < 0)
return NULL;
code = Control_config[index].key_id;
Failed_key_index = index;
if (code < 0) {
code = Control_config[index].joy_id;
if (code >= 0)
return Joy_button_text[code];
}
return textify_scancode(code);
}
char *textify_scancode(int code)
{
static char text[40];
if (code < 0)
return "None";
*text = 0;
if (code & KEY_ALTED) {
if(Lcl_gr){
strcat(text, "Alt-");
} else if(Lcl_fr){
strcat(text, "Alt-");
} else {
strcat(text, "Alt-");
}
}
if (code & KEY_SHIFTED) {
if(Lcl_gr){
strcat(text, "Shift-");
} else if(Lcl_fr){
strcat(text, "Maj.-");
} else {
strcat(text, "Shift-");
}
}
strcat(text, Scan_code_text[code & KEY_MASK]);
return text;
}
//XSTR:ON
// initialize common control config stuff - call at game startup after localization has been initialized
void control_config_common_init()
{
if(Lcl_gr){
Scan_code_text = Scan_code_text_german;
Joy_button_text = Joy_button_text_german;
// swap init bindings for y and z keys
Control_config[TARGET_SHIP_IN_RETICLE].key_default = KEY_Z;
Control_config[TARGET_LAST_TRANMISSION_SENDER].key_default = KEY_ALTED | KEY_Z;
Control_config[REVERSE_THRUST].key_default = KEY_Y;
Control_config[DISARM_MESSAGE].key_default = KEY_SHIFTED | KEY_Y;
} else if(Lcl_fr){
Scan_code_text = Scan_code_text_french;
Joy_button_text = Joy_button_text_french;
} else {
Scan_code_text = Scan_code_text_english;
Joy_button_text = Joy_button_text_english;
}
}
-94
View File
@@ -1,94 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
* $Revision: 2.2 $
* $Date: 2005-09-08 00:09:32 $
* $Author: taylor $
*
* Applet for crypting strings.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/23/98 6:21p Dave
*
* $NoKeywords: $
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "globalincs/crypt.h"
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char **argv)
{
int i;
char *crypt_string;
if ( argc == 1 ) {
printf("Usage: cryptstring <string1> <string2> ...\n");
printf("Output will be <crypt1> <crypt2>\n");
exit(1);
}
for ( i = 1; i < argc; i++ ) {
char *s;
s = argv[i];
// if the length of the string is greater than the number of crypted symbols we
// return, then pass only the maximum length
if ( strlen(s) > CRYPT_STRING_LENGTH )
s += (strlen(s) - CRYPT_STRING_LENGTH);
crypt_string = jcrypt(s);
printf("%s\n", crypt_string);
}
return 0;
}
char *jcrypt (char *plainstring)
{
int i,t,len;
static char cryptstring[CRYPT_STRING_LENGTH + 1];
len=strlen (plainstring);
if (len > CRYPT_STRING_LENGTH)
len = CRYPT_STRING_LENGTH;
for (i = 0;i < len; i++) {
cryptstring[i]=0;
for (t = 0; t < len; t++) {
cryptstring[i]^=(plainstring[t] ^ plainstring[i%(t+1)]);
cryptstring[i]%=90;
cryptstring[i]+=33;
}
}
cryptstring[i]=0;
return ((char *)cryptstring);
}
-865
View File
@@ -1,865 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 2.17 $
* $Date: 2005-07-02 19:42:14 $
* $Author: taylor $
* $Revision: 2.17 $
* $Date: 2005-07-02 19:42:14 $
* $Author: taylor $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.16 2005/05/12 17:49:11 taylor
* use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
* fixes various problems and is past time to make the switch
*
* Revision 2.15 2005/02/23 04:51:55 taylor
* some bm_unload() -> bm_release() changes to save bmpman slots
*
* Revision 2.14 2005/01/31 23:27:51 taylor
* merge with Linux/OSX tree - p0131-2
*
* Revision 2.13 2004/07/26 20:47:26 Kazan
* remove MCD complete
*
* Revision 2.12 2004/07/12 16:32:43 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.11 2004/04/26 13:11:11 taylor
* mark view cutscenes ignoring extension and file case
*
* Revision 2.10 2004/03/05 09:01:58 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.9 2004/02/20 04:29:53 bobboau
* pluged memory leaks,
* 3D HTL lasers (they work perfictly)
* and posably fixed Turnsky's shinemap bug
*
* Revision 2.8 2004/01/24 15:52:25 randomtiger
* I have submitted the new movie playing code despite the fact in D3D it sometimes plays behind the main window.
* In OGL it works perfectly and in both API's it doesnt switch to the desktop anymore so hopefully people will not experience the crashes etc that the old system used to suffer from.
*
* Revision 2.7 2003/08/21 20:54:38 randomtiger
* Fixed switching - RT
*
* Revision 2.6 2003/07/15 02:58:08 phreak
* the cutscene section in the techroom does not append *.mve onto a filename
*
* Revision 2.5 2003/03/18 10:07:01 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.4 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.2.2.4 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.2.2.3 2002/08/28 21:47:02 randomtiger
* Tiny change to DX branch to keep movie code optional (default off)
*
* Revision 2.2.2.2 2002/08/28 12:39:35 randomtiger
* OK, this should be a commit to the DX branch or Im going to be in a lot of trouble.
* The movie and dx8show files have been cleaned up big time.
* My debug system is in but has NO EFFECT at all unless a compiler flag is turned on, check h file for details.
* Aside from that a few changes to help the movie code work properly.
* Works on most things including GF4 and Voodoo 3. However may not work properly on a voodoo 2.
* Im going to leave this as a bug for now, serves you right for buying voodoo!
*
* Revision 2.2.2.1 2002/08/27 13:19:26 penguin
* Moved to directx8 branch
*
* Revision 2.3 2002/08/18 19:48:29 randomtiger
* Added new lib files: strmiids and ddraw to get dshow working
* Added new command line parameter to active direct show movie play: -dshowvid
* Uncommented movie_play calls and includes
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.4 2002/05/16 00:39:47 mharris
* Added ifdef WIN32 around cd stuff
*
* Revision 1.3 2002/05/13 21:43:37 mharris
* A little more network and sound cleanup
*
* Revision 1.2 2002/05/07 02:57:33 mharris
* make Buttons[] static
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 15 6/16/00 3:15p Jefff
* sim of the year dvd version changes, a few german soty localization
* fixes
*
* 14 10/13/99 10:20a Jefff
* fixed bug where intro cutscene showed 2x after getting bad ending
*
* 13 10/06/99 10:30a Jefff
* OEM updates
*
* 12 9/30/99 6:01p Jefff
* OEM updates
*
* 11 9/07/99 1:10p Mikek
* Make movie check not hang in ~RELEASE_REAL build.
*
* 10 9/06/99 6:38p Dave
* Improved CD detection code.
*
* 9 9/06/99 1:16a Dave
* Make sure the user sees the intro movie.
*
* 8 9/03/99 1:31a Dave
* CD checking by act. Added support to play 2 cutscenes in a row
* seamlessly. Fixed super low level cfile bug related to files in the
* root directory of a CD. Added cheat code to set campaign mission # in
* main hall.
*
* 7 7/19/99 2:13p Dave
* Added some new strings for Heiko.
*
* 6 6/01/99 3:52p Dave
* View footage screen. Fixed xstrings to not display the & symbol. Popup,
* dead popup, pxo find player popup, pxo private room popup.
*
* 5 1/30/99 5:08p Dave
* More new hi-res stuff.Support for nice D3D textures.
*
* 4 10/23/98 3:51p Dave
* Full support for tstrings.tbl and foreign languages. All that remains
* is to make it active in Fred.
*
* 3 10/13/98 9:28a Dave
* Started neatening up freespace.h. Many variables renamed and
* reorganized. Added AlphaColors.[h,cpp]
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 18 6/09/98 10:31a Hoffoss
* Created index numbers for all xstr() references. Any new xstr() stuff
* added from here on out should be added to the end if the list. The
* current list count can be found in FreeSpace.cpp (search for
* XSTR_SIZE).
*
* 17 6/01/98 11:43a John
* JAS & MK: Classified all strings for localization.
*
* 16 5/24/98 9:01p Lawrance
* Add commit sounds when accept is pressed
*
* 15 5/21/98 8:05p Allender
* fix possible bug with number of cutscenes shown in the list
*
* 14 5/21/98 12:35a Lawrance
* Tweak how CD is checked for
*
* 13 5/20/98 1:34p Hoffoss
* Added cutscene description rendering.
*
* 12 5/19/98 12:19p Mike
* Cheat codes!
*
* 11 5/12/98 4:17p Hoffoss
* Make ctrl-arrows (up/down) switch between tech room screens.
*
* 10 5/11/98 8:04p Hoffoss
* Fixed minor bugs.
*
* 9 5/10/98 10:05p Allender
* only show cutscenes which have been seen before. Made Fred able to
* write missions anywhere, defaulting to player misison folder, not data
* mission folder. Fix FreeSpace code to properly read missions from
* correct locations
*
* 8 5/08/98 5:30p Lawrance
* add CD checks for movie playing
*
* 7 5/08/98 4:07p Allender
* more cutscene stuff
*
* 6 5/07/98 2:33p Hoffoss
* Removed help and options buttons.
*
* 5 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 4 4/23/98 8:27p Allender
* basic support for cutscene playback. Into movie code in place. Tech
* room can view cutscenes stored in CDROM_dir variable
*
* 3 4/21/98 7:07p Hoffoss
* Fixed problem where when switching screens flashes old tab hilight once
* before switching to new state.
*
* 2 4/17/98 6:33p Hoffoss
* Made changes to the tech room group of screens. Cutscenes screen is
* now in a new file.
*
* $NoKeywords: $
*/
#include "cutscene/cutscenes.h"
#include "ui/ui.h"
#include "gamesnd/gamesnd.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "io/key.h"
#include "movie.h"
#include "popup/popup.h"
#include "menuui/mainhallmenu.h"
#include "globalincs/alphacolors.h"
#include "localization/localize.h"
#include "parse/parselo.h"
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
"ViewFootage",
"2_ViewFootage"
};
char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
"ViewFootage-m",
"2_ViewFootage-m"
};
int Num_cutscenes;
int Cutscenes_viewable;
int Description_index;
cutscene_info Cutscenes[MAX_CUTSCENES];
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
void cutsceen_close(){
for(int i = 0; i<MAX_CUTSCENES; i++)
if(Cutscenes[i].description)vm_free(Cutscenes[i].description);
}
// initialization stuff for cutscenes
void cutscene_init()
{
atexit(cutsceen_close);
char buf[MULTITEXT_LENGTH];
int rval;
if ((rval = setjmp(parse_abort)) != 0) {
Error(LOCATION, "Error parsing 'rank.tbl'\r\nError code = %i.\r\n", rval);
}
// open localization
lcl_ext_open();
read_file_text("cutscenes.tbl");
reset_parse();
// parse in all the rank names
Num_cutscenes = 0;
skip_to_string("#Cutscenes");
ignore_white_space();
while ( required_string_either("#End", "$Filename:") ) {
Assert ( Num_cutscenes < MAX_CUTSCENES );
required_string("$Filename:");
stuff_string( Cutscenes[Num_cutscenes].filename, F_PATHNAME, NULL );
required_string("$Name:");
stuff_string( Cutscenes[Num_cutscenes].name, F_NAME, NULL );
required_string("$Description:");
stuff_string(buf, F_MULTITEXT, NULL);
drop_white_space(buf);
compact_multitext_string(buf);
Cutscenes[Num_cutscenes].description = vm_strdup(buf);
required_string("$cd:");
stuff_int( &Cutscenes[Num_cutscenes].cd );
Num_cutscenes++;
}
required_string("#End");
Cutscenes_viewable = INTRO_CUTSCENE_FLAG;
// close localization
lcl_ext_close();
}
// function to return 0 based index of which CD a particular movie is on
// returns -1 on failure.
int cutscenes_get_cd_num( char *filename )
{
#if defined(OEM_BUILD)
return 0; // only 1 cd for OEM
#else
int i;
for (i = 0; i < Num_cutscenes; i++ ) {
if ( !stricmp(Cutscenes[i].filename, filename) ) {
return (Cutscenes[i].cd - 1);
}
}
return -1;
#endif // defined(OEM_BUILD)
}
// marks a cutscene as viewable
void cutscene_mark_viewable(char *filename)
{
int i;
char cut_file[MAX_FILENAME_LEN];
char file[MAX_FILENAME_LEN];
Assert(filename);
// strip off extension
strcpy( file, filename );
char *p = strchr( file, '.' );
if ( p ) {
*p = 0;
}
// change to lower case
strlwr(file);
for (i = 0; i < Num_cutscenes; i++ ) {
// change the cutscene file name to lower case
strcpy(cut_file, Cutscenes[i].filename);
strlwr(cut_file);
// see if the stripped filename matches the cutscene filename
if ( strstr(cut_file, file) != NULL ) {
Cutscenes_viewable |= (1<<i);
return;
}
}
}
#define NUM_BUTTONS 8
#define TECH_DATABASE_BUTTON 0
#define SIMULATOR_BUTTON 1
#define CUTSCENES_BUTTON 2
#define CREDITS_BUTTON 3
#define SCROLL_UP_BUTTON 4
#define SCROLL_DOWN_BUTTON 5
#define PLAY_BUTTON 6
#define EXIT_BUTTON 7
static int Num_files;
static int Cutscene_list[MAX_CUTSCENES];
//static int Stats_scroll_offset; // not used - taylor
static int Selected_line = 0; // line that is currently selected for binding
static int Scroll_offset;
static int Background_bitmap;
static UI_BUTTON List_region;
static UI_WINDOW Ui_window;
static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
{ // GR_640
ui_button_info("TDB_00", 7, 5, 37, 7, 0), // tech database 1
ui_button_info("TDB_01", 7, 19, 37, 23, 1), // tech database 2
ui_button_info("TDB_02", 7, 34, 37, 38, 2), // tech database 3
ui_button_info("TDB_03", 7, 49, 37, 54, 3), // tech database 4
ui_button_info("VFB_04", 6, 318, -1, -1, 4), // scroll up
ui_button_info("VFB_05", 36, 318, -1, -1, 5), // scroll down
ui_button_info("VFB_06", 578, 319, 587, 366, 6), // play
ui_button_info("VFB_07", 574, 431, 587, 413, 7), // exit
},
{ // GR_1024
ui_button_info("2_TDB_00", 12, 7, 59, 12, 0), // tech database 1
ui_button_info("2_TDB_01", 12, 31, 59, 37, 1), // tech database 2
ui_button_info("2_TDB_02", 12, 56, 59, 62, 2), // tech database 3
ui_button_info("2_TDB_03", 12, 81, 59, 88, 3), // tech database 4
ui_button_info("2_VFB_04", 9, 509, -1, -1, 4), // scroll up
ui_button_info("2_VFB_05", 58, 509, -1, -1, 5), // scroll down
ui_button_info("2_VFB_06", 925, 511, 940, 586, 6), // play
ui_button_info("2_VFB_07", 918, 689, 940, 661, 7), // exit
}
};
// text
#define NUM_CUTSCENE_TEXT 6
UI_XSTR Cutscene_text[GR_NUM_RESOLUTIONS][NUM_CUTSCENE_TEXT] = {
{ // GR_640
{"Technical Database", 1055, 37, 7, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][TECH_DATABASE_BUTTON].button },
{"Mission Simulator", 1056, 37, 23, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][SIMULATOR_BUTTON].button },
{"Cutscenes", 1057, 37, 38, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CUTSCENES_BUTTON].button },
{"Credits", 1058, 37, 54, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][CREDITS_BUTTON].button },
{"Play", 1335, 587, 366, UI_XSTR_COLOR_GREEN, -1, &Buttons[0][PLAY_BUTTON].button },
{"Exit", 1419, 587, 413, UI_XSTR_COLOR_PINK, -1, &Buttons[0][EXIT_BUTTON].button },
},
{ // GR_1024
{"Technical Database", 1055, 59, 12, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][TECH_DATABASE_BUTTON].button },
{"Mission Simulator", 1056, 59, 37, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][SIMULATOR_BUTTON].button },
{"Cutscenes", 1057, 59, 62, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CUTSCENES_BUTTON].button },
{"Credits", 1058, 59, 88, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][CREDITS_BUTTON].button },
{"Play", 1335, 940, 586, UI_XSTR_COLOR_GREEN, -1, &Buttons[1][PLAY_BUTTON].button },
{"Exit", 1419, 940, 661, UI_XSTR_COLOR_PINK, -1, &Buttons[1][EXIT_BUTTON].button },
}
};
int Cutscene_list_coords[GR_NUM_RESOLUTIONS][4] = {
{ // GR_640
9, 117, 621, 198
},
{ // GR_1024
14, 188, 994, 316
}
};
int Cutscene_desc_coords[GR_NUM_RESOLUTIONS][4] = {
{ // GR_640
9, 378, 484, 73
},
{ // GR_1024
14, 605, 775, 117
}
};
#define MAX_TEXT_LINES 20
int Cutscene_max_text_lines[GR_NUM_RESOLUTIONS] = {
10,
MAX_TEXT_LINES
};
#define MAX_TEXT_LINE_LEN 256
static int Text_size;
static int Text_offset = 0;
static int Text_line_size[MAX_TEXT_LINES];
static char *Text_lines[MAX_TEXT_LINES];
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
{
int cd_present = 0;
int cd_drive_num;
int cd_mve_is_on;
char volume_name[128];
#ifdef RELEASE_REAL
int num_attempts = 0;
#endif
while(1) {
int path_set_ok;
cd_mve_is_on = cutscenes_get_cd_num(mve_name);
if ((cd_mve_is_on != 0) && (cd_mve_is_on != 1) && (cd_mve_is_on != 2)) {
cd_present = 0;
break;
}
#if defined(OEM_BUILD)
sprintf(volume_name, NOX("FS2_OEM"));
#else
sprintf(volume_name, NOX("FREESPACE2_%c"), '1' + cd_mve_is_on);
#endif
cd_drive_num = find_freespace_cd(volume_name);
path_set_ok = set_cdrom_path(cd_drive_num);
if ( path_set_ok ) {
cd_present = 1;
break;
}
#ifdef RELEASE_REAL
if ( !prompt_for_cd ) {
cd_present = 0;
break;
}
// no CD found, so prompt user
char popup_msg[256];
int popup_rval;
#if defined(DVD_MESSAGE_HACK)
sprintf(popup_msg, XSTR( "Movie not found\n\nInsert FreeSpace DVD to continue", 203));
#else
sprintf(popup_msg, XSTR( "Movie not found\n\nInsert FreeSpace CD #%d to continue", 203), cd_mve_is_on+1);
#endif
popup_rval = popup(PF_BODY_BIG, 2, POPUP_CANCEL, POPUP_OK, popup_msg);
if ( popup_rval != 1 ) {
cd_present = 0;
break;
}
if ( num_attempts++ > 5 ) {
cd_present = 0;
break;
}
#else
cd_present = 0;
break;
#endif
}
return cd_present;
}
void cutscenes_screen_play()
{
char name[MAX_FILENAME_LEN]; // *full_name
int which_cutscene;
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
which_cutscene = Cutscene_list[Selected_line];
strcpy(name, Cutscenes[which_cutscene].filename );
// full_name = cf_add_ext(name, NOX(".mve"));
main_hall_stop_music();
int rval = movie_play(name);
main_hall_start_music();
if ( !rval ) {
char str[256];
sprintf(str, XSTR( "Unable to play movie %s.", 204), Cutscenes[which_cutscene].name );
popup(0, 1, POPUP_OK, str );
}
}
void cutscenes_screen_scroll_line_up()
{
if (Selected_line) {
Selected_line--;
gamesnd_play_iface(SND_SCROLL);
} else
gamesnd_play_iface(SND_GENERAL_FAIL);
if (Selected_line < Scroll_offset)
Scroll_offset = Selected_line;
}
void cutscenes_screen_scroll_line_down()
{
int h;
if (Selected_line < Num_files - 1) {
Selected_line++;
gamesnd_play_iface(SND_SCROLL);
} else
gamesnd_play_iface(SND_GENERAL_FAIL);
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
if (Selected_line >= Scroll_offset + h){
Scroll_offset++;
}
}
void cutscenes_screen_scroll_screen_up()
{
int h;
if (Scroll_offset) {
Scroll_offset--;
Assert(Selected_line > Scroll_offset);
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
while (Selected_line >= Scroll_offset + h){
Selected_line--;
}
gamesnd_play_iface(SND_SCROLL);
} else {
gamesnd_play_iface(SND_GENERAL_FAIL);
}
}
void cutscenes_screen_scroll_screen_down()
{
int h;
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
if (Scroll_offset + h < Num_files) {
Scroll_offset++;
if (Selected_line < Scroll_offset){
Selected_line = Scroll_offset;
}
gamesnd_play_iface(SND_SCROLL);
} else {
gamesnd_play_iface(SND_GENERAL_FAIL);
}
}
int cutscenes_screen_button_pressed(int n)
{
switch (n) {
case TECH_DATABASE_BUTTON:
gamesnd_play_iface(SND_SWITCH_SCREENS);
gameseq_post_event(GS_EVENT_TECH_MENU);
return 1;
case SIMULATOR_BUTTON:
gamesnd_play_iface(SND_SWITCH_SCREENS);
gameseq_post_event(GS_EVENT_SIMULATOR_ROOM);
return 1;
case CREDITS_BUTTON:
gamesnd_play_iface(SND_SWITCH_SCREENS);
gameseq_post_event(GS_EVENT_CREDITS);
return 1;
case SCROLL_UP_BUTTON:
cutscenes_screen_scroll_screen_up();
break;
case SCROLL_DOWN_BUTTON:
cutscenes_screen_scroll_screen_down();
break;
case PLAY_BUTTON:
cutscenes_screen_play();
break;
case EXIT_BUTTON:
gamesnd_play_iface(SND_COMMIT_PRESSED);
gameseq_post_event(GS_EVENT_MAIN_MENU);
game_flush();
break;
}
return 0;
}
void cutscenes_screen_init()
{
int i;
ui_button_info *b;
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
Ui_window.set_mask_bmap(Cutscene_mask_name[gr_screen.res]);
for (i=0; i<NUM_BUTTONS; i++) {
b = &Buttons[gr_screen.res][i];
b->button.create(&Ui_window, "", b->x, b->y, 60, 30, (i < 2), 1);
// set up callback for when a mouse first goes over a button
b->button.set_highlight_action(common_play_highlight_sound);
b->button.set_bmaps(b->filename);
b->button.link_hotspot(b->hotspot);
}
// add xstrs
for(i=0; i<NUM_CUTSCENE_TEXT; i++){
Ui_window.add_XSTR(&Cutscene_text[gr_screen.res][i]);
}
Buttons[gr_screen.res][EXIT_BUTTON].button.set_hotkey(KEY_CTRLED | KEY_ENTER);
Buttons[gr_screen.res][SCROLL_UP_BUTTON].button.set_hotkey(KEY_PAGEUP);
Buttons[gr_screen.res][SCROLL_DOWN_BUTTON].button.set_hotkey(KEY_PAGEDOWN);
List_region.create(&Ui_window, "", Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1], Cutscene_list_coords[gr_screen.res][2], Cutscene_list_coords[gr_screen.res][3], 0, 1);
List_region.hide();
// set up hotkeys for buttons so we draw the correct animation frame when a key is pressed
Buttons[gr_screen.res][SCROLL_UP_BUTTON].button.set_hotkey(KEY_PAGEUP);
Buttons[gr_screen.res][SCROLL_DOWN_BUTTON].button.set_hotkey(KEY_PAGEDOWN);
Background_bitmap = bm_load(Cutscene_bitmap_name[gr_screen.res]);
Scroll_offset = Selected_line = 0;
Description_index = -1;
// when doing a debug version, just put all of the movie files here.
#ifndef NDEBUG
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
#endif
// if (All_movies_enabled)
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
Num_files = 0;
for ( i = 0; i < Num_cutscenes; i++ ) {
if ( Cutscenes_viewable & (1<<i) ) {
Cutscene_list[Num_files] = i;
Num_files++;
}
}
}
void cutscenes_screen_close()
{
if (Background_bitmap)
bm_release(Background_bitmap);
Ui_window.destroy();
}
void cutscenes_screen_do_frame()
{
int i, k, y, z;
int font_height = gr_get_font_height();
int select_tease_line = -1;
k = Ui_window.process();
switch (k) {
case KEY_DOWN: // select next line
cutscenes_screen_scroll_line_down();
break;
case KEY_UP: // select previous line
cutscenes_screen_scroll_line_up();
break;
case KEY_TAB:
case KEY_CTRLED | KEY_DOWN:
cutscenes_screen_button_pressed(CREDITS_BUTTON);
break;
case KEY_SHIFTED | KEY_TAB:
case KEY_CTRLED | KEY_UP:
cutscenes_screen_button_pressed(SIMULATOR_BUTTON);
break;
case KEY_ENTER:
cutscenes_screen_play();
break;
case KEY_ESC: // cancel
gameseq_post_event(GS_EVENT_MAIN_MENU);
game_flush();
break;
case KEY_F1: // show help overlay
break;
case KEY_F2: // goto options screen
gameseq_post_event(GS_EVENT_OPTIONS_MENU);
break;
} // end switch
for (i=0; i<NUM_BUTTONS; i++){
if (Buttons[gr_screen.res][i].button.pressed()){
if (cutscenes_screen_button_pressed(i)){
return;
}
}
}
if (List_region.button_down()) {
List_region.get_mouse_pos(NULL, &y);
z = Scroll_offset + y / font_height;
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 < Num_files))
Selected_line = z;
}
GR_MAYBE_CLEAR_RES(Background_bitmap);
if (Background_bitmap >= 0) {
gr_set_bitmap(Background_bitmap);
gr_bitmap(0, 0);
}
Ui_window.draw();
for (i=TECH_DATABASE_BUTTON; i<=CREDITS_BUTTON; i++){
if (Buttons[gr_screen.res][i].button.button_down()){
break;
}
}
if (i > CREDITS_BUTTON){
Buttons[gr_screen.res][CUTSCENES_BUTTON].button.draw_forced(2);
}
y = 0;
z = Scroll_offset;
while (y + font_height <= Cutscene_list_coords[gr_screen.res][3]) {
if (z >= Num_files){
break;
}
if (z == Selected_line){
gr_set_color_fast(&Color_text_selected);
} else if (z == select_tease_line) {
gr_set_color_fast(&Color_text_subselected);
} else {
gr_set_color_fast(&Color_text_normal);
}
gr_printf(Cutscene_list_coords[gr_screen.res][0], Cutscene_list_coords[gr_screen.res][1] + y, Cutscenes[Cutscene_list[z]].name);
y += font_height;
z++;
}
if (Description_index != Selected_line) {
char *src;
Description_index = Selected_line;
Text_size = 0;
src = Cutscenes[Cutscene_list[Description_index]].description;
if (src) {
Text_size = split_str(src, Cutscene_desc_coords[gr_screen.res][2], Text_line_size, Text_lines, Cutscene_max_text_lines[gr_screen.res]);
Assert(Text_size >= 0 && Text_size < Cutscene_max_text_lines[gr_screen.res]);
}
}
if (Description_index >= 0) {
int len;
char line[MAX_TEXT_LINE_LEN + 1];
gr_set_color_fast(&Color_text_normal);
y = 0;
z = Text_offset;
while (y + font_height <= Cutscene_desc_coords[gr_screen.res][3]) {
if (z >= Text_size)
break;
len = Text_line_size[z];
if (len > MAX_TEXT_LINE_LEN)
len = MAX_TEXT_LINE_LEN;
strncpy(line, Text_lines[z], len);
line[len] = 0;
gr_string(Cutscene_desc_coords[gr_screen.res][0], Cutscene_desc_coords[gr_screen.res][1] + y, line);
y += font_height;
z++;
}
}
gr_flip();
}
-98
View File
@@ -1,98 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
* $Revision: 2.4 $
* $Date: 2005-07-13 02:50:50 $
* $Author: Goober5000 $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2004/08/11 05:06:20 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.2 2004/03/05 09:01:58 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 6 5/21/98 12:35a Lawrance
* Tweak how CD is checked for
*
* 5 5/10/98 10:05p Allender
* only show cutscenes which have been seen before. Made Fred able to
* write missions anywhere, defaulting to player misison folder, not data
* mission folder. Fix FreeSpace code to properly read missions from
* correct locations
*
* 4 5/08/98 5:30p Lawrance
* add cutscenes_validate_cd()
*
* 3 5/08/98 4:07p Allender
* more cutscene stuff
*
* 2 4/17/98 6:33p Hoffoss
* Made changes to the tech room group of screens. Cutscenes screen is
* now in a new file.
*
* $NoKeywords: $
*/
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#define MAX_CUTSCENES 10
// this cutscene is always available.
#define INTRO_CUTSCENE_FLAG (1<<0)
typedef struct cutscene_info
{
char filename[MAX_FILENAME_LEN];
char name[NAME_LENGTH];
char *description;
int cd;
} cutscene_info;
extern cutscene_info Cutscenes[MAX_CUTSCENES];
extern int Num_cutscenes;
extern int Cutscenes_viewable;
// initializa table data
void cutscene_init();
int cutscene_get_cd_num(char *filename);
void cutscenes_screen_init();
void cutscenes_screen_close();
void cutscenes_screen_do_frame();
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd = 1);
void cutscene_mark_viewable(char *filename);
#endif
-262
View File
@@ -1,262 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
* $Revision: 2.26 $
* $Date: 2005-05-12 17:37:48 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 2.25 2005/04/24 06:52:23 wmcoolmon
* Enabled movies in windowed mode; if this causes problems for people, they can always use -dnoshowvid
*
* Revision 2.24 2005/02/05 00:30:49 taylor
* fix a few things post merge
*
* Revision 2.23 2004/11/27 10:42:18 taylor
* this should get movies working again in D3D and help OGL too
*
* Revision 2.22 2004/07/26 20:47:26 Kazan
* remove MCD complete
*
* Revision 2.21 2004/07/12 16:32:43 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.20 2004/04/26 13:09:20 taylor
* cvs log header, mark cutscenes viewable for later, gr_flip() to fix OGL white flash
*
*
*
* $NoKeywords: $
*/
#ifdef _WIN32
#include <windows.h>
#include "directx/dx8show.h"
#include "graphics/grd3dinternal.h"
#endif
#include "cutscene/movie.h"
#include "osapi/osapi.h"
#include "cmdline/cmdline.h"
#include "debugconsole/dbugfile.h"
#include "cfile/cfile.h"
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
#include "freespace2/freespace.h" // for Game_mode, etc.
// This module links freespace movie calls to the actual API calls the play the movie.
// This module handles all the different requires of OS and gfx API and finding the file to play
void process_messages()
{
#ifdef _WIN32
MSG msg;
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
#endif
}
// filename - file to search for
// out_name - output, full path to file
// returns non-zero if file is found
int movie_find(char *filename, char *out_name)
{
char full_path[MAX_PATH];
char tmp_name[MAX_PATH];
char search_name[MAX_PATH];
int i, size, offset = 0;
const int NUM_EXT = 2;
const char *movie_ext[NUM_EXT] = { ".avi", ".mpg" };
if (out_name == NULL) {
return 0;
}
// remove extension
strcpy( tmp_name, filename );
char *p = strchr( tmp_name, '.' );
if ( p ) {
*p = 0;
}
for (i=0; i<NUM_EXT; i++) {
strcpy( search_name, tmp_name );
strcat( search_name, movie_ext[i] );
// try and find the file
if ( cf_find_file_location(search_name, CF_TYPE_ANY, full_path, &size, &offset, 0) ) {
// if it's not in a packfile then we're done
if (offset == 0) {
strcpy( out_name, full_path );
return 1;
}
}
// clear old string
strcpy( search_name, "" );
}
return 0;
}
// Play one movie
bool movie_play(char *name)
{
// mark the movie as viewable to the player when in a campaign
// do this before anything else so that we're sure the movie is available
// to the player even if it's not going to play right now
if (Game_mode & GM_CAMPAIGN_MODE) {
cutscene_mark_viewable(name);
}
extern int Is_standalone;
if(Is_standalone) return false;
if(Cmdline_dnoshowvid) return false;
//Commented this out since we have dnoshowvid -WMC
//if(Cmdline_window) return false;
char full_name[MAX_PATH];
int rc = 0;
rc = movie_find(name, full_name);
if (!rc) {
DBUGFILE_OUTPUT_1("MOVIE ERROR: Cant open movie file %s", name);
return false;
} else {
DBUGFILE_OUTPUT_1("About to play: %s", full_name);
}
#ifdef _WIN32
process_messages();
// This is a bit of a hack but it works nicely
if(gr_screen.mode == GR_DIRECT3D)
{
GlobalD3DVars::D3D_activate = 0;
GlobalD3DVars::lpD3DDevice->EndScene();
GlobalD3DVars::lpD3DDevice->Present(NULL,NULL,NULL,NULL);
// d3d_lost_device();
}
// reset the gr_* stuff before trying to play a movie
gr_flip(); // in the case of D3D this should recover the device
gr_clear();
gr_flip(); // need an extra flip here to cycle in the clear'd buffer
// This clears the screen
InvalidateRect((HWND) os_get_window(), NULL, TRUE);
PAINTSTRUCT paint_info;
HDC clear_hdc = BeginPaint((HWND) os_get_window(),&paint_info);
if(clear_hdc)
{
POINT points[4] = {
{0,0},
{gr_screen.max_w,0},
{gr_screen.max_w, gr_screen.max_h},
{0, gr_screen.max_h}};
HBRUSH hBrush = CreateSolidBrush(0x00000000);
HBRUSH hOldBrush = (HBRUSH)SelectObject(clear_hdc, hBrush);
SelectObject(clear_hdc, hBrush);
Polygon(clear_hdc, points, 4);
SelectObject(clear_hdc, hOldBrush);
DeleteObject(hBrush);
EndPaint((HWND) os_get_window(),&paint_info);
}
process_messages();
if(OpenClip((HWND) os_get_window(), full_name))
{
do
{
// Give system threads time to run (and don't sample user input madly)
Sleep(100);
MSG msg;
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
if(msg.message == WM_ERASEBKGND)
{
continue;
}
PassMsgToVideoWindow((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
if(msg.message == WM_PAINT)
{
}
if(msg.message != WM_KEYDOWN)
{
// DefWindowProc((HWND) os_get_window(), msg.message, msg.wParam, msg.lParam);
DispatchMessage(&msg);
continue;
}
switch(msg.wParam )
{
// Quits movie if escape, space or return is pressed
case VK_ESCAPE:
case VK_SPACE:
case VK_RETURN:
{
// Terminate movie playback early
CloseClip((HWND) os_get_window());
GlobalD3DVars::D3D_activate = 1;
return true;
}
}
}
}
// Stream bit of the movie then handle windows messages
while(dx8show_stream_movie() == false);
}
// We finished playing the movie
CloseClip((HWND) os_get_window());
if (gr_screen.mode == GR_DIRECT3D) {
GlobalD3DVars::D3D_activate = 1;
}
#else
STUB_FUNCTION;
#endif
return true;
}
bool movie_play_two(char *name1, char *name2)
{
bool result1 = movie_play(name1);
process_messages();
bool result2 = movie_play(name2);
return result1 && result2;
}
-8
View File
@@ -1,8 +0,0 @@
#ifndef _MOVIE_HEADER_FILE
#define _MOVIE_HEADER_FILE
bool movie_play(char *name);
bool movie_play_two(char *name1, char *name2);
#endif
-227
View File
@@ -1,227 +0,0 @@
#include "ddsutils/ddsutils.h"
#include "cfile/cfile.h"
int Texture_compression_enabled=0;
int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int *bpp, int *compression_type, int *levels, int *size)
{
DDSURFACEDESC2 dds_header;
int code = 0;
CFILE *ddsfile;
char real_name[MAX_FILENAME_LEN];
int retval = DDS_ERROR_NONE;
int ct = DDS_UNCOMPRESSED;
int bits = 0;
int trash;
if (img_cfp == NULL) {
// this better not happen.. ever
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p=0; }
strcat(real_name, ".dds");
// try to open the file
ddsfile = cfopen(real_name, "rb");
// file not found
if (ddsfile == NULL)
return DDS_ERROR_INVALID_FILENAME;
} else {
ddsfile = img_cfp;
}
// read the code
code = cfread_int(ddsfile);
// check it
if (code != DDS_FILECODE)
return DDS_ERROR_BAD_HEADER;
// read header variables
dds_header.dwSize = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwSize );
dds_header.dwFlags = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwFlags );
dds_header.dwHeight = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwHeight );
dds_header.dwWidth = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwWidth );
dds_header.dwPitchOrLinearSize = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwPitchOrLinearSize );
dds_header.dwDepth = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwDepth);
dds_header.dwMipMapCount = cfread_uint(ddsfile); //INTEL_INT( dds_header.dwMipMapCount );
// skip over the crap we don't care about
for (int i = 0; i < 11; i++)
trash = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwSize = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwSize );
dds_header.ddpfPixelFormat.dwFlags = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwFlags );
dds_header.ddpfPixelFormat.dwFourCC = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwFourCC );
dds_header.ddpfPixelFormat.dwRGBBitCount = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwRGBBitCount );
dds_header.ddpfPixelFormat.dwRBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwRBitMask );
dds_header.ddpfPixelFormat.dwGBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwGBitMask );
dds_header.ddpfPixelFormat.dwBBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwBBitMask );
dds_header.ddpfPixelFormat.dwRGBAlphaBitMask = cfread_uint(ddsfile); //INTEL_INT( dds_header.ddpfPixelFormat.dwRGBAlphaBitMask );
// calculate the type and size of the data
if (dds_header.ddpfPixelFormat.dwFlags & DDPF_FOURCC) {
// did I mention lately that I hate Microsoft?
// this is here to fix the situation where Microsoft doesn't follow their own docs
if ( dds_header.dwPitchOrLinearSize <= 0 ) {
if (dds_header.dwDepth == 0)
dds_header.dwDepth = 1;
// calculate the block size, mult by 8 for DXT1, 16 for DXT3 & 5
*size = ((dds_header.dwWidth + 3)/4) * ((dds_header.dwHeight + 3)/4) * ((dds_header.dwDepth + 3)/4) * ((dds_header.ddpfPixelFormat.dwFourCC == FOURCC_DXT1) ? 8 : 16);
} else {
*size = dds_header.dwMipMapCount > 1 ? dds_header.dwPitchOrLinearSize * 2 : dds_header.dwPitchOrLinearSize;
}
switch (dds_header.ddpfPixelFormat.dwFourCC) {
case FOURCC_DXT1:
bits=24;
ct=DDS_DXT1;
break;
case FOURCC_DXT3:
bits=32;
ct=DDS_DXT3;
break;
case FOURCC_DXT5:
bits=32;
ct=DDS_DXT5;
break;
// dxt2 and dxt4 aren't supported
case FOURCC_DXT2:
case FOURCC_DXT4:
retval = DDS_ERROR_INVALID_FORMAT;
ct = DDS_DXT_INVALID;
break;
// none of the above
default:
retval = DDS_ERROR_UNSUPPORTED;
ct = DDS_DXT_INVALID;
break;
}
} else if (dds_header.ddpfPixelFormat.dwFlags & DDPF_RGB) {
if (dds_header.dwDepth == 0)
dds_header.dwDepth = 1;
*size = dds_header.dwWidth * dds_header.dwHeight * dds_header.dwDepth * (dds_header.ddpfPixelFormat.dwRGBBitCount / 8);
bits = dds_header.ddpfPixelFormat.dwRGBBitCount;
ct = DDS_UNCOMPRESSED;
} else {
// it's not a readable format
retval = DDS_ERROR_UNSUPPORTED;
}
// stuff important info
if (bpp)
*bpp = bits;
if (compression_type)
*compression_type = ct;
if (width)
*width = dds_header.dwWidth;
if (height)
*height = dds_header.dwHeight;
if (levels)
*levels = dds_header.dwMipMapCount;
if (img_cfp == NULL) {
// close file and return
cfclose(ddsfile);
ddsfile = NULL;
}
return retval;
}
//reads pixel info from a dds file
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp)
{
int retval;
int w,h,ct,lvl;
int size = 0, bits = 0;
CFILE *cfp;
char real_name[MAX_FILENAME_LEN];
// this better not happen.. ever
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p = 0; }
strcat(real_name, ".dds");
// open it up and go to the data section
cfp = cfopen(real_name, "rb");
// just in case
if (cfp == NULL)
return DDS_ERROR_INVALID_FILENAME;
// read the header -- if its at this stage, it should be legal.
retval = dds_read_header(real_name, cfp, &w, &h, &bits, &ct, &lvl, &size);
Assert(retval == DDS_ERROR_NONE);
// this really shouldn't be needed but better safe than sorry
if (retval != DDS_ERROR_NONE) {
return retval;
}
cfseek(cfp, DDS_OFFSET, CF_SEEK_SET);
// read in the data
cfread(data, 1, size, cfp);
if (bpp)
*bpp = (ubyte)bits;
// we look done here
cfclose(cfp);
return DDS_ERROR_NONE;
}
//returns string representation of DDS_** error code
const char *dds_error_string(int code)
{
switch (code)
{
case DDS_ERROR_NONE:
return "No error";
case DDS_ERROR_NO_MEM:
return "Insufficient memory";
case DDS_ERROR_INVALID_FILENAME:
return "File not found";
case DDS_ERROR_BAD_HEADER:
return "Filecode did not equal \"DDS \"";
case DDS_ERROR_INVALID_FORMAT:
return "File was compressed, but it was DXT2 or DXT4";
case DDS_ERROR_UNSUPPORTED:
return "*.DDS files must be uncompressed or use DXT1, DXT3, or DXT5 compression";
default:
return "Abort, retry, fail?";
}
//get a warning otherwise
return "Abort, retry, fail?";
}
-90
View File
@@ -1,90 +0,0 @@
//header file to load .dds files
//these use dxtc texture compression
#ifndef __DDS_H
#define __DDS_H
#include "globalincs/pstypes.h"
#ifdef _WIN32
#include "directx/vddraw.h"
#endif
struct CFILE;
#define DDS_ERROR_NONE 0 //everything went fine
#define DDS_ERROR_INVALID_FILENAME 1 //bad filename
#define DDS_ERROR_NO_MEM 2 //not enough mem to load
#define DDS_ERROR_UNSUPPORTED 3 //not a readable format
#define DDS_ERROR_INVALID_FORMAT 4 //can only use dxtc1, dxtc3, dxtc5
#define DDS_ERROR_BAD_HEADER 5 //header was not "DDS "
#define DDS_DXT_INVALID -1
#define DDS_UNCOMPRESSED 0
#define DDS_DXT1 1
#define DDS_DXT3 3
#define DDS_DXT5 5
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif //defined(MAKEFOURCC)
// FOURCC codes for DX compressed-texture pixel formats
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
#define DDS_FILECODE 0x20534444 // "DDS " in file
#ifndef DUMMYUNIONNAMEN
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
#define DUMMYUNIONNAMEN(n)
#else
#define DUMMYUNIONNAMEN(n) u##n
#endif
#endif
//these structures are the headers for a dds file
typedef struct _DDSCAPS2
{
DWORD dwCaps1;
DWORD dwCaps2;
DWORD Reserved[2];
} DDSCAPS2;
typedef struct _DDSURFACEDESC2
{
DWORD dwSize; // size of the DDSURFACEDESC structure
DWORD dwFlags; // determines what fields are valid
DWORD dwHeight; // height of surface to be created
DWORD dwWidth; // width of input surface
DWORD dwPitchOrLinearSize;
DWORD dwDepth;
DWORD dwMipMapCount;
DWORD dwReserved1[11];
DDPIXELFORMAT ddpfPixelFormat;
DDSCAPS2 ddsCaps; // direct draw surface capabilities
DWORD dwReserved2;
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
//reads a dds header
//returns one of the error values
//'compression_type' comes back as one of the DDS_DXTC* defines
int dds_read_header(char *filename, CFILE *img_cfp = NULL, int *width = 0, int *height = 0, int *bpp = 0, int *compression_type = 0, int *levels = 0, int *size = 0);
//reads bitmap
//size of the data it stored in size
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp = NULL);
//returns a string from a DDS error code
const char* dds_error_string(int code);
extern int Texture_compression_enabled;
#endif //__DDS_H
File diff suppressed because it is too large. Load diff
-217
View File
@@ -1,217 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Debris/Debris.h $
* $Revision: 2.5 $
* $Date: 2005-07-13 02:50:51 $
* $Author: Goober5000 $
*
* Code for the pieces of exploding object debris.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/04/28 05:29:29 wmcoolmon
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
*
* Revision 2.3 2005/04/05 05:53:15 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.2 2004/08/11 05:06:20 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2004/03/05 09:01:59 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 6 7/15/99 9:20a Andsager
* FS2_DEMO initial checkin
*
* 5 7/01/99 11:44a Dave
* Updated object sound system to allow multiple obj sounds per ship.
* Added hit-by-beam sound. Added killed by beam sound.
*
* 4 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 3 10/16/98 1:22p Andsager
* clean up header files
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 29 4/02/98 6:30p Lawrance
* reduce max debris piece if DEMO defined
*
* 28 4/02/98 11:40a Lawrance
* check for #ifdef DEMO instead of #ifdef DEMO_RELEASE
*
* 27 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 26 2/19/98 12:46a Lawrance
* Further work on asteroids.
*
* 25 2/10/98 6:43p Lawrance
* Moved asteroid code to a separate lib.
*
* 24 2/06/98 3:08p Mike
* More asteroid stuff, including resolving conflicts between the two
* asteroid_field structs!
*
* 23 2/05/98 12:51a Mike
* Early asteroid stuff.
*
* 22 1/29/98 5:50p John
* Made electrical arcing on debris pieces be persistent from frame to
* frame
*
* 21 1/21/98 7:18p Lawrance
* Fix bug with creating debris before the mission starts.
*
* 20 12/22/97 9:56p Andsager
* Implement ship:debris collisions. Generalize and move
* ship_ship_or_debris_hit struct from CollideShipShip to ObjCollide.h
*
* 19 11/19/97 5:57p Mike
* Make debris go away if more than N units away from the nearest player.
* Make speed of a docked object not read zero if it's moving.
*
* 18 10/01/97 10:52a Mike
* Change debris prototype to take an additional parameter to give debris
* more thrust when it is created.
*
* 17 9/20/97 9:25a John
* fixed bug with species specific debris shards.
*
* 16 8/13/97 9:50p Allender
* split *_move into *_process_pre and *_process_post functions.
* process_pre functions called before object is moved. _process_post
* functions called after object is moved. Reordered code in ship_post
* and weapon_post for multiplayer
*
* 15 7/24/97 8:35a Allender
* allow ships to blow up before missions starts. Made some debris system
* items available in other modules
*
* 14 7/13/97 5:53p Lawrance
* save model name in debris
*
* 13 7/02/97 11:48a Lawrance
* update debris to delay persistant sound
*
* 12 6/06/97 4:13p Lawrance
* leave debris chunks from very large ships persistant, scale fireball
* lifetime by ship radius
*
* 11 6/06/97 12:12p Lawrance
* limit hull debris pieces, destroying oldest debris to make way for new
* debris.
*
* 10 5/14/97 4:08p Lawrance
* removing my_index from game arrays
*
* 9 4/03/97 12:23a Mike
* Make debris collidable-with. Can hit it, too.
* Make AI ships stop firing when target enters death roll.
*
* 8 3/31/97 11:11a John
* added ship species specific debris.
*
* 7 3/25/97 3:55p Lawrance
* allowing debris to be targeted and shown on radar
*
* 6 2/27/97 12:07p John
* Added code to suppord debris chunks after a ship is exploded..
*
* 5 2/26/97 2:18p Lawrance
* adding Debris[] to save/restore
*
* 4 2/10/97 12:38p John
* made all ships blow up into debris pieces when exploded.
*
* 3 2/07/97 10:45a John
* Initial bare bones implementation of blowing off turrets.
*
* 2 2/07/97 9:30a John
*
* 1 2/06/97 4:13p John
*
* $NoKeywords: $
*/
#ifndef _DEBRIS_H
#define _DEBRIS_H
#include "globalincs/pstypes.h"
struct object;
struct CFILE;
#define MAX_DEBRIS_ARCS 8 // Must be less than MAX_ARC_EFFECTS in model.h
typedef struct debris {
debris *next, *prev; // used for a linked list of the hull debris chunks
int flags; // See DEBRIS_??? defines
int source_objnum; // What object this came from
int source_sig; // Signature of the source object
int ship_info_index; // Ship info index of the ship type debris came from
int team; // Team of the ship where the debris came from
int objnum; // What object this is linked to
float lifeleft; // When 0 or less object dies
int model_num; // What model this uses
int submodel_num; // What submodel this uses
int next_fireball; // When to start a fireball
int is_hull; // indicates a large hull chunk of debris
int species; // What species this is from. -1 if don't care.
int fire_timeout; // timestamp that holds time for fireballs to stop appearing
int sound_delay; // timestamp to signal when sound should start
fix time_started; // time when debris was created
int next_distance_check; // timestamp to determine whether to delete this piece of 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
} debris;
// flags for debris pieces
#define DEBRIS_USED (1<<0)
#define DEBRIS_EXPIRE (1<<1) // debris can expire (ie hull chunks from small ships)
#define MAX_DEBRIS_PIECES 64
extern debris Debris[MAX_DEBRIS_PIECES];
extern int Num_debris_pieces;
struct collision_info_struct;
void debris_init();
void debris_render( object * obj );
void debris_delete( object * obj );
void debris_process_pre( object * obj, float frame_time);
void debris_process_post( object * obj, float frame_time);
object *debris_create( object * source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force );
int debris_check_collision( object * obj, object * other_obj, vec3d * hitpos, collision_info_struct *debris_hit_info=NULL );
void debris_hit( object * debris_obj, object * other_obj, vec3d * hitpos, float damage );
int debris_get_team(object *objp);
void debris_clear_expired_flag(debris *db);
#endif // _DEBRIS_H
-824
View File
@@ -1,824 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
* $Revision: 2.6 $
* $Date: 2005-04-25 00:07:22 $
* $Author: wmcoolmon $
*
* Routines for managing the debug console window.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2004/07/26 20:47:27 Kazan
* remove MCD complete
*
* Revision 2.4 2004/07/12 16:32:44 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.3 2004/03/05 09:01:58 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.2 2003/03/18 10:07:01 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 4 6/04/99 10:35a Dave
*
* 3 10/13/98 9:28a Dave
* Started neatening up freespace.h. Many variables renamed and
* reorganized. Added AlphaColors.[h,cpp]
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 17 2/05/98 11:43a Allender
* enhcanced network statistic collection. Made callback in debug console
* to do networking if player is in the console
*
* 16 1/22/98 6:42p John
* Move game_flush out of debug console into freespace. Made object
* pair code throw out some weapons that turn. Added stats for how many
* object pair are actually checked.
*
* 15 1/16/98 11:56a Allender
* ability to scroll back in debug console, and call game_flush() when
* leaving
*
* 14 1/10/98 1:14p John
* Added explanation to debug console commands
*
* 13 12/21/97 4:39p John
* fixed bug in name compare
*
* 12 12/21/97 4:33p John
* Made debug console functions a class that registers itself
* automatically, so you don't need to add the function to
* debugfunctions.cpp.
*
* 11 9/13/97 9:31a Lawrance
* if playing a demo, clear key filter then reset it once done with debug
* console
*
* 10 9/09/97 3:39p Sandeep
* warning level 4 bugs
*
* 9 6/13/97 3:50p John
* sped up debug console printf
*
* 8 6/13/97 3:27p John
* made debug console pretty
*
* 7 6/09/97 9:24a John
* Changed the way fonts are set.
*
* 6 5/29/97 3:09p John
* Took out debug menu.
* Made software scaler draw larger bitmaps.
* Optimized Direct3D some.
*
* 5 5/13/97 4:07p John
* made numbers also be marked as strings.
*
* 4 4/28/97 5:24p John
* made so : and \ don't get parsed out in debug console.
*
* 3 4/24/97 11:49a John
* added new lighting commands to console.
*
* 2 4/24/97 10:36a John
* moved the debug console stuff into it's own lib... made it compile with
* Fred.
*
* 1 4/24/97 10:16a John
* Initial rev
*
* $NoKeywords: $
*/
#include <stdlib.h>
#include <stdio.h>
#include <stdarg.h>
#include <setjmp.h>
#include <string.h>
#include "globalincs/pstypes.h"
#include "graphics/font.h"
#include "io/timer.h"
#include "io/key.h"
#include "globalincs/alphacolors.h"
#include "osapi/osapi.h"
#include "debugconsole/dbugfile.h"
#define MAX_COMMANDS 300
static int Num_debug_commands = 0;
static debug_command *Debug_command[MAX_COMMANDS];
debug_command::debug_command(char *_name, char *_help, void (*_func)() )
{
int i;
if ( Num_debug_commands >= MAX_COMMANDS ) {
Int3(); // Too many debug console commands!! Increase MAX_COMMANDS!!
return;
}
for (i=0; i<Num_debug_commands; i++ ) {
int ret = stricmp( Debug_command[i]->name, _name );
if ( ret == 0) {
Int3(); // This debug console command already exists!!!!
return;
} else if ( ret > 0 ) {
break; // Insert it here
} else if ( ret < 0 ) {
// do nothing
}
}
if ( i < Num_debug_commands ) {
// Insert it at element i
int j;
for (j=Num_debug_commands; j>i; j-- ) {
Debug_command[j] = Debug_command[j-1];
}
Debug_command[i] = this;
Num_debug_commands++;
} else {
Debug_command[Num_debug_commands] = this;
Num_debug_commands++;
}
name = _name;
help = _help;
func = _func;
}
// some global variables
int Dc_command; // If this is set, then process the command
int Dc_help; // If this is set, then print out the help text in the form, "usage: ... \nLong description\n" );
int Dc_status; // If this is set, then print out the current status of the command.
char *Dc_arg; // The (lowercased) string value of the argument retrieved from dc_arg
char *Dc_arg_org; // Dc_arg before it got converted to lowercase
uint Dc_arg_type; // The type of dc_arg.
char *Dc_command_line; // The rest of the command line, from the end of the last processed arg on.
int Dc_arg_int; // If Dc_arg_type & ARG_INT is set, then this is the value
float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is the value
int scroll_times = 0; // incremented each time display scrolls
int debug_inited = 0;
#define DROWS 25
#define DCOLS 80
int debug_x=0, debug_y=0;
char debug_text[DROWS][DCOLS];
static char command_line[1024];
static int command_line_pos = 0;
#define DEBUG_HISTORY 16
static char oldcommand_line[DEBUG_HISTORY][1024];
int last_oldcommand=-1;
int command_scroll = 0;
///=========================== SCANNER =======================
typedef enum {
LETTER, QUOTE, SPECIAL, EOF_CODE, DIGIT,
} CHAR_CODE;
typedef enum {
NO_TOKEN, IDENTIFIER, NUMBER, STRING,
} TOKEN_CODE;
#define MAX_TOKEN_STRING_LENGTH 128
char scanner_ch;
TOKEN_CODE scanner_token;
char scanner_token_string[MAX_TOKEN_STRING_LENGTH];
char scanner_word_string[MAX_TOKEN_STRING_LENGTH];
char * scanner_bufferp = "";
char * scanner_tokenp = scanner_token_string;
CHAR_CODE scanner_char_table[256];
#define scanner_char_code(x) scanner_char_table[x]
void scanner_get_char()
{
if ( *scanner_bufferp == '\0' ) {
scanner_ch = 0;
return;
}
scanner_ch = *scanner_bufferp++;
}
void scanner_init()
{
int ch;
for (ch=0; ch<256; ++ch) scanner_char_table[ch] = SPECIAL;
for (ch='0'; ch<='9'; ++ch) scanner_char_table[ch] = DIGIT;
for (ch='A'; ch<='Z'; ++ch) scanner_char_table[ch] = LETTER;
for (ch='a'; ch<='z'; ++ch) scanner_char_table[ch] = LETTER;
scanner_char_table['.'] = DIGIT;
scanner_char_table['-'] = DIGIT;
scanner_char_table['+'] = DIGIT;
scanner_char_table['_'] = LETTER;
scanner_char_table[34] = QUOTE;
scanner_char_table[0] = EOF_CODE;
scanner_char_table[':'] = LETTER;
scanner_char_table['\\'] = LETTER;
scanner_ch = 0;
}
void scanner_skip_blanks()
{
while( (scanner_ch ==' ') || (scanner_ch =='\t') )
scanner_get_char();
}
void scanner_downshift_word()
{
int offset = 'a' - 'A';
char * tp;
strcpy( scanner_word_string, scanner_token_string );
tp = scanner_word_string;
do {
*tp = (char)((*tp>='A') && (*tp <='Z') ? *tp + offset : *tp) ;
tp++;
} while (*tp != '\0' );
}
void scanner_get_word()
{
while( (scanner_char_code(scanner_ch)==LETTER) || (scanner_char_code(scanner_ch)==DIGIT) ) {
*scanner_tokenp++ = scanner_ch;
scanner_get_char();
}
*scanner_tokenp = '\0';
scanner_token = IDENTIFIER;
}
void scanner_get_string()
{
*scanner_tokenp++ = 34;
scanner_get_char();
while(scanner_ch != 34 ) {
*scanner_tokenp++ = scanner_ch;
scanner_get_char();
}
scanner_get_char();
*scanner_tokenp++ = 34;
*scanner_tokenp = '\0';
scanner_token = STRING;
}
void scanner_get_token()
{
scanner_skip_blanks();
scanner_tokenp = scanner_token_string;
*scanner_tokenp = 0;
switch( scanner_char_code(scanner_ch) ) {
case QUOTE: scanner_get_string(); break;
case EOF_CODE: scanner_token = NO_TOKEN; break;
case DIGIT:
case LETTER: scanner_get_word(); break;
default:
*scanner_tokenp++ = scanner_ch;
*scanner_tokenp = '\0';
scanner_get_char();
scanner_token = IDENTIFIER;
break;
}
scanner_downshift_word();
}
void scanner_start_command( char * s )
{
scanner_bufferp = s;
scanner_get_char();
}
int Dc_debug_on = 0;
jmp_buf dc_bad_arg;
void dc_get_arg(uint type)
{
scanner_get_token();
Dc_command_line = scanner_bufferp;
Dc_arg_org = scanner_token_string;
Dc_arg = scanner_word_string;
if (Dc_debug_on) {
dc_printf( "next arg is '%s', was originally '%s'\n", Dc_arg, Dc_arg_org );
dc_printf( "Rest of the command line is '%s'\n", Dc_command_line );
}
if ( scanner_token == NO_TOKEN ) {
Dc_arg_type = ARG_NONE;
} else if ( scanner_token == IDENTIFIER ) {
Dc_arg_type = ARG_STRING;
} else if ( scanner_token == STRING ) {
Dc_arg_type = ARG_QUOTE;
} else {
Dc_arg_type = ARG_STRING;
}
if ( Dc_arg_type & ARG_STRING ) {
int i, num_digits, len;
len = strlen(Dc_arg);
num_digits = 0;
for (i=0; i<len; i++)
if ( scanner_char_table[Dc_arg[i]] == DIGIT ) num_digits++;
if ( num_digits==len ) {
Dc_arg_type |= ARG_FLOAT;
Dc_arg_float = (float)atof(Dc_arg);
if ( !strchr( Dc_arg, '.' )) {
Dc_arg_type |= ARG_INT;
Dc_arg_int = atoi(Dc_arg);
}
} else {
if ( (Dc_arg[0] == '0') && (Dc_arg[1] == 'x') ) {
char *p;
int n;
n = strtol(Dc_arg,&p,0);
if ( *p == 0 ) {
Dc_arg_type |= ARG_INT|ARG_HEX;
Dc_arg_int = n;
}
}
}
if (Dc_debug_on) {
if ( Dc_arg_type & ARG_FLOAT )
dc_printf( "Found float number! %f\n", Dc_arg_float );
if ( Dc_arg_type & ARG_INT )
dc_printf( "Found int number! %d\n", Dc_arg_int );
if ( Dc_arg_type & ARG_HEX )
dc_printf( "Found hex number! 0x%x\n", Dc_arg_int );
}
if ( !stricmp( Dc_arg, "on" ))
Dc_arg_type |= ARG_TRUE;
if ( !stricmp( Dc_arg, "true" ))
Dc_arg_type |= ARG_TRUE;
if ( !stricmp( Dc_arg, "off" ))
Dc_arg_type |= ARG_FALSE;
if ( !stricmp( Dc_arg, "false" ))
Dc_arg_type |= ARG_FALSE;
if ( !stricmp( Dc_arg, "+" ))
Dc_arg_type |= ARG_PLUS;
if ( !stricmp( Dc_arg, "-" ))
Dc_arg_type |= ARG_MINUS;
if ( !stricmp( Dc_arg, "," ))
Dc_arg_type |= ARG_COMMA;
}
if ( Dc_arg_type & ARG_INT) {
if ( Dc_arg_int )
Dc_arg_type |= ARG_TRUE;
else
Dc_arg_type |= ARG_FALSE;
}
if ( !(Dc_arg_type&type) ) {
if ( (Dc_arg_type & ARG_NONE) && !(type & ARG_NONE))
dc_printf( "Error: Not enough parameters.\n" );
else
dc_printf( "Error: '%s' invalid type\n", Dc_arg );
longjmp(dc_bad_arg,1);
}
}
void debug_help();
void debug_do_command(char * command)
{
int i;
int mode = 0;
if ( strlen(command) < 1 ) return;
Dc_debug_on = 0;
Dc_command_line = command;
scanner_start_command(command);
if (setjmp(dc_bad_arg) ) {
return;
}
dc_get_arg( ARG_ANY );
if ( !strcmp( Dc_arg, "debug" ) ) {
Dc_debug_on = 1;
dc_printf( "Command line: '%s'\n", Dc_command_line );
dc_get_arg( ARG_ANY );
}
if ( !strcmp( Dc_arg, "?" ) ) {
mode = 1;
dc_get_arg( ARG_ANY );
if ( Dc_arg_type&ARG_NONE ) {
debug_help();
return;
}
}
if ( !strcmp( Dc_arg, "help" ) || !strcmp( Dc_arg, "man" ) ) {
mode = 2;
dc_get_arg( ARG_ANY );
if ( Dc_arg_type&ARG_NONE ) {
debug_help();
return;
}
}
if ( strstr( Dc_command_line, "?" ) ) {
mode = 2;
}
if ( !(Dc_arg_type&ARG_STRING) ) {
dc_printf( "Invalid keyword '%s'\n", Dc_arg );
return;
}
if (Dc_debug_on) {
dc_printf( "Searching for command '%s'\n", Dc_arg );
}
for (i=0; i<Num_debug_commands; i++ ) {
if ( !stricmp( Debug_command[i]->name, Dc_arg )) {
if (mode==0) {
if (Dc_debug_on)
dc_printf( "Calling function '%s'\n", Dc_arg );
Dc_command = 1;
Dc_help = 0;
Dc_status = 1;
} else if (mode==1) {
if (Dc_debug_on)
dc_printf( "Checking status for '%s'\n", Dc_arg );
Dc_command = 0;
Dc_help = 0;
Dc_status = 1;
} else {
if (Dc_debug_on)
dc_printf( "Doing help for '%s'\n", Dc_arg );
Dc_command = 0;
Dc_help = 1;
Dc_status = 0;
}
(*Debug_command[i]->func)();
if (mode==0) {
dc_get_arg(ARG_ANY);
if (!(Dc_arg_type&ARG_NONE)) {
dc_printf( "Ignoring the unused command line tail '%s %s'\n", Dc_arg_org, Dc_command_line );
}
}
return;
}
}
dc_printf( "Unknown command '%s'\n", Dc_arg );
}
void debug_draw()
{
int i;
gr_clear();
gr_set_font(FONT1);
gr_set_color_fast( &Color_bright );
gr_string( 0x8000, 3, "Debug Console" );
gr_set_color_fast( &Color_normal );
for (i=0; i<DROWS; i++ ) {
gr_string( 0, i*16+16, debug_text[i] );
}
int t = timer_get_fixed_seconds() / (F1_0/3);
if ( t & 1 ) {
int w,h;
char c;
c = debug_text[debug_y][command_line_pos+1];
debug_text[debug_y][command_line_pos+1] = 0;
gr_get_string_size( &w, &h, debug_text[debug_y] );
//gr_string( w, debug_y*16, "_" );
gr_rect(w+1,debug_y*16+1+16,2,14);
debug_text[debug_y][command_line_pos+1] = c;
}
gr_flip();
}
void debug_output( char c )
{
if ( c == '\t' ) {
int next_tab = ((debug_x/28)+1)*28;
if ( next_tab >= DCOLS-1 ) {
debug_x=0;
debug_y++;
scroll_times++;
if ( debug_y >= DROWS ) {
int i;
for (i=1; i<DROWS; i++ )
strcpy( debug_text[i-1], debug_text[i] );
debug_y = DROWS-1;
debug_x = 0;
debug_text[debug_y][debug_x] = 0;
}
debug_text[debug_y][debug_x] = 0;
return;
}
for ( ; debug_x < next_tab; )
debug_text[debug_y][debug_x++] = ' ';
debug_text[debug_y][debug_x] = 0;
return;
}
if ( (c == '\n') || (debug_x >= DCOLS-1) ) {
debug_x=0;
debug_y++;
scroll_times++;
if ( debug_y >= DROWS ) {
int i;
for (i=1; i<DROWS; i++ )
strcpy( debug_text[i-1], debug_text[i] );
debug_y = DROWS-1;
debug_x = 0;
debug_text[debug_y][debug_x] = 0;
}
debug_text[debug_y][debug_x] = 0;
if ( c == '\n' ) return;
}
debug_text[debug_y][debug_x++] = c;
debug_text[debug_y][debug_x] = 0;
}
void dc_printf(char *format, ...)
{
char tmp[DCOLS*DROWS];
va_list args;
va_start(args, format);
vsprintf(tmp, format, args);
va_end(args);
char *p = tmp;
while( *p != '\0' ) {
debug_output(*p);
p++;
}
}
void debug_init()
{
int i;
if ( debug_inited ) return;
debug_inited = 1;
debug_x=0;
debug_y=0;
for (i=0; i<DROWS; i++ ) {
debug_text[i][0] = 0;
}
dc_printf("Debug console started.\n" );
}
void debug_console( void (*_func)() )
{
int done = 0;
scanner_init();
while( key_inkey() ){
os_poll();
}
if ( !debug_inited ) debug_init();
debug_draw();
while (!done) {
// poll the os
os_poll();
int k = key_inkey();
switch( k ) {
case KEY_SHIFTED+KEY_ENTER:
case KEY_ESC:
done=1; break;
case KEY_BACKSP:
if ( command_line_pos > 0 ) {
command_line[--command_line_pos] = 0;
}
break;
case KEY_F3:
if ( last_oldcommand > -1 ) {
strcpy( command_line, oldcommand_line[last_oldcommand] );
command_line_pos = strlen(command_line);
command_line[command_line_pos] = 0;
}
break;
case KEY_UP:
command_scroll--;
if (command_scroll<0)
command_scroll = last_oldcommand;
if ( command_scroll > -1 ) {
strcpy( command_line, oldcommand_line[command_scroll] );
command_line_pos = strlen(command_line);
command_line[command_line_pos] = 0;
}
break;
case KEY_DOWN:
command_scroll++;
if (command_scroll>last_oldcommand)
command_scroll = 0;
if (command_scroll>last_oldcommand)
command_scroll = -1;
if ( command_scroll > -1 ) {
strcpy( command_line, oldcommand_line[command_scroll] );
command_line_pos = strlen(command_line);
command_line[command_line_pos] = 0;
}
break;
case KEY_ENTER: {
debug_output( '\n' );
debug_draw();
debug_do_command(command_line);
int i, found = 0;
for (i=0; i<=last_oldcommand; i++ ) {
if (!stricmp( oldcommand_line[i], command_line )) {
found = 1;
}
}
if ( !found ) {
if ( last_oldcommand < DEBUG_HISTORY-1 ) {
last_oldcommand++;
strcpy( oldcommand_line[last_oldcommand], command_line);
} else {
int i;
for (i=0; i<last_oldcommand; i++ ) {
strcpy( oldcommand_line[i], oldcommand_line[i+1] );
}
strcpy( oldcommand_line[last_oldcommand], command_line);
}
}
// int i;
// for (i=0; i<=last_oldcommand; i++ ) {
// dc_printf( "OC %d. %s\n", i, oldcommand_line[i] );
// }
debug_output( '\n' );
command_line_pos = 0;
command_line[command_line_pos] = 0;
command_scroll = 0;
}
break;
default: {
ubyte c = (ubyte)key_to_ascii(k);
if ( c != 255 ) {
command_line[command_line_pos++] = c;
command_line[command_line_pos] = 0;
}
}
}
strcpy( debug_text[debug_y], ">" );
strcat( debug_text[debug_y], command_line );
debug_draw();
if ( _func ){
_func();
}
}
while( key_inkey() ){
os_poll();
}
}
void debug_help()
{
int s, i;
dc_printf( "Available functions:\n\n" );
s = scroll_times;
for (i=0; i<Num_debug_commands; i++ ) {
dc_printf( " %s - %s\n", Debug_command[i]->name, Debug_command[i]->help );
//mprintf(( "Scroll times %d\n", scroll_times - s ));
if ( scroll_times - s > DROWS - 3 ) {
int k;
dc_printf( " Press a key...B for back\n" );
debug_draw();
k = key_getch();
s = scroll_times;
if ( k == KEY_B ) {
i -= ((DROWS-3)*2);
if ( i <= 0 )
i = -1;
}
}
debug_draw();
}
dc_printf( "\n" );
dc_printf( "Typing '? function_name' will give the current status.\n" );
dc_printf( "Typing 'function_name ?' will give help on the function.\n" );
dc_printf( "Typing ? or help will give you help.\n");
dc_printf( "F3 selects last command line.\n" );
}
-408
View File
@@ -1,408 +0,0 @@
#ifdef _WIN32
#include <windows.h>
#endif
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include "dbugfile.h"
#pragma warning(disable:4711) // function selected for inlining
int dbugfile_counters[MAX_COUNTERS];
bool dbugfile_init_var = false;
char dbugfile_filename[512];
void dbugfile_output(char *buffer)
{
if(dbugfile_init_var == false)
{
return;
}
FILE *fp = fopen(dbugfile_filename, "a");
if(fp == NULL)
{
return;
}
fwrite(buffer, sizeof(char) * strlen(buffer), 1, fp);
fclose(fp);
}
void dbugfile_init()
{
// Clear the counters
memset(dbugfile_counters, 0, sizeof(int) * MAX_COUNTERS);
char big_buffer[1000];
char temp_buff[512];
dbugfile_filename[0] = '\0';
#ifdef _WIN32
char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
int path_len = strlen(path);
if(path[path_len - 1] != '\\')
{
path[path_len] = '\\';
path[path_len + 1] = '\0';
}
strcpy(dbugfile_filename, path);
#endif
strcat(dbugfile_filename, "DBUG-");
strcpy(big_buffer, "DBUGFILE Active: ");
#ifdef _WIN32
{
unsigned long len = 512;
GetUserName(temp_buff, &len);
strcat(dbugfile_filename, temp_buff);
strcat(big_buffer, temp_buff);
strcat(dbugfile_filename, "-");
strcat(big_buffer, " ");
}
#endif
_tzset();
// Display operating system-style date and time.
_strdate( temp_buff);
strcat(dbugfile_filename, "D(");
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ") T(");
strcat(big_buffer, " ");
_strtime( temp_buff);
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ").txt");
strcat(big_buffer, "\n");
// Remove invalid slash chars
int len = strlen(dbugfile_filename);
while(len >= 2)
{
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
{
dbugfile_filename[len] = '-';
}
len--;
}
// open file
// Uncomment this to see where the file is going
//MessageBox(NULL, dbugfile_filename, "das", MB_OK);
FILE *fp = fopen(dbugfile_filename, "w");
if(fp == NULL)
{
return;
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
#ifdef _WIN32
// detect OS type
OSVERSIONINFO version_info;
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx(&version_info) != false)
{
char *error = "Error in detecting OS version";
char *version = error;
switch(version_info.dwMajorVersion)
{
case 4:
{
if(version_info.dwMinorVersion == 0)
{
version = "Windows 95";
}
else if(version_info.dwMinorVersion == 10)
{
version = "Windows 98";
}
else if(version_info.dwMinorVersion == 90)
{
version = "Windows Me";
}
break;
}
case 5:
{
if(version_info.dwMinorVersion == 0)
{
version = "Windows 2000";
}
else if(version_info.dwMinorVersion == 1)
{
version = "Windows XP";
}
break;
}
}
char *release_type = NULL;
#ifdef _DEBUG
release_type = "Debug";
#else
release_type = "Release";
#endif
sprintf(big_buffer, "OS: %s %s, ", version, release_type);
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
char exe_name[MAX_PATH];
GetModuleFileName(NULL, exe_name, MAX_PATH);
strcat(exe_name, "\n");
fwrite(exe_name, sizeof(char) * strlen(exe_name), 1, fp);
#endif
fclose(fp);
dbugfile_init_var = true;
}
void dbugfile_deinit()
{
dbugfile_output("Normal end");
dbugfile_init_var = false;
}
void dbugfile_sprintf(int line, char *file, const char *format, ...)
{
if(dbugfile_init_var == false)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
char buffer[1000];
int i = sprintf(buffer, "[%s,%4d] ", ptr, line);
va_list ap;
char *p, *sval;
long ival;
double dval;
// Add each extra parameter to string
va_start(ap, format);
for(p = (char *) format; *p; p++)
{
if(*p != '%')
{
*(buffer + i) = *p;
i++;
continue;
}
p++;
switch(*p)
{
case 'd':
{
ival = va_arg(ap, int);
i += sprintf(buffer+i,"%d", ival);
break;
}
case 'c':
{
ival = va_arg(ap, char);
buffer[i] = (char) ival;
i++;
break;
}
case 'x':
{
ival = va_arg(ap, int);
i += sprintf(buffer+i,"%x", ival);
break;
}
case 'f':
{
dval = va_arg(ap, double);
i += sprintf(buffer+i,"%f", dval);
break;
}
case 's':
{
for(sval = va_arg(ap, char *); *sval; sval++)
{
*(buffer + i++) = *sval;
}
break;
}
default:
{
i += sprintf(buffer+i,"N/A: %%%c", *p);
break;
}
}
}
va_end(ap);
i += sprintf(buffer + i, "\n");
dbugfile_output(buffer);
}
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text)
{
if(dbugfile_init_var == false)
{
return;
}
if(matrix == NULL)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
if(text == NULL)
{
text = "";
}
char buffer[1000];
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
"%f %f %f %f\n"
"%f %f %f %f\n"
"%f %f %f %f\n"
"%f %f %f %f\n",
ptr,line, text,
matrix[0],
matrix[1],
matrix[2],
matrix[3],
matrix[4],
matrix[5],
matrix[6],
matrix[7],
matrix[8],
matrix[9],
matrix[10],
matrix[11],
matrix[12],
matrix[13],
matrix[14],
matrix[15]);
dbugfile_output(buffer);
}
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text)
{
if(dbugfile_init_var == false)
{
return;
}
if(matrix == NULL)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
if(text == NULL)
{
text = "";
}
char buffer[1000];
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
"%f %f %f\n"
"%f %f %f\n"
"%f %f %f\n",
ptr,line, text,
matrix[0],
matrix[1],
matrix[2],
matrix[3],
matrix[4],
matrix[5],
matrix[6],
matrix[7],
matrix[8]);
dbugfile_output(buffer);
}
void dbugfile_print_counter(int line, char *file, int counter_num, char *string)
{
char buffer[1000];
strcpy(buffer, string);
strcat(buffer, " %d");
dbugfile_sprintf(line, file, buffer, dbugfile_counters[counter_num]);
}
-66
View File
@@ -1,66 +0,0 @@
#ifndef _DBUGFILE_HEADER_
#define _DBUGFILE_HEADER_
#define MAX_COUNTERS 10
void dbugfile_init();
void dbugfile_deinit();
void dbugfile_sprintf(int line, char *file, const char *format, ...);
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text);
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text);
void dbugfile_print_counter(int line, char *file, int counter_num, char *string);
#ifdef DBUGFILE_ACTIVE
#define DBUGFILE_INIT() dbugfile_init();
#define DBUGFILE_DEINIT() dbugfile_deinit();
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f);
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h,i);
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) dbugfile_print_matrix_3x3(__LINE__, __FILE__, m,t);
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) dbugfile_print_matrix_4x4(__LINE__, __FILE__, m,t);
extern int dbugfile_counters[MAX_COUNTERS];
#define DBUGFILE_INC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]++;
#define DBUGFILE_DEC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]--;
#define DBUGFILE_OUTPUT_COUNTER(n,s) dbugfile_print_counter(__LINE__, __FILE__, n, s);
#else
#define DBUGFILE_INIT() ;
#define DBUGFILE_DEINIT() ;
#define DBUGFILE_OUTPUT_0(t) ;
#define DBUGFILE_OUTPUT_1(t,a) ;
#define DBUGFILE_OUTPUT_2(t,a,b) ;
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) ;
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) ;
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) ;
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) ;
#define DBUGFILE_INC_COUNTER(n) ;
#define DBUGFILE_DEC_COUNTER(n) ;
#define DBUGFILE_OUTPUT_COUNTER(n,s) ;
#endif
#endif
-226
View File
@@ -1,226 +0,0 @@
/*
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
*
* You may not sell or otherwise commercially exploit the source or things you
* created based on the source.
*
*/
/*
* This module is intended as a debug tool to measure the speed of blocks of code and display
* that information as coloured bars across the top of the screen.
*
* This allows interactive measuring of components of the code, very useful for optimisztion.
*/
#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#endif
#include "timerbar.h"
#include "globalincs/pstypes.h"
// Internal structure for handling frame data
typedef struct
{
LARGE_INTEGER start_value;
LARGE_INTEGER total_value;
LARGE_INTEGER average;
LARGE_INTEGER frame_total;
} timerbar_profile;
timerbar_profile profiles[MAX_NUM_TIMERBARS];
int timerbar_current_profile = 0;
LARGE_INTEGER timerbar_ultimate_start_value;
LARGE_INTEGER timerbar_last_start_value;
// Data needed for push and pop functionality
const int MAX_TB_STACK_SIZE = 100;
int timerbar_stack[MAX_TB_STACK_SIZE];
int timerbar_current_stack_layer = 0;
/*
*
*
*
*/
void timerbar_push(int value)
{
if(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE)
{
// To many pushs, this must be a bug
// Someone is letting code miss the pops, check for early retuns
Assert(!(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE));
return;
}
timerbar_stack[timerbar_current_stack_layer] = timerbar_current_profile;
timerbar_current_stack_layer++;
timerbar_switch_type(value);
}
/*
*
*
*
*/
void timerbar_pop()
{
timerbar_current_stack_layer--;
if(timerbar_current_stack_layer < 0)
{
Assert(!(timerbar_current_stack_layer < 0));
timerbar_current_stack_layer = 0;
return;
}
timerbar_switch_type(timerbar_stack[timerbar_current_stack_layer]);
}
// This pointer holds the draw function to use or NULL
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
void timerbar_start_frame()
{
timerbar_current_stack_layer = 0;
timerbar_current_profile = 0;
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
draw_func_ptr = NULL;
}
timerbar_last_start_value = timerbar_ultimate_start_value;
}
// Constants need for timerbar_conv_and_draw calculations
const int WIDTH = 480;
const float WIDTHF = ((float) WIDTH) * 1.01f;
/**
* Internal conversion function to convert draw data into bars for the screen
*
* @param int colour - colour index (>=0)
* @param int xpos - x position to start bar on
* @param int xwidth - width of bar
* @param int yrow - Index of row bar belongs to
*/
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
{
float fxpos = (float) xpos;
float fxwidth = (float) xwidth;
draw_func_ptr(colour,
fxpos / WIDTHF,
yrow * 0.01f,
fxwidth / WIDTHF,
0.005f);
}
void timerbar_end_frame()
{
// Now we want to draw the bars
if(draw_func_ptr == NULL)
{
// we have not been given a draw function so we are going to have to quit
return;
}
timerbar_switch_type(-1);
int last_xpos = 0;
int y_pos = 0;
for(int i = 0; i < MAX_NUM_TIMERBARS; i++)
{
// Nothing to render this frame
if(profiles[i].frame_total.QuadPart == 0)
{
continue;
}
int xsize = (int) profiles[i].frame_total.QuadPart / 90;
// break condition in else
while(1)
{
// if bar runs over
if(last_xpos + xsize > WIDTH)
{
int rem_len = WIDTH - last_xpos;
// Draw from current position to the end of the bar
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
xsize -= rem_len;
last_xpos = 0;
y_pos++;
}
else
{
// Draw whats left and break for the next bar
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
last_xpos += xsize;
break;
}
}
// reset for next frame
profiles[i].frame_total.QuadPart = 0;
}
}
void timerbar_switch_type(int num)
{
if(num >= MAX_NUM_TIMERBARS)
{
return;
}
// Calculate old profile's total
LARGE_INTEGER now;
if(QueryPerformanceCounter(&now) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
profiles[timerbar_current_profile].frame_total.QuadPart +=
(now.QuadPart - timerbar_last_start_value.QuadPart);
if(num != -1)
{
// Switch to new profile
timerbar_current_profile = num;
}
// Update time to count from
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
}
/**
* @param void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h) - pointer to draw function
*
* Sets the draw function used to output the timer data, designed to be generic allowing any API
* to take advantage of this module. Set to NULL to disable drawing.
*
* By default the draw function is set to NULL
*/
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
{
draw_func_ptr = new_draw_func_ptr;
}
-83
View File
@@ -1,83 +0,0 @@
/*
* Code created by Thomas Whittaker (RT) for a Freespace 2 source code project
*
* You may not sell or otherwise commercially exploit the source or things you
* created based on the source.
*
*/
/*
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
* $Revision: 1.10 $
* $Date: 2005-07-13 02:50:50 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.9 2004/08/11 05:06:20 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 1.8 2004/02/16 11:47:31 randomtiger
* Removed a lot of files that we dont need anymore.
* Changed htl to be on by default, command now -nohtl
* Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
* Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
* Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
*
* Revision 1.7 2003/11/19 20:37:23 randomtiger
* Almost fully working 32 bit pcx, use -pcx32 flag to activate.
* Made some commandline variables fit the naming standard.
* Changed timerbar system not to run pushes and pops if its not in use.
* Put in a note about not uncommenting asserts.
* Fixed up a lot of missing POP's on early returns?
* Perhaps the motivation for Assert functionality getting commented out?
* Fixed up some bad asserts.
* Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
* Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
* Put in a special check for the signs of that D3D init bug I need to lock down.
*
* Revision 1.6 2003/11/09 06:31:39 Kazan
* a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
* conflicts in cmdline and timerbar.h log entries
* cvs stopped acting like it was on crack obviously
*
* Revision 1.5 2003/11/09 04:09:17 Goober5000
* edited for language
* --Goober5000
*
* Revision 1.4 2003/11/08 22:25:47 Kazan
* Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
* DONT MESS WITH OTHER PEOPLES INCLUDE PATHS
* DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
*
*
* $NoKeywords: $
*/
#ifndef _TIMERBAR_HEADER_
#define _TIMERBAR_HEADER_
const int MAX_NUM_TIMERBARS = 20;
#include "cmdline/cmdline.h"
// These functions should never be used directly, always use macros below
void timerbar_start_frame();
void timerbar_end_frame();
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
void timerbar_push(int value);
void timerbar_pop();
// This function shouldnt not be used any more or it will break push and pop calls
void timerbar_switch_type(int num);
#define TIMERBAR_SET_DRAW_FUNC(f) if (Cmdline_timerbar) timerbar_set_draw_func(f);
#define TIMERBAR_START_FRAME() if (Cmdline_timerbar) timerbar_start_frame();
#define TIMERBAR_END_FRAME() if (Cmdline_timerbar) timerbar_end_frame();
#define TIMERBAR_SWITCH_TYPE(n) if (Cmdline_timerbar) timerbar_switch_type(n);
#define TIMERBAR_PUSH(v) if (Cmdline_timerbar) timerbar_push(v);
#define TIMERBAR_POP() if (Cmdline_timerbar) timerbar_pop();
#endif
File diff suppressed because it is too large. Load diff
-108
View File
@@ -1,108 +0,0 @@
//header file for making decals-Bobboau
#ifndef _DECAL_H
#define _DECAL_H
#include "object/object.h"
#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
#include "globalincs/pstypes.h"
//#include "ship/ship.h"
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
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;
};
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);
#endif
File diff suppressed because it is too large. Load diff
-119
View File
@@ -1,119 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Demo/Demo.h $
* $Revision: 2.2 $
* $Date: 2005-07-13 02:50:51 $
* $Author: Goober5000 $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2004/08/11 05:06:21 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 3/29/99 6:17p Dave
* More work on demo system. Got just about everything in except for
* blowing ships up, secondary weapons and player death/warpout.
*
* 2 3/28/99 5:58p Dave
* Added early demo code. Make objects move. Nice and framerate
* independant, but not much else. Don't use yet unless you're me :)
*
*
* $NoKeywords: $
*/
#ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
#define _FS2_DEMO_SYSTEM_HEADER_FILE
// -----------------------------------------------------------------------------------------------------------------------------
// DEMO DEFINES/VARS
//
// compile in the demo system
#define DEMO_SYSTEM
struct object;
struct ship;
// an error reading or writing the demo file
#define DEMO_ERROR_NONE 0 // no error
#define DEMO_ERROR_GENERAL 1 // general problem
#define DEMO_ERROR_FRAMESIZE 2 // frame size was too big (> 32k)
#define DEMO_ERROR_DISK_SPACE 3 // out of disk space
#define DEMO_ERROR_DISK_ACCESS 4 // problem accessing disk
#define DEMO_ERROR_VERSION 5 // bad version #
#define DEMO_ERROR_MISSION 6 // different mission file checksums
extern int Demo_error;
extern int Demo_make;
// -----------------------------------------------------------------------------------------------------------------------------
// DEMO FUNCTIONS
//
// do frame for the demo - start for the frame
int demo_do_frame_start();
// do frame for the demo - end for the frame
int demo_do_frame_end();
// initialize a demo for recording
// NOTE : call this after loading the mission and going through the briefing, but _before_ physically moving into the mission
int demo_start_record(char *file);
// initialize a demo for playback - calling this will load up the demo file and move the player into the playback state
int demo_start_playback(char *file);
// finish the demo, whether recording or playing back
void demo_close();
// if we should run the simulation for this object, or let the demo system handle it
int demo_should_sim(object *objp);
// functions for posting critical events to the demo system ------------------------------------------------------------
// post an object dump event (only used internally)
void demo_POST_object_dump();
// post a primary fired event
void demo_POST_primary_fired(object *objp, int banks, int linked);
// post a unique message
void demo_POST_unique_message(char *id, char *who_from, int m_source, int priority);
// post a builtin message
void demo_POST_builtin_message(int type, ship *shipp, int priority, int timing);
// post an object create message
void demo_POST_obj_create(char *pobj_name, int signature);
// post a warpin event
void demo_POST_warpin(int signature, int ship_flags);
// post a warpout event
void demo_POST_warpout(int signature, int ship_flags);
// post a departed event
void demo_POST_departed(int signature, int ship_flags);
// post a ship kill event
void demo_POST_ship_kill(object *objp);
#endif
-341
View File
@@ -1,341 +0,0 @@
#include <dshow.h>
#include <stdio.h>
#include "osapi/osapi.h"
#include "directx/dx8show.h"
#include "debugconsole/dbugfile.h"
#include "graphics/2d.h"
#include <commctrl.h>
#include <commdlg.h>
#include <tchar.h>
//#include <atlbase.h> // No dependecy on ATL!!!
enum PLAYSTATE {Stopped, Paused, Running, Init};
void Msg(TCHAR *szFormat, ...);
// Local
HRESULT InitPlayerWindow(HWND ghApp);
HRESULT InitVideoWindow(HWND ghApp, long w, long h);
bool HandleGraphEvent(void);
void CheckVisibility(void);
void CloseInterfaces(void);
//
// Constants
//
#define VOLUME_FULL 0L
#define VOLUME_SILENCE -10000L
#define WM_GRAPHNOTIFY WM_USER
char error_buffer[512];
char *ParseDShowError(HRESULT hr)
{
#ifndef NDEBUG
AMGetErrorText(hr, error_buffer, 512);
return error_buffer;
#else
return "DShow error";
#endif
}
//
// Macros
//
#define SAFE_RELEASE(x) { if (x) x->Release(); x = NULL; }
#define JIF(x) if (FAILED(hr=(x))) \
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) " (%s) " TEXT("\n"), hr, ParseDShowError(hr)); return hr;}
#define LIF(x) if (FAILED(hr=(x))) \
{Msg(TEXT("FAILED(hr=0x%x) in ") TEXT(#x) TEXT("\n"), hr);}
//
// Global data
//
BOOL g_bAudioOnly=FALSE;
LONG g_lVolume=VOLUME_FULL;
DWORD g_dwGraphRegister=0;
PLAYSTATE g_psCurrent=Stopped;
// DirectShow interfaces
IGraphBuilder *pGB = NULL;
IMediaControl *pMC = NULL;
IMediaEventEx *pME = NULL;
IVideoWindow *pVW = NULL;
IBasicAudio *pBA = NULL;
IBasicVideo *pBV = NULL;
IMediaSeeking *pMS = NULL;
IMediaPosition *pMP = NULL;
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
if (pVW)
pVW->NotifyOwnerMessage((long) hWnd, message, wParam, lParam);
}
void SetCurrentState(PLAYSTATE state)
{
g_psCurrent = state;
}
PLAYSTATE GetCurrentState()
{
return g_psCurrent;
}
BOOL IsAudioOnly()
{
return g_bAudioOnly;
}
HRESULT PlayMovieInWindow(HWND ghApp, LPTSTR szFile)
{
// USES_CONVERSION;
WCHAR wFile[MAX_PATH];
HRESULT hr;
// Clear open dialog remnants before calling RenderFile()
UpdateWindow(ghApp);
// Convert filename to wide character string
// wcscpy(wFile, T2W(szFile)); // requires ATL
swprintf(wFile, L"%S", szFile); // Uses libc to convert instead
// Get the interface for DirectShow's GraphBuilder
JIF(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,
IID_IGraphBuilder, (void **)&pGB));
if(SUCCEEDED(hr))
{
HRESULT load_attempt = pGB->RenderFile(wFile, NULL);
// Have the graph builder construct its the appropriate graph automatically
if(FAILED(load_attempt))
{
return load_attempt;
}
// QueryInterface for DirectShow interfaces
JIF(pGB->QueryInterface(IID_IMediaControl, (void **)&pMC));
JIF(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
JIF(pGB->QueryInterface(IID_IMediaSeeking, (void **)&pMS));
JIF(pGB->QueryInterface(IID_IMediaPosition, (void **)&pMP));
// Query for video interfaces, which may not be relevant for audio files
JIF(pGB->QueryInterface(IID_IVideoWindow, (void **)&pVW));
JIF(pGB->QueryInterface(IID_IBasicVideo, (void **)&pBV));
// Query for audio interfaces, which may not be relevant for video-only files
JIF(pGB->QueryInterface(IID_IBasicAudio, (void **)&pBA));
// Is this an audio-only file (no video component)?
CheckVisibility();
// Have the graph signal event via window callbacks for performance
JIF(pME->SetNotifyWindow((OAHWND)ghApp, WM_GRAPHNOTIFY, 0));
long width, height;
pBV->get_VideoWidth(&width);
pBV->get_VideoHeight(&height);
JIF(InitVideoWindow(ghApp,width, height));
if (!g_bAudioOnly)
{
JIF(pVW->put_Owner((OAHWND)ghApp));
JIF(pVW->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE));
JIF(pVW->SetWindowForeground(OATRUE));
}
// Run the graph to play the media file
JIF(pMC->Run());
g_psCurrent=Running;
}
return hr;
}
extern int Cmdline_window;
extern int Cmdline_noscalevid;
HRESULT InitVideoWindow(HWND ghApp, long video_w, long video_h)
{
HRESULT hr = S_OK;
RECT rect;
GetClientRect(ghApp, &rect);
int screen_w = rect.right;
int screen_h = rect.bottom;
int video_rescale_w;
int video_rescale_h;
if (Cmdline_noscalevid && (video_w < screen_w) && (video_h < screen_h)) {
video_rescale_w = video_w;
video_rescale_h = video_h;
} else {
video_rescale_w = (video_w * screen_w) / video_w;
video_rescale_h = (video_rescale_w * video_h) / video_w;
}
int extra_w = (screen_w - video_rescale_w) / 2;
int extra_h = (screen_h - video_rescale_h) / 2;
if (Cmdline_window)
{
rect.right += GetSystemMetrics(SM_CXFIXEDFRAME) * 2;
rect.bottom += 2 * GetSystemMetrics(SM_CYFIXEDFRAME) + GetSystemMetrics(SM_CYCAPTION);
}
if(SetWindowPos(ghApp, 0, 0, 0, rect.right, rect.bottom, SWP_NOMOVE | SWP_NOOWNERZORDER) == FALSE) {
MessageBox(ghApp,"Failed SetWindowPos","Error", MB_OK);
}
JIF(pVW->SetWindowPosition(extra_w, extra_h, video_rescale_w, video_rescale_h));
return hr;
}
void CheckVisibility(void)
{
long lVisible;
HRESULT hr;
if ((!pVW) || (!pBV))
{
// Audio-only files have no video interfaces. This might also
// be a file whose video component uses an unknown video codec.
g_bAudioOnly = TRUE;
return;
}
else
{
// Clear the global flag
g_bAudioOnly = FALSE;
}
hr = pVW->get_Visible(&lVisible);
if (FAILED(hr))
{
// If this is an audio-only clip, get_Visible() won't work.
//
// Also, if this video is encoded with an unsupported codec,
// we won't see any video, although the audio will work if it is
// of a supported format.
//
if (hr == E_NOINTERFACE)
{
g_bAudioOnly = TRUE;
}
else
{
Msg(TEXT("Failed(%08lx) in pVW->get_Visible()!\r\n"), hr);
}
}
}
bool OpenClip(HWND ghApp, char *g_szFileName)
{
// Reset status variables
g_psCurrent = Stopped;
g_lVolume = VOLUME_FULL;
// Start playing the media file
HRESULT hr = PlayMovieInWindow(ghApp, g_szFileName);
// If we couldn't play the clip, clean up
if (FAILED(hr)) {
CloseClip(ghApp);
return false;
}
return true;
}
void CloseClip(HWND ghApp)
{
HRESULT hr;
// Stop media playback
if(pMC)
hr = pMC->Stop();
// Clear global flags
g_psCurrent = Stopped;
g_bAudioOnly = TRUE;
// Free DirectShow interfaces
CloseInterfaces();
// No current media state
g_psCurrent = Init;
}
void CloseInterfaces(void)
{
// Relinquish ownership (IMPORTANT!) after hiding video window
if(pVW)
pVW->put_Visible(OAFALSE);
// Disable event callbacks
if (pME)
pME->SetNotifyWindow((OAHWND)NULL, 0, 0);
// Release and zero DirectShow interfaces
SAFE_RELEASE(pME);
SAFE_RELEASE(pMS);
SAFE_RELEASE(pMP);
SAFE_RELEASE(pMC);
SAFE_RELEASE(pBA);
SAFE_RELEASE(pBV);
SAFE_RELEASE(pVW);
SAFE_RELEASE(pGB);
}
void Msg(TCHAR *szFormat, ...)
{
TCHAR szBuffer[512]; // Large buffer for very long filenames (like HTTP)
// Format the input string
va_list pArgs;
va_start(pArgs, szFormat);
_vstprintf(szBuffer, szFormat, pArgs);
va_end(pArgs);
// Display a message box with the formatted string
MessageBox(NULL, szBuffer, TEXT("PlayWnd Sample"), MB_OK);
}
// returns true when finished
bool dx8show_stream_movie(void)
{
LONG evCode, evParam1, evParam2;
HRESULT hr=S_OK;
// Make sure that we don't access the media event interface
// after it has already been released.
if (!pME) {
return S_OK;
}
// Process all queued events
while(SUCCEEDED(pME->GetEvent(&evCode, &evParam1,&evParam2, 0))) {
// Free memory associated with callback, since we're not using it
hr = pME->FreeEventParams(evCode, evParam1, evParam2);
// If this is the end of the clip, reset to beginning
if(EC_COMPLETE == evCode)
{
return true;
}
}
return false;
}
-11
View File
@@ -1,11 +0,0 @@
#ifndef _DX8SHOW_HEADER_FILE
#define _DX8SHOW_HEADER_FILE
bool OpenClip(HWND ghApp, char *g_szFileName);
void CloseClip(HWND ghApp);
bool dx8show_stream_movie(void);
void PassMsgToVideoWindow(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);
#endif
Binary file not shown.
Binary file not shown.
-132
View File
@@ -1,132 +0,0 @@
/*==========================================================================;
*
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
*
* File: async.h
* Content: AsyncData object include file
***************************************************************************/
#ifndef __ASYNC_INCLUDED__
#define __ASYNC_INCLUDED__
#include <ole2.h> // for DECLARE_INTERFACE and HRESULT
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* GUIDS used by DPAsyncData objects
*/
// {47BCD7E0-2E89-11d0-A889-00A0C905433C}
DEFINE_GUID(IID_IDPAsyncData, 0x47bcd7e0, 0x2e89, 0x11d0, 0xa8, 0x89, 0x0, 0xa0, 0xc9, 0x5, 0x43, 0x3c);
/****************************************************************************
*
* IDPAsyncData Structures
*
* Various structures used to invoke DPAsyncData.
*
****************************************************************************/
typedef struct IDPAsyncData FAR *LPDPASYNCDATA;
/****************************************************************************
*
* IDPAsyncData Interface
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDPAsyncData
DECLARE_INTERFACE_( IDPAsyncData, IUnknown )
{
/* IUnknown Methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDPAsyncData Methods */
STDMETHOD(AddItem) (THIS_ LPDWORD, LPVOID, DWORD) PURE;
STDMETHOD(Cancel) (THIS) PURE;
STDMETHOD(GetFlags) (THIS_ LPDWORD) PURE;
STDMETHOD(GetItem) (THIS_ DWORD, LPVOID *) PURE;
STDMETHOD(GetItemCount) (THIS_ LPDWORD) PURE;
STDMETHOD(GetStatus) (THIS_ LPDWORD, LPDWORD, HRESULT *) PURE;
STDMETHOD(IsSnapshotCurrent) (THIS) PURE;
STDMETHOD(RefreshSnapshot) (THIS) PURE;
STDMETHOD(RemoveItem) (THIS_ DWORD) PURE;
STDMETHOD(SetFlags) (THIS_ DWORD) PURE;
STDMETHOD(SetItem) (THIS_ DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetStatus) (THIS_ DWORD) PURE;
STDMETHOD(SetStatusEvent) (THIS_ DWORD, HANDLE) PURE;
};
/****************************************************************************
*
* IDPAsyncData interface macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDPAsyncData_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDPAsyncData_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDPAsyncData_Release(p) (p)->lpVtbl->Release(p)
#define IDPAsyncData_AddItem(p) (p)->lpVtbl->AddItem(p)
#define IDPAsyncData_Cancel(p) (p)->lpVtbl->Cancel(p)
#define IDPAsyncData_GetItem(p,a,b) (p)->lpVtbl->GetItem(p,a,b)
#define IDPAsyncData_GetItemCount(p,a) (p)->lpVtbl->GetItemCount(p,a)
#define IDPAsyncData_GetStatus(p,a,b,c) (p)->lpVtbl->GetStatus(p,a,b,c)
#define IDPAsyncData_IsSnapshotCurrent(p) (p)->lpVtbl->IsSnapshotCurrent(p)
#define IDPAsyncData_RefreshSnapshot(p) (p)->lpVtbl->RefreshSnapshot(p)
#define IDPAsyncData_RemoveItem(p) (p)->lpVtbl->RemoveItem(p)
#define IDPAsyncData_SetFlags(p) (p)->lpVtbl->SetFlags(p)
#define IDPAsyncData_SetItem(p) (p)->lpVtbl->SetItem(p)
#define IDPAsyncData_SetStatus(p) (p)->lpVtbl->SetStatus(p)
#define IDPAsyncData_SetStatusEvent(p,a,b) (p)->lpVtbl->SetStatusEvent(p,a,b)
#else /* C++ */
#define IDPAsyncData_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDPAsyncData_AddRef(p) (p)->AddRef()
#define IDPAsyncData_Release(p) (p)->Release()
#define IDPAsyncData_AddItem(p) (p)->AddItem()
#define IDPAsyncData_Cancel(p) (p)->Cancel()
#define IDPAsyncData_GetItem(p,a,b) (p)->GetItem(a,b)
#define IDPAsyncData_GetItemCount(p,a) (p)->GetItemCount(a)
#define IDPAsyncData_GetStatus(p,a,b,c) (p)->GetStatus(a,b,c)
#define IDPAsyncData_IsSnapshotCurrent(p) (p)->IsSnapshotCurrent()
#define IDPAsyncData_RefreshSnapshot(p) (p)->RefreshSnapshot()
#define IDPAsyncData_RemoveItem(p) (p)->RemoveItem()
#define IDPAsyncData_SetFlags(p) (p)->SetFlags()
#define IDPAsyncData_SetItem(p) (p)->SetItem()
#define IDPAsyncData_SetStatus(p) (p)->SetStatus()
#define IDPAsyncData_SetStatusEvent(p,a,b) (p)->SetStatusEvent(a,b)
#endif
/****************************************************************************
*
* AsyncData Flags
*
****************************************************************************/
/*
* This flag is set if the ItemData is ANSI. If it is not set, the ItemData
* is either Unicode or doesn't contain any string information.
*/
#define DPASYNCDATA_ANSI (0x00000001)
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /* __ASYNC_INCLUDED__ */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
Binary file not shown.
File diff suppressed because it is too large. Load diff
-628
View File
@@ -1,628 +0,0 @@
/*==========================================================================;
*
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dplobby.h
* Content: DirectPlayLobby include file
***************************************************************************/
#ifndef __DPLOBBY_INCLUDED__
#define __DPLOBBY_INCLUDED__
#include "directx/vdplay.h"
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/*
* GUIDS used by DirectPlay objects
*/
/* {AF465C71-9588-11cf-A020-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobby, 0xaf465c71, 0x9588, 0x11cf, 0xa0, 0x20, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {26C66A70-B367-11cf-A024-00AA006157AC} */
DEFINE_GUID(IID_IDirectPlayLobbyA, 0x26c66a70, 0xb367, 0x11cf, 0xa0, 0x24, 0x0, 0xaa, 0x0, 0x61, 0x57, 0xac);
/* {0194C220-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2, 0x194c220, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {1BB4AF80-A303-11d0-9C4F-00A0C905425E} */
DEFINE_GUID(IID_IDirectPlayLobby2A, 0x1bb4af80, 0xa303, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/* {2FE8F810-B2A5-11d0-A787-0000F803ABFC} */
DEFINE_GUID(CLSID_DirectPlayLobby, 0x2fe8f810, 0xb2a5, 0x11d0, 0xa7, 0x87, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/****************************************************************************
*
* IDirectPlayLobby Structures
*
* Various structures used to invoke DirectPlayLobby.
*
****************************************************************************/
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBY;
typedef struct IDirectPlayLobby FAR *LPDIRECTPLAYLOBBYA;
typedef struct IDirectPlayLobby IDirectPlayLobbyA;
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2;
typedef struct IDirectPlayLobby2 FAR *LPDIRECTPLAYLOBBY2A;
typedef struct IDirectPlayLobby2 IDirectPlayLobby2A;
/*
* DPLAPPINFO
* Used to hold information about a registered DirectPlay
* application
*/
typedef struct DPLAPPINFO
{
DWORD dwSize; // Size of this structure
GUID guidApplication; // GUID of the Application
union
{
LPSTR lpszAppNameA; // Pointer to the Application Name
LPWSTR lpszAppName;
};
} DPLAPPINFO, FAR *LPDPLAPPINFO;
/*
* LPCDPLAPPINFO
* A constant pointer to DPLAPPINFO
*/
typedef const DPLAPPINFO FAR *LPCDPLAPPINFO;
/*
* DPCOMPOUNDADDRESSELEMENT
*
* An array of these is passed to CreateCompoundAddresses()
*/
typedef struct DPCOMPOUNDADDRESSELEMENT
{
GUID guidDataType;
DWORD dwDataSize;
LPVOID lpData;
} DPCOMPOUNDADDRESSELEMENT, FAR *LPDPCOMPOUNDADDRESSELEMENT;
/*
* LPCDPCOMPOUNDADDRESSELEMENT
* A constant pointer to DPCOMPOUNDADDRESSELEMENT
*/
typedef const DPCOMPOUNDADDRESSELEMENT FAR *LPCDPCOMPOUNDADDRESSELEMENT;
/****************************************************************************
*
* Enumeration Method Callback Prototypes
*
****************************************************************************/
/*
* Callback for EnumAddress()
*/
typedef BOOL (FAR PASCAL *LPDPENUMADDRESSCALLBACK)(
REFGUID guidDataType,
DWORD dwDataSize,
LPCVOID lpData,
LPVOID lpContext);
/*
* Callback for EnumAddressTypes()
*/
typedef BOOL (FAR PASCAL *LPDPLENUMADDRESSTYPESCALLBACK)(
REFGUID guidDataType,
LPVOID lpContext,
DWORD dwFlags);
/*
* Callback for EnumLocalApplications()
*/
typedef BOOL (FAR PASCAL * LPDPLENUMLOCALAPPLICATIONSCALLBACK)(
LPCDPLAPPINFO lpAppInfo,
LPVOID lpContext,
DWORD dwFlags);
/****************************************************************************
*
* DirectPlayLobby API Prototypes
*
****************************************************************************/
#ifdef UNICODE
#define DirectPlayLobbyCreate DirectPlayLobbyCreateW
#else
#define DirectPlayLobbyCreate DirectPlayLobbyCreateA
#endif /* UNICODE */
extern HRESULT WINAPI DirectPlayLobbyCreateW(LPGUID, LPDIRECTPLAYLOBBY *, IUnknown *, LPVOID, DWORD );
extern HRESULT WINAPI DirectPlayLobbyCreateA(LPGUID, LPDIRECTPLAYLOBBYA *, IUnknown *, LPVOID, DWORD );
/****************************************************************************
*
* IDirectPlayLobby (and IDirectPlayLobbyA) Interface
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayLobby
DECLARE_INTERFACE_( IDirectPlayLobby, IUnknown )
{
/* IUnknown Methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectPlayLobby Methods */
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
};
/****************************************************************************
*
* IDirectPlayLobby2 (and IDirectPlayLobby2A) Interface
*
****************************************************************************/
#undef INTERFACE
#define INTERFACE IDirectPlayLobby2
DECLARE_INTERFACE_( IDirectPlayLobby2, IDirectPlayLobby )
{
/* IUnknown Methods */
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/* IDirectPlayLobby Methods */
STDMETHOD(Connect) (THIS_ DWORD, LPDIRECTPLAY2 *, IUnknown FAR *) PURE;
STDMETHOD(CreateAddress) (THIS_ REFGUID, REFGUID, LPCVOID, DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(EnumAddress) (THIS_ LPDPENUMADDRESSCALLBACK, LPCVOID, DWORD, LPVOID) PURE;
STDMETHOD(EnumAddressTypes) (THIS_ LPDPLENUMADDRESSTYPESCALLBACK, REFGUID, LPVOID, DWORD) PURE;
STDMETHOD(EnumLocalApplications)(THIS_ LPDPLENUMLOCALAPPLICATIONSCALLBACK, LPVOID, DWORD) PURE;
STDMETHOD(GetConnectionSettings)(THIS_ DWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(ReceiveLobbyMessage) (THIS_ DWORD, DWORD, LPDWORD, LPVOID, LPDWORD) PURE;
STDMETHOD(RunApplication) (THIS_ DWORD, LPDWORD, LPDPLCONNECTION, HANDLE) PURE;
STDMETHOD(SendLobbyMessage) (THIS_ DWORD, DWORD, LPVOID, DWORD) PURE;
STDMETHOD(SetConnectionSettings)(THIS_ DWORD, DWORD, LPDPLCONNECTION) PURE;
STDMETHOD(SetLobbyMessageEvent) (THIS_ DWORD, DWORD, HANDLE) PURE;
/* IDirectPlayLobby2 Methods */
STDMETHOD(CreateCompoundAddress)(THIS_ LPCDPCOMPOUNDADDRESSELEMENT,DWORD,LPVOID,LPDWORD) PURE;
};
/****************************************************************************
*
* IDirectPlayLobby interface macros
*
****************************************************************************/
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectPlayLobby_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectPlayLobby_Release(p) (p)->lpVtbl->Release(p)
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->lpVtbl->Connect(p,a,b,c)
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->lpVtbl->CreateAddress(p,a,b,c,d,e,f)
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(p,a,b,c,d)
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->lpVtbl->EnumAddress(p,a,b,c,d)
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->lpVtbl->EnumAddressTypes(p,a,b,c,d)
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->lpVtbl->EnumLocalApplications(p,a,b,c)
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->lpVtbl->GetConnectionSettings(p,a,b,c)
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->lpVtbl->ReceiveLobbyMessage(p,a,b,c,d,e)
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->lpVtbl->RunApplication(p,a,b,c,d)
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->lpVtbl->SendLobbyMessage(p,a,b,c,d)
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->lpVtbl->SetConnectionSettings(p,a,b,c)
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->lpVtbl->SetLobbyMessageEvent(p,a,b,c)
#else /* C++ */
#define IDirectPlayLobby_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectPlayLobby_AddRef(p) (p)->AddRef()
#define IDirectPlayLobby_Release(p) (p)->Release()
#define IDirectPlayLobby_Connect(p,a,b,c) (p)->Connect(a,b,c)
#define IDirectPlayLobby_CreateAddress(p,a,b,c,d,e,f) (p)->CreateAddress(a,b,c,d,e,f)
#define IDirectPlayLobby_CreateCompoundAddress(p,a,b,c,d) (p)->lpVtbl->CreateCompoundAddress(a,b,c,d)
#define IDirectPlayLobby_EnumAddress(p,a,b,c,d) (p)->EnumAddress(a,b,c,d)
#define IDirectPlayLobby_EnumAddressTypes(p,a,b,c,d) (p)->EnumAddressTypes(a,b,c,d)
#define IDirectPlayLobby_EnumLocalApplications(p,a,b,c) (p)->EnumLocalApplications(a,b,c)
#define IDirectPlayLobby_GetConnectionSettings(p,a,b,c) (p)->GetConnectionSettings(a,b,c)
#define IDirectPlayLobby_ReceiveLobbyMessage(p,a,b,c,d,e) (p)->ReceiveLobbyMessage(a,b,c,d,e)
#define IDirectPlayLobby_RunApplication(p,a,b,c,d) (p)->RunApplication(a,b,c,d)
#define IDirectPlayLobby_SendLobbyMessage(p,a,b,c,d) (p)->SendLobbyMessage(a,b,c,d)
#define IDirectPlayLobby_SetConnectionSettings(p,a,b,c) (p)->SetConnectionSettings(a,b,c)
#define IDirectPlayLobby_SetLobbyMessageEvent(p,a,b,c) (p)->SetLobbyMessageEvent(a,b,c)
#endif
/****************************************************************************
*
* DirectPlayLobby Flags
*
****************************************************************************/
/*
* This is a message flag used by ReceiveLobbyMessage. It can be
* returned in the dwMessageFlags parameter to indicate a message from
* the system.
*/
#define DPLMSG_SYSTEM 0x00000001
/*
* This is a message flag used by ReceiveLobbyMessage and SendLobbyMessage.
* It is used to indicate that the message is a standard lobby message.
* DPLMSG_SETPROPERTY, DPLMSG_SETPROPERTYRESPONSE, DPLMSG_GETPROPERTY,
* DPLMSG_GETPROPERTYRESPONSE
*/
#define DPLMSG_STANDARD 0x00000002
/****************************************************************************
*
* DirectPlayLobby messages and message data structures
*
* All system messages have a dwMessageFlags value of DPLMSG_SYSTEM returned
* from a call to ReceiveLobbyMessage.
*
* All standard messages have a dwMessageFlags value of DPLMSG_STANDARD returned
* from a call to ReceiveLobbyMessage.
*
****************************************************************************/
/*
* DPLMSG_GENERIC
* Generic message structure used to identify the message type.
*/
typedef struct _DPLMSG_GENERIC
{
DWORD dwType; // Message type
} DPLMSG_GENERIC, FAR *LPDPLMSG_GENERIC;
/*
* DPLMSG_SETPROPERTY
* Standard message sent by an application to a lobby to set a
* property
*/
typedef struct _DPLMSG_SETPROPERTY
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID (DPL_NOCONFIRMATION if no confirmation desired)
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
DWORD dwDataSize; // Size of data
DWORD dwPropertyData[1]; // Buffer containing data
} DPLMSG_SETPROPERTY, FAR *LPDPLMSG_SETPROPERTY;
#define DPL_NOCONFIRMATION 0
/*
* DPLMSG_SETPROPERTYRESPONSE
* Standard message returned by a lobby to confirm a
* DPLMSG_SETPROPERTY message.
*/
typedef struct _DPLMSG_SETPROPERTYRESPONSE
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
HRESULT hr; // Return Code
} DPLMSG_SETPROPERTYRESPONSE, FAR *LPDPLMSG_SETPROPERTYRESPONSE;
/*
* DPLMSG_GETPROPERTY
* Standard message sent by an application to a lobby to request
* the current value of a property
*/
typedef struct _DPLMSG_GETPROPERTY
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
} DPLMSG_GETPROPERTY, FAR *LPDPLMSG_GETPROPERTY;
/*
* DPLMSG_GETPROPERTYRESPONSE
* Standard message returned by a lobby in response to a
* DPLMSG_GETPROPERTY message.
*/
typedef struct _DPLMSG_GETPROPERTYRESPONSE
{
DWORD dwType; // Message type
DWORD dwRequestID; // Request ID
GUID guidPlayer; // Player GUID
GUID guidPropertyTag; // Property GUID
HRESULT hr; // Return Code
DWORD dwDataSize; // Size of data
DWORD dwPropertyData[1]; // Buffer containing data
} DPLMSG_GETPROPERTYRESPONSE, FAR *LPDPLMSG_GETPROPERTYRESPONSE;
/******************************************
*
* DirectPlay Lobby message dwType values
*
*****************************************/
/*
* The application has read the connection settings.
* It is now O.K. for the lobby client to release
* its IDirectPlayLobby interface.
*/
#define DPLSYS_CONNECTIONSETTINGSREAD 0x00000001
/*
* The application's call to DirectPlayConnect failed
*/
#define DPLSYS_DPLAYCONNECTFAILED 0x00000002
/*
* The application has created a DirectPlay session.
*/
#define DPLSYS_DPLAYCONNECTSUCCEEDED 0x00000003
/*
* The application has terminated.
*/
#define DPLSYS_APPTERMINATED 0x00000004
/*
* The message is a DPLMSG_SETPROPERTY message.
*/
#define DPLSYS_SETPROPERTY 0x00000005
/*
* The message is a DPLMSG_SETPROPERTYRESPONSE message.
*/
#define DPLSYS_SETPROPERTYRESPONSE 0x00000006
/*
* The message is a DPLMSG_GETPROPERTY message.
*/
#define DPLSYS_GETPROPERTY 0x00000007
/*
* The message is a DPLMSG_GETPROPERTYRESPONSE message.
*/
#define DPLSYS_GETPROPERTYRESPONSE 0x00000008
/****************************************************************************
*
* DirectPlay defined property GUIDs and associated data structures
*
****************************************************************************/
/*
* DPLPROPERTY_MessagesSupported
*
* Request whether the lobby supports standard. Lobby with respond with either
* TRUE or FALSE or may not respond at all.
*
* Property data is a single BOOL with TRUE or FALSE
*/
// {762CCDA1-D916-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_MessagesSupported,
0x762ccda1, 0xd916, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLPROPERTY_LobbyGuid
*
* Request the GUID that identifies the lobby software that the application
* is communicating with.
*
* Property data is a single GUID.
*/
// {F56920A0-D218-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_LobbyGuid,
0xf56920a0, 0xd218, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLPROPERTY_PlayerGuid
*
* Request the GUID that identifies the player on this machine for sending
* property data back to the lobby.
*
* Property data is the DPLDATA_PLAYERDATA structure
*/
// {B4319322-D20D-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_PlayerGuid,
0xb4319322, 0xd20d, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLDATA_PLAYERGUID
*
* Data structure to hold the GUID of the player and player creation flags
* from the lobby.
*/
typedef struct _DPLDATA_PLAYERGUID
{
GUID guidPlayer;
DWORD dwPlayerFlags;
} DPLDATA_PLAYERGUID, FAR *LPDPLDATA_PLAYERGUID;
/*
* DPLPROPERTY_PlayerScore
*
* Used to send an array of long integers to the lobby indicating the
* score of a player.
*
* Property data is the DPLDATA_PLAYERSCORE structure.
*/
// {48784000-D219-11d0-BA39-00C04FD7ED67}
DEFINE_GUID(DPLPROPERTY_PlayerScore,
0x48784000, 0xd219, 0x11d0, 0xba, 0x39, 0x0, 0xc0, 0x4f, 0xd7, 0xed, 0x67);
/*
* DPLDATA_PLAYERSCORE
*
* Data structure to hold an array of long integers representing a player score.
* Application must allocate enough memory to hold all the scores.
*/
typedef struct _DPLDATA_PLAYERSCORE
{
DWORD dwScoreCount;
LONG Score[1];
} DPLDATA_PLAYERSCORE, FAR *LPDPLDATA_PLAYERSCORE;
/****************************************************************************
*
* DirectPlay Address ID's
*
****************************************************************************/
/* DirectPlay Address
*
* A DirectPlay address consists of multiple chunks of data, each tagged
* with a GUID signifying the type of data in the chunk. The chunk also
* has a length so that unknown chunk types can be skipped.
*
* The EnumAddress() function is used to parse these address data chunks.
*/
/*
* DPADDRESS
*
* Header for block of address data elements
*/
typedef struct _DPADDRESS
{
GUID guidDataType;
DWORD dwDataSize;
} DPADDRESS;
typedef DPADDRESS FAR *LPDPADDRESS;
/*
* DPAID_TotalSize
*
* Chunk is a DWORD containing size of entire DPADDRESS structure
*/
// {1318F560-912C-11d0-9DAA-00A0C90A43CB}
DEFINE_GUID(DPAID_TotalSize,
0x1318f560, 0x912c, 0x11d0, 0x9d, 0xaa, 0x0, 0xa0, 0xc9, 0xa, 0x43, 0xcb);
/*
* DPAID_ServiceProvider
*
* Chunk is a GUID describing the service provider that created the chunk.
* All addresses must contain this chunk.
*/
// {07D916C0-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_ServiceProvider,
0x7d916c0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_LobbyProvider
*
* Chunk is a GUID describing the lobby provider that created the chunk.
* All addresses must contain this chunk.
*/
// {59B95640-9667-11d0-A77D-0000F803ABFC}
DEFINE_GUID(DPAID_LobbyProvider,
0x59b95640, 0x9667, 0x11d0, 0xa7, 0x7d, 0x0, 0x0, 0xf8, 0x3, 0xab, 0xfc);
/*
* DPAID_Phone and DPAID_PhoneW
*
* Chunk is a string containing a phone number (i.e. "1-800-555-1212")
* in ANSI or UNICODE format
*/
// {78EC89A0-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_Phone,
0x78ec89a0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
// {BA5A7A70-9DBF-11d0-9CC1-00A0C905425E}
DEFINE_GUID(DPAID_PhoneW,
0xba5a7a70, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_Modem and DPAID_ModemW
*
* Chunk is a string containing a modem name registered with TAPI
* in ANSI or UNICODE format
*/
// {F6DCC200-A2FE-11d0-9C4F-00A0C905425E}
DEFINE_GUID(DPAID_Modem,
0xf6dcc200, 0xa2fe, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
// {01FD92E0-A2FF-11d0-9C4F-00A0C905425E}
DEFINE_GUID(DPAID_ModemW,
0x1fd92e0, 0xa2ff, 0x11d0, 0x9c, 0x4f, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPAID_Inet and DPAID_InetW
*
* Chunk is a string containing a TCP/IP host name or an IP address
* (i.e. "dplay.microsoft.com" or "137.55.100.173") in ANSI or UNICODE format
*/
// {C4A54DA0-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_INet,
0xc4a54da0, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
// {E63232A0-9DBF-11d0-9CC1-00A0C905425E}
DEFINE_GUID(DPAID_INetW,
0xe63232a0, 0x9dbf, 0x11d0, 0x9c, 0xc1, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/*
* DPCOMPORTADDRESS
*
* Used to specify com port settings. The constants that define baud rate,
* stop bits and parity are defined in WINBASE.H. The constants for flow
* control are given below.
*/
#define DPCPA_NOFLOW 0 // no flow control
#define DPCPA_XONXOFFFLOW 1 // software flow control
#define DPCPA_RTSFLOW 2 // hardware flow control with RTS
#define DPCPA_DTRFLOW 3 // hardware flow control with DTR
#define DPCPA_RTSDTRFLOW 4 // hardware flow control with RTS and DTR
typedef struct _DPCOMPORTADDRESS
{
DWORD dwComPort; // COM port to use (1-4)
DWORD dwBaudRate; // baud rate (100-256k)
DWORD dwStopBits; // no. stop bits (1-2)
DWORD dwParity; // parity (none, odd, even, mark)
DWORD dwFlowControl; // flow control (none, xon/xoff, rts, dtr)
} DPCOMPORTADDRESS;
typedef DPCOMPORTADDRESS FAR *LPDPCOMPORTADDRESS;
/*
* DPAID_ComPort
*
* Chunk contains a DPCOMPORTADDRESS structure defining the serial port.
*/
// {F2F0CE00-E0AF-11cf-9C4E-00A0C905425E}
DEFINE_GUID(DPAID_ComPort,
0xf2f0ce00, 0xe0af, 0x11cf, 0x9c, 0x4e, 0x0, 0xa0, 0xc9, 0x5, 0x42, 0x5e);
/****************************************************************************
*
* dplobby 1.0 obsolete definitions
* Included for compatibility only.
*
****************************************************************************/
#define DPLAD_SYSTEM DPLMSG_SYSTEM
#ifdef __cplusplus
};
#endif /* __cplusplus */
#endif /* __DPLOBBY_INCLUDED__ */
-268
View File
@@ -1,268 +0,0 @@
/*==========================================================================
*
* Copyright (C) 1995-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dsetup.h
* Content: DirectXSetup, error codes and flags
***************************************************************************/
#ifndef __DSETUP_H__
#define __DSETUP_H__
#include <windows.h> // windows stuff
#ifdef _WIN32
#define COM_NO_WINDOWS_H
#include <objbase.h>
#else
#endif
#ifdef __cplusplus
extern "C" {
#endif
// DSETUP Error Codes, must remain compatible with previous setup.
#define DSETUPERR_SUCCESS_RESTART 1
#define DSETUPERR_SUCCESS 0
#define DSETUPERR_BADWINDOWSVERSION -1
#define DSETUPERR_SOURCEFILENOTFOUND -2
#define DSETUPERR_BADSOURCESIZE -3
#define DSETUPERR_BADSOURCETIME -4
#define DSETUPERR_NOCOPY -5
#define DSETUPERR_OUTOFDISKSPACE -6
#define DSETUPERR_CANTFINDINF -7
#define DSETUPERR_CANTFINDDIR -8
#define DSETUPERR_INTERNAL -9
#define DSETUPERR_NTWITHNO3D -10 /* REM: obsolete, you'll never see this */
#define DSETUPERR_UNKNOWNOS -11
#define DSETUPERR_USERHITCANCEL -12
#define DSETUPERR_NOTPREINSTALLEDONNT -13
// DSETUP flags. DirectX 5.0 apps should use these flags only.
#define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */
#define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */
#define DSETUP_DXCORE 0x00010000 /* install DirectX runtime */
#define DSETUP_DIRECTX (DSETUP_DXCORE|DSETUP_DDRAWDRV|DSETUP_DSOUNDDRV)
#define DSETUP_TESTINSTALL 0x00020000 /* just test install, don't do anything */
// These OBSOLETE flags are here for compatibility with pre-DX5 apps only.
// They are present to allow DX3 apps to be recompiled with DX5 and still work.
// DO NOT USE THEM for DX5. They will go away in future DX releases.
#define DSETUP_DDRAW 0x00000001 /* OBSOLETE. install DirectDraw */
#define DSETUP_DSOUND 0x00000002 /* OBSOLETE. install DirectSound */
#define DSETUP_DPLAY 0x00000004 /* OBSOLETE. install DirectPlay */
#define DSETUP_DPLAYSP 0x00000020 /* OBSOLETE. install DirectPlay Providers */
#define DSETUP_DVIDEO 0x00000040 /* OBSOLETE. install DirectVideo */
#define DSETUP_D3D 0x00000200 /* OBSOLETE. install Direct3D */
#define DSETUP_DINPUT 0x00000800 /* OBSOLETE. install DirectInput */
#define DSETUP_DIRECTXSETUP 0x00001000 /* OBSOLETE. install DirectXSetup DLL's */
#define DSETUP_NOUI 0x00002000 /* OBSOLETE. install DirectX with NO UI */
#define DSETUP_PROMPTFORDRIVERS 0x10000000 /* OBSOLETE. prompt when replacing display/audio drivers */
#define DSETUP_RESTOREDRIVERS 0x20000000 /* OBSOLETE. restore display/audio drivers */
//******************************************************************
// DirectX Setup Callback mechanism
//******************************************************************
// DSETUP Message Info Codes, passed to callback as Reason parameter.
#define DSETUP_CB_MSG_NOMESSAGE 0
#define DSETUP_CB_MSG_CANTINSTALL_UNKNOWNOS 1
#define DSETUP_CB_MSG_CANTINSTALL_NT 2
#define DSETUP_CB_MSG_CANTINSTALL_BETA 3
#define DSETUP_CB_MSG_CANTINSTALL_NOTWIN32 4
#define DSETUP_CB_MSG_CANTINSTALL_WRONGLANGUAGE 5
#define DSETUP_CB_MSG_CANTINSTALL_WRONGPLATFORM 6
#define DSETUP_CB_MSG_PREINSTALL_NT 7
#define DSETUP_CB_MSG_NOTPREINSTALLEDONNT 8
#define DSETUP_CB_MSG_SETUP_INIT_FAILED 9
#define DSETUP_CB_MSG_INTERNAL_ERROR 10
#define DSETUP_CB_MSG_CHECK_DRIVER_UPGRADE 11
#define DSETUP_CB_MSG_OUTOFDISKSPACE 12
#define DSETUP_CB_MSG_BEGIN_INSTALL 13
#define DSETUP_CB_MSG_BEGIN_INSTALL_RUNTIME 14
#define DSETUP_CB_MSG_BEGIN_INSTALL_DRIVERS 15
#define DSETUP_CB_MSG_BEGIN_RESTORE_DRIVERS 16
#define DSETUP_CB_MSG_FILECOPYERROR 17
#define DSETUP_CB_UPGRADE_TYPE_MASK 0x000F
#define DSETUP_CB_UPGRADE_KEEP 0x0001
#define DSETUP_CB_UPGRADE_SAFE 0x0002
#define DSETUP_CB_UPGRADE_FORCE 0x0004
#define DSETUP_CB_UPGRADE_UNKNOWN 0x0008
#define DSETUP_CB_UPGRADE_HASWARNINGS 0x0100
#define DSETUP_CB_UPGRADE_CANTBACKUP 0x0200
#define DSETUP_CB_UPGRADE_DEVICE_ACTIVE 0x0800
#define DSETUP_CB_UPGRADE_DEVICE_DISPLAY 0x1000
#define DSETUP_CB_UPGRADE_DEVICE_MEDIA 0x2000
typedef struct _DSETUP_CB_UPGRADEINFO
{
DWORD UpgradeFlags;
} DSETUP_CB_UPGRADEINFO;
typedef struct _DSETUP_CB_FILECOPYERROR
{
DWORD dwError;
} DSETUP_CB_FILECOPYERROR;
#ifdef _WIN32
//
// Data Structures
//
#ifndef UNICODE_ONLY
typedef struct _DIRECTXREGISTERAPPA {
DWORD dwSize;
DWORD dwFlags;
LPSTR lpszApplicationName;
LPGUID lpGUID;
LPSTR lpszFilename;
LPSTR lpszCommandLine;
LPSTR lpszPath;
LPSTR lpszCurrentDirectory;
} DIRECTXREGISTERAPPA, *PDIRECTXREGISTERAPPA, *LPDIRECTXREGISTERAPPA;
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
typedef struct _DIRECTXREGISTERAPPW {
DWORD dwSize;
DWORD dwFlags;
LPWSTR lpszApplicationName;
LPGUID lpGUID;
LPWSTR lpszFilename;
LPWSTR lpszCommandLine;
LPWSTR lpszPath;
LPWSTR lpszCurrentDirectory;
} DIRECTXREGISTERAPPW, *PDIRECTXREGISTERAPPW, *LPDIRECTXREGISTERAPPW;
#endif //!ANSI_ONLY
#ifdef UNICODE
typedef DIRECTXREGISTERAPPW DIRECTXREGISTERAPP;
typedef PDIRECTXREGISTERAPPW PDIRECTXREGISTERAPP;
typedef LPDIRECTXREGISTERAPPW LPDIRECTXREGISTERAPP;
#else
typedef DIRECTXREGISTERAPPA DIRECTXREGISTERAPP;
typedef PDIRECTXREGISTERAPPA PDIRECTXREGISTERAPP;
typedef LPDIRECTXREGISTERAPPA LPDIRECTXREGISTERAPP;
#endif // UNICODE
//
// API
//
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXSetupA(
HWND hWnd,
LPSTR lpszRootPath,
DWORD dwFlags
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXSetupW(
HWND hWnd,
LPWSTR lpszRootPath,
DWORD dwFlags
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXSetup DirectXSetupW
#else
#define DirectXSetup DirectXSetupA
#endif // !UNICODE
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXDeviceDriverSetupA(
HWND hWnd,
LPSTR lpszDriverClass,
LPSTR lpszDriverPath,
DWORD dwFlags
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXDeviceDriverSetupW(
HWND hWnd,
LPWSTR lpszDriverClass,
LPWSTR lpszDriverPath,
DWORD dwFlags
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupW
#else
#define DirectXDeviceDriverSetup DirectXDeviceDriverSetupA
#endif // !UNICODE
#ifndef UNICODE_ONLY
INT
WINAPI
DirectXRegisterApplicationA(
HWND hWnd,
LPDIRECTXREGISTERAPPA lpDXRegApp
);
#endif //!UNICODE_ONLY
#ifndef ANSI_ONLY
INT
WINAPI
DirectXRegisterApplicationW(
HWND hWnd,
LPDIRECTXREGISTERAPPW lpDXRegApp
);
#endif //!ANSI_ONLY
#ifdef UNICODE
#define DirectXRegisterApplication DirectXRegisterApplicationW
#else
#define DirectXRegisterApplication DirectXRegisterApplicationA
#endif // !UNICODE
INT
WINAPI
DirectXUnRegisterApplication(
HWND hWnd,
LPGUID lpGUID
);
//
// Function Pointers
//
#ifdef UNICODE
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPWSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPWSTR, LPSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPW);
#else
typedef INT (WINAPI * LPDIRECTXSETUP)(HWND, LPSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)(HWND, LPSTR, LPSTR, DWORD);
typedef INT (WINAPI * LPDIRECTXREGISTERAPPLICATION)(HWND, LPDIRECTXREGISTERAPPA);
#endif // UNICODE
typedef DWORD (FAR PASCAL * DSETUP_CALLBACK)(DWORD Reason,
DWORD MsgType, /* Same as flags to MessageBox */
LPSTR szMessage,
LPSTR szName,
void *pInfo);
INT WINAPI DirectXSetupSetCallback(DSETUP_CALLBACK Callback);
INT WINAPI DirectXSetupGetVersion(DWORD *lpdwVersion, DWORD *lpdwMinorVersion);
#endif // WIN32
#ifdef __cplusplus
};
#endif
#endif
-864
View File
@@ -1,864 +0,0 @@
/*==========================================================================;
*
* 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__
Binary file not shown.
-832
View File
@@ -1,832 +0,0 @@
/*==========================================================================;
*
* Copyright (C) 1996-1997 Microsoft Corporation. All Rights Reserved.
*
* File: dvp.h
* Content: DirectDrawVideoPort include file
*
***************************************************************************/
#ifndef __DVP_INCLUDED__
#define __DVP_INCLUDED__
#if defined( _WIN32 ) && !defined( _NO_COM )
#define COM_NO_WINDOWS_H
#include <objbase.h>
#else
#define IUnknown void
#undef CO_E_NOTINITIALIZED
#define CO_E_NOTINITIALIZED 0x800401F0L
#endif
#ifdef __cplusplus
extern "C" {
#endif
/*
* GUIDS used by DirectDrawVideoPort objects
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
DEFINE_GUID( IID_IDDVideoPortContainer, 0x6C142760,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
DEFINE_GUID( IID_IDirectDrawVideoPort, 0xB36D93E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFH, 0x54F39980L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_E_HREFH_VREFL, 0x92783220L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFH, 0xA07A02E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_E_HREFL_VREFL, 0xE09C77E0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_CCIR656, 0xFCA326A0L,0xDA60,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_BROOKTREE, 0x1352A560L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
DEFINE_GUID( DDVPTYPE_PHILIPS, 0x332CF160L,0xDA61,0x11CF,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8);
/*
* GUIDS used to describe connections
*/
#endif
/*============================================================================
*
* DirectDraw Structures
*
* Various structures used to invoke DirectDraw.
*
*==========================================================================*/
struct IDirectDraw;
struct IDirectDrawSurface;
struct IDirectDrawPalette;
struct IDirectDrawClipper;
typedef struct IDDVideoPortContainer FAR *LPDDVIDEOPORTCONTAINER;
typedef struct IDirectDrawVideoPort FAR *LPDIRECTDRAWVIDEOPORT;
typedef struct _DDVIDEOPORTCONNECT FAR *LPDDVIDEOPORTCONNECT;
typedef struct _DDVIDEOPORTCAPS FAR *LPDDVIDEOPORTCAPS;
typedef struct _DDVIDEOPORTDESC FAR *LPDDVIDEOPORTDESC;
typedef struct _DDVIDEOPORTINFO FAR *LPDDVIDEOPORTINFO;
typedef struct _DDVIDEOPORTBANDWIDTH FAR *LPDDVIDEOPORTBANDWIDTH;
typedef struct _DDVIDEOPORTSTATUS FAR *LPDDVIDEOPORTSTATUS;
typedef struct IDDVideoPortContainerVtbl DDVIDEOPORTCONTAINERCALLBACKS;
typedef struct IDirectDrawVideoPortVtbl DIRECTDRAWVIDEOPORTCALLBACKS;
/*
* API's
*/
typedef HRESULT (FAR PASCAL * LPDDENUMVIDEOCALLBACK)(LPDDVIDEOPORTCAPS, LPVOID);
/*
* INTERACES FOLLOW:
* IDirectDrawVideoPort
* IVideoPort
*/
/*
* IDirectDrawVideoPortContainer
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
#undef INTERFACE
#define INTERFACE IDDVideoPortContainer
DECLARE_INTERFACE_( IDDVideoPortContainer, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IDirectDrawVideoPort methods ***/
STDMETHOD(CreateVideoPort)(THIS_ DWORD, LPDDVIDEOPORTDESC, LPDIRECTDRAWVIDEOPORT FAR *, IUnknown FAR *) PURE;
STDMETHOD(EnumVideoPorts)(THIS_ DWORD, LPDDVIDEOPORTCAPS, LPVOID,LPDDENUMVIDEOCALLBACK ) PURE;
STDMETHOD(GetVideoPortConnectInfo)(THIS_ DWORD, LPDWORD, LPDDVIDEOPORTCONNECT ) PURE;
STDMETHOD(QueryVideoPortStatus)(THIS_ DWORD, LPDDVIDEOPORTSTATUS ) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->lpVtbl->QueryInterface(p, a, b)
#define IVideoPortContainer_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IVideoPortContainer_Release(p) (p)->lpVtbl->Release(p)
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->lpVtbl->CreateVideoPort(p, a, b, c, d)
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->lpVtbl->EnumVideoPorts(p, a, b, c, d)
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->lpVtbl->GetVideoPortConnectInfo(p, a, b, c)
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->lpVtbl->QueryVideoPortStatus(p, a, b)
#else
#define IVideoPortContainer_QueryInterface(p, a, b) (p)->QueryInterface(a, b)
#define IVideoPortContainer_AddRef(p) (p)->AddRef()
#define IVideoPortContainer_Release(p) (p)->Release()
#define IVideoPortContainer_CreateVideoPort(p, a, b, c, d) (p)->CreateVideoPort(a, b, c, d)
#define IVideoPortContainer_EnumVideoPorts(p, a, b, c, d) (p)->EnumVideoPorts(a, b, c, d)
#define IVideoPortContainer_GetVideoPortConnectInfo(p, a, b, c) (p)->GetVideoPortConnectInfo(a, b, c)
#define IVideoPortContainer_QueryVideoPortStatus(p, a, b) (p)->QueryVideoPortStatus(a, b)
#endif
#endif
/*
* IDirectDrawVideoPort
*/
#if defined( _WIN32 ) && !defined( _NO_COM )
#undef INTERFACE
#define INTERFACE IDirectDrawVideoPort
DECLARE_INTERFACE_( IDirectDrawVideoPort, IUnknown )
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface) (THIS_ REFIID riid, LPVOID FAR * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef) (THIS) PURE;
STDMETHOD_(ULONG,Release) (THIS) PURE;
/*** IVideoPort methods ***/
STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
STDMETHOD(GetBandwidthInfo)(THIS_ LPDDPIXELFORMAT, DWORD, DWORD, DWORD, LPDDVIDEOPORTBANDWIDTH) PURE;
STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
STDMETHOD(GetInputFormats)(THIS_ LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
STDMETHOD(GetOutputFormats)(THIS_ LPDDPIXELFORMAT, LPDWORD, LPDDPIXELFORMAT, DWORD) PURE;
STDMETHOD(GetFieldPolarity)(THIS_ LPBOOL) PURE;
STDMETHOD(GetVideoLine)(THIS_ LPDWORD) PURE;
STDMETHOD(GetVideoSignalStatus)(THIS_ LPDWORD) PURE;
STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL) PURE;
STDMETHOD(SetTargetSurface)(THIS_ LPDIRECTDRAWSURFACE, DWORD) PURE;
STDMETHOD(StartVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
STDMETHOD(StopVideo)(THIS) PURE;
STDMETHOD(UpdateVideo)(THIS_ LPDDVIDEOPORTINFO) PURE;
STDMETHOD(WaitForSync)(THIS_ DWORD, DWORD, DWORD) PURE;
};
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IVideoPort_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IVideoPort_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IVideoPort_Release(p) (p)->lpVtbl->Release(p)
#define IVideoPort_SetTargetSurface(p,a,b) (p)->lpVtbl->SetTargetSurface(p,a,b)
#define IVideoPort_Flip(p,a,b) (p)->lpVtbl->Flip(p,a,b)
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->lpVtbl->GetBandwidthInfo(p,a,b,c,d,e)
#define IVideoPort_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a)
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->lpVtbl->GetInputFormats(p,a,b,c)
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->lpVtbl->GetOutputFormats(p,a,b,c,d)
#define IVideoPort_GetFieldPolarity(p,a) (p)->lpVtbl->GetFieldPolarity(p,a)
#define IVideoPort_GetVideoLine(p,a) (p)->lpVtbl->GetVideoLine(p,a)
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->lpVtbl->GetVideoSignalStatus(p,a)
#define IVideoPort_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a)
#define IVideoPort_StartVideo(p,a) (p)->lpVtbl->StartVideo(p,a)
#define IVideoPort_StopVideo(p) (p)->lpVtbl->StopVideo(p)
#define IVideoPort_UpdateVideo(p,a) (p)->lpVtbl->UpdateVideo(p,a)
#define IVideoPort_WaitForSync(p,a,b,c) (p)->lpVtbl->WaitForSync(p,a,b,c)
#else
#define IVideoPort_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IVideoPort_AddRef(p) (p)->AddRef()
#define IVideoPort_Release(p) (p)->Release()
#define IVideoPort_SetTargetSurface(p,a,b) (p)->SetTargetSurface(a,b)
#define IVideoPort_Flip(p,a,b) (p)->Flip(a,b)
#define IVideoPort_GetBandwidthInfo(p,a,b,c,d,e) (p)->GetBandwidthInfo(a,b,c,d,e)
#define IVideoPort_GetColorControls(p,a) (p)->GetColorControls(a)
#define IVideoPort_GetInputFormats(p,a,b,c) (p)->GetInputFormats(a,b,c)
#define IVideoPort_GetOutputFormats(p,a,b,c,d) (p)->GetOutputFormats(a,b,c,d)
#define IVideoPort_GetFieldPolarity(p,a) (p)->GetFieldPolarity(a)
#define IVideoPort_GetVideoLine(p,a) (p)->GetVideoLine(a)
#define IVideoPort_GetVideoSignalStatus(p,a) (p)->GetVideoSignalStatus(a)
#define IVideoPort_SetColorControls(p,a) (p)->SetColorControls(a)
#define IVideoPort_StartVideo(p,a) (p)->StartVideo(a)
#define IVideoPort_StopVideo(p) (p)->StopVideo()
#define IVideoPort_UpdateVideo(p,a) (p)->UpdateVideo(a)
#define IVideoPort_WaitForSync(p,a,b,c) (p)->WaitForSync(a,b,c)
#endif
#endif
/*
* DDVIDEOPORTCONNECT
*/
typedef struct _DDVIDEOPORTCONNECT
{
DWORD dwSize; // size of the DDVIDEOPORTCONNECT structure
DWORD dwPortWidth; // Width of the video port
GUID guidTypeID; // Description of video port connection
DWORD dwFlags; // Connection flags
DWORD dwReserved1; // Reserved, set to zero.
} DDVIDEOPORTCONNECT;
/*
* DDVIDEOPORTCAPS
*/
typedef struct _DDVIDEOPORTCAPS
{
DWORD dwSize; // size of the DDVIDEOPORTCAPS structure
DWORD dwFlags; // indicates which fields contain data
DWORD dwMaxWidth; // max width of the video port field
DWORD dwMaxVBIWidth; // max width of the VBI data
DWORD dwMaxHeight; // max height of the video port field
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
DWORD dwCaps; // Video port capabilities
DWORD dwFX; // More video port capabilities
DWORD dwNumAutoFlipSurfaces; // Number of autoflippable surfaces
DWORD dwAlignVideoPortBoundary; // Byte restriction of placement within the surface
DWORD dwAlignVideoPortPrescaleWidth;// Byte restriction of width after prescaling
DWORD dwAlignVideoPortCropBoundary; // Byte restriction of left cropping
DWORD dwAlignVideoPortCropWidth; // Byte restriction of cropping width
DWORD dwPreshrinkXStep; // Width can be shrunk in steps of 1/x
DWORD dwPreshrinkYStep; // Height can be shrunk in steps of 1/x
DWORD dwNumVBIAutoFlipSurfaces; // Number of VBI autoflippable surfaces
DWORD dwReserved1; // Reserved for future use
DWORD dwReserved2; // Reserved for future use
} DDVIDEOPORTCAPS;
/*
* The dwMaxWidth and dwMaxVBIWidth members are valid
*/
#define DDVPD_WIDTH 0x00000001l
/*
* The dwMaxHeight member is valid
*/
#define DDVPD_HEIGHT 0x00000002l
/*
* The dwVideoPortID member is valid
*/
#define DDVPD_ID 0x00000004l
/*
* The dwCaps member is valid
*/
#define DDVPD_CAPS 0x00000008l
/*
* The dwFX member is valid
*/
#define DDVPD_FX 0x00000010l
/*
* The dwNumAutoFlipSurfaces member is valid
*/
#define DDVPD_AUTOFLIP 0x00000020l
/*
* All of the alignment members are valid
*/
#define DDVPD_ALIGN 0x00000040l
/*
* DDVIDEOPORTDESC
*/
typedef struct _DDVIDEOPORTDESC
{
DWORD dwSize; // size of the DDVIDEOPORTDESC structure
DWORD dwFieldWidth; // width of the video port field
DWORD dwVBIWidth; // width of the VBI data
DWORD dwFieldHeight; // height of the video port field
DWORD dwMicrosecondsPerField; // Microseconds per video field
DWORD dwMaxPixelsPerSecond; // Maximum pixel rate per second
DWORD dwVideoPortID; // Video port ID (0 - (dwMaxVideoPorts -1))
DWORD dwReserved1; // Reserved for future use - set to zero
DDVIDEOPORTCONNECT VideoPortType; // Description of video port connection
DWORD dwReserved2; // Reserved for future use - set to zero
DWORD dwReserved3; // Reserved for future use - set to zero
} DDVIDEOPORTDESC;
/*
* DDVIDEOPORTINFO
*/
typedef struct _DDVIDEOPORTINFO
{
DWORD dwSize; // Size of the structure
DWORD dwOriginX; // Placement of the video data within the surface.
DWORD dwOriginY; // Placement of the video data within the surface.
DWORD dwVPFlags; // Video port options
RECT rCrop; // Cropping rectangle (optional).
DWORD dwPrescaleWidth; // Determines pre-scaling/zooming in the X direction (optional).
DWORD dwPrescaleHeight; // Determines pre-scaling/zooming in the Y direction (optional).
LPDDPIXELFORMAT lpddpfInputFormat; // Video format written to the video port
LPDDPIXELFORMAT lpddpfVBIInputFormat; // Input format of the VBI data
LPDDPIXELFORMAT lpddpfVBIOutputFormat;// Output format of the data
DWORD dwVBIHeight; // Specifies the number of lines of data within the vertical blanking interval.
DWORD dwReserved1; // Reserved for future use - set to zero
DWORD dwReserved2; // Reserved for future use - set to zero
} DDVIDEOPORTINFO;
/*
* DDVIDEOPORTBANDWIDTH
*/
typedef struct _DDVIDEOPORTBANDWIDTH
{
DWORD dwSize; // Size of the structure
DWORD dwCaps;
DWORD dwOverlay; // Zoom factor at which overlay is supported
DWORD dwColorkey; // Zoom factor at which overlay w/ colorkey is supported
DWORD dwYInterpolate; // Zoom factor at which overlay w/ Y interpolation is supported
DWORD dwYInterpAndColorkey; // Zoom factor at which ovelray w/ Y interpolation and colorkeying is supported
DWORD dwReserved1; // Reserved for future use - set to zero
DWORD dwReserved2; // Reserved for future use - set to zero
} DDVIDEOPORTBANDWIDTH;
/*
* DDVIDEOPORTSTATUS
*/
typedef struct _DDVIDEOPORTSTATUS
{
DWORD dwSize; // Size of the structure
BOOL bInUse; // TRUE if video port is currently being used
DWORD dwFlags; // Currently not used
DWORD dwReserved1; // Reserved for future use
DDVIDEOPORTCONNECT VideoPortType; // Information about the connection
DWORD dwReserved2; // Reserved for future use
DWORD dwReserved3; // Reserved for future use
} DDVIDEOPORTSTATUS;
/*============================================================================
*
* Video Port Flags
*
* All flags are bit flags.
*
*==========================================================================*/
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTCONNECT FLAGS
*
****************************************************************************/
/*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of double clocking the data.
* When this is set by the client, this indicates that the video port
* should enable double clocking. This flag is only valid with external
* syncs.
*/
#define DDVPCONNECT_DOUBLECLOCK 0x00000001l
/*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of using an external VACT
* signal. When this is set by the client, this indicates that the
* video port should use the external VACT signal.
*/
#define DDVPCONNECT_VACT 0x00000002l
/*
* When this is set by the driver and passed to the client, this
* indicates that the video port is capable of treating even fields
* like odd fields and visa versa. When this is set by the client,
* this indicates that the video port should treat even fields like odd
* fields.
*/
#define DDVPCONNECT_INVERTPOLARITY 0x00000004l
/*
* Indicates that any data written to the video port during the VREF
* period will not be written into the frame buffer. This flag is read only.
*/
#define DDVPCONNECT_DISCARDSVREFDATA 0x00000008l
/*
* Device will write half lines into the frame buffer, sometimes causing
* the data to not be displayed correctly.
*/
#define DDVPCONNECT_HALFLINE 0x00000010l
/*
* Indicates that the signal is interlaced. This flag is only
* set by the client.
*/
#define DDVPCONNECT_INTERLACED 0x00000020l
/*
* Indicates that video port is shareable and that this video port
* will use the even fields. This flag is only set by the client.
*/
#define DDVPCONNECT_SHAREEVEN 0x00000040l
/*
* Indicates that video port is shareable and that this video port
* will use the odd fields. This flag is only set by the client.
*/
#define DDVPCONNECT_SHAREODD 0x00000080l
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTDESC CAPS
*
****************************************************************************/
/*
* Flip can be performed automatically to avoid tearing.
*/
#define DDVPCAPS_AUTOFLIP 0x00000001l
/*
* Supports interlaced video
*/
#define DDVPCAPS_INTERLACED 0x00000002l
/*
* Supports non-interlaced video
*/
#define DDVPCAPS_NONINTERLACED 0x00000004l
/*
* Indicates that the device can return whether the current field
* of an interlaced signal is even or odd.
*/
#define DDVPCAPS_READBACKFIELD 0x00000008l
/*
* Indicates that the device can return the current line of video
* being written into the frame buffer.
*/
#define DDVPCAPS_READBACKLINE 0x00000010l
/*
* Allows two gen-locked video streams to share a single video port,
* where one stream uses the even fields and the other uses the odd
* fields. Separate parameters (including address, scaling,
* cropping, etc.) are maintained for both fields.)
*/
#define DDVPCAPS_SHAREABLE 0x00000020l
/*
* Even fields of video can be automatically discarded.
*/
#define DDVPCAPS_SKIPEVENFIELDS 0x00000040l
/*
* Odd fields of video can be automatically discarded.
*/
#define DDVPCAPS_SKIPODDFIELDS 0x00000080l
/*
* Indicates that the device is capable of driving the graphics
* VSYNC with the video port VSYNC.
*/
#define DDVPCAPS_SYNCMASTER 0x00000100l
/*
* Indicates that data within the vertical blanking interval can
* be written to a different surface.
*/
#define DDVPCAPS_VBISURFACE 0x00000200l
/*
* Indicates that the video port can perform color operations
* on the incoming data before it is written to the frame buffer.
*/
#define DDVPCAPS_COLORCONTROL 0x00000400l
/*
* Indicates that the video port can accept VBI data in a different
* width or format than the regular video data.
*/
#define DDVPCAPS_OVERSAMPLEDVBI 0x00000800l
/*
* Indicates that the video port can write data directly to system memory
*/
#define DDVPCAPS_SYSTEMMEMORY 0x00001000l
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTDESC FX
*
****************************************************************************/
/*
* Limited cropping is available to crop out the vertical interval data.
*/
#define DDVPFX_CROPTOPDATA 0x00000001l
/*
* Incoming data can be cropped in the X direction before it is written
* to the surface.
*/
#define DDVPFX_CROPX 0x00000002l
/*
* Incoming data can be cropped in the Y direction before it is written
* to the surface.
*/
#define DDVPFX_CROPY 0x00000004l
/*
* Supports interleaving interlaced fields in memory.
*/
#define DDVPFX_INTERLEAVE 0x00000008l
/*
* Supports mirroring left to right as the video data is written
* into the frame buffer.
*/
#define DDVPFX_MIRRORLEFTRIGHT 0x00000010l
/*
* Supports mirroring top to bottom as the video data is written
* into the frame buffer.
*/
#define DDVPFX_MIRRORUPDOWN 0x00000020l
/*
* Data can be arbitrarily shrunk in the X direction before it
* is written to the surface.
*/
#define DDVPFX_PRESHRINKX 0x00000040l
/*
* Data can be arbitrarily shrunk in the Y direction before it
* is written to the surface.
*/
#define DDVPFX_PRESHRINKY 0x00000080l
/*
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the X
* direction before it is written to the surface.
*/
#define DDVPFX_PRESHRINKXB 0x00000100l
/*
* Data can be binary shrunk (1/2, 1/4, 1/8, etc.) in the Y
* direction before it is written to the surface.
*/
#define DDVPFX_PRESHRINKYB 0x00000200l
/*
* Data can be shrunk in increments of 1/x in the X direction
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkXStep)
* before it is written to the surface.
*/
#define DDVPFX_PRESHRINKXS 0x00000400l
/*
* Data can be shrunk in increments of 1/x in the Y direction
* (where X is specified in the DDVIDEOPORTCAPS.dwPreshrinkYStep)
* before it is written to the surface.
*/
#define DDVPFX_PRESHRINKYS 0x00000800l
/*
* Data can be arbitrarily stretched in the X direction before
* it is written to the surface.
*/
#define DDVPFX_PRESTRETCHX 0x00001000l
/*
* Data can be arbitrarily stretched in the Y direction before
* it is written to the surface.
*/
#define DDVPFX_PRESTRETCHY 0x00002000l
/*
* Data can be integer stretched in the X direction before it is
* written to the surface.
*/
#define DDVPFX_PRESTRETCHXN 0x00004000l
/*
* Data can be integer stretched in the Y direction before it is
* written to the surface.
*/
#define DDVPFX_PRESTRETCHYN 0x00008000l
/*
* Indicates that data within the vertical blanking interval can
* be converted independently of the remaining video data.
*/
#define DDVPFX_VBICONVERT 0x00010000l
/*
* Indicates that scaling can be disabled for data within the
* vertical blanking interval.
*/
#define DDVPFX_VBINOSCALE 0x00020000l
/*
* Indicates that the video data can ignore the left and right
* cropping coordinates when cropping oversampled VBI data.
*/
#define DDVPFX_IGNOREVBIXCROP 0x00040000l
/****************************************************************************
*
* VIDEOPORT DDVIDEOPORTINFO FLAGS
*
****************************************************************************/
/*
* Perform automatic flipping. Auto-flipping is performed between
* the overlay surface that was attached to the video port using
* IDirectDrawVideoPort::AttachSurface and the overlay surfaces that
* are attached to the surface via the IDirectDrawSurface::AttachSurface
* method. The flip order is the order in which the overlay surfaces
* were. attached.
*/
#define DDVP_AUTOFLIP 0x00000001l
/*
* Perform conversion using the ddpfOutputFormat information.
*/
#define DDVP_CONVERT 0x00000002l
/*
* Perform cropping using the specified rectangle.
*/
#define DDVP_CROP 0x00000004l
/*
* Indicates that interlaced fields should be interleaved in memory.
*/
#define DDVP_INTERLEAVE 0x00000008l
/*
* Indicates that the data should be mirrored left to right as it's
* written into the frame buffer.
*/
#define DDVP_MIRRORLEFTRIGHT 0x00000010l
/*
* Indicates that the data should be mirrored top to bottom as it's
* written into the frame buffer.
*/
#define DDVP_MIRRORUPDOWN 0x00000020l
/*
* Perform pre-scaling/zooming based on the pre-scale parameters.
*/
#define DDVP_PRESCALE 0x00000040l
/*
* Ignore input of even fields.
*/
#define DDVP_SKIPEVENFIELDS 0x00000080l
/*
* Ignore input of odd fields.
*/
#define DDVP_SKIPODDFIELDS 0x00000100l
/*
* Drive the graphics VSYNCs using the video port VYSNCs.
*/
#define DDVP_SYNCMASTER 0x00000200l
/*
* The ddpfVBIOutputFormatFormat member contains data that should be used
* to convert the data within the vertical blanking interval.
*/
#define DDVP_VBICONVERT 0x00000400l
/*
* Indicates that data within the vertical blanking interval
* should not be scaled.
*/
#define DDVP_VBINOSCALE 0x00000800l
/*
* Indicates that these bob/weave decisions should not be
* overriden by other interfaces.
*/
#define DDVP_OVERRIDEBOBWEAVE 0x00001000l
/*
* Indicates that the video data should ignore the left and right
* cropping coordinates when cropping the VBI data.
*/
#define DDVP_IGNOREVBIXCROP 0x00002000l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT GETINPUTFORMAT/GETOUTPUTFORMAT FLAGS
*
****************************************************************************/
/*
* Return formats for the video data
*/
#define DDVPFORMAT_VIDEO 0x00000001l
/*
* Return formats for the VBI data
*/
#define DDVPFORMAT_VBI 0x00000002l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT SETTARGETSURFACE FLAGS
*
****************************************************************************/
/*
* Surface should receive video data (and VBI data if a surface
* is not explicitly attached for that purpose)
*/
#define DDVPTARGET_VIDEO 0x00000001l
/*
* Surface should receive VBI data
*/
#define DDVPTARGET_VBI 0x00000002l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT WAITFORSYNC FLAGS
*
****************************************************************************/
/*
* Waits until the beginning of the next VSYNC
*/
#define DDVPWAIT_BEGIN 0x00000001l
/*
* Waits until the end of the next/current VSYNC
*/
#define DDVPWAIT_END 0x00000002l
/*
* Waits until the beginning of the specified line
*/
#define DDVPWAIT_LINE 0x00000003l
/****************************************************************************
*
* DIRECTDRAWVIDEOPORT FLIP FLAGS
*
****************************************************************************/
/*
* Flips the normal video surface
*/
#define DDVPFLIP_VIDEO 0x00000001l
/*
* Flips the VBI surface
*/
#define DDVPFLIP_VBI 0x00000002l
/****************************************************************************
*
* DIRIRECTDRAWVIDEOPORT GETVIDEOSIGNALSTATUS VALUES
*
****************************************************************************/
/*
* No video signal is present at the video port
*/
#define DDVPSQ_NOSIGNAL 0x00000001l
/*
* A valid video signal is present at the video port
*/
#define DDVPSQ_SIGNALOK 0x00000002l
/****************************************************************************
*
* VIDEOPORTBANDWIDTH Flags
*
****************************************************************************/
/*
* The specified height/width refer to the size of the video port data
* written into memory, after prescaling has occured.
*/
#define DDVPB_VIDEOPORT 0x00000001l
/*
* The specified height/width refer to the source size of the overlay.
*/
#define DDVPB_OVERLAY 0x00000002l
/*
* This is a query for the device to return which caps this device requires.
*/
#define DDVPB_TYPE 0x00000004l
/****************************************************************************
*
* VIDEOPORTBANDWIDTH Caps
*
****************************************************************************/
/*
* The bandwidth for this device is dependant on the overlay source size.
*/
#define DDVPBCAPS_SOURCE 0x00000001l
/*
* The bandwidth for this device is dependant on the overlay destination
* size.
*/
#define DDVPBCAPS_DESTINATION 0x00000002l
#ifdef __cplusplus
};
#endif
#endif
Loaded 100 of 736 files, more files were not shown because too many files have changed in this diff. Show more