Compare commits

..
Author SHA1 Message Date
WMCoolmon 64c9dc8035 Quick patch to optimize camera code, and fix it when being used by any camera which does not use the internal movement code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4495 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:11 +10:00
WMCoolmon dedd2675cc Update MSVC2003 project to compile with TrackIR and objectshield.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4494 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:11 +10:00
WMCoolmon e84fe6d790 Add objectshield.h and include it in files that require it.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4493 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:11 +10:00
WMCoolmon 9857ae0024 Camera code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4492 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:11 +10:00
WMCoolmon 261e63e5f8 Project file updates and minor code corrections.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4491 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:11 +10:00
Backslash 5d46f6c04d Freelook, Target padlock and TrackIR patch by Swifty. Very nice! Don't forget to add code/io/trackir.* to your projects!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4464 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:11 +10:00
karajorma 65a15a5e2e Fix Mantis 1608 Fix a multiplayer issue with the force-jump SEXP
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4462 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 5a60516c6c fix Mantis #1592
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4447 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 19a730d1e2 this is dumb; I didn't even use the formula correctly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4446 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
WMCoolmon 21a5630941 Minor scripting optimization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4445 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
taylor b54e6a922d set eol-style to LF for all code set eol-style to CRLF for MSVC6 project files (since Windows needs it this way to load them)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4431 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Backslash e694c912b8 Mantis #0001488. The cases are depreciated, wouldn't compile using newest SDK.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4425 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
taylor dc01529ee6 remove old ignore files from CVS conversion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4409 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Backslash a805967dd5 Bump MAX_MISSION_EVENTS and MAX_WINGS limits. Ideally someone can make this dynamic later... maybe me when I have time to learn how.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4405 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 fb1c494671 allow FS1 hud to be displayed in FS2 (many thanks to the icculus project for blazing the way)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4403 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
karajorma 8bf41749cb Fix for Mantis 1150
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4402 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 fab0ca5b42 implement the targeting cutoff properly (Mantis #1468)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4401 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 514e823ed4 we all got led down the garden path there! revert all radar range modifications
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4400 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
karajorma 04b04ee57a Fix for Mantis 1516
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4399 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 99238ea308 back out the MOI fix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4397 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Goober5000 ef2f939ca3 warn users when they run a campaign under the wrong mod
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4396 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
Backslash 15c3ea8cf3 Fixed set-object-speed sexps. Thanks for the inspiration, Keldor!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4395 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
karajorma 415556e4cb Add SEXPs for determining the players score and how many respawns they've used.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4393 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:10 +10:00
wmcoolmon 55980eac46 hud_get_draw()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4389 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon 4ec02c6d3c Ze Viewer_pos...it does nothing!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4388 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
karajorma e25ae6472e Catch-up update. This stuff is all in 3.6.9 but somehow missed being added to HEAD.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4385 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
turey 374e1432e6 Added Fiction Viewer files to project.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4380 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
turey 7387e285a3 Small fix for sim hull stuff.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4379 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
Backslash 58bf8dd55c Glide When Pressed key works now! Also, a fix to the engine sound so that it stops playing when the throttle is at 0. (It used to just stop looping -- but in BtRL for example the sound is 20 seconds long.)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4378 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
karajorma 5e12fd27ba Fix the Number Used in Wings display in FRED so that it does what V probably intended it to do all along.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4376 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon 1e0307b61d Move the camera functions into the 'mission' library
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4375 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon 1b7e1aecc0 Maybe-catch an interesting crash upon attempting to revert a mission with no cargo.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4374 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon 4710959a39 Handle missing ship model files more gracefully
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4373 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
karajorma 01ada43c1a Unbreak FRED compiling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4372 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
karajorma f63189dbf4 Fix the Run Freespace option in FRED
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4369 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
Goober5000 911ebf66f3 patch hole in the state machine fix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4368 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
Goober5000 3ee782f7d7 catch invalid bounding boxes caused by buggy POF editors ;)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4367 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
Goober5000 e2d1ceef10 watch out for bad MOI values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4366 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon 335be306e7 MOI access
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4361 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon b9c8026e7c More script-eval functionality; additional matrix functions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4360 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:09 +10:00
wmcoolmon aded7bb83d Fix script-eval and script-eval-num
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4359 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon e471f76e55 - Asteroid, debris, and ship collision damage type support - Scripting system variable-setting optimizations - Standardize override style - Reinstate "Self" variable for HUD - Automatic drawString moving-to-next-line - Visible subsystem name can be changed through scripting; will not be changed in the log - Fix many for-loop signed/unsigned warnings related to size() - Asteroid, debris scripting collision handling - Many, many additional Lua functions and variables - Fix the dreaded random-Lua-parse-crash bug - Fix struct array malf-ups due to flag_def_list change
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4356 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 6e13b68f0f Improved nonwindows Lua errors
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4355 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 0f3837e912 Update MSVC2003 project files & fix debugging
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4354 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 04b11e5287 weapon_armed update
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4353 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon f6d9674386 Detect and warn when bad axis readings are loaded from a pilot file (Causes crashes on axes_values[Axis_map_to[i]] in control_get_axes_readings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4352 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 65297de89d Misc. fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4351 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 261b1382f3 Fix array malfup due to flag_def_list change
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4350 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon cb93063b38 Fix un/signed warnings related to size(), optimize Knossos-finding
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4349 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon c3d3086ab2 Fix un/signed warning due to size()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4348 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 0c528cc407 Fixed array size, as it looks like it has to be the say as NUM_JOY_AXIS_ACTIONS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4347 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon 3d61e11c46 Updated event editor with minihelp box and numbered icons
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4346 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
wmcoolmon abb234c7ef Fix compiling under HEAD branch.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4345 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
taylor b4869d3e1c oops! not ready to commit that part just yet :D
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4343 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
taylor fda165df72 bump node allocation increment (when you are regularly realloc'ing 20-30 times, the increment is too low :))
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4342 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
taylor d16027d228 better case for making sure that a missing ship anim doesn't lead us to a horrible death minor cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4340 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:08 +10:00
taylor 075cb7f7b1 fix some missing cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4339 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor b087f8d0bb fix campaign is missing then give player choice to switch campaigns, switch pilots, or exit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4338 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor 753b652768 no reason to if-else the hud multiplier if it simply defaults to 1.0 add a little sanity checking for hud mutiplier tbl value
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4336 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor 255cb9138e try to deal better with gamma setting/resetting when minimizing/restoring the game (Mantis #1210)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4335 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor 12909598bb minor fixes and cleanup for the warp effect change scale of 3D warp effect to better match up with size of 2D effect
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4333 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor f494fdfef8 add/remove some old, forgotten, and new files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4332 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor b05f3d047a initial support for cursors that are larger than 32x32 fix bug where animated cursors would be constantly loaded/unloaded
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4331 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor b6b52c8ad4 cleanup/fixage for fade in/out function (Mantis #1186)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4330 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
taylor 4b9dca98b5 be sure that we hide the game's mouse cursor (Mantis #1401)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4329 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 40120210a4 add Wing Commander Saga's fiction viewer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4328 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
turey b216447ebe minor bugfix.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4327 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 4b89a0662d fix ship-type-destroyed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4326 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 dd438fb032 recognize a Vasudan main hall even when it isn't the second one; play the appropriate music as soon as the main hall switches
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4325 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 7db8d3d94a clean up the state machine logic for starting games
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4324 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 18e8d1a8b1 some minor enhancements to the skip mission cheat
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4323 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 005df60d13 remove warning... properly this time
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4322 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 f4a6d80099 clarify what this flag is actually for
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4321 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 8fdf299567 add the merge_stats debug function (use with caution)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4320 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:07 +10:00
Goober5000 ec79947e07 fix for Mantis #1503
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4318 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
Goober5000 89cb83573c gak -- stupid mistake
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4317 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma a8e6d242bc Fix peristent variables in missions played from the techroom
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4316 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
taylor 3d09f1c523 fix out-of-bounds issue from retail (Mantis #1518)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4314 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma 8ed8425998 This is better than the other way.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4313 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma 5417c5077f Make Ships_Exited Dynamic. Add the hits-left-single-subsystem and get-damage-caused SEXPs. Minor changes to make diffing 3.6.9 and HEAD easier.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4295 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
taylor da8f890f04 reset Perspective_locked at the start of each mission so that view controls don't get locked until exit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4294 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
phreak e902bd2a93 Get rid of 1-letter and non-descriptive variable names.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4293 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
phreak c4ce741093 'phreak' is now all lowercase (and has been for some time now)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4292 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
Goober5000 dfe665c398 fix a minor bug in the dockpoint system (affects sm2-07a in the Port)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4291 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma dcdde0189c Typo
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4282 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma 336b0fa9ef Doh!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4279 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
taylor dab646c183 fix bugs in beam-*-all and turret-*-all that made them always trigger an Int3()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4278 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
taylor 084edcf6e1 get rid of some old/obsolete items (Mantis #1489 and #1497)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4277 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
Goober5000 d0c1a09a1f another fix by razorjack... parent is -1 when created by sexp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4276 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
Goober5000 d2affec465 another patch by razorjack -- remove something that never worked
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4275 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
Goober5000 f717777f7c a bugfix by razorjack
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4274 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma f3a043668c Fix x-builtin-messages so that the Any Wingman option works
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4273 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:06 +10:00
karajorma 5e50d91dee Upgrade the beam-x-all and turret-x-all SEXPs to accept more than one ship. Add the allow-treason SEXP
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4272 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
karajorma 8b36c5bd6d Fix the double respawn bug (Mantis 788) and hopefully the corresponding server Int3 (Mantis 1213)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4270 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
turey 181edcb916 Mouse defaults to enabled as suggested in Mantis bug: http://scp.indiegames.us/mantis/view.php?id=1498
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4268 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
turey bbfaf12314 Final fix for mantis bug: http://scp.indiegames.us/mantis/view.php?id=1482 There should be no more occurrences of campaign missions being skipped.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4267 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
turey 4ff88a9e70 "no primary linking" ship flag and related SEXPs - prevent a ship from linking primaries.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4266 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Backslash 01b0fb3e5d Whoops, missed a couple lines for Length Unit Multiplier
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4265 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
turey 76a8de9cc7 More fixes related to Lua's waypoint lists.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4264 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
turey 106346a1a1 Fixes related to Lua's asteroids, debris, and waypoints.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4263 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
turey 30cc25e7ee More work on Mantis bug: http://scp.indiegames.us/mantis/view.php?id=1482
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4262 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 7d442047bf fix the factoring on the shudder parameters (Mantis #1419)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4261 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 b036d1049b re-add the code to disable the Windows key... this time, without slowing the system to a crawl when FSO is in the background
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4260 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 262c1dd37c roll back the windows key hook for now
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4259 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 fb6df00c0f fix for 1376
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4258 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 98f59f6c8b fix for 1471
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4257 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 4b3d619d71 Shade's fix for #1329 (approximately)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4256 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Goober5000 2c6cb674ee fix for #1455 plus a bit of cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4255 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:05 +10:00
Backslash 65cbbcd31d 2005 Project file cleanup. Changed a lot of paths to compiler macros. Also gave Freespace2 project the inherited property sheet CoreWin.vsprops -- this lets Express Edition compile!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4254 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Backslash 90b70a027a (code by KeldorKatarn) Reactivated HUD_ship_sent_printf to enable more flexible handling of ship names in displayed messages. Added functionality for WCSaga to use class name instead of ship name for enemy wings.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4253 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Goober5000 d68a225582 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4251 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
turey add1b9aba7 Extensions to Lua system regarding asteroids, debris, and waypoints. They're not heavily tested, but I haven't seen any crashes from them.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4250 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
turey 9d98120dc8 Fix for Mantis bug: http://scp.indiegames.us/mantis/view.php?id=1482 Also, fixed an implicit cast that MSVC2005 choked on.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4249 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Backslash 39365af0ce The long-awaited HUD $Length Unit Multiplier setting! (With lots of help from KeldorKatarn) Multiplies all speeds and distances displayed by the HUD by a given constant multiplier. The value is declared in hud_gauges.tbl (right after $Max Escort Ships) as $Length Unit Multiplier: 5
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4248 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
phreak eb9ab4c957 destroyed-or-departed-delay needs to check for ships that have self destructed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4247 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
phreak a1dda42d98 Add WINVER define to the VC2005 project file so it shouldn't affect users of other compilers.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4246 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Goober5000 fc0bb54541 tweaky move
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4245 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
karajorma bc0ecc1448 Fix for Mantis 1234
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4244 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Goober5000 6d87070b5f bring wxFRED project files up to date
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4243 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Goober5000 373d80684f bring sexp into conformance with other sexps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4242 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
Goober5000 613f761043 generalize the way radar ranges are handled (inspired by Shade's fix)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4241 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
phreak 0f1f2ae2f3 Local SSMs shouldn't jump into subspace if they're not homing.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4240 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
turey 6feabed6c2 Typo fixed.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4239 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:04 +10:00
turey 17c73dd526 set-object-position and set-object-orient now work in multi.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4238 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 1995414e3a okay... let's not redefine the Windows version
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4237 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 62b34a766f disable the Windows key while FreeSpace is running (thanks to jr2) c.f. http://www.hard-light.net/forums/index.php/topic,48838.0.html
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4234 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 fff1530e21 some improvements to the pirate ship
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4233 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 a4ac56cf7b some tweaks for a field that's mostly unused anyway
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4232 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 13d4be980f fix case-sensitive #include (Linux)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4231 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
karajorma 44976923a0 Reinforcements Editor bug fixed Sucka!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4230 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 b5e265d20c fix compile error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4228 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 a9cc12985f fix warning
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4227 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 b0af8dd641 fix compilation issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4226 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
turey a5084fc0fb Scales GUI Mouse movements correctly for non-standard resolutions. Doesn't affect gameplay.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4225 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 a197ab3091 allow embedded dashes in command-line options
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4224 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
karajorma e0ac7eff67 Apparently I forgot to commit this to HEAD. Fixes Mantis 1437
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4223 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 3a34bf48bb tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4222 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 6c0dadb095 this should really be capitalized
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4220 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:03 +10:00
Goober5000 c03d5dde04 make the parse object array dynamic; also made the docking bitstrings dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4219 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Goober5000 6c90a9a07c a couple of tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4218 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Goober5000 591d19c15a AAAAAAAAAAAAAAAAAAAAAAAAAHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH!!!!!!!!!!!!!!!!!!!!!!!!!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4217 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan b3580f8407 I <3 making stupid bugs (return camera to normal when not using cutscene bars)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4215 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan 32278008a6 two-part autopilot warp, add +No_Cutscene_Bars optional flag to autopilot.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4214 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan 0a3ec374d9 small tweak
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4213 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan dedb59494c oops
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4212 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan 1d4bed9485 Make asteroid/debris fields interrupt autopilot, add "hazards near" message to autopilot.tbl, add use-nav-cinematics sexp, fix mantis #1441
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4211 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan 5d9b38e398 Resolve Mantis 1281
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4209 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Goober5000 67ca65ff73 allow mission messages in dogfights (Mantis #1436)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4208 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan 09cd4c1ad9 Resolve Mantis #1440
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4207 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan 1c1c90a7a4 remove unused function... unused function that should probably never be used
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4205 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan dd0f8213a7 copy+pasted typo, now with extra hotsauce
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4204 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:02 +10:00
Kazan f8f1d4ac08 typo correction in autopilot.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4203 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:01 +10:00
Kazan d0884812ce Autopilot upgrades as described, MSVC2005 project fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4202 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:01 +10:00
turey f2d84f3283 Small bugfix relating to restoring engines from disabled via the set-subsystem-strength SEXP.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4201 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
turey b2ef36d883 Made Backslash's change to dampening tied to an ai_profiles flag, as it does affect retail behavior, and significantly affects gameplay in the BtRL Demo. Also, fixed a typo.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4200 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
turey 92039aa55a Small change to how Simulated Hull works. If ship is gone, it now has 0 Simulated Hull.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4199 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 f1693080a3 Kazan's VC2k5 project file fix (HEAD only)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4198 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 ca0f5f0515 Kazan's autopilot fix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4197 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 6c4c0493fc fix and clean up the warpout conditions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4196 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 9bcb844f0b restore WMC's ship flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4195 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 d1915ce351 fix extremely minor bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4194 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 31d71cd1d2 partial commit of aldo's eyepoint feature it will need a keystroke to be complete
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4193 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 415f273e07 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4192 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 7cd3fbf2ef fix a newline bug in the voice acting manager
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4191 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
turey 56c871d49d Initial commit of Training Weapons / Simulated Hull code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4190 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
turey d011acdc74 Truefire weapons code, adds firing ship's velocity to weapon velocity for a more realistic firing, especially during glide. Activated with the "truefire" flag on a weapon.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4189 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
turey daa90a1d31 Ship Template fixes. It's fully working now, hopefully.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4188 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
turey e7037aabb1 Fixed MSVC2005 Project. Debug Config compiles fine, still working on Release config. One file needs to be renamed for these to work, see the README.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4187 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
Goober5000 68d5c461e2 fix an off-by-one error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4186 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:43:00 +10:00
taylor 15093f3772 convert to LN EOL
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4184 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
Backslash 90e0a6a730 Cutscene subtitle positioning fix for resolutions other than 1024x768. Code by MikeStar.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4183 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
turey 008a9a58b5 Fixed some silly little bugs that somehow slipped through the cracks.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4182 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
karajorma 01351fee82 Fix an issue with single character command line arguments
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4181 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
turey 1aea32bff4 Added in Ship Templates code, with some syntax and warning cleanup.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4179 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
Backslash 283ae2dcca Backslash's HEAD-only controls commit: -Lateral thruster axes -Slide_when_pressed -Placeholders for glide_when_pressed and more controls, to give us a little breathing room while we wait for the real pilot file code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4175 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 2610817c23 more resilient checking of stars.tbl and it's modular versions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4173 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor c624dc2a9b various bits of clean up make stats printing a bit more sane printf out game version info to debug log (not very helpful, but might prove some use)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4172 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 433cfa437e oops! the exit() was supposed to come /after/ the last printf() :)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4170 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor bf7075cc6a make the chcksum spew in logs always have a full 8-set of values skip over files found on system which are over the max filename length, prevents several crashes (partial for Mantis #1182)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4169 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 908da6af8c various bits of cleanup don't draw beam impact effect if we are hitting a shield updated hit shield quadrant properly for player when a beam hits set shield quadrant and exit_flag properly for collision info so that we don't count damage twice and handle no_pierce_shields properly
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4168 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 0e800d166a fix armor index bug for shockwaves
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4167 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 4978242f11 bump version to 3.6.10
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4166 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
Goober5000 9f9003e05e add placeholder stuff for parsing ship-class texture replacements
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4162 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
Goober5000 cb88594a81 when importing FS1 missions, account for the shuffled Head-TP4
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4160 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
Goober5000 a100ac10e0 the reinforcement comm menu will now correctly display according to whether or not reinforcements are available
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4159 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 2180e4a5c7 add the rest of the texture page-in code changes that I skipped before (should fix Mantis #1389)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4158 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 505b3fdb4d make Linux just verbally ignore invalid cmdline options rather than it being fatal
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4157 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:59 +10:00
taylor 5a1b975637 fix stupid bugs in CF_SORT_REVERSE (should be as originally intended now)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4152 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor 619a4f02f3 fix armor_parse_table() so that it will parse multiple entries properly fix bug introduced from not closing down lcl_ext after parsing armor.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4151 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
Goober5000 4622db3330 --grouped the shake/shudder code together a bit better --added a sexp to generate shudder --fixed a minor bug in lock-perspective
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4150 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor 6e1610b300 add session open/close times to debug log
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4149 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor f7e6d4fb1f properly handle invalid sound index case, fixes div-by-0 error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4148 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor 9ca28ed022 very minor optimization (mul is much faster than div)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4147 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor da9fe0065e fix debug message (using wrong name, spit out a bunch of garbage on Windows boxes)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4146 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor 436a019cd6 delete the .hdr file once we are done with it, since it's no longer useful
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4145 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
Backslash 1af66f99b1 Add feature to $Max Glide Speed -- negative number means no speed cap Only show gun muzzle flash effect if in not cockpit view, or if "show ship" flag is set Fix a couple typos ;-)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4144 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
Backslash f96579faa6 Fix tiny bug I introduced -- should use forward_decel_time_const, not slide_decel_time_const, for z Add feature to $Max Glide Speed -- negative number means no speed cap
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4143 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
Backslash 966e364b7c Backslash's big Gliding commit! Gliding now obeys physics and collisions, and can be modified with thrusters. Also has a adjustable maximum speed cap. Added a simple glide indicator. Fixed a few things involving fspeed vs speed during gliding, including maneuvering thrusters and main engine noise.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4142 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
karajorma 2659bbcb25 Doh! Missed the return type.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4141 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
karajorma 7fc983d4b6 Add the knock feature from Tom's build. Fix a number of places where the player of a dogfight game could end up in the standard debrief.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4140 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
karajorma 55e03513c3 Fix a number of places where the player of a dogfight game could end up in the standard debrief.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4139 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
karajorma be488b0f6a Remove the -fredhtl command line.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4136 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor a35201c87e add Linux friendly icon
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4134 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:58 +10:00
taylor 699c125aa8 only add player-allowed flag on #Weak weapons when their non-weak versions also have the flag (Goober #73)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4133 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 045efc90a5 little cleanup fix memory size fubar on trail vlist ptr
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4132 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
Goober5000 1b8fd941cf fixed a silly speech bug (Mantis #1238)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4131 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 10d09ff3d1 cleanup and initialize persona_index properly for general safety reasons slight change to karajorma's NO_BUILTIN_MESSAGES check, now it will be properly compiled away in release builds rather than an empty function
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4130 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor c659d8f50b use qsort() instead of insertion_sort() for light sorting, it should be better optimized and quicker in general for this use
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4129 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor b466ed13c2 some basic cleanup for the extension code fix the old bug that didn't report a missing extension name properly get rid of the message that says to use D3D, that's not normally going to be an option anyway add ARB_point_sprite support, mostly for fun since no code will actually use it until after 3.6.10
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4128 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 3568dfd184 clean out some old code we no longer use/need change warning messages to not print out current tbl name, since at the point those messages show the tbl has long since been parsed add an extra quick-check to ship_get_subsystem_strength() to avoid div if we don't need it make Ship_subsystems[] dynamic (sort of), it's allocated in sized sets now, so we can easily change size while still working with the existing linked-list code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4127 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 1819e1ead6 cleanup of chksum 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)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4126 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 2aeade2140 cleanup error message allow launch_snd from tbl to be used for beam weapon shot sound (Mantis #1263)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4123 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor e82ac5f2e1 add modular version of strings.tbl (*-lcl.tbm) (provides for Mantis #924)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4122 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 4c9c897094 bm_unload_fast() should only unload the bitmap passed for animations, not the entire animation (fixes several issues)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4121 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 9530163e34 get rid of stale NO_JOYSTICK define
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4120 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor cedb6ddc89 add extra safety check to make sure that we are going to do a wildcard search for modular tables
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4119 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
taylor 2085a4da87 get rid of (now) unused variables
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4118 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
karajorma c53e12f566 Fix for Mantis 1312
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4112 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
karajorma 5d56a96f30 Fix .wav playback in the briefing editors.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4111 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
karajorma aab6ad507a Friendly stealth ships shouldn't give away their position just cause they send a message.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4109 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
karajorma 50f9747548 Changed my mind This is an Int3() not an assertion
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4108 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
karajorma 62f2ff9f7e Prevent ships from jumping out in glide mode (They'd probably never get up to speed anyway)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4107 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:57 +10:00
karajorma a6bece03cd Fix a bug where gliding ships couldn't jump out. Remove a couple of magic numbers.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4106 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
karajorma cd045d745f A couple of minor fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4105 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
karajorma 52660f8170 I could have sworn I committed this! Anyway, make the wingman complain when you shoot them instead of command. Send traitor messages from wingmen if command is silenced.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4097 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
Goober5000 e4a52bf29d meh, space
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4096 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
Goober5000 ef8aaa498f fixed up some error messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4095 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
Goober5000 1aa2189dd9 tweak
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4094 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
karajorma abe12ea9ca Fix assertion on red-alert carry status in multi games
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4093 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 183bfa7e54 fix breakage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4091 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 9cf236972b bit of cleanup and minor performance tweaks sync up with new generic_anim/bitmap and weapon delayed loading changes with generic_anim, use Goober's animation timing for beam section and glow animations make trail render list dynamic (as well as it can be)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4090 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 4ab2a0d1af bit of cleanup and minor performance tweaks render ship insignia with a bit of alpha to help with blending/lighting dynamic thruster particle limits update for generic_bitmap/anim changes make use of flag_def_list for ship flags rather than a ton of if-else statements use generic_bitmap and generic_anim where possible to faciliate delayed graphics loading (after all ship related tbls are parsed) use VALID_FNAME()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4089 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 09c5e7a21e get rid of non-standard itoa(), make use of the proper sprintf() instead
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4088 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 9a69092e50 add back special "var" setting for flag_def_list and convert some of the lists to use it (more on the way)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4087 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor ba590e029d get rid of non-standard itoa(), make use of the proper sprintf() instead
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4086 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 020e7c841d some generic_bitmap fixes to go with new changes (not in CVS just yet, don't freak out) make use of VALID_FNAME() where possible fix an animation time issue (sub-second animation playback caused div-by-0)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4085 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 78922b1428 fix issue where the lab menu bar would disappear at times when you click on it (Mantis #1063)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4084 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:56 +10:00
taylor 12021bae4c forgot to remove -jpgtga from Launcher options previously get rid of -fixbugs and -nocrash crap
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4083 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 14dfa85b36 give a better msg when movies can't play because they are user-disabled with the cmdline option
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4082 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 8841ade91d bump version to 3.6.10, it will be needed for new texture replacement stuff (tbl version commenting)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4081 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 4501140263 some generic code cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4080 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor a237b61f5c make sure that we set/reset the red alert data properly (Mantis #1255)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4079 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 9bd345fcf1 cleanup and fix for weapon cycling (Mantis #1298)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4078 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 8ea4793841 be sure to page in textures for change ship class sexp preload add a ASF_MENUMUSIC type for things that aren't mission-based event music (since that is handled differently now) make event music keep extension if it exists, so that the special data will be accurate bits of cleanup from old MS code that we don't need
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4077 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 2e98e39d71 a little cleanup handle issue where we don't deal with an error condition properly and hit a NULL ptr
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4076 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 366ce26724 fix stupidness that screwed up RGB values (Mantis #1307)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4075 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 45fb2f2189 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4074 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor c116a2170a various bits of bmpman cleanup be sure to clean all three possible buffers with OGL init fix a couple of bmpman loading bugs that messed up animations fix bmpman bug that didn't properly account for free'd texture ram count with unload_fast
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4073 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 0ccf57a648 old ✌️ snafu
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4072 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 51dc9f37db when parsing a modular tbl, allow a duplicate sun entry to overwrite an existing one
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4071 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor bb87b7c6b8 little bit of cleanup set "#Weak" weapons to always get the "player allowed" flag (Mantis #1301)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4070 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
taylor 2fa81b72f2 make use of generic_anim and generic_bitmap where possible bunch of cleanup and little optimizations add "+remove" tbl option to completely get rid of particular beam sections delayed loading of bitmaps, will only do it after all tbl/tbm have been parsed if we are using a POF missile which isn't loaded yet, try and load it before going crazy bug fix and optimization for laser color setting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4069 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
karajorma 6b7e03405a Bump the number of debriefing stages. Fix an annoying (and erroneous) warning in the campaign editor.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4066 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
karajorma d0435336d4 Turn off afterburner controls when player isn't in control
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4064 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
karajorma ad008469b4 Make .ogg voice files selectable in FRED.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4063 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
karajorma b027179525 It's perfectly legal to press the Target Target's Attacker key with no target. We should just play a failed sound instead.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4061 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:55 +10:00
Goober5000 53a0176712 might as well do this too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4060 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 7af751fcda add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4059 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 58a5a94a97 small bugfix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4058 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 7cf6c12bdd add model compare capability (currently only via debug console)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4057 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 1b60c99cd8 added vm_matrix_same()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4056 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 bec0f110b3 use dynamic memory instead of a static buffer for ship-specific replacement textures
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4055 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 10cfd130aa remove duplicate model texture replacement
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4054 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 1664133cf9 oops, this is for a future commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4053 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 9baae44f88 revert to retail behavior
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4051 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 aefb3efe15 the great big duplicate model removal commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4050 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:54 +10:00
Goober5000 e590e0c5ec *** empty log message ***
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4049 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
wmcoolmon 675428455b More minor tweaks/fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4048 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
wmcoolmon e5d14f09a3 More scripting tweaks/bugfixes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4047 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
wmcoolmon 4a5a3c4bf6 WMCoolmon experiences a duh moment. Move scripting collision variable declarations in front of overrides, to give them access to these (somewhat useful) variables
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4046 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
wmcoolmon 27a058a338 Fixed minor precedence issue.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4045 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 15001ef13e magic word
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4043 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 d9fb4b15b9 revert Bobboau's commits for the past two months; these will be added in later in a less messy/buggy manner
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4041 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 9efce92739 ugh... reverting this, because it was done wrong
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4040 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 80ef48e959 this should be based on a flag or something, not automatically tied into the power output
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4039 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 2f3fee1017 fixed another of bobboau's stupid bugs
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4038 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 b5a7b399db remove obsolete and misleading comments which should have been edited when the code was upgraded
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4037 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
karajorma 6884dc10a2 Thought I'd caught all of these months ago! Thanks to Wanderer for the heads up.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4036 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 3f131e532f uhh... wrong?
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4034 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Backslash a4243b6ac5 small fix for reverse thrusters, and a speed tweak. also a change to damp physics, discussed on the forums and reported in Mantis #1051 months ago.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4033 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:53 +10:00
Goober5000 48935df1ac Linux project file change (thanks to ni1s)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4032 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
phreak 9c0c2e16d3 Project file update for VC 2005. I included a new configuration called "ReleaseDebug" which has the NDEBUG macro found in release builds, but also has all the debugging information included. Regular release builds have no debugging information.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4031 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
phreak ed838bda36 Apparently Visual C++ 2005 follows standard syntax rules.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4030 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 d14355349e fix a hideous bug with the knossos special warp stuff (how did this ever actually work correctly?)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4029 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
taylor cfe438a40c fix stupid bug (Mantis #1275)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4028 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 9449cb7216 ack
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4023 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 099b35c497 scale shield strength according to generator damage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4022 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 c9d903f753 bah
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4021 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 82d858c834 fixage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4010 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 5f073b943c change a number to a constant
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4009 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 42ab4d6622 massive shield infrastructure commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4008 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
Goober5000 2f39ad1a2a fix some breakage ;)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4007 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
taylor 88fe40282f fix a couple of breaks from my commits
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4005 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:52 +10:00
taylor 4f34c8f764 cleanup and minor performance improvements add support for new fireball specific lighting values from tbl remove NO_SOUND
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4004 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 7c1187c46d general cleanup deal with -img2dds error issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4003 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor ebdbb35b5f remove cloakmap stuff, we'll need to redo this later on anyway deal better with a strange Windows buffer swap issue various bits of cleanup and performance improvements fix for gr_opengl_flash() that I had screwed up earlier
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4002 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 9d7f9624c9 support for a couple of recent bmpman changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4001 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 6c54e22b8c support for new finding/loading of sound files add support for automatically figuring out samples-per-measure based on Goober's explanation in the Wiki (not sure if it's actually right though) remove NO_SOUND
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@4000 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor f7c8e262a9 support for tbl specified fireball explosion color ("$Light color:")
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3999 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 0cc9741790 remove some dead code better texture memory handling (a work in-progress) new image finding/loading 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3998 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor ee04f5e5c0 some minor performance improvements remove NO_SOUND
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3990 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 96c7dbcbb6 dd VALID_FNAME() macro and put it around a few places (more to come) clean out some old variables move CLAMP() macro from opengl header to global header update COUNT_ESTIMATE to match new bmpman changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3988 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor d0ca7a13de 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3985 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor b35964c21b remove NO_SOUND fix debris recycling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3981 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 0f32d30d63 little bit of cleanup more fixage for hidden jumpnodes (Mantis #1149)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3980 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 2f0bd47bae fix simroom crash bug from Goober's rencent change add NULL handling to make sure we don't crap out on sorting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3978 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 9354b4e528 slight debug message fixage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3977 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
taylor 7677f53bdc if we are a dying ship then don't do collision detection against our own debris (slight performance boost to exploding ships)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3975 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
Goober5000 7d2f76b26e we probably don't need to play a sound when we equalize already-equalized shields, since we don't play one when we augment already-augmented quadrants
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3973 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:51 +10:00
Goober5000 b29a03e55c when alphabetizing campaigns, ignore "the" at the beginning of a title
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3972 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 b30ec50714 invert the do-collision flag into a don't-do-collision flag, plus fixed a wee lab bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3971 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 da15e932a4 fix spelling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3970 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor 5c5b2f7442 make sure that we don't set the 2d view matrix and then not reset it (Mantis #1269) clean up some of the fullneb mess that was causing some initial setup issues (colors wrong, etc.)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3969 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 50d2b9ae9b sort campaigns by title, not by file name
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3968 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 658b1e6024 new feature: shield generators that control whether the shield is up
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3967 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 ee0aecd193 take all subsystems into account when displaying repair gauge
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3966 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 6fc3e909ca prevent the AI from falling into the black hole of disarming a turretless ship
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3965 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 56508ee06f small tweak
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3964 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
Goober5000 53d16012a7 made support ship shield control a bit less of a hack
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3963 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor 1aa75f7edd remove NO_SOUND
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3962 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor a7ed006559 remove NO_SOUND fix glow bank sexp bug (Mantis #1250)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3960 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor dd6155a914 fix a mouse button issue (just an issue with newer SDL versions?)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3959 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor 7647ab45b3 a quick debug test to catch an error and FRED doesn't catch on it's own yet
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3958 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor 8857f0bf65 performance optimizations: - fvi_ray_boundingbox() is faster and should be less prone to compiler/optimization/platform specific issues - clean up or obj_check_all_collisions() which is a good bit faster now
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3957 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:50 +10:00
taylor 662f5bdc88 obsolete gluLookAt() in favor of doing it manually, should be slight faster and more precise
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3956 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
taylor b01999d2f0 performance/accuracy optimization for the (un)size functions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3955 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
taylor a14410b658 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3954 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
taylor bb8e5f257f add the "show all" hotkey to the cutscene viewer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3953 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
taylor f6763b8eaa add the number of files that CFILE is going to try and use in each root to the debug info optimizations for cf_find_file_location_ext()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3952 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
taylor e0bf5f25c5 add better support for Ogg, Vorbis and Theora libs/includes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3951 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 740e20f684 miniscule tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3949 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 e7456b1c43 bah, change this so it's mostly diff-compatible with 3.6.9
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3947 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 dbc95e47f1 add a few ship flags that weren't on the dialog
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3946 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 1164c1f7ab fix two bugs: --default ship flags in the iff_defs table were not correctly translated from parse flags to ship/object flags --ships were created with default allowed comm orders regardless of which team they were on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3945 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 6abfb88b50 hm, didn't notice this new feature
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3944 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 79c9d90938 Cleaned up the ship-weapon collision code for both conventional weapons and beams. Improved readability and clarity; untangled program flow; cleaned up sloppy enhancements. Fixed a few bugs too.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3943 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 1cc1dd77df remove obsolete and unused shield flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3941 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
wmcoolmon af9a49e02c Couple of commented-out features.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3940 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
wmcoolmon a38cc033a5 Make an error message prettier
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3939 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
wmcoolmon 39ab0db17d Fix a parse bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3938 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:49 +10:00
Goober5000 ce8831a49f fix an old subtle bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3937 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
phreak ceb55ef40e the particle batcher needs to work with static (non-animated) textures as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3936 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
Goober5000 14965a90b0 d'oh... thanks phreak
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3935 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
phreak b7d24781ac spawn weapons now have the option of passing a target lock onto their children.
http://www.hard-light.net/forums/index.php/topic,45166.0.html

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3934 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
phreak 8e08137e92 Committing what i have of the MSVC 2005 project files. FRED2 still isn't there yet, but I don't want to lose what I spent time on.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3933 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
Goober5000 c908adb515 fixed two of Bobboau's bizarre bugs
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3932 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
karajorma 9691112aa3 Well that's going to cause a few crashes (Thanks to ni1s for spotting it)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3931 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
phreak 16cb751909 We don't want to modify the clip plane variables in htl mode once we've moved them to gr_start_clip()
do we even need htl mode checks anymore?  welcome to the 21st century

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3930 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
phreak ff9ee24bf3 Do clip plane testing on thruster glows and thruster particles
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3929 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
phreak 7ef65ac239 memset() does not go array, length, value it goes the other way around
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3928 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
Goober5000 36bd4ca967 oops
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3927 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
Goober5000 338828a7c9 --fix the empty ship name / U.R.A. Moron bug caused by WMC's commit --properly update a ship score when its class changes (in FRED or via change-ship-class or via ship loadout)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3926 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
Goober5000 4da59a7059 minor tweaks to the reset score feature
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3925 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
karajorma 2521541fdc Fix add-remove-escort to actually use a priority. Add yet another missing bit of Network variable code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3924 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
Goober5000 ad95a28767 removed code that isn't used (see Mantis 1219)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3922 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
wmcoolmon 53810a1b76 EXPERIMENTAL turret update, housekeeping for Lua
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3921 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
wmcoolmon 199948f4cc Fix mantis bug; add getOrientation to CVS
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3920 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
wmcoolmon f7e5abbee4 Fix non-opaque circles.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3919 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:48 +10:00
karajorma 71e1654e33 Fix bug in the set ammo and weapon SEXPs Add the reset-orders SEXP Add support for network variables
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3918 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
karajorma 5bca4ce31b Fix bug where orders you gave last mission are sill accessible to the Order SEXP.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3917 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
karajorma 7237bec390 Hmmm. Forgot to commit changes to support network variables and setting ammo/weapons to HEAD as well as 3.6.9.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3916 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
karajorma 9b9dfb64e5 Hmmm. Forgot to commit changes to support network variables and setting ammo/weapons to HEAD as well as 3.6.9. Also add Juke's bug fix for streaming weapons.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3915 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon f8f3b2c9e7 Lua - fix one thing so you can break another.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3913 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon a3ec50ee2c Fix HookVariables-related stuff, and add errors in case it ever gets broken again.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3912 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon 6a0bdcb8c7 Maintain "fileless fs2" capability; change ScriptingVariables library to HookVariables(hv)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3911 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
bobboau b95880ac6b fixing some minnor errors with the batcher code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3910 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon e0d7eea877 Whoops, fix merge error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3909 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon 03d4e7b41b Finish off warning fixage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3908 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon e79d2934c6 Finish off warning fixage; standardized defines in MSVC_2003 project file
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3907 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
bobboau aea0422b0a fixing a thruster bug, a geometry batcher bug, and trying to fix a shield bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3905 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon ff8572af7d Fix CVS & correct various warnings under MSVC 2003
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3904 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:47 +10:00
wmcoolmon 475acdf495 Fix HEAD
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3903 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
Goober5000 761e430eba operator precedence FTW! :D
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3901 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
bobboau a3daa5ff3b ok, something aparently went wrong, last time, so I'm commiting again hopefully it should work this time damnit WORK!!!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3900 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
wmcoolmon de3145b479 Fix +Override, attempted fix for code adjacent to [] causing crash in scripting.tbl (Unreproducable), and (Untested) fix for script-eval.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3899 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
wmcoolmon 9405a8c1e2 Attempt to remove various warnings under MSVC 2003, mostly related to casting, but also some instances of inaccessible code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3898 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
wmcoolmon 9d8d5a3448 Updated MSVC 2003 project files to work out of the box
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3897 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
wmcoolmon 64e2faacea Removed MSVC_7 folder due to redundancy
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3896 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
bobboau 9404744602 made a last second change of mind on something, made it a bit safer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3895 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
bobboau b72b673efd left some test code on super sorry
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3894 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
Goober5000 ac732f8136 hmm... I guess when I fixed this back in 2004, I fixed it the wrong way :D
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3893 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
bobboau 40cb581405 made the new index buffers actualy work, now that I had something to test it with fixed a small problem that kept it from working
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3892 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
bobboau ac3b174c27 forgot about this header in my last commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3891 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
bobboau 916a09975b makeing D3D compatable with 32 bit index buffers, and fixing a minor directx technicality in the texture compression code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3890 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
taylor ddc112141d remove non-dark support per earlier discussions: remove -jpgtga and -pcx32
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3889 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
taylor 59814715fc fixup texture addressing stuff so that it works better bits of cleanup remove non-dark support support for releasing bitmap system memory when transfered to API memory
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3888 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
taylor 6da93821b6 don't bother trying to load message WAV when sound is disabled
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3887 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:46 +10:00
taylor 24905b2638 compiler warning fixage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3886 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 030270f2a8 add support for new IBX format which can support up to UINT_MAX worth of verts (NOTE: D3D code still needs to be made compatible with this!!)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3885 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor ec03cbc46d remove -jpgtga, set 32-bit mode as default (the OGL code will automatically fallback to 16-bit is needed)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3884 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor aff36fce1d little bit of cleanup per earlier discussions: remove -jpgtga and -pcx32
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3883 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 15e8396c2e remove the non-dark stuff, it only works on PCX files and stuff to use it has already been ripped out per earlier discussions: remove -jpgtga and -pcx32, set image load order to DDS->TGA->JPG->PCX some debug log cleanup remove bitmap data from system memory once it's in API memory
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3882 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
Goober5000 0ed509ace7 remove WMC's limbo code, per our discussion a few months ago this will later be handled by copying ship stats using sexps or scripts
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3881 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
Goober5000 3ff70bba49 yet more tweaks to the WCS death scream stuff added a ship flag to force screaming
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3880 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor c9273590c2 fix up Windows window/cursor handling so that it's up-to-date and more compatible make sure that we handle background clearing ourselves, fixes several little issues fix popup warnings to work a bit better and not screw up the game so much or make it difficult to interact with them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3878 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 037f784227 cleanup various bits of obsolete or unused code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3877 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 7b14ead21c bunch of cleanup and minor little fixes get rid of GL_activate and GL_deactivate hold-overs various fixes for platform window/cursor handling we don't need texture combine support most of the time, so don't bother with it (fixes fonts not displaying properly) disable depth testing if we aren't using a zbuffer get rid of secondary color crap that was just messing things up, there are better ways to do it if we need the basic functionality back later dump old gamma ramp support, we don't really need it at this point do edge clamping by default instead of repeat
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3876 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 414a0643dc clean up extension list and comment out the things that we don't use
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3875 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor da0037de69 slight change to emission light settings change default ambient light settings back to proper values add support for lighting falloff with directional lights some minor performance improvements
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3874 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 9e6ca810c6 various bits of cleanup fix for anistotropic filtering messing up with lod bias be sure that we always reset the properly active texture get rid of old gamma stuff loading fix for cubemaps disable apple_client_storage for now fix for ATI problem with framebuffers and corrupting starfield bitmaps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3873 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor bbbaa95841 some general cleanup add emissive light falloff support for asteroids properly setup env texture matrix get rid of secondary color crap, there are better ways to do it anyway
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3872 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 94b58a0eac remove some dead code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3871 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 28b7d2a716 fix thruster 2 length factor tbl entry so that it has the proper name
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3870 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor 7ec286cf81 cleanup shockwave code a bit make Shockwave_info dynamic lot of fixage to allow 2D and 3D shockwaves to work better fix for Mantis bug #1148 properly handle both "none" and "<none>" for 2D and 3D shockwave names better handling, preloading wise, of 3D shockwaves and their textures
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3869 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:45 +10:00
taylor f22c66fe40 safety check to make sure that we don't end up with non-player-usable weapons in the weaponselect pool (Mantis bug #1196)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3868 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor d4db6d3e5e be sure that we can handle both "none" and "<none>" in ignored filenames
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3867 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor f2d4fb19cc add position info for weapon energy text make sure that we can't target a hidden jumpnode rest of the weapon switch fix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3866 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 39f45f0f8e fix NULL ptr reference when a weapon doesn't have a tech description
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3865 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 3e97bd1ce4 taking Bobboau's advice: make sure that anim angles are kept in sane values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3864 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor ba421d8d68 fix tertiary glow sizes fix model vertex normal data that was being read/written incorrectly under OS X (still don't know why this was a problem, but this fixes it)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3863 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 91c2731521 crazy-freaky-cool OS X sound crash fixage fix sound resource exhaustion from using too many buffers allow loading of ogg or wav based on which is found first rather than tbl filename (fixes crash when Theora movies end up in wav code by mistake)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3862 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 8d78a6fa67 fix problem with model unloading that happened because skyboxes aren't reset properly be sure that skybox textures are paged in properly there needs to be a case insensitive string check when looking for existing bitmap filenames
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3861 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor bc64eb6ead make expl info dyanmic fix possible out-of-bounds on expl lod checking fix memory leak from modular tables
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3860 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 7bc01f1aaf build for for newer GCC versions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3859 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 6dbb7b65c2 add missing Lua files from recent update
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3858 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor f3dcb14e39 add in Theora build support add a /y to the copy line (got tired of doing this myself since it won't overwrite by default) remove DirectShow files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3857 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 3c4a168672 make fire-on-normal return value a little more obvious fix the "infinite genius" move I made by breaking turret movements ;)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3856 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor cad6587e70 remove DirectShow files, they are no longer supported
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3855 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 1c11efe082 proper envmap generation for OpenGL
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3854 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 26a8b0c62f fix for Mantis bug #1195
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3853 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 38de6cc5c3 clean up defines a bit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3852 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor d56a2b33bb remove avi and mpg from supported extensions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3851 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 15cad9783b fix bm_page_in_texture() so that it will load all frames of an animation (caused slowdowns in-game with it)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3850 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor d2a5b9a6b9 add Theora player build support add in the waypoint files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3849 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor ae1cc30563 add Theora player remove DirectShow support from movie player fix triple-buffer page flipping problem (Mantis bug #1190)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3848 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:44 +10:00
taylor 55e00902e4 add Theora lib header
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3847 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 246900788b don't display any error messages when there are no background bitmaps to load
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3836 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 e40ee6735e fix bug where built-in lament messages were never played
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3835 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 99b7eea1c2 convert a mission variable to a mission flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3834 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 ee3a0e9708 move this to the Message location of the mission
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3833 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 fefa022f9a add a feature for specifying the source of Command messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3832 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 4d2d3be017 taylor's bugfix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3831 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 6fdb5c8333 breathalyzer for WMC
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3830 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 f98d9af6b8 gah, not this again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3829 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 96887b0a0b update to Lua 5.1.1
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3828 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 904c80dc39 add feature to reset ship scores to what they are in ships.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3827 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 85b3098f72 fix #include path
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3826 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
wmcoolmon 7539f78024 Add missing waypoint files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3825 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 1348a3758c fix spelling... *twitch*
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3824 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 3b732fab3b assume ships-with-bays which haven't yet entered the mission are valid for syntax checking
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3823 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:43 +10:00
Goober5000 59583e8457 removed obsolete limits
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3822 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
wmcoolmon fb94960327 WMC codebase commit. See pre-commit build thread for details on changes.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3821 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 7c64c7ada8 added to the main branch as binary
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3817 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 ff27f47392 allow parsing of similar ship copy names properly (Mantis #1178)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3816 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 6dd131d118 make chase view and external view toggles independent (Mantis #1087)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3797 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
karajorma 2a1767951c Move the voice recognition init to stop Windows complaining and failing to init it.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3796 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 341c99796e fix Mantis #1163
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3795 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 91b722ae7d reverted the buggy commit that caused Mantis bug #1101
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3773 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 9ba23f4357 make an error message more descriptive
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3772 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 5facef281f the grammar nazi strikes again!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3769 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 38f922a22a prevent false positive while error checking
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3768 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 1c72d7c7c3 if a wing of ships is docked to something, that entire wing must have an arrival cue of false
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3767 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 cbfecea816 holy crap, this had the potential to mark the locked-true sexp as known-false, which would seriously screw a lot of stuff up
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3766 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 51e60dfa3a this may have been an oversight
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3765 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
Goober5000 3bedcbc561 FRED again updates backgrounds while the user is editing them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3764 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:42 +10:00
taylor c968496bc2 handle knossos warp effect flip in a slightly better, slighter safer way (Mantis bug #1048, plus a couple that weren't filed)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3761 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 66c3dcc5df 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)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3760 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor f9d1b75bff updated outwnd code for both Windows and non-Windows: - make print filters dynamic - fix various little bugs and issues - cleanup some non-used variables (non-Windows) - put everything under NDEBUG like it was, or should be - change to using data/fs2_open.log for log file (Windows) - change to using data/debug_filter.cfg (Windows) - make the extra debug window optional, and disabled by default (Windows) - fix some possible NULL references - clean up the SAFEPOINT() crap
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3759 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 274c841b64 handle the video registry entry better support for new Windows window creation code various bits of minor cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3758 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor b0f1a79bad properly support the updated window create code (all told: should take of of Mantis bugs #542, #624, #1140, and possibly #962 and #1124)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3757 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 1506ed4576 new window creation code for Windows (gets rid of some stupid :V: voodoo for the software/glide stuff) use detect_home() on Windows too (needed for now outwnd code) some bits of minor cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3756 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 1a2f24eb66 various bits of little cleanup add the debug cmdline printer to FRED, so that we can make use of that info in the FRED-debug case too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3755 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 92de065a4f various bits of little cleanup get rid of some more compiler warnings
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3754 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor b3136d2214 add some needed wing leader checks to prevent Assert()'s and out-of-bounds problems when the leader is dead/dying (Mantis bug #1134)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3753 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 440fa97d49 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)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3752 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 778a353728 fix the stupid safe_string thing ("LogFile" was already closed by the time it tried to write)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3751 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 09d2583123 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3750 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 4f491f99bd 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)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3749 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
taylor 802b7aecbb fix stupid bay depart object animation bug (Mantis bug #1133, part 2)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3748 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
Goober5000 f51d8e7de5 a much better fix for built-in arrival messages... it needs a new feature to fully work for custom wings though
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3747 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
Goober5000 631d1f2318 fix spelling, and synch with voicerec.cpp
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3733 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
Goober5000 193f3e3cda remove directory-specific information
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3732 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
phreak b70c325d6c oops, forgot a break statement
*scrapes off the rust*

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3729 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
Goober5000 1cb679b004 added MadProf's voice recognition enhancements
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3727 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:41 +10:00
phreak c73b4b8186 two fixes:
1) Fix for mantis #1099, part 2.

2) when changing the player's ship using debug_cycle_player_ship(), initialize the
 primary bank starting capacity so the support ship will rearm it.

git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3726 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
phreak 164405aecb Don't copy parentheses to parse buffers if outside of quotation marks. Otherwise the parsing syntax will be copied to said buffer and some warnings/errors would occur.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3725 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
bobboau 03ca7f9849 fixed D3D environment mapping
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3723 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 91cd637f73 fix return values (something that was different between 3_6_9 and HEAD)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3722 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 90e53277ac updated/fixed modelanim code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3721 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 938275b159 fix some of the envmap issues - use proper hand-ness for OGL - fix distortion - get rid of extra index buffer requirement change starfield bitmaps to use an instance matrix rather than going through all the trouble of resetting the view matrix basic cleanup and get rid of a couple of struct/variable naming issues (compiler sanity) make double sure that we aren't using culling of z-buffering when rendering starfield bitmaps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3720 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 13ee1b85db enable/disable alpha test based on blend mode (found this hidden in an old tree, may help with blending the newer alphablend mode)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3719 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor b16ce3e1f2 if a submodel anim fails to start then move directly to ready position flag (set it up to do this, just forgot to do it ;)) (fix for Mantis bug #1133)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3718 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor f4a3cb0a0f make glow_point array for thrusters and glow_point_banks dynamic (a proper fix for old Mantis bug #43)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3717 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 420c35aba5 forgot to reset default value for Interp_warp_alpha when it was changed earlier be sure that we are using the proper zbuffer setting when rendering thruster glows
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3716 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor d9360337a8 forgot this part of the render box fix (obviously no one ever really tried to use this feature, since it has never worked)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3715 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor fca993a805 ok, so apparently that did actually do something ;)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3714 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 9e4c322740 updated/fixed modelanim code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3713 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 4403762592 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3712 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor f7201f7046 updated/fixed modelanim code add ships.tbl subsystem flag ("+fire-down-normals") which will force a turret to fire down it's barrel line (Mantis bug #591)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3711 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:40 +10:00
taylor 3536c39466 updated/fixed modelanim code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3710 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 32f1b13426 grrr ... fix dos EOL chars
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3709 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 36f80a7355 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3708 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 60ee8f6044 a LOT of cleanup: * remove a bunch of old/dead code * some reformatting to help with readability * rearrange/rename some code so that it is a little clearer * move thruster glow code to it's own function (model_render_thrusters()) make HTL model buffers dynamic fix detail boxes so that they actually work for the first time
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3707 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor c76596e044 add "Render full detail" support to the lab as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3706 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor e65ac0202e fix compiler problem due to change in parse_init() function fix dos EOL chars
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3705 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor ccb26d6e1a add a "Render full detail" view option to render models at their full detail for the LOD (for render/detail boxes, Mantis bug #1121)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3704 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor bf5b34e80e give the standalone chat box a horizontal scroll capability, not terribly accurate but it's good enough for the purpose (Mantis bug #1095)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3703 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor ae10003f72 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)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3702 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor d3ff60f166 fix the cmdbrief editor deleting the wrong stage (Mantis bug #1115)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3701 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor cb5b0042e0 fix loading callback issue in standalone
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3700 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 17adb27f4f don't require hardware GL if running FRED (this is mainly for my benefit since I always forget to add that locally)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3699 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 4adea7b1d0 fix the envmap-getting-rotated-by-turrets bug (though it did make me chuckle a bit when I first saw it ;)) try to reuse old view setup info, if we are using the same settings again (for speed up purposes, will be a bigger deal when bumpmapping gets here)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3698 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor a8b0b57925 fix Personas memory leak (not really an issue, I just got tired of seeing it in the Valgrind reports)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3697 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 42b7d023ed remove a basically useless debug message fix parse_init() so that it doesn't absolutely have to init sexps (doesn't need them when getting basic info, and causes memory fragmentation otherwise) fix multiplayer mission info getting to just get basic info (fixes a couple of minor multi issues that were already fixed in single)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3696 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor e24d054410 fix a memory leak that Valgrind was complaining about (happens mainly when you have a mission without a briefing)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3695 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor 3665f9c80d various bits of cleanup (slight reformatting to help readability, remove old/dead code bits, etc.) deal with a index_buffer memory leak that Valgrind has always complained about make HTL model buffers dynamic (get rid of MAX_BUFFERS_PER_SUBMODEL) get rid of MAX_BUFFERS make D3D vertex buffers dynamic, like OGL has already done
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3694 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor eb44c69bcf fix for Mantis bug #1104 (can't use a ":" in chat)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3693 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:39 +10:00
taylor dc8b03f68a various bits of cleanup (warning messages, things that Valgrind complained about, etc.) fix an out-of-bounds issue on Sexp_nodes[] which was leading to stack corruption
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3692 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 6f9ddbfd4a --prevent the ai from "forgetting" that it's attacking a wing (fix for Mantis #1131) --move AI_CHASE_WING goal check so that it will properly short-circuit when appropriate (discussed in the same bug)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3688 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 e0c6eeff25 minor bugfixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3687 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 b33ea1169c fix is-event-x-delay optional argument type
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3686 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 d4242fee13 improve error message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3685 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 8ff52a5f57 improve error message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3684 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
karajorma ad0c943fed Fix for Mantis 1017. - Hope we've seen the end of that damn persona bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3683 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Kazan 0f2cca5c4b Absolute speed, not forward speed, for hud speed reticle - fixes the guage for gliding
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3681 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Kazan 902d1df362 prevent autopilot initialization while player is gliding
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3680 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
taylor a846582d94 make "TBL Info" button in ships editor handle modular tables (Mantis bug #1130) fix bugs where ship names with leading '@' or trailing whitespace didn't get compared properly in "TBL Info"
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3677 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
taylor 71cfdd5f76 remove Assert() on Viewer_obj for supernova sun processing, it's not really needed and a NULL obj is easily dealt with by the code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3676 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
taylor 10cd1b08c9 add the part of the fix which actually did something ;)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3666 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 f44e8b46f7 fix error line reporting (Mantis #1120)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3665 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 c503ef414c moved some stuff around in the sexp menus
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3658 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 5d81316c65 clarified this; it was confusing before
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3657 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 b710bbcc34 make sure to only add the sexp callback once
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3656 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
wmcoolmon 408a2156c6 Fixx0r FRED
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3642 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
wmcoolmon 01b4fad60a Fix extra jumpnode settings not saving. They still don't show up in FRED, unfortunately.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3641 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:38 +10:00
Goober5000 e834420b64 better safety check
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3640 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 9f0d8f5c53 betterized some things with mission arrivals and departures
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3638 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 a195fe2a3f make sexp nodes dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3637 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 cd2953a8c9 make sexp nodes dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3636 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 28b856eb84 preliminary commit of sexp node bump... fred only, just changing some names for clarity
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3635 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 3bcb1fae90 bah
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3634 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 7b1dad27b3 nitpick
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3632 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 9360755de9 fix forum links
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3631 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 bc645de98f bypass annoying warnings for nonexistent bitmaps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3630 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
karajorma 8ba5dd2af3 Fix for Mantis 1092 - (Support ships damage hull)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3629 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
Goober5000 52b0262321 <nelson> Ha, ha! </nelson>
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3627 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
karajorma 81f0690b2d Remove the extra ship_class variable. I'd already added on as part of the team loadout changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3626 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor 239ee80362 handle another null vec warning which can happen during a multiplayer respawn or certain death sequences (Mantis bug #1090)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3625 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor 7a1d701bc7 clean up some old software rendering stuff that we don't use any longer remove grzbuffer.*, since all it did was give us 3 variables, which were moved to 2d.*
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3624 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor 8b0d64f4f1 For redalert stored data be sure that dead ships don't come back, and departed ships come back just as they left (Mantis bug #810)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3623 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor 1dd8b21422 make sure that the armor stuff gets initted (should fix Mantis bug #1080)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3622 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor 884ecee601 meant to do this before but forgot about it (just replaced "(4.0/9.0) * PI" with it's result)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3619 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor d5f3ec6a4e if shockwaves weren't loaded then don't try to unload them (fixes standalone crash)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3618 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:37 +10:00
taylor d34bc91738 make sure Multi_create_bitmap is initialized properly since it might not be otherwise in standalone
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3617 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
taylor b6ee2a4f82 fix for the "branch" bug (still a minor usability issue however, see Mantis bug for details) add a popup to the loopbrief screen when you press ESC, so that we can either accept or decline the loop offer
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3616 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
taylor b27fad2e1e bit of cleanup (technically the vertex buffer stuff is part of a much larger change slated for post-3.6.9, but this should be a little faster)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3615 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
taylor d7d5107a86 re-fix this crap that I managed to break last time (was Mantis bug 1066 I think)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3614 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
wmcoolmon f145570958 Fix OGG bug where sound files were always allocated 16 seconds of wavedata
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3613 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 9b3ad06f06 check that targetview model files exist as well
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3606 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 deb684d140 more accurate message number
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3604 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 fb2e235608 fix spacing
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3603 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 0d23309a35 find message sender too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3602 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 01d12eafc6 newline tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3601 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 950dcfa869 small bugfixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3600 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 02e55270a2 enhanced voice acting manager, now with script generator :)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3599 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 3949d6efd0 fix crlf
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3598 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 ebdc00a523 more flexible checking of generic messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3597 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 8ec6c1a67d merge voice file manager into voice acting manager, plus make a few tweaks to it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3596 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
Goober5000 9af2763943 fix for Mantis #1070
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3595 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
taylor 5b864af888 more standalone server fixes: - add some basic bmpman functionality to grstub, since it needs to do something at least - add missing gr_* function ptrs to grstrub - (re-)enable radar and hud setup functions that used to crash (problems are fixed now) - deal with default pilot file properly (also caused a bmpman headache) - don't bother with Multi_common_icons[] in standalone mode (they don't load, so don't let them unload either)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3594 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
taylor 1c516c2540 clean up the function ptrs so that it's a bit easier to read
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3593 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:36 +10:00
taylor 8186572d15 move FS2NetD connection checks to *after* it tries to connect ;) (Mantis bug #1065)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3592 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor de2fbfb48d fix for deletion of multiplayer pilots (Mantis bug #1066)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3591 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor 9430b78326 minor clean and code optimizations clean up view/proj matrix fubar that made us need far more matrix levels that actually needed (partial fix for Mantis #563) add debug safety check to make sure that we don't use more than 2 proj matrices (all that GL is required to support) set up a texture matrix for the env map to that it doesn't move/look funky
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3590 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor 8c0243b821 fix SAFE_STRCAT() so that it can work in an if() statement that doesn't have braces
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3589 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor acf10e3bba small optimizations and code cleanup use the real frametime for FPS counter stuff, no reason to deal with time compression there (Mantis bug #1058)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3588 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
Backslash 217b5beb99 Ok, maybe this one will be better. Sorry about that.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3584 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor a6bcb0b3e7 revert Backslash's commit, *way* too many changes there for a single friggin line
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3583 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
Backslash de16009a35 max_speed changed to get ship's max forward speed instead of max_vel magnitude, thus fixing trichord speed problems. (Mantis 1050, and early work by argv.)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3582 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
Goober5000 ac2ec50ba4 more descriptive warning message for docking paths
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3581 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor d4b831fa35 default to 44100 sound sample rate (OpenAL tends to works much better with this)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3580 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor 082977d664 add some extra FS2NetD safety checks around to prevent the code from doing stupid crash-happy things
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3579 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor 4134e985a5 have the joystick thread prevent the display and network from going to sleep or activating the screensaver if you use only a joystick to play
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3578 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor cf9095ed6e the resolution checks needed to be based on the unscaled res since you would have to include correct sizes for every single resolution otherwise (fixes a bug noticed in WCS)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3577 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor d54301f34a some gamma ramp fixage, still hasn't gotten a steller review from DaBrain but it does work much better than before, so I'll tweak it later if need be
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3576 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor e0b689c9bb neither of these two structs appear to be used anywhere, so lets just comment them out
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3575 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor b17794b9ed some basic error message/handling fixage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3574 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor a02ac92043 properly support 4gig of RAM, and don't totally freak out if user has more than that
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3573 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor cdb3c02fa2 properly fix the new_recommendation_text FRED problem, plus some real cleanup for that code in general, and some memory leak fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3572 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:35 +10:00
taylor 0ca738ff0a add default recommendation text for debriefing, it's either this or making sure that it's nul
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3565 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor e84a2e24b8 prevent FRED from hitting an Assert() that it shouldn't have had to hit in the first place
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3564 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor 7b2407dd4c fix for Mantis bug #1006
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3563 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor ecda5d2efa fix some stuff_string()'s that got missed previously
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3562 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor 166aafc603 forgot to check that error message to match the new struct format
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3561 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor d79e25ca97 bah! stupid.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3560 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor c1750c14ef might as well add this, just to be on the safe side (I haven't hit it anywhere, but it could be made into a warning if it starts getting hit)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3558 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor 34d198d30f be sure to setup/reset ship team data too when moving to a red-alert mission (Mantis bug 1042) (this will hopefully fix Mantis bug 860 as well, which is a separate but related issue)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3557 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor b0033e2d81 be sure that we still try to play a movie if we get to the cmd/brief screen right from another mission without debrief (Mantis bug 1043)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3556 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor cbe140ab76 restore MAX_AIFTT_TURRETS to retail level, and add comment as to what it means for the next person that tries to change it
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3555 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor ece636df39 revert to retail behavior for turret_should_pick_new_target() fix out-of-bounds issue
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3550 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor 471b758539 fixes for stuff_string() bounds checking
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3549 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor c29aa3e9e3 fixes for stuff_string() bounds checking stict compiler build fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3548 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor ba6773e0f2 compiler warning fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3547 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor 32aa4ccbeb fix bug where set-object-speed-* could set speed subjectively if left to default
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3546 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:34 +10:00
taylor 305a2d5855 fixes for stuff_string() bounds checking compiler warning and stict compiling fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3545 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor d47c1c9cab fixes for stuff_string() bounds checking compiler warning fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3544 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor baa43c4331 fixes for stuff_string() bounds checking make sure that default entries always get used in techroom if they don't otherwise have the techroom visibility flag fix crash bug where the first entry in the various lists wasn't ever initialized if there is no ship/weapon/intel info to show
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3543 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 1ed5c7d6c7 various small compiler warning and strict compiling fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3542 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor dcf3ecd770 crap. ... again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3541 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 4a3e5826ee clean up the grstub mess (for work on standalone server, and just for sanity sake) move color and shader functions to 2d.cpp since they are exactly the same everywhere don't bother with the function pointer for gr_set_font(), it's the same everywhere anyway
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3540 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 01dd0cf6d3 crap, there was supposed to be a multi check there
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3539 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 4d018ff477 allow W32 init fallback if desktop depth is less than requested game depth (it may look like crap, but at least it will work)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3538 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor c7748312b8 bah! got the post-it sitting in front of me, but still forgot to remove this
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3537 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 6175b6652b make Species_info[] and Asteroid_info[] dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3536 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 6ed629949b quite a few fixes to handle missing campaigns better change load order for campaign loading to a full check: Player-specified -> BUILTIN_CAMPAIGN -> First Avaiable. clean up the getting of a list of available campaigns fix simroom issue where single missions, with the [V] icon, would display wrong (this was a retail bug, but it doesn't show normally) fix bug where, if a campaign failed to load, it would still appear available for savefile useage fix bug where, when resetting the campaign info, the num_missions var wasn't 0'd and it could cause a sexp Assert() during reset
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3535 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 58a664c6c8 fix a compiler warning/error on Squadmsg_history[] init
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3534 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor dbc4ef06ac forgot an extension check (was this the background corruption bug???)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3533 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 7c929e83f3 switch to using cf_find_file_location_ext() when looking for movies
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3532 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor b192b094ee 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3531 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor c29957eb1a make muzzle flash info dynamic add support for modular mflash tables (*-mfl.tbm)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3530 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor e405e0e760 add font.h since the gr_set_font() function is only available from there now
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3529 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:33 +10:00
taylor 5702c16c87 don't try to draw beam sections if there is no valid texture for it, or if there is no width
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3528 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 1a3659ac2a make sure that we properly page in textures for 3d shockwave models
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3527 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 32d28c1de3 compiler warning fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3526 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor ffc6ca5117 some fixes for the standalone server - get init order correct for lcl and std init - turn off some cmdlines that are just graphics related when Is_standalone - skip radar_mission_init() (may need to rethink that though, it's bound to cause problems)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3525 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 8e5280a051 minor spelling/grammer fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3524 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 043321868c be sure to reset color and clear color before MVE playback (fix for Mantis bug #1041)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3515 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
wmcoolmon 9b08bcca19 New model & ship scripting stuff
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3514 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor ca4879c4ea fix for vanishing FRED2 cursor (Mantis bug #997), plus a little cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3513 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 1358f61e0d crap, knew I should have fixed that in the patch so that it would be right in both branches...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3512 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 240fabbdd0 fix things that strict compiling balked at (from compiling with -ansi and -pedantic)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3511 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 594fe17d61 fix for Mantis bug #1038 (glow point bank storage being wrong after changing ships in shipselect) fix things that strict compiling balked at (from compiling with -ansi and -pedantic)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3510 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 047bd9ac3f small optimization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3509 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 29c9a124cf fix for Mantis bug #617 (with a very big assist from Shade who did most of the initial work on this)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3508 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor ec6a629cbe lower client/server version back to retail level, there was no reason to bump it in the first place
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3507 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor 40f101e51b add support for a server name in fs2open_pxo.cfg, rather than just an IP address for the server
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3506 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
taylor c3076eb0f5 fix for Mantis bug #687 (at least until better swarming code can be written, post-3.6.9) a quick speed/sanity check for turrets to be sure that they actually have a weapon to fire before processing them
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3505 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:32 +10:00
wmcoolmon f6be711610 Better static mouse cursor support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3497 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 759d4755a7 Update MSVC 7 Project files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3496 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
Goober5000 2649c6a65d revert VOICER breakage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3495 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
Goober5000 d491750ad1 fix macros
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3494 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
Backslash 1d052f7a21 Make hud toggle apply to hud framerate, statistics, and camera position
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3493 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
Backslash 6632c806d9 Turn off gliding upon activating autopilot
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3492 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 8debd63788 Commit of 'new' BTRL FTL effect work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3491 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 62cecf0968 Update to allow flak range to be manually overridden, and safeguard against NULL predicted_pos
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3490 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 93f5fd829a Conditional hook
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3489 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon f76ec55015 enumerations; drawImage update; subsystem orientation and fireWeapon() member objects; many new weapons.tbl data variables; conditional hooks; modular scripting table support (*-sct)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3488 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 8ab18d8257 Fix scripting HUD hook execution method
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3487 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 7089b795e1 Don't force fs2_open to load motion debris.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3486 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon a4543e1c64 Cover-up a bloody annoying warning
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3485 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon f2ebe77471 Allow use of the techroom, even if no current campaign exists.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3484 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon 6f91252eaa Changes to allow for a species with no shield anim
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3483 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon b9b1793287 Fix bug (under Win32) where FRED would warn about unacceptable accepted orders, but not do anything about them.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3482 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
wmcoolmon cc2d2ee49e Added flag-to-string function for error messages
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3481 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
Goober5000 53feaed357 fix waypoint time to goal
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3480 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:31 +10:00
Goober5000 c3c6f6232f remove unnecessary warning
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3478 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
karajorma d0abb505fb Fix TvT problem with scores appearing incorrectly.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3467 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
karajorma d723c2e5fb Fix lack of Wingman Status indicator for Zeta wing in TvT games.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3466 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
Goober5000 1170157003 a tweak and a fix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3454 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 6f62889368 maybe optimize the (PI/2), (PI*2) and (RAND_MAX/2) stuff a little bit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3453 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 5d709bb63f slight math optimizations reduce COUNT_ESTIMATE since I added more game_busy() calls for models and it threw off the loading bar
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3452 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 99d98d8959 slight optimizations fix AI shields to not get overly charged or overly drained when AI does equalize (it's closer to player now, but still within retail intent of function, I think)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3451 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor d617270f54 slight optimizations compiler warning fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3450 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 686bbdd585 clean out some crap that we don't really need
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3449 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 5dd1939e19 cleanup bugfixes error-handling (lots of crap got fixed to work better, and lets leave it at that, the commit log would be too long otherwise :))
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3448 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor b9594353e6 very slight speed optimization to avoid math that we really don't need to do anyway
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3447 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 9eaa57e124 add custom IP option to maybe help get around NAT issues (I haven't heard whether this actually works or not yet though, but it's been out for testing all week)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3446 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor b2d33e0c49 add render option for no glowmaps remove render option for fog (why was this even there??) add tech model view for missiles with special tech models (will hopefully help spur some work towards fixing the currently broken models) handle Z-buf issue that made the lab interface disappear when the transparent render option was ticked
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3445 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor bf6a49525d OMG! MEMLEAK!!!! (maybe no one will notice that it was my fault ;))
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3444 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 6003cea608 an int wrap-around issue could (and was) make debris not have electrical arcs (or lighting or sounds) since it would always fail this check
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3443 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor 9203064801 ever so slight speed up for bm_set_components_* (this crap is slow, and it's called a LOT)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3442 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor e8e3952513 "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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3441 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
taylor ea4cf33a15 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3440 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
Goober5000 e15b9581d0 disable duplicate model texture replace
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3439 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:30 +10:00
Goober5000 e755e262d3 if a modular table ship pof cannot be found, use the original one
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3438 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma 9d5f957d7c More cut & paste errors fixed and removal of the hardcoded warp out animation. Will now actually use the one specified in the table.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3423 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Goober5000 618cb53d8e better handling of ballistic rearm sounds --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3420 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma bbddd92669 Doh! Minor fix
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3419 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma dd97133335 Another typo
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3418 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma 8da36a8ddd Fixed a typo which breaks team-score
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3417 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Backslash 6b1fd17141 add .ogg to the list of recognized movie file extensions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3415 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Backslash 2d9c040b2c Quick fix to deal with the slide accel / decel inconsistency, Mantis 951.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3414 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Goober5000 96275a5b6b nitpick
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3413 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Goober5000 200e56f4bc extremely minor optimizations
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3412 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma 420809c288 Fix a Multiplayer bug where anything that included the name of a player wing was automatically considered to be a part of that wing.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3411 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma 9ca5def214 Fix Mantis 1009 - A problem with using the Change-ship-model SEXP
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3408 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
taylor 553f928558 fix for setting of texture lod bias
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3406 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
taylor 04e24d23f5 very small math optimization
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3405 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
karajorma 50ee65a9bb Fix a small problem with ballistic primary ammo. Forgot to upload this one earlier
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3403 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Goober5000 9347bf9988 deprecate change-ship-model
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3401 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:29 +10:00
Goober5000 9aeec5daf9 make these consistent (pitch-bank-heading is the established order) --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3400 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 83bd864198 add the multiple background feature --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3399 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
karajorma 4296118a3e Fix bug where end-mission SEXP only resulting in the mission ending for the server
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3395 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
karajorma 2ac9eb8f85 Stop multiplayer campaigns crashing if the campaign lacks a description
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3394 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 b9a110b93f add a second method for specifying ship copies, plus allow the parser to recognize ship class copy names that aren't consistent with the table --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3389 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 77592a98cf fix display of ship copy class names in ship loadout screen --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3388 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 58f8bf7f5e fix display of ship copy class names in ship loadout screen --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3387 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Kazan f136b538e5 commented out glide_while_pressed changes until taylor deems them safe
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3386 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 edf95b0f77 proper phrase case
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3385 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Kazan 2b5976a2f8 glide while pressed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3384 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 9b63771633 fix for Mantis #1020 --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3383 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Kazan 097b4940b5 resolve 1018 and an interface problem in fred2's ship editor
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3381 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 c9432fd83f bah, revert
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3380 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
Goober5000 a5fd0083e9 stage 1 in multiple-background feature --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3379 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
taylor f04620dd78 check first stage warp arrival against all docked objects so we can not render them all if even one is 1st stage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3378 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
taylor 3dce69c7f8 when in external (non-control) view be sure to not include time compression speed in camera movement
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3372 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
taylor 1c59dd7af7 don't render extra lighting passes when fog is enabled, prevents fog fragment from getting added for each pass wobble wobble no more!!
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3371 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:28 +10:00
taylor 801924dbba switch from Assert() to basic error fixage for end-of-string white space check
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3370 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor 0c147396fd include CF_TYPE_PLAYERS in special pilot path consideration, prevents moddirs from always getting and empty data/players/
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3369 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor 6b692e048f don't lowercase the dir for chdir on non-Win32 since it could be, and probably is, case sensitive
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3368 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Kazan 9a3be4e8f3 Lock player primaries during autopilot
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3367 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
karajorma 86592894a7 Fixed an error in ballistic weapons where only the server got the correct number of bullets in multiplayer. Fixed a rounding up error in get_max_ammo_count_for_primary_bank()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3366 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Kazan 82a4b70080 Resolve Mantis #1011
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3361 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Kazan c29dd8e247 Optimize
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3360 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Kazan 7892f9d1f6 Resolve Mantis #1010
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3359 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor 7562b17c5c support for cmdline option stacking (a per option setting) so that things like "-mod derelict -mod mediavp" will end up as "-mod derelict,mediavp" to the game fix bug where white space chars didn't get dropped from the end of a option string like they were supposed to allow for something like "-ambient_factor 100 -ambient_factor 70" to use the proper value, the last one specified, rather than just accept the first instance
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3358 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor 9774840088 minor cleanup/optimization to beam warmup glow rendering function various lighting code cleanups - try to always make sure beam origin lights occur outside of model - make Static_lights[] dynamic - be sure to reset to first 8 lights when moving on to render spec related texture passes - add ambient color to point lights (helps warp effects) - sort lights to try and get more important and/or visible lights to always happen in initial render pass
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3357 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Goober5000 511d99402a fix a subtle and nasty bug --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3356 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Goober5000 ef881c1421 fix for Mantis #1003 --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3355 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor f106d752dd minor changes to game_busy() debug text - don't alloc it for bmpman, and make sure to only call on textures that we are loading - add text for model loading, gets rid of the long-wait issue when it appears to not be doing anything early on
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3354 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor 13dfe103fb little cleanup
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3353 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Goober5000 265f08fc49 add another method for calculating dimensions of docked objects, plus improve an existing one --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3352 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Goober5000 b1a581487a fix help text --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3351 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
karajorma df588a7910 Fix for Mantis 996
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3350 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
karajorma a6cfd8137d Fix for Mantis 888.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3348 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
Goober5000 30f27da3c0 tweak control text --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3347 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:27 +10:00
taylor d5f2d2db88 make glow point banks dynamic
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3345 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor dff718944b fix some missile autocentering issues - use MR_AUTOCENTER and MR_IS_MISSILE flags to generate an autocenter for a missile if one doesn't already exist - don't try to autocenter loadout icons when rendered 3d
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3344 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 17e4e28e5f maybe this will finally shut-up some of the people who have complained about certain mipmap issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3343 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 44c635addb only do i2fl() on the font bitmap once per string rather than doing it per-letter (basically unnoticable performance boost) before doing alpha channel check, make sure the bitmap is valid, since it doesn't actually catch that until later in the texture code
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3342 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
Goober5000 08f653f0fb move WMC's preload stuff into main preloader routine
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3341 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
Goober5000 2f9ad571c5 stage 2 of animation fix (add base frame time to each ship) --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3340 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 8d2749639f missed the extern apparently
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3339 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor b8fbbc8f9c we probably need to be processing the number of weapons here rather than the number of ships ;) (Mantis bug #988)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3338 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 0cb91d9854 change clamp mode for font/interface graphics, don't want the border factored in for scaling/filtering
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3337 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 14eb67a3e5 add missing stub for game_get_overall_frametime()
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3336 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 3beb39f3de fix for animated texture map issues (*part one*), this should be faster than before too, and fix inf-loop/div-by-0 issues
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3335 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 92c6092b04 change compiler optimizations a little for release builds, use "Maximize Speed" setting, since it's basically using debug optimizations otherwise
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3334 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:26 +10:00
taylor 8c87508b3e fix for network afterburner support, this one should be compatible with all previous versions
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3333 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
taylor ef64332199 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3332 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 50b8d7ea2a * better formatting for substitute music options * better handling of all special FSO comment tags --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3327 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 0a01d6a4bb prevent labels from overlapping widgets
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3326 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
taylor c5d60b66ea fix the endless-loop fix ;) (this is what broke shield recharging btw)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3325 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
karajorma 90b79cd174 Fix afterburner trails in multiplayer (Mantis 895)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3324 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
taylor a42286877b fix undo system restore the two autosave points that got removed for some reason (yes, these are needed for things to work properly)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3323 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 b90e7941cd bah, make sure we're in the correct mode
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3322 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 90349360f4 tweak max speed function --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3321 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 e8b032882e fix INF builds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3320 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 08b59bc175 ugh... FS2_VOICER isn't actually defined at this point, for some reason... but it looks like phrases.cfg will always be generated, so it should be okay to take these #ifdefs out --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3319 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 f58ced4ccc this shouldn't actually be in CVS; it's produced during the build process --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3318 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 0c4922f248 consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc. this should fix Mantis #977 --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3317 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
Goober5000 29551d1e87 iff defs should allow specification of both flag fields --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3316 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
taylor 9522e2fbba 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
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3315 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:25 +10:00
taylor 926fba9af8 require OpenAL 1.1 under Windows, I think it's causing problems for us to mix users with 1.0 and builds for 1.1 (having 1.0 is fatal to sound, but the game should still work, a corresponding Launcher change goes with this too) clean up some of the error messages to not say "DirectSound" is doing this or that, just say "Audio" instead
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3314 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor 791c6885ac debug-build-only issue, make sure that thrusters are properly enabled if needed for POF based weapons when using cheat keys
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3313 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor f2854de962 hopefully this should get missile viewing working decently again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3312 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 ac9dea08b4 fix for Mantis #967 --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3311 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor d689cd9f6b make sure to reset the optional maps after each buffer render (little scary that this wasn't noticed a long time ago)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3310 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 20935be473 fixed something that slipped by taylor ;) (caused by having extra flags in the main branch) --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3309 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
karajorma 4b2508ec63 Fix for Mantix #959. Campaign editor shouldn't crash on finding an empty mission list any more.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3308 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor e6852a545c some better handling of OpenAL errors during init
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3307 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor f482a89ab6 add some minor error catches for invalid values
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3306 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor ca8fbc977f more big-endian fixage (seriously hope this is the last of it)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3305 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor 2f0d12e022 rest of the map/glow changes - put glowmap activity back on a per-ship basis (via a SF2_* flag) rather than per-model - same for glowpoints, back on a per-ship basis - put specmaps and bumpmap back on a LOD0 and LOD1 affect (got changed to LOD0 only recently) - fix glowmaps for shockwaves again - add support for animated specmaps (mainly for TBP and Starfox mods) some minor code cleanup and compiler warning fixes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3304 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor 0bf68d0550 add a render option to make the model not spin around, easier to work with in some cases, and better screenshots
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3303 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
taylor 5b570b795b newline fixage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3302 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 99bf855bcb fix ship type bug that Taylor mentioned --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3295 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 f20330eb13 add CVS headers --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3294 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 c9f39f527d remove obsolete (and hackish) flag --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3293 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 922d3f5584 WCS screaming stuff --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3292 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:24 +10:00
Goober5000 e00791d79f fix dumb endless loop bug --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3291 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 c2138e0fbb fix subtle change from retail... dunno if it's a bug, but best to stay on the safe side --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3290 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 5c9b21bde9 fix for Mantis #856 --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3289 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 d279ff8421 commented annoying redundant warnings --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3288 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 c969d5b4ef fix a couple of typos --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3287 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 1f9f692bfd 1) complete (almost) changeover to reorganized texture mapping system 2) finally fix texture animation; textures now animate at the correct speed --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3285 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 0f2daa67f1 fix for Mantis #571 --Goober5000/Backslash
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3284 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 6fb59c5921 spelling
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3283 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 b4fcd028f0 cvs comment tweaks
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3282 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 d2b28598f6 forgot this yesterday
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3281 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 2018c5eb3f unremove the storybook for now, but it will probably be replaced with a more complete version in a week --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3280 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 a622bf7e8e --in preparation for fixing an annoying animated texture bug, reorganize the various texture structs and glow point structs and clarify several parts of the texture code :P --this breaks animated glow maps, and animated regular maps still aren't fixed, but these will be remedied shortly --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3279 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
Goober5000 0e9983d8ef remove the storybook for now
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3278 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:23 +10:00
karajorma c7e72f6f9b Restore the Hostile Warning triangles and the "On your Six" warning messages.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3277 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
Goober5000 c8a2e196fe remove associated AI flags --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3275 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
Goober5000 92ddebade4 okay, I have no idea what I was doing there --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3274 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
Goober5000 d0cbc64bfa fix the "Game of TAG" bug; hopefully this won't unfix something else --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3273 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
Goober5000 c29a7a751a restore compatibility with retail ship types --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3272 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor c6f1934ef6 add in Goober's new files
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3271 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 318136b5e0 account for some minor floating point error in the undock speed check
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3270 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor cb7ca8e3f0 fix various compiler warnings and things that Valgrind complained about
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3269 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 0c8eaca26d make sure we don't process cmeasure homing more than once (this should also fix the incompatible network packet) fix flag check to be sure that we properly detonate missiles tracking cmeasures
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3268 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor b54e6f20af we don't use alc functions here so no real need for the header
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3267 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor e97e91d0ea make sure we only do ship related setup on actual ships
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3266 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 853b4fddeb 32-bit PCX conversion doesn't do a bit swizzle so be sure we get the transparent pixel right in the first place to avoid the green
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3265 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 93bf912d98 try to allow RAS VPN connects since they probably aren't dial-up and shouldn't be seen as such
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3264 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor ed0631ce6b fix so that multiple FBOs can be used with different sizes (plus a few other minor adjustments) fix various things that Valgrind complained about
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3263 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 5c1abef3b6 add -disable_fbo option to help troubleshoot crappy ATI drivers address a strange resize error that triggers an Assert() in the texture code with mipmaps
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3262 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 6ddbad120e be sure to properly reset fullscreen/minimized state vars as we switch between them remove the temporary -alpha_alpha_blend option fix screenshots on big endian fix various things that Valgrind complained about
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3261 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor d08247bd83 sync up current OpenAL changes - "SoundDeviceOAL" reg option for user specified sound device (used instead of "Soundcard" for OpenAL) - reset current context when we are leaving, may be leaving drivers in a bad state, and it hasn't hung up in quite a while - if sound card (which DS or OAL) is set to "no sound" then be sure to disable both sound and music fix various things that Valgrind complained about make sure we can report both AL and ALC errors fix for ds_get_free_channel(), it shouldn't return -1 on an AL error
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3260 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor bccaf2a699 add -disable_fbo to troubleshoot crappy ATI drivers remove the temporary -alpha_alpha_blend option tack on an extra byte to the flags.lch file so that the launcher can easily detect if it's an OpenAL build or not
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3259 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor f796a01756 fix various things that Valgrind complained about comp_type for DDS images will always be set to something, an 'uncompressed' type at the least
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3258 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:22 +10:00
taylor 77d2e20dda add/remove files so that 'make dist' works again
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3257 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
taylor e8d14cdc3f bump package version
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3256 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 1f06e3c2e7 add new files to project
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3253 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 268d23cb88 handle docked objects during death roll --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3250 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 5ee98bec89 fix comment in preparation for code commit --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3249 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 ec89e0dbba change back to ubyte --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3247 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 dbc7a006d2 slight optimization --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3246 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
wmcoolmon 1d4d3f5119 Fix loadTexture; fix subsystem indexing; fix getNum() for weaponbanktype; improve missing function error reporting when using LUA_INDEXER
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3242 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
wmcoolmon e99ef17c43 New function for scripting
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3241 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 9deaad0477 doh! sorry for blaming this on you, WMC --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3240 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 0f9caba58c cosmetics, plus revert an unnecessary if
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3239 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 190d222245 make ai-chase-any-except default to ai-chase-any (since it never really worked properly in the first place) --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3238 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
karajorma 2dfa7cb8aa Should be here too
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3236 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
karajorma cfcfb822e3 Make the ambient light sliders actually save their settings.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3232 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
wmcoolmon 6052f17add Remove Assert, should be caught by aforementioned warning
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3230 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
wmcoolmon 0d13a2654d Change an Assert to a more verbose Warning, in the case of issues restoring a red alert ship. Also, try and get some backup allocation of weapons in.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3229 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 c9a892a452 make warpout work properly even if the player is docked to something --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3211 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
wmcoolmon 4399c1c642 Mantis Bug 0000947: Ahh, so that's what this was for :P
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3210 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:21 +10:00
Goober5000 c9378b4d98 this is kinda superfluous
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3209 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
Goober5000 0813bf6a95 version bumpage
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3208 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
Goober5000 3b21cf5552 tweaked the version string --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3207 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
Goober5000 7a074e2472 better handling for 'G' key press --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3206 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
taylor 1ac71f3d5d remove previous attempts at the Y bug fix, it's now back to the retail code for that
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3205 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
taylor 44c381466a fix Assert() on value of face variable, it should be able to be -1 for non-cubemap images
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3204 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
Goober5000 20ced6370a remove /Og switch
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3201 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon f45101a7dc Tweak events support; fix a few of Wanderer's bugs; begin model support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3194 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon 19ad21c88d Oh wait, I can just do this
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3193 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon ed06faf99d Fix attempt #2 for mantis bug 0000900
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3192 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
Goober5000 63b0d7bde0 fix parsing/handling of debriefing persona indexes --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3191 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon bd7e2bd627 Scripting support for events/directives
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3190 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
Goober5000 eb62ad1738 update credits
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3189 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
karajorma 3388506cc5 Fix 130 ships limit for Inferno builds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3184 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon fcba4cada4 Fix the getScreenCoords function.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3182 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon b840fb32d5 Not sure why I didn't catch this when compiling earlier...
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3181 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon ca5777adfe Move fog disappearance factor to objecttypes.tbl
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3180 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon c87db8a371 Link in some scripting limbo support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3179 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:20 +10:00
wmcoolmon 0b582e91eb Pass to get any files that I missed
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3178 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon 4ab913d3c8 Limbo flag support; removed unneeded muzzle flash flag
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3177 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon a3599c2621 Begin multi-turret-guns toggle work
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3176 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon eeb941324e Limbo flag support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3175 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon 3f685dae15 Limbo flag support; fix scripting debug bug
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3174 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon c6367345c9 Limbo flag support; further scripting 3.6.9 update
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3173 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon e0e497faf0 Limbo flag support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3172 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon fc4096ddf5 Limbo flag support, even for as-yet-unused code :P
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3171 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon 391f48f4c8 "Limbo" flag support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3170 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon 32fde03838 Fix muzzleflashes for non-flak weapons. Begin commit of limbo code.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3169 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon d9eba25e04 Scripting system prep for 3.6.9
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3168 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon 955237e707 Revert changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3167 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon 2436225f7c Scripting system prep for 3.6.9
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3166 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon f2a8e7f280 Scripting system prep for 3.6.9
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3165 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
wmcoolmon e52c78e4ad Various sscripting fixes/updates; a couple new functions; esp. for mantis bug 0000893
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3163 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
taylor 56f81dbc45 properly initialize a few entries that were left zero'd by mistake
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3162 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
taylor 98e6495be0 don't Int3() here, it's actually going to happen in some cases when using -img2dds
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3161 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
taylor 7e0c7039fc this should hopefully fix cursor drift on multi-display configs
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3160 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:19 +10:00
Goober5000 fa62be36e1 change to ASCII
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3158 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
Goober5000 9d6a9f7df7 add fighterbay restriction code --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3157 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
Goober5000 cbbd87587d add capability for preloading special arguments NB: it's disabled for now, and it needs to be moved after sexps are parsed to work --Goober5000
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3156 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
taylor 5acf68533c remove init_decals declaration, it's in the header now since we build without decal support
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3155 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
Goober5000 9f6a77eb1b project changes for karajorma's fred stuff
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3154 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
taylor d9bafea31b change filename case to our standard (lower)
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3151 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma ae0431cfdd Alt Ship Classes inital commit
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3150 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 14f99808b8 Complete overhaul of how ship loadout is handled to support the use of variables for setting the class and quantity of ships present in loadout.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3149 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 350c550ef6 Added the alt ship class button
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3148 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 052c85eeec Added the set-class-dynamically and team-loadout-store-status ship flags
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3147 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 0921519b90 Prevented the modify variable dialog deleting or changing the type of variables which are used in Team Loadout
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3146 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma b799e5d64f Team Loadout from variable changes. Added alt ship classes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3145 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
taylor 907a14d209 be sure that we properly apply light to submodels (mainly for debris), looks *really* bad otherwise
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3144 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 35ba652848 Added Team Loadout from variables and alt ship classes changes
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3143 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 557ec22d13 *** empty log message ***
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3142 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma e00c1a0f1f no message
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3141 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma 8dae1dd94c Added the Team Loadout Change subcategory Added the deal-with-ship-loadout SEXP. It's only temporary but it give people an option other than having to roll their own events to fix up loadout at the end of a mission. Added the num_assists SEXP to complement the num_kills one. Updated the is-ship-class SEXP so that it can also act as was-ship-class for departed and destroyed ships. Updated change-ship-class to work with ships that aren't in the mission yet. Updated sexp_modify_variable to actually do the multiplayer callback that V had noticed was needed but never actually added.
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3140 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
karajorma e409144310 Added the Team Loadout subcategory (Only one SEXP in there at the moment but more will come). Added the num_assists SEXP to complement the num_kills one
git-svn-id: svn://svn.icculus.org/fs2open/trunk/fs2_open@3139 387891d4-d844-0410-90c0-e4c51a9137d3
2015-04-29 18:42:18 +10:00
taylor 8c4dfb2f0a hmm, wonder why I did that? ;) 2006-06-02 09:17:09 +00:00
karajorma 8727fb9dc1 Added the VARIABLE_UPDATE packet to send sexp variable value changes to client machines. 2006-06-02 09:10:02 +00:00
karajorma 41e34ebb02 Team Loadout changes to accept variables names as legitimate values for ship class and quantity in loadout.
Added the new alt class system
2006-06-02 09:06:12 +00:00
karajorma d1f4666aa9 Swaped from stuff_int_list to stuff_ship_list when parsing in a list of ships allowed in the campaign. 2006-06-02 08:59:58 +00:00
karajorma 11027dcb53 Added stuff_ship_list to act as a typesafe replacement for stuff_int_list and handle variables as legitimate values for both ship type and availability when parsing Team Loadout lists 2006-06-02 08:55:47 +00:00
karajorma 140c82e6ed Support for alt ship classes, team loadout flag and changes to Ships_exited. Fixed assertion upon multiple uses of the change-ship-class SEXP. 2006-06-02 08:49:35 +00:00
karajorma e39238d8eb Support for alt ship classes, team loadout flag and changes to Ships_exited 2006-06-02 08:46:47 +00:00
taylor 349ffc664f some more buffer size strangeness (which I still don't understand) that makes certain sound formats not work properly 2006-06-02 08:05:33 +00:00
taylor b7c87f6047 flip color/depth values, appears some are initting software GL again and this was the problem previously 2006-06-01 07:33:59 +00:00
taylor 81dab9c506 make sure to use software device rather than hardware since we don't currently handle source rotation/reuse properly between ds and audiostr code 2006-06-01 07:33:00 +00:00
taylor c85e077369 make sure FORM_ON_WING goal is valid since it works for ships other than player now 2006-06-01 04:47:23 +00:00
taylor 0968449eed put back listener setup for each sound, doesn't make a difference under Linux but it may be hurting Windows for some reason 2006-06-01 04:46:18 +00:00
taylor f78a5d462c a little change to the order here, this should be safer in the long run and avoid some memory issues too 2006-06-01 04:45:19 +00:00
taylor d9ca8734ad fix the scope issues that someone complained about in the forums 2006-06-01 04:44:19 +00:00
taylor 214a41b550 use vm_vec_normalize_safe(), a bit cheap as a fix, but it's really difficult to trace the VECMAT errors back from here 2006-06-01 04:43:49 +00:00
taylor b813983b32 put decals back under an #ifdef, until this is fixed it's just in the way 2006-06-01 04:41:43 +00:00
taylor f3f859d28e be sure to to reset ok_to_fire between weapon checks to make sure we don't count something by mistake 2006-06-01 04:40:41 +00:00
taylor e3f7b75542 render strings a string at a time rather than a letter at the time (should be at least 3 times faster from state changes alone) 2006-05-31 04:02:05 +00:00
taylor b10c96d9e2 bah! this thing is crashing. disable for now until I can figure out what's going on 2006-05-31 04:01:13 +00:00
Goober5000 02739c5393 whoops, didn't mean to commit that 2006-05-31 03:27:19 +00:00
Goober5000 3d73663123 some cosmetic changes in preparation for bay arrival/departure code
--Goober5000
2006-05-31 03:05:43 +00:00
Goober5000 baa5097bca fix compiler warning
--Goober5000
2006-05-31 02:08:22 +00:00
karajorma b74175a102 Got sick of seeing that compiler warning all the time! 2006-05-30 11:20:38 +00:00
Goober5000 741afab9cd fix up CVS headers
--Goober5000
2006-05-30 06:01:05 +00:00
Goober5000 068f05c3ab I should probably add these files too
--Goober5000
2006-05-30 05:58:59 +00:00
Goober5000 a3205a97dc add capability to restrict arrival/departure paths
(FRED only; FS2 implementation to follow)
--Goober5000
2006-05-30 05:37:29 +00:00
taylor aba67f6267 make sure we are locking those vars down in timer_get() to avoid thread issues (may fix hang on "timer rolled" message) 2006-05-30 03:55:09 +00:00
taylor 646e844eb2 z-range for 2D ortho is -1.0 to 1.0, may help avoid some strangeness if we actually get that right. :)
minor cleanup of old code and default settings
try not to bother with depth test unless we are actually going to need it (small performance boost in some cases)
don't clear depth bit in flip(), while technically correct it's also a bit redundant (and comes with a slight performance hit)
2006-05-30 03:53:52 +00:00
Goober5000 f441031018 add substitute music boxes to FRED, and reset music properly when mission is cleared
--Goober5000
2006-05-30 02:13:22 +00:00
Goober5000 f0842a8912 add AI Profile box to FRED
--Goober5000
2006-05-30 01:36:24 +00:00
Goober5000 cf29b0dbd6 add debriefing persona index to fred
--Goober5000
2006-05-30 01:08:10 +00:00
Goober5000 1188449341 removed small redundancy
--Goober5000
2006-05-29 19:14:30 +00:00
Goober5000 9957b565bc add Taylor's compile fix
--Goober5000
2006-05-29 02:02:17 +00:00
taylor 59f2a6039e fix D3D white screen issue 2006-05-28 18:40:37 +00:00
taylor 29bbede6b3 remove DX9 SDK since it's useless to us at this time 2006-05-28 17:57:29 +00:00
taylor f3f0bf9a8b minor safety check 2006-05-27 17:22:04 +00:00
taylor bdd4913020 update proj/view matrix calls to use new values 2006-05-27 17:21:37 +00:00
taylor c9af1ffaef clean up BM_TYPE_* stuff so it's a little easier to tell what is what
bm_load_sub_fast() doesn't need to lowercase filenames, so don't
byte-swap 16-bit DDS on big endian (they still don't look right though)
update bm_has_alpha_channel() to be less dumb
2006-05-27 17:20:48 +00:00
taylor 9296d24dc1 d'oh! that was supposed to be off by default! 2006-05-27 17:18:56 +00:00
taylor 8a05bf08b7 few things:
- comment out that -fixbugs and -nocrash crap, that's just stupid
  - move -env off of the experimental list (since it's working pretty well in OGL)
  - remove -nobeampierce
  - remove -max_subdivide (didn't do anything)
  - remove -rt (didn't do anything, and per-coder cmdline options should never be in CVS)
  - move -cache_bitmaps to game speed rather than graphics
  - add options for env and spec map scaling for envmaps (temporary, to be removed before official 3.6.8)
  - add option for new alpha blend mode so that artists can still test with it but not mess up normal users with the bad MediaVPs
  - remove -d3d_particle (it's obsolete now)
2006-05-27 17:17:57 +00:00
taylor 48bf296ee3 add NO_DIRECT3D support 2006-05-27 17:13:22 +00:00
taylor cdf8c8bdd0 NO_DIRECT3D support
clean up video init stuff to use D3D if specified but always OGL otherwise (using NO_DIRECT3D will force always force OGL)
if video card reg entry can't be found just use OGL rather than getting all freaky on people
change for geometry batcher update
2006-05-27 17:12:44 +00:00
taylor 76617a180d don't setup all of the sound stuff for a mission if sound is disabled 2006-05-27 17:09:43 +00:00
taylor adcb333069 oops! 2006-05-27 17:08:50 +00:00
taylor 72e567a7b9 remove grd3dparticle.* and grd3dbatch.*, they are obsolete
allow us to build without D3D support under Windows (just define NO_DIRECT3D)
clean up TMAP flags
fix a couple of minor OpenGL state change issues with spec and env map rendering
make sure we build again for OS X (OGL extension functions work a little different there)
render targets always need to be power-of-2 to avoid incomplete buffer issues in the code
when we disable culling in opengl_3dunlit be sure that we re-enable it on exit of function
re-fix screenshots
add true alpha blending support (with cmdline for now since the artwork has the catch up)
draw lines with float positioning, to be more accurate with resizing on non-standard resolutions
don't load cubemaps from file for D3D, not sure how to do it anyway
update geometry batcher code, memory fixes, dynamic stuff, basic fixage, etc.
2006-05-27 17:07:48 +00:00
taylor 0341e54f3c only display that "no wavefile for voice" message if sound is enabled 2006-05-27 17:00:02 +00:00
taylor 554197fc30 comment out some code which used only if neither D3D nor OGL 2006-05-27 16:59:05 +00:00
taylor 6bc34644ad comment out the model cache stuff, it's old and not actually used anyway
minor cleanup of some modelinterp.cpp code, to make it more readable
fix tertiary thruster batcher which had the radius value swapped
comment out a couple places where we were doing a D3D or OGL check (it's always true so why bother)
add more support for NO_DIRECT3D so that it can be used on Windows to build without D3D
2006-05-27 16:57:13 +00:00
taylor 43dd50673d lots of little cleanup and minor fixage
make Particles[] dynamic (appears to improve processing speed of two particle functions by about 30%)
move to completely using Bobboau's geometry batcher instead of the stale one that RandomTiger did
little change to PARTICLE_SMOKE to flip UV orient differently, may add some realism, or just look kinda neat
get rid of particle_emit() stuff what was hardcoded for MAX_DETAIL_LEVEL value
2006-05-27 16:52:50 +00:00
taylor eda1a26a94 comment out some pointless checks which look for not using either D3D or OGL
don't run through ships on level load setting up the sound environment if sound is disabled
minor cleanup
2006-05-27 16:49:05 +00:00
taylor 32440a7dbc remove some of the old batcher functions, nothing is using them now anyway
minor cleanup
add orient UV flipping to HTL drawing functions, like retail/non-HTL has support for
2006-05-27 16:47:12 +00:00
taylor f7d89326b0 some minor cleanup
remove -nobeampierce
update for geometry batcher changes
2006-05-27 16:45:11 +00:00
taylor 99a1c64fbb fix slight freakiness with debris vclips (un)loading
comment out some code which was only used if neither D3D or OGL
fix dumb particle_emit() calls
2006-05-27 16:42:16 +00:00
taylor 275c656fd7 remove non-Windows timeSetEvent() functions
make PDWORD and LPDWORD int instead of long (64-bit issue) (thanks Spike)
fix 64-bit ptr issue with OpenAL audio streaming code (thanks Spike)
add start of device enumberation for OpenAL 1.1 (it just lists available devices now)
make sure we open the default OpenAL 1.1 device under Windows
comment out blank listener stuff, this may have been crashing under OS X
add support for AL_BYTE_OFFSET in OpenAL 1.1 for buffer positioning under Windows
2006-05-27 16:39:40 +00:00
taylor 052b22557d remove grd3dparticle.* and grd3dbatch.* since they are obsolete
update to current Xcode project file
update frameworks (header problems) used by OS X version
2006-05-27 16:34:57 +00:00
wmcoolmon bc11c5193e Fix for Mantis bug #0000922 2006-05-24 05:09:25 +00:00
Goober5000 edf5648e70 fix for Mantis #750
--Goober5000
2006-05-21 22:57:30 +00:00
Goober5000 cd488f757d fix Mantis #834
--Goober5000
2006-05-21 03:58:58 +00:00
Goober5000 71d71f1de9 fix for Mantis #827
--Goober5000
2006-05-21 02:12:21 +00:00
Goober5000 1d9d98a2f9 and actually commit the uncorrupted file - grr...
--Goober5000
2006-05-20 03:00:06 +00:00
Goober5000 fc33bcb0b0 try changing the format again
--Goober5000
2006-05-20 02:56:11 +00:00
Goober5000 4448ef1c47 fix for Mantis #755, plus make the missionlog #defines uniform
--Goober5000
2006-05-20 02:03:01 +00:00
Goober5000 376dc3ece9 formatting and clarification, plus fix for Mantis #911
--Goober5000
2006-05-19 04:47:40 +00:00
taylor f431fd8804 fix bool compiler warning for MSVC 2006-05-18 14:56:02 +00:00
Goober5000 0e2d3156db fix for Mantis #875
--Goober5000
2006-05-16 15:54:39 +00:00
karajorma e9ed5f5cb7 Fix the lack of a background in FRED 2006-05-16 12:45:20 +00:00
Goober5000 6925e7c4cb fix directory goof
--Goober5000
2006-05-15 17:42:35 +00:00
karajorma 8d146ea024 no message 2006-05-14 16:02:02 +00:00
karajorma 86522a6452 Checkboxes for locking primary and secondary weapons and for disabling builtin messages from command and individual pilots 2006-05-14 15:57:43 +00:00
karajorma 5e9d27ee72 Fixes for the Targetable-as-bomb error from Mantis 0000910 (amongst others) 2006-05-14 15:54:16 +00:00
karajorma a682577a0e Fixes for the Invulnerability problems from Mantis - 0000910 2006-05-14 15:52:42 +00:00
taylor dc5d21a499 forgot to remove STRICT define before commit, gets rid of a Windows compiler warning 2006-05-14 05:22:43 +00:00
taylor 7a8789e334 OpenGL envmap support
newer OpenGL extension support
add GL_ARB_texture_rectangle support for non-power-of-2 textures as interface graphics
add cubemap reading and writing support to DDS loader
fix bug in DDS loader that made compressed images with mipmaps use more memory than they really required
add support for a default envmap named "cubemap.dds"
new mission flag "$Environment Map:" to use a pre-existing envmap
minor cleanup of compiler warning messages
get rid of wasteful math from gr_set_proj_matrix()
remove extra gr_set_*_matrix() calls from starfield.cpp as there was no longer a reason for them to be there
clean up bmpman flags in reguards to cubemaps and render targets
disable D3D envmap code until it can be upgraded to current level of code
remove bumpmap code from OpenGL stuff (sorry but it was getting in the way, if it was more than copy-paste it would be worth keeping)
replace gluPerspective() call with glFrustum() call, it's a lot less math this way and saves the extra function call
2006-05-13 07:29:52 +00:00
taylor 6b92385163 get rid of some wasteful math for gr_set_proj_matrix() calls
fix check that broke praise of kills for player
fix knossos warpin effect that always seems to get rendered backwards (I couldn't find anything that broke with this but I suppose it's a mod could have an issue)
2006-05-13 07:15:51 +00:00
taylor ba41389677 make sure sound buffers are valid before trying to delete them (was causing crash issues on Windows and OS X) 2006-05-13 07:11:46 +00:00
taylor 2a94d55007 some Windows specific OpenAL changes
add MVE files to MSVC6 project
2006-05-13 07:10:37 +00:00
taylor a39e8900e1 minor cleanup and a couple extra error checks
get rid of some wasteful math from the gr_set_proj_matrix() calls
2006-05-13 07:09:25 +00:00
taylor 05bc308f89 Vodka, it's a killer ;) 2006-05-13 07:03:41 +00:00
taylor 0a0249edbd add lazy (ie, faster) checking of asteroid collisions for time-to-impact 2006-05-13 07:02:27 +00:00
taylor 61f1a81ed7 fix bug where anything that wasn't a ship was considered a non-goal 2006-05-13 07:01:17 +00:00
taylor dd54d8a3b4 MVE player (audio only works with OpenAL builds!) 2006-05-13 06:59:48 +00:00
taylor 4bd5e7e9c6 add newest OpenAL SDK, this makes things easier as OpenAL is now the build default 2006-05-13 06:58:07 +00:00
taylor a42c27c5da add some missing headers, got tired of doing this myself when I did a build under Windows 2006-05-13 06:55:54 +00:00
Goober5000 342175f0d0 fixed build bug under WinXP
--Goober5000
2006-05-10 23:49:46 +00:00
taylor 38f72231a9 if in freecamera mode, or the hud is disabled, the don't draw scripted hud elements
(this is almost hackish, but the bug never got a comment from WMC, so he can fix it later if this is wrong)
2006-05-09 09:23:05 +00:00
taylor 1a607e82c7 fix incorrect button locations, it matches the correct layout of the other techroom screens now
(thought Backslash was going to fix this, but I got tired of waiting. :))
2006-05-09 09:21:15 +00:00
taylor 6a6c04c3fd remove SCP Lite build option, the rest of the code for it was long since removed
remove the glBindBufferARB lib check, the soon-to-be-committed extension code upgrade will handle the issue much better
2006-05-09 09:19:38 +00:00
phreak 21519056b6 the -decal command line doesn't enable decals anymore, just pops up a messagebox in windows saying that decals are disabled from now on. 2006-05-04 21:25:12 +00:00
phreak d76f952202 You can now preview sounds again in the event editor. 2006-04-30 16:39:43 +00:00
Goober5000 74857b8d6e tweak for yesterday's file name change 2006-04-20 17:38:25 +00:00
taylor 0c5b8c7cf6 makefile fixage 2006-04-20 16:24:48 +00:00
Goober5000 7e41877b7b proper capitalization according to Volition 2006-04-20 06:32:30 +00:00
Goober5000 1908007d1d change animation.cpp to modelanim.cpp, add CVS info, and add the file to the VC6 project
--Goober5000
2006-04-20 05:42:05 +00:00
bobboau 707095bf05 bugfix for the animation system 2006-04-18 02:33:59 +00:00
bobboau 7c36a78db8 bugfix for the animation system 2006-04-18 00:56:28 +00:00
phreak 96d32f8c56 fix FRED crashing if the user adds multiple waypoint paths then inserts more ships. 2006-04-18 00:08:23 +00:00
karajorma 3aa0b945b0 Some how managed to fail to commit the primary-locked and secondary-locked ship flags.
No idea how. Oh well here they are.
2006-04-16 11:58:11 +00:00
taylor 380b0de996 extra safety check when creating a default path string, filename is optional be we need to available if root0 is missing (CFILE not initted yet)
fix that crazy compiler<->constructor<->linker<->server.txt deal caused by some bad code and a freaky link thing in freespace.cpp
2006-04-16 05:28:10 +00:00
taylor b296bcea3a compiler warning fix, missed this one previously 2006-04-16 05:24:58 +00:00
taylor cebae27cfd probably doesn't need to be world readable, but certainly doesn't need to be world writeable
add Assert() to can when we are stupidly trying to allocate 0 or less size bytes in vm_malloc()
2006-04-16 05:24:16 +00:00
taylor 124942a8ec some optimizations for *nix 2006-04-16 05:22:21 +00:00
taylor e6ae06c8c0 forgot to add forward declaration for allocate_mission_text() (thanks karajorma ;)) 2006-04-15 19:00:52 +00:00
phreak 458a19f5a2 use gr_flash_alpha() for fade-in/fade-out effect.
just using gr_shade() will not work with the hud off or using an external camera.
2006-04-15 04:17:58 +00:00
phreak 0972de3462 gr_flash_alpha(), much like gr_flash(), but allows an alpha value to be passed 2006-04-15 00:13:22 +00:00
taylor ab7f22e9d8 Grrr! That was still stupid. Just going to revert it to retail and work out that bug it was supposed to fix at a later time. 2006-04-14 21:13:31 +00:00
taylor f7aa263c5d that was rather stupid of me, fogetting this would not have been a good thing :) 2006-04-14 18:50:52 +00:00
taylor e35065bc0d remove all of the *_ex() parsing functions added for use by EFFs
add a pause/unpause for parsing so that we can safely start parsing something new then continue parsing something old
make Mission_text and Mission_text_raw only use the memory needed, and free it when it doesn't need to parse anymore
  (should work ok with FRED2, but I wasn't able to test it)
2006-04-14 18:44:16 +00:00
taylor e3c8fa8f51 make sure that modular star tables actually work without going into an endless loop, or constantly complaining on you 2006-04-14 18:40:44 +00:00
taylor a79daa2285 something that Valgrind complained about 2006-04-14 18:39:38 +00:00
taylor ef8095f53c giving a tbl name in this warning message is basically useless since there we can't tell which tbl this particular ship is in 2006-04-14 18:39:06 +00:00
taylor 859482541c more checking to make sure that the malloc calls are actually needed 2006-04-14 18:37:06 +00:00
taylor 4fb6d6ba91 I might have blamed this on sleep, if it wasn't a bold faced lie. ;)
- another part of the turret untargetting target bug
2006-04-14 18:36:11 +00:00
taylor 069698806d make sure we don't allocate any memory for turrets unless there are some, was causing a few various memory issues, mainly for debug builds
(there is more of this same checking on the way for the other malloc() calls during model loading, and vm_malloc() will be set to
   Assert() on a 0 or less size as well)
2006-04-13 12:19:33 +00:00
taylor 2ba79e102e deal with font rendering issue from float precision on non-standard resolutions. this is only about a 97% fix/hack
but I don't want people complaining about the bad issue until I can figure out a more appropriate solution with
  gr_set_clip(), which is the real source of the problem
2006-04-13 12:15:58 +00:00
taylor af8ee7a283 bah! forgot to add a blasted = on that check 2006-04-13 12:12:27 +00:00
taylor 7828fc7e6f compiler warning fixes to make GCC 4.1 shut the hell up 2006-04-12 22:23:41 +00:00
phreak 9513105b52 get jump nodes rendering again..... again. 2006-04-12 05:30:50 +00:00
phreak 122a5c6453 obj_delete() needs to be called for jump nodes since the slot the jump node
that used to reside in hasn't been marked as empty.  This leads to the node still appearing in fred
if the user tries to delete the "ghosted" jump node, fred crashes.
2006-04-12 05:07:00 +00:00
taylor 2ee9d66423 some cleanup and slight reorg
- remove special uv offsets for non-standard res, they were stupid anyway and don't actually fix the problem (which should actually be fixed now)
 - avoid some costly math where possible in the drawing functions
 - add opengl_error_string(), this is part of a later update but there wasn't a reason to not go ahead and commit this peice now
 - minor cleanup to Win32 extension defines
 - make opengl_lights[] allocate only when using OGL
 - cleanup some costly per-frame lighting stuff
 - clamp textures for interface and aabitmap (font) graphics since they shouldn't normally repeat anyway (the default)
   (doing this for D3D, if it doesn't already, may fix the blue-lines problem since a similar issue was seen with OGL)
2006-04-12 01:10:35 +00:00
taylor ac57d4d55e more s/colour/color/ changes
throw in a couple of safety checks for some neb2 functions
2006-04-12 01:03:00 +00:00
taylor 9483b0a7d2 some small optimizations and cleanup
use floats for gr_bitmap() size and positions, mainly for non-standard resolutions since this allows proper resizing and positioning
  (the cast to float was happening later anyway so there should be not additional slowdown from that with standard resolutions)
change g3_draw_2d_poly_bitmap() to use floats instead of ints, gets rid of the extra cast and allows better resize values
2006-04-12 01:00:58 +00:00
taylor 6f5aedc929 that's a rather expensive function to call twice per frame, we should only need to call it once per mission and not ever have to reset it to some middle value 2006-04-12 00:55:16 +00:00
taylor 21311268f7 DDS now works well on the interface, but I forgot to every commit the CFILE change so that they are actually usable :) 2006-04-12 00:53:26 +00:00
taylor bc2ffa4dd5 keep forgetting to add this 2006-04-12 00:52:32 +00:00
phreak 9c40dfa5b9 undo mission list changes for now while taylor is out of town and unable to commit the rest of the codebase. 2006-04-09 19:50:19 +00:00
karajorma e8a819366b Added SEXPs to lock and unlock the primary and secondary weapons 2006-04-07 20:17:33 +00:00
taylor 0892a36bcf perhaps this will fix the white splash screen issue on Windows (been sitting on this, might as well commit it) 2006-04-06 23:25:17 +00:00
taylor bb99432d75 bits of cleanup
minor fixes for -img2dds
2006-04-06 23:23:56 +00:00
karajorma 1f55522ea0 Damn spelling mistakes. And in the only place where it would be visible too! 2006-04-06 20:44:14 +00:00
Goober5000 e85a66b369 small fix 2006-04-06 18:53:28 +00:00
wmcoolmon e1ff2ce649 Better scripting team support. (Just a tad) 2006-04-06 05:28:30 +00:00
karajorma 3eabe542c2 Bah! Silly error. 2006-04-05 19:59:11 +00:00
karajorma 526963be65 Support added for the Enable/Disable-BuiltinMessages SEXP 2006-04-05 17:54:25 +00:00
karajorma b8a871fed5 Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:56:57 +00:00
karajorma ac4eb09f1e Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:46:40 +00:00
karajorma 26d6abfbba Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:29:53 +00:00
karajorma fd2346e37e Changes to support the new Enable/Disable-Builtin-Messages SEXP 2006-04-05 16:14:04 +00:00
taylor 9c293fdb34 remove -tga16, it's obsolete now
add a temporary -no_emissive_light option to not use emission type light in OGL
2006-04-05 13:47:01 +00:00
taylor 734bc91bfa correct some coding mistakes 2006-04-05 13:45:08 +00:00
taylor 15bdbb7c85 fix linking, again. 2006-04-05 13:44:30 +00:00
wmcoolmon b9f263495a Maneuvering hruster scaling, gun convergence 2006-04-04 11:38:07 +00:00
wmcoolmon 4e3eab978c Bump this, too 2006-04-03 09:07:34 +00:00
wmcoolmon 965cc660b9 show-subtitle's got its groove back 2006-04-03 09:05:37 +00:00
wmcoolmon 9094e38372 Maneuvering thruster fixes 2006-04-03 08:09:32 +00:00
wmcoolmon def1993de8 Miscellaneous minor changes, mostly related to addition of Current_camera variable 2006-04-03 07:48:03 +00:00
wmcoolmon 71a596cc09 Scripting support for cameras, as well as for moving model subobjects 2006-04-03 07:47:07 +00:00
wmcoolmon fb286f1706 gamesnd_get_by_name now ignores extensions, mostly for parse_sound reasons. 2006-04-03 07:45:43 +00:00
wmcoolmon 4e5089a7bd camera code updates (Translation should be possible now) 2006-04-03 07:45:15 +00:00
wmcoolmon 0a62d80db6 $Warp time and $Warp speed vars 2006-04-01 01:21:58 +00:00
wmcoolmon f7659ed341 Prelim. BSG warpin effect stuff 2006-03-31 10:20:01 +00:00
Goober5000 c635560a1c those were some bugs just waiting to happen 2006-03-30 04:18:40 +00:00
Goober5000 c8029346cd hehe, grammar
--Goober5000
2006-03-30 04:15:20 +00:00
karajorma 7fe2886e3b Added the set-primary-weapon and the set-secondary-weapon SEXPs. Updated the corresponding
set-x-ammo SEXPs to also accept a rearm limit.
2006-03-28 11:41:57 +00:00
taylor c6d9c1ad1e forgot to ever change this stuff
- version bump to 3.6.8 for configure file
 - the Frameworks package for OS X is now a tarball rather than a zip file
2006-03-26 10:31:02 +00:00
taylor 6c54f20ef5 make sure to only allow on screen save at the time (I don't like having it restricted but since it's not used for anything else there is little point) 2006-03-26 08:26:45 +00:00
taylor 817c840273 the bmpman release issues for the chatbox should be fixed now so we can go back to using bm_release() on the bitmaps
Chatbox_p_coords (the multi-pause background) should be at 0,0 (even though this isn't used I thought it was a good idea to go ahead and fix it)
2006-03-26 08:25:05 +00:00
taylor b39d880ed4 split pause_*() and multi_pause_*() functions into individual single and multi versions (why it was hacked up like that I'll never know)
fix screen save in multi pause mode
address some bmpman issues from interface graphics getting released and then still used by something else
2006-03-26 08:23:06 +00:00
Goober5000 27f5671b52 this should fix random-of
--Goober5000
2006-03-26 06:42:01 +00:00
taylor 8d6162b7ab fix model_allocate_interp_data() extern for OSX 2006-03-25 22:44:52 +00:00
taylor 7a65e0e972 add OGL headers to CFLAGS for OSX 2006-03-25 22:44:04 +00:00
taylor 065924508b the previous changes should prevent these things from happening, but drop in some more Assert()'s anyway 2006-03-25 22:38:15 +00:00
taylor ab5ce4d7e1 modelinterp.cpp: that little bit really isn't needed
popup.cpp:  GCC 4.1 warning fixes
2006-03-25 10:41:44 +00:00
taylor bcdb0b67db don't run through game_shade_frame() every frame unless we are in a game-play state 2006-03-25 10:40:38 +00:00
taylor 01d9f454ee minor cleanup
address numerous out-of-bounds issues
add some better error checking and Assert()'s around
2006-03-25 10:38:44 +00:00
Goober5000 bb4324969d hopefully fix this :( 2006-03-24 18:40:13 +00:00
wmcoolmon d95d6165b5 New subobject animation stuff and Lua functions. 2006-03-24 07:38:36 +00:00
Goober5000 51167b1b95 add nav flag to def_files
--Goober5000
2006-03-24 05:08:23 +00:00
Goober5000 a95eeb4e97 tweak karajorma's fixes... these should work exactly the same but are closer to my original intent 2006-03-24 05:08:19 +00:00
taylor ac19ddcadb address out-of-bounds issues for Sounds[] when unloading 2006-03-22 21:42:55 +00:00
taylor ed38329dfc minor warning fixage 2006-03-22 18:20:06 +00:00
taylor 4feb121a5a if -mipmap is used with -img2dds to then have compressed image also contain mipmaps
use nicest hints for texture compression, should improve quality a little
when reporting compressed sizes to debug log make ani size be total, not per frame
2006-03-22 18:14:52 +00:00
taylor 2205a9e660 minor cleanup 2006-03-22 18:12:50 +00:00
taylor 9e7c73fe88 don't really see the point of the Assert() here, just bail if it's an issue 2006-03-22 18:12:16 +00:00
taylor f361c7272c GCC 4.1 barfed on this 2006-03-22 18:11:28 +00:00
karajorma b9f3ed9328 Fixed Random-Of so that it finally works properly. and doesn't ignore the last items on the list.
Fixed Rand-Multiple so that when seeded it works the way I originally designed it to. Previously it was
working exactly the same as rand when seeded.
2006-03-22 16:24:20 +00:00
taylor be031fa0e3 fix text subtitles that I so kindly broke not too long ago 2006-03-22 08:34:17 +00:00
karajorma 45ead66153 Bah. More errors fixed. This time in in-sequence 2006-03-22 01:36:21 +00:00
karajorma ee92a2a0b3 Added the In-Sequence conditional. 2006-03-21 17:19:01 +00:00
taylor 956cc85410 add commands to view from and change target in viewer mode pause
also add reset ability to both view mode and hud state to return to pre-pause settings
2006-03-21 14:19:18 +00:00
Goober5000 52809741c6 fix taylor's fix :p
--Goober5000
2006-03-21 02:50:59 +00:00
taylor f08d2f8043 some minor cleanup 2006-03-21 00:27:27 +00:00
taylor a12024d715 fix target eval check for weapons so that friendly ships will stop shooting at friendly bombs 2006-03-21 00:08:18 +00:00
taylor b35e8870b2 change wording to ease Goober's ulcer. ;) 2006-03-20 06:25:19 +00:00
taylor 7233ba1db8 add ai_profiles flag to get rid of limit on minimum speed a docked ship can move
(not going to Int3() here from < 0.1 speed by default, a support ship actually hit it)
2006-03-20 06:19:04 +00:00
taylor 026c57c063 fix D3D/OGL test for asteroid rotations (I was far too excited about the result of this :() 2006-03-20 06:16:45 +00:00
taylor 4816d5e4c0 might as well do star antialiasing for OGL too 2006-03-20 06:13:35 +00:00
taylor 6930e3eb6a make sure the mission log doesn't modify stuff in Cargo_names[], since it shouldn't
have split_str_once() be sure to not split a word in half, it should end up on the second line instead
2006-03-19 05:05:59 +00:00
Goober5000 58b58745aa added set-death-message sexp
--Goober5000
2006-03-18 22:43:16 +00:00
Goober5000 36605519ca blast 2006-03-18 22:18:24 +00:00
Goober5000 72c2a5c356 fix comm order initialization bug
--Goober5000
2006-03-18 22:00:43 +00:00
taylor 6b476586a5 add framerate var since it's contained in freespace.cpp and that's not used in a FRED2 compile 2006-03-18 21:23:38 +00:00
wmcoolmon 809bcc8f76 Nitpicketiness 2006-03-18 20:24:54 +00:00
taylor e4977bad12 meh. 2006-03-18 10:28:58 +00:00
taylor d8997a3169 fix out-of-bounds problem in awacs checking (full neb missions may have been a bit freaky from this) 2006-03-18 10:28:25 +00:00
taylor a5d0bc4007 make sure errors in rand_sexp() and rand_internal() are properly handled 2006-03-18 10:26:42 +00:00
taylor 79661b3a3f some cleanup to the nebula debug console help messages 2006-03-18 10:25:45 +00:00
taylor a31f44a4a8 never try and load glow or shine maps if we don't have a base map for it
but WMC's bumpmap block in a BUMPMAPPING define since it useless most of the time
2006-03-18 10:25:05 +00:00
taylor 13a9c694c9 make the main vital TMAP_MAX_VERTS stuff dynamic, should handle the major non-HTL related crashes 2006-03-18 10:23:46 +00:00
taylor f8596e6e18 we already have a variable to show the framerate so lets just use the one 2006-03-18 10:17:59 +00:00
wmcoolmon 9198b46de8 Allow "none" in $Shockwave Model to disable shockwave 2006-03-18 09:25:55 +00:00
Goober5000 27992b09cf add ship-subsys-targetable and ship-subsys-untargetable
--Goober5000
2006-03-18 07:12:08 +00:00
taylor ecf01b39c9 this should fix the secondary thruster effect flow direction problem 2006-03-17 18:26:40 +00:00
taylor 92e49f9bef beyond some possible out-of-bounds issues, I think this stuff was messing up non-HTL lighting too 2006-03-16 14:23:35 +00:00
taylor 272c4feec8 make sure our event state doesn't get filled with things we should poll for (was waiting for the new input code, but really needed to get at least this in) 2006-03-15 17:35:24 +00:00
taylor 676cee0dfe couple of nitpicks 2006-03-15 17:33:05 +00:00
taylor a4a6211dc1 bump error msg buffer size a little (I'll probably just go dynamic with this since you hopefully won't get this too much anyway) 2006-03-15 17:32:13 +00:00
taylor 7a0228fefe remove alut headers, since we don't use any alut functions anyway (didn't I already do this a couple of months ago??) 2006-03-15 17:30:47 +00:00
taylor f91f20b94a bump sexp nodes to 4000 for TBP, really needs to go dynamic soon 2006-03-12 07:35:33 +00:00
taylor df3debd00d when I forget that I'm an idiot little things like this slip through (me == moron) 2006-03-12 07:34:39 +00:00
taylor 143649a771 gah, how stupid could I have been! gotta make sure that the symlinks are preserved (keeps file size down too). 2006-03-12 07:31:20 +00:00
taylor 95fa276241 update Makefile.am for all of the project files changes, include Xcode stuff too
update code/Makefile.am with FRED2 stuff, might as well in case someone wants to do a winelib port or something
2006-03-08 05:24:11 +00:00
taylor 2625427c4d remove asm from MulDiv() since Intel Mac doesn't like it very much, and it doesn't do exactly what it should anyway 2006-03-08 05:22:14 +00:00
taylor 4be8b5b054 add model_allocate_interp_data() extern for PPC machines 2006-03-08 05:15:20 +00:00
taylor 1480d671f5 update project file with a bunch of cleanup and universal binary building support
add a Frameworks.zip which contains pre-made universal binary frameworks for Ogg, Vorbis and SDL
2006-03-08 05:13:10 +00:00
taylor 09f4108991 add Frameworks directory to the ignore list 2006-03-08 05:09:53 +00:00
taylor d3e09d3ac1 don't need these with new project file and frameworks 2006-03-07 09:21:21 +00:00
taylor 36f4910681 make filename length checks non-fatal 2006-03-06 16:30:06 +00:00
taylor a4bc040ddd various small cleanups, fixes, error checks 2006-03-05 21:45:12 +00:00
taylor d4997b0e9a remove WMC's "speed increase" ;) (the math isn't right yet so the collision checks won't be correct, and fixing it to work right wouldn't be any faster) 2006-03-05 18:00:55 +00:00
karajorma ae0ca70b81 Bah. Error in secondary and primary ammo SEXPs fixed 2006-03-04 11:05:47 +00:00
Goober5000 f0f75c4b5c fix the random-of sexps to only choose valid arguments 2006-03-03 06:14:41 +00:00
Goober5000 a166d8dfd2 took care of (hopefully) the rest of Karajorma's SEXP node handle conflicts, plus merged the random sexps with their multiple variants 2006-03-02 04:05:27 +00:00
karajorma 2199ffd0dd Fixed a bunch of bugs with Set-x-ammo and Rand SEXPs. 2006-03-01 23:22:25 +00:00
karajorma 4f8e2ab5a4 Added the random-multiple-of SEXP and fixed random-of to work as designed 2006-03-01 20:54:35 +00:00
karajorma fc01cf65cb Changed text FRED displays for Fade-In and Fade-Out SEXPs 2006-03-01 14:53:15 +00:00
Goober5000 cf31373781 fix comm message localization 2006-03-01 04:01:37 +00:00
Goober5000 cbc8ae14ca not needed... and just an annoyance with > 2 main halls 2006-03-01 04:01:15 +00:00
Goober5000 ecea6ace41 oswpt wing fix 2006-03-01 03:14:22 +00:00
Goober5000 8599f5779c more FS1 import tweaks 2006-03-01 00:46:11 +00:00
wmcoolmon 817ea347d8 Silly mistake 2006-02-28 07:52:04 +00:00
Goober5000 d620aed4ab fix another import bug 2006-02-28 07:37:12 +00:00
Goober5000 53e55777f7 cool stuff with main hall music tracks 2006-02-28 06:59:28 +00:00
Goober5000 4c272613da fix the animation type triggers 2006-02-28 05:16:55 +00:00
Goober5000 a655058346 add log entry for jettison-cargo 2006-02-27 04:17:11 +00:00
wmcoolmon a2c815144b x != y, surprisingly enough 2006-02-27 01:21:03 +00:00
wmcoolmon 51b5c481a9 Bump MAX_TFP to 10 2006-02-27 00:51:03 +00:00
wmcoolmon 5ab3f6cb11 Consistency in Lua 2D funcs; fix FRED2 loading screen images dialog boxes. 2006-02-27 00:40:34 +00:00
wmcoolmon 061dc31594 Afterburner & meta updates 2006-02-27 00:15:08 +00:00
wmcoolmon 0f47fb3dd2 Targetable as bomb SEXPs and dialog stuff; made invulnerable an object flag in both FRED and FS2. 2006-02-26 23:23:31 +00:00
Goober5000 8c580f8550 wow, over a year later and I'm still finding docking bugs :p 2006-02-26 22:47:11 +00:00
wmcoolmon 05f187b921 SF2_TARGETABLE_AS_BOMBER flag, Lua gr_bitmap_ex fix 2006-02-26 22:23:01 +00:00
Goober5000 4fc7c30a4d some more WCSaga stuff 2006-02-26 18:49:07 +00:00
taylor c9c87b8019 one friggin line, should have been able to notice that sooner 2006-02-26 11:09:31 +00:00
taylor 3affad73d1 another non-linear campaign fix, this one affected PVs 2006-02-26 08:06:57 +00:00
Goober5000 df9df096e1 fix stupid bug 2006-02-26 05:32:55 +00:00
Goober5000 ab23b030ad guess this is still needed 2006-02-26 05:32:38 +00:00
Goober5000 d979eb4f30 bah 2006-02-26 01:32:23 +00:00
Goober5000 3576d1c846 fix subsystems for get-object-* 2006-02-26 00:43:10 +00:00
Goober5000 6cd9711872 some paring down of sexps 2006-02-26 00:22:15 +00:00
Goober5000 f361e116f7 import tweak 2006-02-25 22:06:57 +00:00
Goober5000 b52b6b1e00 spelling 2006-02-25 21:47:19 +00:00
Goober5000 90c9c9e196 fixes from last commit 2006-02-25 21:42:31 +00:00
Goober5000 657aeefcec added function for retrieving a ship, wing, waypoint, or team from a sexp argument
--Goober5000
2006-02-25 20:18:14 +00:00
Goober5000 c72eb31dd5 some tweaks to the ignore code 2006-02-25 19:03:39 +00:00
karajorma 9e2946f49d Added Seeding functions to Rand and Rand-Multiple SEXPs 2006-02-25 17:34:23 +00:00
wmcoolmon 5d7847a54b Fix no text for splash screen scripting problem 2006-02-25 06:57:58 +00:00
taylor 7ee4923324 try and make some sense out of that cmdline option mess, maybe it will stay sane for a few days at least :) 2006-02-24 07:36:49 +00:00
taylor 476ab31130 add v-sync support for OGL (I skimmped on this a bit but will go back to do something better, "special" extension wise, at a later date) 2006-02-24 07:35:48 +00:00
taylor 6fd0b02ea1 fix custom loading screens that I manage to break yet again
add a "MaxFPS" registry/ini option to specify a FPS cap, useful if you can't make use of v-sync for some reason
2006-02-24 07:34:07 +00:00
taylor bb1ca10fcd vm_extract_angles_vector() doesn't do the same thing that this code used to so don't use it 2006-02-24 07:32:11 +00:00
taylor 6c0170fa23 clean up some of that FS2OpenPXO crap (can't wait to rip all this out for official PXO :)) 2006-02-24 07:31:18 +00:00
taylor e62b022333 compiler warning fixage 2006-02-24 07:30:23 +00:00
wmcoolmon d35972621b Maybe fix ships-limit bug 2006-02-24 05:13:26 +00:00
Goober5000 b865037e38 remove my old anti-frustration thing since it's not what retail does
--Goober5000
2006-02-24 05:02:34 +00:00
wmcoolmon e02526541e I love it when bugs are this easy to fix. ;) 2006-02-24 04:45:00 +00:00
taylor 6880def156 attempt to fix bad out-of-bounds (and related) issues when weaponchoice icon is missing
be sure to always initialize frame count and FPS with bm_load_animation() calls in case caller got lazy
2006-02-23 06:21:56 +00:00
karajorma 272a93b423 Added the String-to-int SEXP. 2006-02-23 01:37:51 +00:00
taylor 4842f0a7f7 fix subsystem distance check from single ship to subsystem (this has been broken since day 1, over 3 years ago, so there could be other Mantis bugs relating to this) 2006-02-22 18:32:18 +00:00
karajorma 45fac1c94a Changed the set-secondary-ammo and set-primary-ammo SEXPs to use the banks
capacity rather than starting ammo.
2006-02-22 00:04:04 +00:00
karajorma 3f7b89566b Fixed the problems with set-primary-ammo and set-secondary-ammo SEXPs 2006-02-21 22:20:04 +00:00
karajorma 965225ec53 Added the get and set-primary-ammo SEXPs. The set-primary-ammo
and set-secondary-ammo SEXPs appear to be broken at the moment though
2006-02-21 21:40:25 +00:00
Goober5000 1145996990 more true/false tweaks and redid the get-object-* and set-object-speed-* sexps to be more flexible and extensible
this will break compatibility with certain uses of these sexps in existing missions; I don't think there are any released campaigns
with the old versions so hopefully mission designers can simply update unreleased missions... however if it gets to be a problem
I will code in some reverse compatibility

--Goober5000
2006-02-21 09:08:10 +00:00
Goober5000 57c4855e25 add a bunch of tweaks to hopefully lessen the possibility of misinterpreting special return values (such as nan) as true or false
--Goober5000
2006-02-21 07:58:01 +00:00
taylor 812ce9f4a0 make changed object type debug message a bit more useful 2006-02-21 07:12:59 +00:00
karajorma 716d0fc8b8 Added the num-ships-in-wing, get-secondary-ammo and set-secondary-ammo SEXPs 2006-02-20 20:53:11 +00:00
Goober5000 7efe44ef55 fixed several more things in the new ignore code
--Goober5000
2006-02-20 07:59:26 +00:00
taylor 66d317b2ab updated to newest dynamic starfield code
- this mainly is to just better support SEXP based starfield bitmap changes (preloading, better in-mission stuff loading)
 - also fixes index_buffer related double-free()
 - done waste memory for env index buffer if env is not enabled
 - address a couple of bm load/release issues and comment a little to tell why
2006-02-20 07:30:15 +00:00
taylor 7f2c88fa5c div-by-0 bug fixage 2006-02-20 07:26:07 +00:00
taylor dd962df79e handle badly encoded (has short reads due to strange block/data size ratio) ADPCM files a little better in debug builds 2006-02-20 07:25:14 +00:00
taylor 6884c57e2e start of some of the newer GL stuff
- initial support for dropping from fullscreen to windowed mode (will get more changes in another day or so, mainly because of FRED2)
 - a little cleanup
 - init change for WGL to be a little safer and to help report what it tried to use and what it got in the way of pixelformat
 - don't use global OGL_enabled to decide if GL is initialized or not (also getting more changes shortly)
 - make sure opengl_close() will always execute properly through atexit() (also getting changed later to not run through atexit())
2006-02-20 07:23:29 +00:00
Goober5000 3828f19c1b hmm, remove one form of commenting 2006-02-20 05:54:44 +00:00
Goober5000 c27ccf94c4 added ai-ignore-new which hopefully should fix the ignore bug
--Goober5000
2006-02-20 02:13:08 +00:00
Goober5000 f16318cf44 reduce confusion in naming
--Goober5000
2006-02-19 23:14:22 +00:00
Goober5000 bb95da72a8 restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
--Goober5000
2006-02-19 22:00:10 +00:00
Goober5000 f665e3928b rearrange some turret code to be more like retail
--Goober5000
2006-02-19 07:20:43 +00:00
Goober5000 549be4382f fix stealth
--Goober5000
2006-02-19 03:17:01 +00:00
wmcoolmon 01d584e9eb Oops 2006-02-19 02:04:40 +00:00
wmcoolmon 50212a153d Documentation consistency; remove unneeded check. 2006-02-19 02:01:24 +00:00
Goober5000 030c78174b breathalyzer for WMC, stat!
--Goober5000
2006-02-19 00:59:49 +00:00
Goober5000 b7b71d06cf fixed saving of special tags
--Goober5000
2006-02-19 00:49:41 +00:00
Goober5000 8be490655a additional error checking
--Goober5000
2006-02-19 00:32:47 +00:00
Goober5000 02d0c78cac center cbanis
--Goober5000
2006-02-19 00:29:39 +00:00
wmcoolmon b1ea781c57 Introducing draw_model_rotating; many improvements to weapon selection missile rendering 2006-02-18 00:42:51 +00:00
wmcoolmon e8b4fa8508 Fix a silly bug 2006-02-17 21:47:47 +00:00
Goober5000 d40ff02354 bother those variables 2006-02-17 08:36:16 +00:00
Goober5000 07582f16ad fix subtle bug
--Goober5000
2006-02-17 08:13:53 +00:00
wmcoolmon e5d2f05618 Various updates for consistency in documentation 2006-02-16 06:00:49 +00:00
taylor ed3380aafb keep weapon model refcount correct (this is admittedly strange, but safer than before) 2006-02-16 05:48:48 +00:00
taylor 222a225eb8 I never did really like the old audiostr OpenAL change here, this just seems safer
initialize si->data and si->size before loading sound buffer (fixes OGG issue for plats that don't zero-initialize <vector>, this will be handled differently in the new code)
2006-02-16 05:47:32 +00:00
taylor 9ede455899 remove reset of modelnums on level start (more properly moved to model_unload())
minor change ship class fixage to clear out old model
take better care to make sure that a ship model has the proper refcount (this needs further work, I don't like :V:'s crap here)
add <string> to includes in ship.h, fixes a compile issue that I forgot to fix properly before (thanks Jens)
2006-02-16 05:44:53 +00:00
taylor edf5adf90c please stop modifying the passed node value in sexp functions, it makes it very difficult to debug problems 2006-02-16 05:40:58 +00:00
taylor db8d3c01bb some FS2NetD fixes
- timer/timeout issues
 - keep server heartbeats to a minimum in order to save some bandwidth
 - clean up some debug message a little
2006-02-16 05:39:13 +00:00
taylor 9e857ae2c4 NULL vec warning fix (basically just setup as if it were NULL and skip the extra work if needed)
more bmpman related fixes, mainly addresses the condition where it would try to render textures that have been released
have model_unload() run through Ship_info[] and clear out modelnum's when they are free'd (makes more sense here than doing it on level load to keep counts right)
fix missing subsystem warning messages
2006-02-16 05:31:00 +00:00
taylor b43962d929 should fix some of the model/bmpman errors off of the weaponchoice screen 2006-02-16 05:24:35 +00:00
taylor 9436c62e53 I would say this is another selling point for the boozer-svn plugin, but I would have needed it too as I've missed this stuff several times 2006-02-16 05:19:46 +00:00
taylor 849cc24fbe all just getting basic info in parse_mission_info(), this fixes several parsing/warning issues that can show up
from going in the techroom and some similar FRED2 issues as this stuff doesn't get reset between get_mission_info() calls.
  this also should make the mission simulator screen load a bit faster
2006-02-16 05:18:48 +00:00
taylor 0af0be32fa fix strangeness with persona index thingy (ubyte can't be -1, this needs to be left like this or make an int)
address some pilot file corruption using non-linear campaigns, rather simple fix for something that took quite a while to track down
2006-02-16 05:15:48 +00:00
taylor 93fff67c50 NULL vec warning fix (I don't really like this one that much so it may get replaced later) 2006-02-16 05:09:26 +00:00
taylor 7bd5d26e10 minor 64-bit related fixage 2006-02-16 05:07:50 +00:00
taylor c41aa97d85 various camera fixes (did this ever work properly?)
- handle basic init properly for those platforms that do/don't zero-initialize STL vector
 - allow text images without witten text
 - don't try to process text if it's NULL or of 0 length
 - don't get freaky with image handling
 - add clone/assignment operator so that push_back() will not screw up bmpman stuff
2006-02-16 05:07:08 +00:00
taylor bf18c71316 various bmpman related fixes
- some new error checking (and fixes related to that) and cleanup
 - fix EFFs not getting released/unloaded properly (was in a local tree but apparently missed CVS)
 - minor fixes for bm_release() to produce a more properly cleaned slot
 - use fast unloading for page_in stuff since we don't actually want really want the load count changing for texture maps
   and to make sure that we free the memory usage regardless of load count
2006-02-16 05:00:01 +00:00
taylor 4c3a3d08d6 couple more lighting value tweaks 2006-02-16 04:55:53 +00:00
taylor 2765017317 newline fixage 2006-02-16 04:55:14 +00:00
wmcoolmon e29332a64a Dodge an Assert 2006-02-15 07:30:54 +00:00
wmcoolmon 2a2d52145a Blah, pulled a Goober. 2006-02-15 07:26:52 +00:00
wmcoolmon d43babc2d5 Various weapon and team related scripting functions; $Collide Ship and $Collide Weapon hooks 2006-02-15 07:19:50 +00:00
Goober5000 ef13357373 enabled modular tables for ai_profiles and added the default table to def_files
--Goober5000
2006-02-13 04:56:58 +00:00
Goober5000 0cd1cdd3f1 nitpick 2006-02-13 03:11:19 +00:00
Goober5000 a9642a2a86 more tweaks, plus clarification of checks for the existence of files
--Goober5000
2006-02-13 00:20:46 +00:00
wmcoolmon 0c8c487d3c Remove initial corkscrew values from parse_weapon 2006-02-12 17:54:35 +00:00
Goober5000 ada33660b0 allow specification of debriefing personas
--Goober5000
2006-02-12 10:42:25 +00:00
Goober5000 2653f7c9ac whoops, forgot this 2006-02-12 08:39:32 +00:00
Goober5000 28ea82d96b additional fixes and enhancements for substitute music
--Goober5000
2006-02-12 05:23:16 +00:00
Goober5000 7310f00883 more cool work on importing, music handling, etc.
--Goober5000
2006-02-12 01:27:47 +00:00
Goober5000 b5bef91a77 bumped to 3.6.8 because of version-specific commenting
--Goober5000
2006-02-11 22:10:11 +00:00
Goober5000 f990815ab9 removed the FS1-specific music hack
--Goober5000
2006-02-11 22:08:56 +00:00
Goober5000 e696a5844c this isn't needed now
--Goober5000
2006-02-11 21:24:05 +00:00
Goober5000 fc2ff2bd76 reworked how comments are parsed and added version-specific commenting
--Goober5000
2006-02-11 21:23:42 +00:00
wmcoolmon 8727f84919 getWeaponClass->getWeaponClassByName, Linked/DualFire variables 2006-02-11 19:24:17 +00:00
Goober5000 a4ef31ec20 RT's bugfix 2006-02-11 07:34:25 +00:00
Goober5000 504e5e518a two things I missed before
--Goober5000
2006-02-11 07:31:55 +00:00
Goober5000 5ca168e515 yet more various and sundry fixes
--Goober5000
2006-02-11 02:58:23 +00:00
Goober5000 c3793de61e more fixage
--Goober5000
2006-02-11 01:02:28 +00:00
Goober5000 08144ffceb more FS1 import goodness
--Goober5000
2006-02-11 00:13:55 +00:00
Goober5000 6bb63e33d6 fixed an old Volition bug unmasked by my parse changes
--Goober5000
2006-02-10 23:33:39 +00:00
wmcoolmon 7d1a4f0efb Removed resize fields; fixed silly bug with RunBytecode 2006-02-09 05:07:02 +00:00
wmcoolmon 71853d9d47 Maybe fix gliding insta-turn problem 2006-02-08 02:10:39 +00:00
wmcoolmon 208ffda32f WMC-Since we're abusing species_defs.tbl anyways, remove $NumSpecies 2006-02-06 02:29:17 +00:00
wmcoolmon 990132536e Various fixes; very beginnings of Directives scripting support 2006-02-06 02:06:02 +00:00
Goober5000 65ada5e03e fixed several IFF bugs in FRED (plus one or two other bugs)
--Goober5000
2006-02-04 07:05:03 +00:00
taylor 47158d3a1a fix sun flares that I had broken previously 2006-02-03 22:29:01 +00:00
taylor 2aef5864c0 a couple of mvalid.cfg and tvalid.cfg file format changes to give them at least some readability
some cleanup, extra logging, and very slight speedup with mission and table validation checking
fix memory leak from mission and table validation checking
2006-02-03 22:28:10 +00:00
taylor f07b3dae88 I don't like this being considered a fix without retail compatibility testing, but it should at the very least compile... 2006-02-03 22:25:18 +00:00
Goober5000 8d31b2a3c2 ugh, more ship/wing fixage
--Goober5000
2006-02-02 08:12:47 +00:00
Goober5000 72ba8ab2ab bah and double bah 2006-02-02 07:13:42 +00:00
Goober5000 fa592e5e62 fixed what I broke for ship types :p
--Goober5000
2006-02-02 07:01:16 +00:00
Goober5000 546e41bed4 consolidated comm order stuff
--Goober5000
2006-02-02 07:00:29 +00:00
Goober5000 ef4ab2c71a replaced Fred_comm_orders with proper Comm_orders, just for WMC ;)
--Goober5000
2006-02-02 06:22:58 +00:00
Goober5000 e92336bbed restore retail compatibility with comm orders: one logic bugfix, one cosmetic bugfix
--Goober5000
2006-02-02 06:04:02 +00:00
Goober5000 fa002ee29b fixed a FRED problem brought on by the parse reordering
--Goober5000
2006-02-02 05:48:17 +00:00
phreak 591cca45b9 Allow weapons to home in on countermeasures as well. The multiplayer code was only allowing bombs to be homed in on. 2006-02-01 23:43:34 +00:00
phreak 9464b77b0b -ingame should be -ingame_join 2006-02-01 23:35:31 +00:00
taylor 7481555e5e add local lua dir to includes 2006-02-01 13:30:12 +00:00
Goober5000 0fd76f4abe now all the project files are working :)
--Goober5000
2006-02-01 08:05:47 +00:00
Goober5000 f9535667b6 try fixing this again 2006-02-01 05:40:44 +00:00
Goober5000 8ae737074b bettered the ballistic primary check
--Goober5000
2006-02-01 05:11:25 +00:00
Goober5000 0b13726b73 fixed project folder settings 2006-02-01 04:29:30 +00:00
taylor 79be5543cb oh the shame (/me imagines the big grin on Goober's face right now :p) 2006-01-31 17:19:20 +00:00
taylor 155a7f4f21 remove USE_LUA 2006-01-31 15:44:55 +00:00
taylor 8b5e4390bd we need to skip to the start of the string, not the end 2006-01-31 15:44:29 +00:00
wmcoolmon c4f19e64bc Removed USE_LUA; Simulation hook; better debug messages for Lua; swapped out mounted weapon functions for variables 2006-01-31 06:46:14 +00:00
wmcoolmon 0571df5719 Compiler warning fix 2006-01-31 06:44:48 +00:00
wmcoolmon c4755fb10f Debug warning; compiler warning fix. 2006-01-31 06:43:21 +00:00
wmcoolmon 99e29f52ba Removed USE_LUA 2006-01-31 06:42:28 +00:00
wmcoolmon c84776a188 Scripting simulation hook; removed USE_LUA 2006-01-31 06:42:00 +00:00
wmcoolmon a898ab1a00 Fix hack for checking for ballistic primary ammo 2006-01-31 06:32:42 +00:00
Goober5000 b6cee94fc5 stuff 2006-01-31 04:24:25 +00:00
Goober5000 19ca2a5d41 oh noes! :( 2006-01-31 04:13:00 +00:00
Goober5000 d0a92f8d84 fix a potential problem with replacement range
--Goober5000
2006-01-31 02:02:33 +00:00
Goober5000 69db5e8597 update FSM import for FSPort v3.0
--Goober5000
2006-01-31 01:53:37 +00:00
taylor 09d7c4f206 fix problem that made briefing voice repeat first second or two in OpenAL 2006-01-30 22:09:52 +00:00
taylor f8c1115c7f some minor fixage 2006-01-30 22:08:59 +00:00
taylor 5cbc3791a4 and after all of my recent work fixing div-by-0 zero bugs, ya had to know this was coming :) 2006-01-30 19:37:33 +00:00
taylor 0d3fd97f2e fix parsing of reinforcements 2006-01-30 19:35:41 +00:00
taylor b618a74072 make sure to init dest and dest_size for any calling functions that don't 2006-01-30 07:14:32 +00:00
taylor 6397a8f093 fix endless loop when we've got too many weapons 2006-01-30 07:00:14 +00:00
taylor c70fdc3a52 try and handle things like $$ and ## a bit better (this worked for what I threw at it but please double-check me here Goober) 2006-01-30 06:58:10 +00:00
taylor 26b25d548a better lighting for OpenGL
remove some extra stuff that was from sectional bitmaps since we don't need it anymore
2006-01-30 06:52:15 +00:00
taylor 93b4962f17 make MAX_LIGHTS global 2006-01-30 06:41:34 +00:00
taylor 7e7a881354 better lighting for OpenGL
remove some extra stuff that was from sectional bitmaps since we don't need it anymore
some basic lighting code cleanup
2006-01-30 06:40:49 +00:00
taylor 4c9a9dbe31 clean up lighting stuff a little 2006-01-30 06:38:34 +00:00
taylor b55f61b7d1 account for a freaky wing issue (saw this in Derelict, or somewhere) 2006-01-30 06:37:49 +00:00
taylor 14a7d00361 handle Interp data allocation a little better 2006-01-30 06:36:35 +00:00
taylor 7558eba371 minor warning fixage 2006-01-30 06:36:01 +00:00
taylor 7501939a44 minor fixage 2006-01-30 06:35:29 +00:00
taylor 74f014c64d (possibly) better fix for some static/stuttering in certain wav files 2006-01-30 06:35:02 +00:00
taylor 42183592cd try and detect some bad path info 2006-01-30 06:34:06 +00:00
taylor 7c0a59c1a7 add transparent, cycling alpha, and no-light options for weapons 2006-01-30 06:33:19 +00:00
taylor ac5d72045b dynamic starfield bitmaps (if the thought it was freaky before, just take a look at the new and "improved" version ;)) 2006-01-30 06:31:30 +00:00
taylor 603feaaa4c dynamic starfield bitmaps 2006-01-30 06:30:03 +00:00
wmcoolmon 42a74e93d3 Apologies, don't know how I missed this... 2006-01-29 18:01:04 +00:00
wmcoolmon f695a935af Make sure stuff is set up properly for ship kills 2006-01-29 07:42:49 +00:00
wmcoolmon 55846b0484 Minor warning update 2006-01-29 07:41:57 +00:00
Goober5000 7720a40fd6 fix all teams at war IFF behavior
--Goober5000
2006-01-28 04:33:06 +00:00
Goober5000 77f9c7ffae fixed the bug where wings couldn't be initially docked to stuff
--Goober5000
2006-01-28 02:59:55 +00:00
Goober5000 d77e21d84d fixed a small incompatibility
--Goober5000
2006-01-28 00:23:36 +00:00
Goober5000 3554e6c336 some tweaks for insertion sort
--Goober5000
2006-01-27 20:29:30 +00:00
Goober5000 738875f021 replace quick sort with insertion sort in many places
--Goober5000
2006-01-27 06:21:10 +00:00
Goober5000 9345c5e130 add an insertion sort function for small or almost-sorted arrays; it has the same prototype as stdlib's quick sort
--Goober5000
2006-01-27 06:03:41 +00:00
Goober5000 eca06b5c1a a few project file fixes
--Goober5000
2006-01-27 04:06:31 +00:00
phreak 3cf2b0579c Grid zbuffering issue fix moved to the new fred project folder 2006-01-26 23:04:45 +00:00
Goober5000 ba8691181c spelling 2006-01-26 04:01:58 +00:00
taylor 74549db950 first version of this sucked, this should be a bit better while working with both new and retail data
- get an average color from the palette rather than picking first (unoptimized palettes could have unused pixels in first entry)
  - slight cleanup, and s/colour/color/ (yeah, stupid American, deal with it! :))
2006-01-26 03:59:59 +00:00
Goober5000 ce57b3387d added variable replacement to command briefings, briefings, and debriefings
--Goober5000
2006-01-26 03:58:14 +00:00
Goober5000 64e86452d0 pare down the pragmas some more
--Goober5000
2006-01-26 03:23:30 +00:00
Goober5000 ef1ae60796 ugh; these scripting #defines really need to be kept up-to-date 2006-01-26 02:26:17 +00:00
taylor 92c2d3724f quick and ugly hack to get aigoal sorting working on Windows again (temporary, should be replaced by better and permanent sorting function) 2006-01-25 22:51:07 +00:00
wmcoolmon ae74334f02 Maybe fix G3_count error 2006-01-25 07:46:13 +00:00
phreak f36a0b2355 htl_lines should follow zbuffering rules 2006-01-25 03:11:52 +00:00
taylor 8c46901b47 break out of error check loop after the first check in FRED since it doesn't like this for some reason 2006-01-24 13:38:30 +00:00
taylor b4c50e32d7 another NaN/div-by-0 bug 2006-01-23 13:51:11 +00:00
taylor 9a581baa79 fix d3d_bitmap_ex coloring (thanks Alpha0!) 2006-01-23 09:39:30 +00:00
taylor 18d6b377eb add fixes for capships that hit waypoints and just spin around
try and fix a big ship guard NaN error that is the result of an incredibly small forward speed value
2006-01-22 22:41:16 +00:00
wmcoolmon 6912e6cc96 0...1...2...4? 2006-01-22 19:57:35 +00:00
taylor 4ed9dd0b2b more class type name fixage (maybe an AltName: line for objettypes.tbl in the future?)
if a ship has no class_type in ai_chase() then assume it's ok to chase, but log it in debug
  (uncomment Int3() here after this has been tested a little more)
2006-01-22 14:09:01 +00:00
taylor 3f197f34e2 oops, didn't notice that was out of the wrong diff 2006-01-22 01:35:23 +00:00
taylor f771b52a56 warning fixage
don't Int3() when trying to set ship speed via sexp if ship is not in mission yet, this shouldn't be fatal
2006-01-22 01:33:39 +00:00
taylor ae1b2d91f5 newline fixage 2006-01-22 01:32:07 +00:00
taylor a71b58a223 no real need to cast these so just get it right in the first place 2006-01-22 01:31:44 +00:00
taylor 3da6678877 clear depth buffer on each page flip (may give a slight speed increase)
change error check handling again, FRED may like this better but if it starts hanging again I have another fix
little safety checks for opengl_close()
fix atexit() call for OGL closeout
2006-01-22 01:30:33 +00:00
taylor c39585a262 handle NULL ptr ref in debug message (needs to be reconsidered as to whether the function should actually return here or not) 2006-01-22 01:28:06 +00:00
taylor a3bdc81969 fix temp ptr warning, untested but could possibly be less error prone in some situations 2006-01-22 01:26:15 +00:00
wmcoolmon faa0b28008 Texture replacement stuff 2006-01-21 09:36:58 +00:00
taylor 0d515b98d4 long way to go for a simple div-by-0 fix 2006-01-21 02:43:23 +00:00
wmcoolmon 24d8f7973f Scripting updates; Special scripting image list; Better operator meta; Orientation type; Wing type; Texture type. Fix for MSVC7 compiling. 2006-01-21 02:22:05 +00:00
taylor c69ff06b94 that wasn't too smart of me, move extra anim filename size check to *after* we have found an anim 2006-01-21 01:56:58 +00:00
taylor ab81c738db don't forcefully disable multisample still (part of an old ATI fix that didn't actually fix anything) 2006-01-21 00:14:25 +00:00
taylor 922be10b2d fix for LuaError change, *again* ;) 2006-01-21 00:11:51 +00:00
taylor 9de1e7691d fix anim filename length check, they need at least 5 extra characters for the frame number on the filenames 2006-01-20 23:47:51 +00:00
wmcoolmon a2e4eb9c1b Lua unloadMission() 2006-01-20 17:37:38 +00:00
taylor 74e33659ab gr_*_bitmap_ex() stuff, D3D side is 100% untested to even compile
several other very minor changes as well
2006-01-20 17:15:16 +00:00
Goober5000 6876f5ca60 remove unreferenced variable 2006-01-20 07:50:25 +00:00
Goober5000 8dbd2dbbe7 fix warning message
--Goober5000
2006-01-20 07:21:33 +00:00
Goober5000 8ab1cf65a9 reordered #include files to quash Microsoft warnings
--Goober5000
2006-01-20 07:10:34 +00:00
Goober5000 42a84d2e8f sorted the #include listing again
--Goober5000
2006-01-20 06:26:41 +00:00
Goober5000 b70df28ade added a missing file
--Goober5000
2006-01-20 06:24:28 +00:00
Goober5000 bc18d2fcff hopefully fix the Microsoft warnings
--Goober5000
2006-01-20 06:24:01 +00:00
wmcoolmon 5215110d17 Updated FREDStubs.cpp to most current version 2006-01-20 05:35:59 +00:00
wmcoolmon b824b31eec Added FRED2 project file to CVS for MSVC7 2006-01-20 05:34:42 +00:00
Goober5000 28b019a853 fixed a sexp help message
--Goober5000
2006-01-20 04:33:21 +00:00
wmcoolmon d67df04356 GCC compile fixes 2006-01-20 03:48:35 +00:00
wmcoolmon cd7cacd004 Faster object handles 2006-01-19 22:25:01 +00:00
wmcoolmon 769608ef6d More Lua checks; added Lua vector object; better operator support. 2006-01-19 20:18:12 +00:00
wmcoolmon a657ad4cad Lua debugging stuff; gr_bitmap_ex stuff for taylor 2006-01-19 16:00:04 +00:00
taylor 7d3c621d15 don't attempt to draw glowpoints or engine glows when in wireframe mode (this may need to be a flag or something, but I'm not sure) 2006-01-19 14:06:33 +00:00
taylor 82098596a0 better error handling for OGG Voris files 2006-01-19 11:49:12 +00:00
wmcoolmon 851b4dd350 Possible overflow check 2006-01-19 05:40:19 +00:00
phreak 186f3c081e gr_render_buffer shouldn't be returning values if it's supposed to return void 2006-01-19 03:20:49 +00:00
phreak 0662cb6959 give repair-subsystem and set-subsystem-strength a fourth optional parameter used to possibly regenerate the submodel of a given subsystem
sabotage-subsystem should make the subsystems explode
2006-01-19 03:17:12 +00:00
phreak 1456c88369 obj_script_set_global() should have an #ifdef/#endif USE_LUA pair in the function body. 2006-01-19 03:15:31 +00:00
Goober5000 edecd95c92 whoops, messed up the paths
--Goober5000
2006-01-19 02:51:00 +00:00
Goober5000 82302a0aba import FRED2 back into fs2_open module
--Goober5000
2006-01-19 02:27:38 +00:00
Goober5000 0b42f5336a add lowercase .ico file 2006-01-19 02:00:39 +00:00
Goober5000 a6c212b6a9 remove uppercase .ico file 2006-01-19 02:00:00 +00:00
taylor e2f2baf557 this is probably going to end up doing something bad again when switching mods, hopefully it's not still necessary though 2006-01-18 17:45:01 +00:00
taylor 16b6d96c61 oops! :) 2006-01-18 16:36:32 +00:00
taylor db78a0f780 use HTL wireframe view if in HTL mode 2006-01-18 16:17:33 +00:00
taylor fa811c3915 allow gr_render_buffer() to take TMAP flags
let gr_render_buffer() render untextured polys (OGL only until some D3D people fix it on their side)
add MR_SHOW_OUTLINE_HTL flag so we easily render using HTL mode for wireframe views
make Interp_verts/Interp_norms/etc. dynamic and get rid of the extra htl_* versions
2006-01-18 16:14:04 +00:00
taylor 481d9b0811 if a weapon model isn't loaded then be sure to load it in weapon_create() (catches a few weird weapon setups) 2006-01-18 16:02:26 +00:00
taylor 2b241ca617 support only PCX for the nebula background graphics (given how it works that's the fastest and easiest way to get it done) 2006-01-18 16:01:14 +00:00
taylor 4999f3dc4b show poly flag setting was reversed 2006-01-18 15:59:33 +00:00
wmcoolmon 5a566f6e63 Various scripting updates 2006-01-18 06:13:18 +00:00
wmcoolmon 714844d6bb Switch ballistic weapon hudgauge to show "Energy" field in place of pure-energy weapons 2006-01-17 17:41:05 +00:00
wmcoolmon 27a9f8d43a Better state handling; added GameInit hook 2006-01-17 07:28:39 +00:00
wmcoolmon a2a550f3d3 Various minor improvements 2006-01-17 07:10:01 +00:00
wmcoolmon 9efb98785e Removed #ifdef around Object_type_names extern 2006-01-17 04:11:26 +00:00
phreak 4e77c96a9a Make sure the rearm eta isn't recalcuated until the player docks again with a support ship 2006-01-17 03:48:25 +00:00
phreak 7131c7f99d Modified the formatting for the rearm countdown timer once docked. 2006-01-17 03:46:56 +00:00
phreak f300716e93 Rearranged the rearming code so it doesn't potentially take 2 minutes to reload a single bomb. 2006-01-17 03:45:32 +00:00
wmcoolmon 38daca278d data/scripts directory 2006-01-17 02:33:20 +00:00
taylor a15e372b58 well that was super smart of me 2006-01-17 01:31:43 +00:00
wmcoolmon fb59608473 Fix scripting; Tidy up scripting.html; Replace various functions with virtual variables 2006-01-17 01:31:20 +00:00
wmcoolmon e5e7e8a8aa drawText => drawString 2006-01-16 23:29:06 +00:00
wmcoolmon fe5469090f Added support for setting handle variables with LUA_VAR; added support for array indexing with LUA_INDEXER; use LUA_SETTING_VAR to check whether in setting mode for both. Cleaned out older code 2006-01-16 21:26:19 +00:00
taylor 8804e0dcbf some minor changes to model_should_render_engine_glow(), better safety checks, support for disrupted engines
check to see if a particular engine is disabled/destroyed/disrupted before making engine wash for it
2006-01-16 20:57:03 +00:00
taylor e4c89dee9d compile fix 2006-01-16 20:54:58 +00:00
wmcoolmon c1005caecb Use obj_script_set_global for "plr" and "slf"; remove Lua variable if variable goes to NULL 2006-01-16 11:16:07 +00:00
wmcoolmon 11f8b022b0 Changed object's "getType" to "getBreed" to avoid confusion 2006-01-16 11:12:46 +00:00
wmcoolmon 1b06985486 Can't forget #End! 2006-01-16 11:07:37 +00:00
wmcoolmon abf75dd133 Various warning fixes, scripting globals fix; added "plr" and "slf" global variables for in-game hooks; various lua functions; GCC fixes for scripting. 2006-01-16 11:02:23 +00:00
phreak 018d586f49 Only display the capped normal message in debug builds 2006-01-16 07:46:03 +00:00
Goober5000 5e0aaa25dd use IFF colors in escort list 2006-01-16 05:54:21 +00:00
taylor 0247059768 correct get/set sample math, it expects 8-bit sizes so we have to convert to/from actual 2006-01-15 21:22:22 +00:00
taylor 42264f422c another NULL VEC3D warning fix 2006-01-15 18:56:45 +00:00
taylor d67327d1a7 fix compile issues from bad constructor
make sure ai_actively_pursues gets filled for modular tables too
fix NULL ptr reference when parsing ship type which doesn't exist and is set to not create
2006-01-15 18:55:27 +00:00
taylor 9b751defd2 fix stuff_boolean() debug spew 2006-01-15 18:53:19 +00:00
Goober5000 3a1fe4ae53 fix some tweaky thing that isn't even used :p
--Goober5000
2006-01-15 01:02:01 +00:00
wmcoolmon eba6d1dff9 Special shockwave and moving capship bugfix, (even more) scripting stuff, slight rearrangement of level management functions to facilitate scripting access. 2006-01-14 19:54:55 +00:00
taylor 68bf4ec453 minor OGL lighting fix 2006-01-14 19:25:55 +00:00
wmcoolmon 25bcca3dec Allow RunByteCode to return an argument 2006-01-14 10:35:41 +00:00
wmcoolmon 4fd1bc3583 New Lua feature - globals control. 2006-01-14 09:21:27 +00:00
taylor a46a87f8d2 make sure rship gets initialized before use 2006-01-14 06:25:11 +00:00
taylor c9a26f04a2 get object vars correct 2006-01-14 06:24:27 +00:00
taylor b194acc433 be sure to account for skipped mipmap levels in calculation of textures in VRAM 2006-01-14 06:23:39 +00:00
Goober5000 ab4abddc42 tweaky tweak
--Goober5000
2006-01-14 05:36:06 +00:00
phreak 1ccaa6bdcb Tried to make the sphere size more uniform on opposite ends of the orb
Modified the radar disruption angle scale a bit.  Went from 200 degree to 20 degree disruption.  Otherwise, it was very confusing to find hidden objects.
2006-01-14 04:44:29 +00:00
phreak 438a20e0d4 Make orb radar mode drawing again.
Clarify "fudge" variable used for viewing transformations
2006-01-14 03:28:29 +00:00
wmcoolmon 890f5ec6f0 Grr...fix out-of-sync game states 2006-01-14 01:51:49 +00:00
wmcoolmon 1b208224e6 Added a few more functions 2006-01-14 01:20:16 +00:00
wmcoolmon 47b556b75a Oops 2006-01-14 01:15:11 +00:00
wmcoolmon a2a76d68c7 Campaign scripting functions 2006-01-14 01:12:35 +00:00
taylor 4a3a186273 move SDL autoconf checks up so we get the defines earlier
fix some Lua build problems on Linux (enabled by default now, but with configure option)
newline fixage
comment fixage
2006-01-13 14:19:34 +00:00
taylor 5bc170d5be hmm, didn't put much thought in that the first time, this should work closer to the original but still be cleaner 2006-01-13 13:06:15 +00:00
taylor 5f3a6ec743 fix hud comm message screwups (missing support ship, no coverme, etc) that was part :V: bug and (bigger) part Ship_types related bug 2006-01-13 11:09:45 +00:00
taylor d0f071692f swap order of pilot read and reset-to-defaults so that the various entries in the pilot file don't get clobbered needlessly 2006-01-13 08:27:43 +00:00
wmcoolmon f13027481c More scripting stuff 2006-01-13 04:46:17 +00:00
Goober5000 d5b5fd1ffb add a necessary #ifdef
--Goober5000
2006-01-13 04:36:21 +00:00
Goober5000 23a63ff8d5 oops
--Goober5000
2006-01-13 04:12:23 +00:00
Goober5000 120d1f421c remove FS2_VOICER define by default; this should really be kept in local copies
--Goober5000
2006-01-13 04:11:49 +00:00
Goober5000 4d5a477f71 übercommit of custom IFF stuff :) 2006-01-13 03:31:20 +00:00
Goober5000 e8dfc52615 formatting, meh
--Goober5000
2006-01-13 02:56:01 +00:00
wmcoolmon 746b0724b9 Even more scripting stuff. 2006-01-12 17:42:56 +00:00
wmcoolmon 5be88dfe76 Finished committing codebase 2006-01-12 04:18:10 +00:00
wmcoolmon 8da9a3b27e Oops, missed a file 2006-01-12 04:16:27 +00:00
wmcoolmon 59f4b02108 Fix bug with float return; update scripting.html format 2006-01-11 22:09:41 +00:00
wmcoolmon 26c50c18cb More scripting functions, various scripting enhancements 2006-01-11 21:24:37 +00:00
wmcoolmon dacfc2d704 Made turret handling code more descriptive 2006-01-11 21:23:43 +00:00
wmcoolmon 82d4e2aa4e Somewhat better turret comments 2006-01-11 21:15:15 +00:00
taylor 9356140569 allow for an equals value in qsort() comparison function, will hopefully fix Enif station bug and not cause any new problems 2006-01-11 05:42:17 +00:00
taylor d96d446600 use cf_find_file_location() check instead of cfopen() for is_spary_hi check 2006-01-11 05:40:59 +00:00
taylor ce47200c01 newline fixage 2006-01-11 05:40:09 +00:00
taylor 97129e0e9c skip ourselves in hostile check, this isn't really needed since it's handled by the next check but for clarity sake it's here now 2006-01-11 05:39:49 +00:00
wmcoolmon b899086978 Complete the HUD scripting hook. (Eight lines of code, and I still miss three of them. :P 2006-01-11 01:35:53 +00:00
randomtiger cfbdf6837b Took demo compile flag off. 2006-01-10 18:39:40 +00:00
randomtiger fcd67856f7 Improvements to voice recognition system.
Also function put on -voicer launcher option.
2006-01-10 18:37:46 +00:00
phreak 9b606a5424 Fixed a logic error when dealing with non-targetable subsystems 2006-01-10 01:23:09 +00:00
phreak 8c8148f6ee Add the argument for alpha color when using set-jumpnode-color. This was defaulting to some junk value and making the jumpnode disappear. 2006-01-10 00:12:08 +00:00
phreak 098e3a9b93 Argument checking when setting jumpnode color. 2006-01-10 00:11:03 +00:00
phreak 7665133851 Remove tertiary weapons in their current form, I want something more flexable instead of what I had there. 2006-01-09 04:54:51 +00:00
phreak 0c663d84ee fix compile warnings. 2006-01-09 04:52:34 +00:00
taylor 36815c10e0 newline fixage 2006-01-08 13:05:41 +00:00
taylor 5a0c85036d make sure that thrusters will still render with a missing primary bitmap if they have a primary glow 2006-01-07 12:48:04 +00:00
taylor 377c88c1ee I refuse to comment on my own stupidity! (fixes music interruption) 2006-01-06 11:25:29 +00:00
wmcoolmon 07fb5808d6 turret-target-order SEXPs, ship thrusters 2006-01-06 04:18:55 +00:00
taylor 9d2f4e7eb4 make Split_ships[] dynamic (wouldn't have been a big deal to just bump the limit, but what the hell) 2006-01-05 11:34:44 +00:00
taylor c1fc671d6a add a .cvsignore file for lua so there isn't a worry of commiting something bad 2006-01-05 08:06:03 +00:00
wmcoolmon 3f8ffbbea8 Fix supercap 2006-01-05 05:54:16 +00:00
taylor 25b15af791 allow both +Pri style and original style (+Normal, etc) for species_defs TBMs
allow for "<none>" as a bitmap/anim name, to have no effect
fix ship/weapon thruster rendering to handle missing primary animation and/or glow graphics
2006-01-05 05:12:11 +00:00
wmcoolmon 3e9b38313e Flak weapons only use detonation range if targets are further away than $Det range 2006-01-04 21:48:36 +00:00
taylor 741e151cac fixes for regular texture replacement 2006-01-04 08:19:22 +00:00
taylor e65c1ac033 fix files corrupted by RTs commit 2006-01-03 23:24:54 +00:00
taylor 0a6578c8b6 oops, should have been checking my logs on that one, fixes minor GL error 2006-01-03 22:46:52 +00:00
randomtiger 0bcad1ccc4 Fixed bad phrases path 2006-01-03 20:13:23 +00:00
randomtiger 3603e36d13 Removed bad phrases.cfg reference 2006-01-03 18:09:31 +00:00
randomtiger 7bf193c5e4 Added voice recognition functionality for Visual C6 project only.
Currently still a work in progress.
2006-01-03 17:07:11 +00:00
taylor 54478d16f8 weapon precedence wasn't getting read in on normal weapon.tbl parse, should fix the missing primary weapons in early retail missions 2006-01-03 06:02:59 +00:00
taylor 71d9935877 fix freaky nan error on line drawing where model would get loaded on second entry into WS screen when it should be animation 2006-01-03 06:02:00 +00:00
taylor fae386d216 fix a couple of minor mipmap problems
add resizing with mipmaps rather than a physical change in memory when detail levels dictate scaling (maybe this won't blow up)
2006-01-03 02:59:14 +00:00
taylor 7d260f5258 can't overwrite node var here, it's original value is needed later and was throwing out NULL chars in the Warning()s 2006-01-02 21:28:52 +00:00
taylor 09d76a1a12 remove ALUT headers, we don't it anyway and it's not included with OpenAL anymore 2006-01-02 07:26:43 +00:00
taylor 3e1c3c6ff4 don't specify a read buffer, something with this is screwing up ATI cards, a debug string should satisfy a hunch
ifdef out the bumpmap stuff, it's very wrong anyway :)
2006-01-02 07:25:11 +00:00
taylor 0f6eeb3288 use cf_find_file_location() for objecttypes.tbl rather than a cfopen()
fix a few compiler warning messages
2006-01-02 07:16:43 +00:00
taylor 0784e3bee9 make sure we clear out the vertex used to render a sun (just to be on the safe side)
use parse_modular_table() for -str.tbm
2006-01-02 07:13:38 +00:00
taylor 814e5ad084 those blasted Windows programmers! ;) 2006-01-02 07:12:24 +00:00
taylor 3d3d559ac5 start of DDS volume/cube map support (rest of this needs code not ready for CVS but this will be needed later) 2006-01-02 07:11:41 +00:00
phreak 2e56c91d73 add def_files.h and def_files.cpp to code project. 2006-01-02 03:55:28 +00:00
phreak 49b3d63b9c this should have an ifdef/define/endif block 2006-01-02 03:54:27 +00:00
wmcoolmon 20d88460fc Changed num-within-box wing function 2005-12-31 01:49:53 +00:00
wmcoolmon b59fa2bfeb num-within-box 2005-12-31 01:47:35 +00:00
taylor adb851dc54 forgot to include autoconf/automake versions 2005-12-30 10:12:53 +00:00
taylor 45f09f4f33 update Linux build steps 2005-12-30 10:11:02 +00:00
taylor bd2bb9c1be add def_files 2005-12-30 09:57:53 +00:00
wmcoolmon c1b77841ad Assert -> parse warning 2005-12-30 05:40:19 +00:00
wmcoolmon 0a3f63d090 Updated MSVC projects 2005-12-30 00:53:00 +00:00
taylor 1b2a6031e2 we are using gouraud lighting here so be sure to set the proper tmap flag (fixes D3D, corrects OGL) 2005-12-29 20:12:51 +00:00
wmcoolmon 1823576e8b Fix(?) shiptypes.tbl crash on startup 2005-12-29 12:44:45 +00:00
wmcoolmon 246cfcfa65 Codebase commit, most notably including objecttypes.tbl 2005-12-29 08:08:42 +00:00
taylor 56886a1234 add <gamedir>/screenshots support and save screenshot images in TGA rather than BMP format 2005-12-29 07:58:02 +00:00
taylor 150e297236 put texture filter debug message back (was commented out for some reason in phreak's commit) 2005-12-29 04:33:15 +00:00
phreak e34bb97cd1 loading code for flipped briefing icons. 2005-12-29 00:56:45 +00:00
phreak 46b45b6717 mirror parameter in hud_anim_render(). only used when briefing icons are fading in. 2005-12-29 00:54:08 +00:00
phreak 78e2ce963c changed around aabitmap calls to accept a "mirror" parameter. defaults to false, and is only true for mirrored briefing icons.
If the mirror param is true, then the picture is mirrored about the y-axis so left becomes right and vice versa.
2005-12-29 00:52:57 +00:00
phreak 242d9bf764 Briefing icons can now be mirrored so one can point them in the opposite direction. 2005-12-29 00:49:43 +00:00
taylor bf0efdb895 add support for a species_defs modular table with XMT support (*-sdf.tbm) 2005-12-29 00:01:29 +00:00
taylor fa632ab2ee handle case where we make an atexit (on failure) flush call before the texture system is initted 2005-12-29 00:00:18 +00:00
taylor ad3d78a256 getting tired of having to ifdef the snprintf/_snprintf thing that Microsoft can't do right 2005-12-28 22:34:01 +00:00
taylor 12bd9f5c9e properly deal with post-89 TGA images which have extra extension and developer info in the file 2005-12-28 22:32:37 +00:00
taylor 8402d67ee8 unused variable (to make GCC shut up) 2005-12-28 22:31:03 +00:00
taylor cccc259cb1 add fl_tan() for getting the tangent of a float since it's terribly inaccurate to just use tan() on a float 2005-12-28 22:30:24 +00:00
taylor 0b6ed1b5b0 add support for glCompressedTexSubImage2D(), we don't use it yet but there is nothing wrong with adding it already
better support for mipmaps and mipmap filtering
add reg option "TextureFilter" to set bilinear or trilinear filter
clean up bitmap_id/bitmap_handle/texture_handle madness that made things difficult to understand
small fix for using 24-bit images on 16-bit bpp visual (untested)
2005-12-28 22:28:44 +00:00
taylor 0762e9f864 save screenshots into <gamedir>/screenshots/
another attempt at fixing popups with single colors (saves memory too, hope it doesn't blow up)
add a debug msg about mipmap filter in use
2005-12-28 22:24:48 +00:00
taylor 8385fc99ea clean up the EVENT and STATE names so we don't have to manually backtrack the number during debugging 2005-12-28 22:22:34 +00:00
taylor f2db1ce34b Oops, bit of debug stuff I didn't mean to commit (but something similar is needed so you'll it again) 2005-12-28 22:21:04 +00:00
taylor 425c7b86b4 deal with cf_find_file_location() changes
add a central parse_modular_table() function which anything can use
fix up weapon_expl so that it can properly handle modular tables and LOD count changes
add support for for a fireball TBM (handled a little different than a normal TBM is since it only changes rather than adds)
2005-12-28 22:17:02 +00:00
taylor 33ac33bb08 properly deal with non-compressed images with mipmaps (image size didn't include mipmaps before 2005-12-28 22:07:46 +00:00
taylor 79e0e6b355 fix up cf_find_file_location() and related elements so that it's safer (based on WMC's work, but actually safe this time ;)) 2005-12-28 22:06:48 +00:00
taylor b84bce6e8f allow for 24-bit user created bitmap images
make sure we have proper memory size requirements for non-DDS EFFs
2005-12-28 22:04:00 +00:00
taylor a0329bfabb fix a couple of beam section issues when using modular tables 2005-12-24 04:18:57 +00:00
taylor 90d6bce698 one more attempt to fix screenshots on Radeons. 2005-12-22 19:15:20 +00:00
taylor 9c03aedbf3 changes to add Lua
don't use compatibility SDKs
2005-12-22 04:36:03 +00:00
taylor 819c13f658 more big-endian fixes
fix the totally retarded check I made for multi fighter beams (they really don't work right yet anyway) since it broke normal beams for clients
2005-12-22 04:35:04 +00:00
taylor 398f122676 MSVC6 was being a pain about this 2005-12-22 04:33:12 +00:00
taylor 335e3b5adf GCC knows that fix == int so it hates the utility functions here, for sanity sake just rename them to type specific to avoid rampant casting 2005-12-22 04:32:44 +00:00
taylor eddf28ad6e add the name of the modular table about to be parsed to the debug log
a missing weapon_expl table should just be a note in the debug log rather than a popup warning
2005-12-21 08:27:37 +00:00
taylor 4c906966a3 allow the show-all hotkey to work on all techroom tabs
address a couple of possible memory leak issues that could have come up in the future
2005-12-21 08:24:51 +00:00
wmcoolmon 8c7b258e51 Swap beam fixed/animation image loading order 2005-12-18 20:13:26 +00:00
wmcoolmon e5c23334bc Added +nocreate and more verbose index handling for beam sections 2005-12-17 00:59:48 +00:00
wmcoolmon 3bc1b2f1be Better handling of beam overrides (bm_unload textures as they are replaced) 2005-12-17 00:50:55 +00:00
taylor 83eeeb3a35 ehh, didn't ever fix that to my satisfaction, bastardize it until more work can be done (so people don't start filing bug reports) 2005-12-16 16:34:35 +00:00
taylor e4a6cc9aeb apply at least some lighting to ship insignias rather than them being full bright 2005-12-16 06:54:10 +00:00
taylor bfce103ded fix a NULL pointer crash from shipselect screen
make sure to reset "display_type" for weapon select since it would only render one ship correctly
  (still something wrong here WMC, try using models without -ship_choice_3d, everything is positioned too high on screen)
2005-12-16 06:51:31 +00:00
taylor 9ac1accce9 "House Keeping!!"
- minor cleanup of things that have bothered me at one time or another
  - slight speedup from state switching
  - slightly better specmap handling, fixes a couple of (not frequent) strange and sorta random issues
  - make sure to only disable HTL arb stuff when in HTL mode
  - handle any extra lighting pass before spec pass so the light can be applied properly
2005-12-16 06:48:28 +00:00
wmcoolmon 6264b3f9fa Keep a crash from happening if POF file isn't initially specified 2005-12-16 03:36:21 +00:00
taylor 2520f81baa fix limits checking messages to actually be useful and hit sooner (wireframe view of some hi-poly models was going out-of-bounds from normals) 2005-12-15 16:31:03 +00:00
taylor 76eda9798d make sure we always disable all VBO related elements to avoid crashing (new that was a problem, did it anyway, me == stupid) 2005-12-15 16:27:45 +00:00
taylor 4c42eb6fcc didn't mean for that to hit CVS, it makes neb missions work a little strange 2005-12-15 16:26:35 +00:00
phreak f4a2c22285 Countermeasres parameters. Lets users specify how easily missiles are spoofed by countermeasures
A missile is given a seeker strength.  Aspect default of 2.  Heat default of 3.  This is a missile's resistance to spoofage
A countermesaure is given an effectiveness for each type.  The defaults for countermeasure heat and aspect effectiveness are both 1.
Also gave the countermeasure an effective range.  Default is 300 meters.

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

Also i gave the option of aspect missiles having a view cone different from 180 degrees.  This parameter is optional and doesn't effect anything already there.
2005-12-15 06:03:50 +00:00
phreak 79ba02b4e2 [V] can't spell 'turret' 2005-12-15 04:31:05 +00:00
wmcoolmon f8afaf5a62 Added script_lua_callback 2005-12-14 20:31:18 +00:00
taylor 957a5ad360 should have tested that better, it was still finding or ignoring options that it shouldn't if they were in the wrong order on
the same source (source being the two possible cmdline_fso.cfg files and the actual args passed on the cmdline)
2005-12-14 17:58:26 +00:00
phreak 013cb53c1e Handling of exit explosions for beams when a ship is about to get destroyed, or according to the code: "tooled".
Bumped beam frame collisions to 10 to compensate.
2005-12-14 08:07:33 +00:00
wmcoolmon 1aef275407 Ability to disable damage particle spew on ships 2005-12-13 22:32:30 +00:00
wmcoolmon c4fd42c48e Grr, how did I miss this? 2005-12-13 21:50:20 +00:00
wmcoolmon 23b4ed0f70 Music TBL to proper XMT file (-mus) 2005-12-13 21:48:39 +00:00
wmcoolmon 9cff1a52c0 Minor XMT-engine wash fix 2005-12-13 20:20:20 +00:00
taylor b36baacca7 Hmm, .triggers isn't ever malloc'd for the Ships[] copy so don't try to free it since it's actully trying to free the Ship_info[] memory instead, which is bad :)
(newer glibc just starting going monkey over this, not sure why it didn't screw up before)
2005-12-13 18:15:26 +00:00
phreak b0b9202aa2 various countermeasures related fixes. Special cases needed to be handled. 2005-12-13 05:27:36 +00:00
taylor 53e120a16d make sure that the value of model_current_LOD stays with the detail_level value so that it's properly capped when used latter
undo the locked detail level change, all of the LOD textures are cached (or should be) so that really only hurt speed rather than helping
2005-12-12 22:04:19 +00:00
taylor 5bb3145073 allow use of a specific LOD for ship and weapon rendering in the hud targetbox 2005-12-12 21:32:14 +00:00
taylor 37fad529ab double free and invalid ptr reference fixage 2005-12-12 05:29:59 +00:00
taylor e0a4ca8494 switch the shockwave pof and normal names back to the correct spots, this was probably causing some
3-D shockwave usage issues since they wouldn't have rendered
2005-12-08 15:33:39 +00:00
taylor 4b34bbca19 fix several bad crash related problems from WMC's commits on the 4th 2005-12-08 15:17:35 +00:00
taylor ff5da43159 a few game_busy() changes 2005-12-08 15:11:29 +00:00
taylor 1dd17dc698 add APPLE_client_storage support to improve texture performance and reduce memory usage a tiny bit on OS X 2005-12-08 15:10:07 +00:00
taylor 3d31ed046d signed->unsigned compiler warning fix 2005-12-08 15:08:39 +00:00
taylor 30bd180186 remove GL_NO_HTL define since it's basically useless at this point and can produced non-functioning builds
minor cleanup and readability changes
get Apple GL version change in CVS finally, the capabilities of an Apple GL version don't neccessarily correspond to it's features
2005-12-08 15:07:57 +00:00
taylor 926c78f347 fix last bit of recent spec issue 2005-12-07 12:40:51 +00:00
taylor c1f4db610f partial spec fix, can't mass kill the pointers when they are still needed for the second pass (still something else wrong though)
forgot that the extra rangeelement optimization check isn't needed anymore, just look at indices since that's all we're using
2005-12-07 05:42:50 +00:00
taylor 4501a1fc95 bah, X sucks. I need to beef up error handling there in order to make all of the platforms happy. 2005-12-07 05:39:50 +00:00
taylor eee058af11 make sure with cmdline option check that it's the actual option (-spec was getting picked out of the -spec_* options by mistake) 2005-12-07 05:38:32 +00:00
taylor 253e2ac803 15 individual commits, ya had know I was going to miss something :) 2005-12-06 17:53:25 +00:00
taylor 4fd616b2c5 cleanup some debug log messages:
note that a nprintf() with "Warning" or "General" is basically the same thing as mprintf()
  make sure that OpenAL init failures always get to the debug log
2005-12-06 03:17:48 +00:00
taylor 9d5d9b20a7 add a couple of Assert()'s that it doesn't otherwise check for 2005-12-06 03:15:47 +00:00
taylor c6274f2ffc fix for string overwrites with get_version_string() 2005-12-06 03:14:45 +00:00
taylor 22b9889d33 fix quite a few CFILE issues:
use #define's for path lengths when possible so it's easier to move between functions
  fix huge Cfile_stack[] issue (how the hell did that get through ✌️ QA?)
  add Int3() check on cfopen() so it's easier to know if it get's called before cfile is ready to use
  move path separators to pstypes.h
  fix possible string overruns when setting up CFILE roots
  make sure we don't try to init current directory again thinking it's a CD-ROM
  add the list of VP roots to debug log, this will undoubtedly be useful
when -nosound is use go ahead and set -nomusic too to both checks are correct
add list of cmdline options to debug log
fix possible overwrite issues with get_version_string() and remove '(fs2_open)' from string plus change OGL->OpenGL, D3D->Direct3D
2005-12-06 03:13:49 +00:00
taylor d11422acc2 add base support for 8-bit DDS images
clean up some DDS error messages and other minor bug/comment fixes
move bitmap stuff from pstypes.h, it makes more sense here anyway
start of 8-bit palette conversion, needs work but is here for WMCoolmon to look at and play with
2005-12-06 03:05:53 +00:00
taylor 83ecc534e5 move the pragma warnings here from pstypes.h for Windows
add indexed palette support for DDS images
2005-12-06 03:02:28 +00:00
taylor 32f6b62c8f add a nomusic check to not get an error when eval on the change soundtrack sexp 2005-12-06 03:01:25 +00:00
taylor f0db463f56 get away from using CFILE here, needed this to change cfile init order 2005-12-06 03:00:09 +00:00
taylor 367e8e6ed2 sorry but the extra messages are somewhat annoying and already exist in another log anyway, disable by default 2005-12-06 02:59:10 +00:00
taylor 1cbac94676 just to be on the safe side 2005-12-06 02:57:57 +00:00
taylor 2bc0f172ce if for some reason we don't end up using a joystick then shut down the subsystem, saves a few cycles 2005-12-06 02:56:15 +00:00
taylor d7b1346adb little consolidation:
move path separator stuff here from cfile.h
  move the pragma warnings to config.h, since they produce warnings on anything that's not MSVC
  move the bmpman related stuff to bmpman.h, if you need this stuff you have to include bmpman.h anyway
2005-12-06 02:55:22 +00:00
taylor 7ea4a5de2e clean up some D3D debug messages to better match new OGL messages (for easier debugging)
remove D3D_32bit variable since it's basically useless and the same thing can be done another way
2005-12-06 02:53:02 +00:00
taylor 985e6522fa clean up some init stuff and fix a minor SDL annoyance
make debug messages a bit more readable
clean up the debug console commands for minimize and anisotropic filter setting
make anisotropic filter actually work correctly and have it settable with a reg option
give opengl_set_arb() the ability to disable all features on all arbs at once so I don't have to everywhere
2005-12-06 02:50:41 +00:00
wmcoolmon 76a6a274a1 Oops, arand should only be generated if it isn't passed to the function as well. 2005-12-05 09:09:53 +00:00
wmcoolmon 2ad2aa2aef "laser" and "missile" to "primary" and "secondary" 2005-12-05 01:54:16 +00:00
Goober5000 a324693691 fix compiler error
--Goober5000
2005-12-04 22:44:00 +00:00
wmcoolmon 683c612e53 Post-final commit 2005-12-04 19:12:53 +00:00
wmcoolmon 15b30e3177 Final commit of codebase 2005-12-04 19:07:49 +00:00
wmcoolmon 9e9afefeb8 Slightly better main hall error handling 2005-12-04 19:06:01 +00:00
wmcoolmon 416bfa7372 Better weapon handling for techroom (more dynamic-limits friendly) 2005-12-04 19:05:06 +00:00
wmcoolmon 9fea22d551 Better XMT beam section handling ("+Index:"); weapon shockwave armor support; countermeasures as weapons 2005-12-04 19:02:36 +00:00
wmcoolmon ee09b63444 Attempt to fix OpenGL crash-on-debug-exit 2005-12-04 18:59:18 +00:00
wmcoolmon 3e2d1800f2 subsystem + shockwave armor support; countermeasures as weapons 2005-12-04 18:58:07 +00:00
wmcoolmon 3860e7eab3 Better overhead-view handling 2005-12-04 18:55:42 +00:00
Goober5000 fc71c4781b bypass annoying warnings when loading optional models
--Goober5000
2005-12-01 07:45:21 +00:00
phreak c6881022f7 texturing shouldn't be on when drawing lines. 2005-11-30 03:07:54 +00:00
wmcoolmon 4c50d3de10 no message 2005-11-27 23:54:13 +00:00
Goober5000 28a7c73be0 bah, forgot a colon
--Goober5000
2005-11-24 09:08:44 +00:00
Goober5000 c3bfdce5f4 * cleaned up mission_do_departure
* fixed a hidden crash (array index being -1; would only
be triggered for ships w/o subspace drives under certain conditions)
  * removed finding a new fighterbay target because it might screw up missions
  * improved clarity, code flow, and readability :)
* added custom AI flag for disabling warpouts if navigation subsystem fails
--Goober5000
2005-11-24 08:46:11 +00:00
taylor b295119800 fix fred2 startup crash (we probably need to Assert() this case so it doesn't easily happen again) 2005-11-24 07:27:14 +00:00
phreak 2fa4e4bfff Added wiki help for -rearm_timer and -missile_lighting 2005-11-24 06:46:39 +00:00
phreak 0539edac2a Added -missile_lighting command line 2005-11-24 06:37:47 +00:00
phreak e92d279af7 Apply lighting to missiles if -missile_lighting command line is set. 2005-11-24 06:37:17 +00:00
phreak 6216367f79 Forgot to add in the part where the rearm timer actually counts down. Minor oversight 2005-11-24 03:07:35 +00:00
taylor 4806fd38dc yeah I know, I should have noticed that little jewel *before* the commit 2005-11-23 06:59:09 +00:00
taylor 0f0c4c61fe make sure all weapons that will get used later in a mission get preloaded 2005-11-23 06:55:47 +00:00
taylor ed29933ae9 crash fix for using flak without having something targetted 2005-11-23 06:54:28 +00:00
taylor a927686ddf when using cheats be sure to properly load up all weapons that aren't already paged in 2005-11-23 06:53:22 +00:00
phreak 6b3fea1de6 whoops i should test my code sometimes 2005-11-23 04:05:23 +00:00
phreak 7a23e780a8 Added the function to estimate rearm and repair time. 2005-11-23 01:06:58 +00:00
phreak 9cbd504e25 Player repair rearm completion timer display added. 2005-11-23 00:49:51 +00:00
phreak d83b89e3fb Calculate player repair timer when the support ship docks to him. 2005-11-23 00:46:26 +00:00
phreak 5926fa1ede Command lines for rearm countdown timer. 2005-11-23 00:43:20 +00:00
taylor 7a0adb4233 yuck, ugly mistake on my part (thanks Goober!) 2005-11-22 04:50:52 +00:00
taylor 9df5fc333e combine weapon_info_close() and weapon_close()
changes to allow use of weapon_expl.tbl and the modular table versions once more
 - the tables aren't required (but a warning will be produced if weapon_expl.tbl doesn't exist)
 - don't back load LODs, if it's not there then don't use it
 - handle a couple of error conditions a bit better
2005-11-22 00:01:11 +00:00
taylor f83daa497c some minor thruster cleanup, if you could actually use the term "clean" 2005-11-21 23:57:26 +00:00
taylor f911f08298 move generic_* functions to their own file 2005-11-21 23:55:57 +00:00
taylor b97ab28144 add generic.cpp and generic.h 2005-11-21 23:55:00 +00:00
taylor 3d82447d09 little cleaner, lot more friendly to 64-bit archs (long type is usually 64-bit there) 2005-11-21 15:01:18 +00:00
taylor ca5ceb38dc add ai_profiles.cpp/.h 2005-11-21 14:57:08 +00:00
taylor b02e8aeb22 i minus u ;) (should fix overzealous directives list) 2005-11-21 13:04:08 +00:00
Goober5000 ba412c3625 remove old files
--Goober5000
2005-11-21 03:51:03 +00:00
Goober5000 7405fae9fc bah and double bah
--Goober5000
2005-11-21 03:47:51 +00:00
Goober5000 60a2e75bb5 and the project file
--Goober5000
2005-11-21 02:46:36 +00:00
Goober5000 b33caf6f45 change from "setting" to "profile"; this way makes more sense
--Goober5000
2005-11-21 02:43:37 +00:00
Goober5000 7354f81ebd add a flag to re-enable shockwaves damaging subsystems (from FS1)
--Goober5000
2005-11-21 01:53:57 +00:00
Goober5000 66f809de42 whoops
--Goober5000
2005-11-21 00:52:19 +00:00
Goober5000 956e48daf4 add ai_settings.tbl
--Goober5000
2005-11-21 00:50:02 +00:00
taylor 9a9a30324e get rid of the while() loop, OGL doesn't stack errors (this killed FRED2 for some reason even though no error was present) 2005-11-18 13:13:47 +00:00
Goober5000 05fc218515 Wiki links updated; many thanks to StratComm :)
--Goober5000
2005-11-18 08:03:23 +00:00
Goober5000 bd9d7150a6 made arrival invalidation more efficient
(probably only a small speedup, but meh)
--Goober5000
2005-11-18 07:53:27 +00:00
taylor d9bf72f1e1 fix for thruster glows (affecting TBP mainly but OC as well):
- thruster glows should always come from ship entry rather than species (it will be initted by the species entry at first)
 - this obviously needs some work done on it but that gets dangerously close to a rewrite and that isn't something I have time for
2005-11-17 20:52:02 +00:00
wmcoolmon d1e8839166 Small fix for XMTs 2005-11-17 05:12:42 +00:00
taylor 821d18bc64 fix crash on kamikaze deaths 2005-11-17 02:31:36 +00:00
taylor e67246a0da correct a little EFF fubar from my -img2dds commit
vocalize EFF loading errors so that they get noticed and fixed sooner
2005-11-17 02:30:49 +00:00
taylor de93963994 pretty sure my brain wasn't working that day 2005-11-17 02:29:21 +00:00
taylor 368afa64da don't try to apply a shockwave force if there is no actual force to apply, avoids needless math and fixes a NULL vec3d warning 2005-11-16 21:27:31 +00:00
taylor dd30247a35 switch from strchr() to strrchr() for extension checks in order to allow for multiple periods in a filename 2005-11-16 21:25:34 +00:00
taylor c0f2766693 allow for badly encoded ADPCM files if it was otherwise decoded properly 2005-11-16 09:16:24 +00:00
taylor a1ee36aa50 umm, no one saw that, right? :) 2005-11-16 07:45:35 +00:00
taylor e08b1d17ea bunch of error checking and code cleanup for the team stuff in ship/weapon select 2005-11-16 05:46:27 +00:00
taylor 1cb151485e didn't mean for that to hit CVS, stops FRED2 from crashing on exit 2005-11-14 08:39:00 +00:00
taylor 8855e5dfde now able to build with OpenAL 1.0 and 1.1 thanks to newer OpenAL CVS changes (patch from icculus.org FS2 mailing list) 2005-11-14 05:12:01 +00:00
Goober5000 a3a5b01f4a fix the icons.tbl bug
--Goober5000
2005-11-13 23:02:04 +00:00
Goober5000 8cc7793044 this should fix the no-warp-effect bug
--Goober5000
2005-11-13 22:27:17 +00:00
taylor c4259f2c0c cmdline option cleanup:
remove from launcher -pcx32, -cell, -UseNewAI
remove from game -loadonlyused, -dxt, -pcx2dds
rename -d3dmipmap, -d3d_no_vsync, -dnoshowvid to non API specific sounding names
add -nograb into help output under Linux/OSX
add -loadallweps and -img2dds
2005-11-13 06:55:38 +00:00
taylor 36955a02fc minor cleanup and comment cleanup about bpp usage 2005-11-13 06:52:06 +00:00
taylor a6ce70ed7e don't fail if not a starfield pof to load, regular starfield bitmaps don't hard fail so this shouldn't either 2005-11-13 06:50:57 +00:00
taylor 9a2ea9c758 small big-endian fix 2005-11-13 06:49:32 +00:00
taylor d79cf2dee8 -loadonlyused in on by default now, can be turned off with -loadallweps 2005-11-13 06:49:05 +00:00
taylor 79d4c25871 make sure that we don't get "-transport" in with the transparent filename check (TBP bug) 2005-11-13 06:47:26 +00:00
taylor 1c1b2c6885 some minor movie cleanup, not what I would like but enough for now 2005-11-13 06:46:10 +00:00
taylor d7a0c971f0 minor cleanup of old code and consolidate the texture compression checks into this one place 2005-11-13 06:45:24 +00:00
taylor 0fe5be4fe9 small bit of EFF cleanup
add -img2dds support
cleanup some D3D stuff (missing a lot since the old code is so unstable I couldn't get it working like I wanted)
some minor OGL cleanup and small performance changes
converge the various pcx_read_bitmap* functions into one
cleanup/rename/remove some cmdline options
2005-11-13 06:44:18 +00:00
taylor a540ad1093 add support for 8/16/24/32 bit output from ani frame decoder 2005-11-13 06:40:19 +00:00
taylor 870804583d remove Cmdline_cache_ani support, it only worked if not in a VP and only on streaming ani so it was pretty much useless 2005-11-13 06:39:38 +00:00
taylor fc38bb1aca never did port this stupid thing to PPC 2005-11-13 06:38:04 +00:00
taylor bc7cc673ee always produce BGR ordered images rather than RGB 2005-11-13 06:37:24 +00:00
taylor 65d99daf39 add LUA building for MSVC6 2005-11-13 06:36:52 +00:00
phreak 56c97212d6 LuaError() body should not be compiled into the code unless USE_LUA was defined in the project file. 2005-11-13 05:25:59 +00:00
wmcoolmon 7cd75811db More warnings instead of Int3s/Asserts, better Lua scripting, weapons_expl.tbl is no longer needed nor read, added "$Disarmed ImpactSnd:", fire-beam fix 2005-11-08 01:04:02 +00:00
wmcoolmon 4ab0828478 Fixed capitalization 2005-11-05 11:00:50 +00:00
wmcoolmon 74879598df Int3() --> Warning 2005-11-05 10:26:09 +00:00
unknownplayer a2b5c17d0e Committed the DX9 December 2004 SDK. None of the DX9 changes have been committed however. This might break the MSVC 2003 build since DX9 and DX8 share the DX8 include files. Just eliminate one from the library paths if you have any problems. 2005-11-05 09:31:45 +00:00
wmcoolmon 26dc0eb8f1 Forgot the breathalyzer 2005-11-05 08:39:10 +00:00
wmcoolmon 7450bb4c84 Fix for this old and silly bug. 2005-11-05 08:38:36 +00:00
phreak 12ecdcee1a add/remove-sun-bitmap. Also changed "Ship_arrival_list" to "ship_arrival_list" since the former technically doesn't exist due to the capital 'S'. 2005-11-05 07:42:09 +00:00
wmcoolmon b3d4879346 Support for using Lua files for hooks 2005-11-05 05:13:05 +00:00
wmcoolmon b3e7e10a64 Fix(?) for checking whether a weapon is armed or not 2005-11-05 05:12:21 +00:00
wmcoolmon 08f49c1cc1 Slight optimization 2005-11-05 05:11:29 +00:00
wmcoolmon de875a5b47 Removed unneccessary casts 2005-11-05 05:08:58 +00:00
wmcoolmon 899f22b4f1 turret-change-weapon 2005-11-05 05:06:13 +00:00
Goober5000 2a7c6f3f8d remove unused commented stuff
--Goober5000
2005-10-31 09:12:16 +00:00
Goober5000 edb760d4a6 bit of tweakage
--Goober5000
2005-10-31 09:09:41 +00:00
wmcoolmon 0118ff2b47 Support for passing C pointers w/ LUA 2005-10-31 08:57:40 +00:00
wmcoolmon f840b9aac1 Support for custom operators in Lua 2005-10-31 06:37:17 +00:00
Goober5000 5d5f8abf6d stuff for comparing ship classes
--Goober5000
2005-10-30 23:45:45 +00:00
Goober5000 9b9e3dbc7e added scripting stuff to MSVC project
--Goober5000
2005-10-30 21:05:24 +00:00
Goober5000 ccd9fef895 fix the support ship spawning bug
--Goober5000
2005-10-30 20:42:45 +00:00
Goober5000 ff3cb87bb6 comment fixage 2005-10-30 20:20:44 +00:00
taylor 3c2f9cd4c2 add a bunch of Assert()'s and NULL checks to either help debug or avoid errors
fix Mantis bug #381
fix a small issue with the starfield bitmap removal sexp since it would read one past the array size
2005-10-30 20:03:40 +00:00
taylor f19b013589 same basic cleanup and self-sanity changes
split up WinMain() and main() so it doesn't resemble ifdef hell
rename WinMainSub() to game_main() and move anything that should have been in WinMain() to WinMain()
2005-10-30 20:00:22 +00:00
wmcoolmon 07cd84e050 Display a special dialog if the player tries to continue a campaign with no missions 2005-10-30 19:22:31 +00:00
wmcoolmon 7d7a5de047 Return an error if mission_campaign_next_mission() is called when the campaign has no missions 2005-10-30 19:21:45 +00:00
wmcoolmon f246e61ae7 Fix scripting.html 2005-10-30 18:19:58 +00:00
taylor 12997f37b2 add Lua support for automake/autoconf 2005-10-30 10:46:23 +00:00
taylor 3ea8c641bf fix a couple of campaign savefile bugs for WMC 2005-10-30 10:45:19 +00:00
wmcoolmon bb3e884c38 Codebase commit - nebula.tbl, scripting, new dinky explosion/shockwave stuff, moving muzzle flashes 2005-10-30 07:10:20 +00:00
wmcoolmon 78fab0c331 Codebase commit - nebula.tbl, scripting, new dinky explosion/shockwave stuff, moving muzzle flashes 2005-10-30 06:45:00 +00:00
Goober5000 50752e3e42 multiple ship docking implemented for initially docked ships
--Goober5000
2005-10-29 22:09:31 +00:00
taylor d5b777093f Add some error checking and handling to better deal with possible problems, and to let us know what/where they are 2005-10-29 12:26:58 +00:00
taylor 63db92b251 bullet-proof the loadout read a little bit (did this before and had it locally, must have missed CVS) 2005-10-29 12:25:49 +00:00
wmcoolmon 0e1fe216c3 Safeguard against saved loadout and loadout changes. 2005-10-29 09:06:52 +00:00
wmcoolmon b8509e1701 Better alloc_block function 2005-10-29 09:02:13 +00:00
wmcoolmon 354e641cc6 Minor change to an assert 2005-10-29 09:00:41 +00:00
taylor 0c9d02d4af hmm, didn't even notice that earlier 2005-10-28 14:52:26 +00:00
taylor 6e427e11e9 some minor cleanup and compiler warning fixes 2005-10-28 14:49:35 +00:00
taylor 224cde1275 don't do any decal processing if decals are not enabled 2005-10-28 14:48:26 +00:00
taylor 02480d6485 fix issue where GR_640 based non-standard resolutions (ie. 800x600) would use GR_1024 screen coordinates/sizes 2005-10-28 14:47:16 +00:00
taylor 6f18a905e0 more TMAP_MAX_VERTS overflow protection for non-HTL usage (these are the things that need to be addressed to fix non-HTL)
fix some compiler warning messages
don't do any decal processing if decals are disabled, the math was a waste of CPU cycles in that case
2005-10-28 14:45:55 +00:00
Goober5000 e2092f240b nitpicked a rather dumb non-bug
--Goober5000
2005-10-28 06:10:07 +00:00
phreak 6dcbcc178e Added extra documentation for add-background-bitmap and add-sun-bitmap 2005-10-28 05:48:55 +00:00
phreak 5f8e6a71de added implementation for add-background-bitmap and remove-background-bitmap 2005-10-28 05:25:27 +00:00
taylor f350e06851 some minor fixes to message_translate_tokens(), fixes a bug and adds some out-of-bounds checks 2005-10-27 16:24:24 +00:00
taylor 74e3d5401a go back to using abort() over exit() for Assert's and Int3's but close out SDL first this time, makes debugging much easier 2005-10-27 16:23:03 +00:00
taylor 53d10eabf0 fix some automake errors with OSX 10.4's crappy AutoMake and a couple of other OS X related terminal compile fixage 2005-10-27 16:21:19 +00:00
taylor 5880db458e D3D missed the non-standard resolution updates for aabitmaps, should fix briefing icon positioning 2005-10-26 20:54:18 +00:00
taylor b35d857131 convert Jpegs from RGB to BGR after read, OpenGL had a problem with this, D3D still works fine 2005-10-26 20:53:02 +00:00
taylor 9ac238f864 update Xcode project with IFF stuff 2005-10-26 20:51:55 +00:00
taylor 53d95c6b04 make sure that XMTs don't try to still create an invalid entry when +nocreate is used 2005-10-26 00:43:06 +00:00
wmcoolmon 81499b0c12 Bumped MAX_HOTKEY_TARGET_ITEMS 2005-10-25 01:21:52 +00:00
phreak ae966e5e2c implementation for nebula-change-storm and nebula-toggle-poof. looks like they're working 2005-10-24 23:28:37 +00:00
taylor b664b38efd init thruster stuff properly so that bmpman doesn't have a fit 2005-10-24 12:42:14 +00:00
Goober5000 a8dcf18e3b merge Bobboau's thruster code back in; hopefully this covers everything
--Goober5000
2005-10-24 07:13:05 +00:00
taylor 79f76ca829 not sure what I was smoking there, max shininess value is 128, not 180 2005-10-24 04:48:14 +00:00
phreak 0aeb51d927 Get the new nebula argument types working in fred. 2005-10-24 02:53:48 +00:00
wmcoolmon 14cc8930dc Removed max_overclock restriction related to warpout 2005-10-24 02:15:41 +00:00
taylor dd21fa57f2 some cleanup, fix some general memory leaks, safety stuff and whatever else Valgrind complained about 2005-10-23 20:34:30 +00:00
taylor 7032e999c8 fix crashes and minor slowdowns when sound is disabled (-nosound) 2005-10-23 19:08:01 +00:00
taylor f47f4034dd make AABITMAP use GL_ALPHA rather than GL_LUMINANCE_ALPHA (now 8-bit instead of 16-bit, fixes several minor rendering issues) 2005-10-23 19:07:18 +00:00
taylor b8aa6b368d minor cleanup to screenshot code
force front buffer reads for relevant glReadPixels() calls
2005-10-23 14:12:35 +00:00
taylor 2692d35509 add -ogl_shine to adjust the OGL shininess value so that people can play around and find the best value to use 2005-10-23 11:45:06 +00:00
taylor 5e932a8730 fix memory errors from new[]/delete[] mismatch 2005-10-23 11:44:07 +00:00
wmcoolmon 6e97ac964a Ack, missed testing compile under an Inferno build 2005-10-23 05:37:59 +00:00
wmcoolmon e48b96749b *Fix* 2005-10-23 05:01:49 +00:00
phreak 610a99aa72 add-background-bitmap and add-sun-bitmap needed scale values added
also their sexp functions should not return integers.
2005-10-23 04:48:26 +00:00
phreak 21d4b75975 various background and nebula sexps
add-background-bitmap
add-sun-bitmap
remove-background-bitmap
remove-sun-bitmap
nebula-change-storm
nebula-toggle-poofs

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

I've put these sexps in a new fred subcategory called "Backgrounds and Nebula"
along with the sexps "change-skybox-model" and "mission-set-nebula"
2005-10-23 04:18:23 +00:00
Goober5000 1b6fff053d made Cmdline_UseNewAI toggle the mission flag, plus fixed a few other flag-related potential bugs
--Goober5000
2005-10-22 22:25:23 +00:00
Goober5000 f510a86176 rolled back UnknownPlayer's commit
--Goober5000
2005-10-22 22:22:41 +00:00
wmcoolmon ab64770625 mission-set-nebula fixage; remainder of python code 2005-10-22 20:17:19 +00:00
taylor 82749f9b17 couple of changes to NULL vec fixes which better match what Volition would have done (makes both Goober and myself happier :))
keep track of what was an error (even if erroneous) and why with "VECMAT-ERROR" comment
2005-10-22 06:26:30 +00:00
unknownplayer 82a8322255 Added -UseNewAI command line option to force the game to always use
the SCP AI changes. As of now there's some problem in gr_d3d_set_render_target
that crashes the game when it gets to a mission.
2005-10-22 04:28:17 +00:00
taylor 64813b19e4 fix main NULL vec errors, still at least one left but these were those that happened most often:
modelinterp.cpp:parse_tmap() -> first IS_VEC_NULL() check would fail, wasn't a second on reassign
  aicode.cpp:ai_path() -> when (Pl_objp->pos == gcvp), fixed globally in vecmat.cpp:vm_vec_dot_to_point()
2005-10-21 11:32:15 +00:00
taylor 6f579ff221 fix player warpout
basic code cleanup (that previous braces change did nothing for readability)
spell "plyr" correctly
tweak warp shrink time to better match WMC's other changes and avoid the skipping during shrink
2005-10-20 17:50:03 +00:00
taylor ff69f8e38c minor readability fix
plug a memmory leak and possible Polygon_models[] madness if a POF can't be found or is otherwise invalid
2005-10-20 15:33:44 +00:00
wmcoolmon 36a0c5f66a More player warpout speed stuff 2005-10-20 06:38:18 +00:00
wmcoolmon a9e5f602b6 Oops, guess I didn't commit this stuff 2005-10-20 06:37:34 +00:00
taylor 4fc5973d71 fix some bugs with spawn type weapon assignments, particularly with TBMs 2005-10-19 20:54:06 +00:00
wmcoolmon 6551410df2 Don't need this anymore 2005-10-19 04:23:05 +00:00
taylor 9906d23845 make sure gamesnd_parse_soundstbl() doesn't inf-loop because of species problems
if we have missing species then report that before the end of table section check so we're sure to know what's missing
2005-10-18 14:57:32 +00:00
taylor 7c7932b963 lowercase filenames in model_load_textures()
turn texture loading debug messages back on but under "Maps" so they are easy to turn off if not wanted
2005-10-17 14:23:21 +00:00
unknownplayer 602090cb05 Final update to the project files - all compile correctly on MSVC_2003
from the sources on the CVS.
2005-10-17 08:43:03 +00:00
unknownplayer 4dc67e1d7a Updated the files from the MSVC 6 projects - they seem to work better. 2005-10-17 08:38:17 +00:00
taylor 44ddf3545c dynamically allocate object collision pairs 2005-10-17 05:48:18 +00:00
unknownplayer bceee9d8f0 Added project files for MSVC_2003 - these are made from the MSVC_7 files. 2005-10-17 02:17:26 +00:00
wmcoolmon acd09d9daf Fix redmenace's compile problem 2005-10-17 02:09:29 +00:00
wmcoolmon 9e635dbe2c Make weapons clip less 2005-10-17 01:54:15 +00:00
wmcoolmon c268bb02b5 Weapon models now shown in lab 2005-10-17 01:51:01 +00:00
wmcoolmon 542c762d6a Some cfile changes that slipped by 2005-10-17 00:13:28 +00:00
wmcoolmon 668fc5354c USE_OPENAL 2005-10-17 00:03:13 +00:00
wmcoolmon 54ff9951c9 Change this back for MSVC.NET? 2005-10-17 00:02:46 +00:00
wmcoolmon 7fa35140e5 CFile stuff 2005-10-17 00:02:09 +00:00
wmcoolmon efed95c7ec Updated & fixed project files 2005-10-16 23:31:58 +00:00
wmcoolmon b00f5f9a55 Hardened cfile against array overflows 2005-10-16 23:15:47 +00:00
wmcoolmon fbfa6253af Small fix for amor code 2005-10-16 23:15:13 +00:00
Goober5000 d59e425522 I need to bone up on my bulletproofing
--Goober5000
2005-10-16 18:54:12 +00:00
taylor be5d54a1ac use unsigned index buffers 2005-10-16 11:20:43 +00:00
taylor 17a5e786a4 (NULL != (int)0); the size and type of NULL is platform and implementation dependant and should only be used for pointers!
fix naughty bug that would set the flyby sound filenames to NULL
2005-10-16 11:19:57 +00:00
taylor 1d6dad9e36 clean up a couple of things 2005-10-16 10:12:14 +00:00
Goober5000 c6691a22c7 ship-create now generates a default name if you specify "<none>" for the ship name
--Goober5000
2005-10-16 00:32:30 +00:00
taylor 73d4f0878d properly handle cases where bm_make_render_target() might have failed 2005-10-15 20:53:29 +00:00
taylor 2df63f7ab6 make sure that bm_make_render_target will handle failure 2005-10-15 20:42:40 +00:00
taylor 58db700691 add error message in case the number of verts on a submodel is in excess of SHRT_MAX 2005-10-15 20:28:26 +00:00
taylor 670c7db695 make some code a bit more readable
speed up index buffer generation just a tad (maybe 1/3rd)
2005-10-15 20:27:32 +00:00
Goober5000 f6c883f15a add weapon-create sexp
--Goober5000
2005-10-14 09:29:56 +00:00
Goober5000 ae639154f9 removed an unneeded parameter and renamed some stuff
--Goober5000
2005-10-14 07:22:24 +00:00
Goober5000 af61e2625b stuff for WMC: fix sexp description and three warnings; plus add some
bulletproofing to name-specified ship_create
--Goober5000
2005-10-14 07:06:59 +00:00
wmcoolmon 6708680ce7 armor.tbl work 2005-10-14 02:13:52 +00:00
wmcoolmon 1ad2884678 Make ship_create not return a value 2005-10-13 23:23:32 +00:00
wmcoolmon 5b18b70cf1 Fixage for ship_create 2005-10-13 18:47:45 +00:00
taylor 0a567569b7 new timer code that shouldn't suffer from multi-cpu (or dual core) systems
clean out all old Windows timer code since that was just a mess at this point
2005-10-12 05:45:35 +00:00
taylor 0d59f876fc temporary cmdline option, -y_bug_fix, to switch between original code (default) and previous attempt at the Y-bug fix 2005-10-12 05:43:40 +00:00
taylor fa84045144 little cleaner since the two sets weren't needed 2005-10-11 12:24:04 +00:00
taylor 79296221d5 fix memory freakage from dynamic spawn weapon types 2005-10-11 08:30:38 +00:00
wmcoolmon 6adc96626d Topdown updates 2005-10-11 07:43:10 +00:00
wmcoolmon e18977d6db Gliding 2005-10-11 05:24:34 +00:00
taylor 20054116b3 actual cmeasure fix, don't know why the hell it didn't end up other commit 2005-10-10 17:32:59 +00:00
taylor d3481714d0 remove NO_NETWORK 2005-10-10 17:21:11 +00:00
taylor b1aafc762d remove NO_NETWORK
little sanity on model_load() calls
fix cmeasure bug where a blank entry was getting added
2005-10-10 17:19:07 +00:00
taylor acb0a733ad remove NO_NETWORK
clean out some old debug messages that were littered about
2005-10-10 17:17:45 +00:00
taylor e04af2c55c remove NO_NETWORK
whether multi is disabled or not is now determined at runtime
clean out some crap and old debug messages that were littered about
2005-10-10 17:16:22 +00:00
taylor 1180236c5a remove NO_NETWORK
fix controlconfig so that axes can be set to joystick/mouse using the mouse (required when no joystick attached)
2005-10-10 17:14:31 +00:00
wmcoolmon 8748c27fa2 Tidied up code a bit 2005-10-10 01:14:11 +00:00
Kazan c2448a5e74 some weird character was on the head of weapons.cpp 2005-10-09 23:56:22 +00:00
wmcoolmon 9c98551411 Added names to the 'limits reached' dialogs in ship/weapons.tbl 2005-10-09 17:38:49 +00:00
wmcoolmon 645f16cf35 Added warpin/warpout speed values to the lab 2005-10-09 09:18:10 +00:00
wmcoolmon 3981b4b7a2 Added warpin/warpout speed override values to ships.tbl 2005-10-09 09:13:29 +00:00
wmcoolmon 8093cd287d Minor update to ship-create description 2005-10-09 08:10:03 +00:00
wmcoolmon 0dbb5e657c New SEXP stuff 2005-10-09 08:03:21 +00:00
wmcoolmon d1f0e95428 Added sexps set-object-speed-x, set-object-speed-y, set-object-speed-z,
and ship-create
2005-10-09 06:10:59 +00:00
wmcoolmon 7e03e42748 Much better laser weapon/pof handling, removed a couple unneccessary
warnings (used to try and track down a bug)
2005-10-09 03:13:13 +00:00
wmcoolmon 754cad0765 Bumped MAX_PAIRS to prevent objects flying through other objects 2005-10-09 01:50:04 +00:00
wmcoolmon 49f27a4ee6 Extendable modular tables (XMTs); added weapon dialogs to the Lab 2005-10-09 00:43:09 +00:00
wmcoolmon 5dd18ef15c Attempt to fix crash bug on 'Mystery of the Trinity' 2005-10-08 19:29:08 +00:00
wmcoolmon 26505b4422 Error checking for dock error 2005-10-08 18:46:38 +00:00
wmcoolmon c3768a5acf Better readability for parse errors 2005-10-08 18:26:40 +00:00
wmcoolmon ad3e402ede These are no longer needed... 2005-10-08 18:25:41 +00:00
taylor 154633d986 fix several asteroid problems, little code duplication but this actually works and is less error prone than the previous method 2005-10-08 15:37:26 +00:00
wmcoolmon 78721098ba Fix Int3() from ship-vanish 2005-10-08 05:41:09 +00:00
taylor e42dac2301 make sure player death message works when using a NO_NETWORK build 2005-10-06 07:53:01 +00:00
Goober5000 c9ecc594c2 fixed the CTD when support is called for a ship lacking a rearming dockpoint
--Goober5000
2005-10-02 23:12:44 +00:00
Goober5000 7787819daf removed a redundant action
--Goober5000
2005-10-02 23:01:17 +00:00
Goober5000 7a0fe0c0f6 juxtaposition for clarity
--Goober5000
2005-10-02 23:00:39 +00:00
taylor 0a7dea55ee remove -rlm, it's always on now since there was never a complaint and pretty much everyone uses it
add -cache_bitmaps and have bitmap caching between levels off by default
when -cache_bitmaps is used then use C-BMP for top-right memory listing, and just BMP otherwise
2005-09-30 09:47:06 +00:00
taylor 98e2ca8ed6 add iff stuff to makefile 2005-09-30 09:44:19 +00:00
Goober5000 7516d29d62 hooray for more work on the iff code
--Goober5000
2005-09-30 03:40:40 +00:00
Goober5000 995aa49245 parsing stuff
--Goober5000
2005-09-30 03:19:57 +00:00
Goober5000 2e06e37264 parse fixage
--Goober5000
2005-09-29 04:26:09 +00:00
Goober5000 86a1963c0f fix debug warning
--Goober5000
2005-09-27 08:09:13 +00:00
Goober5000 97eea3b17d small fix, bah
--Goober5000
2005-09-27 06:39:23 +00:00
Goober5000 ab5bce6796 added iff_defs to project
--Goober5000
2005-09-27 06:39:04 +00:00
Goober5000 556bf806d5 initial commit of basic IFF code
--Goober5000
2005-09-27 05:25:19 +00:00
Goober5000 620e3d8990 betterizing
--Goober5000
2005-09-27 05:01:52 +00:00
Goober5000 4cf60293d3 clarification
--Goober5000
2005-09-27 02:36:58 +00:00
Goober5000 c5d279bd8d this should fix the rest of the briefing icon bugs
--Goober5000
2005-09-26 06:00:59 +00:00
Goober5000 caaa2b3ff4 small fix
--Goober5000
2005-09-26 05:24:25 +00:00
Goober5000 ff2eb59e13 moved these per taylor's recommendation
--Goober5000
2005-09-26 04:53:19 +00:00
Goober5000 956b638685 some more cleanup
--Goober5000
2005-09-26 04:51:00 +00:00
Goober5000 2db3aade28 some more cleanup
--Goober5000
2005-09-26 04:08:54 +00:00
Goober5000 8efd3812ac okay, this should all be working :)
--Goober5000
2005-09-26 02:15:03 +00:00
Goober5000 8f3db90fec and again, gah
--Goober5000
2005-09-25 23:02:29 +00:00
Kazan 24b7d99e83 my bad 2005-09-25 22:29:35 +00:00
Goober5000 dff26b92c2 more fiddly stuff
--Goober5000
2005-09-25 22:24:22 +00:00
Kazan ec652649d2 correct an error 2005-09-25 22:23:39 +00:00
taylor a85c8ac841 gah. 2005-09-25 21:00:40 +00:00
Goober5000 793f113ac9 oh noes!
--Goober5000
2005-09-25 20:55:28 +00:00
Goober5000 cc64562491 taylor forgot something ;)
--Goober5000
2005-09-25 20:42:57 +00:00
Goober5000 4c5696580b okay; everything should be good to go
--Goober5000
2005-09-25 20:31:42 +00:00
taylor f96075c2fd GCC fixage, my Whiffle Bat that was saved for Bobboau's constant breaking is currently getting "Goober5000" etched into it :) 2005-09-25 18:48:25 +00:00
taylor 299b2d0330 fix Subsys_status leak, wasn't a problem in game but can be touchy on exit 2005-09-25 18:44:51 +00:00
Goober5000 6a3c8e79ff Okay, everything should now work again. :p Still have to do a little more with the asteroids.
--Goober5000
2005-09-25 08:25:16 +00:00
Goober5000 bda507de36 remove unneeded #include
--Goober5000
2005-09-25 08:23:38 +00:00
Goober5000 bb03f3a4ef remove duplicate #include
--Goober5000
2005-09-25 08:21:54 +00:00
Goober5000 7236d2f0c3 and again
--Goober5000
2005-09-25 07:27:33 +00:00
Goober5000 25e55bf580 try to fix the headers
--Goober5000
2005-09-25 07:26:05 +00:00
Goober5000 3ae72e2854 partial commit; hang on
--Goober5000
2005-09-25 07:07:34 +00:00
Goober5000 61d603024e bah
--Goober5000
2005-09-25 05:26:13 +00:00
Goober5000 81784bfa63 hopefully complete species upgrade
--Goober5000
2005-09-25 05:13:07 +00:00
Goober5000 0a62ed5121 meh for consistency
--Goober5000
2005-09-25 02:15:02 +00:00
Goober5000 112f43d532 cleaned up some more thruster stuff; honestly, the thruster code is such a
mess that it should probably be reverted to the retail version
--Goober5000
2005-09-24 07:45:31 +00:00
Goober5000 784b494bae fixage
--Goober5000
2005-09-24 07:18:15 +00:00
Goober5000 374b2b21a0 another species overhaul
--Goober5000
2005-09-24 07:07:17 +00:00
Goober5000 9e4037498f a fix
--Goober5000
2005-09-24 02:57:12 +00:00
Goober5000 906c904881 whoops
--Goober5000
2005-09-24 02:43:33 +00:00
Goober5000 d1ade71cc3 get rid of a whole bunch of Microsoft warnings
--Goober5000
2005-09-24 02:40:10 +00:00
Goober5000 60be5fde17 bah
--Goober5000
2005-09-24 02:24:29 +00:00
Goober5000 dbb5c74ed9 a bunch of support ship bulletproofing
--Goober5000
2005-09-24 01:50:10 +00:00
Goober5000 96f63676a7 this isn't needed because of is_support_allowed
--Goober5000
2005-09-24 01:41:21 +00:00
Goober5000 29eb660e83 bettered the web cursor bitmap error message
--Goober5000
2005-09-23 23:07:11 +00:00
Goober5000 13c6d559b7 something for WCS
--Goober5000
2005-09-23 22:48:56 +00:00
taylor dca7e3f5a9 fix screen update of pilot list when you delete one of them 2005-09-22 19:16:48 +00:00
taylor 0d63b59c8e entries for icon file
some general cleanup of the project file
use "Release" and "Debug" for the builds since that's the terminology we use
2005-09-22 11:22:52 +00:00
taylor aaa7e6e243 delay for fox OS X, SDL messes up for some reason and though I don't like this, even Apple does it 2005-09-22 11:21:22 +00:00
taylor 16fee1c55e byte-swap for 32-bit uncompressed DDS images on big endian 2005-09-22 11:20:11 +00:00
taylor 9589f198fa ignore .DS_Store from OS X
add .cvsignore for Xcode project stuff
temporary placeholder for real FS2_Open icon file
2005-09-22 11:18:30 +00:00
Goober5000 c9e63a8972 add option for warp flash; mess with the cmdlines a bit
--Goober5000
2005-09-21 03:55:32 +00:00
wmcoolmon 8e51aeff23 New parsing functions that I'll be using for XMTs once I get them
working
2005-09-20 04:51:45 +00:00
wmcoolmon adb2bba03f Oops. Breathalyzer standing by... 2005-09-20 04:51:01 +00:00
wmcoolmon 31ebacbb5f Some work I did on the camera code 2005-09-20 04:48:52 +00:00
wmcoolmon b413343c63 Fixed techroom crash if there are no entries to display; removed
unneeded MULTIPLAYER_BETA_BUILD define that disallowed supercaps
2005-09-20 04:37:01 +00:00
taylor 8d5524caad fix a couple of things that Valgrind complained about 2005-09-20 02:48:37 +00:00
taylor f2d072ee16 make sure that any extra ship textures get loaded on a class change (that Ares bug which wasn't actually Ares specific) 2005-09-20 02:48:06 +00:00
taylor de8bbd5254 slight speedup for font rendering
fix a couple of things that Valgrind complained about
2005-09-20 02:46:53 +00:00
taylor 9257d21836 bump version to 0.6
add a specified directory to output files to
2005-09-20 02:45:47 +00:00
taylor ab15d95854 gah, revert that since it was never going to work (not sure what I was drinking that day) 2005-09-18 23:06:17 +00:00
wmcoolmon b954e00155 Fixed silly i variable placement mistake 2005-09-18 20:41:10 +00:00
Goober5000 dc858cd4a6 a small fix
--Goober5000
2005-09-18 02:28:18 +00:00
phreak 7a2c4e2a0d radar bitmap should render the correct color using -orbradar 2005-09-17 19:12:37 +00:00
Goober5000 f5d5226073 better tweak 2005-09-17 01:41:49 +00:00
Goober5000 6c1b1b7114 tweak 2005-09-17 01:37:02 +00:00
Goober5000 a150ca39b8 It is a strange fate that we should suffer so much fear and doubt over so small a thing.
Such a little thing...
2005-09-17 01:36:29 +00:00
Goober5000 13f3d01664 roll back taylor's loadout fix and do it this way: it saves memory
(but thanks to taylor for drawing attention to the difference between wing slots and wss slots!)
--Goober5000
2005-09-16 17:02:50 +00:00
taylor 1b5400ad08 fix afterburner bug 2005-09-16 08:11:39 +00:00
taylor 7451942605 when a wing is departing to a bay have ships break formation when playing follow-the-leader 2005-09-16 02:59:55 +00:00
taylor 1f505cdbdb when changing a campaign in the campaign room make sure that the mainhall is properly set without having to play a mission first 2005-09-16 02:51:54 +00:00
taylor a1a8adea45 didn't mean to leave that in there 2005-09-16 00:03:51 +00:00
Kazan f7db4dfbb3 comment out superfluous debug message 2005-09-15 23:54:58 +00:00
taylor 235c7aa72b gah, I still messed that up. Add a NULL check and have register_malloc() actually handle the correct pointer 2005-09-15 05:19:25 +00:00
taylor 0d63e60e92 some vm_* fixage for Windows 2005-09-14 20:38:12 +00:00
taylor d1853b33ea fix ace badges not getting displayed in debriefing 2005-09-14 20:03:40 +00:00
phreak 0b3ad0cc31 fix to a minor annoyance where the hud weapons gauge wouldnt render properly if there were no secondary weapons. 2005-09-14 02:55:04 +00:00
taylor a1f980f14e fix out-of-bounds crash when apply_to_all button is hit 2005-09-13 04:32:11 +00:00
phreak 50cb940d83 sort_weapons_by_type() now also subsorts primaries by whether its supposed to only
be used on big ships or not.
2005-09-11 03:50:42 +00:00
taylor 567357a92c make sure smart shields can't send the strength of a quadrant over the max 2005-09-10 21:10:19 +00:00
Goober5000 9573da9eea "no briefing" flag now works for red-alert missions too
--Goober5000
2005-09-09 05:12:44 +00:00
Goober5000 89c2493853 braces for clarity 2005-09-09 05:11:20 +00:00
phreak c7f4bd2762 sort_weapons_by_type() now subsorts missiles and places fighter-sized weapons ahead of capital weapons and child weapons
its also alot less memory intensive too.
2005-09-08 23:20:54 +00:00
taylor 30106813de make it actually compile under WIN32
bump version to 0.5 since little else is going to be done to this thing
2005-09-08 05:04:15 +00:00
taylor 5b597c5335 fix building/linking of command line tools under Linux/OSX
add tools as targets to OSX project file
2005-09-08 00:09:32 +00:00
taylor def6915ae6 fix mouse position setting in non-standard resolutions 2005-09-06 17:26:39 +00:00
taylor 3bfb995193 use exit(EXIT_FAILURE) rather than abort() so that all atexit() calls will actually get executed 2005-09-06 05:32:12 +00:00
taylor e87ac95a07 fix for -pcx32 on big-endian 2005-09-06 02:40:24 +00:00
Kazan d9f82bda6f fixed a bug related to multiplayer table validation and modular tables 2005-09-06 00:32:20 +00:00
taylor af1df76849 merge of OSX tree
a lot of byte swaps were still missing, will hopefully be fully network compatible now
2005-09-05 09:38:19 +00:00
taylor d06f863d48 merge of OSX tree
fix OGL fullscreen switch for SDL since the old way only worked under Linux and not OSX or Windows
fix OGL version check, it would allow a required major version to be higher if the required minor version was lower than current
2005-09-05 09:36:41 +00:00
taylor 8f43dddac2 a little more cross-platform friendly this way 2005-09-05 09:34:06 +00:00
taylor a91ead80a0 merge of OSX tree
update cmdline stuff for Linux to be less stupid and provide better feedback to the user
2005-09-05 09:33:08 +00:00
taylor 5933f94248 merging of project files for OSX 2005-09-05 09:23:26 +00:00
taylor be1cdd95f9 merging of new files from OSX tree 2005-09-05 09:21:15 +00:00
wmcoolmon f6bb014f7a Fix the ship vanishing in TOPDOWN mode error 2005-09-05 09:02:08 +00:00
phreak 1d279a469d don't wrap the U_offset variable since it causes the beam to jump once it gets reset. 2005-09-03 17:48:21 +00:00
taylor 2520b32796 various weapon_range cap fixes for primary, secondary weapons and hud targetting info 2005-09-01 04:14:04 +00:00
Goober5000 bb71f4b655 hm, typo
--Goober5000
2005-08-31 08:11:58 +00:00
Goober5000 fe4b513b5c All wings will now form on their respective leaders, not just certain starting wings.
If this breaks anything, the old code is commented out.  You know who to yell at. ;)
--Goober5000
2005-08-31 08:09:51 +00:00
Goober5000 78af7600f1 Wings will now form on their leader, not necessarily the player. This is to
account for cases where the player is not the leader of his wing.  It has the
side effect of causing wings that arrive later in the mission to form on *their*
leader rather than the player, but this is probably the preferred behavior (at
least judging from Mike Kulas's comment of 5/9/98).  This does create a
difference from retail AI, but it should be only cosmetic, since ships only form
on a wing until they are ordered (via comm or sexp) to do something else.
--Goober5000
2005-08-31 07:54:33 +00:00
Goober5000 f4cd9067fd removed two unused functions
--Goober5000
2005-08-31 07:17:43 +00:00
Goober5000 8686a71e66 remove a redundant function
--Goober5000
2005-08-31 07:01:40 +00:00
Goober5000 118bbeda61 fix a function prototype to match its counterpart in vecmat.h
--Goober5000
2005-08-31 06:25:27 +00:00
Goober5000 9fa9ae8310 roll back and recommit the minimally invasive version of phreak's fix...
this removes a bit of redundant code
--Goober5000
2005-08-31 06:12:41 +00:00
phreak a8b4fdd4ef real spawn angle fix. The problem stemmed from the matrix argument in vm_vec_random_cone()
being objp->orient and should have been the matrix formed by vm_vector_2_matrix(&m, &objp->orient.vec.fvec, NULL, NULL);
2005-08-31 05:47:02 +00:00
Goober5000 81c940e254 fixed yet another docking bug, based on taylor's original fix :p
--Goober5000
2005-08-31 00:59:35 +00:00
Goober5000 51587ee9ff made spawning missiles work like retail when appropriate
--Goober5000
2005-08-31 00:48:22 +00:00
phreak bcef5f55ff Get rid of alpha blending when using the htl drawing fuctions for lines and spheres.
Right now, gr_opengl_draw_htl_line and gr_opengl_draw_htl_sphere are only used in fred, so
it shouldn't change anything critical
2005-08-29 02:23:04 +00:00
phreak 65a76cd8d6 Record state changes in gr_opengl_set_state() 2005-08-29 02:20:56 +00:00
Kazan dc78cd4498 potential fix for mantis bug 237 2005-08-27 00:21:27 +00:00
taylor 29e119eb05 fix strange static issue experienced with TBP briefing voices 2005-08-26 17:05:13 +00:00
taylor bf90cfdfdc send out multi pings during level load to prevent timeouts on slower computers (does not break network compatibility with older, or retail, clients/servers) 2005-08-26 00:56:17 +00:00
taylor 2a97e46c9b 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
2005-08-25 22:40:04 +00:00
taylor 3832b9d77d fix crash from oversized buffer data requests with OGGs 2005-08-25 22:33:48 +00:00
taylor 3a8e956471 since the geomtry_batcher can send more verts than non-HTL code can handle, avoid drawing in that case to avoid crashing 2005-08-25 22:32:55 +00:00
taylor d440737986 fix Int3() when we are an OGG and need silence data 2005-08-25 06:32:42 +00:00
taylor 01f831c6f8 don't let ai keep firing primary and secondary weapons for fighters and bombers if they are dying (fixes player deathroll too) 2005-08-25 00:48:19 +00:00
Goober5000 4fe9ddb852 tweaky optimization based on the current version of stristr and
the current version of the expanded music.tbl
--Goober5000
2005-08-24 07:20:36 +00:00
Goober5000 2d29d894d0 faster version of stristr
--Goober5000
2005-08-24 07:14:52 +00:00
matt 7aa6a39040 Changed rect_size_y - 1 to rect_size_y. Not really that important, but much more correct. I'll stop barraging cvs now :) 2005-08-23 17:06:28 +00:00
matt b22d44e804 Fixed another screen save bug relating to having your window positioned offscreen. Still isn't great for when the window is offscreen top left 2005-08-23 16:57:28 +00:00
matt 2d93c49a5a Fixed screen save crash when a popup is called 2005-08-23 15:59:51 +00:00
Goober5000 2e6dbb7165 ensure init/reset of goals works cleanly
--Goober5000
2005-08-23 09:18:08 +00:00
Goober5000 6f9563aa62 fix for bug 519
--Goober5000
2005-08-23 09:03:56 +00:00
Goober5000 94462b57a0 removed a thing I apparently forgot to remove on 2005/07/12
--Goober5000
2005-08-23 07:49:24 +00:00
taylor adcd7c68b4 fix navpoint hud brackets and text display in non-standard resolutions 2005-08-23 07:37:14 +00:00
Goober5000 650afb4bc3 some tweaks to parselo, plus ensure that Unicode files don't crash
--Goober5000
2005-08-22 22:24:22 +00:00
Goober5000 d1f5e5efa8 one more change
--Goober5000
2005-08-22 04:59:13 +00:00
Goober5000 c17c45842e final changes to projects and workspace; everything should work now
(in MSVC 6 anyway)
--Goober5000
2005-08-22 04:58:38 +00:00
Goober5000 c74158924c these ogg libs are needed also
--Goober5000
2005-08-22 04:55:38 +00:00
Goober5000 1ee2c1f762 add dx8 libs and headers missing in the dx9 sdk
--Goober5000
2005-08-22 04:53:41 +00:00
Goober5000 82da24cf53 add ogg libs and headers
--Goober5000
2005-08-22 03:11:32 +00:00
taylor 40900e556a fix stats display in debriefing with non-standard resolutions 2005-08-21 21:05:53 +00:00
Goober5000 87b26e68a5 clarified the comment on my original move of the wing departure information assignment
--Goober5000
2005-08-21 06:19:31 +00:00
taylor 8bcc0066b5 more unix->SCP_UNIX define fixing 2005-08-20 20:38:08 +00:00
taylor 99dab0fc7d 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
2005-08-20 20:34:51 +00:00
taylor c2716d4ee8 Make sure to always use world pos for shockwaves in HTL mode, avoids the distance check Error()
(if someone can find a better explanation of why this one thing was different please make a better fix)
2005-08-20 20:32:28 +00:00
taylor 0073206944 Fix an old unix define, should be SCP_UNIX 2005-08-20 20:29:47 +00:00
Goober5000 90d22b6bcd made AwacsMultiplier more user-friendly
--Goober5000
2005-08-20 18:23:02 +00:00
matt 13d5f649b8 Fix for D3D white squares issue 2005-08-20 16:00:03 +00:00
taylor 63f6c54661 Address a couple of pilot code issues
- make the same MAX_PILOTS in the barracks that the playerselect screen has since it's a problem here too
 - add a -1 check for ship/weapon name lookups to avoid bounds issues.  NOTE: this can empty the techroom of entries if ithits this check, but it won't crash :)
2005-08-18 01:15:41 +00:00
Kazan aeb846307d # FEATURE BREAK # This breaks a feature in pilot files temporarily to correct a [reproducable] crash - it is merely commenting out the trouble lines - bug report in mantis and assigned to taylor 2005-08-18 00:19:53 +00:00
Kazan abbb5ff762 [hopefully] Fix the bug i introduced in the show memory usage code, and the convergence bug during autopilot [also saves cpu cycles - MANY of them] 2005-08-16 20:06:24 +00:00
Kazan 8136a01885 i introduced a bug in _vm_realloc.. fixed it 2005-08-14 23:05:27 +00:00
Kazan dd2cc96e74 I'm stupid, sorry - fixed release-build-crash 2005-08-14 21:01:59 +00:00
Kazan cbf139d3a3 diabled NEW_MALLOC on windows - it was causing crashing - must have been corrupting it's own heap 2005-08-14 17:20:56 +00:00
taylor 12a4369650 don't do any ambient sound or music stuff in game_pause()/unpause() on options screens when in mission so we can
avoid having mainhall ambient sounds and music start playing and then not stop until you exit the mission
2005-08-11 12:22:26 +00:00
taylor 3460454893 handle rare cases where anims would get freaky if one happened to still be playing or otherwise queued 2005-08-11 12:18:53 +00:00
taylor 3b15226dd4 little safety check, a couple of strange cases allow this to happen so we should look for it 2005-08-11 12:16:23 +00:00
taylor dc87987f6f well that was rather stupid of me, this would crash if old + new pilots went over MAX_PILOTS 2005-08-09 10:06:47 +00:00
taylor 86b1553f57 be sure to remove ships from a wing when that ship gets vanished 2005-08-08 03:13:53 +00:00
taylor 57849e8b03 hopefully fix the problem that was causing geometry issues in just OGL when using VBOs 2005-08-08 01:19:50 +00:00
taylor e001fd52d6 some minor cleanup
don't load the default 2d shockwave graphics if we have a default 3d shockwave, they won't get used and only take up memory
2005-08-07 09:25:55 +00:00
taylor 20ab76817f forgot to commit this before, did this gui code actually compile for anyone? 2005-08-07 09:24:22 +00:00
taylor 9016077974 fix 3-D shockwave frame detection so that it will use the proper number of frames for the animation (not less, not more) 2005-08-05 15:33:45 +00:00
Goober5000 5be7501506 made "stealth" tag more user-friendly, and fixed a bit of punctuation
--Goober5000
2005-08-03 22:02:38 +00:00
taylor 29c8145762 allow for both gamedir and userdir cmdline config files 2005-08-01 10:00:39 +00:00
taylor af7ef107fd never could get Ai_class_names to realloc properly but this does the job just as well 2005-08-01 09:57:52 +00:00
wmcoolmon c3c798ef46 MR_NO_FOGGING for shockwaves 2005-07-31 20:31:41 +00:00
taylor cdc9651d1b we only care about fmt and data tags so once we have them bail out, fixes some really bad seek errors in crappy wav files 2005-07-31 01:35:43 +00:00
taylor cb9267a16b fix a NULL pointer reference if there are no secondary banks on a ship 2005-07-31 01:34:03 +00:00
taylor 25c650fdf1 few data type fixes, was only a problem for big-endian systems as little-endian doesn't really care about this 2005-07-31 01:32:21 +00:00
taylor 2e4fc6030f print file and line info for Int3() calls to the logfile so that they are easier to debug with basic error reports 2005-07-31 01:30:48 +00:00
taylor 8de3c04a56 Temporarily add an empty AIM_GET_BEHIND case to ai_execute_behavior() to avoid hitting Int3() in TBP 2005-07-31 01:29:21 +00:00
wmcoolmon 2ade5eb731 Removed turret thing, added some more armor type calculations 2005-07-30 22:34:42 +00:00
taylor bb1c89b3ab safety check for TYPE_D beam weapons, the +Shots: count needs to be at least 1 to avoid various errors 2005-07-29 10:18:26 +00:00
Goober5000 efbb8aeab7 verified that submode_start_time is updated whenever submode is changed
--Goober5000
2005-07-27 18:27:49 +00:00
Goober5000 1d407f013d more tweaks to the dock code
--Goober5000
2005-07-27 17:22:22 +00:00
taylor 961695ee7e Add ability to use specific refresh rate, needs a soon to be updated Launcher to have set via GUI
but this can go in already.  Defaults to, and falls back on, previous behavior and adds some
  error checking that wasn't there previously.
2005-07-26 08:46:48 +00:00
Goober5000 27b8e4d992 more bugs and tweaks
--Goober5000
2005-07-25 08:22:00 +00:00
Goober5000 79f5b6bff9 forgot this
--Goober5000
2005-07-25 05:55:40 +00:00
Goober5000 01f4026e4c cleaned up some command line and mission flag stuff
--Goober5000
2005-07-25 05:24:17 +00:00
Goober5000 0aa3b69e1a whoops
--Goober5000
2005-07-25 05:23:33 +00:00
Goober5000 5fb5c7faf7 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
2005-07-25 03:13:26 +00:00
Goober5000 66ea180792 cleaned up some rotating submodel code
--Goober5000
2005-07-24 20:12:55 +00:00
Goober5000 1f1f3c65d0 fixed a minor docking bug
--Goober5000
2005-07-24 19:59:24 +00:00
taylor 4a3aa3ba0b proper multi support for fighter beams, already has code to break protocol commented out if we need it,
decided to skip and beam type checks and let beam_fire() reassign it (should work ok)
2005-07-24 18:35:44 +00:00
taylor 8e0d0603d2 hehehe, fix the check to allow fighter beams to count for kills 2005-07-24 18:33:47 +00:00
taylor 2ba8a0c45d various incarnations of freaky and stupid, need to do this everywhere eventually 2005-07-24 18:32:58 +00:00
taylor 3e75f2121a address possible div-by-0 problem 2005-07-24 18:31:59 +00:00
taylor 53029156ad little 64-bit strangeness (longs are 64-bit here rather than 32) 2005-07-24 18:31:17 +00:00
wmcoolmon 67c6bca0de Multiple shockwaves support. 2005-07-24 06:01:37 +00:00
wmcoolmon c9fb193cc2 Synced 3D shockwaves' glowmaps with the model, tossed in some medals.tbl
support for the demo/FS1
2005-07-24 00:32:45 +00:00
wmcoolmon 432dea9401 Fixed formatting FTW 2005-07-23 22:52:44 +00:00
wmcoolmon c2437a1430 Fixx0red description for show-subtitle 2005-07-23 22:48:28 +00:00
Goober5000 784cbc79d5 bah - fixed subsystem comparison
--Goober5000
2005-07-23 21:47:46 +00:00
Goober5000 537258cee3 fixed ai issue where some ships would never call for rearm
--Goober5000
2005-07-23 21:06:24 +00:00
Goober5000 a429884abd fixed a rare but ugly (though amusing) bug
--Goober5000
2005-07-23 18:38:47 +00:00
wmcoolmon b657066dac Fixed bug where camera reset when rotation complete 2005-07-23 18:25:42 +00:00
Goober5000 8173d85842 remove Bobboau's extra warp thing
--Goober5000
2005-07-23 17:27:50 +00:00
Goober5000 3624587ac5 remove an extraneous extern
--Goober5000
2005-07-23 16:25:32 +00:00
Goober5000 41635d4716 fix the support ship bug; taylor should be happy now ;)
--Goober5000
2005-07-23 11:42:54 +00:00
wmcoolmon 2a304773ce Another try at fixing gun turrets sticking straight up 2005-07-23 08:17:04 +00:00
Goober5000 2a307d099a CVS header tweaks
--Goober5000
2005-07-22 10:18:41 +00:00
Goober5000 91b014d39d unhide null vector bug
--Goober5000
2005-07-22 09:59:30 +00:00
wmcoolmon d1d68c6e6e 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
2005-07-22 09:19:40 +00:00
Goober5000 81cfbff8fa fixed another bug when changing ship classes
--Goober5000
2005-07-22 04:31:12 +00:00
taylor 85b24f500f better error checking/handling for when you fire primary/beam weapons without a target selected 2005-07-22 03:54:46 +00:00
taylor 087db1ee94 fix crash on commit in the multi ship selection screen
mask_data in the UI code is always cast to ubyte so why it was a ushort type I'll never know
fix unsized text in input boxes (fixed the real problem earlier but forgot to remove this old fix)
2005-07-22 03:53:32 +00:00
taylor 294aa50367 forgot to remove PreProcDefines.h from here too 2005-07-22 03:51:13 +00:00
wmcoolmon 9a33c153dd Changed $Hull Repair Rate and $Subsystem Repair Rate to be percentages,
as well as making them accept all values between -1 and 1
2005-07-21 07:53:14 +00:00
taylor 5b9a5ae0d8 fix problem loading compressed DDS created by DX9 utils 2005-07-20 14:55:12 +00:00
taylor 75fdc06a17 move the "none.wav" init to event_music_init() so it only runs through once (fixes no mission music when modular tbls are used) 2005-07-20 02:37:32 +00:00
taylor 883e973ac2 better UV offsets when using non-standard resolutions (for text mostly), copied from D3D code 2005-07-20 02:35:51 +00:00
taylor a191cc46e0 fix resize fixes 2005-07-19 04:52:56 +00:00
taylor 5e33a5ce59 better "is_640x480" detection, 800x600 res was using GR_1024 where it should have used GR_640 2005-07-18 14:09:03 +00:00
taylor f75566d82d errant unsize was still messing up h-sliders in non-standard resolutions 2005-07-18 12:42:10 +00:00
taylor d901aa63f5 more non-standard res fixing
- I think everything should default to resize now (much easier than having to figure that crap out)
 - new mouse_get_pos_unscaled() function to return 1024x768/640x480 relative values so we don't have to do it later
 - lots of little cleanups which fix several strange offset/size problems
 - fix gr_resize/unsize_screen_pos() so that it won't wrap on int (took too long to track this down)
2005-07-18 03:45:10 +00:00
taylor 34ca40fc63 cleanup hudtargetbox rendering from that total hack job that had been done on it (fixes wireframe view as well)
more non-standard res fixing
 - I think everything should default to resize now (much easier than having to figure that crap out)
 - new mouse_get_pos_unscaled() function to return 1024x768/640x480 relative values so we don't have to do it later
 - lots of little cleanups which fix several strange offset/size problems
 - fix gr_resize/unsize_screen_pos() so that it won't wrap on int (took too long to track this down)
2005-07-18 03:44:01 +00:00
taylor b4ac372e25 PreProcDefines.h has to be removed from here as well so that "make dist" will work 2005-07-18 03:37:35 +00:00
wmcoolmon 509089ce82 Unlike my previous commit, this one does not cause a segmentation
fault. :)
2005-07-16 07:03:49 +00:00
wmcoolmon e0fd57fb36 Commented out lines 554 and 555 so the code would compile 2005-07-16 06:33:16 +00:00
Goober5000 d6a1953b9a cleanup and clarification of phreak's fix of a bug propagated by me and penguin
--Goober5000
2005-07-16 04:41:04 +00:00
wmcoolmon 61fb21b60d I can't compile the source to test this, but this should switch the
hi-res check to "2_ChoosePilot-m" rather than sparky_hi_fs2.
2005-07-15 23:19:10 +00:00
Goober5000 5467d2e8d2 fixed a typo of Kazan's dating all the way back to October 15, 2003 (!!) that
created a nasty stealth bug
--Goober5000
2005-07-15 03:48:40 +00:00
Goober5000 bca4275773 remove PreProcDefines.h from project file; tweak #define's
--Goober5000
2005-07-14 23:46:57 +00:00
mrduckman 262db9a6a1 Restored messages to on-focus channel. If it doesn't work, we'll work around with a pseudo-cmd. 2005-07-14 13:25:03 +00:00
phreak dab936a69d If the web cursor bitmap isn't found, tell the user to move the executable to the main FS2 directory. 2005-07-13 15:15:54 +00:00
Goober5000 2394e9801b remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:35:36 +00:00
Goober5000 c17c11b651 remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:26:00 +00:00
Goober5000 52f136f9ad remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:15:53 +00:00
Goober5000 12c90e780d remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 02:50:53 +00:00
Goober5000 4a6a7cf6d4 remove preprocdefines, yay!
--Goober5000
2005-07-13 02:39:17 +00:00
Goober5000 dd6ef248f7 this seems like it should be handled by the code already...
let's remove it and see what happens :p
--Goober5000
2005-07-13 02:32:22 +00:00
Goober5000 7eaf5dbbf3 removed autopilot #define
--Goober5000
2005-07-13 02:30:54 +00:00
Goober5000 be35a3fef2 move inferno vs. network check here for the time being
--Goober5000
2005-07-13 02:08:26 +00:00
Goober5000 5c6738a534 fixed a bunch of "issues" caused by me with the species stuff
--Goober5000
2005-07-13 02:01:30 +00:00
Goober5000 cbdae3caf0 rolled this back because it causes a syntax error in MSVC
--Goober5000
2005-07-13 02:00:44 +00:00
Goober5000 76d05268fd improved species support and removed need for #define
--Goober5000
2005-07-13 00:44:24 +00:00
Goober5000 41a06a3ac9 removed DECALS_ENABLED
--Goober5000
2005-07-12 22:14:40 +00:00
Goober5000 8d1b92b8dc removed NO_LINKED_PRIMARY_PENALTY as it's better suited for difficulty.tbl or something similar
--Goober5000
2005-07-12 21:58:45 +00:00
Goober5000 fa7ec18c07 fixed "warpout sequence aborted" bug
--Goober5000
2005-07-12 21:10:57 +00:00
Goober5000 4285720027 properly fixed beam_apply_whack()
--Goober5000
2005-07-12 21:01:40 +00:00
mrduckman d850ace866 Better SDL Headers checking for MacOSX 2005-07-12 18:14:53 +00:00
Goober5000 516e57041c remove all restrictions on which ship types can dock with each other
--Goober5000
2005-07-12 07:03:18 +00:00
mrduckman c6d0da47ad Fixed SDL linking for MacOSX 2005-07-11 14:26:30 +00:00
wmcoolmon b3f01c755c Bumped Fs2_open version to 3.6.7 2005-07-11 10:13:09 +00:00
wmcoolmon 5cba03f84f Bumped version for Linux makefile to 3.6.7 2005-07-11 10:12:06 +00:00
wmcoolmon 7efe0c2dde Fixed the bug where sending an ignore command to "All fighters" would
apply to all ships
2005-07-11 10:01:06 +00:00
taylor 4bc11a4191 make sure to tack on a / on the dot dir so that recursive directory making will work properly (code thought it was a file rather than a dir) 2005-07-09 04:34:43 +00:00
wmcoolmon 67ea4a92b7 Added fixes for custom gauges discussed in the recent thread 2005-07-09 03:02:07 +00:00
taylor 92b8c2d6ed various compiler warning fixes (some of these from dizzy) 2005-07-07 16:36:58 +00:00
taylor a0f767e310 make double sure that we actually need to render thruster glows instead of doing it regardless 2005-07-07 16:35:11 +00:00
taylor 1fbb41b020 add value of GL_vertex_data_in to OGL card memory usage 2005-07-07 16:33:39 +00:00
taylor 90c182d5b1 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)
2005-07-07 16:32:33 +00:00
phreak cdec876608 fixed an afterburner bug where AI ships would have infinite AB fuel if NO_NETWORK
was defined.
2005-07-05 17:04:08 +00:00
taylor 597535d8fb bah, forgot to ever check debriefings 2005-07-02 20:57:48 +00:00
taylor fbb630aa2d ton of non-standard resolution fixes 2005-07-02 19:45:02 +00:00
taylor e86d4a7c41 ton of non-standard resolution fixes
make gr_cross_fade() work properly in OGL
2005-07-02 19:40:48 +00:00
taylor e3e826e06b fix compiler warnings introduced by recent stub changes (defining an empty stub as something is wrong, it should be nothing)
assuming that GetStatus thing wasn't tested since it would never have worked
2005-07-02 19:39:23 +00:00
taylor aed9394b5c some supernova fixing 2005-07-02 19:36:04 +00:00
taylor 83145a7add compiler warning fixes 2005-07-02 19:33:18 +00:00
phreak e22f6bcba1 remove the BEAM_NO_WHACK flag in beam_apply_whack() 2005-07-01 17:19:43 +00:00
Goober5000 e2cc46933c the message queue now waits for simulated speech to finish
--Goober5000
2005-06-30 02:36:16 +00:00
Goober5000 d10ad253e6 added functions to check if speech is playing
--Goober5000
2005-06-30 02:35:17 +00:00
Goober5000 6497691a33 * NOX'd none.wav
* changed comparisons on none.wav to only look at the first four letters in case
  we don't have an extension or in case some weirdo decides to put none.ogg
* simulated speech pre-empts "beeps" in in-game messages
--Goober5000
2005-06-30 01:48:52 +00:00
Goober5000 6fbcfa7ffb tweaked the stubs and added a function
--Goober5000
2005-06-30 01:35:52 +00:00
Goober5000 7917104281 if game_busy() is in gamesnd_preload_common_sounds() then it should
also be in gamesnd_load_gameplay_sounds() I would expect
--Goober5000
2005-06-30 00:48:02 +00:00
Goober5000 928cd2870a Removed "beam no whack" as setting the beam's mass to 0 achieves the same effect.
--Goober5000
2005-06-30 00:36:10 +00:00
taylor 6d9cf5ea5c set-skybox-model only takes one argument so don't advertise more
add set-skybox-model help text for FRED2
2005-06-29 18:54:59 +00:00
taylor 47478e6fb0 should fix perpetually damaged subsystems on ships for multi clients 2005-06-29 18:54:02 +00:00
taylor 4dea0537cf FRED2 does special stuff for jumpnode handling so don't try and delete the obj ourselves when FRED is running 2005-06-29 18:53:07 +00:00
taylor e2dd70f652 extra checks to make sure we don't end up targetting a sensor-invisible ship 2005-06-29 18:52:02 +00:00
taylor e9507fb3a3 revert OGL init changes since ATI drivers suck and don't like it 2005-06-29 18:51:05 +00:00
taylor 1c8c8f0b6e little cleanup and error checking 2005-06-29 18:50:13 +00:00
taylor 7661ae057f various FS2NetD fixes:
- replace timer stuff with something that more accurately works cross-platform and without being affected by load
 - better sanity checking for the server list
 - working Linux compatibility that's not dog slow
 - when calling DataReady() make sure that the data is properly valid
 - fix messed up cvs merge cleanup from the Linux merge which did nasty things
2005-06-29 18:49:37 +00:00
taylor 13d63180c8 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)
2005-06-29 18:46:13 +00:00
taylor aa7f25fd50 we only want to have m_data_offset be 0 for oggs since the seeking callback will account for the true offset
only extern the one int we need for the -nosound speech fix rather than including the entire header
2005-06-24 19:36:49 +00:00
taylor 0e31fa4e60 compiler warning fix (dizzy) and make sure that it's safe to continue after that switch statement 2005-06-22 15:25:41 +00:00
taylor 265ddfa336 make sure that _mkdir() will return an error if the path is invalid 2005-06-22 15:18:58 +00:00
taylor b9420f5774 objnum check when targetinfo is used, fixes message brackets having random text as info 2005-06-22 15:17:53 +00:00
taylor 9bf2e719da make sure we only have one extension on mission names 2005-06-22 15:16:40 +00:00
taylor eb29c67cbd probably be a good idea to make the valid objnum check here too 2005-06-21 00:25:34 +00:00
taylor 2ef2b8a53c in the model _render functions change "light_ignore_id" to "objnum" since that's what it really is
and this makes it so much easier to realize that
properly deal with the fact that objnum can be -1 in  model_really_render()
add NULL check to neb2_get_fog_values() so that it can just send back defaults if objp is NULL
small compiler warning fix for neb code
2005-06-21 00:20:24 +00:00
taylor 051598a219 unbreak network compatibility with 3.6.5 and earlier builds
fix crashing with turret weapons
2005-06-21 00:15:06 +00:00
taylor c81198eb17 add some better error checking/handling for when GetServerList messes up 2005-06-21 00:13:47 +00:00
taylor 9b8be166a6 add virtual destructor so that GCC4 can shut up 2005-06-21 00:12:11 +00:00
phreak 83cc635e8c added cmdline.h include so the compiler would see the no sound command line option
also added CVS header information.
2005-06-20 15:54:58 +00:00
taylor 5f85d3c0b5 little cleaner ship_get_random_targetable_ship(), for Goober's sake ;) 2005-06-20 04:10:35 +00:00
taylor 383badd8a1 arch and GCC4 compatibility 2005-06-20 04:09:46 +00:00
taylor bd9e659d0f make sure to reset size to 0 on texture free 2005-06-19 09:04:40 +00:00
taylor d3d8a5f15d check_values() shouldn't be inline anymore
remove useless neb2_get_fog_intensity() call
s/alocate/allocate/g
2005-06-19 09:03:05 +00:00
taylor 2e61bf2d41 minor sanity checking for geometry_batcher
make particle batchers allocate dynamically
handle cases where a particle graphic couldn't be loaded
2005-06-19 09:00:09 +00:00
taylor 6a2fd92ec6 disable speech when -nosound is used 2005-06-19 08:56:23 +00:00
taylor c191c9d2a5 woorps! 2005-06-19 04:59:04 +00:00
taylor c4f2d6efd0 remove xmouse.cpp since it's pretty much useless 2005-06-19 02:48:14 +00:00
taylor 569163a265 never "promote" to a lower rank than current 2005-06-19 02:47:00 +00:00
taylor 8c77de35ce OGG streaming fixes to get data reading right and avoid skipping
properly handle seeking in OGG streams
compiler warning fix in OpenAL builds
2005-06-19 02:45:56 +00:00
taylor a5e533c7e3 WMC's build fix, part deux 2005-06-19 02:43:49 +00:00
taylor 4ee7dd823a jumpnodes can get deleted outside of FRED now so allow for that 2005-06-19 02:43:14 +00:00
taylor 0fba391cbb really needed to mention those two things as well given the types of changes those are 2005-06-19 02:42:21 +00:00
taylor a61100399b fix possible crash from popups, especially in multi 2005-06-19 02:38:33 +00:00
taylor fbf69f1284 model_free_all() will unload textures so don't bother doing it twice 2005-06-19 02:37:43 +00:00
taylor 260b800593 general cleanup, remove some old code
speed up gr_opengl_flip() just a tad
inverted gamma slider fix that Sticks made to D3D
possible fix for ATI green screens
move opengl_check_for_errors() out of gropentnl so we can use it everywhere
fix logged OGL info from debug builds to be a little more readable
if an extension is found but required function is not then fail
try to optimize glDrawRangeElements so we are not rendering more than the card is optimized for
some 2d matrix usage checks
2005-06-19 02:37:02 +00:00
taylor c9c52327e0 allow screenshots and backsaves in windowed mode
account for D3D_textures_in size so that it doesn't hit negative values
2005-06-19 02:31:51 +00:00
taylor 1929229e5e MIN Num_iface_sounds fix 2005-06-19 02:29:54 +00:00
taylor d12a2fb8b4 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
2005-06-19 02:28:56 +00:00
Goober5000 4f6808444d fixed a CVS log spelling error, plus fixed a tricky sexp allocation bug
--Goober5000
2005-06-16 05:17:32 +00:00
mrduckman 98d8a721a4 Added LIST command and added comment about PRIVMSG for Channels 2005-06-09 14:57:38 +00:00
wmcoolmon 1db7d30986 Hopefully this fixes something :) 2005-06-07 06:34:30 +00:00
wmcoolmon d81092d96f This may stop targeting not-targetable ships in EMP 2005-06-07 06:10:51 +00:00
taylor 685f2afa25 add wxwidgets macro so that the dev package doesn't have to be installed to compile regular builds 2005-06-04 20:03:37 +00:00
wmcoolmon 42a8430c92 I *think* this should fix bool lists 2005-06-03 22:36:57 +00:00
taylor cc24f80476 some IBX debugging info to help determine if an IBX is corrupt post-mortem 2005-06-03 18:18:02 +00:00
matt 8fdeb16f8f D3D gamma now no longer works backwards --Sticks 2005-06-03 16:42:30 +00:00
taylor 2305d2b831 the problem this tried to fix should be properly fixed now but I keep forgetting to remove this block 2005-06-03 06:51:50 +00:00
taylor c5c5382fe4 cleanup of gr_bitmap since it's the same for D3D and OGL, skip if GR_STUB though
fix resize/rendering issue when detail culling is used with optimized opengl_create_texture_sub()
2005-06-03 06:44:17 +00:00
taylor d65f5212f5 eek... fix wrong description of changes 2005-06-03 06:41:37 +00:00
taylor f46a6295f7 better audio pause/unpause support when game window loses focus or is minimized 2005-06-03 06:39:27 +00:00
wmcoolmon 6b1733aa00 Small extern fix 2005-06-03 02:28:54 +00:00
Goober5000 f62f8a9bf6 ugh... reverting taylor's change for now; I'll have to take another look at this
--Goober5000
2005-06-02 03:20:20 +00:00
wmcoolmon 2607cf6af9 Protected ships are safe from spawning weapons. :) 2005-06-02 02:41:52 +00:00
wmcoolmon e23bc76eb4 Removed OF_DESTROYED, replacing it with a deletion cache 2005-06-02 02:09:43 +00:00
wmcoolmon 5acb5295d9 Cast to quiet error 2005-06-02 01:56:32 +00:00
wmcoolmon 9af4132f51 Better missing model handling Pt. 2 2005-06-01 22:54:23 +00:00
wmcoolmon 3e47590d0c Better missing model handling 2005-06-01 22:52:56 +00:00
phreak 7e9d517e84 clarified error messages to say that the files listed on asserts/warnings/errors
are located on the computers that built the exe.
2005-06-01 15:10:26 +00:00
taylor cee7b62c98 bit of cleanup for audiostr-openal and fix a Windows-only enum error
bunch of OGG related fixes for Linux and Windows (DirectSound and OpenAL), fixes audio related TBP 3.2 crashes
gracefully handle OGG logical bitstream changes, shouldn't even load if there is more than 1
2005-06-01 09:41:14 +00:00
taylor af3587c1e8 little cleanup
optimize opengl_create_texture_sub() by not doing any extra image processing if we don't have to
  if an image is already power-of-2 or we don't need power-of-2 then avoid the extra time and memory usage
2005-06-01 09:37:44 +00:00
taylor 10955f821d make sure that newly created entries are properly initialized 2005-06-01 09:35:42 +00:00
taylor 2fa258810c newline fix 2005-06-01 09:34:59 +00:00
taylor 19982f4077 well that previous docking fix wasn't quite enough, this makes sure that code will actually get exec'd
(Goober: might want to double check that this isn't stupid, does appear abort properly though)
2005-06-01 09:34:36 +00:00
wmcoolmon b0bafe235b This should fix redmenace's Assert...I'm not sure why it hasn't been triggering every time a shield is at full strength. 2005-05-30 23:41:36 +00:00
taylor d66f548fa7 if a briefing does have any stages (no text) then don't carry over text from a previous mission
some generic cleanup to V code that isn't a real problem now but could easily have been a memleak
2005-05-30 05:33:11 +00:00
taylor 55998a0d29 make sure we don't show various offscreen indicators and info when hud-disabled-except-messages is used 2005-05-30 05:31:19 +00:00
taylor 38f432110e make sure we stop mission in the redalert case too 2005-05-30 05:30:02 +00:00
taylor e30a2338c5 as soon as the first frame gets released the rest are unreachable in the loop
this was basically became a memory leak as additional frames never got released
2005-05-30 05:29:17 +00:00
taylor 2c363f94f4 me is a moron, this broke audio streaming 2005-05-30 05:27:30 +00:00
Goober5000 e000a106e2 Taylor's the real SCP leader; I just play one on the Internet
--Goober5000
2005-05-30 04:38:33 +00:00
taylor 82104dbffc haven't got a clue what I was thinking with that crap 2005-05-28 19:44:17 +00:00
taylor 5a83abf909 debug message fixing
a little bit of code clarity
2005-05-28 19:43:28 +00:00
taylor 8df05848f4 add a NULL check to model_get() for better error detection over an outright CTD 2005-05-28 19:41:56 +00:00
taylor 478d504f09 fix ani corruption detection so that certain streaming anis don't hit it (check was wrong anyway) 2005-05-28 19:40:59 +00:00
Goober5000 3475444eee moved some prototypes that WMC put in the header file back to the implementation file
--Goober5000
2005-05-27 03:37:53 +00:00
Goober5000 7441e76428 hmm, rolled back to 2.3
--Goober5000
2005-05-27 03:36:20 +00:00
Goober5000 5188f6ca9b removed some old unnecessary prototypes WMC had added
--Goober5000
2005-05-27 02:37:29 +00:00
tbird a882dd68a1 no message 2005-05-26 20:59:59 +00:00
tbird 4c57cd3090 no message 2005-05-26 20:59:58 +00:00
tbird 340881347e Removed due to problems with getting the correct file in place 2005-05-26 20:57:33 +00:00
tbird 33f3b34333 Updated based on VC6 projects 2005-05-26 20:56:10 +00:00
taylor ca7a976823 forgot to take into account F1_0 on timer_get_fixed_seconds(), remove those stupid CRs too 2005-05-26 09:21:28 +00:00
Goober5000 146edc116c some bracket happiness, plus fixed the traning message version of the crazy semicolon bug
(thanks to taylor for fixing the regular message version)
--Goober500
2005-05-26 05:07:19 +00:00
taylor a9570a7646 the Loki extensions are Linux only so don't even bother checking under Windows, the
new spec has a cross-platform way of getting the same thing so this isn't a big deal
2005-05-26 04:32:31 +00:00
taylor 987ea35f15 don't page out textures in ship_delete() since it causes some slowdown which can make
the explosion effects skip/stutter
2005-05-26 04:30:48 +00:00
taylor 031580c7e4 those crazy semi-colons 2005-05-26 04:29:23 +00:00
taylor 58ca9a4fc7 if we switch to a pilot who has a campaign that isn't available then abort the read and
deselect all pilots, should prevent data loss or crashes due to the missing safety check
2005-05-26 04:28:45 +00:00
taylor aac663c449 timer changes to fix game_busy() on the loading screen and 100% incorrect values on some machines,
don't know if this is going to work that great but it's more like the Linux SDL code now which
  has worked for years without major problems
2005-05-26 04:27:11 +00:00
taylor 232f1a1374 make sure batch rendering of lasers happens after fog is disabled in nebula missions 2005-05-24 20:55:21 +00:00
taylor bcfc58b350 couple of extra checks to make sure that we can't enter the barracks or the techroom
if the currently selected campaign isn't available, fixes several pilot crash bugs
2005-05-24 20:54:06 +00:00
taylor b548766341 make sure that we recursively create directories for Linux/OSX
replace older recursive mkdir method in cfileextractor with new method
2005-05-24 20:52:10 +00:00
wmcoolmon a16279ca20 Commented out -fixbugs and -nocrash in preparation for 3.6.7 2005-05-24 07:05:49 +00:00
taylor 3b84c4512b extra check to make sure that RLE reading never goes over frame size in new ANI formats 2005-05-24 03:13:36 +00:00
taylor 273cc3d09b get command sanity check right, fixes lowercase on extract too 2005-05-24 03:12:27 +00:00
taylor 36005939b2 an extra bounds check in sound.cpp
fix audiostr error when filename is !NULL but 0 in len might hit on SDL debug code
2005-05-24 03:11:38 +00:00
taylor 481dcf346b 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
2005-05-23 05:58:31 +00:00
taylor 4ca07aa1b3 Jens, again:
- compiler warning fixes
 - sanity and readability fixes for bmpman
2005-05-23 05:56:26 +00:00
taylor b275424411 more from Jens...
- make sure that a frame number doesn't get carried over to non-animated weapon glows
 - move the line splitting code in missiontraining.cpp so that we don't have to worry about EOS chars
2005-05-23 05:55:13 +00:00
phreak 10ef1ffbae fix out of bounds error 2005-05-23 04:58:43 +00:00
phreak 6a52ecbe18 compile warning fixage. 2005-05-22 22:47:19 +00:00
taylor 92aaac8242 a medals crash fix that isn't influenced by the evil Java empire (Jens Granseuer) 2005-05-18 14:03:27 +00:00
taylor e1c087c41a some basic Polish language support from the icculus.org version (Janusz Dziemidowicz) 2005-05-18 14:01:31 +00:00
taylor 86e31c7703 a few help text adjustments and fix some compiler warnings 2005-05-18 01:57:54 +00:00
taylor fca8854fde Initial import of cfileextractor, still needs some work but does what it needs to 2005-05-17 21:00:57 +00:00
taylor c22f38ec7e add building for cfileextractor 2005-05-17 20:59:23 +00:00
taylor c13a57bc05 more autogen goodness from Jens
- remove old/unneeded checks (ie. we don't use libtool so don't check for it)
 - use --foreign rather than --gnu on automake so we can get rid of things like NEWS, etc.
2005-05-17 20:58:46 +00:00
taylor 85d25fef5e more missed stuff from the vm_* macro change (thanks Alpha0) 2005-05-17 20:57:05 +00:00
phreak 19370fb061 reverted a tagged only commit, it wasn't needed 2005-05-16 15:40:43 +00:00
phreak 436e9ddb86 custom loading screen fixage. 2005-05-15 21:40:31 +00:00
taylor d09574c403 don't let the ogg callbacks close the file handle on us, let us do it ourselves to keep things straight 2005-05-15 06:47:57 +00:00
phreak 93d2cfeaca another tagged only turret fix 2005-05-14 21:48:22 +00:00
phreak a44e312429 stop turrets from targeting non-bombs. also some tagged-only fixes. 2005-05-14 21:35:04 +00:00
phreak e92d2c5590 fixed an out-of-bounds array bug 2005-05-14 21:34:17 +00:00
phreak 9571e65fc6 medal_stuff needed a copy constructor and an overloaded assignment operator. 2005-05-14 16:16:48 +00:00
taylor d980676576 unbreak joining (when forming, not in-game) (Jens Granseuer) 2005-05-13 23:10:17 +00:00
taylor b4ea91d8ec Ooops! Added the wrong version of the streaming patch from Jens 2005-05-13 23:09:28 +00:00
taylor bbcf21cba7 properly support multiple versions of automake (Jens Granseuer) 2005-05-13 23:08:39 +00:00
phreak 918d3e30f5 possible fix for seeing suns through ships. shouldn't break anything. 2005-05-13 20:55:19 +00:00
taylor 3d499e190b more malloc->vm_malloc, free->vm_free, strdup->vm_strdup fixage 2005-05-13 02:56:34 +00:00
phreak 89d2954f9e fixed another minimum range bug that prevented the Colossus and the Beast from
properly engaging one another in the mission: Their Finest Hour (SM3-08)
2005-05-13 02:50:47 +00:00
taylor 9cc6998566 missed a strdup to vm_strdup conversion 2005-05-13 02:47:58 +00:00
phreak a65132eb30 forgot a vm_strdup in place of a strdup 2005-05-13 02:41:24 +00:00
taylor 3f6e13d20b 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
2005-05-12 17:49:18 +00:00
taylor 64a0cc64a9 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
fix a few streaming errors in OpenAL code (Jens Granseuer)
temporary change to help deal with missing music in OpenAL Windows builds
don't assert when si->data is NULL unless we really need to check (OpenAL only)
2005-05-12 17:47:57 +00:00
taylor d6b8f7305d 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
reallocate sp->triggers with the real vm_realloc() rather than that manual method
2005-05-12 17:45:53 +00:00
taylor 89b916d044 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
fix crash with Warning() message getting the wrong string
2005-05-12 17:44:02 +00:00
taylor f523fa55d8 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
try and keep up with how much VBO data is in memory too since that takes away from texture memory
2005-05-12 17:43:20 +00:00
taylor 1da38b972f 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
set byte_mult to 2 for TCACHE_TYPE_AABITMAP to get the memory size right for Debug builds
2005-05-12 17:42:13 +00:00
taylor 2a94ce514a 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
use correct GL VRAM texture number in OGL mode rather than the D3D number
2005-05-12 17:40:48 +00:00
taylor 2b430d943d 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
change system->decals allocation to use real vm_realloc() rather than that manual method
2005-05-12 17:39:13 +00:00
taylor ab97b115cb add an extra gr_flip() after gr_clear() to make sure the change is made active 2005-05-12 17:37:48 +00:00
taylor 7e67ebee84 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
for the game_busy() text during page in add a "BmpMan" so we know better what's going on
2005-05-12 17:36:59 +00:00
Goober5000 1dd37d804d added dialogs to the project file
--Goober5000
2005-05-12 14:02:57 +00:00
Goober5000 53ebdf2cf7 added a bunch of dialogs to wxFRED... thanks, taylor, for the GUI development :)
--Goober5000
2005-05-12 14:00:15 +00:00
Goober5000 2ef771f4da whoops
--Goober5000
2005-05-12 03:51:17 +00:00
Goober5000 603530fa0e repeating messages with variables should work properly now
--Goober5000
2005-05-12 03:50:10 +00:00
Goober5000 0185bdccd0 removed variables in messages for now
--Goober5000
2005-05-12 01:34:50 +00:00
phreak e5f9f31f5d added mission flag that will not show enemy wing names, just the ship class. 2005-05-11 22:15:49 +00:00
Goober5000 2222c6ef1d fixed a docking bug
--Goober5000
2005-05-11 11:38:03 +00:00
Goober5000 788d2df962 grr
--Goober5000
2005-05-11 09:32:03 +00:00
Goober5000 48261dc983 fixed a few of karajorma's bugs
--Goober5000
2005-05-11 09:28:32 +00:00
Goober5000 cfb28ed364 changed an Assert() to an Error()
--Goober5000
2005-05-11 09:27:35 +00:00
Goober5000 77e9e8f15e variables should now work properly in messages that are sent multiple times
--Goober5000
2005-05-11 08:10:20 +00:00
phreak 6ec85ab59c clean out some old code 2005-05-11 02:16:17 +00:00
phreak fd5eafc9a6 fix the problem where the fade in/out doesn't work if looking at a sun. 2005-05-11 02:15:07 +00:00
phreak 25ee113b2d reverted a change that WMC made. It made Goober mad and delayed the release of
3.6.6 by two months.
2005-05-11 00:25:42 +00:00
phreak e63dfcf41d fixed a minimum weapon range bug that was causing turrets to fire at ships beyond
the actual range of a weapon.
2005-05-10 15:49:04 +00:00
phreak a6ac8901e4 if you're using all_turret_weapons_have_flags() with a WIF2_** flag, use
all_turret_weapons_have_flags_wif2().

Corrected some logic that would dump a valid target for turrets if its objnum is 0, as
opposed to -1.
2005-05-10 02:44:40 +00:00
phreak dfe453a4f7 when finding valid weapons, set i to MAX_SHIP_PRIMARY_BANKS - 1 since i
is incremented at the top of the loop.  otherwise, we would pass over the first secondary
weapon in the bank.
2005-05-10 01:47:34 +00:00
wmcoolmon 7d687d2840 Code betterness 2005-05-08 20:39:10 +00:00
wmcoolmon 75a677d43c Dynamically allocated medals 2005-05-08 20:38:32 +00:00
wmcoolmon fe32a70746 Various turret code changes in a vain attempt to make things more readable/work properly 2005-05-08 20:35:26 +00:00
wmcoolmon 0e21d7a7ed Turret debugging code; Medals stuff; GUI_system change 2005-05-08 20:33:42 +00:00
wmcoolmon 4e9bf0998a Dynamically allocated medals 2005-05-08 20:28:57 +00:00
wmcoolmon 4665eaa40a Change to GUI_system; this will probably break the lab, but is necessary for things to compile properly. 2005-05-08 20:27:51 +00:00
wmcoolmon 5385beb40c Change to GUI_system (to prevent memory leaks and allow for auto-deconstruction) 2005-05-08 20:26:46 +00:00
wmcoolmon 3bb486e17e "backspace" function 2005-05-08 20:23:28 +00:00
wmcoolmon b39cdf84a0 armor.tbl revamp 2005-05-08 20:21:48 +00:00
tbird 6ebd21d573 Added project files for VC.NET 7.0 (the 2005 project files do not work in 7.0) 2005-05-04 00:30:56 +00:00
wmcoolmon a5986495d0 Added variables to permanent location 2005-05-03 07:55:44 +00:00
wmcoolmon 0e624d5596 Removed variables files 2005-05-03 07:54:49 +00:00
wmcoolmon 1b0f1be626 Added Bobb's variable system (with some minor compiler-warning fixes) 2005-05-03 06:33:07 +00:00
wmcoolmon d7e8d415fd Bah, stupid externs. :P 2005-05-02 22:36:54 +00:00
mrduckman abde894aa7 Added /NAMES command (Very needed to know who's in a channel :P) 2005-05-02 15:33:17 +00:00
phreak 3440b0b1c5 bumped MAX_SPAWN_WEAPONS to 30 for inferno builds 2005-05-01 23:40:44 +00:00
phreak 2095b4f8e4 added CVS info to top of file. 2005-05-01 23:23:18 +00:00
phreak cfe5ac5854 when creating the window take into account the top border 2005-05-01 23:17:46 +00:00
phreak d49301b846 fix the window from shrinking if a cutscene is played in windowed mode 2005-05-01 23:16:12 +00:00
phreak c9404c6231 don't confine the cursor in d3d 2005-05-01 23:13:19 +00:00
wmcoolmon c4a0fced8d -output_sexps command line 2005-05-01 07:13:59 +00:00
wmcoolmon be06a65c32 Added (up-to-date) SEXP description info. 2005-05-01 06:18:58 +00:00
phreak 37b6872b9c buckets in sort_weapons_by_type() allocated on the heap instead of the stack. 2005-04-30 18:20:57 +00:00
phreak 4bb01fe267 ABbitmap should default to -1 2005-04-30 18:18:46 +00:00
phreak 837d80e6fb bm_page_in_textures() should return if bitmap_num is any negative value, instead of just -1 2005-04-30 18:17:17 +00:00
wmcoolmon a0a5b6261a Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse 2005-04-28 05:29:30 +00:00
wmcoolmon 611f4cb1e8 Cleared up some ambiguity that made MSVC 2003 go on strike 2005-04-28 05:12:26 +00:00
wmcoolmon d9909754b9 stuff_byte to stuff_ubyte 2005-04-28 01:39:14 +00:00
wmcoolmon d0198a41e7 parse_ship uses stuff_bool_list; stuff_byte to stuff_ubyte 2005-04-28 01:38:32 +00:00
wmcoolmon 3030913492 More parsing flexibility 2005-04-28 01:36:46 +00:00
wmcoolmon f46f237468 stuff_byte to stuff_ubyte; does the same thing, but with a better name. 2005-04-28 01:36:09 +00:00
wmcoolmon b6a31c28a2 Switch stuff_string_white to stuff_string (I don't see why _white was used in the first place) 2005-04-28 01:32:57 +00:00
wmcoolmon da20f4ede2 Added stuff_bool_list; Internationalized stuff_boolean. 2005-04-28 01:12:19 +00:00
Goober5000 2f07f21d1e -made the XRC file parsed on load instead of embedded
-migrated wxFRED to wxWidgets 2.6.0
--Goober5000
2005-04-25 12:14:21 +00:00
taylor 43675291f4 newline fix 2005-04-25 06:36:25 +00:00
taylor b44135a195 use full size of Campaign_missions[] for simroom filtering, fixes the problem of campaign
missions still showing up in the single list even after filtering
2005-04-25 06:36:01 +00:00
taylor 1df8270c1e little cleanup so that debug and release build files don't have to be listed twice
add newer wxFRED2 files
2005-04-25 06:33:56 +00:00
wmcoolmon cb91362461 Use parse_sound instead of code chunks 2005-04-25 00:34:00 +00:00
wmcoolmon 6acab304f9 Dynamically allocated engine washes; subsystem sounds; armor fixes. Line 4268 of ship.cpp, apparently, works properly; bears further looking into. 2005-04-25 00:31:14 +00:00
wmcoolmon c73e870650 subsystem sounds 2005-04-25 00:28:58 +00:00
wmcoolmon 31296826e1 MAX_SHIP_TYPES > Num_ship_types 2005-04-25 00:28:17 +00:00
wmcoolmon 865808e34e Commented out unneeded array (Glide) 2005-04-25 00:27:32 +00:00
wmcoolmon 36c25e7479 Dynamically allocated engine washes; subsystem sounds 2005-04-25 00:26:53 +00:00
wmcoolmon fe177851c7 Windows have minimum size according to caption; made lab use another tree level so all ships can be seen 2005-04-25 00:24:34 +00:00
wmcoolmon e70db11b41 Added parse_sound; replaced Assert() with an if() (The latter may not be a good idea, but it keeps missions from being un-debuggable) 2005-04-25 00:22:34 +00:00
wmcoolmon 07ea9a87bc Center title screen, removal of unnecessary #ifdefs 2005-04-25 00:21:30 +00:00
wmcoolmon 1aa4a3bf17 Bumped console printing buffer size so people can play with the neb2 command 2005-04-25 00:07:22 +00:00
wmcoolmon 05b9e92455 MAX_SHIP_TYPES -> Num_ship_types 2005-04-25 00:04:30 +00:00
Goober5000 d90c11f8d9 updated the project file
--Goober5000
2005-04-24 14:45:17 +00:00
Goober5000 d680f65288 wxFRED now uses XRC-based resources
--Goober5000
2005-04-24 14:42:27 +00:00
taylor a11e6910ae 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
2005-04-24 12:56:43 +00:00
taylor 2bbef05162 little cleanup of laser rendering
- fix animated glows
 - proper alpha modification (still messed up somewhere though, shows in neb missions)
 - remove excess batch_render()
2005-04-24 12:47:36 +00:00
taylor d3f18e16a1 possible dev/0 bug fix (Jens Granseuer) 2005-04-24 12:45:14 +00:00
taylor bd28b49b7d make sure we don't build with speech support under Linux unless we specify it as a configure option 2005-04-24 12:44:25 +00:00
Goober5000 35a3b03a2e fix0red the CVS log
--Goober5000
2005-04-24 08:27:17 +00:00
Goober5000 c2c5b253a5 made swarm/corkscrew/flak conflict more friendly
--Goober5000
2005-04-24 07:31:34 +00:00
wmcoolmon fdb42c3908 Enabled movies in windowed mode; if this causes problems for people, they can always use -dnoshowvid 2005-04-24 06:52:23 +00:00
Goober5000 b66d2a3774 eh, stupid quotes
--Goober5000
2005-04-24 05:53:15 +00:00
Goober5000 e60ec606da actually, I think this way works better
--Goober5000
2005-04-24 05:15:24 +00:00
Goober5000 cdfe57c517 added FS2PATH environment variable and removed custom build stuff
--Goober5000
2005-04-24 04:47:58 +00:00
phreak c8c5350859 centered the window on the desktop if the -window command line is used. 2005-04-24 03:06:29 +00:00
wmcoolmon 5bf6f6939d Added resizing option to gr_shade. We can probably merge gr_shade and gr_rect; they do the same thing. 2005-04-24 03:02:43 +00:00
wmcoolmon ec387144ef Might as well fix trainer messages too. 2005-04-24 03:01:56 +00:00
wmcoolmon 4e94f188c5 Lowlevel (ie vertex buffer-mapping) functions for _rect and _shade 2005-04-24 02:40:40 +00:00
wmcoolmon 04b48dd106 Context help fixing goodness 2005-04-24 02:39:36 +00:00
wmcoolmon 34953040c8 Moved gr_rect and gr_shade to be API-nonspecific as the OGL/D3D functions were virtually identical 2005-04-24 02:38:31 +00:00
Goober5000 3b05999da8 subsystem fix
--Goober5000
2005-04-24 02:10:53 +00:00
wmcoolmon 0acb0166a7 Removed GL_SECTIONS 2005-04-23 01:17:09 +00:00
taylor c9560f59e2 wurrps 2005-04-22 02:32:18 +00:00
wmcoolmon 7cc8715ca9 Minor updates to the GUI, and added some code that will (hopefully) resize HUD images in nonstandard resolutions. I couldn't test it; got an out of memory error. 2005-04-22 00:34:55 +00:00
taylor 5e0ebf79c8 sexp to swap the skybox in mission, not tested in FRED, hopefully I didn't mess this up too much 2005-04-21 15:59:42 +00:00
taylor 043758c633 initial changes to mission loading and status in debug builds
- move bmpman page in init to an earlier stage to avoid unloading sexp loaded images
 - small changes to progress reports in debug builds so that it's easier to tell what's slow
 - initialize the loading screen before mission_parse() so that we'll be about to get a more accurate load time
fix memory leak in gamesnd (yes, I made a mistake ;))
make sure we unload models on game shutdown too
2005-04-21 15:58:08 +00:00
taylor 17002e83ab make sure we don't try to process chatbox_close() more than once 2005-04-21 15:53:24 +00:00
taylor 5eaf2f3534 stupid little comment fix, no big deal 2005-04-21 15:52:24 +00:00
taylor 2be5cedfa2 fix source/dest memory overwrite that Valgrind was complaining about 2005-04-21 15:51:40 +00:00
taylor 7b997f9aba we can't resize compressed textures so... don't, fixes rendering problems when not at max texture detail 2005-04-21 15:50:47 +00:00
taylor 75332108e5 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
2005-04-21 15:49:21 +00:00
wmcoolmon 48a10eabcb Nonstandard res fix. 2005-04-20 08:32:01 +00:00
wmcoolmon f5be4600d7 Fix silly armor.tbl parse error. 2005-04-20 08:26:49 +00:00
phreak 83e4d6bde3 NMONO should not interfere with the debug window 2005-04-20 04:34:42 +00:00
phreak 735b2828c2 get the cheat keys for "force weapon" working again 2005-04-20 04:34:01 +00:00
phreak b1726ccbdb CVS file header. take 1 2005-04-20 04:29:50 +00:00
phreak c91e5a8bd6 fix for the slow firing turret problem 2005-04-20 04:27:56 +00:00
wmcoolmon b3f700a4c3 Lock time compression when autopilot is engaged 2005-04-19 23:03:42 +00:00
taylor a94100bf4c try not to buffer output to the speech dev so that the text doesn't just show up some time in the future 2005-04-19 06:29:28 +00:00
taylor 374f6168ad we might actually be needing to load a model here ;) 2005-04-19 06:27:54 +00:00
taylor 371ff6cb0d small compiler warning fixes, more 'always true' stuff 2005-04-19 06:26:56 +00:00
taylor 7736d8fc63 don't try to allocate 0 bytes of memory when there are no shield tris, weird memory stuff frightens me 2005-04-19 06:25:23 +00:00
taylor 03bdf5e87f 8 months I've been meaning to put this in the Linux tree, me == moron 2005-04-19 06:22:20 +00:00
Goober5000 03548e8c38 model and class changes should be all set now
--Goober5000
2005-04-18 08:35:28 +00:00
Goober5000 57c2060758 better subsystem comparison
--Goober5000
2005-04-18 06:59:16 +00:00
Goober5000 693577c8e2 removed ship->alt_modelnum as it was essentially duplicates of ship->modelnum; changed the alt modelnum stuff accordingly
fixes for ship_model_change and change_ship_type
--Goober5000
2005-04-18 05:27:26 +00:00
taylor ccbda0a839 some extra checks to make sure we don't act on invalid gamesnds (fix for WCS) 2005-04-18 03:31:27 +00:00
taylor f08b263d74 more accurate play position for OpenAL when AL_BYTE_LOKI is used (Jens Granseuer) 2005-04-18 03:30:05 +00:00
Goober5000 fae5b4ef0f more sexp goodness
--Goober5000
2005-04-18 03:16:57 +00:00
taylor 14e7f76c3a updated Linux joystick code that's a bit less insane speed wise
remove ability to build without joystick support, no reason to keep it around
fix unusable warning flag with libjpeg building
2005-04-17 05:38:29 +00:00
phreak 9e41484c57 fixed lasers drawing backwards 2005-04-16 18:43:17 +00:00
wmcoolmon febb7b2386 Fixed the lab; Made the storybook look less grotesque without skins. 2005-04-16 08:13:34 +00:00
wmcoolmon 50109e9298 Eh, what the hey. Maybe I should've taken the breathalyzer test. :) 2005-04-16 04:19:21 +00:00
wmcoolmon 9de0e8b059 More optional tag-making for ships.tbl 2005-04-16 04:16:57 +00:00
wmcoolmon cc2dcbb434 Minor changes; made even more fields in ships.tbl optional. 2005-04-16 03:36:13 +00:00
wmcoolmon f281c0a7d3 Removed an unneeded semicolon 2005-04-16 03:05:05 +00:00
wmcoolmon 0e079e49fa Added type "exponential base"; equation is 'final_damage = (x^damage)' 2005-04-15 23:19:13 +00:00
taylor e610e9d5af fix ambient light 2005-04-15 11:42:27 +00:00
taylor 96b16c4896 stupid <expletive-delete> terminal, I <expletive-deleted> <expletive-deleted>!!! 2005-04-15 11:41:28 +00:00
taylor 4465f5ee65 new GCC = new warning messages, yippeeeecvs commit code/parse/encrypt.h code/parse/encrypt.cpp code/scramble/scramble.cpp 2005-04-15 11:36:55 +00:00
taylor dfc610f205 add scramble port
support both FS1 (8bit and 7bit) and FS2 style encryption
2005-04-15 11:35:18 +00:00
taylor 8f791fc83b proposes that WMC be subject to a breathalyzer test before commit ;) 2005-04-15 11:32:26 +00:00
taylor 5288098d1c div-by-zero fix for snd_time_remaining() 2005-04-15 11:28:41 +00:00
taylor a3e26f74fb some cleanup to prevent utilities linking all game libs 2005-04-15 11:27:53 +00:00
wmcoolmon a3e406d67b It's amazing how many possible bugs you can catch simply by doing something completely different than coding 2005-04-15 07:19:29 +00:00
wmcoolmon 8bd110479a One final oops (hopefully). 2005-04-15 06:59:05 +00:00
wmcoolmon 6c864e263b Another oops. 2005-04-15 06:56:02 +00:00
wmcoolmon caaef0253c Er, oops 2005-04-15 06:40:54 +00:00
wmcoolmon ed1ea9d172 Local codebase commit; adds armor system. 2005-04-15 06:23:18 +00:00
Goober5000 692941878b bumped sexp limit
--Goober5000
2005-04-14 20:03:16 +00:00
phreak 0f6f2a97cc Updated the message of a required extension that hasn't been found.
It was referencing the old Glide engine.
2005-04-13 23:24:21 +00:00
Goober5000 0203839ba2 fixed the compile errors (thanks Phreak)
--Goober5000
2005-04-13 22:31:53 +00:00
Goober5000 a9d4b61247 removed spurious folder
--Goober5000
2005-04-13 22:17:27 +00:00
taylor 45d5fb1add I totally blame that on the keyboard 2005-04-12 19:53:44 +00:00
taylor 57473d6996 more demo support (Jens Granseuer) 2005-04-12 19:22:48 +00:00
taylor 4797c07806 not sure what that file was doing there... 2005-04-12 19:22:00 +00:00
taylor 7e3b7769c6 many, many compiler warning and header fixes (Jens Granseuer)
fix free on possible NULL in modelinterp.cpp (Jens Granseuer)
2005-04-12 05:26:38 +00:00
taylor 610e713dd5 more support for 'make dist' (Jens Granseuer) 2005-04-12 05:24:48 +00:00
phreak b538d60aa1 ambient light is set in mission 2005-04-12 02:10:09 +00:00
phreak be01f73830 ambient_light_level added to the mission structure 2005-04-12 02:07:00 +00:00
phreak e70fc5a854 gr_set_ambient_light() function for the ambient light sliders in FRED 2005-04-12 02:04:56 +00:00
taylor d29123c582 changes to facilitate 'make dist' 2005-04-11 10:16:26 +00:00
taylor f7fce69d44 un-revert previous revert since it does apparently affect MinGW (Alpha0) 2005-04-11 10:15:11 +00:00
taylor 8a05cd48e7 some limits.h fixes to make GCC happier
revert timer asm change since it doesn't even get used with Linux and couldn't have been the slowdown problem
2005-04-11 05:50:36 +00:00
taylor 382479b954 make sure use an insensitive case check for Messages[] names (Jens Granseuer)
little clarification of if-else block in message_training_que()
2005-04-11 05:48:34 +00:00
taylor 41b48ea3eb _endthread() doesn't take an argument so do support one (Jens Granseuer)
debug variable fixes in freespace.cpp (Jens Granseuer)
as a safety catch we should Assert() on future usage of things we don't yet support in *nix _splitpath()
2005-04-11 05:45:38 +00:00
taylor 2e4946e744 some demo related fixes (Jens Granseuer) 2005-04-11 05:42:02 +00:00
taylor 98b8273d35 add version checks for autoconf and automake
fix wacky wxFRED2 check (Jens Granseuer)
2005-04-11 05:40:21 +00:00
wmcoolmon d8eace7e79 Fixed some paths stuff. 2005-04-09 07:50:41 +00:00
wmcoolmon d1bc3701d2 *crosses fingers* 2005-04-08 20:03:59 +00:00
wmcoolmon d8426202fd Did things in a somewhat less hackish manner; note that 'Update project' will only update the anjuta directory; you will have to update file, and then manually select the fs2_open/ directory to update *everything* 2005-04-06 18:47:02 +00:00
wmcoolmon 103bfe946e Presumeably, I fixed building in anjuta for anyone who can run
autogen.sh
2005-04-06 18:22:49 +00:00
wmcoolmon 399d745d4a Fixed anjuta project file so it would run from projects subdirectory. 2005-04-06 18:12:17 +00:00
wmcoolmon b2021a1e8c Added some comments to the new turret helper functions. 2005-04-06 18:10:40 +00:00
taylor e1ffad5c85 add audio files for OpenAL, build with USE_OPENAL define to use OpenAL 2005-04-05 12:03:03 +00:00
taylor be88cf017e fix memory error from GL extension list that occurs in certain circumstances 2005-04-05 11:50:57 +00:00
taylor db17bbc63d update what sound files get used 2005-04-05 11:49:37 +00:00
taylor 31d59d3c11 remove acm-unix.cpp, replaced by acm-openal.cpp since it's properly cross-platform now
better error handling for OpenAL functions
Windows can now build properly with OpenAL
extra check to make sure we don't try and use too many hardware bases sources
fix memory error from OpenAL extension list in certain instances
2005-04-05 11:48:23 +00:00
taylor 06c7cc132e handle iostream problems on GCC pre-3.x
fix spacing on wxFRED stuff (yes, I'm that anal)
2005-04-05 11:41:33 +00:00
taylor 7f786136a6 s/vector/vec3d/g, better support for different compilers (Jens Granseuer) 2005-04-05 05:53:25 +00:00
Goober5000 326ffbf902 tweaks
--Goober5000
2005-04-03 11:47:01 +00:00
Goober5000 eac7c7ff45 brought weapon loadout banks into agreement with ship info banks
improved error reporting on apply-to-all
--Goober5000
2005-04-03 08:48:31 +00:00
phreak 9f5f6692d9 put First_secondary_index back in so FRED can compile.
The weapons list is also sorted whenever all loading is done so lasers and beams always
come before missiles.  FRED's loadout code needs this behavior to stick.
2005-04-02 21:34:08 +00:00
Goober5000 d685b6a98c fixed a few errors in apply-to-all
--Goober5000
2005-04-01 08:50:25 +00:00
taylor ba3b396747 fix hanging on exit with OpenAL
some better error handling on OpenAL init and make it more Windows friendly too
basic 3d sound stuff for OpenAL, not working right yet
2005-04-01 07:33:08 +00:00
taylor 068705d442 *that blasted Enter key*, just fixing the log... nothing to see here... 2005-04-01 07:31:10 +00:00
taylor a4c27f3df7 some minor Linux fixage 2005-04-01 07:29:40 +00:00
taylor e64cd14892 code/ship 2005-04-01 07:27:32 +00:00
taylor 4b8a521200 go back to 24-bit depth, 32 didn't help any with ATI bugs 2005-04-01 07:25:54 +00:00
mrduckman 6478d14288 Made a change for wxWidget checks, checking for 2.4.2 version. 2005-03-31 21:12:23 +00:00
Goober5000 f7d48064c5 whoops
--Goober5000
2005-03-31 12:45:22 +00:00
Goober5000 780df94b55 implemented the apply-to-all wing loadout button
--Goober5000
2005-03-31 12:43:51 +00:00
Goober5000 8e29897d7a fix type mismatch
--Goober5000
2005-03-31 12:38:24 +00:00
Goober5000 ea51e277a0 changed a bunch of literal constants to their #define'd keywords
--Goober5000
2005-03-31 11:11:56 +00:00
taylor 0ef264e140 forget the swaps for OSX 2005-03-30 16:06:52 +00:00
taylor 934586df2d a little Linux happiness 2005-03-30 16:06:26 +00:00
taylor 97294532ae basic wxFRED2 building, only works on Linux for now 2005-03-30 16:05:42 +00:00
wmcoolmon a78fc4151d Whoops. 2005-03-30 05:37:22 +00:00
wmcoolmon e7f1c3e1fa Made it so *Snd fields in ships.tbl and weapons.tbl take the sound name
as well as its index (ie "L_sidearm.wav" instead of "76")
2005-03-30 02:32:41 +00:00
Goober5000 d574d77f53 fixed version log
--Goober5000
2005-03-30 01:27:49 +00:00
Goober5000 85e2f9b2a9 added header back in, with a small tweak for the .cpp
--Goober5000
2005-03-30 01:23:32 +00:00
Goober5000 217f4e12dc removed mixed-case header file
--Goober5000
2005-03-30 01:20:05 +00:00
Goober5000 7218898e2e set up the main menu options
--Goober5000
2005-03-29 13:35:53 +00:00
Goober5000 c997ccd546 fixed browse info error
--Goober5000
2005-03-29 09:57:02 +00:00
Goober5000 992e4c6932 wxFRED is now dependent on code.lib
--Goober5000
2005-03-29 08:15:44 +00:00
Goober5000 9cf51c7604 whew... bare-bones "hello world" wxFRED base finally implemented!
--Goober5000
2005-03-29 07:55:19 +00:00
wmcoolmon b911af11ea Removed some warnings under Linux/GCC 2005-03-29 07:03:16 +00:00
wmcoolmon ba6da40a84 Added some comments to #defines to make reading easier 2005-03-29 06:36:37 +00:00
wmcoolmon 38c004708f Fixed extern to compile under Linux 2005-03-29 06:28:52 +00:00
phreak e5ccec4457 global variable "Jump_nodes" needs external linkage for FRED 2005-03-29 03:42:07 +00:00
phreak eeef0b3113 get_num_elements() method, probably coded incorrectly, but its needed for FRED 2005-03-29 03:40:15 +00:00
Goober5000 18b17df6a9 added storybook to the MSVC6 project
--Goober5000
2005-03-29 02:50:48 +00:00
mrduckman be3ecf6509 Added OpenGL include dir parameters 2005-03-28 13:25:18 +00:00
taylor 29c36b04e9 fix to snd_time_remaining() to make sure we are getting the correct index into Sounds[] 2005-03-28 00:40:09 +00:00
mrduckman 164d55f828 Syntax correction 2005-03-27 21:13:05 +00:00
mrduckman 9a2904e793 Added /kill IRC Command 2005-03-27 21:06:31 +00:00
wmcoolmon 01136a497d Forgot to replace 'ship' with 'ai' after copy-paste 2005-03-27 17:33:51 +00:00
Goober5000 762662f5b2 bah 2005-03-27 13:37:15 +00:00
Goober5000 3583fe07e6 rewrote the weapon cheat cycle functions to avoid recursion
--Goober5000
2005-03-27 13:23:05 +00:00
Goober5000 aadcac2a5c two new sexps
--Goober5000
2005-03-27 13:00:40 +00:00
Goober5000 6c17ef09ab clarified max hull/shield strength names and added ship guardian thresholds
--Goober5000
2005-03-27 12:28:35 +00:00
taylor 2efe41b7c2 will hopefully fix the slowdown from mission to mission (thanks Alpha0) 2005-03-27 08:57:52 +00:00
taylor faae782fa9 this is what coding on an empty stomach will get you 2005-03-27 08:51:25 +00:00
wmcoolmon 6a9994683d Bizarre combo of fopen() and close() 2005-03-27 08:12:53 +00:00
taylor 31c8326c4c fill in some stuff for timer and mmio calls, not 100% but it works ok 2005-03-27 06:17:54 +00:00
taylor 7f9ddca157 don't use a platform specific ifdef since the OpenAL code may work under Windows now too 2005-03-27 06:16:46 +00:00
taylor afa0f424bf mmio callbacks work on Linux now and fix problem where system ogg.h would get used rather than the local one 2005-03-27 06:15:31 +00:00
taylor e5ab8a5960 update for streaming support and platform independance 2005-03-27 06:14:30 +00:00
taylor 86011a21cb some pilot file fixing when going between multi and single (partial fix) 2005-03-27 06:12:38 +00:00
taylor 825e6014fb make use of new OpenAL define since it's not platform specific anymore 2005-03-27 06:08:42 +00:00
taylor 7fdd13a785 weapon_num can be 0 so let that through 2005-03-27 06:07:54 +00:00
taylor 601a9cb5ee update with current files 2005-03-27 06:07:00 +00:00
taylor e9c0db567e initial import of OpenAL streaming (many thanks to Pierre Willenbrock for the missing parts) 2005-03-27 05:48:58 +00:00
taylor c05391aa4c unix specific version is obsolete 2005-03-27 05:47:31 +00:00
wmcoolmon c6c0e1f3db Fixed possible infinite loop problem
----------------------------------------------------------------------
2005-03-27 04:16:19 +00:00
wmcoolmon 35afc76d9e Fixed missing/invalid variables 2005-03-27 03:04:09 +00:00
wmcoolmon dd52e2548b Forgot to define 'i' outside of for scope...ironically, in the OGL code. 2005-03-27 02:59:27 +00:00
wmcoolmon 2dce5984c9 Some fixes 2005-03-26 07:53:32 +00:00
wmcoolmon 07669c6a51 Cleaned out old code + fixed min problem 2005-03-26 01:49:46 +00:00
wmcoolmon a6c4f1b322 Added the storybook 2005-03-26 00:26:06 +00:00
Goober5000 c406cbb0dd removed unreferenced variable
--Goober5000
2005-03-25 22:36:01 +00:00
wmcoolmon 0b87ed089e Small change now that the storybook is in CVS 2005-03-25 07:35:22 +00:00
wmcoolmon 714120ab6f Updated MSVC6 project file for AI move 2005-03-25 07:12:05 +00:00
wmcoolmon bf2f2aaade Removed old AI files from CVS 2005-03-25 07:03:12 +00:00
wmcoolmon 6c7273c4ef Added taylor's old-weapon code fix 2005-03-25 07:01:53 +00:00
wmcoolmon 2c2a6334db 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) 2005-03-25 06:57:38 +00:00
wmcoolmon 36db6a4931 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. 2005-03-25 06:45:13 +00:00
taylor fc56aaebff I think I deserve a medal or something for that one :) 2005-03-25 01:10:51 +00:00
taylor 95719b2742 s/gr_ogl_/gr_opengl_/g
add empty gr_opengl_draw_line_list() so that it's not a NULL pointer
make gr_opengl_draw_htl_sphere() just use GLU so we don't need yet another friggin API
2005-03-24 23:42:21 +00:00
taylor ba1527d474 make sure we don't go one over the number of message avis 2005-03-24 23:38:49 +00:00
taylor c45c29ea5b fix GCC building 2005-03-24 23:37:25 +00:00
taylor b399461826 fix compiler warnings with mismatched types and unused variables
cleanup some debug messages so they can be turned off if needed
get rid of extra strstr() check for thrusters since it should never get that far anyway
page_in/page_out of model glows should be better now
removed a bunch of unneeded casts and get type specific math functions right
2005-03-24 23:36:14 +00:00
taylor c0ca55e591 make sounds.tbl dynamic
"filename" will never be larger than 33 chars so having it 260 is a waste (freespace.cpp)
2005-03-24 23:31:46 +00:00
taylor 476a96e47e (re)move some uneeded variables to fix compiler warnings 2005-03-24 23:29:33 +00:00
taylor c253042a4a make sounds.tbl dynamic
have snd_time_remaining() be less stupid
some OpenAL error fixerage
be able to turn off some typically useless debug messages
2005-03-24 23:27:26 +00:00
taylor 58741be76d use SWARM_MISSILE_DELAY again so that it's easier to keep up with
fix compiler warnings
2005-03-24 23:24:01 +00:00
taylor 0e018dc3a2 make sure we will get the right error message 2005-03-24 23:22:59 +00:00
wmcoolmon 5419b484f6 no more MSVC compiler warning 2005-03-24 05:50:07 +00:00
phreak 638894b53a Starfield bitmaps should now draw in non-htl mode 2005-03-23 20:09:23 +00:00
phreak b25d1ebed9 Some specular values in g3_draw_perspective_bitmap() were being incorrectly set. fixed that 2005-03-23 20:08:33 +00:00
taylor eb653d20d5 fix version check for drivers that support OpenGL 2.0+ 2005-03-22 00:36:48 +00:00
phreak ad698f1810 Orb correctly displays in 640x480 2005-03-21 23:19:55 +00:00
phreak 819bacd7e2 Add a function to check whether any duplicate jumpnode names exist 2005-03-20 21:07:10 +00:00
phreak e14f198169 export the functions that deal with the creation and destruction of the starfield buffer.
FRED needs them
2005-03-20 20:02:29 +00:00
phreak ba4b720a99 draw paths and docking points using HTL 2005-03-20 20:01:15 +00:00
phreak 99ac5020d2 lol forgot to commit the function pointer stuff 2005-03-20 18:05:04 +00:00
phreak a5388d9a88 high-level implementation for gr_draw_htl_line and gr_draw_htl_sphere 2005-03-20 00:11:27 +00:00
phreak 76abb99cb8 Added gr_draw_htl_line and gr_draw_htl sphere
There still needs to be D3D versions implemented, but OGL is done.
Follow that or ask phreak about how its implemented/
2005-03-20 00:09:07 +00:00
wmcoolmon 00528726ee OpenGL display lists 2005-03-19 21:03:54 +00:00
Goober5000 b7fa7d42cb corrected misinformation in comment about surface shields (implicit surface
shields were removed for meshed ships)
--Goober5000
2005-03-19 20:45:23 +00:00
wmcoolmon 2a73780770 small bool fix 2005-03-19 20:35:45 +00:00
bobboau 0064937b9b adding d3d state block files 2005-03-19 18:18:04 +00:00
bobboau b46d8e28c7 added new graphic functions for state blocks
also added a class formanageing a new effect
2005-03-19 18:02:35 +00:00
bobboau e0907340c1 added a geometry batcher and implemented it in sevral places
namely: lasers, thrusters, and particles,
these have been the primary botle necks for some time,
and this seems to have smoothed them out quite a bit.
2005-03-16 01:35:59 +00:00
phreak 1548988f5e properly handle using the old method of selecting primary weapons.
i forgot a return statement so the new method was used instead
2005-03-16 00:37:42 +00:00
wmcoolmon 3c1fc73f57 Commited placeholder turret funcs. 2005-03-16 00:18:31 +00:00
taylor fcc1669388 make sure w,h,bpp are useable before trying to assign values to them 2005-03-15 17:10:58 +00:00
Goober5000 e9a07354b6 *fixed some sexp declaration formatting
*implemented string comparison sexps
*simplified numeric comparison sexps
*fixed numeric comparison (especially equals) sexps to actually work on all their arguments like they were designed to
--Goober5000
2005-03-15 07:26:52 +00:00
phreak fe6f36720a Awesome 2-for-1 deal!!!
Firstly, the Colossus should now warp out correctly.  No more warphole forming inside of it
Secondly, muzzleflashes now are generated at the gunmounts of the firing ship.
2005-03-15 01:40:07 +00:00
Goober5000 28e6ae723e properly fixed the out-of-bounds error, as well as a few other errors of the same kind
--Goober5000
2005-03-14 23:34:59 +00:00
Goober5000 cf34ddd94d rolled back Phreak's commit
--Goober5000
2005-03-14 23:33:22 +00:00
wmcoolmon 13772825dc Hopefully this will fixx0r Num_sounds 2005-03-14 23:31:54 +00:00
wmcoolmon 4840896a10 Whoops, this isn't needed. 2005-03-14 06:38:31 +00:00
wmcoolmon fde469cba1 Commented out now-unneccessary Int3() 2005-03-14 06:38:06 +00:00
wmcoolmon c177d1389c Added memory display thingy to loading screen, if command line is specified and build is a debug build. Also made screenshots go up to 9999 2005-03-14 06:36:30 +00:00
wmcoolmon eaa70ac0b1 Made sounds dynamically allocated 2005-03-14 06:33:38 +00:00
taylor 0033bdc59b fix for mouse cursor problem when running in a window 2005-03-14 03:38:54 +00:00
taylor b7338aa82e speedup grow/shrink time for the warp to avoid the big size skips 2005-03-14 03:24:25 +00:00
phreak 42f0d01eb0 Got rid of the stealth check that only applied to cloaked ships. This should
fix some errorneous behavior that caused the ai to target the player
2005-03-14 02:52:58 +00:00
taylor 350aba83ad enable 32-bit to 16-bit TGA conversion with -tga16 cmdline option (experimental)
fix crash when upgrading from original campaign stats file to current
2005-03-13 23:07:36 +00:00
wmcoolmon a11ba63e5d Squashed compiler warnings 2005-03-13 08:44:10 +00:00
wmcoolmon e0311d0993 Commented out unneeded variables 2005-03-13 08:38:05 +00:00
wmcoolmon 362a30ece3 Might as well sync this 2005-03-13 08:37:01 +00:00
taylor 666cd6349b gotta use MIN/MAX and not min/max now 2005-03-13 08:33:55 +00:00
wmcoolmon 2775baaed0 Hud fixing goodness. I also removed some obsolete code for displaying HUD weapons. 2005-03-13 08:32:28 +00:00
taylor dff6838110 fix various compiler warning messages
make sure screenshot count doesn't get too high
fix movies playing twice in redalert missions
reset time compression for redalert missions and cmdbriefings, just in case
2005-03-13 08:04:43 +00:00
phreak 2f5adb9e46 extra checks in find_parent_rotating_submodel() 2005-03-12 23:53:27 +00:00
phreak a49d6b493e doubled default spawn angle from 180 to 360 since it seems to track better 2005-03-12 21:08:01 +00:00
phreak 108c108f30 the code for the damaged-escort-priority-all sexp started
overwriting outside ofarray bounds.  goodbye call stack... erm goodbye bug.
2005-03-12 20:48:33 +00:00
taylor 05ea8b4fc2 helps to get the stupid check right 2005-03-12 19:28:47 +00:00
taylor 9edcd3fd29 forgot this one, jpeg stuff 2005-03-12 07:42:05 +00:00
phreak 84b5a5f0b2 Fixed a bug where the orb would incorrectly render under alternate FOVs.
Updated the functions that scramble the contacts so the blips show up
somewhat near where they should be.
2005-03-12 06:03:07 +00:00
wmcoolmon 0be56a1aa3 whee! 2005-03-12 05:21:36 +00:00
taylor e66cfb27a9 absolute header location for jpeglib.h in jpgutils.cpp (thanks WMC)
update VC6 project files to correct versions that work properly with internal libjpeg
2005-03-12 04:59:15 +00:00
wmcoolmon 1421a0b59c Fixx0red odd drag problems 2005-03-12 04:44:24 +00:00
wmcoolmon 2be69e963d New commandline option "-noparseerrors" 2005-03-12 03:09:55 +00:00
taylor 0ae94257a7 was causing strange hangs due to really large values, don't know if this will help but SDL should take care of error checking this way 2005-03-11 14:16:02 +00:00
taylor 6f7a4b0f1f forgot to remove this with the MIN/MAX change 2005-03-11 14:14:05 +00:00
taylor 50086ac7a4 apparently this change never got in 2005-03-11 14:11:53 +00:00
taylor 550d17c7ad ignore the typical build specific files 2005-03-11 14:00:01 +00:00
wmcoolmon 066ee3a487 Isn't the extern needed too? causes linking errors on my system w/o it, although it compiles fine. 2005-03-11 01:37:35 +00:00
wmcoolmon e2338e638e Not really. I've got lib files in my main VC.NET libs directory, and include files in grouped subdirectories under my VC.NET include directory. it keeps my HD free of scattered SDK directories and helps keep conflicts down. 2005-03-11 01:34:19 +00:00
wmcoolmon 49223230ef Oops, gotta remember to commit main codebase stuff when fixing FRED 2005-03-11 01:28:23 +00:00
wmcoolmon 34da09b6b1 I like comments 2005-03-11 01:27:17 +00:00
taylor dd846550a5 fix screwed up stars coloring in OGL 2005-03-10 21:16:16 +00:00
taylor 7b36e67f4c maybe WMC can leave the include alone now ;) 2005-03-10 16:16:52 +00:00
taylor 83d4651f9a build file updates to use the internal jpeglib now 2005-03-10 16:15:18 +00:00
taylor 96efe16ac1 internal libjpeg files 2005-03-10 16:13:54 +00:00
taylor 896c01a52a initial libjpeg project file 2005-03-10 16:10:47 +00:00
bobboau ce75d00092 fixed a local/global conflict 2005-03-10 15:35:21 +00:00
taylor 405ba066b9 change min/max to MIN/MAX to fix GCC problems
add lab stuff to Makefile
build unbreakage for everything that's not MSVC++ 6
lots of warning fixes
fix OpenGL rendering problem with ship insignias
no Warnings() in non-debug mode for Linux (like Windows)
some campaign savefile fixage to stop reverting everyones data
2005-03-10 08:00:18 +00:00
wmcoolmon c7c1481bbf Commit for Bobboau. This causes the lab to crash in some circumstances. 2005-03-09 23:45:18 +00:00
bobboau dceb54f914 added a new interface render funtion 2005-03-09 03:23:32 +00:00
Goober5000 a79c665cca whoops 2005-03-08 04:41:39 +00:00
Goober5000 5548a8e954 edited for language ;)
--Goober5000
2005-03-08 03:50:25 +00:00
bobboau 61180ca93d minor change to high level render target code 2005-03-08 02:31:51 +00:00
Goober5000 37b7824118 rolled back my original code on the support ship CTD; thanks taylor :)
--Goober5000
2005-03-07 20:12:36 +00:00
bobboau 37bfe59c6e commit of render target code, d3d should be totaly functional,
OGL still needs implementation.
2005-03-07 13:10:22 +00:00
taylor 98f254d8be can't believe I missed something that obvious. *hides in shame* 2005-03-06 17:16:08 +00:00
taylor 1864025836 don't Assert() when repair_objp is NULL (support ship object is invalid until it's done with warpin) 2005-03-06 16:43:40 +00:00
wmcoolmon 4cbcb63114 Whoops! 2005-03-06 11:32:40 +00:00
wmcoolmon 323bce86d8 RE-fixed stuff. Ogg support. Briefings. 2005-03-06 11:23:45 +00:00
wmcoolmon ef93982342 Switched out model_unload with model_page_out_textures, as it was causing crashes in release mode. 2005-03-06 08:30:22 +00:00
wmcoolmon 2f24f22af2 fix0r for negative values in textboxes, and ubytes 2005-03-05 20:46:12 +00:00
taylor af4326265c make sure we don't scale the restore_screen bitmap, it's already the correct size 2005-03-05 19:11:07 +00:00
taylor fad12aefd0 don't let hud messages walk off screen when res is GR_640 2005-03-05 18:59:28 +00:00
bobboau 0bd7a2c66b made all the gr_d3d_tmapper variants use dynamic a vertex buffer rather
than drawprimitiveup, this also means that these functions can now
handle as much poly data as you might want to through at them
2005-03-04 03:24:44 +00:00
taylor efe1254bb9 animated beam muzzle glows 2005-03-03 16:40:29 +00:00
taylor 385b2073ac lockup fixes, and it's Linux friendly too :) 2005-03-03 16:18:19 +00:00
taylor f08198fbbb support for TMAP_FLAG_TRILIST
extra check to make sure OGL closes down right under Windows
increased depth buffer, it was too small to compare when 32bpp was used
2005-03-03 16:16:55 +00:00
bobboau 6f068d5dc3 fixed a small error from my earlier commit. 2005-03-03 14:29:39 +00:00
Kazan 3ed6c8c1cb !Om_tracker_flag = non-pxo 2005-03-03 12:58:25 +00:00
Goober5000 923d27e0e9 AUGH! Stupid hidden bugs... this one is V's fault
--Goober5000
2005-03-03 08:41:53 +00:00
wmcoolmon e4f3927555 Added new files to the project. Hopefully this works; I have no way to test it. 2005-03-03 08:16:26 +00:00
wmcoolmon 2bcc948054 Oops 2005-03-03 07:32:55 +00:00
wmcoolmon fc3150bb8a Removed my Assert(true)s :p 2005-03-03 07:30:15 +00:00
wmcoolmon 23745c58d7 Made HUD shield icon auto-generation off unless "generate icon" ship flag is specified for the ship. 2005-03-03 07:13:17 +00:00
Goober5000 f32d0a2776 removed the "error" in the new docking code
--Goober5000
2005-03-03 06:41:40 +00:00
wmcoolmon 02e75ddd49 Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure" 2005-03-03 06:05:32 +00:00
taylor 86b32baff4 well that was good and wrong 2005-03-03 05:32:11 +00:00
wmcoolmon 37e8cf21b9 Turret AI code optimizations. If freaky stuff happens, call WMC() 2005-03-03 03:55:03 +00:00
wmcoolmon 927864c581 This should really be like this to prevent crashing 2005-03-03 03:53:18 +00:00
bobboau 413b0c2781 added trilist suport to the poly rendering functions
and a gr_bitmap_list function that uses it
2005-03-03 02:39:14 +00:00
taylor 9ad43ab8f0 use the back buffer for screen saves, this didn't work on Windows at one
point but I'm out of things to try and it may be ok after other fixes
2005-03-03 00:33:41 +00:00
taylor 91e9fb4433 more NO_NETWORK/INF_BUILD goodness for Windows, takes care of a few warnings too 2005-03-02 21:24:48 +00:00
taylor 3f9ffbc393 better support for Inferno builds (in PreProcDefines.h now, no networking support)
make sure NO_NETWORK builds are as friendly on Windows as it is on Linux/OSX
revert a timeout in Client.h back to the original value before Linux merge
2005-03-02 21:18:20 +00:00
taylor 60d25cb9fa that one should never have slipped passed me (Linux specific) 2005-03-02 03:13:00 +00:00
taylor 295426a6eb make sure starfield bitmaps render when not in HTL mode
slight header fix for osapi.h
add some string overflow protection to modelread and bmpman
s/NO_NETWORKING/NO_NETWORK/g  (Inferno builds)
2005-03-01 23:08:24 +00:00
taylor df19f785c1 unbreak Linux build (not valid C/C++ anyway, block scope) 2005-03-01 23:05:38 +00:00
bobboau 9c9876909b oh, hey look I've commited something :D
animation system, weapon models detail box alt-tab bug, probly other stuff
2005-03-01 06:55:45 +00:00
taylor 44ed68339e uugh, missed the initial tree move (WMC: probable locking problem) 2005-02-28 01:24:02 +00:00
wmcoolmon 1fb475ba86 Removed unneccessary variable 2005-02-28 00:29:52 +00:00
wmcoolmon b94b107822 Added a white component to lightning so it isn't just a big blue block 2005-02-27 23:42:07 +00:00
wmcoolmon 3b2a13ae6a Some HUD work 2005-02-27 23:27:50 +00:00
Goober5000 076bdda114 First stage of "apply to all ships in this wing" weapon loadout button code.
Button hooks only, pending interface art.  The "apply-to-all" code itself
still has to be written.
--Goober5000
2005-02-27 14:09:27 +00:00
wmcoolmon 6f73240dcc Nonstandard res stuff 2005-02-27 10:38:06 +00:00
wmcoolmon 23ef0449ab More nonstandard res stuff 2005-02-27 07:08:22 +00:00
wmcoolmon 1e959494d2 nonstandard res HUD stuff 2005-02-27 07:07:47 +00:00
taylor 310a084b1f few more compiler warning fixes (didn't mean to commit iostream.h change)
lower warning level to 3 to stop MSVC6 from complaining about C++ headers
2005-02-23 13:17:05 +00:00
taylor 4304153d4b more consolidation of various graphics variables
some header cleaning
only one tmapper_internal for OGL, don't use more than two tex/pass now
seperate out 2d matrix mode to allow -2d_poof in OGL and maybe fix missing
   interface when set 3d matrix stuff doesn't have corresponding end
add dump_frame stuff for OGL, mostly useless but allows trailer recording
2005-02-23 05:11:13 +00:00
taylor ce810f8195 compiler warning fixes (for MSVC++ 6)
have the warp effect only load as many LODs as will get used
head off strange bug in release when corrupt soundtrack number gets used
   (will still Assert in debug)
don't ever try and save a campaign savefile in multi or standalone modes
first try at 32bit->16bit color conversion for TGA code (for TGA only ship textures)
2005-02-23 05:05:39 +00:00
taylor c70142a0c8 even more bm_unload() -> bm_release() changes 2005-02-23 04:57:29 +00:00
taylor b1c274ee89 more bm_unload() -> bm_release() changes 2005-02-23 04:55:09 +00:00
taylor b370e5b903 some bm_unload() -> bm_release() changes to save bmpman slots 2005-02-23 04:51:56 +00:00
wmcoolmon eb239416c0 Multi-res support 2005-02-21 09:00:58 +00:00
Goober5000 cc3b463dcd restored release version of some cheat codes; removed a cheat for cloaking
--Goober5000
2005-02-21 05:40:16 +00:00
wmcoolmon b25707b74d Camera code updates (subtitles) 2005-02-20 23:14:00 +00:00
wmcoolmon 2564913620 Trails stuff, moved ship docking func declaration so FRED could get to it. 2005-02-20 23:13:01 +00:00
wmcoolmon 22e44c3eac Fix0r3d trails 2005-02-20 23:11:51 +00:00
wmcoolmon 9fc52304e6 More trails updating goodness 2005-02-20 08:24:19 +00:00
wmcoolmon e1554e26f4 Smartified shipcontrails 2005-02-20 08:22:48 +00:00
wmcoolmon 65a6fcbf37 Trails update: Better, faster, stronger, but not much more reliable 2005-02-20 07:39:34 +00:00
Goober5000 163e2b2d83 restored original behavior for cheat code time dilation
--Goober5000
2005-02-20 05:22:44 +00:00
wmcoolmon 12c2e477a4 Removed trails limit 2005-02-19 07:57:03 +00:00
wmcoolmon 846152daab linklist isn't needed for this 2005-02-19 07:52:56 +00:00
wmcoolmon 8789a43e70 OpenGL gradient fix for nonstandard resolutions 2005-02-19 07:50:15 +00:00
wmcoolmon 8f8fdb7779 Fixes for debriefing window in nonstandard res 2005-02-18 21:14:03 +00:00
wmcoolmon aadb753a5f Fixed line misalignment at nonstandard res in the campaign room 2005-02-18 20:50:40 +00:00
wmcoolmon 39c431b00b More nonstandard res fixing 2005-02-18 09:58:40 +00:00
wmcoolmon a89a04d6c6 Since the screen can be wider than 1200 px now, don't auto-cull brackets if they're that big. 2005-02-18 09:54:41 +00:00
wmcoolmon c02651da4b Updates for better nonstandard res support, as well as a fix to the Perseus crash bug I've been experiencing. Bobb, you might want to take a look at my change to grd3d.cpp 2005-02-18 09:51:07 +00:00
Goober5000 06c07b33a3 really fixed the build warning
--Goober5000
2005-02-18 09:03:34 +00:00
wmcoolmon 7655803770 If a vertex buffer fails to be made, don't crash. 2005-02-18 08:05:16 +00:00
wmcoolmon 2067fa9571 Attempt to get rid of compiler warnings 2005-02-18 05:24:26 +00:00
wmcoolmon cd3689feb3 Added $Tech Model (after +Tech Description) 2005-02-18 04:54:44 +00:00
wmcoolmon 8d72b69b60 "-ingame" command line option 2005-02-16 10:00:40 +00:00
taylor 1094be5d9e fix cleanup to avoid breaking the slider when it's still needed 2005-02-15 02:15:04 +00:00
taylor 2223aed74b clean up some model related globals
code to disable individual thruster glows
fix issue where 1 extra OGL light pass didn't render
2005-02-15 00:06:27 +00:00
taylor 639ee761ac don't try and draw starfield bitmaps if they aren't valid
make AB thruster stuff in ship_create() a little less weird
replace an Int3() with debug warning and fix crash in docking code
make D3D Textures[] allocate on use like OGL does, can only use one anyway
2005-02-15 00:03:36 +00:00
taylor 2a8dd7547b make hudparse GCC 3.4 friendly (WMCoolmon way want to check this with tbl)
fix OSX compile problem
debug message in weapons_page_in() should have been real debug message
2005-02-14 23:59:23 +00:00
taylor b604045666 fix mouse click issues in weapon/ship select screen
skip real VCR controls for Closeup check rather than using hardcoded values
2005-02-14 23:56:51 +00:00
taylor c11ae3ff36 make loading screen shader a bit taller
add i.o to credits for Linux and OSX code
add libjpeg and ogg stuff to credits for license compliance
replace an Int3() with a debug message in the hud code
2005-02-14 23:54:11 +00:00
wmcoolmon c9f7473e9a More explicit calculation handling 2005-02-13 08:42:41 +00:00
wmcoolmon eb0593ba11 3D models in weapons selection screen and nonstandard resolution fixes for ship selection screen. 2005-02-13 08:41:25 +00:00
wmcoolmon 403446d77e nonstandard resolution-friendly function updates 2005-02-13 08:38:54 +00:00
wmcoolmon 0ee363c1c6 Made messages display properly in nonstandard resolutions 2005-02-13 08:37:57 +00:00
wmcoolmon b742875688 Lockon should now work properly in nonstandard resolutions 2005-02-13 08:36:51 +00:00
wmcoolmon b07c2a0b66 while loops are dangerous things... 2005-02-12 22:49:24 +00:00
taylor 280066b619 fix Error() check so that it doesn't hit on MAX_BUFFERS_PER_SUBMODEL-1 2005-02-12 12:17:54 +00:00
taylor 75daed2b9b fix possible crash in bm_get_section_size()
get jpeg_read_header() working properly
VBO fixes and minor optimizations
2005-02-12 10:44:11 +00:00
taylor bec567bbab fix an issue with bm_set_components()
abs is for ints fabsf is for floats (camera.cpp)
make the in-cockpit stuff OGL friendly
2005-02-10 14:38:50 +00:00
wmcoolmon ac993ba2e6 Got rid of a couple annoying compiler warnings 2005-02-10 04:05:42 +00:00
wmcoolmon 0aac23683b Addition of the -clipdist argument. 2005-02-10 04:02:37 +00:00
wmcoolmon 175f3118a9 Low-level code for better hi-res support; better error reporting for vertex errors on model load. 2005-02-10 04:01:43 +00:00
taylor 3cdae29516 update/add .cvsignore files for project file changes
silence warning about depreciated strings.h stuff for MSVC 2005
final model_unload() stuff for WMCoolmon, put in missionweaponchoice.cpp
remove really old project files
2005-02-08 23:49:59 +00:00
taylor bc59138af7 moved to projects 2005-02-08 05:19:34 +00:00
taylor a70fea9d6d moved to projects directory 2005-02-08 05:18:02 +00:00
taylor fdcc240eec add something to the README about projects 2005-02-08 05:14:17 +00:00
taylor fbe5cf32fd new projects directory and files 2005-02-08 05:11:19 +00:00
taylor ce6f466d89 should fix linker error in libjpeg 2005-02-07 08:33:14 +00:00
wmcoolmon de684f1e78 Updated camera code 2005-02-06 22:21:25 +00:00
taylor 7b619f40cf more post merge happiness 2005-02-05 04:15:36 +00:00
taylor 4905537d21 add libjpeg and ogg stuff 2005-02-05 00:52:51 +00:00
taylor 6044aef62c fix a few things post merge 2005-02-05 00:30:49 +00:00
taylor b155e6ebd3 merge with Linux/OSX tree - p0204-3 2005-02-04 23:29:32 +00:00
taylor 09167fa382 merge with Linux/OSX tree - p0204-2 2005-02-04 20:06:10 +00:00
taylor a2232be0c7 merge with Linux/OSX tree - p0204 2005-02-04 10:12:33 +00:00
phreak c840b77b0c revert to default d-missile behavior if the electroinics parameters aren't specified.
added an option to customize the old-style disruption calculation as well.
2005-02-03 01:26:45 +00:00
taylor f2059b4e8a only model_load() if we using a ship other than the current one 2005-02-02 15:09:06 +00:00
taylor bf40c2ebff merge with Linux/OSX tree - p0202 2005-02-02 10:36:23 +00:00
taylor 8ac3251761 OGG fix for streams 2005-02-01 06:54:20 +00:00
taylor 0bf7ee01dc merge with Linux/OSX tree - p0131-2 2005-01-31 23:27:55 +00:00
taylor 694fbd606a merge with Linux/OSX tree - p0131 2005-01-31 10:34:40 +00:00
taylor 0e646c0a45 merge with Linux/OSX tree - p0130
remove extra brace in cfile.cpp
2005-01-30 18:32:42 +00:00
taylor 429a65a246 it's -nosound not -noaudio 2005-01-30 14:09:29 +00:00
taylor 2a7b06112d merge with Linux/OSX tree - p0130 2005-01-30 12:50:08 +00:00
Goober5000 ebf7f23559 bah - rolled back the HTL fix that doesn't really work
--Goober5000
2005-01-30 10:49:26 +00:00
Goober5000 7f98f2ce19 optional flags default to false I should think
--Goober5000
2005-01-30 09:36:19 +00:00
Goober5000 be761d4fc1 nitpicked some boolean tests, and fixed two small bugs
--Goober5000
2005-01-30 09:27:41 +00:00
wmcoolmon e180d98164 Make sure hudnavigation uses the correct draw_brackets_Square 2005-01-30 03:28:17 +00:00
wmcoolmon 3bfc7b0911 This isn't needed anymore 2005-01-30 03:27:09 +00:00
wmcoolmon 703791a2f7 HUD updates 2005-01-30 03:26:11 +00:00
wmcoolmon 21bf99b795 Don't try and create a vertex buffer with no vertices (Seems to cause CTD) and fix to brackets in nonstandard res 2005-01-30 03:24:39 +00:00
wmcoolmon 309b9ef3a7 Improved user-friendliness - give an Error instead of a CTD 2005-01-30 03:23:22 +00:00
wmcoolmon 72a92cc902 If a required string doesn't exist, give an error instead of a warning...doi. 2005-01-30 01:38:26 +00:00
wmcoolmon 7d8ea51898 Made a bunch of ship.tbl variables optional 2005-01-30 01:34:39 +00:00
phreak ed29327ca2 smart shield stuff. enabled by command line for now, but this will be changed in the future, i just want people to test it.
-phreak
2005-01-29 16:31:55 +00:00
phreak 9cb422623a smart shield command line stuff. this will be changed in the future, but i want people to test it.
-phreak
2005-01-29 16:30:47 +00:00
phreak 180d4f7168 fixed error message again :)
-p
2005-01-29 15:40:22 +00:00
argv f52ec71693 Fixed compile errors due to several source files not having been updated to
reference "Min/Max_draw_distance" instead of "MIN/MAX_DRAW_DISTANCE".

-- _argv[-1]
2005-01-29 09:19:45 +00:00
wmcoolmon 386e412e19 Clipping stuff 2005-01-29 08:12:20 +00:00
wmcoolmon a870961d4a When drawing the viewer_obj, temporarily clip less close up for in-cockpit models. 2005-01-29 08:11:41 +00:00
wmcoolmon f7bfc7d969 Various updates; shader, clipping 2005-01-29 08:09:47 +00:00
wmcoolmon 72fc9011b5 Various updates; shader, assert, and clipping 2005-01-29 08:08:24 +00:00
wmcoolmon 6a3803653f Update to work with optimized shader func 2005-01-29 08:06:54 +00:00
wmcoolmon 036677d336 Ahh, the sweet smell of optimized code 2005-01-29 08:04:15 +00:00
Goober5000 599da97f1b docking fixes for FRED
--Goober5000
2005-01-29 05:34:30 +00:00
Goober5000 6ac87d4c9b updated Freespace2 project
--Goober5000
2005-01-29 00:58:01 +00:00
Goober5000 0e53df600f added bitarray.h to the code project
--Goober5000
2005-01-29 00:37:10 +00:00
wmcoolmon d0de69e805 Added better too-many-textures error message 2005-01-28 23:45:23 +00:00
taylor acc629e8ba less hacky and faster version... *hopes no one noticed the stupid mistake* 2005-01-28 13:26:14 +00:00
Goober5000 ff9b79a6e1 fixed Bobboau's spelling of 'relative'
--Goober5000
2005-01-28 11:57:36 +00:00
Goober5000 a746194c10 cleaned up some build warnings
--Goober5000
2005-01-28 11:39:18 +00:00
Goober5000 cc85c92369 changed a bunch of transpose-rotate sequences to use unrotate instead
--Goober5000
2005-01-28 11:06:23 +00:00
taylor 7fada66447 little cleanup to get rid of compiler warnings
add some memory management to help keep size of techroom down
new hotkey Ctrl-Shift-S to show all ships rather than just viewable
make Weapon_list allocate on load just like Ship_list
unload all textures and models on techroom_close()
2005-01-28 10:00:59 +00:00
taylor 0268e7ef01 add model_page_out_textures() for use in techroom
make model_page_in_textures() load more textures
2005-01-28 09:56:44 +00:00
Goober5000 56ae570469 finished implementing docking to a rotating submodel
--Goober5000
2005-01-28 09:01:04 +00:00
phreak 40b25f8860 shockwave weapons now work properly with the electronics (d-missible) tag
added in a "randomness factor" for electronics parameters.  This adds or subtracts
a random value between 0 and this factor to the disruption time.  This was hard coded
to be 4 seconds in retail.
2005-01-28 04:05:05 +00:00
wmcoolmon 1554585645 Better debrief memory handling 2005-01-28 03:00:56 +00:00
wmcoolmon 49c4aba4b9 Fixed crash bug in techroom 2005-01-28 02:57:59 +00:00
Goober5000 86ad5d5d40 dock points on rotating submodels is *almost* working
--Goober5000
2005-01-27 11:26:23 +00:00
Goober5000 35323dd78c added a useful bit of information to vm_vec_rotate and vm_vec_unrotate
--Goober5000
2005-01-27 05:26:07 +00:00
wmcoolmon 4702574a59 Ship autorepair, requested by TBP 2005-01-27 04:23:18 +00:00
wmcoolmon defdb93536 Camera code 2005-01-27 04:16:28 +00:00
Goober5000 ae228fcbc9 important bugfix
--Goober5000
2005-01-26 21:42:19 +00:00
phreak 7063549e4b added ogg and objectdock files to project 2005-01-26 14:57:19 +00:00
Goober5000 cdc08e7e78 hm... added a necessary bugfix for something very badly designed
--Goober5000
2005-01-26 06:58:37 +00:00
Goober5000 505e64424f whoops... need to free variable blocks for special hitpoints
--Goober5000
2005-01-26 06:49:50 +00:00
Goober5000 db7ad1acbc AHA... squashed another bug
--Goober5000
2005-01-26 05:44:10 +00:00
Goober5000 7cf1815d54 fixed a nitpicky thing
--Goober5000
2005-01-26 05:42:37 +00:00
argv 97acff37bc Removed the implicit surface shield on mesh-shielded ships.
-- _argv[-1]
2005-01-26 03:40:43 +00:00
Goober5000 a7540ac62d Bah - I am a moron. :) I see the reason why rand shouldn't work
multiple times.  It's been fixed thus.

I also added a rand-multiple sexp for any times when people do
want multiple random numbers.

--Goober5000
2005-01-26 01:52:21 +00:00
Goober5000 2a41ef68ce dockpoints now rotate with rotating subobjects
--Goober5000
2005-01-26 01:26:09 +00:00
Goober5000 adc3a72d47 species will now load from a default table instead of being initialized via code
--Goober5000
2005-01-25 23:32:46 +00:00
Goober5000 2c32bd840d more cool parsing stuff
--Goober5000
2005-01-25 22:47:37 +00:00
Goober5000 554b3a6660 separated one parsing function into two
--Goober5000
2005-01-25 22:21:45 +00:00
Goober5000 e38ab2fe4d streamlined some redundant stuff
--Goober5000
2005-01-25 21:28:58 +00:00
wmcoolmon d4826f46c6 Instead of trying to allocate a ridiculously large buffer if the file is defined but doesn't exist, give a warning. Someone with nebula-code experience should probably double-check this; also added jpg and TGA support. 2005-01-22 22:53:07 +00:00
wmcoolmon 9ffe178006 Nitpick - can be NULL by default 2005-01-22 22:02:28 +00:00
wmcoolmon 3b513034d2 Fix0red the ext error. Always make sure you have room for the string terminator. :) 2005-01-22 20:29:05 +00:00
taylor 8075cf5af7 crap 2005-01-21 21:12:52 +00:00
taylor 8074a3321b cleanup debug messages for texture loading making the output more readable and useful 2005-01-21 08:58:32 +00:00
taylor 5bc5158c4b make Subsys_status dynamic but allocate in blocks for speed and to help prevent memory fragmentation 2005-01-21 08:56:50 +00:00
taylor 6dba3cc43b slightly better memory management 2005-01-21 08:54:53 +00:00
taylor dc22fb9eba add -rlm cmdline option to switch to local viewpoint lighting calculations (OGL only for now) 2005-01-21 08:29:04 +00:00
taylor 9cd822ec0d fill in gr_opengl_set_texture_addressing()
add support for non-power-of-two textures for cards that have it
temporary crash fix from multiple mipmap levels in uncompressed formats
2005-01-21 08:25:15 +00:00
taylor 4b8212e0f0 make sure we can still use TGAs (16-bit) when Cmdline_jpgtga is not set, PCX still takes precedence per retail 2005-01-21 08:20:44 +00:00
Goober5000 83a8cf1681 fixed a crazy error
--Goober5000
2005-01-18 06:15:33 +00:00
Goober5000 c4ed88f317 fixed a silly error
--Goober5000
2005-01-18 06:14:29 +00:00
Goober5000 8d34467ead variables can be specified in training messages too now
--Goober5000
2005-01-18 01:20:03 +00:00
wmcoolmon e3b6c53f4a OGG fixes, ship selection fixes 2005-01-18 01:14:17 +00:00
Goober5000 c616c51e41 clarified a bunch of sexp stuff and fixed a bug
--Goober5000
2005-01-18 00:14:37 +00:00
argv 64590007e7 Surface shields.
See forum thread:
http://dynamic4.gamespy.com/~freespace/forums/showthread.php?s=&threadid=29643

-- _argv[-1]
2005-01-17 23:35:45 +00:00
Goober5000 92f8e99209 variables can now be displayed in messages
--Goober5000
2005-01-17 22:46:32 +00:00
wmcoolmon d1a7051b62 Attempt to fix the crash when a player ship's subsystems receives damage, and it has a lot (ie player ship is a capital ship).This seems to be controlled by SUBSYSTEM_MAX, which also controls the number of subsystems saved in red alert missions. 2005-01-17 06:35:35 +00:00
wmcoolmon 87775f955d Added "show ship" ship flag 2005-01-16 23:18:04 +00:00
wmcoolmon 8e8a748da5 Added VM_TOPDOWN view; Added 2D mission mode, add 16384 to mission +Flags to use. 2005-01-16 22:39:10 +00:00
wmcoolmon e99f222fd2 Current version of the new techroom code -C 2005-01-15 05:53:18 +00:00
argv 1213166f64 Revision 2.42 (Goober's fixes) broke "no pierce shields". Fixed.
-- _argv[-1]
2005-01-14 23:08:17 +00:00
wmcoolmon e587c5c372 gr_curve 2005-01-14 05:28:58 +00:00
taylor 180b2750fa plug leak from VBO crash fix 2005-01-13 04:55:57 +00:00
Goober5000 bce37fb042 hmm, rolled back one of my clarifications since it caused things to get messed up
--Goober5000
2005-01-13 03:33:07 +00:00
phreak 7ab6b70960 difficulty table changes. this lets modders specify how the difficulty level affect
how the AI behaves and controls advantages given to the player based on the
skill level.

--phreak
2005-01-13 02:25:52 +00:00
Goober5000 f431bc6313 forgot to remove a comment
--Goober5000
2005-01-13 01:10:33 +00:00
Goober5000 ca13ce4ee5 fixed another nasty bug
--Goober5000
2005-01-12 23:38:42 +00:00
Goober5000 0e69e9faf6 fixed a nasty bug where dock pointers would run off a cliff and crash
--Goober5000
2005-01-12 04:45:33 +00:00
Goober5000 2b19b94b77 two minor but important bugfixes to the multiple ship docking
--Goober5000
2005-01-12 00:52:42 +00:00
phreak a576a0bf8f new hud is deault off now. this should fix the disappearing gauges problem. 2005-01-12 00:20:27 +00:00
phreak 961bc28b85 nude hud? was this some kind of freudian slip of a sort or what? 2005-01-12 00:18:00 +00:00
phreak 51e955dfba fixed hud offsets bug 2005-01-12 00:17:09 +00:00
Goober5000 099d2700d0 multiple ship docking :)
don't tell anyone yet... check the SCP internal
--Goober500
2005-01-11 21:38:51 +00:00
Goober5000 d6b1e0c922 made a capitalization thing consistent
--Goober500
2005-01-11 21:28:24 +00:00
Goober5000 263f2b7c61 fixed two small things with physics
--Goober500
2005-01-11 21:25:58 +00:00
taylor 8363163b86 fully working (??) -loadonlyused, allocate used_weapons[] and ship_class_used[] only when needed 2005-01-11 04:05:23 +00:00
wmcoolmon 64114c55ec Bug-guard 2005-01-10 06:58:12 +00:00
wmcoolmon fe071e59d5 Debriefing screen updated to only use memory while open 2005-01-10 04:45:09 +00:00
wmcoolmon 0d0174e2ef Small fix, so we don't try to delete the same thing twice 2005-01-10 04:44:03 +00:00
wmcoolmon 7faf664c05 Techroom and Barracks now allocate memory only when open, and only for the number of ships currently loaded 2005-01-09 22:27:38 +00:00
wmcoolmon 5c6594234e Fix for music directory parent 2005-01-09 21:40:07 +00:00
wmcoolmon 42c5d6978d Sound quality in Freespace 2 is now controlled by SoundSampleBits, and SoundSampleRate. Also, some sounds will use hardware rather than software buffers if available. 2005-01-08 10:00:59 +00:00
wmcoolmon fd6d9228d6 Function pointers to inline functions is a no-no... 2005-01-08 09:57:27 +00:00
phreak 1a2e80eeda fixed the bug where the player couldn't use the target hud in reticle key. 2005-01-07 23:15:44 +00:00
argv e3465ddc03 Added missing #include.
-- _argv[-1]
2005-01-07 14:00:04 +00:00
Goober5000 62894590f3 gah
--Goober5000
2005-01-06 00:39:34 +00:00
Goober5000 6aa309268b changed argument from dist to dist_squared
--Goober5000
2005-01-06 00:37:32 +00:00
Goober5000 1b00feef46 added vm_vec_dist_squared_to_line
--Goober5000
2005-01-06 00:27:34 +00:00
Goober5000 603b466d84 small speedup in shpere_tri_edge (spelling should be fixed...); now distance is only calculated once
--Goober5000
2005-01-06 00:22:01 +00:00
taylor 5b7b87648f make sure we're not loading weapons that are left over from larger missions 2005-01-05 23:17:38 +00:00
taylor 625dfac695 more -loadonlyused fixes 2005-01-03 18:47:06 +00:00
taylor 29c631c38d stupid mistake 2005-01-03 18:46:03 +00:00
taylor 4d16203170 dynamic allocation of num supported OpenGL lights
add config option for more realistic light settings
don't render spec maps in nebula to address lighting issue
2005-01-03 18:45:22 +00:00
phreak 90f06ca5ee made custom loading screens work if only one resolution has been specified. 2005-01-03 01:05:08 +00:00
Goober5000 e5c01cb034 got rid of a nasty nasty bug in the beam collision function, and cleaned up some of Bobboau's old comments
--Goober5000
2005-01-02 23:22:22 +00:00
taylor a28df9d69a make use of MR_NO_FOGGING to render models without fog 2005-01-01 19:47:26 +00:00
taylor e7119711d5 add MR_NO_FOGGING flag to easily render models without fog (warp model, targetbox models) 2005-01-01 19:45:32 +00:00
wmcoolmon 302628fcf1 Erg, always make sure CVS is completely up-to-date. 2005-01-01 19:37:05 +00:00
argv 520084a643 Since Taylor's asteroid targeting code does not use the
TURRETS_SHOOT_ASTEROIDS #define, remove it from preprocdefines.h. We can
put it back from an old rev if people decide to use my code instead of his,
which seems unlikely.

-- _argv[-1]
2005-01-01 13:14:19 +00:00
taylor b349a99c92 good OpenGL spec mapping
fix VBO crash with multitexture using same uv coord data
little speedup of opengl_tcache_frame()
error message to make sure hardware supports the minimum texture size
move OpenGL version check out of the extention printout code
disable 2d_poof with OpenGL
2005-01-01 11:24:23 +00:00
taylor d80dd2c00f asteroid targetting code for capships, enabled by default, matches FS1 behavior 2005-01-01 10:38:23 +00:00
wmcoolmon b3ceda2d70 NEW_HUD stuff, turned off this time. :) It's in a state of disrepair at the moment, doesn't show anything. 2005-01-01 07:18:48 +00:00
Goober5000 bf6cf09a4d CVS checkin of bitarray.h; use this for large arrays of boolean values
--Goober5000
2004-12-31 03:48:12 +00:00
argv da012c2f56 I've just been informed that turrets do not shoot asteroids in the retail
game, and that this implementation causes them to shoot at the parent ship,
too. I'll deal with this later; in the mean time, use
"#define TURRETS_SHOOT_ASTEROIDS" to cause turrets to shoot asteroids.

-- _argv[-1]
2004-12-31 03:13:08 +00:00
Goober5000 e1686efae8 stupid parenthesis fix
--Goober5000
2004-12-30 21:41:24 +00:00
taylor 6f643adee8 don't use cfopen() for upgrade check, it was giving strange results 2004-12-30 16:25:22 +00:00
taylor 0142ec0cbb make sure swprintf() doesn't think szFile is already a wide-character string 2004-12-30 16:23:39 +00:00
argv 111d967c7b * For some reason, turret AI wasn't shooting at asteroids. It never has,
but it did in the retail game, and it should. The code to target asteroids
  was apparently missing, so I reimplemented it, and turrets shoot at
  asteroids again.
2004-12-30 08:07:52 +00:00
argv cdf10ac9ba Quick hack to remove the 50% rate-of-fire penalty when primary weapons are
linked. "#define NO_LINKED_PRIMARY_PENALTY" to enable this change; it's
disabled by default.

-- _argv[-1]
2004-12-30 07:26:21 +00:00
taylor 490a528103 make sure the file gets closed in pilot_file_upgrade_check() 2004-12-28 16:20:33 +00:00
taylor 434bda5ba6 fix some hud stuff getting drawn multiple times, don't show target data if HUD_disabled_except_messages is set 2004-12-26 22:45:58 +00:00
Goober5000 75f4c2a5da hud-disable-except-messages now resets after each mission
--Goober5000
2004-12-26 20:46:34 +00:00
wmcoolmon 2cf0159c55 Fixed text not displaying for single-weapon sips. 2004-12-25 19:17:23 +00:00
wmcoolmon fee35f7ea1 Quick update to tempfix possible bug. 2004-12-25 17:45:38 +00:00
wmcoolmon e22781b812 Fixed a couple of blonde moments. 2004-12-25 17:02:18 +00:00
wmcoolmon 58b5bc92af Fix to modular tables workaround with Fs2NetD 2004-12-25 16:42:59 +00:00
wmcoolmon a756e220ad Sync to current NEW_HUD code 2004-12-25 09:28:41 +00:00
wmcoolmon a6a8d4ddbe Fix to modular tables workaround with Fs2NetD + Sync to current NEW_HUD code 2004-12-25 09:27:41 +00:00
wmcoolmon 76b9870a68 Fix to modular tables workaround with Fs2NetD 2004-12-25 09:25:41 +00:00
wmcoolmon 89e3aae940 Ogg support for WIN32 2004-12-25 00:23:46 +00:00
wmcoolmon 02a8eefd80 Added .ogg in proper directories 2004-12-25 00:22:54 +00:00
Goober5000 32772a761f resorted command-line options and added an option for WMC's ballistic gauge
--Goober5000
2004-12-24 19:36:12 +00:00
wmcoolmon 3bfe49a936 NEW_HUD compiles now. :) 2004-12-24 05:07:05 +00:00
wmcoolmon 20dcfb2ccf Proposed HUD system stuffs - within NEW_HUD defines. 2004-12-24 01:07:19 +00:00
wmcoolmon 53e7dfe11f Ballistic primary ammo-gauge to the right of the HUD, support for weapon images in list. 2004-12-24 00:41:23 +00:00
wmcoolmon 5bcfd8bb0d Removed unneccessary function call (.0000001 ms speed increase!) 2004-12-23 23:36:30 +00:00
wmcoolmon 45b2843965 Added +Hud Image: for weapons, which replaces the weapon name in the list with an image. 2004-12-23 23:35:02 +00:00
wmcoolmon a28eaa0f30 Proposed HUD system stuffs - within NEW_HUD defines. 2004-12-23 23:30:45 +00:00
wmcoolmon a818321eda Proposed HUD system stuffs - within NEW_HUD defines. 2004-12-23 23:08:21 +00:00
phreak 20af7801cc commits for scramble-messages and unscramble-messages
-phreak
2004-12-23 15:58:55 +00:00
phreak b494401b36 added a pragma message if DevIL isn't compiled into the build 2004-12-22 23:05:48 +00:00
taylor 984b747cb9 add a popup to make sure people know about pilot upgrade 2004-12-22 21:49:05 +00:00
taylor a0550b9464 safety check against very large missions 2004-12-22 21:48:21 +00:00
taylor c2dee0d4c7 version bump to 3.6.5 2004-12-22 21:47:37 +00:00
wmcoolmon 84242e23bc Quick fix to hudparse.cpp; If this causes any problems, roll it back and I'll take another look at it. 2004-12-22 09:09:38 +00:00
fryday ce5277368e Fixed a tiny error in bob's code in d3d_init_environment (which seems to be called even
if there's no -env command-line) which created the cube-map and didn't check
if the creation of it failed. Added the same sanity check to d3d_render_to_env
2004-12-20 20:28:15 +00:00
fryday dc2c5537b2 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.
2004-12-20 20:18:30 +00:00
taylor 8f3dd91ea1 fix crash from dynamically allocated Personas 2004-12-17 06:43:01 +00:00
Goober5000 1e09b03f15 move wing name initialization to ship_level_init
--Goober5000
2004-12-15 17:32:19 +00:00
Goober5000 b1de454786 commented dumbfire lead indicator back in, because you need to know where your missiles are going
--Goober5000
2004-12-15 15:22:23 +00:00
Goober5000 814a0ced5e added Verify, an error checking macro that works in both release and debug modes
--Goober5000
2004-12-15 15:14:03 +00:00
Goober5000 7ba333529a new version of stristr that doesn't need to allocate memory
--Goober5000
2004-12-14 17:23:52 +00:00
Goober5000 0c48b587a1 allow different wing names than ABGDEZ
--Goober5000
2004-12-14 14:46:13 +00:00
wmcoolmon 0b1c9d34c5 Apparently I never commited -mpnoreturn... 2004-12-11 09:37:50 +00:00
wmcoolmon b811ba76b1 Changed music modular table ending to *-mus.tbm, in case a miscellaneous modular table is needed. 2004-12-11 09:03:08 +00:00
taylor bfb64d9f8a dymanic allocation of Personas 2004-12-10 17:21:00 +00:00
taylor 4ee06b9d79 fix old V bug when cancelling the pilot select screen 2004-12-05 23:47:18 +00:00
bobboau 631ad4151f sevral feature additions that WCS wanted,
and the foundations of a submodel animation system,
the calls to the animation triggering code (exept the procesing code,
wich shouldn't do anything without the triggering code)
have been commented out.
2004-12-05 22:01:12 +00:00
taylor 1655099a83 support uncompressed DDS images
use TexSubImage2D for video anis
2004-12-05 01:28:39 +00:00
taylor 3e94368b92 text of -no_set_gamma cmdline option shouldn't specify D3D since it works in OGL too 2004-12-02 11:20:33 +00:00
taylor 0d1d27627f make OGL use same gamma reg setting as D3D since it's the same ramp
have OGL respect the -no_set_gamma cmdline option
reset gamma to default on OGL exit to make sure the desktop doesn't stay wrong
2004-12-02 11:18:15 +00:00
taylor 3d4b214a19 not used at the moment but that code was stupid 2004-12-02 11:14:29 +00:00
taylor a68b24ceed little reorg to flags so Experimental won't show up twice
add/update the wiki links since none of them worked before
remove all options that require an argument since they won't work
2004-11-29 18:04:53 +00:00
taylor 08e5fca6e6 make sure we are checking the right bitmap_id 2004-11-29 18:02:01 +00:00
taylor 62e24f22b5 more EFF fixes - can't believe I forgot all this crap 2004-11-27 22:08:21 +00:00
taylor b503f12a85 Linux tree merge 2004-11-27 10:51:01 +00:00
taylor 00105ca9be correct positions for default graphics with no table
compiler warning fix
2004-11-27 10:50:32 +00:00
taylor 1ebc32bcef make sure the old behavior still applies to everything that's not a beam 2004-11-27 10:49:14 +00:00
taylor 7ff8c0bd04 some fixes for position problems on the HUD in non-standard resolutions
few compiler warning fixes
2004-11-27 10:48:03 +00:00
taylor db3759d775 this should get movies working again in D3D and help OGL too 2004-11-27 10:42:18 +00:00
taylor efbccb39e4 couple of LAN game vs. FS2NetD fixes 2004-11-26 08:41:11 +00:00
taylor 7d050d1ac7 fix briefing related crash(es) (forgot I had this) 2004-11-24 20:12:25 +00:00
taylor caad3968ec fix 2d warp in D3D, add cmdline option for 3d warp 2004-11-23 19:29:13 +00:00
taylor 412de9480f try and protect the bitmap_entry stuff a bit better
fix the transparent support ship, again, but correctly this time
2004-11-23 00:10:06 +00:00
taylor 05663b5f58 make sure species_defs.tbl can be found outside of root[0] and in VPs 2004-11-22 06:17:57 +00:00
Kazan 33605e78e0 dumbbugfix 2004-11-21 16:07:22 +00:00
Kazan 8904213db2 conflict res 2004-11-21 15:59:45 +00:00
taylor bf0b047002 support for animated beam sections
various weapon-only-used fixes
remove the -1 frame fix since it was fixed elsewhere
2004-11-21 11:38:17 +00:00
taylor 467b2424df some weapon-only-used loading fixes and general page-in cleanup
page in all ship textures from one function rather than two
2004-11-21 11:35:17 +00:00
taylor 9d28382c2b page in all frames at once rather than separately (old code that wasn't updated) 2004-11-21 11:33:23 +00:00
taylor 1470fe2279 newline fix (got tired of seeing this) 2004-11-21 11:31:46 +00:00
taylor 6d76c7cb3b move warning fixes from il_func.cpp to irc.cpp since that's where they are coming from 2004-11-21 11:31:02 +00:00
taylor 1d488daada make hud_disabled_except_messages() do everything at once, add it to hud_show_radar() and hud_show_target_model() so those don't show up (bug #271) 2004-11-21 11:29:53 +00:00
taylor af3e060a17 some 64-bit OS comaptibility fixes 2004-11-21 11:27:31 +00:00
taylor e6cddc470c split bm_load_sub() into fast (memory only) and slow (disk only) versions
EFF bug fix for fps and much better error handling
2004-11-21 11:26:39 +00:00
Goober5000 16a19c165c #pragma'd a bunch of warnings
--Goober5000
2004-11-18 00:05:37 +00:00
Goober5000 bb6f00f1ad added two new sexps
--Goober5000
2004-11-17 22:23:13 +00:00
taylor 609d799691 don't set gamma ramp while running FRED 2004-11-04 22:49:13 +00:00
taylor 81bf709a24 note to self: copy is down pat, now just learn how to paste, moron 2004-11-04 08:33:44 +00:00
taylor 74caede040 animate weapon glow/bitmaps properly while in flight, make sure
we don't exceed bitmap frame numbers, don't try to calculate
frame for particle spew animations since particle_render_all()
does that for us already
2004-11-02 08:32:38 +00:00
Goober5000 52f3eee0df tweaked some project settings
--Goober5000
2004-11-02 01:48:20 +00:00
taylor ef45ad0498 make use of Knossos_warp_ani_used flag - thanks Goober5000 2004-11-01 20:57:04 +00:00
taylor af97948745 new pilot code 2004-10-31 22:07:27 +00:00
taylor 332962030d compiler warning fixes, maybe fix issue that would cause cap ships to not fire beam weapons 2004-10-31 22:06:42 +00:00
taylor f21fcc0332 s/OGL_inited/OGL_enabled/g 2004-10-31 22:05:30 +00:00
taylor 8d65dc1bc4 be sure to initialize splodeing_texture, fix issue that would cause loading problems for glows 2004-10-31 22:04:33 +00:00
taylor 0874eefc8f little cleanup 2004-10-31 22:02:47 +00:00
taylor 07ce347244 new bmpman merge support, add PreProcDefines.h a few new places 2004-10-31 22:00:57 +00:00
taylor 8d585b4358 support external parsing sources without hurting currently parsing file (for EFF code) 2004-10-31 21:57:30 +00:00
taylor 75154c1613 new bmpman support, new OGL fixes don't need the freaky neb lighting fix anymore 2004-10-31 21:56:09 +00:00
taylor 1d084ab9cf s/fisrt/first/g 2004-10-31 21:55:00 +00:00
taylor c9e0491b23 new pilot code support, no-multiplayer and compiler warning fixes, center mouse cursor for redalert missions 2004-10-31 21:53:24 +00:00
taylor 447873f0cf fix math error that was hitting Assert()'s and making OGL models flip around for no reason 2004-10-31 21:49:49 +00:00
taylor 773d5ad4c9 faster setting of 0 spec values (Kazan), comment out second (dumbfire?) lead indicator since it just looked wierd constantly being offset 2004-10-31 21:48:42 +00:00
taylor 4ff9c8e05f bmpman merge 2004-10-31 21:46:38 +00:00
taylor 964bd9f180 Linux tree merge, better DDS support, texture panning 2004-10-31 21:46:10 +00:00
taylor fabd6362a7 Linux tree merge, single array for VBOs/HTL 2004-10-31 21:45:13 +00:00
taylor 274fa3cb3c Linux tree merge, use linear mag filter, small FRED fix, AA lines (disabled), use rgba colors for 3dunlit, proper gamma adjustment, bmpman merge 2004-10-31 21:42:31 +00:00
taylor 368c713975 move some otherwise bmpman stuff into grd3dbmpman.cpp 2004-10-31 21:40:11 +00:00
taylor c8d4f22a78 bmpman merge 2004-10-31 21:39:24 +00:00
taylor e3c58482c7 reinit device if lost - one of the D3D people should make sure this isn't stupid 2004-10-31 21:38:25 +00:00
taylor 18b6bb4d75 s/fisrt/first/g, bmpman merge 2004-10-31 21:36:39 +00:00
taylor 600444c1fc OGL_enabled, s/fisrt/first/g 2004-10-31 21:35:53 +00:00
taylor a8d696efbd rename __ASSERT check to _ASSERT to fix constant warning message - why did no one else fix this? 2004-10-31 21:34:39 +00:00
taylor bc807d17b5 rename OGL_inited to OGL_enabled to match D3D version 2004-10-31 21:33:05 +00:00
taylor 0630102a5d no networking with Inferno builds, basic 64-bit OS support 2004-10-31 21:32:27 +00:00
taylor 61ad202f69 bump COUNT_ESTIMATE, reset time compression at the start of a mission, new pilot file support, add feature_disabled popup 2004-10-31 21:31:34 +00:00
taylor 9927a5ae87 lots of cleanup with support for bmpman changes, full Linux/OSX support 2004-10-31 21:30:01 +00:00
taylor c5efd0be0f EFF animation support 2004-10-31 21:29:00 +00:00
taylor 49303fd117 support new pilot code, Linux code tree merge, don't use same pilot directory for Inferno builds 2004-10-31 21:28:38 +00:00
taylor e764696b29 bmpman merge, EFF animation support, better page in stuff, dozen or so smaller fixes and cleanup 2004-10-31 21:26:27 +00:00
taylor 3aa7acd898 change case of opengl files so I can stop worrying, add gropenglbmpman files 2004-10-31 21:24:11 +00:00
taylor 633729f763 #define if !#defined, add USE_DEVIL and FS2_SPEECH commented out 2004-10-31 21:23:08 +00:00
taylor 90cf3e8614 initial import from bmpman merge 2004-10-31 21:21:11 +00:00
Goober5000 31c41b5296 whoops
--Goober5000
2004-10-31 02:26:15 +00:00
Goober5000 df8319a0f8 added Knossos_warp_ani_used flag for taylor
--Goober5000
2004-10-31 02:04:34 +00:00
taylor 46c50c1120 make sure all spec colors are set to 0 in hud_tri() 2004-10-18 17:13:36 +00:00
Goober5000 d322e2ff67 fixed FRED bug that changed special arguments to (null)
--Goober5000
2004-10-18 09:27:47 +00:00
phreak b402b71221 Made WMCoolmon's hud target info brackets recognize alt-names
--phreak
2004-10-15 13:10:06 +00:00
Goober5000 c940cd79bf added change-alt-name
--Goober5000
2004-10-15 10:03:09 +00:00
Goober5000 35e3ca578c cleaned up some sexp stuff and added wing capability to kamikaze sexp
--Goober5000
2004-10-15 09:21:55 +00:00
Goober5000 d3c82861c9 extra coding insurance
--Goober5000
2004-10-15 08:14:07 +00:00
Goober5000 8405bd055e tweakage
--Goober5000
2004-10-14 23:03:37 +00:00
Goober5000 e3b142e32a added ability for variable names to be used as special arguments
--Goober5000
2004-10-14 22:28:27 +00:00
Goober5000 650954db1c more ubersexp bugfixing
--Goober5000
2004-10-14 01:19:17 +00:00
Goober5000 479498a9d5 fixed a few when-argument bugs
--Goober5000
2004-10-13 10:46:49 +00:00
Goober5000 4279bbb9d8 added toggle-subsystem-scanning ship flag
--Goober5000
2004-10-12 22:47:15 +00:00
Goober5000 f657744e17 added contrail speed threshold
--Goober5000
2004-10-12 07:34:45 +00:00
Goober5000 953e6a99bc added the no-bank ship flag (which works) and the affected-by-gravity flag
(which won't work until I implement gravity points)
--Goober5000
2004-10-11 22:29:25 +00:00
taylor 03aaaacfb5 make sure windowed mode gets the correct size 2004-10-10 22:15:10 +00:00
taylor decacd4b3e warp mouse to center screen on mission start 2004-10-10 22:12:57 +00:00
taylor 0b5681d867 holy crap at the copy-paste error 2004-10-10 16:59:37 +00:00
taylor 4e8849e133 almost forgot this for the IBX stuff 2004-10-09 18:08:33 +00:00
taylor d3f7db383f one more try to fix the memory leak and end-of-mission crash for talking head anis 2004-10-09 17:58:48 +00:00
taylor d203851662 better debugging for g3_end_frame() - mostly for FRED2 2004-10-09 17:54:32 +00:00
taylor 1194082507 safer handling of missing shield ani 2004-10-09 17:51:23 +00:00
taylor d8d1502cd8 da simple IBX code, back to old line rendering for models since it should be faster for OGL now 2004-10-09 17:48:58 +00:00
taylor 6804c59ad1 da simple IBX code 2004-10-09 17:45:45 +00:00
taylor 0e6d298426 don't use DevIL to read the header, slightly more sane error checking 2004-10-09 17:44:10 +00:00
Kazan bb80f8dd7e interface corruption fix - thanks taylor (MAX_BITMAPS upped to 7000) 2004-10-06 22:02:54 +00:00
Kazan d330dff907 Autopilot convergence collision fix for ai_fly_to_ship() and ai_waypoints() -- mathematically expensive, only usable by autopilot 2004-10-03 21:41:11 +00:00
Kazan 6c27195392 fix autopilot formation bug 2004-09-28 22:51:41 +00:00
Kazan 9a1b1f2eaa | is binary or, || is boolean or - please use the right one
autopilot velocity ramping biasing
made debugged+k kill guardianed ships
2004-09-28 19:54:32 +00:00
taylor 2f8a2dc863 fix logic error, may be support ship rearm fix 2004-09-26 20:58:29 +00:00
taylor 155a9e36c9 handle lost devices better, fix movie crash 2004-09-26 16:24:51 +00:00
taylor c4101b2fde proper OGL line drawing in HTL... hopefully 2004-09-24 22:40:23 +00:00
Goober5000 29dd848989 some ubersexp fixes
--Goober5000
2004-09-24 02:13:00 +00:00
Goober5000 4964e77ef2 fixed two bugs... still more bugs to be found :p
--Goober5000
2004-09-23 23:52:58 +00:00
Goober5000 e65d00dd33 ubersexp implementation complete
--Goober5000
2004-09-23 22:51:07 +00:00
Goober5000 61449827db a bunch of work on the actual implementation of when-argument
--Goober5000
2004-09-23 05:53:00 +00:00
Goober5000 b184c75e5a further work on ubersexp framework
--Goober5000
2004-09-22 21:52:22 +00:00
Goober5000 a57002681e fixed some small problems in the framework - should be working nicely now;
next step is the actual sexp implementation :-P
--Goober5000
2004-09-22 08:32:05 +00:00
Goober5000 cee8a97426 checking in framework for when-argument special ubersexp
--Goober5000
2004-09-22 06:56:45 +00:00
tbird 85de2b657e Modified the image loading to accept 24 and 32 bit images 2004-09-22 03:50:13 +00:00
Goober5000 31f2466725 a bit of reordering
--Goober5000
2004-09-17 08:07:52 +00:00
Goober5000 12c43798c4 changed around the logic for the 3D warp effect
--Goober5000
2004-09-17 07:12:23 +00:00
Goober5000 810272dc17 moved ssm stuff to header file so it would work in FRED
--Goober5000
2004-09-17 07:11:02 +00:00
Goober5000 50d50878a6 removed player-not-use-ai and changed player-use-ai to take an argument
--Goober5000
2004-09-17 00:28:32 +00:00
Goober5000 4d698cb5b8 changed toggle-hud to hud-disable; added hud-disable-except-messages
--Goober5000
2004-09-17 00:18:18 +00:00
et1 5b8643672c Use yellow warp anim when doing exit jump with "-tbpwarpeffects" 2004-09-10 13:55:49 +00:00
et1 d693230a5c Implemented "+WeaponMinRange" token. Fixed a crash issue with fighter launch checks 2004-09-10 13:54:21 +00:00
et1 1d11353e8c Command line option for TBP for warp stuff, "-tbpwarpeffects" 2004-09-10 13:51:45 +00:00
et1 40e1dfe93f Implemented "+WeaponMinRange" token 2004-09-10 13:50:09 +00:00
Goober5000 4482e8e7cd fix0red something weird
--Goober5000
2004-09-05 20:05:16 +00:00
Goober5000 341d7b09e7 whoops, fixed this for debug mode
--Goober5000
2004-09-05 19:41:31 +00:00
Goober5000 3d158e6a93 we definitely want browse info... and Sticks wants a mapfile too
--Goober5000
2004-09-05 19:25:02 +00:00
Goober5000 3766a10e38 fixed a few warnings
--Goober5000
2004-09-05 19:23:24 +00:00
Goober5000 27b3bc69ed MultiUi.cpp should not be in the "Freespace2" project
--Goober5000
2004-09-05 18:42:31 +00:00
Goober5000 2ddca17e8c fixed a warning
--Goober5000
2004-09-02 04:02:44 +00:00
phreak e349f9b809 MISSION_FLAG_USE_NEW_AI fixes for bomber+ missile selection, rapid dumbfire
firing and primary weapons selection
2004-09-01 01:26:20 +00:00
phreak 31d7488532 created the mission flag MISSION_FLAG_USE_NEW_AI
this lets old missions use the retail AI so they are balanced.  new missions would
be able to select this in fred so designers can take advantage of it.
2004-09-01 00:58:46 +00:00
Goober5000 59731f6812 fixed a small bug in the custom hitpoints mod
--Goober5000
2004-09-01 00:22:36 +00:00
Goober5000 40add6add9 when calculating damage for scoring, don't count beams unless they're fired by a fighter or bomber
--Goober5000
2004-08-31 23:36:28 +00:00
Kazan b139d1b03d small standalone-related multibug fix
prohibited execution of process_debug_keys(int) while Game_mode & GM_MULTIPLAYER
2004-08-26 18:19:36 +00:00
Goober5000 7afc414357 fix0red some warnings
--Goober5000
2004-08-23 07:48:09 +00:00
Goober5000 93c32d683f warp effect is back to FS2 default
--Goober5000
2004-08-23 04:32:40 +00:00
Goober5000 17b8a2fa32 ship-tag and ship-untag sexps
--Goober5000
2004-08-23 04:32:06 +00:00
Goober5000 0bd279e968 ship-tag and ship-untag
--Goober5000
2004-08-23 04:00:15 +00:00
Goober5000 91c79b15ad modularized tag stuff in preparation for sexp
--Goober5000
2004-08-23 03:34:34 +00:00
Kazan fa7c2dad07 wakka wakka - fix minor booboo 2004-08-20 05:13:08 +00:00
Kazan 7d1c8b185d 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 2004-08-11 05:06:36 +00:00
phreak aa889ef96e fixed the -orbradar launcher string 2004-08-08 02:56:54 +00:00
phreak 08bf4302e7 added radarorb.cpp and radarorb.h to project 2004-08-05 02:18:17 +00:00
phreak fa031f9047 forgot to commit orb change 2004-08-05 02:15:27 +00:00
phreak 220ed35eeb orb radar rendering style 2004-08-02 22:54:07 +00:00
phreak 01b0dec472 orb radar rendering style 2004-08-02 22:43:03 +00:00
phreak 04c8b17831 added -orbradar to enable orb rendering for the radar 2004-08-02 22:40:59 +00:00
phreak ca99486b24 -phreak command line changed to -dualscanlines 2004-08-01 02:31:18 +00:00
et1 51301cfadf Implemented "+SwarmWait:"-token and fixed weapon glow tails 2004-07-31 08:58:07 +00:00
et1 313f069005 Implemented "+SwarmWait:"-token 2004-07-31 08:57:22 +00:00
et1 f5d7c33c1e Fixed inaccuracy problems with non-homing swarmers 2004-07-31 08:54:38 +00:00
et1 4e2ffa189b Make missing briefing icon message to tell the icon missing 2004-07-31 08:53:46 +00:00
et1 f3e70df182 If weapon loadout anim is missing, warn instead of int3 2004-07-31 08:52:45 +00:00
et1 3b9995c3d7 Disabled ship shield load check for TBP 2004-07-31 08:51:47 +00:00
Kazan d51241cd4e bugfixes 2004-07-29 23:41:22 +00:00
Kazan 3ed360e5b2 unbug the JS bug i caused --- kazan 2004-07-29 19:37:50 +00:00
taylor ef4247b55c fix NULL pointer and try to prevent in future, remove excess commands in opengl_cleanup() 2004-07-29 09:35:29 +00:00
Kazan a90f1bafb6 fs2_open.exe was suffering the same problem as fred2 -- it was just a little less obvious 2004-07-29 03:49:44 +00:00
taylor 10e760b780 plug memory leaks 2004-07-29 03:41:46 +00:00
Kazan 5c64668b0b making another bug a little bit more dead inside :D 2004-07-27 20:09:12 +00:00
Kazan 999e6395b2 squished another 2004-07-27 18:52:11 +00:00
Kazan e3f5bb6229 i love it when bugs go crunch (autopilot ai fixup) 2004-07-27 18:04:09 +00:00
Goober5000 0b3af1240f outline of ship-tag and ship-untag sexps
--Goober5000
2004-07-26 21:26:45 +00:00
Goober5000 751d13997a updated launcher link
--Goober5000
2004-07-26 21:19:05 +00:00
Kazan 864e1b5922 remove MCD complete 2004-07-26 20:47:56 +00:00
Kazan da97eaa8d9 remove MCD 2004-07-26 20:19:04 +00:00
Kazan 84a7aae84f add conditional compilation directive 2004-07-26 19:39:49 +00:00
Kazan ab6b7db850 Autopilot system completed -- i am dropping plans for GUI nav map
All builds should have ENABLE_AUTO_PILOT defined from now on (.dsp's i am committing reflect this) the system will only be noticed if the mission designer brings it online by defining a nav point
Fixed FPS counter during time compression
2004-07-26 17:54:05 +00:00
Goober5000 f7618cbfb8 last bit of Unix fixorage
--Goober5000
2004-07-26 17:50:02 +00:00
Goober5000 7adaed42a8 more #ifndef fixorage
--Goober5000
2004-07-26 17:39:20 +00:00
Goober5000 c671012188 fixored a problem when using the command-line compiler to compile everything under Windows
--Goober5000
2004-07-26 16:11:41 +00:00
Kazan bd8b9956fe only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged 2004-07-25 19:27:51 +00:00
Kazan 257d7bef7a -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)
2004-07-25 18:46:30 +00:00
Kazan d00cd1bda7 i have absolutely nothing to say about that subject 2004-07-25 00:31:31 +00:00
taylor 983729d9eb fix problem with sectioned menu bitmaps in OGL 2004-07-21 00:03:46 +00:00
wmcoolmon a842f88067 Fixed ifdef, was missing ship_decal_system otherwise 2004-07-20 04:03:21 +00:00
Kazan ca8d5ac051 nothing major 2004-07-18 04:07:26 +00:00
taylor 6f0386d93b stupid braces... 2004-07-17 19:01:15 +00:00
taylor 752ba05bae fix set_*_matrix overcompensation, makes OGL work again 2004-07-17 18:59:01 +00:00
taylor 501ae8c8c1 oops, I can't spell 2004-07-17 18:49:57 +00:00
taylor e574e9f732 various OGL and memory leak fixes 2004-07-17 18:46:09 +00:00
taylor ba9569c372 don't use bitmap sections by default, openil_close() 2004-07-17 18:43:46 +00:00
taylor 463e111810 Bob say we fix OGL, so me fix OGL <grunt> 2004-07-17 18:40:40 +00:00
taylor e273761d63 force image orientation in DevIL 2004-07-17 18:38:04 +00:00
taylor 24df446ad7 make old warpmap and new glow bitmap 3D unlit to render right in OGL 2004-07-17 09:29:13 +00:00
taylor 46f274f38d add CF_SORT_REVERSE to real sort routine, makes CF_SORT_TIME work again 2004-07-17 09:26:00 +00:00
taylor 759b7e8b31 make sure avi and mpg movies get added to file cache 2004-07-17 09:03:29 +00:00
taylor 997e5411a3 add .deps directory to ignored entries 2004-07-17 09:00:38 +00:00
taylor ccaa74bfcd misspelled filename 2004-07-17 08:59:25 +00:00
wmcoolmon 4e961ff7c9 I though I fixed this... 2004-07-15 00:16:46 +00:00
wmcoolmon 5ca7069215 Better -load_only_used handling; added mark_weapon_used(weapon ID), which does check for IDs of -1. 2004-07-14 01:27:01 +00:00
wmcoolmon 4478c4ca14 Better -load_only_used handling 2004-07-14 01:26:10 +00:00
Kazan 2d50eb04cb adding mcd 2004-07-12 16:37:01 +00:00
Kazan 428b3dcbc9 MCD - define _MCD_CHECK to use memory tracking 2004-07-12 16:33:09 +00:00
Kazan 670a6e21d7 fix a small multibug in tables validation (I had added this once before.. where did it go) 2004-07-12 14:38:13 +00:00
wmcoolmon 840a8fe5ab More in-game stuff, mostly for restricted games 2004-07-12 03:34:55 +00:00
wmcoolmon 027f21c616 Only send ships on the player's team 2004-07-12 03:26:03 +00:00
Kazan c2882fef09 removed a couple pointless useless messages from the debug console 2004-07-12 03:19:17 +00:00
wmcoolmon ea8bdaae4c ... 2004-07-12 03:04:33 +00:00
wmcoolmon 923e274002 Oops. :p 2004-07-12 03:04:03 +00:00
wmcoolmon a7c3be5299 Ingame joining stuff - use -rt to enabled/disable 2004-07-12 02:50:48 +00:00
bobboau a3422b4d01 added the working decal code 2004-07-11 03:22:54 +00:00
wmcoolmon cb663c76fd Fixed bug with the base ship flag I unwittingly introduced. 2004-07-10 08:03:13 +00:00
Kazan a149ccadad minor bugfixes - oh yeah reenabling a rule for multistats :P 2004-07-10 03:18:23 +00:00
Kazan 7b0a84765e fs2netd 1.0 RC5 full support - Rank and Medal updates 2004-07-09 22:05:32 +00:00
wmcoolmon 68be530ccb Fixed conditional. 2004-07-09 07:32:55 +00:00
wmcoolmon b692956bb3 Fixed HUD escort list for dogfight mode, and for any usage. 2004-07-09 05:53:05 +00:00
wmcoolmon a78be991c9 Re-implemented nomotiondebris, as Bobb overwrote it when he commited his changes. 2004-07-09 05:52:19 +00:00
wmcoolmon f9e86561cf Moved set_current_hud, as well as added a conditional to hud_positions_it; it shouldn't and won't be executed on a standalone server. 2004-07-08 22:08:21 +00:00
wmcoolmon 506d8cfef8 Moving set_current_hud, to ensure compatibility with multiplayer. 2004-07-08 22:06:56 +00:00
Kazan 8c4f1d075a fixed a typo in one of the fs2netd strings
played with WMCoolmon's hacked up escort list
2004-07-07 23:34:08 +00:00
Kazan 5e64177b98 FS2NetD: C2S Ping/Pong, C2S Ping/Pong, Global IP Banlist, Global Network Messages 2004-07-07 21:00:08 +00:00
Kazan 4267ef6b23 minor multi fix 2004-07-06 23:45:34 +00:00
Kazan 5f998b51b1 small multifix 2004-07-06 19:59:37 +00:00
bobboau 97a5c86641 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.
2004-07-05 05:09:21 +00:00
wmcoolmon 75de78014d Replaced some more Int3s with Warnings and Errors. 2004-07-03 08:23:00 +00:00
wmcoolmon 7310682fd7 Error handling for fire_beam instead of just calling Int3() 2004-07-03 07:55:22 +00:00
wmcoolmon 6ab6c14978 Removed function pointer w/ default arguments for compatibility with .NET Sorry, you'll just have to add that "0" by hand. :p 2004-07-03 06:08:54 +00:00
Kazan f90f1a4ad0 working on autonav 2004-07-01 16:38:19 +00:00
phreak 8830b8d266 function pointer radar update.
will enable us to make different radar styles that we can switch between
2004-07-01 02:07:54 +00:00
phreak c565876ce1 function pointer radar update.
will enable us to make different radar styles that we can switch between
2004-07-01 01:54:59 +00:00
bobboau 2798d7d62b implemented index buffered background bitmaps,
OGL people you realy should get this implemented
2004-07-01 01:12:33 +00:00
wmcoolmon 2c4057c20c Support as well as the extern for "-load_only_used"; this way everything that includes cmdline.h doesn't have to be recompiled. 2004-06-29 06:02:34 +00:00
wmcoolmon e37552357b Added "-load_only_used", which makes FS2 load only used weapon data 2004-06-29 06:00:45 +00:00
wmcoolmon 2c20422772 Fixed weapon miniinfo display 2004-06-28 10:00:33 +00:00
bobboau 69aa1db7ab high level index buffer suport and d3d implementation,
OGL people need to get this working on your end as it's broke now
2004-06-28 02:13:08 +00:00
wmcoolmon 175417d319 Bad return 2004-06-27 01:48:17 +00:00
wmcoolmon e6ce945341 Unneccessary warning removed, small change for VC6. 2004-06-27 01:47:16 +00:00
wmcoolmon eeff56c69b Commented out ogg header 2004-06-27 01:45:23 +00:00
wmcoolmon 26d557f94f Minor optimizations and removal of an errant !stricmp 2004-06-26 19:24:24 +00:00
wmcoolmon cd848eee4d Minor optimizations 2004-06-26 19:23:54 +00:00
wmcoolmon 65a0ca7eec Displayed escorts now settable up to MAX_COMPLETE_ESCORT_LIST via "$Max Escort Ships:" in hud_gauges.tbl
Escort list is now hud_gauges.tbl compatible.
2004-06-26 03:19:53 +00:00
wmcoolmon a88b07b315 Added "-targetinfo" to toggle info next to targeted object. 2004-06-26 00:28:05 +00:00
wmcoolmon 523f09bd78 Basic target info next to targeted object. 2004-06-26 00:27:20 +00:00
wmcoolmon cf122544ab Added teh FS2 ogg support files. Not in the project so you still don't need the SDK. 2004-06-22 23:15:17 +00:00
wmcoolmon b1ab3f347f 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.
2004-06-22 23:14:10 +00:00
wmcoolmon 49a5e1cb29 Added support for -nomotiondebris 2004-06-19 22:16:20 +00:00
wmcoolmon 5e12eb2e79 Added -nomotion debris command line option; also re-ordered categories. 2004-06-19 22:15:48 +00:00
randomtiger 1b84850bdd Changed startup code to catch D3D9 request from launcher.
No actual startup code has been implemented.
2004-06-19 12:45:47 +00:00
wmcoolmon ed78b00a8d Only used weapons paged in instead of all, fixed music box in FRED, sound quality settable with SoundSampleRate and SoundSampleBits registry values 2004-06-18 04:59:55 +00:00
wmcoolmon ce3e4250ed Bumped MAX_MISSION_MESSAGES to 500 2004-06-15 21:05:30 +00:00
wmcoolmon 3dd7af18a8 Bumped MAX_SEXP_NODES to 3500 2004-06-15 21:04:18 +00:00
wmcoolmon ceafaa27de Added hud-set-color and get-current-speed 2004-06-15 20:49:22 +00:00
wmcoolmon 9b7e017b21 hud-set-color SEXP 2004-06-09 00:18:50 +00:00
wmcoolmon 0835b58f68 Fix0red the current target's hud info appearing in the corner of the screen. 2004-06-08 01:12:58 +00:00
wmcoolmon ee590ea3a9 Added +Color: option for custom gauges. 2004-06-08 00:35:43 +00:00
wmcoolmon d19633cab6 Warpout failure bug fixingness 2004-06-07 07:36:08 +00:00
randomtiger dc897e009c Commented out mprintf, it was swamping debug console.
Uncommented some code which I hope has plugged the memory leak.
2004-06-06 20:04:28 +00:00
randomtiger 52f70453a5 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.
2004-06-06 12:25:20 +00:00
randomtiger 36572a5cdb Added pcx compression option -pcx32dds, build posted in RSB forum.
Also removed experimental flag from launcher flag list, stupid people were reporting bugs on unfinished code.
2004-06-06 11:16:42 +00:00
wmcoolmon d9bdcaa848 More HUD update stuff. Coordinates are now floats, addparent is now obsolete. 2004-06-05 23:31:12 +00:00
phreak f21eed24a5 spawn weapons can now be specified to be spawned at different angles other than
the sphere thats used in retail
2004-06-05 19:15:39 +00:00
phreak de2e849fc6 added static_random_cone which is used for spawn angle features in multi 2004-06-05 19:14:42 +00:00
wmcoolmon c6200d568c Lotsa stuff. Custom gauges w/ ANIs support added, SEXPs to set gauge text, gauge image frames, and gauge coords. These SEXPs and toggle-hud reside in the Hud/change category. 2004-06-01 07:31:57 +00:00
wmcoolmon 0fad6f3b27 Update to make images (not animations) work 2004-05-31 08:54:13 +00:00
wmcoolmon f96860d4fd Custom HUD support, better loading, etc etc. 2004-05-31 08:32:25 +00:00
wmcoolmon d816460ccc Final draft of the HUD parsing system structure. May change how individual coord positions are specified in the TBL. -C 2004-05-30 08:04:49 +00:00
wmcoolmon 9bab07b0c9 First bugfix in this!: Don't want Freespace exiting if it can't load a hud_gauge file. 2004-05-29 04:09:04 +00:00
wmcoolmon 3e436b6df6 Added HUD gauges placement table, "hud_gauges.tbl" or "*-hdg.tbm" table module 2004-05-29 03:02:53 +00:00
wmcoolmon a991a8a66e Spotted something that might be a problem. 2004-05-29 03:01:00 +00:00
wmcoolmon 4aa9ef3707 Added stuff_float_list 2004-05-29 02:52:17 +00:00
wmcoolmon 5077abe5cf Modular music tables 2004-05-28 23:37:30 +00:00
wmcoolmon 27efe27525 Made HUD.tbl obsolete. Info is now taken directly from $Shield_icon in ships.tbl
Now this table can be used for something more useful...say, hud gauge positions?
2004-05-27 00:49:26 +00:00
wmcoolmon e6c3498787 Fixed cf_matches_spec; small bug was introduced. 2004-05-26 22:02:36 +00:00
wmcoolmon 22ed91e5ad Added weapons_expl modular table, updated cfilesystem to work with modular tables, fixed loading order, fixed ship loading error messages 2004-05-26 21:02:27 +00:00
wmcoolmon eda69a3959 Ship & weapon modular table files 2004-05-26 03:52:08 +00:00
wmcoolmon 96b2905477 Modular ship table support. Uses *-shp.tbm , with the same structure as a normal ships.tbl. Individual sections are optional and entries with the same name will override previous settings. -C 2004-05-26 02:31:39 +00:00
wmcoolmon a304552353 Scratch that - .tbm is a better extension 2004-05-26 02:29:44 +00:00
wmcoolmon 75dfa3d338 Added table chunk extension 2004-05-26 02:26:14 +00:00
wmcoolmon 024c0d3fb5 Updated function calls for VC7 use 2004-05-25 00:38:11 +00:00
wmcoolmon 99d1d45e56 cleared up an ambiguous call for VC7 2004-05-25 00:26:25 +00:00
wmcoolmon f3c9d133e7 Updated to use <fstream> instead of <fstream.h> and fixed an un/signed disagreement 2004-05-25 00:24:00 +00:00
wmcoolmon 2922a55398 Updated to use <iostream> instead of <iostream.h> 2004-05-25 00:21:39 +00:00
taylor aa4856b956 filename case change 2004-05-24 07:25:32 +00:00
taylor 1ff48adebd filename case change 2004-05-24 07:14:13 +00:00
taylor f19b20a52a The Great Linux Merge 2004-05-24 07:04:25 +00:00
taylor 82e9de536b add .cvsingore files 2004-05-24 04:12:07 +00:00
taylor bcee834735 autoconf/automake cleanup 2004-05-24 04:10:47 +00:00
taylor 5d372e603a disable COLOR_MATERIAL, for nvidia drivers 2004-05-13 00:17:20 +00:00
phreak d1743d3eda got rid of the color material call, nebulas should blind the player 2004-05-12 23:24:35 +00:00
phreak 7511e5c48d don't fog the warp model if its being rendered 2004-05-12 22:50:31 +00:00
phreak d96b07e1fd renamed the warp model variable from 'wm' to 'Warp_model' 2004-05-12 22:49:14 +00:00
taylor 234b0cb8ed do page in unlock but not for gr_preload() stuff 2004-05-11 23:08:55 +00:00
phreak 1daa7187e4 fixed an array bounds error that was causing debug builds to crash when
rendering a ship
2004-05-11 19:39:29 +00:00
phreak 968c2e4816 fixed the white boxes appearing on unlit bitmaps 2004-05-11 16:48:19 +00:00
Goober5000 420233b850 completed the FRED import conversion stuff that I started ages ago
--Goober5000
2004-05-11 02:52:12 +00:00
Goober5000 d5ff291e4a fixed the AWACS help message
--Goober5000
2004-05-10 13:07:22 +00:00
Goober5000 e5629bfedc made primary and secondary banks quite a bit more friendly... added error-checking
and reorganized a bunch of code
--Goober5000
2004-05-10 10:51:54 +00:00
Goober5000 6458c81d39 fixored the handling of no lasers and no engines... the tests should check the ship,
not the object
--Goober5000
2004-05-10 08:03:31 +00:00
Goober5000 f72b734d7a fixed $quote and $semicolon... it was simply a matter of moving the spot where
the replacement occurred
--Goober5000
2004-05-10 06:14:40 +00:00
Goober5000 d731d98c1e fixed warp decision
--Goober5000
2004-05-10 06:11:47 +00:00
phreak 633599cee6 bumped to 3.6!!!! 2004-05-09 23:32:40 +00:00
taylor 5de3360d61 prefer ani over pcx for ship textures 2004-05-09 15:02:00 +00:00
Goober5000 6afa0ee914 small fix
--Goober5000
2004-05-08 01:08:48 +00:00
Kazan ff53a2f7ad Sorry Guys! 2004-05-07 23:50:14 +00:00
Goober5000 e7081e2398 added Righteous1's Y bug hack
--Goober5000
2004-05-07 19:06:45 +00:00
taylor a14adc3d95 ...missed one... 2004-05-06 22:39:37 +00:00
taylor 46a51c3ea8 DDS mipmap reading, remove unneeded bm_unlock() during page in 2004-05-06 22:35:26 +00:00
taylor df3c070dc2 get mipmap count off of DDS textures for later use 2004-05-06 22:31:02 +00:00
taylor 5cc3240fcc fix DDS textures 2004-05-06 22:26:52 +00:00
taylor f1bfa1bdfc make sure JPG and DDS files are added to the file cache for maps and effects 2004-05-06 22:12:14 +00:00
Kazan f3b70b0f56 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)
2004-05-03 21:22:23 +00:00
randomtiger 1fff80dcab fl_abs(theta_goal.xyz.z) < 0.001f is reporting using mprintf now instead of assert 2004-05-03 09:27:16 +00:00
randomtiger f396f88286 Fixed D3D fogging on R7000 2004-05-03 08:41:24 +00:00
taylor 4c3d1233bc don't use HTL line fix with Fred 2004-05-02 16:01:38 +00:00
Goober5000 bc931c35da added a comment
--Goober5000
2004-05-02 03:05:23 +00:00
taylor 60ca06ced0 comment out avi free code for now 2004-05-02 01:26:52 +00:00
randomtiger 6cc8ae76f7 FS2_open will now take flag settings from cmdline_fso.cfg not cmdline.cfg.
This means retail FS2 will not crash because of fs2_open flags.
The new version of the launcher (v5) must used to setup flags now.
Anyone distributing pre 3.6 builds should make this clear and 3.6 should come with Launcher v5.
2004-05-01 22:47:23 +00:00
taylor 73e94dc9b1 add some error handling to vm_strdup() 2004-05-01 21:53:39 +00:00
Kazan b5956ab86e bah! stupid me "NULL" not "null" - i hate when i do that 2004-05-01 21:47:43 +00:00
Kazan d50bf8afed changed delete[] to free(), checked for null, if null ERROR 2004-05-01 21:45:31 +00:00
Kazan 3e60e0bfa2 delete[] str_temp
A null check on str_temp is not needed - take a close look at the for loop
2004-05-01 19:49:31 +00:00
taylor 6beca3c32b add CF_TYPE_MISSIONS to physical check to avoid network transfer problems 2004-05-01 19:33:20 +00:00
Goober5000 4d4e171d0c added an assert
--Goober5000
2004-05-01 17:37:09 +00:00
Kazan 1daeaae91d Multiple -mod - "-mod ModA,ModB,ModC" in order of priority
Giving you:
Root: ModA
Root: ModB
Root: ModC
Root: Fs2Default
Root: CDRom
2004-05-01 17:10:37 +00:00
Goober5000 60eac83870 extra insurance
--Goober5000
2004-04-30 22:20:27 +00:00
Kazan ae174f44c4 Lobby screen only shows when PXO_LOBBY is defined 2004-04-30 18:33:22 +00:00
taylor 43574352c1 fix create game buttons 2004-04-27 20:43:32 +00:00
taylor aca865f8ff add NULL check to game_hacked_data() to prevent crash 2004-04-27 20:41:58 +00:00
Goober5000 af23a3fd9c added back in Kazan's line: now you can slow down in cheat mode
whether you press tilde or not
--Goober5000
2004-04-26 19:50:04 +00:00
Goober5000 b32e508cd0 rolled back Kazan's change
--Goober5000
2004-04-26 19:43:07 +00:00
Kazan d9b1a41cff -no_fps_capping 2004-04-26 18:23:48 +00:00
Kazan 9c4b39258a Be careful when modifying other peoples changes - make sure they still work, and do things the simple way
DON'T TOUCH THE CUSTOM BUILD PATH
2004-04-26 17:27:17 +00:00
taylor a389c72462 forgot to remove some safety checks that aren't needed anymore 2004-04-26 15:51:26 +00:00
taylor 07a76fb1d0 mark view cutscenes ignoring extension and file case 2004-04-26 13:11:11 +00:00
taylor 02b01ae130 cvs log header, mark cutscenes viewable for later, gr_flip() to fix OGL white flash 2004-04-26 13:09:20 +00:00
taylor 52c3de6894 respect -glow and -spec 2004-04-26 13:05:19 +00:00
taylor b8d8e129e2 light setup changes, support cmdline ambient value 2004-04-26 13:02:27 +00:00
taylor 8b4e5c76a1 DevIL stuff 2004-04-26 13:00:56 +00:00
taylor 0e013e4194 convert to dos format, add DevIL stuff 2004-04-26 12:57:47 +00:00
taylor 6f8a0fef97 32-bit targa and jpeg loaders, bug fixes, some preload stuff 2004-04-26 12:44:54 +00:00
taylor ad0a54110f minor fixes, HTL lines, 32-bit texture support 2004-04-26 12:43:58 +00:00
taylor 9c32fa49bd gr_preload() pointer for use in bmpman.cpp 2004-04-26 12:41:46 +00:00
taylor b249d885f5 correct header to keep cvs log, minor changes 2004-04-26 12:39:49 +00:00
taylor 82397f1ca3 use d3_draw_rod() for lightning arcs (for OGL fix), fix debris making HUD in OGL disappear 2004-04-26 12:38:35 +00:00
taylor 002a00827b don't try to load glow maps if they are disabled 2004-04-26 12:37:10 +00:00
taylor c91b801f89 add color and HTL support for g3_draw_rod() 2004-04-26 12:36:10 +00:00
taylor 0eb39a0487 32-bit support with DevIL 2004-04-26 02:14:38 +00:00
taylor 121dad10de initial checkin 2004-04-26 02:05:17 +00:00
taylor baa0bddbb2 initial checkin 2004-04-26 01:58:17 +00:00
taylor 785ef0e926 s/idex/idx/ for brief_unload_anims() 2004-04-26 01:41:52 +00:00
taylor b70c71cf8d better anim free stuff, disable for now to prevent CTD 2004-04-26 01:40:53 +00:00
taylor acfc6f572b use absolute moddir path, faster cfilesystem searching 2004-04-26 00:26:37 +00:00
taylor d74ea38f24 don't preload every sound (fixes some slowdowns), snd_preload option support 2004-04-26 00:25:08 +00:00
taylor 46253ef884 novbo and snd_preload cmdline options, fix moddir getting appended space 2004-04-26 00:23:26 +00:00
Goober5000 bf9da3fe00 made time dilation only available in cheat mode; also fixed an obscure CTD
--Goober5000
2004-04-25 06:31:53 +00:00
Kazan 92c0a64e6f Fixed Lobby screen showing up while exiting from non-tracker games
Time dialiation up to 1/4
2004-04-24 15:44:22 +00:00
randomtiger 477edade7a Added -2d_poof command which allows access to 2D poof rendering
Added -radar_reduce to launcher flag description structure
2004-04-18 19:39:13 +00:00
taylor 316e357f56 let language reg setting override auto detection 2004-04-14 23:17:26 +00:00
taylor a587832a5a render lightning unlit so that it works in OGL 2004-04-14 10:27:24 +00:00
taylor de2409e3b0 don't page in neb poofs unless in a neb2 mission, fix OGL whiteout issue 2004-04-14 10:25:50 +00:00
taylor 24cbf23a19 fix for lines and shaders - shouldn't be textured 2004-04-14 10:24:51 +00:00
taylor 202329fc2a fix extra large model with -ship_choice_3d in OGL 2004-04-14 00:37:36 +00:00
Goober5000 e8d124359c fixed the custom hitpoints subsystem bug
--Goober5000
2004-04-13 05:42:45 +00:00
phreak 96f1d08a48 put in the correct fields for the CVS comments to register
fixed a glowmap problem that occured when rendering glowmapped and non-glowmapped ships
2004-04-13 01:55:41 +00:00
randomtiger 07686ee5b2 Adding batching functions here and there and into gr_screen for use with OGL when its ready. 2004-04-11 13:56:33 +00:00
randomtiger 6ad2af811d Fixed movie playing code for fresh install. Removed NO_DSHOW_CODE paths. 2004-04-11 13:43:26 +00:00
Goober5000 d5d8b729c0 quashed the slider bug!
--Goober5000
2004-04-10 16:55:45 +00:00
Goober5000 1541101eb2 some formatting 2004-04-10 16:55:23 +00:00
phreak ad75e90b8e moved an assignment statement inside an #ifdef block so dds works in release mode 2004-04-09 20:32:31 +00:00
phreak 3fde89bebc fixed DDS not working in OpenGL. there was a misplaced Assert() 2004-04-09 20:07:56 +00:00
phreak 4638bb78e1 got rid of some compile warnings 2004-04-08 20:13:17 +00:00
righteous1 a56ee4b6a2 Backing out mainhall audio fix attempt. 2004-04-08 05:00:13 +00:00
phreak 10e8d7df59 changed around the order of some function calls to get the target model
properly rendering in the hud targetbox
2004-04-07 17:20:24 +00:00
righteous1 5b485200de Updated to call alt_tab_pause() function to draw pause screen and discontinue sounds when the game is minimized. -R1 2004-04-07 03:32:45 +00:00
righteous1 59c2fab09d Updated to add alt_tab_pause() function to draw pause screen and discontinue sounds when the game is minimized. -R1 2004-04-07 03:31:53 +00:00
Goober5000 bbef08ce02 code.dsp should definitely have browse info checked
--Goober5000
2004-04-06 16:25:06 +00:00
Goober5000 1eeca3c3f9 commented out one of Bobboau's hacks because it was messing stuff up
--Goober5000
2004-04-06 16:19:11 +00:00
Goober5000 5c066e259a ugh - added back in something that Bobboau removed
-Goober5000
2004-04-06 05:42:49 +00:00
phreak 9adfa4226f oops, hanging ')' 2004-04-06 05:28:07 +00:00
phreak f808f46118 properly commented Local SSM code.
put in some estimation code so the Local SSMs warp in closer to moving ships
2004-04-06 05:26:59 +00:00
phreak ccee36c720 Local SSMs now working again after the code for setting the jumpout/jumpin
times for the missile were removed.
2004-04-06 04:53:21 +00:00
phreak d9ef57bbdd added a control config option for the wireframe hud targetbox i enabled ages ago 2004-04-06 03:09:53 +00:00
phreak 4c8c1b4ca4 removed gropenglw32x.cpp (obsolete) and gropengl2d.cpp (unused and accidentaly committed) 2004-04-06 01:51:36 +00:00
phreak 63627becda added comments (terms of use, commit history) to the tops of files 2004-04-06 01:37:21 +00:00
Kazan c8889d06a1 make custom build work again 2004-04-06 01:11:41 +00:00
phreak ab202a4cbd OpenGL files spilt up to make developing and finding bugs much easier 2004-04-03 20:29:53 +00:00
Kazan ea69ac448f FRED fixes 2004-04-03 18:11:21 +00:00
Goober5000 3e3bb4a80d fixed some stub functions and a bunch of compile warnings
--Goober5000
2004-04-03 06:22:33 +00:00
bobboau dc29468e31 commiting recent minor bug fixes 2004-04-03 02:55:50 +00:00
randomtiger 32aca5283a Changed D3D secondry texture system to be off by default to save mem.
Added some friendly names for parameters.
2004-04-02 18:25:16 +00:00
taylor 41eecb2255 don't use interface anis as ship textures 2004-04-01 15:31:22 +00:00
taylor 4b19143946 close out briefing menu bitmaps before entering mission 2004-04-01 15:29:39 +00:00
taylor 0816cb182c don't load all starfield bitmaps on level load 2004-04-01 15:28:42 +00:00
Goober5000 c7e9c9934d got rid of all those nasty warnings from xlocale and so forth; also added comments
for #pragma warning disable to indicate the message being disabled
--Goober5000
2004-03-31 05:42:29 +00:00
Goober5000 e7830cda37 got rid of Bobboau's SAFEPOINTs in hudtarget.cpp
--Goober5000
2004-03-31 04:24:49 +00:00
taylor 87c33ceff4 handle movie file extensions better 2004-03-30 08:30:38 +00:00
phreak 2e8465e3ab fixed a minor bug where the version checker
would complain even if the correct version of OpenGL was present
2004-03-29 02:24:20 +00:00
taylor 780c43a94e runtime language selection, mantis:0000133 2004-03-28 17:49:55 +00:00
randomtiger 5b3850bac3 Movies now use win32 calls to clear the screen before playback. 2004-03-27 23:23:36 +00:00
randomtiger cbccf655fa Committed possible fix to cutscene listing problem in techroom, as described in mantis. 2004-03-27 22:27:07 +00:00
randomtiger 83d1c8f524 Bug fix for video playback. 2004-03-21 17:38:18 +00:00
bobboau 8c6001b031 fixed a texture loading bug 2004-03-21 10:34:05 +00:00
randomtiger 662398ed86 Fixed a bug that was causing windowed movie playback and a crash.
Added some batching redirection.
2004-03-21 09:41:54 +00:00
bobboau 766ad441d0 fixed -spec comand line option,
probly some other stuf
2004-03-20 21:17:13 +00:00
randomtiger f188726bb6 Added base for a general dynamic batching solution.
Fixed NO_DSHOW_CODE code path bug.
2004-03-20 14:47:14 +00:00
randomtiger 0b76780762 New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system. 2004-03-19 14:51:55 +00:00
randomtiger 43e30176cf Further D3D texture system simplification. 2004-03-19 12:35:58 +00:00
randomtiger c793909426 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.
2004-03-19 11:44:04 +00:00
bobboau cc41a40735 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
2004-03-17 04:07:32 +00:00
randomtiger 4b4cdb941b Added new launcher flag construction code. 2004-03-16 18:37:02 +00:00
phreak 8834f7297b really fixed opengl shields this time 2004-03-16 17:41:12 +00:00
randomtiger 8371056cc0 Commented out shield fix that broke shield rendering for D3D.
Fix didnt appear to work for OGL so I didnt bother to if(OGL) it.
2004-03-16 11:52:17 +00:00
phreak d9ddfb5019 bumped MAX_SOUNDS to 450 if INF_BUILD is defined 2004-03-12 16:26:39 +00:00
phreak d7bf077d52 bumped MAX_GAME_SOUNDS to 400 if INF_BUILD is defined 2004-03-12 16:23:49 +00:00
Kazan 9fc393c46b irc 2004-03-10 20:51:16 +00:00
Kazan 4ddd8bc2a6 generally it helps if i actually add and commit the files i want to modify on a different system 2004-03-10 19:11:40 +00:00
Kazan dc2634a911 partially complete IRC - so i can work on it on my laptop 2004-03-10 18:45:09 +00:00
Kazan 36fe0fdcd7 Disabled multithreaded TCP_Socket in favor of safer single threaded
FS2NetD doesn't kill the game on connection failure now - just gives warning message and effectively dsiables itself until they try to connect again
2004-03-09 17:59:01 +00:00
Kazan cf9e49bd01 more fs2netd stuff 2004-03-09 00:02:16 +00:00
phreak 44cc3e4712 fugly hack to get skyboxes working in HT&L. please port stars_draw() to use HT&L
so this hack can be removed
2004-03-08 22:16:32 +00:00
Kazan d1be81e41b Lobby GUI screen restored 2004-03-08 22:02:39 +00:00
phreak b3b539399d fixed a bug so that shields now render in Opengl HT&L 2004-03-08 22:01:29 +00:00
phreak b8df81b56c made a minor logical fix to gr_opengl_tmapper_internal
disabled pcx32 and jpgtga flags if they were defined by the user
2004-03-08 21:57:04 +00:00
phreak 41446bfa4a split the star and space debris rendering loops into their own separate functions
this makes it easier to edit them if we ever need to and it also increases readability
i also brought some variable declarations outside of the rendering loops
2004-03-08 21:55:20 +00:00
randomtiger 04a8944fb2 Added complete stub system to replace software. 2004-03-08 18:36:21 +00:00
Kazan 275bc85169 Did, undo 2004-03-08 15:06:24 +00:00
Kazan d8c44cdacd *crosses fingers* 2004-03-08 15:03:27 +00:00
Kazan 288b3ffc54 [Incomplete] Readd of Software renderer so Standalone server works
Also FS2NetD changes
PS: CVS crashing mid-transaction and leaving stale locks = annoying++
2004-03-08 14:53:11 +00:00
Kazan 8cb52a463f [Incomplete] Readd of Software renderer so Standalone server works 2004-03-07 23:07:20 +00:00
randomtiger aa7ac12a18 If user has stub ani's dshow code will fail gracefully instead of throwing up an error. 2004-03-07 14:02:22 +00:00
bobboau 07a789e9dc fixed motion debris
animated laser textures
and added a new error check called a safepoint, mostly for tracking the 'Y bug'
2004-03-06 23:28:24 +00:00
Goober5000 518f868ca2 weapons now display counts up to 9999, instead of just 999
--Goober5000
2004-03-06 00:19:23 +00:00
Goober5000 a1991faeeb d'oh!
--Goober5000
2004-03-05 23:54:48 +00:00
Goober5000 efc7e5dc25 made awacs only ask for help in the main fs2 campaign
--Goober5000
2004-03-05 23:41:04 +00:00
Kazan 9dfd09f7f2 Fixed mission validation (was returning false positives) 2004-03-05 21:24:53 +00:00
Kazan df040bed16 Fixed mission validation (was returning false positives) 2004-03-05 21:19:39 +00:00
Goober5000 7ef2ab2e39 Uber pass at reducing #includes
--Goober5000
2004-03-05 09:02:13 +00:00
phreak ade89bb72a fixed the lack of ships in the hud targetbox
prevented other functions calls to glColor3ub() from messing
with the color of textures in gr_opengl_render_buffer().  this was causing some
minor rendering bugs
2004-03-05 04:33:09 +00:00
phreak 0ac7262e3d made OpenGl use the matrix api if called by g3_start_**** or g3_done_instance 2004-03-05 04:16:20 +00:00
randomtiger 840c073f40 Think I have fixed dshow window focus error, will tidy code when confirmed. 2004-03-04 20:56:43 +00:00
Kazan 3efc279ae7 LAN works A1 Supar! 2004-03-04 05:57:45 +00:00
Goober5000 e4fe4d0724 preliminary checking of globals.h
--Goober5000
2004-02-28 20:26:10 +00:00
randomtiger c64ccecfc8 Removed a few uneeded if DIRECT3D's.
Set laser function to only render the effect one sided.
Added some stuff to the credits.
Set D3D fogging to fall back to vertex fog if table fog not supported.
2004-02-28 14:14:57 +00:00
Goober5000 fb0b00fabc commented a slide_face_ship that I missed before
--Goober5000
2004-02-28 01:36:20 +00:00
bobboau 6bc70bcde1 fixed a Z buffer error in HTL submodel rendering,
and glow points,
and other stuff
2004-02-27 04:09:56 +00:00
Goober5000 a0f776a657 added DONT_SHOW_WARNINGS compile branch
--Goober5000
2004-02-25 05:53:32 +00:00
Goober5000 731038a55d removed an old function
--Goober5000
2004-02-23 07:45:38 +00:00
Kazan 240ce6b91c FS2NETD License Comments 2004-02-21 00:59:43 +00:00
randomtiger e9b74587e1 Added * to - conversion for start mission code to allow launcher missions with '-' in them.
Currently the parsing code counts that as a flag and messes it up.
2004-02-20 21:58:07 +00:00
randomtiger 402bee3d1d Removed some uneeded code between NO_DIRECT3D and added gr_zbias call, ogl is set to a stub func.
Changed -htl param to -nohtl. Fixed some badly named functions to match convention.
Fixed setup of center_alpha in OGL which was causing crash.
2004-02-20 21:45:41 +00:00
randomtiger 6c3a22dc8b Changed memory leak detection to happen after atexit all other calls.
This will mean it doesnt report leaks that are cleared by just before the game quits by preset functions.
2004-02-20 18:04:27 +00:00
bobboau e050aa42c3 pluged memory leaks,
3D HTL lasers (they work perfictly)
and posably fixed Turnsky's shinemap bug
2004-02-20 04:29:57 +00:00
bobboau 0a25d70783 fixing lighting bug I accedently introduced 2004-02-16 21:53:40 +00:00
randomtiger 64f810f2eb Use _REPORT_MEM_LEAKS compile flag in code.lib to get a report of memory leaks from malloc calls. 2004-02-16 21:22:15 +00:00
phreak 6b7f45c845 grr fixed a warning message i didn't see 2004-02-16 16:15:04 +00:00
phreak 33a7e1d944 made the window command line tag recognize non-standard resolutions 2004-02-16 16:09:59 +00:00
randomtiger 7e0ac1dfcd Oops, put two files back in, went a bit too far.
Added NO_DSHOW_CODE as a temp solution to Bobs compiling problem.
2004-02-16 12:53:43 +00:00
randomtiger d52d5cf78c 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.
2004-02-16 11:47:34 +00:00
bobboau 315eded215 fixed sevral asorted matrix errors,
OGL people make sure I didn't break anything,
most of what I did was replaceing falses with (if graphicts_mode == D3D)
2004-02-15 06:02:32 +00:00
bobboau 96a19631f1 fixed bug involving 3d shockwaves, note I wasn't able to compile the directshow file, so I ifdefed everything to an older version,
you shouldn't see anything diferent, as the ifdef should be set to the way it should be, if it isn't you will get a warning mesage during compile telling you how to fix it
2004-02-15 03:04:25 +00:00
Goober5000 6f5ba639ed hmph... fixed some bugs
--Goober5000
2004-02-14 04:26:58 +00:00
randomtiger 19bef23d16 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.
2004-02-14 00:18:37 +00:00
randomtiger a4c446a059 Turned off fog in OGL for Fred.
Simulated speech doesnt say tags marked by $ now.
The following are fixes to issues that came up testing TBP in fs2_open and fred2_open:
Changed vm_vec_mag and parse_tmap to fail gracefully on bad data.
Error now given on missing briefing icon and bad ship normal data.
Solved more species divide by zero error.
Fixed neb cube crash.
2004-02-13 04:17:14 +00:00
phreak 98df261305 fixed a bug where the inferno build would get lower limits for MAX_PERSONAS if INF_BUILD was defined 2004-02-12 22:29:55 +00:00
Goober5000 2845421e29 fixed the barracks crash bug
--Goober5000
2004-02-10 21:47:47 +00:00
matt 69818ee7bf Fixed issue with ships being rendered off center
in the HUD target box. Much easier than I
thought
-- Sticks
2004-02-10 05:07:38 +00:00
Goober5000 4284745f34 fixed a small bug in FS1-compatible music
--Goober5000
2004-02-08 03:35:08 +00:00
Goober5000 d44c2db672 fix for undestroyable subsystems
--Goober5000
2004-02-07 05:11:08 +00:00
Goober5000 c4e5e4bad2 hehe, fixed the subsystem compare so it's not destructive :-p
and also fixed the model checking routine
--Goober5000
2004-02-07 01:25:15 +00:00
Goober5000 87b4aab308 made FS2 able to account for subsystem mismatches between ships.tbl and the
model file - e.g. communication vs. communications
--Goober5000
2004-02-07 00:48:53 +00:00
Goober5000 af62956719 tweakage
--Goober5000
2004-02-06 23:17:43 +00:00
Goober5000 bee32d3956 commented my tmap_num Asserts
--Goober5000
2004-02-06 23:00:29 +00:00
Goober5000 d646d576c4 fixed a small HUD bug I introduced
--Goober5000
2004-02-06 22:58:18 +00:00
Goober5000 804c6b5551 fixed a small compatibility bug
--Goober5000
2004-02-06 21:26:07 +00:00
Goober5000 e966d87566 ugh... okay, *really* fixed the head thing this time
--Goober5000
2004-02-06 21:25:43 +00:00
matt 093dbca530 Fix for bad ambient lighting in non-htl -Sticks 2004-02-06 05:55:46 +00:00
Goober5000 56ab08b66a fixed a few random bugs
--Goober5000
2004-02-05 14:31:45 +00:00
Goober5000 8344fdd8d7 fixed the talking head error
--Goober5000
2004-02-05 14:29:33 +00:00
randomtiger 6155d89c49 Small changes, deleted old dshow stuff 2004-02-05 01:41:33 +00:00
Goober5000 ef9e6c785f commented a decal function that someone missed
--Goober5000
2004-02-04 10:14:58 +00:00
Goober5000 546cd60863 changed spec and glow to be off by default; command lines are now -spec and -glow
--Goober5000
2004-02-04 10:14:25 +00:00
Goober5000 e8ae3106de more player ai stuff
--Goober5000
2004-02-04 09:21:36 +00:00
Goober5000 c89af3a84a got rid of unnecessary double semicolons
--Goober5000
2004-02-04 09:02:45 +00:00
Goober5000 1f27a82d03 made code more uniform and simplified some things,
specifically shield percentage and quadrant stuff
--Goober5000
2004-02-04 08:41:04 +00:00
Goober5000 5e72cca3bf fixed Asserts in two places and commented out an unneeded variable
--Goober5000
2004-02-04 04:28:15 +00:00
randomtiger afcd0f031d Fixed OGL fogging in HTL
Changed htl laser function to work in D3D, commented out until function flat bug is fixed
2004-02-03 18:29:30 +00:00
phreak 6f96a71434 commented out decal references 2004-01-31 04:06:29 +00:00
phreak dc33567316 changed "now" to unsigned int 2004-01-31 03:56:46 +00:00
phreak db7df6a934 commented out decal references 2004-01-31 03:54:50 +00:00
phreak 3dccd906b0 commented out file pending rewrite 2004-01-31 03:52:41 +00:00
Goober5000 ffbbe7aff8 whew - I just went through all the code I ever added (or at least, that I could
find that I commented with a Goober5000 tag) and added a bunch of Asserts
and error-checking
--Goober5000
2004-01-30 07:39:09 +00:00
randomtiger 5d68bb08e0 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.
2004-01-29 01:34:02 +00:00
phreak 8c9f3d8236 bumped MAX_AI_CLASSES to 30 if INF_BUILD is defined 2004-01-26 23:07:43 +00:00
randomtiger 2db21cd009 Fix to blurring of interface bitmaps from TGA and JPG.
Changes to the pointsprite system, better but not perfect yet.
2004-01-26 20:03:51 +00:00
randomtiger 1ef4ec188d 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.
2004-01-24 15:52:26 +00:00
randomtiger 9e60b3ee26 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.
2004-01-24 14:31:27 +00:00
randomtiger 7c03fdd837 Font and other small changes for Fred 2004-01-24 12:47:48 +00:00
randomtiger 45d32bf358 Fixed serious memory leak causes by use of -pcx32 flag 2004-01-23 00:14:27 +00:00
phreak 8a819826b4 bumped MAX_POLYGON_MODELS to 300 if INF_BUILD is defined. 2004-01-21 17:37:48 +00:00
phreak 809da42da3 added MAX_DRAW_DISTANCE to the ship selection display. This will only take effect if the ani isn't there 2004-01-21 17:37:04 +00:00
phreak baf8a555fe bumped MAX_PERSONAS to 25 if INF_BUILD is defined. 2004-01-21 17:34:31 +00:00
phreak a88a02f67e added MAX_DRAW_DISTANCE constant 2004-01-21 17:33:47 +00:00
phreak 365f79683a added version string message if build is an inferno build 2004-01-21 17:32:05 +00:00
Goober5000 fa827adfed whoops, messed up the speech slightly
--Goober5000
2004-01-20 23:56:28 +00:00
Goober5000 09edaebbee added some initialization to get rid of warnings
--Goober5000
2004-01-20 23:01:52 +00:00
Goober5000 457b7f5d85 got rid of some warnings... it actually looks like Gr_gamma_lookup can be changed
from int to ubyte, because everything that accesses it converts to a ubyte  O.o
--Goober5000
2004-01-20 22:59:09 +00:00
Goober5000 d184558a99 changed the speech stubs to #defines
--Goober5000
2004-01-20 22:50:18 +00:00
Goober5000 89c8d6626f commented the variables in a commented function
--Goober5000
2004-01-20 22:39:06 +00:00
Goober5000 71092135e5 First of all, this should be more readable, second of all, old_fog_color wasn't
initialized and VC++ is complaining.  Someone want to fix this?
--Goober5000
2004-01-20 22:37:44 +00:00
Goober5000 fb9e1d5e58 bumped MAX_SEXP_NODES to 3000
--Goober5000
2004-01-20 22:20:41 +00:00
Goober5000 ba357466f4 er... corrected some inexplicable code... Bobboau, mind explaining?
--Goober5000
2004-01-20 22:13:06 +00:00
Goober5000 84f705b670 heat-seekers now home in on hidden ships
--Goober5000
2004-01-20 22:10:01 +00:00
randomtiger 4205d2b648 *** empty log message *** 2004-01-19 00:57:18 +00:00
randomtiger 9991bd0f9d Some more small changes for Fred OGL 2004-01-19 00:56:10 +00:00
randomtiger 7fe84f909f Few more small changes for Fred OGL 2004-01-18 14:55:08 +00:00
randomtiger bb5afccf1f A couple of FRED_OGL changes. 2004-01-18 14:03:23 +00:00
randomtiger 9c46c6836f Changed the #ifndef FRED I added to #ifndef FRED_OGL so they only effect OGL FRED compile 2004-01-18 13:17:55 +00:00
randomtiger 6c4e48b042 Some small changes to the main codebase that allow Fred_open OGL to compile. 2004-01-17 21:59:56 +00:00
Goober5000 e2253ae5f5 I think this will fix the problem of the death head ani sometimes incorrectly playing
--Goober5000
2004-01-14 21:12:24 +00:00
Goober5000 5ecf54a969 added error checking for an annoying crash when running an out-of-range
sound; also, Phreak misspelled "tertiary"
--Goober5000
2004-01-14 07:07:14 +00:00
Goober5000 3dff76704a fixx0red a bug
--Goober5000
2004-01-14 06:38:41 +00:00
Goober5000 64b55daf77 made set-support-ship number align with general FS convention
--Goober5000
2004-01-14 06:34:07 +00:00
randomtiger 88a7397972 Added new D3D particle module, will commit the code that uses it when its bug free. 2004-01-13 02:19:59 +00:00
randomtiger 9f8385ceda Added fix for fogging debris in D3D htl. 2004-01-12 21:12:42 +00:00
phreak 76ec27ee01 fixed a null pointer 2003-12-19 05:58:44 +00:00
phreak 373df408ba oops switched the signs in a comparison. thats what was causing debug builds to go haywire 2003-12-18 15:35:52 +00:00
phreak 185a4ae66e added a MAX_BUFFERS_PER_SUBMODEL define so it can be easily changed if we ever want to change the 16 texture limit 2003-12-17 23:25:10 +00:00
phreak 4fbb6f6e6c fixed some logic when dealing with parsing local ssms 2003-12-17 20:38:26 +00:00
phreak 4d0baba496 added ai code for "small only" weapons. works for turrets at the moment 2003-12-17 16:42:20 +00:00
phreak b3f0771bee "small only" weapons flag added. weapon shoots at small ships like fighters 2003-12-17 16:41:25 +00:00
phreak ea210ba10c disabled tertiary weapons support pending a rewrite of critical code 2003-12-16 21:06:21 +00:00
phreak 2b173bd522 disabled tertiary weapons support pending a rewrite of critical code 2003-12-16 20:55:13 +00:00
phreak a2a815701d made gr_set_proj_matrix use the MIN/MAX_DRAW_DISTANCE constants 2003-12-16 20:48:41 +00:00
phreak f68a6176f5 created two constants
MAX_DRAW_DISTANCE = 250000
MIN_DRAW_DISTANCE = 1
2003-12-16 20:42:36 +00:00
phreak 9427f0494a replaced asserts in parse_ship with more descriptive warnings 2003-12-15 21:36:42 +00:00
phreak 9dbdf6f449 made turrets use bob's $shots code 2003-12-15 21:32:59 +00:00
phreak 14ad989e7f upped MAX_WEAPON_TYPES to 300 when INF_BUILD is defined 2003-12-15 21:30:24 +00:00
randomtiger 735f5e199b 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
2003-12-08 22:30:02 +00:00
randomtiger 94ac5d433a D3D now supports loading for DXT1-5 into the texture itself, defaults to on same as OGL.
Fixed bug in old ship choice screen that stopped ani repeating.
Changed all builds (demo, OEM) to use retail reg path, this means launcher can set all them up successfully.
2003-12-05 18:17:07 +00:00
randomtiger 3207e0165d 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
2003-12-04 20:39:10 +00:00
randomtiger 30a2465547 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
2003-12-03 19:27:01 +00:00
Goober5000 390e969586 fixed CVS log header so that changes would update more cleanly
--Goober5000
2003-12-02 03:16:16 +00:00
randomtiger 74c183a2cc Undid my node fix, it introduced a lot of bugs, update again if you have that version. 2003-11-29 17:13:54 +00:00
fryday 273b4ca528 Fixed normal loading in OpenGL HT&L.
Fixed lighting in OpenGL HT&L, hopefully for the last time.
Added a test if a normal is valid during model load, if not, replaced with face normal
2003-11-29 16:11:46 +00:00
randomtiger 1923156d28 Small changes to D3D setup 2003-11-29 15:48:11 +00:00
randomtiger 22d4bfe51e Rendering jumpnodes in htl via the old system to make them display again, appears to be so cheap it wouldnt be worth the effort to convert it to true htl. 2003-11-29 14:54:35 +00:00
randomtiger e63d3ed8b1 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.
2003-11-29 10:52:10 +00:00
fryday 772de2a9d2 Got lasers to work in HT&L OpenGL
Messed a bit with opengl_tmapper_internal3d, draw_laser functions, and added draw_laser_htl
2003-11-25 15:04:46 +00:00
Goober5000 9100afcbc6 fixed an old omission
--Goober5000
2003-11-25 02:32:16 +00:00
Goober5000 9a38fff930 fixed bug in tech-reset-to-default
--Goober5000
2003-11-24 18:18:00 +00:00
Goober5000 cf7af6a24b fixed a bug introduced by Penguin for running with NO_NETWORK defined
--Goober5000
2003-11-23 00:59:01 +00:00
fryday ba0927f69f Changed default alpha value for lasers in OpenGL to be like in D3D
Fixed Glowmaps being rendered with GL_NEAREST instead of GL_LINEAR.
Dynamic Lighting almost there. It looks like some normals are fudged or something.
2003-11-22 10:36:32 +00:00
phreak 42653ac423 changed PLAYER_MAX_DIST_WARNING to 700000 (700km)
changed PLAYER_MAX_DIST_END to 750000           (750km)

this makes the playing field much bigger
this way you don't get the "return to the field of battle messages"
in the future we should have the mission designer set this limit
2003-11-21 22:30:45 +00:00
randomtiger d18ad3ac24 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.
2003-11-19 20:37:25 +00:00
bobboau 065ac67581 got assert to work again 2003-11-17 06:52:52 +00:00
bobboau 5a2ec84253 made the poly list dynamicly alocated,
started work on fixing the node model not rendering,
but most of that got commented out so I wouldn't have to deal with it
while mucking about with the polylist
2003-11-17 04:25:58 +00:00
Goober5000 514ec25eb9 clarified and pruned debug spew messages
--Goober5000
2003-11-16 09:42:38 +00:00
Goober5000 4c165d76ef language 2003-11-16 04:09:27 +00:00
Goober5000 3e7cfa2cf2 fixed briefing scroll and display of "more"
--Goober5000
2003-11-16 04:08:47 +00:00
randomtiger e89dba3e18 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
2003-11-15 18:09:34 +00:00
Kazan 5358cfb5c4 *WARNING* Multi Compatability with previous versions now in question *WARNING*
[But that's ok, i incremented the multi version number the other day so that it will say "you don't have a compatable version"]

I upped the MAX_PACKET_SIZE from 512 to 4096 -- try and bust multi with more than ?130? ships now :D
2003-11-14 22:47:37 +00:00
Kazan 12422861c6 PXO_SID changed from unsigned to signed 2003-11-13 03:59:54 +00:00
Goober5000 4703b4fb52 added Bobboau's real name to the credits, with his permission
--Goober5000
2003-11-12 06:05:00 +00:00
Kazan b3ce7c19d9 (Kazan) /me slaps forehead... make sure things compile before committing.. sorry guys 2003-11-12 00:44:52 +00:00
Kazan f7c7b28b3b A few multi tweaks - fixed a couple warning-killing collisions between goober and me (kazan) 2003-11-12 00:31:45 +00:00
phreak caac0815dc changed g3_done_instance() calls to take a parameter to pop the T&L matrices 2003-11-11 18:12:41 +00:00
phreak 609188df0c made some functions that are there for 2d drawing not modify T&L matrices 2003-11-11 18:06:49 +00:00
phreak 16b11cc1c8 support for GL_ARB_vertex_buffer_object. should run real fast now with _VERY_
high poly ships
2003-11-11 18:05:02 +00:00
phreak ced9ba8623 made g3_done_instance take a parameter that decides wether to pop the matrix stack.
without it, underflows would have been caused
2003-11-11 18:04:06 +00:00
phreak 3a7f85da10 made some g3_start_instance_matrix calls not affect any of the HT&L graphics
calls since they were called for internal calculations for 2D stuff
2003-11-11 17:59:27 +00:00
bobboau df0bab0bcf shit load of bug fixing, much of it in nebula and bitmap drawing 2003-11-11 03:56:13 +00:00
Goober5000 401967dd9d ubercommit - basically spelling and language fixes with some additional
warnings disabled
--Goober5000
2003-11-11 02:15:47 +00:00
matt 51a1901726 Fixed the projection matrix issues -Sticks 2003-11-10 02:44:36 +00:00
Goober5000 21656d6636 fixed spelling
--Goober5000
2003-11-09 07:36:52 +00:00
Kazan d9277c0227 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
2003-11-09 06:31:40 +00:00
Goober5000 a8853113c1 edited for language
--Goober5000
2003-11-09 04:09:18 +00:00
Kazan bc8256cfa9 Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
DONT FUCK WITH OTHER PEOPLES INCLUDE PATHS
DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
2003-11-08 22:25:47 +00:00
Kazan d07c181a45 yeah.. why didn't this commit last time 2003-11-08 21:55:03 +00:00
Goober5000 356b397487 fixed a bug in my sexp code
--Goober5000
2003-11-08 04:31:02 +00:00
phreak 4e15f5cb7d reenabled timerbar 2003-11-07 20:55:15 +00:00
randomtiger d688fb033d 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.
2003-11-07 18:31:02 +00:00
Goober5000 4690c01e2a added some credit stuff
--Goober5000
2003-11-07 07:12:21 +00:00
phreak 070fbb9349 fixed up some of the matrix functions that were causing problems
bob: i there is an important change here. i don't know if its going to cause any d3d problems
2003-11-06 22:49:22 +00:00
phreak b86820c4b8 added gr_start_**_matrix() and gr_end_**_matrix() around where 3d stuff is rendered 2003-11-06 22:47:37 +00:00
phreak e14f8a37b3 added gr_start_**_matrix() and gr_end_**_matrix() around where ships are rendered 2003-11-06 22:47:02 +00:00
phreak bf1c595f03 bob's stack functions implemented in opengl 2003-11-06 22:36:04 +00:00
randomtiger ec26db6d70 Added my batching solution for more efficient d3d_string.
Its part of the new grd3dbatch module, most of this isnt in use but it might help out later so I've left it in.
2003-11-06 21:10:26 +00:00
Kazan 98d823a100 slight change to .dsp - leave the damn release target as fs2_open_r.exe already
added myself to credit
killed some of the stupid fscking 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 the hell 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)
2003-11-06 20:22:18 +00:00
matt 180ce17286 Added myself to the credits. -Sticks 2003-11-06 19:35:51 +00:00
randomtiger d3ac81046c Added -d3d_no_vsync command to make turning off vsync optional.
Removed 32bit command, it doesnt do anything.
Made aa multisample reg check safe.
2003-11-03 18:07:26 +00:00
bobboau 6a4a9b8e97 modified trails to render with tristrips now rather than with stinky old trifans,
MUCH faster now, at least one order of magnatude.
2003-11-02 05:50:08 +00:00
bobboau b5497ebcdf new matrix handeling code, and fixed some problems with 3D lit verts,
several other small fixes
2003-11-01 21:59:22 +00:00
Kazan 12d4be057f lil update 2003-10-30 15:30:23 +00:00
fryday 0e7438fce4 Added code to handle MR_NO_ZBUFFER in d3d VB rendering code. 2003-10-30 08:20:36 +00:00
randomtiger b1553e3202 D3D particle flicker fix, also fixes explosions and thruster glows 2003-10-29 18:18:52 +00:00
randomtiger 3df8c973fd Updated timerbar code to work properly, also added support for it in OGL.
In D3D red is general processing (and generic graphics), green is 2D rendering, dark blue is 3D unlit, light blue is HT&L renders and yellow is the presentation of the frame to D3D. OGL is all red for now. Use compile flag TIMERBAR_ON with code lib to activate it.
Also updated some more D3D device stuff that might get a bit more speed out of some cards.
2003-10-29 02:09:18 +00:00
Goober5000 2ecbce19fa tweakage
--Goober5000
2003-10-28 23:59:02 +00:00
randomtiger 6b1b1751ce 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.
2003-10-27 23:04:23 +00:00
randomtiger c4bd0bddd9 Fixed hulls not drawing (with Phreaks advise).
Put my 32bit PCX loading under PCX_32 compile flag until its working.
Fixed a bug with res 640x480 I introduced with my non standard mode code.
Changed JPG and TGA loading command line param to "-t32"
2003-10-26 00:31:59 +00:00
phreak 0b8c242f3c added an INF_BUILD option to bump max sounds to 400 if INF_BUILD is defined 2003-10-25 20:42:19 +00:00
bobboau 5b504cc840 adding FOF stuff,
and fixed a small error in the matrix code,
I told you it was indeed suposed to be gr_start_instance_matrix
in g3_done_instance,
g3_start_instance_angles needs to have an gr_ API abstraction version of it made
2003-10-25 06:56:07 +00:00
phreak 764c8a8a87 fixed some old bugs that reappeared after RT committed his texture code 2003-10-25 03:27:50 +00:00
randomtiger 3d12981ddc 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.
2003-10-24 17:35:05 +00:00
phreak e3e204bcdf added code to render the user-defined skybox 2003-10-23 23:49:12 +00:00
phreak 190147afa3 added code for the mission parser to recognize user defined skyboxes 2003-10-23 23:48:03 +00:00
randomtiger d86faac276 Bobs changes (take 2) 2003-10-23 18:03:25 +00:00
fryday aa04dcdaeb Simplified model rendering, and it fixed up a serious bug on my system in which models with submodels didn't get their hull rendered 2003-10-23 13:53:36 +00:00
phreak 1aa48038a0 commented out some mprintfs that kazan missed 2003-10-22 23:10:14 +00:00
phreak 1cb419f4fc added gr_flip_window back in. its used in FRED 2003-10-21 18:23:15 +00:00
phreak c30f286087 cleaned up a bunch of repeated code 2003-10-20 22:32:37 +00:00
Goober5000 946868c67a added min, max, and avg sexps
--Goober5000
2003-10-20 11:49:18 +00:00
randomtiger c3876df4dd Set gamma to 1.0 when quitting, someone was getting it carrying onto the desktop 2003-10-19 17:44:30 +00:00
phreak 890549c301 clipping planes now work 2003-10-19 01:10:05 +00:00
phreak 797ae8b425 changed gr_start_instance_matrix(void) to gr_start_instance_matrix((vector*, matrix*) 2003-10-18 02:46:45 +00:00
phreak 0222fbab29 edited gr_d3d_start_instance_matrix to make it take a vector* and a matrix*, but it doesn't do anything yet 2003-10-18 02:45:39 +00:00
phreak 139b1acda2 oops! forgot to bracket something off with an if :rolleyes: 2003-10-18 02:43:59 +00:00
phreak 73c340d0cf switched around positions of gr_start_instance_matrix and gr_end_instance_matrix 2003-10-18 01:59:02 +00:00
phreak cf8e621064 hardware transformation is working. now lighting needs to be done 2003-10-18 01:22:39 +00:00
randomtiger caf2178399 Big restructure for D3D and new modules grd3dlight and grd3dsetup 2003-10-17 17:18:43 +00:00
randomtiger 4f39ed5890 D3D now has its own gamma system (stored in GammaD3D reg entry) that effects everything.
Put in Bobs specular fog fix.
2003-10-16 17:36:29 +00:00
Kazan c21809a609 couple more types in species_defs.cpp, also finished up "Da Species Upgrade" 2003-10-16 16:38:17 +00:00
Kazan 86ade3d80e fixed typo in fallback code array index 2003-10-16 01:55:26 +00:00
randomtiger bbd0319330 Added incomplete code to allow selection of non-standard modes in D3D (requires new launcher).
As well as initialised in a different mode, bitmaps are stretched and for these modes
previously point filtered textures now use linear to keep them smooth.
I also had to shuffle some of the GR_1024 a bit.
Put my HT&L flags in ready for my work to sort out some of the render order issues.
Tided some other stuff up.
2003-10-16 00:17:18 +00:00
Kazan 1737d0bcd1 Da Species Update :D 2003-10-15 22:03:27 +00:00
randomtiger 910b9e5516 Implemented hardware fog for the HT&L code path.
It doesnt use the backgrounds anymore but its still an improvement.
Currently it fogs to a brighter colour than it should because of Bob specular code.
I will fix this after discussing it with Bob.

Also tided up some D3D stuff, a cmdline variable name and changed a small bit of
the htl code to use the existing D3D engine instead of work around it.
And added extra information in version number on bottom left of frontend screen.
2003-10-14 17:39:18 +00:00
Goober5000 2d60d16956 tweaked a thingy with FS1-style music to make deciding the style less of a hack
--Goober5000
2003-10-14 16:47:34 +00:00
Goober5000 0410d8f4da commented back in null vector warning, because any code that flags this
is buggy and should be fixed (and it only pops up in release builds anyway)
--Goober5000
2003-10-14 16:27:01 +00:00
matt ec88451660 prelim reworking of lighting code, dynamic lights work properly now
albeit at only 8 lights per object, although it looks just as good as
the old software version --Sticks
2003-10-13 19:39:20 +00:00
Kazan f52f7e3b7b Added Log Comment Thingy to these files 2003-10-13 06:02:50 +00:00
Kazan 4b042fcbeb Removed a bunch of Useless *_printf()s in the rendering pipeline that were just slowing stuff down
Commented out the "warning null vector in vector normalize" crap since we don't give a rats arse
Added "beam no whack" flag for beams - said beams NEVER whack
Some reliability updates in FS2NetD
2003-10-13 05:57:50 +00:00
Kazan 9c5ac6b86f #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) 2003-10-12 03:46:23 +00:00
matt c1fff6095f Added -nohtl command line param to disable HT&L, nothing is IFDEFd
out now. -Sticks
2003-10-10 03:59:41 +00:00
phreak 7cdd01495b grabbed the most current version from: http://oss.sgi.com/projects/ogl-sample/ABI/ 2003-10-08 21:01:21 +00:00
argv f698c34b0c Negative repeat count means repeat indefinitely. A trivial change, it should not break anything. 2003-10-08 06:32:06 +00:00
Goober5000 ed3e3b0e79 fixed some warnings
--Goober5000
2003-10-07 03:43:22 +00:00
Kazan 5fe9505544 Oopsie! Forgot to commit these with the rest of the fs2netd TCP update 2003-10-06 04:33:11 +00:00
phreak 309f9fc217 bug squashing.
preliminary tnl work done
2003-10-05 23:40:54 +00:00
Kazan 5b6ca4220c fs2netd now TCP 2003-10-04 22:42:23 +00:00
phreak 4a093ef6f3 shinemapping completed. it works!
-phreak
2003-10-04 00:26:43 +00:00
Goober5000 bb42e3f3e1 updated FRED to import FS1 default weapons loadouts as well as missions
--Goober5000
2003-09-30 04:05:09 +00:00
Goober5000 4717f0d3ce added the option to import FSM missions, added a replace function, spruced
up my $player, $rank, etc. code, and fixed encrypt being misspelled as 'encrpyt'
--Goober5000
2003-09-28 21:22:59 +00:00
Kazan b179aba75a ##Kazan## Quick little update of fs2netd stuff to resolve a few issues 2003-09-26 15:34:26 +00:00
bobboau 300d5fc2c1 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.
2003-09-26 14:37:16 +00:00
Kazan 9a0493a48d ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
Also D3D8 Screenshots work now.
2003-09-25 21:12:24 +00:00
Kazan c2cfffcfba ##KAZAN## FS2 Open PXO --- W00t! Stats Storage, everything but table verification completed! 2003-09-24 19:35:59 +00:00
Kazan 25daac0184 ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able] 2003-09-23 02:42:54 +00:00
unknownplayer c8d1fb9142 Minor bugfix to the 3D ship code. There still may be some cases where it will
fail to load the model file it needs, but I'm at present mystified as to why.
2003-09-16 13:30:16 +00:00
unknownplayer 7611d4814b Changed the ship selection window to load the 3D FS2 ship models instead
of the custom *.ani files. It just does a techroom rotation for now, but I'll add
more features later - tell me of any problems or weirdness caused by it, or if
you don't like it and want it as an option only.
2003-09-16 11:56:46 +00:00
fryday 468cdf3450 Rollback killed my lens-flare. D'oh. 2003-09-15 12:34:09 +00:00
wmcoolmon cb0002c4e2 Changed "cell" to "Cmdline_cell" -C 2003-09-14 19:02:06 +00:00
wmcoolmon 860a74c63e Changed "nospec" to "Cmdline_nospec" -C 2003-09-14 19:00:36 +00:00
wmcoolmon f32f566219 Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell" 2003-09-14 19:00:02 +00:00
wmcoolmon 8e98865c0a Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C 2003-09-14 18:32:41 +00:00
Goober5000 52afd31304 fixed case-sensitivity bugs and possibly that Zeta wing bug
--Goober5000
2003-09-13 20:59:54 +00:00
Goober5000 3ff0cc78c1 added some minor things, such as code cleanup and the following:
--turrets will not fire at cargo
--MAX_SHIELD_SECTIONS substituted for the number 4 in many places
--supercaps have their own default message bitfields (distinguished from capships)
--turrets are allowed on fighters
--jump speed capped at 65m/s, to avoid ship travelling too far
--non-huge weapons now scale their damage, instead of arbitrarily cutting off
----Goober5000
2003-09-13 08:27:29 +00:00
Goober5000 51b4692afd clean rollback of all of argv's stuff
--Goober5000
2003-09-13 06:02:08 +00:00
Goober5000 8ffae02b63 fixed a bunch of compile-time errors and warnings
--Goober5000
2003-09-12 03:57:01 +00:00
Goober5000 9e8083c95e grr...fixed more stuff
--Goober5000
2003-09-12 03:17:33 +00:00
Goober5000 f623737a98 clarified stuff and tweaked the damage ratio for big ships
--Goober5000
2003-09-12 02:08:57 +00:00
Goober5000 30ca59faf5 why was the bomb commented out?
--Goober5000
2003-09-12 01:43:57 +00:00
Goober5000 addfa03981 added XSTR and fixed readability
--Goober5000
2003-09-12 01:38:13 +00:00
Goober5000 78d74edb77 rolled back _argv[-1]'s supercilious commit -- fyi, INF_BUILD is used by
the Inferno campaign
--Goober5000
2003-09-12 01:23:53 +00:00
Goober5000 d28f7402b3 cleaned up some logic
--Goober5000
2003-09-12 01:12:49 +00:00
argv 879df5f46b Removed #ifdef INF_BUILD -- this is only referenced once, so what the hell is it for? 2003-09-12 01:02:50 +00:00
argv 5b5158178a Minor cosmetic fix. 2003-09-12 00:34:05 +00:00
Goober5000 562683087c nitpicked the number 4 to the constant MAX_SHIELD_SECTIONS
--Goober5000
2003-09-12 00:12:13 +00:00
Goober5000 f038ad0551 made code a bit more readable
--Goober5000
2003-09-11 23:59:32 +00:00
Goober5000 9c12379555 minor fix because initialization is done in various routines
--Goober5000
2003-09-11 23:39:01 +00:00
Goober5000 e848a1588d Rolled back _argv[-1]'s changes to the sexp infrastructure, which would
have broken a huge amount of stuff and created some nasty bugs.
Also commented most of _argv[-1]'s new sexps pending consolidation,
and added a placeholder help entry for the one good sexp.
--Goober5000
2003-09-11 23:21:54 +00:00
argv a5c904c210 New weapon table flags, configurable beam whacking, subsystem display names, new energy system, modified the meaning of big damage. 2003-09-11 19:48:00 +00:00
argv 9cbe6c8742 Random beam slash, new energy system, redefinition of what hurts big ships (beams don't), subsystem display names, configurable beam whacking. 2003-09-11 19:45:34 +00:00
argv c337e4b8d2 Made the EMP flash message look a little better. 2003-09-11 19:44:27 +00:00
argv b29cd59a27 New energy system, fixes, random beam slash, don't slash if targeting a subsystem, surface shields, singular shields, configurable beam whacking, friendly beam fire does full damage. 2003-09-11 19:43:43 +00:00
argv 57570e1458 Fix really nasty crash bug when not all stars table entries have a flare. 2003-09-11 19:39:55 +00:00
argv 0e36d39aa1 New energy system, fixes, apply skill damage scaling to all ships, new energy system. 2003-09-11 19:39:03 +00:00
argv d1ca92017c Fix fast player ships missing the subspace tunnel when jumping out, increased max simultaneous ship explosions to 16, new energy system. 2003-09-11 19:36:20 +00:00
argv 85ab9cbe9a New energy system, ship table flag big guns in front, increase max ship types to 400. 2003-09-11 19:34:29 +00:00
argv 14f6f4cf7a New energy system, singular shield support, some new ship table flags, no draw of thrusters when they are off, fixes. 2003-09-11 19:33:07 +00:00
argv 38966b823a Singular shield support, and a couple of fixes. 2003-09-11 19:28:52 +00:00
argv 175a3af33f All kinds of changes, from AI intelligence to singular shield support. 2003-09-11 19:27:30 +00:00
argv 18d11d1030 Ship flag big guns in front. 2003-09-11 19:26:13 +00:00
argv ccbd3d5020 New energy system. 2003-09-11 19:25:00 +00:00
argv ed58b3b127 All player ships may now carry turrets, not just bombers. 2003-09-11 19:24:11 +00:00
argv 583f156912 Lateral movement speed is now affected by engine power. 2003-09-11 19:23:18 +00:00
argv 93985ab901 Several new sexps, such as power drain control. Also increased maximum sexp operators to 4096, though there may be another limit at 1024. 2003-09-11 19:18:13 +00:00
argv a40b30f45b Singular shield support. 2003-09-11 19:16:45 +00:00
argv 35d5a0c23d Surface shields. 2003-09-11 19:15:29 +00:00
argv a63ec351c4 New energy system, table subsystem flags including beam free by default, subsystem display name. 2003-09-11 19:14:14 +00:00
argv abc2ce88d4 Ship flag2 beam-free-all. 2003-09-11 19:12:40 +00:00
argv 0bda676510 Don't restore saved loadouts on scramble missions. 2003-09-11 19:11:36 +00:00
argv 516274ab81 Crash avoidance, ship flag2 beam-free-all. 2003-09-11 19:10:33 +00:00
argv 6a1546b96b Singular shield support, beam-free-all ship flag2, negative repeat count means repeat indefinitely. 2003-09-11 19:09:44 +00:00
argv fa015588e9 Negative repeat count means repeat indefinitely. 2003-09-11 19:08:11 +00:00
argv 44c5c6cf9e Turret display names. 2003-09-11 19:07:11 +00:00
argv 26328e8ccd Singular shield support, and a couple of other things. 2003-09-11 19:06:27 +00:00
argv d430fc233b New energy system support. 2003-09-11 19:05:10 +00:00
argv dbf498eb91 New energy system, auto ETS, etc. 2003-09-11 19:04:36 +00:00
argv e647340153 Various new command-line options, stuffed into my own Argv_options struct to avoid namespace pollution. 2003-09-11 18:55:23 +00:00
fryday 9df64dfef2 Added Lens Flares, enabled by optional table entry in stars.tbl on a per-sun basis 2003-09-10 11:38:31 +00:00
fryday 01da562732 Fixed specular for dynamic lights, optimized it a bit 2003-09-09 21:26:23 +00:00
matt 672b4b3e13 Broke stars last commit, fixed -Sticks 2003-09-09 17:18:25 +00:00
matt 7173cff56f Added -nospec cmd line param to disable specular -Sticks 2003-09-09 17:10:55 +00:00
Goober5000 0c0fb587dd if player has primitive sensors, hud will not display shield icons or message sender brackets
--Goober5000
2003-09-09 05:51:14 +00:00
randomtiger b74c16d3c0 Checked in new speech code and calls from relevent modules to make it play.
Should all work now if setup properly with version 2.4 of the launcher.
FS2_SPEECH can be used to make the speech code compile if you have SAPI 5.1 SDK installed.
Otherwise the compile flag should not be set and it should all compile OK.

- RT
2003-09-07 18:14:54 +00:00
drevil 4c8ea75d88 Testing commits. 2003-09-07 12:42:46 +00:00
wmcoolmon 3fd5154cdd Added "+Subsystem Repair Ceiling:" after "+Hull Repair Ceiling:" (formerly "+Support Repair Ceiling:" 2003-09-06 20:41:52 +00:00
wmcoolmon 340da39cfc Added ability to limit subsystem repairs 2003-09-06 20:40:01 +00:00
wmcoolmon e3354cbfee Minor bugfix (changed an == to >=) 2003-09-06 19:14:50 +00:00
wmcoolmon cce8493724 Added optional mission parameter "+Support Repair Ceiling", which sets what percentage a support ship can repair a ship's hull to. 2003-09-06 19:09:24 +00:00
wmcoolmon f876bf2cac Made it possible to limit how much support ships repair a ship's hull. 2003-09-06 19:07:31 +00:00
matt 3f5676c408 Minor d3d star popping fix 2003-09-05 22:35:33 +00:00
Goober5000 1527d71131 bah - fixed a dumb bug
--Goober5000
2003-09-05 10:41:48 +00:00
Goober5000 d5822a203c merged num-ships-in-battle and num-ships-in-battle-team, making the
team argument optional
--Goober5000
2003-09-05 05:06:32 +00:00
Goober5000 8d2b742020 merge of Phreak's and my sexp.cpp
--Goober5000
2003-09-05 04:48:03 +00:00
Goober5000 80003037b8 merge of Phreak's and my sexp.h
--Goober5000
2003-09-05 04:39:55 +00:00
Goober5000 86d041d581 well, let's see here...
* persistent variables
* rotating gun barrels
* positive/negative numbers fixed
* sexps to trigger whether the player is controlled by AI
* sexp for force a subspace jump

I think that's it :)
--Goober5000
2003-09-05 04:25:29 +00:00
phreak f0bb987ebb fixed a small bug in num-ships-in-battle-team
added an option to loop sounds played by play-sound-from-file
2003-09-05 02:15:34 +00:00
bobboau 04716e55dd an asortment of bugfixes, mostly with the specular code,
HUD flickering should be completly gone now
2003-08-31 06:00:42 +00:00
phreak c804368f37 added num-ships-in-battle and num-ships-in-battle-team sexp 2003-08-30 21:59:48 +00:00
Goober5000 b8a31619ce bumped version to 3.5.5
--Goober5000
2003-08-30 20:55:09 +00:00
phreak f4a6b33906 fixed some random specular lighting bugs 2003-08-30 14:49:01 +00:00
Goober5000 9f54fe1114 implemented rotating barrels for firing primary weapons
--Goober5000
2003-08-28 20:42:18 +00:00
Goober5000 11bcd10805 trying to commit
--Goober5000
2003-08-28 06:17:29 +00:00
Goober5000 5c1f7e5c19 trying to commit
--Goober5000
2003-08-28 05:46:52 +00:00
Goober5000 a3f2d48869 added percent-ships-disarmed and percent-ships-disabled
--Goober5000
2003-08-27 02:04:54 +00:00
Goober5000 9ba71612a1 added is-ship-type, is-ship-class, lock-rotating-subsystem, and free-rotating-subsystem;
also fixed the argument and return values for various sexps so that they work
properly for negative numbers
--Goober5000
2003-08-27 01:38:00 +00:00
Goober5000 9940d28a07 fixed a strange thing that Bobboau inexplicably put in
--Goober5000
2003-08-27 01:36:22 +00:00
Goober5000 3e22143d10 added extra code to enable playing of FS1 music tracks
--Goober5000
2003-08-25 04:46:53 +00:00
Goober5000 a04f658b1b added replacement of $rank with the player's rank in any string that appears
in-game (same as with $callsign); also bumped the limit on the length of text
allowed per entry in species.tbl
--Goober5000
2003-08-25 04:45:57 +00:00
Goober5000 1377f3304c fixed unreachable code
--Goober5000
2003-08-25 04:39:17 +00:00
bobboau a76ebd336e 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
2003-08-22 07:35:09 +00:00
Goober5000 205b89b7fa bumped max intel entries to 30
--Goober5000
2003-08-22 07:24:07 +00:00
Goober5000 935fd42370 implemented $callsign to add the player callsign in a briefing, message, or whatever
--Goober5000
2003-08-22 07:01:57 +00:00
phreak a9dfeb1ac0 warp effects and fireballs have their own distinct colors 2003-08-22 03:39:35 +00:00
randomtiger f071b8be41 Fixed switching - RT 2003-08-21 20:54:39 +00:00
phreak a6223bf7c7 added specular highlights. still needs shine mapping 2003-08-21 15:07:45 +00:00
phreak 4035c1d69e zeroed out the specular fields since they caused some flickering 2003-08-21 15:04:17 +00:00
Goober5000 21d60243dc yet another attempt to commit dsp files
--Goober5000
2003-08-21 09:00:58 +00:00
Goober5000 d3ae2fe948 fixed set-support-ship sexp
--Goober5000
2003-08-21 09:00:19 +00:00
Goober5000 e28f0bb38c fixed turret text display for non-laser weapons
--Goober5000
2003-08-21 08:31:24 +00:00
Goober5000 a17149a915 ships that have no afterburners will no longer have the afterburner gauge drawn
--Goober5000
2003-08-21 06:31:19 +00:00
Goober5000 6effe38517 primary weapons will now truncate properly at a '#' symbol, just like secondaries
--Goober5000
2003-08-21 06:18:52 +00:00
Goober5000 b458ec8fc7 removed an extraneous thingy
--Goober5000
2003-08-21 06:11:32 +00:00
Goober5000 161da1e84b Ballistic primaries will now deplete ammo correctly - that is, ammo will be
reduced by the number of firing points, not necessarily 1.
--Goober5000
2003-08-21 06:11:09 +00:00
Goober5000 b26ff24d85 "Fixed" the ballistic primary rearm bug. I have no idea how... I have to assume
it's a bug in MSVC.
--Goober5000
2003-08-21 05:50:00 +00:00
wmcoolmon d05b709fb3 Modified find_file_location to speed up file loading. 2003-08-20 08:14:50 +00:00
wmcoolmon 22d476ba2e Made cfile_delete return 0 on failure, 1 on success 2003-08-20 08:12:08 +00:00
wmcoolmon 13be53d104 Added error screens to the barracks and start screens when a pilot file can't be deleted 2003-08-20 08:11:28 +00:00
bobboau 0ace2693ee 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
2003-08-16 03:52:24 +00:00
bobboau fb698a7a28 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
2003-08-12 03:18:34 +00:00
bobboau 86615245e5 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 2003-08-09 06:07:24 +00:00
phreak ea7dfc171f added code to take into account a tertiary reactor pod 2003-08-06 17:50:01 +00:00
phreak a717e8d13a changed the weapon ammo gauges to show additional ammo if a tertiary ammo pod is being used 2003-08-06 17:44:20 +00:00
phreak 3bf90ddac7 since the launcher has a space between 1024 and 768 for the videocard string, i changed the detection to reflect this
also changed intro.mve to intro.avi since we can't use MVEs
2003-08-06 17:42:47 +00:00
phreak d6778bb9c1 since the afterburners are routed through the physics engine, i needed to route the boost pod through here too 2003-08-06 17:39:49 +00:00
phreak 0aa9daafd9 added a thing to set max thrust when tertiary boost pod is engaged 2003-08-06 17:39:04 +00:00
phreak 99e73f948f preliminary work on tertiary weapons. it doesn't really function yet, but i want to get something committed 2003-08-06 17:37:08 +00:00
phreak b1f73372ad changed default texture filtering to GL_LINEAR 2003-08-06 17:26:20 +00:00
phreak 9293801be0 optimized the way cloaking is handled 2003-08-06 17:24:57 +00:00
bobboau 137c211b64 glow maps, for some reason they wern't in here, they should be now,
also there is some debug code for changeing the FOV in game,
and I have some changes to the init code to try and get a 32 or 24 bit back buffer
if posable, this may cause problems for people
the changes were all marked and if needed can be undone
2003-08-05 23:45:18 +00:00
phreak ca6d1ed53d ai now properly uses rapid fire dumbfires 2003-08-03 23:38:08 +00:00
phreak 2815857683 changed some z-buffer stuff so it doesn't clip as noticably 2003-08-03 23:35:36 +00:00
inquisitor 83ec4f7c6b cleanup of old makefile dsws 2003-07-22 14:11:06 +00:00
fryday 784e477788 added fsspeech.cpp fsspeech.h speech.cpp speech.h into code/sound
They include RT's speech code. Add the preprocessor definition FS2_SPEECH to enable text-to-speech at compile-time.
Requires the Microsoft speech SDK Version 5.1 (around 55MB download).
2003-07-19 16:10:48 +00:00
phreak 0c53451f6e fixed a dumb bug 2003-07-16 23:12:44 +00:00
phreak c302bb1409 lighting in the render functions now work for opengl as they do in d3d 2003-07-15 16:09:46 +00:00
phreak ba5b2d2cfa trails now properly alphablend in ogl as it does in d3d 2003-07-15 16:07:12 +00:00
phreak 69fee0a5b2 higher particle limits for opengl. now matched d3d 2003-07-15 16:06:24 +00:00
phreak fb5996b06b the game handles colored laser lighting for opengl now.
this used to be exclusive to d3d
2003-07-15 16:05:33 +00:00
phreak f6dbb169eb the cutscene section in the techroom does not append *.mve onto a filename 2003-07-15 02:58:08 +00:00
phreak a0b8313126 opengl now doesn't try to shutdown when its not running.
could cause problems on startup
2003-07-15 02:53:54 +00:00
phreak add60f26d8 ships now decloak when firing 2003-07-15 02:52:40 +00:00
phreak ec3d8395a6 cloaked ships will reduce brightness with distance 2003-07-15 02:51:43 +00:00
phreak 1575894d9a fixed a warning.
previous cvs message should read: cloaked ship will decloak if a turret fires
2003-07-15 02:51:01 +00:00
phreak 42f5a1c556 cloaked ships now are less visible with distance 2003-07-15 02:41:41 +00:00
phreak ddec102ece fixed problem where beams that ignore shields do not fully damage the target
disabled attenuation for beams, pending rework
2003-07-15 02:39:59 +00:00
phreak 4a166a2751 models that are fully cloaked draw front-to-back 2003-07-15 02:37:59 +00:00
phreak d6c95e36a6 changed the model_setup_cloak() function to allow an alpha value 2003-07-15 02:36:54 +00:00
phreak 797b7cf1c4 added a debug key to cloak targeted ship ~+shift+x 2003-07-15 02:35:59 +00:00
phreak d2f5c9b978 fun work optimizing the cloak effect 2003-07-15 02:34:59 +00:00
randomtiger 4b529848c0 Random Tiger 6/7/2003
fs2_open now uses the registry entry 'VideocardFs2open' instead of 'Videocard' to store its video settings. To run fs2_open now you MUST use the launcher I have provided.

Launcher binary:      http://mysite.freeserve.com/thomaswhittaker/c_code/freespace/Launcher.rar
Launcher source code: http://mysite.freeserve.com/thomaswhittaker/c_code/freespace/Launcher_code.rar

I have also taken the opertunity to fix a few bugs in the launcher and add a new feature to make selecting mods a bit easier.

The launcher now uses some files in the freespace project so it should be put into CVS with the rest of the code inside the 'code' directory (still in its 'Launcher' dir of course). Currently the launcher wont compile since speech.cpp and speech.h arent in cvs yet. But once Roee has checked in that will be sorted.

I have also removed the internal launcher from the D3D8 module.
Please contact me if you have any problems.

When trying to run the exe after updating I get an error parsing 'rank.tbl' but im fairly sure thats nothing to do with me so I'll just have to leave it for now because I'm still using a 56K modem and cant afford to find out.
2003-07-06 00:19:25 +00:00
phreak b61270e607 support for cloaking added. needs a cloakmap.pcx
to cloak the players ship, activate cheats and press tilde + x
some more work can be done to smooth out the animation.
2003-07-04 02:30:54 +00:00
phreak 16d3f993db changes for cloaking implemented 2003-07-04 02:28:37 +00:00
phreak ff63885bc2 added support for cloaking.
i will need to contact someone who knows d3d to get this to work
2003-07-04 02:27:48 +00:00
phreak 28dfd08de6 tilde + x cloaks a ship 2003-07-04 02:26:15 +00:00
phreak 3ba479444b ai now properly fires bomber+ missiles at capital ships. 2003-07-02 03:31:27 +00:00
phreak 5b5a4c4bd4 added support for weapons that only fire when tagged
also added limited firing range for local ssms
2003-06-25 03:21:03 +00:00
phreak 702fc1b0cb added support for weapons that only fire when tagged 2003-06-25 03:19:40 +00:00
phreak fdafdd1bcb changed around ai code to take into account a limited lock range for local ssms 2003-06-25 03:16:32 +00:00
phreak fa8fde6780 weapon energy cheat does not carry over from mission to mission 2003-06-25 03:13:48 +00:00
phreak 61e670b408 display lock triangle for local ssms only if its in range specified in weapons.tbl 2003-06-25 03:13:02 +00:00
phreak 6559cbf8c5 added turret-tagged-specific and turret-tagged-clear-specific sexps 2003-06-19 18:12:12 +00:00
phreak 27b28dc0b5 undefined DBUGFILE_ACTIVE for release builds 2003-06-16 16:39:42 +00:00
phreak cbd422cfb8 fixed a small bug where rotating subobjects wouldn't work on a player ship
also changed "+PBank Capacity:" to "$PBank Capacity:" when parsing
ballistic primaries. goob knows about this
2003-06-16 03:36:08 +00:00
phreak 080ac424f9 fixed a bug where local ssms may miss the warphole when entering subspace 2003-06-14 22:56:17 +00:00
phreak d69cb5a4b7 capital ship turrets that use the "huge" flag will not target bombs
this will prevent large beams from shooting the player if he shoots a bomb at a destroyer
2003-06-14 21:22:42 +00:00
phreak 97d550de8c added a warning that will display if a modder puts in a local ssm that:
is a laser or beam
doesn't home
2003-06-13 15:33:57 +00:00
phreak 7236a2e555 local ssms fired without lock will not enter subspace at all 2003-06-12 21:21:26 +00:00
phreak cee725592e local ssm warpin is now handled better than what i committed earlier 2003-06-12 17:45:54 +00:00
phreak b4dd4e6527 fixed a minor bug where local ssms will warpin at 0,0,0 if their target was destroyed while in subspace 2003-06-12 16:54:06 +00:00
phreak 010cafc687 turrets now properly use local ssms 2003-06-12 16:53:16 +00:00
phreak fb5e002728 i hate to update again so soon, but i forgot to mark hostile local ssms that
were in stages 2 or 4 as warping so their blip color would then be blue
2003-06-11 03:15:17 +00:00
phreak 5101801bbe i hate to update again so soon, but there was a compile warning that i accidently passed over 2003-06-11 03:13:39 +00:00
phreak 49704751cf local subspace missiles are now in game. yay 2003-06-11 03:06:07 +00:00
phreak 955dbfcfff the ai can now use local ssms. they are able to use them at *very* long range 2003-06-11 03:03:16 +00:00
phreak c1f74f1ca9 the radar will not show stage 3 local ssms 2003-06-11 03:01:27 +00:00
phreak b4827254db changed around collision code to handle the possible variance in speeds when using local ssms 2003-06-11 03:00:50 +00:00
phreak 4a912539e9 local ssm stuff for hud.
they are always in lock range due to the subspace drive on them
they also can't be targeted when in stage 3.
2003-06-11 02:59:48 +00:00
phreak 63efc36dfe the real position is now copied in g3_rotate_vertex 2003-06-08 17:39:35 +00:00
phreak 51a9b7dbba added a vector in the vertex struct that stores the real world position
the x,y,z variables do not accurately reflect the real position
this is for opengl fogging
2003-06-08 17:38:21 +00:00
phreak 1e4365fd32 debris is now properly fogged 2003-06-08 17:31:37 +00:00
phreak c0daceabb1 fixed a compile error that was accidently committed 2003-06-08 17:29:51 +00:00
phreak a832944f39 bmp_gfx_get_components now works with 32 bit opengl 2003-06-07 21:08:09 +00:00
phreak 2362ee54e4 fixed minor fogging bug 2003-06-07 20:51:06 +00:00
phreak a217fd3a6d final fix (hopefully) to zero mass value bug 2003-06-04 15:32:54 +00:00
phreak eca3de01ef fixed a small bug
ai_select_primary_weapon may have a null pointer passed to it.
2003-06-04 15:31:49 +00:00
phreak d9a9f9e750 added some code that took advantage of opengl fogging stuff 2003-06-04 15:28:24 +00:00
phreak a556505a19 added Sesquipedalian's kamikaze and not-kamikaze sexps 2003-05-24 16:47:58 +00:00
phreak 8acf855707 defined USE_OPENGL
should eliminate the "unable to init 104" warnings
2003-05-22 19:41:52 +00:00
phreak 5cd16d5bfb fixed *minor* problem where ships that were disabled during warpout were not
registering on sensors
2003-05-21 21:07:31 +00:00
phreak 19112128b7 fixed disappearing ship bug when a ship is disabled during warpout 2003-05-21 20:28:53 +00:00
phreak e5da7d1fbe hud is drawn when in chase camera for player 2003-05-21 20:27:07 +00:00
phreak a023d4c724 improved chase camera code.. you can now fight using this camera 2003-05-21 20:26:07 +00:00
phreak c4b49e52c1 improved glowmap rendering speed 2003-05-21 20:23:00 +00:00
phreak 1362e3a518 clarified an error message in subsys_set 2003-05-15 19:08:24 +00:00
phreak 41f2f2e507 game_loading_callback_init() now displays a user-defined loading screen 2003-05-09 23:54:59 +00:00
phreak 3476c814e4 possible fix to ships with no mass values 2003-05-09 23:53:32 +00:00
phreak 4b297c377e changed around code in parse_mission_info() to support user-defined loading screens 2003-05-09 23:52:01 +00:00
phreak 8c5d957c19 added fields to the "mission" struct to allow for user-specified loading screens 2003-05-09 23:51:04 +00:00
phreak 2575249ae7 fixed old bug that created "mouse trails" during a popup screen
a result of doing something a long time ago that i thought was right, but wasn't
2003-05-07 00:52:36 +00:00
phreak a3071ddef8 if "Show Background" is not set it FRED,
it used to show background bitmaps and suns
not anymore
2003-05-05 21:27:46 +00:00
Goober5000 527d43e28b fixed small bug inadvertently added by Phreak affecting the custom hitpoints
mod; also fixed a small bug in the new disruption mod (disrupting all subsystems,
as opposed to only those within the weapon radius)
--Goober5000
2003-05-05 20:55:44 +00:00
phreak 4cf75eb1a7 minor fred bug fixed 2003-05-05 20:13:07 +00:00
phreak 5c5e0b1a07 added my real name 2003-05-05 19:29:24 +00:00
phreak cdd3cf652a added additional error info incase gr_opengl_flip() fails for some unknown reason 2003-05-04 23:52:40 +00:00
phreak 6e4e1bd791 ABtrails are only processed if they are using a bitmap.
this should be the end of the "missiles without trails" bug
2003-05-04 20:51:14 +00:00
phreak 88addb4c60 bumped MAX_TRAILS to 500 because of afterburner trails 2003-05-04 20:50:06 +00:00
phreak 055353d403 minor fix in gr_opengl_flip()
should be end of the "unable to swap buffer" error
2003-05-04 20:49:18 +00:00
phreak ccf24c31a5 beams can't fire when disrupted.
cycle ends if the beam is firing and shooting ship is disrupted
2003-05-04 20:21:00 +00:00
phreak cf036e2af8 ships that are disrupted now have arcs around them much like the emp effect 2003-05-04 20:08:04 +00:00
phreak 04d6f2039b fixed mispelling 2003-05-04 19:51:28 +00:00
phreak c157c24b62 added multipliers for beam turrets and sensors for disruptor missiles 2003-05-03 23:47:04 +00:00
phreak fae1d11cf7 background stars are now somewhat colored, just here as a sort of useless feature test 2003-05-03 16:58:40 +00:00
phreak 2c271ff1c3 changed around the way disruptor weapons work 2003-05-03 16:48:08 +00:00
Goober5000 458634292a implemented the custom hitpoints mod
--Goober5000
2003-04-29 01:03:24 +00:00
Goober5000 583814f945 fixed some scrolling issues; added scroll bar to mission select
--Goober5000
2003-04-06 03:56:54 +00:00
Goober5000 f99632553d gotta love those compiler errors ;)
fixed those and cleaned up conflicts with the missile-locked sexp
--Goober5000
2003-04-05 20:47:58 +00:00
sesquipedalian 50b8201d0c Recommit of is-missile-locked.
I changed the sexp's category from non-campaign to training, so you may get a conflict with that.
2003-04-05 20:17:23 +00:00
Goober5000 7ba034c182 fixed some fiddly bits with scrolling and ui stuff
--Goober5000
2003-04-05 11:09:22 +00:00
Goober5000 7d53165468 arg - forgot something
--Goober5000
2003-04-05 08:51:04 +00:00
Goober5000 03b969ac12 command briefing scroll buttons implemented :)
--Goober5000
2003-04-05 08:46:51 +00:00
Goober5000 71be2cdfe6 commit to fix the FRED compile error
--Goober5000
2003-04-04 22:11:06 +00:00
Goober5000 8fe330b59a fixed stupid spelling mistake
--Goober5000
2003-03-30 21:16:21 +00:00
Goober5000 c3f9bba534 preliminary work on adding scroll buttons to command briefings
--Goober5000
2003-03-30 21:08:42 +00:00
Goober5000 1a70dcbd48 resolved a nasty bug that caused some missions to crash
--Goober5000
2003-03-30 07:27:34 +00:00
Goober5000 b1e4605bed preliminary work on ai facing sexp
--Goober5000
2003-03-30 04:34:38 +00:00
sesquipedalian c038548f67 Aaaand nevermind... 2003-03-29 11:23:46 +00:00
Goober5000 3f0643a9b2 made beams default shield piercing again
also added a beam no pierce command line flag
and fixed something else which I forgot :P
--Goober5000
2003-03-29 09:42:05 +00:00
sesquipedalian 14b68cabef Added is-missile-locked sexp 2003-03-29 08:52:59 +00:00
Goober5000 66c3a13ed7 yay for limit bumping!
bumped number of battle tracks and briefing/mainhall/credits tracks, both to 30
--Goober5000
2003-03-29 05:18:17 +00:00
Goober5000 6120df56af got rid of an annoying compile warning
--Goober5000
2003-03-28 19:56:02 +00:00
Goober5000 66c5e48b95 added beginning functionality for $Texture Replace implementation in FRED
--Goober5000
2003-03-25 07:03:30 +00:00
Goober5000 328364df88 argh - lol
--Goober5000
2003-03-22 08:17:34 +00:00
Goober5000 e41e8f97e0 bleah
--Goober5000
2003-03-22 07:24:53 +00:00
Goober5000 8e3b1f3405 bugs are bad, mmkay?
--Goober5000
2003-03-22 06:35:37 +00:00
Goober5000 2047aa4ae5 added play-sound-from-table, play-sound-from-file, and close-sound-from-file
--Goober5000
2003-03-22 06:11:51 +00:00
Goober5000 6373887892 changed event_sexp_change_music to event_change_sexp_soundtrack
--Goober5000
2003-03-22 06:06:22 +00:00
Goober5000 8738a13c2f yuck - fixed a nasty error when FRED provides a default value for warp-effect
and explosion-effect
--Goober5000
2003-03-21 08:33:33 +00:00
Goober5000 8c9e40b21e added get-relative-object-*, where * = x, y, and z; these sexps return the
world coordinates of a set of relative coordinates to an object; also, fixed many
places in sexp.cpp so that now sexps can accept other sexps as parameters,
wherease before they weren't able to
--Goober5000
2003-03-21 04:51:33 +00:00
Goober5000 b81f64088a comments
--Goober500
2003-03-20 23:30:03 +00:00
Goober5000 f67379b05d comments
--Goober500
2003-03-20 23:20:46 +00:00
Goober5000 2578faf0ad moved ballistic primary reload sounds to indexes 171 and 172 2003-03-20 22:58:43 +00:00
unknownplayer 507db274f1 Fixed the bug with shields where it would consistently display the low detail
shield regardless of what the setting was. Turns out some OGL person was
quite thoughtless in their use of || instead of the correct && for the situation
so the game would always go for low detail shields because OGL and D3D
can't both be active at the same time!
2003-03-20 09:48:25 +00:00
Goober5000 2e6ec62838 implemented EMP as part of weapon-effect sexp
--Goober5000
2003-03-20 09:17:16 +00:00
unknownplayer 1d91c0dbd1 Modified the command line options so they are all in lower-case characters.
Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
2003-03-20 08:24:45 +00:00
Goober5000 26a0a8467b implemented mission flags for no briefing or no debriefing - yay!
--Goober5000
2003-03-20 07:15:37 +00:00
Goober5000 90e56619cf extended sexps
--Goober5000
2003-03-20 04:27:10 +00:00
Goober5000 f1341cf14c making sexps better
--Goober5000
2003-03-20 00:08:08 +00:00
Goober5000 74f56b2bba bit o' housecleaning
--Goober5000
2003-03-19 23:06:40 +00:00
Goober5000 4b7de188af added some mission flags
--Goober5000
2003-03-19 22:49:32 +00:00
unknownplayer 92da077924 Woohoo! Killed two birds with one stone!
Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
2003-03-19 12:29:02 +00:00
Goober5000 a8ecbb2980 more housecleaning, this time for debug warnings
--Goober5000
2003-03-19 09:05:26 +00:00
unknownplayer 0eb80bb327 Updated the DX8 code to allow it to be run in 640x480 windowed mode. The game will only procede to do so if your registry settings are set to 640x480 to begin with, but this is accomplished simply enough. 2003-03-19 07:17:05 +00:00
Goober5000 72d5aa53e3 added warp-effect sexp
--Goober5000
2003-03-19 06:23:28 +00:00
Goober5000 3b5e63f1c5 added typecasting to get rid of some build warnings
--Goober5000
2003-03-19 06:22:58 +00:00
unknownplayer 6de76f47f0 Fixed up a bug in the code which was causing all mission loads to crash.
As of this update, the DX merge is officially functional and complete within the CVS main branch. Tell Inquisitor we won't need to roll back at all, but Goober5000 needs to go and look at his SEXP code since he messed up a bunch of checking functions with it
2003-03-18 13:38:07 +00:00
unknownplayer 3a7cc9cc63 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. 2003-03-18 10:07:06 +00:00
Goober5000 5b2b6f4b1e added explosion-effect sexp and did some other minor housekeeping
--Goober5000
2003-03-18 08:44:06 +00:00
Goober5000 988b046585 fixed a subtle bug with EMP parsing which probably never happened and never will,
but it's nice to know it's solved :)
--Goober5000
2003-03-18 06:10:14 +00:00
Goober5000 4214c8c99f fixed some misspellings
--Goober5000
2003-03-18 01:44:31 +00:00
Goober5000 974a939d40 pressing Q no longer makes a sound if the player's ship doesn't have shields
--Goober5000
2003-03-17 10:37:32 +00:00
penguin 508026f4a8 Got autoconf to build w/ dx8 libs (for cutscenes). DX8 files must be in C:/dx8 dir for now, will fix later.
Also got rid of the fs2- prefix on the object files.
penguin
2003-03-11 19:00:05 +00:00
phreak d26c56a4b2 worked a hack to fix opengl support with dx8show movies 2003-03-07 01:00:37 +00:00
phreak 3dbe12dbfe added some hacks that shutdown and restore opengl because of cutscenes 2003-03-07 00:15:45 +00:00
Goober5000 ab0a0cbb37 fixed what should be the last bug with bank-specific loadouts
--Goober5000
2003-03-06 09:13:43 +00:00
Goober5000 7bf2515974 rewrote the restricted bank loadout code; it should work now
--Goober5000
2003-03-05 12:38:01 +00:00
Goober5000 75c7f89e73 cleaned out Bobboau's buggy code - about to rewrite with new, bug-free code :)
--Goober5000
2003-03-05 09:17:15 +00:00
Goober5000 0608f193b9 fixed misspelling of "attenuation"
--Goober5000
2003-03-04 04:41:03 +00:00
Goober5000 e946f44853 made error message appear if EMP used without necessary parameters
--Goober5000
2003-03-04 02:25:25 +00:00
Goober5000 f71b8a2740 fixed custom banks so that they no longer need the ":" between each entry
--Goober5000
2003-03-03 17:15:16 +00:00
bobboau 8a1be5efb8 forgot something 2003-03-03 16:50:14 +00:00
bobboau e30344809f forgot something 2003-03-03 10:29:39 +00:00
bobboau 70696fc427 fixed a bug in the bank specific loadout relaiting to secondaries 2003-03-03 10:21:08 +00:00
Goober5000 2d20fa0ccb fixed the warp effect from always being the knossos type
--Goober5000
2003-03-03 09:53:32 +00:00
Goober5000 b50516343e changed "Subspace node activated" message to "Subspace drive activated"
--Goober5000
2003-03-03 09:31:59 +00:00
Goober5000 4e8174b0e8 fixed the tech room bug! yay!
--Goober5000
2003-03-03 04:28:37 +00:00
inquisitor fb38850485 Readme word doc
-Inquisitor
2003-03-02 18:25:49 +00:00
Goober5000 1431e1d1d8 commented an unneeded variable
-- Goober5000
2003-03-02 17:19:45 +00:00
penguin 6d0e2fec80 Added type for static var
- penguin
2003-03-02 07:39:34 +00:00
penguin cb8ef47709 file needed by automake 2003-03-02 06:58:45 +00:00
penguin fc4923df25 file generated by autoconf 2003-03-02 06:49:23 +00:00
penguin b64f4d9312 Use multimedia headers in local dir, not system's (headers are not present in MinGW distribution)
- penguin
2003-03-02 06:37:24 +00:00
penguin ff7d11234c Added multimedia headers not present in MinGW distribution
- penguin
2003-03-02 06:28:12 +00:00
penguin 1c38ebbf66 Tweaked for gcc
- penguin
2003-03-02 06:25:31 +00:00
penguin 5b620ab6f4 Made a debug error message less confusing
- penguin
2003-03-02 06:10:58 +00:00
penguin 91eb23c859 Added versions of _outp() and _inp() for gcc.
- penguin
2003-03-02 06:04:00 +00:00
penguin fc5f42d677 Added newline at end of file to keep gcc from complaining.
- penguin
2003-03-02 06:03:01 +00:00
penguin b684404c43 Added #ifdef WIN32 and #ifdef MSC_VER
- penguin
2003-03-02 06:01:55 +00:00
penguin fa45233e73 Added #ifdef WIN32 around non-standard header file io.h
- penguin
2003-03-02 05:56:56 +00:00
penguin e15dc894fe Moved Gr_scaler_zbuffering definition to top of file
- penguin
2003-03-02 05:55:51 +00:00
penguin 57fae5f5d0 ANSI C++ - namespace clash on ai_rotation; renamed type to ai_rotation_t
- penguin
2003-03-02 05:54:23 +00:00
penguin 6a0e52c863 Added gcc-compatible asm blocks
- penguin
2003-03-02 05:46:28 +00:00
penguin 0d7964b62b 1. Added gcc-compatible asm code.
2. Added #ifndef NO_SOFTWARE_RENDERING
 - penguin
2003-03-02 05:45:04 +00:00
penguin 59a22006b9 ANSI C++ - fixed non-compliant casts to unsigned short and unsigned char
- penguin
2003-03-02 05:43:49 +00:00
penguin 335408b5d5 Added some #ifndef NO_SOFTWARE_RENDERING
- penguin
2003-03-02 05:41:52 +00:00
penguin 50a45e1c08 Abort if unimplemented asm section is called
- penguin
2003-03-02 05:40:28 +00:00
penguin ad32a0ee91 Added #ifdef _MSC_VER to MSVC-specific code
- penguin
2003-03-02 05:30:26 +00:00
penguin 73a75798a6 only define min() and max() if they're not already defined
- penguin
2003-03-02 05:27:44 +00:00
penguin d6886396ac defined FX_ENTRY and FX_CALL for gcc
- penguin
2003-03-02 05:26:23 +00:00
penguin 13b3b59fff 1. Renamed or, og, ob vars to o_r, o_g, o_b ("or" caused gcc to choke).
2. Added #ifndef NO_SOFTWARE_RENDERING around software rendering code
3. Added #ifdef _MSC_VER around MSVC-specific exception handing code
 - penguin
2003-03-02 05:23:34 +00:00
penguin 313323f149 Moved "extern int wm" declaration inside the header #ifdef block
- penguin
2003-03-02 05:12:39 +00:00
penguin a48c33a2a2 Added #ifdef _MSC_VER around strange exception-handling code
- penguin
2003-03-02 05:10:42 +00:00
penguin 48b19f764c ANSI C++ changes
- penguin
2003-03-02 05:07:12 +00:00
penguin 615a687127 Removed -- this was the old Linux makefile. GNU-style makefiles are now generated by autoconf/automake
- penguin
2003-03-02 05:03:11 +00:00
penguin 607adfff39 New files for autoconf/automake support.
- penguin
2003-03-02 04:53:46 +00:00
Goober5000 93e32d0854 bumped alternate names from 10 to 25
--Goober5000
2003-03-02 02:10:11 +00:00
Goober5000 742c4c1484 fixed the initial status bug 2003-03-01 01:15:38 +00:00
bobboau 0806e440db fixed the bug with fighter beams not giveing you kills 2003-02-26 02:56:55 +00:00
bobboau 08dd102c24 fixing my bug fix for the warp model, and not being able to find it 2003-02-25 16:46:01 +00:00
bobboau 417e500307 doh... forgot something in the beam rendering code 2003-02-25 07:15:07 +00:00
bobboau 03fb48d8aa fixed a bunch of fighter beam bugs,
most notabley the sound now works corectly,
and they have limeted range with atenuated damage (table option)
added bank specific compatabilities
2003-02-25 06:22:50 +00:00
inquisitor bbd8f8ce3e added dxguid, ddraw, and strmiids.lib 2003-02-24 02:01:49 +00:00
inquisitor d221fa35c0 added dxguid, ddraw, and strmiids.lib 2003-02-24 01:25:11 +00:00
wmcoolmon 8407fade43 Refixed the splash screen loading code so that it still works with the demo VPs (Loading "2_PreLoad" and "PreLoad") and put logo support back in. Logo support does nothing unless "PreLoadLogo" and/or"2_PreLoadLogo" exist within the search path. 2003-02-23 20:55:57 +00:00
wmcoolmon 769f9334a2 Uncommented the sections of code that actually played a movie for a given mission. (Removed when daveb cleaned out the movie code for the release) 2003-02-23 03:13:03 +00:00
wmcoolmon 04858a66f3 Added cutscenes/movie.cpp(.h) and directx/dx8show.cpp(.h), which contain movie playing code. Don't compile these if you don't have the DX8 SDK. 2003-02-22 04:24:59 +00:00
wmcoolmon c0217891ff DirectX-specific code for movie-playing functions in cutscenes/movie.cpp. Ask RT if you have any questions about it; I just commited it :). 2003-02-22 04:20:47 +00:00
wmcoolmon a286cdd2a3 Movie playing code; use movie_play and movie_play_two to play movies using Directshow. Depends on directx/dx8show.cpp 2003-02-22 04:17:58 +00:00
wmcoolmon 5d79b222cf Added "os_app_activate_set" 2003-02-22 04:14:21 +00:00
wmcoolmon c26df5cbd5 Added "-dshowvid" command-line option, which must be set in order for movies to play. 2003-02-22 04:13:17 +00:00
phreak 61a409aef1 stupid typo -- my bad 2003-02-16 19:00:56 +00:00
phreak cbc3f3fb09 fixed typecasting warnings 2003-02-16 18:55:59 +00:00
phreak 217955d6d0 fixed around splash screen
2_splash.pcx is loaded in 1024x768
splash.pcx is loaded in 640x480 or 2_splash.pcx isn't found
2003-02-16 18:53:59 +00:00
phreak 1de695fef9 tweaked some more stuff 2003-02-16 18:43:13 +00:00
bobboau 013930bc99 added glow map nebula bug fix for d3d, someone should add a fix for glide too
more importantly I (think I) have fixed all major bugs with fighter beams, and added a bit of new functionality
2003-02-16 05:14:29 +00:00
Goober5000 f28334f782 fixed version bumpage... the version is 3.5.0, not 3.50.0 ;)
--Goober5000
2003-02-05 07:04:31 +00:00
Goober5000 555a830058 made my fighterbay code more forgiving of eccentric modeling hacks...
ships can now use the Faustus hangar again :)
--Goober5000
2003-02-05 06:57:56 +00:00
phreak aa92a9c131 started to finalize before 3.50 release.
added support for GL_EXT_texture_filter_ansiotropic
2003-02-01 02:57:42 +00:00
phreak b7450e15f0 bumped to 3.50 2003-01-30 23:24:34 +00:00
phreak 594bfddf7b cleaned up debug output 2003-01-30 23:19:33 +00:00
phreak aa412718e4 enabled RGB lighting for OpenGL 2003-01-30 23:19:14 +00:00
Goober5000 37e4dd5bc7 finished up my fighterbay code - ships will not be able to arrive from or depart into
fighterbays that have been destroyed (but you have to explicitly say in the tables
that the fighterbay takes damage in order to enable this)
--Goober5000
2003-01-27 07:46:33 +00:00
DTP 143f252099 Part of bumping MAX_SHIPS to 250 max_ship_types. Server now no more Crashes on kill, when max_shiptypes is above 200. Note Client still cant join. narrowing it down. 2003-01-27 01:12:15 +00:00
DTP 72495ef96d Part of bumping MAX_SHIPS to 250 max_ship_types. Server now no more Crashes on kill, when max_shiptypes is above 200. Note Client still cant join. narrowing it down. 2003-01-27 00:51:46 +00:00
DTP 265628ffb2 temporary fix, added some // so that we can do debug builds. i expect Goober5000 will fix it soon. 2003-01-26 23:30:53 +00:00
wmcoolmon 4aeba649e9 Minor mod to preload screen code, added separate 1024x768 logo
-C
2003-01-26 20:04:32 +00:00
Goober5000 d7a3b618b1 changed change-music to change-soundtrack
--Goober5000
2003-01-26 18:37:19 +00:00
wmcoolmon 7ad0621937 Added title screen support to retail version. When FS2 loads, it will build a list of PCX files in the current directory, then attempt to display one. If no PCX files exist, it will try to display one of the title screens defined in the code. Freespace 2 will then attempt to superimpose a logo in the upper-left hand corner of the screen. If neither can be displayed, FS2 will function normally. 2003-01-26 02:58:33 +00:00
Goober5000 cda3657a3a oops - fixed the nebula bug that wasn't completely fixed :)
--Goober5000
2003-01-26 00:20:01 +00:00
Goober5000 5616cbd065 added preloader to change-ship-model and change-ship-class so that the game
doesn't hesitate when switching models in the middle of missions
--Goober5000
2003-01-25 04:54:36 +00:00
Goober5000 4a5e9969a9 added change-music sexp and bumped MAX_SOUNDTRACKS from 10 to 25
--Ian Warfield
2003-01-25 04:17:39 +00:00
Goober5000 5a23f97266 aw, nuts - fixed a dumb bug with my new don't-collide-invisible code :p
--Goober5000
2003-01-24 03:48:11 +00:00
Goober5000 71d9d1975e fixed a small nebula ship trail bug
--Goober5000
2003-01-24 03:15:11 +00:00
Goober5000 09b61901c5 fixed a few bugs in Bobboau's implementation of the glow sexps; also added
help for the sexps in sexp_tree
--Goober5000
2003-01-21 17:24:16 +00:00
bobboau 67faca1076 added several sExps for turning glow points and glow maps on and off 2003-01-20 05:40:50 +00:00
Goober5000 1d6093cc85 cleaned up build output a bit
--Goober5000
2003-01-19 22:45:35 +00:00
Goober5000 f34be99a5e removed unreferenced variable
--Goober5000
2003-01-19 22:25:10 +00:00
Goober5000 31d970d8ee fixed a bunch of bugs -- the support ship sexp, the "no-subspace-drive" flag,
and departure into hangars should now all work properly
--Goober5000
2003-01-19 22:20:23 +00:00
Goober5000 a60f00ec20 fixed fiddly code
--Goober5000
2003-01-19 09:14:05 +00:00
Goober5000 c3c63dff85 more tweaky bug fixes
--Goober5000
2003-01-19 09:10:40 +00:00
Goober5000 db0c1b2e88 fixed two dumb bugs in the set-support-ship code
--Goober5000
2003-01-19 08:37:52 +00:00
Goober5000 9041337baa actually added the set-support-ship sexp; much of the other commit was
groundwork (data types and stuff)
--Goober5000
2003-01-19 07:45:38 +00:00
Goober5000 55135e0f68 oops - forgot a bit of departure code :)
--Goober5000
2003-01-19 07:13:05 +00:00
Goober5000 341803c8c0 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
2003-01-19 07:02:16 +00:00
Goober5000 6256e4a634 got rid of nameplate stuff (superceded by texture replacement)
--Goober5000
2003-01-19 06:44:39 +00:00
bobboau d4f242427d redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it 2003-01-19 01:07:43 +00:00
Goober5000 512b21ee37 made "no-subspace-drive" applicable to all ships and fixed a really *STUPID*
bug that made FRED keep crashing (missing comma, bleagh!)
--Goober5000
2003-01-18 23:25:39 +00:00
phreak 2306c3057d added 'ddsutils' folder to project 2003-01-18 20:00:49 +00:00
phreak 3320a58a9b fixed around the bmpman system to now accept compressed textures 2003-01-18 19:55:16 +00:00
phreak 34fdcc5355 texture mapper now supports DXTC compressed textures 2003-01-18 19:49:45 +00:00
phreak fc351837a5 added tcache flag TCACHE_FLAG_COMPRESSED 2003-01-18 19:49:02 +00:00
phreak b58dd37100 added some defines that deal with mages using DXTC 2003-01-18 19:48:19 +00:00
phreak 401b6c8f8f these files deal with reading .dds files which use DXTC texture compression 2003-01-18 19:45:20 +00:00
Goober5000 09fef27bf5 added "no-subspace-drive" flag for ships
--Goober5000
2003-01-18 10:00:43 +00:00
Goober5000 c9ea61c266 fixed bug I inadvertently introduced by modifying SIF_ flags with sexps rather
than SF_ flags
--Goober5000
2003-01-18 09:25:42 +00:00
Goober5000 a411961c93 fixed some really strange behavior with strings not being truncated at the
# symbol
--Goober5000
2003-01-17 07:59:09 +00:00
Goober5000 f0899ed35b Allowed selection of either $Texture Replace, which keeps track of individual
replacement textures for a ship, or $Duplicate Model Texture Replace, which
duplicates a model and reskins it.  Use $Duplicate Model Texture Replace
if you want to substitute an animated texture or a transparent texture.
--Goober5000
2003-01-17 04:57:17 +00:00
Goober5000 881306223e added capability to the $Texture replace code to substitute the textures
without needing and extra model, however, this way you can't substitute
transparent or animated textures
--Goober5000
2003-01-17 01:48:50 +00:00
Goober5000 4373cdde4f yay! got texture replacement to work!!!
--Goober5000
2003-01-16 06:49:11 +00:00
Goober5000 dd8fbddae1 NOW the model duplicates work! :p
still gotta do the textures, but it shouldn't be hard now
--Goober5000
2003-01-15 23:23:30 +00:00
anonymous 9cd430eb81 fixed the demo compilation. Define FS2_DEMO globally to compile as a demo. Make sure warp.pof is in your data/models directory. 2003-01-15 21:29:05 +00:00
inquisitor 2d54615c04 Test commit, ignore 2003-01-15 20:49:50 +00:00
Goober5000 9dd2db4400 did the XSTR for the turret thing
--Goober5000
2003-01-15 20:49:10 +00:00
Goober5000 6d3fd14816 oops, that'll introduce a bug - naming it just plain "Turret" instead
--Goober5000
2003-01-15 16:52:27 +00:00
Goober5000 926e57b2bd capship ballistic weapon displays "Cannon" on HUD instead of "Laser Turret"
--Goober5000
2003-01-15 16:48:59 +00:00
Goober5000 1b66a0101e assigning duplicate models to ships now works; committing so I have a base
to fall back to as I work on texture replacement
--Goober5000
2003-01-15 08:57:23 +00:00
Goober5000 22f3dc3889 changed most references to modelnum to use ship instead of ship_info --
this will help with the change-model sexp and any other instances of model
changing
--Goober5000
2003-01-15 07:09:09 +00:00
Goober5000 9dfdd02a3f added texture replacement parse - will be implemented later
--Goober5000
2003-01-15 05:24:23 +00:00
Goober5000 9cb006a325 bumped main halls down to 10
--Goober5000
2003-01-15 05:19:07 +00:00
Goober5000 ff0c118dab moved texture loading around a bit; added Texture_replace in preparation
for some cool stuff
--Goober5000
2003-01-15 05:18:13 +00:00
Goober5000 5f72df9715 argh - fixed the stupid message persona bug with <any wingman>
Bobboau, please check your code!
--Goober5000
2003-01-14 06:13:23 +00:00
Goober5000 43023ce714 commented out some mprintfs that were clogging up the debug spew
--Goober5000
2003-01-14 05:53:58 +00:00
Goober5000 ec4cd287bf fixed minor potential bug
--Goober5000
2003-01-14 04:01:33 +00:00
Goober5000 89d54e88db allowed for up to 256 main halls
--Goober5000
2003-01-14 04:00:16 +00:00
Goober5000 78976694ff bug hunting; fixed the beam whack effect bug
--Goober5000
2003-01-13 23:20:01 +00:00
wmcoolmon be8031165b Added MISSION_FLAG_NO_NEB_TRAILS and removed MISSION_FLAG_ST_OVERRIDE_NEB. Also changed code to set flags as necessary 2003-01-13 02:09:12 +00:00
wmcoolmon 68d003d185 Very slightly optimized code 2003-01-12 03:26:41 +00:00
wmcoolmon 0743bceed4 It turns out the version in the CVS did not toggle the ship trails with the flag...fixed this. 2003-01-12 00:19:55 +00:00
wmcoolmon e7d2f6bfee Added code for "Ship Trails override Nebula" 2003-01-11 01:00:25 +00:00
Goober5000 07ba05b7a6 I found these two beautiful functions in ship.cpp - ship_change_model
and change_ship_type - so I made them into sexps :)
--Goober5000
2003-01-10 04:14:19 +00:00
inquisitor 8ed007424b Rollback to 2.7 to fix glow code issue that phreak noticed.
-Quiz
2003-01-09 22:23:38 +00:00
phreak 1ec16a0dce fixed a small error in bob's glowmap code 2003-01-09 21:22:36 +00:00
phreak 531c34e48c fixed a small error in bob's code 2003-01-09 21:20:21 +00:00
phreak e4906d5051 glowmaps in OpenGL, yay! 2003-01-09 21:19:54 +00:00
phreak 290471b544 glowmaps unloaded if their parent is 2003-01-09 21:19:25 +00:00
Goober5000 81227d877a fixed the giant thruster glow bug
--Goober5000
2003-01-09 05:55:55 +00:00
Goober5000 4320767bc6 snagged a potential bug
--Goober5000
2003-01-09 05:52:25 +00:00
Goober5000 0ce01a077f fixed debriefing music in non-campaign missions
--Goober5000
2003-01-08 19:49:15 +00:00
Goober5000 4587aa1d8d added ai-chase-any-except sexp
--Goober5000
2003-01-07 20:06:44 +00:00
phreak 5541f13c99 fixed problem in win32_create_window() that disabled OpenGL from running in windowed mode 2003-01-07 00:02:08 +00:00
Goober5000 f56a7e8b8d implemented keep-safe-distance
--Goober5000
2003-01-06 22:57:23 +00:00
Goober5000 a9b917211c allowed fighters and bombers to accept the stay-near-ship and
keep-safe-distance orders
--Goober5000
2003-01-06 21:52:58 +00:00
Goober5000 bdb95b3655 nasssty bugs, we hates them, yesss we do, preciousssss
:)
--Goober5000
2003-01-06 20:29:28 +00:00
Goober5000 a67d462b4c cleaned up some stuff with model_set_thrust and a commented Assert that
shouldn't have been
--Goober5000
2003-01-06 19:33:22 +00:00
Goober5000 40e711e493 a wee failsafe added
--Goober5000
2003-01-06 18:50:37 +00:00
Goober5000 c3bf521a0b hmm... moved +Squad Logo to immediately beneath $Name
--Goober5000
2003-01-06 17:19:14 +00:00
Goober5000 3ef1984b40 added wing configurable squad logos - put +Squad Logo: filename.pcx as
the last entry in each wing that you want (but the player's squad logo will
still be the squad logo for the player's wing)
--Goober5000
2003-01-06 17:14:52 +00:00
bobboau 12f8b745d2 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
2003-01-05 23:41:51 +00:00
Goober5000 30cf9c6ac4 added capability of is-iff and change-iff to have wings as well as ships
as their arguments; also allowed a bunch of sexps to accept the player
as an argument where they would previously display a parse error
--Goober5000
2003-01-05 01:26:35 +00:00
Goober5000 b8e5217739 fixed the order sexp
--Goober5000
2003-01-04 23:15:39 +00:00
Goober5000 b53761bbd4 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
2003-01-03 21:58:08 +00:00
Goober5000 99d6040adc this is the way we squash the bugs, squash the bugs, squash the bugs
this is the way we squash the bugs, so early in the morning :p
--Goober5000
2003-01-02 03:09:01 +00:00
Goober5000 ab653af1d9 added don't-collide-invisible and collide-invisible sexps
--Goober5000
2003-01-02 00:35:21 +00:00
Goober5000 a17af66a44 added ship-vaporize and ship-no-vaporize sexps
--Goober5000
2003-01-01 23:33:34 +00:00
Goober5000 64ac1f20ca bumped to 3.4
--Goober5000
2002-12-31 20:09:14 +00:00
Goober5000 54ecd11df2 tweaked stuff
--Goober5000
2002-12-31 19:35:14 +00:00
Goober5000 f7eb18db90 if it ain't broke, don't fix it
--Goober5000
2002-12-31 19:18:41 +00:00
Goober5000 1e8f49d1ef if it ain't broke, don't fix it
--Goober5000
2002-12-31 18:59:43 +00:00
Goober5000 acefe1a8a9 simplified end-user implementation of ballistic primaries
--Goober5000
2002-12-31 08:20:31 +00:00
Goober5000 f01c0616a5 added damaged-escort-priority-all sexp
--Goober5000
2002-12-31 07:26:40 +00:00
Goober5000 04b3c2dae4 fixed escort list behavior for stealthy ships
--Goober5000
2002-12-31 05:17:13 +00:00
Goober5000 16d3193e9b made force feedback stronger when firing ballistic primaries
--Goober5000
2002-12-30 06:16:09 +00:00
phreak aff3972663 added damage-escort-list as a new sexp 2002-12-27 20:16:18 +00:00
Goober5000 1c73dc4cf9 the insidious beam bug is now squashed AND committed!
--Goober5000
2002-12-27 17:58:11 +00:00
Goober5000 ba5816809b removed the existing stealth sexps and replaced them with the following...
ship-stealthy
ship-unstealthy
is-ship-stealthy
friendly-stealth-invisible
friendly-stealth-visible
is-friendly-stealth-visible
--Goober5000
2002-12-27 02:57:51 +00:00
Goober5000 7ec35e1a28 meh - changed is-cargo-x to is-cargo
--Goober5000
2002-12-25 01:22:23 +00:00
Goober5000 b07017dfaf added change-ai-class and is-ai-class, and I think I may also have nailed the
is-iff bug; did some other bug hunting as well
--Goober5000
2002-12-24 07:42:29 +00:00
Goober5000 3cffeb1b7c added a wee cautionary note
--Goober5000
2002-12-24 07:38:59 +00:00
Goober5000 f9dd8f6bbc added set-cargo and is-cargo-x sexps
--Goober5000
2002-12-23 23:01:27 +00:00
phreak 8d6ef8f888 defined USE_OPENGL for debug and release builds 2002-12-23 21:13:41 +00:00
phreak 8931674cb7 dumb typo 2002-12-23 19:25:39 +00:00
phreak 59dba1bb95 added code that displays an error if user's OGL version is less than 1.2 2002-12-23 17:52:51 +00:00
Goober5000 77db458273 Bah - Andsager is a moron. :) I see no reason why rand shouldn't work
multiple times.  It's been fixed thus.
--Goober5000
2002-12-23 05:41:08 +00:00
Goober5000 fedebbd53a Squashed some Volition bugs! :O Some of the sexps for dealing with more than
one ship would return after only dealing with the first ship.

Also added the following sexps:
is-ship-stealthed
ship-force-stealth
ship-force-nostealth
ship-remove-stealth-forcing

They toggle the stealth flag on and off.  If a ship is forced stealthy, it won't even
show up for friendly ships.
--Goober5000
2002-12-23 05:18:52 +00:00
Goober5000 b03fc12235 removed stipulation that "Instructor" be present for training-msg sexp to work
--Goober5000

(This is fun! :))
2002-12-23 01:47:17 +00:00
Goober5000 2d141063b9 hack: turn on ship trails if in nebula - restores backward compatibility
--Goober5000
2002-12-22 22:59:04 +00:00
Goober5000 99dc4fda23 tweaked positioning of the new HUD graphics
--Goober5000
2002-12-22 21:31:01 +00:00
Goober5000 138c0c646c added primaries-depleted and primary-ammo-pct sexps -- useful for ships with
ballistic primaries
--Goober5000
2002-12-22 21:12:22 +00:00
Goober5000 4305d29efd Subcategories implemented. :) So far all that's been done is the Change menu, but other
subcategorizations are possible.  Here are the instructions from sexp.h...
"Adding more subcategories is possible with the new code.  All that needs to be done is
to add a #define here (a number from 0x0000 to 0x00ff ORred with the category that it
goes under), some appropriate case statements in get_subcategory() (in sexp.cpp) that
will return the subcategory for each sexp that uses it, and the submenu name in the
op_submenu[] array in sexp_tree.cpp."

Please note that I rearranged a whole bunch of sexps in the Operators[] array in sexp.cpp
in order to make the subcategories work better, so if you get a whole bunch of differences
or even conflicts, just ignore them. :)
--Goober5000
2002-12-22 17:22:47 +00:00
Goober5000 3427b62b65 commented out the warning if you don't have the new ballistic HUD graphics - it would probably get annoying (just use the old ones without comment)
--Goober5000
2002-12-21 18:03:49 +00:00
Goober5000 eb73f43a64 rearranged the sexp list and got the preliminary subcategories working - still need to work on the actual submenu
--Goober5000
2002-12-21 17:58:11 +00:00
DTP 6d7b143c5b 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 2002-12-21 13:39:25 +00:00
Goober5000 aa0e29d421 Updated the cargo-known-delay and cap-subsys-cargo-known-delay sexps to work correctly if set-scanned and set-unscanned are used repeatedly with the same ship or ship subsystem. In most cases, this functionality will never be needed, but it's nice to know that it's here. :) However, I should point out that cap-subsys-cargo-known-delay will recognize only the first instance of a subsystem being revealed once the ship is no longer in the mission. Here is the relevant bit I put into the sexp handling routine...
"Since there is no way to keep track of subsystem status once a ship has departed or has been destroyed, check the mission log.  This will work in 99.9999999% of all cases; however, if the mission designer repeatedly sets and resets the scanned status of the subsystem, the mission log will only return the first occurrence of the subsystem cargo being revealed (regardless of whether it was first hidden using set-unscanned).  Normally, ships keep track of cargo data in the subsystem struct, but once/ the ship has left the mission, the subsystem linked list is purged, causing the loss of this information.  I judged the significant rework of the subsystem code not worth the rare instance that this sexp may be required to work in this way, especially since this problem only occurs after the ship departs.  If the mission designer really needs this functionality, he or she can achieve the same result with creative combinations of event chaining and is-event-true."

Please note that this problem only occurs with cap-subsys-cargo-known-delay, only if the subsystem scanned status is revealed more than once, and then only after the ship is no longer in the mission.  Sufficiently rare, I figured, that I could afford to not worry about it.
--Goober5000
2002-12-20 07:17:23 +00:00
Goober5000 19ae132431 added capability of storing time_subsys_cargo_revealed
--Goober5000
2002-12-20 07:09:03 +00:00
DTP eb8ee38f08 DTP FIX, fast fix to the beam/shield bug problem. will maybe commit later when i find out why this is getting triggered when it should not 2002-12-20 00:50:41 +00:00
Goober5000 dfd893af4f oops - squashed a bug :)
--Goober5000
2002-12-19 10:54:37 +00:00
Goober5000 31945881ef implemented the revised HUD weapon display for ballistic primaries
--Goober5000
2002-12-19 10:46:14 +00:00
phreak 8fedea6256 tidied up game_init() a bit.. took out a bunch of unneeded ifdefs like E3_BUILD
Added option to access OpenGL from the registry keys.  searches for "OpenGL-"
whoever is in charge of the launcher might want to know this.
2002-12-18 22:21:23 +00:00
Goober5000 af3f74d28f added set-scanned and set-unscanned sexps
PLEASE NOTE: These sexps will cause cargo-known-delay and cap-subsys-cargo-known-delay to not work correctly if set-scanned and set-unscanned are used more than once.  I'll fix this later.

--Goober5000
2002-12-17 03:25:30 +00:00
DTP 9a7d2e8e54 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. 2002-12-17 03:08:18 +00:00
DTP 039cff48ca wrong name :) 2002-12-17 02:22:34 +00:00
Goober5000 d99573079f cosmetic fixed; also OP_SET_SCANNED and OP_SET_UNSCANNED added in preparation for the set-scanned and set-unscanned sexp commit
--Goober5000
2002-12-17 02:21:42 +00:00
DTP f42b56fa94 cleaned up after Goober5000 :). it will make a mess in debug builds. added a couple of ifndef _debugs. 2002-12-17 02:21:06 +00:00
Goober5000 817f9a9741 added functionality and fixed a few things with cargo being revealed and hidden in preparation for the set-scanned and set-unscanned sexp commit
--Goober5000
2002-12-17 02:18:40 +00:00
DTP fe4c454d12 Bumped MAX JUMP-nodes to 50. if anybody wants a Jump-node forest 2002-12-17 01:56:36 +00:00
phreak 3f7f79c703 optimized fullscreen/minimized functions.. alot faster 2002-12-16 23:28:52 +00:00
DTP e778d90ad4 fixed a minor glitch, replaced <> with ", so that it takes project glXXX.h, and not compilers glXXX.h 2002-12-15 18:59:57 +00:00
phreak ac64d9a2ac opengl headers 2002-12-15 16:57:15 +00:00
DTP 2efd73e598 FIX; player can now have all ships set in FRED2 as allowed playerships in singleplayer 2002-12-15 06:50:49 +00:00
DTP d587bd16f4 Bumped fire_dealy on_empty_secondary to 1000 2002-12-15 06:29:24 +00:00
Goober5000 d2707c08a9 removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
--Goober5000
2002-12-14 17:09:28 +00:00
phreak 4c192bfdba added a command line that displays frames per second when enabled.
use "-fps"
2002-12-14 17:09:08 +00:00
phreak 50f78056c4 copied from grgpenglw32x.cpp. 2002-12-14 16:14:52 +00:00
Goober5000 1d04b8005e added mission flag to show subsystem damage for fighterbays
~Goober5000~
2002-12-14 01:55:04 +00:00
Goober5000 f9f73970b8 small tweaks and bug fixes for the ballistic primary conversion
~Goober5000~
2002-12-13 08:13:30 +00:00
Goober5000 b2ebdbf7cb added distance-ship-subsystem sexp
~Goober5000~
2002-12-12 08:01:57 +00:00
Goober5000 e2a757bbbe Full-fledged ballistic primary support added! Try it and see! :) 2002-12-10 05:43:35 +00:00
Goober5000 c2661d8d8d Full-fledged ballistic primary support added! Try it and see! :)
Fixed lead indicator behavior; Phreak's version didn't work properly.
2002-12-10 05:42:42 +00:00
Goober5000 83cb4c99ad Full-fledged ballistic primary support added! Try it and see! :)
Preliminary support added for selecting additional primaries (more than 2) and secondaries (more than 3) if this is implemented later.
Transports can now dock with fighters, bombers, & stealth ships.
2002-12-10 05:41:38 +00:00
DTP bb55e367ef DTP; added decals.h and decals.cpp to the project, aswell as the directory 2002-12-10 00:44:38 +00:00
Goober5000 9d9a89434a fixed misspelling 2002-12-09 08:37:31 +00:00
Goober5000 07f5493036 fixed misspelling 2002-12-09 08:26:24 +00:00
bobboau 2dbc7e5277 inital decals code, if you are worried a bug is being caused by the decals code it's only references are in,
collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
it needs a better renderer, but is in prety good shape for now,
I also (think) I squashed a bug in the warpmodel code
2002-12-07 01:37:43 +00:00
phreak 083b43ee43 extension framework implemented(no extensions work YET) -phreak 2002-12-05 00:49:25 +00:00
DTP 6d9921f6c5 lowered MAX_POLYGON_MODELS FROM 198 to 128 for safety reasons since we bumped back MAX_SHIP_TYPES to 130 2002-12-04 09:44:34 +00:00
Goober5000 5600370231 implemented beam-free-all-by-default mission flag 2002-12-03 23:05:13 +00:00
Goober5000 3c31b5236c added myself to the credits list :)
~Goober5000
2002-12-03 22:14:06 +00:00
Goober5000 5131e7dcd8 fixed player-entry-delay bug 2002-12-03 00:00:52 +00:00
Goober5000 e6118e84fc fixed misspelling 2002-12-02 23:56:12 +00:00
Goober5000 49e1f9cfbe fixed misspelling 2002-12-02 23:26:08 +00:00
Goober5000 cbda9dde96 fixed misspelling of "category" as "catagory" 2002-12-02 23:24:35 +00:00
Goober5000 4b7700f317 commented out an unneeded variable (int ret) in psnet_socket_options 2002-12-02 23:18:53 +00:00
Goober5000 88011c314a commented out an unneeded variable (ship *shipp) in model_really_render 2002-12-02 23:16:45 +00:00
Goober5000 9ed133d2f0 fixed mispelling of "category" as "catagory" 2002-12-02 23:14:17 +00:00
Goober5000 1548da9bfb fixed mispelling of "category" as "catagory" 2002-12-02 20:49:14 +00:00
Goober5000 64a26aaa81 fixed mispelling of "category" as "catagory" 2002-12-02 20:37:26 +00:00
sesquipedalian f8a99ca19c end-mission sexp added 2002-11-28 00:00:37 +00:00
sesquipedalian d91b827f0e Added Phreak's fix for the weapons room bug. Can now view a modified weapons.tbl in the tech room without crashing 2002-11-27 01:20:51 +00:00
phreak dac9ebfba6 added OGL_inited global. Sets to 0 even if OGL isn't defined by preproccessor
-phreak
2002-11-22 20:56:15 +00:00
phreak 2913b030b7 changed around some page-in functions to work with opengl
changed bm_set_components_opengl
-phreak
2002-11-22 20:55:27 +00:00
phreak 832191512c finished off all remaining problems with 32 bit mode, fullscreen mode
and colors.  Still needs some tweaking, but works near perfect
2002-11-22 20:54:16 +00:00
phreak 24545765bc added some opengl defines for shield detail -phreak 2002-11-22 20:52:29 +00:00
DTP 5e1b9b2133 DTP; fix at line 6785 in parse/SEXP.cpp, a forgotten "{", when the is tagged thing was Fixed 2002-11-20 21:22:31 +00:00
sesquipedalian 14bc599f38 Adding in EdrickV's fix to the is-tagged sexp. 2002-11-19 02:15:50 +00:00
phreak 78ffd21eee made ogl be used if "NDEBUG" is not defined and "USE_OPENGL" is defined - phreak 2002-11-18 21:34:16 +00:00
phreak ea6fadcd11 added some lines that makes ogl work in windowed mode for fullneb - phreak 2002-11-18 21:32:48 +00:00
phreak 912c0e7c3b added some ogl functionality - phreak 2002-11-18 21:32:11 +00:00
phreak c13bfa5487 complete overhaul, works in 16 bit mode -phreak 2002-11-18 21:31:36 +00:00
phreak 21dec76efd added bm_select_components functions for OpenGL -phreak 2002-11-18 21:27:13 +00:00
bobboau 1534138f83 added nameplate code 2002-11-14 06:15:03 +00:00
bobboau 0a93058abc added warp model and type 1 glow points
and well as made the new glow file type,
some general improvement to fighter beams,
2002-11-14 04:18:17 +00:00
phreak 40a131bf76 updated parse_weapon to parse custom corkscrew missiles 2002-11-11 20:18:30 +00:00
phreak 1781459b96 changed around the 'weapon_info' struct to allow for custom corkscrew missiles 2002-11-11 20:11:02 +00:00
phreak 2a78be3257 changed cscrew_create and cscrew_process_post
to allow for custom corkscrew properties
2002-11-11 20:09:12 +00:00
phreak 30b04bd204 changed a line in ship_fire_secondary to allow for custom
amounts of corkscrew missiles fired
2002-11-11 20:05:52 +00:00
inquisitor 311ef3c714 Bumped to 3.3 2002-11-10 20:40:02 +00:00
DTP 1000fddaab DTP bumped back MAX_SHIP_TYPES to 130 2002-11-10 19:57:36 +00:00
DTP 4996d146a8 -DTP reworked mod support, 2002-11-10 16:32:42 +00:00
DTP d0008ffd9f -DTP reworked mod support, 2002-11-10 16:30:53 +00:00
phreak 918e20b198 Parser error handling for fighter flak, it didn't want flak on player weapons, now it doesn't care 2002-11-06 23:22:05 +00:00
phreak 552f0e6c8a Fighter flak code, it doesn't blow up in your face anymore! 2002-11-06 23:21:06 +00:00
DTP 391e276e91 Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support. 2002-11-04 08:32:38 +00:00
DTP ec8c500c08 DOh,uhmm, define error again, this is getting to me. 2002-11-02 23:06:59 +00:00
DTP 9281b5e6c6 DOh, fixed that define, learn to count DTP :) 2002-11-02 23:04:46 +00:00
inquisitor 9184437b10 Cleaned up the presentation a little, added HLP and VW, and, no offense to Kazan, removed Kazan. 2002-11-02 22:25:26 +00:00
DTP 9f6c744f30 DOH forgot \n 2002-11-02 22:11:35 +00:00
DTP 7fc5878f43 shameless self promotion 2002-11-02 22:10:48 +00:00
DTP 4d9c673c4a DTP Bumped Max_exited_ships from 200 to double that of MAX_SHIPS = 800 . make sense ehh. for logging effect. 2002-10-31 21:56:44 +00:00
DTP ec9427a8e2 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. 2002-10-31 21:14:16 +00:00
penguin 61a205f03a Hopelessly out of date, and only applied to Linux anyhow 2002-10-31 03:49:35 +00:00
penguin 00ff020052 updated 2002-10-31 03:46:27 +00:00
inquisitor af917b66d2 Bad Committ, Rolling back 2002-10-30 20:22:30 +00:00
DTP 32d1ba73b0 doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is 2002-10-30 06:31:05 +00:00
DTP bd40aee5f6 DTP Implemented basic VP files handling. mission and campaign files inside VP files found in mod dir still not supported, cheking / creating directories not implented either 2002-10-30 06:26:11 +00:00
sesquipedalian 21a3a8cb1e no message 2002-10-29 22:41:48 +00:00
DTP 7ae9f0d805 Crap, somebody may restore cmdline.h to 2 version before this. 2002-10-28 02:28:52 +00:00
DTP 4704315480 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.
2002-10-27 23:59:28 +00:00
randomtiger afe941612f 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
2002-10-22 23:02:40 +00:00
randomtiger fc4eceb11b Fixed lighting bug that caused special pause to crash on debug build.
Also added TAB functionality for special pause that toggles HUD. - RT
2002-10-22 17:42:09 +00:00
bobboau c4c099ac0b inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild 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 2002-10-19 19:29:29 +00:00
randomtiger b5105fa8c2 Added special pause mode for easier action screenshots.
Added new command line parameter for accessing all single missions in tech room. - RT
2002-10-19 03:50:29 +00:00
randomtiger 2ca7e10af9 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.
2002-10-17 20:40:51 +00:00
phreak 408e85dff6 screenshots, yay! 2002-10-14 19:49:08 +00:00
phreak b1274d2b58 further optimizations 2002-10-13 21:43:24 +00:00
phreak 69661089ca fixed text 2002-10-12 17:48:11 +00:00
phreak 26998eb80c dont use this one 2002-10-11 21:35:51 +00:00
phreak 32ce4b8718 first run at opengl for w32, only useful in main hall, barracks and campaign room 2002-10-11 21:31:17 +00:00
randomtiger 7cd2d35891 Added us fs2_open people to the credits. Worth looking at just for that.
Added timer bar code, by default its not compiled in.
Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
Added the new timebar files with the new code.
2002-10-05 16:46:10 +00:00
phreak 10f395b570 did glare stuff in game_sunspot_process() 2002-09-20 20:09:01 +00:00
phreak 59deec97d1 glare parser stuff in stars_init() 2002-09-20 20:05:29 +00:00
phreak 9bac9a3c32 added glare variable for ambient suns
if glare is 0 then the sun glare whiteout is not shown when looking at the sun
2002-09-20 20:04:54 +00:00
phreak fadea4253c lead indicator for dumbfire missiles 2002-09-20 20:02:00 +00:00
phreak 0a8251c060 extra effects during cargo scan 2002-09-20 20:01:30 +00:00
randomtiger d058c0ed5b Tiny change to DX branch to keep movie code optional (default off) 2002-08-28 21:47:02 +00:00
randomtiger 315b852604 Woh! I sure as hell didnt modify all these files it says I did.
I will put this down to the branch! Note: I did start from a fresh checkout!
2002-08-28 10:51:04 +00:00
penguin 0678516880 Moved DirectX8 stuff to directx8 branch; reverted to previous 2002-08-27 13:38:58 +00:00
randomtiger a0891d9240 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
2002-08-18 19:48:29 +00:00
penguin 41d83bd1b2 Added #include, needed for FRED 2002-08-15 04:41:17 +00:00
penguin cf3bca8876 updated 2002-08-13 04:31:25 +00:00
penguin 864adcea2f 1. Disable CD checking
2. Add CVS tag to version string
2002-08-13 03:34:00 +00:00
penguin bdc565d380 Bumped to version 3.2 2002-08-13 03:32:25 +00:00
DTP f773219f91 Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h" 2002-08-07 00:45:25 +00:00
DTP c8e6a4363e Implented -GF4FIX commandline switch 2002-08-07 00:44:13 +00:00
penguin f91f37c9df Updated 2002-08-06 21:21:42 +00:00
phreak 1a153fa6f5 added wireframe targetbox feature 2002-08-06 16:50:44 +00:00
phreak 5becd6b823 added Targetbox_wire variable to check what mode the
hud targetbox uses
2002-08-06 16:50:13 +00:00
phreak 188003ab91 added keybing for wireframe hud,
fixed previous missile cheat
2002-08-06 16:49:22 +00:00
penguin 7d3f9305df Use text strings for wingmen names instead of ANI 2002-08-06 04:39:26 +00:00
penguin c19eda4302 inserted "class" keyword on "friend" definitions (ANSI C++ ) 2002-08-06 03:50:48 +00:00
penguin 142154e162 Fixed problem w/ compile options for Debug mode 2002-08-06 02:43:02 +00:00
penguin c65c35bd15 Removed a couple more include dirs I missed 2002-08-06 01:49:47 +00:00
penguin 42177e22ba Renamed ccode members to cc_or and cc_and 2002-08-06 01:49:08 +00:00
penguin 0b00270cb8 Moved ChangeLog to top-level directory 2002-08-04 05:43:13 +00:00
penguin a7544c679a Change version display 2002-08-04 05:13:00 +00:00
penguin e884bc0e68 Display fs2_open version instead of "Freespace 2" 2002-08-04 05:12:42 +00:00
penguin e18b0827f7 Change version display location 2002-08-04 05:12:10 +00:00
penguin bf8447be42 Update version number to 3.1 2002-08-04 05:11:36 +00:00
penguin c610326295 Don't write version to registry; change way version string is formatted 2002-08-04 05:11:05 +00:00
randomtiger d7e1c53bd5 Fixed Geforce 4 bug that caused font and hall video distortion.
Very small change in 'gr_d3d_aabitmap_ex_internal'

Tested and works on the following systems

OUTSIDER Voodoo 3 win98
OUTSIDER Geforce 2 win2000
Me Geforce 4 PNY 4600 XP
JBX-Phoenix Geforce 4 PNY XP
Mehrunes GeForce 3 XP
WMCoolmon nVidia TNT2 M64 win2000
Orange GeForce 4 4200 XP
ShadowWolf_IH Monster2 win98
ShadowWolf_IH voodoo 2 win98
2002-08-03 19:42:17 +00:00
wmcoolmon 8c7658a934 Fixed Win32 debug configuration 2002-08-03 18:35:21 +00:00
wmcoolmon 3a86cd0576 Sync with makefile 1.4 2002-08-03 17:42:40 +00:00
penguin 82d4e6f42b updated 2002-08-01 04:04:01 +00:00
penguin 462b5c2576 The big include file move 2002-08-01 02:00:46 +00:00
penguin 0c503be8d1 The big include file move 2002-08-01 01:41:11 +00:00
wmcoolmon 72a1ee3ab1 Fixed a bug I added in ship_do_rearm_frame 2002-07-30 18:11:25 +00:00
wmcoolmon fdb748d0f5 Modified to add hull repair capabilities and toggling of them via a mission flag, MISSION_FLAG_SUPPORT_REPAIRS_HULL 2002-07-30 17:57:40 +00:00
wmcoolmon b355211cfe Added mission flag "MISSION_FLAG_SUPPORT_REPAIRS_HULL" for toggling Support Ship hull repair on and off 2002-07-30 17:35:22 +00:00
unknownplayer d8c81cd2a3 Started work on DX8.1 implementation. Updated the project files to encompass
the new files. Disable the compiler tag to use old DX code (THERE IS NO
NEW CODE YET!)
2002-07-30 14:29:15 +00:00
penguin c496dd29a5 Added Network/fs2ox.cpp 2002-07-29 22:24:57 +00:00
penguin caaf1172a6 First attempt at "fs2_open exchange" (PXO substitute) screen 2002-07-29 22:24:26 +00:00
penguin eaf2dbb75b We finally have a ChangeLog 2002-07-29 22:14:48 +00:00
penguin eee99b1a5f Moved extern declaration of ssm_create outside of block (it wouldn't compile w/ gcc) 2002-07-29 20:48:51 +00:00
penguin b9e9036d2c added #ifdef _WIN32 around windows-specific system headers 2002-07-29 20:12:31 +00:00
penguin 15e0ba365f removed bogus #include windows.h 2002-07-29 20:12:02 +00:00
penguin 8af02282c5 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:52:48 +00:00
penguin 478e9d7461 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:37:21 +00:00
penguin 41422e2e83 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:17:21 +00:00
penguin 69e2d92570 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:04:48 +00:00
DTP 92640cdc73 Forgot to Bump MAX_MODEL_SUBSYSTEMS from 128 to 200 2002-07-29 08:31:52 +00:00
DTP 22d3bddd00 BUMPED MAX_POLYGON_MODELS TO 198 , MAX_SHIP_TYPES - 2 = 198 2002-07-29 08:28:00 +00:00
DTP 7d9405df1f Bumped all MAX_SHIPS, and SHIP_LIMIT to 400.(let the mission designers decide what is good, and what is bad 2002-07-29 08:24:42 +00:00
DTP b667544505 Bumped MAX_SHIP_SUBOBJECTS to 2100(2100 /(average fighter has 7 subsystems) = 400 fighters 2002-07-29 08:22:42 +00:00
DTP 14e5fa9759 Bumped MAX_SUBSYS_LIST from 32 to 200 2002-07-29 08:19:41 +00:00
DTP c44f0100d0 -almission(autoload mission) commandline arguement handling implemented 2002-07-29 08:05:20 +00:00
DTP c4ee5bec33 FIX; Startgame arguement dont go ahead when a singleplayer pilot is selected 2002-07-29 07:56:10 +00:00
DTP 7e1ab3fe34 added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission. 2002-07-29 06:35:15 +00:00
DTP 0355ac71b3 FIX -stargame commandline arguement will now let you quit, a thing not possible before when using the startgame arguement 2002-07-28 15:07:43 +00:00
penguin 91d6d5f835 Testing commit as penguin 2002-07-26 18:02:33 +00:00
penguin 7ab0f6ba11 renamed 'big' and 'small' (conflict w/ MS include file) 2002-07-26 16:17:46 +00:00
penguin f1252fce9a fixed bug where winsock.h wasn't defined 2002-07-26 16:12:05 +00:00
wmcoolmon e0bf60b559 Added Bobboau's beam tiling code 2002-07-26 03:11:24 +00:00
wmcoolmon 34119582f2 Added Bobboau's fighter-beam code. 2002-07-25 04:50:48 +00:00
penguin 0910c540f5 Added ifndef NO_STANDALONE 2002-07-22 01:39:24 +00:00
penguin 48f4b0e5d6 Stub defines for NO_SOUND 2002-07-22 01:37:24 +00:00
penguin 72db48921a Linux port -- added NO_STANDALONE ifdefs 2002-07-22 01:22:26 +00:00
penguin 5083ae69c1 Made more compatible w/ Win32; defines for NO_SOUND, NO_JOYSTICK, NO_NETWORK 2002-07-22 01:14:09 +00:00
penguin 3482678e04 Moved the dummy "sound" definitions to main program (freespace.cpp) 2002-07-22 01:10:10 +00:00
penguin bacd2d62c1 More defines for winsock compatibility 2002-07-22 01:06:04 +00:00
penguin 5fdc6764e4 took out GAME_CD_CHECK define 2002-07-22 01:04:37 +00:00
DTP 707b284cb5 Bumped Max Shield Icons to 80 2002-07-20 23:51:59 +00:00
DTP 2517536169 Fixed multiplayer music. succes music on all Primary goals complete, fail music
if otherwise
2002-07-20 23:50:53 +00:00
DTP 84ba4e2d0c Fixed Secondary bank bug, where next valid secondary bank inherits current
valid banks FULL fire delay
2002-07-20 23:49:46 +00:00
DTP 0b44cd0f05 bumped MAX_MISSION_TEXT to 1000000 in code/parse/parselo.h 2002-07-20 19:21:13 +00:00
penguin b0e1aac704 Fixed bug (potential access of unitialized pointer) in hud_config_render_gauges() -- thanks to DTP for finding it! 2002-07-18 20:07:49 +00:00
unknownplayer 8235f563c9 no message 2002-07-18 14:36:53 +00:00
unknownplayer 4e401fa68e Revised AI primary selection code again to be more intelligent. 2002-07-18 09:55:26 +00:00
unknownplayer 6a015b9a1d Rewrote my original algorithm to search by proportional hull damage.
Does the same thing a little better.
2002-07-18 05:38:28 +00:00
unknownplayer e32babefe9 Fixed AI problems with using the maxim on fighters. 2002-07-18 03:27:38 +00:00
unknownplayer c9ef8fe12d Added some commentry to the low detail shield function. 2002-07-18 03:26:35 +00:00
unknownplayer 577c232559 no message 2002-07-18 03:25:10 +00:00
unknownplayer e520244a2f Altered project files to properly build debug info. Should save you all some time. 2002-07-17 23:59:56 +00:00
unknownplayer ffdc5a768c Minor commenting added to two functions. 2002-07-17 23:58:46 +00:00
wmcoolmon 1cdcfc1503 Added SSM code for Tag C from Bobboau. Note that strings.tbl may need to be updated. 2002-07-17 20:04:00 +00:00
unknownplayer ec6d9d4485 Added a custom build step to copy to c:\games\freespace2\fs2_open.exe
when you build.
2002-07-17 12:52:01 +00:00
unknownplayer 65dff673a4 Updated to enable compilation under MSVC++ - all changes are marked
with my name ##UnknownPlayer##
2002-07-16 14:39:16 +00:00
unknownplayer 0ed7df259f This is the code project file. Use the workspace file I included to get at this. 2002-07-16 14:37:51 +00:00
unknownplayer 25db1467ef This is the workspace for freespace2.dsp - it contains everything needed to
compile fs2_open.exe
2002-07-16 14:37:09 +00:00
unknownplayer 65c8d2f9af This is the project file to compile fs2_open. It's a real project file - use the
workspace though
2002-07-16 14:36:30 +00:00
penguin a05f76f579 Changed so that debug make debug and release makes release :) 2002-07-16 01:15:59 +00:00
penguin 596092b9ef Commented out "fs2_open.dep" stuff 2002-07-16 01:15:15 +00:00
inquisitor 2be4c8a0ef Visual Studio files
compiles fs2_open.exe - 0 error(s), 7 warning(s)
2002-07-15 22:36:08 +00:00
wmcoolmon 51b3c691d9 Added support for toggling ship trails 2002-07-15 02:11:00 +00:00
wmcoolmon e0976a005f Added initial code for "ship-lights-on" and "ship-lights-off" SEXPs 2002-07-13 09:16:18 +00:00
penguin 42117df4fe Added flags2 (ran out of bits in flags!) to ship struct; bit 0 will be used
to toggle Bobboau's lights.
2002-07-12 16:59:04 +00:00
penguin 74fff521b8 Removed dummy include file 2002-07-12 02:56:07 +00:00
penguin 12da216e48 Fixed endian-ness of new "GLOW" IDs 2002-07-12 02:44:18 +00:00
wmcoolmon c53db880a8 Added Bobboau's glow code; all comments include "-Bobboau" 2002-07-10 18:42:14 +00:00
penguin 3463682f1a Back-port to MSVC 2002-07-07 19:56:00 +00:00
penguin e945f679ed Makefile for Microsoft Visual C++ 2002-07-07 19:49:42 +00:00
penguin 97cb77ba5f Added machine-independent version of MulDiv (in case we don't know
the processor type)
2002-06-04 06:38:21 +00:00
penguin 596e6adfdd Minor changes 2002-06-03 05:03:45 +00:00
penguin 1988cb0eef Initial revision 2002-06-03 04:34:38 +00:00
penguin 8f92eebd34 Warpcore CVS sync 2002-06-03 04:10:40 +00:00
penguin b8d8c68dc7 Dummy include file 2002-06-03 04:08:13 +00:00
penguin ad911724e9 Warpcore CVS sync 2002-06-03 03:55:40 +00:00
penguin 663b3471b9 Volition sources -- warpcore CVS import 2002-06-03 03:26:03 +00:00
1147 changed files with 444274 additions and 134623 deletions

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
Modifications by the FreeSpace Source Code Project (FSSCP)
http://fs2source.warpcore.org
FS2_OPEN STAFF:
Project leader:
Edward "Inquisitor" Gardner
Programmers:
"Bobboau"
Dennis "DTP" Pedersen
Ian "Goober5000" Warfield
Joe "Righteous1" Dowd
Mike "penguin" Harris
"Mysterial"
"PhReAk"
Thomas "Random Tiger" Whittaker
Will "Unknown PLayer" Rousnel
"WMCoolmon"
Web support:
Icefire and the staff at Volitionwatch.com
Alex "Thunder" Avery and the staff at Hard Light Productions
Special thanks to:
Volition for making FS2 such a great game
Dave Baranec for giving us the code and keeping us sanity checked
+14
View File
@@ -0,0 +1,14 @@
Volition Copyright (applies to original FreeSpace2 source code
developed and released by Volition):
"Copyright (C) Volition, Inc. 1999. All rights reserved.
All source code herein is the property of Volition, Inc. You may not
sell or otherwise commercially exploit the source or things you
created based on the source."
Modifications by members of the FreeSpace Source Code Project are
released under whatever terms the individual authors choose, but the
above notice continues to apply to all fs2_open code.
-13
View File
@@ -1,13 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
-15
View File
@@ -1,15 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-14
View File
@@ -1,14 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
-23
View File
@@ -1,23 +0,0 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
-21
View File
@@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-26
View File
@@ -1,26 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
-26
View File
@@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
-12
View File
@@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
-4
View File
@@ -1,4 +0,0 @@
drevil:nNwcK94cKMqZI:fs2source
inquisitor:Jh.dOjaiO2jHk:fs2source
anonymous:EqQXnO5cz9yBA:fs2source
-13
View File
@@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-20
View File
@@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-21
View File
@@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-3
View File
@@ -1,3 +0,0 @@
drevil
inquisitor
+1868
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
+29
View File
@@ -0,0 +1,29 @@
This is still in pretty rough form.
=== for people building fs2_open:
Win32-MSVC:
Use the Freespace2.dsw workspace and build within the IDE.
Win32-MinGW:
make
Linux and other unix variants (NOT YET COMPLETE)
./configure [options]
make
=== for the project maintainers (people who need to
=== keep the makefiles up to date) and those building
=== from CVS:
./autogen.sh (should only has to be done once)
./configure [options]
make
automake v1.6.1+ and
autoconf v2.54+ are required
+86
View File
@@ -0,0 +1,86 @@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = libjpeg lua code
EXTRA_DIST = \
FS2OpenSCPReadMe.doc \
projects/MSVC_2005/Freespace2.sln \
projects/MSVC_2005/Freespace2.vcproj \
projects/MSVC_2005/code.vcproj \
projects/MSVC_6/Fred2.dsp \
projects/MSVC_6/Freespace2.dsp \
projects/MSVC_6/Freespace2.dsw \
projects/MSVC_6/code.dsp \
projects/MSVC_6/libjpeg.dsp \
projects/MSVC_6/liblua.dsp \
projects/MSVC_6/wxFRED2.dsp \
projects/MSVC_7/Freespace2.sln \
projects/MSVC_7/Freespace2.vcproj \
projects/MSVC_7/code.vcproj \
projects/MSVC_7/fred2_open.vcproj \
projects/MSVC_7/libjpeg.vcproj \
projects/MSVC_7/lua.vcproj \
projects/MSVC_7/wxFRED2.vcproj \
projects/anjuta1/FS2_Open.prj \
projects/anjuta1/README \
projects/Xcode/English.lproj/InfoPlist.strings \
projects/Xcode/FS2_Open.icns \
projects/Xcode/FS2_Open.xcodeproj/project.pbxproj \
projects/Xcode/Frameworks.tgz \
projects/Xcode/Info-debug.plist \
projects/Xcode/Info.plist \
projects/Xcode/README.Xcode \
projects/Xcode/SDLMain.h \
projects/Xcode/SDLMain.m
# D_ variants are defaults and should always be used
AM_CXXFLAGS = -I./code @D_CFLAGS@
AM_LDFLAGS = @D_LDFLAGS@
EXTRA_PROGRAMS = cfilearchiver cfileextractor cryptstring scramble
###############################################################################
##
## Begin utilitites
##
# cfilearchiver -- to create VPs
cfilearchiver_SOURCES = \
code/cfilearchiver/cfilearchiver.cpp
# cfileextractor -- to extract files from VPs
cfileextractor_SOURCES = \
code/cfileextractor/cfileextractor.cpp
# cryptstring -- to encrypt strings that are used as cheat codes
cryptstring_SOURCES = \
code/cryptstring/cryptstring.cpp
# scramble -- to encrypt tables
scramble_SOURCES = \
code/parse/encrypt.cpp \
code/scramble/scramble.cpp \
code/scramble/scramble.h
# catch all to build utilitites
tools: cfilearchiver cfileextractor cryptstring scramble
# cleaning
clean-tools:
-test -z "$(EXTRA_PROGRAMS)" || rm -f $(EXTRA_PROGRAMS)
##
## End utilitites
##
###############################################################################
# make sure we get this stuff cleaned up
clean-generic: clean-tools
+3
View File
@@ -0,0 +1,3 @@
This file is required to keep autoconf/automake from complaining.
See the ChangeLog for what's new.
+8
View File
@@ -0,0 +1,8 @@
The "projects" directory contains ready projects for:
Microsoft Visual C++ 6
Microsoft Visual C++ 2005
Anjuta 1 (please see README with project before using)
See the ChangeLog to see what's new.
See the INSTALL file for instructions on how to build fs2_open.
+714
View File
@@ -0,0 +1,714 @@
# Configure paths for SDL
# Sam Lantinga 9/21/99
# stolen from Manish Singh
# stolen back from Frank Belew
# stolen from Manish Singh
# Shamelessly stolen from Owen Taylor
dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
dnl
AC_DEFUN([AM_PATH_SDL],
[dnl
dnl Get the cflags and libraries from the sdl-config script
dnl
AC_ARG_WITH(sdl-prefix,[ --with-sdl-prefix=PFX Prefix where SDL is installed (optional)],
sdl_prefix="$withval", sdl_prefix="")
AC_ARG_WITH(sdl-exec-prefix,[ --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
sdl_exec_prefix="$withval", sdl_exec_prefix="")
AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run a test SDL program],
, enable_sdltest=yes)
if test x$sdl_exec_prefix != x ; then
sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
fi
fi
if test x$sdl_prefix != x ; then
sdl_args="$sdl_args --prefix=$sdl_prefix"
if test x${SDL_CONFIG+set} != xset ; then
SDL_CONFIG=$sdl_prefix/bin/sdl-config
fi
fi
AC_REQUIRE([AC_CANONICAL_TARGET])
PATH="$prefix/bin:$prefix/usr/bin:$PATH"
AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH])
min_sdl_version=ifelse([$1], ,0.11.0,$1)
AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
no_sdl=""
if test "$SDL_CONFIG" = "no" ; then
no_sdl=yes
else
SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
if test "x$enable_sdltest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_CXXFLAGS="$CXXFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
dnl
dnl Now check if the installed SDL is sufficiently new. (Also sanity
dnl checks the results of sdl-config to some extent
dnl
rm -f conf.sdltest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "SDL.h"
char*
my_strdup (char *str)
{
char *new_str;
if (str)
{
new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
strcpy (new_str, str);
}
else
new_str = NULL;
return new_str;
}
int main (int argc, char *argv[])
{
int major, minor, micro;
char *tmp_version;
/* This hangs on some systems (?)
system ("touch conf.sdltest");
*/
{ FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
/* HP/UX 9 (%@#!) writes to sscanf strings */
tmp_version = my_strdup("$min_sdl_version");
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
printf("%s, bad version string\n", "$min_sdl_version");
exit(1);
}
if (($sdl_major_version > major) ||
(($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
(($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
{
return 0;
}
else
{
printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
printf("*** best to upgrade to the required version.\n");
printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
printf("*** to point to the correct copy of sdl-config, and remove the file\n");
printf("*** config.cache before re-running configure\n");
return 1;
}
}
],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
if test "x$no_sdl" = x ; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
if test "$SDL_CONFIG" = "no" ; then
echo "*** The sdl-config script installed by SDL could not be found"
echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
echo "*** your path, or set the SDL_CONFIG environment variable to the"
echo "*** full path to sdl-config."
else
if test -f conf.sdltest ; then
:
else
echo "*** Could not run SDL test program, checking why..."
CFLAGS="$CFLAGS $SDL_CFLAGS"
CXXFLAGS="$CXXFLAGS $SDL_CFLAGS"
LIBS="$LIBS $SDL_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include "SDL.h"
int main(int argc, char *argv[])
{ return 0; }
#undef main
#define main K_and_R_C_main
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding SDL or finding the wrong"
echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
echo "*** to the installed location Also, make sure you have run ldconfig if that"
echo "*** is required on your system"
echo "***"
echo "*** If you have an old version installed, it is best to remove it, although"
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
[ echo "*** The test program failed to compile or link. See the file config.log for the"
echo "*** exact error that occured. This usually means SDL was incorrectly installed"
echo "*** or that you have moved SDL since it was installed. In the latter case, you"
echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
CFLAGS="$ac_save_CFLAGS"
CXXFLAGS="$ac_save_CXXFLAGS"
LIBS="$ac_save_LIBS"
fi
fi
SDL_CFLAGS=""
SDL_LIBS=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(SDL_CFLAGS)
AC_SUBST(SDL_LIBS)
rm -f conf.sdltest
])
dnl ---------------------------------------------------------------------------
dnl Macros for wxWindows detection. Typically used in configure.in as:
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl ...
dnl AM_PATH_WXCONFIG(2.3.4, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWindows must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWindows libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWindows version is 2.3.4 or above.
dnl ])
dnl fi
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_OPTIONS_WXCONFIG
dnl
dnl adds support for --wx-prefix, --wx-exec-prefix and --wx-config
dnl command line options
dnl ---------------------------------------------------------------------------
AC_DEFUN([AM_OPTIONS_WXCONFIG],
[
AC_ARG_WITH(wx-prefix, [ --with-wx-prefix=PREFIX Prefix where wxWindows is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,[ --with-wx-exec-prefix=PREFIX Exec prefix where wxWindows is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
AC_ARG_WITH(wx-config,[ --with-wx-config=CONFIG wx-config script to use (optional)],
wx_config_name="$withval", wx_config_name="")
])
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWindows, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWindows). Set WX_CONFIG_NAME
dnl environment variable to override the default name of the wx-config script
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl ---------------------------------------------------------------------------
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXCONFIG],
[
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
WX_CONFIG_PATH="$WX_CONFIG_NAME"
AC_MSG_RESULT($WX_CONFIG_PATH)
else
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
no_wx=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
AC_MSG_CHECKING(for wxWindows version >= $min_wx_version)
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args"
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_ver_ok=""
if test $wx_config_major_version -gt $wx_requested_major_version; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $wx_requested_major_version; then
if test $wx_config_minor_version -gt $wx_requested_minor_version; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $wx_requested_minor_version; then
if test $wx_config_micro_version -ge $wx_requested_micro_version; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
if test "x$wx_ver_ok" = x ; then
no_wx=yes
else
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs`
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
if test "x$wx_has_cppflags" = x ; then
dnl no choice but to define all flags like CFLAGS
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
fi
if test "x$no_wx" = x ; then
AC_MSG_RESULT(yes (version $WX_VERSION))
ifelse([$2], , :, [$2])
else
if test "x$WX_VERSION" = x; then
dnl no wx-config at all
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
ifelse([$3], , :, [$3])
fi
fi
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_CFLAGS_ONLY)
AC_SUBST(WX_CXXFLAGS_ONLY)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_VERSION)
])
# Configure paths for libogg
# Jack Moffitt <[email protected]> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
dnl XIPH_PATH_OGG([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libogg, and define OGG_CFLAGS and OGG_LIBS
dnl
AC_DEFUN([XIPH_PATH_OGG],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(ogg,[ --with-ogg=PFX Prefix where libogg is installed (optional)], ogg_prefix="$withval", ogg_prefix="")
AC_ARG_WITH(ogg-libraries,[ --with-ogg-libraries=DIR Directory where libogg library is installed (optional)], ogg_libraries="$withval", ogg_libraries="")
AC_ARG_WITH(ogg-includes,[ --with-ogg-includes=DIR Directory where libogg header files are installed (optional)], ogg_includes="$withval", ogg_includes="")
AC_ARG_ENABLE(oggtest, [ --disable-oggtest Do not try to compile and run a test Ogg program],, enable_oggtest=yes)
if test "x$ogg_libraries" != "x" ; then
OGG_LIBS="-L$ogg_libraries"
elif test "x$ogg_prefix" != "x" ; then
OGG_LIBS="-L$ogg_prefix/lib"
elif test "x$prefix" != "xNONE" ; then
OGG_LIBS="-L$libdir"
fi
OGG_LIBS="$OGG_LIBS -logg"
if test "x$ogg_includes" != "x" ; then
OGG_CFLAGS="-I$ogg_includes"
elif test "x$ogg_prefix" != "x" ; then
OGG_CFLAGS="-I$ogg_prefix/include"
elif test "x$prefix" != "xNONE"; then
OGG_CFLAGS=""
fi
AC_MSG_CHECKING(for Ogg)
no_ogg=""
if test "x$enable_oggtest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Ogg is sufficiently new.
dnl
rm -f conf.oggtest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ogg/ogg.h>
int main ()
{
system("touch conf.oggtest");
return 0;
}
],, no_ogg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_ogg" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.oggtest ; then
:
else
echo "*** Could not run Ogg test program, checking why..."
CFLAGS="$CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <ogg/ogg.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Ogg or finding the wrong"
echo "*** version of Ogg. If it is not finding Ogg, 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 Ogg was incorrectly installed"
echo "*** or that you have moved Ogg since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
OGG_CFLAGS=""
OGG_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(OGG_CFLAGS)
AC_SUBST(OGG_LIBS)
rm -f conf.oggtest
])
# Configure paths for libvorbis
# Jack Moffitt <[email protected]> 10-21-2000
# Shamelessly stolen from Owen Taylor and Manish Singh
# thomasvs added check for vorbis_bitrate_addblock which is new in rc3
dnl XIPH_PATH_VORBIS([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libvorbis, and define VORBIS_CFLAGS and VORBIS_LIBS
dnl
AC_DEFUN([XIPH_PATH_VORBIS],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(vorbis,[ --with-vorbis=PFX Prefix where libvorbis is installed (optional)], vorbis_prefix="$withval", vorbis_prefix="")
AC_ARG_WITH(vorbis-libraries,[ --with-vorbis-libraries=DIR Directory where libvorbis library is installed (optional)], vorbis_libraries="$withval", vorbis_libraries="")
AC_ARG_WITH(vorbis-includes,[ --with-vorbis-includes=DIR Directory where libvorbis header files are installed (optional)], vorbis_includes="$withval", vorbis_includes="")
AC_ARG_ENABLE(vorbistest, [ --disable-vorbistest Do not try to compile and run a test Vorbis program],, enable_vorbistest=yes)
if test "x$vorbis_libraries" != "x" ; then
VORBIS_LIBS="-L$vorbis_libraries"
elif test "x$vorbis_prefix" != "x" ; then
VORBIS_LIBS="-L$vorbis_prefix/lib"
elif test "x$prefix" != "xNONE"; then
VORBIS_LIBS="-L$libdir"
fi
VORBIS_LIBS="$VORBIS_LIBS -lvorbis -lm"
VORBISFILE_LIBS="-lvorbisfile"
VORBISENC_LIBS="-lvorbisenc"
if test "x$vorbis_includes" != "x" ; then
VORBIS_CFLAGS="-I$vorbis_includes"
elif test "x$vorbis_prefix" != "x" ; then
VORBIS_CFLAGS="-I$vorbis_prefix/include"
elif test "x$prefix" != "xNONE"; then
VORBIS_CFLAGS=""
fi
AC_MSG_CHECKING(for Vorbis)
no_vorbis=""
if test "x$enable_vorbistest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $VORBIS_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $VORBISENC_LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Vorbis is sufficiently new.
dnl
rm -f conf.vorbistest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <vorbis/codec.h>
#include <vorbis/vorbisenc.h>
int main ()
{
vorbis_block vb;
vorbis_dsp_state vd;
vorbis_info vi;
vorbis_info_init (&vi);
vorbis_encode_init (&vi, 2, 44100, -1, 128000, -1);
vorbis_analysis_init (&vd, &vi);
vorbis_block_init (&vd, &vb);
/* this function was added in 1.0rc3, so this is what we're testing for */
vorbis_bitrate_addblock (&vb);
system("touch conf.vorbistest");
return 0;
}
],, no_vorbis=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_vorbis" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.vorbistest ; then
:
else
echo "*** Could not run Vorbis test program, checking why..."
CFLAGS="$CFLAGS $VORBIS_CFLAGS"
LIBS="$LIBS $VORBIS_LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <vorbis/codec.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Vorbis or finding the wrong"
echo "*** version of Vorbis. If it is not finding Vorbis, 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 Vorbis was incorrectly installed"
echo "*** or that you have moved Vorbis since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
VORBIS_CFLAGS=""
VORBIS_LIBS=""
VORBISFILE_LIBS=""
VORBISENC_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(VORBIS_CFLAGS)
AC_SUBST(VORBIS_LIBS)
AC_SUBST(VORBISFILE_LIBS)
AC_SUBST(VORBISENC_LIBS)
rm -f conf.vorbistest
])
dnl XIPH_PATH_THEORA([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl Test for libtheora, and define THEORA_CFLAGS and THEORA_LIBS
dnl
AC_DEFUN([XIPH_PATH_THEORA],
[dnl
dnl Get the cflags and libraries
dnl
AC_ARG_WITH(theora,[ --with-theora=PFX Prefix where libtheora is installed (optional)], theora_prefix="$withval", theora_prefix="")
AC_ARG_WITH(theora-libraries,[ --with-theora-libraries=DIR Directory where libtheora library is installed (optional)], theora_libraries="$withval", theora_libraries="")
AC_ARG_WITH(theora-includes,[ --with-theora-includes=DIR Directory where libtheora header files are installed (optional)], theora_includes="$withval", theora_includes="")
AC_ARG_ENABLE(theoratest, [ --disable-theoratest Do not try to compile and run a test Theora program],, enable_theoratest=yes)
if test "x$theora_libraries" != "x" ; then
THEORA_LIBS="-L$theora_libraries"
elif test "x$theora_prefix" != "x" ; then
THEORA_LIBS="-L$theora_prefix/lib"
elif test "x$prefix" != "xNONE"; then
THEORA_LIBS="-L$libdir"
fi
THEORA_LIBS="$THEORA_LIBS -ltheora"
if test "x$theora_includes" != "x" ; then
THEORA_CFLAGS="-I$theora_includes"
elif test "x$theora_prefix" != "x" ; then
THEORA_CFLAGS="-I$theora_prefix/include"
elif test "x$prefix" != "xNONE"; then
THEORA_CFLAGS=""
fi
AC_MSG_CHECKING(for Theora)
no_theora=""
if test "x$enable_theoratest" = "xyes" ; then
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $THEORA_CFLAGS $OGG_CFLAGS"
LIBS="$LIBS $THEORA_LIBS $OGG_LIBS"
dnl
dnl Now check if the installed Theora is sufficiently new.
dnl
rm -f conf.theoratest
AC_TRY_RUN([
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <theora/theora.h>
#include <vorbis/codec.h>
int main ()
{
theora_info ti;
theora_state ts;
theora_info_init(&ti);
system("touch conf.theoratest");
return 0;
}
],, no_theora=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
if test "x$no_theora" = "x" ; then
AC_MSG_RESULT(yes)
ifelse([$1], , :, [$1])
else
AC_MSG_RESULT(no)
if test -f conf.theoratest ; then
:
else
echo "*** Could not run Theora test program, checking why..."
CFLAGS="$CFLAGS $THEORA_CFLAGS"
LIBS="$LIBS $THEORA_LIBS $OGG_LIBS"
AC_TRY_LINK([
#include <stdio.h>
#include <vorbis/codec.h>
], [ return 0; ],
[ echo "*** The test program compiled, but did not run. This usually means"
echo "*** that the run-time linker is not finding Theora or finding the wrong"
echo "*** version of Theora. If it is not finding Theora, 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 Theora was incorrectly installed"
echo "*** or that you have moved Theora since it was installed." ])
CFLAGS="$ac_save_CFLAGS"
LIBS="$ac_save_LIBS"
fi
THEORA_CFLAGS=""
THEORA_LIBS=""
ifelse([$2], , :, [$2])
fi
AC_SUBST(THEORA_CFLAGS)
AC_SUBST(THEORA_LIBS)
rm -f conf.theoratest
])
Executable
+137
View File
@@ -0,0 +1,137 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
PKG_NAME="fs2_open"
# check the version of a package
check_version() {
COMMAND=$1
MAJOR=$2
MINOR=$3
MICRO=$4
($COMMAND --version) </dev/null >/dev/null 2>&1 || return 1
ver=`$COMMAND --version|head -n 1|sed 's/^.*) //'|sed 's/ (.*)//'`
major=`echo $ver | cut -d. -f1 | sed s/[a-zA-Z\-].*//g`
minor=`echo $ver | cut -d. -f2 | sed s/[a-zA-Z\-].*//g`
micro=`echo $ver | cut -d. -f3 | sed s/[a-zA-Z\-].*//g`
test -z "$major" && major=0
test -z "$minor" && minor=0
test -z "$micro" && micro=0
fail=0
if [ ! "$major" -gt "$MAJOR" ]; then
if [ "$major" -lt "$MAJOR" ]; then
fail=1
elif [ ! "$minor" -gt "$MINOR" ]; then
if [ "$minor" -lt "$MINOR" ]; then
fail=1
elif [ "$micro" -lt "$MICRO" ]; then
fail=1
fi
fi
fi
return "$fail"
}
AUTOMAKE=
ACLOCAL=
DIE=0
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed to."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
for AM in automake-1.9 automake-1.8 automake-1.7 automake-1.6 automake; do
(check_version "$AM" 1 6 1) && {
AUTOMAKE="$AM"
break
}
done
if [ -z "$AUTOMAKE" ]; then
echo
echo "**Error**: You must have \`automake' version 1.6.1 or greater"
echo "installed to compile $PKG_NAME. Download the appropriate package"
echo "for your distribution, or get the source tarball at"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
# if no automake, don't bother testing for aclocal
test -z "$AUTOMAKE" || {
for ACL in aclocal-1.9 aclocal-1.8 aclocal-1.7 aclocal-1.6 aclocal; do
(check_version "$ACL" 1 6 1) && {
ACLOCAL="$ACL"
break
}
done
if [ -z "$ACLOCAL" ]; then
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed seems to be outdated. Get a recent package from"
echo "ftp://ftp.gnu.org/pub/gnu/"
DIE=1
fi
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -name configure.ac -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
macrodirs=`sed -n -e 's,AM_ACLOCAL_INCLUDE(\(.*\)),\1,gp' < $coin`
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
for k in $macrodirs; do
if test -d $k; then
aclocalinclude="$aclocalinclude -I $k"
##else
## echo "**Warning**: No such directory \`$k'. Ignored."
fi
done
echo "Running $ACLOCAL $aclocalinclude ..."
"$ACLOCAL" $aclocalinclude
echo "Running $AUTOMAKE --add-missing --copy --foreign $am_opt ..."
"$AUTOMAKE" --add-missing --copy --foreign $am_opt
echo "Running autoconf..."
autoconf
)
fi
done
#conf_flags="--enable-maintainer-mode --enable-compile-warnings" #--enable-iso-c
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile $PKG_NAME.
else
echo Skipping configure process.
fi
+851
View File
@@ -0,0 +1,851 @@
## code/Makefile.am for fs2_open
##
## $Id: Makefile.am,v 1.42 2007-11-22 04:52:30 taylor Exp $
EXTRA_DIST = \
freespace2/app_icon.ico \
freespace2/freespace.rc \
freespace2/freespaceresource.h \
freespace2/goal_com.bmp \
freespace2/goal_fail.bmp \
freespace2/goal_inc.bmp \
freespace2/goal_none.bmp \
freespace2/goal_ord.bmp \
fred2/addvariabledlg.cpp \
fred2/addvariabledlg.h \
fred2/adjustgriddlg.cpp \
fred2/adjustgriddlg.h \
fred2/asteroideditordlg.cpp \
fred2/asteroideditordlg.h \
fred2/bgbitmapdlg.cpp \
fred2/bgbitmapdlg.h \
fred2/briefingeditordlg.cpp \
fred2/briefingeditordlg.h \
fred2/campaigneditordlg.cpp \
fred2/campaigneditordlg.h \
fred2/campaignfilelistbox.cpp \
fred2/campaignfilelistbox.h \
fred2/campaigntreeview.cpp \
fred2/campaigntreeview.h \
fred2/campaigntreewnd.cpp \
fred2/campaigntreewnd.h \
fred2/cmdbrief.cpp \
fred2/cmdbrief.h \
fred2/createwingdlg.cpp \
fred2/createwingdlg.h \
fred2/customwingnames.cpp \
fred2/customwingnames.h \
fred2/debriefingeditordlg.cpp \
fred2/debriefingeditordlg.h \
fred2/dialog1.cpp \
fred2/dialog1.h \
fred2/dumpstats.cpp \
fred2/dumpstats.h \
fred2/editor.h \
fred2/eventeditor.cpp \
fred2/eventeditor.h \
fred2/folderdlg.cpp \
fred2/folderdlg.h \
fred2/fred.cpp \
fred2/fred.h \
fred2/fred.rc \
fred2/freddoc.cpp \
fred2/freddoc.h \
fred2/fredrender.cpp \
fred2/fredrender.h \
fred2/fredstubs.cpp \
fred2/fredview.cpp \
fred2/fredview.h \
fred2/grid.cpp \
fred2/grid.h \
fred2/ignoreordersdlg.cpp \
fred2/ignoreordersdlg.h \
fred2/initialships.cpp \
fred2/initialships.h \
fred2/initialstatus.cpp \
fred2/initialstatus.h \
fred2/mainfrm.cpp \
fred2/mainfrm.h \
fred2/makehelp.bat \
fred2/management.cpp \
fred2/management.h \
fred2/messageeditordlg.cpp \
fred2/messageeditordlg.h \
fred2/missiongoalsdlg.cpp \
fred2/missiongoalsdlg.h \
fred2/missionnotesdlg.cpp \
fred2/missionnotesdlg.h \
fred2/missionsave.cpp \
fred2/missionsave.h \
fred2/modifyvariabledlg.cpp \
fred2/modifyvariabledlg.h \
fred2/operatorargtypeselect.cpp \
fred2/operatorargtypeselect.h \
fred2/orienteditor.cpp \
fred2/orienteditor.h \
fred2/playerstarteditor.cpp \
fred2/playerstarteditor.h \
fred2/prefsdlg.cpp \
fred2/prefsdlg.h \
fred2/reinforcementeditordlg.cpp \
fred2/reinforcementeditordlg.h \
fred2/resource.h \
fred2/resource.hm \
fred2/setglobalshipflags.cpp \
fred2/setglobalshipflags.h \
fred2/sexp_tree.cpp \
fred2/sexp_tree.h \
fred2/shieldsysdlg.cpp \
fred2/shieldsysdlg.h \
fred2/ship_select.cpp \
fred2/ship_select.h \
fred2/shipchecklistbox.cpp \
fred2/shipchecklistbox.h \
fred2/shipclasseditordlg.cpp \
fred2/shipclasseditordlg.h \
fred2/shipeditordlg.cpp \
fred2/shipeditordlg.h \
fred2/shipflagsdlg.cpp \
fred2/shipflagsdlg.h \
fred2/shipgoalsdlg.cpp \
fred2/shipgoalsdlg.h \
fred2/shipspecialdamage.cpp \
fred2/shipspecialdamage.h \
fred2/shipspecialhitpoints.cpp \
fred2/shipspecialhitpoints.h \
fred2/shiptexturesdlg.cpp \
fred2/shiptexturesdlg.h \
fred2/starfieldeditor.cpp \
fred2/starfieldeditor.h \
fred2/stdafx.cpp \
fred2/stdafx.h \
fred2/textviewdlg.cpp \
fred2/textviewdlg.h \
fred2/voiceactingmanager.cpp \
fred2/voiceactingmanager.h \
fred2/waypointpathdlg.cpp \
fred2/waypointpathdlg.h \
fred2/weaponeditordlg.cpp \
fred2/weaponeditordlg.h \
fred2/wing.cpp \
fred2/wing.h \
fred2/wing_editor.cpp \
fred2/wing_editor.h \
fred2/hlp/afxcore.rtf \
fred2/hlp/afxhelp.hm \
fred2/hlp/afxprint.rtf \
fred2/hlp/appexit.bmp \
fred2/hlp/bullet.bmp \
fred2/hlp/curarw2.bmp \
fred2/hlp/curarw4.bmp \
fred2/hlp/curhelp.bmp \
fred2/hlp/editcopy.bmp \
fred2/hlp/editcut.bmp \
fred2/hlp/editpast.bmp \
fred2/hlp/editundo.bmp \
fred2/hlp/filenew.bmp \
fred2/hlp/fileopen.bmp \
fred2/hlp/fileprnt.bmp \
fred2/hlp/filesave.bmp \
fred2/hlp/fred.hm \
fred2/hlp/fred.hpj \
fred2/hlp/help.log \
fred2/hlp/hlpsbar.bmp \
fred2/hlp/hlptbar.bmp \
fred2/hlp/recfirst.bmp \
fred2/hlp/reclast.bmp \
fred2/hlp/recnext.bmp \
fred2/hlp/recprev.bmp \
fred2/hlp/scmax.bmp \
fred2/hlp/scmenu.bmp \
fred2/hlp/scmin.bmp \
fred2/res/bitmap1.bmp \
fred2/res/black_do.bmp \
fred2/res/bmp00001.bmp \
fred2/res/chained.bmp \
fred2/res/chained_directive.bmp \
fred2/res/cursor1.cur \
fred2/res/cursor2.cur \
fred2/res/data.bmp \
fred2/res/fred.ico \
fred2/res/fred.rc2 \
fred2/res/freddoc.ico \
fred2/res/green_do.bmp \
fred2/res/root.bmp \
fred2/res/root_directive.bmp \
fred2/res/toolbar.bmp \
fred2/res/toolbar1.bmp \
fred2/res/variable.bmp \
sound/phrases.xml \
sound/gc.exe \
wxfred2/res/fred.ico \
wxfred2/wxfred.xrc
# D_ variants are defaults and should always be used
# FS2_ variants are for game building and wxFRED
AM_CXXFLAGS = @D_CFLAGS@ @FS2_CXXFLAGS@ -I../lua
AM_LDFLAGS = @D_LDFLAGS@ @FS2_LDFLAGS@
noinst_LIBRARIES = libcode.a
noinst_PROGRAMS = @FS2_BINARY@
EXTRA_PROGRAMS = fs2_open_r fs2_open_d wxFRED2_r wxFRED2_d
###############################################################################
##
## Begin CORE library
##
FS2_SOURCES = \
ai/ai.cpp \
ai/ai.h \
ai/aibig.cpp \
ai/aibig.h \
ai/aicode.cpp \
ai/aigoals.cpp \
ai/aigoals.h \
ai/aiinternal.h \
ai/ailocal.h \
ai/aiturret.cpp \
ai/ai_profiles.cpp \
ai/ai_profiles.h \
anim/animplay.cpp \
anim/animplay.h \
anim/packunpack.cpp \
anim/packunpack.h \
asteroid/asteroid.cpp \
asteroid/asteroid.h \
autopilot/autopilot.cpp \
autopilot/autopilot.h \
bmpman/bm_internal.h \
bmpman/bmpman.cpp \
bmpman/bmpman.h \
camera/camera.cpp \
camera/camera.h \
cfile/cfile.cpp \
cfile/cfile.h \
cfile/cfilearchive.cpp \
cfile/cfilearchive.h \
cfile/cfilelist.cpp \
cfile/cfilesystem.cpp \
cfile/cfilesystem.h \
cmdline/cmdline.cpp \
cmdline/cmdline.h \
cmeasure/cmeasure.cpp \
cmeasure/cmeasure.h \
controlconfig/controlsconfig.cpp \
controlconfig/controlsconfig.h \
controlconfig/controlsconfigcommon.cpp \
cutscene/cutscenes.cpp \
cutscene/cutscenes.h \
cutscene/decoder16.cpp \
cutscene/decoder8.cpp \
cutscene/movie.cpp \
cutscene/movie.h \
cutscene/mve_audio.cpp \
cutscene/mvelib.cpp \
cutscene/mvelib.h \
cutscene/mveplayer.cpp \
cutscene/oggplayer.cpp \
cutscene/oggplayer.h \
ddsutils/ddsutils.cpp \
ddsutils/ddsutils.h \
debris/debris.cpp \
debris/debris.h \
debugconsole/console.cpp \
debugconsole/dbugfile.h \
debugconsole/timerbar.cpp \
debugconsole/timerbar.h \
decals/decals.cpp \
decals/decals.h \
demo/demo.cpp \
demo/demo.h \
exceptionhandler/exceptionhandler.cpp \
exceptionhandler/exceptionhandler.h \
fireball/fireballs.cpp \
fireball/fireballs.h \
fireball/warpineffect.cpp \
fs2open_pxo/Client.cpp \
fs2open_pxo/Client.h \
fs2open_pxo/TCP_Client.cpp \
fs2open_pxo/TCP_Socket.cpp \
fs2open_pxo/TCP_Socket.h \
fs2open_pxo/protocol.h \
fs2open_pxo/udpsocket.cpp \
fs2open_pxo/udpsocket.h \
gamehelp/contexthelp.cpp \
gamehelp/contexthelp.h \
gamehelp/gameplayhelp.cpp \
gamehelp/gameplayhelp.h \
gamesequence/gamesequence.cpp \
gamesequence/gamesequence.h \
globalincs/alphacolors.cpp \
globalincs/alphacolors.h \
globalincs/crypt.cpp \
globalincs/crypt.h \
globalincs/def_files.cpp \
globalincs/def_files.h \
globalincs/globals.h \
globalincs/linklist.h \
globalincs/pstypes.h \
globalincs/systemvars.cpp \
globalincs/systemvars.h \
globalincs/version.cpp \
globalincs/version.h \
graphics/2d.cpp \
graphics/2d.h \
graphics/font.cpp \
graphics/font.h \
graphics/generic.cpp \
graphics/generic.h \
graphics/grbatch.cpp \
graphics/grbatch.h \
graphics/grinternal.h \
graphics/gropengl.cpp \
graphics/gropengl.h \
graphics/gropenglbmpman.cpp \
graphics/gropenglbmpman.h \
graphics/gropenglextension.cpp \
graphics/gropenglextension.h \
graphics/gropengllight.cpp \
graphics/gropengllight.h \
graphics/gropengltexture.cpp \
graphics/gropengltexture.h \
graphics/gropengltnl.cpp \
graphics/gropengltnl.h \
graphics/grstub.cpp \
graphics/grstub.h \
graphics/line.h \
graphics/tmapper.h \
hud/hud.cpp \
hud/hud.h \
hud/hudartillery.cpp \
hud/hudartillery.h \
hud/hudbrackets.cpp \
hud/hudbrackets.h \
hud/hudconfig.cpp \
hud/hudconfig.h \
hud/hudescort.cpp \
hud/hudescort.h \
hud/hudets.cpp \
hud/hudets.h \
hud/hudgauges.h \
hud/hudlock.cpp \
hud/hudlock.h \
hud/hudmessage.cpp \
hud/hudmessage.h \
hud/hudnavigation.cpp \
hud/hudnavigation.h \
hud/hudobserver.cpp \
hud/hudobserver.h \
hud/hudparse.cpp \
hud/hudparse.h \
hud/hudresource.h \
hud/hudreticle.cpp \
hud/hudreticle.h \
hud/hudshield.cpp \
hud/hudshield.h \
hud/hudsquadmsg.cpp \
hud/hudsquadmsg.h \
hud/hudtarget.cpp \
hud/hudtarget.h \
hud/hudtargetbox.cpp \
hud/hudtargetbox.h \
hud/hudwingmanstatus.cpp \
hud/hudwingmanstatus.h \
iff_defs/iff_defs.cpp \
iff_defs/iff_defs.h \
io/key.cpp \
io/key.h \
io/keycontrol.cpp \
io/keycontrol.h \
io/mouse.cpp \
io/mouse.h \
io/timer.cpp \
io/timer.h \
irc/irc.cpp \
irc/irc.h \
jpgutils/jpgutils.cpp \
jpgutils/jpgutils.h \
jumpnode/jumpnode.cpp \
jumpnode/jumpnode.h \
lab/lab.cpp \
lab/lab.h \
lab/wmcgui.cpp \
lab/wmcgui.h \
lighting/lighting.cpp \
lighting/lighting.h \
localization/fhash.cpp \
localization/fhash.h \
localization/localize.cpp \
localization/localize.h \
math/bitarray.h \
math/fix.cpp \
math/fix.h \
math/floating.cpp \
math/floating.h \
math/fvi.cpp \
math/fvi.h \
math/spline.cpp \
math/spline.h \
math/staticrand.cpp \
math/staticrand.h \
math/vecmat.cpp \
math/vecmat.h \
menuui/barracks.cpp \
menuui/barracks.h \
menuui/credits.cpp \
menuui/credits.h \
menuui/fishtank.cpp \
menuui/fishtank.h \
menuui/mainhallmenu.cpp \
menuui/mainhallmenu.h \
menuui/mainhalltemp.cpp \
menuui/mainhalltemp.h \
menuui/optionsmenu.cpp \
menuui/optionsmenu.h \
menuui/optionsmenumulti.cpp \
menuui/optionsmenumulti.h \
menuui/playermenu.cpp \
menuui/playermenu.h \
menuui/readyroom.cpp \
menuui/readyroom.h \
menuui/snazzyui.cpp \
menuui/snazzyui.h \
menuui/storybook.cpp \
menuui/storybook.h \
menuui/techmenu.cpp \
menuui/techmenu.h \
menuui/trainingmenu.cpp \
menuui/trainingmenu.h \
mission/missionbriefcommon.cpp \
mission/missionbriefcommon.h \
mission/missioncampaign.cpp \
mission/missioncampaign.h \
mission/missiongoals.cpp \
mission/missiongoals.h \
mission/missiongrid.cpp \
mission/missiongrid.h \
mission/missionhotkey.cpp \
mission/missionhotkey.h \
mission/missionload.cpp \
mission/missionload.h \
mission/missionlog.cpp \
mission/missionlog.h \
mission/missionmessage.cpp \
mission/missionmessage.h \
mission/missionparse.cpp \
mission/missionparse.h \
mission/missiontraining.cpp \
mission/missiontraining.h \
missionui/chatbox.cpp \
missionui/chatbox.h \
missionui/fictionviewer.cpp \
missionui/fictionviewer.h \
missionui/missionbrief.cpp \
missionui/missionbrief.h \
missionui/missioncmdbrief.cpp \
missionui/missioncmdbrief.h \
missionui/missiondebrief.cpp \
missionui/missiondebrief.h \
missionui/missionloopbrief.cpp \
missionui/missionloopbrief.h \
missionui/missionpause.cpp \
missionui/missionpause.h \
missionui/missionrecommend.cpp \
missionui/missionrecommend.h \
missionui/missionscreencommon.cpp \
missionui/missionscreencommon.h \
missionui/missionshipchoice.cpp \
missionui/missionshipchoice.h \
missionui/missionstats.cpp \
missionui/missionstats.h \
missionui/missionweaponchoice.cpp \
missionui/missionweaponchoice.h \
missionui/redalert.cpp \
missionui/redalert.h \
model/model.h \
model/modelanim.cpp \
model/modelanim.h \
model/modelcollide.cpp \
model/modeldiff.cpp \
model/modelinterp.cpp \
model/modelsinc.h \
model/modeloctant.cpp \
model/modelread.cpp \
nebula/neb.cpp \
nebula/neb.h \
nebula/neblightning.cpp \
nebula/neblightning.h \
network/fs2ox.cpp \
network/fs2ox.h \
network/multi.cpp \
network/multi.h \
network/multilag.cpp \
network/multilag.h \
network/multimsgs.cpp \
network/multimsgs.h \
network/multiteamselect.cpp \
network/multiteamselect.h \
network/multiui.cpp \
network/multiui.h \
network/multiutil.cpp \
network/multiutil.h \
network/multi_campaign.cpp \
network/multi_campaign.h \
network/multi_data.cpp \
network/multi_data.h \
network/multi_dogfight.cpp \
network/multi_dogfight.h \
network/multi_endgame.cpp \
network/multi_endgame.h \
network/multi_ingame.cpp \
network/multi_ingame.h \
network/multi_kick.cpp \
network/multi_kick.h \
network/multi_log.cpp \
network/multi_log.h \
network/multi_obj.cpp \
network/multi_obj.h \
network/multi_observer.cpp \
network/multi_observer.h \
network/multi_oo.h \
network/multi_options.cpp \
network/multi_options.h \
network/multi_pause.cpp \
network/multi_pause.h \
network/multi_pinfo.cpp \
network/multi_pinfo.h \
network/multi_ping.cpp \
network/multi_ping.h \
network/multi_pmsg.cpp \
network/multi_pmsg.h \
network/multi_rate.cpp \
network/multi_rate.h \
network/multi_respawn.cpp \
network/multi_respawn.h \
network/multi_team.cpp \
network/multi_team.h \
network/multi_update.h \
network/multi_voice.cpp \
network/multi_voice.h \
network/multi_xfer.cpp \
network/multi_xfer.h \
network/psnet.cpp \
network/psnet.h \
network/psnet2.cpp \
network/psnet2.h \
network/stand_gui.cpp \
network/stand_gui-unix.cpp \
network/stand_gui.h \
object/collidedebrisship.cpp \
object/collidedebrisweapon.cpp \
object/collideshipship.cpp \
object/collideshipweapon.cpp \
object/collideweaponweapon.cpp \
object/deadobjectdock.cpp \
object/deadobjectdock.h \
object/objcollide.cpp \
object/objcollide.h \
object/objectdock.cpp \
object/objectdock.h \
object/object.cpp \
object/object.h \
object/objectsort.cpp \
object/objectshield.cpp \
object/parseobjectdock.cpp \
object/parseobjectdock.h \
object/waypoint/waypoint.cpp \
object/waypoint/waypoint.h \
observer/observer.cpp \
observer/observer.h \
palman/palman.cpp \
palman/palman.h \
parse/encrypt.cpp \
parse/encrypt.h \
parse/lua.cpp \
parse/lua.h \
parse/parselo.cpp \
parse/parselo.h \
parse/scripting.cpp \
parse/scripting.h \
parse/sexp.cpp \
parse/sexp.h \
particle/particle.cpp \
particle/particle.h \
pcxutils/pcxutils.cpp \
pcxutils/pcxutils.h \
physics/physics.cpp \
physics/physics.h \
playerman/managepilot.cpp \
playerman/managepilot.h \
playerman/player.h \
playerman/playercontrol.cpp \
popup/popup.cpp \
popup/popup.h \
popup/popupdead.cpp \
popup/popupdead.h \
radar/radar.cpp \
radar/radar.h \
radar/radarorb.cpp \
radar/radarorb.h \
radar/radarsetup.cpp \
radar/radarsetup.h \
render/3d.h \
render/3dclipper.cpp \
render/3ddraw.cpp \
render/3dinternal.h \
render/3dlaser.cpp \
render/3dmath.cpp \
render/3dsetup.cpp \
ship/afterburner.cpp \
ship/afterburner.h \
ship/awacs.cpp \
ship/awacs.h \
ship/shield.cpp \
ship/ship.cpp \
ship/ship.h \
ship/shipcontrails.cpp \
ship/shipcontrails.h \
ship/shipfx.cpp \
ship/shipfx.h \
ship/shiphit.cpp \
ship/shiphit.h \
ship/subsysdamage.h \
species_defs/species_defs.cpp \
species_defs/species_defs.h \
starfield/nebula.cpp \
starfield/nebula.h \
starfield/starfield.cpp \
starfield/starfield.h \
starfield/supernova.cpp \
starfield/supernova.h \
stats/medals.cpp \
stats/medals.h \
stats/scoring.cpp \
stats/scoring.h \
stats/stats.cpp \
stats/stats.h \
tgautils/tgautils.cpp \
tgautils/tgautils.h \
ui/button.cpp \
ui/checkbox.cpp \
ui/gadget.cpp \
ui/icon.cpp \
ui/inputbox.cpp \
ui/keytrap.cpp \
ui/listbox.cpp \
ui/radio.cpp \
ui/scroll.cpp \
ui/slider.cpp \
ui/slider2.cpp \
ui/ui.h \
ui/uidefs.h \
ui/uidraw.cpp \
ui/uimouse.cpp \
ui/window.cpp \
weapon/beam.cpp \
weapon/beam.h \
weapon/corkscrew.cpp \
weapon/corkscrew.h \
weapon/emp.cpp \
weapon/emp.h \
weapon/flak.cpp \
weapon/flak.h \
weapon/muzzleflash.cpp \
weapon/muzzleflash.h \
weapon/shockwave.cpp \
weapon/shockwave.h \
weapon/swarm.cpp \
weapon/swarm.h \
weapon/trails.cpp \
weapon/trails.h \
weapon/weapons.cpp \
weapon/weapon.h
## conditional includes follow:
## joystic support sources
if FS2_OS_WIN32
JOY_SOURCES = \
io/joy.cpp \
io/joy.h \
io/joy_ff.cpp \
io/joy_ff.h \
io/sw_error.hpp \
io/sw_force.h \
io/sw_guid.hpp \
io/swff_lib.cpp
endif
if FS2_OS_UNIX
JOY_SOURCES = \
io/joy.h \
io/joy_ff.h \
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 \
directx/vdinput.h \
directx/vdplay.h \
directx/vdplobby.h \
directx/vdsetup.h \
directx/vdsound.h \
directx/vdvp.h \
globalincs/windebug.cpp \
graphics/gl/GLAUX.H \
graphics/gl/GLU.H \
graphics/gl/Gl.h \
graphics/gl/Glext.h \
graphics/gl/wglext.h \
graphics/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 \
osapi/osregistry.cpp \
osapi/osregistry.h \
osapi/outwnd.cpp \
osapi/outwnd.h
endif
## Unix-specific sources
if FS2_OS_UNIX
UNIX_SOURCES = \
osapi/osapi_unix.cpp \
osapi/osapi.h \
osapi/osregistry_unix.cpp \
osapi/osregistry.h \
osapi/outwnd_unix.cpp \
osapi/outwnd.h \
windows_stub/stubs.cpp \
windows_stub/config.h
endif
## libcode.a
libcode_a_SOURCES = ${FS2_SOURCES} ${JOY_SOURCES} ${SOUND_SOURCES} \
${WIN32_SOURCES} ${UNIX_SOURCES}
##
## End CODE library
##
###############################################################################
###############################################################################
##
## Begin MAIN fs2 binary
##
FS2OPEN_SOURCES = \
freespace2/freespace.cpp \
freespace2/freespace.h \
freespace2/levelpaging.cpp \
freespace2/levelpaging.h
fs2_open_d_SOURCES = \
${FS2OPEN_SOURCES}
fs2_open_r_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
##
## End MAIN binary
##
###############################################################################
###############################################################################
##
## Begin wxFRED2 binary
##
wxFRED_SOURCES = \
wxfred2/wxfred2.cpp \
wxfred2/wxfred2.h \
wxfred2/fredframe.cpp \
wxfred2/fredframe.h \
wxfred2/wxfred_xrc.cpp \
wxfred2/wxfred_xrc.h
wxFRED2_d_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_r_SOURCES = \
${wxFRED_SOURCES}
wxFRED2_d_LDADD = libcode.a ../libjpeg/libjpeg.a
wxFRED2_r_LDADD = libcode.a ../libjpeg/libjpeg.a
##
## End wxFRED2 binary
##
###############################################################################
+5 -11
View File
@@ -11,17 +11,11 @@
// ai slots and linking them to ships.
// See AiCode.cpp for the actual AI code.
#include "pstypes.h"
#include "object.h"
#include "physics.h"
#include "vecmat.h"
#include "ship.h"
#include "model.h"
#include "2d.h"
#include "3d.h"
#include "ai.h"
#include "floating.h"
#include "ailocal.h"
#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];
+281 -107
View File
@@ -9,11 +9,168 @@
/*
* $Logfile: /Freespace2/code/Ship/ai.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:26:01 $
* $Author: penguin $
* $Revision: 1.19 $
* $Date: 2007-08-11 16:52:02 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.18 2007/02/18 06:16:46 Goober5000
* revert Bobboau's commits for the past two months; these will be added in later in a less messy/buggy manner
*
* Revision 1.17 2007/02/11 21:26:34 Goober5000
* massive shield infrastructure commit
*
* Revision 1.16 2007/01/14 14:03:31 bobboau
* ok, something aparently went wrong, last time, so I'm commiting again
* hopefully it should work this time
* damnit WORK!!!
*
* Revision 1.15 2007/01/07 01:00:18 Goober5000
* convert a mission variable to a mission flag
*
* Revision 1.14 2006/12/28 00:59:18 wmcoolmon
* WMC codebase commit. See pre-commit build thread for details on changes.
*
* Revision 1.13 2006/06/04 01:01:52 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
*
@@ -156,41 +313,46 @@
#ifndef _AI_H
#define _AI_H
#include "pstypes.h"
#include "object.h"
#include "parselo.h"
#include "cfile.h"
#include "systemvars.h"
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
struct ship_weapon;
struct ship_subsys;
struct object;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
#define AIF_AWAITING_REPAIR (1 << 1) // Awaiting a repair ship.
#define AIF_BEING_REPAIRED (1 << 2) // Currently docked with repair ship.
#define AIF_REPAIRING (1 << 3) // Repairing a ship (or going to repair a ship)
#define AIF_DOCKED (1 << 4) // this object docked with something else
#define AIF_SEEK_LOCK (1 << 5) // set if should focus on gaining aspect lock, not hitting with lasers
#define AIF_FORMATION_OBJECT (1 << 6) // Fly in formation off a specific object.
#define AIF_TEMPORARY_IGNORE (1 << 7) // Means current ignore_objnum is only temporary, not an order from the player.
#define AIF_USE_EXIT_PATH (1 << 8) // Used by path code, to flag path as an exit path
#define AIF_USE_STATIC_PATH (1 << 9) // Used by path code, use fixed path, don't try to recreate
#define AIF_TARGET_COLLISION (1 << 10) // Collided with aip->target_objnum last frame. Avoid that ship for half a second or so.
#define AIF_UNLOAD_SECONDARIES (1 << 11) // Fire secondaries as fast as possible!
#define AIF_ON_SUBSYS_PATH (1 << 12) // Current path leads to a subsystem
#define AIF_AVOID_SHOCKWAVE_SHIP (1 << 13) // Avoid an existing shockwave from a ship.
#define AIF_AVOID_SHOCKWAVE_WEAPON (1 << 14) // Avoid an expected shockwave from a weapon. shockwave_object field contains object index.
#define AIF_AVOID_SHOCKWAVE_STARTED (1 << 15) // Already started avoiding shockwave, don't keep deciding whether to avoid.
#define AIF_ATTACK_SLOWLY (1 << 16) // Move slowly while attacking.
#define AIF_REPAIR_OBSTRUCTED (1 << 17) // Ship wants to be repaired, but path is obstructed.
#define AIF_KAMIKAZE (1 << 18) // Crash into target
#define AIF_NO_DYNAMIC (1 << 19) // Not allowed to get dynamic goals
#define AIF_AVOIDING_SMALL_SHIP (1 << 20) // Avoiding a player ship.
#define AIF_AVOIDING_BIG_SHIP (1 << 21) // Avoiding a large ship.
#define AIF_BIG_SHIP_COLLIDE_RECOVER_1 (1 << 22) // Collided into a big ship. Recovering by flying away.
#define AIF_BIG_SHIP_COLLIDE_RECOVER_2 (1 << 23) // Collided into a big ship. Fly towards big ship sphere perimeter.
#define AIF_STEALTH_PURSIUT (1 << 24) // Ai is trying to fight stealth ship
#define AIF_FORMATION_WING (1 << 0) // Fly in formation as part of wing.
#define AIF_AWAITING_REPAIR (1 << 1) // Awaiting a repair ship.
#define AIF_BEING_REPAIRED (1 << 2) // Currently docked with repair ship.
#define AIF_REPAIRING (1 << 3) // Repairing a ship (or going to repair a ship)
#define AIF_SEEK_LOCK (1 << 4) // set if should focus on gaining aspect lock, not hitting with lasers
#define AIF_FORMATION_OBJECT (1 << 5) // Fly in formation off a specific object.
#define AIF_TEMPORARY_IGNORE (1 << 6) // Means current ignore_objnum is only temporary, not an order from the player.
#define AIF_USE_EXIT_PATH (1 << 7) // Used by path code, to flag path as an exit path
#define AIF_USE_STATIC_PATH (1 << 8) // Used by path code, use fixed path, don't try to recreate
#define AIF_TARGET_COLLISION (1 << 9) // Collided with aip->target_objnum last frame. Avoid that ship for half a second or so.
#define AIF_UNLOAD_SECONDARIES (1 << 10) // Fire secondaries as fast as possible!
#define AIF_ON_SUBSYS_PATH (1 << 11) // Current path leads to a subsystem
#define AIF_AVOID_SHOCKWAVE_SHIP (1 << 12) // Avoid an existing shockwave from a ship.
#define AIF_AVOID_SHOCKWAVE_WEAPON (1 << 13) // Avoid an expected shockwave from a weapon. shockwave_object field contains object index.
#define AIF_AVOID_SHOCKWAVE_STARTED (1 << 14) // Already started avoiding shockwave, don't keep deciding whether to avoid.
#define AIF_ATTACK_SLOWLY (1 << 15) // Move slowly while attacking.
#define AIF_REPAIR_OBSTRUCTED (1 << 16) // Ship wants to be repaired, but path is obstructed.
#define AIF_KAMIKAZE (1 << 17) // Crash into target
#define AIF_NO_DYNAMIC (1 << 18) // Not allowed to get dynamic goals
#define AIF_AVOIDING_SMALL_SHIP (1 << 19) // Avoiding a player ship.
#define AIF_AVOIDING_BIG_SHIP (1 << 20) // Avoiding a large ship.
#define AIF_BIG_SHIP_COLLIDE_RECOVER_1 (1 << 21) // Collided into a big ship. Recovering by flying away.
#define AIF_BIG_SHIP_COLLIDE_RECOVER_2 (1 << 22) // Collided into a big ship. Fly towards big ship sphere perimeter.
#define AIF_STEALTH_PURSUIT (1 << 23) // Ai is trying to fight stealth ship
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
// Goober5000
#define AIF_UNLOAD_PRIMARIES (1 << 24) // Fire primaries as fast as possible!
#define AIF_TRYING_UNSUCCESSFULLY_TO_WARP (1 << 25) // Trying to warp, but can't warp at the moment
#define AIF_AVOID_SHOCKWAVE (AIF_AVOID_SHOCKWAVE_SHIP | AIF_AVOID_SHOCKWAVE_WEAPON)
#define AIF_FORMATION (AIF_FORMATION_WING | AIF_FORMATION_OBJECT)
// dock_orient_and_approach() modes.
@@ -206,14 +368,14 @@
#define AIDO_DOCK_NOW 2 // Immediately move into dock position. For ships that start mission docked.
#define AIDO_UNDOCK 3 // Set goal of undocking with object.
#define MAX_AI_GOALS 5
// Submodes for seeking safety.
#define AISS_1 41 // Pick a spot to fly to.
#define AISS_2 42 // Flying to spot.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2
#define MAX_AI_GOALS 5
// types of ai goals -- tyese types will help us to determination on which goals should
// have priority over others (i.e. when a player issues a goal to a wing, then a seperate
// goal to a ship in that wing). We would probably use this type in conjunction with
@@ -225,21 +387,27 @@
#define AIG_TYPE_DYNAMIC 5 // created on the fly
// flags for AI_GOALS
#define AIGF_DOCKER_NAME_VALID (1<<0) // when set, name field for docker is valid
#define AIGF_DOCKEE_NAME_VALID (1<<1) // when set, name field for dockee is valid
#define AIGF_DOCKER_INDEX_VALID (1<<0) // when set, index field for docker is valid
#define AIGF_DOCKEE_INDEX_VALID (1<<1) // when set, index field for dockee is valid
#define AIGF_GOAL_ON_HOLD (1<<2) // when set, this goal cannot currently be satisfied, although it could be in the future
#define AIGF_SUBSYS_NAME_VALID (1<<3) // when set, the subsystem name (for a destroy subsystem goal) is valid, and stored in docker.name field!!
#define AIGF_SUBSYS_NEEDS_FIXUP (1<<3) // when set, the subsystem index (for a destroy subsystem goal) is invalid and must be gotten from the subsys name stored in docker.name field!!
#define AIGF_GOAL_OVERRIDE (1<<4) // paired with AIG_TYPE_DYNAMIC to mean this goal overrides any other goal
#define AIGF_PURGE (1<<5) // purge this goal next time we process
#define AIGF_GOALS_PURGED (1<<6) // this goal has already caused other goals to get purged
#define AIGF_DOCK_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
// Flags to ai_turn_towards_vector().
#define AITTV_FAST (1<<0) // Turn fast, not slowed down based on skill level.
#define AITTV_VIA_SEXP (1<<1) // Goober5000 - via sexp
#define AITTV_IGNORE_BANK (1<<2) // Goober5000 - ignore bank when turning
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
// structure for AI goals
typedef struct ai_goals {
typedef struct ai_goal {
int signature; // Unique identifier. All goals ever created (per mission) have a unique signature.
int ai_mode; // one of the AIM_* modes for this goal
int ai_submode; // maybe need a submode
@@ -253,6 +421,8 @@ typedef struct ai_goals {
int weapon_signature; // signature of weapon this ship might be chasing. Paired with above value to get target.
// unions for docking stuff.
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
// these are the dockpoints used on the docker and dockee ships, not the ships themselves
union {
char *name;
int index;
@@ -265,9 +435,6 @@ typedef struct ai_goals {
} ai_goal;
#include "ship.h" // ai_goal must be declared before including this.
#define MAX_AI_CLASSES 10
#define MAX_GOAL_SHIP_NAMES 100
#define AIM_CHASE 0
@@ -291,23 +458,12 @@ typedef struct ai_goals {
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
#define AIM_WARP_OUT 20 // Commence warp out sequence. Point in legal direction. Then call John's code.
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
#define MAX_AI_BEHAVIORS 21 // Number of AIM_xxxx types
#define MAX_AI_BEHAVIORS 22 // Number of AIM_xxxx types
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_WAYPOINT_LISTS 32
#define MAX_ENEMY_DISTANCE 2500.0f // maximum distance from which a ship will pursue an enemy.
// waypoint list flags bitmasks.
#define WL_MARKED 0x01
typedef struct waypoint_list {
char name[NAME_LENGTH];
int count;
char flags[MAX_WAYPOINTS_PER_LIST];
vector waypoints[MAX_WAYPOINTS_PER_LIST];
} waypoint_list;
#define AI_GOAL_NONE -1
#define AI_ACTIVE_GOAL_DYNAMIC 999
@@ -345,7 +501,7 @@ typedef struct ai_class {
#define AIS_DOCK_1 22
#define AIS_DOCK_2 23
#define AIS_DOCK_3 24
#define AIS_DOCK_3A 25
//#define AIS_DOCK_3A 25
#define AIS_DOCK_4 26 // Only for rearm/repair.
#define AIS_DOCK_4A 27 // Only for not rearm/repair. MK, 7/15/97
#define AIS_UNDOCK_0 30
@@ -381,6 +537,7 @@ typedef struct ai_class {
#define AIS_WARP_3 302
#define AIS_WARP_4 303
#define AIS_WARP_5 304
#define AIS_DEPART_TO_BAY 305
// A node on a path.
// Contains global location of point.
@@ -388,7 +545,7 @@ typedef struct ai_class {
// This hook is used to extract information on the point such as whether it is
// protected by turrets.
typedef struct pnode {
vector pos;
vec3d pos;
int path_num; // path number from polymodel, ie in polymodel, paths[path_num]
int path_index; // index in original model path of point, ie in model_path, use verts[path_index]
} pnode;
@@ -397,13 +554,16 @@ typedef struct pnode {
extern pnode Path_points[MAX_PATH_POINTS];
extern pnode *Ppfp; // Free pointer in path points.
// Goober5000 (based on the "you can only remember 7 things in short-term memory" assumption)
#define MAX_IGNORE_NEW_OBJECTS 7
typedef struct ai_info {
int ai_flags; // Special flags for AI behavior.
int shipnum; // Ship using this slot, -1 means none.
int type; //
int wing; // Member of what wing? -1 means none.
int behavior; // AI Class. Doesn't change after initial setting.
int behavior; // AI behavior; vestigial field from early development of FS1
int mode;
int previous_mode;
int mode_time; // timestamp at which current mode elapses.
@@ -414,14 +574,15 @@ typedef struct ai_info {
int stealth_last_cheat_visible_stamp; // when within 100m, always update pos and velocity, with error increasing for increasing time from last legal visible
int stealth_last_visible_stamp;
float stealth_sweep_box_size;
vector stealth_last_pos;
vector stealth_velocity;
vec3d stealth_last_pos;
vec3d stealth_velocity;
float previous_dot_to_enemy; // dot(fvec, vec_to_enemy) last frame
float target_time; // Amount of time continuously targeting this ship.
int enemy_wing; // When picking an enemy wing, only allow to be in enemy_wing, unless == -1, in which case don't care.
int attacker_objnum;
int goal_objnum; // mode specific goal. In DOCK, ship to dock with.
int goal_signature;
@@ -432,6 +593,10 @@ typedef struct ai_info {
int ignore_objnum; // ship to be ignored, based on player order. UNUSED_OBJNUM if none. -(wing_num+1) if ignoring wing.
int ignore_signature; // signature of ship to be ignored
// Goober5000
int ignore_new_objnums[MAX_IGNORE_NEW_OBJECTS];
int ignore_new_signatures[MAX_IGNORE_NEW_OBJECTS];
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
@@ -439,7 +604,7 @@ typedef struct ai_info {
int wp_index; // waypoint index in list
int wp_flags; // waypoint flags, see WPF_xxxx
int wp_dir; // 1 or -1, amount to add to get to next waypoint index.
char waypoint_speed_cap; // -1 no cap, otherwise cap
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
// Path following information
int path_start; // Index into global array, start of path.
@@ -450,7 +615,7 @@ typedef struct ai_info {
int path_objnum; // Object of interest. It's model contains the path.
int path_goal_obj_hash; // Hash value of goal object when global path created.
fix path_next_create_time; // Next time at which we'll create a global path.
vector path_create_pos; // Object's position at time of global path creation.
vec3d path_create_pos; // Object's position at time of global path creation.
matrix path_create_orient; // Object's orientation at time of global path creation.
int mp_index; // Model path index. Index in polymodel:model_paths
fix path_next_check_time; // Last time checked to see if would collide with model.
@@ -471,7 +636,7 @@ typedef struct ai_info {
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
vector last_predicted_enemy_pos; // Where he thought enemy was last time.
vec3d last_predicted_enemy_pos; // Where he thought enemy was last time.
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
@@ -482,8 +647,8 @@ typedef struct ai_info {
fix resume_goal_time; // Time at which to resume interrupted goal, if nothing else intervenes.
float prev_accel; // Acceleration last frame.
float prev_dot_to_goal; // dot of fvec to goal last frame, used to see if making progress towards goal.
vector goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
vector prev_goal_point; // Previous location of goal point, used at least for evading.
vec3d goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
vec3d prev_goal_point; // Previous location of goal point, used at least for evading.
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
union {
float lead_scale; // Amount to lead current opponent by.
@@ -498,15 +663,15 @@ typedef struct ai_info {
// ship_subsys *targeted_subobject; // subsystem to attack
// int attack_subsystem_parent; // objnum of the object containing the attack_subsystem
int dock_index; // index of docking point to use when docking.
int dockee_index; // index of dock point on other ship.
int dock_path_index; // index of docking path to use when docking.
int dock_objnum; // objnum of ship we are docked with.
int dock_signature; // Signature of repair object.
// Goober5000
int support_ship_objnum; // objnum of support ship docking with us, or (if we're a support ship) object we're docking to
int support_ship_signature; // signature of the same
int danger_weapon_objnum; // Closest objnum of weapon fired at this ship.
int danger_weapon_signature; // Signature of object danger_weapon_objnum.
vector guard_vec; // vector to object being guarded, only used in AIS_GUARD_STATIC submode
vec3d guard_vec; // vector to object being guarded, only used in AIS_GUARD_STATIC submode
int nearest_locked_object; // Nearest locked object.
float nearest_locked_distance; // Distance to nearest locked object.
@@ -521,6 +686,7 @@ typedef struct ai_info {
int last_target;
int rearm_first_missile; // flag to show that reloading of missilies hasn't begun yet
int rearm_first_ballistic_primary; // flag to show that reloading of ballistic primaries hasn't begun yet
int rearm_release_delay; // timestamp used to delay separation of ships after rearm complete
fix afterburner_stop_time; // Missiontime to turn off afterburner
@@ -544,19 +710,19 @@ typedef struct ai_info {
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
vector big_attack_point; // Global point this ship is attacking on a big ship.
vector big_attack_surface_normal; // Surface normal at ship at big_attack_point;
vec3d big_attack_point; // Global point this ship is attacking on a big ship.
vec3d big_attack_surface_normal; // Surface normal at ship at big_attack_point;
int pick_big_attack_point_timestamp; // timestamp at which to pick a new point to attack on a big ship.
// Note: These three avoid_XX terms are shared between the code that avoids small (only player now) and large ships
// The bits in ai_flags determine which is occurring. AIF_AVOID_SMALL_SHIP, AIF_AVOID_BIG_SHIP
int avoid_ship_num; // object index of small ship to avoid
vector avoid_goal_point; // point to aim at when avoiding a ship
vec3d avoid_goal_point; // point to aim at when avoiding a ship
fix avoid_check_timestamp; // timestamp at which to next check for having to avoid ship
vector big_collision_normal; // Global normal of collision with big ship. Helps find direction to fly away from big ship. Set for each collision.
vector big_recover_pos_1; // Global point to fly towards when recovering from collision with a big ship, stage 1.
vector big_recover_pos_2; // Global point to fly towards when recovering from collision with a big ship, stage 2.
vec3d big_collision_normal; // Global normal of collision with big ship. Helps find direction to fly away from big ship. Set for each collision.
vec3d big_recover_pos_1; // Global point to fly towards when recovering from collision with a big ship, stage 1.
vec3d big_recover_pos_2; // Global point to fly towards when recovering from collision with a big ship, stage 2.
int big_recover_timestamp; // timestamp at which it's OK to re-enter stage 1.
int abort_rearm_timestamp; // time at which this rearm should be aborted in a multiplayer game.
@@ -565,7 +731,7 @@ typedef struct ai_info {
int artillery_objnum; // object currently being targeted for artillery lock/attack
int artillery_sig; // artillery object signature
float artillery_lock_time; // how long we've been locked onto this guy
vector artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
vec3d artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
float lethality; // measure of how dangerous ship is to enemy BIG|HUGE ships (likelyhood of targeting)
} ai_info;
@@ -580,7 +746,6 @@ typedef struct ai_info {
#define MAX_BURST_DAMAGE 20 // max damage that can be done in BURST_DURATION
#define BURST_DURATION 500 // decay time over which Player->damage_this_burst falls from MAX_BURST_DAMAGE to 0
extern int Mission_all_attack; // !0 means all teams attack all teams.
extern int Total_goal_ship_names;
extern char Goal_ship_names[MAX_GOAL_SHIP_NAMES][NAME_LENGTH];
@@ -594,14 +759,13 @@ extern ai_info *Player_ai;
extern int Waypoints_created; // externed since needed for save/restore
extern ai_class Ai_classes[];
extern char *Ai_class_names[];
extern ai_class *Ai_classes;
extern char** Ai_class_names;
extern int Num_ai_classes;
extern int Ai_firing_enabled;
extern char *Skill_level_names(int skill_level, int translate = 1);
extern int Skill_level_max_attackers[NUM_SKILL_LEVELS];
extern int Ai_goal_signature;
// need access to following data in AiBig.cpp
@@ -629,22 +793,19 @@ int get_wingnum(int objnum);
void set_wingnum(int objnum, int wingnum);
char *ai_get_goal_ship_name(char *name, int *index);
extern waypoint_list Waypoint_lists[MAX_WAYPOINT_LISTS];
extern int Num_waypoint_lists;
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, int priority, ship_subsys *ssp);
extern void ai_evade_object(object *evader, object *evaded, int priority);
extern void ai_ignore_object(object *ignorer, object *ignored, int priority);
extern void ai_ignore_object(object *ignorer, object *ignored, int priority, int ignore_new);
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
extern void ai_dock_with_object(object *docker, object *dockee, int priority, int dock_type, int docker_index, int dockee_index);
extern void ai_stay_still(object *still_objp, vector *view_pos);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int priority, int dock_type);
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
extern void ai_set_default_behavior(object *obj, int classnum);
extern void ai_do_default_behavior(object *obj);
extern void ai_start_waypoints(object *objp, int waypoint_list_index, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vector *hitpos, int shield_quadrant, vector *hit_normal);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int quadrant_num, vec3d *hit_normal);
extern void ai_ship_destroy(int shipnum, int method);
extern void ai_turn_towards_vector(vector *dest, object *objp, float frametime, float turn_time, vector *slide_vec, vector *rel_pos, float bank_override, int flags, vector *rvec = NULL);
extern void ai_turn_towards_vector(vec3d *dest, object *objp, float frametime, float turn_time, vec3d *slide_vec, vec3d *rel_pos, float bank_override, int flags, vec3d *rvec = NULL, int sexp_flags = 0);
extern void init_ai_object(int objnum);
extern void ai_init(void); // Call this one to parse ai.tbl.
extern void ai_level_init(void); // Call before each level to reset AI
@@ -653,66 +814,66 @@ extern int ai_set_attack_subsystem(object *objp, int subnum);
extern int ai_issue_rearm_request(object *requester_objp); // Object requests rearm/repair.
extern int ai_abort_rearm_request(object *requester_objp); // Object aborts rearm/repair.
extern void ai_do_repair_frame(object *objp, ai_info *aip, float frametime); // Repair a ship object, player or AI.
extern float dock_orient_and_approach(object *objp, object *dobjp, int dock_mode); // Move to a position relative to a dock bay using thrusters.
extern void ai_update_danger_weapon(int objnum, int weapon_objnum);
// called externally from MissionParse.cpp to position ships in wings upon arrival into the
// mission.
extern void get_absolute_wing_pos( vector *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
extern void get_absolute_wing_pos( vec3d *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
// Interface from goals code to AI. Set ship to guard. *objp guards *other_objp
extern void ai_set_guard_object(object *objp, object *other_objp);
extern void ai_set_evade_object(object *objp, object *other_objp);
extern void ai_set_guard_wing(object *objp, int wingnum);
extern void ai_warp_out(object *objp, vector *vp);
extern void ai_warp_out(object *objp, vec3d *vp);
extern void ai_attack_wing(object *attacker, int wingnum, int priority);
extern void ai_deathroll_start(object *ship_obj);
extern void ai_fly_in_formation(int wing_num); // Force wing to fly in formation.
extern void ai_disband_formation(int wing_num); // Force wing to disband formation flying.
extern object *ai_find_docked_object( object *objp ); // returns object that objp is docked to
extern int set_target_objnum(ai_info *aip, int objnum);
extern void ai_form_on_wing(object *objp, object *goal_objp);
extern void ai_do_stay_near(object *objp, object *other_obj, float dist);
extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int parent_objnum);
extern void ai_rearm_repair( object *objp, object *goal_objp, int priority, int docker_index, int dockee_index );
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index, int priority );
extern void ai_add_rearm_goal( object *requester_objp, object *support_objp );
extern void create_model_path(object *pl_objp, object *mobjp, int path_num, int subsys_path=0);
// Goober5000
extern void ai_do_safety(object *objp);
// used to get path info for fighter bay emerging and departing
int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, vector *pos, vector *fvec);
int ai_acquire_depart_path(object *pl_objp, int parent_objnum);
int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, int path_mask, vec3d *pos, vec3d *fvec);
int ai_acquire_depart_path(object *pl_objp, int parent_objnum, int path_mask);
// used by AiBig.cpp
extern void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vector *player_pos, vector *enemy_pos);
extern void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vec3d *player_pos, vec3d *enemy_pos);
extern void accelerate_ship(ai_info *aip, float accel);
extern void turn_away_from_point(object *objp, vector *point, float bank_override);
extern void turn_away_from_point(object *objp, vec3d *point, float bank_override);
extern float ai_endangered_by_weapon(ai_info *aip);
extern void update_aspect_lock_information(ai_info *aip, vector *vec_to_enemy, float dist_to_enemy, float enemy_radius);
extern void update_aspect_lock_information(ai_info *aip, vec3d *vec_to_enemy, float dist_to_enemy, float enemy_radius);
extern void ai_chase_ct();
extern void ai_find_path(object *pl_objp, int objnum, int path_num, int exit_flag, int subsys_path=0);
extern float ai_path();
extern void evade_weapon();
extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enemy, float dist_to_enemy, float duration);
extern void ai_fire_primary_weapon(object *objp);
extern int ai_fire_primary_weapon(object *objp); //changed to return weather it fired-Bobboau
extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priority2 = -1);
extern float ai_get_weapon_dist(ship_weapon *swp);
extern void turn_towards_point(object *objp, vector *point, vector *slide_vec, float bank_override);
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(vector *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
extern int is_instructor(object *objp);
extern int find_enemy(int objnum, float range, int max_attackers);
float ai_get_weapon_speed(ship_weapon *swp);
void set_predicted_enemy_pos_turret(vector *predicted_enemy_pos, vector *gun_pos, object *pobjp, vector *enemy_pos, vector *enemy_vel, float weapon_speed, float time_enemy_in_range);
void ai_turret_select_default_weapon(ship_subsys *turret);
void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
// function to change rearm status for ai ships (called from sexpression code)
extern void ai_set_rearm_status( int team, int new_status );
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, char *shipname );
extern void ai_do_objects_docked_stuff( object *docker, object *dockee );
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point);
extern void ai_do_objects_undocked_stuff( object *docker, object *dockee );
extern void ai_do_objects_repairing_stuff( object *repaired_obj, object *repair_obj, int how );
@@ -720,4 +881,17 @@ extern int find_danger_weapon(object *sobjp, float dtime, float *atime, float do
void ai_set_mode_warp_out(object *objp, ai_info *aip);
// prototyped by Goober5000
int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float range, int max_attackers);
// moved to header file by Goober5000
void ai_announce_ship_dying(object *dying_objp);
// added by kazan
void ai_start_fly_to_ship(object *objp, int shipnum);
void ai_fly_to_ship();
//Moved declaration here for player ship -WMC
void process_subobjects(int objnum);
#endif
+397
View File
@@ -0,0 +1,397 @@
/*
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
/*
* $Logfile: /Freespace2/code/ai/ai_profiles.cpp $
* $Revision: 1.22 $
* $Date: 2007-09-02 02:10:23 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.21 2007/07/19 03:19:32 turey
* Made Backslash's change to dampening tied to an ai_profiles flag, as it does affect
* retail behavior, and significantly affects gameplay in the BtRL Demo.
* Also, fixed a typo.
*
* Revision 1.20 2007/07/15 02:45:17 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.19 2007/02/27 01:44:48 Goober5000
* add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
*
* Revision 1.18 2006/12/28 00:59:18 wmcoolmon
* WMC codebase commit. See pre-commit build thread for details on changes.
*
* Revision 1.17 2006/09/11 06:49:38 taylor
* fixes for stuff_string() bounds checking
*
* Revision 1.16 2006/07/12 04:59:03 taylor
* fix the endless-loop fix ;) (this is what broke shield recharging btw)
*
* Revision 1.15 2006/07/06 18:19:59 Goober5000
* fix dumb endless loop bug
* --Goober5000
*
* Revision 1.14 2006/07/02 03:39:55 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"
#include "globalincs/def_files.h"
#include "ai/ai_profiles.h"
#include "parse/parselo.h"
#include "localization/localize.h"
// global stuff
int Num_ai_profiles;
int Default_ai_profile;
ai_profile_t Ai_profiles[MAX_AI_PROFILES];
// local to this file
static int Ai_profiles_initted = 0;
static char Default_profile_name[NAME_LENGTH];
// utility
void set_flag(ai_profile_t *profile, char *name, int flag)
{
if (optional_string(name))
{
bool val;
stuff_boolean(&val);
if (val)
profile->flags |= flag;
else
profile->flags &= ~flag;
}
}
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;
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
{
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default ai_profiles.tbl>", rval));
lcl_ext_close();
return;
}
if (filename == NULL)
read_file_text_from_array(defaults_get_file("ai_profiles.tbl"));
else
read_file_text(filename);
reset_parse();
// start parsing
required_string("#AI Profiles");
// new default?
if (optional_string("$Default Profile:"))
stuff_string(Default_profile_name, F_NAME, NAME_LENGTH);
// begin reading data
while (required_string_either("#End","$Profile Name:"))
{
ai_profile_t *profile = &dummy_profile;
ai_profile_t *previous_profile = NULL;
// get the name
required_string("$Profile Name:");
stuff_string(profile_name, F_NAME, NAME_LENGTH);
// see if it exists
for (i = 0; i < Num_ai_profiles; i++)
{
if (!stricmp(Ai_profiles[i].profile_name, profile_name))
{
previous_profile = &Ai_profiles[i];
break;
}
}
// modular table stuff
if (optional_string("+nocreate"))
{
no_create = true;
// use the previous one if possible,
// otherwise continue to use the dummy one
if (previous_profile != NULL)
profile = previous_profile;
}
else
{
// don't create multiple profiles with the same name
if (previous_profile != NULL)
{
Warning(LOCATION, "An ai profile named '%s' already exists! The new one will not be created.\n", profile_name);
}
else
{
// make sure we're under the limit
if (Num_ai_profiles >= MAX_AI_PROFILES)
{
Warning(LOCATION, "Too many profiles in ai_profiles.tbl! Max is %d.\n", MAX_AI_PROFILES-1); // -1 because one is built-in
skip_to_string("#End", NULL);
break;
}
profile = &Ai_profiles[Num_ai_profiles];
Num_ai_profiles++;
}
}
// initialize profile if we're not building from a previously parsed one
if (!no_create)
{
// base profile, so zero it out
if (profile == &Ai_profiles[0])
{
memset(profile, 0, sizeof(ai_profile_t));
}
// brand new profile, so set it to the base defaults
else
{
memcpy(profile, &Ai_profiles[0], sizeof(ai_profile_t));
}
}
// set the name
strcpy(profile->profile_name, profile_name);
// fill in any and all settings; they're all optional and can be in any order
while (!check_for_string("$Profile Name:") && !check_for_string("#End"))
{
if (optional_string("$Player Afterburner Recharge Scale:"))
parse_float_list(profile->afterburner_recharge_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Beam Friendly Fire Damage:"))
parse_float_list(profile->beam_friendly_damage_cap, NUM_SKILL_LEVELS);
if (optional_string("$Player Countermeasure Life Scale:"))
parse_float_list(profile->cmeasure_life_scale, NUM_SKILL_LEVELS);
if (optional_string("$AI Countermeasure Firing Chance:"))
parse_float_list(profile->cmeasure_fire_chance, NUM_SKILL_LEVELS);
if (optional_string("$AI In Range Time:"))
parse_float_list(profile->in_range_time, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Ammo Weapons:"))
parse_float_list(profile->link_ammo_levels_maybe, 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:"))
parse_int_list(profile->max_allowed_player_homers, NUM_SKILL_LEVELS);
if (optional_string("$Max Player Attackers:"))
parse_int_list(profile->max_attackers, NUM_SKILL_LEVELS);
if (optional_string("$Max Incoming Asteroids:"))
parse_int_list(profile->max_incoming_asteroids, NUM_SKILL_LEVELS);
if (optional_string("$Player Damage Factor:") || optional_string("$AI Damage Reduction to Player Hull:"))
parse_float_list(profile->player_damage_scale, 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);
// represented in fractions of F1_0
if (optional_string("$Predict Position Delay:"))
{
int i;
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]);
}
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);
if (optional_string("$Friendly AI Fire Delay Scale:"))
parse_float_list(profile->ship_fire_delay_scale_friendly, NUM_SKILL_LEVELS);
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("$AI Turn Time Scale:"))
parse_float_list(profile->turn_time_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, 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);
set_flag(profile, "$smart primary weapon selection:", AIPF_SMART_PRIMARY_WEAPON_SELECTION);
set_flag(profile, "$smart secondary weapon selection:", AIPF_SMART_SECONDARY_WEAPON_SELECTION);
set_flag(profile, "$smart shield management:", AIPF_SMART_SHIELD_MANAGEMENT);
set_flag(profile, "$allow rapid secondary dumbfire:", AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE);
set_flag(profile, "$huge turret weapons ignore bombs:", AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS);
set_flag(profile, "$don't insert random turret fire delay:", AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY);
set_flag(profile, "$shockwaves damage small ship subsystems:", AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS);
set_flag(profile, "$navigation subsystem governs warpout capability:", AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AIPF_NO_MIN_DOCK_SPEED_CAP);
set_flag(profile, "$disable linked fire penalty:", AIPF_DISABLE_LINKED_FIRE_PENALTY);
set_flag(profile, "$disable weapon damage scaling:", AIPF_DISABLE_WEAPON_DAMAGE_SCALING);
set_flag(profile, "$use additive weapon velocity:", AIPF_USE_ADDITIVE_WEAPON_VELOCITY);
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) )
Mp++;
// find next valid option
skip_to_start_of_string_either("$", "#");
saved_Mp = Mp;
}
}
required_string("#End");
// close localization
lcl_ext_close();
}
void ai_profiles_init()
{
int temp;
if (Ai_profiles_initted)
return;
Num_ai_profiles = 0;
Default_ai_profile = 0;
Default_profile_name[0] = '\0';
// init retail entry first
parse_ai_profiles_tbl(NULL);
// now parse the supplied table (if any)
if (cf_exists_full("ai_profiles.tbl", CF_TYPE_TABLES))
parse_ai_profiles_tbl("ai_profiles.tbl");
// parse any modular tables
parse_modular_table("*-aip.tbm", parse_ai_profiles_tbl);
// set default if specified
temp = ai_profile_lookup(Default_profile_name);
if (temp >= 0)
Default_ai_profile = temp;
Ai_profiles_initted = 1;
}
int ai_profile_lookup(char *name)
{
for (int i = 0; i < Num_ai_profiles; i++)
if (!stricmp(name, Ai_profiles[i].profile_name))
return i;
return -1;
}
+132
View File
@@ -0,0 +1,132 @@
/*
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
/*
* $Logfile: /Freespace2/code/ai/ai_profiles.h $
* $Revision: 1.9 $
* $Date: 2007-07-28 22:04:46 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.8 2007/07/19 03:19:32 turey
* Made Backslash's change to dampening tied to an ai_profiles flag, as it does affect
* retail behavior, and significantly affects gameplay in the BtRL Demo.
* Also, fixed a typo.
*
* Revision 1.7 2007/07/15 02:45:17 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.6 2007/02/27 01:44:48 Goober5000
* add two features for WCS: specifyable shield/weapon recharge rates, and removal of linked fire penalty
*
* Revision 1.5 2006/07/02 03:39:55 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_
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
// flags
#define AIPF_SMART_SHIELD_MANAGEMENT (1 << 0)
#define AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS (1 << 1)
#define AIPF_SMART_PRIMARY_WEAPON_SELECTION (1 << 2)
#define AIPF_SMART_SECONDARY_WEAPON_SELECTION (1 << 3)
#define AIPF_ALLOW_RAPID_SECONDARY_DUMBFIRE (1 << 4)
#define AIPF_HUGE_TURRET_WEAPONS_IGNORE_BOMBS (1 << 5)
#define AIPF_DONT_INSERT_RANDOM_TURRET_FIRE_DELAY (1 << 6)
#define AIPF_HACK_IMPROVE_NON_HOMING_SWARM_TURRET_FIRE_ACCURACY (1 << 7)
#define AIPF_SHOCKWAVES_DAMAGE_SMALL_SHIP_SUBSYSTEMS (1 << 8)
#define AIPF_NAVIGATION_SUBSYS_GOVERNS_WARP (1 << 9)
#define AIPF_NO_MIN_DOCK_SPEED_CAP (1 << 10)
#define AIPF_DISABLE_LINKED_FIRE_PENALTY (1 << 11)
#define AIPF_DISABLE_WEAPON_DAMAGE_SCALING (1 << 12)
#define AIPF_USE_ADDITIVE_WEAPON_VELOCITY (1 << 13)
#define AIPF_USE_NEWTONIAN_DAMPENING (1 << 14)
#define MAX_AI_PROFILES 5
typedef struct ai_profile_t {
char profile_name[NAME_LENGTH];
int flags;
// difficulty-related values
int max_incoming_asteroids[NUM_SKILL_LEVELS]; // max number of asteroids thrown at friendlies
int max_allowed_player_homers[NUM_SKILL_LEVELS]; // max number of simultaneous homing weapons on player
int max_attackers[NUM_SKILL_LEVELS]; // max number of ships that can attack a ship
fix predict_position_delay[NUM_SKILL_LEVELS]; // how long until AI predicts a ship position
float in_range_time[NUM_SKILL_LEVELS]; // seconds to add to time it takes to get enemy in range (only for player's enemies)
float shield_manage_delay[NUM_SKILL_LEVELS]; // how long before AI manages shields (note that the player's team always uses the average skill's delay)
// AI ships link primaries if energy levels greater than these percents
float link_energy_levels_always[NUM_SKILL_LEVELS]; // always link
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
// difficulty-related scales
float cmeasure_life_scale[NUM_SKILL_LEVELS]; // life of countermeasures
float cmeasure_fire_chance[NUM_SKILL_LEVELS]; // chance a countermeasure will be fired based on skill level (also scaled by ai_class)
float weapon_energy_scale[NUM_SKILL_LEVELS]; // weapon energy available
float shield_energy_scale[NUM_SKILL_LEVELS]; // shield energy available
float afterburner_recharge_scale[NUM_SKILL_LEVELS]; // speed of afterburner recharge
float player_damage_scale[NUM_SKILL_LEVELS]; // damage applied to the player
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
// 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];
} ai_profile_t;
extern int Num_ai_profiles;
extern int Default_ai_profile;
extern ai_profile_t Ai_profiles[MAX_AI_PROFILES];
void ai_profiles_init();
int ai_profile_lookup(char *name);
#endif
+235 -126
View File
@@ -9,13 +9,112 @@
/*
* $Logfile: /Freespace2/code/Ship/AiBig.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:26:01 $
* $Author: penguin $
* $Revision: 1.14 $
* $Date: 2007-07-15 04:19:24 $
* $Author: Goober5000 $
*
* C module for AI code related to large ships
*
* $Log: not supported by cvs2svn $
* Revision 1.13 2007/02/20 04:20:10 Goober5000
* the great big duplicate model removal commit
*
* Revision 1.12 2006/02/25 21:46:59 Goober5000
* spelling
*
* Revision 1.11 2006/01/13 03:30:59 Goober5000
* übercommit of custom IFF stuff :)
*
* Revision 1.10 2005/11/21 02:43:30 Goober5000
* change from "setting" to "profile"; this way makes more sense
* --Goober5000
*
* Revision 1.9 2005/11/21 00:46:05 Goober5000
* add ai_settings.tbl
* --Goober5000
*
* Revision 1.8 2005/10/22 22:22:41 Goober5000
* rolled back UnknownPlayer's commit
* --Goober5000
*
* Revision 1.6 2005/09/01 04:14:03 taylor
* various weapon_range cap fixes for primary, secondary weapons and hud targetting info
*
* Revision 1.5 2005/07/27 18:27:49 Goober5000
* verified that submode_start_time is updated whenever submode is changed
* --Goober5000
*
* Revision 1.4 2005/07/25 05:23:33 Goober5000
* whoops
* --Goober5000
*
* Revision 1.3 2005/07/25 03:13:23 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.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.12 2005/03/10 08:00:14 taylor
* change min/max to MIN/MAX to fix GCC problems
* add lab stuff to Makefile
* build unbreakage for everything that's not MSVC++ 6
* lots of warning fixes
* fix OpenGL rendering problem with ship insignias
* no Warnings() in non-debug mode for Linux (like Windows)
* some campaign savefile fixage to stop reverting everyones data
*
* Revision 2.11 2004/11/27 10:49:14 taylor
* make sure the old behavior still applies to everything that's not a beam
*
* Revision 2.10 2004/07/26 20:47:50 Kazan
* remove MCD complete
*
* Revision 2.9 2004/07/12 16:33:04 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.8 2004/03/05 09:01:51 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.7 2003/11/11 02:15:40 Goober5000
* ubercommit - basically spelling and language fixes with some additional
* warnings disabled
* --Goober5000
*
* Revision 2.6 2003/06/25 03:16:32 phreak
* changed around ai code to take into account a limited lock range for local ssms
*
* Revision 2.5 2003/06/11 03:03:16 phreak
* the ai can now use local ssms. they are able to use them at *very* long range
*
* Revision 2.4 2003/03/20 08:24:45 unknownplayer
* Modified the command line options so they are all in lower-case characters.
* Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
*
* Revision 2.3 2003/01/15 07:09:09 Goober5000
* changed most references to modelnum to use ship instead of ship_info --
* this will help with the change-model sexp and any other instances of model
* changing
* --Goober5000
*
* 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.2 2002/05/03 22:07:09 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:12 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -331,38 +430,18 @@
* $NoKeywords: $
*/
#include "pstypes.h"
#include "fix.h"
#include "linklist.h"
#include "object.h"
#include "physics.h"
#include "vecmat.h"
#include "ship.h"
#include "model.h"
#include "2d.h"
#include "3d.h"
#include "ai.h"
#include "aibig.h"
#include "floating.h"
#include "player.h"
#include "freespace.h"
#include "weapon.h"
#include "missiongoals.h"
#include "missionlog.h"
#include "timer.h"
#include "sound.h"
#include "aigoals.h"
#include "gamesnd.h"
#include "hudmessage.h"
#include "missionmessage.h"
#include "cmeasure.h"
#include "staticrand.h"
#include "multimsgs.h"
#include "afterburner.h"
#include "hudets.h"
#include "shipfx.h"
#include "shiphit.h"
#include "missionparse.h"
#include "ai/aibig.h"
#include "globalincs/linklist.h"
#include "object/object.h"
#include "ship/ship.h"
#include "ship/afterburner.h"
#include "freespace2/freespace.h"
#include "weapon/weapon.h"
#include "io/timer.h"
#include "mission/missionparse.h"
#include "iff_defs/iff_defs.h"
#pragma optimize("", off)
#pragma auto_inline(off)
@@ -395,13 +474,13 @@
// forward declarations
void ai_big_evade_ship();
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float dist_to_enemy);
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float dist_to_enemy, int modelnum);
void ai_big_avoid_ship();
int ai_big_maybe_follow_subsys_path(int do_dot_check=1);
extern int model_which_octant_distant_many( vector *pnt, int model_num,matrix *model_orient, vector * model_pos, polymodel **pm, int *octs);
extern void compute_desired_rvec(vector *rvec, vector *goal_pos, vector *cur_pos);
extern void big_ship_collide_recover_start(object *objp, object *big_objp, vector *collide_pos, vector *collision_normal);
extern int model_which_octant_distant_many( vec3d *pnt, int model_num,matrix *model_orient, vec3d * model_pos, polymodel **pm, int *octs);
extern void compute_desired_rvec(vec3d *rvec, vec3d *goal_pos, vec3d *cur_pos);
extern void big_ship_collide_recover_start(object *objp, object *big_objp, vec3d *collide_pos, vec3d *collision_normal);
// Called by ai_big_pick_attack_point.
@@ -409,20 +488,21 @@ extern void big_ship_collide_recover_start(object *objp, object *big_objp, vecto
// If truly_random flag set (haha), then generate a pretty random number. Otherwise, generate a static rand which
// tends to not change from frame to frame.
// Try four times and choose nearest point to increase chance of getting a good point.
void ai_bpap(object *objp, vector *attacker_objp_pos, vector *attacker_objp_fvec, vector *attack_point, vector *local_attack_point, float fov, float weapon_travel_dist, vector *surface_normal)
void ai_bpap(object *objp, vec3d *attacker_objp_pos, vec3d *attacker_objp_fvec, vec3d *attack_point, vec3d *local_attack_point, float fov, float weapon_travel_dist, vec3d *surface_normal)
{
float nearest_dist;
vector result_point, best_point;
vector rel_point;
vec3d result_point, best_point;
vec3d rel_point;
int num_tries;
model_octant *octp;
polymodel *pm;
int i, q, octs[4];
ship_info *sip = &Ship_info[Ships[objp->instance].ship_info_index];
best_point = objp->pos;
nearest_dist = weapon_travel_dist;
model_which_octant_distant_many(attacker_objp_pos, Ships[objp->instance].modelnum, &objp->orient, &objp->pos, &pm, octs);
model_which_octant_distant_many(attacker_objp_pos, sip->model_num, &objp->orient, &objp->pos, &pm, octs);
num_tries = (int) (vm_vec_dist(&objp->pos, attacker_objp_pos)/objp->radius);
@@ -453,7 +533,7 @@ void ai_bpap(object *objp, vector *attacker_objp_pos, vector *attacker_objp_fvec
for (i=0; i<num_tries; i++) {
int index;
float dist, dot;
vector v2p;
vec3d v2p;
index = (int) (frand() * (octp->nverts));
@@ -486,7 +566,7 @@ done_1:
// If no collision, cast to (0,0,0) [center of big ship]** [best_point initialized to 000]
// do in world coords to get attack point, then translate to local for local_attack_point
vector attack_dir, end_point, temp;
vec3d attack_dir, end_point, temp;
float dist;
dist = vm_vec_normalized_dir(&attack_dir, attack_point, attacker_objp_pos);
@@ -497,7 +577,7 @@ done_1:
}
mc_info mc;
mc.model_num = Ships[objp->instance].modelnum;
mc.model_num = sip->model_num;
mc.orient = &objp->orient;
mc.pos = &objp->pos;
mc.p0 = attacker_objp_pos;
@@ -527,14 +607,14 @@ done_1:
//
// Note: Default value for fov is 1.0f 1.0f means don't use fov parameter.
// If fov != 1.0f, try up to four times to find a point that's in the field of view.
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vector *gpos, vector *gvec, vector *attack_point, float fov, float weapon_travel_dist)
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float fov, float weapon_travel_dist)
{
if (!timestamp_elapsed(ssp->turret_pick_big_attack_point_timestamp)) {
vector result_point;
vec3d result_point;
vm_vec_unrotate(&result_point, &ssp->turret_big_attack_point, &objp->orient);
vm_vec_add(attack_point, &result_point, &objp->pos);
} else {
vector local_attack_point;
vec3d local_attack_point;
ssp->turret_pick_big_attack_point_timestamp = timestamp(2000 + (int) (frand()*500.0f));
ai_bpap(objp, gpos, gvec, attack_point, &local_attack_point, fov, weapon_travel_dist, NULL);
ssp->turret_big_attack_point = local_attack_point;
@@ -547,19 +627,19 @@ void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vector *gpo
// Note: Default value for fov is 1.0f 1.0f means don't use fov parameter.
// If fov != 1.0f, try up to four times to find a point that's in the field of view.
// Note, attacker_objp can be a ship or a weapon.
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attack_point, float fov)
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov)
{
Assert(objp->instance > -1);
Assert(objp->type == OBJ_SHIP);
vector local_attack_point;
vec3d local_attack_point;
switch (attacker_objp->type) {
case OBJ_SHIP: {
ai_info *attacker_aip;
attacker_aip = &Ai_info[Ships[attacker_objp->instance].ai_index];
if (!timestamp_elapsed(attacker_aip->pick_big_attack_point_timestamp)) {
vector result_point;
vec3d result_point;
vm_vec_unrotate(&result_point, &attacker_aip->big_attack_point, &objp->orient);
vm_vec_add(attack_point, &result_point, &objp->pos);
@@ -574,7 +654,7 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attac
weapon *wp = &Weapons[attacker_objp->instance];
if (!timestamp_elapsed(wp->pick_big_attack_point_timestamp)) {
vector result_point;
vec3d result_point;
vm_vec_unrotate(&result_point, &wp->big_attack_point, &objp->orient);
vm_vec_add(attack_point, &result_point, &objp->pos);
@@ -588,8 +668,8 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attac
}
// checks valid line to target
vector surface_normal;
ai_bpap(objp, &attacker_objp->pos, &attacker_objp->orient.fvec, attack_point, &local_attack_point, fov, 99999.9f, &surface_normal);
vec3d surface_normal;
ai_bpap(objp, &attacker_objp->pos, &attacker_objp->orient.vec.fvec, attack_point, &local_attack_point, fov, 99999.9f, &surface_normal);
switch (attacker_objp->type) {
case OBJ_SHIP: {
@@ -618,11 +698,11 @@ void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attac
// Handler for SM_EVADE submode ( called from ai_big_chase() )
void ai_big_evade_ship()
{
vector player_pos, enemy_pos;
vec3d player_pos, enemy_pos;
float dist;
ship *shipp = &Ships[Pl_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];
vector randvec, semi_enemy_pos;
vec3d randvec, semi_enemy_pos;
ai_set_positions(Pl_objp, En_objp, aip, &player_pos, &enemy_pos);
@@ -639,7 +719,7 @@ void ai_big_evade_ship()
turn_away_from_point(Pl_objp, &semi_enemy_pos, 0.0f);
float box_dist;
vector box_vec;
vec3d box_vec;
int is_inside;
box_dist = get_world_closest_box_point_with_delta(&box_vec, En_objp, &player_pos, &is_inside, EVADE_BOX_BASE_DISTANCE);
if (box_dist > EVADE_BOX_BASE_DISTANCE) {
@@ -699,7 +779,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
int subsys_path_num, subsys_in_sight, checked_sight;
float dist;
pm = model_get( Ships[Pl_objp->instance].modelnum );
pm = model_get( Ship_info[Ships[Pl_objp->instance].ship_info_index].model_num );
// If attacking a subsystem, ensure that we have an unobstructed line of sight... if not, then move
// towards path linked to subsystem
@@ -708,14 +788,14 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
// only check for subsystem sight every N milliseconds
checked_sight = 0;
if ( timestamp_elapsed(aip->path_subsystem_next_check) ) {
vector geye, gsubpos;
vec3d geye, gsubpos;
eye *ep;
aip->path_subsystem_next_check = timestamp(1500);
// get world pos of eye (stored in geye)
ep = &(pm->view_positions[0] );
model_find_world_point( &geye, &ep->pnt, Ships[Pl_objp->instance].modelnum, 0, &Pl_objp->orient, &Pl_objp->pos );
ep = &(pm->view_positions[Ships[Pl_objp->instance].current_viewpoint]);
model_find_world_point( &geye, &ep->pnt, pm->id, 0, &Pl_objp->orient, &Pl_objp->pos );
// get world pos of subsystem
vm_vec_unrotate(&gsubpos, &aip->targeted_subsys->system_info->pnt, &En_objp->orient);
@@ -725,7 +805,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
// Calc dot between subsys normal (based on using path info), and subsys_to_eye vector. This is
// useful later when we want to decide whether we have a realistic line-of-sight to the subsystem.
vector subsys_normal, subsys_to_eye;
vec3d subsys_normal, subsys_to_eye;
if ( do_dot_check ) {
if ( !ship_return_subsys_path_normal(&Ships[target_objp->instance], aip->targeted_subsys, &gsubpos, &subsys_normal) ) {
vm_vec_normalized_dir(&subsys_to_eye, &geye, &gsubpos);
@@ -794,6 +874,7 @@ int ai_big_maybe_follow_subsys_path(int do_dot_check)
aip->previous_mode = aip->mode;
aip->mode = AIM_NONE;
aip->submode = -1;
aip->submode_start_time = Missiontime;
return 1;
}
ai_path();
@@ -836,7 +917,7 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
test_objp = &Objects[so->objnum];
test_sp = &Ships[test_objp->instance];
if ( test_sp->team != Ships[Pl_objp->instance].team ) {
if ( iff_x_attacks_y(Ships[Pl_objp->instance].team, test_sp->team) ) {
if ( Ship_info[test_sp->ship_info_index].flags & SIF_SMALL_SHIP ) {
dist_squared = vm_vec_dist_squared(&Pl_objp->pos, &test_objp->pos);
if ( dist_squared < ENTER_STRAFE_THREAT_DIST_SQUARED ) {
@@ -853,11 +934,11 @@ int ai_big_maybe_start_strafe(ai_info *aip, ship_info *sip)
}
// ATTACK submode handler for chase mode.
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float dist_to_enemy)
void ai_big_chase_attack(ai_info *aip, ship_info *sip, vec3d *enemy_pos, float dist_to_enemy, int modelnum)
{
int start_bank;
float dot_to_enemy, time_to_hit;
polymodel *po = model_get( sip->modelnum );
polymodel *po = model_get( modelnum );
// Maybe evade an incoming weapon.
if (((time_to_hit = ai_endangered_by_weapon(aip)) < 4.0f) && (time_to_hit >= 0.0f)) {
@@ -869,15 +950,15 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
if (Pl_objp->phys_info.speed < 3.0f) {
object *objp;
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if ((objp->type == OBJ_WEAPON) && (Weapons[objp->instance].team != Ships[Pl_objp->instance].team))
if ((objp->type == OBJ_WEAPON) && (iff_x_attacks_y(Ships[Pl_objp->instance].team, Weapons[objp->instance].team)))
if (Weapon_info[objp->instance].subtype == WP_LASER) {
vector in_vec;
vec3d in_vec;
float dist;
vm_vec_sub(&in_vec, &objp->pos, &Pl_objp->pos);
if (vm_vec_dot(&in_vec, &objp->orient.fvec) > 0.0f) {
if (vm_vec_dot(&in_vec, &objp->orient.vec.fvec) > 0.0f) {
dist = vm_vec_normalize(&in_vec);
if ((dist < 200.0f) && (vm_vec_dot(&in_vec, &objp->orient.fvec) > 0.95f)) {
if ((dist < 200.0f) && (vm_vec_dot(&in_vec, &objp->orient.vec.fvec) > 0.95f)) {
if ((Objects[objp->parent].signature == objp->parent_sig) && (vm_vec_dist_quick(&objp->pos, &Objects[objp->parent].pos) < 300.0f)) {
set_target_objnum(aip, objp->parent);
aip->submode = SM_ATTACK;
@@ -910,7 +991,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
return;
}
vector *rel_pos, vec_to_enemy;
vec3d *rel_pos, vec_to_enemy;
float weapon_travel_dist;
start_bank = Ships[aip->shipnum].weapons.current_primary_bank;
@@ -921,9 +1002,9 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
rel_pos = NULL;
dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, enemy_pos, &Pl_objp->pos);
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.fvec);
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
vector rvec_vec, *rvec = &rvec_vec;
vec3d rvec_vec, *rvec = &rvec_vec;
if (dist_to_enemy > 500.0f)
compute_desired_rvec(rvec, enemy_pos, &Pl_objp->pos);
@@ -940,7 +1021,7 @@ void ai_big_chase_attack(ai_info *aip, ship_info *sip, vector *enemy_pos, float
accelerate_ship(aip, 1.0f);
else {
// AL 12-31-97: Move at least as quickly as your target is moving...
accelerate_ship(aip, max(1.0f - dot_to_enemy, Objects[aip->target_objnum].phys_info.fspeed/sip->max_speed));
accelerate_ship(aip, MAX(1.0f - dot_to_enemy, Objects[aip->target_objnum].phys_info.fspeed/sip->max_speed));
}
} else {
@@ -978,7 +1059,7 @@ void ai_big_chase_ct()
extern void ai_select_secondary_weapon(object *objp, ship_weapon *swp, int priority1 = -1, int priority2 = -1);
extern float set_secondary_fire_delay(ai_info *aip, ship *shipp, weapon_info *swip);
extern void ai_choose_secondary_weapon(object *objp, ai_info *aip, object *en_objp);
extern int maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vector *goal_point, float delta_time);
extern int maybe_avoid_big_ship(object *objp, object *ignore_objp, ai_info *aip, vec3d *goal_point, float delta_time);
extern void maybe_cheat_fire_synaptic(object *objp, ai_info *aip);
@@ -987,20 +1068,21 @@ extern void maybe_cheat_fire_synaptic(object *objp, ai_info *aip);
// dist_to_enemy => distance (in m) to attack point on current target
// dot_to_enemy => dot product between fvec of Pl_objp and vector from Pl_objp to attack point
//
void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *firing_pos, vector *enemy_pos, vector *enemy_vel)
void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vec3d *firing_pos, vec3d *enemy_pos, vec3d *enemy_vel)
{
ai_info *aip;
ship_weapon *swp;
int has_fired = -1;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
swp = &Ships[Pl_objp->instance].weapons;
if (dot_to_enemy > 0.95f - 0.5f * En_objp->radius/max(1.0f, En_objp->radius + dist_to_enemy)) {
if (dot_to_enemy > 0.95f - 0.5f * En_objp->radius/MAX(1.0f, En_objp->radius + dist_to_enemy)) {
aip->time_enemy_in_range += flFrametime;
// Chance of hitting ship is based on dot product of firing ship's forward vector with vector to ship
// and also the size of the target relative to distance to target.
if (dot_to_enemy > max(0.5f, 0.90f + aip->ai_accuracy/10.0f - En_objp->radius/max(1.0f,dist_to_enemy))) {
if (dot_to_enemy > MAX(0.5f, 0.90f + aip->ai_accuracy/10.0f - En_objp->radius/MAX(1.0f,dist_to_enemy))) {
ship *temp_shipp;
temp_shipp = &Ships[Pl_objp->instance];
@@ -1010,8 +1092,13 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
Assert(tswp->current_primary_bank < tswp->num_primary_banks);
weapon_info *wip = &Weapon_info[tswp->primary_bank_weapons[tswp->current_primary_bank]];
if (dist_to_enemy < wip->max_speed * wip->lifetime)
ai_fire_primary_weapon(Pl_objp);
if (dist_to_enemy < MIN((wip->max_speed * wip->lifetime), wip->weapon_range)){
has_fired = 1;
if(! ai_fire_primary_weapon(Pl_objp)){
has_fired = -1;
// ship_stop_fire_primary(Pl_objp);
}
}
int priority1, priority2;
@@ -1040,8 +1127,11 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
}
if (timestamp_elapsed(swp->next_secondary_fire_stamp[current_bank])) {
float firing_range = swip->max_speed * swip->lifetime;
float firing_range;
if (swip->wi_flags2 & WIF2_LOCAL_SSM)
firing_range=swip->lssm_lock_range;
else
firing_range = MIN((swip->max_speed * swip->lifetime), swip->weapon_range);
// reduce firing range of secondaries in nebula
extern int Nebula_sec_range;
if ((The_mission.flags & MISSION_FLAG_FULLNEB) && Nebula_sec_range) {
@@ -1075,6 +1165,11 @@ void ai_big_maybe_fire_weapons(float dist_to_enemy, float dot_to_enemy, vector *
} else {
aip->time_enemy_in_range *= (1.0f - flFrametime);
}
if(has_fired == -1){ //stuff that hapens when the ship stops fireing
ship_stop_fire_primary(Pl_objp);
}
}
// switch ai ship into chase mode
@@ -1086,18 +1181,18 @@ void ai_big_switch_to_chase_mode(ai_info *aip)
aip->submode_start_time = Missiontime;
}
extern int ai_big_strafe_maybe_retreat(float dist, vector *target_pos);
extern int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos);
// Make object Pl_objp chase object En_objp, which is a big ship, not a small ship.
void ai_big_chase()
{
float dist_to_enemy, dot_to_enemy;
vector player_pos, enemy_pos, vec_to_enemy;
vec3d player_pos, enemy_pos, vec_to_enemy;
ship_info *sip = &Ship_info[Ships[Pl_objp->instance].ship_info_index];
ship *shipp = &Ships[Pl_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];
int enemy_ship_type;
vector predicted_enemy_pos;
vec3d predicted_enemy_pos;
Assert(aip->mode == AIM_CHASE);
@@ -1123,13 +1218,14 @@ void ai_big_chase()
}
dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, &enemy_pos, &player_pos); // - En_objp->radius;
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.fvec);
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
if (aip->ai_flags & AIF_TARGET_COLLISION) {
if ( ai_big_strafe_maybe_retreat(dist_to_enemy, &enemy_pos) ) {
aip->mode = AIM_STRAFE;
aip->submode = AIS_STRAFE_AVOID;
aip->submode_parm0 = Missiontime; // use parm0 as time strafe mode entered
aip->submode = AIS_STRAFE_AVOID;
aip->submode_start_time = Missiontime;
return;
}
}
@@ -1152,12 +1248,12 @@ void ai_big_chase()
vm_vec_add2(&enemy_pos, &predicted_enemy_pos);
vm_vec_sub2(&enemy_pos, &En_objp->pos);
dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, &enemy_pos, &player_pos); // - En_objp->radius;
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.fvec);
dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
update_aspect_lock_information(aip, &vec_to_enemy, dist_to_enemy, En_objp->radius);
} else if (En_objp->flags & OF_PROTECTED) { // If protected and we're not attacking a subsystem, stop attacking!
update_aspect_lock_information(aip, &vec_to_enemy, dist_to_enemy - En_objp->radius, En_objp->radius);
aip->target_objnum = -1;
if (find_enemy(Pl_objp-Objects, MAX_ENEMY_DISTANCE, Skill_level_max_attackers[Game_skill_level]) == -1) {
if (find_enemy(Pl_objp-Objects, MAX_ENEMY_DISTANCE, The_mission.ai_profile->max_attackers[Game_skill_level]) == -1) {
ai_do_default_behavior(Pl_objp);
return;
}
@@ -1195,7 +1291,7 @@ void ai_big_chase()
case SM_ATTACK:
case SM_SUPER_ATTACK:
case SM_ATTACK_FOREVER:
ai_big_chase_attack(aip, sip, &enemy_pos, dist_to_enemy);
ai_big_chase_attack(aip, sip, &enemy_pos, dist_to_enemy, sip->model_num);
break;
case SM_EVADE:
@@ -1213,6 +1309,7 @@ void ai_big_chase()
default:
aip->last_attack_time = Missiontime;
aip->submode = SM_ATTACK;
aip->submode_start_time = Missiontime;
break;
}
@@ -1246,9 +1343,9 @@ void ai_big_chase()
// mprintf(("normal dist; %.1f, time: %.1f\n", dist_normal_to_enemy, time_to_enemy));
// }
// since we're not in strafe and we may get a bad normal, cap dist_normal_to_enemy as min(0.3*dist_to_enemy, self)
// since we're not in strafe and we may get a bad normal, cap dist_normal_to_enemy as MIN(0.3*dist_to_enemy, self)
// this will allow us to get closer on a bad normal
dist_normal_to_enemy = max(0.3f*dist_to_enemy, dist_normal_to_enemy);
dist_normal_to_enemy = MAX(0.3f*dist_to_enemy, dist_normal_to_enemy);
if (dist_to_enemy < ATTACK_COLLIDE_BASE_DIST) {
// within 50m or 1sec
@@ -1269,7 +1366,7 @@ void ai_big_chase()
}
}
float speed_dist = max(0.0f, (Pl_objp->phys_info.speed-50) * 2);
float speed_dist = MAX(0.0f, (Pl_objp->phys_info.speed-50) * 2);
if ((dist_normal_to_enemy < ATTACK_COLLIDE_AVOID_DIST + speed_dist) || (time_to_enemy < ATTACK_COLLIDE_AVOID_TIME) ) {
// get away, simulate crsh recovery (don't use avoid)
// accelerate_ship(aip, -1.0f);
@@ -1328,8 +1425,8 @@ void ai_big_chase()
if (box_dist > 300) {
aip->submode = SM_ATTACK;
aip->last_attack_time = Missiontime;
aip->submode_start_time = Missiontime;
aip->last_attack_time = Missiontime;
}
}
break;
@@ -1341,8 +1438,8 @@ void ai_big_chase()
aip->submode_start_time = Missiontime;
} else {
aip->submode = SM_ATTACK;
aip->last_attack_time = Missiontime;
aip->submode_start_time = Missiontime;
aip->last_attack_time = Missiontime;
}
}
@@ -1358,8 +1455,8 @@ void ai_big_chase()
default:
aip->submode = SM_ATTACK;
aip->last_attack_time = Missiontime;
aip->submode_start_time = Missiontime;
aip->last_attack_time = Missiontime;
}
//
@@ -1388,9 +1485,9 @@ void ai_big_ship(object *objp)
// dist => distance from Pl_objp front to attack point
// dot => dot of Pl_objp fvec and vector to attack point
// fire_pos => world pos from which firing
void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_to_enemy)
void ai_big_attack_get_data(vec3d *enemy_pos, float *dist_to_enemy, float *dot_to_enemy)
{
vector player_pos, vec_to_enemy, predicted_enemy_pos;
vec3d player_pos, vec_to_enemy, predicted_enemy_pos;
ship *shipp = &Ships[Pl_objp->instance];
ai_info *aip = &Ai_info[shipp->ai_index];
ship_info *esip = &Ship_info[Ships[En_objp->instance].ship_info_index];
@@ -1416,17 +1513,17 @@ void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_
}
// Take player pos to be center of ship + ship_radius
vm_vec_scale_add2(&player_pos, &Pl_objp->orient.fvec, Pl_objp->radius);
vm_vec_scale_add2(&player_pos, &Pl_objp->orient.vec.fvec, Pl_objp->radius);
// If seeking lock, try to point directly at ship, else predict position so lasers can hit it.
// If just acquired target, or target is not in reasonable cone, don't refine believed enemy position.
vm_vec_normalized_dir(&vec_to_enemy, enemy_pos, &player_pos);
*dot_to_enemy=vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.fvec);
*dot_to_enemy=vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
if ((*dot_to_enemy < 0.25f) || (aip->target_time < 1.0f) || (aip->ai_flags & AIF_SEEK_LOCK)) {
predicted_enemy_pos=*enemy_pos;
} else {
vector gun_pos, pnt;
polymodel *po = model_get( Ship_info[shipp->ship_info_index].modelnum );
vec3d gun_pos, pnt;
polymodel *po = model_get( Ship_info[shipp->ship_info_index].model_num );
float weapon_speed;
// Compute position of gun in absolute space and use that as fire position.
@@ -1439,7 +1536,7 @@ void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_
}
*dist_to_enemy = vm_vec_normalized_dir(&vec_to_enemy, &predicted_enemy_pos, &player_pos);
*dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.fvec);
*dot_to_enemy = vm_vec_dot(&vec_to_enemy, &Pl_objp->orient.vec.fvec);
update_aspect_lock_information(aip, &vec_to_enemy, *dist_to_enemy, En_objp->radius);
*enemy_pos = predicted_enemy_pos;
@@ -1447,12 +1544,12 @@ void ai_big_attack_get_data(vector *enemy_pos, float *dist_to_enemy, float *dot_
// check to see if Pl_objp has gotten too close to attacking point.. if so, break off by entering
// AIS_STRAFE_RETREAT
int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
int ai_big_strafe_maybe_retreat(float dist, vec3d *target_pos)
{
ai_info *aip;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
vector vec_to_target;
vec3d vec_to_target;
vm_vec_sub(&vec_to_target, target_pos, &Pl_objp->pos);
float dist_to_target, dist_normal_to_target, time_to_target;
@@ -1463,11 +1560,11 @@ int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
dist_normal_to_target = 0.2f * vm_vec_mag_quick(&vec_to_target);
}
dist_normal_to_target = max(0.2f*dist_to_target, dist_normal_to_target);
dist_normal_to_target = MAX(0.2f*dist_to_target, dist_normal_to_target);
time_to_target = dist_normal_to_target / Pl_objp->phys_info.speed;
// add distance penalty for going too fast
float speed_to_dist_penalty = max(0.0f, (Pl_objp->phys_info.speed-50));
float speed_to_dist_penalty = MAX(0.0f, (Pl_objp->phys_info.speed-50));
//if ((dot_to_enemy > 1.0f - 0.1f * En_objp->radius/(dist_to_enemy + 1.0f)) && (Pl_objp->phys_info.speed > dist_to_enemy/5.0f))
@@ -1485,7 +1582,7 @@ int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
float box_dist;
int is_inside;
vector goal_point;
vec3d goal_point;
box_dist = get_world_closest_box_point_with_delta(&goal_point, En_objp, &Pl_objp->pos, &is_inside, STRAFE_RETREAT_BOX_DIST);
// set goal point
@@ -1507,8 +1604,8 @@ int ai_big_strafe_maybe_retreat(float dist, vector *target_pos)
void ai_big_strafe_attack()
{
ai_info *aip;
vector target_pos;
vector rand_vec;
vec3d target_pos;
vec3d rand_vec;
float target_dist, target_dot, accel, t;
object *target_objp;
@@ -1544,16 +1641,16 @@ void ai_big_strafe_attack()
aip->goal_point = Pl_objp->pos;
switch(rand()%4) {
case 0:
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.uvec, 2.0f);
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.uvec, 2.0f);
break;
case 1:
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.uvec, -2.0f);
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.uvec, -2.0f);
break;
case 2:
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.rvec, 2.0f);
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.rvec, 2.0f);
break;
case 3:
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.rvec, -2.0f);
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.rvec, -2.0f);
break;
} // end switch
@@ -1610,7 +1707,7 @@ void ai_big_strafe_attack()
void ai_big_strafe_avoid()
{
ai_info *aip;
vector target_pos;
vec3d target_pos;
float target_dist, target_dot;
fix mode_time;
@@ -1637,7 +1734,7 @@ void ai_big_strafe_retreat1()
{
float dist;
ai_info *aip;
vector rand_vec;
vec3d rand_vec;
aip = &Ai_info[Ships[Pl_objp->instance].ai_index];
@@ -1654,16 +1751,16 @@ void ai_big_strafe_retreat1()
aip->prev_goal_point = Pl_objp->pos;
switch(rand()%4) {
case 0:
vm_vec_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.uvec);
vm_vec_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.uvec);
break;
case 1:
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.uvec, -1.0f);
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.uvec, -1.0f);
break;
case 2:
vm_vec_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.rvec);
vm_vec_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.rvec);
break;
case 3:
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.fvec, &Pl_objp->orient.rvec, -1.0f);
vm_vec_scale_add(&rand_vec, &Pl_objp->orient.vec.fvec, &Pl_objp->orient.vec.rvec, -1.0f);
break;
} // end switch
@@ -1883,15 +1980,27 @@ void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp)
return;
}
// Only attack turret if it sits on current target
Assert(weapon_objp->parent >= 0 && weapon_objp->parent < MAX_OBJECTS);
parent_objp = &Objects[weapon_objp->parent];
if ( (parent_objp->signature != weapon_objp->parent_sig) || (parent_objp->type != OBJ_SHIP) ) {
return;
}
// UnknownPlayer : Decide whether or not this weapon was a beam, in which case it might be a good
// idea to go after it even if its not on the current target. This is randomized so
// the ai will not always go after different ships firing beams at them.
// Approx 1/4 chance we'll go after the other ship's beam.
if ( aip->target_objnum != OBJ_INDEX(parent_objp) ) {
return;
bool attack_turret_on_different_ship = (The_mission.ai_profile->flags & AIPF_BIG_SHIPS_CAN_ATTACK_BEAM_TURRETS_ON_UNTARGETED_SHIPS)
&& (Weapon_info[weapon_objp->instance].wi_flags & WIF_BEAM) && (frand()*100 < 25.0f);
// unless we're making an exception, we should only attack a turret if it sits on the current target
if ( !attack_turret_on_different_ship )
{
if ( (parent_objp->signature != weapon_objp->parent_sig) || (parent_objp->type != OBJ_SHIP) ) {
return;
}
if ( aip->target_objnum != OBJ_INDEX(parent_objp) ) {
return;
}
}
// attack the turret
+26 -6
View File
@@ -9,13 +9,29 @@
/*
* $Logfile: /Freespace2/code/Ship/AiBig.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:26:01 $
* $Author: penguin $
* $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
*
@@ -67,10 +83,14 @@
* $NoKeywords: $
*/
#ifndef __AIBIG_H__
#define __AIBIG_H__
struct object;
struct ai_info;
struct vec3d;
struct ship_subsys;
void ai_big_ship(object *objp);
void ai_big_chase();
void ai_big_subsys_path_cleanup(ai_info *aip);
@@ -79,8 +99,8 @@ void ai_big_subsys_path_cleanup(ai_info *aip);
void ai_big_strafe();
int ai_big_maybe_enter_strafe_mode(object *objp, int weapon_objnum, int consider_target_only=0);
void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp);
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vector *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vector *gpos, vector *gvec, vector *attack_point, float weapon_travel_dist, float fov=1.0f);
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
#endif
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
@@ -9,13 +9,56 @@
/*
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:26:02 $
* $Author: penguin $
* $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
*
@@ -121,10 +164,10 @@
* add more stuff to save/restore
*
* 24 7/24/97 4:55p Allender
* added ai-evade-ship to fred and to Freespace
* 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
* ai-guard-wing now in both Fred and FreeSpace
*
* 22 7/15/97 11:57a Hoffoss
* Added a general ai goal reference update mode.
@@ -139,8 +182,12 @@
#ifndef _AIGOALS_H
#define _AIGOALS_H
#include "ai.h"
#include "cfile.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
struct wing;
struct ai_info;
struct ai_goal;
// macros for goals which get set via sexpressions in the mission code
@@ -148,6 +195,7 @@
// ai_update_goal_references() and query_referenced_in_ai_goals() or else risk breaking
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
// 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)
@@ -170,28 +218,41 @@
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18)
#define AI_GOAL_REARM_REPAIR (1<<19)
// resume regular goals
#define AI_GOAL_STAY_STILL (1<<20)
#define AI_GOAL_PLAY_DEAD (1<<21)
#define AI_GOAL_CHASE_WEAPON (1<<22)
#define AI_GOAL_FLY_TO_SHIP (1<<23) // kazan
#define AI_GOAL_IGNORE_NEW (1<<24) // Goober5000
// now the masks for ship types
#define AI_GOAL_ACCEPT_FIGHTER ( AI_GOAL_CHASE | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_DESTROY_SUBSYSTEM | AI_GOAL_CHASE_WING | AI_GOAL_GUARD | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP | AI_GOAL_CHASE_ANY | AI_GOAL_IGNORE | AI_GOAL_GUARD_WING | AI_GOAL_EVADE_SHIP | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
#define AI_GOAL_ACCEPT_BOMBER ( AI_GOAL_ACCEPT_FIGHTER )
#define AI_GOAL_ACCEPT_STEALTH ( AI_GOAL_ACCEPT_FIGHTER )
#define AI_GOAL_ACCEPT_TRANSPORT ( AI_GOAL_CHASE | AI_GOAL_CHASE_WING | AI_GOAL_DOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_UNDOCK | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
#define AI_GOAL_ACCEPT_FREIGHTER ( AI_GOAL_ACCEPT_TRANSPORT )
#define AI_GOAL_ACCEPT_CRUISER ( AI_GOAL_ACCEPT_FREIGHTER )
#define AI_GOAL_ACCEPT_CORVETTE ( AI_GOAL_ACCEPT_CRUISER )
#define AI_GOAL_ACCEPT_GAS_MINER ( AI_GOAL_ACCEPT_CRUISER )
#define AI_GOAL_ACCEPT_AWACS ( AI_GOAL_ACCEPT_CRUISER )
#define AI_GOAL_ACCEPT_CAPITAL ( AI_GOAL_ACCEPT_CRUISER & ~(AI_GOAL_DOCK | AI_GOAL_UNDOCK) )
#define AI_GOAL_ACCEPT_SUPERCAP ( AI_GOAL_ACCEPT_CAPITAL )
#define AI_GOAL_ACCEPT_SUPPORT ( AI_GOAL_DOCK | AI_GOAL_UNDOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
#define AI_GOAL_ACCEPT_ESCAPEPOD ( AI_GOAL_ACCEPT_TRANSPORT )
// Goober5000: added AI_GOAL_STAY_NEAR_SHIP and AI_GOAL_KEEP_SAFE_DISTANCE as valid for fighters
//WMC - Don't need these anymore. Whee!
/*
#define AI_GOAL_ACCEPT_FIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_DESTROY_SUBSYSTEM | AI_GOAL_CHASE_WING | AI_GOAL_GUARD | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP | AI_GOAL_CHASE_ANY | AI_GOAL_IGNORE | AI_GOAL_IGNORE_NEW | AI_GOAL_GUARD_WING | AI_GOAL_EVADE_SHIP | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE )
#define AI_GOAL_ACCEPT_BOMBER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_STEALTH ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_TRANSPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_CHASE_WING | AI_GOAL_DOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_UNDOCK | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD| AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_FREIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CRUISER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FREIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CORVETTE ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_GAS_MINER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_AWACS ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CAPITAL ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER & ~(AI_GOAL_DOCK | AI_GOAL_UNDOCK) | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_SUPERCAP ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CAPITAL | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_SUPPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_DOCK | AI_GOAL_UNDOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD)
#define AI_GOAL_ACCEPT_ESCAPEPOD ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT| AI_GOAL_STAY_NEAR_SHIP )
*/
#define MAX_AI_DOCK_NAMES 25
typedef flag_def_list ai_goal_list;
extern ai_goal_list Ai_goal_names[];
extern int Num_ai_goals;
extern int Num_ai_dock_names;
extern char Ai_dock_names[MAX_AI_DOCK_NAMES][NAME_LENGTH];
+31
View File
@@ -0,0 +1,31 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AIINTERNAL_H
#define _AIINTERNAL_H
//Returns true if the specified object is a stealth ship, false if not
bool is_object_stealth_ship(object* objp);
//Number of live turrets on the object attacking
int num_turrets_attacking(object *turret_parent, int target_objnum);
//Determine whether an object is targetable within a nebula (checks for stealth)
int object_is_targetable(object *target, ship *viewer);
//Returns the number of enemy fighters within threshold of pos.
int num_nearby_fighters(int enemy_team_mask, vec3d *pos, float threshold);
//Returns true if OK for *aip to fire its current weapon at its current target.
int check_ok_to_fire(int objnum, int target_objnum, weapon_info *wip);
//Does all the stuff needed to aim and fire a turret.
void ai_fire_from_turret(ship *shipp, ship_subsys *ss, int parent_objnum);
#endif
File renamed without changes.
+1992
View File
File diff suppressed because it is too large. Load diff
@@ -9,13 +9,120 @@
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.22 $
* $Date: 2006-12-28 00:59:19 $
* $Author: wmcoolmon $
*
* C module for playing back anim files
*
* $Log: not supported by cvs2svn $
* Revision 2.21 2006/09/11 06:45:39 taylor
* various small compiler warning and strict compiling fixes
*
* Revision 2.20 2006/06/27 05:07:48 taylor
* fix various compiler warnings and things that Valgrind complained 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
*
@@ -63,7 +170,7 @@
* 34 4/27/98 3:36p Dave
*
* 33 3/25/98 8:43p Hoffoss
* Changed anim_play() to not be so damn complex when you try and call it.
* 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
@@ -178,16 +285,18 @@
* $NoKeywords: $
*/
#include "animplay.h"
#include "linklist.h"
#include "timer.h"
#include "bmpman.h"
#include "2d.h"
#include "3d.h"
#include "grinternal.h"
#include "pcxutils.h"
#include "packunpack.h"
#include "cfile.h"
#include "anim/animplay.h"
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "pcxutils/pcxutils.h"
#include "anim/packunpack.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
static color Color_xparent;
@@ -274,7 +383,7 @@ void anim_render_one(int screen_id, anim_instance *ani, float frametime)
}
}
MONITOR(NumANIPlayed);
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().
@@ -360,8 +469,9 @@ anim_instance *anim_play(anim_play_struct *aps)
if ( anim_instance_is_streamed(instance) ) {
instance->file_offset = instance->parent->file_offset;
}
instance->frame = (ubyte *) malloc(instance->parent->width * instance->parent->height * 2);
instance->frame = (ubyte *) vm_malloc(instance->parent->width * instance->parent->height * 2);
Assert( instance->frame != NULL );
memset( instance->frame, 0, instance->parent->width * instance->parent->height * 2 );
instance->time_elapsed = 0.0f;
instance->stop_at = aps->stop_at;
instance->x = aps->x;
@@ -445,6 +555,7 @@ anim_instance *anim_play(anim_play_struct *aps)
// input: instance => pointer to animation instance
// 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;
@@ -462,6 +573,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
n_frames = instance->stop_at - instance->start_at + 1;
else if(instance->direction == ANIM_DIRECT_REVERSE)
n_frames = instance->start_at - instance->stop_at + 1;
time = n_frames / i2fl(instance->parent->fps);
percent_through = instance->time_elapsed / time;
@@ -606,12 +718,10 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
}
ubyte *temp = NULL;
int temp_file_offset = 0;
int temp_file_offset = -1;
// if we're using bitmap polys
if(Gr_bitmap_poly){
BM_SELECT_TEX_FORMAT();
}
BM_SELECT_TEX_FORMAT();
if ( anim_instance_is_streamed(instance) ) {
if ( instance->xlate_pal ){
@@ -630,6 +740,14 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
// always go back to screen format
BM_SELECT_SCREEN_FORMAT();
// see if we had an error during decode (corrupted anim stream)
if ( (temp == NULL) && (temp_file_offset < 0) ) {
mprintf(("ANI: Fatal ERROR at frame %i!! Aborting playback of \"%s\"...\n", instance->frame_num, instance->parent->name));
// return -1 to end all playing of this anim instanc
return -1;
}
if(instance->direction == ANIM_DIRECT_FORWARD){
if ( anim_instance_is_streamed(instance) ) {
instance->file_offset = temp_file_offset;
@@ -690,9 +808,9 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
else {
g3_rotate_vertex(&image_vertex,instance->world_pos);
Assert(instance->radius != 0.0f);
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED );
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;
}
@@ -731,8 +849,10 @@ int anim_stop_playing(anim_instance* instance)
void anim_release_render_instance(anim_instance* instance)
{
Assert( instance != NULL );
Assert(instance->frame);
free(instance->frame);
if (instance->frame != NULL)
vm_free(instance->frame);
instance->frame = NULL;
instance->parent->instance_count--;
@@ -791,7 +911,7 @@ void anim_release_all_instances(int screen_id)
// 2 | width
// 2 | height
// 2 | number of frames
// 2 | packer code
// 1 | packer code
// 763 | palette
// 2 | number of key frames
// 2 | key frame number } repeats
@@ -829,7 +949,6 @@ void anim_read_header(anim *ptr, CFILE *fp)
}
ptr->height = cfread_short(fp);
#ifndef NDEBUG
// get size of ani compared to power of 2
int r, floor_pow;
@@ -841,7 +960,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
floor_pow++;
}
int floor_size = (int) pow(2, floor_pow);
int floor_size = (int) pow(2.0, floor_pow);
int diff = ptr->height - floor_size;
float waste = 100.0f * float((floor_size - diff))/(2.0f *(float)floor_size);
@@ -853,7 +972,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
#endif
ptr->total_frames = cfread_short(fp);
cfread(&ptr->packer_code, 1, 1, fp);
ptr->packer_code = cfread_ubyte(fp);
cfread(&ptr->palette, 256, 3, fp);
ptr->num_keys = cfread_short(fp);
@@ -888,8 +1007,6 @@ anim *anim_load(char *real_filename, int file_mapped)
int count,idx;
char name[_MAX_PATH];
// file_mapped = 0;
Assert ( real_filename != NULL );
strcpy( name, real_filename );
@@ -912,7 +1029,7 @@ anim *anim_load(char *real_filename, int file_mapped)
if ( !fp )
return NULL;
ptr = (anim *) malloc(sizeof(anim));
ptr = (anim *) vm_malloc(sizeof(anim));
Assert(ptr);
ptr->flags = 0;
@@ -930,7 +1047,7 @@ anim *anim_load(char *real_filename, int file_mapped)
anim_read_header(ptr, fp);
if(ptr->num_keys > 0){
ptr->keys = (key_frame*)malloc(sizeof(key_frame) * ptr->num_keys);
ptr->keys = (key_frame*)vm_malloc(sizeof(key_frame) * ptr->num_keys);
Assert(ptr->keys != NULL);
}
@@ -941,12 +1058,14 @@ anim *anim_load(char *real_filename, 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 );
}
/*prev_keyp = &ptr->keys;
count = ptr->num_keys;
while (count--) {
keyp = (key_frame *) malloc(sizeof(key_frame));
keyp = (key_frame *) vm_malloc(sizeof(key_frame));
keyp->next = *prev_keyp;
*prev_keyp = keyp;
prev_keyp = &keyp->next;
@@ -956,10 +1075,11 @@ anim *anim_load(char *real_filename, int file_mapped)
cfread(&keyp->offset, 4, 1, fp);
}*/
cfread(&count, 4, 1, fp); // size of compressed data
count = INTEL_INT( count );
ptr->cfile_ptr = NULL;
if ( file_mapped ) {
if ( file_mapped == PAGE_FROM_MEM) {
// Try mapping the file to memory
ptr->flags |= ANF_MEM_MAPPED;
ptr->cfile_ptr = cfopen(name, "rb", CFILE_MEMORY_MAPPED);
@@ -986,7 +1106,7 @@ anim *anim_load(char *real_filename, int file_mapped)
if ( ptr->flags & ANF_STREAMED ) {
ptr->data = NULL;
ptr->cache_file_offset = ptr->file_offset;
ptr->cache = (ubyte*)malloc(ANI_STREAM_CACHE_SIZE+2);
ptr->cache = (ubyte*)vm_malloc(ANI_STREAM_CACHE_SIZE+2);
Assert(ptr->cache);
cfseek(ptr->cfile_ptr, offset, CF_SEEK_SET);
cfread(ptr->cache, ANI_STREAM_CACHE_SIZE, 1, ptr->cfile_ptr);
@@ -997,7 +1117,7 @@ anim *anim_load(char *real_filename, int file_mapped)
// Not a memory mapped file (or streamed)
ptr->flags &= ~ANF_MEM_MAPPED;
ptr->flags &= ~ANF_STREAMED;
ptr->data = (ubyte *) malloc(count);
ptr->data = (ubyte *) vm_malloc(count);
ptr->file_offset = -1;
cfread(ptr->data, count, 1, fp);
}
@@ -1033,7 +1153,7 @@ int anim_free(anim *ptr)
}
if ( !list )
return -1;
return -2;
// only free when ref_count is 0
ptr->ref_count--;
@@ -1045,23 +1165,27 @@ int anim_free(anim *ptr)
return -1;
if(ptr->keys != NULL){
free(ptr->keys);
vm_free(ptr->keys);
ptr->keys = NULL;
}
if ( ptr->flags & (ANF_MEM_MAPPED|ANF_STREAMED) ) {
cfclose(ptr->cfile_ptr);
if ( ptr->cache ) {
free(ptr->cache);
vm_free(ptr->cache);
ptr->cache = NULL;
}
}
else {
Assert(ptr->data);
free(ptr->data);
if ( ptr->data ) {
vm_free(ptr->data);
ptr->data = NULL;
}
}
*prev_anim = ptr->next;
free(ptr);
vm_free(ptr);
return 0;
}
@@ -1129,7 +1253,7 @@ int anim_write_frames_out(char *filename)
ai = init_anim_instance(source_anim, 16);
row_data = (ubyte**)malloc((source_anim->height+1) * 4);
row_data = (ubyte**)vm_malloc((source_anim->height+1) * 4);
for ( i = 0; i < source_anim->total_frames; i++ ) {
anim_get_next_raw_buffer(ai, 0, 0, 16);
@@ -1152,7 +1276,7 @@ int anim_write_frames_out(char *filename)
}
printf("\n");
free(row_data);
vm_free(row_data);
return 0;
}
@@ -1185,7 +1309,7 @@ void anim_display_info(char *real_filename)
anim_read_header(&A, fp);
// read the keyframe frame nums and offsets
key_frame_nums = (int*)malloc(sizeof(int)*A.num_keys);
key_frame_nums = (int*)vm_malloc(sizeof(int)*A.num_keys);
Assert(key_frame_nums != NULL);
for ( i = 0; i < A.num_keys; i++ ) {
key_frame_nums[i] = 0;
@@ -1226,7 +1350,7 @@ void anim_display_info(char *real_filename)
printf("ac version: %d\n", A.version);
if ( key_frame_nums != NULL ) {
free(key_frame_nums);
vm_free(key_frame_nums);
}
cfclose(fp);
@@ -9,13 +9,42 @@
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.7 $
* $Date: 2006-09-08 06:20:14 $
* $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
*
@@ -35,7 +64,7 @@
* 10 4/27/98 3:36p Dave
*
* 9 3/25/98 8:43p Hoffoss
* Changed anim_play() to not be so damn complex when you try and call it.
* 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()
@@ -96,6 +125,8 @@
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
struct anim_instance;
@@ -109,7 +140,7 @@ typedef struct {
int start_at;
int stop_at;
int screen_id;
vector *world_pos;
vec3d *world_pos;
float radius;
int framerate_independent;
void *color;
@@ -118,6 +149,13 @@ typedef struct {
int ping_pong;
} anim_play_struct;
enum
{
PAGE_FROM_MEM = 0,
PAGE_FROM_DISK = 1,
PAGE_FROM_DISK_FORCED = 2
};
extern int Anim_paused;
void anim_init();
@@ -132,7 +170,7 @@ int anim_stop_playing(anim_instance* anim_instance);
int anim_show_next_frame(anim_instance *instance, float frametime);
void anim_release_all_instances(int screen_id = 0);
void anim_release_render_instance(anim_instance* instance);
anim *anim_load(char *name, int file_mapped = 0);
anim *anim_load(char *name, int file_mapped = PAGE_FROM_MEM);
int anim_free(anim *ptr);
int anim_playing(anim_instance *ai);
int anim_write_frames_out(char *filename);
@@ -9,15 +9,85 @@
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.14 $
* $Date: 2006-06-27 05:07:48 $
* $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 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
*
@@ -149,15 +219,16 @@
* $NoKeywords: $
*/
#include "grinternal.h"
#include "bmpman.h"
#include "palman.h"
#include "2d.h"
#include "animplay.h"
#include "packunpack.h"
#include "anim/packunpack.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "anim/animplay.h"
int packer_code = PACKER_CODE;
int transparent_code = 254;
const int packer_code = PACKER_CODE;
const int transparent_code = 254;
void anim_check_for_palette_change(anim_instance *instance) {
if ( instance->parent->screen_sig != gr_screen.signature ) {
@@ -188,7 +259,7 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
}
ptr->instance_count++;
inst = (anim_instance *) malloc(sizeof(anim_instance));
inst = (anim_instance *) vm_malloc(sizeof(anim_instance));
Assert(inst);
inst->frame_num = -1;
inst->last_frame_num = -1;
@@ -198,25 +269,24 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
inst->stop_now = FALSE;
inst->aa_color = NULL;
if(bpp == 16){
inst->frame = (ubyte *) malloc(inst->parent->width * inst->parent->height * 2);
} else {
inst->frame = (ubyte *) malloc(inst->parent->width * inst->parent->height);
}
inst->frame = (ubyte *) vm_malloc(inst->parent->width * inst->parent->height * (bpp >> 3));
Assert( inst->frame != NULL );
memset( inst->frame, 0, inst->parent->width * inst->parent->height * (bpp >> 3) );
return inst;
}
void free_anim_instance(anim_instance *inst)
{
Assert(inst->frame);
free(inst->frame);
vm_free(inst->frame);
inst->frame = NULL;
inst->parent->instance_count--;
inst->parent = NULL;
inst->data = NULL;
inst->file_offset = -1;
free(inst);
vm_free(inst);
}
int anim_get_next_frame(anim_instance *inst)
@@ -257,10 +327,7 @@ int anim_get_next_frame(anim_instance *inst)
anim_check_for_palette_change(inst);
// if we're using bitmap polys
if(Gr_bitmap_poly){
BM_SELECT_TEX_FORMAT();
}
BM_SELECT_TEX_FORMAT();
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation, aabitmap, bpp);
@@ -772,6 +839,15 @@ 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
void convert_24_to_16(int bit_24, ushort *bit_16)
{
ubyte *pixel = (ubyte*)&bit_24;
ubyte alpha = 1;
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
int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bpp)
{
@@ -780,8 +856,9 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
ubyte bit_8 = 0;
ubyte al = 0;
ubyte r, g, b;
int pixel_size = (bpp / 8);
anim *a = ai->parent;
Assert(a);
Assert(a);
// if this is an aabitmap, don't run through the palette
if(aabitmap){
@@ -798,31 +875,57 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
} else {
// if the pixel value is 255, or is the xparent color, make it so
if(((a->palette[pix*3] == a->xparent_r) && (a->palette[pix*3+1] == a->xparent_g) && (a->palette[pix*3+2] == a->xparent_b)) ){
r = b = 0;
g = 255;
bm_set_components((ubyte*)&bit_16, &r, &g, &b, &al);
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
if (pixel_size > 2) {
bit_24 = 0;
} else {
r = b = 0;
g = 255;
// convert to 16 bit
bm_24_to_16(bit_24, &bit_16);
bm_set_components((ubyte*)&bit_16, &r, &g, &b, &al);
}
} else {
if (pixel_size > 2) {
ubyte pixel[4];
pixel[0] = ai->parent->palette[pix * 3 + 2];
pixel[1] = ai->parent->palette[pix * 3 + 1];
pixel[2] = ai->parent->palette[pix * 3];
pixel[3] = 255;
memcpy(&bit_24, pixel, sizeof(int));
if (pixel_size == 4) {
bit_24 = INTEL_INT(bit_24);
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
}
}
}
// stuff the pixel
switch(bpp){
case 16 :
memcpy(data, &bit_16, sizeof(ushort));
return sizeof(ushort);
switch (bpp) {
case 32:
case 24:
memcpy(data, &bit_24, pixel_size);
break;
case 8 :
*data = bit_8;
return sizeof(ubyte);
case 16:
memcpy(data, &bit_16, pixel_size);
break;
case 8:
*data = bit_8;
break;
default:
Int3();
return 0;
}
Int3();
return 0;
return pixel_size;
}
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
@@ -834,6 +937,7 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count, int
ushort bit_16 = 0;
ubyte bit_8 = 0;
anim *a = ai->parent;
int pixel_size = (bpp / 8);
ubyte r, g, b;
Assert(a);
@@ -852,34 +956,55 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count, int
} else {
// if the pixel value is 255, or is the xparent color, make it so
if(((a->palette[pix*3] == a->xparent_r) && (a->palette[pix*3+1] == a->xparent_g) && (a->palette[pix*3+2] == a->xparent_b)) ){
r = b = 0;
g = 255;
bm_set_components((ubyte*)&bit_16, &r, &g, &b, &al);
if (pixel_size > 2) {
bit_24 = 0;
} else {
r = b = 0;
g = 255;
bm_set_components((ubyte*)&bit_16, &r, &g, &b, &al);
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
if (pixel_size > 2) {
ubyte pixel[4];
pixel[0] = ai->parent->palette[pix * 3 + 2];
pixel[1] = ai->parent->palette[pix * 3 + 1];
pixel[2] = ai->parent->palette[pix * 3];
pixel[3] = 255;
memcpy(&bit_24, pixel, sizeof(int));
// convert to 16 bit
bm_24_to_16(bit_24, &bit_16);
if (pixel_size == 4) {
bit_24 = INTEL_INT(bit_24);
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
}
}
}
// stuff the pixel
for(idx=0; idx<count; idx++){
switch(bpp){
case 16 :
memcpy(data + (idx*2), &bit_16, sizeof(ushort));
break;
case 8 :
*(data + idx) = bit_8;
break;
}
for (idx=0; idx<count; idx++) {
switch (bpp) {
case 32:
case 24:
memcpy(data + (idx * pixel_size), &bit_24, pixel_size);
break;
case 16:
memcpy(data + (idx * pixel_size), &bit_16, pixel_size);
break;
case 8:
*(data + idx) = bit_8;
break;
}
}
if(bpp == 16){
return sizeof(ushort) * count;
}
return sizeof(ubyte) * count;
return (pixel_size * count);
}
// ptr = packed data to unpack
@@ -890,7 +1015,7 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
{
int xlate_pal, value, count = 0;
int stuffed;
int pixel_size = (bpp == 16) ? 2 : 1;
int pixel_size = (bpp / 8);
if ( pal_translate == NULL ) {
xlate_pal = 0;
@@ -951,6 +1076,9 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
count = value & (~STD_RLE_CODE);
value = *ptr++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
@@ -1037,6 +1165,9 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
count = value & (~STD_RLE_CODE);
value = *ptr++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
@@ -1055,7 +1186,8 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
}
}
else {
Assert(0); // unknown packing method
// Assert(0); // unknown packing method
return NULL;
}
return ptr;
@@ -1070,7 +1202,7 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
int xlate_pal, value, count = 0;
int offset = 0;
int stuffed;
int pixel_size = (bpp == 16) ? 2 : 1;
int pixel_size = (bpp / 8);
if ( pal_translate == NULL ) {
xlate_pal = 0;
@@ -1137,6 +1269,9 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
value = anim_instance_get_byte(ai,offset);
offset++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
@@ -1227,6 +1362,9 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
value = anim_instance_get_byte(ai,offset);
offset++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
@@ -1245,7 +1383,8 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
}
else {
Int3(); // unknown packing method
// Int3(); // unknown packing method
return -1;
}
return ai->file_offset + offset;
@@ -9,15 +9,38 @@
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $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
*
@@ -145,7 +168,7 @@
#ifndef __PACKUNPACK_H__
#define __PACKUNPACK_H__
#include "pstypes.h"
#include "globalincs/pstypes.h"
struct CFILE;
@@ -204,7 +227,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)
vector *world_pos; // world (x,y,z) position of explosion
vec3d *world_pos; // world (x,y,z) position of explosion
float radius; // radius of image, needed for scaling
int frame_num; // current frame, or last frame if between frames (first frame is 0)
int last_frame_num;// last frame rendered
@@ -229,8 +252,6 @@ typedef struct anim_instance {
int loop_count; // starts at 0, and is incremented each time it loops
} anim_instance;
extern int packer_code;
int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_type);
int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, int compress_type);
File diff suppressed because it is too large. Load diff
@@ -9,13 +9,69 @@
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.16 $
* $Date: 2007-11-23 23:49:32 $
* $Author: wmcoolmon $
*
* Header file for asteroids
*
* $Log: not supported by cvs2svn $
* Revision 2.15 2006/11/16 00:53:12 taylor
* various bits of little cleanup
* get rid of some more compiler warnings
*
* Revision 2.14 2006/09/11 06:49:38 taylor
* fixes for stuff_string() bounds checking
*
* Revision 2.13 2006/09/11 06:08:08 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
*
@@ -119,8 +175,10 @@
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "ship.h"
#include "parselo.h" // for NAME_LENGTH
#include "globalincs/pstypes.h"
#include "globalincs/globals.h" // for NAME_LENGTH
#include <vector>
struct object;
struct polymodel;
@@ -128,29 +186,24 @@ struct collision_info_struct;
#define MAX_ASTEROIDS 256
// DEBRIS TYPES
#define MAX_DEBRIS_TYPES 12
#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_BIG 2
//
#define DEBRIS_TERRAN_SMALL 3
#define DEBRIS_TERRAN_MEDIUM 4
#define DEBRIS_TERRAN_LARGE 5
//
#define DEBRIS_VASUDAN_SMALL 6
#define DEBRIS_VASUDAN_MEDIUM 7
#define DEBRIS_VASUDAN_LARGE 8
//
#define DEBRIS_SHIVAN_SMALL 9
#define DEBRIS_SHIVAN_MEDIUM 10
#define DEBRIS_SHIVAN_LARGE 11
// END DEBRIS TYPES
#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
// Goober5000 - currently same as MAX_SHIP_DETAIL_LEVELS (put here to avoid an #include)
#define MAX_ASTEROID_DETAIL_LEVELS 5
typedef struct debris_struct {
int index;
char *name;
} debris_struct;
// Data structure to track the active asteroids
typedef struct asteroid_obj {
@@ -160,79 +213,72 @@ typedef struct asteroid_obj {
extern asteroid_obj Asteroid_obj_list;
extern debris_struct Field_debris_info[];
#define MAX_ASTEROID_POFS 3 // Max number of POFs per asteroid type
#define AF_USED (1<<0) // Set means used.
typedef struct asteroid_info {
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[MAX_ASTEROID_POFS][NAME_LENGTH]; // POF files to load/associate with ship
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_SHIP_DETAIL_LEVELS]; // distance to change detail levels at
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_hull_strength; // starting strength of asteroid
polymodel *modelp[MAX_ASTEROID_POFS];
int model_num[MAX_ASTEROID_POFS];
float initial_asteroid_strength; // starting strength of asteroid
polymodel *modelp[NUM_DEBRIS_POFS];
int model_num[NUM_DEBRIS_POFS];
asteroid_info() { memset(this, 0, sizeof(asteroid_info)); damage_type_idx = -1; };
} asteroid_info;
#define AF_USED (1<<0) // Set means used.
typedef struct asteroid {
int flags;
int objnum;
int type; // In 0..Num_asteroid_types
int asteroid_subtype; // Which index into asteroid_info for modelnum and modelp
int 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_collide; // timestamp to check for asteroid colliding with escort ships
int final_death_time; // timestamp to swap in new models after explosion starts
int collide_objnum; // set to objnum that asteroid will be impacting soon
int collide_objsig; // object signature corresponding to collide_objnum
vector death_hit_pos; // hit pos that caused death
vec3d death_hit_pos; // hit pos that caused death
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
} asteroid;
// TYPEDEF FOR SPECIES OF DEBRIS - BITFIELD
#define DS_TERRAN 0x01
#define DS_VASUDAN 0x02
#define DS_SHIVAN 0x04
// TYPEDEF FOR DEBRIS TYPE
typedef enum {
DG_ASTEROID,
DG_SHIP
} debris_genre;
} debris_genre_t;
// TYPEDEF FOR FIELD TYPE
typedef enum {
FT_ACTIVE,
FT_PASSIVE
} field_type;
#define MAX_ACTIVE_DEBRIS_TYPES 3
} field_type_t;
typedef struct asteroid_field {
vector min_bound; // Minimum range of field.
vector max_bound; // Maximum range of field.
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
int has_inner_bound;
vector inner_min_bound;
vector inner_max_bound;
vector vel; // Average asteroid moves at this velocity.
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 field_type; // active throws and wraps, passive does not
debris_genre debris_genre; // type of debris (ship or asteroid) [generic type]
field_type_t field_type; // active throws and wraps, passive does not
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
} asteroid_field;
extern asteroid_info Asteroid_info[MAX_DEBRIS_TYPES];
extern std::vector<asteroid_info> Asteroid_info;
extern asteroid Asteroids[MAX_ASTEROIDS];
extern asteroid_field Asteroid_field;
extern int Num_asteroid_types;
extern int Num_asteroids;
extern int Asteroids_enabled;
@@ -244,17 +290,17 @@ void asteroid_render( object *asteroid_objp );
void asteroid_delete( object *asteroid_objp );
void asteroid_process_pre( object *asteroid_objp, float frame_time);
void asteroid_process_post( object *asteroid_objp, float frame_time);
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vector * hitpos, collision_info_struct *asteroid_hit_info=NULL );
void asteroid_hit( object *asteroid_objp, object *other_objp, vector *hitpos, float damage );
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL );
void asteroid_hit( object *asteroid_objp, object *other_objp, vec3d *hitpos, float damage );
int asteroid_count();
int asteroid_collide_objnum(object *asteroid_objp);
float asteroid_time_to_impact(object *asteroid_objp);
void asteroid_show_brackets();
void asteroid_target_closest_danger();
int asteroid_get_random_in_cone(vector *pos, vector *dir, float ang, int danger = 0);
int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger = 0);
// need to extern for multiplayer
void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec);
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec);
void asteroid_frame();
File diff suppressed because it is too large. Load diff
+189
View File
@@ -0,0 +1,189 @@
// Autopilot.h
// Derek Meek
// 4-30-2004
/*
* $Logfile: /Freespace2/code/Autopilot/Autopilot.h $
* $Revision: 1.12 $
* $Date: 2007-09-02 02:10:24 $
* $Author: Goober5000 $
*
* $Log: not supported by cvs2svn $
* Revision 1.11 2007/07/24 20:17:36 Kazan
* Make asteroid/debris fields interrupt autopilot, add "hazards near" message to autopilot.tbl, add use-nav-cinematics sexp, fix mantis #1441
*
* Revision 1.10 2007/07/23 15:16:48 Kazan
* Autopilot upgrades as described, MSVC2005 project fixes
*
* 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"
// milliseconds between updates
#define NPS_TICKRATE 125
#define MAX_NAVPOINTS 8
#define NP_WAYPOINT 0x0001 // Nav Point is bound to the poistion of a single node of a waypoint path
#define NP_SHIP 0x0002 // Nav Point is bound to the poisiton of a certain ship
#define NP_HIDDEN 0x0004 // Nav Point doesn't show on map and isn't selectable
#define NP_NOACCESS 0x0008 // Nav Point isn't selectable
#define NP_VISITED 0x0100 // Whether we've been within 1,000 meters of this waypoint
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
struct NavPoint
{
char NavName[32];
int flags;
void *target_obj;
int waypoint_num; //only used when flags & NP_WAYPOINT
vec3d *GetPosition();
char* GetInteralName();
};
#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
struct NavMessage
{
char message[256];
char filename[256]; // can be ""
};
extern bool AutoPilotEngaged;
extern int CurrentNav;
extern NavPoint Navs[MAX_NAVPOINTS];
extern NavMessage NavMsgs[NP_NUM_MESSAGES];
extern int LockAPConv;
// Cycles through the NavPoint List
bool Sel_NextNav();
// Tell us is autopilot is allow
// This needs:
// * Nav point selected
// * No enemies within 5,000 meters
// * Destination > 1,000 meters away
bool CanAutopilot(bool send_msg=false);
bool CanAutopilotPos(vec3d targetPos);
// Engages autopilot
// This does:
// * Control switched from player to AI
// * Time compression to 32x
// * Tell AI to fly to targetted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
void StartAutopilot();
// Checks if autopilot should automatically die
// Returns true if:
// * Targetted waypoint < 1,000 meters away
// * Enemy < 5,000 meters
bool Autopilot_AutoDiable();
// Disengages autopilot
// this does:
// * Time compression to 1x
// * Delete AI nav goal
// * Control switched from AI to player
void EndAutoPilot();
// Checks for changes every NPS_TICKRATE milliseconds
// Checks:
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
// * If we're current AutoNavigating it checks if we need to autodisengage
void NavSystem_Do();
// Inits the Nav System
void NavSystem_Init();
// parse autopilot.tbl
void parse_autopilot_table(char *filename);
// Finds a Nav point by name
int FindNav(char *Nav);
// Set A Nav point to "ZERO"
void ZeroNav(int i);
// Removes a Nav
bool DelNavPoint(char *Nav);
bool DelNavPoint(int nav);
// adds a Nav
bool AddNav_Ship(char *Nav, char *TargetName, int flags);
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags);
//Change Flags
bool Nav_Alt_Flags(char *Nav, int flags);
// Sexp Accessors
bool Nav_Set_Flag(char *Nav, int flag);
bool Nav_UnSet_Flag(char *Nav, int flag);
bool Nav_Set_Hidden(char *Nav);
bool Nav_Set_NoAccess(char *Nav);
bool Nav_Set_Visited(char *Nav);
bool Nav_UnSet_Hidden(char *Nav);
bool Nav_UnSet_NoAccess(char *Nav);
bool Nav_UnSet_Visited(char *Nav);
// Useful functions
unsigned int DistanceTo(char *nav);
unsigned int DistanceTo(int nav);
bool IsVisited(char *nav);
bool IsVisited(int nav);
void send_autopilot_msg(char *msg, char *snd=NULL);
void send_autopilot_msgID(int msgid);
#endif
+185
View File
@@ -0,0 +1,185 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
* $Revision: 2.7 $
* $Date: 2007-01-10 01:40:06 $
* $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__
#define __BM_INTERNAL_H__
// extra check to make sure this stuff doesn't end up in normal files
// don't use any of this unless BMPMAN_INTERNAL is defined
#ifdef BMPMAN_INTERNAL
#include "globalincs/pstypes.h"
#include "bmpman/bmpman.h"
// no-type ( used in: bm_bitmaps[i].type )
#define BM_TYPE_NONE 0
// in-memory type ( used in: bm_bitmaps[i].type )
#define BM_TYPE_USER 1
// file-type types ( used in: bm_bitmaps[i].type )
#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
// 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)
// 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
/// Moved from cpp file ///////////////////
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
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
ubyte fps; // used for animation -- frames per second
struct {
// stuff for static animations
ubyte type; // type for individual images
char filename[MAX_FILENAME_LEN]; // filename for individual images
} eff;
} ani;
struct {
// Stuff needed for user bitmaps
void *data; // For user bitmaps, this is where the data comes from
ubyte bpp; // For user bitmaps, this is what format the data is
ubyte flags; // Flags passed to bm_create
} user;
} bm_extra_info;
typedef struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
uint signature; // a unique signature identifying the data
uint palette_checksum; // checksum used to be sure bitmap is in current palette
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
int last_used; // When this bitmap was last used
ubyte type; // PCX, USER, ANI, etc
ubyte comp_type; // What sort of compressed type, BM_TYPE_NONE if not compressed
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
int dir_type; // which directory this was loaded from (to skip other locations with same name)
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
int num_mipmaps; // number of mipmap levels, we need to read all of them
// Stuff to keep track of usage
ubyte preloaded; // If set, then this was loaded from the lst file
int preload_count; // how many times this gets used in game, for unlocking
ubyte used_flags; // What flags it was accessed thru
int load_count;
// Bitmap info
bitmap bm;
// Data for animations and user bitmaps
bm_extra_info info;
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
int data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
#endif
} bitmap_entry;
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
// image specific lock functions
void bm_lock_ani( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_jpg( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_pcx( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
void bm_lock_user( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags );
#endif // BMPMAN_INTERNAL
#endif // __BM_INTERNAL_H__
File diff suppressed because it is too large. Load diff
+710
View File
@@ -0,0 +1,710 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
*
* $Revision: 2.44 $
* $Date: 2007-03-22 20:13:23 $
* $Author: taylor $
*
* Prototypes for Bitmap Manager functions
*
* $Log: not supported by cvs2svn $
* Revision 2.43 2007/01/10 01:40:07 taylor
* remove the non-dark stuff, it only works on PCX files and stuff to use it has already been ripped out
* per earlier discussions: remove -jpgtga and -pcx32, set image load order to DDS->TGA->JPG->PCX
* some debug log cleanup
* remove bitmap data from system memory once it's in API memory
*
* Revision 2.42 2007/01/07 12:32:06 taylor
* fix bm_page_in_texture() so that it will load all frames of an animation (caused slowdowns in-game with it)
*
* Revision 2.41 2006/12/28 00:59:19 wmcoolmon
* WMC codebase commit. See pre-commit build thread for details on changes.
*
* Revision 2.40 2006/07/05 23:41:43 Goober5000
* spelling
*
* Revision 2.39 2006/07/05 23:35:42 Goober5000
* cvs comment tweaks
*
* Revision 2.38 2006/06/27 04:52:50 taylor
* fix various things that Valgrind complained about
* comp_type for DDS images will always be set to something, an 'uncompressed' type at the least
*
* 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
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#ifndef NDEBUG
#define BMPMAN_NDEBUG
#endif
// this is causing problems - let's UP IT -- Kazan
// bumped from 3500 to 4500 2004/09/21 - taylor
// bumped to 4750 2005/02/03 - taylor
//#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
#define MAX_BITMAPS 4750 // How many bitmaps the game can handle
// NOTE: MAX_BITMAPS shouldn't need to be bumped again. With the fixed bm_release() and it's
// proper use even the largest missions should stay under this number. With the largest retail
// missions and wasteful content we should still have about 20% of the slots free. If it still
// goes over then it's something the artists need to fix. For instance the Terran Mara fighter,
// with -spec and -glow and using the Shinepack, needs 117 bitmap slots alone. 111 of those is
// just for the glowmaps. This number can be greatly reduced if the number of ani frames for
// another LOD than LOD0 has fewer or no ani frames. A 37 frame glow ani for LOD2 is little
// more than a waste of resources. Future reports of texture corruption should be initially
// approached with content as the cause and not code. If anything we could/should reduce
// MAX_BITMAPS in the future. Where it's at now should accomidate even the largest mods.
// -- Taylor
#define BMP_AABITMAP (1<<0) // antialiased bitmap
#define BMP_TEX_XPARENT (1<<1) // transparent texture
#define BMP_TEX_OTHER (1<<2) // so we can identify all "normal" textures
#define BMP_TEX_DXT1 (1<<3) // dxt1 compressed 8r8g8b1a (24bit)
#define BMP_TEX_DXT3 (1<<4) // dxt3 compressed 8r8g8b4a (32bit)
#define BMP_TEX_DXT5 (1<<5) // dxt5 compressed 8r8g8b8a (32bit)
#define BMP_TEX_CUBEMAP (1<<6) // a texture made for cubic environment map
// ***** NOTE: bitmap.flags is an 8-bit value, no more BMP_TEX_* flags can be added unless the type is changed!! ******
//compressed texture types
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
//non compressed textures
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_OTHER )
// any texture type
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0)
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1)
#define BMP_FLAG_CUBEMAP (1<<2)
typedef struct bitmap {
short w, h; // Width and height
short rowsize; // What you need to add to go to next row
ubyte bpp; // How many bits per pixel it is. (7,8,15,16,24,32) (what is requested)
ubyte true_bpp; // How many bits per pixel the image actually is.
ubyte flags; // See the BMP_???? defines for values (this isn't for the BMP_FLAG_* stuff)
ptr_u data; // Pointer to data, or maybe offset into VRAM.
ubyte *palette; // If bpp==8, this is pointer to palette. If the BMP_NO_PALETTE_MAP flag
// is not set, this palette just points to the screen palette. (gr_palette)
} bitmap;
extern int Bm_paging;
void bm_init();
void bm_close();
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames );
int bm_get_next_handle();
void *bm_malloc(int n, int size);
void bm_update_memory_used(int n, int size);
// how many bytes of textures are used.
extern int bm_texture_ram;
// This loads a bitmap so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number.
int bm_load(char * filename);
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
// _and_ texture format, such as pilot pics and squad logos
int bm_load_duplicate(char *filename);
// Creates a bitmap that exists in RAM somewhere, instead
// of coming from a disk file. You pass in a pointer to a
// block of data. The data can be in the following formats:
// 8 bpp (mapped into game palette)
// 32 bpp
// On success, it returns the bitmap number. You cannot
// free that RAM until bm_release is called on that bitmap.
// See example at bottom of this file
int bm_create( int bpp, int w, int h, void *data = 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 );
// like bm_unload() except that it's safe to use to free data without worrying about
// load_count so it's safe to use in relation to bm_release() and in gr_*_texture functions
int bm_unload_fast( int n, int clear_render_targets = 0 );
// Frees up a bitmap's data, and it's slot, so bitmap
// number 'n' cannot be used anymore, and bm_load or
// bm_create might reuse the slot.
int bm_release( int n, int clear_render_targets = 0 );
// This loads a bitmap sequence so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number of the first frame and nframes is set.
extern int bm_load_animation( char * filename, int * nframes = NULL, int *fps = NULL, int can_drop_frames = 0, int dir_type = CF_TYPE_ANY );
// This locks down a bitmap and returns a pointer to a bitmap
// that can be accessed until you call bm_unlock. Only lock
// a bitmap when you need it! This will convert it into the
// appropriate format also.
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
// The signature is a field that gets filled in with
// a unique signature for each bitmap. The signature for each bitmap
// will also change when the bitmap's data changes.
extern uint bm_get_signature( int bitmapnum);
// Unlocks a bitmap
extern void bm_unlock( int bitmapnum );
//WMC - Needed this for scripting
extern int bm_is_valid(int handle);
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
//WMC - Returns -1 on failure, handle or first frame handle on success.
int bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL );
// get filename
extern void bm_get_filename(int bitmapnum, char *filename);
// resyncs all the bitmap palette
extern void bm_update();
// call to load all data for all bitmaps that have been requested to be loaded
extern void bm_gfx_load_all();
extern void bm_unload_all();
// call to get the palette for a bitmap
void bm_get_palette(int n, ubyte *pal, char *name);
// Hacked function to get a pixel from a bitmap.
// Only works good in 8bpp mode.
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
// Returns number of bytes of bitmaps locked this frame
// ntotal = number of bytes of bitmaps locked this frame
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
void bm_get_frame_usage(int *ntotal, int *nnew);
/*
* Example on using bm_create
*
{
static int test_inited = 0;
static int test_bmp;
static uint test_bmp_data[128*64];
if ( !test_inited ) {
test_inited = 1;
// Create the new bitmap and fill in its data.
// When you're done with it completely, call
// bm_release to free up the bitmap handle
test_bmp = bm_create( 32, 128, 64, test_bmp_data );
int i,j;
for (i=0; i<64; i++ ) {
for (j=0; j<64; j++ ) {
uint r=i*4;
test_bmp_data[j+i*128] = r;
}
}
}
bm_unload(test_bmp); // this pages out the data, so that the
// next bm_lock will convert the new data to the
// correct bpp
// put in new data
int x,y;
gr_reset_clip();
for (y=0; y<64; y++)
for (x=0; x<128; x++ )
test_bmp_data[y*128+x] = 15;
// Draw the bitmap to upper left corner
gr_set_bitmap(test_bmp);
gr_bitmap( 0,0 );
}
*/
//============================================================================
// Paging stuff
//============================================================================
void bm_page_in_start();
void bm_page_in_stop();
// Paging code in a library should call these functions
// in its page in function.
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_texture( int bitmapnum, int num_frames = 0 );
// marks a texture as being a transparent textyre used for this level
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
// Marks an aabitmap as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
// unload a texture that was paged in
int bm_page_out( int handle );
//
// Mode: 0 = High memory
// 1 = Low memory ( every other frame of ani's)
// 2 = Debug low memory ( only use first frame of each ani )
void bm_set_low_mem( int mode );
char *bm_get_filename(int handle);
void BM_SELECT_SCREEN_FORMAT();
void BM_SELECT_TEX_FORMAT();
void BM_SELECT_ALPHA_TEX_FORMAT();
// set the rgba components of a pixel, any of the parameters can be NULL
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern void (*bm_set_components_32)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_32_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
// get the rgba components of a pixel, any of the parameters can be NULL
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of 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
int bm_is_compressed(int num);
int bm_get_tcache_type(int num);
int bm_get_size(int num);
int bm_get_num_mipmaps(int num);
int bm_has_alpha_channel(int handle);
void bm_print_bitmaps();
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);
#endif
+971
View File
@@ -0,0 +1,971 @@
#include "camera/camera.h"
#include "math/vecmat.h"
#include "graphics/2d.h"
#include "globalincs/alphacolors.h"
#include "parse/parselo.h"
#include "physics/physics.h" //apply_physics
#include "globalincs/systemvars.h" //VM_FREECAMERA etc
#include "hud/hud.h" //hud_get_draw
#include "model/model.h" //polymodel, model_get
#include "playerman/player.h" //player_get_padlock_orient
#include "ship/ship.h" //compute_slew_matrix
//*************************IMPORTANT GLOBALS*************************
float VIEWER_ZOOM_DEFAULT = 0.75f; // Default viewer zoom, 0.625 as per multi-lateral agreement on 3/24/97
warp_camera Warp_camera;
//*************************OTHER STUFF*************************
//Some global vars
std::vector<subtitle> Subtitles;
std::vector<camera*> Cameras;
//Preset cameras
camid Current_camera;
//*************************INTERNAL FUNCS*************************
//static avd_camera *cam_upgrade_to_avd(camera *cam);
//*************************CLASS: camera*************************
//This is where the camera class beings! :D
camera::camera(char *in_name, int in_signature)
{
set_name(in_name);
sig = in_signature;
// flags = CAM_DEFAULT_FLAGS;
reset();
}
camera::~camera()
{
//Check if this is in use
if(Current_camera.getSignature() == this->sig)
{
Current_camera = camid();
}
}
void camera::clear()
{
strcpy(name, "");
sig = -1;
reset();
}
void camera::reset()
{
flags = CAM_DEFAULT_FLAGS;
object_self = object_target = object_h();
object_self_submodel = object_target_submodel = -1;
c_fov = VIEWER_ZOOM_DEFAULT;
c_pos = vmd_zero_vector;
c_ori = vmd_identity_matrix;
func_custom_position = NULL;
func_custom_orientation = NULL;
fov.clear();
fov.set(VIEWER_ZOOM_DEFAULT);
pos_x.clear();
pos_y.clear();
pos_z.clear();
ori_p.clear();
ori_b.clear();
ori_h.clear();
/*
flags = CAM_DEFAULT_FLAGS;
desired_position = position = vmd_zero_vector;
translation_velocity = translation_vel_limit = translation_acc_limit = vmd_zero_vector;
vm_set_identity(&orientation);
vm_set_identity(&desired_orientation);
rotation_rate = rotation_vel_limit = rotation_acc_limit = vmd_zero_vector;
*/
}
void camera::set_name(char *in_name)
{
if(name != NULL)
strncpy(name, in_name, NAME_LENGTH-1);
}
void camera::set_fov(float in_fov, float in_fov_time, float in_fov_acceleration_time)
{
if(in_fov_time == 0.0f && in_fov_acceleration_time == 0.0f)
{
flags |= CAM_STATIONARY_FOV;
c_fov = in_fov;
return;
}
flags &= ~CAM_STATIONARY_FOV;
if(in_fov <= 0.0f)
{
fov.setVD(in_fov_time, in_fov_acceleration_time, 0.0f);
}
fov.setAVD(in_fov, in_fov_time, in_fov_acceleration_time, in_fov_acceleration_time, 0.0f);
}
void camera::set_object_self(object *objp, int n_object_self_submodel)
{
if(objp == NULL)
object_self = object_h();
object_self = object_h(objp);
object_self_submodel = n_object_self_submodel;
}
void camera::set_object_target(object *objp, int n_object_target_submodel)
{
if(objp == NULL)
object_target = object_h();
object_target = object_h(objp);
object_target_submodel = n_object_target_submodel;
}
//Custom function receives the already-modified current position value.
//It should be replaced or added to as the custom function modifier sees fit.
void camera::set_custom_position_function(void (*n_func_custom_position)(camera *cam, vec3d *camera_pos))
{
func_custom_position = n_func_custom_position;
}
//Custom function receives the already-modified current orientation value.
//It should be replaced or added to as the custom function modifier sees fit.
void camera::set_custom_orientation_function(void (*n_func_custom_orientation)(camera *cam, matrix *camera_ori))
{
func_custom_orientation = n_func_custom_orientation;
}
void camera::set_position(vec3d *in_position, float in_translation_time, float in_translation_acceleration_time)
{
if(in_translation_time == 0.0f && in_translation_acceleration_time == 0.0f)
{
c_pos = *in_position;
flags |= CAM_STATIONARY_POS;
return;
}
flags &= ~CAM_STATIONARY_POS;
if(in_position == NULL)
{
pos_x.setVD(in_translation_time, in_translation_acceleration_time, 0.0f);
pos_y.setVD(in_translation_time, in_translation_acceleration_time, 0.0f);
pos_z.setVD(in_translation_time, in_translation_acceleration_time, 0.0f);
return;
}
pos_x.setAVD(in_position->xyz.x, in_translation_time, in_translation_acceleration_time, in_translation_acceleration_time, 0.0f);
pos_y.setAVD(in_position->xyz.y, in_translation_time, in_translation_acceleration_time, in_translation_acceleration_time, 0.0f);
pos_z.setAVD(in_position->xyz.z, in_translation_time, in_translation_acceleration_time, in_translation_acceleration_time, 0.0f);
}
void camera::set_translation_velocity(vec3d *in_velocity, float in_acceleration_time)
{
pos_x.setVD(in_acceleration_time, in_acceleration_time, in_velocity->xyz.x);
pos_y.setVD(in_acceleration_time, in_acceleration_time, in_velocity->xyz.y);
pos_z.setVD(in_acceleration_time, in_acceleration_time, in_velocity->xyz.z);
}
void camera::set_rotation(matrix *in_orientation, float in_rotation_time, float in_rotation_acceleration_time)
{
if(in_rotation_time == 0.0f && in_rotation_acceleration_time == 0.0f)
{
c_ori = *in_orientation;
flags |= CAM_STATIONARY_ORI;
return;
}
angles a;
vm_extract_angles_matrix(&a, in_orientation);
this->set_rotation(&a, in_rotation_time, in_rotation_acceleration_time);
//c_ori = *in_orientation;
}
void camera::set_rotation(angles *in_angles, float in_rotation_time, float in_rotation_acceleration_time)
{
if(in_angles == NULL)
{
ori_p.setVD(in_rotation_time, in_rotation_acceleration_time, 0.0f);
ori_b.setVD(in_rotation_time, in_rotation_acceleration_time, 0.0f);
ori_h.setVD(in_rotation_time, in_rotation_acceleration_time, 0.0f);
return;
}
ori_p.setAVD(in_angles->p, in_rotation_time, in_rotation_acceleration_time, in_rotation_acceleration_time, 0.0f);
ori_b.setAVD(in_angles->b, in_rotation_time, in_rotation_acceleration_time, in_rotation_acceleration_time, 0.0f);
ori_h.setAVD(in_angles->h, in_rotation_time, in_rotation_acceleration_time, in_rotation_acceleration_time, 0.0f);
}
void camera::set_rotation_facing(vec3d *in_target, float in_rotation_time, float in_rotation_acceleration_time)
{
matrix temp_matrix = IDENTITY_MATRIX;
if(in_target != NULL)
{
vec3d position = vmd_zero_vector;
this->get_info(&position, NULL);
if(in_target->xyz.x == position.xyz.x && in_target->xyz.y == position.xyz.y && in_target->xyz.z == position.xyz.z)
{
Warning(LOCATION, "Camera tried to point to self");
return;
}
vec3d targetvec;
vm_vec_normalized_dir(&targetvec, in_target, &position);
vm_vector_2_matrix(&temp_matrix, &targetvec, NULL, NULL);
}
set_rotation(&temp_matrix, in_rotation_time, in_rotation_acceleration_time);
}
void camera::set_rotation_velocity(angles *in_rotation_rate, float in_acceleration_time)
{
ori_p.setVD(in_acceleration_time, in_acceleration_time, in_rotation_rate->p);
ori_b.setVD(in_acceleration_time, in_acceleration_time, in_rotation_rate->b);
ori_h.setVD(in_acceleration_time, in_acceleration_time, in_rotation_rate->h);
/*if(in_rotation_rate == NULL)
{
rotation_rate.p = rotation_rate.b = rotation_rate.h = 0.0f;
rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time = 0.0f;
rotation_rate_decel_time_til = -1.0f;
return;
}
rotation_rate_delta_time = rotation_rate_delta_time_left = in_rotation_acceleration_time;
rotation_rate_decel_time_til = -1.0f;
rotation_rate_delta.p = in_rotation_rate->p / in_rotation_acceleration_time;
rotation_rate_delta.b = in_rotation_rate->b / in_rotation_acceleration_time;
rotation_rate_delta.h = in_rotation_rate->h / in_rotation_acceleration_time;*/
}
void camera::do_frame(float in_frametime)
{
}
object *camera::get_object_self()
{
if(object_self.IsValid())
return object_self.objp;
else
return NULL;
}
object *camera::get_object_target()
{
if(object_target.IsValid())
return object_target.objp;
else
return NULL;
}
float camera::get_fov()
{
if(!(flags & CAM_STATIONARY_FOV))
{
fov.get(&c_fov, NULL);
}
return c_fov;
}
void camera::get_info(vec3d *position, matrix *orientation)
{
//WTF?
if(position == NULL && orientation == NULL)
return;
//POSITION
if(!(flags & CAM_STATIONARY_POS))
{
c_pos = vmd_zero_vector;
if(object_self.IsValid())
{
object *objp = object_self.objp;
int model_num = object_get_model(objp);
polymodel *pm = NULL;
if(model_num > -1)
{
pm = model_get(model_num);
}
if(object_self_submodel < 0 || pm == NULL)
{
c_pos = objp->pos;
}
else
{
model_find_world_point( &c_pos, &vmd_zero_vector, pm->id, object_self_submodel, &objp->orient, &objp->pos );
}
}
//Do custom position stuff, if needed
if(func_custom_position != NULL)
{
func_custom_position(this, &c_pos);
}
vec3d pt;
pos_x.get(&pt.xyz.x, NULL);
pos_y.get(&pt.xyz.y, NULL);
pos_z.get(&pt.xyz.z, NULL);
vm_vec_add2(&c_pos, &pt);
}
if(position != NULL)
*position = c_pos;
//ORIENTATION
if(orientation != NULL)
{
if(!(flags & CAM_STATIONARY_ORI))
{
if(object_target.IsValid())
{
object *objp = object_target.objp;
int model_num = object_get_model(objp);
polymodel *pm = NULL;
vec3d target_pos = vmd_zero_vector;
//See if we can get the model
if(model_num > -1)
{
pm = model_get(model_num);
}
//If we don't have a submodel or don't have the model use object pos
//Otherwise, find the submodel pos as it is rotated
if(object_self_submodel < 0 || pm == NULL)
{
target_pos = objp->pos;
}
else
{
model_find_world_point( &target_pos, &vmd_zero_vector, pm->id, object_target_submodel, &objp->orient, &objp->pos );
}
vec3d targetvec;
vm_vec_normalized_dir(&targetvec, &target_pos, &c_pos);
vm_vector_2_matrix(&c_ori, &targetvec, NULL, NULL);
}
else if(object_self.IsValid())
{
c_ori = object_self.objp->orient;
}
else
{
c_ori = vmd_identity_matrix;
}
//Do human interaction
//WMC - Nevermind for now, maybe toggleable later.
/*
if ( Viewer_obj == object_self.objp || Viewer_mode & VM_CHASE ) {
if ( Viewer_mode & VM_PADLOCK_ANY ) {
player_get_padlock_orient(&c_ori);
} else {
compute_slew_matrix(&c_ori, &Viewer_slew_angles);
}
}*/
//Do custom orientation stuff, if needed
if(func_custom_orientation != NULL)
{
func_custom_orientation(this, &c_ori);
}
angles a;
ori_p.get(&a.p, NULL);
ori_b.get(&a.b, NULL);
ori_h.get(&a.h, NULL);
//vm_rotate_matrix_by_angles(&c_ori, &a);
vm_angles_2_matrix(&c_ori, &a);
}
*orientation = c_ori;
}
}
//*************************warp_camera*************************
warp_camera::warp_camera()
{
this->reset();
}
warp_camera::warp_camera(object *objp)
{
this->reset();
vec3d object_pos = objp->pos;
matrix tmp;
ship_get_eye(&object_pos, &tmp, objp);
/*
//matrix tmp_m = vmd_identity_matrix;
camid cid = ship_get_eye( objp );
if(cid.isValid())
{
camera *cam = cid.getCamera();
cam->get_info(&player_pos, NULL);
//tmp_m = *cam->get_orientation();
}
*/
vm_vec_scale_add2( &object_pos, &Player_obj->orient.vec.rvec, 0.0f );
vm_vec_scale_add2( &object_pos, &Player_obj->orient.vec.uvec, 0.952f );
vm_vec_scale_add2( &object_pos, &Player_obj->orient.vec.fvec, -1.782f );
vec3d tmp_vel = { { { 0.0f, 5.1919f, 14.7f } } };
this->set_position( &object_pos );
this->set_rotation( &objp->orient );
this->set_velocity( &tmp_vel, true);
}
void warp_camera::reset()
{
c_pos = c_vel = c_desired_vel = vmd_zero_vector;
c_ori = vmd_identity_matrix;
c_damping = 1.0f;
c_time = 0.0f;
}
void warp_camera::set_position( vec3d *in_pos )
{
c_pos = *in_pos;
}
void warp_camera::set_rotation( matrix *in_ori )
{
c_ori = *in_ori;
}
void warp_camera::set_velocity( vec3d *in_vel, bool instantaneous )
{
c_desired_vel.xyz.x = 0.0f;
c_desired_vel.xyz.y = 0.0f;
c_desired_vel.xyz.z = 0.0f;
vm_vec_scale_add2( &c_desired_vel, &c_ori.vec.rvec, in_vel->xyz.x );
vm_vec_scale_add2( &c_desired_vel, &c_ori.vec.uvec, in_vel->xyz.y );
vm_vec_scale_add2( &c_desired_vel, &c_ori.vec.fvec, in_vel->xyz.z );
if ( instantaneous ) {
c_vel = c_desired_vel;
}
}
//
void warp_camera::do_frame(float in_frametime)
{
vec3d new_vel, delta_pos;
apply_physics( c_damping, c_desired_vel.xyz.x, c_vel.xyz.x, in_frametime, &new_vel.xyz.x, &delta_pos.xyz.x );
apply_physics( c_damping, c_desired_vel.xyz.y, c_vel.xyz.y, in_frametime, &new_vel.xyz.y, &delta_pos.xyz.y );
apply_physics( c_damping, c_desired_vel.xyz.z, c_vel.xyz.z, in_frametime, &new_vel.xyz.z, &delta_pos.xyz.z );
c_vel = new_vel;
// mprintf(( "Camera velocity = %.1f,%.1f, %.1f\n", Camera_velocity.xyz.x, Camera_velocity.xyz.y, Camera_velocity.xyz.z ));
vm_vec_add2( &c_pos, &delta_pos );
float ot = c_time+0.0f;
c_time += in_frametime;
if ( (ot < 0.667f) && ( c_time >= 0.667f ) ) {
vec3d tmp;
tmp.xyz.z = 4.739f; // always go this fast forward.
// pick x and y velocities so they are always on a
// circle with a 25 m radius.
float tmp_angle = frand()*PI2;
tmp.xyz.x = 22.0f * (float)sin(tmp_angle);
tmp.xyz.y = -22.0f * (float)cos(tmp_angle);
//mprintf(( "Angle = %.1f, vx=%.1f, vy=%.1f\n", tmp_angle, tmp.xyz.x, tmp.xyz.y ));
//mprintf(( "Changing velocity!\n" ));
this->set_velocity( &tmp, 0 );
}
if ( (ot < 3.0f ) && ( c_time >= 3.0f ) ) {
vec3d tmp = ZERO_VECTOR;
this->set_velocity( &tmp, 0 );
}
}
void warp_camera::get_info(vec3d *position, matrix *orientation)
{
if(position != NULL)
*position = c_pos;
if(orientation != NULL)
*orientation = c_ori;
}
//*************************subtitle*************************
#define MAX_SUBTITLE_LINES 64
subtitle::subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim, float in_fade_time, color *in_text_color, bool center_x, bool center_y, int in_width)
{
// basic init, this always has to be done
memset( imageanim, 0, sizeof(imageanim) );
image_id = -1;
if ( ((in_text != NULL) && (strlen(in_text) <= 0)) && ((in_imageanim != NULL) && (strlen(in_imageanim) <= 0)) )
return;
int num_text_lines = 0;
char *text_line_ptrs[MAX_SUBTITLE_LINES];
int text_line_lens[MAX_SUBTITLE_LINES];
//Setup text
if ( (in_text != NULL) && (strlen(in_text) > 0) ) {
num_text_lines = split_str(in_text, in_width, text_line_lens, text_line_ptrs, MAX_SUBTITLE_LINES);
std::string temp_str;
for(int i = 0; i < num_text_lines; i++)
{
temp_str.assign(text_line_ptrs[i], text_line_lens[i]);
text_lines.push_back(temp_str);
}
}
//Setup text color
if(in_text_color)
text_color = *in_text_color;
else
gr_init_alphacolor(&text_color, 255, 255, 255, 255);
//Setup display and fade time
display_time = fl_abs(in_display_time);
fade_time = fl_abs(in_fade_time);
//Setup image
if ( (in_imageanim != NULL) && (strlen(in_imageanim) > 0) )
{
image_id = bm_load(in_imageanim);
if (image_id >= 0)
strncpy(imageanim, in_imageanim, sizeof(imageanim) - 1);
}
//Setup pos
int w=0, h=0, tw=0, th=0;
float deltax, deltay;
image_pos[0] = 0;
image_pos[1] = 0;
if(center_x || center_y)
{
//Get text size
for(int i = 0; i < num_text_lines; i++)
{
gr_get_string_size(&w, &h, text_line_ptrs[i], text_line_lens[i]);
if(w > tw)
tw = w;
th += h;
}
//Get image size
if(image_id != -1)
{
bm_get_info(image_id, &w, &h);
tw += w;
if(h > th)
th = h;
}
//Center it?
if(center_x)
image_pos[0] = (gr_screen.max_w - tw)/2;
if(center_y)
image_pos[1] = (gr_screen.max_h - th)/2;
}
if(in_x_pos < 0 && !center_x)
image_pos[0] += gr_screen.max_w + in_x_pos;
else if(!center_x)
image_pos[0] += in_x_pos;
if(in_y_pos < 0 && !center_y)
image_pos[1] += gr_screen.max_h + in_y_pos;
else if(!center_y)
image_pos[1] += in_y_pos;
if(image_id != -1)
{
text_pos[0] = image_pos[0] + w; //Still set from bm_get_info call
deltax = text_pos[0] / 1024.0f; //MikeStar;
text_pos[0] = gr_screen.max_w * deltax; //MikeStar;
}
else
{
text_pos[0] = image_pos[0];
deltax = text_pos[0] / 1024.0f; //MikeStar;
text_pos[0] = gr_screen.max_w * deltax; //MikeStar;
}
text_pos[1] = image_pos[1];
deltay = text_pos[1] / 768.0f; //MikeStar;
text_pos[1] = gr_screen.max_h * deltay; //MikeStar;
time_displayed = 0.0f;
time_displayed_end = 2.0f*fade_time + display_time;
}
void subtitle::do_frame(float frametime)
{
//Figure out how much alpha
if(time_displayed < fade_time)
{
text_color.alpha = (ubyte)fl2i(255.0f*(time_displayed/fade_time));
}
else if(time_displayed > time_displayed_end)
{
//We're finished
return;
}
else if((time_displayed - fade_time) > display_time)
{
text_color.alpha = (ubyte)fl2i(255.0f*(1-(time_displayed - fade_time - display_time)/fade_time));
}
else
{
text_color.alpha = 255;
}
gr_set_color_fast(&text_color);
int font_height = gr_get_font_height();
int y = text_pos[1];
for(unsigned int i = 0; i < text_lines.size(); i++)
{
gr_string(text_pos[0], y, (char*)text_lines[i].c_str(), false);
y += font_height;
}
if(image_id != -1)
{
gr_set_bitmap(image_id, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, text_color.alpha/255.0f);
gr_bitmap(image_pos[0], image_pos[1], false);
}
time_displayed += frametime;
}
subtitle::~subtitle()
{
if (image_id != -1) {
if ( bm_release(image_id) ) {
image_id = -1;
}
}
}
void subtitle::clone(const subtitle &sub)
{
uint i = 0;
for (i = 0; i < sub.text_lines.size(); i++) {
text_lines.push_back(sub.text_lines[i]);
}
text_pos[0] = sub.text_pos[0];
text_pos[1] = sub.text_pos[1];
display_time = sub.display_time;
fade_time = sub.fade_time;
memcpy( &text_color, &sub.text_color, sizeof(color) );
if ( strlen(sub.imageanim) ) {
memcpy( imageanim, sub.imageanim, MAX_FILENAME_LEN );
// we bm_load() again here to kick the refcount up
image_id = bm_load(imageanim);
} else {
memset( imageanim, 0, MAX_FILENAME_LEN );
image_id = -1;
}
image_pos[0] = sub.image_pos[0];
image_pos[1] = sub.image_pos[1];
time_displayed = sub.time_displayed;
time_displayed_end = sub.time_displayed_end;
}
const subtitle &subtitle::operator=(const subtitle &sub)
{
if (this != &sub) {
if (image_id != -1) {
if ( bm_release(image_id) ) {
image_id = -1;
}
}
clone(sub);
}
return *this;
}
camid::camid()
{
idx = 0;
sig = -1;
}
camid::camid(int n_idx, int n_sig)
{
idx = n_idx;
sig = n_sig;
}
camera* camid::getCamera()
{
if(!isValid())
return NULL;
return Cameras[idx];
}
uint camid::getIndex()
{
return idx;
}
int camid::getSignature()
{
return sig;
}
bool camid::isValid()
{
if(idx < 0 || idx >= Cameras.size())
return false;
if(Cameras[idx] == NULL)
return false;
if(Cameras[idx]->get_signature() != this->sig)
return false;
return true;
}
void cam_init()
{
//Nothing now
}
void cam_close()
{
//Set Current_camera to nothing
Current_camera = camid();
for(unsigned int i = 0; i < Cameras.size(); i++)
{
if(Cameras[i] != NULL)
{
delete Cameras[i];
Cameras[i] = NULL;
}
}
Cameras.clear();
}
int cam_get_next_sig()
{
static int next_sig = 0;
return next_sig++;
}
camid cam_create(char *n_name, vec3d *n_pos, vec3d *n_norm, object *n_object, int n_object_self_submodel)
{
matrix ori;
vm_vector_2_matrix_norm(&ori, n_norm);
return cam_create(n_name, n_pos, &ori, n_object, n_object_self_submodel);
}
camid cam_create(char *n_name, vec3d *n_pos, matrix *n_ori, object *n_object, int n_object_self_submodel)
{
camera *cam = NULL;
camid cid;
//Get signature
int sig = cam_get_next_sig();
//Get name
char buf[NAME_LENGTH] = {'\0'};
if(n_name == NULL)
sprintf(buf, "Camera %d", cid.getSignature());
else
strncpy(buf, n_name, NAME_LENGTH-1);
//Find a free slot
for(uint i = 0; i < Cameras.size(); i++)
{
if(Cameras[i] == NULL)
{
cam = new camera(buf, sig);
cid = camid(i, sig);
Cameras[i] = cam;
break;
}
else if(Cameras[i]->is_empty())
{
delete Cameras[i];
cam = new camera(buf, sig);
cid = camid(i, sig);
Cameras[i] = cam;
}
}
if(cam == NULL)
{
cam = new camera(buf, sig);
cid = camid(Cameras.size(), sig);
Cameras.push_back(cam);
}
//Set attributes
if(n_pos != NULL)
cam->set_position(n_pos);
if(n_ori != NULL)
cam->set_rotation(n_ori);
if(n_object != NULL)
cam->set_object_self(n_object, n_object_self_submodel);
return cid;
}
void cam_delete(camid cid)
{
if(cid.isValid())
{
cid.getCamera()->clear();
}
}
void cam_do_frame(float frametime)
{
unsigned int i,size=Cameras.size();
for(i = 0; i < size; i++)
{
if(Cameras[i] != NULL)
Cameras[i]->do_frame(frametime);
}
}
camid cam_get_camera(uint idx)
{
if(idx < 0 || idx >= Cameras.size())
return camid();
return camid(idx, Cameras[idx]->get_signature());
}
camid cam_get_current()
{
return Current_camera;
}
uint cam_get_num()
{
return Cameras.size();
}
//Looks up camera by name, returns -1 on failure
camid cam_lookup(char *name)
{
unsigned int i,size=Cameras.size();
for(i = 0; i < size; i++)
{
if(Cameras[i] != NULL && !stricmp(Cameras[i]->get_name(), name))
return camid(i, Cameras[i]->get_signature());
}
return camid();
}
static int Camera_hud_draw_saved = 0;
bool cam_set_camera(camid cid)
{
if(!cid.isValid())
{
return false;
}
Viewer_mode |= VM_FREECAMERA;
Current_camera = cid;
Camera_hud_draw_saved = hud_get_draw();
hud_set_draw(0);
return true;
}
void cam_reset_camera()
{
Viewer_mode &= ~VM_FREECAMERA;
hud_set_draw(Camera_hud_draw_saved);
}
//Functions must delete the original camera after calling this function.
//Note that due to the esoteric nature of this function, it should not
//be used outside camera.cpp
/*
static avd_camera *cam_upgrade_to_avd(camera *cam)
{
for(uint i = 0; i < Cameras.size(); i++)
{
if(Cameras[i] == cam)
break;
}
if(i == Cameras.size())
return NULL;
avd_camera *avdcam = new avd_camera(cam);
//Make the switch
Cameras[i] = avdcam;
return avdcam;
}
*/
void subtitles_init()
{
//Do nothing!!
}
void subtitles_close()
{
Subtitles.clear();
}
void subtitles_do_frame(float frametime)
{
unsigned int i,size=Subtitles.size();
for(i = 0; i < size; i++)
{
Subtitles[i].do_frame(frametime);
}
}
+172
View File
@@ -0,0 +1,172 @@
#ifndef _CAMERA_H
#define _CAMERA_H
#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
{
friend class avd_camera;
protected:
char name[NAME_LENGTH];
int sig;
int flags;
object_h object_self;
int object_self_submodel;
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_p;
avd_movement ori_b;
avd_movement ori_h;
float c_fov;
vec3d c_pos;
matrix c_ori;
public:
camera(char *in_name=NULL, int in_signature=-1);
~camera();
void clear();
void reset();
//Set'
void set_name(char *in_name);
void set_object_self(object *objp, int n_object_self_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);
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, 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);
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(angles *in_rotation_rate, float in_acceleration_time = 0.0f);
//Get
char *get_name() {return name;}
int get_signature() {return sig;}
object *get_object_self();
object *get_object_target();
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];
float display_time;
float fade_time;
color text_color;
//Done with set
char imageanim[MAX_FILENAME_LEN];
int image_id;
int image_pos[2];
//Time this has been displayed
float time_displayed;
//When to end it
float time_displayed_end;
public:
subtitle(int in_x_pos, int in_y_pos, char* in_text, float in_display_time, char* in_imageanim = NULL, float in_fade_time = 0.0f, color *in_text_color = NULL, bool center_x = false, bool center_y = false, int in_width = 200);
~subtitle();
subtitle(const subtitle &sub) { clone(sub); }
const subtitle &operator=(const subtitle &sub);
void do_frame(float frametime);
};
//Some global stuff
extern std::vector<subtitle> Subtitles;
extern float VIEWER_ZOOM_DEFAULT;
//Helpful functions
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 subtitles_init();
void subtitles_close();
void subtitles_do_frame(float frametime);
#endif // _CAMERA_H
File diff suppressed because it is too large. Load diff
@@ -9,13 +9,110 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.22 $
* $Date: 2007-11-21 07:28:37 $
* $Author: Goober5000 $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 2.21 2007/04/11 18:24:27 taylor
* cleanup of chksum 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.20 2007/03/22 20:22:24 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.19 2007/02/11 09:31:11 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.18 2006/09/11 05:49:05 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
*
@@ -331,8 +428,9 @@
#ifndef __CFILE_H__
#define __CFILE_H__
#include <time.h>
#include "pstypes.h"
#include "globalincs/pstypes.h"
#define CF_EOF (-1)
@@ -356,44 +454,46 @@ typedef struct {
#define CF_TYPE_ANY -1 // Used to check in any directory
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MISSIONS 5
#define CF_TYPE_MODELS 6
#define CF_TYPE_TABLES 7
#define CF_TYPE_SOUNDS 8
#define CF_TYPE_SOUNDS_8B22K 9
#define CF_TYPE_SOUNDS_16B11K 10
#define CF_TYPE_VOICE 11
#define CF_TYPE_VOICE_BRIEFINGS 12
#define CF_TYPE_VOICE_CMD_BRIEF 13
#define CF_TYPE_VOICE_DEBRIEFINGS 14
#define CF_TYPE_VOICE_PERSONAS 15
#define CF_TYPE_VOICE_SPECIAL 16
#define CF_TYPE_VOICE_TRAINING 17
#define CF_TYPE_MUSIC 18
#define CF_TYPE_MOVIES 19
#define CF_TYPE_INTERFACE 20
#define CF_TYPE_FONT 21
#define CF_TYPE_EFFECTS 22
#define CF_TYPE_HUD 23
#define CF_TYPE_PLAYER_MAIN 24
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
#define CF_TYPE_CACHE 26
#define CF_TYPE_PLAYERS 27
#define CF_TYPE_SINGLE_PLAYERS 28
#define CF_TYPE_MULTI_PLAYERS 29
#define CF_TYPE_MULTI_CACHE 30
#define CF_TYPE_CONFIG 31
#define CF_TYPE_SQUAD_IMAGES_MAIN 32
#define CF_TYPE_DEMOS 33
#define CF_TYPE_CBANIMS 34
#define CF_TYPE_INTEL_ANIMS 35
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MODELS 5
#define CF_TYPE_TABLES 6
#define CF_TYPE_SOUNDS 7
#define CF_TYPE_SOUNDS_8B22K 8
#define CF_TYPE_SOUNDS_16B11K 9
#define CF_TYPE_VOICE 10
#define CF_TYPE_VOICE_BRIEFINGS 11
#define CF_TYPE_VOICE_CMD_BRIEF 12
#define CF_TYPE_VOICE_DEBRIEFINGS 13
#define CF_TYPE_VOICE_PERSONAS 14
#define CF_TYPE_VOICE_SPECIAL 15
#define CF_TYPE_VOICE_TRAINING 16
#define CF_TYPE_MUSIC 17
#define CF_TYPE_MOVIES 18
#define CF_TYPE_INTERFACE 19
#define CF_TYPE_FONT 20
#define CF_TYPE_EFFECTS 21
#define CF_TYPE_HUD 22
#define CF_TYPE_PLAYERS 23
#define CF_TYPE_PLAYER_IMAGES 24
#define CF_TYPE_SQUAD_IMAGES 25
#define CF_TYPE_SINGLE_PLAYERS 26
#define CF_TYPE_MULTI_PLAYERS 27
#define CF_TYPE_CACHE 28
#define CF_TYPE_MULTI_CACHE 29
#define CF_TYPE_MISSIONS 30
#define CF_TYPE_CONFIG 31
#define CF_TYPE_DEMOS 32
#define CF_TYPE_CBANIMS 33
#define CF_TYPE_INTEL_ANIMS 34
#define CF_TYPE_SCRIPTS 35
#define CF_TYPE_FICTION 36
#define CF_MAX_PATH_TYPES 37 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
@@ -405,6 +505,7 @@ typedef struct {
#define CF_SORT_NONE 0
#define CF_SORT_NAME 1
#define CF_SORT_TIME 2
#define CF_SORT_REVERSE 3
#define cfread_fix(file) (fix)cfread_int(file)
#define cfwrite_fix(i,file) cfwrite_int(i,file)
@@ -416,6 +517,9 @@ extern int (*Get_file_list_filter)(char *filename);
// cfile directory. valid after cfile_init() returns successfully
#define CFILE_ROOT_DIRECTORY_LEN 256
extern char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN];
#ifdef SCP_UNIX
extern char Cfile_user_dir[CFILE_ROOT_DIRECTORY_LEN];
#endif
//================= LOW-LEVEL FUNCTIONS ==================
// Call this once at the beginning of the program
@@ -436,6 +540,10 @@ int cf_get_dir_type(CFILE *cfile);
// default path. If mode is NULL, delete the file.
CFILE *cfopen(char *filename, char *mode, int type = CFILE_NORMAL, int dir_type = CF_TYPE_ANY, bool localize = false);
// like cfopen(), but it accepts a fully qualified path only (ie, the result of a cf_find_file_location() call)
// NOTE: only supports reading files!!
CFILE *cfopen_special(char *file_path, char *mode, const int size, const int offset, int dir_type = CF_TYPE_ANY);
// Flush the open file buffer
int cflush(CFILE *cfile);
@@ -443,14 +551,22 @@ 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 );
// Deletes a file.
void cf_delete( char *filename, int dir_type );
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete(char *filename, int dir_type);
// Same as _access function to read a file's access bits
int cf_access( char *filename, int dir_type, int mode );
int cf_access(char *filename, int dir_type, int mode);
// Returns 1 if file exists, 0 if not.
int cf_exist( char *filename, int dir_type );
// Returns 1 if the file exists, 0 if not.
// Checks only the file system.
int cf_exists(char *filename, int dir_type);
// Goober5000
// Returns 1 if the file exists, 0 if not.
// Checks both the file system and the VPs.
int cf_exists_full(char *filename, int dir_type);
// check num_ext worth of ext_list extensions
int cf_exists_full_ext(char *filename, int dir_type, const int num_ext, const char **ext_list);
// ctmpfile() opens a temporary file stream. File is deleted automatically when closed
CFILE *ctmpfile();
@@ -509,13 +625,15 @@ int cf_chksum_long(char *filename, uint *chksum, int max_size = -1, int cf_type
// NOTE : preserves current file position
int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
int cf_chksum_pack(char *filename, uint *chk_long, bool full = false);
// convenient for misc checksumming purposes ------------------------------------------
// update cur_chksum with the chksum of the new_data of size new_data_size
ushort cf_add_chksum_short(ushort seed, char *buffer, int size);
ushort cf_add_chksum_short(ushort seed, ubyte *buffer, int size);
// update cur_chksum with the chksum of the new_data of size new_data_size
unsigned long cf_add_chksum_long(unsigned long seed, char *buffer, int size);
uint cf_add_chksum_long(uint seed, ubyte *buffer, int size);
// convenient for misc checksumming purposes ------------------------------------------
@@ -547,7 +665,7 @@ ushort cfread_ushort(CFILE *file, int ver = 0, ushort deflt = 0);
int cfread_int(CFILE *file, int ver = 0, int deflt = 0);
uint cfread_uint(CFILE *file, int ver = 0, uint deflt = 0);
float cfread_float(CFILE *file, int ver = 0, float deflt = 0.0f);
void cfread_vector(vector *vec, CFILE *file, int ver = 0, vector *deflt = NULL);
void cfread_vector(vec3d *vec, CFILE *file, int ver = 0, vec3d *deflt = NULL);
void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
// Reads variable length, null-termined string. Will only read up
@@ -565,7 +683,7 @@ int cfwrite_uint(uint i, CFILE *file);
int cfwrite_short(short s, CFILE *file);
int cfwrite_ushort(ushort s, CFILE *file);
int cfwrite_ubyte(ubyte u, CFILE *file);
int cfwrite_vector(vector *vec, CFILE *file);
int cfwrite_vector(vec3d *vec, CFILE *file);
int cfwrite_angles(angles *ang, CFILE *file);
// writes variable length, null-termined string.
@@ -583,15 +701,33 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NUL
// CD's and pack files.
// Input: filespace - Filename & extension
// pathtype - See CF_TYPE_ defines in CFILE.H
// max_out - Maximum string size to be stuffed into pack_filename
// Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns 0.
int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, int *size, int *offset, bool localize = false);
int cf_find_file_location( char *filespec, int pathtype, int max_out, char *pack_filename, int *size, int *offset, bool localize = false);
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files. Searches all locations in order for first filename using ext filter list.
// Input: filename - Filename & extension
// ext_num - number of extensions to look for
// ext_list - extension filter list
// pathtype - See CF_TYPE_ defines in CFILE.H
// max_out - Maximum string length that should be stuffed into pack_filename
// Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns -1, else returns offset into ext_list.
// (NOTE: This function is exponentially slow, so don't use it unless truely needed!!)
int cf_find_file_location_ext(char *filename, const int ext_num, const char **ext_list, int pathtype, int max_out = 0, char *pack_filename = NULL, int *size = NULL, int *offset = NULL, bool localize = false);
// Functions to change directories
int cfile_chdir(char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
#endif
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type);
@@ -9,14 +9,40 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2006-12-28 00:59:19 $
* $Author: wmcoolmon $
*
* 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.7 2005/07/24 18:31:17 taylor
* little 64-bit strangeness (longs are 64-bit here rather than 32)
*
* 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
*
@@ -79,17 +105,19 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "cfile/cfile.h"
#include "cfile/cfilearchive.h"
#include "luaconf.h"
#include "pstypes.h"
#include "cfile.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "cfilearchive.h"
#define CHECK_POSITION
@@ -113,7 +141,8 @@ void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position = ftell(cb->fp) - cb->lib_offset;
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
}
@@ -145,8 +174,9 @@ int cfeof(CFILE *cfile)
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
if (cb->raw_position >= cb->size ) {
@@ -176,8 +206,9 @@ int cftell( CFILE * cfile )
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
return cb->raw_position;
@@ -225,7 +256,8 @@ int cfseek( CFILE *cfile, int offset, int where )
cb->raw_position = goal_position - cb->lib_offset;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
int tmp_offset;
tmp_offset = (int)ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
@@ -271,7 +303,8 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
@@ -279,3 +312,29 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
}
int cfread_lua_number(double *buf, CFILE *cfile)
{
Assert(cfile != NULL);
Assert(buf != NULL);
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
Cfile_block *cb;
cb = &Cfile_block_list[cfile->id];
// cfread() not supported for memory-mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
long orig_pos = ftell(cb->fp);
int items_read = fscanf(cb->fp, LUA_NUMBER_SCAN, buf);
cb->raw_position += ftell(cb->fp)-orig_pos;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return items_read;
}
@@ -9,14 +9,26 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $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
*
@@ -60,8 +72,13 @@ typedef struct Cfile_block {
int dir_type; // directory location
FILE *fp; // File pointer if opening an individual file
void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
#ifdef _WIN32
HANDLE hInFile; // Handle from CreateFile()
HANDLE hMapFile; // Handle from CreateFileMapping()
#else
// int fd; // file descriptor
size_t data_length; // length of data for mmap
#endif
int lib_offset;
int raw_position;
int size; // for packed files
@@ -9,13 +9,37 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2007-05-20 02:51:08 $
* $Author: taylor $
*
* Code for doing directory lists and sorts
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2006/08/20 00:45:10 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
*
@@ -57,16 +81,19 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "pstypes.h"
#include "cfile.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
// n = number of filenames in list to sort
@@ -135,6 +162,30 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
incr /= 2;
}
return;
} else if (sort == CF_SORT_REVERSE) {
incr = n / 2;
char buffer[MAX_FILENAME_LEN];
file_list_info tt_tmp;
for (i = 0; i < incr; i++) {
t = list[n - 1 - i];
if (list[i] != t) {
strcpy(buffer, list[i]);
strcpy(list[i], t);
strcpy(t, buffer);
if (info) {
tt = info[n - 1 - i];
tt_tmp = info[i];
info[i] = tt;
tt = tt_tmp;
}
}
}
return;
}
@@ -142,6 +193,8 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
}
#if (0) // these aren't used anywhere now
// cf_compress - Do Run Length Compression on a block of data. Targa format.
//
// Usage:
@@ -311,6 +364,8 @@ int cf_decompress(char *out, char *in )
}
#endif // 0
// cfread() reads from a file and decompresses it
//
@@ -323,7 +378,7 @@ int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
while(1) {
byte count;
ubyte count;
if ( cfread( &count, 1, 1, cfile ) != 1 ) {
break;
@@ -336,7 +391,7 @@ int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
if ( count > 0 ) {
if ( run_span ) {
// RLE'd data
byte c;
ubyte c;
if ( cfread( &c, 1, 1, cfile ) != 1 ) {
break;
}
File diff suppressed because it is too large. Load diff
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $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.
@@ -20,6 +20,23 @@
* 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
*
@@ -46,6 +63,8 @@
#ifndef _CFILESYSTEM_H
#define _CFILESYSTEM_H
#include "cfile/cfile.h"
// Builds a list of all the files
void cf_build_secondary_filelist( char *cdrom_path );
void cf_free_secondary_filelist();
@@ -53,7 +72,7 @@ void cf_free_secondary_filelist();
// Internal stuff
typedef struct cf_pathtype {
int index; // To verify that the CF_TYPE define is correctly indexed into this array
char *path; // Path relative to Freespace root, has ending backslash.
char *path; // Path relative to FreeSpace root, has ending backslash.
char *extensions; // Extensions used in this pathtype, separated by spaces
int parent_index; // Index of this directory's parent. Used for creating directories when writing.
} cf_pathtype;
@@ -67,9 +86,11 @@ extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
// If filename isn't null it will also tack the filename
// on the end, creating a completely valid filename.
// Input: pathtype - CF_TYPE_??
// path_max - Maximum characters in the path
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
void cf_create_default_path_string( char *path, int pathtype, char *filename=NULL, bool localize = false);
//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);
#endif //_CFILESYSTEM_H
+455
View File
@@ -0,0 +1,455 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
* $Revision: 2.5 $
* $Date: 2007-05-11 03:09:09 $
* $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>
#include <string.h>
#ifdef _WIN32
#include <direct.h>
#include <io.h>
#include <conio.h>
#else
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
static int data_error;
static int no_dir;
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
// since it would require SDL which isn't used on WIN32 platforms
#if BYTE_ORDER == BIG_ENDIAN
#define INT_SWAP(x) ( \
(x << 24) | \
(((ulong)x) >> 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) \
)
#else
#define INT_SWAP(x) (x)
#endif
size_t fswrite_int(int *wint, FILE *stream)
{
int tmp = *wint;
tmp = INT_SWAP(tmp);
return fwrite(&tmp, 1, sizeof(int), stream);
}
unsigned int Total_size=16; // Start with size of header
unsigned int Num_files =0;
FILE *fp_out = NULL;
FILE *fp_out_hdr = NULL;
typedef struct vp_header {
char id[4];
int version;
int index_offset;
int num_files;
} vp_header;
//vp_header Vp_header;
char archive_dat[1024];
char archive_hdr[1024];
#define BLOCK_SIZE (1024*1024)
#define VERSION_NUMBER 2;
char tmp_data[BLOCK_SIZE]; // 1 MB
void write_header()
{
int ver = VERSION_NUMBER;
fseek(fp_out, 0, SEEK_SET);
fwrite("VPVP", 1, 4, fp_out);
fswrite_int(&ver, fp_out);
fswrite_int((int*)&Total_size, fp_out);
fswrite_int((int*)&Num_files, fp_out);
}
int write_index(char *hf, char *df)
{
FILE *h = NULL, *d = NULL;
unsigned int i;
h = fopen(hf, "rb");
d = fopen(df, "a+b");
if ( (h == NULL) || (d == NULL) )
return 0;
for (i = 0; i < Num_files; i++) {
fread(tmp_data, 32+4+4+4, 1, h);
fwrite(tmp_data, 32+4+4+4, 1, d);
}
fclose(h);
fclose(d);
unlink(hf);
return 1;
}
void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_write )
{
char path[1024];
if ( strstr( filename, ".vp" )) {
// Don't pack yourself!!
return;
}
if ( strstr( filename, ".hdr" )) {
// Don't pack yourself!!
return;
}
if ( filesize == 0 ) {
// Don't pack 0 length files, screws up directory structure!
return;
}
if ( strlen(filename) > 31 ) {
printf( "Filename '%s' too long\n", filename );
exit(1);
}
memset( path, 0, sizeof(path) );
strcpy( path, filename );
fswrite_int( (int*)&Total_size, fp_out_hdr );
fswrite_int( &filesize, fp_out_hdr );
fwrite( &path, 1, 32, fp_out_hdr );
fswrite_int( (int*)&time_write, fp_out_hdr );
Total_size += filesize;
Num_files++;
printf( "Packing %s%s%s...", filespec, DIR_SEPARATOR_STR, filename );
sprintf( path, "%s%s%s", filespec, DIR_SEPARATOR_STR, filename );
FILE *fp = fopen( path, "rb" );
if ( fp == NULL ) {
printf( "Error opening '%s'\n", path );
exit(1);
}
int nbytes, nbytes_read=0;
do {
nbytes = fread( tmp_data, 1, BLOCK_SIZE, fp );
if ( nbytes > 0 ) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_read += nbytes;
}
} while( nbytes > 0 );
fclose(fp);
printf( " %d bytes\n", nbytes_read );
}
// This function adds a directory marker to the header file
void add_directory( char * dirname)
{
char path[256];
char *pathptr = path;
char *tmpptr;
int i = 0;
strcpy(path, dirname);
fswrite_int( (int*)&Total_size, fp_out_hdr);
fswrite_int( &i, fp_out_hdr);
// strip out any directories that this dir is a subdir of
while ( (tmpptr = strchr(pathptr, DIR_SEPARATOR_CHAR)) != NULL ) {
pathptr = tmpptr+1;
}
fwrite(pathptr, 1, 32, fp_out_hdr);
fswrite_int( &i, fp_out_hdr); // timestamp = 0
Num_files++;
}
void pack_directory( char * filespec)
{
#ifdef _WIN32
int find_handle;
_finddata_t find;
#endif
char tmp[512];
char tmp1[512];
char *ts;
// strip trailing slash
ts = filespec + (strlen(filespec) - 1);
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
strcpy( tmp1, filespec );
add_directory(filespec);
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
printf( "In dir '%s'\n", tmp1 );
#ifdef _WIN32
find_handle = _findfirst( tmp1, &find );
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
}
}
#else
DIR *dirp;
struct dirent *dir;
dirp = opendir (filespec);
if ( dirp ) {
while ((dir = readdir(dirp)) != NULL) {
char fn[MAX_PATH];
snprintf(fn, MAX_PATH-1, "%s/%s", filespec, dir->d_name);
fn[MAX_PATH-1] = 0;
struct stat buf;
if (stat(fn, &buf) == -1) {
continue;
}
if ( (strcmp(dir->d_name, ".") == 0) || (strcmp(dir->d_name, "..") == 0) ) {
continue;
}
if (S_ISDIR(buf.st_mode)) {
strcpy( tmp, filespec );
strcat( tmp, "/" );
strcat( tmp, dir->d_name );
pack_directory(tmp);
} else {
pack_file( filespec, dir->d_name, buf.st_size, buf.st_mtime );
}
}
closedir(dirp);
} else {
printf("Error: Source directory does not exist!\n");
no_dir = 1;
}
#endif
add_directory("..");
}
int verify_directory( char *filespec )
{
char *ts;
char *dd;
// strip trailing '/'
ts = filespec+(strlen(filespec)-1);
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
// make sure last directory is named "data", ignoring case
dd = filespec + (strlen(filespec) - 4);
if ( stricmp( dd, "data" ) )
data_error = 1;
return data_error;
}
void print_instructions()
{
printf( "Creates a vp archive out of a FreeSpace data tree.\n\n" );
printf( "Usage: cfilearchiver archive_name src_dir\n");
printf( "Example: cfilearchiver freespace /tmp/freespace/data\n\n");
printf( "Directory structure options:\n" );
printf( " Effects (.ani .pcx .neb .tga)\n" );
printf( " Fonts (.vf)\n" );
printf( " Hud (.ani .pcx .tga\n" );
printf( " Interface (.pcx .ani .tga)\n" );
printf( " Maps (.pcx .ani .tga)\n" );
printf( " Missions (.ntl .ssv), FS1(.fsm .fsc), FS2(.fs2 .fc2)\n" );
printf( " Models (.pof)\n" );
printf( " Music (.wav)\n" );
printf( " Sounds/8b22k (.wav)\n" );
printf( " Sounds/16b11k (.wav)\n" );
printf( " Tables (.tbl)\n" );
printf( " Voice/Briefing (.wav)\n" );
printf( " Voice/Command briefings (.wav)\n" );
printf( " Voice/Debriefing (.wav)\n" );
printf( " Voice/Personas (.wav)\n" );
printf( " Voice/Special (.wav)\n" );
printf( " Voice/Training (.wav)\n" );
exit(0);
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[] )
{
char archive[1024];
char *p;
if ( argc < 3 ) {
#ifdef _WIN32
printf( "Usage: %s archive_name src_dir\n", argv[0] );
printf( "Example: %s freespace c:\\freespace\\data\n", argv[0] );
printf( "Creates an archive named freespace out of the\nfreespace data tree\n" );
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
print_instructions();
#endif
}
strcpy( archive, argv[1] );
p = strchr( archive, '.' );
if (p) *p = 0; // remove extension
strcpy( archive_dat, archive );
strcat( archive_dat, ".vp" );
strcpy( archive_hdr, archive );
strcat( archive_hdr, ".hdr" );
fp_out = fopen( archive_dat, "wb" );
if ( !fp_out ) {
printf( "Couldn't open '%s'!\n", archive_dat );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(1);
#endif
}
fp_out_hdr = fopen( archive_hdr, "wb" );
if ( !fp_out_hdr ) {
printf( "Couldn't open '%s'!\n", archive_hdr );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(2);
#endif
}
if ( verify_directory( argv[2] ) != 0 ) {
printf("Warning! Last directory must be named \"data\" (not case sensitive)\n");
exit(3);
}
write_header();
pack_directory( argv[2] );
// in case the directory doesn't exist
if ( no_dir )
exit(4);
write_header();
fclose(fp_out);
fclose(fp_out_hdr);
printf( "Data files written, appending index...\n" );
if (!write_index(archive_hdr, archive_dat)) {
printf("Error appending index!\n");
#ifdef _WIN32
printf("Press any key to exit...\n");
getch();
#endif
return 1;
}
printf( "%d total KB.\n", Total_size/1024 );
return 0;
}
+537
View File
@@ -0,0 +1,537 @@
/*
* Copyright (C) 2005 Taylor Richards
*
*/
/*
* $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"
#include <vector>
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <ctime>
#ifdef _WIN32
#include <direct.h>
#else
#include <unistd.h>
#endif
#include <sys/stat.h>
#include <sys/types.h>
#include <errno.h>
// /////////////////////////////////////////////////////////////////////////////
//
// GLOBAL FUNCTIONS AND VARIABLES
//
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
// since it would require SDL which isn't used on WIN32 platforms
#if BYTE_ORDER == BIG_ENDIAN
#define INT_SWAP(x) ( \
(x << 24) | \
(((ulong)x) >> 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) \
)
#else
#define INT_SWAP(x) (x)
#endif
FILE *fp_in = NULL;
FILE *fp_out = NULL;
#ifndef MAX_PATH
#define MAX_PATH 255
#endif
char out_dir[MAX_PATH];
#define BLOCK_SIZE (1024*1024)
char tmp_data[BLOCK_SIZE]; // 1 MB
static int have_index = 0;
static int have_header = 0;
#define ERR_NO_FP_IN 0
#define ERR_NO_FP_OUT 1
#define ERR_INVALID_VP 2
#define ERR_NO_INDEX 3
#define ERR_NO_HEADER 4
#define ERR_PATH_TOO_LONG 5
typedef struct vp_header {
char id[4]; // 'VPVP'
int version;
int index_offset; // offset where the file index starts, also a total file data size count
int num_files; // number of files, including each step in the directory structure
} vp_header;
vp_header VP_Header;
typedef struct vp_fileinfo {
// stuff that is actually written to the VP
int offset; // offset of where this file is in the VP
int file_size; // size of file
char file_name[CF_MAX_FILENAME_LENGTH]; // filename
_fs_time_t write_time; // date/time in _fs_time_t type (a 32-bit version of time_t)
// not in the VP
char file_path[CF_MAX_PATHNAME_LENGTH]; // file path, generated here and not actually in the VP on a per file basis
vp_fileinfo() {
offset = 0;
file_size = 0;
file_name[0] = '\0';
file_path[0] = '\0';
write_time = 0;
}
~vp_fileinfo() {}
} vp_fileinfo;
std::vector<vp_fileinfo> VP_FileInfo;
// just like strlwr() but without actually including it here
void lowercase(char *s)
{
if (s == NULL)
return;
while (*s) {
*s = tolower(*s);
s++;
}
}
//
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
//
// The useful stuff...
//
void print_error(int err)
{
switch (err) {
case ERR_NO_FP_IN:
printf("ERROR: The input file (fp_in) is NULL! Exiting...\n");
break;
case ERR_NO_FP_OUT:
printf("ERROR: The output file (fp_out) is NULL! Exiting...\n");
break;
case ERR_INVALID_VP:
printf("ERROR: The specified VP file is invalid! Exiting...\n");
break;
case ERR_NO_INDEX:
printf("ERROR: No file index is available! Exiting...\n");
break;
case ERR_NO_HEADER:
printf("ERROR: No file header is available! Exiting...\n");
break;
case ERR_PATH_TOO_LONG:
printf("ERROR: Path to output directory is too long! Exiting...\n");
break;
default:
break;
}
exit(1);
}
void read_header()
{
fseek(fp_in, 0, SEEK_SET);
fread(&VP_Header.id, 1, 4, fp_in);
fread(&VP_Header.version, 1, sizeof(int), fp_in);
fread(&VP_Header.index_offset, 1, sizeof(int), fp_in);
fread(&VP_Header.num_files, 1, sizeof(int), fp_in);
VP_Header.version = INT_SWAP(VP_Header.version);
VP_Header.index_offset = INT_SWAP(VP_Header.index_offset);
VP_Header.num_files = INT_SWAP(VP_Header.num_files);
// check for a valid id (VPVP)
if ( (VP_Header.id[0] != 'V') && (VP_Header.id[1] != 'P') && (VP_Header.id[2] != 'V') && (VP_Header.id[3] != 'P') )
print_error(ERR_INVALID_VP);
// the index_offset needs to be greater than the size of vp_header at the very least and there should be at least one file
if ( !(VP_Header.index_offset > (int)sizeof(vp_header)) || !(VP_Header.num_files > 1) )
print_error(ERR_INVALID_VP);
have_header = 1;
}
void read_index(int lc = 0)
{
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
else if (!have_header)
print_error(ERR_NO_HEADER);
int i;
char path[CF_MAX_PATHNAME_LENGTH];
fseek(fp_in, VP_Header.index_offset, SEEK_SET);
memset(path, 0, CF_MAX_PATHNAME_LENGTH);
for ( i = 0; i < VP_Header.num_files; i++) {
vp_fileinfo vpinfo;
fread(&vpinfo.offset, 1, sizeof(int), fp_in);
fread(&vpinfo.file_size, 1, sizeof(int), fp_in);
fread(&vpinfo.file_name, 1, CF_MAX_FILENAME_LENGTH, fp_in);
fread(&vpinfo.write_time, 1, sizeof(_fs_time_t), fp_in);
vpinfo.offset = INT_SWAP(vpinfo.offset);
vpinfo.file_size = INT_SWAP(vpinfo.file_size);
vpinfo.write_time = INT_SWAP(vpinfo.write_time);
// check if it's a directory and if so then create a path to use for files
if (vpinfo.file_size == 0) {
// if we get a ".." then drop down in the path
if (!strcmp(vpinfo.file_name, "..")) {
char *s = strrchr(path, DIR_SEPARATOR_CHAR);
if (s)
*s = '\0';
// skip, we don't want to add the ".." to the path
continue;
}
// don't add the very first directory separator character, easier to clean later
if (path[0] != 0)
strcat( path, DIR_SEPARATOR_STR );
// always make directory names lower case for ease of use
lowercase( vpinfo.file_name );
strcat( path, vpinfo.file_name );
} // it's a file then
else {
// lowercase the filename if wanted
if (lc == 1)
lowercase( vpinfo.file_name );
strcpy( vpinfo.file_path, path );
VP_FileInfo.push_back(vpinfo);
}
}
have_index = 1;
}
void extract_all_files(char *file)
{
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
else if (!have_header)
print_error(ERR_NO_HEADER);
else if (!have_index)
print_error(ERR_NO_INDEX);
int status, m_error, nbytes, nbytes_remaining;
char path[CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1]; // path length + filename length + extra NULL
char path2[CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1]; // path length + filename length + extra NULL
char *c;
ubyte have_outdir = 0;
int out_len = strlen(out_dir);
if (out_len > 0)
have_outdir = 1;
printf("VP file extractor - version 0.6\n");
printf("\n");
if (have_outdir) {
printf("Output directory: \"%s\"\n", out_dir);
}
printf("Extracting: %s...\n", file);
for (uint i = 0; i < VP_FileInfo.size(); i++) {
// save the file path to a temp location and recursively make the needed directories
if (have_outdir) {
if ( (out_len + 1 + strlen(path)) > MAX_PATH-1 )
print_error(ERR_PATH_TOO_LONG);
sprintf(path, "%s%s%s%s", out_dir, DIR_SEPARATOR_STR, VP_FileInfo[i].file_path, DIR_SEPARATOR_STR);
} else {
sprintf(path, "%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR);
}
c = &path[0];
while (c++) {
c = strchr(c, DIR_SEPARATOR_CHAR);
if (c) {
*c = '\0'; // NULL at DIR_SEP char
#ifdef _WIN32
status = _mkdir(path);
#else
status = mkdir(path, 0777);
#endif
m_error = errno;
if (status && (m_error != EEXIST) ) {
printf("Cannot mkdir %s: %s\n", VP_FileInfo[i].file_path, strerror(m_error));
continue;
}
*c = DIR_SEPARATOR_CHAR; // replace DIR_SEP char
}
}
memset( path, 0, CF_MAX_PATHNAME_LENGTH+CF_MAX_FILENAME_LENGTH+1);
// start writing out the file
fseek(fp_in, VP_FileInfo[i].offset, SEEK_SET);
sprintf(path, "%s%s%s", VP_FileInfo[i].file_path, DIR_SEPARATOR_STR, VP_FileInfo[i].file_name);
// this is cheap, I know.
if (have_outdir) {
if ( (out_len + 1 + strlen(path)) > MAX_PATH-1 )
print_error(ERR_PATH_TOO_LONG);
sprintf(path2, "%s%s%s", out_dir, DIR_SEPARATOR_STR, path);
} else {
strcpy(path2, path);
}
fp_out = fopen(path2, "wb");
printf(" %s ... ", path);
if (fp_out == NULL) {
printf("can't create file!\n");
continue;
}
nbytes_remaining = VP_FileInfo[i].file_size;
while ( nbytes_remaining > 0 ) {
nbytes = fread( tmp_data, 1, MIN(BLOCK_SIZE, nbytes_remaining), fp_in );
if (nbytes > 0) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_remaining -= nbytes;
}
}
printf("done!\n");
fclose(fp_out);
fp_out = NULL;
}
printf("\n");
}
// TODO: the formatting of this is a bit loco but I don't care enough to make it better...
void list_all_files(char *file)
{
char out_time[20];
float one_k = 1024.0f;
float one_m = 1048576.0f;
char m;
float div_by;
time_t plat_time;
// if we don't have an index then bail
if (!have_index)
print_error(ERR_NO_INDEX);
printf("VP file extractor - version 0.6\n");
printf("\n");
printf("%s:\n", file);
printf("\n");
printf(" Name Size Offset Date/Time Path\n");
printf("-------------------------------------------------------------------------------\n");
for (uint i = 0; i < VP_FileInfo.size(); i++) {
plat_time = VP_FileInfo[i].write_time; // gets rid of some platform strangeness this way
strftime(out_time, 32, "%F %H:%M", localtime(&plat_time)); // YYYY-mm-dd HH:mm (ISO 8601 date format, 24-hr time)
if (VP_FileInfo[i].file_size > (int)one_m) {
m = 'M';
div_by = one_m;
} else {
m = 'K';
div_by = one_k;
}
int len = strlen( VP_FileInfo[i].file_name );
printf("%s %*.1f%c %10i %18s %3s%s\n", VP_FileInfo[i].file_name, 33 - len, (float)VP_FileInfo[i].file_size/div_by, m, VP_FileInfo[i].offset, out_time, DIR_SEPARATOR_STR, VP_FileInfo[i].file_path);
}
printf("\n");
// we use the vector size here since VP_Header.num_files would include each entry
// in the directory tree as well as individual files and that artificially inflates
// the number of files that we show or would extract
printf("Total files: %i\n", (int)VP_FileInfo.size());
// yeah, I'm just that cheap
if (VP_Header.index_offset > (int)one_m) {
m = 'M';
div_by = one_m;
} else {
m = 'K';
div_by = one_k;
}
printf("Total size: %.1f%c\n", (float)VP_Header.index_offset/div_by, m);
printf("\n");
}
void help()
{
printf("VP file extractor - version 0.6\n");
printf("\n");
printf("Usage: cfileextractor [-x | -l] [-L] [-o <dir>] <vp_filename>\n");
printf("\n");
printf(" Commands (only one at the time):\n");
printf(" -x | --extract Extract all files into current directory.\n");
printf(" -l | --list List all files in VP archive.\n");
printf(" -h | --help Show this help text.\n");
printf("\n");
printf(" Options:\n");
printf(" -L | --lowercase Force all filenames to be lower case.\n");
printf(" -o <dir> Extract files to <dir> instead of current directory.\n");
printf(" NOTE: No spaces allowed, enclose path in \" \" if needed.\n");
printf("\n");
printf(" (No command specified will list all files in the VP archive.)\n");
printf("\n");
}
// we end up #include'ing SDL.h which on Windows and Mac will redfine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[])
{
int extract = 0, lc = 0, list = 0;
if (argc < 2) {
help();
return 0;
}
if (!strcmp(argv[1], "-h") || !strcmp(argv[1], "--help")) {
help();
return 0;
}
// the last option should always be the VP file that we want
fp_in = fopen(argv[argc-1], "rb");
if (fp_in == NULL)
print_error(ERR_NO_FP_IN);
// if the header is invalid then read_header() should exit us out
read_header();
memset(out_dir, 0, MAX_PATH);
// TODO: add filter based extraction
for (int i = 1; i < argc-1; i++) {
if (!strcmp(argv[i], "-x") || !strcmp(argv[i], "--extract")) {
if (list) {
help();
exit(0);
}
extract = 1;
} else if (!strcmp(argv[i], "-L") || !strcmp(argv[i], "--lowercase")) {
lc = 1;
} else if (!strcmp(argv[i], "-l") || !strcmp(argv[i], "--list")) {
if (extract) {
help();
exit(0);
}
list = 1;
} else if ( !strcmp(argv[i], "-o") && (i+1 < argc) && (argv[i+1][0] != '-') ) {
strncpy(out_dir, argv[i+1], MAX_PATH-1);
i++; // have to increment "i" past the output directory
} else {
help();
return 0;
}
}
// read the file index, make all filenames lowercase if wanted
read_index( lc );
if (extract) {
extract_all_files( argv[argc-1] );
return 0;
} else if (list) {
list_all_files( argv[argc-1] );
return 0;
} else {
// if only -L is specified or no command is specified then just list files
list_all_files( argv[argc-1] );
return 0;
}
return 0;
}
File diff suppressed because it is too large. Load diff
+724
View File
@@ -0,0 +1,724 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.95 $
* $Date: 2007-04-11 18:24:27 $
* $Author: taylor $
*
* $Log: not supported by cvs2svn $
* Revision 2.94 2007/01/10 01:40:43 taylor
* little bit of cleanup
* per earlier discussions: remove -jpgtga and -pcx32
*
* Revision 2.93 2006/11/16 00:50:00 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.92 2006/07/08 18:11:33 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.91 2006/06/27 04:55:53 taylor
* add -disable_fbo to troubleshoot crappy ATI drivers
* remove the temporary -alpha_alpha_blend option
* tack on an extra byte to the flags.lch file so that the launcher can easily detect if it's an OpenAL build or not
*
* Revision 2.90 2006/06/15 00:37:11 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
int parse_cmdline(char *cmdline);
int fred2_parse_cmdline(int argc, char *argv[]);
// COMMAND LINE SETTINGS
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
//
// Add any extern definitions here and put the actual variables inside of cmdline.cpp for ease of use
// Also, check to make sure anything you add doesn't break Fred or TestCode
// RETAIL OPTIONS ----------------------------------------------
extern char *Cmdline_connect_addr;
extern char *Cmdline_game_name;
extern char *Cmdline_game_password;
extern char *Cmdline_rank_above;
extern char *Cmdline_rank_below;
extern int Cmdline_cd_check;
extern int Cmdline_client_dodamage;
extern int Cmdline_closed_game;
extern int Cmdline_freespace_no_music;
extern int Cmdline_freespace_no_sound;
extern int Cmdline_gimme_all_medals;
extern int Cmdline_mouse_coords;
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;
// FSO OPTIONS -------------------------------------------------
// Graphics related
extern double specular_exponent_value;
extern float Cmdline_clip_dist;
extern float Cmdline_fov;
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_nomotiondebris;
extern int Cmdline_noscalevid; // disables fit-to-window for movies - taylor
extern int Cmdline_nospec;
// Game Speed related
extern int Cmdline_cache_bitmaps;
extern int Cmdline_img2dds;
extern int Cmdline_NoFPSCap;
extern int Cmdline_no_vsync;
// HUD related
extern int Cmdline_ballistic_gauge;
extern int Cmdline_dualscanlines;
extern int Cmdline_orb_radar;
extern int Cmdline_rearm_timer;
extern int Cmdline_targetinfo;
// Gameplay related
extern int Cmdline_3dwarp;
extern int Cmdline_ship_choice_3d;
extern int Cmdline_warp_flash;
// Audio related
extern int Cmdline_query_speech;
extern int Cmdline_snd_preload;
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;
extern int Cmdline_mpnoreturn;
extern int Cmdline_SpewMission_CRCs;
extern int Cmdline_SpewTable_CRCs;
// 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;
// Developer/Testing related
extern char *Cmdline_start_mission;
extern int Cmdline_dis_collisions;
extern int Cmdline_dis_weapons;
extern int Cmdline_noparseerrors;
extern int Cmdline_nowarn;
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;
#ifdef SCP_UNIX
extern int Cmdline_no_grab;
#endif
//extern char FreeSpace_Directory[]; // allievating a cfilesystem problem caused by fred -- Kazan
#endif
@@ -9,13 +9,52 @@
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $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
*
@@ -202,62 +241,38 @@
* $NoKeywords: $
*/
#include "pstypes.h"
#include "systemvars.h"
#include "cmeasure.h"
#include "freespace.h"
#include "vecmat.h"
#include "2d.h"
#include "3d.h"
#include "model.h"
#include "physics.h"
#include "floating.h"
#include "model.h"
#include "ship.h"
#include "timer.h"
#include "fireballs.h"
#include "radar.h"
#include "missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd.h"
#include "objectsnd.h"
#include "sound.h"
#include "staticrand.h"
#include "cmeasure/cmeasure.h"
//#include "freespace2/freespace.h"
//#include "model/model.h"
#include "ship/ship.h"
#include "math/staticrand.h"
#include "object/object.h"
#include "weapon/weapon.h"
#include "hud/hud.h"
#include "gamesnd/gamesnd.h"
#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;
//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 ) {
if ( !Cmeasure_inited )
Cmeasure_inited = 1;
/* // Do all the processing that happens only once
if ( Debris_model < 0 ) {
if (Debris_model>-1) {
polymodel * pm;
pm = model_get(Debris_model);
Debris_num_submodels = pm->n_models;
}
}
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
Debris_textures[i] = bm_load( Debris_texture_files[i] );
if ( Debris_textures[i] < 0 ) {
Warning( LOCATION, "Couldn't load species %d debris\ntexture, '%s'\n", i, Debris_texture_files[i] );
}
}
*/
}
// Reset everything between levels
Num_cmeasures = 0;
@@ -265,8 +280,8 @@ void cmeasure_init()
Cmeasures[i].subtype = CMEASURE_UNUSED;
}
}
}*/
/*
void cmeasure_render(object * objp)
{
// JAS TODO: Replace with proper fireball
@@ -280,16 +295,6 @@ void cmeasure_render(object * objp)
Int3(); // Hey, what are we doing in here?
return;
}
// float size = -1.0f;
// vertex p;
// g3_rotate_vertex(&p, &objp->pos );
// if ( rand() > RAND_MAX/2 ) {
// gr_set_color( 255, 0, 0 );
// } else {
// gr_set_color( 255, 255, 255 );
// }
// g3_draw_sphere(&p, 100.0f );
if ( cmip->model_num > -1 ) {
model_clear_instance(cmip->model_num);
@@ -297,39 +302,8 @@ void cmeasure_render(object * objp)
} else {
mprintf(( "Not rendering countermeasure because model_num is negative\n" ));
}
}*/
/*
// JAS TODO: Replace with proper fireball
int framenum = -1;
float size = -1.0f;
vertex p;
cmeasure *cmp;
fireball_data *fd;
cmp = &Cmeasures[objp->instance];
fd = &Fireball_data[FIREBALL_SHIP_EXPLODE1];
switch (cmp->subtype) {
case CMEASURE_UNUSED:
Int3(); // Hey, what are we doing in here?
break;
default:
framenum = (int) (fd->num_frames * Cmeasures[objp->instance].lifeleft*4) % fd->num_frames;
size = objp->radius;
break;
}
Assert(framenum != -1);
Assert(size != -1.0f);
gr_set_bitmap(fd->bitmap_id + framenum);
g3_rotate_vertex(&p, &objp->pos );
g3_draw_bitmap(&p, 0, size*0.5f, TMAP_FLAG_TEXTURED );
*/
}
void cmeasure_delete( object * objp )
{
int num;
@@ -341,15 +315,15 @@ void cmeasure_delete( object * 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;
@@ -366,14 +340,13 @@ void cmeasure_process_post(object * objp, float frame_time)
}
}
}
float Skill_level_cmeasure_life_scale[NUM_SKILL_LEVELS] = {3.0f, 2.0f, 1.5f, 1.25f, 1.0f};
}*/
// creates one countermeasure. A ship fires 1 of these per launch. rand_val is used
// in multiplayer. If -1, then create a random number. If non-negative, use this
// number for static_rand functions
int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_val )
/*
int cmeasure_create( object * source_obj, vec3d * pos, int cm_type, int rand_val )
{
int n, objnum, parent_objnum, arand;
object * obj;
@@ -381,11 +354,6 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
cmeasure *cmp;
cmeasure_info *cmeasurep;
#ifndef NDEBUG
if (!Countermeasures_enabled || !Ai_firing_enabled)
return -1;
#endif
Cmeasures_homing_check = 2; // Tell homing code to scan everything for two frames. If only one frame, get sync problems due to objects being created at end of frame!
parent_objnum = OBJ_INDEX(source_obj);
@@ -424,7 +392,7 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
cmp->lifeleft = static_randf(arand) * (cmeasurep->life_max - cmeasurep->life_min) / cmeasurep->life_min;
if (source_obj->flags & OF_PLAYER_SHIP){
cmp->lifeleft *= Skill_level_cmeasure_life_scale[Game_skill_level];
cmp->lifeleft *= The_mission.ai_profile->cmeasure_life_scale[Game_skill_level];
}
cmp->lifeleft = cmeasurep->life_min + cmp->lifeleft * (cmeasurep->life_max - cmeasurep->life_min);
@@ -443,47 +411,105 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
Num_cmeasures++;
vector vel, rand_vec;
//Set countermeasure velocity
vec3d vel, rand_vec;
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.fvec, -25.0f);
//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;
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
obj->phys_info.max_vel.z = -25.0f;
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.fvec, obj->phys_info.max_vel.z );
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
// obj->phys_info.flags |= PF_USE_VEL;
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)
{
vec3d vel, rand_vec;
//Get cmeasure rear velocity in world
vm_vec_scale_add(&vel, &parent_objp->phys_info.vel, &parent_objp->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);
objp->phys_info.vel = vel;
//Zero out this stuff so it isn't moving
vm_vec_zero(&objp->phys_info.rotvel);
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;
objp->phys_info.max_vel.xyz.z = -25.0f;
vm_vec_copy_scale(&objp->phys_info.desired_vel, &objp->orient.vec.fvec, objp->phys_info.max_vel.xyz.z );
}
void cmeasure_select_next(object *objp)
void cmeasure_select_next(ship *shipp)
{
ship *shipp;
Assert(shipp != NULL);
int i, new_index;
Assert(objp->type == OBJ_SHIP);
for (i = 1; i < Num_weapon_types; i++)
{
new_index = (shipp->current_cmeasure + i) % Num_weapon_types;
shipp = &Ships[objp->instance];
shipp->current_cmeasure++;
if (shipp->current_cmeasure >= Num_cmeasure_types)
shipp->current_cmeasure = 0;
if(Weapon_info[new_index].wi_flags & WIF_CMEASURE)
{
shipp->current_cmeasure = new_index;
return;
}
}
//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
void cmeasure_maybe_alert_success(object *objp)
{
//Is this a countermeasure, and does it have a parent
if ( objp->type != OBJ_WEAPON || objp->parent < 0) {
return;
}
Assert(Weapon_info[Weapons[objp->instance].weapon_info_index].wi_flags & WIF_CMEASURE);
if ( objp->parent == OBJ_INDEX(Player_obj) ) {
hud_start_text_flash(XSTR("Evaded", 1430), 800);
snd_play(&Snds[SND_MISSILE_EVADED_POPUP]);
} else if ( Objects[objp->parent].flags & OF_PLAYER_SHIP ) {
send_countermeasure_success_packet( objp->parent );
}
}
@@ -9,13 +9,33 @@
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $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
*
@@ -112,30 +132,33 @@
#ifndef _CMEASURE_H
#define _CMEASURE_H
#include "parselo.h"
#include "object.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
#define MAX_CMEASURES 64
struct object;
//struct vec3d;
//#define MAX_CMEASURES 64
// Goes in cmeasure.subtype
#define CMEASURE_UNUSED -1
//#define CMEASURE_UNUSED -1
#define MAX_CMEASURE_TYPES 3
//#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_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)
//#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 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.
@@ -152,19 +175,24 @@ typedef struct cmeasure {
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 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, vector *pos, int cm_type, int rand_val = -1 );
//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
@@ -9,13 +9,101 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.20 $
* $Date: 2007-11-23 23:08:32 $
* $Author: wmcoolmon $
*
* C module for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.19 2007/06/04 00:04:21 Backslash
* Backslash's HEAD-only controls commit:
* -Lateral thruster axes
* -Slide_when_pressed
* -Placeholders for glide_when_pressed and more controls, to give us a little breathing room while we wait for the real pilot file code
*
* Revision 2.18 2005/10/10 17:14:30 taylor
* remove NO_NETWORK
* fix controlconfig so that axes can be set to joystick/mouse using the mouse (required when no joystick attached)
*
* Revision 2.17 2005/07/22 10:18:37 Goober5000
* CVS header tweaks
* --Goober5000
*
* Revision 2.16 2005/07/13 02:50:50 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.15 2005/07/07 16:36:57 taylor
* various compiler warning fixes (some of these from dizzy)
*
* Revision 2.14 2005/07/02 19:42:14 taylor
* ton of non-standard resolution fixes
*
* Revision 2.13 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.12 2005/04/28 05:29:28 wmcoolmon
* Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse
*
* Revision 2.11 2005/04/17 05:38:28 taylor
* updated Linux joystick code that's a bit less insane speed wise
* remove ability to build without joystick support, no reason to keep it around
* fix unusable warning flag with libjpeg building
*
* Revision 2.10 2005/03/02 21:24:43 taylor
* more network/inferno goodness for Windows, takes care of a few warnings too
*
* Revision 2.9 2004/07/29 19:37:50 Kazan
* unbug the JS bug i caused --- kazan
*
* Revision 2.8 2004/07/26 20:47:26 Kazan
* remove MCD complete
*
* Revision 2.7 2004/07/25 00:31:28 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 2.6 2004/07/12 16:32:43 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.5 2004/03/05 09:01:58 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* 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 2003/04/05 11:09:21 Goober5000
* fixed some fiddly bits with scrolling and ui stuff
* --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.4 2002/05/16 06:06:23 mharris
* ifndef NO_JOYSTICK
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* Revision 1.2 2002/05/10 06:08:08 mharris
* Porting... added ifndef NO_SOUND
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -96,7 +184,7 @@
*
* 51 5/19/98 12:56p Hoffoss
* Added some code to help prevent triple-clicking for binding the mouse
* button to an action (why the hell people triple click is beyond me,
* button to an action (why people triple click is beyond me,
* though).
*
* 50 5/19/98 11:11a Lawrance
@@ -291,31 +379,32 @@
*
*/
#include "freespace.h"
#include "controlsconfig.h"
#include "gamesequence.h"
#include "player.h"
#include "2d.h"
#include "hudsquadmsg.h"
#include "key.h"
#include "timer.h"
#include "math.h"
#include "mouse.h"
#include "ui.h"
#include "joy.h"
#include "bmpman.h"
#include "sound.h"
#include "gamesnd.h"
#include "missionscreencommon.h"
#include "font.h"
#include "hud.h"
#include "managepilot.h"
#include "multi_pmsg.h"
#include "contexthelp.h"
#include "popup.h"
#include "uidefs.h"
#include "multiutil.h"
#include "alphacolors.h"
#include "freespace2/freespace.h"
#include "controlconfig/controlsconfig.h"
#include "gamesequence/gamesequence.h"
#include "hud/hudsquadmsg.h"
#include "io/key.h"
#include "io/timer.h"
#include "ui/ui.h"
#include "io/joy.h"
#include "gamesnd/gamesnd.h"
#include "missionui/missionscreencommon.h"
#include "graphics/font.h"
#include "playerman/managepilot.h"
#include "gamehelp/contexthelp.h"
#include "popup/popup.h"
#include "ui/uidefs.h"
#include "globalincs/alphacolors.h"
#include "network/multi_pmsg.h"
#include "network/multiutil.h"
#ifndef NDEBUG
#include "hud/hud.h"
#endif
#define NUM_SYSTEM_KEYS 14
#define NUM_BUTTONS 19
@@ -400,7 +489,7 @@ int Conflict_warning_coords[GR_NUM_RESOLUTIONS][2] = {
int Conflict_stamp = -1;
int Conflict_bright = 0;
#define LIST_BUTTONS_MAX 40
#define LIST_BUTTONS_MAX 42
#define JOY_AXIS 0x80000
static int Num_cc_lines;
@@ -425,8 +514,8 @@ config_item Control_config_backup[CCFG_MAX];
int Axis_map_to[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, JOY_Z_AXIS, -1 };
int Axis_map_to_defaults[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, JOY_Z_AXIS, -1 };
#else
int Axis_map_to[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, -1, -1 };
int Axis_map_to_defaults[] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, -1, -1 };
int Axis_map_to[NUM_JOY_AXIS_ACTIONS] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
int Axis_map_to_defaults[NUM_JOY_AXIS_ACTIONS] = { JOY_X_AXIS, JOY_Y_AXIS, JOY_RX_AXIS, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
#endif
// all this stuff is localized/externalized
@@ -670,6 +759,7 @@ int control_config_detect_axis()
{
int i, d, axis = -1, delta = 16384;
int axes_values[JOY_NUM_AXES];
int dx, dy, dz, fudge = 7;
joystick_read_raw_axis(JOY_NUM_AXES, axes_values);
for (i=0; i<JOY_NUM_AXES; i++) {
@@ -680,11 +770,25 @@ int control_config_detect_axis()
}
}
if ( (axis == -1) && Use_mouse_to_fly ) {
mouse_get_delta( &dx, &dy, &dz );
if ( (dx > fudge) || (dx < -fudge) ) {
axis = 0;
} else if ( (dy > fudge) || (dy < -fudge) ) {
axis = 1;
} else if ( (dz > fudge) || (dz < -fudge) ) {
axis = 2;
}
}
return axis;
}
int control_config_valid_action(int n)
{
//WMC - Invalid_demo_keys is never even filled!!
/*
#ifdef FS2_DEMO
int i;
@@ -692,7 +796,7 @@ int control_config_valid_action(int n)
if (n == Invalid_demo_keys[i])
return 0;
#endif
*/
return 1;
}
@@ -798,7 +902,13 @@ void control_config_list_prepare()
if ((Control_config[z].tab == Tab) && control_config_valid_action(z)) {
k = Control_config[z].key_id;
j = Control_config[z].joy_id;
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
if (Control_config[z].hasXSTR)
Cc_lines[Num_cc_lines].label = XSTR(Control_config[z].text, CONTROL_CONFIG_XSTR + z);
else
Cc_lines[Num_cc_lines].label = Control_config[z].text;
Cc_lines[Num_cc_lines].cc_index = z;
Cc_lines[Num_cc_lines++].y = y;
y += font_height + 2;
@@ -838,16 +948,16 @@ config_item_undo *get_undo_block(int size)
{
config_item_undo *ptr;
ptr = (config_item_undo *) malloc( sizeof(config_item_undo) );
ptr = (config_item_undo *) vm_malloc( sizeof(config_item_undo) );
Assert(ptr);
ptr->next = Config_item_undo;
Config_item_undo = ptr;
ptr->size = size;
if (size) {
ptr->index = (int *) malloc( sizeof(int) * size );
ptr->index = (int *) vm_malloc( sizeof(int) * size );
Assert(ptr->index);
ptr->list = (config_item *) malloc( sizeof(config_item) * size );
ptr->list = (config_item *) vm_malloc( sizeof(config_item) * size );
Assert(ptr->list);
} else {
@@ -869,11 +979,11 @@ void free_undo_block()
Config_item_undo = ptr->next;
if (ptr->size) {
free(ptr->list);
free(ptr->index);
vm_free(ptr->list);
vm_free(ptr->index);
}
free(ptr);
vm_free(ptr);
}
// undo the most recent binding changes
@@ -932,8 +1042,9 @@ void control_config_save_axis_undo(int axis)
config_item_undo *ptr;
config_item item;
memset( &item, 0, sizeof(config_item) );
item.joy_id = (short) Axis_map_to[axis];
item.used = 0;
item.used = Invert_axis[axis];
ptr = get_undo_block(1);
@@ -1049,6 +1160,8 @@ int control_config_clear_other()
ptr = get_undo_block(total);
for (i=j=0; i<NUM_JOY_AXIS_ACTIONS; i++)
if ((Axis_map_to[i] == Axis_map_to[z]) && (i != z)) {
memset( &item, 0, sizeof(config_item) );
item.joy_id = (short) Axis_map_to[i];
item.used = Invert_axis[i];
@@ -1186,6 +1299,8 @@ int control_config_do_reset()
for (i=0; i<NUM_JOY_AXIS_ACTIONS; i++)
if ((Axis_map_to[i] != control_config_axis_default(i)) || (Invert_axis[i] != Invert_axis_defaults[i])) {
memset( &item, 0, sizeof(config_item) );
item.joy_id = (short) Axis_map_to[i];
item.used = Invert_axis[i];
@@ -1328,7 +1443,7 @@ void control_config_do_bind()
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
joy_down_count(i); // clear checking status of all joystick buttons
joy_down_count(i, 1); // clear checking status of all joystick buttons
}
control_config_detect_axis_reset();
@@ -1356,7 +1471,7 @@ void control_config_do_search()
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
joy_down_count(i); // clear checking status of all joystick buttons
joy_down_count(i, 1); // clear checking status of all joystick buttons
}
Binding_mode = 0;
@@ -1523,7 +1638,7 @@ void control_config_init()
Control_config_backup[i] = Control_config[i];
common_set_interface_palette(NOX("ControlConfigPalette")); // set the interface palette
Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
Ui_window.set_mask_bmap(Conflict_background_bitmap_mask_fname[gr_screen.res]);
Ui_window.tooltip_handler = control_config_tooltip_handler;
@@ -1588,26 +1703,28 @@ void control_config_init()
control_config_conflict_check();
// setup strings
Joy_axis_action_text[0] = strdup(XSTR("Turn (Yaw) Axis", 1016));
Joy_axis_action_text[1] = strdup(XSTR("Pitch Axis", 1017));
Joy_axis_action_text[2] = strdup(XSTR("Bank Axis", 1018));
Joy_axis_action_text[3] = strdup(XSTR("Absolute Throttle Axis", 1019));
Joy_axis_action_text[4] = strdup(XSTR("Relative Throttle Axis", 1020));
Joy_axis_text[0] = strdup(XSTR("Joystick/Mouse X Axis", 1021));
Joy_axis_text[1] = strdup(XSTR("Joystick/Mouse Y Axis", 1022));
Joy_axis_text[2] = strdup(XSTR("Joystick Z Axis", 1023));
Joy_axis_text[3] = strdup(XSTR("Joystick rX Axis", 1024));
Joy_axis_text[4] = strdup(XSTR("Joystick rY Axis", 1025));
Joy_axis_text[5] = strdup(XSTR("Joystick rZ Axis", 1026));
Mouse_button_text[0] = strdup("");
Mouse_button_text[1] = strdup(XSTR("Left Button", 1027));
Mouse_button_text[2] = strdup(XSTR("Right Button", 1028));
Mouse_button_text[3] = strdup(XSTR("Mid Button", 1029));
Mouse_button_text[4] = strdup("");
Mouse_axis_text[0] = strdup(XSTR("L/R", 1030));
Mouse_axis_text[1] = strdup(XSTR("U/B", 1031));
Invert_text[0] = strdup(XSTR("N", 1032));
Invert_text[1] = strdup(XSTR("Y", 1033));
Joy_axis_action_text[0] = vm_strdup(XSTR("Turn (Yaw) Axis", 1016));
Joy_axis_action_text[1] = vm_strdup(XSTR("Pitch Axis", 1017));
Joy_axis_action_text[2] = vm_strdup(XSTR("Bank Axis", 1018));
Joy_axis_action_text[3] = vm_strdup(XSTR("Absolute Throttle Axis", 1019));
Joy_axis_action_text[4] = vm_strdup(XSTR("Relative Throttle Axis", 1020));
Joy_axis_action_text[5] = vm_strdup("Horizontal Lateral (Slide) Axis");
Joy_axis_action_text[6] = vm_strdup("Vertical Lateral (Slide) Axis");
Joy_axis_text[0] = vm_strdup(XSTR("Joystick/Mouse X Axis", 1021));
Joy_axis_text[1] = vm_strdup(XSTR("Joystick/Mouse Y Axis", 1022));
Joy_axis_text[2] = vm_strdup(XSTR("Joystick Z Axis", 1023));
Joy_axis_text[3] = vm_strdup(XSTR("Joystick rX Axis", 1024));
Joy_axis_text[4] = vm_strdup(XSTR("Joystick rY Axis", 1025));
Joy_axis_text[5] = vm_strdup(XSTR("Joystick rZ Axis", 1026));
Mouse_button_text[0] = vm_strdup("");
Mouse_button_text[1] = vm_strdup(XSTR("Left Button", 1027));
Mouse_button_text[2] = vm_strdup(XSTR("Right Button", 1028));
Mouse_button_text[3] = vm_strdup(XSTR("Mid Button", 1029));
Mouse_button_text[4] = vm_strdup("");
Mouse_axis_text[0] = vm_strdup(XSTR("L/R", 1030));
Mouse_axis_text[1] = vm_strdup(XSTR("U/B", 1031));
Invert_text[0] = vm_strdup(XSTR("N", 1032));
Invert_text[1] = vm_strdup(XSTR("Y", 1033));
control_config_list_prepare();
}
@@ -1624,7 +1741,7 @@ void control_config_close()
help_overlay_unload(CONTROL_CONFIG_OVERLAY);
if (Background_bitmap){
bm_unload(Background_bitmap);
bm_release(Background_bitmap);
}
Ui_window.destroy();
@@ -1636,31 +1753,31 @@ void control_config_close()
// free strings
for(idx=0; idx<NUM_JOY_AXIS_ACTIONS; idx++){
if(Joy_axis_action_text[idx] != NULL){
free(Joy_axis_action_text[idx]);
vm_free(Joy_axis_action_text[idx]);
Joy_axis_action_text[idx] = NULL;
}
}
for(idx=0; idx<NUM_AXIS_TEXT; idx++){
if(Joy_axis_text[idx] != NULL){
free(Joy_axis_text[idx]);
vm_free(Joy_axis_text[idx]);
Joy_axis_text[idx] = NULL;
}
}
for(idx=0; idx<NUM_MOUSE_TEXT; idx++){
if(Mouse_button_text[idx] != NULL){
free(Mouse_button_text[idx]);
vm_free(Mouse_button_text[idx]);
Mouse_button_text[idx] = NULL;
}
}
for(idx=0; idx<NUM_MOUSE_AXIS_TEXT; idx++){
if(Mouse_axis_text[idx] != NULL){
free(Mouse_axis_text[idx]);
vm_free(Mouse_axis_text[idx]);
Mouse_axis_text[idx] = NULL;
}
}
for(idx=0; idx<NUM_INVERT_TEXT; idx++){
if(Invert_text[idx] != NULL){
free(Invert_text[idx]);
vm_free(Invert_text[idx]);
Invert_text[idx] = NULL;
}
}
@@ -1704,7 +1821,7 @@ void control_config_do_frame(float frametime)
bind = 1;
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i))
if (joy_down_count(i, 1))
bind = 1;
if (bind) {
@@ -1761,8 +1878,8 @@ void control_config_do_frame(float frametime)
break;
}
if (Cc_lines[Selected_line].cc_index == BANK_WHEN_PRESSED) // a special hack just for Mike K.
if ( (Last_key >= 0) && (k <= 0) && !keyd_pressed[Last_key] )
if (Cc_lines[Selected_line].cc_index == BANK_WHEN_PRESSED || Cc_lines[Selected_line].cc_index == SLIDE_WHEN_PRESSED || Cc_lines[Selected_line].cc_index == GLIDE_WHEN_PRESSED) // a special hack just for Mike K.
if ( (Last_key >= 0) && (k <= 0) && !keyd_pressed[Last_key] ) //Backslash - ok it's not just for Mike K. any more :-P but seriously, this is so we can bind such controls to Shift or Alt. Does this actually get used?
k = Last_key;
if ((k > 0) && !Config_allowed[k & KEY_MASK]) {
@@ -1785,7 +1902,7 @@ void control_config_do_frame(float frametime)
}
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i)) {
if (joy_down_count(i, 1)) {
z = Cc_lines[Selected_line].cc_index;
Assert(!(z & JOY_AXIS));
control_config_bind_joy(z, i);
@@ -1870,7 +1987,7 @@ void control_config_do_frame(float frametime)
}
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i)) {
if (joy_down_count(i, 1)) {
j = i;
for (i=0; i<CCFG_MAX; i++)
if (Control_config[i].joy_id == j) {
@@ -2155,7 +2272,11 @@ void control_config_do_frame(float frametime)
gr_get_string_size(&w, NULL, str);
gr_printf(x - w / 2, y - font_height, str);
strcpy(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
if (Control_config[i].hasXSTR)
strcpy(buf, XSTR(Control_config[i].text, CONTROL_CONFIG_XSTR + i));
else
strcpy(buf, Control_config[i].text);
gr_force_fit_string(buf, 255, Conflict_wnd_coords[gr_screen.res][CONTROL_W_COORD]);
gr_get_string_size(&w, NULL, buf);
gr_printf(x - w / 2, y, buf);
@@ -2384,7 +2505,7 @@ int check_control(int id, int key)
}
if (Control_config[id].type == CC_TYPE_CONTINUOUS) {
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id)) {
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id, 1)) {
control_used(id);
return 1;
}
@@ -2424,7 +2545,8 @@ int check_control(int id, int key)
return 0;
}
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id) || mouse_down_count(1 << Control_config[id].joy_id)) {
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
//mprintf(("Key used %d", key));
control_used(id);
return 1;
}
@@ -2433,43 +2555,28 @@ int check_control(int id, int key)
}
// get heading, pitch, bank, throttle abs. and throttle rel. values.
void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr)
void control_get_axes_readings(int *axis)
{
int axes_values[JOY_NUM_AXES];
joystick_read_raw_axis(JOY_NUM_AXES, axes_values);
// joy_get_scaled_reading will return a value represents the joystick pos from -1 to +1 (fixed point)
*h = 0;
if (Axis_map_to[0] >= 0)
*h = joy_get_scaled_reading(axes_values[Axis_map_to[0]], Axis_map_to[0]);
*p = 0;
if (Axis_map_to[1] >= 0)
*p = joy_get_scaled_reading(axes_values[Axis_map_to[1]], Axis_map_to[1]);
*b = 0;
if (Axis_map_to[2] >= 0)
*b = joy_get_scaled_reading(axes_values[Axis_map_to[2]], Axis_map_to[2]);
*ta = 0;
if (Axis_map_to[3] >= 0)
*ta = joy_get_unscaled_reading(axes_values[Axis_map_to[3]], Axis_map_to[3]);
*tr = 0;
if (Axis_map_to[4] >= 0)
*tr = joy_get_scaled_reading(axes_values[Axis_map_to[4]], Axis_map_to[4]);
if (Invert_axis[0])
*h = -(*h);
if (Invert_axis[1])
*p = -(*p);
if (Invert_axis[2])
*b = -(*b);
if (Invert_axis[3])
*ta = F1_0 - *ta;
if (Invert_axis[4])
*tr = -(*tr);
for (int i = 0; i < NUM_JOY_AXIS_ACTIONS; i++) {
if (Axis_map_to[i] >= 0) {
if (i == 3) {
//Backslash -- this is to handle the absolute throttle.
//I hate this hardcoding! but what can we do but follow precedent? Corrections welcome.
axis[i] = joy_get_unscaled_reading(axes_values[Axis_map_to[i]], Axis_map_to[i]);
if (Invert_axis[i])
axis[i] = F1_0 - axis[i];
} else {
axis[i] = joy_get_scaled_reading(axes_values[Axis_map_to[i]], Axis_map_to[i]);
if (Invert_axis[i])
axis[i] = -(axis[i]);
}
}
}
return;
}
@@ -9,13 +9,80 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.19 $
* $Date: 2007-12-22 09:36:17 $
* $Author: Backslash $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.18 2007/06/04 00:04:21 Backslash
* Backslash's HEAD-only controls commit:
* -Lateral thruster axes
* -Slide_when_pressed
* -Placeholders for glide_when_pressed and more controls, to give us a little breathing room while we wait for the real pilot file code
*
* Revision 2.17 2006/08/01 04:26:02 Kazan
* commented out glide_while_pressed changes until taylor deems them safe
*
* Revision 2.16 2006/07/31 23:57:48 Kazan
* glide while pressed
*
* 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
*
@@ -274,13 +341,15 @@
#define JOY_RY_AXIS 4
#define JOY_RZ_AXIS 5
#define NUM_JOY_AXIS_ACTIONS 5
#define NUM_JOY_AXIS_ACTIONS 12 //5
#define JOY_HEADING_AXIS 0
#define JOY_PITCH_AXIS 1
#define JOY_BANK_AXIS 2
#define JOY_ABS_THROTTLE_AXIS 3
#define JOY_REL_THROTTLE_AXIS 4
#define JOY_SIDEWAYS_AXIS 5
#define JOY_VERTICAL_AXIS 6
// --------------------------------------------------
// different types of controls that can be assigned
@@ -292,7 +361,8 @@
typedef struct config_item {
short key_default; // default key bound to action
short joy_default; // default joystick button bound to action
char tab; // what tab (catagory) it belongs in
char tab; // what tab (category) it belongs in
bool hasXSTR; // whether we should translate this with an XSTR
char *text; // describes the action in the config screen
char type; // manner control should be checked in
short key_id; // actual key bound to action
@@ -309,28 +379,28 @@ typedef struct config_item {
#define TARGET_NEXT 0
#define TARGET_PREV 1
#define TARGET_NEXT_CLOSEST_HOSTILE 2
#define TARGET_PREV_CLOSEST_HOSTILE 3
#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
#define TARGET_NEXT_CLOSEST_FRIENDLY 5
#define TARGET_PREV_CLOSEST_FRIENDLY 6
#define TARGET_SHIP_IN_RETICLE 7
#define TARGET_CLOSEST_SHIP_ATTACKING_TARGET 8
#define TARGET_LAST_TRANMISSION_SENDER 9
#define STOP_TARGETING_SHIP 10
// targeting a ship's subsystem
#define TARGET_SUBOBJECT_IN_RETICLE 11
#define TARGET_SUBOBJECT_IN_RETICLE 11
#define TARGET_NEXT_SUBOBJECT 12
#define TARGET_PREV_SUBOBJECT 13
#define STOP_TARGETING_SUBSYSTEM 14
// speed matching
#define MATCH_TARGET_SPEED 15
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
#define TOGGLE_AUTO_MATCH_TARGET_SPEED 16
// weapons
#define FIRE_PRIMARY 17
#define FIRE_PRIMARY 17
#define FIRE_SECONDARY 18
#define CYCLE_NEXT_PRIMARY 19
#define CYCLE_PREV_PRIMARY 20
@@ -341,19 +411,19 @@ typedef struct config_item {
// controls
#define FORWARD_THRUST 24
#define REVERSE_THRUST 25
#define BANK_LEFT 26
#define BANK_LEFT 26
#define BANK_RIGHT 27
#define PITCH_FORWARD 28
#define PITCH_BACK 29
#define YAW_LEFT 30
#define YAW_RIGHT 31
#define YAW_LEFT 30
#define YAW_RIGHT 31
// throttle control
#define ZERO_THROTTLE 32
#define MAX_THROTTLE 33
#define MAX_THROTTLE 33
#define ONE_THIRD_THROTTLE 34
#define TWO_THIRDS_THROTTLE 35
#define PLUS_5_PERCENT_THROTTLE 36
#define TWO_THIRDS_THROTTLE 35
#define PLUS_5_PERCENT_THROTTLE 36
#define MINUS_5_PERCENT_THROTTLE 37
// squadmate messaging keys
@@ -363,27 +433,27 @@ typedef struct config_item {
#define ATTACK_SUBSYSTEM_MESSAGE 41
#define CAPTURE_MESSAGE 42
#define ENGAGE_MESSAGE 43
#define FORM_MESSAGE 44
#define FORM_MESSAGE 44
#define IGNORE_MESSAGE 45
#define PROTECT_MESSAGE 46
#define COVER_MESSAGE 47
#define WARP_MESSAGE 48
#define WARP_MESSAGE 48
#define REARM_MESSAGE 49
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
#define TARGET_CLOSEST_SHIP_ATTACKING_SELF 50
// Views
#define VIEW_CHASE 51
#define VIEW_EXTERNAL 52
#define VIEW_EXTERNAL_TOGGLE_CAMERA_LOCK 53
#define VIEW_SLEW 54
#define VIEW_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_DOWN 60
#define PADLOCK_LEFT 61
#define PADLOCK_RIGHT 62
@@ -400,53 +470,76 @@ typedef struct config_item {
#define DECREASE_SHIELD 72
#define INCREASE_ENGINE 73
#define DECREASE_ENGINE 74
#define ETS_EQUALIZE 75
#define ETS_EQUALIZE 75
#define SHIELD_EQUALIZE 76
#define SHIELD_XFER_TOP 77
#define SHIELD_XFER_BOTTOM 78
#define SHIELD_XFER_LEFT 79
#define SHIELD_XFER_RIGHT 80
#define XFER_SHIELD 81
#define XFER_SHIELD 81
#define XFER_LASER 82
#define SHOW_DAMAGE_POPUP 83 // AL: this binding should be removing next time the controls are reorganized
//#define SHOW_DAMAGE_POPUP 83 // AL: this binding should be removing next time the controls are reorganized
#define SLIDE_WHEN_PRESSED 83
//Backslash -- this was a convenient place for Slide 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
#define ESCORT_CLEAR 87
#define TARGET_NEXT_ESCORT_SHIP 88
#define TARGET_CLOSEST_REPAIR_SHIP 89
#define TARGET_NEXT_UNINSPECTED_CARGO 90
#define TARGET_PREV_UNINSPECTED_CARGO 91
#define TARGET_CLOSEST_REPAIR_SHIP 89
#define TARGET_NEXT_UNINSPECTED_CARGO 90
#define TARGET_PREV_UNINSPECTED_CARGO 91
#define TARGET_NEWEST_SHIP 92
#define TARGET_NEXT_LIVE_TURRET 93
#define TARGET_PREV_LIVE_TURRET 94
#define TARGET_NEXT_LIVE_TURRET 93
#define TARGET_PREV_LIVE_TURRET 94
#define TARGET_NEXT_BOMB 95
#define TARGET_PREV_BOMB 96
// multiplayer messaging keys
#define MULTI_MESSAGE_ALL 97
#define MULTI_MESSAGE_FRIENDLY 98
#define MULTI_MESSAGE_FRIENDLY 98
#define MULTI_MESSAGE_HOSTILE 99
#define MULTI_MESSAGE_TARGET 100
// multiplayer misc keys
#define MULTI_OBSERVER_ZOOM_TO 101
#define MULTI_OBSERVER_ZOOM_TO 101
#define TIME_SPEED_UP 102
#define TIME_SLOW_DOWN 103
#define TOGGLE_HUD_CONTRAST 104
#define TOGGLE_HUD_CONTRAST 104
#define MULTI_TOGGLE_NETINFO 105
#define MULTI_SELF_DESTRUCT 106
#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
#define GLIDE_WHEN_PRESSED 118
#define VIEW_UP 119
#define VIEW_DOWN 120
#define VIEW_LEFT 121
#define VIEW_RIGHT 122
// this should be the total number of control action defines above (or last define + 1)
#define CCFG_MAX 107
#define CCFG_MAX 128 //118
extern int Failed_key_index;
extern int Invert_heading;
@@ -479,7 +572,7 @@ char *translate_key(char *key);
char *textify_scancode(int code);
float check_control_timef(int id);
int check_control(int id, int key = -1);
void control_get_axes_readings(int *h, int *p, int *b, int *ta, int *tr);
void control_get_axes_readings(int *axis);
void control_used(int id);
void control_config_clear();
void clear_key_binding(short key);
@@ -9,13 +9,83 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.20 $
* $Date: 2007-12-22 09:36:16 $
* $Author: Backslash $
*
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
*
* $Log: not supported by cvs2svn $
* Revision 2.19 2007/06/04 00:04:21 Backslash
* Backslash's HEAD-only controls commit:
* -Lateral thruster axes
* -Slide_when_pressed
* -Placeholders for glide_when_pressed and more controls, to give us a little breathing room while we wait for the real pilot file code
*
* Revision 2.18 2006/08/01 04:26:02 Kazan
* commented out glide_while_pressed changes until taylor deems them safe
*
* Revision 2.17 2006/08/01 01:56:44 Goober5000
* proper phrase case
*
* Revision 2.16 2006/07/31 23:57:48 Kazan
* glide while pressed
*
* Revision 2.15 2006/07/20 01:51:17 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
*
@@ -27,7 +97,7 @@
* minor key name change in german
*
* 12 10/29/99 6:10p Jefff
* squashed the damned y/z german issues once and for all
* 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
@@ -372,10 +442,11 @@
*
*/
#include "controlsconfig.h"
#include "key.h"
#include "joy.h"
#include "localize.h"
#include "controlconfig/controlsconfig.h"
#include "io/key.h"
#include "io/joy.h"
#include "localization/localize.h"
#define TARGET_TAB 0
#define SHIP_TAB 1
@@ -391,149 +462,179 @@ int Alt_is_modifier;
int Axis_enabled[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
int Axis_enabled_defaults[JOY_NUM_AXES] = { 1, 1, 1, 0, 0, 0 };
int Invert_axis[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
int Invert_axis_defaults[JOY_NUM_AXES] = { 0, 0, 0, 0, 0, 0 };
int Invert_axis[NUM_JOY_AXIS_ACTIONS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
int Invert_axis_defaults[NUM_JOY_AXIS_ACTIONS] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
// arrays which hold the key mappings. The array index represents a key-independent action.
//
//XSTR:OFF
config_item Control_config[CCFG_MAX + 1] = {
// targeting a ship
{ KEY_T, -1, TARGET_TAB, "Target Next Ship" },
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, "Target Previous Ship" },
{ KEY_H, 2, TARGET_TAB, "Target Next Closest Hostile Ship" },
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, "Target Previous Closest Hostile Ship" },
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, "Toggle Auto Targeting" },
{ KEY_F, -1, TARGET_TAB, "Target Next Closest Friendly Ship" },
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, "Target Previous Closest Friendly Ship" },
{ KEY_Y, 4, TARGET_TAB, "Target Ship in Reticle" },
{ KEY_G, -1, TARGET_TAB, "Target Target's Nearest Attacker" },
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, "Target Last Ship to Send Transmission" },
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, "Turn Off Auto-Targeting" },
{ KEY_T, -1, TARGET_TAB, true, "Target Next Ship" },
{ KEY_SHIFTED | KEY_T, -1, TARGET_TAB, true, "Target Previous Ship" },
{ KEY_H, 2, TARGET_TAB, true, "Target Next Closest Hostile Ship" },
{ KEY_SHIFTED | KEY_H, -1, TARGET_TAB, true, "Target Previous Closest Hostile Ship" },
{ KEY_ALTED | KEY_H, -1, TARGET_TAB, true, "Toggle Auto Targeting" },
{ KEY_F, -1, TARGET_TAB, true, "Target Next Closest Friendly Ship" },
{ KEY_SHIFTED | KEY_F, -1, TARGET_TAB, true, "Target Previous Closest Friendly Ship" },
{ KEY_Y, 4, TARGET_TAB, true, "Target Ship in Reticle" },
{ KEY_G, -1, TARGET_TAB, true, "Target Target's Nearest Attacker" },
{ KEY_ALTED | KEY_Y, -1, TARGET_TAB, true, "Target Last Ship to Send Transmission" },
{ KEY_ALTED | KEY_T, -1, TARGET_TAB, true, "Turn Off Targeting" },
// targeting a ship's subsystem
{ KEY_V, -1, TARGET_TAB, "Target Subsystem in Reticle" },
{ KEY_S, -1, TARGET_TAB, "Target Next Subsystem" },
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, "Target Previous Subsystem" },
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, "Turn Off Auto-Targeting of Subsystems" },
{ KEY_V, -1, TARGET_TAB, true, "Target Subsystem in Reticle" },
{ KEY_S, -1, TARGET_TAB, true, "Target Next Subsystem" },
{ KEY_SHIFTED | KEY_S, -1, TARGET_TAB, true, "Target Previous Subsystem" },
{ KEY_ALTED | KEY_S, -1, TARGET_TAB, true, "Turn Off Targeting of Subsystems" },
// matching speed
{ KEY_M, -1, COMPUTER_TAB, "Match Target Speed" },
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, "Toggle Auto Speed Matching" },
{ KEY_M, -1, COMPUTER_TAB, true, "Match Target Speed" },
{ KEY_ALTED | KEY_M, -1, COMPUTER_TAB, true, "Toggle Auto Speed Matching" },
// weapons
{ KEY_LCTRL, 0, WEAPON_TAB, "Fire Primary Weapon", CC_TYPE_CONTINUOUS },
{ KEY_SPACEBAR, 1, WEAPON_TAB, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS },
{ KEY_PERIOD, -1, WEAPON_TAB, "Cycle Forward Primary Weapon" },
{ KEY_COMMA, -1, WEAPON_TAB, "Cycle Backward Primary Weapon" },
{ KEY_DIVIDE, -1, WEAPON_TAB, "Cycle Secondary Weapon Bank" },
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, "Cycle Secondary Weapon Firing Rate" },
{ KEY_X, 3, WEAPON_TAB, "Launch Countermeasure" },
{ KEY_LCTRL, 0, WEAPON_TAB, true, "Fire Primary Weapon", CC_TYPE_CONTINUOUS },
{ KEY_SPACEBAR, 1, WEAPON_TAB, true, "Fire Secondary Weapon", CC_TYPE_CONTINUOUS },
{ KEY_PERIOD, -1, WEAPON_TAB, true, "Cycle Forward Primary Weapon" },
{ KEY_COMMA, -1, WEAPON_TAB, true, "Cycle Backward Primary Weapon" },
{ KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Bank" },
{ KEY_SHIFTED | KEY_DIVIDE, -1, WEAPON_TAB, true, "Cycle Secondary Weapon Firing Rate" },
{ KEY_X, 3, WEAPON_TAB, true, "Launch Countermeasure" },
// controls
{ KEY_A, -1, SHIP_TAB, "Forward Thrust", CC_TYPE_CONTINUOUS },
{ KEY_Z, -1, SHIP_TAB, "Reverse Thrust", CC_TYPE_CONTINUOUS },
{ KEY_PAD7, -1, SHIP_TAB, "Bank Left", CC_TYPE_CONTINUOUS },
{ KEY_PAD9, -1, SHIP_TAB, "Bank Right", CC_TYPE_CONTINUOUS },
{ KEY_PAD8, -1, SHIP_TAB, "Pitch Forward", CC_TYPE_CONTINUOUS },
{ KEY_PAD2, -1, SHIP_TAB, "Pitch Backward", CC_TYPE_CONTINUOUS },
{ KEY_PAD4, -1, SHIP_TAB, "Turn Left", CC_TYPE_CONTINUOUS },
{ KEY_PAD6, -1, SHIP_TAB, "Turn Right", CC_TYPE_CONTINUOUS },
{ KEY_A, -1, SHIP_TAB, true, "Forward Thrust", CC_TYPE_CONTINUOUS },
{ KEY_Z, -1, SHIP_TAB, true, "Reverse Thrust", CC_TYPE_CONTINUOUS },
{ KEY_PAD7, -1, SHIP_TAB, true, "Bank Left", CC_TYPE_CONTINUOUS },
{ KEY_PAD9, -1, SHIP_TAB, true, "Bank Right", CC_TYPE_CONTINUOUS },
{ KEY_PAD8, -1, SHIP_TAB, true, "Pitch Forward", CC_TYPE_CONTINUOUS },
{ KEY_PAD2, -1, SHIP_TAB, true, "Pitch Backward", CC_TYPE_CONTINUOUS },
{ KEY_PAD4, -1, SHIP_TAB, true, "Turn Left", CC_TYPE_CONTINUOUS },
{ KEY_PAD6, -1, SHIP_TAB, true, "Turn Right", CC_TYPE_CONTINUOUS },
// throttle controls
{ KEY_BACKSP, -1, SHIP_TAB, "Set Throttle to Zero" },
{ KEY_SLASH, -1, SHIP_TAB, "Set Throttle to Max" },
{ KEY_LBRACKET, -1, SHIP_TAB, "Set Throttle to One-Third" },
{ KEY_RBRACKET, -1, SHIP_TAB, "Set Throttle to Two-Thirds" },
{ KEY_EQUAL, -1, SHIP_TAB, "Increase Throttle 5 Percent" },
{ KEY_MINUS, -1, SHIP_TAB, "Decrease Throttle 5 Percent" },
{ KEY_BACKSP, -1, SHIP_TAB, true, "Set Throttle to Zero" },
{ KEY_SLASH, -1, SHIP_TAB, true, "Set Throttle to Max" },
{ KEY_LBRACKET, -1, SHIP_TAB, true, "Set Throttle to One-Third" },
{ KEY_RBRACKET, -1, SHIP_TAB, true, "Set Throttle to Two-Thirds" },
{ KEY_EQUAL, -1, SHIP_TAB, true, "Increase Throttle 5 Percent" },
{ KEY_MINUS, -1, SHIP_TAB, true, "Decrease Throttle 5 Percent" },
// squadmate messaging
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, "Attack My Target" },
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, "Disarm My Target" },
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, "Disable My Target" },
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, "Attack my Subsystem" },
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, "Capture My Target" },
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, "Engage Enemy" },
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, "Form on my Wing" },
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, "Ignore my Target" },
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, "Protect my Target" },
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, "Cover me" },
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, "Return to base" },
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, "Rearm me" },
{ KEY_SHIFTED | KEY_A, -1, COMPUTER_TAB, true, "Attack My Target" },
{ KEY_SHIFTED | KEY_Z, -1, COMPUTER_TAB, true, "Disarm My Target" },
{ KEY_SHIFTED | KEY_D, -1, COMPUTER_TAB, true, "Disable My Target" },
{ KEY_SHIFTED | KEY_V, -1, COMPUTER_TAB, true, "Attack My Subsystem" },
{ KEY_SHIFTED | KEY_X, -1, COMPUTER_TAB, true, "Capture My Target" },
{ KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Engage Enemy" },
{ KEY_SHIFTED | KEY_W, -1, COMPUTER_TAB, true, "Form on My Wing" },
{ KEY_SHIFTED | KEY_I, -1, COMPUTER_TAB, true, "Ignore My Target" },
{ KEY_SHIFTED | KEY_P, -1, COMPUTER_TAB, true, "Protect My Target" },
{ KEY_SHIFTED | KEY_C, -1, COMPUTER_TAB, true, "Cover Me" },
{ KEY_SHIFTED | KEY_J, -1, COMPUTER_TAB, true, "Return to Base" },
{ KEY_SHIFTED | KEY_R, -1, COMPUTER_TAB, true, "Rearm Me" },
{ KEY_R, 6, TARGET_TAB, "Target Closest Attacking Ship" },
{ KEY_R, 6, TARGET_TAB, true, "Target Closest Attacking Ship" },
// Views
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, "Chase View" },
{ KEY_PADPERIOD, -1, COMPUTER_TAB, "External View"},
{ KEY_PADENTER, -1, COMPUTER_TAB, "Toggle External Camera Lock"},
{ KEY_PAD0, -1, COMPUTER_TAB, "Free Look View", CC_TYPE_CONTINUOUS },
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, "Current Target View" },
{ KEY_PADPLUS, -1, COMPUTER_TAB, "Increase View Distance", CC_TYPE_CONTINUOUS },
{ KEY_PADMINUS, -1, COMPUTER_TAB, "Decrease View Distance", CC_TYPE_CONTINUOUS },
{ KEY_PAD5, -1, COMPUTER_TAB, "Center View", CC_TYPE_CONTINUOUS },
{ -1, 33, COMPUTER_TAB, "View Up", CC_TYPE_CONTINUOUS },
{ -1, 32, COMPUTER_TAB, "View Rear", CC_TYPE_CONTINUOUS },
{ -1, 34, COMPUTER_TAB, "View Left", CC_TYPE_CONTINUOUS },
{ -1, 35, COMPUTER_TAB, "View Right", CC_TYPE_CONTINUOUS },
{ KEY_PADMULTIPLY, -1, COMPUTER_TAB, true, "Chase View" },
{ KEY_PADPERIOD, -1, COMPUTER_TAB, true, "External View"},
{ KEY_PADENTER, -1, COMPUTER_TAB, true, "Toggle External Camera Lock"},
{ KEY_PAD0, -1, COMPUTER_TAB, true, "Free Look View" }, // (Swifty) No longer used
{ KEY_PADDIVIDE, -1, COMPUTER_TAB, true, "Current Target View" },
{ KEY_PADPLUS, -1, COMPUTER_TAB, true, "Increase View Distance", CC_TYPE_CONTINUOUS },
{ KEY_PADMINUS, -1, COMPUTER_TAB, true, "Decrease View Distance", CC_TYPE_CONTINUOUS },
{ KEY_PAD5, -1, COMPUTER_TAB, true, "Center View", CC_TYPE_CONTINUOUS },
{ -1, 33, COMPUTER_TAB, true, "View Up", CC_TYPE_CONTINUOUS },
{ -1, 32, COMPUTER_TAB, true, "View Rear", CC_TYPE_CONTINUOUS },
{ -1, 34, COMPUTER_TAB, true, "View Left", CC_TYPE_CONTINUOUS },
{ -1, 35, COMPUTER_TAB, true, "View Right", CC_TYPE_CONTINUOUS },
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, "Cycle Radar Range" },
{ KEY_C, -1, COMPUTER_TAB, "Communications Menu" },
{ -1, -1, -1, "Show Objectives" },
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, "Enter Subspace (End Mission)" },
{ KEY_J, -1, TARGET_TAB, "Target Target's Target" },
{ KEY_TAB, 5, SHIP_TAB, "Afterburner", CC_TYPE_CONTINUOUS },
{ KEY_RAPOSTRO, -1, COMPUTER_TAB, true, "Cycle Radar Range" },
{ KEY_C, -1, COMPUTER_TAB, true, "Communications Menu" },
{ -1, -1, -1, true, "Show Objectives" },
{ KEY_ALTED | KEY_J, -1, COMPUTER_TAB, true, "Enter Subspace (End Mission)" },
{ KEY_J, -1, TARGET_TAB, true, "Target Target's Target" },
{ KEY_TAB, 5, SHIP_TAB, true, "Afterburner", CC_TYPE_CONTINUOUS },
{ KEY_INSERT, -1, COMPUTER_TAB, "Increase Weapon Energy" },
{ KEY_DELETE, -1, COMPUTER_TAB, "Decrease Weapon Energy" },
{ KEY_HOME, -1, COMPUTER_TAB, "Increase Shield Energy" },
{ KEY_END, -1, COMPUTER_TAB, "Decrease Shield Energy" },
{ KEY_PAGEUP, -1, COMPUTER_TAB, "Increase Engine Energy" },
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, "Decrease Engine Energy" },
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, "Equalize Energy Settings" },
{ KEY_INSERT, -1, COMPUTER_TAB, true, "Increase Weapon Energy" },
{ KEY_DELETE, -1, COMPUTER_TAB, true, "Decrease Weapon Energy" },
{ KEY_HOME, -1, COMPUTER_TAB, true, "Increase Shield Energy" },
{ KEY_END, -1, COMPUTER_TAB, true, "Decrease Shield Energy" },
{ KEY_PAGEUP, -1, COMPUTER_TAB, true, "Increase Engine Energy" },
{ KEY_PAGEDOWN, -1, COMPUTER_TAB, true, "Decrease Engine Energy" },
{ KEY_ALTED | KEY_D, -1, COMPUTER_TAB, true, "Equalize Energy Settings" },
{ KEY_Q, 7, COMPUTER_TAB, "Equalize Shield" },
{ KEY_UP, -1, COMPUTER_TAB, "Augment Forward Shield" },
{ KEY_DOWN, -1, COMPUTER_TAB, "Augment Rear Shield" },
{ KEY_LEFT, -1, COMPUTER_TAB, "Augment Left Shield" },
{ KEY_RIGHT, -1, COMPUTER_TAB, "Augment Right Shield" },
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, "Transfer Energy Laser->Shield" },
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, "Transfer Energy Shield->Laser" },
{ -1, -1, -1, "Show Damage Popup Window" },
{ KEY_Q, 7, COMPUTER_TAB, true, "Equalize Shields" },
{ KEY_UP, -1, COMPUTER_TAB, true, "Augment Forward Shield" },
{ KEY_DOWN, -1, COMPUTER_TAB, true, "Augment Rear Shield" },
{ KEY_LEFT, -1, COMPUTER_TAB, true, "Augment Left Shield" },
{ KEY_RIGHT, -1, COMPUTER_TAB, true, "Augment Right Shield" },
{ KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Laser->Shield" },
{ KEY_SHIFTED | KEY_SCROLLOCK, -1, COMPUTER_TAB, true, "Transfer Energy Shield->Laser" },
// { -1, -1, -1, true, "Show Damage Popup Window" },
{ -1, -1, SHIP_TAB, "Bank When Pressed", CC_TYPE_CONTINUOUS },
{ -1, -1, -1, "Show NavMap" },
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, "Add or Remove Escort" },
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, "Clear Escort List" },
{ KEY_E, -1, TARGET_TAB, "Target Next Escort Ship" },
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, "Target Closest Repair Ship" },
{ -1, -1, SHIP_TAB, false, "Slide When Pressed", CC_TYPE_CONTINUOUS },
//Backslash -- this was a convenient place for Slide When Pressed, as Show Damage Popup isn't used
{ -1, -1, SHIP_TAB, true, "Bank When Pressed", CC_TYPE_CONTINUOUS },
{ -1, -1, -1, true, "Show Nav Map" },
{ KEY_ALTED | KEY_E, -1, COMPUTER_TAB, true, "Add or Remove Escort" },
{ KEY_ALTED | KEY_SHIFTED | KEY_E, -1, COMPUTER_TAB, true, "Clear Escort List" },
{ KEY_E, -1, TARGET_TAB, true, "Target Next Escort Ship" },
{ KEY_ALTED | KEY_R, -1, TARGET_TAB, true, "Target Closest Repair Ship" },
{ KEY_U, -1, TARGET_TAB, "Target Next Uninspected Cargo" },
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, "Target Previous Uninspected Cargo" },
{ KEY_N, -1, TARGET_TAB, "Target Newest Ship In Area" },
{ KEY_K, -1, TARGET_TAB, "Target Next Live Turret" },
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, "Target Previous Live Turret" },
{ KEY_U, -1, TARGET_TAB, true, "Target Next Uninspected Cargo" },
{ KEY_SHIFTED | KEY_U, -1, TARGET_TAB, true, "Target Previous Uninspected Cargo" },
{ KEY_N, -1, TARGET_TAB, true, "Target Newest Ship in Area" },
{ KEY_K, -1, TARGET_TAB, true, "Target Next Live Turret" },
{ KEY_SHIFTED | KEY_K, -1, TARGET_TAB, true, "Target Previous Live Turret" },
{ KEY_B, -1, TARGET_TAB, "Target Next Hostile Bomb or Bomber" },
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, "Target Previous Hostile Bomb or Bomber" },
{ KEY_B, -1, TARGET_TAB, true, "Target Next Hostile Bomb or Bomber" },
{ KEY_SHIFTED | KEY_B, -1, TARGET_TAB, true, "Target Previous Hostile Bomb or Bomber" },
// multiplayer messaging keys
{ KEY_1, -1, COMPUTER_TAB, "(Multiplayer) Message All", CC_TYPE_CONTINUOUS },
{ KEY_2, -1, COMPUTER_TAB, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS },
{ KEY_3, -1, COMPUTER_TAB, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS },
{ KEY_4, -1, COMPUTER_TAB, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS },
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, "(Multiplayer) Observer zoom to target"},
{ KEY_1, -1, COMPUTER_TAB, true, "(Multiplayer) Message All", CC_TYPE_CONTINUOUS },
{ KEY_2, -1, COMPUTER_TAB, true, "(Multiplayer) Message Friendly", CC_TYPE_CONTINUOUS },
{ KEY_3, -1, COMPUTER_TAB, true, "(Multiplayer) Message Hostile", CC_TYPE_CONTINUOUS },
{ KEY_4, -1, COMPUTER_TAB, true, "(Multiplayer) Message Target", CC_TYPE_CONTINUOUS },
{ KEY_ALTED | KEY_X, -1, COMPUTER_TAB, true, "(Multiplayer) Observer Zoom to Target"},
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, "Increase time compression" },
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, "Decrease time compression" },
{ KEY_SHIFTED | KEY_PERIOD, -1, COMPUTER_TAB, true, "Increase Time Compression" },
{ KEY_SHIFTED | KEY_COMMA, -1, COMPUTER_TAB, true, "Decrease Time Compression" },
{ KEY_L, -1, COMPUTER_TAB, "Toggle high HUD contrast" },
{ KEY_L, -1, COMPUTER_TAB, true, "Toggle High HUD Contrast" },
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, "(Multiplayer) Toggle network info"},
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, "(Multiplayer) Self destruct"},
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, true, "(Multiplayer) Toggle Network Info"},
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, true, "(Multiplayer) Self Destruct"},
{ -1, -1, -1, "" }
// Misc
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, true, "Toggle HUD"},
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, true, "Right Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, true, "Left Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, true, "Up Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, true, "Down Thrust", CC_TYPE_CONTINUOUS},
{ KEY_ALTED | KEY_SHIFTED | KEY_Q, -1, COMPUTER_TAB, true, "Toggle HUD Wireframe Target View"},
{ -1, -1, COMPUTER_TAB, false, "Top-Down View"},
{ -1, -1, COMPUTER_TAB, false, "Target Padlock View"}, // (Swifty) Toggle for VM_TRACK
// Auto Navigation Systen
{ KEY_ALTED | KEY_A, -1, COMPUTER_TAB, false, "Toggle Auto Pilot"},
{ KEY_ALTED | KEY_N, -1, COMPUTER_TAB, false, "Cycle Nav Points"},
{ KEY_ALTED | KEY_G, -1, SHIP_TAB, false, "Toggle Gliding"},
{ -1, -1, SHIP_TAB, false, "Glide When Pressed", CC_TYPE_CONTINUOUS},
// (Swifty) The four new free looking commands.
{ -1, -1, COMPUTER_TAB, false, "Free Look Up", CC_TYPE_CONTINUOUS},
{ -1, -1, COMPUTER_TAB, false, "Free Look Down", CC_TYPE_CONTINUOUS},
{ -1, -1, COMPUTER_TAB, false, "Free Look Left", CC_TYPE_CONTINUOUS},
{ -1, -1, COMPUTER_TAB, false, "Free Look Right", CC_TYPE_CONTINUOUS},
{ -1, -1, -1, false, "MultiTarget Wing" },
{ -1, -1, -1, false, "Placeholder" },
{ -1, -1, -1, false, "Placeholder" },
{ -1, -1, -1, false, "Placeholder" },
{ -1, -1, -1, false, "Placeholder" },
{ -1, -1, -1, false, "" }
};
char *Scan_code_text_german[] = {
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $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
*
@@ -28,7 +34,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "crypt.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)
{
@@ -9,13 +9,122 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.23 $
* $Date: 2007-09-02 02:10:24 $
* $Author: Goober5000 $
* $Revision: 2.23 $
* $Date: 2007-09-02 02:10:24 $
* $Author: Goober5000 $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.22 2007/03/22 20:53:43 taylor
* give a better msg when movies can't play because they are user-disabled with the cmdline option
*
* Revision 2.21 2007/02/09 23:58:52 taylor
* add the "show all" hotkey to the cutscene viewer
*
* Revision 2.20 2006/12/28 00:59:19 wmcoolmon
* WMC codebase commit. See pre-commit build thread for details on changes.
*
* Revision 2.19 2006/09/11 06:49:38 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
*
@@ -135,19 +244,22 @@
* $NoKeywords: $
*/
#include "cutscenes.h"
#include "ui.h"
#include "cfile.h"
#include "gamesnd.h"
#include "gamesequence.h"
#include "freespace.h"
#include "key.h"
#include "bmpman.h"
// #include "movie.h"
#include "popup.h"
#include "mainhallmenu.h"
#include "alphacolors.h"
#include "localize.h"
#include "cutscene/cutscenes.h"
#include "ui/ui.h"
#include "gamesnd/gamesnd.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "io/key.h"
#include "movie.h"
#include "popup/popup.h"
#include "menuui/mainhallmenu.h"
#include "globalincs/alphacolors.h"
#include "localization/localize.h"
#include "parse/parselo.h"
extern int Cmdline_nomovies;
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
"ViewFootage",
@@ -158,44 +270,55 @@ char *Cutscene_mask_name[GR_NUM_RESOLUTIONS] = {
"2_ViewFootage-m"
};
int Num_cutscenes;
int Num_cutscenes = 0;
int Cutscenes_viewable;
int Description_index;
cutscene_info Cutscenes[MAX_CUTSCENES];
extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
//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 != NULL) {
vm_free(Cutscenes[i].description);
}
}
}
// initialization stuff for cutscenes
void cutscene_init()
{
atexit(cutscene_close);
char buf[MULTITEXT_LENGTH];
int rval;
if ((rval = setjmp(parse_abort)) != 0) {
Error(LOCATION, "Error parsing 'rank.tbl'\r\nError code = %i.\r\n", rval);
}
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0) {
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", "cutscenes.tbl", rval));
lcl_ext_close();
return;
}
read_file_text("cutscenes.tbl");
reset_parse();
// parse in all the rank names
// parse in all the cutscenes
Num_cutscenes = 0;
skip_to_string("#Cutscenes");
ignore_white_space();
while ( required_string_either("#End", "$Filename:") ) {
Assert ( Num_cutscenes < MAX_CUTSCENES );
required_string("$Filename:");
stuff_string( Cutscenes[Num_cutscenes].filename, F_PATHNAME, NULL );
stuff_string( Cutscenes[Num_cutscenes].filename, F_PATHNAME, MAX_FILENAME_LEN );
required_string("$Name:");
stuff_string( Cutscenes[Num_cutscenes].name, F_NAME, NULL );
stuff_string( Cutscenes[Num_cutscenes].name, F_NAME, NAME_LENGTH );
required_string("$Description:");
stuff_string(buf, F_MULTITEXT, NULL);
stuff_string(buf, F_MULTITEXT, sizeof(buf));
drop_white_space(buf);
compact_multitext_string(buf);
Cutscenes[Num_cutscenes].description = strdup(buf);
Cutscenes[Num_cutscenes].description = vm_strdup(buf);
required_string("$cd:");
stuff_int( &Cutscenes[Num_cutscenes].cd );
@@ -233,9 +356,28 @@ int cutscenes_get_cd_num( char *filename )
void cutscene_mark_viewable(char *filename)
{
int i;
char cut_file[MAX_FILENAME_LEN];
char file[MAX_FILENAME_LEN];
Assert(filename);
// strip off extension
strcpy( file, filename );
char *p = strchr( file, '.' );
if ( p ) {
*p = 0;
}
// change to lower case
strlwr(file);
for (i = 0; i < Num_cutscenes; i++ ) {
if ( !stricmp(Cutscenes[i].filename, filename) ) {
// change the cutscene file name to lower case
strcpy(cut_file, Cutscenes[i].filename);
strlwr(cut_file);
// see if the stripped filename matches the cutscene filename
if ( strstr(cut_file, file) != NULL ) {
Cutscenes_viewable |= (1<<i);
return;
}
@@ -256,17 +398,17 @@ void cutscene_mark_viewable(char *filename)
static int Num_files;
static int Cutscene_list[MAX_CUTSCENES];
static int Stats_scroll_offset;
//static int Stats_scroll_offset; // not used - taylor
static int Selected_line = 0; // line that is currently selected for binding
static int Scroll_offset;
static int Background_bitmap;
static UI_BUTTON List_region;
static UI_WINDOW Ui_window;
ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
{ // GR_640
ui_button_info("TDB_00", 7, 5, 37, 7, 0), // tech database 1
ui_button_info("TDB_01", 7, 19, 37, 23, 1), // tech database 2
ui_button_info("TDB_00", 7, 3, 37, 7, 0), // tech database 1
ui_button_info("TDB_01", 7, 18, 37, 23, 1), // tech database 2
ui_button_info("TDB_02", 7, 34, 37, 38, 2), // tech database 3
ui_button_info("TDB_03", 7, 49, 37, 54, 3), // tech database 4
@@ -276,7 +418,7 @@ ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
ui_button_info("VFB_07", 574, 431, 587, 413, 7), // exit
},
{ // GR_1024
ui_button_info("2_TDB_00", 12, 7, 59, 12, 0), // tech database 1
ui_button_info("2_TDB_00", 12, 5, 59, 12, 0), // tech database 1
ui_button_info("2_TDB_01", 12, 31, 59, 37, 1), // tech database 2
ui_button_info("2_TDB_02", 12, 56, 59, 62, 2), // tech database 3
ui_button_info("2_TDB_03", 12, 81, 59, 88, 3), // tech database 4
@@ -402,7 +544,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
if ( num_attempts++ > 5 ) {
cd_present = 0;
break;
}
}
#else
cd_present = 0;
break;
@@ -410,30 +552,35 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
}
return cd_present;
return cd_present;
}
void cutscenes_screen_play()
{
char name[MAX_FILENAME_LEN], *full_name;
char name[MAX_FILENAME_LEN]; // *full_name
int which_cutscene;
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
which_cutscene = Cutscene_list[Selected_line];
strcpy(name, Cutscenes[which_cutscene].filename );
full_name = cf_add_ext(name, NOX(".mve"));
// full_name = cf_add_ext(name, NOX(".mve"));
main_hall_stop_music();
int rval = movie_play(name);
main_hall_start_music();
// no soup for you!
/*
int rval = movie_play(full_name);
if ( !rval ) {
char str[256];
sprintf(str, XSTR( "Unable to play movie %s.", 204), Cutscenes[which_cutscene].name );
if (Cmdline_nomovies)
sprintf(str, XSTR("Movies are currently disabled.", -1));
else
sprintf(str, XSTR("Unable to play movie %s.", 204), Cutscenes[which_cutscene].name);
popup(0, 1, POPUP_OK, str );
}
*/
}
void cutscenes_screen_scroll_line_up()
@@ -547,7 +694,7 @@ void cutscenes_screen_init()
int i;
ui_button_info *b;
Ui_window.create(0, 0, gr_screen.max_w, gr_screen.max_h, 0);
Ui_window.create(0, 0, gr_screen.max_w_unscaled, gr_screen.max_h_unscaled, 0);
Ui_window.set_mask_bmap(Cutscene_mask_name[gr_screen.res]);
for (i=0; i<NUM_BUTTONS; i++) {
@@ -585,8 +732,8 @@ void cutscenes_screen_init()
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
#endif
if (All_movies_enabled)
Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
// if (All_movies_enabled)
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
Num_files = 0;
for ( i = 0; i < Num_cutscenes; i++ ) {
@@ -600,7 +747,7 @@ void cutscenes_screen_init()
void cutscenes_screen_close()
{
if (Background_bitmap)
bm_unload(Background_bitmap);
bm_release(Background_bitmap);
Ui_window.destroy();
}
@@ -646,6 +793,18 @@ void cutscenes_screen_do_frame()
case KEY_F2: // goto options screen
gameseq_post_event(GS_EVENT_OPTIONS_MENU);
break;
// 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++;
}
break;
}
} // end switch
for (i=0; i<NUM_BUTTONS; i++){
@@ -9,13 +9,30 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.5 $
* $Date: 2006-12-28 00:59:19 $
* $Author: wmcoolmon $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/07/13 02:50:50 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
*
@@ -50,7 +67,8 @@
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#include "parselo.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#define MAX_CUTSCENES 10
@@ -63,6 +81,7 @@ typedef struct cutscene_info
char name[NAME_LENGTH];
char *description;
int cd;
cutscene_info(){memset(this, 0, sizeof(cutscene_info));}
} cutscene_info;
extern cutscene_info Cutscenes[MAX_CUTSCENES];
+669
View File
@@ -0,0 +1,669 @@
/*
* $Logfile: /Freespace2/src/cutscene/decoder16.cpp $
* $Revision: 2.2 $
* $Date: 2006-08-20 00:44:36 $
* $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"
extern int g_width, g_height;
extern void *g_vBackBuf1, *g_vBackBuf2;
/* 16 bit decoding routines */
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 genLoopkupTable();
void decodeFrame16(unsigned char *pFrame, unsigned char *pMap, int mapRemain, unsigned char *pData, int dataRemain)
{
unsigned char *pOrig;
unsigned char *pOffData, *pEnd;
ushort offset;
int length;
int op;
int i, j;
int xb, yb;
if (!lookup_initialized) {
genLoopkupTable();
}
backBuf1 = (ushort *)g_vBackBuf1;
backBuf2 = (ushort *)g_vBackBuf2;
xb = g_width >> 3;
yb = g_height >> 3;
offset = pData[0]|(pData[1]<<8);
pOffData = pData + offset;
pEnd = pData + offset;
pData += 2;
pOrig = pData;
length = offset - 2; /*dataRemain-2;*/
for (j=0; j<yb; j++) {
for (i=0; i<xb/2; i++) {
op = (*pMap) & 0xf;
dispatchDecoder16((ushort **)&pFrame, op, &pData, &pOffData, &dataRemain, &i, &j);
op = ((*pMap) >> 4) & 0xf;
dispatchDecoder16((ushort **)&pFrame, op, &pData, &pOffData, &dataRemain, &i, &j);
pMap++;
mapRemain--;
}
pFrame += 7*g_width*2;
}
if ((length-(pData-pOrig)) != 0) {
nprintf(("MVE", "DEBUG: junk left over: %d,%d,%d\n", (pData-pOrig), length, (length-(pData-pOrig))));
}
}
static ushort GETPIXEL(unsigned char **buf, int off)
{
ushort val = (*buf)[0+off] | ((*buf)[1+off] << 8);
return val;
}
static ushort GETPIXELI(unsigned char **buf, int off)
{
ushort val = (*buf)[0+off] | ((*buf)[1+off] << 8);
(*buf) += 2;
return val;
}
static void relClose(int i, int *x, int *y)
{
int ma, mi;
ma = i >> 4;
mi = i & 0xf;
*x = mi - 8;
*y = ma - 8;
}
static void relFar(int i, int sign, int *x, int *y)
{
if (i < 56) {
*x = sign * (8 + (i % 7));
*y = sign * (i / 7);
} else {
*x = sign * (-14 + (i - 56) % 29);
*y = sign * (8 + (i - 56) / 29);
}
}
static int close_table[512];
static int far_p_table[512];
static int far_n_table[512];
static void genLoopkupTable()
{
int i;
int x, y;
for (i = 0; i < 256; i++) {
relClose(i, &x, &y);
close_table[i*2+0] = x;
close_table[i*2+1] = y;
relFar(i, 1, &x, &y);
far_p_table[i*2+0] = x;
far_p_table[i*2+1] = y;
relFar(i, -1, &x, &y);
far_n_table[i*2+0] = x;
far_n_table[i*2+1] = y;
}
lookup_initialized = 1;
}
static void copyFrame(ushort *pDest, ushort *pSrc)
{
int i;
for (i=0; i<8; i++) {
memcpy(pDest, pSrc, 16);
pDest += g_width;
pSrc += g_width;
}
}
static void patternRow4Pixels(ushort *pFrame, unsigned char pat0, unsigned char pat1, ushort *p)
{
ushort mask=0x0003;
ushort shift=0;
ushort pattern = (pat1 << 8) | pat0;
while (mask != 0) {
*pFrame++ = p[(mask & pattern) >> shift];
mask <<= 2;
shift += 2;
}
}
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;
pFrame[1] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
static void patternRow4Pixels2x1(ushort *pFrame, unsigned char pat, ushort *p)
{
unsigned char mask=0x03;
unsigned char shift=0;
ushort pel;
while (mask != 0) {
pel = p[(mask & pat) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
static void patternQuadrant4Pixels(ushort *pFrame, unsigned char pat0, unsigned char pat1, unsigned char pat2, unsigned char pat3, ushort *p)
{
unsigned long mask = 0x00000003UL;
int shift=0;
int i;
unsigned long pat = (pat3 << 24) | (pat2 << 16) | (pat1 << 8) | pat0;
for (i=0; i<16; i++) {
pFrame[i&3] = p[(pat & mask) >> shift];
if ((i&3) == 3)
pFrame += g_width;
mask <<= 2;
shift += 2;
}
}
static void patternRow2Pixels(ushort *pFrame, unsigned char pat, ushort *p)
{
unsigned char mask=0x01;
while (mask != 0) {
*pFrame++ = p[(mask & pat) ? 1 : 0];
mask <<= 1;
}
}
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];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 1] = pel;
pFrame += 2;
mask <<= 1;
}
}
static void patternQuadrant2Pixels(ushort *pFrame, unsigned char pat0, unsigned char pat1, ushort *p)
{
ushort mask = 0x0001;
int i;
ushort pat = (pat1 << 8) | pat0;
for (i=0; i<16; i++) {
pFrame[i&3] = p[(pat & mask) ? 1 : 0];
if ((i&3) == 3)
pFrame += g_width;
mask <<= 1;
}
}
static void dispatchDecoder16(ushort **pFrame, unsigned char codeType, unsigned char **pData, unsigned char **pOffData, int *pDataRemain, int *curXb, int *curYb)
{
ushort p[4];
unsigned char pat[16];
int i, j, k;
int x, y;
ushort *pDstBak;
pDstBak = *pFrame;
switch(codeType) {
case 0x0:
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1));
break; // ADDED
case 0x1:
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;
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;
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;
case 0x5:
x = (char)*(*pData)++;
y = (char)*(*pData)++;
copyFrame(*pFrame, *pFrame + (backBuf2 - backBuf1) + x + y*g_width);
*pDataRemain -= 2;
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))
return;
}
}
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 {
for (i=0; i<2; i++) {
patternRow2Pixels2(*pFrame, *(*pData) & 0xf, p);
*pFrame += 2*g_width;
patternRow2Pixels2(*pFrame, *(*pData) >> 4, p);
(*pData)++;
*pFrame += 2*g_width;
}
}
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 {
*pFrame += 4*g_width;
}
}
} else {
p[2] = GETPIXEL(pData, 8);
if (!(p[2]&0x8000)) {
for (i=0; i<4; i++) {
if ((i & 1) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1) {
*pFrame -= (4*g_width - 4);
} else {
*pFrame += 4*g_width;
}
}
} else {
for (i=0; i<8; i++) {
if ((i & 3) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
}
patternRow2Pixels(*pFrame, *(*pData), p);
(*pData)++;
*pFrame += g_width;
}
}
}
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++) {
pat[0] = (*pData)[0];
pat[1] = (*pData)[1];
(*pData) += 2;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pDataRemain -= 16;
} else {
patternRow4Pixels2(*pFrame, (*pData)[0], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[1], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[2], p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, (*pData)[3], p);
(*pData) += 4;
*pDataRemain -= 4;
}
} else {
if (!(p[2] & 0x8000)) {
for (i=0; i<8; i++) {
pat[0] = (*pData)[0];
(*pData) += 1;
patternRow4Pixels2x1(*pFrame, pat[0], p);
*pFrame += g_width;
}
*pDataRemain -= 8;
} else {
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);
*pFrame += g_width;
}
*pDataRemain -= 8;
}
}
break;
case 0xa:
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);
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 {
*pFrame += 4*g_width;
}
}
} else {
p[0] = GETPIXEL(pData, 16);
if (!(p[0] & 0x8000)) {
for (i=0; i<4; i++) {
if ((i&1) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
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 {
*pFrame += 4*g_width;
}
}
} else {
for (i=0; i<8; i++) {
if ((i&3) == 0) {
p[0] = GETPIXELI(pData, 0);
p[1] = GETPIXELI(pData, 0);
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;
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);
*swap_tmp = INTEL_SHORT(*swap_tmp);
}
memcpy(*pFrame, &frame_tmp, 16);
#else
memcpy(*pFrame, *pData, 16);
#endif
*pFrame += g_width;
*pData += 16;
*pDataRemain -= 16;
}
break;
case 0xc:
for (i=0; i<4; i++) {
p[0] = GETPIXEL(pData, 0);
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;
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;
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;
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;
default:
break;
}
*pFrame = pDstBak+8;
}
+545
View File
@@ -0,0 +1,545 @@
/*
* $Logfile: /Freespace2/src/cutscene/decoder8.cpp $
* $Revision: 2.1 $
* $Date: 2006-08-20 00:44:36 $
* $Author: taylor $
*
* decoder for 8-bit MVE image data
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*
*/
#include "globalincs/pstypes.h"
extern int g_width, g_height;
extern void *g_vBackBuf1, *g_vBackBuf2;
static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int *pDataRemain, int *curXb, int *curYb);
void decodeFrame8(ubyte *pFrame, ubyte *pMap, int mapRemain, ubyte *pData, int dataRemain)
{
int i, j;
int xb, yb;
xb = g_width >> 3;
yb = g_height >> 3;
for (j = 0; j < yb; j++) {
for (i = 0; i < (xb / 2); i++) {
dispatchDecoder8(&pFrame, (*pMap) & 0xf, &pData, &dataRemain, &i, &j);
dispatchDecoder8(&pFrame, (*pMap) >> 4, &pData, &dataRemain, &i, &j);
pMap++;
mapRemain--;
}
pFrame += 7*g_width;
}
}
static void relClose(int i, int *x, int *y)
{
int ma, mi;
ma = i >> 4;
mi = i & 0xf;
*x = mi - 8;
*y = ma - 8;
}
static void relFar(int i, int sign, int *x, int *y)
{
if (i < 56) {
*x = sign * (8 + (i % 7));
*y = sign * (i / 7);
} else {
*x = sign * (-14 + (i - 56) % 29);
*y = sign * (8 + (i - 56) / 29);
}
}
/* copies an 8x8 block from pSrc to pDest.
pDest and pSrc are both g_width bytes wide */
static void copyFrame(ubyte *pDest, ubyte *pSrc)
{
int i;
for (i = 0; i < 8; i++) {
memcpy(pDest, pSrc, 8);
pDest += g_width;
pSrc += g_width;
}
}
// Fill in the next eight bytes with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat0 and pat1
static void patternRow4Pixels(ubyte *pFrame, ubyte pat0, ubyte pat1, ubyte *p)
{
ushort mask = 0x0003;
ushort shift = 0;
ushort pattern = (pat1 << 8) | pat0;
while (mask != 0) {
*pFrame++ = p[(mask & pattern) >> shift];
mask <<= 2;
shift += 2;
}
}
// Fill in the next four 2x2 pixel blocks with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat0.
static void patternRow4Pixels2(ubyte *pFrame, ubyte pat0, ubyte *p)
{
ubyte mask = 0x03;
ubyte shift = 0;
ubyte pel;
while (mask != 0) {
pel = p[(mask & pat0) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame[g_width + 0] = pel;
pFrame[g_width + 1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
// Fill in the next four 2x1 pixel blocks with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat.
static void patternRow4Pixels2x1(ubyte *pFrame, ubyte pat, ubyte *p)
{
ubyte mask = 0x03;
ubyte shift = 0;
ubyte pel;
while (mask != 0) {
pel = p[(mask & pat) >> shift];
pFrame[0] = pel;
pFrame[1] = pel;
pFrame += 2;
mask <<= 2;
shift += 2;
}
}
// Fill in the next 4x4 pixel block with p[0], p[1], p[2], or p[3],
// depending on the corresponding two-bit value in pat0, pat1, pat2, and pat3.
static void patternQuadrant4Pixels(ubyte *pFrame, ubyte pat0, ubyte pat1, ubyte pat2, ubyte pat3, ubyte *p)
{
unsigned long mask = 0x00000003UL;
int shift=0;
int i;
unsigned long pat = (pat3 << 24) | (pat2 << 16) | (pat1 << 8) | pat0;
for (i = 0; i < 16; i++) {
pFrame[i&3] = p[(pat & mask) >> shift];
if ( (i & 3) == 3 )
pFrame += g_width;
mask <<= 2;
shift += 2;
}
}
// fills the next 8 pixels with either p[0] or p[1], depending on pattern
static void patternRow2Pixels(ubyte *pFrame, ubyte pat, ubyte *p)
{
ubyte mask=0x01;
while (mask != 0) {
*pFrame++ = p[(mask & pat) ? 1 : 0];
mask <<= 1;
}
}
// fills the next four 2 x 2 pixel boxes with either p[0] or p[1], depending on pattern
static void patternRow2Pixels2(ubyte *pFrame, ubyte pat, ubyte *p)
{
ubyte pel;
ubyte mask=0x1;
while (mask != 0x10) {
pel = p[(mask & pat) ? 1 : 0];
pFrame[0] = pel; // upper-left
pFrame[1] = pel; // upper-right
pFrame[g_width + 0] = pel; // lower-left
pFrame[g_width + 1] = pel; // lower-right
pFrame += 2;
mask <<= 1;
}
}
// fills pixels in the next 4 x 4 pixel boxes with either p[0] or p[1], depending on pat0 and pat1.
static void patternQuadrant2Pixels(ubyte *pFrame, ubyte pat0, ubyte pat1, ubyte *p)
{
ubyte pel;
ushort mask = 0x0001;
int i, j;
ushort pat = (pat1 << 8) | pat0;
for (i = 0; i < 4; i++) {
for (j = 0; j < 4; j++) {
pel = p[(pat & mask) ? 1 : 0];
pFrame[j + i * g_width] = pel;
mask <<= 1;
}
}
}
static void dispatchDecoder8(ubyte **pFrame, ubyte codeType, ubyte **pData, int *pDataRemain, int *curXb, int *curYb)
{
ubyte p[4];
ubyte pat[16];
int i, j, k;
int x, y;
switch(codeType) {
case 0x0:
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1));
*pFrame += 8;
break;
case 0x1:
*pFrame += 8;
break;
case 0x2:
relFar(*(*pData)++, 1, &x, &y);
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
break;
case 0x3:
relFar(*(*pData)++, -1, &x, &y);
copyFrame(*pFrame, *pFrame + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
break;
case 0x4:
relClose(*(*pData)++, &x, &y);
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1) + x + y*g_width);
*pFrame += 8;
*pDataRemain--;
break;
case 0x5:
x = (signed char)*(*pData)++;
y = (signed char)*(*pData)++;
copyFrame(*pFrame, *pFrame + ((ubyte *)g_vBackBuf2 - (ubyte *)g_vBackBuf1) + x + y*g_width);
*pFrame += 8;
*pDataRemain -= 2;
break;
case 0x6:
for (i = 0; i < 2; i++) {
*pFrame += 16;
if (++*curXb == (g_width >> 3)) {
*pFrame += 7*g_width;
*curXb = 0;
if (++*curYb == (g_height >> 3))
return;
}
}
break;
case 0x7:
p[0] = *(*pData)++;
p[1] = *(*pData)++;
if (p[0] <= p[1]) {
for (i = 0; i < 8; i++) {
patternRow2Pixels(*pFrame, *(*pData)++, p);
*pFrame += g_width;
}
} else {
for (i = 0; i < 2; i++) {
patternRow2Pixels2(*pFrame, *(*pData) & 0xf, p);
*pFrame += 2*g_width;
patternRow2Pixels2(*pFrame, *(*pData)++ >> 4, p);
*pFrame += 2*g_width;
}
}
*pFrame -= (8*g_width - 8);
break;
case 0x8:
if ( (*pData)[0] <= (*pData)[1] ) {
// four quadrant case
for (i = 0; i < 4; i++) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
// alternate between moving down and moving up and right
if (i & 1)
*pFrame += 4 - 4*g_width; // up and right
else
*pFrame += 4*g_width; // down
}
} else if ( (*pData)[6] <= (*pData)[7] ) {
// split horizontal
for (i = 0; i < 4; i++) {
if ((i & 1) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternQuadrant2Pixels(*pFrame, pat[0], pat[1], p);
if (i & 1)
*pFrame -= (4*g_width - 4);
else
*pFrame += 4*g_width;
}
} else {
// split vertical
for (i = 0; i < 8; i++) {
if ((i & 3) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
}
patternRow2Pixels(*pFrame, *(*pData)++, p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
}
break;
case 0x9:
if ( (*pData)[0] <= (*pData)[1] ) {
if ( (*pData)[2] <= (*pData)[3] ) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
for (i = 0; i < 8; i++) {
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
} else {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame += 2*g_width;
patternRow4Pixels2(*pFrame, *(*pData)++, p);
*pFrame -= (6*g_width - 8);
}
} else {
if ( (*pData)[2] <= (*pData)[3] ) {
// draw 2x1 strips
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
for (i = 0; i < 8; i++) {
pat[0] = *(*pData)++;
patternRow4Pixels2x1(*pFrame, pat[0], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
} else {
// draw 1x2 strips
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
for (i = 0; i < 4; i++) {
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
}
}
break;
case 0xa:
if ( (*pData)[0] <= (*pData)[1] ) {
for (i = 0; i < 4; i++) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
pat[2] = *(*pData)++;
pat[3] = *(*pData)++;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1)
*pFrame -= (4*g_width - 4);
else
*pFrame += 4*g_width;
}
} else {
if ( (*pData)[12] <= (*pData)[13] ) {
// split vertical
for (i = 0; i < 4; i++) {
if ((i&1) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
pat[2] = *(*pData)++;
pat[3] = *(*pData)++;
patternQuadrant4Pixels(*pFrame, pat[0], pat[1], pat[2], pat[3], p);
if (i & 1)
*pFrame -= (4*g_width - 4);
else
*pFrame += 4*g_width;
}
} else {
// split horizontal
for (i = 0; i < 8; i++) {
if ((i&3) == 0) {
p[0] = *(*pData)++;
p[1] = *(*pData)++;
p[2] = *(*pData)++;
p[3] = *(*pData)++;
}
pat[0] = *(*pData)++;
pat[1] = *(*pData)++;
patternRow4Pixels(*pFrame, pat[0], pat[1], p);
*pFrame += g_width;
}
*pFrame -= (8*g_width - 8);
}
}
break;
case 0xb:
for (i = 0; i < 8; i++) {
memcpy(*pFrame, *pData, 8);
*pFrame += g_width;
*pData += 8;
*pDataRemain -= 8;
}
*pFrame -= (8*g_width - 8);
break;
case 0xc:
for (i = 0; i < 4; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 4; k++) {
(*pFrame)[2*k] = (*pData)[k];
(*pFrame)[2*k+1] = (*pData)[k];
}
*pFrame += g_width;
}
*pData += 4;
*pDataRemain -= 4;
}
*pFrame -= (8*g_width - 8);
break;
case 0xd:
for (i = 0; i < 2; i++) {
for (j = 0; j < 4; j++) {
for (k = 0; k < 4; k++) {
(*pFrame)[k*g_width+j] = (*pData)[0];
(*pFrame)[k*g_width+j+4] = (*pData)[1];
}
}
*pFrame += 4*g_width;
*pData += 2;
*pDataRemain -= 2;
}
*pFrame -= (8*g_width - 8);
break;
case 0xe:
for (i = 0; i < 8; i++) {
memset(*pFrame, **pData, 8);
*pFrame += g_width;
}
(*pData)++;
*pDataRemain--;
*pFrame -= (8*g_width - 8);
break;
case 0xf:
for (i = 0; i < 8; i++) {
for (j = 0; j < 8; j++) {
(*pFrame)[j] = (*pData)[(i+j)&1];
}
*pFrame += g_width;
}
*pData += 2;
*pDataRemain -= 2;
*pFrame -= (8*g_width - 8);
break;
default:
break;
}
}
+247
View File
@@ -0,0 +1,247 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/cutscene/movie.cpp $
* $Revision: 2.40 $
* $Date: 2007-01-07 12:29:43 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 2.39 2006/12/28 00:59:19 wmcoolmon
* WMC codebase commit. See pre-commit build thread for details on changes.
*
* Revision 2.38 2006/11/16 00:50:38 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.37 2006/09/11 05:54:37 taylor
* switch to using cf_find_file_location_ext() when looking for movies
*
* Revision 2.36 2006/09/09 21:28:19 taylor
* be sure to reset color and clear color before MVE playback (fix for Mantis bug #1041)
*
* Revision 2.35 2006/08/20 00:44:36 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.34 2006/08/15 00:26:07 Backslash
* add .ogg to the list of recognized movie file extensions
*
* Revision 2.33 2006/07/13 22:15:02 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.32 2006/06/27 05:07:48 taylor
* fix various compiler warnings and things that Valgrind complained about
*
* 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"
#include "globalincs/systemvars.h"
#include "cutscene/movie.h"
#include "osapi/osapi.h"
#include "cmdline/cmdline.h"
#include "cfile/cfile.h"
#include "cutscene/cutscenes.h" // cutscene_mark_viewable()
#include "cutscene/mvelib.h"
#include "cutscene/oggplayer.h"
#include "menuui/mainhallmenu.h"
extern int Game_mode;
#define MOVIE_NONE -1
#define MOVIE_OGG 0
#define MOVIE_MVE 1
// This module links freespace movie calls to the actual API calls the play the movie.
// This module handles all the different requires of OS and gfx API and finding the file to play
// filename - file to search for
// out_name - output, full path to file
// returns non-zero if file is found
int movie_find(char *filename, char *out_name)
{
char full_path[MAX_PATH];
char tmp_name[MAX_PATH];
int size, offset = 0;
const int NUM_EXT = 2;
const char *movie_ext[NUM_EXT] = { ".ogg", ".mve" };
if (out_name == NULL)
return MOVIE_NONE;
memset( full_path, 0, sizeof(full_path) );
memset( tmp_name, 0, sizeof(tmp_name) );
// remove extension
strcpy( tmp_name, filename );
char *p = strchr(tmp_name, '.');
if ( p ) *p = 0;
int rc = cf_find_file_location_ext(tmp_name, NUM_EXT, movie_ext, CF_TYPE_ANY, sizeof(full_path) - 1, full_path, &size, &offset, 0);
if (rc == MOVIE_NONE)
return MOVIE_NONE;
strcpy( out_name, full_path );
return rc;
}
// Play one movie
bool movie_play(char *name)
{
// mark the movie as viewable to the player when in a campaign
// do this before anything else so that we're sure the movie is available
// to the player even if it's not going to play right now
if (Game_mode & GM_CAMPAIGN_MODE) {
cutscene_mark_viewable(name);
}
extern int Mouse_hidden;
extern int Is_standalone;
if (Cmdline_nomovies || Is_standalone)
return false;
char full_name[MAX_PATH];
int rc = 0;
rc = movie_find(name, full_name);
if (rc == MOVIE_NONE) {
mprintf(("MOVIE ERROR: Unable to open movie file '%s' in any supported format.\n", name));
return false;
}
// kill all background sounds
main_hall_pause();
// clear the screen and hide the mouse cursor
Mouse_hidden++;
gr_reset_clip();
gr_set_color(255, 255, 255);
gr_set_clear_color(0, 0, 0);
gr_zbuffer_clear(0);
// clear first buffer
gr_clear();
gr_flip();
// clear second buffer (may not be one, but that's ok)
gr_clear();
gr_flip();
// clear third buffer (may not be one, but that's ok)
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) {
// start playing ...
theora_play(movie_ogg);
// ... done playing, close the movie
theora_close(movie_ogg);
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
return false;
}
} else if (rc == MOVIE_MVE) {
MVESTREAM *movie_mve = mve_open(name);
if (movie_mve) {
// start playing ...
mve_init(movie_mve);
mve_play(movie_mve);
// ... done playing, close the movie
mve_shutdown();
mve_close(movie_mve);
} else {
// uh-oh, movie is invalid... Abory, Retry, Fail?
mprintf(("MOVIE ERROR: Found invalid movie! (%s)\n", name));
return false;
}
}
// show the mouse cursor again, and unpause the mainhall music
Mouse_hidden--;
main_hall_unpause();
return true;
}
void movie_play_two(char *name1, char *name2)
{
if ( movie_play(name1) )
movie_play(name2);
}
+29
View File
@@ -0,0 +1,29 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/cutscene/movie.h $
* $Revision: 2.7 $
* $Date: 2007-01-07 12:29:43 $
* $Author: taylor $
*
* movie player header
*
* $Log: not supported by cvs2svn $
*
* $NoKeywords: $
*/
#ifndef _MOVIE_HEADER_FILE
#define _MOVIE_HEADER_FILE
bool movie_play(char *name);
void movie_play_two(char *name1, char *name2);
#endif
+82
View File
@@ -0,0 +1,82 @@
/*
* $Logfile: /Freespace2/src/cutscene/mve_audio.cpp $
* $Revision: 2.2 $
* $Date: 2007-01-15 01:37:37 $
* $Author: wmcoolmon $
*
* Handles compressed audio data in MVE files
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2006/05/13 06:59:48 taylor
* MVE player (audio only works with OpenAL builds!)
*
* 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] =
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 47, 51, 56, 61,
66, 72, 79, 86, 94, 102, 112, 122, 133, 145, 158, 173, 189, 206, 225, 245,
267, 292, 318, 348, 379, 414, 452, 493, 538, 587, 640, 699, 763, 832, 908, 991,
1081, 1180, 1288, 1405, 1534, 1673, 1826, 1993, 2175, 2373, 2590, 2826, 3084, 3365, 3672, 4008,
4373, 4772, 5208, 5683, 6202, 6767, 7385, 8059, 8794, 9597, 10472, 11428, 12471, 13609, 14851, 16206,
17685, 19298, 21060, 22981, 25078, 27367, 29864, 32589, -29973, -26728, -23186, -19322, -15105, -10503, -5481, -1,
1, 1, 5481, 10503, 15105, 19322, 23186, 26728, 29973, -32589, -29864, -27367, -25078, -22981, -21060, -19298,
-17685, -16206, -14851, -13609, -12471, -11428, -10472, -9597, -8794, -8059, -7385, -6767, -6202, -5683, -5208, -4772,
-4373, -4008, -3672, -3365, -3084, -2826, -2590, -2373, -2175, -1993, -1826, -1673, -1534, -1405, -1288, -1180,
-1081, -991, -908, -832, -763, -699, -640, -587, -538, -493, -452, -414, -379, -348, -318, -292,
-267, -245, -225, -206, -189, -173, -158, -145, -133, -122, -112, -102, -94, -86, -79, -72,
-66, -61, -56, -51, -47, -43, -42, -41, -40, -39, -38, -37, -36, -35, -34, -33,
-32, -31, -30, -29, -28, -27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17,
-16, -15, -14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1
};
static int getWord(unsigned char **fin)
{
int value = ((*fin)[1] << 8) | (*fin)[0];
*fin += 2;
return value;
}
static void sendWord(short **fout, int 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]);
}
}
void mveaudio_uncompress(short *buffer, unsigned char *data)
{
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);
}
#endif
+385
View File
@@ -0,0 +1,385 @@
/*
* $Logfile: /Freespace2/src/cutscene/mvelib.cpp $
* $Revision: 2.2 $
* $Date: 2006-08-20 00:44:36 $
* $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"
#include "cfile/cfile.h"
static const char MVE_HEADER[] = "Interplay MVE File\x1A";
static const short MVE_HDRCONST1 = 0x001A;
static const short MVE_HDRCONST2 = 0x0100;
static const short MVE_HDRCONST3 = 0x1133;
// -----------------------------------------------------------
// public MVEFILE functions
// -----------------------------------------------------------
// utility functions for mvefile and mveplayer
short mve_get_short(ubyte *data)
{
short value;
value = data[0] | (data[1] << 8);
return value;
}
ushort mve_get_ushort(ubyte *data)
{
ushort value;
value = data[0] | (data[1] << 8);
return value;
}
int mve_get_int(ubyte *data)
{
int value;
value = data[0] | (data[1] << 8) | (data[2] << 16) | (data[3] << 24);
return value;
}
// open an MVE file
MVEFILE *mvefile_open(char *filename)
{
int cf_opened = 0;
int mve_valid = 1;
char lower_name[MAX_FILENAME_LEN];
char buffer[20];
MVEFILE *file;
// create the file
file = (MVEFILE *)vm_malloc(sizeof(MVEFILE));
// set defaults
file->stream = NULL;
file->cur_chunk = NULL;
file->buf_size = 0;
file->cur_fill = 0;
file->next_segment = 0;
// lower case filename for checking
strncpy(lower_name, filename, strlen(filename)+1);
strlwr(lower_name);
char *p = strchr( lower_name, '.' );
if ( p ) *p = 0;
SAFE_STRCAT( lower_name, ".mve", sizeof(lower_name) );
// 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)) ) {
cf_opened = 1;
}
if (!cf_opened) {
mvefile_close(file);
return NULL;
}
// initialize the buffer
file->cur_chunk = (ubyte *)vm_malloc(100 + 1024);
file->buf_size = 100 + 1024;
// verify the file's header
cfread_string(buffer, 20, file->stream);
if (strcmp(buffer, MVE_HEADER))
mve_valid = 0;
if (cfread_short(file->stream) != MVE_HDRCONST1)
mve_valid = 0;
if (cfread_short(file->stream) != MVE_HDRCONST2)
mve_valid = 0;
if (cfread_short(file->stream) != MVE_HDRCONST3)
mve_valid = 0;
if (!mve_valid) {
mvefile_close(file);
return NULL;
}
// now, prefetch the next chunk
mvefile_fetch_next_chunk(file);
return file;
}
// close a MVE file
void mvefile_close(MVEFILE *file)
{
// free the stream
if (file->stream)
cfclose(file->stream);
file->stream = NULL;
// free the buffer
if (file->cur_chunk)
vm_free(file->cur_chunk);
file->cur_chunk = NULL;
// not strictly necessary
file->buf_size = 0;
file->cur_fill = 0;
file->next_segment = 0;
// free the struct
vm_free(file);
}
// get the size of the next segment
int mvefile_get_next_segment_size(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return -1;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return -1;
// otherwise, get the data length
return mve_get_short(file->cur_chunk + file->next_segment);
}
// get type of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_major(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return 0xff;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return 0xff;
// otherwise, get the data length
return file->cur_chunk[file->next_segment + 2];
}
// get subtype (version) of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_minor(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return 0xff;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return 0xff;
// otherwise, get the data length
return file->cur_chunk[file->next_segment + 3];
}
// see next segment (return NULL if no next segment)
ubyte *mvefile_get_next_segment(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return NULL;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return NULL;
// otherwise, get the data length
return file->cur_chunk + file->next_segment + 4;
}
// advance to next segment
void mvefile_advance_segment(MVEFILE *file)
{
// if nothing is cached, fail
if (file->cur_chunk == NULL || file->next_segment >= file->cur_fill)
return;
// if we don't have enough data to get a segment, fail
if (file->cur_fill - file->next_segment < 4)
return;
// else, advance to next segment
file->next_segment += (4 + mve_get_ushort(file->cur_chunk + file->next_segment));
}
// fetch the next chunk (return 0 if at end of stream)
int mvefile_fetch_next_chunk(MVEFILE *file)
{
ubyte buffer[4];
ubyte *new_buffer;
ushort length;
// fail if not open
if (file->stream == NULL)
return 0;
// fail if we can't read the next segment descriptor
if (cfread(buffer, 1, 4, file->stream) < 4)
return 0;
// pull out the next length
length = mve_get_short(buffer);
// setup a new buffer if needed --
// only allocate new buffer is old one is too small
if (length > file->buf_size) {
// allocate new buffer
new_buffer = (ubyte *)vm_malloc(100 + length);
// copy old data
if (file->cur_chunk && file->cur_fill)
memcpy(new_buffer, file->cur_chunk, file->cur_fill);
// free old buffer
if (file->cur_chunk) {
vm_free(file->cur_chunk);
file->cur_chunk = NULL;
}
// install new buffer
file->cur_chunk = new_buffer;
file->buf_size = 100 + length;
}
// read the chunk
if (length > 0) {
if (cfread(file->cur_chunk, 1, length, file->stream) < length)
return 0;
}
file->cur_fill = length;
file->next_segment = 0;
return 1;
}
// -----------------------------------------------------------
// public MVESTREAM functions
// -----------------------------------------------------------
// open an MVE stream
MVESTREAM *mve_open(char *filename)
{
MVESTREAM *stream;
// allocate
stream = (MVESTREAM *)vm_malloc(sizeof(MVESTREAM));
// defaults
stream->movie = NULL;
// open
stream->movie = mvefile_open(filename);
if (stream->movie == NULL) {
mve_close(stream);
return NULL;
}
return stream;
}
// close an MVE stream
void mve_close(MVESTREAM *stream)
{
// close MVEFILE
if (stream->movie)
mvefile_close(stream->movie);
stream->movie = NULL;
vm_free(stream);
}
// play next chunk
int mve_play_next_chunk(MVESTREAM *stream)
{
ubyte major, minor;
ubyte *data;
int len;
// loop over segments
major = mvefile_get_next_segment_major(stream->movie);
while (major != 0xff) {
// check whether to handle the segment
if (major < 32) {
minor = mvefile_get_next_segment_minor(stream->movie);
len = mvefile_get_next_segment_size(stream->movie);
data = mvefile_get_next_segment(stream->movie);
switch (major) {
case 0x00:
mve_end_movie();
break;
case 0x01:
mve_end_chunk();
break;
case 0x02:
mve_timer_create(data);
break;
case 0x03:
mve_audio_createbuf(minor, data);
break;
case 0x04:
mve_audio_play();
break;
case 0x05:
if (!mve_video_createbuf(minor, data))
return 0;
break;
case 0x07:
mve_video_display();
break;
case 0x08:
mve_audio_data(major, data);
break;
case 0x09:
mve_audio_data(major, data);
break;
case 0x0a:
if (!mve_video_init(data))
return 0;
break;
case 0x0c:
mve_video_palette(data);
break;
case 0x0f:
mve_video_codemap(data, len);
break;
case 0x11:
mve_video_data(data, len);
break;
default:
break;
}
}
// advance to next segment
mvefile_advance_segment(stream->movie);
major = mvefile_get_next_segment_major(stream->movie);
}
if (!mvefile_fetch_next_chunk(stream->movie))
return 0;
// return status
return 1;
}
+101
View File
@@ -0,0 +1,101 @@
/*
* $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
#include "globalincs/pstypes.h"
struct CFILE;
// structure for maintaining info on a MVEFILE stream
typedef struct MVEFILE
{
CFILE *stream;
ubyte *cur_chunk;
int buf_size;
int cur_fill;
int next_segment;
} MVEFILE;
// open a .MVE file
MVEFILE *mvefile_open(char *filename);
// close a .MVE file
void mvefile_close(MVEFILE *movie);
// get size of next segment in chunk (-1 if no more segments in chunk)
int mvefile_get_next_segment_size(MVEFILE *movie);
// get type of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_major(MVEFILE *movie);
// get subtype (version) of next segment in chunk (0xff if no more segments in chunk)
ubyte mvefile_get_next_segment_minor(MVEFILE *movie);
// see next segment (return NULL if no next segment)
ubyte *mvefile_get_next_segment(MVEFILE *movie);
// advance to next segment
void mvefile_advance_segment(MVEFILE *movie);
// fetch the next chunk (return 0 if at end of stream)
int mvefile_fetch_next_chunk(MVEFILE *movie);
// structure for maintaining an MVE stream
typedef struct MVESTREAM
{
MVEFILE *movie;
} MVESTREAM;
// open an MVE stream
MVESTREAM *mve_open(char *filename);
// close an MVE stream
void mve_close(MVESTREAM *movie);
// play next chunk
int mve_play_next_chunk(MVESTREAM *movie);
// basic movie playing functions
void mve_init(MVESTREAM *mve);
void mve_play(MVESTREAM *mve);
void mve_shutdown();
// utility functions
short mve_get_short(ubyte *data);
ushort mve_get_ushort(ubyte *data);
int mve_get_int(ubyte *data);
// callbacks for data handling
// audio
void mve_audio_createbuf(ubyte minor, ubyte *data);
int mve_audio_data(ubyte major, ubyte *data);
void mve_audio_play();
// video
int mve_video_createbuf(ubyte minor, ubyte *data);
int mve_video_init(ubyte *data);
void mve_video_palette(ubyte *data);
void mve_video_data(ubyte *data, int len);
void mve_video_codemap(ubyte *data, int len);
void mve_video_display();
// misc
void mve_end_movie();
void mve_end_chunk();
int mve_timer_create(ubyte *data);
typedef short mves;
#endif /* INCLUDED_MVELIB_H */
+855
View File
@@ -0,0 +1,855 @@
/*
* $Logfile: /Freespace2/code/cutscene/mveplayer.cpp $
* $Revision: 2.5 $
* $Date: 2007-02-10 00:02:18 $
* $Author: taylor $
*
* MVE movie playing routines
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2007/01/15 01:37:37 wmcoolmon
* Fix CVS & correct various warnings under MSVC 2003
*
* Revision 2.3 2007/01/07 12:29:43 taylor
* add Theora player
* remove DirectShow support from movie player
* fix triple-buffer page flipping problem (Mantis bug #1190)
*
* Revision 2.2 2006/08/20 00:44:36 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>
#include <time.h>
#include <sys/time.h>
#endif
#include "graphics/gropengl.h"
#include "graphics/gropengltexture.h"
#include "graphics/gropenglextension.h"
#include "globalincs/pstypes.h"
#include "cutscene/mvelib.h"
#include "cutscene/movie.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "osapi/osapi.h"
#include "io/timer.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "bmpman/bmpman.h"
//#include "sound/audiostr.h"
extern int Cmdline_noscalevid;
static int mve_playing;
// timer variables
static int micro_frame_delay = 0;
static int timer_started = 0;
#ifdef SCP_UNIX
static struct timeval timer_expire = { 0, 0 };
#else
static int timer_expire;
#endif
// audio variables
#define MVE_AUDIO_BUFFERS 64 // total buffers to interact with stream
static int mve_audio_buffer_tail = 0;
static int mve_audio_playing = 0;
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;
int sample_rate;
int bytes_per_sec;
int channels;
int bitsize;
ALuint source_id;
ALuint audio_buffer[MVE_AUDIO_BUFFERS];
} mve_audio_t;
mve_audio_t *mas; // mve_audio_stream
// audio decompressor
extern void mveaudio_uncompress(short *buffer, unsigned char *data);
#endif // USE_OPENAL
// video variables
int g_width, g_height;
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_screenU = 0;
static GLfloat gl_screenV = 0;
static int g_screenWidth, g_screenHeight;
static int g_screenX, g_screenY;
static int g_truecolor = 0;
static ubyte g_palette[768];
static ubyte *g_pCurMap = NULL;
static int g_nMapLength = 0;
static int videobuf_created, video_inited;
static int hp2, wp2;
static uint mve_video_skiptimer = 0;
static int mve_scale_video = 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);
extern GLenum GL_previous_texture_target;
// the decoders
extern void decodeFrame16(ubyte *pFrame, ubyte *pMap, int mapRemain, ubyte *pData, int dataRemain);
extern void decodeFrame8(ubyte *pFrame, ubyte *pMap, int mapRemain, ubyte *pData, int dataRemain);
/*************************
* general handlers
*************************/
void mve_end_movie()
{
mve_playing = 0;
}
/*************************
* timer handlers
*************************/
int mve_timer_create(ubyte *data)
{
int rate = mve_get_int(data);
int subd = mve_get_short(data+4);
micro_frame_delay = rate * subd;
return 1;
}
static void mve_timer_start(void)
{
#ifdef SCP_UNIX
int nsec = 0;
gettimeofday(&timer_expire, NULL);
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;
}
#else
timer_expire = timer_get_microseconds();
timer_expire += micro_frame_delay;
#endif
timer_started = 1;
}
static int mve_do_timer_wait(void)
{
if (!timer_started)
return 0;
#ifdef SCP_UNIX
int nsec = 0;
struct timespec ts, tsRem;
struct timeval tv;
gettimeofday(&tv, NULL);
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) )
goto end;
ts.tv_sec = timer_expire.tv_sec - tv.tv_sec;
ts.tv_nsec = 1000 * (timer_expire.tv_usec - tv.tv_usec);
if (ts.tv_nsec < 0) {
ts.tv_nsec += 1000000000UL;
--ts.tv_sec;
}
if ( (nanosleep(&ts, &tsRem) == -1) && (errno == EINTR) ) {
// so we got an error that was a signal interupt, try to sleep again with remainder of time
if ( (nanosleep(&tsRem, NULL) == -1) && (errno == EINTR) ) {
mprintf(("MVE: Timer error! Aborting movie playback!\n"));
return 1;
}
}
end:
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;
}
#else
int tv, ts, ts2;
tv = timer_get_microseconds();
if (tv > timer_expire)
goto end;
ts = timer_expire - tv;
ts2 = ts/1000;
Sleep(ts2);
end:
timer_expire += micro_frame_delay;
#endif
return 0;
}
static void mve_timer_stop()
{
#ifdef SCP_UNIX
timer_expire.tv_sec = 0;
timer_expire.tv_usec = 0;
#else
timer_expire = 0;
#endif
timer_started = 0;
}
/*************************
* audio handlers
*************************/
// setup the audio information from the data stream
void mve_audio_createbuf(ubyte minor, ubyte *data)
{
if (audiobuf_created)
return;
// if game sound disabled don't try and play movie audio
if (!Sound_enabled) {
mve_audio_canplay = 0;
return;
}
#ifdef USE_OPENAL
int flags, desired_buffer, sample_rate;
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);
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 {
mve_audio_compressed = 0;
}
if (mas->bitsize == 16) {
if (mas->channels == 2) {
mas->format = AL_FORMAT_STEREO16;
} else if (mas->channels == 1) {
mas->format = AL_FORMAT_MONO16;
}
} else if (mas->bitsize == 8) {
if (mas->channels == 2) {
mas->format = AL_FORMAT_STEREO8;
} else if (mas->channels == 1) {
mas->format = AL_FORMAT_MONO8;
}
}
// somethings wrong, bail now
if (mas->format == AL_INVALID) {
mve_audio_canplay = 0;
audiobuf_created = 1;
return;
}
OpenAL_ErrorCheck( alGenSources(1, &mas->source_id), { mve_audio_canplay = 0; return; } );
mve_audio_canplay = 1;
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;
audiobuf_created = 1;
}
// play and stream the audio
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)
return;
#ifdef USE_OPENAL
ALint p = 0;
mve_audio_playing = 0;
OpenAL_ErrorPrint( alSourceStop(mas->source_id) );
OpenAL_ErrorPrint( alGetSourcei(mas->source_id, AL_BUFFERS_PROCESSED, &p) );
OpenAL_ErrorPrint( alSourceUnqueueBuffers(mas->source_id, p, mas->audio_buffer) );
OpenAL_ErrorPrint( alDeleteSources(1, &mas->source_id) );
for (int i = 0; i < MVE_AUDIO_BUFFERS; i++) {
// make sure that the buffer is real before trying to delete, it could crash for some otherwise
if ( (mas->audio_buffer[i] != 0) && alIsBuffer(mas->audio_buffer[i]) ) {
OpenAL_ErrorPrint( alDeleteBuffers(1, &mas->audio_buffer[i]) );
}
}
if (mas != NULL) {
vm_free(mas);
mas = NULL;
}
#endif // USE_OPENAL
}
int mve_audio_data(ubyte major, ubyte *data)
{
static const int selected_chan=1;
int chan;
int nsamp;
if (mve_audio_canplay) {
#ifdef USE_OPENAL
chan = mve_get_ushort(data + 2);
nsamp = mve_get_ushort(data + 4);
if (chan & selected_chan) {
ALint bprocessed, bqueued, status;
ALuint bid;
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_BUFFERS_PROCESSED, &bprocessed), return 0 );
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)
mprintf(("MVE: Buffer underun (First is normal)\n"));
OpenAL_ErrorCheck( alGetSourcei(mas->source_id, AL_SOURCE_STATE, &status), return 0 );
if ( (mve_audio_playing) && (status != AL_PLAYING) && (bqueued > 0) ) {
OpenAL_ErrorCheck( alSourcePlay(mas->source_id), return 0 );
}
if (bqueued < MVE_AUDIO_BUFFERS) {
short *buf = NULL;
/* HACK: +4 mveaudio_uncompress adds 4 more bytes */
if (major == 8) {
if (mve_audio_compressed) {
nsamp += 4;
buf = (short *)vm_malloc(nsamp);
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)
mve_audio_buffer_tail = 0;
bqueued++;
vm_free(buf);
} else {
mprintf(("MVE: Buffer overrun: Queue full\n"));
}
}
#endif // USE_OPENAL
}
return 1;
}
/*************************
* video handlers
*************************/
int mve_video_createbuf(ubyte minor, ubyte *data)
{
if (videobuf_created)
return 1;
short w, h;
short count, truecolor;
w = mve_get_short(data);
h = mve_get_short(data+2);
if (minor > 0) {
count = mve_get_short(data+4);
} else {
count = 1;
}
if (minor > 1) {
truecolor = mve_get_short(data+6);
} else {
truecolor = 0;
}
g_width = w << 3;
g_height = h << 3;
g_vBackBuf1 = g_vBuffers = vm_malloc(g_width * g_height * 4);
if (g_vBackBuf1 == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate video buffer"));
videobuf_created = 1;
return 0;
}
if (truecolor)
g_vBackBuf2 = (ushort *)g_vBackBuf1 + (g_width * g_height);
else
g_vBackBuf2 = (ubyte *)g_vBackBuf1 + (g_width * g_height);
memset(g_vBackBuf1, 0, g_width * g_height * 4);
g_truecolor = truecolor;
videobuf_created = 1;
if (gr_screen.mode == GR_OPENGL) {
GLfloat scale_by = 1.0f;
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)
scale_by = (float)gr_screen.max_h / (float)g_height;
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)) {
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glScalef( scale_by, scale_by, 1.0f );
mve_scale_video = 1;
}
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);
} 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);
}
// set additional values for screen width/height and UV coords
if (gr_screen.mode == GR_OPENGL) {
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);
}
}
}
return 1;
}
static void mve_convert_and_draw()
{
ushort *pDests;
ushort *pSrcs = NULL;
ushort *pixels = (ushort *)g_vBackBuf1;
int x, y;
ubyte *pSrcs8 = NULL;
ubyte *pixels8 = (ubyte *)g_vBackBuf1;
ubyte r, g, b;
ushort bit_16;
if (g_truecolor)
pSrcs = pixels;
else
pSrcs8 = pixels8;
pDests = pixelbuf;
if (gr_screen.mode != GR_OPENGL) {
if (g_screenWidth > g_width)
pDests += ((g_screenWidth - g_width) / 2) / 2;
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 {
Assert( pSrcs8 != NULL );
// grab rgb color
r = (g_palette[(*pSrcs8)*3] / 2);
g = (g_palette[(*pSrcs8)*3 + 1] / 2);
b = (g_palette[(*pSrcs8)*3 + 2] / 2);
// stuff the color
bit_16 = (ushort)(r << Gr_t_red.shift);
bit_16 |= (ushort)(g << Gr_t_green.shift);
bit_16 |= (ushort)(b << Gr_t_blue.shift);
bit_16 |= (ushort)(Gr_t_alpha.mask);
// stuff the pixel
pDests[x] = (1<<15)|bit_16;
pSrcs8++;
}
}
pDests += g_screenWidth;
}
}
void mve_video_display()
{
fix t1 = timer_get_fixed_seconds();
mve_convert_and_draw();
// this thing is basically stupid but I don't care
// micro_frame_delay is divided by 10 to match mve_video_skiptimer overflow catch
if ( mve_video_skiptimer > (uint)(micro_frame_delay/10) ) {
// we are running slow so subtract desired time from actual and skip this frame
mve_video_skiptimer -= (micro_frame_delay/10);
return;
} else {
// zero out so we can get a new count
mve_video_skiptimer = 0;
}
if (gr_screen.mode == GR_OPENGL) {
glBindTexture(GL_texture_target, GLtex);
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();
} 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);
bm_release (bitmap);
}
gr_flip();
os_poll();
fix t2 = timer_get_fixed_seconds();
// only get a new count if we are definitely through with old count
if ( mve_video_skiptimer == 0 ) {
// for a more accurate count convert the frame rate to a float and multiply
// by one-hundred-thousand before converting to an uint.
mve_video_skiptimer = (uint)(f2fl(t2-t1) * 100000);
}
int k = key_inkey();
switch (k) {
case KEY_ESC:
case KEY_ENTER:
case KEY_SPACEBAR:
mve_playing = 0;
}
//mprintf(("mve frame took this long: %.6f\n", f2fl(t2-t1) / 1000.0f));
}
int mve_video_init(ubyte *data)
{
if (video_inited)
return 1;
short width, height;
width = mve_get_short(data);
height = mve_get_short(data+2);
g_screenWidth = width;
g_screenHeight = height;
// DDOI - Allocate RGB565 pixel buffer
pixelbuf = (ushort *)vm_malloc(g_screenWidth * g_screenHeight * 2);
if (pixelbuf == NULL) {
nprintf(("MOVIE", "ERROR: Can't allocate memory for pixelbuf"));
video_inited = 1;
return 0;
}
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_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
glGenTextures(1, &GLtex);
Assert( GLtex != 0 );
if ( GLtex == 0 ) {
nprintf(("MOVIE", "ERROR: Can't create a GL texture"));
video_inited = 1;
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);
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);
// 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);
// set our color so that we can make sure that it's correct
glColor3f(1.0f, 1.0f, 1.0f);
}
#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;
}
void mve_video_palette(ubyte *data)
{
short start, count;
start = mve_get_short(data);
count = mve_get_short(data+2);
memcpy(g_palette + 3*start, data+4, 3*count);
}
void mve_video_codemap(ubyte *data, int len)
{
g_pCurMap = data;
g_nMapLength = len;
}
void mve_video_data(ubyte *data, int len)
{
short nFrameHot, nFrameCold;
short nXoffset, nYoffset;
short nXsize, nYsize;
ushort nFlags;
ubyte *temp;
nFrameHot = mve_get_short(data);
nFrameCold = mve_get_short(data+2);
nXoffset = mve_get_short(data+4);
nYoffset = mve_get_short(data+6);
nXsize = mve_get_short(data+8);
nYsize = mve_get_short(data+10);
nFlags = mve_get_ushort(data+12);
if (nFlags & 1) {
temp = (ubyte *)g_vBackBuf1;
g_vBackBuf1 = g_vBackBuf2;
g_vBackBuf2 = temp;
}
if (g_truecolor)
decodeFrame16((ubyte *)g_vBackBuf1, g_pCurMap, g_nMapLength, data+14, len-14);
else
decodeFrame8((ubyte *)g_vBackBuf1, g_pCurMap, g_nMapLength, data+14, len-14);
}
void mve_end_chunk()
{
g_pCurMap = NULL;
}
void mve_init(MVESTREAM *mve)
{
// reset to default values
mve_audio_buffer_tail = 0;
mve_audio_playing = 0;
mve_audio_canplay = 0;
mve_audio_compressed = 0;
audiobuf_created = 0;
videobuf_created = 0;
video_inited = 0;
mve_scale_video = 0;
mve_playing = 1;
}
void mve_play(MVESTREAM *mve)
{
int init_timer = 0, timer_error = 0;
int cont = 1;
if (!timer_started)
mve_timer_start();
while (cont && mve_playing && !timer_error) {
cont = mve_play_next_chunk(mve);
if (micro_frame_delay && !init_timer) {
mve_timer_start();
init_timer = 1;
}
timer_error = mve_do_timer_wait();
}
}
void mve_shutdown()
{
if (gr_screen.mode == GR_OPENGL) {
if (mve_scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
glBindTexture(GL_texture_target, 0);
glDeleteTextures(1, &GLtex);
GLtex = 0;
opengl_switch_arb(-1, 0);
opengl_set_texture_target();
}
if (pixelbuf != NULL) {
vm_free(pixelbuf);
pixelbuf = NULL;
}
if (g_vBuffers != NULL) {
vm_free(g_vBuffers);
g_vBuffers = NULL;
}
mve_audio_stop();
mve_timer_stop();
}
+978
View File
@@ -0,0 +1,978 @@
/*
* $Logfile: /Freespace2/code/cutscene/oggplayer.cpp $
* $Revision: 2.5 $
* $Date: 2007-04-11 14:50:01 $
* $Author: taylor $
*
* movie player code
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2007/03/22 20:23:42 taylor
* fix stupidness that screwed up RGB values (Mantis #1307)
*
* Revision 2.3 2007/02/10 00:02:18 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 2.2 2007/01/14 10:26:37 wmcoolmon
* Attempt to remove various warnings under MSVC 2003, mostly related to casting, but also some instances of inaccessible code.
*
* Revision 2.1 2007/01/07 12:29:43 taylor
* add Theora player
* remove DirectShow support from movie player
* fix triple-buffer page flipping problem (Mantis bug #1190)
*
* Revision 1.0 2006/12/25 21:44:11 taylor
*
* $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
#ifdef SCP_UNIX
#include <sys/time.h>
#include <errno.h>
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "graphics/gropengl.h"
#include "graphics/gropengltexture.h"
#include "graphics/gropenglextension.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "osapi/osapi.h"
#include "sound/sound.h"
#include "sound/ds.h"
#include "bmpman/bmpman.h"
#include "cutscene/oggplayer.h"
#include "io/timer.h"
#include "theora/theora.h"
#include "vorbis/codec.h"
extern int Cmdline_noscalevid;
static int hp2, wp2;
static int video_inited = 0;
static int scale_video = 0;
static int playing = 1;
static ubyte *pixelbuf = NULL;
static uint g_screenWidth = 0;
static uint g_screenHeight = 0;
static int g_screenX = 0;
static int g_screenY = 0;
static GLuint GLtex = 0;
static GLint gl_screenYH = 0;
static GLint gl_screenXW = 0;
static GLfloat gl_screenU = 0;
static GLfloat gl_screenV = 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);
static int timer_started = 0;
static longlong base_time = -1;
#ifdef SCP_UNIX
static struct timeval timer_expire = { 0, 0 };
#else
static int timer_expire;
#endif
static int audio_inited = 0;
static int audio_buffer_tail = 0;
static ALuint audio_sid = 0;
#define OGG_AUDIO_BUFFERS 15
static ALuint audio_buffers[OGG_AUDIO_BUFFERS];
// single audio fragment audio buffering
static int audiobuf_fill = 0;
static short *audiobuf = NULL;
static longlong audiobuf_granulepos = 0; // time position of last sample
static int audiofd_fragsize = 0;
// single frame video buffering
static longlong videobuf_granulepos = -1;
static double videobuf_time = 0;
// -----------------------------------------------------------------------------
// Utility items
//
// 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);
ogg_sync_wrote(&movie->osyncstate, bytes);
return bytes;
}
// helper: push a page into the appropriate steam
// this can be done blindly; a stream won't accept a page that doesn't belong to it
static void OGG_queue_page(THEORAFILE *movie)
{
Assert( movie->theora_p );
ogg_stream_pagein(&movie->t_osstate, &movie->opage);
if (movie->vorbis_p)
ogg_stream_pagein(&movie->v_osstate, &movie->opage);
}
// get relative time since beginning playback, compensating for A/V drift
static double OGG_get_time()
{
#ifdef SCP_UNIX
longlong now;
struct timeval tv;
gettimeofday(&tv, NULL);
now = tv.tv_sec * 1000 + tv.tv_usec / 1000;
if (base_time == -1)
base_time = now;
return (now - base_time) * 0.001;
#else
if (base_time == -1)
base_time = timer_get_milliseconds();
return (timer_get_milliseconds() - base_time) * 0.001;
#endif
}
static void OGG_timer_init()
{
#if SCP_UNIX
int nsec = 0;
gettimeofday(&timer_expire, NULL);
timer_expire.tv_usec += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
if (timer_expire.tv_usec > 1000000) {
nsec = timer_expire.tv_usec / 1000000;
timer_expire.tv_sec += nsec;
timer_expire.tv_usec -= nsec * 1000000;
}
#else
timer_expire = timer_get_microseconds();
timer_expire += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
#endif
timer_started = 1;
}
static void OGG_timer_do_wait()
{
if (!timer_started)
OGG_timer_init();
#if SCP_UNIX
int nsec = 0;
struct timespec ts, tsRem;
struct timeval tv;
gettimeofday(&tv, NULL);
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) )
goto end;
ts.tv_sec = timer_expire.tv_sec - tv.tv_sec;
ts.tv_nsec = 1000 * (timer_expire.tv_usec - tv.tv_usec);
if (ts.tv_nsec < 0) {
ts.tv_nsec += 1000000000UL;
--ts.tv_sec;
}
if ( (nanosleep(&ts, &tsRem) == -1) && (errno == EINTR) ) {
// so we got an error that was a signal interupt, try to sleep again with remainder of time
if ( (nanosleep(&tsRem, NULL) == -1) && (errno == EINTR) ) {
mprintf(("MVE: Timer error! Aborting movie playback!\n"));
return;
}
}
end:
timer_expire.tv_usec += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
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)
goto end;
ts = timer_expire - tv;
ts2 = ts/1000;
Sleep(ts2);
end:
timer_expire += (int)((videobuf_time - OGG_get_time()) * 1000000.0);
#endif
}
//
// End Utility items
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// That wonderful Audio
//
static void OGG_audio_init(vorbis_info *vinfo)
{
if (audio_inited)
return;
Assert( vinfo != NULL );
audio_inited = 1;
OpenAL_ErrorCheck( alGenSources(1, &audio_sid), return );
OpenAL_ErrorPrint( alSourcef(audio_sid, AL_GAIN, 1.0f) );
memset( &audio_buffers, 0, sizeof(ALuint) * OGG_AUDIO_BUFFERS );
audiofd_fragsize = (((vinfo->channels * 16) / 8) * vinfo->rate);
audiobuf = (short *) vm_malloc(audiofd_fragsize);
}
static void OGG_audio_close()
{
if ( !audio_inited )
return;
audio_inited = 0;
ALint p = 0;
OpenAL_ErrorPrint( alSourceStop(audio_sid) );
OpenAL_ErrorPrint( alGetSourcei(audio_sid, AL_BUFFERS_PROCESSED, &p) );
OpenAL_ErrorPrint( alSourceUnqueueBuffers(audio_sid, p, audio_buffers) );
OpenAL_ErrorPrint( alDeleteSources(1, &audio_sid) );
for (int i = 0; i < OGG_AUDIO_BUFFERS; i++) {
// make sure that the buffer is real before trying to delete, it could crash for some otherwise
if ( (audio_buffers[i] != 0) && alIsBuffer(audio_buffers[i]) ) {
OpenAL_ErrorPrint( alDeleteBuffers(1, &audio_buffers[i]) );
}
}
audio_sid = 0;
audio_buffer_tail = 0;
audiobuf_fill = 0;
audiobuf_granulepos = 0;
audiofd_fragsize = 0;
if (audiobuf != NULL) {
vm_free(audiobuf);
audiobuf = NULL;
}
}
static void OGG_audio_write(vorbis_info *vorbis, bool *ready)
{
ALint status, queued, processed = 0;
ALuint bid = 0;
if ( !audio_inited || !(*ready) )
return;
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_BUFFERS_PROCESSED, &processed), return );
while (processed-- > 2)
OpenAL_ErrorPrint( alSourceUnqueueBuffers(audio_sid, 1, &bid) );
if ( !(*ready) )
return;
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_BUFFERS_QUEUED, &queued), return );
if ( audiobuf_fill && (queued < OGG_AUDIO_BUFFERS) ) {
if ( !audio_buffers[audio_buffer_tail] )
OpenAL_ErrorCheck( alGenBuffers(1, &audio_buffers[audio_buffer_tail]), return );
ALenum format = (vorbis->channels == 2) ? AL_FORMAT_STEREO16 : AL_FORMAT_MONO16;
OpenAL_ErrorCheck( alBufferData(audio_buffers[audio_buffer_tail], format, audiobuf, audiobuf_fill, vorbis->rate), return );
OpenAL_ErrorCheck( alSourceQueueBuffers(audio_sid, 1, &audio_buffers[audio_buffer_tail]), return );
if (++audio_buffer_tail == OGG_AUDIO_BUFFERS)
audio_buffer_tail = 0;
audiobuf_fill = 0;
*ready = false;
} else {
// mprintf(("Theora WARN: Buffer overrun: Queue full\n"));
}
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_SOURCE_STATE, &status), return );
OpenAL_ErrorCheck( alGetSourcei(audio_sid, AL_BUFFERS_QUEUED, &queued), return );
if ( (status != AL_PLAYING) && (queued > 0) )
OpenAL_ErrorPrint( alSourcePlay(audio_sid) );
}
//
// End Audio stuff
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// Video related stuff
//
static void OGG_video_init(theora_info *tinfo)
{
float scale_by = 0.0f;
if (video_inited)
return;
Assert( tinfo != NULL );
g_screenWidth = tinfo->frame_width;
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_tcache_get_adjusted_texture_size(g_screenWidth, g_screenHeight, &wp2, &hp2);
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);
float screen_ratio = (float)gr_screen.max_w / (float)gr_screen.max_h;
float movie_ratio = (float)g_screenWidth / (float)g_screenHeight;
if (screen_ratio > movie_ratio)
scale_by = (float)gr_screen.max_h / (float)g_screenHeight;
else
scale_by = (float)gr_screen.max_w / (float)g_screenWidth;
// don't bother setting anything if we aren't going to need it
if (!Cmdline_noscalevid && (scale_by != 1.0f)) {
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glLoadIdentity();
glScalef( scale_by, scale_by, -1.0f );
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);
}
#ifndef NO_DIRECT3D
else if (gr_screen.mode == GR_DIRECT3D) {
// TODO: is there a fast way to do frames in D3D too?
}
#endif
if (scale_video) {
g_screenX = ((fl2i(gr_screen.max_w / scale_by + 0.5f) - g_screenWidth) / 2);
g_screenY = ((fl2i(gr_screen.max_h / scale_by + 0.5f) - g_screenHeight) / 2);
} else {
// centers on 1024x768, fills on 640x480
g_screenX = ((gr_screen.max_w - g_screenWidth) / 2);
g_screenY = ((gr_screen.max_h - g_screenHeight) / 2);
}
// set additional values for screen width/height and UV coords
if (gr_screen.mode == GR_OPENGL) {
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);
}
}
video_inited = 1;
}
static void OGG_video_close()
{
if (!video_inited)
return;
if (gr_screen.mode == GR_OPENGL) {
if (scale_video) {
glMatrixMode(GL_MODELVIEW);
glPopMatrix();
}
opengl_switch_arb(-1, 0);
glBindTexture(GL_texture_target, 0);
glDeleteTextures(1, &GLtex);
GLtex = 0;
opengl_set_texture_target();
glEnable(GL_DEPTH_TEST);
}
if (pixelbuf != NULL) {
vm_free(pixelbuf);
pixelbuf = NULL;
}
video_inited = 0;
scale_video = 0;
pixelbuf = NULL;
g_screenWidth = 0;
g_screenHeight = 0;
g_screenX = 0;
g_screenY = 0;
GLtex = 0;
gl_screenYH = 0;
gl_screenXW = 0;
gl_screenU = 0;
gl_screenV = 0;
}
static void convert_YUV_to_RGB(yuv_buffer *yuv)
{
int Y1, Y2, U, V;
int R = 0, G = 0, B = 0;
int C, D, E;
uint x, y;
uint width_2 = g_screenWidth/2;
ubyte *pix = &pixelbuf[0];
ubyte *y_ptr = (ubyte *)yuv->y;
ubyte *u_ptr = (ubyte *)yuv->u;
ubyte *v_ptr = (ubyte *)yuv->v;
for (y = 0; y < g_screenHeight; y++) {
for (x = 0; x < width_2; x++) {
// we need two pixels of Y
Y1 = *y_ptr; y_ptr++;
Y2 = *y_ptr; y_ptr++;
// only one pixel of U and V (half the size of Y)
U = u_ptr[x];
V = v_ptr[x];
D = (U - 128);
E = (V - 128);
// first pixel
C = (Y1 - 16) * 298;
R = ((C + 409 * E + 128) >> 8);
G = ((C - 100 * D - 208 * E + 128) >> 8);
B = ((C + 516 * D + 128) >> 8);
CLAMP(R, 0, 255);
CLAMP(G, 0, 255);
CLAMP(B, 0, 255);
*pix++ = (ubyte)B;
*pix++ = (ubyte)G;
*pix++ = (ubyte)R;
// second pixel (U and V values are resused)
C = (Y2 - 16) * 298;
R = ((C + 409 * E + 128) >> 8);
G = ((C - 100 * D - 208 * E + 128) >> 8);
B = ((C + 516 * D + 128) >> 8);
CLAMP(R, 0, 255);
CLAMP(G, 0, 255);
CLAMP(B, 0, 255);
*pix++ = (ubyte)B;
*pix++ = (ubyte)G;
*pix++ = (ubyte)R;
}
y_ptr += (yuv->y_stride - yuv->y_width);
// u and v have to be done every other row (it's a 2x2 block)
if (y % 2) {
u_ptr += yuv->uv_stride;
v_ptr += yuv->uv_stride;
}
}
}
static void OGG_video_draw(theora_state *tstate)
{
yuv_buffer yuv;
theora_decode_YUVout(tstate, &yuv);
convert_YUV_to_RGB(&yuv);
if (gr_screen.mode == GR_OPENGL) {
glBindTexture(GL_texture_target, GLtex);
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!!!!
}
gr_flip();
os_poll();
int k = key_inkey();
switch (k) {
case KEY_ESC:
case KEY_ENTER:
case KEY_SPACEBAR:
playing = 0;
}
}
//
// End Video related stuff
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
// The global stuff...
//
// close out a theora movie and free it's memory
void theora_close(THEORAFILE *movie)
{
Assert( movie != NULL );
timer_started = 0;
base_time = -1;
videobuf_granulepos = -1;
videobuf_time = 0;
if (movie->vorbis_p) {
ogg_stream_clear(&movie->v_osstate);
vorbis_block_clear(&movie->vblock);
vorbis_dsp_clear(&movie->vstate);
vorbis_comment_clear(&movie->vcomment);
vorbis_info_clear(&movie->vinfo);
}
if (movie->theora_p) {
ogg_stream_clear(&movie->t_osstate);
theora_clear(&movie->tstate);
theora_comment_clear(&movie->tcomment);
theora_info_clear(&movie->tinfo);
}
ogg_sync_clear(&movie->osyncstate);
// free the stream
if (movie->cfp)
cfclose(movie->cfp);
// free the struct
vm_free(movie);
playing = 1;
}
// opens a theora file, verifies we can use it, initializes everything needed
// to decode and use the file
THEORAFILE *theora_open(char *filename)
{
char lower_name[MAX_FILENAME_LEN];
THEORAFILE *movie;
int stateflag = 0;
// create the file
movie = (THEORAFILE *) vm_malloc_q( sizeof(THEORAFILE) );
if (movie == NULL)
return NULL;
memset( movie, 0, sizeof(THEORAFILE) );
// lower case filename for checking
memset( lower_name, 0, sizeof(lower_name) );
strncpy( lower_name, filename, strlen(filename) );
strlwr(lower_name);
char *p = strchr( lower_name, '.' );
if ( p ) *p = 0;
SAFE_STRCAT( lower_name, ".ogg", sizeof(lower_name) );
// 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
// two places that Theora movies might exist.
movie->cfp = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_ROOT);
if (movie->cfp == NULL)
movie->cfp = cfopen(lower_name, "rb", CFILE_NORMAL, CF_TYPE_MOVIES);
if (movie->cfp == NULL) {
mprintf(("Theora ERROR: Unable to find and open movie file named '%s'\n", lower_name));
goto Error;
}
// start up Ogg stream synchronization layer
ogg_sync_init(&movie->osyncstate);
// init supporting Vorbis structures needed in header parsing
vorbis_info_init(&movie->vinfo);
vorbis_comment_init(&movie->vcomment);
// init supporting Theora structures needed in header parsing
theora_comment_init(&movie->tcomment);
theora_info_init(&movie->tinfo);
// ogg file open so parse the headers
// we are only interested in Vorbis/Theora streams
while ( !stateflag ) {
int ret = OGG_buffer_data(movie);
if (ret == 0)
break;
while (ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0) {
ogg_stream_state test;
// is this a mandated initial header? If not, stop parsing
if ( !ogg_page_bos(&movie->opage) ) {
// don't leak the page; get it into the appropriate stream
OGG_queue_page(movie);
stateflag = 1;
break;
}
ogg_stream_init(&test, ogg_page_serialno(&movie->opage));
ogg_stream_pagein(&test, &movie->opage);
ogg_stream_packetout(&test, &movie->opacket);
// identify the codec: try theora
if ( !movie->theora_p && (theora_decode_header(&movie->tinfo, &movie->tcomment, &movie->opacket) >= 0) ) {
// it is theora
memcpy( &movie->t_osstate, &test, sizeof(test) );
movie->theora_p = 1;
} else if ( !movie->vorbis_p && (vorbis_synthesis_headerin(&movie->vinfo, &movie->vcomment, &movie->opacket) >= 0) ) {
// it is vorbis
memcpy( &movie->v_osstate, &test, sizeof(test) );
movie->vorbis_p = 1;
} else {
// whatever it is, we don't care about it
ogg_stream_clear(&test);
}
}
// fall through to non-bos page parsing
}
// if we don't have usable video then bail out now
if ( !movie->theora_p ) {
mprintf(("Theora ERROR: Unable to find video data in '%s'\n", lower_name));
goto Error;
}
// go ahead and do some audio stream error checking...
if ( (movie->vinfo.channels < 0) || (movie->vinfo.channels > 2) ) {
mprintf(("Theora ERROR: Unsupported number of audio channels!\n"));
movie->vorbis_p = 0;
}
// if we don't have usable audio then close out it's partial setup and just use the video
if ( !Sound_enabled || !movie->vorbis_p ) {
vorbis_info_clear(&movie->vinfo);
vorbis_comment_clear(&movie->vcomment);
movie->vorbis_p = 0;
}
// we're expecting more header packets.
while ( (movie->theora_p < 3) || (movie->vorbis_p && (movie->vorbis_p < 3)) ) {
int ret;
// look for further theora headers
while ( (movie->theora_p < 3) && (ret = ogg_stream_packetout(&movie->t_osstate, &movie->opacket)) ){
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;
}
if (++movie->theora_p == 3)
break;
}
// look for more vorbis header packets
while ( movie->vorbis_p && (movie->vorbis_p < 3) && (ret = ogg_stream_packetout(&movie->v_osstate, &movie->opacket)) ) {
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;
}
if (++movie->vorbis_p == 3)
break;
}
// The header pages/packets will arrive before anything else we care about, or the stream is not obeying spec
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
if ( ret == 0 ) {
mprintf(("Theora ERROR: End of file while searching for codec headers in '%s'!\n", lower_name));
goto Error;
}
}
}
// initialize video decoder
theora_decode_init(&movie->tstate, &movie->tinfo);
// and now for video stream error checking...
if (movie->tinfo.pixelformat != OC_PF_420) {
mprintf(("Theora ERROR: Only the yuv420p chroma is supported!\n"));
goto Error;
}
if (movie->tinfo.offset_x || movie->tinfo.offset_y) {
mprintf(("Theora ERROR: Player does not support frame offsets!\n"));
goto Error;
}
if ( (movie->tinfo.frame_width > 640) || (movie->tinfo.frame_height > 480) ) {
mprintf(("Theora ERROR: Movies must be no larger than 640x480!\n"));
goto Error;
}
// initialize audio decoder, if there is audio
if (movie->vorbis_p) {
vorbis_synthesis_init(&movie->vstate, &movie->vinfo);
vorbis_block_init(&movie->vstate, &movie->vblock);
}
return movie;
Error:
theora_close(movie);
return NULL;
}
// play that funky music... err, movie!
void theora_play(THEORAFILE *movie)
{
int i, j;
bool stateflag = false;
bool videobuf_ready = false;
bool audiobuf_ready = false;
double last_time = 0.0; // for frame skipper
if ( (movie == NULL) || !movie->theora_p )
return;
// open audio
if (movie->vorbis_p)
OGG_audio_init(&movie->vinfo);
// open video
OGG_video_init(&movie->tinfo);
// on to the main decode loop. We assume in this example that audio
// and video start roughly together, and don't begin playback until
// we have a start frame for both. This is not necessarily a valid
// assumption in Ogg A/V streams! It will always be true of the
// example_encoder (and most streams) though.
while (playing) {
// we want a video and audio frame ready to go at all times. If
// we have to buffer incoming, buffer the compressed data (ie, let
// ogg do the buffering)
while ( movie->vorbis_p && !audiobuf_ready ) {
int ret;
float **pcm;
// if there's pending, decoded audio, grab it
if ( (ret = vorbis_synthesis_pcmout(&movie->vstate, &pcm)) > 0 ) {
int count = (audiobuf_fill / 2);
int maxsamples = (audiofd_fragsize - audiobuf_fill) / 2 / movie->vinfo.channels;
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);
if (val > 32767)
val = 32767;
if (val < -32768)
val = -32768;
audiobuf[count++] = (short)val;
}
}
vorbis_synthesis_read(&movie->vstate, i);
audiobuf_fill += (i * movie->vinfo.channels * 2);
if (audiobuf_fill == audiofd_fragsize)
audiobuf_ready = true;
if (movie->vstate.granulepos >= 0)
audiobuf_granulepos = movie->vstate.granulepos - ret + i;
else
audiobuf_granulepos += i;
} else {
// no pending audio; is there a pending packet to decode?
if ( ogg_stream_packetout(&movie->v_osstate, &movie->opacket) > 0 ) {
if ( vorbis_synthesis(&movie->vblock, &movie->opacket) == 0 )
vorbis_synthesis_blockin(&movie->vstate, &movie->vblock);
}
// we need more data; break out to suck in another page
else {
break;
}
}
}
while ( !videobuf_ready ) {
// theora is one in, one out...
if ( ogg_stream_packetout(&movie->t_osstate, &movie->opacket) <= 0 )
break;
theora_decode_packetin(&movie->tstate, &movie->opacket);
videobuf_time = theora_granule_time(&movie->tstate, movie->tstate.granulepos);
double now_time = OGG_get_time();
double delay = videobuf_time - OGG_get_time();
// if we are running slow then skip the frame, otherwise to go into ready mode
if ( (delay >= 0.0) || (now_time - last_time >= 1.0) )
videobuf_ready = true;
}
if ( !videobuf_ready && (movie->vorbis_p && !audiobuf_ready) && cfeof(movie->cfp) )
break;
if ( !videobuf_ready || (movie->vorbis_p && !audiobuf_ready) ) {
// no data yet for somebody. Grab another page
OGG_buffer_data(movie);
while (ogg_sync_pageout(&movie->osyncstate, &movie->opage) > 0)
OGG_queue_page(movie);
}
// If playback has begun, top audio buffer off immediately.
if ( stateflag )
OGG_audio_write(&movie->vinfo, &audiobuf_ready);
// are we at or past time for this video frame?
if ( stateflag && videobuf_ready && (videobuf_time <= OGG_get_time()) ) {
OGG_video_draw(&movie->tstate);
last_time = OGG_get_time();
videobuf_ready = false;
}
// if our buffers either don't exist or are ready to go, we can begin playback
if ( videobuf_ready && (audiobuf_ready || !movie->vorbis_p) )
stateflag = true;
// bail if we run into eof
// if ( cfeof(movie->cfp) )
// break;
if (videobuf_ready)
OGG_timer_do_wait();
}
// tear it all down
OGG_audio_close();
OGG_video_close();
}
+55
View File
@@ -0,0 +1,55 @@
/*
* $Logfile: /Freespace2/src/cutscene/oggplayer.h $
* $Revision: 2.1 $
* $Date: 2007-01-07 12:29:43 $
* $Author: taylor $
*
* main lib for using Theora movies
*
* $Log: not supported by cvs2svn $
* 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: $
*
*/
#ifndef _OGGPLAYER_H
#define _OGGPLAYER_H
#include "globalincs/pstypes.h"
#include "theora/theora.h"
#include "vorbis/codec.h"
struct CFILE;
// structure for maintaining info on a THEORAFILE stream
typedef struct THEORAFILE
{
CFILE *cfp;
ubyte theora_p;
ubyte vorbis_p;
ogg_sync_state osyncstate;
ogg_page opage;
ogg_packet opacket;
ogg_stream_state v_osstate;
ogg_stream_state t_osstate;
theora_info tinfo;
theora_comment tcomment;
theora_state tstate;
vorbis_info vinfo;
vorbis_dsp_state vstate;
vorbis_block vblock;
vorbis_comment vcomment;
} THEORAFILE;
void theora_play(THEORAFILE *movie);
THEORAFILE *theora_open(char *filename);
void theora_close(THEORAFILE *movie);
#endif
+501
View File
@@ -0,0 +1,501 @@
#include "ddsutils/ddsutils.h"
#include "cfile/cfile.h"
#include "osapi/osregistry.h"
/* Currently supported formats:
* DXT1a (compressed)
* DXT1c (compressed)
* DXT3 (compressed)
* DXT5 (compressed)
* uncompressed 1555 (16-bit, 1-bit being alpha)
* uncompressed 8888 (32-bit)
* uncompressed 888 (24-bit, no alpha)
* paletted 8-bit (256 colors)
*/
int Texture_compression_available = 0;
int Use_compressed_textures = 0;
// power of two check, to verify that a given DDS will always be usable since
// some may not be power-of-2
static inline int is_power_of_two(int w, int h)
{
return ( (w && !(w & (w-1))) && (h && !(h & (h-1))) );
}
int dds_read_header(char *filename, CFILE *img_cfp, int *width, int *height, int *bpp, int *compression_type, int *levels, int *size, ubyte *palette)
{
DDSURFACEDESC2 dds_header;
int code = 0;
CFILE *ddsfile;
char real_name[MAX_FILENAME_LEN];
int retval = DDS_ERROR_NONE;
int ct = DDS_UNCOMPRESSED;
int bits = 0;
int i, trash, is_cubemap = 0;
int d_width = 0, d_height = 0, d_depth = 0, d_size = 0;
if (img_cfp == NULL) {
// this better not happen.. ever
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p=0; }
strcat(real_name, ".dds");
// try to open the file
ddsfile = cfopen(real_name, "rb");
// file not found
if (ddsfile == NULL)
return DDS_ERROR_INVALID_FILENAME;
} else {
ddsfile = img_cfp;
}
// read the code
code = cfread_int(ddsfile);
// check it
if (code != DDS_FILECODE) {
retval = DDS_ERROR_BAD_HEADER;
goto Done;
}
// read header variables
dds_header.dwSize = cfread_uint(ddsfile);
dds_header.dwFlags = cfread_uint(ddsfile);
dds_header.dwHeight = cfread_uint(ddsfile);
dds_header.dwWidth = cfread_uint(ddsfile);
dds_header.dwPitchOrLinearSize = cfread_uint(ddsfile);
dds_header.dwDepth = cfread_uint(ddsfile);
dds_header.dwMipMapCount = cfread_uint(ddsfile);
// skip over the crap we don't care about
for (i = 0; i < 11; i++)
trash = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwSize = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwFlags = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwFourCC = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwRGBBitCount = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwRBitMask = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwGBitMask = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwBBitMask = cfread_uint(ddsfile);
dds_header.ddpfPixelFormat.dwRGBAlphaBitMask = cfread_uint(ddsfile);
dds_header.ddsCaps.dwCaps1 = cfread_uint(ddsfile);
dds_header.ddsCaps.dwCaps2 = cfread_uint(ddsfile);
// sanity
if (dds_header.dwDepth == 0)
dds_header.dwDepth = 1;
if (dds_header.dwMipMapCount < 1)
dds_header.dwMipMapCount = 1;
d_width = dds_header.dwWidth;
d_height = dds_header.dwHeight;
d_depth = dds_header.dwDepth;
// calculate the type and size of the data
if (dds_header.ddpfPixelFormat.dwFlags & DDPF_FOURCC) {
// did I mention lately that I hate Microsoft?
// this is here to fix the situation where Microsoft doesn't follow their own docs
if ( dds_header.dwPitchOrLinearSize <= 0 ) {
// calculate the block size, mult by 8 for DXT1, 16 for DXT3 & 5
d_size = ((dds_header.dwWidth + 3)/4) * ((dds_header.dwHeight + 3)/4) * ((dds_header.dwDepth + 3)/4) * ((dds_header.ddpfPixelFormat.dwFourCC == FOURCC_DXT1) ? 8 : 16);
} else {
d_size = dds_header.dwPitchOrLinearSize;
}
// if we have mipmaps then compute them into the final size too
for (i = 1; i < (int)dds_header.dwMipMapCount; i++) {
// reduce size by half for the next pass
d_width /= 2;
d_height /= 2;
if (d_width <= 0)
d_width = 1;
if (d_height <= 0)
d_height = 1;
// size of data block (4x4)
d_size += ((d_width + 3) / 4) * ((d_height + 3) / 4) * ((dds_header.ddpfPixelFormat.dwFourCC == FOURCC_DXT1) ? 8 : 16);
}
if ( dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP ) {
if ( !(dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) ) {
retval = DDS_ERROR_CUBEMAP_FACES;
ct = DDS_DXT_INVALID;
goto Done;
}
// it's a valid cubemap, probably
is_cubemap = 1;
// the previously computed size is just per face, mult by 6 for full size
d_size *= 6;
}
Assert( d_size > 0 );
*size = d_size;
switch (dds_header.ddpfPixelFormat.dwFourCC) {
case FOURCC_DXT1:
bits = 24;
ct = (is_cubemap) ? DDS_CUBEMAP_DXT1 : DDS_DXT1;
break;
case FOURCC_DXT3:
bits = 32;
ct = (is_cubemap) ? DDS_CUBEMAP_DXT3 : DDS_DXT3;
break;
case FOURCC_DXT5:
bits = 32;
ct = (is_cubemap) ? DDS_CUBEMAP_DXT5 : DDS_DXT5;
break;
// dxt2 and dxt4 aren't supported
case FOURCC_DXT2:
case FOURCC_DXT4:
retval = DDS_ERROR_UNSUPPORTED;
ct = DDS_DXT_INVALID;
goto Done;
break;
// none of the above
default:
retval = DDS_ERROR_INVALID_FORMAT;
ct = DDS_DXT_INVALID;
goto Done;
break;
}
} else if ( dds_header.ddpfPixelFormat.dwFlags & (DDPF_RGB | DDPF_PALETTEINDEXED8) ) {
d_size += d_width * d_height * d_depth * (dds_header.ddpfPixelFormat.dwRGBBitCount / 8);
// calculate full data size for all mipmap levels
for (i = 1; i < (int)dds_header.dwMipMapCount; i++) {
d_width /= 2;
d_height /= 2;
d_depth /= 2;
if (d_width < 1)
d_width = 1;
if (d_height < 1)
d_height = 1;
if (d_depth < 1)
d_depth = 1;
d_size += d_width * d_height * d_depth * (dds_header.ddpfPixelFormat.dwRGBBitCount / 8);
}
Assert( d_size > 0 );
if ( dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP ) {
if ( !(dds_header.ddsCaps.dwCaps2 & DDSCAPS2_CUBEMAP_ALLFACES) ) {
retval = DDS_ERROR_CUBEMAP_FACES;
ct = DDS_DXT_INVALID;
goto Done;
}
// it's a valid cubemap, probably
is_cubemap = 1;
// the previously computed size is just per face, mult by 6 for full size
d_size *= 6;
}
*size = d_size;
bits = dds_header.ddpfPixelFormat.dwRGBBitCount;
ct = (is_cubemap) ? DDS_CUBEMAP_UNCOMPRESSED : DDS_UNCOMPRESSED;
} else {
// it's not a readable format
retval = DDS_ERROR_INVALID_FORMAT;
goto Done;
}
// we don't support compressed, non-power-of-2 images
if ( (ct != DDS_UNCOMPRESSED) && (!is_power_of_two(dds_header.dwWidth, dds_header.dwHeight)) ) {
retval = DDS_ERROR_NON_POWER_OF_2;
goto Done;
}
// make sure that the video card can handle compressed textures before using them
if ( !Use_compressed_textures && (ct != DDS_UNCOMPRESSED) && (ct != DDS_DXT_INVALID) ) {
retval = DDS_ERROR_NO_COMPRESSION;
goto Done;
}
// stuff important info
if (bpp)
*bpp = bits;
if (compression_type)
*compression_type = ct;
if (width)
*width = dds_header.dwWidth;
if (height)
*height = dds_header.dwHeight;
if (levels)
*levels = dds_header.dwMipMapCount;
if (palette && (bits == 8)) {
cfseek(ddsfile, DDS_OFFSET, CF_SEEK_SET);
cfread(palette, 1, 1024, ddsfile);
}
Done:
if (img_cfp == NULL) {
// close file and return
cfclose(ddsfile);
ddsfile = NULL;
}
return retval;
}
//reads pixel info from a dds file
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp)
{
int retval;
int w,h,ct,lvl;
int size = 0, bits = 0;
CFILE *cfp;
char real_name[MAX_FILENAME_LEN];
// this better not happen.. ever
Assert(filename != NULL);
// make sure there is an extension
strcpy(real_name, filename);
char *p = strchr(real_name, '.');
if (p) { *p = 0; }
strcat(real_name, ".dds");
// open it up and go to the data section
cfp = cfopen(real_name, "rb");
// just in case
if (cfp == NULL)
return DDS_ERROR_INVALID_FILENAME;
// read the header -- if its at this stage, it should be legal.
retval = dds_read_header(real_name, cfp, &w, &h, &bits, &ct, &lvl, &size);
Assert(retval == DDS_ERROR_NONE);
// this really shouldn't be needed but better safe than sorry
if (retval != DDS_ERROR_NONE) {
return retval;
}
cfseek(cfp, DDS_OFFSET, CF_SEEK_SET);
// read in the data
cfread(data, 1, size, cfp);
if (bpp)
*bpp = (ubyte)bits;
// we look done here
cfclose(cfp);
return DDS_ERROR_NONE;
}
// save some image data as a DDS image
// NOTE: we only support, uncompressed, 24-bit RGB and 32-bit RGBA images here!!
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data, int cubemap, char *filename)
{
DDSURFACEDESC2 dds_header;
char real_filename[MAX_FILENAME_LEN];
if (data == NULL) {
Int3();
return;
}
// header size check
if (sizeof(DDSURFACEDESC2) != 124) {
Int3();
return;
}
// not that that's out of the way we can get down to business, constructing a sane filename
memset( &real_filename, 0, sizeof(real_filename) );
int count = os_config_read_uint(NULL, "ImageExportNum", 0);
if (count > 999)
count = 0;
if (filename == NULL) {
if (cubemap) {
sprintf(real_filename, "cubemap%.3d.dds", count++);
} else {
sprintf(real_filename, "image%.3d.dds", count++);
}
os_config_write_uint(NULL, "ImageExportNum", count);
} else {
Assert( strlen(filename) < MAX_FILENAME_LEN-5 );
strcpy(real_filename, filename);
char *p = strchr(real_filename, '.');
if (p) { *p = 0; }
strcat(real_filename, ".dds");
}
CFILE *image = cfopen( real_filename, "wb", CFILE_NORMAL, CF_TYPE_CACHE );
if (image == NULL) {
mprintf(("Unable to open DDS image for saving!!\n"));
return;
}
if (num_mipmaps < 1)
num_mipmaps = 1;
// we have a filename and file handle, so now lets create our DDS header...
memset( &dds_header, 0, sizeof(DDSURFACEDESC2) );
uint flags = (DDSD_CAPS | DDSD_PITCH | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT);
uint pixel_flags = DDPF_RGB;
uint caps1 = DDSCAPS_TEXTURE;
uint caps2 = 0;
if (bpp == 32) {
pixel_flags |= DDPF_ALPHAPIXELS;
}
if (num_mipmaps > 1) {
flags |= DDSD_MIPMAPCOUNT;
caps1 |= (DDSCAPS_COMPLEX | DDSCAPS_MIPMAP);
}
if (cubemap) {
caps1 |= DDSCAPS_COMPLEX;
caps2 |= (DDSCAPS2_CUBEMAP | DDSCAPS2_CUBEMAP_ALLFACES);
}
dds_header.dwSize = 124;
dds_header.dwFlags = flags;
dds_header.dwHeight = height;
dds_header.dwWidth = width;
dds_header.dwPitchOrLinearSize = (width * (bpp >> 3));
dds_header.dwDepth = 0;
dds_header.dwMipMapCount = num_mipmaps;
dds_header.ddpfPixelFormat.dwSize = 32;
dds_header.ddpfPixelFormat.dwFlags = pixel_flags;
dds_header.ddpfPixelFormat.dwFourCC = 0;
dds_header.ddpfPixelFormat.dwRGBBitCount = bpp;
dds_header.ddpfPixelFormat.dwRBitMask = 0x00ff0000;
dds_header.ddpfPixelFormat.dwGBitMask = 0x0000ff00;
dds_header.ddpfPixelFormat.dwBBitMask = 0x000000ff;
dds_header.ddpfPixelFormat.dwRGBAlphaBitMask = (bpp == 32) ? 0xff000000 : 0x00000000;
dds_header.ddsCaps.dwCaps1 = caps1;
dds_header.ddsCaps.dwCaps2 = caps2;
// now save it all...
uint dds_id = DDS_FILECODE;
cfwrite(&dds_id, 1, 4, image);
cfwrite(&dds_header, 1, sizeof(DDSURFACEDESC2), image);
int faces = (cubemap) ? 6 : 1;
int f_width = width;
int f_height = height;
int f_size = 0, f_offset = 0;
// cubemaps are written:
// face 1
// all face 1 mipmaps
// face 2
// all face 2 mipmaps
// ... etc.
for (int i = 0; i < faces; i++) {
for (int j = 0; j < num_mipmaps; j++) {
f_size = (f_width * f_height * (bpp >> 3));
cfwrite(data + f_offset, 1, f_size, image);
// increase offset for next mipmap level
f_offset += f_size;
// half width and height for next mipmap level
f_width /= 2;
f_height /= 2;
if (f_width < 1)
f_width = 1;
if (f_height < 1)
f_height = 1;
}
// reset width and height to original values for the next face
f_width = width;
f_height = height;
}
// done! now lets go get something to eat...
cfclose(image);
}
// returns string representation of DDS_** error code
const char *dds_error_string(int code)
{
switch (code)
{
case DDS_ERROR_NONE:
return "No error";
case DDS_ERROR_INVALID_FILENAME:
return "File not found";
case DDS_ERROR_BAD_HEADER:
return "Filecode did not equal \"DDS \"";
case DDS_ERROR_INVALID_FORMAT:
return "DDS was in an unsupported/unknown format";
case DDS_ERROR_UNSUPPORTED:
return "DDS format was known but is not supported (ie. DXT2/DXT4)";
case DDS_ERROR_NO_COMPRESSION:
return "DDS is compressed but compression support is not enabled";
case DDS_ERROR_NON_POWER_OF_2:
return "Cannot load DDS if not power-of-2";
case DDS_ERROR_CUBEMAP_FACES:
return "Cubemaps must have all 6 faces";
default:
break;
}
//get a warning otherwise
return "Abort, retry, fail?";
}
+157
View File
@@ -0,0 +1,157 @@
//header file to load .dds files
//these use dxtc texture compression
#ifndef __DDS_H
#define __DDS_H
#include "globalincs/pstypes.h"
struct CFILE;
#define DDS_ERROR_NONE 0 // everything went fine
#define DDS_ERROR_INVALID_FILENAME 1 // bad or missing file
#define DDS_ERROR_UNSUPPORTED 2 // a known format but one we don't support
#define DDS_ERROR_INVALID_FORMAT 3 // format that's not supported
#define DDS_ERROR_BAD_HEADER 4 // header was not "DDS "
#define DDS_ERROR_NO_COMPRESSION 5 // file is compressed, compression isn't supported
#define DDS_ERROR_NON_POWER_OF_2 6 // file is not a power of 2 in dimensions
#define DDS_ERROR_CUBEMAP_FACES 7 // file is a cubemap, but doesn't have all six faces
#define DDS_DXT_INVALID -1
#define DDS_UNCOMPRESSED 0
#define DDS_DXT1 1
#define DDS_DXT3 3
#define DDS_DXT5 5
#define DDS_CUBEMAP_UNCOMPRESSED 10
#define DDS_CUBEMAP_DXT1 11
#define DDS_CUBEMAP_DXT3 13
#define DDS_CUBEMAP_DXT5 15
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((uint)(ubyte)(ch0) | ((uint)(ubyte)(ch1) << 8) | \
((uint)(ubyte)(ch2) << 16) | ((uint)(ubyte)(ch3) << 24 ))
#endif //defined(MAKEFOURCC)
// FOURCC codes for DX compressed-texture pixel formats
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
#define DDS_FILECODE 0x20534444 // "DDS " in file
// DDS format stuff ...
#define DDSD_LINEARSIZE 0x00080000
#define DDSD_PITCH 0x00000008
#define DDPF_ALPHAPIXELS 0x00000001
#define DDPF_FOURCC 0x00000004
#define DDPF_PALETTEINDEXED4 0x00000008
#define DDPF_PALETTEINDEXEDTO8 0x00000010
#define DDPF_PALETTEINDEXED8 0x00000020
#define DDPF_RGB 0x00000040
#define DDSD_PIXELFORMAT 0x00001000
#define DDSD_WIDTH 0x00000004
#define DDSD_HEIGHT 0x00000002
#define DDSD_CAPS 0x00000001
#define DDSD_MIPMAPCOUNT 0x00020000
#define DDSCAPS_COMPLEX 0x00000008
#define DDSCAPS_PRIMARYSURFACE 0x00000200
#define DDSCAPS_MIPMAP 0x00400000
#define DDSCAPS_TEXTURE 0x00001000
#define DDSCAPS2_CUBEMAP 0x00000200
#define DDSCAPS2_VOLUME 0x00200000
#define DDSCAPS2_CUBEMAP_POSITIVEX 0x00000400
#define DDSCAPS2_CUBEMAP_NEGATIVEX 0x00000800
#define DDSCAPS2_CUBEMAP_POSITIVEY 0x00001000
#define DDSCAPS2_CUBEMAP_NEGATIVEY 0x00002000
#define DDSCAPS2_CUBEMAP_POSITIVEZ 0x00004000
#define DDSCAPS2_CUBEMAP_NEGATIVEZ 0x00008000
#define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX | \
DDSCAPS2_CUBEMAP_NEGATIVEX | \
DDSCAPS2_CUBEMAP_POSITIVEY | \
DDSCAPS2_CUBEMAP_NEGATIVEY | \
DDSCAPS2_CUBEMAP_POSITIVEZ | \
DDSCAPS2_CUBEMAP_NEGATIVEZ )
#pragma pack(1)
// these structures are the headers for a dds file
/*typedef struct _DDPIXELFORMAT {
uint dwSize;
uint dwFlags;
uint dwFourCC;
uint dwRGBBitCount;
uint dwRBitMask;
uint dwGBitMask;
uint dwBBitMask;
uint dwRGBAlphaBitMask;
} DDPIXELFORMAT;
typedef struct _DDSCAPS2
{
uint dwCaps1;
uint dwCaps2;
uint Reserved[2];
} DDSCAPS2;*/
typedef struct _DDSURFACEDESC2
{
uint dwSize; // size of the DDSURFACEDESC structure
uint dwFlags; // determines what fields are valid
uint dwHeight; // height of surface to be created
uint dwWidth; // width of input surface
uint dwPitchOrLinearSize;
uint dwDepth;
uint dwMipMapCount;
uint dwReserved1[11];
struct {
uint dwSize;
uint dwFlags;
uint dwFourCC;
uint dwRGBBitCount;
uint dwRBitMask;
uint dwGBitMask;
uint dwBBitMask;
uint dwRGBAlphaBitMask;
} ddpfPixelFormat;
struct {
uint dwCaps1;
uint dwCaps2;
uint Reserved[2];
} ddsCaps;
// DDPIXELFORMAT ddpfPixelFormat;
// DDSCAPS2 ddsCaps; // direct draw surface capabilities
uint dwReserved2;
} DDSURFACEDESC2;
#pragma pack()
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
//reads a dds header
//returns one of the error values
//'compression_type' comes back as one of the DDS_DXTC* defines
int dds_read_header(char *filename, CFILE *img_cfp = NULL, int *width = 0, int *height = 0, int *bpp = 0, int *compression_type = 0, int *levels = 0, int *size = 0, ubyte *palette = NULL);
//reads bitmap
//size of the data it stored in size
int dds_read_bitmap(char *filename, ubyte *data, ubyte *bpp = NULL);
// writes a DDS file using given data
void dds_save_image(int width, int height, int bpp, int num_mipmaps, ubyte *data = NULL, int cubemap = 0, char *filename = NULL);
//returns a string from a DDS error code
const char *dds_error_string(int code);
extern int Texture_compression_available;
extern int Use_compressed_textures;
#endif //__DDS_H
@@ -9,13 +9,138 @@
/*
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.32 $
* $Date: 2007-03-22 21:55:01 $
* $Author: taylor $
*
* Code for the pieces of exploding object debris.
*
* $Log: not supported by cvs2svn $
* Revision 2.31 2007/02/20 04:20:10 Goober5000
* the great big duplicate model removal commit
*
* Revision 2.30 2007/02/11 09:22:29 taylor
* remove NO_SOUND
* fix debris recycling
*
* Revision 2.29 2006/12/28 00:59:19 wmcoolmon
* WMC codebase commit. See pre-commit build thread for details on changes.
*
* Revision 2.28 2006/09/11 06:45:39 taylor
* various small compiler warning and strict compiling fixes
*
* Revision 2.27 2006/09/11 06:08:08 taylor
* make Species_info[] and Asteroid_info[] dynamic
*
* Revision 2.26 2006/08/20 00:46:02 taylor
* an int wrap-around issue could (and was) make debris not have electrical arcs (or lighting or sounds) since it would always fail this check
*
* Revision 2.25 2006/07/06 04:06:03 Goober5000
* 1) complete (almost) changeover to reorganized texture mapping system
* 2) finally fix texture animation; textures now animate at the correct speed
* --Goober5000
*
* Revision 2.24 2006/07/04 07:42:48 Goober5000
* --in preparation for fixing an annoying animated texture bug, reorganize the various texture structs and glow point structs and clarify several parts of the texture code :P
* --this breaks animated glow maps, and animated regular maps still aren't fixed, but these will be remedied shortly
* --Goober5000
*
* Revision 2.23 2006/01/26 03:23:29 Goober5000
* pare down the pragmas some more
* --Goober5000
*
* Revision 2.22 2005/12/29 08:08:33 wmcoolmon
* Codebase commit, most notably including objecttypes.tbl
*
* Revision 2.21 2005/10/30 06:44:56 wmcoolmon
* Codebase commit - nebula.tbl, scripting, new dinky explosion/shockwave stuff, moving muzzle flashes
*
* Revision 2.20 2005/10/10 17:21:03 taylor
* remove NO_NETWORK
*
* Revision 2.19 2005/09/25 05:13:05 Goober5000
* hopefully complete species upgrade
* --Goober5000
*
* Revision 2.18 2005/09/24 07:07:15 Goober5000
* another species overhaul
* --Goober5000
*
* Revision 2.17 2005/07/22 10:18:37 Goober5000
* CVS header tweaks
* --Goober5000
*
* Revision 2.16 2005/07/13 02:50:51 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.15 2005/07/13 02:01:28 Goober5000
* fixed a bunch of "issues" caused by me with the species stuff
* --Goober5000
*
* Revision 2.14 2005/07/13 00:44:21 Goober5000
* improved species support and removed need for #define
* --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/27 12:28:32 Goober5000
* clarified max hull/shield strength names and added ship guardian thresholds
* --Goober5000
*
* Revision 2.11 2005/03/02 21:24:43 taylor
* more network/inferno goodness for Windows, takes care of a few warnings too
*
* Revision 2.10 2005/01/30 09:27:39 Goober5000
* nitpicked some boolean tests, and fixed two small bugs
* --Goober5000
*
* Revision 2.9 2004/07/26 20:47:26 Kazan
* remove MCD complete
*
* Revision 2.8 2004/07/12 16:32:44 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.7 2004/07/01 01:52:20 phreak
* function pointer radar update.
* will enable us to make different radar styles that we can switch between
*
* Revision 2.6 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.5 2004/03/05 09:01:59 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.4 2003/10/15 22:03:24 Kazan
* Da Species Update :D
*
* Revision 2.3 2003/04/29 01:03:22 Goober5000
* implemented the custom hitpoints mod
* --Goober5000
*
* Revision 2.2 2003/03/19 12:29:01 unknownplayer
* Woohoo! Killed two birds with one stone!
* Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
*
* 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.4 2002/05/13 21:43:37 mharris
* A little more network and sound cleanup
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* 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
*
@@ -208,31 +333,35 @@
* $NoKeywords: $
*/
#include "3d.h"
#include "bmpman.h"
#include "object.h"
#include "debris.h"
#include "fireballs.h"
#include "radar.h"
#include "missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd.h"
#include "objectsnd.h"
#include "linklist.h"
#include "systemvars.h"
#include "multi.h"
#include "multimsgs.h"
#include "particle.h"
#include "freespace.h"
#include "multiutil.h"
#include "objcollide.h"
#include "timer.h"
#include "debris/debris.h"
#include "render/3d.h"
#include "fireball/fireballs.h"
#include "radar/radar.h"
#include "gamesnd/gamesnd.h"
#include "object/objectsnd.h"
#include "globalincs/linklist.h"
#include "particle/particle.h"
#include "freespace2/freespace.h"
#include "object/objcollide.h"
#include "io/timer.h"
#include "species_defs/species_defs.h"
#include "ship/ship.h"
#include "radar/radarsetup.h"
#include "network/multi.h"
#include "network/multimsgs.h"
#include "network/multiutil.h"
#define MAX_LIFE 10.0f
#define MIN_RADIUS_FOR_PERSISTANT_DEBRIS 50 // ship radius at which debris from it becomes persistant
#define DEBRIS_SOUND_DELAY 2000 // time to start debris sound after created
// limit the number of hull debris chunks that can exist.
#define MAX_HULL_PIECES 10
//#define MAX_HULL_PIECES 10
#define MAX_HULL_PIECES MAX_DEBRIS_PIECES //-WMCD
int Num_hull_pieces; // number of hull pieces in existance
debris Hull_debris_list; // head of linked list for hull debris chunks, for quick search
@@ -244,13 +373,6 @@ int Debris_inited = 0;
int Debris_model = -1;
int Debris_vaporize_model = -1;
int Debris_num_submodels = 0;
char * Debris_texture_files[MAX_SPECIES_NAMES] = {
NOX("debris01a"), // Terran
NOX("debris01b"), // Species B
NOX("debris01c"), // Shivan
};
int Debris_textures[MAX_SPECIES_NAMES];
#define MAX_DEBRIS_DIST 10000.0f // Debris goes away if it's this far away.
#define DEBRIS_DISTANCE_CHECK_TIME (10*1000) // Check every 10 seconds.
@@ -259,7 +381,7 @@ int Debris_textures[MAX_SPECIES_NAMES];
#define MAX_SPEED_SMALL_DEBRIS 200 // maximum velocity of small debris piece
#define MAX_SPEED_BIG_DEBRIS 150 // maximum velocity of big debris piece
#define MAX_SPEED_CAPITAL_DEBRIS 100 // maximum velocity of capital debris piece
#define DEBRIS_SPEED_DEBUG
//#define DEBRIS_SPEED_DEBUG
// ---------------------------------------------------------------------------------------
// debris_start_death_roll()
@@ -318,10 +440,10 @@ void debris_init()
// Page in debris bitmaps at level load
void debris_page_in()
{
int i;
uint i;
Debris_model = model_load( NOX("debris01.pof"), 0, NULL );
if (Debris_model>-1) {
if (Debris_model >= 0) {
polymodel * pm;
pm = model_get(Debris_model);
Debris_num_submodels = pm->n_models;
@@ -329,19 +451,25 @@ void debris_page_in()
Debris_vaporize_model = model_load( NOX("debris02.pof"), 0, NULL );
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
nprintf(( "Paging", "Paging in debris texture '%s'\n", Debris_texture_files[i] ));
Debris_textures[i] = bm_load( Debris_texture_files[i] );
if ( Debris_textures[i] < 0 ) {
Warning( LOCATION, "Couldn't load species %d debris\ntexture, '%s'\n", i, Debris_texture_files[i] );
for (i=0; i<Species_info.size(); i++ )
{
species_info *species = &Species_info[i];
nprintf(( "Paging", "Paging in debris texture '%s'\n", species->debris_texture.filename));
species->debris_texture.bitmap_id = bm_load(species->debris_texture.filename);
if (species->debris_texture.bitmap_id < 0)
{
Warning( LOCATION, "Couldn't load species %s debris\ntexture, '%s'\n", species->species_name, species->debris_texture.filename);
}
bm_page_in_texture( Debris_textures[i] );
bm_page_in_texture(species->debris_texture.bitmap_id);
}
}
MONITOR(NumSmallDebrisRend);
MONITOR(NumHullDebrisRend);
MONITOR(NumSmallDebrisRend)
MONITOR(NumHullDebrisRend)
// ---------------------------------------------------------------------------------------
// debris_render()
@@ -358,19 +486,19 @@ void debris_render(object * obj)
pm = NULL;
num = obj->instance;
Assert(num >= 0 && num < MAX_DEBRIS_PIECES );
Assert(num >= 0 && num < MAX_DEBRIS_PIECES);
db = &Debris[num];
Assert( db->flags & DEBRIS_USED );
Assert(db->flags & DEBRIS_USED);
// Swap in a different texture depending on the species
if ( (db->species > -1) && (db->species < MAX_SPECIES_NAMES) ) {
if (db->species >= 0)
{
pm = model_get( db->model_num );
if ( pm && (pm->n_textures == 1) ) {
swapped = pm->textures[0];
pm->textures[0] = Debris_textures[db->species];
swapped = pm->maps[0].base_map.texture;
pm->maps[0].base_map.texture = Species_info[db->species].debris_texture.bitmap_id;
}
}
@@ -394,7 +522,7 @@ void debris_render(object * obj)
}
if ((swapped!=-1) && pm) {
pm->textures[0] = swapped;
pm->maps[0].base_map.texture = swapped;
}
}
@@ -443,16 +571,23 @@ void maybe_delete_debris(debris *db)
{
object *objp;
if (timestamp_elapsed(db->next_distance_check)) {
if (!(Game_mode & GM_MULTIPLAYER)) { // In single player game, just check against player.
if (timestamp_elapsed(db->next_distance_check) && timestamp_elapsed(db->must_survive_until))
{
if (!(Game_mode & GM_MULTIPLAYER))
{ // In single player game, just check against player.
if (vm_vec_dist_quick(&Player_obj->pos, &Objects[db->objnum].pos) > MAX_DEBRIS_DIST)
db->lifeleft = 0.1f;
else
db->next_distance_check = timestamp(DEBRIS_DISTANCE_CHECK_TIME);
} else {
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) ) {
if (objp->flags & OF_PLAYER_SHIP) {
if (vm_vec_dist_quick(&objp->pos, &Objects[db->objnum].pos) < MAX_DEBRIS_DIST) {
}
else
{
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) )
{
if (objp->flags & OF_PLAYER_SHIP)
{
if (vm_vec_dist_quick(&objp->pos, &Objects[db->objnum].pos) < MAX_DEBRIS_DIST)
{
db->next_distance_check = timestamp(DEBRIS_DISTANCE_CHECK_TIME);
return;
}
@@ -469,8 +604,8 @@ void debris_process_pre( object *objp, float frame_time)
{
}
MONITOR(NumSmallDebris);
MONITOR(NumHullDebris);
MONITOR(NumSmallDebris)
MONITOR(NumHullDebris)
// ---------------------------------------------------------------------------------------
// debris_process_post()
@@ -528,7 +663,7 @@ void debris_process_post(object * obj, float frame_time)
int n, n_arcs = ((rand()>>5) % 3)+1; // Create 1-3 sparks
vector v1, v2, v3, v4;
vec3d v1, v2, v3, v4;
submodel_get_two_random_points( db->model_num, db->submodel_num, &v1, &v2 );
submodel_get_two_random_points( db->model_num, db->submodel_num, &v3, &v4 );
@@ -571,7 +706,7 @@ void debris_process_post(object * obj, float frame_time)
// rotate v2 out of local coordinates into world.
// Use v2 since it is used in every bolt. See above switch().
vector snd_pos;
vec3d snd_pos;
vm_vec_unrotate(&snd_pos, &v2, &obj->orient);
vm_vec_add2(&snd_pos, &obj->pos );
@@ -608,7 +743,7 @@ void debris_process_post(object * obj, float frame_time)
// Maybe move a vertex.... 20% of the time maybe?
int mr = myrand();
if ( mr < RAND_MAX/5 ) {
vector v1, v2;
vec3d v1, v2;
submodel_get_two_random_points( db->model_num, db->submodel_num, &v1, &v2 );
db->arc_pts[i][mr % 2] = v1;
}
@@ -644,7 +779,7 @@ int debris_find_oldest()
}
#define DEBRIS_ROTVEL_SCALE 5.0f
void calc_debris_physics_properties( physics_info *pi, vector *min, vector *max );
void calc_debris_physics_properties( physics_info *pi, vec3d *min, vec3d *max );
// ---------------------------------------------------------------------------------------
// debris_create()
//
@@ -652,20 +787,23 @@ void calc_debris_physics_properties( physics_info *pi, vector *min, vector *max
//
// exp_force: Explosion force, used to assign velocity to pieces.
// 1.0f assigns velocity like before. 2.0f assigns twice as much to non-inherited part of velocity
object *debris_create(object *source_obj, int model_num, int submodel_num, vector *pos, vector *exp_center, int hull_flag, float exp_force)
object *debris_create(object *source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force)
{
int i, n, objnum, parent_objnum;
object *obj;
ship *shipp;
debris *db;
polymodel *pm;
physics_info *pi;
int vaporize;
ship_info *sip = NULL;
parent_objnum = OBJ_INDEX(source_obj);
Assert( (source_obj->type == OBJ_SHIP ) || (source_obj->type == OBJ_GHOST));
Assert( source_obj->instance >= 0 && source_obj->instance < MAX_SHIPS );
shipp = &Ships[source_obj->instance];
sip = &Ship_info[shipp->ship_info_index];
vaporize = (shipp->flags &SF_VAPORIZE);
if ( !hull_flag ) {
@@ -693,26 +831,58 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
break;
}
if ( n == MAX_DEBRIS_PIECES ) {
if (n == MAX_DEBRIS_PIECES) {
n = debris_find_oldest();
if (n >= 0)
debris_start_death_roll(&Objects[Debris[n].objnum], &Debris[n]);
nprintf(("Warning","Frame %i: Could not create debris, no more slots left\n", Framecount));
return NULL;
}
db = &Debris[n];
// Create Debris piece n!
if ( hull_flag ) {
if (rand() < RAND_MAX/6) // Make some pieces blow up shortly after explosion.
db->lifeleft = 2.0f * ((float) myrand()/(float) RAND_MAX) + 0.5f;
else
db->lifeleft = -1.0f; // large hull pieces stay around forever
} else {
db->lifeleft = (i2fl(myrand())/i2fl(RAND_MAX))*2.0f+0.1f;
//WMC - We must survive until now, at least.
db->must_survive_until = timestamp();
if(hull_flag && sip->debris_min_lifetime >= 0.0f && sip->debris_max_lifetime >= 0.0f)
{
db->lifeleft = (( sip->debris_max_lifetime - sip->debris_min_lifetime ) * frand()) + sip->debris_min_lifetime;
}
else
{
// Create Debris piece n!
if ( hull_flag ) {
if (rand() < RAND_MAX/6) // Make some pieces blow up shortly after explosion.
db->lifeleft = 2.0f * ((float) myrand()/(float) RAND_MAX) + 0.5f;
else
db->lifeleft = -1.0f; // large hull pieces stay around forever
} else {
db->lifeleft = (i2fl(myrand())/i2fl(RAND_MAX))*2.0f+0.1f;
}
// increase lifetime for vaporized debris
if (vaporize) {
db->lifeleft *= 3.0f;
}
}
// increase lifetime for vaporized debris
if (vaporize) {
db->lifeleft *= 3.0f;
//WMC - Oh noes, we may need to change lifeleft
if(hull_flag)
{
if(sip->debris_min_lifetime >= 0.0f)
{
db->must_survive_until = timestamp(fl2i(sip->debris_min_lifetime * 1000.0f));
if(db->lifeleft < sip->debris_min_lifetime)
db->lifeleft = sip->debris_min_lifetime;
}
if(sip->debris_max_lifetime >= 0.0f)
{
if(db->lifeleft > sip->debris_max_lifetime)
db->lifeleft = sip->debris_max_lifetime;
}
}
db->flags |= DEBRIS_USED;
db->is_hull = hull_flag;
@@ -727,12 +897,12 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
for (i=0; i<MAX_DEBRIS_ARCS; i++ ) {
db->arc_timestamp[i] = timestamp(-1);
// vector arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
// vec3d arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
}
if ( db->is_hull ) {
// Only make 1/2 of the pieces have arcs
if ( myrand() < RAND_MAX*2/3 ) {
if ( myrand() < RAND_MAX_2 ) {
db->arc_frequency = 1000;
} else {
db->arc_frequency = 0;
@@ -771,10 +941,12 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
db->objnum = objnum;
obj = &Objects[objnum];
pi = &obj->phys_info;
// assign the network signature. The signature will be 0 for non-hull pieces, but since that
// is our invalid signature, it should be okay.
obj->net_signature = 0;
if ( (Game_mode & GM_MULTIPLAYER) && hull_flag ) {
obj->net_signature = multi_get_next_network_signature( MULTI_SIG_DEBRIS );
}
@@ -782,13 +954,13 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
// -- No long need shield: bset_shield_strength(obj, 100.0f); // Hey! Set to some meaningful value!
if (source_obj->type == OBJ_SHIP) {
obj->hull_strength = Ship_info[Ships[source_obj->instance].ship_info_index].initial_hull_strength/8.0f;
obj->hull_strength = Ships[source_obj->instance].ship_max_hull_strength/8.0f;
} else
obj->hull_strength = 10.0f;
Num_debris_pieces++;
vector rotvel, radial_vel, to_center;
vec3d rotvel, radial_vel, to_center;
if ( exp_center )
vm_vec_sub( &to_center,pos, exp_center );
@@ -804,7 +976,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
// set up physics mass and I_inv for hull debris pieces
pm = model_get(model_num);
vector *min, *max;
vec3d *min, *max;
min = &pm->submodel[submodel_num].min;
max = &pm->submodel[submodel_num].max;
calc_debris_physics_properties( &obj->phys_info, min, max );
@@ -843,40 +1015,15 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
// DA: here we need to vel_from_rot = w x to_center, where w is world is unrotated to world coords and offset is the
// displacement fromt the center of the parent object to the center of the debris piece
vector world_rotvel, vel_from_rotvel;
vec3d world_rotvel, vel_from_rotvel;
vm_vec_unrotate ( &world_rotvel, &source_obj->phys_info.rotvel, &source_obj->orient );
vm_vec_crossprod ( &vel_from_rotvel, &world_rotvel, &to_center );
vm_vec_scale ( &vel_from_rotvel, DEBRIS_ROTVEL_SCALE);
vm_vec_add (&obj->phys_info.vel, &radial_vel, &source_obj->phys_info.vel);
vm_vec_add2(&obj->phys_info.vel, &vel_from_rotvel);
vm_vec_add (&pi->vel, &radial_vel, &source_obj->phys_info.vel);
vm_vec_add2(&pi->vel, &vel_from_rotvel);
#ifdef DEBRIS_SPEED_DEBUG
// check that debris is not created with too high a velocity
if (hull_flag) {
int ship_info_flag = Ship_info[Ships[source_obj->instance].ship_info_index].flags;
if (ship_info_flag & (SIF_SMALL_SHIP | SIF_NOT_FLYABLE | SIF_HARMLESS)) {
if (vm_vec_mag_squared(&obj->phys_info.vel) > MAX_SPEED_SMALL_DEBRIS*MAX_SPEED_SMALL_DEBRIS) {
float scale = MAX_SPEED_SMALL_DEBRIS / vm_vec_mag(&obj->phys_info.vel);
vm_vec_scale(&obj->phys_info.vel, scale);
}
} else if (ship_info_flag & SIF_BIG_SHIP) {
if (vm_vec_mag_squared(&obj->phys_info.vel) > MAX_SPEED_BIG_DEBRIS*MAX_SPEED_BIG_DEBRIS) {
float scale = MAX_SPEED_BIG_DEBRIS / vm_vec_mag(&obj->phys_info.vel);
vm_vec_scale(&obj->phys_info.vel, scale);
}
} else if (ship_info_flag & SIF_HUGE_SHIP) {
if (vm_vec_mag_squared(&obj->phys_info.vel) > MAX_SPEED_CAPITAL_DEBRIS*MAX_SPEED_CAPITAL_DEBRIS) {
float scale = MAX_SPEED_CAPITAL_DEBRIS / vm_vec_mag(&obj->phys_info.vel);
vm_vec_scale(&obj->phys_info.vel, scale);
}
} else {
Warning(LOCATION, "Ship has info flag that is not among the following: SMALL, NOT_FLYABLE, HARMLESS, BIG, CAPITAL, SUPERCAP");
}
}
#endif
// vm_vec_scale_add(&obj->phys_info.vel, &radial_vel, &source_obj->phys_info.vel, frand()/2.0f + 0.5f);
// vm_vec_scale_add(&pi->vel, &radial_vel, &source_obj->phys_info.vel, frand()/2.0f + 0.5f);
// nprintf(("Andsager","object vel from rotvel: %0.2f, %0.2f, %0.2f\n",vel_from_rotvel.x, vel_from_rotvel.y, vel_from_rotvel.z));
// make sure rotational velocity does not get too high
@@ -889,26 +1036,81 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
vm_vec_rand_vec_quick(&rotvel);
vm_vec_scale(&rotvel, scale);
obj->phys_info.flags |= PF_DEAD_DAMP;
obj->phys_info.rotvel = rotvel;
pi->flags |= PF_DEAD_DAMP;
pi->rotvel = rotvel;
check_rotvel_limit( &obj->phys_info );
// check that debris is not created with too high a velocity
if (hull_flag)
{
if(sip->debris_min_speed >= 0.0f && sip->debris_max_speed >= 0.0f)
{
float debris_speed = (( sip->debris_max_speed - sip->debris_min_speed ) * frand()) + sip->debris_min_speed;
float scale = debris_speed / vm_vec_mag(&pi->vel);
vm_vec_scale(&pi->vel, scale);
}
else if(sip->debris_min_speed >= 0.0f)
{
float curspeed = vm_vec_mag(&pi->vel);
if(curspeed < sip->debris_min_speed)
{
float scale = sip->debris_min_speed / curspeed;
vm_vec_scale(&pi->vel, scale);
}
}
else if(sip->debris_max_speed >= 0.0f)
{
float curspeed = vm_vec_mag(&pi->vel);
if(curspeed > sip->debris_max_speed)
{
float scale = sip->debris_max_speed / curspeed;
vm_vec_scale(&pi->vel, scale);
}
}
//WMC - Rotational velocity user cap
if(sip->debris_min_rotspeed >= 0.0f && sip->debris_max_rotspeed >= 0.0f)
{
float debris_rotspeed = (( sip->debris_max_rotspeed - sip->debris_min_rotspeed ) * frand()) + sip->debris_min_rotspeed;
float scale = debris_rotspeed / vm_vec_mag(&pi->rotvel);
vm_vec_scale(&pi->rotvel, scale);
}
else if(sip->debris_min_rotspeed >= 0.0f)
{
float curspeed = vm_vec_mag(&pi->rotvel);
if(curspeed < sip->debris_min_rotspeed)
{
float scale = sip->debris_min_rotspeed / curspeed;
vm_vec_scale(&pi->rotvel, scale);
}
}
else if(sip->debris_max_rotspeed >= 0.0f)
{
float curspeed = vm_vec_mag(&pi->rotvel);
if(curspeed > sip->debris_max_rotspeed)
{
float scale = sip->debris_max_rotspeed / curspeed;
vm_vec_scale(&pi->rotvel, scale);
}
}
}
// 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.flags |= (PF_REDUCED_DAMP | PF_DEAD_DAMP); // set damping equal for all axis and not changable
pi->rotdamp = 10000.0f;
pi->side_slip_time_const = 10000.0f;
pi->flags |= (PF_REDUCED_DAMP | PF_DEAD_DAMP); // set damping equal for all axis and not changable
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
vm_vec_zero(&pi->max_vel); // make so he can't turn on his own VOLITION anymore.
vm_vec_zero(&pi->max_rotvel); // make so he can't change speed on his own VOLITION anymore.
// ensure vel is valid
Assert( !vm_is_vec_nan(&obj->phys_info.vel) );
Assert( !vm_is_vec_nan(&pi->vel) );
// if ( hull_flag ) {
// vm_vec_zero(&obj->phys_info.vel);
// vm_vec_zero(&obj->phys_info.rotvel);
// vm_vec_zero(&pi->vel);
// vm_vec_zero(&pi->rotvel);
// }
return obj;
@@ -920,7 +1122,7 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
// Alas, poor debris_obj got whacked. Fortunately, we know who did it, where and how hard, so we
// can do something about it.
//
void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float damage)
void debris_hit(object *debris_obj, object *other_obj, vec3d *hitpos, float damage)
{
debris *debris_p = &Debris[debris_obj->instance];
@@ -932,7 +1134,7 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
pe.pos = *hitpos; // Where the particles emit from
pe.vel = debris_obj->phys_info.vel; // Initial velocity of all the particles
vector tmp_norm;
vec3d tmp_norm;
vm_vec_sub( &tmp_norm, hitpos, &debris_obj->pos );
vm_vec_normalize_safe(&tmp_norm);
@@ -949,7 +1151,8 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
pe.max_vel = 10.0f; // How fast the fastest particle can move
pe.min_life = 0.25f; // How long the particles live
pe.max_life = 0.75f; // How long the particles live
particle_emit( &pe, PARTICLE_FIRE, 0 );
pe.texture_id = particle_get_fire_id();
particle_emit( &pe );
}
// multiplayer clients bail here
@@ -980,9 +1183,7 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
// NOTE: debris_hit_info pointer NULL for debris:weapon collision, otherwise debris:ship collision.
// Return true if hit, else return false.
//
#pragma warning ( push )
#pragma warning ( disable : 4701 )
int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, collision_info_struct *debris_hit_info)
int debris_check_collision(object *pdebris, object *other_obj, vec3d *hitpos, collision_info_struct *debris_hit_info)
{
mc_info mc;
int num;
@@ -1023,7 +1224,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
object *heavy_obj = heavy;
object *light_obj = light;
vector zero, p0, p1;
vec3d zero, p0, p1;
vm_vec_zero(&zero);
vm_vec_sub(&p0, &light->last_pos, &heavy->last_pos);
vm_vec_sub(&p1, &light->pos, &heavy->pos);
@@ -1033,7 +1234,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
mc.p1 = &p1; // Point 2 of ray to check
// find the light object's position in the heavy object's reference frame at last frame and also in this frame.
vector p0_temp, p0_rotated;
vec3d p0_temp, p0_rotated;
// Collision detection from rotation enabled if at rotaion is less than 30 degree in frame
// This should account for all ships
@@ -1053,14 +1254,14 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
int mc_ret_val = 0;
if ( debris_hit_info->heavy == ship_obj ) { // ship is heavier, so debris is sphere. Check sphere collision against ship poly model
mc.model_num = Ships[ship_obj->instance].modelnum; // Fill in the model to check
mc.model_num = Ship_info[Ships[ship_obj->instance].ship_info_index].model_num; // Fill in the model to check
mc.orient = &ship_obj->orient; // The object's orient
mc.radius = pdebris->radius;
mc.flags = (MC_CHECK_MODEL | MC_CHECK_SPHERELINE);
// copy important data
int copy_flags = mc.flags; // make a copy of start end positions of sphere in big ship RF
vector copy_p0, copy_p1;
vec3d copy_p0, copy_p1;
copy_p0 = *mc.p0;
copy_p1 = *mc.p1;
@@ -1084,10 +1285,11 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
model_get_rotating_submodel_list(submodel_list, &num_rotating_submodels, heavy_obj);
// Get polymodel and turn off all rotating submodels, collide against only 1 at a time.
pm = model_get(Ships[heavy_obj->instance].modelnum);
pm = model_get(Ship_info[Ships[heavy_obj->instance].ship_info_index].model_num);
// turn off all rotating submodels and test for collision
for (int i=0; i<num_rotating_submodels; i++) {
int i;
for (i=0; i<num_rotating_submodels; i++) {
pm->submodel[submodel_list[i]].blown_off = 1;
}
@@ -1130,7 +1332,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
}
// find position in submodel RF of light object at collison
vector int_light_pos, diff;
vec3d int_light_pos, diff;
vm_vec_sub(&diff, mc.p1, mc.p0);
vm_vec_scale_add(&int_light_pos, mc.p0, &diff, mc.hit_dist);
model_find_world_point(&debris_hit_info->light_collision_cm_pos, &int_light_pos, mc.model_num, mc.hit_submodel, &heavy_obj->orient, &zero);
@@ -1162,7 +1364,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
}
// find position in submodel RF of light object at collison
vector diff;
vec3d diff;
vm_vec_sub(&diff, mc.p1, mc.p0);
vm_vec_scale_add(&debris_hit_info->light_collision_cm_pos, mc.p0, &diff, mc.hit_dist);
@@ -1178,7 +1380,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
mc.submodel_num = Debris[num].submodel_num;
model_clear_instance( mc.model_num );
mc.orient = &pdebris->orient; // The object's orient
mc.radius = model_get_core_radius( Ships[ship_obj->instance].modelnum );
mc.radius = model_get_core_radius(Ship_info[Ships[ship_obj->instance].ship_info_index].model_num);
// check for collision between debris model and ship sphere
mc.flags = (MC_CHECK_MODEL | MC_SUBMODEL | MC_CHECK_SPHERELINE);
@@ -1194,7 +1396,7 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
}
// find position in submodel RF of light object at collison
vector diff;
vec3d diff;
vm_vec_sub(&diff, mc.p1, mc.p0);
vm_vec_scale_add(&debris_hit_info->light_collision_cm_pos, mc.p0, &diff, mc.hit_dist);
@@ -1228,8 +1430,6 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
return 0;
}
}
#pragma warning ( pop )
// ---------------------------------------------------------------------------------------
// debris_get_team()
@@ -1244,28 +1444,26 @@ int debris_get_team(object *objp)
}
// fills in debris physics properties when created, specifically mass and moment of inertia
void calc_debris_physics_properties( physics_info *pi, vector *mins, vector *maxs )
void calc_debris_physics_properties( physics_info *pi, vec3d *mins, vec3d *maxs )
{
float dx, dy, dz, mass;
dx = maxs->x - mins->x;
dy = maxs->y - mins->y;
dz = maxs->z - mins->z;
dx = maxs->xyz.x - mins->xyz.x;
dy = maxs->xyz.y - mins->xyz.y;
dz = maxs->xyz.z - mins->xyz.z;
// John, with new bspgen, just set pi->mass = mass
mass = 0.12f * dx * dy * dz;
pi->mass = (float) pow(mass, 0.6666667f) * 4.65f;
pi->I_body_inv.rvec.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
pi->I_body_inv.rvec.y = 0.0f;
pi->I_body_inv.rvec.z = 0.0f;
pi->I_body_inv.vec.rvec.xyz.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
pi->I_body_inv.vec.rvec.xyz.y = 0.0f;
pi->I_body_inv.vec.rvec.xyz.z = 0.0f;
pi->I_body_inv.uvec.x = 0.0f;
pi->I_body_inv.uvec.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
pi->I_body_inv.uvec.z = 0.0f;
pi->I_body_inv.vec.uvec.xyz.x = 0.0f;
pi->I_body_inv.vec.uvec.xyz.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
pi->I_body_inv.vec.uvec.xyz.z = 0.0f;
pi->I_body_inv.fvec.x = 0.0f;
pi->I_body_inv.fvec.y = 0.0f;
pi->I_body_inv.fvec.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
pi->I_body_inv.vec.fvec.xyz.x = 0.0f;
pi->I_body_inv.vec.fvec.xyz.y = 0.0f;
pi->I_body_inv.vec.fvec.xyz.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
}
@@ -9,13 +9,33 @@
/*
* $Logfile: /Freespace2/code/Debris/Debris.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2006-12-28 00:59:19 $
* $Author: wmcoolmon $
*
* Code for the pieces of exploding object debris.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2005/07/13 02:50:51 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
*
@@ -141,6 +161,8 @@
#ifndef _DEBRIS_H
#define _DEBRIS_H
#include "globalincs/pstypes.h"
struct object;
struct CFILE;
@@ -155,6 +177,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
@@ -165,7 +188,7 @@ typedef struct debris {
fix time_started; // time when debris was created
int next_distance_check; // timestamp to determine whether to delete this piece of debris.
vector arc_pts[MAX_DEBRIS_ARCS][2]; // The endpoints of each arc
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
@@ -177,11 +200,7 @@ typedef struct debris {
#define DEBRIS_EXPIRE (1<<1) // debris can expire (ie hull chunks from small ships)
#ifdef FS2_DEMO
#define MAX_DEBRIS_PIECES 48
#else
#define MAX_DEBRIS_PIECES 64
#endif
#define MAX_DEBRIS_PIECES 64
extern debris Debris[MAX_DEBRIS_PIECES];
@@ -194,9 +213,9 @@ 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, vector *pos, vector *exp_center, int hull_flag, float exp_force );
int debris_check_collision( object * obj, object * other_obj, vector * hitpos, collision_info_struct *debris_hit_info=NULL );
void debris_hit( object * debris_obj, object * other_obj, vector * hitpos, float damage );
object *debris_create( object * source_obj, int model_num, int submodel_num, vec3d *pos, vec3d *exp_center, int hull_flag, float exp_force );
int debris_check_collision( object * obj, object * other_obj, vec3d * hitpos, collision_info_struct *debris_hit_info=NULL );
void debris_hit( object * debris_obj, object * other_obj, vec3d * hitpos, float damage );
int debris_get_team(object *objp);
void debris_clear_expired_flag(debris *db);
@@ -9,13 +9,44 @@
/*
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2007-02-18 21:26:50 $
* $Author: Goober5000 $
*
* Routines for managing the debug console window.
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2006/09/08 06:20:14 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
*
@@ -101,14 +132,14 @@
#include <setjmp.h>
#include <string.h>
#include "pstypes.h"
#include "freespace.h"
#include "font.h"
#include "timer.h"
#include "2d.h"
#include "key.h"
#include "alphacolors.h"
#include "osapi.h"
#include "globalincs/pstypes.h"
#include "graphics/font.h"
#include "io/timer.h"
#include "io/key.h"
#include "globalincs/alphacolors.h"
#include "osapi/osapi.h"
#include "debugconsole/dbugfile.h"
#define MAX_COMMANDS 300
@@ -188,11 +219,11 @@ int command_scroll = 0;
///=========================== SCANNER =======================
typedef enum {
LETTER, QUOTE, SPECIAL, EOF_CODE, DIGIT,
LETTER, QUOTE, SPECIAL, EOF_CODE, DIGIT
} CHAR_CODE;
typedef enum {
NO_TOKEN, IDENTIFIER, NUMBER, STRING,
NO_TOKEN, IDENTIFIER, NUMBER, STRING
} TOKEN_CODE;
@@ -451,6 +482,11 @@ void debug_do_command(char * command)
dc_get_arg( ARG_ANY );
}
if ( !stricmp( Dc_arg, "xyzzy" ) ) {
dc_printf("Nothing happens.\n");
return;
}
if ( !strcmp( Dc_arg, "?" ) ) {
mode = 1;
dc_get_arg( ARG_ANY );
@@ -607,7 +643,7 @@ void debug_output( char c )
void dc_printf(char *format, ...)
{
char tmp[DCOLS*2];
char tmp[DCOLS*DROWS];
va_list args;
va_start(args, format);
@@ -615,7 +651,7 @@ void dc_printf(char *format, ...)
va_end(args);
char *p = tmp;
while( *p ) {
while( *p != '\0' ) {
debug_output(*p);
p++;
}
+406
View File
@@ -0,0 +1,406 @@
#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
@@ -0,0 +1,66 @@
#ifndef _DBUGFILE_HEADER_
#define _DBUGFILE_HEADER_
#define MAX_COUNTERS 10
void dbugfile_init();
void dbugfile_deinit();
void dbugfile_sprintf(int line, char *file, const char *format, ...);
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text);
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text);
void dbugfile_print_counter(int line, char *file, int counter_num, char *string);
#ifdef DBUGFILE_ACTIVE
#define DBUGFILE_INIT() dbugfile_init();
#define DBUGFILE_DEINIT() dbugfile_deinit();
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f);
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h,i);
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) dbugfile_print_matrix_3x3(__LINE__, __FILE__, m,t);
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) dbugfile_print_matrix_4x4(__LINE__, __FILE__, m,t);
extern int dbugfile_counters[MAX_COUNTERS];
#define DBUGFILE_INC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]++;
#define DBUGFILE_DEC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]--;
#define DBUGFILE_OUTPUT_COUNTER(n,s) dbugfile_print_counter(__LINE__, __FILE__, n, s);
#else
#define DBUGFILE_INIT() ;
#define DBUGFILE_DEINIT() ;
#define DBUGFILE_OUTPUT_0(t) ;
#define DBUGFILE_OUTPUT_1(t,a) ;
#define DBUGFILE_OUTPUT_2(t,a,b) ;
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) ;
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) ;
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) ;
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) ;
#define DBUGFILE_INC_COUNTER(n) ;
#define DBUGFILE_DEC_COUNTER(n) ;
#define DBUGFILE_OUTPUT_COUNTER(n,s) ;
#endif
#endif
+226
View File
@@ -0,0 +1,226 @@
/*
* Code created by Thomas Whittaker (RT) for a FreeSpace 2 source code project
*
* You may not sell or otherwise commercially exploit the source or things you
* created based on the source.
*
*/
/*
* This module is intended as a debug tool to measure the speed of blocks of code and display
* that information as coloured bars across the top of the screen.
*
* This allows interactive measuring of components of the code, very useful for optimisztion.
*/
#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#endif
#include "timerbar.h"
#include "globalincs/pstypes.h"
// Internal structure for handling frame data
typedef struct
{
LARGE_INTEGER start_value;
LARGE_INTEGER total_value;
LARGE_INTEGER average;
LARGE_INTEGER frame_total;
} timerbar_profile;
timerbar_profile profiles[MAX_NUM_TIMERBARS];
int timerbar_current_profile = 0;
LARGE_INTEGER timerbar_ultimate_start_value;
LARGE_INTEGER timerbar_last_start_value;
// Data needed for push and pop functionality
const int MAX_TB_STACK_SIZE = 100;
int timerbar_stack[MAX_TB_STACK_SIZE];
int timerbar_current_stack_layer = 0;
/*
*
*
*
*/
void timerbar_push(int value)
{
if(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE)
{
// To many pushs, this must be a bug
// Someone is letting code miss the pops, check for early retuns
Assert(!(timerbar_current_stack_layer >= MAX_TB_STACK_SIZE));
return;
}
timerbar_stack[timerbar_current_stack_layer] = timerbar_current_profile;
timerbar_current_stack_layer++;
timerbar_switch_type(value);
}
/*
*
*
*
*/
void timerbar_pop()
{
timerbar_current_stack_layer--;
if(timerbar_current_stack_layer < 0)
{
Assert(!(timerbar_current_stack_layer < 0));
timerbar_current_stack_layer = 0;
return;
}
timerbar_switch_type(timerbar_stack[timerbar_current_stack_layer]);
}
// This pointer holds the draw function to use or NULL
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
void timerbar_start_frame()
{
timerbar_current_stack_layer = 0;
timerbar_current_profile = 0;
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
draw_func_ptr = NULL;
}
timerbar_last_start_value = timerbar_ultimate_start_value;
}
// Constants need for timerbar_conv_and_draw calculations
const int WIDTH = 480;
const float WIDTHF = ((float) WIDTH) * 1.01f;
/**
* Internal conversion function to convert draw data into bars for the screen
*
* @param int colour - colour index (>=0)
* @param int xpos - x position to start bar on
* @param int xwidth - width of bar
* @param int yrow - Index of row bar belongs to
*/
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
{
float fxpos = (float) xpos;
float fxwidth = (float) xwidth;
draw_func_ptr(colour,
fxpos / WIDTHF,
yrow * 0.01f,
fxwidth / WIDTHF,
0.005f);
}
void timerbar_end_frame()
{
// Now we want to draw the bars
if(draw_func_ptr == NULL)
{
// we have not been given a draw function so we are going to have to quit
return;
}
timerbar_switch_type(-1);
int last_xpos = 0;
int y_pos = 0;
for(int i = 0; i < MAX_NUM_TIMERBARS; i++)
{
// Nothing to render this frame
if(profiles[i].frame_total.QuadPart == 0)
{
continue;
}
int xsize = (int) profiles[i].frame_total.QuadPart / 90;
// break condition in else
while(1)
{
// if bar runs over
if(last_xpos + xsize > WIDTH)
{
int rem_len = WIDTH - last_xpos;
// Draw from current position to the end of the bar
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
xsize -= rem_len;
last_xpos = 0;
y_pos++;
}
else
{
// Draw whats left and break for the next bar
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
last_xpos += xsize;
break;
}
}
// reset for next frame
profiles[i].frame_total.QuadPart = 0;
}
}
void timerbar_switch_type(int num)
{
if(num >= MAX_NUM_TIMERBARS)
{
return;
}
// Calculate old profile's total
LARGE_INTEGER now;
if(QueryPerformanceCounter(&now) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
profiles[timerbar_current_profile].frame_total.QuadPart +=
(now.QuadPart - timerbar_last_start_value.QuadPart);
if(num != -1)
{
// Switch to new profile
timerbar_current_profile = num;
}
// Update time to count from
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
{
// DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
}
/**
* @param void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h) - pointer to draw function
*
* Sets the draw function used to output the timer data, designed to be generic allowing any API
* to take advantage of this module. Set to NULL to disable drawing.
*
* By default the draw function is set to NULL
*/
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
{
draw_func_ptr = new_draw_func_ptr;
}
+87
View File
@@ -0,0 +1,87 @@
/*
* Code created by Thomas Whittaker (RT) for a FreeSpace 2 source code project
*
* You may not sell or otherwise commercially exploit the source or things you
* created based on the source.
*
*/
/*
* $Logfile: /Freespace2/code/debugconsole/timerbar.h $
* $Revision: 1.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_
const int MAX_NUM_TIMERBARS = 20;
#include "cmdline/cmdline.h"
// These functions should never be used directly, always use macros below
void timerbar_start_frame();
void timerbar_end_frame();
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
void timerbar_push(int value);
void timerbar_pop();
// This function shouldnt not be used any more or it will break push and pop calls
void timerbar_switch_type(int num);
#define TIMERBAR_SET_DRAW_FUNC(f) if (Cmdline_timerbar) timerbar_set_draw_func(f);
#define TIMERBAR_START_FRAME() if (Cmdline_timerbar) timerbar_start_frame();
#define TIMERBAR_END_FRAME() if (Cmdline_timerbar) timerbar_end_frame();
#define TIMERBAR_SWITCH_TYPE(n) if (Cmdline_timerbar) timerbar_switch_type(n);
#define TIMERBAR_PUSH(v) if (Cmdline_timerbar) timerbar_push(v);
#define TIMERBAR_POP() if (Cmdline_timerbar) timerbar_pop();
#endif
File diff suppressed because it is too large. Load diff
+129
View File
@@ -0,0 +1,129 @@
//header file for making decals-Bobboau
#ifndef _DECAL_H
#define _DECAL_H
#include "object/object.h"
#include "globalincs/pstypes.h"
//#include "ship/ship.h"
#ifdef ENABLE_DECALS
#define MAX_DECAL_POLY 40
#define MAX_DECAL_POLY_POINT 10
#define MAX_DECAL_DEFPOINTS 10000
#define MAX_DECAL_POINT 10
#define MAX_SHIP_DECALS 25
#define MAX_GLOBAL_DECAL_POLYS 11000
#define QUICKFIND_SUBDIVISION 100
#define QUICKFIND_SEGMENT_LENGTH (MAX_GLOBAL_DECAL_POLYS/QUICKFIND_SUBDIVISION)
#define MAX_GLOBAL_DECALS 5000
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
#endif // ENABLE_DECALS
struct decal;
struct decal_list;
struct decal_list_controle;
struct decal_poly{
vec3d norm[3];
vertex point[3];
decal_poly *next;
decal* parent;
int idx;
};
struct decal{
int n_poly;
int timestamp; //when this decal was created
int burn_time; //how long it takes for the glow texture to fade
int vertex_buffer_start; //were is the start of this decal's polys in the vertex buffer
decal_poly* poly;
decal_poly* add_poly();
decal_poly* get_last_poly();
void remove_last_poly();
decal_list_controle *parent;
};
struct decal_list{
decal dec;
decal_list *next;
};
struct decal_item{
decal_list dec;
bool used;
};
struct decal_list_controle{
int n_decals;
int buffer;
int texture;
int n_poly;
int burn_texture;
int glow_texture;
bool modifyed;
decal_list *d_list;
decal_list *end;
decal_list *add_new();
void trim();
void clear();
~decal_list_controle();
decal_list_controle();
};
struct decal_system{
decal_list_controle *decals;
int n_decal_textures;
bool decals_modified;
int max_decals;
decal_system():decals(NULL),n_decal_textures(0),decals_modified(false){};
};
//this is used to give all the data to the generation data to the functions that make them
struct decal_point{
vec3d pnt;
matrix orient;
float radius;
};
#ifdef ENABLE_DECALS
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000);//makes the decal
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
void decal_render_all(object * obj); //renders all decals
int decal_create_sub(void *model_ptr);
void clear_decals(decal_system *system);
void init_decals();
#else // ENABLE_DECALS
inline int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1, int glow_texture = -1, int burn_texture = -1, int burn_time = 1000)
{
return 0;
}
#define decal_create_simple(a, b, c) (0)
#define decal_render_all(a)
#define decal_create_sub(a) (0);
#define clear_decals(a)
#define init_decals()
#endif // ENABLE_DECALS
#endif // _DECAL_H
@@ -9,12 +9,46 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.11 $
* $Date: 2007-09-02 18:53:22 $
* $Author: Goober5000 $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.10 2006/07/09 01:55:41 Goober5000
* consolidate the "for reals" crap into a proper ship flag; also move the limbo flags over to SF2_*; etc.
* this should fix Mantis #977
* --Goober5000
*
* Revision 2.8 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.7 2005/04/05 05:53:15 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.6 2005/01/31 23:27:52 taylor
* merge with Linux/OSX tree - p0131-2
*
* Revision 2.5 2004/07/26 20:47:27 Kazan
* remove MCD complete
*
* Revision 2.4 2004/07/12 16:32:45 Kazan
* MCD - define _MCD_CHECK to use memory tracking
*
* Revision 2.3 2004/03/05 09:01:59 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* 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.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -41,20 +75,21 @@
* $NoKeywords: $
*/
#include "demo.h"
#include "missionload.h"
#include "ship.h"
#include "linklist.h"
#include "freespace.h"
#include "object.h"
#include "timer.h"
#include "gamesequence.h"
#include "systemvars.h"
#include "cfile.h"
#include "missionmessage.h"
#include "missionparse.h"
#include "shipfx.h"
#include "shiphit.h"
#include "demo/demo.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
#include "globalincs/linklist.h"
#include "freespace2/freespace.h"
#include "object/object.h"
#include "io/timer.h"
#include "gamesequence/gamesequence.h"
#include "mission/missionmessage.h"
#include "mission/missionparse.h"
#include "ship/shipfx.h"
#include "ship/shiphit.h"
#include "cfile/cfile.h"
// -----------------------------------------------------------------------------------------------------------------------------
// DEMO DEFINES/VARS
@@ -131,7 +166,7 @@ int Demo_error = DEMO_ERROR_NONE;
#define DEMO_BYTE(vl) do { DEMO_DATA(vl, sizeof(char)); } while(0)
#define DEMO_UBYTE(vl) do { DEMO_DATA(vl, sizeof(ubyte)); } while(0)
#define DEMO_FLOAT(vl) do { DEMO_DATA(vl, sizeof(float)); } while(0)
#define DEMO_VECTOR(vl) do { DEMO_DATA(vl, sizeof(vector)); } while(0)
#define DEMO_VECTOR(vl) do { DEMO_DATA(vl, sizeof(vec3d)); } while(0)
#define DEMO_MATRIX(vl) do { DEMO_DATA(vl, sizeof(matrix)); } while(0)
#define DEMO_STRING(vl) do { int stlen; if(Game_mode & GM_DEMO_RECORD){ stlen = strlen(vl); if(stlen <= 0){ break; } DEMO_DATA(stlen, sizeof(ushort)); DEMO_DATA(*vl, strlen(vl)); } else { ushort len = 0; DEMO_USHORT(len); DEMO_DATA(*vl, len); vl[len] = '\0'; } } while(0)
@@ -278,7 +313,7 @@ int demo_start_record(char *file)
char full_name[MAX_FILENAME_LEN] = "";
// try and allocate the buffer
Demo_buf = (char*)malloc(DEMO_BUF_SIZE);
Demo_buf = (char*)vm_malloc(DEMO_BUF_SIZE);
if(Demo_buf == NULL){
DEMO_ERROR(DEMO_ERROR_DISK_ACCESS);
return 0;
@@ -322,7 +357,7 @@ int demo_start_playback(char *file)
char full_name[MAX_FILENAME_LEN] = "";
// try and allocate the buffer
Demo_buf = (char*)malloc(DEMO_BUF_SIZE);
Demo_buf = (char*)vm_malloc(DEMO_BUF_SIZE);
if(Demo_buf == NULL){
DEMO_ERROR(DEMO_ERROR_DISK_ACCESS);
return 0;
@@ -372,7 +407,7 @@ void demo_close()
// free the buffer
if(Demo_buf != NULL){
free(Demo_buf);
vm_free(Demo_buf);
Demo_buf = NULL;
}
@@ -810,7 +845,7 @@ int demo_playback_seek_sub(int frame_size)
ushort obj_count = 0;
int obj_sig = 0;
ubyte team = 0;
vector obj_pos = vmd_zero_vector;
vec3d obj_pos = vmd_zero_vector;
matrix obj_orient = vmd_identity_matrix;
float obj_fthrust = 0;
int ship_index = 0;
@@ -975,7 +1010,7 @@ int demo_playback_seek_sub(int frame_size)
ship_index = ship_get_by_signature(obj_sig);
if(ship_index >= 0){
Ships[ship_index].flags = ship_flags;
ship_departed(ship_index);
ship_actually_depart(ship_index);
}
}
break;
+14 -3
View File
@@ -9,12 +9,22 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2006-07-09 01:55:41 $
* $Author: Goober5000 $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2005/07/13 02:50:51 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* 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
*
@@ -31,6 +41,7 @@
* $NoKeywords: $
*/
#ifndef _FS2_DEMO_SYSTEM_HEADER_FILE
#define _FS2_DEMO_SYSTEM_HEADER_FILE
Binary file not shown.
Binary file not shown.
@@ -5,6 +5,7 @@
* File: async.h
* Content: AsyncData object include file
***************************************************************************/
#ifndef __ASYNC_INCLUDED__
#define __ASYNC_INCLUDED__
@@ -10,14 +10,14 @@
#ifndef _D3DTYPES_H_
#define _D3DTYPES_H_
#if (! defined WIN32) && (! defined WIN95)
#if (! defined _WIN32) && (! defined WIN95)
#include "subwtype.h"
#else
#include <windows.h>
#endif
#include <float.h>
#include "vddraw.h"
#include "directx/vddraw.h"
#pragma pack(4)
@@ -305,6 +305,14 @@ typedef struct _D3DTLVERTEX {
D3DVALUE tv;
D3DVALUE dvTV;
};
union {
D3DVALUE env_u; /* Texture coordinates */
D3DVALUE dvenv_U;
};
union {
D3DVALUE env_v;
D3DVALUE dvenv_V;
};
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
_D3DTLVERTEX() { }
_D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
@@ -320,6 +328,7 @@ typedef struct _D3DTLVERTEX {
/*
* Untransformed/lit vertices
*/
//(D3DFVF_XYZ | D3DFVF_DIFFUSE | D3DFVF_SPECULAR | D3DFVF_TEX1)
typedef struct _D3DLVERTEX {
union {
D3DVALUE x; /* Homogeneous coordinates */
@@ -399,12 +408,21 @@ typedef struct _D3DVERTEX {
D3DVALUE tv;
D3DVALUE dvTV;
};
union {
D3DVALUE tu2; /* Texture coordinates */
D3DVALUE dvTU2;
};
union {
D3DVALUE tv2;
D3DVALUE dvTV2;
};
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
_D3DVERTEX() { }
_D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv)
_D3DVERTEX(const D3DVECTOR& v, const D3DVECTOR& n, float _tu, float _tv, float _tu2=_tu, float _tv2=_tv)
{ x = v.x; y = v.y; z = v.z;
nx = n.x; ny = n.y; nz = n.z;
tu = _tu; tv = _tv;
tu2 = _tu2; tv2 = _tv2;
}
#endif
} D3DVERTEX, *LPD3DVERTEX;
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -5,10 +5,11 @@
* File: dplobby.h
* Content: DirectPlayLobby include file
***************************************************************************/
#ifndef __DPLOBBY_INCLUDED__
#define __DPLOBBY_INCLUDED__
#include "vdplay.h"
#include "directx/vdplay.h"
#ifdef __cplusplus
extern "C" {
Loaded 100 of 1147 files, more files were not shown because too many files have changed in this diff. Show more