Compare commits

..
Author SHA1 Message Date
Goober5000 022a04472c revert the directory move 2008-02-09 21:33:46 +00:00
Goober5000 e80b91c27e experimentally move everything up one folder 2008-02-09 18:21:58 +00:00
argv 26a66f9c53 Mission ship flag beam-free-all. 2003-09-19 01:02:51 +00:00
argv a337c9a5d5 Don't restore player loadout in scramble missions. Avoids breakage when changing the default loadout in fred on such missions. 2003-09-19 00:58:49 +00:00
argv 85da72fb16 Mission ship flag beam-free-all. 2003-09-19 00:57:06 +00:00
argv 13ee1bdb60 Singular shield, beam-free-all mission ship flag, negative repeat count means repeat forever. Sorry for flooding the dev list with this junk. :P 2003-09-19 00:55:33 +00:00
argv 02465b9db6 Negative repeat count in mission means to repeat indefinitely. Shouldn't break anything, I don't think. Fred needs to be changed to be able to use this, though. 2003-09-19 00:49:11 +00:00
argv b33417a918 New energy system support. This doesn't compile yet, but this _is_ the experimental branch... 2003-09-19 00:42:13 +00:00
argv f802db8345 Table specified subsys display name. 2003-09-19 00:35:51 +00:00
argv 56054d6782 Made target nothing command not disable auto targeting if player says not to, and made targeting big ships not auto-select a turret if player says not to. 2003-09-19 00:31:10 +00:00
argv 1c3fb592cb Gave fredders more power over what orders players can give to big ships, like ordering a supercap to attack something. 2003-09-19 00:15:26 +00:00
argv 049870c973 Various singular shield stuff. 2003-09-19 00:10:21 +00:00
argv 22c0882bc6 New energy system and auto ETS stuff. 2003-09-19 00:02:20 +00:00
argv ffd3fbd922 Added my command-line options. Note that this is in my new experimental branch, so don't panic. 2003-09-18 23:40:16 +00:00
(no author) 42e496d103 This commit was manufactured by cvs2svn to create branch
'argv_experimental_branch'.
2003-09-16 13:30:17 +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
566 changed files with 90424 additions and 14662 deletions

No files matched your search

-13
View File
@@ -1,13 +0,0 @@
# The "checkoutlist" file is used to support additional version controlled
# administrative files in $CVSROOT/CVSROOT, such as template files.
#
# The first entry on a line is a filename which will be checked out from
# the corresponding RCS file in the $CVSROOT/CVSROOT directory.
# The remainder of the line is an error message to use if the file cannot
# be checked out.
#
# File format:
#
# [<whitespace>]<filename><whitespace><error message><end-of-line>
#
# comment lines begin with '#'
-15
View File
@@ -1,15 +0,0 @@
# The "commitinfo" file is used to control pre-commit checks.
# The filter on the right is invoked with the repository and a list
# of files to check. A non-zero exit of the filter program will
# cause the commit to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-14
View File
@@ -1,14 +0,0 @@
# Set this to "no" if pserver shouldn't check system users/passwords
#SystemAuth=no
# Put CVS lock files in this directory rather than directly in the repository.
#LockDir=/var/lock/cvs
# Set `TopLevelAdmin' to `yes' to create a CVS directory at the top
# level of the new working directory when using the `cvs checkout'
# command.
#TopLevelAdmin=no
# Set `LogHistory' to `all' or `TOFEWGCMAR' to log all transactions to the
# history file, or a subset as needed (ie `TMAR' logs all write operations)
#LogHistory=TOFEWGCMAR
-23
View File
@@ -1,23 +0,0 @@
# This file affects handling of files based on their names.
#
# The -t/-f options allow one to treat directories of files
# as a single file, or to transform a file in other ways on
# its way in and out of CVS.
#
# The -m option specifies whether CVS attempts to merge files.
#
# The -k option specifies keyword expansion (e.g. -kb for binary).
#
# Format of wrapper file ($CVSROOT/CVSROOT/cvswrappers or .cvswrappers)
#
# wildcard [option value][option value]...
#
# where option is one of
# -f from cvs filter value: path to filter
# -t to cvs filter value: path to filter
# -m update methodology value: MERGE or COPY
# -k expansion mode value: b, o, kkv, &c
#
# and value is a single-quote delimited value.
# For example:
#*.gif -k 'b'
-21
View File
@@ -1,21 +0,0 @@
# The "editinfo" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-26
View File
@@ -1,26 +0,0 @@
# The "loginfo" file controls where "cvs commit" log information
# is sent. The first entry on a line is a regular expression which must match
# the directory that the change is being made to, relative to the
# $CVSROOT. If a match is found, then the remainder of the line is a filter
# program that should expect log information on its standard input.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name ALL appears as a regular expression it is always used
# in addition to the first matching regex or DEFAULT.
#
# You may specify a format string as part of the
# filter. The string is composed of a `%' followed
# by a single format character, or followed by a set of format
# characters surrounded by `{' and `}' as separators. The format
# characters are:
#
# s = file name
# V = old version number (pre-checkin)
# v = new version number (post-checkin)
#
# For example:
#DEFAULT (echo ""; id; echo %s; date; cat) >> $CVSROOT/CVSROOT/commitlog
# or
#DEFAULT (echo ""; id; echo %{sVv}; date; cat) >> $CVSROOT/CVSROOT/commitlog
-26
View File
@@ -1,26 +0,0 @@
# Three different line formats are valid:
# key -a aliases...
# key [options] directory
# key [options] directory files...
#
# Where "options" are composed of:
# -i prog Run "prog" on "cvs commit" from top-level of module.
# -o prog Run "prog" on "cvs checkout" of module.
# -e prog Run "prog" on "cvs export" of module.
# -t prog Run "prog" on "cvs rtag" of module.
# -u prog Run "prog" on "cvs update" of module.
# -d dir Place module in directory "dir" instead of module name.
# -l Top-level directory only -- do not recurse.
#
# NOTE: If you change any of the "Run" options above, you'll have to
# release and re-checkout any working directories of these modules.
#
# And "directory" is a path to a directory relative to $CVSROOT.
#
# The "-a" option specifies an alias. An alias is interpreted as if
# everything on the right of the "-a" had been typed on the command line.
#
# You can encode a module within a module by using the special '&'
# character to interpose another module into the current module. This
# can be useful for creating a module that consists of many directories
# spread out over the entire source repository.
-12
View File
@@ -1,12 +0,0 @@
# The "notify" file controls where notifications from watches set by
# "cvs watch add" or "cvs edit" are sent. The first entry on a line is
# a regular expression which is tested against the directory that the
# change is being made to, relative to the $CVSROOT. If it matches,
# then the remainder of the line is a filter program that should contain
# one occurrence of %s for the user to notify, and information on its
# standard input.
#
# "ALL" or "DEFAULT" can be used in place of the regular expression.
#
# For example:
#ALL mail %s -s "CVS notification"
-4
View File
@@ -1,4 +0,0 @@
drevil:nNwcK94cKMqZI:fs2source
inquisitor:Jh.dOjaiO2jHk:fs2source
anonymous:EqQXnO5cz9yBA:fs2source
-13
View File
@@ -1,13 +0,0 @@
# The "rcsinfo" file is used to control templates with which the editor
# is invoked on commit and import.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being made to, relative to the
# $CVSROOT. For the first match that is found, then the remainder of the
# line is the name of the file that contains the template.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-20
View File
@@ -1,20 +0,0 @@
# The "taginfo" file is used to control pre-tag checks.
# The filter on the right is invoked with the following arguments:
#
# $1 -- tagname
# $2 -- operation "add" for tag, "mov" for tag -F, and "del" for tag -d
# $3 -- repository
# $4-> file revision [file revision ...]
#
# A non-zero exit of the filter program will cause the tag to be aborted.
#
# The first entry on a line is a regular expression which is tested
# against the directory that the change is being committed to, relative
# to the $CVSROOT. For the first match that is found, then the remainder
# of the line is the name of the filter to run.
#
# If the repository name does not match any of the regular expressions in this
# file, the "DEFAULT" line is used, if it is specified.
#
# If the name "ALL" appears as a regular expression it is always used
# in addition to the first matching regex or "DEFAULT".
-21
View File
@@ -1,21 +0,0 @@
# The "verifymsg" file is used to allow verification of logging
# information. It works best when a template (as specified in the
# rcsinfo file) is provided for the logging procedure. Given a
# template with locations for, a bug-id number, a list of people who
# reviewed the code before it can be checked in, and an external
# process to catalog the differences that were code reviewed, the
# following test can be applied to the code:
#
# Making sure that the entered bug-id number is correct.
# Validating that the code that was reviewed is indeed the code being
# checked in (using the bug-id number or a seperate review
# number to identify this particular code set.).
#
# If any of the above test failed, then the commit would be aborted.
#
# Actions such as mailing a copy of the report to each reviewer are
# better handled by an entry in the loginfo file.
#
# One thing that should be noted is the the ALL keyword is not
# supported. There can be only one entry that matches a given
# repository.
-3
View File
@@ -1,3 +0,0 @@
drevil
inquisitor
+29
View File
@@ -0,0 +1,29 @@
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
Modifications by the FreeSpace Source Code Project (FSSCP)
http://fs2source.warpcore.org
FS2_OPEN STAFF:
Project leader:
Edward "Inquisitor" Gardner
Programmers:
"Bobboau"
Dennis "DTP" Pedersen
Ian "Goober5000" Warfield
Joe "Righteous1" Dowd
Mike "penguin" Harris
"Mysterial"
"PhReAk"
Thomas "Random Tiger" Whittaker
Will "Unknown PLayer" Rousnel
"WMCoolmon"
Web support:
Icefire and the staff at Volitionwatch.com
Alex "Thunder" Avery and the staff at Hard Light Productions
Special thanks to:
Volition for making FS2 such a great game
Dave Baranec for giving us the code and keeping us sanity checked
+14
View File
@@ -0,0 +1,14 @@
Volition Copyright (applies to original FreeSpace2 source code
developed and released by Volition):
"Copyright (C) Volition, Inc. 1999. All rights reserved.
All source code herein is the property of Volition, Inc. You may not
sell or otherwise commercially exploit the source or things you
created based on the source."
Modifications by members of the FreeSpace Source Code Project are
released under whatever terms the individual authors choose, but the
above notice continues to apply to all fs2_open code.
+1868
View File
File diff suppressed because it is too large. Load diff
Binary file not shown.
+157
View File
@@ -0,0 +1,157 @@
# Microsoft Developer Studio Project File - Name="Freespace2" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Freespace2 - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Freespace2.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Freespace2.mak" CFG="Freespace2 - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Freespace2 - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Freespace2 - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
# PROP Scc_ProjName ""$/Freespace2", RHWBAAAA"
# PROP Scc_LocalPath "."
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Freespace2 - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release\Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /map /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"c:\games\Freespace2\fs2_open_r.exe" /libpath:"release"
# SUBTRACT LINK32 /debug
# Begin Custom Build
InputPath=c:\games\Freespace2\fs2_open_r.exe
SOURCE="$(InputPath)"
"c:\games\freespace2\fs2_open_r.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) c:\games\freespace2
# End Custom Build
!ELSEIF "$(CFG)" == "Freespace2 - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug\Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "code" /D "WIN32" /D "_WINDOWS" /D "_DEBUG" /D "NO_CD_CHECK" /D "DBUGFILE_ACTIVE" /D "USE_OPENGL" /U "NDEBUG" /Fr /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo /o"debug/profile/Freespace2.bsc" "./debug/profile/*.sbr"
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 Dxerr8.lib d3d8.lib d3dx8.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib wsock32.lib winmm.lib vfw32.lib msacm32.lib comctl32.lib code.lib /nologo /subsystem:windows /debug /debugtype:both /machine:I386 /nodefaultlib:"libc.lib" /nodefaultlib:"libcd.lib" /out:"C:\games\Freespace2/fs2_open_d.exe" /libpath:"debug"
# SUBTRACT LINK32 /pdb:none /incremental:no /map
# Begin Custom Build - Copying $(InputPath) to c:\games\freespace2
InputPath=C:\games\Freespace2\fs2_open_d.exe
SOURCE="$(InputPath)"
"c:\games\freespace2\fs2_open_d.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy $(InputPath) c:\games\freespace2
# End Custom Build
!ENDIF
# Begin Target
# Name "Freespace2 - Win32 Release"
# Name "Freespace2 - Win32 Debug"
# Begin Source File
SOURCE=.\code\FREESPACE2\app_icon.ico
# End Source File
# Begin Source File
SOURCE=.\code\FREESPACE2\FreeSpace.cpp
# End Source File
# Begin Source File
SOURCE=.\code\FREESPACE2\FreeSpace.h
# End Source File
# Begin Source File
SOURCE=.\code\FREESPACE2\FreeSpace.rc
# End Source File
# Begin Source File
SOURCE=.\code\FREESPACE2\FreespaceResource.h
# End Source File
# Begin Source File
SOURCE=.\code\freespace2\goal_com.bmp
# End Source File
# Begin Source File
SOURCE=.\code\freespace2\goal_fail.bmp
# End Source File
# Begin Source File
SOURCE=.\code\freespace2\goal_inc.bmp
# End Source File
# Begin Source File
SOURCE=.\code\freespace2\goal_none.bmp
# End Source File
# Begin Source File
SOURCE=.\code\freespace2\goal_ord.bmp
# End Source File
# Begin Source File
SOURCE=.\code\FREESPACE2\LevelPaging.cpp
# End Source File
# Begin Source File
SOURCE=.\code\FREESPACE2\LevelPaging.h
# End Source File
# End Target
# End Project
+44
View File
@@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Freespace2"=".\Freespace2.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name code
End Project Dependency
}}}
###############################################################################
Project: "code"=".\code\code.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
+27
View File
@@ -0,0 +1,27 @@
This is still in pretty rough form.
=== for people building fs2_open:
Win32-MSVC:
Use the Freespace2.dsw workspace and build within the IDE.
Win32-MinGW:
make
Linux and other unix variants (NOT YET COMPLETE)
./configure [options] (options tbd)
make -f makefile.linux
=== for the project maintainers (people who need to
=== keep the makefiles up to date):
aclocal
autoconf
automake
./configure
make
+5
View File
@@ -0,0 +1,5 @@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
SUBDIRS = code
+506
View File
@@ -0,0 +1,506 @@
# Makefile.in generated by automake 1.7.2 from Makefile.am.
# @configure_input@
# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002
# Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
# Makefile.am for fs2_open (top level)
#
# This file uses GNU Automake to generate makefiles
srcdir = @srcdir@
top_srcdir = @top_srcdir@
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
top_builddir = .
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
INSTALL = @INSTALL@
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
host_triplet = @host@
ACLOCAL = @ACLOCAL@
AMDEP_FALSE = @AMDEP_FALSE@
AMDEP_TRUE = @AMDEP_TRUE@
AMTAR = @AMTAR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
DX8_INCLUDE = @DX8_INCLUDE@
DX8_LIB = @DX8_LIB@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EXEEXT = @EXEEXT@
FS2_GRSOFT_FALSE = @FS2_GRSOFT_FALSE@
FS2_GRSOFT_TRUE = @FS2_GRSOFT_TRUE@
FS2_JOYSTICK_FALSE = @FS2_JOYSTICK_FALSE@
FS2_JOYSTICK_TRUE = @FS2_JOYSTICK_TRUE@
FS2_NETWORKING_FALSE = @FS2_NETWORKING_FALSE@
FS2_NETWORKING_TRUE = @FS2_NETWORKING_TRUE@
FS2_OS_UNIX_FALSE = @FS2_OS_UNIX_FALSE@
FS2_OS_UNIX_TRUE = @FS2_OS_UNIX_TRUE@
FS2_OS_WIN32_FALSE = @FS2_OS_WIN32_FALSE@
FS2_OS_WIN32_TRUE = @FS2_OS_WIN32_TRUE@
FS2_SOUND_FALSE = @FS2_SOUND_FALSE@
FS2_SOUND_TRUE = @FS2_SOUND_TRUE@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
ac_ct_CXX = @ac_ct_CXX@
ac_ct_STRIP = @ac_ct_STRIP@
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
am__include = @am__include@
am__quote = @am__quote@
bindir = @bindir@
build = @build@
build_alias = @build_alias@
build_cpu = @build_cpu@
build_os = @build_os@
build_vendor = @build_vendor@
datadir = @datadir@
exec_prefix = @exec_prefix@
host = @host@
host_alias = @host_alias@
host_cpu = @host_cpu@
host_os = @host_os@
host_vendor = @host_vendor@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localstatedir = @localstatedir@
mandir = @mandir@
oldincludedir = @oldincludedir@
prefix = @prefix@
program_transform_name = @program_transform_name@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
SUBDIRS = code
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
CONFIG_CLEAN_FILES =
DIST_SOURCES =
RECURSIVE_TARGETS = info-recursive dvi-recursive pdf-recursive \
ps-recursive install-info-recursive uninstall-info-recursive \
all-recursive install-data-recursive install-exec-recursive \
installdirs-recursive install-recursive uninstall-recursive \
check-recursive installcheck-recursive
DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \
Makefile.in NEWS aclocal.m4 config.guess config.sub configure \
configure.in depcomp install-sh missing mkinstalldirs
DIST_SUBDIRS = $(SUBDIRS)
all: all-recursive
.SUFFIXES:
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno
$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4)
cd $(top_srcdir) && \
$(AUTOMAKE) --gnu Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)
$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): configure.in
cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
uninstall-info-am:
# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
# (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
mostlyclean-recursive clean-recursive distclean-recursive \
maintainer-clean-recursive:
@set fnord $$MAKEFLAGS; amf=$$2; \
dot_seen=no; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
rev=''; for subdir in $$list; do \
if test "$$subdir" = "."; then :; else \
rev="$$subdir $$rev"; \
fi; \
done; \
rev="$$rev ."; \
target=`echo $@ | sed s/-recursive//`; \
for subdir in $$rev; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
(cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
done && test -z "$$fail"
tags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
done
ctags-recursive:
list='$(SUBDIRS)'; for subdir in $$list; do \
test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
done
ETAGS = etags
ETAGSFLAGS =
CTAGS = ctags
CTAGSFLAGS =
tags: TAGS
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
mkid -fID $$unique
TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
fi; \
done; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(ETAGS_ARGS)$$tags$$unique" \
|| $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$tags $$unique
ctags: CTAGS
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
$(AWK) ' { files[$$0] = 1; } \
END { for (i in files) print i; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& cd $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) $$here
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
top_distdir = .
distdir = $(PACKAGE)-$(VERSION)
am__remove_distdir = \
{ test ! -d $(distdir) \
|| { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -fr $(distdir); }; }
GZIP_ENV = --best
distuninstallcheck_listfiles = find . -type f -print
distcleancheck_listfiles = find . -type f -print
distdir: $(DISTFILES)
$(am__remove_distdir)
mkdir $(distdir)
@srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \
list='$(DISTFILES)'; for file in $$list; do \
case $$file in \
$(srcdir)/*) file=`echo "$$file" | sed "s|^$$srcdirstrip/||"`;; \
$(top_srcdir)/*) file=`echo "$$file" | sed "s|^$$topsrcdirstrip/|$(top_builddir)/|"`;; \
esac; \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
dir="/$$dir"; \
$(mkinstalldirs) "$(distdir)$$dir"; \
else \
dir=''; \
fi; \
if test -d $$d/$$file; then \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \
fi; \
cp -pR $$d/$$file $(distdir)$$dir || exit 1; \
else \
test -f $(distdir)/$$file \
|| cp -p $$d/$$file $(distdir)/$$file \
|| exit 1; \
fi; \
done
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test -d $(distdir)/$$subdir \
|| mkdir $(distdir)/$$subdir \
|| exit 1; \
(cd $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$(top_distdir)" \
distdir=../$(distdir)/$$subdir \
distdir) \
|| exit 1; \
fi; \
done
-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
! -type d ! -perm -400 -exec chmod a+r {} \; -o \
! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
|| chmod -R a+r $(distdir)
dist-gzip: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
dist dist-all: distdir
$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
$(am__remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
# tarfile.
distcheck: dist
$(am__remove_distdir)
GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
chmod -R a-w $(distdir); chmod a+w $(distdir)
mkdir $(distdir)/=build
mkdir $(distdir)/=inst
chmod a-w $(distdir)
dc_install_base=`$(am__cd) $(distdir)/=inst && pwd` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& cd $(distdir)/=build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
&& $(MAKE) $(AM_MAKEFLAGS) check \
&& $(MAKE) $(AM_MAKEFLAGS) install \
&& $(MAKE) $(AM_MAKEFLAGS) installcheck \
&& $(MAKE) $(AM_MAKEFLAGS) uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
distuninstallcheck \
&& chmod -R a-w "$$dc_install_base" \
&& ({ \
(cd ../.. && $(mkinstalldirs) "$$dc_destdir") \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
&& $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
} || { rm -rf "$$dc_destdir"; exit 1; }) \
&& rm -rf "$$dc_destdir" \
&& $(MAKE) $(AM_MAKEFLAGS) dist-gzip \
&& rm -f $(distdir).tar.gz \
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck
$(am__remove_distdir)
@echo "$(distdir).tar.gz is ready for distribution" | \
sed 'h;s/./=/g;p;x;p;x'
distuninstallcheck:
cd $(distuninstallcheck_dir) \
&& test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
fi ; \
$(distuninstallcheck_listfiles) ; \
exit 1; } >&2
distcleancheck: distclean
if test '$(srcdir)' = . ; then \
echo "ERROR: distcleancheck can only run from a VPATH build" ; \
exit 1 ; \
fi
test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left in build directory after distclean:" ; \
$(distcleancheck_listfiles) ; \
exit 1; } >&2
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
INSTALL_STRIP_FLAG=-s \
`test -z '$(STRIP)' || \
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
mostlyclean-generic:
clean-generic:
distclean-generic:
-rm -f Makefile $(CONFIG_CLEAN_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
info: info-recursive
info-am:
install-data-am:
install-exec-am:
install-info: install-info-recursive
install-man:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf autom4te.cache
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am: uninstall-info-am
uninstall-info: uninstall-info-recursive
.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am clean \
clean-generic clean-recursive ctags ctags-recursive dist \
dist-all dist-gzip distcheck distclean distclean-generic \
distclean-recursive distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am dvi-recursive info info-am \
info-recursive install install-am install-data install-data-am \
install-data-recursive install-exec install-exec-am \
install-exec-recursive install-info install-info-am \
install-info-recursive install-man install-recursive \
install-strip installcheck installcheck-am installdirs \
installdirs-am installdirs-recursive maintainer-clean \
maintainer-clean-generic maintainer-clean-recursive mostlyclean \
mostlyclean-generic mostlyclean-recursive pdf pdf-am \
pdf-recursive ps ps-am ps-recursive tags tags-recursive \
uninstall uninstall-am uninstall-info-am \
uninstall-info-recursive uninstall-recursive
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
+3
View File
@@ -0,0 +1,3 @@
This file is required to keep autoconf/automake from complaining.
See the ChangeLog for what's new.
+4
View File
@@ -0,0 +1,4 @@
This file is required to keep autoconf/automake from complaining.
See the ChangeLog to see what's new.
See the INSTALL file for instructions on how to build fs2_open.
-285
View File
@@ -1,285 +0,0 @@
TARGET = libcode.a
CXXFLAGS = -DWIN32 -D_DEBUG \
-Iwindows_stub \
-IAnim -IAsteroid -IBmpman -ICFile -ICmdline -ICMeasure -IControlConfig \
-ICutscene -IDebris -IDebugConsole -IDirectX -IFireball -IGameHelp -IFREESPACE2 \
-IGameSequence -IGamesnd -IGlide -IGlobalIncs -IGraphics -IHud -IIo -IJumpNode \
-ILighting -IMath -IMenuUI -IMission -IMissionUI -IModel -INetwork -IObject \
-IObserver -IOsApi -IPalman -IParse -IParticle -IPcxUtils -IPhysics -IPlayerman \
-IPopup -IRadar -IRender -IShip -ISound -IStarfield -IStats -ITgaUtils -IUI -IVCodec \
-IWeapon -ILocalization -INebula -IDemo -IInetfile -IExceptionHandler \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG
# removed from OBJFILES
# CFile/cfile.o \
# CFile/CfileArchive.o \
# CFile/CfileList.o \
# CFile/CfileSystem.o \
OBJFILES = \
Anim/animplay.o \
Anim/packunpack.o \
Asteroid/asteroid.o \
Bmpman/bmpman.o \
Cmdline/cmdline.o \
CMeasure/cmeasure.o \
ControlConfig/controlsconfig.o \
ControlConfig/controlsconfigcommon.o \
Cutscene/cutscenes.o \
Debris/debris.o \
DebugConsole/console.o \
Fireball/fireballs.o \
Fireball/warpineffect.o \
GameHelp/contexthelp.o \
GameHelp/gameplayhelp.o \
GameSequence/gamesequence.o \
Gamesnd/eventmusic.o \
Gamesnd/gamesnd.o \
Glide/glide.o \
GlobalIncs/alphacolors.o \
GlobalIncs/crypt.o \
GlobalIncs/systemvars.o \
GlobalIncs/version.o \
GlobalIncs/windebug.o \
Graphics/2d.o \
Graphics/aaline.o \
Graphics/bitblt.o \
Graphics/circle.o \
Graphics/colors.o \
Graphics/font.o \
Graphics/gradient.o \
Graphics/grd3d.o \
Graphics/grd3drender.o \
Graphics/grd3dtexture.o \
Graphics/grdirectdraw.o \
Graphics/grglide.o \
Graphics/grglidetexture.o \
Graphics/gropengl.o \
Graphics/grsoft.o \
Graphics/grzbuffer.o \
Graphics/line.o \
Graphics/pixel.o \
Graphics/rect.o \
Graphics/scaler.o \
Graphics/shade.o \
Graphics/tmapgenericscans.o \
Graphics/tmapper.o \
Graphics/tmapscanline.o \
Graphics/tmapscantiled128x128.o \
Graphics/tmapscantiled16x16.o \
Graphics/tmapscantiled256x256.o \
Graphics/tmapscantiled32x32.o \
Graphics/tmapscantiled64x64.o \
Hud/hud.o \
Hud/hudartillery.o \
Hud/hudbrackets.o \
Hud/hudconfig.o \
Hud/hudescort.o \
Hud/hudets.o \
Hud/hudlock.o \
Hud/hudmessage.o \
Hud/hudobserver.o \
Hud/hudreticle.o \
Hud/hudshield.o \
Hud/hudsquadmsg.o \
Hud/hudtarget.o \
Hud/hudtargetbox.o \
Hud/hudwingmanstatus.o \
Io/joy.o \
Io/joy_ff.o \
Io/key.o \
Io/keycontrol.o \
Io/mouse.o \
Io/swff_lib.o \
Io/timer.o \
JumpNode/jumpnode.o \
Lighting/lighting.o \
Math/fix.o \
Math/floating.o \
Math/fvi.o \
Math/spline.o \
Math/staticrand.o \
Math/vecmat.o \
MenuUI/barracks.o \
MenuUI/credits.o \
MenuUI/fishtank.o \
MenuUI/mainhallmenu.o \
MenuUI/mainhalltemp.o \
MenuUI/optionsmenu.o \
MenuUI/optionsmenumulti.o \
MenuUI/playermenu.o \
MenuUI/readyroom.o \
MenuUI/snazzyui.o \
MenuUI/techmenu.o \
MenuUI/trainingmenu.o \
Mission/missionbriefcommon.o \
Mission/missioncampaign.o \
Mission/missiongoals.o \
Mission/missiongrid.o \
Mission/missionhotkey.o \
Mission/missionload.o \
Mission/missionlog.o \
Mission/missionmessage.o \
Mission/missionparse.o \
Mission/missiontraining.o \
MissionUI/chatbox.o \
MissionUI/missionbrief.o \
MissionUI/missioncmdbrief.o \
MissionUI/missiondebrief.o \
MissionUI/missionloopbrief.o \
MissionUI/missionpause.o \
MissionUI/missionrecommend.o \
MissionUI/missionscreencommon.o \
MissionUI/missionshipchoice.o \
MissionUI/missionstats.o \
MissionUI/missionweaponchoice.o \
MissionUI/redalert.o \
Model/modelcollide.o \
Model/modelinterp.o \
Model/modeloctant.o \
Model/modelread.o \
Object/collidedebrisship.o \
Object/collidedebrisweapon.o \
Object/collideshipship.o \
Object/collideshipweapon.o \
Object/collideweaponweapon.o \
Object/objcollide.o \
Object/object.o \
Object/objectsnd.o \
Object/objectsort.o \
Observer/observer.o \
OsApi/osapi.o \
OsApi/osregistry.o \
OsApi/outwnd.o \
Palman/palman.o \
Parse/encrypt.o \
Parse/parselo.o \
Parse/sexp.o \
Particle/particle.o \
PcxUtils/pcxutils.o \
Physics/physics.o \
Playerman/managepilot.o \
Playerman/playercontrol.o \
Popup/popup.o \
Popup/popupdead.o \
Radar/radar.o \
Render/3dclipper.o \
Render/3ddraw.o \
Render/3dlaser.o \
Render/3dmath.o \
Render/3dsetup.o \
Ship/afterburner.o \
Ship/ai.o \
Ship/aibig.o \
Ship/aicode.o \
Ship/aigoals.o \
Ship/awacs.o \
Ship/shield.o \
Ship/ship.o \
Ship/shipcontrails.o \
Ship/shipfx.o \
Ship/shiphit.o \
Sound/acm.o \
Sound/audiostr.o \
Sound/ds.o \
Sound/ds3d.o \
Sound/dscap.o \
Sound/midifile.o \
Sound/rbaudio.o \
Sound/rtvoice.o \
Sound/sound.o \
Sound/winmidi.o \
Sound/winmidi_base.o \
Starfield/nebula.o \
Starfield/starfield.o \
Starfield/supernova.o \
Stats/medals.o \
Stats/scoring.o \
Stats/stats.o \
UI/button.o \
UI/checkbox.o \
UI/gadget.o \
UI/icon.o \
UI/inputbox.o \
UI/keytrap.o \
UI/listbox.o \
UI/radio.o \
UI/scroll.o \
UI/slider.o \
UI/slider2.o \
UI/uidraw.o \
UI/uimouse.o \
UI/window.o \
VCodec/codec1.o \
Weapon/beam.o \
Weapon/corkscrew.o \
Weapon/emp.o \
Weapon/flak.o \
Weapon/muzzleflash.o \
Weapon/shockwave.o \
Weapon/swarm.o \
Weapon/trails.o \
Weapon/weapons.o \
Nebula/neb.o \
Nebula/neblightning.o \
Localization/fhash.o \
Localization/localize.o \
TgaUtils/tgautils.o \
Demo/demo.o \
Inetfile/cftp.o \
Inetfile/chttpget.o \
Inetfile/inetgetfile.o \
ExceptionHandler/exceptionhandler.o \
Network/multi.o \
Network/multi_campaign.o \
Network/multi_data.o \
Network/multi_dogfight.o \
Network/multi_endgame.o \
Network/multi_ingame.o \
Network/multi_kick.o \
Network/multi_log.o \
Network/multi_obj.o \
Network/multi_observer.o \
Network/multi_oo.o \
Network/multi_options.o \
Network/multi_pause.o \
Network/multi_pinfo.o \
Network/multi_ping.o \
Network/multi_pmsg.o \
Network/multi_rate.o \
Network/multi_respawn.o \
Network/multi_team.o \
Network/multi_update.o \
Network/multi_voice.o \
Network/multi_xfer.o \
Network/multilag.o \
Network/multimsgs.o \
Network/multiteamselect.o \
Network/multiui.o \
Network/multiutil.o \
Network/psnet.o \
Network/psnet2.o \
Network/stand_gui.o
# ==============================
.PHONY: all clean code
.cpp.o:
$(CXX) $(CXXFLAGS) -E $< > $@
# $(CXX) $(CXXFLAGS) -c $<
all: $(TARGET)
clean:
rm -f $(TARGET) core *.o *~
find -name *.o -exec rm {} \;
find -name *~ -exec rm {} \;
code: $(TARGET)
# ==============================
libcode.a: $(OBJFILES)
+305
View File
@@ -0,0 +1,305 @@
# code/Makefile.am for fs2_open
#
# $Id: Makefile.am,v 1.2 2003-03-11 19:00:05 penguin Exp $
noinst_PROGRAMS = fs2
fs2_SOURCES = \
anim/animplay.cpp \
anim/packunpack.cpp \
asteroid/asteroid.cpp \
bmpman/bmpman.cpp \
cfile/cfile.cpp \
cfile/cfilearchive.cpp \
cfile/cfilelist.cpp \
cfile/cfilesystem.cpp \
cmdline/cmdline.cpp \
cmeasure/cmeasure.cpp \
controlconfig/controlsconfig.cpp \
controlconfig/controlsconfigcommon.cpp \
cutscene/cutscenes.cpp \
debris/debris.cpp \
debugconsole/console.cpp \
decals/decals.cpp \
demo/demo.cpp \
exceptionhandler/exceptionhandler.cpp \
fireball/fireballs.cpp \
fireball/warpineffect.cpp \
freespace2/freespace.cpp \
freespace2/levelpaging.cpp \
gamehelp/contexthelp.cpp \
gamehelp/gameplayhelp.cpp \
gamesequence/gamesequence.cpp \
globalincs/alphacolors.cpp \
globalincs/crypt.cpp \
globalincs/systemvars.cpp \
globalincs/version.cpp \
graphics/2d.cpp \
graphics/aaline.cpp \
graphics/bitblt.cpp \
graphics/circle.cpp \
graphics/colors.cpp \
graphics/font.cpp \
graphics/gradient.cpp \
graphics/gropengl.cpp \
graphics/grzbuffer.cpp \
graphics/line.cpp \
graphics/pixel.cpp \
graphics/rect.cpp \
graphics/scaler.cpp \
graphics/shade.cpp \
hud/hud.cpp \
hud/hudartillery.cpp \
hud/hudbrackets.cpp \
hud/hudconfig.cpp \
hud/hudescort.cpp \
hud/hudets.cpp \
hud/hudlock.cpp \
hud/hudmessage.cpp \
hud/hudreticle.cpp \
hud/hudshield.cpp \
hud/hudsquadmsg.cpp \
hud/hudtarget.cpp \
hud/hudtargetbox.cpp \
hud/hudwingmanstatus.cpp \
io/key.cpp \
io/keycontrol.cpp \
io/mouse.cpp \
io/timer.cpp \
jumpnode/jumpnode.cpp \
lighting/lighting.cpp \
localization/fhash.cpp \
localization/localize.cpp \
math/fix.cpp \
math/floating.cpp \
math/fvi.cpp \
math/spline.cpp \
math/staticrand.cpp \
math/vecmat.cpp \
menuui/barracks.cpp \
menuui/credits.cpp \
menuui/fishtank.cpp \
menuui/mainhallmenu.cpp \
menuui/mainhalltemp.cpp \
menuui/optionsmenu.cpp \
menuui/playermenu.cpp \
menuui/readyroom.cpp \
menuui/snazzyui.cpp \
menuui/techmenu.cpp \
menuui/trainingmenu.cpp \
mission/missionbriefcommon.cpp \
mission/missioncampaign.cpp \
mission/missiongoals.cpp \
mission/missiongrid.cpp \
mission/missionhotkey.cpp \
mission/missionload.cpp \
mission/missionlog.cpp \
mission/missionmessage.cpp \
mission/missionparse.cpp \
mission/missiontraining.cpp \
missionui/missionbrief.cpp \
missionui/missioncmdbrief.cpp \
missionui/missiondebrief.cpp \
missionui/missionloopbrief.cpp \
missionui/missionpause.cpp \
missionui/missionrecommend.cpp \
missionui/missionscreencommon.cpp \
missionui/missionshipchoice.cpp \
missionui/missionstats.cpp \
missionui/missionweaponchoice.cpp \
missionui/redalert.cpp \
model/modelcollide.cpp \
model/modelinterp.cpp \
model/modeloctant.cpp \
model/modelread.cpp \
nebula/neb.cpp \
nebula/neblightning.cpp \
object/collidedebrisship.cpp \
object/collidedebrisweapon.cpp \
object/collideshipship.cpp \
object/collideshipweapon.cpp \
object/collideweaponweapon.cpp \
object/objcollide.cpp \
object/object.cpp \
object/objectsort.cpp \
observer/observer.cpp \
palman/palman.cpp \
parse/encrypt.cpp \
parse/parselo.cpp \
parse/sexp.cpp \
particle/particle.cpp \
pcxutils/pcxutils.cpp \
physics/physics.cpp \
playerman/managepilot.cpp \
playerman/playercontrol.cpp \
popup/popup.cpp \
popup/popupdead.cpp \
radar/radar.cpp \
render/3dclipper.cpp \
render/3ddraw.cpp \
render/3dlaser.cpp \
render/3dmath.cpp \
render/3dsetup.cpp \
ship/afterburner.cpp \
ship/ai.cpp \
ship/aibig.cpp \
ship/aicode.cpp \
ship/aigoals.cpp \
ship/awacs.cpp \
ship/shield.cpp \
ship/ship.cpp \
ship/shipcontrails.cpp \
ship/shipfx.cpp \
ship/shiphit.cpp \
starfield/nebula.cpp \
starfield/starfield.cpp \
starfield/supernova.cpp \
stats/medals.cpp \
stats/scoring.cpp \
stats/stats.cpp \
tgautils/tgautils.cpp \
ui/button.cpp \
ui/checkbox.cpp \
ui/gadget.cpp \
ui/icon.cpp \
ui/inputbox.cpp \
ui/keytrap.cpp \
ui/listbox.cpp \
ui/radio.cpp \
ui/scroll.cpp \
ui/slider.cpp \
ui/slider2.cpp \
ui/uidraw.cpp \
ui/uimouse.cpp \
ui/window.cpp \
weapon/beam.cpp \
weapon/corkscrew.cpp \
weapon/emp.cpp \
weapon/flak.cpp \
weapon/muzzleflash.cpp \
weapon/shockwave.cpp \
weapon/swarm.cpp \
weapon/trails.cpp \
weapon/weapons.cpp
## conditional includes follow:
## joystic support sources
if FS2_JOYSTICK
fs2_SOURCES += \
io/joy.cpp \
io/joy_ff.cpp \
io/swff_lib.cpp
endif # FS2_JOYSTICK
## networking support sources
if FS2_NETWORKING
fs2_SOURCES += \
hud/hudobserver.cpp \
network/multi.cpp \
network/multimsgs.cpp \
network/multiteamselect.cpp \
network/multiui.cpp \
network/multiutil.cpp \
network/multi_campaign.cpp \
network/multi_data.cpp \
network/multi_dogfight.cpp \
network/multi_endgame.cpp \
network/multi_ingame.cpp \
network/multi_kick.cpp \
network/multi_log.cpp \
network/multi_obj.cpp \
network/multi_observer.cpp \
network/multi_options.cpp \
network/multi_pause.cpp \
network/multi_pinfo.cpp \
network/multi_ping.cpp \
network/multi_pmsg.cpp \
network/multi_rate.cpp \
network/multi_respawn.cpp \
network/multi_team.cpp \
network/multi_voice.cpp \
network/multi_xfer.cpp \
network/psnet.cpp \
network/psnet2.cpp \
menuui/optionsmenumulti.cpp \
missionui/chatbox.cpp
endif # FS2_NETWORKING
## sound support sources
if FS2_SOUND
fs2_SOURCES += \
gamesnd/eventmusic.cpp \
gamesnd/gamesnd.cpp \
object/objectsnd.cpp \
sound/acm.cpp \
sound/audiostr.cpp \
sound/ds.cpp \
sound/ds3d.cpp \
sound/dscap.cpp \
sound/midifile.cpp \
sound/rbaudio.cpp \
sound/rtvoice.cpp \
sound/sound.cpp \
sound/winmidi.cpp \
sound/winmidi_base.cpp \
vcodec/codec1.cpp
endif # FS2_SOUND
## software-rendering support sources
if FS2_GRSOFT
fs2_SOURCES += \
graphics/grsoft.cpp \
graphics/tmapper.cpp
endif # FS2_GRSOFT
## Win32-specific sources
if FS2_OS_WIN32
fs2_SOURCES += \
cutscene/movie.cpp \
directx/dx8show.cpp \
ddsutils/ddsutils.cpp \
globalincs/windebug.cpp \
glide/glide.cpp \
graphics/grd3d.cpp \
graphics/grd3drender.cpp \
graphics/grd3dtexture.cpp \
graphics/grdirectdraw.cpp \
graphics/grglide.cpp \
graphics/grglidetexture.cpp \
network/stand_gui.cpp \
osapi/osapi.cpp \
osapi/osregistry.cpp \
osapi/outwnd.cpp
endif # FS2_OS_WIN32
## Unix-specific sources
if FS2_OS_UNIX
fs2_SOURCES += \
io/xmouse.cpp \
osapi/osapi_unix.cpp \
osapi/osregistry_unix.cpp \
osapi/outwnd_unix.cpp
endif # FS2_OS_UNIX
## compiler flags
# INCLUDES = -I.
AM_CXXFLAGS = -fno-exceptions @DX8_INCLUDE@
AM_LDFLAGS = -L/c/dx8/lib @DX8_LIB@
LDADD =
if FS2_OS_WIN32
## Win32 libraries needed
LDADD += \
-lgdi32 -lole32 -lwsock32 -lwinmm -lmsacm32 -lopengl32 \
-lcomctl32 -lstrmiids -ldxguid -lddraw -ldinput
endif
if FS2_OS_UNIX
## Unix libraries needed
## -- TODO --
endif
File diff suppressed because it is too large. Load diff
+43 -14
View File
@@ -9,13 +9,34 @@
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-03-18 10:07:00 $
* $Author: unknownplayer $
*
* C module for playing back anim files
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.3 2002/11/04 21:24:59 randomtiger
*
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
* Cleaned up some more texture stuff enabled console debug for D3D.
*
* Revision 2.1.2.2 2002/09/28 22:13:42 randomtiger
* Sorted out some bits and pieces. The background nebula blends now which is nice. – RT
*
* Revision 2.1.2.1 2002/09/24 18:56:40 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -178,16 +199,18 @@
* $NoKeywords: $
*/
#include "animplay.h"
#include "linklist.h"
#include "timer.h"
#include "bmpman.h"
#include "2d.h"
#include "3d.h"
#include "grinternal.h"
#include "pcxutils.h"
#include "packunpack.h"
#include "cfile.h"
#include "anim/animplay.h"
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "graphics/grinternal.h"
#include "pcxutils/pcxutils.h"
#include "anim/packunpack.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "debugconsole/dbugfile.h"
static color Color_xparent;
@@ -445,6 +468,7 @@ anim_instance *anim_play(anim_play_struct *aps)
// input: instance => pointer to animation instance
// frametime => time elapsed since last call, in seconds
//
int anim_show_next_frame(anim_instance *instance, float frametime)
{
int bitmap_id, bitmap_flags=0, new_frame_num, frame_diff=0, i, n_frames=0,frame_save;
@@ -462,6 +486,7 @@ int anim_show_next_frame(anim_instance *instance, float frametime)
n_frames = instance->stop_at - instance->start_at + 1;
else if(instance->direction == ANIM_DIRECT_REVERSE)
n_frames = instance->start_at - instance->stop_at + 1;
time = n_frames / i2fl(instance->parent->fps);
percent_through = instance->time_elapsed / time;
@@ -888,7 +913,11 @@ anim *anim_load(char *real_filename, int file_mapped)
int count,idx;
char name[_MAX_PATH];
// file_mapped = 0;
// Unless told otherwise in D3D everything is loaded for speed, lets make use of all that memory
// people have
if(gr_screen.mode == GR_DIRECT3D && Cmdline_d3dlowmem == 0) {
file_mapped = 0;
}
Assert ( real_filename != NULL );
+10 -2
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Anim/AnimPlay.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Header file for playing back anim files
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:07 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -96,6 +102,8 @@
#ifndef __ANIMPLAY_H__
#define __ANIMPLAY_H__
#include "globalincs/pstypes.h"
struct anim;
struct anim_info;
struct anim_instance;
+31 -9
View File
@@ -9,15 +9,36 @@
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-03-18 10:07:00 $
* $Author: unknownplayer $
*
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
* Anim files. Also handles Anim loading, creating Anim instances (for
* utilizing an Anim), and getting getting frames of the Anim.
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.1 2002/11/04 03:02:27 randomtiger
*
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
*
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
*
* Rolled back to an old version of bumpman and made a few changes.
* Added new files: grd3dbumpman.cpp and .h
* Moved the bitmap init function to after the 3D engine is initialised
* Added includes where needed
* Disabled (for now) the D3D8 TGA loading - RT
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -149,12 +170,13 @@
* $NoKeywords: $
*/
#include "grinternal.h"
#include "bmpman.h"
#include "palman.h"
#include "2d.h"
#include "animplay.h"
#include "packunpack.h"
#include "graphics/grinternal.h"
#include "bmpman/bmpman.h"
#include "palman/palman.h"
#include "graphics/2d.h"
#include "anim/animplay.h"
#include "anim/packunpack.h"
#include "graphics/2d.h"
int packer_code = PACKER_CODE;
int transparent_code = 254;
+11 -5
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Anim/PackUnpack.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code for handling packing and unpacking in Hoffoss's RLE format, used for
@@ -18,6 +18,12 @@
* utilizing an Anim), and getting getting frames of the Anim.
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:07 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -145,7 +151,7 @@
#ifndef __PACKUNPACK_H__
#define __PACKUNPACK_H__
#include "pstypes.h"
#include "globalincs/pstypes.h"
struct CFILE;
@@ -195,7 +201,7 @@ typedef struct anim {
int file_offset; // file offset to start of frame data
int cache_file_offset;
ubyte *cache;
} anim;
} anim_t;
// the direction to play the anim (forwards or backwards)
#define ANIM_DIRECT_FORWARD 0
@@ -227,7 +233,7 @@ typedef struct anim_instance {
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;
} anim_instance_t;
extern int packer_code;
+111 -76
View File
@@ -9,13 +9,25 @@
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-04-29 01:03:22 $
* $Author: Goober5000 $
*
* C module for asteroid code
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -257,25 +269,30 @@
* $NoKeywords: $
*/
#include "asteroid.h"
#include "object.h"
#include "objcollide.h"
#include "freespace.h"
#include "timer.h"
#include "3d.h"
#include "fireballs.h"
#include "gamesnd.h"
#include "bmpman.h"
#include "particle.h"
#include "linklist.h"
#include "hudescort.h"
#include "shiphit.h"
#include "multiutil.h"
#include "staticrand.h"
#include "multimsgs.h"
#include "systemvars.h"
#include "localize.h"
#include "multi.h"
#include "asteroid/asteroid.h"
#include "object/object.h"
#include "object/objcollide.h"
#include "freespace2/freespace.h"
#include "io/timer.h"
#include "render/3d.h"
#include "fireball/fireballs.h"
#include "gamesnd/gamesnd.h"
#include "bmpman/bmpman.h"
#include "particle/particle.h"
#include "globalincs/linklist.h"
#include "hud/hudescort.h"
#include "ship/shiphit.h"
#include "math/staticrand.h"
#include "globalincs/systemvars.h"
#include "localization/localize.h"
#include "stats/scoring.h"
#include "hud/hudtarget.h"
#ifndef NO_NETWORK
#include "network/multiutil.h"
#include "network/multimsgs.h"
#include "network/multi.h"
#endif
#ifndef FS2_DEMO
@@ -415,15 +432,15 @@ int asteroid_in_inner_bound_with_axes(asteroid_field *asfieldp, vector *pos, flo
Assert(asfieldp->has_inner_bound);
int rval = 0;
if ( (pos->x > asfieldp->inner_min_bound.x - delta) && (pos->x < asfieldp->inner_max_bound.x + delta) ) {
if ( (pos->xyz.x > asfieldp->inner_min_bound.xyz.x - delta) && (pos->xyz.x < asfieldp->inner_max_bound.xyz.x + delta) ) {
rval += 1;
}
if ( (pos->y > asfieldp->inner_min_bound.y - delta) && (pos->y < asfieldp->inner_max_bound.y + delta) ) {
if ( (pos->xyz.y > asfieldp->inner_min_bound.xyz.y - delta) && (pos->xyz.y < asfieldp->inner_max_bound.xyz.y + delta) ) {
rval += 2;
}
if ( (pos->z > asfieldp->inner_min_bound.z - delta) && (pos->z < asfieldp->inner_max_bound.z + delta) ) {
if ( (pos->xyz.z > asfieldp->inner_min_bound.xyz.z - delta) && (pos->xyz.z < asfieldp->inner_max_bound.xyz.z + delta) ) {
rval += 4;
}
@@ -536,9 +553,9 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
signature = 0;
rand_base = 0;
if ( Game_mode & GM_NORMAL ) {
pos.x = asfieldp->min_bound.x + delta_bound.x * frand();
pos.y = asfieldp->min_bound.y + delta_bound.y * frand();
pos.z = asfieldp->min_bound.z + delta_bound.z * frand();
pos.xyz.x = asfieldp->min_bound.xyz.x + delta_bound.xyz.x * frand();
pos.xyz.y = asfieldp->min_bound.xyz.y + delta_bound.xyz.y * frand();
pos.xyz.z = asfieldp->min_bound.xyz.z + delta_bound.xyz.z * frand();
inner_bound_pos_fixup(asfieldp, &pos);
// vm_set_identity(&orient);
@@ -546,18 +563,20 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
angs.b = frand() * 2*PI;
angs.h = frand() * 2*PI;
} else {
#ifndef NO_NETWORK
signature = multi_assign_network_signature( MULTI_SIG_ASTEROID );
rand_base = signature;
pos.x = asfieldp->min_bound.x + delta_bound.x * static_randf( rand_base++ );
pos.y = asfieldp->min_bound.y + delta_bound.y * static_randf( rand_base++ );
pos.z = asfieldp->min_bound.z + delta_bound.z * static_randf( rand_base++ );
pos.xyz.x = asfieldp->min_bound.xyz.x + delta_bound.xyz.x * static_randf( rand_base++ );
pos.xyz.y = asfieldp->min_bound.xyz.y + delta_bound.xyz.y * static_randf( rand_base++ );
pos.xyz.z = asfieldp->min_bound.xyz.z + delta_bound.xyz.z * static_randf( rand_base++ );
inner_bound_pos_fixup(asfieldp, &pos);
// vm_set_identity(&orient);
angs.p = static_randf( rand_base++ ) * 2*PI;
angs.b = static_randf( rand_base++ ) * 2*PI;
angs.h = static_randf( rand_base++ ) * 2*PI;
#endif
}
vm_angles_2_matrix(&orient, &angs);
@@ -620,15 +639,15 @@ object *asteroid_create(asteroid_field *asfieldp, int asteroid_type, int asteroi
// Fill in the max_vel field, so the collision pair stuff knows
// how fast this can move maximum in order to throw out collisions.
// This is in local coordinates, so Z is forward velocity.
objp->phys_info.max_vel.x = 0.0f;
objp->phys_info.max_vel.y = 0.0f;
objp->phys_info.max_vel.z = vm_vec_mag(&objp->phys_info.desired_vel);
objp->phys_info.max_vel.xyz.x = 0.0f;
objp->phys_info.max_vel.xyz.y = 0.0f;
objp->phys_info.max_vel.xyz.z = vm_vec_mag(&objp->phys_info.desired_vel);
objp->phys_info.mass = asip->modelp[asteroid_subtype]->rad * 700.0f;
objp->phys_info.I_body_inv.rvec.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
objp->phys_info.I_body_inv.uvec.y = objp->phys_info.I_body_inv.rvec.x;
objp->phys_info.I_body_inv.fvec.z = objp->phys_info.I_body_inv.rvec.x;
objp->hull_strength = asip->initial_hull_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
objp->phys_info.I_body_inv.vec.rvec.xyz.x = 1.0f / (objp->phys_info.mass*asip->modelp[asteroid_subtype]->rad);
objp->phys_info.I_body_inv.vec.uvec.xyz.y = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
objp->phys_info.I_body_inv.vec.fvec.xyz.z = objp->phys_info.I_body_inv.vec.rvec.xyz.x;
objp->hull_strength = asip->initial_asteroid_strength * (0.8f + (float)Game_skill_level/NUM_SKILL_LEVELS)/2.0f;
// ensure vel is valid
Assert( !vm_is_vec_nan(&objp->phys_info.vel) );
@@ -652,9 +671,11 @@ void asteroid_sub_create(object *parent_objp, int asteroid_type, vector *relvec)
if (new_objp == NULL)
return;
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER ){
send_asteroid_create( new_objp, parent_objp, asteroid_type, relvec );
}
#endif
// Now, bash some values.
vm_vec_scale_add(&new_objp->pos, &parent_objp->pos, relvec, 0.5f * parent_objp->radius);
@@ -859,38 +880,40 @@ void asteroid_level_init()
// 0 from this function. We will force a wrap on the clients when server tells us
int asteroid_should_wrap(object *objp, asteroid_field *asfieldp)
{
#ifndef NO_NETWORK
if ( MULTIPLAYER_CLIENT )
return 0;
#endif
if (objp->pos.x < asfieldp->min_bound.x) {
if (objp->pos.xyz.x < asfieldp->min_bound.xyz.x) {
return 1;
}
if (objp->pos.y < asfieldp->min_bound.y) {
if (objp->pos.xyz.y < asfieldp->min_bound.xyz.y) {
return 1;
}
if (objp->pos.z < asfieldp->min_bound.z) {
if (objp->pos.xyz.z < asfieldp->min_bound.xyz.z) {
return 1;
}
if (objp->pos.x > asfieldp->max_bound.x) {
if (objp->pos.xyz.x > asfieldp->max_bound.xyz.x) {
return 1;
}
if (objp->pos.y > asfieldp->max_bound.y) {
if (objp->pos.xyz.y > asfieldp->max_bound.xyz.y) {
return 1;
}
if (objp->pos.z > asfieldp->max_bound.z) {
if (objp->pos.xyz.z > asfieldp->max_bound.xyz.z) {
return 1;
}
// check against inner bound
if (asfieldp->has_inner_bound) {
if ( (objp->pos.x > asfieldp->inner_min_bound.x) && (objp->pos.x < asfieldp->inner_max_bound.x)
&& (objp->pos.y > asfieldp->inner_min_bound.y) && (objp->pos.y < asfieldp->inner_max_bound.y)
&& (objp->pos.z > asfieldp->inner_min_bound.z) && (objp->pos.z < asfieldp->inner_max_bound.z) ) {
if ( (objp->pos.xyz.x > asfieldp->inner_min_bound.xyz.x) && (objp->pos.xyz.x < asfieldp->inner_max_bound.xyz.x)
&& (objp->pos.xyz.y > asfieldp->inner_min_bound.xyz.y) && (objp->pos.xyz.y < asfieldp->inner_max_bound.xyz.y)
&& (objp->pos.xyz.z > asfieldp->inner_min_bound.xyz.z) && (objp->pos.xyz.z < asfieldp->inner_max_bound.xyz.z) ) {
return 1;
}
@@ -902,28 +925,28 @@ int asteroid_should_wrap(object *objp, asteroid_field *asfieldp)
// Wrap an asteroid from one end of the asteroid field to the other
void asteroid_wrap_pos(object *objp, asteroid_field *asfieldp)
{
if (objp->pos.x < asfieldp->min_bound.x) {
objp->pos.x = asfieldp->max_bound.x + (objp->pos.x - asfieldp->min_bound.x);
if (objp->pos.xyz.x < asfieldp->min_bound.xyz.x) {
objp->pos.xyz.x = asfieldp->max_bound.xyz.x + (objp->pos.xyz.x - asfieldp->min_bound.xyz.x);
}
if (objp->pos.y < asfieldp->min_bound.y) {
objp->pos.y = asfieldp->max_bound.y + (objp->pos.y - asfieldp->min_bound.y);
if (objp->pos.xyz.y < asfieldp->min_bound.xyz.y) {
objp->pos.xyz.y = asfieldp->max_bound.xyz.y + (objp->pos.xyz.y - asfieldp->min_bound.xyz.y);
}
if (objp->pos.z < asfieldp->min_bound.z) {
objp->pos.z = asfieldp->max_bound.z + (objp->pos.z - asfieldp->min_bound.z);
if (objp->pos.xyz.z < asfieldp->min_bound.xyz.z) {
objp->pos.xyz.z = asfieldp->max_bound.xyz.z + (objp->pos.xyz.z - asfieldp->min_bound.xyz.z);
}
if (objp->pos.x > asfieldp->max_bound.x) {
objp->pos.x = asfieldp->min_bound.x + (objp->pos.x - asfieldp->max_bound.x);
if (objp->pos.xyz.x > asfieldp->max_bound.xyz.x) {
objp->pos.xyz.x = asfieldp->min_bound.xyz.x + (objp->pos.xyz.x - asfieldp->max_bound.xyz.x);
}
if (objp->pos.y > asfieldp->max_bound.y) {
objp->pos.y = asfieldp->min_bound.y + (objp->pos.y - asfieldp->max_bound.y);
if (objp->pos.xyz.y > asfieldp->max_bound.xyz.y) {
objp->pos.xyz.y = asfieldp->min_bound.xyz.y + (objp->pos.xyz.y - asfieldp->max_bound.xyz.y);
}
if (objp->pos.z > asfieldp->max_bound.z) {
objp->pos.z = asfieldp->min_bound.z + (objp->pos.z - asfieldp->max_bound.z);
if (objp->pos.xyz.z > asfieldp->max_bound.xyz.z) {
objp->pos.xyz.z = asfieldp->min_bound.xyz.z + (objp->pos.xyz.z - asfieldp->max_bound.xyz.z);
}
// wrap on inner bound, check all 3 axes as needed, use of rand ok for multiplayer with send_asteroid_throw()
@@ -962,9 +985,9 @@ void asteroid_aim_at_target(object *objp, object *asteroid_objp, float delta_tim
vm_vec_rand_vec_quick(&rand_vec);
vm_vec_scale_add2(&predicted_center_pos, &rand_vec, objp->radius/2.0f);
vm_vec_add2(&rand_vec, &objp->orient.fvec);
vm_vec_add2(&rand_vec, &objp->orient.vec.fvec);
if (vm_vec_mag_quick(&rand_vec) < 0.1f)
vm_vec_add2(&rand_vec, &objp->orient.rvec);
vm_vec_add2(&rand_vec, &objp->orient.vec.rvec);
vm_vec_normalize(&rand_vec);
speed = Asteroid_info[0].max_speed * (frand()/2.0f + 0.5f);
@@ -1017,9 +1040,11 @@ void maybe_throw_asteroid(int count)
// this line gives too many collision pairs.
// asteroid_update_collide(objp);
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER ) {
send_asteroid_throw( objp );
}
#endif
}
}
@@ -1071,7 +1096,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
// only wrap if player won't see asteroid disappear/reverse direction
dist = vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.fvec, &vec_to_asteroid);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
if ((dot < 0.7f) || (dist > 3000.0f)) {
if (Num_asteroids > MAX_ASTEROIDS-10) {
@@ -1082,7 +1107,7 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
Asteroids[objp->instance].target_objnum = -1;
vm_vec_normalized_dir(&vec_to_asteroid, &objp->pos, &Eye_position);
dot = vm_vec_dot(&Eye_matrix.fvec, &vec_to_asteroid);
dot = vm_vec_dot(&Eye_matrix.vec.fvec, &vec_to_asteroid);
dist = vm_vec_dist_quick(&objp->pos, &Eye_position);
if (( dot > 0.7f) && (dist < 3000.0f)) {
@@ -1098,8 +1123,10 @@ void asteroid_maybe_reposition(object *objp, asteroid_field *asfieldp)
asteroid_update_collide(objp);
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER )
send_asteroid_throw( objp );
#endif
}
}
}
@@ -1119,12 +1146,12 @@ void asteroid_process_pre( object *objp, float frame_time)
v = &objp->phys_info.vel;
vv = &objp->phys_info.desired_vel;
//nprintf(("AI", "Frm %i: Obj #%2i: Hull: %5.1f Vel: %5.1f %5.1f %5.1f Des: %5.1f %5.1f %5.1f\n", Framecount, objp-Objects, objp->hull_strength, v->x, v->y, v->z, vv->x, vv->y, vv->z));
//nprintf(("AI", "Frm %i: Obj #%2i: Hull: %5.1f Vel: %5.1f %5.1f %5.1f Des: %5.1f %5.1f %5.1f\n", Framecount, objp-Objects, objp->hull_strength, v->xyz.x, v->xyz.y, v->xyz.z, vv->xyz.x, vv->xyz.y, vv->xyz.z));
// Make vel chase desired_vel
lerp(&objp->phys_info.vel.x, objp->phys_info.vel.x, objp->phys_info.desired_vel.x, flFrametime);
lerp(&objp->phys_info.vel.y, objp->phys_info.vel.y, objp->phys_info.desired_vel.y, flFrametime);
lerp(&objp->phys_info.vel.z, objp->phys_info.vel.z, objp->phys_info.desired_vel.z, flFrametime);
lerp(&objp->phys_info.vel.xyz.x, objp->phys_info.vel.xyz.x, objp->phys_info.desired_vel.xyz.x, flFrametime);
lerp(&objp->phys_info.vel.xyz.y, objp->phys_info.vel.xyz.y, objp->phys_info.desired_vel.xyz.y, flFrametime);
lerp(&objp->phys_info.vel.xyz.z, objp->phys_info.vel.xyz.z, objp->phys_info.desired_vel.xyz.z, flFrametime);
}
}
@@ -1244,7 +1271,8 @@ int asteroid_check_collision(object *pasteroid, object *other_obj, vector *hitpo
pm = model_get(Ships[heavy_obj->instance].modelnum);
// turn off all rotating submodels and test for collision
for (int i=0; i<num_rotating_submodels; i++) {
int i;
for (i=0; i<num_rotating_submodels; i++) {
pm->submodel[submodel_list[i]].blown_off = 1;
}
@@ -1561,9 +1589,11 @@ void asteroid_hit( object * asteroid_obj, object * other_obj, vector * hitpos, f
return;
}
#ifndef NO_NETWORK
if ( MULTIPLAYER_MASTER ){
send_asteroid_hit( asteroid_obj, other_obj, hitpos, damage );
}
#endif
asteroid_obj->hull_strength -= damage;
@@ -1698,8 +1728,9 @@ void asteroid_maybe_break_up(object *asteroid_obj)
// multiplayer clients won't go through the following code. asteroid_sub_create will send
// a create packet to the client in the above named function
#ifndef NO_NETWORK
if ( !MULTIPLAYER_CLIENT ) {
#endif
switch (asp->type) {
case ASTEROID_TYPE_SMALL:
break;
@@ -1746,7 +1777,9 @@ void asteroid_maybe_break_up(object *asteroid_obj)
default:
Int3();
}
#ifndef NO_NETWORK
}
#endif
asp->final_death_time = timestamp(-1);
}
@@ -1850,10 +1883,12 @@ void asteroid_update_collide_flag(object *asteroid_objp)
asp->collide_objnum = -1;
asp->collide_objsig = -1;
#ifndef NO_NETWORK
// multiplayer dogfight
if((Game_mode & GM_MULTIPLAYER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT)){
return;
}
#endif
num_escorts = hud_escort_num_ships_on_list();
@@ -1990,7 +2025,7 @@ void asteroid_parse_section()
stuff_float(&asip->blast);
required_string("$Hitpoints:");
stuff_float(&asip->initial_hull_strength);
stuff_float(&asip->initial_asteroid_strength);
}
// read in data from asteroid.tbl into Asteroid_info[] array
@@ -2070,12 +2105,12 @@ int set_asteroid_throw_objnum()
float radius = ship_objp->radius*2.0f;
if (Ship_info[Ships[ship_objp->instance].ship_info_index].flags & (SIF_HUGE_SHIP | SIF_BIG_SHIP)) {
if (ship_objp->pos.x + radius > Asteroid_field.min_bound.x)
if (ship_objp->pos.y + radius > Asteroid_field.min_bound.y)
if (ship_objp->pos.z + radius > Asteroid_field.min_bound.z)
if (ship_objp->pos.x - radius < Asteroid_field.max_bound.x)
if (ship_objp->pos.y - radius < Asteroid_field.max_bound.y)
if (ship_objp->pos.z - radius < Asteroid_field.max_bound.z)
if (ship_objp->pos.xyz.x + radius > Asteroid_field.min_bound.xyz.x)
if (ship_objp->pos.xyz.y + radius > Asteroid_field.min_bound.xyz.y)
if (ship_objp->pos.xyz.z + radius > Asteroid_field.min_bound.xyz.z)
if (ship_objp->pos.xyz.x - radius < Asteroid_field.max_bound.xyz.x)
if (ship_objp->pos.xyz.y - radius < Asteroid_field.max_bound.xyz.y)
if (ship_objp->pos.xyz.z - radius < Asteroid_field.max_bound.xyz.z)
if (!asteroid_in_inner_bound(&Asteroid_field, &ship_objp->pos, radius))
return so->objnum;
}
+19 -10
View File
@@ -9,13 +9,22 @@
/*
* $Logfile: /Freespace2/code/Asteroid/Asteroid.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-04-29 01:03:22 $
* $Author: Goober5000 $
*
* Header file for asteroids
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -119,8 +128,8 @@
#ifndef __ASTEROID_H__
#define __ASTEROID_H__
#include "ship.h"
#include "parselo.h" // for NAME_LENGTH
#include "ship/ship.h"
#include "parse/parselo.h" // for NAME_LENGTH
struct object;
struct polymodel;
@@ -176,7 +185,7 @@ typedef struct asteroid_info {
float outer_rad; // radius at which no area effect damage is applied
float damage; // maximum damage applied from area effect explosion
float blast; // maximum blast impulse from area effect explosion
float initial_hull_strength; // starting strength of asteroid
float initial_asteroid_strength; // starting strength of asteroid
polymodel *modelp[MAX_ASTEROID_POFS];
int model_num[MAX_ASTEROID_POFS];
} asteroid_info;
@@ -204,13 +213,13 @@ typedef struct asteroid {
typedef enum {
DG_ASTEROID,
DG_SHIP
} debris_genre;
} debris_genre_t;
// TYPEDEF FOR FIELD TYPE
typedef enum {
FT_ACTIVE,
FT_PASSIVE
} field_type;
} field_type_t;
#define MAX_ACTIVE_DEBRIS_TYPES 3
@@ -223,8 +232,8 @@ typedef struct asteroid_field {
vector vel; // Average asteroid moves at this velocity.
float speed; // Average speed of field
int num_initial_asteroids; // Number of asteroids at creation.
field_type field_type; // active throws and wraps, passive does not
debris_genre debris_genre; // type of debris (ship or asteroid) [generic type]
field_type_t field_type; // active throws and wraps, passive does not
debris_genre_t debris_genre; // type of debris (ship or asteroid) [generic type]
int field_debris_type[MAX_ACTIVE_DEBRIS_TYPES]; // one of the debris type defines above
} asteroid_field;
+435 -124
View File
@@ -9,13 +9,107 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* $Revision: 2.15 $
* $Date: 2003-08-16 03:52:22 $
* $Author: bobboau $
*
* Code to load and manage all bitmaps for the game
*
* $Log: not supported by cvs2svn $
* Revision 2.14 2003/08/12 03:18:32 bobboau
* Specular 'shine' mapping;
* useing a phong lighting model I have made specular highlights
* that are mapped to the model,
* rendering them is still slow, but they look real purdy
*
* also 4 new (untested) comand lines, the XX is a floating point value
* -spec_exp XX
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
* -spec_point XX
* -spec_static XX
* -spec_tube XX
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
* static is the local stars,
* point is weapons/explosions/warp in/outs,
* tube is beam weapons,
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
*
* Revision 2.13 2003/06/07 21:08:09 phreak
* bmp_gfx_get_components now works with 32 bit opengl
*
* Revision 2.12 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
*
* Revision 2.11 2003/01/19 01:07:41 bobboau
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
*
* Revision 2.10 2003/01/18 19:55:16 phreak
* fixed around the bmpman system to now accept compressed textures
*
* Revision 2.9 2003/01/09 22:23:38 inquisitor
* Rollback to 2.7 to fix glow code issue that phreak noticed.
* -Quiz
*
* Revision 2.7 2003/01/05 23:41:50 bobboau
* disabled decals (for now), removed the warp ray thingys,
* made some better error mesages while parseing weapons and ships tbls,
* and... oh ya, added glow mapping
*
* Revision 2.6 2002/12/02 23:26:08 Goober5000
* fixed misspelling
*
* Revision 2.5 2002/12/02 20:46:41 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.4 2002/11/22 20:55:27 phreak
* changed around some page-in functions to work with opengl
* changed bm_set_components_opengl
* -phreak
*
* Revision 2.3 2002/11/18 21:27:13 phreak
* added bm_select_components functions for OpenGL -phreak
*
*
* Revision 2.2.2.12 2002/11/04 16:04:20 randomtiger
*
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
*
* Revision 2.2.2.11 2002/11/04 03:02:28 randomtiger
*
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
*
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
*
* Rolled back to an old version of bumpman and made a few changes.
* Added new files: grd3dbumpman.cpp and .h
* Moved the bitmap init function to after the 3D engine is initialised
* Added includes where needed
* Disabled (for now) the D3D8 TGA loading - RT
*
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.4 2002/05/21 15:36:25 mharris
* Added ifdef WIN32
*
* Revision 1.3 2002/05/09 13:49:30 mharris
* Added ifndef NO_DIRECT3D
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -235,7 +329,7 @@
* Added code to print the number of bitmap slots in use between levels.
*
* 82 2/16/98 3:54p John
* Changed a bunch of mprintfs to catagorize to BmpInfo
* Changed a bunch of mprintfs to categorize to BmpInfo
*
* 81 2/13/98 5:00p John
* Made user bitmaps not get wrote to level cache file.
@@ -461,25 +555,35 @@
* $NoKeywords: $
*/
#include "pstypes.h"
#include "pcxutils.h"
#include "bmpman.h"
#include "palman.h"
#include "2d.h"
#include "animplay.h"
#include "timer.h"
#include "systemvars.h"
#include "key.h"
#include "packunpack.h"
#include "cfile.h"
#include "grinternal.h"
#include "tgautils.h"
#include "ship.h"
#include <ctype.h>
#include "globalincs/pstypes.h"
#include "pcxutils/pcxutils.h"
#include "bmpman/bmpman.h"
#include "palman/palman.h"
#include "graphics/2d.h"
#include "anim/animplay.h"
#include "io/timer.h"
#include "globalincs/systemvars.h"
#include "io/key.h"
#include "anim/packunpack.h"
#include "cfile/cfile.h"
#include "graphics/grinternal.h"
#include "tgautils/tgautils.h"
#include "ship/ship.h"
#include "ddsutils/ddsutils.h"
#ifndef NDEBUG
#define BMPMAN_NDEBUG
#endif
extern int Texture_compression_enabled;
int GLOWMAP = -1;
int SPECMAP = -1;
int ENVMAP = -1;
#define MAX_BMAP_SECTION_SIZE 256
// keep this defined to use per-ship nondarkening pixels
#define BMPMAN_SPECIAL_NONDARK
@@ -490,52 +594,9 @@ int bm_inited = 0;
#define BM_TYPE_USER 2
#define BM_TYPE_ANI 3 // in-house ANI format
#define BM_TYPE_TGA 4 // 16 bit targa
typedef union bm_extra_info {
struct {
// Stuff needed for animations
int first_frame; // used for animations -- points to index of first frame
ubyte num_frames; // used for animation -- number of frames in the animation
ubyte fps; // used for animation -- frames per second
} ani;
struct {
// Stuff needed for user bitmaps
void *data; // For user bitmaps, this is where the data comes from
ubyte bpp; // For user bitmaps, this is what format the data is
ubyte flags; // Flags passed to bm_create
} user;
} bm_extra_info;
typedef struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
uint signature; // a unique signature identifying the data
uint palette_checksum; // checksum used to be sure bitmap is in current palette
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
int last_used; // When this bitmap was last used
ubyte type; // PCX, USER, ANI, etc
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
// Stuff to keep track of usage
ubyte preloaded; // If set, then this was loaded from the lst file
ubyte used_flags; // What flags it was accessed thru
// Bitmap info
bitmap bm;
// Data for animations and user bitmaps
bm_extra_info info;
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
int data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
#endif
} bitmap_entry;
#define BM_TYPE_DXT1 5 // 24 bit with switchable alpha (compressed)
#define BM_TYPE_DXT3 6 // 32 bit with 4 bit alpha (compressed)
#define BM_TYPE_DXT5 7 // 32 bit with 8 bit alpha (compressed)
uint Bm_next_signature = 0x1234;
@@ -583,7 +644,7 @@ void bm_set_low_mem( int mode )
}
static int bm_get_next_handle()
int bm_gfx_get_next_handle()
{
int n = bm_next_handle;
bm_next_handle++;
@@ -697,7 +758,7 @@ static void *bm_malloc( int n, int size )
return malloc(size);
}
void bm_close()
void bm_gfx_close()
{
int i;
if ( bm_inited ) {
@@ -709,7 +770,7 @@ void bm_close()
}
void bm_init()
void bm_gfx_init()
{
int i;
@@ -735,8 +796,6 @@ void bm_init()
#endif
bm_free_data(i); // clears flags, bbp, data, etc
}
}
#ifdef BMPMAN_NDEBUG
@@ -744,7 +803,7 @@ void bm_init()
// Returns number of bytes of bitmaps locked this frame
// ntotal = number of bytes of bitmaps locked this frame
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
void bm_get_frame_usage(int *ntotal, int *nnew)
void bm_gfx_get_frame_usage(int *ntotal, int *nnew)
{
int i;
@@ -764,7 +823,7 @@ void bm_get_frame_usage(int *ntotal, int *nnew)
}
#else
void bm_get_frame_usage(int *ntotal, int *nnew)
void bm_gfx_get_frame_usage(int *ntotal, int *nnew)
{
}
#endif
@@ -799,7 +858,7 @@ void bm_calc_sections(bitmap *be)
// bpp you can pass in is 32 or 8. On success, it returns the
// bitmap number. You cannot free that RAM until bm_release
// is called on that bitmap.
int bm_create( int bpp, int w, int h, void * data, int flags )
int bm_gfx_create( int bpp, int w, int h, void * data, int flags )
{
int i, n, first_slot = MAX_BITMAPS;
@@ -831,10 +890,10 @@ int bm_create( int bpp, int w, int h, void * data, int flags )
bm_bitmaps[n].type = BM_TYPE_USER;
bm_bitmaps[n].palette_checksum = 0;
bm_bitmaps[n].bm.w = short(w);
bm_bitmaps[n].bm.h = short(h);
bm_bitmaps[n].bm.rowsize = short(w);
bm_bitmaps[n].bm.bpp = unsigned char(bpp);
bm_bitmaps[n].bm.w = (short) w;
bm_bitmaps[n].bm.h = (short) h;
bm_bitmaps[n].bm.rowsize = (short) w;
bm_bitmaps[n].bm.bpp = (unsigned char) bpp;
bm_bitmaps[n].bm.flags = 0;
bm_bitmaps[n].bm.flags |= flags;
bm_bitmaps[n].bm.data = 0;
@@ -883,16 +942,15 @@ int bm_load_sub(char *real_filename, char *ext, int *handle)
}
// try and find the file
/*
CFILE *test = cfopen(filename, "rb");
if(test != NULL){
cfclose(test);
return 0;
}
*/
// could not be found
return 0;
return -1;
}
// This loads a bitmap so we can draw with it later.
@@ -900,14 +958,16 @@ int bm_load_sub(char *real_filename, char *ext, int *handle)
// the bitmap. On success, it returns the bitmap
// number. Function doesn't acutally load the data, only
// width, height, and possibly flags.
int bm_load( char * real_filename )
int bm_gfx_load( char * real_filename )
{
int i, n, first_slot = MAX_BITMAPS;
int w, h, bpp;
char filename[MAX_FILENAME_LEN];
int tga = 0;
int dds = 0;
int handle;
int found = 0;
unsigned char type;
if ( !bm_inited ) bm_init();
@@ -924,23 +984,51 @@ int bm_load( char * real_filename )
//Int3();
*p = 0;
}
// try and find a compressed tex first
// unless we're cant do so
if (Texture_compression_enabled)
{
switch(bm_load_sub(filename, ".dds", &handle)){
// error
case -1:
break;
// found as a file
case 0:
found = 1;
dds=1;
strcat(filename, ".dds");
break;
// found as pre-existing
case 1:
found = 1;
return handle;
}
}
// try and find the pcx file
switch(bm_load_sub(filename, ".pcx", &handle)){
// error
case -1:
break;
if (!found)
{
// found as a file
case 0:
found = 1;
strcat(filename, ".pcx");
break;
// try and find the pcx file
switch(bm_load_sub(filename, ".pcx", &handle)){
// error
case -1:
break;
// found as a file
case 0:
found = 1;
strcat(filename, ".pcx");
break;
// found as pre-existing
// found as pre-existing
case 1:
found = 1;
return handle;
}
}
if(!found){
@@ -963,13 +1051,45 @@ int bm_load( char * real_filename )
}
}
if (dds)
{
int ct;
int dds_error=dds_read_header ( filename, &w, &h, &bpp, &ct);
if (dds_error != DDS_ERROR_NONE)
{
mprintf(("Couldn't open '%s -- error description %s\n", filename, dds_error_string(dds_error)));
return -1;
}
mprintf(("Found a .dds file! %s\n", filename));
switch (ct)
{
case DDS_DXT1:
type=BM_TYPE_DXT1;
break;
case DDS_DXT3:
type=BM_TYPE_DXT3;
break;
case DDS_DXT5:
type=BM_TYPE_DXT5;
break;
default:
Error(LOCATION, "bad DDS file compression. Not using DXT1,3,5 %s", filename);
return -1;
}
}
// if its a tga file
if(tga){
else if(tga){
int tga_error=targa_read_header( filename, &w, &h, &bpp, NULL );
if ( tga_error != TARGA_ERROR_NONE ) {
mprintf(( "Couldn't open '%s'\n", filename ));
return -1;
}
type = BM_TYPE_TGA;
}
// if its a pcx file
else {
@@ -978,6 +1098,7 @@ int bm_load( char * real_filename )
mprintf(( "Couldn't open '%s'\n", filename ));
return -1;
}
type=BM_TYPE_PCX;
}
// Error( LOCATION, "Unknown bitmap type %s\n", filename );
@@ -1003,7 +1124,7 @@ int bm_load( char * real_filename )
// Mark the slot as filled, because cf_read might load a new bitmap
// into this slot.
bm_bitmaps[n].type = tga ? (ubyte)BM_TYPE_TGA : (ubyte)BM_TYPE_PCX;
bm_bitmaps[n].type = type;
bm_bitmaps[n].signature = Bm_next_signature++;
Assert ( strlen(filename) < MAX_FILENAME_LEN );
strncpy(bm_bitmaps[n].filename, filename, MAX_FILENAME_LEN-1 );
@@ -1028,7 +1149,7 @@ int bm_load( char * real_filename )
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
// _and_ texture format, such as pilot pics and squad logos
int bm_load_duplicate(char *filename)
int bm_gfx_load_duplicate(char *filename)
{
int ret;
@@ -1112,7 +1233,7 @@ static int find_block_of(int n)
//
// returns: bitmap number of first frame in the animation
//
int bm_load_animation( char *real_filename, int *nframes, int *fps, int can_drop_frames)
int bm_gfx_load_animation( char *real_filename, int *nframes, int *fps, int can_drop_frames)
{
int i, n;
anim the_anim;
@@ -1221,7 +1342,7 @@ int bm_load_animation( char *real_filename, int *nframes, int *fps, int can_drop
}
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
void bm_get_info( int handle, int *w, int * h, ubyte * flags, int *nframes, int *fps, bitmap_section_info **sections )
void bm_gfx_get_info( int handle, int *w, int * h, ubyte * flags, int *nframes, int *fps, bitmap_section_info **sections )
{
bitmap * bmp;
@@ -1312,7 +1433,7 @@ static void bm_convert_format( int bitmapnum, bitmap *bmp, ubyte bpp, ubyte flag
g /= Gr_t_green.scale;
b /= Gr_t_blue.scale;
a /= Gr_t_alpha.scale;
((ushort*)bmp->data)[idx] = unsigned short((a<<Gr_t_alpha.shift) | (r << Gr_t_red.shift) | (g << Gr_t_green.shift) | (b << Gr_t_blue.shift));
((ushort*)bmp->data)[idx] = (unsigned short)((a<<Gr_t_alpha.shift) | (r << Gr_t_red.shift) | (g << Gr_t_green.shift) | (b << Gr_t_blue.shift));
break;
default:
Int3();
@@ -1654,6 +1775,35 @@ void bm_lock_tga( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyt
bm_convert_format( bitmapnum, bmp, bpp, flags );
}
//lock a dds file
void bm_lock_dds( int handle, int bitmapnum, bitmap_entry *be, bitmap *bmp, ubyte bpp, ubyte flags )
{
uint data;
int size;
int error;
Assert(Texture_compression_enabled);
Assert(&be->bm == bmp);
#ifdef BMPMAN_NDEBUG
Assert( be->data_size > 0 );
#endif
//data is malloc'ed in the function
error=dds_read_bitmap( be->filename, &size, &data );
if (error != DDS_ERROR_NONE)
{
Error(LOCATION, "error loading %s -- %s", be->filename, dds_error_string(error));
}
bmp->bpp=bpp;
bmp->data=data;
bmp->flags =0;
be->mem_taken=size;
}
MONITOR( NumBitmapPage );
MONITOR( SizeBitmapPage );
@@ -1661,7 +1811,7 @@ MONITOR( SizeBitmapPage );
// that can be accessed until you call bm_unlock. Only lock
// a bitmap when you need it! This will convert it into the
// appropriate format also.
bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
bitmap * bm_gfx_lock( int handle, ubyte bpp, ubyte flags )
{
bitmap *bmp;
bitmap_entry *be;
@@ -1687,9 +1837,19 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
} else {
if(flags & BMP_AABITMAP){
Assert( bpp == 8 );
} else {
} else if ((flags & BMP_TEX_NONCOMP) && (!(flags & BMP_TEX_COMP))) {
Assert( bpp == 16 );
}
else if (flags & BMP_TEX_DXT1){
Assert(bpp==24);
}
else if (flags & (BMP_TEX_DXT3 | BMP_TEX_DXT5)){
Assert(bpp==32);
}
else
{
Assert(0); //?
}
}
}
@@ -1718,11 +1878,11 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
int pal_changed = 0;
int rle_changed = 0;
int fake_xparent_changed = 0;
if ( (bmp->data == NULL) || (bpp != bmp->bpp) || pal_changed || rle_changed || fake_xparent_changed ) {
if ( (bmp->data == 0) || (bpp != bmp->bpp) || pal_changed || rle_changed || fake_xparent_changed ) {
Assert(be->ref_count == 1);
if ( be->type != BM_TYPE_USER ) {
if ( bmp->data == NULL ) {
if ( bmp->data == 0 ) {
nprintf (("BmpMan","Loading %s for the first time.\n", be->filename));
} else if ( bpp != bmp->bpp ) {
nprintf (("BmpMan","Reloading %s from bitdepth %d to bitdepth %d\n", be->filename, bmp->bpp, bpp));
@@ -1772,6 +1932,12 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
bm_lock_tga( handle, bitmapnum, be, bmp, bpp, flags );
break;
case BM_TYPE_DXT1:
case BM_TYPE_DXT3:
case BM_TYPE_DXT5:
bm_lock_dds( handle, bitmapnum, be, bmp, bpp, flags );
break;
default:
Warning(LOCATION, "Unsupported type in bm_lock -- %d\n", be->type );
return NULL;
@@ -1813,7 +1979,7 @@ bitmap * bm_lock( int handle, ubyte bpp, ubyte flags )
// 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 )
void bm_gfx_unlock( int handle )
{
bitmap_entry *be;
bitmap *bmp;
@@ -1846,7 +2012,7 @@ char *bm_get_filename(int handle)
return bm_bitmaps[n].filename;
}
void bm_get_palette(int handle, ubyte *pal, char *name)
void bm_gfx_get_palette(int handle, ubyte *pal, char *name)
{
char *filename;
int w,h;
@@ -1873,7 +2039,7 @@ void bm_get_palette(int handle, ubyte *pal, char *name)
//
// returns: nothing
void bm_release(int handle)
void bm_gfx_release(int handle)
{
bitmap_entry *be;
@@ -1944,7 +2110,7 @@ void bm_release(int handle)
// returns: 0 => unload failed
// 1 => unload successful
//
int bm_unload( int handle )
int bm_gfx_unload( int handle )
{
bitmap_entry *be;
bitmap *bmp;
@@ -1975,7 +2141,7 @@ int bm_unload( int handle )
// unload all used bitmaps
void bm_unload_all()
void bm_gfx_unload_all()
{
int i;
@@ -2034,8 +2200,10 @@ DCF(bmpman,"Shows/changes bitmap caching parameters and usage")
}
}
extern int OGL_inited;
// Marks a texture as being used for this level
void bm_page_in_texture( int bitmapnum, int nframes )
void bm_gfx_page_in_texture( int bitmapnum, int nframes )
{
int i;
for (i=0; i<nframes;i++ ) {
@@ -2043,7 +2211,27 @@ void bm_page_in_texture( int bitmapnum, int nframes )
bm_bitmaps[n+i].preloaded = 1;
if ( D3D_enabled ) {
//check if its compressed
if (OGL_inited)
{
switch (bm_bitmaps[n+i].type)
{
case BM_TYPE_DXT1:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
continue;
case BM_TYPE_DXT3:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
continue;
case BM_TYPE_DXT5:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
continue;
}
}
if ( D3D_enabled || OGL_inited ) {
bm_bitmaps[n+i].used_flags = BMP_TEX_OTHER;
} else {
bm_bitmaps[n+i].used_flags = 0;
@@ -2053,7 +2241,7 @@ void bm_page_in_texture( int bitmapnum, int nframes )
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
void bm_gfx_page_in_nondarkening_texture( int bitmapnum, int nframes )
{
int i;
for (i=0; i<nframes;i++ ) {
@@ -2061,7 +2249,7 @@ void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
bm_bitmaps[n+i].preloaded = 4;
if ( D3D_enabled ) {
if ( D3D_enabled || OGL_inited ) {
bm_bitmaps[n+i].used_flags = BMP_TEX_NONDARK;
} else {
bm_bitmaps[n+i].used_flags = 0;
@@ -2072,7 +2260,7 @@ void bm_page_in_nondarkening_texture( int bitmapnum, int nframes )
// marks a texture as being a transparent textyre used for this level
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_xparent_texture( int bitmapnum, int nframes)
void bm_gfx_page_in_xparent_texture( int bitmapnum, int nframes)
{
int i;
for (i=0; i<nframes;i++ ) {
@@ -2080,7 +2268,26 @@ void bm_page_in_xparent_texture( int bitmapnum, int nframes)
bm_bitmaps[n+i].preloaded = 3;
if ( D3D_enabled ) {
//check if its compressed
if (OGL_inited)
{
switch (bm_bitmaps[n+i].type)
{
case BM_TYPE_DXT1:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT1;
continue;
case BM_TYPE_DXT3:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT3;
continue;
case BM_TYPE_DXT5:
bm_bitmaps[n+i].used_flags = BMP_TEX_DXT5;
continue;
}
}
if ( D3D_enabled || OGL_inited ) {
// bm_bitmaps[n+i].used_flags = BMP_NO_PALETTE_MAP;
bm_bitmaps[n+i].used_flags = BMP_TEX_XPARENT;
} else {
@@ -2090,7 +2297,7 @@ void bm_page_in_xparent_texture( int bitmapnum, int nframes)
}
// Marks an aabitmap as being used for this level
void bm_page_in_aabitmap( int bitmapnum, int nframes )
void bm_gfx_page_in_aabitmap( int bitmapnum, int nframes )
{
int i;
@@ -2099,7 +2306,7 @@ void bm_page_in_aabitmap( int bitmapnum, int nframes )
bm_bitmaps[n+i].preloaded = 2;
if ( D3D_enabled ) {
if ( D3D_enabled || OGL_inited ) {
bm_bitmaps[n+i].used_flags = BMP_AABITMAP;
} else {
bm_bitmaps[n+i].used_flags = 0;
@@ -2110,7 +2317,7 @@ void bm_page_in_aabitmap( int bitmapnum, int nframes )
// Tell the bitmap manager to start keeping track of what bitmaps are used where.
void bm_page_in_start()
void bm_gfx_page_in_start()
{
int i;
@@ -2130,10 +2337,12 @@ void bm_page_in_start()
}
#ifndef NO_DIRECT3D
extern void gr_d3d_preload_init();
extern int gr_d3d_preload(int bitmap_num, int is_aabitmap );
#endif
void bm_page_in_stop()
void bm_gfx_page_in_stop()
{
int i;
int ship_info_index;
@@ -2147,9 +2356,10 @@ void bm_page_in_stop()
Bm_ram_freed = 0;
#endif
#ifndef NO_DIRECT3D
int d3d_preloading = 1;
gr_d3d_preload_init();
#endif
for (i = 0; i < MAX_BITMAPS; i++) {
if ( bm_bitmaps[i].type != BM_TYPE_NONE ) {
@@ -2177,12 +2387,14 @@ void bm_page_in_stop()
}
bm_unlock( bm_bitmaps[i].handle );
#ifndef NO_DIRECT3D
if ( d3d_preloading ) {
if ( !gr_d3d_preload(bm_bitmaps[i].handle, (bm_bitmaps[i].preloaded==2) ) ) {
mprintf(( "Out of VRAM. Done preloading.\n" ));
d3d_preloading = 0;
}
}
#endif
n++;
#ifdef BMPMAN_NDEBUG
@@ -2213,11 +2425,14 @@ void bm_page_in_stop()
Bm_paging = 0;
}
int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
int bm_gfx_get_cache_slot( int bitmap_id, int separate_ani_frames )
{
int n = bitmap_id % MAX_BITMAPS;
Assert( bm_bitmaps[n].handle == bitmap_id ); // INVALID BITMAP HANDLE
if( bm_bitmaps[n].handle != bitmap_id ){//this should rightfully squash the invalid bitmap handel bug for the glow mapping
mprintf(("bitmap handel %d is not equil to bitmap id %d",bm_bitmaps[n].handle,bitmap_id));
return -1; // INVALID BITMAP HANDLE
}
bitmap_entry *be = &bm_bitmaps[n];
@@ -2230,7 +2445,7 @@ int bm_get_cache_slot( int bitmap_id, int separate_ani_frames )
}
// convert a 24 bit value to a 16 bit value
void bm_24_to_16(int bit_24, ushort *bit_16)
void bm_gfx_24_to_16(int bit_24, ushort *bit_16)
{
ubyte *pixel = (ubyte*)&bit_24;
ubyte alpha = 1;
@@ -2238,7 +2453,9 @@ void bm_24_to_16(int bit_24, ushort *bit_16)
bm_set_components((ubyte*)bit_16, (ubyte*)&pixel[0], (ubyte*)&pixel[1], (ubyte*)&pixel[2], &alpha);
}
#ifndef NO_DIRECT3D
extern int D3D_32bit;
#endif
void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a) = NULL;
@@ -2311,6 +2528,22 @@ void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte
}
}
void bm_set_components_opengl(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
{
// rgba
*((ushort*)pixel) |= (ushort)(( (int)*rv / Gr_current_red->scale ) << Gr_current_red->shift);
*((ushort*)pixel) |= (ushort)(( (int)*gv / Gr_current_green->scale ) << Gr_current_green->shift);
*((ushort*)pixel) |= (ushort)(( (int)*bv / Gr_current_blue->scale ) << Gr_current_blue->shift);
*((ushort*)pixel) &= ~(0x8000);
if (*((ushort*)pixel) == (ushort)Gr_current_green->mask) {
*((ushort*)pixel) = 0;
} else {
if(*av){
*((ushort*)pixel) |= 0x8000;
}
}
}
// for selecting pixel formats
void BM_SELECT_SCREEN_FORMAT()
{
@@ -2320,19 +2553,34 @@ void BM_SELECT_SCREEN_FORMAT()
Gr_current_alpha = &Gr_alpha;
// setup pointers
#ifdef _WIN32
if(gr_screen.mode == GR_GLIDE){
bm_set_components = bm_set_components_argb;
} else if(gr_screen.mode == GR_DIRECT3D){
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
bm_set_components = bm_set_components_d3d;
} else {
#ifndef NO_DIRECT3D
if(D3D_32bit){
bm_set_components = bm_set_components_argb_d3d_32_screen;
} else {
bm_set_components = bm_set_components_argb_d3d_16_screen;
}
#else
bm_set_components = bm_set_components_argb_d3d_16_screen;
#endif // ifndef NO_DIRECT3D
}
}
#ifdef USE_OPENGL
else if (gr_screen.mode == GR_OPENGL)
{
bm_set_components = bm_set_components_opengl;
}
#endif
#else
bm_set_components = bm_set_components_argb_d3d_16_screen;
#endif // ifdef WIN32
}
void BM_SELECT_TEX_FORMAT()
@@ -2343,19 +2591,33 @@ void BM_SELECT_TEX_FORMAT()
Gr_current_alpha = &Gr_t_alpha;
// setup pointers
#ifdef _WIN32
if(gr_screen.mode == GR_GLIDE){
bm_set_components = bm_set_components_argb;
} else if(gr_screen.mode == GR_DIRECT3D){
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
bm_set_components = bm_set_components_d3d;
} else {
#ifndef NO_DIRECT3D
if(D3D_32bit){
bm_set_components = bm_set_components_argb_d3d_32_tex;
} else {
bm_set_components = bm_set_components_argb_d3d_16_tex;
}
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif
}
}
#ifdef USE_OPENGL
else if (gr_screen.mode == GR_OPENGL)
{
bm_set_components = bm_set_components_opengl;
}
#endif
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif // ifdef WIN32
}
void BM_SELECT_ALPHA_TEX_FORMAT()
@@ -2366,19 +2628,33 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
Gr_current_alpha = &Gr_ta_alpha;
// setup pointers
#ifdef _WIN32
if(gr_screen.mode == GR_GLIDE){
bm_set_components = bm_set_components_argb;
} else if(gr_screen.mode == GR_DIRECT3D){
if(Bm_pixel_format == BM_PIXEL_FORMAT_D3D){
bm_set_components = bm_set_components_d3d;
} else {
#ifndef NO_DIRECT3D
if(D3D_32bit){
bm_set_components = bm_set_components_argb_d3d_32_tex;
} else {
bm_set_components = bm_set_components_argb_d3d_16_tex;
}
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif
}
}
#ifdef USE_OPENGL
else if (gr_screen.mode == GR_OPENGL)
{
bm_set_components = bm_set_components_opengl;
}
#endif
#else
bm_set_components = bm_set_components_argb_d3d_16_tex;
#endif // ifdef WIN32
}
// set the rgba components of a pixel, any of the parameters can be -1
@@ -2456,15 +2732,15 @@ void bm_set_components(ubyte *pixel, ubyte *rv, ubyte *gv, ubyte *bv, ubyte *av)
*/
// get the rgba components of a pixel, any of the parameters can be NULL
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a)
void bm_gfx_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a)
{
int bit_32 = 0;
// pick a byte size - 32 bits only if 32 bit mode d3d and screen format
if(D3D_32bit && (Gr_current_red == &Gr_red)){
if((gr_screen.bits_per_pixel==32) && (Gr_current_red == &Gr_red)){
bit_32 = 1;
}
if(r != NULL){
if(bit_32){
*r = ubyte(( (*((uint*)pixel) & Gr_current_red->mask)>>Gr_current_red->shift)*Gr_current_red->scale);
@@ -2544,7 +2820,7 @@ void bm_get_filename(int bitmapnum, char *filename)
}
// given a bitmap and a section, return the size (w, h)
void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h)
void bm_gfx_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h)
{
int bw, bh;
bitmap_section_info *sections;
@@ -2562,3 +2838,38 @@ void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h)
*w = sx < (sections->num_x - 1) ? MAX_BMAP_SECTION_SIZE : bw - sections->sx[sx];
*h = sy < (sections->num_y - 1) ? MAX_BMAP_SECTION_SIZE : bh - sections->sy[sy];
}
int bm_is_compressed(int num)
{
int n=num % MAX_BITMAPS;
//duh
if (!Texture_compression_enabled)
return 0;
Assert(num==bm_bitmaps[n].handle);
switch (bm_bitmaps[n].type)
{
case BM_TYPE_DXT1:
return 1;
case BM_TYPE_DXT3:
return 2;
case BM_TYPE_DXT5:
return 3;
}
return 0;
}
//needed only for compressed bitmaps
int bm_get_size(int num)
{
int n=num % MAX_BITMAPS;
if (!bm_is_compressed(num))
return 0;
Assert(num==bm_bitmaps[n].handle);
return bm_bitmaps[n].mem_taken;
}
+185 -31
View File
@@ -9,13 +9,95 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
*
* $Revision: 2.6 $
* $Date: 2003-08-16 03:52:22 $
* $Author: bobboau $
*
* Prototypes for Bitmap Manager functions
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2003/08/12 03:18:32 bobboau
* Specular 'shine' mapping;
* useing a phong lighting model I have made specular highlights
* that are mapped to the model,
* rendering them is still slow, but they look real purdy
*
* also 4 new (untested) comand lines, the XX is a floating point value
* -spec_exp XX
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
* -spec_point XX
* -spec_static XX
* -spec_tube XX
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
* static is the local stars,
* point is weapons/explosions/warp in/outs,
* tube is beam weapons,
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
*
* Revision 2.4 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.3 2003/01/19 01:07:41 bobboau
* redid the way glowmaps are handeled, you now must set the global int GLOWMAP (no longer an array) before you render a poly that uses a glow map then set GLOWMAP to -1 when you're done with, fixed a few other misc bugs it
*
* Revision 2.2 2003/01/18 19:55:16 phreak
* fixed around the bmpman system to now accept compressed textures
*
* Revision 2.1 2003/01/05 23:41:50 bobboau
* disabled decals (for now), removed the warp ray thingys,
* made some better error mesages while parseing weapons and ships tbls,
* and... oh ya, added glow mapping
*
* Revision 2.0.2.10 2002/11/04 21:24:59 randomtiger
*
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
* Cleaned up some more texture stuff enabled console debug for D3D.
*
* Revision 2.0.2.9 2002/11/04 16:04:20 randomtiger
*
* Tided up some bumpman stuff and added a few function points to gr_screen. - RT
*
* Revision 2.0.2.8 2002/11/04 03:02:28 randomtiger
*
* I have made some fairly drastic changes to the bumpman system. Now functionality can be engine dependant.
* This is so D3D8 can call its own loading code that will allow good efficient loading and use of textures that it desparately needs without
* turning bumpman.cpp into a total hook infested nightmare. Note the new bumpman code is still relying on a few of the of the old functions and all of the old bumpman arrays.
*
* I have done this by adding to the gr_screen list of function pointers that are set up by the engines init functions.
* I have named the define calls the same name as the original 'bm_' functions so that I havent had to change names all through the code.
*
* Rolled back to an old version of bumpman and made a few changes.
* Added new files: grd3dbumpman.cpp and .h
* Moved the bitmap init function to after the 3D engine is initialised
* Added includes where needed
* Disabled (for now) the D3D8 TGA loading - RT
*
* Revision 2.0.2.7 2002/10/26 01:24:22 randomtiger
* Fixed debug bitmap compiling bug.
* Fixed tga bug. - RT
*
* Revision 2.0.2.6 2002/10/22 17:46:17 randomtiger
* Fixed new TGA code texturing bug. - RT
*
* Revision 2.0.2.5 2002/10/21 16:33:40 randomtiger
* Added D3D only 32 bit TGA functionality. Will load a texture as big as your graphics card allows. Code not finished yet and will forge the beginnings of the new texture system. - RT
*
* Revision 2.0.2.4 2002/10/19 23:56:39 randomtiger
* Changed generic bitmap code to allow maximum dimensions to be determined by 3D's engines maximum texture size query.
* Defaults to 256 as it was before. Also added base code for reworking the texture code to be more efficient. - RT
*
* Revision 2.0.2.3 2002/10/02 11:40:19 randomtiger
* Bmpmap has been reverted to an old non d3d8 version.
* All d3d8 code is now in the proper place.
* PCX code is now working to an extent. Problems with alpha though.
* Ani's work slowly with alpha problems.
* Also I have done a bit of tidying - RT
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -154,17 +236,82 @@
#ifndef _BMPMAN_H
#define _BMPMAN_H
#ifdef FS2_DEMO
#define MAX_BITMAPS 3500
#else
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
#ifndef NDEBUG
#define BMPMAN_NDEBUG
#endif
#define MAX_BITMAPS 3500 // How many bitmaps the game can handle
// 16 bit pixel formats
#define BM_PIXEL_FORMAT_ARGB 0 // for glide - can assume certain things, like 1555 LFB writes, whee!
#define BM_PIXEL_FORMAT_D3D 1 // d3d - card dependant. booo!
#define BM_PIXEL_FORMAT_ARGB_D3D 2 // this card has nice 1555 textures like Glide - ahhhhh!
#define BM_TYPE_NONE 0
#define BM_TYPE_PCX 1
#define BM_TYPE_USER 2
#define BM_TYPE_ANI 3 // in-house ANI format
#define BM_TYPE_TGA 4 // 16 bit targa
/// Moved from cpp file ///////////////////
// Consider these 'protected' structures and functions that should only be used by special bitmap functions
typedef union bm_extra_info {
struct {
// Stuff needed for animations
int first_frame; // used for animations -- points to index of first frame
ubyte num_frames; // used for animation -- number of frames in the animation
ubyte fps; // used for animation -- frames per second
} ani;
struct {
// Stuff needed for user bitmaps
void *data; // For user bitmaps, this is where the data comes from
ubyte bpp; // For user bitmaps, this is what format the data is
ubyte flags; // Flags passed to bm_create
} user;
} bm_extra_info;
typedef struct bitmap_entry {
// identification
char filename[MAX_FILENAME_LEN]; // filename for this bitmap
uint signature; // a unique signature identifying the data
uint palette_checksum; // checksum used to be sure bitmap is in current palette
int handle; // Handle = id*MAX_BITMAPS + bitmapnum
int last_used; // When this bitmap was last used
ubyte type; // PCX, USER, ANI, etc
signed char ref_count; // Number of locks on bitmap. Can't unload unless ref_count is 0.
// compressed bitmap stuff (.dds) - RT please take a look at this and tell me if we really need it
int mem_taken; // How much memory does this bitmap use? - UnknownPlayer
// Stuff to keep track of usage
ubyte preloaded; // If set, then this was loaded from the lst file
ubyte used_flags; // What flags it was accessed thru
// Bitmap info
bitmap bm;
// Data for animations and user bitmaps
bm_extra_info info;
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
ubyte used_this_frame; // If set, then it was used this frame
int data_size; // How much data this bitmap uses
int used_count; // How many times it was accessed
#endif
} bitmap_entry;
void bm_gfx_init();
void bm_gfx_close();
int bm_gfx_get_cache_slot( int bitmap_id, int separate_ani_frames );
int bm_gfx_get_next_handle();
// 16 bit pixel formats
extern int Bm_pixel_format;
@@ -177,12 +324,12 @@ extern int bm_texture_ram;
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number.
int bm_load(char * filename);
int bm_gfx_load(char * filename);
// special load function. basically allows you to load a bitmap which already exists (by filename).
// this is useful because in some cases we need to have a bitmap which is locked in screen format
// _and_ texture format, such as pilot pics and squad logos
int bm_load_duplicate(char *filename);
int bm_gfx_load_duplicate(char *filename);
// Creates a bitmap that exists in RAM somewhere, instead
// of coming from a disk file. You pass in a pointer to a
@@ -192,29 +339,29 @@ int bm_load_duplicate(char *filename);
// On success, it returns the bitmap number. You cannot
// free that RAM until bm_release is called on that bitmap.
// See example at bottom of this file
int bm_create( int bpp, int w, int h, void * data, int flags = 0);
int bm_gfx_create( int bpp, int w, int h, void * data, int flags = 0);
// Frees up a bitmap's data, but bitmap number 'n' can
// still be used, it will just have to be paged in next
// time it is locked.
int bm_unload( int n );
int bm_gfx_unload( int n );
// Frees up a bitmap's data, and it's slot, so bitmap
// number 'n' cannot be used anymore, and bm_load or
// bm_create might reuse the slot.
void bm_release(int n);
void bm_gfx_release(int n);
// This loads a bitmap sequence so we can draw with it later.
// It returns a negative number if it couldn't load
// the bitmap. On success, it returns the bitmap
// number of the first frame and nframes is set.
extern int bm_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0 );
extern int bm_gfx_load_animation( char * filename, int * nframes, int *fps = NULL, int can_drop_frames = 0 );
// This locks down a bitmap and returns a pointer to a bitmap
// that can be accessed until you call bm_unlock. Only lock
// a bitmap when you need it! This will convert it into the
// appropriate format also.
extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
extern bitmap * bm_gfx_lock( int bitmapnum, ubyte bpp, ubyte flags );
// The signature is a field that gets filled in with
// a unique signature for each bitmap. The signature for each bitmap
@@ -222,32 +369,32 @@ extern bitmap * bm_lock( int bitmapnum, ubyte bpp, ubyte flags );
extern uint bm_get_signature( int bitmapnum);
// Unlocks a bitmap
extern void bm_unlock( int bitmapnum );
extern void bm_gfx_unlock( int bitmapnum );
// Gets info. w,h,or flags,nframes or fps can be NULL if you don't care.
extern void bm_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
extern void bm_gfx_get_info( int bitmapnum, int *w=NULL, int * h=NULL, ubyte * flags=NULL, int *nframes=NULL, int *fps=NULL, bitmap_section_info **sections = NULL );
// get filename
extern void bm_get_filename(int bitmapnum, char *filename);
extern void bm_get_filename(int bitmapnum, char *filename);
// resyncs all the bitmap palette
extern void bm_update();
// call to load all data for all bitmaps that have been requested to be loaded
extern void bm_load_all();
extern void bm_unload_all();
extern void bm_gfx_load_all();
extern void bm_gfx_unload_all();
// call to get the palette for a bitmap
extern void bm_get_palette(int n, ubyte *pal, char *name);
void bm_gfx_get_palette(int n, ubyte *pal, char *name);
// Hacked function to get a pixel from a bitmap.
// Only works good in 8bpp mode.
void bm_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
void bm_gfx_get_pixel( int bitmap, float u, float v, ubyte *r, ubyte *g, ubyte *b );
// Returns number of bytes of bitmaps locked this frame
// ntotal = number of bytes of bitmaps locked this frame
// nnew = number of bytes of bitmaps locked this frame that weren't locked last frame
void bm_get_frame_usage(int *ntotal, int *nnew);
void bm_gfx_get_frame_usage(int *ntotal, int *nnew);
/*
* Example on using bm_create
@@ -294,28 +441,28 @@ void bm_get_frame_usage(int *ntotal, int *nnew);
// Paging stuff
//============================================================================
void bm_page_in_start();
void bm_page_in_stop();
void bm_gfx_page_in_start();
void bm_gfx_page_in_stop();
// Paging code in a library should call these functions
// in its page in function.
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_texture( int bitmapnum, int num_frames=1 );
void bm_gfx_page_in_texture( int bitmapnum, int num_frames=1 );
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_nondarkening_texture( int bitmap, int num_frames=1 );
void bm_gfx_page_in_nondarkening_texture( int bitmap, int num_frames=1 );
// marks a texture as being a transparent textyre used for this level
// Marks a texture as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
void bm_gfx_page_in_xparent_texture( int bitmapnum, int num_frames=1 );
// Marks an aabitmap as being used for this level
// If num_frames is passed, assume this is an animation
void bm_page_in_aabitmap( int bitmapnum, int num_frames=1 );
void bm_gfx_page_in_aabitmap( int bitmapnum, int num_frames=1 );
//
// Mode: 0 = High memory
@@ -330,7 +477,7 @@ void BM_SELECT_TEX_FORMAT();
void BM_SELECT_ALPHA_TEX_FORMAT();
// convert a 24 bit value to a 16 bit value
void bm_24_to_16(int bit_24, ushort *bit_16);
void bm_gfx_24_to_16(int bit_24, ushort *bit_16);
// set the rgba components of a pixel, any of the parameters can be NULL
extern void (*bm_set_components)(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
@@ -342,13 +489,20 @@ void bm_set_components_argb_d3d_16_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *
void bm_set_components_argb_d3d_32_tex(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
// get the rgba components of a pixel, any of the parameters can be NULL
void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
void bm_gfx_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
//============================================================================
// section info stuff
//============================================================================
// given a bitmap and a section, return the size (w, h)
void bm_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
void bm_gfx_get_section_size(int bitmapnum, int sx, int sy, int *w, int *h);
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
extern int SPECMAP; //this holds a reference to a map that is for specular mapping -Bobboau
extern int ENVMAP; //this holds a reference to a map that is for environment mapping -Bobboau
int bm_is_compressed(int num);
int bm_get_size(int num);
#endif
+246 -80
View File
@@ -9,13 +9,77 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.12 $
* $Date: 2003-08-27 01:36:22 $
* $Author: Goober5000 $
*
* Utilities for operating on files
*
* $Log: not supported by cvs2svn $
* Revision 2.11 2003/08/25 04:39:17 Goober5000
* fixed unreachable code
* --Goober5000
*
* Revision 2.10 2003/08/22 07:35:07 bobboau
* specular code should be bugless now,
* cell shadeing has been added activated via the comand line '-cell',
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
*
* Revision 2.9 2003/08/20 08:12:08 wmcoolmon
* Made cfile_delete return 0 on failure, 1 on success
*
* Revision 2.8 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.7 2002/11/10 16:29:53 DTP
* -DTP reworked mod support,
*
* Revision 2.6 2002/11/04 08:32:38 DTP
* Made sure, that VP and Plain files dont get added twice to the search order. Side-effect of Mod support.
*
* Revision 2.5 2002/10/30 06:31:05 DTP
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
*
* Revision 2.4 2002/10/27 23:59:28 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.3.2.1 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 19:04:48 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.7 2002/05/21 15:37:14 mharris
* Cosmetics - reformat Pathtypes to line up again
*
* Revision 1.6 2002/05/17 06:45:53 mharris
* More porting tweaks. It links! but segfaults...
*
* Revision 1.5 2002/05/17 02:56:19 mharris
* first crack at unix compatibity
*
* Revision 1.4 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.3 2002/05/09 22:58:08 mharris
* Added ifdef WIN32 around change-drive functions
*
* Revision 1.2 2002/05/07 13:23:17 mharris
* Port tweaks
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -164,21 +228,31 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <errno.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "pstypes.h"
#include "cfile.h"
#include "encrypt.h"
#ifdef unix
#include <sys/stat.h>
#include <glob.h>
#include <sys/mman.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "parse/encrypt.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "cfilesystem.h"
#include "cfilearchive.h"
#include "osapi.h"
#include "cfile/cfilesystem.h"
#include "cfile/cfilearchive.h"
#include "osapi/osapi.h"
char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
@@ -186,45 +260,47 @@ char Cfile_root_dir[CFILE_ROOT_DIRECTORY_LEN] = "";
// Each path must have a valid parent that can be tracable all the way back to the root
// so that we can create directories when we need to.
//
// Please make sure extensions are all lower-case, or we'll break unix compatibility
//
cf_pathtype Pathtypes[CF_MAX_PATH_TYPES] = {
// What type this is Path Extensions Parent type
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
// What type this is Path Extensions Parent type
{ CF_TYPE_INVALID, NULL, NULL, CF_TYPE_INVALID },
// Root must be index 1!!
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
{ CF_TYPE_DATA, "Data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MAPS, "Data\\Maps", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_TEXT, "Data\\Text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MISSIONS, "Data\\Missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_MODELS, "Data\\Models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "Data\\Tables", ".tbl", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS, "Data\\Sounds", ".wav", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS_8B22K, "Data\\Sounds\\8b22k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_SOUNDS_16B11K, "Data\\Sounds\\16b11k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_VOICE, "Data\\Voice", "", CF_TYPE_DATA },
{ CF_TYPE_VOICE_BRIEFINGS, "Data\\Voice\\Briefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_CMD_BRIEF, "Data\\Voice\\Command_briefings",".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_DEBRIEFINGS, "Data\\Voice\\Debriefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_PERSONAS, "Data\\Voice\\Personas", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_SPECIAL, "Data\\Voice\\Special", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_TRAINING, "Data\\Voice\\Training", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MUSIC, "Data\\Music", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOVIES, "Data\\Movies", ".mve .msb", CF_TYPE_DATA },
{ CF_TYPE_INTERFACE, "Data\\Interface", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_FONT, "Data\\Fonts", ".vf", CF_TYPE_DATA },
{ CF_TYPE_EFFECTS, "Data\\Effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
{ CF_TYPE_HUD, "Data\\Hud", ".ani .pcx .tga", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_MAIN, "Data\\Players", "", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_IMAGES_MAIN, "Data\\Players\\Images", ".pcx", CF_TYPE_PLAYER_MAIN },
{ CF_TYPE_CACHE, "Data\\Cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_PLAYERS, "Data\\Players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_SINGLE_PLAYERS, "Data\\Players\\Single", ".plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MULTI_PLAYERS, "Data\\Players\\Multi", ".plr", CF_TYPE_DATA },
{ CF_TYPE_MULTI_CACHE, "Data\\MultiData", ".pcx .fs2", CF_TYPE_DATA },
{ CF_TYPE_CONFIG, "Data\\Config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_SQUAD_IMAGES_MAIN, "Data\\Players\\Squads", ".pcx", CF_TYPE_DATA },
{ CF_TYPE_DEMOS, "Data\\Demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_CBANIMS, "Data\\CBAnims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "Data\\IntelAnims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_ROOT, "", ".mve", CF_TYPE_ROOT },
{ CF_TYPE_DATA, "data", ".cfg .log .txt", CF_TYPE_ROOT },
{ CF_TYPE_MAPS, "data" DIR_SEPARATOR_STR "maps", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_TEXT, "data" DIR_SEPARATOR_STR "text", ".txt .net", CF_TYPE_DATA },
{ CF_TYPE_MISSIONS, "data" DIR_SEPARATOR_STR "missions", ".fs2 .fc2 .ntl .ssv", CF_TYPE_DATA },
{ CF_TYPE_MODELS, "data" DIR_SEPARATOR_STR "models", ".pof", CF_TYPE_DATA },
{ CF_TYPE_TABLES, "data" DIR_SEPARATOR_STR "tables", ".tbl", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS, "data" DIR_SEPARATOR_STR "sounds", ".wav", CF_TYPE_DATA },
{ CF_TYPE_SOUNDS_8B22K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "8b22k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_SOUNDS_16B11K, "data" DIR_SEPARATOR_STR "sounds" DIR_SEPARATOR_STR "16b11k", ".wav", CF_TYPE_SOUNDS },
{ CF_TYPE_VOICE, "data" DIR_SEPARATOR_STR "voice", "", CF_TYPE_DATA },
{ CF_TYPE_VOICE_BRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "briefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_CMD_BRIEF, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "command_briefings", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_DEBRIEFINGS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "debriefing", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_PERSONAS, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "personas", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_SPECIAL, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "special", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_VOICE_TRAINING, "data" DIR_SEPARATOR_STR "voice" DIR_SEPARATOR_STR "training", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MUSIC, "data" DIR_SEPARATOR_STR "music", ".wav", CF_TYPE_VOICE },
{ CF_TYPE_MOVIES, "data" DIR_SEPARATOR_STR "movies", ".mve .msb", CF_TYPE_DATA },
{ CF_TYPE_INTERFACE, "data" DIR_SEPARATOR_STR "interface", ".pcx .ani .tga", CF_TYPE_DATA },
{ CF_TYPE_FONT, "data" DIR_SEPARATOR_STR "fonts", ".vf", CF_TYPE_DATA },
{ CF_TYPE_EFFECTS, "data" DIR_SEPARATOR_STR "effects", ".ani .pcx .neb .tga", CF_TYPE_DATA },
{ CF_TYPE_HUD, "data" DIR_SEPARATOR_STR "hud", ".ani .pcx .tga", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_MAIN, "data" DIR_SEPARATOR_STR "players", "", CF_TYPE_DATA },
{ CF_TYPE_PLAYER_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "images", ".pcx", CF_TYPE_PLAYER_MAIN },
{ CF_TYPE_CACHE, "data" DIR_SEPARATOR_STR "cache", ".clr .tmp", CF_TYPE_DATA }, //clr=cached color
{ CF_TYPE_PLAYERS, "data" DIR_SEPARATOR_STR "players", ".hcf", CF_TYPE_DATA },
{ CF_TYPE_SINGLE_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "single", ".plr .csg .css", CF_TYPE_PLAYERS },
{ CF_TYPE_MULTI_PLAYERS, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "multi", ".plr", CF_TYPE_DATA },
{ CF_TYPE_MULTI_CACHE, "data" DIR_SEPARATOR_STR "multidata", ".pcx .fs2", CF_TYPE_DATA },
{ CF_TYPE_CONFIG, "data" DIR_SEPARATOR_STR "config", ".cfg", CF_TYPE_DATA },
{ CF_TYPE_SQUAD_IMAGES_MAIN, "data" DIR_SEPARATOR_STR "players" DIR_SEPARATOR_STR "squads", ".pcx", CF_TYPE_DATA },
{ CF_TYPE_DEMOS, "data" DIR_SEPARATOR_STR "demos", ".fsd", CF_TYPE_DATA },
{ CF_TYPE_CBANIMS, "data" DIR_SEPARATOR_STR "cbanims", ".ani", CF_TYPE_DATA },
{ CF_TYPE_INTEL_ANIMS, "data" DIR_SEPARATOR_STR "intelanims", ".ani", CF_TYPE_DATA },
};
@@ -246,7 +322,13 @@ char *Cfile_cdrom_dir = NULL;
int cfget_cfile_block();
CFILE *cf_open_fill_cfblock(FILE * fp, int type);
CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size);
#if defined _WIN32
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type);
#elif defined unix
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type);
#endif
void cf_chksum_long_init();
void cfile_close()
@@ -271,13 +353,13 @@ int cfile_in_root_dir(char *exe_path)
strncpy(path_copy, exe_path, 2047);
// count how many slashes there are in the path
tok = strtok(path_copy, "\\");
tok = strtok(path_copy, DIR_SEPARATOR_STR);
if(tok == NULL){
return 1;
}
do {
token_count++;
tok = strtok(NULL, "\\");
tok = strtok(NULL, DIR_SEPARATOR_STR);
} while(tok != NULL);
// root directory if we have <= 1 slash
@@ -311,12 +393,16 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
// are we in a root directory?
if(cfile_in_root_dir(buf)){
#if defined _WIN32
MessageBox((HWND)NULL, "Freespace2/Fred2 cannot be run from a drive root directory!", "Error", MB_OK);
#elif defined unix
fprintf(stderr, "Error: Freespace2/Fred2 cannot be run from a drive root directory!\n");
#endif
return 1;
}
while (i--) {
if (buf[i] == '\\'){
if (buf[i] == DIR_SEPARATOR_CHAR){
break;
}
}
@@ -325,7 +411,11 @@ int cfile_init(char *exe_dir, char *cdrom_dir)
buf[i] = 0;
cfile_chdir(buf);
} else {
#if defined _WIN32
MessageBox((HWND)NULL, "Error trying to determine executable root directory!", "Error", MB_OK);
#elif defined unix
fprintf(stderr, "Error trying to determine executable root directory!\n");
#endif
return 1;
}
@@ -357,6 +447,7 @@ void cfile_refresh()
}
#ifdef _WIN32
// Changes to a drive if valid.. 1=A, 2=B, etc
// If flag, then changes to it.
// Returns 0 if not-valid, 1 if valid.
@@ -381,6 +472,7 @@ int cfile_chdrive( int DriveNum, int flag )
return Valid;
}
#endif // ifdef WIN32
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type)
@@ -397,14 +489,16 @@ int cfile_push_chdir(int type)
cf_create_default_path_string( dir, type, NULL );
_strlwr(dir);
Drive = strchr(dir, ':');
if (Drive) {
#ifdef _WIN32
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
return 1;
Path = Drive+1;
#endif
} else {
Path = dir;
}
@@ -416,7 +510,9 @@ int cfile_push_chdir(int type)
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
#ifdef _WIN32
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
#endif
return 2;
}
@@ -436,11 +532,12 @@ int cfile_chdir(char *dir)
Drive = strchr(dir, ':');
if (Drive) {
#ifdef _WIN32
if (!cfile_chdrive( *(Drive - 1) - 'a' + 1, 1))
return 1;
Path = Drive+1;
#endif
} else {
Path = dir;
}
@@ -452,7 +549,9 @@ int cfile_chdir(char *dir)
// This chdir might get a critical error!
e = _chdir( Path );
if (e) {
#ifdef _WIN32
cfile_chdrive( OriginalDirectory[0] - 'a' + 1, 1 );
#endif
return 2;
}
@@ -472,7 +571,6 @@ int cfile_flush_dir(int dir_type)
{
int find_handle;
int del_count;
_finddata_t find;
Assert( CF_TYPE_SPECIFIED(dir_type) );
@@ -482,8 +580,10 @@ int cfile_flush_dir(int dir_type)
}
// proceed to delete the files
find_handle = _findfirst( "*", &find );
del_count = 0;
#if defined _WIN32
_finddata_t find;
find_handle = _findfirst( "*", &find );
if (find_handle != -1) {
do {
if (!(find.attrib & _A_SUBDIR) && !(find.attrib & _A_RDONLY)) {
@@ -496,6 +596,27 @@ int cfile_flush_dir(int dir_type)
} while (!_findnext(find_handle, &find));
_findclose( find_handle );
}
#elif defined unix
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob("*", 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
// delete the file
cf_delete(globinfo.gl_pathv[i], dir_type);
// increment the deleted count
del_count++;
}
}
globfree(&globinfo);
}
#endif
// pop the directory back
cfile_pop_dir();
@@ -527,8 +648,8 @@ char *cf_add_ext(char *filename, char *ext)
return path;
}
// Deletes a file.
void cf_delete( char *filename, int dir_type )
// Deletes a file. Returns 0 if an error occurs, 1 on success
int cf_delete( char *filename, int dir_type )
{
char longname[MAX_PATH_LEN];
@@ -540,9 +661,21 @@ void cf_delete( char *filename, int dir_type )
if (fp) {
// delete the file
fclose(fp);
_unlink(longname);
if(_unlink(longname) == -1)
{
//ERROR - file is probably read only
return 0;
}
else
{
return 1;
}
}
else
{
//ERROR - file doesn't exist
return 0;
}
}
@@ -570,13 +703,15 @@ int cf_exist( char *filename, int dir_type )
FILE *fp = fopen(longname, "rb");
if (fp) {
return 1;
// Goober5000 - these were switched, causing the fclose to be unreachable
fclose(fp);
return 1;
}
return 0;
}
#ifdef _WIN32
void cf_attrib(char *filename, int set, int clear, int dir_type)
{
char longname[MAX_PATH_LEN];
@@ -594,6 +729,7 @@ void cf_attrib(char *filename, int set, int clear, int dir_type)
}
}
#endif
int cf_rename(char *old_name, char *name, int dir_type)
{
@@ -677,18 +813,12 @@ extern int game_cd_changed();
CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize)
{
/* Bobboau, what is this doing here? 31 is way too short... - Goober5000
if( strlen(file_path) > 31 )
Error(LOCATION, "file name %s too long, \nmust be less than 31 charicters", file_path);*/
char longname[_MAX_PATH];
// nprintf(("CFILE", "CFILE -- trying to open %s\n", file_path ));
// #if !defined(MULTIPLAYER_BETA_BUILD) && !defined(FS2_DEMO)
// we no longer need to do this, and on machines with crappy-ass drivers it can slow things down horribly.
#if 0
if ( game_cd_changed() ) {
cfile_refresh();
}
#endif
//================================================
// Check that all the parameters make sense
Assert(file_path && strlen(file_path));
@@ -746,6 +876,7 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
// Can't open memory mapped files out of pack files
if ( offset == 0 ) {
#if defined _WIN32
HANDLE hFile;
hFile = CreateFile(longname, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
@@ -753,6 +884,12 @@ CFILE *cfopen(char *file_path, char *mode, int type, int dir_type, bool localize
if (hFile != INVALID_HANDLE_VALUE) {
return cf_open_mapped_fill_cfblock(hFile, dir_type);
}
#elif defined unix
FILE *fp = fopen( longname, "rb" );
if (fp) {
return cf_open_mapped_fill_cfblock(fp, dir_type);
}
#endif
}
} else {
@@ -842,6 +979,7 @@ int cfclose( CFILE * cfile )
result = 0;
if ( cb->data ) {
// close memory mapped file
#if defined _WIN32
result = UnmapViewOfFile((void*)cb->data);
Assert(result);
result = CloseHandle(cb->hInFile);
@@ -849,6 +987,10 @@ int cfclose( CFILE * cfile )
result = CloseHandle(cb->hMapFile);
Assert(result); // Ensure file handle is closed properly
result = 0;
#elif defined unix
result = munmap(cb->data, cb->data_length);
Assert(result);
#endif
} else if ( cb->fp != NULL ) {
Assert(cb->fp != NULL);
@@ -888,7 +1030,13 @@ CFILE *cf_open_fill_cfblock(FILE *fp, int type)
cfbp->fp = fp;
cfbp->dir_type = type;
#if defined _WIN32
cf_init_lowlevel_read_code(cfp,0,filelength(fileno(fp)) );
#elif defined unix
struct stat statbuf;
fstat(fileno(fp), &statbuf);
cf_init_lowlevel_read_code(cfp, 0, statbuf.st_size );
#endif
return cfp;
}
@@ -935,7 +1083,11 @@ CFILE *cf_open_packed_cfblock(FILE *fp, int type, int offset, int size)
//
// returns: ptr CFILE structure.
//
#if defined _WIN32
CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
#elif defined unix
CFILE *cf_open_mapped_fill_cfblock(FILE *fp, int type)
#endif
{
int cfile_block_index;
@@ -951,11 +1103,13 @@ CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
cfp = &Cfile_list[cfile_block_index];
cfp->id = cfile_block_index;
cfbp->fp = NULL;
#if defined _WIN32
cfbp->hInFile = hFile;
#endif
cfbp->dir_type = type;
cf_init_lowlevel_read_code(cfp,0 , 0 );
#if defined _WIN32
cfbp->hMapFile = CreateFileMapping(cfbp->hInFile, NULL, PAGE_READONLY, 0, 0, NULL);
if (cfbp->hMapFile == NULL) {
nprintf(("Error", "Could not create file-mapping object.\n"));
@@ -964,6 +1118,17 @@ CFILE *cf_open_mapped_fill_cfblock(HANDLE hFile, int type)
cfbp->data = (ubyte*)MapViewOfFile(cfbp->hMapFile, FILE_MAP_READ, 0, 0, 0);
Assert( cfbp->data != NULL );
#elif defined unix
cfbp->fp = fp;
cfbp->data = mmap(NULL, // start
cfbp->data_length, // length
PROT_READ, // prot
MAP_SHARED, // flags
fileno(fp), // fd
0); // offset
Assert( cfbp->data != NULL );
#endif
return cfp;
}
}
@@ -1091,14 +1256,14 @@ void cfread_vector(vector *vec, CFILE *file, int ver, vector *deflt)
if (deflt)
*vec = *deflt;
else
vec->x = vec->y = vec->z = 0.0f;
vec->xyz.x = vec->xyz.y = vec->xyz.z = 0.0f;
return;
}
vec->x = cfread_float(file, ver, deflt ? deflt->x : NULL);
vec->y = cfread_float(file, ver, deflt ? deflt->y : NULL);
vec->z = cfread_float(file, ver, deflt ? deflt->z : NULL);
vec->xyz.x = cfread_float(file, ver, deflt ? deflt->xyz.x : 0.0f);
vec->xyz.y = cfread_float(file, ver, deflt ? deflt->xyz.y : 0.0f);
vec->xyz.z = cfread_float(file, ver, deflt ? deflt->xyz.z : 0.0f);
}
void cfread_angles(angles *ang, CFILE *file, int ver, angles *deflt)
@@ -1112,9 +1277,9 @@ void cfread_angles(angles *ang, CFILE *file, int ver, angles *deflt)
return;
}
ang->p = cfread_float(file, ver, deflt ? deflt->p : NULL);
ang->b = cfread_float(file, ver, deflt ? deflt->b : NULL);
ang->h = cfread_float(file, ver, deflt ? deflt->h : NULL);
ang->p = cfread_float(file, ver, deflt ? deflt->p : 0.0f);
ang->b = cfread_float(file, ver, deflt ? deflt->b : 0.0f);
ang->h = cfread_float(file, ver, deflt ? deflt->h : 0.0f);
}
char cfread_char(CFILE *file, int ver, char deflt)
@@ -1193,13 +1358,13 @@ int cfwrite_ubyte(ubyte b, CFILE *file)
int cfwrite_vector(vector *vec, CFILE *file)
{
if(!cfwrite_float(vec->x, file)){
if(!cfwrite_float(vec->xyz.x, file)){
return 0;
}
if(!cfwrite_float(vec->y, file)){
if(!cfwrite_float(vec->xyz.y, file)){
return 0;
}
return cfwrite_float(vec->z, file);
return cfwrite_float(vec->xyz.z, file);
}
int cfwrite_angles(angles *ang, CFILE *file)
@@ -1648,3 +1813,4 @@ int cflush(CFILE *cfile)
+74 -32
View File
@@ -9,13 +9,41 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.7 $
* $Date: 2003-08-20 08:12:08 $
* $Author: wmcoolmon $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2002/11/10 16:29:53 DTP
* -DTP reworked mod support,
*
* Revision 2.5 2002/11/02 23:06:59 DTP
* DOh,uhmm, define error again, this is getting to me.
*
* Revision 2.4 2002/11/02 23:04:46 DTP
* DOh, fixed that define, learn to count DTP :)
*
* Revision 2.3 2002/10/27 23:59:28 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.3 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.2 2002/05/09 22:58:08 mharris
* Added ifdef WIN32 around change-drive functions
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -332,7 +360,17 @@
#define __CFILE_H__
#include <time.h>
#include "pstypes.h"
#include "globalincs/pstypes.h"
#if defined _WIN32
#define DIR_SEPARATOR_CHAR '\\'
#define DIR_SEPARATOR_STR "\\"
#elif defined unix
#define DIR_SEPARATOR_CHAR '/'
#define DIR_SEPARATOR_STR "/"
#else
#error unknown OS
#endif
#define CF_EOF (-1)
@@ -356,44 +394,45 @@ typedef struct {
#define CF_TYPE_ANY -1 // Used to check in any directory
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MISSIONS 5
#define CF_TYPE_MODELS 6
#define CF_TYPE_TABLES 7
#define CF_TYPE_SOUNDS 8
#define CF_TYPE_SOUNDS_8B22K 9
#define CF_TYPE_SOUNDS_16B11K 10
#define CF_TYPE_VOICE 11
#define CF_TYPE_INVALID 0
#define CF_TYPE_ROOT 1 // Root must be 1!!
#define CF_TYPE_DATA 2
#define CF_TYPE_MAPS 3
#define CF_TYPE_TEXT 4
#define CF_TYPE_MISSIONS 5
#define CF_TYPE_MODELS 6
#define CF_TYPE_TABLES 7
#define CF_TYPE_SOUNDS 8
#define CF_TYPE_SOUNDS_8B22K 9
#define CF_TYPE_SOUNDS_16B11K 10
#define CF_TYPE_VOICE 11
#define CF_TYPE_VOICE_BRIEFINGS 12
#define CF_TYPE_VOICE_CMD_BRIEF 13
#define CF_TYPE_VOICE_DEBRIEFINGS 14
#define CF_TYPE_VOICE_PERSONAS 15
#define CF_TYPE_VOICE_SPECIAL 16
#define CF_TYPE_VOICE_SPECIAL 16
#define CF_TYPE_VOICE_TRAINING 17
#define CF_TYPE_MUSIC 18
#define CF_TYPE_MOVIES 19
#define CF_TYPE_INTERFACE 20
#define CF_TYPE_FONT 21
#define CF_TYPE_EFFECTS 22
#define CF_TYPE_HUD 23
#define CF_TYPE_MUSIC 18
#define CF_TYPE_MOVIES 19
#define CF_TYPE_INTERFACE 20
#define CF_TYPE_FONT 21
#define CF_TYPE_EFFECTS 22
#define CF_TYPE_HUD 23
#define CF_TYPE_PLAYER_MAIN 24
#define CF_TYPE_PLAYER_IMAGES_MAIN 25
#define CF_TYPE_CACHE 26
#define CF_TYPE_PLAYERS 27
#define CF_TYPE_CACHE 26
#define CF_TYPE_PLAYERS 27
#define CF_TYPE_SINGLE_PLAYERS 28
#define CF_TYPE_MULTI_PLAYERS 29
#define CF_TYPE_MULTI_PLAYERS 29
#define CF_TYPE_MULTI_CACHE 30
#define CF_TYPE_CONFIG 31
#define CF_TYPE_CONFIG 31
#define CF_TYPE_SQUAD_IMAGES_MAIN 32
#define CF_TYPE_DEMOS 33
#define CF_TYPE_CBANIMS 34
#define CF_TYPE_DEMOS 33
#define CF_TYPE_CBANIMS 34
#define CF_TYPE_INTEL_ANIMS 35
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like
#define CF_MAX_PATH_TYPES 36 // Can be as high as you'd like //DTP; yeah but beware alot of things uses CF_MAX_PATH_TYPES
// TRUE if type is specified and valid
#define CF_TYPE_SPECIFIED(path_type) (((path_type)>CF_TYPE_INVALID) && ((path_type)<CF_MAX_PATH_TYPES))
@@ -443,8 +482,8 @@ int cflush(CFILE *cfile);
// open a file. Once set, you can use minimum version numbers with the read functions.
void cf_set_version( CFILE * cfile, int version );
// Deletes a file.
void cf_delete( char *filename, int dir_type );
// Deletes a file. Returns 0 on error, 1 if successful
int cf_delete( char *filename, int dir_type );
// Same as _access function to read a file's access bits
int cf_access( char *filename, int dir_type, int mode );
@@ -591,7 +630,10 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
// Functions to change directories
int cfile_chdir(char *dir);
#ifdef _WIN32
int cfile_chdrive(int DriveNum, int flag);
#endif
// push current directory on a 'stack' (so we can restore it) and change the directory
int cfile_push_chdir(int type);
+30 -16
View File
@@ -9,14 +9,23 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-03-19 09:05:25 $
* $Author: Goober5000 $
*
* Low-level code for reading data out of large archive files or normal files. All
* reads/seeks come through here.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/29 19:17:21 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -79,17 +88,17 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "pstypes.h"
#include "cfile.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "cfilearchive.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "cfile/cfilearchive.h"
#define CHECK_POSITION
@@ -113,7 +122,8 @@ void cf_init_lowlevel_read_code( CFILE * cfile, int offset, int size )
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position = ftell(cb->fp) - cb->lib_offset;
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
}
@@ -145,8 +155,9 @@ int cfeof(CFILE *cfile)
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
if (cb->raw_position >= cb->size ) {
@@ -176,8 +187,9 @@ int cftell( CFILE * cfile )
Assert(cb->fp != NULL);
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
int raw_position;
raw_position = ftell(cb->fp) - cb->lib_offset;
Assert(raw_position == cb->raw_position);
#endif
return cb->raw_position;
@@ -225,7 +237,8 @@ int cfseek( CFILE *cfile, int offset, int where )
cb->raw_position = goal_position - cb->lib_offset;
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
@@ -271,7 +284,8 @@ int cfread(void *buf, int elsize, int nelem, CFILE *cfile)
}
#if defined(CHECK_POSITION) && !defined(NDEBUG)
int tmp_offset = ftell(cb->fp) - cb->lib_offset;
int tmp_offset;
tmp_offset = ftell(cb->fp) - cb->lib_offset;
Assert(tmp_offset==cb->raw_position);
#endif
+13 -2
View File
@@ -9,14 +9,20 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileArchive.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.1 $
* $Date: 2002-07-07 19:55:58 $
* $Author: penguin $
*
* External def's for CfileArchive.cpp. This should only be used
* internally by cfile stuff.
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/17 02:56:19 mharris
* first crack at unix compatibity
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -60,8 +66,13 @@ typedef struct Cfile_block {
int dir_type; // directory location
FILE *fp; // File pointer if opening an individual file
void *data; // Pointer for memory-mapped file access. NULL if not mem-mapped.
#ifdef _WIN32
HANDLE hInFile; // Handle from CreateFile()
HANDLE hMapFile; // Handle from CreateFileMapping()
#else
// int fd; // file descriptor
size_t data_length; // length of data for mmap
#endif
int lib_offset;
int raw_position;
int size; // for packed files
+13 -7
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileList.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code for doing directory lists and sorts
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/07/29 19:37:21 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -57,16 +63,16 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "pstypes.h"
#include "cfile.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
// Sorts a list of filenames using the specified sorting method (CF_SORT_*).
// n = number of filenames in list to sort
+347 -70
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2003-09-14 18:32:41 $
* $Author: wmcoolmon $
*
* Functions to keep track of and find files that can exist
* on the harddrive, cd-rom, or in a pack file on either of those.
@@ -20,6 +20,45 @@
* all those locations, inherently enforcing precedence orders.
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2003/08/20 08:14:50 wmcoolmon
* Modified find_file_location to speed up file loading.
*
* Revision 2.6 2002/11/10 16:28:08 DTP
* -DTP reworked mod support,
*
* Revision 2.5 2002/10/30 06:29:45 DTP
* doh!, used upper case in include, dont know how much it matters for *nix systems, but here it is
*
* Revision 2.4 2002/10/30 06:26:11 DTP
* 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
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 19:52:48 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.6 2002/05/24 16:44:10 mharris
* Fix unix "find files" operations so they return relative path
*
* Revision 1.5 2002/05/21 15:38:00 mharris
* Unix glob changes -- still needs some work as we are getting full pathnames
*
* Revision 1.4 2002/05/17 23:38:33 mharris
* Fixed silly bug in unix find-files code
*
* Revision 1.3 2002/05/16 06:03:29 mharris
* Unix port changes
*
* Revision 1.2 2002/05/07 13:22:52 mharris
* Added errno.h include
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -85,19 +124,25 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#ifdef _WIN32
#include <io.h>
#include <direct.h>
#include <windows.h>
#include <winbase.h> /* needed for memory mapping of file functions */
#endif
#include "pstypes.h"
//#include "outwnd.h"
//#include "vecmat.h"
//#include "timer.h"
#include "cfile.h"
#include "cfilesystem.h"
#include "localize.h"
#ifdef unix
#include <glob.h>
#include <sys/stat.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "cfile/cfilesystem.h"
#include "localization/localize.h"
#define CF_ROOTTYPE_PATH 0
#define CF_ROOTTYPE_PACK 1
@@ -219,12 +264,14 @@ int cf_get_packfile_count(cf_root *root)
packfile_count = 0;
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
strcpy( filespec, root->path );
if(strlen(Pathtypes[i].path)){
strcat( filespec, Pathtypes[i].path );
strcat( filespec, "\\" );
if(strlen(Pathtypes[i].path)) {
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
// }
}
#if defined _WIN32
strcat( filespec, "*.vp" );
int find_handle;
@@ -242,7 +289,26 @@ int cf_get_packfile_count(cf_root *root)
_findclose( find_handle );
}
}
#elif defined unix
strcat( filespec, "*.[vV][pP]" );
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int 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)) {
packfile_count++;
}
}
globfree(&globinfo);
}
#endif
}
return packfile_count;
}
@@ -288,11 +354,15 @@ void cf_build_pack_list( cf_root *root )
root_index = 0;
for (i=CF_TYPE_ROOT; i<CF_MAX_PATH_TYPES; i++ ) {
strcpy( filespec, root->path );
if(strlen(Pathtypes[i].path)){
strcat( filespec, Pathtypes[i].path );
strcat( filespec, "\\" );
if(strlen(Pathtypes[i].path)) {
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
}
#if defined _WIN32
strcat( filespec, "*.vp" );
int find_handle;
@@ -311,12 +381,13 @@ void cf_build_pack_list( cf_root *root )
// fill in all the proper info
strcpy(rptr_sort->path, root->path);
if(strlen(Pathtypes[i].path)) {
if(strlen(Pathtypes[i].path)){
strcat(rptr_sort->path, Pathtypes[i].path );
strcat(rptr_sort->path, "\\");
strcat(rptr_sort->path, Pathtypes[i].path );
strcat(rptr_sort->path, DIR_SEPARATOR_STR);
}
strcat(rptr_sort->path, find.name );
rptr_sort->roottype = CF_ROOTTYPE_PACK;
rptr_sort->cf_type = i;
@@ -326,6 +397,32 @@ void cf_build_pack_list( cf_root *root )
_findclose( find_handle );
}
#elif defined unix
strcat( filespec, "*.[vV][pP]" );
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int 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)) {
Assert(root_index < temp_root_count);
// get a temp pointer
rptr_sort = &temp_roots_sort[root_index++];
// fill in all the proper info
strcpy(rptr_sort->path, globinfo.gl_pathv[j] );
rptr_sort->roottype = CF_ROOTTYPE_PACK;
rptr_sort->cf_type = i;
}
}
globfree(&globinfo);
}
#endif
}
// these should always be the same
@@ -357,20 +454,27 @@ void cf_build_root_list(char *cdrom_dir)
cf_root *root;
//======================================================
// First, check the current directory.
// strcpy( root->path, "d:\\projects\\freespace\\" );
if(Cmdline_mod) {
strcat(Cmdline_mod, DIR_SEPARATOR_STR);
cf_root *modroot;
modroot = cf_create_root();
strcpy(modroot->path,Cmdline_mod);
modroot->roottype = CF_ROOTTYPE_PATH;
cf_build_pack_list(modroot);
}
root = cf_create_root();
if ( !_getcwd(root->path, CF_MAX_PATHNAME_LENGTH ) ) {
Error(LOCATION, "Can't get current working directory -- %d", errno );
}
// do we already have a slash? as in the case of a root directory install
if(strlen(root->path) && (root->path[strlen(root->path)-1] != '\\')){
strcat(root->path, "\\"); // put trailing backslash on for easier path construction
if(strlen(root->path) && (root->path[strlen(root->path)-1] != DIR_SEPARATOR_CHAR)){
strcat(root->path, DIR_SEPARATOR_STR); // put trailing backslash on for easier path construction
}
root->roottype = CF_ROOTTYPE_PATH;
//======================================================
@@ -423,11 +527,12 @@ void cf_search_root_path(int root_index)
strcpy( search_path, root->path );
if(strlen(Pathtypes[i].path)){
if(strlen(Pathtypes[i].path)) {
strcat( search_path, Pathtypes[i].path );
strcat( search_path, "\\" );
strcat( search_path, DIR_SEPARATOR_STR );
}
#if defined _WIN32
strcat( search_path, "*.*" );
int find_handle;
@@ -463,7 +568,39 @@ void cf_search_root_path(int root_index)
_findclose( find_handle );
}
#elif defined unix
strcat( search_path, "*" );
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(search_path, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int 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)) {
char *ext = strchr(globinfo.gl_pathv[j], '.' );
if ( ext ) {
if ( is_ext_in_list( Pathtypes[i].extensions, ext ) ) {
// Found a file!!!!
cf_file *file = cf_create_file();
strcpy( file->name_ext, globinfo.gl_pathv[j] );
file->root_index = root_index;
file->pathtype_index = i;
file->write_time = statbuf.st_mtime;
file->size = statbuf.st_size;
file->pack_offset = 0; // Mark as a non-packed file
//mprintf(( "Found file '%s'\n", file->name_ext ));
}
}
}
}
globfree(&globinfo);
}
#endif
}
}
@@ -483,15 +620,12 @@ typedef struct VP_FILE {
} VP_FILE;
void cf_search_root_pack(int root_index)
{
int i;
{
cf_root *root = cf_get_root(root_index);
//mprintf(( "Searching root pack '%s'\n", root->path ));
// Open data
// Open data
FILE *fp = fopen( root->path, "rb" );
// Read the file header
if (!fp) {
@@ -511,6 +645,7 @@ void cf_search_root_pack(int root_index)
strcpy( search_path, "" );
// Go through all the files
int i;
for (i=0; i<VP_header.num_files; i++ ) {
VP_FILE find;
@@ -520,13 +655,13 @@ void cf_search_root_pack(int root_index)
if ( !stricmp( find.filename, ".." )) {
int l = strlen(search_path);
char *p = &search_path[l-1];
while( (p > search_path) && (*p != '\\') ) {
while( (p > search_path) && (*p != DIR_SEPARATOR_CHAR) ) {
p--;
}
*p = 0;
} else {
if ( strlen(search_path) ) {
strcat( search_path, "\\" );
strcat( search_path, DIR_SEPARATOR_STR );
}
strcat( search_path, find.filename );
}
@@ -534,38 +669,35 @@ void cf_search_root_pack(int root_index)
//mprintf(( "Current dir = '%s'\n", search_path ));
} else {
int j;
int j;
for (j=CF_TYPE_ROOT; j<CF_MAX_PATH_TYPES; j++ ) {
if ( !stricmp( search_path, Pathtypes[j].path )) {
char *ext = strchr( find.filename, '.' );
if ( ext ) {
if ( is_ext_in_list( Pathtypes[j].extensions, ext ) ) {
// Found a file!!!!
cf_file *file = cf_create_file();
strcpy( file->name_ext, find.filename );
file->root_index = root_index;
file->pathtype_index = j;
file->write_time = find.write_time;
file->size = find.size;
file->pack_offset = find.offset; // Mark as a non-packed file
file->pack_offset = find.offset; // Mark as a packed file
//mprintf(( "Found pack file '%s'\n", file->name_ext ));
}
}
}
}
}
}
fclose(fp);
}
void cf_build_file_list()
{
int i;
@@ -595,10 +727,12 @@ void cf_build_secondary_filelist(char *cdrom_dir)
// Init the path types
for (i=0; i<CF_MAX_PATH_TYPES; i++ ) {
Assert( Pathtypes[i].index == i );
if ( Pathtypes[i].extensions ) {
strlwr(Pathtypes[i].extensions);
}
//Assert( Pathtypes[i].index == i );
// [mharris] can't modify constant strings, why do this anyhow???
// just need to make sure exts are all lc in the definition...
// if ( Pathtypes[i].extensions ) {
// strlwr(Pathtypes[i].extensions);
// }
}
// Init the root blocks
@@ -669,7 +803,15 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
if ( strpbrk(filespec,"/\\:") ) { // do we have a full path already?
FILE *fp = fopen(filespec, "rb" );
if (fp) {
if ( size ) *size = filelength(fileno(fp));
if ( size ) {
#if defined _WIN32
*size = filelength(fileno(fp));
#elif defined unix
struct stat statbuf;
fstat(fileno(fp), &statbuf);
*size = statbuf.st_size;
#endif
}
if ( offset ) *offset = 0;
if ( pack_filename ) {
strcpy( pack_filename, filespec );
@@ -695,21 +837,70 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
}
}
#if defined WIN32
long findhandle;
_finddata_t findstruct;
#endif
for (i=0; i<num_search_dirs; i++ ) {
char longname[MAX_PATH_LEN];
cf_create_default_path_string( longname, search_order[i], filespec, localize );
#if defined _WIN32
if(!Cmdline_safeloading)
{
findhandle = _findfirst(longname, &findstruct);
if (findhandle != -1) {
if ( size ) {
*size = findstruct.size;
}
_findclose(findhandle);
if ( offset ) *offset = 0;
if ( pack_filename ) {
strcpy( pack_filename, longname );
};
return 1;
}
}
else
{
FILE *fp = fopen(longname, "rb" );
if(fp) {
if( size ) {
*size = filelength( fileno(fp) );
}
fclose(fp);
if(offset) *offset = 0;
if( pack_filename ) {
strcpy(pack_filename, longname);
}
return 1;
}
}
#elif defined unix
FILE *fp = fopen(longname, "rb" );
if (fp) {
if ( size ) *size = filelength(fileno(fp));
if (fp) {
if ( size ) {
struct stat statbuf;
fstat(fileno(fp), &statbuf);
*size = statbuf.st_size;
}
fclose(fp);
if ( offset ) *offset = 0;
if ( pack_filename ) {
strcpy( pack_filename, longname );
}
fclose(fp);
}
return 1;
}
#endif
}
// Search the pak files and CD-ROM.
@@ -737,11 +928,11 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
strcpy( pack_filename, r->path );
if ( f->pack_offset < 1 ) {
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
strcat( pack_filename, "\\" );
strcat( pack_filename, DIR_SEPARATOR_STR );
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
// restore original filespec
strcpy(filespec, temp);
@@ -759,17 +950,18 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
if(strlen(Pathtypes[f->pathtype_index].path)){
strcat( pack_filename, Pathtypes[f->pathtype_index].path );
strcat( pack_filename, "\\" );
strcat( pack_filename, DIR_SEPARATOR_STR );
}
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
}
return 0;
return 0;
}
@@ -822,10 +1014,10 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
{
char *ptr;
int i, l, find_handle, num_files = 0, own_flag = 0;
_finddata_t find;
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -840,10 +1032,13 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
cf_create_default_path_string( filespec, pathtype, filter );
#if defined _WIN32
_finddata_t find;
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
do {
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -869,6 +1064,43 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
_findclose( find_handle );
}
#elif defined unix
char base_filespec[MAX_PATH_LEN];
cf_create_default_path_string( base_filespec, pathtype );
int base_filespec_len = strlen(base_filespec);
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
if ( !Get_file_list_filter || (*Get_file_list_filter)(globinfo.gl_pathv[i]) ) {
char *found_file = globinfo.gl_pathv[i];
Assert(strncmp(found_file, base_filespec, base_filespec_len) == 0);
found_file += base_filespec_len;
ptr = strrchr(found_file, '.');
if (ptr)
l = ptr - found_file;
else
l = strlen(found_file);
list[num_files] = (char *)malloc(l + 1);
strncpy(list[num_files], found_file, l);
list[num_files][l] = 0;
if (info)
info[num_files].write_time = statbuf.st_mtime;
num_files++;
}
}
globfree(&globinfo);
}
}
#endif
// Search all the packfiles and CD.
if ( !Skip_packfile_search ) {
@@ -881,8 +1113,9 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
if (num_files >= max)
break;
break;
if ( !cf_matches_spec( filter,f->name_ext)) {
continue;
}
@@ -925,6 +1158,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -958,6 +1192,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -977,15 +1212,18 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
char filespec[MAX_PATH_LEN];
cf_create_default_path_string( filespec, pathtype, filter );
mprintf(("cf_get_file_list_preallocated looking for type=%d, filter=\"%s\"\n",
pathtype, filter));
// Search the default directories
#if defined _WIN32
int find_handle;
_finddata_t find;
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
do {
if (num_files >= max)
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -1010,7 +1248,44 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
_findclose( find_handle );
}
#elif defined unix
char base_filespec[MAX_PATH_LEN];
cf_create_default_path_string( base_filespec, pathtype );
int base_filespec_len = strlen(base_filespec);
glob_t globinfo;
memset(&globinfo, 0, sizeof(globinfo));
int status = glob(filespec, 0, NULL, &globinfo);
if (status == 0) {
for (unsigned int i = 0; i < globinfo.gl_pathc; i++) {
// Determine if this is a regular file
struct stat statbuf;
memset(&statbuf, 0, sizeof(statbuf));
stat(globinfo.gl_pathv[i], &statbuf);
if (S_ISREG(statbuf.st_mode)) {
if ( !Get_file_list_filter || (*Get_file_list_filter)(globinfo.gl_pathv[i]) ) {
char *found_file = globinfo.gl_pathv[i];
Assert(strncmp(found_file, base_filespec, base_filespec_len) == 0);
found_file += base_filespec_len;
strncpy(arr[num_files], found_file, MAX_FILENAME_LEN - 1 );
char *ptr = strrchr(arr[num_files], '.');
if ( ptr ) {
*ptr = 0;
}
if (info) {
info[num_files].write_time = statbuf.st_mtime;
}
num_files++;
}
}
}
globfree(&globinfo);
}
#endif
// Search all the packfiles and CD.
if ( !Skip_packfile_search ) {
@@ -1023,6 +1298,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
}
if (num_files >= max)
break;
if ( !cf_matches_spec( filter,f->name_ext)) {
@@ -1063,6 +1339,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1095,7 +1372,7 @@ void cf_create_default_path_string( char *path, int pathtype, char *filename, bo
// Don't add slash for root directory
if (Pathtypes[pathtype].path[0] != '\0') {
strcat(path, "\\");
strcat(path, DIR_SEPARATOR_STR);
}
// add filename
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
*
* Functions to keep track of and find files that can exist
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Cfilearchiver/CfileArchiver.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
*
* Program to create an archive file for use with cfile stuff
+332 -10
View File
@@ -9,11 +9,156 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.29.2.1 $
* $Date: 2003-09-18 23:40:16 $
* $Author: argv $
* $Revision: 2.29.2.1 $
* $Date: 2003-09-18 23:40:16 $
* $Author: argv $
*
* $Log: not supported by cvs2svn $
* Revision 2.29 2003/09/14 19:00:02 wmcoolmon
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
*
* Revision 2.28 2003/09/14 18:32:24 wmcoolmon
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
*
* Revision 2.27 2003/09/13 06:02:05 Goober5000
* clean rollback of all of argv's stuff
* --Goober5000
*
* Revision 2.25 2003/09/09 17:10:54 matt
* Added -nospec cmd line param to disable specular -Sticks
*
* Revision 2.24 2003/08/22 07:35:08 bobboau
* specular code should be bugless now,
* cell shadeing has been added activated via the comand line '-cell',
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
*
* Revision 2.23 2003/08/21 20:54:37 randomtiger
* Fixed switching - RT
*
* Revision 2.22 2003/08/12 03:18:33 bobboau
* Specular 'shine' mapping;
* useing a phong lighting model I have made specular highlights
* that are mapped to the model,
* rendering them is still slow, but they look real purdy
*
* also 4 new (untested) comand lines, the XX is a floating point value
* -spec_exp XX
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
* -spec_point XX
* -spec_static XX
* -spec_tube XX
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
* static is the local stars,
* point is weapons/explosions/warp in/outs,
* tube is beam weapons,
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
*
* Revision 2.21 2003/08/09 06:07:23 bobboau
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
*
* Revision 2.20 2003/03/29 09:42:05 Goober5000
* made beams default shield piercing again
* also added a beam no pierce command line flag
* and fixed something else which I forgot :P
* --Goober5000
*
* Revision 2.19 2003/03/20 08:24:45 unknownplayer
* Modified the command line options so they are all in lower-case characters.
* Made a slight AI adjustment to how ships choose to attack turrets (they now have a 25% chance of attacking a beam turret which has fired at them from another ship)
*
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
*
* Revision 2.16 2002/12/21 13:39:25 DTP
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
*
* Revision 2.15 2002/12/17 03:08:18 DTP
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
*
* Revision 2.14 2002/12/17 02:22:34 DTP
* wrong name :)
*
* Revision 2.13 2002/12/17 02:21:06 DTP
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
*
* Revision 2.12 2002/12/14 17:09:08 phreak
* added a command line that displays frames per second when enabled.
* use "-fps"
*
* Revision 2.11 2002/11/10 16:32:42 DTP
* -DTP reworked mod support,
*
* Revision 2.10 2002/11/10 16:30:53 DTP
* -DTP reworked mod support,
*
* Revision 2.9 2002/10/27 23:55:36 DTP
* DTP; started basic implementation of mod-support
* plain files only for now. fs2_open.exe -mod X will look for files in fs2/ X /all-legal-subdirectories. no checking/creating dirs yet. directories must be there.
*
* Revision 2.8 2002/10/22 23:02:39 randomtiger
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
*
* Revision 2.7 2002/10/19 03:50:28 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.6 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.4.2.4 2002/11/10 11:32:29 randomtiger
*
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
* When on is now less blury. - RT
*
* Revision 2.4.2.3 2002/11/04 23:53:24 randomtiger
*
* Added new command line parameter -d3dlauncher which brings up the launcher.
* This is needed since FS2 DX8 now stores the last successful details in the registry and
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
*
* Revision 2.4.2.2 2002/11/04 21:24:59 randomtiger
*
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
* Cleaned up some more texture stuff enabled console debug for D3D.
*
* Revision 2.4.2.1 2002/08/27 13:19:02 penguin
* Moved to directx8 branch
*
* Revision 2.5 2002/08/18 19:48:28 randomtiger
* Added new lib files: strmiids and ddraw to get dshow working
* Added new command line parameter to active direct show movie play: -dshowvid
* Uncommented movie_play calls and includes
*
* Revision 2.4 2002/08/07 00:44:13 DTP
* Implented -GF4FIX commandline switch
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 06:35:15 DTP
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.3 2002/05/08 17:29:17 mharris
* more port tweaks
*
* Revision 1.2 2002/05/07 13:22:14 mharris
* added pstypes.h include
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -190,11 +335,12 @@
#include <string.h>
#include <stdlib.h>
#include "cmdline.h"
#include "linklist.h"
#include "systemvars.h"
#include "multi.h"
#include "cfile.h"
#include "globalincs/pstypes.h"
#include "cmdline/cmdline.h"
#include "globalincs/linklist.h"
#include "globalincs/systemvars.h"
#include "network/multi.h"
#include "cfile/cfile.h"
// variables
class cmdline_parm {
@@ -234,6 +380,30 @@ cmdline_parm d3d_32bit("-32bit", NULL);
cmdline_parm mouse_coords("-coords", NULL);
cmdline_parm timeout("-timeout", NULL);
cmdline_parm d3d_window("-window", NULL);
cmdline_parm almission_arg("-almission", NULL); //DTP for autoload Multi mission
cmdline_parm gf4fix_arg("-gf4fix", NULL); //DTP for random tigers GF4fix
cmdline_parm allslev_arg("-allslev", NULL); //Give access to all single player missions
cmdline_parm phreak_arg("-phreak", NULL); // Change to phreaks options including new targetting code
cmdline_parm dnoshowvid_arg("-dnoshowvid", NULL); // Allows video streaming
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
cmdline_parm fps_arg("-fps", NULL);
cmdline_parm d3dlowmem_arg("-d3dlowmem", NULL); //DTP for random tigers GF4fix
cmdline_parm d3dmipmap_arg("-d3dmipmap", NULL);
cmdline_parm beams_no_pierce_shields_arg("-nobeampierce", NULL); // beams do not pierce shields - Goober5000
cmdline_parm fov_arg("-fov", NULL); // comand line FOV -Bobboau
cmdline_parm spec_exp_arg("-spec_exp", NULL); // comand line FOV -Bobboau
cmdline_parm spec_point_arg("-spec_point", NULL); // comand line FOV -Bobboau
cmdline_parm spec_static_arg("-spec_static", NULL); // comand line FOV -Bobboau
cmdline_parm spec_tube_arg("-spec_tube", NULL); // comand line FOV -Bobboau
cmdline_parm safeloading_arg("-safeloading", NULL); //Uses old loading method -C
cmdline_parm nospec_arg("-nospec", NULL); // skip specular highlighting -Sticks
cmdline_parm auto_ets_arg("-auto-ets", NULL); // _argv[-1] - auto ETS.
cmdline_parm no_implicit_disable_auto_target("-no-implicit-disable-auto-target", NULL); // _argv[-1] - don't disable auto targeting when 'target nothing' command is used.
cmdline_parm no_auto_target_turret("-no-auto-target-turret", NULL); // _argv[-1] - don't auto-target turrets.
cmdline_parm sound_from_own_turrets("-sound-from-own-turrets", NULL); // _argv[-1] - play sounds when own turrets fire.
cmdline_parm singular_shields("-singular-shields", NULL); // _argv[-1] - turn on singular shields for all ships.
cmdline_parm cell_arg("-cell", NULL);
int Cmdline_multi_stream_chat_to_file = 0;
int Cmdline_freespace_no_sound = 0;
@@ -251,6 +421,8 @@ char *Cmdline_game_password = NULL;
char *Cmdline_rank_above= NULL;
char *Cmdline_rank_below = NULL;
char *Cmdline_connect_addr = NULL;
char *Cmdline_almission = NULL; //DTP for autoload multi mission.
char *Cmdline_mod = NULL; //DTP for mod arguement
int Cmdline_multi_log = 0;
int Cmdline_server_firing = 0;
int Cmdline_client_dodamage = 0;
@@ -260,10 +432,29 @@ int Cmdline_mouse_coords = 0;
int Cmdline_timeout = -1;
int Cmdline_window = 0;
int Cmdline_gf4fix = 0; // DTP for randomstigers GF4 fix.
int Cmdline_allslev = 0;
int Cmdline_phreak = 0;
int Cmdline_dnoshowvid = 0;
int Cmdline_show_fps = 0;
int Cmdline_safeloading = 0;
int Cmdline_nospec = 0;
int Cmdline_d3dlowmem = 0;
int Cmdline_d3dmipmap = 0;
int Cmdline_beams_no_pierce_shields = 0; // Goober5000
struct argv_options Argv_options; // _argv[-1] - options struct for my stuff, and maybe other people's too.
static cmdline_parm Parm_list(NULL, NULL);
static int Parm_list_inited = 0;
float Cmdline_fov = 0.75f;
extern float VIEWER_ZOOM_DEFAULT;
extern float Viewer_zoom;
int Cmdline_cell = 0;
// Return true if this character is an extra char (white space and quotes)
int is_extra_space(char ch)
@@ -408,10 +599,8 @@ void os_init_cmdline(char *cmdline)
}
os_parse_parms(cmdline);
os_validate_parms(cmdline);
}
@@ -477,9 +666,39 @@ char *cmdline_parm::str()
}
// external entry point into this modules
#ifdef _WIN32
int parse_cmdline(char *cmdline)
#else
int parse_cmdline(int argc, char *argv[])
#endif
{
#ifdef _WIN32
os_init_cmdline(cmdline);
#else
if (argc > 1) {
// kind of silly -- combine arg list into single string for parsing,
// but it fits with the win32-centric existing code.
char *cmdline = NULL;
unsigned int arglen = 0;
int i;
for (i = 1; i < argc; i++)
arglen += strlen(argv[i]);
if (argc > 2)
arglen += argc - 2; // leave room for the separators
cmdline = new char [arglen+1];
i = 1;
strcpy(cmdline, argv[i]);
for ( ; i < argc; i++) {
strcat(cmdline, " ");
strcat(cmdline, argv[i]);
}
os_init_cmdline(cmdline);
delete [] cmdline;
} else {
// no cmdline args
os_init_cmdline("");
}
#endif
// is this a standalone server??
if (standalone_arg.found()) {
@@ -590,6 +809,109 @@ int parse_cmdline(char *cmdline)
if(d3d_window.found()){
Cmdline_window = 1;
}
if(almission_arg.found()){//DTP for autoload mission // developer oritentated
Cmdline_almission = almission_arg.str();
Cmdline_use_last_pilot = 1;
Cmdline_start_netgame = 1;
}
if (gf4fix_arg.found() ) {
Cmdline_gf4fix = 1;
}
if (allslev_arg.found() ) {
Cmdline_allslev = 1;
}
if(phreak_arg.found() ) {
Cmdline_phreak = 1;
}
if(dnoshowvid_arg.found() ) {
Cmdline_dnoshowvid = 1;
}
if(mod_arg.found() ) {
Cmdline_mod = mod_arg.str();
}
if (fps_arg.found())
{
Cmdline_show_fps = 1;
}
if ( safeloading_arg.found() ) {
Cmdline_safeloading = 1;
}
if( d3dlowmem_arg.found() ) {
Cmdline_d3dlowmem = 1;
}
if( d3dmipmap_arg.found() ) {
Cmdline_d3dmipmap = 1;
}
if ( beams_no_pierce_shields_arg.found() ) {
Cmdline_beams_no_pierce_shields = 1;
}
memset(&Argv_options, 0, sizeof(Argv_options));
// _argv[-1] - auto ETS.
if ( auto_ets_arg.found() ) {
Argv_options.auto_ets = 1;
}
// _argv[-1] - don't disable auto targeting when 'target nothing' command is used.
if ( no_implicit_disable_auto_target.found() ) {
Argv_options.no_implicit_disable_auto_target = 1;
}
// _argv[-1] - don't auto-target turrets.
if ( no_auto_target_turret.found() ) {
Argv_options.no_auto_target_turret = 1;
}
// _argv[-1] - play sounds when own turrets fire.
if ( sound_from_own_turrets.found() ) {
Argv_options.sound_from_own_turrets = 1;
}
// _argv[-1] - turn on singular shields for all ships.
if ( singular_shields.found() ) {
Argv_options.singular_shields = 1;
}
if ( fov_arg.found() ) {
Viewer_zoom = VIEWER_ZOOM_DEFAULT = Cmdline_fov = fov_arg.get_float();
}
//specular comand lines
if ( spec_exp_arg.found() ) {
specular_exponent_value = spec_exp_arg.get_float();
}
if ( spec_point_arg.found() ) {
static_point_factor = spec_point_arg.get_float();
}
if ( spec_static_arg.found() ) {
static_light_factor = spec_static_arg.get_float();
}
if ( spec_tube_arg.found() ) {
static_tube_factor = spec_tube_arg.get_float();
}
if ( cell_arg.found() ) {
Cmdline_cell = 1;
}
if ( nospec_arg.found() ) {
Cmdline_nospec = 1;
}
return 1;
}
+167 -3
View File
@@ -5,15 +5,140 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.27.2.1 $
* $Date: 2003-09-18 23:40:16 $
* $Author: argv $
*
* $Log: not supported by cvs2svn $
* Revision 2.27 2003/09/14 19:00:02 wmcoolmon
* Changed "nospec" and "cell" to "Cmdline_nospec" and "Cmdline_cell"
*
* Revision 2.26 2003/09/14 18:32:24 wmcoolmon
* Added "-safeloading" command line parameter, which uses old fs2_retail-style loading code -C
*
* Revision 2.25 2003/09/13 06:02:05 Goober5000
* clean rollback of all of argv's stuff
* --Goober5000
*
* Revision 2.23 2003/08/22 07:35:08 bobboau
* specular code should be bugless now,
* cell shadeing has been added activated via the comand line '-cell',
* 3D shockwave models, and a transparency method I'm calling edge and center alpha that could be usefull for other things, ask for details
*
* Revision 2.22 2003/08/21 20:54:37 randomtiger
* Fixed switching - RT
*
* Revision 2.21 2003/08/12 03:18:33 bobboau
* Specular 'shine' mapping;
* useing a phong lighting model I have made specular highlights
* that are mapped to the model,
* rendering them is still slow, but they look real purdy
*
* also 4 new (untested) comand lines, the XX is a floating point value
* -spec_exp XX
* the n value, you can set this from 0 to 200 (actualy more than that, but this is the recomended range), it will make the highlights bigger or smaller, defalt is 16.0 so start playing around there
* -spec_point XX
* -spec_static XX
* -spec_tube XX
* these are factors for the three diferent types of lights that FS uses, defalt is 1.0,
* static is the local stars,
* point is weapons/explosions/warp in/outs,
* tube is beam weapons,
* for thouse of you who think any of these lights are too bright you can configure them you're self for personal satisfaction
*
* Revision 2.20 2003/08/09 06:07:23 bobboau
* slightly better implementation of the new zbuffer thing, it now checks only three diferent formats defalting to the 16 bit if neither the 24 or 32 bit versions are suported
*
* Revision 2.19 2003/03/29 09:42:05 Goober5000
* made beams default shield piercing again
* also added a beam no pierce command line flag
* and fixed something else which I forgot :P
* --Goober5000
*
* Revision 2.18 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.17 2003/02/22 04:13:17 wmcoolmon
* Added "-dshowvid" command-line option, which must be set in order for movies to play.
*
* Revision 2.16 2002/12/21 13:39:25 DTP
* did bit more house keeping. modfied Phreaks fps cmdline a bit, so that we dont have to specific build code.libs for fred, but can use the same code.lib for both fs2_open.exe and fred2_open.exe
*
* Revision 2.15 2002/12/17 03:08:18 DTP
* fix to Show_framerate. seems it will call an unresolved external error during fred builds. modified my ifndefs a bit, dsw modified to include preprocessor tag FRED.
*
* Revision 2.14 2002/12/17 02:22:34 DTP
* wrong name :)
*
* Revision 2.13 2002/12/17 02:21:06 DTP
* cleaned up after phreak :). it will make a mess in debug builds. added a couple of ifndef _debugs.
*
* Revision 2.12 2002/11/10 16:30:53 DTP
* -DTP reworked mod support,
*
* Revision 2.11 2002/10/31 21:14:16 DTP
* DTP Quickly added something needed to cmdline.h, since otherwise we can not compile the code as it misses some externals. Thought a rollback rolled all back.
*
* Revision 2.10 2002/10/30 20:22:30 inquisitor
* Bad Committ, Rolling back
*
* Revision 2.7 2002/10/22 23:02:39 randomtiger
* Made Phreaks alternative scanning style optional under the command line tag "-phreak"
* Fixed bug that changes HUD colour when targetting debris in a full nebula. - RT
*
* Revision 2.6 2002/10/19 03:50:28 randomtiger
* Added special pause mode for easier action screenshots.
* Added new command line parameter for accessing all single missions in tech room. - RT
*
* Revision 2.5 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.3.2.4 2002/11/10 11:32:29 randomtiger
*
* Made D3D8 mipmapping optional on command line flag -d3dmipmip, off by default.
* When on is now less blury. - RT
*
* Revision 2.3.2.3 2002/11/04 23:53:24 randomtiger
*
* Added new command line parameter -d3dlauncher which brings up the launcher.
* This is needed since FS2 DX8 now stores the last successful details in the registry and
* uses them to choose the adapter and mode to run in unless its windowed or they are not set.
* Added some code for Antialiasing but it messes up the font but hopefully that can be fixed later. - RT
*
* Revision 2.3.2.2 2002/11/04 21:24:59 randomtiger
*
* When running in D3D all ani's are memory mapped for speed, this takes up more memory but stops gametime locking of textures which D3D8 hates.
* Added new command line tag Cmdline_d3dlowmem for people who dont want to make use of this because they have no memory.
* Cleaned up some more texture stuff enabled console debug for D3D.
*
* Revision 2.3.2.1 2002/08/27 13:19:02 penguin
* Moved to directx8 branch
*
* Revision 2.4 2002/08/18 19:48:28 randomtiger
* Added new lib files: strmiids and ddraw to get dshow working
* Added new command line parameter to active direct show movie play: -dshowvid
* Uncommented movie_play calls and includes
*
* Revision 2.3 2002/08/07 00:44:13 DTP
* Implented -GF4FIX commandline switch
*
* Revision 2.2 2002/07/29 06:35:15 DTP
* added -almission commandline arguement, will autoload mission i.e fs2_open.exe -almission kickass will autoload kickass.fs2 which should be a multiplayer mission.
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/08 17:29:17 mharris
* more port tweaks
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -151,7 +276,11 @@
#ifndef FS_CMDLINE_HEADER_FILE
#define FS_CMDLINE_HEADER_FILE
#ifdef _WIN32
int parse_cmdline(char *cmdline);
#else
int parse_cmdline(int argc, char *argv[]);
#endif
// COMMAND LINE SETTINGS
// This section is for reference by all the *_init() functions. For example, the multiplayer init function
@@ -184,5 +313,40 @@ extern int Cmdline_mouse_coords;
extern int Cmdline_timeout;
extern int Cmdline_window;
extern char *Cmdline_almission; //DTP for autoload mission
extern int Cmdline_gf4fix; //DTP for Random tigers GF4fix.
extern int Cmdline_allslev;
extern int Cmdline_phreak;
extern int Cmdline_dnoshowvid; //WMC Toggles movie playing support
extern char *Cmdline_mod; //DTP for mod support
extern int Cmdline_show_fps;//DTP moved here because it is the correct place for it to be.
extern int Cmdline_safeloading;
extern int Cmdline_nospec;
extern int Cmdline_d3dlowmem;
extern int Cmdline_d3dmipmap;
extern int Cmdline_beams_no_pierce_shields; // Goober5000
extern float Cmdline_fov;
extern float static_light_factor;
extern float static_tube_factor;
extern float static_point_factor;
extern double specular_exponent_value;
extern int Cmdline_cell;
// _argv[-1] - use a struct with bitfields to avoid wasting memory.
// Yes, I know this deviates from the usual Volition #define flags.
// This is intentional. Structs with bitfields waste less memory and are easier to understand.
// Also, the ':1' etc is not an initializer; it is a specification of how many bits to use.
struct argv_options {
int auto_ets:1;
int no_implicit_disable_auto_target:1;
int no_auto_target_turret:1;
int sound_from_own_turrets:1;
int singular_shields:1;
};
extern struct argv_options Argv_options;
#endif
+42 -45
View File
@@ -9,13 +9,28 @@
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-03-18 10:07:00 $
* $Author: unknownplayer $
*
* Counter measures. Created by Mike Kulas, May 12, 1997.
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -202,26 +217,26 @@
* $NoKeywords: $
*/
#include "pstypes.h"
#include "systemvars.h"
#include "cmeasure.h"
#include "freespace.h"
#include "vecmat.h"
#include "2d.h"
#include "3d.h"
#include "model.h"
#include "physics.h"
#include "floating.h"
#include "model.h"
#include "ship.h"
#include "timer.h"
#include "fireballs.h"
#include "radar.h"
#include "missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd.h"
#include "objectsnd.h"
#include "sound.h"
#include "staticrand.h"
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "cmeasure/cmeasure.h"
#include "freespace2/freespace.h"
#include "math/vecmat.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "model/model.h"
#include "physics/physics.h"
#include "math/floating.h"
#include "model/model.h"
#include "ship/ship.h"
#include "io/timer.h"
#include "fireball/fireballs.h"
#include "radar/radar.h"
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd/gamesnd.h"
#include "object/objectsnd.h"
#include "sound/sound.h"
#include "math/staticrand.h"
cmeasure_info Cmeasure_info[MAX_CMEASURE_TYPES];
cmeasure Cmeasures[MAX_CMEASURES];
@@ -237,27 +252,9 @@ void cmeasure_init()
{
int i;
if ( !Cmeasure_inited ) {
if ( !Cmeasure_inited )
Cmeasure_inited = 1;
/* // Do all the processing that happens only once
if ( Debris_model < 0 ) {
if (Debris_model>-1) {
polymodel * pm;
pm = model_get(Debris_model);
Debris_num_submodels = pm->n_models;
}
}
for (i=0; i<MAX_SPECIES_NAMES; i++ ) {
Debris_textures[i] = bm_load( Debris_texture_files[i] );
if ( Debris_textures[i] < 0 ) {
Warning( LOCATION, "Couldn't load species %d debris\ntexture, '%s'\n", i, Debris_texture_files[i] );
}
}
*/
}
// Reset everything between levels
Num_cmeasures = 0;
@@ -445,7 +442,7 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
vector vel, rand_vec;
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.fvec, -25.0f);
vm_vec_scale_add(&vel, &source_obj->phys_info.vel, &source_obj->orient.vec.fvec, -25.0f);
static_randvec(arand+1, &rand_vec);
@@ -460,8 +457,8 @@ int cmeasure_create( object * source_obj, vector * pos, int cm_type, int rand_va
obj->phys_info.side_slip_time_const = 10000.0f;
vm_vec_zero(&obj->phys_info.max_vel); // make so he can't turn on his own VOLITION anymore.
obj->phys_info.max_vel.z = -25.0f;
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.fvec, obj->phys_info.max_vel.z );
obj->phys_info.max_vel.xyz.z = -25.0f;
vm_vec_copy_scale(&obj->phys_info.desired_vel, &obj->orient.vec.fvec, obj->phys_info.max_vel.xyz.z );
vm_vec_zero(&obj->phys_info.max_rotvel); // make so he can't change speed on his own VOLITION anymore.
+7 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/CMeasure/CMeasure.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Counter measures. Created by Mike Kulas, May 12, 1997.
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -112,8 +115,8 @@
#ifndef _CMEASURE_H
#define _CMEASURE_H
#include "parselo.h"
#include "object.h"
#include "parse/parselo.h"
#include "object/object.h"
#define MAX_CMEASURES 64
File diff suppressed because it is too large. Load diff
+71 -35
View File
@@ -9,13 +9,37 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-04-05 11:09:21 $
* $Author: Goober5000 $
*
* C module for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2003/03/18 10:07:00 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.4 2002/05/16 06:06:23 mharris
* ifndef NO_JOYSTICK
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* Revision 1.2 2002/05/10 06:08:08 mharris
* Porting... added ifndef NO_SOUND
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -291,31 +315,35 @@
*
*/
#include "freespace.h"
#include "controlsconfig.h"
#include "gamesequence.h"
#include "player.h"
#include "2d.h"
#include "hudsquadmsg.h"
#include "key.h"
#include "timer.h"
#include "freespace2/freespace.h"
#include "controlconfig/controlsconfig.h"
#include "gamesequence/gamesequence.h"
#include "playerman/player.h"
#include "graphics/2d.h"
#include "hud/hudsquadmsg.h"
#include "io/key.h"
#include "io/timer.h"
#include "math.h"
#include "mouse.h"
#include "ui.h"
#include "joy.h"
#include "bmpman.h"
#include "sound.h"
#include "gamesnd.h"
#include "missionscreencommon.h"
#include "font.h"
#include "hud.h"
#include "managepilot.h"
#include "multi_pmsg.h"
#include "contexthelp.h"
#include "popup.h"
#include "uidefs.h"
#include "multiutil.h"
#include "alphacolors.h"
#include "io/mouse.h"
#include "ui/ui.h"
#include "io/joy.h"
#include "bmpman/bmpman.h"
#include "sound/sound.h"
#include "gamesnd/gamesnd.h"
#include "missionui/missionscreencommon.h"
#include "graphics/font.h"
#include "hud/hud.h"
#include "playerman/managepilot.h"
#include "gamehelp/contexthelp.h"
#include "popup/popup.h"
#include "ui/uidefs.h"
#include "globalincs/alphacolors.h"
#include "debugconsole/dbugfile.h"
#ifndef NO_NETWORK
#include "network/multi_pmsg.h"
#include "network/multiutil.h"
#endif
#define NUM_SYSTEM_KEYS 14
#define NUM_BUTTONS 19
@@ -400,7 +428,7 @@ int Conflict_warning_coords[GR_NUM_RESOLUTIONS][2] = {
int Conflict_stamp = -1;
int Conflict_bright = 0;
#define LIST_BUTTONS_MAX 40
#define LIST_BUTTONS_MAX 42
#define JOY_AXIS 0x80000
static int Num_cc_lines;
@@ -1137,12 +1165,15 @@ int control_config_clear_all()
return 0;
}
#ifndef NO_JOYSTICK
extern Joy_info joystick;
#endif
int control_config_axis_default(int axis)
{
Assert(axis >= 0);
#ifndef NO_JOYSTICK
if ( axis > 1 ) {
if (Axis_map_to_defaults[axis] < 0)
return -1;
@@ -1152,6 +1183,9 @@ int control_config_axis_default(int axis)
}
return Axis_map_to_defaults[axis];
#else
return -1;
#endif
}
int control_config_do_reset()
@@ -1328,7 +1362,7 @@ void control_config_do_bind()
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
joy_down_count(i); // clear checking status of all joystick buttons
joy_down_count(i, 1); // clear checking status of all joystick buttons
}
control_config_detect_axis_reset();
@@ -1356,7 +1390,7 @@ void control_config_do_search()
CC_Buttons[gr_screen.res][CANCEL_BUTTON].button.set_hotkey(KEY_ESC);
for (i=0; i<JOY_TOTAL_BUTTONS; i++){
joy_down_count(i); // clear checking status of all joystick buttons
joy_down_count(i, 1); // clear checking status of all joystick buttons
}
Binding_mode = 0;
@@ -1704,7 +1738,7 @@ void control_config_do_frame(float frametime)
bind = 1;
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i))
if (joy_down_count(i, 1))
bind = 1;
if (bind) {
@@ -1785,7 +1819,7 @@ void control_config_do_frame(float frametime)
}
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i)) {
if (joy_down_count(i, 1)) {
z = Cc_lines[Selected_line].cc_index;
Assert(!(z & JOY_AXIS));
control_config_bind_joy(z, i);
@@ -1870,7 +1904,7 @@ void control_config_do_frame(float frametime)
}
for (i=0; i<JOY_TOTAL_BUTTONS; i++)
if (joy_down_count(i)) {
if (joy_down_count(i, 1)) {
j = i;
for (i=0; i<CCFG_MAX; i++)
if (Control_config[i].joy_id == j) {
@@ -2378,13 +2412,15 @@ int check_control(int id, int key)
last_key = key;
#ifndef NO_NETWORK
// if we're in multiplayer text enter (for chat) mode, check to see if we should ignore controls
if ((Game_mode & GM_MULTIPLAYER) && multi_ignore_controls()){
return 0;
}
#endif
if (Control_config[id].type == CC_TYPE_CONTINUOUS) {
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id)) {
if (joy_down(Control_config[id].joy_id) || joy_down_count(Control_config[id].joy_id, 1)) {
control_used(id);
return 1;
}
@@ -2424,7 +2460,7 @@ int check_control(int id, int key)
return 0;
}
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id) || mouse_down_count(1 << Control_config[id].joy_id)) {
if ((Control_config[id].key_id == key) || joy_down_count(Control_config[id].joy_id, 1) || mouse_down_count(1 << Control_config[id].joy_id)) {
control_used(id);
return 1;
}
+25 -5
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2002-12-02 23:52:02 $
* $Author: Goober5000 $
*
* Header file for keyboard, joystick and mouse configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/02 20:47:28 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.2 2002/10/19 19:29:27 bobboau
* inital commit, trying to get most of my stuff into FSO, there should be most of my fighter beam, beam rendering, beam 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
*
* Revision 2.1 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -292,7 +305,7 @@
typedef struct config_item {
short key_default; // default key bound to action
short joy_default; // default joystick button bound to action
char tab; // what tab (catagory) it belongs in
char tab; // what tab (category) it belongs in
char *text; // describes the action in the config screen
char type; // manner control should be checked in
short key_id; // actual key bound to action
@@ -445,8 +458,15 @@ typedef struct config_item {
#define MULTI_SELF_DESTRUCT 106
#define TOGGLE_HUD 107
#define RIGHT_SLIDE_THRUST 108
#define LEFT_SLIDE_THRUST 109
#define UP_SLIDE_THRUST 110
#define DOWN_SLIDE_THRUST 111
// this should be the total number of control action defines above (or last define + 1)
#define CCFG_MAX 107
#define CCFG_MAX 112
extern int Failed_key_index;
extern int Invert_heading;
@@ -9,13 +9,23 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-10-19 19:29:27 $
* $Author: bobboau $
*
* C module for keyboard, joystick and mouse configuration common stuff (between Fred and FreeSpace)
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/10/17 20:40:50 randomtiger
* Added ability to remove HUD ingame on keypress shift O
* So I've added a new key to the bind list and made use of already existing hud removal code.
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -372,10 +382,10 @@
*
*/
#include "controlsconfig.h"
#include "key.h"
#include "joy.h"
#include "localize.h"
#include "controlconfig/controlsconfig.h"
#include "io/key.h"
#include "io/joy.h"
#include "localization/localize.h"
#define TARGET_TAB 0
#define SHIP_TAB 1
@@ -533,6 +543,13 @@ config_item Control_config[CCFG_MAX + 1] = {
{ KEY_SHIFTED | KEY_N, -1, COMPUTER_TAB, "(Multiplayer) Toggle network info"},
{ KEY_SHIFTED | KEY_END, -1, COMPUTER_TAB, "(Multiplayer) Self destruct"},
// Misc
{ KEY_SHIFTED | KEY_O, -1, COMPUTER_TAB, "Toggle HUD"},
{ KEY_SHIFTED | KEY_3, -1, SHIP_TAB, "Right Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_1, -1, SHIP_TAB, "Left Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADPLUS, -1, SHIP_TAB, "Up Thrust", CC_TYPE_CONTINUOUS},
{ KEY_SHIFTED | KEY_PADENTER, -1, SHIP_TAB, "Down Thrust", CC_TYPE_CONTINUOUS},
{ -1, -1, -1, "" }
};
+6 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Cryptstring/cryptstring.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Applet for crypting strings.
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -28,7 +31,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "crypt.h"
#include "globalincs/crypt.h"
int main(int argc, char **argv)
{
+100 -26
View File
@@ -9,13 +9,68 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.7 $
* $Date: 2003-08-21 20:54:38 $
* $Author: randomtiger $
* $Revision: 2.7 $
* $Date: 2003-08-21 20:54:38 $
* $Author: randomtiger $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2003/07/15 02:58:08 phreak
* the cutscene section in the techroom does not append *.mve onto a filename
*
* Revision 2.5 2003/03/18 10:07:01 unknownplayer
* The big DX/main line merge. This has been uploaded to the main CVS since I can't manage to get it to upload to the DX branch. Apologies to all who may be affected adversely, but I'll work to debug it as fast as I can.
*
* Revision 2.4 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.2.2.4 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.2.2.3 2002/08/28 21:47:02 randomtiger
* Tiny change to DX branch to keep movie code optional (default off)
*
* Revision 2.2.2.2 2002/08/28 12:39:35 randomtiger
* OK, this should be a commit to the DX branch or Im going to be in a lot of trouble.
* The movie and dx8show files have been cleaned up big time.
* My debug system is in but has NO EFFECT at all unless a compiler flag is turned on, check h file for details.
* Aside from that a few changes to help the movie code work properly.
* Works on most things including GF4 and Voodoo 3. However may not work properly on a voodoo 2.
* Im going to leave this as a bug for now, serves you right for buying voodoo!
*
* Revision 2.2.2.1 2002/08/27 13:19:26 penguin
* Moved to directx8 branch
*
* Revision 2.3 2002/08/18 19:48:29 randomtiger
* Added new lib files: strmiids and ddraw to get dshow working
* Added new command line parameter to active direct show movie play: -dshowvid
* Uncommented movie_play calls and includes
*
* Revision 2.2 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.4 2002/05/16 00:39:47 mharris
* Added ifdef WIN32 around cd stuff
*
* Revision 1.3 2002/05/13 21:43:37 mharris
* A little more network and sound cleanup
*
* Revision 1.2 2002/05/07 02:57:33 mharris
* make Buttons[] static
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -135,19 +190,20 @@
* $NoKeywords: $
*/
#include "cutscenes.h"
#include "ui.h"
#include "cfile.h"
#include "gamesnd.h"
#include "gamesequence.h"
#include "freespace.h"
#include "key.h"
#include "bmpman.h"
// #include "movie.h"
#include "popup.h"
#include "mainhallmenu.h"
#include "alphacolors.h"
#include "localize.h"
#include "cutscene/cutscenes.h"
#include "ui/ui.h"
#include "cfile/cfile.h"
#include "gamesnd/gamesnd.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "io/key.h"
#include "bmpman/bmpman.h"
#include "movie.h"
#include "popup/popup.h"
#include "menuui/mainhallmenu.h"
#include "globalincs/alphacolors.h"
#include "localization/localize.h"
#include "debugconsole/dbugfile.h"
char *Cutscene_bitmap_name[GR_NUM_RESOLUTIONS] = {
"ViewFootage",
@@ -163,7 +219,7 @@ int Cutscenes_viewable;
int Description_index;
cutscene_info Cutscenes[MAX_CUTSCENES];
extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
//extern int All_movies_enabled; // If set, all movies may be viewed. Keyed off cheat code.
// initialization stuff for cutscenes
void cutscene_init()
@@ -214,6 +270,7 @@ void cutscene_init()
// returns -1 on failure.
int cutscenes_get_cd_num( char *filename )
{
#ifdef _WIN32
#if defined(OEM_BUILD)
return 0; // only 1 cd for OEM
#else
@@ -227,6 +284,9 @@ int cutscenes_get_cd_num( char *filename )
return -1;
#endif // defined(OEM_BUILD)
#else // !WIN32
return -1;
#endif // ifdef WIN32
}
// marks a cutscene as viewable
@@ -263,7 +323,7 @@ static int Background_bitmap;
static UI_BUTTON List_region;
static UI_WINDOW Ui_window;
ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
static ui_button_info Buttons[GR_NUM_RESOLUTIONS][NUM_BUTTONS] = {
{ // GR_640
ui_button_info("TDB_00", 7, 5, 37, 7, 0), // tech database 1
ui_button_info("TDB_01", 7, 19, 37, 23, 1), // tech database 2
@@ -344,6 +404,7 @@ static char *Text_lines[MAX_TEXT_LINES];
int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
{
#ifdef _WIN32
int cd_present = 0;
int cd_drive_num;
int cd_mve_is_on;
@@ -402,7 +463,7 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
if ( num_attempts++ > 5 ) {
cd_present = 0;
break;
}
}
#else
cd_present = 0;
break;
@@ -411,29 +472,42 @@ int cutscenes_validate_cd(char *mve_name, int prompt_for_cd)
}
return cd_present;
#else // !WIN32
return 0;
#endif // ifdef WIN32
}
void cutscenes_screen_play()
{
char name[MAX_FILENAME_LEN], *full_name;
char name[MAX_FILENAME_LEN]; // *full_name
int which_cutscene;
Assert( (Selected_line >= 0) && (Selected_line < Num_files) );
which_cutscene = Cutscene_list[Selected_line];
strcpy(name, Cutscenes[which_cutscene].filename );
full_name = cf_add_ext(name, NOX(".mve"));
// full_name = cf_add_ext(name, NOX(".mve"));
// no soup for you!
/*
int rval = movie_play(full_name);
if(gr_screen.mode != GR_DIRECT3D )
{
gr_activate(0);
}
int rval = movie_play(name);
if(gr_screen.mode != GR_DIRECT3D )
{
gr_activate(1);
}
if ( !rval ) {
char str[256];
sprintf(str, XSTR( "Unable to play movie %s.", 204), Cutscenes[which_cutscene].name );
popup(0, 1, POPUP_OK, str );
}
*/
}
void cutscenes_screen_scroll_line_up()
@@ -585,8 +659,8 @@ void cutscenes_screen_init()
//Cutscenes_viewable = 0xffffffff; // makes all cutscenes viewble.
#endif
if (All_movies_enabled)
Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
// if (All_movies_enabled)
// Cutscenes_viewable = 0xffffffff; // Cheat code enables all movies.
Num_files = 0;
for ( i = 0; i < Num_cutscenes; i++ ) {
+6 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code for the cutscenes viewer screen
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -50,7 +53,7 @@
#ifndef _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#define _FREESPACE_CUTSCENES_SCREEN_HEADER_FILE
#include "parselo.h"
#include "parse/parselo.h"
#define MAX_CUTSCENES 10
+180
View File
@@ -0,0 +1,180 @@
#include <windows.h>
#include "movie.h"
#include "directx/dx8show.h"
#include "osapi/osapi.h"
#include "cmdline/cmdline.h"
#include "graphics/2d.h"
#include "debugconsole/dbugfile.h"
#include "graphics/gropengl.h"
bool movie_shutdown_fgx = false;
void movie_set_shutdown_fgx(bool state)
{
movie_shutdown_fgx = state;
}
bool movie_play(char *name, int unknown_value)
{
// This should not be uncommented
if(Cmdline_dnoshowvid)
{
return true;
}
char full_name[MAX_PATH];
GetCurrentDirectory(MAX_PATH, full_name);
strcat(full_name, "\\");
strcat(full_name, name);
/*
** Check file exists
*/
// Ok - this should be replaced with FS2 cfopen or something - UP
FILE *fp = fopen(full_name,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",full_name);
if(fp == NULL)
{
DBUGFILE_OUTPUT_1("MOVIE ERROR: Cant open movie file %s",full_name);
return false;
}
fclose(fp);
if(movie_shutdown_fgx == true)
{
gr_activate(0);
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_cleanup(0);
}
}
#ifdef _WIN32
os_app_activate_set(false);
dx8show_set_hwnd((void *) os_get_window());
// ShowWindow((HWND) os_get_window(),SW_HIDE);
// ShowWindow((HWND) os_get_window(),SW_MINIMIZE);
dx8show_play_cutscene(name);
// ShowWindow((HWND) os_get_window(),SW_RESTORE);
// ShowWindow((HWND) os_get_window(),SW_SHOW);
os_app_activate_set(true);
/*
// Comment this back in if the freespace window isnt coming back after the movie ends
if((HWND) os_get_window() != NULL)
{
if(GetForegroundWindow() != (HWND) os_get_window())
{
DBUGFILE_OUTPUT_0("Using SetForegroundWindow last");
SetForegroundWindow((HWND) os_get_window());
}
}
*/
#endif // _WIN32
if(movie_shutdown_fgx == true)
{
gr_activate(1);
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_init(1);
}
}
return true;
}
bool movie_play_two(char *name1, char *name2, int unknown_value)
{
bool result = true;
// This should not be uncommented
if(Cmdline_dnoshowvid)
{
return true;
}
/*
** Check file exists
*/
FILE *fp = fopen(name1,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",name1);
if(fp == NULL)
{
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
/*
** Check second file exists
*/
FILE *fp2 = fopen(name2,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",name2);
if(fp2 == NULL)
{
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
return true;
}
fclose(fp2);
}
fclose(fp);
if(movie_shutdown_fgx == true)
{
gr_activate(0);
}
#ifdef _WIN32
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_cleanup();
}
os_app_activate_set(false);
dx8show_play_cutscene(name1);
{
MSG msg;
while(PeekMessage(&msg, (HWND) os_get_window(), 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
dx8show_play_cutscene(name2);
os_app_activate_set(true);
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_init(1);
}
#endif
if(movie_shutdown_fgx == true)
{
gr_activate(1);
}
return result;
}
+8
View File
@@ -0,0 +1,8 @@
#ifndef _MOVIE_HEADER_FILE
#define _MOVIE_HEADER_FILE
void movie_set_shutdown_fgx(bool state);
bool movie_play(char *name, int unknown_value = 0);
bool movie_play_two(char *name1, char *name2, int unknown_value = 0);
#endif
+175
View File
@@ -0,0 +1,175 @@
#include "ddsutils/ddsutils.h"
#include "cfile/cfile.h"
int Texture_compression_enabled=0;
static int dds_read_header_internal(LPDDSURFACEDESC2 lpddsd, char *filename, int *width, int *height, int *bpp, int *compression_type)
{
char code[5];
CFILE *ddsfile;
char real_name[MAX_FILENAME_LEN];
char *p;
int retval=DDS_ERROR_NONE;
int ct;
int bits=0;
//this better not happen.. ever
Assert(filename!=NULL);
//make sure there is an extension
strcpy(real_name, filename);
p=strchr(real_name, '.');
if (p) *p=0;
strcat(real_name, ".dds");
memset(code,0,sizeof(code));
//try to open the file
ddsfile = cfopen(real_name, "rb");
//file not found
if (!ddsfile)
{
return DDS_ERROR_INVALID_FILENAME;
}
//read the code
cfread(code,1,4,ddsfile);
code[4]=0;
//check it
if (strncmp(code,DDS_FILECODE,4)!=0)
{
return DDS_ERROR_BAD_HEADER;
}
//read the header
cfread(lpddsd,sizeof(DDSURFACEDESC2),1,ddsfile);
//stuff important info
if (width) *width=lpddsd->dwWidth;
if (height) *height=lpddsd->dwHeight;
switch(lpddsd->ddpfPixelFormat.dwFourCC)
{
case FOURCC_DXT1:
bits=24;
ct=DDS_DXT1;
break;
case FOURCC_DXT3:
bits=32;
ct=DDS_DXT3;
break;
case FOURCC_DXT5:
bits=32;
ct=DDS_DXT5;
break;
//dxt2 and dxt4 aren't supported
case FOURCC_DXT2:
case FOURCC_DXT4:
retval=DDS_ERROR_INVALID_FORMAT;
ct=DDS_DXT_INVALID;
break;
//none of the above
default:
retval=DDS_ERROR_UNCOMPRESSED;
ct=DDS_DXT_INVALID;
break;
}
if (bpp) *bpp=bits;
if (compression_type) *compression_type=ct;
//close file and return
cfclose(ddsfile);
return retval;
}
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type)
{
DDSURFACEDESC2 ddsd;
return dds_read_header_internal(&ddsd, filename, width, height, bpp, compression_type);
}
//reads pixel info from a dds file
int dds_read_bitmap(char *filename, int *size, uint* data)
{
int retval;
DDSURFACEDESC2 ddsd;
int w,h,ct,bpp;
CFILE *cfp;
ubyte* tmp;
//this must be set
Assert(size!=NULL);
//read the header -- if its at this stage, it should be legal.
retval=dds_read_header_internal(&ddsd, filename, &w, &h, &bpp, &ct);
Assert(retval==DDS_ERROR_NONE);
//get some more info from the surface
*size=ddsd.dwMipMapCount > 1 ? ddsd.dwLinearSize * 2 : ddsd.dwLinearSize;
//open it up and go to the data section
cfp=cfopen(filename,"rb");
cfseek(cfp,DDS_OFFSET, CF_SEEK_SET);
//get the data
tmp=(ubyte*)malloc(*size);
if (!tmp)
{
cfclose(cfp);
return DDS_ERROR_NO_MEM; //barf
}
cfread(tmp,1,*size,cfp);
*data=(uint)tmp;
//we look done here
cfclose(cfp);
return DDS_ERROR_NONE;
}
//returns string representation of DDS_** error code
const char *dds_error_string(int code)
{
switch (code)
{
case DDS_ERROR_NONE:
return "No error";
case DDS_ERROR_NO_MEM:
return "Insufficient memory";
case DDS_ERROR_INVALID_FILENAME:
return "File not found";
case DDS_ERROR_BAD_HEADER:
return "Filecode did not equal \"DDS \"";
case DDS_ERROR_INVALID_FORMAT:
return "File was compressed, but it was DXT2 or DXT4";
case DDS_ERROR_UNCOMPRESSED:
return "*.DDS files must be compressed and use DXT1, DXT3, or DXT5 compression";
default:
return "Abort, retry, fail?";
}
//get a warning otherwise
return "Abort, retry, fail?";
}
+119
View File
@@ -0,0 +1,119 @@
//header file to load .dds files
//these use dxtc texture compression
#ifndef __DDS_H
#define __DDS_H
#include "globalincs/pstypes.h"
#include "directx/vddraw.h"
#define DDS_ERROR_NONE 0 //everything went fine
#define DDS_ERROR_INVALID_FILENAME 1 //bad filename
#define DDS_ERROR_NO_MEM 2 //not enough mem to load
#define DDS_ERROR_UNCOMPRESSED 3 //not using dxtc compression
#define DDS_ERROR_INVALID_FORMAT 4 //can only use dxtc1, dxtc3, dxtc5
#define DDS_ERROR_BAD_HEADER 5 //header was not "DDS "
#define DDS_DXT_INVALID -1
#define DDS_DXT1 1
#define DDS_DXT3 3
#define DDS_DXT5 5
#ifndef MAKEFOURCC
#define MAKEFOURCC(ch0, ch1, ch2, ch3) \
((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) | \
((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
#endif //defined(MAKEFOURCC)
// FOURCC codes for DX compressed-texture pixel formats
#define FOURCC_DXT1 (MAKEFOURCC('D','X','T','1'))
#define FOURCC_DXT2 (MAKEFOURCC('D','X','T','2'))
#define FOURCC_DXT3 (MAKEFOURCC('D','X','T','3'))
#define FOURCC_DXT4 (MAKEFOURCC('D','X','T','4'))
#define FOURCC_DXT5 (MAKEFOURCC('D','X','T','5'))
#define DDS_FILECODE "DDS "
#ifndef DUMMYUNIONNAMEN
#if defined(__cplusplus) || !defined(NONAMELESSUNION)
#define DUMMYUNIONNAMEN(n)
#else
#define DUMMYUNIONNAMEN(n) u##n
#endif
#endif
//these structures are the headers for a dds file
typedef struct _DDSCAPS2
{
DWORD dwCaps; // capabilities of surface wanted
DWORD dwCaps2;
DWORD dwCaps3;
union
{
DWORD dwCaps4;
DWORD dwVolumeDepth;
} DUMMYUNIONNAMEN(1);
} DDSCAPS2;
typedef struct _DDSURFACEDESC2
{
DWORD dwSize; // size of the DDSURFACEDESC structure
DWORD dwFlags; // determines what fields are valid
DWORD dwHeight; // height of surface to be created
DWORD dwWidth; // width of input surface
union
{
LONG lPitch; // distance to start of next line (return value only)
DWORD dwLinearSize; // Formless late-allocated optimized surface size
} DUMMYUNIONNAMEN(1);
union
{
DWORD dwBackBufferCount; // number of back buffers requested
DWORD dwDepth; // the depth if this is a volume texture
} DUMMYUNIONNAMEN(5);
union
{
DWORD dwMipMapCount; // number of mip-map levels requestde
// dwZBufferBitDepth removed, use ddpfPixelFormat one instead
DWORD dwRefreshRate; // refresh rate (used when display mode is described)
DWORD dwSrcVBHandle; // The source used in VB::Optimize
} DUMMYUNIONNAMEN(2);
DWORD dwAlphaBitDepth; // depth of alpha buffer requested
DWORD dwReserved; // reserved
LPVOID lpSurface; // pointer to the associated surface memory
union
{
DDCOLORKEY ddckCKDestOverlay; // color key for destination overlay use
DWORD dwEmptyFaceColor; // Physical color for empty cubemap faces
} DUMMYUNIONNAMEN(3);
DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
DDCOLORKEY ddckCKSrcOverlay; // color key for source overlay use
DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
union
{
DDPIXELFORMAT ddpfPixelFormat; // pixel format description of the surface
DWORD dwFVF; // vertex format description of vertex buffers
} DUMMYUNIONNAMEN(4);
DDSCAPS2 ddsCaps; // direct draw surface capabilities
DWORD dwTextureStage; // stage in multitexture cascade
} DDSURFACEDESC2, FAR* LPDDSURFACEDESC2;
#define DDS_OFFSET 4+sizeof(DDSURFACEDESC2) //place where the data starts -- should be 128
//reads a dds header
//returns one of the error values
//'compression_type' comes back as one of the DDS_DXTC* defines
int dds_read_header(char *filename, int *width, int *height, int *bpp, int *compression_type);
//reads bitmap
//size of the data it stored in size
int dds_read_bitmap(char *filename, int *size, uint* data);
//returns a string from a DDS error code
const char* dds_error_string(int code);
extern int Texture_compression_enabled;
#endif //__DDS_H
+69 -35
View File
@@ -9,13 +9,32 @@
/*
* $Logfile: /Freespace2/code/Debris/Debris.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-04-29 01:03:22 $
* $Author: Goober5000 $
*
* Code for the pieces of exploding object debris.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2003/03/19 12:29:01 unknownplayer
* Woohoo! Killed two birds with one stone!
* Fixed the 'black screen around dialog boxes' problem and also the much more serious freezing problem experienced by Goober5000. It wasn't a crash, just an infinite loop. DX8 merge is GO! once again :)
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.4 2002/05/13 21:43:37 mharris
* A little more network and sound cleanup
*
* Revision 1.3 2002/05/10 20:42:43 mharris
* use "ifndef NO_NETWORK" all over the place
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -208,24 +227,28 @@
* $NoKeywords: $
*/
#include "3d.h"
#include "bmpman.h"
#include "object.h"
#include "debris.h"
#include "fireballs.h"
#include "radar.h"
#include "missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd.h"
#include "objectsnd.h"
#include "linklist.h"
#include "systemvars.h"
#include "multi.h"
#include "multimsgs.h"
#include "particle.h"
#include "freespace.h"
#include "multiutil.h"
#include "objcollide.h"
#include "timer.h"
#include "render/3d.h"
#include "bmpman/bmpman.h"
#include "object/object.h"
#include "debris/debris.h"
#include "fireball/fireballs.h"
#include "radar/radar.h"
#include "mission/missionparse.h" // For MAX_SPECIES_NAMES
#include "gamesnd/gamesnd.h"
#include "object/objectsnd.h"
#include "globalincs/linklist.h"
#include "globalincs/systemvars.h"
#include "particle/particle.h"
#include "freespace2/freespace.h"
#include "object/objcollide.h"
#include "io/timer.h"
#include "fireball/fireballs.h"
#ifndef NO_NETWORK
#include "network/multi.h"
#include "network/multimsgs.h"
#include "network/multiutil.h"
#endif
#define MAX_LIFE 10.0f
#define MIN_RADIUS_FOR_PERSISTANT_DEBRIS 50 // ship radius at which debris from it becomes persistant
@@ -270,8 +293,10 @@ static void debris_start_death_roll(object *debris_obj, debris *debris_p)
{
if (debris_p->is_hull) {
// tell everyone else to blow up the piece of debris
#ifndef NO_NETWORK
if( MULTIPLAYER_MASTER )
send_debris_update_packet(debris_obj,DEBRIS_UPDATE_NUKE);
#endif
int fireball_type = FIREBALL_EXPLOSION_LARGE1 + rand()%FIREBALL_NUM_LARGE_EXPLOSIONS;
fireball_create( &debris_obj->pos, fireball_type, OBJ_INDEX(debris_obj), debris_obj->radius*1.75f);
@@ -495,7 +520,9 @@ void debris_process_post(object * obj, float frame_time)
radar_plot_object( obj );
if ( timestamp_elapsed(db->sound_delay) ) {
#ifndef NO_SOUND
obj_snd_assign(objnum, SND_DEBRIS, &vmd_zero_vector, 0);
#endif
db->sound_delay = 0;
}
} else {
@@ -775,14 +802,16 @@ object *debris_create(object *source_obj, int model_num, int submodel_num, vecto
// assign the network signature. The signature will be 0 for non-hull pieces, but since that
// is our invalid signature, it should be okay.
obj->net_signature = 0;
#ifndef NO_NETWORK
if ( (Game_mode & GM_MULTIPLAYER) && hull_flag ) {
obj->net_signature = multi_get_next_network_signature( MULTI_SIG_DEBRIS );
}
#endif
// -- No long need shield: bset_shield_strength(obj, 100.0f); // Hey! Set to some meaningful value!
if (source_obj->type == OBJ_SHIP) {
obj->hull_strength = Ship_info[Ships[source_obj->instance].ship_info_index].initial_hull_strength/8.0f;
obj->hull_strength = Ships[source_obj->instance].ship_initial_hull_strength/8.0f;
} else
obj->hull_strength = 10.0f;
@@ -952,10 +981,12 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
particle_emit( &pe, PARTICLE_FIRE, 0 );
}
#ifndef NO_NETWORK
// multiplayer clients bail here
if(MULTIPLAYER_CLIENT){
return;
}
#endif
if ( damage < 0.0f ) {
damage = 0.0f;
@@ -967,9 +998,11 @@ void debris_hit(object *debris_obj, object *other_obj, vector *hitpos, float dam
debris_start_death_roll(debris_obj, debris_p );
} else {
// otherwise, give all the other players an update on the debris
#ifndef NO_NETWORK
if(MULTIPLAYER_MASTER){
send_debris_update_packet(debris_obj,DEBRIS_UPDATE_UPDATE);
}
#endif
}
}
@@ -1087,7 +1120,8 @@ int debris_check_collision(object *pdebris, object *other_obj, vector *hitpos, c
pm = model_get(Ships[heavy_obj->instance].modelnum);
// turn off all rotating submodels and test for collision
for (int i=0; i<num_rotating_submodels; i++) {
int i;
for (i=0; i<num_rotating_submodels; i++) {
pm->submodel[submodel_list[i]].blown_off = 1;
}
@@ -1247,25 +1281,25 @@ int debris_get_team(object *objp)
void calc_debris_physics_properties( physics_info *pi, vector *mins, vector *maxs )
{
float dx, dy, dz, mass;
dx = maxs->x - mins->x;
dy = maxs->y - mins->y;
dz = maxs->z - mins->z;
dx = maxs->xyz.x - mins->xyz.x;
dy = maxs->xyz.y - mins->xyz.y;
dz = maxs->xyz.z - mins->xyz.z;
// John, with new bspgen, just set pi->mass = mass
mass = 0.12f * dx * dy * dz;
pi->mass = (float) pow(mass, 0.6666667f) * 4.65f;
pi->I_body_inv.rvec.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
pi->I_body_inv.rvec.y = 0.0f;
pi->I_body_inv.rvec.z = 0.0f;
pi->I_body_inv.vec.rvec.xyz.x = 12.0f / (pi->mass * (dy*dy + dz*dz));
pi->I_body_inv.vec.rvec.xyz.y = 0.0f;
pi->I_body_inv.vec.rvec.xyz.z = 0.0f;
pi->I_body_inv.uvec.x = 0.0f;
pi->I_body_inv.uvec.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
pi->I_body_inv.uvec.z = 0.0f;
pi->I_body_inv.vec.uvec.xyz.x = 0.0f;
pi->I_body_inv.vec.uvec.xyz.y = 12.0f / (pi->mass * (dx*dx + dz*dz));
pi->I_body_inv.vec.uvec.xyz.z = 0.0f;
pi->I_body_inv.fvec.x = 0.0f;
pi->I_body_inv.fvec.y = 0.0f;
pi->I_body_inv.fvec.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
pi->I_body_inv.vec.fvec.xyz.x = 0.0f;
pi->I_body_inv.vec.fvec.xyz.y = 0.0f;
pi->I_body_inv.vec.fvec.xyz.z = 12.0f / (pi->mass * (dx*dx + dy*dy));
}
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Debris/Debris.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
*
* Code for the pieces of exploding object debris.
+24 -11
View File
@@ -9,13 +9,25 @@
/*
* $Logfile: /Freespace2/code/DebugConsole/Console.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-03-18 10:07:01 $
* $Author: unknownplayer $
*
* Routines for managing the debug console window.
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.1 2002/09/24 18:56:41 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -101,14 +113,15 @@
#include <setjmp.h>
#include <string.h>
#include "pstypes.h"
#include "freespace.h"
#include "font.h"
#include "timer.h"
#include "2d.h"
#include "key.h"
#include "alphacolors.h"
#include "osapi.h"
#include "globalincs/pstypes.h"
#include "freespace2/freespace.h"
#include "graphics/font.h"
#include "io/timer.h"
#include "graphics/2d.h"
#include "io/key.h"
#include "globalincs/alphacolors.h"
#include "osapi/osapi.h"
#include "debugconsole/dbugfile.h"
#define MAX_COMMANDS 300
+404
View File
@@ -0,0 +1,404 @@
#ifdef _WIN32
#include <windows.h>
#endif
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include "dbugfile.h"
int dbugfile_counters[MAX_COUNTERS];
bool dbugfile_init_var = false;
char dbugfile_filename[512];
void dbugfile_output(char *buffer)
{
if(dbugfile_init_var == false)
{
return;
}
FILE *fp = fopen(dbugfile_filename, "a");
if(fp == NULL)
{
return;
}
fwrite(buffer, sizeof(char) * strlen(buffer), 1, fp);
fclose(fp);
}
void dbugfile_init()
{
// Clear the counters
memset(dbugfile_counters, 0, sizeof(int) * MAX_COUNTERS);
char big_buffer[1000];
char temp_buff[512];
dbugfile_filename[0] = '\0';
#ifdef _WIN32
char path[MAX_PATH];
GetCurrentDirectory(MAX_PATH, path);
int path_len = strlen(path);
if(path[path_len - 1] != '\\')
{
path[path_len] = '\\';
path[path_len + 1] = '\0';
}
strcpy(dbugfile_filename, path);
#endif
strcat(dbugfile_filename, "DBUG-");
strcpy(big_buffer, "DBUGFILE Active: ");
#ifdef _WIN32
{
unsigned long len = 512;
GetUserName(temp_buff, &len);
strcat(dbugfile_filename, temp_buff);
strcat(big_buffer, temp_buff);
strcat(dbugfile_filename, "-");
strcat(big_buffer, " ");
}
#endif
_tzset();
// Display operating system-style date and time.
_strdate( temp_buff);
strcat(dbugfile_filename, "D(");
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ") T(");
strcat(big_buffer, " ");
_strtime( temp_buff);
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ").txt");
strcat(big_buffer, "\n");
// Remove invalid slash chars
int len = strlen(dbugfile_filename);
while(len >= 2)
{
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
{
dbugfile_filename[len] = '-';
}
len--;
}
// open file
// Uncomment this to see where the file is going
//MessageBox(NULL, dbugfile_filename, "das", MB_OK);
FILE *fp = fopen(dbugfile_filename, "w");
if(fp == NULL)
{
return;
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
#ifdef _WIN32
// detect OS type
OSVERSIONINFO version_info;
version_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if(GetVersionEx(&version_info) != false)
{
char *error = "Error in detecting OS version";
char *version = error;
switch(version_info.dwMajorVersion)
{
case 4:
{
if(version_info.dwMinorVersion == 0)
{
version = "Windows 95";
}
else if(version_info.dwMinorVersion == 10)
{
version = "Windows 98";
}
else if(version_info.dwMinorVersion == 90)
{
version = "Windows Me";
}
break;
}
case 5:
{
if(version_info.dwMinorVersion == 0)
{
version = "Windows 2000";
}
else if(version_info.dwMinorVersion == 1)
{
version = "Windows XP";
}
break;
}
}
char *release_type = NULL;
#ifdef _DEBUG
release_type = "Debug";
#else
release_type = "Release";
#endif
sprintf(big_buffer, "OS: %s %s, ", version, release_type);
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 1, fp);
char exe_name[MAX_PATH];
GetModuleFileName(NULL, exe_name, MAX_PATH);
strcat(exe_name, "\n");
fwrite(exe_name, sizeof(char) * strlen(exe_name), 1, fp);
#endif
fclose(fp);
dbugfile_init_var = true;
}
void dbugfile_deinit()
{
dbugfile_output("Normal end");
dbugfile_init_var = false;
}
void dbugfile_sprintf(int line, char *file, const char *format, ...)
{
if(dbugfile_init_var == false)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
char buffer[1000];
int i = sprintf(buffer, "[%s,%4d] ", ptr, line);
va_list ap;
char *p, *sval;
long ival;
double dval;
// Add each extra parameter to string
va_start(ap, format);
for(p = (char *) format; *p; p++)
{
if(*p != '%')
{
*(buffer + i) = *p;
i++;
continue;
}
p++;
switch(*p)
{
case 'd':
{
ival = va_arg(ap, int);
i += sprintf(buffer+i,"%d", ival);
break;
}
case 'c':
{
ival = va_arg(ap, char);
buffer[i] = (char) ival;
i++;
break;
}
case 'x':
{
ival = va_arg(ap, int);
i += sprintf(buffer+i,"%x", ival);
break;
}
case 'f':
{
dval = va_arg(ap, double);
i += sprintf(buffer+i,"%f", dval);
break;
}
case 's':
{
for(sval = va_arg(ap, char *); *sval; sval++)
{
*(buffer + i++) = *sval;
}
break;
}
default:
{
i += sprintf(buffer+i,"N/A: %%%c", *p);
break;
}
}
}
va_end(ap);
i += sprintf(buffer + i, "\n");
dbugfile_output(buffer);
}
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text)
{
if(dbugfile_init_var == false)
{
return;
}
if(matrix == NULL)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
if(text == NULL)
{
text = "";
}
char buffer[1000];
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
"%f %f %f %f\n"
"%f %f %f %f\n"
"%f %f %f %f\n"
"%f %f %f %f\n",
ptr,line, text,
matrix[0],
matrix[1],
matrix[2],
matrix[3],
matrix[4],
matrix[5],
matrix[6],
matrix[7],
matrix[8],
matrix[9],
matrix[10],
matrix[11],
matrix[12],
matrix[13],
matrix[14],
matrix[15]);
dbugfile_output(buffer);
}
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text)
{
if(dbugfile_init_var == false)
{
return;
}
if(matrix == NULL)
{
return;
}
// find last slash (for PC) to crop file path
char *ptr = strrchr(file, '\\');
if(ptr == NULL)
{
ptr = file;
}
else
{
ptr++;
}
if(text == NULL)
{
text = "";
}
char buffer[1000];
sprintf(buffer,"[%s,%4d] Matrix %s:\n"
"%f %f %f\n"
"%f %f %f\n"
"%f %f %f\n",
ptr,line, text,
matrix[0],
matrix[1],
matrix[2],
matrix[3],
matrix[4],
matrix[5],
matrix[6],
matrix[7],
matrix[8]);
dbugfile_output(buffer);
}
void dbugfile_print_counter(int line, char *file, int counter_num, char *string)
{
char buffer[1000];
strcpy(buffer, string);
strcat(buffer, " %d");
dbugfile_sprintf(line, file, buffer, dbugfile_counters[counter_num]);
}
+65
View File
@@ -0,0 +1,65 @@
#ifndef _DBUGFILE_HEADER_
#define _DBUGFILE_HEADER_
#define MAX_COUNTERS 10
void dbugfile_init();
void dbugfile_deinit();
void dbugfile_sprintf(int line, char *file, const char *format, ...);
void dbugfile_print_matrix_3x3(int line, char *file, float *matrix, char *text);
void dbugfile_print_matrix_4x4(int line, char *file, float *matrix, char *text);
void dbugfile_print_counter(int line, char *file, int counter_num, char *string);
#ifdef DBUGFILE_ACTIVE
#define DBUGFILE_INIT() dbugfile_init();
#define DBUGFILE_DEINIT() dbugfile_deinit();
#define DBUGFILE_OUTPUT_0(t) dbugfile_sprintf(__LINE__, __FILE__, t);
#define DBUGFILE_OUTPUT_1(t,a) dbugfile_sprintf(__LINE__, __FILE__, t,a);
#define DBUGFILE_OUTPUT_2(t,a,b) dbugfile_sprintf(__LINE__, __FILE__, t,a,b);
#define DBUGFILE_OUTPUT_3(t,a,b,c) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c);
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d);
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e);
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f);
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g);
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h,i);
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) dbugfile_print_matrix_3x3(__LINE__, __FILE__, m,t);
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) dbugfile_print_matrix_4x4(__LINE__, __FILE__, m,t);
extern int dbugfile_counters[MAX_COUNTERS];
#define DBUGFILE_INC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]++;
#define DBUGFILE_DEC_COUNTER(n) if(n < MAX_COUNTERS) dbugfile_counters[n]--;
#define DBUGFILE_OUTPUT_COUNTER(n,s) dbugfile_print_counter(__LINE__, __FILE__, n, s);
#else
#define DBUGFILE_INIT() ;
#define DBUGFILE_DEINIT() ;
#define DBUGFILE_OUTPUT_0(t) ;
#define DBUGFILE_OUTPUT_1(t,a) ;
#define DBUGFILE_OUTPUT_2(t,a,b) ;
#define DBUGFILE_OUTPUT_3(t,a,b,c) ;
#define DBUGFILE_OUTPUT_4(t,a,b,c,d) ;
#define DBUGFILE_OUTPUT_5(t,a,b,c,d,e) ;
#define DBUGFILE_OUTPUT_6(t,a,b,c,d,e,f) ;
#define DBUGFILE_OUTPUT_7(t,a,b,c,d,e,f,g) ;
#define DBUGFILE_OUTPUT_8(t,a,b,c,d,e,f,g,h) ;
#define DBUGFILE_OUTPUT_9(t,a,b,c,d,e,f,g,h,i) ;
#define DBUGFILE_OUTPUT_MATRIX_3X3(m,t) ;
#define DBUGFILE_OUTPUT_MATRIX_4X4(m,t) ;
#define DBUGFILE_INC_COUNTER(n) ;
#define DBUGFILE_DEC_COUNTER(n) ;
#define DBUGFILE_OUTPUT_COUNTER(n,s) ;
#endif
#endif
+148
View File
@@ -0,0 +1,148 @@
#ifdef _WIN32
#include <windows.h>
#include <winbase.h>
#include "dbugfile.h"
#include "timerbar.h"
typedef struct
{
LARGE_INTEGER start_value;
LARGE_INTEGER total_value;
LARGE_INTEGER average;
LARGE_INTEGER frame_total;
} timerbar_profile;
timerbar_profile profiles[TIMERBAR_COLOUR_MAX];
int timerbar_current_profile = 0;
LARGE_INTEGER timerbar_ultimate_start_value;
LARGE_INTEGER timerbar_last_start_value;
void (*draw_func_ptr)(int colour, float x, float y, float w, float h) = NULL;
void timerbar_start_frame()
{
timerbar_current_profile = 0;
if(QueryPerformanceCounter(&timerbar_ultimate_start_value) == FALSE)
{
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
draw_func_ptr = NULL;
}
timerbar_last_start_value = timerbar_ultimate_start_value;
}
const int WIDTH = 480;
const float WIDTHF = ((float) WIDTH) * 1.05f;
void timerbar_conv_and_draw(int colour, int xpos, int xwidth, int yrow)
{
float fxpos = (float) xpos;
float fxwidth = (float) xwidth;
draw_func_ptr(colour,
fxpos / WIDTHF,
yrow * 0.01f,
fxwidth / WIDTHF,
0.005f);
}
void timerbar_end_frame()
{
// Now we want to draw the bars
if(draw_func_ptr == NULL)
{
// we have not been given a draw function so we are going to have to quit
return;
}
timerbar_switch_type(-1);
int last_xpos = 0;
int y_pos = 0;
for(int i = 0; i < TIMERBAR_COLOUR_MAX; i++)
{
// Nothing to render this frame
if(profiles[i].frame_total.QuadPart == 0)
{
continue;
}
int xsize = (int) profiles[i].frame_total.QuadPart / 60;
// break condition in else
for (;;)
{
// if bar runs over
if(last_xpos + xsize > WIDTH)
{
int rem_len = WIDTH - last_xpos;
// Draw from current position to the end of the bar
timerbar_conv_and_draw(i, last_xpos, rem_len, y_pos);
xsize -= rem_len;
last_xpos = 0;
y_pos++;
}
else
{
// Draw whats left and break for the next bar
timerbar_conv_and_draw(i,last_xpos, xsize, y_pos);
last_xpos += xsize;
break;
}
}
// reset for next frame
profiles[i].frame_total.QuadPart = 0;
}
}
void timerbar_switch_type(int num)
{
if(num >= TIMERBAR_COLOUR_MAX)
{
return;
}
// Calculate old profile's total
LARGE_INTEGER now;
if(QueryPerformanceCounter(&now) == FALSE)
{
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
profiles[timerbar_current_profile].frame_total.QuadPart =
(now.QuadPart - timerbar_last_start_value.QuadPart);
if(num != -1)
{
// Switch to new profile
timerbar_current_profile = num;
}
// Update time to count from
if(QueryPerformanceCounter(&timerbar_last_start_value) == FALSE)
{
DBUGFILE_OUTPUT_0("QueryPerformanceCounter not supported by hardware");
}
}
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h))
{
draw_func_ptr = new_draw_func_ptr;
}
#endif
+34
View File
@@ -0,0 +1,34 @@
#ifndef _TIMERBAR_HEADER_
#define _TIMERBAR_HEADER_
enum
{
TIMERBAR_COLOUR_RED,
TIMERBAR_COLOUR_GREEN,
TIMERBAR_COLOUR_BLUE,
TIMERBAR_COLOUR_MAX,
};
void timerbar_start_frame();
void timerbar_end_frame();
void timerbar_switch_type(int num);
void timerbar_set_draw_func(void (*new_draw_func_ptr)(int colour, float x, float y, float w, float h));
#ifdef TIMEBAR_ACTIVE
#define TIMERBAR_SET_DRAW_FUNC(f) timerbar_set_draw_func(f);
#define TIMERBAR_START_FRAME() timerbar_start_frame();
#define TIMERBAR_END_FRAME() timerbar_end_frame();
#define TIMERBAR_SWITCH_TYPE(n) timerbar_switch_type(n);
#else
#define TIMERBAR_SET_DRAW_FUNC(f) ;
#define TIMERBAR_START_FRAME() ;
#define TIMERBAR_END_FRAME() ;
#define TIMERBAR_SWITCH_TYPE(n) ;
#endif
#endif
+830
View File
@@ -0,0 +1,830 @@
//sorce file for decals-Bobboau
//and no, I don't have any idea what I'm doing
#include "decals/decals.h"
#include "ship/ship.h"
#include "render/3d.h"
#include "io/timer.h"
#include "math/fvi.h"
#include "lighting/lighting.h"
//#define DECALS_ENABLED
int decal_intersect_seg_with_cube(vector * poly_point, vector start, vector end, vector cube_point[8], matrix orient, int ints=1);
int decal_intersect_poly_with_cube(vector * poly_point, vector point[3], vector cube_point[8], int ints);
decal_model d_model;
int poly_num = 0;
static vector decal_cube_point[8];
static vector decal_cube_plane[6][2];
static vector decal_hit_point;
static vector decal_hit_vect;
static float decal_hit_radius;
static matrix decal_orient;
static vector * decal_point_list[MAX_DECAL_DEFPOINTS];
static int decal_poly[MAX_DECAL_DEFPOINTS];
static decal * new_decal;
static int nverts;
static float min_rad;
static int back_faceing;
/*
vector uvec, rvec;
vector temp;
temp = *pos;
vm_vec_sub( &rvec, Eyeposition, &temp );
vm_vec_normalize( &rvec );
vm_vec_crossprod(&uvec,fvec,&rvec);
vm_vec_normalize(&uvec);
vm_vec_scale_add( top, &temp, &uvec, w/2.0f );
vm_vec_scale_add( bot, &temp, &uvec, -w/2.0f );
*/
int decal_find_next(object *obj){
ship *shipp = &Ships[obj->instance];
int oldest = shipp->decals[0].timestamp;
int i;
for(i = 0; i < MAX_SHIP_DECALS; i++){
if(shipp->decals[i].is_valid != 1){ //use up all the unused decals first
return i%MAX_SHIP_DECALS;
}
}
for(i = 1; i < MAX_SHIP_DECALS; i++){
if(shipp->decals[i].timestamp > oldest){ //then get the oldest one
oldest = i;
}
}
return oldest%MAX_SHIP_DECALS;
}
int decal_create_simple(object *obj, decal_point *point, int texture){//makes a simple non-clipped decal
#ifdef DECALS_ENABLED
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
mprintf(("orient fvec at %0.2f, %0.2f, %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
if(obj->type != OBJ_SHIP){
return 0;
}
// vertex vert[1][2];
// vector vec[4];
vector center = point->pnt;
float rad = point->radius;
if(rad <=0) rad = 10;
mprintf(("radius %f\n",rad));
vector plain_point[4];
// mprintf(("orient uvec x %0.2f %0.2f %0.2f\n", point->orient.vec.uvec.xyz.x, point->orient.vec.uvec.xyz.y, point->orient.vec.uvec.xyz.z));
// mprintf(("orient rvec x %0.2f %0.2f %0.2f\n", point->orient.vec.rvec.xyz.x, point->orient.vec.rvec.xyz.y, point->orient.vec.rvec.xyz.z));
// mprintf(("orient fvec x %0.2f %0.2f %0.2f\n", point->orient.vec.fvec.xyz.x, point->orient.vec.fvec.xyz.y, point->orient.vec.fvec.xyz.z));
plain_point[0] = point->orient.vec.uvec;
plain_point[1] = plain_point[0];
vm_vec_negate(&plain_point[1]);
plain_point[2] = point->orient.vec.rvec;
plain_point[3] = plain_point[2];
vm_vec_negate(&plain_point[3]);
mprintf(("\n"));
int dinx = decal_find_next(obj);
ship *shipp = &Ships[obj->instance];
decal *dec = shipp->decals;
vm_vec_scale_add( &dec[0].vert[0], &center, &plain_point[0], rad );
vm_vec_scale_add( &dec[0].vert[1], &center, &plain_point[2], rad );
vm_vec_scale_add( &dec[0].vert[2], &center, &plain_point[1], rad );
vm_vec_scale_add( &dec[0].vert[3], &center, &plain_point[3], rad );
dec[dinx].poly[0].point[0] = 0;
dec[dinx].poly[0].point[1] = 1;
dec[dinx].poly[0].point[2] = 2;
dec[dinx].poly[1].point[0] = 0;
dec[dinx].poly[1].point[1] = 3;
dec[0].poly[1].point[2] = 2;
dec[dinx].poly[0].uv[0].u = 0; dec[0].poly[0].uv[0].v = 0;
dec[dinx].poly[0].uv[1].u = 0; dec[0].poly[0].uv[1].v = 1;
dec[dinx].poly[0].uv[2].u = 1; dec[0].poly[0].uv[2].v = 1;
dec[dinx].poly[1].uv[0].u = 0; dec[0].poly[1].uv[0].v = 0;
dec[dinx].poly[1].uv[1].u = 1; dec[0].poly[1].uv[1].v = 0;
dec[dinx].poly[1].uv[2].u = 1; dec[0].poly[1].uv[2].v = 1;
dec[dinx].texture = texture;
dec[dinx].n_poly = 2;
dec[dinx].is_valid = 1;
dec[dinx].timestamp = timestamp();
mprintf(("a decal should have been made at %0.2f %0.2f %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
//Int3();
#endif
return 1;
}
#define duw(p) (*((uint *) (p)))
#define dw(p) (*((int *) (p)))
#define dwp(p) ((int *) (p))
#define dvp(p) ((vector *) (p))
#define dfl(p) (*((float *) (p)))
//creates a decal, returns decal index on succes, -1 on failure
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture){
#ifdef DECALS_ENABLED
mprintf(("a decal is about to be made at %0.2f, %0.2f, %0.2f\n", point->pnt.xyz.x, point->pnt.xyz.y, point->pnt.xyz.z));
if(obj->type != OBJ_SHIP){
return -1;
}
if(texture == -1)return -1;
if(point->radius <= 0)return -1;
vector center = point->pnt;
float rad = point->radius;
if(rad <=0) rad = 1;
mprintf(("radius %f\n",rad));
vector plain_point[4];
vector cube_point[8];
//define the decals dimentions
plain_point[0] = point->orient.vec.uvec;
plain_point[1] = plain_point[0];
vm_vec_negate(&plain_point[1]);
plain_point[2] = point->orient.vec.rvec;
plain_point[3] = plain_point[2];
vm_vec_negate(&plain_point[3]);
vector topcenter;
vector bvec = point->orient.vec.fvec;
vm_vec_negate(&bvec);
vm_vec_scale_add(&topcenter, &center, &bvec, rad);
for(int i = 0; i < 4; i++){
vm_vec_scale_add( &cube_point[i], &topcenter, &plain_point[i], rad );
vm_vec_scale_add( &cube_point[i+4], &cube_point[i], &point->orient.vec.fvec, rad*2);
}
float max_rad = vm_vec_dist_quick(&center, &cube_point[0]); //the cube points are all equidistant, right?
min_rad = fl_sqrt((rad * rad)/2); //the cube points are all equidistant, right?
mprintf(("decal defined\n"));
//define the decals dimentions
//set up the decal model
ship *shipp = &Ships[obj->instance];
decal *sdec = shipp->decals;
polymodel *pm = model_get(shipp->modelnum);
bsp_info * sm;
sm = &pm->submodel[subobject];
// decal_model dmod = pm->submodel[subobject].dec_model;// sm->dec_model;
// decal_model tdec; //temporary decal model for holding the culled down part of the decal
//setting up the decal cube
vector test_vec, temp1, temp2;
for(i = 0; i<8; i++)decal_cube_point[i] = cube_point[i];
decal_orient = point->orient;
decal_cube_plane[0][0] = cube_point[5];
temp1 = decal_orient.vec.uvec;
temp2 = decal_orient.vec.rvec;
vm_vec_avg(&test_vec, &temp1, &temp2);
vm_vec_normalize(&test_vec);
decal_cube_plane[0][1] = test_vec;
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
decal_cube_plane[1][0] = cube_point[0];
vm_vec_negate(&test_vec);
decal_cube_plane[1][1] = test_vec;
// mprintf(("plane 1 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][0].xyz.x, decal_cube_plane[1][0].xyz.y, decal_cube_plane[1][0].xyz.z));
// mprintf(("plane 1 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[1][1].xyz.x, decal_cube_plane[1][1].xyz.y, decal_cube_plane[1][1].xyz.z));
decal_cube_plane[2][0] = cube_point[5];
vm_vec_negate(&temp2);
vm_vec_avg(&test_vec, &temp1, &temp2);
vm_vec_normalize(&test_vec);
decal_cube_plane[2][1] = test_vec;
// mprintf(("plane 2 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][0].xyz.x, decal_cube_plane[2][0].xyz.y, decal_cube_plane[2][0].xyz.z));
// mprintf(("plane 2 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[2][1].xyz.x, decal_cube_plane[2][1].xyz.y, decal_cube_plane[2][1].xyz.z));
decal_cube_plane[3][0] = cube_point[0];
vm_vec_negate(&test_vec);
decal_cube_plane[3][1] = test_vec;
// mprintf(("plane 3 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][0].xyz.x, decal_cube_plane[3][0].xyz.y, decal_cube_plane[3][0].xyz.z));
// mprintf(("plane 3 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[3][1].xyz.x, decal_cube_plane[3][1].xyz.y, decal_cube_plane[3][1].xyz.z));
test_vec = decal_orient.vec.fvec;
decal_cube_plane[4][0] = cube_point[0];
decal_cube_plane[4][1] = test_vec;
// mprintf(("plane 4 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][0].xyz.x, decal_cube_plane[4][0].xyz.y, decal_cube_plane[4][0].xyz.z));
// mprintf(("plane 4 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[4][1].xyz.x, decal_cube_plane[4][1].xyz.y, decal_cube_plane[4][1].xyz.z));
vm_vec_negate(&test_vec);
decal_cube_plane[5][0] = cube_point[5];
decal_cube_plane[5][1] = test_vec;
// mprintf(("plane 5 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][0].xyz.x, decal_cube_plane[5][0].xyz.y, decal_cube_plane[5][0].xyz.z));
// mprintf(("plane 5 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[5][1].xyz.x, decal_cube_plane[5][1].xyz.y, decal_cube_plane[5][1].xyz.z));
//setting up the decal cube
mprintf(("cube set up\n"));
decal_hit_point = point->pnt;
decal_hit_radius = max_rad;
decal_hit_vect = point->orient.vec.fvec;
poly_num = 0;
nverts = 0;
//go and find decals for each submodel
// for(int z = 0; z<pm->n_models;z++){
int dinx = decal_find_next(obj);
mprintf(("decal is number %d\n", dinx));
sdec[dinx].is_valid = 0;
new_decal = &shipp->decals[dinx];
if(backfaced_texture != -1){
back_faceing = 1;
}else{
back_faceing = 0;
}
decal_create_sub((ubyte *)pm->submodel[subobject].bsp_data);
mprintf(("deacal defined\n"));
sdec[dinx].texture = texture;
sdec[dinx].backfaced_texture = backfaced_texture;
sdec[dinx].is_valid = 1;
sdec[dinx].timestamp = timestamp();
sdec[dinx].n_poly = poly_num;
sdec[dinx].state = 1;
sdec[dinx].lifetime = 3000;
sdec[dinx].frames = 1;
sdec[dinx].importance = 0;
sdec[dinx].radius = max_rad;
sdec[dinx].position = point->pnt;
mprintf(("a decal should have been made with %d polys\n",sdec[0].n_poly));
return dinx;
#else
return -1;
#endif
}
//decal_model d_model;
// Point list
// +0 int id
// +4 int size
// +8 int n_verts
// +12 int n_norms
// +16 int offset from start of chunk to vertex data
// +20 n_verts*char norm_counts
// +offset vertex data. Each vertex n is a point followed by norm_counts[n] normals.
void decal_create_defpoints(ubyte * p )
{
// mprintf(("entering decal decal_create_defpoints\n"));
int n;
nverts = dw(p+8);
int offset = dw(p+16);
mprintf(("%d verts\n",nverts));
ubyte * normcount = p+20;
vector *src = dvp(p+offset);
Assert( nverts < 1200 );
for (n=0; n<nverts; n++ ) {
decal_point_list[n] = src;
new_decal->vert[n].xyz = src->xyz;
src += normcount[n]+1;
// mprintf(("defpoint %d, x %0.2f, y %0.2f, z %0.2f\n",n,d_model.vert[n].xyz.x,d_model.vert[n].xyz.y,d_model.vert[n].xyz.z));
}
}
// Sortnorms
// +0 int id
// +4 int size
// +8 vector normal
// +20 vector center
// +32 float radius
// 36 int front offset
// 40 int back offset
// 44 int prelist offset
// 48 int postlist offset
// 52 int online offset
void decal_create_sortnorm(ubyte * p)
{
// mprintf(("entering decal_create_sortnorm\n"));
int frontlist = dw(p+36);
int backlist = dw(p+40);
int prelist = dw(p+44);
int postlist = dw(p+48);
int onlist = dw(p+52);
vector min, max;
min.xyz = dvp(p+56)->xyz;
max.xyz = dvp(p+68)->xyz;
min.xyz.x += decal_hit_radius;
min.xyz.y += decal_hit_radius;
min.xyz.z += decal_hit_radius;
max.xyz.x += decal_hit_radius;
max.xyz.y += decal_hit_radius;
max.xyz.z += decal_hit_radius;
/* if (!fvi_ray_boundingbox( &min, &max, &decal_hit_point, &decal_hit_vect, NULL )) {
return;
}
*/
if (prelist) decal_create_sub(p+prelist);
if (backlist) decal_create_sub(p+backlist);
if (onlist) decal_create_sub(p+onlist);
if (frontlist) decal_create_sub(p+frontlist);
if (postlist) decal_create_sub(p+postlist);
}
/*
typedef struct model_tmap_vert {
short vertnum;
short normnum;
float u,v;
} model_tmap_vert;
*/
//int poly_num = 0;
// Textured Poly
// +0 int id
// +4 int size
// +8 vector normal
// +20 vector normal_point
// +32 int tmp = 0
// +36 int nverts
// +40 int tmap_num
// +44 nverts*(model_tmap_vert) vertlist (n,u,v)
void decal_create_tmappoly(ubyte * p)
{
// mprintf(("entering decal_create_tmappoly\n"));
if(poly_num >= MAX_DECAL_POLY){
mprintf(("bugging out becase there are too many polys in the decal\n"));
return;
}
int i;
int nv;
// uv_pair uvlist[TMAP_MAX_VERTS];
// vector points[TMAP_MAX_VERTS];
model_tmap_vert *verts;
nv = dw(p+36);
if ( nv < 0 ) return;
// int tmap_num = dw(p+40);
/*
if ( (!(Mc->flags & MC_CHECK_INVISIBLE_FACES)) && (Mc_pm->textures[tmap_num] < 0) ) {
// Don't check invisible polygons.
return;
}
*/
verts = (model_tmap_vert *)(p+44);
vector temppoly[820];
for (i=0;i<nv;i++) {
decal_poly[i] = (int)verts[i].vertnum;
temppoly[i].xyz = decal_point_list[decal_poly[i]]->xyz;
}
vector pnorm;
vm_vec_perp(&pnorm, decal_point_list[decal_poly[0]], decal_point_list[decal_poly[1]], decal_point_list[decal_poly[2]]);
float back = vm_vec_dot(&decal_cube_plane[4][1], &pnorm);
if( (back_faceing == 0) && (back >= 0) )return;
//poly culling
vector pcenter;
vm_vec_avg_n(&pcenter, nv, temppoly);
float pradius = 0;
float dist = 0;
for (i=0;i<nv;i++) {
dist = vm_vec_dist(decal_point_list[decal_poly[i]], &pcenter);
if(dist>pradius){
pradius = dist;
}
}
//if it's too far to posably get near the cube get out
if(vm_vec_dist_quick(&pcenter, &decal_hit_point) >= (pradius + decal_hit_radius)){
// mprintf(("leaveing becase poly is too far away\n"));
return;
}
//this is for faster testing, I'm not sure if it's realy makeing it faster or not
int k;
for(k = 0; k<6; k++){
int first_good = -1;
for(i = 0; ((i< nv) && (first_good == -1)); i++){
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
first_good = i;
}
}
if(first_good == -1){
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
return;
}
}
//poly culling
int temp_poly[820];
int skip = 0, numv = 0, valid = 0;
// mprintf(("starting to test the poly, with %d verts in it\n",nv));
for(k = 0; k<6; k++){
//find the first point in front of the plain
int first_good = -1;
for(i = 0; ((i< nv) && (first_good == -1)); i++){
// mprintf(("testing point %d with plane %d\n", i, k));
// mprintf(("point's position is x %0.2f y %0.2f z %0.2f\n", decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z));
// mprintf(("plane's position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][0].xyz.x, decal_cube_plane[k][0].xyz.y, decal_cube_plane[k][0].xyz.z));
// mprintf(("plane's normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[k][1].xyz.x, decal_cube_plane[k][1].xyz.y, decal_cube_plane[k][1].xyz.z));
if(fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i]]) > 0){
first_good = i;
// mprintf(("%d is the first good point\n", i));
}
}
if(first_good == -1){
// mprintf(("all points are behind a plane, polygon is not in the cube\n"));
return;
}else{
valid = 1;
}
//first point in front of the plane is good of corse
// temp_poly[0] = decal_poly[(first_good + nv)%nv];
numv = 0;
//go through each point and see if there is an intersection between it the next point and the current plane
//if there is then make the intersection point the next point in the poly
//ignor all points untill there is another intersection
//other wise make the next point the next point in the poly
// if(k==1)Int3();
int is_infront = 1, is_infront2 = 1;
for(i = first_good; i < (nv + first_good); i++){
// mprintf(("looking for intersections between point %d and point %d, with plane %d\n", i%nv, (i + 1)%nv, k));
// mprintf((" point %d, is at, x %0.2f y %0.2f z %0.2f and point %d, is at, x %0.2f y %0.2f z %0.2f\n", i%nv, decal_point_list[decal_poly[i]]->xyz.x, decal_point_list[decal_poly[i]]->xyz.y, decal_point_list[decal_poly[i]]->xyz.z, (i + 1)%nv, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.x, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.y, decal_point_list[decal_poly[(i + 1)%nv]]->xyz.z));
is_infront2 = is_infront;
float is_in = fvi_point_dist_plane(&decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[(i + 1)%nv]]);
if(is_in > 0){
is_infront = 1;
}else{
is_infront= 0;
}
if(is_infront != is_infront2){
if(fvi_segment_plane(&new_decal->vert[nverts], &decal_cube_plane[k][0], &decal_cube_plane[k][1], decal_point_list[decal_poly[i%nv]], decal_point_list[decal_poly[(i + 1)%nv]], 0)){
// mprintf(("segment %d %d has an an itersection\n", i%nv, (i + 1)%nv));
decal_point_list[nverts] = &new_decal->vert[nverts];
// mprintf(("new decal defpoint has been added as number %d at x %0.2f y %0.2f z %0.2f\n",nverts, new_decal->vert[nverts].xyz.x, new_decal->vert[nverts].xyz.y, new_decal->vert[nverts].xyz.z));
temp_poly[numv] = nverts++;
// mprintf(("temp_poly point %d, should have been set to defpoint %d, it was set to %d\n",numv, nverts-1, temp_poly[numv]));
skip = (skip+1)%2;
// mprintf(("skip has been set to %d\n",skip));
numv++;
if((skip == 0)){
// mprintf(("adding point, becase it is after an intersection point\n", (i + 1)%nv));
temp_poly[numv] = decal_poly[(i + 1)%nv];
numv++;
}
}else{
// mprintf(("there sould have been an intersection but there wasnt"));
}
}else{
if((skip == 0)){//don't copy the first point
// mprintf(("segment %d %d has no itersection, copying\n", i%nv, (i + 1)%nv));
temp_poly[numv] = decal_poly[(i + 1)%nv];
numv++;
}else{
// mprintf(("skipping segment %d %d becase it isn't in front of the plane\n", i%nv, (i + 1)%nv));
}
}
}
// mprintf(("temp poly has %d points\n", numv));
for(int h = 0; h < numv; h++){
decal_poly[h] = temp_poly[h];
mprintf(("seting decal_poly point %d to %d\n",h,temp_poly[h]));
}
nv = numv;
numv=0;
// mprintf(("decal_poly now has has %d points\n", nv));
if(nv < 3)return; //if at any time we get fewer than three points this poly is dead
}
// mprintf(("copying the poly to the decal\n"));
//copy a triangulated version of the poly to the new decal
if((valid == 1) && (nv > 2)){
/* for (i=1;i<(nv-1);i++) {
if(poly_num >= MAX_DECAL_POLY){
mprintf(("bugging out becase there are too many polys in the decal\n"));
return;
}
new_decal->poly[poly_num].point[0] = decal_poly[0];
new_decal->poly[poly_num].point[1] = decal_poly[i];
new_decal->poly[poly_num].point[2] = decal_poly[i+1];
new_decal->poly[poly_num].norm = pnorm;
if(back > 0){
new_decal->poly[poly_num].backfaced = 0;
}else{
new_decal->poly[poly_num].backfaced = 1;
}
for (k=0;k<3;k++) {
//calculate the UV coords
new_decal->poly[poly_num].uv[k].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
new_decal->poly[poly_num].uv[k].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[k]]) / (min_rad*2));
}
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
poly_num++;
}*/
for (i=1;i<nv;i++){
if(poly_num >= MAX_DECAL_POLY){
mprintf(("bugging out becase there are too many polys in the decal\n"));
return;
}
if(i >= MAX_DECAL_POLY_POINT){
mprintf(("bugging out becase there are too many points in the poly\n"));
return;
}
new_decal->poly[poly_num].point[i] = decal_poly[i];
new_decal->poly[poly_num].norm = pnorm;
if(back > 0){
new_decal->poly[poly_num].backfaced = 0;
}else{
new_decal->poly[poly_num].backfaced = 1;
}
//calculate the UV coords
new_decal->poly[poly_num].uv[i].u = (fvi_point_dist_plane(&decal_cube_plane[0][0], &decal_cube_plane[0][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
new_decal->poly[poly_num].uv[i].v = (fvi_point_dist_plane(&decal_cube_plane[2][0], &decal_cube_plane[2][1], &new_decal->vert[new_decal->poly[poly_num].point[i]]) / (min_rad*2));
// mprintf(("decal poly %d, vert 0 being set to %d, vert 1 %d, and vert 2 %d\n", poly_num, new_decal->poly[poly_num].point[0], new_decal->poly[poly_num].point[1], new_decal->poly[poly_num].point[2]));
}
poly_num++;
}else{
// mprintf(("no poly, all points are out side of planes"));
}
mprintf(("there are now %d polys in the current decal\n", poly_num));
}
int decal_create_sub(void *model_ptr )
{
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
// mprintf(("entering decal_create_sub\n"));
ubyte *p = (ubyte *)model_ptr;
int chunk_type, chunk_size;
chunk_type = dw(p);
chunk_size = dw(p+4);
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
while (chunk_type != DP_EOF) {
// mprintf(( "Processing chunk type %d, len=%d\n", chunk_type, chunk_size ));
// mprintf(("plane 0 position is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][0].xyz.x, decal_cube_plane[0][0].xyz.y, decal_cube_plane[0][0].xyz.z));
// mprintf(("plane 0 normal is x %0.2f y %0.2f z %0.2f\n", decal_cube_plane[0][1].xyz.x, decal_cube_plane[0][1].xyz.y, decal_cube_plane[0][1].xyz.z));
switch (chunk_type) {
case DP_EOF: return 1;
case DP_DEFPOINTS: decal_create_defpoints(p); break;
case DP_FLATPOLY: break;// I don't want any of these anyway-Bobboau decal_create_flatpoly(p); break;
case DP_TMAPPOLY: decal_create_tmappoly(p); break;
case DP_SORTNORM: decal_create_sortnorm(p); break;
case DP_BOUNDBOX:
/* if (!mc_ray_boundingbox( vp(p+8), vp(p+20), &Mc_p0, &Mc_direction, NULL )) {
return 1;
}*/
break;
default:
mprintf(( "Bad chunk type %d, len=%d in decal_create_sub\n", chunk_type, chunk_size ));
Int3(); // Bad chunk type!
return 0;
}
// mprintf(( "current chunk offset %d\n", (int)p ));
p += chunk_size;
chunk_type = dw(p);
chunk_size = dw(p+4);
}
return 1;
}
int decal_make_model(polymodel * pm){
return 1;
}
/*
void decal_render_all(object * obj){
if(obj->type != OBJ_SHIP){
return;
}
vertex vecs[3];
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
// mprintf(("about to render all decals\n"));
ship *shipp = &Ships[obj->instance];
for(int h = 0; h < MAX_SHIP_DECALS; h++){
decal *dec = &shipp->decals[h];
if(dec->is_valid){
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
for(int i = 0; i<dec->n_poly; i++){
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture)){
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
}
for( int j = 0; j < 3; j++){
// vecs[j] = dec->vert[i][j];
// vector pos;
// vm_vert2vec(&vecs[j], &pos);
// vm_vec_add2(&pos, &obj->pos);
g3_rotate_vertex(&vecs[j], &dec->vert[dec->poly[i].point[j]]);
g3_project_vertex(&vecs[j]);
vecs[j].u = dec->poly[i].uv[j].u;
vecs[j].v = dec->poly[i].uv[j].v;
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
}
gr_set_cull(0);
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT );
gr_set_cull(1);
}
}
}
// mprintf(("decals rendered\n"));
}
*/
void decal_render_all(object * obj){
#ifdef DECALS_ENABLED
if(obj->type != OBJ_SHIP){
return;
}
vertex vecs[3];
vertex *vlist[3] = { &vecs[0], &vecs[1], &vecs[2] };
// mprintf(("about to render all decals\n"));
ship *shipp = &Ships[obj->instance];
polymodel *pm = model_get( shipp->modelnum );
for(int h = 0; h < MAX_SHIP_DECALS; h++){
decal *dec = &shipp->decals[h];
if(dec->is_valid){
mprintf(("decal %d is valid, and has %d polys\n",h,dec->n_poly));
// vector g_pos;
// vm_vec_add(&g_pos, &dec->position, &obj->pos);
float dist = vm_vec_dist(&dec->position, &View_position);
if(dist < (dec->radius*10)){
mprintf(("decal %d too far away to be drawn %0.2f\n", h, dist));
// HUD_printf("decal %d too far away to be drawn %0.2f\n", h, dist);
continue;
}
for(int i = 0; i<dec->n_poly; i++){
// if((pm->submodel[dec->submodel_parent].blown_off != 0) && (dec->submodel_parent > 0))continue;
for( int j = 0; j < 3; j++){
// vecs[j] = dec->vert[i][j];
// vector pos;
// vm_vert2vec(&vecs[j], &pos);
// vm_vec_add2(&pos, &obj->pos);
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
vector pnt = dec->vert[dec->poly[i].point[j]];
if(dec->submodel_parent != pm->detail[0]){
matrix m;
angles angs = pm->submodel[dec->submodel_parent].angs;
angs.b = PI2 - angs.b;
angs.p = PI2 - angs.p;
angs.h = PI2 - angs.h;
mprintf(("decal is child of a submodel, who's angles are b %0.2f p %0.2f h %0.2f, it should be rotateing with it\n", angs.b, angs.p, angs.h));
vector offset = pm->submodel[dec->submodel_parent].offset;
vm_angles_2_matrix(&m, &angs);
vector p = pnt;
vm_vec_rotate(&pnt, &p, &m);
vm_vec_add2(&pnt, &offset);
}
g3_rotate_vertex(&vecs[j], &pnt);
g3_project_vertex(&vecs[j]);
vecs[j].u = dec->poly[i].uv[j].u;
vecs[j].v = dec->poly[i].uv[j].v;
mprintf(("vert %d at x %0.2f y %0.2f z %0.2f u %0.2f v %0.2f\n", j, vecs[j].x, vecs[j].y, vecs[j].z, vecs[j].u, vecs[j].v));
/*
if ( D3D_enabled ) {
light_apply_rgb( &vlist[j]->r, &vlist[j]->g, &vlist[j]->b, &pnt, &dec->poly[i].norm, 0 );
} else {
vlist[j]->b = light_apply( &pnt, &dec->poly[i].norm, 0 );
}
*/
}
if(dec->poly[i].point[j]<0 || dec->poly[i].point[j]>1000)break;
gr_set_bitmap(dec->texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
if((dec->poly[i].backfaced == 1) && (dec->backfaced_texture > -1)){
gr_set_bitmap(dec->backfaced_texture, 0, GR_BITBLT_MODE_NORMAL, 1.0f );
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->backfaced_texture));
}else{
mprintf(("drawing decal poly %d, with bitmap %d\n", i, dec->texture));
}
// gr_set_cull(0);
g3_draw_poly(3, vlist, TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT | TMAP_FLAG_RGB | TMAP_FLAG_GOURAUD );
// gr_set_cull(1);
}
}
}
// mprintf(("decals rendered\n"));
#endif
}
+80
View File
@@ -0,0 +1,80 @@
//header file for makeing decals-Bobboau
#ifndef _DECAL_H
#define _DECAL_H
#define MAX_DECAL_POLY 20
#define MAX_DECAL_POLY_POINT 10
#define MAX_DECAL_DEFPOINTS 1000
#define MAX_DECAL_POINT 10
#define MAX_SHIP_DECALS 25
#include "globalincs/pstypes.h"
#include "object/object.h"
#define DP_EOF 0
#define DP_DEFPOINTS 1
#define DP_FLATPOLY 2
#define DP_TMAPPOLY 3
#define DP_SORTNORM 4
#define DP_BOUNDBOX 5
typedef struct decal_model{ //this will store a triangulated version of the ships polygons
struct{
int point[3]; //an index to the vert list-Bobboau
vector center; //the center of the poly
float radius; //the max radius of the poly
}poly[MAX_DECAL_POLY];
vector vert[MAX_DECAL_DEFPOINTS]; //the defpoints-Bobboau
int n_polys;
}decal_model;
//extern decal_model d_model;
typedef struct decal{
struct{
int backfaced; //flag that this poly uses the backfaced texture
uv_pair uv[MAX_DECAL_POLY_POINT]; //uv coordanants
int point[MAX_DECAL_POLY_POINT]; //an index to the vert list-Bobboau
int n_poly;
vector norm; //the normal used for lighting
}poly[MAX_DECAL_POLY];
vector position;
float radius;
int submodel_parent; //the submodel this is part of
vector vert[1000]; //the defpoints-Bobboau
int frames; //number of frames in an animation
int fps; //frames per second
int starting_keyframe; //the frame that indicates the end of the inital nonlooped portion and the start of the middle looped part
int ending_keyframe; //the frame that indicates the end of the loopable portion and the start of the end part
int texture; //the texture to be used, first in animation
int backfaced_texture; //the texture to be used by backfaced polys, first in animation
int is_valid; //this means it is a good decal that should be rendered-Bobboau
int n_poly; //the number of polys
int timestamp; //this is when the decal was made-Bobboau
int lifetime; //this is how long the decal should be alive for-Bobboau
int importance; //this is for big things large beam marks and bomb craters should last longer than the odd laser impacts-Bobboau
int state; //1 starting, 2 looping(mostly for beams), 3 ending, 4 static
}decal;
typedef struct decal_point{
vector pnt;
matrix orient;
float radius;
}decal_point;
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture = -1);//makes the decal
#endif
int decal_create_simple(object * obj, decal_point *point, int texture);//makes a simple non-clipped decal
void decal_render_all(object * obj); //renders all decals
int decal_create(object * obj, decal_point *point, int subobject, int texture, int backfaced_texture);//makes the decal
int decal_create_sub(void *model_ptr);
/*
int decal_is_in_face(int n, vertex vertlist[n]);//sees if a poly is inside a decal: 0 is yes, 1 is sort of, -1 is no
*/
+23 -16
View File
@@ -9,12 +9,18 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/07/07 19:55:58 penguin
* Back-port to MSVC
*
* Revision 2.0 2002/06/03 04:02:21 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:04 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -41,20 +47,21 @@
* $NoKeywords: $
*/
#include "demo.h"
#include "missionload.h"
#include "ship.h"
#include "linklist.h"
#include "freespace.h"
#include "object.h"
#include "timer.h"
#include "gamesequence.h"
#include "systemvars.h"
#include "cfile.h"
#include "missionmessage.h"
#include "missionparse.h"
#include "shipfx.h"
#include "shiphit.h"
#include "globalincs/pstypes.h"
#include "demo/demo.h"
#include "mission/missionload.h"
#include "ship/ship.h"
#include "globalincs/linklist.h"
#include "freespace2/freespace.h"
#include "object/object.h"
#include "io/timer.h"
#include "gamesequence/gamesequence.h"
#include "globalincs/systemvars.h"
#include "cfile/cfile.h"
#include "mission/missionmessage.h"
#include "mission/missionparse.h"
#include "ship/shipfx.h"
#include "ship/shiphit.h"
// -----------------------------------------------------------------------------------------------------------------------------
// DEMO DEFINES/VARS
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/Demo/Demo.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:56 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
*
*
Binary file not shown.
+236
View File
@@ -0,0 +1,236 @@
#include <dshow.h>
#include <stdio.h>
#include "osapi/osapi.h"
#include "dx8show.h"
#include "debugconsole/dbugfile.h"
//
// Constants
//
const int KEYBOARD_SAMPLE_FREQ = 200; // Sample user input on an interval
//
// Globals
//
IGraphBuilder *pGB = NULL;
IMediaControl *pMC = NULL;
IVideoWindow *pVW = NULL;
IMediaEvent *pME = NULL;
//
// Function prototypes
//
HRESULT get_interfaces(void);
bool play_media(LPTSTR movie_filename);
bool set_fullscreen(void);
void cleanup_interfaces(void);
HWND internal_hwnd = NULL;
// This define, 0 by default, if set to 1 will run window binding code which currently
// doesnt work, left in for fun
#define VIS_CODE 0
//
// Helper Macros (Jump-If-Failed, Log-If-Failed)
//
#define RUN_FUNCTION_ROF(x) if(FAILED(hr=(x))) \
{DBUGFILE_OUTPUT_0("FAILED in " #x); return false;}
#define RUN_FUNCTION_GET_INTERFACE(x) if(FAILED(hr=(x))) \
{DBUGFILE_OUTPUT_0("FAILED " #x); cleanup_interfaces(); return hr;}
#define RUN_FUNCTION(x) if(FAILED(hr=(x))) \
{DBUGFILE_OUTPUT_0("FAILED " #x);}
#define RELEASE(i) {if (i) i->Release(); i = NULL;}
void process_messages(HWND hwnd)
{
MSG msg;
while(PeekMessage(&msg, hwnd, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
void dx8show_set_hwnd(void *hwnd)
{
internal_hwnd = (HWND) hwnd;
}
bool dx8show_play_cutscene(char *movie_file)
{
HRESULT hr;
// Get DirectShow interfaces
RUN_FUNCTION_ROF(get_interfaces());
if(internal_hwnd == NULL)
{
internal_hwnd = (HWND) os_get_window();
}
#if VIS_CODE
RUN_FUNCTION(pVW->put_Visible(OATRUE));
RUN_FUNCTION(pVW->put_Owner((OAHWND) internal_hwnd));
#endif
// Play the movie / cutscene
play_media(movie_file);
#if VIS_CODE
RUN_FUNCTION(pVW->put_Visible(OAFALSE));
RUN_FUNCTION(pVW->put_Owner(NULL));
#endif
// Release DirectShow interfaces
cleanup_interfaces();
return true;
}
HRESULT get_interfaces(void)
{
HRESULT hr = S_OK;
// Instantiate filter graph interface
RUN_FUNCTION_GET_INTERFACE(CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC, IID_IGraphBuilder, (void **) &pGB));
// Get interfaces to control playback & screensize
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaControl, (void **) &pMC));
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IVideoWindow, (void **) &pVW));
// Get interface to allow the app to wait for completion of playback
RUN_FUNCTION_GET_INTERFACE(pGB->QueryInterface(IID_IMediaEventEx, (void **)&pME));
return hr;
}
void cleanup_interfaces(void)
{
// Release the DirectShow interfaces
RELEASE(pMC);
RELEASE(pVW);
RELEASE(pME);
RELEASE(pGB);
}
bool play_media(LPTSTR movie_filename)
{
HRESULT hr;
WCHAR file_name[MAX_PATH];
#ifndef UNICODE
MultiByteToWideChar(CP_ACP, 0, movie_filename, -1, file_name, MAX_PATH);
#else
lstrcpy(file_name, movie_filename);
#endif
// Allow DirectShow to create the FilterGraph for this media file
RUN_FUNCTION_ROF(pGB->RenderFile(file_name, NULL));
// Set the message drain of the video window to point to our hidden application window. This allows
// keyboard input to be transferred to our main window for processing.
//
// If this is an audio-only or MIDI file, then put_MessageDrain will fail.
//
RUN_FUNCTION(pVW->put_MessageDrain((OAHWND) internal_hwnd));
if(set_fullscreen() == false)
{
return false;
}
// Display first frame of the movie and play
RUN_FUNCTION_ROF(pMC->Pause());
RUN_FUNCTION_ROF(pMC->Run());
// Update state variables
bool movie_continue = true;
// Enter a loop of checking for events and sampling keyboard input
while (movie_continue)
{
long event_code, param1, param2;
// Has there been a media event? Look for end of stream condition.
if(E_ABORT != pME->GetEvent(&event_code, &param1, &param2, 0))
{
// Is this the end of the movie?
if (event_code == EC_COMPLETE)
{
movie_continue = false;
}
// Free the media event resources.
RUN_FUNCTION(pME->FreeEventParams(event_code, param1, param2));
}
// Give system threads time to run (and don't sample user input madly)
Sleep(KEYBOARD_SAMPLE_FREQ);
MSG msg;
// Quits movie if escape, space or return is pressed
while(PeekMessage(&msg, internal_hwnd, 0, 0, PM_REMOVE))
{
TranslateMessage(&msg);
if(msg.message != WM_KEYDOWN)
{
DispatchMessage(&msg);
continue;
}
switch(msg.wParam )
{
case VK_ESCAPE:
case VK_SPACE:
case VK_RETURN:
{
DBUGFILE_OUTPUT_0("User skipped cut scene");
movie_continue = false;
}
}
}
}
return true;
}
bool set_fullscreen(void)
{
HRESULT hr;
LONG mode;
HWND drain=0;
if (!pVW)
{
return S_FALSE;
}
// Read current state
RUN_FUNCTION_ROF(pVW->get_FullScreenMode(&mode));
if (mode == OAFALSE)
{
// Save current message drain
RUN_FUNCTION_ROF(pVW->get_MessageDrain((OAHWND *) &drain));
// This is very important. It ensures that the video window doesnt end
// up playing behind the main window
SetFocus(drain);
// Set message drain to application main window
RUN_FUNCTION_ROF(pVW->put_MessageDrain((OAHWND) internal_hwnd));
// Switch to full-screen mode
mode = OATRUE;
RUN_FUNCTION_ROF(pVW->put_FullScreenMode(mode));
}
return true;
}
+8
View File
@@ -0,0 +1,8 @@
#ifndef _DX8SHOW_HEADER_FILE
#define _DX8SHOW_HEADER_FILE
bool dx8show_play_cutscene(char *filename);
void dx8show_set_hwnd(void *hwnd);
#endif
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -97,8 +97,8 @@ typedef struct IDirect3DViewport2 *LPDIRECT3DVIEWPORT2;
#endif
#include "vd3dtypes.h"
#include "vd3dcaps.h"
#include "directx/vd3dtypes.h"
#include "directx/vd3dcaps.h"
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -13,7 +13,7 @@
/*
* Pull in DirectDraw include file automatically:
*/
#include "vddraw.h"
#include "directx/vddraw.h"
#pragma pack(4)
+5 -5
View File
@@ -6,7 +6,7 @@
* Content: Direct3D internal include file
*@@BEGIN_MSINTERNAL
*
* $Id: vd3di.h,v 1.1 2002-06-03 03:25:56 penguin Exp $
* $Id: vd3di.h,v 2.2 2002-08-01 01:41:04 penguin Exp $
*
* History:
* Date By Reason
@@ -33,11 +33,11 @@
#include "vddrawp.h"
#if 0
//@@END_MSINTERNAL
#include "vddraw.h"
#include "directx/vddraw.h"
//@@BEGIN_MSINTERNAL
#endif
//@@END_MSINTERNAL
#include "vd3d.h"
#include "directx/vd3d.h"
// @@BEGIN_MSINTERNAL
#if !defined(BUILD_RLAPI) && !defined(BUILD_DDDDK)
@@ -45,7 +45,7 @@
#include "rlreg.h"
#include "lists.h"
#include "object.h"
#include "object/object.h"
/*
@@ -383,7 +383,7 @@ typedef struct _DIRECT3DDEVICEI
D3DVALUE perspective_tolerance;
/* Library information */
#ifdef WIN32
#ifdef _WIN32
HINSTANCE hDrvDll;
char dllname[MAXPATH];
char base[256];
+2 -2
View File
@@ -10,8 +10,8 @@
#ifndef __D3DRM_H__
#define __D3DRM_H__
#include "vddraw.h"
#include "vd3drmobj.h"
#include "directx/vddraw.h"
#include "directx/vd3drmobj.h"
#ifdef __cplusplus
extern "C" {
+2 -2
View File
@@ -11,9 +11,9 @@
#define __D3DRMDEFS_H__
#include <stddef.h>
#include "vd3dtypes.h"
#include "directx/vd3dtypes.h"
#ifdef WIN32
#ifdef _WIN32
#define D3DRMAPI __stdcall
#else
#define D3DRMAPI
+2 -2
View File
@@ -13,8 +13,8 @@
#include <objbase.h> /* Use Windows header files */
#define VIRTUAL
#include "vd3drmdef.h"
#include "vd3d.h"
#include "directx/vd3drmdef.h"
#include "directx/vd3d.h"
#ifdef __cplusplus
extern "C" {
+6 -3
View File
@@ -10,13 +10,16 @@
#ifndef __D3DRMWIN_H__
#define __D3DRMWIN_H__
#ifdef _WIN32
#ifndef WIN32
#define WIN32
#endif
#endif
#include "vd3drm.h"
#include "vddraw.h"
#include "vd3d.h"
#include "directx/vd3drm.h"
#include "directx/vddraw.h"
#include "directx/vd3d.h"
/*
* GUIDS used by Direct3DRM Windows interface
+10 -2
View File
@@ -10,14 +10,14 @@
#ifndef _D3DTYPES_H_
#define _D3DTYPES_H_
#if (! defined WIN32) && (! defined WIN95)
#if (! defined _WIN32) && (! defined WIN95)
#include "subwtype.h"
#else
#include <windows.h>
#endif
#include <float.h>
#include "vddraw.h"
#include "directx/vddraw.h"
#pragma pack(4)
@@ -305,6 +305,14 @@ typedef struct _D3DTLVERTEX {
D3DVALUE tv;
D3DVALUE dvTV;
};
union {
D3DVALUE env_u; /* Texture coordinates */
D3DVALUE dvenv_U;
};
union {
D3DVALUE env_v;
D3DVALUE dvenv_V;
};
#if (defined __cplusplus) && (defined D3D_OVERLOADS)
_D3DTLVERTEX() { }
_D3DTLVERTEX(const D3DVECTOR& v, float _rhw,
+1 -1
View File
@@ -8,7 +8,7 @@
#ifndef __DPLOBBY_INCLUDED__
#define __DPLOBBY_INCLUDED__
#include "vdplay.h"
#include "directx/vdplay.h"
#ifdef __cplusplus
extern "C" {
+1 -1
View File
@@ -10,7 +10,7 @@
#ifndef __DSOUND_INCLUDED__
#define __DSOUND_INCLUDED__
#include "vd3dtypes.h"
#include "directx/vd3dtypes.h"
#define COM_NO_WINDOWS_H
#include <objbase.h>
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2003-03-02 05:10:42 $
* $Author: penguin $
*
* Main file for dealing with exception handling
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:05 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -139,7 +142,9 @@ static void PrintTime(char *output, FILETIME TimeToPrint)
static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
{
char ModName[MAX_PATH];
#ifdef _MSC_VER
__try {
#endif
if (GetModuleFileName(ModuleHandle, ModName, sizeof(ModName)) > 0) {
// If GetModuleFileName returns greater than zero then this must
// be a valid code module address. Therefore we can try to walk
@@ -174,11 +179,13 @@ static void ShowModuleInfo(HANDLE LogFile, HINSTANCE ModuleHandle)
ModName, ModuleHandle, FileSize,
NTHeader->FileHeader.TimeDateStamp, TimeBuffer);
}
#ifdef _MSC_VER
}
// Handle any exceptions by continuing from this point.
__except(EXCEPTION_EXECUTE_HANDLER)
{
}
#endif
}
// Scan memory looking for code modules (DLLs or EXEs). VirtualQuery is used
@@ -436,15 +443,19 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
// exception handler will print '??'.
unsigned char *code = (unsigned char*)Context->Eip;
for (int codebyte = 0; codebyte < NumCodeBytes; codebyte++) {
#ifdef _MSC_VER
__try {
#endif
hprintf(LogFile, "%02x ", code[codebyte]);
#ifdef _MSC_VER
}
__except(EXCEPTION_EXECUTE_HANDLER) {
hprintf(LogFile, "?? ");
}
#endif
}
#ifdef _MSC_VER
// Time to print part or all of the stack to the error log. This allows
// us to figure out the call stack, parameters, local variables, etc.
hprintf(LogFile, "\r\n"
@@ -500,6 +511,7 @@ int __cdecl RecordExceptionInfo(PEXCEPTION_POINTERS data, const char *Message)
__except(EXCEPTION_EXECUTE_HANDLER) {
hprintf(LogFile, "Exception encountered during stack dump.\r\n");
}
#endif
RecordModuleList(LogFile);
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2002-07-07 19:55:58 $
* $Author: penguin $
*
* Header file for program exception handling
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/07 02:58:10 mharris
* ifdef around pragma
*
* Revision 1.1 2002/05/02 18:03:05 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -29,7 +35,9 @@
* $NoKeywords: $
*/
#ifdef _MSC_VER
#pragma once // Include this file only once
#endif
#ifndef __EXCEPTION_HANDLER_H
#define __EXCEPTION_HANDLER_H
+77 -61
View File
@@ -9,13 +9,37 @@
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
* $Revision: 2.5 $
* $Date: 2003-03-19 06:23:27 $
* $Author: Goober5000 $
*
* Code to move, render and otherwise deal with fireballs.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2003/03/18 01:44:30 Goober5000
* fixed some misspellings
* --Goober5000
*
* Revision 2.3 2002/12/07 01:37:41 bobboau
* 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
*
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -112,7 +136,7 @@
* Made warp in glow page in
*
* 67 3/27/98 2:17p Lawrance
* Don't play warphole closing for non-captial sized warp effects
* Don't play warphole closing for non-capital sized warp effects
*
* 66 3/26/98 5:44p Lawrance
* take out debug comments for warphole sounds playing
@@ -318,57 +342,31 @@
#include <stdlib.h>
#include "vecmat.h"
#include "tmapper.h"
#include "2d.h"
#include "3d.h"
#include "bmpman.h"
#include "model.h"
#include "key.h"
#include "physics.h"
#include "floating.h"
#include "model.h"
#include "lighting.h"
#include "object.h"
#include "ship.h"
#include "systemvars.h"
#include "fireballs.h"
#include "linklist.h"
#include "gamesnd.h"
#include "localize.h"
#include "math/vecmat.h"
#include "graphics/tmapper.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "bmpman/bmpman.h"
#include "model/model.h"
#include "io/key.h"
#include "physics/physics.h"
#include "math/floating.h"
#include "model/model.h"
#include "lighting/lighting.h"
#include "object/object.h"
#include "ship/ship.h"
#include "globalincs/systemvars.h"
#include "fireball/fireballs.h"
#include "globalincs/linklist.h"
#include "gamesnd/gamesnd.h"
#include "localization/localize.h"
#define WARPHOLE_GROW_TIME (1.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
int wm;
#define WARPHOLE_GROW_TIME (3.5f) // time for warphole to reach max size (also time to shrink to nothing once it begins to shrink)
#define MAX_FIREBALL_LOD 4
typedef struct fireball_lod {
char filename[MAX_FILENAME_LEN];
int bitmap_id;
int num_frames;
int fps;
} fireball_lod;
typedef struct fireball_info {
int lod_count;
fireball_lod lod[4];
} fireball_info;
// flag values for fireball struct flags member
#define FBF_WARP_CLOSE_SOUND_PLAYED (1<<0)
#define FBF_WARP_CAPTIAL_SIZE (1<<1)
#define FBF_WARP_CRUISER_SIZE (1<<2)
typedef struct fireball {
int objnum; // If -1 this object is unused
int fireball_info_index; // Index into Fireball_info array
int current_bitmap;
int orient; // For fireballs, which orientation. For warps, 0 is warpin, 1 is warpout
int flags; // see #define FBF_*
char lod; // current LOD
float time_elapsed; // in seconds
float total_time; // total lifetime of animation in seconds
} fireball;
#define MAX_FIREBALLS 200
fireball Fireballs[MAX_FIREBALLS];
@@ -401,12 +399,16 @@ void fireball_play_warphole_open_sound(int ship_class, fireball *fb)
if((ship_class >= 0) && (ship_class < Num_ship_types)){
if ( Ship_info[ship_class].flags & SIF_HUGE_SHIP ) {
sound_index = SND_CAPITAL_WARP_IN;
fb->flags |= FBF_WARP_CAPTIAL_SIZE;
fb->flags |= FBF_WARP_CAPITAL_SIZE;
} else if ( Ship_info[ship_class].flags & SIF_BIG_SHIP ) {
range_multiplier = 6.0f;
fb->flags |= FBF_WARP_CRUISER_SIZE;
}
}
else
{
sound_index = fb->warp_open_sound_index;
}
snd_play_3d(&Snds[sound_index], &fireball_objp->pos, &Eye_position, fireball_objp->radius, NULL, 0, 1.0f, SND_PRIORITY_DOUBLE_INSTANCE, NULL, range_multiplier); // play warp sound effect
}
@@ -422,10 +424,12 @@ void fireball_play_warphole_close_sound(fireball *fb)
sound_index = SND_WARP_OUT;
if ( fb->flags & FBF_WARP_CAPTIAL_SIZE ) {
if ( fb->flags & FBF_WARP_CAPITAL_SIZE ) {
sound_index = SND_CAPITAL_WARP_OUT;
} else if ( fb->flags & FBF_WARP_VIA_SEXP ) {
sound_index = fb->warp_close_sound_index;
} else {
// AL 27-3-98: Decided that warphole closing is only required for captial ship sized warp effects.
// AL 27-3-98: Decided that warphole closing is only required for capital ship sized warp effects.
return;
}
@@ -502,7 +506,9 @@ void fireball_load_data()
if ( Warp_glow_bitmap == -1 ) {
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
}
}
// polymodel Warp_pm;
}
@@ -531,6 +537,11 @@ void fireball_init()
Fireballs[i].objnum = -1;
}
mprintf(("loading warp model"));
wm = -1;
wm = model_load("warp.pof", 0, NULL, 0);
mprintf((" %d\n", wm));
}
@@ -624,9 +635,10 @@ void fireball_render(object * obj)
//rad = (fb->total_time - t )*obj->radius/WARPHOLE_GROW_TIME;
}
//rad = obj->radius;
// obj->alt_rad = rad;
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius );
warpin_render(&obj->orient, &obj->pos, Fireballs[num].current_bitmap, rad, percent_life, obj->radius, (Fireballs[num].flags & FBF_WARP_FORCE_OLD) );
}
break;
@@ -921,7 +933,7 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
vector temp;
behind = 1;
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.fvec, dist);
vm_vec_scale_add(&temp, &Eye_position, &Eye_matrix.vec.fvec, dist);
g3_rotate_vertex(&v, &temp);
// if still behind, bail and go with default
@@ -971,7 +983,7 @@ int fireball_get_lod(vector *pos, fireball_info *fd, float size)
}
// Create a fireball, return object index.
int fireball_create( vector * pos, int fireball_type, int parent_obj, float size, int reverse, vector *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res)
int fireball_create( vector * pos, int fireball_type, int parent_obj, float size, int reverse, vector *velocity, float warp_lifetime, int ship_class, matrix *orient_override, int low_res, int extra_flags, int warp_open_sound, int warp_close_sound)
{
int n, objnum, fb_lod;
object *obj;
@@ -1040,7 +1052,11 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
fl = &fd->lod[fb_lod];
fb->lod = (char)fb_lod;
fb->flags = 0;
fb->flags = extra_flags;
fb->warp_open_sound_index = warp_open_sound;
fb->warp_close_sound_index = warp_close_sound;
matrix orient;
if(orient_override != NULL){
orient = *orient_override;
@@ -1088,8 +1104,8 @@ int fireball_create( vector * pos, int fireball_type, int parent_obj, float size
if (reverse) {
fb->orient = 1;
// if warp out, then reverse the orientation
vm_vec_scale( &obj->orient.fvec, -1.0f ); // Reverse the forward vector
vm_vec_scale( &obj->orient.rvec, -1.0f ); // Reverse the right vector
vm_vec_scale( &obj->orient.vec.fvec, -1.0f ); // Reverse the forward vector
vm_vec_scale( &obj->orient.vec.rvec, -1.0f ); // Reverse the right vector
} else {
fb->orient = 0;
}
+59 -8
View File
@@ -5,17 +5,32 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
*/
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2003-03-19 06:23:27 $
* $Author: Goober5000 $
*
* Prototypes for fireball functions
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2003/03/02 05:12:39 penguin
* Moved "extern int wm" declaration inside the header #ifdef block
* - penguin
*
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -157,8 +172,8 @@
#ifndef _FIREBALLS_H
#define _FIREBALLS_H
#include "object.h"
#include "cfile.h"
#include "object/object.h"
#include "cfile/cfile.h"
// these values correspond to the fireball.tbl entries
#define FIREBALL_EXPLOSION_MEDIUM 0 // Used for the 4 little explosions before a ship explodes
@@ -172,6 +187,40 @@
#define FIREBALL_NUM_LARGE_EXPLOSIONS 2
// all this moved here by Goober5000 because it makes more sense in the H file
typedef struct fireball_lod {
char filename[MAX_FILENAME_LEN];
int bitmap_id;
int num_frames;
int fps;
} fireball_lod;
typedef struct fireball_info {
int lod_count;
fireball_lod lod[4];
} fireball_info;
// flag values for fireball struct flags member
#define FBF_WARP_CLOSE_SOUND_PLAYED (1<<0)
#define FBF_WARP_CAPITAL_SIZE (1<<1)
#define FBF_WARP_CRUISER_SIZE (1<<2)
#define FBF_WARP_FORCE_OLD (1<<3) // Goober5000
#define FBF_WARP_VIA_SEXP (1<<4) // Goober5000
typedef struct fireball {
int objnum; // If -1 this object is unused
int fireball_info_index; // Index into Fireball_info array
int current_bitmap;
int orient; // For fireballs, which orientation. For warps, 0 is warpin, 1 is warpout
int flags; // see #define FBF_*
char lod; // current LOD
float time_elapsed; // in seconds
float total_time; // total lifetime of animation in seconds
int warp_open_sound_index; // for warp-effect - Goober5000
int warp_close_sound_index; // for warp-effect - Goober5000
} fireball;
// end move
void fireball_init();
void fireball_render(object * obj);
void fireball_delete( object * obj );
@@ -181,7 +230,7 @@ void fireball_process_post(object * obj, float frame_time);
// reversed is for warp_in/out effects
// Velocity: If not NULL, the fireball will move at a constant velocity.
// warp_lifetime: If warp_lifetime > 0.0f then makes the explosion loop so it lasts this long. Only works for warp effect
int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0);
int fireball_create(vector *pos, int fireball_type, int parent_obj, float size, int reversed=0, vector *velocity=NULL, float warp_lifetime=0.0f, int ship_class=-1, matrix *orient=NULL, int low_res=0, int extra_flags=0, int warp_open_sound=0, int warp_close_sound=0);
void fireball_render_plane(int plane);
void fireball_close();
void fireball_level_close();
@@ -200,7 +249,9 @@ float fireball_lifeleft( object *obj );
float fireball_lifeleft_percent( object *obj );
// internal function to draw warp grid.
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int force_old = 0 );
extern int Warp_glow_bitmap; // Internal
extern int wm;
#endif /* _FIREBALLS_H */
+160 -58
View File
@@ -7,15 +7,50 @@
*
*/
/*
/*
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
* $Revision: 2.8 $
* $Date: 2003-08-31 06:00:41 $
* $Author: bobboau $
*
* Code for rendering the warp in effects for ships
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2003/03/19 23:06:40 Goober5000
* bit o' housecleaning
* --Goober5000
*
* Revision 2.6 2003/03/19 22:49:32 Goober5000
* added some mission flags
* --Goober5000
*
* Revision 2.5 2003/03/19 06:23:27 Goober5000
* added warp-effect sexp
* --Goober5000
*
* Revision 2.4 2003/03/18 01:44:30 Goober5000
* fixed some misspellings
* --Goober5000
*
* Revision 2.3 2003/01/05 23:41:50 bobboau
* disabled decals (for now), removed the warp ray thingys,
* made some better error mesages while parseing weapons and ships tbls,
* and... oh ya, added glow mapping
*
* Revision 2.2 2002/11/14 04:18:16 bobboau
* added warp model and type 1 glow points
* and well as made the new glow file type,
* some general improvement to fighter beams,
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -111,24 +146,28 @@
*/
#include "vecmat.h"
#include "tmapper.h"
#include "2d.h"
#include "3d.h"
#include "bmpman.h"
#include "model.h"
#include "key.h"
#include "physics.h"
#include "floating.h"
#include "model.h"
#include "lighting.h"
#include "object.h"
#include "ship.h"
#include "systemvars.h"
#include "animplay.h"
#include "fireballs.h"
#include "linklist.h"
#include "timer.h"
#include "math/vecmat.h"
#include "graphics/tmapper.h"
#include "graphics/2d.h"
#include "render/3d.h"
#include "bmpman/bmpman.h"
#include "model/model.h"
#include "io/key.h"
#include "physics/physics.h"
#include "math/floating.h"
#include "model/model.h"
#include "lighting/lighting.h"
#include "object/object.h"
#include "ship/ship.h"
#include "globalincs/systemvars.h"
#include "anim/animplay.h"
#include "fireball/fireballs.h"
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "weapon/beam.h"
#include "mission/missionparse.h"
extern int wm;
DCF(norm,"normalize a zero length vector")
{
@@ -158,7 +197,11 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
}
void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius )
#define wSTUFF_VERTICES() do { verts[0]->u = 0.5f; verts[0]->v = 0.0f; verts[1]->u = 1.0f; verts[1]->v = 0.0f; verts[2]->u = 1.0f; verts[2]->v = 1.0f; verts[3]->u = 0.5f; verts[3]->v = 1.0f; } while(0);
#define wR_VERTICES() do { g3_rotate_vertex(verts[0], &bottom1); g3_rotate_vertex(verts[1], &bottom2); g3_rotate_vertex(verts[2], &top2); g3_rotate_vertex(verts[3], &top1); } while(0);
#define wP_VERTICES() do { for(idx=0; idx<4; idx++){ g3_project_vertex(verts[idx]); } } while(0);
void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius, int force_old)
{
int i;
@@ -166,51 +209,116 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
// gr_zbuffering = 0;
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
float Grid_depth = radius/2.5f;
vector center;
vm_vec_scale_add( &center, pos, &orient->fvec, -(max_radius/2.5f)/3.0f );
vm_vec_scale_add( &center, pos, &orient->vec.fvec, -(max_radius/2.5f)/3.0f );
// Warp_Map = texture_bitmap_num;//sets the warp map, and thus sets the interp flag for this being a warpin effect
vector vecs[5];
vertex verts[5];
vm_vec_scale_add( &vecs[0], &center, &orient->uvec, radius );
vm_vec_scale_add2( &vecs[0], &orient->rvec, -radius );
vm_vec_scale_add2( &vecs[0], &orient->fvec, Grid_depth );
if(wm > -1 && !force_old && !(The_mission.flags & MISSION_FLAG_OLD_WARP_EFFECT)){
float model_Interp_scale_x = radius /20;
float model_Interp_scale_y = radius /20;
float model_Interp_scale_z = radius /20;
vm_vec_scale_add( &vecs[1], &center, &orient->uvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->rvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->fvec, Grid_depth );
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, texture_bitmap_num, (radius/max_radius) );
float dist = vm_vec_dist_quick( pos, &Eye_position );
vm_vec_scale_add( &vecs[2], &center, &orient->uvec, -radius );
vm_vec_scale_add2( &vecs[2], &orient->rvec, radius );
vm_vec_scale_add2( &vecs[2], &orient->fvec, Grid_depth );
model_set_detail_level((int)(dist / (radius * 10.0f)));
gr_set_cull(0);
model_render( wm, orient, pos, MR_NO_LIGHTING | MR_NORMAL);
gr_set_cull(1);
vm_vec_scale_add( &vecs[3], &center, &orient->uvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->rvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->fvec, Grid_depth );
// Warp_Map = -1;//un sets the warp map
// vm_vec_scale_add( &vecs[4], &center, &orient->fvec, -Grid_depth );
vecs[4] = center;
model_Interp_scale_x = 1.0f;
model_Interp_scale_y = 1.0f;
model_Interp_scale_z = 1.0f;
set_warp_globals(model_Interp_scale_x, model_Interp_scale_y, model_Interp_scale_z, -1, 0.0f);
gr_set_cull(0);
/*
//this is that half done effect that was pissing people off-Bobboau
matrix m;
vector ray_dir;
vm_vector_2_matrix(&m, &orient->vec.fvec, NULL, NULL);//this is the beam things that will come outof the point-Bobboau
float angle = ANG_TO_RAD(135.0f);
if(life_percent < 0.2f){
angle = ANG_TO_RAD(135.0f * (life_percent * 5.0f));
}
for(int idx=0; idx<1; idx++){
vm_vec_random_cone(&ray_dir, &orient->vec.fvec, angle, &m);
mprintf(( "ray direction %f %f %f, orentation %f %f %f, angle %f\n",ray_dir.xyz.x, ray_dir.xyz.y, ray_dir.xyz.z, orient->vec.fvec.xyz.x, orient->vec.fvec.xyz.y, orient->vec.fvec.xyz.z, angle));
vector p_temp = *pos;
vm_vec_scale_add(&p_temp, pos, &ray_dir, (max_radius * 10 * frand_range(0.75f, 0.9f)));
mprintf(( "end %f %f %f",p_temp.xyz.x, p_temp.xyz.y, p_temp.xyz.z));
verts[0].u = 0.01f; verts[0].v = 0.01f;
verts[1].u = 0.99f; verts[1].v = 0.01f;
verts[2].u = 0.99f; verts[2].v = 0.99f;
verts[3].u = 0.01f; verts[3].v = 0.99f;
verts[4].u = 0.5f; verts[4].v = 0.5f;
vertex h1[4]; // halves of a beam section
vertex *verts[4] = { &h1[0], &h1[1], &h1[2], &h1[3] };
vector top1, bottom1, top2, bottom2;
for (i=0; i<5; i++ ) {
g3_rotate_vertex( &verts[i], &vecs[i] );
beam_calc_facing_pts(&top1, &bottom1, &ray_dir, pos, 1.0f, 1.0f);
beam_calc_facing_pts(&top2, &bottom2, &ray_dir, &p_temp, 1.0f, 1.0f);
mprintf(( "top1 %f %f %f, botom1 %f %f %f, \n",top1.xyz.x, top1.xyz.y, top1.xyz.z, bottom1.xyz.x, bottom1.xyz.y, bottom1.xyz.z));
mprintf(( "top2 %f %f %f, botom2 %f %f %f, \n",top2.xyz.x, top2.xyz.y, top2.xyz.z, bottom2.xyz.x, bottom2.xyz.y, bottom2.xyz.z));
wR_VERTICES(); // rotate and project the vertices
wP_VERTICES();
wSTUFF_VERTICES(); // stuff the beam with creamy goodness (texture coords)
gr_set_bitmap(Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.9999f);
g3_draw_poly( 4, verts, TMAP_FLAG_TILED | TMAP_FLAG_TEXTURED | TMAP_FLAG_CORRECT); // added TMAP_FLAG_TILED flag for beam texture tileing -Bobboau
}
*/
gr_set_cull(1);
vecs[4] = center; //this is for the warp glow-Bobboau
verts[4].u = 0.5f; verts[4].v = 0.5f;
g3_rotate_vertex( &verts[4], &vecs[4] );
}else{
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
vm_vec_scale_add( &vecs[0], &center, &orient->vec.uvec, radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
vm_vec_scale_add( &vecs[1], &center, &orient->vec.uvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[1], &orient->vec.fvec, Grid_depth );
vm_vec_scale_add( &vecs[2], &center, &orient->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.fvec, Grid_depth );
vm_vec_scale_add( &vecs[3], &center, &orient->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
// vm_vec_scale_add( &vecs[4], ¢er, &orient->vec.fvec, -Grid_depth );
vecs[4] = center;
verts[0].u = 0.01f; verts[0].v = 0.01f;
verts[1].u = 0.99f; verts[1].v = 0.01f;
verts[2].u = 0.99f; verts[2].v = 0.99f;
verts[3].u = 0.01f; verts[3].v = 0.99f;
verts[4].u = 0.5f; verts[4].v = 0.5f;
for (i=0; i<5; i++ ) {
g3_rotate_vertex( &verts[i], &vecs[i] );
}
draw_face( &verts[0], &verts[4], &verts[1] );
draw_face( &verts[1], &verts[4], &verts[2] );
draw_face( &verts[4], &verts[3], &verts[2] );
draw_face( &verts[0], &verts[3], &verts[4] );
}
draw_face( &verts[0], &verts[4], &verts[1] );
draw_face( &verts[1], &verts[4], &verts[2] );
draw_face( &verts[4], &verts[3], &verts[2] );
draw_face( &verts[0], &verts[3], &verts[4] );
if ( Warp_glow_bitmap != -1 ) {
gr_set_bitmap( Warp_glow_bitmap, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
@@ -259,9 +367,3 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
gr_zbuffer_set( saved_gr_zbuffering );
}
File diff suppressed because it is too large. Load diff
+8 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/FREESPACE2/FreeSpace.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* FreeSpace, the game, not the project, header information.
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -147,9 +150,9 @@
#define _FREESPACE_H
#ifndef STAMPER_PROGRAM // because of all the dependancies, I have to do this...yuck!!! MWA 7/21/97
#include "pstypes.h"
#include "systemvars.h"
#include "2d.h"
#include "globalincs/pstypes.h"
#include "globalincs/systemvars.h"
#include "graphics/2d.h"
// --------------------------------------------------------------------------------------------------------
// FREESPACE DEFINES/VARS
+1 -1
View File
@@ -1,6 +1,6 @@
//Microsoft Developer Studio generated resource script.
//
#include "freespaceresource.h"
#include "FreespaceResource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
+8 -2
View File
@@ -17,6 +17,7 @@
#define IDB_GOAL_FAIL 122
#define IDI_APP_ICON 124
#define IDD_GEN 127
#define IDD_RT_VSELECT 128
#define IDC_LIST_DEBUG 1000
#define IDC_DEBUG_TEXT1 1001
#define IDC_DEBUG_TEXT2 1002
@@ -73,6 +74,11 @@
#define IDC_FIELD2 1065
#define IDC_FIELD3 1066
#define IDC_PXO_REFRESH 1067
#define IDC_COMBO_VCARD 1069
#define IDC_COMBO_VMODE 1070
#define IDC_COMBO_AATYPE 1071
#define ID_CANCEL 1072
#define ID_OK 1073
#define IDC_CON_COUNT 2000
#define IDC_FRAMECAP_STATIC 2001
#define IDC_GODSTUFF_FPS 2002
@@ -85,9 +91,9 @@
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NO_MFC 1
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 128
#define _APS_NEXT_RESOURCE_VALUE 129
#define _APS_NEXT_COMMAND_VALUE 40001
#define _APS_NEXT_CONTROL_VALUE 1068
#define _APS_NEXT_CONTROL_VALUE 1074
#define _APS_NEXT_SYMED_VALUE 101
#endif
#endif
+8 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Freespace2/LevelPaging.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Code to page in all the bitmaps at the beginning of a level.
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -53,9 +56,9 @@
* $NoKeywords: $
*/
#include "freespace.h"
#include "bmpman.h"
#include "levelpaging.h"
#include "freespace2/freespace.h"
#include "bmpman/bmpman.h"
#include "freespace2/levelpaging.h"
// All the page in functions
extern void ship_page_in();
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/FREESPACE2/LevelPaging.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Author: penguin $
*
* Code to page in all the bitmaps at the beginning of a level.
+32 -26
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/GameHelp/ContextHelp.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Functions to drive the context-sensitive help
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.2 2002/05/03 22:07:08 mharris
* got some stuff to compile
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -104,21 +110,21 @@
#include <string.h>
#include <setjmp.h>
#include "contexthelp.h"
#include "gamesequence.h"
#include "freespace.h"
#include "mainhallmenu.h"
#include "key.h"
#include "bmpman.h"
#include "2d.h"
#include "timer.h"
#include "gamehelp/contexthelp.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "menuui/mainhallmenu.h"
#include "io/key.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "io/timer.h"
#include "math.h"
#include "mouse.h"
#include "controlsconfig.h"
#include "techmenu.h"
#include "parselo.h"
#include "localize.h"
#include "alphacolors.h"
#include "io/mouse.h"
#include "controlconfig/controlsconfig.h"
#include "menuui/techmenu.h"
#include "parse/parselo.h"
#include "localization/localize.h"
#include "globalincs/alphacolors.h"
////////////////////////////////////////////////////////////////////
@@ -510,23 +516,23 @@ void parse_helptbl()
for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
stuff_int(&a);
stuff_int(&b);
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i].xyz.z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_640][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[i];
}
// get 1024x768 vertex coordinates
for (i=0; i<help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtxcount; i++) {
stuff_int(&a);
stuff_int(&b);
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.x = (float)a;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.y = (float)b;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i].xyz.z = 0.0f;
help_overlaylist[overlay_id].plinelist[GR_1024][currcount].pvtx[i] = &help_overlaylist[overlay_id].plinelist[GR_1024][currcount].vtx[i];
}
}
//mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].y));
//mprintf(("Found pline - start location (%f,%f), end location (%f,%f)\n", help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].xyz.x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[0].xyz.y, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].xyz.x, help_overlaylist[overlay_id].plinelist[GR_640][currcount].vtx[2].xyz.y));
help_overlaylist[overlay_id].plinecount++;
} else if (optional_string("+text")) {
@@ -668,11 +674,11 @@ void nudgetext_y(int textnum, int amount)
}
void nudgepline_x(int plinenum, int plinevert, int amount)
{
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].x += amount;
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.x += amount;
}
void nudgepline_y(int plinenum, int plinevert, int amount)
{
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].y += amount;
help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[plinevert].xyz.y += amount;
}
void nudgerbracket_x(int num, int amount)
{
@@ -708,7 +714,7 @@ void showplinepos(int plinenum)
dc_printf("pline %d on overlay %d vertices are now ", plinenum, current_helpid, help_overlaylist[current_helpid].textlist[gr_screen.res][plinenum].y_coord );
for (i=0; i<help_overlaylist[current_helpid].plinelist[GR_640][plinenum].vtxcount; i++)
{
dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].y);
dc_printf("(%3.0f %3.0f) ", help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.x, help_overlaylist[current_helpid].plinelist[gr_screen.res][plinenum].vtx[i].xyz.y);
}
}
+31 -18
View File
@@ -9,13 +9,25 @@
/*
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-03-18 10:07:02 $
* $Author: unknownplayer $
*
* Module for displaying in-game help
*
* $Log: not supported by cvs2svn $
* Revision 2.1.2.1 2002/09/24 18:56:42 randomtiger
* DX8 branch commit
*
* This is the scub of UP's previous code with the more up to date RT code.
* For full details check previous dev e-mails
*
* Revision 2.1 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -115,22 +127,23 @@
* $NoKeywords: $
*/
#include "contexthelp.h"
#include "gamesequence.h"
#include "freespace.h"
#include "key.h"
#include "bmpman.h"
#include "2d.h"
#include "timer.h"
#include "gamehelp/contexthelp.h"
#include "gamesequence/gamesequence.h"
#include "freespace2/freespace.h"
#include "io/key.h"
#include "bmpman/bmpman.h"
#include "graphics/2d.h"
#include "io/timer.h"
#include "math.h"
#include "mouse.h"
#include "controlsconfig.h"
#include "ui.h"
#include "gamesnd.h"
#include "missionscreencommon.h"
#include "alphacolors.h"
#include "beam.h"
#include "audiostr.h"
#include "io/mouse.h"
#include "controlconfig/controlsconfig.h"
#include "ui/ui.h"
#include "gamesnd/gamesnd.h"
#include "missionui/missionscreencommon.h"
#include "globalincs/alphacolors.h"
#include "weapon/beam.h"
#include "sound/audiostr.h"
#include "debugconsole/dbugfile.h"
// text positioning constats
#define TITLE_Y 35
+2 -2
View File
@@ -9,8 +9,8 @@
/*
* $Logfile: /Freespace2/code/GameHelp/GameplayHelp.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Author: penguin $
*
* Header for displaying in-game help
+7 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/GameSequence/GameSequence.cpp $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* File to control Game Sequencing
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -240,8 +243,8 @@
* States should always be referred to using the macros.
*/
#include "freespace.h"
#include "gamesequence.h"
#include "freespace2/freespace.h"
#include "gamesequence/gamesequence.h"
// local defines
#define MAX_GAMESEQ_EVENTS 20 // maximum number of events on the game sequencing queue
+6 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/GameSequence/GameSequence.h $
* $Revision: 1.1 $
* $Date: 2002-06-03 03:25:57 $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
*
* Header file for Game Sequencing items
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -331,7 +334,7 @@
#ifndef __GAMESEQUENCE_H__
#define __GAMESEQUENCE_H__
#include "pstypes.h"
#include "globalincs/pstypes.h"
// defines for game sequencing events
//
Loaded 100 of 566 files, more files were not shown because too many files have changed in this diff. Show more