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
2337 changed files with 396752 additions and 535814 deletions

No files matched your search

-99
View File
@@ -1,99 +0,0 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: false
AlignEscapedNewlinesLeft: false
AlignOperands: true
AlignTrailingComments: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: true
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: true
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Custom
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
ConstructorInitializerAllOnOneLineOrOnePerLine: false
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
DisableFormat: false
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ]
IncludeCategories:
- Regex: '^(<.*\.(h|hh|hpp)>)$' # Includes of external libraries
Priority: 4
- Regex: '^(<.*>)$' # standard library includes (won't match deprecated C headers)
Priority: 5
- Regex: '^"[^/]*\.(h)"$' # Local includes
Priority: 1
- Regex: '^".*\.(h)"$' # standard engine includes
Priority: 2
- Regex: '.*' # Catch all in case something is unhandled above
Priority: 3
IncludeIsMainRegex: '$'
IndentCaseLabels: false
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SpaceAfterCStyleCast: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
Standard: Cpp11
TabWidth: 4
UseTab: ForIndentation
...
-24
View File
@@ -1,24 +0,0 @@
---
Checks: "-*,\
modernize-*,\
-modernize-raw-string-literal,\
-modernize-use-using,\
-modernize-make-unique,\
performance-*,\
-performance-type-promotion-in-math-fn,\
misc-*,\
-misc-macro-parentheses,\
-misc-misplaced-widening-cast,\
-misc-static-assert,\
-modernize-make-unique,\
"
WarningsAsErrors: ''
HeaderFilterRegex: 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$'
AnalyzeTemporaryDtors: false
CheckOptions:
- key: 'misc-assert-side-effect.AssertMacros'
value: 'assert,Assert,Assertion'
- key: 'modernize-use-emplace.ContainersWithPushBack'
value: 'std::vector;std::deque;std::list;SCP_vector;SCP_deque;SCP_list'
...
-21
View File
@@ -1,21 +0,0 @@
build:
image: teaci/msys$$arch
pull: true
shell: mingw$$arch
commands:
- git submodule update --init --recursive
- if [ $$arch = 32 ]; then target=i686; fi
- if [ $$arch = 64 ]; then target=x86_64; fi
- pacman -S --needed --noconfirm --noprogressbar mingw-w64-${target}-pkg-config mingw-w64-${target}-cmake
- mkdir build && cd build
- cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=$$CONFIGURATION -DFSO_USE_SPEECH=OFF -DFSO_USE_VOICEREC=OFF -DFSO_FATAL_WARNINGS=ON -DFSO_BUILD_FRED2=OFF ..
- make -j$(nproc) all
matrix:
arch:
- 64
- 32
CONFIGURATION:
- Debug
- Release
-7
View File
@@ -1,7 +0,0 @@
root = true
[*.{h,cpp}]
indent_style = tab
[*.sdr]
indent_style = tab
-259
View File
@@ -1,259 +0,0 @@
#OS junk files
[Tt]humbs.db
*.DS_Store
#Visual Studio files
*.[Oo]bj
*.user
*.aps
*.pch
*.vspscc
*.vssscc
*_i.c
*_p.c
*.ncb
*.suo
*.tlb
*.tlh
*.bak
*.[Cc]ache
*.ilk
*.log
*.lib
*.sbr
*.sdf
*.opensdf
*.unsuccessfulbuild
ipch/
[Oo]bj/
Ankh.NoLoad
*.VC.db
*.VC.VC.opendb
#MonoDevelop
*.pidb
*.userprefs
#Tooling
_ReSharper*/
*.resharper
[Tt]est[Rr]esult*
*.sass-cache
#Project files
[Bb]uild/
#Subversion files
.svn
# Office Temp Files
~$*
# vim Temp Files
*~
#NuGet
packages/
*.nupkg
#ncrunch
*ncrunch*
*crunch*.local.xml
# visual studio database projects
*.dbmdl
#Test files
*.testsettings
#===========
#########################
# .gitignore file for Xcode4 and Xcode5 Source projects
#
# Apple bugs, waiting for Apple to fix/respond:
#
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation?
#
# Version 2.1
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
# - added line-by-line explanations for EVERYTHING (some were missing)
#
# NB: if you are storing "built" products, this WILL NOT WORK,
# and you should use a different .gitignore (or none at all)
# This file is for SOURCE projects, where there are many extra
# files that we want to exclude
#
#########################
#####
# OS X temporary files that should never be committed
#
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
.DS_Store
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
.Trashes
# c.f. http://www.westwind.com/reference/os-x/invisibles.html
*.swp
# *.lock - this is used and abused by many editors for many different things.
# For the main ones I use (e.g. Eclipse), it should be excluded
# from source-control, but YMMV
*.lock
#
# profile - REMOVED temporarily (on double-checking, this seems incorrect; I can't find it in OS X docs?)
#profile
####
# Xcode temporary files that should never be committed
#
# NB: NIB/XIB files still exist even on Storyboard projects, so we want this...
*~.nib
####
# Xcode build files -
#
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "DerivedData"
DerivedData/
# NB: slash on the end, so we only remove the FOLDER, not any files that were badly named "build"
build/
#####
# Xcode private settings (window sizes, bookmarks, breakpoints, custom executables, smart groups)
#
# This is complicated:
#
# SOMETIMES you need to put this file in version control.
# Apple designed it poorly - if you use "custom executables", they are
# saved in this file.
# 99% of projects do NOT use those, so they do NOT want to version control this file.
# ..but if you're in the 1%, comment out the line "*.pbxuser"
# .pbxuser: http://lists.apple.com/archives/xcode-users/2004/Jan/msg00193.html
*.pbxuser
# .mode1v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
*.mode1v3
# .mode2v3: http://lists.apple.com/archives/xcode-users/2007/Oct/msg00465.html
*.mode2v3
# .perspectivev3: http://stackoverflow.com/questions/5223297/xcode-projects-what-is-a-perspectivev3-file
*.perspectivev3
# NB: also, whitelist the default ones, some projects need to use these
!default.pbxuser
!default.mode1v3
!default.mode2v3
!default.perspectivev3
####
# Xcode 4 - semi-personal settings
#
#
# OPTION 1: ---------------------------------
# throw away ALL personal settings (including custom schemes!
# - unless they are "shared")
#
# NB: this is exclusive with OPTION 2 below
xcuserdata
# OPTION 2: ---------------------------------
# get rid of ALL personal settings, but KEEP SOME OF THEM
# - NB: you must manually uncomment the bits you want to keep
#
# NB: this *requires* git v1.8.2 or above; you may need to upgrade to latest OS X,
# or manually install git over the top of the OS X version
# NB: this is exclusive with OPTION 1 above
#
#xcuserdata/**/*
# (requires option 2 above): Personal Schemes
#
#!xcuserdata/**/xcschemes/*
####
# XCode 4 workspaces - more detailed
#
# Workspaces are important! They are a core feature of Xcode - don't exclude them :)
#
# Workspace layout is quite spammy. For reference:
#
# /(root)/
# /(project-name).xcodeproj/
# project.pbxproj
# /project.xcworkspace/
# contents.xcworkspacedata
# /xcuserdata/
# /(your name)/xcuserdatad/
# UserInterfaceState.xcuserstate
# /xcsshareddata/
# /xcschemes/
# (shared scheme name).xcscheme
# /xcuserdata/
# /(your name)/xcuserdatad/
# (private scheme).xcscheme
# xcschememanagement.plist
#
#
####
# Xcode 4 - Deprecated classes
#
# Allegedly, if you manually "deprecate" your classes, they get moved here.
#
# We're using source-control, so this is a "feature" that we do not want!
*.moved-aside
# .xccheckout
#
# Per http://stackoverflow.com/questions/18340453/should-xccheckout-files-in-xcode5-be-ignored-under-vcs
#
*.xccheckout
####
# Visual Studio Code
.vscode
####
# Documentation
#
documentation/doxygen/*
!documentation/doxygen/.gitkeep
.idea/*
projects/*
/.vs
CMakeSettings.json
# Weird files created by Linux
.fuse_hidden*
# This gets ignored by one of the rules above for some reason...
!/code/scripting/lua/LuaConvert.h
!/code/debugconsole/
-6
View File
@@ -1,6 +0,0 @@
[submodule "cmake/external/rpavlik-cmake-modules"]
path = cmake/external/rpavlik-cmake-modules
url = https://github.com/asarium/cmake-modules.git
[submodule "lib/libRocket"]
path = lib/libRocket
url = https://github.com/asarium/libRocket.git
-181
View File
@@ -1,181 +0,0 @@
language: bash
sudo: required
dist: trusty
cache:
directories:
- $HOME/cmake-3.8
- $HOME/.ccache
addons:
apt:
packages: &global_deps
- ninja-build
- libopenal-dev
- libreadline6-dev
- libpng12-dev
- libjpeg62-dev
- liblua5.1-0-dev
- libjansson-dev
- libsdl2-dev
- libfreetype6-dev
- valgrind
- qt57base
coverity_scan:
project:
name: "scp-fs2open/fs2open.github.com"
notification_email: [email protected]
build_command: "ci/travis/script.sh"
# must match TRAVIS_BRANCH check below
branch_pattern: coverity_scan
env:
global:
# The next declaration is the encrypted COVERITY_SCAN_TOKEN, created
# via the "travis encrypt" command using the project repo's public key
# also note that fork's don't get access to secure keys
# you have to test using a branch in the main repo
- secure: "C3wF967ZeliwwP1vC12EMIBOaC568n26Z/cPnwzn317ve59DWH3YSfPZVgvt08GzmaXITGGsJvPB+qxfGoKvQzYE4O1B73q81RpUe5pB3IhF+ThQ91VfQZIRJR5xEGJaLINUlHTTZGX5jxlkVO9wAcauVj/s3b8sQ3dvUZauPvk="
# These declarations set INDIEGAMES_USER and INDIEGAMES_PASSWORD for uploading nightly builds to the indiegames server
- secure: "lUuRu8XIi8MKNf1ebOfyC4iVEpPyASojJIDWXRo2bNqEF4ILAljXdkVeXeN6H5yKCHD52cxCNTtyePIG/o3p3QEuGSVud9bDS3D7LaQicLETGGrsw3l07U49gF2OKHXGopg0MzBbZUU9QmhoFTAe8t6PV9NDuEayYCheqvTqjZg="
- secure: "E/DHLYcPK/hBUqxBYYlUqp5sjgvIqY5A0qRHyQ4bmjsB+WB/Xx71bGCSiF7hk6lTxar1ZI1i5RAXXh9AIvNVaYAIdEOlCP+q3gvwCYuc5naZEKmkxlUCf0oEL4O9Fye93A/3VkFHuBdC1TGPYYf69m4W5r4367wWO9dPRIdWpJA="
# These declarations set FS2DOWNLOADS_USER and FS2DOWNLOADS_PASSWORD
- secure: "h6GbMX2jLsW1bS9fCM9fthOSJ1nfQQIRWi6EUH2p8u4NFLD5Bfi/C8JhQPKHUzyo3wvKkSHl+PsW7bgr1oXLusRwAur/dtv2N3imqvtbfIz305b00hZlsvbcYmQmUzQFSAdOGShK57JJ5aKQKccaUBP25KqB7Q+JaqBRdaMBS54="
- secure: "fUDAPAUUaaYZy8I4zU3SJ0JcK7aw4eb6eTdaEr7LyNyTMSfPgwY6P1MrbSQC0lJNQIUQ5ffjdxE5g7D7OYpoJF9L14ni4UY8t2QASt7kmpgcYihmjeuYy8FQXgmFG8CTxiWBPKTybZJ7voQcvIvRaNG7b2wM9PMfc5lRIondB6c="
deploy:
- provider: releases
api_key:
secure: "Wdt4Ccefo7a0ZDjEJQJgpghh7n72FtNJuKSAPUvoz4gtEX6Ct9J8yJI1t9V3jE3CTbbLJ21/Q6eZRDfT7UfNJe5DdepoJsP9DeFhKMWqQCq+AChqQWlm0KeZAffJoJreL8vXYhnRYcLT9ceZHEH6AqwN9TPV+xJziGPISAkYNZ8="
skip_cleanup: true
file_glob: true
file: "/tmp/builds/*"
on:
condition: '"$RELEASE_BUILD" == true'
tags: true
- provider: script
script: bash ci/travis/ftp_deploy.sh
on:
condition: '"$NIGHTLY_BUILD" == true'
tags: true
- provider: script
skip_cleanup: true
script: bash ci/travis/ftp_deploy.sh
on:
condition: $TEST_BUILD = true
all_branches: true
matrix:
include:
# note that gcc Debug MUST be 1st for Coverity
- os: linux
env: CONFIGURATION="Debug" CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Debug" CC=gcc-8 CXX=g++-8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- g++-8
- *global_deps
- os: linux
env: CONFIGURATION="Debug" CC=clang-4.0 CXX=clang++-4.0 CMAKE_OPTIONS="-DCMAKE_EXPORT_COMPILE_COMMANDS=ON"
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- *global_deps
- clang-4.0
- clang-tidy-4.0
- libc++-dev
script:
- ./ci/travis/script.sh
- ./ci/travis/clang_tidy.sh
- os: osx
env: CONFIGURATION="Debug"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: linux
env: CONFIGURATION="Release" CC=gcc-5 CXX=g++-5
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- *global_deps
- g++-5
- os: linux
env: CONFIGURATION="Release" CC=gcc-8 CXX=g++-8
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- g++-8
- *global_deps
- os: linux
env: CONFIGURATION="Release" CC=clang-4.0 CXX=clang++-4.0
addons:
apt:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-trusty-4.0
- sourceline: 'ppa:beineri/opt-qt571-trusty'
packages:
- *global_deps
- clang-4.0
- libc++-dev
- os: osx
env: CONFIGURATION="Release"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
# As long as Windows is still experimental on Travis CI, allow failures
allow_failures:
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Debug" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET=v141_xp CMAKE_GENERATOR="Visual Studio 15 2017"
- os: windows
env: CONFIGURATION="Release" CMAKE_TOOLSET="" CMAKE_GENERATOR="Ninja"
fast_finish: true
before_install:
# ugly hack; if running a coverity scan abort all except the 1st build
# see note re gcc compiler above needing to be 1st
# also note that branch_pattern & the TRAVIS_BRANCH check must match
# unfortunately COVERITY_SCAN_BRANCH isn't defined until later in the
# build process
- if ([[ "${TRAVIS_JOB_NUMBER##*.}" != "1" ]] && [[ "${TRAVIS_BRANCH}" == "coverity_scan" ]]); then false ; fi
- source "./ci/travis/check_release.sh"
- "./ci/travis/before_install.sh"
install:
- if [ "$TRAVIS_OS_NAME" = "windows" ]; then export PATH="/c/Program Files/CMake/bin":$PATH; fi
- "./ci/travis/install.sh"
- export PATH=$HOME/cmake-3.6/bin:$PATH
before_script:
- if [ "$TRAVIS_OS_NAME" = "linux" ]; then QT_ENV_SCRIPT=$(find /opt -name 'qt*-env.sh'); source $QT_ENV_SCRIPT; fi
- "./ci/travis/before_script.sh"
script:
- if [ "$BUILD_DEPLOYMENT" = true ] ; then ./ci/travis/release.sh ; else ./ci/travis/script.sh ; fi
-199
View File
@@ -1,199 +0,0 @@
CMAKE_MINIMUM_REQUIRED(VERSION 3.4)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Make sure the source and binary directory are not the sample
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
message(FATAL_ERROR "Binary and source directory can not be the same! Choose another build directory.")
endif()
include(cmake/util.cmake)
# Set a few policies
set_policy(CMP0051 OLD)
set_policy(CMP0053 NEW)
set_policy(CMP0054 NEW)
SET(FSO_PROJECT_DESCRIPTION "Open source project based on the original FreeSpace 2 source code.")
SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Executable output path")
SET(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin CACHE PATH "Library output path")
# CMAKE_INSTALL_PREFIX is defined but also overwritten by the PROJECT command so we need to set it later
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(RESET_INSTALL_PREFIX TRUE)
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
# Reset this variable
SET(TARGET_COPY_FILES "" CACHE INTERNAL "" FORCE)
SET(TARGET_COPY_DIRS "" CACHE INTERNAL "" FORCE)
### Define options and editable variables in the section below:
# This is only needed for single configuration generators so don't annoy others
if(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Default build configuration used." FORCE)
message(WARNING "CMAKE_BUILD_TYPE was not specified, defaulting to Release configuration.")
endif(NOT CMAKE_BUILD_TYPE AND NOT DEFINED CMAKE_CONFIGURATION_TYPES)
# Override standard CMake configurations
set(CMAKE_CONFIGURATION_TYPES Debug Release FastDebug CACHE STRING "Available configurations" FORCE)
PROJECT(FS2_Open)
find_program(CCACHE_PROGRAM ccache)
# Currently only GCC support ccache properly without generating additional warnings
if(CCACHE_PROGRAM AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
message(STATUS "Using ccache for compilation: ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CCACHE_PROGRAM}")
endif()
IF(CMAKE_CROSSCOMPILING)
SET(IMPORT_EXE_DIR "IMPORT_EXE_DIR-NOTFOUND" CACHE FILEPATH "Required for a cross compiling build, point to binary directory of a cmake build for the real OS")
INCLUDE(${IMPORT_EXE_DIR}/ImportExecutables.cmake)
ENDIF(CMAKE_CROSSCOMPILING)
# Check if the external modules exists
IF(NOT IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules/launcher-templates")
message(FATAL_ERROR "External submodules could not be found. Please make sure you have updated your submodules.")
endif()
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/finder")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/rpavlik-cmake-modules")
LIST(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/external/cotire")
IF(RESET_INSTALL_PREFIX)
IF(NOT $ENV{FS2PATH} STREQUAL "")
IF(NOT IS_DIRECTORY $ENV{FS2PATH})
MESSAGE(WARNING "The path '$ENV{FS2PATH}' of the environment variable FS2PATH does not point to a directory! Install prefix wasn't set.")
ELSE(NOT IS_DIRECTORY $ENV{FS2PATH})
SET(CMAKE_INSTALL_PREFIX "$ENV{FS2PATH}" CACHE FILEPATH "Install path" FORCE)
FILE(TO_CMAKE_PATH ${CMAKE_INSTALL_PREFIX} CMAKE_INSTALL_PREFIX)
ENDIF(NOT IS_DIRECTORY $ENV{FS2PATH})
ELSE(NOT $ENV{FS2PATH} STREQUAL "")
MESSAGE(STATUS "NO FS2PATH environment variable found, you can define this to point to your freespace install but it is not required.")
ENDIF(NOT $ENV{FS2PATH} STREQUAL "")
ENDIF(RESET_INSTALL_PREFIX)
IF (WIN32)
OPTION(FSO_USE_SPEECH "Use Windows specific text-to-speach libraries" ON)
OPTION(FSO_USE_VOICEREC "Enable voice recognition support" ON)
OPTION(FSO_BUILD_FRED2 "Build FRED2 binary" ON)
elseif(UNIX)
option(FSO_BUILD_APPIMAGE "Build an AppImage package" OFF)
ENDIF(WIN32)
OPTION(FSO_BUILD_TOOLS "Build tools related to FSO" OFF)
OPTION(FSO_BUILD_TESTS "Build unit tests" OFF)
OPTION(FSO_DEVELOPMENT_MODE "Generate binaries in development mode, only use if you know what you're doing!" OFF)
OPTION(FSO_BUILD_QTFRED "Build qtFRED2 binary" OFF)
IF(WIN32 OR APPLE)
# On windows and mac the default should be to always build the included libraries
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT ON)
ELSE()
SET(FSO_BUILD_INCLUDED_LIBS_DEFAULT OFF)
ENDIF()
OPTION(FSO_BUILD_INCLUDED_LIBS "Build and use the included libraries istead of using the system headers and libraries" ${FSO_BUILD_INCLUDED_LIBS_DEFAULT})
OPTION(FSO_USE_LUAJIT "Use LuaJIT for Lua scripting, needs a working internet connection!" OFF)
OPTION(FSO_USE_OPENALSOFT "Download and build OpenAL Soft instead of using the system libraries" OFF)
OPTION(FSO_FATAL_WARNINGS "Determines if warnings in the build are considered fatal errors, primarily used for CI" OFF)
SET(FSO_FREESPACE_PATH "${CMAKE_INSTALL_PREFIX}" CACHE FILEPATH "The path of the FreeSpace directory you want to use. Please note that you will have to change CMAKE_INSTALL_PREFIX if you change this at some point.")
SET(FSO_RUN_ARGUMENTS "" CACHE STRING "Additional arguments passed to a generated executable when run with the generated build files.")
option(FSO_INSTALL_DEBUG_FILES "Install some debug files (currently only PDB files on windows)" OFF)
option(ENABLE_COTIRE "Enable cotire for faster compilation. Enabled by default." ON)
MARK_AS_ADVANCED(FORCE FSO_CMAKE_DEBUG)
MARK_AS_ADVANCED(FORCE FSO_BUILD_INCLUDED_LIBS)
MARK_AS_ADVANCED(FORCE FSO_USE_OPENALSOFT)
MARK_AS_ADVANCED(FORCE FSO_USE_LUAJIT)
MARK_AS_ADVANCED(FORCE FSO_DEVELOPMENT_MODE)
MARK_AS_ADVANCED(FORCE FSO_FATAL_WARNINGS)
mark_as_advanced(FORCE FSO_INSTALL_DEBUG_FILES)
mark_as_advanced(FORCE ENABLE_COTIRE)
# Include cotire file from https://github.com/sakra/cotire/
include(cotire)
INCLUDE(globals)
INCLUDE(toolchain)
INCLUDE(platforms)
include(version)
INCLUDE(headers)
SET(GENERATED_SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/generated_source)
include(generateHeaders)
if(FSO_BUILD_APPIMAGE)
include(appimage)
endif()
include(clang-tidy)
# This includes source code for some tools, either used in the build or also for something else
ADD_SUBDIRECTORY(tools)
ADD_SUBDIRECTORY(lib)
ADD_SUBDIRECTORY(code)
ADD_SUBDIRECTORY(freespace2)
IF(FSO_BUILD_FRED2)
ADD_SUBDIRECTORY(fred2)
ENDIF(FSO_BUILD_FRED2)
IF(FSO_BUILD_QTFRED)
ADD_SUBDIRECTORY(qtfred)
ENDIF()
if(FSO_BUILD_TESTS)
add_subdirectory(test)
endif()
if ("${CMAKE_VERSION}" VERSION_GREATER "3.5")
# Default to using Freespace2 as startup project if CMake supports it.
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT Freespace2)
endif()
IF(MSVC_USE_RUNTIME_DLL)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_DESTINATION "${BINARY_DESTINATION}")
IF(FSO_BUILD_FRED2)
SET(CMAKE_INSTALL_MFC_LIBRARIES ON)
ENDIF(FSO_BUILD_FRED2)
INCLUDE(InstallRequiredSystemLibraries)
ENDIF(MSVC_USE_RUNTIME_DLL)
include(package)
include(doxygen)
# Print used options to log
IF (WIN32)
message(STATUS "Using text to speech: ${FSO_USE_SPEECH}")
message(STATUS "Using voice recogition: ${FSO_USE_VOICEREC}")
message(STATUS "Building FRED2: ${FSO_BUILD_FRED2}")
elseif(UNIX)
message(STATUS "Building AppImage: ${FSO_BUILD_APPIMAGE}")
ENDIF()
message(STATUS "Building FSO tools: ${FSO_BUILD_TOOLS}")
message(STATUS "Building qtFRED: ${FSO_BUILD_QTFRED}")
message(STATUS "Fatal warnings: ${FSO_FATAL_WARNINGS}")
+1 -21
View File
@@ -1,26 +1,6 @@
ChangeLog for fs2_open. All times are UTC.
Updated 2002-10-31 03:46
Features: September 2013
http://www.hard-light.net/forums/index.php?topic=85700.0
- show-subtitle-text can now display messages as well as raw text - Goober5000
- toggle subsytem scanning, scannable, cargo revealed, hidden from sensors, stealth and friendly stealth added to the alter-ship-flag sexp - karajorma
- Support added to add more languages besides English, French, German and Polish, leading the way to better localization! - karajorma
- event.log can now snapshot events checked in a frame and record the status of an event the previous time it was checked as well as the current state - karajorma
- added a player-is-cheating sexp - The E
- allow a user-specified number of credit images - Goober5000
- allow the specification of the positions of medals, callsigns and labels on the medal screen. - Goober5000
- lua function to check if a ship is warp capable, and access to a ship's auto-aim FOV - zookeeper
- is-facing now works for things that aren't ships (like waypoints!) - zookeeper
- experimental configurations to make AVX builds (see this post for more explainations) - The E
- new ship flag to enable smarter AI use of afterburners. Now it can use them while flying waypoints or attacking capital ships (use the free-afterburner-use flag with alter-ship-flag) - Admiral MS
- the number of medals is now dynamic! - Goober5000
- frame profiling code, see what exactly is slowing down FreeSpace. (Mostly for devs or coders) - Swifty + The E
- allowing fade-in and fade-out sexps to use any color, not just black, white and red. - Goober5000
==================================================================
( massive gap in updates, maybe this will be filled in someday...)
==================================================================
2002-10-30 22:57 randomtiger
+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
+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.
-42
View File
@@ -1,42 +0,0 @@
FreeSpace2 *S*ource *C*ode *P*roject
==
[![Travis-CI Build Status](https://travis-ci.org/scp-fs2open/fs2open.github.com.svg?branch=master)](https://travis-ci.org/scp-fs2open/fs2open.github.com)
[![AppVeyor Build Status](https://ci.appveyor.com/api/projects/status/github/scp-fs2open/fs2open.github.com?branch=master&svg=true)](https://ci.appveyor.com/project/SirKnightly/fs2open-github-com/branch/master)
[![Coverity](https://img.shields.io/coverity/scan/870.svg)](https://scan.coverity.com/projects/870)
Building
--
Before you do anything, make sure you have updated your git submodules, either by running `git submodule update --init --recursive` or by cloning the repository with the `--recursive` flag.<br/>
<br/>
For building you will need [CMake](http://www.cmake.org/cmake/resources/software.html). Version 3.4 is required. Once you have installed CMake you should create a build directory where the project/make files should be created, **do not create them inside the source tree!**<br>
<br>
On Windows you can use the `cmake-gui` executable to get a nice GUI, on Unix just use `cmake`. Use the newly created directory as build directory (change to this directory on Unix) and run cmake. On Windows this can be done by clicking the `Configure` button. Choose your compiler version and hit `Generate` when configuring is done. <br>
Depending on the makefile generator used build the `all` or `ALL_BUILD` target to compile the project.<br>
### Available variables to control the build
* `FSO_BUILD_WXFRED2`: Build the wxfred2 project, requires wxWidgets
* `FSO_FREESPACE_PATH`: Sets the path of your FreeSpace install, can be used to automatically run the generated executables with the correct working directory, this is an optional variable. By default this will use the value of the `FS2PATH` environment variable.
* `FSO_BUILD_TOOLS`: Build some tools related to FSO
* `CMAKE_BUILD_TYPE`: Sets the binary build type between `Debug` and `Release` (default)
#### Windows only variables
* `FSO_BUILD_FRED2`: Build FRED2, requires a Visual Studio version that ships with MFC
* `FSO_USE_SPEECH`: Build a binary with text-to-speech support
* `FSO_USE_VOICEREC`: Build a binary with voice recognition support
#### Advanced variables
You should only use these variables if you know what you're doing
* `FSO_CMAKE_DEBUG`: Print CMake debugging informations
* `FSO_BUILD_INCLUDED_LIBS`: Build libraries from the included source
* `FSO_USE_OPENALSOFT`: Use [OpenALSoft](http://kcat.strangesoft.net/openal.html) for OpenAL support
* `FSO_USE_LUAJIT`: Use [luajit](http://luajit.org/) as a replacement for lua
* `FSO_DEVELOPMENT_MODE`: Toggles some development behavior, only use if you really need it.
* `FSO_RUN_ARGUMENTS`: If you run an executable from within the project, these arguments will also be passed to the executable
* `FSO_BUILD_POSTFIX`: Sets a postfix to be added to the executable name, may be useful for release candidates.
#### Visual Studio specific variables
* `MSVC_USE_RUNTIME_DLL`: Use the DLL version of the runtime, experimental and not well tested.
* `MSVC_SIMD_INSTRUCTIONS`: The instruction set the executables will be optimized for.
### Generating an installation package
CMake can automatically generate installation packages of the project. To do this you will just need to run the `package` target of the build system and the package will be placed inside your build directory. On Windows you will have to install [NSIS](http://nsis.sourceforge.net/Main_Page) to use this.
+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
])
-64
View File
@@ -1,64 +0,0 @@
version: 1.0.0.{build}
image: Visual Studio 2015
configuration:
- Debug
- Release
clone_depth: 10
environment:
matrix:
- BuildID: 0
CMAKE_GENERATOR: Visual Studio 14 2015
PlatformToolset: v140_xp
QT_DIR: C:\Qt\5.9.5\msvc2015
- BuildID: 1
CMAKE_GENERATOR: Visual Studio 14 2015 Win64
PlatformToolset: v140_xp
QT_DIR: C:\Qt\5.9.5\msvc2015_64
before_build:
- git submodule update --init --recursive
build_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/build.ps1
test_script:
- ps: . $Env:APPVEYOR_BUILD_FOLDER/ci/appveyor/test.ps1
deploy:
- provider: GitHub
auth_token:
secure: 3kV4efHXwRnfXzmJPRAOs8D7+MhwXUXYeayI/P5y114L09kJa6b6L70beXdW7yYr
on:
ReleaseBuild: true # deploy on release push only
- provider: FTP
protocol: sftp
host: scp.indiegames.us
username:
secure: SFivQZfatqWHXK1ijYK3GQ==
password:
secure: q6Zk/412o1ri+NEya1dl1Q==
folder: public_html/builds/nightly/$(VersionName)
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: ftp
host: swc.fs2downloads.com
username:
secure: EXg2ADoKzMduZF90ip2Q0g==
password:
secure: x0LL0uY9yBAQ7JTARhQ6AA==
folder: swc.fs2downloads.com/builds/nightly/$(VersionName)
beta: true
on:
NightlyBuild: true # deploy on nightly push only
- provider: FTP
protocol: ftp
host: swc.fs2downloads.com
username:
secure: EXg2ADoKzMduZF90ip2Q0g==
password:
secure: x0LL0uY9yBAQ7JTARhQ6AA==
folder: swc.fs2downloads.com/builds/test/$(VersionName)
beta: true
on:
TestBuild: true # deploy on test build push only
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
-160
View File
@@ -1,160 +0,0 @@
class BuildConfig {
[string]$Generator
[string]$PackageType
[string]$Toolset
[string]$SimdType
[string]$QtDir
[Bool]$SourcePackage
}
$NightlyConfigurations = @(
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015_64";
SourcePackage=$false;
},
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015";
SourcePackage=$false;
}
)
$ReleaseConfigurations = @(
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015";
SourcePackage=$true;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32-AVX";
Toolset="v140_xp";
SimdType="AVX";
QtDir="C:\Qt\5.9.5\msvc2015";
SourcePackage=$false;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9.5\msvc2015_64";
SourcePackage=$false;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64-AVX";
Toolset="v140_xp";
SimdType="AVX";
QtDir="C:\Qt\5.9.5\msvc2015_64";
SourcePackage=$false;
}
)
$BuildConfigurations = $null
# Default values
$ReleaseBuild = $false
$NightlyBuild = $false
$TestBuild = $false
# Set to true to test either the release or the nightly part of this script
$ReleaseTest = $false
$NightlyTest = $false
$TestBuildTest = $false
if ($ReleaseTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^release_(.*)"))) {
# Tag matches
$ReleaseBuild = $true
$PackageName = "fs2_open_$($matches[1])"
$BuildConfigurations = $ReleaseConfigurations
}
if ($NightlyTest -Or ([System.Convert]::ToBoolean($env:APPVEYOR_REPO_TAG) -And ("$env:APPVEYOR_REPO_TAG_NAME" -match "^nightly_(.*)"))) {
# Tag matches
$NightlyBuild = $true
$PackageName = "nightly_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
$BuildConfigurations = $NightlyConfigurations
}
if ($TestBuildTest -Or ([System.Convert]::ToInt32($env:APPVEYOR_PULL_REQUEST_NUMBER) -le 0 -And ("$env:APPVEYOR_REPO_BRANCH" -match "^test\/(.*)"))) {
# Tag matches
$TestBuild = $true
$PackageName = "test_$($matches[1])"
Set-AppveyorBuildVariable 'VersionName' "$($matches[1])"
$BuildConfigurations = $NightlyConfigurations
# Override the revision string so that the builds are named correctly
[System.IO.File]::WriteAllLines("$env:APPVEYOR_BUILD_FOLDER/version_override.cmake", "set(FSO_VERSION_REVISION_STR $env:VersionName)")
}
# Multiply by 2 so that we can add 0 or 1 for debug or release Configs
$buildID = [convert]::ToInt32($env:BuildID) * 2
if ($Env:Configuration -eq "Release") {
$buildID = $buildID + 1
}
$DeployBuild = $false
if ($ReleaseBuild -Or $NightlyBuild -Or $TestBuild) {
$DeployBuild = $true
}
Set-AppveyorBuildVariable 'ReleaseBuild' "$ReleaseBuild"
Set-AppveyorBuildVariable 'NightlyBuild' "$NightlyBuild"
Set-AppveyorBuildVariable 'TestBuild' "$TestBuild"
New-Item build -type directory
Set-Location -Path build
if ($DeployBuild) {
# Release build
if ($buildID -ge $BuildConfigurations.Length) {
# Not needed
exit 0
}
$buildConfig = $BuildConfigurations[$buildID]
if ($buildConfig.SourcePackage -eq $True) {
7z a -xr'!.git' "$($PackageName)-source-Win.zip" "$env:APPVEYOR_BUILD_FOLDER"
Push-AppveyorArtifact "$($PackageName)-source-Win.zip"
}
cmake -DCMAKE_INSTALL_PREFIX="$env:APPVEYOR_BUILD_FOLDER/../install" -DFSO_USE_SPEECH="ON" `
-DFSO_USE_VOICEREC="ON" -DMSVC_SIMD_INSTRUCTIONS="$($buildConfig.SimdType)" `
-DQT5_INSTALL_ROOT="$($buildConfig.QtDir)" -DFSO_BUILD_QTFRED=ON `
-G "$($buildConfig.Generator)" -T "$($buildConfig.Toolset)" ..
$Configs = @("Release", "FastDebug")
foreach ($config in $Configs) {
cmake --build . --config "$config" --target INSTALL -- /verbosity:minimal
if (! ($?)) {
Add-AppveyorMessage "A release build failed!"
exit 1
}
}
7z a "$($PackageName)-builds-$($buildConfig.PackageType).zip" "$env:APPVEYOR_BUILD_FOLDER/../install/*"
Push-AppveyorArtifact "$($PackageName)-builds-$($buildConfig.PackageType).zip"
} else {
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="ON" -DFSO_BUILD_TESTS="ON" -DMSVC_SIMD_INSTRUCTIONS=SSE2 `
-DFSO_BUILD_QTFRED=ON -DQT5_INSTALL_ROOT="$env:QT_DIR" -DFSO_BUILD_FRED2="ON" `
-G "$Env:CMAKE_GENERATOR" -T "$Env:PlatformToolset" ..
cmake --build . --config "$Env:CONFIGURATION" -- /verbosity:minimal
if (! ($?)) {
exit 1
}
}
-13
View File
@@ -1,13 +0,0 @@
if ([System.Convert]::ToBoolean($env:ReleaseBuild) -Or [System.Convert]::ToBoolean($env:NightlyBuild) -Or [System.Convert]::ToBoolean($env:TestBuild)) {
# Skip tests for deployment
exit 0
} else {
write "Running unit tests..."
# Run unit tests
&"$pwd\bin\$Env:CONFIGURATION\unittests.exe" --gtest_shuffle 2>&1
if (! ($?)) {
exit 1
}
}
-19
View File
@@ -1,19 +0,0 @@
{
"package": {
"subject": "scp-fs2open",
"repo": "FSO",
"name": "nightly"
},
"version": {
"name": "$VERSION_NAME"
},
"files": [
{
"includePattern": "/tmp/builds/(.*)",
"uploadPattern": "$1"
}
],
"publish": true
}
-8
View File
@@ -1,8 +0,0 @@
#!/usr/bin/env sh
set -ex
if [ "$NIGHTLY_BUILD" = true ]; then
echo "Generating bintray config..."
sed -e "s/\$VERSION_NAME/$VERSION_NAME/" ci/bintray.template.json > ci/bintray.json
fi
-14
View File
@@ -1,14 +0,0 @@
#!/usr/bin/env sh
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Nothing to do here
:
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
# Nothing to do here
:
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
# Nothing to do here
:
fi
-54
View File
@@ -1,54 +0,0 @@
#!/usr/bin/env bash
set -ex
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
mkdir -p /tmp/builds
if [ "$RELEASE_BUILD" = true ]; then
# Package the source code in release builds
PARENT_DIR="$(basename "$PWD")"
(cd .. && tar -czvf /tmp/builds/$PACKAGE_NAME-source-Unix.tar.gz --exclude-vcs "$PARENT_DIR")
fi
fi
mkdir -p build
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
CXXFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
CFLAGS="-m64 -mtune=generic -mfpmath=sse -msse -msse2 -pipe -Wno-unknown-pragmas"
if [[ "$CC" =~ ^clang.*$ ]]; then
CXXFLAGS="$CXXFLAGS -stdlib=libc++"
fi
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
if [ "$BUILD_DEPLOYMENT" = true ]; then
for config in $BUILD_CONFIGS
do
mkdir -p $config
cd $config
eval $CMAKE -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_BUILD_TYPE=$config -DCMAKE_INSTALL_PREFIX="/tmp/release/$config" \
-DFSO_BUILD_APPIMAGE=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFFMPEG_USE_PRECOMPILED=ON -DFSO_BUILD_QTFRED=OFF ../..
cd ..
done
else
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON -DFSO_BUILD_QTFRED=ON ..
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ "$BUILD_DEPLOYMENT" = true ]; then
cmake -G "Xcode" -DFSO_FATAL_WARNINGS=ON -DFSO_INSTALL_DEBUG_FILES=ON -DCMAKE_INSTALL_PREFIX="/tmp/release" ..
else
cmake -G "Xcode" $CMAKE_OPTIONS ..
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
if [ "$CMAKE_GENERATOR" = "Ninja" ]; then
cmake -DFSO_USE_SPEECH="OFF" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DFSO_BUILD_FRED2="OFF" -G "$CMAKE_GENERATOR" ..
else
cmake -DFSO_USE_SPEECH="ON" -DFSO_FATAL_WARNINGS="ON" -DFSO_USE_VOICEREC="OFF" -DFSO_BUILD_TESTS="ON" \
-DMSVC_SIMD_INSTRUCTIONS=SSE2 -DFSO_BUILD_FRED2="ON" -G "$CMAKE_GENERATOR" -T "$CMAKE_TOOLSET" ..
fi
fi
-74
View File
@@ -1,74 +0,0 @@
#!/usr/bin/env sh
RELEASE_BUILD=false
NIGHTLY_BUILD=false
TEST_BUILD=false
BUILD_DEPLOYMENT=false
BUILD_CONFIGS="Release FastDebug"
VERSION_NAME=""
PACKAGE_NAME=""
RELEASE_PATTERN="^release_(.*)$"
NIGHTLY_PATTERN="^nightly_(.*)$"
TEST_BUILD_PATTERN="^test\/(.*)$"
# These are for testing
NIGHTLY_TEST=false
RELEASE_TEST=false
TEST_BUILD_TEST=false
if [ "$RELEASE_TEST" = true ] || [[ "$TRAVIS_TAG" =~ $RELEASE_PATTERN ]]; then
echo "This is a release tag!";
RELEASE_BUILD=true;
PACKAGE_NAME="fs2_open_${BASH_REMATCH[1]}";
fi
if [ "$NIGHTLY_TEST" = true ] || [[ "$TRAVIS_TAG" =~ $NIGHTLY_PATTERN ]]; then
echo "This is a nightly tag!";
NIGHTLY_BUILD=true;
VERSION_NAME="${BASH_REMATCH[1]}";
PACKAGE_NAME="nightly_${BASH_REMATCH[1]}";
fi
if [ "$TEST_BUILD_TEST" = true ] || [[ "$TRAVIS_PULL_REQUEST" == "false" && "$TRAVIS_BRANCH" =~ $TEST_BUILD_PATTERN ]]; then
echo "This is a test build branch!";
TEST_BUILD=true;
if [ "$TEST_BUILD_TEST" = true ]; then
VERSION_NAME="test";
PACKAGE_NAME="test_test";
else
VERSION_NAME="${BASH_REMATCH[1]}";
PACKAGE_NAME="test_${BASH_REMATCH[1]}";
fi
# Override the revision string so that the builds are named correctly
echo "set(FSO_VERSION_REVISION_STR $VERSION_NAME)" > "$TRAVIS_BUILD_DIR/version_override.cmake"
fi
if ([ "$RELEASE_BUILD" = true ] || [ "$NIGHTLY_BUILD" = true ] || [ "$TEST_BUILD" = true ]); then
BUILD_DEPLOYMENT=true;
fi
if [ "$BUILD_DEPLOYMENT" = true ]; then
if ([ "$TRAVIS_OS_NAME" = "linux" ] && (! [[ "$CC" =~ ^gcc-5.*$ ]])); then
echo "Skipping non-release compiler";
exit 0;
fi
if ([[ "$CONFIGURATION" == "Debug" ]]); then
echo "Skipping non-release configuration";
exit 0;
fi
if [ "$TRAVIS_OS_NAME" = "windows" ]; then
echo "Skipping non-release platform"
exit 0
fi
fi
export RELEASE_BUILD
export NIGHTLY_BUILD
export TEST_BUILD
export BUILD_DEPLOYMENT
export BUILD_CONFIGS
export VERSION_NAME
export PACKAGE_NAME
-141
View File
@@ -1,141 +0,0 @@
#!/usr/bin/env python
#
#===- clang-tidy-diff.py - ClangTidy Diff Checker ------------*- python -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
r"""
ClangTidy Diff Checker
======================
This script reads input from a unified diff, runs clang-tidy on all changed
files and outputs clang-tidy warnings in changed lines only. This is useful to
detect clang-tidy regressions in the lines touched by a specific patch.
Example usage for git/svn users:
git diff -U0 HEAD^ | clang-tidy-diff.py -p1
svn diff --diff-cmd=diff -x-U0 | \
clang-tidy-diff.py -fix -checks=-*,modernize-use-override
"""
import argparse
import json
import re
import subprocess
import sys
def main():
parser = argparse.ArgumentParser(description=
'Run clang-tidy against changed files, and '
'output diagnostics only for modified '
'lines.')
parser.add_argument('-clang-tidy-binary', metavar='PATH',
default='clang-tidy',
help='path to clang-tidy binary')
parser.add_argument('-p', metavar='NUM', default=0,
help='strip the smallest prefix containing P slashes')
parser.add_argument('-regex', metavar='PATTERN', default=None,
help='custom pattern selecting file paths to check '
'(case sensitive, overrides -iregex)')
parser.add_argument('-iregex', metavar='PATTERN', default=
r'.*\.(cpp|cc|c\+\+|cxx|c|cl|h|hpp|m|mm|inc)',
help='custom pattern selecting file paths to check '
'(case insensitive, overridden by -regex)')
parser.add_argument('-fix', action='store_true', default=False,
help='apply suggested fixes')
parser.add_argument('-checks',
help='checks filter, when not specified, use clang-tidy '
'default',
default='')
parser.add_argument('-path', dest='build_path',
help='Path used to read a compile command database.')
parser.add_argument('-extra-arg', dest='extra_arg',
action='append', default=[],
help='Additional argument to append to the compiler '
'command line.')
parser.add_argument('-extra-arg-before', dest='extra_arg_before',
action='append', default=[],
help='Additional argument to prepend to the compiler '
'command line.')
parser.add_argument('-quiet', action='store_true', default=False,
help='Run clang-tidy in quiet mode')
clang_tidy_args = []
argv = sys.argv[1:]
if '--' in argv:
clang_tidy_args.extend(argv[argv.index('--'):])
argv = argv[:argv.index('--')]
args = parser.parse_args(argv)
# Extract changed lines for each file.
filename = None
lines_by_file = {}
for line in sys.stdin:
match = re.search('^\+\+\+\ \"?(.*?/){%s}([^ \t\n\"]*)' % args.p, line)
if match:
filename = match.group(2)
if filename == None:
continue
if args.regex is not None:
if not re.match('^%s$' % args.regex, filename):
continue
else:
if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE):
continue
match = re.search('^@@.*\+(\d+)(,(\d+))?', line)
if match:
start_line = int(match.group(1))
line_count = 1
if match.group(3):
line_count = int(match.group(3))
if line_count == 0:
continue
end_line = start_line + line_count - 1;
lines_by_file.setdefault(filename, []).append([start_line, end_line])
if len(lines_by_file) == 0:
print("No relevant changes found.")
sys.exit(0)
line_filter_json = json.dumps(
[{"name" : name, "lines" : lines_by_file[name]} for name in lines_by_file],
separators = (',', ':'))
quote = "";
if sys.platform == 'win32':
line_filter_json=re.sub(r'"', r'"""', line_filter_json)
else:
quote = "'";
# Run clang-tidy on files containing changes.
command = [args.clang_tidy_binary]
command.append('-line-filter=' + quote + line_filter_json + quote)
if args.fix:
command.append('-fix')
if args.checks != '':
command.append('-checks=' + quote + args.checks + quote)
if args.quiet:
command.append('-quiet')
if args.build_path is not None:
command.append('-p=%s' % args.build_path)
command.extend(lines_by_file.keys())
for arg in args.extra_arg:
command.append('-extra-arg=%s' % arg)
for arg in args.extra_arg_before:
command.append('-extra-arg-before=%s' % arg)
command.extend(clang_tidy_args)
sys.exit(subprocess.call(' '.join(command), shell=True))
if __name__ == '__main__':
main()
-24
View File
@@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
if ! git rev-list $TRAVIS_COMMIT_RANGE 2>1 >/dev/null; then
echo "\$TRAVIS_COMMIT_RANGE ($TRAVIS_COMMIT_RANGE) is not valid for this build (probably caused by a rebase)."
exit 0
fi
cd "$TRAVIS_BUILD_DIR"
echo "Running clang-tidy on changed files"
git diff -U0 --no-color $TRAVIS_COMMIT_RANGE | \
$TRAVIS_BUILD_DIR/ci/travis/clang-tidy-diff.py -path "$TRAVIS_BUILD_DIR/build" -p1 \
-regex 'code/.*$|freespace2/.*$|qtfred/.*$|test/src/.*$|build/.*$|tools/.*' \
-clang-tidy-binary /usr/bin/clang-tidy-4.0 2>/dev/null | \
tee clang-tidy-output.txt
if [[ -n $(grep "warning: " clang-tidy-output.txt) ]] || [[ -n $(grep "error: " clang-tidy-output.txt) ]]; then
echo "Errors or warnings were detected in the clang-tidy output!"
exit 1
else
echo -e "\033[1;32m\xE2\x9C\x93 passed:\033[0m clang-tidy test succeeded";
fi
-54
View File
@@ -1,54 +0,0 @@
#!/usr/bin/env bash
set -e
set -u
if [[ ! "$(curl -V)" == *"sftp"* ]]; then
# Before
echo "Before:"
curl -V
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
# Since the Travis CI people are not capable of enabling SSH/SCP support for their libcurl we need to build that manually...
# These commands are based on the tutorial from here: http://zeroset.mnim.org/2013/03/14/sftp-support-for-curl-in-ubuntu-12-10-quantal-quetzal-and-later/
mkdir /tmp/curl
cd /tmp/curl
sudo apt-get update
sudo apt-get install build-essential debhelper libssh2-1-dev libgnutls-dev libidn11-dev libkrb5-dev libldap2-dev libnss3-dev librtmp-dev libtool openssh-server quilt
apt-get source curl
sudo apt-get build-dep curl
cd curl-*
export DEB_BUILD_OPTIONS="nocheck"
sudo dpkg-buildpackage -uc -us -j"$(grep -c ^processor /proc/cpuinfo)"
cd ..
dpkg -l | grep curl
ls -al
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install curl --with-libssh2
export PATH="/usr/local/opt/curl/bin:$PATH"
fi
# After
echo "After:"
curl -V
fi
cd /tmp/builds
for file in *; do
if [ "$TEST_BUILD" = true ]; then
# Upload to fs2downloads
curl -k "ftp://swc.fs2downloads.com/swc.fs2downloads.com/builds/test/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_PASSWORD" -T "$file" --ftp-create-dirs
else
# Upload to indiegames
curl -k "sftp://scp.indiegames.us/~/public_html/builds/nightly/$VERSION_NAME/" --user "$INDIEGAMES_USER:$INDIEGAMES_PASSWORD" -T "$file" --ftp-create-dirs
# Upload to fs2downloads
curl -k "ftp://swc.fs2downloads.com/swc.fs2downloads.com/builds/nightly/$VERSION_NAME/" --user "$FS2DOWNLOADS_USER:$FS2DOWNLOADS_PASSWORD" -T "$file" --ftp-create-dirs
fi
done
-34
View File
@@ -1,34 +0,0 @@
#!/usr/bin/env sh
set -ex
FILENAME=
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
if [ ! -d "$HOME/cmake-3.8/bin" ]; then
# If the cache does not currently contain CMake then download and install it
mkdir -p $HOME/cmake-3.8/
wget -O /tmp/cmake.tar.gz --no-check-certificate https://cmake.org/files/v3.8/cmake-3.8.2-Linux-x86_64.tar.gz
tar -xzf /tmp/cmake.tar.gz -C $HOME/cmake-3.8/ --strip-components=1
fi
export PATH=$HOME/cmake-3.8/bin:$PATH
cd $HOME
if [ "${BUILD_DEPLOYMENT}" = true ]; then
wget -O appimagetool -c "https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage" # (64-bit)
chmod a+x ./appimagetool
wget -O linuxdeployqt -c "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage" # (64-bit)
chmod a+x ./linuxdeployqt
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
gem install xcpretty
brew update
brew outdated cmake || brew upgrade cmake
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
choco install mingw ninja
fi
cmake --version
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env sh
set -ex
mkdir -p /tmp/builds
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
cd build
for config in $BUILD_CONFIGS
do
cd "$config"
# Compile all targets
ninja all
# Install Freespace2 targets
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/fso -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/fso -DCOMPONENT=Freespace2 -P cmake_install.cmake
# We need to be a bit creative for determining the AppImage name since we don't want to hard-code the name
FILENAME="$(find /tmp/release/$config/fso/bin -name 'fs2_open_*' -type f -printf "%f\n").AppImage"
$HOME/appimagetool -n /tmp/release/$config/fso "/tmp/release/$config/fso/$FILENAME"
: <<'END'
# Install qtFRED targets
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/qtfred/usr -DCOMPONENT=Unspecified -P cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=/tmp/release/$config/qtfred/usr -DCOMPONENT=qtFRED -P cmake_install.cmake
PREV="$(pwd)"
cd /tmp/release/$config/qtfred
unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH
$HOME/linuxdeployqt usr/qtfred.desktop -bundle-non-qt-libs
# Move our AppRun script to the right location
mv usr/AppRun AppRun
echo "Embed newer libstdc++ for distros that don't come with it (ubuntu 14.04)";
mkdir -p usr/optional/; mkdir -p usr/optional/libstdc++/;
cp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 ./usr/optional/libstdc++/;
$HOME/appimagetool -n . "$(find /tmp/release/$config/qtfred/usr/bin -name 'qtfred_*' -type f -printf "%f\n").AppImage"
cd "$PREV"
END
cd ..
done
cp `find /tmp/release -name '*.AppImage' -print` /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-Linux.tar.gz *.AppImage)
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cd build
for config in $BUILD_CONFIGS
do
cmake --build . --config "$config" --target install | tee build.log \
| xcpretty
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://transfer.sh/build.log.tar.gz"
exit $XCODE_RET
fi
done
ls -al /tmp/release
(cd /tmp/release && tar -cvzf /tmp/builds/$PACKAGE_NAME-builds-MacOSX.tar.gz *)
fi
-31
View File
@@ -1,31 +0,0 @@
#!/usr/bin/env sh
set -e
cd build
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
ninja -k 20 all
if [ "$CONFIGURATION" = "Debug" ]; then
valgrind --leak-check=full --error-exitcode=1 --gen-suppressions=all \
--suppressions="$TRAVIS_BUILD_DIR/ci/travis/valgrind.supp" ./bin/unittests --gtest_shuffle
else
./bin/unittests --gtest_shuffle
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
cmake --build . --config "$CONFIGURATION" | tee build.log | xcpretty
XCODE_RET=${PIPESTATUS[0]}
if [ "$XCODE_RET" -ne "0" ]; then
tar -cvzf build.log.tar.gz build.log
curl --upload-file build.log.tar.gz "https://transfer.sh/build.log.tar.gz"
exit $XCODE_RET
fi
elif [ "$TRAVIS_OS_NAME" = "windows" ]; then
if [ "$CMAKE_GENERATOR" = "Ninja" ]; then
cmake --build . --config "$CONFIGURATION"
else
cmake --build . --config "$CONFIGURATION" -- /verbosity:minimal
fi
fi
-43
View File
@@ -1,43 +0,0 @@
{
liblsan Invalid read
Memcheck:Addr8
obj:/usr/lib64/liblsan.so.0.0.0
obj:/usr/lib64/liblsan.so.0.0.0
obj:/usr/lib64/liblsan.so.0.0.0
obj:*
obj:*
obj:*
}
{
Travis memleak
Memcheck:Leak
match-leak-kinds: definite
fun:malloc
fun:_dl_signal_error
fun:_dl_open
fun:dlopen_doit
fun:_dl_catch_error
fun:_dlerror_run
fun:dlopen@@GLIBC_2.2.5
obj:/usr/lib/x86_64-linux-gnu/libmirclient.so.7
fun:call_init.part.0
fun:call_init
fun:_dl_init
fun:dl_open_worker
fun:_dl_catch_error
}
{
CLang Lua unitialized value error
Memcheck:Cond
...
fun:luaH_get
fun:lua_rawget
fun:_ZN12_GLOBAL__N_117ade_index_handlerEP9lua_State
}
{
False-positive uninitialized variable warning
Memcheck:Cond
fun:_Z23cf_check_location_flagsjj
fun:_Z29cf_create_default_path_stringPcjiPKcbj
...
}
-6
View File
@@ -1,6 +0,0 @@
[Desktop Entry]
Type=Application
Name=FreeSpace Open
Exec=$<TARGET_FILE_NAME:Freespace2>
Icon=app_icon
Categories=Game;
-4
View File
@@ -1,4 +0,0 @@
#!/bin/sh
HERE=$(dirname $(readlink -f "${0}"))
export LD_LIBRARY_PATH="${HERE}"/lib:"$LD_LIBRARY_PATH"
"${HERE}"/bin/$<TARGET_FILE_NAME:Freespace2> $@
-17
View File
@@ -1,17 +0,0 @@
include(WriteCompilerDetectionHeader)
set(CMAKE_CXX_STANDARD_REQUIRED 11)
set(CMAKE_CXX_STANDARD 11)
set(REQUIRED_CXX_FEATURES cxx_rvalue_references cxx_nullptr)
get_property(CMAKE_CXX_KNOWN_FEATURES GLOBAL PROPERTY CMAKE_CXX_KNOWN_FEATURES)
write_compiler_detection_header(
FILE "${GENERATED_SOURCE_DIR}/scp_compiler_detection.h"
PREFIX SCP
COMPILERS AppleClang Clang GNU MSVC
FEATURES ${CMAKE_CXX_KNOWN_FEATURES}
VERSION 3.2
)
-21
View File
@@ -1,21 +0,0 @@
SET(BINARY_DESTINATION "bin")
SET(LIBRAY_DESTINATION "lib")
configure_file("${CMAKE_CURRENT_LIST_DIR}/AppRun.in" "${CMAKE_CURRENT_BINARY_DIR}/AppRun.gen" @ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppRun-$<CONFIG>"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/AppRun.gen")
install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/AppRun-$<CONFIG>" DESTINATION "." RENAME "AppRun"
COMPONENT "Freespace2")
configure_file("${CMAKE_CURRENT_LIST_DIR}/AppImage.desktop.in" "${CMAKE_CURRENT_BINARY_DIR}/AppImage.desktop.gen" @ONLY)
file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppImage-$<CONFIG>.desktop"
INPUT "${CMAKE_CURRENT_BINARY_DIR}/AppImage.desktop.gen")
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/AppImage-$<CONFIG>.desktop" DESTINATION "." RENAME "fso.desktop"
COMPONENT "Freespace2")
install(FILES "${CMAKE_SOURCE_DIR}/freespace2/resources/app_icon.png" DESTINATION "."
COMPONENT "Freespace2")
-37
View File
@@ -1,37 +0,0 @@
option(ENABLE_CLANG_TIDY "Enable source code checking using clang-tidy" OFF)
find_program(
CLANG_TIDY_EXE
NAMES "clang-tidy"
DOC "Path to clang-tidy executable"
)
function(enable_clang_tidy target)
# Not enabled in this configuration
endfunction()
if(NOT ENABLE_CLANG_TIDY)
return()
endif()
if(NOT EXISTS "${CLANG_TIDY_EXE}")
message(SEND_ERROR "clang-tidy: Could not find clang-tidy executable (value of variable is \"${CLANG_TIDY_EXE}\".")
return()
endif()
if(CMAKE_VERSION VERSION_LESS "3.6.0")
message(SEND_ERROR "Clang-tidy support requires CMake 3.6")
return()
endif()
message(STATUS "clang-tidy: Using \"${CLANG_TIDY_EXE}\"")
function(enable_clang_tidy target)
SET(TIDY_OPTIONS "${CLANG_TIDY_EXE}")
if(FSO_FATAL_WARNINGS)
set(TIDY_OPTIONS "${TIDY_OPTIONS};-warnings-as-errors=*")
endif()
set_target_properties(${target} PROPERTIES CXX_CLANG_TIDY "${TIDY_OPTIONS}")
endfunction()
-59
View File
@@ -1,59 +0,0 @@
// Code snippet from http://stackoverflow.com/a/7495023
#ifdef _WIN32
#include <intrin.h>
// Windows
#define cpuid __cpuid
#else
// GCC Inline Assembly
void cpuid(int CPUInfo[4],int InfoType){
__asm__ __volatile__ (
"cpuid":
"=a" (CPUInfo[0]),
"=b" (CPUInfo[1]),
"=c" (CPUInfo[2]),
"=d" (CPUInfo[3]) :
"a" (InfoType)
);
}
#endif
#include <iostream>
int main( int argc, char* argv[] )
{
int SSE = false;
int SSE2 = false;
int AVX = false;
int AVX2 = false;
int info[4];
cpuid(info, 0);
int nIds = info[0];
// Detect Instruction Set
if (nIds >= 1){
cpuid(info,0x00000001);
SSE = (info[3] & ((int)1 << 25)) != 0;
SSE2 = (info[3] & ((int)1 << 26)) != 0;
AVX = (info[2] & ((int)1 << 28)) != 0;
}
if (nIds >= 7){
cpuid(info,0x00000007);
AVX2 = (info[1] & ((int)1 << 5)) != 0;
}
if (AVX2)
std::cout << "AVX2";
else if(AVX)
std::cout << "AVX";
else if(SSE2)
std::cout << "SSE2";
else if(SSE)
std::cout << "SSE";
return 0;
}
-26
View File
@@ -1,26 +0,0 @@
# Sample toolchain file for building for Windows from a Linux system.
#
# Typical usage:
# *) install cross compiler: `sudo apt-get install mingw-w64 g++-mingw-w64`
# *) cd build
# *) cmake -DCMAKE_TOOLCHAIN_FILE=~/Toolchain-Ubuntu-mingw64.cmake ..
set(CMAKE_SYSTEM_NAME Windows)
set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
# cross compilers to use for C and C++
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
# target environment on the build host system
# set 1st to dir with the cross compiler's C/C++ headers/libs
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
# modify default behavior of FIND_XXX() commands to
# search for headers/libs in the target environment and
# don't search for programs in the build host environment
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
-154
View File
@@ -1,154 +0,0 @@
# ------------------------- Begin Generic CMake Variable Logging ------------------
# /* C++ comment style not allowed */
# if you are building in-source, this is the same as CMAKE_SOURCE_DIR, otherwise
# this is the top level directory of your build tree
MESSAGE( STATUS "CMAKE_BINARY_DIR: " ${CMAKE_BINARY_DIR} )
# if you are building in-source, this is the same as CMAKE_CURRENT_SOURCE_DIR, otherwise this
# is the directory where the compiled or generated files from the current CMakeLists.txt will go to
MESSAGE( STATUS "CMAKE_CURRENT_BINARY_DIR: " ${CMAKE_CURRENT_BINARY_DIR} )
# this is the directory, from which cmake was started, i.e. the top level source directory
MESSAGE( STATUS "CMAKE_SOURCE_DIR: " ${CMAKE_SOURCE_DIR} )
# this is the directory where the currently processed CMakeLists.txt is located in
MESSAGE( STATUS "CMAKE_CURRENT_SOURCE_DIR: " ${CMAKE_CURRENT_SOURCE_DIR} )
# contains the full path to the top level directory of your build tree
MESSAGE( STATUS "PROJECT_BINARY_DIR: " ${PROJECT_BINARY_DIR} )
MESSAGE( STATUS "CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
# contains the full path to the root of your project source directory,
# i.e. to the nearest directory where CMakeLists.txt contains the PROJECT() command
MESSAGE( STATUS "PROJECT_SOURCE_DIR: " ${PROJECT_SOURCE_DIR} )
# set this variable to specify a common place where CMake should put all executable files
# (instead of CMAKE_CURRENT_BINARY_DIR)
MESSAGE( STATUS "EXECUTABLE_OUTPUT_PATH: " ${EXECUTABLE_OUTPUT_PATH} )
# set this variable to specify a common place where CMake should put all libraries
# (instead of CMAKE_CURRENT_BINARY_DIR)
MESSAGE( STATUS "LIBRARY_OUTPUT_PATH: " ${LIBRARY_OUTPUT_PATH} )
# tell CMake to search first in directories listed in CMAKE_MODULE_PATH
# when you use FIND_PACKAGE() or INCLUDE()
MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )
# this is the complete path of the cmake which runs currently (e.g. /usr/local/bin/cmake)
MESSAGE( STATUS "CMAKE_COMMAND: " ${CMAKE_COMMAND} )
# this is the CMake installation directory
MESSAGE( STATUS "CMAKE_ROOT: " ${CMAKE_ROOT} )
# this is the filename including the complete path of the file where this variable is used.
MESSAGE( STATUS "CMAKE_CURRENT_LIST_FILE: " ${CMAKE_CURRENT_LIST_FILE} )
# this is linenumber where the variable is used
MESSAGE( STATUS "CMAKE_CURRENT_LIST_LINE: " ${CMAKE_CURRENT_LIST_LINE} )
# this is used when searching for include files e.g. using the FIND_PATH() command.
MESSAGE( STATUS "CMAKE_INCLUDE_PATH: " ${CMAKE_INCLUDE_PATH} )
# this is used when searching for libraries e.g. using the FIND_LIBRARY() command.
MESSAGE( STATUS "CMAKE_LIBRARY_PATH: " ${CMAKE_LIBRARY_PATH} )
# the complete system name, e.g. "Linux-2.4.22", "FreeBSD-5.4-RELEASE" or "Windows 5.1"
MESSAGE( STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM} )
# the short system name, e.g. "Linux", "FreeBSD" or "Windows"
MESSAGE( STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME} )
# only the version part of CMAKE_SYSTEM
MESSAGE( STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION} )
# the processor name (e.g. "Intel(R) Pentium(R) M processor 2.00GHz")
MESSAGE( STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR} )
# is TRUE on all UNIX-like OS's, including Apple OS X and CygWin
MESSAGE( STATUS "UNIX: " ${UNIX} )
# is TRUE on Windows, including CygWin
MESSAGE( STATUS "WIN32: " ${WIN32} )
# is TRUE on Apple OS X
MESSAGE( STATUS "APPLE: " ${APPLE} )
# is TRUE when using the MinGW compiler in Windows
MESSAGE( STATUS "MINGW: " ${MINGW} )
# is TRUE on Windows when using the CygWin version of cmake
MESSAGE( STATUS "CYGWIN: " ${CYGWIN} )
# is TRUE on Windows when using a Borland compiler
MESSAGE( STATUS "BORLAND: " ${BORLAND} )
# Microsoft compiler
MESSAGE( STATUS "MSVC: " ${MSVC} )
MESSAGE( STATUS "MSVC_IDE: " ${MSVC_IDE} )
MESSAGE( STATUS "MSVC60: " ${MSVC60} )
MESSAGE( STATUS "MSVC70: " ${MSVC70} )
MESSAGE( STATUS "MSVC71: " ${MSVC71} )
MESSAGE( STATUS "MSVC80: " ${MSVC80} )
MESSAGE( STATUS "CMAKE_COMPILER_2005: " ${CMAKE_COMPILER_2005} )
# set this to true if you don't want to rebuild the object files if the rules have changed,
# but not the actual source files or headers (e.g. if you changed the some compiler switches)
MESSAGE( STATUS "CMAKE_SKIP_RULE_DEPENDENCY: " ${CMAKE_SKIP_RULE_DEPENDENCY} )
# since CMake 2.1 the install rule depends on all, i.e. everything will be built before installing.
# If you don't like this, set this one to true.
MESSAGE( STATUS "CMAKE_SKIP_INSTALL_ALL_DEPENDENCY: " ${CMAKE_SKIP_INSTALL_ALL_DEPENDENCY} )
# If set, runtime paths are not added when using shared libraries. Default it is set to OFF
MESSAGE( STATUS "CMAKE_SKIP_RPATH: " ${CMAKE_SKIP_RPATH} )
# set this to true if you are using makefiles and want to see the full compile and link
# commands instead of only the shortened ones
MESSAGE( STATUS "CMAKE_VERBOSE_MAKEFILE: " ${CMAKE_VERBOSE_MAKEFILE} )
# this will cause CMake to not put in the rules that re-run CMake. This might be useful if
# you want to use the generated build files on another machine.
MESSAGE( STATUS "CMAKE_SUPPRESS_REGENERATION: " ${CMAKE_SUPPRESS_REGENERATION} )
# A simple way to get switches to the compiler is to use ADD_DEFINITIONS().
# But there are also two variables exactly for this purpose:
# the compiler flags for compiling C sources
MESSAGE( STATUS "CMAKE_C_FLAGS: " ${CMAKE_C_FLAGS} )
# the compiler flags for compiling C++ sources
MESSAGE( STATUS "CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
# Choose the type of build. Example: SET(CMAKE_BUILD_TYPE Debug)
MESSAGE( STATUS "CMAKE_BUILD_TYPE: " ${CMAKE_BUILD_TYPE} )
# if this is set to ON, then all libraries are built as shared libraries by default.
MESSAGE( STATUS "BUILD_SHARED_LIBS: " ${BUILD_SHARED_LIBS} )
# the compiler used for C files
MESSAGE( STATUS "CMAKE_C_COMPILER: " ${CMAKE_C_COMPILER} )
# the compiler used for C++ files
MESSAGE( STATUS "CMAKE_CXX_COMPILER: " ${CMAKE_CXX_COMPILER} )
# if the compiler is a variant of gcc, this should be set to 1
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCC: " ${CMAKE_COMPILER_IS_GNUCC} )
# if the compiler is a variant of g++, this should be set to 1
MESSAGE( STATUS "CMAKE_COMPILER_IS_GNUCXX : " ${CMAKE_COMPILER_IS_GNUCXX} )
# the tools for creating libraries
MESSAGE( STATUS "CMAKE_AR: " ${CMAKE_AR} )
MESSAGE( STATUS "CMAKE_RANLIB: " ${CMAKE_RANLIB} )
#
#MESSAGE( STATUS ": " ${} )
# ------------------------- End of Generic CMake Variable Logging ------------------
-37
View File
@@ -1,37 +0,0 @@
# add a target to generate API documentation with Doxygen
find_package(Doxygen)
if(DOXYGEN_FOUND)
SET(OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/documentation/doxygen")
FILE(MAKE_DIRECTORY "${OUTPUT_DIR}")
FILE(TO_NATIVE_PATH ${OUTPUT_DIR} OUTPUT_DIR)
SET(OUTPUT_DIR \"${OUTPUT_DIR}\")
SET(INPUTS "${CMAKE_CURRENT_SOURCE_DIR}/code" "${CMAKE_CURRENT_SOURCE_DIR}/freespace2" "${CMAKE_CURRENT_SOURCE_DIR}/fred2" "${CMAKE_CURRENT_SOURCE_DIR}/wxfred2")
SET(INPUT_DIRS)
FOREACH(DIR IN LISTS INPUTS)
FILE(TO_NATIVE_PATH ${DIR} native_dir)
LIST(APPEND INPUT_DIRS \"${native_dir}\")
ENDFOREACH(DIR)
STRING(REPLACE ";" " " INPUT_DIRS "${INPUT_DIRS}")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/fs2open.Doxyfile.in
${CMAKE_CURRENT_BINARY_DIR}/fs2open.Doxyfile
@ONLY)
add_custom_target(doxygen
${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/fs2open.Doxyfile
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
COMMENT "Generating API documentation with Doxygen" VERBATIM
)
set_target_properties(doxygen
PROPERTIES
FOLDER "Documentation"
EXCLUDE_FROM_ALL ON
EXCLUDE_FROM_DEFAULT_BUILD ON
)
endif(DOXYGEN_FOUND)
-4054
View File
File diff suppressed because it is too large. Load diff
-16
View File
@@ -1,16 +0,0 @@
include(CheckIncludeFile)
add_library(speech INTERFACE)
if (WIN32)
CHECK_INCLUDE_FILE_CXX("sapi.h" HAVE_SAPI_H)
if (NOT HAVE_SAPI_H)
message(SEND_ERROR "sapi.h could not be found on your platform. Please disable speech support.")
endif()
else()
message(SEND_ERROR "Text to Speech is not supported on this platform!")
endif()
target_compile_definitions(speech INTERFACE -DFS2_SPEECH)
-9
View File
@@ -1,9 +0,0 @@
#ifndef __FREDRC_H
#define __FREDRC_H
#define ABOUT_LINE_1 "FRED2_OPEN - FreeSpace Editor, Version @FSO_PRODUCT_VERSION_STRING@ OpenGL"
#define MAINFRAME_CONTENTS "FRED2_OPEN @FSO_PRODUCT_VERSION_STRING@ - FreeSpace2 Mission Editor\nUntitled\nFRED2\nFreeSpace2 Missions (*.fs2)\n.fs2\nFreeSpace2Mission\nFreeSpace2 Mission"
#endif // __FREDRC_H
-7
View File
@@ -1,7 +0,0 @@
include(Cxx11)
include(platformChecks)
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/project.h.in ${GENERATED_SOURCE_DIR}/project.h)
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/fred_rc.h.in ${GENERATED_SOURCE_DIR}/fred_rc.h)
-9
View File
@@ -1,9 +0,0 @@
SET(BINARY_DESTINATION ".")
SET(LIBRAY_DESTINATION "${BINARY_DESTINATION}")
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
set(IS_64BIT TRUE)
else()
set(IS_64BIT FALSE)
endif()
-8
View File
@@ -1,8 +0,0 @@
SET(CODE_HEADERS ${CMAKE_SOURCE_DIR}/code)
SET(FREESPACE_HEADERS ${CMAKE_SOURCE_DIR}/freespace2)
SET(FRED_HEADERS ${CMAKE_SOURCE_DIR}/fred2)
SET(WXFRED_HEADERS ${CMAKE_SOURCE_DIR}/wxfred2)
-14
View File
@@ -1,14 +0,0 @@
SET(CPACK_PACKAGE_VERSION_MAJOR ${FSO_VERSION_MAJOR})
SET(CPACK_PACKAGE_VERSION_MINOR ${FSO_VERSION_MINOR})
SET(CPACK_PACKAGE_VERSION_PATCH ${FSO_VERSION_BUILD})
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY ${FSO_PROJECT_DESCRIPTION})
IF(WIN32)
SET(CPACK_NSIS_MUI_ICON ${FSO_INSTALLER_ICON})
set(CPACK_NSIS_MENU_LINKS "http://www.hard-light.net/" "FreeSpace Community")
ENDIF(WIN32)
include(CPack)
-34
View File
@@ -1,34 +0,0 @@
MESSAGE(STATUS "Doing Mac OSX specific things...")
target_compile_definitions(platform INTERFACE APPLE_APP)
SET(EXE_GUI_TYPE MACOSX_BUNDLE)
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
if (NOT COCOA_LIBRARY)
message(FATAL_ERROR "Couldn't find Cocoa!")
endif()
target_link_libraries(platform INTERFACE ${COCOA_LIBRARY})
SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.9")
SET(CMAKE_SKIP_RPATH FALSE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
SET(CMAKE_INSTALL_RPATH @loader_path/../Frameworks/)
# Set the path where library dependencies are copied to
SET(LIBRAY_DESTINATION "../Frameworks")
set(PLATFORM_MAC TRUE CACHE INTERNAL "" FORCE)
# Generate and don't strip debug symbols
# These settings don't seem to generate debug symbols for code and Freespace2
# so those settings are set manually in code and Freespace2's CMakeLists.txt files
set(CMAKE_XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS "YES")
set(CMAKE_XCODE_ATTRIBUTE_COPY_PHASE_STRIP "NO")
set(CMAKE_XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT "NO")
set(CMAKE_XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN "NO")
# Generate .dSYM file
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
-10
View File
@@ -1,10 +0,0 @@
target_compile_definitions(platform INTERFACE SCP_BSD)
find_library(EXECINFO_LIB execinfo)
if (NOT EXECINFO_LIB)
message(FATAL_ERROR "Couldn't find libexecinfo! Please install it and rerun the configuration.")
else()
target_link_libraries(platform INTERFACE "${EXECINFO_LIB}")
endif()
-18
View File
@@ -1,18 +0,0 @@
target_compile_definitions(platform INTERFACE SCP_SOLARIS)
find_library(SOCKET_LIB socket)
if (NOT SOCKET_LIB)
message(FATAL_ERROR "Couldn't find libsocket! Please install it and rerun the configuration.")
else()
target_link_libraries(platform INTERFACE "${SOCKET_LIB}")
endif()
find_library(NSL_LIB nsl)
if (NOT NSL_LIB)
message(FATAL_ERROR "Couldn't find libnsl! Please install it and rerun the configuration.")
else()
target_link_libraries(platform INTERFACE "${NSL_LIB}")
endif()
-13
View File
@@ -1,13 +0,0 @@
INCLUDE(util)
MESSAGE(STATUS "Configuring UNIX specific things and stuff...")
target_compile_definitions(platform INTERFACE SCP_UNIX USE_OPENAL)
# Set RPATH
set(CMAKE_SKIP_BUILD_RPATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "\$ORIGIN")
set(PLATFORM_UNIX TRUE CACHE INTERNAL "" FORCE)
-27
View File
@@ -1,27 +0,0 @@
MESSAGE(STATUS "Configuring Windows specific things and stuff...")
SET(WIN32_LIBS
comctl32
msacm32
odbc32
odbccp32
vfw32
winmm
wsock32
psapi
)
IF (MINGW)
SET(WIN32_LIBS ${WIN32_LIBS} mingw32)
ENDIF (MINGW)
target_link_libraries(platform INTERFACE ${WIN32_LIBS})
target_compile_definitions(platform INTERFACE WIN32 USE_OPENAL _WINDOWS)
# Specify minimum Windows version for the headers (currently this is XP)
target_compile_definitions(platform INTERFACE NTDDI_VERSION=0x05010000 _WIN32_WINNT=0x0501)
SET(EXE_GUI_TYPE WIN32)
set(PLATFORM_WINDOWS TRUE CACHE INTERNAL "" FORCE)
-48
View File
@@ -1,48 +0,0 @@
include(CheckFunctionExists)
include(CheckIncludeFiles)
include(CheckIncludeFile)
include(CheckIncludeFileCXX)
include(CheckLibraryExists)
include(CheckPrototypeDefinition)
include(CheckStructHasMember)
include(CheckSymbolExists)
include(CheckCXXSymbolExists)
include(CheckTypeSize)
CHECK_INCLUDE_FILE("execinfo.h" HAVE_EXECINFO_H)
CHECK_INCLUDE_FILE_CXX("cxxabi.h" HAVE_CXXAPI_H)
CHECK_TYPE_SIZE("max_align_t" MAX_ALIGN_T)
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set(CMAKE_REQUIRED_FLAGS "-std=c++11") # required for g++ <= 5
endif()
set(CMAKE_EXTRA_INCLUDE_FILES "cstddef")
CHECK_TYPE_SIZE("std::max_align_t" STD_MAX_ALIGN_T LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES "type_traits")
CHECK_TYPE_SIZE("std::is_trivially_copyable<int>" STD_IS_TRIVIALLY_COPYABLE LANGUAGE CXX)
set(CMAKE_EXTRA_INCLUDE_FILES)
CHECK_TYPE_SIZE("char32_t" CHAR32_T LANGUAGE CXX)
CHECK_TYPE_SIZE("U'b'" UNICODE_CHAR_LITERAL LANGUAGE CXX)
set(CMAKE_REQUIRED_FLAGS)
CHECK_FUNCTION_EXISTS(strcasecmp HAVE_STRCASECMP)
CHECK_FUNCTION_EXISTS(strncasecmp HAVE_STRNCASECMP)
CHECK_FUNCTION_EXISTS(_stricmp HAVE__STRICMP)
CHECK_FUNCTION_EXISTS(_strnicmp HAVE__STRNICMP)
CHECK_FUNCTION_EXISTS(strlwr HAVE_STRLWR)
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
check_symbol_exists(snprintf "stdio.h" HAVE_SNPRINTF)
check_symbol_exists(_snprintf "stdio.h" HAVE__SNPRINTF)
set(PLATFORM_CHECK_HEADER "${GENERATED_SOURCE_DIR}/platformChecks.h")
CONFIGURE_FILE(${CMAKE_CURRENT_LIST_DIR}/platformChecks.h.in "${PLATFORM_CHECK_HEADER}")
-31
View File
@@ -1,31 +0,0 @@
#ifndef __PLATFORM_CHECKS_H__
#define __PLATFORM_CHECKS_H__
#pragma once
#cmakedefine HAVE_EXECINFO_H
#cmakedefine HAVE_CXXAPI_H
#cmakedefine HAVE_MAX_ALIGN_T
#cmakedefine HAVE_STD_MAX_ALIGN_T
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE
#cmakedefine HAVE_STD_IS_TRIVIALLY_COPYABLE_ARRAY
#cmakedefine01 IS_64BIT
#cmakedefine01 HAVE_STRCASECMP
#cmakedefine01 HAVE_STRNCASECMP
#cmakedefine01 HAVE__STRICMP
#cmakedefine01 HAVE__STRNICMP
#cmakedefine01 HAVE_STRLWR
#cmakedefine01 HAVE_STRINGS_H
#cmakedefine01 HAVE_CHAR32_T
#cmakedefine01 HAVE_UNICODE_CHAR_LITERAL
#cmakedefine01 HAVE_SNPRINTF
#cmakedefine01 HAVE__SNPRINTF
#endif // __PLATFORM_CHECKS_H__
-29
View File
@@ -1,29 +0,0 @@
add_library(platform INTERFACE)
IF(FSO_CMAKE_DEBUG)
INCLUDE(debug-vars)
ENDIF(FSO_CMAKE_DEBUG)
set(PLATFORM_WINDOWS FALSE CACHE INTERNAL "" FORCE)
set(PLATFORM_UNIX FALSE CACHE INTERNAL "" FORCE)
set(PLATFORM_LINUX FALSE CACHE INTERNAL "" FORCE)
set(PLATFORM_MAC FALSE CACHE INTERNAL "" FORCE)
IF(WIN32)
INCLUDE(platform-win32)
ELSEIF(UNIX)
INCLUDE(platform-unix)
IF(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
INCLUDE(platform-freebsd)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
INCLUDE(platform-solaris)
ELSEIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
include(platform-darwin)
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
set(PLATFORM_LINUX TRUE CACHE INTERNAL "" FORCE)
ENDIF()
ELSE(WIN32)
MESSAGE(STATUS "This platform is not supported, good luck!")
ENDIF(WIN32)
-17
View File
@@ -1,17 +0,0 @@
#ifndef __PROJECT_H
#define __PROJECT_H
#define FS_VERSION_MAJOR @FSO_VERSION_MAJOR@
#define FS_VERSION_MINOR @FSO_VERSION_MINOR@
#define FS_VERSION_BUILD @FSO_VERSION_BUILD@
#define FS_VERSION_REVIS @FSO_VERSION_REVISION@
#define FS_VERSION_REVIS_STR "@FSO_VERSION_REVISION_STR@"
#define FS_VERSION_HAS_REVIS @FSO_VERSION_HAS_REVISION@
#define FS_VERSION_FULL "@FSO_FULL_VERSION_STRING@"
#define FS_PRODUCT_VERSION "@FSO_PRODUCT_VERSION_STRING@"
#endif // __PROJECT_H
-20
View File
@@ -1,20 +0,0 @@
MESSAGE(STATUS "Doing configuration specific to Apple Clang...")
# TODO: Actually add Mac specific flags here...
# Suppress specific warning
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -funroll-loops -fsigned-char -Wno-unknown-pragmas")
# Omit "conversion from string literal to 'char *' is deprecated" warnings.
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-write-strings")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-function")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated -Wno-char-subscripts")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fcolor-diagnostics")
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-unused-variable")
set(CMAKE_CXX_FLAGS_DEBUG "-Wextra -Wshadow -Wno-unused-parameter")
-111
View File
@@ -1,111 +0,0 @@
# Clang
include(EnableExtraCompilerWarnings)
include(CheckCXXCompilerFlag)
MESSAGE(STATUS "Doing configuration specific to clang...")
option(CLANG_ENABLE_LEAK_CHECK "Enable -fsanitize=leak" OFF)
option(CLANG_ENABLE_ADDRESS_SANITIZER "Enable -fsanitize=address" OFF)
# These are the default values
set(C_BASE_FLAGS "-march=native -pipe")
set(CXX_BASE_FLAGS "-march=native -pipe")
# For C and C++, the values can be overwritten independently
if(DEFINED ENV{CXXFLAGS})
set(CXX_BASE_FLAGS $ENV{CXXFLAGS})
endif()
if(DEFINED ENV{CFLAGS})
set(C_BASE_FLAGS $ENV{CFLAGS})
endif()
# Initialize with an empty string to make sure we always get a clean start
set(COMPILER_FLAGS "")
# This is a slight hack since our flag setup is a bit more complicated
_enable_extra_compiler_warnings_flags()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
# Omit "argument unused during compilation" when clang is used with ccache.
if(${CMAKE_CXX_COMPILER} MATCHES "ccache")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Qunused-arguments")
endif()
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# Force color diagnostics for Ninja generator
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdiagnostics-color")
endif()
# Start with an empty list
set(SANITIZE_FLAGS)
if(CLANG_ENABLE_ADDRESS_SANITIZER)
set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
CHECK_C_COMPILER_FLAG("-fsanitize=address" SUPPORTS_SANITIZE_ADDRESS)
if (SUPPORTS_SANITIZE_ADDRESS)
set(SANITIZE_FLAGS ${SANITIZE_FLAGS} "address")
endif()
endif()
if (CLANG_ENABLE_LEAK_CHECK)
check_linker_flag("-fsanitize=leak" SUPPORTS_FSANITIZE_LEAK)
if (SUPPORTS_FSANITIZE_LEAK)
set(SANITIZE_FLAGS ${SANITIZE_FLAGS} "leak")
endif()
endif()
string(REPLACE ";" "," SANITIZE_FLAGS "${SANITIZE_FLAGS}")
if (NOT "${SANITIZE_FLAGS}" STREQUAL "")
set(SANITIZE_FLAGS "-fsanitize=${SANITIZE_FLAGS}")
endif()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${SANITIZE_FLAGS}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wformat-security")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-function")
# Dear Clang, please tell us if a function does not return a value since that part of the standard is stupid!
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wreturn-type")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-char-subscripts")
check_cxx_compiler_flag(-Wshift-negative-value SUPPORTS_SHIFT_NEGATIVE_VALUE)
if(SUPPORTS_SHIFT_NEGATIVE_VALUE)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-shift-negative-value")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-parameter")
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# Always use the base flags and add our compiler flags at the bacl
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${C_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
if (SANITIZE_FLAGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}")
endif()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g -rdynamic")
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
target_compile_options(compiler INTERFACE "-Werror")
endif()
# Always define this to make sure that the fixed width format macros are available
target_compile_definitions(compiler INTERFACE __STDC_FORMAT_MACROS)
-144
View File
@@ -1,144 +0,0 @@
include(EnableExtraCompilerWarnings)
include(CheckCCompilerFlag)
include(util)
MESSAGE(STATUS "Doing configuration specific to gcc...")
option(GCC_ENABLE_LEAK_CHECK "Enable -fsanitize=leak" OFF)
option(GCC_ENABLE_ADDRESS_SANITIZER "Enable -fsanitize=address" OFF)
option(GCC_ENABLE_SANITIZE_UNDEFINED "Enable -fsanitize=undefined" OFF)
# These are the default values
set(C_BASE_FLAGS "-march=native -pipe")
set(CXX_BASE_FLAGS "-march=native -pipe")
# For C and C++, the values can be overwritten independently
if(DEFINED ENV{CFLAGS})
set(C_BASE_FLAGS $ENV{CFLAGS})
endif()
if(DEFINED ENV{CXXFLAGS})
set(CXX_BASE_FLAGS $ENV{CXXFLAGS})
endif()
# Initialize with an empty string to make sure we always get a clean start
set(COMPILER_FLAGS "")
# This is a slight hack since our flag setup is a bit more complicated
_enable_extra_compiler_warnings_flags()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${_flags}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -funroll-loops -fsigned-char -Wno-unknown-pragmas")
# Place each function and data in its own section so the linker can
# perform dead code elimination
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdata-sections -ffunction-sections")
if ("${CMAKE_GENERATOR}" STREQUAL "Ninja")
# Force color diagnostics for Ninja generator
CHECK_C_COMPILER_FLAG(-fdiagnostics-color SUPPORTS_DIAGNOSTIC_COLOR)
if(SUPPORTS_DIAGNOSTIC_COLOR)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -fdiagnostics-color")
endif()
endif()
# Start with an empty list
set(SANITIZE_FLAGS)
if(GCC_ENABLE_ADDRESS_SANITIZER)
set(CMAKE_REQUIRED_FLAGS "-fsanitize=address")
CHECK_C_COMPILER_FLAG("-fsanitize=address" SUPPORTS_SANITIZE_ADDRESS)
if (SUPPORTS_SANITIZE_ADDRESS)
set(SANITIZE_FLAGS ${SANITIZE_FLAGS} "address")
endif()
endif()
if (GCC_ENABLE_LEAK_CHECK)
check_linker_flag("-fsanitize=leak" SUPPORTS_FSANITIZE_LEAK)
if (SUPPORTS_FSANITIZE_LEAK)
set(SANITIZE_FLAGS ${SANITIZE_FLAGS} "leak")
endif()
endif()
if (GCC_ENABLE_SANITIZE_UNDEFINED)
check_linker_flag("-fsanitize=undefined" SUPPORTS_SANITIZE_UNDEFINED)
if (SUPPORTS_SANITIZE_UNDEFINED)
set(SANITIZE_FLAGS ${SANITIZE_FLAGS} "undefined")
endif()
endif()
string(REPLACE ";" "," SANITIZE_FLAGS "${SANITIZE_FLAGS}")
if (NOT "${SANITIZE_FLAGS}" STREQUAL "")
set(SANITIZE_FLAGS "-fsanitize=${SANITIZE_FLAGS}")
endif()
set(COMPILER_FLAGS "${COMPILER_FLAGS} ${SANITIZE_FLAGS}")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wformat-security")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-unused-function")
# Dear GCC, please tell us if a function does not return a value since that part of the standard is stupid!
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wreturn-type")
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-deprecated -Wno-char-subscripts")
# These two warnings cause a lot of false-positives in the FSO code base
check_cxx_compiler_flag(-Wstringop-truncation SUPPORTS_STRINGOP_TRUNCATION)
if(SUPPORTS_STRINGOP_TRUNCATION)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-stringop-truncation")
endif()
check_cxx_compiler_flag(-Wstringop-overflow SUPPORTS_STRINGOP_OVERFLOW)
if(SUPPORTS_STRINGOP_TRUNCATION)
set(COMPILER_FLAGS "${COMPILER_FLAGS} -Wno-stringop-overflow")
endif()
set(COMPILER_FLAGS_RELEASE "-O2 -Wno-unused-variable -Wno-unused-but-set-variable -Wno-array-bounds -Wno-empty-body -Wno-clobbered -Wno-unused-parameter")
set(COMPILER_FLAGS_DEBUG "-O0 -g -Wshadow")
# Always use the base flags and add our compiler flags at the bacl
set(CMAKE_CXX_FLAGS "${CXX_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_C_FLAGS "${C_BASE_FLAGS} ${COMPILER_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_C_FLAGS_RELEASE ${COMPILER_FLAGS_RELEASE})
set(CMAKE_CXX_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_C_FLAGS_DEBUG ${COMPILER_FLAGS_DEBUG})
set(CMAKE_EXE_LINKER_FLAGS "")
IF (MINGW)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -static-libgcc -static-libstdc++ -Wl,--enable-auto-import")
target_compile_definitions(compiler INTERFACE __USE_MINGW_ANSI_STDIO=1)
ENDIF(MINGW)
if (SANITIZE_FLAGS)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${SANITIZE_FLAGS}")
endif()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "-g")
IF(NOT MINGW)
SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -rdynamic")
# Allow the linker to perform dead code elimination; this is considered
# experimental for COFF and PE formats and thus disabled for Windows builds
# (https://sourceware.org/binutils/docs/ld/Options.html)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections")
ENDIF(NOT MINGW)
IF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
SET(CMAKE_EXE_LINKER_FLAGS "-Wl,-zignore")
ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "SunOS")
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
target_compile_options(compiler INTERFACE "-Werror")
endif()
# Always define this to make sure that the fixed width format macros are available
target_compile_definitions(compiler INTERFACE __STDC_FORMAT_MACROS=1)
-145
View File
@@ -1,145 +0,0 @@
include(EnableExtraCompilerWarnings)
include(CheckCXXCompilerFlag)
include(util)
MESSAGE(STATUS "Doing configuration specific to visual studio...")
set_property(GLOBAL PROPERTY DEBUG_CONFIGURATIONS Debug)
option(MSVC_USE_RUNTIME_DLL "Use the dynamically linked version of the runtime" OFF)
option(MSVC_RELEASE_DEBUGGING "Set options that allow to debug release builds" OFF)
MARK_AS_ADVANCED(FORCE MSVC_USE_RUNTIME_DLL)
MARK_AS_ADVANCED(FORCE MSVC_RELEASE_DEBUGGING)
# These are the warnings we disable
set(WARNING_FLAGS
/wd4100 # unreferenced formal parameters
/wd4127 # constant conditional (assert)
/wd4201 # nonstandard extension used: nameless struct/union (happens a lot in Windows include headers)
/wd4290 # C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
/wd4390 # empty control statement (triggered by nprintf and mprintf's inside of one-line if's, etc)
/wd4410 # illegal size for operand... ie... fxch st(1)
/wd4511 # copy constructor could not be generated (happens a lot in Windows include headers)
/wd4512 # assignment operator could not be generated (happens a lot in Windows include headers)
/wd4514 # unreferenced inline function removed
/wd4611 # _setjmp warning. Since we use setjmp alot, and we don't really use constructors or destructors, this warning doesn't really apply to us.
/wd4663 # C++ language change (template specification)
/wd4710 # is inline function not expanded (who cares?)
/wd4711 # tells us an inline function was expanded (who cares?)
/wd4786 # is identifier truncated to 255 characters (happens all the time in Microsoft #includes) -- Goober5000"
/wd4996 # deprecated strcpy, strcat, sprintf, etc. (from MSVC 2005) - taylor
/wd4311 # Disables warnings about casting pointer types to ints. The funny thing is these warnings can't be resolved, just disabled... - m!m
/wd4302 # Same as above - m!m
/wd4366 # The result of the unary '&' operator may be unaligned - m!m
/wd4592 # "symbol will be dynamically initialized" is being generated by a compiler bug, see https://stackoverflow.com/a/34027257 for an explanation - m!m
$<$<CONFIG:Release>:/wd4101> # In release mode there are unreferenced variables because debug needs them
/wd4995 # "'vsprintf': name was marked as #pragma deprecated" is being caused by our custom definition of vsprintf. I have no idea what causes this or how to fix it - m!m
/wd4723 # "potential divide by 0" is caused by some code that definitely will not divide by zero - m!m
)
target_compile_options(compiler INTERFACE ${WARNING_FLAGS})
# Base
set(CMAKE_C_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_CXX_FLAGS "/MP /GS- /analyze- /Zc:wchar_t /errorReport:prompt /WX- /Zc:forScope /Gd /EHsc /nologo /Zm200")
set(CMAKE_EXE_LINKER_FLAGS "/MANIFEST /DYNAMICBASE:NO /SAFESEH:NO /ERRORREPORT:PROMPT /NOLOGO")
set(CMAKE_STATIC_LINKER_FLAGS "")
# Release
set(CMAKE_C_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_CXX_FLAGS_RELEASE "/GL /W2 /Gy- /Ox /Ot /Ob2 /fp:precise /GF /Oy /Oi /Zi /W3")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /LTCG /INCREMENTAL:NO")
set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "/LTCG")
globally_enable_extra_compiler_warnings()
if (MSVC_RELEASE_DEBUGGING)
CHECK_CXX_COMPILER_FLAG("/Zo" MSVC_COMPILER_SUPPORTS_ARCH_ZO)
if (MSVC_COMPILER_SUPPORTS_ARCH_ZO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zo")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zo")
endif()
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG")
endif()
IF(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MD")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MD")
ELSE(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
ENDIF(MSVC_USE_RUNTIME_DLL)
# Debug
set(CMAKE_C_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
set(CMAKE_CXX_FLAGS_DEBUG "/W4 /Gy /Zi /Od /RTC1 /Gd /Oy-")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /INCREMENTAL:NO /MAPINFO:EXPORTS /NODEFAULTLIB:libcmt.lib")
IF(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MDd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MDd")
ELSE(MSVC_USE_RUNTIME_DLL)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /MTd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
ENDIF(MSVC_USE_RUNTIME_DLL)
INCLUDE(MSVCMultipleProcessCompile)
# Visual Studio supports compiling for multiple vector instruction sets
SET(POSSIBLE_INSTUCTION_SETS "" SSE SSE2 AVX AVX2)
if (NOT DEFINED MSVC_SIMD_INSTRUCTIONS)
detect_simd_instructions(MSVC_DETECTED_SIMD_INSTRUCTIONS)
SET(MSVC_SIMD_INSTRUCTIONS "${MSVC_DETECTED_SIMD_INSTRUCTIONS}" CACHE FILEPATH "The SIMD instructions which will be used, possible values are ${POSSIBLE_INSTUCTION_SETS}")
MARK_AS_ADVANCED(FORCE MSVC_SIMD_INSTRUCTIONS)
endif()
set(FSO_INSTRUCTION_SET ${MSVC_SIMD_INSTRUCTIONS})
LIST(FIND POSSIBLE_INSTUCTION_SETS "${MSVC_SIMD_INSTRUCTIONS}" SET_INDEX)
if (SET_INDEX LESS 0)
MESSAGE(STATUS "An invalid instruction set was specified, defaulting to no special compiler options.")
else()
IF (NOT SET_INDEX EQUAL 0)
SET(FOUND)
FOREACH(list_index RANGE ${SET_INDEX} 1)
list(GET POSSIBLE_INSTUCTION_SETS ${list_index} _simd_set)
CHECK_CXX_COMPILER_FLAG("/arch:${_simd_set}" COMPILER_SUPPORTS_ARCH_${_simd_set})
IF(COMPILER_SUPPORTS_ARCH_${_simd_set})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:${_simd_set}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:${_simd_set}")
SET(FOUND TRUE)
BREAK()
ENDIF()
ENDFOREACH(list_index)
IF(NOT FOUND)
# Don't set anything, it will likely not work
MESSAGE(STATUS "Your compiler does not support any optimization flags, defaulting to none")
ENDIF(NOT FOUND)
ELSE()
CHECK_CXX_COMPILER_FLAG("/arch:IA32" COMPILER_SUPPORTS_ARCH_IA32)
IF(COMPILER_SUPPORTS_ARCH_IA32)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /arch:IA32")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:IA32")
ENDIF(COMPILER_SUPPORTS_ARCH_IA32)
ENDIF()
endif()
target_compile_definitions(compiler INTERFACE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS _SECURE_SCL=0 NOMINMAX
"$<$<CONFIG:FastDebug>:_ITERATOR_DEBUG_LEVEL=0>" _SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING)
if (FSO_FATAL_WARNINGS)
# Make warnings fatal if the right variable is set
target_compile_options(compiler INTERFACE "/WX")
endif()
-33
View File
@@ -1,33 +0,0 @@
# File to execute compiler specific commands
add_library(compiler INTERFACE)
target_compile_definitions(compiler INTERFACE "$<$<CONFIG:Release>:NDEBUG>;$<$<CONFIG:Debug>:_DEBUG>;$<$<CONFIG:FastDebug>:_DEBUG>")
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
include(toolchain-gcc)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
include(toolchain-msvc)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
include(toolchain-clang)
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
include(toolchain-apple-clang)
ELSE("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
MESSAGE(STATUS "No special handling for this compiler present, good luck!")
ENDIF("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# Copy release settings to FastDebug
set(CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_RELEASE}")
set(CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_RELEASE}")
set(CMAKE_EXE_LINKER_FLAGS_FASTDEBUG "${CMAKE_EXE_LINKER_FLAGS_RELEASE}")
set(CMAKE_STATIC_LINKER_FLAGS_FASTDEBUG "${CMAKE_STATIC_LINKER_FLAGS_RELEASE}")
if (MSVC)
# Adjust runtime library
string(REPLACE "/MD" "/MDd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
string(REPLACE "/MT" "/MTd" CMAKE_C_FLAGS_FASTDEBUG "${CMAKE_C_FLAGS_FASTDEBUG}")
string(REPLACE "/MD" "/MDd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
string(REPLACE "/MT" "/MTd" CMAKE_CXX_FLAGS_FASTDEBUG "${CMAKE_CXX_FLAGS_FASTDEBUG}")
endif()
-237
View File
@@ -1,237 +0,0 @@
include(CheckCCompilerFlag)
FUNCTION(MAKE_CACHE_INTERNAL VARIABLE)
SET(${VARIABLE} ${${VARIABLE}} CACHE INTERNAL "Internal cache variable")
ENDFUNCTION(MAKE_CACHE_INTERNAL)
FUNCTION(ADD_IMPORTED_LIB NAME INCLUDES LIBS)
ADD_LIBRARY(${NAME} INTERFACE)
target_link_libraries(${NAME} INTERFACE "${LIBS}")
target_include_directories(${NAME} SYSTEM INTERFACE "${INCLUDES}")
ENDFUNCTION(ADD_IMPORTED_LIB)
MACRO(PKG_CONFIG_LIB_RESOLVE NAME OUTVAR)
SET(${OUTVAR} "")
foreach(lib ${${NAME}_LIBRARIES})
find_library(${lib}_LIBRARY
NAMES ${lib}
HINTS ${${NAME}_LIBDIR} ${${NAME}_LIBRARY_DIRS}
)
if (NOT ${${lib}_LIBRARY} MATCHES ".*NOTFOUND.*")
SET(${OUTVAR} ${${OUTVAR}} ${${lib}_LIBRARY})
endif (NOT ${${lib}_LIBRARY} MATCHES ".*NOTFOUND.*")
endforeach(lib)
ENDMACRO(PKG_CONFIG_LIB_RESOLVE)
# Copy from http://cmake.3232098.n2.nabble.com/RFC-cmake-analog-to-AC-SEARCH-LIBS-td7585423.html
INCLUDE (CheckFunctionExists)
INCLUDE (CheckLibraryExists)
MACRO (CMAKE_SEARCH_LIBS v_func v_lib func)
CHECK_FUNCTION_EXISTS (${func} ${v_func})
IF (NOT ${v_func})
FOREACH (lib ${ARGN})
CHECK_LIBRARY_EXISTS (${lib} ${func} "" "HAVE_${func}_IN_${lib}")
IF (${HAVE_${func}_IN_${lib}})
SET (${v_func} TRUE)
SET (${v_lib} "${lib}" CACHE INTERNAL "Library providing ${func}")
BREAK()
ENDIF (${HAVE_${func}_IN_${lib}})
ENDFOREACH (lib)
ENDIF (NOT ${v_func})
ENDMACRO (CMAKE_SEARCH_LIBS)
# End copy
FUNCTION(EP_CHECK_FILE_EXISTS FILE OUTVAR TARGET NAME COMMAND WORKING_DIR)
string (REPLACE ";" " " COMMAND_STR "${COMMAND}")
IF(WIN32)
# Do something special for windows...
SET(COMMAND "cmd /C \"${COMMAND_STR}\"")
ELSE(WIN32)
SET(COMMAND "${COMMAND_STR}")
ENDIF(WIN32)
FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME}" "
IF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
MESSAGE(\"'${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}' already exists, nothing to be done.\")
ELSE(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
execute_process(COMMAND ${COMMAND} WORKING_DIRECTORY \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${WORKING_DIR}\")
ENDIF(EXISTS \"${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${FILE}\")
")
SET(${OUTVAR} "${CMAKE_COMMAND}" -P ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}/${NAME} PARENT_SCOPE)
ENDFUNCTION(EP_CHECK_FILE_EXISTS)
MACRO(COPY_FILE_TO_TARGET _target _file)
if(UNIX)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND cp -a "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
)
else()
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different "${_file}" "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "copying '${_file}'..."
)
endif()
endmacro(COPY_FILE_TO_TARGET)
MACRO(COPY_FILES_TO_TARGET _target)
if(UNIX)
ADD_CUSTOM_COMMAND(
TARGET ${_target} POST_BUILD
COMMAND mkdir -p "$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/"
COMMENT "Creating '$<TARGET_FILE_DIR:${_target}>/${LIBRAY_DESTINATION}/'..."
)
endif()
FOREACH(file IN LISTS TARGET_COPY_FILES)
COPY_FILE_TO_TARGET("${_target}" "${file}")
ENDFOREACH(file)
ENDMACRO(COPY_FILES_TO_TARGET)
macro(_clear_old_libraries_state)
set(is_debug FALSE)
set(is_optimized FALSE)
endmacro(_clear_old_libraries_state)
function(CONVERT_OLD_LIBRARIES)
_clear_old_libraries_state()
set(out_list)
foreach(lib ${ARGV})
if ("${lib}" STREQUAL "debug")
_clear_old_libraries_state()
set(is_debug TRUE)
elseif("${lib}" STREQUAL "optimized")
_clear_old_libraries_state()
set(is_optimized TRUE)
elseif("${lib}" STREQUAL "general")
_clear_old_libraries_state()
else("${lib}" STREQUAL "debug")
# Expecting normal library
if(is_debug)
list(APPEND out_list "$<$<CONFIG:Debug>:${lib}>" "$<$<CONFIG:FastDebug>:${lib}>")
elseif(is_optimized)
list(APPEND out_list "$<$<CONFIG:Release>:${lib}>")
else(is_debug)
list(APPEND out_list "${lib}")
endif(is_debug)
endif("${lib}" STREQUAL "debug")
endforeach(lib)
set(CONVERTED_LIBRARIES ${out_list} PARENT_SCOPE)
endfunction(CONVERT_OLD_LIBRARIES)
macro(set_policy policy value)
if (POLICY ${policy})
cmake_policy(SET ${policy} ${value})
endif ()
endmacro(set_policy)
macro(set_if_not_defined VAR VALUE)
if (NOT DEFINED ${VAR})
set(${VAR} ${VALUE})
endif()
endmacro(set_if_not_defined)
macro(configure_cotire target)
if(ENABLE_COTIRE)
# Disable unity build as it doesn't work well for us
set_target_properties(${target} PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE)
cotire(${target})
endif()
endmacro(configure_cotire)
macro(add_target_copy_files)
foreach(file ${ARGN})
if (IS_DIRECTORY "${file}")
INSTALL(DIRECTORY ${file}
DESTINATION ${LIBRAY_DESTINATION}
)
else()
INSTALL(FILES ${file}
DESTINATION ${LIBRAY_DESTINATION}
)
endif()
SET(TARGET_COPY_FILES ${TARGET_COPY_FILES} ${file} CACHE INTERNAL "" FORCE)
endforeach()
endmacro(add_target_copy_files)
function(detect_simd_instructions _out_var)
if(CMAKE_CROSSCOMPILING)
set(${_out_var} "" PARENT_SCOPE)
else()
message(STATUS "Detecting SIMD features of current CPU...")
TRY_RUN(RUN_RESULT COMPILE_RESULT "${CMAKE_BINARY_DIR}/temp" "${CMAKE_SOURCE_DIR}/cmake/cpufeatures.cpp"
RUN_OUTPUT_VARIABLE FEATURE_OUTPUT)
IF(COMPILE_RESULT)
MESSAGE(STATUS "Detected compatibility for the ${FEATURE_OUTPUT} feature set.")
SET(${_out_var} ${FEATURE_OUTPUT} PARENT_SCOPE)
ELSE(COMPILE_RESULT)
MESSAGE("Compilation of CPU feature detector failed, please set the instruction set manually.")
set(${_out_var} "" PARENT_SCOPE)
ENDIF(COMPILE_RESULT)
endif()
endfunction()
function (check_linker_flag _flag _out_var)
SET(CMAKE_REQUIRED_FLAGS "${_flag}")
CHECK_C_COMPILER_FLAG("" ${_out_var})
endfunction(check_linker_flag)
# Suppresses warnings for the specified target
function(suppress_warnings _target)
if (MSVC)
target_compile_options(${_target} PRIVATE "/W0")
else()
# Assume everything else uses GCC style options
target_compile_options(${_target} PRIVATE "-w")
endif()
endfunction(suppress_warnings)
function(list_target_dependencies _target _out_var)
set(out_list)
set(work_libs ${_target})
list(LENGTH work_libs libs_length)
while(libs_length GREATER 0)
list(GET work_libs 0 current)
list(REMOVE_AT work_libs 0)
list(APPEND out_list ${current})
get_target_property(current_libs ${current} INTERFACE_LINK_LIBRARIES)
if(current_libs)
foreach(lib ${current_libs})
if (TARGET ${lib})
list(APPEND work_libs ${lib})
endif (TARGET ${lib})
endforeach(lib)
endif(current_libs)
list(LENGTH work_libs libs_length)
endwhile(libs_length GREATER 0)
list(REMOVE_DUPLICATES out_list)
set(${_out_var} ${out_list} PARENT_SCOPE)
endfunction(list_target_dependencies)
macro(add_file_folder FOLDER_NAME)
string(MAKE_C_IDENTIFIER "${FOLDER_NAME}" VARIABLE_NAME)
set(files_${VARIABLE_NAME} ${files_${VARIABLE_NAME}} ${ARGN})
string(REPLACE "/" "\\" FIXED_FOLDER_FILE "${FOLDER_NAME}")
source_group("${FIXED_FOLDER_FILE}" FILES ${ARGN})
set(source_files ${source_files} ${ARGN})
endmacro(add_file_folder)
-52
View File
@@ -1,52 +0,0 @@
include(util)
if (EXISTS "${PROJECT_SOURCE_DIR}/version_override.cmake")
# This allows to override the values by using a special file
include("${PROJECT_SOURCE_DIR}/version_override.cmake")
endif()
set_if_not_defined(FSO_VERSION_MAJOR 3)
set_if_not_defined(FSO_VERSION_MINOR 8)
set_if_not_defined(FSO_VERSION_BUILD 1)
# A numeric revision e.g. the CI build number
set_if_not_defined(FSO_VERSION_REVISION 0)
# A generic revision string, can be anything
set_if_not_defined(FSO_VERSION_REVISION_STR "${FSO_VERSION_REVISION}")
if("${FSO_VERSION_REVISION}" STREQUAL "0" AND "${FSO_VERSION_REVISION_STR}" STREQUAL "${FSO_VERSION_REVISION}")
set(FSO_VERSION_HAS_REVISION 0)
else()
set(FSO_VERSION_HAS_REVISION 1)
endif()
set(FSO_FULL_VERSION_STRING "${FSO_VERSION_MAJOR}.${FSO_VERSION_MINOR}.${FSO_VERSION_BUILD}")
set(FSO_PRODUCT_VERSION_STRING "${FSO_FULL_VERSION_STRING}")
if (FSO_VERSION_HAS_REVISION)
set(FSO_FULL_VERSION_STRING "${FSO_FULL_VERSION_STRING}.${FSO_VERSION_REVISION_STR}")
endif()
IF(NOT FSO_VERSION_HAS_REVISION)
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}")
ELSE()
SET(FSO_BINARY_SUFFIX "${FSO_VERSION_MAJOR}_${FSO_VERSION_MINOR}_${FSO_VERSION_BUILD}_${FSO_VERSION_REVISION_STR}")
ENDIF()
IF(IS_64BIT)
# This is a 64-bit builds
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_x64")
ENDIF()
IF (NOT "${FSO_INSTRUCTION_SET}" STREQUAL "")
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_${FSO_INSTRUCTION_SET}")
ENDIF()
IF (NOT "${FSO_BUILD_POSTFIX}" STREQUAL "")
SET(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}_${FSO_BUILD_POSTFIX}")
ENDIF()
set(CONFIG_POSTFIX "$<$<CONFIG:Release>:>$<$<CONFIG:Debug>:-DEBUG>$<$<CONFIG:FastDebug>:-FASTDBG>")
set(FSO_BINARY_SUFFIX "${FSO_BINARY_SUFFIX}${CONFIG_POSTFIX}")
-87
View File
@@ -1,87 +0,0 @@
INCLUDE(source_groups.cmake)
INCLUDE(voice_rec.cmake)
ADD_LIBRARY(code STATIC ${source_files} ${VOICE_REC_FILES})
target_compile_features(code PUBLIC ${REQUIRED_CXX_FEATURES})
INCLUDE(default_files.cmake)
if (MSVC)
target_compile_definitions(code PUBLIC "PDB_DEBUGGING=1")
endif(MSVC)
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${CODE_HEADERS})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${FREESPACE_HEADERS})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(code PUBLIC ${GENERATED_SOURCE_DIR}/code)
target_link_libraries(code PUBLIC OpenGL)
TARGET_LINK_LIBRARIES(code PUBLIC openal)
TARGET_LINK_LIBRARIES(code PUBLIC ${LUA_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${PNG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC ${JPEG_LIBS})
TARGET_LINK_LIBRARIES(code PUBLIC sdl2)
TARGET_LINK_LIBRARIES(code PUBLIC ffmpeg)
TARGET_LINK_LIBRARIES(code PUBLIC utfcpp)
TARGET_LINK_LIBRARIES(code PUBLIC platform)
TARGET_LINK_LIBRARIES(code PUBLIC compiler)
target_link_libraries(code PUBLIC md5)
target_link_libraries(code PUBLIC discord-rpc)
target_link_libraries(code PUBLIC libRocket)
enable_clang_tidy(code)
IF (FSO_USE_SPEECH)
find_package(Speech REQUIRED)
target_link_libraries(code PUBLIC speech)
ENDIF(FSO_USE_SPEECH)
TARGET_LINK_LIBRARIES(code PUBLIC jansson)
# Headers for standalone "gui" on UNIX
IF(UNIX)
TARGET_LINK_LIBRARIES(code PUBLIC ${MONGOOSE_LIBS})
ENDIF(UNIX)
IF(FSO_BUILD_TOOLS)
ADD_SUBDIRECTORY(cfilearchiver)
ADD_SUBDIRECTORY(cfileextractor)
ENDIF(FSO_BUILD_TOOLS)
if (ENABLE_COTIRE)
set_target_properties(code PROPERTIES COTIRE_CXX_PREFIX_HEADER_INIT "${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h")
else()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:/FI ${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
elseif("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang")
target_compile_options(code PRIVATE "$<$<COMPILE_LANGUAGE:CXX>:-include${CMAKE_CURRENT_SOURCE_DIR}/prefix_header.h>")
ELSE()
MESSAGE("Unknown compiler for global includes. This will probably break the build.")
ENDIF()
endif()
include(util)
configure_cotire(code)
# Ensure that Xcode generates debug symbols on macOS for Debug builds
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_GCC_GENERATE_DEBUGGING_SYMBOLS[variant=Debug] "YES")
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_COPY_PHASE_STRIP[variant=Debug] "NO")
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_STRIP_INSTALLED_PRODUCT[variant=Debug] "NO")
set_target_properties(code PROPERTIES XCODE_ATTRIBUTE_GCC_SYMBOLS_PRIVATE_EXTERN[variant=Debug] "NO")
+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
##
###############################################################################
+19 -26
View File
@@ -7,26 +7,23 @@
*
*/
/**
* @file
* The code in here is just for bookeeping, allocating AI slots and linking them to ships.
* See AiCode.cpp for the actual AI code.
*/
// The code in here is just for bookeeping, allocating
// ai slots and linking them to ships.
// See AiCode.cpp for the actual AI code.
#include "ai/ai.h"
#include "object/object.h"
#include "ship/ship.h"
int Total_goal_target_names = 0;
char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH];
int Total_goal_ship_names = 0;
char Goal_ship_names[MAX_GOAL_SHIP_NAMES][NAME_LENGTH];
ai_info Ai_info[MAX_AI_INFO];
ai_info *Player_ai;
/**
* @brief Returns index of free AI slot.
* @return Return -1 if no free slot.
*/
// Return index of free AI slot.
// Return -1 if no free slot.
int ai_get_slot(int shipnum)
{
int i;
@@ -43,10 +40,8 @@ int ai_get_slot(int shipnum)
return -1;
}
/**
* @brief Frees a currently used AI slot.
* @details Only modifies in ::Ai_info struct. Does not modify hook in ship.
*/
// Releases an AI slot to be used by someone else.
// Only modifies in Ai_info struct. Does not modify hook in ship.
void ai_free_slot(int ai_index)
{
Assert( (ai_index >= 0) && (ai_index < MAX_AI_INFO) );
@@ -82,22 +77,20 @@ void set_wingnum(int objnum, int wingnum)
Ai_info[ai_index].wing = wingnum;
}
char *ai_get_goal_target_name(const char *name, int *index)
char *ai_get_goal_ship_name(char *name, int *index)
{
Assert(name != NULL);
Assert(index != NULL);
int i;
for (i=0; i < Total_goal_target_names; i++)
if (!stricmp(name, Goal_target_names[i])) {
for (i=0; i < Total_goal_ship_names; i++)
if (!stricmp(name, Goal_ship_names[i])) {
*index = i;
return Goal_target_names[i];
return Goal_ship_names[i];
}
Assert(Total_goal_target_names < MAX_GOAL_TARGET_NAMES);
Assertion(strlen(name) <= NAME_LENGTH - 1, "Goal target name %s is too long. Needs to be 31 characters or less.", name);
i = Total_goal_target_names++;
strcpy_s(Goal_target_names[i], name);
Assert(Total_goal_ship_names < MAX_GOAL_SHIP_NAMES);
Assert(strlen(name) < NAME_LENGTH - 1);
i = Total_goal_ship_names++;
strcpy(Goal_ship_names[i], name);
*index = i;
return Goal_target_names[i];
return Goal_ship_names[i];
}
+411 -188
View File
@@ -7,37 +7,357 @@
*
*/
/*
* $Logfile: /Freespace2/code/Ship/ai.h $
* $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
*
*
* 12 8/29/99 4:18p Andsager
* New "burst" limit for friendly damage. Also credit more damage done
* against large friendly ships.
*
* 11 8/26/99 5:14p Andsager
*
* 10 7/26/99 12:14p Andsager
* Apply cap to how much slower a transport flies with cargo. Remove
* limit on waypoint speed for training. Enemy ai get stealth exact pos
* when stealth fires
*
* 9 7/02/99 10:56a Andsager
* Put in big ship - big ship attack mode. Modify stealth sweep ai.
*
* 8 6/30/99 5:53p Dave
* Put in new anti-camper code.
*
* 7 6/23/99 5:51p Andsager
* Add waypoint-cap-speed. Checkin stealth ai - inactive.
*
* 6 6/14/99 10:45a Dave
* Made beam weapons specify accuracy by skill level in the weapons.tbl
*
* 5 4/20/99 6:39p Dave
* Almost done with artillery targeting. Added support for downloading
* images on the PXO screen.
*
* 4 4/20/99 3:40p Andsager
* Changes to big ship ai. Uses bounding box as limit where to fly to
* when flying away.
*
* 3 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:51a Dave
*
* 186 6/09/98 5:15p Lawrance
* French/German localization
*
* 185 5/23/98 2:41p Mike
* Make Easy the default skill level and prevent old pilot's skill level
* from carrying into new pilot.
*
* 184 5/20/98 12:45a Mike
* Fix bug in support ships aborting rearm. Also, remove test code that
* made any ship whose name began, "Kami" a kamikaze.
*
* 183 5/18/98 1:58a Mike
* Make Phoenix not be fired at fighters (but yes bombers).
* Improve positioning of ships in guard mode.
* Make turrets on player ship not fire near end of support ship docking.
*
* 182 5/13/98 4:41p Mike
* Make big ships try a tiny bit to avoid collision with each other when
* attacking another big ship. Make ships a little less likely to collide
* into player when in formation, drop off if player flying wacky.
*
* 181 5/12/98 4:53p Mike
* Make ships recover from collisions with big ships, eventually flying
* around.
*
* 180 5/10/98 11:30p Mike
* Better firing of bombs, less likely to go into strafe mode.
*
* 179 4/12/98 2:02p Mike
* Make small ships avoid big ships.
* Turn on Collide_friendly flag.
*
* 178 4/10/98 11:02p Mike
* Make countermeasures less effective against aspect seekers than against
* heat seekers.
* Make AI ships match bank with each other when attacking a faraway
* target.
* Make ships not do silly loop-de-loop sometimes when attacking a faraway
* target.
*
* 177 4/08/98 8:38a Mike
* Make ships avoid player when attacking or guarding a faraway object.
*
* 176 4/06/98 12:46a Allender
* bump max ai goals down to 5
*
* 175 4/01/98 9:20a Mike
* Reduce MAX_SHIPS, MAX_OBJECTS and make MAX_AI_INFO same as MAX_SHIPS
*
* 174 3/21/98 3:36p Mike
* Fix/optimize attacking of big ships.
*
* 173 3/17/98 12:50a Mike
* Improved kamikaze behavior.
*
* 172 3/16/98 8:27p Allender
* Fred support for two new AI flags -- kamikaze and no dynamic goals.
*
* 171 3/16/98 12:03a Mike
* Add support for kamikaze mode. Add AIF_NO_DYNAMIC which means
* relentlessly pursue current goal.
*
* 170 3/15/98 9:44p Lawrance
* Get secondary weapons for turrets working
*
* 169 3/13/98 8:34a Mike
* Intermediate checkin to resolve link errors. Working on detecting
* whether dock with player ship is obstructed by another ship
*
* 168 3/09/98 5:12p Mike
* Make sure Pl_objp uses are valid.
* Throw asteroids at ships in asteroid field, not "Gal"
* Support ships warp out if no goals after 30 seconds.
*
* 167 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 166 2/22/98 4:17p John
* More string externalization classification... 190 left to go!
*
* 165 2/18/98 10:34p Allender
* repair/rearm system (for single and multi) about finished.
* dock/undock and ai goals packets implemented for multiplayer
*
* 164 2/17/98 5:03p Allender
* major cdhanges to rearm repair code. All flag and variable setting
* done in one function. A little more work to do. Fix bug in squad
* messaging when hotkey was used on invalid target
*
* 163 2/16/98 10:13p Allender
* initial work on being able to target weapons (bombs specifically).
* Work on getting rearm/repair working under multiplayer
*
* $NoKeywords: $
*/
#ifndef _AI_H
#define _AI_H
#include "ai/ai_profiles.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
#include "object/waypoint.h"
#include "physics/physics.h"
#include "ship/ship_flags.h"
class ship_weapon;
class ship_subsys;
class object;
class ship_info;
struct ship_weapon;
struct ship_subsys;
struct object;
#define AI_DEFAULT_CLASS 3 // default AI class for new ships (Fred)
typedef struct ai_flag_name {
AI::AI_Flags flag;
char flag_name[TOKEN_LENGTH];
} ai_flag_name;
#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 MAX_AI_FLAG_NAMES 2
extern ai_flag_name Ai_flag_names[];
// 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.
#define DOA_APPROACH 1 // Approach the current point on the path (aip->path_cur)
#define DOA_DOCK 2 // Dock with goal object.
#define DOA_DOCK 2 // Dock with goal object.
#define DOA_UNDOCK_1 3 // Begin undocking with goal object. Just move away.
#define DOA_UNDOCK_2 4 // Secondary undocking. Move away.
#define DOA_UNDOCK_3 5 // Tertiary undocking. Move away and orient away.
@@ -51,7 +371,7 @@ extern ai_flag_name Ai_flag_names[];
// Submodes for seeking safety.
#define AISS_1 41 // Pick a spot to fly to.
#define AISS_2 42 // Flying to spot.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2
#define MAX_AI_GOALS 5
@@ -60,12 +380,24 @@ extern ai_flag_name Ai_flag_names[];
// have priority over others (i.e. when a player issues a goal to a wing, then a seperate
// goal to a ship in that wing). We would probably use this type in conjunction with
// goal priority to establish which goal to follow
#define AIG_TYPE_EVENT_SHIP 1 // from mission event direct to ship
#define AIG_TYPE_EVENT_WING 2 // from mission event direct to wing
#define AIG_TYPE_EVENT_SHIP 1 // from mission event direct to ship
#define AIG_TYPE_EVENT_WING 2 // from mission event direct to wing
#define AIG_TYPE_PLAYER_SHIP 3 // from player direct to ship
#define AIG_TYPE_PLAYER_WING 4 // from player direct to wing
#define AIG_TYPE_DYNAMIC 5 // created on the fly
// flags for AI_GOALS
#define AIGF_DOCKER_INDEX_VALID (1<<0) // when set, index field for docker is valid
#define AIGF_DOCKEE_INDEX_VALID (1<<1) // when set, index field for dockee is valid
#define AIGF_GOAL_ON_HOLD (1<<2) // when set, this goal cannot currently be satisfied, although it could be in the future
#define AIGF_SUBSYS_NEEDS_FIXUP (1<<3) // when set, the subsystem index (for a destroy subsystem goal) is invalid and must be gotten from the subsys name stored in docker.name field!!
#define AIGF_GOAL_OVERRIDE (1<<4) // paired with AIG_TYPE_DYNAMIC to mean this goal overrides any other goal
#define AIGF_PURGE (1<<5) // purge this goal next time we process
#define AIGF_GOALS_PURGED (1<<6) // this goal has already caused other goals to get purged
#define AIGF_DOCK_SOUND_PLAYED (1<<7) // Goober5000 - replacement for AL's hack ;)
#define AIGF_DOCK_INDEXES_VALID (AIGF_DOCKER_INDEX_VALID|AIGF_DOCKEE_INDEX_VALID)
// Flags to ai_turn_towards_vector().
#define AITTV_FAST (1<<0) // Turn fast, not slowed down based on skill level.
#define AITTV_VIA_SEXP (1<<1) // Goober5000 - via sexp
@@ -73,21 +405,20 @@ extern ai_flag_name Ai_flag_names[];
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
// structure for AI goals
typedef struct ai_goal {
int signature; // Unique identifier. All goals ever created (per mission) have a unique signature.
int ai_mode; // one of the AIM_* modes for this goal
int ai_submode; // maybe need a submode
int type; // one of the AIG_TYPE_* values above
flagset<AI::Goal_Flags> flags; // one of the AIGF_* values above
int flags; // one of the AIGF_* values above
fix time; // time at which this goal was issued.
int priority; // how important is this goal -- number 0 - 100
char *target_name; // name of the thing that this goal acts upon
int target_name_index; // index of goal_target_name in Goal_target_names[][]
waypoint_list *wp_list; // waypoints that this ship might fly.
int target_instance; // instance of thing this ship might be chasing (currently only used for weapons; note, not the same as objnum!)
int target_signature; // signature of object this ship might be chasing (currently only used for weapons; paired with above value to confirm target)
char *ship_name; // name of the ship that this goal acts upon
int ship_name_index; // index of ship_name in Goal_ship_names[][]
int wp_index; // index into waypoints list of waypoints that this ship might fly.
int weapon_signature; // signature of weapon this ship might be chasing. Paired with above value to get target.
// unions for docking stuff.
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
@@ -104,7 +435,7 @@ typedef struct ai_goal {
} ai_goal;
#define MAX_GOAL_TARGET_NAMES 100
#define MAX_GOAL_SHIP_NAMES 100
#define AIM_CHASE 0
#define AIM_EVADE 1
@@ -114,25 +445,24 @@ typedef struct ai_goal {
#define AIM_GUARD 5 // Guard an object
#define AIM_AVOID 6 // Avoid an object
#define AIM_WAYPOINTS 7 // Fly waypoints
#define AIM_DOCK 8 // Dock with ship.
#define AIM_NONE 9 // Uh, do nothing.
#define AIM_DOCK 8 // Dock with ship.
#define AIM_NONE 9 // Uh, do nothing.
#define AIM_BIGSHIP 10 // Like a capital ship, doesn't focus on one ship.
#define AIM_PATH 11 // Follow path on ship
#define AIM_PATH 11 // Follow path on ship
#define AIM_BE_REARMED 12 // Allow self to be rearmed
#define AIM_SAFETY 13 // Seek safety at periphery of battle
#define AIM_EVADE_WEAPON 14 // Evade a weapon.
#define AIM_STRAFE 15 // Attack a big ship by strafing it
#define AIM_STRAFE 15 // attack a big ship by strafing it
#define AIM_PLAY_DEAD 16 // Play dead. Get it? Don't move, fire, etc.
#define AIM_BAY_EMERGE 17 // Emerging from a fighter bay, following path to do so
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
#define AIM_BAY_EMERGE 17 // Emerging from a fighter bay, following path to do so
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
#define AIM_WARP_OUT 20 // Commence warp out sequence. Point in legal direction. Then call John's code.
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
#define MAX_AI_BEHAVIORS 22 // Number of AIM_xxxx types
#define MAX_AI_BEHAVIORS 22 // Number of AIM_xxxx types
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_ENEMY_DISTANCE 2500.0f // Maximum distance from which a ship will pursue an enemy.
#define MAX_ENEMY_DISTANCE 2500.0f // maximum distance from which a ship will pursue an enemy.
#define AI_GOAL_NONE -1
@@ -144,42 +474,6 @@ typedef struct ai_class {
float ai_evasion[NUM_SKILL_LEVELS];
float ai_courage[NUM_SKILL_LEVELS];
float ai_patience[NUM_SKILL_LEVELS];
//SUSHI: These were originally in AI_Profiles, adding the option to override in AI.tbl
//INT_MIN and FLT_MIN represent the "not set" state for which defaults are used instead.
float ai_cmeasure_fire_chance[NUM_SKILL_LEVELS];
float ai_in_range_time[NUM_SKILL_LEVELS];
float ai_link_ammo_levels_maybe[NUM_SKILL_LEVELS];
float ai_link_ammo_levels_always[NUM_SKILL_LEVELS];
float ai_primary_ammo_burst_mult[NUM_SKILL_LEVELS];
float ai_link_energy_levels_maybe[NUM_SKILL_LEVELS];
float ai_link_energy_levels_always[NUM_SKILL_LEVELS];
fix ai_predict_position_delay[NUM_SKILL_LEVELS];
float ai_shield_manage_delay[NUM_SKILL_LEVELS];
float ai_ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
float ai_ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
float ai_ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
float ai_ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
float ai_turn_time_scale[NUM_SKILL_LEVELS];
float ai_glide_attack_percent[NUM_SKILL_LEVELS];
float ai_circle_strafe_percent[NUM_SKILL_LEVELS];
float ai_glide_strafe_percent[NUM_SKILL_LEVELS];
float ai_random_sidethrust_percent[NUM_SKILL_LEVELS];
float ai_stalemate_time_thresh[NUM_SKILL_LEVELS];
float ai_stalemate_dist_thresh[NUM_SKILL_LEVELS];
int ai_chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS];
float ai_max_aim_update_delay[NUM_SKILL_LEVELS];
float ai_turret_max_aim_update_delay[NUM_SKILL_LEVELS];
flagset<AI::Profile_Flags> ai_profile_flags; //Holds the state of flags that are set
flagset<AI::Profile_Flags> ai_profile_flags_set; //Holds which flags are set and which are just left alone
//SUSHI: These are optional overrides to an AI class to prevent the automatic scaling based on AI class index
int ai_aburn_use_factor[NUM_SKILL_LEVELS];
float ai_shockwave_evade_chance[NUM_SKILL_LEVELS];
float ai_get_away_chance[NUM_SKILL_LEVELS];
float ai_secondary_range_mult[NUM_SKILL_LEVELS];
bool ai_class_autoscale; //Defaults to true, but can be turned off in order to disable extra scaling of some AI behaviors
//based on AI class index
} ai_class;
// Submode definitions.
@@ -202,17 +496,14 @@ typedef struct ai_class {
#define SM_BIG_CIRCLE 16 // Big ship flies circle around other big ship to get good angle to go parallel
#define SM_BIG_PARALLEL 17 // Big ship flies parallel to another
//SUSHI: Attack submodes (besides those implicitly listed above)
#define AIS_CHASE_GLIDEATTACK 18 // Ship uses glide to move in a constant direction while pointing and shooting at target
#define AIS_CHASE_CIRCLESTRAFE 19 // Attempt a circle-strafe on the target
// Submodes for docking behavior
#define AIS_DOCK_0 20
#define AIS_DOCK_1 21
#define AIS_DOCK_2 22
#define AIS_DOCK_3 23
#define AIS_DOCK_4 24 // Only for rearm/repair.
#define AIS_DOCK_4A 25 // Only for not rearm/repair. MK, 7/15/97
#define AIS_DOCK_0 21
#define AIS_DOCK_1 22
#define AIS_DOCK_2 23
#define AIS_DOCK_3 24
//#define AIS_DOCK_3A 25
#define AIS_DOCK_4 26 // Only for rearm/repair.
#define AIS_DOCK_4A 27 // Only for not rearm/repair. MK, 7/15/97
#define AIS_UNDOCK_0 30
#define AIS_UNDOCK_1 31
#define AIS_UNDOCK_2 32
@@ -231,7 +522,6 @@ typedef struct ai_class {
#define AIS_STRAFE_RETREAT1 203 // fly away from attack point
#define AIS_STRAFE_RETREAT2 204
#define AIS_STRAFE_POSITION 205 // re-position to resume strafing attack
#define AIS_STRAFE_GLIDE_ATTACK 206 // SUSHI: Glide strafe atack
#define WPF_REPEAT (1 << 0)
#define WPF_BACKTRACK (1 << 1)
@@ -268,7 +558,7 @@ extern pnode *Ppfp; // Free pointer in path points.
#define MAX_IGNORE_NEW_OBJECTS 7
typedef struct ai_info {
flagset<AI::AI_Flags> ai_flags; // Special flags for AI behavior.
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.
@@ -310,10 +600,11 @@ typedef struct ai_info {
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
waypoint_list *wp_list; // waypoint list being followed
size_t wp_index; // waypoint index in list
int wp_list; // waypoint list index
int wp_index; // waypoint index in list
int wp_flags; // waypoint flags, see WPF_xxxx
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
int wp_dir; // 1 or -1, amount to add to get to next waypoint index.
int waypoint_speed_cap; // -1 no cap, otherwise cap - changed to int by Goober5000
// Path following information
int path_start; // Index into global array, start of path.
@@ -330,7 +621,6 @@ typedef struct ai_info {
fix path_next_check_time; // Last time checked to see if would collide with model.
int path_goal_dist; // minimum distance to first path point to consider path reached
int path_subsystem_next_check; // timestamp to next check if subsystem is still visible
vec3d path_depart_orient; //Rotational orientation associated with the path
int submode;
int previous_submode; // previous submode, get it?
@@ -340,23 +630,14 @@ typedef struct ai_info {
fix best_dot_from_time; // time at which best dot occurred
fix submode_start_time; // time at which we entered the current submode
int submode_parm0; // parameter specific to current submode
int submode_parm1; // SUSHI: Another optional parameter
fix next_predict_pos_time; // Next time to predict position.
//SUSHI: like last_predicted_enemy_pos, but for aiming (which currently ignores predicted position)
//Unlike the predicted position stuff, also takes into account velocity
//Only used against small ships
fix next_aim_pos_time;
vec3d last_aim_enemy_pos;
vec3d last_aim_enemy_vel;
ai_goal goals[MAX_AI_GOALS];
int active_goal; // index of active goal, -1 if none, AI_ACTIVE_GOAL_DYNAMIC if dynamic (runtime-created) goal
int goal_check_time; // timer used for processing goals for this ai object
vec3d last_predicted_enemy_pos; // Where he thought enemy was last time.
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
float time_enemy_near; // SUSHI: amount of time enemy continuously "near" the player
float time_enemy_in_range; // Amount of time enemy continuously in "sight", near crosshair.
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
int last_hit_quadrant; // Shield section of last hit.
@@ -368,42 +649,7 @@ typedef struct ai_info {
float prev_dot_to_goal; // dot of fvec to goal last frame, used to see if making progress towards goal.
vec3d goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
vec3d prev_goal_point; // Previous location of goal point, used at least for evading.
//Values copied from the AI class
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
int ai_aburn_use_factor;
float ai_shockwave_evade_chance;
float ai_get_away_chance;
float ai_secondary_range_mult;
bool ai_class_autoscale;
//SUSHI: These were originally in AI_Profiles, adding the option to override in AI.tbl
float ai_cmeasure_fire_chance;
float ai_in_range_time;
float ai_link_ammo_levels_maybe;
float ai_link_ammo_levels_always;
float ai_primary_ammo_burst_mult;
float ai_link_energy_levels_maybe;
float ai_link_energy_levels_always;
fix ai_predict_position_delay;
float ai_shield_manage_delay;
float ai_ship_fire_delay_scale_friendly;
float ai_ship_fire_delay_scale_hostile;
float ai_ship_fire_secondary_delay_scale_friendly;
float ai_ship_fire_secondary_delay_scale_hostile;
float ai_turn_time_scale;
float ai_glide_attack_percent;
float ai_circle_strafe_percent;
float ai_glide_strafe_percent;
float ai_random_sidethrust_percent;
float ai_stalemate_time_thresh;
float ai_stalemate_dist_thresh;
int ai_chance_to_use_missiles_on_plr;
float ai_max_aim_update_delay;
float ai_turret_max_aim_update_delay;
flagset<AI::Profile_Flags> ai_profile_flags; //Holds AI_Profiles flags (possibly overriden by AI class) that actually apply to AI
float ai_accuracy, ai_evasion, ai_courage, ai_patience;
union {
float lead_scale; // Amount to lead current opponent by.
float stay_near_distance; // Distance to stay within for AIM_STAY_NEAR mode.
@@ -415,6 +661,9 @@ typedef struct ai_info {
float aspect_locked_time; // Time towards acquiring lock for current_target
// ship_subsys *targeted_subobject; // subsystem to attack
// int attack_subsystem_parent; // objnum of the object containing the attack_subsystem
// Goober5000
int support_ship_objnum; // objnum of support ship docking with us, or (if we're a support ship) object we're docking to
int support_ship_signature; // signature of the same
@@ -460,7 +709,7 @@ typedef struct ai_info {
int self_destruct_timestamp; // Time at which to self-destruct, probably due to being disabled.
int ok_to_target_timestamp; // Time at which this ship can dynamically target.
int kamikaze_damage; // some damage value used to produce a shockwave from a kamikaze ship
float kamikaze_damage; // some damage value used to produce a shockwave from a kamikaze ship
vec3d big_attack_point; // Global point this ship is attacking on a big ship.
vec3d big_attack_surface_normal; // Surface normal at ship at big_attack_point;
int pick_big_attack_point_timestamp; // timestamp at which to pick a new point to attack on a big ship.
@@ -484,23 +733,8 @@ typedef struct ai_info {
float artillery_lock_time; // how long we've been locked onto this guy
vec3d artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
float lethality; // measure of how dangerous ship is to enemy BIG|HUGE ships (likelyhood of targeting)
flagset<AI::Maneuver_Override_Flags> ai_override_flags; // flags for marking ai overrides from sexp or lua systems
control_info ai_override_ci; // ai override control info
int ai_override_timestamp; // mark for when to end the current override
} ai_info;
// Goober5000
typedef struct {
vec3d docker_point;
vec3d dockee_point;
int dock_mode;
int submodel;
vec3d submodel_pos;
float submodel_r;
float submodel_w;
} rotating_dockpoint_info;
#define MAX_AI_INFO MAX_SHIPS
// SUBSYS_PATH_DIST is used as the distance that a subsystem path should terminate from the actual
@@ -512,9 +746,8 @@ typedef struct {
#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_target_names;
extern char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH];
extern int Total_goal_ship_names;
extern char Goal_ship_names[MAX_GOAL_SHIP_NAMES][NAME_LENGTH];
extern void update_ai_info_for_hit(int hitter_obj, int hit_obj);
extern void ai_frame_all(void);
@@ -524,13 +757,15 @@ extern int find_guard_obj(void);
extern ai_info Ai_info[];
extern ai_info *Player_ai;
extern int Waypoints_created; // externed since needed for save/restore
extern ai_class *Ai_classes;
extern char** Ai_class_names;
extern int Num_ai_classes;
extern int Ai_firing_enabled;
extern const char *Skill_level_names(int skill_level, int translate = 1);
extern char *Skill_level_names(int skill_level, int translate = 1);
extern int Ai_goal_signature;
// need access to following data in AiBig.cpp
@@ -556,20 +791,21 @@ void ai_process( object * obj, int ai_index, float frametime );
int get_wingnum(int objnum);
void set_wingnum(int objnum, int wingnum);
char *ai_get_goal_target_name(const char *name, int *index);
char *ai_get_goal_ship_name(char *name, int *index);
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, ship_subsys *ssp, int ship_info_index = -1);
extern void ai_evade_object(object *evader, object *evaded);
extern void ai_ignore_object(object *ignorer, object *ignored, int ignore_new);
extern void ai_ignore_wing(object *ignorer, int wingnum);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int dock_type);
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, int ignore_new);
extern void ai_ignore_wing(object *ignorer, int wingnum, int priority);
extern void ai_dock_with_object(object *docker, int docker_index, object *dockee, int dockee_index, int priority, int dock_type);
extern void ai_stay_still(object *still_objp, vec3d *view_pos);
extern void ai_set_default_behavior(object *obj, int classnum);
extern void ai_do_default_behavior(object *obj);
extern void ai_start_waypoints(object *objp, waypoint_list *wp_list, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hit_normal);
extern void ai_ship_destroy(int shipnum);
extern void ai_turn_towards_vector(vec3d *dest, object *objp, float turn_time, vec3d *slide_vec, vec3d *rel_pos, float bank_override, int flags, vec3d *rvec = nullptr, int sexp_flags = 0);
extern void ai_start_waypoints(object *objp, int waypoint_list_index, int wp_flags);
extern void ai_ship_hit(object *objp_ship, object *hit_objp, vec3d *hitpos, int quadrant_num, vec3d *hit_normal);
extern void ai_ship_destroy(int shipnum, int method);
extern void ai_turn_towards_vector(vec3d *dest, object *objp, float frametime, float turn_time, vec3d *slide_vec, vec3d *rel_pos, float bank_override, int flags, vec3d *rvec = NULL, int sexp_flags = 0);
extern void init_ai_object(int objnum);
extern void ai_init(void); // Call this one to parse ai.tbl.
extern void ai_level_init(void); // Call before each level to reset AI
@@ -583,14 +819,14 @@ extern void ai_update_danger_weapon(int objnum, int weapon_objnum);
// called externally from MissionParse.cpp to position ships in wings upon arrival into the
// mission.
extern void get_absolute_wing_pos( vec3d *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
extern void get_absolute_wing_pos_autopilot( vec3d *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
// Interface from goals code to AI. Set ship to guard. *objp guards *other_objp
extern void ai_set_guard_object(object *objp, object *other_objp);
extern void ai_set_evade_object(object *objp, object *other_objp);
extern void ai_set_guard_wing(object *objp, int wingnum);
extern void ai_warp_out(object *objp, vec3d *vp);
extern void ai_attack_wing(object *attacker, int wingnum);
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.
@@ -598,10 +834,9 @@ extern int set_target_objnum(ai_info *aip, int objnum);
extern void ai_form_on_wing(object *objp, object *goal_objp);
extern void ai_do_stay_near(object *objp, object *other_obj, float dist);
extern ship_subsys *set_targeted_subsys(ai_info *aip, ship_subsys *new_subsys, int parent_objnum);
extern void ai_rearm_repair( object *objp, int docker_index, object *goal_objp, int dockee_index );
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);
extern int ai_find_goal_index( ai_goal* aigp, int mode, int submode = -1, int priority = -1 );
// Goober5000
extern void ai_do_safety(object *objp);
@@ -622,14 +857,14 @@ extern float ai_path();
extern void evade_weapon();
extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enemy, float dist_to_enemy, float duration);
extern int ai_fire_primary_weapon(object *objp); //changed to return weather it fired-Bobboau
extern int ai_fire_secondary_weapon(object *objp);
extern int ai_fire_secondary_weapon(object *objp, int priority1 = -1, int priority2 = -1);
extern float ai_get_weapon_dist(ship_weapon *swp);
extern void turn_towards_point(object *objp, vec3d *point, vec3d *slide_vec, float bank_override);
extern int ai_maybe_fire_afterburner(object *objp, ai_info *aip);
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, ai_info *aip);
extern void set_predicted_enemy_pos(vec3d *predicted_enemy_pos, object *pobjp, object *eobjp, ai_info *aip);
extern int is_instructor(object *objp);
extern int find_enemy(int objnum, float range, int max_attackers, int ship_info_index = -1);
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(vec3d *predicted_enemy_pos, vec3d *gun_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
@@ -638,20 +873,16 @@ void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos,
extern void ai_set_rearm_status( int team, int new_status );
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, char *shipname );
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point, bool update_clients = true);
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 );
// Goober5000
// Move to a position relative to a dock bay using thrusters.
extern float dock_orient_and_approach(object *docker_objp, int docker_index, object *dockee_objp, int dockee_index, int dock_mode, rotating_dockpoint_info *rdinfo = NULL);
extern int find_danger_weapon(object *sobjp, float dtime, float *atime, float dot_threshhold);
void ai_set_mode_warp_out(object *objp, ai_info *aip);
// prototyped by Goober5000
int get_nearest_objnum(int objnum, int enemy_team_mask, int enemy_wing, float range, int max_attackers, int ship_info_index);
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);
@@ -663,12 +894,4 @@ void ai_fly_to_ship();
//Moved declaration here for player ship -WMC
void process_subobjects(int objnum);
//SUSHI: Setting ai_info stuff from both ai class and ai profile
void init_aip_from_class_and_profile(ai_info *aip, ai_class *aicp, ai_profile_t *profile);
void ai_update_aim(ai_info *aip);
//SUSHI: Random evasive sidethrust
void do_random_sidethrust(ai_info *aip, ship_info *sip);
#endif
-123
View File
@@ -1,123 +0,0 @@
#ifndef AI_FLAGS_H
#define AI_FLAGS_H
#include "globalincs/flagset.h"
namespace AI {
FLAG_LIST(AI_Flags) {
Formation_wing, // Fly in formation as part of wing.
Awaiting_repair, // Awaiting a repair ship.
Being_repaired, // Currently docked with repair ship.
Repairing, // Repairing a ship (or going to repair a ship)
Seek_lock, // set if should focus on gaining aspect lock, not hitting with lasers
Formation_object, // Fly in formation off a specific object.
Temporary_ignore, // Means current ignore_objnum is only temporary, not an order from the player.
Use_exit_path, // Used by path code, to flag path as an exit path
Use_static_path, // Used by path code, use fixed path, don't try to recreate
Target_collision, // Collided with aip->target_objnum last frame. Avoid that ship for half a second or so.
Unload_secondaries, // Fire secondaries as fast as possible!
On_subsys_path, // Current path leads to a subsystem
Avoid_shockwave_ship, // Avoid an existing shockwave from a ship.
Avoid_shockwave_weapon, // Avoid an expected shockwave from a weapon. shockwave_object field contains object index.
Avoid_shockwave_started, // Already started avoiding shockwave, don't keep deciding whether to avoid.
Attack_slowly, // Move slowly while attacking.
Repair_obstructed, // Ship wants to be repaired, but path is obstructed.
Kamikaze, // Crash into target
No_dynamic, // Not allowed to get dynamic goals
Avoiding_small_ship, // Avoiding a player ship.
Avoiding_big_ship, // Avoiding a large ship.
Big_ship_collide_recover_1, // Collided into a big ship. Recovering by flying away.
Big_ship_collide_recover_2, // Collided into a big ship. Fly towards big ship sphere perimeter.
Stealth_pursuit, // AI is trying to fight stealth ship
Unload_primaries, // Fire primaries as fast as possible!
Trying_unsuccessfully_to_warp, // Trying to warp, but can't warp at the moment
Free_afterburner_use, // Use afterburners while following waypoints or flying towards objects
NUM_VALUES
};
FLAG_LIST(Goal_Flags) {
Docker_index_valid, // when set, index field for docker is valid
Dockee_index_valid, // when set, index field for dockee is valid
Goal_on_hold, // when set, this goal cannot currently be satisfied, although it could be in the future
Subsys_needs_fixup, // 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!!
Goal_override, // paired with AIG_TYPE_DYNAMIC to mean this goal overrides any other goal
Purge, // purge this goal next time we process
Goals_purged, // this goal has already caused other goals to get purged
Depart_sound_played,// Goober5000 - replacement for AL's hack ;)
Target_own_team,
NUM_VALUES
};
FLAG_LIST(Maneuver_Override_Flags) {
Full, // Full sexp control
Roll, // Sexp forced roll maneuver
Pitch, // Sexp forced pitch change
Heading, // Sexp forced heading change
Full_lat, // full control over up/side/forward movement
Up, // vertical movement
Sideways, // horizontal movement
Forward, // forward movement
NUM_VALUES
};
FLAG_LIST(Profile_Flags) {
Advanced_turret_fov_edge_checks,
Ai_aims_from_ship_center,
Ai_can_slow_down_attacking_big_ships,
Ai_guards_specific_ship_in_wing,
All_ships_manage_shields,
Allow_multi_event_scoring,
Allow_primary_link_at_start,
Allow_rapid_secondary_dumbfire,
Allow_turrets_target_weapons_freely,
Allow_vertical_dodge,
Aspect_invulnerability_fix,
Aspect_lock_countermeasure,
Assist_scoring_scales_with_damage,
Beams_damage_weapons,
Big_ships_can_attack_beam_turrets_on_untargeted_ships,
Disable_linked_fire_penalty,
Disable_weapon_damage_scaling,
Dont_insert_random_turret_fire_delay,
Fix_ai_class_bug,
Fix_ai_path_order_bug,
Fix_heat_seeker_stealth_bug,
Fix_linked_primary_bug,
Force_beam_turret_fov,
Free_afterburner_use,
Glide_decay_requires_thrust,
Hack_improve_non_homing_swarm_turret_fire_accuracy,
Huge_turret_weapons_ignore_bombs,
Include_beams_in_stat_calcs,
Kill_scoring_scales_with_damage,
Multi_allow_empty_primaries,
Multi_allow_empty_secondaries,
Navigation_subsys_governs_warp,
No_min_dock_speed_cap,
No_special_player_avoid,
No_warp_camera,
Perform_fewer_scream_checks,
Player_weapon_scale_fix,
Prevent_targeting_bombs_beyond_range,
Require_turret_to_have_target_in_fov,
Shockwaves_damage_small_ship_subsystems,
Smart_afterburner_management,
Smart_primary_weapon_selection,
Smart_secondary_weapon_selection,
Smart_shield_management,
Smart_subsystem_targeting_for_turrets,
Strict_turred_tagged_only_targeting,
Turrets_ignore_target_radius,
Use_actual_primary_range,
Use_additive_weapon_velocity,
Use_newtonian_dampening,
Use_only_single_fov_for_turrets,
NUM_VALUES
};
}
#endif
+317 -549
View File
@@ -4,17 +4,105 @@
* 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 "def_files/def_files.h"
#include "globalincs/def_files.h"
#include "ai/ai_profiles.h"
#include "globalincs/pstypes.h"
#include "localization/localize.h"
#include "parse/parselo.h"
#include "ship/ship.h"
#include "weapon/weapon.h"
#include "localization/localize.h"
// global stuff
@@ -28,497 +116,246 @@ static char Default_profile_name[NAME_LENGTH];
// utility
void set_flag(ai_profile_t *profile, const char *name, AI::Profile_Flags flag)
void set_flag(ai_profile_t *profile, char *name, int flag)
{
if (optional_string(name))
{
bool val;
stuff_boolean(&val);
profile->flags.set(flag, val);
if (val)
profile->flags |= flag;
else
profile->flags &= ~flag;
}
}
const char *AI_path_types[] = {
"normal",
"alt1",
};
int Num_ai_path_types = sizeof(AI_path_types)/sizeof(char*);
int ai_path_type_match(char *p)
void parse_ai_profiles_tbl(char *filename)
{
int i;
for(i = 0; i < Num_ai_path_types; i++)
{
if(!stricmp(AI_path_types[i], p))
return i;
}
return -1;
}
void parse_ai_profiles_tbl(const char *filename)
{
int i;
int i, rval;
bool no_create = false;
char profile_name[NAME_LENGTH];
ai_profile_t dummy_profile;
char *saved_Mp = NULL;
char buf[NAME_LENGTH];
try
// open localization
lcl_ext_open();
if ((rval = setjmp(parse_abort)) != 0)
{
if (filename == NULL)
read_file_text_from_default(defaults_get_file("ai_profiles.tbl"));
else
read_file_text(filename, CF_TYPE_TABLES);
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;
bool no_create = false;
// 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])
{
profile->reset();
}
// brand new profile, so set it to the base defaults
else
{
*profile = Ai_profiles[0];
}
}
// set the name
strcpy_s(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("$Primary Ammo Burst Multiplier:"))
parse_float_list(profile->primary_ammo_burst_mult, NUM_SKILL_LEVELS);
if (optional_string("$AI Always Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_always, NUM_SKILL_LEVELS);
if (optional_string("$AI Maybe Links Energy Weapons:"))
parse_float_list(profile->link_energy_levels_maybe, NUM_SKILL_LEVELS);
if (optional_string("$Max Missles Locked on Player:") || optional_string("$Max Missiles 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 iLoop;
float temp_list[NUM_SKILL_LEVELS];
parse_float_list(temp_list, NUM_SKILL_LEVELS);
for (iLoop = 0; iLoop < NUM_SKILL_LEVELS; iLoop++)
profile->predict_position_delay[iLoop] = fl2f(temp_list[iLoop]);
}
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("$Friendly AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_friendly, NUM_SKILL_LEVELS);
if (optional_string("$Hostile AI Secondary Fire Delay Scale:"))
parse_float_list(profile->ship_fire_secondary_delay_scale_hostile, NUM_SKILL_LEVELS);
if (optional_string("$AI Turn Time Scale:"))
parse_float_list(profile->turn_time_scale, NUM_SKILL_LEVELS);
if (optional_string("$Glide Attack Percent:")) {
parse_float_list(profile->glide_attack_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_attack_percent[i] < 0.0f || profile->glide_attack_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Attack Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_attack_percent[i]);
profile->glide_attack_percent[i] = 0.0f;
}
profile->glide_attack_percent[i] /= 100.0;
}
}
if (optional_string("$Circle Strafe Percent:")) {
parse_float_list(profile->circle_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->circle_strafe_percent[i] < 0.0f || profile->circle_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Circle Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->circle_strafe_percent[i]);
profile->circle_strafe_percent[i] = 0.0f;
}
profile->circle_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Glide Strafe Percent:")) {
parse_float_list(profile->glide_strafe_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->glide_strafe_percent[i] < 0.0f || profile->glide_strafe_percent[i] > 100.0f) {
Warning(LOCATION, "$Glide Strafe Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->glide_strafe_percent[i]);
profile->glide_strafe_percent[i] = 0.0f;
}
profile->glide_strafe_percent[i] /= 100.0;
}
}
if (optional_string("$Random Sidethrust Percent:")) {
parse_float_list(profile->random_sidethrust_percent, NUM_SKILL_LEVELS);
//Percent is nice for modders, but here in the code we want it betwwen 0 and 1.0
//While we're at it, verify the range
for (i = 0; i < NUM_SKILL_LEVELS; i++) {
if (profile->random_sidethrust_percent[i] < 0.0f || profile->random_sidethrust_percent[i] > 100.0f) {
Warning(LOCATION, "$Random Sidethrust Percent should be between 0 and 100.0 (read %f). Setting to 0.", profile->random_sidethrust_percent[i]);
profile->random_sidethrust_percent[i] = 0.0f;
}
profile->random_sidethrust_percent[i] /= 100.0;
}
}
if (optional_string("$Stalemate Time Threshold:"))
parse_float_list(profile->stalemate_time_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Stalemate Distance Threshold:"))
parse_float_list(profile->stalemate_dist_thresh, NUM_SKILL_LEVELS);
if (optional_string("$Player Shield Recharge Scale:"))
parse_float_list(profile->shield_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Player Weapon Recharge Scale:"))
parse_float_list(profile->weapon_energy_scale, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Target Ownage:"))
parse_int_list(profile->max_turret_ownage_target, NUM_SKILL_LEVELS);
if (optional_string("$Max Turret Player Ownage:"))
parse_int_list(profile->max_turret_ownage_player, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Kill Scale:"))
parse_float_list(profile->kill_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Required For Assist Scale:"))
parse_float_list(profile->assist_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Percentage Awarded For Capship Assist:"))
parse_float_list(profile->assist_award_percentage_scale, NUM_SKILL_LEVELS);
if (optional_string("$Repair Penalty:"))
parse_int_list(profile->repair_penalty, NUM_SKILL_LEVELS);
if (optional_string("$Delay Before Allowing Bombs to Be Shot Down:"))
parse_float_list(profile->delay_bomb_arm_timer, NUM_SKILL_LEVELS);
if (optional_string("$Chance AI Has to Fire Missiles at Player:"))
parse_int_list(profile->chance_to_use_missiles_on_plr, NUM_SKILL_LEVELS);
if (optional_string("$Max Aim Update Delay:"))
parse_float_list(profile->max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Turret Max Aim Update Delay:"))
parse_float_list(profile->turret_max_aim_update_delay, NUM_SKILL_LEVELS);
if (optional_string("$Player Autoaim FOV:"))
{
float fov_list[NUM_SKILL_LEVELS];
parse_float_list(fov_list, NUM_SKILL_LEVELS);
for (i = 0; i < NUM_SKILL_LEVELS; i++)
{
//Enforce range
if (fov_list[i] < 0.0f || fov_list[i] >= 360.0f)
{
Warning(LOCATION, "$Player Autoaim FOV should be >= 0 and < 360.0 (read %f). Setting to 0.", fov_list[i]);
fov_list[i] = 0.0f;
}
//Convert units
profile->player_autoaim_fov[i] = fov_list[i] * PI / 180.0f;
}
}
if (optional_string("$Detail Distance Multiplier:"))
parse_float_list(profile->detail_distance_mult, MAX_DETAIL_LEVEL + 1);
set_flag(profile, "$big ships can attack beam turrets on untargeted ships:", AI::Profile_Flags::Big_ships_can_attack_beam_turrets_on_untargeted_ships);
set_flag(profile, "$smart primary weapon selection:", AI::Profile_Flags::Smart_primary_weapon_selection);
set_flag(profile, "$smart secondary weapon selection:", AI::Profile_Flags::Smart_secondary_weapon_selection);
set_flag(profile, "$smart shield management:", AI::Profile_Flags::Smart_shield_management);
set_flag(profile, "$smart afterburner management:", AI::Profile_Flags::Smart_afterburner_management);
set_flag(profile, "$free afterburner use:", AI::Profile_Flags::Free_afterburner_use);
set_flag(profile, "$allow rapid secondary dumbfire:", AI::Profile_Flags::Allow_rapid_secondary_dumbfire);
set_flag(profile, "$huge turret weapons ignore bombs:", AI::Profile_Flags::Huge_turret_weapons_ignore_bombs);
set_flag(profile, "$don't insert random turret fire delay:", AI::Profile_Flags::Dont_insert_random_turret_fire_delay);
set_flag(profile, "$hack improve non-homing swarm turret fire accuracy:", AI::Profile_Flags::Hack_improve_non_homing_swarm_turret_fire_accuracy);
set_flag(profile, "$shockwaves damage small ship subsystems:", AI::Profile_Flags::Shockwaves_damage_small_ship_subsystems);
set_flag(profile, "$navigation subsystem governs warpout capability:", AI::Profile_Flags::Navigation_subsys_governs_warp);
set_flag(profile, "$ignore lower bound for minimum speed of docked ship:", AI::Profile_Flags::No_min_dock_speed_cap);
set_flag(profile, "$disable linked fire penalty:", AI::Profile_Flags::Disable_linked_fire_penalty);
set_flag(profile, "$disable weapon damage scaling:", AI::Profile_Flags::Disable_weapon_damage_scaling);
set_flag(profile, "$use additive weapon velocity:", AI::Profile_Flags::Use_additive_weapon_velocity);
set_flag(profile, "$use newtonian dampening:", AI::Profile_Flags::Use_newtonian_dampening);
set_flag(profile, "$include beams for kills and assists:", AI::Profile_Flags::Include_beams_in_stat_calcs);
set_flag(profile, "$score kills based on damage caused:", AI::Profile_Flags::Kill_scoring_scales_with_damage);
set_flag(profile, "$score assists based on damage caused:", AI::Profile_Flags::Assist_scoring_scales_with_damage);
set_flag(profile, "$allow event and goal scoring in multiplayer:", AI::Profile_Flags::Allow_multi_event_scoring);
set_flag(profile, "$fix linked primary weapon decision bug:", AI::Profile_Flags::Fix_linked_primary_bug);
set_flag(profile, "$prevent turrets targeting too distant bombs:", AI::Profile_Flags::Prevent_targeting_bombs_beyond_range);
set_flag(profile, "$smart subsystem targeting for turrets:", AI::Profile_Flags::Smart_subsystem_targeting_for_turrets);
set_flag(profile, "$fix heat seekers homing on stealth ships bug:", AI::Profile_Flags::Fix_heat_seeker_stealth_bug);
set_flag(profile, "$multi allow empty primaries:", AI::Profile_Flags::Multi_allow_empty_primaries);
set_flag(profile, "$multi allow empty secondaries:", AI::Profile_Flags::Multi_allow_empty_secondaries);
set_flag(profile, "$allow turrets target weapons freely:", AI::Profile_Flags::Allow_turrets_target_weapons_freely);
set_flag(profile, "$use only single fov for turrets:", AI::Profile_Flags::Use_only_single_fov_for_turrets);
set_flag(profile, "$allow vertical dodge:", AI::Profile_Flags::Allow_vertical_dodge);
set_flag(profile, "$force beam turrets to use normal fov:", AI::Profile_Flags::Force_beam_turret_fov);
set_flag(profile, "$fix ai class bug:", AI::Profile_Flags::Fix_ai_class_bug);
set_flag(profile, "$turrets ignore targets radius in range checks:", AI::Profile_Flags::Turrets_ignore_target_radius);
set_flag(profile, "$no extra collision avoidance vs player:", AI::Profile_Flags::No_special_player_avoid);
set_flag(profile, "$perform fewer checks for death screams:", AI::Profile_Flags::Perform_fewer_scream_checks);
set_flag(profile, "$advanced turret fov edge checks:", AI::Profile_Flags::Advanced_turret_fov_edge_checks);
set_flag(profile, "$require turrets to have target in fov:", AI::Profile_Flags::Require_turret_to_have_target_in_fov);
set_flag(profile, "$all ships manage shields:", AI::Profile_Flags::All_ships_manage_shields);
set_flag(profile, "$ai aims from ship center:", AI::Profile_Flags::Ai_aims_from_ship_center);
set_flag(profile, "$allow primary link at mission start:", AI::Profile_Flags::Allow_primary_link_at_start);
set_flag(profile, "$allow beams to damage bombs:", AI::Profile_Flags::Beams_damage_weapons);
set_flag(profile, "$disable weapon damage scaling for player:", AI::Profile_Flags::Player_weapon_scale_fix);
set_flag(profile, "$countermeasures affect aspect seekers:", AI::Profile_Flags::Aspect_lock_countermeasure);
set_flag(profile, "$ai guards specific ship in wing:", AI::Profile_Flags::Ai_guards_specific_ship_in_wing);
profile->ai_path_mode = AI_PATH_MODE_NORMAL;
if (optional_string("$ai path mode:"))
{
stuff_string(buf, F_NAME, NAME_LENGTH);
int j = ai_path_type_match(buf);
if (j >= 0) {
profile->ai_path_mode = j;
}
else {
Warning(LOCATION, "Invalid ai path mode '%s' specified", buf);
}
}
set_flag(profile, "$no warp camera:", AI::Profile_Flags::No_warp_camera);
set_flag(profile, "$fix ai path order bug:", AI::Profile_Flags::Fix_ai_path_order_bug);
set_flag(profile, "$strict turret-tagged-only targeting:", AI::Profile_Flags::Strict_turred_tagged_only_targeting);
set_flag(profile, "$aspect bomb invulnerability fix:", AI::Profile_Flags::Aspect_invulnerability_fix);
set_flag(profile, "$glide decay requires thrust:", AI::Profile_Flags::Glide_decay_requires_thrust);
set_flag(profile, "$ai can slow down when attacking big ships:", AI::Profile_Flags::Ai_can_slow_down_attacking_big_ships);
set_flag(profile, "$use actual primary range:", AI::Profile_Flags::Use_actual_primary_range);
profile->bay_arrive_speed_mult = 1.0f;
profile->bay_depart_speed_mult = 1.0f;
if (optional_string("$bay arrive speed multiplier:")) {
stuff_float(&profile->bay_arrive_speed_mult);
}
if (optional_string("$bay depart speed multiplier:")) {
stuff_float(&profile->bay_depart_speed_mult);
}
// ----------
// compatibility
if (optional_string("$perform less checks for death screams:"))
{
mprintf(("Warning: \"$perform less checks for death screams\" flag is deprecated in favor of \"$perform fewer checks for death screams\"\n"));
bool temp;
stuff_boolean(&temp);
profile->flags.set(AI::Profile_Flags::Perform_fewer_scream_checks, temp);
}
if (optional_string("$allow primary link delay:"))
{
mprintf(("Warning: \"$allow primary link delay\" flag is deprecated in favor of \"$allow primary link at mission start\"\n"));
bool temp;
stuff_boolean(&temp);
profile->flags.set(AI::Profile_Flags::Allow_primary_link_at_start, !temp);
}
// if we've been through once already and are at the same place, force a move
if (saved_Mp && (saved_Mp == Mp))
{
char tmp[60];
memset(tmp, 0, 60);
strncpy(tmp, Mp, 59);
mprintf(("WARNING: Unrecognized parameter in ai_profiles: %s\n", tmp));
Mp++;
}
// find next valid option
if (!skip_to_start_of_string_either("$", "#"))
break;
saved_Mp = Mp;
}
}
required_string("#End");
}
catch (const parse::ParseException& e)
{
mprintf(("TABLES: Unable to parse '%s'! Error message = %s.\n", (filename) ? filename : "<default ai_profiles.tbl>", e.what()));
mprintf(("TABLES: Unable to parse '%s'! Error code = %i.\n", (filename) ? filename : "<default ai_profiles.tbl>", rval));
lcl_ext_close();
return;
}
// add tbl/tbm to multiplayer validation list
extern void fs2netd_add_table_validation(const char *tblname);
fs2netd_add_table_validation(filename);
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()
@@ -558,72 +395,3 @@ int ai_profile_lookup(char *name)
return -1;
}
void ai_profile_t::reset()
{
memset(profile_name, 0, sizeof(profile_name));
flags.reset();
ai_path_mode = 0;
bay_arrive_speed_mult = 0;
bay_depart_speed_mult = 0;
for (int i = 0; i < NUM_SKILL_LEVELS; ++i) {
max_incoming_asteroids[i] = 0;
max_allowed_player_homers[i] = 0;
max_attackers[i] = 0;
predict_position_delay[i] = 0;
in_range_time[i] = 0;
shield_manage_delay[i] = 0;
link_energy_levels_always[i] = 0;
link_energy_levels_maybe[i] = 0;
link_ammo_levels_always[i] = 0;
link_ammo_levels_maybe[i] = 0;
primary_ammo_burst_mult[i] = 0;
cmeasure_life_scale[i] = 0;
cmeasure_fire_chance[i] = 0;
weapon_energy_scale[i] = 0;
shield_energy_scale[i] = 0;
afterburner_recharge_scale[i] = 0;
player_damage_scale[i] = 0;
subsys_damage_scale[i] = 0;
beam_friendly_damage_cap[i] = 0;
turn_time_scale[i] = 0;
glide_attack_percent[i] = 0;
circle_strafe_percent[i] = 0;
glide_strafe_percent[i] = 0;
random_sidethrust_percent[i] = 0;
stalemate_time_thresh[i] = 0;
stalemate_dist_thresh[i] = 0;
max_aim_update_delay[i] = 0;
turret_max_aim_update_delay[i] = 0;
ship_fire_delay_scale_hostile[i] = 0;
ship_fire_delay_scale_friendly[i] = 0;
ship_fire_secondary_delay_scale_hostile[i] = 0;
ship_fire_secondary_delay_scale_friendly[i] = 0;
max_turret_ownage_target[i] = 0;
max_turret_ownage_player[i] = 0;
kill_percentage_scale[i] = 0;
assist_percentage_scale[i] = 0;
assist_award_percentage_scale[i] = 0;
repair_penalty[i] = 0;
delay_bomb_arm_timer[i] = 0;
chance_to_use_missiles_on_plr[i] = 0;
player_autoaim_fov[i] = 0;
}
for (int i = 0; i <= MAX_DETAIL_LEVEL; ++i) {
detail_distance_mult[i] = 0;
}
}
+72 -59
View File
@@ -4,27 +4,86 @@
* 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/globals.h"
#include "globalincs/pstypes.h"
#include "globalincs/globals.h"
#include "globalincs/systemvars.h"
#include "ai/ai_flags.h"
// AI Path types
#define AI_PATH_MODE_NORMAL 0
#define AI_PATH_MODE_ALT1 1
// 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
class ai_profile_t {
public:
typedef struct ai_profile_t {
char profile_name[NAME_LENGTH];
flagset<AI::Profile_Flags> flags;
int flags;
// difficulty-related values
int max_incoming_asteroids[NUM_SKILL_LEVELS]; // max number of asteroids thrown at friendlies
@@ -39,9 +98,8 @@ public:
float link_energy_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
// AI ships link primaries if ammunition levels greater than these percents
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
float primary_ammo_burst_mult[NUM_SKILL_LEVELS]; // SUSHI: Multiplier adjusting burst frequency for ballistic primary weapons
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
@@ -54,63 +112,18 @@ public:
float subsys_damage_scale[NUM_SKILL_LEVELS]; // damage applied to a player subsystem
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]; // damage cap values for friendly beam fire
float turn_time_scale[NUM_SKILL_LEVELS]; // speed at which enemy ships turn
float glide_attack_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "glide attack" move
float circle_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use the "circle strafe" move
float glide_strafe_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to use glide when strafing capships
float random_sidethrust_percent[NUM_SKILL_LEVELS]; // SUSHI: The likelihood (0.0-1.0) of the AI to randomly use sidethrust while dogfihthing
float stalemate_time_thresh[NUM_SKILL_LEVELS]; // SUSHI: The amount of time required for the AI to detect (and try to break) dogfight stalemate
float stalemate_dist_thresh[NUM_SKILL_LEVELS]; // SUSHI: The maximum distance the AI and target must be within for a stalemate
float max_aim_update_delay[NUM_SKILL_LEVELS]; // SUSHI: The maximum delay before the AI updates their aim against small ships
float turret_max_aim_update_delay[NUM_SKILL_LEVELS]; // SUSHI: As above, but for turrets updating their aim
// Multiplicative delay factors for increasing skill levels.
float ship_fire_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_delay_scale_friendly[NUM_SKILL_LEVELS];
// Multiplicative secondary delay factors for increasing skill levels.
float ship_fire_secondary_delay_scale_hostile[NUM_SKILL_LEVELS];
float ship_fire_secondary_delay_scale_friendly[NUM_SKILL_LEVELS];
// Maximum turrets of one ship allowed to shoot the same target
int max_turret_ownage_target[NUM_SKILL_LEVELS];
int max_turret_ownage_player[NUM_SKILL_LEVELS];
// percentage of damage caused required for a kill/assist
float kill_percentage_scale[NUM_SKILL_LEVELS];
float assist_percentage_scale[NUM_SKILL_LEVELS];
// percentage of the capships score given to other team mates on a kill
float assist_award_percentage_scale[NUM_SKILL_LEVELS];
// the number of points subtracted from score for a rearm started on a player
int repair_penalty[NUM_SKILL_LEVELS];
float delay_bomb_arm_timer[NUM_SKILL_LEVELS];
// the chance (x/7) that ship is allowed to fire missiles at player ship.
int chance_to_use_missiles_on_plr[NUM_SKILL_LEVELS];
// Player-specific autoaim FOV override
float player_autoaim_fov[NUM_SKILL_LEVELS];
float detail_distance_mult[MAX_DETAIL_LEVEL + 1]; //MAX_DETAIL_LEVEL really needs to be 4
int ai_path_mode;
// Ships flying bay paths will gradually accelerate/decelerate instead of
// flying the whole path at max speed
float bay_arrive_speed_mult;
float bay_depart_speed_mult;
void reset();
};
} ai_profile_t;
extern int Num_ai_profiles;
extern int Default_ai_profile;
extern ai_profile_t Ai_profiles[MAX_AI_PROFILES];
#define AI_PROFILES_INDEX(ai_p) ((int)((ai_p) - Ai_profiles))
void ai_profiles_init();
+598 -413
View File
File diff suppressed because it is too large. Load diff
+80 -5
View File
@@ -7,23 +7,98 @@
*
*/
/*
* $Logfile: /Freespace2/code/Ship/AiBig.h $
* $Revision: 1.3 $
* $Date: 2005-07-13 02:50:48 $
* $Author: Goober5000 $
*
* Header file for AI code related to large ships
*
* $Log: not supported by cvs2svn $
* Revision 1.2 2005/04/05 05:53:13 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 1.1 2005/03/25 06:45:12 wmcoolmon
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
*
* Revision 2.2 2004/08/11 05:06:34 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2004/03/05 09:01:51 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:28 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:12 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:51a Dave
*
* 13 4/29/98 5:01p Mike
* Large overhaul in how turrets fire.
*
* 12 4/27/98 11:59p Mike
* Intermediate checkin. Getting big ship turrets firing at big ships to
* use pick_big_attack_point.
*
* 11 3/21/98 3:36p Mike
* Fix/optimize attacking of big ships.
*
* 10 1/29/98 1:39p Mike
* Better heat seeking homing on big ships.
*
* 9 1/22/98 5:14p Lawrance
* clean up ai_big code, clear path info when stop attacking a subsystem
*
* 8 1/06/98 6:58p Lawrance
* Attack turrets (sometimes) when fired upon while attacking a ship.
*
* 7 12/15/97 7:16p Lawrance
* improving subsystem attacking
*
* 6 12/01/97 5:11p Lawrance
* make strafe mode more effective... slow down when approaching and use
* afterburner in avoids
*
* 5 10/30/97 9:17p Lawrance
* work on getting AIM_STRAFE working well with disable/disarm, try to
* balance
*
* 4 10/30/97 12:32a Lawrance
* further work on AIM_STRAFE
*
* 3 10/29/97 6:24p Lawrance
* extern ai_strafe()
*
* 2 10/26/97 3:24p Lawrance
* split off large ship ai code into AiBig.cpp
*
* $NoKeywords: $
*/
#ifndef __AIBIG_H__
#define __AIBIG_H__
class object;
struct object;
struct ai_info;
struct vec3d;
class ship_subsys;
struct ship_subsys;
void ai_big_ship(object *objp);
void ai_big_chase();
void ai_big_subsys_path_cleanup(ai_info *aip);
// strafe functions
void ai_big_strafe();
int ai_big_maybe_enter_strafe_mode(const object *objp, int weapon_objnum);
void ai_big_strafe_maybe_attack_turret(const object *ship_objp, const object *weapon_objp);
int ai_big_maybe_enter_strafe_mode(object *objp, int weapon_objnum, int consider_target_only=0);
void ai_big_strafe_maybe_attack_turret(object *ship_objp, object *weapon_objp);
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
+4482 -3666
View File
File diff suppressed because it is too large. Load diff
+1016 -625
View File
File diff suppressed because it is too large. Load diff
+202 -39
View File
@@ -7,7 +7,177 @@
*
*/
/*
* $Logfile: /Freespace2/code/Ship/AiGoals.h $
* $Revision: 1.6 $
* $Date: 2006-04-20 06:32:00 $
* $Author: Goober5000 $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 1.5 2006/02/20 02:13:07 Goober5000
* added ai-ignore-new which hopefully should fix the ignore bug
* --Goober5000
*
* Revision 1.4 2006/02/19 22:00:09 Goober5000
* restore original ignore behavior and remove soon-to-be-obsolete ai-chase-any-except
* --Goober5000
*
* Revision 1.3 2005/12/29 08:08:33 wmcoolmon
* Codebase commit, most notably including objecttypes.tbl
*
* Revision 1.2 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 1.1 2005/03/25 06:45:13 wmcoolmon
* Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem.
*
* Revision 2.6 2004/08/11 05:06:34 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.5 2004/07/25 00:31:31 Kazan
* i have absolutely nothing to say about that subject
*
* Revision 2.4 2004/03/05 09:01:52 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.3 2003/01/07 20:06:44 Goober5000
* added ai-chase-any-except sexp
* --Goober5000
*
* Revision 2.2 2003/01/06 21:52:58 Goober5000
* allowed fighters and bombers to accept the stay-near-ship and
* keep-safe-distance orders
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:10 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:28 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:12 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 5 7/09/99 5:54p Dave
* Seperated cruiser types into individual types. Added tons of new
* briefing icons. Campaign screen.
*
* 4 3/26/99 4:49p Dave
* Made cruisers able to dock with stuff. Made docking points and paths
* visible in fred.
*
* 3 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 2 10/07/98 10:53a Dave
* Initial checkin.
*
* 1 10/07/98 10:51a Dave
*
* 46 2/26/98 10:08p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 45 2/22/98 4:17p John
* More string externalization classification... 190 left to go!
*
* 44 2/16/98 10:13p Allender
* initial work on being able to target weapons (bombs specifically).
* Work on getting rearm/repair working under multiplayer
*
* 43 2/13/98 3:21p Lawrance
* Set up allowed goals for escape pods.
*
* 42 1/30/98 10:01a Allender
* made large ships able to attack other ships. Made goal code recognize
* when ships removed from wings during ship select
*
* 41 12/15/97 5:25p Allender
* fix problem with docked ships receiving another dock goal. They now
* properly undock
*
* 40 11/17/97 6:39p Lawrance
* add AI_goal_text[] array, used by HUD code to show text description of
* order
*
* 39 10/29/97 10:02p Allender
* be sure that player starting wings that arrive late also form on the
* players wing if there are no goals
*
* 38 10/23/97 4:41p Allender
* lots of new rearm/repair code. Rearm requests now queue as goals for
* support ship. Warp in of new support ships functional. Support for
* stay-still and play-dead.
*
* 37 10/22/97 1:44p Allender
* more work on stay-still and play-dead
*
* 36 10/22/97 11:07a Allender
* Hooked in form on my wing into Mikes AI code
*
* 35 10/22/97 10:33a Hoffoss
* Added AI_GOAL_PLAY_DEAD as a valid goal for all ships.
*
* 34 10/22/97 9:54a Allender
* added ai_goal_play_dead
*
* 33 10/10/97 5:03p Allender
* started work on ai-stay-still
*
* 32 9/23/97 4:35p Allender
* added two function to add "internal" goals to ships and wings. Used by
* AI when it needs to do something special
*
* 31 8/15/97 11:07a Hoffoss
* Added warning to help eliminate problems later on down the road.
*
* 30 8/15/97 9:59a Hoffoss
* Changed ai_query_goal_valid() again. I can't think of any time you
* wouldn't find it easier just to pass in a ship instead of a ship_info
* flag structure filtered of all flags that aren't ship type bits. Since
* I'll call this quite a few times, it will make my life easier.
*
* 29 8/14/97 10:00p Allender
* made ai goals bitfields so that we can have set of orders that certain
* ship types are allowed to receive. Added function for Hoffoss to check
* goal vs. ship type validity
*
* 28 8/12/97 1:55a Hoffoss
* Made extensive changes to object reference checking and handling for
* object deletion call.
*
* 27 8/08/97 1:30p Allender
* added commands (and ai goals) for support ships. stay near ship (which
* could be player or current target), and keep safe distance
*
* 26 8/06/97 9:41a Allender
* renamed from ai_goal function. made a function to remove a goal from a
* wing (used strictly for waypoints now). ai-chase-wing and
* ai-guard-wing now appear to user as ai-chase and ai-guard. Tidied up
* function which deals with sexpression goals
*
* 25 8/06/97 8:06a Lawrance
* add more stuff to save/restore
*
* 24 7/24/97 4:55p Allender
* added ai-evade-ship to Fred and to FreeSpace
*
* 23 7/17/97 4:23p Allender
* ai-guard-wing now in both Fred and FreeSpace
*
* 22 7/15/97 11:57a Hoffoss
* Added a general ai goal reference update mode.
*
* 21 6/18/97 11:46a Hoffoss
* Fixed initial order object reference updating and added briefing dialog
* window tracking data.
*
* $NoKeywords: $
*/
#ifndef _AIGOALS_H
#define _AIGOALS_H
@@ -26,38 +196,35 @@ struct ai_goal;
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
// WMC - Oh and add them to Ai_goal_names plz. TY! :)
// Goober5000 - As well as Ai_goal_text and Ai_goal_list, if appropriate
#define AI_GOAL_CHASE (1<<1) // 0x00000002
#define AI_GOAL_DOCK (1<<2) // 0x00000004 // used for undocking as well
#define AI_GOAL_WAYPOINTS (1<<3) // 0x00000008
#define AI_GOAL_WAYPOINTS_ONCE (1<<4) // 0x00000010
#define AI_GOAL_WARP (1<<5) // 0x00000020
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6) // 0x00000040
#define AI_GOAL_FORM_ON_WING (1<<7) // 0x00000080
#define AI_GOAL_UNDOCK (1<<8) // 0x00000100
#define AI_GOAL_CHASE_WING (1<<9) // 0x00000200
#define AI_GOAL_GUARD (1<<10) // 0x00000400
#define AI_GOAL_DISABLE_SHIP (1<<11) // 0x00000800
#define AI_GOAL_DISARM_SHIP (1<<12) // 0x00001000
#define AI_GOAL_CHASE_ANY (1<<13) // 0x00002000
#define AI_GOAL_IGNORE (1<<14) // 0x00004000
#define AI_GOAL_GUARD_WING (1<<15) // 0x00008000
#define AI_GOAL_EVADE_SHIP (1<<16) // 0x00010000
#define AI_GOAL_CHASE (1<<1)
#define AI_GOAL_DOCK (1<<2) // used for undocking as well
#define AI_GOAL_WAYPOINTS (1<<3)
#define AI_GOAL_WAYPOINTS_ONCE (1<<4)
#define AI_GOAL_WARP (1<<5)
#define AI_GOAL_DESTROY_SUBSYSTEM (1<<6)
#define AI_GOAL_FORM_ON_WING (1<<7)
#define AI_GOAL_UNDOCK (1<<8)
#define AI_GOAL_CHASE_WING (1<<9)
#define AI_GOAL_GUARD (1<<10)
#define AI_GOAL_DISABLE_SHIP (1<<11)
#define AI_GOAL_DISARM_SHIP (1<<12)
#define AI_GOAL_CHASE_ANY (1<<13)
#define AI_GOAL_IGNORE (1<<14)
#define AI_GOAL_GUARD_WING (1<<15)
#define AI_GOAL_EVADE_SHIP (1<<16)
// the next goals are for support ships only
#define AI_GOAL_STAY_NEAR_SHIP (1<<17) // 0x00020000
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18) // 0x00040000
#define AI_GOAL_REARM_REPAIR (1<<19) // 0x00080000
#define AI_GOAL_STAY_NEAR_SHIP (1<<17)
#define AI_GOAL_KEEP_SAFE_DISTANCE (1<<18)
#define AI_GOAL_REARM_REPAIR (1<<19)
// resume regular goals
#define AI_GOAL_STAY_STILL (1<<20) // 0x00100000
#define AI_GOAL_PLAY_DEAD (1<<21) // 0x00200000
#define AI_GOAL_STAY_STILL (1<<20)
#define AI_GOAL_PLAY_DEAD (1<<21)
#define AI_GOAL_CHASE_WEAPON (1<<22)
// added by SCP
#define AI_GOAL_CHASE_WEAPON (1<<22) // 0x00400000
#define AI_GOAL_FLY_TO_SHIP (1<<23) // 0x00800000
#define AI_GOAL_IGNORE_NEW (1<<24) // 0x01000000
#define AI_GOAL_CHASE_SHIP_CLASS (1<<25) // 0x02000000
#define AI_GOAL_FLY_TO_SHIP (1<<23) // kazan
#define AI_GOAL_IGNORE_NEW (1<<24) // Goober5000
// now the masks for ship types
@@ -89,24 +256,18 @@ extern int Num_ai_goals;
extern int Num_ai_dock_names;
extern char Ai_dock_names[MAX_AI_DOCK_NAMES][NAME_LENGTH];
extern const char *Ai_goal_text(int goal);
extern char *Ai_goal_text(int goal);
// extern function definitions
extern void ai_post_process_mission();
extern void ai_maybe_add_form_goal( wing *wingp );
extern void ai_process_mission_orders( int objnum, ai_info *aip );
extern int ai_goal_num(ai_goal *goals);
// adds goals to ships/wing through sexpressions
extern void ai_add_ship_goal_scripting(int mode, int submode, int priority, char *shipname, ai_info *aip);
extern void ai_add_ship_goal_sexp( int sexp, int type, ai_info *aip );
extern void ai_add_wing_goal_sexp( int sexp, int type, int wingnum );
extern void ai_add_goal_sub_sexp( int sexp, int type, ai_goal *aigp );
extern int ai_remove_goal_sexp_sub( int sexp, ai_goal* aigp );
extern void ai_remove_wing_goal_sexp(int sexp, int wingnum);
// adds goals to ships/sings through player orders
extern void ai_add_ship_goal_player( int type, int mode, int submode, char *shipname, ai_info *aip );
extern void ai_add_wing_goal_player( int type, int mode, int submode, char *shipname, int wingnum );
@@ -120,11 +281,13 @@ extern void ai_copy_mission_wing_goal( ai_goal *aigp, ai_info *aip );
extern void ai_mission_goal_complete( ai_info *aip );
extern void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp );
extern void ai_update_goal_references(ai_goal *goals, int type, const char *old_name, const char *new_name);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, const char *name);
extern char *ai_add_dock_name(const char *str);
extern int ai_get_subsystem_type( char *subsystem );
extern char *ai_get_subsystem_type_name(int type);
extern void ai_update_goal_references(ai_goal *goals, int type, char *old_name, char *new_name);
extern int query_referenced_in_ai_goals(ai_goal *goals, int type, char *name);
extern char *ai_add_dock_name(char *str);
extern int ai_query_goal_valid( int ship, int ai_goal_type );
extern int ai_query_goal_valid( int ship, int ai_goal );
extern void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int docker_point, int dockee_point, int immediate = 1 );
extern void ai_add_goal_wing_internal( wing *wingp, int goal_type, char *name, int immediate = 1 );
-3
View File
@@ -10,9 +10,6 @@
#ifndef _AIINTERNAL_H
#define _AIINTERNAL_H
#include "ship/ship.h"
#include "weapon/weapon.h"
//Returns true if the specified object is a stealth ship, false if not
bool is_object_stealth_ship(object* objp);
+5 -2
View File
@@ -7,7 +7,10 @@
*
*/
#ifndef _AILOCAL_H
#define _AILOCAL_H
// -- Don't put anything in here --
// Put it in ai.h!
#include "stdafx.h"
#endif
+637 -1497
View File
File diff suppressed because it is too large. Load diff
+490 -160
View File
@@ -7,20 +7,296 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
* $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
*
*
* 9 9/13/99 11:26p Andsager
* Add debug code to check for poorly sized anis
*
* 8 8/26/99 9:45a Dave
* First pass at easter eggs and cheats.
*
* 7 7/16/99 1:49p Dave
* 8 bit aabitmaps. yay.
*
* 6 7/13/99 1:15p Dave
* 32 bit support. Whee!
*
* 5 6/10/99 10:34a Dave
* Removed unnecessary assert.
*
* 4 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 3 10/22/98 6:14p Dave
* Optimized some #includes in Anim folder. Put in the beginnings of
* parse/localization support for externalized strings and tstrings.tbl
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 38 6/23/98 4:18p Hoffoss
* Fixed some bugs with AC release build.
*
* 37 5/18/98 5:59p Hoffoss
* Made command briefing advanced now once the speech stops and animation
* has fully played once, whichever is longer.
*
* 36 5/14/98 6:29p Hoffoss
* Fixed some warnings a release rebuild all turned up.
*
* 35 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 34 4/27/98 3:36p Dave
*
* 33 3/25/98 8:43p Hoffoss
* Changed anim_play() to not be so complex when you try and call it.
*
* 32 2/05/98 9:21p John
* Some new Direct3D code. Added code to monitor a ton of stuff in the
* game.
*
* 31 1/19/98 11:37p Lawrance
* Fixing Optimization build warnings
*
* 30 1/19/98 3:09p Hoffoss
* Only free an anim instance if it is actually playing.
*
* 29 1/14/98 6:43p Lawrance
* Add ref_count to anim struct, so we don't free multiple times
*
* 28 12/30/97 6:44p John
* Made g3_Draw_bitmap functions account for aspect of bitmap.
*
* 27 12/27/97 2:35p John
* Restructed some code so that if the memory-mapped file open fails, it
* will still read it the old-fashioned, non-memory mapped way.
*
* 26 12/24/97 9:10p Lawrance
* take out some debugging statements
*
* 25 12/24/97 8:57p Lawrance
* Added anim_ignore_next_frametime()
*
* 24 12/07/97 2:06p Dave
* Removed some debug frame-checking code.
*
* 23 12/06/97 2:55p Dave
*
* 22 11/29/97 2:05p John
* made g3_draw_bitmap and g3_draw_rotated bitmap take w&h, not w/2 & h/2,
* like they used to incorrectly assume. Added code to model to read in
* thruster radius's.
*
* 21 11/20/97 5:36p Dave
* Hooked in a bunch of main hall changes (including sound). Made it
* possible to reposition (rewind/ffwd)
* sound buffer pointers. Fixed animation direction change framerate
* problem.
*
* 20 11/20/97 4:33p Sandeep
* ALAN: ensure instance->paused gets initialized
*
* 19 11/20/97 4:12p Lawrance
* when paused, don't increment time_elapsed
*
* 18 11/19/97 8:28p Dave
* Hooked in Main Hall screen. Put in Anim support for ping ponging
* animations as well as general reversal of anim direction.
*
* 17 9/11/97 4:17p Allender
* use _MAX_PATH instead of MAX_FILENAME_LENGTH for anim_play since it is
* called from MoviePlayer with full path
*
* 16 9/11/97 10:49a Lawrance
* improve anim_show_next_frame()
*
* 15 9/10/97 4:59p Lawrance
* improve comments to anim_play() function
*
* 14 9/03/97 4:19p John
* changed bmpman to only accept ani and pcx's. made passing .pcx or .ani
* to bm_load functions not needed. Made bmpman keep track of palettes
* for bitmaps not mapped into game palettes.
*
* 13 8/30/97 2:11p Lawrance
* allow animations to loop
*
* 12 8/25/97 11:13p Lawrance
* support framerate independent playback with the option of now advancing
* more than one frame at a time
*
* 11 8/22/97 8:20a Lawrance
* display scrolling text properly, with indicator that text exitsts to be
* scrolled
*
* 10 8/21/97 5:11p Lawrance
* frame numbering for ANI's now is from 0 -> total_frames-1.
*
* 9 8/19/97 9:30a Lawrance
* print out reason if file doesn't open right
*
* 8 7/28/97 10:42p Lawrance
* re-did interface to unpack_frame() to make more general
*
* 7 7/21/97 11:41a Lawrance
* make playback time of .ani files keyed of frametime
*
* 6 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 5 7/11/97 11:54a John
* added rotated 3d bitmaps.
*
* 4 6/27/97 4:36p Lawrance
* update pal translation table when gr_screen.signature changes
*
* 3 6/26/97 3:00p Lawrance
* fix bug with playing 3d anims
*
* 2 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 1 6/23/97 5:09p Lawrance
*
* 24 6/03/97 5:53p Lawrance
* don't unload bitmap after bm_create
*
* $NoKeywords: $
*/
#include "anim/animplay.h"
#include "anim/packunpack.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"
#include "globalincs/linklist.h"
#include "graphics/2d.h"
#include "io/timer.h"
#include "pcxutils/pcxutils.h"
#include "render/3d.h"
#include "graphics/material.h"
#include "tracing/Monitor.h"
static color Color_xparent;
@@ -31,17 +307,16 @@ anim_instance anim_render_list;
#define MAX_ANIM_INSTANCES 25
anim_instance anim_render_instance[MAX_ANIM_INSTANCES];
int Anim_paused; /// Global variable to pause the playing back of anims
int Anim_paused; // global variable to pause the playing back of anims
int Anim_inited = FALSE;
fix t1,t2;
int Anim_ignore_frametime=0; // flag used to ignore frametime... useful when need to avoid saturated frametimes
/**
* @brief Initialise animation
* @details Queue all the ::anim_render_instance[] elements onto the ::anim_free_list
*/
// -------------------------------------------------------------------------------------------------
// anim_init() will queue all the anim_render_instance[] elements onto the anim_free_list
//
void anim_init()
{
int i;
@@ -61,9 +336,9 @@ void anim_init()
Anim_inited = TRUE;
}
/**
* @brief Display the frames for the currently playing anims
*/
// -------------------------------------------------------------------------------------------------
// anim_render_all() will display the frames for the currently playing anims
//
void anim_render_all(int screen_id, float frametime)
{
anim_instance* A;
@@ -86,10 +361,10 @@ void anim_render_all(int screen_id, float frametime)
}
}
/**
* @brief Display the frames for the passed animation
* @details It will ignore animations which do not have the same id as the passed screen_id
*/
// -------------------------------------------------------------------------------------------------
// anim_render_one() will display the frames for the passed animation, it will ignore animations which
// do not have the same id as the passed screen_id
//
void anim_render_one(int screen_id, anim_instance *ani, float frametime)
{
// make sure this guy's screen id matches the passed one
@@ -110,17 +385,14 @@ void anim_render_one(int screen_id, anim_instance *ani, float frametime)
MONITOR(NumANIPlayed)
/**
* @brief Setup an anim_play_struct for passing into ::anim_play().
* @details Will fill in default values, which you can then change before calling ::anim_play().
*/
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int base_w, int base_h)
// Setup an anim_play_struct for passing into anim_play(). Will fill in default values, which you
// can then change before calling anim_play().
//
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y)
{
aps->anim_info = a_info;
aps->x = x;
aps->y = y;
aps->base_w = base_w;
aps->base_h = base_h;
aps->start_at = 0;
aps->stop_at = a_info->total_frames - 1;
aps->screen_id = 0;
@@ -133,21 +405,49 @@ void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int base_
aps->ping_pong = 0;
}
/**
* @brief Will add an anim instance to the anim_render_list.
* This will cause the anim to be played at the x,y position specified in the parameter list.
*
* @param aps Compressed animation that we should make an instance from
* @return If success pointer to instance, NULL if anim anim could not be played
*/
// -------------------------------------------------------------------------------------------------
// anim_play() will add an anim instance to the anim_render_list. This will cause the
// anim to be played at the x,y position specified in the parameter list.
//
// input:
//
// anim_info => the compressed animation that we should make an instance from
// x => x position of animation to play at (top left corner)
// y => y position of animation to play at ( top left corner)
// start_at => frame number to start at (note: numbering is from 0->num_frames-1)
// stop_at => frame number to stop at (note: numbering is from 0->num_frames-1)
// screen_id => OPTIONAL (default value 0): screen signature so animation only plays when
// anim_render_all() called with that same signature
// world_pos => OPTIONAL (default value NULL): only give a world pos when you want to
// play the animation at a 3D location. You must specify radius when
// this is non-null.
// radius => OPTIONAL (default value 0): only needed when the animation is playing
// as a 3D animation (this is only when world_pos in not NULL).
// fi => OPTIONAL (default value 0): framerate indepentdent flag, when set TRUE
// the animation will skip frames if necessary to maintain the fps value
// associated with the animation
// color => OPTIONAL (default value NULL) address of an alpha color struct. Only
// required when the animation should be drawn with an alpha color.
// skip_frames => OPTIONAL (default value 1) should anim skip frames when doing framerate
// independent playback
// looped => OPTIONAL (default value 0) should anim play looped (ie forever)
//
// returns:
//
// pointer to instance => success
// NULL => if anim anim could not be played
//
anim_instance *anim_play(anim_play_struct *aps)
{
Assert( aps->anim_info != NULL );
Assert( aps->start_at >= 0 );
Assert( aps->stop_at < aps->anim_info->total_frames );
// Assert( aps->stop_at >= aps->start_at );
Assert( !(aps->looped && aps->ping_pong) ); // shouldn't have these both set at once
MONITOR_INC(NumANIPlayed, 1);
// if (aps->ping_pong && !(aps->anim_info->flags & ANF_ALL_KEYFRAMES));
anim_instance *instance;
@@ -195,14 +495,6 @@ anim_instance *anim_play(anim_play_struct *aps)
instance->xlate_pal = 0;
}
if(aps->base_w < 0 || aps->base_h < 0) {
instance->base_w = gr_screen.max_w_unscaled_zoomed;
instance->base_h = gr_screen.max_h_unscaled_zoomed;
} else {
instance->base_w = aps->base_w;
instance->base_h = aps->base_h;
}
// determining the start_at frame is more complicated, since it must be a key-frame.
// Futhermore, need to subtract 1 from key-frame number, since frame number is always
// incremented the first time anim_show_next_frame() is called
@@ -227,6 +519,16 @@ anim_instance *anim_play(anim_play_struct *aps)
idx++;
}
/*while (keyp) {
if (( (keyp->frame_num-1) <= frame_num) && ( (keyp->frame_num-1) > key)) { // find closest key
key = keyp->frame_num-1;
offset = keyp->offset;
if ( key == frame_num )
break;
}
keyp = keyp->next;
}*/
if (key > instance->frame_num) { // best key is closer than current position
instance->frame_num = key;
@@ -244,17 +546,20 @@ anim_instance *anim_play(anim_play_struct *aps)
return instance;
}
/**
* @brief This function is called to blit the next frame of an anim instance to the screen.
* This is normally called by the anim_render_all() function.
*
* @param instance Pointer to animation instance
* @param frametime Time elapsed since last call, in seconds
*/
// -----------------------------------------------------------------------------
// anim_show_next_frame()
//
// This function is called to blit the next frame of an anim instance to the
// screen. This is normally called by the anim_render_all() function.
//
// input: instance => pointer to animation instance
// frametime => time elapsed since last call, in seconds
//
int anim_show_next_frame(anim_instance *instance, float frametime)
{
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
float percent_through, time;
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
float percent_through, decompress_time, render_time, time;
vertex image_vertex;
int aabitmap = 0;
int bpp = 16;
@@ -274,9 +579,9 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
percent_through = instance->time_elapsed / time;
if(instance->direction == ANIM_DIRECT_FORWARD)
new_frame_num = instance->start_at - 1 + (int) lround(percent_through * n_frames);
new_frame_num = instance->start_at - 1 + fl2i(percent_through * n_frames + 0.5f);
else
new_frame_num = instance->start_at - 1 - (int) lround(percent_through * n_frames);
new_frame_num = instance->start_at - 1 - fl2i(percent_through * n_frames + 0.5f);
frame_save = instance->frame_num;
@@ -336,6 +641,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
instance->time_elapsed = 0.0f;
} else if(instance->ping_pong) { // pingponged animations
instance->frame_num = instance->stop_at;
// instance->time_elapsed = 0.0f;
anim_reverse_direction(instance);
} else { // one-shot animations
instance->frame_num = instance->stop_at;
@@ -350,6 +656,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
instance->time_elapsed = 0.0f;
} else if(instance->ping_pong) { // pingponged animations
instance->frame_num = instance->stop_at;
// instance->time_elapsed = 0.0f;
anim_reverse_direction(instance);
} else { // one-shot animations
instance->frame_num = instance->stop_at+1;
@@ -373,6 +680,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
}
}
Assert(frame_diff >= 0);
// nprintf(("Alan","FRAME DIFF: %d\n",frame_diff));
Assert( instance->frame_num >= 0 && instance->frame_num < instance->parent->total_frames );
// if the anim is paused, ignore all the above changes and still display this frame
@@ -383,6 +691,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
}
if (instance->parent->flags & ANF_XPARENT){
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
}
bpp = 16;
@@ -461,6 +770,8 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
instance->file_offset = instance->parent->file_offset;
instance->loop_count++;
}
decompress_time = f2fl(t2-t1);
t1 = timer_get_fixed_seconds();
if ( frame_diff == 0 && instance->last_bitmap != -1 ) {
@@ -470,7 +781,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
if ( instance->last_bitmap != -1 ){
bm_release(instance->last_bitmap);
}
bitmap_id = bm_create(bpp, instance->parent->width, instance->parent->height, instance->frame, bitmap_flags);
bitmap_id = bm_create(16, instance->parent->width, instance->parent->height, instance->frame, bitmap_flags);
}
if ( bitmap_id == -1 ) {
@@ -486,42 +797,37 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
// determine x,y to display the bitmap at
if ( instance->world_pos == NULL ) {
int old_max_w_unscaled = gr_screen.max_w_unscaled;
int old_max_h_unscaled = gr_screen.max_h_unscaled;
int old_max_w_unscaled_zoomed = gr_screen.max_w_unscaled_zoomed;
int old_max_h_unscaled_zoomed = gr_screen.max_h_unscaled_zoomed;
gr_set_screen_scale(instance->base_w, instance->base_h);
gr_set_clip(0, 0, instance->base_w, instance->base_h, GR_RESIZE_MENU);
if ( instance->aa_color == NULL ) {
gr_bitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
gr_bitmap(instance->x, instance->y);
}
else {
gr_set_color_fast( (color*)instance->aa_color );
gr_aabitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
gr_aabitmap(instance->x, instance->y);
}
gr_set_screen_scale(old_max_w_unscaled, old_max_h_unscaled, old_max_w_unscaled_zoomed, old_max_h_unscaled_zoomed);
gr_reset_clip();
}
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 | TMAP_HTL_2D);
material mat_params;
material_set_unlit(&mat_params, bitmap_id, 1.0f, false, false);
g3_render_rect_screen_aligned_2d(&mat_params, &image_vertex, 0, instance->radius*1.5f);
g3_draw_bitmap(&image_vertex, 0, instance->radius*1.5f, TMAP_FLAG_TEXTURED | TMAP_HTL_2D);
}
//bm_release(bitmap_id);
instance->last_bitmap = bitmap_id;
}
t2 = timer_get_fixed_seconds();
render_time = f2fl(t2-t1);
// nprintf(("Alan","DECOMPRESS: %.3fms RENDER: %.3fms\n", decompress_time*1000, render_time*1000));
return 0;
}
/**
* @brief Stop an anim instance that is on the anim_render_list from playing
*/
// -----------------------------------------------------------------------------
// anim_stop_playing()
//
// Stop an anim instance that is on the anim_render_list from playing
//
int anim_stop_playing(anim_instance* instance)
{
Assert(instance != NULL);
@@ -532,12 +838,14 @@ int anim_stop_playing(anim_instance* instance)
return 0;
}
/**
* @brief Free a particular animation instance that is on the anim_render_list.
* Do not call this function to free an animation instance in general (use
* free_anim_instance() for that), only when you want to free an instance
* that is on the anim_render_list
*/
// -----------------------------------------------------------------------------
// anim_release_render_instance()
//
// Free a particular animation instance that is on the anim_render_list. Do
// not call this function to free an animation instance in general (use
// free_anim_instance() for that), only when you want to free an instance
// that is on the anim_render_list
//
void anim_release_render_instance(anim_instance* instance)
{
Assert( instance != NULL );
@@ -560,13 +868,16 @@ void anim_release_render_instance(anim_instance* instance)
list_append( &anim_free_list, instance );
}
/**
* @brief Free all anim instances that are on the anim_render_list.
*
* @param screen_id Optional parameter that lets you only free a subset of the anim instances.
* A screen_id of 0 is the default value, and this is used for animations that always play when
* they are placed on the aim_render_list.
*/
// -----------------------------------------------------------------------------
// anim_release_all_instances()
//
// Free all anim instances that are on the anim_render_list.
//
// input: screen_id => optional parameter that lets you only free a subset
// of the anim instances. A screen_id of 0 is the default
// value, and this is used for animations that always play
// when they are placed on the aim_render_list.
//
void anim_release_all_instances(int screen_id)
{
anim_instance* A;
@@ -590,18 +901,18 @@ void anim_release_all_instances(int screen_id)
//
// Read the header of a .ani file. Below is the format of a .ani header
//
// #bytes | description
// #bytes | description
// 2 | obsolete, kept for compatibility with old versions
// 2 | version number
// 2 | fps
// 1 | transparent red value
// 1 | transparent green value
// 1 | transparent green value
// 1 | transparent blue value
// 2 | width
// 2 | height
// 2 | number of frames
// 1 | packer code
// 763 | palette
// 763 | palette
// 2 | number of key frames
// 2 | key frame number } repeats
// 4 | key frame offset } repeats
@@ -611,7 +922,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
{
ptr->width = cfread_short(fp);
// If first 2 bytes are zero, this means we are using a new format, which includes
// a version, and fps values. This is only done since a version number was not included
// a version, and fps values. This is only done since a version number was not included
// in the original header.
// default
@@ -638,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;
@@ -656,7 +966,7 @@ void anim_read_header(anim *ptr, CFILE *fp)
if (diff != 0) {
if (ptr->height > 16) {
mprintf(("ANI %s with size %dx%d (%.1f%% wasted)\n", ptr->name, ptr->width, ptr->height, waste));
mprintf(("ANI %s with size %dx%d (%.1f%% wasted)\n", ptr->name, ptr->height, ptr->height, waste));
}
}
#endif
@@ -676,32 +986,35 @@ void anim_read_header(anim *ptr, CFILE *fp)
}
}
/**
* @brief Load an animation. This stores the compressed data, which instances of the animation can reference.
* Must be free'ed later with anim_free().
*
* @param real_filename Filename of animation
* @param cf_dir_type
* @param file_mapped Whether to use memory-mapped file or not.
*
* @details Memory-mapped files will page in the animation from disk as it is needed, but performance is not as good.
* @return Pointer to anim that is loaded if sucess, NULL if failure.
*/
anim *anim_load(const char *real_filename, int cf_dir_type, int file_mapped)
// -----------------------------------------------------------------------------
// anim_load()
//
// Load an animation. This stores the compressed data, which instances
// of the animation can reference. Must be free'ed later with anim_free()
//
// input: name => filename of animation
// file_mapped => boolean, whether to use memory-mapped file or not.
// Memory-mapped files will page in the animation from disk
// as it is needed, but performance is not as good
//
// returns: pointer to anim that is loaded => sucess
// NULL => failure
//
anim *anim_load(char *real_filename, int file_mapped)
{
anim *ptr;
CFILE *fp;
int count,idx;
char name[_MAX_PATH];
Assert( real_filename != NULL );
Assert ( real_filename != NULL );
strcpy_s( name, real_filename );
strcpy( name, real_filename );
char *p = strchr( name, '.' );
if ( p ) {
*p = 0;
}
strcat_s( name, ".ani" );
strcat( name, ".ani" );
ptr = first_anim;
while (ptr) {
@@ -712,7 +1025,7 @@ anim *anim_load(const char *real_filename, int cf_dir_type, int file_mapped)
}
if (!ptr) {
fp = cfopen(name, "rb", CFILE_NORMAL, cf_dir_type);
fp = cfopen(name, "rb");
if ( !fp )
return NULL;
@@ -723,7 +1036,7 @@ anim *anim_load(const char *real_filename, int cf_dir_type, int file_mapped)
ptr->next = first_anim;
first_anim = ptr;
Assert(strlen(name) < _MAX_PATH - 1);
strcpy_s(ptr->name, name);
strcpy(ptr->name, name);
ptr->instance_count = 0;
ptr->width = 0;
ptr->height = 0;
@@ -733,10 +1046,6 @@ anim *anim_load(const char *real_filename, int cf_dir_type, int file_mapped)
anim_read_header(ptr, fp);
if (ptr->width < 0 || ptr->height < 0) {
Error(LOCATION, "Ani file %s has a faulty header and cannot be loaded.", name);
}
if(ptr->num_keys > 0){
ptr->keys = (key_frame*)vm_malloc(sizeof(key_frame) * ptr->num_keys);
Assert(ptr->keys != NULL);
@@ -749,10 +1058,22 @@ anim *anim_load(const char *real_filename, int cf_dir_type, int file_mapped)
ptr->keys[idx].frame_num = 0;
cfread(&ptr->keys[idx].frame_num, 2, 1, fp);
cfread(&ptr->keys[idx].offset, 4, 1, fp);
ptr->keys[idx].frame_num = INTEL_INT( ptr->keys[idx].frame_num ); //-V570
ptr->keys[idx].offset = INTEL_INT( ptr->keys[idx].offset ); //-V570
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 *) vm_malloc(sizeof(key_frame));
keyp->next = *prev_keyp;
*prev_keyp = keyp;
prev_keyp = &keyp->next;
keyp->frame_num = 0;
cfread(&keyp->frame_num, 2, 1, fp);
cfread(&keyp->offset, 4, 1, fp);
}*/
cfread(&count, 4, 1, fp); // size of compressed data
count = INTEL_INT( count );
@@ -761,14 +1082,14 @@ anim *anim_load(const char *real_filename, int cf_dir_type, int 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, cf_dir_type);
ptr->cfile_ptr = cfopen(name, "rb", CFILE_MEMORY_MAPPED);
}
// couldn't memory-map file... must be in a packfile, so stream manually
if ( file_mapped == PAGE_FROM_MEM && !ptr->cfile_ptr ) {
if ( file_mapped && !ptr->cfile_ptr ) {
ptr->flags &= ~ANF_MEM_MAPPED;
ptr->flags |= ANF_STREAMED;
ptr->cfile_ptr = cfopen(name, "rb", CFILE_NORMAL, cf_dir_type);
ptr->cfile_ptr = cfopen(name, "rb");
}
ptr->cache = NULL;
@@ -813,10 +1134,12 @@ anim *anim_load(const char *real_filename, int cf_dir_type, int file_mapped)
return ptr;
}
/**
* @brief Free an animation that was loaded with anim_load().
* @details All instances referencing this animation must be free'ed or get an assert.
*/
// ---------------------------------------------------
// anim_free()
//
// Free an animation that was loaded with anim_load(). All instances
// referencing this animation must be free'ed or get an assert.
//
int anim_free(anim *ptr)
{
Assert ( ptr != NULL );
@@ -848,14 +1171,14 @@ int anim_free(anim *ptr)
if ( ptr->flags & (ANF_MEM_MAPPED|ANF_STREAMED) ) {
cfclose(ptr->cfile_ptr);
if (ptr->cache != NULL) {
if ( ptr->cache ) {
vm_free(ptr->cache);
ptr->cache = NULL;
}
}
else {
Assert(ptr->data);
if (ptr->data != NULL) {
if ( ptr->data ) {
vm_free(ptr->data);
ptr->data = NULL;
}
@@ -867,9 +1190,11 @@ int anim_free(anim *ptr)
}
/**
* @brief Return if an anim is playing or not.
*/
// ---------------------------------------------------------------------
// anim_playing()
//
// Return if an anim is playing or not.
//
int anim_playing(anim_instance *ai)
{
Assert(ai != NULL);
@@ -880,28 +1205,36 @@ int anim_playing(anim_instance *ai)
}
/**
* @brief Called at the beginning of a mission to initialize any mission dependent anim data.
* @todo Redundant?
*/
// ---------------------------------------------------------------------
// anim_level_init()
//
// Called at the beginning of a mission to initialize any mission dependent
// anim data.
//
void anim_level_init()
{
}
/**
* @brief Called after the end of a mission to clean up any mission dependent anim data.
*/
// ---------------------------------------------------------------------
// anim_level_close()
//
// Called after the end of a mission to clean up any mission dependent
// anim data.
//
void anim_level_close()
{
anim_release_all_instances();
}
/**
* @brief Write the frames of a .ani file out to disk as .pcx files.
* @details Use naming convention: filename0000.pcx, filename0001.pcx etc.
*
* @return If success 0, or if failed -1
*/
// ---------------------------------------------------
// anim_write_frames_out()
//
// Write the frames of a .ani file out to disk as .pcx files.
// Use naming convention: filename0000.pcx, filename0001.pcx etc.
//
// return: 0 => success
// -1 => failed
//
int anim_write_frames_out(char *filename)
{
anim *source_anim;
@@ -911,7 +1244,7 @@ int anim_write_frames_out(char *filename)
int i,j;
ubyte **row_data;
strcpy_s(root_name, filename);
strcpy(root_name, filename);
root_name[strlen(filename)-4] = 0;
source_anim = anim_load(filename);
@@ -924,9 +1257,9 @@ int anim_write_frames_out(char *filename)
for ( i = 0; i < source_anim->total_frames; i++ ) {
anim_get_next_raw_buffer(ai, 0, 0, 16);
strcpy_s(pcxname, root_name);
strcpy(pcxname, root_name);
sprintf(buf,"%04d",i);
strcat_s(pcxname, buf);
strcat(pcxname, buf);
for ( j = 0; j < source_anim->height; j++ ) {
row_data[j] = &ai->frame[j*source_anim->width];
@@ -947,10 +1280,12 @@ int anim_write_frames_out(char *filename)
return 0;
}
/**
* @brief Display information and statistics about a .ani file.
* @details This is called when -i switch is on when running ac.exe
*/
// ---------------------------------------------------
// anim_display_info()
//
// Display information and statistics about a .ani file.
// This is called when -i switch is on when running ac.exe
//
void anim_display_info(char *real_filename)
{
CFILE *fp;
@@ -959,12 +1294,12 @@ void anim_display_info(char *real_filename)
int i, uncompressed, compressed, *key_frame_nums=NULL, tmp;
char filename[MAX_FILENAME_LEN];
strcpy_s( filename, real_filename );
strcpy( filename, real_filename );
char *p = strchr( filename, '.' );
if ( p ) {
*p = 0;
}
strcat_s( filename, ".ani" );
strcat( filename, ".ani" );
fp = cfopen(filename, "rb");
if ( !fp ) {
@@ -973,21 +1308,14 @@ void anim_display_info(char *real_filename)
}
anim_read_header(&A, fp);
if (A.width < 0 || A.height < 0) {
Error(LOCATION, "Ani file %s has a faulty header and cannot be loaded.", filename);
}
// read the keyframe frame nums and offsets
key_frame_nums = (int*)vm_malloc(sizeof(int)*A.num_keys);
Assert(key_frame_nums != NULL);
if (key_frame_nums == NULL)
return;
for ( i = 0; i < A.num_keys; i++ ) {
key_frame_nums[i] = 0;
cfread(&key_frame_nums[i], 2, 1, fp);
cfread(&tmp, 4, 1, fp);
//printf("key frame num: %d,%d\n", key_frame_nums[i],tmp);
}
cfread(&compressed, 4, 1, fp);
@@ -1016,7 +1344,7 @@ void anim_display_info(char *real_filename)
printf("FPS: %d\n", A.fps);
#ifndef NDEBUG
printf("Transparent RGB: (%u,%u,%u)\n", A.xparent_r, A.xparent_g, A.xparent_b);
printf("Transparent RGB: (%d,%d,%d)\n", A.xparent_r, A.xparent_g, A.xparent_b);
#endif
printf("ac version: %d\n", A.version);
@@ -1032,9 +1360,11 @@ void anim_reverse_direction(anim_instance *ai)
{
int temp;
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
// The God of Delta-RLE demands it be thus.
Assertion( ai->parent->flags & ANF_ALL_KEYFRAMES, "Ani was set to play backwards. In order to enable this, all frames of the animation MUST be keyframes.");
if(!(ai->parent->flags & ANF_ALL_KEYFRAMES)){
// you're not allowed to call anim_reverse_direction(...) unless every frame is a keyframe!!!!
// The God of Delta-RLE demands it be thus.
Int3();
}
// flip the animation direction
if(ai->direction == ANIM_DIRECT_FORWARD){
+120 -8
View File
@@ -7,25 +7,136 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
* $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
*
*
* 3 10/22/98 6:14p Dave
* Optimized some #includes in Anim folder. Put in the beginnings of
* parse/localization support for externalized strings and tstrings.tbl
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 11 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 10 4/27/98 3:36p Dave
*
* 9 3/25/98 8:43p Hoffoss
* Changed anim_play() to not be so complex when you try and call it.
*
* 8 12/24/97 8:57p Lawrance
* Added anim_ignore_next_frametime()
*
* 7 11/19/97 8:28p Dave
* Hooked in Main Hall screen. Put in Anim support for ping ponging
* animations as well as general reversal of anim direction.
*
* 6 8/30/97 2:11p Lawrance
* allow animations to loop
*
* 5 8/25/97 11:13p Lawrance
* support framerate independent playback with the option of now advancing
* more than one frame at a time
*
* 4 7/21/97 11:41a Lawrance
* make playback time of .ani files keyed of frametime
*
* 3 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 2 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 1 6/23/97 5:09p Lawrance
*
* 10 5/19/97 2:28p Lawrance
* changes some variables to flags
*
* 9 5/15/97 5:58p Lawrance
* fix some bugs that were present with animations when playing multiple
* missions
*
* 8 5/15/97 4:42p Lawrance
* suporting anims in-game
*
* 7 5/15/97 11:46a Lawrance
* add function to check if an anim is playing
*
* 6 2/28/97 12:17p Lawrance
* supporting mapping file to memory
*
* 5 2/25/97 11:06a Lawrance
* moved some higher level functions to from PackUnpack to AnimPlay
*
* 4 2/19/97 9:27p Lawrance
* added pause capability to anim playback
*
* 3 2/17/97 4:19p Lawrance
* using frame numbers instead of percentages for accessing keyframes
*
* 2 2/17/97 3:01p Lawrance
* code for playing back an anim
*
* $NoKeywords: $
*/
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
struct anim_instance;
struct CFILE;
// structure passed in when playing an anim. Talk about overkill..
typedef struct {
anim *anim_info;
int x;
int y;
int base_w;
int base_h;
int start_at;
int stop_at;
int screen_id;
@@ -40,8 +151,9 @@ typedef struct {
enum
{
PAGE_FROM_DISK = 0,
PAGE_FROM_MEM = 1
PAGE_FROM_MEM = 0,
PAGE_FROM_DISK = 1,
PAGE_FROM_DISK_FORCED = 2
};
extern int Anim_paused;
@@ -51,14 +163,14 @@ void anim_level_init();
void anim_level_close();
void anim_render_all(int screen_id, float frametime);
void anim_render_one(int screen_id, anim_instance *ani, float frametime);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int max_x = -1, int max_y = -1);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y);
anim_instance *anim_play(anim_play_struct *aps);
void anim_ignore_next_frametime();
int anim_stop_playing(anim_instance* anim_instance);
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(const char *name, int cf_dir_type = CF_TYPE_ANY, int file_mapped = PAGE_FROM_DISK);
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);
+420 -85
View File
@@ -7,12 +7,224 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
* $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
*
*
* 12 7/30/99 10:10p Dave
* Fixed loading bar in 32 bit mode.
*
* 11 7/18/99 1:59p Johnson
* Fixed potential anim locking problem.
*
* 10 7/16/99 1:49p Dave
* 8 bit aabitmaps. yay.
*
* 9 7/13/99 1:15p Dave
* 32 bit support. Whee!
*
* 8 4/09/99 2:21p Dave
* Multiplayer beta stuff. CD checking.
*
* 7 1/14/99 12:48a Dave
* Todo list bug fixes. Made a pass at putting briefing icons back into
* FRED. Sort of works :(
*
* 6 12/01/98 5:53p Dave
* Simplified the way pixel data is swizzled. Fixed tga bitmaps to work
* properly in D3D and Glide.
*
* 5 12/01/98 8:06a Dave
* Temporary checkin to fix some texture transparency problems in d3d.
*
* 4 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 3 10/22/98 6:14p Dave
* Optimized some #includes in Anim folder. Put in the beginnings of
* parse/localization support for externalized strings and tstrings.tbl
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 30 5/14/98 3:38p John
* Added in more non-darkening colors for Adam. Had to fix some bugs in
* BmpMan and Ani stuff to get this to work.
*
* 29 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 28 11/19/97 8:28p Dave
* Hooked in Main Hall screen. Put in Anim support for ping ponging
* animations as well as general reversal of anim direction.
*
* 27 9/09/97 3:39p Sandeep
* warning level 4 bugs
*
* 26 8/22/97 8:21a Lawrance
* short circuit key frame check if keyframe matches frame we are
* searching for
*
* 25 8/21/97 5:11p Lawrance
* frame numbering for ANI's now is from 0 -> total_frames-1.
*
* 24 8/19/97 10:59a Lawrance
* fix problem with accessing key frames
*
* 23 7/28/97 10:42p Lawrance
* re-did interface to unpack_frame() to make more general
*
* 22 7/28/97 10:52a Lawrance
* correctly set bitmap flags in anim_get_frame()
*
* 21 7/21/97 5:10p Lawrance
* fix problem that was causing infinite recursion
*
* 20 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 19 6/27/97 4:36p Lawrance
* update pal translation table when gr_screen.signature changes
*
* 18 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 17 6/25/97 3:03p Lawrance
* fix palette translation problem with anti-alised bitmaps
*
* 16 5/19/97 2:28p Lawrance
* changes some variables to flags
*
* 15 5/15/97 4:42p Lawrance
* supporting animations in-game
*
* 14 2/25/97 11:06a Lawrance
* moved some higher level functions to from PackUnpack to AnimPlay
*
* 13 2/19/97 9:51p Lawrance
* made keyframe decompression more effecient, moved
* default anim FPS to header file
*
* 12 2/19/97 4:00p Lawrance
* don't assert when cannot find anim filename, return a NULL instead
*
* 11 2/17/97 4:17p Hoffoss
* modified packing internal format and added random access function to an
* Anim frame.
*
* 10 2/17/97 2:59p Lawrance
* integrating into game
*
* 9 2/14/97 11:27p Lawrance
* optimized unpacking some more (Jason)
*
* 8 2/14/97 11:09p Hoffoss
* Made optimizations.
*
* 7 2/14/97 10:48p Hoffoss
* fixed bug.
*
* 6 2/14/97 10:38p Lawrance
* fixing bugs
*
* 5 2/14/97 5:38p Hoffoss
* Changes to get AnimCoverter project to compile and link.
*
* 4 2/14/97 3:29p Hoffoss
* Added header for MSDEV to fill in.
*
* $NoKeywords: $
*/
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "anim/animplay.h"
const int packer_code = PACKER_CODE;
@@ -49,7 +261,6 @@ anim_instance *init_anim_instance(anim *ptr, int bpp)
ptr->instance_count++;
inst = (anim_instance *) vm_malloc(sizeof(anim_instance));
Assert(inst);
memset(inst, 0, sizeof(anim_instance));
inst->frame_num = -1;
inst->last_frame_num = -1;
inst->parent = ptr;
@@ -100,7 +311,12 @@ int anim_get_next_frame(anim_instance *inst)
return -1;
}
bitmap_flags = 0;
if (inst->parent->flags & ANF_XPARENT) {
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
} else {
bitmap_flags = 0;
}
bpp = 16;
if(inst->aa_color != NULL){
@@ -162,16 +378,159 @@ ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap
return inst->frame;
}
/**
* @brief Pack key frame
*
* @param frame Frame pixel data to pack
* @param save Memory to store packed data to
* @param size Number of bytes to pack
* @param max Maximum number of packed bytes (size of buffer)
* @param compress_type Compress type
* @return Actual number of bytes data packed to or -1 if error
*/
// --------------------------------------------------------------------
// anim_get_frame()
//
// Get a bitmap id from the anim_instance for the specified frame_num
//
// input: *inst => pointer to anim instance
// frame_num => frame number to get (first frame is 0)
// xlate_pal => DEFAULT PARM (value 1): whether to translate the palette
// to the current game palette
//
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal)
{
/*
int bm, bitmap_flags, key = 0, offset = 0;
int idx;
if ((frame_num < 0) || (frame_num >= inst->parent->total_frames)) // illegal frame number
return -1;
int need_reset = 0;
if ( anim_instance_is_streamed(inst) ) {
if ( inst->file_offset < 0 ) {
need_reset = 1;
}
} else {
if ( !inst->data ) {
need_reset = 1;
}
}
if (need_reset || (inst->frame_num >= inst->parent->total_frames)) { // reset to valid info
inst->data = inst->parent->data;
inst->file_offset = inst->parent->file_offset;
inst->frame_num = 0;
}
bitmap_flags = 0;
if (inst->parent->flags & ANF_XPARENT) {
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
}
if ( inst->frame_num == frame_num ) {
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
bm_unload(bm);
return bm;
}
if (inst->parent->flags & ANF_XPARENT){
// bitmap_flags = BMP_XPARENT;
bitmap_flags = 0;
} else {
bitmap_flags = 0;
}
idx = 0;
key = 0;
while(idx < inst->parent->num_keys){
if (( (inst->parent->keys[idx].frame_num-1) <= frame_num) && ( (inst->parent->keys[idx].frame_num-1) > key)) { // find closest key
key = inst->parent->keys[idx].frame_num - 1;
offset = inst->parent->keys[idx].offset;
if ( key == frame_num )
break;
}
idx++;
}
if ( key == frame_num ) {
inst->frame_num = key;
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = inst->parent->file_offset + offset;
} else {
inst->data = inst->parent->data + offset;
}
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal ){
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
} else {
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
} else {
if ( xlate_pal ){
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
} else {
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
}
goto create_bitmap;
}
if (key > inst->frame_num) // best key is closer than current position
{
inst->frame_num = key;
if ( anim_instance_is_streamed(inst) ) {
inst->file_offset = inst->parent->file_offset + offset;
} else {
inst->data = inst->parent->data + offset;
}
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal )
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
} else {
if ( xlate_pal )
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
}
while (inst->frame_num != frame_num) {
anim_check_for_palette_change(inst);
if ( anim_instance_is_streamed(inst) ) {
if ( xlate_pal )
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL);
} else {
if ( xlate_pal )
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation);
else
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL);
}
inst->frame_num++;
}
create_bitmap:
bm = bm_create(16, inst->parent->width, inst->parent->height, inst->frame, bitmap_flags);
bm_unload(bm);
return bm;
*/
Int3();
return -1;
}
// frame = frame pixel data to pack
// save = memory to store packed data to
// size = number of bytes to pack
// max = maximum number of packed bytes (size of buffer)
// returns: actual number of bytes data packed to or -1 if error
int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_type)
{
int last = -32768, count = 0;
@@ -256,12 +615,14 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
*save++ = (ubyte)last;
packed_size++;
Assert( last != STD_RLE_CODE );
// printf("Just packed %d 1 times, since pixel change, no count included\n",last);
}
else {
count |= STD_RLE_CODE;
*save++ = (ubyte)count;
*save++ = (ubyte)last;
packed_size += 2;
// printf("Just packed %d %d times, since pixel change\n",last,count);
}
}
@@ -278,6 +639,8 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
*save++ = (ubyte)last;
packed_size += 2;
count = 0;
// printf("Just packed %d %d times, since count overflow\n",last,count);
}
} // end for
@@ -289,6 +652,7 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
if ( (count == 1) && !(last & STD_RLE_CODE) ) {
*save++ = (ubyte)last;
packed_size++;
// printf("Just packed %d 1 times, at end since single pixel, no count\n",last);
Assert( last != STD_RLE_CODE );
}
else {
@@ -296,11 +660,13 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
*save++ = (ubyte)count;
*save++ = (ubyte)last;
packed_size += 2;
// printf("Just packed %d %d times, at end since pixel change\n",last,count);
}
}
Assert(packed_size == (save-dest_start) );
return packed_size;
break;
}
default:
@@ -312,17 +678,12 @@ int pack_key_frame(ubyte *frame, ubyte *save, long size, long max, int compress_
return packed_size;
}
/**
* @brief Pack frame
*
* @param frame Frame pixel data to pack
* @param frame2 Previous frame's pixel data
* @param save Memory to store packed data to
* @param size Number of bytes to pack
* @param max Maximum number of packed bytes (size of buffer)
* @param compress_type Compress type
* @return Actual number of bytes data packed to or -1 if error
*/
// frame = frame pixel data to pack
// frame2 = previous frame's pixel data
// save = memory to store packed data to
// size = number of bytes to pack
// max = maximum number of packed bytes (size of buffer)
// returns: actual number of bytes data packed to or -1 if error
int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, int compress_type)
{
int pixel, last = -32768, count = 0, i;
@@ -466,6 +827,7 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
Assert(packed_size == (save-dest_start) );
return packed_size;
break;
}
default:
@@ -477,11 +839,7 @@ int pack_frame(ubyte *frame, ubyte *frame2, ubyte *save, long size, long max, in
return packed_size;
}
/**
* @brief Convert a 24 bit value to a 16 bit value
* @param bit_24 24 bit value
* @param bit_16 16 bit value (output)
*/
// 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;
@@ -490,10 +848,7 @@ void convert_24_to_16(int bit_24, ushort *bit_16)
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
}
/**
* @brief Unpack a pixel given the passed index and the anim_instance's palette
* @return Bytes stuffed
*/
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bpp)
{
int bit_24;
@@ -512,14 +867,7 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
bit_16 = (ushort)pix;
break;
case 8:
// 8 bit-per-pixel aa bitmaps are a bit special since they only use value in the range [0, 15] where 15 wraps
// around back to 0. Since the rest of the code expects the value to be in the range [0, 255] the pixel value
// needs to be adjusted here. By muliplying the value with 17 the original range [0, 15] is mapped to [0, 255]
if (pix >= 15) {
bit_8 = 0;
} else {
bit_8 = (ubyte)(pix * 17);
}
bit_8 = pix;
break;
default:
Int3();
@@ -549,7 +897,7 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3); //-V512
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
@@ -580,11 +928,8 @@ int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bp
return pixel_size;
}
/**
* @brief Unpack a pixel given the passed index and the anim_instance's palette
* @return Bytes stuffed
*/
int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0, int aabitmap = 0, int bpp = 8)
// unpack a pixel given the passed index and the anim_instance's palette, return bytes stuffed
int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count, int aabitmap, int bpp)
{
int bit_24;
int idx;
@@ -603,14 +948,7 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0,
bit_16 = (ushort)pix;
break;
case 8 :
// 8 bit-per-pixel aa bitmaps are a bit special since they only use value in the range [0, 15] where 15 wraps
// around back to 0. Since the rest of the code expects the value to be in the range [0, 255] the pixel value
// needs to be adjusted here. By muliplying the value with 17 the original range [0, 15] is mapped to [0, 255]
if (pix >= 15) {
bit_8 = 0;
} else {
bit_8 = (ubyte)(pix * 17);
}
bit_8 = pix;
break;
default :
Int3();
@@ -640,7 +978,7 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0,
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3); //-V512
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3);
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
@@ -669,17 +1007,10 @@ int unpack_pixel_count(anim_instance *ai, ubyte *data, ubyte pix, int count = 0,
return (pixel_size * count);
}
/**
* @brief Unpack frame
*
* @param ai Animation instance
* @param ptr Packed data to unpack
* @param frame Where to store unpacked data to
* @param size Total number of unpacked pixels requested
* @param pal_translate Color translation lookup table (NULL if no palette translation desired)
* @param aabitmap
* @param bpp
*/
// ptr = packed data to unpack
// frame = where to store unpacked data to
// size = total number of unpacked pixels requested
// pal_translate = color translation lookup table (NULL if no palette translation desired)
ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp)
{
int xlate_pal, value, count = 0;
@@ -762,6 +1093,9 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
}
}
else if (*ptr == PACKING_METHOD_RLE) { // normal frame, Hoffoss's RLE format
// test code, to show unused pixels
// memset(frame, 255, size);
ptr++;
while (size > 0) {
@@ -852,23 +1186,17 @@ ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte
}
}
else {
// unknown packing method
// Assert(0); // unknown packing method
return NULL;
}
return ptr;
}
/**
* @brief Unpack frame from file
*
* @param ai Animation instance
* @param frame Where to store unpacked data to
* @param size Total number of unpacked pixels requested
* @param pal_translate Color translation lookup table (NULL if no palette translation desired)
* @param aabitmap
* @param bpp
*/
// ptr = packed data to unpack
// frame = where to store unpacked data to
// size = total number of unpacked pixels requested
// pal_translate = color translation lookup table (NULL if no palette translation desired)
int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp)
{
int xlate_pal, value, count = 0;
@@ -958,6 +1286,9 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
}
else if (anim_instance_get_byte(ai,offset) == PACKING_METHOD_RLE) { // normal frame, Hoffoss's RLE format
// test code, to show unused pixels
// memset(frame, 255, size);
offset++;
while (size > 0) {
@@ -1052,7 +1383,7 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
}
else {
// unknown packing method
// Int3(); // unknown packing method
return -1;
}
@@ -1060,17 +1391,21 @@ int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal
}
/**
* @brief Set animation palette
* @todo Actually convert the frame data to correct palette at this point
*/
// TODO: actually convert the frame data to correct palette at this point
void anim_set_palette(anim *ptr)
{
int i, xparent_found = 0;
// create the palette translation look-up table
for ( i = 0; i < 256; i++ ) {
ptr->palette_translation[i] = (ubyte)i;
//if ( (ptr->palette[i*3] == ptr->xparent_r) && (ptr->palette[i*3+1] == ptr->xparent_g) && (ptr->palette[i*3+2] == ptr->xparent_b) ) {
// ptr->palette_translation[i] = 255;
// xparent_found = 1;
//} else {
// ptr->palette_translation[i] = (ubyte)palette_find( ptr->palette[i*3], ptr->palette[i*3+1], ptr->palette[i*3+2] );
ptr->palette_translation[i] = (ubyte)i;
//}
}
if ( xparent_found ) {
+163 -7
View File
@@ -7,7 +7,163 @@
*
*/
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
* $Revision: 2.6 $
* $Date: 2006-03-21 00:27:27 $
* $Author: taylor $
*
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
* Anim files. Also handles Anim loading, creating Anim instances (for
* utilizing an Anim), and getting getting frames of the Anim.
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2005/07/13 02:50:48 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.4 2005/04/05 05:53:14 taylor
* s/vector/vec3d/g, better support for different compilers (Jens Granseuer)
*
* Revision 2.3 2004/08/11 05:06:18 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.2 2004/03/05 09:01:53 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:07 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 7 7/16/99 1:49p Dave
* 8 bit aabitmaps. yay.
*
* 6 1/14/99 12:48a Dave
* Todo list bug fixes. Made a pass at putting briefing icons back into
* FRED. Sort of works :(
*
* 5 11/30/98 1:07p Dave
* 16 bit conversion, first run.
*
* 4 10/22/98 6:14p Dave
* Optimized some #includes in Anim folder. Put in the beginnings of
* parse/localization support for externalized strings and tstrings.tbl
*
* 3 10/16/98 3:42p Andsager
* increase MAX_WEAPONS and MAX_SHIPS and som header files
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 32 5/18/98 5:59p Hoffoss
* Made command briefing advanced now once the speech stops and animation
* has fully played once, whichever is longer.
*
* 31 5/07/98 3:11a Lawrance
* Implement custom streaming code
*
* 30 1/14/98 6:43p Lawrance
* Add ref_count to anim struct, so we don't free multiple times
*
* 29 11/19/97 8:28p Dave
* Hooked in Main Hall screen. Put in Anim support for ping ponging
* animations as well as general reversal of anim direction.
*
* 28 8/30/97 2:11p Lawrance
* allow animations to loop
*
* 27 8/25/97 11:13p Lawrance
* support framerate independent playback with the option of now advancing
* more than one frame at a time
*
* 26 8/21/97 5:11p Lawrance
* frame numbering for ANI's now is from 0 -> total_frames-1.
*
* 25 7/28/97 10:42p Lawrance
* re-did interface to unpack_frame() to make more general
*
* 24 7/21/97 11:41a Lawrance
* make playback time of .ani files keyed of frametime
*
* 23 7/20/97 6:57p Lawrance
* supporting new RLE format
*
* 22 6/27/97 4:36p Lawrance
* update pal translation table when gr_screen.signature changes
*
* 21 6/26/97 12:12a Lawrance
* supporting anti-aliased bitmap animations
*
* 20 6/25/97 3:03p Lawrance
* fix palette translation problem with anti-alised bitmaps
*
* 19 5/27/97 3:48p Lawrance
* don't re-create a bitmap if using the same frame of animation
*
* 18 5/21/97 11:06a Lawrance
* enabling a user-defined transparent value
*
* 17 5/19/97 3:21p Lawrance
* add fps parm, version num to anim header
*
* 16 5/19/97 2:28p Lawrance
* changes some variables to flags
*
* 15 5/15/97 4:42p Lawrance
* supporting animations in-game
*
* 14 3/01/97 2:08p Lawrance
* not using windows.h, since memory mapping details moved to cfile
*
* 13 2/28/97 12:17p Lawrance
* supporting mapping file to memory
*
* 12 2/25/97 11:06a Lawrance
* moved some higher level functions to from PackUnpack to AnimPlay
*
* 11 2/19/97 9:51p Lawrance
* made keyframe decompression more effecient, moved
* default anim FPS to header file
*
* 10 2/19/97 4:01p Lawrance
* load_anim returns int, not void
*
* 9 2/17/97 4:19p Lawrance
* changed stop and start to be actual frame numbers, not percentages
*
* 8 2/17/97 4:17p Hoffoss
* modified packing internal format and added random access function to an
* Anim frame.
*
* 7 2/17/97 2:59p Lawrance
* integrating into game
*
* 6 2/14/97 11:09p Hoffoss
* Made optimizations.
*
* 5 2/14/97 10:48p Hoffoss
* fixed bug.
*
* 4 2/14/97 10:38p Lawrance
* fixing bugs
*
* 3 2/14/97 3:29p Hoffoss
* Added header for MSDEV to fill in.
*
* $NoKeywords: $
*/
#ifndef __PACKUNPACK_H__
#define __PACKUNPACK_H__
@@ -18,11 +174,11 @@ struct CFILE;
#define ANI_STREAM_CACHE_SIZE 4096
#define PACKER_CODE 0xEE /// Used by PACKING_METHOD_RLE
#define PACKING_METHOD_RLE 0 /// Hoffoss's RLE format
#define PACKING_METHOD_RLE_KEY 1 /// Hoffoss's key frame RLE format
#define PACKING_METHOD_STD_RLE 2 /// Standard RLE format (high bit is count)
#define PACKING_METHOD_STD_RLE_KEY 3 /// Standard RLE format key frame
#define PACKER_CODE 0xEE // Use'd by PACKING_METHOD_RLE
#define PACKING_METHOD_RLE 0 // Hoffoss's RLE format
#define PACKING_METHOD_RLE_KEY 1 // Hoffoss's key frame RLE format
#define PACKING_METHOD_STD_RLE 2 // Standard RLE format (high bit is count)
#define PACKING_METHOD_STD_RLE_KEY 3 // Standard RLE format key frame
#define STD_RLE_CODE 0x80
@@ -71,7 +227,6 @@ typedef struct anim {
typedef struct anim_instance {
anim_instance *next, *prev;
int x,y; // coordinates anim is played at (top left corner of anim)
int base_w, base_h; // coordinate scale this anim is played in.
vec3d *world_pos; // world (x,y,z) position of explosion
float radius; // radius of image, needed for scaling
int frame_num; // current frame, or last frame if between frames (first frame is 0)
@@ -107,6 +262,7 @@ void anim_init();
anim_instance *init_anim_instance(anim *ptr, int bpp);
void free_anim_instance(anim_instance *inst);
int anim_get_next_frame(anim_instance *inst);
int anim_get_frame(anim_instance *inst, int frame_num, int xlate_pal=1);
ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap, int bpp);
void anim_set_palette(anim *a);
void anim_check_for_palette_change(anim_instance *inst);
+945 -667
View File
File diff suppressed because it is too large. Load diff
+209 -74
View File
@@ -7,29 +7,197 @@
*
*/
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
* $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
*
*
* 12 6/09/99 2:55p Andsager
* Allow multiple asteroid subtypes (of large, medium, small) and follow
* family.
*
* 11 6/07/99 1:18p Andsager
* Make asteroids choose consistent texture from large to small. Modify
* fireball radius of dying asteroids.
*
* 10 5/03/99 10:50p Andsager
* Make Asteroid_obj_list. Change get_nearest_turret_objnum() to use
* Asteroid_obj_list, Ship_obj_list and Missile_obj_list vs.
* obj_used_list.
*
* 9 4/16/99 2:34p Andsager
* Second pass on debris fields
*
* 8 4/15/99 5:00p Andsager
* Frist pass on Debris field
*
* 7 3/31/99 9:51a Andsager
* Add for generalization to debris field
*
* 6 2/07/99 8:51p Andsager
* Add inner bound to asteroid field. Inner bound tries to stay astroid
* free. Wrap when within and don't throw at ships inside.
*
* 5 1/20/99 6:04p Dave
* Another bit of stuff for beam weapons. Ships will properly use them
* now, although they're really deadly.
*
* 4 11/05/98 5:55p Dave
* Big pass at reducing #includes
*
* 3 10/16/98 1:22p Andsager
* clean up header files
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 17 3/26/98 9:19a Lawrance
* Support multiple asteroid pofs
*
* 16 3/17/98 12:16a Allender
* asteroids in multiplayer -- minor problems with position being correct
*
* 15 3/14/98 1:44p Mike
* Todolist items 3365..3368. Make child asteroids collide properly.
* Make asteroid throwing less bunchy, toss asteroids earlier, make
* facing-ness not break mission balance.
*
* 14 3/11/98 12:13a Lawrance
* Auto-target asteroids if no hostile ships present
*
* 13 3/08/98 4:16p Hoffoss
*
* 12 3/07/98 3:48p Lawrance
* Show offscreen indicators for asteroids
*
* 11 3/04/98 11:59p Lawrance
* create an asteroid.tbl, read all asteroid data from there
*
* 10 3/04/98 4:11p Lawrance
* Have area effects affect asteroids, have asteroids cast an area effect,
* fix ship shockwaves
*
* 9 3/03/98 12:48a Lawrance
* Ensure collide_objnum is still valid each frame.
*
* 8 3/02/98 11:35p Lawrance
* Keep track of asteroids that will impact ships on the escort view.
*
* 7 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 6 2/26/98 4:22p Lawrance
* Change wrapping behavior, make vel random
*
* 5 2/20/98 8:31p Lawrance
* delay creation of sub-asteroids
*
* 4 2/19/98 4:33p Lawrance
* hook in new sounds and custom explosion animation
*
* 3 2/19/98 12:46a Lawrance
* Further work on asteroids.
*
* 2 2/10/98 6:43p Lawrance
* Moved asteroid code to a separate lib.
*
* 1 2/10/98 6:05p Lawrance
*
* $NoKeywords: $
*/
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "globalincs/globals.h" // for NAME_LENGTH
#include "globalincs/pstypes.h"
#include "globalincs/globals.h" // for NAME_LENGTH
#include <vector>
class object;
class polymodel;
struct object;
struct polymodel;
struct collision_info_struct;
class model_draw_list;
#define MAX_ASTEROIDS 512
#define MAX_ASTEROIDS 256
#define NUM_DEBRIS_SIZES 3
#define NUM_DEBRIS_POFS 3 // Number of POFs per debris size
#define NUM_DEBRIS_SIZES 3
#define NUM_DEBRIS_POFS 3 // Number of POFs per debris size
#define ASTEROID_TYPE_SMALL 0
#define ASTEROID_TYPE_MEDIUM 1
#define ASTEROID_TYPE_LARGE 2
// This is for the asteroid types plus DEBRIS_X_Y
// (X is each species and Y is SMALL, MEDIUM, and LARGE)
// 20060826 - made dynamic -- taylor
//#define MAX_DEBRIS_TYPES ((MAX_SPECIES + 1) * NUM_DEBRIS_SIZES)
// these should always be equal for the benefit of generic asteroids (c.f. asteroid_page_in)
#define MAX_ACTIVE_DEBRIS_TYPES NUM_DEBRIS_SIZES
@@ -45,69 +213,39 @@ typedef struct asteroid_obj {
extern asteroid_obj Asteroid_obj_list;
// Data structure for determining a type and amount of other asteroids an
// asteroid will split to when destroyed.
typedef struct asteroid_split_info {
int asteroid_type;
int min;
int max;
} asteroid_split_info;
class asteroid_info
{
public:
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // POF files to load/associate with ship
int num_detail_levels; // number of detail levels for this ship
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
float max_speed; // cap on speed for asteroid
int damage_type_idx; //Damage type of the asteroid
int damage_type_idx_sav; // stored value from table used to reset damage_type_idx
float inner_rad; // radius within which maximum area effect damage is applied
float outer_rad; // radius at which no area effect damage is applied
float damage; // maximum damage applied from area effect explosion
float blast; // maximum blast impulse from area effect explosion
float initial_asteroid_strength; // starting strength of asteroid
SCP_vector< asteroid_split_info > split_info;
typedef struct asteroid_info {
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // POF files to load/associate with ship
int num_detail_levels; // number of detail levels for this ship
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
float max_speed; // cap on speed for asteroid
int damage_type_idx; //Damage type of the asteroid
float inner_rad; // radius within which maximum area effect damage is applied
float outer_rad; // radius at which no area effect damage is applied
float damage; // maximum damage applied from area effect explosion
float blast; // maximum blast impulse from area effect explosion
float initial_asteroid_strength; // starting strength of asteroid
polymodel *modelp[NUM_DEBRIS_POFS];
int model_num[NUM_DEBRIS_POFS];
SCP_vector<int> explosion_bitmap_anims;
float fireball_radius_multiplier; // the model radius is multiplied by this to determine the fireball size
asteroid_info( )
: num_detail_levels( 0 ), max_speed( 0 ), damage_type_idx( 0 ),
damage_type_idx_sav( -1 ), inner_rad( 0 ), outer_rad( 0 ),
damage( 0 ), blast( 0 ), initial_asteroid_strength( 0 ),
fireball_radius_multiplier( -1 )
{
name[ 0 ] = 0;
memset( detail_distance, 0, sizeof( detail_distance ) );
for (int i = 0; i < NUM_DEBRIS_POFS; i++)
{
modelp[i] = NULL;
model_num[i] = -1;
pof_files[i][0] = 0;
}
}
};
asteroid_info() { memset(this, 0, sizeof(asteroid_info)); damage_type_idx = -1; };
} asteroid_info;
#define AF_USED (1<<0) // Set means used.
#define AF_USED (1<<0) // Set means used.
typedef struct asteroid {
int flags;
int objnum;
int model_instance_num;
int asteroid_type; // 0..MAX_DEBRIS_TYPES
int asteroid_subtype; // Index in asteroid_info for modelnum and modelp
int check_for_wrap; // timestamp to check for asteroid wrapping around field
int check_for_wrap; // timestamp to check for asteroid wrapping around field
int check_for_collide; // timestamp to check for asteroid colliding with escort ships
int final_death_time; // timestamp to swap in new models after explosion starts
int final_death_time; // timestamp to swap in new models after explosion starts
int collide_objnum; // set to objnum that asteroid will be impacting soon
int collide_objsig; // object signature corresponding to collide_objnum
vec3d death_hit_pos; // hit pos that caused death
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
vec3d death_hit_pos; // hit pos that caused death
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
} asteroid;
@@ -124,45 +262,42 @@ typedef enum {
} field_type_t;
typedef struct asteroid_field {
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
float bound_rad;
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
int has_inner_bound;
vec3d inner_min_bound;
vec3d inner_max_bound;
vec3d vel; // Average asteroid moves at this velocity.
float speed; // Average speed of field
int num_initial_asteroids; // Number of asteroids at creation.
field_type_t field_type; // active throws and wraps, passive does not
vec3d vel; // Average asteroid moves at this velocity.
float speed; // Average speed of field
int num_initial_asteroids; // Number of asteroids at creation.
field_type_t field_type; // active throws and wraps, passive does not
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
} asteroid_field;
extern SCP_vector< asteroid_info > Asteroid_info;
extern std::vector<asteroid_info> Asteroid_info;
extern asteroid Asteroids[MAX_ASTEROIDS];
extern asteroid_field Asteroid_field;
extern int Num_asteroids;
extern int Asteroids_enabled;
extern char Asteroid_icon_closeup_model[NAME_LENGTH]; // model for asteroid field briefing icon rendering
extern vec3d Asteroid_icon_closeup_position; // closeup position for asteroid field briefing icon rendering
extern float Asteroid_icon_closeup_zoom; // zoom position for asteroid field briefing icon rendering
void asteroid_init();
void asteroid_init();
void asteroid_level_init();
void asteroid_level_close();
void asteroid_create_all();
void asteroid_render(object * obj, model_draw_list *scene);
void asteroid_render( object *asteroid_objp );
void asteroid_delete( object *asteroid_objp );
void asteroid_process_pre( object *asteroid_objp );
void asteroid_process_post( object *asteroid_objp);
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL, vec3d* hitnormal=NULL );
void asteroid_hit( object *pasteroid_objp, object *other_objp, vec3d *hitpos, float damage );
void asteroid_process_pre( object *asteroid_objp, float frame_time);
void asteroid_process_post( object *asteroid_objp, float frame_time);
int asteroid_check_collision( object *asteroid_objp, object * other_obj, vec3d * hitpos, collision_info_struct *asteroid_hit_info=NULL );
void asteroid_hit( object *asteroid_objp, object *other_objp, vec3d *hitpos, float damage );
int asteroid_count();
int asteroid_collide_objnum(object *asteroid_objp);
float asteroid_time_to_impact(object *asteroid_objp);
void asteroid_show_brackets();
void asteroid_target_closest_danger();
int asteroid_get_random_in_cone(vec3d *pos, vec3d *dir, float ang, int danger = 0);
// need to extern for multiplayer
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec);
File diff suppressed because it is too large. Load diff
+65 -44
View File
@@ -2,23 +2,64 @@
// 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"
#include "object/object.h"
#include <map>
// milliseconds between updates
#define NPS_TICKRATE 125
#define MAX_NAVPOINTS 8
#define NP_WAYPOINT 0x0001 // Nav Point is bound to the position of a single node of a waypoint path
#define NP_SHIP 0x0002 // Nav Point is bound to the position of a certain ship
#define NP_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
@@ -26,38 +67,26 @@
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
class NavPoint
struct NavPoint
{
public:
char m_NavName[32];
char NavName[32];
int flags;
void *target_obj;
int waypoint_num; //only used when flags & NP_WAYPOINT
vec3d *GetPosition();
char* GetInternalName();
void clear()
{
m_NavName[0] = 0;
flags = 0;
target_obj = NULL;
waypoint_num = -1;
}
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
#define NP_MSG_FAIL_SUPPORT_PRESENT 6
#define NP_MSG_FAIL_SUPPORT_WORKING 7
#define NP_NUM_MESSAGES 8
struct NavMessage
{
@@ -70,34 +99,32 @@ extern int CurrentNav;
extern NavPoint Navs[MAX_NAVPOINTS];
extern NavMessage NavMsgs[NP_NUM_MESSAGES];
extern int LockAPConv;
extern SCP_map<int,int> autopilot_wings;
// Cycles through the NavPoint List
bool Sel_NextNav();
// Tell us if autopilot is allowed
// Tell us is autopilot is allow
// This needs:
// * Nav point selected
// * No enemies within AutopilotMinEnemyDistance meters
// * No asteroids within AutopilotMinAsteroidDistance meters
// * No enemies within 5,000 meters
// * Destination > 1,000 meters away
// * Support ship not present or is actively leaving
bool CanAutopilot(vec3d targetPos, bool send_msg=false);
// Check if autopilot is allowed at player's current position
// See CanAutopilot(vec3d, bool) for more information
inline bool CanAutopilot(bool send_msg=false) { return CanAutopilot(Player_obj->pos, send_msg); }
bool CanAutopilot(bool send_msg=false);
bool CanAutopilotPos(vec3d targetPos);
// Engages autopilot
// This does:
// * Checks if Autopilot is allowed. See CanAutopilot() for conditions.
// * Control switched from player to AI
// * Time compression to 32x
// * Tell AI to fly to targeted Nav Point (for all nav-status wings/ships)
// * Sets max waypoint speed to the best-speed of the slowest ship tagged
// Returns false if autopilot cannot be started. True otherwise.
bool StartAutopilot();
// * 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:
@@ -118,17 +145,11 @@ void NavSystem_Do();
void NavSystem_Init();
// parse autopilot.tbl
void parse_autopilot_table(const char *filename);
void parse_autopilot_table(char *filename);
// Finds a Nav point by name
int FindNav(char *Nav);
// Selects a Nav point by name
void SelectNav(char *Nav);
// Deselects any navpoint selected.
void DeselectNav();
// Set A Nav point to "ZERO"
void ZeroNav(int i);
-54
View File
@@ -1,54 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/**
* @file bm_examples.cpp
* This file contains example code for using bmpman.
*/
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
void bm_create_example() {
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;
}
}
}
// page out the data, so that the next bm_lock will convert the new data to
// the correct bpp
bm_unload(test_bmp);
// 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, the upper left corner is the origin (0, 0)
gr_set_bitmap(test_bmp);
gr_bitmap(0, 0);
}
+140 -89
View File
@@ -1,134 +1,185 @@
#ifndef __BM_INTERNAL_H__
#define __BM_INTERNAL_H__
/*
* 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.
*
* 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.
*
*/
/**
* @file bm_internal.h
* These are functions and types used by bmpman and a few others.
/*
* $Logfile: /Freespace2/code/bmpman/bm_internal.h $
* $Revision: 2.7 $
* $Date: 2007-01-10 01:40:06 $
* $Author: taylor $
*
* @details It is a "protected" header that requires BMPMAN_INTERNAL to be defined before it can be included. This is to
* provide a small measure of safety since this functions can cause problems if not used correctly
* 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 BMPMAN_INTERNAL
#error The file header "bmpman/bm_internal.h" is protected. Make sure you know what you are doing!
#endif
#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"
#include <array>
/**
* @brief Container class for graphics API specific bitmap data
*/
class gr_bitmap_info {
public:
virtual ~gr_bitmap_info() = 0;
};
// 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
union bm_extra_info {
/// 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
int num_frames; //!< used for animations -- number of frames in the animation
int keyframe; //!< used for animations -- keyframe info
float total_time; //!< used for animations -- total animation time (not always derived from num_frames/fps)
ubyte fps; //!< used for animations -- frames per second
bool is_array; //!< Flag for if all frames of an animation have the same size which means that it can be put into a texture array
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
BM_TYPE type; //!< type for individual images
char filename[MAX_FILENAME_LEN]; //!< filename for individual images
ubyte type; // type for individual images
char filename[MAX_FILENAME_LEN]; // filename for individual images
} eff;
struct {
bool is_apng; //!< Is this animation an APNG?
float frame_delay; //!< cumulative frame delay
} apng;
} 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; //!< For user bitmaps, Flags passed to bm_create
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;
struct bitmap_entry {
typedef struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; //!< filename for this bitmap
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
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
BM_TYPE type; //!< PCX, USER, ANI, etc
BM_TYPE 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.
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)
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
size_t mem_taken; //!< How much memory does this bitmap use? - UnknownPlayer
int num_mipmaps; //!< number of mipmap levels, we need to read all of them
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;
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 bm; //!< Bitmap info
// Bitmap info
bitmap bm;
bm_extra_info info; //!< Data for animations and user bitmaps
// 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
size_t data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
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;
struct bitmap_slot {
bitmap_entry entry;
extern bitmap_entry bm_bitmaps[MAX_BITMAPS];
gr_bitmap_info* gr_info = nullptr;
};
// image specific lock functions
void bm_lock_ani( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_dds( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_png( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_apng( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_jpg( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_pcx( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_tga( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
void bm_lock_user( int handle, bitmap_slot *bs, bitmap *bmp, int bpp, ubyte flags );
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 );
const size_t BM_BLOCK_SIZE = 4096;
extern SCP_vector<std::array<bitmap_slot, BM_BLOCK_SIZE>> bm_blocks;
bitmap_slot* bm_get_slot(int handle, bool separate_ani_frames = true);
inline bitmap_entry* bm_get_entry(int handle, bool separate_ani_frames = true) {
return &bm_get_slot(handle, separate_ani_frames)->entry;
}
template<typename T>
T* bm_get_gr_info(int handle, bool separate_ani_frames = true) {
return static_cast<T*>(bm_get_slot(handle, separate_ani_frames)->gr_info);
}
#endif // BMPMAN_INTERNAL
#endif // __BM_INTERNAL_H__
+3021 -2822
View File
File diff suppressed because it is too large. Load diff
+630 -648
View File
File diff suppressed because it is too large. Load diff
+278 -398
View File
File diff suppressed because it is too large. Load diff
+34 -40
View File
@@ -1,14 +1,16 @@
#ifndef _CAMERA_H
#define _CAMERA_H
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
#include "object/object.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)
@@ -23,8 +25,8 @@ protected:
int sig;
int flags;
object_h object_host;
int object_host_submodel;
object_h object_self;
int object_self_submodel;
object_h object_target;
int object_target_submodel;
@@ -33,47 +35,48 @@ protected:
void (*func_custom_orientation)(camera *cam, matrix *ori);
avd_movement fov;
avd_movement pos_x;
avd_movement pos_y;
avd_movement pos_z;
avd_movement ori[9];
//Cache stuff
avd_movement ori_p;
avd_movement ori_b;
avd_movement ori_h;
float c_fov;
vec3d c_pos;
matrix c_ori;
public:
camera(const char *in_name=NULL, int in_signature=-1);
camera(char *in_name=NULL, int in_signature=-1);
~camera();
void clear();
void reset();
//Set
void set_name(const char *in_name);
//Set'
void set_name(char *in_name);
void set_object_host(object *objp, int n_object_host_submodel = -1);
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, float in_deceleration_time = 0.0f);
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, float in_translation_deceleration_time = 0.0f, float in_end_velocity = 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, float in_rotation_deceleration_time = 0.0f);
void set_rotation(angles *in_angles, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation_facing(vec3d *in_target, float in_rotation_time = 0.0f, float in_rotation_acceleration_time = 0.0f, float in_rotation_deceleration_time = 0.0f);
void set_rotation(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
const char* get_name() { return name; }
char *get_name() {return name;}
int get_signature() {return sig;}
object *get_object_host();
int get_object_host_submodel();
object *get_object_self();
object *get_object_target();
int get_object_target_submodel();
float get_fov();
void get_info(vec3d *position, matrix *orientation);
@@ -116,18 +119,17 @@ class subtitle
private:
void clone(const subtitle &sub);
SCP_vector<SCP_string> text_lines;
struct { int x; int y; } text_pos;
std::vector<std::string> text_lines;
float text_pos[2];
float display_time;
float fade_time;
color text_color;
int text_fontnum;
//Done with set
char imageanim[MAX_FILENAME_LEN];
int image_id;
struct { int x; int y; int w; int h; } image_pos;
int image_pos[2];
//Time this has been displayed
float time_displayed;
@@ -135,44 +137,36 @@ private:
//When to end it
float time_displayed_end;
bool post_shaded;
public:
subtitle(int in_x_pos, int in_y_pos, const char* in_text = NULL, const char* in_imageanim = NULL,
float in_display_time = 0, float in_fade_time = 0.0f, const color *in_text_color = NULL, int in_text_fontnum = -1,
bool center_x = false, bool center_y = false, int in_width = 0, int in_height = 0, bool post_shaded=false);
subtitle(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); }
subtitle& operator=(const subtitle &sub);
const subtitle &operator=(const subtitle &sub);
void do_frame(float frametime);
bool is_post_shaded( ) { return post_shaded; }
};
//Some global stuff
extern SCP_vector<subtitle> Subtitles;
extern std::vector<subtitle> Subtitles;
extern float VIEWER_ZOOM_DEFAULT;
extern float Sexp_fov;
//Helpful functions
void cam_init();
void cam_close();
void cam_do_frame(float frametime);
camid cam_create(const char *n_name=NULL, vec3d *n_pos=NULL, matrix *n_ori=NULL, object *n_object=NULL, int n_submodel_parent=-1);
camid cam_create(const char *n_name, vec3d *n_pos, vec3d *n_norm, object *n_object=NULL, int n_submodel_parent=-1);
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(const char* name);
camid cam_lookup(char *name);
camid cam_get_camera(uint index);
camid cam_get_current();
size_t cam_get_num();
void get_turret_cam_pos(camera *cam, vec3d *pos);
void get_turret_cam_orient(camera *cam, matrix *ori);
uint cam_get_num();
void subtitles_init();
void subtitles_close();
void subtitles_do_frame(float frametime);
void subtitles_do_frame_post_shaded(float frametime);
#endif // _CAMERA_H
+779 -637
View File
File diff suppressed because it is too large. Load diff
+455 -202
View File
@@ -7,18 +7,431 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $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
*
*
* 11 9/08/99 12:03a Dave
* Make squad logos render properly in D3D all the time. Added intel anim
* directory.
*
* 10 8/31/99 9:46a Dave
* Support for new cfile cbanims directory.
*
* 9 5/19/99 4:07p Dave
* Moved versioning code into a nice isolated common place. Fixed up
* updating code on the pxo screen. Fixed several stub problems.
*
* 8 3/28/99 5:58p Dave
* Added early demo code. Make objects move. Nice and framerate
* independant, but not much else. Don't use yet unless you're me :)
*
* 7 3/24/99 4:05p Dave
* Put in support for assigning the player to a specific squadron with a
* specific logo. Preliminary work for doing pos/orient checksumming in
* multiplayer to reduce bandwidth.
*
* 6 1/12/99 3:15a Dave
* Barracks screen support for selecting squad logos. We need real artwork
* :)
*
* 5 10/29/98 10:41a Dave
* Change the way cfile initializes exe directory.
*
* 4 10/13/98 9:19a Andsager
* Add localization support to cfile. Optional parameter with cfopen that
* looks for localized files.
*
* 3 10/12/98 9:54a Dave
* Fixed a few file organization things.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 84 9/09/98 5:53p Dave
* Put in new tracker packets in API. Change cfile to be able to checksum
* portions of a file.
*
* 83 8/12/98 4:53p Dave
* Put in 32 bit checksumming for PXO missions. No validation on the
* actual tracker yet, though.
*
* 82 5/19/98 1:19p Allender
* new low level reliable socket reading code. Make all missions/campaign
* load/save to data missions folder (i.e. we are rid of the player
* missions folder)
*
* 81 5/13/98 10:22p John
* Added cfile functions to read/write rle compressed blocks of data.
* Made palman use it for .clr files. Made alphacolors calculate on the
* fly rather than caching to/from disk.
*
* 80 5/01/98 10:21a John
* Added code to find all pack files in all trees. Added code to create
* any directories that we write to.
*
* 79 4/30/98 10:29p John
* Added code to refresh filelist if cd-rom changed or packfiles created
* or deleted.
*
* 78 4/30/98 10:06p John
* Started adding code for splitting the maps data tree for hardware
* textures.
*
* 77 4/30/98 9:43p John
* Restructured some stuff.
*
* 76 4/30/98 8:23p John
* Fixed some bugs with Fred caused by my new cfile code.
*
* 75 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 74 4/20/98 6:04p Dave
* Implement multidata cache flushing and xferring mission files to
* multidata. Make sure observers can't change hud config. Fix pilot image
* viewing in popup. Put in game status field. Tweaked multi options.
*
* 73 4/01/98 6:06p Hoffoss
* Added a command briefing directory for those voice files.
*
* 72 3/31/98 4:51p Dave
* Removed medals screen and multiplayer buttons from demo version. Put in
* new pilot popup screen. Make ships in mp team vs. team have proper team
* ids. Make mp respawns a permanent option saved in the player file.
*
* 71 3/26/98 6:01p Dave
* Put in file checksumming routine in cfile. Made pilot pic xferring more
* robust. Cut header size of voice data packets in half. Put in
* restricted game host query system.
*
* 70 3/10/98 2:27p Hoffoss
* Added change directory with history stack functions, so you can switch
* to a new directory, do something, and restore to what it was. useful
* for Fred.
*
* 69 3/07/98 3:48p Lawrance
* get save game working, allow restore from main menu
*
* 68 2/26/98 10:07p Hoffoss
* Rewrote state saving and restoring to fix bugs and simplify the code.
*
* 67 2/20/98 4:43p Dave
* Finished support for multiplayer player data files. Split off
* multiplayer campaign functionality.
*
* 66 2/19/98 6:26p Dave
* Fixed a few file xfer bugs. Tweaked mp team select screen. Put in
* initial support for player data uploading.
*
* 65 2/06/98 3:47p Allender
* subtitling for movies
*
* 64 2/05/98 10:15p Lawrance
* Add support for .svg filenames.
*
* 63 1/12/98 10:07p Hoffoss
* Made tab cycle properly in debriefing screen and put in aux. pilot
* image directory.
*
* 62 1/11/98 2:45p John
* Changed .lst to .clt
*
* 61 1/11/98 2:14p John
* Changed a lot of stuff that had to do with bitmap loading. Made cfile
* not do callbacks, I put that in global code. Made only bitmaps that
* need to load for a level load.
*
* 60 1/02/98 4:41p Allender
* added new mission folder for "player" missions
*
* 59 12/28/97 12:42p John
* Put in support for reading archive files; Made missionload use the
* cf_get_file_list function. Moved demos directory out of data tree.
*
* 58 12/17/97 10:16p Allender
* implemented a "no callback" flag to tell the cfile code not to use the
* cf_callback on files which specify this flag
*
* 57 12/08/97 6:23p Lawrance
* add cflush()
*
* 56 12/07/97 4:30p John
* Fixed bug with cfile versioning if two files use it at once. Added
* code to cfile so I could display a loading box while loading.
*
* 55 11/24/97 9:28a Hoffoss
* Moved define of CF_TYPE_MULTI_PLAYERS so it's in order. I started to
* add it because I couldn't find it, so that's indication enough it
* needed it.
*
* 54 11/20/97 1:07a Lawrance
* add support for voice/debriefings directory
*
* 53 11/19/97 7:27p Hoffoss
* Added version checking read functions.
*
* 52 11/18/97 10:53a Hoffoss
*
* 51 11/17/97 6:07p Hoffoss
* Make get_file_list() allow filtering via a callback function.
*
* 50 11/16/97 2:29p John
* added versioning to nebulas; put nebula code into freespace.
*
* 49 11/15/97 6:10p Lawrance
* add in support for new voice directories
*
* 48 11/11/97 4:54p Dave
* Put in support for single vs. multiplayer pilots. Put in initial player
* selection screen (no command line option yet). Started work on
* multiplayer campaign file save gaming.
*
* 47 11/07/97 4:00p Hoffoss
* Capitalized directory names, changed the player/image directory to work
* like the rest, and forced the player/images directory to be created.
*
* 46 11/06/97 5:38p Hoffoss
* Added a new player image directory and added support for it.
*
* 45 11/04/97 7:46p Lawrance
* Add support for data\interface\HUD directory
*
* 44 10/29/97 6:22p Hoffoss
* Added some new file listing functions.
*
* 43 10/28/97 10:54a Lawrance
* support for 8b22k and 16b11k directories under the sound directory
*
* 42 10/14/97 11:34p Lawrance
* add function to get full path for a given filename
*
* 41 9/24/97 5:30p Lawrance
* add directory for voices
*
* 40 9/20/97 8:16a John
* Made .clr files go into the Cache directory. Replaced cfopen(name,NULL)
* to delete a file with cf_delete.
*
* 39 9/09/97 6:50p Hoffoss
* Fixed bug with mission saving.
*
* 38 9/05/97 4:52p Lawrance
* fix prototype for cfread_angles() and cfwrite_angles()
*
* 37 8/29/97 4:47p Dave
* Added an extension for state transfer status files.
*
* 36 8/21/97 12:14p Dave
* Changed demo file extension from .keg to .fsd
*
* 35 8/19/97 5:51p Hoffoss
* Fixes to cfopen to not check the default directory first, but check it
* last. Also tracks info as to where a file is located when opened.
*
* 34 8/17/97 10:22p Hoffoss
* Fixed several bugs in Fred with Undo feature. In the process, recoded
* a lot of CFile.cpp.
*
* 33 8/17/97 12:47p Hoffoss
* Changed code so I can force missions to load from the missions
* directory regardless of it's extension.
*
* 32 8/13/97 1:39p Adam
* make .ani files available in the data/effects directory
*
* 31 8/13/97 12:24p Lawrance
* Add support for effects directory
*
* 30 7/30/97 5:23p Dave
* Added file extensions for demo stuff
*
* 29 7/28/97 10:42p Lawrance
* added ctmpfile(), analog to tmpfile()
*
* 28 7/16/97 5:29p John
* added palette table caching and made scaler and liner no light tmapper
* do alpha blending in 8 bpp mode.
*
* 27 6/05/97 4:53p John
* First rev of new antialiased font stuff.
*
* 26 6/05/97 1:22p Allender
* added .ntl as an extension for nettest program
*
* 25 4/25/97 11:31a Allender
* Campaign state now saved in campaign save file in player directory.
* Made some global variables follow naming convention. Solidified
* continuing campaigns based on new structure
*
* 24 4/17/97 9:01p Allender
* start of campaign stuff. Campaigns now stored in external file (no
* filenames in code). Continuing campaign won't work at this point
*
* 23 4/03/97 4:26p Lawrance
* adding .wav search to music directory
*
* 22 4/01/97 9:26a Allender
* added support for descent style fonts although they are not used in the
* game yet
*
* 21 3/04/97 8:17a John
* Fixed movie code to not require a file handle. Used CFILE instead.
* Took cfile_get_handle or whatever out.
*
* 20 3/03/97 8:57a Lawrance
* took out cf_returnfp()
*
* 19 3/01/97 2:09p Lawrance
* supporting memory mapped files, moved cfile implementation details into
* .cpp file
*
* 18 2/17/97 3:00p Lawrance
* added .ani type to MAPS_EXT and INTERFACE_EXT
*
* 17 2/07/97 9:00a Lawrance
* added cfread_uint() and cwrite_uint()
*
* 16 2/04/97 9:29a Allender
* added cfwrite* functions
*
* 15 1/22/97 10:48a Lawrance
* supporting AVI playback
*
* 14 12/23/96 10:56a John
* Totally restructured the POF stuff to support multiple
* detail levels in one POF file.
*
*
* 13 11/20/96 10:00a Hoffoss
* Added cfile_chdir() function.
*
* 12 11/13/96 10:14a Allender
* added small routines to read basic data types. Also changed code to
* try to find extensions in more than 1 directory.
*
* 11 11/11/96 3:21p Allender
* added extension for movies
*
* $NoKeywords: $
*/
#ifndef __CFILE_H__
#define __CFILE_H__
#include <ctime>
#include <time.h>
#include "globalincs/pstypes.h"
#include <stdexcept>
#define CF_EOF (-1)
#define CF_SEEK_SET (0)
@@ -78,12 +491,9 @@ typedef struct {
#define CF_TYPE_INTEL_ANIMS 34
#define CF_TYPE_SCRIPTS 35
#define CF_TYPE_FICTION 36
#define CF_TYPE_FREDDOCS 37
#define CF_TYPE_INTERFACE_MARKUP 38
#define CF_TYPE_INTERFACE_CSS 39
#define CF_MAX_PATH_TYPES \
40 // 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 37 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
@@ -97,84 +507,23 @@ typedef struct {
#define CF_SORT_TIME 2
#define CF_SORT_REVERSE 3
/**
* @brief Contains a collection of flags for specifying from where a CFILE should be opened
*
* There are two types of flags. CF_LOCATION_GAME_ROOT and CF_LOCATION_USER_ROOT specify in which basic root directory
* CFile should search for files.
*
* The remaining flags control what type of location may be used for the operation. It's possible to restrict the
* location to the primary mod, the remaining mods or the top-level root directory.
*/
enum CFileLocationFlags {
CF_LOCATION_ROOT_GAME = 1 << 0, //!< The game root location. This is the location of the game data (e.g. FS2 retail)
/**
* @brief The user directories.
*
* If the engine is in portable mode then using this flag exclusively will result in a failure to open files!
*/
CF_LOCATION_ROOT_USER = 1 << 1,
/**
* @brief The memory root
*
* This contains all the built-in files available to the engine.
*/
CF_LOCATION_ROOT_MEMORY = 1 << 2,
/**
* @brief Mask for extracting root type from a location bit field
*/
CF_LOCATION_ROOT_MASK = 0xFFFF,
CF_LOCATION_TYPE_ROOT = 1 << 16, //!< The basic, top-level root location
/**
* @brief The primary mod location.
*
* This is the mod that appears first on the command line. If there are no mods then the root location is considered
* to be the primary mod
*/
CF_LOCATION_TYPE_PRIMARY_MOD = 1 << 17,
/**
* @brief The remaining mods.
*
* If there are no mods on the command line then this might not include any valid location.
*/
CF_LOCATION_TYPE_SECONDARY_MODS = 1 << 18,
/**
* @brief Bitmask for extracting the type from a location bit field
*/
CF_LOCATION_TYPE_MASK = 0xFFFF0000,
/**
* @brief A combination of all flags
*
* This should be used when the default behavior without any location filtering is desired.
*/
CF_LOCATION_ALL = CF_LOCATION_ROOT_MASK | CF_LOCATION_TYPE_MASK
};
#define cfread_fix(file) (fix)cfread_int(file)
#define cfwrite_fix(i,file) cfwrite_int(i,file)
// callback function used for get_file_list() to filter files to be added to list. Return 1
// to add file to list, or 0 to not add it.
extern int (*Get_file_list_filter)(const char *filename);
// extra check for child directory under CF_TYPE_*
// NOTE: if specified cf_get_file_list() will not search pack files!
// NOTE: specified string must not contain ':' or spaces or begin with DIR_SEPARATOR!
extern const char *Get_file_list_child;
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 ==================
int cfile_init(const char *exe_dir, const char *cdrom_dir=NULL);
void cfile_close();
// Call this once at the beginning of the program
int cfile_init(char *exe_dir,char *cdrom_dir=NULL);
// Call this if pack files got added or removed or the
// cdrom changed. This will refresh the list of filenames
@@ -182,22 +531,18 @@ void cfile_close();
void cfile_refresh();
// add an extension to a filename if it doesn't already have it
char *cf_add_ext(const char *filename, const char *ext);
char *cf_add_ext(char *filename, char *ext);
// return CF_TYPE (directory location type) of a CFILE you called cfopen() successfully on.
int cf_get_dir_type(CFILE *cfile);
// Opens the file. If no path is given, use the extension to look into the
// default path. If mode is NULL, delete the file.
CFILE* _cfopen(const char* source_file, int line, const char* filename, const char* mode, int type = CFILE_NORMAL,
int dir_type = CF_TYPE_ANY, bool localize = false, uint32_t location_flags = CF_LOCATION_ALL);
#define cfopen(...) _cfopen(LOCATION, __VA_ARGS__) // Pass source location to the function
// 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(const char* source_file, int line, const char *file_path, const char *mode,
const size_t size, const size_t offset, const void* data, int dir_type = CF_TYPE_ANY);
#define cfopen_special(...) _cfopen_special(LOCATION, __VA_ARGS__) // Pass source location to the function
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);
@@ -206,27 +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 );
// will throw an error if cfread*() functions read past this mark
// converted to raw offsets when used, but gets passed actual length from current position
// setting 'len' to zero will disable the check
void cf_set_max_read_len(CFILE *cfile, size_t len);
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete(const char *filename, int dir_type, uint32_t location_flags = CF_LOCATION_ALL);
int cf_delete(char *filename, int dir_type);
// Same as _access function to read a file's access bits
int cf_access(const char *filename, int dir_type, int mode);
int cf_access(char *filename, int dir_type, int mode);
// Returns 1 if the file exists, 0 if not.
// Checks only the file system.
int cf_exists(const char *filename, int dir_type);
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(const char *filename, int dir_type);
int cf_exists_full(char *filename, int dir_type);
// check num_ext worth of ext_list extensions
int cf_exists_full_ext(const char *filename, int dir_type, const int num_ext, const char **ext_list);
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();
@@ -234,9 +574,6 @@ CFILE *ctmpfile();
// Closes the file
int cfclose(CFILE *cfile);
//Checks if the given handle is valid
int cf_is_valid(CFILE *cfile);
// Returns size of file...
int cfilelength(CFILE *fp);
@@ -244,7 +581,7 @@ int cfilelength(CFILE *fp);
int cfread(void *buf, int elsize, int nelem, CFILE *fp);
// cfwrite() writes to the file
int cfwrite(const void *buf, int elsize, int nelem, CFILE *cfile);
int cfwrite(void *buf, int elsize, int nelem, CFILE *cfile);
// Reads/writes RLE compressed data.
int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile);
@@ -260,7 +597,7 @@ int cftell(CFILE *fp);
int cfputc(int c, CFILE *cfile);
// cfputs() writes a string to a file
int cfputs(const char *str, CFILE *cfile);
int cfputs(char *str, CFILE *cfile);
// cfgetc() reads a character to a file
int cfgetc(CFILE *cfile);
@@ -272,23 +609,23 @@ char *cfgets(char *buf, int n, CFILE *cfile);
int cfeof(CFILE *cfile);
// Return the data pointer associated with the CFILE structure (for memory mapped files)
const void *cf_returndata(CFILE *cfile);
void *cf_returndata(CFILE *cfile);
// get the 2 byte checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_short(const char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
int cf_chksum_short(char *filename, ushort *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 2 byte checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_short(CFILE *file, ushort *chksum, int max_size = -1);
// get the 32 bit CRC checksum of the passed filename - return 0 if operation failed, 1 if succeeded
int cf_chksum_long(const char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
int cf_chksum_long(char *filename, uint *chksum, int max_size = -1, int cf_type = CF_TYPE_ANY );
// get the 32 bit CRC checksum of the passed file - return 0 if operation failed, 1 if succeeded
// NOTE : preserves current file position
int cf_chksum_long(CFILE *file, uint *chksum, int max_size = -1);
int cf_chksum_pack(const char *filename, uint *chk_long, bool full = false);
int cf_chksum_pack(char *filename, uint *chk_long, bool full = false);
// convenient for misc checksumming purposes ------------------------------------------
@@ -296,21 +633,21 @@ int cf_chksum_pack(const char *filename, uint *chk_long, bool full = false);
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
uint cf_add_chksum_long(uint seed, ubyte *buffer, size_t size);
uint cf_add_chksum_long(uint seed, ubyte *buffer, int size);
// convenient for misc checksumming purposes ------------------------------------------
//================= HIGH LEVEL FUNCTIONS ==================
int cfexist(const char *filename); // Returns true if file exists on disk (1) or in hog (2).
int cfexist(char *filename); // Returns true if file exists on disk (1) or in hog (2).
// rename a file, utilizing the extension to determine where file is.
#define CF_RENAME_SUCCESS 0 // successfully renamed the file
#define CF_RENAME_FAIL_ACCESS 1 // new name could not be created
#define CF_RENAME_FAIL_EXIST 2 // old name does not exist
int cf_rename(const char *old_name, const char *name, int type = CF_TYPE_ANY );
int cf_rename(char *old_name, char *name, int type = CF_TYPE_ANY );
// changes the attributes of a file
void cf_attrib(const char *name, int set, int clear, int type);
void cf_attrib(char *name, int set, int clear, int type);
// flush (delete all files in) the passed directory (by type), return the # of files deleted
// NOTE : WILL NOT DELETE READ-ONLY FILES
@@ -334,24 +671,10 @@ void cfread_angles(angles *ang, CFILE *file, int ver = 0, angles *deflt = NULL);
// Reads variable length, null-termined string. Will only read up
// to n characters.
void cfread_string(char *buf,int n, CFILE *file);
/**
* @brief Read a fixed length string that is not null-terminated, with the length stored in file
*
* @param buf Pre-allocated array to store string
* @param n Size of pre-allocated array
* @param file File to read from
*
* @note Appends NULL character to string (buf)
*/
// Read a fixed length that is null-terminatedm, and has the length
// stored in file
void cfread_string_len(char *buf,int n, CFILE *file);
/**
* @brief Read a string from the file where the length is stored in the file
* @param file The file to read the string from
* @return The string that was read
*/
SCP_string cfread_string_len(CFILE *file);
// functions for writing cfiles
int cfwrite_char(char c, CFILE *file);
int cfwrite_float(float f, CFILE *file);
@@ -364,35 +687,15 @@ int cfwrite_vector(vec3d *vec, CFILE *file);
int cfwrite_angles(angles *ang, CFILE *file);
// writes variable length, null-termined string.
int cfwrite_string(const char *buf, CFILE *file);
int cfwrite_string(char *buf, CFILE *file);
/**
* @brief Write a fixed length string (not including its null terminator), with the length stored in file
*
* @param buf String to write to file
* @param file File to write to
*/
int cfwrite_string_len(const char *buf, CFILE *file);
// write a fixed length that is null-terminatedm, and has the length
// stored in file
int cfwrite_string_len(char *buf, CFILE *file);
int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, const char* filter, int sort = CF_SORT_NONE,
SCP_vector<file_list_info>* info = nullptr, uint32_t location_flags = CF_LOCATION_ALL);
int cf_get_file_list(int max, char** list, int type, const char* filter, int sort = CF_SORT_NONE,
file_list_info* info = nullptr, uint32_t location_flags = CF_LOCATION_ALL);
int cf_get_file_list_preallocated(int max, char arr[][MAX_FILENAME_LEN], char** list, int type, const char* filter,
int sort = CF_SORT_NONE, file_list_info* info = nullptr,
uint32_t location_flags = CF_LOCATION_ALL);
int cf_get_file_list( int max, char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char **list, int type, char *filter, int sort = CF_SORT_NONE, file_list_info *info = NULL );
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info = NULL );
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info = NULL );
struct CFileLocation {
bool found = false;
SCP_string full_name;
size_t size = 0;
size_t offset = 0;
const void* data_ptr = nullptr;
explicit CFileLocation(bool found_in = false) : found(found_in) {}
};
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files.
@@ -403,17 +706,7 @@ struct CFileLocation {
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns 0.
CFileLocation cf_find_file_location(const char* filespec, int pathtype, bool localize = false,
uint32_t location_flags = CF_LOCATION_ALL);
struct CFileLocationExt : public CFileLocation {
int extension_index = -1;
explicit CFileLocationExt(int extension_index_in = -1)
: CFileLocation(extension_index_in >= 0), extension_index(extension_index_in)
{
}
};
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.
@@ -427,11 +720,10 @@ struct CFileLocationExt : public CFileLocation {
// 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!!)
CFileLocationExt cf_find_file_location_ext(const char* filename, const int ext_num, const char** ext_list, int pathtype,
bool localize = false);
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(const char *dir);
int cfile_chdir(char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
@@ -443,44 +735,5 @@ int cfile_push_chdir(int type);
// restore directory on top of the stack
int cfile_pop_dir();
int cfile_get_path_type(const SCP_string& dir);
namespace cfile
{
// exceptions and other errors
class cfile_error : public std::exception
{
public:
cfile_error() : m_excuse("CFILE Exception")
{
}
explicit cfile_error(const std::string &excuse) : m_excuse(excuse)
{
}
~cfile_error() SCP_NOEXCEPT override {}
const char *what() const SCP_NOEXCEPT override {
return m_excuse.c_str();
}
private:
std::string m_excuse;
};
class max_read_length : public cfile_error
{
public:
explicit max_read_length(const std::string &excuse) : cfile_error(excuse)
{
}
max_read_length() : cfile_error("Attempted to read beyond length limit")
{
}
};
}
#endif /* __CFILE_H__ */
+158 -106
View File
@@ -7,13 +7,104 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
* $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
*
*
* 4 2/22/99 10:31p Andsager
* Get rid of unneeded includes.
*
* 3 1/06/99 2:24p Dave
* Stubs and release build fixes.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 12 5/14/98 8:10p Lawrance
* Fix bug with trying to read past the end of a file (when from a
* packfile).
*
* 11 5/11/98 11:48a John
* fixed bug with memory mapped files
*
* 10 5/11/98 10:59a John
* added in debug code
*
* 9 5/11/98 10:59a John
* Moved the low-level file reading code into cfilearchive.cpp.
*
* 8 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 7 4/20/98 11:49a Hoffoss
* Fixed bug with directory name getting.
*
* 6 4/10/98 12:18a Hoffoss
* Make pilot image search in pack file possible.
*
* 5 1/19/98 9:37p Allender
* Great Compiler Warning Purge of Jan, 1998. Used pragma's in a couple
* of places since I was unsure of what to do with code.
*
* 4 12/30/97 5:31p Lawrance
* fixed problem for people that didn't have a VP file
*
* 3 12/30/97 4:31p Sandeep
* Changed pakfile format
*
* 2 12/28/97 12:42p John
* Put in support for reading archive files; Made missionload use the
* cf_get_file_list function. Moved demos directory out of data tree.
*
* 1 12/28/97 11:48a John
*
* $NoKeywords: $
*/
#define _CFILE_INTERNAL
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
@@ -26,15 +117,13 @@
#include "cfile/cfilearchive.h"
#include "luaconf.h"
#include <sstream>
#include <limits>
#define CHECK_POSITION
// Called once to setup the low-level reading code.
void cf_init_lowlevel_read_code( CFILE * cfile, size_t lib_offset, size_t size, size_t pos )
void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
{
Assert(cfile != NULL);
@@ -42,18 +131,19 @@ void cf_init_lowlevel_read_code( CFILE * cfile, size_t lib_offset, size_t size,
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
cb->lib_offset = lib_offset;
cb->raw_position = pos;
cb->lib_offset = offset;
cb->raw_position = 0;
cb->size = size;
if ( cb->fp ) {
if ( cb->lib_offset ) {
fseek( cb->fp, (long)cb->lib_offset, SEEK_SET );
fseek( cb->fp, cb->lib_offset, SEEK_SET );
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
auto 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
}
}
@@ -74,13 +164,19 @@ int cfeof(CFILE *cfile)
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
int result = 0;
int result;
result = 0;
// cfeof() not supported for memory-mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cb->fp) {
auto 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
if (cb->raw_position >= cb->size ) {
@@ -104,17 +200,18 @@ int cftell( CFILE * cfile )
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
cb = &Cfile_block_list[cfile->id];
// Doesn't work for memory mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cb->fp) {
auto 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
// The rest of the code still uses ints, do an overflow check to detect cases where this fails
Assertion(cb->raw_position <= static_cast<size_t>(std::numeric_limits<int>::max()),
"Integer overflow in cftell, a file is probably too large (but I don't know which one).");
return (int) cb->raw_position;
return cb->raw_position;
}
@@ -133,9 +230,10 @@ int cfseek( CFILE *cfile, int offset, int where )
// TODO: seek to offset in memory mapped file
Assert( !cb->mem_mapped );
Assert( !cb->data );
Assert( cb->fp != NULL );
size_t goal_position;
int goal_position;
switch( where ) {
case CF_SEEK_SET:
@@ -152,27 +250,15 @@ int cfseek( CFILE *cfile, int offset, int where )
default:
Int3();
return 1;
}
}
// Make sure we don't seek beyond the end of the file
CAP(goal_position, cb->lib_offset, cb->lib_offset + cb->size);
int result = 0;
if (cb->fp) {
// If we have a file pointer we can also seek in that file
result = fseek(cb->fp, (long)goal_position, SEEK_SET );
Assertion(goal_position >= cb->lib_offset, "Invalid offset values detected while seeking! Goal was " SIZE_T_ARG ", lib_offset is " SIZE_T_ARG ".", goal_position, cb->lib_offset);
}
// If we only have a data pointer this will do all the work
int result = fseek(cb->fp, goal_position, SEEK_SET );
cb->raw_position = goal_position - cb->lib_offset;
Assertion(cb->raw_position <= cb->size, "Invalid raw_position value detected!");
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cb->fp) {
auto tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset == cb->raw_position);
}
int tmp_offset;
tmp_offset = (int)ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
return result;
@@ -186,18 +272,24 @@ int cfseek( CFILE *cfile, int offset, int where )
//
int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return 0;
Assert(cfile != NULL);
Assert(buf != NULL);
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
size_t size = elsize*nelem;
Cfile_block *cb;
cb = &Cfile_block_list[cfile->id];
if(buf == NULL || size <= 0)
return 0;
// cfread() not supported for memory-mapped files
Assert( !cb->data );
Assert(cb->fp != NULL);
Cfile_block *cb = &Cfile_block_list[cfile->id];
int size = elsize*nelem;
Assert(nelem > 0);
Assert(elsize > 0);
Assert(size > 0);
if ( (cb->raw_position+size) > cb->size ) {
Assertion(cb->raw_position <= cb->size, "Invalid raw_position value detected!");
size = cb->size - cb->raw_position;
if ( size < 1 ) {
return 0;
@@ -205,84 +297,44 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
//mprintf(( "CFILE: EOF encountered in file\n" ));
}
if (cb->max_read_len) {
if ( cb->raw_position+size > cb->max_read_len ) {
std::ostringstream s_buf;
s_buf << "Attempted to read " << size << "-byte(s) beyond length limit";
throw cfile::max_read_length(s_buf.str());
}
}
size_t bytes_read;
if (cb->data != nullptr) {
// This is a file from memory
bytes_read = size;
memcpy(buf, reinterpret_cast<const char*>(cb->data) + cb->raw_position, size);
} else {
bytes_read = fread( buf, 1, size, cb->fp );
}
int bytes_read = fread( buf, 1, size, cb->fp );
if ( bytes_read > 0 ) {
cb->raw_position += bytes_read;
Assertion(cb->raw_position <= cb->size, "Invalid raw_position value detected!");
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cb->fp) {
auto 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
return (int)(bytes_read / elsize);
return bytes_read / elsize;
}
int cfread_lua_number(double *buf, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return 0;
Assert(cfile != NULL);
Assert(buf != NULL);
Assert(cfile->id >= 0 && cfile->id < MAX_CFILE_BLOCKS);
if(buf == NULL)
return 0;
Cfile_block *cb = &Cfile_block_list[cfile->id];
Cfile_block *cb;
cb = &Cfile_block_list[cfile->id];
// cfread() not supported for memory-mapped files
if(cb->data != NULL)
{
Warning(LOCATION, "Writing is not supported for mem-mapped files");
return 0;
}
Assert( !cb->data );
Assert(cb->fp != NULL);
size_t advance = 0;
int items_read;
if (cb->fp) {
long orig_pos = ftell(cb->fp);
items_read = fscanf(cb->fp, LUA_NUMBER_SCAN, buf);
advance = (size_t) (ftell(cb->fp)-orig_pos);
} else {
int read;
// %n returns the number of bytes currently read so we append that to the scan format at the end so it will return
// how many bytes we have consumed
items_read = sscanf(reinterpret_cast<const char*>(cb->data), LUA_NUMBER_SCAN "%n", buf, &read);
if (items_read == 2) {
// We need to correct the items read counter since we read one additional item
items_read = 1;
}
advance = (size_t) read;
}
cb->raw_position += advance;
Assertion(cb->raw_position <= cb->size, "Invalid raw_position value detected!");
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)
if (cb->fp) {
auto 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
return items_read;
}
}
+52 -11
View File
@@ -7,7 +7,52 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
* $Revision: 2.3 $
* $Date: 2005-07-13 02:50:49 $
* $Author: Goober5000 $
*
* External def's for CfileArchive.cpp. This should only be used
* internally by cfile stuff.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/17 02:56:19 mharris
* first crack at unix compatibity
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 4 5/11/98 10:59a John
* Moved the low-level file reading code into cfilearchive.cpp.
*
* 3 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 2 12/28/97 12:42p John
* Put in support for reading archive files; Made missionload use the
* cf_get_file_list function. Moved demos directory out of data tree.
*
* 1 12/28/97 11:48a John
*
* $NoKeywords: $
*/
#ifndef _CFILEARCHIVE_H
#define _CFILEARCHIVE_H
@@ -26,8 +71,7 @@ typedef struct Cfile_block {
int type; // CFILE_BLOCK_UNUSED, CFILE_BLOCK_USED
int dir_type; // directory location
FILE *fp; // File pointer if opening an individual file
const void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
bool mem_mapped; // Flag for memory mapped files (if data is not null and this is false it means that it's an embedded 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()
@@ -35,20 +79,17 @@ typedef struct Cfile_block {
// int fd; // file descriptor
size_t data_length; // length of data for mmap
#endif
size_t lib_offset;
size_t raw_position;
size_t size; // for packed files
size_t max_read_len; // max read offset, for special error handling
int lib_offset;
int raw_position;
int size; // for packed files
const char* source_file;
int line_num;
} Cfile_block;
#define MAX_CFILE_BLOCKS 64
extern Cfile_block Cfile_block_list[MAX_CFILE_BLOCKS];
extern CFILE Cfile_list[MAX_CFILE_BLOCKS];
// Called once to setup the low-level reading code.
void cf_init_lowlevel_read_code( CFILE * cfile, size_t lib_offset, size_t size, size_t pos );
void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size );
#endif
+76 -86
View File
@@ -7,13 +7,80 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
* $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
*
*
* 3 2/22/99 10:31p Andsager
* Get rid of unneeded includes.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 6 5/13/98 10:22p John
* Added cfile functions to read/write rle compressed blocks of data.
* Made palman use it for .clr files. Made alphacolors calculate on the
* fly rather than caching to/from disk.
*
* 5 5/06/98 5:30p John
* Removed unused cfilearchiver. Removed/replaced some unused/little used
* graphics functions, namely gradient_h and _v and pixel_sp. Put in new
* DirectX header files and libs that fixed the Direct3D alpha blending
* problems.
*
* 4 4/30/98 4:53p John
* Restructured and cleaned up cfile code. Added capability to read off
* of CD-ROM drive and out of multiple pack files.
*
* 3 4/10/98 12:18a Hoffoss
* Make pilot image search in pack file possible.
*
* 2 3/30/98 10:36p Allender
* be sure to call _findclose() when done reading a file list
*
* 1 12/28/97 11:48a John
*
* $NoKeywords: $
*/
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <algorithm>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
@@ -22,88 +89,11 @@
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
void cf_sort_filenames( SCP_vector<SCP_string> &list, int sort, SCP_vector<file_list_info> *info )
{
// NOTE: This really needs to be updated to C++ style sorting at some point
int i, j, incr;
SCP_string t;
file_list_info tt;
int n = (int)list.size();
if (sort == CF_SORT_NAME) {
incr = n / 2;
while (incr > 0) {
for (i=incr; i<n; i++) {
j = i - incr;
while (j >= 0) {
if (stricmp(list[j].c_str(), list[j + incr].c_str()) > 0) {
t = list[j];
list[j] = list[j + incr];
list[j + incr] = t;
if (info) {
tt = (*info)[j];
(*info)[j] = (*info)[j + incr];
(*info)[j + incr] = tt;
}
j -= incr;
} else
break;
}
}
incr /= 2;
}
return;
} else if (sort == CF_SORT_TIME) {
Assert(info);
incr = n / 2;
while (incr > 0) {
for (i=incr; i<n; i++) {
j = i - incr;
while (j >= 0) {
if ( (*info)[j].write_time < (*info)[j + incr].write_time ) {
t = list[j];
list[j] = list[j + incr];
list[j + incr] = t;
tt = (*info)[j];
(*info)[j] = (*info)[j + incr];
(*info)[j + incr] = tt;
j -= incr;
} else
break;
}
}
incr /= 2;
}
return;
} else if (sort == CF_SORT_REVERSE) {
std::reverse( list.begin(), list.end() );
if (info) {
std::reverse( info->begin(), info->end() );
}
return;
}
nprintf(("Error", "Unknown sorting method %d passed to cf_sort_filenames()\n", sort));
}
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
// n = number of filenames in list to sort
@@ -183,7 +173,7 @@ void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
t = list[n - 1 - i];
if (list[i] != t) {
strcpy_s(buffer, list[i]);
strcpy(buffer, list[i]);
strcpy(list[i], t);
strcpy(t, buffer);
@@ -420,7 +410,7 @@ int cfread_compressed(void *buf, int elsize, int nelem, CFILE *cfile)
}
}
return (int)((out - (char *)buf)/elsize);
return (out - (char *)buf)/elsize;
}
int cfwrite_compressed(void *param_buf, int param_elsize, int param_nelem, CFILE *cfile)
+697 -1020
View File
File diff suppressed because it is too large. Load diff
+59 -12
View File
@@ -7,7 +7,58 @@
*
*/
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
* $Revision: 2.5 $
* $Date: 2006-04-20 06:32:00 $
* $Author: Goober5000 $
*
* Functions to keep track of and find files that can exist
* on the harddrive, cd-rom, or in a pack file on either of those.
* This keeps a list of all the files in packfiles or on CD-rom
* and when you need a file you call one function which then searches
* all those locations, inherently enforcing precedence orders.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2005/10/16 23:15:46 wmcoolmon
* Hardened cfile against array overflows
*
* Revision 2.3 2005/07/13 02:50:49 Goober5000
* remove PreProcDefine #includes in FS2
* --Goober5000
*
* Revision 2.2 2004/08/11 05:06:19 Kazan
* added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this
*
* Revision 2.1 2004/03/05 09:01:54 Goober5000
* Uber pass at reducing #includes
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
*
* 3 10/13/98 9:19a Andsager
* Add localization support to cfile. Optional parameter with cfopen that
* looks for localized files.
*
* 2 10/07/98 10:52a Dave
* Initial checkin.
*
* 1 10/07/98 10:48a Dave
*
* 5 5/01/98 10:21a John
* Added code to find all pack files in all trees. Added code to create
* any directories that we write to.
*
* 4 4/30/98 10:21p John
* Added code to cleanup cfilesystem
*
* $NoKeywords: $
*/
#ifndef _CFILESYSTEM_H
#define _CFILESYSTEM_H
@@ -15,22 +66,20 @@
#include "cfile/cfile.h"
// Builds a list of all the files
void cf_build_secondary_filelist( const char *cdrom_path );
void cf_build_secondary_filelist( char *cdrom_path );
void cf_free_secondary_filelist();
// Internal stuff
typedef struct cf_pathtype {
int index; // To verify that the CF_TYPE define is correctly indexed into this array
const char* path; // Path relative to FreeSpace root, has ending backslash.
const 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.
int index; // To verify that the CF_TYPE define is correctly indexed into this array
char *path; // Path relative to FreeSpace root, has ending backslash.
char *extensions; // Extensions used in this pathtype, separated by spaces
int parent_index; // Index of this directory's parent. Used for creating directories when writing.
} cf_pathtype;
// During cfile_init, verify that Pathtypes[n].index == n for each item
extern cf_pathtype Pathtypes[CF_MAX_PATH_TYPES];
bool cf_check_location_flags(uint32_t check_flags, uint32_t desired_flags);
// Returns the default storage path for files given a
// particular pathtype. In other words, the path to
// the unpacked, non-cd'd, stored on hard drive path.
@@ -41,9 +90,7 @@ bool cf_check_location_flags(uint32_t check_flags, uint32_t desired_flags);
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//Returns 0 if result would be too long (invalid result)
int cf_create_default_path_string(char* path, uint path_max, int pathtype, const char* filename = nullptr,
bool localize = false, uint32_t location_flags = CF_LOCATION_ALL);
int cf_create_default_path_string(SCP_string& path, int pathtype, const char* filename = nullptr, bool localize = false,
uint32_t location_flags = CF_LOCATION_ALL);
int cf_create_default_path_string( char *path, uint path_max, int pathtype, char *filename=NULL, bool localize = false);
#endif //_CFILESYSTEM_H
-19
View File
@@ -1,19 +0,0 @@
add_executable(cfilearchiver EXCLUDE_FROM_ALL cfilearchiver.cpp)
ADD_DEFINITIONS(-DNO_SAFE_STRINGS)
include_directories(${CODE_HEADERS})
set_target_properties(cfilearchiver
PROPERTIES
FOLDER "FSOTools"
)
TARGET_LINK_LIBRARIES(cfilearchiver PUBLIC sdl2)
TARGET_INCLUDE_DIRECTORIES(cfilearchiver PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(cfilearchiver PUBLIC ${GENERATED_SOURCE_DIR}/code)
IF(MSVC)
set_target_properties(cfilearchiver PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG;PDB_DEBUGGING=1"
)
ENDIF(MSVC)
+79 -35
View File
@@ -7,7 +7,40 @@
*
*/
/*
* $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>
@@ -94,13 +127,7 @@ int write_index(char *hf, char *df)
d = fopen(df, "a+b");
if ( (h == NULL) || (d == NULL) )
{
if ( h )
fclose( h );
if ( d )
fclose( d );
return 0;
}
for (i = 0; i < Num_files; i++) {
fread(tmp_data, 32+4+4+4, 1, h);
@@ -135,12 +162,12 @@ void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_wr
}
if ( strlen(filename) > 31 ) {
printf( "Filename '%s' too long! Skipping...\n", filename );
return;
printf( "Filename '%s' too long\n", filename );
exit(1);
}
memset( path, 0, sizeof(path) );
strcpy_s( path, filename );
strcpy( path, filename );
fswrite_int( (int*)&Total_size, fp_out_hdr );
fswrite_int( &filesize, fp_out_hdr );
@@ -186,7 +213,7 @@ void add_directory( char * dirname)
char *tmpptr;
int i = 0;
strcpy_s(path, dirname);
strcpy(path, dirname);
fswrite_int( (int*)&Total_size, fp_out_hdr);
fswrite_int( &i, fp_out_hdr);
@@ -217,7 +244,7 @@ void pack_directory( char * filespec)
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
strcpy_s( tmp1, filespec );
strcpy( tmp1, filespec );
add_directory(filespec);
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
@@ -228,8 +255,8 @@ void pack_directory( char * filespec)
find_handle = _findfirst( tmp1, &find );
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy_s( tmp, filespec );
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
@@ -240,8 +267,8 @@ void pack_directory( char * filespec)
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy_s( tmp, filespec );
if (strcmp( "..", find.name) && strcmp( ".", find.name)) {
strcpy( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
@@ -273,12 +300,8 @@ void pack_directory( char * filespec)
continue;
}
if ( (strcmp(dir->d_name, ".svn") == 0) ) {
continue;
}
if (S_ISDIR(buf.st_mode)) {
strcpy_s( tmp, filespec );
strcpy( tmp, filespec );
strcat( tmp, "/" );
strcat( tmp, dir->d_name );
pack_directory(tmp);
@@ -315,20 +338,32 @@ int verify_directory( char *filespec )
void print_instructions()
{
printf("Creates a vp archive out of a FreeSpace data tree.\n\n");
printf("Usage: cfilearchiver archive_name src_dir\n");
#ifdef _WIN32
printf("Example: cfilearchiver freespace c:\\freespace\\data\n");
#else
printf("Example: cfilearchiver freespace /tmp/freespace/data\n\n");
#endif
printf("Creates an archive named freespace out of the freespace data tree\n");
printf("For information about the FS2 directory structure, please consult\n");
printf("http://www.hard-light.net/wiki/index.php/FS2_Data_Structure\n");
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 redefine main() which is something
// 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
@@ -340,17 +375,26 @@ int main(int argc, char *argv[] )
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_s( archive, argv[1] );
strcpy( archive, argv[1] );
p = strchr( archive, '.' );
if (p) *p = 0; // remove extension
strcpy_s( archive_dat, archive );
strcpy( archive_dat, archive );
strcat( archive_dat, ".vp" );
strcpy_s( archive_hdr, archive );
strcpy( archive_hdr, archive );
strcat( archive_hdr, ".hdr" );
fp_out = fopen( archive_dat, "wb" );
Loaded 100 of 2337 files, more files were not shown because too many files have changed in this diff. Show more