Compare commits

...
3253 Commits
Author SHA1 Message Date
chief1983 104d2d6fce Update trunk version to 3.6.19 to make sure nightlies are now properly indicated as newer than 3.6.18.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9547 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:46 +10:00
karajorma 9531268fd9 Fix Mantis 2797 (Ship Loadout shouldn't remember the previous settings if the mission has changed)
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9544 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:46 +10:00
Goober5000 3c3d1b4bd1 proper movement of ships attached to other ships fixes Mantis #2787
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9542 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:46 +10:00
Goober5000 dc18b7e012 fix Mantis #2796 (capships always have an EMP time of 7.5 seconds) by adding a weapon flag to allow the full value of emp_time to be used
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9540 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:46 +10:00
Zacam 8959ecdc07 Follow up to r9536: re-instate -no_warn, but put it behind a compiler level #ifdef flag to enable the ability to use it. And if you don't know how to do that, you have no business using it.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9539 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:46 +10:00
m_m 7f170217a8 Fixed scripting issue with wrong type conversions.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9538 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 55d4f0b96c follow-up to revision 9127: that commit breaks FSPort (causing part of the nameplated Orions to be translucent), so let's just check that "nameplate" is the entire texture name
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9537 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
The_E 129d02eb0d Removing the -nowarn commandline argument. The encouragement of bad habits is a serious bug.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9536 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
The_E 4bcc9f1716 From AMS: Fix for Mantis 2293: Destroyed/departed AI showing up as present in wingmen display.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9535 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
niffiwan 24037c6e02 Fix for mantis 2786: from Yarn - make +Main Hall: always override +Flags: i.e. so retail-compatible campaigns can use the second main hall in retail and a different main hall in FSO
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9534 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Echelon9 72770939a2 Further spelling fixes, inspired by bugmenot's Mantis 2794
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9533 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
The_E d1e73bd8b7 Followup for 2788: Fix potential issue while looping through subobjects.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9530 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
The_E 6197c20010 Patch for Mantis 2788: Difficulty-based damage scaling does not work
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9529 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 6ab03f2e2b might as well remove this unnecessary temporary variable
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9528 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
niffiwan 37c132318a Fix for mantis 2785: when unpausing sounds, use the previous volume, not the detault
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9527 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Echelon9 93d0af04d2 Resolve uninitialised value warnings in load_gauge_warhead_count()
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9526 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Echelon9 6fceacafd8 Revise Xcode4 project file to support recommended settings of the current Xcode 4.6 release
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9525 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 1409e7d6cf don't throw errors for missing skybox models... we just won't display the skybox
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9524 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 e4d92ae779 don't crash when doing debug stuff
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9523 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
The_E d02ef204a2 Fix a bug caused by an oversight during refactoring. It should be noted that this wouldn't have happened if this code was using normal scoping in for loops (for (int i = 0.....)) instead of having the loop counter be declared in the outer scope.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9522 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
karajorma 8271a12a53 FUBAR's fix for Mantis 2778 (Game_skill_level goes out of range and causes crashes) with some changes by me.
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9520 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 6cab0d12bc no, silly Volition programmer, that's handled elsewhere (fix Mantis #2783)
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9516 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 28b386633b this ought to fix Mantis #2326
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9515 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 c8b5e8e755 correct the sexp help for string-to-int
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9514 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 ebd54319d2 flip these around so that they're less confusing
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9513 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:45 +10:00
Goober5000 94f7a54596 apply m!m's fix for Mantis #2780 also correct the off-by-one error in the range check (path_num must < n_paths, not <=)
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9512 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:44 +10:00
The_E 17a48525e7 Prevent the hud-set-frame sexp from accidentally causing badness by setting an invalid frame offset
git-svn-id: svn://svn.icculus.org/fs2open/trunk@9510 387891d4-d844-0410-90c0-e4c51a9137d3
2013-03-18 20:24:44 +10:00
niffiwan f947a5fb5d Fix for mantis 2776: from onlyjob, fix format-hardening error 2013-01-22 09:57:29 +00:00
m_m cd19783e69 Fix for Mantis 2763: ETS gauge showing up for ships with no shields if default ship had shields 2013-01-19 13:06:51 +00:00
Goober5000 29a0cc5684 tell who is respawning 2013-01-16 07:13:47 +00:00
Goober5000 a916633b46 onlyjob's spelling fixes, per Mantis #2777 2013-01-13 09:50:08 +00:00
Goober5000 4791df1b17 return special_hitpoints to using a specific value instead of a multiplier;
this was extensively tested in both single-player and multiplayer, using change-ship-class and changing ship loadout, against ships both higher and lower in hitpoints, to ensure it didn't re-break Mantis #2326
2013-01-13 09:28:28 +00:00
Goober5000 e26c663c59 wing departure now works 2013-01-13 03:55:09 +00:00
Goober5000 107a61ea13 for Mantis #2097, straighten out the departure code so that goals to warp cause warping, and comm departures use whatever departure method is specified 2013-01-13 03:03:25 +00:00
Goober5000 9cb9e349ac FUBAR's changes for Mantis #2775, plus the addition of the asteroid model 2013-01-13 00:05:21 +00:00
Goober5000 6fe3e087a9 FUBAR's fix for #2779 -- don't crash when launching asteroids 2013-01-12 22:34:30 +00:00
Goober5000 15fb88b8c5 add files to project 2013-01-08 01:56:54 +00:00
Goober5000 9b589d3005 MSVC6 compatibility 2013-01-08 01:44:48 +00:00
Goober5000 ab5c47cdf6 jg18's patch -- don't do irrelevant stuff when we're only querying for flags
see http://www.hard-light.net/forums/index.php?topic=83315.0
2013-01-07 23:33:49 +00:00
chief1983 ef9e06fcb1 Reverting 9491. 2013-01-07 16:33:42 +00:00
Echelon9 85e42f57be Updated Mac Xcode 4 project for the 3.6.16 RC phase 2013-01-07 14:20:24 +00:00
Goober5000 6b62d36e02 change from 1 meter to 0.1 meter 2013-01-07 04:35:36 +00:00
Goober5000 bdb40e07e9 strncpy_s wasn't specified quite right (Mantis #2765) 2013-01-07 04:07:28 +00:00
Goober5000 c610a1f9a2 FUBAR's fix for Mantis #2770
see http://www.hard-light.net/forums/index.php?topic=83122.0
2013-01-07 03:31:46 +00:00
chief1983 2d228279fa Change output filenames to match those used for 3.6.14 releases. 2013-01-06 19:24:49 +00:00
niffiwan 4b2bfd4bf3 autotools: remove extra -lpng that will break compiles if libpng12 is being used 2013-01-06 05:03:33 +00:00
niffiwan 4e4f551c31 Autotools: check for alternate libpng package name (specifically for opensuse) 2013-01-06 04:14:01 +00:00
niffiwan 7f7179f327 Workaround for mantis 2760: re-order struct shield_hit_info to avoid segfault with gcc & -ftree-vectorize 2013-01-03 06:57:53 +00:00
Goober5000 5a4c6c90c4 be mindful of sending ship-create packets for docked ships in multiplayer -- should fix Mantis #2761 2013-01-01 22:22:11 +00:00
niffiwan 45b98592e6 autotools: exclude lua5.2 because it's not (yet) compatible with FSO 2012-12-31 09:34:27 +00:00
Goober5000 154356924e allow alternate spelling 2012-12-30 18:01:02 +00:00
niffiwan 3177815a3c Linux/GCC compilation: -march=athlon64 could cause issues on non-AMD CPUs. Use mtune for more widely compatible binaries.
Also enable SSE/SSE2
2012-12-30 03:36:13 +00:00
The_E 71571e40da Fixes issue with the "no primary linking" weapon flag not working correctly 2012-12-29 23:19:51 +00:00
niffiwan a218b7d37d GCC: make install now installs fs2_open_x.y.z - helps Linux packaging tools 2012-12-27 09:47:35 +00:00
Valathil c8eceec482 Followup to 9454. Only check in the one instance where the crash happened. Ticket 2757 2012-12-25 18:44:09 +00:00
FUBAR-BDHR 8cb31c63e7 Mantis 2759 - Add Warning for null normals on docking points 2012-12-24 06:23:56 +00:00
Valathil 5bce063959 Fix for Mantis 2745: Make it impossible in FRED to select individual ships for reinforcements when in a wing. From FUBAR: Check at mission parse and spit out warnings. 2012-12-23 23:58:58 +00:00
FUBAR-BDHR 2ca8fce056 add -tbp and -jpgtga to the depreciated flags 2012-12-22 23:45:15 +00:00
karajorma a4489e6b97 Fix Mantis 1818 (PXO Login fails ambiguously if you don't have a password or username) 2012-12-21 07:15:07 +00:00
Goober5000 6e77fe5fbb enhance debug warning for Mantis #1951 2012-12-20 07:34:38 +00:00
Valathil 3f3b8c128b Adding an assert to multi_ts_get_team_and_slot so we can get Auto variable data in the crash dump to track down ticket 2757. 2012-12-19 01:58:27 +00:00
Valathil 3fbbaf05fa Fix for Mantis 2738: Reset buffer state before drawing spheres and lines. Additionally fix the new htl outline rendering in fred by setting the outline color. 2012-12-19 00:11:28 +00:00
The_E d702b276ef Rename the model subsystem flag masks to MSS_MODEL_FLAG_MASK and MSS_MODEL_FLAG2_MASK respectively, for readability 2012-12-18 21:55:26 +00:00
The_E 20f7383d4a Fix for Mantis 2513 by Admiral MS: Fixes issues with two ship classes sharing model data. 2012-12-18 21:46:35 +00:00
Valathil 456290db4e Fix for Mantis 2364: Load the relevant thruster bitmaps when switching weapons in lab. 2012-12-18 20:09:08 +00:00
Valathil 1a8a03aba2 Fix for Mantis 1901: Update the displayed ship after the loadout is refreshed. 2012-12-18 19:42:59 +00:00
Valathil 7577bacfbc Fix for Mantis 1928: Recreate the briefing and background dialog when the mission updates. 2012-12-18 18:40:25 +00:00
Valathil 4eaa532ce0 Fix for Mantis 2447: Allow fighters to use anti subsystem weapons when disarming/disabling protected ships. 2012-12-18 17:26:48 +00:00
Goober5000 b3c5bdab7b properly fix the removal of particles (Mantis #2165) 2012-12-17 09:36:40 +00:00
Goober5000 6bb4ae42ae revert revision 9411 in preparation for fixing particles (Mantis #2165) 2012-12-17 08:59:55 +00:00
Goober5000 5b77af048c since invisible textures were loaded as -1, they have to be flagged specially to actually replace real textures (Mantis #2340) 2012-12-17 08:00:17 +00:00
Goober5000 2e2c1afe38 there is actually a way to check for extra sound values per Mantis #2048, and here it is 2012-12-17 05:54:18 +00:00
Valathil 913aeb0753 Fix for Mantis 2199: Reject objects from being clicked on when selection lock is active. 2012-12-17 01:17:19 +00:00
Valathil e1f07390e2 Fix for Mantis 2755: Update weapon_info references after weapon_create to get updates from possible substitution 2012-12-16 14:25:21 +00:00
Valathil 0dc6c8fcf7 Set the 3D flag in the new sounds.tbl parsing. 2012-12-15 22:11:57 +00:00
Valathil f920395b0c Fix for Mantis 2707: Pass the firing turret to weapon_create so it knows where to look for when using $Substitute. 2012-12-15 21:47:51 +00:00
Valathil a4974307f5 Fix for Mantis 2737: Recreate the entire orientation matrix not just the forward vector when ships spawn from docking bays. 2012-12-15 19:51:40 +00:00
The_E 0e3003fc93 Change the default toolset for MSVC2012 to "110-XP", to make builds made with VS2012 XP-compatible. 2012-12-15 10:33:35 +00:00
Goober5000 68cb625ce7 allow saving of invisible textures for replacements (Mantis #2340) 2012-12-15 04:41:52 +00:00
Goober5000 2e783fe37b fix Mantis #2319 (alt names and callsigns aren't properly removed) 2012-12-15 04:36:27 +00:00
Valathil fd125acb19 Fix for Mantis 1978: Add eyepoint directions to cameras; Add guncam view for cameras that are bound to turrets 2012-12-14 22:18:45 +00:00
The_E dee413b32c Fix for Mantis 2754: Reset the frame offset for custom HUD gauges when reinitializing. 2012-12-14 12:07:30 +00:00
karajorma 4cb7e70068 Fix Mantis 2753 (Customised Loadouts sometimes won't save for next time the mission is played). 2012-12-14 09:27:17 +00:00
karajorma 2e96022d5e Fix a couple of event logs. Clean up the operators array. 2012-12-14 08:51:22 +00:00
karajorma eebe54b0b1 Actually fix a bug in Num-ships-in-battle rather than accidentally committing a different minor fix. 2012-12-14 03:31:26 +00:00
karajorma 5c7804cadd Fix a bug in Num-ships-in-battle 2012-12-14 03:28:40 +00:00
Goober5000 b329c4020a fix Mantis #2752 2012-12-13 06:14:04 +00:00
Goober5000 13f1705c1b patch another memory leak 2012-12-13 06:12:24 +00:00
Goober5000 cff8cde651 patch a memory leak 2012-12-13 05:56:28 +00:00
The_E 9ac4d2d0b0 Patch for Mantis 2733: Updates the description for add-nav-waypoint. Also makes it work as intended. 2012-12-12 13:57:34 +00:00
Goober5000 dc66db326a fix compilation 2012-12-11 03:53:53 +00:00
Zacam 0502b4d648 Revert of 9410. Apparently not ready for prime time, what with older compilers that don't seem to understand C++0x types (and complaints about upgrades to enable it), and it apparently (under said compilers) isn't any faster than stdext::hash_set anyway. 2012-12-10 08:23:19 +00:00
The_E f0dee720d9 Fix for Mantis 2733: Adds documentation for the 4th argument for the add-nav-waypoint sexp 2012-12-09 22:47:31 +00:00
The_E 38ba853d9b Rewrite the sexp documentation for most of Kazan's navpoint sexps to follow the formatting established by the rest of the sexp docs. 2012-12-09 22:36:17 +00:00
Valathil ec32829615 Fix for Mantis 184: Use Vertex shader to replicate nohtl rendering of thruster cones. Also make shader state handling a bit less hackish. 2012-12-09 21:51:20 +00:00
Valathil 982f7e63ff Fix for Mantis 2146: Move the model_clear_instance call so it doesn't reset the replaced texture. 2012-12-09 21:49:20 +00:00
Zacam e43f9dcc83 Fixes Mantis 2706: Weapons not colliding 2012-12-09 06:28:56 +00:00
Zacam fc51dde285 Fixes Mantis 2325: View shakes in 'show ship' flag when far from the mission origin 2012-12-09 04:28:44 +00:00
Zacam 71a9ab8b7d Fix for Mantis 1496: Ships stopping mid-waypoint; From Admiral MS 2012-12-09 03:45:27 +00:00
Zacam c10eca5808 Fix for Mantis 2165: Vector iterator becomes invalid in Particle.cpp 2012-12-09 03:31:18 +00:00
Zacam 5f998ff345 Mantis 2746: Fix for geometry batcher, from Valathil. Update for Mac by Echelon9. 2012-12-09 02:59:02 +00:00
The_E a77e9d3376 From CommanderDJ: Patch for Mantis 2009 2012-12-08 20:25:37 +00:00
The_E 01e45dc8e8 Patch for Mantis 2188 by Admiral MS 2012-12-08 20:23:09 +00:00
The_E 8ef4975eee Patch for Mantis 2200 by Eli2 2012-12-08 20:21:25 +00:00
Valathil 01cb063bd4 Fix for Mantis 2693: Fix rotating submodels still colliding even if $no_collision or $no_collision_this_only is set. Also fix ships that have $no_collision on detail0 set colliding with bigger ships. 2012-12-06 20:44:29 +00:00
Goober5000 c811f80f2a set the mini help text to blank if we select an operator
make sure special lists of arguments are checked for mini help text
(Mantis #2020)
2012-12-06 06:50:43 +00:00
Goober5000 0a5392f2aa fix Mantis #1975 2012-12-06 06:14:24 +00:00
Goober5000 301be27e72 1) don't actually copy the ship object, because it has classes
2) fix Mantis #1616 by re-applying the original parsed texture replacements
2012-12-06 04:20:54 +00:00
The_E 291c17f380 Fix for Mantis 1616: Texture replacement data is not copied over when changing ship classes that share models 2012-12-05 19:06:49 +00:00
FUBAR-BDHR b0d7dfc750 Fix for mantis 2748: Wing delay values not reset when using file->new 2012-12-05 18:09:32 +00:00
niffiwan fd7fe0dd9e Goober!!! :) Fix parentheses in r9397 2012-12-05 09:23:29 +00:00
niffiwan 90f25111d9 Fix for mantis 1922: set glowmaps on/off in the hud target box 2012-12-05 09:02:48 +00:00
Goober5000 b11cca1e7d bulletproof the activation and deactivation of shields; this should fix Mantis #2747 2012-12-05 07:45:47 +00:00
Goober5000 5ac69dc1a2 for Mantis #2346 and #1129 -- munge the data if it runs afoul of the warnings 2012-12-05 04:20:45 +00:00
Valathil 3c9130e39b From Mantis 2346: Spit out a warning if the two docking slots lie on the same axis as the docking normal. 2012-12-04 23:02:02 +00:00
Valathil b3465ad929 From Mantis 1129: Spit out a Warning if a model has a docking port with identical slot positions. 2012-12-04 20:25:55 +00:00
Valathil 9cf3151ef4 Fix for Mantis 2743: Strip down 16 Bit files to 8 Bit by adding PNG_TRANSFORM_STRIP_16 to png_read_png 2012-12-04 17:19:05 +00:00
Goober5000 ea4e1acb34 CommanderDJ's patch for #2730 2012-12-04 05:12:48 +00:00
Valathil 96c9a56549 Fix for Mantis 2727: Add Autocenter for debris rendering 2012-12-03 20:45:14 +00:00
Valathil 6ad5a937a9 Fix for Mantis 2736: abs is int in Linux and Mac; change to fl_abs in all instances where floats were used in the codebase. 2012-12-03 00:59:45 +00:00
The_E 552779163b And another fix for Mantis 2326. 2012-12-02 10:23:23 +00:00
The_E 097673762c I am just going to assume that this was a hasty application of Ctrl-C Ctrl-V, not some kind of intentional cast of a boolean to a float 2012-12-01 18:12:50 +00:00
karajorma 54a8788cb9 Update SEXP help for ai goal SEXPs to reflect that priorities over 89 are allowed now. 2012-12-01 07:11:29 +00:00
The_E 26b5c3a926 Changing the function descriptions of isLaser() and isMissile() to better explain what they're doing. Also adding isPrimary() and isSecondary(), which are basically the same as the first two, but named better. 2012-11-28 21:38:09 +00:00
The_E 9cec60f23d Fix for Mantis 1596: Adds "turret-fired" animation trigger 2012-11-28 20:08:07 +00:00
The_E 1a7a74f43e From FUBAR: Patch for Mantis 2256 2012-11-28 18:32:39 +00:00
karajorma 893701d0b7 This might or might not help with Mantis 1841. Either way Assertion > Int3() anyway. 2012-11-28 09:18:23 +00:00
Goober5000 2014ee4bab update comment 2012-11-28 06:56:08 +00:00
Goober5000 583f5f39ae clean out dead_docked list as part of ship_cleanup -- fixes Mantis #2294 2012-11-28 06:55:15 +00:00
Goober5000 48a30b0888 update ship orders when changing ship classes in FRED - fix Mantis #2341 2012-11-27 06:59:48 +00:00
Goober5000 9df9157e3c improve ship-copy-damage sexp with more robust checks and incidentally a fix for Mantis #2734 2012-11-26 05:49:23 +00:00
Valathil 917bd38692 Fix for Mantis 2735: Port commit 8643 & 8644 to Turrets as well 2012-11-26 01:37:24 +00:00
Echelon9 b4a578314c PVS-Studio fix: V601 The 'true' value is implicitly casted to the integer type. 2012-11-25 02:45:16 +00:00
The_E 7208989f05 Did you know that WP_BEAM isn't actually used anywhere? I didn't. Neither did the isBeam() scripting function. 2012-11-24 09:17:18 +00:00
karajorma 2d91a76f47 Fix Mantis 2703 (Primary weapons with the child flag prevent any further weapons appearing in the ships-editor->weapons list) 2012-11-24 08:37:25 +00:00
niffiwan 26d70dcb33 Fix for mantis 2664: shockwaves now use bounding box to test distance for damage 2012-11-24 02:40:55 +00:00
karajorma b5b9b8bc6e Fix an issue with persistent variables being ignored by the loadout code. 2012-11-23 06:49:04 +00:00
karajorma e10a41a82e That buffer needs to be bigger! 2012-11-23 06:37:09 +00:00
FUBAR-BDHR c2eb2e0840 Log but don't warn about LOD mismatches when running a standalone server. 2012-11-21 18:49:13 +00:00
Valathil e039a4954e Fix for Mantis 2207: Use Missiontime for F4 Logscreen entries and fix the calculation. 2012-11-20 23:42:12 +00:00
Valathil eb434cf828 Fix for Mantis 2376: Don't calculate nose offsets for chase view. 2012-11-20 20:54:28 +00:00
Valathil c5005adf53 Correct some issues with Help screens that popped up because of glCleanup and undocumented Nvidia driver behaviour. 2012-11-20 18:53:26 +00:00
niffiwan c38ad85175 Fix mantis 2732 2012-11-20 10:38:52 +00:00
Goober5000 a756cf2960 for Mantis #2636 2012-11-20 00:05:51 +00:00
Goober5000 c9d7673801 fix Mantis #2691 by just ending colorization on whitespace 2012-11-19 23:40:50 +00:00
Goober5000 48f36f569e addendum to r9340 to fix Mantis #2714 in scripting function (thanks to Admiral MS) 2012-11-19 22:57:41 +00:00
Valathil 374b5afafd Fix for Mantis 2731: Add a +use_pxo flag in multi.cfg 2012-11-19 17:43:40 +00:00
Goober5000 bc26caba28 follow-up to 9355: since we have a version of get_string that accepts SCP_string, just use that 2012-11-19 05:36:05 +00:00
Valathil 699e69b027 Followup to 9357: Don't flush texture state we don't care about that in shader pipeline and also move the fix to a more efficient place per Swifty's suggestion. 2012-11-18 23:33:01 +00:00
Valathil 666f978756 Fix for Mantis 2719: Clear Vertex Array state after rendering. 2012-11-18 19:07:33 +00:00
Valathil 5997a72a62 Fix for Mantis 2729: Remove the Int3 and make the log entry a little clearer. 2012-11-18 18:01:41 +00:00
The_E def96b21d2 Increase the buffer size for stuff_string_list(SCP_vector<SCP_string>) to 2048. If this function was used with substrings longer than NAME_LENGTH, this would cause stack corruption due to a buffer overrun. 2012-11-18 17:58:05 +00:00
Zacam 755d7326b3 From Valathil, glCleanup to reduce the amount of calls.
First post here: http://www.hard-light.net/forums/index.php?topic=82886.0
Mantis Here: http://scp.indiegames.us/mantis/view.php?id=2728
2012-11-18 10:05:44 +00:00
Zacam 212eee3b31 Warning resolution: grbatch.cpp(806) : warning C4018: '<' : signed/unsigned mismatch; solved by setting 'Batch_buffer_size' from 'int' to 'size_t' 2012-11-17 23:12:17 +00:00
zookeeper 0f198fd677 Fixed the reset button in the HUD config screen not resetting to the default color scheme given to new pilots. 2012-11-16 21:17:18 +00:00
zookeeper a88b1e145c Ought to fix bug 2690. 2012-11-16 19:45:24 +00:00
zookeeper 8308920e3b Fix really stupid mistake. 2012-11-16 11:26:48 +00:00
Zacam 05944baae8 From Valathil: Corrects for dynamic switching regarding Fixed Render Pipeline in the LAB 2012-11-16 04:14:29 +00:00
Goober5000 0a7d226d5f fix for Mantis #2726 -- proper handling of mismatch of LOD levels 2012-11-15 07:52:45 +00:00
zookeeper b7335b4f2e Tweaked some of the settings of the four detail level presets. 2012-11-14 12:05:59 +00:00
zookeeper a456519b95 Made the default detail level tableable in game_settings.tbl, but kept "very high" as the default. 2012-11-14 11:54:47 +00:00
Echelon9 c6691dc721 PVS-Studio fix: Resolve bug introduced in r201 (9 years, 11 months ago) in relation to an if statement without encompassing curly brackets. 2012-11-12 14:32:57 +00:00
Goober5000 0627377338 Admiral MS's fix for Mantis #2723 2012-11-12 06:57:18 +00:00
Goober5000 92c03d15f2 CommanderDJ's fix for Mantis #2529 2012-11-12 06:48:17 +00:00
Goober5000 429ab61311 fix Mantis #2714 -- hud doesn't change when change-ship-class is called 2012-11-12 03:25:59 +00:00
zookeeper 1b6a87498d Fix botchedness in r9338. 2012-11-11 20:59:02 +00:00
zookeeper 4e273451b4 Set the default detail level of new pilots to "very high". 2012-11-11 12:09:25 +00:00
Goober5000 b30e2ee226 inspired by recent change to multi_sexp.cpp... in most cases, SCP_string should not be passed by value 2012-11-05 08:31:39 +00:00
Goober5000 14322c5064 a ship that is self-destructed should have the same behavior as one that is destroyed, if going by mission log entries
(c.f. thread: http://www.hard-light.net/forums/index.php?topic=82718.0)
2012-11-05 05:43:28 +00:00
Zacam 815b74691b Lets see if this handles Mantis 2724.
On Valathil's suggestion, pulled the code added in 9312 from 'model_render_glow_points' and 'model_render_thrusters'
2012-11-04 21:50:34 +00:00
Zacam e9d39c9b57 One more spot to update Build revision from .13 to .15 2012-11-04 15:44:11 +00:00
The_E ca5dd281bd Compiler warning removal: Variable initialized but not used 2012-11-04 08:30:20 +00:00
The_E 664c1c383b Compiler Warning removal: int-to-ubyte conversion 2012-11-04 08:29:46 +00:00
The_E 1032302351 Compiler warning removal: Unused variable, float-to-int cast 2012-11-04 08:27:50 +00:00
The_E 051fcdd770 Compiler warning removal: ubyte/int comparison 2012-11-04 08:25:53 +00:00
Echelon9 ba917667b6 Re: r9305 - while NULL pointer checks in non-Debug are useful, ensure we don't lose the better check in Debug as well. 2012-11-03 23:11:41 +00:00
The_E 43fecf84c8 PVS Studio fix: string last_portion is not used anywhere 2012-11-03 09:39:11 +00:00
The_E cc8893ca72 PVS Studio suggestion: Create a reference to avoid repeated vector access 2012-11-03 09:38:34 +00:00
The_E c75469e066 PVS Studio fix: Pointer not checked against NULL 2012-11-03 09:37:29 +00:00
The_E 40536f9069 PVS Studio fix: Pointer shipp is not checked against NULL 2012-11-03 09:36:44 +00:00
The_E dd098ed217 PVS Studio fix: Really confusing code 2012-11-03 09:35:46 +00:00
The_E 2ab5c72111 PVS Studio fix: "!none_valid" is always true 2012-11-03 09:33:54 +00:00
The_E 1f48d15dcc PVS Studio suggestion: Create a reference to avoid multiple vector access operations 2012-11-03 09:31:54 +00:00
The_E 4c9333a6f0 PVS Studio fix: String play_callsign is not used anywhere 2012-11-03 09:28:49 +00:00
The_E 35cc7b886e PVS Studio suggestion: Create a reference instead of repeated vector access 2012-11-03 09:25:48 +00:00
The_E 75ba6a15cc PVS Studio suggestion: Use ++it for iterators 2012-11-03 09:24:25 +00:00
The_E a71b5f4247 PVS Studio fix: Add checks against NULL pointer dereferences 2012-11-03 09:23:23 +00:00
karajorma 5769d206e4 Turns out you do need some of those after all. No idea why grep didn't find them. 2012-11-03 09:01:17 +00:00
karajorma e83c18a7f9 Clear out some cruft from the multiplayer code. Make sure Macros are being used. 2012-11-03 08:25:27 +00:00
karajorma 9dd9dd1581 Object numbers are not guaranteed to the same on the client. Sent the net_sig instead. 2012-11-03 06:08:22 +00:00
chief1983 2ca33c3ee6 He did the job, parse error fixes came with ease, but one couldn't stop it's like he had a disease, he fixed another and another and a sista and her brotha... 2012-11-02 19:48:57 +00:00
chief1983 666aee826f Darn typos. 2012-11-02 19:41:59 +00:00
chief1983 9f4f3dfd2c More tweaks for FreeBSD support, and cleanup of configure.ac. Slightly experimental. 2012-11-02 19:36:53 +00:00
chief1983 4e5d3e2e57 Fix all the 'no newline at end of file' warnings I saw thrown by gcc on FreeBSD. 2012-11-02 17:30:17 +00:00
Echelon9 beb0f3915a Update Xcode4 project file to the latest recommended settings in Xcode 4.5.x 2012-11-01 14:41:07 +00:00
Goober5000 b09e535c3b Admiral MS's fix to the lab weaponmodel fix 2012-10-31 01:56:35 +00:00
The_E 4bb94b0abf OOps, forgot a : 2012-10-30 20:09:03 +00:00
The_E ebd477067d Fix for Mantis 2679: Adds new setting to game_settings.tbl: "$Weapons inherit parent collision group:", a boolean setting defaulting to FALSE. Setting it to true will cause weapons fired to inherit their parent ships' collision group setting. 2012-10-30 19:37:53 +00:00
karajorma 418135917d Move the add paste button in FRED. Hopefully this will result in less cursing when people press paste instead of add paste. 2012-10-30 03:26:30 +00:00
karajorma cfcb883159 Switch the name of the deselect-nav SEXP 2012-10-30 02:07:41 +00:00
Goober5000 91d30c608a fix an old Volition bug -- properly mark a goal as not achievable if a ship departs, not only if it's destroyed
and throw in self-destructed for good measure, per Admiral MS
2012-10-29 20:48:06 +00:00
Goober5000 3b5b154712 fix from Admiral MS -- if there's no explosion, explosion sound shouldn't play either 2012-10-29 20:29:54 +00:00
Goober5000 b9a803a771 fix from Admiral MS -- move waypoints properly when moved via scripting 2012-10-29 20:27:31 +00:00
Goober5000 b8ce4b7a7e fix from Admiral MS -- page out weapons when lab is exited
also, modelnum comparisons should be >= 0, not > 0
2012-10-29 20:26:29 +00:00
Goober5000 ee357c9846 yes, whoops (fix bug noticed by Droid803) 2012-10-29 07:10:01 +00:00
The_E 4d57e2eaba Make change-team-color multi. Also adds SCP_string overloads for multi_send_string/multi_get_string 2012-10-27 09:24:11 +00:00
The_E f98e75dde6 A few updates to Team Colors:
-Team Colors can now be applied to player ships
-change-team-color sexp for on the fly changes
-New F3 lab controls: T and Y can now be used to cycle team color presets
2012-10-26 18:39:43 +00:00
karajorma 20b614069e Resaving a mission shouldn't result in any changes other than the date. 2012-10-26 09:44:12 +00:00
karajorma d822dce5bb Small error with alter-ship-flag fixed. 2012-10-26 00:28:20 +00:00
chief1983 00abe171bc Bump trunk revision to 3.6.15. Update output build names for MSVC 2005 through 2012, Xcode 3 and 4, Linux, and internal version strings. 2012-10-25 16:26:11 +00:00
chief1983 b7f8bc6ba8 Add event.log stuff to Xcode3 project file. 2012-10-25 16:03:17 +00:00
niffiwan 6e0bfaa4d1 Add generic_log files to Makefile.am for *nix compiles 2012-10-25 10:16:38 +00:00
karajorma 54f6d864a0 alter-ship-flag SEXP. Now does AI flags too. 2012-10-23 12:02:28 +00:00
IssMneur fa00353c9d Name the packfile with the odd header 2012-10-20 03:41:25 +00:00
Swifty 385b8c48bb Axem's rotating dead subobjects. 2012-10-17 05:58:33 +00:00
Goober5000 8aa23d6a1a fix for Mantis #2643 (generated shield quadrants displayed in the wrong spots) 2012-10-16 03:20:47 +00:00
Goober5000 d57b46bfe5 add missing files to project 2012-10-16 02:27:14 +00:00
Goober5000 b01a5b3f65 add arrival_delay and departure_delay arguments to set-arrival-info and set-departure-info 2012-10-16 01:08:30 +00:00
Echelon9 2b3def2ade PVS-Studio fix: V601 The 'true' value is implicitly casted to the integer type. Inspect the first argument. 2012-10-15 10:57:15 +00:00
Echelon9 841032c37a PVS-Studio fix: V576 Incorrect format. Consider checking the fourth actual argument of the '_snprintf' function. The SIGNED integer type argument is expected. 2012-10-15 10:53:01 +00:00
Swifty 7aadb223ef Let's simplify that no autoaim in multiplayer commit. 2012-10-15 09:08:20 +00:00
Swifty 3236a1d262 Removed the multiplayer game mode check in unnecessary places in the autoaim/convergence firing code. 2012-10-15 07:31:26 +00:00
Swifty e4880e319e Made sure that cockpit models are getting flushed out when unloading a given model. 2012-10-15 06:21:00 +00:00
Swifty 2132f14d60 Fixed scaling and positioning issues with cockpit displays. Added Display Offsets: to all RTT capable gauges. 2012-10-15 04:45:02 +00:00
Swifty 002f143725 Added RTIF settings for DRADIS. 2012-10-15 02:42:10 +00:00
IssMneur 3ae4064268 Added a note to the configure file about letting SCP know about successful builds on our unsupported and less supported platforms. 2012-10-13 21:42:06 +00:00
IssMneur 8f39310eb9 nbspjr's changes for FreeBSD building
See: http://www.hard-light.net/forums/index.php?topic=82425.msg1646772#msg1646772
2012-10-13 21:27:42 +00:00
m_m e2e3eeafed Adding a few new scripting functions, including support for dockingpoint access for scripting and a function to draw HUD-like brackets around an arbitrary subsystem. 2012-10-12 16:14:47 +00:00
m_m 513caa9ec3 Fix compilation for Visual Studio 2010 and 2012. 2012-10-12 10:39:44 +00:00
Echelon9 52093cf6c6 Documentation: Pass cleaning up a few functions with partial docs 2012-10-08 15:53:14 +00:00
Echelon9 c1121a56bb Fix: Format string is not a string literal (potentially insecure) 2012-10-08 15:17:43 +00:00
Echelon9 b1fc599517 Support event.log compilation in the Xcode4 project file 2012-10-08 15:03:01 +00:00
karajorma 7769a4e6e1 Okay, this time JUST the event.log stuff! 2012-10-08 09:13:21 +00:00
karajorma 49f63ad88b Backout that commit. Wrong codebsse! 2012-10-08 09:11:14 +00:00
karajorma 7c25c35243 Commit the event.log feature. 2012-10-08 09:02:44 +00:00
Swifty ab7c112951 Cockpit display support for a crapload of gauges. 2012-10-07 05:37:50 +00:00
Goober5000 f53f819591 remove all hacks with #weak because FSPort has corrected data 2012-10-07 04:06:29 +00:00
karajorma 5a75b350cb Fix AI issue where ships ended up with no target to land on. 2012-10-07 01:18:30 +00:00
Swifty 54a668bc1c Disabled auto aim in multiplayer. 2012-10-06 23:57:29 +00:00
Swifty 38da17a334 Fixed crash caused by certain AI code assuming all objects are Ships. 2012-10-06 23:56:20 +00:00
karajorma c94d97073c Talon1024's Nav select/deselect SEXPs. 2012-10-04 02:28:23 +00:00
Goober5000 45c8ad336c change alloca to standard vm_malloc/vm_free 2012-10-01 06:16:15 +00:00
Goober5000 2c701c592a update comments 2012-10-01 03:19:46 +00:00
Goober5000 acac926656 update const-correctness 2012-10-01 03:19:31 +00:00
Swifty 4b95d09f8c Fixed attempted reinitialization of collision pairs. Need to use OBJ_INDEX(objp), not objp->instance as that refers to the ship index, not the object index. 2012-10-01 03:05:20 +00:00
Goober5000 22dc84b6e1 MSVC6 compatibility 2012-09-30 21:08:05 +00:00
Goober5000 3e08e72d5b Admiral MS's lab patch
http://www.hard-light.net/forums/index.php?topic=82192.0
2012-09-30 19:43:24 +00:00
Goober5000 b028b372af fix a compiler warning 2012-09-28 06:26:34 +00:00
Goober5000 8612ee9f69 fix the techroom bug where #weak weapons appear because they were assigned the player-allowed flag during parsing 2012-09-28 06:26:14 +00:00
Goober5000 e7bcccd4c0 revert r9218 per discussion with karajorma... new fix will follow shortly 2012-09-28 05:36:12 +00:00
Echelon9 3825ce1968 Fix up cmd_brief and cmd_brief_stage struct definitions; some general cleanup of code within missioncmdbrief as well 2012-09-26 10:39:56 +00:00
Valathil aa5f42f1f1 Fix for Mantis 2709: Use the correct dimensions for updating texture images when texture streaming to fix crashes on hardware not capable of handling non power of 2 texture dimensions 2012-09-25 19:11:05 +00:00
karajorma e4978a67a4 Allow mods to mark campaigns as ignored. 2012-09-25 13:40:05 +00:00
karajorma c51f88abd8 Doh! Those two should be the other way round. 2012-09-25 01:08:19 +00:00
m_m 947263a047 Let's try this again, hopefully this time without reverting previous changes. See r9215 for a better description. 2012-09-24 16:17:26 +00:00
karajorma 05215a7ffa Commit Mission Moods 2012-09-24 11:00:40 +00:00
Goober5000 ef6ccc36f0 play-sound-from-table should work for both 3d and non-3d sounds 2012-09-24 06:58:54 +00:00
Goober5000 424c315575 remove a warning 2012-09-24 06:58:10 +00:00
Echelon9 7b00d3dd45 Support Universal builds (32/64 bit) on Mac OS X 10.6+. Also updates library frameworks to libogg-1.3.0, libvorbis-1.3.3 and libtheora-1.1.1 2012-09-23 15:17:52 +00:00
karajorma 9433f054f3 Stop #weak weapons appearing in the tech room in multiplayer missions. 2012-09-23 08:33:32 +00:00
The_E 1f8dcf5494 Reverting 9215, because it conflicts massively with my fixes for hud_gauges. m|m, did you update your checkout before committing your stuff? 2012-09-22 21:41:23 +00:00
m_m 1faee4f711 Added weapon specific HUD tracking and lock-on sounds and in-flight sounds.
New options are $TrackingSnd, $LockedSnd, $InFlightSnd and +Inflight sound type.
2012-09-20 13:05:09 +00:00
karajorma d5cb354950 Display the skill level on the debriefing stats screen. 2012-09-20 01:05:23 +00:00
The_E c04b6a54f0 Fixes memory management issues due to duplicated pointers 2012-09-19 19:28:03 +00:00
The_E 1cae449aad Clear the ship list between gauge configs to avoid multiple huds rendering at once 2012-09-19 18:40:10 +00:00
The_E dcf8339ae2 And another fix. Apparently, = != ==, who knew 2012-09-19 17:34:09 +00:00
The_E d324780a3f And more fixes 2012-09-19 16:52:30 +00:00
The_E 98e4c56c19 Fix a stupid parsing bug 2012-09-19 16:37:34 +00:00
The_E a736ac2d36 As requested by mjn.mixael: Allows modders to specify a list of ship classes a given hud config can be applied to. To use this, use "$Ships: ("Some ship" "Another ship")" instead of "$Ship: This ship". $Ship has been deprecated. 2012-09-19 15:31:31 +00:00
karajorma 6b7f78965d Allow subtitles to also display remappable keys. 2012-09-18 09:22:21 +00:00
karajorma 3780eb6a86 Looks like Do-Nothing went walkabout. Putting it back. 2012-09-16 13:30:18 +00:00
karajorma a8cccb2168 Send a keep alive packet when loading icons as sometimes this can take quite a while (for instance in debug). 2012-09-16 09:09:19 +00:00
karajorma ee52320146 Fix Mantis 2712 (Change-ship-class does not update clients). Only a partial fix as cockpit and HUD are not updated. 2012-09-16 08:30:48 +00:00
karajorma 683e8cf2a4 Axem's Radians -> Degrees fix for FRED 2012-09-16 01:27:32 +00:00
karajorma 0d0a8b644a Axem's SEXP reorganisation. 2012-09-15 03:28:36 +00:00
karajorma abd9b6a3f7 Add the debug SEXP. 2012-09-13 09:35:13 +00:00
karajorma 67d106ae15 We really shouldn't be doing that on the standalone 2012-09-13 04:47:27 +00:00
IssMneur bc713b68bb Fixes mantis 2711. AudioStream handles are leaked under certain conditions.
AudioStream handles that were to destroy and fade would not if the stream was already finished or not started.
2012-09-12 02:41:08 +00:00
The_E c69f00d90e Fixes issue with Team Colors accidentally causing a null pointer dereference. Thanks to mjn.mixael for prodding at this. 2012-09-11 22:24:45 +00:00
Valathil ac5c8dc798 Only use offsets for thruster distortions. Fixes weird framebuffer explosions. 2012-09-11 12:50:43 +00:00
niffiwan adecd7fe12 From m!m: Fix for mantis #0002695 2012-09-11 10:02:59 +00:00
Swifty 849976985a Created Primary Weapons Gauge and Secondary Weapons Gauge. 2012-09-10 07:09:32 +00:00
Swifty 2b857771fc Created Hardpoints gauge. 2012-09-10 06:58:59 +00:00
Swifty aba9b4515e Created Warhead Count gauge. 2012-09-10 06:51:14 +00:00
Swifty 087d9c04db Added additional parameters for the Wingman Status gauge. 2012-09-10 06:35:33 +00:00
Swifty cafad3bb24 Added text color parameters for the auto target and auto speed gauges. 2012-09-10 06:31:03 +00:00
Swifty a3fafcb248 Added Bottom Background Offset: and Max Line Width: to Directives gauge. 2012-09-10 06:23:46 +00:00
Swifty 9c3ef3c636 Added Bottom Background Offset: to Squad Message gauge. 2012-09-10 06:14:06 +00:00
Swifty 4c9ca0c336 Added parameters to adjust subsystem name, integrity, and status offsets for the Target Monitor. 2012-09-10 06:04:24 +00:00
Swifty e4af974b70 Added Desaturated rendering to the Target Monitor. 2012-09-10 05:59:55 +00:00
Swifty 2ca77f899a Added alpha masking support for the Target Monitor gauge. 2012-09-10 05:53:53 +00:00
Swifty 67767e77ff Added a variety of parameters to the Weapon Energy gauge. 2012-09-10 05:43:10 +00:00
Swifty b83644c8a0 Added a variety of parameters to the Throttle gauge. 2012-09-10 05:38:02 +00:00
Swifty c32052a1a0 Added Bottom Background Offset: and Ship Name Max Width: parameters to the Escort gauge in hud_gauges.tbl. 2012-09-10 05:35:49 +00:00
Swifty 2f22a5ce67 Created Flight Path Marker gauge. 2012-09-10 05:33:17 +00:00
Swifty e2ee74c387 Added bottom offset parameter to the Damage gauge in hud_gauges.tbl 2012-09-10 05:21:46 +00:00
Swifty 6dfa635811 Added better object and weapon cleanup code for the new collision detection code when max object and weapon counts are reached. 2012-09-10 05:08:16 +00:00
Swifty 87436e4eec Added OpenGL color masking functions to the graphics code. 2012-09-10 05:06:36 +00:00
Swifty de89915514 Added OpenGL alpha testing functions to the graphics code. 2012-09-10 05:05:14 +00:00
Swifty d2d9f4e74b Forgot to add these stubs for the graphics code stencil functions. 2012-09-10 05:03:33 +00:00
Swifty 0ef190c33a Added basic OpenGL stencil support. Valathil, feel free to alter this implementation if you need to get things working with deferred shading. 2012-09-10 05:00:26 +00:00
Swifty eeeeb2ce96 Base support for desaturated model rendering. 2012-09-10 04:51:11 +00:00
Swifty 63e43021ed Added method to the HudGauge class that renders full color bitmaps. 2012-09-10 04:39:41 +00:00
Swifty 967c28c87d Allowed resizing of scaled HUD gauges even if we're using GR_640 or GR_1024. 2012-09-10 04:32:28 +00:00
Swifty 0a4f6b332d Added "$Radar Color Image 2D:" to ships.tbl. Adds full color radar image blips on top of IFF-colored image blips. 2012-09-10 04:22:07 +00:00
Swifty e23a729ec5 HUD Config Options will properly set Text Messages and Messages to its defaults when reset. 2012-09-10 04:01:17 +00:00
Swifty d8d6e86fd6 Collision caching properly resets between missions. 2012-09-10 03:58:14 +00:00
Swifty 22b51105e7 Fixed change_ship_type to use proper collision functions. 2012-09-10 03:57:00 +00:00
Swifty 11e355757b Fixed crash when using viewing from a ship using the "show ship" flag. 2012-09-10 03:55:46 +00:00
Echelon9 42a4aef344 Fix LLVM warning: Declaration shadows a field of 'NavPoint' 2012-09-06 17:01:51 +00:00
Echelon9 fae7e022ad Fix LLVM warning: Declaration shadows a local variable (modelread.cpp) 2012-09-06 16:59:02 +00:00
Echelon9 b28e57f86d Fix LLVM warning: Declaration shadows a local variable (ship.cpp) 2012-09-06 16:57:52 +00:00
Echelon9 530aa28cfa Fix LLVM warning: Declaration shadows a local variable (missionparse.cpp) 2012-09-06 16:56:47 +00:00
Echelon9 a8ee61c0fa Fix LLVM warning: Declaration shadows a field of 'HudGaugeRadarDradis' 2012-09-06 16:51:06 +00:00
Echelon9 a59c092fc6 Fix LLVM warning: Declaration shadows a field of 'WE_BSG' 2012-09-06 16:47:59 +00:00
Echelon9 d919dc2cb2 Fix LLVM warning: Declaration shadows a field of 'LoopingSoundInfo' 2012-09-06 16:45:52 +00:00
Echelon9 ffa4efd64a Fix LLVM warning: Declaration shadows a field of 'cockpit_display_*' 2012-09-06 16:44:16 +00:00
Echelon9 9abd596b72 Fix LLVM warning: Declaration shadows a field of 'waypoint_list' 2012-09-06 16:40:18 +00:00
Echelon9 73a487aab6 Fix LLVM warning: Declaration shadows a field of 'waypoint' 2012-09-06 16:38:15 +00:00
Echelon9 fa671f18fc Remove some unused variables 2012-09-06 15:51:52 +00:00
The_E 9901ad613d This warning needs to be a bit more helpful 2012-09-05 15:29:56 +00:00
zookeeper 45da46eddd Fix the disabled flag not getting initialized right for controls which don't have an entry in controlconfigdefaults.tbl. 2012-08-31 19:23:44 +00:00
zookeeper 83871b3aa3 Added support for hiding/disabling keybinds in controlconfigdefaults.tbl. Patch from http://www.hard-light.net/forums/index.php?topic=81727.0 2012-08-30 06:45:22 +00:00
Valathil 71cd726349 Fix for Mantis 2705: Add Jump Nodes to the list of object types that are models so they are rendered at the right time 2012-08-28 18:50:53 +00:00
Goober5000 5785885641 Admiral MS's patch for destroy-instantly and destroy-subsys-instantly 2012-08-27 02:50:05 +00:00
Goober5000 1c5823030c this actually does exactly the same thing, but it's more consistent with the rest of the code 2012-08-25 23:49:32 +00:00
Goober5000 4ab6f03c9e make red-alert not dependent on whether the HUD is visible or not
(fixes Mantis #2683)
2012-08-24 04:09:05 +00:00
The_E c163a453ce Also revert 9132. That was actually meant to go through review first. 2012-08-22 16:35:49 +00:00
The_E 4142a964bd Revert 9131 for real 2012-08-22 16:35:18 +00:00
The_E ee6afdd724 Double oops, I don't know why I committed this 2012-08-22 16:30:27 +00:00
The_E d36e568a76 Ooooops, forgot a ":" in the parser 2012-08-22 16:26:06 +00:00
Goober5000 4d6b42a298 variable tokens can be quite a bit longer than standard tokens due to their unusual format; handle this properly
(fixes Mantis #2670)
2012-08-22 05:31:40 +00:00
Goober5000 0537dff6d6 the initialized value should match the default value 2012-08-22 02:00:03 +00:00
niffiwan 3c14c37fde Replace RamTable memory management with something a bit faster 2012-08-21 10:32:05 +00:00
The_E f591b04348 Adding nameplate textures to the list of texture names that trigger the transparency renderer. 2012-08-20 19:00:28 +00:00
Goober5000 271d344f01 spelling 2012-08-20 01:42:45 +00:00
Goober5000 8e807f0fff sync ai_profiles.cpp with def_files.cpp and with wiki page 2012-08-20 01:04:49 +00:00
Echelon9 460dab24f8 Fix Mantis 2699: Replace deprecated hash_map on systems that support std::tr1::unordered_map. Code review following ni1s initial patch and suggestions. 2012-08-19 14:14:20 +00:00
Goober5000 6422270049 there is indeed one minor bug -- switching flags for flags2 2012-08-19 07:53:12 +00:00
Goober5000 ca08b3813a reverting 9121 -- I'll give karajorma the benefit of the doubt and assume he just didn't see the compatibility additions 2012-08-19 07:20:06 +00:00
karajorma 8e043a0019 Revert 9119 and 9120 since at least one of them breaks compatibility with 3.6.12 2012-08-19 06:13:45 +00:00
Goober5000 53f080ea67 all mod_table flags should also default to NO
also, change the generic_anim flag on whether to use the HUD color settings to be a bit more descriptive
2012-08-19 03:27:31 +00:00
Goober5000 4fa40e49c4 LESS -> FEWER
also, all ai profiles flags should default to NO
2012-08-19 02:06:26 +00:00
Valathil 8ea85e3004 Fix for Mantis #2697: That was supposed to be the other way round. DIVIDE BY 0 OH SHIII... 2012-08-18 17:47:13 +00:00
The_E f5ebe4be4a Fix for Mantis 2685: Glowpoints attached to a modelled subsystem will be rendered even if that subsysstem has been destroyed 2012-08-18 16:57:48 +00:00
Swifty 7c7c64e769 Fixed rendering when using fixed function OpenGL pipeline. (Mantis 2696) 2012-08-18 10:39:20 +00:00
Swifty 50c649a030 Restored set object position functionality for OSWPT_TYPE_SHIP since they no longer should be sharing the same code with OSWPT_TYPE_WAYPOINT. See Mantis 2612. 2012-08-17 06:47:19 +00:00
Echelon9 3623cb6d79 Fix Mantis 2687: In weapon selection window, glowpoints can be seen through a ships hull. Note this is similar to the fix in r9031. 2012-08-16 10:05:22 +00:00
IssMneur 76a889a027 Fixes 2266 by reverting ds_get_free_channel to retail 2012-08-16 04:42:21 +00:00
Valathil ff47353bd7 Followup to 9109: Add some error handling to handle 1 frame "animations" and missing frame 0 image files 2012-08-16 01:16:05 +00:00
zookeeper 7a50e19311 Turned $Comms Menu Hides Messages from a global HUD flag to a +Messages gauge flag. 2012-08-15 19:18:25 +00:00
zookeeper ea81983597 Added a hud_gauges.tbl boolean flag to allow one to override the default behaviour of messages not being displayed while the comms menu is open. 2012-08-15 14:27:12 +00:00
Valathil 48e0517e0d Allow generic_anim's to reuse bmpman and texture_cache slots and implement eff streaming. Changed talking heads to use generic_anim. Fixes Mantis 2417 2012-08-14 23:48:23 +00:00
Valathil 71ccf2e274 Fix for Mantis #2612: Allow set-object-position to work with waypoints. Patch by Admiral MS 2012-08-14 20:25:23 +00:00
zookeeper dbb5988dc7 Added some default mod_table comments. 2012-08-14 05:53:49 +00:00
The_E ecd363ed3e Adding stub functions for maybe_create_shader, set_team_color, enable_team_color and disable_team_color 2012-08-13 19:43:21 +00:00
Swifty f913017200 BSG FTL effect modified to use soft particle rendering if available. 2012-08-11 21:40:01 +00:00
Swifty c6c12fc251 go_even_faster: Improved collision detection performance by rewriting broadphase and narrowphase testing. 2012-08-11 21:14:53 +00:00
Swifty 6ba0da6020 go_even_faster: Improved rendering performance of particles by sending vertex data via buffer object. 2012-08-11 21:01:13 +00:00
Swifty 638ff917a1 go_even_faster: Added framework to improve rendering performance by reducing OpenGL state changes between vertex data binds. 2012-08-11 20:20:24 +00:00
The_E 4550188f8b Removing the "run_launcher" function, since as far as I know, it hasn't worked for a looooong time 2012-08-11 15:18:23 +00:00
niffiwan 0619953c14 Also check we have a valid bitmap before trying to render it 2012-08-11 09:39:43 +00:00
niffiwan bd05b0c1e7 Switch mprintf to Warning - if these are missing you can get bmpman assertions 2012-08-11 09:27:20 +00:00
Echelon9 a4813e38dc Clean up the Xcode 4 project file, to work default on Xocde 4.4.1 (latest) 2012-08-08 14:24:10 +00:00
niffiwan 6579133220 Remove unnecessary Int3() - already gracefully handles running out of turret swarm slots 2012-08-07 09:11:41 +00:00
Goober5000 2ceecf9405 fix for Mantis #2694: homing breaks when free_flight_time is 0
also, correctly set default free_flight_time to retail value of 0.5 second
2012-08-07 05:59:35 +00:00
chief1983 b2f566a5d8 Fix compile errors about an ambiguous call when using the Xcode project and Xcode 3. 2012-08-06 18:12:02 +00:00
The_E e8b23a5b03 Correcting a few mistakes that somehow happened 2012-08-04 06:18:00 +00:00
The_E bc682b8e12 Changing "use" to "enable" 2012-08-04 05:44:51 +00:00
The_E 9a54bd0cc4 New game_settings.tbl setting: "$Enable External Shaders:", which allows the use of, you may have guessed it, external shaders. Default is off. 2012-08-03 20:31:57 +00:00
The_E 64d55a67a1 Fix to make glowpoints respect clip planes during warpout again 2012-08-03 18:19:35 +00:00
The_E 340ee49db3 Fixes issue with team color setting resetting itself when tbms become involved 2012-08-02 14:24:14 +00:00
niffiwan a66665dd73 remove memsets on game_snd vars - struct now has vectors in it... 2012-08-02 10:17:32 +00:00
The_E b0ab2b96d2 Aaargh, derp again 2012-08-01 17:32:48 +00:00
The_E 33d8d4cdf7 A bit of un-derping. 2012-08-01 17:23:05 +00:00
The_E f26a189cc2 Fix for Mantis 2692: Invalid memory access in initial ship status editor. Also adds a line to ships.tbl "$Enable Team Colors: <BOOL>", inserted after the "$ND:" block and before the "$Default Team" entry, which can be used to switch on Team Colors without specifying a team.
Also adds a "None" entry to the Team color selection that can be used to switch off team colors.
2012-08-01 16:40:33 +00:00
zookeeper 93758084dc Fixed includes forgotten from last commit. 2012-08-01 10:06:54 +00:00
zookeeper 20b3d8c94d Prevent garbage collection of texture handles which still have a non-zero load count. Underlying reason for why this can happen in the first place still unknown. 2012-08-01 09:45:26 +00:00
The_E 371b827014 Patch from Pecenipicek that allows a "none" team color to be defined in ships.tbl 2012-07-31 18:27:07 +00:00
The_E b52453ee9b Remove a define from the builtin shader that was causing issues now that AMD has fixed their driver's clipping behaviour 2012-07-31 14:18:27 +00:00
chief1983 28e04bf7d1 From pecenipicek: Fix team colors bug in built-in shaders. 2012-07-30 06:34:04 +00:00
Goober5000 f33c101224 clean up some of the CString code in FRED 2012-07-30 01:49:57 +00:00
Goober5000 0ad86d78f6 unherp the derp 2012-07-29 20:59:44 +00:00
Goober5000 bbcd26c2d7 remove warning 2012-07-29 20:57:35 +00:00
Goober5000 a5f80ab4bb move the selection effect settings into game_settings.tbl because putting them in ai_profiles.tbl is incorrect and misleading
also, fix game_settings.tbl to not leave some settings uninitialized
2012-07-29 20:57:20 +00:00
Goober5000 cc45955cf2 m!m's patch for returning invalid IDs 2012-07-29 19:22:48 +00:00
The_E e120d533a3 Do not penalize for linking weapons with WIF3_NOLINK 2012-07-29 17:54:23 +00:00
The_E 4762aa6191 A few fixes for the On Weapon Fired hook. 2012-07-29 17:31:08 +00:00
Goober5000 68bf7db7c6 hooray for parentheses 2012-07-29 17:00:18 +00:00
The_E 6da6894f22 New weapons.tbl flag: "no primary linking" Weapons with this flag can not be linked with other weapons. This also introduces a third (!) field for weapon flags. 2012-07-29 11:32:39 +00:00
The_E 535d91bae8 New weapons.tbl flag: "anti-subsystem beam" Enabling this allows the turret AI to use beams against subsystems 2012-07-29 11:09:36 +00:00
Goober5000 f1c4e57300 more warning reduction 2012-07-29 07:47:49 +00:00
Goober5000 e541cf0180 m!m's modular sounds patch, with minor modifications 2012-07-29 07:35:37 +00:00
Goober5000 db351f77dd this gets rid of the "conversion to ushort" warning, strangely 2012-07-29 07:34:46 +00:00
The_E aa19416dbe Ooops, this should not be here twice 2012-07-28 21:13:37 +00:00
The_E 3b1a94b751 After a long time being tested in TAP, Team Colors are now stable. Please refer to http://www.hard-light.net/forums/index.php?topic=79743.0 for details. 2012-07-28 20:53:57 +00:00
Echelon9 90069f176b Fix commit 2628 - treatment of is_training_mission(). Nothing like fixing 6.5 year old bugs. 2012-07-26 14:01:32 +00:00
Goober5000 fcbf33aeab some const stuff, useful for the sounds patch 2012-07-26 07:46:35 +00:00
niffiwan b1f32b5087 Fix 4 for #2590: don't use "j" when its value could be greater than the array size - thanks to Zacam & Goober for finding this 2012-07-24 10:02:11 +00:00
Goober5000 3eeb334d77 allow skyboxes to be rendered at a custom orientation 2012-07-24 03:53:25 +00:00
Goober5000 b3c0f7a58b I guess these need to be listed in the project file? 2012-07-24 03:37:40 +00:00
Swifty 7645c6628a Fixed glow points in the Tech Room. 2012-07-22 08:35:44 +00:00
Goober5000 9d08a95283 standardize conversion to radians 2012-07-20 23:19:11 +00:00
Echelon9 5c9b9044e0 PVS Studio fix: V619 The array 'Players' is being utilized as a pointer to single object. hudsquadmsg.cpp 2595 2012-07-19 14:38:01 +00:00
Goober5000 d001f8ebea these arguments are needed 2012-07-19 03:31:37 +00:00
Goober5000 dd847005af update SCP credits, add $Music: for credits.tbl 2012-07-19 02:31:10 +00:00
Swifty ad6e68d819 Corrected glow point directional attenuation. Need to use world coordinates of glow points, not local. 2012-07-18 08:07:47 +00:00
Echelon9 ddbbe72630 PVS-Studio fix: V601 The 'true' value is implicitly casted to the integer type. Inspect the fifth argument. lua.cpp 6982 2012-07-16 12:19:00 +00:00
Echelon9 3ec3849598 PVS-Studio fix: Subtle one, as FALSE (the define) is not the same as false (the boolean).
V601 The 'false' value is implicitly casted to the integer type. hudtarget.cpp 1346
2012-07-16 12:14:28 +00:00
Echelon9 11fbc7b5cf PVS-Studio fix: V601 The 'true' value is implicitly cast to the integer type. Inspect the second argument. 2012-07-16 12:08:57 +00:00
Echelon9 46d854d9f0 PVS-Studio fix: There is only one PI.
V624 The constant 3.14159 is being utilized. The resulting value could be inaccurate.
2012-07-16 11:44:22 +00:00
Echelon9 e337c91482 Whoops, fix commit r9020 2012-07-16 11:34:02 +00:00
Echelon9 e5ff246f1b PVS-Studio fix: V619 The array 'shipp->ab_info' is being utilized as a pointer to single object. shipcontrails.cpp 2012-07-16 11:26:43 +00:00
Echelon9 0efe864dd1 PVS-Studio fix: V619 The array 'v' is being utilized as a pointer to single object. gropengldraw.cpp 2012-07-16 11:16:28 +00:00
Goober5000 1adc301bde prevent ships with mismatched models and tables from causing crashes later on (Mantis #2689) 2012-07-15 22:54:47 +00:00
Goober5000 a687fbbf1b this is a slightly modified version of m!m's patch for Mantis #2688 2012-07-15 18:48:42 +00:00
Echelon9 35d9af7e5f Commit contribution from community for Lua debug as preference, while preserving old behaviour. Sorry I don't have the name of the contributor or can find the original thread containing this patch. 2012-07-15 15:53:51 +00:00
Goober5000 10e1e1d8ef add four useful sexps: set-arrival-info, set-departure-info, set-debriefing-toggled, set-subspace-drive
also, fix a hole in the oswpt routine (and a few sexps) dealing with wings that weren't present yet
2012-07-15 05:21:12 +00:00
Goober5000 8cf4e79607 this really ought to be a Warning, not an Error 2012-07-15 05:16:13 +00:00
Goober5000 dfc0d6ec15 m!m's fix for signed/unsigned mismatch
(IT'S OVER 9000!!!)
2012-07-14 18:11:21 +00:00
Goober5000 fdd685fb8a we want to truncate based on number of lines, not number of characters
also, we want to truncate the FRED error message boxes too
(this is a better fix for Mantis #2658)
2012-07-14 06:23:45 +00:00
Goober5000 d05d04ec4f that's an order of magnitude too high for integers 2012-07-14 05:34:44 +00:00
Goober5000 5654733692 check to make sure a wing that has a player does not also have an arrival delay (Mantis #2678) 2012-07-13 05:06:08 +00:00
Swifty 3fff8216ed Target direction arrow properly disappears when target is placed under reticle. Fixes Mantis 2504. 2012-07-12 07:26:45 +00:00
karajorma e620a3e5e1 It's about time these changes got committed. They've been tested by Diaspora for over a year without issue. 2012-07-12 06:27:36 +00:00
The_E ab868da2d9 Various fixes and additions to the lua API from m!m:
Matrix vectors: getUvec(), getFVec() and getRVec()
equals operators for weaponclass and shipclass to improve performance where a string comparison was needed before
Cockpit display interface. Allows scripting to access the cockpit displays defined in ships.tbl and render to them using RTT
A getParent() function in the subsystem handle which returns the parent object of the subsystem
Numerous fixes in the way turret subsystems are handled which now results in more correct behavior
Targetable variable in subsystem which specifies if the subsystem is targetable or not
getNextFiringPosition() function in subsystem which returns the position and the direction of the next firing operation of the specified turret
Scripting access to post processing values
getCurrentCamera() function to retrieve the currently active camera
setLineWidth() to modify the width of the lines that are getting drawn
setClip() and resetClip() to set the clipping areas used for drawing
2012-07-11 17:19:33 +00:00
Goober5000 1798c9b750 add the mission cutscene save type, per Karajorma and MjnMixael 2012-07-09 06:48:53 +00:00
Goober5000 1d0e73adcf in the interest of avoiding mysterious and subtle differences in AI behavior, restore retail behavior where:
a) the player's wing forms on him at mission start
b) wings in the Starting_wings list will form on the player if they arrive later in the mission
c) no other wing automatically forms on its leader
2012-07-09 05:29:43 +00:00
Goober5000 807a3cf7cd also revert the "nohtl" part of r8977 for FRED (Mantis #2676) because no-HTL models shouldn't use HTL rendering 2012-07-07 21:01:27 +00:00
Goober5000 497d11c7af revert r8975 because this fix adds unwanted diagonal lines to the jump node model (Mantis #2396) 2012-07-07 21:00:37 +00:00
Goober5000 4195945a36 niffiwan's fix for Mantis #2681 2012-07-07 20:51:39 +00:00
The_E a28dc8beff Fix for Mantis 2682: extra glowpoints are rendered for targeted ships 2012-07-07 14:31:14 +00:00
The_E 227f6cc8ef *sigh* And because MSVC6 is a bit on the stupid side (read: Does not know about this little thing called C++0x), I have to do this bit of ugliness. 2012-07-07 08:41:12 +00:00
Goober5000 af4e7c3069 restore this extra space, which is necessary for formatting purposes 2012-07-07 07:39:46 +00:00
The_E 585db085ea Removing the rest of the glBegin()/glEnd() pairs. 2012-07-07 06:45:35 +00:00
niffiwan ab5709ecb2 Fix number 3 for mantis #2590 - move array overflow detection to correct place in loops 2012-07-07 01:39:27 +00:00
niffiwan 1ef253a65a Sync linux binary name format between 3.6.14 & trunk 2012-07-04 10:13:25 +00:00
Goober5000 8910b50d96 replace variables in recommendations too 2012-07-04 05:38:51 +00:00
Echelon9 cda28dba2f Fix for Mantis 2677: Compiler errors following r8973, thanks to niffiwan 2012-07-03 13:13:23 +00:00
niffiwan fdafa3f2a4 Linux release compilation back to using -Wall, but with -Wno-write-strings 2012-07-03 10:01:20 +00:00
Goober5000 5c6261c229 fix a rather important variable initialization
(follow-up to r8967)
2012-07-03 05:12:24 +00:00
Goober5000 53bc8c5821 this is the equivalent of r8975 for FRED (Mantis #2676) 2012-07-03 05:05:33 +00:00
Goober5000 5346544807 attacking a protected target will remove its protected flag, so don't allow this if hit by EMP
(Mantis #2192)
2012-07-03 05:02:32 +00:00
Goober5000 eac17f338e Zacam's fix for Mantis #2396 2012-07-03 05:01:33 +00:00
Goober5000 93c89a19ab fix for Mantis #2179, proper afterburner shutdown 2012-07-03 03:46:18 +00:00
The_E cc2b907673 Changes the glBegin()/glEnd() stuff we were using in some places to the more modern glDrawArrays() way of doing things. Thanks to Kromaatikse for the initial implementation. 2012-07-02 15:48:56 +00:00
Goober5000 495ab7fdb2 fix Mantis #1972: hotkey brackets are drawn around stealth ships 2012-07-02 06:00:41 +00:00
Goober5000 358d860542 fix TD2192...
[derp, wrong game]
fix Mantis #2192, EMP brings play-dead fighters back to life
2012-07-02 03:47:53 +00:00
Goober5000 ec5f9ccf81 CommanderDJ's set-player-throttle-speed 2012-07-02 02:17:35 +00:00
Goober5000 89eca40235 wings that are initially docked will now arrive in mission correctly 2012-07-02 01:59:35 +00:00
Goober5000 4cfd7f903a follow-up to r8922: this part isn't actually a problem 2012-07-01 19:54:22 +00:00
Goober5000 3a47eae3a7 make the dock leader code more robust, and make FRED mark dock leaders in wings correctly 2012-07-01 08:17:59 +00:00
Goober5000 7200341deb add more error checking for initially docked ships, per Mantis #1658 2012-07-01 05:56:15 +00:00
Goober5000 30ebd4ecfd looks like this was never actually implemented! 2012-07-01 05:54:26 +00:00
Goober5000 3e983aa390 add mod.tbl flag for Mantis #82 2012-07-01 04:32:03 +00:00
Goober5000 e1d4e74092 remove extension if user didn't 2012-07-01 04:17:22 +00:00
Goober5000 00d4f23209 this should fix all of the issues with docked fighters and bombers (Mantis #945) 2012-07-01 03:24:41 +00:00
Goober5000 b0af0aa71a fix for Mantis #2673, following Valathil's detective work 2012-06-30 23:31:48 +00:00
karajorma e23449f911 Minor fixes to the message.tbl settings I just added. 2012-06-25 14:23:00 +00:00
Goober5000 d71f6dda5f fix the old Volition bug where a docked ship would execute its default behavior even when the preceding comment explicitly said that it should "just sit here" :-/
also guard against a few edge cases related to this
(all of this is in regards to Mantis #945)
2012-06-25 10:39:26 +00:00
Goober5000 fcb0d8149d remove unused variable 2012-06-25 07:06:03 +00:00
Goober5000 9b885aca84 CommanderDJ's fix for Mantis #2628 2012-06-25 06:41:06 +00:00
Goober5000 3fd421d432 fine-tune Valathil's error message 2012-06-25 04:27:26 +00:00
The_E 72bfeef335 Changing glowpoint rendering from being a separate step during model rendering to being a part of the batch renderer. This makes glowpoint rendering much faster. 2012-06-24 20:17:46 +00:00
Valathil bf0756be2f Fix for Mantis 2671: Skip submodels that have been blown off in ship-ship collisions. 2012-06-24 18:12:43 +00:00
Valathil f97eac7851 Fix for Mantis 2670: Followup: Fix the bug without breaking mission parsing. 2012-06-24 14:04:16 +00:00
karajorma 480931fa17 Additions to message.tbl to allow users to specify the frequency of builtin messages. 2012-06-24 11:36:45 +00:00
IssMneur 9d335569f1 No warnings for release linux builds. 2012-06-23 21:19:41 +00:00
Valathil bd3a0fe0de Fix for Mantis 2670: Truncate tokens to their maximum length and pop up a MessageBox for the user. 2012-06-23 20:54:05 +00:00
Goober5000 583d702c80 synchronize the ship classes that evade shockwaves
(this fixes Mantis #2548)
2012-06-23 11:51:47 +00:00
Goober5000 715727c333 restore retail behavior for chaining by reverting r8603 -- this fixes Mantis #2667
also add descriptive comment in header file
2012-06-23 10:31:42 +00:00
niffiwan 56ab99d5cd Fix for mantis #2666: call the new HUD renderBitmap function for the red alert notification background image 2012-06-23 03:02:33 +00:00
The_E f0254524db From CommanderDJ: Fix for Mantis 2657 (Alt-Shift-E does not clear escort list) 2012-06-22 15:55:43 +00:00
Echelon9 40983c4f40 GCC warning: variable set but not used 2012-06-17 13:32:04 +00:00
Goober5000 7ef1c9f99a MSVC6 compatibility 2012-06-17 05:43:28 +00:00
Goober5000 367278315b revert r8893 since it's no longer needed and since RTTI adds overhead 2012-06-17 05:42:54 +00:00
Goober5000 1990e4a635 since the if() block already checks for a specific gauge type, we can safely do the static_cast 2012-06-17 05:41:47 +00:00
Goober5000 e5e06d1e32 MSVC6 project should have Run-Time Type Information enabled 2012-06-17 05:04:48 +00:00
Valathil 6d7674967f Fix for Mantis 2665: Include Player Ship's in the search for valid Message Sources 2012-06-14 21:52:23 +00:00
niffiwan 9a6611198e GCC warnings: more 'variable set but not used' 2012-06-14 11:21:09 +00:00
niffiwan bcea3057f5 GCC warnings: declaration of ‘ship_obj’ shadows a global declaration (weapon/*.cpp) 2012-06-14 10:30:01 +00:00
IssMneur 271d05ecc9 Recommit 8843 with a simpler fix to the build failure with GCC. 2012-06-14 04:44:13 +00:00
IssMneur dccd2d9811 Reverse 8843 as requested by Goober5000. Breaks compilation with GCC.
- This fix is too confusing.
2012-06-14 04:41:16 +00:00
Echelon9 79da099645 GCC warning: variable set but not used (related to HUD) 2012-06-13 14:50:57 +00:00
Echelon9 20ac5cb868 GCC warning: defined but not used 2012-06-13 14:43:08 +00:00
Echelon9 e5ef4467da GCC warning: missing initialiser for member ‘opengl_shader_file_t::attributes’ 2012-06-13 14:26:30 +00:00
Echelon9 d029db7f88 GCC warning: statement has no effect (clearing this warning as it was prevalent throughout) 2012-06-13 14:18:56 +00:00
Echelon9 43a7fd178a GCC warning: missing initialiser for member ‘<anonymous struct>::bitmap’ 2012-06-13 14:10:52 +00:00
Echelon9 2214bb7ac6 GCC warning: missing initialiser 2012-06-13 14:07:37 +00:00
Echelon9 dcbe91136b GCC warning: variable set but not used (further) 2012-06-13 14:07:05 +00:00
Echelon9 e9f103dfd2 GCC warning: variable set but not used (fireballs.cpp) 2012-06-13 13:20:04 +00:00
Echelon9 65adaf51a9 GCC warning: variable set but not used (within AI code) 2012-06-12 16:45:36 +00:00
Echelon9 eceb337219 GCC warning: variable set but not used (further cases) 2012-06-12 16:09:22 +00:00
Echelon9 65c6a8f51e GCC warning: suggest curly brackets (braces) around empty body in an ‘else’ statement 2012-06-12 15:57:21 +00:00
Echelon9 791146c9ac GCC warnings: first pass of warning: variable is set but not used 2012-06-12 15:32:47 +00:00
niffiwan d19c6702cf GCC warning: weapon/shockwave.cpp - variable set but not used 2012-06-11 10:12:09 +00:00
niffiwan 09c4bc2b00 GCC Warnings: mission/missiontraining.cpp - variable set but not used 2012-06-11 09:56:13 +00:00
niffiwan c8c0a213bf GCC Warnings: mission/missiontraining.cpp - variable defined but not used 2012-06-11 09:51:16 +00:00
Valathil ae1327c7b1 Fix for Mantis 2631: Take the main hall of first mission of the fallback campaign as the current one and save the campaign to the pilot struct. 2012-06-11 04:53:35 +00:00
niffiwan a6d501de98 Fix for last bit of mantis #2410: show training messages when hud-disabled-except-messages 2012-06-11 03:45:12 +00:00
Goober5000 39fc7d8834 Valathil's fix for Mantis #2652 2012-06-11 03:22:48 +00:00
Goober5000 03b8f478b1 remove the unnecessary null sets 2012-06-11 03:17:55 +00:00
Goober5000 e683881ac3 remove the vestiges of free_flight_time, which never worked 2012-06-11 02:52:43 +00:00
Goober5000 b14d2c4938 fix some aspects of homing (pun not intended), including hopefully Mantis #2652 2012-06-11 02:40:05 +00:00
Goober5000 bfe3f3f60c parentheses are A-1 SUPAR 2012-06-11 01:04:46 +00:00
Sushi 3ae15d873d Mastadon's fix to make auto-target pick the nearest enemy ship instead of the nearest ship attacking the player.
http://www.hard-light.net/forums/index.php?topic=80906.msg1614837#msg1614837
2012-06-09 01:33:53 +00:00
The_E 1413eddcd2 From CommanderDJ: Fix for Mantis 2663 (hud-set-color only works once per mission) 2012-06-08 14:45:41 +00:00
The_E 8e271af26b As requested and tested by VA, bumping MAX_INSTANCE_DEPTH to 10 2012-06-06 10:50:23 +00:00
Sushi 22ae177ba7 Fix Evil Turret Bug of Doom. :) 2012-06-06 06:17:23 +00:00
IssMneur c429e1ddec Reformat the function modified by 8842 so that we don't jump over a variable initialization
This issue was not picked up by VC, and was brought to my attention by ZekeS on #scp and his GCC build. Fix was tested by ZekeS.
2012-06-02 23:25:08 +00:00
IssMneur a28d92456e From Mastadon: "target nearest attacker" now selects only *attacking* hostiles
Fixes #2659
2012-06-01 02:07:56 +00:00
IssMneur 218ce9ed3f From Mastadon: "Target closest attacker" cycles through all attackers; misc code cleanup.
- Changed "target closest attacker" command to cycle through the other baddies gunning for you by pressing the "target closest attacker" command repeatedly.
- The new functionality behaves similarly to the "target closest hostile" key.
- Moved the esct (or, the "Evaluate Ship as Closest Target" struct) to hudtarget.h, where a type declaration belongs.
- Moved the documenting comments for hud_target_closest() to be just above the function definition.
-- Also, converted these comments to doxygen format.
2012-06-01 02:05:14 +00:00
niffiwan cc222f1b53 Add mod_table.* to codeblocks 2012-05-30 08:48:47 +00:00
Echelon9 3df38b912b Implement EModelAnimationPosition enum to more completely address boolean issue fixed in r8837 2012-05-29 10:27:52 +00:00
niffiwan 553766600d GCC Warning: declaration shadows a global declarationa (hudparse.*) 2012-05-29 10:24:00 +00:00
Echelon9 26e1226478 PVS-Studio fix: The 'false' value is implicitly casted to the integer type. 2012-05-29 09:55:54 +00:00
Goober5000 fae70dbb8d truncate assert strings, warnings, errors, and dump buffers if they are too long
(this should fix Mantis #2658)
2012-05-28 22:24:53 +00:00
Echelon9 e20a418c94 PVS-Studio fix: The 'false' value is implicitly casted to the integer type. 2012-05-28 13:35:39 +00:00
Echelon9 a04a14170f PVS-Studio fix: The 'modified' variable is assigned values twice successively. Perhaps this is a mistake (freespace.cpp:4666,4668) 2012-05-28 13:20:40 +00:00
niffiwan 2cded90031 Mantis 2419: add a new ETS gauge that behaves like the retail one 2012-05-28 08:13:35 +00:00
Echelon9 fd56997cdf GCC warning: Absence of curly brackets in initialiser 2012-05-27 15:00:40 +00:00
Echelon9 b0e614c410 GCC warning: base_res[0] and base_res[1] may be used uninitialised in this function 2012-05-27 14:52:56 +00:00
Echelon9 a8c54f5b9d GCC warning: initialisation reorder 2012-05-27 14:46:00 +00:00
Echelon9 68faf910cd GCC warning: suggest brackets (parentheses) around '&&' within '||' 2012-05-27 14:38:53 +00:00
Echelon9 4dcb3a7a16 GCC warning: comparison between signed and unsigned integer expressions 2012-05-27 14:23:41 +00:00
Echelon9 7dfa5bdd7a GCC warning: passing NULL to non-pointer argument, in hudtarget.cpp 2012-05-27 14:16:00 +00:00
Echelon9 4d31532aad GCC warning: passing NULL to non-pointer argument, in gropenglpostprocessing.cpp 2012-05-27 14:13:25 +00:00
Echelon9 7c41319714 GCC warning: missing curly brackets (braces) around initialiser for 'vec3d::<anonymous union>::<anonymous struct>' 2012-05-27 14:07:34 +00:00
Echelon9 55703bb600 GCC warning: Defined by not used, in lua.cpp 2012-05-27 14:00:17 +00:00
Echelon9 28c20e0468 GCC warning: converting to non-pointer type 'int' from NULL 2012-05-27 13:53:04 +00:00
Echelon9 592c9421ac GCC warning: Fix absence of parentheses, further 2012-05-27 13:35:05 +00:00
Echelon9 bd405ee457 GCC warning: converting to non-pointer type 'char' from NULL 2012-05-27 13:32:08 +00:00
Echelon9 0ba6d38a31 GCC warning: Fix absence of parenthesis 2012-05-27 13:07:53 +00:00
Goober5000 9fd70fd5a9 fix for Mantis #2117 (dock names with trailing spaces cause errors) 2012-05-22 08:39:13 +00:00
Goober5000 b5aa89a8e1 restrict multi-editing for Mantis #1681 2012-05-22 06:43:38 +00:00
Goober5000 7bc7c4297e time the briefing stages appropriately for text-to-speech (Mantis #2637)
also, make the briefing speech timing, which is badly written, a little bit more like the command briefing, which is a bit better written
2012-05-21 08:05:18 +00:00
Goober5000 f36a76ff5b the Microsoft documentation was misleading; there is a hidden "queued to speak" state 2012-05-21 05:24:47 +00:00
Goober5000 f3a0a1921d project changes to enable simulated speech 2012-05-21 03:53:58 +00:00
Goober5000 9785871010 if a movie fails to play, give back the mouse cursor 2012-05-20 20:50:17 +00:00
Goober5000 dc456c667b restore code that was inadvertently deleted, fixing Mantis #2478 2012-05-20 19:25:38 +00:00
niffiwan 381d50c74c Documentation for head-ani's && messages 2012-05-20 10:07:21 +00:00
niffiwan c634b65d24 GCC: remove trivial warning: multi-line comment [-Wcomment] 2012-05-20 06:31:09 +00:00
niffiwan 3eb66f7bae save a tiny amount of RAM when creating BMP_AABITMAP bitmaps 2012-05-20 06:15:23 +00:00
niffiwan b1b2920ea9 Fix for mantis 2655: play messages at least until head ani finishes 2012-05-20 06:03:24 +00:00
niffiwan 7dc94578b5 Fix for mantis 2411: allow repeated messages to play head anis 2012-05-20 05:41:53 +00:00
zookeeper b4c53dba03 Decoupled height and normal maps in one more place. 2012-05-19 10:10:12 +00:00
The_E 10a2e8d1d3 Ooops, forgot the safety check 2012-05-19 09:27:36 +00:00
The_E aa67e7dd1f Decoupling height and normal maps 2012-05-19 09:22:11 +00:00
The_E 749fee1a3d Turn -height into -noheight, to follow the precedent set by the other flags. 2012-05-19 08:51:12 +00:00
karajorma f883224269 Niffiwan's fix for 2590 seems to have introduced a bug of it's own. Easy enough to fix it though. 2012-05-19 02:28:41 +00:00
zookeeper af997d2b5d Added changes missing from previous commit. 2012-05-18 17:02:49 +00:00
zookeeper 3f34b57fb3 Allowed detail spheres to provide an $offset: x,y,z prop to offset the sphere from the model center. 2012-05-18 15:24:45 +00:00
Echelon9 de48302de6 GCC: Remove unused variable 2012-05-17 17:51:51 +00:00
Echelon9 9fc2a7c908 GCC: warning: converting to non-pointer type 'char' from NULL 2012-05-17 17:36:55 +00:00
Echelon9 d71a32677e Remove some unused variables 2012-05-17 17:20:36 +00:00
IssMneur ea75b099ff From jg18: Allow FSO to actually fetch the max anisotropy value rather than hard capping at 2.0. 2012-05-17 03:10:12 +00:00
IssMneur bcab66cd87 Fixes #2624. The sound environment should now track the camera correctly. 2012-05-17 02:57:33 +00:00
Goober5000 1d4dee495a if we are ignoring whitespace and we encounter a newline, don't eat it 2012-05-15 01:27:38 +00:00
Goober5000 896f0721dc make the closing color span brace be $} instead of $c} 2012-05-15 01:26:36 +00:00
Goober5000 270a4111c0 add capability to specify different nested default colors
(see http://www.hard-light.net/forums/index.php?topic=80766.0)
2012-05-14 06:48:47 +00:00
Goober5000 e704974a1b remove small warning 2012-05-14 06:32:58 +00:00
Goober5000 3cc5be68d8 other people than me also deprecate sexps now 2012-05-14 06:23:05 +00:00
The_E e0c1c21bae Fix for Mantis 2647, take two: Remove the pointers in question 2012-05-13 19:38:21 +00:00
Echelon9 5782378e6f Fix PVS-Studio warnings: The 'rval' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: freespace.cpp:8277, 8281.
The 'then' statement is equivalent to the 'else' statement. freespace.cpp:8311.
2012-05-13 05:00:31 +00:00
The_E be86dc5254 Introduces "-misc" maps, which can be used to pass information to shaders using the sMiscmap sampler and FLAG_MISC_MAP shader define. 2012-05-12 21:08:15 +00:00
The_E d03af34eed Add a log print for my previous mod.tbl addition 2012-05-11 11:30:19 +00:00
The_E b006d8de1a Since we can't change the default cutscene camera behaviour (switching off the HUD when cutscene camera is active), this introduces a mod.tbl setting to alter this behaviour.
The new setting is called "$Cutscene camera disables HUD:", is a boolean, and defaults to true.
2012-05-11 07:57:01 +00:00
Goober5000 6812854419 supernova-stop sexp, written by CommanderDJ 2012-05-11 06:34:49 +00:00
The_E 17a99ac973 Partial fix for 2410: Fixes Directive gauge ignoring hud-disable-except messages 2012-05-10 21:38:15 +00:00
The_E acffa5b358 Fix for Mantis 2606: Local SSMs fired in swarm may cause propagating NaN errors 2012-05-10 20:54:40 +00:00
The_E a57e263c7c Make sure we use a valid pointer for 8768 2012-05-10 15:06:41 +00:00
The_E 4d8c498628 Fix for Mantis 2647: Pointers becoming invalid when going out of scope during armor calculations (PVS Studio warning) 2012-05-10 15:04:05 +00:00
The_E c4f103e1d7 From CommanderDJ: Patch for Mantis 2650 (Allow 0 door animations in mainhall.tbls/tbms) 2012-05-10 12:32:19 +00:00
karajorma 998c7eb207 Add a SEXP allowing the FREDder to change the orders a player can give to a ship. 2012-05-09 05:09:40 +00:00
niffiwan a09306b31c From m!m: Fix for mantis #0002648 - skip intercom mainhall sounds when none are defined 2012-05-08 07:28:45 +00:00
Echelon9 04b12cf599 PVS-Studio fix: The conditional expressions of the 'if' operators situated alongside each other are identical. multi_ingame.cpp: 1073, 1086 2012-05-06 14:23:11 +00:00
Echelon9 5bc51383b7 Fix The_E's partially broken commit in r8757 -- there is no wi_flags3 or WIF3_NOLINK yet 2012-05-06 06:47:12 +00:00
niffiwan 65aedf36ad From CommanderDJ: Fix for mantis #0002646 2012-05-06 03:46:03 +00:00
The_E 0330dbf493 Fixes a few more bugs with the On Weapon Deselect hook 2012-05-05 22:05:46 +00:00
zookeeper a1ab5a725d Fixed a pointer assignment which should have been a value assignment. 2012-05-05 15:01:14 +00:00
The_E 9d3faf893e Adds ability for scripting to manipulate subsystem armor classes and shield armor classes as well. 2012-05-05 14:39:49 +00:00
The_E 2b40344bc7 Adds scripting access to a ships' armor type. 2012-05-05 14:07:31 +00:00
The_E 57d7fb7fbd Clarifies the code for the On Weapon Fired hook. also adds On Primary Fire and On Secondary Fire hooks. 2012-05-05 13:46:24 +00:00
The_E 49466254c7 Change this little piece of code to avoid a potentially very baffling null pointer dereference later on 2012-05-05 12:50:06 +00:00
Valathil a6d112c192 Fix for transparent submodels that are children of submodels. 2012-05-04 21:26:49 +00:00
Valathil bded282738 Fix for transparent cockpits that should'nt be transparent. Breaks lightshafts for cockpit models with glass which don't use "-trans". This may be remedied in the future. 2012-05-04 18:49:34 +00:00
Echelon9 6e51b354d1 Fix Mantis 2644: Replace vector<bool> with proper STL deque<bool>, thanks IssMneur and CommanderDJ 2012-05-02 15:20:57 +00:00
Echelon9 e21ad72877 Utilise the CLAMP() utility macro in a further range of appropriate locations 2012-05-02 15:15:48 +00:00
Echelon9 8a839fa159 Use CLAMP utility macro in lightin.cpp 2012-05-02 14:48:22 +00:00
Echelon9 721b3af9d7 Documentation: Doxygen comments for lighting.cpp 2012-05-02 14:35:50 +00:00
chief1983 dd13785941 Remove ltests from Xcode 3 project file. 2012-05-01 18:48:28 +00:00
karajorma d7d6009ea1 Fix a bug that caused bombs to be indestructible by the player for much longer than they should be according to the table settings given. 2012-04-30 07:47:23 +00:00
karajorma e5b2ebd02e Fix the bug in closing the event editor that caused it to take minutes with some missions rather than seconds. 2012-04-30 07:26:44 +00:00
Echelon9 5b7190ea39 Fix Assert and Assertion for non-MSVC compilers, due to changes in r8692; Fix use of C++11 cbegin/cend() STL operators as these are not going to be supported widely yet, due to changes in r8693 2012-04-29 11:10:29 +00:00
IssMneur cc521fcaa4 Make the asteroid.tbl parser generate a more useful error messages.
- Converts asteroid_info into the class that it is.
- Changes the asteroid.tbl parser to parse the table as specified
- Also removes the attempts at being clever from the asteroid.tbl parser.
2012-04-29 04:10:58 +00:00
IssMneur a95091db20 Rename the args of Assert and Assertion macros to be more helpful than just 'x' and 'y'. 2012-04-29 03:52:30 +00:00
Echelon9 15e5adf31d Documentation: Doxygen comments throughout mainhallmenu.cpp 2012-04-29 03:49:00 +00:00
The_E a415a803ee Update the MSVC projects to remove ltests.c from the lua library. 2012-04-27 11:01:24 +00:00
Echelon9 9e4f1cc30c Upgrade internal Lua interpreter to 5.1.5 bugfix release; announcement details http://lua-users.org/lists/lua-l/2012-02/msg00639.html 2012-04-25 13:40:32 +00:00
Echelon9 5828d17ac7 Fix Mantis 2640: Double free in missionbriefcommon.cpp, thanks 3dL3XAqPiDaS5WF2 2012-04-22 13:44:06 +00:00
Echelon9 52b421c56b Documentation: Remove redundant #includes 2012-04-22 13:36:31 +00:00
Echelon9 c4c33bea34 Fix Mantis 2642: Cockpits are rendered incorrectly when post-processing is disabled, thanks m_m 2012-04-22 13:34:37 +00:00
Echelon9 cbc7b49399 Setting the floats correctly in avd_movement constructor 2012-04-22 11:27:31 +00:00
Echelon9 51ad3f97eb Eradicate the memset(this...) paradigm within ade_table_entry 2012-04-22 11:25:15 +00:00
Echelon9 33918a1a17 Eradicate the memset(this...) paradigm within class avd_movement 2012-04-22 10:54:59 +00:00
Sushi 5669c03872 Add support for weapon spread over time (+FOF Spread Rate, +FOF Reset Rate, +Max FOF) 2012-04-21 15:40:06 +00:00
Echelon9 f28bd3e167 These two variables were missed; the sort of overlooked error that is easy with this odd method of copy constructing... 2012-04-19 13:22:44 +00:00
Echelon9 1da3f30ff4 warning C4018: '<' : signed/unsigned mismatch 2012-04-15 09:02:10 +00:00
Echelon9 4820ef1fdf warning C6246: Local declaration of 'i' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '1037' 2012-04-15 07:55:27 +00:00
Echelon9 b74f0dd2a1 warning C6246: Local declaration of 'i' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '832' 2012-04-15 07:44:11 +00:00
Echelon9 267a88eb59 warning C6246: Local declaration of 'i' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '1350' 2012-04-15 07:17:51 +00:00
Echelon9 81bd5a98f1 warning C6246: Local declaration of 'curspeed' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '1877' 2012-04-15 07:14:58 +00:00
Echelon9 8befbc7adf warning C6246: Local declaration of 'subsys' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '443' 2012-04-15 07:12:28 +00:00
Echelon9 fd74d06398 warning C6246: Local declaration of 'exp' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '8063' 2012-04-15 07:02:18 +00:00
Echelon9 12fbf17af5 warning C6246: Local declaration of 'pm' hides declaration of the same name in outer scope. 2012-04-15 06:57:05 +00:00
Echelon9 e798ee0f5e Ensure that the Xcode 4 project file can build Mac binaries for OS X 10.6, as well as 10.7 2012-04-15 06:20:56 +00:00
Goober5000 908557be9f fix for Mantis #2630
(LUA is not mentioned, but the problem might affect that too)
2012-04-13 07:01:45 +00:00
Echelon9 172ff073ef Documentation: Some extra notes within aiturret.cpp 2012-04-12 16:09:33 +00:00
Echelon9 3ce3fea911 Correct copy/paste error -- refer functions above for similar pattern used correctly 2012-04-12 16:05:57 +00:00
Echelon9 6bebe3c397 Documentation: Attempt to begin getting aiturret.cpp under control 2012-04-12 15:55:57 +00:00
Goober5000 63a78e79fd modular credits.tbl, courtesy of m!m
(with a few tiny tweaks)
2012-04-12 03:49:47 +00:00
Goober5000 34bfc4a12e const-correctness in preparation for modular credits.tbl, courtesy of m!m 2012-04-12 03:48:24 +00:00
Echelon9 a10b5ae804 warning C6011: Dereferencing NULL pointer 'wp->turret_subsys' 2012-04-11 14:44:59 +00:00
Echelon9 6ed3ce07d7 warning C6011: Dereferencing NULL pointer 'lowest_vol_osp' 2012-04-11 14:44:05 +00:00
Echelon9 067724f5a8 warning C6280: 'tmp_Player' is allocated with 'new', but deleted with 'free' 2012-04-11 13:04:28 +00:00
Echelon9 8947768fda warning C6246: Local declaration of 'props' hides declaration of the same name in outer scope 2012-04-11 13:00:28 +00:00
Echelon9 968f2e6423 warning C6246: Local declaration of 'temp' hides declaration of the same name in outer scope. 2012-04-11 12:59:16 +00:00
The_E ae084d47e0 Do shader compilation during modelload, in order to avoid having to compile shaders during gameplay as much as possible 2012-04-09 12:43:20 +00:00
Swifty edb5762d9c Optimization: sped up rendering of trails by switching out g3_draw_poly with gr_render. Removed extra memory allocation. 2012-04-08 22:00:16 +00:00
Echelon9 13ca0a1c67 Remove redundant #includes to fs2open's internal linked list implementation 2012-04-08 01:39:34 +00:00
Echelon9 c0df634874 Documentation: Complete documentation of CJumpNode 2012-04-07 23:31:23 +00:00
Echelon9 a0e59defd6 CJumpNode class code convention; convert to UpperCamelCase for class and function name; ensure all private variables adopt m_ prefix 2012-04-07 11:07:30 +00:00
Echelon9 7b1d5e1ece Documentation: A bit of code cleanup 2012-04-06 08:52:15 +00:00
The_E 66b5912d7b Converting this Assert() to an Assertion(), for better error logging 2012-04-04 22:01:32 +00:00
The_E 6157334fe8 MSVC Analyze warning fix: Incorrect type passed as parameter in call to function printf() 2012-04-03 19:44:39 +00:00
The_E 7cb8876976 MSVC Analyze warning fix: Local declaration of variable hides variable of same name in outer scope 2012-04-03 19:35:37 +00:00
The_E 3383b20893 Change the MSVC2012 projects to use the MSVC2012 toolset 2012-04-03 19:34:22 +00:00
Echelon9 164581168d Fix Mantis 2632: Sounds assigned to objects get dropped when limit hardcoded gets reached. Patch from m_m 2012-04-02 21:32:47 +00:00
The_E c2d19384f5 Fixes LLVM and Doxygen errors 2012-04-02 15:01:31 +00:00
The_E 95f56d3af7 New shader initialization code. This removes the big, ugly GL_Shader_file[] array, and changes shader compilation behaviour to only compile shaders on demand, not on program startup 2012-04-02 10:20:31 +00:00
zookeeper c3fe50ecce Made @Laser Color2 work even with a value of 0,0,0. 2012-04-02 06:35:19 +00:00
The_E 5d8b95c2f5 Same for secondary weapons 2012-04-01 15:09:24 +00:00
The_E 2f72134675 Fix for Mantis 2635: Invalid memory access when saving a mission due to a weapon bank set to empty. 2012-04-01 14:57:09 +00:00
Echelon9 8157463c4b Fix Doxygen documentation for wl_draw_ship_weapons() 2012-04-01 08:25:53 +00:00
Echelon9 0c9cfdfc93 PVS-Studio fix: The 'Player' pointer is used simultaneously as an array and as a pointer to single object. 2012-04-01 08:06:21 +00:00
Echelon9 0a45d3df33 PVS-Studio fix: The 'Players' pointer is used simultaneously as an array and as a pointer to single object. Check lines: 1392, 1410. 2012-04-01 08:05:29 +00:00
Echelon9 491793adcd PVS-Studio fix: The 'Weapon_info' pointer is used simultaneously as an array and as a pointer to single object. Check lines: 2962, 2975. 2012-04-01 08:04:40 +00:00
Echelon9 8caa385786 Xcode4: Add the common schemes 2012-04-01 04:58:26 +00:00
Echelon9 a9a9c43ea2 Remainder of Xcode4 project files 2012-04-01 04:44:45 +00:00
Echelon9 0fdfef37d4 Add Xcode4 compatable project file, along with SDL v1.2.15 that addresses Mac OS X 10.7 compatability 2012-04-01 04:28:04 +00:00
The_E 6badeadd54 As per discussion for Mantis 2633, Reverting revision 8544 due to timer drift. 2012-03-31 20:30:09 +00:00
zookeeper 7ebb6f53a3 Fixed a screwup in $detail_sphere distance calculation. 2012-03-31 20:10:26 +00:00
The_E 21ef9c620a Adding a few newlines here 2012-03-30 16:25:06 +00:00
Goober5000 913edc6294 revision 8155 inadvertently made ALL weapons area-effect... so don't add an automatic inner radius (for Mantis #2634) but still be careful about potential divide-by-zero 2012-03-30 05:58:55 +00:00
Zacam 2cb5b15bd8 Nukes changes to the Armor Table for Difficulty Scaling and additional options.
Potentially handles Mantis issues 2493 and/or 2494.
http://www.hard-light.net/forums/index.php?topic=78277.0
2012-03-28 06:25:26 +00:00
Sushi 92e593fb37 Gliding bugfix: only "decay" glide speed when actually thrusting. 2012-03-27 15:31:08 +00:00
The_E 28410c9ec9 Removing -img2dds, since it's highly unlikely that anyone would run into issues with it. 2012-03-25 21:22:27 +00:00
zookeeper a5279f786c Fixed a typo ("$Fix Turret Collisions:" -> "$Fixed Turret Collisions:"). 2012-03-22 06:52:35 +00:00
zookeeper a02fb5a869 Moved the features from r8621 and r8622 behind two game_settings.tbl flags. 2012-03-22 06:15:39 +00:00
Sushi f941c56597 Make $Max Turrets per Target only affect small ships (we can add a separate one for large ships later, if needed) 2012-03-21 15:07:28 +00:00
zookeeper 8890b61350 Made hits which directly impact a subsystem's submodel always deal damage to that subsystem first, even if other subsystems are closer to the point of impact. 2012-03-21 12:34:34 +00:00
zookeeper c14399cfb1 Made hits to a turret's barrel count as hits to the turret subsystem itself. 2012-03-21 12:31:02 +00:00
zookeeper c87c2cbd63 Added a "collide submodel" subsystem flag, which makes the subsystem take local damage only from shots which actually impacted its submodel. 2012-03-17 17:40:53 +00:00
Goober5000 8cd3cbc721 considering that both the HUD and sexp_replace_variable_names_with_values work with SCP_string, just use SCP_string directly and remove the character limit
also, MESSAGE_LENGTH isn't 32 characters
2012-03-16 04:09:30 +00:00
karajorma 2b445b41c0 Fix a rather unhelpfully vague piece of the SEXP documentation. 2012-03-16 03:28:57 +00:00
Swifty bebf5e8fbf Added hud-clear-messages. Clears active messages currently displayed. 2012-03-14 05:25:07 +00:00
Swifty d84d9a8f5d Allowed hud-set-directive and hud-set-message to set custom gauge text up to MESSAGE_LENGTH instead of NAME_LENGTH. 2012-03-13 06:54:13 +00:00
niffiwan d315a55fbe Update to 8602 - an even simpler fix 2012-03-12 10:08:10 +00:00
Goober5000 1372ff8a17 this isn't needed 2012-03-12 06:52:32 +00:00
Goober5000 e022277a42 redo the fix for Mantis #2627 so that we don't create temporary SCP_strings 2012-03-12 06:49:28 +00:00
Echelon9 124cbbfb99 Fix for Mantis 2629: PVS-Studio warning: The variable j is being used for this loop and for the outer loop. (controlsconfig.cpp 1613) 2012-03-11 11:19:06 +00:00
niffiwan 3163f80518 Fix for mantis #0002627: save filename to temp var in generic_anim_init 2012-03-10 04:01:51 +00:00
chief1983 596d99d685 This is probably a better way to add silent rules support. 2012-03-09 23:09:24 +00:00
chief1983 8dbc4660e2 Fix line ending issues from happening here too. 2012-03-09 18:32:17 +00:00
karajorma 6f4227e21d Well I find it hard to believe that in over eight years three senior SCP coders couldn't find THAT!
Fix Mantis 0082 (Repeat count sexp does not work reliably)
2012-03-08 15:19:42 +00:00
niffiwan 9489e74d9c Reorder setting of filename in game init to stop missions crashing in load screen 2012-03-08 10:55:33 +00:00
niffiwan 5a873d6646 Fix gcc compile error with yet more const ness 2012-03-08 10:55:22 +00:00
Goober5000 b146b10403 MOAR const-correctness! 2012-03-08 08:12:56 +00:00
Goober5000 a378cfe005 sexp strings are now SCP_string 2012-03-08 06:48:44 +00:00
Goober5000 9683410dbb const-correctness and SCP_string which is useful for sexp string conversion 2012-03-08 06:46:25 +00:00
Goober5000 c743b37a77 fix a derp by Echelon9 (local variable was hiding the member field) 2012-03-08 03:09:40 +00:00
niffiwan 2950030649 From Echelon9, fix for mantis #0002621 2012-03-07 09:23:34 +00:00
Goober5000 7d4fd7ee2a convert briefing and debriefing to use SCP_string 2012-03-07 05:23:21 +00:00
Goober5000 19fc7728ba one more bit of const-correctness 2012-03-07 05:22:55 +00:00
Goober5000 15d603b2e8 revert 8515 per Mantis #2607 2012-03-07 02:50:10 +00:00
Goober5000 5127340279 per discussion with mjn.mixael, fix error function so that it doesn't break on messages that are too long 2012-03-07 01:52:30 +00:00
karajorma dc9de13d85 Get the default chance of a pilot praising his own kills from mod.tbl rather than the hardcoded magic number it currently uses.
Switch mod.tbl to automatically read the default table first, then look for the one the mod uses. This guarantees that variables are initialised to something and simplifies the logic for mod.tbl a lot.
2012-03-07 00:45:28 +00:00
The_E c075661087 Mea culpa. I made a stupid mistake, goober's version was correct. 2012-03-06 12:35:12 +00:00
The_E 9b43020e26 Reverting 8581. If you are breaking freespace2.fc2, something is wrong with your code. 2012-03-06 12:20:59 +00:00
The_E d1607ffa3c Switches -glow, -normal, -spec and -env to be on by default. Renames commandline options to -noglow, -nospec, -nonormal and -noenv. Also renames -flightshaftsoff to -nolightshafts for consistency. 2012-03-06 11:53:41 +00:00
karajorma 2c1db51681 Allow modders to define a default campaign using mod.tbl 2012-03-06 11:21:29 +00:00
niffiwan f75e83c900 Fix for Mantis #0002604: using m_m's patch, allow swarm/corkscrew bank to keep firing if current bank changes 2012-03-06 10:09:04 +00:00
Goober5000 42942750e0 no need for this #define now 2012-03-06 05:16:16 +00:00
Goober5000 1e23f07948 fix the algorithm for trimming whitespace 2012-03-06 05:11:55 +00:00
Goober5000 d4adf75ffa change command briefing text to use SCP_string 2012-03-06 04:58:45 +00:00
Goober5000 a01d54e808 another change to parsing of XSTR ids because an id can be one digit long 2012-03-06 04:52:14 +00:00
Goober5000 75232cc2f3 const-correctness which will be useful for SCP_string 2012-03-06 03:41:57 +00:00
The_E a75d03ac05 Fix for Mantis 2619: Adds .png to FRED's list of recognized file formats for loading screens. 2012-03-05 23:00:06 +00:00
The_E 5c18143aa1 From casual_pilot: Fix for Mantis 2395 (incorrect index values passed to OpenGL) 2012-03-05 12:01:44 +00:00
The_E 88dbf09947 Properly updating all the projects to VS11 beta. Also sets toolset property to use the VS2010 toolset; given that almost noone has the MSVC2011 redistributable installed. 2012-03-05 11:33:52 +00:00
Goober5000 4e9915cc9b change fout routines to use SCP_string instead of large C string buffers 2012-03-05 09:23:01 +00:00
Goober5000 0d3f28e8d4 enhance vsprintf for SCP_string to be more intelligent in how it handles specifiers 2012-03-05 09:09:15 +00:00
Goober5000 bc9023f5ad fix a bug in the way XSTR ids were interpreted 2012-03-05 08:18:11 +00:00
Goober5000 97002e90ca use SCP_string internally in stuff_and_malloc_string to remove the need for huge temporary buffers
also fix a Volition derp with the function prototype: if you're mallocing a string, you don't need a maximum length
2012-03-05 06:20:23 +00:00
Goober5000 b0079dc0ce we might XSTR these at some point 2012-03-05 06:00:33 +00:00
Goober5000 589f7f332e use SCP_string for great justice 2012-03-05 05:55:43 +00:00
Goober5000 79e4c58064 just derping along 2012-03-05 05:49:25 +00:00
Goober5000 d22ad134fd a vsprintf equivalent is useful 2012-03-05 05:24:15 +00:00
Goober5000 f03eb16119 mjn.mixael's required weapon feature 2012-03-05 02:37:09 +00:00
Goober5000 806492779a partial revert of 8561: vm_malloc should never return null, so the Assert is necessary, and will immediately flag the error as it happens instead of leaving a mine to be triggered later 2012-03-04 19:19:11 +00:00
zookeeper 8e8d11962b Fixed the inability to use ship:TargetSubsystem to set the player's subsystem target during one frame even if the ship was not already being targeted. 2012-03-04 13:48:40 +00:00
Echelon9 8891526368 Fix for Mantis 2327 - Strange behavior with key-press, patch from Eli2 2012-03-04 13:05:41 +00:00
Echelon9 165721374a Fix for Mantis 2616 - Lua forward controls don't get applied to player controls, patch by m_m 2012-03-04 13:02:48 +00:00
Echelon9 f2856015ad PVS-Studio fixes: Resolve some warnings about use of pointers before checking for a null pointer 2012-03-04 08:51:59 +00:00
Echelon9 9ae918ead4 Fix SCP_string parselo code - std::string.c_str() function means it's a string being passed to Error(), not the whole std::string object 2012-03-04 07:50:47 +00:00
Goober5000 e2ccd37673 derp 2012-03-04 06:54:56 +00:00
Goober5000 83b09269f4 add variants of replace_one and replace_all 2012-03-04 03:59:29 +00:00
The_E 48977af19a Mod.tbl adjustments for VS2011 2012-03-04 00:44:52 +00:00
Goober5000 02def13365 add SCP_string variants of parselo functions 2012-03-04 00:20:09 +00:00
Goober5000 297725ee76 small project fix 2012-03-03 08:05:20 +00:00
Goober5000 138148c92a const correctness for fhash 2012-03-03 07:57:54 +00:00
Goober5000 a52b1e0c1b this is a fix that doesn't require #including another file 2012-03-03 02:02:32 +00:00
Echelon9 2fd00900f6 Fix Mantis 2620 - PVS-Studio warning: Consider inspecting the '(strlen(filename) > 6)' expression. A 5 year old bug. 2012-03-03 00:22:49 +00:00
Echelon9 e04e570078 PVS Studio fix: The conditional expressions of the 'if' operators situated alongside each other are identical (aicode.cpp) 2012-03-03 00:00:16 +00:00
Goober5000 805374a5d8 fix compilation for MSVC6 2012-03-02 22:00:33 +00:00
chief1983 52c60b1711 stdint.h and inttypes.h moved, and let's fix some paths that VC6 botched up for us again. 2012-03-02 20:29:19 +00:00
Goober5000 687cc4b87b mod_table project updates 2012-03-02 19:58:07 +00:00
Goober5000 abeb98a566 change stuff_vector to stuff_vec3d for clarity, since "vector" now refers to a dynamic list and "vec3d" now refers to the three-float struct 2012-03-02 04:26:44 +00:00
zookeeper e98ff51535 Eli2's minimal timer fix patch(es) from http://www.hard-light.net/forums/index.php?topic=79070.0 2012-03-01 19:16:31 +00:00
karajorma 76f8d96721 Fix a bug where placing the host in team 2 of a TvT mission would cause the clients to crash out. 2012-03-01 09:58:39 +00:00
chief1983 e290d97228 Add mod_table files to Xcode project. 2012-02-29 17:41:06 +00:00
Sushi 1af1c1644c Update VS2010 project to work with mod_table stuff. 2012-02-29 16:07:31 +00:00
Echelon9 5eb4e7728c Related to Mantis 2617 - there is no way this is correct, now we have a properly functioning constructor for mc_info 2012-02-29 14:13:22 +00:00
Echelon9 53aa9752f2 Fix Mantis 2617: LLVM warning: argument to 'sizeof' in 'memset' call is the same expression as the destination; did you mean to dereference it? 2012-02-29 14:09:42 +00:00
niffiwan adb2475528 Update makefile for new mod_table files 2012-02-29 10:33:58 +00:00
karajorma caf038d3fc Commit game_settings.tbl / -mod.tbm 2012-02-29 07:13:49 +00:00
karajorma f856776a6e Fix ignore-keys not blocking joystick or mouse buttons. (Mantis 2611) 2012-02-29 06:07:08 +00:00
Echelon9 35e26fb068 Diaspora code: Fix for Mantis 840 - Sounds for DRADIS, patch by m_m 2012-02-28 14:19:34 +00:00
Echelon9 621d82e1dd Diaspora code: Fix for Mantis 768 - Tabled explosion sounds for ships, patch my m_m 2012-02-28 14:17:07 +00:00
Valathil fe511293fa Fix for Mantis 2614: Remove that statement, it works fine without exponentiating the offset. 2012-02-27 16:45:29 +00:00
The_E d1c6d894eb Forgot newlines 2012-02-24 23:51:03 +00:00
The_E 5287c93dfe Deprecating stuff: Good. Printing messages to the log: Good. Using Warning() instead of mprintf(): Bad. 2012-02-24 23:25:00 +00:00
zookeeper 535c0f3bb5 Added subsystem:NextFireTimestamp scripting variable, exposing the ship_subsys->turret_next_fire_stamp variable to Lua. 2012-02-20 10:10:50 +00:00
zookeeper 56a62f6a46 Added subsystem:TurretLocked scripting variable, providing a way of directly getting/setting the locked status of a turret (also without the random delay incurred by the turret-free SEXP). 2012-02-20 10:07:38 +00:00
zookeeper 6198e29bad Added weapon:ParentTurret scripting variable, providing a handle to the turret (if any) which fired the weapon. This allows $On Turret Fired hooks to easily get a handle to the fired turret. 2012-02-20 09:59:34 +00:00
zookeeper 9f3bc98876 Fixed a few typos in scripting documentation. 2012-02-20 09:53:24 +00:00
The_E bff9ebae74 Fix for 8515: Need to init Use_GLSL earlier 2012-02-19 18:04:15 +00:00
The_E 19de3c06c9 From CommanderDJ: Fix for Mantis 2594 (FRED is unable to open mission files from the commandline or shell) 2012-02-16 13:54:45 +00:00
The_E 7284622f4a Fixes GLSL detection to switch off GLSL support if reported GLSL version is below 1.2 2012-02-16 13:00:18 +00:00
Zacam b78ad057e5 Reported by ni1s: GCC complaint about missing .c_str() in the updated dynamic MAX_SHIELD_ICON dynamic change. 2012-02-15 07:58:46 +00:00
zookeeper 472837efb3 Added the "no disappear" subsystem flag. http://www.hard-light.net/forums/index.php?topic=79093.0 2012-02-15 07:54:38 +00:00
niffiwan a7681b38d9 From CommanderDJ, fix for mantis #0002601: create constructor for player struct 2012-02-14 10:27:03 +00:00
zookeeper 19326e0a18 Proper way to fix what was attempted in r8439. 2012-02-11 16:42:16 +00:00
The_E 8163db606f Not only did rev 8439 not do what it was supposed to, it also broke subsystem scanning 2012-02-11 12:37:39 +00:00
The_E a95b79c879 Fix for Mantis 2603: Fullscreen_window window not centered. 2012-02-10 18:45:06 +00:00
The_E 6b4fd467a4 Given that hitting this assert can cause crashes in release builds, it's probably better if it's turned into an Error() instead. 2012-02-10 18:09:43 +00:00
zookeeper 9dfb30b67d Added subsystem:getModelName() scripting function, returning the original subsystem name as it appears in the model file, which is useful for example as a unique subsystem identifier. 2012-02-09 19:51:23 +00:00
zookeeper 924a188ac7 Made subsystems contain an objnum reference to their parent ship. 2012-02-09 16:06:37 +00:00
The_E f929dc0a49 Amendment to 8431: Introduces AI Profiles flag "$countermeasures affect aspect seekers:", which governs the behaviour in 8431 2012-02-09 14:40:59 +00:00
Zacam 15f7e72fc6 From CommanderDJ: Makes MAX_SHIELD_ICONS dynamic 2012-02-09 12:40:15 +00:00
Goober5000 b0585fe5c1 Mantis #2524 2012-02-08 07:28:27 +00:00
Valathil 3f69eafcbc Don't wait for brackets for messages without a target. 2012-02-08 02:49:34 +00:00
Valathil 21de0f9f73 Fixed the annoying OpenAL error messages in the log. AL_DOPPLER_FACTOR is only valid for alGet. Changed all instances to the correct alDopplerFactor. 2012-02-07 19:12:21 +00:00
zookeeper 828c766337 Slightly relocated the triggering of $On Turret Fired hooks as well as the setting of a few weapon variables. Makes sure that the variables only get set when a weapon is actually created and that all the weapon variables have been set before the hook is triggered. 2012-02-06 21:09:16 +00:00
Swifty d8118c3f8b Minor optimization when rendering tris that do not use distortion effects and therefore do not require calling glDrawBuffers. 2012-02-06 10:19:56 +00:00
Swifty dd1c4a436c Fixed Mantis 2413. hud-set-color changes to the HUD will no longer reset when pausing or entering options menu. Introduced Color entry fields for hud_gauges.tbl. 2012-02-06 10:01:01 +00:00
niffiwan fe25fc41d2 Fix for mantis #0002597: fix some GCC compiler warnings 2012-02-05 04:27:18 +00:00
Swifty 3affb86b52 Removed configOverride from HudGauge class since we don't even use it. 2012-02-05 03:41:31 +00:00
zookeeper b9aea9b532 Makes subsystem targeting brackets always get drawn in the right place in the targeting box. 2012-02-04 22:43:28 +00:00
The_E 747841add1 Make the OS_SUBSYS_ROTATION sound depend on the SSF_ROTATES flag 2012-02-04 22:08:45 +00:00
The_E b8c1a68989 Makes the $AliveSnd, $DeadSnd and $RotationSnd entries for subsystems work. NOTE: This will apparently not work correctly for nested subsystems. 2012-02-04 21:50:49 +00:00
The_E 855fe8cb34 Removing superfluous SSM alert message spawning. 2012-02-04 21:05:02 +00:00
The_E d8026058d5 Ooops, I accidentally broke flaks. 2012-02-04 19:25:20 +00:00
Valathil eea597decd Make $FlyBySnd actually do something and allow primaries as well. 2012-02-04 17:13:45 +00:00
The_E 09b28e2b71 Make aspect lock weapons react to countermeasures the same way as heatseekers do instead of going dumbfire. 2012-02-04 17:04:40 +00:00
The_E 6145ae753a A bit of cleanup in flak.cpp. Removes #defines made obsolete by previous commits, especially the hardcoded need for the "flk2" animation, which wasn't referenced anywhere in the actual code. 2012-02-04 13:48:58 +00:00
The_E 8636e43dbd oops, forgot to remove this terminal command 2012-02-04 13:32:03 +00:00
The_E 928ef7a91b A few parameters for Flak weapons as requested by fury. Changes:
-Arm Radius now determines how far a flak shell will have to travel before being able to detonate (used to be hardcoded to 10 meters)
-New weapons.tbl parameter "Flak Detonation Accuracy" to determine how far from a target a flak shell may explode (used to be hardcoded to 65 meters)
-New weapons.tbl parameter "Flak Targeting Accuracy" to determine the amount of jitter applied to turrets targeting other objects. Used to be hardcoded to 60 meters, applied as a radius around the target position
-New weapons.tbl parameter "Untargeted Flak Range Penalty" to determine the range penalty a flak weapon is subjected to when firing without a target. Used to be hardcoded to 20 meters.
2012-02-04 13:28:02 +00:00
niffiwan f5eb49e652 Fix for mantis #0002593: structs containing vectors don't like being memset to zero... 2012-02-04 11:01:18 +00:00
Valathil 1d64312266 Fix for Mantis 2534: Separate Warp IN and OUT when checking if the thrusters are behind the clip plane and don't do any checks for the "Hyperspace" warp type 2012-02-03 19:05:01 +00:00
Valathil 5fcc1c513e Add a random offset to the thruster distortion to make thruster clusters look better. 2012-02-03 15:27:24 +00:00
The_E 1c1ad1214d Given how often the particle shaders are called, moving them up to the beginning of the shaders array makes sense. 2012-02-03 10:27:33 +00:00
Zacam 3b865b16d3 Apologies to Swifty, this line change got truncated from the Font Fix. 2012-02-02 00:41:02 +00:00
Zacam dd6fb0d27b 100ms was perhaps a bit too long. The answer is, of course, 42.
Wait, what was the question...?
2012-02-01 23:13:11 +00:00
Valathil b9599be1cc Fix for Mantis 2588: Messages without voice files now show the target brackets for at least "Message Length" * 100ms 2012-02-01 20:27:25 +00:00
Zacam cf017ba490 From Swifty: Alternative fix to the font distortion problem by glyph realignment at the font creation phase rather than by manipulating the draw stage.
http://www.hard-light.net/forums/index.php?topic=79807.0
2012-02-01 20:07:36 +00:00
Zacam d56a2a188b Fix for the Fix for Mantis #2374: Had only updated the Effect 2 portion of the missionscreencommon. Don't I feel silly now. Did a little housekeeping while at it. 2012-02-01 17:31:19 +00:00
Zacam 82f68b59f5 Fix for Mantis #2374: Adds "+Closeup_pos:" and "+Closeup_zoom:" as entries following "$Tech Model:" for the weapons.tbl. For entries not using a dedicated $Tech Model, simply specify the $Tech Model as the same POF used in $Model to adjust Loadout Screen viewing position and zoom. 2012-02-01 14:11:45 +00:00
niffiwan 1b1ede220f Fix for mantis #0002590: fix array overruns caused by starting wings have > MAX_WING_SLOTS ships 2012-02-01 09:23:05 +00:00
Goober5000 ef62e392b0 more robust saving of dockpoint indexes (again for Mantis #2587) 2012-01-31 04:53:37 +00:00
Echelon9 b43c50e178 Adopt the mprintf() macro correctly. It needs the braces to wrap the format string and variables 2012-01-30 16:58:23 +00:00
Valathil 3a26811c1d Follow up to 8408: torename is a bad name since jnp is actually the jump node to be renamed 2012-01-30 15:24:46 +00:00
Valathil 9d1659aba9 Fix for Mantis 2523: Actually add the jump node to the vector after creating it and fix some new renaming code checks to work when you're trying to rename a node to the same name it had before. 2012-01-30 14:47:43 +00:00
Valathil 770593930a Fix for Mantis 2589: Deactivate the Special* buttons while no ship is selected 2012-01-30 12:53:16 +00:00
Valathil eb658ce53e Fix for Mantis 2458: Initialize stuff before calling the point_to_vec function so it has the right matrices for calculation, also fixed scripted sphere drawing 2012-01-30 09:29:32 +00:00
Zacam 4541545bed Slight touch up to Trunk Commit 8401: (! switch to !( to resolve a C4806 warning in MSVC. 2012-01-29 17:38:50 +00:00
The_E 858426d06a Fixes issue where the jumpnode destructor would try to use obj_delete() on already deleted objects. Also changes obj_delete() to no longer assert when called on an already deleted object; will print a message to the log now. 2012-01-29 16:37:52 +00:00
The_E 2583d974e5 Adds weapons.tbl flag "ciws". This allows a flak weapons' blasts and shockwaves to damage bombs (essentially a reversal of the way the "takes blast/shockwave damage" flaks work) 2012-01-29 12:13:12 +00:00
The_E c14dd6fa82 As requested by Diaspora: Adds "render flak" flag to weapons.tbl. This will allow the game to render flak shells. 2012-01-29 11:47:00 +00:00
Goober5000 ff4218e405 undo animations for undockings that happen from exploding or jettisoning cargo 2012-01-29 09:58:59 +00:00
Goober5000 5e2d53fba5 coded for Mantis #2587 but not actually used... this can allow a series of animations to be pushed and then popped 2012-01-29 09:19:40 +00:00
Goober5000 1732520514 fix Mantis #2587 2012-01-29 09:19:07 +00:00
Goober5000 b44df6f7be tweaks 2012-01-29 06:53:42 +00:00
Goober5000 0b8089d07f Vasudan Admiral's fix for the modelanim code 2012-01-29 05:05:59 +00:00
niffiwan e2be31bff0 Fix for mantis #0002591: add braces based on code indentation 2012-01-29 04:38:45 +00:00
Goober5000 c535100ae6 remove another four warnings 2012-01-29 03:24:36 +00:00
Goober5000 87b23a8184 remove warning 2012-01-29 03:23:12 +00:00
Goober5000 c84812fbda herp a big derp 2012-01-29 02:58:29 +00:00
Goober5000 ceb53cbb30 derp 2012-01-29 02:32:19 +00:00
Goober5000 f8c5a31a6a VA says this might work? 2012-01-29 02:26:26 +00:00
Goober5000 8b95cbb92b wait until animation finishes before separating during undocking 2012-01-29 02:12:09 +00:00
Valathil 09b5e02331 Fix for Mantis 2521: Don't use the ship list for updating when we're in the middle of creating it. 2012-01-28 21:00:51 +00:00
The_E 1460805856 Given that there's an exit path available right here, changing this Assert() into a Warning() seems appropriate. 2012-01-28 19:32:09 +00:00
Zacam 938a122440 Fix for Mantis 2538: From Eli2, corrects for looping fade issue reported by FelixJim. 2012-01-28 15:48:19 +00:00
Zacam eb4a6f6fff Getting annoyed by -mipmap being used when it doesn't need to be. Moving it out of general graphics and into troubleshooting where it more appropriately belongs. 2012-01-28 13:02:40 +00:00
niffiwan 35d796d7cb Fix for mantis #0002370: ignore missing starting wing indexes during mission restart 2012-01-28 11:10:30 +00:00
Goober5000 cd7874e856 two new sexps, signum and trigger-submodel-animation
also, fix a smattering of missing sexp stuff from other people's commits such as argument types, validity checking, putting things in submenus, and using is_sexp_true
2012-01-28 07:56:26 +00:00
Zacam a3c0ed6880 Fix to Trunk r8379, for want of a ; a compile was lost. 2012-01-28 07:07:07 +00:00
Goober5000 7d99d1016a update docking code some more
add code logic to (theoretically) set submodels instantly to initial or final positions
2012-01-28 02:51:42 +00:00
Goober5000 e4c749ed2c enhancement for bug 2582: trigger animations on BOTH ships undergoing docking 2012-01-27 07:42:13 +00:00
Goober5000 86e53c60b7 remove unnecessary warning 2012-01-27 07:40:23 +00:00
zookeeper fe604aaf4a Added support for the $detail_sphere submodel prop. 2012-01-26 14:25:20 +00:00
Goober5000 a54cfd15de partial fix for Mantis #2582:
--add Vasudan Admiral's fix for setting submodels to their initial positions
--add trigger for moving submodels to their docked positions when an initially-docked ship arrives
2012-01-26 03:57:23 +00:00
Zacam b0d077677b From Eli2: Mantis #2538: Fade-in time limitation.
Testing in Multiplayer as well, no drastic incompatibility found. (If the host is patched but the client is not, then the timing returns are a little funny, but it doesn't cause for any crashes)
2012-01-24 05:54:55 +00:00
Valathil d637e02f30 Fix for Mantis 2556: Check if the mouse cursor is really there before drawing it. 2012-01-24 04:11:13 +00:00
Valathil 6d7ce503d5 Fix for Mantis 2583: Reinitialize the timer right when changing selection modes. 2012-01-24 00:13:21 +00:00
The_E 64ce84c367 Makes a very strangely coded warning more readable and useful. 2012-01-24 00:11:07 +00:00
Goober5000 de6eb9460d upgrades to the docking system to incorporate docking animations -- incidentally, fixes Mantis #2581
also, remove DOCK_BACKUP_RETURN_VAL which never did anything even in retail
2012-01-23 23:27:06 +00:00
Valathil a8206df327 Follow up to 8289 + 8310: Make the sprite rotation independent of the camera direction and revert the docking change and make it simpler 2012-01-23 22:50:01 +00:00
Valathil 3d045470eb Fix for Mantis 2580: Use the texture matrix in the vertex shader to support texture panning. 2012-01-23 19:12:16 +00:00
The_E eed196e9ba Followup to 8327: Texture names from pofs are provided without extension, so we have to make sure to account for it. 2012-01-23 13:51:13 +00:00
Goober5000 43fdfaa209 fix Mantis #2579 2012-01-23 02:48:33 +00:00
The_E 9b15f2bc0f Fix for Mantis 1997: "Filename too long" warning for nonexistant textures. 2012-01-23 01:25:08 +00:00
chief1983 46d1ff7d7f Fixes #2578 - Change the < in these checks against NAME_LENGTH to <=. 2012-01-23 01:22:05 +00:00
Valathil 2184d3698b Follow up to 8289: Change the rotation back to relative cause of flipping out billboards at certain viewing angles and fix the dock rotation another way. 2012-01-22 14:01:18 +00:00
Echelon9 7b5b59e913 Fix for Mantis #2523: FRED Waypoints/Jumpnode Refuses Rename Leading To Unescapeable Loop 2012-01-22 12:00:08 +00:00
Echelon9 bedaf72b94 Fix LoopingSoundInfo constructor, as reported by Goober 2012-01-22 09:30:01 +00:00
Echelon9 a8c5c80a39 Fix for Mantis #2540 - confirmed by Goober to resolve the constructor warnings 2012-01-22 09:19:57 +00:00
Goober5000 64e430b586 quash a warning 2012-01-22 09:19:22 +00:00
Echelon9 ac96bad97b Documentation: pedantic rename of this function to describe it better 2012-01-22 08:52:31 +00:00
Goober5000 599efc960f follow-up to 8299: we need to check visibility for our own team in case we have a friendly-stealth-invisible ship covered by AWACS, or something 2012-01-22 06:51:53 +00:00
Echelon9 f95628f94d Documentation: Missionweaponchoice.cpp and related changes. Removed a few redundant functions. 2012-01-22 06:47:55 +00:00
Goober5000 854e55c843 don't remove the escort flag from invisible ships that aren't on the escort list (fixes Mantis #2057)
also, don't remove dead or dying ships from the escort list, because due to the design of the culling function, they were never removed previously
2012-01-22 06:40:12 +00:00
Goober5000 149797ae75 the proper way to fix Mantis #2441 is by modifying the team_visibility_update function
also, clarify terminology: in-frustum/not-in-frustum replaces visible/invisible
and do some minor rewrites for additional clarification
2012-01-22 05:37:09 +00:00
Zacam 3514f7a961 From Valathil: Adjusts view point rotation in 3rd Person/chase view. This is especially apparent in Nebula missions where rotating in Chase View is radically different from cockpit view. This fix corrects that, and has additionally been tested in Multiplayer. 2012-01-22 03:13:33 +00:00
Zacam 256c881885 Purely aesthetic. I have no idea what a packlock is. 2012-01-22 02:30:02 +00:00
Goober5000 9ab3a0728f tie scramble-messages and unscramble-messages into the communications subsystem status so that they will affect all aspects of communications in a consistent way (squadmsg menu, dashed text, etc.)
also make hud_communications_state() be a pure function, i.e. one without side effects
also fixes Mantis #2577
2012-01-21 22:08:38 +00:00
Valathil 49c31e34cd Fix for Mantis 2575: Don't increment array indices without checking for the maximum. 2012-01-21 19:52:00 +00:00
zookeeper c12fa5c183 Small scripting documentation fix: modeltextures -> modeltextures_h. 2012-01-21 15:52:31 +00:00
zookeeper ab34afd212 Added the $On Turret Fired scripting hook. 2012-01-21 15:16:53 +00:00
The_E a915fda2f5 Fix a few unused variable warnings that popped up after recent commits by Echelon9 2012-01-21 12:40:53 +00:00
Valathil c39576fce8 Fix for Mantis 2522: Moved the calculation of the sprite rotation to get the updated orientation matrix after dock calculation. 2012-01-21 10:33:57 +00:00
Goober5000 17bdae26b5 project file changes for wxfred 2012-01-21 08:41:15 +00:00
Goober5000 bc9cfe782f VC6 compatibility 2012-01-21 07:58:07 +00:00
Echelon9 90b17eacd0 LLVM Warnings fix: Value stored to is never read and related, in mission folder 2012-01-21 07:48:24 +00:00
Echelon9 447af95475 LLVM Warnings fix: Value stored to * is never read, in missionweaponchoice.cpp 2012-01-21 07:27:49 +00:00
Echelon9 bc8e853ae5 LLVM Warning fix: Various warnings within hudtarget.cpp and ancilliary changes 2012-01-21 07:21:51 +00:00
Echelon9 3d05a92ace LLVM Warning fix: Value stored to goal_changed is never read 2012-01-21 06:44:12 +00:00
Echelon9 0c56cdc7f1 LLVM Warning fix: Value stored to percent_left is never read 2012-01-21 06:42:29 +00:00
Echelon9 4923b671f2 LLVM Warning fix: Value stored to num_offsets_on_this_line is never read. Btw no need to clear this specific variable as it is defined within the while() loop, unlike the others. 2012-01-21 06:36:52 +00:00
Echelon9 9557a779de LLVM Warning fix: Value stored to ship_is_ballistic is never read 2012-01-21 06:34:11 +00:00
Echelon9 7501ff2bef LLVM Warning fix: Value stored to target_objp is never read 2012-01-21 06:27:54 +00:00
Echelon9 2873a28131 LLVM Warning fix: Value stored to enemy_ship_type is never read 2012-01-21 06:25:30 +00:00
Echelon9 3ec5e94ff2 LLVM Warning fix: Remove this dead code to ai_shipname 2012-01-21 06:18:22 +00:00
Echelon9 f0746c2524 LLVM Warning fix: This is a dead store to the value done_reading. 2012-01-21 06:10:45 +00:00
Echelon9 e67348d4e6 LLVM Warning fix: This is all dead code, removing. 2012-01-21 06:09:50 +00:00
Echelon9 eb8d60d281 LLVM Warning fix: No need to assign value to entry.ship_class twice. 2012-01-21 05:57:42 +00:00
Echelon9 3251ea5c95 LLVM Warning fix: Resolve an order of precedence issue with && and || 2012-01-21 05:40:58 +00:00
Valathil dd810fa34e Fix for Mantis 2576: Use the beam direction as the applied force vector 2012-01-21 04:07:27 +00:00
Goober5000 9ace109aa0 update to revision 8263: one should probably reset the special shields if you reset special hitpoints 2012-01-21 03:58:42 +00:00
Valathil 41a875c5e2 Fix for Mantis 2461: Check to see if the reduced damp timestamp is valid so we don't get ridiculous acceleration values. 2012-01-21 01:54:17 +00:00
The_E 438aee9862 These error messages need to be waay clearer 2012-01-20 14:55:06 +00:00
Zacam 49e9c6a1d5 From CommanderDJ: makes the maximum number of intercom sounds, misc anims and door anims dynamic (v2)
http://www.hard-light.net/forums/index.php?topic=78856.msg1574656#msg1574656
2012-01-20 02:13:38 +00:00
Valathil 16df14125d Fix for Mantis 2574: Timestamps do not work that way, also fixed the rapid fire "Out of Energy" sound for fighter beams. 2012-01-20 01:35:19 +00:00
Valathil dd6fa1c906 Fix for Mantis 2553: Fix overdrawing subspace glows by changing them from thrusters to normal bitmaps therefore avoiding a render time problem with the thruster geometry batcher. 2012-01-19 19:15:43 +00:00
The_E a3e00635d6 Fix for Mantis 2573: Special Hitpoint settings get carried over when deleting and adding ships in FRED 2012-01-19 11:41:19 +00:00
Goober5000 3f0914f407 need to use subsystem_stricmp for subsystems 2012-01-19 07:05:50 +00:00
Valathil e3773925ee Fix for Mantis 2572: Just dont render 0.0 Laser Length weapons 2012-01-18 19:21:38 +00:00
niffiwan a3fc01c2d6 Fix for mantis #0002480: when emptying secondary banks use the standard function to select the next bank 2012-01-18 10:12:38 +00:00
Valathil 42a0fd0626 Fix cockpit simulated brightness for lightshafts: Recalculate even if falloff is 1.0 and use the actual sample number 2012-01-17 17:13:01 +00:00
Zacam 351922e042 Slight update to unify the formating of the built in shaders. This behaviorally changes nothing, just their presentation. 2012-01-17 00:18:22 +00:00
chief1983 a5fae58600 Fixes #2571 - Changes a value in each config to match the config name. 2012-01-16 01:34:01 +00:00
The_E 149ec390d1 Followup to 8232: Fixes slight mistake in the usage of boolean operators 2012-01-16 00:09:49 +00:00
Zacam 23b6548390 Update to Commit 8223: When adding more lines to an IF, brace it please. 2012-01-15 23:33:49 +00:00
The_E f89d327e48 Made the failure message for failed model loads include the model filename. 2012-01-15 17:07:37 +00:00
The_E f93cd55032 Fix for Mantis 2441: "friendly-stealth-invisible" flag doesn't work 2012-01-15 14:14:46 +00:00
The_E f23c5ebba7 Fix for Mantis 1768: Cutscene bars do not display properly. 2012-01-15 13:29:00 +00:00
Echelon9 45ba7fd411 Removing the redundant weapon_create_names(). If you want to find Weapons by name, the Weapon_names[i] approach is not the right one. Found by Eli2. 2012-01-15 12:08:31 +00:00
Echelon9 e57fc904b5 Fix initialisation bug in the weapon_info struct, from within init_weapon_entry(). Patch from Eli2 2012-01-15 11:19:14 +00:00
niffiwan 13274d4fc5 Fix for Mantis #0002443: allow primary weapons to have fire_waits longer than 5 secs 2012-01-15 10:55:09 +00:00
Goober5000 494bdf6493 yeesh... part of the original iff_defs feature that wasn't updated 2012-01-15 08:13:50 +00:00
Echelon9 dc4371680a Clear a whole set of LLVM warnings - some of these would have caused memory fubars, so should marginally improve stability 2012-01-15 08:08:15 +00:00
Echelon9 d57bcd41a1 Ensure we don't leak memory on Mac OS X. Any object created with a CF*Create() function must have CFRelease() called upon it. 2012-01-15 07:27:41 +00:00
Echelon9 53d407332f Fix LLVM warnings in weapon folder 2012-01-15 07:05:20 +00:00
Valathil 86dcd45e50 Fix for #2570: Changed the external camera messages to be IFF color and internal messages back to green 2012-01-15 03:11:12 +00:00
Valathil b126751503 Fix for #2549 & #2457 - Fixed rendering of bars and moved earlier in code so we dont overdraw the hud messages 2012-01-15 00:09:59 +00:00
The_E 7f49ef1a9d Fix for Mantis 1803: Lensflares are rendered with no sun in sight 2012-01-14 23:20:05 +00:00
Valathil bca5096e9a Fix OpenGL errors caused by animated shaders when not rendering to a fbo 2012-01-14 19:24:29 +00:00
Valathil 80c44ab1f0 Fix "Unable to get shader uniform location" warning for distortion shaders 2012-01-14 19:03:55 +00:00
The_E 3477e1d968 Fix for Mantis 2568: "Fog Near/Far Mult:" being written to mission files even when in retail compatibility mode. 2012-01-14 10:55:13 +00:00
Echelon9 cccabac1af Fix for #2567 - LLVM warning: Semantic issue in lua.cpp 2012-01-14 00:31:14 +00:00
Echelon9 7270d1fb88 Fix for #2566 - GCC warning: NULL used in arithmetic in lua.cpp (lua_getstack(L,n+1, ar) == NULL) 2012-01-14 00:22:58 +00:00
Echelon9 a24370a2e2 Fix for #2565 - GCC warning: Use of unary operation that may not be intended in lua.cpp (type =- 1;) 2012-01-14 00:17:03 +00:00
Echelon9 4389dae0e0 Fix for #2564 - GCC warning: Use of NULL in arithmetic operation in ship.cpp (winfo_p->pre_launch_snd != NULL) 2012-01-14 00:13:25 +00:00
Echelon9 f8fddac844 Fix for #2563 - GCC warning: Equality comparison with extraneous parentheses in ship.cpp (Ai_tp_list[i].obj_type == -1) 2012-01-14 00:00:31 +00:00
Echelon9 2a00ead369 Fix for #2562 - Expression result unused in ship.cpp (ship_system->turret_swarm_num) 2012-01-13 23:54:19 +00:00
Zacam 5e34a60d35 Okay. This was ridiculous running all these changes separately. This setts svn:eol-type across the board for types that were not previously set to LF as they should have been. 2012-01-13 18:44:18 +00:00
Zacam 6c702a11e6 svn:eol-type set to LF. 2012-01-13 18:37:09 +00:00
Zacam f6ad6b14b6 Synchronization of differences between Antipodes and Trunk. Cause unknown, just commit drift issues. Regular auditing will catch these faster, but people need to pay more attention when syncing Trunk changes over to Antipodes. 2012-01-13 17:49:57 +00:00
The_E 6b1bf3ea0f Various scripting patches from m!m:
--Eyepoint access to the model handle
--getCollisionDistance() to the collision info handle to get the precomputed distance to the hit point
--A Disabled variable for the ship handle
--getTimeUntilExplosion() for the ship handle to get the time until the ship finally explodes
--A change to the documentation of ad.play3DSound() to reflect that the function also takes position parameters
2012-01-13 17:46:36 +00:00
The_E 10713cebc4 Fix for Mantis 2561: Rotating guns don't rotate. Allows gun rotation property to be set by using "$gun_rotation". 2012-01-13 10:44:55 +00:00
chief1983 bea9ef7c36 Fix for #2559 - new frameworks file that strips the metadata files out of the archive. 2012-01-11 17:43:26 +00:00
The_E b9f9b49e4f Make sure the FXAA pass only draws to COLOR_ATTACHMENT0 2012-01-11 17:41:52 +00:00
karajorma bfb54ea844 Split the Locked flag in two so that you can lock Ships or Weapons independently. 2012-01-11 07:57:36 +00:00
karajorma a15a260245 Change the define to one that is a little less confusing. 2012-01-11 01:46:50 +00:00
karajorma 28db28427b Not that it matters much since it's that's what it's ending up as anyway but since the variable that uses it was switched to unsigned we might as well change this. 2012-01-11 01:44:24 +00:00
Zacam 93c43bfced Fix for Mantis 0002558 : Resolves the issue by updating the libpng provided to version 1.5.7. 2012-01-10 21:43:30 +00:00
Valathil 164898ee8e Made WIF2_SMALL_ONLY weapons on turrets not fire on HUGE ships when grouped with other weapons that are not WIF2_SMALL_ONLY 2012-01-10 18:34:50 +00:00
The_E d36f05218d Another Assert->Assertion change. Also changes parsing code to throw warnings when a shockwaves' inner radius is zero. 2012-01-07 00:44:48 +00:00
The_E 03d9233618 Remove incomprehensible Comment 2012-01-06 18:20:44 +00:00
The_E ecb11b095c We were disabling the framebuffer a bit too soon here. 2012-01-06 01:03:37 +00:00
zookeeper 9b5dbe6674 Added support for a fourth targeting box render mode and re-structured some of the targeting box rendering code to make it easier to read and extend. 2012-01-05 20:13:14 +00:00
zookeeper a42c430650 Added support for the $Targetbox Shader Effect option in hud_gauges.tbl. 2012-01-05 19:48:39 +00:00
Zacam 61a9ed4700 spotted by ni1s: Need an '#include <limits.h>' to make compilers happy when using MAX_INT. 2012-01-03 15:13:17 +00:00
The_E 4c0c94f70d Removed an unused #define 2012-01-02 15:51:04 +00:00
The_E 9bc2ac733f Small fix to make gcc happy. 2012-01-02 12:28:58 +00:00
karajorma fb561c55c3 Remove a magic number. This number will probably become something defined in mod.tbl eventually but for now at least it's easy to find again. 2011-12-31 06:51:21 +00:00
karajorma e95201e041 Training weapons shouldn't cause smoke to come off of ships which haven't really taken any damage. 2011-12-31 06:49:30 +00:00
karajorma 4be0d29712 Switch from the directive-is-variable SEXP to the more powerful directive-value one. 2011-12-31 06:46:47 +00:00
Valathil f7ccb35817 Fixed font rendering at high resolutions 2011-12-29 18:16:04 +00:00
zookeeper 2a79bd427e Fixed stupid mistake in previous commit. 2011-12-29 08:37:44 +00:00
zookeeper 0815b6f5a6 Fixes ships not rendering during hyperspace warpin due to r7936. 2011-12-29 08:13:27 +00:00
IssMneur d53bf32cb8 From CommanderDJ: - Fully vectorize and stringify mainhall.tbl internals
- replaces all arrays with SCP_vectors
 - replaces all c-strings with SCP_strings
 - depreciates +Misc Anim Handles: and +Misc Anim Flags: because they are just cruft
 -- +Misc Anim Handles: has not been hooked up for years
 -- +Misc Anim Flags: are dealt with automatically
2011-12-29 06:28:05 +00:00
The_E b84060a437 Fixing an old mistake I made back in September 2010. Note: Assertions are optimized out of release builds, leaving this necessary skip out. 2011-12-29 00:53:49 +00:00
chief1983 dd4026f82a Make sure to include the right lua headers on all platforms, as pointed out by rhl. 2011-12-28 19:53:50 +00:00
The_E ebf89c9ef2 We do need to bind the correct depth buffer for rendering, else things get all confused. 2011-12-26 16:20:38 +00:00
The_E 34e536cd90 We only need to set up Scene_Depth_texture once, there must have been a merge gone wrong somewhere 2011-12-23 17:17:55 +00:00
The_E 41d68f3aca From m|m: Fix for Mantis 2400 (RTT rendering broken in current builds). Also changes GL_rendering_to_framebuffer to the more aptly named GL_rendering_to_texture. 2011-12-23 13:09:39 +00:00
Echelon9 e98f25198c Adjust alignment when shader debug logs are written. 2011-12-23 00:15:46 +00:00
Valathil 04af86b7a4 Added hardware accelerated YUV to RGB conversion with shaders to the ogg video renderpath. 2011-12-22 16:40:50 +00:00
The_E 09b8d1e3d1 Adds an intermediate render target for FXAA to work against, this removes a previous reliance on undocumented behaviour in OpenGL. 2011-12-22 15:12:18 +00:00
Valathil 7ffe518adb Allow for FS1 shader effect to be customized in post_process.tbl 2011-12-22 14:40:30 +00:00
Zacam 226cd53d8a From CommanderDJ: SCP_Vector-izes some more of the Main Hall structures (intercom and misc anim mostly) 2011-12-22 00:13:31 +00:00
zookeeper 6353841820 Removed the unused "Ghost Save" entry from Object_type_names, because it was causing an off-by-one when using the getBreedName() scripting function. Also added "Beam" to the list since it's a valid object type. 2011-12-21 08:30:34 +00:00
The_E 8ca2106ad5 Fix for Mantis 2498: Invalid species reference in ships.tbl is not detected. 2011-12-21 01:14:01 +00:00
Valathil da24970b18 from zookeeper: make hv.Player availiable in "$On Gameplay Start" scripting hook 2011-12-20 21:50:38 +00:00
Valathil 4096a41ac3 Fixed Swarm Salvo turrets Spamming their ordinance since 7981 2011-12-18 16:52:35 +00:00
The_E 0bbca2cd79 Removing two unused variables 2011-12-18 16:36:49 +00:00
The_E 90982854b2 Fix for Mantis 2545: Default ship in FRED is not the ship defined by #Default Player Ship 2011-12-18 16:35:10 +00:00
The_E 07b03ff2b3 Fix for Mantis 2550: Text in multiplayer is rendered outside the textbox if custom fonts are in use 2011-12-18 16:00:26 +00:00
Goober5000 c7b38b0b92 fix for Mantis #2547 2011-12-18 08:45:47 +00:00
Goober5000 47a51b8e37 make sexp category stuff accessible
fix Mantis #2551
2011-12-18 08:43:37 +00:00
Zacam fa6fc231b5 Tortoise Merge somehow screwed the application of the patch for Commit 8093, my apologies to everybody. 2011-12-15 18:53:41 +00:00
Valathil d839351511 Fix rendering of Sun Coronas and Lens Flares 2011-12-15 18:45:13 +00:00
Zacam e6d7b56a3b From CommanderDJ: Corrects the timing problem caused by commit 8079 regarding the playing of Main_hall misc_anim sounds. 2011-12-15 15:31:20 +00:00
Zacam 1ad0e977ff Fix to the sexp_ship_effect causing an assert when used against ships that get destroyed before the event triggering it fires off. (From The E) 2011-12-13 16:32:17 +00:00
The_E a3e0dedf6f Fix for trunkated command briefs when custom fonts are in use 2011-12-13 16:11:49 +00:00
IssMneur e2ad4c2064 From CommanderDJ: parse the mainhall only on first load.
Adds -reparse_mainhall to enable the previous behaviour of parsing the mainhall on every viewing of the mainhall.
2011-12-10 17:56:15 +00:00
Echelon9 faa029e540 Fix small compile issue on Apple OSX with new Valathil lightrays code 2011-12-09 09:48:35 +00:00
IssMneur bc71e0abaa From ni1s: Apparently gcc chokes on this without the space. 2011-12-09 07:23:36 +00:00
IssMneur 2eff95c4ea Allow names in mainhall.tbl sound lists.
Allows sound names in addition to sound indexes in the sound lists:
 +Intercom sound:
 +Misc anim sounds:
 +Door sounds:
Extends parse_sound to search in the interface sound table instead of the main sound table.
2011-12-09 06:38:16 +00:00
IssMneur 58ebb97d26 Fix breaking of FRED by revision 8069. Sun_spot was only declared in freespace.cpp which fred doesn't have linked in. 2011-12-09 06:24:07 +00:00
IssMneur e496117892 From CommanderDJ: add check_for_eoln() to parselo.cpp. 2011-12-09 05:48:35 +00:00
chief1983 40372c53e4 Fix stdint's existence breaking OS X compiling. 2011-12-08 23:05:56 +00:00
Valathil 8208aecf1b Fix crash when framebuffer shockwaves are enabled but no weapon loads the standard shockwave animation 2011-12-08 21:58:16 +00:00
Valathil a0d1c8445a Added Lightshafts as a replacement for sun glare. Look at http://www.hard-light.net/forums/index.php?topic=78923.80 for post_processing.tbl format 2011-12-08 20:57:11 +00:00
The_E e767e7dc01 Oops, infinite loops are bad in a sexp. 2011-12-06 17:09:00 +00:00
The_E 2538ed6814 Adds a sexp to switch the thrusters on a given ship or list of ships on and off. 2011-12-04 17:29:02 +00:00
Echelon9 b06fa6d7f9 Fix r8054: Const char* to char* conversion was causing GCC compile errors 2011-12-04 03:16:56 +00:00
Echelon9 da95aa8a14 Clear old commented out line 2011-12-04 03:06:24 +00:00
Wanderer 82ddb4a305 fix to autoaim 2011-12-03 17:27:22 +00:00
The_E 1a9b5aa980 Hellzed's french keyboard layout stuff 2011-12-03 14:18:14 +00:00
Wanderer 1a8745c960 zookeeper's change to locating subsystem positions 2011-11-30 21:33:31 +00:00
karajorma 5dbb9c3295 Make it possible to localise a couple of extra sentences. 2011-11-30 03:12:06 +00:00
Wanderer badf45b75d zookeeper's addition of new scripting hook that runs right before entering mission. 2011-11-29 21:32:57 +00:00
Wanderer 7bb10d8408 changes to the order in which autoaim/convergence modes are used 2011-11-29 20:44:39 +00:00
Goober5000 9eb2eacee0 make weapon parsing more robust for Mantis #2369 2011-11-29 06:03:15 +00:00
Zacam 72a80fb925 From CommanderDJ: Since "neb2_eye_changed()" contains "Neb2_regen" why not use it instead? 2011-11-29 04:07:42 +00:00
Zacam fd66bdcab3 From CommanderDJ: Nebula distance check for set-object-position's regeneration of local nebula. 2011-11-29 01:54:34 +00:00
Echelon9 21c2449f0b Documentation: Changes such that the Doxygen log reports clean, in anticipation of 3.6.14 release 2011-11-28 13:03:38 +00:00
The_E a1c0483f86 Since the +RGBA Inner and +RGBA Outer options aren't used anywhere in the code, we can just remove them. 2011-11-27 18:37:48 +00:00
Goober5000 2fac8f1899 fix revision 7971: Echelon9, if you add statements to a single-line if(), make sure you also add braces 2011-11-23 05:18:18 +00:00
Goober5000 94e13d761b add to the project file too 2011-11-23 04:26:20 +00:00
Goober5000 977ea25a6d approximate the standard function for MSVC6 compatibility purposes 2011-11-23 04:25:50 +00:00
Goober5000 b243f3151a these ought to appear in the project file 2011-11-23 03:10:57 +00:00
Goober5000 e5367f49dd LOL and DERP, whoever coded this didn't even read his own comment 2011-11-23 02:47:43 +00:00
Goober5000 14bc0e2230 zookeeper's initial velocity patch
http://www.hard-light.net/forums/index.php?topic=79069.0
2011-11-20 19:48:53 +00:00
IssMneur 5f7fc07507 Fixes a crash when a jumpnode targeted by the player is hidden. See MANTIS#2541 2011-11-19 23:17:51 +00:00
The_E 24a0c18cd9 Another one from zookeeper: More fixes for thrusters 2011-11-19 19:14:57 +00:00
The_E 717ea3a2dd From zookeeper: Proper fix for thrusters attached to rotating submodels 2011-11-19 19:11:47 +00:00
The_E c33749ac82 Those filters are just too helpful 2011-11-19 17:43:57 +00:00
karajorma 31bc16cd6e That's a rather pointless test when we don't have AI smart missiles. 2011-11-19 09:04:06 +00:00
Echelon9 fc9fbdd8f7 Fourth part of fixing jump_nodes refactor, clearing FRED compile errors. 2011-11-19 05:59:41 +00:00
Echelon9 5bf63e8c8d Third part of fixing jump_nodes refactor, remove the union approach to linking Jump_nodes into Objects[]. First go at clearing the FRED errors. 2011-11-19 04:07:30 +00:00
Echelon9 d340f7ec2e Documentation: Take out some old commented out code 2011-11-19 03:25:52 +00:00
Echelon9 f1060979fd Second part of fixing jump_nodes refactor, using cleaner attribute variables 2011-11-19 03:05:44 +00:00
Echelon9 e9c91374e0 Documentation: code/hud/hudtargetbox.cpp 2011-11-19 01:40:58 +00:00
Echelon9 84c96eaac6 First part of fixing jump_nodes refactor, use the set_name() function properly as it is available 2011-11-19 01:11:35 +00:00
Echelon9 12eda6154e Documentation: Code cleanup in weapons.cpp 2011-11-17 11:33:17 +00:00
Echelon9 19ae6528e0 Cases of commented out Int3() indicate areas of old, redundant code. 2011-11-17 11:07:53 +00:00
The_E 8b65d3e3ce Patch for Mantis 2391 (again): Removes a few leftovers from the old HUD code that generated warnings unnecessarily. 2011-11-15 23:25:50 +00:00
The_E 0f2f77d2d5 Fix for Mantis 2544: Crash when opening the "Class Variables" window for a weapon. 2011-11-15 22:54:21 +00:00
The_E 66c2741772 Fix for Mantis 2543: Windows in F3 lab aren't getting closed. 2011-11-15 21:50:41 +00:00
The_E 3fd09a9828 Slight fix for the "thrusters on rotating subobjects" thing: Only account for rotations that are actually happening. 2011-11-15 21:39:39 +00:00
Sushi 6a1f8a692c Add $Armor Type support for missiles (table entry goes right after $Weapon Hitpoints) 2011-11-15 19:05:30 +00:00
Goober5000 6147c19496 clean up ship maneuvers
significantly improve sexp help for those sexps
2011-11-15 09:36:27 +00:00
Sushi f542f19fcc Add "only target if can fire" turret flag 2011-11-14 18:26:55 +00:00
Zacam 69ec80042e From zookeeper: Correction to the getAnimationDoneTime in lua.cpp time_s calculation. 2011-11-14 09:45:20 +00:00
niffiwan e5ebb22d49 Fix for 7977 - explicitly include <algorithm> so gcc will compile 2011-11-14 03:55:08 +00:00
niffiwan ee0358ee79 cfile: change Assert to Assertion 2011-11-14 03:55:01 +00:00
Goober5000 1eec8f5093 add is-in-mission sexp 2011-11-13 09:59:10 +00:00
Goober5000 6dff3d4179 fix compilation on MSVC 6 2011-11-13 03:52:01 +00:00
niffiwan 8312d0a1e1 Documentation: cf*_string_len in cfile.h 2011-11-13 03:10:41 +00:00
Zacam bcf9fd90be From zookeeper: allow thrusters to follow a rotating engine
http://www.hard-light.net/forums/index.php?topic=74290.msg1557431#msg1557431
2011-11-12 15:22:48 +00:00
Zacam 403fef79ec From zookeeper: mod-wide disable of the warp camera
http://www.hard-light.net/forums/index.php?topic=78748.0
2011-11-12 14:53:59 +00:00
Zacam 6b2af30314 From zookeeper: fix $Shots for turret-fired weapons
http://www.hard-light.net/forums/index.php?topic=78832.0
2011-11-12 14:39:02 +00:00
Zacam ef5f145d5a From zookeeper: customizable warpout engage time
http://www.hard-light.net/forums/index.php?topic=78913.0
2011-11-12 14:36:31 +00:00
Zacam 6c87b2c5bc Small cleanup to last two commits, Tortoise Patch apparently decided to eat some line returns along the way. Additionally, some spacing adjustments to line things up a little better. 2011-11-12 14:20:25 +00:00
Zacam 8c8974b215 From zookeeper: customizable asteroid death explosions and radius
http://www.hard-light.net/forums/index.php?topic=78762.0
2011-11-12 14:01:38 +00:00
Zacam 3323847094 From zookeeper: customized asteroid split rules
http://www.hard-light.net/forums/index.php?topic=78755.0
2011-11-12 13:51:22 +00:00
Zacam 1b403a4505 Might as well include the missing inttypes.h file as well, just in case we ever come around to needing to use it, sine it's another file that MSVC doesn't ship with as part of it's C99 support. 2011-11-12 06:59:41 +00:00
Zacam 98b93e572d As per commit message r7963, uint64_t is not supported on MSVC out of the box. This is because stdint.h is not shipped with MSVC, so <include>ing it doesn't do any good when it doesn't exist. Since stdint.h can be distributed without modification, it is now in globalincs and the include is ifdef'd to MSVC to use the globalincs version, all other platforms will use the C++ ISO standard library version. 2011-11-12 06:45:39 +00:00
Echelon9 3f0761e4c7 Documentation: More code cleanup of missionparse.cpp and missionparse.h 2011-11-10 13:46:11 +00:00
Echelon9 4ad4d98c93 Documentation: Code cleanup of missionparse.cpp 2011-11-10 13:21:03 +00:00
Echelon9 0564ae99b8 Fix Mantis 2343: Assert on arriving from destroyed ship 2011-11-10 12:21:34 +00:00
Sushi f333133656 Add workaround so that AI landings consistently work 2011-11-09 18:24:12 +00:00
Echelon9 f04551523d Documentation: General 2011-11-09 14:21:16 +00:00
Echelon9 0615fe46f6 Mantis 2537: Help track down a memory leak problem 2011-11-09 14:01:06 +00:00
Echelon9 ac90d940a1 Fix Mantis 2539: Valgrind: Memory leak - parse_ship_values(ship_info*, bool, bool, bool) 2011-11-09 13:38:01 +00:00
Echelon9 3a28d938ea Documentation: Code cleanup of missioncampaign.cpp 2011-11-09 12:48:35 +00:00
Echelon9 9e127ca7f9 Documentation: Code cleanup in graphics/bmpman 2011-11-09 12:12:33 +00:00
The_E e7e279ca10 uint64_t is not supported out of the box on MSVC. 2011-11-09 09:36:23 +00:00
The_E f92eae073f Fix for Mantis 2533 from Eli2: Integer overflow in mission-time-msecs 2011-11-09 09:25:59 +00:00
Zacam 4dd05cde7f Originally spotted by zookeeper: "$gun_rotation:" should be set to "!= NULL" like the other entries around it. 2011-11-08 04:48:50 +00:00
Sushi cdfacd5f67 Oops, committed the wrong version of the player autoaim patch 2011-11-07 20:58:29 +00:00
The_E 17a420c92a Reverting the texture cache stuff due to issues with some models 2011-11-07 09:26:37 +00:00
niffiwan 047f2ab811 Linux: remove -g (debug symbols) flag from release builds & switch optimisations from -Os -to -O2 2011-11-07 03:32:42 +00:00
Sushi 113465660a Add "$Player Autoaim FOV:" to AI Profiles (optionally allows autoaim only for the player on a per-difficulty-level basis) 2011-11-06 12:46:33 +00:00
Echelon9 86f53da049 Documentation: General code cleanup of fireballs.cpp 2011-11-06 12:14:31 +00:00
Echelon9 2ed77792fe Documentation: Code cleanup in modelread.cpp 2011-11-06 11:25:15 +00:00
The_E e004154986 Eep, missed a "!" 2011-11-05 19:52:02 +00:00
Valathil 0fe89eedd4 Fixed min(0) and max(0) being recognized as macros on Windows 2011-11-05 19:42:29 +00:00
The_E 593d3c00c1 Changing opengl_render_pipeline_program to avoid unnecessary texture uploads. 2011-11-05 19:23:39 +00:00
The_E fff1a1c60b Reverting 7938: Bugfix breaks existing missions relying on old behaviour. 2011-11-05 19:20:17 +00:00
Echelon9 9f711bf53e Documentation: General code cleanup for 64bit 2011-11-05 08:12:04 +00:00
Echelon9 c852d3a466 Fix Mantis 2535: Game crashes in player select menu, patch from Eli2 2011-11-05 07:09:58 +00:00
Echelon9 90601fce4d Bug fix: This looked to be an accidental copy paste. See further gamesnd_get_by_iface_tbl_index() and gamesnd_get_by_tbl_index() 2011-11-03 14:39:37 +00:00
Echelon9 181fbfed52 From Eli2: patch removes leftovers of the conversion from arrays to Vectors. 2011-11-03 14:32:52 +00:00
chief1983 c00f931cfa From niffiwan: Fix our linking order to work with --as-needed 2011-11-02 16:23:42 +00:00
The_E 96ef05f89c From Eli2: Fix for Mantis 2533 (integer overflow in mission-time-msecs) 2011-11-02 11:40:51 +00:00
Goober5000 289169f96a zookeeper's hyperspace patch
http://www.hard-light.net/forums/index.php?topic=65427.msg1558799#msg1558799
2011-10-29 22:22:39 +00:00
Echelon9 ce0d6fc978 Fix Mantis 2531: Issues with cockpit sounds, from Eli2 2011-10-29 03:09:05 +00:00
The_E c8d456a784 Moving this up a bit more 2011-10-28 11:21:25 +00:00
The_E 2a80a598f7 This line shouldn't have been removed in m previous commit. No idea how that happened, but I moved it closer to where it's actually used. 2011-10-28 10:41:01 +00:00
The_E 327afbc262 From zookeeper: Adds kill() function to asteroid objects 2011-10-28 10:01:54 +00:00
The_E 681c2a356e From m!m: Reworked scripting sound API 2011-10-28 09:59:31 +00:00
Goober5000 1bcea87036 the ship copy flag needs to be able to recognize ships that appear later in the table 2011-10-26 07:51:31 +00:00
Goober5000 91fc326a17 we have some preconditions, so let's enforce them 2011-10-26 06:35:19 +00:00
Zacam fde2022fa2 from zookeeper: [FotG] Fixes collision problem with the hyperspace warpin type introduced by r7889 2011-10-23 19:00:04 +00:00
Echelon9 22219ed382 Documentation: Code cleanup of shockwaves.cpp and ancilliary changes 2011-10-23 05:00:49 +00:00
Echelon9 457e36c511 Documentation: Fix typo in the Doxygen comment block 2011-10-23 02:36:12 +00:00
IssMneur 29b4a6c922 From m!m: patch to add support for customizable cockpit sounds. See: http://www.hard-light.net/forums/index.php?topic=78675.0 2011-10-22 22:11:31 +00:00
Echelon9 648723e2ff Documentation: cleanup and documentation of gamesnd.h from Eli2 2011-10-22 10:29:48 +00:00
Echelon9 684b59e500 Fix Mantis 2526: Valgrind: Conditional jump or move depends on uninitialized value(s) - init_anim_instance() 2011-10-20 20:25:39 +00:00
Echelon9 9f4a1ac309 Fix Mantis 2525: Valgrind: Conditional jump or move depends on uninitialized value(s) - parse_ship_values() 2011-10-20 13:37:58 +00:00
Zacam 876289a4b2 From ni1s: -Wreorder warnings clean up for GCC output. 2011-10-19 07:36:21 +00:00
Echelon9 6c9598b2ae And found another offender of the STL capacity() / size() / reserve() type 2011-10-17 13:10:17 +00:00
Echelon9 8543045b15 STL types again. Some of these are just inefficient, like reserving one extra slot for each additional element, and then pushing that element onto the STL type 2011-10-17 13:07:24 +00:00
Echelon9 598bd73413 STL types are tuned to handle their own memory allocations. Code like this is never going to be optimal in all situations, and likely to be sub-optimal in many situations 2011-10-17 13:01:48 +00:00
Echelon9 366fc7b342 Huh? This Assert() check doesn't make any sense 2011-10-17 12:58:31 +00:00
Echelon9 69dbd07c88 STL types are tuned to handle their own memory allocations. Code like this is never going to be optimal in all situations, and likely to be sub-optimal in many situations 2011-10-17 12:56:47 +00:00
Echelon9 7a573539cc It's small, does lead to a slightly longer (but not necessarily less concise) code... but it is slightly faster. Tested on OS X, Intel Core 2 Duo, compiled with GCC 4.0 2011-10-17 12:42:34 +00:00
Echelon9 a2199e6b81 Looks pretty unneeded now, odd commented out definition in cmdline.h 2011-10-16 05:27:03 +00:00
Echelon9 cb0326a38e Convert the geometry map batcher lookup functions to use size_t, in line with the STL types 2011-10-16 05:22:34 +00:00
Echelon9 41919ee15b Clarify some aspects of the geometry map and distortion map batchers, as well as clarifying and making consistent the function calling conventions throughout the code. 2011-10-16 05:08:33 +00:00
Echelon9 61791b01cc Fixing Eli2's commit in r7905. Where the -keyboard_layout commandline hasn't been used, the code was causing a CTD rather than handling gracefully the fallback option 2011-10-16 04:23:42 +00:00
The_E 76923c1613 From Eli2: Allows adjustment of the keyboard layout on Linux/MacOS. Right now, only german layout is added in, use "-keyboard_layout qwertz" to activate it. 2011-10-14 13:58:50 +00:00
Zacam 183c57dc03 Wrong EOL type on these two. 2011-10-12 17:44:40 +00:00
niffiwan cb293f60c5 Improve performance of jpeg byte swap operation 2011-10-12 10:37:27 +00:00
Valathil 965c251ce6 Fix the transparency delay framework to work with submodel_render() 2011-10-11 15:55:43 +00:00
Echelon9 563fd4db10 min (lowercase) is not cross-platform, MIN (uppercase) is 2011-10-11 13:45:44 +00:00
niffiwan 8d59b5954a Add RGB / BGR byte swap to jpeg reading - libjpeg now doesn't need jmorecfg.h to be updated 2011-10-10 21:45:20 +00:00
Sushi c206ba8548 Remove unneeded warnings 2011-10-10 15:22:22 +00:00
Zacam ea52bab005 from zookeeper: [FotG] Makes adjustments to the Hyperspace warp type to allow the arrival/departure acceleration/deceleration rate to be controlled, $Warpout speed to be used as well as maintains initial velocity after warpin 2011-10-10 09:57:24 +00:00
Echelon9 b45a5ee281 From m\!m: access to the Viewer_mode as I need to know if the view is currently in the cockpit or not 2011-10-09 12:57:39 +00:00
The_E 2341c9aef3 Change the log message here to better explain what's happening. 2011-10-09 12:24:35 +00:00
niffiwan 2713be7140 From Eli2: fix for mantis 2517: loop sounds are always at 100% volume locked and afterburner fade out sound not work 2011-10-09 11:10:13 +00:00
Echelon9 e150a93cfb Testing Assert() to track down a series of bugs reported by QuantumDelta 2011-10-09 10:52:24 +00:00
Zacam cc2323b578 found by Valathil; in "int obj_in_view_cone( object * objp )", codes=g3_rotate_vector(&tmp,&pt); works out better than running the check, then discarding it since g3_code_vector calls to run g3_rotate_vector anyway. 2011-10-09 10:37:27 +00:00
Echelon9 a1e054190e Documentation: Clean up of globals.h 2011-10-09 03:00:53 +00:00
Echelon9 375ca512ad Documentation: Code cleanup of iff_deffs.cpp and related 2011-10-09 02:52:41 +00:00
Zacam 015a70bc48 Adds Success/Average/Fail music selections to the Debriefing Editor.
http://www.hard-light.net/forums/index.php?topic=78504.0
2011-10-08 15:38:07 +00:00
Zacam 5b7883128c From zookeeper: [FotG] makes hyperspace warp type use a longer distance for the collision check 2011-10-08 15:15:46 +00:00
Echelon9 3c7dad3563 Fix for medal room crash reported by QuantumDelta 2011-10-08 07:31:06 +00:00
Echelon9 9314724fc3 Documentation: Code cleanup of bmpman.cpp and ancilliary changes 2011-10-08 06:22:41 +00:00
The_E 4237db0536 Fixes issue with the mn.Asteroids and mn.Debris scripting tables, as these were accidentally 0-indexed instead of the Lua-standard way of starting indices from 1. 2011-10-06 15:09:26 +00:00
Echelon9 3d97037b87 Documentation: Code clean up of medals.cpp and medals.h 2011-10-06 12:51:15 +00:00
Goober5000 d5ee76453f enhance are-waypoints-done-delay to allow ships to complete waypoint paths multiple times
make count check more robust in has-docked-delay and has-undocked-delay; Assert shouldn't be used for mission data entered in FRED
2011-10-06 04:33:52 +00:00
Zacam de9864b36a Remove the empty hudresource.cpp/.h files from /code/hud and all projects. 2011-10-05 09:14:19 +00:00
Goober5000 d6b23cc1c0 PVS-Studio V581 in revision 7779 was actually a false alarm; overzealous cleanup created a condition where a negative array index could occur, triggering either an assert or a crash (Mantis #2514) 2011-10-04 06:34:47 +00:00
karajorma e28573fe30 CommanderDJ's fix for Mantis 2276 set-object-speed SEXPs don't work in multiplayer. 2011-10-04 05:03:09 +00:00
Echelon9 77c852e15a A few further changes for Windows support under the new jump_nodes STL refactor 2011-10-03 13:26:03 +00:00
Echelon9 27900ec1a9 Refactor of the jump_node code to use the STL's std::list, rather than Volition's in-house written linked_list. 2011-10-03 12:15:55 +00:00
niffiwan 24f253971a Fix: Mantis 2470 - $Flags: ("untargetable") does not work on turret subsystems 2011-10-03 10:37:30 +00:00
Echelon9 6d4f266e52 Use SCP_* types to access STL types wherever possible. This allows more complete memory monitoring 2011-10-03 09:06:56 +00:00
Echelon9 17e9ace62a Documentation: Code cleanup in modelinterp.cpp and ancilliary changes 2011-10-03 08:35:36 +00:00
Echelon9 500859ae98 Documentation: Only need update_min_max() because CLAMP() doesn't handle pointers 2011-10-03 07:46:04 +00:00
Echelon9 227b835116 Documentation: Code cleanup in aicode.cpp and ancilliary changes 2011-10-03 07:40:09 +00:00
Echelon9 b9ec80682d Documentation: Code cleanup in debris.cpp and ancilliary changes 2011-10-03 06:03:55 +00:00
The_E ca52181adb From Eli2: Patch for Mantis 2489: adjust-audio-volume doesn't affect subspace 2011-10-02 11:08:41 +00:00
Zacam 1b1895abdb Finish removing dbugfile.cpp/.h from the rest of the projects. 2011-10-02 08:09:04 +00:00
The_E 42fcf8052c Make force-jump cancel glide mode. 2011-10-01 20:09:00 +00:00
The_E dd1d682d9b From m!m: Allows per-ship customization of ship sounds in ships.tbl. See Wiki for details. 2011-10-01 19:16:38 +00:00
Echelon9 5dfb30dfce PVS-Studio fix: V507 Pointer to local array 'title_str' is stored outside the scope of this array. Such a pointer will become invalid. 2011-10-01 06:54:43 +00:00
Echelon9 6d0ac6b2f3 Remove the variables.cpp and variables.h redundant references from the Xcode project file 2011-10-01 04:32:55 +00:00
karajorma a52ba3d462 Remove dbugfile from VC2008 project files so that it will build. 2011-10-01 00:03:38 +00:00
The_E 939f1f949f Damn, wrong line changed. 2011-09-30 17:54:01 +00:00
The_E 766486b103 Update to ad.playMusic to allow control over whether or not to loop the passed sound file. 2011-09-30 17:53:06 +00:00
The_E ac82e45cd5 Removing dbugfile.cpp/.h from the project, since it doesn't seem to be useful. 2011-09-30 14:52:33 +00:00
The_E d85fb17efc Change this for loop to use an iterator for better performance 2011-09-30 10:22:34 +00:00
Goober5000 0d96fc1bff partial revert of 7825... don't remove the sound index 2011-09-29 06:03:30 +00:00
niffiwan dd66475b75 Reapplying 7790, seems to have been mistakenly swatted by 7802 2011-09-28 11:23:27 +00:00
Zacam b306018b92 This is now in the .14 Branch, we'll keep it there and leave the "final" code for putting to Trunk when AP is merged/Final is released. 2011-09-27 21:23:46 +00:00
Zacam 5c8f8f0cae This file is not binary nor an application. Silly SVN. 2011-09-27 20:54:56 +00:00
Zacam b1428c9eb7 What the? There were two Inferno Debug SSE/SSE2 project setups in libpng project file. 2011-09-27 07:02:25 +00:00
Sushi 2b6ef14077 Add set-docked SEXP 2011-09-27 03:32:05 +00:00
IssMneur 3ec2689d39 A bunch of audio code hacks to address the concerns in http://www.hard-light.net/forums/index.php?topic=77889.0 until proper fixes of the sound code are completed.
+F -donotenforce = to turn off concurrent playback limit for sounds.
+F -percent_flashtobang = sets the default percentage of nebula flashes get converted to bangs.  Default is 50, max 100, min 0.
+T lightning.tbl +flash_to_bang_percent: = sets the percentage of nebula flashes that get converted to bangs for the storm type.
-- Audio gain of OpenAL is set to 65% of max.
2011-09-27 03:04:11 +00:00
niffiwan ece4ad88bc Fix for mantis 2501 2011-09-26 11:17:06 +00:00
Zacam 02a23b22b1 From CommanderDJ: Fix for Mantis 2224 "Chat messages may end up unreadable due to unfortunate color choice"
Allows for the specification of colors via a colors.tbl
(Wiki Documentation here: http://www.hard-light.net/wiki/index.php/Colors.tbl )
2011-09-26 05:40:07 +00:00
The_E 9710f64934 Aargh. NOW it's fixed correctly 2011-09-25 20:47:31 +00:00
The_E e8d36eac79 And a final fix here 2011-09-25 20:46:22 +00:00
The_E c052cbe1e2 Fix for subsystem flags resetting erroneously. Thanks to zookeeper for noticing this. 2011-09-25 10:50:08 +00:00
Zacam 206279c5fd Sync Drift: Apparently still some lingering ifdefs for OEM/Multiplayer_Beta and non-AP specific things not having made it to trunk for some reason. 2011-09-25 08:26:45 +00:00
The_E 6b90b35f56 FRom CommanderDJ: Patch for Mantis 2307, set-object-position weirdness when in nebula 2011-09-25 07:50:07 +00:00
IssMneur 1ac6127251 Fixes Mantis 2510 - Rotation periods for submodels of less than 1.0 seconds cause uncontrolled rotation of submodel. 2011-09-25 04:00:06 +00:00
Echelon9 e3195a82d6 Code cleanup: We should be really careful with using these scoring struct elements, as the types were changed from ushort to int at some point. 2011-09-25 02:42:27 +00:00
The_E 0f51dc1925 Redo 7777 without breaking anything else in the process 2011-09-24 19:47:47 +00:00
The_E 531a7c71bb Revert 7791. Something went wrong there. 2011-09-24 18:31:20 +00:00
The_E 4ce7dfe9e4 Revert 7789 2011-09-24 17:42:56 +00:00
The_E a982eb153d Remove more useless encryption stuff. NOTE FOR PROJECT FILE MAINTAINERS: parse/encrypt.(cpp|h) should no longer be part of the project. 2011-09-24 17:37:12 +00:00
The_E b964c63d6e From niffiwan: Fix for Mantis 2477 2011-09-24 15:59:00 +00:00
The_E 24d6ca3bad PVS Studio related: False alarms 2011-09-24 15:46:24 +00:00
The_E 5f0cf81cd2 PVS Studio fix: Rearranged struct to decrease size 2011-09-24 15:46:03 +00:00
The_E 6511cfdddf From eli2: Change the control defines into a more manageable enum 2011-09-24 15:45:13 +00:00
The_E 05f3578109 PVS Studio fix: V547, <variable> >= 0 check on size_t variable 2011-09-24 14:26:04 +00:00
The_E 0e66893f32 Remove unused variable 2011-09-24 14:22:35 +00:00
Echelon9 cd1cc88640 Xcode project file cleanup: Xcode 3 thinks these sections are unnecessary after the encrypt.cpp file was removed recently 2011-09-24 01:35:19 +00:00
Echelon9 7d9ea6b21c Documenation: Code cleanup of keycontrol.cpp 2011-09-24 01:34:25 +00:00
Echelon9 911025d835 A small code cleanup patch from Eli2. Thanks. 2011-09-24 01:19:29 +00:00
Echelon9 8e1c689f32 PVS-Studio fix: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 2056, 2061 (multiteamselect.cpp) 2011-09-23 20:28:06 +00:00
Echelon9 2866b4fb3b PVS-Studio fix: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 2039, 2044 (multiteamselect.cpp) 2011-09-23 20:27:25 +00:00
Echelon9 82a36997cb PVS-Studio fix: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 2172, 2186 (sexp.cpp) 2011-09-23 20:26:32 +00:00
Echelon9 efcdac911e PVS-Studio fix: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 1977, 1986 (sexp.cpp) 2011-09-23 20:24:43 +00:00
The_E ad0581dd4d Fix for Mantis 2134: set-fov sexp has no effect at mission start. This moves the camera initialization stuff up a few lines to run before game_simulation_frame, thus ensuring the main camera is set up when sexps are evaluated.
Many thanks to CommanderDJ for tracking this down.
2011-09-23 19:09:23 +00:00
Swifty e329d4542f Fixed Mantis 2502. Messages gauge will no longer calculate string sizes using the incorrect font. 2011-09-23 09:14:02 +00:00
Echelon9 586491f150 PVS-Studio fix: V512 A call of the 'memset' function will lead to underflow of the buffer '&stackFrame' (mspdb_callstack.cpp). 2011-09-22 13:42:07 +00:00
Swifty 0ab6ecd58c Further fix for Mantis 2500. Directives should now be using sexp overrides. 2011-09-22 06:28:49 +00:00
Echelon9 2db013e321 Documentation: Code cleanup of grbatch.cpp and work to prepare for 64bit with size_t 2011-09-21 14:37:36 +00:00
Zacam cf5125d6a0 Revert enabling Speech and Voice Recognition, as it doesn't play well with Express versions of MSVC (at least not without a lot of work) 2011-09-21 06:37:56 +00:00
IssMneur 023c267374 - renamed +frequency to +period to reflect what the code actually does (as Valathil pointed out)
- +period: or +index: is no longer required for $substitute: (default is +index: 0)
- removed unnecessary check on +period: (1 is now a valid period)
2011-09-20 02:47:39 +00:00
The_E c428e55ee2 Move this check outside the for loop for better performance 2011-09-19 18:01:56 +00:00
The_E 5c05db7c40 Small fix for the logic here 2011-09-19 15:53:11 +00:00
The_E e689c90703 As requested by zookeeper: Adds "play fire sound for player" subsystem flag 2011-09-18 17:31:41 +00:00
Echelon9 83bc0e33fa From niffiwan: Fix for Mantis 2468 - Change-Ship-Class does not change armor type 2011-09-18 05:24:34 +00:00
Zacam c88660eca9 Also from Eli2: Code cleanup 2011-09-18 01:03:23 +00:00
Zacam 0a4f360908 Project cleanup for the removals of cryptstring, scramble, and crypt.cpp/.h. 2011-09-18 00:35:48 +00:00
Valathil 7a810e1dde From Eli2_: Change cheat codes to not use that useless crypto function anymore 2011-09-17 23:00:58 +00:00
The_E 9f4d15b9d6 Make sure ETS settings carry over when changing ship class, as well as making sure that weapon selection are still valid after the change. 2011-09-17 22:11:34 +00:00
The_E 7751e8c076 Another case where one should use the case-insensitive check found and fixed. 2011-09-17 21:48:46 +00:00
Valathil fe8f7ebaec Reinitialize collision checks when executing the change-ship-class sexp 2011-09-17 21:02:33 +00:00
Valathil 4c4258eb6d Reordered shaders for performance reasons 2011-09-17 20:55:03 +00:00
The_E 704908f74e Since this header and cpp define a single function used in a single place, let's move the function to where it's used, and get rid of these files 2011-09-17 20:25:49 +00:00
The_E d031406000 And another obsolete tool goes away 2011-09-17 20:08:13 +00:00
The_E 75790a647d These are unused as well. 2011-09-17 20:00:29 +00:00
The_E b692311667 These files are referenced nowhere, so away they go 2011-09-17 19:53:27 +00:00
The_E b1fc8971de Little change to fix bug with external post shaders not loading 2011-09-17 19:36:24 +00:00
Valathil df80d5a1c3 Add Ships.tbl flag to disable lighting 2011-09-17 18:00:38 +00:00
Valathil 7074db9287 Don't do a boolean check on Floats could be -0.0 which is boolean true 2011-09-17 14:36:29 +00:00
The_E c4ea493f9e From m!m: Make the player object and mn.* table available in an $On Mission Start hook 2011-09-17 13:03:52 +00:00
The_E 5b53430da5 From m!m: Adds isTurret() and isAfterburnerActive() Scripting functions 2011-09-17 12:59:54 +00:00
The_E 5cb8835238 Highly experimental project files for the highly experimental MSVC 2011. 2011-09-16 21:17:02 +00:00
The_E 8c129cfc3d Reverting 7733. This is clearly not ready for primetime, let alone a release. 2011-09-16 10:01:10 +00:00
The_E 5ec132d6e4 Adding support for the $On Weapon Fired: hook going off when turret weapons are firing 2011-09-15 11:46:33 +00:00
The_E 2997266ce9 Fix for the $On Weapon fired: scripting hook firing on every frame as long as the fire button is pressed 2011-09-15 11:35:32 +00:00
Zacam 1c324758f0 Enable Text-to-Speech (SVN Include) and Voice Recognition. (MSVC 2010) 2011-09-15 03:29:05 +00:00
Zacam cc14debd26 Enable Text-to-Speech (SVN Include) and Voice Recognition. 2011-09-14 22:44:50 +00:00
Zacam 9b9b172e9e EOL inconsistencies corrected to match the rest of the files. 2011-09-14 19:25:15 +00:00
The_E 7d5bce148f strcmp != stricmp. Using stricmp is necessary to avoid breaking old missions. 2011-09-14 18:49:06 +00:00
The_E 49fe727218 Fix for the $On Weapon Fired: scripting hook 2011-09-14 12:21:45 +00:00
Backslash 28c482a2f1 Add radar gauges to Hud_gauge_types list, so that hud-activate-gauge-type sexp can affect radar. Also a bit of code sorting to make it easier to make sure all gauges are accounted for. 2011-09-14 02:53:12 +00:00
chief1983 f07609e6db Update codeblocks project file. 2011-09-13 22:00:26 +00:00
The_E 36aaaf018e Since this is the only place where r1 and r2 are variable, let's safeguard it. 2011-09-13 20:36:41 +00:00
The_E 4c838f2014 Adding an exit path here. 2011-09-13 20:26:23 +00:00
Echelon9 dacd3337c7 Documentation: Code cleanup in hudnavigation and hudobserver 2011-09-12 13:52:07 +00:00
Echelon9 8c272b61ae Documentation: Code cleanup in fvi.cpp 2011-09-12 13:31:38 +00:00
Echelon9 5d2e1444e6 Documentation: Code cleanup in font.cpp and font.h 2011-09-12 12:52:33 +00:00
Echelon9 c17fbdbcfc Documentation: Code cleanup in flak.cpp and flak.h 2011-09-12 12:45:19 +00:00
Echelon9 7f6e6e0b03 Documentation: Remove the old CreditWins from credits.cpp. These were unused for some time 2011-09-12 12:38:36 +00:00
The_E debdb78531 A few fixes for the $Weapon Class scripting hook and associated actions 2011-09-12 12:35:08 +00:00
Echelon9 0ebe034272 Documentation: Big code cleanup of the collide**.cpp files 2011-09-12 12:34:49 +00:00
Echelon9 10f9ecac09 Documentation: Code cleanup of camera.cpp and camera.h, and removal of redundant function 2011-09-12 12:15:27 +00:00
IssMneur dedd73a3f5 Lets try this again without templates that VC6 doesn't like (this time for real).
Use const strings in split_str.
2011-09-12 05:14:58 +00:00
Goober5000 3597538bde revert 7705... it did, in fact, contain templates that VC6 doesn't like 2011-09-12 05:01:57 +00:00
IssMneur 10809783f9 Lets try this again without templates that VC6 doesn't like.
Use const strings in split_str.
2011-09-12 04:03:56 +00:00
Valathil a899b8601f Allow customization of the thruster distortion effect in species_defs.tbl and ships.tbl 2011-09-12 03:59:45 +00:00
Echelon9 eb56cc982d Documentation: Code cleanup of asteroid.cpp and asteroid.h 2011-09-11 13:56:10 +00:00
Echelon9 1f07c6fcb1 Documentation: Code cleanup of alphacolors.cpp 2011-09-11 13:38:17 +00:00
Echelon9 6c4e057035 Documentation: Code cleanup of afterburner.cpp 2011-09-11 13:36:33 +00:00
Zacam f779a5b8a8 Fix for Trunk r7677 causing map corruption on model cache rebuild. 2011-09-10 21:14:55 +00:00
Zacam b781d3220c From Goober5000: Fix for model read for 'submodel_get_two_random_points' failing to find any points in the POF 'defpoints' as reported by Nighteyes. 2011-09-09 15:13:23 +00:00
Zacam 83045f7d4c Some more Parity/drift correction between Antipodes and Trunk: cfile update for better handling. 2011-09-09 14:06:29 +00:00
Zacam f15c81fdd0 Part Three: Synchronization pass of Trunk and Antipodes Differences.
Catching on anything missed in the first two passes.
2011-09-09 10:38:14 +00:00
Zacam a63dbe572c Part Two: Synchronization pass of Trunk and Antipodes Differences.
Removes all extraneous ifdefs (Demo, E3, Multi Beta, etc).
Leaves Debug and Inferno.
2011-09-09 10:23:53 +00:00
Zacam 9678d18bc3 Part One: Synchronization pass of Trunk and Antipodes Differences.
Whitespace/tab mostly.
aicode does have a change of an Int3 to an Assertion.
bmpman has an update to bm_next_handle.
2011-09-09 09:37:45 +00:00
Zacam efaa50fd0c From Valathil: Fixes thrusters with -trans textures 2011-09-08 17:12:25 +00:00
Goober5000 6c2f4f3c30 PVS-Studio fixes:
V506	Pointer to local variable 'Default_video_settings' is stored outside the scope of this variable. Such a pointer will become invalid.	code	2d.cpp	507
V506	Pointer to local variable 'pos' is stored outside the scope of this variable. Such a pointer will become invalid.	code	shipfx.cpp	1075
2011-09-08 06:55:50 +00:00
Goober5000 fd4dc268d4 made show/hide jumpnode work on more than one argument 2011-09-08 06:41:38 +00:00
IssMneur 0717ad3d13 PVS-Studio fix: V512 A call of the 'memcpy' function will lead to overflow of the buffer '& x'. (pstypes.h:131) 2011-09-08 05:39:53 +00:00
IssMneur dd3404b441 PVS-Studio: These are not false positives. Variable args can only be PODs, changing the "class" to a structure makes ade_odata a POD which should stop PVS-Studio from flagging this. 2011-09-08 05:38:21 +00:00
Echelon9 3eb9602696 Documentation: Complete code clean up of the 3d/2d code 2011-09-07 14:33:26 +00:00
Echelon9 f1cd24101f Documentation: Code clean up in 3dlaser.cpp 2011-09-07 14:26:25 +00:00
Echelon9 dd99b7b035 Documentation: Code cleanup of 3ddraw.cpp 2011-09-07 14:22:03 +00:00
Echelon9 687b91d197 Documentation: Code cleanup to 2d.cpp, 2d.h and 3d.h 2011-09-07 14:10:41 +00:00
Echelon9 23d689e087 PVS-Studio fix: V512 A call of the 'memcpy' function will lead to underflow of the buffer 'szcode'. 2011-09-07 12:46:35 +00:00
Echelon9 6de5b02e77 Documentation: Code clean up of psnet2.cpp 2011-09-07 12:28:18 +00:00
Echelon9 dece779168 PVS-Studio fix (courtesy of niffiwan): V512 A call of the 'memcpy' function will lead to underflow of the buffer '& bit_24'. 2011-09-07 12:00:21 +00:00
Echelon9 9086c95131 PVS-Studio fix (courtesy of niffiwan): V512 A call of the 'memcpy' function will lead to underflow of the buffer (psnet2.cpp) 2011-09-07 11:58:47 +00:00
Zacam c946bc4a45 PVS-Studio fix (courtesy of niffiwan): V512 - A call of the 'memcpy' function will lead to overflow of the buffer '& ip_addr.sin_addr'. 2011-09-07 10:00:03 +00:00
Zacam 0dac515506 MSVC Analysis: Local declaration of <variable> hides previous declaration at <line> of <file>: 'Scene_texture_width'/'Scene_texture_height' in gropengldraw lines 56 & 57. 2011-09-07 09:57:37 +00:00
karajorma d7274c3714 Fix Mantis 2497 (SEXP help text not available in the ships editor) 2011-09-07 02:50:05 +00:00
Valathil 388fd3bb81 Delay transparent texture rendering to fix z-buffer ordering issues 2011-09-06 17:17:58 +00:00
Echelon9 f678baabde Documentation: Major code clean up of shield.cpp 2011-09-06 14:39:53 +00:00
Echelon9 6d245f7bc2 PVS-Studio fix: V524 It is odd that the body of 'multi_xfer_reset' function is fully equivalent to the body of 'multi_xfer_close' function (multi_xfer.cpp, line 185).
Remove duplicate, unused function
2011-09-06 12:29:56 +00:00
Goober5000 f3349119b8 end string at hash symbol for jump nodes too 2011-09-06 08:59:29 +00:00
karajorma 7e97177a75 Fix Mantis 2492 (Confusing help messages for the get-x-ammo SEXPs) 2011-09-06 02:29:47 +00:00
Goober5000 d94416f71b remove unreferenced variable 2011-09-05 19:50:26 +00:00
Echelon9 aacaa2d331 Documentation: Major code cleanup of ship.cpp 2011-09-05 14:30:34 +00:00
Echelon9 7d56f961e5 PVS-Studio fix (courtesy of niffiwan): V568It's odd that the argument of sizeof() operator is the '(short) method' expression. 2011-09-05 12:49:37 +00:00
Echelon9 1de8a20958 PVS-Studio fix (courtesy of niffiwan): This is a false positive, BUT IT REALLY SHOULD be rewritten with an STL container 2011-09-05 12:47:12 +00:00
karajorma 1fe4fdeaef Fix the cloaked ship flag not saving. 2011-09-05 00:05:20 +00:00
Valathil 02848eb577 Fixed a little misunderstanding of the collision query framework in the sun occlusion test 2011-09-04 20:01:34 +00:00
The_E 5ea6138708 A bit of cleanup here. Removed unnecessary "if (true)" and changed the sexp code to use the already written armor_type_get_idx function 2011-09-04 19:33:09 +00:00
Valathil 944ea0b367 Implemented Sun occlusion for Cockpit models and shown Ship models 2011-09-04 15:48:05 +00:00
Echelon9 47ce96863f PVS-Studio fix: Mark a false positive reported by niffiwan 2011-09-04 15:30:34 +00:00
The_E e63a8680f9 PVS Studio fix: V535 The variable 'j' is being used for this loop and for the outer loop. 2011-09-04 12:36:33 +00:00
The_E c187041e9f PVS Studio fix: Variable "item_index" was assigned values twice in succession 2011-09-04 12:35:14 +00:00
The_E d283d5800d Another false alarm from PVS Studio 2011-09-04 12:33:00 +00:00
The_E 834e383c26 Marking a bunch of PVS Studio warnings as false alarms. While the warnings are technically correct, none of these are in places where performance matters. 2011-09-04 12:31:33 +00:00
The_E 5bec06b168 PVS Studio fix: V803 Decreased performance. In case 'obji' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. 2011-09-04 12:14:35 +00:00
The_E b92c6402a4 More false alarms from PVS Studio 2011-09-04 12:13:31 +00:00
The_E 124138ae07 PVS Studio related: Mark false alarms as such 2011-09-04 10:14:17 +00:00
The_E 790dba1d3d PVS Studio related: Mark false alarms as such 2011-09-04 09:35:08 +00:00
The_E 383403967c PVS Studio fix: V510, class type argument passed to sprintf 2011-09-04 09:31:30 +00:00
The_E c14d9213d2 Change batch_render_* to use iterators 2011-09-04 08:19:21 +00:00
Swifty 8e2fbd8b9e Thrusters render in the proper position when drawing an auto centered model. 2011-09-04 06:54:09 +00:00
Goober5000 001baa29a2 remove unneeded Assert 2011-09-04 05:43:42 +00:00
Goober5000 bab303963b fix a bug from the waypoint conversion 2011-09-04 00:41:05 +00:00
Goober5000 0e278350d7 d'oh... in most cases, atoi(CTEXT(n)) should be eval_num(n) 2011-09-03 21:46:49 +00:00
Valathil 107f02d8d6 Fix tcache_set() OpenGL Errors by not using vertex attributes when drawing distortion Thrusters 2011-09-03 16:17:19 +00:00
Echelon9 e3c100d5fa Documentation: A few documentation fixes 2011-09-03 09:06:00 +00:00
Echelon9 67658b89c8 Documentation: A few documentation fixes so that Doxygen 1.7.5.1 outputs a clean log 2011-09-03 08:25:53 +00:00
Echelon9 eda7103399 PVS-Studio fix: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 1281, 1312. 2011-09-03 05:38:28 +00:00
Echelon9 6c55c061c4 Suppress a PVS-Studio false positive 2011-09-03 05:34:08 +00:00
Echelon9 f701d00d0a PVS-Studio fix: V592 The expression was enclosed by parentheses twice: ((expression)). One pair of parentheses is unnecessary or misprint is present (starfield.cpp). 2011-09-03 05:31:12 +00:00
Echelon9 4f2574dddb PVS-Studio fix: V592 The expression was enclosed by parentheses twice: '((cur_sep > 0.9f * desired_sep))'. One pair of parentheses is unnecessary or misprint is present (aicode.cpp).
I think this is the right fix. In addition the code comments did not reflect what was happening, so I've updated these to reflect the if() comparison.
2011-09-03 05:20:27 +00:00
Goober5000 3b5512d60a whoops 2011-09-03 04:30:23 +00:00
Goober5000 725762bf35 The_E made the wrong fix; this is the right one 2011-09-03 02:34:14 +00:00
Goober5000 70a1873c86 a bunch of small PVS-Studio fixes (mostly duplicate assignments) 2011-09-03 02:25:39 +00:00
Goober5000 43cbdb0783 wl_fury_missile_offset_hack was only applicable for FS1 2011-09-03 02:21:20 +00:00
Goober5000 eee761ab79 PVS-Studio fix: V507 Pointer to local array 'name' is stored outside the scope of this array. Such a pointer will become invalid. code missioncampaign.cpp
(This is a Volition bug!  In all other locations, Campaign_file_names and Campaign_names are set using strdup.)
2011-09-03 01:48:06 +00:00
Goober5000 c7ddf2f619 PVS-Studio fix: V506 Pointer to local variable 'terminus' is stored outside the scope of this variable. Such a pointer will become invalid. 2011-09-03 01:45:56 +00:00
Goober5000 2ce8ca62cf PVS-Studio fix: V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. 2011-09-03 01:32:07 +00:00
Goober5000 09bb4ab771 PVS-Studio fix: V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. 2011-09-03 01:15:20 +00:00
Goober5000 ee4e1f2afa PVS-Studio fix: V805 Decreased performance. It is inefficient to identify an empty string by using 'strlen(str) != 0' construct. A more efficient way is to check: str[0] != '\0'.
(and sorry Kazan, you don't get to call your for statement a work of art if you use strlen inefficiently)
2011-09-03 01:05:00 +00:00
Valathil 22c4cf13da Changed Sun glow and lens flare rendering to not be obscured by objects 2011-09-01 19:35:17 +00:00
Valathil a67f2d4f29 Enable alpha channel on render to texture targets and provide scripting functions with alpha capabilities 2011-09-01 16:16:03 +00:00
Echelon9 45f8701e68 Documentation: Code cleanup of missionbriefcommon.cpp 2011-09-01 13:50:37 +00:00
Echelon9 4201582786 Let's have another go at this one... around we go again 2011-09-01 13:08:32 +00:00
karajorma 7df5137ac4 Fix a mismatch. 2011-08-31 14:06:19 +00:00
Echelon9 a20c658026 cppcheck fix: Memory leak in icon table parsing. 2011-08-31 13:53:14 +00:00
Echelon9 3063b2cd85 Undo my rather silly patch, apply niffiwan's patch as a temporary measure (at least). 2011-08-31 13:48:23 +00:00
Echelon9 2abd999dd9 PVS-Studio fix: V522 Dereferencing of the null pointer 'snd' might take place. Check the logical condition (autopilot.cpp) 2011-08-31 13:25:14 +00:00
Echelon9 9be05a4d7f PVS-Studio fix: V523 The 'then' statement is equivalent to the 'else' statement (psnet2.cpp).
This one was particular bad as it code have lead to remotely induced crashes over the network with oversize packets.
2011-08-31 13:12:46 +00:00
Echelon9 dc29308c31 PVS-Studio false positive: V581 The conditional expressions of the 'if' operators situated alongside each other are identical.(hudtarget.cpp) 2011-08-31 13:02:44 +00:00
Echelon9 81f5d8ee99 PVS-Studio false positive: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. Check lines: 185, 189 (dscap.cpp) 2011-08-31 13:00:57 +00:00
Echelon9 bcb60d8bd0 PVS-Studio false positive: V537 Consider reviewing the correctness of 'y' item's usage (3dmath.cpp) 2011-08-31 12:58:58 +00:00
Zacam 64efa9f2fa Clean up the commented out code from niffiwan's PVS-Studio patches. (from niffiwan) 2011-08-31 10:58:33 +00:00
Zacam 10445ba0c3 MSVC Analysis C6244: Local declaration of <variable> hides previous declaration at <line> of <file>. (lock_world_pos; 31; hudlock.cpp) 2011-08-31 09:59:55 +00:00
Zacam def9877ade MSVC Analysis C6246: Local declaration of <variable> hides declaration of same name in outer scope. (wip, swp, objp, j) 2011-08-31 09:37:20 +00:00
Zacam e21235bfb9 Fix for 7590: Shipp can be NULL, which would lead to a crash. This resolves that crash from happening. 2011-08-30 22:59:57 +00:00
The_E 0525e871d0 PVS Studio related: Mark false alarms as such. 2011-08-30 17:46:49 +00:00
The_E 724f1be9d3 Removing the RELEASE_REAL define from ye olde ✌️ days. We really don't need it anymore. 2011-08-30 17:46:03 +00:00
The_E 9e8f902ed3 PVS Studio fix: V581 The conditional expressions of the 'if' operators situated alongside each other are identical. 2011-08-30 17:40:00 +00:00
Swifty fa54551e26 Engine glows no longer render when on the wrong side of a warp-in/out. 2011-08-30 17:39:48 +00:00
The_E 9d9d2d0eb2 PVS Studio fix: V576 Incorrect format. A different number of actual arguments is expected while calling 'Format' function. Expected: 2. Present: 3. 2011-08-30 17:29:56 +00:00
The_E 57fae21a9c PVS Studio fix: V567 Undefined behavior. The 'index' variable is modified while being used twice between sequence points. 2011-08-30 17:28:39 +00:00
The_E 27e0c1b3b2 PVS Studio fix: V547 Expression 'character <= 127' is always true. The value range of signed char type: [-128, 127]. 2011-08-30 17:26:57 +00:00
The_E 0ce71ca239 PVS Studio fix: V541 It is dangerous to print the string 'base' into itself. 2011-08-30 17:24:50 +00:00
The_E b15d864aac PVS Studio fix: V541 It is dangerous to print the string 'ani_name' into itself. 2011-08-30 17:23:01 +00:00
Echelon9 3453cc9c70 PVS-Studio fix: V576 Incorrect format. Consider checking the [third] actual argument of the 'sprintf' function. The SIGNED integer type argument is expected.
Fixes a number of this class of issue with sprintf formats.
2011-08-30 15:39:29 +00:00
Echelon9 a03118b88d PVS-Studio fix: V805 Decreased performance. It is inefficient to identify an empty string by using 'strlen(str) == 0' construct. A more efficient way is to check: str[0] == '\0' (missioncampaign.cpp). 2011-08-30 15:17:28 +00:00
Echelon9 a5bd4b9845 PVS-Studio fix: V523 The 'then' statement is equivalent to the 'else' statement (shipfx.cpp).
Also take opportunity to clean up the BSG warp effect code. That duplice if() else() had been included since the original WMC commit in r5261.
2011-08-30 14:32:10 +00:00
Echelon9 64d2e8b9fb PVS-Studio fix: V803 Decreased performance. In case 'aip->wp_index' is iterator it's more effective to use prefix form of decrement. Replace iterator-- with --iterator. 2011-08-30 14:06:03 +00:00
The_E e3039d3ea4 PVS Studio fix: V570 The 'end_angle.a1d [axis]' variable is assigned to itself. 2011-08-30 13:55:36 +00:00
The_E 2a723f78b0 PVS Studio fix: V547 Expression is always true. Unsigned type value is always >= 0. 2011-08-30 13:48:56 +00:00
The_E c7422150fc PVS Studio fix: V535 The variable 'i' is being used for this loop and for the outer loop. 2011-08-30 13:46:00 +00:00
The_E 003ed628c7 PVS Studio fix: V517 The use of 'if (A) {...} else if (A) {...}' pattern was detected. There is a probability of logical error presence. Check lines: 279, 287. 2011-08-30 13:40:36 +00:00
The_E 32bc367306 PVS Studio fix: "delete operator applied to non-pointer" 2011-08-30 13:38:33 +00:00
The_E 1aa806a3ab PVS Studio fix: duplicated "!strlen(filename)" check 2011-08-30 13:21:28 +00:00
Echelon9 5a0dc8f6b1 PVS-Studio (courtesy of niffiwan): V523 The 'then' statement is equivalent to the 'else' statement (techmenu.cpp). 2011-08-30 13:12:51 +00:00
Echelon9 8a4482c827 PVS-Studio fix (courtesy of niffiwan): V523 The 'then' statement is equivalent to the 'else' statement (missiontraining.cpp). 2011-08-30 13:06:28 +00:00
karajorma 7ca92457b4 PVS-Studio fix: V512 A call of the 'memset' function will lead to underflow of the buffer 'type'.
Never really would matter but it's a waste of memory declaring an int buffer and then only using 1/4 of it
2011-08-30 11:50:23 +00:00
Goober5000 2ef9fa11b6 add fire-beam-at-coordinates, which is as awesome as it sounds 2011-08-30 07:29:57 +00:00
Goober5000 3f1fcf2e71 having null iterators is apparently a no-no according to the C++ standard, so use a globally defined invalid iterator instead 2011-08-30 07:27:32 +00:00
karajorma af96b121b6 Gliding remains on when the player restarts a mission. 2011-08-30 04:12:55 +00:00
Goober5000 3ce69f150a waypoints and waypoint paths now have dynamic limits 2011-08-30 03:35:42 +00:00
karajorma caff640862 Documentation for the Multiplayer SEXP system. 2011-08-30 00:18:32 +00:00
Echelon9 9a76fcfe78 PVS-Studio fix: V515 The 'delete' operator is applied to non-pointer (hud.cpp). 2011-08-29 16:08:03 +00:00
Echelon9 e58723d589 PVS-Studio fix (Courtesy of niffiwan): V523 The 'then' statement is equivalent to the 'else' statement (barracks.cpp and missionhotkey.cpp). 2011-08-29 13:19:58 +00:00
Echelon9 b55516dfdb Documentation: Code cleanup of sexp.cpp 2011-08-28 15:10:07 +00:00
Echelon9 a5249cf57c Reverting 7545: Due to some odd errors coming through as Asserts in cfile.cpp 2011-08-28 12:48:20 +00:00
Echelon9 81c9c92479 PVS-Studio fix: V516 Consider inspecting an odd expression. Non-null function pointer is compared to null: 'jumpnode_get_by_name == 0' (sexp.cpp).
Ironic that check_sexp_syntax() appeared to have a mistake in it's check functions.
2011-08-28 09:49:02 +00:00
Echelon9 5386b9da7c PVS-Studio fix: V555 The expression '(now - bi->last_down_check) > 0' will work as 'now != bi->last_down_check'.
Due to unsigned int type wrapping the former code would have always returned true.
2011-08-28 09:41:54 +00:00
Echelon9 9c0edf2d64 Documentation: Code cleanup in multi_obj.cpp 2011-08-28 09:36:18 +00:00
Echelon9 66dd978878 PVS-Studio fix: V519 The 'num_users' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2296, 2297 (multi_pxo.cpp) 2011-08-28 09:34:09 +00:00
Echelon9 91f01706fd PVS-Studio fix: V519 The 'player_index' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 1389, 1392 (multi_obj.cpp) 2011-08-28 09:32:55 +00:00
Echelon9 9bd9ea619d PVS-Studio fix: V519 The 'list_size' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 597, 604 (gropenglpostprocessing.cpp) 2011-08-28 09:31:21 +00:00
Echelon9 b765ca37b9 PVS-Studio fix: V519 The 'path_index' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 12782, 12809 (aicode.cpp) 2011-08-28 09:30:07 +00:00
Echelon9 cb07f76f6c Documentation: Clean up lua.cpp 2011-08-28 08:54:10 +00:00
Echelon9 80a027a400 PVS-Studio fix: V803 Decreased performance. In case 'tvs' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator.
For further discussion see, http://www.viva64.com/en/b/0093/

The scenarios where it will improve performance are under Debug builds. This improvement will however allow quicker use of other profiling tools that need to run on Debug builds.

Note. Code with size_t does not see the performance improvement comparison to iterators due to absence of array overrun check.
2011-08-28 08:31:25 +00:00
Echelon9 2226ca29d8 Revert r7546 -- will need more work. 2011-08-28 07:39:56 +00:00
Echelon9 34084aebe6 PVS-Studio fix: V501 There are identical sub-expressions '(stricmp (szCmd, "372") == 0)' to the left and to the right of the '||' operator.
and 

V501 There are identical sub-expressions '(stricmp (szCmd, "375") == 0)' to the left and to the right of the '||' operator.
2011-08-28 07:27:53 +00:00
Echelon9 2d01954585 PVS-Studio fix: V802 On 32-bit platform, structure size can be reduced from 80 to 76 bytes by rearranging the fields according to their sizes in decreasing order. 2011-08-28 07:16:42 +00:00
Echelon9 9fa25a9ae4 PVS-Studio fix: V802 On 32-bit platform, structure size can be reduced from 50 to 48 bytes by rearranging the fields according to their sizes in decreasing order. 2011-08-28 07:08:40 +00:00
Echelon9 58b77fb8f9 PVS-Studio fix: V802 On 32-bit platform, structure size can be reduced from 52 to 48 bytes by rearranging the fields according to their sizes in decreasing order. 2011-08-28 07:03:57 +00:00
Echelon9 93622a3748 PVS-Studio fix: V802 On 32-bit platform, structure size can be reduced from 40 to 32 bytes by rearranging the fields according to their sizes in decreasing order. 2011-08-28 07:00:38 +00:00
Echelon9 499c698ba8 PVS-Studio fix: V802 On 32-bit platform, structure size can be reduced from 24 to 20 bytes by rearranging the fields according to their sizes in decreasing order. 2011-08-28 06:55:00 +00:00
Echelon9 a93f7d50fd PVS-Studio fix: V802 On 32-bit platform, structure size can be reduced from 28 to 24 bytes by rearranging the fields according to their sizes in decreasing order. 2011-08-28 06:50:02 +00:00
Goober5000 7931831cbe add dynamic vector stuffing 2011-08-28 03:31:46 +00:00
Goober5000 13366ad45b add linked lists, woot 2011-08-27 05:27:24 +00:00
Goober5000 9ef2aac09a return special exp values to ints, per discussion with Zacam awhile ago
while we're at it, change kamikaze damage to int since it's treated as such
2011-08-27 05:08:39 +00:00
Goober5000 7f5d1b362f enhance end-mission to possibly dump player to main hall 2011-08-27 04:39:18 +00:00
Goober5000 3b2b76206f add infrastructure and parsing support for mission forks (vs. mission loops)
mission fork interface art and selection logic still needs to be written
2011-08-27 03:57:16 +00:00
Zacam c6beca2629 Fix for Mantis 2467: untargeted heat seekers ignore ship protect
from niffiwan: http://www.hard-light.net/forums/index.php?topic=78001.0
2011-08-26 00:17:45 +00:00
Zacam 2115469681 Alt Name field for ships not being set was interfering with displaying the ship class or name in the loadout screen when selecting a weapon said ship could not carry. This fixes that. From Wanderer, via Karajorma. 2011-08-25 07:33:49 +00:00
Zacam 9bbc485f0c Slight update to optimize the built in main-f.sdr. 2011-08-25 02:42:05 +00:00
karajorma 7952433415 I've already removed this section of code once! Let's see if it stays out this time! 2011-08-25 02:36:10 +00:00
Sushi 04af101eda Add "$Max Turrets per Bomb" and "$Max Turrets per Target" turret attributes. Allow per-turret control over maximum number of targeted bombs and ships (respectively). Works like "$Max Turret Target Ownage" but on a per-turret basis, and with the ability to affect incoming bombs as well. 2011-08-25 01:33:44 +00:00
Echelon9 0b17acff72 Documentation: Cleanup a few comments in pstypes.h 2011-08-24 21:27:07 +00:00
The_E fe0ec8dffa Update for the ad.playMusic() function so that it accepts a volume parameter 2011-08-24 15:20:04 +00:00
Echelon9 d208740bcd PVS-Studio fix: V524 It is odd that the body of 'ds_eax_set_preset' function is fully equivalent to the body of 'ds_eax_set_environment' function (ds.cpp, line 2091). 2011-08-24 15:06:22 +00:00
Echelon9 a47f5b4069 PVS-Studio fix: V525 The code containing the collection of similar blocks. Check items 'Scene_color_texture', 'Scene_color_texture', 'Scene_depth_texture' in lines 2073, 2076, 2079. code gropengldraw.cpp 2011-08-24 14:56:48 +00:00
Echelon9 c2e41e4a95 PVS-Studio fix: V524 It is odd that the body of 'l_Object_getrvec_f' function is fully equivalent to the body of 'l_Object_getfvec_f' function (lua.cpp, line 4735). 2011-08-24 14:52:05 +00:00
Echelon9 dbcce6b112 PVS-Studio fix: V524 It is odd that the body of 'fireball_level_close' function is fully equivalent to the body of 'fireball_close' function (fireballs.cpp, line 970). 2011-08-24 14:48:17 +00:00
Echelon9 a248a37d58 PVS-Studio: Fix V805. Decreased performance. It is inefficient to identify an empty string by using 'strlen(str) > 0' construct 2011-08-24 13:37:01 +00:00
karajorma 56f758967a Fix several SEXPs for multiplayer use. This should fix Mantis issues 2401, 2483 and 2382.
In addition, fix a bug caused by SEXPs that do a callback but don't send any data.
2011-08-24 08:37:11 +00:00
Goober5000 f5ad44950a change the units on rotation acceleration to bring them in line with rotational velocity
this is not a compatibility break because acceleration didn't work until just a few days ago :D
2011-08-24 02:41:07 +00:00
Goober5000 b232661a78 supposedly these two checks were forgotten 2011-08-24 02:23:44 +00:00
The_E 94bb513f0f Another FXAA change to stop it from murdering our pretty pretty starfields. 2011-08-23 19:07:58 +00:00
The_E 34e7c0c927 Removing a preprocessor define from the fxaa fragment shader that we're not using. 2011-08-23 18:41:19 +00:00
Echelon9 745ec904d5 Documentation: Minor tweaking to ai.cpp 2011-08-23 13:50:24 +00:00
Zacam ec58a7388f Formating the shaders entries for soft particles to match the rest of the shaders. 2011-08-22 22:18:06 +00:00
Zacam c8d0e343e2 From jg18: Platform flag exclusion, Soft Particles wiki link.
(reformatting/spacing is mine)
2011-08-22 22:17:34 +00:00
Valathil da6727d9d1 Let's try this again. Adding Framebuffer distortion thrusters and explosions. 2011-08-22 17:57:01 +00:00
The_E 14ac7a3cbf object:checkRayCollision() for scripting, from m!m 2011-08-22 12:57:01 +00:00
karajorma 9aa338ecd8 Add a version of the event-true-delay SEXP which works using milliseconds rather than seconds. 2011-08-22 10:44:41 +00:00
Goober5000 a74ae93a14 wow... it looks like the subsystem acceleration sexp never worked until now... 2011-08-22 08:38:02 +00:00
Goober5000 f492ce292c revert 7508, which MSVC6 doesn't like 2011-08-22 07:58:00 +00:00
IssMneur 80d3b0ed84 - make split_str use const strings were appropriate.
- make brief_color_text_init use const strings where appropriate.
2011-08-21 17:05:04 +00:00
Zacam 583f5c976f Revert 7498: You should also test without optional command lines present, yellow disco screens of death in-mission are bad. 2011-08-21 04:04:45 +00:00
Goober5000 b1ad28efdb add an option to fire-beam to force the beam to fire
combine fighter_beam flag into flags field
2011-08-21 01:11:24 +00:00
Goober5000 6346fc6de6 fix string length 2011-08-21 00:43:31 +00:00
Goober5000 8e27e23acc Zacam's patch for bringing MSVC 2005 up to date 2011-08-21 00:29:11 +00:00
Valathil 89da5f6fdc Added thruster heat distortions and explosion framebuffer effects 2011-08-20 23:31:07 +00:00
Swifty fe605149c4 Soft sphere sprite rendering for particles, explosions, shockwaves, and thrusters. 2011-08-20 22:14:52 +00:00
Sushi 68b036a4af Add "Fog Near Multiplier" and "Fog Far Multiplier" options for missions. Allows the FREDder to tweak distances at which ships fade out in a nebula. 2011-08-20 15:06:18 +00:00
Goober5000 bc1b977c77 rewrite facing and is-facing to be more clear; I think I also fixed a bug in the process 2011-08-20 08:25:39 +00:00
Goober5000 5a28b96872 the key should be in the training category along with the other key sexps 2011-08-20 05:55:14 +00:00
Valathil 9c5e18225e Fixed a crash in the Ship effect SEXP so it doesn't crash the game if you try to cloak a wing with destroyed/departed/vanished ships. 2011-08-19 14:49:04 +00:00
karajorma c56684cf43 Fix Mantis 2397 (Variables do not use more than one column when using replace data or replace variable unlike all other data) 2011-08-19 10:10:53 +00:00
karajorma 4dfa577114 Add options to send objects, shorts and ushorts via the multiplayer SEXP system. 2011-08-19 08:09:50 +00:00
Goober5000 ce48784a5f add some sanity protections against overstuffing arrays 2011-08-19 04:39:12 +00:00
Goober5000 017699d8a3 minor tweaks 2011-08-19 04:32:24 +00:00
The_E bb2c773d7b Fix for Mantis 2484: Default text length for EFF files was far too short. 2011-08-18 20:21:05 +00:00
Echelon9 555a9033de Documentation: General clean-up and function documentation 2011-08-18 16:47:54 +00:00
karajorma 77745bdb75 Doh, missed one! 2011-08-18 07:56:31 +00:00
karajorma 1a577f6473 Fixes and clean up for the multiplayer SEXP packet system.
- Make the system more robust against accidental attempts to write data to the packet without proper initialisation. 
- Improve the error messages and function names to make clear the difference between the packet the game actually sends and the abstracted packets the coder seems to create and send in sexp.cpp
- Add a convenience methods to deal with SEXPs that don't need to write any data.
2011-08-18 07:48:59 +00:00
karajorma df0722f929 Fixes for the multiplayer SEXP packet to prevent errors caused by the coder taking too little data out of the packet before reporting that they are done. 2011-08-18 05:24:27 +00:00
Echelon9 13d8c4e97c Diaspora feature: Control configs override and default table 2011-08-17 14:40:13 +00:00
karajorma dc980ecc21 Halleck's bomb scoring code 2011-08-16 09:45:14 +00:00
Goober5000 a60c3d5a2d compilation fix 2011-08-16 04:55:47 +00:00
IssMneur 9395281267 From jg18: Add some missing wiki urls in the flag file output. 2011-08-14 23:10:08 +00:00
Zacam 608880bae5 Fred2 Open debug log now records build version data, just like fs2_open.log.
Updated the fs2_open.log output to declare "FreeSpace 2 Open version" instead of just "FreeSpace version"
2011-08-14 16:42:47 +00:00
The_E d5c065bf74 When loading FXAA shaders, always use the built-in defaults. 2011-08-14 15:08:28 +00:00
Echelon9 639fd1951a PVS-Studio fix: Expression 'b->type < 0' is always false. Unsigned type value is never < 0. 2011-08-14 14:07:11 +00:00
Goober5000 570aaf88ae change warnings to mprintfs 2011-08-14 08:42:50 +00:00
Zacam 0054d25e0b Shader Update: main-f updated with latest cloaking code. small amount of cleanup done as well. 2011-08-14 02:36:33 +00:00
Echelon9 37097f2d83 PVS-Studio fix: Duplicate comparison check for stricmp('FRED2_Open', scp->data.name). Instead use the second comparison to check for the same naming format as stricmp('FS2Open', scp->data.name) 2011-08-13 08:22:51 +00:00
Echelon9 c45aa93a9a PVS-Studio fix: Calling empty() on an STL vector does not modify the content of the vector in any way. To clear, use clear(). In addition, this commit also fixes the spelling of the containing function and turns on Doxygen documentation. 2011-08-13 08:19:55 +00:00
Echelon9 3a9f72c231 PVS-Studio fix: A call of the 'memset' function will lead to underflow of the buffer 'txt'. In HudGaugeMultiMsg::render() 2011-08-11 15:31:44 +00:00
Echelon9 ddb6039161 PVS-Studio fix: The '&' operator is applied to bool type value. You've probably forgotten to include parentheses or intended to use the '&&' operator. In UI_SLIDER2::draw() 2011-08-11 14:59:16 +00:00
Echelon9 5b60b84cfd PVS-Studio: The '&' operator is applied to bool type value. You've probably forgotten to include parentheses or intended to use the '&&' operator. In process_event_update_packet() 2011-08-11 14:56:43 +00:00
Echelon9 71255d6ba5 PVS-Studio: A call of the 'memset' function will lead to underflow of various buffers in multi code. 2011-08-11 14:53:11 +00:00
Echelon9 f25f912848 PVS-Studio fix: Fix r5260 - A call of the 'memset' function will lead to underflow of the buffer 'Valid_builtin_message_types'. 2011-08-11 14:35:03 +00:00
Echelon9 fe1c83e4eb PVS-Studio fix: Expression 'i >= 0' is always true. Unsigned type value is always >= 0. 2011-08-11 14:18:26 +00:00
Echelon9 2808f6624d PVS-Studio fix: Expression 'idx < 0' is always false. Unsigned type value is never < 0. 2011-08-11 14:15:05 +00:00
Echelon9 682936b8d7 PVS-Studio fix: XYZ co-ordinated were not correctly copied and pasted in parse_ship_values() 2011-08-10 16:11:29 +00:00
Zacam 1c4dacdafc Logging update: Major/Minor/Build update so that "Build" will always be available/log correctly even when "0" (ex: 3.7.0) without also needing "Revision" present. 2011-08-10 14:23:51 +00:00
Echelon9 f2f77ccc5f PVS-Studio fix: This if...then...else block was redundant in HudGaugeSupport::render(), as each 'then' block did the same thing 2011-08-10 14:01:15 +00:00
Echelon9 148c68b9f4 PVS-Studio fix: This if...then...else block was redundant in player_select_init(), as each 'then' block did the same thing 2011-08-10 13:58:25 +00:00
Echelon9 e7f07441f9 PVS-Studio fix: Incorrect logic within ping time colour indicator in multi_join_display_games() was overrepresenting yellow at the expense of red. Also replaced magic number with a definition. 2011-08-10 13:55:33 +00:00
Echelon9 913c4effe7 PVS-Studio fix: No need to set sinfo variable again immediately after first assignment to a different value in send_secondary_fired_packet() 2011-08-10 13:51:31 +00:00
Echelon9 283753bffa PVS-Studio fix: No need to set Current_stage variable again immediately after first assignment to a different hard coded value 2011-08-10 13:49:42 +00:00
Echelon9 139bb5afa9 PVS-studio fix: Ensure that both x and y of Player->current_target are reset correctly in hud_lock_determine_lock_point() 2011-08-10 13:47:06 +00:00
Echelon9 8531488d1b PVS-Studio fix: Remove duplicate if...then conditional within fs2netd_get_pilot_info() 2011-08-10 13:45:14 +00:00
Echelon9 127ac8d051 PVS-Studio fix: Remove duplicate if...then conditional within ai_process() 2011-08-10 13:43:18 +00:00
Echelon9 989916e0a7 PVS-Studio fix: Correct duplicate attempt to set the docker_aip->support_ship_signature in ai_do_objects_undocked_stuff() 2011-08-10 13:40:53 +00:00
IssMneur 973efc2865 From jg18: various polish details and a description clarification, based from descriptions within sandmanjack's launcher 2011-08-09 04:37:59 +00:00
Swifty f6ba2141b4 Shockwaves and death explosions will stay oriented independently of player's bank. 2011-08-07 09:55:18 +00:00
The_E abd7134e0e ALtered according to feedback from Valathil. 2011-08-06 19:11:43 +00:00
IssMneur 1c130bbc8a From Valathil: Fixes a problem with a min-max lifetime smart spawn weapons where it wouldn't fire except at close range 2011-08-06 18:20:34 +00:00
The_E 20346118c6 Another sprite rendering fix from Valathil 2011-08-05 21:39:14 +00:00
Swifty f35b322397 Ship-specific gauges will only get preprocessed once. 2011-08-05 09:06:31 +00:00
The_E 154f90823c Another sprite rendering fix from Valathil 2011-08-04 21:46:21 +00:00
The_E 55427f1690 Patch for sprite orientation from Valathil 2011-08-04 16:25:19 +00:00
Zacam 7cb68f6de2 Resolves MSVC complaint about "'i' : unreferenced local variable" for the size_t in "void game_render_hud(camid cid)" 2011-08-04 13:58:46 +00:00
The_E e6f0e0e956 Ooops, meant to use a pointer there. 2011-08-04 13:34:33 +00:00
The_E 4dd9021e9c Resolve an "uninitialized Variable" warning 2011-08-04 13:33:35 +00:00
The_E aa9bb91dd7 And another one. 2011-08-04 13:17:55 +00:00
The_E 300ee6f9e9 Slight correction to make nvidias GLSL compiler happy 2011-08-04 13:16:32 +00:00
The_E ac8b7c4c10 From m!m: Adds access to collision data to the Lua API. 2011-08-04 11:05:25 +00:00
Swifty 5283c36d34 Let's try this again without breaking the orb radar: Optimized BSG radar and cockpit displays. Fixed cockpit models not switching when changing ships. 2011-08-04 11:01:28 +00:00
The_E 47b1f57435 Adding the function "ship::addShipEffect(string name, int duration)" to the LUA API. 2011-08-04 10:58:28 +00:00
IssMneur bb75f7fc4e Move clear-subtitles to the camera subcategory in FRED. 2011-08-03 04:12:46 +00:00
The_E 4a488dd7f0 Reverting 7411 due to it breaking the standard 3D radar. 2011-08-02 13:02:34 +00:00
Swifty 043d56b3f7 For Diaspora: Optimized BSG radar rendering and cockpit displays. Fixed cockpit models not switching when changing ships. 2011-08-02 10:49:51 +00:00
The_E 43e220aa68 Fix for issue with the weapon select sound not playing when weapon_choice_3d was active 2011-08-01 20:39:31 +00:00
IssMneur 64ff2ba5a5 Complain correctly about pilot name length (actually say that the name is too long rather than just an assert). 2011-08-01 20:10:51 +00:00
The_E ab30a9662d Updating the internal shaders a bit 2011-08-01 18:38:04 +00:00
The_E 91e54218a7 Correcting a little oversight with the $Selection Effect: tbl entries 2011-08-01 18:06:58 +00:00
The_E fd29f15e12 Make external weapon models cloak when the mothership is cloaking. 2011-08-01 11:56:06 +00:00
The_E ebf412d9f4 From Valathil: Allow shader effects to be less wrong if the Post-processing framebuffer is not active 2011-07-31 20:37:42 +00:00
The_E d366751420 Request by MjnMixael: clear-subtitles sexp 2011-07-31 20:35:34 +00:00
The_E 245ed41f71 Moving ai_profiles parsing up a few lines to fix issue with $Default Weapon select effect 2011-07-31 20:21:35 +00:00
Echelon9 e4125bab11 Picked up by MSVC analyser: Lock down these cases of unsafe string operations 2011-07-31 13:41:13 +00:00
Echelon9 7d8ec67a99 Fix Apple support for vglDrawBuffers, part of the new shader code 2011-07-31 08:03:04 +00:00
The_E 43c6cd2539 Updating the sexp description 2011-07-30 23:21:28 +00:00
The_E 4c919f0a59 Fixes issue with post_processing.tbl parsing 2011-07-30 22:45:53 +00:00
The_E 2dc34f3e1f This is the correct version now. 2011-07-30 22:39:49 +00:00
The_E 7f219cad2c Reverting due to bugs 2011-07-30 22:32:09 +00:00
The_E 3a702bdc1a This should have been committed as well 2011-07-30 21:43:30 +00:00
The_E 32c5491d83 Adding support for the new cloaking effect. 2011-07-30 21:13:02 +00:00
The_E c1ed95995d Fixes issue regarding UI sounds and built-in retail ship/weapon effects being of different length. 2011-07-30 19:49:49 +00:00
karajorma 04348d856d Ignore-key SEXP and the changes needed to support it. 2011-07-30 18:54:02 +00:00
The_E 466441a58b Slight fix for issue with SSMs hitting the player ship 2011-07-30 07:31:24 +00:00
The_E 9e423a8bca Fixes issue with Default ship/weapon select ai_profiles entries. 2011-07-29 13:53:35 +00:00
The_E 23f7fcfd07 Woops, built-in shader was incorrect 2011-07-27 14:44:43 +00:00
The_E 8fb2085a9d Adding the realtime ship/weapon select effects by Valathil. 2011-07-26 22:02:12 +00:00
Zacam 9d212a5f07 From Plombo: sets "force_s3tc_enable" for some linux drivers to be able to render DDS textures.
http://www.hard-light.net/forums/index.php?topic=77196.0
2011-07-25 22:10:32 +00:00
The_E 83d1fe8f5f Update to FXAA 3.11 2011-07-23 10:14:36 +00:00
Echelon9 ea27c04867 Documentation: Resolve a Doxygen warning on the unpack_frame() and unpack_frame_from_file() functions 2011-07-23 04:38:16 +00:00
Zacam 96925143c1 Resolves SSE detection issues on #including <xmmintrin.h> for GCC/G++ and MSVC6.
GCC/G++ users (Apple, Linux) should look to adding intrinsics to their compile options. (-msse)
2011-07-23 02:07:19 +00:00
The_E 76dfdc4ba7 Another change to make compilers happy. This time, it's ATi's turn. 2011-07-22 20:54:46 +00:00
Zacam f2cc1239dd If we declare inv2A as a float up top, we no longer need to brace out any instances which resolves cross initialization as well as still allowing MSVC6 to remain operational (per 7372). Minor formating cleanup as well.
Thanks to Goober and Plombo for feedback.
2011-07-22 18:32:22 +00:00
Goober5000 96736a29ea fix compile problems on MSVC6 2011-07-22 05:56:46 +00:00
Goober5000 8dac846455 fix Mantis #2474 2011-07-22 05:55:04 +00:00
Goober5000 6422ac62e0 revert 7368: these are most certainly not graphics options 2011-07-22 05:13:28 +00:00
The_E 646046538c Small change to make nvidias' GLSL compiler happier 2011-07-21 20:44:26 +00:00
The_E 39a1a01a63 Moving the -window and -fullscreen_window cmdline options to the "Graphics" section 2011-07-21 16:29:49 +00:00
The_E bbae282db5 Update FXAA to 3.10. Also changes the fxaa preset selection method to recompile shaders when preset changes, should yield some speed improvements. 2011-07-21 12:18:37 +00:00
Zacam 6e8265278a This is not a repeat of 7340/7344. It is necessary however that we be able to tell users the value found before we reset it to zero, otherwise the warning will only ever return 0 instead of the bogus value. 2011-07-21 06:02:42 +00:00
The_E 7f5c3d343e Valathil's code cleanup patch. 2011-07-20 18:04:43 +00:00
The_E a61116b42b Remove unreferenced variable. 2011-07-20 15:54:28 +00:00
The_E 519819b550 More lighting patches from Valathil 2011-07-20 15:27:59 +00:00
The_E 60c4ca8eb3 Changing this Warning to an mprintf. We really do NOT want to generate warnings with retail data, don't we? 2011-07-19 22:00:27 +00:00
The_E 1d3aa79e6b Split the fxaa shader in two for better compiler compatibility 2011-07-19 21:51:37 +00:00
The_E 084465a613 Updating the built-in fxaa shaders to 3.9 2011-07-19 18:23:32 +00:00
Echelon9 c6d0f6170d For Valathil: Fix distance check in beam.cpp 2011-07-19 13:25:42 +00:00
The_E c57dd1ed07 From m!m: Gives scripting access to debris chunk size data 2011-07-18 17:58:49 +00:00
Sushi bbfc33eb40 Revert 7340 and 7344, since they derped hard. (Kept 7341) 2011-07-18 14:54:41 +00:00
Zacam 1e7caaccda Update:
libpng now at 1.5.2 (with update to pngutils)
zlib now at 1.2.5
(Files are in "LF" instead of "CRLF" this time around.)
MSVC6-2010 and XCode project updates included.
2011-07-17 05:46:14 +00:00
Zacam 1e7c5e65b3 Update to Post_Processing for split controls on Brightness and contrast.
Spacing/formatting clean-up.
2011-07-17 04:39:10 +00:00
Zacam 8cbffd6065 From Valathil: Beams now use Tube lighting. Updates to main shaders accordingly. 2011-07-17 04:36:00 +00:00
Swifty 6488b73b0a Corrected directive gauge to use both X and Y offsets. 2011-07-14 07:08:53 +00:00
The_E 7b2c8f7086 From Valathil: Do light sorting only once per object 2011-07-13 09:03:03 +00:00
Goober5000 a308e6f45f Valathil's fixes for #weak weapon variants
http://www.hard-light.net/forums/index.php?topic=77060.0
2011-07-13 07:33:29 +00:00
Zacam 513d2d7182 Copeh Pasteh does not make for al dente. 2011-07-11 19:09:10 +00:00
Goober5000 2eb4bb3aec deal with string truncation on MSVC6 2011-07-11 02:10:48 +00:00
Goober5000 bff6c5d16d Valathil's method will fail on a string that is less than 60 chars and does not contain a :, so use memset, which is the historical technique 2011-07-11 02:05:27 +00:00
Zacam cc46867722 Additional warning messaging for parsing the ai_profiles.tbl or -aip.tbm. 2011-07-10 17:21:33 +00:00
Zacam 8438530258 From Valathil: ai_profiles tbl/tbm will now parse set_flags and warn on unrecognized declarations when found.
Credits to Spoon and WoD for unveiling this over-sight.
2011-07-10 17:05:57 +00:00
The_E 53428e2b62 Reverting 7334 and 7333, following feedback from valathil 2011-07-09 13:14:49 +00:00
Echelon9 872f8589b7 Fix r7325: Asset() =/= Assertion() 2011-07-07 12:59:38 +00:00
Zacam 1dd78de5ff Directional Lights sorting probably should not have been flipped, the rest seem to be okay though.
(Sun facing sides of ships were going pitch dark when lots of beams were active)
2011-07-06 23:07:09 +00:00
Zacam a312b49bc9 From Valathil: Correction to commit 7292. Light sorting now takes place in the proper order. 2011-07-06 20:55:45 +00:00
The_E 4fdfd96b8f Major change to FXAA. Now doing a prepass to convert the main shaders' RGBA output into RGBL. Also enables minor speedup for OpenGL 4/4.1 capable chips. Default preset changed to 6. 2011-07-06 10:48:56 +00:00
Goober5000 0244c64214 a wee bit more is needed 2011-07-06 05:06:22 +00:00
Goober5000 b175a91843 make things compile 2011-07-06 04:44:25 +00:00
Goober5000 eeeb1a8898 don't assert on a benign conflict 2011-07-06 04:39:40 +00:00
IssMneur 2272fd28e2 From Valathil: Vary the intensity of lighting from warp fireballs (wormhole) based on the radius of the fireball. 2011-07-06 04:22:09 +00:00
The_E 4fa70b61db New FXAA shaders. These have an increased preset range, going from 0 to 9 inclusive. Presets 0 - 4 use the "Console" version of the algorithm, 5 - 9 get the "PC" version 2011-07-05 12:35:18 +00:00
The_E 9db07896e1 Wasn't supposed to change this 2011-07-04 14:59:12 +00:00
The_E 28bbbdab09 Reverting, due to unforeseen consequences 2011-07-04 14:55:07 +00:00
The_E 48610b1de5 Small update to the FXAA shaders. Also adds a function for shader uniform access that was previously missing. 2011-07-04 13:59:02 +00:00
karajorma d6767809b1 Add a separator between paste and add paste in the event editor. 2011-07-04 02:22:26 +00:00
Zacam c284047c36 I should sleep more. 7307 was to add a "{ "glUniform4fARB", 0 }," not another v. 2011-07-03 14:44:16 +00:00
The_E 5674ce0c3e Updating these to current official versions 2011-07-03 08:40:21 +00:00
The_E b6548dfb50 And -oldfire, which does nothing, goes to the grave. 2011-07-02 19:45:46 +00:00
The_E eaf03bb480 And -safeloading bites the dust too. 2011-07-02 19:43:02 +00:00
The_E e23da70624 Removing several deprecated/unused cmdline options. Victims this round are: -cell, -timerbar and -d3d_bad_tsys 2011-07-02 19:33:23 +00:00
Zacam e0ae11af61 Fix for SSM usage causing Assert. If warp lifetime must be 4 seconds or greater, how about we warn them (in parsing) before they try and use it (and thus set it to at least 4.0) instead?
Thanks to bigchunk1 for catching this one and to IssMneur for the assist and review.
2011-07-02 05:07:57 +00:00
Zacam c2452b69fa This is the right way to do it.
Correct version of 7304.
2011-07-02 01:02:26 +00:00
Zacam 54644adfb8 ...but apparently not that way. 2011-07-02 00:14:04 +00:00
Zacam 9f00e84edf OGL_UNIFORM4FV should be (and now is) preceded by OGL_UNIFORM4F. 2011-07-01 23:37:30 +00:00
The_E 5d210146e3 Built-in bloom shader adjusted for higher quality 2011-07-01 19:09:25 +00:00
The_E ff7b3cdaaf Minor typo correction. Thanks to Valathil for finding it. 2011-07-01 19:00:57 +00:00
The_E f768943284 Swifty's collision detection improvements. 2011-07-01 17:00:31 +00:00
The_E f22bef9b5e Another small change to the built-in shaders 2011-07-01 11:33:09 +00:00
The_E c806651d11 From Valathiel: enables light sorting. Reduces light flickering in some cases. 2011-07-01 10:00:55 +00:00
The_E 9d6e0936cd Minor adjustment to the built-in shaders 2011-06-30 10:06:01 +00:00
The_E a46de9340f Fix for Mantis 2395: Introduces troubleshooting flag to switch between using glDrawElements and glDrawRangeElements 2011-06-28 20:20:25 +00:00
The_E aaba640733 Fix for Mantis 1983: Do not process lightning info when in standalone mode 2011-06-28 19:48:20 +00:00
The_E d60e3787d1 Fix for Mantis 2424: Crashes in multiplayer when <Wingname> 1 is not a player ship 2011-06-28 19:24:13 +00:00
The_E 3a451f36b5 When will I get it right.... 2011-06-28 14:13:21 +00:00
The_E a955dfa6dc Aaaargh, messed up AGAIN. 2011-06-28 14:10:23 +00:00
The_E 28e82d9c5b Ooops, fucked this one up a bit. 2011-06-28 14:07:34 +00:00
The_E 28db0bfe1f How did these values start colliding all of a sudden? Must have been my fault, sorry. 2011-06-28 09:38:06 +00:00
The_E 59cbde3d9e Adds sexps to manipulate a ships' collision groups. If two objects are members of the same collision group, they will not collide with each other. 2011-06-28 08:36:54 +00:00
Goober5000 e4266af9cf add string-get-substring, string-set-substring, and string-get-length; needed for Blue Planet 2011-06-28 04:08:59 +00:00
Zacam 524099c68e Some "\n"'s to help with logging during multi. "Scoring:" wasn't using any, so it would run on the next item right at the end. 2011-06-28 01:03:03 +00:00
The_E c57ede0cc1 Adding a piece of sanity checking here, to avoid crashing the release build under certain strange circumstances 2011-06-27 22:16:41 +00:00
The_E a60d32e669 Disable warning that is meaningless ("why are G_predicted_pos and G_fire_pos the same?"), and only serves to confuse people. 2011-06-27 13:52:45 +00:00
The_E fb21bc4272 Patch for Mantis 2050: Renaming the log file may cause crashes 2011-06-27 13:45:19 +00:00
The_E 4b5d6f939a From m!m: Patch for Mantis 2459 (Calling ts.createParticle with an invalid effect handle causes an Int3()) 2011-06-27 12:49:42 +00:00
Sushi e661586a3f Add "wait for animation" turret flag (turret won't fire until associated animation completes) 2011-06-26 18:10:54 +00:00
The_E 590cbf0b2b Patch from m!m to give scripting access to debris metadata 2011-06-25 14:15:44 +00:00
Swifty a7383cba89 Introduced the preprocess() method in HudGauges. Allowed the HUD to peek at the HUD message buffer when HUD is disabled. 2011-06-25 09:30:47 +00:00
The_E f8fef5c56f Patch for Mantis 2326: Standalone server crashes when ship classes are changed in loadout.
I hope.
2011-06-25 08:03:52 +00:00
Zacam d15c9259cd Standalone execution now creates it's own log file (fs2_standalone.log) 2011-06-21 19:23:56 +00:00
The_E 503fa0d19b Fixes issue with padlock view messages not appearing 2011-06-19 12:57:26 +00:00
The_E bafed3f964 Fix compiler warnings re: signed/unsigned mismatch 2011-06-18 21:36:05 +00:00
Sushi 3a7c0f2cee Halleck's glide sound patch (mantis 2452) 2011-06-18 00:44:41 +00:00
The_E 2f01d3f0ce Bumping the max number of files CFile can handle to 2^16 2011-06-16 17:09:30 +00:00
Zacam 1b6bfd2c89 Adds "/MP" as an Additional compiler Option for MSVC 2008. 2011-06-16 15:59:59 +00:00
Sushi 83b4d80566 Added is-in-box SEXP 2011-06-16 02:59:44 +00:00
chief1983 0a06eff122 Update OS X Ogg libraries in the Frameworks archive. 2011-06-15 20:04:07 +00:00
karajorma 65d6013539 Get and set SEXPs for countermeasures. 2011-06-15 12:46:02 +00:00
The_E a5a34af86d Oops, small typo 2011-06-14 16:45:35 +00:00
The_E f187ed531e This will make various text boxes react correctly to changes in font height. 2011-06-14 16:40:20 +00:00
Goober5000 2bdaac8c52 add mjn.mixael's credits image specification feature 2011-06-13 03:42:24 +00:00
The_E 695db665e3 Adds "$disable weapon damage scaling for player:" AI profiles option, which does what it says on the tin. 2011-06-11 19:26:56 +00:00
Sushi 4f8e6da7b9 Halleck's pre-launch sound patch (mantis 2451) 2011-06-10 04:52:35 +00:00
Zacam 0801b6861f Back port from AP: removes a couple of Unreachable NULL returns 2011-06-07 02:30:00 +00:00
Sushi 4b6d7192a1 Merged from Diaspora: Slight bump in contrail limit and max reinforcements 2011-06-04 16:42:43 +00:00
Sushi ed340e193f Merged from Diaspora branch: Make "+Shield_Hit_ani" optional 2011-06-04 16:02:21 +00:00
Sushi 14717f3368 Turn Z-buffering back on for BSG warp effect. 2011-06-03 23:54:30 +00:00
The_E cd9663f015 A small change to make Apple's GLSL compiler happy 2011-06-03 18:02:29 +00:00
chief1983 f7c4aa5221 Fix a typo reported by ElGuillermo. 2011-06-03 16:53:39 +00:00
Zacam 6f4725b0d9 In crawling through XT Branch, noticed this.
"%sÀÄ%s" should be "%s:%s"
2011-06-03 05:18:10 +00:00
Sushi fcbce45a2c Fix nasty pointer bug 2011-06-03 03:02:48 +00:00
The_E 6037493ae9 Another Assert -> Assertion conversion to help in mission debugging. 2011-06-02 09:36:24 +00:00
The_E c71012a829 Patch for Mantis 2421 from m!m: Adds scripting controls for particles. 2011-06-01 19:41:07 +00:00
Goober5000 8d10c0864d extra small enhancement 2011-05-30 21:20:32 +00:00
Goober5000 5fb4a6db18 add ability to set the duration of the ship death roll 2011-05-30 21:06:11 +00:00
The_E 2eab7d90f2 From m!m: Patch for Mantis 2446: Scripts not pausing when game is paused. 2011-05-30 18:47:27 +00:00
Goober5000 c6b4fc32d3 fix sanity check for too-long messages (Mantis #2412) 2011-05-30 06:47:27 +00:00
Goober5000 600936b331 reverting 7211 because it is not a proper fix 2011-05-29 06:56:17 +00:00
The_E 5c628d2abd Adding a code comment here to remind people about necessary bumpings 2011-05-28 14:37:48 +00:00
Zacam e1c107a483 Back in r6952 "HUD_OBJECT_PING," was added to "static int retail_gauges[] = {" but "int num_default_gauges = 43;" was not bumped up, resulting in "HUD_OBJECT_FIXED_MESSAGES" not displaying. 2011-05-27 23:38:14 +00:00
Sushi 2106903cbc Fixing some HUDs showing from other ships when they shouldn't, take 2 2011-05-27 14:36:14 +00:00
The_E 23b121a108 Patch for Mantis 2441 (friendly-stealth-invisible" flag doesn't work) from pyro3d 2011-05-27 09:11:51 +00:00
The_E 649c0fb3c4 Reverting commit 7203. If you wish to exclude certain gauges from rendering depending on camera mode, you need to edit that gauges's constructor function, NOT the canRender() method. 2011-05-26 20:45:12 +00:00
Goober5000 358343b813 break strings into bite-size pieces for ease of compiler digestion 2011-05-26 03:58:00 +00:00
Goober5000 0a8f93d474 fix minor pierce-shields table flag bug (Mantis #2442) 2011-05-26 03:40:07 +00:00
Sushi 6f11196106 Added an Assertion to help track down a sound error 2011-05-24 15:03:09 +00:00
Sushi 368029ec59 Fix some HUD gauges being rendered while viewing other ships externally 2011-05-24 14:40:57 +00:00
Sushi 1d4d3c0b6f Update thruster rendering (consistently render based on acceleration instead of speed, don't render distant/tiny thrusters) 2011-05-21 20:25:14 +00:00
The_E 784da1e0d0 Adding the FSU main shaders, FSU post-processing.tbl, as well as the post-processing and FXAA shaders to def_files. 2011-05-21 17:07:41 +00:00
The_E 3cbf515fe3 Since bloom can now be changed in-game, we always need to compile the shaders. 2011-05-20 15:56:30 +00:00
The_E 6526b86bc5 Patch for bug encountered by Zacam: Ship model instance data was not being reset correctly when changing ship classes. 2011-05-19 21:32:02 +00:00
The_E 444936ec21 This will make the lab more useful, as it is now possible to adjust the bloom intensity on-the-fly by pressing b (for more bloom) or n (for less bloom). 2011-05-19 14:51:51 +00:00
Zacam 99cdc82be6 Stupidest typo ever. "GS_STATE_END_OF_CAMPAIGN" not "_EMD_" 2011-05-19 12:20:22 +00:00
Sushi 63444087e2 Fix BSG warp effect shockwave 2011-05-19 00:50:27 +00:00
The_E ad1297167d Adding a bit of configurability to the FXAA business. This alters the F3 Lab so that the number keys correspond to FXAA presets (with 0 being lowest and fastest, default being 3). Also adds the "-fxaa_preset" commandline argument, which accepts a single int parameter. New Shaders needed to take full advantage of this, see forum thread (http://www.hard-light.net/forums/index.php?topic=76145.0) for details. 2011-05-18 11:37:27 +00:00
The_E 814f9777c5 Adding an error message in case FXAA shader compilation fails. 2011-05-17 16:29:43 +00:00
The_E 41bfa86911 This will enable FXAA support in FSO (Read: Antialiasing as a post-process stage). In order to use it, the shaders found here: http://blueplanet.fsmods.net/E/stuff/FXAA-shaders.7z need to be in data/effects. 2011-05-17 14:57:33 +00:00
The_E c1c9096d82 Converting a few more Asserts to Assertions. Also added a graceful exit path. 2011-05-15 08:38:22 +00:00
Sushi 8c3150455a Fix clipping problems with deathcam and cutscene bars. 2011-05-14 16:58:29 +00:00
Echelon9 365bd811c2 Documentation: First pass of AI code functions 2011-05-12 13:44:20 +00:00
Echelon9 38257bead8 Documentation: 3D clipper functions 2011-05-12 13:43:42 +00:00
Echelon9 e1fa804c1c Documentation: Animation code function documentation 2011-05-12 13:43:00 +00:00
The_E 70d1c6f8b1 Fixes issue where both the 2D and 3D radars were visible at the same time. Code should now respet the commandline flags properly. 2011-05-10 15:26:46 +00:00
The_E c684705e01 This makes the "Form on Wing" AI order accessible to FREDers as an AI goal. 2011-05-08 11:17:34 +00:00
Sushi 4324ca87d6 Updated "alt1" path mode so that it respects the cap-waypoint-speed SEXP. 2011-05-07 11:31:30 +00:00
The_E 033f06ec20 Aargh, this might have been catastrophic 2011-05-01 15:05:01 +00:00
The_E c65a175d2c Fix compile warnings here. 2011-05-01 15:00:53 +00:00
Echelon9 e55068ccf1 ds.cpp: Back this change back out until the wholesale change can be made at once 2011-05-01 14:59:31 +00:00
Echelon9 f55260cc0e Fix Diaspora Mantis 772: Player is able to fire countermeasures when player-use-ai SEXP is used. Also document. 2011-05-01 13:03:39 +00:00
Echelon9 761266b768 Two small comment typo corrections for model.h and ship.cpp 2011-05-01 12:00:26 +00:00
Echelon9 8138efbcf9 Documentation: Commentary for modelanim.cpp|h 2011-05-01 11:59:40 +00:00
Echelon9 aa708f6d26 Fix Valgrind report: Use of uninitialised value &freq in alcGetIntergerv(); requires braces to address GCC crosses initialisation error due to the goto in this function 2011-05-01 11:07:26 +00:00
Echelon9 dab00c94bf Documentation: Help save some trees 2011-05-01 09:06:12 +00:00
Echelon9 4669a7613c As we don't do Unicode properly yet, this character corrupts. In French it still means Hat Back (joystick control) 2011-05-01 08:53:13 +00:00
Echelon9 5565e0ac8b Documentation: hud.cpp and hud.h files 2011-05-01 06:05:48 +00:00
Echelon9 aa1601bb36 Documentation: Fix a few syntax errors reported in Doxygen's log 2011-05-01 03:54:01 +00:00
The_E 744a247f67 Change syntax and help text of the set-jumpnode-model sexp, as it was rather broken before. 2011-04-30 16:23:05 +00:00
Echelon9 9a4d348bc0 Xcode project file: Generate debug builds with a DWARF plus dsym file, so that analysis tools can retrieve source code line numbers 2011-04-30 06:24:08 +00:00
Echelon9 09a360c284 Documentation: sound/ds.cpp 2011-04-30 06:18:03 +00:00
The_E a858e90a6d And now set-jumpnode-name is even multi compatible. 2011-04-29 14:54:38 +00:00
The_E 83bd54130b Added warning to the sexp help for set-jumpnode-name 2011-04-29 14:10:52 +00:00
The_E 6c5013760a set-jumpnode-name, as implemented by CommanderDJ 2011-04-29 14:05:45 +00:00
karajorma 68645bd224 Fix for Mantis 2427 (Directive-Is-Variable SEXP doesn't allow you to change the variable name. 2011-04-28 12:46:01 +00:00
Sushi 2992e88315 Add $Path Metadata and +departure rvec to ships.tbl 2011-04-27 14:22:22 +00:00
The_E b79a54b67a Okay. No more screwing around with this. 2011-04-26 11:13:56 +00:00
The_E a71d012ef6 Ooops, this armor type business isn't ready yet 2011-04-26 11:09:19 +00:00
The_E e821ae2ccd Fix for Mantis 2428: Decal parsing deprecation error 2011-04-26 09:24:54 +00:00
The_E d71a5d5b90 Fixes issue with custom HUD gauges not resetting to their default values between missions. 2011-04-24 17:19:21 +00:00
Wanderer 2eb06e1787 fixes to turret rotation handling (swarm issue) and to secondary turret angle checks 2011-04-23 21:53:19 +00:00
Wanderer 06a3381dd9 fix for mantis 2309's corkscrew issue 2011-04-23 12:18:30 +00:00
The_E 7e50611a02 Guarding against a null vec3D in vm_vec_normalize here. 2011-04-21 16:12:54 +00:00
Wanderer e04d475345 related to mantis 2406 - ai profiles option to make beams deal damage to weapons 2011-04-20 15:40:29 +00:00
Wanderer 94faf22283 Fix for mantis 2406 for weapon vs. weapon collisions (not beam vs. weapon collisions however) 2011-04-20 08:17:24 +00:00
IssMneur e6f43f6f0f Make this a more useful error message. 2011-04-20 04:16:42 +00:00
Sushi 39d6889f86 Add "$ai path mode:" to ai_profiles. This allows an alternate method of path following that works better in some cases, such as with high-damp ships. 2011-04-18 14:08:31 +00:00
karajorma 1bba558d70 Add a SEXP to allow variables to set the counter in a directive. 2011-04-18 05:34:18 +00:00
Echelon9 5d635a262b DOC: Amendment to frand_range() 2011-04-17 00:33:51 +00:00
Echelon9 e12f71c83d DOC: Documentation of floating.cpp 2011-04-17 00:18:59 +00:00
Wanderer 39e8a24663 fix for issue noticed by Zacam in the particle effect changes 2011-04-15 14:34:31 +00:00
The_E f4c90eff0c Woops, this shouldn't have gone in 2011-04-15 12:44:24 +00:00
The_E e5efa336c1 Fix for Mantis 2416 (Messages do not display when in padlock view) 2011-04-15 12:34:11 +00:00
The_E ceb68d44bd Fix for Mantis 2240 (HUD anis and training messages do not display if hud_disable_except_messages is active) 2011-04-15 12:16:17 +00:00
Wanderer bf66734ded adds table controls for various particle effects, and explosions related to ship death event. per ship class base deathroll time. 2011-04-14 18:59:06 +00:00
Zacam 973fab655e Reported by chief1983, adds closing brace to line 2346.
Mac's should be happy now.
2011-04-12 23:35:58 +00:00
The_E 5cbf11ff6b Of course, I did it wrong. However, this works now. 2011-04-12 13:32:27 +00:00
The_E b68ef9b9b0 Requested by Axem: Allow beams to tag targets. 2011-04-11 15:44:33 +00:00
Echelon9 362241cf22 Documentation: hud_sensors_ok() function comment 2011-04-10 13:09:24 +00:00
Echelon9 247ac6373e Second go at patch r7110 2011-04-08 13:00:51 +00:00
Echelon9 0a7e8be8f4 Fix two buffer overflows: missionweaponchoice.cpp(3580): warning C6386: Buffer overrun: accessing 'slot->wep', the writable size is '28' bytes, but '4194244' bytes might be written & missionweaponchoice.cpp(3585): warning C6386: Buffer overrun: accessing 'slot->wep_count', the writable size is '28' bytes, but '4194244' bytes might be written 2011-04-08 12:38:19 +00:00
The_E 9a6f8a8be7 Removing an Assert in favour of more elegant error handling. 2011-04-06 10:25:18 +00:00
The_E 092ea635c3 Fix for issue with the "no ETS" flag where subsystems were not getting recharged properly. 2011-04-05 12:05:32 +00:00
The_E 67175970a4 2011-04-05 09:44:43 +00:00
The_E 72287264e3 FSF's fix for Mantis 2371 (Hotkey selection does not work for additional wings) 2011-04-04 14:48:27 +00:00
The_E 9b580610ca Fix for Mantis 2409 (Directive gauge is rendered despite hud-disable-except-messages) 2011-04-04 13:07:17 +00:00
The_E 406b57e5b0 Fix for Mantis 2391 (Erroneous warning about missing assets due to changd HUD loading mechanisms) 2011-04-04 13:03:29 +00:00
The_E 42ff356ad2 Fix for Mantis 2422 (Target Shield indicator behaves like a duplicate of the player shield indicator) 2011-04-04 12:56:59 +00:00
The_E 0aa44e3b12 Correction: Previous commit broke AWACS behaviour. 2011-03-30 09:42:52 +00:00
The_E e635eb373b Add a sanity check here. 2011-03-29 18:06:04 +00:00
The_E ef2681eb69 Change an Assert to an Assertion for better debugging. 2011-03-29 17:17:15 +00:00
Zacam 223920ded6 7092/7093 were meant for Antipodes, not Trunk. 2011-03-29 13:55:04 +00:00
Zacam 8501ffa53f Reported by rsaxvc (Probably due to MAX_INT being used)
http://www.hard-light.net/forums/index.php?topic=75332.0
2011-03-29 13:50:17 +00:00
Zacam 9c0144dd96 Pull the "demo" dir out of the makefile. 2011-03-29 13:42:57 +00:00
Echelon9 6628e967b3 DOC: Update some documentation in missionbriefcommon.cpp 2011-03-24 12:53:44 +00:00
Wanderer db8b44191d feature commit - damage and impact particle spew controls, control for setting a multiplier for propagating explosion radius. 2011-03-19 22:37:32 +00:00
The_E a1acb0601d And more from m!m, as seen here: http://www.hard-light.net/forums/index.php?topic=44821.msg1487355#msg1487355 2011-03-19 21:49:42 +00:00
The_E 808a3dd1e0 A few tweaks and additions by nuke 2011-03-19 21:37:51 +00:00
The_E 9d8caf5f2a m!m's corrections to subsystem:fireWeapon() as seen here: http://www.hard-light.net/forums/index.php?topic=44821.msg1486751#msg1486751. Slightly adjusted to use model instances. Also tweaked ship_get_global_turret_gun_info() to use model instances. 2011-03-18 21:47:17 +00:00
Sushi 5469769936 Add "$Detail Distance Multiplier" 2011-03-18 14:33:50 +00:00
Goober5000 b9a1eca909 improved version of hud_squadmsg_wing_valid(); fixes Mantis #2415 2011-03-11 07:21:27 +00:00
karajorma a561ecc2a3 Remove a few annoying compilation warnings 2011-03-10 00:26:45 +00:00
Goober5000 af39be3120 add another ship class to the list of FSPort changed names 2011-03-09 04:04:33 +00:00
Goober5000 c6f40a74bb finish patching subsystem comparison 2011-03-03 07:00:42 +00:00
Swifty 225f16f754 Memory leaks involving Polymodel_instances plugged. 2011-03-02 14:08:22 +00:00
Goober5000 e765702121 use subsystem_stricmp where appropriate 2011-02-28 08:27:52 +00:00
Echelon9 444c6b293b Update SVN ignore keyword so we don't get documentation output in SVN 2011-02-26 01:18:16 +00:00
Echelon9 d52f90c076 First version of our Documentation system, using automated Doxygen source code comments 2011-02-26 01:15:51 +00:00
Echelon9 2c8dc2722d Effective STL: Use Container.empty() instead of Container.size() == 0 in if() statements 2011-02-25 14:38:28 +00:00
Goober5000 b0dcbfbc56 change the subsystem warning to an nprintf, since it's a pretty benign notification and sexps don't notify you anyway 2011-02-23 05:09:24 +00:00
Echelon9 d549d06728 DOC: Further instructions on initialisation of the pseudo random number generator 2011-02-22 12:05:31 +00:00
Echelon9 634dcc7e23 Accompanying changes to aicode.cpp following staticrand.cpp 2011-02-21 14:15:34 +00:00
Echelon9 80d622f56f A couple of other small changes to staticrand.cpp|h to address readability 2011-02-21 14:13:23 +00:00
Echelon9 1c687e4b4e Initial testing of something very exciting for the coders... 2011-02-21 12:50:16 +00:00
Goober5000 750df36303 add slash and backslash 2011-02-19 04:51:02 +00:00
karajorma 92be430fdb Add the Num-Valid-Arguments SEXP. 2011-02-15 08:18:58 +00:00
Goober5000 315bd423dc rename subsystem type fields so as to better distinguish them
some consistency checks
add "no aggregate" flag to exclude a subsystem from aggregate hitpoint calculations
2011-02-14 08:33:23 +00:00
The_E 9f9a294e9d More lua stuff from m!m 2011-02-13 19:45:12 +00:00
Sushi 5a9202910f Fix a bug with friendly shield manage/cm usage 2011-02-12 17:02:23 +00:00
Goober5000 dbd13bba38 activate the OF_IMMOBILE flag, and clean up the obj_move_all loop slightly 2011-02-12 05:00:13 +00:00
Goober5000 a5cd0f8de0 gaaaah, fix a whole bunch of bugs with the no-ets flag:
checkbox ui settings were incorrect
checkbox wasn't hooked into the event loop
resource #define's overlapped
FRED never saved the ship flag
ship flag did not have an equivalent parse flag
sexp(s) to modify ship flag did not use the existing ship flag sexp architecture
2011-02-07 09:08:39 +00:00
Goober5000 9b0b26b643 fixed compilation error 2011-02-06 08:18:26 +00:00
The_E 13ade13402 More fixes for Mantis 2372. Should now allow longer descriptions. 2011-02-05 09:18:04 +00:00
The_E fe51ef9df0 Minor whoopsie. This shouldn't have been committed just yet. 2011-02-05 08:59:26 +00:00
The_E ebab2d44ff Adding patch for Mantis 2385. This adds a "+sub_name" option to the animation code, which comes after/replaces "+sub_type" for a few triggers, such as the "weapon fired" trigger. 2011-02-04 17:18:39 +00:00
The_E e36d312d73 Adding a bit of verification here to catch a very strange bug 2011-02-04 17:12:48 +00:00
The_E 0b9429b9ea Adding a few error messages 2011-02-04 17:02:49 +00:00
Echelon9 9ec0215ad8 Remove last references to the redundant Intel_anim_filenames array 2011-02-04 15:31:44 +00:00
Zacam 720ad2127a Nukes Particle Code update (for more particle types)
http://www.hard-light.net/forums/index.php?topic=74165.0
2011-02-04 14:10:59 +00:00
Zacam bed42975da Karajorma's "Clean up" code. (Not for credit, but because I'm trying to reduce the "open" number of "Code Reviews" so that we don't get too backlogged with them)
http://www.hard-light.net/forums/index.php?topic=74066.0
2011-02-03 07:41:16 +00:00
FUBAR-BDHR c0df5578c8 Add node-targeted sexp 2011-02-02 06:26:21 +00:00
Goober5000 f570348ee2 --the behavior of cargo index -1 (which can only happen for capships) and cargo index 0 is substantially the same, so let's standardize on index 0... this prevents crazy stuff happening with bitwise operators on negative numbers :-/
--also, remove the restriction on capship cargo where ships must have the "scannable" flag
--because of the above constraints, "nothing" cannot be a meaningful subsys cargo, but then again, scanning a subsystem with "nothing" didn't do anything in the old code, so this doesn't change anything
2011-01-31 10:04:37 +00:00
Goober5000 c77551181c fix for Mantis #2390
errors in handling the CARGO_NO_DEPLETE flag for ship subsystems
2011-01-31 09:18:21 +00:00
Goober5000 9df7a37f3f fix some errors with sexp numbering that free up 2 Change slots
merge the Nav operators into other categories
add the new Change2 category and set up hacks so that its operators will display in Change's menu
2011-01-30 09:17:15 +00:00
Goober5000 eae11de29b commit the "immobile" flag, requested by Black Wolf, Diaspora, etc. This is just the infrastructure; the flag doesn't actually do anything yet. 2011-01-30 08:19:17 +00:00
Goober5000 e68c34eb90 fix ship flag dlg layout, which got messed up in The E's commit 2011-01-30 08:12:42 +00:00
Goober5000 32c70d3f96 someone made a bug here! 2011-01-30 07:55:05 +00:00
Goober5000 3a9ed93730 fix compilation 2011-01-30 07:07:33 +00:00
Zacam 398523e3cc It would have been NICE if Tortoise had actually _deleted_ the files when it asked if I wanted them removed. Stupid !@$^*&# Tortoise. 2011-01-30 06:09:42 +00:00
Zacam 9254dae233 Resolves LNK4221 under MSVC. multi_oo and psnet are not actually linked/used, so references pointing to them now go to multi_obj and psnet2 respectively. (Same as Antipodes 6881)
http://www.hard-light.net/forums/index.php?topic=73147.0
2011-01-30 05:59:36 +00:00
Zacam 4517320ffd Microsoft Visual Studio 6/2005/2008/2010 project updates to use newer libjpeg code committed on 6980. 2011-01-30 01:40:18 +00:00
Echelon9 fb8910635e Update libjpeg in source to v8c (16-Jan-11) from 6b (27-Mar-98). For more details see http://www.hard-light.net/forums/index.php?topic=74110.0 2011-01-30 01:33:52 +00:00
Goober5000 d03d5b95e7 this should fix the weird crashes in localization 2011-01-29 09:41:13 +00:00
IssMneur a468eeb878 Allow a primary or secondary weapon shot be substituted with any other weapon in any arbitrary pattern.
http://www.hard-light.net/wiki/index.php/Weapons.tbl#.24Substitute:
2011-01-27 05:35:13 +00:00
Echelon9 f9fd5807d8 Resolve circa 800 warnings that occur on Xcode due to symbol visibility scoping issue. 2011-01-26 11:30:56 +00:00
Echelon9 4be2c7e94d Small fix: Correct the spelling of a NavPoint function 2011-01-25 14:37:43 +00:00
Echelon9 04fe584c87 Chase down radardradis.h from the same location in Xcode 2011-01-25 13:10:37 +00:00
Echelon9 55c3409cf8 What's radardradis.cpp doing in that spot of the Xcode project file? 2011-01-25 13:05:58 +00:00
Echelon9 b1be9e56e0 We don't need a specific Copy Bundle Resources stage to put the Info.plist file in the Mac .app bundle, as well as setting the INFOPLIST_FILE setting. Using Copy Bundle Resources doesn't use the C preprocessor and then puts the file in the wrong location anyway. 2011-01-25 13:03:00 +00:00
Echelon9 89102e2c31 shipfx_large_blowup_init() function can have the void return type, as the caller never checks. 2011-01-25 12:25:59 +00:00
Zacam df749e6d45 A tiny over-sight. Now incorrect values on "hud_speed_multiplier" will actually report as such. 2011-01-25 07:51:02 +00:00
The_E 4a414205a3 Fix for Mantis 2372 (+Description field in Ships.tbl is being ignored) 2011-01-23 21:20:04 +00:00
The_E 824dd0cae8 Fix for Mantis 2380 (Setting target subsystem through scripting doesn't work) 2011-01-23 17:10:53 +00:00
The_E 34b7cbe0b7 Resolves a few signed/unsigned warnings 2011-01-23 17:06:58 +00:00
The_E 76e7f656d1 Adds "no ets" ships.tbl flag. 2011-01-23 16:03:04 +00:00
Echelon9 7d7ca9eb15 Fix: warning C6246: Local declaration of 'i' hides declaration of the same name in outer scope. 2011-01-23 12:47:08 +00:00
Echelon9 e09dea7a79 Revert this change to size_t; will require the wholesale update of the weapon code indices at the same time 2011-01-23 12:30:06 +00:00
FUBAR-BDHR 9f29b454b5 Fix for FRED not compiling with new nebula lightning from r6958 2011-01-23 06:56:01 +00:00
FUBAR-BDHR 41b1476b23 Fix bug in sexp_ship_set_damage_type() 2011-01-22 06:52:43 +00:00
Echelon9 a8db22bc65 Refactored nebula lightning & removed limits on Lightning.tbl 2011-01-22 05:35:43 +00:00
Sushi b38fa48e7e Add "starts locked" subsystem flag (that turret starts out locked by default and needs to be turret-freed before it will fire) 2011-01-22 00:44:44 +00:00
Goober5000 110cd3bccc add turret-protect-ship and turret-unprotect-ship 2011-01-21 08:55:26 +00:00
Goober5000 ab8808e35a get-object-speed-* are status sexps, not change sexps! 2011-01-21 08:49:54 +00:00
IssMneur efff8a5d83 get-object-speed-{x,y,z} added. 2011-01-21 06:28:37 +00:00
Swifty 6e52dbd299 Resolved some issues involving the Ping Indicator not displaying. 2011-01-19 09:21:22 +00:00
karajorma b742eac806 LuaPineapple's fix for Mantis 2322.
Some comment clean up.
2011-01-19 08:24:26 +00:00
The_E b4db3b3ecf FUBAR's damage type sexps. Tested ad nauseum by BP. 2011-01-18 16:21:36 +00:00
Goober5000 34fd0c53ad make subsystem-vanish consistent with ship-vanish
clarify sexp help and fix name (using deprecation, so that old missions will still work)
2011-01-16 08:20:08 +00:00
Goober5000 42fc6e461c add if-then-else and perform-actions 2011-01-16 08:18:09 +00:00
Echelon9 6c4bed411e Fix Mantis 2379: Last available nebula storm type in Lightning.tbl wouldn't be used in game 2011-01-15 03:54:50 +00:00
Echelon9 400331d4ec Cleanup cmeasure.*: Remove dead code, use size_t as for loop array index not a signed int 2011-01-15 03:05:01 +00:00
Echelon9 822110405a Prevent potential overflow of Escort_ships[] array 2011-01-15 02:33:34 +00:00
Sushi 95a713128c Add "hide from radar" weapon flag to force bombs not to show up on radar 2011-01-12 16:51:38 +00:00
Goober5000 eafc0ca82e fix a return value error
also, cut down on the number of warning messages shown for background bitmap loading
2011-01-12 10:03:45 +00:00
Goober5000 230da289d2 change xor (but not bitwise-xor) to use any number of arguments, not just 2
enhance string-to-int to ignore non-numeric characters (so turret07 becomes 7)
2011-01-12 02:10:22 +00:00
Goober5000 330fee1b3b commit string-concatenate and int-to-string 2011-01-12 01:37:03 +00:00
Swifty 98b65e2dba Eliminated pesky bug involving some gauges not being properly updated with necessary HUD config data. Took a while to figure out. 2011-01-11 07:58:03 +00:00
Goober5000 0cc190e9f1 stupid brain fart
fix Mantis #2375
2011-01-11 01:03:48 +00:00
The_E ebff760cca There is no function with the signature "double pow(int, int)" in math.h 2011-01-10 16:10:54 +00:00
Goober5000 8370567747 remove for-each-of
add a note regarding string-to-int to for-counter
supernova-start takes a positive argument
2011-01-10 11:55:15 +00:00
Goober5000 2f0324048b Added the following sexps:
pow (power function)
xor (logical operator)
set-bit, unset-bit, is-bit-set (for working with individual bits in integers)
bitwise-and, bitwise-or, bitwise-not, bitwise-xor
2011-01-10 11:29:24 +00:00
FUBAR-BDHR 55de86a47d Add the ability to define detail distances for weapons. 2011-01-09 22:35:02 +00:00
FUBAR-BDHR c07f1a1c1d Fix for Mantis 2368. Subsystems with vanish flag still play sound from player ship 2011-01-07 22:01:36 +00:00
Goober5000 ea4cc1e870 the repeated messages get really annoying, so log them and display one message 2011-01-07 10:16:10 +00:00
Goober5000 66c82d58c1 added two awesome sexps, for-each-of and for-counter
as part of the sexp infrastructure, add test_argument_vector_for_condition so that argument sources are not limited to sexp nodes
2011-01-07 09:11:02 +00:00
chief1983 5ffb61b26c Fix for #2365: Assert to Assertion so we can tell the user a little more about the crash. 2011-01-06 05:07:51 +00:00
Swifty 4a9e605e56 Support for PNG/JPG/TGA based EFFs for the HUD and other graphics that previously required ANI/PCX. 2011-01-05 08:54:14 +00:00
Zacam 5b9ceff06a GLSL version Detection fix.
http://www.hard-light.net/forums/index.php?topic=73712.0
2011-01-05 07:12:48 +00:00
FUBAR-BDHR 1529f948f2 Add flag that applies damage to subsystem as if it were the hull. 2011-01-05 00:12:01 +00:00
Goober5000 0ee79b269f resolve a conversion warning pointed out by FUBAR 2011-01-02 00:35:05 +00:00
Goober5000 08e86d0192 re-add Echelon9's commit, with proper logging, and also with parallel fix to bmpman.cpp 2011-01-01 09:17:36 +00:00
Sushi 65f7c760d8 Add "$ai aims from ship center:" and "$allow primary link delay:" AI profiles flags 2010-12-31 20:03:16 +00:00
Goober5000 6d4b0efd39 add sexps for object orientation 2010-12-31 07:41:01 +00:00
Goober5000 4f7f79732e missed one file 2010-12-31 04:28:37 +00:00
Goober5000 d57ab51162 change fl_radian to fl_radians so as to be consistent 2010-12-31 04:02:41 +00:00
chief1983 34d11f1295 Fix the DirectInput commit r6902 breaking compiling on nix 2010-12-29 18:18:44 +00:00
Echelon9 337786ef26 Remove from Xcode project file two non-existant source code files 2010-12-29 07:45:10 +00:00
Zacam 5ae8d90656 Thanks to Goober5000, this is the correct way to be doing this. 2010-12-28 04:49:05 +00:00
Zacam 802d5956f3 Fixes the index so that Player Main Hall changes will actually save properly. Should have caught this back in 6860. 2010-12-27 20:59:16 +00:00
Sushi 9a71e9b080 Add -disable_di_mouse command-line option to force the game to use Windows mouse input instead of DirectInput. For some people, this results in more reliable mouse input. 2010-12-27 16:17:54 +00:00
Zacam 900fd755b1 Fixes reports of Retail data showing "0 ms" for ships Velocity in Ship Selection Screen. When multiplying an INT by a FLOAT, setting the fl2i() on the float is a good idea. 2010-12-27 15:27:48 +00:00
Swifty aa71f4a817 Clear the active display list when this ship is beleeted. 2010-12-27 09:28:17 +00:00
Echelon9 0da3dff1c1 Fix a small typo in Diaspora feature's comment 2010-12-27 08:26:04 +00:00
Echelon9 0557c1e4cd Correct 2 comment typos 2010-12-27 08:18:39 +00:00
Echelon9 9410909ee1 Fix: Mantis 2351 - Animated subsystems not counted as rotating allowing max to be exceeded 2010-12-27 08:00:31 +00:00
Echelon9 db1e2a891e This check can go back in, the real cause was fixed in r6893. Good work Assert() 2010-12-27 07:48:31 +00:00
Swifty 0c67dd9abc Get Lua ray tests to use model_instances for collision detection. Fixes the failed assertion associated with this. 2010-12-27 07:36:49 +00:00
Echelon9 7fa59778c5 Fix a comment typo 2010-12-27 06:47:03 +00:00
Swifty a5be8facf6 Limit the setup of cockpit displays to only the player ship. 2010-12-27 05:52:33 +00:00
Swifty 4d3bf36f48 Fixes the weapons list gauge bug where a blank space would render when no secondaries are loaded. 2010-12-27 05:43:52 +00:00
Zacam fdd529621a Revert 6884. Not a good thing to do apparently. 2010-12-26 19:46:00 +00:00
The_E 38d2da68a3 Fix for Mantis 2350 (Sound assignments get lost/become bogus when changing ship class) 2010-12-25 15:15:28 +00:00
Zacam f98be5dcde Fix: MSVC signed/unsigned mismatch. 2010-12-25 13:15:55 +00:00
FUBAR-BDHR c3550e55dc Fix for mantis 2356: Turret-free-all in an every-time acts as turret-lock-all
Fixed turret-free, beam-free-all, and beam-free as well
Removed generic subsystem argument from those as well as turret-tagged-specific as they do not have code to process it.
2010-12-22 18:39:40 +00:00
The_E 083a84feff Swifty's go-swift stuff. Makes collision detection slightly less insane. 2010-12-22 14:42:21 +00:00
The_E 1f1640d47d 2010-12-20 19:53:52 +00:00
Sushi c7eac88eec Fix oversight from AI.tbl overhaul a while ago 2010-12-20 16:57:13 +00:00
Echelon9 08eeeedff3 A further two spots where the MSVC 2008 compiler doesn't like SAFE_STRINGS changes 2010-12-20 07:50:23 +00:00
Echelon9 cd7da4d94e Mantis 1889: Utilise all three hud target box rendering styles (inclusion of a rendering style with proper lighting) 2010-12-20 07:46:38 +00:00
Echelon9 f3359d1547 MSVC compiler doesn't like some of these SAFE_STRINGS changes, GCC does... 2010-12-20 06:14:08 +00:00
Echelon9 eb129200a1 Fix: Convert a further subset of strcpy() to the SAFE_STRINGS strcpy_s() version 2010-12-20 04:28:01 +00:00
Echelon9 7b9d36e105 Guarding against array out of bounds error, ahead of conversion to STL type 2010-12-20 03:04:54 +00:00
Echelon9 10dd0c57d5 Clean up redundant checks 2010-12-19 02:03:41 +00:00
Echelon9 25b199c25c Two further cases of typo referenced in r6861 fixed 2010-12-19 01:28:38 +00:00
Echelon9 1a98990c3c Remove redundant Invalid_demo_keys[] and associated control_config_valid_action() 2010-12-19 01:24:50 +00:00
Echelon9 78496b1953 Remove redundant #ifdef check 2010-12-19 01:09:38 +00:00
Echelon9 f278ca0e85 Correct typo in comments 2010-12-19 01:06:58 +00:00
Echelon9 b19fc28a7e Fix: Local declaration of 'i' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '786' 2010-12-15 12:51:51 +00:00
Echelon9 91fbebd307 Fix: Local declaration of 'i' hides declaration of the same name in outer scope. 2010-12-15 12:48:24 +00:00
Echelon9 178963e78a Clear out commented #IFDEF INTERPLAYQA section 2010-12-15 12:39:11 +00:00
Echelon9 bacb819e5f Fix: Local declaration of 'retail_gauge_loaded' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '392' 2010-12-15 12:27:14 +00:00
Goober5000 2e7dea0018 set certain flags that used to be in ship_info via ship_set and change_ship_type, which is the correct thing to do, rather than in the middle of parsing, which was a red herring
(fixes Mantis #2169)
2010-12-13 07:33:35 +00:00
Goober5000 c8dd5e1bab bypass weird compiler error 2010-12-13 07:24:38 +00:00
Zacam 81bf3cec47 Reverts commits 6681, 6683 and 6684. Adds C4101 Warning suppression for Release Builds (only) so that "catch" doesn't cause an unreferenced parameter warning. 2010-12-13 05:51:49 +00:00
The_E 0b292a1652 Fix for Mantis 2349 (Invalid number of arguments not detected by FRED). This adds a new function to sexp.cpp (check_operator_argument_count()), which can be used to handle cases like send-message-list.
Also adds a warning to change-iff-color in case the FREDer supplied an invalid rgb argument (Mantis 2256)
2010-12-13 04:10:08 +00:00
Zacam 09fad95070 Antipodes 7 Merge: HUD Overhaul, by Swifty. 2010-12-12 20:34:15 +00:00
Echelon9 b1c2a85faa Fix: Local declaration of 'template_id' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '1062' 2010-12-12 01:09:02 +00:00
Echelon9 06d24df914 Clean up up logic check on packet length overrun 2010-12-12 01:08:10 +00:00
Echelon9 6c50ba90ba Fix: Local declaration of 'wip' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '5444' 2010-12-12 01:07:03 +00:00
Echelon9 ebc0d3b6f4 Fix: Local declaration of 'rship' hides declaration of the same name in outer scope. For additional information, see previous declaration at line '6450' 2010-12-11 13:49:06 +00:00
Echelon9 d0e05d5417 Fix: Buffer overrun: accessing 'struct NavPoint * Navs', the writable size is '352' bytes, but '396' bytes might be written: Lines: 1597, 1600 2010-12-11 12:54:02 +00:00
The_E 214e0daf00 Fix for Mantis 1647 (Message brackets linger around when player turns traitor) 2010-12-11 06:03:45 +00:00
Goober5000 257f92441f use standard font to output the "more" indicator 2010-12-10 08:39:21 +00:00
FUBAR-BDHR 17776c091e Fix for mantis 0002337: lock-rotating-subsystem affects more than it should 2010-12-09 23:30:04 +00:00
The_E e38b68bee5 Partial fix for Mantis 2277. This moves the "Turret Firing" animation trigger so that it only triggers when the turret really is firing. 2010-12-09 23:13:46 +00:00
The_E 5db4e2a6b3 Fix for Mantis 2306 (Destroy subsystem cheat does not work in release builds) 2010-12-09 20:28:16 +00:00
The_E bf578e51ef Genghis' fix for Mantis 2164 (Better feedback and error handling for invalid muzzleflash definitions) 2010-12-09 19:55:46 +00:00
The_E 254cd2f2d2 Aaaand done. Now it's fixed. 2010-12-09 18:54:28 +00:00
The_E dc91321cba Fix for Mantis 2111 (Bank indicator alignment issues in weapon loadout select screen) 2010-12-09 18:07:44 +00:00
The_E 649f1ff6c3 Fix for Mantis 2055 (Allow/break/never/fix-warp sexps don't work on the AI) 2010-12-09 16:24:54 +00:00
The_E 82efd3434b Fixes issue with "external model launcher" flag, where secondary weapons would use the models for primary weapons noticed y Droid803 2010-12-08 20:08:25 +00:00
The_E 109f962350 What in the nine hells is happening here? Did noone ever use set-armor-type to reset an armor type? 2010-12-08 04:25:14 +00:00
The_E 8f1f95c273 Fix for Mantis 2257. This adds the options "+HUD Message:" (Boolean, whether or not firing this SSM generates a notification on the HUD), and "+Custom Message:" (if you want to use something other than "Firing Artillery!") to ssm.tbl. 2010-12-07 16:33:58 +00:00
Goober5000 32dd5f9306 follow-up to 6804... fix secondary as well as primary 2010-12-07 07:57:00 +00:00
FUBAR-BDHR ce8024ce15 Oops on the use of /n instead of \n. Good catch IssMneur 2010-12-07 06:31:53 +00:00
The_E 5dcdc79c4e Fix for Mantis 2336 (Countermeasure type assignment doesn't survive ship class change) 2010-12-06 23:27:46 +00:00
FUBAR-BDHR a79d51b357 Fix backward LOD warning message. 2010-12-06 22:00:14 +00:00
The_E 0b4fb309ae Turning this assert to an Error, after feedback from Goober 2010-12-05 18:07:28 +00:00
The_E 4925eb8412 Turning these Warnings into Assertions, as it's something that really needs to be fixed. 2010-12-03 23:27:58 +00:00
The_E 3f21f1fe5e Converting this Assert() to an Assertion() for better feedback 2010-12-03 22:41:44 +00:00
The_E 60ac096301 Taylor's fix for Mantis 2172 2010-12-03 17:44:23 +00:00
Sushi 1389b67bd4 Fix an additive weapon velocity bug (main symptom: collision detection going wonky sometimes). 2010-12-03 15:37:44 +00:00
The_E 9441cc7eef Okay, I'm disabling this Int3(). It's far too easy to hit, even with perfectly valid data. 2010-12-02 21:06:32 +00:00
Echelon9 b8f3fe13bc Fix 2339: Intermittent crashes in add_sexps 2010-11-29 10:28:47 +00:00
Goober5000 e20b95bba4 add_data_dup when we're working with a temporary string 2010-11-29 08:36:31 +00:00
The_E c52d8a4763 Adding a break here 2010-11-27 08:13:53 +00:00
Goober5000 2afc961a62 bump number of misc anims to 32 2010-11-26 04:03:56 +00:00
Goober5000 4faa94a9e3 add feature to select a random animation from a miscellaneous animation group 2010-11-25 23:51:22 +00:00
The_E 04e252c1ea Thanks to Goober for noticing the right way to do this. 2010-11-25 20:48:07 +00:00
Goober5000 81607f7ddc move the error nprintf to a place where it will trigger before the crash it tests for
fix a loop boundary check
2010-11-25 20:10:13 +00:00
The_E 8726f7e0fb Fix for Mantis 2344 (Post-processing sexps don't show correctly in FRED) 2010-11-25 18:48:00 +00:00
The_E 507631cf86 Moving post processing flag back to graphics section 2010-11-25 15:11:04 +00:00
The_E e978adbbdf Adding a return and Warning in case of a null pointer here 2010-11-24 11:35:21 +00:00
Goober5000 04c5416de9 add error detection for arrays that exceed maximum
num door sounds = num door animations
(how did that ever work before?)
2010-11-24 07:18:05 +00:00
Goober5000 5214560f70 how was that accidentally deleted? 2010-11-24 06:39:22 +00:00
Goober5000 2eda13c3e8 remove #defines that were obsolete since after FS1
fix an nprintf bug
change the method of pausing anims so that more than one anim can play in the same spot
(this means that the first frame of an anim won't be drawn until the anim actually starts playing but I think that's okay; it is really only noticeable for the crane animation in the Bastion main hall when the "new player tips" box appears)
2010-11-24 06:33:53 +00:00
Goober5000 d069b8ede7 ugh; formatting ftw 2010-11-24 04:53:41 +00:00
Goober5000 b3db43f54c slight cleanup 2010-11-24 04:35:10 +00:00
FUBAR-BDHR 31853b77de Fix issue with beams not doing damage due to the traitor beam fix. 2010-11-24 02:22:46 +00:00
Goober5000 0c945c210d revert Echelon9's commit 6754 which needs to be discussed first 2010-11-23 08:27:18 +00:00
The_E f02e83320d Fix two instances where an object instance number was used as an index into Weapon_info[] 2010-11-23 08:20:56 +00:00
Goober5000 2b01993d64 corrected Echelon9's correction of Zacam's ... correction?
Anyway, sexp variables are only ints or strings, not floats. Therefore we need to print them to the file correctly.
2010-11-23 08:11:16 +00:00
Goober5000 10d6e21c9d fix some things that Zacam noticed 2010-11-23 07:30:36 +00:00
chief1983 e7e1a07a4b Finish matching vm_mallocs and vm_frees 2010-11-22 17:21:12 +00:00
Echelon9 4ccc6ba9a0 MAGIC numbers aren't for hiding in code... 2010-11-22 13:01:41 +00:00
Echelon9 e4e5775b63 Fix: Local declaration of 'i' hides declaration of the same name in outer scope. 2010-11-22 12:51:59 +00:00
The_E 66596f519c Fix for commit 6756: -1 is a perfectly valid value for current_secondary_bank at that point. 2010-11-22 06:14:11 +00:00
FUBAR-BDHR e818f7840f Fix for Mantis 2190 - Player beams do not cause traitor. 2010-11-21 06:34:27 +00:00
Echelon9 8bc8deffd6 Fix: Local declaration of 'num_lines' hides declaration of the same name in outer scope. 2010-11-20 18:45:34 +00:00
Echelon9 8ba4f6c3c6 Corrected sprintf format, as 'Changed from 'int' to 'float' by Zacam 10/2010' 2010-11-20 17:27:45 +00:00
Echelon9 184b004e19 Fix: Use of swp->current_secondary_bank when equal to -1 as an array index. Very broken. 2010-11-20 16:25:33 +00:00
Echelon9 f96d7fc1be Fix: Invalid data: accessing 'Text_line_size', the readable size is '80' bytes, but '4194244' bytes might be read; Invalid data: accessing 'Text_lines', the readable size is '80' bytes, but '4194244' bytes might be read 2010-11-20 15:10:14 +00:00
Echelon9 5bf9697227 Fix a range of potential NULL dereferences 2010-11-20 12:22:03 +00:00
Echelon9 9f361b791d Fix a few malloc/vm_malloc changes to properly track memory usage; fix a potential NULL dereference in parse/lua.cpp 2010-11-20 08:25:16 +00:00
IssMneur 318d3f032b Back to how the no configure worked before, because it does work just IssMneur is a dummy. Thank you ni1s for pointing it out :P
Added a clarifying comment to autogen.sh.
2010-11-15 21:13:53 +00:00
IssMneur c898573e58 Modify autogen.sh so that it can be run without running configure. To run autogen.sh without running configure pass --noconfigure as first parameter. 2010-11-15 20:40:25 +00:00
Goober5000 b7acaf9177 remove the mprintf per discussion with taylor 2010-11-14 05:42:47 +00:00
Goober5000 8ba6a7035c add SCP_string variants of sprintf, sexp_replace_variable_names_with_values, replace_one, replace_all, and lcl_replace_stuff
change the death message to use an SCP_string
change the set-death-message sexp to accept actual messages
2010-11-14 02:07:45 +00:00
Goober5000 91fd779f86 add missing files to MSVC 2005 project 2010-11-14 01:53:21 +00:00
Goober5000 a1f6c70318 Bad IssMneur! No biscuit! 2010-11-13 22:49:22 +00:00
IssMneur 9ce801e175 Remove redundant weapon_name_lookup().
Make the parameter to weapon_info_lookup a const char* (like it should be).
2010-11-13 07:27:45 +00:00
FUBAR-BDHR f7f6e0e94b Fix for mantis 2174: ERANGE: String error in multiui.cpp 2010-11-12 23:46:24 +00:00
The_E 52529f597a Reverting that again to help tr5ack this down further 2010-11-11 09:54:18 +00:00
The_E 142649e968 Adding proper FRED-side support for special message source "<none>" 2010-11-11 08:45:25 +00:00
The_E 09f9dca972 Replacing a few asserts with proper error handling (in this case, simply CLAMPing the offending values to valid ranges). 2010-11-11 08:41:34 +00:00
The_E 1b00dda9dd Fix for Mantis 2333 (Random crashes caused by snd_get_duration()) 2010-11-08 23:04:34 +00:00
The_E 60eda39ca7 Adding a few checks here to guard/catch Mantis 2333 2010-11-08 01:36:43 +00:00
The_E 727da9031c Fix for Mantis 2329 (Malloc fail on invalid sound files) 2010-11-06 04:44:17 +00:00
The_E 371307eb1f Woops. This fixes screwed up test for MOI validity 2010-11-05 00:34:29 +00:00
FUBAR-BDHR 367ff95e79 Remove sexp_turret_subsystem_targeting_disable() and sexp_turret_subsystem_targeting_enable() and changes them to use the new generic function. 2010-11-04 05:28:39 +00:00
FUBAR-BDHR 09e6972731 4 new sexps to control Wanderer's subsystem flags from r6581
Fix for Mantis 2330 subsystem targetable/untargetable in multi.
2010-11-04 05:17:52 +00:00
chief1983 7192a2d8fe More compatibility fixes for Solaris 2010-11-02 21:20:09 +00:00
The_E afcf923c43 Remove bogus debug warning from the :V: days 2010-11-01 15:25:27 +00:00
The_E d5b15a0567 Adding check for invalid MOI values 2010-11-01 15:24:07 +00:00
chief1983 4ccadf51fe This should fix a OS X 10.5 crash, possibly others. 2010-10-29 19:09:26 +00:00
The_E c4fe142f3a Woops. How did I screw this up? 2010-10-29 04:14:13 +00:00
The_E 7c58abb9eb Fix for faulty check 2010-10-29 02:44:14 +00:00
The_E 09343bfa46 Adding a warning and proper error handling to the "/" operator in order to catch div-by-zero scenarios. 2010-10-29 02:22:51 +00:00
The_E 5f5cea2c6a Patch for minor snafu, from FUBAR 2010-10-29 01:10:19 +00:00
The_E 7fada6171a 2010-10-26 23:42:14 +00:00
The_E e11fe6515a Changing this sanity check to pop up a warning in FRED, but print to log in FS. 2010-10-26 22:56:58 +00:00
The_E 339ba7cca3 Fixes issue with the wrong mainhall being loaded on startup. Note: If a value gets initialized to -1, don't change it to a ubyte and init it to 0, even if that fixes a conversion warning. In this case, casting explicitly is a valid course of action, and should be taken. Here endeth the lesson on refactoring. 2010-10-26 22:23:56 +00:00
The_E 4e2fb80608 Removing lua.c from the VS2010 project 2010-10-25 15:09:17 +00:00
chief1983 416e725e22 Let's get rid of lua.c for Xcode then too 2010-10-25 14:57:53 +00:00
karajorma f5ff35c3bf Looks like we forgot to update the save functions when we changed the special_explosion to use floats. 2010-10-25 13:53:31 +00:00
Zacam c45f22ff98 ...and then it helps to actually initialize it to something. 2010-10-25 03:59:15 +00:00
Zacam 252f2b4e6c Should have paid more attention on that last one, need to define what 'err' is outside of where it is. 2010-10-25 03:54:48 +00:00
Zacam 3e613ff431 Let see how unreachable all this really was. 2010-10-25 03:48:01 +00:00
Zacam b64d1991e1 Fix for Release Build warning for 'err' 2010-10-25 03:43:02 +00:00
Zacam 984df3b5ec 'lua.c' not needed for liblua. 2010-10-25 03:34:33 +00:00
Zacam 0050b48e80 Clears up the rest of the type conversion warnings listed in MSVC. 2010-10-25 03:26:03 +00:00
Zacam a58a8b21af Warnings Resolutions: 'int' to 'ubyte' conversion warnings.
Some formatting cleanup done on the affected files.
While not necessary, some {} put in by suggestion of output from GCC and to improve readability.
2010-10-25 00:03:29 +00:00
karajorma 284fd79740 Not 100% a bug fix but this will have the effect of making it harder to hit the bug and will warn when it hits it. See http://www.hard-light.net/forums/index.php?topic=72160.0 for more details 2010-10-24 05:28:30 +00:00
Wanderer 724c77afc2 adding blank scripting state to the game 2010-10-23 19:54:39 +00:00
The_E c885611291 Adding special message source "<none>" 2010-10-22 23:17:44 +00:00
Echelon9 a8d31d4ae4 Update project file listing 2010-10-22 22:53:48 +00:00
The_E 89ae5cf458 m!m's function to access the "affected by gravity" flag 2010-10-22 20:43:27 +00:00
The_E 26ac4b804a Fix for Mantis 2171 (documentation out of sync for gr.getVectorFromCoords) 2010-10-22 13:45:33 +00:00
The_E 332f94886b Thank you code analysis. This could have been ugly.... 2010-10-20 20:06:55 +00:00
The_E 0f38bee49b Change an Assert to a more elegant way of handling this. 2010-10-20 19:38:34 +00:00
Sushi c9b6c3a4ee Fix bug where changing AI goals while gliding can cause them to get stuck in glide 2010-10-20 05:21:51 +00:00
chief1983 d731767ea6 Wrong way with this fix, should have gone from trunk to antipodes 2010-10-19 22:16:26 +00:00
chief1983 1d9c341c07 Use appropriate line endings 2010-10-19 22:14:52 +00:00
Zacam 6e46c4668d From FUBAR: Turret ROF Sexp
http://www.hard-light.net/forums/index.php?topic=71884.0
2010-10-18 21:23:16 +00:00
chief1983 b0bd068e4d Pedantically correct a comment 2010-10-18 21:18:10 +00:00
Zacam 2b44f6325b The hell...? Missed one somehow. 2010-10-18 20:55:08 +00:00
The_E 2349ec5695 Warnings done properly. Thanks, chief 2010-10-18 20:17:01 +00:00
The_E 770953a051 This case shouldn't ever be hit, but it's still bad form to Int3() there. 2010-10-18 19:57:12 +00:00
Zacam 59a360a139 Sun OS compatibility: "Sun" is a reserved word, so (*sun) becomes (*sun_ptr), (bool sun) becomes (bool is_a_sun), etc.
Also: void stars_delete_instance_FRED is now void stars_delete_entry_FRED in the CPP to better match the H.
White-space clean-up took place too.
2010-10-18 19:29:38 +00:00
Zacam 75043ff5b1 go_faster from Antipodes 6. Everybody, say "Thank you, taylor!" 2010-10-18 18:32:37 +00:00
chief1983 0cbb97861b FORCE:MULTIPLE for VC6 in advance of Antipodes 6 2010-10-18 18:08:52 +00:00
chief1983 d0e20484ee FORCE:MULTIPLE for VS2005 in advance of Antipodes 6 2010-10-18 18:03:10 +00:00
IssMneur 253a4b4dc9 Reimplement VerifyEx to soothe any concerns about the WinAssert use and remove any potential problems for non-VC. 2010-10-18 06:33:54 +00:00
IssMneur 3292e4eee4 Extended Verify to allow a developer to give a more detailed message. 2010-10-17 22:27:04 +00:00
Goober5000 b8736c0c0b sanity check +Team: values, because older versions of FRED saved crazy values like 1301728 2010-10-17 20:12:09 +00:00
karajorma f5065880dd Fix the camera-shudder SEXP to work in multiplayer. 2010-10-17 09:33:08 +00:00
karajorma ffd9b2cdac Add the -parse_cmdline_only option to prevent the command line being parsed in FRED (and FSO for that matter). 2010-10-16 05:17:46 +00:00
The_E b352e39494 m!m's team:getColor() function for scripting. 2010-10-15 19:45:02 +00:00
IssMneur 85c4032ef7 Added a couple of mprintf lines to help diagnose where exactly Openal fails to load. 2010-10-15 17:20:50 +00:00
IssMneur 1482cac08b Fix a crash that occurs when the player turns off auto-targeting. 2010-10-15 16:39:43 +00:00
chief1983 1f61ee9025 Add the FORCE:MULTIPLE option to the linker for VS2008 and VS2010, in advance of the Antipodes 6 merge 2010-10-13 16:47:12 +00:00
karajorma baf028bdb7 Mantis 2324 (Missiontime-msecs gives the wrong value after SHORT_MAX milliseconds) 2010-10-13 06:18:36 +00:00
karajorma 9bcf6d9521 Change Alt_Type into an int to fix a compiler warning.
Move the multi_sexp_ship_change_callsign function (Multi_ functions should sit directly below the server side function that calls them so that they can be updated at the same time).
2010-10-13 02:16:34 +00:00
Zacam 7d8fae55f0 Output name updated to "fred2_open_3_6_13" in MSVC2005. 2010-10-12 23:40:48 +00:00
Zacam 52b5f2fbb1 Project Synchronization: Trunk vs Antipodes
2005: Set PDB and Map Exports to explicitly FALSE on Release builds.
Removed <File Configuration> lines (save for in the case of phrases.xml) as they are unnecessary bloat.
2008: Set PDB and Map Exports to explicitly FALSE on Release builds.
2010-10-12 22:37:50 +00:00
chief1983 d4bfce509e Pull this fix for VC6 from Antipodes since it's unrelated to go_faster 2010-10-12 16:06:27 +00:00
IssMneur 39e516af3f Add some variable verification to hud_cease_subsystem_targeting. 2010-10-12 04:27:17 +00:00
Zacam 93c819e215 Warning Fix: in "opengl_make_gamma_ramp"
'int' to 'ushort' conversion addressed.
2010-10-08 23:32:54 +00:00
Zacam 53a78a859b Warning Fix: (audiostr.cpp "WaveFile::Read" / ds.cpp "ds_load_buffer")
Sets 'float **pcm' to start as NULL
2010-10-08 23:30:15 +00:00
Zacam 55cb3c209a Warning Fix: in "bool message_filename_is_generic"
signed/unsigned mismatch
2010-10-08 23:24:36 +00:00
Wanderer 57a2f2955c feature commit - diaspora subsystem options 2010-10-08 21:32:48 +00:00
Wanderer caae28adfa feature commit - diaspora turret related patch 2010-10-08 21:05:40 +00:00
The_E 4bb193a519 Patch for Mantis 1963 (Optional argument for set-object-facing and set-object-facing-object doesn't work) 2010-10-08 12:01:11 +00:00
The_E cf04d1b6de Fix for Mantis 1817 & 2323 (Glide does not get reset on mission restart/player respawn) 2010-10-08 10:15:40 +00:00
Zacam f14b184c81 Warning Fix: "sexp_show_subtitle_text"/"sexp_show_subtitle_image"
No more 'float' to 'int'. (not the best way, but it is expedient and doesn't risk breaking things)
2010-10-07 02:21:15 +00:00
Zacam 95a89874e8 Warning Fix: in "void beam_get_binfo"
"miss_factor" is a 'float', not an 'int'.
(some odd 'tab' spacing cleaned up in the function as well)
2010-10-06 20:03:05 +00:00
Zacam 76c4083cbd Warning Fix: for "set_special_explosion"
Corrects conversion of 'float' to 'int', by setting set_special_explosion related entries to 'float'
2010-10-06 19:18:38 +00:00
Zacam 7acab9ba98 Warning Fix: in "object *ship_find_repair_ship"
"min_time_till_available" is a 'float', not an 'int' and so is "howlong" that it is compared to.
2010-10-06 18:45:58 +00:00
karajorma 42fba98066 FUBAR's fix to allow the callsign SEXP to work properly in multiplayer. 2010-10-06 08:53:28 +00:00
Goober5000 2e4143013a fix some old fat-fingering from r1601 (Mantis #2226) 2010-10-06 03:58:21 +00:00
Wanderer 2200196cd5 fix to corkscrew missile emitted particles issue 2010-10-05 08:01:23 +00:00
karajorma 4bf6dc5201 Missed one. 2010-10-05 06:45:51 +00:00
karajorma 4e40f145db Some minor future-proofing/magic number removal. 2010-10-05 06:44:02 +00:00
karajorma 3a578fa70d Fix Mantis 2321 (Weird values for Team when saving events). 2010-10-05 06:08:31 +00:00
Zacam 8c4e0e9614 Double-Trouble: Noted by FUBAR, somebody made a copy-paste mistake 2010-10-04 23:14:27 +00:00
IssMneur 134abc8f09 Make VS2010 copy *every time* that it rebuilds the binaries, not just when a change is made to a file in Freespace2 or Fred2 projects (ie. when it inserts code changes from code.lib into the binary). 2010-10-04 04:27:55 +00:00
The_E b192612b57 More checking to guard against Mantis 2205 2010-10-03 20:35:48 +00:00
Echelon9 f54e6a1c86 Second case of mprintf fubar this week. MSVC thought this was valid? 2010-10-03 09:06:47 +00:00
Wanderer 4b26c34625 Feature commit - option to adjust turret ROF by multiplier or by the number of firepoints. 2010-10-03 07:19:43 +00:00
The_E 4ee64c07f1 Adding a better explanation here. 2010-10-03 03:45:01 +00:00
Echelon9 0968f851bf Correction to r6555 to use mprintf correctly 2010-10-02 07:06:17 +00:00
The_E 4512219c9f Adding the ad.stopMusic() function to scripting 2010-10-01 22:27:37 +00:00
The_E 2d062ff380 Print warning here as well. 2010-10-01 19:14:24 +00:00
The_E fe38a382f9 Adding a deprecation warning to the log 2010-10-01 19:09:17 +00:00
The_E 97634e590a Readding parsing for decals so we don't break stuff unnecessarily. 2010-10-01 18:12:31 +00:00
taylor ecc9c970fd allow duplicate when same file exists as both 2D and 3D in sounds.tbl 2010-10-01 16:42:06 +00:00
taylor a06e48966b easier to follow debug messages for sound loading 2010-10-01 16:42:05 +00:00
taylor f7d8b9ef26 only need half size for mono buffer memory 2010-10-01 16:42:04 +00:00
taylor 3b5f674ba6 remove decal files 2010-10-01 16:42:03 +00:00
The_E 6c059f30c4 Adding a sanity check here. 2010-10-01 07:53:03 +00:00
Sushi 6500943b41 Get rid of compiler warnings 2010-10-01 04:20:40 +00:00
Zacam db96e9fa26 Removed "grammar.h" and added to 'ignore' list. Also added phrases.cfg to 'ignore' list. 2010-10-01 04:10:03 +00:00
The_E e8aa478524 Another compilation warning fix. 2010-10-01 03:06:09 +00:00
The_E 05e68890f4 Fix compilation warning 2010-10-01 01:36:44 +00:00
The_E 044df34584 Adding the "force-glide" sexp by request of Axem 2010-10-01 00:38:58 +00:00
The_E 93b1740848 Fix for Mantis 2289 (Invalid commandline arguments passed to FRED) 2010-09-30 17:22:58 +00:00
Zacam b9b5237123 Purging of the Decal system. Includes Projects updates for codeblocks, MSVC 6-2010 and Xcode. 2010-09-30 05:50:04 +00:00
The_E c6fe7ad5a0 Bumping MAX_SPOOLED_MUSIC to 50. 2010-09-30 00:00:49 +00:00
The_E 4f6fcc566e Removing an Int3() that isn't as impossible to hit as expected. Since we can exit gracefully here, we should. 2010-09-29 19:01:04 +00:00
Wanderer 9a10b6b0b4 Fix for mantis 2304 - 2nd take 2010-09-27 11:55:21 +00:00
Goober5000 2d3f566691 use the warning loop, same as the other half of the if() block 2010-09-27 05:51:28 +00:00
Goober5000 46f48ee3a6 fix redefinition of local variable 'i'
remove unused local variable 'wip'
2010-09-27 05:27:27 +00:00
The_E 6fccf9f790 Ooops. Now this is a proper sanity check. 2010-09-27 04:46:08 +00:00
The_E f5d8a1354d Hopefully fixes an Int3() encountered by FUBAR, where the AI submode of a ship was set incorrectly. 2010-09-27 04:03:06 +00:00
The_E 55d7ca153e Better error checking for adjust-audio-volume, fixes Mantis 2314. Thanks to Echelon9 for noticing this. 2010-09-26 15:54:19 +00:00
Wanderer 2a6727136e Fix for mantis 2303 and related issue in lua.cpp 2010-09-26 11:32:18 +00:00
The_E acf8f56b41 Reverting 6513 due to errors found in the implementation 2010-09-25 21:38:37 +00:00
Wanderer eb660e86c1 Fix to prevent global damage (shockwaves etc) from creating debris shards that spawn in empty space 2010-09-25 20:50:33 +00:00
Wanderer 1015cfe7e9 Fix for mantis 2304 - non standard uvec/fvec turrets did not have proper collision detection 2010-09-25 20:49:05 +00:00
The_E 536203d7e3 Adding the "On Weapon Selected", "On Weapon Deselected", "On Weapon Equipped" and "On Weapon Fired" scripting actions. 2010-09-25 19:43:45 +00:00
The_E 18e539c27b Moving this assert to a better place 2010-09-25 19:08:27 +00:00
The_E 5daf4591b7 Less ugly hacks is good as well. Why compute the object index, when it's passed as a function argument? 2010-09-24 06:31:52 +00:00
The_E 78f7d9f737 Added an Assertion() to further narrow down the cause of the "ai_find_path tries to find path that doesn't exist" bug 2010-09-24 06:29:46 +00:00
The_E fa7d8cb479 Avoiding a possible Int3() due to invalid data being passed; since the documentation for get-object-* doesn't specify that you need to give all 3 "relative coordinate" arguments, this needs to be checked. 2010-09-24 06:28:25 +00:00
Zacam 4465400d13 Add a description to config.h as to what 4290 is. (Thanks Goober for catching that) 2010-09-22 22:59:06 +00:00
Zacam bdcb906c6c Adding 4290 to the pragma warning(disable:) list for easier testing of some code changes. 2010-09-22 21:13:10 +00:00
IssMneur 730ac54217 Fix bug in the new support ship sexp noted by Goober5000. 2010-09-22 03:05:57 +00:00
The_E 4b1dd8e719 Same here. 2010-09-22 00:41:52 +00:00
The_E a9f02aab7b And another variable declaration overwriting a declaration in an outer scope. 2010-09-22 00:38:08 +00:00
The_E a92b28abdf Moving this counter variable to be declared as local for the loops. 2010-09-22 00:32:39 +00:00
The_E f421af5016 Another potential var name collision. Thankfully, this one's part of the decal code, so it's likely it never was a problem. 2010-09-22 00:25:01 +00:00
The_E 667a557e15 Avoiding a name collision between a global and a local variable 2010-09-22 00:15:29 +00:00
The_E 3efcad84a7 Flags are bitfields, so an "&" needs to be used instead of an "&&" 2010-09-22 00:06:20 +00:00
IssMneur 654be5a6e7 Removes the hard restriction (compile time) on the maximum number of "active" support ships per team. Controlled by an optional seventh argument to set-support-ship. Also fixes glitch where only "max concurrent ships" number of support ships would actually respond to support requests. 2010-09-21 05:16:23 +00:00
The_E 3617bb9809 Another Assert()->Assertion(). 2010-09-17 20:59:39 +00:00
IssMneur e852ecf115 I thought I fixed that typo before committing. 2010-09-17 03:59:11 +00:00
IssMneur a29ca275a7 Converted 4 Asserts into Warnings. 2010-09-17 03:54:46 +00:00
The_E d98efc0675 Changing a string literal to the proper XSTR lookup 2010-09-17 00:01:58 +00:00
The_E 467c7d1e39 Fixing typos noticed by FUBAR 2010-09-16 21:41:10 +00:00
The_E 99dff69a3f Another assert->Assertion conversion. 2010-09-15 22:00:51 +00:00
Sushi 26c2725ccd Fix a typo 2010-09-15 05:06:23 +00:00
karajorma d181d77744 Mantis 2159 - Add the last of Ghengis' code with a switch from debug output to a warning. 2010-09-15 00:53:15 +00:00
karajorma d4e8bd4bf3 Fix Mantis 2278 (Adding a variable can mess up team loadout variables) 2010-09-15 00:50:28 +00:00
karajorma eb1889327f More SEXPs fixed for multiplayer. 2010-09-15 00:49:14 +00:00
karajorma e960a14280 Add the has-primary/secondary-weapon SEXPs 2010-09-15 00:47:08 +00:00
The_E e7fa7f021d Averting a potential div by zero 2010-09-14 23:56:26 +00:00
Sushi 8c6895a029 Re-added collision physics, added basic landings support (still needs some work) 2010-09-13 14:27:42 +00:00
The_E e76761a84a ...For real 2010-09-12 19:38:48 +00:00
The_E fe50ee7231 Fix for is-facing (hopefully) 2010-09-12 19:30:10 +00:00
The_E 3e390ecfdc ... right this time. 2010-09-11 16:55:10 +00:00
The_E 14ae54ad3c Adding ship:getEMP() for scripting. 2010-09-11 16:52:36 +00:00
Goober5000 c4a337e391 partial revert on 6444... don't forget, someone recently fixed a five-year-old bug in the countermeasures code :) 2010-09-11 00:08:57 +00:00
The_E 439c2c78cd Adding object:getrvec() and object:getuvec() for completeness' sake 2010-09-10 23:11:28 +00:00
The_E d863626f26 Adding the vector:getNormalized() and object:getfvec() functions 2010-09-10 20:51:55 +00:00
karajorma 8b1460aa30 Fix sexp_show_subtitle_image to work properly in multiplayer. 2010-09-10 10:42:12 +00:00
The_E 840d11d53d ....And another fix for is-facing. 2010-09-08 16:42:58 +00:00
The_E a41728df77 Thanks to Goober for the warning. 2010-09-08 14:58:41 +00:00
The_E 820fa1dc73 Two more Asserts turned into Assertions() for better explaining 2010-09-08 10:56:31 +00:00
The_E 67a5ae2d27 Another int3() -> Assertion() conversion 2010-09-07 15:14:36 +00:00
The_E a31d34a991 Bah, stupid typo (!= is != <!) 2010-09-07 15:11:01 +00:00
The_E a1ef957423 Adding the is-facing sexp, as per Axem's request 2010-09-06 22:11:25 +00:00
The_E c28989e121 2010-09-04 13:56:02 +00:00
Goober5000 e40cef7e4f make the if check simpler, cause part of it was redundant 2010-09-04 06:55:10 +00:00
Goober5000 a129508de7 made the AWACS hack less ugly, by making the filename replacement much more efficient
--this also allows stuff to be added past the #End of messages.tbl
improve message_filename_is_generic to consider #Simulated Speech Overrides specified in messages.tbl
2010-09-04 06:51:50 +00:00
Goober5000 3cab590e03 none.wav is redundant in this check 2010-09-04 06:40:46 +00:00
The_E a5cd35a1b9 Ooops. 2010-09-03 22:51:42 +00:00
The_E 5d625a2473 More cleanup 2010-09-03 22:45:18 +00:00
The_E 5249397161 More dead code be gone. 2010-09-03 22:41:08 +00:00
The_E b7c9f0e8dd Dead code removal 2010-09-03 22:31:25 +00:00
Goober5000 ef46114a12 disable the warning about Assertion since it clutters the build output 2010-09-03 21:44:54 +00:00
chief1983 682a517129 MSVC, why on FSM's green earth does this compile? 2010-09-03 15:04:05 +00:00
Goober5000 8733ab557a don't simply assume that something is a ship! 2010-09-03 02:57:49 +00:00
Goober5000 455b7f9d81 no need to check if other_objp is a capital ship in these if statements, since the first capital+ check would have already returned the function
this also removes the assumption that other_objp is always a ship!  it isn't!
2010-09-03 02:50:54 +00:00
Goober5000 61f66f13d6 yeah, asteroids and debris are pretty much the same thing 2010-09-03 01:26:49 +00:00
Goober5000 8e5dfc2d33 maintain the original hull, shield, and subsystem percentages when changing ship class, since we might be changing it from a briefing loadout (Mantis #2301) 2010-09-03 00:34:38 +00:00
Goober5000 31db1efaff partial revert (just one file) of Sushi's collision physics feature as it causes all kinds of crashes in asteroid fields 2010-09-03 00:16:45 +00:00
Goober5000 39f3d1d663 fix polymodel gettage since heavy_obj could be an asteroid 2010-09-03 00:14:10 +00:00
The_E 25c80ca56f ...and here. 2010-09-03 00:08:31 +00:00
The_E 83bb23a989 ...and here... 2010-09-03 00:07:50 +00:00
The_E 931cd6bf3a Better feedback here, as well 2010-09-03 00:06:52 +00:00
The_E 431b8955e8 Another Assert() redirected to more useful things 2010-09-03 00:06:01 +00:00
The_E bae585b910 ...Aaaaand another Assert()->Assertion() to make modellers happy 2010-09-02 21:48:53 +00:00
The_E e282c07427 And another int3() turned to something more useful 2010-09-02 21:25:54 +00:00
The_E 2bf6c518ac A useless int3() turned into a useful Assertion() 2010-09-02 20:27:33 +00:00
The_E ccd0401a02 More asserts turned to assertions. 2010-09-02 19:57:18 +00:00
The_E 314c4dfdc3 Removing game_load_palette(). It was useless and commented out anyway. 2010-09-02 07:47:09 +00:00
Goober5000 30feeae3d0 fix the passengers tag so that it works more like the cargo tag 2010-09-01 06:43:08 +00:00
Zacam 273be5d221 -timerbar now has the same message as -decals and is a disabled launcher command. Launcher will (or should) no longer list it as an available command and a msgbox will pop-up if in an existing command line anywhere. 2010-09-01 03:17:10 +00:00
The_E 8458f75d76 weapon_info::subtype is not a bitfield 2010-08-31 22:40:30 +00:00
chief1983 5b775e7a88 Fix Assertion on GCC to support 2 arguments, and revert hacked calls to their 2 argument state 2010-08-31 21:09:15 +00:00
Goober5000 5f85e34b3f update project file 2010-08-31 19:55:12 +00:00
Goober5000 972bdcfd15 don't generate debug information on release builds 2010-08-31 18:18:15 +00:00
chief1983 0fbcb2a2b6 Actually fix the Assertion instead of just disabling it. 2010-08-31 17:41:50 +00:00
The_E 2bfd50b5dc Change assert to assertion. Also allowed usage of non-anis or effs as muzzleflashes. 2010-08-31 13:12:45 +00:00
The_E ca37eeaf8e Changing Assert() to Assertion() again. 2010-08-31 12:52:50 +00:00
The_E c0fc384c8a Change Assert() to Assertion() for better feedback to modders 2010-08-31 12:43:04 +00:00
The_E a5c10c3ce9 Several minor touchups. 2010-08-31 12:42:39 +00:00
Goober5000 12e4d3713b add +Tech title for ships.tbl 2010-08-29 06:07:22 +00:00
Goober5000 fa1f780227 fix compile errors 2010-08-29 04:51:15 +00:00
Goober5000 cc46e18d68 handle clearing alt-name too 2010-08-29 04:45:51 +00:00
Goober5000 6bd68fdeaf add a #define 2010-08-29 04:30:21 +00:00
Goober5000 3445ce4cb8 FUBAR's change-callsign patch 2010-08-29 03:46:48 +00:00
The_E 9fbe036484 Ooops, slight typo 2010-08-26 23:42:04 +00:00
The_E 3397d3a21e From FUBAR: Patch to redirect a warning popup to the log when in standalone mode. 2010-08-26 22:56:36 +00:00
The_E ee27823042 Change Assert() to Assertion(), again to better explain why it fails. 2010-08-26 12:17:51 +00:00
The_E 3d3fbb3002 Fixes a crash when "Test Load Ship" was used with a ship that has turrets with rotation sounds defined. 2010-08-25 20:24:34 +00:00
The_E 17b4aeac33 Change Int3() to assertion for better explaining and stuff. 2010-08-22 12:59:01 +00:00
The_E e5416e3506 Remove hardcoded piece of interface code in favour of something generated dynamically. Fixes issue with too many pilot names being displayed in the pilot select screen if a custom font is in use. 2010-08-21 20:19:48 +00:00
Sushi f045a26eed Updated random sidethrust ($Random Sidethrust Percent) to include strafing attacks vs big ships, as well as making it a bit more situational for fighter vs fighter. 2010-08-21 19:55:44 +00:00
The_E a47698230b Adding a bit of sanity checking here... 2010-08-21 16:22:57 +00:00
The_E ffe6397e66 Fix issue reported by droid803 where non-player ships that have an afterburner need shield icons as well, causing debug warnings. Changed the check so that it only triggers on player ships. 2010-08-20 23:13:44 +00:00
The_E a1ecfe158b Adding the adjust-audio-volume sexp. 2010-08-19 19:45:28 +00:00
IssMneur 5dac806c8e Adds support to Voice Acting Manager in FRED for putting the speaker's name into the generated file name.
Also makes the "Generate Filename" function set the modified flag for FRED if any file names get changed.
2010-08-17 23:52:20 +00:00
IssMneur 26ae5efb0f Fixes mantis 2275: Improving remove-background-bitmap and remove-sun-bitmap so that they issue an Error if an invalid index is passed via the sexp. 2010-08-17 05:42:55 +00:00
IssMneur ad9759d2fa Clarify the help text for set-object-speed-x, set-object-speed-y, and set-object-speed-z 2010-08-17 05:37:38 +00:00
The_E 31b88687d0 And of course, I screwed it up a bit. Reading the documentation is A1 SUPAR. 2010-08-16 23:18:10 +00:00
The_E 0ac5a17102 Allow scripting to override turret AI target selection 2010-08-16 22:04:23 +00:00
The_E bde583461f Fix for assertion encountered with the warp-effect sexp. Also updated sexp help to indicate correct usage. 2010-08-11 13:08:51 +00:00
The_E 6032c0b463 Remove requirement for SM3. While this will not allow cards that are only capable of SM2 to use the standard shaders, now shaders can be written for them. 2010-08-10 18:41:12 +00:00
Sushi b64303a19e Support for allowing bombs to be destroyed by weapon blast and/or shockwaves. Weapon flags are "takes blast damage" and "takes shockwave damage" 2010-08-05 14:17:20 +00:00
chief1983 19319a4835 Whoops hangovers and VNC don't go well together, did not mean to commit this at all. 2010-08-04 19:38:29 +00:00
chief1983 f5e236e408 2010-08-04 19:33:54 +00:00
karajorma 47f157a9f7 Fix 4 more SEXPs for multiplayer. 2010-08-04 17:44:40 +00:00
Sushi 679430d654 Added to ships.tbl:
$Collision Physics: 
+Bounce 
+Both Small Bounce
+Friction
+Rotation Factor
2010-08-04 02:08:14 +00:00
taylor 25987a680d various FS2NetD fixes:
- increase sleep time during reconnect
 - better handling of disconnects from connection errors
 - proper disconnect in case of login failure
 - log stats request calls
 - don't try to read stats from packet when there aren't any to read
 - allow proper connection resetting with standalone
 - change auto-reconnect timeout from 30 minutes to 5
 - count server traffic among activity instead of just client traffic
 - reduce uneccessary client->server traffic
2010-08-03 08:22:02 +00:00
taylor e27d61bbae fix debug message 2010-08-03 08:21:59 +00:00
Goober5000 b48eb270f9 don't generate debug/pdb/map info for release builds on VC6 2010-08-02 04:07:28 +00:00
Goober5000 b00b61ccd2 revert using motion debris in asteroid fields 2010-08-02 03:52:16 +00:00
Zacam 342640920a This is the same as 6335, but for FRED. 2008 and 2010. 2010-07-30 16:21:21 +00:00
Zacam 7185348ea9 Removes /DEBUG from the Linker Properties, no longer Generating PDB files for Release builds. This should also resolve the "no disk in drive" issues. MSVC 2008 and 2010. 2010-07-30 16:13:46 +00:00
The_E 063dea2f89 Patch for issue with ai-waypoints not working correctly. The ship's goals were accidentally cleared after a single run through the waypoint path. 2010-07-29 22:30:02 +00:00
Sushi d391e3f093 Changed "big ships manage shields" to "all ships manage shields." No difference in behavior, just named more accurately. 2010-07-29 00:30:57 +00:00
The_E c6589187e4 Fix/Workaround for Mantis 2272 (Int3() in hudtarget.cpp) 2010-07-27 15:28:09 +00:00
The_E dd60442914 Change short to ushort to avoid issues with high-poly models. 2010-07-25 23:30:18 +00:00
Echelon9 b7c1dcff02 Fix for reinforcement menu bug - Mantis 2246 2010-07-25 05:04:14 +00:00
Goober5000 7df3e81080 add feature requested by BWO: group send-message-list messages at beginning of script 2010-07-22 07:51:32 +00:00
chief1983 e691fa8f94 Should allow INT_MAX to be visible on POSIX-compliant systems 2010-07-21 18:50:19 +00:00
chief1983 e9e3333c73 IssMneur's fix for Mantis #2240, allow gaps after the hardcoded retail sound entries. 2010-07-20 21:59:36 +00:00
chief1983 2d43f0b847 Per IssMneur, fix the root directory detection on *nix systems. 2010-07-19 15:50:50 +00:00
The_E d12eec674f Fix for the "is-ai-class" sexp. Previously, the sexp would compare the given AI class against the ship class' tbl default AI class, which produced erroneous results. 2010-07-19 02:12:43 +00:00
The_E dc54a7d11d No wonder it didn't really work. I was looking in the wrong array. 2010-07-18 02:18:40 +00:00
chief1983 3aba1b9f73 Bump to MAX_SHIP_FLAGS and a subtle reminder for posterity 2010-07-17 22:27:14 +00:00
chief1983 251fe9a34a One more autopilot fix for 3.6.12, per IssMneur 2010-07-17 22:18:20 +00:00
The_E 4d5008fcc1 Fix for Mantis 2263 (Objectives list is still displayed despite disable-hud-except-messages being active) 2010-07-17 14:59:32 +00:00
The_E 4f2942e440 Slight cockup on my part here. Pain flashes were not supposed to be gone for everyone. 2010-07-16 18:35:13 +00:00
The_E 3c412bef42 Updated the credits after god knows how long 2010-07-16 16:16:27 +00:00
The_E 7bcd8d162b Reverting the revert (Yay for feedback), as the ships flag solution seems to be what people really want. 2010-07-15 14:55:59 +00:00
chief1983 b60eb681e6 Fix an Assertion usage issue on *nix platforms. 2010-07-14 15:31:17 +00:00
chief1983 cbe541598e IssMneur's autopilot fixes (hooray\!) 2010-07-13 22:45:54 +00:00
The_E c1f1c47fa8 Patch for Mantis 2205 (Division by zero in do_random_sidethrust()) 2010-07-10 15:06:33 +00:00
Sushi 9c766c1315 Added "$big ships manage shields:" AI profile/AI class flag 2010-07-09 13:11:37 +00:00
Zacam 58d378134d Added the following (recursively) to the svn:ignore: .ncb, .suo, .user, desktop.ini, thumbs.db. 2010-07-08 03:51:39 +00:00
Zacam 7ad97943fd From blowfish: Mac Icon update based on: http://www.hard-light.net/forums/index.php?topic=44371.0 2010-07-08 03:35:57 +00:00
The_E 52f424a0b0 While the other code that was commented out might be unnecessary, this fvec still needs to be set up properly 2010-07-07 15:27:37 +00:00
The_E 854ff6cff9 If lock-perspective is active, the perspective should stay locked. 2010-07-07 02:19:06 +00:00
The_E 3b93ad2ba9 Reverting 6279, and making it more intelligently (Thanks Goober for the heads-up) 2010-07-07 00:04:32 +00:00
Goober5000 3cdf9d3f12 fix a bug noticed by The_E: object types are not bitfields 2010-07-05 05:43:08 +00:00
Goober5000 131805bb51 use motion debris in asteroid fields, per Galemp 2010-07-05 05:41:57 +00:00
The_E 7a8973eade Introducing new SIF2 flag ("no pain flash") to turn off the pain flash. I guess all the peeps who want to do capship missions can rejoice now. 2010-07-05 02:28:48 +00:00
Echelon9 8383d11490 Update Lua interpreter to 5.1.4 (patch 2) to fix the following bugs http://www.lua.org/bugs.html#5.1.4 2010-07-03 02:48:03 +00:00
The_E 437b27c460 A few more dialogues added 2010-06-27 21:46:50 +00:00
Goober5000 51f9cbb20a make FRED be intelligent about mission directory (Mantis #2236) 2010-06-27 08:30:45 +00:00
Goober5000 c8ef8d38ef remove unreferenced variables 2010-06-27 07:13:33 +00:00
Goober5000 614f60968c use 2_ animations in the tech room, just as in the command brief (Mantis #2231) 2010-06-27 07:05:01 +00:00
Goober5000 af2ac0a7eb remove a bit of code that should no longer be necessary due to previous upgrades/fixes 2010-06-27 06:04:48 +00:00
Backslash 5263673023 Add a $Max Directives: option to hud_gauges.tbl -- works just like $Max Escort Ships 2010-06-26 19:34:59 +00:00
Wanderer 0718bc2921 fix for potential null vec issue when using limited base rotation turrets 2010-06-24 18:21:31 +00:00
Wanderer 999ec32353 fix for salvo + check hull bug found by fubar 2010-06-24 17:56:19 +00:00
Sushi 6d29c1a462 Removed unpopular circle strafe changes to make circle-strafing AI more aggressive (like in RC2) 2010-06-24 02:33:48 +00:00
Goober5000 7edfdb32ad this is just a bit cleaner 2010-06-23 06:56:45 +00:00
Goober5000 06216fce4f remove not-kamikaze, since it was never implemented, and since its behavior is incorporated into the kamikaze sexp 2010-06-23 06:19:43 +00:00
Goober5000 be6ea31534 fix for Mantis #2056 (sexps may not want to process every ship)
also, account for the fact that Command may not be "#Command"
2010-06-23 03:05:26 +00:00
Goober5000 6966b3a57d fix a silly bug noticed by karajorma
also, slightly compact the knossos check
2010-06-22 02:29:53 +00:00
The_E 1ae587f819 Fix for null vec3d error mentioned in Mantis 1888 by Woolie Wool 2010-06-22 00:51:12 +00:00
Wanderer fd6c3a84f6 allow lua to track if ship is 'dying' during the frame (bugfix for flashy deaths script) 2010-06-21 22:06:49 +00:00
Wanderer 4d1f5f6a1c fix for the ai profile issue (mantis 2228) 2010-06-21 19:25:00 +00:00
chief1983 6284da4654 Fix the Assertion to not break Macs and Linux. 2010-06-21 17:12:23 +00:00
chief1983 eed85feae9 IssMneur's fix for #1888 (finally): Much better autopilot behavior. 2010-06-21 14:59:36 +00:00
Goober5000 f8efafb0f2 minor modification of karajorma's warp effect so that Knossos can be used for both warpin and warpout; Babylon5 still switches appropriately 2010-06-21 07:41:26 +00:00
Goober5000 5141cf6dab fix some problems with set-explosion-option (viz. all options need to be set if a special explosion is being used) 2010-06-21 07:14:54 +00:00
Goober5000 f8e3aee161 add set-explosion-option to edit explosions (needed after karajorma's new special-exp code) 2010-06-21 01:21:40 +00:00
Wanderer e047ba0155 Fix lua ray collision checks against debris pieces 2010-06-20 14:07:30 +00:00
Wanderer c0862e47bc add a null vec check - hit by fubar 2010-06-20 14:06:34 +00:00
The_E 6ead2d8d87 Stopgap fix for Mantis 2224 (Black text is unreadable in the multiplayer chat). Turned black into pink (as that colour wasn't used before). 2010-06-18 18:18:27 +00:00
karajorma 725ce08f38 Remove the -tbp command line. 2010-06-18 05:03:32 +00:00
Zacam d50cb3841c Commit of PNG Data fix as suggested and supplied by Armchair Commander and marvn.
(Read: http://www.hard-light.net/forums/index.php?topic=68405.0)
2010-06-17 19:46:46 +00:00
Goober5000 33f47d53c7 add awesome logical operators
(I wonder why nobody added these until now)
2010-06-16 02:38:24 +00:00
Goober5000 db2e20e59a add mission-time-msecs 2010-06-16 02:10:48 +00:00
The_E 67e89bdd8d Fix for Mantis 2212 (Interface animations start at frame 1, not 0) 2010-06-15 17:24:03 +00:00
The_E c0e55de8f0 Fix for Mantis 2210 (Ship models in ship selection do not always show up properly) 2010-06-15 12:04:50 +00:00
Echelon9 0d2c96ba09 Project file update to include bitarray.h 2010-06-14 14:12:45 +00:00
The_E 02e76c00e9 Project file update to include bitarray.h 2010-06-14 07:36:07 +00:00
Goober5000 7b8c035320 revert portej05's removal of the bitstring code 2010-06-14 06:56:52 +00:00
The_E d41fa67715 Don't increase the total number of loaded menu music files if a tbm with +nocreate is loaded.
This also neatly fixes the somewhat screwed up music selection list in FRED (remember all those empty lines?), albeit not completely.
2010-06-14 01:59:15 +00:00
Goober5000 7cfdf27b78 sync file for proper string length 2010-06-12 21:23:56 +00:00
Goober5000 5cc6f5e4fd sync case 2010-06-12 20:47:22 +00:00
Wanderer 4b66b6e42c related to mantis 2187 - fix to improve autoaim accuracy if additive velocity is enabled 2010-06-12 16:10:31 +00:00
The_E 8edeb00886 Some stuff for wxFRED. Slowly making progress. 2010-06-10 01:29:17 +00:00
Wanderer c01b067c1a better handling of 'dying' weapons for lua scripting.cpp
added lua controls for accessing beams
2010-06-09 16:49:20 +00:00
Goober5000 9940f9a752 add OPF_SOUND_ENVIRONMENT for Taylor's sexps
also, some tweaks for sexp checks and for SEXP_NONE_STRING
2010-06-09 07:38:27 +00:00
Wanderer 9d75c04e99 fix for target priorities and sif2 flags issue 2010-06-09 05:19:54 +00:00
The_E 56c1699aee Project File for wxFRED. 2010-06-09 05:18:45 +00:00
Wanderer a9e043f156 fixes for the external weapons patch (accidentally uploaded outdated patch) 2010-06-07 12:48:53 +00:00
Wanderer 2296b885b5 changes to external weapon model handling 2010-06-07 12:22:54 +00:00
The_E 36f1acb0ae Not quite sure how this one went broken for so long....( FSO specific .libs were not loaded on non-SSE2 configurations, leading to broken builds.) 2010-06-07 11:10:11 +00:00
Wanderer add696869b mantis 1988 - error checking for the targeting priorities 2010-06-07 10:53:34 +00:00
Goober5000 a6066d79a9 ignore generated file 2010-06-07 07:02:18 +00:00
Goober5000 bbeba26c70 adjust coordinates for The E's latest 640x480 art 2010-06-07 06:35:40 +00:00
Goober5000 b59580e84c FUBAR's feature for LOD naming: http://www.hard-light.net/forums/index.php?topic=68901.0 2010-06-07 03:58:47 +00:00
Goober5000 a992f0687c tweak fiction viewer coordinates 2010-06-07 02:13:44 +00:00
The_E 5d5b377ad8 A missing ) is bad for parsing. 2010-06-06 18:12:29 +00:00
taylor a971f3d768 make sure to stop deathroll effect too (Mantis #2215) 2010-06-06 14:50:38 +00:00
taylor 5e943b843c add some missing safety checks for Snds[] (Mantis #2216) 2010-06-06 14:50:36 +00:00
Echelon9 67a5d89d47 Removed defined but unused variables 2010-06-06 08:35:19 +00:00
taylor f80dcd4a87 make sure to always close context and device when searching through valid devices 2010-06-06 03:10:40 +00:00
taylor 96d93607dd fix OS X compile issue 2010-06-06 03:10:38 +00:00
The_E 03d0b66214 Same here. 2010-06-05 02:45:13 +00:00
The_E 719eb41cd8 Remove unused files from the project file 2010-06-05 02:36:41 +00:00
Goober5000 f37ff6da68 minor fix to the -wcs flag removal 2010-06-03 06:28:06 +00:00
karajorma 3005e447d3 Kill the -wcs flag. Should have done this years ago. 2010-06-02 12:01:13 +00:00
The_E 1dbe105933 Fix for Mantis 2214 (toparc2 and toparc3 hud anis [The Enemy Missile threat and Enemy Missile lock indicators] may have a length > 2 now, instead of being fixed at 3 frames) 2010-06-02 11:49:24 +00:00
taylor 04cac71fe9 revert r6151
Per source doppler factor is part of the EFX spec, which means all full 1.1 implementations.
2010-06-01 02:44:15 +00:00
The_E 4bee746897 According to the OpenAL programmer's guide, AL_DOPPLER_FACTOR is not a valid parameter for alSourcef 2010-05-31 10:38:00 +00:00
Wanderer 4b34460f06 Certain fixes for Bobs animation code issues. Please report if this renders any current anims invalid. 2010-05-30 19:28:21 +00:00
Echelon9 af574dacff codec1.cpp and codec1.h included in Xcode project file when no such source files present 2010-05-30 05:14:00 +00:00
The_E e101736d8f Project file update for new sound code. 2010-05-30 02:17:21 +00:00
taylor f06ef36ca6 more sane memory reserve 2010-05-29 15:53:28 +00:00
taylor 1491795451 fix endless loop 2010-05-29 15:53:27 +00:00
taylor 0a17554c4f disable doppler for the time being 2010-05-29 15:53:24 +00:00
taylor b287ecfef9 new sound code
- Mantis #58
 - Mantis #1769
 - many other fixes and improvements
2010-05-29 15:53:18 +00:00
taylor a7bac8679c fix view skew math issue (Mantis #2213) 2010-05-29 14:55:04 +00:00
taylor f72d0a4cd5 bah! remove debug code that slipped in with safety fixes 2010-05-29 10:55:33 +00:00
taylor d3e750edf7 support for newer versions of automake (Mantis #2145) 2010-05-29 10:55:30 +00:00
The_E 7f9df9c09e Fictionviewer interface adjusted for new, official interface art found here: http://blueplanet.fsmods.net/E/FictionViewer.7z 2010-05-28 20:07:05 +00:00
Wanderer 89d7a512af add read access for lua to weapon and ship info index. enable to check 'weapon_armed' status 2010-05-28 19:15:05 +00:00
karajorma 61af589c21 Swap the engage enemies messages over. 2010-05-28 06:09:53 +00:00
Sushi 270734b6f3 Fixed a parsing bug in AI.tbl that scaled Glide Attack Percent, Glide Strafe Percent, Circle Strafe Percent, and Random Sidethrust percent between 0 and 1 instead of 0 and 100 (as is the case for AI profiles.tbl) 2010-05-25 18:09:59 +00:00
Sushi 5704dce248 Fix a bug where additive weapon velocity would sometimes cause primary shots to pass through a target 2010-05-25 16:25:41 +00:00
The_E f993f7ced1 Altered the project file to allow FRED release compilation on VS2010 2010-05-25 01:11:46 +00:00
Goober5000 04436d634f remove message from queue the correct way, thus fixing the training message crash 2010-05-19 04:28:43 +00:00
Sushi e63505510b Added $Random Sidethrust Percent to AI Profiles and AI.tbl. Allows ships with sidethrust capability to sometimes randomly use it in dogfighting situations to make life more miserable for the player. 2010-05-17 19:10:34 +00:00
Goober5000 c5e3600bef reverted fix. It has problems, which is why I'm going over it first. 2010-05-16 22:26:58 +00:00
The_E acdc56272b Committing IssMneur's fix for Mantis 2183. 2010-05-16 15:40:11 +00:00
Goober5000 7a44b33152 better handling of missing models 2010-05-15 22:53:41 +00:00
Goober5000 ec2542fa1e misc silly fixes 2010-05-15 21:48:23 +00:00
Goober5000 1eb544da58 fix subsystem alignment on ship class change (Mantis #1181)
fix a bug with Bobboau's external missiles feature
2010-05-15 21:31:32 +00:00
Sushi 71ba95081c Added $No extra collision avoidance vs player flag. Makes the AI less likely to didder around like an idiot at close range. 2010-05-14 20:43:32 +00:00
Sushi b01b4a1778 Small fix for circle strafe 2010-05-14 18:57:58 +00:00
Sushi e46ba43891 Fix for Mantis 2099 2010-05-12 19:40:09 +00:00
The_E e2c5ff679c Swarm weapons should respect "$Free flight time" as well 2010-05-10 17:17:49 +00:00
The_E 132ba60085 Patch for Mantis 2202 (Children of swarm weapons do not inherit parent target) 2010-05-09 14:53:29 +00:00
Echelon9 fdb7de88da Remove commented out code (still in SVN history if needed) and the overhead of an empty function call every frame 2010-05-09 06:12:06 +00:00
Echelon9 44886e1ba5 Benefit from our use of STL vectors be removing a now unnecessary variable in cutscenes.cpp and making code cleaner and easier to read 2010-05-08 15:09:08 +00:00
Sushi 63b9efeb3a Some fixes/updates for the Circle Strafe behavior. The AI should use it a bit more effectively now. 2010-05-07 17:03:23 +00:00
chief1983 e702ce2267 Quick fix for the WarningEx breakage on *nix 2010-05-05 16:47:12 +00:00
karajorma de0c889d10 Fix compilation under OSX and Linux with WarningEx 2010-05-04 12:34:05 +00:00
The_E e2fbbb5e19 Genghis' fix for Mantis 2162 (Thruster cones have collision detection) 2010-05-03 12:32:42 +00:00
karajorma 27f58de890 Add the (in)validate-all-arguments SEXPs 2010-05-03 12:03:57 +00:00
karajorma c07d555346 Genghis' fix for Mantis 2159 (Certain parsing errors are never reported) 2010-05-02 10:24:48 +00:00
karajorma 2f635ad879 Genghis' fix for Mantis 2157 (Invalid subsystems not properly detected on mission parse). 2010-05-02 06:00:50 +00:00
karajorma 10d6940145 GencGenghis' fix for Mantis 2155 (No error checking for certain ship problems in the lab that FRED does pick up). 2010-05-02 05:54:26 +00:00
karajorma c6b8d515a4 Genghis' fix for Mantis 2151 (No error checking for incorrect engine wash entries). 2010-05-02 05:53:02 +00:00
Sushi 34c61a7caa Reverted commit 5656, due to side effect of changing AI behavior (see mantis 1982) 2010-05-01 20:39:41 +00:00
Goober5000 39d5580651 prevent HUD formatting from destroying subsystem names - Mantis #2195
also made hud_targetbox_truncate_subsys_name return void to lessen the chance of people making the mistake in the future
2010-04-30 06:33:38 +00:00
Goober5000 0d75839a9d fix rounding formula (Mantis #2194) 2010-04-30 04:03:24 +00:00
karajorma 35ac7d6afa Fix Mantis 2194 (FRED incorrectly calculates the wrong number used in wings). 2010-04-30 03:24:30 +00:00
Sushi b48b7f76ac Fix for bug causing AI to not fire secondaries, as well as a fix for other minor AI bugs 2010-04-29 18:56:11 +00:00
karajorma a2afa2b67a Switch to using the Macros for Multiplayer modes whenever possible. 2010-04-27 13:42:59 +00:00
Sushi 0889d77f9f Fix for Dynamic Glide Cap so that the cap ramps max speed in the same way as normal flight when turning afterburners on/off or changing the overclock (what it should have done in the first place). Also removed some old, unused glide code. 2010-04-26 13:38:36 +00:00
Sushi b72514fbaa Fix for 6057 (game sometimes crashes if $Turret Max Aim Update Delay not set) 2010-04-26 13:36:08 +00:00
The_E 475853afa3 Fix for Mantis 2189 (camera FOV may get corrupted by malformed commandline argument) 2010-04-21 21:14:08 +00:00
karajorma 047ae70637 FUBAR's Fix to allow Explosion-Effect to use any explosion in fireball.tbl 2010-04-20 13:05:29 +00:00
Goober5000 2e58278eba make sure Fred knows its base directory before loading the command line... this will allow it to load cmdline_fso.cfg which will allow Fred to recognize mods (Mantis #2185) 2010-04-20 05:37:34 +00:00
Goober5000 26f33cba24 fix parsing of miss factors (Mantis #2185) 2010-04-20 04:37:44 +00:00
chief1983 7846af6c24 No 2-arg asserts on Linux. 2010-04-19 23:32:52 +00:00
Goober5000 aa0c39cb7d add beam miss factor by team, requested by Blue Planet 2010-04-19 05:17:57 +00:00
Goober5000 63909095f5 merge Iss_Mneur's fix for Mantis #2173 (better error message in cmdline.cpp) 2010-04-19 03:51:05 +00:00
Goober5000 e537b1e133 merge Iss_Mneur's fix for Mantis #2178 (Assertion in missiontraining.cpp) 2010-04-19 03:49:09 +00:00
Goober5000 09602a9ffa merge The E's fix for Mantis #2182 (NaN propagation leading to rendering wonkiness) 2010-04-19 03:40:13 +00:00
Sushi f7ebd3c636 Added $Turret Max Aim Update Delay (same as $Max Aim Update Delay, but affecting turrets instead). 2010-04-15 20:03:01 +00:00
chief1983 52fb26169c Add a VS2010 project file, made from VS2010 Ultimate RC1. Added tweaks after conversion from 2008 to make the output file names and target names more dynamic. This should be the basis for getting FRED release builds to compile. The three other executables per config work fine. 2010-04-14 20:07:08 +00:00
karajorma ff7f028e0e Fix the end-mission SEXP to make it possible to test if the player is alive or not. 2010-04-13 11:15:18 +00:00
karajorma 1362e16c4c Remove a hack which wouldn't allow players to skip the penultimate FS2 mission if they failed it 5 times. 2010-04-13 11:14:20 +00:00
karajorma 4178c4b65c Iss Mneur's mission-set-subspace and hud-display-gauge SEXPs 2010-04-13 11:12:28 +00:00
Goober5000 f59fd543c9 fix Mantis #1953 (departure locations and anchors destroyed by ship editor dialog) 2010-04-13 06:51:06 +00:00
Goober5000 0dddfbca74 consolidate and fix the resetting of time compression (Mantis #2180) 2010-04-13 03:54:30 +00:00
Sushi 0c025d96f6 Fixes a bug where paths generated by exit paths aren't garbage collected. This can cause the game to crash in missions where a lot of ships launch from fighterbays. 2010-04-11 18:36:30 +00:00
Goober5000 4b662a3649 prevent an endless loop if someone tries to assign a variable to itself 2010-03-31 20:31:02 +00:00
Goober5000 d6d69d9ac7 IssMneur's patch for Mantis 2161 2010-03-31 05:33:55 +00:00
Goober5000 59c7c56dd4 The E's patch to apply capital+ to secondary weapons 2010-03-31 05:31:23 +00:00
Goober5000 c2a2f0727f patch some holes in the handling of string variables 2010-03-29 09:39:26 +00:00
karajorma a5078ce0aa Fix Mantis 2000 (Skip Mission Dialog appears even when mission is successfully completed). 2010-03-24 10:49:28 +00:00
Echelon9 36f2e4fd73 Fix Mantis 2158: Increase Intelligence limit from species.tbl 2010-03-21 06:22:35 +00:00
Goober5000 0458d83f94 a couple of small but important fixes to the subtitle code, including (finally) the complete fix for Mantis #2152 2010-03-20 06:37:26 +00:00
Echelon9 c66a0b8e05 Fix Mantis 2156: Crash within outwnd_printf2(char*, ...) on non-Windows platforms 2010-03-20 00:20:47 +00:00
Goober5000 725b48d2b9 handle variables in show-subtitle 2010-03-19 07:39:51 +00:00
Goober5000 b7f4d00358 Genghis's fix for too many cargo names (Mantis 2132) 2010-03-19 06:45:05 +00:00
Goober5000 5a3fa6f576 allow specification of fonts via show-subtitle 2010-03-19 06:31:15 +00:00
Goober5000 28d23c56c0 sexp help now scrolls 2010-03-19 05:47:56 +00:00
Goober5000 7181e3d602 a few things here...
--add space for font argument which will be in post-3.6.12 builds
--fix round-off error in coordinate conversion, discovered by genghis
--use is_sexp_true() instead of WMC's comparison
--fix images not appearing in show-subtitle (Mantis #2152)
--fix invalid character in change-soundtrack sexp help
2010-03-19 04:03:49 +00:00
Goober5000 774f34dea4 approximate the beam whack from retail FS2 2010-03-16 06:43:05 +00:00
Goober5000 7fa0a70c9e this is a long-overdue rewrite of WMC's show-subtitle sexps 2010-03-15 01:55:40 +00:00
Goober5000 27f70fe135 move the -post_process flag to the experimental section 2010-03-14 22:38:37 +00:00
Echelon9 1530e3556b Fix Diaspora Mantis 537: Successfully killing a ship hidden from sensors should count towards your kill count 2010-03-12 23:19:42 +00:00
karajorma b6914428ad Fix Mantis 2140 (Set-primary-ammo/weapon result in the ammo being set to 0 in some mods) 2010-03-10 14:49:50 +00:00
taylor d36f675f50 no comment. (nothing nice to say) 2010-03-10 10:05:42 +00:00
karajorma ca90928e08 Refactoring the Special Explosion and Special Hitpoints/Shield code and saving methods. 2010-03-10 08:50:28 +00:00
Wanderer f19a74b5c2 mantis 2122, fix for hud_gauge string comparison problems. 2010-03-09 07:09:40 +00:00
Wanderer e8d72f5a50 mantis 2138, fix game crashing if using ships with secondaries but without primaries, allow ai ships armed only with secondaries to attack & shoot 2010-03-08 14:53:48 +00:00
Wanderer be06149719 mantis 2113, make autoaim independent from lead indicator status 2010-03-08 14:52:24 +00:00
Wanderer d0b3d8fe30 feature commit - alternate lead indicator based on komet's code changes. 2010-03-06 14:23:13 +00:00
Goober5000 46ea3669d5 allow multiple interface patterns (FS2 plus WCS) to be used in fiction viewer 2010-03-06 11:39:11 +00:00
Wanderer 96c365ca86 Fix for mantis 2131:
prevent for time compression caused vector scaling errors
changed time compression related beam assert into nprintf.
2010-03-05 11:48:19 +00:00
Wanderer f93e369d73 Fubars fix for mantis 2141 2010-03-05 05:47:23 +00:00
Wanderer 5983a47bc4 fix for mantis 2125 2010-03-04 20:34:52 +00:00
Wanderer c4df09934c fix for mantis 2105 2010-03-04 19:39:48 +00:00
Wanderer 3b1597f2d9 fix to attach muzzleflashes on ship to weapon firing points - mantis 2135.
also related fixes - fix attached particle rendering, allow all particles to exists at least 1 frame
2010-03-04 10:10:57 +00:00
taylor 56102ad328 use system versions of JPEG, PNG and LUA (per Mantis #1663 discussion) 2010-03-04 05:58:54 +00:00
taylor 8d2b02efb7 add detection of OpenAL and OpenGL (Mantis #1663) 2010-03-04 05:58:53 +00:00
taylor de60dfe106 fix memory issues with arg parsing 2010-03-04 05:58:52 +00:00
taylor 7b293cd972 reduce minimum sound volume value for OpenAL compatibility (Mantis #1854) 2010-03-04 05:58:50 +00:00
taylor 1ad8db2238 cycle back to normal music is hostile ships leave without battle (Mantis #1632) 2010-03-04 05:58:49 +00:00
taylor bce97dae91 updated Ogg/Vorbis/Theora libs 2010-03-04 05:58:45 +00:00
taylor 721e71f860 handle cmdline_fso.cfg files of any size 2010-03-04 05:58:18 +00:00
taylor a8510f8a51 clean up launcher flags
- update easy flag settings (Mantis #2074)
 - remove -res, it requires an option
2010-03-04 05:58:17 +00:00
taylor f818572382 properly close out mission when end-mission sexp is used (Mantis #2144) 2010-03-04 05:58:16 +00:00
karajorma 64d3a85dfa Fix an issue with the multi_sexp system if you ever had to send two full packets in a single frame. 2010-03-03 14:11:59 +00:00
Swifty b9baca78ed Fix frame buffer objects from rendering upside down after calling gr_opengl_set_clip and gr_opengl_set_projection_matrix. 2010-03-03 12:47:08 +00:00
karajorma e12b4c3840 Remove "disarm or disable cause global ai goal effects:" from AI_Profiles as promised and replace it with a new object types table setting. 2010-03-01 15:59:47 +00:00
karajorma b464f2a558 Fix Mantis 2137 (Play-Sound-From-File doesn't loop correctly). 2010-03-01 13:44:25 +00:00
karajorma abd020529d Ironically OF_REFERENCED isn't referenced anywhere in the code. 2010-02-28 14:07:49 +00:00
karajorma d4b6ae7b8d FRED should base the list on the selected object and not simply the first marked one. 2010-02-24 09:13:47 +00:00
Goober5000 5a92218ce6 fix bugs in VC2005 project files, probably caused by VC6 import 2010-02-24 05:11:22 +00:00
karajorma 38a42dd2e4 Change an assertion into a warning and auto-fix the data in release builds. 2010-02-23 01:53:55 +00:00
Zacam e7b0c695ea For 3.6.12 RC: resolves the text "Monitoring" not showing on the HUD Escort monitor box. [Mantis 2133] 2010-02-20 22:24:28 +00:00
chief1983 a77a92b8f0 Get rid of one place we have to update the version. 2010-02-19 20:41:19 +00:00
Zacam bfdf0c5b48 Increase Trunk tagging and version to 3.6.13. 2010-02-19 19:57:22 +00:00
chief1983 5fc6743d4c SVN will ignore .git and .gitignore files now. 2010-02-18 03:55:41 +00:00
Goober5000 b124ff648b reconvert MSVC_2005 project from MSVC_6 2010-02-17 10:27:23 +00:00
Goober5000 5c032efc72 remove MSVC_6_Release which is now redundant, and MSVC_2003 and MSVC_2005 which are old and need fixing 2010-02-17 10:16:33 +00:00
Goober5000 01a242f269 sync with MSVC6_Release 2010-02-17 10:13:54 +00:00
chief1983 e96e973a54 Fix VS 2008 compiling of FRED. 2010-02-16 05:22:14 +00:00
Zacam cebcd67cfc Some *nix compilers (and potentially Mac in the near future) are dying on the build process regarding this comma. 2010-02-15 22:04:45 +00:00
taylor 41adc2f68b fix coop kill limit check when set to none (Mantis #2014)
cleanup coop validation checks a little, particularly if future checks are added
2010-02-15 19:53:33 +00:00
taylor f7126d9c9c Merge branch 'misc' 2010-02-15 19:01:14 +00:00
Goober5000 4efaaf4523 clarify difference between knossos warpin and warpout in the code -- this should fix Mantis #2128
"mabye" -> "maybe"
2010-02-15 11:01:29 +00:00
Goober5000 ba9c45714a add Fiction Viewer dialog
FRED will now save fiction viewer information properly
FRED will now also save "hidden" debriefing information properly
2010-02-15 10:22:20 +00:00
Goober5000 99aa1e74a0 sync png and zlib changes with MSVC6 2010-02-15 10:08:20 +00:00
Zacam 3761e36f4c Well, this is embarrassing. Forgot to apply "is_a_word_separator" in the briefing text coloring fix for Mantis 1992. As a result, it wasn't stopping coloring unless and until a whitespace was being hit, instead of stopping on valid word separators like it should have been. 2010-02-14 00:46:13 +00:00
Echelon9 271044cb70 Mantis 2108 Fix (Mac Inferno build configurations do not correctly set INF_BUILD in Xcode) 2010-02-13 12:07:00 +00:00
karajorma 7d4f9f0fb5 FUBAR's Mantis 2053 fix (Fix a few holes where invalid names could leak through.) 2010-02-13 09:10:40 +00:00
Wanderer 8651bb3a0b fix for potential (and real) null vec issue caused by sexped explosions 2010-02-13 09:01:07 +00:00
chief1983 1a4917ca2b Fixes for Mantis #2071: Color inheritance and child gauge IDs, per KK. 2010-02-12 17:42:31 +00:00
karajorma 9d705df121 Better fix for Mantis 2106 (set-object-position crashing multiplayer) 2010-02-12 11:23:23 +00:00
karajorma ceebf42868 Bump the server version (should have done this when I broke the packet earlier this week). 2010-02-12 11:19:56 +00:00
karajorma a1f100d0a3 Whoever designed a comparison function that reports false when the arguments are the same should be shot! 2010-02-12 07:42:23 +00:00
karajorma 8555140cf6 Deprecate <any support ship class> in favour of something that does exactly what it says on the tin. 2010-02-12 07:14:34 +00:00
karajorma 77dacf4307 Fix Mantis 2094 (Set-Support-ship results in support ships that can't rearm even though present in the mission). Thanks to FUBAR for the spading on this. 2010-02-12 06:42:19 +00:00
Zacam 6dffec5d23 Patch for Mantis #2001: Primary weapon loadouts with text names no longer show # or anything to the right. Works with $Alt Name: as well. 2010-02-11 16:47:19 +00:00
chief1983 14e0a7f257 Patch for Mantis #2071: color inheritance and pan or static option for custom gauges 2010-02-11 16:32:45 +00:00
chief1983 9473a345fc Fix Mantis #2120: is-primary-selected now returns true for any bank when primaries are linked. 2010-02-11 16:31:25 +00:00
Zacam 20d6d6116f Potential Fix for Mantis 2114 as suggested by The_E and tested by myself. Not only set "static int bm_next_handle" to 0, but also conditioned the Asserts (hopefully) a bit better and cleared out commented code blocks.
(Note: It seems I got Notepad++ to convert ushort and uint into "unsigned" short and int. Doesn't break anything and frankly, I hate unnecessary typedefs anyway).
2010-02-11 02:12:15 +00:00
Zacam e226c8e7f4 Resolves "conditional within an assignment" warnings that could cause problems. 2010-02-11 01:42:36 +00:00
Wanderer c2a1ff57c9 Commit of lua debug patch. 2010-02-10 21:50:15 +00:00
Wanderer 3b84da5af0 commit of beam piercing patch (allow beam tooling to occur simultaneously to the effects) 2010-02-10 21:38:01 +00:00
Zacam ab17ff4d40 From The_E: "This adds the optional string "$End Campaign Cutscene:" to the list of possible cutscenes; once end-campaign is called, all of those scenes will be played if their requisite trigger conditions are met, in the order in which they are defined in the mission file". 2010-02-09 20:03:57 +00:00
Zacam 6a6a3ac822 From The_E: Capital+ flag "AI will not use this weapon on fighters or bombers" for use against Capital class Targets ( SIF_BIG_SHIP | SIF_HUGE_SHIP ). 2010-02-09 20:01:54 +00:00
karajorma 47faa1c364 Fix for Mantis 2106 (Set-object-position crashes in multiplayer). 2010-02-06 11:20:32 +00:00
karajorma b2a443a225 Packet breaking fix for Mantis 2011 (Send-Message-List sends all messages at once for clients). 2010-02-06 11:19:31 +00:00
Echelon9 6d4fb01f67 Updated Xcode project file to reflect the non-inclusion of some redundant png source code files that weren't actually needed in Antipodes 5 2010-02-06 06:52:12 +00:00
Zacam 7096cd3d11 From Antipodes #5: PNG File Format support.
Adds PNG to Maps (should only be used for Nameplates), Interface, Effects, HUD (still needs HUD Rewrite to implement), Player/Squad Images, Multi Players, Multi Cache, CB Anims and Intel Anims.
LIBPNG: Version 1.2.42, current and highest usable version (MAX_VERSION), Linux can use any 1.2.2x-1.2.42, but should NOT use 1.4.0 under any platform for ANY reason (will require rewriting pngutils)
ZLIB: Version 1.2.3.
2010-02-06 02:35:41 +00:00
taylor 05f95e05ee fix damage lightning (from Xt tree) 2010-02-06 01:02:24 +00:00
Wanderer 1cc80c2841 fix couple of model handle related bugs in lua.cpp 2010-02-05 23:14:34 +00:00
Wanderer 17decc5654 allow armor entries exists even without any calculations. 2010-02-05 19:04:12 +00:00
Wanderer e3e7bbfd05 fix for mantis 2110 2010-02-04 21:18:19 +00:00
Zacam e8e37e8620 Multi-platform resolution for "signed/unsigned mismatch" warning on aiturret.cpp via ship.h 2010-02-04 05:36:04 +00:00
Zacam 10d94a24e8 Not multi-platform, but it doesn't break other platforms and removes 11 warnings from nebula.cpp. 2010-02-04 05:02:07 +00:00
Zacam 6d273e9495 Multi-platform resolution for "unused variable" warning on shiphit.cpp 2010-02-04 04:44:42 +00:00
Zacam 650c8010bc Multi-platform resolution for "signed/unsigned mismatch" warning on ship.cpp 2010-02-04 04:42:04 +00:00
Zacam 1f9d15d20e Multi-platform resolution for "signed/unsigned mismatch" warning on gropenglstate.cpp 2010-02-04 04:27:43 +00:00
Zacam b40359cd30 Fix for cutscene.cpp "signed/unsigned mismatch" multi-platform warning. 2010-02-04 04:12:45 +00:00
Zacam 40f0b0b279 Proper fix for Mantis 2039. Nebula poof debris ANI usage now based on using any ANI/EFF on nebdeb01-nebdeb04. Doesn't exist on retail but also doesn't conflict or break Retail as these (nor the original "Neb01-64") actually exist, but allows for the same flexible range for the effect as non-nebula has for motion debris. 2010-02-04 04:04:17 +00:00
taylor 4b40d32f3d particle updates from the Xt code base 2010-02-03 02:18:22 +00:00
karajorma a4f587110d FUBAR's special hits fix. 2010-02-01 04:49:09 +00:00
karajorma 32f4c944e6 FUBAR's bump for the number of docks a ship can have in FRED. 2010-02-01 04:35:29 +00:00
karajorma 8f8a8486a1 FUBAR's Corkscrew Limit bump 2010-02-01 04:15:23 +00:00
Zacam 99c4490bb0 Crap. Fixes SparK's Reverse AB. Now with a ship defined with Reverse AB, forward AB still responds as normal. 2010-02-01 03:37:14 +00:00
Zacam 76d4ba4479 From Antipodes #5: Corrections for errors and warnings to SPHelper.h for speech compiling for WSVC (specifically 2008), especially when done on Vista/Win 7. 2010-01-31 01:22:56 +00:00
Zacam 6cc6bd9119 From Antipodes #5: new TBM option '$Alt name:'
For ships and weapon tbms - renaming existing tbl entries in mods
2010-01-31 01:19:58 +00:00
Wanderer 05b47ecfec bah, bah, bah, bah - fix my own stupid bug in lua raycollision function 2010-01-30 11:45:22 +00:00
Zacam 5ddd75b11e SparK's Reverse Afterburner code, for FringeSpace (Tachyon) project Feature Request. 2010-01-30 03:38:53 +00:00
Goober5000 96d93caf1b Zacam's project fixes 2010-01-30 00:50:08 +00:00
Goober5000 7630b1669c change the other DSPs too 2010-01-30 00:12:45 +00:00
Goober5000 0e7bdf926d fix the MSVC6 project files 2010-01-30 00:04:54 +00:00
chief1983 274aa3cf93 Fix a VC6 compiling issue with multiple declarations of i 2010-01-29 22:21:33 +00:00
Wanderer 38c1682975 The_E's fix for preventing lua On HUD Draw hook from being run when HUD is not visible 2010-01-28 20:28:29 +00:00
Wanderer 170266436b adding 'retail' type piercing (no piercing effect, but normal beam tooling effect) 2010-01-28 20:24:39 +00:00
Wanderer 13a3308e23 added improved controls for piercing effects. fixed shield armor type bug. 2010-01-28 16:05:15 +00:00
Wanderer a3ca4f4ef7 lua function for checking the state of a ship when the ship is dying 2010-01-28 08:05:43 +00:00
Wanderer b0e8ce130e Lua additions/bugfixes, fixed drawmodeloor function for drawing models in game, new model loading helper functions (slow). 2010-01-28 07:37:31 +00:00
Sushi d89a92c6e7 Added $Damage Lightning Type and +Lightning Arc Percent (under $Debris) to ships.tbl. Allows damage lightning effect to be changed (current options are default and none) on a per-ship basis. The percentage of debris pieces with lightning arcs can also be controlled via +Lightning Arc Percent. 2010-01-27 18:55:37 +00:00
Goober5000 51ef10452c remove redundant definitions from modelinterp.cpp 2010-01-26 01:47:35 +00:00
Goober5000 4d643bfe6b thanks to Zacam for noticing the edge case; max flags should actually be 31 2010-01-26 01:47:29 +00:00
Wanderer ffaca21fdd fix for certain lua control problems, data was read and copied at 'wrong' time. 2010-01-25 12:01:01 +00:00
Goober5000 ec0a7e930e Mantis #1992 - enhanced briefing token support; credit to Pedro with modifications by Zacam 2010-01-25 03:25:41 +00:00
Goober5000 fba4e77284 bump MAX_SHIP_BAY_PATHS per Mantis #1917 2010-01-24 21:50:57 +00:00
Goober5000 b53a2b9cd3 trackIR change for MSVC6 project file 2010-01-24 21:50:29 +00:00
chief1983 266737ff84 Fix for Mantis #1936: Third time's a a charm. Let's see if this doesn't help things a bit. Per KK. 2010-01-24 18:45:16 +00:00
chief1983 d5829ad173 Fix for Mantis #1936 part 2: Some stuff that was fixed exposed more broken stuff. Now should be fixed too. Per KK. 2010-01-23 21:58:57 +00:00
Wanderer 8279944008 separate beam flash from dinky explosion (was not a good idea). Enable beam width setting to affect all beams. 2010-01-23 19:34:59 +00:00
Wanderer 8549f3c71a fix to lua escort ship indexer 2010-01-23 09:02:32 +00:00
Wanderer 1375bab654 fix for the new effects with shield impacts and with missiles exploding without impacting 2010-01-23 07:58:31 +00:00
Wanderer f514d2b25a some changes to beam pierce effect, blob pierce effect, new settings for them both 2010-01-22 15:50:54 +00:00
Wanderer 27ac3b0c05 fury's request, option for huge beams not to draw impact effects when hitting specified type of ship. 2010-01-19 14:28:50 +00:00
Wanderer afbb428349 more chase view mode fixes 2010-01-19 07:28:17 +00:00
chief1983 ed5cd1d06b Fix for Mantis #1936: Per ship gauges should now work properly. From KK. 2010-01-18 16:06:35 +00:00
Wanderer 1de215abd5 potential fix for mantis 2041 2010-01-18 14:58:45 +00:00
Wanderer f7d04a9311 weapon info flags: targetable weapon, show weapon on radar, show friendly weapon on radar 2010-01-17 13:52:34 +00:00
Echelon9 d30cc69e36 Provide a simpler way to set the CFBundleName key in the Xcode project file. 2010-01-16 18:26:05 +00:00
Echelon9 47869f4f32 Add to Xcode project file LSMinimumSystemVersion key for future work 2010-01-16 17:55:10 +00:00
Echelon9 03c24467ea Simplify the Xcode project file's CFBundleExecutable key to be truly extensible 2010-01-16 16:51:43 +00:00
Wanderer 74225ecac9 enable another bitfield for ai profile flags, add ai profiles fix for turrets targeting too distant enemies in certain cases. 2010-01-16 16:14:21 +00:00
Wanderer 8546cac0c0 fix for issue when ai is selecting big attack points 2010-01-16 16:06:32 +00:00
Wanderer dbf5d60ab2 Lua control for getting the full button control data 2010-01-16 13:10:55 +00:00
Wanderer 834e4321a7 fixes for various lua wings and wing ship indexer bugs. 2010-01-14 18:05:48 +00:00
Echelon9 2db4d1c9c2 Cleanup Xcode project file 2010-01-13 09:12:41 +00:00
portej05 8694bb1a29 trackir static library no longer needed 2010-01-13 06:53:31 +00:00
Sushi 9e9b6ada2d Added "$Expl Visual Rad" to ships.tbl. This controls the visual size of the main fireball for ship explosions. 2010-01-12 18:51:36 +00:00
Wanderer c18119c729 make sure the debug data is only used in debug builds (not initialized in release builds) 2010-01-11 21:15:27 +00:00
Wanderer d41514c78e Enable missing controls lua control info. Force fireprimary lua function to work regardless of stream status of the weapons. 2010-01-11 10:39:40 +00:00
Wanderer 9a8202cfd0 Fix for subsystem existing without table entries. Rewrote old disabled warnings related to this issue. 2010-01-11 10:38:00 +00:00
Wanderer e2cfb8017a lua access & related functions to enable player button controls to be operated via scripting 2010-01-10 20:59:31 +00:00
Echelon9 e12839e11e With the removal of final Direct3D references, there are no remaining uses of the NO_DIRECT3D definition in the code base 2010-01-10 08:08:26 +00:00
Wanderer f168b7aab7 fix for a case when player dies before his weapons hit the target (target hit by ghost) 2010-01-09 20:12:03 +00:00
Echelon9 cfec9106be Complete reversion 2010-01-07 17:30:44 +00:00
Echelon9 9824b21218 Revert r5760 training_message_queue changes 2010-01-07 17:21:44 +00:00
Wanderer 0eca97a967 model:checkRayCollision lua function to allowed certain collision checks be done with lua 2010-01-07 15:23:25 +00:00
chief1983 abfb3b7298 Fix Xcode compiling for reals, tested to currently work. 2010-01-07 04:48:25 +00:00
chief1983 9f4b691a98 Fix for Mantis #1934: Secondaries now work when changing from a ship that had none, and FRED won't complain when you can't equip secondaries to a ship. 2010-01-07 04:16:44 +00:00
taylor 951ec34a36 fix broken trackir compiling on non-Windows
eol fixage
2010-01-07 02:48:31 +00:00
portej05 680edc2da3 Remove trackir directory from VS2008 solutions 2010-01-06 17:03:13 +00:00
Echelon9 3085dd4b1c Complete update to Xcode project file 2010-01-06 12:10:24 +00:00
Goober5000 d5ab81c947 add external_dll files to VC6 project
alphabetize the project modules at the same time
2010-01-06 01:21:35 +00:00
Goober5000 9ead43eccd change ExternalDLL to external_dll for cross-platform friendliness
(yes there aren't any errors currently, but this has been a convention since the beginning of cross-platform compatibility)
vcproj and xcode projects are updated accordingly
2010-01-06 01:18:31 +00:00
Wanderer cd15f39847 lua handled collision groups and lua bitwise ops library 2010-01-05 18:00:01 +00:00
Hery c0b2e1b1ec Fix for bloom using outdated mipmaps 2010-01-05 17:51:57 +00:00
Hery 1f40c55c1a Fix for mantis 2078, two pass bilinear downscaling in order to reduce artifacts 2010-01-05 12:56:33 +00:00
Wanderer 3572226340 Fix for mantis 2063 from warfull 2010-01-05 09:41:35 +00:00
Wanderer 93524920bd fix for mantis 2077 2010-01-04 11:21:56 +00:00
Goober5000 cdb6ceb1f1 location oops 2010-01-03 20:20:49 +00:00
portej05 99be9d044d Fix TrackIR compile errors 2010-01-03 14:27:39 +00:00
Echelon9 65fc924f92 Update Xcode project file for portej05's code 2010-01-03 09:46:14 +00:00
Echelon9 8116b15105 Update Xcode project file to reflect removed .cpp/.h source code files 2010-01-03 08:52:46 +00:00
Goober5000 169e4e8518 hooray for function prototypes 2010-01-03 05:55:17 +00:00
portej05 2cc225ba3f TrackIR DLL loading implementation. You need scptrackir.dll in order to run (on internal beta at present). 2010-01-02 14:12:22 +00:00
Echelon9 c2b601bd5c Rename function to correctly reflect what it does 2010-01-02 13:32:43 +00:00
Echelon9 67b86f7377 Make Training_Message_Queue dynamic with SCP_vector 2010-01-02 13:28:56 +00:00
Echelon9 3c6f77811a 2010 2010-01-02 06:33:49 +00:00
Echelon9 dce9388543 Some how the removal of the OpenAL.Framework to address GCC 4.2 issues got reverted 2010-01-01 20:02:47 +00:00
Goober5000 5f7684a795 Zacam's extra colors for briefings (Mantis #2059) 2010-01-01 08:30:53 +00:00
Goober5000 05b509d813 Zacam's fix for Int3 in mission briefing (Mantis #2059) 2010-01-01 08:27:25 +00:00
Goober5000 ba9353ee54 adjust number of lines according to font, per KeldorKatarn 2010-01-01 07:52:22 +00:00
Goober5000 21c28412e3 fix ui window using the same font as fiction_viewer 2009-12-30 21:04:58 +00:00
Goober5000 407c670e74 fix mission load error message
remove deleted files from project
2009-12-30 21:04:00 +00:00
Echelon9 155907b7d0 Update SDL from 1.2.13 to 1.2.14. The changelog can be found at http://www.libsdl.org/release/changes-1.2.html 2009-12-30 19:14:05 +00:00
portej05 442ea06112 safe_strings requires you to specify the size of the destination buffer in some way. (fix build for all non-VC6 builds) 2009-12-30 18:09:39 +00:00
Goober5000 770095c84c allow up to two additional fonts using fonts.tbl
allow specification of fiction viewer font
2009-12-30 08:02:37 +00:00
Sushi 4edb31de72 Fixed a problem in the glide code where thrust was not proportional to framerate. Also made glide ramping more consistent in behavior with normal speed ramping. 2009-12-29 23:10:26 +00:00
portej05 345f7b4bc3 ifdef trackir pending new trackir interface code 2009-12-28 18:06:36 +00:00
Wanderer 44b04ddb93 table defined support ship shield, hull and subsystem repair rates 2009-12-28 16:10:11 +00:00
Hery bce99b342e shader manager and post-procesing files need svn:eol-style set to LF 2009-12-27 16:35:39 +00:00
portej05 2449c9abb4 Locking for PDB_DEBUGGING (multithreadedness will need it) 2009-12-27 15:14:55 +00:00
Hery bc369d5566 fix problems with nebula background 2009-12-27 13:20:51 +00:00
Hery 6939a6c05b fix problems with lua scripts and post-processing 2009-12-27 13:01:42 +00:00
Hery 41156280df fix for mantis 2081 2009-12-27 12:42:11 +00:00
portej05 7b730af602 Remove NEW_MALLOC code
Add strcpy_s where needed in vm_strdup
2009-12-26 07:59:01 +00:00
Echelon9 22869bd825 Complete the removal of the now redundant Info-debug.plist 2009-12-24 08:06:38 +00:00
Echelon9 b8af21a85b Fix Mantis 2079. This change utilised Xcode's Info.plist Preprocessor Definitions to consolidate the .plist files into one; which is dynamically generated for the chosen Build Configuration (Release, Debug, Inferno_Release, Inferno_Debug) 2009-12-24 08:02:27 +00:00
Goober5000 1b7863f1d3 clean out some old font stuff 2009-12-24 04:52:56 +00:00
chief1983 a386e6ae74 Fix the makefile to work with the new executable filenames 2009-12-23 06:45:43 +00:00
chief1983 45b6069d74 Update Linux makefile with recently added/deleted files from post processing and the vampire list 2009-12-22 21:50:06 +00:00
Echelon9 b3bc073a73 Reduced size of Frameworks.tgz by removing the unused OpenAL.Framework (it is linked from the system version, this one was redundant). Mac developers will have to reextract the Frameworks folder to take effect. Preparation for the pending update of out of date SDL, Ogg, Theora and Vorbis frameworks for OS X. 2009-12-22 15:18:41 +00:00
Echelon9 9d342e4133 Remove the Xcode project's references to Makefiles 2009-12-22 14:31:46 +00:00
Echelon9 86b9f2f1f8 Hopefully last step to resolve OS X issues from Hery 2009-12-21 20:03:54 +00:00
portej05 de4d3ea105 Updated to VC6 release files for code commit removing empty sound code files 2009-12-21 11:42:07 +00:00
portej05 b8c080bb8e Mantis 1900 patch from Hery 2009-12-21 11:28:16 +00:00
Echelon9 0dbed68b2a Cleanup Xcode project file for *.cpp/*.h that have been previously removed 2009-12-21 09:23:45 +00:00
portej05 5b633a3342 Removal of empty files/unused files (sine OpenAL is now used in all builds) 2009-12-21 09:12:56 +00:00
Goober5000 0c1a0951d7 rewrite code to bypass bizarre internal compiler error 2009-12-21 03:19:13 +00:00
Goober5000 dfd4f33c1f VC6 project file updates 2009-12-21 03:18:45 +00:00
Echelon9 8822a79e42 Commit of Hery's update to the new shader code to address GCC/Xcode compilation issues 2009-12-19 18:39:32 +00:00
Sushi fc26bd16da Fix for mantis 2031 2009-12-18 17:22:01 +00:00
Wanderer f69d5881ed Patch from FUBAR - set armor type sexp 2009-12-18 10:11:48 +00:00
Wanderer 80545a8a96 Patch from FUBAR - turret direction preference, turret optimum range & turret target priorities sexps 2009-12-18 09:34:23 +00:00
Wanderer c2a526db7d fix to portej's fix to particle code 2009-12-18 07:43:43 +00:00
portej05 e67a50beca Make particles go a lot faster! (until a better system is implemented) 2009-12-18 04:28:13 +00:00
Wanderer c0d76ee6c9 weapon based targeting priorities for turrets 2009-12-17 11:45:08 +00:00
Wanderer 02414bc9d6 making countermeasures function like retail countermeasures. 2009-12-16 07:29:56 +00:00
Echelon9 94a1b2d275 MIN() is defined as capitalised at pstypes.h:274 2009-12-15 06:16:04 +00:00
portej05 5f636a00f1 Potential fix for mac issues caused by inclusion of postprocessing in trunk 2009-12-15 02:56:15 +00:00
portej05 8ccf735e27 Resolve macro definition warning for MAX_MONITORS (renamed MAX_VARIABLE_MONITORS in FSO) 2009-12-15 02:23:23 +00:00
portej05 016d01c345 Woops - missed the two important files! 2009-12-14 17:17:29 +00:00
portej05 cf3a4975da Antipodes #4 - Post Processing from Hery 2009-12-14 13:57:33 +00:00
Goober5000 6993a136c0 the reason for the return statement no longer exists 2009-12-14 05:28:06 +00:00
Goober5000 cc4fb68ea6 fix warnings Zacam noticed 2009-12-13 07:24:59 +00:00
Wanderer 54ebd3ad25 hery's patch for mantis 1945 2009-12-11 08:38:39 +00:00
Wanderer 11c87b9934 make the +override option use the flags set during the current parse tbm event 2009-12-10 14:54:13 +00:00
Wanderer 22586a2fb4 commit of aardwolf's clearOrders sexp function 2009-12-08 18:32:40 +00:00
Wanderer 6120956cd6 Fix for mantis 1998 2009-12-08 18:25:50 +00:00
Wanderer d9808e04f6 Added proper functions and warnings as requested for mantis 2018. 2009-12-08 09:59:05 +00:00
Wanderer 97c7fb934d added a warning to prevent issues like mantis 1946 2009-12-06 10:32:11 +00:00
Goober5000 a679a8f597 remove ai_get_subsystem_type as it's redundant
clean up all sorts of subsystem stuff in sexp.cpp (in particular, use ship_get_subsys when possible)
weapon / sensor subsystem types should work for "weapon" and "sensor", not "weapons" and "sensors" to be consistent
2009-12-06 10:06:51 +00:00
Goober5000 62575f7e23 add hits-left-subsystem-generic and hits-left-subsystem-specific
deprecate hits-left-subsystem
2009-12-06 08:48:03 +00:00
karajorma 66e3333392 Fix an issue with the client side section of sexp_deal_with_ship_flag. 2009-12-06 07:15:36 +00:00
Goober5000 434059b5a2 commit the revision patch originally inspired by Zacam 2009-12-05 22:53:04 +00:00
Wanderer cbdca14ea4 fix for mantis 1976. 2009-12-05 19:15:31 +00:00
Wanderer 0db2ca515f fix for mantis 2016 2009-12-05 12:01:03 +00:00
Goober5000 0b2c715162 project file fixes 2009-12-05 07:17:18 +00:00
portej05 17391ffc18 Turns out enableWindowsKey/disableWindowsKey isn't defined for all platforms 2009-12-05 00:50:09 +00:00
portej05 2560ae1109 MSPDB fix for VC6 users. 2009-12-04 06:58:22 +00:00
Goober5000 4c16a66ba9 fix for Mantis #2044 2009-12-04 06:19:02 +00:00
portej05 031f448be2 Fix "SymRefreshModuleList" symbol not found error on platforms without dbghelp.dll v6.5+ (we really should distribute that monster) 2009-12-03 10:23:59 +00:00
portej05 54f63a1357 Running as standalone no longer disables windows key (Mantis #2047) 2009-12-03 07:01:48 +00:00
portej05 7445380789 Commit to update PDB_DEBUGGING in preparation for new allocator system 2009-12-02 17:16:33 +00:00
Wanderer b9fc819ce2 fix to make sure turret matrices (and turret normals) are properly setup from the start 2009-12-01 08:58:40 +00:00
Goober5000 c092173f36 fix a bunch of problems where sexps with multiple arguments might not work on all of them
fix problem with beam-free-all and beam-lock-all only working on the first ship in a list
2009-11-28 19:15:53 +00:00
Wanderer b98c4e8b75 fix to prevent formation of badly setup turret rotation matrices. 2009-11-27 10:09:20 +00:00
chief1983 34179e931a Change the filename for Linux Inferno builds. 2009-11-25 06:20:19 +00:00
chief1983 cc3e1fd071 Set the Inferno configs to output a different filename than the regular counterparts. 2009-11-24 20:05:06 +00:00
chief1983 0bf1baac94 The_E's 720p hi-res interface art patch. Use hi-res interface stuff at vertical res of 600 and higher instead of 768 and higher. 2009-11-24 03:19:19 +00:00
portej05 02b5fd1496 Remove bitarray.h and substitute with simpler functions (tested via Zacam, Flaming_Sword and portej05) 2009-11-23 12:12:09 +00:00
portej05 583e03890f Strip missed CVS comment 2009-11-23 06:11:24 +00:00
karajorma af7ba40eb4 Add the ability to specify ships or wings to the num-ships-in-battle SEXP (In collaboration with FUBAR). 2009-11-23 04:57:42 +00:00
portej05 67e79b3177 Fix for Mantis 2042 2009-11-23 04:45:51 +00:00
Goober5000 554de8e375 warning fixage 2009-11-23 03:41:40 +00:00
Goober5000 5c88548cab more warning fixage 2009-11-23 03:24:10 +00:00
Goober5000 aac68877ec spacing
fix build warning
2009-11-23 03:23:11 +00:00
portej05 b9a95040f7 Remove name concatenation issue from cfilesystem (hopefully mantis 2042 solved, but that callstack changes depending on whether dbg_filter.cfg is there) 2009-11-22 15:05:33 +00:00
Goober5000 9a98a31b1b fix Mantis #2043 - variable-array-set needed extra sexp_tree management
also, improve type safety for checking for sexp operators (compare the constants rather than using stricmp on the names)
2009-11-22 11:55:40 +00:00
chief1983 c90151f94a Fix for fix for #1945 and #1768: Previous fixes didn't play nicely together. Per Hery. 2009-11-19 17:31:48 +00:00
chief1983 65a31a1676 Fix for #1768: cutscene bars should now be fully functional again. Something about cubemaps, ask Hery :) 2009-11-19 06:06:52 +00:00
chief1983 1435ef0752 Fix for #1914: Add a Skybox CLAMP flag to FRED that forces clamped textures instead of tiling. 2009-11-19 05:51:26 +00:00
chief1983 2cc02d72e3 Fix for #1945: Finish adding the proper rectangle drawing code. Cutscenes now combine FOV change + rectangles. From Hery. 2009-11-19 05:49:23 +00:00
Goober5000 6008752531 bump MAX_ASTEROIDS (I can't believe nobody else has yet) 2009-11-18 09:33:31 +00:00
Goober5000 aeb5fd2789 add two awesome sexps that allow treating sexp variables as arrays 2009-11-18 09:17:01 +00:00
Goober5000 33203d244a add useful parselo function 2009-11-18 08:59:35 +00:00
Goober5000 6f3a91c53f remove unused variable 2009-11-18 08:17:26 +00:00
Goober5000 769d3a4d89 sexp subcategorization 2009-11-18 06:34:09 +00:00
chief1983 2da096f845 Add back in:
_CRT_SECURE_NO_DEPRECATE;_SECURE_SCL=0;_HAS_ITERATOR_DEBUGGING=0; 
until we can fix the code that is visibly broken by removing those.  Per Zacam.
2009-11-18 05:58:11 +00:00
Goober5000 f33a638c61 Zacam's "oops" patch 2009-11-17 04:41:35 +00:00
Goober5000 12033c664b fix knossos animations rendering backwards for ships warping out in certain orientations
(taylor's hack isn't actually needed; the parent_obj can - and probably should, for consistency - be the warping ship, not the knossos)
2009-11-16 07:04:06 +00:00
Goober5000 9ee90c41b7 remove this extra friendly-stealth-invisible check; it's redundant and incorrect 2009-11-16 07:01:49 +00:00
karajorma e900e56e1a Trim out some warning messages. 2009-11-14 11:57:35 +00:00
karajorma 39550294bd Pedro's Mantis 1982 Fix (Afterburners are used from several places in the code for ships with no afterburners). 2009-11-14 09:51:24 +00:00
karajorma b323aa89b9 FUBAR's percent-ships-arrived SEXP. 2009-11-14 09:13:45 +00:00
portej05 35aaf68496 FRED Learns to write in its own log file! 2009-11-14 04:11:16 +00:00
chief1983 c178b00fc1 VS2008 remembers how to build
Zacam fixed the broken merge from Antipodes of the project file updates.
2009-11-13 23:35:08 +00:00
portej05 7e65e47acc Fix for issues caused by memset and _HAS_ITERATOR_DEBUGGING.
Some ugliness involved (placement new - yuck!), however given that a lot of our structures are allocated with vm_malloc, I haven't got a better way around this at present.
2009-11-13 18:06:27 +00:00
portej05 cbaf0e5cc3 Fix more incorrect uses of memset causing crashes 2009-11-13 13:22:59 +00:00
portej05 5fd345352e Fix mistake with globally defined symbols (_SECURE_SCL=0 and _HAS_ITERATOR_DEBUGGING=0)
Add PDB_DEBUGGING to default 'code' builds
2009-11-13 10:09:10 +00:00
Goober5000 9c85ac2835 fix Mantis #1967 (spurious warning about custom wing names) 2009-11-13 08:26:12 +00:00
Goober5000 28120ca20c allow changing of case for ship, wing, waypoint, and reinforcement names per Mantis #2017 2009-11-13 08:07:48 +00:00
portej05 6011414dcc Remove _HAS_ITERATOR_DEBUGGING=0;
Remove _SECURE_SCL=0;
Remove _CRT_SECURE_NO_DEPRECATE;
Add Zacams icons patch
2009-11-12 16:40:27 +00:00
Goober5000 52a939531a load hi-res cbanis, if we have them (Mantis #2029) 2009-11-11 06:33:26 +00:00
karajorma 18933d071a Change the Galactica warp effect name to a more neutral term. 2009-11-09 02:18:34 +00:00
portej05 03c0f38796 Added SCP_string, SCP_stringstream, SCP_map, SCP_multimap and allocator equality operators to vmallocator.h (Hery) 2009-11-08 10:28:35 +00:00
Sushi 771571be7e AI Profiles entries in AI.tbl are now overrides instead of multipliers. 2009-11-05 22:46:54 +00:00
karajorma 74d1c139ed Doh x2 2009-11-05 06:16:15 +00:00
portej05 3aaf81208b Fix for memory debugging functions.
Totals are now more accurate!
2009-11-04 13:03:02 +00:00
portej05 b37058615f Fix Assert in WMCGUI.cpp (Vector subscript out of range) 2009-11-03 07:28:25 +00:00
portej05 25e3fe0f80 Fix stupid VC6 variable scoping for for loop in memory debugging routines 2009-11-02 08:00:58 +00:00
karajorma 133a331fc8 Switch to a more neutral name (which fits better with the others too) for the BSG warpout effect.
Add FUBAR's fix for a radius issue affecting BSG style jumps.
2009-11-02 06:28:28 +00:00
karajorma 6d4a7ec889 FUBAR's bump for MULTI_PXO_MAX_PAGES (it was causing issues for Diaspora). 2009-11-02 06:25:23 +00:00
karajorma 2e8a49a05b Minor unused variable clean up. 2009-11-02 03:44:57 +00:00
karajorma 9f44258319 Bump MAX_OBJECTS, WEAPONS, SPLIT_PLANES, and SWARM_MISSILES. This stuff has been tested by Diaspora for months now so it should be fine. 2009-11-02 03:37:36 +00:00
Goober5000 32450e2984 remove constructors as the init functions will always be called
make sure init functions init all struct fields
fix keyframes for weird FS1 anims
remove "dodgy frame skipping code" since frames should be skipped in certain circumstances
2009-11-02 03:10:19 +00:00
karajorma 5e968aac93 Might as well improve this message while fixing Respawn Delay. 2009-11-02 02:24:08 +00:00
karajorma 3d98b9aeae Error message is back to front. 2009-11-02 02:23:16 +00:00
karajorma 38682babc3 Fix Max Respawn Delay properly. 2009-11-02 02:21:42 +00:00
Goober5000 b43417882f Zacam's & Flaming_Sword's patch for ANI streaming, audited by Goober5000 2009-11-02 01:45:26 +00:00
Goober5000 47e03f4a32 removed an unused variable
fixed saving of mission fiction
2009-11-01 09:52:04 +00:00
Goober5000 fbcb83b9db fix FRED choking on respawn delay by making it default to 0 instead of -1; this does not appear to break anything 2009-11-01 09:51:36 +00:00
taylor de43cc3488 spew table/mission crcs to CSV 2009-10-21 11:12:36 +00:00
Wanderer e1df65d0e4 2009-10-12 14:46:54 +00:00
Sushi 56ff4f45c6 Fixed bomb-firing delay scale bug (actually applied to all secondaries) 2009-10-10 19:25:04 +00:00
portej05 983d9cb94a Fixup debug_int3 (until a better solution can be found) 2009-10-06 10:53:08 +00:00
karajorma f0b8f077d5 Fix for Mantis 1996 (Missing support ship builtin messages) 2009-10-01 06:45:02 +00:00
Sushi f4bd24d720 Moving the ships.tbl +Use Newtonian Dampening flag out of the $Glide flag's tree. 2009-09-28 23:00:04 +00:00
Sushi b12b60d577 Fixed a bug that caused the AI to use afterburner too much (in the past 50 revisions or so) 2009-09-28 22:18:35 +00:00
Goober5000 94038d3822 pretty sure the parent objects here have to be -1, not 0 2009-09-28 01:55:14 +00:00
Goober5000 076cbcf818 don't create duplicate waypoints 2009-09-28 01:54:06 +00:00
Goober5000 f3fa70b18b major goof from me a while ago; ship_info data isn't supposed to be modified 2009-09-27 20:53:23 +00:00
portej05 7a3b09e132 Fix for error introduced in Antipodes 3 which caused animations not to repeat 2009-09-26 11:22:26 +00:00
portej05 0383415a3b Antipodes 3 from Flaming_Sword 2009-09-26 05:52:17 +00:00
Sushi 6542269c77 Fix decade-old AI class bug... including AI_Profiles.tbl flag ($fix AI class bug) to avoid breaking retail compatibility. 2009-09-24 20:40:56 +00:00
Goober5000 e516f97d49 improved some retarded setup code in aicode.cpp
moved create_waypoints() into waypoints.cpp and called it at mission post-process
2009-09-20 08:30:50 +00:00
Goober5000 d4f1e1132c remove python files from MSVC6 project 2009-09-20 08:28:44 +00:00
Goober5000 664df3af89 remove an entirely redundant check that WMC added that has the unfortunate side-effect of screwing up any disabled ship that warps in 2009-09-20 08:03:01 +00:00
Goober5000 2a1b807bdb fix compilation problems 2009-09-20 00:39:42 +00:00
Wanderer 27e87c6a0f fotg request - lua support for reading turret fovs and turret matrix 2009-09-19 08:03:07 +00:00
Wanderer 06f0b169e4 wanderer's ai control system setup (both sexps and lua) 2009-09-17 21:27:45 +00:00
Sushi 2e833278ea Fix for Linux build bug reported by Shadow95 2009-09-17 17:43:14 +00:00
karajorma f2158a72fa Add the remove-weapons SEXP. Fix add-waypoint-nav to work properly in multiplayer missions. 2009-09-15 13:47:38 +00:00
karajorma c81d8fdeec Add the option to set a maximum delay before a player is automatically respawned in multiplayer games. 2009-09-15 13:43:13 +00:00
portej05 5e92431d02 Removal of ASSUME macro behaviour 2009-09-13 15:46:34 +00:00
portej05 057ef78c09 Fix to make the stubs error function have a const parameter 2009-09-12 14:43:11 +00:00
Wanderer 2ee628829a fixes to various things listed in the prefast log 2009-09-11 15:52:18 +00:00
portej05 1a8acd364b ifdefing out of global exception handler pending removal. 2009-09-10 15:53:07 +00:00
portej05 be79cb4991 _asm int 3; replaced with DebugBreak for MSVC users 2009-09-10 15:49:56 +00:00
portej05 6cf641cb96 If -fps is specified, the framerate should always be shown. 2009-09-10 15:49:13 +00:00
portej05 884de6da24 ASSUME macro for preFAST noise suppression and optimisation hints (through Assert macros) for VS2005+ 2009-09-10 15:44:25 +00:00
portej05 44f8eab341 Change to make safe_strings show asserts in release.
safe_strings is now used regardless of whether the CRT supports it (except if you're using VC6).
2009-09-10 07:44:08 +00:00
Wanderer 976b86d607 fixing a logic error from the previous fix 2009-09-09 15:41:07 +00:00
Wanderer f53e3a9143 commit for glowpoint issue reported by darius 2009-09-09 15:26:28 +00:00
portej05 585981e24b post-frame-shaded subtitles! Pass an argument 13 which is either (true) or (false) in order to make use of this.
Fix for multimonitor focus loss issue associated with the mouse at the initialisation of the mainhall
2009-09-09 11:52:42 +00:00
Wanderer b91c8cd616 add lua functions to get and set individual HUD gauge color 2009-09-09 09:19:33 +00:00
Sushi 01c5a62b1a Fixed an oversight in my last commit 2009-09-09 04:44:23 +00:00
Sushi 890b1bee36 Added $Max Aim Update Delay to AI_Profiles.tbl (and AI.tbl). $Max Aim Update Delay allows AI aim to "lag" somewhat, making it more possible to evade high-velocity weapons. 2009-09-08 23:32:03 +00:00
Wanderer 780f5e9d09 re-enable both interface and game sound playing from audio lib. 2009-09-08 15:33:34 +00:00
Wanderer f675bde3db fix for detonation_radius issue reported by FUBAR_BDHR 2009-09-08 06:57:05 +00:00
Wanderer 5b1ceed359 from prefast log.. add missing casts 2009-09-07 16:15:35 +00:00
portej05 2e08994ede preFAST noise reduction - these will get optimised out in a release build. 2009-09-07 11:40:02 +00:00
portej05 49ce1e23a5 Fullscreen window request from QuantumDelta 2009-09-07 11:39:32 +00:00
portej05 07b1ea4a3a Logic bugs - ((state != blah) || (state != blah2) ) is always true, so that || should be a &&, and !blah.state & flag != !(blah.state & flag) 2009-09-07 11:13:52 +00:00
Wanderer db1a9508b6 reverting code change - seems only to make things worse 2009-09-06 15:16:23 +00:00
Wanderer c9adb19837 fix for mantis 1944 2009-09-06 13:40:01 +00:00
Wanderer 84c2ad3461 FUBAR-BDHR's fix for 'knossos device' string appearing twice as 'knossos device device' in default objecttypes table 2009-09-06 08:25:37 +00:00
Wanderer 0b742d2301 fix to allow missiles not fired directly at the enemy to home on random spots on the target ships hull. 2009-09-06 08:21:57 +00:00
portej05 0de4a7d9ae Fix for WiH crashes - I reckon this might be the cause of a few peoples problems (using bitwise & instead of logical &&) 2009-09-06 07:41:14 +00:00
Wanderer cf2ef994e9 option to prevent missiles from losing lifetime if they miss their targets 2009-09-04 17:08:24 +00:00
Wanderer d21f8d106f fix for occasional turret locking issue 2009-09-04 17:07:47 +00:00
Echelon9 087f141218 Correct grammar 2009-09-04 08:36:46 +00:00
Wanderer f6fbd4aa1d commit of 'turret direction preference' (int - percentage) - meant to allow turrets to prefer targeting the targets close to the previous target. 2009-09-02 18:17:21 +00:00
Wanderer 7678d0b0c8 weapon flag to allow weapons (including player weapons) not to home on subsystems 2009-09-02 18:14:46 +00:00
Wanderer 5e9bf597c5 debris hitpoints (min/max), debris ship collision damage multiplier. 2009-09-02 08:32:43 +00:00
Wanderer 0715c8d504 Change to collision prediction when using additive weapon velocity. Change to allow 'arm_radius' to sue homing position instead of homing object pos as distance measuring point. Allow weapons with arm_radius to count as armed if they collide with intended target. 2009-09-02 08:13:39 +00:00
Wanderer 468fd91442 Optimum range setting for turrets to help with turrets re-targeting objects inside their minimum range 2009-09-02 08:09:18 +00:00
Wanderer 9eb42469a9 fix for debugging CTD in clean_filename function 2009-09-02 05:17:30 +00:00
Echelon9 822828f412 Force GCC 4.0 as the compiler (for those who've updated to Snow Leopard and Xcode 3.2) while we sort out GCC 4.2 deprecation 2009-09-01 08:16:44 +00:00
Wanderer a92e6bfb1d fix for shockwave and 'carry no damage' flag - addition of 'carry shockwave' flag for subsystems 2009-08-31 17:13:58 +00:00
Wanderer 4ce4880c70 improvements to how subsystems and armor interact 2009-08-30 21:16:48 +00:00
portej05 fb3c9dd696 Fix for interface weirdness in the multi ui (Props to Flaming_Sword and The_E) 2009-08-30 12:09:46 +00:00
Wanderer f1e808aa62 fix for a null vec issue which fubar hit. 2009-08-30 07:51:55 +00:00
karajorma 78deb06ea2 Fix Mantis 1987 (Too many calls to good-secondary-time causes an Int3() ) 2009-08-30 04:24:09 +00:00
karajorma cf949cc6ad Fix a typo, remove some unreachable code, add some missing casts. 2009-08-29 09:32:36 +00:00
Sushi 8b8f325e71 Updates to ai.tbl to allow AI behavior to NOT use the index of the AI class in its logic. In other words, added stuff so that you can create AI classes where their order in the file doesn't affect how they perform.
AI now uses the (previously unused) "Patience" attribute to determine how quickly to break out of a "stalemate" situation (higher patience means willing to endure stalemate for longer). Only matters if the stalemate detection stuff is used as well.
2009-08-29 01:20:11 +00:00
Wanderer 24c94fc72c option to always allow hull armor type to be used (fix for mantis 1973) 2009-08-28 13:48:24 +00:00
portej05 5294e3e1ee Hery's shader unification patch (from Antipodes #2) 2009-08-28 13:16:53 +00:00
karajorma 72af11bb6d Allow bombs to use their actual radius when working out collisions rather than doubling it. 2009-08-28 07:59:31 +00:00
Wanderer ccda696429 runsexp debug console functions - runsexp lua scripting functions 2009-08-28 07:53:45 +00:00
karajorma 8a10fb3181 Don't bother with any other AI checks for afterburner use when the ship doesn't even have an afterburner. Might fix Mantis 1982. 2009-08-28 00:04:25 +00:00
Wanderer 9a1bfaf9c1 Fix for mantis 1986 2009-08-27 15:34:51 +00:00
karajorma 1fb668de99 FUBAR's Fix to make debugging message errors a little easier. 2009-08-26 08:39:41 +00:00
karajorma 5180dc1146 Fix Mantis 1984 (Using sexp_deal_with_ship_flag() on anything ship-vanished causes an Int3() ) 2009-08-26 06:03:11 +00:00
karajorma cb5bcc3369 Fix an issue with the location of the Number Used In Wings label. 2009-08-25 14:49:40 +00:00
karajorma 8edf0d43ed Fix Mantis 1974 (Muzzleflashes don't show up in 3.6.11 builds). 2009-08-25 14:48:18 +00:00
taylor 1529b99932 ensure init_scoring_element() initializes properly (Mantis #1827) 2009-08-25 01:09:32 +00:00
taylor 85920f2151 fix resetting of mission stats when reconnect of FS2NetD happens 2009-08-25 01:09:30 +00:00
taylor a1259d02a8 remove libreadline dependency since we don't need it and can't use it anyway (redo of r.4603) 2009-08-25 01:09:28 +00:00
chief1983 867a8a643f portej's safe strings fix for OS X problem 2009-08-24 16:58:46 +00:00
Sushi 9990637240 Fix so that checking subsystems that are allowed cargo is case-insensitive 2009-08-24 16:05:32 +00:00
Sushi 95a8b8c730 Fix for bug reported by Spoon (http://www.hard-light.net/forums/index.php?topic=65285.0) 2009-08-24 14:16:55 +00:00
Wanderer 75a514b5f9 split 'is_vec_null' macro into normal and 'safe to square' macros. 2009-08-23 11:36:44 +00:00
Wanderer b559c0959b fix for code trying assign 'light laser' and 'rockeye missile' to the weaponbanks if ship class didn't have enough weapons defined for it 2009-08-23 09:33:48 +00:00
Wanderer 48cc61733c option to force beam turrets to use same FOV limits as the rest of the turrets 2009-08-22 09:25:34 +00:00
Wanderer b77b9adf39 turret fov check improvements 2009-08-22 09:00:33 +00:00
Wanderer 8124f3d81d commit of set of vm_vec_normalize_safe functions to modelread.cpp 2009-08-22 08:41:53 +00:00
Wanderer 23521c1e3b nuke's scripting and submodel animation changes 2009-08-22 06:32:11 +00:00
Wanderer 064ab52578 lots of fixes to the earlier burst fire mode 2009-08-21 18:20:28 +00:00
Wanderer 09db476623 fix for shield armor issue reported by Qent 2009-08-19 17:19:37 +00:00
karajorma 3d02219bd7 Bump the number of manoeuvring thrusters again. This probably should be made dynamic at some point. 2009-08-19 06:58:46 +00:00
Sushi eb4b7c03e9 Major expansion of AI.tbl. AI.tbl now allows per-AI-class changes to AI settings in AI Profiles. Numerical values (such as $Glide Attack Percent or $Predict Position Delay) are handled as multipliers. YES/NO flags are overridden if set for a specific AI class. All of these multipliers and overrides are optional, and only active if explicitly specified for an AI class. 2009-08-18 04:32:40 +00:00
Wanderer 02718dd5eb fix for low res medals screen (by flaming sword) 2009-08-17 11:41:59 +00:00
portej05 6d7343b17d Another offsets fix from Flaming_Sword (optionsmenumulti.cpp Line 471 20->31)
What appears to be an indexing error (cheers wanderer!)
2009-08-15 16:40:29 +00:00
portej05 6a1d3d3862 Flaming_Swords Interface Fixes "fixed popup dialog button errors" 2009-08-14 15:42:19 +00:00
portej05 06ef9910c4 Windoze->Windows
(Another) Fix (Attempt) for Mantis 1090. Make the IS_VEC_NULL now check small ranges, not just == 0.f
2009-08-14 12:18:58 +00:00
Wanderer ed0821391e lua virtvar to check and control hud draw status 2009-08-14 11:39:30 +00:00
Wanderer 8826c47460 fix for the support ship issue 2009-08-13 17:23:23 +00:00
Echelon9 3810491748 Modified version of blowfish's FSAA implementation for OS X. Enabled in ~/Library/FS2_Open/fs2_open.ini with OGL_AntiAliasSamples 2009-08-13 12:41:47 +00:00
portej05 6c2aea0db5 Quick update to mspdb_callstack.cpp to handle 64bit windows more correctly (I think - nobody has actually managed to compile FSO on 64bit windows successfully yet.)
Offset fix from Flaming_Sword for the music slider in optionsmenu.cpp (281->279 on line 189)
2009-08-13 04:25:50 +00:00
karajorma 560ab1a5b0 That really needs to be more than just an assertion. 2009-08-09 11:49:21 +00:00
Echelon9 35a8b8bb08 Proposed change for a OpenGL GLint fix in Snow Leopard 2009-08-08 06:02:00 +00:00
Sushi 66db559d2c Some fixes/improvements to AI glide stuff, cleaned up some comments and notes 2009-08-05 05:36:45 +00:00
portej05 1a70dbca7a Get rid of confusing magic numbers and boolean logic that is confusing on non-0 or not numbers. 2009-08-03 15:31:36 +00:00
Wanderer 8fc13dc9d7 Fix for the 'carry-no-damage' subsystem flag, feature commit of shield armor types and shield armor type based piercing percentage setting. 2009-08-02 12:56:26 +00:00
Wanderer cc624e61cd fix to allow live debris from static subsystems 2009-08-02 12:20:36 +00:00
portej05 aa25b5a591 Fix for pdb debugging not showing the symbols on subsequent warnings. 2009-08-02 09:22:40 +00:00
portej05 be186cd01d Fix crash when no cutscenes are defined (NULL pointer dereference through vector [] overload) 2009-08-02 06:32:38 +00:00
Wanderer c19d78f82f variable lead prediction missiles & untargeted heat seekers (aka 'primitive sensor' heat seekers) 2009-07-31 17:26:55 +00:00
Wanderer 0dc516368a commit of target highlighting options mostly for radar icons 2009-07-31 17:25:29 +00:00
portej05 0b1bfe8003 ifdef logic correction for safe_strings (VS2008 release build)
Full logic description is included in comments - please check!
2009-07-31 15:02:56 +00:00
Echelon9 2706a10aca Well yes, but the issue is that strcpy_s was out of scope though 2009-07-31 11:07:10 +00:00
portej05 dcafaa6780 Update to asserts that come from safe_strings - now they print out what they're trying to concatenate - still some ways to go on how pretty they are though (strcat_s will not show the current contents of the buffer, so a short filename might appear to cause the assert, but it's being concatenated with a very long directory structure - the buffer size shown is the full buffer size, not the remaining size) 2009-07-31 09:45:50 +00:00
portej05 dac9c92928 safe_strings is actually safe here (copying stack buffer to stack buffer) 2009-07-31 09:30:03 +00:00
Wanderer e7ff18e13d fix for BP assert due arm_radius 2009-07-30 12:40:52 +00:00
portej05 9bafc782f9 Change taylors change for readability in version.cpp (char buffer initialisation)
safe_strings now spits more, but can be turned off using NO_SAFE_STRINGS (spits during build)
2009-07-29 16:03:15 +00:00
taylor 8cd76d8d41 fix strcpy_s() changes where they didn't need to be or just can't be used 2009-07-29 15:13:34 +00:00
portej05 98f337f701 safe_strings - from Antipodes build #1 2009-07-27 16:06:24 +00:00
portej05 fe7ff55ea2 Restrict semantics for VC2005+ and GCC (not actually used anywhere yet) 2009-07-26 10:13:39 +00:00
karajorma 8a811104b5 Add support for ammo low builtin messages when there is no support ship in the mission. 2009-07-25 16:31:51 +00:00
karajorma f848621a1b Ugly hack for the player ordered disarm/disable issue WCS have been experiencing. 2009-07-25 14:58:25 +00:00
Echelon9 414ce88c58 Clarify a code comment re:GCC 2009-07-24 17:26:43 +00:00
portej05 25e3cd89c4 Fix mistake in extended safe_strings for VS2008 macro expansion 2009-07-24 07:54:35 +00:00
Echelon9 11034e3376 Cleanup Xcode project file post DirectX purge 2009-07-22 14:46:35 +00:00
Echelon9 aadd6ca7c1 Fix use of uninitialised variable reported by valgrind 2009-07-22 09:48:01 +00:00
Echelon9 3bf44ae5b1 Reflect the change to 3.6.11 in Xcode 2009-07-22 09:13:25 +00:00
portej05 673ac40dba Fix for Rodos long, single-word hud message issues. Seems that hudmessage.cpp didn't correctly handle all the possible return values from split_str_once 2009-07-22 05:08:49 +00:00
taylor 737496d65c bump buffer to allow for more tables (99 minimum) during validation 2009-07-22 02:21:24 +00:00
chief1983 95ab9dffa9 Add Zacam's changes (slightly modified) to the VC2008 config - adds Inferno configs and cleans out some kruft 2009-07-21 22:52:19 +00:00
Sushi 7c0008c211 Changed ranges for "$Glide Attack Percent," "$Circle Strafe Percent," "$Glide Strafe Percent", and "$Vaporize Percent Chance" to be between 0-100 instead of 0-1. 2009-07-20 19:52:41 +00:00
chief1983 2f1ca39df8 VC6 updates - add safe_strings, remove Python, remove other vestigial non-existent D3D files 2009-07-20 17:56:01 +00:00
chief1983 060cfbc7ae Fix odd VC6 complaint about a string that was too long. Guess that's what all those double quotes are for. 2009-07-20 17:55:06 +00:00
chief1983 c1a599ac0f Likely unnecessary removal of non-existent files from makefile. 2009-07-20 15:56:41 +00:00
chief1983 90d350816c Add safe_strings to linux makefile. 2009-07-20 15:53:07 +00:00
Wanderer 014b7e4300 Commit of thruster effects for ship and weapon flame and for weapon glow effects 2009-07-19 16:07:23 +00:00
portej05 4c350109dd More safe_strings fixes. 2009-07-19 15:54:59 +00:00
portej05 90943b80c2 Update to safe_strings to give information while in debug mode under VS2005+ (uses scp_str*_s instead of str*_s in debug mode) 2009-07-19 11:15:33 +00:00
portej05 013997a0dd Missed another one. 2009-07-19 08:07:48 +00:00
portej05 9fce479b91 Missed a buffer. 2009-07-19 07:57:39 +00:00
portej05 c5ee5f5e33 Bump buffers causing safe_strings asserts 2009-07-19 07:56:04 +00:00
chief1983 a1699f9edd Port from 3.6.10 branch of fix for dropping issues in the mod warning system, r5458. 2009-07-18 21:34:31 +00:00
Echelon9 89f4e8985b Small fix 2009-07-18 18:13:52 +00:00
portej05 7db0e1c4f1 Debug versions of safe_strings now show where the error occurred 2009-07-18 18:02:58 +00:00
portej05 41bf8dd1d4 Added some new strcpy_s calls 2009-07-18 17:15:17 +00:00
karajorma ee761c8dfc GUI and mission saving stuff for Chief's Force-Shields-On Parse flag. 2009-07-17 21:18:22 +00:00
portej05 86fd3cc17d Some VC6 builds apparently borked by SCP_vm_allocator. VC6 now uses std::vector without a custom allocator. 2009-07-17 12:10:36 +00:00
Echelon9 cfb53105be Apply some of portej05's recent changes to the Xcode project file 2009-07-17 08:15:40 +00:00
chief1983 c9ca0cab25 Add the phrases.xml and its file configuration so that grammar.h and phrases.cfg get generated for VC2008 builds.
This is a necessary step for FS2_VOICER builds to be built, even by 2008 Pro.
2009-07-16 19:58:51 +00:00
portej05 3ac9167ac7 Some safe_strings in use!
Note that I couldn't figure out the buffer size for some of them, so they haven't been changed. The buffer size should be passed as a function argument in future.
2009-07-16 15:18:11 +00:00
portej05 23fcd2968e Fix for embarrassing bug in safe_strings. 2009-07-16 12:48:11 +00:00
portej05 51968f1a77 Fix possible compile error on VC6 platform 2009-07-16 10:14:58 +00:00
portej05 e7db3e6bef Fix the broken comment in safe_strings.h
Add safe_strings.h to pstypes.h
2009-07-16 10:00:50 +00:00
portej05 76ddbc8c2a Checkin of files related to safe_strings, and adding to the project tree (VS2008) 2009-07-16 09:50:34 +00:00
karajorma 0bde3e5d8f Fix a couple of typos other people made. One minor, one not so minor. 2009-07-15 21:49:15 +00:00
Sushi f20e481ba2 Added $Vaporize Percent Chance flag to objecttypes.tbl and ships.tbl. This flag (which takes a value between 0 and 1) allows ships to sometimes explode instantly instead of going through a death roll. 2009-07-15 21:23:46 +00:00
Sushi d4cc6c215e Added burst-fire for ballistic primaries (controlled with the $Primary Ammo Burst Multiplier flag in AI_Profiles). 2009-07-15 19:29:49 +00:00
karajorma 2ffc8487c4 Really need to remove the mission stuff from those too. 2009-07-15 15:19:31 +00:00
Echelon9 4e5c2a89d8 Ensure Sushi's latest AI changes work with gcc, as well as Visual Studio 2009-07-13 20:33:43 +00:00
Sushi 9246a2f74d Additional AI code, including stuff taking advantage of glide and sidethrust. Includes: Flag for allowing fighters to dodge vertically as well as horizontally, "stalemate detection" to help AI break out of circle fights and other stalemate situations, "glide attack" where AI fighters will use glide to fly away while shooting back at you, "circle strafe" where AI fighters will use sidethrusters to jink around while shooting, and an (incomplete) version of "glide strafe" that allows fighters/bombers to use glide to attack capital ships. All new stuff is off by default, and can be turned on with AI_Profiles flags. 2009-07-13 20:08:32 +00:00
portej05 915a9270c9 NEW_HUD Removal commit 2009-07-13 15:48:38 +00:00
portej05 29abf1f51c Python Stripping. Can't promise to have gotten the whole lot though. 2009-07-13 14:11:24 +00:00
chief1983 b0b03a7f7d Fix 1959, the shockwave flag. Again. Hopefully this one doesn't have any other repurcussions. 2009-07-13 01:20:36 +00:00
Echelon9 7af7b91b56 Another instance of std::vector, converted to SCP_vector 2009-07-12 09:36:31 +00:00
karajorma c77a70bfda A couple more vectors that slipped the net. 2009-07-11 17:52:33 +00:00
karajorma 1e80a663af Make messages dynamic. 2009-07-11 17:40:46 +00:00
karajorma fcd9f2b8fb Looks like one SCP_Vector was missed. 2009-07-11 14:18:29 +00:00
portej05 6a8d45c93d Replace most instances of std::vector with SCP_vector. Memory is now all run through vm_malloc and vm_free.
Watch it go up AND down in mission.
2009-07-11 07:07:57 +00:00
karajorma a9179e2db4 Add the Get-throttle-speed SEXP. 2009-07-10 17:07:07 +00:00
Echelon9 c91bf775bb Reflect 3.6.11 version string in Xcode 2009-07-09 12:43:36 +00:00
portej05 5d6b9be53c Removal of DirectX from the codebase.
VC6 and VC2008 solutions have been updated.
2009-07-09 11:35:43 +00:00
portej05 ba4d5c7132 Fix VC6 string too long compile error (props to Flaming_Sword) 2009-07-09 11:16:49 +00:00
karajorma 48d8822bd9 Fix Mantis 1957 (Too many subsystems crash FRED). 2009-07-09 10:55:13 +00:00
Wanderer 657eed8106 Non-swarm type burst fire firing mode commit 2009-07-07 17:08:50 +00:00
Wanderer a5f5e912c3 ai profiles flag to allow turrets to ignore hardcoded fov limits 2009-07-06 20:49:51 +00:00
karajorma 81c1002211 Fix the Primary/secondary-fired-since SEXPs 2009-07-06 17:36:44 +00:00
Wanderer 94ddf755da moved ai's missiles fired at player limit to ai_profiles.tbl 2009-07-06 15:40:21 +00:00
karajorma 31d6469fde Can't say for certain this will cause a speed up but it definitely places the faster check first. 2009-07-06 13:28:33 +00:00
karajorma 5efb4abb9f Looks like the previous SEXP code optimisation didn't take into account the fact that the game tramped values as well as operators through that function so it could call eval_num(). Fixing that gets rid of another few million needless calls to stricmp. 2009-07-06 11:27:31 +00:00
karajorma bc633ce96e Allow clients to pass variable changes to the server (when using lua). 2009-07-06 10:04:19 +00:00
karajorma d121b449d3 Change the way the game figures out the current SEXP Operator in-game as the old method was a massive slowdown. 2009-07-06 10:03:03 +00:00
Goober5000 772865c027 documentation per KeldorKatarn's request 2009-07-06 05:57:17 +00:00
portej05 963fcf87b4 Fix bug in vmallocator. 2009-07-05 15:03:05 +00:00
portej05 720391f8f4 Fix potential undefined behaviour bug. 2009-07-05 06:53:29 +00:00
portej05 d14ace67b0 Customised STL allocator (uses vm_malloc and vm_free) - not actually used anywhere in this commit. 2009-07-05 04:21:55 +00:00
portej05 85eab173d2 Removed more memset(this ... ) statements. 2009-07-04 14:48:16 +00:00
portej05 bdd1f5ff9f Missed a few! (CVS Comment blocks) 2009-07-04 13:39:58 +00:00
portej05 e704b86f72 Browse information turned off for VS2008.
Doesn't affect intellisense, only affects View->Object Browser (not commonly used)
2009-07-03 17:49:01 +00:00
chief1983 d973756d7f KeldorKatarn's fix for Fire Down Normals flag. 2009-07-03 17:08:33 +00:00
portej05 ee5e08868d Fix for Mantis 1949 - Aardwolf has tested this patch. 2009-07-03 15:37:31 +00:00
portej05 3e9707bd0b Got rid of the memset(this,0,sizeof(species_info)) in species_info - defined constructors for a bunch of structs that species_info depends on 2009-07-03 14:29:58 +00:00
chief1983 8b7917d084 No primary linking ship flag. Good thing Kara did 5395 or this would be one more that caused problems. 2009-07-02 23:23:55 +00:00
karajorma f24633cba2 New bug uncovers old bug. Neither particularly serious but both were annoying Diaspora debug builds. 2009-07-02 17:32:32 +00:00
portej05 aebae0185a Warning now makes sense when it is displayed. 2009-07-01 14:31:32 +00:00
Echelon9 4808e4557a Addition of get-fov SEXP 2009-07-01 11:09:06 +00:00
Goober5000 b6e4ccfd05 remove the three additional options from possible squad msgs for support ships; but thanks to WMC's feature they can be added for mods
synchronize comments on the comm menu and flags
2009-07-01 03:47:54 +00:00
karajorma 9df31c7d79 Colour in the ship names in FRED since no one uses wireframe mode to see what is marked these days. 2009-06-30 22:01:39 +00:00
karajorma 5992a55a77 Well that shouldn't have always been saved! 2009-06-30 22:00:24 +00:00
portej05 6281b057ee Fix the FRED crashing on startup problem 2009-06-30 20:18:21 +00:00
Echelon9 948ccf959e Cleanup sexp_set_fov() 2009-06-30 10:39:54 +00:00
Goober5000 f1cc46a562 fix for Mantis #1942 (support ship message using wrong persona)
made the message selection more robust and cleaner while I was at it
this also fixes Kara's multiple-builtin-message feature, as I don't think it would have worked properly in the previous revision :D
(it would have bailed after finding the first message match)
2009-06-30 04:24:15 +00:00
Goober5000 f67596bc5e better checking of wingmen persona headz
fix Mantis #1874 (Command messages check for existence of ship)
2009-06-30 03:34:26 +00:00
Sushi fe87aed445 Added "$nocollide_this_only" and "$collide_invisible" submodel flags. The first one is like $no_collisions, but not recursive on submodels. The second one allows weapon impacts on the special "invisible" texture (normally only ship collisions are allowed). These two flags can be combined to implement invisible collision meshes, which can save a lot of FPS for complex models. 2009-06-29 18:55:20 +00:00
karajorma c9631721c5 This should only have caused problems with corrupt missions but given that it does that with the final FS2 mission it should be fixed. 2009-06-27 08:15:40 +00:00
chief1983 7015ffa0b2 Complete the gutting of safe_strings. 2009-06-24 17:27:09 +00:00
portej05 be743859c0 Removal of safe_strings code - not VC6 compatible :P 2009-06-24 16:56:11 +00:00
portej05 0ebf630314 KeldorKatarns Shield Checking Code. 2009-06-24 16:17:46 +00:00
chief1983 7a37841292 Fix a Lua function so the scripted mainhall works with multiplayer 2009-06-22 23:23:07 +00:00
portej05 0c93ba4501 This simple change means that speech works under VC2008.
I suggest getting the PSDK (rather than relying on the files in /speech/), and defining FS2_SPEECH in both code and Freespace2.
Then you're good to go!
2009-06-22 16:09:27 +00:00
portej05 b91be33343 Just->Error in windebug 2009-06-22 06:37:32 +00:00
Echelon9 0cc4ebc9ef Adopt Assertion in safe_strings.h 2009-06-21 19:09:02 +00:00
Echelon9 7f79f08d32 Update Xcode project file for safe_strings.* 2009-06-21 18:52:21 +00:00
Echelon9 4c55c88b22 Cleanup includes 2009-06-21 18:36:34 +00:00
Echelon9 0666011353 Small change to safe_strings.cpp 2009-06-21 18:22:40 +00:00
Echelon9 015f4a5ef6 Updating portej05 str*_s implementation 2009-06-21 18:01:11 +00:00
portej05 5ad2dcf4b5 Add safe_strings to pstypes.h - forgot to do it in the last checkin 2009-06-21 17:27:24 +00:00
portej05 5b4c5f388c Fixed up some indentation in pstypes.h - the assert section is now readable
Added a space after the ! in the stack tracing using DbgHelp
Added the str*_s basic functions. Note the licence in the top. (also, this only updates the VC2008 project)
2009-06-21 17:08:18 +00:00
portej05 cb51bf1eb5 Callstacks now work under VC2008 - define PDB_DEBUGGING to use. (you need the PSDK to make this work)
See the post in SCP for what/why.
2009-06-21 15:39:13 +00:00
chief1983 9103c5f217 Zacam's enhancement for briefing text colors. 2009-06-20 18:28:13 +00:00
karajorma 18f82eab12 KeldorKatarn's Capship screams fix. 2009-06-20 16:50:18 +00:00
karajorma 7d08f2fecb Add the Trigger Count setting to allow events to repeat a certain number of times rather than simply be tested as with Repeat Count. 2009-06-20 11:27:50 +00:00
Echelon9 98f27b88dd Fix for required_string_4() and readability in ship.cpp 2009-06-20 09:59:04 +00:00
portej05 719825f80d The big CVS comment removal. This chops approx. 3.5mb off a full checkout.
I've tested this through compiling and through hand checking. 
Normalises line endings in ALL files to \n.
2009-06-20 08:08:20 +00:00
portej05 af37fc1b1b Fix for mantis 1933. Despite the huge ugly looking changes, there's only really 2 lines of code changed and indentation has been added. 2009-06-20 07:40:04 +00:00
portej05 8b43ed823c Fix for Mantis 1938. Has been tested against plain mediavps and blueplanet by Sushi 2009-06-20 07:38:02 +00:00
portej05 2f307a06fe Fix one of the static analysis errors Wanderer reported (leaking handle in cfilearchiver.cpp write_index) 2009-06-20 07:36:40 +00:00
portej05 da4d3ce2af remove-goals sexp commit. This has received testing, however it hasn't been pushed to the limit.
http://www.hard-light.net/forums/index.php/topic,63249.0.html
2009-06-20 07:24:46 +00:00
portej05 f7a8bf844b Fix the CTD in aicode.cpp when autopilot is engaged, but not in AP_CINEMATIC and wing_leader == NULL. Probably does not fix all the autopilot woes. 2009-06-20 07:21:41 +00:00
karajorma 9abc540362 Plug a memory leak. 2009-06-19 18:43:20 +00:00
Goober5000 dfb8d4cadf clean-up the end-campaign sexp logic and fix the end-of-campaign movie playing
this leaves room for possible future specification of end-of-campaign movies
2009-06-16 04:14:27 +00:00
karajorma 286a7fca3e Commit Sushi's improved glide changes. 2009-06-14 15:57:45 +00:00
Wanderer 77a8ab89e8 move the bomb delay timer to its proper place in internal ai_profiles.tbl 2009-06-14 09:38:49 +00:00
karajorma 5e3ca2f514 A few minor fixes. 2009-06-13 18:08:54 +00:00
Wanderer c817826d45 commit of Nuke's and Aardwolf's lua functions 2009-06-12 11:38:18 +00:00
chief1983 87fa567516 Whoops. 2009-06-11 04:30:13 +00:00
chief1983 5bd74f4ab3 intrinsic no shields flag for ships.
force-shields-on p_obj flag for mission ship object (overrides intrinsic no shields, don't use with no shields).
No FRED checkbox yet for force-shields-on yet.
2009-06-10 20:19:01 +00:00
Wanderer 79adc6dde8 Echelon9's update to bring lua to version 5.1.4 2009-06-10 09:46:20 +00:00
Wanderer 16db9601ac change mouse_force_pos call to mouse_set_pos call in forceMousePosition lua function 2009-06-10 07:54:52 +00:00
karajorma 15fe7f2ffe Commit Echelon9's flag to prevent the addition of noise to thrusters. 2009-06-06 10:46:10 +00:00
Goober5000 7121dd75d5 clarify op_submenu comment (it had been moved from sexp_tree.cpp to sexp.cpp)
reorder weapon, shield, and engine sexps for consistency
2009-06-03 04:11:42 +00:00
Goober5000 1e4447111a fix bug found by RedDwarf which would overflow the array if (e.g.) Alpha wing ever had six ships 2009-06-03 03:59:50 +00:00
Wanderer dbd42fca7c joystick sensitivity change to improve the accuracy of the controls 2009-06-01 20:33:32 +00:00
chief1983 6d999b5b9d Add the new FRED files to the VC6 projects too. 2009-05-30 21:54:52 +00:00
karajorma cd5faf4e8c Fix yet another VC6 only issue. 2009-05-30 21:22:05 +00:00
chief1983 0c8b78505f Add multi_sexp files to Xcode project 2009-05-29 15:47:55 +00:00
chief1983 a482a9a4a5 Add multi_sexp files to the VC6 projects. 2009-05-29 15:28:04 +00:00
chief1983 f0feac6f70 Committing for Karajorma since he's occupied - fixes Assertion code from breaking Linux now 2009-05-28 21:32:46 +00:00
karajorma 96852832cc Fix compilation of Assertion on MSVC 6 and compilation of multi_sexp stuff on Mac OS X 2009-05-28 13:00:26 +00:00
Wanderer 84423fbcf3 fixing vector rotation issue in subsystem targeting 2009-05-25 21:16:00 +00:00
karajorma 8bdc2c1a9f Portej05's second set of preFAST fixes. 2009-05-24 21:38:22 +00:00
Wanderer 875b735417 fix for the release build crash reported by HT 2009-05-24 07:09:16 +00:00
Wanderer de5f86bd79 fixing the number of lua enumerations 2009-05-23 19:22:05 +00:00
Wanderer eb1bd98ee8 merge from wanderer branch - additional options for lua mouse control 2009-05-23 07:29:56 +00:00
Wanderer 2a69aaa23b merge from wanderer branch - lua flight control option 2009-05-23 07:06:11 +00:00
karajorma 24de2cb225 Bobboau's Skybox flags code (via Wanderer then me) 2009-05-21 14:57:33 +00:00
karajorma 77d60f603c A piece of WMC's warp code that somehow missed being committed. 2009-05-21 14:15:41 +00:00
Wanderer 1302964fbf merge from wanderer branch - trail & contrail leading edge fade out option 2009-05-21 08:50:31 +00:00
Wanderer 7f36e6dc8f merge from wanderer branch - emp protection option for weapon, emp resistant option for ships 2009-05-21 08:37:48 +00:00
Goober5000 8fcee4ebe2 add Taylor's fix for Mantis 1768 (cutscene bars) 2009-05-21 08:33:02 +00:00
Goober5000 e79c4fd923 fix ship-to-ship collisions; they should be disabled iff the ship has a no_collide flag, not iff the ship is a navbuoy
(fortunately, in retail, all navbuoys also have no_collide flags)
2009-05-21 08:31:31 +00:00
Wanderer 943969aac1 merge from wanderer branch - fix inconsistencies with subobj_name and name 2009-05-21 08:19:51 +00:00
Wanderer 7cc7000f88 merge from wanderer branch - additions to alt subsys name from r5125 2009-05-21 08:05:46 +00:00
Wanderer 629b7558f7 merge from wanderer branch - alt subsys name for damage popup 2009-05-21 07:31:43 +00:00
Wanderer 2036fb95cc merge from wanderer branch - turret target priorities setup 2009-05-20 20:43:01 +00:00
Wanderer e05276ea1e merge from wanderer branch.
option to allow all hitpointed weapons to be hit.
allow 'safe from weapons' time of bombs be set.
2009-05-20 20:11:15 +00:00
Wanderer fdb2de32e7 fix swarm issue - again 2009-05-20 19:44:18 +00:00
Wanderer b4eb17bd7f merge from wanderer branch - limited rotation turrets, reset idle turrets option 2009-05-20 18:03:14 +00:00
Wanderer 0920dc10ed addition to the rotate sound to toggle it on if rotation is re-enabled via sexps 2009-05-20 14:23:19 +00:00
Wanderer fa24bc0b39 merge from wanderer branch - autoaim/convergence improvements and variants 2009-05-20 14:13:58 +00:00
Wanderer 4cd2a011db merge from wanderer branch - fixed firingpoint and 'fire on target' subsystem flags 2009-05-20 13:24:57 +00:00
Wanderer cb3085e58c merge from wanderer branch - subsys/turret sounds 2009-05-20 12:24:45 +00:00
Wanderer d320ebf724 merge from wanderer branch - no subsystem targeting flag for turrets 2009-05-20 09:46:45 +00:00
chief1983 01cb760ae5 Bump linux version to 3.6.11 2009-05-19 22:13:12 +00:00
chief1983 3c64b07134 Convert these to UNIX again, hope they compile this time... 2009-05-19 22:02:48 +00:00
Wanderer 9c7b1a1292 merge from wanderer branch - alt iff colors 2009-05-19 21:17:48 +00:00
Wanderer d7f721f3b1 merge from wanderer branch - phreak's inherit parent target weapon flag 2009-05-19 19:40:06 +00:00
Wanderer b399e066f7 merge from wanderer branch - smart spawn weapon flag 2009-05-19 19:29:41 +00:00
chief1983 4def2aebce Add SEXP stuff to Linux Makefile.am 2009-05-19 18:17:31 +00:00
Wanderer fc2f05c747 merge from wanderer branch '$Turrets prioritize ship target:' objecttypes flag 2009-05-19 17:20:18 +00:00
Wanderer ea1cc6ca27 quick jury rigging to prevent stream of null vec warnings caused by r5261 2009-05-19 16:53:05 +00:00
Wanderer cabc75bfe5 merge from wanderer branch. 2d and 3d radar images support 2009-05-18 22:08:13 +00:00
karajorma 3b912c0ca3 Fix Mantis 1926 (Piranha submunitions home in on the ship that fired them in dogfight mode) 2009-05-18 22:00:01 +00:00
Wanderer ab316e895f initial merge from wanderer branch - fixes to corkscrew missile effects 2009-05-18 20:36:11 +00:00
karajorma 5c1a6ef841 Fix Mantis 1925 (Loadout lists may contain ships and weapons which are not been flagged as player allowed). 2009-05-17 12:35:52 +00:00
karajorma a4e623db23 Portej05's preFAST warning fixes. 2009-05-17 11:50:48 +00:00
karajorma d599cc1d6b Commit Wanderer's Salvo Fire mode changes. 2009-05-16 19:41:05 +00:00
chief1983 67406e5952 Update Xcode's Info.plist to 3.6.11 2009-05-16 19:09:55 +00:00
karajorma 3ac6b9aa80 WMC's shipFX changes. Some other minor fixes. 2009-05-16 18:01:08 +00:00
karajorma 2f33c72ba7 AddAdd support for multiple builtins of the same type and new builtin message types Praise Self, High Praise and Primaries Low 2009-05-16 17:32:53 +00:00
karajorma 1a1f81f86d Switch network variables over to the SEXP packet except for when called from lua 2009-05-16 16:58:22 +00:00
karajorma 9f9f4dae6c Add the set-ambient-light SEXP 2009-05-16 16:38:49 +00:00
karajorma 5d9af246c5 Allow multi-docking in multiplayer. 2009-05-16 16:29:41 +00:00
karajorma 7c70f212ba More minor fixes. 2009-05-16 16:20:45 +00:00
karajorma f95777ebe3 Add a ship and parse flag to lock all turrets initially. Fix the Lock Primary/Secondary checkboxes to work for multi-selection. Add a checkbox for lock afterburner. Add the weapon fired since SEXPs 2009-05-16 14:06:23 +00:00
karajorma fc12d0a5b7 Break up the status SEXPs into sub-categories. 2009-05-16 13:03:59 +00:00
karajorma 0a4ca2f858 Fix a bug where the order of SEXP arguments was reversed. 2009-05-16 12:56:26 +00:00
karajorma fbf44b51e0 Add SEXPs to set weapon, shield and afterburner energy. 2009-05-16 12:55:11 +00:00
karajorma 321c1cd30e Echelon 9's fix for a potential buffer overrun. 2009-05-16 12:32:46 +00:00
karajorma e63ea3738b Auto-expand branches after pasting, add-pasting or replacing SEXPs. I really don't know why someone didn't get rid of that petty annoyance years ago. 2009-05-15 18:38:24 +00:00
karajorma 0adb576247 Fix an assertion that crops up when you have no selected message but click on delete message. Has the side effect of making the message editor much less annoying too. 2009-05-15 18:36:47 +00:00
karajorma b67289e52a Commit the SEXP packet code.
Add the set-respawns SEXP.
2009-05-15 18:32:46 +00:00
karajorma 1ea70f7122 Move the repair penalty to an AI profile setting. 2009-05-15 17:53:38 +00:00
karajorma 0512409e18 Looks like that icon was needed after all. 2009-05-15 17:34:46 +00:00
karajorma 39adc73583 Add the validate-argument SEXP.
Fix a minor initialisation error with the ship-tag SEXP.
Fix Mantis 1907 (Error in the get-damage-caused description)
2009-05-14 17:12:23 +00:00
karajorma 4bd18224fe Fix Mantis 1859 (FRED crashes if an unknown ship type is detected in the loadout). 2009-05-14 16:52:56 +00:00
karajorma 961c88132b Due to a merge, delete a file which was never in trunk anyway. 2009-05-14 16:38:02 +00:00
karajorma ba4e5132ef Add new sexps to determine the amount of afterburner and weapon energy remaining. 2009-05-14 16:37:11 +00:00
karajorma 251285cacc Add support for cutscenes before the various briefing and debriefing sections (FRED support for this feature will come later, but it will load and save correctly for now). 2009-05-14 16:27:36 +00:00
karajorma a9219ca129 Fix a bug where the log displays incorrect percentages for kills. 2009-05-14 16:26:37 +00:00
karajorma 616b19772e Changes to allow more data to be used from exited_ship. Make ship_exited dynamic too.
Get-Damage-Caused SEXP and a couple of functions for counting the number of variables of a certain type. 
Commit the new team loadout code and FRED changes to support it.
2009-05-14 15:06:52 +00:00
karajorma 4485f12c24 A couple of new parsing functions for dealing with variables in fields that previously only accepted integers or strings. 2009-05-14 14:08:07 +00:00
Wanderer fe352da2a2 tweak to keep all 3d radar dots inside the retail radar bitmap area - Mantis 1908 2009-05-13 22:03:30 +00:00
karajorma 1d8f54cf29 Allow wireframe for the targetbox to be set from hud_gauges.tbl. 2009-05-12 22:05:43 +00:00
karajorma 5ec562973b Allow the boilerplate traitor debrief to be turned off even if the player did turn traitor. 2009-05-12 22:03:39 +00:00
karajorma dc934368ab Fix Mantis 1538 (special hitpoints not updated properly on deletion) 2009-05-12 21:55:49 +00:00
karajorma b33f468e38 Fix Mantis 1913 (Characters after # are visible in the wings and reinforcements comms menu) 2009-05-12 21:53:12 +00:00
karajorma 428e5d67c9 Fix the FictionViewer truncating anything with more than 70 lines. 2009-05-12 21:49:41 +00:00
karajorma 6a5bf64aeb Allow players to filter who they send messages to when using the chatbox 2009-05-12 21:30:17 +00:00
karajorma 5a919c3e49 Fix Mantis 1911 (Add Data doesn't show the <argument> option)
Fix Mantis 1813 (Negative number constants could be added in FRED for SEXPs which expected OPF_POSITIVE, often resulting in crashes).
Fix (part of) Mantis 1677 (cap-subsys-cargo-known-delay doesn't list the correct ships)
Fix Mantis 1909 (Can't paste variables in FRED)
2009-05-11 09:00:40 +00:00
karajorma 2c8d1795e6 Fix a typo in disable-builtin-messages 2009-05-11 08:54:52 +00:00
karajorma be03d7e3f1 Fix Mantis 1884 (Entering the name of an invalid operator in any dialog other than events editor would crash FRED) 2009-05-11 08:54:28 +00:00
karajorma ad31fc80be Fix Mantis 1910 (Assist Percentage resets itself when ships are multi selected) 2009-05-11 08:48:05 +00:00
karajorma 63f00de6e0 Fix an issue with homing capship missiles not tracking correctly in multiplayer. 2009-05-11 08:45:58 +00:00
karajorma c35da651ea Fix Mantis 1753 (Using " or ; in briefings and messages causes them to either vanish or truncate the message)
Fix a bug that prevented lcl_replace_stuff() working properly when a message had two or more replacements of the same type.
2009-05-11 08:41:51 +00:00
karajorma 6ba239d6a0 Allow beams on any player ship to count for kills. Not just fighters and bombers. 2009-05-11 08:41:09 +00:00
Wanderer edd046798a fix for mantis 1902 2009-05-10 19:09:21 +00:00
karajorma 09adeaea8a Fix compile issue with GCC. 2009-05-10 13:03:41 +00:00
karajorma 62b5d676cd Bump version to 3.6.11. Bump debug warning level to 4 2009-05-10 09:52:05 +00:00
karajorma 61d9326eb8 Fix Mantis 1371 (Can target target's target even if it is stealthed or hidden from sensors). 2009-05-10 09:06:00 +00:00
karajorma 5e54017f15 Fix Mantis 1916 (Can't change the dockpoint a ship is initially docked to without undocking it) 2009-05-10 08:58:16 +00:00
karajorma 0cb0206db2 Add the Assertion Macro as an alternative to Assert.
Switch a couple of Asserts to Assertions.
2009-05-10 08:53:57 +00:00
karajorma d4f6ec98b9 Fix Mantis 1883 (spaces at the end of ship and wing names can cause errors) 2009-05-10 08:32:08 +00:00
karajorma 35dbaac407 Fix Mantis 1620 (Replace Number/String don't work in FRED) 2009-05-10 08:26:17 +00:00
Wanderer c695230883 Fix for mantis 1915 and related collision detection issues 2009-05-09 10:45:04 +00:00
karajorma e2f1229d79 Nope. That won't fix the error. Reverting. 2009-05-04 13:43:48 +00:00
karajorma bdb1569898 Maybe fix a crash in the voice recognition code. Maybe fix a lock when going into the option menu while respawning. 2009-05-01 17:48:15 +00:00
chief1983 4f18bbd624 Nobody here but us chickens (really I don't think anyone uses this but FotG) 2009-05-01 16:14:32 +00:00
Goober5000 b78f77f0a0 fix bug in voice messaging 2009-04-30 23:55:42 +00:00
Goober5000 3427549f9b activate voice recognition 2009-04-30 23:45:14 +00:00
chief1983 f711df0fd1 This is why we can't have nice things. 2009-04-18 19:37:20 +00:00
chief1983 5119664e14 Pretty FRED icon (and new 256x256 FS2 icon to boot) courtesy of Axem 2009-04-13 20:50:59 +00:00
Goober5000 6e4021888d add apostrophes to contractions, lol 2009-04-10 07:49:12 +00:00
chief1983 03123b1437 Add Inferno configs to Xcode project 2009-04-08 17:48:46 +00:00
Goober5000 47060c5c9b add warning system for mods with bad data files 2009-04-08 04:58:12 +00:00
chief1983 0c628834c5 Manual inspection to make sure my new VC6 project was essentially the same as the old one, and wouldn't you know, I found a bug in the wxFred project too :) 2009-04-02 21:57:12 +00:00
chief1983 b4a20998e1 Amazing what you can learn from reading SVN logs. Really. Old. SVN logs. 2009-04-02 21:32:15 +00:00
chief1983 b4d35f6afe This MSVC6 project has additional defines to build Inferno builds, and also utilizes the speech SDK by default which was previously committed. I'm committing this so that anyone with VC6 can make a release build with little to no hassle. 2009-04-01 21:05:12 +00:00
chief1983 144a30b20f We include every other SDK just about...why not speech 2009-04-01 20:29:09 +00:00
chief1983 fe5c1f3bad Missing comma revealed with FS2_VOICER 2009-04-01 20:25:49 +00:00
chief1983 763f714864 Grammar fix 2009-03-31 18:32:09 +00:00
Wanderer 26217893fd fix for mantis 1899 2009-03-31 06:11:09 +00:00
Wanderer ce24e12816 fix for mantis 1900 2009-03-26 08:18:46 +00:00
Goober5000 570755309c final tweak to callsign feature 2009-03-26 01:43:26 +00:00
Goober5000 4f22d45411 change warning 2009-03-26 01:42:47 +00:00
karajorma 26db4ff799 Bit of a hack but it should stop the function from going over MAX_PACKET_SET_SIZE 2009-03-25 00:49:21 +00:00
karajorma aa49d10143 Made this change in my branch but it never made it over here. 2009-03-21 23:06:37 +00:00
karajorma d5168e3592 Fix Mantis 1661 (Ships leaving via the fighter bay don't disappear on multiplayer clients). 2009-03-17 20:28:41 +00:00
karajorma d8a1a68c16 Fix multiplayer for Inferno builds. 2009-03-17 20:25:36 +00:00
karajorma 70ecaa5d86 Various fixes needed to allow multiplayer to use over 255 weapons. 2009-03-17 20:20:48 +00:00
karajorma bdf9f7008b Fix Mantis 1486 (Pressing F4 crashes multiplayer) 2009-03-17 20:14:31 +00:00
karajorma 1637424c35 Fix a series of bugs with generic subsystem types and non-standard names in the ship model. 2009-03-17 17:44:28 +00:00
karajorma 26b7f17c41 Fix Mantis 1729 (Pressing glide keys while warping out locks up the game) 2009-03-16 22:22:48 +00:00
karajorma fff260ae8e Fix Mantis 1838 (Latency information obscures the messaging menu) 2009-03-15 17:19:45 +00:00
karajorma 5dcf9f7880 Fix Mantis 1898 (Names with a # are not truncated correctly in the message menu). 2009-03-12 20:25:09 +00:00
karajorma bf6391e4c2 Fix Mantis 1896 (Two support ships crash the game) 2009-03-10 21:24:07 +00:00
karajorma 87774d9ce8 Doh! x2 2009-03-09 11:50:38 +00:00
karajorma b4abe9f24d Doh! 2009-03-09 11:46:44 +00:00
karajorma 3f1880d22c Fix Mantis 1872 (Fiction Viewer crashes/locks up.)
Allow FRED to save fiction if the mission file already has some.
2009-03-07 22:53:07 +00:00
karajorma 9e61bb1df9 On reflection Mantis 1861 is also going to affect creating a new mission as well. Might as well fix that too. 2009-03-06 20:53:26 +00:00
karajorma 26dfa5f47f Fix Mantis 1861 (Texture Replacements don't initialise properly in FRED). 2009-03-06 19:03:51 +00:00
Wanderer e302a90a1e add 'missing' casts 2009-03-06 15:08:16 +00:00
karajorma bec2409fba Fix a warning where ai_do_objects_docked_stuff was being called twice on clients during multiplayer mission load. 2009-03-05 20:43:34 +00:00
karajorma 812e480bb3 That should only be called once per mission. 2009-03-02 20:41:31 +00:00
karajorma d704a450cb Some minor fixes including getting rid of the vestigial Determination setting from everything except the mission file itself. 2009-02-25 15:41:23 +00:00
Wanderer 4ea1424e64 possible fix for the missing thruster glow names.
changed phrasing of unrecognized type subsystem issue to less severe.
forced game to warn only once if exceeding max ship classes.
2009-02-25 14:50:59 +00:00
chief1983 0272c785dd Taylor's fix for the OpenGL error in the debug log
http://www.hard-light.net/forums/index.php/topic,61170.msg1207696/topicseen.html#msg1207696
2009-02-23 17:10:14 +00:00
Wanderer 8e83b3f502 fix for mantis 1862 2009-02-03 13:42:30 +00:00
karajorma 2d495a3c15 Serves me right for saying it was working. 2009-02-03 00:12:18 +00:00
karajorma e57d4ff5f2 Argument SEXPs shouldn't be included when searching the tree for arguments. 2009-02-02 17:17:31 +00:00
Wanderer 6e0200d27e fix for mantis 1875 2009-02-01 13:13:18 +00:00
karajorma 38eff95a7f Fix a bug with in-sequence and invalidate-argument. 2009-01-28 22:41:57 +00:00
karajorma d6f28ceb97 Fix Mantis 1867 (String-equals didn't work with nested arguments) 2009-01-24 22:36:45 +00:00
Goober5000 b8375fa785 being meticulous 2009-01-20 05:49:27 +00:00
phreak d5f2b68044 Cutscene bars fix, try #2 2009-01-20 05:19:35 +00:00
Goober5000 afd60862ab fix for Mantis #1851 2009-01-20 04:18:14 +00:00
Goober5000 deaad91241 possible fix for Mantis #1853 2009-01-20 03:46:49 +00:00
Goober5000 6842f9d910 don't CTD on sexps that are too long (Mantis #1852) 2009-01-20 03:38:09 +00:00
Goober5000 eb862504f4 preserve texture replacement upon name change (Mantis #1695) 2009-01-20 00:35:58 +00:00
Goober5000 ec427000eb hopefully final revision of the callsign code 2009-01-19 20:56:36 +00:00
phreak 87dd770d93 Cutscene bars fix using gr_set_clip instead of gr_rect. 2009-01-19 03:48:45 +00:00
Goober5000 39efcaf386 just for sanity's sake, default to 0% limit for support ships repairing hull 2009-01-18 04:01:09 +00:00
Goober5000 a58ae3d02e revert changes to close out issue #1870 2009-01-18 04:00:15 +00:00
karajorma 2f0c86dd01 Get rid of the ping message when the HUD is turned off 2009-01-15 21:33:32 +00:00
phreak 98e1d6b56f Fix for Mantis #1870 2009-01-15 01:07:35 +00:00
karajorma 6d8ca2c14b Make the player orders error message a little clearer. 2009-01-05 17:51:02 +00:00
karajorma d448ff3632 Mantis 1633 (No orders for player ships) appears to have been due to two different bugs. This should fix the one I missed earlier. 2009-01-04 17:10:51 +00:00
karajorma 978f5f363f Add a 3rd save format to FRED thereby making the current forward compatibility of save game optional. 2009-01-03 14:54:15 +00:00
chief1983 51a6901dae OpenGL tweaks from Taylor's 3610 patch and a big fix for OS X graphics - Thanks Echelon9! 2009-01-03 02:39:11 +00:00
chief1983 da0dbe84b3 Standalone GUI minimize from Taylor's 3610 patch 2009-01-03 02:37:45 +00:00
chief1983 6fc6267fca Fix for movie playback from Taylor's 3610 patch 2009-01-03 02:36:59 +00:00
chief1983 f5f0713345 Fix for fighter beams from Taylor's 3610 patch 2009-01-03 02:36:22 +00:00
karajorma 054d745ece Fix a bug whereby initial orders were being ignored on the standalone. Maybe fix Mantis 1815 (Starting wings play dead on standalone). 2008-12-30 21:33:35 +00:00
phreak 53492408c9 Change FRED version and title bar from 3.6.9 to 3.6.10 2008-12-25 04:13:43 +00:00
Goober5000 506ee1f517 choose the last persona found as the Command persona, not the first, since that's how retail does it 2008-12-22 05:30:21 +00:00
Goober5000 58b171ce76 bah 2008-12-21 21:36:42 +00:00
Goober5000 673f10485b this ought to fix bomber+ according to the way $smart secondary weapon selection was set up 2008-12-21 21:34:37 +00:00
Goober5000 1323b85c9d roll back Wanderer's fix 2008-12-21 21:18:00 +00:00
Wanderer f80572c172 fix mantis 1802
fix possible issue with subsystem fixup
fix - via ai_profiles - AI with bomber+ flag
2008-12-21 19:46:38 +00:00
karajorma 25c6d6340c Use fout_version for +Use Table Score and +Assist Score Percentage 2008-12-21 13:08:12 +00:00
Goober5000 33034e581b we probably only want to use fout_version when we have actually pushed a FSO version
(hopefully this should fix the sprawling version-specific commenting)
2008-12-21 07:45:38 +00:00
karajorma 88f71ef237 Fix a multiplayer bug where names like Alphabet were assumed to be in Alpha wing 2008-12-20 22:10:29 +00:00
Goober5000 69b0a7a250 skybox model should be 3.6, not 3.6.10 2008-12-20 19:53:55 +00:00
phreak cd7ce4e88b Fix crash due to revision 5006 2008-12-20 16:54:24 +00:00
Wanderer c37055ea42 possible fix for Mantis 1802 2008-12-19 22:23:31 +00:00
chief1983 b7a51a86b5 Commit WMC's fix for icon briefing lines that don't get deleted (Mantis 1763). 2008-12-17 07:54:55 +00:00
chief1983 af9eea721c Revert changes done to fix bug 1645 (it'll have to wait) 2008-12-17 07:38:38 +00:00
phreak 6ba6544036 Made the cutscene list dynamic 2008-12-16 22:07:21 +00:00
karajorma 2835c6950b Restore Assist Score Percentage saving. 2008-12-15 22:11:57 +00:00
Wanderer 0562982e02 warn the user of 'div by 0' issue 2008-12-15 20:25:49 +00:00
karajorma 3dd6ce5bb7 That's probably had a rather large knock on effect with the version saving code. 2008-12-15 18:47:43 +00:00
phreak 04f77b4e7c Add code project as a depedency of the Freespace2 project 2008-12-14 21:44:27 +00:00
phreak be97108d6c Fix a bad memset 2008-12-14 21:33:53 +00:00
Goober5000 adbb60d8bc fix algorithms for any-of, every-of, and number-of to align with or and and, respectively 2008-12-14 08:47:27 +00:00
phreak 28a408deee Possible fix for mantis #1843 2008-12-14 08:11:14 +00:00
Goober5000 6208959b49 whoever made this change forgot about operator precedence 2008-12-14 07:20:56 +00:00
phreak ee75c69ab9 Edit workspace file to use relative paths 2008-12-13 17:25:16 +00:00
karajorma 548faf84bc Fix the <argument> option not appearing when there were no other options on the list 2008-12-13 10:09:59 +00:00
karajorma 90ea4099fb Fix a bug where you could supply add-background-bitmap or add-sun-bitmap with a string variable which then couldn't be used. 2008-12-12 17:38:23 +00:00
phreak e1416453a8 This stops the crashing as demonstrated by Mantis #1844, but I don't know why or if it is correct. Could someone please look at this? 2008-12-12 14:38:28 +00:00
chief1983 d18a78ef05 Must have fatfingered some keys when I wasn't paying attention. 2008-12-10 17:48:29 +00:00
chief1983 8406bfada6 Hopefully this will actually let it load the 2d without breaking WCS again 2008-12-09 23:51:13 +00:00
phreak 23742e8261 Turning an Int3() into a Warning() 2008-12-09 13:02:30 +00:00
chief1983 f75be11102 Only PCX and DDS work for Squad Logos.
Slight tweak of the open file dialogs.
2008-12-08 16:45:07 +00:00
phreak 1d453b80f2 Add code::blocks support. To compile you will need to install the following library packages SDL, openal, ogg, vorbis, vorbisfile, theora, lua5.1, jpeg, GL, GLU. Currently, it has two types of outputs: Debug (standard debug build), and Release, which optimizes using -O3 and -march=core2 (because my laptop is a core2). Probably could experiment with additional compiler options to improve speed. 2008-12-06 21:24:14 +00:00
chief1983 b290f5281a Add Ship Choice 3d for TBP flag as well since lack of will crash debug builds, and fixed whitespace on that particular section of code. 2008-12-06 20:23:24 +00:00
chief1983 89a7c1e0f4 Force 3d Shockwave and 3d Weapon Selection command line option when The Babylon Project command line option is on, since their default launcher.ini does not have those and not having these options breaks things in TBP. 2008-12-06 00:44:44 +00:00
karajorma 6f32344d45 Fix the FRED undo function. 2008-12-05 23:06:17 +00:00
chief1983 fb37f654f0 Allow DDS, TGA and JPEG files for squad logos (TGA and JPEG need testing) 2008-12-04 23:15:18 +00:00
chief1983 9c0dbb7acb Add 3d Shockwave to All Features On and Default Off lists 2008-12-04 20:47:45 +00:00
chief1983 5c12c0ef48 Redo that fix again - tolower wins, but don't chdrive on non-Windows platforms
Made a variable more semantically correct
2008-12-04 20:17:51 +00:00
karajorma e55577111e Fix Mantis 1835 2008-12-04 19:32:21 +00:00
chief1983 61891ed5ec Fix the cause of the problem in Mantis #1748 in both chdir functions in case it becomes a problem elsewhere down the line 2008-12-04 17:56:53 +00:00
chief1983 84e6b6eabe Rest of the different fix for 1278 (only my second commit and I already goofed) 2008-12-04 17:40:28 +00:00
chief1983 1f5444b850 Different fix for 1278 - It's a bit more flexible. Use ai_profiles to allow/disallow entering multi with no primaries or secondaries 2008-12-04 17:38:11 +00:00
chief1983 d12f0c7ae9 Fix for disabled 3d shockwave flag when 2d shockwave doesn't exist - fallback to 3d anyway 2008-12-04 17:27:26 +00:00
phreak 3736999bdc Possible fix for mantis #1748 (FRED2 Crashes when squad logo button is pressed). 2008-12-03 05:40:35 +00:00
karajorma 93bb980ff3 Fix gibberish entries in file dialogs. Maybe fix Mantis 1748 2008-12-02 21:42:04 +00:00
karajorma 4862747454 Since the player ship is the default for most of these SEXPs they should not be greyed out just cause it is a player start rather than a ship 2008-12-02 21:14:23 +00:00
karajorma 42b5befef0 Fix Mantis 1733 (String variables required a valid default value when used in SEXPs even if that value would never be used) 2008-12-01 22:34:38 +00:00
karajorma 78cda09d2c Fix Mantis 1822 (Cannot use variables in add-background-bitmap or add-sun-bitmap) 2008-12-01 17:29:24 +00:00
karajorma b06a4a5349 Widen the primary and secondary combos in the weapons editor. 2008-11-30 20:00:02 +00:00
karajorma 21d258925d Typo 2008-11-30 14:56:45 +00:00
karajorma d6399427ff Print an error to the log when too many messages are in the queue rather than breakpointing. 2008-11-30 14:55:58 +00:00
phreak 4bf6b83e93 whoops 2008-11-30 14:13:28 +00:00
karajorma 07d6f2bff9 Fix add-background-bitmap and add-sun-bitmap to display a list of bitmaps from the tables properly. 2008-11-30 13:01:30 +00:00
phreak 1bc83969ac fix the message variable parsing the right way (mantis #1831) 2008-11-27 01:38:28 +00:00
karajorma aa7fc2d713 Fix Mantis 1825 (Int3() when trying to change a ship flag on a ship which self destructed) 2008-11-26 23:19:31 +00:00
phreak 4a4268e77d Fix Mantis #1831 2008-11-25 22:05:39 +00:00
Goober5000 66019a11ca add ai_profiles flag for Mantis #1422 2008-11-24 02:35:20 +00:00
Goober5000 219c7541f8 if a ship or weapon is allowed, allow all its # equivalents (further insurance against the Interceptor#Weak problem) 2008-11-24 02:13:13 +00:00
Goober5000 09d116f667 prevent form-on-wing goals from overriding everything else
this should fix the AI bug that revision 2170 applied to all wings (not just starting wings)
this should also fix the bug where Alpha wing couldn't be issued orders via sexp, even in retail
2008-11-24 00:01:00 +00:00
phreak 8c521c771b Add some preprocessor macros to aid in debugging. Nothing is on by default, but when enabled, the macros will force windowed mode at various resolutions. 2008-11-22 20:56:30 +00:00
karajorma cfa7e2d7c8 Fix Mantis 1823 (Rand SEXP only has 16-bit precision) 2008-11-20 20:03:14 +00:00
phreak 6d13cce780 Apply the time limit check when starting a co-op game to the kill limit as well. 2008-11-19 23:45:43 +00:00
phreak d1f6caaaaa Fixed Mantis #1675 2008-11-19 16:12:05 +00:00
phreak 871b316add Fix Mantis #1278 2008-11-19 15:31:30 +00:00
karajorma 9eb55188d5 Fix Mantis 1824 (Cargo containers disappear when using change-ship-class SEXPs) 2008-11-19 08:00:05 +00:00
phreak 9b7fff7e99 more fixes that deal with mantis 1564 2008-11-18 03:30:13 +00:00
karajorma 53143dee9c Allow AI-goals to be assigned to a ship represented by an <argument> 2008-11-17 17:57:45 +00:00
karajorma a6bae2c557 Fix the Decline error message that crops up in multiplayer sometimes and get rid of the PAIN! entry in the log. 2008-11-14 09:15:19 +00:00
karajorma 55aea5cf13 Fix Mantis 1633 (Initial orders for multiplayer Player Starts that end up AI controlled are ignored). 2008-11-13 21:21:00 +00:00
taylor 643a1aa230 standalone changes:
- add score/kill values to Player Info tab
 - add multi.log out to the Debug tab
 - add minimize-to-tray functionality
 - fix messaging problem with property sheet handled messages
2008-11-11 01:09:01 +00:00
taylor fe03b667cd remove bad checks for loadout info (we are screwed if the info is bad regardless, so making it Assert() is cleaner)
fix bug that screwed up TVT if more than 4 ships on team
2008-11-11 01:03:38 +00:00
taylor 570e4cb1e6 make sure that a positive hull precentage doesn't hit 0 due to rounding error (Mantis #1720) 2008-11-11 00:59:19 +00:00
taylor 2c45dbbb5f give multi clients a short delay on briefing music to reevaluate goals if needed (should fix/reduce Mantis #1465) 2008-11-11 00:58:19 +00:00
phreak 307106f983 Got rid of goto statements 2008-11-11 00:09:30 +00:00
karajorma 68c51f242a Fix Mantis 1812 (Ship-Deaths reported incorrectly for player starts controlled by AI ships) 2008-11-10 19:31:07 +00:00
taylor ad1c5055d4 address some rounding issues with integer based percent values (Mantis #1807) 2008-11-09 05:09:51 +00:00
taylor 3abccfa76c sync up to current FS2NetD code (fixes so many little problems/issues that it's not even funny) 2008-11-09 05:08:19 +00:00
karajorma 42683318f7 Fix Mantis 1044 (Campaign Editor crashes in release builds but not in debug) 2008-11-06 20:42:23 +00:00
phreak f4ba5d0bb2 Apply Spicious' patch from http://www.hard-light.net/forums/index.php/topic,57573.0.html 2008-11-04 05:21:00 +00:00
phreak 8d70f8c15f Mantis #1800, take 2 2008-11-03 00:04:26 +00:00
karajorma 73f924163c Surprised this wasn't committed before. 2008-10-30 20:39:47 +00:00
phreak 83a57be996 Possible fix for mantis #1800. Don't ask me how I came up with the numbers I used, I'm not too sure myself. 2008-10-30 04:04:54 +00:00
taylor 50cc1331ae put a 1/2 sec delay on the next secondary so we don't fire immediately after respawn (Mantis #1118) 2008-10-28 18:18:12 +00:00
taylor 1b5f722967 make disband wing work properly (Mantis #1680) 2008-10-28 18:16:08 +00:00
taylor 33ab6d34ef fix weapons carry check to work properly for multi (Mantis #1624) 2008-10-26 14:42:03 +00:00
phreak d7fd6b4454 Possible fix for mantis #1564 2008-10-26 02:57:36 +00:00
Goober5000 028bfecc70 fix another spawning weapon bug 2008-10-24 22:57:40 +00:00
Goober5000 e6b801595b fix bugs caused by missing parent when weapon-create creates missiles 2008-10-24 22:17:02 +00:00
Goober5000 d3f38e26bc fix a bug in weapon-create argument validation 2008-10-24 21:14:24 +00:00
karajorma d4305fbd85 Set the type correctly for modify-variable (it used to assume all variables were numbers). Fix setting string variable to the value of another string variable (again). Solve a couple of other minor assertions and crashes. 2008-10-24 16:54:59 +00:00
taylor 70059a94d6 make sure that we update our subsystem in-use count when removing subsystems
(fixes bug where it just keeps wanting more memory but doesn't really need it)
2008-10-24 09:05:54 +00:00
taylor 262c3178e9 more if-statement fixing
fix the fix so that it's actually fixed (re: Mantis #1676)
2008-10-24 09:03:46 +00:00
Wanderer 91dd16167b patch to improve turret subsystem targeting 2008-10-23 15:38:57 +00:00
taylor 862d6f43db mode if statement fixage 2008-10-23 13:27:21 +00:00
taylor 966ec358e9 fix bogus ml_printf strings
use ml_string over ml_printf where possible
remove newlines from ml_* calls, since it gets added already
2008-10-23 13:26:35 +00:00
taylor 6ed6ecbfb8 be sure that we sort the mission list properly for a host that isn't the master (for consistency with host-master behavior) 2008-10-23 13:25:19 +00:00
taylor 1062040fbf output warnings, errors and asserts to debug log for Linux/OSX
allow -no_warn to skip asserts like it does on Windows builds (for consistent behavior)
2008-10-23 13:23:45 +00:00
taylor 0f01a1bd4c this assert will happen during normal multi play, nothing ingame related 2008-10-23 13:22:11 +00:00
taylor 0b1ea9a58d restart sounds/music on game browser screen (Mantis #1279) 2008-10-23 13:21:02 +00:00
taylor 19c1520dba final part of the fighter beam fix; freaky as it is, it actually managed to not break anything :D (Mantis #1795) 2008-10-23 13:00:21 +00:00
Wanderer 3032a0f5d9 added 2 missing newlines to debug spew 2008-10-23 10:09:12 +00:00
Wanderer fbe14f5a5e improved readability per taylor's suggestion 2008-10-23 06:47:12 +00:00
taylor c4b763680c fix stupid bug that messed up last flight date (Mantis #1274) 2008-10-23 04:51:02 +00:00
taylor 60fca98974 set player speed after respawn to be initial velocity specified in mission (Mantis #1198) 2008-10-23 04:49:24 +00:00
taylor 15dbb9e8b4 basic fixing for cmeasure handling over the network, not 100% without packet breaking though (Mantis #1098) 2008-10-23 04:47:41 +00:00
taylor 9bce69ef79 ingame join related crash fix (the correct value is put in after mission sync) 2008-10-23 04:44:25 +00:00
taylor fdcaebfad3 pass correct object to primary cycling (fix for multiplayer) 2008-10-23 04:43:19 +00:00
taylor ef0c0e994b fix V's "hack" so that it actually works and doesn't leave unused objects hanging around 2008-10-23 04:41:19 +00:00
taylor 249b8496e3 fix some NaN that gave invalid values in the standalone UI 2008-10-23 04:39:54 +00:00
taylor 7c944ed2a3 fix some weird signature checks from retail code 2008-10-23 04:38:17 +00:00
Wanderer aab688222c allow option to prevent turrets from targeting too distant bombs 2008-10-23 04:30:09 +00:00
Wanderer acc7fa2b16 fix for surface shields selecting wrong hit quadrant 2008-10-22 13:56:19 +00:00
Goober5000 1ccfa433d6 one last fix 2008-10-21 21:37:37 +00:00
Goober5000 a832c11585 hopefully this should be the last on Mantis #1785 (the callsigns) 2008-10-21 06:17:44 +00:00
Goober5000 10340678cb Keldor's fix for callsigns not getting translated 2008-10-21 06:05:30 +00:00
Goober5000 a82b7862d8 fix a warning 2008-10-21 02:20:18 +00:00
Wanderer 2ccbedd071 added +noreplace to ships flags to allow adding flags
added +override to muzzleflash.tbl
added +override to weapon flags
2008-10-20 18:51:51 +00:00
Goober5000 280b979d09 try to keep up with Nature producing bigger idiots :( 2008-10-19 20:25:30 +00:00
Backslash 8a2af2b13b My bad. No need to cap the ammo here. I had used the wrong variable anyway. Fixed. 2008-10-17 10:12:48 +00:00
phreak 400e950190 Fix Mantis #1799: Crash on "Mystery of the Trinity" 2008-10-16 04:09:38 +00:00
taylor 36ac0cb908 make sure that we don't re-save a deleted pilot in the barracks (Mantis #1794)
fix pilot deletion proceedure to not provide useless failure handling (if it fails to delete once, it will fail every time)
2008-10-16 00:41:35 +00:00
taylor ae062bcc0b make debris render properly in wireframe mode in hud targetbox and in ships lab (Mantis #1797) 2008-10-15 22:15:24 +00:00
Backslash 4d0f978e1c Fix 'cycle' behavior when $Shots is more than 1. 2008-10-15 06:31:18 +00:00
taylor 4f7744cf36 fix bug where changing turret_targeting_order[] to have asteroids earlier in the order would skip further checks 2008-10-14 17:09:09 +00:00
taylor acf1aa60ac get rid of some useless/annoying debug messages 2008-10-14 16:58:26 +00:00
taylor e44de24957 fix for fighter beams in multi (Mantis #1795) 2008-10-14 16:57:23 +00:00
taylor 6e42152761 better version of the earlier ab_count fix 2008-10-14 16:42:33 +00:00
taylor 251f52796c when sorting the mission/campaign list be sure that we keep our current selection
when loading the mission/campaign list for the first time make sure that we always select the first element in the list
2008-10-14 16:40:42 +00:00
taylor c5f9ba424c add exports to map file
generate program database for release builds (doesn't make build bigger, .PDB allows finding of source/line given error address)
2008-10-14 16:38:39 +00:00
taylor d23e80bdef fix some bad if statements 2008-10-14 16:35:49 +00:00
taylor ddd6ce2cf6 update to build with current code (Mantis #1796) 2008-10-14 08:30:54 +00:00
taylor f2e2297e9f disable const string warning (that thing was just plain annoying) 2008-10-13 06:38:03 +00:00
taylor 0253d298e9 only load tbls from tables/ (Mantis #1725) 2008-10-13 06:34:48 +00:00
taylor f6d26f915a bunch of out-of-bounds fixage 2008-10-13 05:57:57 +00:00
Goober5000 941faf9ab9 fixed a number of bugs with Electronics missiles that were present ever since 2003 :( 2008-10-12 21:57:40 +00:00
Goober5000 d0af5c2169 move the Electronics tag to its proper place 2008-10-12 19:44:27 +00:00
Goober5000 05769b3ffe fixed "bastion" debug console command to work for all main halls
added "medals" debug console command for testing
2008-10-12 19:44:06 +00:00
phreak 6a3cf80be0 Add additional filename extension filters to fix Mantis #1484 2008-10-11 12:08:09 +00:00
karajorma 55c8720e90 Fix Mantis 1791 (invalidate-argument did not work with multiple matching arguments) 2008-10-09 21:13:26 +00:00
Turey e461625622 Mantis 1584: Enabled F(n) keys during popups. 2008-10-08 03:02:15 +00:00
taylor f598aafeb0 more class_type fixage from r4638 2008-10-07 20:47:03 +00:00
taylor 71e948278b don't call gr_activate() in Assert macro
log asserts properly when using the -no_warn flag
(though asserts aren't really warnings and should not be turned off, it could be argued that many of our asserts don't belong)
2008-10-07 20:31:04 +00:00
taylor ee57fa59ca make sure that we reset the state properly after an ident failure (Mantis #1735) 2008-10-07 16:28:22 +00:00
Wanderer dbe8e071bb fix for ab_count crash issue on mission reload 2008-10-06 18:05:37 +00:00
taylor 27f2f168dc fix fs2netd shutdown/cleanup code to work better (gets rid of various little issues) 2008-10-06 05:52:25 +00:00
taylor beafe688bb don't really need to bother with MAX_SERVERS any longer since it's ultimately dynamic 2008-10-06 05:51:20 +00:00
Goober5000 01c783e27d if ship names are hidden but a callsign is supplied, use the callsign 2008-10-05 21:58:16 +00:00
Goober5000 c7b8cd7021 alt names should now work in FRED (including the voice acting manager) 2008-10-05 21:29:45 +00:00
Wanderer 6ca5bdcffa Added warning to help preventing invalid ship types. 2008-10-05 13:50:44 +00:00
taylor 18b2922455 a fix/workaround for Mantis #1692
bunch of standalone fixage for error reporting and various little signon issues
fix heartbeats for standalone servers
make proper use of +pxo in multi.cfg for standalone so that games can show up in the lobby
client-side fix for getting pilot stats in lobby (Mantis #1652)
2008-10-05 13:31:35 +00:00
taylor de28613166 add separate standalone options for setting FS2NetD login/password (gets around FS2NetD server game listing issue) 2008-10-05 13:24:06 +00:00
taylor 9a3a1b051e no magic numbers 2008-10-05 13:19:13 +00:00
taylor 8650ee98bd start up mainhall music/ambient when in the lobby (Mantis #1761) 2008-10-05 13:16:42 +00:00
taylor a4889e49e9 fix standalone crash when server name/password is too long in multi.cfg 2008-10-05 13:15:10 +00:00
taylor fcb28b51f1 better error handling for when TCP socket is already in use (Mantis #1626)
fix missing protocol XSTR that used the wrong tstring for display
2008-10-05 01:17:45 +00:00
taylor 7938c36df2 you are never guaranteed a valid class_type (fixes Mantis #1742) 2008-10-04 20:48:07 +00:00
Swifty ceea88037c Fix the rest of the Visual Studio project files such that FRED can compile. 2008-10-03 00:04:52 +00:00
phreak d17ea1d102 Update fred to include trackir libs 2008-10-02 17:32:54 +00:00
Swifty db5767b18a Added missing semi-colons. 2008-10-02 06:50:15 +00:00
Swifty 04fc426d90 Statically link TrackIR support; FS2_TrackIR.dll no longer required at run-time. 2008-10-02 05:58:01 +00:00
phreak 4524583f06 Disable the mouse when lost focus in windowed mode. 2008-10-02 00:57:10 +00:00
phreak f445aedaf1 Get rid of some repeated code. 2008-10-01 22:50:13 +00:00
phreak 666cbd4bc5 Get rid of windows system ding sound when pressing ALT and another key while windowed mode is active. 2008-10-01 05:36:40 +00:00
phreak 99446022fc It may be a hack, but this seems to fix that one pixel line seen on the bottom and right side of the screen when faded to a solid color. 2008-10-01 04:04:39 +00:00
Goober5000 d37828e00a fix linked primary behavior to be based on percentage, not absolute value, as expected (Mantis #1778) 2008-10-01 00:44:11 +00:00
Goober5000 818b6a40ac re-bump alt names
fix hidden ship names for voice acting manager
2008-09-30 23:50:14 +00:00
karajorma 3bc9a692af Fix Mantis 1774 (when-argument within when does nothing) 2008-09-30 17:36:12 +00:00
karajorma 9ef6d889d3 Fix compiling on OSX...apparently. 2008-09-30 15:52:53 +00:00
Goober5000 a0344aefae uninitialized pointer bugfix and cleanup to hud_stuff_ship_name / hud_stuff_ship_class
send messages with ship class rather than ship name if ship name is hidden
2008-09-29 04:47:23 +00:00
Goober5000 f0e53971f6 redo the callsign feature to be independent of the alt name
(fixes Mantis #1785)
2008-09-28 23:05:03 +00:00
Goober5000 8340ed5943 add Keldor's fix for Mantis #1779 2008-09-28 20:58:28 +00:00
Goober5000 89d3b62524 make CAR and CDR fail-safe 2008-09-28 19:28:22 +00:00
Goober5000 fdd2daebad don't hide information when displaying ship callsign
clean up hud_render_target_ship_info a bit
2008-09-28 01:53:54 +00:00
Goober5000 d3509e1aba fix for Mantis #1783 (voice acting manager message senders) 2008-09-28 01:16:07 +00:00
Goober5000 52c04fdf18 add KeldorKatarn's fix for AI afterburning too long 2008-09-28 00:26:56 +00:00
phreak 42b5c942f5 Allow .jpg files to be loaded out of VPs when in the "interface" subdirectory. 2008-09-26 04:59:12 +00:00
phreak b2f21047da Add KeldorKatarn's patch for mantis #1776 2008-09-25 03:55:24 +00:00
phreak c3e32613d7 Fix for Mantis #1767: Fix invisible ships upon knossos warpin 2008-09-25 03:45:57 +00:00
phreak 146d3cdd8f Fix for mantis #1773. Check null pointers 2008-09-25 01:58:40 +00:00
phreak 16a3ed9f4b Seperate 3d ship and weapons selection into their own command line options. 2008-09-25 01:15:30 +00:00
phreak b5cc4e46fb Render the lens flare even if the parent sun is off screen as some lens flares are much larger than their parent star and they magically disappear as soon as the center of the star leaves the FOV. 2008-09-18 00:33:59 +00:00
phreak 485a98ac3e Fix radar orb rendering (It was using the incorrect rotation matrix). Also enable alpha blending on the orb axes. 2008-09-18 00:30:54 +00:00
WMCoolmon 4e872096b1 Fixed secondaries using the laser renderer 2008-09-17 00:10:05 +00:00
phreak 0248c6988a Ensure the larger keyframe is chosen when looping the weapon loadout animations. 2008-09-16 04:51:36 +00:00
phreak 3189278d43 Do the same thing for ships that the previous commit did 2008-09-15 23:21:41 +00:00
phreak 9278f421ad Honor the keyframe value in the weapon loadout animations. If less than 2 keyframes are defined (first frame and return frame), then the animation will treat "52" as the keyframe value (retail default).
All 1024x768 weapon loadout animations have 0 and 52 set as the keyframes so they render properly.
2008-09-15 23:05:05 +00:00
phreak 0f13bcee06 Fix for Mantis #1562: Lens flares visible if sun behind asteroids. 2008-09-15 01:51:20 +00:00
phreak f78749be88 Ensure target_engines pointer is initialized. 2008-09-14 21:55:34 +00:00
Goober5000 b784bb6cff revert changes from 4801 (Phreak's fix for >4GB memory reporting)
c.f. http://www.hard-light.net/forums/index.php/topic,56409.0.html
2008-09-14 20:29:03 +00:00
Goober5000 0ae4939981 re-fix WMC's bug to be compatible with expected behavior 2008-09-14 19:29:07 +00:00
phreak 2c34c391d2 Fixed nebula render bug for Mantis #1765 2008-09-14 19:05:30 +00:00
phreak 14c478376b cleanup find_homing_object() 2008-09-14 18:51:38 +00:00
phreak 8bf826793a Change output executables to 3_6_10 2008-09-14 17:05:59 +00:00
karajorma 58fc12fc57 KeldorKatarn's afterburner lock SEXPs 2008-09-13 22:21:38 +00:00
taylor 61ef271683 update with current official SDL framework (should fix Mantis #1727) 2008-09-13 14:41:57 +00:00
taylor 81811ff842 if max shield strength is 0 then disable shields (rest of Mantis #1645) 2008-09-13 14:40:06 +00:00
karajorma 455180fa4a Fix Mantis 1088 (Extra call to ai_do_objects_docked_stuff() )
Remove the banks_fired Assert. WMC is correct. We don't need it anyway.
2008-09-10 11:24:00 +00:00
phreak 25b56bfac6 Add updated freespace2 icons 2008-09-08 23:01:22 +00:00
Swifty 7e047b5c98 WMC's fix for RTT indexing and fix unnecessary slewing for 3D HUD elements. 2008-09-06 07:51:50 +00:00
Wanderer ac4fb52604 Fix for mantis 1736 2008-09-05 21:59:55 +00:00
Swifty 57fbb21c62 Fix for Mantis 1743: Targets don't shudder with the rest of the HUD. 2008-09-05 07:57:40 +00:00
phreak 21aa72ae2f Fix memory detection for systems with > 4GB of RAM. 2008-09-04 20:40:57 +00:00
karajorma 04e4095b36 Arguments within arguments (again). It should work this time round. 2008-09-04 20:38:14 +00:00
phreak 38abe31509 Possible fix for Mantis #1669 2008-09-01 03:09:00 +00:00
karajorma 3b6e62805f Fix Mantis 1545 & 1754 (Order SEXP doesn't work with wings or destroy subsystems properly)
Add the Query-Orders SEXP 
Deprecate the Order SEXP
2008-08-31 21:04:44 +00:00
WMCoolmon 4bff232cad Change set-fov back to a global override 2008-08-30 19:48:20 +00:00
WMCoolmon ddf75fc7e0 Final scripting, camera code updates. 2008-08-30 11:05:48 +00:00
WMCoolmon b4b2f7d54f Fix for mantis 0001211 2008-08-30 11:04:12 +00:00
WMCoolmon e71d060984 Core all-RTT code. 2008-08-30 11:03:03 +00:00
WMCoolmon c9e3d746d4 Added object_get_model; moved object_h to object.h 2008-08-30 11:02:36 +00:00
WMCoolmon 9d4bad1c7f Input updates for scripting 2008-08-30 11:00:11 +00:00
WMCoolmon 74a6636bc6 Attempted HUD shake fixes 2008-08-30 10:59:10 +00:00
WMCoolmon 19ed659d6b Minor idiotproofs 2008-08-30 10:58:44 +00:00
WMCoolmon 48d8f030b3 Better compatibility with avoiding the main hall 2008-08-30 10:57:27 +00:00
WMCoolmon 7ef7959d77 all-texture replacement code 2008-08-30 10:56:28 +00:00
WMCoolmon 6c7ccad82f Attempted HUD shake fixes 2008-08-30 10:56:04 +00:00
WMCoolmon 36e44e7f2b hud_get_draw, custom subsystem names in HUD subsystem damage list 2008-08-30 10:54:44 +00:00
WMCoolmon 6cfab94ef0 New camera code 2008-08-30 10:52:32 +00:00
WMCoolmon 9764ce9ea8 Replace Assert with smooth failure. 2008-08-30 10:52:08 +00:00
WMCoolmon d0808e2bf0 New camera code, cutscene bar fixes 2008-08-30 10:51:21 +00:00
WMCoolmon d2e4d0d6ee Support for all-texture-type texture replacement. 2008-08-30 10:50:49 +00:00
WMCoolmon 699ac0f2bd FRED support for new camera code and texture replacement of all texture types 2008-08-30 10:49:22 +00:00
WMCoolmon 39d623c7c2 ship_wing_point_or_none SEXP type 2008-08-30 10:48:46 +00:00
WMCoolmon 5404b776aa Support for custom warp sounds 2008-08-30 10:47:50 +00:00
WMCoolmon 5a72f40f62 Fix unneeded use of doubles 2008-08-30 10:47:16 +00:00
WMCoolmon 525e45db77 Updated objsnd API 2008-08-30 10:46:23 +00:00
WMCoolmon 3f02f79b3d New camera code, warp code updates, debris attributes, fix large numbers of ships being created at the same time, delta bank. 2008-08-30 10:45:41 +00:00
WMCoolmon 9360d3b580 Prevent "Alt-Alt" from textify_scancode 2008-08-30 10:43:37 +00:00
WMCoolmon f51a8cf3c0 New camera code core commit, delta bank code. 2008-08-30 10:42:27 +00:00
WMCoolmon 743c9eb82d Update to use new camera code. 2008-08-30 10:41:31 +00:00
WMCoolmon 752bff94cc Updated to use new texture map class. 2008-08-30 10:41:01 +00:00
WMCoolmon fd7cbf5750 - Fixed bug involving too many goals being assigned to a ship from wing orders 2008-08-30 10:37:51 +00:00
WMCoolmon 13eb0e77e4 Fix for mantis 0001737 2008-08-30 01:21:54 +00:00
WMCoolmon 896b61f2fe Fix glowpoint option in lab not working (thanks blowfish) 2008-08-30 00:24:10 +00:00
Goober5000 1859ae688e Mantis #1755: stars should not be drawn when there's a skybox 2008-08-26 01:28:30 +00:00
phreak 943ee9b8a2 Add Fred to the list of executables automatically built in debug mode. 2008-08-22 15:05:12 +00:00
karajorma 81a851e33a Revert argument changes till I can figure out why they crashing VC6 builds but not 2005 ones. 2008-08-20 20:45:45 +00:00
phreak 97951efa9d Fix alt-tab and FS2 trying to regain focus. 2008-08-20 04:22:39 +00:00
karajorma 672e34c166 Fix the -argument SEXPs to allow them to cope with conditionals being used within them.
Clean up some code from in-sequence that never worked anyway.
2008-08-19 19:00:54 +00:00
phreak 4ea2ca2b64 Applied blowfish's patch for Mantis #1714. 2008-08-18 23:33:34 +00:00
taylor 61dbdc24b3 fix broken commit from partial Xt merge 2008-08-18 05:56:46 +00:00
phreak 2d79e4eee4 Don't flash the screen red when damaged while invulnerable (either through cheat or sexp). 2008-08-17 22:26:59 +00:00
phreak 1a3e5f28af Fix beam damage when time compression is active. 2008-08-17 21:55:03 +00:00
karajorma 69b61ceaa4 Hmmmmmm. Using a VC2005 keyword as a variable name is just asking for trouble. 2008-08-16 08:13:43 +00:00
Goober5000 ca0df1f2b0 fix a few bugs by rolling back the non-ship-template code from revision 4636
this also fixes the ship spinny thing (which both argv[-1] and Backslash had noticed and fixed previously)
2008-08-16 05:06:38 +00:00
phreak 3f48553935 Add a check to see if the complete escort list is full before adding an additional ship. 2008-08-15 01:37:38 +00:00
karajorma cb6dbe5214 Fix Mantis 1745 (TvT scoring for players kills scales with difficulty) 2008-08-12 20:29:36 +00:00
phreak 52829ea14e Remove check for no-collide-invisible ships when checking to see if a weapon passed it's target. Changed FOV check to allow for missiles with FOV half-angles greater than 90 degrees. 2008-08-11 04:11:46 +00:00
phreak 4e1fdc6c8b Fix for mantis #1744 2008-08-10 21:17:00 +00:00
phreak f419106805 Possible fix for mantis #1728 2008-08-10 21:16:22 +00:00
karajorma bfe417ff2f Add builtin messages for support ships back into TvT missions. 2008-08-10 10:37:20 +00:00
WMCoolmon 3a54776c6b ATTN: Swifty - Mantis #0001707. Update to fix what looks like basic math error on my part. 2008-08-07 01:35:17 +00:00
karajorma 6de7ba0deb Fix Mantis 1605 (Support ships are forever marked as abort on clients after initially called in).
Fix a bug where support messages were sent from the client and the server so they played twice.
2008-08-05 21:25:55 +00:00
WMCoolmon da6fa5a429 Update MSVC2003 project files 2008-08-04 22:54:03 +00:00
karajorma a70c5ffb1d Fix the Run Freespace option in FRED. Still not 100% but it should get a valid name more often than not. 2008-08-04 09:56:40 +00:00
karajorma bcdc1c1589 Fix Mantis 1731 (CTEXT reporting the variable value if a block variable of the same name existed) 2008-08-03 11:39:05 +00:00
karajorma 9a28c24f70 Fix Mantis 1232 (Can't use Zeta in Coop or Beta/Gamma in TvT) 2008-08-02 19:20:58 +00:00
karajorma 4374fcd1ce Fix Mantis 1734 (Block variables appearing in modify_variable menu and SEXP) 2008-08-02 16:53:09 +00:00
karajorma 90e30ee37e Fix a problem with the assertion logging fix I added earlier if the stack trace was too long. Will now log errors too. 2008-07-29 19:25:34 +00:00
WMCoolmon bf23eb17c8 add isPXOEnabled scripting function to Testing library 2008-07-29 04:21:58 +00:00
phreak e10379ad18 Disable UAC for the other project types (debug, and non-sse2 release builds). 2008-07-28 22:14:18 +00:00
phreak d094476101 Remove UAC when building the executables. 2008-07-28 02:51:36 +00:00
karajorma 0a9903f48d Print the stacktrace to the debug log on hitting an assertion. 2008-07-24 20:25:42 +00:00
karajorma a05b1ef11f Allow the player to score from assists and kills in a variety of new ways. 2008-07-24 20:23:52 +00:00
karajorma b3d7dba2a4 Let TvT games use all the skill levels 2008-07-24 20:10:29 +00:00
karajorma a360a8e606 Allow multi_find_player_by_ship_name() to deal with respawning players too 2008-07-24 20:09:21 +00:00
karajorma e44f2c1911 Fix Mantis 1732 (Ship-Guardianing ships destroyed before mission start)
Add change-player/team-score SEXPs
2008-07-24 20:01:30 +00:00
karajorma 5b05ce6028 Update 2005 solution with the shader stuff. 2008-07-24 19:56:27 +00:00
taylor 952c057ff9 add ARB_shader_texture_lod to the stupid SM3.0 test (for OS X mainly) 2008-07-22 15:50:01 +00:00
taylor e1044c578d 2d poofs are supposed to be default (forgot that since I didn't commit the new neb2 code :)) 2008-07-22 12:59:58 +00:00
phreak bba43b5a79 Updated to add new files to the VS2008 project. 2008-07-18 20:26:27 +00:00
taylor f2f6bef1fa damn, forgot these 2008-07-16 07:50:58 +00:00
taylor 9231692e48 basic commit of a few Xt tree changes
- updated OpenGL code (basic shader support, etc.)
 - new ships lab code
 - scripting RTT fixes
 - don't let FRED hog CPU time
2008-07-16 02:49:19 +00:00
karajorma 6e3aa4a33a A bandaid on the gaping wound that is the current score code for ships. Should stop the missions corrupting themselves with ;;FSO 3.6.10;; messages but missions won't open in 3.6.9 now. 2008-07-14 18:25:41 +00:00
taylor 663ff9d0b1 add part of the Xt texture replacement code which fixed texture page-in issues for late arrivals
(rest of the missing thruster fix)
2008-07-14 03:11:11 +00:00
phreak a9c8558507 Updated to a newer version of glext.h from SGI 2008-07-10 11:34:50 +00:00
taylor d5e1312e19 total_time fixage (it should never be allowed to be zero) 2008-07-10 06:15:56 +00:00
taylor 2494bd0291 various thruster fixage from the Xt tree (should fix Mantis #1450) 2008-07-10 05:58:51 +00:00
taylor 6c255cf1c9 fix HB being sent after server disconnect (made games show up for up to 10 minutes after they had ended)
make the chat channel count update more than once, since that didn't appear to work very well
fix compile error with GCC 4.3
2008-07-10 05:10:31 +00:00
Goober5000 16f8087433 the second half of the Mantis #1271 fix 2008-07-10 03:44:45 +00:00
Swifty 14c7b2c4c8 Mantis 1707: fix for FTL warp effect going out of bounds. 2008-07-08 16:17:49 +00:00
Goober5000 9d5d21c39d d'oh -- fix Mantis #1271 2008-07-08 08:03:31 +00:00
karajorma 466d3a2811 Couple of small changes to make the Standalone work again. 2008-07-07 08:46:17 +00:00
Goober5000 b57c41c6f7 fix incompatibility in sexps between retail and SCP 2008-06-26 21:18:46 +00:00
phreak ebc331324d Properly autocenter the missile models in the techroom. 2008-06-26 02:52:51 +00:00
Wanderer ccbdf0ead1 added startMission lua function 2008-06-24 12:27:49 +00:00
phreak 0fff5c7da0 Fix mantis #1710 2008-06-23 22:09:04 +00:00
karajorma 78d512002e Allow capship beams to take full credit for their kills if a flag is set. 2008-06-23 20:47:26 +00:00
karajorma 7ce2d59bce Doh! 2008-06-23 19:01:08 +00:00
karajorma a10ea210b3 Fix a bug that meant players sometimes didn't get an assist is someone had already earned one.
Make it possible to decide what percentage of the damage a ship receives earns you a kill.
2008-06-23 16:27:14 +00:00
WMCoolmon 89f5949071 The new scripting hooks for mouse/keyboard. 2008-06-23 07:50:47 +00:00
Swifty 1746c4ce94 Even more accurate HUD reticle offset calculations. 2008-06-23 07:39:01 +00:00
phreak 4a2b028463 Get rid of my mixed case old username. 2008-06-23 01:58:02 +00:00
phreak 468bcc6441 Fixed filename cases in the code, fred2, and freespace2 project files. The files were originally mixed-case (from fs2-public) and the mixed-case names would be restored when saving the files. This didn't sit too well with SVN. 2008-06-23 01:54:33 +00:00
karajorma 73aaa87bd3 Change No Debrief to Toggle Debrief. It will now turn on debriefings for dogfight missions (Which otherwise get the kills matrix). 2008-06-22 16:57:35 +00:00
karajorma ea02c08748 Add the Hide-ship-name ship flag 2008-06-22 16:55:29 +00:00
Swifty 87b4f5ef8d Fixed inaccurate slewing HUD reticle as pointed out by Goober. 2008-06-22 08:24:57 +00:00
Goober5000 1dcb42aa5d added missing TrackIR offsets in FS1 HUD code
disabled the entire HUD nose offset system until Swifty can fix the centering algorithm
2008-06-22 04:02:07 +00:00
taylor 0c1d218fb4 fix compiling on F9 (per the standard, limits.h isn't implicitly included) 2008-06-19 04:36:26 +00:00
karajorma d9432e7e82 I'm fairly sure FRED shouldn't be calling that function. Certainly not for BtRL at least as it was causing a crash. 2008-06-18 22:24:56 +00:00
phreak 5b45bf9029 Fix for mantis #1691: Ships disappear at stage 2 of knossos warpout. 2008-06-15 21:02:18 +00:00
Wanderer 6f67df5835 fix for the detail box parsing (issue reported by Water) 2008-06-13 13:18:43 +00:00
WMCoolmon 380b3e658e Move gr_reset_clip into draw_model_rotating, and don't assume that if a NULL closeup pos is passed that it's a missile. 2008-06-11 22:38:28 +00:00
phreak ece785dee7 fix mantis #1682 - weapon ship collisions not applying to ships beyond the warpout clip plane. 2008-06-10 01:14:32 +00:00
phreak db2e91478b Shoudln't forgetting a return statement be an error and not a warning? 2008-06-10 01:13:48 +00:00
phreak 90238d4e69 Mantis #1676 - Prevent particles from appearing during warpout and the particle emitter is beyond the clip plane. 2008-06-09 22:27:21 +00:00
Wanderer 939dcaa849 Fix for mantis #1687 (corkscrew missiles and turrets) 2008-06-09 08:11:27 +00:00
phreak 25c0d647bd Added SSE/SSE2 build configurations. These builds are are optional versions of the release builds with SSE/SSE2 instruction support. 2008-06-09 01:10:43 +00:00
phreak b99f4d98a2 Added additional compiler optimizations for release builds. 2008-06-08 23:53:12 +00:00
phreak 81b3aad776 Add Visual Studio 2008 project files.
The release builds have been configured to use Multi-processor support (/MP) when compiling.
2008-06-07 23:59:05 +00:00
phreak 43407479d5 Alpha blending and line widths for radar orb rings when in HTL mode. 2008-06-03 00:18:58 +00:00
Wanderer 2661893a44 fix for cutscene jerkyness (part of mantis #1697) 2008-06-02 20:51:50 +00:00
Wanderer b909ada973 fix for the Mantis #1703 (debris and alt names) 2008-06-02 06:28:13 +00:00
phreak cdffd39097 Render the radar orb using HTL. It still wasn't doing that after all these years. The original rendering method is still in place. 2008-06-01 17:54:02 +00:00
Wanderer 15209a2a5f Fixes beams have migrating firing points (Mantis #1688)
Prevents simultaneously fired weapons from sharing firing points.
2008-06-01 10:50:28 +00:00
1041 changed files with 323864 additions and 248561 deletions

No files matched your search

+3 -15
View File
@@ -2,7 +2,7 @@
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = libjpeg lua code
SUBDIRS = code
EXTRA_DIST = \
@@ -32,7 +32,7 @@ EXTRA_DIST = \
AM_CXXFLAGS = -I./code @D_CFLAGS@
AM_LDFLAGS = @D_LDFLAGS@
EXTRA_PROGRAMS = cfilearchiver cfileextractor cryptstring scramble
EXTRA_PROGRAMS = cfilearchiver cfileextractor
###############################################################################
##
@@ -47,20 +47,8 @@ cfilearchiver_SOURCES = \
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
tools: cfilearchiver cfileextractor
# cleaning
clean-tools:
+4 -1
View File
@@ -1,7 +1,10 @@
The "projects" directory contains ready projects for:
Microsoft Visual C++ 6
Microsoft Visual C++ 2005
Anjuta 1 (please see README with project before using)
Microsoft Visual C++ 2008
Micrsofot Visual C++ 2010
Apple Xcode
Code::Blocks
See the ChangeLog to see what's new.
+175
View File
@@ -712,3 +712,178 @@ int main ()
AC_SUBST(THEORA_LIBS)
rm -f conf.theoratest
])
dnl AM_PATH_OPENAL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for OpenAL, and define OPENAL_CFLAGS and OPENAL_LIBS
dnl
AC_DEFUN([AM_PATH_OPENAL],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(openal,[ --with-openal=PFX Prefix where OpenAL is installed (optional)], openal_prefix="$withval", openal_prefix="")
AC_ARG_WITH(openal-libraries,[ --with-openal-libraries=DIR Directory where OpenAL library is installed (optional)], openal_libraries="$withval", openal_libraries="")
AC_ARG_WITH(openal-includes,[ --with-openal-includes=DIR Directory where OpenAL header files are installed (optional)], openal_includes="$withval", openal_includes="")
AC_ARG_ENABLE(openaltest, [ --disable-openaltest Do not try to compile and run a test OpenAL program],, enable_openaltest=yes)
if test "x$openal_libraries" != "x" ; then
OPENAL_LIBS="-L$openal_libraries"
elif test "x$openal_prefix" != "x" ; then
OPENAL_LIBS="-L$openal_prefix/lib"
elif test "x$prefix" != "xNONE"; then
OPENAL_LIBS="-L$libdir"
fi
OPENAL_LIBS="$OPENAL_LIBS -lopenal"
if test "x$openal_includes" != "x" ; then
OPENAL_CFLAGS="-I$openal_includes"
elif test "x$openal_prefix" != "x" ; then
OPENAL_CFLAGS="-I$openal_prefix/include"
elif test "x$prefix" != "xNONE"; then
OPENAL_CFLAGS=""
fi
AC_MSG_CHECKING(for OpenAL)
no_openal=""
if test "x$enable_openaltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"
dnl
dnl Now check if the installed OpenAL is sufficiently new.
dnl
rm -f conf.openaltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <AL/al.h>
#include <AL/alc.h>
int main ()
{
#ifdef AL_VERSION_1_1
alcIsExtensionPresent(NULL, (const ALCchar*)"ALC_ENUMERATION_EXT");
system("touch conf.openaltest");
return 0;
#else
printf("\n*** OpenAL version 1.1 or greater is required.\n");
return 1;
#endif
}
],, no_openal=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_openal" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.openaltest ; then
:
else
echo "*** Could not run OpenAL test program, checking why..."
CFLAGS="$CFLAGS $OPENAL_CFLAGS"
LIBS="$LIBS $OPENAL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <AL/al.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding OpenAL or finding the wrong"
echo "*** version of OpenAL. If it is not finding OpenAL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means OpenAL was incorrectly installed"
echo "*** or that you have moved OpenAL since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OPENAL_CFLAGS=""
OPENAL_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENAL_CFLAGS)
AC_SUBST(OPENAL_LIBS)
rm -f conf.openaltest
])
dnl AM_PATH_OPENGL([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for OpenGL, and define OPENGL_CFLAGS and OPENGL_LIBS
dnl
AC_DEFUN([AM_PATH_OPENGL],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(opengl,[ --with-opengl=PFX Prefix where OpenGL is installed (optional)], opengl_prefix="$withval", opengl_prefix="")
AC_ARG_WITH(opengl-libraries,[ --with-opengl-libraries=DIR Directory where OpenGL library is installed (optional)], opengl_libraries="$withval", opengl_libraries="")
AC_ARG_WITH(opengl-includes,[ --with-opengl-includes=DIR Directory where OpenGL header files are installed (optional)], opengl_includes="$withval", opengl_includes="")
AC_ARG_ENABLE(opengltest, [ --disable-opengltest Do not try to compile and run a test OpenGL program],, enable_opengltest=yes)
if test "x$opengl_libraries" != "x" ; then
OPENGL_LIBS="-L$opengl_libraries"
elif test "x$opengl_prefix" != "x" ; then
OPENGL_LIBS="-L$opengl_prefix/lib"
elif test "x$prefix" != "xNONE"; then
OPENGL_LIBS="-L$libdir"
fi
OPENGL_LIBS="$OPENGL_LIBS -lGL -lGLU"
if test "x$opengl_includes" != "x" ; then
OPENGL_CFLAGS="-I$opengl_includes"
elif test "x$opengl_prefix" != "x" ; then
OPENGL_CFLAGS="-I$opengl_prefix/include"
elif test "x$prefix" != "xNONE"; then
OPENGL_CFLAGS=""
fi
no_opengl=""
if test "x$enable_opengltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OPENGL_CFLAGS"
LIBS="$LIBS $OPENGL_LIBS"
AC_CHECK_LIB(GL, glPushMatrix,
[AC_CHECK_HEADER(GL/gl.h,
[AC_CHECK_LIB(GLU, gluPerspective,
[AC_CHECK_HEADER(GL/glu.h, ,
dnl NOTE: this is a failure
no_opengl=yes
)]
)]
)]
)
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_opengl" = "x" ; then
ifelse([$1], , :, [$1])
else
OPENGL_CFLAGS=""
OPENGL_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OPENGL_CFLAGS)
AC_SUBST(OPENGL_LIBS)
])
+4 -2
View File
@@ -49,7 +49,7 @@ DIE=0
DIE=1
}
for AM in automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
for AM in automake-1.11 automake-1.10 automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
(check_version "$AM" 1 6 1) && {
AUTOMAKE="$AM"
break
@@ -67,7 +67,7 @@ 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
for ACL in aclocal-1.11 aclocal-1.10 aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
(check_version "$ACL" 1 6 1) && {
ACLOCAL="$ACL"
break
@@ -128,6 +128,8 @@ done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
# to not run configure, call autogen.sh as,
# NOCONFIGURE=1 ./autogen.sh
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
+88 -88
View File
@@ -185,13 +185,16 @@ EXTRA_DIST = \
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I../lua
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
noinst_PROGRAMS = @FS2_BINARY@
bin_PROGRAMS = @FS2_BINARY@
EXTRA_PROGRAMS = fs2_open_r fs2_open_d wxFRED2_r wxFRED2_d
EXTRA_PROGRAMS = fs2_open_@PACKAGE_VERSION@ fs2_open_@PACKAGE_VERSION@_NOINF \
fs2_open_@PACKAGE_VERSION@_DEBUG fs2_open_@PACKAGE_VERSION@_NOINF_DEBUG \
wxFRED2_@PACKAGE_VERSION@ wxFRED2_@PACKAGE_VERSION@_NOINF \
wxFRED2_@PACKAGE_VERSION@_DEBUG wxFRED2_@PACKAGE_VERSION@_NOINF_DEBUG
###############################################################################
##
@@ -258,12 +261,11 @@ FS2_SOURCES = \
debugconsole/dbugfile.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
decals/decals.cpp \
decals/decals.h \
demo/demo.cpp \
demo/demo.h \
exceptionhandler/exceptionhandler.cpp \
exceptionhandler/exceptionhandler.h \
external_dll/externalcode.h \
external_dll/trackirglobal.cpp \
external_dll/trackirglobal.h \
fireball/fireballs.cpp \
fireball/fireballs.h \
fireball/warpineffect.cpp \
@@ -280,15 +282,22 @@ FS2_SOURCES = \
gamehelp/gameplayhelp.h \
gamesequence/gamesequence.cpp \
gamesequence/gamesequence.h \
gamesnd/eventmusic.cpp \
gamesnd/eventmusic.h \
gamesnd/gamesnd.cpp \
gamesnd/gamesnd.h \
globalincs/alphacolors.cpp \
globalincs/alphacolors.h \
globalincs/crypt.cpp \
globalincs/crypt.h \
globalincs/def_files.cpp \
globalincs/def_files.h \
globalincs/fsmemory.cpp \
globalincs/fsmemory.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/pstypes.h \
globalincs/safe_strings.cpp \
globalincs/safe_strings.h \
globalincs/safe_strings_test.cpp \
globalincs/systemvars.cpp \
globalincs/systemvars.h \
globalincs/version.cpp \
@@ -306,10 +315,18 @@ FS2_SOURCES = \
graphics/gropengl.h \
graphics/gropenglbmpman.cpp \
graphics/gropenglbmpman.h \
graphics/gropengldraw.cpp \
graphics/gropengldraw.h \
graphics/gropenglextension.cpp \
graphics/gropenglextension.h \
graphics/gropengllight.cpp \
graphics/gropengllight.h \
graphics/gropenglpostprocessing.cpp \
graphics/gropenglpostprocessing.h \
graphics/gropenglshader.cpp \
graphics/gropenglshader.h \
graphics/gropenglstate.cpp \
graphics/gropenglstate.h \
graphics/gropengltexture.cpp \
graphics/gropengltexture.h \
graphics/gropengltnl.cpp \
@@ -341,7 +358,6 @@ FS2_SOURCES = \
hud/hudobserver.h \
hud/hudparse.cpp \
hud/hudparse.h \
hud/hudresource.h \
hud/hudreticle.cpp \
hud/hudreticle.h \
hud/hudshield.cpp \
@@ -370,8 +386,6 @@ FS2_SOURCES = \
io/mouse.h \
io/timer.cpp \
io/timer.h \
io/trackir.cpp \
io/trackir.h \
jpgutils/jpgutils.cpp \
jpgutils/jpgutils.h \
jumpnode/jumpnode.cpp \
@@ -386,7 +400,6 @@ FS2_SOURCES = \
localization/fhash.h \
localization/localize.cpp \
localization/localize.h \
math/bitarray.h \
math/fix.cpp \
math/fix.h \
math/floating.cpp \
@@ -469,6 +482,8 @@ FS2_SOURCES = \
missionui/missionweaponchoice.h \
missionui/redalert.cpp \
missionui/redalert.h \
mod_table/mod_table.cpp \
mod_table/mod_table.h \
model/model.h \
model/modelanim.cpp \
model/modelanim.h \
@@ -513,7 +528,6 @@ FS2_SOURCES = \
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 \
@@ -530,6 +544,8 @@ FS2_SOURCES = \
network/multi_rate.h \
network/multi_respawn.cpp \
network/multi_respawn.h \
network/multi_sexp.cpp \
network/multi_sexp.h \
network/multi_team.cpp \
network/multi_team.h \
network/multi_update.h \
@@ -537,8 +553,6 @@ FS2_SOURCES = \
network/multi_voice.h \
network/multi_xfer.cpp \
network/multi_xfer.h \
network/psnet.cpp \
network/psnet.h \
network/psnet2.cpp \
network/psnet2.h \
network/stand_gui.cpp \
@@ -559,6 +573,8 @@ FS2_SOURCES = \
object/object.h \
object/objectshield.cpp \
object/objectshield.h \
object/objectsnd.cpp \
object/objectsnd.h \
object/objectsort.cpp \
object/parseobjectdock.cpp \
object/parseobjectdock.h \
@@ -570,6 +586,8 @@ FS2_SOURCES = \
palman/palman.h \
parse/encrypt.cpp \
parse/encrypt.h \
parse/generic_log.cpp \
parse/generic_log.h \
parse/lua.cpp \
parse/lua.h \
parse/parselo.cpp \
@@ -582,6 +600,8 @@ FS2_SOURCES = \
particle/particle.h \
pcxutils/pcxutils.cpp \
pcxutils/pcxutils.h \
pngutils/pngutils.cpp \
pngutils/pngutils.h \
physics/physics.cpp \
physics/physics.h \
playerman/managepilot.cpp \
@@ -594,6 +614,8 @@ FS2_SOURCES = \
popup/popupdead.h \
radar/radar.cpp \
radar/radar.h \
radar/radardradis.cpp \
radar/radardradis.h \
radar/radarorb.cpp \
radar/radarorb.h \
radar/radarsetup.cpp \
@@ -619,6 +641,30 @@ FS2_SOURCES = \
ship/shiphit.cpp \
ship/shiphit.h \
ship/subsysdamage.h \
sound/audiostr.cpp \
sound/audiostr.h \
sound/acm.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/dscap.cpp \
sound/dscap.h \
sound/fsspeech.cpp \
sound/fsspeech.h \
sound/openal.cpp \
sound/openal.h \
sound/rtvoice.cpp \
sound/rtvoice.h \
sound/sound.cpp \
sound/sound.h \
sound/speech.cpp \
sound/speech.h \
sound/voicerec.cpp \
sound/voicerec.h \
sound/ogg/ogg.cpp \
sound/ogg/ogg.h \
species_defs/species_defs.cpp \
species_defs/species_defs.h \
starfield/nebula.cpp \
@@ -692,56 +738,9 @@ JOY_SOURCES = \
io/joy-unix.cpp
endif
## sound support sources
if FS2_SOUND
SOUND_SOURCES = \
gamesnd/eventmusic.cpp \
gamesnd/eventmusic.h \
gamesnd/gamesnd.cpp \
gamesnd/gamesnd.h \
object/objectsnd.cpp \
object/objectsnd.h \
sound/ogg/ogg.cpp \
sound/ogg/ogg.h \
sound/audiostr-openal.cpp \
sound/audiostr.cpp \
sound/audiostr.h \
sound/acm-openal.cpp \
sound/acm.cpp \
sound/acm.h \
sound/ds.cpp \
sound/ds.h \
sound/ds3d.cpp \
sound/ds3d.h \
sound/dscap.cpp \
sound/dscap.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 \
sound/voicerec.cpp \
sound/voicerec.h
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 \
@@ -749,7 +748,6 @@ WIN32_SOURCES = \
directx/vdplay.h \
directx/vdplobby.h \
directx/vdsetup.h \
directx/vdsound.h \
directx/vdvp.h \
globalincs/windebug.cpp \
graphics/gl/GLAUX.H \
@@ -757,20 +755,6 @@ WIN32_SOURCES = \
graphics/gl/Gl.h \
graphics/gl/Glext.h \
graphics/gl/wglext.h \
graphics/GrD3DStateBlock.cpp \
graphics/GrD3DStateBlock.h \
graphics/grd3d.cpp \
graphics/grd3d.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 \
@@ -795,8 +779,8 @@ endif
## libcode.a
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
${WIN32_SOURCES} ${UNIX_SOURCES}
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${WIN32_SOURCES} \
${UNIX_SOURCES}
##
## End CODE library
@@ -814,14 +798,22 @@ FS2OPEN_SOURCES = \
freespace2/levelpaging.cpp \
freespace2/levelpaging.h
fs2_open_d_SOURCES = \
fs2_open_@PACKAGE_VERSION@_DEBUG_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_r_SOURCES = \
fs2_open_@PACKAGE_VERSION@_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_d_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
fs2_open_r_LDADD = libcode.a ../libjpeg/libjpeg.a ../lua/liblua.a
fs2_open_@PACKAGE_VERSION@_NOINF_DEBUG_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_@PACKAGE_VERSION@_NOINF_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a
fs2_open_@PACKAGE_VERSION@_LDADD = libcode.a
fs2_open_@PACKAGE_VERSION@_NOINF_DEBUG_LDADD = libcode.a
fs2_open_@PACKAGE_VERSION@_NOINF_LDADD = libcode.a
##
## End MAIN binary
@@ -841,14 +833,22 @@ wxFRED_SOURCES = \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
wxFRED2_d_SOURCES = \
wxFRED2_@PACKAGE_VERSION@_DEBUG_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_r_SOURCES = \
wxFRED2_@PACKAGE_VERSION@_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_@PACKAGE_VERSION@_NOINF_DEBUG_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_@PACKAGE_VERSION@_NOINF_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_@PACKAGE_VERSION@_DEBUG_LDADD = libcode.a
wxFRED2_@PACKAGE_VERSION@_LDADD = libcode.a
wxFRED2_@PACKAGE_VERSION@_NOINF_DEBUG_LDADD = libcode.a
wxFRED2_@PACKAGE_VERSION@_NOINF_LDADD = libcode.a
##
## End wxFRED2 binary
+26 -19
View File
@@ -7,23 +7,26 @@
*
*/
// The code in here is just for bookeeping, allocating
// ai slots and linking them to ships.
// See AiCode.cpp for the actual AI code.
/**
* @file
* 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];
int Total_goal_target_names = 0;
char Goal_target_names[MAX_GOAL_TARGET_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.
/**
* @brief Returns index of free AI slot.
* @return Return -1 if no free slot.
*/
int ai_get_slot(int shipnum)
{
int i;
@@ -40,8 +43,10 @@ int ai_get_slot(int shipnum)
return -1;
}
// Releases an AI slot to be used by someone else.
// Only modifies in Ai_info struct. Does not modify hook in ship.
/**
* @brief Frees a currently used AI slot.
* @details 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) );
@@ -77,20 +82,22 @@ void set_wingnum(int objnum, int wingnum)
Ai_info[ai_index].wing = wingnum;
}
char *ai_get_goal_ship_name(char *name, int *index)
char *ai_get_goal_target_name(const char *name, int *index)
{
Assert(name != NULL);
Assert(index != NULL);
int i;
for (i=0; i < Total_goal_ship_names; i++)
if (!stricmp(name, Goal_ship_names[i])) {
for (i=0; i < Total_goal_target_names; i++)
if (!stricmp(name, Goal_target_names[i])) {
*index = i;
return Goal_ship_names[i];
return Goal_target_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);
Assert(Total_goal_target_names < MAX_GOAL_TARGET_NAMES);
Assertion(strlen(name) <= NAME_LENGTH - 1, "Goal target name %s is too long. Needs to be 31 characters or less.", name);
i = Total_goal_target_names++;
strcpy_s(Goal_target_names[i], name);
*index = i;
return Goal_ship_names[i];
return Goal_target_names[i];
}
+184 -333
View File
@@ -7,291 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Ship/ai.h $
* $Revision: 1.12.2.2 $
* $Date: 2007-08-11 16:51:55 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.12.2.1 2006/06/04 01:03:12 Goober5000
* add fighterbay restriction code
* --Goober5000
*
* Revision 1.12 2006/02/25 21:46:59 Goober5000
* spelling
*
* Revision 1.11 2006/02/20 02:13:07 Goober5000
* added ai-ignore-new which hopefully should fix the ignore bug
* --Goober5000
*
* Revision 1.10 2006/02/19 22:00:09 Goober5000
* restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
* --Goober5000
*
* Revision 1.9 2005/11/24 08:46:11 Goober5000
* * 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
*
* Revision 1.8 2005/11/21 00:46:05 Goober5000
* add ai_settings.tbl
* --Goober5000
*
* Revision 1.7 2005/07/27 17:22:22 Goober5000
* more tweaks to the dock code
* --Goober5000
*
* 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
* initial 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
@@ -299,13 +15,26 @@
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
#include "ai/ai_profiles.h"
#include "physics/physics.h"
#include "object/waypoint.h"
struct ship_weapon;
struct ship_subsys;
struct object;
struct ship_info;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
typedef struct ai_flag_name {
int flag;
char flag_name[TOKEN_LENGTH];
int flag_list;
} ai_flag_name;
#define MAX_AI_FLAG_NAMES 1
extern ai_flag_name Ai_flag_names[];
#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.
@@ -313,11 +42,11 @@ struct object;
#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_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_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.
@@ -329,7 +58,7 @@ struct object;
#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
#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!
@@ -340,7 +69,7 @@ struct 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_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.
@@ -354,7 +83,7 @@ struct 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_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
@@ -363,8 +92,8 @@ struct object;
// 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_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
@@ -377,7 +106,7 @@ struct object;
#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_DEPART_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
@@ -388,6 +117,15 @@ struct object;
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
// flags for possible ai overrides
#define AIORF_FULL (1<<0) // Full sexp control
#define AIORF_ROLL (1<<1) // Sexp forced roll maneuver
#define AIORF_PITCH (1<<2) // Sexp forced pitch change
#define AIORF_HEADING (1<<3) // Sexp forced heading change
#define AIORF_FULL_LAT (1<<4) // full control over up/side/forward movement
#define AIORF_UP (1<<5) // vertical movement
#define AIORF_SIDEWAYS (1<<6) // horizontal movement
#define AIORF_FORWARD (1<<7) // forward movement
// structure for AI goals
typedef struct ai_goal {
@@ -398,10 +136,12 @@ typedef struct ai_goal {
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.
char *target_name; // name of the thing that this goal acts upon
int target_name_index; // index of goal_target_name in Goal_target_names[][]
waypoint_list *wp_list; // waypoints that this ship might fly.
int target_instance; // instance of thing this ship might be chasing (currently only used for weapons; note, not the same as objnum!)
int target_signature; // signature of object this ship might be chasing (currently only used for weapons; paired with above value to confirm target)
// unions for docking stuff.
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
@@ -418,7 +158,7 @@ typedef struct ai_goal {
} ai_goal;
#define MAX_GOAL_SHIP_NAMES 100
#define MAX_GOAL_TARGET_NAMES 100
#define AIM_CHASE 0
#define AIM_EVADE 1
@@ -428,25 +168,25 @@ typedef struct ai_goal {
#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_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_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_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_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 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_AI_BEHAVIORS 22 // Number of AIM_xxxx types
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_ENEMY_DISTANCE 2500.0f // maximum distance from which a ship will pursue an enemy.
#define MAX_ENEMY_DISTANCE 2500.0f // Maximum distance from which a ship will pursue an enemy.
#define AI_GOAL_NONE -1
@@ -458,6 +198,44 @@ typedef struct ai_class {
float ai_evasion[NUM_SKILL_LEVELS];
float ai_courage[NUM_SKILL_LEVELS];
float ai_patience[NUM_SKILL_LEVELS];
//SUSHI: These were originally in AI_Profiles, adding the option to override in AI.tbl
//INT_MIN and FLT_MIN represent the "not set" state for which defaults are used instead.
float ai_cmeasure_fire_chance[NUM_SKILL_LEVELS];
float ai_in_range_time[NUM_SKILL_LEVELS];
float ai_link_ammo_levels_maybe[NUM_SKILL_LEVELS];
float ai_link_ammo_levels_always[NUM_SKILL_LEVELS];
float ai_primary_ammo_burst_mult[NUM_SKILL_LEVELS];
float ai_link_energy_levels_maybe[NUM_SKILL_LEVELS];
float ai_link_energy_levels_always[NUM_SKILL_LEVELS];
fix ai_predict_position_delay[NUM_SKILL_LEVELS];
float ai_shield_manage_delay[NUM_SKILL_LEVELS];
float ai_ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
float ai_ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
float ai_ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
float ai_ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
float ai_turn_time_scale[NUM_SKILL_LEVELS];
float ai_glide_attack_percent[NUM_SKILL_LEVELS];
float ai_circle_strafe_percent[NUM_SKILL_LEVELS];
float ai_glide_strafe_percent[NUM_SKILL_LEVELS];
float ai_random_sidethrust_percent[NUM_SKILL_LEVELS];
float ai_stalemate_time_thresh[NUM_SKILL_LEVELS];
float ai_stalemate_dist_thresh[NUM_SKILL_LEVELS];
int ai_chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS];
float ai_max_aim_update_delay[NUM_SKILL_LEVELS];
float ai_turret_max_aim_update_delay[NUM_SKILL_LEVELS];
int ai_profile_flags; //Holds the state of flags that are set
int ai_profile_flags_set; //Holds which flags are set and which are just left alone
int ai_profile_flags2;
int ai_profile_flags2_set;
//SUSHI: These are optional overrides to an AI class to prevent the automatic scaling based on AI class index
int ai_aburn_use_factor[NUM_SKILL_LEVELS];
float ai_shockwave_evade_chance[NUM_SKILL_LEVELS];
float ai_get_away_chance[NUM_SKILL_LEVELS];
float ai_secondary_range_mult[NUM_SKILL_LEVELS];
bool ai_class_autoscale; //Defaults to true, but can be turned off in order to disable extra scaling of some AI behaviors
//based on AI class index
} ai_class;
// Submode definitions.
@@ -480,14 +258,17 @@ typedef struct ai_class {
#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
//SUSHI: Attack submodes (besides those implicitly listed above)
#define AIS_CHASE_GLIDEATTACK 18 // Ship uses glide to move in a constant direction while pointing and shooting at target
#define AIS_CHASE_CIRCLESTRAFE 19 // Attempt a circle-strafe on the target
// 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_DOCK_0 20
#define AIS_DOCK_1 21
#define AIS_DOCK_2 22
#define AIS_DOCK_3 23
#define AIS_DOCK_4 24 // Only for rearm/repair.
#define AIS_DOCK_4A 25 // Only for not rearm/repair. MK, 7/15/97
#define AIS_UNDOCK_0 30
#define AIS_UNDOCK_1 31
#define AIS_UNDOCK_2 32
@@ -506,6 +287,7 @@ typedef struct ai_class {
#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 AIS_STRAFE_GLIDE_ATTACK 206 // SUSHI: Glide strafe atack
#define WPF_REPEAT (1 << 0)
#define WPF_BACKTRACK (1 << 1)
@@ -584,10 +366,9 @@ typedef struct ai_info {
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
int wp_list; // waypoint list index
int wp_index; // waypoint index in list
waypoint_list *wp_list; // waypoint list being followed
SCP_list<waypoint>::iterator 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
@@ -605,6 +386,7 @@ typedef struct ai_info {
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
vec3d path_depart_orient; //Rotational orientation associated with the path
int submode;
int previous_submode; // previous submode, get it?
@@ -614,14 +396,23 @@ typedef struct ai_info {
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
int submode_parm1; // SUSHI: Another optional parameter
fix next_predict_pos_time; // Next time to predict position.
//SUSHI: like last_predicted_enemy_pos, but for aiming (which currently ignores predicted position)
//Unlike the predicted position stuff, also takes into account velocity
//Only used against small ships
fix next_aim_pos_time;
vec3d last_aim_enemy_pos;
vec3d last_aim_enemy_vel;
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.
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
float time_enemy_near; // SUSHI: amount of time enemy continuously "near" the player
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.
@@ -633,7 +424,43 @@ typedef struct ai_info {
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;
//Values copied from the AI class
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
int ai_aburn_use_factor;
float ai_shockwave_evade_chance;
float ai_get_away_chance;
float ai_secondary_range_mult;
bool ai_class_autoscale;
//SUSHI: These were originally in AI_Profiles, adding the option to override in AI.tbl
float ai_cmeasure_fire_chance;
float ai_in_range_time;
float ai_link_ammo_levels_maybe;
float ai_link_ammo_levels_always;
float ai_primary_ammo_burst_mult;
float ai_link_energy_levels_maybe;
float ai_link_energy_levels_always;
fix ai_predict_position_delay;
float ai_shield_manage_delay;
float ai_ship_fire_delay_scale_friendly;
float ai_ship_fire_delay_scale_hostile;
float ai_ship_fire_secondary_delay_scale_friendly;
float ai_ship_fire_secondary_delay_scale_hostile;
float ai_turn_time_scale;
float ai_glide_attack_percent;
float ai_circle_strafe_percent;
float ai_glide_strafe_percent;
float ai_random_sidethrust_percent;
float ai_stalemate_time_thresh;
float ai_stalemate_dist_thresh;
int ai_chance_to_use_missiles_on_plr;
float ai_max_aim_update_delay;
float ai_turret_max_aim_update_delay;
int ai_profile_flags; //Holds AI_Profiles flags (possibly overriden by AI class) that actually apply to AI
int ai_profile_flags2;
union {
float lead_scale; // Amount to lead current opponent by.
float stay_near_distance; // Distance to stay within for AIM_STAY_NEAR mode.
@@ -645,9 +472,6 @@ typedef struct ai_info {
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
@@ -693,7 +517,7 @@ typedef struct ai_info {
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
int 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.
@@ -717,8 +541,23 @@ typedef struct ai_info {
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)
int ai_override_flags; // flags for marking ai overrides from sexp or lua systems
control_info ai_override_ci; // ai override control info
int ai_override_timestamp; // mark for when to end the current override
} ai_info;
// Goober5000
typedef struct {
vec3d docker_point;
vec3d dockee_point;
int dock_mode;
int submodel;
vec3d submodel_pos;
float submodel_r;
float submodel_w;
} rotating_dockpoint_info;
#define MAX_AI_INFO MAX_SHIPS
// SUBSYS_PATH_DIST is used as the distance that a subsystem path should terminate from the actual
@@ -731,8 +570,8 @@ typedef struct ai_info {
#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 int Total_goal_target_names;
extern char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH];
extern void update_ai_info_for_hit(int hitter_obj, int hit_obj);
extern void ai_frame_all(void);
@@ -742,8 +581,6 @@ 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;
@@ -776,7 +613,7 @@ 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);
char *ai_get_goal_target_name(const char *name, int *index);
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, ship_subsys *ssp);
@@ -787,7 +624,7 @@ extern void ai_dock_with_object(object *docker, int docker_index, object *dockee
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_start_waypoints(object *objp, waypoint_list *wp_list, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int shield_quadrant, vec3d *hit_normal);
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);
@@ -822,6 +659,7 @@ extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, i
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index );
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int subsys_path=0);
extern int ai_find_goal_index( ai_goal* aigp, int mode, int submode = -1, int priority = -1 );
// Goober5000
extern void ai_do_safety(object *objp);
@@ -846,7 +684,7 @@ extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priori
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 void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, ai_info *aip);
extern int is_instructor(object *objp);
extern int find_enemy(int objnum, float range, int max_attackers);
@@ -858,10 +696,14 @@ void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos,
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_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point, bool update_clients = true);
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 );
// Goober5000
// Move to a position relative to a dock bay using thrusters.
extern float dock_orient_and_approach(object *docker_objp, int docker_index, object *dockee_objp, int dockee_index, int dock_mode, rotating_dockpoint_info *rdinfo = NULL);
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);
@@ -879,4 +721,13 @@ void ai_fly_to_ship();
//Moved declaration here for player ship -WMC
void process_subobjects(int objnum);
//SUSHI: Setting ai_info stuff from both ai class and ai profile
void init_aip_from_class_and_profile(ai_info *aip, ai_class *aicp, ai_profile_t *profile);
//SUSHI: Updating AI aim
void ai_update_aim(ai_info *aip, object* En_Objp);
//SUSHI: Random evasive sidethrust
void do_random_sidethrust(ai_info *aip, ship_info *sip);
#endif
+275 -122
View File
@@ -4,96 +4,7 @@
* create based on the source.
*/
/*
* $Logfile: /Freespace2/code/ai/ai_profiles.cpp $
* $Revision: 1.13.2.9 $
* $Date: 2007-10-15 06:43:08 $
* $Author: taylor $
*
* $Log: not supported by cvs2svn $
* Revision 1.13.2.8 2007/09/02 02:07:37 Goober5000
* 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
*
* Revision 1.13.2.7 2007/07/28 22:04:13 Goober5000
* apply some of Turey's changes to stable branch
*
* Revision 1.13.2.6 2007/07/15 02:45:48 Goober5000
* 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
*
* Revision 1.13.2.5 2007/02/27 01:44:44 Goober5000
* add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
*
* Revision 1.13.2.4 2006/09/11 01:15:03 taylor
* fixes for stuff_string() bounds checking
*
* Revision 1.13.2.3 2006/07/12 04:57:20 taylor
* fix the endless-loop fix ;) (this is what broke shield recharging btw)
*
* Revision 1.13.2.2 2006/07/06 18:19:55 Goober5000
* fix dumb endless loop bug
* --Goober5000
*
* Revision 1.13.2.1 2006/07/02 03:39:34 Goober5000
* remove associated AI flags
* --Goober5000
*
* Revision 1.13 2006/04/20 06:32:00 Goober5000
* proper capitalization according to Volition
*
* Revision 1.12 2006/03/20 06:25:19 taylor
* change wording to ease Goober's ulcer. ;)
*
* Revision 1.11 2006/03/20 06:19:03 taylor
* 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)
*
* Revision 1.10 2006/02/13 04:56:58 Goober5000
* enabled modular tables for ai_profiles and added the default table to def_files
* --Goober5000
*
* Revision 1.9 2006/02/13 00:20:44 Goober5000
* more tweaks, plus clarification of checks for the existence of files
* --Goober5000
*
* Revision 1.8 2005/12/22 04:32:44 taylor
* 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
*
* Revision 1.7 2005/12/06 03:17:48 taylor
* 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
*
* Revision 1.6 2005/11/24 09:08:44 Goober5000
* bah, forgot a colon
* --Goober5000
*
* Revision 1.5 2005/11/24 08:46:11 Goober5000
* * 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
*
* Revision 1.4 2005/11/24 07:27:14 taylor
* fix fred2 startup crash (we probably need to Assert() this case so it doesn't easily happen again)
*
* Revision 1.3 2005/11/21 15:01:18 taylor
* little cleaner, lot more friendly to 64-bit archs (long type is usually 64-bit there)
*
* Revision 1.2 2005/11/21 03:47:51 Goober5000
* bah and double bah
* --Goober5000
*
* Revision 1.1 2005/11/21 02:43:30 Goober5000
* change from "setting" to "profile"; this way makes more sense
* --Goober5000
*
*/
#include "globalincs/pstypes.h"
@@ -101,6 +12,8 @@
#include "ai/ai_profiles.h"
#include "parse/parselo.h"
#include "localization/localize.h"
#include "weapon/weapon.h"
#include "ship/ship.h"
// global stuff
@@ -114,27 +27,53 @@ static char Default_profile_name[NAME_LENGTH];
// utility
void set_flag(ai_profile_t *profile, char *name, int flag)
void set_flag(ai_profile_t *profile, char *name, int flag, int type)
{
if (optional_string(name))
{
bool val;
stuff_boolean(&val);
if (val)
profile->flags |= flag;
else
profile->flags &= ~flag;
if (type == AIP_FLAG) {
if (val)
profile->flags |= flag;
else
profile->flags &= ~flag;
} else {
if (val)
profile->flags2 |= flag;
else
profile->flags2 &= ~flag;
}
}
}
char *AI_path_types[] = {
"normal",
"alt1",
};
int Num_ai_path_types = sizeof(AI_path_types)/sizeof(char*);
int ai_path_type_match(char *p)
{
int i;
for(i = 0; i < Num_ai_path_types; i++)
{
if(!stricmp(AI_path_types[i], p))
return i;
}
return -1;
}
void parse_ai_profiles_tbl(char *filename)
{
int i, rval;
bool no_create = false;
char profile_name[NAME_LENGTH];
ai_profile_t dummy_profile;
char *saved_Mp = NULL;
char buf[NAME_LENGTH];
// open localization
lcl_ext_open();
@@ -149,7 +88,7 @@ void parse_ai_profiles_tbl(char *filename)
if (filename == NULL)
read_file_text_from_array(defaults_get_file("ai_profiles.tbl"));
else
read_file_text(filename);
read_file_text(filename, CF_TYPE_TABLES);
reset_parse();
@@ -166,6 +105,7 @@ void parse_ai_profiles_tbl(char *filename)
{
ai_profile_t *profile = &dummy_profile;
ai_profile_t *previous_profile = NULL;
bool no_create = false;
// get the name
required_string("$Profile Name:");
@@ -229,7 +169,7 @@ void parse_ai_profiles_tbl(char *filename)
}
// set the name
strcpy(profile->profile_name, profile_name);
strcpy_s(profile->profile_name, profile_name);
// fill in any and all settings; they're all optional and can be in any order
@@ -256,13 +196,16 @@ void parse_ai_profiles_tbl(char *filename)
if (optional_string("$AI Maybe Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Primary Ammo Burst Multiplier:"))
parse_float_list(profile->primary_ammo_burst_mult, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Max Missles Locked on Player:"))
if (optional_string("$Max Missles Locked on Player:") || optional_string("$Max Missiles Locked on Player:"))
parse_int_list(profile->max_allowed_player_homers, NUM_SKILL_LEVELS);
if (optional_string("$Max Player Attackers:"))
@@ -280,18 +223,15 @@ void parse_ai_profiles_tbl(char *filename)
// represented in fractions of F1_0
if (optional_string("$Predict Position Delay:"))
{
int i;
int iLoop;
float temp_list[NUM_SKILL_LEVELS];
parse_float_list(temp_list, NUM_SKILL_LEVELS);
for (i = 0; i < NUM_SKILL_LEVELS; i++)
profile->predict_position_delay[i] = fl2f(temp_list[i]);
for (iLoop = 0; iLoop < NUM_SKILL_LEVELS; iLoop++)
profile->predict_position_delay[iLoop] = fl2f(temp_list[iLoop]);
}
if (optional_string("$Player Shield Recharge Scale:"))
parse_float_list(profile->shield_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Shield Manage Delay:") || optional_string("$AI Shield Manage Delays:"))
parse_float_list(profile->shield_manage_delay, NUM_SKILL_LEVELS);
@@ -301,12 +241,76 @@ void parse_ai_profiles_tbl(char *filename)
if (optional_string("$Hostile AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$Player Subsys Damage Factor:") || optional_string("$AI Damage Reduction to Player Subsys:"))
parse_float_list(profile->subsys_damage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Friendly AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$AI Turn Time Scale:"))
parse_float_list(profile->turn_time_scale, NUM_SKILL_LEVELS);
if (optional_string("$Glide Attack Percent:")) {
parse_float_list(profile->glide_attack_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_attack_percent[i] < 0.0f || profile->glide_attack_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Attack Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_attack_percent[i]);
profile->glide_attack_percent[i] = 0.0f;
}
profile->glide_attack_percent[i] /= 100.0;
}
}
if (optional_string("$Circle Strafe Percent:")) {
parse_float_list(profile->circle_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->circle_strafe_percent[i] < 0.0f || profile->circle_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Circle Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->circle_strafe_percent[i]);
profile->circle_strafe_percent[i] = 0.0f;
}
profile->circle_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Glide Strafe Percent:")) {
parse_float_list(profile->glide_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_strafe_percent[i] < 0.0f || profile->glide_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_strafe_percent[i]);
profile->glide_strafe_percent[i] = 0.0f;
}
profile->glide_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Random Sidethrust Percent:")) {
parse_float_list(profile->random_sidethrust_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->random_sidethrust_percent[i] < 0.0f || profile->random_sidethrust_percent[i] > 100.0f) {
Warning(LOCATION, "$Random Sidethrust Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->random_sidethrust_percent[i]);
profile->random_sidethrust_percent[i] = 0.0f;
}
profile->random_sidethrust_percent[i] /= 100.0;
}
}
if (optional_string("$Stalemate Time Threshold:"))
parse_float_list(profile->stalemate_time_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Stalemate Distance Threshold:"))
parse_float_list(profile->stalemate_dist_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Player Shield Recharge Scale:"))
parse_float_list(profile->shield_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
@@ -316,39 +320,188 @@ void parse_ai_profiles_tbl(char *filename)
if (optional_string("$Max Turret Player Ownage:"))
parse_int_list(profile->max_turret_ownage_player, NUM_SKILL_LEVELS);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS);
if (optional_string("$Percentage Required For Kill Scale:"))
parse_float_list(profile->kill_percentage_scale, NUM_SKILL_LEVELS);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION);
if (optional_string("$Percentage Required For Assist Scale:"))
parse_float_list(profile->assist_percentage_scale, NUM_SKILL_LEVELS);
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION);
if (optional_string("$Percentage Awarded For Capship Assist:"))
parse_float_list(profile->assist_award_percentage_scale, NUM_SKILL_LEVELS);
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT);
if (optional_string("$Repair Penalty:"))
parse_int_list(profile->repair_penalty, NUM_SKILL_LEVELS);
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE);
if (optional_string("$Delay Before Allowing Bombs to Be Shot Down:"))
parse_float_list(profile->delay_bomb_arm_timer, NUM_SKILL_LEVELS);
if (optional_string("$Chance AI Has to Fire Missiles at Player:"))
parse_int_list(profile->chance_to_use_missiles_on_plr, NUM_SKILL_LEVELS);
if (optional_string("$Max Aim Update Delay:"))
parse_float_list(profile->max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Turret Max Aim Update Delay:"))
parse_float_list(profile->turret_max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Player Autoaim FOV:"))
{
float fov_list[NUM_SKILL_LEVELS];
parse_float_list(fov_list, NUM_SKILL_LEVELS);
for (i = 0; i < NUM_SKILL_LEVELS; i++)
{
//Enforce range
if (fov_list[i] < 0.0f || fov_list[i] >= 360.0f)
{
Warning(LOCATION, "$Player Autoaim FOV should be >= 0 and < 360.0 (read %f). Setting to 0.", fov_list[i]);
fov_list[i] = 0.0f;
}
//Convert units
profile->player_autoaim_fov[i] = fov_list[i] * PI / 180.0f;
}
}
if (optional_string("$Detail Distance Multiplier:"))
parse_float_list(profile->detail_distance_mult, NUM_SKILL_LEVELS);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS, AIP_FLAG);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION, AIP_FLAG);
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION, AIP_FLAG);
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT, AIP_FLAG);
set_flag(profile, "$smart afterburner management:", AIPF_SMART_AFTERBURNER_MANAGEMENT, AIP_FLAG);
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE, AIP_FLAG);
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS);
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS, AIP_FLAG);
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY);
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY, AIP_FLAG);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY, AIP_FLAG);
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS);
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS, AIP_FLAG);
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP);
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP, AIP_FLAG);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP, AIP_FLAG);
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY);
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY, AIP_FLAG);
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING);
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING, AIP_FLAG);
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY);
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY, AIP_FLAG);
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING, AIP_FLAG);
set_flag(profile, "$include beams for kills and assists:", AIPF_INCLUDE_BEAMS_IN_STAT_CALCS, AIP_FLAG);
set_flag(profile, "$score kills based on damage caused:", AIPF_KILL_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
set_flag(profile, "$score assists based on damage caused:", AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE, AIP_FLAG);
set_flag(profile, "$allow event and goal scoring in multiplayer:", AIPF_ALLOW_MULTI_EVENT_SCORING, AIP_FLAG);
set_flag(profile, "$fix linked primary weapon decision bug:", AIPF_FIX_LINKED_PRIMARY_BUG, AIP_FLAG);
set_flag(profile, "$prevent turrets targeting too distant bombs:", AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE, AIP_FLAG);
set_flag(profile, "$smart subsystem targeting for turrets:", AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS, AIP_FLAG);
set_flag(profile, "$fix heat seekers homing on stealth ships bug:", AIPF_FIX_HEAT_SEEKER_STEALTH_BUG, AIP_FLAG);
set_flag(profile, "$multi allow empty primaries:", AIPF_MULTI_ALLOW_EMPTY_PRIMARIES, AIP_FLAG);
set_flag(profile, "$multi allow empty secondaries:", AIPF_MULTI_ALLOW_EMPTY_SECONDARIES, AIP_FLAG);
set_flag(profile, "$allow turrets target weapons freely:", AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY, AIP_FLAG);
set_flag(profile, "$use only single fov for turrets:", AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS, AIP_FLAG);
set_flag(profile, "$allow vertical dodge:", AIPF_ALLOW_VERTICAL_DODGE, AIP_FLAG);
set_flag(profile, "$force beam turrets to use normal fov:", AIPF_FORCE_BEAM_TURRET_FOV, AIP_FLAG);
set_flag(profile, "$fix ai class bug:", AIPF_FIX_AI_CLASS_BUG, AIP_FLAG);
set_flag(profile, "$turrets ignore targets radius in range checks:", AIPF2_TURRETS_IGNORE_TARGET_RADIUS, AIP_FLAG2);
set_flag(profile, "$no extra collision avoidance vs player:", AIPF2_NO_SPECIAL_PLAYER_AVOID, AIP_FLAG2);
set_flag(profile, "$perform fewer checks for death screams:", AIPF2_PERFORM_FEWER_SCREAM_CHECKS, AIP_FLAG2);
set_flag(profile, "$advanced turret fov edge checks:", AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS, AIP_FLAG2);
set_flag(profile, "$require turrets to have target in fov:", AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV, AIP_FLAG2);
set_flag(profile, "$all ships manage shields:", AIPF2_ALL_SHIPS_MANAGE_SHIELDS, AIP_FLAG2);
set_flag(profile, "$ai aims from ship center:", AIPF2_AI_AIMS_FROM_SHIP_CENTER, AIP_FLAG2);
set_flag(profile, "$allow primary link at mission start:", AIPF2_ALLOW_PRIMARY_LINK_AT_START, AIP_FLAG2);
set_flag(profile, "$allow beams to damage bombs:", AIPF2_BEAMS_DAMAGE_WEAPONS, AIP_FLAG2);
set_flag(profile, "$disable weapon damage scaling for player:", AIPF2_PLAYER_WEAPON_SCALE_FIX, AIP_FLAG2);
set_flag(profile, "$countermeasures affect aspect seekers:", AIPF2_ASPECT_LOCK_COUNTERMEASURE, AIP_FLAG2);
set_flag(profile, "$ai guards specific ship in wing:", AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING, AIP_FLAG2);
profile->ai_path_mode = AI_PATH_MODE_NORMAL;
if(optional_string("$ai path mode:"))
{
stuff_string(buf, F_NAME, NAME_LENGTH);
int j = ai_path_type_match(buf);
if(j >= 0) {
profile->ai_path_mode = j;
} else {
Warning(LOCATION, "Invalid ai path mode '%s' specified", buf);
}
}
set_flag(profile, "$no warp camera:", AIPF2_NO_WARP_CAMERA, AIP_FLAG2);
set_flag(profile, "$fix ai path order bug:", AIPF2_FIX_AI_PATH_ORDER_BUG, AIP_FLAG2);
// ----------
// compatibility
if (optional_string("$perform less checks for death screams:"))
{
mprintf(("Warning: \"$perform less checks for death screams\" flag is deprecated in favor of \"$perform fewer checks for death screams\"\n"));
bool temp;
stuff_boolean(&temp);
if (temp)
profile->flags2 |= AIPF2_PERFORM_FEWER_SCREAM_CHECKS;
else
profile->flags2 &= ~AIPF2_PERFORM_FEWER_SCREAM_CHECKS;
}
if (optional_string("$allow primary link delay:"))
{
mprintf(("Warning: \"$allow primary link delay\" flag is deprecated in favor of \"$allow primary link at mission start\"\n"));
bool temp;
stuff_boolean(&temp);
if (temp)
profile->flags2 &= ~AIPF2_ALLOW_PRIMARY_LINK_AT_START;
else
profile->flags2 |= AIPF2_ALLOW_PRIMARY_LINK_AT_START;
}
set_flag(profile, "$use newtonian dampening:", AIPF_USE_NEWTONIAN_DAMPENING);
// if we've been through once already and are at the same place, force a move
if ( saved_Mp && (saved_Mp == Mp) )
{
char tmp[60];
memset(tmp, 0, 60);
strncpy(tmp, Mp, 59);
mprintf(("WARNING: Unrecognized parameter in ai_profiles: %s\n", tmp));
Mp++;
}
// find next valid option
skip_to_start_of_string_either("$", "#");
+77 -46
View File
@@ -4,50 +4,7 @@
* create based on the source.
*/
/*
* $Logfile: /Freespace2/code/ai/ai_profiles.h $
* $Revision: 1.4.2.5 $
* $Date: 2007-07-28 22:04:14 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.4.2.4 2007/07/15 02:45:48 Goober5000
* 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
*
* Revision 1.4.2.3 2007/02/27 01:44:44 Goober5000
* add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
*
* Revision 1.4.2.2 2006/07/02 04:13:43 Goober5000
* bah
*
* Revision 1.4.2.1 2006/07/02 03:39:34 Goober5000
* remove associated AI flags
* --Goober5000
*
* Revision 1.4 2006/04/20 06:32:00 Goober5000
* proper capitalization according to Volition
*
* Revision 1.3 2006/03/20 06:19:03 taylor
* 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)
*
* Revision 1.2 2005/11/24 08:46:11 Goober5000
* * 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
*
* Revision 1.1 2005/11/21 02:43:30 Goober5000
* change from "setting" to "profile"; this way makes more sense
* --Goober5000
*
*/
#ifndef _AI_PROFILES_H_
#define _AI_PROFILES_H_
@@ -56,6 +13,9 @@
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
// flag int defines
#define AIP_FLAG 1
#define AIP_FLAG2 2
// flags
#define AIPF_SMART_SHIELD_MANAGEMENT (1 << 0)
@@ -73,8 +33,43 @@
#define AIPF_DISABLE_WEAPON_DAMAGE_SCALING (1 << 12)
#define AIPF_USE_ADDITIVE_WEAPON_VELOCITY (1 << 13)
#define AIPF_USE_NEWTONIAN_DAMPENING (1 << 14)
#define AIPF_INCLUDE_BEAMS_IN_STAT_CALCS (1 << 15)
#define AIPF_KILL_SCORING_SCALES_WITH_DAMAGE (1 << 16)
#define AIPF_ASSIST_SCORING_SCALES_WITH_DAMAGE (1 << 17)
#define AIPF_ALLOW_MULTI_EVENT_SCORING (1 << 18)
#define AIPF_SMART_AFTERBURNER_MANAGEMENT (1 << 19)
#define AIPF_FIX_LINKED_PRIMARY_BUG (1 << 20)
#define AIPF_PREVENT_TARGETING_BOMBS_BEYOND_RANGE (1 << 21)
#define AIPF_SMART_SUBSYSTEM_TARGETING_FOR_TURRETS (1 << 22)
#define AIPF_FIX_HEAT_SEEKER_STEALTH_BUG (1 << 23)
#define AIPF_MULTI_ALLOW_EMPTY_PRIMARIES (1 << 24)
#define AIPF_MULTI_ALLOW_EMPTY_SECONDARIES (1 << 25)
#define AIPF_ALLOW_TURRETS_TARGET_WEAPONS_FREELY (1 << 26)
#define AIPF_USE_ONLY_SINGLE_FOV_FOR_TURRETS (1 << 27)
#define AIPF_ALLOW_VERTICAL_DODGE (1 << 28) //Allows AI ships to evade weapons vertically as well as horizontally
#define AIPF_FORCE_BEAM_TURRET_FOV (1 << 29)
#define AIPF_FIX_AI_CLASS_BUG (1 << 30)
// flags2
#define AIPF2_TURRETS_IGNORE_TARGET_RADIUS (1 << 0)
#define AIPF2_NO_SPECIAL_PLAYER_AVOID (1 << 1)
#define AIPF2_PERFORM_FEWER_SCREAM_CHECKS (1 << 2)
#define AIPF2_ALL_SHIPS_MANAGE_SHIELDS (1 << 3)
#define AIPF2_ADVANCED_TURRET_FOV_EDGE_CHECKS (1 << 4)
#define AIPF2_REQUIRE_TURRET_TO_HAVE_TARGET_IN_FOV (1 << 5)
#define AIPF2_AI_AIMS_FROM_SHIP_CENTER (1 << 6)
#define AIPF2_ALLOW_PRIMARY_LINK_AT_START (1 << 7)
#define AIPF2_BEAMS_DAMAGE_WEAPONS (1 << 8)
#define AIPF2_PLAYER_WEAPON_SCALE_FIX (1 << 9)
#define AIPF2_NO_WARP_CAMERA (1 << 10)
#define AIPF2_ASPECT_LOCK_COUNTERMEASURE (1 << 11)
#define AIPF2_AI_GUARDS_SPECIFIC_SHIP_IN_WING (1 << 12)
#define AIPF2_FIX_AI_PATH_ORDER_BUG (1 << 13)
// AI Path types
#define AI_PATH_MODE_NORMAL 0
#define AI_PATH_MODE_ALT1 1
#define MAX_AI_PROFILES 5
typedef struct ai_profile_t {
@@ -82,6 +77,7 @@ typedef struct ai_profile_t {
char profile_name[NAME_LENGTH];
int flags;
int flags2;
// difficulty-related values
int max_incoming_asteroids[NUM_SKILL_LEVELS]; // max number of asteroids thrown at friendlies
@@ -96,8 +92,9 @@ typedef struct ai_profile_t {
float link_energy_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
// AI ships link primaries if ammunition levels greater than these percents
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
float primary_ammo_burst_mult[NUM_SKILL_LEVELS]; // SUSHI: Multiplier adjusting burst frequency for ballistic primary weapons
// difficulty-related scales
float cmeasure_life_scale[NUM_SKILL_LEVELS]; // life of countermeasures
@@ -110,15 +107,49 @@ typedef struct ai_profile_t {
float subsys_damage_scale[NUM_SKILL_LEVELS]; // damage applied to a player subsystem
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]; // damage cap values for friendly beam fire
float turn_time_scale[NUM_SKILL_LEVELS]; // speed at which enemy ships turn
float glide_attack_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "glide attack" move
float circle_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "circle strafe" move
float glide_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use glide when strafing capships
float random_sidethrust_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to randomly use sidethrust while dogfihthing
float stalemate_time_thresh[NUM_SKILL_LEVELS]; // SUSHI: The amount of time required for the AI to detect (and try to break) dogfight stalemate
float stalemate_dist_thresh[NUM_SKILL_LEVELS]; // SUSHI: The maximum distance the AI and target must be within for a stalemate
float max_aim_update_delay[NUM_SKILL_LEVELS]; // SUSHI: The maximum delay before the AI updates their aim against small ships
float turret_max_aim_update_delay[NUM_SKILL_LEVELS]; // SUSHI: As above, but for turrets updating their aim
// Multiplicative delay factors for increasing skill levels.
float ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
// Multiplicative secondary delay factors for increasing skill levels.
float ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
// Maximum turrets of one ship allowed to shoot the same target
int max_turret_ownage_target[NUM_SKILL_LEVELS];
int max_turret_ownage_player[NUM_SKILL_LEVELS];
// percentage of damage caused required for a kill/assist
float kill_percentage_scale[NUM_SKILL_LEVELS];
float assist_percentage_scale[NUM_SKILL_LEVELS];
// percentage of the capships score given to other team mates on a kill
float assist_award_percentage_scale[NUM_SKILL_LEVELS];
// the number of points subtracted from score for a rearm started on a player
int repair_penalty[NUM_SKILL_LEVELS];
float delay_bomb_arm_timer[NUM_SKILL_LEVELS];
// the chance (x/7) that ship is allowed to fire missiles at player ship.
int chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS];
// Player-specific autoaim FOV override
float player_autoaim_fov[NUM_SKILL_LEVELS];
float detail_distance_mult[MAX_DETAIL_LEVEL + 1]; //MAX_DETAIL_LEVEL really needs to be 4
int ai_path_mode;
} ai_profile_t;
+282 -503
View File
File diff suppressed because it is too large. Load diff
+1 -75
View File
@@ -7,81 +7,7 @@
*
*/
/*
* $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__
+2389 -3510
View File
File diff suppressed because it is too large. Load diff
+386 -901
View File
File diff suppressed because it is too large. Load diff
+29 -198
View File
@@ -7,177 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
* $Revision: 1.6 $
* $Date: 2006-04-20 06:32:00 $
* $Author: Goober5000 $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2006/02/20 02:13:07 Goober5000
* added ai-ignore-new which hopefully should fix the ignore bug
* --Goober5000
*
* Revision 1.4 2006/02/19 22:00:09 Goober5000
* restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
* --Goober5000
*
* Revision 1.3 2005/12/29 08:08:33 wmcoolmon
* Codebase commit, most notably including objecttypes.tbl
*
* Revision 1.2 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
@@ -196,35 +26,35 @@ struct ai_goal;
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
// WMC - Oh and add them to Ai_goal_names plz. TY! :)
#define AI_GOAL_CHASE (1<<1)
#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)
#define AI_GOAL_CHASE (1<<1) // 0x00000002
#define AI_GOAL_DOCK (1<<2) // 0x00000004 // used for undocking as well
#define AI_GOAL_WAYPOINTS (1<<3) // 0x00000008
#define AI_GOAL_WAYPOINTS_ONCE (1<<4) // 0x00000010
#define AI_GOAL_WARP (1<<5) // 0x00000020
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6) // 0x00000040
#define AI_GOAL_FORM_ON_WING (1<<7) // 0x00000080
#define AI_GOAL_UNDOCK (1<<8) // 0x00000100
#define AI_GOAL_CHASE_WING (1<<9) // 0x00000200
#define AI_GOAL_GUARD (1<<10) // 0x00000400
#define AI_GOAL_DISABLE_SHIP (1<<11) // 0x00000800
#define AI_GOAL_DISARM_SHIP (1<<12) // 0x00001000
#define AI_GOAL_CHASE_ANY (1<<13) // 0x00002000
#define AI_GOAL_IGNORE (1<<14) // 0x00004000
#define AI_GOAL_GUARD_WING (1<<15) // 0x00008000
#define AI_GOAL_EVADE_SHIP (1<<16) // 0x00010000
// 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_NEAR_SHIP (1<<17) // 0x00020000
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18) // 0x00040000
#define AI_GOAL_REARM_REPAIR (1<<19) // 0x00080000
// resume regular goals
#define AI_GOAL_STAY_STILL (1<<20)
#define AI_GOAL_PLAY_DEAD (1<<21)
#define AI_GOAL_CHASE_WEAPON (1<<22)
#define AI_GOAL_STAY_STILL (1<<20) // 0x00100000
#define AI_GOAL_PLAY_DEAD (1<<21) // 0x00200000
#define AI_GOAL_CHASE_WEAPON (1<<22) // 0x00400000
#define AI_GOAL_FLY_TO_SHIP (1<<23) // kazan
#define AI_GOAL_IGNORE_NEW (1<<24) // Goober5000
#define AI_GOAL_FLY_TO_SHIP (1<<23) // 0x00800000
#define AI_GOAL_IGNORE_NEW (1<<24) // 0x01000000
// now the masks for ship types
@@ -271,6 +101,9 @@ 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 );
extern int ai_remove_goal_sexp_sub( int sexp, ai_goal* aigp );
extern void ai_remove_wing_goal_sexp(int sexp, int wingnum);
// 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 );
@@ -284,9 +117,7 @@ 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 void ai_update_goal_references(ai_goal *goals, int type, const char *old_name, const char *new_name);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name);
extern char *ai_add_dock_name(char *str);
+1102 -431
View File
File diff suppressed because it is too large. Load diff
+124 -465
View File
@@ -7,280 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
* $Revision: 2.19.2.2 $
* $Date: 2006-09-11 01:00:27 $
* $Author: taylor $
*
* C module for playing back anim files
*
* $Log: not supported by cvs2svn $
* Revision 2.19.2.1 2006/06/22 14:59:44 taylor
* fix various things that Valgrind has been complaining about
*
* Revision 2.19 2006/03/21 00:27:27 taylor
* some minor cleanup
*
* Revision 2.18 2005/11/13 06:39:38 taylor
* remove Cmdline_cache_ani support, it only worked if not in a VP and only on streaming ani so it was pretty much useless
*
* Revision 2.17 2005/05/28 19:40:59 taylor
* fix ani corruption detection so that certain streaming anis don't hit it (check was wrong anyway)
*
* Revision 2.16 2005/05/23 05:58:31 taylor
* quick catch for some corrupted anis, only a partial fix but it will do until something
* a bit more heavy duty comes along in the near future
*
* Revision 2.15 2005/05/12 17:49:10 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.14 2005/01/30 12:50:08 taylor
* merge with Linux/OSX tree - p0130
*
* Revision 2.13 2004/12/20 20:18:30 fryday
* Commented out ATL dependencies (And changed one macro to an swprintf instead)
* Tiny change in animplay ( pow(2.0, ...) instead of pow(2, ...)) because VS2K5
* throws an ambiguity error over that.
*
* Revision 2.12 2004/10/09 17:58:48 taylor
* one more try to fix the memory leak and end-of-mission crash for talking head anis
*
* Revision 2.11 2004/07/26 20:47:23 Kazan
* remove MCD complete
*
* Revision 2.10 2004/07/17 18:46:06 taylor
* various OGL and memory leak fixes
*
* Revision 2.9 2004/07/12 16:32:41 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.8 2004/03/05 09:01:52 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.7 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.6 2004/02/14 00:18:29 randomtiger
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
* Removal of many files from project.
* Removal of meanless Gr_bitmap_poly variable.
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
* Removal of redundant Fred paths that arent needed for Fred OGL.
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
*
* Revision 2.5 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.4 2003/11/29 10:52:08 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.3 2003/11/11 02:15:41 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --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.3 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.1.2.2 2002/09/28 22:13:42 randomtiger
* Sorted out some bits and pieces. The background nebula blends now which is nice. – RT
*
* Revision 2.1.2.1 2002/09/24 18:56:40 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
*
*
* 9 9/13/99 11:26p Andsager
* Add debug code to check for poorly sized anis
*
* 8 8/26/99 9:45a Dave
* First pass at easter eggs and cheats.
*
* 7 7/16/99 1:49p Dave
* 8 bit aabitmaps. yay.
*
* 6 7/13/99 1:15p Dave
* 32 bit support. Whee!
*
* 5 6/10/99 10:34a Dave
* Removed unnecessary assert.
*
* 4 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 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
*
* 38 6/23/98 4:18p Hoffoss
* Fixed some bugs with AC release build.
*
* 37 5/18/98 5:59p Hoffoss
* Made command briefing advanced now once the speech stops and animation
* has fully played once, whichever is longer.
*
* 36 5/14/98 6:29p Hoffoss
* Fixed some warnings a release rebuild all turned up.
*
* 35 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 34 4/27/98 3:36p Dave
*
* 33 3/25/98 8:43p Hoffoss
* Changed anim_play() to not be so complex when you try and call it.
*
* 32 2/05/98 9:21p John
* Some new Direct3D code. Added code to monitor a ton of stuff in the
* game.
*
* 31 1/19/98 11:37p Lawrance
* Fixing Optimization build warnings
*
* 30 1/19/98 3:09p Hoffoss
* Only free an anim instance if it is actually playing.
*
* 29 1/14/98 6:43p Lawrance
* Add ref_count to anim struct, so we don't free multiple times
*
* 28 12/30/97 6:44p John
* Made g3_Draw_bitmap functions account for aspect of bitmap.
*
* 27 12/27/97 2:35p John
* Restructed some code so that if the memory-mapped file open fails, it
* will still read it the old-fashioned, non-memory mapped way.
*
* 26 12/24/97 9:10p Lawrance
* take out some debugging statements
*
* 25 12/24/97 8:57p Lawrance
* Added anim_ignore_next_frametime()
*
* 24 12/07/97 2:06p Dave
* Removed some debug frame-checking code.
*
* 23 12/06/97 2:55p Dave
*
* 22 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.
*
* 21 11/20/97 5:36p Dave
* Hooked in a bunch of main hall changes (including sound). Made it
* possible to reposition (rewind/ffwd)
* sound buffer pointers. Fixed animation direction change framerate
* problem.
*
* 20 11/20/97 4:33p Sandeep
* ALAN: ensure instance->paused gets initialized
*
* 19 11/20/97 4:12p Lawrance
* when paused, don't increment time_elapsed
*
* 18 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.
*
* 17 9/11/97 4:17p Allender
* use _MAX_PATH instead of MAX_FILENAME_LENGTH for anim_play since it is
* called from MoviePlayer with full path
*
* 16 9/11/97 10:49a Lawrance
* improve anim_show_next_frame()
*
* 15 9/10/97 4:59p Lawrance
* improve comments to anim_play() function
*
* 14 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.
*
* 13 8/30/97 2:11p Lawrance
* allow animations to loop
*
* 12 8/25/97 11:13p Lawrance
* support framerate independent playback with the option of now advancing
* more than one frame at a time
*
* 11 8/22/97 8:20a Lawrance
* display scrolling text properly, with indicator that text exitsts to be
* scrolled
*
* 10 8/21/97 5:11p Lawrance
* frame numbering for ANI's now is from 0 -> total_frames-1.
*
* 9 8/19/97 9:30a Lawrance
* print out reason if file doesn't open right
*
* 8 7/28/97 10:42p Lawrance
* re-did interface to unpack_frame() to make more general
*
* 7 7/21/97 11:41a Lawrance
* make playback time of .ani files keyed of frametime
*
* 6 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 5 7/11/97 11:54a John
* added rotated 3d bitmaps.
*
* 4 6/27/97 4:36p Lawrance
* update pal translation table when gr_screen.signature changes
*
* 3 6/26/97 3:00p Lawrance
* fix bug with playing 3d anims
*
* 2 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 1 6/23/97 5:09p Lawrance
*
* 24 6/03/97 5:53p Lawrance
* don't unload bitmap after bm_create
*
* $NoKeywords: $
*/
#include "anim/animplay.h"
#include "globalincs/linklist.h"
@@ -304,16 +31,17 @@ anim_instance anim_render_list;
#define MAX_ANIM_INSTANCES 25
anim_instance anim_render_instance[MAX_ANIM_INSTANCES];
int Anim_paused; // global variable to pause the playing back of anims
int Anim_paused; /// Global variable to pause the playing back of anims
int Anim_inited = FALSE;
fix t1,t2;
int Anim_ignore_frametime=0; // flag used to ignore frametime... useful when need to avoid saturated frametimes
// -------------------------------------------------------------------------------------------------
// anim_init() will queue all the anim_render_instance[] elements onto the anim_free_list
//
/**
* @brief Initialise animation
* @details Queue all the ::anim_render_instance[] elements onto the ::anim_free_list
*/
void anim_init()
{
int i;
@@ -333,9 +61,9 @@ void anim_init()
Anim_inited = TRUE;
}
// -------------------------------------------------------------------------------------------------
// anim_render_all() will display the frames for the currently playing anims
//
/**
* @brief Display the frames for the currently playing anims
*/
void anim_render_all(int screen_id, float frametime)
{
anim_instance* A;
@@ -358,10 +86,10 @@ void anim_render_all(int screen_id, float frametime)
}
}
// -------------------------------------------------------------------------------------------------
// anim_render_one() will display the frames for the passed animation, it will ignore animations which
// do not have the same id as the passed screen_id
//
/**
* @brief Display the frames for the passed animation
* @details It will ignore animations which do not have the same id as the passed screen_id
*/
void anim_render_one(int screen_id, anim_instance *ani, float frametime)
{
// make sure this guy's screen id matches the passed one
@@ -382,14 +110,17 @@ void anim_render_one(int screen_id, anim_instance *ani, float frametime)
MONITOR(NumANIPlayed)
// Setup an anim_play_struct for passing into anim_play(). Will fill in default values, which you
// can then change before calling anim_play().
//
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y)
/**
* @brief Setup an anim_play_struct for passing into ::anim_play().
* @details Will fill in default values, which you can then change before calling ::anim_play().
*/
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int base_w, int base_h)
{
aps->anim_info = a_info;
aps->x = x;
aps->y = y;
aps->base_w = base_w;
aps->base_h = base_h;
aps->start_at = 0;
aps->stop_at = a_info->total_frames - 1;
aps->screen_id = 0;
@@ -402,49 +133,21 @@ void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y)
aps->ping_pong = 0;
}
// -------------------------------------------------------------------------------------------------
// anim_play() will add an anim instance to the anim_render_list. This will cause the
// anim to be played at the x,y position specified in the parameter list.
//
// input:
//
// anim_info => the compressed animation that we should make an instance from
// x => x position of animation to play at (top left corner)
// y => y position of animation to play at ( top left corner)
// start_at => frame number to start at (note: numbering is from 0->num_frames-1)
// stop_at => frame number to stop at (note: numbering is from 0->num_frames-1)
// screen_id => OPTIONAL (default value 0): screen signature so animation only plays when
// anim_render_all() called with that same signature
// world_pos => OPTIONAL (default value NULL): only give a world pos when you want to
// play the animation at a 3D location. You must specify radius when
// this is non-null.
// radius => OPTIONAL (default value 0): only needed when the animation is playing
// as a 3D animation (this is only when world_pos in not NULL).
// fi => OPTIONAL (default value 0): framerate indepentdent flag, when set TRUE
// the animation will skip frames if necessary to maintain the fps value
// associated with the animation
// color => OPTIONAL (default value NULL) address of an alpha color struct. Only
// required when the animation should be drawn with an alpha color.
// skip_frames => OPTIONAL (default value 1) should anim skip frames when doing framerate
// independent playback
// looped => OPTIONAL (default value 0) should anim play looped (ie forever)
//
// returns:
//
// pointer to instance => success
// NULL => if anim anim could not be played
//
/**
* @brief Will add an anim instance to the anim_render_list.
* This will cause the anim to be played at the x,y position specified in the parameter list.
*
* @param aps Compressed animation that we should make an instance from
* @return If success pointer to instance, NULL if anim anim could not be played
*/
anim_instance *anim_play(anim_play_struct *aps)
{
Assert( aps->anim_info != NULL );
Assert( aps->start_at >= 0 );
Assert( aps->stop_at < aps->anim_info->total_frames );
// Assert( aps->stop_at >= aps->start_at );
Assert( !(aps->looped && aps->ping_pong) ); // shouldn't have these both set at once
MONITOR_INC(NumANIPlayed, 1);
// if (aps->ping_pong && !(aps->anim_info->flags & ANF_ALL_KEYFRAMES));
anim_instance *instance;
@@ -492,6 +195,14 @@ anim_instance *anim_play(anim_play_struct *aps)
instance->xlate_pal = 0;
}
if(aps->base_w < 0 || aps->base_h < 0) {
instance->base_w = gr_screen.max_w_unscaled;
instance->base_h = gr_screen.max_h_unscaled;
} else {
instance->base_w = aps->base_w;
instance->base_h = aps->base_h;
}
// determining the start_at frame is more complicated, since it must be a key-frame.
// Futhermore, need to subtract 1 from key-frame number, since frame number is always
// incremented the first time anim_show_next_frame() is called
@@ -516,16 +227,6 @@ anim_instance *anim_play(anim_play_struct *aps)
idx++;
}
/*while (keyp) {
if (( (keyp->frame_num-1) <= frame_num) && ( (keyp->frame_num-1) > key)) { // find closest key
key = keyp->frame_num-1;
offset = keyp->offset;
if ( key == frame_num )
break;
}
keyp = keyp->next;
}*/
if (key > instance->frame_num) { // best key is closer than current position
instance->frame_num = key;
@@ -543,20 +244,17 @@ anim_instance *anim_play(anim_play_struct *aps)
return instance;
}
// -----------------------------------------------------------------------------
// anim_show_next_frame()
//
// This function is called to blit the next frame of an anim instance to the
// screen. This is normally called by the anim_render_all() function.
//
// input: instance => pointer to animation instance
// frametime => time elapsed since last call, in seconds
//
/**
* @brief This function is called to blit the next frame of an anim instance to the screen.
* This is normally called by the anim_render_all() function.
*
* @param instance Pointer to animation instance
* @param frametime Time elapsed since last call, in seconds
*/
int anim_show_next_frame(anim_instance *instance, float frametime)
{
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
float percent_through, decompress_time, render_time, time;
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
float percent_through, decompress_time, render_time, time;
vertex image_vertex;
int aabitmap = 0;
int bpp = 16;
@@ -638,7 +336,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
instance->time_elapsed = 0.0f;
} else if(instance->ping_pong) { // pingponged animations
instance->frame_num = instance->stop_at;
// instance->time_elapsed = 0.0f;
anim_reverse_direction(instance);
} else { // one-shot animations
instance->frame_num = instance->stop_at;
@@ -653,7 +350,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
instance->time_elapsed = 0.0f;
} else if(instance->ping_pong) { // pingponged animations
instance->frame_num = instance->stop_at;
// instance->time_elapsed = 0.0f;
anim_reverse_direction(instance);
} else { // one-shot animations
instance->frame_num = instance->stop_at+1;
@@ -677,7 +373,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
}
}
Assert(frame_diff >= 0);
// nprintf(("Alan","FRAME DIFF: %d\n",frame_diff));
Assert( instance->frame_num >= 0 && instance->frame_num < instance->parent->total_frames );
// if the anim is paused, ignore all the above changes and still display this frame
@@ -688,7 +383,6 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
}
if (instance->parent->flags & ANF_XPARENT){
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
}
bpp = 16;
@@ -778,7 +472,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
if ( instance->last_bitmap != -1 ){
bm_release(instance->last_bitmap);
}
bitmap_id = bm_create(16, instance->parent->width, instance->parent->height, instance->frame, bitmap_flags);
bitmap_id = bm_create(bpp, instance->parent->width, instance->parent->height, instance->frame, bitmap_flags);
}
if ( bitmap_id == -1 ) {
@@ -794,6 +488,8 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
// determine x,y to display the bitmap at
if ( instance->world_pos == NULL ) {
gr_set_screen_scale(instance->base_w, instance->base_h);
gr_set_clip(0, 0, instance->base_w, instance->base_h, false);
if ( instance->aa_color == NULL ) {
gr_bitmap(instance->x, instance->y);
}
@@ -801,6 +497,8 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
gr_set_color_fast( (color*)instance->aa_color );
gr_aabitmap(instance->x, instance->y);
}
gr_reset_screen_scale();
gr_reset_clip();
}
else {
g3_rotate_vertex(&image_vertex,instance->world_pos);
@@ -808,23 +506,18 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED | TMAP_HTL_2D);
}
//bm_release(bitmap_id);
instance->last_bitmap = bitmap_id;
}
t2 = timer_get_fixed_seconds();
render_time = f2fl(t2-t1);
// nprintf(("Alan","DECOMPRESS: %.3fms RENDER: %.3fms\n", decompress_time*1000, render_time*1000));
return 0;
}
// -----------------------------------------------------------------------------
// anim_stop_playing()
//
// Stop an anim instance that is on the anim_render_list from playing
//
/**
* @brief Stop an anim instance that is on the anim_render_list from playing
*/
int anim_stop_playing(anim_instance* instance)
{
Assert(instance != NULL);
@@ -835,14 +528,12 @@ int anim_stop_playing(anim_instance* instance)
return 0;
}
// -----------------------------------------------------------------------------
// anim_release_render_instance()
//
// Free a particular animation instance that is on the anim_render_list. Do
// not call this function to free an animation instance in general (use
// free_anim_instance() for that), only when you want to free an instance
// that is on the anim_render_list
//
/**
* @brief Free a particular animation instance that is on the anim_render_list.
* Do not call this function to free an animation instance in general (use
* free_anim_instance() for that), only when you want to free an instance
* that is on the anim_render_list
*/
void anim_release_render_instance(anim_instance* instance)
{
Assert( instance != NULL );
@@ -865,16 +556,13 @@ void anim_release_render_instance(anim_instance* instance)
list_append( &anim_free_list, instance );
}
// -----------------------------------------------------------------------------
// anim_release_all_instances()
//
// Free all anim instances that are on the anim_render_list.
//
// input: screen_id => optional parameter that lets you only free a subset
// of the anim instances. A screen_id of 0 is the default
// value, and this is used for animations that always play
// when they are placed on the aim_render_list.
//
/**
* @brief Free all anim instances that are on the anim_render_list.
*
* @param screen_id Optional parameter that lets you only free a subset of the anim instances.
* A screen_id of 0 is the default value, and this is used for animations that always play when
* they are placed on the aim_render_list.
*/
void anim_release_all_instances(int screen_id)
{
anim_instance* A;
@@ -898,18 +586,18 @@ void anim_release_all_instances(int screen_id)
//
// Read the header of a .ani file. Below is the format of a .ani header
//
// #bytes | description
// #bytes | description
// 2 | obsolete, kept for compatibility with old versions
// 2 | version number
// 2 | fps
// 1 | transparent red value
// 1 | transparent green value
// 1 | transparent green value
// 1 | transparent blue value
// 2 | width
// 2 | height
// 2 | number of frames
// 1 | packer code
// 763 | palette
// 763 | palette
// 2 | number of key frames
// 2 | key frame number } repeats
// 4 | key frame offset } repeats
@@ -919,7 +607,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
{
ptr->width = cfread_short(fp);
// If first 2 bytes are zero, this means we are using a new format, which includes
// a version, and fps values. This is only done since a version number was not included
// a version, and fps values. This is only done since a version number was not included
// in the original header.
// default
@@ -984,20 +672,17 @@ void anim_read_header(anim *ptr, CFILE *fp)
}
}
// -----------------------------------------------------------------------------
// anim_load()
//
// Load an animation. This stores the compressed data, which instances
// of the animation can reference. Must be free'ed later with anim_free()
//
// input: name => filename of animation
// file_mapped => boolean, whether to use memory-mapped file or not.
// Memory-mapped files will page in the animation from disk
// as it is needed, but performance is not as good
//
// returns: pointer to anim that is loaded => sucess
// NULL => failure
//
/**
* @brief Load an animation. This stores the compressed data, which instances of the animation can reference.
* Must be free'ed later with anim_free().
*
* @param real_filename Filename of animation
* @param cf_dir_type
* @param file_mapped Whether to use memory-mapped file or not.
*
* @details Memory-mapped files will page in the animation from disk as it is needed, but performance is not as good.
* @return Pointer to anim that is loaded if sucess, NULL if failure.
*/
anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
{
anim *ptr;
@@ -1005,14 +690,14 @@ anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
int count,idx;
char name[_MAX_PATH];
Assert ( real_filename != NULL );
Assert( real_filename != NULL );
strcpy( name, real_filename );
strcpy_s( name, real_filename );
char *p = strchr( name, '.' );
if ( p ) {
*p = 0;
}
strcat( name, ".ani" );
strcat_s( name, ".ani" );
ptr = first_anim;
while (ptr) {
@@ -1034,7 +719,7 @@ anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
ptr->next = first_anim;
first_anim = ptr;
Assert(strlen(name) < _MAX_PATH - 1);
strcpy(ptr->name, name);
strcpy_s(ptr->name, name);
ptr->instance_count = 0;
ptr->width = 0;
ptr->height = 0;
@@ -1056,22 +741,10 @@ anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
ptr->keys[idx].frame_num = 0;
cfread(&ptr->keys[idx].frame_num, 2, 1, fp);
cfread(&ptr->keys[idx].offset, 4, 1, fp);
ptr->keys[idx].frame_num = INTEL_INT( ptr->keys[idx].frame_num );
ptr->keys[idx].offset = INTEL_INT( ptr->keys[idx].offset );
ptr->keys[idx].frame_num = INTEL_INT( ptr->keys[idx].frame_num ); //-V570
ptr->keys[idx].offset = INTEL_INT( ptr->keys[idx].offset ); //-V570
}
/*prev_keyp = &ptr->keys;
count = ptr->num_keys;
while (count--) {
keyp = (key_frame *) vm_malloc(sizeof(key_frame));
keyp->next = *prev_keyp;
*prev_keyp = keyp;
prev_keyp = &keyp->next;
keyp->frame_num = 0;
cfread(&keyp->frame_num, 2, 1, fp);
cfread(&keyp->offset, 4, 1, fp);
}*/
cfread(&count, 4, 1, fp); // size of compressed data
count = INTEL_INT( count );
@@ -1132,12 +805,10 @@ anim *anim_load(char *real_filename, int cf_dir_type, int file_mapped)
return ptr;
}
// ---------------------------------------------------
// anim_free()
//
// Free an animation that was loaded with anim_load(). All instances
// referencing this animation must be free'ed or get an assert.
//
/**
* @brief Free an animation that was loaded with anim_load().
* @details All instances referencing this animation must be free'ed or get an assert.
*/
int anim_free(anim *ptr)
{
Assert ( ptr != NULL );
@@ -1169,14 +840,14 @@ int anim_free(anim *ptr)
if ( ptr->flags & (ANF_MEM_MAPPED|ANF_STREAMED) ) {
cfclose(ptr->cfile_ptr);
if ( ptr->cache ) {
if (ptr->cache != NULL) {
vm_free(ptr->cache);
ptr->cache = NULL;
}
}
else {
Assert(ptr->data);
if ( ptr->data ) {
if (ptr->data != NULL) {
vm_free(ptr->data);
ptr->data = NULL;
}
@@ -1188,11 +859,9 @@ int anim_free(anim *ptr)
}
// ---------------------------------------------------------------------
// anim_playing()
//
// Return if an anim is playing or not.
//
/**
* @brief Return if an anim is playing or not.
*/
int anim_playing(anim_instance *ai)
{
Assert(ai != NULL);
@@ -1203,36 +872,28 @@ int anim_playing(anim_instance *ai)
}
// ---------------------------------------------------------------------
// anim_level_init()
//
// Called at the beginning of a mission to initialize any mission dependent
// anim data.
//
/**
* @brief Called at the beginning of a mission to initialize any mission dependent anim data.
* @todo Redundant?
*/
void anim_level_init()
{
}
// ---------------------------------------------------------------------
// anim_level_close()
//
// Called after the end of a mission to clean up any mission dependent
// anim data.
//
/**
* @brief Called after the end of a mission to clean up any mission dependent anim data.
*/
void anim_level_close()
{
anim_release_all_instances();
}
// ---------------------------------------------------
// anim_write_frames_out()
//
// Write the frames of a .ani file out to disk as .pcx files.
// Use naming convention: filename0000.pcx, filename0001.pcx etc.
//
// return: 0 => success
// -1 => failed
//
/**
* @brief Write the frames of a .ani file out to disk as .pcx files.
* @details Use naming convention: filename0000.pcx, filename0001.pcx etc.
*
* @return If success 0, or if failed -1
*/
int anim_write_frames_out(char *filename)
{
anim *source_anim;
@@ -1242,7 +903,7 @@ int anim_write_frames_out(char *filename)
int i,j;
ubyte **row_data;
strcpy(root_name, filename);
strcpy_s(root_name, filename);
root_name[strlen(filename)-4] = 0;
source_anim = anim_load(filename);
@@ -1255,9 +916,9 @@ int anim_write_frames_out(char *filename)
for ( i = 0; i < source_anim->total_frames; i++ ) {
anim_get_next_raw_buffer(ai, 0, 0, 16);
strcpy(pcxname, root_name);
strcpy_s(pcxname, root_name);
sprintf(buf,"%04d",i);
strcat(pcxname, buf);
strcat_s(pcxname, buf);
for ( j = 0; j < source_anim->height; j++ ) {
row_data[j] = &ai->frame[j*source_anim->width];
@@ -1278,12 +939,10 @@ int anim_write_frames_out(char *filename)
return 0;
}
// ---------------------------------------------------
// anim_display_info()
//
// Display information and statistics about a .ani file.
// This is called when -i switch is on when running ac.exe
//
/**
* @brief Display information and statistics about a .ani file.
* @details This is called when -i switch is on when running ac.exe
*/
void anim_display_info(char *real_filename)
{
CFILE *fp;
@@ -1292,12 +951,12 @@ void anim_display_info(char *real_filename)
int i, uncompressed, compressed, *key_frame_nums=NULL, tmp;
char filename[MAX_FILENAME_LEN];
strcpy( filename, real_filename );
strcpy_s( filename, real_filename );
char *p = strchr( filename, '.' );
if ( p ) {
*p = 0;
}
strcat( filename, ".ani" );
strcat_s( filename, ".ani" );
fp = cfopen(filename, "rb");
if ( !fp ) {
@@ -1309,11 +968,13 @@ void anim_display_info(char *real_filename)
// read the keyframe frame nums and offsets
key_frame_nums = (int*)vm_malloc(sizeof(int)*A.num_keys);
Assert(key_frame_nums != NULL);
if (key_frame_nums == NULL)
return;
for ( i = 0; i < A.num_keys; i++ ) {
key_frame_nums[i] = 0;
cfread(&key_frame_nums[i], 2, 1, fp);
cfread(&tmp, 4, 1, fp);
//printf("key frame num: %d,%d\n", key_frame_nums[i],tmp);
}
cfread(&compressed, 4, 1, fp);
@@ -1342,7 +1003,7 @@ void anim_display_info(char *real_filename)
printf("FPS: %d\n", A.fps);
#ifndef NDEBUG
printf("Transparent RGB: (%d,%d,%d)\n", A.xparent_r, A.xparent_g, A.xparent_b);
printf("Transparent RGB: (%u,%u,%u)\n", A.xparent_r, A.xparent_g, A.xparent_b);
#endif
printf("ac version: %d\n", A.version);
@@ -1358,11 +1019,9 @@ void anim_reverse_direction(anim_instance *ai)
{
int temp;
if(!(ai->parent->flags & ANF_ALL_KEYFRAMES)){
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
// The God of Delta-RLE demands it be thus.
Int3();
}
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
// The God of Delta-RLE demands it be thus.
Assertion( ai->parent->flags & ANF_ALL_KEYFRAMES, "Ani was set to play backwards. In order to enable this, all frames of the animation MUST be keyframes.");
// flip the animation direction
if(ai->direction == ANIM_DIRECT_FORWARD){
+4 -115
View File
@@ -7,120 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
* $Revision: 2.6.2.1 $
* $Date: 2006-09-08 06:14:43 $
* $Author: taylor $
*
* Header file for playing back anim files
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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__
@@ -137,6 +24,8 @@ typedef struct {
anim *anim_info;
int x;
int y;
int base_w;
int base_h;
int start_at;
int stop_at;
int screen_id;
@@ -163,7 +52,7 @@ void anim_level_init();
void anim_level_close();
void anim_render_all(int screen_id, float frametime);
void anim_render_one(int screen_id, anim_instance *ani, float frametime);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int max_x = -1, int max_y = -1);
anim_instance *anim_play(anim_play_struct *aps);
void anim_ignore_next_frametime();
int anim_stop_playing(anim_instance* anim_instance);
+67 -417
View File
@@ -7,220 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
* $Revision: 2.13.2.2 $
* $Date: 2007-10-28 16:32:06 $
* $Author: taylor $
*
* 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.13.2.1 2006/06/22 14:59:44 taylor
* fix various things that Valgrind has been complaining about
*
* Revision 2.13 2006/03/21 00:27:27 taylor
* some minor cleanup
*
* Revision 2.12 2006/01/22 19:57:35 wmcoolmon
* 0...1...2...4?
*
* Revision 2.11 2005/11/13 06:40:19 taylor
* add support for 8/16/24/32 bit output from ani frame decoder
*
* Revision 2.10 2005/05/24 03:13:36 taylor
* extra check to make sure that RLE reading never goes over frame size in new ANI formats
*
* Revision 2.9 2005/05/23 05:58:31 taylor
* quick catch for some corrupted anis, only a partial fix but it will do until something
* a bit more heavy duty comes along in the near future
*
* Revision 2.8 2005/05/12 17:49:10 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.7 2004/07/26 20:47:23 Kazan
* remove MCD complete
*
* Revision 2.6 2004/07/12 16:32:41 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.5 2004/03/05 09:01:53 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.4 2004/02/14 00:18:29 randomtiger
* Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
* OK, these changes effect a lot of file, I suggest everyone updates ASAP:
* Removal of many files from project.
* Removal of meanless Gr_bitmap_poly variable.
* Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
* Removal of redundant Fred paths that arent needed for Fred OGL.
* Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
* Fixed many D3D non standard mode bugs and brought OGL up to the same level.
* Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
*
* Revision 2.3 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.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/11/04 03:02:27 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.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
*
*
* 12 7/30/99 10:10p Dave
* Fixed loading bar in 32 bit mode.
*
* 11 7/18/99 1:59p Johnson
* Fixed potential anim locking problem.
*
* 10 7/16/99 1:49p Dave
* 8 bit aabitmaps. yay.
*
* 9 7/13/99 1:15p Dave
* 32 bit support. Whee!
*
* 8 4/09/99 2:21p Dave
* Multiplayer beta stuff. CD checking.
*
* 7 1/14/99 12:48a Dave
* Todo list bug fixes. Made a pass at putting briefing icons back into
* FRED. Sort of works :(
*
* 6 12/01/98 5:53p Dave
* Simplified the way pixel data is swizzled. Fixed tga bitmaps to work
* properly in D3D and Glide.
*
* 5 12/01/98 8:06a Dave
* Temporary checkin to fix some texture transparency problems in d3d.
*
* 4 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 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
*
* 30 5/14/98 3:38p John
* Added in more non-darkening colors for Adam. Had to fix some bugs in
* BmpMan and Ani stuff to get this to work.
*
* 29 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 28 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.
*
* 27 9/09/97 3:39p Sandeep
* warning level 4 bugs
*
* 26 8/22/97 8:21a Lawrance
* short circuit key frame check if keyframe matches frame we are
* searching for
*
* 25 8/21/97 5:11p Lawrance
* frame numbering for ANI's now is from 0 -> total_frames-1.
*
* 24 8/19/97 10:59a Lawrance
* fix problem with accessing key frames
*
* 23 7/28/97 10:42p Lawrance
* re-did interface to unpack_frame() to make more general
*
* 22 7/28/97 10:52a Lawrance
* correctly set bitmap flags in anim_get_frame()
*
* 21 7/21/97 5:10p Lawrance
* fix problem that was causing infinite recursion
*
* 20 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 19 6/27/97 4:36p Lawrance
* update pal translation table when gr_screen.signature changes
*
* 18 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 17 6/25/97 3:03p Lawrance
* fix palette translation problem with anti-alised bitmaps
*
* 16 5/19/97 2:28p Lawrance
* changes some variables to flags
*
* 15 5/15/97 4:42p Lawrance
* supporting animations in-game
*
* 14 2/25/97 11:06a Lawrance
* moved some higher level functions to from PackUnpack to AnimPlay
*
* 13 2/19/97 9:51p Lawrance
* made keyframe decompression more effecient, moved
* default anim FPS to header file
*
* 12 2/19/97 4:00p Lawrance
* don't assert when cannot find anim filename, return a NULL instead
*
* 11 2/17/97 4:17p Hoffoss
* modified packing internal format and added random access function to an
* Anim frame.
*
* 10 2/17/97 2:59p Lawrance
* integrating into game
*
* 9 2/14/97 11:27p Lawrance
* optimized unpacking some more (Jason)
*
* 8 2/14/97 11:09p Hoffoss
* Made optimizations.
*
* 7 2/14/97 10:48p Hoffoss
* fixed bug.
*
* 6 2/14/97 10:38p Lawrance
* fixing bugs
*
* 5 2/14/97 5:38p Hoffoss
* Changes to get AnimCoverter project to compile and link.
*
* 4 2/14/97 3:29p Hoffoss
* Added header for MSDEV to fill in.
*
* $NoKeywords: $
*/
#include "anim/packunpack.h"
#include "bmpman/bmpman.h"
@@ -228,8 +15,6 @@
#include "anim/animplay.h"
const int packer_code = PACKER_CODE;
const int transparent_code = 254;
@@ -264,6 +49,7 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
ptr->instance_count++;
inst = (anim_instance *) vm_malloc(sizeof(anim_instance));
Assert(inst);
memset(inst, 0, sizeof(anim_instance));
inst->frame_num = -1;
inst->last_frame_num = -1;
inst->parent = ptr;
@@ -314,12 +100,7 @@ int anim_get_next_frame(anim_instance *inst)
return -1;
}
if (inst->parent->flags & ANF_XPARENT) {
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
} else {
bitmap_flags = 0;
}
bitmap_flags = 0;
bpp = 16;
if(inst->aa_color != NULL){
@@ -381,159 +162,16 @@ ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap
return inst->frame;
}
// --------------------------------------------------------------------
// anim_get_frame()
//
// Get a bitmap id from the anim_instance for the specified frame_num
//
// input: *inst => pointer to anim instance
// frame_num => frame number to get (first frame is 0)
// xlate_pal => DEFAULT PARM (value 1): whether to translate the palette
// to the current game palette
//
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal)
{
/*
int bm, bitmap_flags, key = 0, offset = 0;
int idx;
if ((frame_num < 0) || (frame_num >= inst->parent->total_frames)) // illegal frame number
return -1;
int need_reset = 0;
if ( anim_instance_is_streamed(inst) ) {
if ( inst->file_offset < 0 ) {
need_reset = 1;
}
} else {
if ( !inst->data ) {
need_reset = 1;
}
}
if (need_reset || (inst->frame_num >= inst->parent->total_frames)) { // reset to valid info
inst->data = inst->parent->data;
inst->file_offset = inst->parent->file_offset;
inst->frame_num = 0;
}
bitmap_flags = 0;
if (inst->parent->flags & ANF_XPARENT) {
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
}
if ( inst->frame_num == frame_num ) {
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
bm_unload(bm);
return bm;
}
if (inst->parent->flags & ANF_XPARENT){
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
} else {
bitmap_flags = 0;
}
idx = 0;
key = 0;
while(idx < inst->parent->num_keys){
if (( (inst->parent->keys[idx].frame_num-1) <= frame_num) && ( (inst->parent->keys[idx].frame_num-1) > key)) { // find closest key
key = inst->parent->keys[idx].frame_num - 1;
offset = inst->parent->keys[idx].offset;
if ( key == frame_num )
break;
}
idx++;
}
if ( key == frame_num ) {
inst->frame_num = key;
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = inst->parent->file_offset + offset;
} else {
inst->data = inst->parent->data + offset;
}
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal ){
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
} else {
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
} else {
if ( xlate_pal ){
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
} else {
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
}
goto create_bitmap;
}
if (key > inst->frame_num) // best key is closer than current position
{
inst->frame_num = key;
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = inst->parent->file_offset + offset;
} else {
inst->data = inst->parent->data + offset;
}
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal )
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
} else {
if ( xlate_pal )
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
}
while (inst->frame_num != frame_num) {
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal )
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
} else {
if ( xlate_pal )
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
inst->frame_num++;
}
create_bitmap:
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
bm_unload(bm);
return bm;
*/
Int3();
return -1;
}
// frame = frame pixel data to pack
// save = memory to store packed data to
// size = number of bytes to pack
// max = maximum number of packed bytes (size of buffer)
// returns: actual number of bytes data packed to or -1 if error
/**
* @brief Pack key frame
*
* @param frame Frame pixel data to pack
* @param save Memory to store packed data to
* @param size Number of bytes to pack
* @param max Maximum number of packed bytes (size of buffer)
* @param compress_type Compress type
* @return Actual number of bytes data packed to or -1 if error
*/
int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_type)
{
int last = -32768, count = 0;
@@ -618,14 +256,12 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
*save++ = (ubyte)last;
packed_size++;
Assert( last != STD_RLE_CODE );
// printf("Just packed %d 1 times, since pixel change, no count included\n",last);
}
else {
count |= STD_RLE_CODE;
*save++ = (ubyte)count;
*save++ = (ubyte)last;
packed_size += 2;
// printf("Just packed %d %d times, since pixel change\n",last,count);
}
}
@@ -642,8 +278,6 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
*save++ = (ubyte)last;
packed_size += 2;
count = 0;
// printf("Just packed %d %d times, since count overflow\n",last,count);
}
} // end for
@@ -655,7 +289,6 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
if ( (count == 1) && !(last & STD_RLE_CODE) ) {
*save++ = (ubyte)last;
packed_size++;
// printf("Just packed %d 1 times, at end since single pixel, no count\n",last);
Assert( last != STD_RLE_CODE );
}
else {
@@ -663,7 +296,6 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
*save++ = (ubyte)count;
*save++ = (ubyte)last;
packed_size += 2;
// printf("Just packed %d %d times, at end since pixel change\n",last,count);
}
}
@@ -681,12 +313,17 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
return packed_size;
}
// frame = frame pixel data to pack
// frame2 = previous frame's pixel data
// save = memory to store packed data to
// size = number of bytes to pack
// max = maximum number of packed bytes (size of buffer)
// returns: actual number of bytes data packed to or -1 if error
/**
* @brief Pack frame
*
* @param frame Frame pixel data to pack
* @param frame2 Previous frame's pixel data
* @param save Memory to store packed data to
* @param size Number of bytes to pack
* @param max Maximum number of packed bytes (size of buffer)
* @param compress_type Compress type
* @return Actual number of bytes data packed to or -1 if error
*/
int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, int compress_type)
{
int pixel, last = -32768, count = 0, i;
@@ -842,7 +479,11 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
return packed_size;
}
// convert a 24 bit value to a 16 bit value
/**
* @brief Convert a 24 bit value to a 16 bit value
* @param bit_24 24 bit value
* @param bit_16 16 bit value (output)
*/
void convert_24_to_16(int bit_24, ushort *bit_16)
{
ubyte *pixel = (ubyte*)&bit_24;
@@ -851,7 +492,10 @@ void convert_24_to_16(int bit_24, ushort *bit_16)
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
}
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
/**
* @brief Unpack a pixel given the passed index and the anim_instance's palette
* @return Bytes stuffed
*/
int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bpp)
{
int bit_24;
@@ -900,7 +544,7 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3); //-V512
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
@@ -931,7 +575,10 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
return pixel_size;
}
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
/**
* @brief Unpack a pixel given the passed index and the anim_instance's palette
* @return Bytes stuffed
*/
int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0, int aabitmap = 0, int bpp = 8)
{
int bit_24;
@@ -981,7 +628,7 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0,
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3); //-V512
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
@@ -1010,10 +657,17 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0,
return (pixel_size * count);
}
// ptr = packed data to unpack
// frame = where to store unpacked data to
// size = total number of unpacked pixels requested
// pal_translate = color translation lookup table (NULL if no palette translation desired)
/**
* @brief Unpack frame
*
* @param ai Animation instance
* @param ptr Packed data to unpack
* @param frame Where to store unpacked data to
* @param size Total number of unpacked pixels requested
* @param pal_translate Color translation lookup table (NULL if no palette translation desired)
* @param aabitmap
* @param bpp
*/
ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp)
{
int xlate_pal, value, count = 0;
@@ -1096,9 +750,6 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
}
}
else if (*ptr == PACKING_METHOD_RLE) { // normal frame, Hoffoss's RLE format
// test code, to show unused pixels
// memset(frame, 255, size);
ptr++;
while (size > 0) {
@@ -1189,17 +840,23 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
}
}
else {
// Assert(0); // unknown packing method
// unknown packing method
return NULL;
}
return ptr;
}
// ptr = packed data to unpack
// frame = where to store unpacked data to
// size = total number of unpacked pixels requested
// pal_translate = color translation lookup table (NULL if no palette translation desired)
/**
* @brief Unpack frame from file
*
* @param ai Animation instance
* @param frame Where to store unpacked data to
* @param size Total number of unpacked pixels requested
* @param pal_translate Color translation lookup table (NULL if no palette translation desired)
* @param aabitmap
* @param bpp
*/
int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp)
{
int xlate_pal, value, count = 0;
@@ -1289,9 +946,6 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
}
else if (anim_instance_get_byte(ai,offset) == PACKING_METHOD_RLE) { // normal frame, Hoffoss's RLE format
// test code, to show unused pixels
// memset(frame, 255, size);
offset++;
while (size > 0) {
@@ -1386,7 +1040,7 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
}
else {
// Int3(); // unknown packing method
// unknown packing method
return -1;
}
@@ -1394,21 +1048,17 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
// TODO: actually convert the frame data to correct palette at this point
/**
* @brief Set animation palette
* @todo Actually convert the frame data to correct palette at this point
*/
void anim_set_palette(anim *ptr)
{
int i, xparent_found = 0;
// create the palette translation look-up table
for ( i = 0; i < 256; i++ ) {
//if ( (ptr->palette[i*3] == ptr->xparent_r) && (ptr->palette[i*3+1] == ptr->xparent_g) && (ptr->palette[i*3+2] == ptr->xparent_b) ) {
// ptr->palette_translation[i] = 255;
// xparent_found = 1;
//} else {
// ptr->palette_translation[i] = (ubyte)palette_find( ptr->palette[i*3], ptr->palette[i*3+1], ptr->palette[i*3+2] );
ptr->palette_translation[i] = (ubyte)i;
//}
ptr->palette_translation[i] = (ubyte)i;
}
if ( xparent_found ) {
+7 -163
View File
@@ -7,163 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
* $Revision: 2.6 $
* $Date: 2006-03-21 00:27:27 $
* $Author: taylor $
*
* 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.5 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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__
@@ -174,11 +18,11 @@ 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 PACKER_CODE 0xEE /// Used 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
@@ -227,6 +71,7 @@ typedef struct anim {
typedef struct anim_instance {
anim_instance *next, *prev;
int x,y; // coordinates anim is played at (top left corner of anim)
int base_w, base_h; // coordinate scale this anim is played in.
vec3d *world_pos; // world (x,y,z) position of explosion
float radius; // radius of image, needed for scaling
int frame_num; // current frame, or last frame if between frames (first frame is 0)
@@ -262,7 +107,6 @@ 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);
+468 -703
View File
File diff suppressed because it is too large. Load diff
+58 -200
View File
@@ -7,170 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
* $Revision: 2.12.2.4 $
* $Date: 2007-05-28 18:27:32 $
* $Author: wmcoolmon $
*
* Header file for asteroids
*
* $Log: not supported by cvs2svn $
* Revision 2.12.2.3 2006/11/15 00:36:08 taylor
* various bits of little cleanup
* get rid of some more compiler warnings
*
* Revision 2.12.2.2 2006/09/11 01:15:04 taylor
* fixes for stuff_string() bounds checking
*
* Revision 2.12.2.1 2006/08/27 18:12:39 taylor
* make Species_info[] and Asteroid_info[] dynamic
*
* Revision 2.12 2005/09/25 20:31:42 Goober5000
* okay; everything should be good to go
* --Goober5000
*
* Revision 2.11 2005/09/25 08:25:14 Goober5000
* Okay, everything should now work again. :p Still have to do a little more with the asteroids.
* --Goober5000
*
* Revision 2.9 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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__
@@ -178,26 +15,20 @@
#include "globalincs/pstypes.h"
#include "globalincs/globals.h" // for NAME_LENGTH
#include <vector>
struct object;
struct polymodel;
struct collision_info_struct;
#define MAX_ASTEROIDS 256
#define MAX_ASTEROIDS 512
#define NUM_DEBRIS_SIZES 3
#define NUM_DEBRIS_POFS 3 // Number of POFs per debris size
#define NUM_DEBRIS_SIZES 3
#define NUM_DEBRIS_POFS 3 // Number of POFs per debris size
#define ASTEROID_TYPE_SMALL 0
#define ASTEROID_TYPE_MEDIUM 1
#define ASTEROID_TYPE_LARGE 2
// This is for the asteroid types plus DEBRIS_X_Y
// (X is each species and Y is SMALL, MEDIUM, and LARGE)
// 20060826 - made dynamic -- taylor
//#define MAX_DEBRIS_TYPES ((MAX_SPECIES + 1) * NUM_DEBRIS_SIZES)
// these should always be equal for the benefit of generic asteroids (c.f. asteroid_page_in)
#define MAX_ACTIVE_DEBRIS_TYPES NUM_DEBRIS_SIZES
@@ -213,39 +44,63 @@ typedef struct asteroid_obj {
extern asteroid_obj Asteroid_obj_list;
typedef struct asteroid_info {
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // 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
int damage_type_idx; //Damage type of the 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
// Data structure for determining a type and amount of other asteroids an
// asteroid will split to when destroyed.
typedef struct asteroid_split_info {
int asteroid_type;
int min;
int max;
} asteroid_split_info;
class asteroid_info {
public:
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // POF files to load/associate with ship
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
int damage_type_idx; //Damage type of the asteroid
int damage_type_idx_sav; // stored value from table used to reset damage_type_idx
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
SCP_vector< asteroid_split_info > split_info;
polymodel *modelp[NUM_DEBRIS_POFS];
int model_num[NUM_DEBRIS_POFS];
SCP_vector<int> explosion_bitmap_anims;
float fireball_radius_multiplier; // the model radius is multiplied by this to determine the fireball size
asteroid_info() { memset(this, 0, sizeof(asteroid_info)); damage_type_idx = -1; };
} asteroid_info;
asteroid_info( )
: num_detail_levels( 0 ), max_speed( 0 ), damage_type_idx( 0 ),
damage_type_idx_sav( -1 ), inner_rad( 0 ), outer_rad( 0 ),
damage( 0 ), blast( 0 ), initial_asteroid_strength( 0 ),
fireball_radius_multiplier( -1 )
{
name[ 0 ] = 0;
memset( pof_files, 0, sizeof( pof_files ) );
memset( detail_distance, 0, sizeof( detail_distance ) );
memset( modelp, 0, sizeof( modelp ) );
memset( model_num, -1, sizeof( model_num ) );
}
};
#define AF_USED (1<<0) // Set means used.
#define AF_USED (1<<0) // Set means used.
typedef struct asteroid {
int flags;
int objnum;
int asteroid_type; // 0..MAX_DEBRIS_TYPES
int asteroid_subtype; // Index in asteroid_info for modelnum and modelp
int check_for_wrap; // timestamp to check for asteroid wrapping around field
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 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().
vec3d death_hit_pos; // hit pos that caused death
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
} asteroid;
@@ -262,27 +117,30 @@ typedef enum {
} field_type_t;
typedef struct asteroid_field {
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of 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
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 std::vector<asteroid_info> Asteroid_info;
extern SCP_vector< asteroid_info > Asteroid_info;
extern asteroid Asteroids[MAX_ASTEROIDS];
extern asteroid_field Asteroid_field;
extern int Num_asteroids;
extern int Asteroids_enabled;
extern char Asteroid_icon_closeup_model[NAME_LENGTH]; // model for asteroid field briefing icon rendering
extern vec3d Asteroid_icon_closeup_position; // closeup position for asteroid field briefing icon rendering
extern float Asteroid_icon_closeup_zoom; // zoom position for asteroid field briefing icon rendering
void asteroid_init();
void asteroid_init();
void asteroid_level_init();
void asteroid_level_close();
void asteroid_create_all();
File diff suppressed because it is too large. Load diff
+30 -64
View File
@@ -2,56 +2,13 @@
// Derek Meek
// 4-30-2004
/*
* $Logfile: /Freespace2/code/Autopilot/Autopilot.h $
* $Revision: 1.9.2.3 $
* $Date: 2007-09-02 02:07:38 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.9.2.2 2007/07/24 20:08:29 Kazan
* Make asteroid/debris fields interrupt autopilot, add "hazards near" message to autopilot.tbl, add use-nav-cinematics sexp, fix mantis #1441
*
* Revision 1.9.2.1 2007/07/23 16:08:23 Kazan
* Autopilot updates, minor misc fixes, working MSVC2005 project files
*
* Revision 1.9 2006/02/25 21:42:31 Goober5000
* fixes from last commit
*
* Revision 1.8 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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"
#include "object/object.h"
#include <map>
// milliseconds between updates
@@ -59,8 +16,8 @@
#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_WAYPOINT 0x0001 // Nav Point is bound to the position of a single node of a waypoint path
#define NP_SHIP 0x0002 // Nav Point is bound to the position 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
@@ -70,24 +27,26 @@
struct NavPoint
{
char NavName[32];
char m_NavName[32];
int flags;
void *target_obj;
int waypoint_num; //only used when flags & NP_WAYPOINT
vec3d *GetPosition();
char* GetInteralName();
char* GetInternalName();
};
#define NP_NUM_MESSAGES 6
#define NP_MSG_FAIL_NOSEL 0
#define NP_MSG_FAIL_GLIDING 1
#define NP_MSG_FAIL_TOCLOSE 2
#define NP_MSG_FAIL_HOSTILES 3
#define NP_MSG_MISC_LINKED 4
#define NP_MSG_FAIL_HAZARD 5
#define NP_MSG_FAIL_SUPPORT_PRESENT 6
#define NP_MSG_FAIL_SUPPORT_WORKING 7
#define NP_NUM_MESSAGES 8
struct NavMessage
{
@@ -100,33 +59,34 @@ extern int CurrentNav;
extern NavPoint Navs[MAX_NAVPOINTS];
extern NavMessage NavMsgs[NP_NUM_MESSAGES];
extern int LockAPConv;
extern std::map<int,int> autopilot_wings;
extern SCP_map<int,int> autopilot_wings;
// Cycles through the NavPoint List
bool Sel_NextNav();
// Tell us is autopilot is allow
// Tell us if autopilot is allowed
// This needs:
// * Nav point selected
// * No enemies within 5,000 meters
// * No enemies within AutopilotMinEnemyDistance meters
// * No asteroids within AutopilotMinAsteroidDistance meters
// * Destination > 1,000 meters away
bool CanAutopilot(bool send_msg=false);
bool CanAutopilotPos(vec3d targetPos);
// * Support ship not present or is actively leaving
bool CanAutopilot(vec3d targetPos, bool send_msg=false);
// Check if autopilot is allowed at player's current position
// See CanAutopilot(vec3d, bool) for more information
inline bool CanAutopilot(bool send_msg=false) { return CanAutopilot(Player_obj->pos, send_msg); }
// Engages autopilot
// This does:
// * Checks if Autopilot is allowed. See CanAutopilot() for conditions.
// * Control switched from player to AI
// * Time compression to 32x
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
void StartAutopilot();
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 1,000 meters away
// * Enemy < 5,000 meters
bool Autopilot_AutoDiable();
// * Tell AI to fly to targeted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
// Returns false if autopilot cannot be started. True otherwise.
bool StartAutopilot();
// Disengages autopilot
// this does:
@@ -152,6 +112,12 @@ void parse_autopilot_table(char *filename);
// Finds a Nav point by name
int FindNav(char *Nav);
// Selects a Nav point by name
void SelectNav(char *Nav);
// Deselects any navpoint selected.
void DeselectNav();
// Set A Nav point to "ZERO"
void ZeroNav(int i);
+15 -69
View File
@@ -7,64 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
* $Revision: 2.6.2.1 $
* $Date: 2007-02-11 09:51:21 $
* $Author: taylor $
*
* bmpman info that's internal to bmpman related files only
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2006/05/27 17:20:48 taylor
* 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
*
* Revision 2.5 2006/05/13 07:29:51 taylor
* 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
*
* Revision 2.4 2005/11/13 06:44:17 taylor
* 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
*
* Revision 2.3 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.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__
@@ -87,17 +30,18 @@
#define BM_TYPE_PCX 2
#define BM_TYPE_TGA 3 // 16 or 32 bit targa
#define BM_TYPE_DDS 4 // generic identifier for DDS
#define BM_TYPE_JPG 5 // 32 bit jpeg
#define BM_TYPE_ANI 6 // in-house ANI format
#define BM_TYPE_EFF 7 // specifies any type of animated image, the EFF itself is just text
#define BM_TYPE_PNG 5 // PNG
#define BM_TYPE_JPG 6 // 32 bit jpeg
#define BM_TYPE_ANI 7 // in-house ANI format
#define BM_TYPE_EFF 8 // specifies any type of animated image, the EFF itself is just text
// c-type types ( used in: bm_bitmaps[i].c_type )
#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_CUBEMAP_DDS 11 // generic DDS cubemap (uncompressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT1 12 // 24-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT3 13 // 32-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT5 14 // 32-bit cubemap (compressed cubemap surface)
#define BM_TYPE_DXT1 9 // 24 bit with switchable alpha (compressed)
#define BM_TYPE_DXT3 10 // 32 bit with 4 bit alpha (compressed)
#define BM_TYPE_DXT5 11 // 32 bit with 8 bit alpha (compressed)
#define BM_TYPE_CUBEMAP_DDS 12 // generic DDS cubemap (uncompressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT1 13 // 24-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT3 14 // 32-bit cubemap (compressed cubemap surface)
#define BM_TYPE_CUBEMAP_DXT5 15 // 32-bit cubemap (compressed cubemap surface)
// special types ( used in: bm_bitmaps[i].type )
#define BM_TYPE_RENDER_TARGET_STATIC 16 // 24/32 bit setup internally as a static render target
#define BM_TYPE_RENDER_TARGET_DYNAMIC 17 // 24/32 bit setup internally as a dynamic render target
@@ -109,7 +53,8 @@ typedef union 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
int num_frames; // used for animation -- number of frames in the animation
int keyframe; // used for animation -- keyframe info
ubyte fps; // used for animation -- frames per second
struct {
@@ -174,6 +119,7 @@ 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_png( 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 );
+498 -1247
View File
File diff suppressed because it is too large. Load diff
+16 -439
View File
@@ -7,432 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
*
* $Revision: 2.37.2.6 $
* $Date: 2007-03-22 20:14:16 $
* $Author: taylor $
*
* Prototypes for Bitmap Manager functions
*
* $Log: not supported by cvs2svn $
* Revision 2.37.2.5 2007/02/11 09:51:21 taylor
* 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
*
* Revision 2.37.2.4 2007/01/07 12:07:40 taylor
* fix bm_page_in_texture() so that it will load all frames of an animation (caused slowdowns in-game with it)
*
* Revision 2.37.2.3 2006/07/05 23:41:02 Goober5000
* spelling
*
* Revision 2.37.2.2 2006/07/05 23:36:55 Goober5000
* cvs comment tweaks
*
* Revision 2.37.2.1 2006/06/22 14:59:44 taylor
* fix various things that Valgrind has been complaining about
*
* Revision 2.37 2006/05/27 17:20:48 taylor
* 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
*
* Revision 2.36 2006/05/13 07:29:51 taylor
* 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
*
* Revision 2.35 2006/02/16 05:00:01 taylor
* 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
*
* Revision 2.34 2006/01/21 02:22:04 wmcoolmon
* Scripting updates; Special scripting image list; Better operator meta; Orientation type; Wing type; Texture type. Fix for MSVC7 compiling.
*
* Revision 2.33 2005/12/06 03:05:53 taylor
* 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
*
* Revision 2.32 2005/12/04 19:07:48 wmcoolmon
* Final commit of codebase
*
* Revision 2.31 2005/11/08 01:03:59 wmcoolmon
* More warnings instead of Int3s/Asserts, better Lua scripting, weapons_expl.tbl is no longer needed nor read, added "$Disarmed ImpactSnd:", fire-beam fix
*
* Revision 2.30 2005/09/26 04:53:19 Goober5000
* moved these per taylor's recommendation
* --Goober5000
*
* Revision 2.29 2005/09/26 04:08:53 Goober5000
* some more cleanup
* --Goober5000
*
* Revision 2.28 2005/09/26 02:15:02 Goober5000
* okay, this should all be working :)
* --Goober5000
*
* Revision 2.27 2005/09/25 05:13:07 Goober5000
* hopefully complete species upgrade
* --Goober5000
*
* Revision 2.26 2005/09/24 07:07:17 Goober5000
* another species overhaul
* --Goober5000
*
* Revision 2.25 2005/08/20 20:34:49 taylor
* some bmpman and render_target function name changes so that they make sense
* always use bm_set_render_target() rather than the gr_ version so that the graphics state is set properly
* save the original gamma ramp on OGL init so that it can be restored on exit
*
* 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 glow maps are handled; you now must set a global variable before you render a poly that uses a glow map, then set it to -1 when you're done with it
* fixed a few other misc bugs too
*
* 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
@@ -444,11 +19,6 @@
#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
@@ -519,6 +89,7 @@ extern int bm_texture_ram;
// the bitmap. On success, it returns the bitmap
// number.
int bm_load(char * filename);
int bm_load(const SCP_string& filename);
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
@@ -538,7 +109,7 @@ int bm_create( int bpp, int w, int h, void *data = NULL, 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, int clear_render_targets = 0 );
int bm_unload( int n, int clear_render_targets = 0, bool nodebug = 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
@@ -553,22 +124,25 @@ int bm_release( int n, int clear_render_targets = 0 );
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number of the first frame and nframes is set.
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
//Loads either animation (bm_load_animation) or still image (bm_load)
extern int bm_load_either(char *filename, int *nframes = NULL, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
extern int bm_load_either(char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
// 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 );
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags, bool nodebug = false);
// 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);
//gets the image type
ubyte bm_get_type(int handle);
// Unlocks a bitmap
extern void bm_unlock( int bitmapnum );
@@ -582,9 +156,6 @@ int bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, i
// 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();
@@ -601,6 +172,9 @@ void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
void bm_get_frame_usage(int *ntotal, int *nnew);
// Reload a different image into an existing bmpman slot
int bm_reload(int bitmap_handle, char* filename);
/*
* Example on using bm_create
*
@@ -694,7 +268,9 @@ 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 its 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
extern int BUMPMAP; //blah blah bumpmapping
extern int NORMMAP; // normal mapping
extern int HEIGHTMAP; // height map for normal mapping
extern int MISCMAP; // Utility map, to be utilized for various things shader authors can come up with
int bm_is_compressed(int num);
int bm_get_tcache_type(int num);
@@ -708,4 +284,5 @@ int bm_make_render_target( int width, int height, int flags );
int bm_is_render_target(int bitmap_id);
int bm_set_render_target(int handle, int face = -1);
int bm_load_and_parse_eff(char *filename, int dir_type, int *nframes, int *nfps, int *key, ubyte *type);
#endif
+805 -322
View File
File diff suppressed because it is too large. Load diff
+113 -37
View File
@@ -5,66 +5,129 @@
#include "graphics/2d.h"
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "physics/physics.h" //for avd
#include "object/object.h"
#include <string>
#include <vector>
#define CAM_STATIONARY_FOV (1<<0)
#define CAM_STATIONARY_ORI (1<<1)
#define CAM_STATIONARY_POS (1<<2)
#define CAM_DEFAULT_FLAGS 0
class camera
{
private:
friend class avd_camera;
protected:
char name[NAME_LENGTH];
int sig;
int flags;
vec3d position;
vec3d *desired_position; //NULL unless we're trying to move somewhere
vec3d translation_velocity;
vec3d translation_vel_limit;
vec3d translation_acc_limit;
object_h object_host;
int object_host_submodel;
matrix orientation;
matrix *desired_orientation; //NULL unless we're trying to point somewhere
vec3d rotation_rate;
vec3d rotation_vel_limit;
vec3d rotation_acc_limit;
object_h object_target;
int object_target_submodel;
void (*func_custom_position)(camera *cam, vec3d *pos);
void (*func_custom_orientation)(camera *cam, matrix *ori);
avd_movement fov;
avd_movement pos_x;
avd_movement pos_y;
avd_movement pos_z;
avd_movement ori[9];
//Cache stuff
float c_fov;
vec3d c_pos;
matrix c_ori;
public:
camera(char *in_name=NULL);
camera(char *in_name=NULL, int in_signature=-1);
~camera();
void clear();
void reset();
//Set'
//Set
void set_name(char *in_name);
void set_position(vec3d *in_position = NULL, 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 = NULL, 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);
void set_object_host(object *objp, int n_object_host_submodel = -1);
void set_object_target(object *objp, int n_object_target_submodel = -1);
void set_custom_position_function(void (*n_func_custom_position)(camera *cam, vec3d *pos));
void set_custom_orientation_function(void (*n_func_custom_orientation)(camera *cam, matrix *ori));
void set_fov(float in_fov, float in_fov_time = 0.0f, float in_fov_acceleration_time = 0.0f, float in_deceleration_time = 0.0f);
void set_position(vec3d *in_position = NULL, float in_translation_time = 0.0f, float in_translation_acceleration_time = 0.0f, float in_translation_deceleration_time = 0.0f, float in_end_velocity = 0.0f);
void set_translation_velocity(vec3d *in_velocity, float in_acceleration_time = 0.0f);
void set_rotation(matrix *in_orientation = NULL, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation(angles *in_angles, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation_facing(vec3d *in_target, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation_velocity(angles *in_rotation_rate, float in_acceleration_time = 0.0f);
//Get
//These return values should never ever be changed, I do this in the interest of speed.
char *get_name() {return name;}
vec3d *get_position() {return &position;}
matrix *get_orientation() {return &orientation;}
int get_signature() {return sig;}
object *get_object_host();
int get_object_host_submodel();
object *get_object_target();
int get_object_target_submodel();
float get_fov();
void get_info(vec3d *position, matrix *orientation);
//Is
bool is_empty(){return sig < 0;}
//Do
void do_frame(float in_frametime);
};
class warp_camera
{
private:
float c_time;
float c_damping;
vec3d c_vel;
vec3d c_desired_vel;
vec3d c_pos;
matrix c_ori;
public:
warp_camera();
warp_camera(object *objp);
void reset();
void set_position(vec3d *in_pos);
void set_rotation(matrix *in_ori);
void set_velocity(vec3d *in_vel, bool instantaneous);
void do_frame(float in_frametime);
void get_info(vec3d *position, matrix *orientation);
};
extern warp_camera Warp_camera;
class subtitle
{
private:
void clone(const subtitle &sub);
std::vector<std::string> text_lines;
float text_pos[2];
SCP_vector<SCP_string> text_lines;
struct { int x; int y; } text_pos;
float display_time;
float fade_time;
color text_color;
int text_fontnum;
//Done with set
char imageanim[MAX_FILENAME_LEN];
int image_id;
int image_pos[2];
struct { int x; int y; int w; int h; } image_pos;
//Time this has been displayed
float time_displayed;
@@ -72,31 +135,44 @@ private:
//When to end it
float time_displayed_end;
bool post_shaded;
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(int in_x_pos, int in_y_pos, char* in_text = NULL, char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, color *in_text_color = NULL, int in_text_fontnum = -1,
bool center_x = false, bool center_y = false, int in_width = 0, int in_height = 0, bool post_shaded=false);
~subtitle();
subtitle(const subtitle &sub) { clone(sub); }
const subtitle &operator=(const subtitle &sub);
void do_frame(float frametime);
bool is_post_shaded( ) { return post_shaded; }
};
//Some global stuff
extern std::vector<subtitle> Subtitles;
extern std::vector<camera> Cameras;
//Preset cameras
extern camera* Free_camera;
extern camera* Current_camera;
extern SCP_vector<subtitle> Subtitles;
extern float VIEWER_ZOOM_DEFAULT;
extern float Sexp_fov;
//Helpful functions
void cameras_init();
void cameras_close();
void cameras_do_frame(float frametime);
int cameras_lookup(char *name);
void cam_init();
void cam_close();
void cam_do_frame(float frametime);
camid cam_create(char *n_name=NULL, vec3d *n_pos=NULL, matrix *n_ori=NULL, object *n_object=NULL, int n_submodel_parent=-1);
camid cam_create(char *n_name, vec3d *n_pos, vec3d *n_norm, object *n_object=NULL, int n_submodel_parent=-1);
void cam_delete(camid cid);
bool cam_set_camera(camid cid);
void cam_reset_camera();
camid cam_lookup(char *name);
camid cam_get_camera(uint index);
camid cam_get_current();
uint cam_get_num();
void get_turret_cam_pos(camera *cam, vec3d *pos);
void get_turret_cam_orient(camera *cam, matrix *ori);
void subtitles_init();
void subtitles_close();
void subtitles_do_frame(float frametime);
void subtitles_do_frame_post_shaded(float frametime);
#endif // _CAMERA_H
+87 -444
View File
@@ -7,355 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
* $Revision: 2.40.2.7 $
* $Date: 2007-11-21 07:27:45 $
* $Author: Goober5000 $
*
* Utilities for operating on files
*
* $Log: not supported by cvs2svn $
* Revision 2.40.2.6 2007/04/11 18:21:20 taylor
* 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)
*
* Revision 2.40.2.5 2007/03/22 20:22:44 taylor
* 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
*
* Revision 2.40.2.4 2007/02/11 09:32:19 taylor
* forgot to remove .avi and .mpg from CF_TYPE_ROOT
*
* Revision 2.40.2.3 2007/02/11 09:25:42 taylor
* 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
*
* Revision 2.40.2.2 2006/12/26 05:11:57 taylor
* add .ogg files to movie locations
*
* Revision 2.40.2.1 2006/07/28 02:43:48 taylor
* don't lowercase the dir for chdir on non-Win32 since it could be, and probably is, case sensitive
*
* Revision 2.40 2006/04/20 06:32:00 Goober5000
* proper capitalization according to Volition
*
* Revision 2.39 2006/04/16 05:28:10 taylor
* 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
*
* Revision 2.38 2006/04/12 00:53:26 taylor
* DDS now works well on the interface, but I forgot to every commit the CFILE change so that they are actually usable :)
*
* Revision 2.37 2006/02/16 05:07:50 taylor
* minor 64-bit related fixage
*
* Revision 2.36 2006/02/13 00:20:45 Goober5000
* more tweaks, plus clarification of checks for the existence of files
* --Goober5000
*
* Revision 2.35 2006/01/17 02:33:20 wmcoolmon
* data/scripts directory
*
* Revision 2.34 2005/12/28 22:06:47 taylor
* fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;))
*
* Revision 2.33 2005/12/06 03:13:49 taylor
* 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 :v: 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
*
* Revision 2.32 2005/10/17 00:13:28 wmcoolmon
* Some cfile changes that slipped by
*
* Revision 2.31 2005/10/16 23:15:46 wmcoolmon
* Hardened cfile against array overflows
*
* Revision 2.30 2005/04/19 06:22:20 taylor
* 8 months I've been meaning to put this in the Linux tree, me == moron
*
* Revision 2.29 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.28 2005/03/02 03:13:00 taylor
* that one should never have slipped passed me (Linux specific)
*
* Revision 2.27 2005/01/30 18:32:41 taylor
* merge with Linux/OSX tree - p0130
* remove extra brace in cfile.cpp
*
* Revision 2.26 2005/01/30 12:50:08 taylor
* merge with Linux/OSX tree - p0130
*
* Revision 2.25 2005/01/09 21:40:07 wmcoolmon
* Fix for music directory parent
*
* Revision 2.24 2004/12/25 00:22:54 wmcoolmon
* Added .ogg in proper directories
*
* Revision 2.23 2004/10/31 21:29:00 taylor
* EFF animation support
*
* Revision 2.22 2004/10/09 18:08:33 taylor
* almost forgot this for the IBX stuff
*
* Revision 2.21 2004/07/26 20:47:25 Kazan
* remove MCD complete
*
* Revision 2.20 2004/07/17 09:03:29 taylor
* make sure avi and mpg movies get added to file cache
*
* Revision 2.19 2004/07/12 16:32:42 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.18 2004/06/22 23:14:09 wmcoolmon
* Nonworking OGG support for sound (not music) added, disabled load-only-used-weapons code, modification to sound system registry code.
* OGG code has been commented out, so you don't need the SDK yet.
*
* Revision 2.17 2004/05/26 02:29:44 wmcoolmon
* Scratch that - .tbm is a better extension
*
* Revision 2.16 2004/05/26 02:26:14 wmcoolmon
* Added table chunk extension
*
* Revision 2.15 2004/05/06 22:12:14 taylor
* make sure JPG and DDS files are added to the file cache for maps and effects
*
* Revision 2.14 2004/03/05 09:01:54 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.13 2004/02/04 09:02:45 Goober5000
* got rid of unnecessary double semicolons
* --Goober5000
*
* Revision 2.12 2003/08/27 01:36:22 Goober5000
* fixed a strange thing that Bobboau inexplicably put in
* --Goober5000
*
* Revision 2.11 2003/08/25 04:39:17 Goober5000
* fixed unreachable code
* --Goober5000
*
* Revision 2.10 2003/08/22 07:35:07 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.9 2003/08/20 08:12:08 wmcoolmon
* Made cfile_delete return 0 on failure, 1 on success
*
* Revision 2.8 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.7 2002/11/10 16:29:53 DTP
* -DTP reworked mod support,
*
* Revision 2.6 2002/11/04 08:32:38 DTP
* Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support.
*
* Revision 2.5 2002/10/30 06:31:05 DTP
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
*
* Revision 2.4 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.3.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.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 19:04:48 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* 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.7 2002/05/21 15:37:14 mharris
* Cosmetics - reformat Pathtypes to line up again
*
* Revision 1.6 2002/05/17 06:45:53 mharris
* More porting tweaks. It links! but segfaults...
*
* Revision 1.5 2002/05/17 02:56:19 mharris
* first crack at unix compatibity
*
* Revision 1.4 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.3 2002/05/09 22:58:08 mharris
* Added ifdef WIN32 around change-drive functions
*
* Revision 1.2 2002/05/07 13:23:17 mharris
* Port tweaks
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 20 9/08/99 10:01p Dave
* Make sure game won't run in a drive's root directory. Make sure
* standalone routes suqad war messages properly to the host.
*
* 19 9/08/99 12:03a Dave
* Make squad logos render properly in D3D all the time. Added intel anim
* directory.
*
* 18 9/06/99 2:35p Dave
* Rename briefing and debriefing voice direcrory paths properly.
*
* 17 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.
*
* 16 8/31/99 9:46a Dave
* Support for new cfile cbanims directory.
*
* 15 8/06/99 11:20a Johns
* Don't call game_cd_changed() in a demo or multiplayer beta build.
*
* 14 6/08/99 2:33p Dave
* Fixed release build warning. Put in hud config stuff.
*
* 13 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.
*
* 12 4/30/99 12:18p Dave
* Several minor bug fixes.
*
* 11 4/07/99 5:54p Dave
* Fixes for encryption in updatelauncher.
*
* 10 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 :)
*
* 9 2/22/99 10:31p Andsager
* Get rid of unneeded includes.
*
* 8 1/12/99 3:15a Dave
* Barracks screen support for selecting squad logos. We need real artwork
* :)
*
* 7 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 6 10/29/98 10:41a Dave
* Change the way cfile initializes exe directory.
*
* 5 10/13/98 9:19a Andsager
* Add localization support to cfile. Optional parameter with cfopen that
* looks for localized files.
*
* 4 10/12/98 9:54a Dave
* Fixed a few file organization things.
*
* 3 10/07/98 6:27p Dave
* Globalized mission and campaign file extensions. Removed Silent Threat
* special code. Moved \cache \players and \multidata into the \data
* directory.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 110 9/17/98 10:31a Hoffoss
* Changed code to use location of executable as root rather than relying
* on the cwd being set correctly. This is most helpful in the case of
* Fred launching due to the user double-clicking on an .fsm file in
* explorer or something (where the cwd is probably the location of the
* .fsm file).
*
* 109 9/11/98 4:14p Dave
* Fixed file checksumming of < file_size. Put in more verbose kicking and
* PXO stats store reporting.
*
* 108 9/09/98 5:53p Dave
* Put in new tracker packets in API. Change cfile to be able to checksum
* portions of a file.
*
* 107 9/04/98 3:51p Dave
* Put in validated mission updating and application during stats
* updating.
*
* 106 8/31/98 2:06p Dave
* Make cfile sort the ordering or vp files. Added support/checks for
* recognizing "mission disk" players.
*
* 105 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.
*
* 104 8/12/98 4:53p Dave
* Put in 32 bit checksumming for PXO missions. No validation on the
* actual tracker yet, though.
*
* 103 6/17/98 9:30a Allender
* fixed red alert replay stats clearing problem
*
* 102 6/05/98 9:46a Lawrance
* check for CD change on cfopen()
*
* 101 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)
*
* 100 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.
*
* 99 5/11/98 10:59a John
* Moved the low-level file reading code into cfilearchive.cpp.
*
* 98 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.
*
* 97 5/03/98 11:53a John
* Fixed filename case mangling.
*
* 96 5/03/98 8:33a John
* Made sure there weren't any more broken function lurking around like
* the one Allender fixed.
*
* 95 5/02/98 11:05p Allender
* fix cfilelength for pack files
*
*
* $NoKeywords: $
*/
#define _CFILE_INTERNAL
#include <stdlib.h>
@@ -398,10 +50,10 @@ char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
// What type this is Path Extensions Parent type
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
// Root must be index 1!!
// Root must be index 1!!
{ CF_TYPE_ROOT, "", ".mve .ogg", CF_TYPE_ROOT },
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .eff .tga .jpg .dds", CF_TYPE_DATA },
{ CF_TYPE_DATA, "data", ".cfg .txt", CF_TYPE_ROOT },
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl .tbm", CF_TYPE_DATA },
@@ -417,22 +69,22 @@ cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav .ogg", CF_TYPE_VOICE },
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav .ogg", CF_TYPE_DATA },
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb .ogg", CF_TYPE_DATA },
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .dds .tga .eff", CF_TYPE_DATA },
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .dds .tga .eff .png .jpg", CF_TYPE_DATA },
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf .ttf", CF_TYPE_DATA },
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .eff .pcx .neb .tga .jpg .dds", CF_TYPE_DATA },
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga .dds", CF_TYPE_DATA },
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .eff .pcx .neb .tga .jpg .png .dds .sdr", CF_TYPE_DATA },
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_PLAYERS, "data" DIR_SEPARATOR_STR "players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx .dds", CF_TYPE_PLAYERS },
{ CF_TYPE_SQUAD_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx .dds", CF_TYPE_PLAYERS },
{ CF_TYPE_PLAYER_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx .png .dds", CF_TYPE_PLAYERS },
{ CF_TYPE_SQUAD_IMAGES, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx .png .dds", CF_TYPE_PLAYERS },
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".pl2 .cs2 .plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_PLAYERS },
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .ibx", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .dds .fs2 .txt", CF_TYPE_DATA },
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_PLAYERS },
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp .bx", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .png .dds .fs2 .txt", CF_TYPE_DATA },
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_DEMOS, "data" DIR_SEPARATOR_STR "demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".pcx .ani .eff .tga .jpg .png .dds", CF_TYPE_DATA },
{ CF_TYPE_SCRIPTS, "data" DIR_SEPARATOR_STR "scripts", ".lua .lc", CF_TYPE_DATA },
{ CF_TYPE_FICTION, "data" DIR_SEPARATOR_STR "fiction", ".txt", CF_TYPE_DATA },
};
@@ -495,9 +147,14 @@ int cfile_in_root_dir(char *exe_path)
token_count++;
tok = strtok(NULL, DIR_SEPARATOR_STR);
} while(tok != NULL);
// root directory if we have <= 1 slash
#ifdef SCP_UNIX
// /freespace works, / does not
if(token_count <= 1) {
#else
// C:/freespace works, C:/ does not
if(token_count <= 2){
#endif
return 1;
}
@@ -627,15 +284,13 @@ int cfile_push_chdir(int type)
cf_create_default_path_string( dir, sizeof(dir)-1, type, NULL );
#ifdef _WIN32
_strlwr(dir);
char *colon_pos = strchr(dir, ':');
char *Drive = strchr(dir, ':');
if (Drive) {
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
if (colon_pos) {
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
return 1;
Path = Drive+1;
Path = colon_pos+1;
} else
#endif // _WIN32
{
@@ -649,7 +304,9 @@ int cfile_push_chdir(int type)
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
#ifdef _WIN32
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
#endif // _WIN32
return 2;
}
@@ -667,14 +324,12 @@ int cfile_chdir(char *dir)
_getcwd(OriginalDirectory, CFILE_ROOT_DIRECTORY_LEN-1);
#ifdef _WIN32
_strlwr(dir);
char *Drive = strchr(dir, ':');
if (Drive) {
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
char *colon_pos = strchr(dir, ':');
if (colon_pos) {
if (!cfile_chdrive( tolower(*(colon_pos - 1)) - 'a' + 1, 1))
return 1;
Path = Drive+1;
Path = colon_pos+1;
} else
#endif // _WIN32
{
@@ -688,7 +343,9 @@ int cfile_chdir(char *dir)
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
#ifdef _WIN32
cfile_chdrive( tolower(OriginalDirectory[0]) - 'a' + 1, 1 );
#endif // _WIN32
return 2;
}
@@ -780,10 +437,10 @@ char *cf_add_ext(char *filename, char *ext)
flen = strlen(filename);
elen = strlen(ext);
Assert(flen < MAX_PATH_LEN);
strcpy(path, filename);
strcpy_s(path, filename);
if ((flen < 4) || stricmp(path + flen - elen, ext)) {
Assert(flen + elen < MAX_PATH_LEN);
strcat(path, ext);
strcat_s(path, ext);
}
return path;
@@ -1013,7 +670,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
if ( strpbrk(file_path,"/\\:") ) {
#endif
// Full path given?
strcpy(longname, file_path );
strcpy_s(longname, file_path );
} else {
// Path type given?
Assert( dir_type != CF_TYPE_ANY );
@@ -1052,12 +709,12 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
}
happy_mode[i] = '\0';
if(need_b)
strcat(happy_mode, "b");
strcat_s(happy_mode, "b");
//*****END PROCESSING OF MODE*****
}
else
{
strcpy(happy_mode, mode);
strcpy_s(happy_mode, mode);
}
FILE *fp = fopen(longname, happy_mode);
@@ -1073,7 +730,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
int offset, size;
char copy_file_path[MAX_PATH_LEN]; // FIX change in memory from cf_find_file_location
strcpy(copy_file_path, file_path);
strcpy_s(copy_file_path, file_path);
if ( cf_find_file_location( copy_file_path, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize ) ) {
@@ -1161,53 +818,6 @@ CFILE *cfopen_special(char *file_path, char *mode, const int size, const int off
// it's a normal file
return cf_open_fill_cfblock(fp, dir_type);
}
/* char longname[_MAX_PATH];
if ( !cfile_inited ) {
Int3();
return NULL;
}
//================================================
// Check that all the parameters make sense
Assert( file_path && strlen(file_path) );
Assert( mode != NULL );
if ( (ext_num <= 0) || (!ext_list) ) {
Int3();
return NULL;
}
// cfopen_ext() only supports reading files, not creating them
if ( strchr(mode, 'w') ) {
Int3();
return NULL;
}
//================================================
// Search for file on disk, on cdrom, or in a packfile
int offset, size;
char copy_file_path[MAX_PATH_LEN]; // FIX change in memory from cf_find_file_location
strcpy(copy_file_path, file_path);
if ( cf_find_file_location_ext(copy_file_path, ext_num, ext_list, dir_type, sizeof(longname) - 1, longname, &size, &offset, localize) ) {
// Fount it, now create a cfile out of it
FILE *fp = fopen( longname, "rb" );
if ( fp ) {
if ( offset ) {
// Found it in a pack file
return cf_open_packed_cfblock(fp, dir_type, offset, size );
} else {
// Found it in a normal file
return cf_open_fill_cfblock(fp, dir_type);
}
}
}
return NULL;*/
}
@@ -1351,6 +961,7 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
cfbp->data = NULL;
cfbp->fp = fp;
cfbp->dir_type = type;
cfbp->max_read_len = 0;
int pos = ftell(fp);
if(pos == -1L)
@@ -1388,6 +999,7 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
cfbp->data = NULL;
cfbp->fp = fp;
cfbp->dir_type = type;
cfbp->max_read_len = 0;
cf_init_lowlevel_read_code(cfp,offset, size, 0 );
@@ -1425,6 +1037,8 @@ CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
cfp = &Cfile_list[cfile_block_index];
cfp->id = cfile_block_index;
cfp->version = 0;
cfbp->max_read_len = 0;
cfbp->fp = NULL;
#if defined _WIN32
cfbp->hInFile = hFile;
@@ -1488,6 +1102,22 @@ void cf_set_version( CFILE * cfile, int version )
cfile->version = version;
}
// cutoff point where cfread() will throw an error when it hits this limit
// if 'len' is 0 then this check will be disabled
void cf_set_max_read_len( CFILE * cfile, size_t len )
{
Assert( cfile != NULL );
Assert( (cfile->id >= 0) && (cfile->id < MAX_CFILE_BLOCKS) );
Cfile_block *cb = &Cfile_block_list[cfile->id];
if (len) {
cb->max_read_len = cb->raw_position + len;
} else {
cb->max_read_len = 0;
}
}
// routines to read basic data types from CFILE's. Put here to
// simplify mac/pc reading from cfiles.
@@ -1636,7 +1266,7 @@ void cfread_string_len(char *buf,int n, CFILE *file)
{
int len;
len = cfread_int(file);
Assert( len < n );
Assertion( (len < n), "len: %i, n: %i", len, n );
if (len)
cfread(buf, len, 1, file);
@@ -1719,7 +1349,7 @@ int cfwrite_string(char *buf, CFILE *file)
return cfwrite_char(0, file); // write out NULL termination
}
int cfwrite_string_len(char *buf, CFILE *file)
int cfwrite_string_len(const char *buf, CFILE *file)
{
int len = strlen(buf);
@@ -1755,7 +1385,7 @@ int cfilelength( CFILE * cfile )
// returns: number of full elements actually written
//
//
int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile)
int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return 0;
@@ -1777,18 +1407,22 @@ int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile)
return EOF;
}
int result = 0;
size_t bytes_written = 0;
size_t size = elsize * nelem;
result = fwrite(buf, elsize, nelem, cb->fp);
bytes_written = fwrite(buf, 1, size, cb->fp);
//WMC - update filesize and position
if(result > 0)
{
cb->size = filelength(fileno(cb->fp));
cb->raw_position += result;
if (bytes_written > 0) {
cb->size += bytes_written;
cb->raw_position += bytes_written;
}
return result;
#if defined(CHECK_SIZE) && !defined(NDEBUG)
Assert( cb->size == filelength(fileno(cb->fp)) );
#endif
return ((int)bytes_written / elsize);
}
@@ -1824,10 +1458,14 @@ int cfputc(int c, CFILE *cfile)
//WMC - update filesize and position
if(result != EOF)
{
cb->size = filelength(fileno(cb->fp));
cb->size += 1;
cb->raw_position += 1;
}
#if defined(CHECK_SIZE) && !defined(NDEBUG)
Assert( cb->size == filelength(fileno(cb->fp)) );
#endif
return result;
}
@@ -1864,10 +1502,14 @@ int cfputs(char *str, CFILE *cfile)
//WMC - update filesize and position
if(result != EOF)
{
cb->size = filelength(fileno(cb->fp));
cb->size += strlen(str);
cb->raw_position += strlen(str);
}
#if defined(CHECK_SIZE) && !defined(NDEBUG)
Assert( cb->size == filelength(fileno(cb->fp)) );
#endif
return result;
}
@@ -2088,7 +1730,8 @@ int cf_chksum_pack(char *filename, uint *chk_long, bool full)
else {
CLAMP(max_size, 0, safe_size);
Assert( max_size > header_offset );
Assertion(max_size > header_offset,
"max_size (%d) > header_offset in packfile %s", max_size, filename);
max_size -= header_offset;
fseek(fp, -(max_size), SEEK_END);
+73 -423
View File
@@ -7,423 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 2.17.2.5 $
* $Date: 2007-11-21 07:27:45 $
* $Author: Goober5000 $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 2.17.2.4 2007/04/11 18:21:20 taylor
* 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)
*
* Revision 2.17.2.3 2007/03/22 20:22:44 taylor
* 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
*
* Revision 2.17.2.2 2007/02/11 09:25:42 taylor
* 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
*
* Revision 2.17.2.1 2006/08/27 18:01:45 taylor
* 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
*
* Revision 2.17 2006/02/13 00:20:45 Goober5000
* more tweaks, plus clarification of checks for the existence of files
* --Goober5000
*
* Revision 2.16 2006/01/17 02:33:20 wmcoolmon
* data/scripts directory
*
* Revision 2.15 2005/12/28 22:06:47 taylor
* fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;))
*
* Revision 2.14 2005/12/06 03:13:49 taylor
* 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 :v: 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
*
* Revision 2.13 2005/10/16 23:15:46 wmcoolmon
* Hardened cfile against array overflows
*
* Revision 2.12 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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__
@@ -432,6 +16,9 @@
#include <time.h>
#include "globalincs/pstypes.h"
#include <stdexcept>
#define CF_EOF (-1)
#define CF_SEEK_SET (0)
@@ -514,6 +101,11 @@ typedef struct {
// to add file to list, or 0 to not add it.
extern int (*Get_file_list_filter)(char *filename);
// extra check for child directory under CF_TYPE_*
// NOTE: if specified cf_get_file_list() will not search pack files!
// NOTE: specified string must not contain ':' or spaces or begin with DIR_SEPARATOR!
extern const char *Get_file_list_child;
// cfile directory. valid after cfile_init() returns successfully
#define CFILE_ROOT_DIRECTORY_LEN 256
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
@@ -551,6 +143,11 @@ int cflush(CFILE *cfile);
// open a file. Once set, you can use minimum version numbers with the read functions.
void cf_set_version( CFILE * cfile, int version );
// will throw an error if cfread*() functions read past this mark
// converted to raw offsets when used, but gets passed actual length from current position
// setting 'len' to zero will disable the check
void cf_set_max_read_len(CFILE *cfile, size_t len);
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete(char *filename, int dir_type);
@@ -584,7 +181,7 @@ int cfilelength(CFILE *fp);
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);
int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile);
// Reads/writes RLE compressed data.
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile);
@@ -674,8 +271,15 @@ 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
/**
* @brief Read a fixed length string that is not null-terminated, with the length stored in file
*
* @param buf Pre-allocated array to store string
* @param n Size of pre-allocated array
* @param file File to read from
*
* @note Appends NULL character to string (buf)
*/
void cfread_string_len(char *buf,int n, CFILE *file);
// functions for writing cfiles
@@ -692,13 +296,19 @@ 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);
/**
* @brief Write a fixed length string (not including its null terminator), with the length stored in file
*
* @param buf String to write to file
* @param file File to write to
*/
int cfwrite_string_len(const char *buf, CFILE *file);
int cf_get_file_list( SCP_vector<SCP_string> &list, int pathtype, char *filter, int sort = CF_SORT_NONE, SCP_vector<file_list_info> *info = NULL );
int cf_get_file_list( int max, char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info = NULL );
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files.
@@ -738,5 +348,45 @@ int cfile_push_chdir(int type);
// restore directory on top of the stack
int cfile_pop_dir();
namespace cfile
{
// exceptions and other errors
class cfile_error : public std::exception
{
public:
cfile_error() : m_excuse("CFILE Exception")
{
}
cfile_error(const std::string &excuse) : m_excuse(excuse)
{
}
~cfile_error() throw()
{
}
virtual const char *what() const throw()
{
return m_excuse.c_str();
}
private:
std::string m_excuse;
};
class max_read_length : public cfile_error
{
public:
max_read_length(const std::string &excuse) : cfile_error(excuse)
{
}
max_read_length() : cfile_error("Attempted to read beyond length limit")
{
}
};
};
#endif /* __CFILE_H__ */
+12 -89
View File
@@ -7,95 +7,7 @@
*
*/
/*
* $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
@@ -114,6 +26,8 @@
#include "cfile/cfilearchive.h"
#include "luaconf.h"
#include <sstream>
#define CHECK_POSITION
@@ -293,6 +207,15 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
//mprintf(( "CFILE: EOF encountered in file\n" ));
}
if (cb->max_read_len) {
if ( (size_t)(cb->raw_position+size) > cb->max_read_len ) {
std::ostringstream s_buf;
s_buf << "Attempted to read " << size << "-byte(s) beyond length limit";
throw cfile::max_read_length(s_buf.str());
}
}
int bytes_read = fread( buf, 1, size, cb->fp );
if ( bytes_read > 0 ) {
cb->raw_position += bytes_read;
+3 -47
View File
@@ -7,52 +7,7 @@
*
*/
/*
* $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
@@ -82,7 +37,8 @@ typedef struct Cfile_block {
int lib_offset;
int raw_position;
int size; // for packed files
size_t max_read_len; // max read offset, for special error handling
} Cfile_block;
#define MAX_CFILE_BLOCKS 64
+81 -71
View File
@@ -7,80 +7,13 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
* $Revision: 2.6.2.2 $
* $Date: 2007-05-20 02:51:26 $
* $Author: taylor $
*
* Code for doing directory lists and sorts
*
* $Log: not supported by cvs2svn $
* Revision 2.6.2.1 2006/08/19 04:16:49 taylor
* "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
*
* Revision 2.6 2005/01/31 23:27:51 taylor
* merge with Linux/OSX tree - p0131-2
*
* 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>
#include <string>
#include <algorithm>
#ifdef _WIN32
#include <io.h>
@@ -93,7 +26,84 @@
#include "cfile/cfile.h"
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info )
{
// NOTE: This really needs to be updated to C++ style sorting at some point
int i, j, incr;
SCP_string t;
file_list_info tt;
int n = (int)list.size();
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].c_str(), list[j + incr].c_str()) > 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) {
std::reverse( list.begin(), list.end() );
if (info) {
std::reverse( info->begin(), info->end() );
}
return;
}
nprintf(("Error", "Unknown sorting method %d passed to cf_sort_filenames()\n", sort));
}
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
// n = number of filenames in list to sort
@@ -173,7 +183,7 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
t = list[n - 1 - i];
if (list[i] != t) {
strcpy(buffer, list[i]);
strcpy_s(buffer, list[i]);
strcpy(list[i], t);
strcpy(t, buffer);
+470 -415
View File
File diff suppressed because it is too large. Load diff
+2 -53
View File
@@ -7,58 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
* $Revision: 2.5 $
* $Date: 2006-04-20 06:32:00 $
* $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.4 2005/10/16 23:15:46 wmcoolmon
* Hardened cfile against array overflows
*
* Revision 2.3 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
@@ -91,6 +40,6 @@ extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
// Output: path - Fully qualified pathname.
//Returns 0 if result would be too long (invalid result)
int cf_create_default_path_string( char *path, uint path_max, int pathtype, char *filename=NULL, bool localize = false);
int cf_create_default_path_string( SCP_string &path, int pathtype, char *filename=NULL, bool localize = false );
#endif //_CFILESYSTEM_H
+17 -44
View File
@@ -7,40 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
* $Revision: 2.4.2.1 $
* $Date: 2007-05-11 03:09:21 $
* $Author: taylor $
*
* Program to create an archive file for use with cfile stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/11/13 06:38:04 taylor
* never did port this stupid thing to PPC
*
* Revision 2.3 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 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>
@@ -127,7 +94,13 @@ int write_index(char *hf, char *df)
d = fopen(df, "a+b");
if ( (h == NULL) || (d == NULL) )
{
if ( h )
fclose( h );
if ( d )
fclose( d );
return 0;
}
for (i = 0; i < Num_files; i++) {
fread(tmp_data, 32+4+4+4, 1, h);
@@ -167,7 +140,7 @@ void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_wr
}
memset( path, 0, sizeof(path) );
strcpy( path, filename );
strcpy_s( path, filename );
fswrite_int( (int*)&Total_size, fp_out_hdr );
fswrite_int( &filesize, fp_out_hdr );
@@ -213,7 +186,7 @@ void add_directory( char * dirname)
char *tmpptr;
int i = 0;
strcpy(path, dirname);
strcpy_s(path, dirname);
fswrite_int( (int*)&Total_size, fp_out_hdr);
fswrite_int( &i, fp_out_hdr);
@@ -244,7 +217,7 @@ void pack_directory( char * filespec)
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
strcpy( tmp1, filespec );
strcpy_s( tmp1, filespec );
add_directory(filespec);
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
@@ -256,7 +229,7 @@ void pack_directory( char * filespec)
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy( tmp, filespec );
strcpy_s( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
@@ -268,7 +241,7 @@ void pack_directory( char * filespec)
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy( tmp, filespec );
strcpy_s( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
@@ -305,7 +278,7 @@ void pack_directory( char * filespec)
}
if (S_ISDIR(buf.st_mode)) {
strcpy( tmp, filespec );
strcpy_s( tmp, filespec );
strcat( tmp, "/" );
strcat( tmp, dir->d_name );
pack_directory(tmp);
@@ -367,7 +340,7 @@ void print_instructions()
exit(0);
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// we end up #include'ing SDL.h which on Windows and Mac will redefine 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
@@ -391,14 +364,14 @@ int main(int argc, char *argv[] )
#endif
}
strcpy( archive, argv[1] );
strcpy_s( archive, argv[1] );
p = strchr( archive, '.' );
if (p) *p = 0; // remove extension
strcpy( archive_dat, archive );
strcpy_s( archive_dat, archive );
strcat( archive_dat, ".vp" );
strcpy( archive_hdr, archive );
strcpy_s( archive_hdr, archive );
strcat( archive_hdr, ".hdr" );
fp_out = fopen( archive_dat, "wb" );
+7 -47
View File
@@ -3,47 +3,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/cfileextractor/cfileextractor.cpp $
* $Revision: 1.9 $
* $Date: 2006-01-20 07:10:33 $
* $Author: Goober5000 $
*
* Cross-platform cmdline extractor for VP files
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2005/09/24 02:40:09 Goober5000
* get rid of a whole bunch of Microsoft warnings
* --Goober5000
*
* Revision 1.7 2005/09/20 02:45:47 taylor
* bump version to 0.6
* add a specified directory to output files to
*
* Revision 1.6 2005/09/08 05:04:15 taylor
* make it actually compile under WIN32
* bump version to 0.5 since little else is going to be done to this thing
*
* 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 "cfile/cfile.h"
#include "globalincs/pstypes.h"
@@ -137,7 +97,7 @@ typedef struct vp_fileinfo {
~vp_fileinfo() {}
} vp_fileinfo;
std::vector<vp_fileinfo> VP_FileInfo;
SCP_vector<vp_fileinfo> VP_FileInfo;
// just like strlwr() but without actually including it here
void lowercase(char *s)
@@ -264,7 +224,7 @@ void read_index(int lc = 0)
if (lc == 1)
lowercase( vpinfo.file_name );
strcpy( vpinfo.file_path, path );
strcpy_s( vpinfo.file_path, path );
VP_FileInfo.push_back(vpinfo);
}
}
@@ -301,7 +261,7 @@ void extract_all_files(char *file)
printf("Extracting: %s...\n", file);
for (uint i = 0; i < VP_FileInfo.size(); i++) {
for (size_t i = 0; i < VP_FileInfo.size(); i++) {
// save the file path to a temp location and recursively make the needed directories
if (have_outdir) {
if ( (out_len + 1 + strlen(path)) > MAX_PATH-1 )
@@ -351,7 +311,7 @@ void extract_all_files(char *file)
sprintf(path2, "%s%s%s", out_dir, DIR_SEPARATOR_STR, path);
} else {
strcpy(path2, path);
strcpy_s(path2, path);
}
fp_out = fopen(path2, "wb");
@@ -405,7 +365,7 @@ void list_all_files(char *file)
printf(" Name Size Offset Date/Time Path\n");
printf("-------------------------------------------------------------------------------\n");
for (uint i = 0; i < VP_FileInfo.size(); i++) {
for (size_t 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)
@@ -462,7 +422,7 @@ void help()
printf("\n");
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// we end up #include'ing SDL.h which on Windows and Mac will redefine 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
+443 -1100
View File
File diff suppressed because it is too large. Load diff
+27 -610
View File
@@ -8,597 +8,7 @@
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.89.2.9 $
* $Date: 2008-01-08 01:41:13 $
* $Author: Kazan $
*
* $Log: not supported by cvs2svn $
* Revision 2.89.2.8 2007/10/15 06:43:08 taylor
* FS2NetD v.2 (still a work in progress, but is ~98% complete)
*
* Revision 2.89.2.7 2007/04/11 18:21:22 taylor
* 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)
*
* Revision 2.89.2.6 2007/04/06 12:55:37 karajorma
* Add the -cap_object_update command line to force multiplayer clients to a more server friendly object update setting.
*
* Revision 2.89.2.5 2007/02/11 09:24:08 taylor
* remove -pcx32 and -jpgtga
*
* Revision 2.89.2.4 2006/11/15 00:21:40 taylor
* 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)
*
* Revision 2.89.2.3 2006/07/08 18:09:41 taylor
* 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
*
* Revision 2.89.2.2 2006/06/18 17:21:49 taylor
* add a -disable_fbo troubleshooting option for those ATI users having trouble with FBOs, but can still use envmapping otherwise
*
* Revision 2.89.2.1 2006/06/15 00:16:23 taylor
* remove previous attempts at the Y bug fix, it's now back to the retail code for that
*
* Revision 2.89 2006/05/27 17:17:57 taylor
* 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)
*
* Revision 2.88 2006/05/13 07:29:51 taylor
* 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
*
* Revision 2.87 2006/04/05 13:47:01 taylor
* remove -tga16, it's obsolete now
* add a temporary -no_emissive_light option to not use emission type light in OGL
*
* Revision 2.86 2006/03/18 10:17:58 taylor
* we already have a variable to show the framerate so lets just use the one
*
* Revision 2.85 2006/02/24 07:36:49 taylor
* try and make some sense out of that cmdline option mess, maybe it will stay sane for a few days at least :)
*
* Revision 2.84 2006/01/10 18:37:45 randomtiger
* Improvements to voice recognition system.
* Also function put on -voicer launcher option.
*
* Revision 2.83 2005/11/24 06:37:47 phreak
* Added -missile_lighting command line
*
* Revision 2.82 2005/11/23 00:43:20 phreak
* Command lines for rearm countdown timer.
*
* Revision 2.81 2005/11/21 00:46:06 Goober5000
* add ai_settings.tbl
* --Goober5000
*
* Revision 2.80 2005/11/13 06:55:38 taylor
* 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
*
* Revision 2.79 2005/10/30 20:00:22 taylor
* 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()
*
* Revision 2.78 2005/10/23 11:45:06 taylor
* add -ogl_shine to adjust the OGL shininess value so that people can play around and find the best value to use
*
* Revision 2.77 2005/10/22 04:28:16 unknownplayer
* 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.
*
* Revision 2.76 2005/10/12 05:43:40 taylor
* temporary cmdline option, -y_bug_fix, to switch between original code (default) and previous attempt at the Y-bug fix
*
* Revision 2.75 2005/09/30 09:47:06 taylor
* 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
*
* Revision 2.74 2005/09/21 03:55:31 Goober5000
* add option for warp flash; mess with the cmdlines a bit
* --Goober5000
*
* Revision 2.73 2005/07/25 05:24:16 Goober5000
* cleaned up some command line and mission flag stuff
* --Goober5000
*
* 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
@@ -631,12 +41,12 @@ extern int Cmdline_multi_log;
extern int Cmdline_multi_stream_chat_to_file;
extern int Cmdline_network_port;
extern int Cmdline_restricted_game;
extern int Cmdline_server_firing;
extern int Cmdline_spew_pof_info;
extern int Cmdline_start_netgame;
extern int Cmdline_timeout;
extern int Cmdline_use_last_pilot;
extern int Cmdline_window;
extern int Cmdline_fullscreen_window;
extern char *Cmdline_res;
@@ -650,22 +60,25 @@ extern float Cmdline_ogl_spec;
extern float static_light_factor;
extern float static_point_factor;
extern float static_tube_factor;
extern int Cmdline_2d_poof;
extern int Cmdline_alpha_env;
extern int Cmdline_ambient_factor;
extern int Cmdline_cell;
extern int Cmdline_decals;
extern int Cmdline_env;
extern int Cmdline_mipmap;
extern int Cmdline_missile_lighting;
extern int Cmdline_noglow;
extern int Cmdline_glow;
extern int Cmdline_nomotiondebris;
extern int Cmdline_noscalevid; // disables fit-to-window for movies - taylor
extern int Cmdline_nospec;
extern int Cmdline_spec;
extern int Cmdline_normal;
extern int Cmdline_height;
extern int Cmdline_enable_3d_shockwave;
extern int Cmdline_softparticles;
extern int Cmdline_postprocess;
extern int Cmdline_bloom_intensity;
extern bool Cmdline_fxaa;
extern int Cmdline_fxaa_preset;
extern bool Cmdline_fb_explosions;
// Game Speed related
extern int Cmdline_cache_bitmaps;
extern int Cmdline_img2dds;
extern int Cmdline_NoFPSCap;
extern int Cmdline_no_vsync;
@@ -679,6 +92,7 @@ extern int Cmdline_targetinfo;
// Gameplay related
extern int Cmdline_3dwarp;
extern int Cmdline_ship_choice_3d;
extern int Cmdline_weapon_choice_3d;
extern int Cmdline_warp_flash;
extern int Cmdline_autopilot_interruptable;
@@ -689,9 +103,6 @@ extern int Cmdline_voice_recognition;
// MOD related
extern char *Cmdline_mod; // DTP for mod support
extern int Cmdline_tbp;
extern int Cmdline_wcsaga;
// Multiplayer/Network related
extern char *Cmdline_almission; // DTP for autoload mission (for multi only)
extern int Cmdline_ingamejoin;
@@ -701,35 +112,41 @@ extern char *Cmdline_spew_table_crcs;
extern int Cmdline_objupd;
// Troubleshooting
extern int Cmdline_d3d_lesstmem;
extern int Cmdline_FRED2_htl;
extern int Cmdline_load_all_weapons;
extern int Cmdline_nohtl;
extern int Cmdline_noibx;
extern int Cmdline_nomovies; // WMC Toggles movie playing support
extern int Cmdline_no_set_gamma;
extern int Cmdline_novbo;
extern int Cmdline_safeloading;
extern int Cmdline_no_fbo;
extern int Cmdline_verify_vps;
extern int Cmdline_noglsl;
extern int Cmdline_mipmap;
extern int Cmdline_ati_color_swap;
extern int Cmdline_no_3d_sound;
extern int Cmdline_no_glsl_model_rendering;
extern int Cmdline_no_di_mouse;
extern int Cmdline_drawelements;
extern char* Cmdline_keyboard_layout;
// Developer/Testing related
extern char *Cmdline_start_mission;
extern int Cmdline_old_collision_sys;
extern int Cmdline_dis_collisions;
extern int Cmdline_dis_weapons;
extern int Cmdline_noparseerrors;
#ifdef Allow_NoWarn
extern int Cmdline_nowarn;
#endif
extern int Cmdline_extra_warn;
extern int Cmdline_show_mem_usage;
extern int Cmdline_show_pos;
extern int Cmdline_show_stats;
extern int Cmdline_timerbar;
extern int Cmdline_save_render_targets;
extern int Cmdline_debug_window;
extern int Cmdline_verify_vps;
#ifdef SCP_UNIX
extern int Cmdline_no_grab;
#endif
extern int Cmdline_reparse_mainhall;
//extern char FreeSpace_Directory[]; // allievating a cfilesystem problem caused by fred -- Kazan
#endif
+11 -428
View File
@@ -7,243 +7,9 @@
*
*/
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
* $Revision: 2.9 $
* $Date: 2005-12-04 19:07:48 $
* $Author: wmcoolmon $
*
* Counter measures. Created by Mike Kulas, May 12, 1997.
*
* $Log: not supported by cvs2svn $
* Revision 2.8 2005/11/21 02:43:30 Goober5000
* change from "setting" to "profile"; this way makes more sense
* --Goober5000
*
* Revision 2.7 2005/11/21 00:46:06 Goober5000
* add ai_settings.tbl
* --Goober5000
*
* Revision 2.6 2005/04/05 05:53:15 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* 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 "cmeasure/cmeasure.h"
//#include "freespace2/freespace.h"
//#include "model/model.h"
#include "ship/ship.h"
#include "math/staticrand.h"
#include "object/object.h"
@@ -253,192 +19,9 @@
#include "network/multimsgs.h"
#include "mission/missionparse.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.
//Not anymore - WMC
/*
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;
}
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" ));
}
}*/
/*
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));
}
}
}*/
// 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;
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 *= The_mission.ai_profile->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++;
//Set countermeasure velocity
vec3d vel, rand_vec;
//Get cmeasure rear velocity in world
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
//Get random velocity vector
static_randvec(arand+1, &rand_vec);
//Add it to the rear velocity
vm_vec_scale_add2(&vel, &rand_vec, 2.0f);
obj->phys_info.vel = vel;
vm_vec_zero(&obj->phys_info.rotvel);
vm_vec_zero(&obj->phys_info.max_vel);
vm_vec_zero(&obj->phys_info.max_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;
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 );
return arand; // need to return this value for multiplayer purposes
}*/
//Used to set a countermeasure velocity after being launched from a ship as a countermeasure
//ie not as a primary or secondary.
void cmeasure_set_ship_launch_vel(object *objp, object *parent_objp, int arand)
@@ -461,12 +44,6 @@ void cmeasure_set_ship_launch_vel(object *objp, object *parent_objp, int arand)
vm_vec_zero(&objp->phys_info.max_vel);
vm_vec_zero(&objp->phys_info.max_rotvel);
//Idunnit. -WMC
//objp->phys_info.flags |= PF_CONST_VEL;
//WMC - I don't think this stuff is needed with the flag I set
//WMC - Or maybe it is.
// blow out his reverse thrusters. Or drag, same thing.
objp->phys_info.rotdamp = 10000.0f;
objp->phys_info.side_slip_time_const = 10000.0f;
@@ -491,12 +68,18 @@ void cmeasure_select_next(ship *shipp)
}
}
//snd_play( &Snds[SND_CMEASURE_CYCLE] );
mprintf(("Countermeasure type set to %i in frame %i\n", shipp->current_cmeasure, Framecount));
}
// If this is a player countermeasure, let the player know he evaded a missile
/**
* @brief If this is a player countermeasure, let the player know they evaded a missile.
* @param objp [description]
*
* During single player games, this function notifies the player that evasion has occurred.
* Multiplayer games ensure that #send_countermeasure_success_packet() is called to notify the other player.
*/
void cmeasure_maybe_alert_success(object *objp)
{
//Is this a countermeasure, and does it have a parent
@@ -508,7 +91,7 @@ void cmeasure_maybe_alert_success(object *objp)
if ( objp->parent == OBJ_INDEX(Player_obj) ) {
hud_start_text_flash(XSTR("Evaded", 1430), 800);
snd_play(&Snds[SND_MISSILE_EVADED_POPUP]);
snd_play(&Snds[ship_get_sound(Player_obj, SND_MISSILE_EVADED_POPUP)]);
} else if ( Objects[objp->parent].flags & OF_PLAYER_SHIP ) {
send_countermeasure_success_packet( objp->parent );
}
+1 -166
View File
@@ -7,127 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
* $Revision: 2.6 $
* $Date: 2005-12-04 19:07:48 $
* $Author: wmcoolmon $
*
* Counter measures. Created by Mike Kulas, May 12, 1997.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2005/07/13 02:50:50 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
@@ -136,63 +16,18 @@
#include "globalincs/systemvars.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 int Countermeasures_enabled;
//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_set_ship_launch_vel(object *objp, object *parent_objp, int arand);
extern void cmeasure_select_next(object *objp);
extern void cmeasure_maybe_alert_success(object *objp);
extern float Skill_level_cmeasure_life_scale[NUM_SKILL_LEVELS];
#endif // _CMEASURE_H
File diff suppressed because it is too large. Load diff
+143 -452
View File
@@ -7,315 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 2.15.2.1 $
* $Date: 2007-12-28 02:10:34 $
* $Author: Backslash $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.15 2006/02/25 21:46:59 Goober5000
* spelling
*
* Revision 2.14 2005/10/11 05:24:33 wmcoolmon
* Gliding
*
* Revision 2.13 2005/07/13 02:50:50 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
* initial 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
@@ -354,173 +46,172 @@ typedef struct config_item {
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
bool disabled; // whether this action should be available at all
} config_item;
// --------------------------------------------------
// Keyboard #defines for the actions
// This is the value of the id field in config_item
// --------------------------------------------------
/**
* All available actions
* This is the value of the id field in config_item
*/
enum IoActionId {
// targeting a ship
TARGET_NEXT =0, //!< target next
TARGET_PREV =1, //!< target previous
TARGET_NEXT_CLOSEST_HOSTILE =2, //!< target the next hostile target
TARGET_PREV_CLOSEST_HOSTILE =3, //!< target the previous closest hostile
TOGGLE_AUTO_TARGETING =4, //!< toggle auto-targeting
TARGET_NEXT_CLOSEST_FRIENDLY =5, //!< target the next friendly ship
TARGET_PREV_CLOSEST_FRIENDLY =6, //!< target the closest friendly ship
TARGET_SHIP_IN_RETICLE =7, //!< target ship closest to center of reticle
TARGET_CLOSEST_SHIP_ATTACKING_TARGET =8, //!< target the closest ship attacking current target
TARGET_LAST_TRANMISSION_SENDER =9, //!< TARGET_LAST_TRANMISSION_SENDER
STOP_TARGETING_SHIP =10, //!< stop targeting ship
// targeting a ship
// targeting a ship's subsystem
TARGET_SUBOBJECT_IN_RETICLE =11, //!< target ships subsystem in reticle
TARGET_NEXT_SUBOBJECT =12, //!< target next subsystem on current target
TARGET_PREV_SUBOBJECT =13, //!< TARGET_PREV_SUBOBJECT
STOP_TARGETING_SUBSYSTEM =14, //!< stop targeting subsystems on ship
#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
// speed matching
MATCH_TARGET_SPEED =15, //!< match target speed
TOGGLE_AUTO_MATCH_TARGET_SPEED =16, //!< toggle auto-match target speed
// 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
// weapons
FIRE_PRIMARY =17, //!< FIRE_PRIMARY
FIRE_SECONDARY =18, //!< FIRE_SECONDARY
CYCLE_NEXT_PRIMARY =19, //!< cycle to next primary weapon
CYCLE_PREV_PRIMARY =20, //!< cycle to previous primary weapon
CYCLE_SECONDARY =21, //!< cycle to next secondary weapon
CYCLE_NUM_MISSLES =22, //!< cycle number of missiles fired from secondary bank
LAUNCH_COUNTERMEASURE =23, //!< LAUNCH_COUNTERMEASURE
// speed matching
#define MATCH_TARGET_SPEED 15
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
// controls
FORWARD_THRUST =24, //!< FORWARD_THRUST
REVERSE_THRUST =25, //!< REVERSE_THRUST
BANK_LEFT =26, //!< BANK_LEFT
BANK_RIGHT =27, //!< BANK_RIGHT
PITCH_FORWARD =28, //!< PITCH_FORWARD
PITCH_BACK =29, //!< PITCH_BACK
YAW_LEFT =30, //!< YAW_LEFT
YAW_RIGHT =31, //!< YAW_RIGHT
// 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
// throttle control
ZERO_THROTTLE =32, //!< ZERO_THROTTLE
MAX_THROTTLE =33, //!< MAX_THROTTLE
ONE_THIRD_THROTTLE =34, //!< ONE_THIRD_THROTTLE
TWO_THIRDS_THROTTLE =35, //!< TWO_THIRDS_THROTTLE
PLUS_5_PERCENT_THROTTLE =36, //!< PLUS_5_PERCENT_THROTTLE
MINUS_5_PERCENT_THROTTLE =37, //!< MINUS_5_PERCENT_THROTTLE
// 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
// squadmate messaging keys
ATTACK_MESSAGE =38, //!< wingman message: attack current target
DISARM_MESSAGE =39, //!< wingman message: disarm current target
DISABLE_MESSAGE =40, //!< wingman message: disable current target
ATTACK_SUBSYSTEM_MESSAGE =41, //!< wingman message: disable current target
CAPTURE_MESSAGE =42, //!< wingman message: capture current target
ENGAGE_MESSAGE =43, //!< wingman message: engage enemy
FORM_MESSAGE =44, //!< wingman message: form on my wing
IGNORE_MESSAGE =45, //!< IGNORE_MESSAGE
PROTECT_MESSAGE =46, //!< wingman message: protect current target
COVER_MESSAGE =47, //!< wingman message: cover me
WARP_MESSAGE =48, //!< wingman message: warp out
REARM_MESSAGE =49, //!< REARM_MESSAGE
TARGET_CLOSEST_SHIP_ATTACKING_SELF =50, //!< target closest ship that is attacking player
// 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
// Views
VIEW_CHASE =51, //!< VIEW_CHASE
VIEW_EXTERNAL =52, //!< VIEW_EXTERNAL
VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK =53, //!< VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK
VIEW_SLEW =54, //!< VIEW_SLEW
VIEW_OTHER_SHIP =55, //!< VIEW_OTHER_SHIP
VIEW_DIST_INCREASE =56, //!< VIEW_DIST_INCREASE
VIEW_DIST_DECREASE =57, //!< VIEW_DIST_DECREASE
VIEW_CENTER =58, //!< VIEW_CENTER
PADLOCK_UP =59, //!< PADLOCK_UP
PADLOCK_DOWN =60, //!< PADLOCK_DOWN
PADLOCK_LEFT =61, //!< PADLOCK_LEFT
PADLOCK_RIGHT =62, //!< PADLOCK_RIGHT
// 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
RADAR_RANGE_CYCLE =63, //!< cycle to next radar range
SQUADMSG_MENU =64, //!< toggle the squadmate messaging menu
SHOW_GOALS =65, //!< show the mission goals screen
END_MISSION =66, //!< end the mission
TARGET_TARGETS_TARGET =67, //!< target your target's target
AFTERBURNER =68, //!< AFTERBURNER
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
INCREASE_WEAPON =69, //!< increase weapon recharge rate
DECREASE_WEAPON =70, //!< decrease weapon recharge rate
INCREASE_SHIELD =71, //!< increase shield recharge rate
DECREASE_SHIELD =72, //!< decrease shield recharge rate
INCREASE_ENGINE =73, //!< increase energy to engines
DECREASE_ENGINE =74, //!< decrease energy to engines
ETS_EQUALIZE =75, //!< equalize recharge rates
SHIELD_EQUALIZE =76, //!< equalize shield energy to all quadrants
SHIELD_XFER_TOP =77, //!< transfer shield energy to front
SHIELD_XFER_BOTTOM =78, //!< transfer shield energy to rear
SHIELD_XFER_LEFT =79, //!< transfer shield energy to left
SHIELD_XFER_RIGHT =80, //!< transfer shield energy to right
// 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
XFER_SHIELD =81, //!< transfer energy to shield from weapons
XFER_LASER =82, //!< transfer energy to weapons from shield
//Backslash -- this was a convenient place for Glide When Pressed, since Show Damage Popup isn't used
GLIDE_WHEN_PRESSED =83, //!< GLIDE_WHEN_PRESSED
BANK_WHEN_PRESSED =84, //!< BANK_WHEN_PRESSED
SHOW_NAVMAP =85, //!< SHOW_NAVMAP
ADD_REMOVE_ESCORT =86, //!< ADD_REMOVE_ESCORT
ESCORT_CLEAR =87, //!< ESCORT_CLEAR
TARGET_NEXT_ESCORT_SHIP =88, //!< TARGET_NEXT_ESCORT_SHIP
TARGET_CLOSEST_REPAIR_SHIP =89, //!< target the closest repair ship
TARGET_NEXT_UNINSPECTED_CARGO =90, //!< TARGET_NEXT_UNINSPECTED_CARGO
TARGET_PREV_UNINSPECTED_CARGO =91, //!< TARGET_PREV_UNINSPECTED_CARGO
TARGET_NEWEST_SHIP =92, //!< TARGET_NEWEST_SHIP
TARGET_NEXT_LIVE_TURRET =93, //!< TARGET_NEXT_LIVE_TURRET
TARGET_PREV_LIVE_TURRET =94, //!< TARGET_PREV_LIVE_TURRET
#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
TARGET_NEXT_BOMB =95, //!< TARGET_NEXT_BOMB
TARGET_PREV_BOMB =96, //!< TARGET_PREV_BOMB
#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
// multiplayer messaging keys
MULTI_MESSAGE_ALL =97, //!< message all netplayers
MULTI_MESSAGE_FRIENDLY =98, //!< message all friendlies
MULTI_MESSAGE_HOSTILE =99, //!< message all hostiles
MULTI_MESSAGE_TARGET =100, //!< message targeted ship (if player)
#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
// multiplayer misc keys
MULTI_OBSERVER_ZOOM_TO =101, //!< if i'm an observer, zoom to my targeted object
#define GLIDE_WHEN_PRESSED 83
//Backslash -- this was a convenient place for Glide When Pressed, since Show Damage Popup isn't used
#define BANK_WHEN_PRESSED 84
#define SHOW_NAVMAP 85
#define ADD_REMOVE_ESCORT 86
#define ESCORT_CLEAR 87
#define TARGET_NEXT_ESCORT_SHIP 88
TIME_SPEED_UP =102, //!< TIME_SPEED_UP
TIME_SLOW_DOWN =103, //!< TIME_SLOW_DOWN
#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
TOGGLE_HUD_CONTRAST =104, //!< toggle between high and low HUD contrast
#define TARGET_NEXT_BOMB 95
#define TARGET_PREV_BOMB 96
MULTI_TOGGLE_NETINFO =105, //!< toggle network info
// multiplayer messaging keys
#define MULTI_MESSAGE_ALL 97
#define MULTI_MESSAGE_FRIENDLY 98
#define MULTI_MESSAGE_HOSTILE 99
#define MULTI_MESSAGE_TARGET 100
MULTI_SELF_DESTRUCT =106, //!< self destruct (multiplayer only)
// multiplayer misc keys
#define MULTI_OBSERVER_ZOOM_TO 101
TOGGLE_HUD =107, //!< TOGGLE_HUD
RIGHT_SLIDE_THRUST =108, //!< RIGHT_SLIDE_THRUST
LEFT_SLIDE_THRUST =109, //!< LEFT_SLIDE_THRUST
UP_SLIDE_THRUST =110, //!< UP_SLIDE_THRUST
DOWN_SLIDE_THRUST =111, //!< DOWN_SLIDE_THRUST
HUD_TARGETBOX_TOGGLE_WIREFRAME =112, //!< HUD_TARGETBOX_TOGGLE_WIREFRAME
VIEW_TOPDOWN =113, //!< VIEW_TOPDOWN
VIEW_TRACK_TARGET =114, //!< VIEW_TRACK_TARGET
#define TIME_SPEED_UP 102
#define TIME_SLOW_DOWN 103
//AutoPilot - Kazan
AUTO_PILOT_TOGGLE =115, //!< Autopilot key control
NAV_CYCLE =116, //!< NAV_CYCLE
#define TOGGLE_HUD_CONTRAST 104
//Gliding
TOGGLE_GLIDING =117, //!< TOGGLE_GLIDING
#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
//Gliding
#define TOGGLE_GLIDING 117
// this should be the total number of control action defines above (or last define + 1)
#define CCFG_MAX 118
/**
* This must always be below the last defined action
*/
CCFG_MAX //!< The total number of defined control actions (or last define + 1)
};
extern int Failed_key_index;
extern int Invert_heading;
+296 -444
View File
@@ -7,431 +7,17 @@
*
*/
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 2.14.2.2 $
* $Date: 2007-12-28 02:10:35 $
* $Author: Backslash $
*
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
*
* $Log: not supported by cvs2svn $
* Revision 2.14.2.1 2006/07/20 01:51:20 Goober5000
* tweak control text
* --Goober5000
*
* Revision 2.14 2006/02/25 21:46:59 Goober5000
* spelling
*
* Revision 2.13 2005/10/11 05:24:33 wmcoolmon
* Gliding
*
* 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/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
* initial 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 <stdio.h>
#include <stdarg.h>
#include "cfile/cfile.h"
#include "controlconfig/controlsconfig.h"
#include "io/key.h"
#include "io/joy.h"
#include "localization/localize.h"
#include "parse/parselo.h"
#include "globalincs/systemvars.h"
#include "globalincs/def_files.h"
#define TARGET_TAB 0
#define SHIP_TAB 1
@@ -577,10 +163,10 @@ config_item Control_config[CCFG_MAX + 1] = {
{ 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_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All" },
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly" },
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile" },
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target" },
{ 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" },
@@ -703,7 +289,7 @@ char *Joy_button_text_french[] = {
"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"
"Bouton 31", "Bouton 32", "Chapeau Arriere", "Chapeau Avant", "Chapeau Gauche", "Chapeau Droite"
};
// This is the text that is displayed on the screen for the keys a player selects
@@ -863,21 +449,48 @@ int translate_key_to_index(char *key)
// or there is no key current bound to the function, NULL is returned.
char *translate_key(char *key)
{
int index = -1, code = -1;
int index = -1, key_code = -1, joy_code = -1;
char *key_text = NULL;
char *joy_text = NULL;
static char text[40] = {"None"};
index = translate_key_to_index(key);
if (index < 0)
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);
key_code = Control_config[index].key_id;
joy_code = Control_config[index].joy_id;
Failed_key_index = index;
if (key_code >= 0) {
key_text = textify_scancode(key_code);
}
if (joy_code >= 0) {
joy_text = Joy_button_text[joy_code];
}
// both key and joystick button are mapped to this control
if ((key_code >= 0 ) && (joy_code >= 0) ) {
strcpy_s(text, key_text);
strcat_s(text, " or ");
strcat_s(text, joy_text);
}
// if we only have one
else if (key_code >= 0 ) {
strcpy_s(text, key_text);
}
else if (joy_code >= 0) {
strcpy_s(text, joy_text);
}
else {
strcpy_s(text, "None");
}
return text;
}
char *textify_scancode(int code)
@@ -887,35 +500,43 @@ char *textify_scancode(int code)
if (code < 0)
return "None";
int keycode = code & KEY_MASK;
*text = 0;
if (code & KEY_ALTED) {
if (code & KEY_ALTED && !(keycode == KEY_LALT || keycode == KEY_RALT)) {
if(Lcl_gr){
strcat(text, "Alt-");
strcat_s(text, "Alt-");
} else if(Lcl_fr){
strcat(text, "Alt-");
strcat_s(text, "Alt-");
} else {
strcat(text, "Alt-");
strcat_s(text, "Alt-");
}
}
if (code & KEY_SHIFTED) {
if (code & KEY_SHIFTED && !(keycode == KEY_LSHIFT || keycode == KEY_RSHIFT)) {
if(Lcl_gr){
strcat(text, "Shift-");
strcat_s(text, "Shift-");
} else if(Lcl_fr){
strcat(text, "Maj.-");
strcat_s(text, "Maj.-");
} else {
strcat(text, "Shift-");
strcat_s(text, "Shift-");
}
}
strcat(text, Scan_code_text[code & KEY_MASK]);
strcat_s(text, Scan_code_text[keycode]);
return text;
}
//XSTR:ON
void control_config_common_load_overrides();
// initialize common control config stuff - call at game startup after localization has been initialized
void control_config_common_init()
{
for (int i=0; i<CCFG_MAX; i++)
Control_config[i].disabled = false;
control_config_common_load_overrides();
if(Lcl_gr){
Scan_code_text = Scan_code_text_german;
Joy_button_text = Joy_button_text_german;
@@ -933,3 +554,234 @@ void control_config_common_init()
Joy_button_text = Joy_button_text_english;
}
}
#include <map>
#include <string>
SCP_map<SCP_string, int> mEnumNameToVal;
void LoadEnumsIntoMap();
void control_config_common_load_overrides()
{
LoadEnumsIntoMap();
if (cf_exists_full("controlconfigdefaults.tbl", CF_TYPE_TABLES))
read_file_text("controlconfigdefaults.tbl", CF_TYPE_TABLES);
else
read_file_text_from_array(defaults_get_file("controlconfigdefaults.tbl"));
reset_parse();
// start parsing
required_string("#ControlConfigOverride");
// read fonts
while (required_string_either("#End","$Bind Name:"))
{
const int iBufferLength = 64;
char szTempBuffer[iBufferLength];
required_string("$Bind Name:");
stuff_string(szTempBuffer, F_NAME, iBufferLength);
const size_t cCntrlAryLength = sizeof(Control_config) / sizeof(Control_config[0]);
for (size_t i = 0; i < cCntrlAryLength; ++i)
{
config_item& r_ccConfig = Control_config[i];
if (!strcmp(szTempBuffer, r_ccConfig.text))
{
/**
* short key_default;
* short joy_default;
* char tab;
* bool hasXSTR;
* char type;
*/
int iTemp;
if (optional_string("$Key Default:"))
{stuff_string(szTempBuffer, F_NAME, iBufferLength);
r_ccConfig.key_default = (short)mEnumNameToVal[szTempBuffer];}
if (optional_string("$Joy Default:"))
{stuff_int(&iTemp); r_ccConfig.joy_default = (short)iTemp;}
if (optional_string("$Key Mod Shift:"))
{stuff_int(&iTemp); r_ccConfig.key_default |= (iTemp == 1) ? KEY_SHIFTED : 0;}
if (optional_string("$Key Mod Alt:"))
{stuff_int(&iTemp); r_ccConfig.key_default |= (iTemp == 1) ? KEY_ALTED : 0;}
if (optional_string("$Key Mod Ctrl:"))
{stuff_int(&iTemp); r_ccConfig.key_default |= (iTemp == 1) ? KEY_CTRLED : 0;}
if (optional_string("$Category:"))
{stuff_string(szTempBuffer, F_NAME, iBufferLength);
r_ccConfig.tab = (char)mEnumNameToVal[szTempBuffer];}
if (optional_string("$Has XStr:"))
{stuff_int(&iTemp); r_ccConfig.hasXSTR = (iTemp == 1);}
if (optional_string("$Type:"))
{stuff_string(szTempBuffer, F_NAME, iBufferLength);
r_ccConfig.type = (char)mEnumNameToVal[szTempBuffer];}
if (optional_string("+Disable"))
r_ccConfig.disabled = true;
// Nerf the buffer now.
szTempBuffer[0] = '\0';
}
else if ((i + 1) == cCntrlAryLength)
{
error_display(1, "Bind Name not found: %s\n", szTempBuffer);
advance_to_eoln(NULL);
ignore_white_space();
return;
}
}
}
required_string("#End");
}
#define ADD_ENUM_TO_ENUM_MAP(Enum) mEnumNameToVal[#Enum] = (Enum);
void LoadEnumsIntoMap()
{
mEnumNameToVal["KEY_SHIFTED"] = KEY_SHIFTED;
/*
ADD_ENUM_TO_ENUM_MAP(KEY_SHIFTED)
ADD_ENUM_TO_ENUM_MAP(KEY_ALTED)
ADD_ENUM_TO_ENUM_MAP(KEY_CTRLED)
ADD_ENUM_TO_ENUM_MAP(KEY_DEBUGGED)
ADD_ENUM_TO_ENUM_MAP(KEY_DEBUGGED1)
ADD_ENUM_TO_ENUM_MAP(KEY_MASK)
ADD_ENUM_TO_ENUM_MAP(KEY_DEBUG_KEY)
*/
ADD_ENUM_TO_ENUM_MAP(KEY_0)
ADD_ENUM_TO_ENUM_MAP(KEY_1)
ADD_ENUM_TO_ENUM_MAP(KEY_2)
ADD_ENUM_TO_ENUM_MAP(KEY_3)
ADD_ENUM_TO_ENUM_MAP(KEY_4)
ADD_ENUM_TO_ENUM_MAP(KEY_5)
ADD_ENUM_TO_ENUM_MAP(KEY_6)
ADD_ENUM_TO_ENUM_MAP(KEY_7)
ADD_ENUM_TO_ENUM_MAP(KEY_8)
ADD_ENUM_TO_ENUM_MAP(KEY_9)
ADD_ENUM_TO_ENUM_MAP(KEY_A)
ADD_ENUM_TO_ENUM_MAP(KEY_B)
ADD_ENUM_TO_ENUM_MAP(KEY_C)
ADD_ENUM_TO_ENUM_MAP(KEY_D)
ADD_ENUM_TO_ENUM_MAP(KEY_E)
ADD_ENUM_TO_ENUM_MAP(KEY_F)
ADD_ENUM_TO_ENUM_MAP(KEY_G)
ADD_ENUM_TO_ENUM_MAP(KEY_H)
ADD_ENUM_TO_ENUM_MAP(KEY_I)
ADD_ENUM_TO_ENUM_MAP(KEY_J)
ADD_ENUM_TO_ENUM_MAP(KEY_K)
ADD_ENUM_TO_ENUM_MAP(KEY_L)
ADD_ENUM_TO_ENUM_MAP(KEY_M)
ADD_ENUM_TO_ENUM_MAP(KEY_N)
ADD_ENUM_TO_ENUM_MAP(KEY_O)
ADD_ENUM_TO_ENUM_MAP(KEY_P)
ADD_ENUM_TO_ENUM_MAP(KEY_Q)
ADD_ENUM_TO_ENUM_MAP(KEY_R)
ADD_ENUM_TO_ENUM_MAP(KEY_S)
ADD_ENUM_TO_ENUM_MAP(KEY_T)
ADD_ENUM_TO_ENUM_MAP(KEY_U)
ADD_ENUM_TO_ENUM_MAP(KEY_V)
ADD_ENUM_TO_ENUM_MAP(KEY_W)
ADD_ENUM_TO_ENUM_MAP(KEY_X)
ADD_ENUM_TO_ENUM_MAP(KEY_Y)
ADD_ENUM_TO_ENUM_MAP(KEY_Z)
ADD_ENUM_TO_ENUM_MAP(KEY_MINUS)
ADD_ENUM_TO_ENUM_MAP(KEY_EQUAL)
ADD_ENUM_TO_ENUM_MAP(KEY_DIVIDE)
ADD_ENUM_TO_ENUM_MAP(KEY_SLASH)
ADD_ENUM_TO_ENUM_MAP(KEY_SLASH_UK)
ADD_ENUM_TO_ENUM_MAP(KEY_COMMA)
ADD_ENUM_TO_ENUM_MAP(KEY_PERIOD)
ADD_ENUM_TO_ENUM_MAP(KEY_SEMICOL)
ADD_ENUM_TO_ENUM_MAP(KEY_LBRACKET)
ADD_ENUM_TO_ENUM_MAP(KEY_RBRACKET)
ADD_ENUM_TO_ENUM_MAP(KEY_RAPOSTRO)
ADD_ENUM_TO_ENUM_MAP(KEY_LAPOSTRO)
ADD_ENUM_TO_ENUM_MAP(KEY_ESC)
ADD_ENUM_TO_ENUM_MAP(KEY_ENTER)
ADD_ENUM_TO_ENUM_MAP(KEY_BACKSP)
ADD_ENUM_TO_ENUM_MAP(KEY_TAB)
ADD_ENUM_TO_ENUM_MAP(KEY_SPACEBAR)
ADD_ENUM_TO_ENUM_MAP(KEY_NUMLOCK)
ADD_ENUM_TO_ENUM_MAP(KEY_SCROLLOCK)
ADD_ENUM_TO_ENUM_MAP(KEY_CAPSLOCK)
ADD_ENUM_TO_ENUM_MAP(KEY_LSHIFT)
ADD_ENUM_TO_ENUM_MAP(KEY_RSHIFT)
ADD_ENUM_TO_ENUM_MAP(KEY_LALT)
ADD_ENUM_TO_ENUM_MAP(KEY_RALT)
ADD_ENUM_TO_ENUM_MAP(KEY_LCTRL)
ADD_ENUM_TO_ENUM_MAP(KEY_RCTRL)
ADD_ENUM_TO_ENUM_MAP(KEY_F1)
ADD_ENUM_TO_ENUM_MAP(KEY_F2)
ADD_ENUM_TO_ENUM_MAP(KEY_F3)
ADD_ENUM_TO_ENUM_MAP(KEY_F4)
ADD_ENUM_TO_ENUM_MAP(KEY_F5)
ADD_ENUM_TO_ENUM_MAP(KEY_F6)
ADD_ENUM_TO_ENUM_MAP(KEY_F7)
ADD_ENUM_TO_ENUM_MAP(KEY_F8)
ADD_ENUM_TO_ENUM_MAP(KEY_F9)
ADD_ENUM_TO_ENUM_MAP(KEY_F10)
ADD_ENUM_TO_ENUM_MAP(KEY_F11)
ADD_ENUM_TO_ENUM_MAP(KEY_F12)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD0)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD1)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD2)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD3)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD4)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD5)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD6)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD7)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD8)
ADD_ENUM_TO_ENUM_MAP(KEY_PAD9)
ADD_ENUM_TO_ENUM_MAP(KEY_PADMINUS)
ADD_ENUM_TO_ENUM_MAP(KEY_PADPLUS)
ADD_ENUM_TO_ENUM_MAP(KEY_PADPERIOD)
ADD_ENUM_TO_ENUM_MAP(KEY_PADDIVIDE)
ADD_ENUM_TO_ENUM_MAP(KEY_PADMULTIPLY)
ADD_ENUM_TO_ENUM_MAP(KEY_PADENTER)
ADD_ENUM_TO_ENUM_MAP(KEY_INSERT)
ADD_ENUM_TO_ENUM_MAP(KEY_HOME)
ADD_ENUM_TO_ENUM_MAP(KEY_PAGEUP)
ADD_ENUM_TO_ENUM_MAP(KEY_DELETE)
ADD_ENUM_TO_ENUM_MAP(KEY_END)
ADD_ENUM_TO_ENUM_MAP(KEY_PAGEDOWN)
ADD_ENUM_TO_ENUM_MAP(KEY_UP)
ADD_ENUM_TO_ENUM_MAP(KEY_DOWN)
ADD_ENUM_TO_ENUM_MAP(KEY_LEFT)
ADD_ENUM_TO_ENUM_MAP(KEY_RIGHT)
ADD_ENUM_TO_ENUM_MAP(KEY_PRINT_SCRN)
ADD_ENUM_TO_ENUM_MAP(KEY_PAUSE)
ADD_ENUM_TO_ENUM_MAP(KEY_BREAK)
ADD_ENUM_TO_ENUM_MAP(TARGET_TAB)
ADD_ENUM_TO_ENUM_MAP(SHIP_TAB)
ADD_ENUM_TO_ENUM_MAP(WEAPON_TAB)
ADD_ENUM_TO_ENUM_MAP(COMPUTER_TAB)
}
-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);
}
+61 -305
View File
@@ -7,239 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 2.18.2.4 $
* $Date: 2007-09-02 02:07:39 $
* $Author: Goober5000 $
* $Revision: 2.18.2.4 $
* $Date: 2007-09-02 02:07:39 $
* $Author: Goober5000 $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.18.2.3 2007/03/22 20:54:00 taylor
* give a better msg when movies can't play because they are user-disabled with the cmdline option
*
* Revision 2.18.2.2 2007/02/09 23:58:28 taylor
* add the "show all" hotkey to the cutscene viewer
*
* Revision 2.18.2.1 2006/09/11 01:15:04 taylor
* fixes for stuff_string() bounds checking
*
* Revision 2.18 2006/05/09 09:21:15 taylor
* 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. :))
*
* Revision 2.17 2005/07/02 19:42:14 taylor
* ton of non-standard resolution fixes
*
* 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"
@@ -267,15 +35,16 @@ char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
"2_ViewFootage-m"
};
int Num_cutscenes;
int Cutscenes_viewable;
int Description_index;
cutscene_info Cutscenes[MAX_CUTSCENES];
SCP_vector<cutscene_info> Cutscenes;
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
void cutscene_close(){
for(int i = 0; i<MAX_CUTSCENES; i++)
if(Cutscenes[i].description)vm_free(Cutscenes[i].description);
void cutscene_close()
{
for(SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut)
if(cut->description)
vm_free(cut->description);
}
// initialization stuff for cutscenes
@@ -284,6 +53,7 @@ void cutscene_init()
atexit(cutscene_close);
char buf[MULTITEXT_LENGTH];
int rval;
cutscene_info cutinfo;
// open localization
lcl_ext_open();
@@ -294,28 +64,34 @@ void cutscene_init()
return;
}
read_file_text("cutscenes.tbl");
read_file_text("cutscenes.tbl", CF_TYPE_TABLES);
reset_parse();
// parse in all the cutscenes
Num_cutscenes = 0;
Cutscenes.clear();
skip_to_string("#Cutscenes");
ignore_white_space();
while ( required_string_either("#End", "$Filename:") ) {
Assert ( Num_cutscenes < MAX_CUTSCENES );
while ( required_string_either("#End", "$Filename:") )
{
memset(&cutinfo, 0, sizeof(cutscene_info));
required_string("$Filename:");
stuff_string( Cutscenes[Num_cutscenes].filename, F_PATHNAME, MAX_FILENAME_LEN );
stuff_string( cutinfo.filename, F_PATHNAME, MAX_FILENAME_LEN );
required_string("$Name:");
stuff_string( Cutscenes[Num_cutscenes].name, F_NAME, NAME_LENGTH );
stuff_string( cutinfo.name, F_NAME, NAME_LENGTH );
required_string("$Description:");
stuff_string(buf, F_MULTITEXT, sizeof(buf));
drop_white_space(buf);
compact_multitext_string(buf);
Cutscenes[Num_cutscenes].description = vm_strdup(buf);
required_string("$cd:");
stuff_int( &Cutscenes[Num_cutscenes].cd );
cutinfo.description = vm_strdup(buf);
Num_cutscenes++;
required_string("$cd:");
stuff_int( &cutinfo.cd );
Cutscenes.push_back(cutinfo);
}
required_string("#End");
@@ -330,32 +106,25 @@ void cutscene_init()
// 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);
for (SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
if ( !stricmp(cut->filename, filename) ) {
return (cut->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);
Assert(filename!=NULL);
// strip off extension
strcpy( file, filename );
strcpy_s( file, filename );
char *p = strchr( file, '.' );
if ( p ) {
*p = 0;
@@ -363,10 +132,10 @@ void cutscene_mark_viewable(char *filename)
// change to lower case
strlwr(file);
for (i = 0; i < Num_cutscenes; i++ ) {
int i = 0;
for (SCP_vector<cutscene_info>::iterator cut = Cutscenes.begin(); cut != Cutscenes.end(); ++cut) {
// change the cutscene file name to lower case
strcpy(cut_file, Cutscenes[i].filename);
strcpy_s(cut_file, cut->filename);
strlwr(cut_file);
// see if the stripped filename matches the cutscene filename
@@ -374,6 +143,7 @@ void cutscene_mark_viewable(char *filename)
Cutscenes_viewable |= (1<<i);
return;
}
i++;
}
}
@@ -389,8 +159,7 @@ void cutscene_mark_viewable(char *filename)
#define PLAY_BUTTON 6
#define EXIT_BUTTON 7
static int Num_files;
static int Cutscene_list[MAX_CUTSCENES];
static SCP_vector<int> Cutscene_list;
//static int Stats_scroll_offset; // not used - taylor
static int Selected_line = 0; // line that is currently selected for binding
static int Scroll_offset;
@@ -484,9 +253,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
int cd_mve_is_on;
char volume_name[128];
#ifdef RELEASE_REAL
int num_attempts = 0;
#endif
while(1) {
int path_set_ok;
@@ -497,12 +264,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
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);
@@ -512,7 +274,6 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
break;
}
#ifdef RELEASE_REAL
if ( !prompt_for_cd ) {
cd_present = 0;
break;
@@ -522,11 +283,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
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 ) {
@@ -538,11 +295,6 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
cd_present = 0;
break;
}
#else
cd_present = 0;
break;
#endif
}
return cd_present;
@@ -553,10 +305,10 @@ void cutscenes_screen_play()
char name[MAX_FILENAME_LEN]; // *full_name
int which_cutscene;
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
Assert( (Selected_line >= 0) && (Selected_line < (int)Cutscene_list.size()) );
which_cutscene = Cutscene_list[Selected_line];
strcpy(name, Cutscenes[which_cutscene].filename );
strcpy_s(name, Cutscenes[which_cutscene].filename );
// full_name = cf_add_ext(name, NOX(".mve"));
main_hall_stop_music();
@@ -568,7 +320,7 @@ void cutscenes_screen_play()
char str[256];
if (Cmdline_nomovies)
sprintf(str, XSTR("Movies are currently disabled.", -1));
strcpy_s(str, XSTR("Movies are currently disabled.", -1));
else
sprintf(str, XSTR("Unable to play movie %s.", 204), Cutscenes[which_cutscene].name);
@@ -594,7 +346,7 @@ void cutscenes_screen_scroll_line_down()
{
int h;
if (Selected_line < Num_files - 1) {
if (Selected_line < (int)Cutscene_list.size() - 1) {
Selected_line++;
gamesnd_play_iface(SND_SCROLL);
@@ -631,7 +383,7 @@ void cutscenes_screen_scroll_screen_down()
int h;
h = Cutscene_list_coords[gr_screen.res][3] / gr_get_font_height();
if (Scroll_offset + h < Num_files) {
if (Scroll_offset + h < (int)Cutscene_list.size()) {
Scroll_offset++;
if (Selected_line < Scroll_offset){
Selected_line = Scroll_offset;
@@ -729,11 +481,12 @@ void cutscenes_screen_init()
// 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++;
Cutscene_list.clear();
size_t size = Cutscenes.size();
for (size_t j=0;j < size;j++) {
if ( Cutscenes_viewable & (1<<j) ) {
Cutscene_list.push_back((int)j);
}
}
}
@@ -791,10 +544,10 @@ void cutscenes_screen_do_frame()
// the "show-all" hotkey
case KEY_CTRLED | KEY_SHIFTED | KEY_S:
{
Num_files = 0;
for (i = 0; i < Num_cutscenes; i++) {
Cutscene_list[Num_files] = i;
Num_files++;
Cutscene_list.clear();
size_t size = Cutscenes.size();
for (size_t t = 0; t < size; t++) {
Cutscene_list.push_back((int)t);
}
break;
@@ -812,14 +565,14 @@ void cutscenes_screen_do_frame()
if (List_region.button_down()) {
List_region.get_mouse_pos(NULL, &y);
z = Scroll_offset + y / font_height;
if ((z >= 0) && (z < Num_files))
if ((z >= 0) && (z < (int)Cutscene_list.size()))
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))
if ((z >= 0) && (z < (int)Cutscene_list.size()))
Selected_line = z;
}
@@ -844,7 +597,7 @@ void cutscenes_screen_do_frame()
y = 0;
z = Scroll_offset;
while (y + font_height <= Cutscene_list_coords[gr_screen.res][3]) {
if (z >= Num_files){
if (z >= (int)Cutscene_list.size()){
break;
}
@@ -863,14 +616,17 @@ void cutscenes_screen_do_frame()
}
if (Description_index != Selected_line) {
char *src;
char *src = NULL;
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 < (int)Cutscene_list.size( ) &&
(int)Cutscene_list[ Description_index ] < (int)Cutscenes.size( ) ) {
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]);
}
}
}
@@ -883,7 +639,7 @@ void cutscenes_screen_do_frame()
y = 0;
z = Text_offset;
while (y + font_height <= Cutscene_desc_coords[gr_screen.res][3]) {
if (z >= Text_size)
if (z >= Text_size || z >= MAX_TEXT_LINES-1)
break;
len = Text_line_size[z];
+2 -56
View File
@@ -7,58 +7,7 @@
*
*/
/*
* $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
@@ -66,8 +15,6 @@
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#define MAX_CUTSCENES 10
// this cutscene is always available.
#define INTRO_CUTSCENE_FLAG (1<<0)
@@ -79,8 +26,7 @@ typedef struct cutscene_info
int cd;
} cutscene_info;
extern cutscene_info Cutscenes[MAX_CUTSCENES];
extern int Num_cutscenes;
extern SCP_vector<cutscene_info> Cutscenes;
extern int Cutscenes_viewable;
// initializa table data
+31 -130
View File
@@ -1,19 +1,4 @@
/*
* $Logfile: /Freespace2/src/cutscene/decoder16.cpp $
* $Revision: 2.1.2.1 $
* $Date: 2006-08-19 04:14:57 $
* $Author: taylor $
*
* decoder for 16-bit MVE image data
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
@@ -25,18 +10,14 @@ extern void *g_vBackBuf1, *g_vBackBuf2;
static ushort *backBuf1, *backBuf2;
static int lookup_initialized;
static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned char **pData, unsigned char **pOffData, int *pDataRemain, int *curXb, int *curYb);
static void dispatchDecoder16(ushort **pFrame, ubyte codeType, ubyte **pData, ubyte **pOffData, int *pDataRemain, int *curXb, int *curYb);
static void genLoopkupTable();
void decodeFrame16(unsigned char *pFrame, unsigned char *pMap, int mapRemain, unsigned char *pData, int dataRemain)
void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, unsigned char *pData, int dataRemain)
{
unsigned char *pOrig;
unsigned char *pOffData, *pEnd;
ubyte *pOrig, *pOffData, *pEnd, op;
ushort offset;
int length;
int op;
int i, j;
int xb, yb;
int length = 0, i, j, xb, yb;
if (!lookup_initialized) {
genLoopkupTable();
@@ -171,21 +152,7 @@ static void patternRow4Pixels2(ushort *pFrame, unsigned char pat0, ushort *p)
unsigned char mask=0x03;
unsigned char shift=0;
ushort pel;
/* ORIGINAL VERSION IS BUGGY
int skip=1;
while (mask != 0) {
pel = p[(mask & pat0) >> shift];
pFrame[0] = pel;
pFrame[2] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 2] = pel;
pFrame += skip;
skip = 4 - skip;
mask <<= 2;
shift += 2;
}
*/
while (mask != 0) {
pel = p[(mask & pat0) >> shift];
pFrame[0] = pel;
@@ -223,10 +190,9 @@ static void patternQuadrant4Pixels(ushort *pFrame, unsigned char pat0, unsigned
for (i=0; i<16; i++) {
pFrame[i&3] = p[(pat & mask) >> shift];
if ((i&3) == 3)
if ((i&3) == 3) {
pFrame += g_width;
}
mask <<= 2;
shift += 2;
}
@@ -247,19 +213,6 @@ static void patternRow2Pixels2(ushort *pFrame, unsigned char pat, ushort *p)
ushort pel;
unsigned char mask=0x1;
/* ORIGINAL VERSION IS BUGGY
int skip=1;
while (mask != 0x10) {
pel = p[(mask & pat) ? 1 : 0];
pFrame[0] = pel;
pFrame[2] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 2] = pel;
pFrame += skip;
skip = 4 - skip;
mask <<= 1;
}
*/
while (mask != 0x10) {
pel = p[(mask & pat) ? 1 : 0];
@@ -281,10 +234,9 @@ static void patternQuadrant2Pixels(ushort *pFrame, unsigned char pat0, unsigned
for (i=0; i<16; i++) {
pFrame[i&3] = p[(pat & mask) ? 1 : 0];
if ((i&3) == 3)
if ((i&3) == 3) {
pFrame += g_width;
}
mask <<= 1;
}
@@ -303,76 +255,63 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
switch(codeType) {
case 0x0:
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1));
break; // ADDED
break; // ADDED
case 0x1:
break;
break;
case 0x2:
/* relFar(*(*pOffData)++, 1, &x, &y); */
k = *(*pOffData)++;
x = far_p_table[k*2+0];
y = far_p_table[k*2+1];
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pDataRemain--;
break;
(*pDataRemain)--;
break;
case 0x3:
/* relFar(*(*pOffData)++, -1, &x, &y); */
k = *(*pOffData)++;
x = far_n_table[k*2+0];
y = far_n_table[k*2+1];
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pDataRemain--;
break;
(*pDataRemain)--;
break;
case 0x4:
/* relClose(*(*pOffData)++, &x, &y); */
k = *(*pOffData)++;
x = close_table[k*2+0];
y = close_table[k*2+1];
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width);
*pDataRemain--;
break;
(*pDataRemain)--;
break;
case 0x5:
x = (char)*(*pData)++;
y = (char)*(*pData)++;
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width);
*pDataRemain -= 2;
break;
break;
case 0x6:
nprintf(("MVE", "STUB: encoding 6 not tested\n"));
for (i=0; i<2; i++) {
*pFrame += 16;
if (++*curXb == (g_width >> 3)) {
*pFrame += 7*g_width;
*curXb = 0;
if (++*curYb == (g_height >> 3))
if (++*curYb == (g_height >> 3)) {
return;
}
}
}
break;
break;
case 0x7:
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
if (!((p[0]/*|p[1]*/)&0x8000)) {
for (i=0; i<8; i++) {
patternRow2Pixels(*pFrame, *(*pData), p);
(*pData)++;
*pFrame += g_width;
}
} else {
@@ -381,26 +320,21 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
*pFrame += 2*g_width;
patternRow2Pixels2(*pFrame, *(*pData) >> 4, p);
(*pData)++;
*pFrame += 2*g_width;
}
}
break;
break;
case 0x8:
p[0] = GETPIXEL(pData, 0);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
(*pData) += 2;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
@@ -409,7 +343,6 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
}
} else {
p[2] = GETPIXEL(pData, 8);
if (!(p[2]&0x8000)) {
for (i=0; i<4; i++) {
if ((i & 1) == 0) {
@@ -419,7 +352,6 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
@@ -434,21 +366,18 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
}
patternRow2Pixels(*pFrame, *(*pData), p);
(*pData)++;
*pFrame += g_width;
}
}
}
break;
break;
case 0x9:
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
*pDataRemain -= 8;
if (!(p[0] & 0x8000)) {
if (!(p[2] & 0x8000)) {
for (i=0; i<8; i++) {
@@ -467,7 +396,6 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
patternRow4Pixels2(*pFrame, (*pData)[2], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[3], p);
(*pData) += 4;
*pDataRemain -= 4;
}
@@ -484,9 +412,7 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
for (i=0; i<4; i++) {
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
(*pData) += 2;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
@@ -495,11 +421,10 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
*pDataRemain -= 8;
}
}
break;
break;
case 0xa:
p[0] = GETPIXEL(pData, 0);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
p[0] = GETPIXELI(pData, 0);
@@ -510,11 +435,8 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
pat[1] = (*pData)[1];
pat[2] = (*pData)[2];
pat[3] = (*pData)[3];
(*pData) += 4;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
@@ -523,7 +445,6 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
}
} else {
p[0] = GETPIXEL(pData, 16);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
if ((i&1) == 0) {
@@ -532,16 +453,12 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
}
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
pat[2] = (*pData)[2];
pat[3] = (*pData)[3];
(*pData) += 4;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
@@ -556,24 +473,21 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
p[2] = GETPIXELI(pData, 0);
p[3] = GETPIXELI(pData, 0);
}
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
(*pData) += 2;
}
}
}
break;
break;
case 0xb:
for (i=0; i<8; i++) {
#if BYTE_ORDER == BIG_ENDIAN
ubyte frame_tmp[16];
memcpy(&frame_tmp, *pData, 16);
ushort *swap_tmp;
for (j = 0; j < 16; j += 2) {
swap_tmp = (ushort*)(frame_tmp + j);
@@ -587,7 +501,7 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
*pData += 16;
*pDataRemain -= 16;
}
break;
break;
case 0xc:
for (i=0; i<4; i++) {
@@ -595,74 +509,61 @@ static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned
p[1] = GETPIXEL(pData, 2);
p[2] = GETPIXEL(pData, 4);
p[3] = GETPIXEL(pData, 6);
for (j=0; j<2; j++) {
for (k=0; k<4; k++) {
(*pFrame)[2*k] = p[k];
(*pFrame)[2*k+1] = p[k];
// (*pFrame)[j+2*k] = p[k];
// (*pFrame)[g_width+j+2*k] = p[k];
}
*pFrame += g_width;
}
*pData += 8;
*pDataRemain -= 8;
}
break;
break;
case 0xd:
for (i=0; i<2; i++) {
p[0] = GETPIXEL(pData, 0);
p[1] = GETPIXEL(pData, 2);
for (j=0; j<4; j++) {
for (k=0; k<4; k++) {
(*pFrame)[k*g_width+j] = p[0];
(*pFrame)[k*g_width+j+4] = p[1];
}
}
*pFrame += 4*g_width;
*pData += 4;
*pDataRemain -= 4;
}
break;
break;
case 0xe:
p[0] = GETPIXEL(pData, 0);
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++) {
(*pFrame)[j] = p[0];
}
*pFrame += g_width;
}
*pData += 2;
*pDataRemain -= 2;
break;
break;
case 0xf:
p[0] = GETPIXEL(pData, 0);
p[1] = GETPIXEL(pData, 1);
for (i=0; i<8; i++) {
for (j=0; j<8; j++) {
(*pFrame)[j] = p[(i+j)&1];
}
*pFrame += g_width;
}
*pData += 4;
*pDataRemain -= 4;
break;
break;
default:
break;
break;
}
*pFrame = pDstBak+8;
+5 -17
View File
@@ -1,16 +1,4 @@
/*
* $Logfile: /Freespace2/src/cutscene/decoder8.cpp $
* $Revision: 1.1.2.1 $
* $Date: 2006-08-19 04:14:57 $
* $Author: taylor $
*
* decoder for 8-bit MVE image data
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
@@ -220,21 +208,21 @@ static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int
relFar(*(*pData)++, 1, &x, &y);
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
(*pDataRemain)--;
break;
case 0x3:
relFar(*(*pData)++, -1, &x, &y);
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
(*pDataRemain)--;
break;
case 0x4:
relClose(*(*pData)++, &x, &y);
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1) + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
(*pDataRemain)--;
break;
case 0x5:
@@ -521,7 +509,7 @@ static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int
}
(*pData)++;
*pDataRemain--;
(*pDataRemain)--;
*pFrame -= (8*g_width - 8);
break;
+5 -103
View File
@@ -7,105 +7,10 @@
*
*/
/*
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
* $Revision: 2.31.2.11 $
* $Date: 2007-02-11 09:23:14 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 2.31.2.10 2007/01/07 12:10:18 taylor
* 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)
*
* Revision 2.31.2.9 2006/12/26 05:13:29 taylor
* 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)
*
* Revision 2.31.2.8 2006/12/07 17:57:25 taylor
* 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
*
* Revision 2.31.2.7 2006/11/15 00:24:47 taylor
* 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
*
* Revision 2.31.2.6 2006/09/09 21:27:50 taylor
* be sure to reset color and clear color before MVE playback (fix for Mantis bug #1041)
*
* Revision 2.31.2.5 2006/08/28 17:14:52 taylor
* stupid, stupid, stupid...
* - fix AVI/MPG movie playback
* - fix missing campaign craziness
*
* Revision 2.31.2.4 2006/08/27 18:02:26 taylor
* switch to using cf_find_file_location_ext() when looking for movies
*
* Revision 2.31.2.3 2006/08/19 04:14:57 taylor
* 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
*
* Revision 2.31.2.2 2006/07/13 22:06:38 taylor
* 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
*
* Revision 2.31.2.1 2006/06/18 16:54:36 taylor
* various compiler warning fixes
*
* Revision 2.31 2006/05/27 17:13:22 taylor
* add NO_DIRECT3D support
*
* Revision 2.30 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
* Revision 2.29 2005/12/28 22:17:01 taylor
* 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)
*
* Revision 2.28 2005/11/13 06:46:10 taylor
* some minor movie cleanup, not what I would like but enough for now
*
* Revision 2.27 2005/10/16 23:15:46 wmcoolmon
* Hardened cfile against array overflows
*
* Revision 2.26 2005/05/12 17:37:48 taylor
* add an extra gr_flip() after gr_clear() to make sure the change is made active
*
* 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 "graphics/grd3dinternal.h"
#endif
#include "graphics/2d.h"
@@ -148,7 +53,7 @@ int movie_find(char *filename, char *out_name)
memset( tmp_name, 0, sizeof(tmp_name) );
// remove extension
strcpy( tmp_name, filename );
strcpy_s( tmp_name, filename );
char *p = strrchr(tmp_name, '.');
if ( p ) *p = 0;
@@ -187,7 +92,7 @@ bool movie_play(char *name)
rc = movie_find(name, full_name);
if (rc == MOVIE_NONE) {
strcpy(full_name, name);
strcpy_s(full_name, name);
char *p = strrchr(full_name, '.');
if ( p ) *p = 0;
@@ -211,11 +116,6 @@ bool movie_play(char *name)
gr_clear();
if (rc == MOVIE_OGG) {
if (gr_screen.mode == GR_DIRECT3D) {
mprintf(("MOVIE ERROR: Theora movies are not currently supported in Direct3D mode!\n"));
return false;
}
THEORAFILE *movie_ogg = theora_open(name);
if (movie_ogg) {
@@ -227,6 +127,7 @@ bool movie_play(char *name)
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
Mouse_hidden--; // show the mouse cursor!
return false;
}
} else if (rc == MOVIE_MVE) {
@@ -243,6 +144,7 @@ bool movie_play(char *name)
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
Mouse_hidden--; // show the mouse cursor!
return false;
}
}
+1 -12
View File
@@ -7,18 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/cutscene/movie.h $
* $Revision: 2.6.2.1 $
* $Date: 2007-02-11 09:23:14 $
* $Author: taylor $
*
* movie player header
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*/
#ifndef _MOVIE_HEADER_FILE
#define _MOVIE_HEADER_FILE
+19 -42
View File
@@ -1,24 +1,4 @@
/*
* $Logfile: /Freespace2/src/cutscene/mve_audio.cpp $
* $Revision: 2.1 $
* $Date: 2006-05-13 06:59:48 $
* $Author: taylor $
*
* Handles compressed audio data in MVE files
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/03/29 07:50:34 taylor
* Update to newest movie code with much better video support and audio support from
* Pierre Willenbrock. Movies are enabled always now (no longer a build option)
* and but can be skipped with the "--nomovies" or "-n" cmdline options.
*
*
*
* $NoKeywords: $
*
*/
#ifdef USE_OPENAL
static int audio_exp_table[256] =
{
@@ -42,38 +22,35 @@ static int audio_exp_table[256] =
static int getWord(unsigned char **fin)
{
int value = ((*fin)[1] << 8) | (*fin)[0];
*fin += 2;
return value;
int value = ((*fin)[1] << 8) | (*fin)[0];
*fin += 2;
return value;
}
static void sendWord(short **fout, int nOffset)
{
*(*fout)++ = nOffset;
*(*fout)++ = (short)nOffset;
}
static void processSwath(short *fout, unsigned char *data, int swath, int *offsets)
{
int i;
for (i=0; i<swath; i++)
{
offsets[i&1] += audio_exp_table[data[i]];
sendWord(&fout, offsets[i&1]);
}
int i;
for (i=0; i<swath; i++) {
offsets[i&1] += audio_exp_table[data[i]];
sendWord(&fout, offsets[i&1]);
}
}
void mveaudio_uncompress(short *buffer, unsigned char *data, int length)
void mveaudio_uncompress(short *buffer, unsigned char *data)
{
int nCurOffsets[2];
int swath;
int nCurOffsets[2];
int swath;
data += 4;
swath = getWord(&data) / 2;
nCurOffsets[0] = getWord(&data);
nCurOffsets[1] = getWord(&data);
sendWord(&buffer, nCurOffsets[0]);
sendWord(&buffer, nCurOffsets[1]);
processSwath(buffer, data, swath, nCurOffsets);
data += 4;
swath = getWord(&data) / 2;
nCurOffsets[0] = getWord(&data);
nCurOffsets[1] = getWord(&data);
sendWord(&buffer, nCurOffsets[0]);
sendWord(&buffer, nCurOffsets[1]);
processSwath(buffer, data, swath, nCurOffsets);
}
#endif
+4 -18
View File
@@ -1,19 +1,4 @@
/*
* $Logfile: /Freespace2/src/cutscene/mvelib.cpp $
* $Revision: 2.1.2.1 $
* $Date: 2006-08-19 04:14:57 $
* $Author: taylor $
*
* main lib for using MVEs
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
#include "cutscene/mvelib.h"
@@ -78,11 +63,12 @@ MVEFILE *mvefile_open(char *filename)
char *p = strchr( lower_name, '.' );
if ( p ) *p = 0;
SAFE_STRCAT( lower_name, ".mve", sizeof(lower_name) );
strcat_s( lower_name, ".mve" );
// NOTE: CF_TYPE *must* be ANY to get movies off of the CDs
// assume lower case filename for *nix
if ( (file->stream = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_ANY)) ) {
file->stream = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_ANY);
if ( file->stream ) {
cf_opened = 1;
}
+1 -13
View File
@@ -1,16 +1,4 @@
/*
* $Logfile: /Freespace2/src/cutscene/mvelib.h $
* $Revision: 2.1 $
* $Date: 2006-05-13 06:59:48 $
* $Author: taylor $
*
* main lib for using MVEs
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#ifndef INCLUDED_MVELIB_H
#define INCLUDED_MVELIB_H
+131 -165
View File
@@ -1,37 +1,4 @@
/*
* $Logfile: /Freespace2/code/cutscene/mveplayer.cpp $
* $Revision: 2.1.2.4 $
* $Date: 2007-02-10 00:01:53 $
* $Author: taylor $
*
* MVE movie playing routines
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.3 2006/12/26 05:14:52 taylor
* 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
*
* Revision 2.1.2.2 2006/12/07 17:55:51 taylor
* 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
*
* Revision 2.1.2.1 2006/08/19 04:14:57 taylor
* 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
*
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
*
* $NoKeywords: $
*/
#ifdef SCP_UNIX
#include <errno.h>
@@ -42,6 +9,7 @@
#include "graphics/gropengl.h"
#include "graphics/gropengltexture.h"
#include "graphics/gropenglextension.h"
#include "graphics/gropenglstate.h"
#include "globalincs/pstypes.h"
#include "cutscene/mvelib.h"
@@ -51,9 +19,8 @@
#include "osapi/osapi.h"
#include "io/timer.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "sound/openal.h"
#include "bmpman/bmpman.h"
//#include "sound/audiostr.h"
extern int Cmdline_noscalevid;
@@ -77,7 +44,6 @@ static int mve_audio_canplay = 0;
static int mve_audio_compressed = 0;
static int audiobuf_created;
#ifdef USE_OPENAL
// struct for the audio stream information
typedef struct MVE_AUDIO_T {
ALenum format;
@@ -92,8 +58,7 @@ typedef struct MVE_AUDIO_T {
mve_audio_t *mas; // mve_audio_stream
// audio decompressor
extern void mveaudio_uncompress(short *buffer, unsigned char *data, int length);
#endif // USE_OPENAL
extern void mveaudio_uncompress(short *buffer, unsigned char *data);
// video variables
int g_width, g_height;
@@ -101,12 +66,13 @@ void *g_vBuffers = NULL;
void *g_vBackBuf1, *g_vBackBuf2;
ushort *pixelbuf = NULL;
static GLuint GLtex = 0;
static GLint gl_screenYH = 0;
static GLint gl_screenXW = 0;
static GLfloat gl_screenYH = 0;
static GLfloat gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 0;
static GLfloat glVertices[4][4] = {{0}};
static int g_screenWidth, g_screenHeight;
static int g_screenX, g_screenY;
static float g_screenX, g_screenY;
static int g_truecolor = 0;
static ubyte g_palette[768];
static ubyte *g_pCurMap = NULL;
@@ -171,8 +137,9 @@ static void mve_timer_start(void)
static int mve_do_timer_wait(void)
{
if (!timer_started)
if (!timer_started) {
return 0;
}
#ifdef SCP_UNIX
int nsec = 0;
@@ -181,11 +148,13 @@ static int mve_do_timer_wait(void)
gettimeofday(&tv, NULL);
if (tv.tv_sec > timer_expire.tv_sec)
if (tv.tv_sec > timer_expire.tv_sec) {
goto end;
}
if ( (tv.tv_sec == timer_expire.tv_sec) && (tv.tv_usec >= timer_expire.tv_usec) )
if ( (tv.tv_sec == timer_expire.tv_sec) && (tv.tv_usec >= timer_expire.tv_usec) ) {
goto end;
}
ts.tv_sec = timer_expire.tv_sec - tv.tv_sec;
ts.tv_nsec = 1000 * (timer_expire.tv_usec - tv.tv_usec);
@@ -204,25 +173,24 @@ static int mve_do_timer_wait(void)
}
end:
timer_expire.tv_usec += micro_frame_delay;
timer_expire.tv_usec += micro_frame_delay;
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
#else
int tv, ts, ts2;
tv = timer_get_microseconds();
if (tv > timer_expire)
if (tv > timer_expire) {
goto end;
}
ts = timer_expire - tv;
ts2 = ts/1000;
Sleep(ts2);
end:
@@ -250,8 +218,9 @@ static void mve_timer_stop()
// setup the audio information from the data stream
void mve_audio_createbuf(ubyte minor, ubyte *data)
{
if (audiobuf_created)
if (audiobuf_created) {
return;
}
// if game sound disabled don't try and play movie audio
if (!Sound_enabled) {
@@ -259,30 +228,29 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
return;
}
#ifdef USE_OPENAL
int flags, desired_buffer, sample_rate;
int flags, desired_buffer, sample_rate;
mas = (mve_audio_t *) vm_malloc ( sizeof(mve_audio_t) );
mas = (mve_audio_t *) vm_malloc ( sizeof(mve_audio_t) );
memset(mas, 0, sizeof(mve_audio_t));
mas->format = AL_INVALID;
flags = mve_get_ushort(data + 2);
sample_rate = mve_get_ushort(data + 4);
desired_buffer = mve_get_int(data + 6);
flags = mve_get_ushort(data + 2);
sample_rate = mve_get_ushort(data + 4);
desired_buffer = mve_get_int(data + 6);
mas->channels = (flags & 0x0001) ? 2 : 1;
mas->channels = (flags & 0x0001) ? 2 : 1;
mas->bitsize = (flags & 0x0002) ? 16 : 8;
mas->sample_rate = sample_rate;
if (minor > 0) {
mve_audio_compressed = flags & 0x0004 ? 1 : 0;
} else {
if (minor > 0) {
mve_audio_compressed = flags & 0x0004 ? 1 : 0;
} else {
mve_audio_compressed = 0;
}
}
if (mas->bitsize == 16) {
if (mas->bitsize == 16) {
if (mas->channels == 2) {
mas->format = AL_FORMAT_STEREO16;
} else if (mas->channels == 1) {
@@ -310,9 +278,8 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
OpenAL_ErrorPrint( alSourcef(mas->source_id, AL_GAIN, 1.0f) );
memset(mas->audio_buffer, 0, MVE_AUDIO_BUFFERS * sizeof(ALuint));
#endif // USE_OPENAL
mve_audio_buffer_tail = 0;
mve_audio_buffer_tail = 0;
audiobuf_created = 1;
}
@@ -321,29 +288,27 @@ void mve_audio_createbuf(ubyte minor, ubyte *data)
void mve_audio_play()
{
if (mve_audio_canplay) {
#ifdef USE_OPENAL
ALint status, bqueued;
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_SOURCE_STATE, &status), return );
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_QUEUED, &bqueued), return );
mve_audio_playing = 1;
if (status != AL_PLAYING && bqueued > 0) {
OpenAL_ErrorPrint( alSourcePlay(mas->source_id) );
}
#endif // USE_OPENAL
}
}
// call this in shutdown to stop and close audio
static void mve_audio_stop()
{
if (!audiobuf_created)
if (!audiobuf_created || mas == NULL) {
return;
}
#ifdef USE_OPENAL
ALint p = 0;
mve_audio_playing = 0;
@@ -364,7 +329,6 @@ static void mve_audio_stop()
vm_free(mas);
mas = NULL;
}
#endif // USE_OPENAL
}
int mve_audio_data(ubyte major, ubyte *data)
@@ -374,7 +338,6 @@ int mve_audio_data(ubyte major, ubyte *data)
int nsamp;
if (mve_audio_canplay) {
#ifdef USE_OPENAL
chan = mve_get_ushort(data + 2);
nsamp = mve_get_ushort(data + 4);
@@ -384,13 +347,15 @@ int mve_audio_data(ubyte major, ubyte *data)
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_PROCESSED, &bprocessed), return 0 );
while (bprocessed-- > 2)
while (bprocessed-- > 2) {
OpenAL_ErrorPrint( alSourceUnqueueBuffers(mas->source_id, 1, &bid) );
}
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_QUEUED, &bqueued), return 0 );
if (bqueued == 0)
if (bqueued == 0) {
mprintf(("MVE: Buffer underun (First is normal)\n"));
}
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_SOURCE_STATE, &status), return 0 );
@@ -403,37 +368,34 @@ int mve_audio_data(ubyte major, ubyte *data)
/* HACK: +4 mveaudio_uncompress adds 4 more bytes */
if (major == 8) {
if (mve_audio_compressed) {
if (mve_audio_compressed) {
nsamp += 4;
buf = (short *)vm_malloc(nsamp);
mveaudio_uncompress(buf, data, -1); /* XXX */
mveaudio_uncompress(buf, data); /* XXX */
} else {
nsamp -= 8;
data += 8;
buf = (short *)vm_malloc(nsamp);
memcpy(buf, data, nsamp);
}
}
} else {
buf = (short *)vm_malloc(nsamp);
memset(buf, 0, nsamp); /* XXX */
}
if (!mas->audio_buffer[mve_audio_buffer_tail]) {
OpenAL_ErrorCheck( alGenBuffers(1,&mas->audio_buffer[mve_audio_buffer_tail]), { vm_free(buf); return 0; } );
}
OpenAL_ErrorCheck( alBufferData(mas->audio_buffer[mve_audio_buffer_tail], mas->format, buf, nsamp, mas->sample_rate), { vm_free(buf); return 0; } );
OpenAL_ErrorCheck( alSourceQueueBuffers(mas->source_id, 1, &mas->audio_buffer[mve_audio_buffer_tail]), { vm_free(buf); return 0;} );
//fprintf(stderr,"Queued buffer %d(%d)\n", mve_audio_buftail, mas->audio_buffer[mve_audio_buftail]);
if (++mve_audio_buffer_tail == MVE_AUDIO_BUFFERS)
if (++mve_audio_buffer_tail == MVE_AUDIO_BUFFERS) {
mve_audio_buffer_tail = 0;
}
bqueued++;
vm_free(buf);
@@ -441,7 +403,6 @@ int mve_audio_data(ubyte major, ubyte *data)
mprintf(("MVE: Buffer overrun: Queue full\n"));
}
}
#endif // USE_OPENAL
}
return 1;
@@ -453,8 +414,9 @@ int mve_audio_data(ubyte major, ubyte *data)
int mve_video_createbuf(ubyte minor, ubyte *data)
{
if (videobuf_created)
if (videobuf_created) {
return 1;
}
short w, h;
short count, truecolor;
@@ -484,11 +446,11 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
return 0;
}
if (truecolor)
if (truecolor) {
g_vBackBuf2 = (ushort *)g_vBackBuf1 + (g_width * g_height);
else
} else {
g_vBackBuf2 = (ubyte *)g_vBackBuf1 + (g_width * g_height);
}
memset(g_vBackBuf1, 0, g_width * g_height * 4);
g_truecolor = truecolor;
@@ -500,10 +462,11 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
float movie_ratio = (float)g_width / (float)g_height;
if (screen_ratio > movie_ratio)
if (screen_ratio > movie_ratio) {
scale_by = (float)gr_screen.max_h / (float)g_height;
else
} else {
scale_by = (float)gr_screen.max_w / (float)g_width;
}
// don't bother setting anything if we aren't going to need it
if (!Cmdline_noscalevid && (scale_by != 1.0f)) {
@@ -516,12 +479,12 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
}
if (mve_scale_video) {
g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_width) / 2);
g_screenY = ((fl2i(gr_screen.max_h / scale_by + 0.5f) - g_height) / 2);
g_screenX = ((ceil((gr_screen.max_w / scale_by) - 0.5f) - g_width) / 2);
g_screenY = ((ceil((gr_screen.max_h / scale_by) - 0.5f) - g_height) / 2);
} else {
// centers on 1024x768, fills on 640x480
g_screenX = ((gr_screen.max_w - g_width) / 2);
g_screenY = ((gr_screen.max_h - g_height) / 2);
g_screenX = ((float)(gr_screen.max_w - g_width) / 2.0f);
g_screenY = ((float)(gr_screen.max_h - g_height) / 2.0f);
}
// set additional values for screen width/height and UV coords
@@ -529,14 +492,38 @@ int mve_video_createbuf(ubyte minor, ubyte *data)
gl_screenYH = g_screenY + g_height;
gl_screenXW = g_screenX + g_width;
if (GL_texture_target == GL_TEXTURE_RECTANGLE_ARB) {
gl_screenU = (GLfloat)g_width;
gl_screenV = (GLfloat)g_height;
} else {
gl_screenU = i2fl(g_width) / i2fl(wp2);
gl_screenV = i2fl(g_height) / i2fl(hp2);
}
gl_screenU = i2fl(g_width) / i2fl(wp2);
gl_screenV = i2fl(g_height) / i2fl(hp2);
}
glVertices[0][0] = g_screenX;
glVertices[0][1] = g_screenY;
glVertices[0][2] = 0;
glVertices[0][3] = 0;
glVertices[1][0] = g_screenX;
glVertices[1][1] = gl_screenYH;
glVertices[1][2] = 0;
glVertices[1][3] = gl_screenV;
glVertices[2][0] = gl_screenXW;
glVertices[2][1] = g_screenY;
glVertices[2][2] = gl_screenU;
glVertices[2][3] = 0;
glVertices[3][0] = gl_screenXW;
glVertices[3][1] = gl_screenYH;
glVertices[3][2] = gl_screenU;
glVertices[3][3] = gl_screenV;
GL_state.Array.BindArrayBuffer(0);
GL_state.Array.EnableClientVertex();
GL_state.Array.VertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
GL_state.Array.SetActiveClientUnit(0);
GL_state.Array.EnableClientTexture();
GL_state.Array.TexPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
}
return 1;
@@ -554,26 +541,26 @@ static void mve_convert_and_draw()
ubyte r, g, b;
ushort bit_16;
if (g_truecolor)
if (g_truecolor) {
pSrcs = pixels;
else
} else {
pSrcs8 = pixels8;
}
pDests = pixelbuf;
if (gr_screen.mode != GR_OPENGL) {
if (g_screenWidth > g_width)
if (g_screenWidth > g_width) {
pDests += ((g_screenWidth - g_width) / 2) / 2;
if (g_screenHeight > g_height)
}
if (g_screenHeight > g_height) {
pDests += ((g_screenHeight - g_height) / 2) * g_screenWidth;
}
}
for (y=0; y<g_height; y++) {
for (x = 0; x < g_width; x++) {
if (g_truecolor) {
Assert( pSrcs != NULL );
pDests[x] = (1<<15)|*pSrcs;
pSrcs++;
} else {
@@ -620,28 +607,14 @@ void mve_video_display()
}
if (gr_screen.mode == GR_OPENGL) {
glBindTexture(GL_texture_target, GLtex);
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_width, g_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixelbuf);
glTexSubImage2D(GL_texture_target, 0, 0, 0, g_width, g_height, GL_BGRA, GL_UNSIGNED_SHORT_1_5_5_5_REV, pixelbuf);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2i(g_screenX, g_screenY);
glTexCoord2f(0, gl_screenV);
glVertex2i(g_screenX, gl_screenYH);
glTexCoord2f(gl_screenU, gl_screenV);
glVertex2i(gl_screenXW, gl_screenYH);
glTexCoord2f(gl_screenU, 0);
glVertex2i(gl_screenXW, g_screenY);
glEnd();
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
} else {
// DDOI - This is probably really fricking slow
int bitmap = bm_create (16, g_screenWidth, g_screenHeight, pixelbuf, 0);
gr_set_bitmap (bitmap);
gr_bitmap (g_screenX, g_screenY, true);
gr_bitmap ((int)g_screenX, (int)g_screenY, true);
bm_release (bitmap);
}
@@ -670,8 +643,9 @@ void mve_video_display()
int mve_video_init(ubyte *data)
{
if (video_inited)
if (video_inited) {
return 1;
}
short width, height;
@@ -693,10 +667,7 @@ int mve_video_init(ubyte *data)
memset(pixelbuf, 0, g_screenWidth * g_screenHeight * 2);
if (gr_screen.mode == GR_OPENGL) {
// set the appropriate texture target
if ( Is_Extension_Enabled(OGL_ARB_TEXTURE_RECTANGLE) && !Is_Extension_Enabled(OGL_ARB_TEXTURE_NON_POWER_OF_TWO) )
opengl_set_texture_target( GL_TEXTURE_RECTANGLE_ARB );
opengl_set_texture_target(GL_TEXTURE_2D);
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
glGenTextures(1, &GLtex);
@@ -709,39 +680,32 @@ int mve_video_init(ubyte *data)
return 0;
}
// disable everything but what we need
opengl_switch_arb(-1, 0);
opengl_switch_arb(0, 1);
gr_set_lighting(false, false);
glBindTexture(GL_texture_target, GLtex);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_ALWAYS);
glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
GL_state.Texture.DisableAll();
GL_state.Texture.SetActiveUnit(0);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(GLtex);
GL_state.SetTextureSource(TEXTURE_SOURCE_DECAL);
GL_state.SetAlphaBlendMode(ALPHA_BLEND_NONE);
GL_state.SetZbufferType(ZBUFFER_TYPE_NONE);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_texture_target, 0, GL_RGB5_A1, wp2, hp2, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_RGB5_A1, wp2, hp2, 0, GL_BGRA_EXT, GL_UNSIGNED_SHORT_1_5_5_5_REV, NULL);
// set our color so that we can make sure that it's correct
glColor3f(1.0f, 1.0f, 1.0f);
GL_state.Color(255, 255, 255, 255);
}
#ifndef NO_DIRECT3D
else if (gr_screen.mode == GR_DIRECT3D) {
// TODO: is there a fast way to do frames in D3D too?
}
#endif
memset(g_palette, 0, 768);
video_inited = 1;
return 1;
}
@@ -781,10 +745,11 @@ void mve_video_data(ubyte *data, int len)
g_vBackBuf2 = temp;
}
if (g_truecolor)
if (g_truecolor) {
decodeFrame16((ubyte *)g_vBackBuf1, g_pCurMap, g_nMapLength, data+14, len-14);
else
} else {
decodeFrame8((ubyte *)g_vBackBuf1, g_pCurMap, g_nMapLength, data+14, len-14);
}
}
void mve_end_chunk()
@@ -813,8 +778,9 @@ void mve_play(MVESTREAM *mve)
int init_timer = 0, timer_error = 0;
int cont = 1;
if (!timer_started)
if (!timer_started) {
mve_timer_start();
}
while (cont && mve_playing && !timer_error) {
cont = mve_play_next_chunk(mve);
@@ -831,17 +797,18 @@ void mve_play(MVESTREAM *mve)
void mve_shutdown()
{
if (gr_screen.mode == GR_OPENGL) {
GL_state.Array.DisableClientVertex();
GL_state.Array.DisableClientTexture();
if (mve_scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
glBindTexture(GL_texture_target, 0);
GL_state.Texture.Disable();
GL_state.Texture.Delete(GLtex);
glDeleteTextures(1, &GLtex);
GLtex = 0;
opengl_switch_arb(-1, 0);
opengl_set_texture_target();
}
if (pixelbuf != NULL) {
@@ -855,6 +822,5 @@ void mve_shutdown()
}
mve_audio_stop();
mve_timer_stop();
}
+254 -124
View File
@@ -1,31 +1,4 @@
/*
* $Logfile: /Freespace2/code/cutscene/oggplayer.cpp $
* $Revision: 1.1.2.5 $
* $Date: 2007-04-11 14:44:32 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 1.1.2.4 2007/03/22 20:23:58 taylor
* fix stupidness that screwed up RGB values (Mantis #1307)
*
* Revision 1.1.2.3 2007/02/10 00:01:53 taylor
* 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
*
* Revision 1.1.2.2 2007/01/07 12:10:18 taylor
* 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)
*
* Revision 1.1.2.1 2006/12/25 21:44:11 taylor
* initial OGG Theora movie support (likely to be rewritten at least in large part)
*
*
*
* $NoKeywords: $
*
*/
// This player code is based largely on the player example in the libtheora package
// and so they get a fair bit of credit for this code, even if in ideas/comments only
@@ -37,15 +10,18 @@
#endif
#include "globalincs/pstypes.h"
#include "globalincs/def_files.h"
#include "cfile/cfile.h"
#include "graphics/gropengl.h"
#include "graphics/gropengltexture.h"
#include "graphics/gropenglextension.h"
#include "graphics/gropenglshader.h"
#include "graphics/gropenglstate.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "osapi/osapi.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "sound/openal.h"
#include "bmpman/bmpman.h"
#include "cutscene/oggplayer.h"
#include "io/timer.h"
@@ -67,10 +43,14 @@ static int g_screenX = 0;
static int g_screenY = 0;
static GLuint GLtex = 0;
static GLuint ytex = 0;
static GLuint utex = 0;
static GLuint vtex = 0;
static GLint gl_screenYH = 0;
static GLint gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 0;
static GLfloat glVertices[4][4] = {{0}};
// video externs from API graphics functions
extern void opengl_tcache_get_adjusted_texture_size(int w_in, int h_in, int *w_out, int *h_out);
@@ -99,7 +79,7 @@ static int audiofd_fragsize = 0;
static longlong videobuf_granulepos = -1;
static double videobuf_time = 0;
static bool use_shaders = true;
// -----------------------------------------------------------------------------
// Utility items
//
@@ -107,8 +87,8 @@ static double videobuf_time = 0;
// helper; just grab some more compressed bitstream and sync it for page extraction
static int OGG_buffer_data(THEORAFILE *movie)
{
char *buffer = ogg_sync_buffer(&movie->osyncstate, 4096);
int bytes = cfread(buffer, 1, 4096, movie->cfp);
char *buffer = ogg_sync_buffer(&movie->osyncstate, 8192); // Doubled read size to fix choppy audio with high bitrate movies - Valathil
int bytes = cfread(buffer, 1, 8192, movie->cfp);
ogg_sync_wrote(&movie->osyncstate, bytes);
@@ -351,6 +331,8 @@ static void OGG_video_init(theora_info *tinfo)
{
float scale_by = 0.0f;
GLhandleARB shader_id = 0;
if (video_inited)
return;
@@ -360,50 +342,141 @@ static void OGG_video_init(theora_info *tinfo)
g_screenHeight = tinfo->frame_height;
pixelbuf = (ubyte *) vm_malloc_q(g_screenWidth * g_screenHeight * 3);
if (pixelbuf == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate memory for pixelbuf"));
video_inited = 1;
return;
}
memset( pixelbuf, 0, g_screenWidth * g_screenHeight * 3 );
if (gr_screen.mode == GR_OPENGL) {
// set the appropriate texture target
if ( Is_Extension_Enabled(OGL_ARB_TEXTURE_RECTANGLE) && !Is_Extension_Enabled(OGL_ARB_TEXTURE_NON_POWER_OF_TWO) )
opengl_set_texture_target( GL_TEXTURE_RECTANGLE_ARB );
opengl_set_texture_target(GL_TEXTURE_2D);
opengl_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
glGenTextures(1, &GLtex);
if(!Use_GLSL)
use_shaders = false;
Assert( GLtex != 0 );
if(use_shaders) {
glGenTextures(1, &ytex);
glGenTextures(1, &utex);
glGenTextures(1, &vtex);
if ( GLtex == 0 ) {
nprintf(("MOVIE", "ERROR: Can't create a GL texture"));
video_inited = 1;
return;
Assert( ytex != 0 );
Assert( utex != 0 );
Assert( vtex != 0 );
if ( ytex + utex + vtex == 0 ) {
nprintf(("MOVIE", "ERROR: Can't create a GL texture"));
video_inited = 1;
return;
}
char *vert = NULL, *frag = NULL;
opengl_shader_t new_shader;
// choose appropriate files
char *vert_name = "video-v.sdr";
char *frag_name = "video-f.sdr";
mprintf(("Compiling video-processing shader ... \n"));
// read vertex shader
CFILE *cf_shader = cfopen(vert_name, "rt", CFILE_NORMAL, CF_TYPE_EFFECTS);
if (cf_shader != NULL) {
int len = cfilelength(cf_shader);
vert = (char*) vm_malloc(len + 1);
cfread(vert, len + 1, 1, cf_shader);
cfclose(cf_shader);
} else {
mprintf((" Loading built-in default shader for: %s\n", vert_name));
vert = defaults_get_file(vert_name);
}
if(!vert)
use_shaders = false;
// read fragment shader
cf_shader = cfopen(frag_name, "rt", CFILE_NORMAL, CF_TYPE_EFFECTS);
if (cf_shader != NULL) {
int len = cfilelength(cf_shader);
frag = (char*) vm_malloc(len + 1);
cfread(frag, len + 1, 1, cf_shader);
cfclose(cf_shader);
} else {
mprintf((" Loading built-in default shader for: %s\n", frag_name));
frag = defaults_get_file(frag_name);
}
if(!vert)
use_shaders = false;
Verify( vert != NULL );
Verify( frag != NULL );
shader_id = opengl_shader_create(vert, frag);
vglUseProgramObjectARB(shader_id);
if (!shader_id)
use_shaders = false;
}
if(!use_shaders) {
glGenTextures(1, &GLtex);
Assert( GLtex != 0 );
if ( GLtex == 0 ) {
nprintf(("MOVIE", "ERROR: Can't create a GL texture"));
video_inited = 1;
return;
}
}
// disable everything but what we need
opengl_switch_arb(-1, 0);
opengl_switch_arb(0, 1);
gr_set_lighting(false, false);
glBindTexture(GL_texture_target, GLtex);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glDepthFunc(GL_ALWAYS);
glDepthMask(GL_FALSE);
glDisable(GL_DEPTH_TEST);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
GL_state.Texture.DisableAll();
if(!use_shaders) {
GL_state.Texture.SetActiveUnit(0);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(GLtex);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_RGB8, wp2, hp2, 0, GL_BGR, GL_UNSIGNED_BYTE, NULL);
}
GL_state.SetTextureSource(TEXTURE_SOURCE_DECAL);
GL_state.SetAlphaBlendMode(ALPHA_BLEND_NONE);
GL_state.SetZbufferType(ZBUFFER_TYPE_NONE);
if(use_shaders) {
GL_state.Texture.SetActiveUnit(0);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(ytex);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_LUMINANCE8, 2048, 2048, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
GL_state.Texture.SetActiveUnit(1);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(utex);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_LUMINANCE8, 1024, 1024, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
GL_state.Texture.SetActiveUnit(2);
GL_state.Texture.SetTarget(GL_texture_target);
GL_state.Texture.Enable(vtex);
glTexParameteri(GL_texture_target, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_texture_target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_state.Texture.GetTarget(), 0, GL_LUMINANCE8, 1024, 1024, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE, NULL);
}
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
float movie_ratio = (float)g_screenWidth / (float)g_screenHeight;
@@ -422,17 +495,21 @@ static void OGG_video_init(theora_info *tinfo)
scale_video = 1;
}
// NOTE: using NULL instead of pixelbuf crashes some drivers, but then so does pixelbuf
glTexImage2D(GL_texture_target, 0, GL_RGB8, wp2, hp2, 0, GL_BGR, GL_UNSIGNED_BYTE, NULL);
// set our color so that we can make sure that it's correct
glColor3f(1.0f, 1.0f, 1.0f);
GL_state.Color(255, 255, 255, 255);
}
#ifndef NO_DIRECT3D
else if (gr_screen.mode == GR_DIRECT3D) {
// TODO: is there a fast way to do frames in D3D too?
if(!use_shaders) {
pixelbuf = (ubyte *) vm_malloc_q(g_screenWidth * g_screenHeight * 3);
if (pixelbuf == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate memory for pixelbuf"));
video_inited = 1;
return;
}
memset( pixelbuf, 0, g_screenWidth * g_screenHeight * 3 );
}
#endif
if (scale_video) {
g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_screenWidth) / 2);
@@ -448,38 +525,86 @@ static void OGG_video_init(theora_info *tinfo)
gl_screenYH = g_screenY + g_screenHeight;
gl_screenXW = g_screenX + g_screenWidth;
if (GL_texture_target == GL_TEXTURE_RECTANGLE_ARB) {
gl_screenU = (GLfloat)wp2;
gl_screenV = (GLfloat)hp2;
} else {
gl_screenU = i2fl(g_screenWidth) / i2fl(wp2);
gl_screenV = i2fl(g_screenHeight) / i2fl(hp2);
}
}
gl_screenU = i2fl(g_screenWidth) / i2fl(wp2);
gl_screenV = i2fl(g_screenHeight) / i2fl(hp2);
if(use_shaders) {
gl_screenU = i2fl(tinfo->frame_width-1) / i2fl(2048) ;
gl_screenV = i2fl(tinfo->frame_height-1) / i2fl(2048);
GL_state.Texture.SetShaderMode(GL_TRUE);
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "ytex"), 0 );
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "utex"), 1 );
vglUniform1iARB( vglGetUniformLocationARB(shader_id, "vtex"), 2 );
}
glVertices[0][0] = (GLfloat)g_screenX;
glVertices[0][1] = (GLfloat)g_screenY;
glVertices[0][2] = 0.0f;
glVertices[0][3] = 0.0f;
glVertices[1][0] = (GLfloat)g_screenX;
glVertices[1][1] = (GLfloat)gl_screenYH;
glVertices[1][2] = 0.0f;
glVertices[1][3] = gl_screenV;
glVertices[2][0] = (GLfloat)gl_screenXW;
glVertices[2][1] = (GLfloat)g_screenY;
glVertices[2][2] = gl_screenU;
glVertices[2][3] = 0.0f;
glVertices[3][0] = (GLfloat)gl_screenXW;
glVertices[3][1] = (GLfloat)gl_screenYH;
glVertices[3][2] = gl_screenU;
glVertices[3][3] = gl_screenV;
GL_state.Array.BindArrayBuffer(0);
GL_state.Array.EnableClientVertex();
GL_state.Array.VertexPointer(2, GL_FLOAT, sizeof(glVertices[0]), glVertices);
GL_state.Array.SetActiveClientUnit(0);
GL_state.Array.EnableClientTexture();
GL_state.Array.TexPointer(2, GL_FLOAT, sizeof(glVertices[0]), &(glVertices[0][2]));
}
if(!use_shaders && tinfo->frame_height > 450) {
mprintf(("VIDEO: No shader support and hd video is beeing played this can get choppy."));
}
video_inited = 1;
}
static void OGG_video_close()
{
if (!video_inited)
if ( !video_inited ) {
return;
}
if (gr_screen.mode == GR_OPENGL) {
GL_state.Array.DisableClientVertex();
GL_state.Array.DisableClientTexture();
if (scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
opengl_switch_arb(-1, 0);
glBindTexture(GL_texture_target, 0);
glDeleteTextures(1, &GLtex);
GLtex = 0;
GL_state.Texture.Disable();
if(use_shaders) {
GL_state.Texture.Delete(ytex);
GL_state.Texture.Delete(utex);
GL_state.Texture.Delete(vtex);
glDeleteTextures(1, &ytex);
glDeleteTextures(1, &utex);
glDeleteTextures(1, &vtex);
} else {
GL_state.Texture.Delete(GLtex);
glDeleteTextures(1, &GLtex);
}
opengl_set_texture_target();
glEnable(GL_DEPTH_TEST);
ytex = utex = vtex = 0;
GLtex = 0;
GL_state.Texture.SetShaderMode(GL_FALSE);
opengl_shader_set_current( 0 );
}
if (pixelbuf != NULL) {
@@ -495,7 +620,6 @@ static void OGG_video_close()
g_screenX = 0;
g_screenY = 0;
GLtex = 0;
gl_screenYH = 0;
gl_screenXW = 0;
gl_screenU = 0;
@@ -570,35 +694,29 @@ static void convert_YUV_to_RGB(yuv_buffer *yuv)
}
}
extern int Mouse_hidden;
static void OGG_video_draw(theora_state *tstate)
{
yuv_buffer yuv;
theora_decode_YUVout(tstate, &yuv);
convert_YUV_to_RGB(&yuv);
if(!use_shaders)
convert_YUV_to_RGB(&yuv);
if (gr_screen.mode == GR_OPENGL) {
glBindTexture(GL_texture_target, GLtex);
if(use_shaders) {
GL_state.Texture.SetActiveUnit(0);
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, yuv.y_stride, yuv.y_height, GL_LUMINANCE, GL_UNSIGNED_BYTE, yuv.y);
GL_state.Texture.SetActiveUnit(1);
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, yuv.uv_stride, yuv.uv_height, GL_LUMINANCE, GL_UNSIGNED_BYTE, yuv.u);
GL_state.Texture.SetActiveUnit(2);
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, yuv.uv_stride, yuv.uv_height, GL_LUMINANCE, GL_UNSIGNED_BYTE, yuv.v);
} else {
glTexSubImage2D(GL_state.Texture.GetTarget(), 0, 0, 0, g_screenWidth, g_screenHeight, GL_BGR, GL_UNSIGNED_BYTE, pixelbuf);
}
glTexSubImage2D(GL_texture_target, 0, 0, 0, g_screenWidth, g_screenHeight, GL_BGR, GL_UNSIGNED_BYTE, pixelbuf);
glBegin(GL_QUADS);
glTexCoord2f(0, 0);
glVertex2i(g_screenX, g_screenY);
glTexCoord2f(0, gl_screenV);
glVertex2i(g_screenX, gl_screenYH);
glTexCoord2f(gl_screenU, gl_screenV);
glVertex2i(gl_screenXW, gl_screenYH);
glTexCoord2f(gl_screenU, 0);
glVertex2i(gl_screenXW, g_screenY);
glEnd();
} else {
// TODO: FIXME!!!
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}
Mouse_hidden = 1;
gr_flip();
os_poll();
@@ -685,7 +803,7 @@ THEORAFILE *theora_open(char *filename)
char *p = strchr( lower_name, '.' );
if ( p ) *p = 0;
SAFE_STRCAT( lower_name, ".ogg", sizeof(lower_name) );
strcat_s( lower_name, ".ogg" );
// NOTE: Because the .ogg extension is used for both movies and sounds, we have to
// be a bit more specific about our search locations, so we look only in the
@@ -770,12 +888,14 @@ THEORAFILE *theora_open(char *filename)
movie->vorbis_p = 0;
}
int ret;
// we're expecting more header packets.
while ( (movie->theora_p < 3) || (movie->vorbis_p && (movie->vorbis_p < 3)) ) {
int ret;
ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket);
// look for further theora headers
while ( (movie->theora_p < 3) && (ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket)) ){
while ( (movie->theora_p < 3) && (ret) ){
if ( (ret < 0) || theora_decode_header(&movie->tinfo, &movie->tcomment, &movie->opacket) ) {
mprintf(("Theora ERROR: Error parsing Theora stream headers on '%s'! Corrupt stream?\n", lower_name));
goto Error;
@@ -783,10 +903,14 @@ THEORAFILE *theora_open(char *filename)
if (++movie->theora_p == 3)
break;
ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket);
}
ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket);
// look for more vorbis header packets
while ( movie->vorbis_p && (movie->vorbis_p < 3) && (ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket)) ) {
while ( movie->vorbis_p && (movie->vorbis_p < 3) && (ret) ) {
if ( (ret < 0) || vorbis_synthesis_headerin(&movie->vinfo, &movie->vcomment, &movie->opacket) ) {
mprintf(("Theora ERROR: Error parsing Vorbis stream headers on '%s'! Corrupt stream?\n", lower_name));
goto Error;
@@ -794,6 +918,8 @@ THEORAFILE *theora_open(char *filename)
if (++movie->vorbis_p == 3)
break;
ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket);
}
// The header pages/packets will arrive before anything else we care about, or the stream is not obeying spec
@@ -801,7 +927,7 @@ THEORAFILE *theora_open(char *filename)
if ( ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0 ) {
OGG_queue_page(movie); // demux into the appropriate stream
} else {
int ret = OGG_buffer_data(movie); // someone needs more data
ret = OGG_buffer_data(movie); // someone needs more data
if ( ret == 0 ) {
mprintf(("Theora ERROR: End of file while searching for codec headers in '%s'!\n", lower_name));
@@ -851,6 +977,10 @@ void theora_play(THEORAFILE *movie)
if ( (movie == NULL) || !movie->theora_p )
return;
// only OGL is supported
if (gr_screen.mode != GR_OPENGL)
return;
// open audio
if (movie->vorbis_p)
OGG_audio_init(&movie->vinfo);
@@ -879,15 +1009,15 @@ void theora_play(THEORAFILE *movie)
for (i = 0; (i < ret) && (i < maxsamples); i++) {
for (j = 0; j < movie->vinfo.channels; j++) {
int val = fl2i(pcm[j][i] * 32767.0f + 0.5f);
float val = pcm[j][i] * 32767.0f + 0.5f;
if (val > 32767)
val = 32767;
if (val > 32767.0f)
val = 32767.0f;
if (val < -32768)
val = -32768;
if (val < -32768.0f)
val = -32768.0f;
audiobuf[count++] = val;
audiobuf[count++] = (short)val;
}
}
+1 -13
View File
@@ -1,16 +1,4 @@
/*
* $Logfile: /Freespace2/src/cutscene/oggplayer.h $
* $Revision: 1.1.2.1 $
* $Date: 2006-12-25 21:44:11 $
* $Author: taylor $
*
* main lib for using Theora movies
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#ifndef _OGGPLAYER_H
#define _OGGPLAYER_H
+6 -9
View File
@@ -45,10 +45,10 @@ int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
strcpy_s(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p=0; }
strcat(real_name, ".dds");
strcat_s(real_name, ".dds");
// try to open the file
ddsfile = cfopen(real_name, "rb");
@@ -284,10 +284,10 @@ int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp, int cf_type)
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
strcpy_s(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p = 0; }
strcat(real_name, ".dds");
strcat_s(real_name, ".dds");
// open it up and go to the data section
cfp = cfopen(real_name, "rb", CFILE_NORMAL, cf_type);
@@ -356,12 +356,12 @@ void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data
} else {
Assert( strlen(filename) < MAX_FILENAME_LEN-5 );
strcpy(real_filename, filename);
strcpy_s(real_filename, filename);
char *p = strchr(real_filename, '.');
if (p) { *p = 0; }
strcat(real_filename, ".dds");
strcat_s(real_filename, ".dds");
}
CFILE *image = cfopen( real_filename, "wb", CFILE_NORMAL, CF_TYPE_CACHE );
@@ -495,7 +495,4 @@ const char *dds_error_string(int code)
default:
return "Abort, retry, fail?";
}
//get a warning otherwise
return "Abort, retry, fail?";
}
+202 -524
View File
File diff suppressed because it is too large. Load diff
+4 -148
View File
@@ -7,152 +7,7 @@
*
*/
/*
* $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
@@ -173,6 +28,7 @@ typedef struct debris {
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 must_survive_until; //WMC - timestamp of earliest point that it can be murthered.
int model_num; // What model this uses
int submodel_num; // What submodel this uses
int next_fireball; // When to start a fireball
@@ -186,6 +42,8 @@ typedef struct debris {
vec3d arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
int arc_timestamp[MAX_DEBRIS_ARCS]; // When this times out, the spark goes away. -1 is not used
int arc_frequency; // Starts at 0, gets bigger
int parent_alt_name;
float damage_mult;
} debris;
@@ -194,7 +52,6 @@ typedef struct debris {
#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];
@@ -206,7 +63,6 @@ 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 );
+208 -296
View File
@@ -7,124 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
* $Revision: 2.6.2.2 $
* $Date: 2007-02-18 21:26:52 $
* $Author: Goober5000 $
*
* Routines for managing the debug console window.
*
* $Log: not supported by cvs2svn $
* Revision 2.6.2.1 2006/09/08 06:14:43 taylor
* fix things that strict compiling balked at (from compiling with -ansi and -pedantic)
*
* Revision 2.6 2005/04/25 00:07:22 wmcoolmon
* Bumped console printing buffer size so people can play with the neb2 command
*
* 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>
@@ -138,7 +21,6 @@
#include "io/key.h"
#include "globalincs/alphacolors.h"
#include "osapi/osapi.h"
#include "debugconsole/dbugfile.h"
#define MAX_COMMANDS 300
@@ -151,35 +33,35 @@ debug_command::debug_command(char *_name, char *_help, void (*_func)() )
{
int i;
if ( Num_debug_commands >= MAX_COMMANDS ) {
if ( Num_debug_commands >= MAX_COMMANDS ) {
Int3(); // Too many debug console commands!! Increase MAX_COMMANDS!!
return;
}
for (i=0; i<Num_debug_commands; i++ ) {
for (i=0; i<Num_debug_commands; i++ ) {
int ret = stricmp( Debug_command[i]->name, _name );
if ( ret == 0) {
if ( ret == 0) {
Int3(); // This debug console command already exists!!!!
return;
} else if ( ret > 0 ) {
} else if ( ret > 0 ) {
break; // Insert it here
} else if ( ret < 0 ) {
} else if ( ret < 0 ) {
// do nothing
}
}
if ( i < Num_debug_commands ) {
if ( i < Num_debug_commands ) {
// Insert it at element i
int j;
for (j=Num_debug_commands; j>i; j-- ) {
for (j=Num_debug_commands; j>i; j-- ) {
Debug_command[j] = Debug_command[j-1];
}
Debug_command[i] = this;
Debug_command[i] = this;
Num_debug_commands++;
} else {
Debug_command[Num_debug_commands] = this;
Debug_command[Num_debug_commands] = this;
Num_debug_commands++;
}
@@ -189,17 +71,18 @@ debug_command::debug_command(char *_name, char *_help, void (*_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 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
ubyte Dc_arg_ubyte; // If Dc_arg_type & ARG_UBYTE 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 scroll_times = 0; // incremented each time display scrolls
int debug_inited = 0;
@@ -229,7 +112,7 @@ typedef enum {
#define MAX_TOKEN_STRING_LENGTH 128
char scanner_ch;
char scanner_ch;
TOKEN_CODE scanner_token;
char scanner_token_string[MAX_TOKEN_STRING_LENGTH];
@@ -243,7 +126,7 @@ CHAR_CODE scanner_char_table[256];
void scanner_get_char()
{
if ( *scanner_bufferp == '\0' ) {
if ( *scanner_bufferp == '\0' ) {
scanner_ch = 0;
return;
}
@@ -261,32 +144,29 @@ void scanner_init()
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') )
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 );
strcpy_s( scanner_word_string, scanner_token_string );
tp = scanner_word_string;
do {
@@ -295,10 +175,9 @@ void scanner_downshift_word()
} while (*tp != '\0' );
}
void scanner_get_word()
{
while( (scanner_char_code(scanner_ch)==LETTER) || (scanner_char_code(scanner_ch)==DIGIT) ) {
while( (scanner_char_code(scanner_ch)==LETTER) || (scanner_char_code(scanner_ch)==DIGIT) ) {
*scanner_tokenp++ = scanner_ch;
scanner_get_char();
}
@@ -307,13 +186,12 @@ void scanner_get_word()
scanner_token = IDENTIFIER;
}
void scanner_get_string()
{
*scanner_tokenp++ = 34;
scanner_get_char();
while(scanner_ch != 34 ) {
while(scanner_ch != 34 ) {
*scanner_tokenp++ = scanner_ch;
scanner_get_char();
}
@@ -323,21 +201,18 @@ void scanner_get_string()
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;
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:
case LETTER: scanner_get_word(); break;
default:
*scanner_tokenp++ = scanner_ch;
*scanner_tokenp = '\0';
scanner_get_char();
@@ -354,7 +229,6 @@ void scanner_start_command( char * s )
scanner_get_char();
}
int Dc_debug_on = 0;
jmp_buf dc_bad_arg;
@@ -362,98 +236,126 @@ void dc_get_arg(uint type)
{
scanner_get_token();
Dc_command_line = scanner_bufferp;
Dc_command_line = scanner_bufferp;
Dc_arg_org = scanner_token_string;
Dc_arg = scanner_word_string;
if (Dc_debug_on) {
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 ) {
if ( scanner_token == NO_TOKEN ) {
Dc_arg_type = ARG_NONE;
} else if ( scanner_token == IDENTIFIER ) {
} else if ( scanner_token == IDENTIFIER ) {
Dc_arg_type = ARG_STRING;
} else if ( scanner_token == STRING ) {
} else if ( scanner_token == STRING ) {
Dc_arg_type = ARG_QUOTE;
} else {
Dc_arg_type = ARG_STRING;
}
if ( 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);
for (i=0; i<len; i++) {
if ( scanner_char_table[Dc_arg[i]] == DIGIT ) {
num_digits++;
}
} 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 ( 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);
Dc_arg_type |= ARG_UBYTE;
Dc_arg_ubyte = (ubyte)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 )
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 )
if ( Dc_arg_type & ARG_INT ) {
dc_printf( "Found int number! %d\n", Dc_arg_int );
}
if ( Dc_arg_type & ARG_HEX )
if ( Dc_arg_type & ARG_UBYTE ) {
dc_printf( "Found ubyte number! %d\n", Dc_arg_ubyte );
}
if ( Dc_arg_type & ARG_HEX ) {
dc_printf( "Found hex number! 0x%x\n", Dc_arg_int );
}
}
if ( !stricmp( Dc_arg, "on" ))
if ( !stricmp( Dc_arg, "on" ) ) {
Dc_arg_type |= ARG_TRUE;
if ( !stricmp( Dc_arg, "true" ))
}
if ( !stricmp( Dc_arg, "true" ) ) {
Dc_arg_type |= ARG_TRUE;
if ( !stricmp( Dc_arg, "off" ))
}
if ( !stricmp( Dc_arg, "off" ) ) {
Dc_arg_type |= ARG_FALSE;
if ( !stricmp( Dc_arg, "false" ))
}
if ( !stricmp( Dc_arg, "false" ) ) {
Dc_arg_type |= ARG_FALSE;
}
if ( !stricmp( Dc_arg, "+" ))
if ( !stricmp( Dc_arg, "+" ) ) {
Dc_arg_type |= ARG_PLUS;
}
if ( !stricmp( Dc_arg, "-" ))
if ( !stricmp( Dc_arg, "-" ) ) {
Dc_arg_type |= ARG_MINUS;
}
if ( !stricmp( Dc_arg, "," ))
if ( !stricmp( Dc_arg, "," ) ) {
Dc_arg_type |= ARG_COMMA;
}
}
if ( Dc_arg_type & ARG_INT) {
if ( Dc_arg_int )
if ( Dc_arg_type & ARG_INT) {
if ( Dc_arg_int ) {
Dc_arg_type |= ARG_TRUE;
else
} else {
Dc_arg_type |= ARG_FALSE;
}
}
if ( !(Dc_arg_type&type) ) {
if ( (Dc_arg_type & ARG_NONE) && !(type & ARG_NONE))
if ( Dc_arg_type & ARG_UBYTE) {
if ( Dc_arg_ubyte ) {
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
} else {
dc_printf( "Error: '%s' invalid type\n", Dc_arg );
longjmp(dc_bad_arg,1);
longjmp(dc_bad_arg,1);
}
}
}
void debug_help();
@@ -464,80 +366,85 @@ void debug_do_command(char * command)
int i;
int mode = 0;
if ( strlen(command) < 1 ) return;
if ( strlen(command) < 1 ) {
return;
}
Dc_debug_on = 0;
Dc_command_line = command;
scanner_start_command(command);
if (setjmp(dc_bad_arg) ) {
if (setjmp(dc_bad_arg) ) {
return;
}
dc_get_arg( ARG_ANY );
if ( !strcmp( Dc_arg, "debug" ) ) {
if ( !strcmp( Dc_arg, "debug" ) ) {
Dc_debug_on = 1;
dc_printf( "Command line: '%s'\n", Dc_command_line );
dc_get_arg( ARG_ANY );
}
if ( !stricmp( Dc_arg, "xyzzy" ) ) {
if ( !stricmp( Dc_arg, "xyzzy" ) ) {
dc_printf("Nothing happens.\n");
return;
}
if ( !strcmp( Dc_arg, "?" ) ) {
if ( !strcmp( Dc_arg, "?" ) ) {
mode = 1;
dc_get_arg( ARG_ANY );
if ( Dc_arg_type&ARG_NONE ) {
debug_help();
if ( Dc_arg_type&ARG_NONE ) {
debug_help();
return;
}
}
if ( !strcmp( Dc_arg, "help" ) || !strcmp( Dc_arg, "man" ) ) {
if ( !strcmp( Dc_arg, "help" ) || !strcmp( Dc_arg, "man" ) ) {
mode = 2;
dc_get_arg( ARG_ANY );
if ( Dc_arg_type&ARG_NONE ) {
debug_help();
if ( Dc_arg_type&ARG_NONE ) {
debug_help();
return;
}
}
if ( strstr( Dc_command_line, "?" ) ) {
if ( strstr( Dc_command_line, "?" ) ) {
mode = 2;
}
if ( !(Dc_arg_type&ARG_STRING) ) {
if ( !(Dc_arg_type&ARG_STRING) ) {
dc_printf( "Invalid keyword '%s'\n", Dc_arg );
return;
}
if (Dc_debug_on) {
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 )) {
for (i=0; i<Num_debug_commands; i++ ) {
if ( !stricmp( Debug_command[i]->name, Dc_arg ) ) {
if (mode==0) {
if (Dc_debug_on)
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)
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)
if (Dc_debug_on) {
dc_printf( "Doing help for '%s'\n", Dc_arg );
}
Dc_command = 0;
Dc_help = 1;
Dc_status = 0;
@@ -545,9 +452,9 @@ void debug_do_command(char * command)
(*Debug_command[i]->func)();
if (mode==0) {
if (mode==0) {
dc_get_arg(ARG_ANY);
if (!(Dc_arg_type&ARG_NONE)) {
if (!(Dc_arg_type&ARG_NONE)) {
dc_printf( "Ignoring the unused command line tail '%s %s'\n", Dc_arg_org, Dc_command_line );
}
}
@@ -562,7 +469,7 @@ void debug_do_command(char * command)
void debug_draw()
{
int i;
gr_clear();
gr_set_font(FONT1);
gr_set_color_fast( &Color_bright );
@@ -570,12 +477,12 @@ void debug_draw()
gr_set_color_fast( &Color_normal );
for (i=0; i<DROWS; i++ ) {
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 ) {
if ( t & 1 ) {
int w,h;
char c;
@@ -583,10 +490,10 @@ void debug_draw()
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;
}
@@ -596,17 +503,18 @@ void debug_draw()
void debug_output( char c )
{
if ( c == '\t' ) {
if ( c == '\t' ) {
int next_tab = ((debug_x/28)+1)*28;
if ( next_tab >= DCOLS-1 ) {
if ( next_tab >= DCOLS-1 ) {
debug_x=0;
debug_y++;
scroll_times++;
if ( debug_y >= DROWS ) {
if ( debug_y >= DROWS ) {
int i;
for (i=1; i<DROWS; i++ )
strcpy( debug_text[i-1], debug_text[i] );
for (i=1; i<DROWS; i++ ) {
strcpy_s( debug_text[i-1], debug_text[i] );
}
debug_y = DROWS-1;
debug_x = 0;
debug_text[debug_y][debug_x] = 0;
@@ -615,26 +523,30 @@ void debug_output( char c )
return;
}
for ( ; debug_x < next_tab; )
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) ) {
if ( (c == '\n') || (debug_x >= DCOLS-1) ) {
debug_x=0;
debug_y++;
scroll_times++;
if ( debug_y >= DROWS ) {
if ( debug_y >= DROWS ) {
int i;
for (i=1; i<DROWS; i++ )
strcpy( debug_text[i-1], debug_text[i] );
for (i=1; i<DROWS; i++ ) {
strcpy_s( 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;
if ( c == '\n' ) {
return;
}
}
debug_text[debug_y][debug_x++] = c;
@@ -645,73 +557,73 @@ 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' ) {
while( *p != '\0' ) {
debug_output(*p);
p++;
}
}
}
void debug_init()
{
int i;
if ( debug_inited ) return;
if ( debug_inited ) {
return;
}
debug_inited = 1;
debug_x=0;
debug_y=0;
for (i=0; i<DROWS; i++ ) {
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() ){
while( key_inkey() ) {
os_poll();
}
if ( !debug_inited ) debug_init();
if ( !debug_inited ) {
debug_init();
}
debug_draw();
while (!done) {
while (!done) {
// poll the os
os_poll();
int k = key_inkey();
switch( k ) {
switch( k ) {
case KEY_SHIFTED+KEY_ENTER:
case KEY_ESC:
done=1; break;
case KEY_ESC:
done=1; break;
case KEY_BACKSP:
if ( command_line_pos > 0 ) {
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] );
if ( last_oldcommand > -1 ) {
strcpy_s( command_line, oldcommand_line[last_oldcommand] );
command_line_pos = strlen(command_line);
command_line[command_line_pos] = 0;
}
@@ -719,11 +631,12 @@ void debug_console( void (*_func)() )
case KEY_UP:
command_scroll--;
if (command_scroll<0)
if (command_scroll<0) {
command_scroll = last_oldcommand;
}
if ( command_scroll > -1 ) {
strcpy( command_line, oldcommand_line[command_scroll] );
if ( command_scroll > -1 ) {
strcpy_s( command_line, oldcommand_line[command_scroll] );
command_line_pos = strlen(command_line);
command_line[command_line_pos] = 0;
}
@@ -731,46 +644,44 @@ void debug_console( void (*_func)() )
case KEY_DOWN:
command_scroll++;
if (command_scroll>last_oldcommand)
if (command_scroll>last_oldcommand) {
command_scroll = 0;
if (command_scroll>last_oldcommand)
}
if (command_scroll>last_oldcommand) {
command_scroll = -1;
if ( command_scroll > -1 ) {
strcpy( command_line, oldcommand_line[command_scroll] );
}
if ( command_scroll > -1 ) {
strcpy_s( command_line, oldcommand_line[command_scroll] );
command_line_pos = strlen(command_line);
command_line[command_line_pos] = 0;
}
break;
case KEY_ENTER: {
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 )) {
for (i=0; i<=last_oldcommand; i++ ) {
if (!stricmp( oldcommand_line[i], command_line )) {
found = 1;
}
}
if ( !found ) {
if ( last_oldcommand < DEBUG_HISTORY-1 ) {
if ( !found ) {
if ( last_oldcommand < DEBUG_HISTORY-1 ) {
last_oldcommand++;
strcpy( oldcommand_line[last_oldcommand], command_line);
strcpy_s( oldcommand_line[last_oldcommand], command_line);
} else {
int i;
for (i=0; i<last_oldcommand; i++ ) {
strcpy( oldcommand_line[i], oldcommand_line[i+1] );
int iLoop;
for (iLoop=0; iLoop<last_oldcommand; iLoop++ ) {
strcpy_s( oldcommand_line[iLoop], oldcommand_line[iLoop+1] );
}
strcpy( oldcommand_line[last_oldcommand], command_line);
strcpy_s( 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;
@@ -779,7 +690,7 @@ void debug_console( void (*_func)() )
}
break;
default: {
default: {
ubyte c = (ubyte)key_to_ascii(k);
if ( c != 255 ) {
command_line[command_line_pos++] = c;
@@ -788,16 +699,16 @@ void debug_console( void (*_func)() )
}
}
strcpy( debug_text[debug_y], ">" );
strcat( debug_text[debug_y], command_line );
strcpy_s( debug_text[debug_y], ">" );
strcat_s( debug_text[debug_y], command_line );
debug_draw();
if ( _func ){
if ( _func ) {
_func();
}
}
while( key_inkey() ){
while( key_inkey() ) {
os_poll();
}
}
@@ -806,24 +717,25 @@ void debug_help()
{
int s, i;
dc_printf( "Available functions:\n\n" );
dc_printf( "Available functions:\n\n" );
s = scroll_times;
for (i=0; i<Num_debug_commands; i++ ) {
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 ) {
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 ) {
if ( k == KEY_B ) {
i -= ((DROWS-3)*2);
if ( i <= 0 )
if ( i <= 0 ) {
i = -1;
}
}
}
}
debug_draw();
}
dc_printf( "\n" );
-406
View File
@@ -1,406 +0,0 @@
#include "dbugfile.h"
#include "globalincs/pstypes.h"
#ifdef _WIN32
#include <windows.h>
#endif
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
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
+5 -5
View File
@@ -109,10 +109,10 @@ 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
* @param colour Colour index (>=0)
* @param xpos X position to start bar on
* @param xwidth Width of bar
* @param yrow Index of row bar belongs to
*/
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
{
@@ -212,7 +212,7 @@ void timerbar_switch_type(int num)
}
/**
* @param void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h) - pointer to draw function
* @param (*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.
+1 -58
View File
@@ -6,56 +6,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
* $Revision: 1.11 $
* $Date: 2006-04-20 06:32:00 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.10 2005/07/13 02:50:50 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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_
@@ -75,13 +26,5 @@ 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
-129
View File
@@ -1,129 +0,0 @@
//header file for making decals-Bobboau
#ifndef _DECAL_H
#define _DECAL_H
#include "object/object.h"
#include "globalincs/pstypes.h"
//#include "ship/ship.h"
#ifdef ENABLE_DECALS
#define MAX_DECAL_POLY 40
#define MAX_DECAL_POLY_POINT 10
#define MAX_DECAL_DEFPOINTS 10000
#define MAX_DECAL_POINT 10
#define MAX_SHIP_DECALS 25
#define MAX_GLOBAL_DECAL_POLYS 11000
#define QUICKFIND_SUBDIVISION 100
#define QUICKFIND_SEGMENT_LENGTH (MAX_GLOBAL_DECAL_POLYS/QUICKFIND_SUBDIVISION)
#define MAX_GLOBAL_DECALS 5000
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
#endif // ENABLE_DECALS
struct decal;
struct decal_list;
struct decal_list_controle;
struct decal_poly{
vec3d norm[3];
vertex point[3];
decal_poly *next;
decal* parent;
int idx;
};
struct decal{
int n_poly;
int timestamp; //when this decal was created
int burn_time; //how long it takes for the glow texture to fade
int vertex_buffer_start; //were is the start of this decal's polys in the vertex buffer
decal_poly* poly;
decal_poly* add_poly();
decal_poly* get_last_poly();
void remove_last_poly();
decal_list_controle *parent;
};
struct decal_list{
decal dec;
decal_list *next;
};
struct decal_item{
decal_list dec;
bool used;
};
struct decal_list_controle{
int n_decals;
int buffer;
int texture;
int n_poly;
int burn_texture;
int glow_texture;
bool modifyed;
decal_list *d_list;
decal_list *end;
decal_list *add_new();
void trim();
void clear();
~decal_list_controle();
decal_list_controle();
};
struct decal_system{
decal_list_controle *decals;
int n_decal_textures;
bool decals_modified;
int max_decals;
decal_system():decals(NULL),n_decal_textures(0),decals_modified(false){};
};
//this is used to give all the data to the generation data to the functions that make them
struct decal_point{
vec3d pnt;
matrix orient;
float radius;
};
#ifdef ENABLE_DECALS
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000);//makes the decal
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
void decal_render_all(object * obj); //renders all decals
int decal_create_sub(void *model_ptr);
void clear_decals(decal_system *system);
void init_decals();
#else // ENABLE_DECALS
inline int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000)
{
return 0;
}
#define decal_create_simple(a, b, c) (0)
#define decal_render_all(a)
#define decal_create_sub(a) (0);
#define clear_decals(a)
#define init_decals()
#endif // ENABLE_DECALS
#endif // _DECAL_H
-1035
View File
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
-350
View File
@@ -1,350 +0,0 @@
#include <windows.h>
#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);
// f%#$ing DivX6...
// SetForegroundWindow(ghApp);
// 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(InitVideoWindow(ghApp, width, height));
JIF(pVW->SetWindowForeground(OATRUE));
JIF(pVW->put_MessageDrain((OAHWND)ghApp));
}
// 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);
pVW->put_Owner(NULL);
}
// 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
-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__
+7 -75
View File
@@ -7,78 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
* $Revision: 2.10.2.1 $
* $Date: 2006-11-15 00:26:03 $
* $Author: taylor $
*
* Main file for dealing with exception handling
*
* $Log: not supported by cvs2svn $
* Revision 2.10 2006/01/26 03:23:29 Goober5000
* pare down the pragmas some more
* --Goober5000
*
* Revision 2.9 2006/01/20 07:10:33 Goober5000
* reordered #include files to quash Microsoft warnings
* --Goober5000
*
* Revision 2.8 2005/01/31 23:27:52 taylor
* merge with Linux/OSX tree - p0131-2
*
* Revision 2.7 2004/07/26 20:47:27 Kazan
* remove MCD complete
*
* Revision 2.6 2004/07/12 16:32:45 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.5 2004/03/31 05:42:26 Goober5000
* got rid of all those nasty warnings from xlocale and so forth; also added comments
* to indicate which warnings were being disabled
* --Goober5000
*
* Revision 2.4 2004/03/06 23:28:22 bobboau
* fixed motion debris
* animated laser textures
* and added a new error check called a safepoint, mostly for tracking the 'Y bug'
*
* Revision 2.3 2003/11/11 02:15:43 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --Goober5000
*
* Revision 2.2 2003/11/06 20:22:03 Kazan
* slight change to .dsp - leave the release target as fs2_open_r.exe already
* added myself to credit
* killed some of the stupid warnings (including doing some casting and commenting out unused vars in the graphics modules)
* Release builds should have warning level set no higher than 2 (default is 1)
* Why are we getting warning's about function selected for inline expansion... (killing them with warning disables)
* FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
*
* Revision 2.1 2003/03/02 05:10:42 penguin
* Added #ifdef _MSC_VER around strange exception-handling code
* - penguin
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:05 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 1 6/29/99 7:42p Dave
*
* 3 1/19/99 9:07a Allender
* removed compiler warning pragma's since we are already ignoring them in
* vtypes.h
*
* 2 1/18/99 4:34p Allender
* added the exception handler routines from Game Developer for structured
* exception handling in vsdk code
*
* $NoKeywords: $
*/
// Copyright © 1998 Bruce Dawson.
/*
@@ -87,6 +16,8 @@ information after crashes. See exceptionhandler.h for information
on how to hook it in.
*/
#ifdef GAME_ERRORLOG_TXT
#ifdef _WIN32
#include "globalincs/pstypes.h"
@@ -377,7 +308,7 @@ static char* GetFilePart(char *source)
//
// --------------------
extern char safe_string[512];
SCP_string safe_string;
// Entry point into the main exception handling routine. This routine is put into an except()
// statment at the beginning of a thread and is called anytime that there is a program exception
@@ -563,8 +494,8 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
#endif
#ifndef NDEBUG
if (safe_string[0])
hprintf(LogFile, "Last safe point: %s\r\n", safe_string);
if (!safe_string.empty())
hprintf(LogFile, "Last safe point: %s\r\n", safe_string.c_str());
#endif
RecordModuleList(LogFile);
@@ -578,3 +509,4 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
}
#endif // _WIN32
#endif
+2 -37
View File
@@ -7,44 +7,8 @@
*
*/
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
* $Revision: 2.4 $
* $Date: 2005-07-13 02:50:52 $
* $Author: Goober5000 $
*
* Header file for program exception handling
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2005/04/12 05:26:36 taylor
* many, many compiler warning and header fixes (Jens Granseuer)
* fix free on possible NULL in modelinterp.cpp (Jens Granseuer)
*
* Revision 2.2 2004/08/11 05:06:22 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:22 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/07 02:58:10 mharris
* ifdef around pragma
*
* Revision 1.1 2002/05/02 18:03:05 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 1 6/29/99 7:42p Dave
*
* 2 1/18/99 4:34p Allender
* added the exception handler routines from Game Developer for structured
* exception handling in vsdk code
*
* $NoKeywords: $
*/
#ifdef GAME_ERRORLOG_TXT
#ifndef __EXCEPTION_HANDLER_H
#define __EXCEPTION_HANDLER_H
@@ -105,3 +69,4 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message);
#endif // __EXCEPTION_HANDLER_H
#endif
+106
View File
@@ -0,0 +1,106 @@
#ifndef EXTERNALCODE_H_INCLUDED_
#define EXTERNALCODE_H_INCLUDED_
#include "globalincs/pstypes.h"
/* We must have windows.h anywhere SCP_ExternalCode is used under windows */
#ifdef _WIN32
#include <windows.h>
#endif
/* This class loads external libraries for FSO use.
* Different platforms have different ways of doing this, so use your ifdefs!
*/
class SCP_ExternalCode
{
public:
SCP_ExternalCode( )
#ifdef _WIN32
: m_dll( NULL )
#endif
{
}
virtual ~SCP_ExternalCode( )
{
#ifdef _WIN32
if ( m_dll )
::FreeLibrary( m_dll );
#endif
}
protected:
BOOL LoadExternal( const char* externlib )
{
if ( !externlib )
return FALSE;
#ifdef _WIN32
m_dll = ::LoadLibrary( externlib );
if ( m_dll )
return TRUE;
#endif
return FALSE;
}
void* LoadFunction( const char* functionname )
{
#ifdef _WIN32
if ( m_dll != NULL && functionname != NULL )
return ::GetProcAddress( m_dll, functionname );
#endif
return NULL;
}
private:
#ifdef _WIN32
HMODULE m_dll;
#endif
};
/* These are available if you're compiling an external DLL
* So far we have trackir, and speech is on the way
*/
#ifdef _WIN32
# define SCP_EXT_CALLCONV __cdecl
# ifdef SCPDLL_EXTERNAL_LIB
# define SCPDLL_EXTERNAL __declspec( dllexport )
# else
# define SCPDLL_EXTERNAL __declspec( dllimport )
# endif
/* Must be in a CPP file in your DLL code
* If you want to write your own, you shouldn't.
*/
# define SCPDLL_DLLMAIN( ) \
SCP_EXTERN_C BOOL APIENTRY DllMain( HANDLE, DWORD, LPVOID ) { return TRUE; }
#else
# define SCP_EXT_CALLCONV
# define SCPDLL_EXTERNAL
# define SCPDLL_DLLMAIN( )
#endif
#ifdef __cplusplus
# define SCP_EXTERN_C extern "C"
#else
# define SCP_EXTERN_C
#endif
/* Version information */
typedef struct _SCPDLL_Version
{
int major;
int minor;
int patch;
} SCPDLL_Version;
typedef int ( SCP_EXT_CALLCONV *SCPDLL_PFVERSION )( SCPDLL_Version* );
/* Must be in a CPP file in your DLL code */
#define SCPDLL_VERSION_FUNCTION( Major, Minor, Patch ) \
SCP_EXTERN_C int SCPDLL_EXTERNAL SCPDLL_GetVersion( SCPDLL_Version* v ) { \
if ( !v ) return -1;\
v->major = Major; v->minor = Minor; v->patch = Patch;\
return 0; }
#endif /* EXTERNALCODE_H_INCLUDED_ */
+4
View File
@@ -0,0 +1,4 @@
#include "trackirpublic.h"
/* The TrackIR Interface */
TrackIRDLL gTirDll_TrackIR;
+170
View File
@@ -0,0 +1,170 @@
#ifndef TRACKIRPUBLIC_H_INCLUDED_
#define TRACKIRPUBLIC_H_INCLUDED_
#include "external_dll/externalcode.h"
#include "globalincs/pstypes.h"
#define TRACKIRBRIDGEDLLNAME "scptrackir.dll"
#define SCP_INITRESULT_SUCCESS 0
#define SCP_INITRESULT_BADKEY 1
#define SCP_INITRESULT_BADPATH 2
#define SCP_INITRESULT_PATHTOOLONG 3
#define SCP_INITRESULT_NODLL 4
#define SCP_INITRESULT_BADSIGNATURE 5
#define SCP_INITRESULT_UNABLETOREGISTER 6
#define SCP_INITRESULT_BADDATAFIELDS 7
#define SCP_INITRESULT_BADREGISTRATION 8
#define SCP_INITRESULT_BADTRANSMISSION 9
/* Exported functions */
/* HWND comes from externalcode.h */
/* These are function pointer prototypes provided for library loading */
/* Only one function doesn't return an int or a float */
typedef int ( SCP_EXT_CALLCONV *SCPTRACKIR_PFINIT )( HWND );
/* All other trackir functions return an int or a float
* and take no parameters
*/
typedef int ( SCP_EXT_CALLCONV *SCPTRACKIR_PFINTVOID )( );
typedef float ( SCP_EXT_CALLCONV *SCPTRACKIR_PFFLOATVOID )( );
class TrackIRDLL : public SCP_ExternalCode
{
public:
TrackIRDLL( )
{
/* Load the DLL and functions
* If this is done globally, we'll be found by MSPDBDEBUGGING :)
*/
Reset( );
if ( !LoadExternal( TRACKIRBRIDGEDLLNAME ) )
return;
m_Init = (SCPTRACKIR_PFINIT)LoadFunction( "SCPTIR_Init" );
m_Close = (SCPTRACKIR_PFINTVOID)LoadFunction( "SCPTIR_Close" );
m_Query = (SCPTRACKIR_PFINTVOID)LoadFunction( "SCPTIR_Query" );
m_GetX = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetX" );
m_GetY = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetY" );
m_GetZ = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetZ" );
m_GetRoll = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetRoll" );
m_GetPitch = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetPitch" );
m_GetYaw = (SCPTRACKIR_PFFLOATVOID)LoadFunction( "SCPTIR_GetYaw" );
m_enabled = true;
}
bool Enabled( )
{
return m_enabled;
}
virtual ~TrackIRDLL( )
{
/* Prevent further use of the DLL */
Reset( );
}
void Reset( )
{
m_Init = NULL;
m_Close = NULL;
m_Query = NULL;
m_GetX = NULL;
m_GetY = NULL;
m_GetZ = NULL;
m_GetPitch = NULL;
m_GetRoll = NULL;
m_GetYaw = NULL;
m_enabled = false;
}
/* Returns 0 on success */
int Init( HWND hwnd )
{
if ( m_Init )
return m_Init( hwnd );
return 0;
}
int Close( )
{
if ( m_Close )
return m_Close( );
return 0;
}
int Query( )
{
if ( m_Query )
return m_Query( );
return 0;
}
float GetX( )
{
if ( m_GetX )
return m_GetX( );
return 0.0f;
}
float GetY( )
{
if ( m_GetY )
return m_GetY( );
return 0.0f;
}
float GetZ( )
{
if ( m_GetZ )
return m_GetZ( );
return 0.0f;
}
float GetPitch( )
{
if ( m_GetPitch )
return m_GetPitch( );
return 0.0f;
}
float GetRoll( )
{
if ( m_GetRoll )
return m_GetRoll( );
return 0.0f;
}
float GetYaw( )
{
if ( m_GetYaw )
return m_GetYaw( );
return 0.0f;
}
private:
/* Functions */
SCPTRACKIR_PFINIT m_Init;
SCPTRACKIR_PFINTVOID m_Close;
SCPTRACKIR_PFINTVOID m_Query;
SCPTRACKIR_PFFLOATVOID m_GetX;
SCPTRACKIR_PFFLOATVOID m_GetY;
SCPTRACKIR_PFFLOATVOID m_GetZ;
SCPTRACKIR_PFFLOATVOID m_GetPitch;
SCPTRACKIR_PFFLOATVOID m_GetRoll;
SCPTRACKIR_PFFLOATVOID m_GetYaw;
bool m_enabled;
};
/* Added to trackirpublic.h */
#ifndef SCPDLL_EXTERNAL_LIB
extern TrackIRDLL gTirDll_TrackIR;
#endif
#endif /* TRACKIRPUBLIC_H_INCLUDED_ */
File diff suppressed because it is too large. Load diff
+28 -230
View File
@@ -7,214 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
* $Revision: 2.14.2.2 $
* $Date: 2007-11-22 05:02:28 $
* $Author: taylor $
*
* Prototypes for fireball functions
*
* $Log: not supported by cvs2svn $
* Revision 2.14.2.1 2007/02/11 09:53:33 taylor
* support for tbl specified fireball explosion color ("$Light color:")
*
* Revision 2.14 2005/07/13 02:50:52 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.13 2005/04/05 05:53:15 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.12 2005/03/19 18:02:33 bobboau
* added new graphic functions for state blocks
* also added a class formanageing a new effect
*
* Revision 2.11 2004/10/31 02:04:33 Goober5000
* added Knossos_warp_ani_used flag for taylor
* --Goober5000
*
* Revision 2.10 2004/09/17 07:12:22 Goober5000
* changed around the logic for the 3D warp effect
* --Goober5000
*
* Revision 2.9 2004/08/23 04:32:39 Goober5000
* warp effect is back to FS2 default
* --Goober5000
*
* Revision 2.8 2004/08/11 05:06:22 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.7 2004/05/12 22:49:13 phreak
* renamed the warp model variable from 'wm' to 'Warp_model'
*
* Revision 2.6 2004/03/17 04:07:29 bobboau
* new fighter beam code
* fixed old after burner trails
* had to bump a few limits, working on some dynamic solutions
* a few fixed to background POF rendering
* fixing asorted bugs
*
* Revision 2.5 2004/03/05 09:02:00 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.4 2003/03/19 06:23:27 Goober5000
* added warp-effect sexp
* --Goober5000
*
* Revision 2.3 2003/03/02 05:12:39 penguin
* Moved "extern int wm" declaration inside the header #ifdef block
* - penguin
*
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 8 9/13/99 10:09a Andsager
* Add debug console commands to lower model render detail and fireball
* LOD for big ship explosiosns.
*
* 7 9/06/99 6:57p Jamesa
* Cranked down num large fireball explosions.
*
* 6 9/06/99 6:14p Jamesa
* Reduced max fireball types.
*
* 5 8/31/99 10:13p Andsager
* Add Knossos warp effect fireball
*
* 4 4/28/99 11:13p Dave
* Temporary checkin of artillery code.
*
* 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
*
* 34 5/15/98 3:54p John
* Added code so that only "perishable" fireballs get removed.
*
* 33 4/15/98 9:42a Adam
* added 2 more explosion types (1, actually, but placeholder for 2)
*
* 32 4/12/98 9:56a John
* Made lighting detail flags work. Made explosions cast light on
* highest.
*
* 31 3/30/98 4:02p John
* Made machines with < 32 MB of RAM use every other frame of certain
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
*
* 30 3/18/98 12:36p John
* Made hardware have nicer looking warp effect
*
* 29 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 28 2/19/98 4:32p Lawrance
* Add asteroid explosion
*
* 27 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.
*
* 26 1/15/98 4:58p John
* Made warp effect use a looping ani. Made the scaling up & down be in
* software.
*
* 25 1/15/98 2:32p John
* Added code to optionally take a velocity for a fireball.
*
* 24 1/02/98 5:04p John
* Several explosion related changes. Made fireballs not be used as
* ani's. Made ship spark system expell particles. Took away impact
* explosion for weapon hitting ship... this needs to get added to weapon
* info and makes shield hit more obvious. Only make sparks when hit
* hull, not shields.
*
* 23 12/08/97 11:15a John
* added parameter to warpout for life.
*
* 22 11/01/97 1:49p John
* added code to page fireballs in during level load. Made player warpout
* use Adam's new camera movement pattern. Make ships docked to warping
* out ships render correctly.
*
* 21 10/24/97 6:24p John
* added code to return the life left of a fireball
*
* 20 9/14/97 4:49p Lawrance
* extern Num_fireballs
*
* 19 9/12/97 4:02p John
* put in ship warp out effect.
* put in dynamic lighting for warp in/out
*
* 18 9/09/97 4:49p John
* Almost done ship warp in code
*
* 17 9/03/97 4:32p 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.
*
* 16 8/29/97 2:26p John
* first rev of ship warp in effect. Nothing more than a fireball inside
* of freespace, but textest.cpp contains the correct effect code that
* needs to be transferred into the game next.
*
* 15 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
*
* 14 8/13/97 12:06p Lawrance
* supporting multiple types of fireball explosions
*
* 13 7/21/97 11:41a Lawrance
* clean up fireballs at the end of each level
*
* 12 7/11/97 11:19a Lawrance
* fix mem leaks, move save code from State.cpp here
*
* 11 7/10/97 1:51p Lawrance
* sorting anim fireballs
*
* 10 5/14/97 4:08p Lawrance
* removing my_index from game arrays
*
* 9 3/11/97 10:47p Mike
* Add a slew of secondary weapons.
* Support exhaust blobs.
* Add weapons that spawn weapons.
* Add remotely detonatable weapons.
* Add heat-seeking missiles.
*
* 8 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 _FIREBALLS_H
#define _FIREBALLS_H
@@ -223,6 +16,7 @@
struct object;
struct ship_info;
class asteroid_info;
// values correspond to the fireball render types
#define FIREBALL_MEDIUM_EXPLOSION 0
@@ -230,29 +24,30 @@ struct ship_info;
#define FIREBALL_WARP_EFFECT 2
// these values correspond to the fireball.tbl default entries
#define FIREBALL_EXPLOSION_MEDIUM 0 // Used for the 4 little explosions before a ship explodes
#define FIREBALL_WARP 1 // Used for the warp in / warp out effect
#define FIREBALL_KNOSSOS 2 // Used for the KNOSSOS warp in / warp out effect
#define FIREBALL_ASTEROID 3
#define FIREBALL_EXPLOSION_LARGE1 4 // Used for the big explosion when a ship breaks into pieces
#define FIREBALL_EXPLOSION_LARGE2 5 // Used for the big explosion when a ship breaks into pieces
#define FIREBALL_EXPLOSION_MEDIUM 0 // Used for the 4 little explosions before a ship explodes
#define FIREBALL_WARP 1 // Used for the warp in / warp out effect
#define FIREBALL_KNOSSOS 2 // Used for the KNOSSOS warp in / warp out effect
#define FIREBALL_ASTEROID 3
#define FIREBALL_EXPLOSION_LARGE1 4 // Used for the big explosion when a ship breaks into pieces
#define FIREBALL_EXPLOSION_LARGE2 5 // Used for the big explosion when a ship breaks into pieces
#define MAX_FIREBALL_TYPES 32 // The maximum number of fireballs that can be defined
#define NUM_DEFAULT_FIREBALLS 6
#define MAX_FIREBALL_TYPES 32 // The maximum number of fireballs that can be defined
#define NUM_DEFAULT_FIREBALLS 6
#define FIREBALL_NUM_LARGE_EXPLOSIONS 2
extern int fireball_used[MAX_FIREBALL_TYPES];
extern int Num_fireball_types;
// all this moved here by Goober5000 because it makes more sense in the H file
typedef struct fireball_lod {
char filename[MAX_FILENAME_LEN];
int bitmap_id;
int num_frames;
int fps;
int bitmap_id;
int num_frames;
int fps;
} fireball_lod;
typedef struct fireball_info {
typedef struct fireball_info {
int lod_count;
float exp_color[3];
fireball_lod lod[4];
@@ -265,35 +60,32 @@ typedef struct fireball_info {
#define FBF_WARP_3D (1<<3) // Goober5000
#define FBF_WARP_VIA_SEXP (1<<4) // Goober5000
typedef struct fireball {
typedef struct fireball {
int objnum; // If -1 this object is unused
int fireball_info_index; // Index into Fireball_info array
int fireball_render_type;
int current_bitmap;
int orient; // For fireballs, which orientation. For warps, 0 is warpin, 1 is warpout
int flags; // see #define FBF_*
char lod; // current LOD
float time_elapsed; // in seconds
float total_time; // total lifetime of animation in seconds
int warp_open_sound_index; // for warp-effect - Goober5000
int warp_close_sound_index; // for warp-effect - Goober5000
char lod; // current LOD
float time_elapsed; // in seconds
float total_time; // total lifetime of animation in seconds
int warp_open_sound_index; // for warp-effect - Goober5000
int warp_close_sound_index; // for warp-effect - Goober5000
} fireball;
// end move
void fireball_init();
void fireball_render(object * obj);
void fireball_delete( object * obj );
void fireball_process_pre(object * obj, float frame_time);
void fireball_process_post(object * obj, float frame_time);
// reversed is for warp_in/out effects
// Velocity: If not NULL, the fireball will move at a constant velocity.
// warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long. Only works for warp effect
int fireball_create(vec3d *pos, int fireball_type, int render_type, int parent_obj, float size, int reversed=0, vec3d *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
int fireball_create(vec3d *pos, int fireball_type, int render_type, int parent_obj, float size, int reversed=0, vec3d *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=-1, int warp_close_sound=-1);
void fireball_render_plane(int plane);
void fireball_close();
void fireball_level_close();
void fireball_preload(); // page in warpout effect data
// Returns 1 if you can remove this fireball
int fireball_is_perishable(object * obj);
@@ -313,6 +105,12 @@ void fireball_get_color(int idx, float *red, float *green, float *blue);
// returns the index of the fireball bitmap for this ship. -1 if there is none.
int fireball_ship_explosion_type(ship_info *sip);
// returns the index of the fireball bitmap for this asteroid. -1 if there is none.
int fireball_asteroid_explosion_type(asteroid_info *aip);
// returns the intensity of a wormhole
float fireball_wormhole_intensity( object *obj );
// internal function to draw warp grid.
extern void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int warp_3d = 0 );
+29 -274
View File
@@ -7,264 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
* $Revision: 2.32.2.5 $
* $Date: 2007-11-22 05:02:28 $
* $Author: taylor $
*
* Code for rendering the warp in effects for ships
*
* $Log: not supported by cvs2svn $
* Revision 2.32.2.4 2006/11/16 01:07:23 taylor
* 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)
*
* Revision 2.32.2.3 2006/10/27 21:37:11 taylor
* 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
*
* Revision 2.32.2.2 2006/10/27 06:42:29 taylor
* 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
*
* Revision 2.32.2.1 2006/07/21 16:08:03 taylor
* little cleanup
*
* Revision 2.32 2006/03/31 10:20:01 wmcoolmon
* Prelim. BSG warpin effect stuff
*
* Revision 2.31 2005/09/21 03:55:32 Goober5000
* add option for warp flash; mess with the cmdlines a bit
* --Goober5000
*
* Revision 2.30 2005/08/25 22:40:02 taylor
* basic cleaning, removing old/useless code, sanity stuff, etc:
* - very minor performance boost from not doing stupid things :)
* - minor change to 3d shockwave sizing to better approximate 2d effect movements
* - for shields, Gobal_tris was only holding half as many as the game can/will use, buffer is now set to full size to avoid possible rendering issues
* - removed extra tcache_set on OGL spec map code, not sure how that slipped in
*
* Revision 2.29 2005/07/25 05:24:17 Goober5000
* cleaned up some command line and mission flag stuff
* --Goober5000
*
* Revision 2.28 2005/07/23 17:27:50 Goober5000
* remove Bobboau's extra warp thing
* --Goober5000
*
* Revision 2.27 2005/05/22 22:47:19 phreak
* compile warning fixage.
*
* Revision 2.26 2005/04/05 05:53:15 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.25 2005/03/25 06:57:33 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 2.24 2005/03/19 18:02:33 bobboau
* added new graphic functions for state blocks
* also added a class formanageing a new effect
*
* Revision 2.23 2005/01/01 19:47:26 taylor
* make use of MR_NO_FOGGING to render models without fog
*
* Revision 2.22 2004/11/23 19:29:13 taylor
* fix 2d warp in D3D, add cmdline option for 3d warp
*
* Revision 2.21 2004/09/17 07:12:22 Goober5000
* changed around the logic for the 3D warp effect
* --Goober5000
*
* Revision 2.20 2004/08/23 04:32:39 Goober5000
* warp effect is back to FS2 default
* --Goober5000
*
* Revision 2.19 2004/07/26 20:47:28 Kazan
* remove MCD complete
*
* Revision 2.18 2004/07/17 09:29:13 taylor
* make old warpmap and new glow bitmap 3D unlit to render right in OGL
*
* Revision 2.17 2004/07/12 16:32:46 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.16 2004/07/05 05:09:18 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.15 2004/05/12 22:49:13 phreak
* renamed the warp model variable from 'wm' to 'Warp_model'
*
* Revision 2.14 2004/05/08 01:08:48 Goober5000
* small fix
* --Goober5000
*
* Revision 2.13 2004/03/17 04:07:29 bobboau
* new fighter beam code
* fixed old after burner trails
* had to bump a few limits, working on some dynamic solutions
* a few fixed to background POF rendering
* fixing asorted bugs
*
* Revision 2.12 2004/03/05 09:02:00 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.11 2003/11/16 04:09:19 Goober5000
* language
*
* Revision 2.10 2003/11/11 03:56:10 bobboau
* lots of bug fixing, much of it in nebula and bitmap drawing
*
* Revision 2.9 2003/09/26 14:37:13 bobboau
* commiting Hardware T&L code, everything is ifdefed out with the compile flag HTL
* still needs a lot of work, ubt the frame rates were getting with it are incredable
* the biggest problem it still has is a bad lightmanegment system, and the zbuffer
* doesn't work well with things still getting rendered useing the sofware pipeline, like thrusters,
* and weapons, I think these should be modifyed to be sent through hardware,
* it would be slightly faster and it would likely fix the problem
*
* also the thruster glow/particle stuff I did is now in.
*
* Revision 2.8 2003/08/31 06:00:41 bobboau
* an asortment of bugfixes, mostly with the specular code,
* HUD flickering should be completly gone now
*
* Revision 2.7 2003/03/19 23:06:40 Goober5000
* bit o' housecleaning
* --Goober5000
*
* Revision 2.6 2003/03/19 22:49:32 Goober5000
* added some mission flags
* --Goober5000
*
* Revision 2.5 2003/03/19 06:23:27 Goober5000
* added warp-effect sexp
* --Goober5000
*
* Revision 2.4 2003/03/18 01:44:30 Goober5000
* fixed some misspellings
* --Goober5000
*
* Revision 2.3 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.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 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:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 7/22/99 1:22p Dave
* Enable proper zbuffering for warpin glow effect.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 23 4/08/98 8:20p John
* Made "Apex" of warp effect not move.
*
* 22 3/30/98 4:02p John
* Made machines with < 32 MB of RAM use every other frame of certain
* bitmaps. Put in code to keep track of how much RAM we've malloc'd.
*
* 21 3/29/98 12:39p John
* Made warp in glow page in
*
* 20 3/26/98 5:21p John
* Added new code to preload all bitmaps at the start of a level.
* Commented it out, though.
*
* 19 3/18/98 12:36p John
* Made hardware have nicer looking warp effect
*
* 18 3/16/98 4:51p John
* Added low-level code to clip all polygons against an arbritary plane.
* Took out all old model_interp_zclip and used this new method instead.
*
* 17 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.
*
* 16 3/04/98 7:07p John
* Added debug code to try to normalize a zerolength vector.
*
* 15 2/26/98 3:28p John
* fixed optimize compiler warning
*
* 14 2/24/98 6:36p John
* Made warp effect draw as a 4 poly cone.
*
* 13 2/22/98 12:19p John
* Externalized some strings
*
* 12 1/15/98 9:07p John
* Added noise to warp effect glow.
*
* 11 1/15/98 4:58p John
* Made warp effect use a looping ani. Made the scaling up & down be in
* software.
*
* 10 12/30/97 6:44p John
* Made g3_Draw_bitmap functions account for aspect of bitmap.
*
* 9 12/08/97 11:15a John
* added parameter to warpout for life.
*
* 8 12/05/97 3:46p John
* made ship thruster glow scale instead of being an animation.
*
* 7 12/02/97 3:59p John
* Added first rev of thruster glow, along with variable levels of
* translucency, which retquired some restructing of palman.
*
* 6 10/24/97 12:18p John
* sped up warp effect by decreasing number of polys with distance.
*
* 5 9/15/97 5:45p John
* took out chunk stuff.
* made pofview display thrusters as blue polies.
*
* 4 9/12/97 4:02p John
* put in ship warp out effect.
* put in dynamic lighting for warp in/out
*
* 3 9/09/97 4:49p John
* Almost done ship warp in code
*
* 2 9/08/97 8:39a John
* added in code structure for grid
*
* 1 9/05/97 10:07a John
*
* $NoKeywords: $
*/
#include "math/vecmat.h"
@@ -289,8 +32,8 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
vec3d norm;
vertex *vertlist[3];
vm_vec_perp(&norm,(vec3d *)&v1->x, (vec3d *)&v2->x, (vec3d *)&v3->x);
if ( vm_vec_dot(&norm, (vec3d *)&v1->x ) >= 0.0 ) {
vm_vec_perp(&norm,&v1->world, &v2->world, &v3->world);
if ( vm_vec_dot(&norm, &v1->world ) >= 0.0 ) {
vertlist[0] = v3;
vertlist[1] = v2;
vertlist[2] = v1;
@@ -318,7 +61,7 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
if (Warp_glow_bitmap >= 0) {
float r = radius;
bool render_it = (Cmdline_warp_flash == 1);
bool render_it = true;
#define OUT_PERCENT1 0.80f
#define OUT_PERCENT2 0.90f
@@ -326,12 +69,15 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
#define IN_PERCENT1 0.10f
#define IN_PERCENT2 0.20f
if ( (life_percent >= IN_PERCENT1) && (life_percent < IN_PERCENT2) ) {
r *= (life_percent - IN_PERCENT1) / (IN_PERCENT2 - IN_PERCENT1);
render_it = true;
} else if ( (life_percent >= OUT_PERCENT1) && (life_percent < OUT_PERCENT2) ) {
r *= (OUT_PERCENT2 - life_percent) / (OUT_PERCENT2 - OUT_PERCENT1);
render_it = true;
if (Cmdline_warp_flash)
{
if ( (life_percent >= IN_PERCENT1) && (life_percent < IN_PERCENT2) ) {
r *= (life_percent - IN_PERCENT1) / (IN_PERCENT2 - IN_PERCENT1);
//render_it = true;
} else if ( (life_percent >= OUT_PERCENT1) && (life_percent < OUT_PERCENT2) ) {
r *= (OUT_PERCENT2 - life_percent) / (OUT_PERCENT2 - OUT_PERCENT1);
//render_it = true;
}
}
if (render_it) {
@@ -346,7 +92,7 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
}
vecs[4] = center;
verts[4].u = 0.5f; verts[4].v = 0.5f;
verts[4].texture_position.u = 0.5f; verts[4].texture_position.v = 0.5f;
if (Cmdline_nohtl) {
g3_rotate_vertex( &verts[4], &vecs[4] );
@@ -395,11 +141,20 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
vecs[4] = center;
verts[0].u = 0.01f; verts[0].v = 0.01f;
verts[1].u = 0.99f; verts[1].v = 0.01f;
verts[2].u = 0.99f; verts[2].v = 0.99f;
verts[3].u = 0.01f; verts[3].v = 0.99f;
verts[4].u = 0.5f; verts[4].v = 0.5f;
verts[0].texture_position.u = 0.01f;
verts[0].texture_position.v = 0.01f;
verts[1].texture_position.u = 0.99f;
verts[1].texture_position.v = 0.01f;
verts[2].texture_position.u = 0.99f;
verts[2].texture_position.v = 0.99f;
verts[3].texture_position.u = 0.01f;
verts[3].texture_position.v = 0.99f;
verts[4].texture_position.u = 0.5f;
verts[4].texture_position.v = 0.5f;
if (Cmdline_nohtl) {
g3_rotate_vertex( &verts[0], &vecs[0] );
@@ -423,7 +178,7 @@ void warpin_render(object *obj, matrix *orient, vec3d *pos, int texture_bitmap_n
gr_set_cull(cull);
}
if (Warp_ball_bitmap > -1) {
if (Warp_ball_bitmap > -1 && Cmdline_warp_flash == 1) {
flash_ball warp_ball(20, .1f,.25f, &vmd_z_vector, &vmd_zero_vector, 4.0f, 0.5f);
float adg = (2.0f * life_percent) - 1.0f;
float pct = (powf(adg, 4.0f) - powf(adg, 128.0f)) * 4.0f;
+406
View File
@@ -0,0 +1,406 @@
/*
* Created by Hassan "Karajorma" Kazmi for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
// AltShipClassDlg.cpp : implementation file
//
#include "stdafx.h"
#include "fred.h"
#include "AltShipClassDlg.h"
#include "globalincs/linklist.h"
#include "ship/ship.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// AltShipClassDlg dialog
AltShipClassDlg::AltShipClassDlg(CWnd* pParent /*=NULL*/)
: CDialog(AltShipClassDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(AltShipClassDlg)
m_selected_variable = -1;
m_selected_class = -1;
//}}AFX_DATA_INIT
multi_edit = false;
player_ships_only = true;
num_string_variables = 0;
memset(string_variable_indices, -1, sizeof (int)*MAX_SEXP_VARIABLES);
memset(ship_class_indices, -1, sizeof (int)*MAX_SHIP_CLASSES);
}
void AltShipClassDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(AltShipClassDlg)
DDX_Control(pDX, IDC_DEFAULT_TO_CLASS, m_default_to_class);
DDX_Control(pDX, IDC_ALT_CLASS_LIST, m_alt_class_list);
DDX_Control(pDX, IDC_SET_FROM_SHIP_CLASS, m_set_from_ship_class);
DDX_Control(pDX, IDC_SET_FROM_VARIABLES, m_set_from_variables);
DDX_CBIndex(pDX, IDC_SET_FROM_VARIABLES, m_selected_variable);
DDX_CBIndex(pDX, IDC_SET_FROM_SHIP_CLASS, m_selected_class);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(AltShipClassDlg, CDialog)
//{{AFX_MSG_MAP(AltShipClassDlg)
ON_BN_CLICKED(IDC_ALT_CLASS_ADD, OnAltClassAdd)
ON_BN_CLICKED(IDC_ALT_CLASS_INSERT, OnAltClassInsert)
ON_BN_CLICKED(IDC_ALT_CLASS_DELETE, OnAltClassDelete)
ON_BN_CLICKED(IDC_ALT_CLASS_UP, OnMoveUp)
ON_BN_CLICKED(IDC_ALT_CLASS_DOWN, OnMoveDown)
ON_CBN_SELENDOK(IDC_SET_FROM_SHIP_CLASS, OnSelendokSetFromShipClass)
ON_CBN_SELENDOK(IDC_SET_FROM_VARIABLES, OnSelendokSetFromVariables)
ON_LBN_SELCHANGE(IDC_ALT_CLASS_LIST, OnSelchangeAltClassList)
ON_BN_CLICKED(IDC_DEFAULT_TO_CLASS, OnDefaultToClass)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// AltShipClassDlg message handlers
BOOL AltShipClassDlg::OnInitDialog()
{
int i, count;
char buff[TOKEN_LENGTH + TOKEN_LENGTH + 2]; // VariableName[VariableValue]
CDialog::OnInitDialog();
// have we got multiple selected ships?
num_selected_ships = 0;
object *objp;
objp = GET_FIRST(&obj_used_list);
while (objp != END_OF_LIST(&obj_used_list)) {
if ((objp->type == OBJ_START) || (objp->type == OBJ_SHIP)) {
if (objp->flags & OF_MARKED) {
m_selected_ships[num_selected_ships++] = objp->instance;
}
}
objp = GET_NEXT(objp);
}
Assert (num_selected_ships > 0);
Assert (Objects[cur_object_index].flags & OF_MARKED);
if (num_selected_ships > 1)
{
multi_edit = true;
}
// Fill the variable combo box
m_set_from_variables.ResetContent();
m_set_from_variables.AddString("Set From Ship Class");
for (i=0; i < MAX_SEXP_VARIABLES; i++)
{
if (Sexp_variables[i].type & SEXP_VARIABLE_STRING)
{
sprintf(buff, "%s[%s]", Sexp_variables[i].variable_name, Sexp_variables[i].text);
m_set_from_variables.AddString(buff);
string_variable_indices[num_string_variables++] = i;
}
}
m_set_from_variables.SetCurSel(0);
if (!num_string_variables) {
m_set_from_variables.EnableWindow(FALSE);
}
// Fill the ship classes combo box
m_set_from_ship_class.ResetContent();
// Add the default entry if we need one followed by all the ship classes
if (num_string_variables) {
m_set_from_ship_class.AddString("Set From Variable");
}
count = 0;
for (i=0; i<Num_ship_classes; i++)
{
if (player_ships_only && !(Ship_info[i].flags & SIF_PLAYER_SHIP)) {
continue;
}
ship_class_indices[count++] = i;
m_set_from_ship_class.AddString(Ship_info[i].name);
}
m_set_from_ship_class.SetCurSel(num_string_variables?1:0); // Set to the first ship class
// Set up the actual list of alt classes
alt_class_pool.clear();
alt_class_pool = Ships[Objects[cur_object_index].instance].s_alt_classes;
alt_class_list_rebuild();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void AltShipClassDlg::alt_class_list_rebuild()
{
int i, j;
char buff[TOKEN_LENGTH + TOKEN_LENGTH + 2]; // VariableName[VariableValue]
j = m_alt_class_list.GetCount();
for ( i=0; i < j ; i++) {
m_alt_class_list.DeleteString(0);
}
for (i = 0; i < (int)alt_class_pool.size() ; i++) {
// Default classes should be at the end of the list
if(alt_class_pool[i].default_to_this_class && (i < (int)alt_class_pool.size() - 1) ) {
// Int3();
// TO DO : we should fix this.
}
if (alt_class_pool[i].variable_index != -1) {
Assert (alt_class_pool[i].variable_index > -1 && alt_class_pool[i].variable_index < MAX_SEXP_VARIABLES);
Assert (Sexp_variables[alt_class_pool[i].variable_index].type & SEXP_VARIABLE_STRING);
sprintf(buff, "%s[%s]", Sexp_variables[alt_class_pool[i].variable_index].variable_name, Sexp_variables[alt_class_pool[i].variable_index].text);
// add it to the list
m_alt_class_list.AddString(buff);
}
else {
if (alt_class_pool[i].ship_class >= 0 && alt_class_pool[i].ship_class < MAX_SHIP_CLASSES) {
m_alt_class_list.AddString(Ship_info[alt_class_pool[i].ship_class].name);
}
else {
m_alt_class_list.AddString("Invalid Ship Class");
Int3();
}
}
}
}
void AltShipClassDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void AltShipClassDlg::OnOK()
{
// TODO: Add extra validation here
for (int i=0; i < num_selected_ships; i++) {
Ships[m_selected_ships[i]].s_alt_classes = alt_class_pool;
}
CDialog::OnOK();
}
void AltShipClassDlg::OnAltClassAdd()
{
alt_class new_list_item;
alt_class_update_entry(new_list_item);
alt_class_pool.push_back(new_list_item);
alt_class_list_rebuild();
}
void AltShipClassDlg::OnAltClassInsert()
{
int index;
alt_class new_list_item;
alt_class_update_entry(new_list_item);
index = m_alt_class_list.GetCurSel();
// If nothing is selected just add it
if ( index == -1) {
alt_class_pool.push_back(new_list_item);
}
// Stick it in front of the current selection
else {
alt_class_pool.insert(alt_class_pool.begin() + index, new_list_item );
}
alt_class_list_rebuild();
// If we inserted the user will probably want to edit the selection
if (index > -1) {
m_alt_class_list.SetCurSel(index);
}
}
// Updates the currently selected list entry
void AltShipClassDlg::alt_class_update_entry(alt_class &list_item)
{
int index;
// Add a string variable to the list
if (num_string_variables && m_set_from_variables.GetCurSel() > 0) {
index = string_variable_indices[m_set_from_variables.GetCurSel() -1];
Assert (index >= 0);
list_item.variable_index = index;
list_item.ship_class = ship_info_lookup(Sexp_variables[index].text);
}
// Add a ship class to the list
else {
index = m_set_from_ship_class.GetCurSel();
// Correct the index if the first entry isn't actually a ship class
if (num_string_variables) {
Assert (index > 0);
index--;
}
list_item.variable_index = -1;
list_item.ship_class = ship_class_indices[index];
}
// check the default tickbox
list_item.default_to_this_class = m_default_to_class.GetCheck() ? true:false;
}
void AltShipClassDlg::OnAltClassDelete()
{
int index = m_alt_class_list.GetCurSel();
// Nothing selected
if (index == -1) {
return;
}
Assert (index < (int) alt_class_pool.size());
alt_class_pool.erase(alt_class_pool.begin()+index);
alt_class_list_rebuild();
}
void AltShipClassDlg::OnMoveUp()
{
int index = m_alt_class_list.GetCurSel();
// Nothing selected or already at the top
if (index < 1) {
return;
}
std::swap(alt_class_pool[index], alt_class_pool[index-1]);
alt_class_list_rebuild();
m_alt_class_list.SetCurSel(index-1);
}
void AltShipClassDlg::OnMoveDown()
{
int index = m_alt_class_list.GetCurSel();
int inext = index + 1;
// Nothing selected or already at the bottom
if (index == -1 || (index >= m_alt_class_list.GetCount() - 1) ) {
return;
}
std::swap(alt_class_pool[index], alt_class_pool[inext]);
alt_class_list_rebuild();
m_alt_class_list.SetCurSel(index);
}
void AltShipClassDlg::OnSelendokSetFromShipClass()
{
int current_selection;
if (m_set_from_ship_class.GetCurSel() == 0 && num_string_variables) {
m_set_from_variables.SetCurSel(1);
}
else {
m_set_from_variables.SetCurSel(0);
}
// if a list entry is selected we should update it
current_selection = m_alt_class_list.GetCurSel();
if (current_selection >= 0) {
alt_class_update_entry(alt_class_pool[m_alt_class_list.GetCurSel()]);
alt_class_list_rebuild();
}
}
void AltShipClassDlg::OnSelendokSetFromVariables()
{
int current_selection;
if (m_set_from_variables.GetCurSel() == 0) {
m_set_from_ship_class.SetCurSel(num_string_variables ? 1 : 0);
}
else {
m_set_from_ship_class.SetCurSel(0);
}
// if a list entry is selected we should update it
current_selection = m_alt_class_list.GetCurSel();
if (current_selection >= 0) {
alt_class_update_entry(alt_class_pool[m_alt_class_list.GetCurSel()]);
alt_class_list_rebuild();
}
}
void AltShipClassDlg::OnSelchangeAltClassList()
{
int i;
int variable_selection = 0;
int ship_selection = 0;
int index = m_alt_class_list.GetCurSel();
// Selected nothing
if (index == -1) {
return;
}
// If we have a variable selected
if (alt_class_pool[index].variable_index != -1) {
for (i=0; i < MAX_SEXP_VARIABLES; i++)
{
if (string_variable_indices[i] == alt_class_pool[index].variable_index) {
variable_selection = i+1;
break;
}
}
}
// Ship selected
else {
for (i=0; i < MAX_SHIP_CLASSES; i++) {
if (ship_class_indices[i] == alt_class_pool[index].ship_class) {
ship_selection = i;
break;
}
}
// if we have string variables in the mission the first entry on the list won't be a ship
if (num_string_variables) {
ship_selection++;
}
}
m_set_from_variables.SetCurSel(variable_selection);
m_set_from_ship_class.SetCurSel(ship_selection);
m_default_to_class.SetCheck(alt_class_pool[index].default_to_this_class ? 1:0);
}
void AltShipClassDlg::OnDefaultToClass()
{
int index = m_alt_class_list.GetCurSel();
// Nothing selected
if (index == -1) {
return;
}
alt_class_pool[index].default_to_this_class = m_default_to_class.GetCheck() ? true:false;
}
+86
View File
@@ -0,0 +1,86 @@
/*
* Created by Hassan "Karajorma" Kazmi for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
#if !defined(AFX_AltShipClassDlg_H__2FE2C917_C7DA_4C05_A11F_DCC46BFB26BB__INCLUDED_)
#define AFX_AltShipClassDlg_H__2FE2C917_C7DA_4C05_A11F_DCC46BFB26BB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// AltShipClassDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// AltShipClassDlg dialog
class AltShipClassDlg : public CDialog
{
// Construction
public:
AltShipClassDlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(AltShipClassDlg)
enum { IDD = IDD_ALT_SHIP_CLASS };
CButton m_default_to_class;
CListBox m_alt_class_list;
CComboBox m_set_from_ship_class;
CComboBox m_set_from_variables;
int m_selected_variable;
int m_selected_class;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(AltShipClassDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(AltShipClassDlg)
virtual BOOL OnInitDialog();
virtual void OnCancel();
virtual void OnOK();
afx_msg void OnAltClassAdd();
afx_msg void OnAltClassInsert();
afx_msg void OnAltClassDelete();
afx_msg void OnMoveUp();
afx_msg void OnMoveDown();
afx_msg void OnSelendokSetFromShipClass();
afx_msg void OnSelendokSetFromVariables();
afx_msg void OnSelchangeAltClassList();
afx_msg void OnDefaultToClass();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
bool player_ships_only; // Whether we only add player ships to the alt classes or if we can add any ship
SCP_vector<alt_class> alt_class_pool;
int num_string_variables; // Number of string variables in the mission
int string_variable_indices[MAX_SEXP_VARIABLES]; // maps string variables to their index in Sexp_variables
int ship_class_indices[MAX_SHIP_CLASSES]; // maps ships in the ships combobox to their index in Ship_info
// variables to handle selection of multiple ships
bool multi_edit;
int m_selected_ships[MAX_SHIPS];
int num_selected_ships;
void AltShipClassDlg::alt_class_list_rebuild();
void AltShipClassDlg::alt_class_update_entry(alt_class &list_item);
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_AltShipClassDlg_H__2FE2C917_C7DA_4C05_A11F_DCC46BFB26BB__INCLUDED_)
+115
View File
@@ -0,0 +1,115 @@
// FictionViewerDlg.cpp : implementation file
//
#include "stdafx.h"
#include "fred.h"
#include "FictionViewerDlg.h"
#include "missionui/fictionviewer.h"
#include "gamesnd/eventmusic.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// FictionViewerDlg dialog
FictionViewerDlg::FictionViewerDlg(CWnd* pParent /*=NULL*/)
: CDialog(FictionViewerDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(FictionViewerDlg)
m_story_file = _T("");
m_font_file = _T("");
m_fiction_music = 0;
//}}AFX_DATA_INIT
}
void FictionViewerDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(FictionViewerDlg)
DDX_Text(pDX, IDC_STORY_FILE, m_story_file);
DDX_Text(pDX, IDC_FONT_FILE, m_font_file);
DDX_CBIndex(pDX, IDC_FICTION_MUSIC, m_fiction_music);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(FictionViewerDlg, CDialog)
//{{AFX_MSG_MAP(FictionViewerDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// FictionViewerDlg message handlers
BOOL FictionViewerDlg::OnInitDialog()
{
int i;
CComboBox *box;
box = (CComboBox *) GetDlgItem(IDC_FICTION_MUSIC);
box->AddString("None");
for (i=0; i<Num_music_files; i++){
box->AddString(Spooled_music[i].name);
}
// init variables
m_story_file = _T(fiction_file());
m_font_file = _T(fiction_font());
m_fiction_music = Mission_music[SCORE_FICTION_VIEWER] + 1;
CDialog::OnInitDialog();
UpdateData(FALSE);
return TRUE;
}
void FictionViewerDlg::OnOK()
{
UpdateData(TRUE);
// load it up
fiction_viewer_reset();
fiction_viewer_load((char *)(LPCSTR) m_story_file, (char *)(LPCSTR) m_font_file);
// set music
Mission_music[SCORE_FICTION_VIEWER] = m_fiction_music - 1;
CDialog::OnOK();
}
void FictionViewerDlg::OnCancel()
{
// TODO: Add extra cleanup here
CDialog::OnCancel();
}
void FictionViewerDlg::OnClose()
{
int z;
UpdateData(TRUE);
if (query_modified()) {
z = MessageBox("Do you want to keep your changes?", "Close", MB_ICONQUESTION | MB_YESNOCANCEL);
if (z == IDCANCEL){
return;
}
if (z == IDYES) {
OnOK();
return;
}
}
CDialog::OnClose();
}
int FictionViewerDlg::query_modified()
{
return strcmp(m_story_file, fiction_file()) || strcmp(m_font_file, fiction_font()) || m_fiction_music != (Mission_music[SCORE_FICTION_VIEWER] + 1);
}
+52
View File
@@ -0,0 +1,52 @@
#if !defined(AFX_FICTIONVIEWERDLG_H__46BAD1B6_F9DC_4414_9C33_18EC17FD491F__INCLUDED_)
#define AFX_FICTIONVIEWERDLG_H__46BAD1B6_F9DC_4414_9C33_18EC17FD491F__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// FictionViewerDlg.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// FictionViewerDlg dialog
class FictionViewerDlg : public CDialog
{
// Construction
public:
FictionViewerDlg(CWnd* pParent = NULL); // standard constructor
int query_modified();
void OnOK();
void OnCancel();
// Dialog Data
//{{AFX_DATA(FictionViewerDlg)
enum { IDD = IDD_FICTION_VIEWER };
CString m_story_file;
CString m_font_file;
int m_fiction_music;
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(FictionViewerDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(FictionViewerDlg)
virtual BOOL OnInitDialog();
afx_msg void OnClose();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_FICTIONVIEWERDLG_H__46BAD1B6_F9DC_4414_9C33_18EC17FD491F__INCLUDED_)
+6 -7
View File
@@ -16,7 +16,6 @@
#include "parse/sexp.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -78,8 +77,8 @@ void CAddVariableDlg::OnOK()
// int sexp_add_variable(char *text, char*, int type);
// char temp_name[32];
// char temp_value[32];
// strcpy(temp_name, m_variable_name);
// strcpy(temp_value, m_default_value);
// strcpy_s(temp_name, m_variable_name);
// strcpy_s(temp_value, m_default_value);
// SEXP_VARIABLE_NUMBER SEXP_VARIABLE_STRING
// int type;
//
@@ -154,7 +153,7 @@ void CAddVariableDlg::validate_variable_name(int set_focus)
// Check if any change and not already in list
if ( stricmp(temp_name, "<Variable Name>") ) {
if ( (strlen(temp_name) > 0) && (get_index_sexp_variable_name(LPCTSTR(temp_name)) == -1) ) { //not already in list and length > 0 {
if ( (strlen(temp_name) > 0) && (get_index_sexp_variable_name(LPCTSTR(temp_name)) == -1) ) { //not already in list and length > 0 { //-V805
// Goober5000 - replace spaces with hyphens
if (strchr(temp_name, ' ') != NULL)
{
@@ -175,7 +174,7 @@ void CAddVariableDlg::validate_variable_name(int set_focus)
m_name_validated = true;
} else {
// conflicting variable name
if (strlen(temp_name) == 0) {
if (strlen(temp_name) == 0) { //-V805
edit->SetWindowText("<Variable Name>");
}
m_name_validated = false;
@@ -205,7 +204,7 @@ void CAddVariableDlg::validate_data(int set_focus)
edit->GetWindowText(temp_data);
// check for 0 string length
if (strlen(temp_data) == 0) {
if (strlen(temp_data) == 0) { //-V805
m_data_validated = false;
} else {
if (m_type_number) {
@@ -285,4 +284,4 @@ void CAddVariableDlg::set_variable_type()
((CButton *) GetDlgItem(IDC_TYPE_CAMPAIGN_PERSISTENT))->SetCheck(m_type_campaign_persistent);
((CButton *) GetDlgItem(IDC_TYPE_PLAYER_PERSISTENT))->SetCheck(m_type_player_persistent);
((CButton *) GetDlgItem(IDC_TYPE_NETWORK_VARIABLE))->SetCheck(m_type_network_variable);
}
}
+4 -45
View File
@@ -7,47 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/AdjustGridDlg.cpp $
* $Revision: 1.2 $
* $Date: 2006-01-21 02:22:04 $
* $Author: wmcoolmon $
*
* Editor to allow one to change Fred's grid orientation and position.
*
* $Log: not supported by cvs2svn $
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.3 2002/08/15 04:35:44 penguin
* Changes to build with fs2_open code.lib
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 2:59p Dave
*
* 3 8/18/97 10:01p Hoffoss
* Improved dialog by graying out fields that don't have any effect on
* current plane setting.
*
* 2 8/18/97 9:31p Hoffoss
* Added grid adjustment dialog and shield system editor dialog.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
@@ -55,7 +15,6 @@
#include "mission/missiongrid.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -119,9 +78,9 @@ BOOL adjust_grid_dlg::OnInitDialog()
GetDlgItem(IDC_EDIT_Z)->EnableWindow(FALSE);
}
m_spinx.SetRange((short)99999, (short)-99999);
m_spiny.SetRange((short)99999, (short)-99999);
m_spinz.SetRange((short)99999, (short)-99999);
m_spinx.SetRange(SHRT_MIN, SHRT_MAX);
m_spiny.SetRange(SHRT_MIN, SHRT_MAX);
m_spinz.SetRange(SHRT_MIN, SHRT_MAX);
return TRUE;
}
+1 -38
View File
@@ -7,44 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/AdjustGridDlg.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Editor to allow one to change Fred's grid orientation and position.
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 2:59p Dave
*
* 3 8/18/97 10:01p Hoffoss
* Improved dialog by graying out fields that don't have any effect on
* current plane setting.
*
* 2 8/18/97 9:31p Hoffoss
* Added grid adjustment dialog and shield system editor dialog.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// adjust_grid_dlg dialog
-1
View File
@@ -19,7 +19,6 @@
#include "species_defs/species_defs.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
+1 -2
View File
@@ -7,7 +7,6 @@
#include "ship/ship.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -85,4 +84,4 @@ void BackgroundChooser::OnClose()
int BackgroundChooser::GetChosenBackground()
{
return m_chosenBackground;
}
}
+147 -217
View File
@@ -7,201 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/BgBitmapDlg.cpp $
* $Revision: 1.5.2.7 $
* $Date: 2007-09-02 02:07:39 $
* $Author: Goober5000 $
*
* Background space images manager dialog
*
* $Log: not supported by cvs2svn $
* Revision 1.5.2.6 2007/05/28 18:27:32 wmcoolmon
* Added armor support for asteroid, debris, ship, and beam damage
*
* Revision 1.5.2.5 2006/11/24 22:40:15 Goober5000
* FRED again updates backgrounds while the user is editing them
*
* Revision 1.5.2.4 2006/11/15 00:30:10 taylor
* 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)
*
* Revision 1.5.2.3 2006/10/24 13:44:54 taylor
* 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)
*
* Revision 1.5.2.2 2006/08/06 18:47:12 Goober5000
* add the multiple background feature
* --Goober5000
*
* Revision 1.5.2.1 2006/07/20 21:15:11 karajorma
* Fix for Mantis 996
*
* Revision 1.5 2006/04/20 06:32:01 Goober5000
* proper capitalization according to Volition
*
* Revision 1.4 2006/02/25 21:46:59 Goober5000
* spelling
*
* Revision 1.3 2006/02/20 07:30:14 taylor
* 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
*
* Revision 1.2 2006/01/30 06:27:59 taylor
* dynamic starfield bitmaps
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.11 2005/12/22 01:44:43 phreak
* Extra error code for background importing
*
* Revision 1.10 2005/12/21 00:28:43 phreak
* Import background button for mission bitmaps.
*
* Revision 1.9 2005/07/25 06:51:33 Goober5000
* mission flag changes for FRED
* --Goober5000
*
* Revision 1.8 2005/04/12 02:18:52 phreak
* Ambient lighting sliders now work in the background editor.
*
* Revision 1.7 2005/03/29 03:13:06 phreak
* Made some changes to the background bitmap dialog to show the user updates
* whenever any information on the position or size changes, or another bitmap is
* used instead of whats currently selected. The spinners for the bitmaps also wrap
* from 359 - > 0 and from 0 -> 359. These enhancements should make creating
* backgrounds much quicker and easier.
*
* Also fixed a bug where if a user entered "39" in either the pitch, bank, or heading
* boxes, then the "39" would be set to "38" due to truncation from converting between
* radians and degrees.
*
* Revision 1.6 2005/03/20 20:23:47 phreak
* Get the Background Bitmap Dialog to generate the vertex buffers the background bitmaps need to draw
* This will get the backgrounds drawing again.
*
* Revision 1.5 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.4 2003/10/23 23:52:26 phreak
* changed the background bitmap dialog so the user can specify custom skyboxes
*
* Revision 1.3 2003/01/13 02:07:26 wmcoolmon
* Removed the override checkbox + flag for ship trails and added a checkbox + flag to disable ship trails within the nebula, NO_NEB_TRAILS, to the Background dialog.
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 11 7/02/99 4:30p Dave
* Much more sophisticated lightning support.
*
* 10 6/08/99 5:42p Dave
* Fixed background bitmap division stuff.
*
* 9 6/03/99 6:42p Dave
*
* 8 6/03/99 6:37p Dave
* More TNT fun. Made perspective bitmaps more flexible.
*
* 7 5/09/99 6:00p Dave
* Lots of cool new effects. E3 build tweaks.
*
* 6 4/26/99 8:47p Dave
* Made all pof related nebula stuff customizable through Fred.
*
* 5 4/07/99 6:21p Dave
* Fred and FreeSpace support for multiple background bitmaps and suns.
* Fixed link errors on all subprojects. Moved encrypt_init() to
* cfile_init() and lcl_init(), since its safe to call twice.
*
* 4 1/25/99 5:03a Dave
* First run of stealth, AWACS and TAG missile support. New mission type
* :)
*
* 3 11/14/98 5:37p Dave
* Put in support for full nebulas.
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 18 4/13/98 10:25p Hoffoss
* Added a flag for subspace missions, and for aboard the Galatea or
* Bastion.
*
* 17 1/14/98 8:56a John
* Removed old nebula palette code that didn't matter what HUD colors were
* loaded.
*
* 16 12/08/97 4:48p Hoffoss
* Moved starfield editor controls to background editor.
*
* 15 11/25/97 4:48p Johnson
* Fixed bug with nebula selection.
*
* 14 11/25/97 11:40a Hoffoss
* Added support for nebula placement editing.
*
* 13 11/23/97 6:06p Hoffoss
* Renamed background bitmap editor to just background editor.
*
* 12 11/21/97 2:55p Hoffoss
* Added Nebula support to Fred. Implemented loading and saving nebula
* info to/from mission files.
*
* 11 6/11/97 3:26p Hoffoss
* Added better verification of bitmap filename to BG editor.
*
* 10 4/17/97 2:01p Hoffoss
* All dialog box window states are saved between sessions now.
*
* 9 3/31/97 6:07p Hoffoss
* Fixed several errors, including BG editor not graying fields, BG editor
* not updating image when changed, Removed obsolete data from Weapon
* editor, priority not being saved when missions saved, priority not
* editable in initial orders editor.
*
* 8 3/27/97 2:24p Hoffoss
* Fixed bug in image not updating when new image selected from listbox of
* combo box.
*
* 7 3/21/97 4:24p Hoffoss
* Fixed bug in changing image to an external image file.
*
* 6 3/17/97 1:54p Hoffoss
* fixed bugs in BG editor, and added delete button functionality.
*
* 5 3/12/97 4:33p Hoffoss
* added spin controls to orient editor, light intensity level can be
* specified in BG editor.
*
* 4 2/21/97 5:34p Hoffoss
* Added extensive modification detection and fixed a bug in initial
* orders editor.
*
* 3 2/04/97 3:09p Hoffoss
* Background bitmap editor implemented fully.
*
* 2 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#include "stdafx.h"
@@ -220,7 +26,6 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -232,7 +37,6 @@ bg_bitmap_dlg::bg_bitmap_dlg(CWnd* pParent) : CDialog(bg_bitmap_dlg::IDD, pParen
{
//{{AFX_DATA_INIT(bg_bitmap_dlg)
m_neb_intensity = _T("");
m_skybox_model = _T("");
m_envmap = _T("");
m_nebula_color = -1;
m_nebula_index = -1;
@@ -260,6 +64,17 @@ bg_bitmap_dlg::bg_bitmap_dlg(CWnd* pParent) : CDialog(bg_bitmap_dlg::IDD, pParen
b_scale_x = 1.0f; b_scale_y = 1.0f;
b_div_x = 1; b_div_y = 1;
b_index = -1;
m_skybox_model = _T("");
m_skybox_pitch = 0;
m_skybox_bank = 0;
m_skybox_heading = 0;
m_sky_flag_1 = The_mission.skybox_flags & MR_NO_LIGHTING ? 1 : 0;
m_sky_flag_2 = The_mission.skybox_flags & MR_ALL_XPARENT ? 1 : 0;
m_sky_flag_3 = The_mission.skybox_flags & MR_NO_ZBUFFER ? 1 : 0;
m_sky_flag_4 = The_mission.skybox_flags & MR_NO_CULL ? 1 : 0;
m_sky_flag_5 = The_mission.skybox_flags & MR_NO_GLOWMAPS ? 1 : 0;
m_sky_flag_6 = The_mission.skybox_flags & MR_FORCE_CLAMP ? 1 : 0;
//}}AFX_DATA_INIT
}
@@ -311,7 +126,21 @@ void bg_bitmap_dlg::DoDataExchange(CDataExchange* pDX)
DDX_Text(pDX, IDC_SBITMAP_DIV_Y, b_div_y);
DDV_MinMaxInt(pDX, b_div_y, 1, 5);
DDX_Text(pDX, IDC_SKYBOX_FNAME, m_skybox_model);
DDX_Text(pDX, IDC_SKYBOX_P, m_skybox_pitch);
DDV_MinMaxInt(pDX, m_skybox_pitch, 0, 359);
DDX_Text(pDX, IDC_SKYBOX_B, m_skybox_bank);
DDV_MinMaxInt(pDX, m_skybox_bank, 0, 359);
DDX_Text(pDX, IDC_SKYBOX_H, m_skybox_heading);
DDV_MinMaxInt(pDX, m_skybox_heading, 0, 359);
DDX_Text(pDX, IDC_ENVMAP, m_envmap);
DDX_Check(pDX, IDC_SKY_FLAG_NO_LIGHTING, m_sky_flag_1);
DDX_Check(pDX, IDC_SKY_FLAG_XPARENT, m_sky_flag_2);
DDX_Check(pDX, IDC_SKY_FLAG_NO_ZBUFF, m_sky_flag_3);
DDX_Check(pDX, IDC_SKY_FLAG_NO_CULL, m_sky_flag_4);
DDX_Check(pDX, IDC_SKY_FLAG_NO_GLOW, m_sky_flag_5);
DDX_Check(pDX, IDC_SKY_FLAG_CLAMP, m_sky_flag_6);
DDX_Text(pDX, IDC_NEB_FAR_MULTIPLIER, m_neb_far_multi);
DDX_Text(pDX, IDC_NEB_NEAR_MULTIPLIER, m_neb_near_multi);
//}}AFX_DATA_MAP
}
@@ -351,6 +180,12 @@ BEGIN_MESSAGE_MAP(bg_bitmap_dlg, CDialog)
ON_BN_CLICKED(IDC_SWAP_BACKGROUND, OnSwapBackground)
ON_CBN_SELCHANGE(IDC_BACKGROUND_NUM, OnBackgroundDropdownChange)
ON_BN_CLICKED(IDC_SKYBOX_MODEL, OnSkyboxBrowse)
ON_NOTIFY(UDN_DELTAPOS, IDC_SKYBOX_P_SPIN, OnDeltaposSkyboxPSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_SKYBOX_B_SPIN, OnDeltaposSkyboxBSpin)
ON_NOTIFY(UDN_DELTAPOS, IDC_SKYBOX_H_SPIN, OnDeltaposSkyboxHSpin)
ON_EN_KILLFOCUS(IDC_SKYBOX_P, OnKillfocusSkyboxP)
ON_EN_KILLFOCUS(IDC_SKYBOX_B, OnKillfocusSkyboxB)
ON_EN_KILLFOCUS(IDC_SKYBOX_H, OnKillfocusSkyboxH)
ON_BN_CLICKED(IDC_ENVMAP_BROWSE, OnEnvmapBrowse)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
@@ -392,13 +227,19 @@ void bg_bitmap_dlg::create()
m_skybox_model = _T(The_mission.skybox_model);
m_envmap = _T(The_mission.envmap_name);
angles skybox_angles;
vm_extract_angles_matrix(&skybox_angles, &The_mission.skybox_orientation);
m_skybox_pitch = (int) fl_degrees(skybox_angles.p);
m_skybox_bank = (int) fl_degrees(skybox_angles.b);
m_skybox_heading = (int) fl_degrees(skybox_angles.h);
for(i=0; i<MAX_NEB2_BITMAPS; i++){
if(strlen(Neb2_bitmap_filenames[i]) > 0){
if(strlen(Neb2_bitmap_filenames[i]) > 0){ //-V805
((CComboBox*)GetDlgItem(IDC_NEB2_TEXTURE))->AddString(Neb2_bitmap_filenames[i]);
}
}
// if we have a texture selected already
if(strlen(Neb2_texture_name) > 0){
if(strlen(Neb2_texture_name) > 0){ //-V805
m_neb2_texture = ((CComboBox*)GetDlgItem(IDC_NEB2_TEXTURE))->SelectString(-1, Neb2_texture_name);
if(m_neb2_texture == CB_ERR){
((CComboBox*)GetDlgItem(IDC_NEB2_TEXTURE))->SetCurSel(0);
@@ -411,8 +252,8 @@ void bg_bitmap_dlg::create()
// setup lightning storm names
((CComboBox*)GetDlgItem(IDC_NEB2_LIGHTNING))->ResetContent();
((CComboBox*)GetDlgItem(IDC_NEB2_LIGHTNING))->AddString(CString("none"));
for(i=0; i<Num_storm_types; i++){
((CComboBox*)GetDlgItem(IDC_NEB2_LIGHTNING))->AddString(CString(Storm_types[i].name));
for(size_t j=0; j<Storm_types.size(); j++){
((CComboBox*)GetDlgItem(IDC_NEB2_LIGHTNING))->AddString(CString(Storm_types[j].name));
}
((CComboBox*)GetDlgItem(IDC_NEB2_LIGHTNING))->SelectString(-1, Mission_parse_storm_name);
@@ -420,7 +261,7 @@ void bg_bitmap_dlg::create()
if(Neb2_awacs < 0.0f){
m_neb_intensity = CString("3000");
} else {
char whee[255] = "";
char whee[25] = "";
m_neb_intensity = CString(itoa((int)Neb2_awacs, whee, 10));
}
@@ -481,7 +322,9 @@ void bg_bitmap_dlg::create()
GetDlgItem(IDC_AMBIENT_G_TEXT)->SetWindowText(buf);
sprintf(buf, "Blue: %d", m_amb_blue.GetPos());
GetDlgItem(IDC_AMBIENT_B_TEXT)->SetWindowText(buf);
m_neb_near_multi = Neb2_fog_near_mult;
m_neb_far_multi = Neb2_fog_far_mult;
UpdateData(FALSE);
OnFullNeb();
@@ -542,14 +385,15 @@ void bg_bitmap_dlg::OnClose()
}
// get the bitmap name
strcpy(Neb2_texture_name, Neb2_bitmap_filenames[m_neb2_texture]);
strcpy_s(Neb2_texture_name, Neb2_bitmap_filenames[m_neb2_texture]);
// init the nebula
neb2_level_init();
} else {
The_mission.flags &= ~MISSION_FLAG_FULLNEB; Nebula_index = m_nebula_index - 1;
The_mission.flags &= ~MISSION_FLAG_FULLNEB;
Nebula_index = m_nebula_index - 1;
Neb2_awacs = -1.0f;
strcpy(Neb2_texture_name, "");
strcpy_s(Neb2_texture_name, "");
}
// check for no ship trails -C
@@ -580,6 +424,36 @@ void bg_bitmap_dlg::OnClose()
string_copy(The_mission.skybox_model, m_skybox_model, NAME_LENGTH, 1);
string_copy(The_mission.envmap_name, m_envmap, NAME_LENGTH, 1);
angles skybox_angles;
skybox_angles.p = fl_radians(m_skybox_pitch);
skybox_angles.b = fl_radians(m_skybox_bank);
skybox_angles.h = fl_radians(m_skybox_heading);
vm_angles_2_matrix(&The_mission.skybox_orientation, &skybox_angles);
//store the skybox flags
The_mission.skybox_flags = 0;
if(m_sky_flag_1) {
The_mission.skybox_flags |= MR_NO_LIGHTING;
}
if(m_sky_flag_2) {
The_mission.skybox_flags |= MR_ALL_XPARENT;
}
if(m_sky_flag_3) {
The_mission.skybox_flags |= MR_NO_ZBUFFER;
}
if(m_sky_flag_4) {
The_mission.skybox_flags |= MR_NO_CULL;
}
if(m_sky_flag_5) {
The_mission.skybox_flags |= MR_NO_GLOWMAPS;
}
if(m_sky_flag_6) {
The_mission.skybox_flags |= MR_FORCE_CLAMP;
}
Neb2_fog_near_mult = m_neb_near_multi;
Neb2_fog_far_mult = m_neb_far_multi;
// close sun data
sun_data_close();
@@ -820,10 +694,10 @@ void bg_bitmap_dlg::sun_data_save_current()
UpdateData(TRUE);
// store the data
strcpy(sle->filename, s_name);
sle->ang.p = (float) fl_radian(s_pitch);
sle->ang.b = (float) fl_radian(s_bank);
sle->ang.h = (float) fl_radian(s_heading);
strcpy_s(sle->filename, s_name);
sle->ang.p = (float) fl_radians(s_pitch);
sle->ang.b = (float) fl_radians(s_bank);
sle->ang.h = (float) fl_radians(s_heading);
sle->scale_x = (float) s_scale;
sle->scale_y = 1.0f;
sle->div_x = 1;
@@ -873,7 +747,7 @@ void bg_bitmap_dlg::OnAddSun()
sun_data_save_current();
// select the first sun by default
strcpy(sle.filename, stars_get_name_FRED(0, true));
strcpy_s(sle.filename, stars_get_name_FRED(0, true));
sle.ang.p = 0;
sle.ang.b = 0;
@@ -984,10 +858,10 @@ void bg_bitmap_dlg::bitmap_data_save_current()
UpdateData(TRUE);
// store the data
strcpy(sle->filename, b_name);
sle->ang.p = (float) fl_radian(b_pitch);
sle->ang.b = (float) fl_radian(b_bank);
sle->ang.h = (float) fl_radian(b_heading);
strcpy_s(sle->filename, b_name);
sle->ang.p = (float) fl_radians(b_pitch);
sle->ang.b = (float) fl_radians(b_bank);
sle->ang.h = (float) fl_radians(b_heading);
sle->scale_x = (float) b_scale_x;
sle->scale_y = (float) b_scale_y;
sle->div_x = b_div_x;
@@ -1040,7 +914,7 @@ void bg_bitmap_dlg::OnAddBitmap()
bitmap_data_save_current();
// select the first bitmap by default
strcpy(sle.filename, stars_get_name_FRED(0, false));
strcpy_s(sle.filename, stars_get_name_FRED(0, false));
sle.ang.p = 0;
sle.ang.b = 0;
@@ -1332,6 +1206,51 @@ void bg_bitmap_dlg::OnKillfocusSun1Scale()
OnSunChange();
}
void bg_bitmap_dlg::OnDeltaposSkyboxPSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
get_data_spinner(pNMUpDown, IDC_SKYBOX_P, &m_skybox_pitch, 0, 359);
OnOrientationChange();
*pResult = 0;
}
void bg_bitmap_dlg::OnDeltaposSkyboxBSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
get_data_spinner(pNMUpDown, IDC_SKYBOX_B, &m_skybox_bank, 0, 359);
OnOrientationChange();
*pResult = 0;
}
void bg_bitmap_dlg::OnDeltaposSkyboxHSpin(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_UPDOWN* pNMUpDown = (NM_UPDOWN*)pNMHDR;
get_data_spinner(pNMUpDown, IDC_SKYBOX_H, &m_skybox_heading, 0, 359);
OnOrientationChange();
*pResult = 0;
}
void bg_bitmap_dlg::OnKillfocusSkyboxP()
{
get_data_int(IDC_SKYBOX_P, &m_skybox_pitch, 0, 359);
OnOrientationChange();
}
void bg_bitmap_dlg::OnKillfocusSkyboxB()
{
get_data_int(IDC_SKYBOX_B, &m_skybox_bank, 0, 359);
OnOrientationChange();
}
void bg_bitmap_dlg::OnKillfocusSkyboxH()
{
get_data_int(IDC_SKYBOX_H, &m_skybox_heading, 0, 359);
OnOrientationChange();
}
extern void parse_one_background(background_t *background);
@@ -1350,7 +1269,7 @@ void bg_bitmap_dlg::OnImportBackground()
if (cfd.DoModal() == IDCANCEL)
return;
strcpy(filename, cfd.GetPathName());
strcpy_s(filename, cfd.GetPathName());
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("BGBITMAPDLG: Unable to parse '%s'! Error code = %i.\n", filename, rval));
@@ -1499,6 +1418,17 @@ void bg_bitmap_dlg::OnSkyboxBrowse()
stars_set_background_model( (char*)(LPCTSTR)m_skybox_model, NULL );
}
void bg_bitmap_dlg::OnOrientationChange()
{
angles temp_angles;
matrix temp_orient;
temp_angles.p = fl_radians(m_skybox_pitch);
temp_angles.b = fl_radians(m_skybox_bank);
temp_angles.h = fl_radians(m_skybox_heading);
vm_angles_2_matrix(&temp_orient, &temp_angles);
stars_set_background_orientation( &temp_orient );
}
void bg_bitmap_dlg::OnEnvmapBrowse()
{
CString filename;
+23 -133
View File
@@ -7,137 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/BgBitmapDlg.h $
* $Revision: 1.2.2.2 $
* $Date: 2006-10-24 13:44:54 $
* $Author: taylor $
*
* Background space images manager dialog
*
* $Log: not supported by cvs2svn $
* Revision 1.2.2.1 2006/08/06 18:47:12 Goober5000
* add the multiple background feature
* --Goober5000
*
* Revision 1.2 2006/04/20 06:32:01 Goober5000
* proper capitalization according to Volition
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.9 2005/12/21 00:28:43 phreak
* Import background button for mission bitmaps.
*
* Revision 1.8 2005/07/25 06:51:33 Goober5000
* mission flag changes for FRED
* --Goober5000
*
* Revision 1.7 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.6 2005/04/12 02:18:52 phreak
* Ambient lighting sliders now work in the background editor.
*
* Revision 1.5 2005/03/29 03:13:06 phreak
* Made some changes to the background bitmap dialog to show the user updates
* whenever any information on the position or size changes, or another bitmap is
* used instead of whats currently selected. The spinners for the bitmaps also wrap
* from 359 - > 0 and from 0 -> 359. These enhancements should make creating
* backgrounds much quicker and easier.
*
* Also fixed a bug where if a user entered "39" in either the pitch, bank, or heading
* boxes, then the "39" would be set to "38" due to truncation from converting between
* radians and degrees.
*
* Revision 1.4 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.3 2003/10/23 23:52:26 phreak
* changed the background bitmap dialog so the user can specify custom skyboxes
*
* Revision 1.2 2003/01/13 02:07:26 wmcoolmon
* Removed the override checkbox + flag for ship trails and added a checkbox + flag to disable ship trails within the nebula, NO_NEB_TRAILS, to the Background dialog.
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 8 7/02/99 4:30p Dave
* Much more sophisticated lightning support.
*
* 7 6/03/99 6:37p Dave
* More TNT fun. Made perspective bitmaps more flexible.
*
* 6 4/26/99 8:47p Dave
* Made all pof related nebula stuff customizable through Fred.
*
* 5 4/07/99 6:21p Dave
* Fred and FreeSpace support for multiple background bitmaps and suns.
* Fixed link errors on all subprojects. Moved encrypt_init() to
* cfile_init() and lcl_init(), since its safe to call twice.
*
* 4 1/25/99 5:03a Dave
* First run of stealth, AWACS and TAG missile support. New mission type
* :)
*
* 3 11/14/98 5:37p Dave
* Put in support for full nebulas.
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 2:59p Dave
*
* 12 4/13/98 10:25p Hoffoss
* Added a flag for subspace missions, and for aboard the Galatea or
* Bastion.
*
* 11 12/08/97 4:48p Hoffoss
* Moved starfield editor controls to background editor.
*
* 10 11/25/97 11:40a Hoffoss
* Added support for nebula placement editing.
*
* 9 11/21/97 2:55p Hoffoss
* Added Nebula support to Fred. Implemented loading and saving nebula
* info to/from mission files.
*
* 8 3/31/97 6:07p Hoffoss
* Fixed several errors, including BG editor not graying fields, BG editor
* not updating image when changed, Removed obsolete data from Weapon
* editor, priority not being saved when missions saved, priority not
* editable in initial orders editor.
*
* 7 3/27/97 2:24p Hoffoss
* Fixed bug in image not updating when new image selected from listbox of
* combo box.
*
* 6 3/21/97 4:24p Hoffoss
* Fixed bug in changing image to an external image file.
*
* 5 3/17/97 1:54p Hoffoss
* fixed bugs in BG editor, and added delete button functionality.
*
* 4 3/12/97 4:33p Hoffoss
* added spin controls to orient editor, light intensity level can be
* specified in BG editor.
*
* 3 2/04/97 3:09p Hoffoss
* Background bitmap editor implemented fully.
*
* 2 1/30/97 2:24p Hoffoss
* Added remaining mission file structures and implemented load/save of
* them.
*
* $NoKeywords: $
*/
#ifndef _BG_BITMAP_DLG_H
#define _BG_BITMAP_DLG_H
@@ -165,7 +35,9 @@ public:
void get_data_spinner(NM_UPDOWN* pUD, int id, int *var, int min, int max);
void get_data_int(int id, int *var, int min, int max);
void get_data_float(int id, float *var, float max, float min);
afx_msg void OnClose();
bg_bitmap_dlg(CWnd* pParent = NULL); // standard constructor
// Dialog Data
@@ -207,8 +79,19 @@ public:
int b_div_x;
int b_div_y;
int b_index;
int m_sky_flag_1;
int m_sky_flag_2;
int m_sky_flag_3;
int m_sky_flag_4;
int m_sky_flag_5;
int m_sky_flag_6;
CString m_skybox_model;
CString m_envmap;
int m_skybox_pitch;
int m_skybox_bank;
int m_skybox_heading;
float m_neb_near_multi;
float m_neb_far_multi;
//}}AFX_DATA
// Overrides
@@ -227,9 +110,10 @@ protected:
int get_swap_background();
void reinitialize_lists();
void OnOrientationChange();
// Generated message map functions
//{{AFX_MSG(bg_bitmap_dlg)
afx_msg void OnClose();
afx_msg void OnCancel();
afx_msg void OnOK();
afx_msg void OnSelchangeNebcolor();
@@ -265,6 +149,12 @@ protected:
afx_msg void OnSwapBackground();
afx_msg void OnBackgroundDropdownChange();
afx_msg void OnSkyboxBrowse();
afx_msg void OnDeltaposSkyboxPSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSkyboxBSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnDeltaposSkyboxHSpin(NMHDR* pNMHDR, LRESULT* pResult);
afx_msg void OnKillfocusSkyboxP();
afx_msg void OnKillfocusSkyboxB();
afx_msg void OnKillfocusSkyboxH();
afx_msg void OnEnvmapBrowse();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
+50 -224
View File
@@ -7,206 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/Fred2/BriefingEditorDlg.cpp $
* $Revision: 1.4.2.2 $
* $Date: 2007-04-08 08:28:20 $
* $Author: karajorma $
*
* Briefing editor dialog box class.
*
* $Log: not supported by cvs2svn $
* Revision 1.4.2.1 2007/03/07 22:36:51 karajorma
* Make .ogg selectable in FRED.
*
* Revision 1.4 2006/05/30 02:13:22 Goober5000
* add substitute music boxes to FRED, and reset music properly when mission is cleared
* --Goober5000
*
* Revision 1.3 2006/02/04 07:05:03 Goober5000
* fixed several IFF bugs in FRED (plus one or two other bugs)
* --Goober5000
*
* Revision 1.2 2006/01/26 04:01:58 Goober5000
* spelling
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.13 2006/01/14 05:24:18 Goober5000
* first pass at converting FRED to use new IFF stuff
* --Goober5000
*
* Revision 1.12 2005/12/29 08:21:00 wmcoolmon
* No my widdle FRED, I didn't forget about you ^_^ (codebase commit)
*
* Revision 1.11 2005/12/29 00:55:25 phreak
* Briefing icons are now able to be flipped. Left becomes right and vice versa.
*
* Revision 1.10 2005/10/22 05:54:48 wmcoolmon
* Fixed cf_find_file_location
*
* Revision 1.9 2005/09/29 05:18:59 Goober5000
* the FRED stuff
* --Goober5000
*
* Revision 1.8 2005/07/13 01:03:10 Goober5000
* improved species support and removed need for #define
* --Goober5000
*
* Revision 1.7 2005/04/13 20:11:06 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.6 2005/03/06 23:19:27 wmcoolmon
* Fixed the last of the jump node errors
*
* Revision 1.5 2005/03/06 22:43:14 wmcoolmon
* Fixx0red some of the jump node errors
*
* Revision 1.4 2005/01/29 05:40:27 Goober5000
* regular docking should work again in FRED now (multiple docking still isn't done yet)
* --Goober5000
*
* Revision 1.3 2002/08/15 04:35:44 penguin
* Changes to build with fs2_open code.lib
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 9 7/19/99 3:01p Dave
* Fixed icons. Added single transport icon.
*
* 8 7/18/99 5:19p Dave
* Jump node icon. Fixed debris fogging. Framerate warning stuff.
*
* 7 7/09/99 5:54p Dave
* Seperated cruiser types into individual types. Added tons of new
* briefing icons. Campaign screen.
*
* 6 5/20/99 1:46p Andsager
* Add briefing view copy and paste between stages
*
* 5 4/23/99 12:01p Johnson
* Added SIF_HUGE_SHIP
*
* 4 11/30/98 5:32p Dave
* Fixed up Fred support for software mode.
*
* 3 10/16/98 4:28p Andsager
* Fix fred dependency
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:02p Dave
*
* 1 10/07/98 3:00p Dave
*
* 63 5/21/98 4:20p Dave
* Fixed bug with briefing editor when no current stage selected.
*
* 62 5/21/98 12:58a Hoffoss
* Fixed warnings optimized build turned up.
*
* 61 5/14/98 4:47p Hoffoss
* Made it so when you switch to a new team's debriefing (via menu), it
* updates the camera position to what it should be for new briefing
* stage.
*
* 60 4/30/98 8:23p John
* Fixed some bugs with Fred caused by my new cfile code.
*
* 59 4/22/98 9:56a Sandeep
*
* 58 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 57 4/16/98 2:49p Johnson
* Fixed initialization for new icons in briefing.
*
* 56 4/07/98 6:32p Dave
* Fixed function I forget to change back.
*
* 55 4/07/98 6:27p Dave
* Implemented a more boiler-plate solution to the multiple team briefing
* problem in this editor.
*
* 54 4/07/98 4:51p Dave
* (Hoffoss) Fixed a boat load of bugs caused by the new change to
* multiple briefings. Allender's code changed to support this in the
* briefing editor wasn't quite correct.
*
* 53 4/06/98 5:37p Hoffoss
* Added sexp tree support to briefings in Fred.
*
* 52 4/06/98 10:43a John
* Fixed bugs with inserting/deleting stages
*
* 51 4/03/98 12:39p Hoffoss
* Changed starting directory for browse buttons in several editors.
*
* 50 4/03/98 11:34a John
* Fixed the stuff I broke in Fred from the new briefing
*
* 49 3/26/98 6:40p Lawrance
* Don't store icon text for briefings
*
* 48 3/21/98 7:36p Lawrance
* Move jump nodes to own lib.
*
* 47 3/19/98 4:24p Hoffoss
* Added remaining support for command brief screen (ANI and WAVE file
* playing).
*
* 46 3/17/98 2:00p Hoffoss
* Added ability to make an icon from a jump node in briefing editor.
*
* 45 2/18/98 6:44p Hoffoss
* Added support for lines between icons in briefings for Fred.
*
* 44 2/09/98 9:25p Allender
* team v team support. multiple pools and briefings
*
* 43 2/04/98 4:31p Allender
* support for multiple briefings and debriefings. Changes to mission
* type (now a bitfield). Bitfield defs for multiplayer modes
*
* 42 1/28/98 7:19p Lawrance
* Get fading/highlighting animations working
*
* 41 12/28/97 5:52p Lawrance
* Add support for debriefing success/fail music.
*
* 40 11/04/97 4:33p Hoffoss
* Made saving keep the current briefing state intact.
*
* 39 11/04/97 11:31a Duncan
* Made make icon button gray if at max icons already.
*
* 38 11/03/97 4:07p Jasen
* Fixed bug in briefing editor caused by changes in TEAM_* defines in the
* past and whoever made these changes failed to update this editor along
* with it.
*
* 37 10/19/97 11:32p Hoffoss
* Added support for briefing cuts in Fred.
*
* 36 10/12/97 11:23p Mike
* About ten fixes/changes in the docking system.
* Also, renamed SIF_REARM_REPAIR to SIF_SUPPORT.
*
* 35 9/30/97 5:56p Hoffoss
* Added music selection combo boxes to Fred.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
@@ -226,9 +27,9 @@
#include "object/objectdock.h"
#include "iff_defs/iff_defs.h"
#include "sound/audiostr.h"
#include "localization/localize.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -310,7 +111,6 @@ void briefing_editor_dlg::DoDataExchange(CDataExchange* pDX)
DDX_Check(pDX, IDC_FLIP_ICON, m_flipicon);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_text, MAX_BRIEF_LEN - 1);
DDV_MaxChars(pDX, m_voice, MAX_FILENAME_LEN - 1);
DDV_MaxChars(pDX, m_icon_label, MAX_LABEL_LEN - 1);
DDV_MaxChars(pDX, m_icon_text, MAX_ICON_TEXT_LEN - 1);
@@ -365,6 +165,11 @@ void briefing_editor_dlg::OnInitMenu(CMenu* pMenu)
// put a check next to the currently selected item
m->CheckMenuItem(m_current_briefing, MF_BYPOSITION | MF_CHECKED );
// Karajorma - it might be nice to autobalance the briefings and debriefings but I'm not doing anything till I
// understand how the how system works better. disabling the option for now.
m = pMenu->GetSubMenu(1);
m->EnableMenuItem(ID_AUTOBALANCE, MF_GRAYED);
CDialog::OnInitMenu(pMenu);
}
@@ -380,7 +185,7 @@ void briefing_editor_dlg::create()
box->AddString(Icon_names[i]);
box = (CComboBox *) GetDlgItem(IDC_TEAM);
for (i=0; i<Num_team_names; i++)
for (i=0; i<Num_iffs; i++)
box->AddString(Iff_info[i].iff_name);
box = (CComboBox *) GetDlgItem(IDC_SHIP_TYPE);
@@ -496,7 +301,8 @@ void briefing_editor_dlg::restore_editor_state()
void briefing_editor_dlg::update_data(int update)
{
char buf[MAX_LABEL_LEN], buf2[MAX_ICON_TEXT_LEN], buf3[MAX_BRIEF_LEN];
char buf[MAX_LABEL_LEN], buf2[MAX_ICON_TEXT_LEN];
SCP_string buf3;
int i, j, l, lines, count, enable = TRUE, valid = 0, invalid = 0;
object *objp;
brief_stage *ptr = NULL;
@@ -508,14 +314,15 @@ void briefing_editor_dlg::update_data(int update)
Briefing = save_briefing;
Mission_music[SCORE_BRIEFING] = m_briefing_music - 1;
strcpy(The_mission.substitute_briefing_music_name, m_substitute_briefing_music);
strcpy_s(The_mission.substitute_briefing_music_name, m_substitute_briefing_music);
if (m_last_stage >= 0) {
ptr = &Briefing->stages[m_last_stage];
deconvert_multiline_string(buf3, m_text, MAX_BRIEF_LEN);
if (stricmp(ptr->new_text, buf3))
deconvert_multiline_string(buf3, m_text);
lcl_fred_replace_stuff(buf3);
if (ptr->text != buf3)
set_modified();
strcpy(ptr->new_text, buf3);
ptr->text = buf3;
MODIFY(ptr->camera_time, atoi(m_time));
string_copy(ptr->voice, m_voice, MAX_FILENAME_LEN, 1);
i = ptr->flags;
@@ -564,6 +371,18 @@ void briefing_editor_dlg::update_data(int update)
break;
}
//WMC - Safeguard against broken lines
i = ptr->num_lines;
while(i--)
{
if(ptr->lines[i].start_icon < 0 || ptr->lines[i].end_icon < 0 || ptr->lines[i].start_icon >= ptr->num_icons || ptr->lines[i].end_icon >= ptr->num_icons)
{
ptr->num_lines--;
for(l = i; l < ptr->num_lines; l++)
ptr->lines[l] = ptr->lines[l+1];
}
}
if (m_last_icon >= 0) {
valid = (m_id != ptr->icons[m_last_icon].id);
if (m_id >= 0) {
@@ -609,10 +428,10 @@ void briefing_editor_dlg::update_data(int update)
set_modified();
reset_icon_loop(m_last_stage);
while (get_next_icon(m_id))
strcpy(iconp->label, buf);
strcpy_s(iconp->label, buf);
}
strcpy(ptr->icons[m_last_icon].label, buf);
strcpy_s(ptr->icons[m_last_icon].label, buf);
if ( m_hilight )
ptr->icons[m_last_icon].flags |= BI_HIGHLIGHT;
else
@@ -653,10 +472,10 @@ void briefing_editor_dlg::update_data(int update)
set_modified();
reset_icon_loop(m_last_stage);
while (get_next_icon(m_id))
strcpy(iconp->text, buf2);
strcpy_s(iconp->text, buf2);
}
strcpy(ptr->icons[m_last_icon].text, buf2);
strcpy_s(ptr->icons[m_last_icon].text, buf2);
*/
}
}
@@ -670,7 +489,7 @@ void briefing_editor_dlg::update_data(int update)
if ((m_cur_stage >= 0) && (m_cur_stage < Briefing->num_stages)) {
ptr = &Briefing->stages[m_cur_stage];
m_stage_title.Format("Stage %d of %d", m_cur_stage + 1, Briefing->num_stages);
m_text = convert_multiline_string(ptr->new_text);
convert_multiline_string(m_text, ptr->text);
m_time.Format("%d", ptr->camera_time);
m_voice = ptr->voice;
m_cut_prev = (ptr->flags & BS_BACKWARD_CUT) ? 1 : 0;
@@ -1033,8 +852,8 @@ void briefing_editor_dlg::OnInsertStage()
void briefing_editor_dlg::copy_stage(int from, int to)
{
if ((from < 0) || (from >= Briefing->num_stages)) {
strcpy(Briefing->stages[to].new_text, "<Text here>");
strcpy(Briefing->stages[to].voice, "none.wav");
Briefing->stages[to].text = "<Text here>";
strcpy_s(Briefing->stages[to].voice, "none.wav");
Briefing->stages[to].camera_pos = view_pos;
Briefing->stages[to].camera_orient = view_orient;
Briefing->stages[to].camera_time = 500;
@@ -1044,8 +863,8 @@ void briefing_editor_dlg::copy_stage(int from, int to)
}
// Copy all the data in the stage structure.
strcpy( Briefing->stages[to].new_text, Briefing->stages[from].new_text );
strcpy( Briefing->stages[to].voice, Briefing->stages[from].voice );
Briefing->stages[to].text = Briefing->stages[from].text;
strcpy_s( Briefing->stages[to].voice, Briefing->stages[from].voice );
Briefing->stages[to].camera_pos = Briefing->stages[from].camera_pos;
Briefing->stages[to].camera_orient = Briefing->stages[from].camera_orient;
Briefing->stages[to].camera_time = Briefing->stages[from].camera_time;
@@ -1097,7 +916,7 @@ void briefing_editor_dlg::OnMakeIcon()
iconp = &Briefing->stages[m_cur_stage].icons[m_cur_icon];
ship = waypoint = -1;
team = 0;
jump_node *jnp = NULL;
SCP_list<CJumpNode>::iterator jnp;
vm_vec_make(&min, 9e19f, 9e19f, 9e19f);
vm_vec_make(&max, -9e19f, -9e19f, -9e19f);
@@ -1128,7 +947,10 @@ void briefing_editor_dlg::OnMakeIcon()
break;
case OBJ_JUMP_NODE:
jnp = ptr->jnp;
for (jnp = Jump_nodes.begin(); jnp != Jump_nodes.end(); ++jnp) {
if(jnp->GetSCPObject() == ptr)
break;
}
break;
default:
@@ -1169,9 +991,13 @@ void briefing_editor_dlg::OnMakeIcon()
if (ship >= 0)
name = Ships[ship].ship_name;
else if (waypoint >= 0)
name = Waypoint_lists[waypoint / 65536].name;
else if (jnp != NULL)
name = jnp->get_name_ptr();
{
waypoint_list *wp_list = find_waypoint_list_with_instance(waypoint);
Assert(wp_list != NULL);
name = wp_list->get_name();
}
else if (jnp != Jump_nodes.end())
name = jnp->GetName();
else
return;
@@ -1265,7 +1091,7 @@ void briefing_editor_dlg::OnMakeIcon()
}
}
// jumpnodes
else if(jnp != NULL){
else if(jnp != Jump_nodes.end()){
// find the first navbuoy
iconp->ship_class = -1;
for (int i = 0; i < Num_ship_classes; i++)
@@ -1517,7 +1343,7 @@ void briefing_editor_dlg::OnEndlabeleditTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
*pResult = m_tree.end_label_edit(pTVDispInfo->item.hItem, pTVDispInfo->item.pszText);
*pResult = m_tree.end_label_edit(pTVDispInfo->item);
}
BOOL briefing_editor_dlg::DestroyWindow()
+1 -124
View File
@@ -7,130 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/BriefingEditorDlg.h $
* $Revision: 1.3 $
* $Date: 2006-05-30 02:13:22 $
* $Author: Goober5000 $
*
* Briefing editor dialog box class.
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2006/01/26 04:01:58 Goober5000
* spelling
*
* Revision 1.1 2006/01/19 02:27:31 Goober5000
* import FRED2 back into fs2_open module
* --Goober5000
*
* Revision 1.6 2005/12/29 00:55:25 phreak
* Briefing icons are now able to be flipped. Left becomes right and vice versa.
*
* Revision 1.5 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.4 2005/04/13 20:02:08 chhogg
* Changed vector to vec3d for Fred.
*
* Revision 1.3 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:52 inquisitor
* Initial FRED2 Checking
*
*
* 3 5/20/99 1:46p Andsager
* Add briefing view copy and paste between stages
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 24 4/20/98 4:40p Hoffoss
* Added a button to 4 editors to play the chosen wave file.
*
* 23 4/07/98 4:51p Dave
* (Hoffoss) Fixed a boat load of bugs caused by the new change to
* multiple briefings. Allender's code changed to support this in the
* briefing editor wasn't quite correct.
*
* 22 4/06/98 5:37p Hoffoss
* Added sexp tree support to briefings in Fred.
*
* 21 2/18/98 6:45p Hoffoss
* Added support for lines between icons in briefings for Fred.
*
* 20 2/09/98 9:25p Allender
* team v team support. multiple pools and briefings
*
* 19 2/04/98 4:32p Allender
* support for multiple briefings and debriefings. Changes to mission
* type (now a bitfield). Bitfield defs for multiplayer modes
*
* 18 11/04/97 4:33p Hoffoss
* Made saving keep the current briefing state intact.
*
* 17 10/19/97 11:32p Hoffoss
* Added support for briefing cuts in Fred.
*
* 16 9/30/97 5:56p Hoffoss
* Added music selection combo boxes to Fred.
*
* 15 8/19/97 10:15a Hoffoss
* Made escape close briefing window through normal channels.
*
* 14 8/14/97 6:37p Hoffoss
* Added briefing icon id support to Fred.
*
* 13 8/07/97 3:45p Hoffoss
* Added in several requested features to the briefing editor.
*
* 12 8/06/97 12:25p Hoffoss
* Fixed bugs: Briefing editor dialog wasn't getting reset when new
* mission created, and hitting MFC assert when quitting while briefing
* editor open.
*
* 11 7/03/97 9:42a Hoffoss
* Added a ship type field in briefing editor.
*
* 10 6/26/97 6:04p Hoffoss
* Briefing icons now are selected before normal objects.
*
* 9 6/26/97 5:18p Hoffoss
* Major rework of briefing editor functionality.
*
* 8 6/25/97 4:13p Hoffoss
* Added functionality to the make icon button.
*
* 7 6/25/97 10:37a Hoffoss
* Added icon text field support to briefing editor.
*
* 6 6/24/97 3:03p Hoffoss
* New stages now copy another stage if possible.
*
* 5 6/24/97 11:31a Hoffoss
* Added code for handling icon editing.
*
* 4 6/24/97 10:16a Hoffoss
* Changes to briefing editor code.
*
* 3 6/23/97 2:58p Hoffoss
* Added more functionality to briefing editor.
*
* 2 6/18/97 2:39p Hoffoss
* Improved on briefing editor. Still far from done, though.
*
* $NoKeywords: $
*/
#ifndef __BRIEFINGEDITORDLG_H__
#define __BRIEFINGEDITORDLG_H__
+77 -77
View File
@@ -23,7 +23,6 @@
#include "mission/missiongoals.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -46,9 +45,9 @@ campaign_editor::campaign_editor()
m_type = -1;
m_num_players = _T("");
m_desc = _T("");
m_loop_desc = _T("");
m_loop_brief_anim = _T("");
m_loop_brief_sound = _T("");
m_branch_desc = _T("");
m_branch_brief_anim = _T("");
m_branch_brief_sound = _T("");
m_custom_tech_db = FALSE;
//}}AFX_DATA_INIT
@@ -72,14 +71,14 @@ void campaign_editor::DoDataExchange(CDataExchange* pDX)
DDX_CBIndex(pDX, IDC_CAMPAIGN_TYPE, m_type);
DDX_Text(pDX, IDC_NUM_PLAYERS, m_num_players);
DDX_Text(pDX, IDC_DESC2, m_desc);
DDX_Text(pDX, IDC_MISSISON_LOOP_DESC, m_loop_desc);
DDX_Text(pDX, IDC_LOOP_BRIEF_ANIM, m_loop_brief_anim);
DDX_Text(pDX, IDC_LOOP_BRIEF_SOUND, m_loop_brief_sound);
DDX_Text(pDX, IDC_MISSISON_LOOP_DESC, m_branch_desc);
DDX_Text(pDX, IDC_LOOP_BRIEF_ANIM, m_branch_brief_anim);
DDX_Text(pDX, IDC_LOOP_BRIEF_SOUND, m_branch_brief_sound);
DDX_Check(pDX, IDC_CUSTOM_TECH_DB, m_custom_tech_db);
//}}AFX_DATA_MAP
DDV_MaxChars(pDX, m_desc, MISSION_DESC_LENGTH - 1);
DDV_MaxChars(pDX, m_loop_desc, MISSION_DESC_LENGTH - 1);
DDV_MaxChars(pDX, m_branch_desc, MISSION_DESC_LENGTH - 1);
}
BEGIN_MESSAGE_MAP(campaign_editor, CFormView)
@@ -181,7 +180,7 @@ void campaign_editor::load_campaign()
load_tree(0);
if (!strlen(Campaign.filename))
strcpy(Campaign.filename, BUILTIN_CAMPAIGN);
strcpy_s(Campaign.filename, Default_campaign_file_name);
if (mission_campaign_load(Campaign.filename, NULL, 0)) {
MessageBox("Couldn't open Campaign file!", "Error");
@@ -219,15 +218,15 @@ void campaign_editor::initialize( int init_files )
m_num_players.Format("%d", Campaign.num_players);
if (Campaign.desc) {
m_desc = convert_multiline_string(Campaign.desc);
convert_multiline_string(m_desc, Campaign.desc);
} else {
m_desc = _T("");
}
m_loop_desc = _T("");
m_branch_desc = _T("");
m_loop_brief_anim = _T("");
m_loop_brief_sound = _T("");
m_branch_brief_anim = _T("");
m_branch_brief_sound = _T("");
// single player should hide the two dialog items about number of players allowed
if ( m_type == CAMPAIGN_TYPE_SINGLE ) {
@@ -353,16 +352,16 @@ void campaign_editor::load_tree(int save_first)
m_num_links++;
if (Links[i].from == Links[i].to) {
strcpy(text, "Repeat mission");
strcpy_s(text, "Repeat mission");
} else if ( (Links[i].to == -1) && (Links[i].from != -1) ) {
strcpy(text, "End of Campaign");
strcpy_s(text, "End of Campaign");
} else {
sprintf(text, "Branch to %s", Campaign.missions[Links[i].to].name);
}
// insert item into tree
int image, sel_image;
if (Links[i].mission_loop) {
if (Links[i].is_mission_loop || Links[i].is_mission_fork) {
image = BITMAP_BLUE_DOT;
sel_image = BITMAP_GREEN_DOT;
} else {
@@ -400,7 +399,7 @@ void campaign_editor::OnEndlabeleditSexpTree(NMHDR* pNMHDR, LRESULT* pResult)
{
TV_DISPINFO* pTVDispInfo = (TV_DISPINFO*)pNMHDR;
*pResult = m_tree.end_label_edit(pTVDispInfo->item.hItem, pTVDispInfo->item.pszText);
*pResult = m_tree.end_label_edit(pTVDispInfo->item);
}
int campaign_editor::handler(int code, int node, char *str)
@@ -655,76 +654,76 @@ void campaign_editor::save_loop_desc_window()
{
char buffer[MISSION_DESC_LENGTH];
// update only if active link and there is a mission has mission loop
if ( (Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop ) {
deconvert_multiline_string(buffer, m_loop_desc, MISSION_DESC_LENGTH);
if (Links[Cur_campaign_link].mission_loop_txt) {
free(Links[Cur_campaign_link].mission_loop_txt);
// update only if active link and there is a mission has mission loop or fork
if ( (Cur_campaign_link >= 0) && (Links[Cur_campaign_link].is_mission_loop || Links[Cur_campaign_link].is_mission_fork) ) {
deconvert_multiline_string(buffer, m_branch_desc, MISSION_DESC_LENGTH);
if (Links[Cur_campaign_link].mission_branch_txt) {
free(Links[Cur_campaign_link].mission_branch_txt);
}
if (Links[Cur_campaign_link].mission_loop_brief_anim) {
free(Links[Cur_campaign_link].mission_loop_brief_anim);
if (Links[Cur_campaign_link].mission_branch_brief_anim) {
free(Links[Cur_campaign_link].mission_branch_brief_anim);
}
if (Links[Cur_campaign_link].mission_loop_brief_sound) {
free(Links[Cur_campaign_link].mission_loop_brief_sound);
if (Links[Cur_campaign_link].mission_branch_brief_sound) {
free(Links[Cur_campaign_link].mission_branch_brief_sound);
}
if (strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_txt = strdup(buffer);
Links[Cur_campaign_link].mission_branch_txt = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_txt = NULL;
Links[Cur_campaign_link].mission_branch_txt = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_anim, MAX_FILENAME_LEN);
deconvert_multiline_string(buffer, m_branch_brief_anim, MAX_FILENAME_LEN);
if(strlen(buffer)){
Links[Cur_campaign_link].mission_loop_brief_anim = strdup(buffer);
Links[Cur_campaign_link].mission_branch_brief_anim = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_anim = NULL;
Links[Cur_campaign_link].mission_branch_brief_anim = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_sound, MAX_FILENAME_LEN);
deconvert_multiline_string(buffer, m_branch_brief_sound, MAX_FILENAME_LEN);
if(strlen(buffer)){
Links[Cur_campaign_link].mission_loop_brief_sound = strdup(buffer);
Links[Cur_campaign_link].mission_branch_brief_sound = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_sound = NULL;
Links[Cur_campaign_link].mission_branch_brief_sound = NULL;
}
}
}
void campaign_editor::update_loop_desc_window()
{
bool enable_loop_desc_window;
bool enable_branch_desc_window;
enable_loop_desc_window = false;
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop) {
enable_loop_desc_window = true;
enable_branch_desc_window = false;
if ((Cur_campaign_link >= 0) && (Links[Cur_campaign_link].is_mission_loop || Links[Cur_campaign_link].is_mission_fork)) {
enable_branch_desc_window = true;
}
// maybe enable description window
GetDlgItem(IDC_MISSISON_LOOP_DESC)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_ANIM)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_SOUND)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_BROWSE)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_SOUND_BROWSE)->EnableWindow(enable_loop_desc_window);
GetDlgItem(IDC_MISSISON_LOOP_DESC)->EnableWindow(enable_branch_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_ANIM)->EnableWindow(enable_branch_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_SOUND)->EnableWindow(enable_branch_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_BROWSE)->EnableWindow(enable_branch_desc_window);
GetDlgItem(IDC_LOOP_BRIEF_SOUND_BROWSE)->EnableWindow(enable_branch_desc_window);
// set new text
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop_txt && enable_loop_desc_window) {
m_loop_desc = convert_multiline_string(Links[Cur_campaign_link].mission_loop_txt);
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_branch_txt && enable_branch_desc_window) {
convert_multiline_string(m_branch_desc, Links[Cur_campaign_link].mission_branch_txt);
} else {
m_loop_desc = _T("");
m_branch_desc = _T("");
}
// set new text
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop_brief_anim && enable_loop_desc_window) {
m_loop_brief_anim = convert_multiline_string(Links[Cur_campaign_link].mission_loop_brief_anim);
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_branch_brief_anim && enable_branch_desc_window) {
convert_multiline_string(m_branch_brief_anim, Links[Cur_campaign_link].mission_branch_brief_anim);
} else {
m_loop_brief_anim = _T("");
m_branch_brief_anim = _T("");
}
// set new text
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop_brief_sound && enable_loop_desc_window) {
m_loop_brief_sound = convert_multiline_string(Links[Cur_campaign_link].mission_loop_brief_sound);
if ((Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_branch_brief_sound && enable_branch_desc_window) {
convert_multiline_string(m_branch_brief_sound, Links[Cur_campaign_link].mission_branch_brief_sound);
} else {
m_loop_brief_sound = _T("");
m_branch_brief_sound = _T("");
}
// reset text
@@ -738,55 +737,56 @@ void campaign_editor::OnToggleLoop()
return;
}
// store mission looop text
// store mission loop text
UpdateData(TRUE);
if ( (Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop ) {
if (Links[Cur_campaign_link].mission_loop_txt) {
free(Links[Cur_campaign_link].mission_loop_txt);
if ( (Cur_campaign_link >= 0) && (Links[Cur_campaign_link].is_mission_loop || Links[Cur_campaign_link].is_mission_fork) ) {
if (Links[Cur_campaign_link].mission_branch_txt) {
free(Links[Cur_campaign_link].mission_branch_txt);
}
if (Links[Cur_campaign_link].mission_loop_brief_anim) {
free(Links[Cur_campaign_link].mission_loop_brief_anim);
if (Links[Cur_campaign_link].mission_branch_brief_anim) {
free(Links[Cur_campaign_link].mission_branch_brief_anim);
}
if (Links[Cur_campaign_link].mission_loop_brief_sound) {
free(Links[Cur_campaign_link].mission_loop_brief_sound);
if (Links[Cur_campaign_link].mission_branch_brief_sound) {
free(Links[Cur_campaign_link].mission_branch_brief_sound);
}
char buffer[MISSION_DESC_LENGTH];
deconvert_multiline_string(buffer, m_loop_desc, MISSION_DESC_LENGTH);
if (m_loop_desc && strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_txt = strdup(buffer);
deconvert_multiline_string(buffer, m_branch_desc, MISSION_DESC_LENGTH);
if (m_branch_desc && strlen(buffer)) {
Links[Cur_campaign_link].mission_branch_txt = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_txt = NULL;
Links[Cur_campaign_link].mission_branch_txt = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_anim, MISSION_DESC_LENGTH);
if (m_loop_brief_anim && strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_brief_anim = strdup(buffer);
deconvert_multiline_string(buffer, m_branch_brief_anim, MISSION_DESC_LENGTH);
if (m_branch_brief_anim && strlen(buffer)) {
Links[Cur_campaign_link].mission_branch_brief_anim = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_anim = NULL;
Links[Cur_campaign_link].mission_branch_brief_anim = NULL;
}
deconvert_multiline_string(buffer, m_loop_brief_sound, MISSION_DESC_LENGTH);
if (m_loop_brief_sound && strlen(buffer)) {
Links[Cur_campaign_link].mission_loop_brief_sound = strdup(buffer);
deconvert_multiline_string(buffer, m_branch_brief_sound, MISSION_DESC_LENGTH);
if (m_branch_brief_sound && strlen(buffer)) {
Links[Cur_campaign_link].mission_branch_brief_sound = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_sound = NULL;
Links[Cur_campaign_link].mission_branch_brief_sound = NULL;
}
}
// toggle to mission_loop setting
Links[Cur_campaign_link].mission_loop = !Links[Cur_campaign_link].mission_loop;
Links[Cur_campaign_link].is_mission_loop = !Links[Cur_campaign_link].is_mission_loop;
Links[Cur_campaign_link].is_mission_fork = false;
// reset loop desc window (gray if inactive)
update_loop_desc_window();
// set root icon
int bitmap1, bitmap2;
if (Links[Cur_campaign_link].mission_loop) {
if (Links[Cur_campaign_link].is_mission_loop || Links[Cur_campaign_link].is_mission_fork) {
bitmap2 = BITMAP_GREEN_DOT;
bitmap1 = BITMAP_BLUE_DOT;
} else {
@@ -820,7 +820,7 @@ void campaign_editor::OnBrowseLoopAni()
CFileDialog dlg(TRUE, "ani", NULL, OFN_HIDEREADONLY | OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR, "Ani Files (*.ani)|*.ani");
if (dlg.DoModal() == IDOK) {
m_loop_brief_anim = dlg.GetFileName();
m_branch_brief_anim = dlg.GetFileName();
UpdateData(FALSE);
}
@@ -842,7 +842,7 @@ void campaign_editor::OnBrowseLoopSound()
"Voice Files (*.ogg, *.wav)|*.ogg;*.wav|Ogg Vorbis Files (*.ogg)|*.ogg|Wave Files (*.wav)|*.wav||");
if (dlg.DoModal() == IDOK) {
m_loop_brief_sound = dlg.GetFileName();
m_branch_brief_sound = dlg.GetFileName();
UpdateData(FALSE);
}
@@ -886,7 +886,7 @@ void campaign_editor::OnChangeDebriefingPersona()
if (persona < 0 || persona > 0xff)
persona = 0;
Campaign.missions[Cur_campaign_mission].debrief_persona_index = persona;
Campaign.missions[Cur_campaign_mission].debrief_persona_index = (ubyte) persona;
}
}
+3 -3
View File
@@ -56,9 +56,9 @@ public:
int m_type;
CString m_num_players;
CString m_desc;
CString m_loop_desc;
CString m_loop_brief_anim;
CString m_loop_brief_sound;
CString m_branch_desc;
CString m_branch_brief_anim;
CString m_branch_brief_sound;
BOOL m_custom_tech_db;
//}}AFX_DATA
+2 -2
View File
@@ -19,7 +19,6 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -48,13 +47,14 @@ void campaign_filelist_box::initialize()
{
int i, z, num_files;
char *mission_filenames[2000];
char mission_filenames_arr[2000][MAX_FILENAME_LEN];
mission a_mission;
ResetContent();
extern int Skip_packfile_search;
Skip_packfile_search = 1;
num_files = cf_get_file_list(2000, mission_filenames, CF_TYPE_MISSIONS, "*.fs2");
num_files = cf_get_file_list_preallocated(2000, mission_filenames_arr, mission_filenames, CF_TYPE_MISSIONS, "*.fs2");
Skip_packfile_search = 0;
i=0;
+46 -39
View File
@@ -18,7 +18,6 @@
#include "mission/missionparse.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -148,7 +147,7 @@ void campaign_tree_view::OnDraw(CDC* pDC)
Elements[i].box.top = y - By / 2;
Elements[i].box.bottom = Elements[i].box.top + By;
strcpy(str, Campaign.missions[i].name);
strcpy_s(str, Campaign.missions[i].name);
str[strlen(str) - 4] = 0; // strip extension from filename
GetTextExtentPoint32(pDC->m_hDC, str, strlen(str), &size);
if (size.cx > CELL_TEXT_WIDTH) {
@@ -184,14 +183,14 @@ void campaign_tree_view::OnDraw(CDC* pDC)
Links[i].p2.x = Elements[t].box.left + Links[i].to_pos * Bx / (Elements[t].to_links + 1);
Links[i].p2.y = Elements[t].box.top;
// if mission_loop link, select blue pen
if (Links[i].mission_loop) {
// if special mission link, select blue pen
if (Links[i].is_mission_loop || Links[i].is_mission_fork) {
pDC->SelectObject(&blue_pen);
}
// if active link, select highlight pen (red - normal, green - mission loop)
// if active link, select highlight pen (red - normal, green - special)
if (i == Cur_campaign_link) {
if (Links[i].mission_loop) {
if (Links[i].is_mission_loop || Links[i].is_mission_fork) {
pDC->SelectObject(&green_pen);
} else {
pDC->SelectObject(&red_pen);
@@ -249,9 +248,9 @@ void stuff_link_with_formula(int *link_idx, int formula, int mission_num)
node2 = CAR(node);
Links[*link_idx].from = mission_num;
Links[*link_idx].sexp = CAR(node2);
Links[*link_idx].mission_loop_txt = NULL;
Links[*link_idx].mission_loop_brief_anim = NULL;
Links[*link_idx].mission_loop_brief_sound = NULL;
Links[*link_idx].mission_branch_txt = NULL;
Links[*link_idx].mission_branch_brief_anim = NULL;
Links[*link_idx].mission_branch_brief_sound = NULL;
sexp_mark_persistent(CAR(node2));
free_one_sexp(node2);
node3 = CADR(node2);
@@ -301,13 +300,20 @@ void campaign_tree_view::construct_tree()
// do main campaign path
stuff_link_with_formula(&link_idx, Campaign.missions[i].formula, i);
// do mission loop path
if ( Campaign.missions[i].has_mission_loop ) {
// do special mission path
if ( Campaign.missions[i].flags & CMISSION_FLAG_HAS_LOOP ) {
stuff_link_with_formula(&link_idx, Campaign.missions[i].mission_loop_formula, i);
Links[link_idx-1].mission_loop_txt = Campaign.missions[i].mission_loop_desc;
Links[link_idx-1].mission_loop_brief_anim = Campaign.missions[i].mission_loop_brief_anim;
Links[link_idx-1].mission_loop_brief_sound = Campaign.missions[i].mission_loop_brief_sound;
Links[link_idx-1].mission_loop = 1;
Links[link_idx-1].mission_branch_txt = Campaign.missions[i].mission_branch_desc;
Links[link_idx-1].mission_branch_brief_anim = Campaign.missions[i].mission_branch_brief_anim;
Links[link_idx-1].mission_branch_brief_sound = Campaign.missions[i].mission_branch_brief_sound;
Links[link_idx-1].is_mission_loop = true;
}
else if ( Campaign.missions[i].flags & CMISSION_FLAG_HAS_FORK ) {
Campaign.missions[i].mission_loop_formula = -1;
Links[link_idx-1].mission_branch_txt = Campaign.missions[i].mission_branch_desc;
Links[link_idx-1].mission_branch_brief_anim = Campaign.missions[i].mission_branch_brief_anim;
Links[link_idx-1].mission_branch_brief_sound = Campaign.missions[i].mission_branch_brief_sound;
Links[link_idx-1].is_mission_fork = true;
}
}
@@ -511,45 +517,45 @@ void campaign_tree_view::OnLButtonDown(UINT nFlags, CPoint point)
dc.DrawDragRect(Dragging_rect, Last_draw_size, NULL, CSize(0, 0));
} else {
if ( (Cur_campaign_link >= 0) && Links[Cur_campaign_link].mission_loop) {
// HACK!! UPDATE mission loop desc before changing selections
// save mission loop desc
if ( (Cur_campaign_link >= 0) && (Links[Cur_campaign_link].is_mission_loop || Links[Cur_campaign_link].is_mission_fork)) {
// HACK!! UPDATE mission loop/fork desc before changing selections
// save mission loop/fork desc
char buffer[MISSION_DESC_LENGTH];
box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_MISSISON_LOOP_DESC);
box->GetWindowText(buffer, MISSION_DESC_LENGTH);
if (strlen(buffer)) {
if (Links[Cur_campaign_link].mission_loop_txt) {
free(Links[Cur_campaign_link].mission_loop_txt);
if (Links[Cur_campaign_link].mission_branch_txt) {
free(Links[Cur_campaign_link].mission_branch_txt);
}
Links[Cur_campaign_link].mission_loop_txt = strdup(buffer);
Links[Cur_campaign_link].mission_branch_txt = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_txt = NULL;
Links[Cur_campaign_link].mission_branch_txt = NULL;
}
// HACK!! UPDATE mission loop desc before changing selections
// save mission loop desc
// HACK!! UPDATE mission loop/fork desc before changing selections
// save mission loop/fork desc
box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_LOOP_BRIEF_ANIM);
box->GetWindowText(buffer, MISSION_DESC_LENGTH);
if (strlen(buffer)) {
if (Links[Cur_campaign_link].mission_loop_brief_anim) {
free(Links[Cur_campaign_link].mission_loop_brief_anim);
if (Links[Cur_campaign_link].mission_branch_brief_anim) {
free(Links[Cur_campaign_link].mission_branch_brief_anim);
}
Links[Cur_campaign_link].mission_loop_brief_anim = strdup(buffer);
Links[Cur_campaign_link].mission_branch_brief_anim = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_anim = NULL;
Links[Cur_campaign_link].mission_branch_brief_anim = NULL;
}
// HACK!! UPDATE mission loop desc before changing selections
// save mission loop desc
// HACK!! UPDATE mission loop/fork desc before changing selections
// save mission loop/fork desc
box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_LOOP_BRIEF_SOUND);
box->GetWindowText(buffer, MISSION_DESC_LENGTH);
if (strlen(buffer)) {
if (Links[Cur_campaign_link].mission_loop_brief_sound) {
free(Links[Cur_campaign_link].mission_loop_brief_sound);
if (Links[Cur_campaign_link].mission_branch_brief_sound) {
free(Links[Cur_campaign_link].mission_branch_brief_sound);
}
Links[Cur_campaign_link].mission_loop_brief_sound = strdup(buffer);
Links[Cur_campaign_link].mission_branch_brief_sound = strdup(buffer);
} else {
Links[Cur_campaign_link].mission_loop_brief_sound = NULL;
Links[Cur_campaign_link].mission_branch_brief_sound = NULL;
}
}
Mission_dragging = Cur_campaign_mission = Cur_campaign_link = -1;
@@ -565,7 +571,7 @@ void campaign_tree_view::OnLButtonDown(UINT nFlags, CPoint point)
read_mission_goal_list(Cur_campaign_mission);
if (Campaign.missions[Cur_campaign_mission].notes) {
str = convert_multiline_string(Campaign.missions[Cur_campaign_mission].notes);
convert_multiline_string(str, Campaign.missions[Cur_campaign_mission].notes);
box = (CEdit *) Campaign_tree_formp->GetDlgItem(IDC_HELP_BOX);
if (box)
box->SetWindowText(str);
@@ -745,10 +751,11 @@ int campaign_tree_view::add_link(int from, int to)
Links[Total_links].from = from;
Links[Total_links].to = to;
Links[Total_links].sexp = Locked_sexp_true;
Links[Total_links].mission_loop = false;
Links[Total_links].mission_loop_txt = NULL;
Links[Total_links].mission_loop_brief_anim = NULL;
Links[Total_links].mission_loop_brief_sound = NULL;
Links[Total_links].is_mission_loop = false;
Links[Total_links].is_mission_fork = false;
Links[Total_links].mission_branch_txt = NULL;
Links[Total_links].mission_branch_brief_anim = NULL;
Links[Total_links].mission_branch_brief_sound = NULL;
Total_links++;
if (from != to) {
Elements[from].from_links++;
+5 -4
View File
@@ -28,10 +28,11 @@ typedef struct campaign_tree_link {
int node; // node tracker when link is in sexp tree window
int from_pos; // from link drawing offset
int to_pos; // to link drawing offset
bool mission_loop; // whether link leads to mission loop
char *mission_loop_txt; // text describing mission loop
char *mission_loop_brief_anim; // filename of anim to play in the brief
char *mission_loop_brief_sound; // filename of anim to play in the brief
bool is_mission_loop; // whether link leads to mission loop
bool is_mission_fork; // whether link leads to mission fork
char *mission_branch_txt; // text describing mission loop
char *mission_branch_brief_anim; // filename of anim to play in the brief
char *mission_branch_brief_sound; // filename of anim to play in the brief
CPoint p1; // coordinates of line last draw for link, from p1 to p2
CPoint p2;
} campaign_tree_link;
+18 -151
View File
@@ -7,142 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/CampaignTreeWnd.cpp $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Campaign display tree window code. Works very closely with the Campaign editor dialog box.
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2006/01/11 04:46:17 phreak
* Some campaign editor fixes:
*
* Filebox is initialized upon opening the window
* Campaign will save to directories other than /data/missions/ or /mod/data/missions
*
* Revision 1.4 2003/03/03 04:15:24 Goober5000
* FRED portion of tech room fix, plus some neatening up of the dialogs
* --Goober5000
*
* Revision 1.3 2003/01/14 04:00:15 Goober5000
* allowed for up to 256 main halls
* --Goober5000
*
* Revision 1.2 2002/08/15 01:06:34 penguin
* Include filename reorg (to coordinate w/ fs2_open)
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 3 1/07/99 1:52p Andsager
* Initial check in of Sexp_variables
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:00p Dave
*
* 27 9/16/98 3:08p Dave
* Upped max sexpression nodes to 1800 (from 1600). Changed FRED to sort
* the ship list box. Added code so that tracker stats are not stored with
* only 1 player.
*
* 26 8/19/98 9:46a Hoffoss
* Added some 'save first?' type checks to the campaign editor.
*
* 25 5/26/98 2:32p Hoffoss
* Made campaign editor come up with a new campaign instead of loading
* built-in one.
*
* 24 5/22/98 1:06a Hoffoss
* Made Fred not use OLE.
*
* 23 4/14/98 11:55a Allender
* add end-of-campaign sexpression to allow for mission replay at the end
* of campaigns
*
* 22 3/31/98 12:23a Allender
* changed macro names of campaign types to be more descriptive. Added
* "team" to objectives dialog for team v. team missions. Added two
* distinct multiplayer campaign types
*
* 21 3/18/98 10:38p Allender
* added required "num players" for multiplayer missions. Put in required
* "num players" for multiplayer campaigns. Added campaign editor support
* to determine "num players"
*
* 20 2/24/98 10:23a Johnson
* Fixed up some build bugs caused by a multiplayer struct removal.
*
* 19 12/19/97 10:29a Allender
* made initial status windows appear on top of campaign editor window
* instead of Fred main window
*
* 18 12/18/97 5:11p Allender
* initial support for ship/weapon persistence
*
* 17 12/02/97 5:29p Johnson
* Fixed bug in branch sexp error checking. Was using link number instead
* of mission number.
*
* 16 11/22/97 3:05p Allender
* support for new fields for multiplayer in campaign editor
*
* 15 9/16/97 4:19p Jasen
* Fixed a bug in Fred with Campaign mode.
*
* 14 9/01/97 6:31p Hoffoss
* Added remaining missing features to campaign editor in Fred.
*
* 13 8/14/97 11:54p Hoffoss
* Added more error checking to Campaign editor, and made exit from
* Campaign editor reload last mission in Fred (unless specifically
* loading another mission).
*
* 12 8/13/97 5:49p Hoffoss
* Fixed bugs, made additions.
*
* 11 8/13/97 12:46p Hoffoss
* Added campaign error checker, accelerator table, and mission goal data
* listings to sexp tree right click menu.
*
* 10 7/09/97 2:28p Hoffoss
* Fixed bug with adding new links, and made campaign general info update.
*
* 9 5/15/97 12:45p Hoffoss
* Extensive changes to fix many little bugs.
*
* 8 5/14/97 12:54p Hoffoss
* Added sexp tree for campaign branches, branch hilighting, and branch
* reordering.
*
* 7 5/13/97 12:46p Hoffoss
* Added close campaign editor functions, changed global pointer to have
* capped first letter.
*
* 6 5/13/97 11:13a Hoffoss
* Added remaining file menu options to campaign editor.
*
* 5 5/13/97 10:52a Hoffoss
* Added campaign saving code.
*
* 4 5/09/97 9:50a Hoffoss
* Routine code check in.
*
* 3 5/05/97 9:40a Hoffoss
* Campaign editor begun.
*
* 2 5/01/97 4:11p Hoffoss
* Started on Campaign editor stuff, being sidetracked with fixing bugs
* now, though, so checking it for now.
*
* $NoKeywords: $
*/
#include "stdafx.h"
#include "FRED.h"
@@ -155,9 +20,9 @@
#include "MissionSave.h"
#include "InitialShips.h"
#include "mission/missionparse.h"
#include "parse/parselo.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
@@ -381,7 +246,7 @@ void campaign_tree_wnd::OnCpgnFileNew()
Campaign.filename[0] = 0;
Campaign.num_missions = 0;
Campaign.num_players = 0;
strcpy(Campaign.name, "Unnamed");
strcpy_s(Campaign.name, "Unnamed");
Campaign.desc = NULL;
Campaign_tree_viewp->free_links();
Campaign_tree_formp->initialize();
@@ -509,9 +374,9 @@ int campaign_tree_wnd::error_checker()
return 0;
}
int campaign_tree_wnd::error(char *msg, ...)
int campaign_tree_wnd::error(const char *msg, ...)
{
char buf[2048];
SCP_string buf;
va_list args;
g_err++;
@@ -519,15 +384,16 @@ int campaign_tree_wnd::error(char *msg, ...)
vsprintf(buf, msg, args);
va_end(args);
if (MessageBox(buf, "Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDOK)
nprintf(("Error", buf.c_str()));
if (MessageBox(buf.c_str(), "Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDOK)
return 0;
return 1;
}
int campaign_tree_wnd::internal_error(char *msg, ...)
int campaign_tree_wnd::internal_error(const char *msg, ...)
{
char buf[2048], buf2[2048];
SCP_string buf, buf2;
va_list args;
g_err++;
@@ -536,9 +402,10 @@ int campaign_tree_wnd::internal_error(char *msg, ...)
va_end(args);
sprintf(buf2, "%s\n\nThis is an internal error. Please let Hoffoss\n"
"know about this so he can fix it. Click cancel to debug.", buf);
"know about this so he can fix it. Click cancel to debug.", buf.c_str());
if (MessageBox(buf2, "Internal Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDCANCEL)
nprintf(("Error", buf.c_str()));
if (MessageBox(buf2.c_str(), "Internal Error", MB_OKCANCEL | MB_ICONEXCLAMATION) == IDCANCEL)
Int3(); // drop to debugger so the problem can be analyzed.
return -1;
@@ -546,7 +413,7 @@ int campaign_tree_wnd::internal_error(char *msg, ...)
int campaign_tree_wnd::fred_check_sexp(int sexp, int type, char *msg, ...)
{
char buf[512], buf2[2048], buf3[4096];
SCP_string buf, sexp_buf, error_buf;
int err = 0, z, faulty_node;
va_list args;
@@ -561,17 +428,17 @@ int campaign_tree_wnd::fred_check_sexp(int sexp, int type, char *msg, ...)
if (!z)
return 0;
convert_sexp_to_string(sexp, buf2, SEXP_ERROR_CHECK_MODE);
sprintf(buf3, "Error in %s: %s\n\nIn sexpression: %s\n\n(Error appears to be: %s)",
buf, sexp_error_message(z), buf2, Sexp_nodes[faulty_node].text);
convert_sexp_to_string(sexp_buf, sexp, SEXP_ERROR_CHECK_MODE);
truncate_message_lines(sexp_buf, 30);
sprintf(error_buf, "Error in %s: %s\n\nIn sexpression: %s\n\n(Error appears to be: %s)", buf.c_str(), sexp_error_message(z), sexp_buf.c_str(), Sexp_nodes[faulty_node].text);
if (z < 0 && z > -100)
err = 1;
if (err)
return internal_error(buf3);
return internal_error(error_buf.c_str());
if (error(buf3))
if (error(error_buf.c_str()))
return 1;
return 0;
+4 -73
View File
@@ -7,76 +7,7 @@
*
*/
/*
* $Logfile: /Freespace2/code/FRED2/CampaignTreeWnd.h $
* $Revision: 1.1 $
* $Date: 2006-01-19 02:27:31 $
* $Author: Goober5000 $
*
* Campaign display tree window code. Works very closely with the Campaign editor dialog box.
*
* $Log: not supported by cvs2svn $
* Revision 1.3 2005/07/13 02:40:50 Goober5000
* remove PreProcDefine #includes in FRED
* --Goober5000
*
* Revision 1.2 2004/09/29 17:26:32 Kazan
* PreProfDefines.h includes for fred2
*
* Revision 1.1.1.1 2002/07/15 03:10:53 inquisitor
* Initial FRED2 Checking
*
*
* 2 10/07/98 6:28p Dave
* Initial checkin. Renamed all relevant stuff to be Fred2 instead of
* Fred. Globalized mission and campaign file extensions. Removed Silent
* Threat specific code.
*
* 1 10/07/98 3:01p Dave
*
* 1 10/07/98 3:00p Dave
*
* 12 12/18/97 5:11p Allender
* initial support for ship/weapon persistence
*
* 11 8/14/97 11:54p Hoffoss
* Added more error checking to Campaign editor, and made exit from
* Campaign editor reload last mission in Fred (unless specifically
* loading another mission).
*
* 10 8/13/97 5:49p Hoffoss
* Fixed bugs, made additions.
*
* 9 8/13/97 12:46p Hoffoss
* Added campaign error checker, accelerator table, and mission goal data
* listings to sexp tree right click menu.
*
* 8 5/15/97 12:45p Hoffoss
* Extensive changes to fix many little bugs.
*
* 7 5/14/97 12:54p Hoffoss
* Added sexp tree for campaign branches, branch hilighting, and branch
* reordering.
*
* 6 5/13/97 12:46p Hoffoss
* Added close campaign editor functions, changed global pointer to have
* capped first letter.
*
* 5 5/13/97 11:13a Hoffoss
* Added remaining file menu options to campaign editor.
*
* 4 5/13/97 10:52a Hoffoss
* Added campaign saving code.
*
* 3 5/09/97 9:50a Hoffoss
* Routine code check in.
*
* 2 5/01/97 4:11p Hoffoss
* Started on Campaign editor stuff, being sidetracked with fixing bugs
* now, though, so checking it for now.
*
* $NoKeywords: $
*/
/////////////////////////////////////////////////////////////////////////////
// campaign_tree_wnd window
@@ -96,8 +27,8 @@ public:
public:
int error_checker();
int fred_check_sexp(int sexp, int type, char *msg, ...);
int error(char *msg, ...);
int internal_error(char *msg, ...);
int error(const char *msg, ...);
int internal_error(const char *msg, ...);
int save_modified();
// Overrides
@@ -137,4 +68,4 @@ public:
extern int Mission_filename_cb_format;
extern int Campaign_modified;
extern int Bypass_clear_mission;
extern campaign_tree_wnd *Campaign_wnd;
extern campaign_tree_wnd *Campaign_wnd;
Loaded 100 of 1041 files, more files were not shown because too many files have changed in this diff. Show more