Compare commits

..
Author SHA1 Message Date
Goober5000 6d1334e5a3 revert the directory move 2008-02-09 21:33:46 +00:00
Goober5000 bbd2b65616 remove extraneous fs2_open folder from all branches and tags 2008-02-09 19:21:05 +00:00
(no author) 55d6cb4b70 This commit was manufactured by cvs2svn to create tag
'fs2_open_3_6_7'.
2005-09-18 23:06:18 +00:00
taylor fe88ab1396 gah, revert that since it was never going to work (not sure what I was drinking that day) 2005-09-18 23:06:17 +00:00
wmcoolmon 4179e85caf Fixed silly i variable placement mistake 2005-09-18 20:41:10 +00:00
Goober5000 b73dcd739b a small fix
--Goober5000
2005-09-18 02:28:18 +00:00
phreak c1a82b09d6 radar bitmap should render the correct color using -orbradar 2005-09-17 19:12:37 +00:00
Goober5000 75e8b56828 better tweak 2005-09-17 01:41:49 +00:00
Goober5000 205fc23b91 tweak 2005-09-17 01:37:02 +00:00
Goober5000 49a65b4ea8 It is a strange fate that we should suffer so much fear and doubt over so small a thing.
Such a little thing...
2005-09-17 01:36:29 +00:00
Goober5000 d8351b5cb9 roll back taylor's loadout fix and do it this way: it saves memory
(but thanks to taylor for drawing attention to the difference between wing slots and wss slots!)
--Goober5000
2005-09-16 17:02:50 +00:00
taylor 50306334bc fix afterburner bug 2005-09-16 08:11:39 +00:00
taylor 7e3012fec1 when a wing is departing to a bay have ships break formation when playing follow-the-leader 2005-09-16 02:59:55 +00:00
taylor 28b190122d when changing a campaign in the campaign room make sure that the mainhall is properly set without having to play a mission first 2005-09-16 02:51:54 +00:00
taylor caa37d9b86 didn't mean to leave that in there 2005-09-16 00:03:51 +00:00
Kazan 8a36ebd73e comment out superfluous debug message 2005-09-15 23:54:58 +00:00
taylor 8890cec34b gah, I still messed that up. Add a NULL check and have register_malloc() actually handle the correct pointer 2005-09-15 05:19:25 +00:00
taylor d2bcd90e9e some vm_* fixage for Windows 2005-09-14 20:38:12 +00:00
taylor 017d7b1cb8 fix ace badges not getting displayed in debriefing 2005-09-14 20:03:40 +00:00
phreak fccb7eaf69 fix to a minor annoyance where the hud weapons gauge wouldnt render properly if there were no secondary weapons. 2005-09-14 02:55:04 +00:00
taylor 6b94ed3308 fix out-of-bounds crash when apply_to_all button is hit 2005-09-13 04:32:11 +00:00
phreak cee0940c17 sort_weapons_by_type() now also subsorts primaries by whether its supposed to only
be used on big ships or not.
2005-09-11 03:50:42 +00:00
taylor 5663c4933a make sure smart shields can't send the strength of a quadrant over the max 2005-09-10 21:10:19 +00:00
Goober5000 1292005d71 "no briefing" flag now works for red-alert missions too
--Goober5000
2005-09-09 05:12:44 +00:00
Goober5000 598598d26c braces for clarity 2005-09-09 05:11:20 +00:00
phreak 4d6d45dd76 sort_weapons_by_type() now subsorts missiles and places fighter-sized weapons ahead of capital weapons and child weapons
its also alot less memory intensive too.
2005-09-08 23:20:54 +00:00
taylor efe030c058 make it actually compile under WIN32
bump version to 0.5 since little else is going to be done to this thing
2005-09-08 05:04:15 +00:00
taylor 8b4b35be0a fix building/linking of command line tools under Linux/OSX
add tools as targets to OSX project file
2005-09-08 00:09:32 +00:00
taylor f51a10c546 fix mouse position setting in non-standard resolutions 2005-09-06 17:26:39 +00:00
taylor c1acb96dc6 use exit(EXIT_FAILURE) rather than abort() so that all atexit() calls will actually get executed 2005-09-06 05:32:12 +00:00
taylor 0952771b72 fix for -pcx32 on big-endian 2005-09-06 02:40:24 +00:00
Kazan f116ff4f58 fixed a bug related to multiplayer table validation and modular tables 2005-09-06 00:32:20 +00:00
taylor f6c794bd85 merge of OSX tree
a lot of byte swaps were still missing, will hopefully be fully network compatible now
2005-09-05 09:38:19 +00:00
taylor cc72eb1d2a merge of OSX tree
fix OGL fullscreen switch for SDL since the old way only worked under Linux and not OSX or Windows
fix OGL version check, it would allow a required major version to be higher if the required minor version was lower than current
2005-09-05 09:36:41 +00:00
taylor 68265ecfc9 a little more cross-platform friendly this way 2005-09-05 09:34:06 +00:00
taylor adb71b42b6 merge of OSX tree
update cmdline stuff for Linux to be less stupid and provide better feedback to the user
2005-09-05 09:33:08 +00:00
taylor bd372c46ec merging of project files for OSX 2005-09-05 09:23:26 +00:00
taylor a62183fd64 merging of new files from OSX tree 2005-09-05 09:21:15 +00:00
wmcoolmon 74f451ab2e Fix the ship vanishing in TOPDOWN mode error 2005-09-05 09:02:08 +00:00
phreak f98a3ba721 don't wrap the U_offset variable since it causes the beam to jump once it gets reset. 2005-09-03 17:48:21 +00:00
taylor 33e28ed71e various weapon_range cap fixes for primary, secondary weapons and hud targetting info 2005-09-01 04:14:04 +00:00
Goober5000 2518d7d7a9 hm, typo
--Goober5000
2005-08-31 08:11:58 +00:00
Goober5000 391ae75979 All wings will now form on their respective leaders, not just certain starting wings.
If this breaks anything, the old code is commented out.  You know who to yell at. ;)
--Goober5000
2005-08-31 08:09:51 +00:00
Goober5000 fa1270f62d Wings will now form on their leader, not necessarily the player. This is to
account for cases where the player is not the leader of his wing.  It has the
side effect of causing wings that arrive later in the mission to form on *their*
leader rather than the player, but this is probably the preferred behavior (at
least judging from Mike Kulas's comment of 5/9/98).  This does create a
difference from retail AI, but it should be only cosmetic, since ships only form
on a wing until they are ordered (via comm or sexp) to do something else.
--Goober5000
2005-08-31 07:54:33 +00:00
Goober5000 7e583ad5d6 removed two unused functions
--Goober5000
2005-08-31 07:17:43 +00:00
Goober5000 46386e5ee0 remove a redundant function
--Goober5000
2005-08-31 07:01:40 +00:00
Goober5000 40442a6cc4 fix a function prototype to match its counterpart in vecmat.h
--Goober5000
2005-08-31 06:25:27 +00:00
Goober5000 b783360750 roll back and recommit the minimally invasive version of phreak's fix...
this removes a bit of redundant code
--Goober5000
2005-08-31 06:12:41 +00:00
phreak 5507bf9c95 real spawn angle fix. The problem stemmed from the matrix argument in vm_vec_random_cone()
being objp->orient and should have been the matrix formed by vm_vector_2_matrix(&m, &objp->orient.vec.fvec, NULL, NULL);
2005-08-31 05:47:02 +00:00
Goober5000 dcb66b4ce6 fixed yet another docking bug, based on taylor's original fix :p
--Goober5000
2005-08-31 00:59:35 +00:00
Goober5000 d13386b02b made spawning missiles work like retail when appropriate
--Goober5000
2005-08-31 00:48:22 +00:00
phreak 9f64817f7d Get rid of alpha blending when using the htl drawing fuctions for lines and spheres.
Right now, gr_opengl_draw_htl_line and gr_opengl_draw_htl_sphere are only used in fred, so
it shouldn't change anything critical
2005-08-29 02:23:04 +00:00
phreak 80a248e214 Record state changes in gr_opengl_set_state() 2005-08-29 02:20:56 +00:00
Kazan 6e816fc2d3 potential fix for mantis bug 237 2005-08-27 00:21:27 +00:00
taylor 0357abd27d fix strange static issue experienced with TBP briefing voices 2005-08-26 17:05:13 +00:00
taylor 98ab82451e send out multi pings during level load to prevent timeouts on slower computers (does not break network compatibility with older, or retail, clients/servers) 2005-08-26 00:56:17 +00:00
taylor ae0211df31 basic cleaning, removing old/useless code, sanity stuff, etc:
- very minor performance boost from not doing stupid things :)
 - minor change to 3d shockwave sizing to better approximate 2d effect movements
 - for shields, Gobal_tris was only holding half as many as the game can/will use, buffer is now set to full size to avoid possible rendering issues
 - removed extra tcache_set on OGL spec map code, not sure how that slipped in
2005-08-25 22:40:04 +00:00
taylor a71dd6e5c5 fix crash from oversized buffer data requests with OGGs 2005-08-25 22:33:48 +00:00
taylor f3d6636fb9 since the geomtry_batcher can send more verts than non-HTL code can handle, avoid drawing in that case to avoid crashing 2005-08-25 22:32:55 +00:00
taylor 499bfccdf3 fix Int3() when we are an OGG and need silence data 2005-08-25 06:32:42 +00:00
taylor 10b4d8ef73 don't let ai keep firing primary and secondary weapons for fighters and bombers if they are dying (fixes player deathroll too) 2005-08-25 00:48:19 +00:00
Goober5000 f7db8ee7d1 tweaky optimization based on the current version of stristr and
the current version of the expanded music.tbl
--Goober5000
2005-08-24 07:20:36 +00:00
Goober5000 20de684fcd faster version of stristr
--Goober5000
2005-08-24 07:14:52 +00:00
matt 0b285d1ce5 Changed rect_size_y - 1 to rect_size_y. Not really that important, but much more correct. I'll stop barraging cvs now :) 2005-08-23 17:06:28 +00:00
matt 85e806405c Fixed another screen save bug relating to having your window positioned offscreen. Still isn't great for when the window is offscreen top left 2005-08-23 16:57:28 +00:00
matt 94d2d6da1d Fixed screen save crash when a popup is called 2005-08-23 15:59:51 +00:00
Goober5000 6d83162a72 ensure init/reset of goals works cleanly
--Goober5000
2005-08-23 09:18:08 +00:00
Goober5000 995961bd93 fix for bug 519
--Goober5000
2005-08-23 09:03:56 +00:00
Goober5000 f9e97e03dc removed a thing I apparently forgot to remove on 2005/07/12
--Goober5000
2005-08-23 07:49:24 +00:00
taylor 87363eba75 fix navpoint hud brackets and text display in non-standard resolutions 2005-08-23 07:37:14 +00:00
Goober5000 9f2bf811be some tweaks to parselo, plus ensure that Unicode files don't crash
--Goober5000
2005-08-22 22:24:22 +00:00
Goober5000 49735a9631 one more change
--Goober5000
2005-08-22 04:59:13 +00:00
Goober5000 7d7d365d9c final changes to projects and workspace; everything should work now
(in MSVC 6 anyway)
--Goober5000
2005-08-22 04:58:38 +00:00
Goober5000 eff4e44151 these ogg libs are needed also
--Goober5000
2005-08-22 04:55:38 +00:00
Goober5000 ce5aa8edfb add dx8 libs and headers missing in the dx9 sdk
--Goober5000
2005-08-22 04:53:41 +00:00
Goober5000 e28c203461 add ogg libs and headers
--Goober5000
2005-08-22 03:11:32 +00:00
taylor 87d2843cfc fix stats display in debriefing with non-standard resolutions 2005-08-21 21:05:53 +00:00
Goober5000 09e9dbec4d clarified the comment on my original move of the wing departure information assignment
--Goober5000
2005-08-21 06:19:31 +00:00
taylor 35309cc15a more unix->SCP_UNIX define fixing 2005-08-20 20:38:08 +00:00
taylor f851a3190b some bmpman and render_target function name changes so that they make sense
always use bm_set_render_target() rather than the gr_ version so that the graphics state is set properly
save the original gamma ramp on OGL init so that it can be restored on exit
2005-08-20 20:34:51 +00:00
taylor a646e617ff Make sure to always use world pos for shockwaves in HTL mode, avoids the distance check Error()
(if someone can find a better explanation of why this one thing was different please make a better fix)
2005-08-20 20:32:28 +00:00
taylor 9872bd0bc3 Fix an old unix define, should be SCP_UNIX 2005-08-20 20:29:47 +00:00
Goober5000 e01b990494 made AwacsMultiplier more user-friendly
--Goober5000
2005-08-20 18:23:02 +00:00
matt 1000c46fe9 Fix for D3D white squares issue 2005-08-20 16:00:03 +00:00
taylor 73c9b0e749 Address a couple of pilot code issues
- make the same MAX_PILOTS in the barracks that the playerselect screen has since it's a problem here too
 - add a -1 check for ship/weapon name lookups to avoid bounds issues.  NOTE: this can empty the techroom of entries if ithits this check, but it won't crash :)
2005-08-18 01:15:41 +00:00
Kazan 421fc46b42 # FEATURE BREAK # This breaks a feature in pilot files temporarily to correct a [reproducable] crash - it is merely commenting out the trouble lines - bug report in mantis and assigned to taylor 2005-08-18 00:19:53 +00:00
Kazan 66fd939231 [hopefully] Fix the bug i introduced in the show memory usage code, and the convergence bug during autopilot [also saves cpu cycles - MANY of them] 2005-08-16 20:06:24 +00:00
Kazan 725bfc17df i introduced a bug in _vm_realloc.. fixed it 2005-08-14 23:05:27 +00:00
Kazan 2cde2c8e46 I'm stupid, sorry - fixed release-build-crash 2005-08-14 21:01:59 +00:00
Kazan 9e9b151960 diabled NEW_MALLOC on windows - it was causing crashing - must have been corrupting it's own heap 2005-08-14 17:20:56 +00:00
taylor 5c563c5cb8 don't do any ambient sound or music stuff in game_pause()/unpause() on options screens when in mission so we can
avoid having mainhall ambient sounds and music start playing and then not stop until you exit the mission
2005-08-11 12:22:26 +00:00
taylor b8818d6cfc handle rare cases where anims would get freaky if one happened to still be playing or otherwise queued 2005-08-11 12:18:53 +00:00
taylor a081773563 little safety check, a couple of strange cases allow this to happen so we should look for it 2005-08-11 12:16:23 +00:00
taylor cb3401e03a well that was rather stupid of me, this would crash if old + new pilots went over MAX_PILOTS 2005-08-09 10:06:47 +00:00
taylor 222b984cc3 be sure to remove ships from a wing when that ship gets vanished 2005-08-08 03:13:53 +00:00
taylor 0fda3d1fbd hopefully fix the problem that was causing geometry issues in just OGL when using VBOs 2005-08-08 01:19:50 +00:00
taylor 4e3fb69600 some minor cleanup
don't load the default 2d shockwave graphics if we have a default 3d shockwave, they won't get used and only take up memory
2005-08-07 09:25:55 +00:00
taylor 0ee8aac766 forgot to commit this before, did this gui code actually compile for anyone? 2005-08-07 09:24:22 +00:00
taylor ca91178cbe fix 3-D shockwave frame detection so that it will use the proper number of frames for the animation (not less, not more) 2005-08-05 15:33:45 +00:00
Goober5000 c619247b02 made "stealth" tag more user-friendly, and fixed a bit of punctuation
--Goober5000
2005-08-03 22:02:38 +00:00
taylor 3708fb1de7 allow for both gamedir and userdir cmdline config files 2005-08-01 10:00:39 +00:00
taylor 4602e63dc1 never could get Ai_class_names to realloc properly but this does the job just as well 2005-08-01 09:57:52 +00:00
wmcoolmon d9cf3916f4 MR_NO_FOGGING for shockwaves 2005-07-31 20:31:41 +00:00
taylor 2c6bc53193 we only care about fmt and data tags so once we have them bail out, fixes some really bad seek errors in crappy wav files 2005-07-31 01:35:43 +00:00
taylor 61ccec1abd fix a NULL pointer reference if there are no secondary banks on a ship 2005-07-31 01:34:03 +00:00
taylor c8bc719c4c few data type fixes, was only a problem for big-endian systems as little-endian doesn't really care about this 2005-07-31 01:32:21 +00:00
taylor 3817a704ff print file and line info for Int3() calls to the logfile so that they are easier to debug with basic error reports 2005-07-31 01:30:48 +00:00
taylor 1a62ef0b68 Temporarily add an empty AIM_GET_BEHIND case to ai_execute_behavior() to avoid hitting Int3() in TBP 2005-07-31 01:29:21 +00:00
wmcoolmon d37906f041 Removed turret thing, added some more armor type calculations 2005-07-30 22:34:42 +00:00
taylor d77c090eaf safety check for TYPE_D beam weapons, the +Shots: count needs to be at least 1 to avoid various errors 2005-07-29 10:18:26 +00:00
Goober5000 8a5dc41e2e verified that submode_start_time is updated whenever submode is changed
--Goober5000
2005-07-27 18:27:49 +00:00
Goober5000 2dd43251ec more tweaks to the dock code
--Goober5000
2005-07-27 17:22:22 +00:00
taylor 9719b83766 Add ability to use specific refresh rate, needs a soon to be updated Launcher to have set via GUI
but this can go in already.  Defaults to, and falls back on, previous behavior and adds some
  error checking that wasn't there previously.
2005-07-26 08:46:48 +00:00
Goober5000 9fb769900b more bugs and tweaks
--Goober5000
2005-07-25 08:22:00 +00:00
Goober5000 9b12500fe1 forgot this
--Goober5000
2005-07-25 05:55:40 +00:00
Goober5000 2d0bde22e4 cleaned up some command line and mission flag stuff
--Goober5000
2005-07-25 05:24:17 +00:00
Goober5000 f0b3d37762 whoops
--Goober5000
2005-07-25 05:23:33 +00:00
Goober5000 2f1745b9c8 various code cleanups, tweaks, and fixes; most notably the MISSION_FLAG_USE_NEW_AI
should now be added to all places where it is needed (except the turret code, which I still
have to to review)
--Goober5000
2005-07-25 03:13:26 +00:00
Goober5000 db06ce05c1 cleaned up some rotating submodel code
--Goober5000
2005-07-24 20:12:55 +00:00
Goober5000 9e830fd82d fixed a minor docking bug
--Goober5000
2005-07-24 19:59:24 +00:00
taylor e4dfa534f6 proper multi support for fighter beams, already has code to break protocol commented out if we need it,
decided to skip and beam type checks and let beam_fire() reassign it (should work ok)
2005-07-24 18:35:44 +00:00
taylor 9ad5b3686f hehehe, fix the check to allow fighter beams to count for kills 2005-07-24 18:33:47 +00:00
taylor 2bb5300132 various incarnations of freaky and stupid, need to do this everywhere eventually 2005-07-24 18:32:58 +00:00
taylor ed4f880369 address possible div-by-0 problem 2005-07-24 18:31:59 +00:00
taylor 01f6ac2148 little 64-bit strangeness (longs are 64-bit here rather than 32) 2005-07-24 18:31:17 +00:00
wmcoolmon 253e12878c Multiple shockwaves support. 2005-07-24 06:01:37 +00:00
wmcoolmon 7b18d839ca Synced 3D shockwaves' glowmaps with the model, tossed in some medals.tbl
support for the demo/FS1
2005-07-24 00:32:45 +00:00
wmcoolmon b1f5390f90 Fixed formatting FTW 2005-07-23 22:52:44 +00:00
wmcoolmon c85ed21a50 Fixx0red description for show-subtitle 2005-07-23 22:48:28 +00:00
Goober5000 a8daa191bf bah - fixed subsystem comparison
--Goober5000
2005-07-23 21:47:46 +00:00
Goober5000 95f0ce016e fixed ai issue where some ships would never call for rearm
--Goober5000
2005-07-23 21:06:24 +00:00
Goober5000 6328625e63 fixed a rare but ugly (though amusing) bug
--Goober5000
2005-07-23 18:38:47 +00:00
wmcoolmon 2f84efb076 Fixed bug where camera reset when rotation complete 2005-07-23 18:25:42 +00:00
Goober5000 1c19a2bfa5 remove Bobboau's extra warp thing
--Goober5000
2005-07-23 17:27:50 +00:00
Goober5000 9a494bb545 remove an extraneous extern
--Goober5000
2005-07-23 16:25:32 +00:00
Goober5000 f7cc6399c4 fix the support ship bug; taylor should be happy now ;)
--Goober5000
2005-07-23 11:42:54 +00:00
wmcoolmon f996cbb2c0 Another try at fixing gun turrets sticking straight up 2005-07-23 08:17:04 +00:00
Goober5000 d4e507ad41 CVS header tweaks
--Goober5000
2005-07-22 10:18:41 +00:00
Goober5000 25d1addbed unhide null vector bug
--Goober5000
2005-07-22 09:59:30 +00:00
wmcoolmon 295a57cc65 Dynamic AI Class number commit. KNOWN BUG: When AI_CLASS_INCREMENT is hit and vm_realloc is called, memory corruption seems to
result. Not at all sure what causes this; if this can't be resolved soon, we can always treat _INCREMENT like _MAX
2005-07-22 09:19:40 +00:00
Goober5000 c54410f177 fixed another bug when changing ship classes
--Goober5000
2005-07-22 04:31:12 +00:00
taylor 1ffb472245 better error checking/handling for when you fire primary/beam weapons without a target selected 2005-07-22 03:54:46 +00:00
taylor db538a19d7 fix crash on commit in the multi ship selection screen
mask_data in the UI code is always cast to ubyte so why it was a ushort type I'll never know
fix unsized text in input boxes (fixed the real problem earlier but forgot to remove this old fix)
2005-07-22 03:53:32 +00:00
taylor ba26e4690f forgot to remove PreProcDefines.h from here too 2005-07-22 03:51:13 +00:00
wmcoolmon 478543cd73 Changed $Hull Repair Rate and $Subsystem Repair Rate to be percentages,
as well as making them accept all values between -1 and 1
2005-07-21 07:53:14 +00:00
taylor e21deb998a fix problem loading compressed DDS created by DX9 utils 2005-07-20 14:55:12 +00:00
taylor 7cc52df168 move the "none.wav" init to event_music_init() so it only runs through once (fixes no mission music when modular tbls are used) 2005-07-20 02:37:32 +00:00
taylor 32304b128a better UV offsets when using non-standard resolutions (for text mostly), copied from D3D code 2005-07-20 02:35:51 +00:00
taylor fe0b2855ee fix resize fixes 2005-07-19 04:52:56 +00:00
taylor 5398dc8206 better "is_640x480" detection, 800x600 res was using GR_1024 where it should have used GR_640 2005-07-18 14:09:03 +00:00
taylor f0b509911a errant unsize was still messing up h-sliders in non-standard resolutions 2005-07-18 12:42:10 +00:00
taylor a13064936a more non-standard res fixing
- I think everything should default to resize now (much easier than having to figure that crap out)
 - new mouse_get_pos_unscaled() function to return 1024x768/640x480 relative values so we don't have to do it later
 - lots of little cleanups which fix several strange offset/size problems
 - fix gr_resize/unsize_screen_pos() so that it won't wrap on int (took too long to track this down)
2005-07-18 03:45:10 +00:00
taylor a14b57d6f5 cleanup hudtargetbox rendering from that total hack job that had been done on it (fixes wireframe view as well)
more non-standard res fixing
 - I think everything should default to resize now (much easier than having to figure that crap out)
 - new mouse_get_pos_unscaled() function to return 1024x768/640x480 relative values so we don't have to do it later
 - lots of little cleanups which fix several strange offset/size problems
 - fix gr_resize/unsize_screen_pos() so that it won't wrap on int (took too long to track this down)
2005-07-18 03:44:01 +00:00
taylor 23d5e01508 PreProcDefines.h has to be removed from here as well so that "make dist" will work 2005-07-18 03:37:35 +00:00
wmcoolmon b48172ce1b Unlike my previous commit, this one does not cause a segmentation
fault. :)
2005-07-16 07:03:49 +00:00
wmcoolmon 64721e4407 Commented out lines 554 and 555 so the code would compile 2005-07-16 06:33:16 +00:00
Goober5000 6a2a61287d cleanup and clarification of phreak's fix of a bug propagated by me and penguin
--Goober5000
2005-07-16 04:41:04 +00:00
wmcoolmon 08db59549f I can't compile the source to test this, but this should switch the
hi-res check to "2_ChoosePilot-m" rather than sparky_hi_fs2.
2005-07-15 23:19:10 +00:00
Goober5000 6a02b099da fixed a typo of Kazan's dating all the way back to October 15, 2003 (!!) that
created a nasty stealth bug
--Goober5000
2005-07-15 03:48:40 +00:00
Goober5000 e49cd4edb8 remove PreProcDefines.h from project file; tweak #define's
--Goober5000
2005-07-14 23:46:57 +00:00
mrduckman 919bd0d434 Restored messages to on-focus channel. If it doesn't work, we'll work around with a pseudo-cmd. 2005-07-14 13:25:03 +00:00
phreak d9c643bb41 If the web cursor bitmap isn't found, tell the user to move the executable to the main FS2 directory. 2005-07-13 15:15:54 +00:00
Goober5000 1004ffcb54 remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:35:36 +00:00
Goober5000 d62d659bf4 remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:26:00 +00:00
Goober5000 81833122b8 remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 03:15:53 +00:00
Goober5000 a3ee32e28d remove PreProcDefine #includes in FS2
--Goober5000
2005-07-13 02:50:53 +00:00
Goober5000 851732e3e1 remove preprocdefines, yay!
--Goober5000
2005-07-13 02:39:17 +00:00
Goober5000 485e7fcf7e this seems like it should be handled by the code already...
let's remove it and see what happens :p
--Goober5000
2005-07-13 02:32:22 +00:00
Goober5000 c14a21e332 removed autopilot #define
--Goober5000
2005-07-13 02:30:54 +00:00
Goober5000 55e04969c9 move inferno vs. network check here for the time being
--Goober5000
2005-07-13 02:08:26 +00:00
Goober5000 b8db2eb59f fixed a bunch of "issues" caused by me with the species stuff
--Goober5000
2005-07-13 02:01:30 +00:00
Goober5000 47edc76b69 rolled this back because it causes a syntax error in MSVC
--Goober5000
2005-07-13 02:00:44 +00:00
Goober5000 84b8fe77d7 improved species support and removed need for #define
--Goober5000
2005-07-13 00:44:24 +00:00
Goober5000 28fdeb4a28 removed DECALS_ENABLED
--Goober5000
2005-07-12 22:14:40 +00:00
Goober5000 197a041da5 removed NO_LINKED_PRIMARY_PENALTY as it's better suited for difficulty.tbl or something similar
--Goober5000
2005-07-12 21:58:45 +00:00
Goober5000 9b657a529b fixed "warpout sequence aborted" bug
--Goober5000
2005-07-12 21:10:57 +00:00
Goober5000 3008602982 properly fixed beam_apply_whack()
--Goober5000
2005-07-12 21:01:40 +00:00
mrduckman 1259c46d3c Better SDL Headers checking for MacOSX 2005-07-12 18:14:53 +00:00
Goober5000 67a5183ad6 remove all restrictions on which ship types can dock with each other
--Goober5000
2005-07-12 07:03:18 +00:00
mrduckman 61162cfd67 Fixed SDL linking for MacOSX 2005-07-11 14:26:30 +00:00
wmcoolmon 6a2b0110b9 Bumped Fs2_open version to 3.6.7 2005-07-11 10:13:09 +00:00
wmcoolmon 43d061d4f3 Bumped version for Linux makefile to 3.6.7 2005-07-11 10:12:06 +00:00
wmcoolmon 344c50572a Fixed the bug where sending an ignore command to "All fighters" would
apply to all ships
2005-07-11 10:01:06 +00:00
taylor 2175a959db make sure to tack on a / on the dot dir so that recursive directory making will work properly (code thought it was a file rather than a dir) 2005-07-09 04:34:43 +00:00
wmcoolmon ccd760994b Added fixes for custom gauges discussed in the recent thread 2005-07-09 03:02:07 +00:00
taylor 775c86a894 various compiler warning fixes (some of these from dizzy) 2005-07-07 16:36:58 +00:00
taylor 449f1e2fe5 make double sure that we actually need to render thruster glows instead of doing it regardless 2005-07-07 16:35:11 +00:00
taylor dc7a2d08db add value of GL_vertex_data_in to OGL card memory usage 2005-07-07 16:33:39 +00:00
taylor 88d08df966 compiler warning fixes
add -noibx troubleshooting cmdline option to disable use of IBX files
don't try to set thuster object number is only one thruster bank is specified (default method should go into affect)
2005-07-07 16:32:33 +00:00
phreak 5e8c31dadd fixed an afterburner bug where AI ships would have infinite AB fuel if NO_NETWORK
was defined.
2005-07-05 17:04:08 +00:00
taylor ea7c3255fc bah, forgot to ever check debriefings 2005-07-02 20:57:48 +00:00
taylor e2bc4ff920 ton of non-standard resolution fixes 2005-07-02 19:45:02 +00:00
taylor 7500378696 ton of non-standard resolution fixes
make gr_cross_fade() work properly in OGL
2005-07-02 19:40:48 +00:00
taylor 3921b2b079 fix compiler warnings introduced by recent stub changes (defining an empty stub as something is wrong, it should be nothing)
assuming that GetStatus thing wasn't tested since it would never have worked
2005-07-02 19:39:23 +00:00
taylor 15c5c06c7f some supernova fixing 2005-07-02 19:36:04 +00:00
taylor 0270ac2c0b compiler warning fixes 2005-07-02 19:33:18 +00:00
phreak 8842fb64db remove the BEAM_NO_WHACK flag in beam_apply_whack() 2005-07-01 17:19:43 +00:00
Goober5000 578d70b7cd the message queue now waits for simulated speech to finish
--Goober5000
2005-06-30 02:36:16 +00:00
Goober5000 ea73c417ff added functions to check if speech is playing
--Goober5000
2005-06-30 02:35:17 +00:00
Goober5000 cbf7b33393 * NOX'd none.wav
* changed comparisons on none.wav to only look at the first four letters in case
  we don't have an extension or in case some weirdo decides to put none.ogg
* simulated speech pre-empts "beeps" in in-game messages
--Goober5000
2005-06-30 01:48:52 +00:00
Goober5000 84e6492488 tweaked the stubs and added a function
--Goober5000
2005-06-30 01:35:52 +00:00
Goober5000 d24b80f395 if game_busy() is in gamesnd_preload_common_sounds() then it should
also be in gamesnd_load_gameplay_sounds() I would expect
--Goober5000
2005-06-30 00:48:02 +00:00
Goober5000 ef175e9271 Removed "beam no whack" as setting the beam's mass to 0 achieves the same effect.
--Goober5000
2005-06-30 00:36:10 +00:00
taylor 304a1f77a1 set-skybox-model only takes one argument so don't advertise more
add set-skybox-model help text for FRED2
2005-06-29 18:54:59 +00:00
taylor 83012fe0e9 should fix perpetually damaged subsystems on ships for multi clients 2005-06-29 18:54:02 +00:00
taylor 4df1fd48c4 FRED2 does special stuff for jumpnode handling so don't try and delete the obj ourselves when FRED is running 2005-06-29 18:53:07 +00:00
taylor 81480ebcbc extra checks to make sure we don't end up targetting a sensor-invisible ship 2005-06-29 18:52:02 +00:00
taylor 15628c5f8b revert OGL init changes since ATI drivers suck and don't like it 2005-06-29 18:51:05 +00:00
taylor 5427e73ffa little cleanup and error checking 2005-06-29 18:50:13 +00:00
taylor 97982c52d7 various FS2NetD fixes:
- replace timer stuff with something that more accurately works cross-platform and without being affected by load
 - better sanity checking for the server list
 - working Linux compatibility that's not dog slow
 - when calling DataReady() make sure that the data is properly valid
 - fix messed up cvs merge cleanup from the Linux merge which did nasty things
2005-06-29 18:49:37 +00:00
taylor 892fb2ea93 add option to not scale up movies to fit window/screen, default is to scale
(arguably not a bug but I said I would get it in before 3.6.5 and forgot)
2005-06-29 18:46:13 +00:00
taylor 4de6d09b64 we only want to have m_data_offset be 0 for oggs since the seeking callback will account for the true offset
only extern the one int we need for the -nosound speech fix rather than including the entire header
2005-06-24 19:36:49 +00:00
taylor 52d9eccb72 compiler warning fix (dizzy) and make sure that it's safe to continue after that switch statement 2005-06-22 15:25:41 +00:00
taylor abed73b3c6 make sure that _mkdir() will return an error if the path is invalid 2005-06-22 15:18:58 +00:00
taylor 5f9b7064c9 objnum check when targetinfo is used, fixes message brackets having random text as info 2005-06-22 15:17:53 +00:00
taylor 148ba14b56 make sure we only have one extension on mission names 2005-06-22 15:16:40 +00:00
taylor 3abc9fc0f8 probably be a good idea to make the valid objnum check here too 2005-06-21 00:25:34 +00:00
taylor 0de8af2602 in the model _render functions change "light_ignore_id" to "objnum" since that's what it really is
and this makes it so much easier to realize that
properly deal with the fact that objnum can be -1 in  model_really_render()
add NULL check to neb2_get_fog_values() so that it can just send back defaults if objp is NULL
small compiler warning fix for neb code
2005-06-21 00:20:24 +00:00
taylor 7f48891579 unbreak network compatibility with 3.6.5 and earlier builds
fix crashing with turret weapons
2005-06-21 00:15:06 +00:00
taylor 375bad91e6 add some better error checking/handling for when GetServerList messes up 2005-06-21 00:13:47 +00:00
taylor 887aa98e05 add virtual destructor so that GCC4 can shut up 2005-06-21 00:12:11 +00:00
phreak 8862debae8 added cmdline.h include so the compiler would see the no sound command line option
also added CVS header information.
2005-06-20 15:54:58 +00:00
taylor d1b28d6c7e little cleaner ship_get_random_targetable_ship(), for Goober's sake ;) 2005-06-20 04:10:35 +00:00
taylor b4cf700de6 arch and GCC4 compatibility 2005-06-20 04:09:46 +00:00
taylor cb9c2520bd make sure to reset size to 0 on texture free 2005-06-19 09:04:40 +00:00
taylor e2c5b17775 check_values() shouldn't be inline anymore
remove useless neb2_get_fog_intensity() call
s/alocate/allocate/g
2005-06-19 09:03:05 +00:00
taylor 4a1fa4ce38 minor sanity checking for geometry_batcher
make particle batchers allocate dynamically
handle cases where a particle graphic couldn't be loaded
2005-06-19 09:00:09 +00:00
taylor ad6698346f disable speech when -nosound is used 2005-06-19 08:56:23 +00:00
taylor 5db635395d woorps! 2005-06-19 04:59:04 +00:00
taylor 960d41a0d5 remove xmouse.cpp since it's pretty much useless 2005-06-19 02:48:14 +00:00
taylor 457f351954 never "promote" to a lower rank than current 2005-06-19 02:47:00 +00:00
taylor ed3eeb59e4 OGG streaming fixes to get data reading right and avoid skipping
properly handle seeking in OGG streams
compiler warning fix in OpenAL builds
2005-06-19 02:45:56 +00:00
taylor 7bb2d44d29 WMC's build fix, part deux 2005-06-19 02:43:49 +00:00
taylor c774be5da9 jumpnodes can get deleted outside of FRED now so allow for that 2005-06-19 02:43:14 +00:00
taylor b213b72e04 really needed to mention those two things as well given the types of changes those are 2005-06-19 02:42:21 +00:00
taylor 1f3ed28920 fix possible crash from popups, especially in multi 2005-06-19 02:38:33 +00:00
taylor 7df06d9b99 model_free_all() will unload textures so don't bother doing it twice 2005-06-19 02:37:43 +00:00
taylor 2b4dd24535 general cleanup, remove some old code
speed up gr_opengl_flip() just a tad
inverted gamma slider fix that Sticks made to D3D
possible fix for ATI green screens
move opengl_check_for_errors() out of gropentnl so we can use it everywhere
fix logged OGL info from debug builds to be a little more readable
if an extension is found but required function is not then fail
try to optimize glDrawRangeElements so we are not rendering more than the card is optimized for
some 2d matrix usage checks
2005-06-19 02:37:02 +00:00
taylor 2807196e1e allow screenshots and backsaves in windowed mode
account for D3D_textures_in size so that it doesn't hit negative values
2005-06-19 02:31:51 +00:00
taylor 1665521590 MIN Num_iface_sounds fix 2005-06-19 02:29:54 +00:00
taylor 0051f2b19f add a _fast version of bm_unload() to be used in modelinterp and future graphics API code
clean up some modelinterp code to not use memcpy() everywhere so it's more platform compatible and matches old code (Jens Granseuer)
NaN check to catch shards-of-death and prevent hitting an Assert() (Jens Granseuer)
fix jumpnode code to catch model errors and close a memory leak
make the call to bm_unload_all() after model_free_all() since we will get bmpman screwups otherwise
don't show hardware sound RAM when using OpenAL build, it will always be 0
print top-right memory figures in debug builds slighly further over when 1024+ res
2005-06-19 02:28:56 +00:00
Goober5000 8f0d5d7024 fixed a CVS log spelling error, plus fixed a tricky sexp allocation bug
--Goober5000
2005-06-16 05:17:32 +00:00
mrduckman e3883f2426 Added LIST command and added comment about PRIVMSG for Channels 2005-06-09 14:57:38 +00:00
wmcoolmon f006692c72 Hopefully this fixes something :) 2005-06-07 06:34:30 +00:00
wmcoolmon 98870cab35 This may stop targeting not-targetable ships in EMP 2005-06-07 06:10:51 +00:00
taylor 7ffbec56f3 add wxwidgets macro so that the dev package doesn't have to be installed to compile regular builds 2005-06-04 20:03:37 +00:00
wmcoolmon 28979a738d I *think* this should fix bool lists 2005-06-03 22:36:57 +00:00
taylor 5977a382dd some IBX debugging info to help determine if an IBX is corrupt post-mortem 2005-06-03 18:18:02 +00:00
matt 125f341f10 D3D gamma now no longer works backwards --Sticks 2005-06-03 16:42:30 +00:00
taylor 597668dd88 the problem this tried to fix should be properly fixed now but I keep forgetting to remove this block 2005-06-03 06:51:50 +00:00
taylor 7b1cf8dd59 cleanup of gr_bitmap since it's the same for D3D and OGL, skip if GR_STUB though
fix resize/rendering issue when detail culling is used with optimized opengl_create_texture_sub()
2005-06-03 06:44:17 +00:00
taylor c71c1ab1f9 eek... fix wrong description of changes 2005-06-03 06:41:37 +00:00
taylor 85a0250f11 better audio pause/unpause support when game window loses focus or is minimized 2005-06-03 06:39:27 +00:00
wmcoolmon dc0d63e1c0 Small extern fix 2005-06-03 02:28:54 +00:00
Goober5000 1c229c15d0 ugh... reverting taylor's change for now; I'll have to take another look at this
--Goober5000
2005-06-02 03:20:20 +00:00
wmcoolmon 32dd6aafd5 Protected ships are safe from spawning weapons. :) 2005-06-02 02:41:52 +00:00
wmcoolmon 1500870bfa Removed OF_DESTROYED, replacing it with a deletion cache 2005-06-02 02:09:43 +00:00
wmcoolmon 063342c36b Cast to quiet error 2005-06-02 01:56:32 +00:00
wmcoolmon f034cb48a1 Better missing model handling Pt. 2 2005-06-01 22:54:23 +00:00
wmcoolmon 12fc5a9a32 Better missing model handling 2005-06-01 22:52:56 +00:00
phreak 2db4db928e clarified error messages to say that the files listed on asserts/warnings/errors
are located on the computers that built the exe.
2005-06-01 15:10:26 +00:00
taylor e03d62eeb7 bit of cleanup for audiostr-openal and fix a Windows-only enum error
bunch of OGG related fixes for Linux and Windows (DirectSound and OpenAL), fixes audio related TBP 3.2 crashes
gracefully handle OGG logical bitstream changes, shouldn't even load if there is more than 1
2005-06-01 09:41:14 +00:00
taylor 59c1d7a01e little cleanup
optimize opengl_create_texture_sub() by not doing any extra image processing if we don't have to
  if an image is already power-of-2 or we don't need power-of-2 then avoid the extra time and memory usage
2005-06-01 09:37:44 +00:00
taylor e24d75cf94 make sure that newly created entries are properly initialized 2005-06-01 09:35:42 +00:00
taylor 8d1c0cd5b2 newline fix 2005-06-01 09:34:59 +00:00
taylor bb89ede9a2 well that previous docking fix wasn't quite enough, this makes sure that code will actually get exec'd
(Goober: might want to double check that this isn't stupid, does appear abort properly though)
2005-06-01 09:34:36 +00:00
wmcoolmon 8ffc7d031f This should fix redmenace's Assert...I'm not sure why it hasn't been triggering every time a shield is at full strength. 2005-05-30 23:41:36 +00:00
taylor 49318711ab if a briefing does have any stages (no text) then don't carry over text from a previous mission
some generic cleanup to V code that isn't a real problem now but could easily have been a memleak
2005-05-30 05:33:11 +00:00
taylor 5e415f7bd4 make sure we don't show various offscreen indicators and info when hud-disabled-except-messages is used 2005-05-30 05:31:19 +00:00
taylor abb7c260b4 make sure we stop mission in the redalert case too 2005-05-30 05:30:02 +00:00
taylor 622f835598 as soon as the first frame gets released the rest are unreachable in the loop
this was basically became a memory leak as additional frames never got released
2005-05-30 05:29:17 +00:00
taylor 039f3a26af me is a moron, this broke audio streaming 2005-05-30 05:27:30 +00:00
Goober5000 7cfdb91770 Taylor's the real SCP leader; I just play one on the Internet
--Goober5000
2005-05-30 04:38:33 +00:00
taylor f0b9910163 haven't got a clue what I was thinking with that crap 2005-05-28 19:44:17 +00:00
taylor 1f730b9284 debug message fixing
a little bit of code clarity
2005-05-28 19:43:28 +00:00
taylor 90005e98fe add a NULL check to model_get() for better error detection over an outright CTD 2005-05-28 19:41:56 +00:00
taylor 28fbeef528 fix ani corruption detection so that certain streaming anis don't hit it (check was wrong anyway) 2005-05-28 19:40:59 +00:00
Goober5000 ba24fb1aee moved some prototypes that WMC put in the header file back to the implementation file
--Goober5000
2005-05-27 03:37:53 +00:00
Goober5000 a4f4184fe0 hmm, rolled back to 2.3
--Goober5000
2005-05-27 03:36:20 +00:00
Goober5000 17b8798fbe removed some old unnecessary prototypes WMC had added
--Goober5000
2005-05-27 02:37:29 +00:00
tbird 133e98a434 no message 2005-05-26 20:59:59 +00:00
tbird 583024a8fa no message 2005-05-26 20:59:58 +00:00
tbird 9bea5c63e6 Removed due to problems with getting the correct file in place 2005-05-26 20:57:33 +00:00
tbird 437733a98e Updated based on VC6 projects 2005-05-26 20:56:10 +00:00
taylor 366980ab4a forgot to take into account F1_0 on timer_get_fixed_seconds(), remove those stupid CRs too 2005-05-26 09:21:28 +00:00
Goober5000 8fa5d63cb0 some bracket happiness, plus fixed the traning message version of the crazy semicolon bug
(thanks to taylor for fixing the regular message version)
--Goober500
2005-05-26 05:07:19 +00:00
taylor 82d7c503d8 the Loki extensions are Linux only so don't even bother checking under Windows, the
new spec has a cross-platform way of getting the same thing so this isn't a big deal
2005-05-26 04:32:31 +00:00
taylor 7aec8d2a42 don't page out textures in ship_delete() since it causes some slowdown which can make
the explosion effects skip/stutter
2005-05-26 04:30:48 +00:00
taylor edc7a3da00 those crazy semi-colons 2005-05-26 04:29:23 +00:00
taylor e722d89389 if we switch to a pilot who has a campaign that isn't available then abort the read and
deselect all pilots, should prevent data loss or crashes due to the missing safety check
2005-05-26 04:28:45 +00:00
taylor 6f481a3472 timer changes to fix game_busy() on the loading screen and 100% incorrect values on some machines,
don't know if this is going to work that great but it's more like the Linux SDL code now which
  has worked for years without major problems
2005-05-26 04:27:11 +00:00
taylor 7c5d87a506 make sure batch rendering of lasers happens after fog is disabled in nebula missions 2005-05-24 20:55:21 +00:00
taylor ae398ffe8b couple of extra checks to make sure that we can't enter the barracks or the techroom
if the currently selected campaign isn't available, fixes several pilot crash bugs
2005-05-24 20:54:06 +00:00
taylor 644f1120ed make sure that we recursively create directories for Linux/OSX
replace older recursive mkdir method in cfileextractor with new method
2005-05-24 20:52:10 +00:00
wmcoolmon edc4c33208 Commented out -fixbugs and -nocrash in preparation for 3.6.7 2005-05-24 07:05:49 +00:00
taylor 1c55a120b8 extra check to make sure that RLE reading never goes over frame size in new ANI formats 2005-05-24 03:13:36 +00:00
taylor 49f283f030 get command sanity check right, fixes lowercase on extract too 2005-05-24 03:12:27 +00:00
taylor c96527a320 an extra bounds check in sound.cpp
fix audiostr error when filename is !NULL but 0 in len might hit on SDL debug code
2005-05-24 03:11:38 +00:00
taylor d363f55686 quick catch for some corrupted anis, only a partial fix but it will do until something
a bit more heavy duty comes along in the near future
2005-05-23 05:58:31 +00:00
taylor 0610b5e051 Jens, again:
- compiler warning fixes
 - sanity and readability fixes for bmpman
2005-05-23 05:56:26 +00:00
taylor e02157b394 more from Jens...
- make sure that a frame number doesn't get carried over to non-animated weapon glows
 - move the line splitting code in missiontraining.cpp so that we don't have to worry about EOS chars
2005-05-23 05:55:13 +00:00
phreak 1aafce7240 fix out of bounds error 2005-05-23 04:58:43 +00:00
phreak a73e6686d0 compile warning fixage. 2005-05-22 22:47:19 +00:00
taylor 75ecd13e2c a medals crash fix that isn't influenced by the evil Java empire (Jens Granseuer) 2005-05-18 14:03:27 +00:00
taylor b3235d9998 some basic Polish language support from the icculus.org version (Janusz Dziemidowicz) 2005-05-18 14:01:31 +00:00
taylor 71cb920cab a few help text adjustments and fix some compiler warnings 2005-05-18 01:57:54 +00:00
taylor f0f3990738 Initial import of cfileextractor, still needs some work but does what it needs to 2005-05-17 21:00:57 +00:00
taylor a432fd8699 add building for cfileextractor 2005-05-17 20:59:23 +00:00
taylor f66759eac1 more autogen goodness from Jens
- remove old/unneeded checks (ie. we don't use libtool so don't check for it)
 - use --foreign rather than --gnu on automake so we can get rid of things like NEWS, etc.
2005-05-17 20:58:46 +00:00
taylor 4c8003fb8c more missed stuff from the vm_* macro change (thanks Alpha0) 2005-05-17 20:57:05 +00:00
phreak 4a8d5d19d3 reverted a tagged only commit, it wasn't needed 2005-05-16 15:40:43 +00:00
phreak 97778bd8ce custom loading screen fixage. 2005-05-15 21:40:31 +00:00
taylor 560ee745ea don't let the ogg callbacks close the file handle on us, let us do it ourselves to keep things straight 2005-05-15 06:47:57 +00:00
phreak c44cb63459 another tagged only turret fix 2005-05-14 21:48:22 +00:00
phreak f9cad9acb4 stop turrets from targeting non-bombs. also some tagged-only fixes. 2005-05-14 21:35:04 +00:00
phreak c225d664a2 fixed an out-of-bounds array bug 2005-05-14 21:34:17 +00:00
phreak 78d4b21830 medal_stuff needed a copy constructor and an overloaded assignment operator. 2005-05-14 16:16:48 +00:00
taylor 349a0cda5f unbreak joining (when forming, not in-game) (Jens Granseuer) 2005-05-13 23:10:17 +00:00
taylor ff36b6aa7b Ooops! Added the wrong version of the streaming patch from Jens 2005-05-13 23:09:28 +00:00
taylor fdb372e5a3 properly support multiple versions of automake (Jens Granseuer) 2005-05-13 23:08:39 +00:00
phreak 7089596664 possible fix for seeing suns through ships. shouldn't break anything. 2005-05-13 20:55:19 +00:00
taylor 9ff37eb37e more malloc->vm_malloc, free->vm_free, strdup->vm_strdup fixage 2005-05-13 02:56:34 +00:00
phreak dca9ba1202 fixed another minimum range bug that prevented the Colossus and the Beast from
properly engaging one another in the mission: Their Finest Hour (SM3-08)
2005-05-13 02:50:47 +00:00
taylor 359485654f missed a strdup to vm_strdup conversion 2005-05-13 02:47:58 +00:00
phreak 0a858b7b05 forgot a vm_strdup in place of a strdup 2005-05-13 02:41:24 +00:00
taylor e4131e25e4 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
2005-05-12 17:49:18 +00:00
taylor b4cc142d08 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
fix a few streaming errors in OpenAL code (Jens Granseuer)
temporary change to help deal with missing music in OpenAL Windows builds
don't assert when si->data is NULL unless we really need to check (OpenAL only)
2005-05-12 17:47:57 +00:00
taylor 7dbcf77914 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
reallocate sp->triggers with the real vm_realloc() rather than that manual method
2005-05-12 17:45:53 +00:00
taylor 23176b03dd use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
fix crash with Warning() message getting the wrong string
2005-05-12 17:44:02 +00:00
taylor ff31561484 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
try and keep up with how much VBO data is in memory too since that takes away from texture memory
2005-05-12 17:43:20 +00:00
taylor 6f55648495 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
set byte_mult to 2 for TCACHE_TYPE_AABITMAP to get the memory size right for Debug builds
2005-05-12 17:42:13 +00:00
taylor 122ddc2134 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
use correct GL VRAM texture number in OGL mode rather than the D3D number
2005-05-12 17:40:48 +00:00
taylor a110e19177 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
change system->decals allocation to use real vm_realloc() rather than that manual method
2005-05-12 17:39:13 +00:00
taylor c2700b4b9e add an extra gr_flip() after gr_clear() to make sure the change is made active 2005-05-12 17:37:48 +00:00
taylor 6a9f82eac5 use vm_malloc(), vm_free(), vm_realloc(), vm_strdup() rather than system named macros
fixes various problems and is past time to make the switch
for the game_busy() text during page in add a "BmpMan" so we know better what's going on
2005-05-12 17:36:59 +00:00
Goober5000 ee91e844ef added dialogs to the project file
--Goober5000
2005-05-12 14:02:57 +00:00
Goober5000 5fbc8f7e23 added a bunch of dialogs to wxFRED... thanks, taylor, for the GUI development :)
--Goober5000
2005-05-12 14:00:15 +00:00
Goober5000 62cfe8b61b whoops
--Goober5000
2005-05-12 03:51:17 +00:00
Goober5000 ef6b1a12f4 repeating messages with variables should work properly now
--Goober5000
2005-05-12 03:50:10 +00:00
Goober5000 f2d38d2f13 removed variables in messages for now
--Goober5000
2005-05-12 01:34:50 +00:00
phreak 76d763cd8e added mission flag that will not show enemy wing names, just the ship class. 2005-05-11 22:15:49 +00:00
Goober5000 35c25efdc7 fixed a docking bug
--Goober5000
2005-05-11 11:38:03 +00:00
Goober5000 8eea5e3446 grr
--Goober5000
2005-05-11 09:32:03 +00:00
Goober5000 1563378777 fixed a few of karajorma's bugs
--Goober5000
2005-05-11 09:28:32 +00:00
Goober5000 03137abad6 changed an Assert() to an Error()
--Goober5000
2005-05-11 09:27:35 +00:00
Goober5000 48af4d28a9 variables should now work properly in messages that are sent multiple times
--Goober5000
2005-05-11 08:10:20 +00:00
phreak bc45b7c1d8 clean out some old code 2005-05-11 02:16:17 +00:00
phreak 8f8afd10ff fix the problem where the fade in/out doesn't work if looking at a sun. 2005-05-11 02:15:07 +00:00
phreak 428dde26e4 reverted a change that WMC made. It made Goober mad and delayed the release of
3.6.6 by two months.
2005-05-11 00:25:42 +00:00
phreak 2b8b24f78a fixed a minimum weapon range bug that was causing turrets to fire at ships beyond
the actual range of a weapon.
2005-05-10 15:49:04 +00:00
phreak 33b64ccd98 if you're using all_turret_weapons_have_flags() with a WIF2_** flag, use
all_turret_weapons_have_flags_wif2().

Corrected some logic that would dump a valid target for turrets if its objnum is 0, as
opposed to -1.
2005-05-10 02:44:40 +00:00
phreak 7fa4c0f215 when finding valid weapons, set i to MAX_SHIP_PRIMARY_BANKS - 1 since i
is incremented at the top of the loop.  otherwise, we would pass over the first secondary
weapon in the bank.
2005-05-10 01:47:34 +00:00
wmcoolmon ee3624ccdb Code betterness 2005-05-08 20:39:10 +00:00
wmcoolmon 4631e6f31a Dynamically allocated medals 2005-05-08 20:38:32 +00:00
wmcoolmon 3232327c9d Various turret code changes in a vain attempt to make things more readable/work properly 2005-05-08 20:35:26 +00:00
wmcoolmon f3bc4e0425 Turret debugging code; Medals stuff; GUI_system change 2005-05-08 20:33:42 +00:00
wmcoolmon 790810ada9 Dynamically allocated medals 2005-05-08 20:28:57 +00:00
wmcoolmon 994f25cdf0 Change to GUI_system; this will probably break the lab, but is necessary for things to compile properly. 2005-05-08 20:27:51 +00:00
wmcoolmon c70c6005b3 Change to GUI_system (to prevent memory leaks and allow for auto-deconstruction) 2005-05-08 20:26:46 +00:00
wmcoolmon 63d1922367 "backspace" function 2005-05-08 20:23:28 +00:00
wmcoolmon 0c7adec15c armor.tbl revamp 2005-05-08 20:21:48 +00:00
tbird 3230a9eca9 Added project files for VC.NET 7.0 (the 2005 project files do not work in 7.0) 2005-05-04 00:30:56 +00:00
wmcoolmon 313d75276e Added variables to permanent location 2005-05-03 07:55:44 +00:00
wmcoolmon 045e29ae29 Removed variables files 2005-05-03 07:54:49 +00:00
wmcoolmon d0bace2c57 Added Bobb's variable system (with some minor compiler-warning fixes) 2005-05-03 06:33:07 +00:00
wmcoolmon aa61590ad3 Bah, stupid externs. :P 2005-05-02 22:36:54 +00:00
mrduckman a1569ff1c2 Added /NAMES command (Very needed to know who's in a channel :P) 2005-05-02 15:33:17 +00:00
phreak 39ea734595 bumped MAX_SPAWN_WEAPONS to 30 for inferno builds 2005-05-01 23:40:44 +00:00
phreak 471ed14f14 added CVS info to top of file. 2005-05-01 23:23:18 +00:00
phreak 2ce65069fb when creating the window take into account the top border 2005-05-01 23:17:46 +00:00
phreak 1270b04c97 fix the window from shrinking if a cutscene is played in windowed mode 2005-05-01 23:16:12 +00:00
phreak 0b959888c7 don't confine the cursor in d3d 2005-05-01 23:13:19 +00:00
wmcoolmon bd620e76dd -output_sexps command line 2005-05-01 07:13:59 +00:00
wmcoolmon 6f2fc71a7c Added (up-to-date) SEXP description info. 2005-05-01 06:18:58 +00:00
phreak 24774cf9cc buckets in sort_weapons_by_type() allocated on the heap instead of the stack. 2005-04-30 18:20:57 +00:00
phreak 79d41f9a59 ABbitmap should default to -1 2005-04-30 18:18:46 +00:00
phreak 6e69f08e65 bm_page_in_textures() should return if bitmap_num is any negative value, instead of just -1 2005-04-30 18:17:17 +00:00
wmcoolmon 529e3c47bd Removed FS2_DEMO defines that looked like they wouldn't cause the universe to collapse 2005-04-28 05:29:30 +00:00
wmcoolmon e01a6293d5 Cleared up some ambiguity that made MSVC 2003 go on strike 2005-04-28 05:12:26 +00:00
wmcoolmon e63b108e61 stuff_byte to stuff_ubyte 2005-04-28 01:39:14 +00:00
wmcoolmon 744a53ddf0 parse_ship uses stuff_bool_list; stuff_byte to stuff_ubyte 2005-04-28 01:38:32 +00:00
wmcoolmon ff0d52b1a4 More parsing flexibility 2005-04-28 01:36:46 +00:00
wmcoolmon fbc24176cd stuff_byte to stuff_ubyte; does the same thing, but with a better name. 2005-04-28 01:36:09 +00:00
wmcoolmon a7987b89be Switch stuff_string_white to stuff_string (I don't see why _white was used in the first place) 2005-04-28 01:32:57 +00:00
wmcoolmon 448027d119 Added stuff_bool_list; Internationalized stuff_boolean. 2005-04-28 01:12:19 +00:00
Goober5000 ec269425fd -made the XRC file parsed on load instead of embedded
-migrated wxFRED to wxWidgets 2.6.0
--Goober5000
2005-04-25 12:14:21 +00:00
taylor 7543e00581 newline fix 2005-04-25 06:36:25 +00:00
taylor 593ff86eeb use full size of Campaign_missions[] for simroom filtering, fixes the problem of campaign
missions still showing up in the single list even after filtering
2005-04-25 06:36:01 +00:00
taylor 46acd73b0b little cleanup so that debug and release build files don't have to be listed twice
add newer wxFRED2 files
2005-04-25 06:33:56 +00:00
wmcoolmon 7ed4e8985d Use parse_sound instead of code chunks 2005-04-25 00:34:00 +00:00
wmcoolmon 151c188018 Dynamically allocated engine washes; subsystem sounds; armor fixes. Line 4268 of ship.cpp, apparently, works properly; bears further looking into. 2005-04-25 00:31:14 +00:00
wmcoolmon 97cb2f5933 subsystem sounds 2005-04-25 00:28:58 +00:00
wmcoolmon a4d6350db0 MAX_SHIP_TYPES > Num_ship_types 2005-04-25 00:28:17 +00:00
wmcoolmon d0d7f35c76 Commented out unneeded array (Glide) 2005-04-25 00:27:32 +00:00
wmcoolmon 44f837acf8 Dynamically allocated engine washes; subsystem sounds 2005-04-25 00:26:53 +00:00
wmcoolmon 68ded37681 Windows have minimum size according to caption; made lab use another tree level so all ships can be seen 2005-04-25 00:24:34 +00:00
wmcoolmon f959265a74 Added parse_sound; replaced Assert() with an if() (The latter may not be a good idea, but it keeps missions from being un-debuggable) 2005-04-25 00:22:34 +00:00
wmcoolmon 01791870bc Center title screen, removal of unnecessary #ifdefs 2005-04-25 00:21:30 +00:00
wmcoolmon 365c12e99f Bumped console printing buffer size so people can play with the neb2 command 2005-04-25 00:07:22 +00:00
wmcoolmon d2eaea9a85 MAX_SHIP_TYPES -> Num_ship_types 2005-04-25 00:04:30 +00:00
Goober5000 18606cfb46 updated the project file
--Goober5000
2005-04-24 14:45:17 +00:00
Goober5000 658730bb4b wxFRED now uses XRC-based resources
--Goober5000
2005-04-24 14:42:27 +00:00
taylor 732d7f5561 really are too many changes here:
- remove all bitmap section support and fix problems with previous attempt
 ( code/bmpman/bmpman.cpp, code/bmpman/bmpman.h, code/globalincs/pstypes.h,
   code/graphics/2d.cpp, code/graphics/2d.h code/graphics/grd3dbmpman.cpp,
   code/graphics/grd3dinternal.h, code/graphics/grd3drender.cpp, code/graphics/grd3dtexture.cpp,
   code/graphics/grinternal.h, code/graphics/gropengl.cpp, code/graphics/gropengl.h,
   code/graphics/gropengllight.cpp, code/graphics/gropengltexture.cpp, code/graphics/gropengltexture.h,
   code/graphics/tmapper.h, code/network/multi_pinfo.cpp, code/radar/radarorb.cpp
   code/render/3ddraw.cpp )
 - use CLAMP() define in gropengl.h for gropengllight instead of single clamp() function
 - remove some old/outdated code from gropengl.cpp and gropengltexture.cpp
2005-04-24 12:56:43 +00:00
taylor 592899a5f5 little cleanup of laser rendering
- fix animated glows
 - proper alpha modification (still messed up somewhere though, shows in neb missions)
 - remove excess batch_render()
2005-04-24 12:47:36 +00:00
taylor a99518e88d possible dev/0 bug fix (Jens Granseuer) 2005-04-24 12:45:14 +00:00
taylor e3c8004429 make sure we don't build with speech support under Linux unless we specify it as a configure option 2005-04-24 12:44:25 +00:00
Goober5000 343e2537de fix0red the CVS log
--Goober5000
2005-04-24 08:27:17 +00:00
Goober5000 995ce3e17f made swarm/corkscrew/flak conflict more friendly
--Goober5000
2005-04-24 07:31:34 +00:00
wmcoolmon f630e1799e Enabled movies in windowed mode; if this causes problems for people, they can always use -dnoshowvid 2005-04-24 06:52:23 +00:00
Goober5000 ae8c507d37 eh, stupid quotes
--Goober5000
2005-04-24 05:53:15 +00:00
Goober5000 605b490d17 actually, I think this way works better
--Goober5000
2005-04-24 05:15:24 +00:00
Goober5000 ea491e3bed added FS2PATH environment variable and removed custom build stuff
--Goober5000
2005-04-24 04:47:58 +00:00
phreak 159c0affaf centered the window on the desktop if the -window command line is used. 2005-04-24 03:06:29 +00:00
wmcoolmon 2d7f231f47 Added resizing option to gr_shade. We can probably merge gr_shade and gr_rect; they do the same thing. 2005-04-24 03:02:43 +00:00
wmcoolmon 1417a0236a Might as well fix trainer messages too. 2005-04-24 03:01:56 +00:00
wmcoolmon f7e389eec4 Lowlevel (ie vertex buffer-mapping) functions for _rect and _shade 2005-04-24 02:40:40 +00:00
wmcoolmon 4f94da464d Context help fixing goodness 2005-04-24 02:39:36 +00:00
wmcoolmon 2e35d7571c Moved gr_rect and gr_shade to be API-nonspecific as the OGL/D3D functions were virtually identical 2005-04-24 02:38:31 +00:00
Goober5000 3575982079 subsystem fix
--Goober5000
2005-04-24 02:10:53 +00:00
wmcoolmon 6f93eb7ca8 Removed GL_SECTIONS 2005-04-23 01:17:09 +00:00
taylor 4dc7881df8 wurrps 2005-04-22 02:32:18 +00:00
wmcoolmon 131bac2b53 Minor updates to the GUI, and added some code that will (hopefully) resize HUD images in nonstandard resolutions. I couldn't test it; got an out of memory error. 2005-04-22 00:34:55 +00:00
taylor e030989f59 sexp to swap the skybox in mission, not tested in FRED, hopefully I didn't mess this up too much 2005-04-21 15:59:42 +00:00
taylor 51cc8377d2 initial changes to mission loading and status in debug builds
- move bmpman page in init to an earlier stage to avoid unloading sexp loaded images
 - small changes to progress reports in debug builds so that it's easier to tell what's slow
 - initialize the loading screen before mission_parse() so that we'll be about to get a more accurate load time
fix memory leak in gamesnd (yes, I made a mistake ;))
make sure we unload models on game shutdown too
2005-04-21 15:58:08 +00:00
taylor 5a75bba686 make sure we don't try to process chatbox_close() more than once 2005-04-21 15:53:24 +00:00
taylor d0ad20c79d stupid little comment fix, no big deal 2005-04-21 15:52:24 +00:00
taylor 1fe7c55885 fix source/dest memory overwrite that Valgrind was complaining about 2005-04-21 15:51:40 +00:00
taylor f63d3a01f1 we can't resize compressed textures so... don't, fixes rendering problems when not at max texture detail 2005-04-21 15:50:47 +00:00
taylor 981c2e4601 update of bmpman and model bitmap management, well tested but things may get a bit bumpy
- use VM_* macros for bmpman since it didn't seem to register the memory correctly (temporary)
 - a little "stupid" fix for dds bitmap reading
 - fix it so that memory is released properly on bitmap read errors
 - some cleanup to model texture loading
 - allow model textures to get released rather than just unloaded, saves bitmap slots
 - bump MAX_BITMAPS to 4750, should be able to decrease after public testing of new code
2005-04-21 15:49:21 +00:00
wmcoolmon fe81f39299 Nonstandard res fix. 2005-04-20 08:32:01 +00:00
wmcoolmon 3460e06701 Fix silly armor.tbl parse error. 2005-04-20 08:26:49 +00:00
phreak dd41824dc5 NMONO should not interfere with the debug window 2005-04-20 04:34:42 +00:00
phreak 72f1bb21ab get the cheat keys for "force weapon" working again 2005-04-20 04:34:01 +00:00
phreak 95db195410 CVS file header. take 1 2005-04-20 04:29:50 +00:00
phreak dc2e5a8ef9 fix for the slow firing turret problem 2005-04-20 04:27:56 +00:00
wmcoolmon 31f7d6dd34 Lock time compression when autopilot is engaged 2005-04-19 23:03:42 +00:00
taylor 904a63b7e5 try not to buffer output to the speech dev so that the text doesn't just show up some time in the future 2005-04-19 06:29:28 +00:00
taylor a8713687ae we might actually be needing to load a model here ;) 2005-04-19 06:27:54 +00:00
taylor 5f7ce77177 small compiler warning fixes, more 'always true' stuff 2005-04-19 06:26:56 +00:00
taylor 75f276cff4 don't try to allocate 0 bytes of memory when there are no shield tris, weird memory stuff frightens me 2005-04-19 06:25:23 +00:00
taylor a35470e783 8 months I've been meaning to put this in the Linux tree, me == moron 2005-04-19 06:22:20 +00:00
Goober5000 48959c177c model and class changes should be all set now
--Goober5000
2005-04-18 08:35:28 +00:00
Goober5000 a0e945bf21 better subsystem comparison
--Goober5000
2005-04-18 06:59:16 +00:00
Goober5000 a0305a1fc6 removed ship->alt_modelnum as it was essentially duplicates of ship->modelnum; changed the alt modelnum stuff accordingly
fixes for ship_model_change and change_ship_type
--Goober5000
2005-04-18 05:27:26 +00:00
taylor 78f22aea2f some extra checks to make sure we don't act on invalid gamesnds (fix for WCS) 2005-04-18 03:31:27 +00:00
taylor 777a5dbab0 more accurate play position for OpenAL when AL_BYTE_LOKI is used (Jens Granseuer) 2005-04-18 03:30:05 +00:00
Goober5000 0a72f49270 more sexp goodness
--Goober5000
2005-04-18 03:16:57 +00:00
taylor d4799821f8 updated Linux joystick code that's a bit less insane speed wise
remove ability to build without joystick support, no reason to keep it around
fix unusable warning flag with libjpeg building
2005-04-17 05:38:29 +00:00
phreak b87907a3be fixed lasers drawing backwards 2005-04-16 18:43:17 +00:00
wmcoolmon d950a6d8da Fixed the lab; Made the storybook look less grotesque without skins. 2005-04-16 08:13:34 +00:00
wmcoolmon af4ce5c886 Eh, what the hey. Maybe I should've taken the breathalyzer test. :) 2005-04-16 04:19:21 +00:00
wmcoolmon 7fd2b592b4 More optional tag-making for ships.tbl 2005-04-16 04:16:57 +00:00
wmcoolmon 1e4e53bf80 Minor changes; made even more fields in ships.tbl optional. 2005-04-16 03:36:13 +00:00
wmcoolmon 1745959ed7 Removed an unneeded semicolon 2005-04-16 03:05:05 +00:00
wmcoolmon 255570da57 Added type "exponential base"; equation is 'final_damage = (x^damage)' 2005-04-15 23:19:13 +00:00
taylor b24cd07398 fix ambient light 2005-04-15 11:42:27 +00:00
taylor 085db31507 stupid <expletive-delete> terminal, I <expletive-deleted> <expletive-deleted>!!! 2005-04-15 11:41:28 +00:00
taylor 092315362e new GCC = new warning messages, yippeeeecvs commit code/parse/encrypt.h code/parse/encrypt.cpp code/scramble/scramble.cpp 2005-04-15 11:36:55 +00:00
taylor 6a655dc469 add scramble port
support both FS1 (8bit and 7bit) and FS2 style encryption
2005-04-15 11:35:18 +00:00
taylor b217d73a44 proposes that WMC be subject to a breathalyzer test before commit ;) 2005-04-15 11:32:26 +00:00
taylor d78b715166 div-by-zero fix for snd_time_remaining() 2005-04-15 11:28:41 +00:00
taylor d55e7cc900 some cleanup to prevent utilities linking all game libs 2005-04-15 11:27:53 +00:00
wmcoolmon 443c49cbf9 It's amazing how many possible bugs you can catch simply by doing something completely different than coding 2005-04-15 07:19:29 +00:00
wmcoolmon 0cbd23c615 One final oops (hopefully). 2005-04-15 06:59:05 +00:00
wmcoolmon 55f7fdc264 Another oops. 2005-04-15 06:56:02 +00:00
wmcoolmon 7241244f70 Er, oops 2005-04-15 06:40:54 +00:00
wmcoolmon d0ed305d43 Local codebase commit; adds armor system. 2005-04-15 06:23:18 +00:00
Goober5000 b3e0314930 bumped sexp limit
--Goober5000
2005-04-14 20:03:16 +00:00
phreak 41fdb1da08 Updated the message of a required extension that hasn't been found.
It was referencing the old Glide engine.
2005-04-13 23:24:21 +00:00
Goober5000 3b2eee464a fixed the compile errors (thanks Phreak)
--Goober5000
2005-04-13 22:31:53 +00:00
Goober5000 b6980737f0 removed spurious folder
--Goober5000
2005-04-13 22:17:27 +00:00
taylor 039e34ffaa I totally blame that on the keyboard 2005-04-12 19:53:44 +00:00
taylor 99136873c0 more demo support (Jens Granseuer) 2005-04-12 19:22:48 +00:00
taylor 7516eae124 not sure what that file was doing there... 2005-04-12 19:22:00 +00:00
taylor 84a3455035 many, many compiler warning and header fixes (Jens Granseuer)
fix free on possible NULL in modelinterp.cpp (Jens Granseuer)
2005-04-12 05:26:38 +00:00
taylor 9b86e6966b more support for 'make dist' (Jens Granseuer) 2005-04-12 05:24:48 +00:00
phreak 8388a394c1 ambient light is set in mission 2005-04-12 02:10:09 +00:00
phreak 120c01f735 ambient_light_level added to the mission structure 2005-04-12 02:07:00 +00:00
phreak 189e5fe678 gr_set_ambient_light() function for the ambient light sliders in FRED 2005-04-12 02:04:56 +00:00
taylor fc35ceeffc changes to facilitate 'make dist' 2005-04-11 10:16:26 +00:00
taylor 8698cece32 un-revert previous revert since it does apparently affect MinGW (Alpha0) 2005-04-11 10:15:11 +00:00
taylor 30fc4cc19f some limits.h fixes to make GCC happier
revert timer asm change since it doesn't even get used with Linux and couldn't have been the slowdown problem
2005-04-11 05:50:36 +00:00
taylor 17ac979ae7 make sure use an insensitive case check for Messages[] names (Jens Granseuer)
little clarification of if-else block in message_training_que()
2005-04-11 05:48:34 +00:00
taylor e37bdddb71 _endthread() doesn't take an argument so do support one (Jens Granseuer)
debug variable fixes in freespace.cpp (Jens Granseuer)
as a safety catch we should Assert() on future usage of things we don't yet support in *nix _splitpath()
2005-04-11 05:45:38 +00:00
taylor be7f62118c some demo related fixes (Jens Granseuer) 2005-04-11 05:42:02 +00:00
taylor 7079b22535 add version checks for autoconf and automake
fix wacky wxFRED2 check (Jens Granseuer)
2005-04-11 05:40:21 +00:00
wmcoolmon 8b414664c5 Fixed some paths stuff. 2005-04-09 07:50:41 +00:00
wmcoolmon 0b89fec44c *crosses fingers* 2005-04-08 20:03:59 +00:00
wmcoolmon fb90a4caaf Did things in a somewhat less hackish manner; note that 'Update project' will only update the anjuta directory; you will have to update file, and then manually select the fs2_open/ directory to update *everything* 2005-04-06 18:47:02 +00:00
wmcoolmon 3e633a7021 Presumeably, I fixed building in anjuta for anyone who can run
autogen.sh
2005-04-06 18:22:49 +00:00
wmcoolmon 4f7a1a73c7 Fixed anjuta project file so it would run from projects subdirectory. 2005-04-06 18:12:17 +00:00
wmcoolmon 4dd746e46d Added some comments to the new turret helper functions. 2005-04-06 18:10:40 +00:00
taylor a89a6f6186 add audio files for OpenAL, build with USE_OPENAL define to use OpenAL 2005-04-05 12:03:03 +00:00
taylor 6c822c7993 fix memory error from GL extension list that occurs in certain circumstances 2005-04-05 11:50:57 +00:00
taylor 67eb07aae2 update what sound files get used 2005-04-05 11:49:37 +00:00
taylor 5a34ecf947 remove acm-unix.cpp, replaced by acm-openal.cpp since it's properly cross-platform now
better error handling for OpenAL functions
Windows can now build properly with OpenAL
extra check to make sure we don't try and use too many hardware bases sources
fix memory error from OpenAL extension list in certain instances
2005-04-05 11:48:23 +00:00
taylor 4df7becbea handle iostream problems on GCC pre-3.x
fix spacing on wxFRED stuff (yes, I'm that anal)
2005-04-05 11:41:33 +00:00
taylor 586190fb8e s/vector/vec3d/g, better support for different compilers (Jens Granseuer) 2005-04-05 05:53:25 +00:00
Goober5000 2059ed3528 tweaks
--Goober5000
2005-04-03 11:47:01 +00:00
Goober5000 fc42a097eb brought weapon loadout banks into agreement with ship info banks
improved error reporting on apply-to-all
--Goober5000
2005-04-03 08:48:31 +00:00
phreak ba27712ccd put First_secondary_index back in so FRED can compile.
The weapons list is also sorted whenever all loading is done so lasers and beams always
come before missiles.  FRED's loadout code needs this behavior to stick.
2005-04-02 21:34:08 +00:00
Goober5000 02fb161187 fixed a few errors in apply-to-all
--Goober5000
2005-04-01 08:50:25 +00:00
taylor 826be871bc fix hanging on exit with OpenAL
some better error handling on OpenAL init and make it more Windows friendly too
basic 3d sound stuff for OpenAL, not working right yet
2005-04-01 07:33:08 +00:00
taylor 6958a3be52 *that blasted Enter key*, just fixing the log... nothing to see here... 2005-04-01 07:31:10 +00:00
taylor 6576b9bf69 some minor Linux fixage 2005-04-01 07:29:40 +00:00
taylor 77a4348695 code/ship 2005-04-01 07:27:32 +00:00
taylor f1f9396d4f go back to 24-bit depth, 32 didn't help any with ATI bugs 2005-04-01 07:25:54 +00:00
mrduckman a550f19877 Made a change for wxWidget checks, checking for 2.4.2 version. 2005-03-31 21:12:23 +00:00
Goober5000 aea447768f whoops
--Goober5000
2005-03-31 12:45:22 +00:00
Goober5000 68c7b774e6 implemented the apply-to-all wing loadout button
--Goober5000
2005-03-31 12:43:51 +00:00
Goober5000 ce89e0d560 fix type mismatch
--Goober5000
2005-03-31 12:38:24 +00:00
Goober5000 111fa9a728 changed a bunch of literal constants to their #define'd keywords
--Goober5000
2005-03-31 11:11:56 +00:00
taylor 001f85c695 forget the swaps for OSX 2005-03-30 16:06:52 +00:00
taylor 23ab20680a a little Linux happiness 2005-03-30 16:06:26 +00:00
taylor aff41f6382 basic wxFRED2 building, only works on Linux for now 2005-03-30 16:05:42 +00:00
wmcoolmon cdfbe82f07 Whoops. 2005-03-30 05:37:22 +00:00
wmcoolmon 8316e86843 Made it so *Snd fields in ships.tbl and weapons.tbl take the sound name
as well as its index (ie "L_sidearm.wav" instead of "76")
2005-03-30 02:32:41 +00:00
Goober5000 591a76e0bd fixed version log
--Goober5000
2005-03-30 01:27:49 +00:00
Goober5000 a9ba9ccea8 added header back in, with a small tweak for the .cpp
--Goober5000
2005-03-30 01:23:32 +00:00
Goober5000 9d30ba0210 removed mixed-case header file
--Goober5000
2005-03-30 01:20:05 +00:00
Goober5000 5f32fc582f set up the main menu options
--Goober5000
2005-03-29 13:35:53 +00:00
Goober5000 c519d635f1 fixed browse info error
--Goober5000
2005-03-29 09:57:02 +00:00
Goober5000 272627527b wxFRED is now dependent on code.lib
--Goober5000
2005-03-29 08:15:44 +00:00
Goober5000 1406ef90ec whew... bare-bones "hello world" wxFRED base finally implemented!
--Goober5000
2005-03-29 07:55:19 +00:00
wmcoolmon fbad2dcdc0 Removed some warnings under Linux/GCC 2005-03-29 07:03:16 +00:00
wmcoolmon b24d6815bc Added some comments to #defines to make reading easier 2005-03-29 06:36:37 +00:00
wmcoolmon a28a052ac6 Fixed extern to compile under Linux 2005-03-29 06:28:52 +00:00
phreak 71c2ae7fca global variable "Jump_nodes" needs external linkage for FRED 2005-03-29 03:42:07 +00:00
phreak fb1d118622 get_num_elements() method, probably coded incorrectly, but its needed for FRED 2005-03-29 03:40:15 +00:00
Goober5000 1dbfce5ea7 added storybook to the MSVC6 project
--Goober5000
2005-03-29 02:50:48 +00:00
mrduckman b4e502737c Added OpenGL include dir parameters 2005-03-28 13:25:18 +00:00
taylor bbefc0b90e fix to snd_time_remaining() to make sure we are getting the correct index into Sounds[] 2005-03-28 00:40:09 +00:00
mrduckman fe8a8cc8e7 Syntax correction 2005-03-27 21:13:05 +00:00
mrduckman dbacdf939b Added /kill IRC Command 2005-03-27 21:06:31 +00:00
wmcoolmon 728ee7e21f Forgot to replace 'ship' with 'ai' after copy-paste 2005-03-27 17:33:51 +00:00
Goober5000 0f94de5dd8 bah 2005-03-27 13:37:15 +00:00
Goober5000 6351a5becf rewrote the weapon cheat cycle functions to avoid recursion
--Goober5000
2005-03-27 13:23:05 +00:00
Goober5000 881f1c6077 two new sexps
--Goober5000
2005-03-27 13:00:40 +00:00
Goober5000 2dfa5cdd45 clarified max hull/shield strength names and added ship guardian thresholds
--Goober5000
2005-03-27 12:28:35 +00:00
taylor 413cdab6b7 will hopefully fix the slowdown from mission to mission (thanks Alpha0) 2005-03-27 08:57:52 +00:00
taylor e4827d8110 this is what coding on an empty stomach will get you 2005-03-27 08:51:25 +00:00
wmcoolmon 7fe64c20b0 Bizarre combo of fopen() and close() 2005-03-27 08:12:53 +00:00
taylor 4dfb7611ed fill in some stuff for timer and mmio calls, not 100% but it works ok 2005-03-27 06:17:54 +00:00
taylor 233a8c3134 don't use a platform specific ifdef since the OpenAL code may work under Windows now too 2005-03-27 06:16:46 +00:00
taylor 885ab83dba mmio callbacks work on Linux now and fix problem where system ogg.h would get used rather than the local one 2005-03-27 06:15:31 +00:00
taylor 4df106d0e6 update for streaming support and platform independance 2005-03-27 06:14:30 +00:00
taylor 54707bc916 some pilot file fixing when going between multi and single (partial fix) 2005-03-27 06:12:38 +00:00
taylor 0d4ab080a9 make use of new OpenAL define since it's not platform specific anymore 2005-03-27 06:08:42 +00:00
taylor 3b3aafd920 weapon_num can be 0 so let that through 2005-03-27 06:07:54 +00:00
taylor a1509554e7 update with current files 2005-03-27 06:07:00 +00:00
taylor 3dd13913da initial import of OpenAL streaming (many thanks to Pierre Willenbrock for the missing parts) 2005-03-27 05:48:58 +00:00
taylor 6581a79466 unix specific version is obsolete 2005-03-27 05:47:31 +00:00
wmcoolmon f8b4ba66bc Fixed possible infinite loop problem
----------------------------------------------------------------------
2005-03-27 04:16:19 +00:00
wmcoolmon ab323f6b2a Fixed missing/invalid variables 2005-03-27 03:04:09 +00:00
wmcoolmon 535f8fc3d6 Forgot to define 'i' outside of for scope...ironically, in the OGL code. 2005-03-27 02:59:27 +00:00
wmcoolmon 8cba1f3939 Some fixes 2005-03-26 07:53:32 +00:00
wmcoolmon 18ddb1f6ad Cleaned out old code + fixed min problem 2005-03-26 01:49:46 +00:00
wmcoolmon dc3d359393 Added the storybook 2005-03-26 00:26:06 +00:00
Goober5000 31b5327765 removed unreferenced variable
--Goober5000
2005-03-25 22:36:01 +00:00
wmcoolmon 622ac05c63 Small change now that the storybook is in CVS 2005-03-25 07:35:22 +00:00
wmcoolmon 6319d41ab6 Updated MSVC6 project file for AI move 2005-03-25 07:12:05 +00:00
wmcoolmon 19ea0c5b11 Removed old AI files from CVS 2005-03-25 07:03:12 +00:00
wmcoolmon 9471ebced4 Added taylor's old-weapon code fix 2005-03-25 07:01:53 +00:00
wmcoolmon fbf776164b Big, massive, codebase commit. I have not removed the old ai files as the ones I uploaded aren't up-to-date (But should work with the rest of the codebase) 2005-03-25 06:57:38 +00:00
wmcoolmon feee088277 Initial AI code move commit - note that aigoals.cpp has some escape characters in it, I'm not sure if this is really a problem. 2005-03-25 06:45:13 +00:00
taylor 1630965ce8 I think I deserve a medal or something for that one :) 2005-03-25 01:10:51 +00:00
taylor bb556e9c7f s/gr_ogl_/gr_opengl_/g
add empty gr_opengl_draw_line_list() so that it's not a NULL pointer
make gr_opengl_draw_htl_sphere() just use GLU so we don't need yet another friggin API
2005-03-24 23:42:21 +00:00
taylor b0ec8041de make sure we don't go one over the number of message avis 2005-03-24 23:38:49 +00:00
taylor 9e329634b3 fix GCC building 2005-03-24 23:37:25 +00:00
taylor 7843ed8770 fix compiler warnings with mismatched types and unused variables
cleanup some debug messages so they can be turned off if needed
get rid of extra strstr() check for thrusters since it should never get that far anyway
page_in/page_out of model glows should be better now
removed a bunch of unneeded casts and get type specific math functions right
2005-03-24 23:36:14 +00:00
taylor 008582fce5 make sounds.tbl dynamic
"filename" will never be larger than 33 chars so having it 260 is a waste (freespace.cpp)
2005-03-24 23:31:46 +00:00
taylor 8ecfbed208 (re)move some uneeded variables to fix compiler warnings 2005-03-24 23:29:33 +00:00
taylor 851fc877d0 make sounds.tbl dynamic
have snd_time_remaining() be less stupid
some OpenAL error fixerage
be able to turn off some typically useless debug messages
2005-03-24 23:27:26 +00:00
taylor 3ff8fff6af use SWARM_MISSILE_DELAY again so that it's easier to keep up with
fix compiler warnings
2005-03-24 23:24:01 +00:00
taylor 74ae69a49b make sure we will get the right error message 2005-03-24 23:22:59 +00:00
wmcoolmon 3df75bed77 no more MSVC compiler warning 2005-03-24 05:50:07 +00:00
phreak 37034092d4 Starfield bitmaps should now draw in non-htl mode 2005-03-23 20:09:23 +00:00
phreak 8e98e16796 Some specular values in g3_draw_perspective_bitmap() were being incorrectly set. fixed that 2005-03-23 20:08:33 +00:00
taylor 1c2d7163c1 fix version check for drivers that support OpenGL 2.0+ 2005-03-22 00:36:48 +00:00
phreak 0e2d83529b Orb correctly displays in 640x480 2005-03-21 23:19:55 +00:00
phreak c1bc6871c3 Add a function to check whether any duplicate jumpnode names exist 2005-03-20 21:07:10 +00:00
phreak 12c6e04b17 export the functions that deal with the creation and destruction of the starfield buffer.
FRED needs them
2005-03-20 20:02:29 +00:00
phreak d2912daaac draw paths and docking points using HTL 2005-03-20 20:01:15 +00:00
phreak 983881e398 lol forgot to commit the function pointer stuff 2005-03-20 18:05:04 +00:00
phreak 822b4d9c01 high-level implementation for gr_draw_htl_line and gr_draw_htl_sphere 2005-03-20 00:11:27 +00:00
phreak 8074a129cd Added gr_draw_htl_line and gr_draw_htl sphere
There still needs to be D3D versions implemented, but OGL is done.
Follow that or ask phreak about how its implemented/
2005-03-20 00:09:07 +00:00
wmcoolmon 844ac565ef OpenGL display lists 2005-03-19 21:03:54 +00:00
Goober5000 40eeea76d8 corrected misinformation in comment about surface shields (implicit surface
shields were removed for meshed ships)
--Goober5000
2005-03-19 20:45:23 +00:00
wmcoolmon c7b5a70830 small bool fix 2005-03-19 20:35:45 +00:00
bobboau 4972df4cdf adding d3d state block files 2005-03-19 18:18:04 +00:00
bobboau 028fd5c930 added new graphic functions for state blocks
also added a class formanageing a new effect
2005-03-19 18:02:35 +00:00
bobboau 1397a84db7 added a geometry batcher and implemented it in sevral places
namely: lasers, thrusters, and particles,
these have been the primary botle necks for some time,
and this seems to have smoothed them out quite a bit.
2005-03-16 01:35:59 +00:00
phreak 9523481fe2 properly handle using the old method of selecting primary weapons.
i forgot a return statement so the new method was used instead
2005-03-16 00:37:42 +00:00
wmcoolmon 00a413d3b0 Commited placeholder turret funcs. 2005-03-16 00:18:31 +00:00
taylor dd6d061488 make sure w,h,bpp are useable before trying to assign values to them 2005-03-15 17:10:58 +00:00
Goober5000 038cb865be *fixed some sexp declaration formatting
*implemented string comparison sexps
*simplified numeric comparison sexps
*fixed numeric comparison (especially equals) sexps to actually work on all their arguments like they were designed to
--Goober5000
2005-03-15 07:26:52 +00:00
phreak f46914eab9 Awesome 2-for-1 deal!!!
Firstly, the Colossus should now warp out correctly.  No more warphole forming inside of it
Secondly, muzzleflashes now are generated at the gunmounts of the firing ship.
2005-03-15 01:40:07 +00:00
Goober5000 a71305bdc3 properly fixed the out-of-bounds error, as well as a few other errors of the same kind
--Goober5000
2005-03-14 23:34:59 +00:00
Goober5000 9ef30029aa rolled back Phreak's commit
--Goober5000
2005-03-14 23:33:22 +00:00
wmcoolmon 69231d79ff Hopefully this will fixx0r Num_sounds 2005-03-14 23:31:54 +00:00
wmcoolmon 22a4cfc835 Whoops, this isn't needed. 2005-03-14 06:38:31 +00:00
wmcoolmon db1c760a3c Commented out now-unneccessary Int3() 2005-03-14 06:38:06 +00:00
wmcoolmon 70f831bc22 Added memory display thingy to loading screen, if command line is specified and build is a debug build. Also made screenshots go up to 9999 2005-03-14 06:36:30 +00:00
wmcoolmon c20117ef22 Made sounds dynamically allocated 2005-03-14 06:33:38 +00:00
taylor 0e92b61ebf fix for mouse cursor problem when running in a window 2005-03-14 03:38:54 +00:00
taylor f36b06ee40 speedup grow/shrink time for the warp to avoid the big size skips 2005-03-14 03:24:25 +00:00
phreak 5739cfb2d0 Got rid of the stealth check that only applied to cloaked ships. This should
fix some errorneous behavior that caused the ai to target the player
2005-03-14 02:52:58 +00:00
taylor 7b8ff3d087 enable 32-bit to 16-bit TGA conversion with -tga16 cmdline option (experimental)
fix crash when upgrading from original campaign stats file to current
2005-03-13 23:07:36 +00:00
wmcoolmon 087c0be980 Squashed compiler warnings 2005-03-13 08:44:10 +00:00
wmcoolmon 1f1153bc57 Commented out unneeded variables 2005-03-13 08:38:05 +00:00
wmcoolmon c54e4875bd Might as well sync this 2005-03-13 08:37:01 +00:00
taylor 06dc37d064 gotta use MIN/MAX and not min/max now 2005-03-13 08:33:55 +00:00
wmcoolmon c32522129b Hud fixing goodness. I also removed some obsolete code for displaying HUD weapons. 2005-03-13 08:32:28 +00:00
taylor 0f50203063 fix various compiler warning messages
make sure screenshot count doesn't get too high
fix movies playing twice in redalert missions
reset time compression for redalert missions and cmdbriefings, just in case
2005-03-13 08:04:43 +00:00
phreak 50b2cd65fa extra checks in find_parent_rotating_submodel() 2005-03-12 23:53:27 +00:00
phreak a036fc3bea doubled default spawn angle from 180 to 360 since it seems to track better 2005-03-12 21:08:01 +00:00
phreak b2c098ee44 the code for the damaged-escort-priority-all sexp started
overwriting outside ofarray bounds.  goodbye call stack... erm goodbye bug.
2005-03-12 20:48:33 +00:00
taylor 1f92bafc8f helps to get the stupid check right 2005-03-12 19:28:47 +00:00
taylor 50baf2c401 forgot this one, jpeg stuff 2005-03-12 07:42:05 +00:00
phreak 440b39a3ee Fixed a bug where the orb would incorrectly render under alternate FOVs.
Updated the functions that scramble the contacts so the blips show up
somewhat near where they should be.
2005-03-12 06:03:07 +00:00
wmcoolmon ed45cfb078 whee! 2005-03-12 05:21:36 +00:00
taylor 249bfeb9fe absolute header location for jpeglib.h in jpgutils.cpp (thanks WMC)
update VC6 project files to correct versions that work properly with internal libjpeg
2005-03-12 04:59:15 +00:00
wmcoolmon 68ec71efad Fixx0red odd drag problems 2005-03-12 04:44:24 +00:00
wmcoolmon a42a4ec0f0 New commandline option "-noparseerrors" 2005-03-12 03:09:55 +00:00
taylor 4504bea340 was causing strange hangs due to really large values, don't know if this will help but SDL should take care of error checking this way 2005-03-11 14:16:02 +00:00
taylor d395341b1c forgot to remove this with the MIN/MAX change 2005-03-11 14:14:05 +00:00
taylor a3f509766a apparently this change never got in 2005-03-11 14:11:53 +00:00
taylor 69130eb9fe ignore the typical build specific files 2005-03-11 14:00:01 +00:00
wmcoolmon bac63f2faf Isn't the extern needed too? causes linking errors on my system w/o it, although it compiles fine. 2005-03-11 01:37:35 +00:00
wmcoolmon bedf8a6157 Not really. I've got lib files in my main VC.NET libs directory, and include files in grouped subdirectories under my VC.NET include directory. it keeps my HD free of scattered SDK directories and helps keep conflicts down. 2005-03-11 01:34:19 +00:00
wmcoolmon 947e8b16fb Oops, gotta remember to commit main codebase stuff when fixing FRED 2005-03-11 01:28:23 +00:00
wmcoolmon fd9f14053a I like comments 2005-03-11 01:27:17 +00:00
taylor 4821082a53 fix screwed up stars coloring in OGL 2005-03-10 21:16:16 +00:00
taylor 56774f66d0 maybe WMC can leave the include alone now ;) 2005-03-10 16:16:52 +00:00
taylor 76b12d5465 build file updates to use the internal jpeglib now 2005-03-10 16:15:18 +00:00
taylor fcac6d58c2 internal libjpeg files 2005-03-10 16:13:54 +00:00
taylor f3dcea6db1 initial libjpeg project file 2005-03-10 16:10:47 +00:00
bobboau 030267adf3 fixed a local/global conflict 2005-03-10 15:35:21 +00:00
taylor 119a28190f change min/max to MIN/MAX to fix GCC problems
add lab stuff to Makefile
build unbreakage for everything that's not MSVC++ 6
lots of warning fixes
fix OpenGL rendering problem with ship insignias
no Warnings() in non-debug mode for Linux (like Windows)
some campaign savefile fixage to stop reverting everyones data
2005-03-10 08:00:18 +00:00
wmcoolmon dfcf412627 Commit for Bobboau. This causes the lab to crash in some circumstances. 2005-03-09 23:45:18 +00:00
bobboau 386efe7325 added a new interface render funtion 2005-03-09 03:23:32 +00:00
Goober5000 d63f7075a9 whoops 2005-03-08 04:41:39 +00:00
Goober5000 a24fde6280 edited for language ;)
--Goober5000
2005-03-08 03:50:25 +00:00
bobboau c78c8c0a43 minor change to high level render target code 2005-03-08 02:31:51 +00:00
Goober5000 1fdfc4bca8 rolled back my original code on the support ship CTD; thanks taylor :)
--Goober5000
2005-03-07 20:12:36 +00:00
bobboau bf878a6322 commit of render target code, d3d should be totaly functional,
OGL still needs implementation.
2005-03-07 13:10:22 +00:00
taylor a77e725968 can't believe I missed something that obvious. *hides in shame* 2005-03-06 17:16:08 +00:00
taylor e69a6f945b don't Assert() when repair_objp is NULL (support ship object is invalid until it's done with warpin) 2005-03-06 16:43:40 +00:00
wmcoolmon c6e589c31a Whoops! 2005-03-06 11:32:40 +00:00
wmcoolmon cc62873cb3 RE-fixed stuff. Ogg support. Briefings. 2005-03-06 11:23:45 +00:00
wmcoolmon e27299e03b Switched out model_unload with model_page_out_textures, as it was causing crashes in release mode. 2005-03-06 08:30:22 +00:00
wmcoolmon c2d671deac fix0r for negative values in textboxes, and ubytes 2005-03-05 20:46:12 +00:00
taylor 70d2885e0b make sure we don't scale the restore_screen bitmap, it's already the correct size 2005-03-05 19:11:07 +00:00
taylor ff7451ccc0 don't let hud messages walk off screen when res is GR_640 2005-03-05 18:59:28 +00:00
bobboau a09aba049c made all the gr_d3d_tmapper variants use dynamic a vertex buffer rather
than drawprimitiveup, this also means that these functions can now
handle as much poly data as you might want to through at them
2005-03-04 03:24:44 +00:00
taylor 6be13dc50b animated beam muzzle glows 2005-03-03 16:40:29 +00:00
taylor 6b54aa9784 lockup fixes, and it's Linux friendly too :) 2005-03-03 16:18:19 +00:00
taylor b5381eb23e support for TMAP_FLAG_TRILIST
extra check to make sure OGL closes down right under Windows
increased depth buffer, it was too small to compare when 32bpp was used
2005-03-03 16:16:55 +00:00
bobboau a600ceca96 fixed a small error from my earlier commit. 2005-03-03 14:29:39 +00:00
Kazan f4296903ce !Om_tracker_flag = non-pxo 2005-03-03 12:58:25 +00:00
Goober5000 abeaab1602 AUGH! Stupid hidden bugs... this one is V's fault
--Goober5000
2005-03-03 08:41:53 +00:00
wmcoolmon 00211ea1f0 Added new files to the project. Hopefully this works; I have no way to test it. 2005-03-03 08:16:26 +00:00
wmcoolmon ca97992985 Oops 2005-03-03 07:32:55 +00:00
wmcoolmon 8850cbcb38 Removed my Assert(true)s :p 2005-03-03 07:30:15 +00:00
wmcoolmon 382e540086 Made HUD shield icon auto-generation off unless "generate icon" ship flag is specified for the ship. 2005-03-03 07:13:17 +00:00
Goober5000 b9d5898908 removed the "error" in the new docking code
--Goober5000
2005-03-03 06:41:40 +00:00
wmcoolmon 20c60b021f Merge of WMC's codebase. "Features and bugs, making Goober say "Grr!", as release would be stalled now for two months for sure" 2005-03-03 06:05:32 +00:00
taylor f81a818afa well that was good and wrong 2005-03-03 05:32:11 +00:00
wmcoolmon 58b5bae0cb Turret AI code optimizations. If freaky stuff happens, call WMC() 2005-03-03 03:55:03 +00:00
wmcoolmon 69e5efdd91 This should really be like this to prevent crashing 2005-03-03 03:53:18 +00:00
bobboau 811c572cf8 added trilist suport to the poly rendering functions
and a gr_bitmap_list function that uses it
2005-03-03 02:39:14 +00:00
taylor 0c6f8bbefd use the back buffer for screen saves, this didn't work on Windows at one
point but I'm out of things to try and it may be ok after other fixes
2005-03-03 00:33:41 +00:00
taylor a58856e0d5 more NO_NETWORK/INF_BUILD goodness for Windows, takes care of a few warnings too 2005-03-02 21:24:48 +00:00
taylor 9ce18ac6e5 better support for Inferno builds (in PreProcDefines.h now, no networking support)
make sure NO_NETWORK builds are as friendly on Windows as it is on Linux/OSX
revert a timeout in Client.h back to the original value before Linux merge
2005-03-02 21:18:20 +00:00
taylor 5bdb318371 that one should never have slipped passed me (Linux specific) 2005-03-02 03:13:00 +00:00
taylor 3659d10464 make sure starfield bitmaps render when not in HTL mode
slight header fix for osapi.h
add some string overflow protection to modelread and bmpman
s/NO_NETWORKING/NO_NETWORK/g  (Inferno builds)
2005-03-01 23:08:24 +00:00
taylor bf26a96691 unbreak Linux build (not valid C/C++ anyway, block scope) 2005-03-01 23:05:38 +00:00
bobboau 4625702437 oh, hey look I've commited something :D
animation system, weapon models detail box alt-tab bug, probly other stuff
2005-03-01 06:55:45 +00:00
taylor 438f9360e1 uugh, missed the initial tree move (WMC: probable locking problem) 2005-02-28 01:24:02 +00:00
wmcoolmon d54288be7f Removed unneccessary variable 2005-02-28 00:29:52 +00:00
wmcoolmon 3f2266581c Added a white component to lightning so it isn't just a big blue block 2005-02-27 23:42:07 +00:00
wmcoolmon 5085b17246 Some HUD work 2005-02-27 23:27:50 +00:00
Goober5000 ecd3f09e74 First stage of "apply to all ships in this wing" weapon loadout button code.
Button hooks only, pending interface art.  The "apply-to-all" code itself
still has to be written.
--Goober5000
2005-02-27 14:09:27 +00:00
wmcoolmon aa8a4447ef Nonstandard res stuff 2005-02-27 10:38:06 +00:00
wmcoolmon 0ea465d45f More nonstandard res stuff 2005-02-27 07:08:22 +00:00
wmcoolmon 6c1468d59d nonstandard res HUD stuff 2005-02-27 07:07:47 +00:00
taylor 345a4b396d few more compiler warning fixes (didn't mean to commit iostream.h change)
lower warning level to 3 to stop MSVC6 from complaining about C++ headers
2005-02-23 13:17:05 +00:00
taylor ed21106256 more consolidation of various graphics variables
some header cleaning
only one tmapper_internal for OGL, don't use more than two tex/pass now
seperate out 2d matrix mode to allow -2d_poof in OGL and maybe fix missing
   interface when set 3d matrix stuff doesn't have corresponding end
add dump_frame stuff for OGL, mostly useless but allows trailer recording
2005-02-23 05:11:13 +00:00
taylor 5b28717fec compiler warning fixes (for MSVC++ 6)
have the warp effect only load as many LODs as will get used
head off strange bug in release when corrupt soundtrack number gets used
   (will still Assert in debug)
don't ever try and save a campaign savefile in multi or standalone modes
first try at 32bit->16bit color conversion for TGA code (for TGA only ship textures)
2005-02-23 05:05:39 +00:00
taylor 85ff0f7030 even more bm_unload() -> bm_release() changes 2005-02-23 04:57:29 +00:00
taylor df2d335539 more bm_unload() -> bm_release() changes 2005-02-23 04:55:09 +00:00
taylor 144429e984 some bm_unload() -> bm_release() changes to save bmpman slots 2005-02-23 04:51:56 +00:00
wmcoolmon 9cf34e208c Multi-res support 2005-02-21 09:00:58 +00:00
Goober5000 f64849dc72 restored release version of some cheat codes; removed a cheat for cloaking
--Goober5000
2005-02-21 05:40:16 +00:00
wmcoolmon 853b8e79f3 Camera code updates (subtitles) 2005-02-20 23:14:00 +00:00
wmcoolmon 6a6069354d Trails stuff, moved ship docking func declaration so FRED could get to it. 2005-02-20 23:13:01 +00:00
wmcoolmon d66b99c9f4 Fix0r3d trails 2005-02-20 23:11:51 +00:00
wmcoolmon c195c0aaf2 More trails updating goodness 2005-02-20 08:24:19 +00:00
wmcoolmon d7f483708a Smartified shipcontrails 2005-02-20 08:22:48 +00:00
wmcoolmon 333c370d71 Trails update: Better, faster, stronger, but not much more reliable 2005-02-20 07:39:34 +00:00
Goober5000 c5222f828c restored original behavior for cheat code time dilation
--Goober5000
2005-02-20 05:22:44 +00:00
wmcoolmon a828e0e934 Removed trails limit 2005-02-19 07:57:03 +00:00
wmcoolmon 9c87d92c91 linklist isn't needed for this 2005-02-19 07:52:56 +00:00
wmcoolmon 833e99e6a7 OpenGL gradient fix for nonstandard resolutions 2005-02-19 07:50:15 +00:00
wmcoolmon af3332d595 Fixes for debriefing window in nonstandard res 2005-02-18 21:14:03 +00:00
wmcoolmon 97119e182a Fixed line misalignment at nonstandard res in the campaign room 2005-02-18 20:50:40 +00:00
wmcoolmon a504a33138 More nonstandard res fixing 2005-02-18 09:58:40 +00:00
wmcoolmon cd741318d3 Since the screen can be wider than 1200 px now, don't auto-cull brackets if they're that big. 2005-02-18 09:54:41 +00:00
wmcoolmon d0f50e30e4 Updates for better nonstandard res support, as well as a fix to the Perseus crash bug I've been experiencing. Bobb, you might want to take a look at my change to grd3d.cpp 2005-02-18 09:51:07 +00:00
Goober5000 2ab0a4a032 really fixed the build warning
--Goober5000
2005-02-18 09:03:34 +00:00
wmcoolmon f73d8075c6 If a vertex buffer fails to be made, don't crash. 2005-02-18 08:05:16 +00:00
wmcoolmon fc8e4a077e Attempt to get rid of compiler warnings 2005-02-18 05:24:26 +00:00
wmcoolmon 83272bbd2f Added $Tech Model (after +Tech Description) 2005-02-18 04:54:44 +00:00
wmcoolmon 153526208d "-ingame" command line option 2005-02-16 10:00:40 +00:00
taylor d553a0d2c5 fix cleanup to avoid breaking the slider when it's still needed 2005-02-15 02:15:04 +00:00
taylor 5732d2f126 clean up some model related globals
code to disable individual thruster glows
fix issue where 1 extra OGL light pass didn't render
2005-02-15 00:06:27 +00:00
taylor 88950ad717 don't try and draw starfield bitmaps if they aren't valid
make AB thruster stuff in ship_create() a little less weird
replace an Int3() with debug warning and fix crash in docking code
make D3D Textures[] allocate on use like OGL does, can only use one anyway
2005-02-15 00:03:36 +00:00
taylor 60d1234579 make hudparse GCC 3.4 friendly (WMCoolmon way want to check this with tbl)
fix OSX compile problem
debug message in weapons_page_in() should have been real debug message
2005-02-14 23:59:23 +00:00
taylor 74f77cf920 fix mouse click issues in weapon/ship select screen
skip real VCR controls for Closeup check rather than using hardcoded values
2005-02-14 23:56:51 +00:00
taylor 7192f32409 make loading screen shader a bit taller
add i.o to credits for Linux and OSX code
add libjpeg and ogg stuff to credits for license compliance
replace an Int3() with a debug message in the hud code
2005-02-14 23:54:11 +00:00
wmcoolmon b1d397e91b More explicit calculation handling 2005-02-13 08:42:41 +00:00
wmcoolmon 42cbf081d0 3D models in weapons selection screen and nonstandard resolution fixes for ship selection screen. 2005-02-13 08:41:25 +00:00
wmcoolmon ddc47ef2f2 nonstandard resolution-friendly function updates 2005-02-13 08:38:54 +00:00
wmcoolmon 931f4f2df6 Made messages display properly in nonstandard resolutions 2005-02-13 08:37:57 +00:00
wmcoolmon 97c87a6bf8 Lockon should now work properly in nonstandard resolutions 2005-02-13 08:36:51 +00:00
wmcoolmon 85386190d2 while loops are dangerous things... 2005-02-12 22:49:24 +00:00
taylor 0ffcef0fc8 fix Error() check so that it doesn't hit on MAX_BUFFERS_PER_SUBMODEL-1 2005-02-12 12:17:54 +00:00
taylor 96645bff74 fix possible crash in bm_get_section_size()
get jpeg_read_header() working properly
VBO fixes and minor optimizations
2005-02-12 10:44:11 +00:00
taylor 9bd125e1de fix an issue with bm_set_components()
abs is for ints fabsf is for floats (camera.cpp)
make the in-cockpit stuff OGL friendly
2005-02-10 14:38:50 +00:00
wmcoolmon 5b549c7d4a Got rid of a couple annoying compiler warnings 2005-02-10 04:05:42 +00:00
wmcoolmon 550ef67140 Addition of the -clipdist argument. 2005-02-10 04:02:37 +00:00
wmcoolmon 7be677573e Low-level code for better hi-res support; better error reporting for vertex errors on model load. 2005-02-10 04:01:43 +00:00
taylor 65bea0960c update/add .cvsignore files for project file changes
silence warning about depreciated strings.h stuff for MSVC 2005
final model_unload() stuff for WMCoolmon, put in missionweaponchoice.cpp
remove really old project files
2005-02-08 23:49:59 +00:00
taylor 0ddb694d5c moved to projects 2005-02-08 05:19:34 +00:00
taylor de6cadea7d moved to projects directory 2005-02-08 05:18:02 +00:00
taylor fd8c41243e add something to the README about projects 2005-02-08 05:14:17 +00:00
taylor 40193dcfa7 new projects directory and files 2005-02-08 05:11:19 +00:00
taylor 75d63a8bb5 should fix linker error in libjpeg 2005-02-07 08:33:14 +00:00
wmcoolmon 5d1ca5e7c6 Updated camera code 2005-02-06 22:21:25 +00:00
taylor a685b68033 more post merge happiness 2005-02-05 04:15:36 +00:00
taylor 36da5e1a16 add libjpeg and ogg stuff 2005-02-05 00:52:51 +00:00
taylor ab78ba209c fix a few things post merge 2005-02-05 00:30:49 +00:00
taylor 4ae7263242 merge with Linux/OSX tree - p0204-3 2005-02-04 23:29:32 +00:00
taylor b1128630e4 merge with Linux/OSX tree - p0204-2 2005-02-04 20:06:10 +00:00
taylor b906b0fcce merge with Linux/OSX tree - p0204 2005-02-04 10:12:33 +00:00
phreak b723200206 revert to default d-missile behavior if the electroinics parameters aren't specified.
added an option to customize the old-style disruption calculation as well.
2005-02-03 01:26:45 +00:00
taylor 81d967eab5 only model_load() if we using a ship other than the current one 2005-02-02 15:09:06 +00:00
taylor 2673720ce8 merge with Linux/OSX tree - p0202 2005-02-02 10:36:23 +00:00
taylor 03bb0c45a4 OGG fix for streams 2005-02-01 06:54:20 +00:00
taylor 8eef49b990 merge with Linux/OSX tree - p0131-2 2005-01-31 23:27:55 +00:00
taylor 40516e52a4 merge with Linux/OSX tree - p0131 2005-01-31 10:34:40 +00:00
taylor 7a31d39759 merge with Linux/OSX tree - p0130
remove extra brace in cfile.cpp
2005-01-30 18:32:42 +00:00
taylor 2407f4f0d9 it's -nosound not -noaudio 2005-01-30 14:09:29 +00:00
taylor fa0172afb0 merge with Linux/OSX tree - p0130 2005-01-30 12:50:08 +00:00
Goober5000 2952838d64 bah - rolled back the HTL fix that doesn't really work
--Goober5000
2005-01-30 10:49:26 +00:00
Goober5000 f9db9a5810 optional flags default to false I should think
--Goober5000
2005-01-30 09:36:19 +00:00
Goober5000 a26e7a0a49 nitpicked some boolean tests, and fixed two small bugs
--Goober5000
2005-01-30 09:27:41 +00:00
wmcoolmon 8400768e9a Make sure hudnavigation uses the correct draw_brackets_Square 2005-01-30 03:28:17 +00:00
wmcoolmon a51ff7379b This isn't needed anymore 2005-01-30 03:27:09 +00:00
wmcoolmon be4fa8cef9 HUD updates 2005-01-30 03:26:11 +00:00
wmcoolmon 8b4df0aaff Don't try and create a vertex buffer with no vertices (Seems to cause CTD) and fix to brackets in nonstandard res 2005-01-30 03:24:39 +00:00
wmcoolmon 85bd57fb74 Improved user-friendliness - give an Error instead of a CTD 2005-01-30 03:23:22 +00:00
wmcoolmon 3dba61c334 If a required string doesn't exist, give an error instead of a warning...doi. 2005-01-30 01:38:26 +00:00
wmcoolmon 84d991e191 Made a bunch of ship.tbl variables optional 2005-01-30 01:34:39 +00:00
phreak e4fd785fbd smart shield stuff. enabled by command line for now, but this will be changed in the future, i just want people to test it.
-phreak
2005-01-29 16:31:55 +00:00
phreak 54a3a76774 smart shield command line stuff. this will be changed in the future, but i want people to test it.
-phreak
2005-01-29 16:30:47 +00:00
phreak 8a20ab1088 fixed error message again :)
-p
2005-01-29 15:40:22 +00:00
argv 2d41918dae Fixed compile errors due to several source files not having been updated to
reference "Min/Max_draw_distance" instead of "MIN/MAX_DRAW_DISTANCE".

-- _argv[-1]
2005-01-29 09:19:45 +00:00
wmcoolmon dae81d157b Clipping stuff 2005-01-29 08:12:20 +00:00
wmcoolmon a014e5227c When drawing the viewer_obj, temporarily clip less close up for in-cockpit models. 2005-01-29 08:11:41 +00:00
wmcoolmon 633bca17d9 Various updates; shader, clipping 2005-01-29 08:09:47 +00:00
wmcoolmon e19e89b20f Various updates; shader, assert, and clipping 2005-01-29 08:08:24 +00:00
wmcoolmon 9eba78035a Update to work with optimized shader func 2005-01-29 08:06:54 +00:00
wmcoolmon 68a26cf7d5 Ahh, the sweet smell of optimized code 2005-01-29 08:04:15 +00:00
Goober5000 e3077951ca docking fixes for FRED
--Goober5000
2005-01-29 05:34:30 +00:00
Goober5000 9d79b2e8d5 updated Freespace2 project
--Goober5000
2005-01-29 00:58:01 +00:00
Goober5000 ecd3cddeca added bitarray.h to the code project
--Goober5000
2005-01-29 00:37:10 +00:00
wmcoolmon 38de54f03a Added better too-many-textures error message 2005-01-28 23:45:23 +00:00
taylor 49d25dce7c less hacky and faster version... *hopes no one noticed the stupid mistake* 2005-01-28 13:26:14 +00:00
Goober5000 e4d74ff3cb fixed Bobboau's spelling of 'relative'
--Goober5000
2005-01-28 11:57:36 +00:00
Goober5000 c789bf7509 cleaned up some build warnings
--Goober5000
2005-01-28 11:39:18 +00:00
Goober5000 ee26a8a8f6 changed a bunch of transpose-rotate sequences to use unrotate instead
--Goober5000
2005-01-28 11:06:23 +00:00
taylor 06540c61b3 little cleanup to get rid of compiler warnings
add some memory management to help keep size of techroom down
new hotkey Ctrl-Shift-S to show all ships rather than just viewable
make Weapon_list allocate on load just like Ship_list
unload all textures and models on techroom_close()
2005-01-28 10:00:59 +00:00
taylor 72a5f1fa53 add model_page_out_textures() for use in techroom
make model_page_in_textures() load more textures
2005-01-28 09:56:44 +00:00
Goober5000 ba13b76ffe finished implementing docking to a rotating submodel
--Goober5000
2005-01-28 09:01:04 +00:00
phreak a70d0b3144 shockwave weapons now work properly with the electronics (d-missible) tag
added in a "randomness factor" for electronics parameters.  This adds or subtracts
a random value between 0 and this factor to the disruption time.  This was hard coded
to be 4 seconds in retail.
2005-01-28 04:05:05 +00:00
wmcoolmon a853432699 Better debrief memory handling 2005-01-28 03:00:56 +00:00
wmcoolmon afa8c96236 Fixed crash bug in techroom 2005-01-28 02:57:59 +00:00
Goober5000 88c4e9880b dock points on rotating submodels is *almost* working
--Goober5000
2005-01-27 11:26:23 +00:00
Goober5000 4ffaf24ab8 added a useful bit of information to vm_vec_rotate and vm_vec_unrotate
--Goober5000
2005-01-27 05:26:07 +00:00
wmcoolmon c2c4c1a4ea Ship autorepair, requested by TBP 2005-01-27 04:23:18 +00:00
wmcoolmon c09b89127b Camera code 2005-01-27 04:16:28 +00:00
Goober5000 291215d6a9 important bugfix
--Goober5000
2005-01-26 21:42:19 +00:00
phreak 23e73f2b0d added ogg and objectdock files to project 2005-01-26 14:57:19 +00:00
Goober5000 6f7f3296e0 hm... added a necessary bugfix for something very badly designed
--Goober5000
2005-01-26 06:58:37 +00:00
Goober5000 6c89a3310c whoops... need to free variable blocks for special hitpoints
--Goober5000
2005-01-26 06:49:50 +00:00
Goober5000 579972dd62 AHA... squashed another bug
--Goober5000
2005-01-26 05:44:10 +00:00
Goober5000 c7916f4483 fixed a nitpicky thing
--Goober5000
2005-01-26 05:42:37 +00:00
argv 3dff6606f2 Removed the implicit surface shield on mesh-shielded ships.
-- _argv[-1]
2005-01-26 03:40:43 +00:00
Goober5000 69ab027ecf Bah - I am a moron. :) I see the reason why rand shouldn't work
multiple times.  It's been fixed thus.

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

--Goober5000
2005-01-26 01:52:21 +00:00
Goober5000 ee175fcfd3 dockpoints now rotate with rotating subobjects
--Goober5000
2005-01-26 01:26:09 +00:00
Goober5000 bf2a2cf7cc species will now load from a default table instead of being initialized via code
--Goober5000
2005-01-25 23:32:46 +00:00
Goober5000 0094f97f3c more cool parsing stuff
--Goober5000
2005-01-25 22:47:37 +00:00
Goober5000 77cc78e5e7 separated one parsing function into two
--Goober5000
2005-01-25 22:21:45 +00:00
Goober5000 6f1eed006f streamlined some redundant stuff
--Goober5000
2005-01-25 21:28:58 +00:00
wmcoolmon 5b09ed5b78 Instead of trying to allocate a ridiculously large buffer if the file is defined but doesn't exist, give a warning. Someone with nebula-code experience should probably double-check this; also added jpg and TGA support. 2005-01-22 22:53:07 +00:00
wmcoolmon 86ad73d71b Nitpick - can be NULL by default 2005-01-22 22:02:28 +00:00
wmcoolmon 5017882299 Fix0red the ext error. Always make sure you have room for the string terminator. :) 2005-01-22 20:29:05 +00:00
taylor 7d6f0afc73 crap 2005-01-21 21:12:52 +00:00
taylor 8989ee4abf cleanup debug messages for texture loading making the output more readable and useful 2005-01-21 08:58:32 +00:00
taylor c85f1bfa4e make Subsys_status dynamic but allocate in blocks for speed and to help prevent memory fragmentation 2005-01-21 08:56:50 +00:00
taylor 0fe03690f8 slightly better memory management 2005-01-21 08:54:53 +00:00
taylor 227298f10b add -rlm cmdline option to switch to local viewpoint lighting calculations (OGL only for now) 2005-01-21 08:29:04 +00:00
taylor 388fa7ac45 fill in gr_opengl_set_texture_addressing()
add support for non-power-of-two textures for cards that have it
temporary crash fix from multiple mipmap levels in uncompressed formats
2005-01-21 08:25:15 +00:00
taylor 926c12c560 make sure we can still use TGAs (16-bit) when Cmdline_jpgtga is not set, PCX still takes precedence per retail 2005-01-21 08:20:44 +00:00
Goober5000 8cafc52ff3 fixed a crazy error
--Goober5000
2005-01-18 06:15:33 +00:00
Goober5000 6483947732 fixed a silly error
--Goober5000
2005-01-18 06:14:29 +00:00
Goober5000 8b6dab73be variables can be specified in training messages too now
--Goober5000
2005-01-18 01:20:03 +00:00
wmcoolmon 0d8d459deb OGG fixes, ship selection fixes 2005-01-18 01:14:17 +00:00
Goober5000 5f9778d505 clarified a bunch of sexp stuff and fixed a bug
--Goober5000
2005-01-18 00:14:37 +00:00
argv a023302cbb Surface shields.
See forum thread:
http://dynamic4.gamespy.com/~freespace/forums/showthread.php?s=&threadid=29643

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

--phreak
2005-01-13 02:25:52 +00:00
Goober5000 9aa9bfaaf1 forgot to remove a comment
--Goober5000
2005-01-13 01:10:33 +00:00
Goober5000 134a3668ae fixed another nasty bug
--Goober5000
2005-01-12 23:38:42 +00:00
Goober5000 00b0a8d148 fixed a nasty bug where dock pointers would run off a cliff and crash
--Goober5000
2005-01-12 04:45:33 +00:00
Goober5000 6111162808 two minor but important bugfixes to the multiple ship docking
--Goober5000
2005-01-12 00:52:42 +00:00
phreak 63d43fbfb0 new hud is deault off now. this should fix the disappearing gauges problem. 2005-01-12 00:20:27 +00:00
phreak 6f2275c4ab nude hud? was this some kind of freudian slip of a sort or what? 2005-01-12 00:18:00 +00:00
phreak 55b3af43e8 fixed hud offsets bug 2005-01-12 00:17:09 +00:00
Goober5000 144f8f3a4b multiple ship docking :)
don't tell anyone yet... check the SCP internal
--Goober500
2005-01-11 21:38:51 +00:00
Goober5000 0b5a25446a made a capitalization thing consistent
--Goober500
2005-01-11 21:28:24 +00:00
Goober5000 1ddc459df6 fixed two small things with physics
--Goober500
2005-01-11 21:25:58 +00:00
taylor cfe8a03ff3 fully working (??) -loadonlyused, allocate used_weapons[] and ship_class_used[] only when needed 2005-01-11 04:05:23 +00:00
wmcoolmon 3e4f71fe29 Bug-guard 2005-01-10 06:58:12 +00:00
wmcoolmon f236be7241 Debriefing screen updated to only use memory while open 2005-01-10 04:45:09 +00:00
wmcoolmon 18ac53bb5d Small fix, so we don't try to delete the same thing twice 2005-01-10 04:44:03 +00:00
wmcoolmon ebd866660e Techroom and Barracks now allocate memory only when open, and only for the number of ships currently loaded 2005-01-09 22:27:38 +00:00
wmcoolmon 4a4e834199 Fix for music directory parent 2005-01-09 21:40:07 +00:00
wmcoolmon eee1d07cf5 Sound quality in Freespace 2 is now controlled by SoundSampleBits, and SoundSampleRate. Also, some sounds will use hardware rather than software buffers if available. 2005-01-08 10:00:59 +00:00
wmcoolmon 6539724237 Function pointers to inline functions is a no-no... 2005-01-08 09:57:27 +00:00
phreak 21bb39d102 fixed the bug where the player couldn't use the target hud in reticle key. 2005-01-07 23:15:44 +00:00
argv 4a93077ddf Added missing #include.
-- _argv[-1]
2005-01-07 14:00:04 +00:00
Goober5000 30c6e6582b gah
--Goober5000
2005-01-06 00:39:34 +00:00
Goober5000 b8e4e24434 changed argument from dist to dist_squared
--Goober5000
2005-01-06 00:37:32 +00:00
Goober5000 926b788fc9 added vm_vec_dist_squared_to_line
--Goober5000
2005-01-06 00:27:34 +00:00
Goober5000 c425a9c12b small speedup in shpere_tri_edge (spelling should be fixed...); now distance is only calculated once
--Goober5000
2005-01-06 00:22:01 +00:00
taylor 15e395f6a4 make sure we're not loading weapons that are left over from larger missions 2005-01-05 23:17:38 +00:00
taylor cf35f79402 more -loadonlyused fixes 2005-01-03 18:47:06 +00:00
taylor 431812cd6d stupid mistake 2005-01-03 18:46:03 +00:00
taylor d0cf0ced4a dynamic allocation of num supported OpenGL lights
add config option for more realistic light settings
don't render spec maps in nebula to address lighting issue
2005-01-03 18:45:22 +00:00
phreak a6dbf2facd made custom loading screens work if only one resolution has been specified. 2005-01-03 01:05:08 +00:00
Goober5000 56da3a6bf6 got rid of a nasty nasty bug in the beam collision function, and cleaned up some of Bobboau's old comments
--Goober5000
2005-01-02 23:22:22 +00:00
taylor 55323b32f1 make use of MR_NO_FOGGING to render models without fog 2005-01-01 19:47:26 +00:00
taylor 49c005525e add MR_NO_FOGGING flag to easily render models without fog (warp model, targetbox models) 2005-01-01 19:45:32 +00:00
wmcoolmon fafb5bd1e8 Erg, always make sure CVS is completely up-to-date. 2005-01-01 19:37:05 +00:00
argv 075fdeaa5c Since Taylor's asteroid targeting code does not use the
TURRETS_SHOOT_ASTEROIDS #define, remove it from preprocdefines.h. We can
put it back from an old rev if people decide to use my code instead of his,
which seems unlikely.

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

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

-- _argv[-1]
2004-12-30 07:26:21 +00:00
taylor 7ae710ace6 make sure the file gets closed in pilot_file_upgrade_check() 2004-12-28 16:20:33 +00:00
taylor 611ce79893 fix some hud stuff getting drawn multiple times, don't show target data if HUD_disabled_except_messages is set 2004-12-26 22:45:58 +00:00
Goober5000 5ceb4a2291 hud-disable-except-messages now resets after each mission
--Goober5000
2004-12-26 20:46:34 +00:00
wmcoolmon 4f719b2c4d Fixed text not displaying for single-weapon sips. 2004-12-25 19:17:23 +00:00
wmcoolmon 4b5f47441b Quick update to tempfix possible bug. 2004-12-25 17:45:38 +00:00
wmcoolmon 6b3c4a3bbe Fixed a couple of blonde moments. 2004-12-25 17:02:18 +00:00
wmcoolmon 2f8c97d99d Fix to modular tables workaround with Fs2NetD 2004-12-25 16:42:59 +00:00
wmcoolmon 3d527efc50 Sync to current NEW_HUD code 2004-12-25 09:28:41 +00:00
wmcoolmon 7dd62135a3 Fix to modular tables workaround with Fs2NetD + Sync to current NEW_HUD code 2004-12-25 09:27:41 +00:00
wmcoolmon 4071a37ef4 Fix to modular tables workaround with Fs2NetD 2004-12-25 09:25:41 +00:00
wmcoolmon dd6eea5406 Ogg support for WIN32 2004-12-25 00:23:46 +00:00
wmcoolmon 840a2b37b5 Added .ogg in proper directories 2004-12-25 00:22:54 +00:00
Goober5000 762d41f41c resorted command-line options and added an option for WMC's ballistic gauge
--Goober5000
2004-12-24 19:36:12 +00:00
wmcoolmon e0b48bec6f NEW_HUD compiles now. :) 2004-12-24 05:07:05 +00:00
wmcoolmon 28b3a8cffa Proposed HUD system stuffs - within NEW_HUD defines. 2004-12-24 01:07:19 +00:00
wmcoolmon 431335b27d Ballistic primary ammo-gauge to the right of the HUD, support for weapon images in list. 2004-12-24 00:41:23 +00:00
wmcoolmon 237ae621a4 Removed unneccessary function call (.0000001 ms speed increase!) 2004-12-23 23:36:30 +00:00
wmcoolmon f959999594 Added +Hud Image: for weapons, which replaces the weapon name in the list with an image. 2004-12-23 23:35:02 +00:00
wmcoolmon 997d57faae Proposed HUD system stuffs - within NEW_HUD defines. 2004-12-23 23:30:45 +00:00
wmcoolmon 1f2a891c7a Proposed HUD system stuffs - within NEW_HUD defines. 2004-12-23 23:08:21 +00:00
phreak 911528b6d7 commits for scramble-messages and unscramble-messages
-phreak
2004-12-23 15:58:55 +00:00
phreak 9b6620e21c added a pragma message if DevIL isn't compiled into the build 2004-12-22 23:05:48 +00:00
taylor 17fc45faba add a popup to make sure people know about pilot upgrade 2004-12-22 21:49:05 +00:00
taylor 59add586e3 safety check against very large missions 2004-12-22 21:48:21 +00:00
taylor bb472f8669 version bump to 3.6.5 2004-12-22 21:47:37 +00:00
wmcoolmon 2f807f5793 Quick fix to hudparse.cpp; If this causes any problems, roll it back and I'll take another look at it. 2004-12-22 09:09:38 +00:00
fryday a770aeab31 Fixed a tiny error in bob's code in d3d_init_environment (which seems to be called even
if there's no -env command-line) which created the cube-map and didn't check
if the creation of it failed. Added the same sanity check to d3d_render_to_env
2004-12-20 20:28:15 +00:00
fryday afa8e9b947 Commented out ATL dependencies (And changed one macro to an swprintf instead)
Tiny change in animplay ( pow(2.0, ...) instead of pow(2, ...)) because VS2K5
throws an ambiguity error over that.
2004-12-20 20:18:30 +00:00
taylor 6c733d9f7b fix crash from dynamically allocated Personas 2004-12-17 06:43:01 +00:00
Goober5000 4474d26e5b move wing name initialization to ship_level_init
--Goober5000
2004-12-15 17:32:19 +00:00
Goober5000 9ca91d3518 commented dumbfire lead indicator back in, because you need to know where your missiles are going
--Goober5000
2004-12-15 15:22:23 +00:00
Goober5000 d4823f735a added Verify, an error checking macro that works in both release and debug modes
--Goober5000
2004-12-15 15:14:03 +00:00
Goober5000 4f87d063b8 new version of stristr that doesn't need to allocate memory
--Goober5000
2004-12-14 17:23:52 +00:00
Goober5000 eaae1243e6 allow different wing names than ABGDEZ
--Goober5000
2004-12-14 14:46:13 +00:00
wmcoolmon 3ce44dcdfa Apparently I never commited -mpnoreturn... 2004-12-11 09:37:50 +00:00
wmcoolmon 17f4291b70 Changed music modular table ending to *-mus.tbm, in case a miscellaneous modular table is needed. 2004-12-11 09:03:08 +00:00
taylor 31019d38a2 dymanic allocation of Personas 2004-12-10 17:21:00 +00:00
taylor bca69ce180 fix old V bug when cancelling the pilot select screen 2004-12-05 23:47:18 +00:00
bobboau f56c5d230e sevral feature additions that WCS wanted,
and the foundations of a submodel animation system,
the calls to the animation triggering code (exept the procesing code,
wich shouldn't do anything without the triggering code)
have been commented out.
2004-12-05 22:01:12 +00:00
taylor 45caba7c72 support uncompressed DDS images
use TexSubImage2D for video anis
2004-12-05 01:28:39 +00:00
taylor 0fc13dfa87 text of -no_set_gamma cmdline option shouldn't specify D3D since it works in OGL too 2004-12-02 11:20:33 +00:00
taylor f5b60aa156 make OGL use same gamma reg setting as D3D since it's the same ramp
have OGL respect the -no_set_gamma cmdline option
reset gamma to default on OGL exit to make sure the desktop doesn't stay wrong
2004-12-02 11:18:15 +00:00
taylor 023d5ffab0 not used at the moment but that code was stupid 2004-12-02 11:14:29 +00:00
taylor a4760e9c70 little reorg to flags so Experimental won't show up twice
add/update the wiki links since none of them worked before
remove all options that require an argument since they won't work
2004-11-29 18:04:53 +00:00
taylor a58587d3a5 make sure we are checking the right bitmap_id 2004-11-29 18:02:01 +00:00
taylor 3b35a4f9c1 more EFF fixes - can't believe I forgot all this crap 2004-11-27 22:08:21 +00:00
taylor 6ddaabcead Linux tree merge 2004-11-27 10:51:01 +00:00
taylor d706747bd1 correct positions for default graphics with no table
compiler warning fix
2004-11-27 10:50:32 +00:00
taylor 503ea74554 make sure the old behavior still applies to everything that's not a beam 2004-11-27 10:49:14 +00:00
taylor 128a6d840f some fixes for position problems on the HUD in non-standard resolutions
few compiler warning fixes
2004-11-27 10:48:03 +00:00
taylor a0b4747c57 this should get movies working again in D3D and help OGL too 2004-11-27 10:42:18 +00:00
taylor e237b9d8ba couple of LAN game vs. FS2NetD fixes 2004-11-26 08:41:11 +00:00
taylor 0bd342af4a fix briefing related crash(es) (forgot I had this) 2004-11-24 20:12:25 +00:00
taylor 1c8018a5ab fix 2d warp in D3D, add cmdline option for 3d warp 2004-11-23 19:29:13 +00:00
taylor 5760eaf5fc try and protect the bitmap_entry stuff a bit better
fix the transparent support ship, again, but correctly this time
2004-11-23 00:10:06 +00:00
taylor ea4341a938 make sure species_defs.tbl can be found outside of root[0] and in VPs 2004-11-22 06:17:57 +00:00
Kazan a410c7f132 dumbbugfix 2004-11-21 16:07:22 +00:00
Kazan 83f954520c conflict res 2004-11-21 15:59:45 +00:00
taylor 29963bfe39 support for animated beam sections
various weapon-only-used fixes
remove the -1 frame fix since it was fixed elsewhere
2004-11-21 11:38:17 +00:00
taylor 163b45fdab some weapon-only-used loading fixes and general page-in cleanup
page in all ship textures from one function rather than two
2004-11-21 11:35:17 +00:00
taylor 73eda1ee69 page in all frames at once rather than separately (old code that wasn't updated) 2004-11-21 11:33:23 +00:00
taylor 2ea42c0928 newline fix (got tired of seeing this) 2004-11-21 11:31:46 +00:00
taylor af3afff65c move warning fixes from il_func.cpp to irc.cpp since that's where they are coming from 2004-11-21 11:31:02 +00:00
taylor 1651717c41 make hud_disabled_except_messages() do everything at once, add it to hud_show_radar() and hud_show_target_model() so those don't show up (bug #271) 2004-11-21 11:29:53 +00:00
taylor 71b718a3b9 some 64-bit OS comaptibility fixes 2004-11-21 11:27:31 +00:00
taylor c619e7b3b7 split bm_load_sub() into fast (memory only) and slow (disk only) versions
EFF bug fix for fps and much better error handling
2004-11-21 11:26:39 +00:00
Goober5000 6e5ee3312d #pragma'd a bunch of warnings
--Goober5000
2004-11-18 00:05:37 +00:00
Goober5000 14b29354bb added two new sexps
--Goober5000
2004-11-17 22:23:13 +00:00
taylor 9460f0c613 don't set gamma ramp while running FRED 2004-11-04 22:49:13 +00:00
taylor ff083e9600 note to self: copy is down pat, now just learn how to paste, moron 2004-11-04 08:33:44 +00:00
taylor 008a450cfd animate weapon glow/bitmaps properly while in flight, make sure
we don't exceed bitmap frame numbers, don't try to calculate
frame for particle spew animations since particle_render_all()
does that for us already
2004-11-02 08:32:38 +00:00
Goober5000 1e5edb91a7 tweaked some project settings
--Goober5000
2004-11-02 01:48:20 +00:00
taylor 863475d8d0 make use of Knossos_warp_ani_used flag - thanks Goober5000 2004-11-01 20:57:04 +00:00
taylor 5194bb5f80 new pilot code 2004-10-31 22:07:27 +00:00
taylor 2c6f07a416 compiler warning fixes, maybe fix issue that would cause cap ships to not fire beam weapons 2004-10-31 22:06:42 +00:00
taylor 664c3bf797 s/OGL_inited/OGL_enabled/g 2004-10-31 22:05:30 +00:00
taylor 031b923385 be sure to initialize splodeing_texture, fix issue that would cause loading problems for glows 2004-10-31 22:04:33 +00:00
taylor db75f373b3 little cleanup 2004-10-31 22:02:47 +00:00
taylor d2badfc49e new bmpman merge support, add PreProcDefines.h a few new places 2004-10-31 22:00:57 +00:00
taylor 200588c3b0 support external parsing sources without hurting currently parsing file (for EFF code) 2004-10-31 21:57:30 +00:00
taylor 5511c94080 new bmpman support, new OGL fixes don't need the freaky neb lighting fix anymore 2004-10-31 21:56:09 +00:00
taylor e4460b46f3 s/fisrt/first/g 2004-10-31 21:55:00 +00:00
taylor bd3855b315 new pilot code support, no-multiplayer and compiler warning fixes, center mouse cursor for redalert missions 2004-10-31 21:53:24 +00:00
taylor 00f6a2ee32 fix math error that was hitting Assert()'s and making OGL models flip around for no reason 2004-10-31 21:49:49 +00:00
taylor 4594df128c faster setting of 0 spec values (Kazan), comment out second (dumbfire?) lead indicator since it just looked wierd constantly being offset 2004-10-31 21:48:42 +00:00
taylor a3b330bdf5 bmpman merge 2004-10-31 21:46:38 +00:00
taylor 01a1403f67 Linux tree merge, better DDS support, texture panning 2004-10-31 21:46:10 +00:00
taylor a09c6beb5c Linux tree merge, single array for VBOs/HTL 2004-10-31 21:45:13 +00:00
taylor d589bcd911 Linux tree merge, use linear mag filter, small FRED fix, AA lines (disabled), use rgba colors for 3dunlit, proper gamma adjustment, bmpman merge 2004-10-31 21:42:31 +00:00
taylor 401dbfc523 move some otherwise bmpman stuff into grd3dbmpman.cpp 2004-10-31 21:40:11 +00:00
taylor 6cc7c6fcbd bmpman merge 2004-10-31 21:39:24 +00:00
taylor 7e37fee039 reinit device if lost - one of the D3D people should make sure this isn't stupid 2004-10-31 21:38:25 +00:00
taylor 0e2d84c60e s/fisrt/first/g, bmpman merge 2004-10-31 21:36:39 +00:00
taylor 647a03d53c OGL_enabled, s/fisrt/first/g 2004-10-31 21:35:53 +00:00
taylor 97e7b62860 rename __ASSERT check to _ASSERT to fix constant warning message - why did no one else fix this? 2004-10-31 21:34:39 +00:00
taylor da03d81df6 rename OGL_inited to OGL_enabled to match D3D version 2004-10-31 21:33:05 +00:00
taylor 194717b0c8 no networking with Inferno builds, basic 64-bit OS support 2004-10-31 21:32:27 +00:00
taylor ccf5d144b5 bump COUNT_ESTIMATE, reset time compression at the start of a mission, new pilot file support, add feature_disabled popup 2004-10-31 21:31:34 +00:00
taylor 87552b959c lots of cleanup with support for bmpman changes, full Linux/OSX support 2004-10-31 21:30:01 +00:00
taylor 1a384df3ce EFF animation support 2004-10-31 21:29:00 +00:00
taylor bf0a46d3f6 support new pilot code, Linux code tree merge, don't use same pilot directory for Inferno builds 2004-10-31 21:28:38 +00:00
taylor e0570a7677 bmpman merge, EFF animation support, better page in stuff, dozen or so smaller fixes and cleanup 2004-10-31 21:26:27 +00:00
taylor 738c92e036 change case of opengl files so I can stop worrying, add gropenglbmpman files 2004-10-31 21:24:11 +00:00
taylor 56e60218b3 #define if !#defined, add USE_DEVIL and FS2_SPEECH commented out 2004-10-31 21:23:08 +00:00
taylor 0dad90aa7f initial import from bmpman merge 2004-10-31 21:21:11 +00:00
Goober5000 9abdc3e9ae whoops
--Goober5000
2004-10-31 02:26:15 +00:00
Goober5000 35e62e4777 added Knossos_warp_ani_used flag for taylor
--Goober5000
2004-10-31 02:04:34 +00:00
taylor aa5d98a918 make sure all spec colors are set to 0 in hud_tri() 2004-10-18 17:13:36 +00:00
Goober5000 6e0f31092e fixed FRED bug that changed special arguments to (null)
--Goober5000
2004-10-18 09:27:47 +00:00
phreak 1c98f5954d Made WMCoolmon's hud target info brackets recognize alt-names
--phreak
2004-10-15 13:10:06 +00:00
Goober5000 19b5126542 added change-alt-name
--Goober5000
2004-10-15 10:03:09 +00:00
Goober5000 b5fa66428c cleaned up some sexp stuff and added wing capability to kamikaze sexp
--Goober5000
2004-10-15 09:21:55 +00:00
Goober5000 6a0d138a08 extra coding insurance
--Goober5000
2004-10-15 08:14:07 +00:00
Goober5000 14804a1396 tweakage
--Goober5000
2004-10-14 23:03:37 +00:00
Goober5000 38dbeab543 added ability for variable names to be used as special arguments
--Goober5000
2004-10-14 22:28:27 +00:00
Goober5000 41fdb82dd1 more ubersexp bugfixing
--Goober5000
2004-10-14 01:19:17 +00:00
Goober5000 91af9dbfc0 fixed a few when-argument bugs
--Goober5000
2004-10-13 10:46:49 +00:00
Goober5000 c3cc9f8e21 added toggle-subsystem-scanning ship flag
--Goober5000
2004-10-12 22:47:15 +00:00
Goober5000 1429123da4 added contrail speed threshold
--Goober5000
2004-10-12 07:34:45 +00:00
Goober5000 93973d4a49 added the no-bank ship flag (which works) and the affected-by-gravity flag
(which won't work until I implement gravity points)
--Goober5000
2004-10-11 22:29:25 +00:00
taylor df028f3714 make sure windowed mode gets the correct size 2004-10-10 22:15:10 +00:00
taylor 6937a4d1e2 warp mouse to center screen on mission start 2004-10-10 22:12:57 +00:00
taylor 19680f4ebd holy crap at the copy-paste error 2004-10-10 16:59:37 +00:00
taylor 8a450c6b4d almost forgot this for the IBX stuff 2004-10-09 18:08:33 +00:00
taylor dacc345814 one more try to fix the memory leak and end-of-mission crash for talking head anis 2004-10-09 17:58:48 +00:00
taylor 349459c502 better debugging for g3_end_frame() - mostly for FRED2 2004-10-09 17:54:32 +00:00
taylor fc9655bde3 safer handling of missing shield ani 2004-10-09 17:51:23 +00:00
taylor faac91b3be da simple IBX code, back to old line rendering for models since it should be faster for OGL now 2004-10-09 17:48:58 +00:00
taylor eaa75f0a3f da simple IBX code 2004-10-09 17:45:45 +00:00
taylor 6ca850fbe6 don't use DevIL to read the header, slightly more sane error checking 2004-10-09 17:44:10 +00:00
Kazan f035fff922 interface corruption fix - thanks taylor (MAX_BITMAPS upped to 7000) 2004-10-06 22:02:54 +00:00
Kazan 625220a856 Autopilot convergence collision fix for ai_fly_to_ship() and ai_waypoints() -- mathematically expensive, only usable by autopilot 2004-10-03 21:41:11 +00:00
Kazan 134aeb0085 fix autopilot formation bug 2004-09-28 22:51:41 +00:00
Kazan 7d51c61184 | is binary or, || is boolean or - please use the right one
autopilot velocity ramping biasing
made debugged+k kill guardianed ships
2004-09-28 19:54:32 +00:00
taylor ec523fdf0b fix logic error, may be support ship rearm fix 2004-09-26 20:58:29 +00:00
taylor 849e22dfff handle lost devices better, fix movie crash 2004-09-26 16:24:51 +00:00
taylor d334ab504a proper OGL line drawing in HTL... hopefully 2004-09-24 22:40:23 +00:00
Goober5000 09f3d78d1c some ubersexp fixes
--Goober5000
2004-09-24 02:13:00 +00:00
Goober5000 363313ee59 fixed two bugs... still more bugs to be found :p
--Goober5000
2004-09-23 23:52:58 +00:00
Goober5000 48371badfc ubersexp implementation complete
--Goober5000
2004-09-23 22:51:07 +00:00
Goober5000 cd3bb82030 a bunch of work on the actual implementation of when-argument
--Goober5000
2004-09-23 05:53:00 +00:00
Goober5000 2f0a9985de further work on ubersexp framework
--Goober5000
2004-09-22 21:52:22 +00:00
Goober5000 83887ad91b fixed some small problems in the framework - should be working nicely now;
next step is the actual sexp implementation :-P
--Goober5000
2004-09-22 08:32:05 +00:00
Goober5000 7c6bde8551 checking in framework for when-argument special ubersexp
--Goober5000
2004-09-22 06:56:45 +00:00
tbird d355d6be5c Modified the image loading to accept 24 and 32 bit images 2004-09-22 03:50:13 +00:00
Goober5000 35441575e7 a bit of reordering
--Goober5000
2004-09-17 08:07:52 +00:00
Goober5000 92424ee0e3 changed around the logic for the 3D warp effect
--Goober5000
2004-09-17 07:12:23 +00:00
Goober5000 bb4974a467 moved ssm stuff to header file so it would work in FRED
--Goober5000
2004-09-17 07:11:02 +00:00
Goober5000 d5cc98338e removed player-not-use-ai and changed player-use-ai to take an argument
--Goober5000
2004-09-17 00:28:32 +00:00
Goober5000 ea30714b53 changed toggle-hud to hud-disable; added hud-disable-except-messages
--Goober5000
2004-09-17 00:18:18 +00:00
et1 12ce22b1a4 Use yellow warp anim when doing exit jump with "-tbpwarpeffects" 2004-09-10 13:55:49 +00:00
et1 e2865c4576 Implemented "+WeaponMinRange" token. Fixed a crash issue with fighter launch checks 2004-09-10 13:54:21 +00:00
et1 14cbcbf2ac Command line option for TBP for warp stuff, "-tbpwarpeffects" 2004-09-10 13:51:45 +00:00
et1 c71f96710f Implemented "+WeaponMinRange" token 2004-09-10 13:50:09 +00:00
Goober5000 f787dd331d fix0red something weird
--Goober5000
2004-09-05 20:05:16 +00:00
Goober5000 33b42b554e whoops, fixed this for debug mode
--Goober5000
2004-09-05 19:41:31 +00:00
Goober5000 5ac6b0a787 we definitely want browse info... and Sticks wants a mapfile too
--Goober5000
2004-09-05 19:25:02 +00:00
Goober5000 11ae968eb6 fixed a few warnings
--Goober5000
2004-09-05 19:23:24 +00:00
Goober5000 48a882755e MultiUi.cpp should not be in the "Freespace2" project
--Goober5000
2004-09-05 18:42:31 +00:00
Goober5000 a179aa698b fixed a warning
--Goober5000
2004-09-02 04:02:44 +00:00
phreak a69435baa1 MISSION_FLAG_USE_NEW_AI fixes for bomber+ missile selection, rapid dumbfire
firing and primary weapons selection
2004-09-01 01:26:20 +00:00
phreak 2f4ff28011 created the mission flag MISSION_FLAG_USE_NEW_AI
this lets old missions use the retail AI so they are balanced.  new missions would
be able to select this in fred so designers can take advantage of it.
2004-09-01 00:58:46 +00:00
Goober5000 6cef921092 fixed a small bug in the custom hitpoints mod
--Goober5000
2004-09-01 00:22:36 +00:00
Goober5000 4c53554eae when calculating damage for scoring, don't count beams unless they're fired by a fighter or bomber
--Goober5000
2004-08-31 23:36:28 +00:00
Kazan ec7681b75d small standalone-related multibug fix
prohibited execution of process_debug_keys(int) while Game_mode & GM_MULTIPLAYER
2004-08-26 18:19:36 +00:00
Goober5000 0d46b06833 fix0red some warnings
--Goober5000
2004-08-23 07:48:09 +00:00
Goober5000 6316b4a4e4 warp effect is back to FS2 default
--Goober5000
2004-08-23 04:32:40 +00:00
Goober5000 85d7186bf6 ship-tag and ship-untag sexps
--Goober5000
2004-08-23 04:32:06 +00:00
Goober5000 b5ae16e463 ship-tag and ship-untag
--Goober5000
2004-08-23 04:00:15 +00:00
Goober5000 acbb64b9b4 modularized tag stuff in preparation for sexp
--Goober5000
2004-08-23 03:34:34 +00:00
Kazan 63af0632df wakka wakka - fix minor booboo 2004-08-20 05:13:08 +00:00
Kazan 60d31003cf added preprocdefines.h to prevent what happened with fred -- make sure to make all fred2 headers include this file as the _first_ include -- i have already modified fs2 files to do this 2004-08-11 05:06:36 +00:00
phreak cb22efe237 fixed the -orbradar launcher string 2004-08-08 02:56:54 +00:00
phreak 3a7f5f7320 added radarorb.cpp and radarorb.h to project 2004-08-05 02:18:17 +00:00
phreak bf2870d53b forgot to commit orb change 2004-08-05 02:15:27 +00:00
phreak 5024413d68 orb radar rendering style 2004-08-02 22:54:07 +00:00
phreak e418257394 orb radar rendering style 2004-08-02 22:43:03 +00:00
phreak 4640a5eea4 added -orbradar to enable orb rendering for the radar 2004-08-02 22:40:59 +00:00
phreak c55568852b -phreak command line changed to -dualscanlines 2004-08-01 02:31:18 +00:00
et1 21448785ec Implemented "+SwarmWait:"-token and fixed weapon glow tails 2004-07-31 08:58:07 +00:00
et1 4acd808412 Implemented "+SwarmWait:"-token 2004-07-31 08:57:22 +00:00
et1 806e9eefd1 Fixed inaccuracy problems with non-homing swarmers 2004-07-31 08:54:38 +00:00
et1 4634470897 Make missing briefing icon message to tell the icon missing 2004-07-31 08:53:46 +00:00
et1 670d6a9078 If weapon loadout anim is missing, warn instead of int3 2004-07-31 08:52:45 +00:00
et1 1bf056b5ca Disabled ship shield load check for TBP 2004-07-31 08:51:47 +00:00
Kazan 3aae4e73f2 bugfixes 2004-07-29 23:41:22 +00:00
Kazan bd64ca2cb9 unbug the JS bug i caused --- kazan 2004-07-29 19:37:50 +00:00
taylor 1c6ef1c02c fix NULL pointer and try to prevent in future, remove excess commands in opengl_cleanup() 2004-07-29 09:35:29 +00:00
Kazan 1119146fcd fs2_open.exe was suffering the same problem as fred2 -- it was just a little less obvious 2004-07-29 03:49:44 +00:00
taylor 45d5f46063 plug memory leaks 2004-07-29 03:41:46 +00:00
Kazan a5407aff0a making another bug a little bit more dead inside :D 2004-07-27 20:09:12 +00:00
Kazan be1fba0b34 squished another 2004-07-27 18:52:11 +00:00
Kazan d1186a73ab i love it when bugs go crunch (autopilot ai fixup) 2004-07-27 18:04:09 +00:00
Goober5000 cb8f3dd3e2 outline of ship-tag and ship-untag sexps
--Goober5000
2004-07-26 21:26:45 +00:00
Goober5000 33144fdad4 updated launcher link
--Goober5000
2004-07-26 21:19:05 +00:00
Kazan 89e6af4fb5 remove MCD complete 2004-07-26 20:47:56 +00:00
Kazan a1c0d95647 remove MCD 2004-07-26 20:19:04 +00:00
Kazan a4dbb0ee88 add conditional compilation directive 2004-07-26 19:39:49 +00:00
Kazan a4e1bcfd2d Autopilot system completed -- i am dropping plans for GUI nav map
All builds should have ENABLE_AUTO_PILOT defined from now on (.dsp's i am committing reflect this) the system will only be noticed if the mission designer brings it online by defining a nav point
Fixed FPS counter during time compression
2004-07-26 17:54:05 +00:00
Goober5000 3ad5ea54fb last bit of Unix fixorage
--Goober5000
2004-07-26 17:50:02 +00:00
Goober5000 2b9cdc2689 more #ifndef fixorage
--Goober5000
2004-07-26 17:39:20 +00:00
Goober5000 5a9eee5a12 fixored a problem when using the command-line compiler to compile everything under Windows
--Goober5000
2004-07-26 16:11:41 +00:00
Kazan ff8edc4adc only disable afterburning during AIM_WAYPOINTS and AIM_FLY_TO_SHIP while AutoPilotEngaged 2004-07-25 19:27:51 +00:00
Kazan d83dbd88c4 -fred_no_warn has become -no_warn and applies to both fred and fs2
added new ai directive (last commit) and disabled afterburners while performing AIM_WAYPOINTS or AIM_FLY_TO_SHIP
fixed player ship speed bug w/ player-use-ai, now stays in formation correctly and manages speed
made -radar_reduce ignore itself if no parameter is given (ignoring launcher bug)
2004-07-25 18:46:30 +00:00
Kazan 7af6e41fa1 i have absolutely nothing to say about that subject 2004-07-25 00:31:31 +00:00
taylor b3c084db06 fix problem with sectioned menu bitmaps in OGL 2004-07-21 00:03:46 +00:00
wmcoolmon 37cdc6a4fe Fixed ifdef, was missing ship_decal_system otherwise 2004-07-20 04:03:21 +00:00
Kazan e9a29ac2e6 nothing major 2004-07-18 04:07:26 +00:00
taylor f7ffb89690 stupid braces... 2004-07-17 19:01:15 +00:00
taylor 77fcc86c14 fix set_*_matrix overcompensation, makes OGL work again 2004-07-17 18:59:01 +00:00
taylor f0dddf2854 oops, I can't spell 2004-07-17 18:49:57 +00:00
taylor d23c3a6e4d various OGL and memory leak fixes 2004-07-17 18:46:09 +00:00
taylor 26726238b5 don't use bitmap sections by default, openil_close() 2004-07-17 18:43:46 +00:00
taylor 51d8809a22 Bob say we fix OGL, so me fix OGL <grunt> 2004-07-17 18:40:40 +00:00
taylor 92e696a6ea force image orientation in DevIL 2004-07-17 18:38:04 +00:00
taylor cae2b33d34 make old warpmap and new glow bitmap 3D unlit to render right in OGL 2004-07-17 09:29:13 +00:00
taylor e1ab4e4532 add CF_SORT_REVERSE to real sort routine, makes CF_SORT_TIME work again 2004-07-17 09:26:00 +00:00
taylor 21fe0590ed make sure avi and mpg movies get added to file cache 2004-07-17 09:03:29 +00:00
taylor 0d76068eb8 add .deps directory to ignored entries 2004-07-17 09:00:38 +00:00
taylor f6faea6f81 misspelled filename 2004-07-17 08:59:25 +00:00
wmcoolmon 72c34be6f9 I though I fixed this... 2004-07-15 00:16:46 +00:00
wmcoolmon 65da0763f7 Better -load_only_used handling; added mark_weapon_used(weapon ID), which does check for IDs of -1. 2004-07-14 01:27:01 +00:00
wmcoolmon baed9715df Better -load_only_used handling 2004-07-14 01:26:10 +00:00
Kazan 8d2fa0418a adding mcd 2004-07-12 16:37:01 +00:00
Kazan f7dd512ba8 MCD - define _MCD_CHECK to use memory tracking 2004-07-12 16:33:09 +00:00
Kazan 9c9006f55e fix a small multibug in tables validation (I had added this once before.. where did it go) 2004-07-12 14:38:13 +00:00
wmcoolmon 177698e014 More in-game stuff, mostly for restricted games 2004-07-12 03:34:55 +00:00
wmcoolmon 70834437dd Only send ships on the player's team 2004-07-12 03:26:03 +00:00
Kazan a501d4b688 removed a couple pointless useless messages from the debug console 2004-07-12 03:19:17 +00:00
wmcoolmon cb0360016d ... 2004-07-12 03:04:33 +00:00
wmcoolmon 55f179db5c Oops. :p 2004-07-12 03:04:03 +00:00
wmcoolmon e8c844b32a Ingame joining stuff - use -rt to enabled/disable 2004-07-12 02:50:48 +00:00
bobboau b8fb999660 added the working decal code 2004-07-11 03:22:54 +00:00
wmcoolmon 93964edfed Fixed bug with the base ship flag I unwittingly introduced. 2004-07-10 08:03:13 +00:00
Kazan 3a89eeffc9 minor bugfixes - oh yeah reenabling a rule for multistats :P 2004-07-10 03:18:23 +00:00
Kazan 72ac50ca24 fs2netd 1.0 RC5 full support - Rank and Medal updates 2004-07-09 22:05:32 +00:00
wmcoolmon 6f8e5b4447 Fixed conditional. 2004-07-09 07:32:55 +00:00
wmcoolmon 64efe3e91c Fixed HUD escort list for dogfight mode, and for any usage. 2004-07-09 05:53:05 +00:00
wmcoolmon eda444a92b Re-implemented nomotiondebris, as Bobb overwrote it when he commited his changes. 2004-07-09 05:52:19 +00:00
wmcoolmon 7999173fc7 Moved set_current_hud, as well as added a conditional to hud_positions_it; it shouldn't and won't be executed on a standalone server. 2004-07-08 22:08:21 +00:00
wmcoolmon a4c2329316 Moving set_current_hud, to ensure compatibility with multiplayer. 2004-07-08 22:06:56 +00:00
Kazan e2b8ce4d5d fixed a typo in one of the fs2netd strings
played with WMCoolmon's hacked up escort list
2004-07-07 23:34:08 +00:00
Kazan 13ee198069 FS2NetD: C2S Ping/Pong, C2S Ping/Pong, Global IP Banlist, Global Network Messages 2004-07-07 21:00:08 +00:00
Kazan 84e74a8abf minor multi fix 2004-07-06 23:45:34 +00:00
Kazan a1903268ad small multifix 2004-07-06 19:59:37 +00:00
bobboau f36d1802df FVF code, only the data that is needed is sent off to the card,,
OGL can take advantage of this if they want but it won't break
anything if they don't. also state block code has been implemented,
that's totaly internal to D3D no high level code is involved.
2004-07-05 05:09:21 +00:00
wmcoolmon a8beea705e Replaced some more Int3s with Warnings and Errors. 2004-07-03 08:23:00 +00:00
wmcoolmon 0e60209a24 Error handling for fire_beam instead of just calling Int3() 2004-07-03 07:55:22 +00:00
wmcoolmon 5187223a76 Removed function pointer w/ default arguments for compatibility with .NET Sorry, you'll just have to add that "0" by hand. :p 2004-07-03 06:08:54 +00:00
Kazan d99263ed75 working on autonav 2004-07-01 16:38:19 +00:00
phreak eb489320e1 function pointer radar update.
will enable us to make different radar styles that we can switch between
2004-07-01 02:07:54 +00:00
phreak 1b906e0369 function pointer radar update.
will enable us to make different radar styles that we can switch between
2004-07-01 01:54:59 +00:00
bobboau 5019375c1f implemented index buffered background bitmaps,
OGL people you realy should get this implemented
2004-07-01 01:12:33 +00:00
wmcoolmon 3f1f149312 Support as well as the extern for "-load_only_used"; this way everything that includes cmdline.h doesn't have to be recompiled. 2004-06-29 06:02:34 +00:00
wmcoolmon 698f4e0e16 Added "-load_only_used", which makes FS2 load only used weapon data 2004-06-29 06:00:45 +00:00
wmcoolmon c089510571 Fixed weapon miniinfo display 2004-06-28 10:00:33 +00:00
bobboau e2bb83fbdb high level index buffer suport and d3d implementation,
OGL people need to get this working on your end as it's broke now
2004-06-28 02:13:08 +00:00
wmcoolmon 16b030459f Bad return 2004-06-27 01:48:17 +00:00
wmcoolmon 2fbdb960f6 Unneccessary warning removed, small change for VC6. 2004-06-27 01:47:16 +00:00
wmcoolmon e80f8b391d Commented out ogg header 2004-06-27 01:45:23 +00:00
wmcoolmon 231f9a0246 Minor optimizations and removal of an errant !stricmp 2004-06-26 19:24:24 +00:00
wmcoolmon eb26a123cf Minor optimizations 2004-06-26 19:23:54 +00:00
wmcoolmon 2b8c618b27 Displayed escorts now settable up to MAX_COMPLETE_ESCORT_LIST via "$Max Escort Ships:" in hud_gauges.tbl
Escort list is now hud_gauges.tbl compatible.
2004-06-26 03:19:53 +00:00
wmcoolmon 7d0c23b02b Added "-targetinfo" to toggle info next to targeted object. 2004-06-26 00:28:05 +00:00
wmcoolmon 1fc27844ce Basic target info next to targeted object. 2004-06-26 00:27:20 +00:00
wmcoolmon d6d0be0a3c Added teh FS2 ogg support files. Not in the project so you still don't need the SDK. 2004-06-22 23:15:17 +00:00
wmcoolmon 94b5611023 Nonworking OGG support for sound (not music) added, disabled load-only-used-weapons code, modification to sound system registry code.
OGG code has been commented out, so you don't need the SDK yet.
2004-06-22 23:14:10 +00:00
wmcoolmon 5142d17030 Added support for -nomotiondebris 2004-06-19 22:16:20 +00:00
wmcoolmon 6bcd42f543 Added -nomotion debris command line option; also re-ordered categories. 2004-06-19 22:15:48 +00:00
randomtiger d00f29b663 Changed startup code to catch D3D9 request from launcher.
No actual startup code has been implemented.
2004-06-19 12:45:47 +00:00
wmcoolmon 633d2c58e2 Only used weapons paged in instead of all, fixed music box in FRED, sound quality settable with SoundSampleRate and SoundSampleBits registry values 2004-06-18 04:59:55 +00:00
wmcoolmon 55d46b3801 Bumped MAX_MISSION_MESSAGES to 500 2004-06-15 21:05:30 +00:00
wmcoolmon d329ae66ae Bumped MAX_SEXP_NODES to 3500 2004-06-15 21:04:18 +00:00
wmcoolmon 54d0d3bd2c Added hud-set-color and get-current-speed 2004-06-15 20:49:22 +00:00
wmcoolmon 9a50e83dce hud-set-color SEXP 2004-06-09 00:18:50 +00:00
wmcoolmon a98bc2643a Fix0red the current target's hud info appearing in the corner of the screen. 2004-06-08 01:12:58 +00:00
wmcoolmon 3bf411f705 Added +Color: option for custom gauges. 2004-06-08 00:35:43 +00:00
wmcoolmon 2d0dc11c64 Warpout failure bug fixingness 2004-06-07 07:36:08 +00:00
randomtiger 30c3556abc Commented out mprintf, it was swamping debug console.
Uncommented some code which I hope has plugged the memory leak.
2004-06-06 20:04:28 +00:00
randomtiger 6a3569280a Added new compression option -pcx32dds, build posted in RSB forum.
Changed flag because of launcher bug, have fixed launcher bug, will distribute later.
Also removed experimental flag from launcher flag list, stupid people were reporting bugs on unfinished code.
2004-06-06 12:25:20 +00:00
randomtiger 76215199f1 Added pcx compression option -pcx32dds, build posted in RSB forum.
Also removed experimental flag from launcher flag list, stupid people were reporting bugs on unfinished code.
2004-06-06 11:16:42 +00:00
wmcoolmon 3d8b7de265 More HUD update stuff. Coordinates are now floats, addparent is now obsolete. 2004-06-05 23:31:12 +00:00
phreak 4bc768fc32 spawn weapons can now be specified to be spawned at different angles other than
the sphere thats used in retail
2004-06-05 19:15:39 +00:00
phreak e34938c8dc added static_random_cone which is used for spawn angle features in multi 2004-06-05 19:14:42 +00:00
wmcoolmon 254efe0d53 Lotsa stuff. Custom gauges w/ ANIs support added, SEXPs to set gauge text, gauge image frames, and gauge coords. These SEXPs and toggle-hud reside in the Hud/change category. 2004-06-01 07:31:57 +00:00
wmcoolmon cdfd1299f0 Update to make images (not animations) work 2004-05-31 08:54:13 +00:00
wmcoolmon c005dc7dad Custom HUD support, better loading, etc etc. 2004-05-31 08:32:25 +00:00
wmcoolmon 9193af0210 Final draft of the HUD parsing system structure. May change how individual coord positions are specified in the TBL. -C 2004-05-30 08:04:49 +00:00
wmcoolmon 12eef3702d First bugfix in this!: Don't want Freespace exiting if it can't load a hud_gauge file. 2004-05-29 04:09:04 +00:00
wmcoolmon 480175df7d Added HUD gauges placement table, "hud_gauges.tbl" or "*-hdg.tbm" table module 2004-05-29 03:02:53 +00:00
wmcoolmon 8ae9aaebf8 Spotted something that might be a problem. 2004-05-29 03:01:00 +00:00
wmcoolmon e7ac8a5d12 Added stuff_float_list 2004-05-29 02:52:17 +00:00
wmcoolmon 6710e15c5c Modular music tables 2004-05-28 23:37:30 +00:00
wmcoolmon f5c586edaf Made HUD.tbl obsolete. Info is now taken directly from $Shield_icon in ships.tbl
Now this table can be used for something more useful...say, hud gauge positions?
2004-05-27 00:49:26 +00:00
wmcoolmon 16163aad45 Fixed cf_matches_spec; small bug was introduced. 2004-05-26 22:02:36 +00:00
wmcoolmon 1cb372a8e7 Added weapons_expl modular table, updated cfilesystem to work with modular tables, fixed loading order, fixed ship loading error messages 2004-05-26 21:02:27 +00:00
wmcoolmon e22820c475 Ship & weapon modular table files 2004-05-26 03:52:08 +00:00
wmcoolmon 9469dee1b8 Modular ship table support. Uses *-shp.tbm , with the same structure as a normal ships.tbl. Individual sections are optional and entries with the same name will override previous settings. -C 2004-05-26 02:31:39 +00:00
wmcoolmon 71aecd3927 Scratch that - .tbm is a better extension 2004-05-26 02:29:44 +00:00
wmcoolmon a8f2fb5c24 Added table chunk extension 2004-05-26 02:26:14 +00:00
wmcoolmon 5a4a0f9710 Updated function calls for VC7 use 2004-05-25 00:38:11 +00:00
wmcoolmon f5bbbff05b cleared up an ambiguous call for VC7 2004-05-25 00:26:25 +00:00
wmcoolmon fc0251d305 Updated to use <fstream> instead of <fstream.h> and fixed an un/signed disagreement 2004-05-25 00:24:00 +00:00
wmcoolmon 7129774def Updated to use <iostream> instead of <iostream.h> 2004-05-25 00:21:39 +00:00
taylor fc71fe2c0e filename case change 2004-05-24 07:25:32 +00:00
taylor de55362fe1 filename case change 2004-05-24 07:14:13 +00:00
taylor 4df953f3bd The Great Linux Merge 2004-05-24 07:04:25 +00:00
taylor a867b1979c add .cvsingore files 2004-05-24 04:12:07 +00:00
taylor 8acb0872ac autoconf/automake cleanup 2004-05-24 04:10:47 +00:00
taylor 4afe186dc4 disable COLOR_MATERIAL, for nvidia drivers 2004-05-13 00:17:20 +00:00
phreak 87c5d993dc got rid of the color material call, nebulas should blind the player 2004-05-12 23:24:35 +00:00
phreak a0666e9591 don't fog the warp model if its being rendered 2004-05-12 22:50:31 +00:00
phreak 593285a975 renamed the warp model variable from 'wm' to 'Warp_model' 2004-05-12 22:49:14 +00:00
taylor 7096ffbc98 do page in unlock but not for gr_preload() stuff 2004-05-11 23:08:55 +00:00
phreak 490678193a fixed an array bounds error that was causing debug builds to crash when
rendering a ship
2004-05-11 19:39:29 +00:00
phreak 3d3c197dc0 fixed the white boxes appearing on unlit bitmaps 2004-05-11 16:48:19 +00:00
Goober5000 7ac03c7835 completed the FRED import conversion stuff that I started ages ago
--Goober5000
2004-05-11 02:52:12 +00:00
Goober5000 887239e1d4 fixed the AWACS help message
--Goober5000
2004-05-10 13:07:22 +00:00
Goober5000 ea415cce97 made primary and secondary banks quite a bit more friendly... added error-checking
and reorganized a bunch of code
--Goober5000
2004-05-10 10:51:54 +00:00
Goober5000 409e068104 fixored the handling of no lasers and no engines... the tests should check the ship,
not the object
--Goober5000
2004-05-10 08:03:31 +00:00
Goober5000 b4ec7e4e34 fixed $quote and $semicolon... it was simply a matter of moving the spot where
the replacement occurred
--Goober5000
2004-05-10 06:14:40 +00:00
Goober5000 7ad5b133ff fixed warp decision
--Goober5000
2004-05-10 06:11:47 +00:00
phreak 01bc1043e4 bumped to 3.6!!!! 2004-05-09 23:32:40 +00:00
taylor dad23b95db prefer ani over pcx for ship textures 2004-05-09 15:02:00 +00:00
Goober5000 23a79af4dc small fix
--Goober5000
2004-05-08 01:08:48 +00:00
Kazan 39bbccebfc Sorry Guys! 2004-05-07 23:50:14 +00:00
Goober5000 b32d1c7fa9 added Righteous1's Y bug hack
--Goober5000
2004-05-07 19:06:45 +00:00
taylor b318f01819 ...missed one... 2004-05-06 22:39:37 +00:00
taylor 7e8ca9a005 DDS mipmap reading, remove unneeded bm_unlock() during page in 2004-05-06 22:35:26 +00:00
taylor 6f657470fe get mipmap count off of DDS textures for later use 2004-05-06 22:31:02 +00:00
taylor dfc59ef087 fix DDS textures 2004-05-06 22:26:52 +00:00
taylor b09c3b3491 make sure JPG and DDS files are added to the file cache for maps and effects 2004-05-06 22:12:14 +00:00
Kazan c63f80dbaf Abandon strdup() usage for mod list processing - it was acting odd and causing crashing on free()
Fix condition where alt_tab_pause() would flipout and trigger failed assert if game minimizes during startup (like it does a lot during debug)
Nav Point / Auto Pilot code (All disabled via #ifdefs)
2004-05-03 21:22:23 +00:00
randomtiger 66556fe514 fl_abs(theta_goal.xyz.z) < 0.001f is reporting using mprintf now instead of assert 2004-05-03 09:27:16 +00:00
randomtiger d4d41d8eff Fixed D3D fogging on R7000 2004-05-03 08:41:24 +00:00
taylor 12d6469ee7 don't use HTL line fix with Fred 2004-05-02 16:01:38 +00:00
Goober5000 d0f604c81a added a comment
--Goober5000
2004-05-02 03:05:23 +00:00
taylor f5f347109c comment out avi free code for now 2004-05-02 01:26:52 +00:00
randomtiger 4195c0e9fa FS2_open will now take flag settings from cmdline_fso.cfg not cmdline.cfg.
This means retail FS2 will not crash because of fs2_open flags.
The new version of the launcher (v5) must used to setup flags now.
Anyone distributing pre 3.6 builds should make this clear and 3.6 should come with Launcher v5.
2004-05-01 22:47:23 +00:00
taylor f87fbdb857 add some error handling to vm_strdup() 2004-05-01 21:53:39 +00:00
Kazan d97912ce37 bah! stupid me "NULL" not "null" - i hate when i do that 2004-05-01 21:47:43 +00:00
Kazan 1b725c3ac4 changed delete[] to free(), checked for null, if null ERROR 2004-05-01 21:45:31 +00:00
Kazan ab23820319 delete[] str_temp
A null check on str_temp is not needed - take a close look at the for loop
2004-05-01 19:49:31 +00:00
taylor 8c7614ac34 add CF_TYPE_MISSIONS to physical check to avoid network transfer problems 2004-05-01 19:33:20 +00:00
Goober5000 63b9d44968 added an assert
--Goober5000
2004-05-01 17:37:09 +00:00
Kazan 8887c8a07e Multiple -mod - "-mod ModA,ModB,ModC" in order of priority
Giving you:
Root: ModA
Root: ModB
Root: ModC
Root: Fs2Default
Root: CDRom
2004-05-01 17:10:37 +00:00
Goober5000 8367ed5943 extra insurance
--Goober5000
2004-04-30 22:20:27 +00:00
Kazan 6ceeeb7239 Lobby screen only shows when PXO_LOBBY is defined 2004-04-30 18:33:22 +00:00
taylor 1e5fe42652 fix create game buttons 2004-04-27 20:43:32 +00:00
taylor b9802a0d6e add NULL check to game_hacked_data() to prevent crash 2004-04-27 20:41:58 +00:00
Goober5000 343423adc2 added back in Kazan's line: now you can slow down in cheat mode
whether you press tilde or not
--Goober5000
2004-04-26 19:50:04 +00:00
Goober5000 961cfbe12e rolled back Kazan's change
--Goober5000
2004-04-26 19:43:07 +00:00
Kazan 1207801f77 -no_fps_capping 2004-04-26 18:23:48 +00:00
Kazan fd816a1a5b Be careful when modifying other peoples changes - make sure they still work, and do things the simple way
DON'T TOUCH THE CUSTOM BUILD PATH
2004-04-26 17:27:17 +00:00
taylor e086613047 forgot to remove some safety checks that aren't needed anymore 2004-04-26 15:51:26 +00:00
taylor c121c18b4f mark view cutscenes ignoring extension and file case 2004-04-26 13:11:11 +00:00
taylor 5e0b6a687f cvs log header, mark cutscenes viewable for later, gr_flip() to fix OGL white flash 2004-04-26 13:09:20 +00:00
taylor 2ccaf8f927 respect -glow and -spec 2004-04-26 13:05:19 +00:00
taylor c94d4bea59 light setup changes, support cmdline ambient value 2004-04-26 13:02:27 +00:00
taylor 7528ef0fef DevIL stuff 2004-04-26 13:00:56 +00:00
taylor 901e565798 convert to dos format, add DevIL stuff 2004-04-26 12:57:47 +00:00
taylor 7323c9e0da 32-bit targa and jpeg loaders, bug fixes, some preload stuff 2004-04-26 12:44:54 +00:00
taylor 054bcf6dec minor fixes, HTL lines, 32-bit texture support 2004-04-26 12:43:58 +00:00
taylor 79a01657a7 gr_preload() pointer for use in bmpman.cpp 2004-04-26 12:41:46 +00:00
taylor ff5ee510a3 correct header to keep cvs log, minor changes 2004-04-26 12:39:49 +00:00
taylor b4f3e252d0 use d3_draw_rod() for lightning arcs (for OGL fix), fix debris making HUD in OGL disappear 2004-04-26 12:38:35 +00:00
taylor c10a141861 don't try to load glow maps if they are disabled 2004-04-26 12:37:10 +00:00
taylor a83e3a6223 add color and HTL support for g3_draw_rod() 2004-04-26 12:36:10 +00:00
taylor 76d820d0f4 32-bit support with DevIL 2004-04-26 02:14:38 +00:00
taylor b0ece8eb3a initial checkin 2004-04-26 02:05:17 +00:00
taylor e5f836df4b initial checkin 2004-04-26 01:58:17 +00:00
taylor e4256a1cd3 s/idex/idx/ for brief_unload_anims() 2004-04-26 01:41:52 +00:00
taylor 06e8db1bf8 better anim free stuff, disable for now to prevent CTD 2004-04-26 01:40:53 +00:00
taylor c84fbacb8b use absolute moddir path, faster cfilesystem searching 2004-04-26 00:26:37 +00:00
taylor cba0190e05 don't preload every sound (fixes some slowdowns), snd_preload option support 2004-04-26 00:25:08 +00:00
taylor 39e9479ac8 novbo and snd_preload cmdline options, fix moddir getting appended space 2004-04-26 00:23:26 +00:00
Goober5000 f8f1ef779e made time dilation only available in cheat mode; also fixed an obscure CTD
--Goober5000
2004-04-25 06:31:53 +00:00
Kazan 9fccd4c2d0 Fixed Lobby screen showing up while exiting from non-tracker games
Time dialiation up to 1/4
2004-04-24 15:44:22 +00:00
randomtiger 8dc2c082c3 Added -2d_poof command which allows access to 2D poof rendering
Added -radar_reduce to launcher flag description structure
2004-04-18 19:39:13 +00:00
taylor 7ec25aa692 let language reg setting override auto detection 2004-04-14 23:17:26 +00:00
taylor 3835d0758b render lightning unlit so that it works in OGL 2004-04-14 10:27:24 +00:00
taylor e4ab7f2254 don't page in neb poofs unless in a neb2 mission, fix OGL whiteout issue 2004-04-14 10:25:50 +00:00
taylor abbd2a260e fix for lines and shaders - shouldn't be textured 2004-04-14 10:24:51 +00:00
taylor 892cf38736 fix extra large model with -ship_choice_3d in OGL 2004-04-14 00:37:36 +00:00
Goober5000 cc9afc7d3e fixed the custom hitpoints subsystem bug
--Goober5000
2004-04-13 05:42:45 +00:00
phreak f210455827 put in the correct fields for the CVS comments to register
fixed a glowmap problem that occured when rendering glowmapped and non-glowmapped ships
2004-04-13 01:55:41 +00:00
randomtiger 55f84acd98 Adding batching functions here and there and into gr_screen for use with OGL when its ready. 2004-04-11 13:56:33 +00:00
randomtiger b6f02b52cb Fixed movie playing code for fresh install. Removed NO_DSHOW_CODE paths. 2004-04-11 13:43:26 +00:00
Goober5000 b21ab3282d quashed the slider bug!
--Goober5000
2004-04-10 16:55:45 +00:00
Goober5000 1f3318524b some formatting 2004-04-10 16:55:23 +00:00
phreak e2e5a24926 moved an assignment statement inside an #ifdef block so dds works in release mode 2004-04-09 20:32:31 +00:00
phreak 1120cdaa03 fixed DDS not working in OpenGL. there was a misplaced Assert() 2004-04-09 20:07:56 +00:00
phreak 25c7c7c8af got rid of some compile warnings 2004-04-08 20:13:17 +00:00
righteous1 07a01628a0 Backing out mainhall audio fix attempt. 2004-04-08 05:00:13 +00:00
phreak edae245b0e changed around the order of some function calls to get the target model
properly rendering in the hud targetbox
2004-04-07 17:20:24 +00:00
righteous1 fdde5a6713 Updated to call alt_tab_pause() function to draw pause screen and discontinue sounds when the game is minimized. -R1 2004-04-07 03:32:45 +00:00
righteous1 28508f0be4 Updated to add alt_tab_pause() function to draw pause screen and discontinue sounds when the game is minimized. -R1 2004-04-07 03:31:53 +00:00
Goober5000 1502269102 code.dsp should definitely have browse info checked
--Goober5000
2004-04-06 16:25:06 +00:00
Goober5000 d496969846 commented out one of Bobboau's hacks because it was messing stuff up
--Goober5000
2004-04-06 16:19:11 +00:00
Goober5000 e7ee4f4ef1 ugh - added back in something that Bobboau removed
-Goober5000
2004-04-06 05:42:49 +00:00
phreak 7f25fcf05f oops, hanging ')' 2004-04-06 05:28:07 +00:00
phreak 4551cda108 properly commented Local SSM code.
put in some estimation code so the Local SSMs warp in closer to moving ships
2004-04-06 05:26:59 +00:00
phreak 105e95a991 Local SSMs now working again after the code for setting the jumpout/jumpin
times for the missile were removed.
2004-04-06 04:53:21 +00:00
phreak 2257b4efde added a control config option for the wireframe hud targetbox i enabled ages ago 2004-04-06 03:09:53 +00:00
phreak d53c6289dc removed gropenglw32x.cpp (obsolete) and gropengl2d.cpp (unused and accidentaly committed) 2004-04-06 01:51:36 +00:00
phreak d5bc0051fb added comments (terms of use, commit history) to the tops of files 2004-04-06 01:37:21 +00:00
Kazan 4477777cd4 make custom build work again 2004-04-06 01:11:41 +00:00
phreak d81cfcbbba OpenGL files spilt up to make developing and finding bugs much easier 2004-04-03 20:29:53 +00:00
Kazan 42e936b6b1 FRED fixes 2004-04-03 18:11:21 +00:00
Goober5000 f6007413de fixed some stub functions and a bunch of compile warnings
--Goober5000
2004-04-03 06:22:33 +00:00
bobboau 12b3ffb6b9 commiting recent minor bug fixes 2004-04-03 02:55:50 +00:00
randomtiger 034f987d38 Changed D3D secondry texture system to be off by default to save mem.
Added some friendly names for parameters.
2004-04-02 18:25:16 +00:00
taylor d3ca761e30 don't use interface anis as ship textures 2004-04-01 15:31:22 +00:00
taylor f8dcf11f99 close out briefing menu bitmaps before entering mission 2004-04-01 15:29:39 +00:00
taylor a780021f7b don't load all starfield bitmaps on level load 2004-04-01 15:28:42 +00:00
Goober5000 f43da62c3e got rid of all those nasty warnings from xlocale and so forth; also added comments
for #pragma warning disable to indicate the message being disabled
--Goober5000
2004-03-31 05:42:29 +00:00
Goober5000 6487bd1ff4 got rid of Bobboau's SAFEPOINTs in hudtarget.cpp
--Goober5000
2004-03-31 04:24:49 +00:00
taylor bb870a6926 handle movie file extensions better 2004-03-30 08:30:38 +00:00
phreak 6216fb09da fixed a minor bug where the version checker
would complain even if the correct version of OpenGL was present
2004-03-29 02:24:20 +00:00
taylor a1751c30ab runtime language selection, mantis:0000133 2004-03-28 17:49:55 +00:00
randomtiger 98e7e86697 Movies now use win32 calls to clear the screen before playback. 2004-03-27 23:23:36 +00:00
randomtiger c488360abc Committed possible fix to cutscene listing problem in techroom, as described in mantis. 2004-03-27 22:27:07 +00:00
randomtiger c38d9601c8 Bug fix for video playback. 2004-03-21 17:38:18 +00:00
bobboau aa60ef5bcc fixed a texture loading bug 2004-03-21 10:34:05 +00:00
randomtiger e611d3d74e Fixed a bug that was causing windowed movie playback and a crash.
Added some batching redirection.
2004-03-21 09:41:54 +00:00
bobboau 24a9694494 fixed -spec comand line option,
probly some other stuf
2004-03-20 21:17:13 +00:00
randomtiger 55671189f0 Added base for a general dynamic batching solution.
Fixed NO_DSHOW_CODE code path bug.
2004-03-20 14:47:14 +00:00
randomtiger 8e595a903c New command line parameter: -d3d_lesstmem causes D3D to bypass V's secondry texture system. 2004-03-19 14:51:55 +00:00
randomtiger 2e49d55faf Further D3D texture system simplification. 2004-03-19 12:35:58 +00:00
randomtiger 08d8e0799a Removed -d3d_notmanaged param.
Tided D3D texture code. Merged remaining section code into the rest of the system.
Prepared for removal of code causing waste of memory for secondry store of textures.
2004-03-19 11:44:04 +00:00
bobboau 5d54009c21 new fighter beam code
fixed old after burner trails
had to bump a few limits, working on some dynamic solutions
a few fixed to background POF rendering
fixing asorted bugs
2004-03-17 04:07:32 +00:00
randomtiger fcc33b856f Added new launcher flag construction code. 2004-03-16 18:37:02 +00:00
phreak b8d48fac23 really fixed opengl shields this time 2004-03-16 17:41:12 +00:00
randomtiger 4c27f96902 Commented out shield fix that broke shield rendering for D3D.
Fix didnt appear to work for OGL so I didnt bother to if(OGL) it.
2004-03-16 11:52:17 +00:00
phreak 9fde027411 bumped MAX_SOUNDS to 450 if INF_BUILD is defined 2004-03-12 16:26:39 +00:00
phreak 2af460314d bumped MAX_GAME_SOUNDS to 400 if INF_BUILD is defined 2004-03-12 16:23:49 +00:00
Kazan a639da2973 irc 2004-03-10 20:51:16 +00:00
Kazan 9cbbb6fd03 generally it helps if i actually add and commit the files i want to modify on a different system 2004-03-10 19:11:40 +00:00
Kazan 20a083c859 partially complete IRC - so i can work on it on my laptop 2004-03-10 18:45:09 +00:00
Kazan 685880a7b6 Disabled multithreaded TCP_Socket in favor of safer single threaded
FS2NetD doesn't kill the game on connection failure now - just gives warning message and effectively dsiables itself until they try to connect again
2004-03-09 17:59:01 +00:00
Kazan 9010d21b32 more fs2netd stuff 2004-03-09 00:02:16 +00:00
phreak 841774f69f fugly hack to get skyboxes working in HT&L. please port stars_draw() to use HT&L
so this hack can be removed
2004-03-08 22:16:32 +00:00
Kazan 04e34810e0 Lobby GUI screen restored 2004-03-08 22:02:39 +00:00
phreak dcfc77364e fixed a bug so that shields now render in Opengl HT&L 2004-03-08 22:01:29 +00:00
phreak be2d15fc4f made a minor logical fix to gr_opengl_tmapper_internal
disabled pcx32 and jpgtga flags if they were defined by the user
2004-03-08 21:57:04 +00:00
phreak 014e261af1 split the star and space debris rendering loops into their own separate functions
this makes it easier to edit them if we ever need to and it also increases readability
i also brought some variable declarations outside of the rendering loops
2004-03-08 21:55:20 +00:00
randomtiger f343c2f7b1 Added complete stub system to replace software. 2004-03-08 18:36:21 +00:00
Kazan 30ae2da9cd Did, undo 2004-03-08 15:06:24 +00:00
Kazan 9236bd6d7c *crosses fingers* 2004-03-08 15:03:27 +00:00
Kazan 85f05019b5 [Incomplete] Readd of Software renderer so Standalone server works
Also FS2NetD changes
PS: CVS crashing mid-transaction and leaving stale locks = annoying++
2004-03-08 14:53:11 +00:00
Kazan 6509badc36 [Incomplete] Readd of Software renderer so Standalone server works 2004-03-07 23:07:20 +00:00
randomtiger 21856a78e5 If user has stub ani's dshow code will fail gracefully instead of throwing up an error. 2004-03-07 14:02:22 +00:00
bobboau 6ee175e65d fixed motion debris
animated laser textures
and added a new error check called a safepoint, mostly for tracking the 'Y bug'
2004-03-06 23:28:24 +00:00
Goober5000 2f067ae8aa weapons now display counts up to 9999, instead of just 999
--Goober5000
2004-03-06 00:19:23 +00:00
Goober5000 fcc38162c5 d'oh!
--Goober5000
2004-03-05 23:54:48 +00:00
Goober5000 771e6b2faa made awacs only ask for help in the main fs2 campaign
--Goober5000
2004-03-05 23:41:04 +00:00
Kazan 28cc2957c8 Fixed mission validation (was returning false positives) 2004-03-05 21:24:53 +00:00
Kazan 1e99847291 Fixed mission validation (was returning false positives) 2004-03-05 21:19:39 +00:00
Goober5000 2edd420943 Uber pass at reducing #includes
--Goober5000
2004-03-05 09:02:13 +00:00
phreak 852ec76549 fixed the lack of ships in the hud targetbox
prevented other functions calls to glColor3ub() from messing
with the color of textures in gr_opengl_render_buffer().  this was causing some
minor rendering bugs
2004-03-05 04:33:09 +00:00
phreak 7caf442717 made OpenGl use the matrix api if called by g3_start_**** or g3_done_instance 2004-03-05 04:16:20 +00:00
randomtiger e1ca009d9a Think I have fixed dshow window focus error, will tidy code when confirmed. 2004-03-04 20:56:43 +00:00
Kazan 5b591c2c4c LAN works A1 Supar! 2004-03-04 05:57:45 +00:00
Goober5000 55c7d0e0fc preliminary checking of globals.h
--Goober5000
2004-02-28 20:26:10 +00:00
randomtiger 6a2cadb08f Removed a few uneeded if DIRECT3D's.
Set laser function to only render the effect one sided.
Added some stuff to the credits.
Set D3D fogging to fall back to vertex fog if table fog not supported.
2004-02-28 14:14:57 +00:00
Goober5000 0ccb8a19dc commented a slide_face_ship that I missed before
--Goober5000
2004-02-28 01:36:20 +00:00
bobboau 7d87db1939 fixed a Z buffer error in HTL submodel rendering,
and glow points,
and other stuff
2004-02-27 04:09:56 +00:00
Goober5000 e94733df9c added DONT_SHOW_WARNINGS compile branch
--Goober5000
2004-02-25 05:53:32 +00:00
Goober5000 a69f3bd271 removed an old function
--Goober5000
2004-02-23 07:45:38 +00:00
Kazan d7905cd06a FS2NETD License Comments 2004-02-21 00:59:43 +00:00
randomtiger 244b9718d5 Added * to - conversion for start mission code to allow launcher missions with '-' in them.
Currently the parsing code counts that as a flag and messes it up.
2004-02-20 21:58:07 +00:00
randomtiger 020379cf40 Removed some uneeded code between NO_DIRECT3D and added gr_zbias call, ogl is set to a stub func.
Changed -htl param to -nohtl. Fixed some badly named functions to match convention.
Fixed setup of center_alpha in OGL which was causing crash.
2004-02-20 21:45:41 +00:00
randomtiger 183587f8b4 Changed memory leak detection to happen after atexit all other calls.
This will mean it doesnt report leaks that are cleared by just before the game quits by preset functions.
2004-02-20 18:04:27 +00:00
bobboau a963f3ccc1 pluged memory leaks,
3D HTL lasers (they work perfictly)
and posably fixed Turnsky's shinemap bug
2004-02-20 04:29:57 +00:00
bobboau e540947704 fixing lighting bug I accedently introduced 2004-02-16 21:53:40 +00:00
randomtiger b94f8cddde Use _REPORT_MEM_LEAKS compile flag in code.lib to get a report of memory leaks from malloc calls. 2004-02-16 21:22:15 +00:00
phreak 6fd1ef440b grr fixed a warning message i didn't see 2004-02-16 16:15:04 +00:00
phreak cd2b9d9871 made the window command line tag recognize non-standard resolutions 2004-02-16 16:09:59 +00:00
randomtiger eb1b936ff1 Oops, put two files back in, went a bit too far.
Added NO_DSHOW_CODE as a temp solution to Bobs compiling problem.
2004-02-16 12:53:43 +00:00
randomtiger 8bf7c4076b Removed a lot of files that we dont need anymore.
Changed htl to be on by default, command now -nohtl
Changed D3D to use a 2D vertex for 2D operations which should cut down on redundant data having to go though the system.
Added small change to all -start_mission flag to take you to any mission by filename, very useful for testing.
Removed old dshow code and took away timerbar compile flag condition since it uses a runtime flag now.
2004-02-16 11:47:34 +00:00
bobboau 9a76ae8d12 fixed sevral asorted matrix errors,
OGL people make sure I didn't break anything,
most of what I did was replaceing falses with (if graphicts_mode == D3D)
2004-02-15 06:02:32 +00:00
bobboau a9dc8db3bb fixed bug involving 3d shockwaves, note I wasn't able to compile the directshow file, so I ifdefed everything to an older version,
you shouldn't see anything diferent, as the ifdef should be set to the way it should be, if it isn't you will get a warning mesage during compile telling you how to fix it
2004-02-15 03:04:25 +00:00
Goober5000 b99a6b6af2 hmph... fixed some bugs
--Goober5000
2004-02-14 04:26:58 +00:00
randomtiger 397699ec31 Please note that from now on OGL will only run with a registry set by Launcher v4. See forum for details.
OK, these changes effect a lot of file, I suggest everyone updates ASAP:
Removal of many files from project.
Removal of meanless Gr_bitmap_poly variable.
Removal of glide, directdraw, software modules all links to them, and all code specific to those paths.
Removal of redundant Fred paths that arent needed for Fred OGL.
Have seriously tidied the graphics initialisation code and added generic non standard mode functionality.
Fixed many D3D non standard mode bugs and brought OGL up to the same level.
Removed texture section support for D3D8, voodoo 2 and 3 cards will no longer run under fs2_open in D3D, same goes for any card with a maximum texture size less than 1024.
2004-02-14 00:18:37 +00:00
randomtiger 3529db4d37 Turned off fog in OGL for Fred.
Simulated speech doesnt say tags marked by $ now.
The following are fixes to issues that came up testing TBP in fs2_open and fred2_open:
Changed vm_vec_mag and parse_tmap to fail gracefully on bad data.
Error now given on missing briefing icon and bad ship normal data.
Solved more species divide by zero error.
Fixed neb cube crash.
2004-02-13 04:17:14 +00:00
phreak 694d089fe0 fixed a bug where the inferno build would get lower limits for MAX_PERSONAS if INF_BUILD was defined 2004-02-12 22:29:55 +00:00
Goober5000 de560ceb29 fixed the barracks crash bug
--Goober5000
2004-02-10 21:47:47 +00:00
matt 73c417bf70 Fixed issue with ships being rendered off center
in the HUD target box. Much easier than I
thought
-- Sticks
2004-02-10 05:07:38 +00:00
Goober5000 dfc06acfd3 fixed a small bug in FS1-compatible music
--Goober5000
2004-02-08 03:35:08 +00:00
Goober5000 1b0a949dc5 fix for undestroyable subsystems
--Goober5000
2004-02-07 05:11:08 +00:00
Goober5000 4e7667842b hehe, fixed the subsystem compare so it's not destructive :-p
and also fixed the model checking routine
--Goober5000
2004-02-07 01:25:15 +00:00
Goober5000 5129749cb8 made FS2 able to account for subsystem mismatches between ships.tbl and the
model file - e.g. communication vs. communications
--Goober5000
2004-02-07 00:48:53 +00:00
Goober5000 1fe6fa8b06 tweakage
--Goober5000
2004-02-06 23:17:43 +00:00
Goober5000 7034e99aa5 commented my tmap_num Asserts
--Goober5000
2004-02-06 23:00:29 +00:00
Goober5000 47e55fe686 fixed a small HUD bug I introduced
--Goober5000
2004-02-06 22:58:18 +00:00
Goober5000 668ddde68b fixed a small compatibility bug
--Goober5000
2004-02-06 21:26:07 +00:00
Goober5000 ea259b8961 ugh... okay, *really* fixed the head thing this time
--Goober5000
2004-02-06 21:25:43 +00:00
matt 3428289778 Fix for bad ambient lighting in non-htl -Sticks 2004-02-06 05:55:46 +00:00
Goober5000 12c9238f62 fixed a few random bugs
--Goober5000
2004-02-05 14:31:45 +00:00
Goober5000 360060f59d fixed the talking head error
--Goober5000
2004-02-05 14:29:33 +00:00
randomtiger 720b16befb Small changes, deleted old dshow stuff 2004-02-05 01:41:33 +00:00
Goober5000 def739c279 commented a decal function that someone missed
--Goober5000
2004-02-04 10:14:58 +00:00
Goober5000 0e9af797e5 changed spec and glow to be off by default; command lines are now -spec and -glow
--Goober5000
2004-02-04 10:14:25 +00:00
Goober5000 17665a6333 more player ai stuff
--Goober5000
2004-02-04 09:21:36 +00:00
Goober5000 58b82fefd8 got rid of unnecessary double semicolons
--Goober5000
2004-02-04 09:02:45 +00:00
Goober5000 66cb87e18f made code more uniform and simplified some things,
specifically shield percentage and quadrant stuff
--Goober5000
2004-02-04 08:41:04 +00:00
Goober5000 564fb3fd19 fixed Asserts in two places and commented out an unneeded variable
--Goober5000
2004-02-04 04:28:15 +00:00
randomtiger 89fe89775c Fixed OGL fogging in HTL
Changed htl laser function to work in D3D, commented out until function flat bug is fixed
2004-02-03 18:29:30 +00:00
phreak e112deb37a commented out decal references 2004-01-31 04:06:29 +00:00
phreak a6189c4fdd changed "now" to unsigned int 2004-01-31 03:56:46 +00:00
phreak ff7dca2d05 commented out decal references 2004-01-31 03:54:50 +00:00
phreak d83d4098de commented out file pending rewrite 2004-01-31 03:52:41 +00:00
Goober5000 3c2e1de05e whew - I just went through all the code I ever added (or at least, that I could
find that I commented with a Goober5000 tag) and added a bunch of Asserts
and error-checking
--Goober5000
2004-01-30 07:39:09 +00:00
randomtiger 492597e3b2 Added malloc montoring system, use -show_mem_usage, debug exes only to get an ingame list of heap usage.
Also added -d3d_notmanaged flag to activate non managed D3D path, in experimental stage.
2004-01-29 01:34:02 +00:00
phreak 9078d2aea6 bumped MAX_AI_CLASSES to 30 if INF_BUILD is defined 2004-01-26 23:07:43 +00:00
randomtiger c74f634e79 Fix to blurring of interface bitmaps from TGA and JPG.
Changes to the pointsprite system, better but not perfect yet.
2004-01-26 20:03:51 +00:00
randomtiger 72f0a923e0 I have submitted the new movie playing code despite the fact in D3D it sometimes plays behind the main window.
In OGL it works perfectly and in both API's it doesnt switch to the desktop anymore so hopefully people will not experience the crashes etc that the old system used to suffer from.
2004-01-24 15:52:26 +00:00
randomtiger 23be3b5605 Added the D3D particle code, its not bugfree but works perfectly on my card and helps with the framerate.
Its optional and off by default, use -d3d_particle to activiate.
Also bumped up D3D ambient light setting, it was way too dark.
Its now set to something similar to the original game.
2004-01-24 14:31:27 +00:00
randomtiger 49491fac75 Font and other small changes for Fred 2004-01-24 12:47:48 +00:00
randomtiger 8ebf284993 Fixed serious memory leak causes by use of -pcx32 flag 2004-01-23 00:14:27 +00:00
phreak 0a072d7403 bumped MAX_POLYGON_MODELS to 300 if INF_BUILD is defined. 2004-01-21 17:37:48 +00:00
phreak e862231feb added MAX_DRAW_DISTANCE to the ship selection display. This will only take effect if the ani isn't there 2004-01-21 17:37:04 +00:00
phreak f7df30b549 bumped MAX_PERSONAS to 25 if INF_BUILD is defined. 2004-01-21 17:34:31 +00:00
phreak 3f87bea143 added MAX_DRAW_DISTANCE constant 2004-01-21 17:33:47 +00:00
phreak e1dce56a56 added version string message if build is an inferno build 2004-01-21 17:32:05 +00:00
Goober5000 9ae52aa90a whoops, messed up the speech slightly
--Goober5000
2004-01-20 23:56:28 +00:00
Goober5000 2523a62878 added some initialization to get rid of warnings
--Goober5000
2004-01-20 23:01:52 +00:00
Goober5000 1762e4a6be got rid of some warnings... it actually looks like Gr_gamma_lookup can be changed
from int to ubyte, because everything that accesses it converts to a ubyte  O.o
--Goober5000
2004-01-20 22:59:09 +00:00
Goober5000 e691cbc995 changed the speech stubs to #defines
--Goober5000
2004-01-20 22:50:18 +00:00
Goober5000 f98f7e12be commented the variables in a commented function
--Goober5000
2004-01-20 22:39:06 +00:00
Goober5000 7034b6a0f0 First of all, this should be more readable, second of all, old_fog_color wasn't
initialized and VC++ is complaining.  Someone want to fix this?
--Goober5000
2004-01-20 22:37:44 +00:00
Goober5000 d240e24ef1 bumped MAX_SEXP_NODES to 3000
--Goober5000
2004-01-20 22:20:41 +00:00
Goober5000 8f497bfac7 er... corrected some inexplicable code... Bobboau, mind explaining?
--Goober5000
2004-01-20 22:13:06 +00:00
Goober5000 23601fda0d heat-seekers now home in on hidden ships
--Goober5000
2004-01-20 22:10:01 +00:00
randomtiger 278eedf7ad *** empty log message *** 2004-01-19 00:57:18 +00:00
randomtiger efe43d3466 Some more small changes for Fred OGL 2004-01-19 00:56:10 +00:00
randomtiger e19577e35c Few more small changes for Fred OGL 2004-01-18 14:55:08 +00:00
randomtiger 42568915bd A couple of FRED_OGL changes. 2004-01-18 14:03:23 +00:00
randomtiger 6ca2f86255 Changed the #ifndef FRED I added to #ifndef FRED_OGL so they only effect OGL FRED compile 2004-01-18 13:17:55 +00:00
randomtiger 32b0a71369 Some small changes to the main codebase that allow Fred_open OGL to compile. 2004-01-17 21:59:56 +00:00
Goober5000 2cf3e96a6b I think this will fix the problem of the death head ani sometimes incorrectly playing
--Goober5000
2004-01-14 21:12:24 +00:00
Goober5000 cc187b758d added error checking for an annoying crash when running an out-of-range
sound; also, Phreak misspelled "tertiary"
--Goober5000
2004-01-14 07:07:14 +00:00
Goober5000 ea11ea8a63 fixx0red a bug
--Goober5000
2004-01-14 06:38:41 +00:00
Goober5000 33212b6499 made set-support-ship number align with general FS convention
--Goober5000
2004-01-14 06:34:07 +00:00
randomtiger ef1880b03a Added new D3D particle module, will commit the code that uses it when its bug free. 2004-01-13 02:19:59 +00:00
randomtiger 077d4b2a54 Added fix for fogging debris in D3D htl. 2004-01-12 21:12:42 +00:00
phreak 07b00e2fae fixed a null pointer 2003-12-19 05:58:44 +00:00
phreak 018159b822 oops switched the signs in a comparison. thats what was causing debug builds to go haywire 2003-12-18 15:35:52 +00:00
phreak 7f20e9109f added a MAX_BUFFERS_PER_SUBMODEL define so it can be easily changed if we ever want to change the 16 texture limit 2003-12-17 23:25:10 +00:00
phreak 2cb5a44f3e fixed some logic when dealing with parsing local ssms 2003-12-17 20:38:26 +00:00
phreak 450ac81a1e added ai code for "small only" weapons. works for turrets at the moment 2003-12-17 16:42:20 +00:00
phreak dd840fe227 "small only" weapons flag added. weapon shoots at small ships like fighters 2003-12-17 16:41:25 +00:00
phreak 57772da95b disabled tertiary weapons support pending a rewrite of critical code 2003-12-16 21:06:21 +00:00
phreak e672918122 disabled tertiary weapons support pending a rewrite of critical code 2003-12-16 20:55:13 +00:00
phreak 6b00a67df0 made gr_set_proj_matrix use the MIN/MAX_DRAW_DISTANCE constants 2003-12-16 20:48:41 +00:00
phreak 8e68228c86 created two constants
MAX_DRAW_DISTANCE = 250000
MIN_DRAW_DISTANCE = 1
2003-12-16 20:42:36 +00:00
phreak 0cae377b72 replaced asserts in parse_ship with more descriptive warnings 2003-12-15 21:36:42 +00:00
phreak d343e5b73a made turrets use bob's $shots code 2003-12-15 21:32:59 +00:00
phreak 72cb0142b2 upped MAX_WEAPON_TYPES to 300 when INF_BUILD is defined 2003-12-15 21:30:24 +00:00
randomtiger ffdef38781 Put render state and other direct D3D calls repetition check back in, provides speed boost.
Fixed bug that caused fullscreen only crash with DXT textures
Put dithering back in for tgas and jpgs
2003-12-08 22:30:02 +00:00
randomtiger 0578517f3a D3D now supports loading for DXT1-5 into the texture itself, defaults to on same as OGL.
Fixed bug in old ship choice screen that stopped ani repeating.
Changed all builds (demo, OEM) to use retail reg path, this means launcher can set all them up successfully.
2003-12-05 18:17:07 +00:00
randomtiger f994cdac45 Added DDS image support for D3D
Added new command flag '-ship_choice_3d' to activate 3D models instead of ani's in ship choice, feature now off by default
Hopefully have fixed D3D text batching bug that caused old values to appear
Added Hud_target_object_factor variable to control 3D object sizes of zoom in HUD target
Fixed jump nodes not showing
2003-12-04 20:39:10 +00:00
randomtiger 1f16f9dc23 Changed -t32 flag to -jpgtga
Added -query_flag to identify builds with speech not compiled and other problems
Now loads up launcher if videocard reg entry not found
Now offers to go online to download launcher if its not present
Changed target view not to use lower res texture, hi res one is already chached so might as well use it
2003-12-03 19:27:01 +00:00
Goober5000 dbaf87c202 fixed CVS log header so that changes would update more cleanly
--Goober5000
2003-12-02 03:16:16 +00:00
randomtiger 391c18e9e7 Undid my node fix, it introduced a lot of bugs, update again if you have that version. 2003-11-29 17:13:54 +00:00
fryday 026e23d8ed Fixed normal loading in OpenGL HT&L.
Fixed lighting in OpenGL HT&L, hopefully for the last time.
Added a test if a normal is valid during model load, if not, replaced with face normal
2003-11-29 16:11:46 +00:00
randomtiger 8a579733c0 Small changes to D3D setup 2003-11-29 15:48:11 +00:00
randomtiger cfc99c4f23 Rendering jumpnodes in htl via the old system to make them display again, appears to be so cheap it wouldnt be worth the effort to convert it to true htl. 2003-11-29 14:54:35 +00:00
randomtiger dac33aeb71 Turned off D3D file mapping, its using too much memory which may be hurting older systems and doesnt seem to be providing much of a speed benifit.
Added stats command for ingame stats on memory usage.
Trys to play intro.mve and intro.avi, just to be safe since its not set by table.
Added fix for fonts wrapping round in non standard hi res modes.
Changed D3D mipmapping to a good value to suit htl mode.
Added new fog colour method which makes use of the bitmap, making this htl feature backcompatible again.
2003-11-29 10:52:10 +00:00
fryday 29af6aefbc Got lasers to work in HT&L OpenGL
Messed a bit with opengl_tmapper_internal3d, draw_laser functions, and added draw_laser_htl
2003-11-25 15:04:46 +00:00
Goober5000 99e6883251 fixed an old omission
--Goober5000
2003-11-25 02:32:16 +00:00
Goober5000 2513b23ad9 fixed bug in tech-reset-to-default
--Goober5000
2003-11-24 18:18:00 +00:00
Goober5000 d64d8ce6e0 fixed a bug introduced by Penguin for running with NO_NETWORK defined
--Goober5000
2003-11-23 00:59:01 +00:00
fryday 2f994399e9 Changed default alpha value for lasers in OpenGL to be like in D3D
Fixed Glowmaps being rendered with GL_NEAREST instead of GL_LINEAR.
Dynamic Lighting almost there. It looks like some normals are fudged or something.
2003-11-22 10:36:32 +00:00
phreak ad100d79dc changed PLAYER_MAX_DIST_WARNING to 700000 (700km)
changed PLAYER_MAX_DIST_END to 750000           (750km)

this makes the playing field much bigger
this way you don't get the "return to the field of battle messages"
in the future we should have the mission designer set this limit
2003-11-21 22:30:45 +00:00
randomtiger c11ed4873b Almost fully working 32 bit pcx, use -pcx32 flag to activate.
Made some commandline variables fit the naming standard.
Changed timerbar system not to run pushes and pops if its not in use.
Put in a note about not uncommenting asserts.
Fixed up a lot of missing POP's on early returns?
Perhaps the motivation for Assert functionality getting commented out?
Fixed up some bad asserts.
Changed nebula poofs to render in 2D in htl, it makes it look how it used to in non htl. (neb.cpp,1248)
Before the poofs were creating a nasty stripe effect where they intersected with ships hulls.
Put in a special check for the signs of that D3D init bug I need to lock down.
2003-11-19 20:37:25 +00:00
bobboau bbc8d83f37 got assert to work again 2003-11-17 06:52:52 +00:00
bobboau 9e0128f705 made the poly list dynamicly alocated,
started work on fixing the node model not rendering,
but most of that got commented out so I wouldn't have to deal with it
while mucking about with the polylist
2003-11-17 04:25:58 +00:00
Goober5000 c90c94b39f clarified and pruned debug spew messages
--Goober5000
2003-11-16 09:42:38 +00:00
Goober5000 9fc627aee5 language 2003-11-16 04:09:27 +00:00
Goober5000 edbc336888 fixed briefing scroll and display of "more"
--Goober5000
2003-11-16 04:08:47 +00:00
randomtiger 70ed9547a7 Put TGA and JPG stuff on -t32 flag
Put 32 bit PCX stuff on -pcx32 (still has bugs)
Added multisample checking on device initialisation
Changed unrecognised parameter message (as requested) to be more user friendly
Speech now chooses voice based on reg value set by launcher v3.1
2003-11-15 18:09:34 +00:00
Kazan 70ae616b0d *WARNING* Multi Compatability with previous versions now in question *WARNING*
[But that's ok, i incremented the multi version number the other day so that it will say "you don't have a compatable version"]

I upped the MAX_PACKET_SIZE from 512 to 4096 -- try and bust multi with more than ?130? ships now :D
2003-11-14 22:47:37 +00:00
Kazan 5801e69441 PXO_SID changed from unsigned to signed 2003-11-13 03:59:54 +00:00
Goober5000 d77dccf068 added Bobboau's real name to the credits, with his permission
--Goober5000
2003-11-12 06:05:00 +00:00
Kazan c157da28f6 (Kazan) /me slaps forehead... make sure things compile before committing.. sorry guys 2003-11-12 00:44:52 +00:00
Kazan a09b61d39e A few multi tweaks - fixed a couple warning-killing collisions between goober and me (kazan) 2003-11-12 00:31:45 +00:00
phreak ecfd1a015f changed g3_done_instance() calls to take a parameter to pop the T&L matrices 2003-11-11 18:12:41 +00:00
phreak 046e438380 made some functions that are there for 2d drawing not modify T&L matrices 2003-11-11 18:06:49 +00:00
phreak 0fd9bdff5e support for GL_ARB_vertex_buffer_object. should run real fast now with _VERY_
high poly ships
2003-11-11 18:05:02 +00:00
phreak 01e93d672c made g3_done_instance take a parameter that decides wether to pop the matrix stack.
without it, underflows would have been caused
2003-11-11 18:04:06 +00:00
phreak cd417c2158 made some g3_start_instance_matrix calls not affect any of the HT&L graphics
calls since they were called for internal calculations for 2D stuff
2003-11-11 17:59:27 +00:00
bobboau 2a522859ad shit load of bug fixing, much of it in nebula and bitmap drawing 2003-11-11 03:56:13 +00:00
Goober5000 1e6803a7fd ubercommit - basically spelling and language fixes with some additional
warnings disabled
--Goober5000
2003-11-11 02:15:47 +00:00
matt 1cf142d5d7 Fixed the projection matrix issues -Sticks 2003-11-10 02:44:36 +00:00
Goober5000 f1c749650c fixed spelling
--Goober5000
2003-11-09 07:36:52 +00:00
Kazan 4356a59467 a couple of htl functions being called in nonhtl (ie NULL functions) problems fixed
conflicts in cmdline and timerbar.h log entries
cvs stopped acting like it was on crack obviously
2003-11-09 06:31:40 +00:00
Goober5000 d3374eaabf edited for language
--Goober5000
2003-11-09 04:09:18 +00:00
Kazan 3ce9785fde Timerbar was enabled in both release and debug - so i made it a command line option "-timerbar"
DONT FUCK WITH OTHER PEOPLES INCLUDE PATHS
DONT MESS WITH EXEC NAMES (leave it fs2_open_r and fs2_open_d) or paths!
2003-11-08 22:25:47 +00:00
Kazan 4c6e954a04 yeah.. why didn't this commit last time 2003-11-08 21:55:03 +00:00
Goober5000 84cffa91f2 fixed a bug in my sexp code
--Goober5000
2003-11-08 04:31:02 +00:00
phreak 59bfbd24b1 reenabled timerbar 2003-11-07 20:55:15 +00:00
randomtiger cf61ab2454 Fixed a nohtl call to htl funcs (crash with NULL pointer)
Fixed a bug with 32bit PCX code.
Fixed a bug in the d3d_string batch system that was messing up screen shaking.
Added a couple of checks to try and stop timerbar push and pop overloads, check returns missing pops if you use the system.
Put in a higher res icon until we get something better sorted out.
2003-11-07 18:31:02 +00:00
Goober5000 9cb8408105 added some credit stuff
--Goober5000
2003-11-07 07:12:21 +00:00
phreak 82524891f5 fixed up some of the matrix functions that were causing problems
bob: i there is an important change here. i don't know if its going to cause any d3d problems
2003-11-06 22:49:22 +00:00
phreak 3b43f42ac8 added gr_start_**_matrix() and gr_end_**_matrix() around where 3d stuff is rendered 2003-11-06 22:47:37 +00:00
phreak aa3fe0ae83 added gr_start_**_matrix() and gr_end_**_matrix() around where ships are rendered 2003-11-06 22:47:02 +00:00
phreak 90adfed3f4 bob's stack functions implemented in opengl 2003-11-06 22:36:04 +00:00
randomtiger 694cab8b52 Added my batching solution for more efficient d3d_string.
Its part of the new grd3dbatch module, most of this isnt in use but it might help out later so I've left it in.
2003-11-06 21:10:26 +00:00
Kazan 28d7008b91 slight change to .dsp - leave the damn release target as fs2_open_r.exe already
added myself to credit
killed some of the stupid fscking warnings (including doing some casting and commenting out unused vars in the graphics modules)
Release builds should have warning level set no higher than 2 (default is 1)
Why the hell are we getting warning's about function selected for inline expansion... (killing them with warning disables)
FS2_SPEECH was not defined (source file doesn't appear to capture preproc defines correctly either)
2003-11-06 20:22:18 +00:00
matt baad5ab1a1 Added myself to the credits. -Sticks 2003-11-06 19:35:51 +00:00
randomtiger f0a1351b3d Added -d3d_no_vsync command to make turning off vsync optional.
Removed 32bit command, it doesnt do anything.
Made aa multisample reg check safe.
2003-11-03 18:07:26 +00:00
bobboau ea3b09b621 modified trails to render with tristrips now rather than with stinky old trifans,
MUCH faster now, at least one order of magnatude.
2003-11-02 05:50:08 +00:00
bobboau 0cc2b10c45 new matrix handeling code, and fixed some problems with 3D lit verts,
several other small fixes
2003-11-01 21:59:22 +00:00
Kazan fc0d71bd72 lil update 2003-10-30 15:30:23 +00:00
fryday 76dd81e73b Added code to handle MR_NO_ZBUFFER in d3d VB rendering code. 2003-10-30 08:20:36 +00:00
randomtiger eb1e903fbb D3D particle flicker fix, also fixes explosions and thruster glows 2003-10-29 18:18:52 +00:00
randomtiger 22f7acf0fb Updated timerbar code to work properly, also added support for it in OGL.
In D3D red is general processing (and generic graphics), green is 2D rendering, dark blue is 3D unlit, light blue is HT&L renders and yellow is the presentation of the frame to D3D. OGL is all red for now. Use compile flag TIMERBAR_ON with code lib to activate it.
Also updated some more D3D device stuff that might get a bit more speed out of some cards.
2003-10-29 02:09:18 +00:00
Goober5000 9ccd7a9006 tweakage
--Goober5000
2003-10-28 23:59:02 +00:00
randomtiger 731f460f7d Added -no_set_gamma flags
Fixed up some more non standard res stuff
Improved selection of device type, this includes using a pure device when allowed which means dev should not use Get* functions in D3D
Made fade in credits work
Stopped a call to gr_reser_lighting() in non htl mode when the pointer was NULL, was causing a crash loading a fogged level
Deleted directx8 directory content, has never been needed.
2003-10-27 23:04:23 +00:00
randomtiger 2851362007 Fixed hulls not drawing (with Phreaks advise).
Put my 32bit PCX loading under PCX_32 compile flag until its working.
Fixed a bug with res 640x480 I introduced with my non standard mode code.
Changed JPG and TGA loading command line param to "-t32"
2003-10-26 00:31:59 +00:00
phreak 7fe84d4e7c added an INF_BUILD option to bump max sounds to 400 if INF_BUILD is defined 2003-10-25 20:42:19 +00:00
bobboau a5729efca3 adding FOF stuff,
and fixed a small error in the matrix code,
I told you it was indeed suposed to be gr_start_instance_matrix
in g3_done_instance,
g3_start_instance_angles needs to have an gr_ API abstraction version of it made
2003-10-25 06:56:07 +00:00
phreak 38aa953754 fixed some old bugs that reappeared after RT committed his texture code 2003-10-25 03:27:50 +00:00
randomtiger ad224416de Implemented support for 32bit TGA and JPG for D3D
Also 32 bit PCX, but it still has some bugs to be worked out
Moved convert_24_to_16 out of the bitmap pfunction structures and into packunpack.cpp because thats the only place that uses it.
2003-10-24 17:35:05 +00:00
phreak c2e8ed3074 added code to render the user-defined skybox 2003-10-23 23:49:12 +00:00
phreak f4821c63f2 added code for the mission parser to recognize user defined skyboxes 2003-10-23 23:48:03 +00:00
randomtiger 4c0f6ab31f Bobs changes (take 2) 2003-10-23 18:03:25 +00:00
fryday bbe7d70bb1 Simplified model rendering, and it fixed up a serious bug on my system in which models with submodels didn't get their hull rendered 2003-10-23 13:53:36 +00:00
phreak 112f2cb5c8 commented out some mprintfs that kazan missed 2003-10-22 23:10:14 +00:00
phreak f6bdec81fe added gr_flip_window back in. its used in FRED 2003-10-21 18:23:15 +00:00
phreak 6e93c0772a cleaned up a bunch of repeated code 2003-10-20 22:32:37 +00:00
Goober5000 eeb0bcc3c6 added min, max, and avg sexps
--Goober5000
2003-10-20 11:49:18 +00:00
randomtiger 5132c845b0 Set gamma to 1.0 when quitting, someone was getting it carrying onto the desktop 2003-10-19 17:44:30 +00:00
phreak ea32ed86c9 clipping planes now work 2003-10-19 01:10:05 +00:00
phreak 2488f81b45 changed gr_start_instance_matrix(void) to gr_start_instance_matrix((vector*, matrix*) 2003-10-18 02:46:45 +00:00
phreak c40b01e40e edited gr_d3d_start_instance_matrix to make it take a vector* and a matrix*, but it doesn't do anything yet 2003-10-18 02:45:39 +00:00
phreak 9a4d8e46ef oops! forgot to bracket something off with an if :rolleyes: 2003-10-18 02:43:59 +00:00
phreak c9c0b38de5 switched around positions of gr_start_instance_matrix and gr_end_instance_matrix 2003-10-18 01:59:02 +00:00
phreak 591c5baca0 hardware transformation is working. now lighting needs to be done 2003-10-18 01:22:39 +00:00
randomtiger c9c5bdd7bb Big restructure for D3D and new modules grd3dlight and grd3dsetup 2003-10-17 17:18:43 +00:00
randomtiger 8ab51d480c D3D now has its own gamma system (stored in GammaD3D reg entry) that effects everything.
Put in Bobs specular fog fix.
2003-10-16 17:36:29 +00:00
Kazan cae9cec74b couple more types in species_defs.cpp, also finished up "Da Species Upgrade" 2003-10-16 16:38:17 +00:00
Kazan 16a51d7bf8 fixed typo in fallback code array index 2003-10-16 01:55:26 +00:00
randomtiger a338355f78 Added incomplete code to allow selection of non-standard modes in D3D (requires new launcher).
As well as initialised in a different mode, bitmaps are stretched and for these modes
previously point filtered textures now use linear to keep them smooth.
I also had to shuffle some of the GR_1024 a bit.
Put my HT&L flags in ready for my work to sort out some of the render order issues.
Tided some other stuff up.
2003-10-16 00:17:18 +00:00
Kazan 84cec97f57 Da Species Update :D 2003-10-15 22:03:27 +00:00
randomtiger 79f0e02ec2 Implemented hardware fog for the HT&L code path.
It doesnt use the backgrounds anymore but its still an improvement.
Currently it fogs to a brighter colour than it should because of Bob specular code.
I will fix this after discussing it with Bob.

Also tided up some D3D stuff, a cmdline variable name and changed a small bit of
the htl code to use the existing D3D engine instead of work around it.
And added extra information in version number on bottom left of frontend screen.
2003-10-14 17:39:18 +00:00
Goober5000 08dd57a3f9 tweaked a thingy with FS1-style music to make deciding the style less of a hack
--Goober5000
2003-10-14 16:47:34 +00:00
Goober5000 e30a7913b7 commented back in null vector warning, because any code that flags this
is buggy and should be fixed (and it only pops up in release builds anyway)
--Goober5000
2003-10-14 16:27:01 +00:00
matt 4d337c3fa7 prelim reworking of lighting code, dynamic lights work properly now
albeit at only 8 lights per object, although it looks just as good as
the old software version --Sticks
2003-10-13 19:39:20 +00:00
Kazan 5895ef7a46 Added Log Comment Thingy to these files 2003-10-13 06:02:50 +00:00
Kazan 9e870cd2d1 Removed a bunch of Useless *_printf()s in the rendering pipeline that were just slowing stuff down
Commented out the "warning null vector in vector normalize" crap since we don't give a rats arse
Added "beam no whack" flag for beams - said beams NEVER whack
Some reliability updates in FS2NetD
2003-10-13 05:57:50 +00:00
Kazan f51b8ec8bb #Kazan# FS2NetD client code gone multithreaded, some Fred2 Open -mod stuff [obvious code.lib] including a change in cmdline.cpp, changed Stick's "-nohtl" to "-htl" - HTL is _OFF_ by default here (Bobboau and I decided this was a better idea for now) 2003-10-12 03:46:23 +00:00
matt 773556dd2d Added -nohtl command line param to disable HT&L, nothing is IFDEFd
out now. -Sticks
2003-10-10 03:59:41 +00:00
phreak ae39e8614f grabbed the most current version from: http://oss.sgi.com/projects/ogl-sample/ABI/ 2003-10-08 21:01:21 +00:00
argv 4ffeb7d3db Negative repeat count means repeat indefinitely. A trivial change, it should not break anything. 2003-10-08 06:32:06 +00:00
Goober5000 f58c06b028 fixed some warnings
--Goober5000
2003-10-07 03:43:22 +00:00
Kazan d865f3520c Oopsie! Forgot to commit these with the rest of the fs2netd TCP update 2003-10-06 04:33:11 +00:00
phreak 3c19786ae3 bug squashing.
preliminary tnl work done
2003-10-05 23:40:54 +00:00
Kazan 25939ab572 fs2netd now TCP 2003-10-04 22:42:23 +00:00
phreak a5fcf64a5f shinemapping completed. it works!
-phreak
2003-10-04 00:26:43 +00:00
Goober5000 562f5e7f6a updated FRED to import FS1 default weapons loadouts as well as missions
--Goober5000
2003-09-30 04:05:09 +00:00
Goober5000 3106f14f92 added the option to import FSM missions, added a replace function, spruced
up my $player, $rank, etc. code, and fixed encrypt being misspelled as 'encrpyt'
--Goober5000
2003-09-28 21:22:59 +00:00
Kazan 436276a812 ##Kazan## Quick little update of fs2netd stuff to resolve a few issues 2003-09-26 15:34:26 +00:00
bobboau 1a2be91e2a commiting Hardware T&L code, everything is ifdefed out with the compile flag HTL
still needs a lot of work, ubt the frame rates were getting with it are incredable
the biggest problem it still has is a bad lightmanegment system, and the zbuffer
doesn't work well with things still getting rendered useing the sofware pipeline, like thrusters,
and weapons, I think these should be modifyed to be sent through hardware,
it would be slightly faster and it would likely fix the problem

also the thruster glow/particle stuff I did is now in.
2003-09-26 14:37:16 +00:00
Kazan 0b87224e39 ##Kazan## FS2NetD Completed! Just needs some thorough bug checking (i don't think there are any serious bugs)
Also D3D8 Screenshots work now.
2003-09-25 21:12:24 +00:00
Kazan eff6a6efc4 ##KAZAN## FS2 Open PXO --- W00t! Stats Storage, everything but table verification completed! 2003-09-24 19:35:59 +00:00
Kazan edd5287f84 ##KAZAN## - FS2NetD Support! (FS2 Open PXO) -- Game Server Listing, and mission validation completed - stats storing to come - needs fs2open_pxo.cfg file [VP-able] 2003-09-23 02:42:54 +00:00
unknownplayer 71f159840b Minor bugfix to the 3D ship code. There still may be some cases where it will
fail to load the model file it needs, but I'm at present mystified as to why.
2003-09-16 13:30:16 +00:00
unknownplayer 854041749b Changed the ship selection window to load the 3D FS2 ship models instead
of the custom *.ani files. It just does a techroom rotation for now, but I'll add
more features later - tell me of any problems or weirdness caused by it, or if
you don't like it and want it as an option only.
2003-09-16 11:56:46 +00:00
fryday a4a77744d6 Rollback killed my lens-flare. D'oh. 2003-09-15 12:34:09 +00:00
wmcoolmon dac335f3dd Changed "cell" to "Cmdline_cell" -C 2003-09-14 19:02:06 +00:00
wmcoolmon 275ba09a3b Changed "nospec" to "Cmdline_nospec" -C 2003-09-14 19:00:36 +00:00
wmcoolmon 40ab7fc0f3 Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell" 2003-09-14 19:00:02 +00:00
wmcoolmon 3b16380936 Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C 2003-09-14 18:32:41 +00:00
Goober5000 67e18e30a7 fixed case-sensitivity bugs and possibly that Zeta wing bug
--Goober5000
2003-09-13 20:59:54 +00:00
Goober5000 293e984d60 added some minor things, such as code cleanup and the following:
--turrets will not fire at cargo
--MAX_SHIELD_SECTIONS substituted for the number 4 in many places
--supercaps have their own default message bitfields (distinguished from capships)
--turrets are allowed on fighters
--jump speed capped at 65m/s, to avoid ship travelling too far
--non-huge weapons now scale their damage, instead of arbitrarily cutting off
----Goober5000
2003-09-13 08:27:29 +00:00
Goober5000 35bf641cb7 clean rollback of all of argv's stuff
--Goober5000
2003-09-13 06:02:08 +00:00
Goober5000 c86461fd22 fixed a bunch of compile-time errors and warnings
--Goober5000
2003-09-12 03:57:01 +00:00
Goober5000 498edeb86e grr...fixed more stuff
--Goober5000
2003-09-12 03:17:33 +00:00
Goober5000 e6c7719bf4 clarified stuff and tweaked the damage ratio for big ships
--Goober5000
2003-09-12 02:08:57 +00:00
Goober5000 e907a052e5 why was the bomb commented out?
--Goober5000
2003-09-12 01:43:57 +00:00
Goober5000 6f089c21c5 added XSTR and fixed readability
--Goober5000
2003-09-12 01:38:13 +00:00
Goober5000 3d8ad87da9 rolled back _argv[-1]'s supercilious commit -- fyi, INF_BUILD is used by
the Inferno campaign
--Goober5000
2003-09-12 01:23:53 +00:00
Goober5000 92a0ed3c6d cleaned up some logic
--Goober5000
2003-09-12 01:12:49 +00:00
argv 988b86238f Removed #ifdef INF_BUILD -- this is only referenced once, so what the hell is it for? 2003-09-12 01:02:50 +00:00
argv f2c019adc3 Minor cosmetic fix. 2003-09-12 00:34:05 +00:00
Goober5000 bda256f095 nitpicked the number 4 to the constant MAX_SHIELD_SECTIONS
--Goober5000
2003-09-12 00:12:13 +00:00
Goober5000 77e48b4849 made code a bit more readable
--Goober5000
2003-09-11 23:59:32 +00:00
Goober5000 0ea85483dc minor fix because initialization is done in various routines
--Goober5000
2003-09-11 23:39:01 +00:00
Goober5000 54a034da9a Rolled back _argv[-1]'s changes to the sexp infrastructure, which would
have broken a huge amount of stuff and created some nasty bugs.
Also commented most of _argv[-1]'s new sexps pending consolidation,
and added a placeholder help entry for the one good sexp.
--Goober5000
2003-09-11 23:21:54 +00:00
argv 84d249db18 New weapon table flags, configurable beam whacking, subsystem display names, new energy system, modified the meaning of big damage. 2003-09-11 19:48:00 +00:00
argv 5a1b5233b8 Random beam slash, new energy system, redefinition of what hurts big ships (beams don't), subsystem display names, configurable beam whacking. 2003-09-11 19:45:34 +00:00
argv 3a88ee37ed Made the EMP flash message look a little better. 2003-09-11 19:44:27 +00:00
argv 67464a2ad4 New energy system, fixes, random beam slash, don't slash if targeting a subsystem, surface shields, singular shields, configurable beam whacking, friendly beam fire does full damage. 2003-09-11 19:43:43 +00:00
argv e1775947ec Fix really nasty crash bug when not all stars table entries have a flare. 2003-09-11 19:39:55 +00:00
argv f18771b309 New energy system, fixes, apply skill damage scaling to all ships, new energy system. 2003-09-11 19:39:03 +00:00
argv 1716850f80 Fix fast player ships missing the subspace tunnel when jumping out, increased max simultaneous ship explosions to 16, new energy system. 2003-09-11 19:36:20 +00:00
argv 9ff5945744 New energy system, ship table flag big guns in front, increase max ship types to 400. 2003-09-11 19:34:29 +00:00
argv 13d91d590b New energy system, singular shield support, some new ship table flags, no draw of thrusters when they are off, fixes. 2003-09-11 19:33:07 +00:00
argv 4611c36631 Singular shield support, and a couple of fixes. 2003-09-11 19:28:52 +00:00
argv 0d5eb222a9 All kinds of changes, from AI intelligence to singular shield support. 2003-09-11 19:27:30 +00:00
argv 3508e8d309 Ship flag big guns in front. 2003-09-11 19:26:13 +00:00
argv cafe8965c1 New energy system. 2003-09-11 19:25:00 +00:00
argv 5604bced59 All player ships may now carry turrets, not just bombers. 2003-09-11 19:24:11 +00:00
argv 08e2943edb Lateral movement speed is now affected by engine power. 2003-09-11 19:23:18 +00:00
argv 656623be9c Several new sexps, such as power drain control. Also increased maximum sexp operators to 4096, though there may be another limit at 1024. 2003-09-11 19:18:13 +00:00
argv 3ccc1da630 Singular shield support. 2003-09-11 19:16:45 +00:00
argv 01c12c8010 Surface shields. 2003-09-11 19:15:29 +00:00
argv dbd2ee4f3c New energy system, table subsystem flags including beam free by default, subsystem display name. 2003-09-11 19:14:14 +00:00
argv 84a5ae3268 Ship flag2 beam-free-all. 2003-09-11 19:12:40 +00:00
argv 949d8446f1 Don't restore saved loadouts on scramble missions. 2003-09-11 19:11:36 +00:00
argv f7e17e90a7 Crash avoidance, ship flag2 beam-free-all. 2003-09-11 19:10:33 +00:00
argv f0078cc8fc Singular shield support, beam-free-all ship flag2, negative repeat count means repeat indefinitely. 2003-09-11 19:09:44 +00:00
argv 833164823d Negative repeat count means repeat indefinitely. 2003-09-11 19:08:11 +00:00
argv 77deede2de Turret display names. 2003-09-11 19:07:11 +00:00
argv 085a0aa0d4 Singular shield support, and a couple of other things. 2003-09-11 19:06:27 +00:00
argv 3edcb0a519 New energy system support. 2003-09-11 19:05:10 +00:00
argv c6ba1645a1 New energy system, auto ETS, etc. 2003-09-11 19:04:36 +00:00
argv e1d2dfcf9e Various new command-line options, stuffed into my own Argv_options struct to avoid namespace pollution. 2003-09-11 18:55:23 +00:00
fryday dccaa30202 Added Lens Flares, enabled by optional table entry in stars.tbl on a per-sun basis 2003-09-10 11:38:31 +00:00
fryday e205ab47a2 Fixed specular for dynamic lights, optimized it a bit 2003-09-09 21:26:23 +00:00
matt a2e351779d Broke stars last commit, fixed -Sticks 2003-09-09 17:18:25 +00:00
matt f85ca67666 Added -nospec cmd line param to disable specular -Sticks 2003-09-09 17:10:55 +00:00
Goober5000 e1261c0340 if player has primitive sensors, hud will not display shield icons or message sender brackets
--Goober5000
2003-09-09 05:51:14 +00:00
randomtiger 89e4dc4fd5 Checked in new speech code and calls from relevent modules to make it play.
Should all work now if setup properly with version 2.4 of the launcher.
FS2_SPEECH can be used to make the speech code compile if you have SAPI 5.1 SDK installed.
Otherwise the compile flag should not be set and it should all compile OK.

- RT
2003-09-07 18:14:54 +00:00
drevil fa480451d1 Changed sender to [email protected] instead of just 'fs2source' to
get around member only posts to mailing list requirement
2003-09-07 12:46:59 +00:00
drevil a42cf30bdb Testing commits. 2003-09-07 12:42:46 +00:00
wmcoolmon 225bc96739 Added "+Subsystem Repair Ceiling:" after "+Hull Repair Ceiling:" (formerly "+Support Repair Ceiling:" 2003-09-06 20:41:52 +00:00
wmcoolmon e15beaa7f9 Added ability to limit subsystem repairs 2003-09-06 20:40:01 +00:00
wmcoolmon fcc1ea98c4 Minor bugfix (changed an == to >=) 2003-09-06 19:14:50 +00:00
wmcoolmon afb0e066b0 Added optional mission parameter "+Support Repair Ceiling", which sets what percentage a support ship can repair a ship's hull to. 2003-09-06 19:09:24 +00:00
wmcoolmon 7b5548642a Made it possible to limit how much support ships repair a ship's hull. 2003-09-06 19:07:31 +00:00
matt 5f1898c503 Minor d3d star popping fix 2003-09-05 22:35:33 +00:00
Goober5000 7854fb293f bah - fixed a dumb bug
--Goober5000
2003-09-05 10:41:48 +00:00
Goober5000 1e04df322c merged num-ships-in-battle and num-ships-in-battle-team, making the
team argument optional
--Goober5000
2003-09-05 05:06:32 +00:00
Goober5000 fb12c1df6e merge of Phreak's and my sexp.cpp
--Goober5000
2003-09-05 04:48:03 +00:00
Goober5000 c4fcafccc5 merge of Phreak's and my sexp.h
--Goober5000
2003-09-05 04:39:55 +00:00
Goober5000 cfbc2ebb46 well, let's see here...
* persistent variables
* rotating gun barrels
* positive/negative numbers fixed
* sexps to trigger whether the player is controlled by AI
* sexp for force a subspace jump

I think that's it :)
--Goober5000
2003-09-05 04:25:29 +00:00
phreak 4a85d415e5 fixed a small bug in num-ships-in-battle-team
added an option to loop sounds played by play-sound-from-file
2003-09-05 02:15:34 +00:00
bobboau 94c2fab5b0 an asortment of bugfixes, mostly with the specular code,
HUD flickering should be completly gone now
2003-08-31 06:00:42 +00:00
phreak d6b179d3b5 added num-ships-in-battle and num-ships-in-battle-team sexp 2003-08-30 21:59:48 +00:00
Goober5000 32f7fd2c11 bumped version to 3.5.5
--Goober5000
2003-08-30 20:55:09 +00:00
phreak 5a858562cc fixed some random specular lighting bugs 2003-08-30 14:49:01 +00:00
Goober5000 eb800ebbbc implemented rotating barrels for firing primary weapons
--Goober5000
2003-08-28 20:42:18 +00:00
Goober5000 f3bd46dab2 trying to commit
--Goober5000
2003-08-28 06:17:29 +00:00
Goober5000 b11a8c02a0 trying to commit
--Goober5000
2003-08-28 05:46:52 +00:00
Goober5000 7564ecb19f added percent-ships-disarmed and percent-ships-disabled
--Goober5000
2003-08-27 02:04:54 +00:00
Goober5000 65fd9ef338 added is-ship-type, is-ship-class, lock-rotating-subsystem, and free-rotating-subsystem;
also fixed the argument and return values for various sexps so that they work
properly for negative numbers
--Goober5000
2003-08-27 01:38:00 +00:00
Goober5000 aab49a95db fixed a strange thing that Bobboau inexplicably put in
--Goober5000
2003-08-27 01:36:22 +00:00
Goober5000 f0110fab45 added extra code to enable playing of FS1 music tracks
--Goober5000
2003-08-25 04:46:53 +00:00
Goober5000 3c053feb30 added replacement of $rank with the player's rank in any string that appears
in-game (same as with $callsign); also bumped the limit on the length of text
allowed per entry in species.tbl
--Goober5000
2003-08-25 04:45:57 +00:00
Goober5000 68fde7a8ce fixed unreachable code
--Goober5000
2003-08-25 04:39:17 +00:00
bobboau abf067f708 specular code should be bugless now,
cell shadeing has been added activated via the comand line '-cell',
3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
2003-08-22 07:35:09 +00:00
Goober5000 0151279a55 bumped max intel entries to 30
--Goober5000
2003-08-22 07:24:07 +00:00
Goober5000 633c391b4d implemented $callsign to add the player callsign in a briefing, message, or whatever
--Goober5000
2003-08-22 07:01:57 +00:00
phreak fee9ff59ef warp effects and fireballs have their own distinct colors 2003-08-22 03:39:35 +00:00
randomtiger 290da64ffe Fixed switching - RT 2003-08-21 20:54:39 +00:00
phreak 46479ac3a0 added specular highlights. still needs shine mapping 2003-08-21 15:07:45 +00:00
phreak 016e525f62 zeroed out the specular fields since they caused some flickering 2003-08-21 15:04:17 +00:00
Goober5000 58cb8f4a36 yet another attempt to commit dsp files
--Goober5000
2003-08-21 09:00:58 +00:00
Goober5000 240c74da4e fixed set-support-ship sexp
--Goober5000
2003-08-21 09:00:19 +00:00
Goober5000 897d3f8ad5 fixed turret text display for non-laser weapons
--Goober5000
2003-08-21 08:31:24 +00:00
Goober5000 3916653149 ships that have no afterburners will no longer have the afterburner gauge drawn
--Goober5000
2003-08-21 06:31:19 +00:00
Goober5000 0baf2f7bc9 primary weapons will now truncate properly at a '#' symbol, just like secondaries
--Goober5000
2003-08-21 06:18:52 +00:00
Goober5000 ef83ecbc05 removed an extraneous thingy
--Goober5000
2003-08-21 06:11:32 +00:00
Goober5000 53834ee415 Ballistic primaries will now deplete ammo correctly - that is, ammo will be
reduced by the number of firing points, not necessarily 1.
--Goober5000
2003-08-21 06:11:09 +00:00
Goober5000 7dcc40de8a "Fixed" the ballistic primary rearm bug. I have no idea how... I have to assume
it's a bug in MSVC.
--Goober5000
2003-08-21 05:50:00 +00:00
wmcoolmon edfd3fdc85 Modified find_file_location to speed up file loading. 2003-08-20 08:14:50 +00:00
wmcoolmon 39e9cddb5f Made cfile_delete return 0 on failure, 1 on success 2003-08-20 08:12:08 +00:00
wmcoolmon 450ea5c63e Added error screens to the barracks and start screens when a pilot file can't be deleted 2003-08-20 08:11:28 +00:00
bobboau 36668ce6a1 update for the specmapping code includeing
suport for seperate specular levels on lights and
optional strings for the stars table
code has been made more organised,
though there seems to be a bug in the state selecting code
resulting in the HUD being rendered incorectly
and specmapping failing ocasionaly
2003-08-16 03:52:24 +00:00
bobboau 8cacc9b1a0 Specular 'shine' mapping;
useing a phong lighting model I have made specular highlights
that are mapped to the model,
rendering them is still slow, but they look real purdy

also 4 new (untested) comand lines, the XX is a floating point value
-spec_exp XX
the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
-spec_point XX
-spec_static XX
-spec_tube XX
these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
static is the local stars,
point is weapons/explosions/warp in/outs,
tube is beam weapons,
for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
2003-08-12 03:18:34 +00:00
bobboau 03dd93b79d slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported 2003-08-09 06:07:24 +00:00
phreak ee79809edc added code to take into account a tertiary reactor pod 2003-08-06 17:50:01 +00:00
phreak 257675bb93 changed the weapon ammo gauges to show additional ammo if a tertiary ammo pod is being used 2003-08-06 17:44:20 +00:00
phreak d9a01620f6 since the launcher has a space between 1024 and 768 for the videocard string, i changed the detection to reflect this
also changed intro.mve to intro.avi since we can't use MVEs
2003-08-06 17:42:47 +00:00
phreak 3b15d779d6 since the afterburners are routed through the physics engine, i needed to route the boost pod through here too 2003-08-06 17:39:49 +00:00
phreak 19796f7538 added a thing to set max thrust when tertiary boost pod is engaged 2003-08-06 17:39:04 +00:00
phreak e594563d00 preliminary work on tertiary weapons. it doesn't really function yet, but i want to get something committed 2003-08-06 17:37:08 +00:00
phreak 15d394edbf changed default texture filtering to GL_LINEAR 2003-08-06 17:26:20 +00:00
phreak b07476fc96 optimized the way cloaking is handled 2003-08-06 17:24:57 +00:00
bobboau d3e4c5c30b glow maps, for some reason they wern't in here, they should be now,
also there is some debug code for changeing the FOV in game,
and I have some changes to the init code to try and get a 32 or 24 bit back buffer
if posable, this may cause problems for people
the changes were all marked and if needed can be undone
2003-08-05 23:45:18 +00:00
phreak 839be403b1 ai now properly uses rapid fire dumbfires 2003-08-03 23:38:08 +00:00
phreak 5c2c0ab09f changed some z-buffer stuff so it doesn't clip as noticably 2003-08-03 23:35:36 +00:00
inquisitor 81f8a9e375 cleanup of old makefile dsws 2003-07-22 14:11:06 +00:00
fryday 4386cab9bc added fsspeech.cpp fsspeech.h speech.cpp speech.h into code/sound
They include RT's speech code. Add the preprocessor definition FS2_SPEECH to enable text-to-speech at compile-time.
Requires the Microsoft speech SDK Version 5.1 (around 55MB download).
2003-07-19 16:10:48 +00:00
phreak 00773de340 fixed a dumb bug 2003-07-16 23:12:44 +00:00
phreak 450bd1e213 lighting in the render functions now work for opengl as they do in d3d 2003-07-15 16:09:46 +00:00
phreak 2092c2705f trails now properly alphablend in ogl as it does in d3d 2003-07-15 16:07:12 +00:00
phreak e592c64d8f higher particle limits for opengl. now matched d3d 2003-07-15 16:06:24 +00:00
phreak 0f275acc12 the game handles colored laser lighting for opengl now.
this used to be exclusive to d3d
2003-07-15 16:05:33 +00:00
phreak af1da198b3 the cutscene section in the techroom does not append *.mve onto a filename 2003-07-15 02:58:08 +00:00
phreak e75e4b5640 opengl now doesn't try to shutdown when its not running.
could cause problems on startup
2003-07-15 02:53:54 +00:00
phreak 9ed49694bf ships now decloak when firing 2003-07-15 02:52:40 +00:00
phreak b0088c67ba cloaked ships will reduce brightness with distance 2003-07-15 02:51:43 +00:00
phreak 3505a530d0 fixed a warning.
previous cvs message should read: cloaked ship will decloak if a turret fires
2003-07-15 02:51:01 +00:00
phreak ec87a1f3ad cloaked ships now are less visible with distance 2003-07-15 02:41:41 +00:00
phreak 0c9c758dbd fixed problem where beams that ignore shields do not fully damage the target
disabled attenuation for beams, pending rework
2003-07-15 02:39:59 +00:00
phreak 17a9178c8b models that are fully cloaked draw front-to-back 2003-07-15 02:37:59 +00:00
phreak 7628e19f26 changed the model_setup_cloak() function to allow an alpha value 2003-07-15 02:36:54 +00:00
phreak 97b506ca15 added a debug key to cloak targeted ship ~+shift+x 2003-07-15 02:35:59 +00:00
phreak 7c1c973917 fun work optimizing the cloak effect 2003-07-15 02:34:59 +00:00
randomtiger e7340e703b Random Tiger 6/7/2003
fs2_open now uses the registry entry 'VideocardFs2open' instead of 'Videocard' to store its video settings. To run fs2_open now you MUST use the launcher I have provided.

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

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

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

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

When trying to run the exe after updating I get an error parsing 'rank.tbl' but im fairly sure thats nothing to do with me so I'll just have to leave it for now because I'm still using a 56K modem and cant afford to find out.
2003-07-06 00:19:25 +00:00
phreak 1fa5e2bf54 support for cloaking added. needs a cloakmap.pcx
to cloak the players ship, activate cheats and press tilde + x
some more work can be done to smooth out the animation.
2003-07-04 02:30:54 +00:00
phreak dc12e5dd1e changes for cloaking implemented 2003-07-04 02:28:37 +00:00
phreak 2c62498b62 added support for cloaking.
i will need to contact someone who knows d3d to get this to work
2003-07-04 02:27:48 +00:00
phreak 2eb193101a tilde + x cloaks a ship 2003-07-04 02:26:15 +00:00
phreak 11d8d11b04 ai now properly fires bomber+ missiles at capital ships. 2003-07-02 03:31:27 +00:00
phreak 37b0bd28ce added support for weapons that only fire when tagged
also added limited firing range for local ssms
2003-06-25 03:21:03 +00:00
phreak 13cccac317 added support for weapons that only fire when tagged 2003-06-25 03:19:40 +00:00
phreak 4fce3b9610 changed around ai code to take into account a limited lock range for local ssms 2003-06-25 03:16:32 +00:00
phreak fc22d35695 weapon energy cheat does not carry over from mission to mission 2003-06-25 03:13:48 +00:00
phreak 091c8b4d7e display lock triangle for local ssms only if its in range specified in weapons.tbl 2003-06-25 03:13:02 +00:00
phreak 8d4512a612 added turret-tagged-specific and turret-tagged-clear-specific sexps 2003-06-19 18:12:12 +00:00
phreak c80bab1fcc undefined DBUGFILE_ACTIVE for release builds 2003-06-16 16:39:42 +00:00
phreak ca0683ecfa fixed a small bug where rotating subobjects wouldn't work on a player ship
also changed "+PBank Capacity:" to "$PBank Capacity:" when parsing
ballistic primaries. goob knows about this
2003-06-16 03:36:08 +00:00
phreak 31cfd8011f fixed a bug where local ssms may miss the warphole when entering subspace 2003-06-14 22:56:17 +00:00
phreak 371f2e3869 capital ship turrets that use the "huge" flag will not target bombs
this will prevent large beams from shooting the player if he shoots a bomb at a destroyer
2003-06-14 21:22:42 +00:00
phreak cd48667a38 added a warning that will display if a modder puts in a local ssm that:
is a laser or beam
doesn't home
2003-06-13 15:33:57 +00:00
phreak 45d02246ee local ssms fired without lock will not enter subspace at all 2003-06-12 21:21:26 +00:00
phreak 25e339a4d6 local ssm warpin is now handled better than what i committed earlier 2003-06-12 17:45:54 +00:00
phreak 155f0f1cce fixed a minor bug where local ssms will warpin at 0,0,0 if their target was destroyed while in subspace 2003-06-12 16:54:06 +00:00
phreak 807ee34c9d turrets now properly use local ssms 2003-06-12 16:53:16 +00:00
phreak 123515a33d i hate to update again so soon, but i forgot to mark hostile local ssms that
were in stages 2 or 4 as warping so their blip color would then be blue
2003-06-11 03:15:17 +00:00
phreak cc741f5029 i hate to update again so soon, but there was a compile warning that i accidently passed over 2003-06-11 03:13:39 +00:00
phreak 0fc5f831fc local subspace missiles are now in game. yay 2003-06-11 03:06:07 +00:00
phreak ecf181a2c7 the ai can now use local ssms. they are able to use them at *very* long range 2003-06-11 03:03:16 +00:00
phreak 000257bd8e the radar will not show stage 3 local ssms 2003-06-11 03:01:27 +00:00
phreak 30cbbfedf3 changed around collision code to handle the possible variance in speeds when using local ssms 2003-06-11 03:00:50 +00:00
phreak 47cd793262 local ssm stuff for hud.
they are always in lock range due to the subspace drive on them
they also can't be targeted when in stage 3.
2003-06-11 02:59:48 +00:00
phreak ed6be03aa0 the real position is now copied in g3_rotate_vertex 2003-06-08 17:39:35 +00:00
phreak afd83a21fb added a vector in the vertex struct that stores the real world position
the x,y,z variables do not accurately reflect the real position
this is for opengl fogging
2003-06-08 17:38:21 +00:00
phreak 4a030dfb73 debris is now properly fogged 2003-06-08 17:31:37 +00:00
phreak e4b6bc70bc fixed a compile error that was accidently committed 2003-06-08 17:29:51 +00:00
phreak fcaa985c2d bmp_gfx_get_components now works with 32 bit opengl 2003-06-07 21:08:09 +00:00
phreak 3574628259 fixed minor fogging bug 2003-06-07 20:51:06 +00:00
phreak be71b9f6b5 final fix (hopefully) to zero mass value bug 2003-06-04 15:32:54 +00:00
phreak 5f5fe2b8cc fixed a small bug
ai_select_primary_weapon may have a null pointer passed to it.
2003-06-04 15:31:49 +00:00
phreak 5ff5467673 added some code that took advantage of opengl fogging stuff 2003-06-04 15:28:24 +00:00
phreak 809b0155df added Sesquipedalian's kamikaze and not-kamikaze sexps 2003-05-24 16:47:58 +00:00
phreak 1e6670c1b7 defined USE_OPENGL
should eliminate the "unable to init 104" warnings
2003-05-22 19:41:52 +00:00
drevil bda9f63f59 Updated cvs administrative files. 2003-05-22 15:14:39 +00:00
phreak ea966211b5 fixed *minor* problem where ships that were disabled during warpout were not
registering on sensors
2003-05-21 21:07:31 +00:00
phreak 1771fd2d3b fixed disappearing ship bug when a ship is disabled during warpout 2003-05-21 20:28:53 +00:00
phreak 7dd22631a9 hud is drawn when in chase camera for player 2003-05-21 20:27:07 +00:00
phreak 7146c9f90c improved chase camera code.. you can now fight using this camera 2003-05-21 20:26:07 +00:00
phreak 63a90da345 improved glowmap rendering speed 2003-05-21 20:23:00 +00:00
phreak 29a0e77753 clarified an error message in subsys_set 2003-05-15 19:08:24 +00:00
phreak 1760554305 game_loading_callback_init() now displays a user-defined loading screen 2003-05-09 23:54:59 +00:00
phreak 3f391d36b2 possible fix to ships with no mass values 2003-05-09 23:53:32 +00:00
phreak fee9efe1db changed around code in parse_mission_info() to support user-defined loading screens 2003-05-09 23:52:01 +00:00
phreak c8a2551a6e added fields to the "mission" struct to allow for user-specified loading screens 2003-05-09 23:51:04 +00:00
phreak 9e5a3781b7 fixed old bug that created "mouse trails" during a popup screen
a result of doing something a long time ago that i thought was right, but wasn't
2003-05-07 00:52:36 +00:00
phreak fa960dc625 if "Show Background" is not set it FRED,
it used to show background bitmaps and suns
not anymore
2003-05-05 21:27:46 +00:00
Goober5000 364767a0b4 fixed small bug inadvertently added by Phreak affecting the custom hitpoints
mod; also fixed a small bug in the new disruption mod (disrupting all subsystems,
as opposed to only those within the weapon radius)
--Goober5000
2003-05-05 20:55:44 +00:00
phreak abdd8a6a79 minor fred bug fixed 2003-05-05 20:13:07 +00:00
phreak 15be002888 added my real name 2003-05-05 19:29:24 +00:00
phreak af9f703302 added additional error info incase gr_opengl_flip() fails for some unknown reason 2003-05-04 23:52:40 +00:00
phreak 944981b835 ABtrails are only processed if they are using a bitmap.
this should be the end of the "missiles without trails" bug
2003-05-04 20:51:14 +00:00
phreak f7760d69c0 bumped MAX_TRAILS to 500 because of afterburner trails 2003-05-04 20:50:06 +00:00
phreak b63c14fcb7 minor fix in gr_opengl_flip()
should be end of the "unable to swap buffer" error
2003-05-04 20:49:18 +00:00
phreak 7ec2608d58 beams can't fire when disrupted.
cycle ends if the beam is firing and shooting ship is disrupted
2003-05-04 20:21:00 +00:00
phreak 881b31f7fa ships that are disrupted now have arcs around them much like the emp effect 2003-05-04 20:08:04 +00:00
phreak 6be53b57e1 fixed mispelling 2003-05-04 19:51:28 +00:00
phreak 13338a1c76 added multipliers for beam turrets and sensors for disruptor missiles 2003-05-03 23:47:04 +00:00
phreak f843302d16 background stars are now somewhat colored, just here as a sort of useless feature test 2003-05-03 16:58:40 +00:00
phreak f4fe757d5d changed around the way disruptor weapons work 2003-05-03 16:48:08 +00:00
Goober5000 1a410e1f09 implemented the custom hitpoints mod
--Goober5000
2003-04-29 01:03:24 +00:00
Goober5000 79fff22d2e fixed some scrolling issues; added scroll bar to mission select
--Goober5000
2003-04-06 03:56:54 +00:00
Goober5000 e6536f612a gotta love those compiler errors ;)
fixed those and cleaned up conflicts with the missile-locked sexp
--Goober5000
2003-04-05 20:47:58 +00:00
sesquipedalian 031c50768a Recommit of is-missile-locked.
I changed the sexp's category from non-campaign to training, so you may get a conflict with that.
2003-04-05 20:17:23 +00:00
Goober5000 a805b8e293 fixed some fiddly bits with scrolling and ui stuff
--Goober5000
2003-04-05 11:09:22 +00:00
Goober5000 7145251058 arg - forgot something
--Goober5000
2003-04-05 08:51:04 +00:00
Goober5000 5a5e364bee command briefing scroll buttons implemented :)
--Goober5000
2003-04-05 08:46:51 +00:00
Goober5000 6351a06b68 commit to fix the FRED compile error
--Goober5000
2003-04-04 22:11:06 +00:00
Goober5000 4dd27db603 fixed stupid spelling mistake
--Goober5000
2003-03-30 21:16:21 +00:00
Goober5000 d01ed806b9 preliminary work on adding scroll buttons to command briefings
--Goober5000
2003-03-30 21:08:42 +00:00
Goober5000 2b6c194af7 resolved a nasty bug that caused some missions to crash
--Goober5000
2003-03-30 07:27:34 +00:00
Goober5000 87409846f0 preliminary work on ai facing sexp
--Goober5000
2003-03-30 04:34:38 +00:00
sesquipedalian 88dca1dbea Aaaand nevermind... 2003-03-29 11:23:46 +00:00
Goober5000 4bf29edec3 made beams default shield piercing again
also added a beam no pierce command line flag
and fixed something else which I forgot :P
--Goober5000
2003-03-29 09:42:05 +00:00
sesquipedalian d1abacf7ae Added is-missile-locked sexp 2003-03-29 08:52:59 +00:00
Goober5000 9d6126086c yay for limit bumping!
bumped number of battle tracks and briefing/mainhall/credits tracks, both to 30
--Goober5000
2003-03-29 05:18:17 +00:00
Goober5000 4c74af0b4a got rid of an annoying compile warning
--Goober5000
2003-03-28 19:56:02 +00:00
Goober5000 fb738a9319 added beginning functionality for $Texture Replace implementation in FRED
--Goober5000
2003-03-25 07:03:30 +00:00
Goober5000 c470ecc598 argh - lol
--Goober5000
2003-03-22 08:17:34 +00:00
Goober5000 47302dd5ad bleah
--Goober5000
2003-03-22 07:24:53 +00:00
Goober5000 431b588cef bugs are bad, mmkay?
--Goober5000
2003-03-22 06:35:37 +00:00
Goober5000 0f931f0275 added play-sound-from-table, play-sound-from-file, and close-sound-from-file
--Goober5000
2003-03-22 06:11:51 +00:00
Goober5000 0a3a0c525f changed event_sexp_change_music to event_change_sexp_soundtrack
--Goober5000
2003-03-22 06:06:22 +00:00
Goober5000 c818bd61d5 yuck - fixed a nasty error when FRED provides a default value for warp-effect
and explosion-effect
--Goober5000
2003-03-21 08:33:33 +00:00
Goober5000 3e220d87f0 added get-relative-object-*, where * = x, y, and z; these sexps return the
world coordinates of a set of relative coordinates to an object; also, fixed many
places in sexp.cpp so that now sexps can accept other sexps as parameters,
wherease before they weren't able to
--Goober5000
2003-03-21 04:51:33 +00:00
Goober5000 58691c0d15 comments
--Goober500
2003-03-20 23:30:03 +00:00
Goober5000 a59a1bbaad comments
--Goober500
2003-03-20 23:20:46 +00:00
Goober5000 1d84bd94ea moved ballistic primary reload sounds to indexes 171 and 172 2003-03-20 22:58:43 +00:00
unknownplayer e777b3806e Fixed the bug with shields where it would consistently display the low detail
shield regardless of what the setting was. Turns out some OGL person was
quite thoughtless in their use of || instead of the correct && for the situation
so the game would always go for low detail shields because OGL and D3D
can't both be active at the same time!
2003-03-20 09:48:25 +00:00
Goober5000 74afd2522f implemented EMP as part of weapon-effect sexp
--Goober5000
2003-03-20 09:17:16 +00:00
unknownplayer da831bf833 Modified the command line options so they are all in lower-case characters.
Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
2003-03-20 08:24:45 +00:00
Goober5000 d21190d765 implemented mission flags for no briefing or no debriefing - yay!
--Goober5000
2003-03-20 07:15:37 +00:00
Goober5000 ae2eefeb92 extended sexps
--Goober5000
2003-03-20 04:27:10 +00:00
Goober5000 c0968ba348 making sexps better
--Goober5000
2003-03-20 00:08:08 +00:00
Goober5000 d469a505c4 bit o' housecleaning
--Goober5000
2003-03-19 23:06:40 +00:00
Goober5000 34244e313b added some mission flags
--Goober5000
2003-03-19 22:49:32 +00:00
unknownplayer d77c3feef5 Woohoo! Killed two birds with one stone!
Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
2003-03-19 12:29:02 +00:00
Goober5000 0fa9b99445 more housecleaning, this time for debug warnings
--Goober5000
2003-03-19 09:05:26 +00:00
unknownplayer 433688cc92 Updated the DX8 code to allow it to be run in 640x480 windowed mode. The game will only procede to do so if your registry settings are set to 640x480 to begin with, but this is accomplished simply enough. 2003-03-19 07:17:05 +00:00
Goober5000 790af7d332 added warp-effect sexp
--Goober5000
2003-03-19 06:23:28 +00:00
Goober5000 4fb733df43 added typecasting to get rid of some build warnings
--Goober5000
2003-03-19 06:22:58 +00:00
unknownplayer 0794d14a7a Fixed up a bug in the code which was causing all mission loads to crash.
As of this update, the DX merge is officially functional and complete within the CVS main branch. Tell Inquisitor we won't need to roll back at all, but Goober5000 needs to go and look at his SEXP code since he messed up a bunch of checking functions with it
2003-03-18 13:38:07 +00:00
unknownplayer 324747af39 The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can. 2003-03-18 10:07:06 +00:00
Goober5000 5377b50e53 added explosion-effect sexp and did some other minor housekeeping
--Goober5000
2003-03-18 08:44:06 +00:00
Goober5000 b745b8e545 fixed a subtle bug with EMP parsing which probably never happened and never will,
but it's nice to know it's solved :)
--Goober5000
2003-03-18 06:10:14 +00:00
Goober5000 cfa65cfe5c fixed some misspellings
--Goober5000
2003-03-18 01:44:31 +00:00
Goober5000 7d52af37fa pressing Q no longer makes a sound if the player's ship doesn't have shields
--Goober5000
2003-03-17 10:37:32 +00:00
penguin d8f9376d55 Got autoconf to build w/ dx8 libs (for cutscenes). DX8 files must be in C:/dx8 dir for now, will fix later.
Also got rid of the fs2- prefix on the object files.
penguin
2003-03-11 19:00:05 +00:00
phreak 2c95fa52f8 worked a hack to fix opengl support with dx8show movies 2003-03-07 01:00:37 +00:00
phreak 993740e06f added some hacks that shutdown and restore opengl because of cutscenes 2003-03-07 00:15:45 +00:00
Goober5000 da67b2b53c fixed what should be the last bug with bank-specific loadouts
--Goober5000
2003-03-06 09:13:43 +00:00
Goober5000 7d08fec7cc rewrote the restricted bank loadout code; it should work now
--Goober5000
2003-03-05 12:38:01 +00:00
Goober5000 6ec2c31678 cleaned out Bobboau's buggy code - about to rewrite with new, bug-free code :)
--Goober5000
2003-03-05 09:17:15 +00:00
Goober5000 e469a54429 fixed misspelling of "attenuation"
--Goober5000
2003-03-04 04:41:03 +00:00
Goober5000 2352055d98 made error message appear if EMP used without necessary parameters
--Goober5000
2003-03-04 02:25:25 +00:00
Goober5000 7892625474 fixed custom banks so that they no longer need the ":" between each entry
--Goober5000
2003-03-03 17:15:16 +00:00
bobboau 58a1497614 forgot something 2003-03-03 16:50:14 +00:00
bobboau 76d94278a8 forgot something 2003-03-03 10:29:39 +00:00
bobboau 47b2c3cd88 fixed a bug in the bank specific loadout relaiting to secondaries 2003-03-03 10:21:08 +00:00
Goober5000 1f55e87876 fixed the warp effect from always being the knossos type
--Goober5000
2003-03-03 09:53:32 +00:00
Goober5000 cdd1a0b743 changed "Subspace node activated" message to "Subspace drive activated"
--Goober5000
2003-03-03 09:31:59 +00:00
Goober5000 f864a28bb3 fixed the tech room bug! yay!
--Goober5000
2003-03-03 04:28:37 +00:00
inquisitor 993a176572 Readme word doc
-Inquisitor
2003-03-02 18:25:49 +00:00
Goober5000 414a344f33 commented an unneeded variable
-- Goober5000
2003-03-02 17:19:45 +00:00
penguin 28848dcbc8 Added type for static var
- penguin
2003-03-02 07:39:34 +00:00
penguin ea32341410 file needed by automake 2003-03-02 06:58:45 +00:00
penguin ad53507f1c file generated by autoconf 2003-03-02 06:49:23 +00:00
penguin 8f9e7cf941 Use multimedia headers in local dir, not system's (headers are not present in MinGW distribution)
- penguin
2003-03-02 06:37:24 +00:00
penguin 1f1339cb01 Added multimedia headers not present in MinGW distribution
- penguin
2003-03-02 06:28:12 +00:00
penguin e5eafea546 Tweaked for gcc
- penguin
2003-03-02 06:25:31 +00:00
penguin 373d2c201c Made a debug error message less confusing
- penguin
2003-03-02 06:10:58 +00:00
penguin ec63b64b1f Added versions of _outp() and _inp() for gcc.
- penguin
2003-03-02 06:04:00 +00:00
penguin e6da9a6d68 Added newline at end of file to keep gcc from complaining.
- penguin
2003-03-02 06:03:01 +00:00
penguin 4fac9708ec Added #ifdef WIN32 and #ifdef MSC_VER
- penguin
2003-03-02 06:01:55 +00:00
penguin 71d4bd62b2 Added #ifdef WIN32 around non-standard header file io.h
- penguin
2003-03-02 05:56:56 +00:00
penguin 3e96899ace Moved Gr_scaler_zbuffering definition to top of file
- penguin
2003-03-02 05:55:51 +00:00
penguin 51c590c6a6 ANSI C++ - namespace clash on ai_rotation; renamed type to ai_rotation_t
- penguin
2003-03-02 05:54:23 +00:00
penguin e7d1452827 Added gcc-compatible asm blocks
- penguin
2003-03-02 05:46:28 +00:00
penguin 137e7a8cdd 1. Added gcc-compatible asm code.
2. Added #ifndef NO_SOFTWARE_RENDERING
 - penguin
2003-03-02 05:45:04 +00:00
penguin 77f769b328 ANSI C++ - fixed non-compliant casts to unsigned short and unsigned char
- penguin
2003-03-02 05:43:49 +00:00
penguin c85cb1377b Added some #ifndef NO_SOFTWARE_RENDERING
- penguin
2003-03-02 05:41:52 +00:00
penguin f3362d6a2f Abort if unimplemented asm section is called
- penguin
2003-03-02 05:40:28 +00:00
penguin 043310f88a Added #ifdef _MSC_VER to MSVC-specific code
- penguin
2003-03-02 05:30:26 +00:00
penguin 46f524706c only define min() and max() if they're not already defined
- penguin
2003-03-02 05:27:44 +00:00
penguin 7b7df3caba defined FX_ENTRY and FX_CALL for gcc
- penguin
2003-03-02 05:26:23 +00:00
penguin a47ff4d7a5 1. Renamed or, og, ob vars to o_r, o_g, o_b ("or" caused gcc to choke).
2. Added #ifndef NO_SOFTWARE_RENDERING around software rendering code
3. Added #ifdef _MSC_VER around MSVC-specific exception handing code
 - penguin
2003-03-02 05:23:34 +00:00
penguin 70fc3119e7 Moved "extern int wm" declaration inside the header #ifdef block
- penguin
2003-03-02 05:12:39 +00:00
penguin 830be35c58 Added #ifdef _MSC_VER around strange exception-handling code
- penguin
2003-03-02 05:10:42 +00:00
penguin 2fff39194f ANSI C++ changes
- penguin
2003-03-02 05:07:12 +00:00
penguin fffa377d2f Removed -- this was the old Linux makefile. GNU-style makefiles are now generated by autoconf/automake
- penguin
2003-03-02 05:03:11 +00:00
penguin a819e73388 New files for autoconf/automake support.
- penguin
2003-03-02 04:53:46 +00:00
Goober5000 0562965e69 bumped alternate names from 10 to 25
--Goober5000
2003-03-02 02:10:11 +00:00
Goober5000 7928823b96 fixed the initial status bug 2003-03-01 01:15:38 +00:00
bobboau 3b92333b16 fixed the bug with fighter beams not giveing you kills 2003-02-26 02:56:55 +00:00
bobboau 7238ae9025 fixing my bug fix for the warp model, and not being able to find it 2003-02-25 16:46:01 +00:00
bobboau f6634e882c doh... forgot something in the beam rendering code 2003-02-25 07:15:07 +00:00
bobboau f99a3916de fixed a bunch of fighter beam bugs,
most notabley the sound now works corectly,
and they have limeted range with atenuated damage (table option)
added bank specific compatabilities
2003-02-25 06:22:50 +00:00
inquisitor cc9f972e80 added dxguid, ddraw, and strmiids.lib 2003-02-24 02:01:49 +00:00
inquisitor 609da60af3 added dxguid, ddraw, and strmiids.lib 2003-02-24 01:25:11 +00:00
wmcoolmon 7b794ea056 Refixed the splash screen loading code so that it still works with the demo VPs (Loading "2_PreLoad" and "PreLoad") and put logo support back in. Logo support does nothing unless "PreLoadLogo" and/or"2_PreLoadLogo" exist within the search path. 2003-02-23 20:55:57 +00:00
wmcoolmon 3f66617c68 Uncommented the sections of code that actually played a movie for a given mission. (Removed when daveb cleaned out the movie code for the release) 2003-02-23 03:13:03 +00:00
wmcoolmon f8f60965a9 Added cutscenes/movie.cpp(.h) and directx/dx8show.cpp(.h), which contain movie playing code. Don't compile these if you don't have the DX8 SDK. 2003-02-22 04:24:59 +00:00
wmcoolmon 6f0832c6d8 DirectX-specific code for movie-playing functions in cutscenes/movie.cpp. Ask RT if you have any questions about it; I just commited it :). 2003-02-22 04:20:47 +00:00
wmcoolmon 33c321d328 Movie playing code; use movie_play and movie_play_two to play movies using Directshow. Depends on directx/dx8show.cpp 2003-02-22 04:17:58 +00:00
wmcoolmon 16fdb53870 Added "os_app_activate_set" 2003-02-22 04:14:21 +00:00
wmcoolmon b5ab80797d Added "-dshowvid" command-line option, which must be set in order for movies to play. 2003-02-22 04:13:17 +00:00
phreak 1385a9c6ac stupid typo -- my bad 2003-02-16 19:00:56 +00:00
phreak a11c390fd5 fixed typecasting warnings 2003-02-16 18:55:59 +00:00
phreak a498b79b2d fixed around splash screen
2_splash.pcx is loaded in 1024x768
splash.pcx is loaded in 640x480 or 2_splash.pcx isn't found
2003-02-16 18:53:59 +00:00
phreak 6a22f2443e tweaked some more stuff 2003-02-16 18:43:13 +00:00
bobboau cd2597f3a2 added glow map nebula bug fix for d3d, someone should add a fix for glide too
more importantly I (think I) have fixed all major bugs with fighter beams, and added a bit of new functionality
2003-02-16 05:14:29 +00:00
Goober5000 d32a38c267 fixed version bumpage... the version is 3.5.0, not 3.50.0 ;)
--Goober5000
2003-02-05 07:04:31 +00:00
Goober5000 64bcc9942e made my fighterbay code more forgiving of eccentric modeling hacks...
ships can now use the Faustus hangar again :)
--Goober5000
2003-02-05 06:57:56 +00:00
phreak cf750429cb started to finalize before 3.50 release.
added support for GL_EXT_texture_filter_ansiotropic
2003-02-01 02:57:42 +00:00
phreak 32843f18f8 bumped to 3.50 2003-01-30 23:24:34 +00:00
phreak d7bd110ffe cleaned up debug output 2003-01-30 23:19:33 +00:00
phreak 36176b8eb4 enabled RGB lighting for OpenGL 2003-01-30 23:19:14 +00:00
Goober5000 8c94fbd199 finished up my fighterbay code - ships will not be able to arrive from or depart into
fighterbays that have been destroyed (but you have to explicitly say in the tables
that the fighterbay takes damage in order to enable this)
--Goober5000
2003-01-27 07:46:33 +00:00
DTP d9e1e01afc Part of bumping MAX_SHIPS to 250 max_ship_types. Server now no more Crashes on kill, when max_shiptypes is above 200. Note Client still cant join. narrowing it down. 2003-01-27 01:12:15 +00:00
DTP 8edec19426 Part of bumping MAX_SHIPS to 250 max_ship_types. Server now no more Crashes on kill, when max_shiptypes is above 200. Note Client still cant join. narrowing it down. 2003-01-27 00:51:46 +00:00
DTP 5419f3b5de temporary fix, added some // so that we can do debug builds. i expect Goober5000 will fix it soon. 2003-01-26 23:30:53 +00:00
wmcoolmon 6df0403964 Minor mod to preload screen code, added separate 1024x768 logo
-C
2003-01-26 20:04:32 +00:00
Goober5000 2bef522bfc changed change-music to change-soundtrack
--Goober5000
2003-01-26 18:37:19 +00:00
wmcoolmon 4e86a928b3 Added title screen support to retail version. When FS2 loads, it will build a list of PCX files in the current directory, then attempt to display one. If no PCX files exist, it will try to display one of the title screens defined in the code. Freespace 2 will then attempt to superimpose a logo in the upper-left hand corner of the screen. If neither can be displayed, FS2 will function normally. 2003-01-26 02:58:33 +00:00
Goober5000 254b4f6603 oops - fixed the nebula bug that wasn't completely fixed :)
--Goober5000
2003-01-26 00:20:01 +00:00
Goober5000 7373203236 added preloader to change-ship-model and change-ship-class so that the game
doesn't hesitate when switching models in the middle of missions
--Goober5000
2003-01-25 04:54:36 +00:00
Goober5000 55a4c34bab added change-music sexp and bumped MAX_SOUNDTRACKS from 10 to 25
--Ian Warfield
2003-01-25 04:17:39 +00:00
Goober5000 b060ac5928 aw, nuts - fixed a dumb bug with my new don't-collide-invisible code :p
--Goober5000
2003-01-24 03:48:11 +00:00
Goober5000 ab27958761 fixed a small nebula ship trail bug
--Goober5000
2003-01-24 03:15:11 +00:00
Goober5000 dca1600f46 fixed a few bugs in Bobboau's implementation of the glow sexps; also added
help for the sexps in sexp_tree
--Goober5000
2003-01-21 17:24:16 +00:00
bobboau 218ac8a0d7 added several sExps for turning glow points and glow maps on and off 2003-01-20 05:40:50 +00:00
Goober5000 cac96f1a44 cleaned up build output a bit
--Goober5000
2003-01-19 22:45:35 +00:00
Goober5000 55948f0db1 removed unreferenced variable
--Goober5000
2003-01-19 22:25:10 +00:00
Goober5000 c80033de55 fixed a bunch of bugs -- the support ship sexp, the "no-subspace-drive" flag,
and departure into hangars should now all work properly
--Goober5000
2003-01-19 22:20:23 +00:00
Goober5000 dd378506ee fixed fiddly code
--Goober5000
2003-01-19 09:14:05 +00:00
Goober5000 9e890d8df5 more tweaky bug fixes
--Goober5000
2003-01-19 09:10:40 +00:00
Goober5000 f4030700dc fixed two dumb bugs in the set-support-ship code
--Goober5000
2003-01-19 08:37:52 +00:00
Goober5000 b7f924ea6b actually added the set-support-ship sexp; much of the other commit was
groundwork (data types and stuff)
--Goober5000
2003-01-19 07:45:38 +00:00
Goober5000 c5c4fd08e9 oops - forgot a bit of departure code :)
--Goober5000
2003-01-19 07:13:05 +00:00
Goober5000 bf7871905e fixed a bunch of bugs - "no-subspace-drive" should now work properly for
all ships, and all ships who have their departure anchor set to a capital ship
should exit to that ship when told to depart
--Goober5000
2003-01-19 07:02:16 +00:00
Goober5000 28ef47c26f got rid of nameplate stuff (superceded by texture replacement)
--Goober5000
2003-01-19 06:44:39 +00:00
bobboau 7a6e12df06 redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it 2003-01-19 01:07:43 +00:00
Goober5000 97130623dc made "no-subspace-drive" applicable to all ships and fixed a really *STUPID*
bug that made FRED keep crashing (missing comma, bleagh!)
--Goober5000
2003-01-18 23:25:39 +00:00
phreak a1ad295557 added 'ddsutils' folder to project 2003-01-18 20:00:49 +00:00
phreak ecc552eda8 fixed around the bmpman system to now accept compressed textures 2003-01-18 19:55:16 +00:00
phreak 56d7afd8a0 texture mapper now supports DXTC compressed textures 2003-01-18 19:49:45 +00:00
phreak 46e465b1d2 added tcache flag TCACHE_FLAG_COMPRESSED 2003-01-18 19:49:02 +00:00
phreak 4c52cb0441 added some defines that deal with mages using DXTC 2003-01-18 19:48:19 +00:00
phreak 4da09ccefc these files deal with reading .dds files which use DXTC texture compression 2003-01-18 19:45:20 +00:00
Goober5000 389921bd48 added "no-subspace-drive" flag for ships
--Goober5000
2003-01-18 10:00:43 +00:00
Goober5000 e9f6827211 fixed bug I inadvertently introduced by modifying SIF_ flags with sexps rather
than SF_ flags
--Goober5000
2003-01-18 09:25:42 +00:00
Goober5000 042d935a80 fixed some really strange behavior with strings not being truncated at the
# symbol
--Goober5000
2003-01-17 07:59:09 +00:00
Goober5000 1f7fee5baa Allowed selection of either $Texture Replace, which keeps track of individual
replacement textures for a ship, or $Duplicate Model Texture Replace, which
duplicates a model and reskins it.  Use $Duplicate Model Texture Replace
if you want to substitute an animated texture or a transparent texture.
--Goober5000
2003-01-17 04:57:17 +00:00
Goober5000 ff33077291 added capability to the $Texture replace code to substitute the textures
without needing and extra model, however, this way you can't substitute
transparent or animated textures
--Goober5000
2003-01-17 01:48:50 +00:00
Goober5000 70c909302c yay! got texture replacement to work!!!
--Goober5000
2003-01-16 06:49:11 +00:00
Goober5000 900f57bc94 NOW the model duplicates work! :p
still gotta do the textures, but it shouldn't be hard now
--Goober5000
2003-01-15 23:23:30 +00:00
anonymous 41fabe25bd fixed the demo compilation. Define FS2_DEMO globally to compile as a demo. Make sure warp.pof is in your data/models directory. 2003-01-15 21:29:05 +00:00
inquisitor 1e634da6dd Test commit, ignore 2003-01-15 20:49:50 +00:00
Goober5000 a4386862f5 did the XSTR for the turret thing
--Goober5000
2003-01-15 20:49:10 +00:00
Goober5000 7435ddd89b oops, that'll introduce a bug - naming it just plain "Turret" instead
--Goober5000
2003-01-15 16:52:27 +00:00
Goober5000 f1e5508023 capship ballistic weapon displays "Cannon" on HUD instead of "Laser Turret"
--Goober5000
2003-01-15 16:48:59 +00:00
Goober5000 0fd8e46ea2 assigning duplicate models to ships now works; committing so I have a base
to fall back to as I work on texture replacement
--Goober5000
2003-01-15 08:57:23 +00:00
Goober5000 cb4764e8d0 changed most references to modelnum to use ship instead of ship_info --
this will help with the change-model sexp and any other instances of model
changing
--Goober5000
2003-01-15 07:09:09 +00:00
Goober5000 0c55ff682b added texture replacement parse - will be implemented later
--Goober5000
2003-01-15 05:24:23 +00:00
Goober5000 8659222b82 bumped main halls down to 10
--Goober5000
2003-01-15 05:19:07 +00:00
Goober5000 64b2332534 moved texture loading around a bit; added Texture_replace in preparation
for some cool stuff
--Goober5000
2003-01-15 05:18:13 +00:00
Goober5000 303278228a argh - fixed the stupid message persona bug with <any wingman>
Bobboau, please check your code!
--Goober5000
2003-01-14 06:13:23 +00:00
Goober5000 16baec8877 commented out some mprintfs that were clogging up the debug spew
--Goober5000
2003-01-14 05:53:58 +00:00
Goober5000 0b7cc9aa9d fixed minor potential bug
--Goober5000
2003-01-14 04:01:33 +00:00
Goober5000 77bc1ed93b allowed for up to 256 main halls
--Goober5000
2003-01-14 04:00:16 +00:00
Goober5000 d2969046d4 bug hunting; fixed the beam whack effect bug
--Goober5000
2003-01-13 23:20:01 +00:00
wmcoolmon b3c67343e5 Added MISSION_FLAG_NO_NEB_TRAILS and removed MISSION_FLAG_ST_OVERRIDE_NEB. Also changed code to set flags as necessary 2003-01-13 02:09:12 +00:00
wmcoolmon f26624902f Very slightly optimized code 2003-01-12 03:26:41 +00:00
wmcoolmon f96196c271 It turns out the version in the CVS did not toggle the ship trails with the flag...fixed this. 2003-01-12 00:19:55 +00:00
wmcoolmon f47b3c0fd0 Added code for "Ship Trails override Nebula" 2003-01-11 01:00:25 +00:00
Goober5000 170ac43ebe I found these two beautiful functions in ship.cpp - ship_change_model
and change_ship_type - so I made them into sexps :)
--Goober5000
2003-01-10 04:14:19 +00:00
inquisitor 93e0b43b03 Rollback to 2.7 to fix glow code issue that phreak noticed.
-Quiz
2003-01-09 22:23:38 +00:00
phreak b9c9069c5a fixed a small error in bob's glowmap code 2003-01-09 21:22:36 +00:00
phreak fdc9b42d14 fixed a small error in bob's code 2003-01-09 21:20:21 +00:00
phreak 6cb690996d glowmaps in OpenGL, yay! 2003-01-09 21:19:54 +00:00
phreak eb63396934 glowmaps unloaded if their parent is 2003-01-09 21:19:25 +00:00
Goober5000 f1aa394d29 fixed the giant thruster glow bug
--Goober5000
2003-01-09 05:55:55 +00:00
Goober5000 415969fca0 snagged a potential bug
--Goober5000
2003-01-09 05:52:25 +00:00
Goober5000 dfbd9ad9d0 fixed debriefing music in non-campaign missions
--Goober5000
2003-01-08 19:49:15 +00:00
Goober5000 a50424930b added ai-chase-any-except sexp
--Goober5000
2003-01-07 20:06:44 +00:00
phreak 9843ff7b49 fixed problem in win32_create_window() that disabled OpenGL from running in windowed mode 2003-01-07 00:02:08 +00:00
Goober5000 7ea79b3ed4 implemented keep-safe-distance
--Goober5000
2003-01-06 22:57:23 +00:00
Goober5000 b783b7e364 allowed fighters and bombers to accept the stay-near-ship and
keep-safe-distance orders
--Goober5000
2003-01-06 21:52:58 +00:00
Goober5000 60d0011159 nasssty bugs, we hates them, yesss we do, preciousssss
:)
--Goober5000
2003-01-06 20:29:28 +00:00
Goober5000 e730044cc1 cleaned up some stuff with model_set_thrust and a commented Assert that
shouldn't have been
--Goober5000
2003-01-06 19:33:22 +00:00
Goober5000 60ea566ecc a wee failsafe added
--Goober5000
2003-01-06 18:50:37 +00:00
Goober5000 fd797419dd hmm... moved +Squad Logo to immediately beneath $Name
--Goober5000
2003-01-06 17:19:14 +00:00
Goober5000 3a5a785f51 added wing configurable squad logos - put +Squad Logo: filename.pcx as
the last entry in each wing that you want (but the player's squad logo will
still be the squad logo for the player's wing)
--Goober5000
2003-01-06 17:14:52 +00:00
bobboau 65564198ef disabled decals (for now), removed the warp ray thingys,
made some better error mesages while parseing weapons and ships tbls,
and... oh ya, added glow mapping
2003-01-05 23:41:51 +00:00
Goober5000 def0b0ceb0 added capability of is-iff and change-iff to have wings as well as ships
as their arguments; also allowed a bunch of sexps to accept the player
as an argument where they would previously display a parse error
--Goober5000
2003-01-05 01:26:35 +00:00
Goober5000 01776721ab fixed the order sexp
--Goober5000
2003-01-04 23:15:39 +00:00
Goober5000 6f7d012184 Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
has primitive sensors it can't target anything and objects don't appear
on radar if they're outside a certain range.  This range can be modified
via the sexp primitive-sensors-set-range.
--Goober5000
2003-01-03 21:58:08 +00:00
Goober5000 7d4d468e58 this is the way we squash the bugs, squash the bugs, squash the bugs
this is the way we squash the bugs, so early in the morning :p
--Goober5000
2003-01-02 03:09:01 +00:00
Goober5000 d1a870b372 added don't-collide-invisible and collide-invisible sexps
--Goober5000
2003-01-02 00:35:21 +00:00
Goober5000 680e55e493 added ship-vaporize and ship-no-vaporize sexps
--Goober5000
2003-01-01 23:33:34 +00:00
Goober5000 c779bae39a bumped to 3.4
--Goober5000
2002-12-31 20:09:14 +00:00
Goober5000 5a4fafec31 tweaked stuff
--Goober5000
2002-12-31 19:35:14 +00:00
Goober5000 cfcc94c2bb if it ain't broke, don't fix it
--Goober5000
2002-12-31 19:18:41 +00:00
Goober5000 8d1c8fad7c if it ain't broke, don't fix it
--Goober5000
2002-12-31 18:59:43 +00:00
Goober5000 c6cc437092 simplified end-user implementation of ballistic primaries
--Goober5000
2002-12-31 08:20:31 +00:00
Goober5000 6a30e96439 added damaged-escort-priority-all sexp
--Goober5000
2002-12-31 07:26:40 +00:00
Goober5000 95d7869aa6 fixed escort list behavior for stealthy ships
--Goober5000
2002-12-31 05:17:13 +00:00
Goober5000 95a26b87ce made force feedback stronger when firing ballistic primaries
--Goober5000
2002-12-30 06:16:09 +00:00
phreak 6c0bfdd0b7 added damage-escort-list as a new sexp 2002-12-27 20:16:18 +00:00
Goober5000 0e19a3a614 the insidious beam bug is now squashed AND committed!
--Goober5000
2002-12-27 17:58:11 +00:00
Goober5000 35350315b7 removed the existing stealth sexps and replaced them with the following...
ship-stealthy
ship-unstealthy
is-ship-stealthy
friendly-stealth-invisible
friendly-stealth-visible
is-friendly-stealth-visible
--Goober5000
2002-12-27 02:57:51 +00:00
Goober5000 8f97380d75 meh - changed is-cargo-x to is-cargo
--Goober5000
2002-12-25 01:22:23 +00:00
Goober5000 fe6bac98c7 added change-ai-class and is-ai-class, and I think I may also have nailed the
is-iff bug; did some other bug hunting as well
--Goober5000
2002-12-24 07:42:29 +00:00
Goober5000 77c5502b19 added a wee cautionary note
--Goober5000
2002-12-24 07:38:59 +00:00
Goober5000 065eb6f1d5 added set-cargo and is-cargo-x sexps
--Goober5000
2002-12-23 23:01:27 +00:00
phreak 103e4b2b22 defined USE_OPENGL for debug and release builds 2002-12-23 21:13:41 +00:00
phreak cb4e5b551f dumb typo 2002-12-23 19:25:39 +00:00
phreak c22d9a7e99 added code that displays an error if user's OGL version is less than 1.2 2002-12-23 17:52:51 +00:00
Goober5000 2b52cf3896 Bah - Andsager is a moron. :) I see no reason why rand shouldn't work
multiple times.  It's been fixed thus.
--Goober5000
2002-12-23 05:41:08 +00:00
Goober5000 5b16bd3748 Squashed some Volition bugs! :O Some of the sexps for dealing with more than
one ship would return after only dealing with the first ship.

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

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

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

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

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

--Goober5000
2002-12-17 03:25:30 +00:00
DTP 754c35f2f5 fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED. 2002-12-17 03:08:18 +00:00
DTP 2bbd5a806b wrong name :) 2002-12-17 02:22:34 +00:00
Goober5000 5891192fda cosmetic fixed; also OP_SET_SCANNED and OP_SET_UNSCANNED added in preparation for the set-scanned and set-unscanned sexp commit
--Goober5000
2002-12-17 02:21:42 +00:00
DTP 5effb36530 cleaned up after Goober5000 :). it will make a mess in debug builds. added a couple of ifndef _debugs. 2002-12-17 02:21:06 +00:00
Goober5000 bc72cea911 added functionality and fixed a few things with cargo being revealed and hidden in preparation for the set-scanned and set-unscanned sexp commit
--Goober5000
2002-12-17 02:18:40 +00:00
DTP ec8886cf09 Bumped MAX JUMP-nodes to 50. if anybody wants a Jump-node forest 2002-12-17 01:56:36 +00:00
phreak bce0cc4ca0 optimized fullscreen/minimized functions.. alot faster 2002-12-16 23:28:52 +00:00
DTP 66eaf28ac8 fixed a minor glitch, replaced <> with ", so that it takes project glXXX.h, and not compilers glXXX.h 2002-12-15 18:59:57 +00:00
phreak d728b3d745 opengl headers 2002-12-15 16:57:15 +00:00
DTP 11426ed5a2 FIX; player can now have all ships set in FRED2 as allowed playerships in singleplayer 2002-12-15 06:50:49 +00:00
DTP 386abb7000 Bumped fire_dealy on_empty_secondary to 1000 2002-12-15 06:29:24 +00:00
Goober5000 476fb7bbfc removed mission flag for fighterbay damage; instead made damage display contingent on whether the fighterbay subsystem is assigned a damage percentage in ships.tbl
--Goober5000
2002-12-14 17:09:28 +00:00
phreak c825720ae0 added a command line that displays frames per second when enabled.
use "-fps"
2002-12-14 17:09:08 +00:00
phreak 6e407fff7b copied from grgpenglw32x.cpp. 2002-12-14 16:14:52 +00:00
Goober5000 11b24d23aa added mission flag to show subsystem damage for fighterbays
~Goober5000~
2002-12-14 01:55:04 +00:00
Goober5000 2135e20299 small tweaks and bug fixes for the ballistic primary conversion
~Goober5000~
2002-12-13 08:13:30 +00:00
Goober5000 123277167b added distance-ship-subsystem sexp
~Goober5000~
2002-12-12 08:01:57 +00:00
Goober5000 4a9f85674f Full-fledged ballistic primary support added! Try it and see! :) 2002-12-10 05:43:35 +00:00
Goober5000 719579177e Full-fledged ballistic primary support added! Try it and see! :)
Fixed lead indicator behavior; Phreak's version didn't work properly.
2002-12-10 05:42:42 +00:00
Goober5000 3f6a1f33d4 Full-fledged ballistic primary support added! Try it and see! :)
Preliminary support added for selecting additional primaries (more than 2) and secondaries (more than 3) if this is implemented later.
Transports can now dock with fighters, bombers, & stealth ships.
2002-12-10 05:41:38 +00:00
DTP 688dee73c2 DTP; added decals.h and decals.cpp to the project, aswell as the directory 2002-12-10 00:44:38 +00:00
Goober5000 5fa10d82f4 fixed misspelling 2002-12-09 08:37:31 +00:00
Goober5000 4cde77929f fixed misspelling 2002-12-09 08:26:24 +00:00
bobboau 41f66ee2f3 inital decals code, if you are worried a bug is being caused by the decals code it's only references are in,
collideshipweapon.cpp line 262, beam.cpp line 2771, and modelinterp.cpp line 2949.
it needs a better renderer, but is in prety good shape for now,
I also (think) I squashed a bug in the warpmodel code
2002-12-07 01:37:43 +00:00
phreak 2ee9db9479 extension framework implemented(no extensions work YET) -phreak 2002-12-05 00:49:25 +00:00
DTP f87883712e lowered MAX_POLYGON_MODELS FROM 198 to 128 for safety reasons since we bumped back MAX_SHIP_TYPES to 130 2002-12-04 09:44:34 +00:00
Goober5000 ea22ebfe09 implemented beam-free-all-by-default mission flag 2002-12-03 23:05:13 +00:00
Goober5000 0edd905be5 added myself to the credits list :)
~Goober5000
2002-12-03 22:14:06 +00:00
Goober5000 47e2ff7500 fixed player-entry-delay bug 2002-12-03 00:00:52 +00:00
Goober5000 c011621363 fixed misspelling 2002-12-02 23:56:12 +00:00
Goober5000 8c47d95901 fixed misspelling 2002-12-02 23:26:08 +00:00
Goober5000 e08be40462 fixed misspelling of "category" as "catagory" 2002-12-02 23:24:35 +00:00
Goober5000 d7022ad67b commented out an unneeded variable (int ret) in psnet_socket_options 2002-12-02 23:18:53 +00:00
Goober5000 38f435eba8 commented out an unneeded variable (ship *shipp) in model_really_render 2002-12-02 23:16:45 +00:00
Goober5000 6f429c16ee fixed mispelling of "category" as "catagory" 2002-12-02 23:14:17 +00:00
Goober5000 dfaebd0908 fixed mispelling of "category" as "catagory" 2002-12-02 20:49:14 +00:00
Goober5000 d6abb06544 fixed mispelling of "category" as "catagory" 2002-12-02 20:37:26 +00:00
sesquipedalian d950369202 end-mission sexp added 2002-11-28 00:00:37 +00:00
sesquipedalian 745fc385e9 Added Phreak's fix for the weapons room bug. Can now view a modified weapons.tbl in the tech room without crashing 2002-11-27 01:20:51 +00:00
phreak f02a1caced added OGL_inited global. Sets to 0 even if OGL isn't defined by preproccessor
-phreak
2002-11-22 20:56:15 +00:00
phreak e547962d31 changed around some page-in functions to work with opengl
changed bm_set_components_opengl
-phreak
2002-11-22 20:55:27 +00:00
phreak 31fe8e2a4c finished off all remaining problems with 32 bit mode, fullscreen mode
and colors.  Still needs some tweaking, but works near perfect
2002-11-22 20:54:16 +00:00
phreak 1b1dc86fb6 added some opengl defines for shield detail -phreak 2002-11-22 20:52:29 +00:00
DTP 7539390fc3 DTP; fix at line 6785 in parse/SEXP.cpp, a forgotten "{", when the is tagged thing was Fixed 2002-11-20 21:22:31 +00:00
sesquipedalian ad7b508184 Adding in EdrickV's fix to the is-tagged sexp. 2002-11-19 02:15:50 +00:00
phreak 0fa37a5b62 made ogl be used if "NDEBUG" is not defined and "USE_OPENGL" is defined - phreak 2002-11-18 21:34:16 +00:00
phreak 1cbfc73384 added some lines that makes ogl work in windowed mode for fullneb - phreak 2002-11-18 21:32:48 +00:00
phreak c58ae29dd5 added some ogl functionality - phreak 2002-11-18 21:32:11 +00:00
phreak 96e442b564 complete overhaul, works in 16 bit mode -phreak 2002-11-18 21:31:36 +00:00
phreak e817f867af added bm_select_components functions for OpenGL -phreak 2002-11-18 21:27:13 +00:00
bobboau 8c8c96bb89 added nameplate code 2002-11-14 06:15:03 +00:00
bobboau f0e7af10bb added warp model and type 1 glow points
and well as made the new glow file type,
some general improvement to fighter beams,
2002-11-14 04:18:17 +00:00
phreak 4e44bcfdef updated parse_weapon to parse custom corkscrew missiles 2002-11-11 20:18:30 +00:00
phreak d4cea3a9ff changed around the 'weapon_info' struct to allow for custom corkscrew missiles 2002-11-11 20:11:02 +00:00
phreak f06b7dfd20 changed cscrew_create and cscrew_process_post
to allow for custom corkscrew properties
2002-11-11 20:09:12 +00:00
phreak 6dd4f692e2 changed a line in ship_fire_secondary to allow for custom
amounts of corkscrew missiles fired
2002-11-11 20:05:52 +00:00
inquisitor d860dc0011 Bumped to 3.3 2002-11-10 20:40:02 +00:00
DTP d5d8e66dee DTP bumped back MAX_SHIP_TYPES to 130 2002-11-10 19:57:36 +00:00
DTP ad4843b8ea -DTP reworked mod support, 2002-11-10 16:32:42 +00:00
DTP 3162ede091 -DTP reworked mod support, 2002-11-10 16:30:53 +00:00
phreak f9e3871b3e Parser error handling for fighter flak, it didn't want flak on player weapons, now it doesn't care 2002-11-06 23:22:05 +00:00
phreak 53abc32182 Fighter flak code, it doesn't blow up in your face anymore! 2002-11-06 23:21:06 +00:00
DTP 39267bcb05 Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support. 2002-11-04 08:32:38 +00:00
DTP 7398df34ec DOh,uhmm, define error again, this is getting to me. 2002-11-02 23:06:59 +00:00
DTP 62c8792c2a DOh, fixed that define, learn to count DTP :) 2002-11-02 23:04:46 +00:00
inquisitor e561a547a7 Cleaned up the presentation a little, added HLP and VW, and, no offense to Kazan, removed Kazan. 2002-11-02 22:25:26 +00:00
DTP 5128907c07 DOH forgot \n 2002-11-02 22:11:35 +00:00
DTP 5ddef96ccc shameless self promotion 2002-11-02 22:10:48 +00:00
DTP e75251141a DTP Bumped Max_exited_ships from 200 to double that of MAX_SHIPS = 800 . make sense ehh. for logging effect. 2002-10-31 21:56:44 +00:00
DTP 4f419025fe DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back. 2002-10-31 21:14:16 +00:00
penguin c6cf69e4a3 Hopelessly out of date, and only applied to Linux anyhow 2002-10-31 03:49:35 +00:00
penguin 10e444df95 updated 2002-10-31 03:46:27 +00:00
inquisitor eeab39d62d Bad Committ, Rolling back 2002-10-30 20:22:30 +00:00
DTP 28e46d411b doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is 2002-10-30 06:31:05 +00:00
DTP 1195eb3ada DTP Implemented basic VP files handling. mission and campaign files inside VP files found in mod dir still not supported, cheking / creating directories not implented either 2002-10-30 06:26:11 +00:00
sesquipedalian 5f779fae4c no message 2002-10-29 22:41:48 +00:00
DTP cdb274654e Crap, somebody may restore cmdline.h to 2 version before this. 2002-10-28 02:28:52 +00:00
DTP b486c02ac8 DTP; started basic implementation of mod-support
plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
2002-10-27 23:59:28 +00:00
randomtiger 9bcb08776c Made Phreaks alternative scanning style optional under the command line tag "-phreak"
Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
2002-10-22 23:02:40 +00:00
randomtiger d36c788e00 Fixed lighting bug that caused special pause to crash on debug build.
Also added TAB functionality for special pause that toggles HUD. - RT
2002-10-22 17:42:09 +00:00
bobboau 00bbac6ae1 inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam sheild hit, ABtrails, and ssm stuff. one thing you should be happy to know is the beam texture tileing is now set in the beam section section of the weapon table entry 2002-10-19 19:29:29 +00:00
randomtiger 40db1ce831 Added special pause mode for easier action screenshots.
Added new command line parameter for accessing all single missions in tech room. - RT
2002-10-19 03:50:29 +00:00
randomtiger bbf18d5667 Added ability to remove HUD ingame on keypress shift O
So I've added a new key to the bind list and made use of already existing hud removal code.
2002-10-17 20:40:51 +00:00
phreak 377f78db0f screenshots, yay! 2002-10-14 19:49:08 +00:00
phreak ad96da3537 further optimizations 2002-10-13 21:43:24 +00:00
phreak db8cf9134f fixed text 2002-10-12 17:48:11 +00:00
phreak 0d65873a0b dont use this one 2002-10-11 21:35:51 +00:00
phreak c38ff6302d first run at opengl for w32, only useful in main hall, barracks and campaign room 2002-10-11 21:31:17 +00:00
randomtiger abc9a3ddb1 Added us fs2_open people to the credits. Worth looking at just for that.
Added timer bar code, by default its not compiled in.
Use TIMEBAR_ACTIVE in project and dependancy code settings to activate.
Added the new timebar files with the new code.
2002-10-05 16:46:10 +00:00
phreak 650c4dea46 did glare stuff in game_sunspot_process() 2002-09-20 20:09:01 +00:00
phreak a2d1cf8f37 glare parser stuff in stars_init() 2002-09-20 20:05:29 +00:00
phreak 23c449af6c added glare variable for ambient suns
if glare is 0 then the sun glare whiteout is not shown when looking at the sun
2002-09-20 20:04:54 +00:00
phreak 2d548f46bf lead indicator for dumbfire missiles 2002-09-20 20:02:00 +00:00
phreak c3c4ce064c extra effects during cargo scan 2002-09-20 20:01:30 +00:00
randomtiger fb7a0d5257 Tiny change to DX branch to keep movie code optional (default off) 2002-08-28 21:47:02 +00:00
randomtiger f8351a9818 Woh! I sure as hell didnt modify all these files it says I did.
I will put this down to the branch! Note: I did start from a fresh checkout!
2002-08-28 10:51:04 +00:00
penguin 5aefddd246 Moved DirectX8 stuff to directx8 branch; reverted to previous 2002-08-27 13:38:58 +00:00
randomtiger facefe5872 Added new lib files: strmiids and ddraw to get dshow working
Added new command line parameter to active direct show movie play: -dshowvid
Uncommented movie_play calls and includes
2002-08-18 19:48:29 +00:00
penguin ef794efbb3 Added #include, needed for FRED 2002-08-15 04:41:17 +00:00
penguin 573a1f2fa3 updated 2002-08-13 04:31:25 +00:00
penguin a763d84b56 1. Disable CD checking
2. Add CVS tag to version string
2002-08-13 03:34:00 +00:00
penguin c06ccbb602 Bumped to version 3.2 2002-08-13 03:32:25 +00:00
drevil ffd8a5ae2a Rebuilding admin files 2002-08-11 23:08:20 +00:00
drevil aa753d5d6e Trash syncmail, it's worthless, use logaccum stuff instead 2002-08-11 23:05:15 +00:00
drevil 1cf042064f Yet more updates for syncmail 2002-08-11 22:36:01 +00:00
drevil a4e14a94d2 Correct arguments to syncmail 2002-08-11 22:22:35 +00:00
drevil 5871d644cc Change which module syncinfo "hooks" to 2002-08-11 22:20:56 +00:00
drevil 145a149873 Updated syncmail to current CVS version 2002-08-11 22:17:16 +00:00
drevil 7492c51ee6 corrected path to syncmail 2002-08-11 22:04:47 +00:00
drevil be4954a69e Adding syncmail cvs commit notification 2002-08-11 22:02:45 +00:00
DTP 875a95b82e Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h" 2002-08-07 00:45:25 +00:00
DTP f6b129577b Implented -GF4FIX commandline switch 2002-08-07 00:44:13 +00:00
penguin 4d30bbba3e Updated 2002-08-06 21:21:42 +00:00
phreak 8823dc67eb added wireframe targetbox feature 2002-08-06 16:50:44 +00:00
phreak 8690c9d7f6 added Targetbox_wire variable to check what mode the
hud targetbox uses
2002-08-06 16:50:13 +00:00
phreak f70d242903 added keybing for wireframe hud,
fixed previous missile cheat
2002-08-06 16:49:22 +00:00
penguin 5b4306dbd6 Use text strings for wingmen names instead of ANI 2002-08-06 04:39:26 +00:00
penguin 013870fc6a inserted "class" keyword on "friend" definitions (ANSI C++ ) 2002-08-06 03:50:48 +00:00
penguin 0e3d4e562f Fixed problem w/ compile options for Debug mode 2002-08-06 02:43:02 +00:00
penguin 48d1ec4575 Removed a couple more include dirs I missed 2002-08-06 01:49:47 +00:00
penguin 32ad077676 Renamed ccode members to cc_or and cc_and 2002-08-06 01:49:08 +00:00
penguin 9942308fc8 Moved ChangeLog to top-level directory 2002-08-04 05:43:13 +00:00
penguin af3b97aae5 Change version display 2002-08-04 05:13:00 +00:00
penguin c3c0b0e1f4 Display fs2_open version instead of "Freespace 2" 2002-08-04 05:12:42 +00:00
penguin 9d5863bc76 Change version display location 2002-08-04 05:12:10 +00:00
penguin 4b2d436b04 Update version number to 3.1 2002-08-04 05:11:36 +00:00
penguin 404195d389 Don't write version to registry; change way version string is formatted 2002-08-04 05:11:05 +00:00
randomtiger df29aad213 Fixed Geforce 4 bug that caused font and hall video distortion.
Very small change in 'gr_d3d_aabitmap_ex_internal'

Tested and works on the following systems

OUTSIDER Voodoo 3 win98
OUTSIDER Geforce 2 win2000
Me Geforce 4 PNY 4600 XP
JBX-Phoenix Geforce 4 PNY XP
Mehrunes GeForce 3 XP
WMCoolmon nVidia TNT2 M64 win2000
Orange GeForce 4 4200 XP
ShadowWolf_IH Monster2 win98
ShadowWolf_IH voodoo 2 win98
2002-08-03 19:42:17 +00:00
wmcoolmon 026601e350 Fixed Win32 debug configuration 2002-08-03 18:35:21 +00:00
wmcoolmon 05a48addc6 Sync with makefile 1.4 2002-08-03 17:42:40 +00:00
penguin a1e9e62b6e updated 2002-08-01 04:04:01 +00:00
penguin 64ea61c93a The big include file move 2002-08-01 02:00:46 +00:00
penguin a0bbf8fd54 The big include file move 2002-08-01 01:41:11 +00:00
wmcoolmon 15e9872bb5 Fixed a bug I added in ship_do_rearm_frame 2002-07-30 18:11:25 +00:00
wmcoolmon a1f592ffef Modified to add hull repair capabilities and toggling of them via a mission flag, MISSION_FLAG_SUPPORT_REPAIRS_HULL 2002-07-30 17:57:40 +00:00
wmcoolmon 07de43ffc4 Added mission flag "MISSION_FLAG_SUPPORT_REPAIRS_HULL" for toggling Support Ship hull repair on and off 2002-07-30 17:35:22 +00:00
unknownplayer 522fa4c906 Started work on DX8.1 implementation. Updated the project files to encompass
the new files. Disable the compiler tag to use old DX code (THERE IS NO
NEW CODE YET!)
2002-07-30 14:29:15 +00:00
penguin 7611e0a2d2 Added Network/fs2ox.cpp 2002-07-29 22:24:57 +00:00
penguin 9290659edf First attempt at "fs2_open exchange" (PXO substitute) screen 2002-07-29 22:24:26 +00:00
penguin 3a88c2f9e3 We finally have a ChangeLog 2002-07-29 22:14:48 +00:00
penguin a732686bf6 Moved extern declaration of ssm_create outside of block (it wouldn't compile w/ gcc) 2002-07-29 20:48:51 +00:00
penguin 2ede27a557 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 20:12:31 +00:00
penguin 8300b018f0 removed bogus #include windows.h 2002-07-29 20:12:02 +00:00
penguin 93aed25251 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:52:48 +00:00
penguin 591563118c added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:37:21 +00:00
penguin b59b5dd5d8 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:17:21 +00:00
penguin bb0bde6409 added #ifdef _WIN32 around windows-specific system headers 2002-07-29 19:04:48 +00:00
DTP 66a392ddae Forgot to Bump MAX_MODEL_SUBSYSTEMS from 128 to 200 2002-07-29 08:31:52 +00:00
DTP 8bfc9fa709 BUMPED MAX_POLYGON_MODELS TO 198 , MAX_SHIP_TYPES - 2 = 198 2002-07-29 08:28:00 +00:00
DTP ccbdeeff67 Bumped all MAX_SHIPS, and SHIP_LIMIT to 400.(let the mission designers decide what is good, and what is bad 2002-07-29 08:24:42 +00:00
DTP 0f1176adaf Bumped MAX_SHIP_SUBOBJECTS to 2100(2100 /(average fighter has 7 subsystems) = 400 fighters 2002-07-29 08:22:42 +00:00
DTP b75fce3d5c Bumped MAX_SUBSYS_LIST from 32 to 200 2002-07-29 08:19:41 +00:00
DTP ab68ad4855 -almission(autoload mission) commandline arguement handling implemented 2002-07-29 08:05:20 +00:00
DTP 426cf0b969 FIX; Startgame arguement dont go ahead when a singleplayer pilot is selected 2002-07-29 07:56:10 +00:00
DTP 2d1f7ba50f added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission. 2002-07-29 06:35:15 +00:00
DTP 69145e65f1 FIX -stargame commandline arguement will now let you quit, a thing not possible before when using the startgame arguement 2002-07-28 15:07:43 +00:00
penguin 3dcb4b380a Testing commit as penguin 2002-07-26 18:02:33 +00:00
drevil 8e996fdf67 Updated password file 2002-07-26 17:59:31 +00:00
penguin 7367d8a31f renamed 'big' and 'small' (conflict w/ MS include file) 2002-07-26 16:17:46 +00:00
penguin d5fcfc773c fixed bug where winsock.h wasn't defined 2002-07-26 16:12:05 +00:00
wmcoolmon 5cdd3a676d Added Bobboau's beam tiling code 2002-07-26 03:11:24 +00:00
wmcoolmon fd95da4c0a Added Bobboau's fighter-beam code. 2002-07-25 04:50:48 +00:00
penguin 1aa613e0f5 Added ifndef NO_STANDALONE 2002-07-22 01:39:24 +00:00
penguin 7d91a35878 Stub defines for NO_SOUND 2002-07-22 01:37:24 +00:00
penguin fa2c566b3f Linux port -- added NO_STANDALONE ifdefs 2002-07-22 01:22:26 +00:00
penguin f2b7f9718a Made more compatible w/ Win32; defines for NO_SOUND, NO_JOYSTICK, NO_NETWORK 2002-07-22 01:14:09 +00:00
penguin 08c0bd3aee Moved the dummy "sound" definitions to main program (freespace.cpp) 2002-07-22 01:10:10 +00:00
penguin 3a39133e04 More defines for winsock compatibility 2002-07-22 01:06:04 +00:00
penguin c3ec5825a4 took out GAME_CD_CHECK define 2002-07-22 01:04:37 +00:00
DTP baddd6703d Bumped Max Shield Icons to 80 2002-07-20 23:51:59 +00:00
DTP 0c3733d2cd Fixed multiplayer music. succes music on all Primary goals complete, fail music
if otherwise
2002-07-20 23:50:53 +00:00
DTP c536d49afd Fixed Secondary bank bug, where next valid secondary bank inherits current
valid banks FULL fire delay
2002-07-20 23:49:46 +00:00
DTP b031aee73a bumped MAX_MISSION_TEXT to 1000000 in code/parse/parselo.h 2002-07-20 19:21:13 +00:00
penguin c480e2c944 Fixed bug (potential access of unitialized pointer) in hud_config_render_gauges() -- thanks to DTP for finding it! 2002-07-18 20:07:49 +00:00
unknownplayer c7cd913df4 no message 2002-07-18 14:36:53 +00:00
unknownplayer 58a465e805 Revised AI primary selection code again to be more intelligent. 2002-07-18 09:55:26 +00:00
unknownplayer cf08ff0cd5 Rewrote my original algorithm to search by proportional hull damage.
Does the same thing a little better.
2002-07-18 05:38:28 +00:00
unknownplayer c839e8168a Fixed AI problems with using the maxim on fighters. 2002-07-18 03:27:38 +00:00
unknownplayer 3257777c18 Added some commentry to the low detail shield function. 2002-07-18 03:26:35 +00:00
unknownplayer 1028e14398 no message 2002-07-18 03:25:10 +00:00
unknownplayer b733679875 Altered project files to properly build debug info. Should save you all some time. 2002-07-17 23:59:56 +00:00
unknownplayer 723cbd5938 Minor commenting added to two functions. 2002-07-17 23:58:46 +00:00
wmcoolmon 0e48ea11ac Added SSM code for Tag C from Bobboau. Note that strings.tbl may need to be updated. 2002-07-17 20:04:00 +00:00
unknownplayer 57ab92645c Added a custom build step to copy to c:\games\freespace2\fs2_open.exe
when you build.
2002-07-17 12:52:01 +00:00
unknownplayer 2431f5db2c Updated to enable compilation under MSVC++ - all changes are marked
with my name ##UnknownPlayer##
2002-07-16 14:39:16 +00:00
unknownplayer 34d960638a This is the code project file. Use the workspace file I included to get at this. 2002-07-16 14:37:51 +00:00
unknownplayer 3bb26b10a3 This is the workspace for freespace2.dsp - it contains everything needed to
compile fs2_open.exe
2002-07-16 14:37:09 +00:00
unknownplayer 3cdc511b2d This is the project file to compile fs2_open. It's a real project file - use the
workspace though
2002-07-16 14:36:30 +00:00
penguin 4543d0c80c Changed so that debug make debug and release makes release :) 2002-07-16 01:15:59 +00:00
penguin 2a740ad2c8 Commented out "fs2_open.dep" stuff 2002-07-16 01:15:15 +00:00
inquisitor 7187da0233 Visual Studio files
compiles fs2_open.exe - 0 error(s), 7 warning(s)
2002-07-15 22:36:08 +00:00
wmcoolmon ab43e4d987 Added support for toggling ship trails 2002-07-15 02:11:00 +00:00
wmcoolmon 8056476db1 Added initial code for "ship-lights-on" and "ship-lights-off" SEXPs 2002-07-13 09:16:18 +00:00
penguin 4b471d6045 Added flags2 (ran out of bits in flags!) to ship struct; bit 0 will be used
to toggle Bobboau's lights.
2002-07-12 16:59:04 +00:00
penguin 8b19d7c8eb Removed dummy include file 2002-07-12 02:56:07 +00:00
penguin 90c6679f03 Fixed endian-ness of new "GLOW" IDs 2002-07-12 02:44:18 +00:00
wmcoolmon 4c73e5fe20 Added Bobboau's glow code; all comments include "-Bobboau" 2002-07-10 18:42:14 +00:00
penguin dd3a3138a7 Back-port to MSVC 2002-07-07 19:56:00 +00:00
penguin 9e8a091172 Makefile for Microsoft Visual C++ 2002-07-07 19:49:42 +00:00
drevil 5d72560a30 Adding mysterial and penguin to CVS's admin files 2002-06-08 19:21:16 +00:00
drevil 2a9c65bd3f Changing my password 2002-06-08 19:10:16 +00:00
drevil 6b4cca55be Changing my password 2002-06-08 19:04:53 +00:00
penguin c18139e73f Added machine-independent version of MulDiv (in case we don't know
the processor type)
2002-06-04 06:38:21 +00:00
penguin be6ee814c2 Minor changes 2002-06-03 05:03:45 +00:00
penguin ea6130e542 Initial revision 2002-06-03 04:34:38 +00:00
penguin 48a566a2d5 Warpcore CVS sync 2002-06-03 04:10:40 +00:00
penguin dab5b293d4 Dummy include file 2002-06-03 04:08:13 +00:00
penguin 2a2cd3c873 Warpcore CVS sync 2002-06-03 03:55:40 +00:00
penguin 51ffb56b16 Volition sources -- warpcore CVS import 2002-06-03 03:26:03 +00:00
fs2source 211e7a4284 Commited initial passwd/writers files,
inquisitor
drevil
anonymous

added

anonymous has no write access
2002-06-02 00:39:17 +00:00
fs2source 24643586f1 initial checkin 2002-06-01 21:21:20 +00:00
fs2source 08986cb47e initial checkin 2002-06-01 21:21:19 +00:00
(no author) c3d878b1b3 New repository initialized by cvs2svn. 2002-06-01 21:21:19 +00:00
2679 changed files with 503728 additions and 801248 deletions

No files matched your search

-182
View File
@@ -1,182 +0,0 @@
version: 2
references:
container_config: &container_config
docker:
- image: "debian:stretch"
working_directory: /root/build
restore_repo: &restore_repo
restore_cache:
keys:
- source-repo-{{ .Branch }}-{{ .Revision }}
- source-repo-{{ .Branch }}
- source-repo
cmake_configure: &cmake_configure
run:
name: Creating Build Files
command: |
mkdir build
cd build
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
eval $CC --version
export CXXFLAGS
export CFLAGS
CMAKE="cmake -G Ninja -DFSO_FATAL_WARNINGS=ON $CMAKE_OPTIONS"
eval $CMAKE -DCMAKE_BUILD_TYPE=$CONFIGURATION -DFSO_BUILD_TESTS=ON -DFSO_BUILD_INCLUDED_LIBS=ON ..
compile: &compile
run:
name: Compiling Source code
command: |
cd build
ninja -k 20 all
run_tests: &run_tests
run:
name: Run unit tests
command: |
./build/bin/unittests --gtest_shuffle
compile_steps: &compile_steps
steps:
- *restore_repo
- *cmake_configure
- *compile
- *run_tests
jobs:
checkout_code:
<<: *container_config
steps:
- run:
name: Installing Git
command: 'apt-get update && apt-get -yq install git'
- *restore_repo
- checkout
- run:
name: Updating submodules
command: 'git submodule update --init --recursive'
- save_cache:
key: source-repo-{{ .Branch }}-{{ .Revision }}
paths:
- .
build_gcc_lowest_debug:
docker:
- image: asarium/fso_compile:gcc-lowest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Debug
<<: *compile_steps
build_gcc_lowest_release:
docker:
- image: asarium/fso_compile:gcc-lowest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Release
<<: *compile_steps
build_gcc_latest_debug:
docker:
- image: asarium/fso_compile:gcc-latest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Debug
<<: *compile_steps
build_gcc_latest_release:
docker:
- image: asarium/fso_compile:gcc-latest
working_directory: /root/build
environment:
CC: gcc
CXX: g++
CONFIGURATION: Release
<<: *compile_steps
build_clang_latest_debug:
docker:
- image: asarium/fso_compile:clang-latest
working_directory: /root/build
environment:
CC: clang-8
CXX: clang++-8
CONFIGURATION: Debug
<<: *compile_steps
build_clang_latest_release:
docker:
- image: asarium/fso_compile:clang-latest
working_directory: /root/build
environment:
CC: clang-8
CXX: clang++-8
CONFIGURATION: Release
<<: *compile_steps
build_clang_lowest_debug:
docker:
- image: asarium/fso_compile:clang-lowest
working_directory: /root/build
environment:
CC: clang
CXX: clang++
CONFIGURATION: Debug
<<: *compile_steps
build_clang_lowest_release:
docker:
- image: asarium/fso_compile:clang-lowest
working_directory: /root/build
environment:
CC: clang
CXX: clang++
CONFIGURATION: Release
<<: *compile_steps
workflows:
version: 2
build_test:
jobs:
- checkout_code
- build_gcc_lowest_debug:
requires:
- checkout_code
- build_gcc_lowest_release:
requires:
- checkout_code
- build_gcc_latest_debug:
requires:
- checkout_code
- build_gcc_latest_release:
requires:
- checkout_code
- build_clang_latest_debug:
requires:
- checkout_code
- build_clang_latest_release:
requires:
- checkout_code
- build_clang_lowest_debug:
requires:
- checkout_code
- build_clang_lowest_release:
requires:
- checkout_code
-100
View File
@@ -1,100 +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 ]
IncludeBlocks: Regroup
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
-182
View File
@@ -1,182 +0,0 @@
language: bash
sudo: required
dist: trusty
cache:
directories:
- $HOME/cmake-3.8
- $HOME/.ccache
- $HOME/curl_cache
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}")
-29
View File
@@ -1,29 +0,0 @@
This is still in pretty rough form.
=== for people building fs2_open:
Win32-MSVC:
Use the Freespace2.dsw workspace and build within the IDE.
Win32-MinGW:
make
Linux and other unix variants (NOT YET COMPLETE)
./configure [options]
make
=== for the project maintainers (people who need to
=== keep the makefiles up to date) and those building
=== from CVS:
./autogen.sh (should only has to be done once)
./configure [options]
make
automake v1.6.1+ and
autoconf v2.54+ are required
-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.
-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\msvc2015
- BuildID: 1
CMAKE_GENERATOR: Visual Studio 14 2015 Win64
PlatformToolset: v140_xp
QT_DIR: C:\Qt\5.9\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
-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\msvc2015_64";
SourcePackage=$false;
},
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9\msvc2015";
SourcePackage=$false;
}
)
$ReleaseConfigurations = @(
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9\msvc2015";
SourcePackage=$true;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015";
PackageType="Win32-AVX";
Toolset="v140_xp";
SimdType="AVX";
QtDir="C:\Qt\5.9\msvc2015";
SourcePackage=$false;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64";
Toolset="v140_xp";
SimdType="SSE2";
QtDir="C:\Qt\5.9\msvc2015_64";
SourcePackage=$false;
}
[BuildConfig]@{
Generator="Visual Studio 14 2015 Win64";
PackageType="Win64-AVX";
Toolset="v140_xp";
SimdType="AVX";
QtDir="C:\Qt\5.9\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
-89
View File
@@ -1,89 +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
if [ -f ~/curl_cache/curl*.deb ]; then
cd ~/curl_cache
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
else
# 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
if [ ! -d ~/curl_cache ]; then
mkdir ~/curl_cache
fi
cp libcurl3*.deb curl*.deb ~/curl_cache
sudo dpkg -i libcurl3*.deb
sudo dpkg -i curl*.deb
fi
elif [ "$TRAVIS_OS_NAME" = "osx" ]; then
brew install libssh2
if [ -d ~/curl_cache/curl ]; then
cd ~/curl_cache/curl
sudo make install
else
mkdir /tmp/curl
cd /tmp/curl
curl -LO "https://curl.haxx.se/download/curl-7.64.0.tar.bz2"
tar -xjf curl-7.64.0.tar.bz2
cd curl-7.64.0
./configure --disable-debug --disable-dependency-tracking --disable-silent-rules --with-libssh2 --with-darwinssl --without-ca-bundle --without-ca-path
make -j"$(sysctl hw.logicalcpu | cut -d " " -f 2)"
if [ ! -d ~/curl_cache ]; then
mkdir ~/curl_cache
fi
cp -a . ~/curl_cache/curl
sudo make install
fi
export PATH=/usr/local/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
-18
View File
@@ -1,18 +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-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")
-109
View File
@@ -1,109 +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")
# 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)
-142
View File
@@ -1,142 +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")
# 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")
-103
View File
@@ -1,103 +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
* 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];
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.
*/
int ai_get_slot(int shipnum)
{
int i;
for (i=0; i<MAX_AI_INFO ; i++)
if (Ai_info[i].shipnum == -1) {
Ai_info[i].shipnum = shipnum;
return i;
}
Warning( LOCATION, "Couldn't get AI slot" );
Int3();
return -1;
}
/**
* @brief Frees a currently used AI slot.
* @details Only modifies in ::Ai_info struct. Does not modify hook in ship.
*/
void ai_free_slot(int ai_index)
{
Assert( (ai_index >= 0) && (ai_index < MAX_AI_INFO) );
Ai_info[ai_index].shipnum = -1;
}
int get_wingnum(int objnum)
{
int shipnum, ai_index;
shipnum = Objects[objnum].instance;
ai_index = Ships[shipnum].ai_index;
return Ai_info[ai_index].wing;
}
void set_wingnum(int objnum, int wingnum)
{
int shipnum, ai_index;
Assert(Objects[objnum].type == OBJ_SHIP);
shipnum = Objects[objnum].instance;
Assert((shipnum >= 0) && (shipnum < MAX_SHIPS));
ai_index = Ships[shipnum].ai_index;
Assert( (ai_index >= 0) && (ai_index < MAX_AI_INFO) );
Ai_info[ai_index].wing = wingnum;
}
char *ai_get_goal_target_name(const 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])) {
*index = i;
return Goal_target_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);
*index = i;
return Goal_target_names[i];
}
-669
View File
@@ -1,669 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AI_H
#define _AI_H
#include "ai/ai_profiles.h"
#include "globalincs/globals.h"
#include "globalincs/pstypes.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;
#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 MAX_AI_FLAG_NAMES 2
extern ai_flag_name Ai_flag_names[];
// dock_orient_and_approach() modes.
#define DOA_APPROACH 1 // Approach the current point on the path (aip->path_cur)
#define DOA_DOCK 2 // Dock with goal object.
#define DOA_UNDOCK_1 3 // Begin undocking with goal object. Just move away.
#define DOA_UNDOCK_2 4 // Secondary undocking. Move away.
#define DOA_UNDOCK_3 5 // Tertiary undocking. Move away and orient away.
#define DOA_DOCK_STAY 6 // Rigidly maintain position in dock bay.
// Type values for ai_dock_with_object() dock_type parameter.
#define AIDO_DOCK 1 // Set goal of docking with object.
#define AIDO_DOCK_NOW 2 // Immediately move into dock position. For ships that start mission docked.
#define AIDO_UNDOCK 3 // Set goal of undocking with object.
// Submodes for seeking safety.
#define AISS_1 41 // Pick a spot to fly to.
#define AISS_2 42 // Flying to spot.
#define AISS_3 43 // Gotten near spot, fly about there.
#define AISS_1a 44 // Pick a new nearby spot because we are endangered, then go to AISS_2
#define MAX_AI_GOALS 5
// types of ai goals -- tyese types will help us to determination on which goals should
// have priority over others (i.e. when a player issues a goal to a wing, then a seperate
// goal to a ship in that wing). We would probably use this type in conjunction with
// goal priority to establish which goal to follow
#define AIG_TYPE_EVENT_SHIP 1 // from mission event direct to ship
#define AIG_TYPE_EVENT_WING 2 // from mission event direct to wing
#define AIG_TYPE_PLAYER_SHIP 3 // from player direct to ship
#define AIG_TYPE_PLAYER_WING 4 // from player direct to wing
#define AIG_TYPE_DYNAMIC 5 // created on the fly
// Flags to ai_turn_towards_vector().
#define AITTV_FAST (1<<0) // Turn fast, not slowed down based on skill level.
#define AITTV_VIA_SEXP (1<<1) // Goober5000 - via sexp
#define AITTV_IGNORE_BANK (1<<2) // Goober5000 - ignore bank when turning
#define KAMIKAZE_HULL_ON_DEATH -1000.0f // Hull strength ship gets set to if it crash-dies.
// structure for AI goals
typedef struct ai_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
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)
// unions for docking stuff.
// (AIGF_DOCKER_INDEX_VALID and AIGF_DOCKEE_INDEX_VALID tell us to use indexes; otherwise we use names)
// these are the dockpoints used on the docker and dockee ships, not the ships themselves
union {
char *name;
int index;
} docker;
union {
char *name;
int index;
} dockee;
} ai_goal;
#define MAX_GOAL_TARGET_NAMES 100
#define AIM_CHASE 0
#define AIM_EVADE 1
#define AIM_GET_BEHIND 2
#define AIM_STAY_NEAR 3 // Stay near another ship.
#define AIM_STILL 4 // Sit still. Don't move. Hold your breath. Don't blink.
#define AIM_GUARD 5 // Guard an object
#define AIM_AVOID 6 // Avoid an object
#define AIM_WAYPOINTS 7 // Fly waypoints
#define AIM_DOCK 8 // Dock with ship.
#define AIM_NONE 9 // Uh, do nothing.
#define AIM_BIGSHIP 10 // Like a capital ship, doesn't focus on one ship.
#define AIM_PATH 11 // Follow path on ship
#define AIM_BE_REARMED 12 // Allow self to be rearmed
#define AIM_SAFETY 13 // Seek safety at periphery of battle
#define AIM_EVADE_WEAPON 14 // Evade a weapon.
#define AIM_STRAFE 15 // Attack a big ship by strafing it
#define AIM_PLAY_DEAD 16 // Play dead. Get it? Don't move, fire, etc.
#define AIM_BAY_EMERGE 17 // Emerging from a fighter bay, following path to do so
#define AIM_BAY_DEPART 18 // Departing to a fighter bay, following path to do so
#define AIM_SENTRYGUN 19 // AI mode for sentry guns only (floating turrets)
#define AIM_WARP_OUT 20 // Commence warp out sequence. Point in legal direction. Then call John's code.
#define AIM_FLY_TO_SHIP 21 // [Kazan] Fly to a ship, doesn't matter if it's hostile or friendly -- for Autopilot usage
#define MAX_AI_BEHAVIORS 22 // Number of AIM_xxxx types
#define MAX_WAYPOINTS_PER_LIST 20
#define MAX_ENEMY_DISTANCE 2500.0f // Maximum distance from which a ship will pursue an enemy.
#define AI_GOAL_NONE -1
#define AI_ACTIVE_GOAL_DYNAMIC 999
typedef struct ai_class {
char name[NAME_LENGTH];
float ai_accuracy[NUM_SKILL_LEVELS];
float ai_evasion[NUM_SKILL_LEVELS];
float ai_courage[NUM_SKILL_LEVELS];
float ai_patience[NUM_SKILL_LEVELS];
//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.
// Note: These need to be renamed to be of the form: AIS_mode_xxxx
#define SM_CONTINUOUS_TURN 1 // takes parm: vector_id {0..3 = right, -right, up, -up}
#define SM_ATTACK 2
#define SM_EVADE_SQUIGGLE 3
#define SM_EVADE_BRAKE 4
#define SM_EVADE 5
#define SM_SUPER_ATTACK 6
#define SM_AVOID 7
#define SM_GET_BEHIND 8
#define SM_GET_AWAY 9
#define SM_EVADE_WEAPON 10 // Evade incoming weapon
#define SM_FLY_AWAY 11 // Fly away from target_objnum
#define SM_ATTACK_FOREVER 12 // Engine subsystem destroyed, so attack, never evading, avoiding, etc.
#define SM_STEALTH_FIND 13 // Stealth ship is "targeted", but not visible, so try to find based on predicted pos
#define SM_STEALTH_SWEEP 14 // General sweep, looking for stealth after not visible for some time.
#define SM_BIG_APPROACH 15 // Big ship approaches another
#define SM_BIG_CIRCLE 16 // Big ship flies circle around other big ship to get good angle to go parallel
#define SM_BIG_PARALLEL 17 // Big ship flies parallel to another
//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_UNDOCK_0 30
#define AIS_UNDOCK_1 31
#define AIS_UNDOCK_2 32
#define AIS_UNDOCK_3 33
#define AIS_UNDOCK_4 34
// Submodes for Guard behavior
#define AIS_GUARD_PATROL 101
#define AIS_GUARD_ATTACK 102
#define AIS_GUARD_2 103
#define AIS_GUARD_STATIC 104 // maintain current relative position to guard object, if possible
// Submodes for strafing big ships behavior (AIM_STRAFE)
#define AIS_STRAFE_ATTACK 201 // fly towards target and attack
#define AIS_STRAFE_AVOID 202 // fly evasive vector to avoid incoming fire
#define AIS_STRAFE_RETREAT1 203 // fly away from attack point
#define AIS_STRAFE_RETREAT2 204
#define AIS_STRAFE_POSITION 205 // re-position to resume strafing attack
#define AIS_STRAFE_GLIDE_ATTACK 206 // SUSHI: Glide strafe atack
#define WPF_REPEAT (1 << 0)
#define WPF_BACKTRACK (1 << 1)
#define PD_FORWARD 1
#define PD_BACKWARD -1
#define MIN_TRACKABLE_ASPECT_DOT 0.992f // dot of fvec and vec_to_enemy to progress towards aspect lock
// Submodes for warping out.
#define AIS_WARP_1 300 // Make sure there is no obstruction to warping out.
#define AIS_WARP_2 301
#define AIS_WARP_3 302
#define AIS_WARP_4 303
#define AIS_WARP_5 304
#define AIS_DEPART_TO_BAY 305
// A node on a path.
// Contains global location of point.
// Contains hooks back to original path information.
// This hook is used to extract information on the point such as whether it is
// protected by turrets.
typedef struct pnode {
vec3d pos;
int path_num; // path number from polymodel, ie in polymodel, paths[path_num]
int path_index; // index in original model path of point, ie in model_path, use verts[path_index]
} pnode;
#define MAX_PATH_POINTS 1000
extern pnode Path_points[MAX_PATH_POINTS];
extern pnode *Ppfp; // Free pointer in path points.
// Goober5000 (based on the "you can only remember 7 things in short-term memory" assumption)
#define MAX_IGNORE_NEW_OBJECTS 7
typedef struct ai_info {
flagset<AI::AI_Flags> ai_flags; // Special flags for AI behavior.
int shipnum; // Ship using this slot, -1 means none.
int type; //
int wing; // Member of what wing? -1 means none.
int behavior; // AI behavior; vestigial field from early development of FS1
int mode;
int previous_mode;
int mode_time; // timestamp at which current mode elapses.
int target_objnum; // object index of current target.
int target_signature; // Signature of current target.
int previous_target_objnum; // On 5/19/97, only used for player.
int stealth_last_cheat_visible_stamp; // when within 100m, always update pos and velocity, with error increasing for increasing time from last legal visible
int stealth_last_visible_stamp;
float stealth_sweep_box_size;
vec3d stealth_last_pos;
vec3d stealth_velocity;
float previous_dot_to_enemy; // dot(fvec, vec_to_enemy) last frame
float target_time; // Amount of time continuously targeting this ship.
int enemy_wing; // When picking an enemy wing, only allow to be in enemy_wing, unless == -1, in which case don't care.
int attacker_objnum;
int goal_objnum; // mode specific goal. In DOCK, ship to dock with.
int goal_signature;
int guard_objnum; // Ship to guard.
int guard_signature; // Signature of ship to guard.
int guard_wingnum; // Wing to guard. guard_objnum set to leader.
int ignore_objnum; // ship to be ignored, based on player order. UNUSED_OBJNUM if none. -(wing_num+1) if ignoring wing.
int ignore_signature; // signature of ship to be ignored
// Goober5000
int ignore_new_objnums[MAX_IGNORE_NEW_OBJECTS];
int ignore_new_signatures[MAX_IGNORE_NEW_OBJECTS];
int ai_class; // Class. Might be override of default.
// Probably become obsolete, to be replaced by path_start, path_cur, etc.
waypoint_list *wp_list; // waypoint list being followed
size_t 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
// Path following information
int path_start; // Index into global array, start of path.
int path_cur; // Index into global array, current location in path.
int path_length; // Number of links in this path.
int path_dir; // PD_FORWARD, PD_BACKWARD
int path_flags; // loop, backtrack, whatever else.
int path_objnum; // Object of interest. It's model contains the path.
int path_goal_obj_hash; // Hash value of goal object when global path created.
fix path_next_create_time; // Next time at which we'll create a global path.
vec3d path_create_pos; // Object's position at time of global path creation.
matrix path_create_orient; // Object's orientation at time of global path creation.
int mp_index; // Model path index. Index in polymodel:model_paths
fix path_next_check_time; // Last time checked to see if would collide with model.
int path_goal_dist; // minimum distance to first path point to consider path reached
int path_subsystem_next_check; // timestamp to next check if subsystem is still visible
vec3d path_depart_orient; //Rotational orientation associated with the path
int submode;
int previous_submode; // previous submode, get it?
float best_dot_to_enemy; // best dot product to enemy in last BEST_DOT_TIME seconds
float best_dot_from_enemy; // best dot product for enemy to player in last BEST_DOT_TIME seconds
fix best_dot_to_time; // time at which best dot occurred
fix best_dot_from_time; // time at which best dot occurred
fix submode_start_time; // time at which we entered the current submode
int submode_parm0; // parameter specific to current submode
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
fix last_attack_time; // Missiontime of last time this ship attacked its enemy.
fix last_hit_time; // Missiontime of last time this ship was hit by anyone.
int last_hit_quadrant; // Shield section of last hit.
fix last_hit_target_time; // Missiontime of last time this ship successfully hit target.
int hitter_objnum; // Object index of ship that hit this ship last time.
int hitter_signature; // Signature of hitter. Prevents stupidity if hitter gets killed.
fix resume_goal_time; // Time at which to resume interrupted goal, if nothing else intervenes.
float prev_accel; // Acceleration last frame.
float prev_dot_to_goal; // dot of fvec to goal last frame, used to see if making progress towards goal.
vec3d goal_point; // Used in AIM_SAFETY, AIM_STILL and in circling.
vec3d prev_goal_point; // Previous location of goal point, used at least for evading.
//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
union {
float lead_scale; // Amount to lead current opponent by.
float stay_near_distance; // Distance to stay within for AIM_STAY_NEAR mode.
};
ship_subsys* targeted_subsys; // Targeted subobject on current target. NULL if none;
ship_subsys* last_subsys_target; // last known subsystem target
int targeted_subsys_parent; // Parent objnum of subobject, not necessarily targeted
float aspect_locked_time; // Time towards acquiring lock for current_target
// Goober5000
int support_ship_objnum; // objnum of support ship docking with us, or (if we're a support ship) object we're docking to
int support_ship_signature; // signature of the same
int danger_weapon_objnum; // Closest objnum of weapon fired at this ship.
int danger_weapon_signature; // Signature of object danger_weapon_objnum.
vec3d guard_vec; // vector to object being guarded, only used in AIS_GUARD_STATIC submode
int nearest_locked_object; // Nearest locked object.
float nearest_locked_distance; // Distance to nearest locked object.
float current_target_distance; // Distance of current target from player
int current_target_is_locked; // Flag to indicate whether the current target is locked for missile fire
int current_target_dist_trend; // Tracks whether distance to target is increasing or decreasing
int current_target_speed_trend; // Tracks whether speed of target is increasing or decreasing
float last_dist; // last frame's distance between player and target
float last_speed; // last frame's target speed
int last_secondary_index; // needed for secondary weapon change check
int last_target;
int rearm_first_missile; // flag to show that reloading of missilies hasn't begun yet
int rearm_first_ballistic_primary; // flag to show that reloading of ballistic primaries hasn't begun yet
int rearm_release_delay; // timestamp used to delay separation of ships after rearm complete
fix afterburner_stop_time; // Missiontime to turn off afterburner
int last_objsig_hit; // The object number signature of the ship last hit by this ship
int ignore_expire_timestamp; // Timestamp at which temporary ignore (AIF_TEMPORARY_IGNORE) expires.
int warp_out_timestamp; // Timestamp at which this ship is to warp out.
int next_rearm_request_timestamp; // Timestamp at which ship might next request rearm.
int primary_select_timestamp; // When to next select a primary weapon.
int secondary_select_timestamp; // When to next select a secondary weapon.
int scan_for_enemy_timestamp; // When to next look for enemy fighters if sitting still while pounding
// on a bigship. SCAN_FIGHTERS_INTERVAL is defined in AiBig.h
int choose_enemy_timestamp; // Time at which it is next legal to choose a new enemy (does not apply
// to special situations, like getting hit by a weapon)
int force_warp_time; // time at which to give up avoiding a ship and just warp out
int shockwave_object; // Object index of missile that will generate a shockwave. We will try to avoid.
int shield_manage_timestamp; // Time at which to next manage shield.
int self_destruct_timestamp; // Time at which to self-destruct, probably due to being disabled.
int ok_to_target_timestamp; // Time at which this ship can dynamically target.
int kamikaze_damage; // some damage value used to produce a shockwave from a kamikaze ship
vec3d big_attack_point; // Global point this ship is attacking on a big ship.
vec3d big_attack_surface_normal; // Surface normal at ship at big_attack_point;
int pick_big_attack_point_timestamp; // timestamp at which to pick a new point to attack on a big ship.
// Note: These three avoid_XX terms are shared between the code that avoids small (only player now) and large ships
// The bits in ai_flags determine which is occurring. AIF_AVOID_SMALL_SHIP, AIF_AVOID_BIG_SHIP
int avoid_ship_num; // object index of small ship to avoid
vec3d avoid_goal_point; // point to aim at when avoiding a ship
fix avoid_check_timestamp; // timestamp at which to next check for having to avoid ship
vec3d big_collision_normal; // Global normal of collision with big ship. Helps find direction to fly away from big ship. Set for each collision.
vec3d big_recover_pos_1; // Global point to fly towards when recovering from collision with a big ship, stage 1.
vec3d big_recover_pos_2; // Global point to fly towards when recovering from collision with a big ship, stage 2.
int big_recover_timestamp; // timestamp at which it's OK to re-enter stage 1.
int abort_rearm_timestamp; // time at which this rearm should be aborted in a multiplayer game.
// artillery targeting info
int artillery_objnum; // object currently being targeted for artillery lock/attack
int artillery_sig; // artillery object signature
float artillery_lock_time; // how long we've been locked onto this guy
vec3d artillery_lock_pos; // base position of the lock point on (in model's frame of reference)
float lethality; // measure of how dangerous ship is to enemy BIG|HUGE ships (likelyhood of targeting)
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
// subsystem. We don't want to rely on the model path points for this, since we may need to be
// changed.
#define SUBSYS_PATH_DIST 500.0f
// Friendly damage defines
#define MAX_BURST_DAMAGE 20 // max damage that can be done in BURST_DURATION
#define BURST_DURATION 500 // decay time over which Player->damage_this_burst falls from MAX_BURST_DAMAGE to 0
extern int Mission_all_attack; // !0 means all teams attack all teams.
extern int Total_goal_target_names;
extern char Goal_target_names[MAX_GOAL_TARGET_NAMES][NAME_LENGTH];
extern void update_ai_info_for_hit(int hitter_obj, int hit_obj);
extern void ai_frame_all(void);
extern int find_guard_obj(void);
extern ai_info Ai_info[];
extern ai_info *Player_ai;
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 int Ai_goal_signature;
// need access to following data in AiBig.cpp
extern object *Pl_objp;
extern object *En_objp;
extern float AI_frametime;
// Return index of free AI slot.
// Return 0 if no free slot.
int ai_get_slot(int shipnum);
// Releases an AI slot to be used by someone else.
void ai_free_slot(int ai_index);
// call to init one ai object.. you can pass all sorts of
// stuff by adding new paramters.
void ai_object_init(object * obj, int ai_index);
// Called once a frame
void ai_process( object * obj, int ai_index, float frametime );
int get_wingnum(int objnum);
void set_wingnum(int objnum, int wingnum);
char *ai_get_goal_target_name(const char *name, int *index);
extern void init_ai_system(void);
extern void ai_attack_object(object *attacker, object *attacked, ship_subsys *ssp, 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_stay_still(object *still_objp, vec3d *view_pos);
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 init_ai_object(int objnum);
extern void ai_init(void); // Call this one to parse ai.tbl.
extern void ai_level_init(void); // Call before each level to reset AI
extern int ai_set_attack_subsystem(object *objp, int subnum);
extern int ai_issue_rearm_request(object *requester_objp); // Object requests rearm/repair.
extern int ai_abort_rearm_request(object *requester_objp); // Object aborts rearm/repair.
extern void ai_do_repair_frame(object *objp, ai_info *aip, float frametime); // Repair a ship object, player or AI.
extern void ai_update_danger_weapon(int objnum, int weapon_objnum);
// called externally from MissionParse.cpp to position ships in wings upon arrival into the
// mission.
extern void get_absolute_wing_pos( vec3d *result_pos, object *leader_objp, int wing_index, int formation_object_flag);
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_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_deathroll_start(object *ship_obj);
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_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);
// used to get path info for fighter bay emerging and departing
int ai_acquire_emerge_path(object *pl_objp, int parent_objnum, int path_mask, vec3d *pos, vec3d *fvec);
int ai_acquire_depart_path(object *pl_objp, int parent_objnum, int path_mask);
// used by AiBig.cpp
extern void ai_set_positions(object *pl_objp, object *en_objp, ai_info *aip, vec3d *player_pos, vec3d *enemy_pos);
extern void accelerate_ship(ai_info *aip, float accel);
extern void turn_away_from_point(object *objp, vec3d *point, float bank_override);
extern float ai_endangered_by_weapon(ai_info *aip);
extern void update_aspect_lock_information(ai_info *aip, vec3d *vec_to_enemy, float dist_to_enemy, float enemy_radius);
extern void ai_chase_ct();
extern void ai_find_path(object *pl_objp, int objnum, int path_num, int exit_flag, int subsys_path=0);
extern float ai_path();
extern void evade_weapon();
extern int might_collide_with_ship(object *obj1, object *obj2, float dot_to_enemy, float dist_to_enemy, float duration);
extern int ai_fire_primary_weapon(object *objp); //changed to return weather it fired-Bobboau
extern int ai_fire_secondary_weapon(object *objp);
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 int is_instructor(object *objp);
extern int find_enemy(int objnum, float range, int max_attackers, int ship_info_index = -1);
float ai_get_weapon_speed(ship_weapon *swp);
void set_predicted_enemy_pos_turret(vec3d *predicted_enemy_pos, vec3d *gun_pos, object *pobjp, vec3d *enemy_pos, vec3d *enemy_vel, float weapon_speed, float time_enemy_in_range);
// function to change rearm status for ai ships (called from sexpression code)
extern void ai_set_rearm_status( int team, int new_status );
extern void ai_good_secondary_time( int team, int weapon_index, int num_weapons, char *shipname );
extern void ai_do_objects_docked_stuff(object *docker, int docker_point, object *dockee, int dockee_point, bool update_clients = true);
extern void ai_do_objects_undocked_stuff( object *docker, object *dockee );
extern void ai_do_objects_repairing_stuff( object *repaired_obj, object *repair_obj, int how );
// Goober5000
// Move to a position relative to a dock bay using thrusters.
extern float dock_orient_and_approach(object *docker_objp, int docker_index, object *dockee_objp, int dockee_index, int dock_mode, rotating_dockpoint_info *rdinfo = NULL);
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);
// moved to header file by Goober5000
void ai_announce_ship_dying(object *dying_objp);
// added by kazan
void ai_start_fly_to_ship(object *objp, int shipnum);
void ai_fly_to_ship();
//Moved declaration here for player ship -WMC
void process_subobjects(int objnum);
//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
-124
View File
@@ -1,124 +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,
Support_dont_add_primaries, //Prevents support ship from equipping new primary as requested in http://scp.indiegames.us/mantis/view.php?id=3198
Turrets_ignore_target_radius,
Use_actual_primary_range,
Use_additive_weapon_velocity,
Use_newtonian_dampening,
Use_only_single_fov_for_turrets,
NUM_VALUES
};
}
#endif
-631
View File
@@ -1,631 +0,0 @@
/*
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
#include "globalincs/pstypes.h"
#include "def_files/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"
// global stuff
int Num_ai_profiles;
int Default_ai_profile;
ai_profile_t Ai_profiles[MAX_AI_PROFILES];
// local to this file
static int Ai_profiles_initted = 0;
static char Default_profile_name[NAME_LENGTH];
// utility
void set_flag(ai_profile_t *profile, const char *name, AI::Profile_Flags flag)
{
if (optional_string(name))
{
bool val;
stuff_boolean(&val);
profile->flags.set(flag, val);
}
}
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)
{
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;
char profile_name[NAME_LENGTH];
ai_profile_t dummy_profile;
char *saved_Mp = NULL;
char buf[NAME_LENGTH];
try
{
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);
set_flag(profile, "$support don't add primaries:", AI::Profile_Flags::Support_dont_add_primaries);
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()));
return;
}
// add tbl/tbm to multiplayer validation list
extern void fs2netd_add_table_validation(const char *tblname);
fs2netd_add_table_validation(filename);
}
void ai_profiles_init()
{
int temp;
if (Ai_profiles_initted)
return;
Num_ai_profiles = 0;
Default_ai_profile = 0;
Default_profile_name[0] = '\0';
// init retail entry first
parse_ai_profiles_tbl(NULL);
// now parse the supplied table (if any)
if (cf_exists_full("ai_profiles.tbl", CF_TYPE_TABLES))
parse_ai_profiles_tbl("ai_profiles.tbl");
// parse any modular tables
parse_modular_table("*-aip.tbm", parse_ai_profiles_tbl);
// set default if specified
temp = ai_profile_lookup(Default_profile_name);
if (temp >= 0)
Default_ai_profile = temp;
Ai_profiles_initted = 1;
}
int ai_profile_lookup(char *name)
{
for (int i = 0; i < Num_ai_profiles; i++)
if (!stricmp(name, Ai_profiles[i].profile_name))
return i;
return -1;
}
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;
}
}
-119
View File
@@ -1,119 +0,0 @@
/*
* Created by Ian "Goober5000" Warfield for the FreeSpace2 Source Code Project.
* You may not sell or otherwise commercially exploit the source or things you
* create based on the source.
*/
#ifndef _AI_PROFILES_H_
#define _AI_PROFILES_H_
#include "globalincs/globals.h"
#include "globalincs/pstypes.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
#define MAX_AI_PROFILES 5
class ai_profile_t {
public:
char profile_name[NAME_LENGTH];
flagset<AI::Profile_Flags> flags;
// difficulty-related values
int max_incoming_asteroids[NUM_SKILL_LEVELS]; // max number of asteroids thrown at friendlies
int max_allowed_player_homers[NUM_SKILL_LEVELS]; // max number of simultaneous homing weapons on player
int max_attackers[NUM_SKILL_LEVELS]; // max number of ships that can attack a ship
fix predict_position_delay[NUM_SKILL_LEVELS]; // how long until AI predicts a ship position
float in_range_time[NUM_SKILL_LEVELS]; // seconds to add to time it takes to get enemy in range (only for player's enemies)
float shield_manage_delay[NUM_SKILL_LEVELS]; // how long before AI manages shields (note that the player's team always uses the average skill's delay)
// AI ships link primaries if energy levels greater than these percents
float link_energy_levels_always[NUM_SKILL_LEVELS]; // always link
float link_energy_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
// AI ships link primaries if ammunition levels greater than these percents
float link_ammo_levels_always[NUM_SKILL_LEVELS]; // always link
float link_ammo_levels_maybe[NUM_SKILL_LEVELS]; // link if hull strength low
float primary_ammo_burst_mult[NUM_SKILL_LEVELS]; // SUSHI: Multiplier adjusting burst frequency for ballistic primary weapons
// difficulty-related scales
float cmeasure_life_scale[NUM_SKILL_LEVELS]; // life of countermeasures
float cmeasure_fire_chance[NUM_SKILL_LEVELS]; // chance a countermeasure will be fired based on skill level (also scaled by ai_class)
float weapon_energy_scale[NUM_SKILL_LEVELS]; // weapon energy available
float shield_energy_scale[NUM_SKILL_LEVELS]; // shield energy available
float afterburner_recharge_scale[NUM_SKILL_LEVELS]; // speed of afterburner recharge
float player_damage_scale[NUM_SKILL_LEVELS]; // damage applied to the player
float subsys_damage_scale[NUM_SKILL_LEVELS]; // damage applied to a player subsystem
float beam_friendly_damage_cap[NUM_SKILL_LEVELS]; // damage cap values for friendly beam fire
float turn_time_scale[NUM_SKILL_LEVELS]; // speed at which enemy ships turn
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();
};
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();
int ai_profile_lookup(char *name);
#endif
-1823
View File
File diff suppressed because it is too large. Load diff
-32
View File
@@ -1,32 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef __AIBIG_H__
#define __AIBIG_H__
class object;
struct ai_info;
struct vec3d;
class ship_subsys;
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);
void ai_big_pick_attack_point(object *objp, object *attacker_objp, vec3d *attack_point, float fov=1.0f);
void ai_big_pick_attack_point_turret(object *objp, ship_subsys *ssp, vec3d *gpos, vec3d *gvec, vec3d *attack_point, float weapon_travel_dist, float fov=1.0f);
#endif
-15489
View File
File diff suppressed because it is too large. Load diff
-2497
View File
File diff suppressed because it is too large. Load diff
-132
View File
@@ -1,132 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _AIGOALS_H
#define _AIGOALS_H
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
struct wing;
struct ai_info;
struct ai_goal;
// macros for goals which get set via sexpressions in the mission code
// IMPORTANT! If you add a new AI_GOAL_x define, be sure to update the functions
// ai_update_goal_references() and query_referenced_in_ai_goals() or else risk breaking
// Fred. If the goal you add doesn't have a target (such as chase_any), then you don't have
// to worry about doing this. Also add it to list in Fred\Management.cpp, and let Hoffoss know!
// 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
// 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
// resume regular goals
#define AI_GOAL_STAY_STILL (1<<20) // 0x00100000
#define AI_GOAL_PLAY_DEAD (1<<21) // 0x00200000
// 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_PLAY_DEAD_PERSISTENT (1<<26) // 0x03000000
// now the masks for ship types
// Goober5000: added AI_GOAL_STAY_NEAR_SHIP and AI_GOAL_KEEP_SAFE_DISTANCE as valid for fighters
//WMC - Don't need these anymore. Whee!
/*
#define AI_GOAL_ACCEPT_FIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_DESTROY_SUBSYSTEM | AI_GOAL_CHASE_WING | AI_GOAL_GUARD | AI_GOAL_DISABLE_SHIP | AI_GOAL_DISARM_SHIP | AI_GOAL_CHASE_ANY | AI_GOAL_IGNORE | AI_GOAL_IGNORE_NEW | AI_GOAL_GUARD_WING | AI_GOAL_EVADE_SHIP | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD | AI_GOAL_PLAY_DEAD_PERSISTENT | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE )
#define AI_GOAL_ACCEPT_BOMBER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_STEALTH ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_TRANSPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_CHASE | AI_GOAL_CHASE_WING | AI_GOAL_DOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_WARP | AI_GOAL_UNDOCK | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD | AI_GOAL_PLAY_DEAD_PERSISTENT | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_FREIGHTER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CRUISER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_FREIGHTER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CORVETTE ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_GAS_MINER ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_AWACS ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_CAPITAL ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CRUISER & ~(AI_GOAL_DOCK | AI_GOAL_UNDOCK) | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_SUPERCAP ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_CAPITAL | AI_GOAL_STAY_NEAR_SHIP )
#define AI_GOAL_ACCEPT_SUPPORT ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_DOCK | AI_GOAL_UNDOCK | AI_GOAL_WAYPOINTS | AI_GOAL_WAYPOINTS_ONCE | AI_GOAL_STAY_NEAR_SHIP | AI_GOAL_KEEP_SAFE_DISTANCE | AI_GOAL_STAY_STILL | AI_GOAL_PLAY_DEAD | AI_GOAL_PLAY_DEAD_PERSISTENT )
#define AI_GOAL_ACCEPT_ESCAPEPOD ( AI_GOAL_FLY_TO_SHIP | AI_GOAL_ACCEPT_TRANSPORT| AI_GOAL_STAY_NEAR_SHIP )
*/
#define MAX_AI_DOCK_NAMES 25
typedef flag_def_list ai_goal_list;
extern ai_goal_list Ai_goal_names[];
extern int Num_ai_goals;
extern int Num_ai_dock_names;
extern char Ai_dock_names[MAX_AI_DOCK_NAMES][NAME_LENGTH];
extern const 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, char *actor_name );
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 );
extern void ai_remove_ship_goal( ai_info *aip, int index );
extern void ai_clear_ship_goals( ai_info *aip );
extern void ai_clear_wing_goals( int wingnum );
extern void ai_copy_mission_wing_goal( ai_goal *aigp, ai_info *aip );
extern void ai_mission_goal_complete( ai_info *aip );
extern void ai_mission_wing_goal_complete( int wingnum, ai_goal *remove_goalp );
extern 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_query_goal_valid( int ship, int ai_goal_type );
extern void ai_add_goal_ship_internal( ai_info *aip, int goal_type, char *name, int docker_point, int dockee_point, int immediate = 1 );
#endif
-2854
View File
File diff suppressed because it is too large. Load diff
-940
View File
@@ -1,940 +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.
*
*/
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "bmpman/bmpman.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;
anim *first_anim = NULL;
anim_instance anim_free_list;
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_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
*/
void anim_init()
{
int i;
if ( Anim_inited == TRUE )
return;
list_init( &anim_free_list );
list_init( &anim_render_list );
// Link all anim render slots into the free list
for (i=1; i < MAX_ANIM_INSTANCES; i++) {
list_append(&anim_free_list, &anim_render_instance[i]);
}
Anim_paused = 0;
Anim_inited = TRUE;
}
/**
* @brief Display the frames for the currently playing anims
*/
void anim_render_all(int screen_id, float frametime)
{
anim_instance* A;
anim_instance* temp;
A = GET_FIRST(&anim_render_list);
while( A !=END_OF_LIST(&anim_render_list) ) {
temp = GET_NEXT(A);
if ( A->screen_id == screen_id ) {
if ( Anim_ignore_frametime ) {
frametime = 0.0f;
Anim_ignore_frametime=0;
}
if ( anim_show_next_frame(A, frametime) == -1 ) {
A->data = NULL;
anim_release_render_instance(A);
}
}
A = temp;
}
}
/**
* @brief Display the frames for the passed animation
* @details It will ignore animations which do not have the same id as the passed screen_id
*/
void anim_render_one(int screen_id, anim_instance *ani, float frametime)
{
// make sure this guy's screen id matches the passed one
if(screen_id != ani->screen_id){
return;
}
// otherwise render it
if ( Anim_ignore_frametime ) {
frametime = 0.0f;
Anim_ignore_frametime=0;
}
if ( anim_show_next_frame(ani, frametime) == -1 ) {
ani->data = NULL;
anim_release_render_instance(ani);
}
}
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)
{
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;
aps->world_pos = NULL;
aps->radius = 0.0f;
aps->framerate_independent = 0;
aps->color = NULL;
aps->skip_frames = 1;
aps->looped = 0;
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_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->looped && aps->ping_pong) ); // shouldn't have these both set at once
MONITOR_INC(NumANIPlayed, 1);
anim_instance *instance;
// Find next free anim instance slot on queue
instance = GET_FIRST(&anim_free_list);
Assert( instance != &anim_free_list ); // shouldn't have the dummy element
// remove instance from the free list
list_remove( &anim_free_list, instance );
// insert instance onto the end of anim_render_list
list_append( &anim_render_list, instance );
aps->anim_info->instance_count++;
instance->frame_num = -1;
instance->last_frame_num = -99;
instance->parent = aps->anim_info;
instance->data = aps->anim_info->data;
if ( anim_instance_is_streamed(instance) ) {
instance->file_offset = instance->parent->file_offset;
}
instance->frame = (ubyte *) vm_malloc(instance->parent->width * instance->parent->height * 2);
Assert( instance->frame != NULL );
memset( instance->frame, 0, instance->parent->width * instance->parent->height * 2 );
instance->time_elapsed = 0.0f;
instance->stop_at = aps->stop_at;
instance->x = aps->x;
instance->y = aps->y;
instance->world_pos = aps->world_pos;
instance->radius = aps->radius;
instance->framerate_independent = aps->framerate_independent;
instance->last_bitmap = -1;
instance->stop_now = FALSE;
instance->screen_id = aps->screen_id;
instance->aa_color = aps->color;
instance->skip_frames = aps->skip_frames;
instance->looped = aps->looped;
instance->ping_pong = aps->ping_pong;
instance->direction = ANIM_DIRECT_FORWARD;
instance->paused = 0;
instance->loop_count = 0;
if ( aps->color == NULL ){
instance->xlate_pal = 1;
} else {
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
instance->start_at = aps->start_at;
if ( aps->start_at > 0 ) {
key_frame *keyp;
int idx;
int key = 0;
int offset = 0;
int frame_num = aps->start_at;
keyp = instance->parent->keys;
idx = 0;
while (idx < instance->parent->num_keys) {
if (key == frame_num)
break;
key = keyp[idx].frame_num - 1;
offset = keyp[idx].offset;
idx++;
}
if (key > instance->frame_num) { // best key is closer than current position
instance->frame_num = key;
if ( anim_instance_is_streamed(instance) ) {
instance->file_offset = instance->parent->file_offset + offset;
} else {
instance->data = instance->parent->data + offset;
}
}
instance->frame_num--; // required
}
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
*/
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;
vertex image_vertex;
int aabitmap = 0;
int bpp = 16;
Assert( instance != NULL );
instance->time_elapsed += frametime;
// Advance to the next frame, if we determine enough time has elapsed.
if(instance->direction == ANIM_DIRECT_FORWARD)
n_frames = instance->stop_at - instance->start_at + 1;
else if(instance->direction == ANIM_DIRECT_REVERSE)
n_frames = instance->start_at - instance->stop_at + 1;
time = n_frames / i2fl(instance->parent->fps);
percent_through = instance->time_elapsed / time;
if(instance->direction == ANIM_DIRECT_FORWARD)
new_frame_num = instance->start_at - 1 + (int) lround(percent_through * n_frames);
else
new_frame_num = instance->start_at - 1 - (int) lround(percent_through * n_frames);
frame_save = instance->frame_num;
// If framerate independent, use the new_frame_num... unless instance->skip_frames is
// FALSE, then only advance a maximum of one frame (this is needed since some big animations
// should just play slower rather than taking the hit of decompressing multiple frames and
// creating an even greater slowdown
if (instance->framerate_independent) {
if(instance->direction == ANIM_DIRECT_FORWARD){
if ( new_frame_num > instance->last_frame_num) {
if ( instance->skip_frames )
instance->frame_num = new_frame_num;
else
instance->frame_num++;
}
} else if(instance->direction == ANIM_DIRECT_REVERSE){
if( new_frame_num < instance->last_frame_num) {
if ( instance->skip_frames )
instance->frame_num = new_frame_num;
else
instance->frame_num--;
}
}
}
else {
if(instance->direction == ANIM_DIRECT_FORWARD){
if ( new_frame_num > instance->last_frame_num) {
instance->frame_num++;
}
} else if(instance->direction == ANIM_DIRECT_REVERSE){
if ( new_frame_num < instance->last_frame_num) {
instance->frame_num--;
}
}
}
if(instance->direction == ANIM_DIRECT_FORWARD){
if ( instance->frame_num < instance->start_at ) {
instance->frame_num = instance->start_at;
}
} else if(instance->direction == ANIM_DIRECT_REVERSE){
if ( instance->frame_num > instance->start_at ) {
instance->frame_num = instance->start_at;
}
}
if ( instance->stop_now == TRUE ) {
return -1;
}
// If past the last frame, clamp to the last frame and then set the stop_now flag in the
// anim instance. The next iteration, the animation will stop.
if(instance->direction == ANIM_DIRECT_FORWARD){
if (instance->frame_num >= instance->stop_at ) {
if (instance->looped) { // looped animations
instance->frame_num = instance->stop_at;
instance->time_elapsed = 0.0f;
} else if(instance->ping_pong) { // pingponged animations
instance->frame_num = instance->stop_at;
anim_reverse_direction(instance);
} else { // one-shot animations
instance->frame_num = instance->stop_at;
instance->last_frame_num = instance->frame_num;
instance->stop_now = TRUE;
}
}
} else if(instance->direction == ANIM_DIRECT_REVERSE){
if (instance->frame_num <= instance->stop_at ) {
if (instance->looped) { // looped animations
instance->frame_num = instance->stop_at;
instance->time_elapsed = 0.0f;
} else if(instance->ping_pong) { // pingponged animations
instance->frame_num = instance->stop_at;
anim_reverse_direction(instance);
} else { // one-shot animations
instance->frame_num = instance->stop_at+1;
instance->last_frame_num = instance->frame_num;
instance->stop_now = TRUE;
}
}
}
if(instance->direction == ANIM_DIRECT_FORWARD){
if( instance->last_frame_num >= instance->start_at ) {
frame_diff = instance->frame_num - instance->last_frame_num;
} else {
frame_diff = 1;
}
} else if(instance->direction == ANIM_DIRECT_REVERSE){
if( instance->last_frame_num <= instance->start_at ) {
frame_diff = instance->last_frame_num - instance->frame_num;
} else {
frame_diff = 1;
}
}
Assert(frame_diff >= 0);
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
if(instance->paused || Anim_paused){
instance->frame_num = frame_save;
instance->time_elapsed -= frametime;
frame_diff = 0;
}
if (instance->parent->flags & ANF_XPARENT){
bitmap_flags = 0;
}
bpp = 16;
if(instance->aa_color != NULL){
bitmap_flags |= BMP_AABITMAP;
aabitmap = 1;
bpp = 8;
}
if ( frame_diff > 0 ) {
instance->last_frame_num = instance->frame_num;
t1 = timer_get_fixed_seconds();
for ( i = 0; i < frame_diff; i++ ) {
anim_check_for_palette_change(instance);
// if we're playing backwards, every frame must be a keyframe and we set the data ptr here
if(instance->direction == ANIM_DIRECT_REVERSE){
if ( anim_instance_is_streamed(instance) ) {
instance->file_offset = instance->parent->file_offset + instance->parent->keys[instance->frame_num-1].offset;
} else {
instance->data = instance->parent->data + instance->parent->keys[instance->frame_num-1].offset;
}
}
ubyte *temp = NULL;
int temp_file_offset = -1;
// if we're using bitmap polys
BM_SELECT_TEX_FORMAT();
if ( anim_instance_is_streamed(instance) ) {
if ( instance->xlate_pal ){
temp_file_offset = unpack_frame_from_file(instance, instance->frame, instance->parent->width*instance->parent->height, instance->parent->palette_translation, aabitmap, bpp);
} else {
temp_file_offset = unpack_frame_from_file(instance, instance->frame, instance->parent->width*instance->parent->height, NULL, aabitmap, bpp);
}
} else {
if ( instance->xlate_pal ){
temp = unpack_frame(instance, instance->data, instance->frame, instance->parent->width*instance->parent->height, instance->parent->palette_translation, aabitmap, bpp);
} else {
temp = unpack_frame(instance, instance->data, instance->frame, instance->parent->width*instance->parent->height, NULL, aabitmap, bpp);
}
}
// always go back to screen format
BM_SELECT_SCREEN_FORMAT();
// see if we had an error during decode (corrupted anim stream)
if ( (temp == NULL) && (temp_file_offset < 0) ) {
mprintf(("ANI: Fatal ERROR at frame %i!! Aborting playback of \"%s\"...\n", instance->frame_num, instance->parent->name));
// return -1 to end all playing of this anim instanc
return -1;
}
if(instance->direction == ANIM_DIRECT_FORWARD){
if ( anim_instance_is_streamed(instance) ) {
instance->file_offset = temp_file_offset;
} else {
instance->data = temp;
}
}
}
t2 = timer_get_fixed_seconds();
}
else {
t2=t1=0;
}
// this only happens when the anim is being looped, we need to reset the last_frame_num
if ( (instance->time_elapsed == 0) && (instance->looped) ) {
instance->last_frame_num = -1;
instance->frame_num = -1;
instance->data = instance->parent->data;
instance->file_offset = instance->parent->file_offset;
instance->loop_count++;
}
t1 = timer_get_fixed_seconds();
if ( frame_diff == 0 && instance->last_bitmap != -1 ) {
bitmap_id = instance->last_bitmap;
}
else {
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);
}
if ( bitmap_id == -1 ) {
// anim has finsished playing, free the instance frame data
anim_release_render_instance(instance);
return -1;
// NOTE: there is no need to free the instance, since it was pre-allocated as
// part of the anim_free_list
}
else {
gr_set_bitmap(bitmap_id);
// 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);
}
else {
gr_set_color_fast( (color*)instance->aa_color );
gr_aabitmap(instance->x, instance->y, GR_RESIZE_MENU_NO_OFFSET);
}
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);
}
instance->last_bitmap = bitmap_id;
}
t2 = timer_get_fixed_seconds();
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
*/
void anim_release_render_instance(anim_instance* instance)
{
Assert( instance != NULL );
if (instance->frame != NULL)
vm_free(instance->frame);
instance->frame = NULL;
instance->parent->instance_count--;
if ( instance->last_bitmap != -1 ) {
bm_release(instance->last_bitmap);
instance->last_bitmap = -1;
}
// remove instance from anim_render_list
list_remove( &anim_render_list, instance );
// insert instance into the anim_free_list
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.
*/
void anim_release_all_instances(int screen_id)
{
anim_instance* A;
anim_instance* temp;
if ( Anim_inited == FALSE )
return;
A = GET_FIRST(&anim_render_list);
while( A !=END_OF_LIST(&anim_render_list) ) {
temp = GET_NEXT(A);
if ( A->screen_id == screen_id || screen_id == 0 ) {
anim_release_render_instance(A);
}
A = temp;
}
}
// -----------------------------------------------------------------------------
// anim_read_header()
//
// Read the header of a .ani file. Below is the format of a .ani header
//
// #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 blue value
// 2 | width
// 2 | height
// 2 | number of frames
// 1 | packer code
// 763 | palette
// 2 | number of key frames
// 2 | key frame number } repeats
// 4 | key frame offset } repeats
// 4 | compressed data length
//
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
// in the original header.
// default
Color_xparent.red = 0;
Color_xparent.green = 255;
Color_xparent.blue = 0;
if ( ptr->width == 0 ) {
ptr->version = cfread_short(fp);
ptr->fps = cfread_short(fp);
// version 2 added a custom transparency color
if ( ptr->version >= 2 ) {
cfread(&Color_xparent.red, 1, 1, fp);
cfread(&Color_xparent.green, 1, 1, fp);
cfread(&Color_xparent.blue, 1, 1, fp);
}
ptr->width = cfread_short(fp);
}
else {
ptr->version = 0;
ptr->fps = 30;
}
ptr->height = cfread_short(fp);
#ifndef NDEBUG
// get size of ani compared to power of 2
int r, floor_pow;
r = ptr->height;
floor_pow = 0;
while(r >= 2) {
r /= 2;
floor_pow++;
}
int floor_size = (int) pow(2.0, floor_pow);
int diff = ptr->height - floor_size;
float waste = 100.0f * float((floor_size - diff))/(2.0f *(float)floor_size);
if (diff != 0) {
if (ptr->height > 16) {
mprintf(("ANI %s with size %dx%d (%.1f%% wasted)\n", ptr->name, ptr->width, ptr->height, waste));
}
}
#endif
ptr->total_frames = cfread_short(fp);
ptr->packer_code = cfread_ubyte(fp);
cfread(&ptr->palette, 256, 3, fp);
ptr->num_keys = cfread_short(fp);
// store xparent colors
ptr->xparent_r = Color_xparent.red;
ptr->xparent_g = Color_xparent.green;
ptr->xparent_b = Color_xparent.blue;
if(ptr->total_frames == ptr->num_keys){
ptr->flags |= ANF_ALL_KEYFRAMES;
}
}
/**
* @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 *ptr;
CFILE *fp;
int count,idx;
char name[_MAX_PATH];
Assert( real_filename != NULL );
strcpy_s( name, real_filename );
char *p = strchr( name, '.' );
if ( p ) {
*p = 0;
}
strcat_s( name, ".ani" );
ptr = first_anim;
while (ptr) {
if (!stricmp(name, ptr->name))
break;
ptr = ptr->next;
}
if (!ptr) {
fp = cfopen(name, "rb", CFILE_NORMAL, cf_dir_type);
if ( !fp )
return NULL;
ptr = (anim *) vm_malloc(sizeof(anim));
Assert(ptr);
ptr->flags = 0;
ptr->next = first_anim;
first_anim = ptr;
Assert(strlen(name) < _MAX_PATH - 1);
strcpy_s(ptr->name, name);
ptr->instance_count = 0;
ptr->width = 0;
ptr->height = 0;
ptr->total_frames = 0;
ptr->keys = NULL;
ptr->ref_count=0;
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);
}
// store how long the anim should take on playback (in seconds)
ptr->time = i2fl(ptr->total_frames)/ptr->fps;
for(idx=0;idx<ptr->num_keys;idx++){
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
}
cfread(&count, 4, 1, fp); // size of compressed data
count = INTEL_INT( count );
ptr->cfile_ptr = NULL;
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);
}
// couldn't memory-map file... must be in a packfile, so stream manually
if ( file_mapped == PAGE_FROM_MEM && !ptr->cfile_ptr ) {
ptr->flags &= ~ANF_MEM_MAPPED;
ptr->flags |= ANF_STREAMED;
ptr->cfile_ptr = cfopen(name, "rb", CFILE_NORMAL, cf_dir_type);
}
ptr->cache = NULL;
// If it opened properly as mem-mapped (or streamed)
if (ptr->cfile_ptr != NULL) {
// VERY IMPORTANT STEP
// Set the data pointer to the compressed data (which is not at the start of the
// file). Use ftell() to find out how far we've already parsed into the file
//
int offset;
offset = cftell(fp);
ptr->file_offset = offset;
if ( ptr->flags & ANF_STREAMED ) {
ptr->data = NULL;
ptr->cache_file_offset = ptr->file_offset;
ptr->cache = (ubyte*)vm_malloc(ANI_STREAM_CACHE_SIZE+2);
Assert(ptr->cache);
cfseek(ptr->cfile_ptr, offset, CF_SEEK_SET);
cfread(ptr->cache, ANI_STREAM_CACHE_SIZE, 1, ptr->cfile_ptr);
} else {
ptr->data = (ubyte*)cf_returndata(ptr->cfile_ptr) + offset;
}
} else {
// Not a memory mapped file (or streamed)
ptr->flags &= ~ANF_MEM_MAPPED;
ptr->flags &= ~ANF_STREAMED;
ptr->data = (ubyte *) vm_malloc(count);
ptr->file_offset = -1;
cfread(ptr->data, count, 1, fp);
}
cfclose(fp);
// store screen signature, so we can tell if palette changes
ptr->screen_sig = gr_screen.signature;
anim_set_palette(ptr);
}
ptr->ref_count++;
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.
*/
int anim_free(anim *ptr)
{
Assert ( ptr != NULL );
anim *list, **prev_anim;
list = first_anim;
prev_anim = &first_anim;
while (list && (list != ptr)) {
prev_anim = &list->next;
list = list->next;
}
if ( !list )
return -2;
// only free when ref_count is 0
ptr->ref_count--;
if ( ptr->ref_count > 0 )
return -1;
// only free if there are no playing instances
if ( ptr->instance_count > 0 )
return -1;
if(ptr->keys != NULL){
vm_free(ptr->keys);
ptr->keys = NULL;
}
if ( ptr->flags & (ANF_MEM_MAPPED|ANF_STREAMED) ) {
cfclose(ptr->cfile_ptr);
if (ptr->cache != NULL) {
vm_free(ptr->cache);
ptr->cache = NULL;
}
}
else {
Assert(ptr->data);
if (ptr->data != NULL) {
vm_free(ptr->data);
ptr->data = NULL;
}
}
*prev_anim = ptr->next;
vm_free(ptr);
return 0;
}
/**
* @brief Called at the beginning of a mission to initialize any mission dependent anim data.
* @todo Redundant?
*/
void anim_level_init()
{
}
/**
* @brief Called after the end of a mission to clean up any mission dependent anim data.
*/
void anim_level_close()
{
anim_release_all_instances();
}
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.");
// flip the animation direction
if(ai->direction == ANIM_DIRECT_FORWARD){
ai->direction = ANIM_DIRECT_REVERSE;
} else if(ai->direction == ANIM_DIRECT_REVERSE){
ai->direction = ANIM_DIRECT_FORWARD;
}
// flip frame_num and last_frame_num
temp = ai->frame_num;
ai->frame_num = ai->last_frame_num;
ai->last_frame_num = temp;
// flip the start and stop at frames
temp = ai->stop_at;
ai->stop_at = ai->start_at;
ai->start_at = temp;
// make sure to sync up the time correctly
if(ai->direction == ANIM_DIRECT_FORWARD){
ai->time_elapsed = ((float)ai->frame_num - (float)ai->start_at - 1.0f) / (float)ai->parent->fps;
} else if(ai->direction == ANIM_DIRECT_REVERSE) {
ai->time_elapsed = ((float)ai->start_at - (float)ai->frame_num - 1.0f) / (float)ai->parent->fps;
}
}
void anim_ignore_next_frametime()
{
Anim_ignore_frametime=1;
}
int anim_instance_is_streamed(anim_instance *ai)
{
Assert(ai);
return ( ai->parent->flags & ANF_STREAMED );
}
unsigned char anim_instance_get_byte(anim_instance *ai, int offset)
{
int absolute_offset;
anim *parent;
Assert(ai);
Assert(ai->parent->cfile_ptr);
Assert(ai->parent->flags & ANF_STREAMED);
parent = ai->parent;
absolute_offset = ai->file_offset + offset;
// maybe in cache?
int cache_offset;
cache_offset = absolute_offset - parent->cache_file_offset;
if ( (cache_offset >= 0) && (cache_offset < ANI_STREAM_CACHE_SIZE) ) {
return parent->cache[cache_offset];
} else {
// fill cache
cfseek(parent->cfile_ptr, absolute_offset, CF_SEEK_SET);
cfread(parent->cache, ANI_STREAM_CACHE_SIZE, 1, parent->cfile_ptr);
parent->cache_file_offset = absolute_offset;
return parent->cache[0];
}
}
-68
View File
@@ -1,68 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
struct anim_instance;
// 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;
vec3d *world_pos;
float radius;
int framerate_independent;
void *color;
int skip_frames;
int looped;
int ping_pong;
} anim_play_struct;
enum
{
PAGE_FROM_DISK = 0,
PAGE_FROM_MEM = 1
};
extern int Anim_paused;
void anim_init();
void anim_level_init();
void anim_level_close();
void anim_render_all(int screen_id, float frametime);
void anim_render_one(int screen_id, anim_instance *ani, float frametime);
void anim_play_init(anim_play_struct *aps, anim *a_info, int x, int y, int max_x = -1, int max_y = -1);
anim_instance *anim_play(anim_play_struct *aps);
void anim_ignore_next_frametime();
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);
int anim_free(anim *ptr);
void anim_read_header(anim *ptr, CFILE *fp);
void anim_reverse_direction(anim_instance *ai); // called automatically for ping-ponging, and can also be called externally
int anim_instance_is_streamed(anim_instance *ai);
unsigned char anim_instance_get_byte(anim_instance *ai, int offset);
#endif /* __ANIMPLAY_H__ */
-721
View File
@@ -1,721 +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.
*
*/
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
const int packer_code = PACKER_CODE;
const int transparent_code = 254;
void anim_check_for_palette_change(anim_instance *instance) {
if ( instance->parent->screen_sig != gr_screen.signature ) {
instance->parent->screen_sig = gr_screen.signature;
anim_set_palette(instance->parent);
}
}
anim_instance *init_anim_instance(anim *ptr, int bpp)
{
anim_instance *inst;
if (!ptr) {
Int3();
return NULL;
}
if ( ptr->flags & ANF_STREAMED ) {
if ( ptr->file_offset < 0 ) {
Int3();
return NULL;
}
} else {
if ( !ptr->data ) {
Int3();
return NULL;
}
}
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;
inst->data = ptr->data;
inst->file_offset = ptr->file_offset;
inst->stop_now = FALSE;
inst->aa_color = NULL;
inst->frame = (ubyte *) vm_malloc(inst->parent->width * inst->parent->height * (bpp >> 3));
Assert( inst->frame != NULL );
memset( inst->frame, 0, inst->parent->width * inst->parent->height * (bpp >> 3) );
return inst;
}
void free_anim_instance(anim_instance *inst)
{
Assert(inst->frame);
vm_free(inst->frame);
inst->frame = NULL;
inst->parent->instance_count--;
inst->parent = NULL;
inst->data = NULL;
inst->file_offset = -1;
vm_free(inst);
}
ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap, int bpp)
{
if ( anim_instance_is_streamed(inst) ) {
if ( inst->file_offset < 0 ) {
return NULL;
}
} else {
if (!inst->data){
return NULL;
}
}
inst->frame_num++;
if (inst->frame_num >= inst->parent->total_frames) {
inst->data = NULL;
inst->file_offset = inst->parent->file_offset;
return NULL;
}
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, aabitmap, bpp);
} else {
inst->file_offset = unpack_frame_from_file(inst, inst->frame, inst->parent->width*inst->parent->height, NULL, aabitmap, bpp);
}
} else {
if ( xlate_pal ){
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, inst->parent->palette_translation, aabitmap, bpp);
} else {
inst->data = unpack_frame(inst, inst->data, inst->frame, inst->parent->width*inst->parent->height, NULL, aabitmap, bpp);
}
}
return inst->frame;
}
/**
* @brief Convert a 24 bit value to a 16 bit value
* @param bit_24 24 bit value
* @param bit_16 16 bit value (output)
*/
void convert_24_to_16(int bit_24, ushort *bit_16)
{
ubyte *pixel = (ubyte*)&bit_24;
ubyte alpha = 1;
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
*/
int unpack_pixel(anim_instance *ai, ubyte *data, ubyte pix, int aabitmap, int bpp)
{
int bit_24;
ushort bit_16 = 0;
ubyte bit_8 = 0;
ubyte al = 0;
ubyte r, g, b;
int pixel_size = (bpp / 8);
anim *a = ai->parent;
Assert(a);
// if this is an aabitmap, don't run through the palette
if(aabitmap){
switch(bpp){
case 16 :
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);
}
break;
default:
Int3();
}
} else {
// if the pixel value is 255, or is the xparent color, make it so
if(((a->palette[pix*3] == a->xparent_r) && (a->palette[pix*3+1] == a->xparent_g) && (a->palette[pix*3+2] == a->xparent_b)) ){
if (pixel_size > 2) {
bit_24 = 0;
} else {
r = b = 0;
g = 255;
bm_set_components((ubyte*)&bit_16, &r, &g, &b, &al);
}
} else {
if (pixel_size > 2) {
ubyte pixel[4];
pixel[0] = ai->parent->palette[pix * 3 + 2];
pixel[1] = ai->parent->palette[pix * 3 + 1];
pixel[2] = ai->parent->palette[pix * 3];
pixel[3] = 255;
memcpy(&bit_24, pixel, sizeof(int));
if (pixel_size == 4) {
bit_24 = INTEL_INT(bit_24);
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3); //-V512
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
}
}
}
// stuff the pixel
switch (bpp) {
case 32:
case 24:
memcpy(data, &bit_24, pixel_size);
break;
case 16:
memcpy(data, &bit_16, pixel_size);
break;
case 8:
*data = bit_8;
break;
default:
Int3();
return 0;
}
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)
{
int bit_24;
int idx;
ubyte al = 0;
ushort bit_16 = 0;
ubyte bit_8 = 0;
anim *a = ai->parent;
int pixel_size = (bpp / 8);
ubyte r, g, b;
Assert(a);
// if this is an aabitmap, don't run through the palette
if(aabitmap){
switch(bpp){
case 16 :
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);
}
break;
default :
Int3();
}
} else {
// if the pixel value is 255, or is the xparent color, make it so
if(((a->palette[pix*3] == a->xparent_r) && (a->palette[pix*3+1] == a->xparent_g) && (a->palette[pix*3+2] == a->xparent_b)) ){
if (pixel_size > 2) {
bit_24 = 0;
} else {
r = b = 0;
g = 255;
bm_set_components((ubyte*)&bit_16, &r, &g, &b, &al);
}
} else {
if (pixel_size > 2) {
ubyte pixel[4];
pixel[0] = ai->parent->palette[pix * 3 + 2];
pixel[1] = ai->parent->palette[pix * 3 + 1];
pixel[2] = ai->parent->palette[pix * 3];
pixel[3] = 255;
memcpy(&bit_24, pixel, sizeof(int));
if (pixel_size == 4) {
bit_24 = INTEL_INT(bit_24);
}
} else {
// stuff the 24 bit value
memcpy(&bit_24, &ai->parent->palette[pix * 3], 3); //-V512
// convert to 16 bit
convert_24_to_16(bit_24, &bit_16);
}
}
}
// stuff the pixel
for (idx=0; idx<count; idx++) {
switch (bpp) {
case 32:
case 24:
memcpy(data + (idx * pixel_size), &bit_24, pixel_size);
break;
case 16:
memcpy(data + (idx * pixel_size), &bit_16, pixel_size);
break;
case 8:
*(data + idx) = bit_8;
break;
}
}
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
*/
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;
int stuffed;
int pixel_size = (bpp / 8);
if ( pal_translate == NULL ) {
xlate_pal = 0;
}
else {
xlate_pal = 1;
}
if (*ptr == PACKING_METHOD_RLE_KEY) { // key frame, Hoffoss's RLE format
ptr++;
while (size > 0) {
value = *ptr++;
if (value != packer_code) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
frame += stuffed;
size--;
} else {
count = *ptr++;
if (count < 2){
value = packer_code;
} else {
value = *ptr++;
}
if (++count > size){
count = size;
}
if ( xlate_pal ){
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
frame += stuffed;
size -= count;
}
}
}
else if ( *ptr == PACKING_METHOD_STD_RLE_KEY) { // key frame, with high bit as count
ptr++;
while (size > 0) {
value = *ptr++;
if ( !(value & STD_RLE_CODE) ) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
frame += stuffed;
size--;
} else {
count = value & (~STD_RLE_CODE);
value = *ptr++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
if ( xlate_pal ){
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
frame += stuffed;
}
}
}
else if (*ptr == PACKING_METHOD_RLE) { // normal frame, Hoffoss's RLE format
ptr++;
while (size > 0) {
value = *ptr++;
if (value != packer_code) {
if (value != transparent_code) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
} else {
// temporary pixel
stuffed = pixel_size;
}
frame += stuffed;
size--;
} else {
count = *ptr++;
if (count < 2){
value = packer_code;
} else {
value = *ptr++;
}
if (++count > size){
count = size;
}
size -= count;
Assert(size >= 0);
if (value != transparent_code ) {
if ( xlate_pal ) {
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
} else {
stuffed = count * pixel_size;
}
frame += stuffed;
}
}
}
else if ( *ptr == PACKING_METHOD_STD_RLE) { // normal frame, with high bit as count
ptr++;
while (size > 0) {
value = *ptr++;
if ( !(value & STD_RLE_CODE) ) {
if (value != transparent_code) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
} else {
stuffed = pixel_size;
}
frame += stuffed;
size--;
} else {
count = value & (~STD_RLE_CODE);
value = *ptr++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
if (value != transparent_code) {
if ( xlate_pal ){
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
} else {
stuffed = pixel_size * count;
}
frame += stuffed;
}
}
}
else {
// 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
*/
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;
int offset = 0;
int stuffed;
int pixel_size = (bpp / 8);
if ( pal_translate == NULL ) {
xlate_pal = 0;
}
else {
xlate_pal = 1;
}
if (anim_instance_get_byte(ai,offset) == PACKING_METHOD_RLE_KEY) { // key frame, Hoffoss's RLE format
offset++;
while (size > 0) {
value = anim_instance_get_byte(ai,offset);
offset++;
if (value != packer_code) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
frame += stuffed;
size--;
} else {
count = anim_instance_get_byte(ai,offset);
offset++;
if (count < 2) {
value = packer_code;
} else {
value = anim_instance_get_byte(ai,offset);
offset++;
}
if (++count > size){
count = size;
}
if ( xlate_pal ){
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
frame += stuffed;
size -= count;
}
}
}
else if ( anim_instance_get_byte(ai,offset) == PACKING_METHOD_STD_RLE_KEY) { // key frame, with high bit as count
offset++;
while (size > 0) {
value = anim_instance_get_byte(ai,offset);
offset++;
if ( !(value & STD_RLE_CODE) ) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
frame += stuffed;
size--;
} else {
count = value & (~STD_RLE_CODE);
value = anim_instance_get_byte(ai,offset);
offset++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
if ( xlate_pal ){
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
frame += stuffed;
}
}
}
else if (anim_instance_get_byte(ai,offset) == PACKING_METHOD_RLE) { // normal frame, Hoffoss's RLE format
offset++;
while (size > 0) {
value = anim_instance_get_byte(ai,offset);
offset++;
if (value != packer_code) {
if (value != transparent_code) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
} else {
stuffed = pixel_size;
}
frame += stuffed;
size--;
} else {
count = anim_instance_get_byte(ai,offset);
offset++;
if (count < 2) {
value = packer_code;
} else {
value = anim_instance_get_byte(ai,offset);
offset++;
}
if (++count > size){
count = size;
}
size -= count;
Assert(size >= 0);
if (value != transparent_code ) {
if ( xlate_pal ) {
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
} else {
stuffed = pixel_size * count;
}
frame += stuffed;
}
}
}
else if ( anim_instance_get_byte(ai,offset) ) { // normal frame, with high bit as count
offset++;
while (size > 0) {
value = anim_instance_get_byte(ai,offset);
offset++;
if ( !(value & STD_RLE_CODE) ) {
if (value != transparent_code) {
if ( xlate_pal ){
stuffed = unpack_pixel(ai, frame, pal_translate[value], aabitmap, bpp);
} else {
stuffed = unpack_pixel(ai, frame, (ubyte)value, aabitmap, bpp);
}
} else {
stuffed = pixel_size;
}
frame += stuffed;
size--;
} else {
count = value & (~STD_RLE_CODE);
value = anim_instance_get_byte(ai,offset);
offset++;
if (count > size)
count = size;
size -= count;
Assert(size >= 0);
if (value != transparent_code) {
if ( xlate_pal ){
stuffed = unpack_pixel_count(ai, frame, pal_translate[value], count, aabitmap, bpp);
} else {
stuffed = unpack_pixel_count(ai, frame, (ubyte)value, count, aabitmap, bpp);
}
} else {
stuffed = pixel_size * count;
}
frame += stuffed;
}
}
}
else {
// unknown packing method
return -1;
}
return ai->file_offset + offset;
}
/**
* @brief Set animation palette
* @todo Actually convert the frame data to correct palette at this point
*/
void anim_set_palette(anim *ptr)
{
int i, xparent_found = 0;
// create the palette translation look-up table
for ( i = 0; i < 256; i++ ) {
ptr->palette_translation[i] = (ubyte)i;
}
if ( xparent_found ) {
ptr->flags |= ANF_XPARENT;
}
else {
ptr->flags &= ~ANF_XPARENT;
}
}
-111
View File
@@ -1,111 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef __PACKUNPACK_H__
#define __PACKUNPACK_H__
#include "globalincs/pstypes.h"
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 STD_RLE_CODE 0x80
typedef struct key_frame {
int frame_num; // which frame number this key frame is
int offset; // offset from the start of data block
} key_frame;
#define ANF_MEM_MAPPED (1<<0) // animation is memory-mapped file
#define ANF_STREAMED (1<<1)
#define ANF_XPARENT (1<<2) // animation has transparency
#define ANF_ALL_KEYFRAMES (1<<3) // all the frames are keyframes (this is necessary if we want to play the file backwards)
typedef struct anim {
anim *next;
char name[MAX_PATH_LEN];
ubyte packer_code;
int width;
int height;
int total_frames;
int instance_count; // number of instances that are currently playing
int ref_count; // number of times this anim has been loaded
float time; // playback time in seconds
int num_keys;
key_frame *keys;
ubyte palette[768];
ubyte palette_translation[256];
ubyte *data; // points to compressed data
CFILE* cfile_ptr;
int version;
int fps;
ubyte xparent_r; // red component for the transparent color in source image
ubyte xparent_g; // green component for the transparent color in source image
ubyte xparent_b; // blue component for the transparent color in source image
int flags;
uint screen_sig;
int file_offset; // file offset to start of frame data
int cache_file_offset;
ubyte *cache;
} anim;
// the direction to play the anim (forwards or backwards)
#define ANIM_DIRECT_FORWARD 0
#define ANIM_DIRECT_REVERSE 1
typedef struct anim_instance {
anim_instance *next, *prev;
int x,y; // coordinates anim is played at (top left corner of anim)
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)
int last_frame_num;// last frame rendered
anim *parent; // pointer to anim structure, which holds compressed data
ubyte *data; // pointer to next frame's compressed data
ubyte *frame; // uncompressed frame
float time_elapsed; // how long the anim has played for (in seconds)
int start_at; // frame anim playing should start
int stop_at; // frame anim playing should stop
int framerate_independent; // animation should play back in same amount of time, regardless
int skip_frames; // should anim skip frames during framerate independent playback
int looped; // should anim keep playing over and over...
int stop_now; // flag to indicate time to stop the animation
int last_bitmap; // id of last bitmap that was rendered out from animation
int screen_id; // 0 means all screens should render, otherwise screen specific
void *aa_color; // anti-aliased bitmap color
int xlate_pal;
int direction; // playing forwards or backwards ?
int ping_pong; // should be played ping-pong style
int paused; // pause the anim
int file_offset; // current offset into frame (like data, put offset into file)
int loop_count; // starts at 0, and is incremented each time it loops
} anim_instance;
ubyte *unpack_frame(anim_instance *ai, ubyte *ptr, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp);
int unpack_frame_from_file(anim_instance *ai, ubyte *frame, int size, ubyte *pal_translate, int aabitmap, int bpp);
void anim_init();
anim_instance *init_anim_instance(anim *ptr, int bpp);
void free_anim_instance(anim_instance *inst);
ubyte *anim_get_next_raw_buffer(anim_instance *inst, int xlate_pal, int aabitmap, int bpp);
void anim_set_palette(anim *a);
void anim_check_for_palette_change(anim_instance *inst);
#endif /* __PACKUNPACK_H__ */
File diff suppressed because it is too large. Load diff
-172
View File
@@ -1,172 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "globalincs/globals.h" // for NAME_LENGTH
#include "globalincs/pstypes.h"
class object;
class polymodel;
struct collision_info_struct;
class model_draw_list;
#define MAX_ASTEROIDS 512
#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
// these should always be equal for the benefit of generic asteroids (c.f. asteroid_page_in)
#define MAX_ACTIVE_DEBRIS_TYPES NUM_DEBRIS_SIZES
// Goober5000 - currently same as MAX_SHIP_DETAIL_LEVELS (put here to avoid an #include)
#define MAX_ASTEROID_DETAIL_LEVELS 5
// Data structure to track the active asteroids
typedef struct asteroid_obj {
asteroid_obj *next, *prev;
int flags, objnum;
} asteroid_obj;
extern asteroid_obj Asteroid_obj_list;
// Data structure for determining a type and amount of other asteroids an
// asteroid will split to when destroyed.
typedef struct asteroid_split_info {
int asteroid_type;
int min;
int max;
} asteroid_split_info;
class asteroid_info
{
public:
char name[NAME_LENGTH]; // name for the asteroid
char pof_files[NUM_DEBRIS_POFS][MAX_FILENAME_LEN]; // POF files to load/associate with ship
int num_detail_levels; // number of detail levels for this ship
int detail_distance[MAX_ASTEROID_DETAIL_LEVELS]; // distance to change detail levels at
float max_speed; // cap on speed for asteroid
int damage_type_idx; //Damage type of the asteroid
int damage_type_idx_sav; // stored value from table used to reset damage_type_idx
float inner_rad; // radius within which maximum area effect damage is applied
float outer_rad; // radius at which no area effect damage is applied
float damage; // maximum damage applied from area effect explosion
float blast; // maximum blast impulse from area effect explosion
float initial_asteroid_strength; // starting strength of asteroid
SCP_vector< asteroid_split_info > split_info;
polymodel *modelp[NUM_DEBRIS_POFS];
int model_num[NUM_DEBRIS_POFS];
SCP_vector<int> explosion_bitmap_anims;
float fireball_radius_multiplier; // the model radius is multiplied by this to determine the fireball size
asteroid_info( )
: 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;
}
}
};
#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_collide; // timestamp to check for asteroid colliding with escort ships
int final_death_time; // timestamp to swap in new models after explosion starts
int collide_objnum; // set to objnum that asteroid will be impacting soon
int collide_objsig; // object signature corresponding to collide_objnum
vec3d death_hit_pos; // hit pos that caused death
int target_objnum; // Yes, hah! Asteroids can have targets. See asteroid_aim_at_target().
} asteroid;
// TYPEDEF FOR DEBRIS TYPE
typedef enum {
DG_ASTEROID,
DG_SHIP
} debris_genre_t;
// TYPEDEF FOR FIELD TYPE
typedef enum {
FT_ACTIVE,
FT_PASSIVE
} field_type_t;
typedef struct asteroid_field {
vec3d min_bound; // Minimum range of field.
vec3d max_bound; // Maximum range of field.
float bound_rad;
int has_inner_bound;
vec3d inner_min_bound;
vec3d inner_max_bound;
vec3d vel; // Average asteroid moves at this velocity.
float speed; // Average speed of field
int num_initial_asteroids; // Number of asteroids at creation.
field_type_t field_type; // active throws and wraps, passive does not
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
} asteroid_field;
extern SCP_vector< asteroid_info > Asteroid_info;
extern asteroid Asteroids[MAX_ASTEROIDS];
extern asteroid_field Asteroid_field;
extern int Num_asteroids;
extern int Asteroids_enabled;
extern char Asteroid_icon_closeup_model[NAME_LENGTH]; // model for asteroid field briefing icon rendering
extern vec3d Asteroid_icon_closeup_position; // closeup position for asteroid field briefing icon rendering
extern float Asteroid_icon_closeup_zoom; // zoom position for asteroid field briefing icon rendering
void asteroid_init();
void asteroid_level_init();
void asteroid_level_close();
void asteroid_create_all();
void asteroid_render(object * obj, model_draw_list *scene);
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 );
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();
// need to extern for multiplayer
void asteroid_sub_create(object *parent_objp, int asteroid_type, vec3d *relvec);
void asteroid_frame();
#endif // __ASTEROID_H__
File diff suppressed because it is too large. Load diff
-161
View File
@@ -1,161 +0,0 @@
// Autopilot.h
// Derek Meek
// 4-30-2004
#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_HIDDEN 0x0004 // Nav Point doesn't show on map and isn't selectable
#define NP_NOACCESS 0x0008 // Nav Point isn't selectable
#define NP_VISITED 0x0100 // Whether we've been within 1,000 meters of this waypoint
#define NP_NOSELECT ( NP_HIDDEN | NP_NOACCESS )
#define NP_VALIDTYPE ( NP_WAYPOINT | NP_SHIP )
class NavPoint
{
public:
char m_NavName[32];
int flags;
void *target_obj;
int waypoint_num; //only used when flags & NP_WAYPOINT
vec3d *GetPosition();
void clear()
{
m_NavName[0] = 0;
flags = 0;
target_obj = NULL;
waypoint_num = -1;
}
};
#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
{
char message[256];
char filename[256]; // can be ""
};
extern bool AutoPilotEngaged;
extern int CurrentNav;
extern NavPoint Navs[MAX_NAVPOINTS];
extern NavMessage NavMsgs[NP_NUM_MESSAGES];
extern int LockAPConv;
extern SCP_map<int,int> autopilot_wings;
// Cycles through the NavPoint List
bool Sel_NextNav();
// Tell us if autopilot is allowed
// This needs:
// * Nav point selected
// * No enemies within AutopilotMinEnemyDistance meters
// * No asteroids within AutopilotMinAsteroidDistance 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); }
// 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();
// Disengages autopilot
// this does:
// * Time compression to 1x
// * Delete AI nav goal
// * Control switched from AI to player
void EndAutoPilot();
// Checks for changes every NPS_TICKRATE milliseconds
// Checks:
// * if we've gotten close enough to a nav point for it to be counted as "Visited"
// * If we're current AutoNavigating it checks if we need to autodisengage
void NavSystem_Do();
// Inits the Nav System
void NavSystem_Init();
// parse autopilot.tbl
void parse_autopilot_table(const 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();
// Removes a Nav
bool DelNavPoint(char *Nav);
bool DelNavPoint(int nav);
// adds a Nav
bool AddNav_Ship(char *Nav, char *TargetName, int flags);
bool AddNav_Waypoint(char *Nav, char *WP_Path, int node, int flags);
// Sexp Accessors
bool Nav_Set_Flag(char *Nav, int flag);
bool Nav_UnSet_Flag(char *Nav, int flag);
bool Nav_Set_Hidden(char *Nav);
bool Nav_Set_NoAccess(char *Nav);
bool Nav_Set_Visited(char *Nav);
bool Nav_UnSet_Hidden(char *Nav);
bool Nav_UnSet_NoAccess(char *Nav);
bool Nav_UnSet_Visited(char *Nav);
// Useful functions
unsigned int DistanceTo(char *nav);
unsigned int DistanceTo(int nav);
bool IsVisited(char *nav);
bool IsVisited(int nav);
void send_autopilot_msg(char *msg, char *snd=NULL);
void send_autopilot_msgID(int msgid);
#endif
-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);
}
-132
View File
@@ -1,132 +0,0 @@
#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.
*
*/
/**
* @file bm_internal.h
* These are functions and types used by bmpman and a few others.
*
* @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
*/
#ifndef BMPMAN_INTERNAL
#error The file header "bmpman/bm_internal.h" is protected. Make sure you know what you are doing!
#endif
#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;
};
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
struct {
// stuff for static animations
BM_TYPE 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
} user;
};
struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; //!< filename for this bitmap
uint signature; //!< a unique signature identifying the data
int handle; //!< Handle = id*MAX_BITMAPS + bitmapnum
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.
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
// Stuff to keep track of usage
ubyte preloaded; //!< If set, then this was loaded from the lst file
int preload_count; //!< how many times this gets used in game, for unlocking
ubyte used_flags; //!< What flags it was accessed thru
int load_count;
bitmap bm; //!< Bitmap info
bm_extra_info info; //!< Data for animations and user bitmaps
#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
#endif
};
struct bitmap_slot {
bitmap_entry entry;
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 );
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 // __BM_INTERNAL_H__
File diff suppressed because it is too large. Load diff
-675
View File
@@ -1,675 +0,0 @@
#ifndef _BMPMAN_H
#define _BMPMAN_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.
*
*/
/**
* @file bmpman.h
* Header file for the bitmap manager (bmpman)
*/
/**
* @example bm_examples.cpp
* @brief This containes examples of bmpman usage
*/
#include "cfile/cfile.h"
#include "globalincs/pstypes.h"
#ifndef NDEBUG
#define BMPMAN_NDEBUG //!< Enables BMPMAN debugging code
#endif
/**
* @defgroup BMPMAN_CONSTANTS Macro constants used in/with bmpman.h
*
* @{
*/
// Flag positions for bitmap.flags
// ***** NOTE: bitmap.flags is an 8-bit value, no more BMP_TEX_* flags can be added unless the type is changed!! ******
#define BMP_AABITMAP (1<<0) //!< antialiased bitmap
#define BMP_TEX_XPARENT (1<<1) //!< transparent texture
#define BMP_TEX_OTHER (1<<2) //!< so we can identify all "normal" textures
#define BMP_TEX_DXT1 (1<<3) //!< dxt1 compressed 8r8g8b1a (24bit)
#define BMP_TEX_DXT3 (1<<4) //!< dxt3 compressed 8r8g8b4a (32bit)
#define BMP_TEX_DXT5 (1<<5) //!< dxt5 compressed 8r8g8b8a (32bit)
#define BMP_TEX_CUBEMAP (1<<6) //!< a texture made for cubic environment map
#define BMP_MASK_BITMAP (1<<7) //!< a bitmap that will be used for masking mouse interaction. Typically not used in render operations
// Combined flags
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 ) //!< Compressed textures
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_OTHER ) //!< Non-compressed textures
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP ) //!< Any texture
// Flag positions for bitmap.type
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0) //!< Texture is a static type
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1) //!< Texture is a dynamic type (animation)
#define BMP_FLAG_CUBEMAP (1<<2) //!< Texture is a cubemap
// Bitmap types
enum BM_TYPE
{
BM_TYPE_NONE = 0, //!< No type
BM_TYPE_USER, //!< in-memory
BM_TYPE_PCX, //!< PCX
BM_TYPE_TGA, //!< 16 or 32 bit targa
BM_TYPE_DDS, //!< generic identifier for DDS
BM_TYPE_PNG, //!< PNG
BM_TYPE_JPG, //!< 32 bit jpeg
BM_TYPE_ANI, //!< in-house ANI format
BM_TYPE_EFF, //!< specifies any type of animated image, the EFF itself is just text
// special types
BM_TYPE_RENDER_TARGET_STATIC, //!< 24/32 bit setup internally as a static render target
BM_TYPE_RENDER_TARGET_DYNAMIC, //!< 24/32 bit setup internally as a dynamic render target
// Compressed types (bitmap.c_type)
BM_TYPE_DXT1, //!< 24 bit with switchable alpha
BM_TYPE_DXT3, //!< 32 bit with 4 bit alpha
BM_TYPE_DXT5, //!< 32 bit with 8 bit alpha
BM_TYPE_CUBEMAP_DDS, //!< generic DDS cubemap (uncompressed cubemap surface)
BM_TYPE_CUBEMAP_DXT1, //!< 24-bit cubemap (compressed cubemap surface)
BM_TYPE_CUBEMAP_DXT3, //!< 32-bit cubemap (compressed cubemap surface)
BM_TYPE_CUBEMAP_DXT5 //!< 32-bit cubemap (compressed cubemap surface)
};
/**
* @}
*/
struct bitmap
{
short w; //!< Width, in number of pixels
short h; //!< Height, in number of pixels
short rowsize; //!< What you need to add to go to next row
int bpp; //!< Requested bitdepth of each pixel. ( 7, 8, 15, 16, 24, 32)
int true_bpp; //!< The image's actual bitdepth
ubyte flags; //!< Various texture type flags. @see BMPMAN_CONSTANTS
ptr_u data; //!< Pointer to data, or maybe offset into VRAM.
ubyte *palette; /**< @brief Pointer to this bitmap's palette (if it has one).
* @details If BMP_NO_PALETTE_MAP flag is cleared, this palette just points to the screen palette. (gr_palette)
*/
};
// Forward definition for the graphics API
struct bitmap_entry;
struct bitmap_slot;
extern size_t bm_texture_ram; //!< how many bytes of textures are used.
extern int Bm_paging; //!< Bool type that indicates if BMPMAN is currently paging.
extern const BM_TYPE bm_type_list[]; //!< List of valid bitmap types
extern const char *bm_ext_list[]; //!< List of extensions for those types
extern const int BM_NUM_TYPES; //!< Calculated number of bitmap types
extern const BM_TYPE bm_ani_type_list[]; //!< List of valid bitmap animation types
extern const char *bm_ani_ext_list[]; //!< List of extensions for those types
extern const int BM_ANI_NUM_TYPES; //!< Calculated number of bitmap animation types
extern int ENVMAP; //!< References a map that is for environment mapping -Bobboau
/**
* @brief Initilizes the bitmap manager
*/
void bm_init();
/**
* @brief Closes the bitmap manager, freeing any allocated memory used by bitmaps. Is called at program close.
*/
void bm_close();
#define BMP_FLAG_RENDER_TARGET_STATIC (1<<0)
#define BMP_FLAG_RENDER_TARGET_DYNAMIC (1<<1)
#define BMP_FLAG_CUBEMAP (1<<2)
#define BMP_FLAG_RENDER_TARGET_MIPMAP (1<<3)
/**
* @brief Allocates memory for the given handle.
*
* @returns A pointer to the allocated vm if successful,
* @returns Null, if unsuccessful
*
* @note z64 - This function looks fishy. Not only is handle not used in release builds, but bm_bitmaps[handle].size
* and bm_texture_size aren't modified unless this is a debug build
*/
void *bm_malloc(int handle, size_t size);
/**
* @brief (DEBUG) Similar to bm_malloc, but only updates how much memory is used
*
* @note z64 - Also fishy (see bm_malloc)
*/
void bm_update_memory_used(int n, size_t size);
class bitmap_lookup {
ubyte *Bitmap_data;
int Width;
int Height;
int Num_channels;
float map_texture_address(float address);
public:
bitmap_lookup(int bitmap_num);
~bitmap_lookup();
bool valid();
float get_channel_alpha(float u, float v);
};
/**
* @brief Loads a bitmap so we can draw with it later.
*
* @param filename
*
* @returns The bitmap number if successful, else
* @returns a negative value if not
*/
int bm_load(const char* filename);
/**
* @brief Loads a bitmap so we can draw with it later. (Preferred version)
*
* @param filename
*
* @returns The bitmap number if successful, else
* @returns a negative value if not
*/
int bm_load(const SCP_string& filename);
/**
* @brief Reloads a bitmap as a duplicate.
*
* @details This function basically allows you to load a bitmap which already exists (by filename). This is useful
* because in some cases we need to have a bitmap which is locked in screen format _and_ texture format, such as
* the pilot pics and squad logos
*
* @param filename
*
* @returns The bitmap number if successful, else
* @returns a negative value if not
*/
int bm_load_duplicate(const char *filename);
/**
* Loads a bitmap which exists somewhere in the RAM.
*
* @param bpp The bitdepth of the bitmap
* @param w The width of the bitmap
* @param h The height of the bitmap
* @param[in] data The bitmap's data glob
* @param flags
*
* @note The used RAM cannot be freed until bm_release is called on the created bitmap
*/
int bm_create(int bpp, int w, int h, void *data = NULL, int flags = 0);
/**
* @brief Unloads a bitmap's data, but not the bitmap info
*
* @details The bm number (n) may be reused once this function has been called on it. However, it will have to be paged
* in the next time it is locked.
* @param handle The index number of the bitmap to free
* @param clear_render_targets If true, release a render target
* @param nodebug If true, exclude certain debug messages
*
* @returns 0 if not successful,
* @returns 1 if successful
*/
int bm_unload(int handle, int clear_render_targets = 0, bool nodebug = false);
/**
* @brief Quickly unloads a bitmap's data, ignoring the load_count
*
* @details Similar to bm_unload(), except that it can be safely used to free data without worrying about load_count.
* It's safe to use in relation to bm_release() and in gr_*_texture functions
*
* @param handle The bm number of the bitmap to free
* @param clear_render_targets If true, release a render target
*
* @note bm_free_data_fast() is used here and NOT bm_free_data()
*/
int bm_unload_fast(int handle, int clear_render_targets = 0);
/**
* @brief Frees both a bitmap's data and it's associated slot.
*
* @details Once called, the bm number 'n' cannot be used until bm_load or bm_create is re-inits the slot.
*
* @param handle The index number of the bitmap to release
* @param clear_render_targets If nonzero, also release render targets
*
* @returns 1 on success,
* @returns 0 otherwise
*
* @note If the passed handle is that of an ANI, it frees EVERY frame. Be sure to only pass the handle of the first frame!
*
* @todo upgrade return type and clear_render_targets type to bools
*/
int bm_release(int handle, int clear_render_targets = 0);
/**
* @brief Loads a bitmap sequance so we can draw with it.
*
* @param[in] filename
* @param[out] nframes If non-null, set to the number of frames the animation has
* @param[out] fps If non-null, set to the fps of this animation
* @param[out] keyframe if non null, set to the keyframe index of this animation
* @param[in] can_drop_frames If set, allows dropped frames
* @param[in] dir_type Directory type
*
* @returns The bm number of the first bitmap in the sequence if successful, or
* @returns A negative value if unsuccessful
*/
int bm_load_animation(const char *filename, int *nframes = nullptr, int *fps = nullptr, int *keyframe = nullptr, float *total_time = nullptr, bool can_drop_frames = 0, int dir_type = CF_TYPE_ANY);
/**
* @brief Loads either animation (bm_load_animation) or still image (bm_load)
*
* @param[in] filename
* @param[out] nframes If non-null and loading was successful, set to the number of frames the animation has
* @param[out] fps If non-null and loading was successful, set to the fps of this animation
* @param[out] keyframe if non null and loading was successful, set to the keyframe index of this animation
* @param[in] can_drop_frames
* @param[in] dir_type
*
* @returns The bm number of the first bitmap in the sequence if successful, or
* @returns A negative value if unsuccessful
*/
int bm_load_either(const char *filename, int *nframes = NULL, int *fps = NULL, int *keyframe = NULL, bool can_drop_frames = false, int dir_type = CF_TYPE_ANY);
/**
* @brief Locks down the bitmap indexed by bitmapnum.
*
* @details Also converts the bitmap to the appropriate format specified by bpp and flags. Only lock a bitmap when you
* need it!
*
* @param handle The number indexing the desired bitmap
* @param bpp The desired bpp of the bitmep
* @param flags The desired bitmap format
* @param nodebug
* @returns A pointer to the bitmap that's valid until bm_unlock is called if successful, or
* @returns NULL if unsuccessful
*/
bitmap* bm_lock(int handle, int bpp, ubyte flags, bool nodebug = false);
/**
* @brief Returns the image type of the given bitmap handle
*/
BM_TYPE bm_get_type(int handle);
/**
* @brief Unlocks a bitmap
*
* @details Decrements the ref_count member of the bitmap_entry struct, A bitmap can only be unloaded when the
* ref_count is 0
*/
void bm_unlock(int handle);
/**
* @brief Checks if the bitmap indexed by handle is valid
*
* @details Some early known false or out of range handles (such as negative) are checked within
* an initial routine pass, followed by a more thorough check routine to ensure the
* series of bitmaps within the bm_bitmaps[] structure have not become invalid.
*
* @returns Nonzero if valid, else
* @returns Zero otherwise
*
* @todo z64 - Returned value is essentially a bool type, need to check all caller functions to see if it can safely
* be updated to reflect this
*/
int bm_is_valid(int handle);
/**
* @brief Gets info on the bitmap indexed by handle.
*
* @param[out] w If non-null, gets the width
* @param[out] h If non-null, gets the heigth
* @param[out] flags If non-null, gets the flags
* @param[out] nframs If non-null, gets the nframes
* @param[out] fps If non-null, gets the fps
*
* @returns The handle on success, or
* @returns The handle to the first frame on success, or
* @returns -1 on failure
*/
int bm_get_info(int handle, int *w = NULL, int * h = NULL, ubyte * flags = NULL, int *nframes = NULL, int *fps = NULL);
/**
* @brief Gets the filename of the bitmap indexed by handle
*
* @param[out] filename The filename of the bitmap, if successful. Is set to an empty string if unseccessful
*
* @todo z64 - maybe deprecate this in favor of an SCP_string version
*/
void bm_get_filename(int bitmapnum, char *filename);
/**
* @brief Gets the filename of the bitmap indexed by handle, which must exist.
*
* @details If the bitmap does not exist (i.e. the handle is invalid), then an Assertion halts program execution.
*
* @returns A const char* to the filename of the bitmap
*
* @todo z64 - maybe deprecate this in favor of an SCP_string version.
* @todo z64 - maybe combine this with the other bm_get_filename function like so:
* void bm_get_filename(int handle, SCP_string *filename, bool must_exist = false);
*/
const char *bm_get_filename(int handle);
/**
* @brief Unloads all used bitmaps, should only ever be called by game_shutdown()
*
* @todo Maybe move this declaration into bmpman.cpp and then extern this function within game_shutdown() to
* ensure it only ever gets called there.
*/
void bm_unload_all();
/**
* @brief Gets the palette for a given bitmap indexed by handle, and optionally the filename
*
* @param[out] pal Is set to reference the bitmap's palette
* @param[out] name (optional) Is set to the bitmap's filename
*
* @todo Maybe get rid of the optional filename and have the callers call bm_get_filename. Less efficient, however.
*/
void bm_get_palette(int handle, ubyte *pal, char *name);
/**
* @brief (DEBUG) Gets memory size, in bytes, of the locked bitmaps
*
* @details Both params are non-optional, and must be non-null. There's currently no safety checks on either.
*
* @param ntotal[out] Memory size, in bytes, of the locked bitmaps
* @param nnew[out] Memory size, in bytes, of the bitmaps that were locked since the last frame
*
* @note This is a debug function, and is undefined within release builds
*/
void bm_get_frame_usage(int *ntotal, int *nnew);
/**
* @brief Reloads an existing bmpman slot with different bitmap
*
* @param[in] filename The filename of the image to load
*
* @returns The bitmap handle on success, or
* @returns A negative value on failure
*
* @note This should only be used if you are certain the new picture is the same type, has same dimensions, etc.
*/
int bm_reload(int bitmap_handle, const char* filename);
/**
* @brief Tells bmpman to start keeping track of what bitmaps are used where
*/
void bm_page_in_start();
/**
* @brief Tells bmpman to stop paging (?)
*/
void bm_page_in_stop();
// Paging code in a library should call these functions
// in its page in function.
/**
* @brief Marks a texture as being used for this level
*
* @param[in] num_frames If specified, assumes this is an animated texture
*/
void bm_page_in_texture(int bitmapnum, int num_frames = 0);
/**
* @brief Marks a textures as being used for level and is transparant
*
* @param[in] num_frames If specified, assumes this is an animated texture
*/
void bm_page_in_xparent_texture(int bitmapnum, int num_frames = 1);
/**
* @brief Marks a texture as being used for this level, and is anti-aliased
*
* @param[in] num_frames If specified, assumes this is an animated texture
*/
void bm_page_in_aabitmap(int bitmapnum, int num_frames = 1);
/**
* @brief Sets BMPMAN's memory mode
*
* @details 0 = High memory;
* 1 = Low memory (loads every other frame of ani's);
* 2 = Debug low memory (only use first frame of each ani)
*
* @todo This should use an enum, or instead allow an arbitrary number to drop frames (like 1/2, 1/3, etc.)
*/
void bm_set_low_mem(int mode);
/**
* @brief Sets bm_set_components and bm_get_components to reference screen format functions
*/
void BM_SELECT_SCREEN_FORMAT();
/**
* @brief Sets bm_set_components and bm_get_components to reference texture format functions
*/
void BM_SELECT_TEX_FORMAT();
/**
* @brief Sets bm_set_components and bm_get_components to reference texture format functions (with alpha)
*/
void BM_SELECT_ALPHA_TEX_FORMAT();
/**
* @brief Functional pointer that references any of the bm_set_components functions.
*
* @details The bm_set_components functions packs the RGBA values into the ubyte array referenced by pixel, whose
* format differs according to its bpp value and presence of an alpha channel. The RGBA values are scaled accordingly.
*
* @param[out] pixel The pixel to set
* @param[in] r Red value (may not be NULL)
* @param[in] g Green value (may not be NULL)
* @param[in] b Blue value (may not be NULL)
* @param[in] a Alpha value (currently ignored)
*
* @note z64 - These functions were made predating the introduction of C++ classes, and are basically the equivalent
* of Pixel::set(ubyte *r, ubyte *b, ubyte *g). The original comment mentions that any of the rgba params may be
* NULL, but this is by far _NOT_ the case, as a NULL value will cause undefined behavior (really really bad chroma
* corruption)
*
* @note These functions assume the incoming bitdepth will always be >= to the outgoing bitdepth of the pixel. Should
* the incoming bitdepth be lower, the outgoing values will appear darker than they should be
*/
extern void(*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 16bpp screen pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_16_screen(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 16bpp texture pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Sets the 32bpp texture pixel to the specified RGBA value
*
* @see bm_set_components
*/
void bm_set_components_argb_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
/**
* @brief Gets the RGBA components of a pixel according to the selected mode
*
* @see BM_SELECT_SCREEN_FORMAT() BM_SELECT_TEX_FORMAT() BM_SELECT_ALPHA_TEX_FORMAT()
*/
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
/**
* @brief Returns the compression type of the bitmap indexed by handle
*/
int bm_is_compressed(int handle);
/**
* @brief Gets the correct TCACHE_TYPE for compressed graphics (uncompressed are assumed TCACHE_TYPE_NORMAL)
*/
int bm_get_tcache_type(int handle);
/**
* @brief Gets the number of mipmaps of the indexed texture
*/
int bm_get_num_mipmaps(int handle);
/**
* @brief Checks to see if the indexed bitmap has an alpha channel
*
* @note Currently just checks if the bitmap is 32bpp and is not a .PCX
*/
bool bm_has_alpha_channel(int handle);
/**
* @brief (DEBUG) Prints all loaded bitmaps to an outwindow
*/
void bm_print_bitmaps();
/**
* @brief Creates a render target as close to the desired resolution as possible.
*
* @returns the handle of an avilable render target if successful, or
* @returns -1 if not successful
*
* @note BM_FLAG_RENDER_TARGET_STATIC are drawn once/infrequently, while BM_FLAG_RENDER_TARGET_DYNAMIC are drawn roughly once every frame
*/
int bm_make_render_target(int width, int height, int flags);
/**
* @brief Checks to see if the given bitmap indexed by handle is a render target
*
* @returns The render type (BM_TYPE) if it is a render target, or
* @returns 0 if it is not
*/
int bm_is_render_target(int handle);
/**
* @brief (GR function) Calls gr_bm_set_render target for the given bitmap indexed by handle
*
* @returns true if successful, or
* @returns false if unsuccessful
*/
bool bm_set_render_target(int handle, int face = -1);
/**
* @brief Loads and parses an .EFF
*
* @param[in] filename The filename of the .EFF
* @param[in] dir_type
* @param[out] nframes (optional) If given, is set to the number of frames this .EFF has
* @param[out] nfps (optional) If given, is set to the fps of this .EFF
* @param[out] key (optional) If given, is set to the keyframe index of this .EFF
* @param[out] type (optional) If given, is set to the BM_TYPE of the .EFF
*
* @returns true If successful
* @returns false If not successful
*/
bool bm_load_and_parse_eff(const char *filename, int dir_type, int *nframes, int *nfps, int *key, BM_TYPE *type);
/**
* @brief Calculates & returns the current frame of an animation
*
* @param[in] frame1_handle Handle of the animation
* @param[in] elapsed_time Time in seconds since the animation started playing
* @param[in] loop (optional) specifies if the animation should loop, default is false which causes animation to hold on the last frame
* @param[in] divisor (optional) if greater than zero, elapsed time will be divided by this value i.e. allows "percentage complete" to be used to determine the frame instead of the animations total time derived from fps * frames
*
* @returns current frame of the animation (range is zero to the number of frames minus one)
*/
int bm_get_anim_frame(const int frame1_handle, float elapsed_time, const float divisor = 0.0f, const bool loop = false);
/**
* @brief Determines if the given handle could be used in a texture array
*
* @param handle The handle to query the value for
* @return @c true if all frames have the same size, @c false otherwise. Always returns @c true for single images
*/
bool bm_is_texture_array(const int handle);
/**
* @brief Gets the base frame of the specified animation
*
* @details The base frame is the frame of the animation that should be used to determine if two animation frames can be
* used in the same draw call. Use this if you want to optimize your draw calls to make use of texture arrays.
*
* @param handle The handle of the animation to check. This may also be a single frame bitmap
* @param num_frames Optionally return the number of frames in the animation
* @return The bitmap handle of the base frame or -1 on error
*/
int bm_get_base_frame(const int handle, int* num_frames = nullptr);
/**
* @brief Get the array index of the specified bitmap
*
* This should be used when passing the array index to the GPU (e.g. when building uniform structs or streaming particle
* data)
*
* @param handle The handle of the bitmap
* @return The index into the array
*/
int bm_get_array_index(const int handle);
/**
* @brief Counts how many slots are used in bm_bitmaps
*
* This needs to iterate through all the slots in order to determine whether or not they're used, so shouldn't be used frivolously.
*
* @return The number of used slots
*/
int bmpman_count_bitmaps();
/**
* @brief Counts how many slots are available to the bmpman system
*
* Since the number of slots is dynamic now, this should be used for determining the total amount of available slots at
* the moment.
*
* @warning This is entirely for debugging and logging purposes. It should not be used in actual engine code.
*
* @return The number of available slots
*/
int bmpman_count_available_slots();
/**
* @brief Checks if the given filename is a valid effect or texture file name
*
* @note At least one of @c single_frame or @c animation must be true since the result would make no sense otherwise. It
* is also valid to set both parmeters to @c true.
*
* @todo This currently just tries to load the file but could be improved by not actually loading the file in the future.
*
* @param file The file name to check
* @param single_frame If set to @c true then single frames are valid files
* @param animation If set to @c true then animations are valid files
* @return @c true if the file name is valid, @c false otherwise
*/
bool bm_validate_filename(const SCP_string& file, bool single_frame, bool animation);
SDL_Surface* bm_to_sdl_surface(int handle);
#endif
File diff suppressed because it is too large. Load diff
-175
View File
@@ -1,175 +0,0 @@
#ifndef _CAMERA_H
#define _CAMERA_H
#include "globalincs/globals.h"
#include "globalincs/pstypes.h"
#include "graphics/2d.h"
#include "object/object.h"
#include "physics/physics.h" //for avd
#include <string>
#define CAM_STATIONARY_FOV (1<<0)
#define CAM_STATIONARY_ORI (1<<1)
#define CAM_STATIONARY_POS (1<<2)
#define CAM_DEFAULT_FLAGS 0
class camera
{
protected:
char name[NAME_LENGTH];
int sig;
int flags;
object_h object_host;
int object_host_submodel;
object_h object_target;
int object_target_submodel;
void (*func_custom_position)(camera *cam, vec3d *pos);
void (*func_custom_orientation)(camera *cam, matrix *ori);
avd_movement fov;
avd_movement pos_x;
avd_movement pos_y;
avd_movement pos_z;
avd_movement ori[9];
//Cache stuff
float c_fov;
vec3d c_pos;
matrix c_ori;
public:
camera(const char *in_name=NULL, int in_signature=-1);
~camera();
void clear();
void reset();
//Set
void set_name(const char *in_name);
void set_object_host(object *objp, int n_object_host_submodel = -1);
void set_object_target(object *objp, int n_object_target_submodel = -1);
void set_custom_position_function(void (*n_func_custom_position)(camera *cam, vec3d *pos));
void set_custom_orientation_function(void (*n_func_custom_orientation)(camera *cam, matrix *ori));
void set_fov(float in_fov, float in_fov_time = 0.0f, float in_fov_acceleration_time = 0.0f, float in_deceleration_time = 0.0f);
void set_position(vec3d *in_position = NULL, float in_translation_time = 0.0f, float in_translation_acceleration_time = 0.0f, float in_translation_deceleration_time = 0.0f, float in_end_velocity = 0.0f);
void set_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);
//Get
const char* get_name() { return name; }
int get_signature() {return sig;}
object *get_object_host();
int get_object_host_submodel();
object *get_object_target();
int get_object_target_submodel();
float get_fov();
void get_info(vec3d *position, matrix *orientation);
//Is
bool is_empty(){return sig < 0;}
//Do
void do_frame(float in_frametime);
};
class warp_camera
{
private:
float c_time;
float c_damping;
vec3d c_vel;
vec3d c_desired_vel;
vec3d c_pos;
matrix c_ori;
public:
warp_camera();
warp_camera(object *objp);
void reset();
void set_position(vec3d *in_pos);
void set_rotation(matrix *in_ori);
void set_velocity(vec3d *in_vel, bool instantaneous);
void do_frame(float in_frametime);
void get_info(vec3d *position, matrix *orientation);
};
extern warp_camera Warp_camera;
class subtitle
{
private:
void clone(const subtitle &sub);
SCP_vector<SCP_string> text_lines;
struct { int x; int y; } text_pos;
float display_time;
float fade_time;
color text_color;
int text_fontnum;
//Done with set
char imageanim[MAX_FILENAME_LEN];
int image_id;
struct { int x; int y; int w; int h; } image_pos;
//Time this has been displayed
float time_displayed;
//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();
subtitle(const subtitle &sub) { clone(sub); }
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 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);
void cam_delete(camid cid);
bool cam_set_camera(camid cid);
void cam_reset_camera();
camid cam_lookup(const 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);
void subtitles_close();
void subtitles_do_frame(float frametime);
void subtitles_do_frame_post_shaded(float frametime);
#endif // _CAMERA_H
-1799
View File
File diff suppressed because it is too large. Load diff
-488
View File
@@ -1,488 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef __CFILE_H__
#define __CFILE_H__
#include "globalincs/pstypes.h"
#include <ctime>
#include <stdexcept>
#include <memory>
#define CF_EOF (-1)
#define CF_SEEK_SET (0)
#define CF_SEEK_CUR (1)
#define CF_SEEK_END (2)
// Opaque file handle
struct CFILE;
// extra info that can be returned when getting a file listing
typedef struct {
time_t write_time;
} file_list_info;
#define CF_MAX_FILENAME_LENGTH 32 // Includes null terminater, so real length is 31
#define CF_MAX_PATHNAME_LENGTH 256 // Includes null terminater, so real length is 255
#define CF_TYPE_ANY -1 // Used to check in any directory
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MODELS 5
#define CF_TYPE_TABLES 6
#define CF_TYPE_SOUNDS 7
#define CF_TYPE_SOUNDS_8B22K 8
#define CF_TYPE_SOUNDS_16B11K 9
#define CF_TYPE_VOICE 10
#define CF_TYPE_VOICE_BRIEFINGS 11
#define CF_TYPE_VOICE_CMD_BRIEF 12
#define CF_TYPE_VOICE_DEBRIEFINGS 13
#define CF_TYPE_VOICE_PERSONAS 14
#define CF_TYPE_VOICE_SPECIAL 15
#define CF_TYPE_VOICE_TRAINING 16
#define CF_TYPE_MUSIC 17
#define CF_TYPE_MOVIES 18
#define CF_TYPE_INTERFACE 19
#define CF_TYPE_FONT 20
#define CF_TYPE_EFFECTS 21
#define CF_TYPE_HUD 22
#define CF_TYPE_PLAYERS 23
#define CF_TYPE_PLAYER_IMAGES 24
#define CF_TYPE_SQUAD_IMAGES 25
#define CF_TYPE_SINGLE_PLAYERS 26
#define CF_TYPE_MULTI_PLAYERS 27
#define CF_TYPE_CACHE 28
#define CF_TYPE_MULTI_CACHE 29
#define CF_TYPE_MISSIONS 30
#define CF_TYPE_CONFIG 31
#define CF_TYPE_DEMOS 32
#define CF_TYPE_CBANIMS 33
#define CF_TYPE_INTEL_ANIMS 34
#define CF_TYPE_SCRIPTS 35
#define CF_TYPE_FICTION 36
#define CF_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
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
// #define's for the type parameter in cfopen.
#define CFILE_NORMAL 0 // open file normally
#define CFILE_MEMORY_MAPPED (1<<0) // open file as a memory-mapped file
#define CF_SORT_NONE 0
#define CF_SORT_NAME 1
#define CF_SORT_TIME 2
#define CF_SORT_REVERSE 3
/**
* @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
};
// 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;
// cfile directory. valid after cfile_init() returns successfully
#define CFILE_ROOT_DIRECTORY_LEN 256
namespace cfile {
enum class ModRootType { Unknown, Folder, Package };
enum class LocationType { Unknown, SecondaryMod, PrimaryMod, GameRoot };
struct ModRoot {
ModRootType type = ModRootType::Unknown;
SCP_string path;
LocationType location_type = LocationType::Unknown;
bool user_location = false;
};
} // namespace cfile
//================= LOW-LEVEL FUNCTIONS ==================
int cfile_init(const SCP_vector<cfile::ModRoot>& modRoots);
void cfile_close();
// add an extension to a filename if it doesn't already have it
char *cf_add_ext(const char *filename, const 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
// 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
// Flush the open file buffer
int cflush(CFILE *cfile);
// 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);
// Same as _access function to read a file's access bits
int cf_access(const 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);
// 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);
// 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);
// ctmpfile() opens a temporary file stream. File is deleted automatically when closed
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);
// Reads data
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);
// Moves the file pointer
int cfseek(CFILE *fp, int offset, int where);
// Returns current position of file.
int cftell(CFILE *fp);
// cfputc() writes a character to a file
int cfputc(int c, CFILE *cfile);
// cfputs() writes a string to a file
int cfputs(const char *str, CFILE *cfile);
// cfgetc() reads a character to a file
int cfgetc(CFILE *cfile);
// cfgets() reads a string from a file
char *cfgets(char *buf, int n, CFILE *cfile);
// cfeof() Tests for end-of-file on a stream
int cfeof(CFILE *cfile);
// Return the data pointer associated with the CFILE structure (for memory mapped files)
const 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 );
// 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 );
// 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);
// convenient for misc checksumming purposes ------------------------------------------
// update cur_chksum with the chksum of the new_data of size new_data_size
ushort cf_add_chksum_short(ushort seed, 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);
// convenient for misc checksumming purposes ------------------------------------------
//================= HIGH LEVEL FUNCTIONS ==================
// 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 );
// changes the attributes of a file
void cf_attrib(const char *name, int set, int clear, int type);
// flush (delete all files in) the passed directory (by type), return the # of files deleted
// NOTE : WILL NOT DELETE READ-ONLY FILES
int cfile_flush_dir(int type);
// functions for reading from cfile
// These are all high level, built up from
// cfread.
char *cfgets(char *buf, size_t n, CFILE *fp);
char cfread_char(CFILE* file, char deflt = 0);
ubyte cfread_ubyte(CFILE* file, ubyte deflt = 0);
short cfread_short(CFILE* file, short deflt = 0);
ushort cfread_ushort(CFILE* file, ushort deflt = 0);
int cfread_int(CFILE* file, int deflt = 0);
uint cfread_uint(CFILE* file, uint deflt = 0);
float cfread_float(CFILE* file, float deflt = 0.0f);
void cfread_vector(vec3d* vec, CFILE* file, vec3d* deflt = nullptr);
// 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)
*/
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);
int cfwrite_int(int i, CFILE *file);
int cfwrite_uint(uint i, CFILE *file);
int cfwrite_short(short s, CFILE *file);
int cfwrite_ushort(ushort s, CFILE *file);
int cfwrite_ubyte(ubyte u, CFILE *file);
// writes variable length, null-termined string.
int cfwrite_string(const char *buf, CFILE *file);
/**
* @brief Write a fixed length string (not including its null terminator), with the length stored in file
*
* @param buf String to write to file
* @param file File to write to
*/
int cfwrite_string_len(const char *buf, CFILE *file);
int cf_get_file_list(SCP_vector<SCP_string>& list, int pathtype, 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);
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.
// Input: filespace - Filename & extension
// pathtype - See CF_TYPE_ defines in CFILE.H
// max_out - Maximum string size to be stuffed into pack_filename
// Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns 0.
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)
{
}
};
// Searches for a file. Follows all rules and precedence and searches
// CD's and pack files. Searches all locations in order for first filename using ext filter list.
// Input: filename - Filename & extension
// ext_num - number of extensions to look for
// ext_list - extension filter list
// pathtype - See CF_TYPE_ defines in CFILE.H
// max_out - Maximum string length that should be stuffed into pack_filename
// Output: pack_filename - Absolute path and filename of this file. Could be a packfile or the actual file.
// size - File size
// offset - Offset into pack file. 0 if not a packfile.
// Returns: If not found returns -1, else returns offset into ext_list.
// (NOTE: This function is exponentially slow, so don't use it unless truely needed!!)
CFileLocationExt cf_find_file_location_ext(const char* filename, const int ext_num, const char** ext_list, int pathtype,
bool localize = false);
// Functions to change directories
int cfile_chdir(const char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
#endif
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type);
// restore directory on top of the stack
int cfile_pop_dir();
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")
{
}
};
}
// This allows to use std::unique_ptr with CFILE
namespace std {
template <>
struct default_delete<CFILE> {
void operator()(CFILE* ptr)
{
if (cf_is_valid(ptr)) {
cfclose(ptr);
}
}
};
} // namespace std
#endif /* __CFILE_H__ */
-269
View File
@@ -1,269 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#define _CFILE_INTERNAL
#include <cstdlib>
#include <cstring>
#include <cstdio>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "cfile/cfile.h"
#include "cfile/cfilearchive.h"
#include "luaconf.h"
#include <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 )
{
Assert(cfile != nullptr);
cfile->lib_offset = lib_offset;
cfile->raw_position = pos;
cfile->size = size;
if ( cfile->fp ) {
if ( cfile->lib_offset ) {
fseek( cfile->fp, (long)cfile->lib_offset, SEEK_SET );
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
auto raw_position = ftell(cfile->fp) - cfile->lib_offset;
Assert(raw_position == cfile->raw_position);
#endif
}
}
// cfeof() Tests for end-of-file on a stream
//
// returns a nonzero value after the first read operation that attempts to read
// past the end of the file. It returns 0 if the current position is not end of file.
// There is no error return.
int cfeof(CFILE *cfile)
{
Assert(cfile != NULL);
int result = 0;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cfile->fp) {
auto raw_position = ftell(cfile->fp) - cfile->lib_offset;
Assert(raw_position == cfile->raw_position);
}
#endif
if (cfile->raw_position >= cfile->size ) {
result = 1;
} else {
result = 0;
}
return result;
}
// cftell() returns offset into file
//
// returns: success ==> offset into the file
// error ==> -1
//
int cftell( CFILE * cfile )
{
Assert(cfile != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cfile->fp) {
auto raw_position = ftell(cfile->fp) - cfile->lib_offset;
Assert(raw_position == cfile->raw_position);
}
#endif
// The rest of the code still uses ints, do an overflow check to detect cases where this fails
Assertion(cfile->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) cfile->raw_position;
}
// cfseek() moves the file pointer
//
// returns: success ==> 0
// error ==> non-zero
//
int cfseek( CFILE *cfile, int offset, int where )
{
Assert(cfile != NULL);
// TODO: seek to offset in memory mapped file
Assert( !cfile->mem_mapped );
size_t goal_position;
switch( where ) {
case CF_SEEK_SET:
goal_position = offset+cfile->lib_offset;
break;
case CF_SEEK_CUR:
{
goal_position = cfile->raw_position+offset+cfile->lib_offset;
}
break;
case CF_SEEK_END:
goal_position = cfile->size+offset+cfile->lib_offset;
break;
default:
Int3();
return 1;
}
// Make sure we don't seek beyond the end of the file
CAP(goal_position, cfile->lib_offset, cfile->lib_offset + cfile->size);
int result = 0;
if (cfile->fp) {
// If we have a file pointer we can also seek in that file
result = fseek(cfile->fp, (long)goal_position, SEEK_SET );
Assertion(goal_position >= cfile->lib_offset, "Invalid offset values detected while seeking! Goal was " SIZE_T_ARG ", lib_offset is " SIZE_T_ARG ".", goal_position, cfile->lib_offset);
}
// If we only have a data pointer this will do all the work
cfile->raw_position = goal_position - cfile->lib_offset;
Assertion(cfile->raw_position <= cfile->size, "Invalid raw_position value detected!");
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cfile->fp) {
auto tmp_offset = ftell(cfile->fp) - cfile->lib_offset;
Assert(tmp_offset == cfile->raw_position);
}
#endif
return result;
}
// cfread() reads from a file
//
// returns: returns the number of full elements read
//
//
int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return 0;
size_t size = elsize*nelem;
if(buf == NULL || size <= 0)
return 0;
if ( (cfile->raw_position+size) > cfile->size ) {
Assertion(cfile->raw_position <= cfile->size, "Invalid raw_position value detected!");
size = cfile->size - cfile->raw_position;
if ( size < 1 ) {
return 0;
}
//mprintf(( "CFILE: EOF encountered in file\n" ));
}
if (cfile->max_read_len) {
if ( cfile->raw_position+size > cfile->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 (cfile->data != nullptr) {
// This is a file from memory
bytes_read = size;
memcpy(buf, reinterpret_cast<const char*>(cfile->data) + cfile->raw_position, size);
} else {
bytes_read = fread( buf, 1, size, cfile->fp );
}
if ( bytes_read > 0 ) {
cfile->raw_position += bytes_read;
Assertion(cfile->raw_position <= cfile->size, "Invalid raw_position value detected!");
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cfile->fp) {
auto tmp_offset = ftell(cfile->fp) - cfile->lib_offset;
Assert(tmp_offset==cfile->raw_position);
}
#endif
return (int)(bytes_read / elsize);
}
int cfread_lua_number(double *buf, CFILE *cfile)
{
if(!cf_is_valid(cfile))
return 0;
if(buf == NULL)
return 0;
// cfread() not supported for memory-mapped files
if(cfile->data != nullptr)
{
Warning(LOCATION, "Writing is not supported for mem-mapped files");
return 0;
}
size_t advance = 0;
int items_read;
if (cfile->fp) {
long orig_pos = ftell(cfile->fp);
items_read = fscanf(cfile->fp, LUA_NUMBER_SCAN, buf);
advance = (size_t) (ftell(cfile->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*>(cfile->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;
}
cfile->raw_position += advance;
Assertion(cfile->raw_position <= cfile->size, "Invalid raw_position value detected!");
#if defined(CHECK_POSITION) && !defined(NDEBUG)
if (cfile->fp) {
auto tmp_offset = ftell(cfile->fp) - cfile->lib_offset;
Assert(tmp_offset==cfile->raw_position);
}
#endif
return items_read;
}
-53
View File
@@ -1,53 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _CFILEARCHIVE_H
#define _CFILEARCHIVE_H
#ifndef _CFILE_INTERNAL
#error This file should only be included internally in CFILE!!
#endif
// The following Cfile_block data is private to cfile.cpp
// DO NOT MOVE the Cfile_block* information to cfile.h / do not extern this data
//
#define CFILE_BLOCK_UNUSED 0
#define CFILE_BLOCK_USED 1
struct CFILE {
int type = CFILE_BLOCK_UNUSED; // 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)
#ifdef _WIN32
HANDLE hInFile; // Handle from CreateFile()
HANDLE hMapFile; // Handle from CreateFileMapping()
#else
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
const char* source_file;
int line_num;
};
#define MAX_CFILE_BLOCKS 64
extern std::array<CFILE, MAX_CFILE_BLOCKS> Cfile_block_list;
// 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 );
#endif
-203
View File
@@ -1,203 +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.
*
*/
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <string>
#include <algorithm>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "cfile/cfile.h"
#include "globalincs/pstypes.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
// list = list of filenames to be sorted
// sort = sorting method to use (one of the CF_SORT_* defines)
// info = extra info for each file. Only required if sorting by time, however if you
// have extra file info, you should pass it as well to get it sorted too (so an
// index into list is the same index for info for that file
void cf_sort_filenames( int n, char **list, int sort, file_list_info *info )
{
int i, j, incr;
char *t;
file_list_info tt;
if (sort == CF_SORT_NAME) {
incr = n / 2;
while (incr > 0) {
for (i=incr; i<n; i++) {
j = i - incr;
while (j >= 0) {
if (stricmp(list[j], list[j + incr]) > 0) {
t = list[j];
list[j] = list[j + incr];
list[j + incr] = t;
if (info) {
tt = info[j];
info[j] = info[j + incr];
info[j + incr] = tt;
}
j -= incr;
} else
break;
}
}
incr /= 2;
}
return;
} else if (sort == CF_SORT_TIME) {
Assert(info);
incr = n / 2;
while (incr > 0) {
for (i=incr; i<n; i++) {
j = i - incr;
while (j >= 0) {
if (info[j].write_time < info[j + incr].write_time) {
t = list[j];
list[j] = list[j + incr];
list[j + incr] = t;
tt = info[j];
info[j] = info[j + incr];
info[j + incr] = tt;
j -= incr;
} else
break;
}
}
incr /= 2;
}
return;
} else if (sort == CF_SORT_REVERSE) {
incr = n / 2;
char buffer[MAX_FILENAME_LEN];
file_list_info tt_tmp;
for (i = 0; i < incr; i++) {
t = list[n - 1 - i];
if (list[i] != t) {
strcpy_s(buffer, list[i]);
strcpy(list[i], t);
strcpy(t, buffer);
if (info) {
tt = info[n - 1 - i];
tt_tmp = info[i];
info[i] = tt;
tt = tt_tmp;
}
}
}
return;
}
nprintf(("Error", "Unknown sorting method %d passed to cf_sort_filenames()\n", sort));
}
-266
View File
@@ -1,266 +0,0 @@
#define _CFILE_INTERNAL
#include "cfilemod.h"
#include "cfile.h"
#include "cmdline/cmdline.h"
#include "osapi/osapi.h"
#include "cfilesystem.h"
#ifdef SCP_UNIX
#include <glob.h>
#include <sys/types.h>
#include <dirent.h>
#include <fnmatch.h>
#include <sys/stat.h>
#include <unistd.h>
#include <libgen.h>
#endif
namespace cfile {
namespace {
typedef struct cf_root_sort {
SCP_string path;
int cf_type;
} cf_root_sort;
// packfile sort function
bool cf_packfile_sort_func(const cf_root_sort& r1, const cf_root_sort& r2) {
// if the 2 directory types are the same, do a string compare
if (r1.cf_type == r2.cf_type) {
return (stricmp(r1.path.c_str(), r2.path.c_str()) < 0);
}
// otherwise return them in order of CF_TYPE_* precedence
return (r1.cf_type < r2.cf_type);
}
// Go through a root and look for pack files
void build_pack_list(SCP_vector<ModRoot>& mod_roots,
const SCP_string& search_path,
LocationType location_type,
bool user_location) {
char filespec[MAX_PATH_LEN];
// allocate a temporary array of temporary roots so we can easily sort them
SCP_vector<cf_root_sort> temp_roots_sort;
// now just setup all the root info
for (int i = CF_TYPE_ROOT; i < CF_MAX_PATH_TYPES; i++) {
strcpy_s(filespec, search_path.c_str());
if (strlen(Pathtypes[i].path)) {
strcat_s(filespec, Pathtypes[i].path);
if (filespec[strlen(filespec) - 1] != DIR_SEPARATOR_CHAR)
strcat_s(filespec, DIR_SEPARATOR_STR);
}
#if defined _WIN32
strcat_s( filespec, "*.vp" );
intptr_t find_handle;
_finddata_t find;
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
do {
// add the new item
if (!(find.attrib & _A_SUBDIR)) {
// get a temp pointer
rptr_sort = &temp_roots_sort[root_index++];
// fill in all the proper info
strcpy_s(rptr_sort->path, root->path);
if(strlen(Pathtypes[i].path)) {
strcat_s(rptr_sort->path, Pathtypes[i].path );
strcat_s(rptr_sort->path, DIR_SEPARATOR_STR);
}
strcat_s(rptr_sort->path, find.name );
rptr_sort->roottype = CF_ROOTTYPE_PACK;
rptr_sort->cf_type = i;
}
} while (!_findnext(find_handle, &find));
_findclose( find_handle );
}
#elif defined SCP_UNIX
strcat_s(filespec, "*.[vV][pP]");
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (uint j = 0; j < globinfo.gl_pathc; j++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[j], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
cf_root_sort sort;
// fill in all the proper info
sort.path = globinfo.gl_pathv[j];
sort.cf_type = i;
temp_roots_sort.push_back(sort);
}
}
globfree(&globinfo);
}
#endif
}
// sort the roots
std::sort(temp_roots_sort.begin(), temp_roots_sort.end(), cf_packfile_sort_func);
// now insert them all into the real root list properly
for (const auto& pack_root : temp_roots_sort) {
ModRoot root;
root.type = ModRootType::Package;
root.path = pack_root.path;
root.user_location = user_location;
root.location_type = location_type;
mod_roots.push_back(root);
}
}
char normalize_directory_separator(char in) {
if (in == '/') {
return DIR_SEPARATOR_CHAR;
}
return in;
}
void
add_mod_roots(SCP_vector<ModRoot>& mod_roots, const char* mod_cmdline, const SCP_string& rootDirectory, bool user_location) {
if (mod_cmdline) {
bool primary = true;
for (const char* cur_pos = mod_cmdline; strlen(cur_pos) != 0; cur_pos += (strlen(cur_pos) + 1)) {
SCP_stringstream ss;
ss << rootDirectory;
if (rootDirectory.back() != DIR_SEPARATOR_CHAR) {
ss << DIR_SEPARATOR_CHAR;
}
ss << cur_pos << DIR_SEPARATOR_STR;
SCP_string rootPath = ss.str();
// normalize the path to the native path format
std::transform(rootPath.begin(), rootPath.end(), rootPath.begin(), normalize_directory_separator);
ModRoot root;
root.type = ModRootType::Folder;
root.path = rootPath;
root.user_location = user_location;
if (primary) {
root.location_type = LocationType::PrimaryMod;
} else {
root.location_type = LocationType::SecondaryMod;
}
mod_roots.push_back(root);
build_pack_list(mod_roots, rootPath, root.location_type, user_location);
primary = false;
}
}
}
}
SCP_vector<ModRoot> getModRootsFromModCmdline(const SCP_string& content_root, const char* mod_cmdline) {
SCP_vector<ModRoot> mod_roots;
if (os_is_legacy_mode()) {
// =========================================================================
#ifdef WIN32
// Nothing to do here, Windows uses the current directory as the base
#else
add_mod_roots(mod_roots, mod_cmdline, os_get_legacy_user_dir(), true);
ModRoot root;
root.type = ModRootType::Folder;
root.path = os_get_legacy_user_dir();
root.user_location = true;
root.location_type = LocationType::GameRoot;
// do we already have a slash? as in the case of a root directory install
if (root.path.back() != DIR_SEPARATOR_CHAR) {
root.path += DIR_SEPARATOR_STR; // put trailing backslash on for easier path construction
}
mod_roots.push_back(root);
// Next, check any VP files under the current directory.
build_pack_list(mod_roots, root.path, root.location_type, root.user_location);
#endif
// =========================================================================
} else if (!Cmdline_portable_mode) {
// =========================================================================
// now look for mods under the users HOME directory to use before system ones
add_mod_roots(mod_roots, mod_cmdline, os_get_config_path(), true);
// =========================================================================
// =========================================================================
// set users HOME directory as default for loading and saving files
ModRoot root;
root.type = ModRootType::Folder;
root.path = os_get_config_path();
root.user_location = true;
root.location_type = LocationType::GameRoot;
// do we already have a slash? as in the case of a root directory install
if (root.path.back() != DIR_SEPARATOR_CHAR) {
root.path += DIR_SEPARATOR_STR; // put trailing backslash on for easier path construction
}
mod_roots.push_back(root);
// Next, check any VP files under the current directory.
build_pack_list(mod_roots, root.path, root.location_type, root.user_location);
// =========================================================================
}
add_mod_roots(mod_roots, mod_cmdline, content_root, false);
ModRoot root;
root.type = ModRootType::Folder;
root.path = content_root;
root.user_location = false;
root.location_type = LocationType::GameRoot;
// do we already have a slash? as in the case of a root directory install
if (root.path.back() != DIR_SEPARATOR_CHAR) {
root.path += DIR_SEPARATOR_STR; // put trailing backslash on for easier path construction
}
mod_roots.push_back(root);
//======================================================
// Next, check any VP files under the current directory.
build_pack_list(mod_roots, root.path, root.location_type, root.user_location);
return mod_roots;
}
}
-10
View File
@@ -1,10 +0,0 @@
#pragma once
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
namespace cfile {
SCP_vector<ModRoot> getModRootsFromModCmdline(const SCP_string& content_root, const char* mod_cmdline);
}
File diff suppressed because it is too large. Load diff
-49
View File
@@ -1,49 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef _CFILESYSTEM_H
#define _CFILESYSTEM_H
#include "cfile/cfile.h"
// Builds a list of all the files
void cf_build_secondary_filelist(const SCP_vector<cfile::ModRoot>& modRoots);
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.
} 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.
// If filename isn't null it will also tack the filename
// on the end, creating a completely valid filename.
// Input: pathtype - CF_TYPE_??
// path_max - Maximum characters in the path
// filename - optional, if set, tacks the filename onto end of path.
// Output: path - Fully qualified pathname.
//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);
#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)
-411
View File
@@ -1,411 +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.
*
*/
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef _WIN32
#include <direct.h>
#include <io.h>
#include <conio.h>
#else
#include <dirent.h>
#include <unistd.h>
#include <sys/stat.h>
#include <sys/types.h>
#endif
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
static int data_error;
static int no_dir;
// right out of pstypes.h but we don't want to use the INTEL_INT macro here
// since it would require SDL which isn't used on WIN32 platforms
#if BYTE_ORDER == BIG_ENDIAN
#define INT_SWAP(x) ( \
(x << 24) | \
(((ulong)x) >> 24) | \
((x & 0x0000ff00) << 8) | \
((x & 0x00ff0000) >> 8) \
)
#else
#define INT_SWAP(x) (x)
#endif
size_t fswrite_int(int *wint, FILE *stream)
{
int tmp = *wint;
tmp = INT_SWAP(tmp);
return fwrite(&tmp, 1, sizeof(int), stream);
}
unsigned int Total_size=16; // Start with size of header
unsigned int Num_files =0;
FILE *fp_out = NULL;
FILE *fp_out_hdr = NULL;
typedef struct vp_header {
char id[4];
int version;
int index_offset;
int num_files;
} vp_header;
//vp_header Vp_header;
char archive_dat[1024];
char archive_hdr[1024];
#define BLOCK_SIZE (1024*1024)
#define VERSION_NUMBER 2;
char tmp_data[BLOCK_SIZE]; // 1 MB
void write_header()
{
int ver = VERSION_NUMBER;
fseek(fp_out, 0, SEEK_SET);
fwrite("VPVP", 1, 4, fp_out);
fswrite_int(&ver, fp_out);
fswrite_int((int*)&Total_size, fp_out);
fswrite_int((int*)&Num_files, fp_out);
}
int write_index(char *hf, char *df)
{
FILE *h = NULL, *d = NULL;
unsigned int i;
h = fopen(hf, "rb");
d = fopen(df, "a+b");
if ( (h == NULL) || (d == NULL) )
{
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);
fwrite(tmp_data, 32+4+4+4, 1, d);
}
fclose(h);
fclose(d);
unlink(hf);
return 1;
}
void pack_file( char *filespec, char *filename, int filesize, _fs_time_t time_write )
{
char path[1024];
if ( strstr( filename, ".vp" )) {
// Don't pack yourself!!
return;
}
if ( strstr( filename, ".hdr" )) {
// Don't pack yourself!!
return;
}
if ( filesize == 0 ) {
// Don't pack 0 length files, screws up directory structure!
return;
}
if ( strlen(filename) > 31 ) {
printf( "Filename '%s' too long! Skipping...\n", filename );
return;
}
memset( path, 0, sizeof(path) );
strcpy_s( path, filename );
fswrite_int( (int*)&Total_size, fp_out_hdr );
fswrite_int( &filesize, fp_out_hdr );
fwrite( &path, 1, 32, fp_out_hdr );
fswrite_int( (int*)&time_write, fp_out_hdr );
Total_size += filesize;
Num_files++;
printf( "Packing %s%s%s...", filespec, DIR_SEPARATOR_STR, filename );
sprintf( path, "%s%s%s", filespec, DIR_SEPARATOR_STR, filename );
FILE *fp = fopen( path, "rb" );
if ( fp == NULL ) {
printf( "Error opening '%s'\n", path );
exit(1);
}
int nbytes, nbytes_read=0;
do {
nbytes = fread( tmp_data, 1, BLOCK_SIZE, fp );
if ( nbytes > 0 ) {
fwrite( tmp_data, 1, nbytes, fp_out );
nbytes_read += nbytes;
}
} while( nbytes > 0 );
fclose(fp);
printf( " %d bytes\n", nbytes_read );
}
// This function adds a directory marker to the header file
void add_directory( char * dirname)
{
char path[256];
char *pathptr = path;
char *tmpptr;
int i = 0;
strcpy_s(path, dirname);
fswrite_int( (int*)&Total_size, fp_out_hdr);
fswrite_int( &i, fp_out_hdr);
// strip out any directories that this dir is a subdir of
while ( (tmpptr = strchr(pathptr, DIR_SEPARATOR_CHAR)) != NULL ) {
pathptr = tmpptr+1;
}
fwrite(pathptr, 1, 32, fp_out_hdr);
fswrite_int( &i, fp_out_hdr); // timestamp = 0
Num_files++;
}
void pack_directory( char * filespec)
{
#ifdef _WIN32
int find_handle;
_finddata_t find;
#endif
char tmp[512];
char tmp1[512];
char *ts;
// strip trailing slash
ts = filespec + (strlen(filespec) - 1);
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
strcpy_s( tmp1, filespec );
add_directory(filespec);
strcat( tmp1, DIR_SEPARATOR_STR"*.*" );
printf( "In dir '%s'\n", tmp1 );
#ifdef _WIN32
find_handle = _findfirst( tmp1, &find );
if( find_handle != -1 ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy_s( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
while( !_findnext( find_handle, &find ) ) {
if ( find.attrib & _A_SUBDIR ) {
if (strcmp( "..", find.name) && strcmp( ".", find.name) && strcmp( ".svn", find.name)) {
strcpy_s( tmp, filespec );
strcat( tmp, "\\" );
strcat( tmp, find.name );
pack_directory(tmp);
}
} else {
pack_file( filespec, find.name, find.size, find.time_write );
}
}
}
#else
DIR *dirp;
struct dirent *dir;
dirp = opendir (filespec);
if ( dirp ) {
while ((dir = readdir(dirp)) != NULL) {
char fn[MAX_PATH];
snprintf(fn, MAX_PATH-1, "%s/%s", filespec, dir->d_name);
fn[MAX_PATH-1] = 0;
struct stat buf;
if (stat(fn, &buf) == -1) {
continue;
}
if ( (strcmp(dir->d_name, ".") == 0) || (strcmp(dir->d_name, "..") == 0) ) {
continue;
}
if ( (strcmp(dir->d_name, ".svn") == 0) ) {
continue;
}
if (S_ISDIR(buf.st_mode)) {
strcpy_s( tmp, filespec );
strcat( tmp, "/" );
strcat( tmp, dir->d_name );
pack_directory(tmp);
} else {
pack_file( filespec, dir->d_name, buf.st_size, buf.st_mtime );
}
}
closedir(dirp);
} else {
printf("Error: Source directory does not exist!\n");
no_dir = 1;
}
#endif
add_directory("..");
}
int verify_directory( char *filespec )
{
char *ts;
char *dd;
// strip trailing '/'
ts = filespec+(strlen(filespec)-1);
while ( (*ts == DIR_SEPARATOR_CHAR) && (ts > filespec) )
*ts = '\0';
// make sure last directory is named "data", ignoring case
dd = filespec + (strlen(filespec) - 4);
if ( stricmp( dd, "data" ) )
data_error = 1;
return data_error;
}
void print_instructions()
{
printf("Creates a vp archive out of a FreeSpace data tree.\n\n");
printf("Usage: cfilearchiver archive_name src_dir\n");
#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");
exit(0);
}
// we end up #include'ing SDL.h which on Windows and Mac will redefine main() which is something
// that we don't want since we don't actually link against SDL, this solves the problem...
#ifdef main
#undef main
#endif
int main(int argc, char *argv[] )
{
char archive[1024];
char *p;
if ( argc < 3 ) {
print_instructions();
}
strcpy_s( archive, argv[1] );
p = strchr( archive, '.' );
if (p) *p = 0; // remove extension
strcpy_s( archive_dat, archive );
strcat( archive_dat, ".vp" );
strcpy_s( archive_hdr, archive );
strcat( archive_hdr, ".hdr" );
fp_out = fopen( archive_dat, "wb" );
if ( !fp_out ) {
printf( "Couldn't open '%s'!\n", archive_dat );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(1);
#endif
}
fp_out_hdr = fopen( archive_hdr, "wb" );
if ( !fp_out_hdr ) {
printf( "Couldn't open '%s'!\n", archive_hdr );
#ifdef _WIN32
printf( "Press any key to exit...\n" );
getch();
return 1;
#else
exit(2);
#endif
}
if ( verify_directory( argv[2] ) != 0 ) {
printf("Warning! Last directory must be named \"data\" (not case sensitive)\n");
exit(3);
}
write_header();
pack_directory( argv[2] );
// in case the directory doesn't exist
if ( no_dir )
exit(4);
write_header();
fclose(fp_out);
fclose(fp_out_hdr);
printf( "Data files written, appending index...\n" );
if (!write_index(archive_hdr, archive_dat)) {
printf("Error appending index!\n");
#ifdef _WIN32
printf("Press any key to exit...\n");
getch();
#endif
return 1;
}
printf( "%d total KB.\n", Total_size/1024 );
return 0;
}
-19
View File
@@ -1,19 +0,0 @@
add_executable(cfileextractor EXCLUDE_FROM_ALL cfileextractor.cpp)
ADD_DEFINITIONS(-DNO_SAFE_STRINGS)
include_directories(${CODE_HEADERS})
set_target_properties(cfileextractor
PROPERTIES
FOLDER "FSOTools"
)
TARGET_LINK_LIBRARIES(cfileextractor PUBLIC sdl2)
TARGET_INCLUDE_DIRECTORIES(cfileextractor PUBLIC ${GENERATED_SOURCE_DIR})
TARGET_INCLUDE_DIRECTORIES(cfileextractor PUBLIC ${GENERATED_SOURCE_DIR}/code)
IF(MSVC)
set_target_properties(cfileextractor PROPERTIES
COMPILE_DEFINITIONS_DEBUG "_DEBUG;PDB_DEBUGGING=1"
)
ENDIF(MSVC)
File diff suppressed because it is too large. Load diff
-159
View File
@@ -1,159 +0,0 @@
/*
* Copyright (C) Volition, Inc. 1999. All rights reserved.
*
* All source code herein is the property of Volition, Inc. You may not sell
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
#ifndef FS_CMDLINE_HEADER_FILE
#define FS_CMDLINE_HEADER_FILE
#include "globalincs/pstypes.h"
int parse_cmdline(int argc, char *argv[]);
// COMMAND LINE SETTINGS
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
// could check to see if (int Cmdline_multi_stream_chat_to_file) has been set by the command line parser.
//
// Add any extern definitions here and put the actual variables inside of cmdline.cpp for ease of use
// Also, check to make sure anything you add doesn't break Fred or TestCode
// RETAIL OPTIONS ----------------------------------------------
extern SCP_string Cmdline_connect_addr;
extern SCP_string Cmdline_game_name;
extern SCP_string Cmdline_game_password;
extern SCP_string Cmdline_rank_above;
extern SCP_string Cmdline_rank_below;
extern int Cmdline_cd_check;
extern int Cmdline_client_dodamage;
extern int Cmdline_closed_game;
extern int Cmdline_freespace_no_music;
extern int Cmdline_freespace_no_sound;
extern int Cmdline_gimme_all_medals;
extern int Cmdline_mouse_coords;
extern int Cmdline_multi_log;
extern int Cmdline_multi_stream_chat_to_file;
extern int Cmdline_network_port;
extern int Cmdline_restricted_game;
extern int Cmdline_spew_pof_info;
extern int Cmdline_start_netgame;
extern int Cmdline_timeout;
extern int Cmdline_use_last_pilot;
extern int Cmdline_window;
extern int Cmdline_fullscreen_window;
extern SCP_string Cmdline_res;
extern SCP_string Cmdline_center_res;
// FSO OPTIONS -------------------------------------------------
// Graphics related
extern double specular_exponent_value;
extern float Cmdline_clip_dist;
extern float Cmdline_ogl_spec;
extern float static_light_factor;
extern float static_point_factor;
extern float static_tube_factor;
extern int Cmdline_ambient_factor;
extern int Cmdline_env;
extern int Cmdline_glow;
extern int Cmdline_noscalevid; // disables fit-to-window for movies - taylor
extern int Cmdline_spec;
extern int Cmdline_normal;
extern int Cmdline_height;
extern int Cmdline_enable_3d_shockwave;
extern int Cmdline_softparticles;
extern int Cmdline_bloom_intensity;
extern int Cmdline_no_deferred_lighting;
extern int Cmdline_no_emissive;
extern int Cmdline_aniso_level;
// Game Speed related
extern int Cmdline_NoFPSCap;
extern int Cmdline_no_vsync;
// HUD related
extern int Cmdline_ballistic_gauge;
extern int Cmdline_dualscanlines;
extern int Cmdline_orb_radar;
extern int Cmdline_rearm_timer;
extern int Cmdline_targetinfo;
// Gameplay related
extern int Cmdline_3dwarp;
extern int Cmdline_ship_choice_3d;
extern int Cmdline_weapon_choice_3d;
extern int Cmdline_warp_flash;
extern int Cmdline_autopilot_interruptable;
extern int Cmdline_stretch_menu;
// Audio related
extern int Cmdline_voice_recognition;
extern int Cmdline_no_enhanced_sound;
namespace cfile {
struct ModRoot;
} // namespace cfile
// MOD related
extern SCP_vector<cfile::ModRoot> Cmdline_mod; // DTP for mod support
// Multiplayer/Network related
extern SCP_string Cmdline_almission; // DTP for autoload mission (for multi only)
extern int Cmdline_ingamejoin;
extern int Cmdline_mpnoreturn;
extern SCP_string Cmdline_spew_mission_crcs;
extern SCP_string Cmdline_spew_table_crcs;
extern int Cmdline_objupd;
// Launcher related options
extern bool Cmdline_portable_mode;
// Troubleshooting
extern int Cmdline_load_all_weapons;
extern int Cmdline_nomovies; // WMC Toggles movie playing support
extern int Cmdline_no_set_gamma;
extern int Cmdline_no_fbo;
extern int Cmdline_no_pbo;
extern int Cmdline_mipmap;
extern int Cmdline_ati_color_swap;
extern int Cmdline_no_3d_sound;
extern int Cmdline_drawelements;
extern SCP_string Cmdline_keyboard_layout;
extern bool Cmdline_gl_finish;
extern bool Cmdline_no_geo_sdr_effects;
extern bool Cmdline_set_cpu_affinity;
extern bool Cmdline_nograb;
extern bool Cmdline_noshadercache;
#ifdef WIN32
extern bool Cmdline_alternate_registry_path;
#endif
// Developer/Testing related
extern SCP_string Cmdline_start_mission;
extern int Cmdline_dis_collisions;
extern int Cmdline_dis_weapons;
extern bool Cmdline_output_sexp_info;
extern int Cmdline_noparseerrors;
extern int Cmdline_extra_warn;
extern int Cmdline_bmpman_usage;
extern int Cmdline_show_pos;
extern int Cmdline_show_stats;
extern int Cmdline_save_render_targets;
extern int Cmdline_verify_vps;
extern int Cmdline_reparse_mainhall;
extern bool Cmdline_profile_write_file;
extern bool Cmdline_no_unfocus_pause;
extern bool Cmdline_benchmark_mode;
extern bool Cmdline_noninteractive;
extern bool Cmdline_json_profiling;
extern bool Cmdline_frame_profile;
extern bool Cmdline_show_video_info;
extern bool Cmdline_debug_window;
#endif
-48
View File
@@ -1,48 +0,0 @@
{
"version": 1,
"flags": {
"-bool_option": false,
"-number_option": 5.8,
"-string_option": "asdf",
"-mod": [
{
"type": "folder",
"path": "/home/fso/mediavps",
"user": true,
"location_type": "primary_mod"
},
{
"type": "folder",
"path": "/home/fso",
"user": true,
"location_type": "game_root"
},
{
"type": "folder",
"path": "/path/to/fso/mediavps",
"user": false,
"location_type": "primary_mod"
},
{
"type": "package",
"path": "/path/to/fso/mediavps/MVPS-Z.vp",
"location_type": "primary_mod"
},
{
"type": "package",
"path": "/path/to/fso/mediavps/MVPS-X.vp",
"location_type": "primary_mod"
},
{
"type": "folder",
"path": "/path/to/fso",
"location_type": "game_root"
},
{
"type": "package",
"path": "/path/to/fso/retail.vp",
"location_type": "game_root"
}
]
}
}
Loaded 100 of 2679 files, more files were not shown because too many files have changed in this diff. Show more