Compare commits

...
Author SHA1 Message Date
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
192 changed files with 50395 additions and 4368 deletions

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
Original source (Freespace 2) by Volition, Inc.; see "credits.tbl"
Modifications by the FreeSpace Source Code Project (FSSCP)
http://fs2source.warpcore.org
FS2_OPEN STAFF:
Project leader:
Edward "Inquisitor" Gardner
Programmers:
"Bobboau"
Dennis "DTP" Pedersen
Ian "Goober5000" Warfield
Joe "Righteous1" Dowd
Mike "penguin" Harris
"Mysterial"
"PhReAk"
Thomas "Random Tiger" Whittaker
Will "Unknown PLayer" Rousnel
"WMCoolmon"
Web support:
Icefire and the staff at Volitionwatch.com
Alex "Thunder" Avery and the staff at Hard Light Productions
Special thanks to:
Volition for making FS2 such a great game
Dave Baranec for giving us the code and keeping us sanity checked
+13
View File
@@ -0,0 +1,13 @@
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.
+595 -1
View File
@@ -1,6 +1,600 @@
ChangeLog for fs2_open. All times are UTC.
Updated 2002-08-13 04:31
Updated 2002-10-31 03:46
2002-10-30 22:57 randomtiger
* code/: code.dsp (1.6.2.8), graphics/grd3d.cpp (2.2.2.18),
graphics/grd3dinternal.h (2.1.2.7), graphics/grd3dtexture.cpp
(2.1.2.16), model/modelinterp.cpp (2.3.2.1):
Changed DX8 code to not use set render and texture states if they
are already set to that value. Disabled buffer saving and
restoring code when windowed to stop DX8 debug runs from crashing.
- RT
2002-10-30 20:22 inquisitor
* code/cmdline/cmdline.h (2.10):
Bad Committ, Rolling back
2002-10-30 06:29 DTP
* code/cfile/: cfilesystem.cpp (2.5), cfile.cpp (2.5):
doh!, used upper case in include, dont know how much it matters for
*nix systems, but here it is
2002-10-30 06:26 DTP
* code/cfile/cfilesystem.cpp (2.4):
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-29 22:41 sesquipedalian
* code/parse/: sexp.cpp (2.3), sexp.h (2.3):
no message
2002-10-28 02:28 DTP
* code/cmdline/cmdline.h (2.9):
Crap, somebody may restore cmdline.h to 2 version before this.
2002-10-28 00:40 randomtiger
* code/graphics/grd3d.cpp (2.2.2.17):
Implemented screen saving code for restoring when drawing popups, a
bit slow but works. - RT
2002-10-27 23:59 DTP
* code/cfile/: cfile.cpp (2.4), cfile.h (2.3):
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:55 DTP
* code/cmdline/: cmdline.cpp (2.9), cmdline.h (2.8):
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-26 09:55 unknownplayer
* code/: freespace2/freespace.cpp (2.6.2.5), nebula/neb.cpp
(2.1.2.1):
Fixed the nebula flicker bug. Check the NO_DIRECT3D conditional
compile sections in the future for bits of code which may cause
problems due to hacks correcting for DirectX5 that no longer apply.
2002-10-26 01:24 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.10), bmpman/bmpman.h (2.0.2.7),
graphics/grd3d.cpp (2.2.2.16), graphics/grd3drender.cpp (2.3.2.15),
graphics/grd3dtexture.cpp (2.1.2.15):
Fixed debug bitmap compiling bug. Fixed tga bug. - RT
2002-10-22 23:02 randomtiger
* code/: cmdline/cmdline.cpp (2.8), cmdline/cmdline.h (2.7),
debugconsole/timerbar.h (1.2), hud/hudtargetbox.cpp (2.4),
model/modelinterp.cpp (2.5):
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 17:46 randomtiger
* Freespace2.dsp (1.7.2.4), code/bmpman/bmpman.cpp (2.2.2.9),
code/bmpman/bmpman.h (2.0.2.6), code/graphics/grd3dtexture.cpp
(2.1.2.14):
Fixed new TGA code texturing bug. - RT
2002-10-22 17:42 randomtiger
* code/: freespace2/freespace.cpp (2.13),
missionui/missionpause.cpp (2.3):
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-21 16:33 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.8), bmpman/bmpman.h (2.0.2.5),
graphics/grd3d.cpp (2.2.2.15), graphics/grd3dinternal.h (2.1.2.6),
graphics/grd3drender.cpp (2.3.2.14), graphics/grd3dtexture.cpp
(2.1.2.13):
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
2002-10-20 22:21 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.7), graphics/grd3d.cpp
(2.2.2.14), graphics/grd3drender.cpp (2.3.2.13), palman/palman.cpp
(2.1.2.1):
Some incomplete code to handle background drawing when message
boxes are drawn. It doesnt work but its a good base for someone to
start from. - RT
2002-10-19 23:56 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.6), bmpman/bmpman.h (2.0.2.4),
globalincs/pstypes.h (2.4.2.3), graphics/grd3d.cpp (2.2.2.13),
graphics/grd3dtexture.cpp (2.1.2.12):
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
2002-10-19 19:29 bobboau
* code/: controlconfig/controlsconfig.h (2.2),
controlconfig/controlsconfigcommon.cpp (2.3), model/model.h (2.5),
model/modelinterp.cpp (2.4), model/modelread.cpp (2.4),
model/modelsinc.h (2.4), object/object.cpp (2.2), osapi/outwnd.cpp
(2.2), physics/physics.cpp (2.2), physics/physics.h (2.2),
playerman/playercontrol.cpp (2.2), ship/ai.h (2.2), ship/aibig.cpp
(2.2), ship/aicode.cpp (2.8), ship/ship.cpp (2.7), ship/ship.h
(2.4), ship/shipcontrails.cpp (2.3), ship/shipcontrails.h (2.1),
ship/shiphit.cpp (2.6), starfield/starfield.cpp (2.3),
weapon/beam.cpp (2.4), weapon/beam.h (2.3), weapon/weapon.h (2.2),
weapon/weapons.cpp (2.2):
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 03:50 randomtiger
* code/: cmdline/cmdline.cpp (2.7), cmdline/cmdline.h (2.6),
freespace2/freespace.cpp (2.12), io/keycontrol.cpp (2.4),
menuui/readyroom.cpp (2.2), missionui/missionpause.cpp (2.2),
missionui/missionpause.h (2.2):
Added special pause mode for easier action screenshots. Added new
command line parameter for accessing all single missions in tech
room. - RT
2002-10-17 20:40 randomtiger
* code/: controlconfig/controlsconfig.h (2.1),
controlconfig/controlsconfigcommon.cpp (2.2), hud/hud.cpp (2.2),
hud/hud.h (2.2), io/keycontrol.cpp (2.3),
mission/missionmessage.cpp (2.2):
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-16 00:41 randomtiger
* code/graphics/: 2d.cpp (2.3.2.8), 2d.h (2.1.2.2), grd3d.cpp
(2.2.2.12), grd3d.h (2.0.2.4), grd3drender.cpp (2.3.2.12):
Fixed small bug that was stopping unactive text from displaying
greyed out Also added ability to run FS2 DX8 in 640x480, however I
needed to make a small change to 2d.cpp which invloved calling the
resolution processing code after initialising the device for D3D
only. This is because D3D8 for the moment has its own internal
launcher. Also I added a fair bit of documentation and tidied some
stuff up. - RT
2002-10-14 21:52 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.5), graphics/grd3d.cpp
(2.2.2.11), graphics/grd3drender.cpp (2.3.2.11),
graphics/grd3dtexture.cpp (2.1.2.11):
Finally tracked down and killed off that 8 bit alpha bug. So the
font, HUD and 8 bit ani's now work fine. - RT
2002-10-14 19:49 phreak
* code/graphics/gropenglw32x.cpp (1.4):
screenshots, yay!
2002-10-13 21:43 phreak
* code/graphics/gropenglw32x.cpp (1.3):
further optimizations
2002-10-12 17:48 phreak
* code/graphics/gropenglw32x.cpp (1.2):
fixed text
2002-10-11 21:35 phreak
* code/graphics/gropenglw32.cpp (1.2):
dont use this one
2002-10-11 21:30 phreak
* code/graphics/: gropenglw32.cpp (1.1), gropenglw32x.cpp (1.1):
first run at opengl for w32, only useful in main hall, barracks and
campaign room
2002-10-11 18:50 randomtiger
* code/graphics/: 2d.cpp (2.3.2.7), 2d.h (2.1.2.1), grd3d.cpp
(2.2.2.10), grd3d.h (2.0.2.3), grd3dinternal.h (2.1.2.5),
grd3drender.cpp (2.3.2.10), grd3dtexture.cpp (2.1.2.10):
Checked in fix for 16 bit problem, thanks to Righteous1 Removed a
fair bit of code that was used by the 16 bit code path which no
longer exists. 32 bit and 16 bit should now work in exactly the
same way. - RT
2002-10-08 14:33 randomtiger
* code/: graphics/grd3d.cpp (2.2.2.9), graphics/grd3drender.cpp
(2.3.2.9), graphics/grd3dtexture.cpp (2.1.2.9), osapi/outwnd.cpp
(2.1.2.1):
OK, I've fixed the z-buffer problem. However I have abandoned
using w-buffer for now because of problems. I think I know how to
solve it but Im not sure it would make much difference given the
way FS2 engine works. I have left code in there of use if anyone
wants to turn their hand to it. However for now we just need to
crack of the alpha problem then we will have FS2 fully wokring in
DX8 on GF4 in 32 bit.
2002-10-05 16:46 randomtiger
* code/: code.dsp (1.10), debugconsole/timerbar.cpp (1.1),
debugconsole/timerbar.h (1.1), freespace2/freespace.cpp (2.11),
globalincs/systemvars.h (2.2), graphics/grd3d.cpp (2.3),
graphics/grd3dinternal.h (2.2), graphics/grd3drender.cpp (2.4),
menuui/credits.cpp (2.3):
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-04 00:48 randomtiger
* code/graphics/: grd3d.cpp (2.2.2.8), grd3dinternal.h (2.1.2.4),
grd3drender.cpp (2.3.2.8), grd3dtexture.cpp (2.1.2.8):
Fixed video memory leaks Added code to cope with lost device, not
tested Got rid of some DX5 stuff we definately dont need Moved some
enum's into internal,h because gr_d3d_set_state should be able to
be called from any dx file Cleaned up some stuff - RT
2002-10-03 08:32 unknownplayer
* code/: graphics/grd3d.cpp (2.2.2.7), graphics/grd3dtexture.cpp
(2.1.2.7), osapi/osapi.cpp (2.2.2.2):
Hacked in a windowed mode so we can properly debug this without
using monitors (although I drool at the concept of having that!)
2002-10-02 17:52 randomtiger
* code/: debugconsole/dbugfile.cpp (2.1.2.3),
debugconsole/dbugfile.h (2.1.2.3), graphics/grd3d.cpp (2.2.2.6),
graphics/grd3drender.cpp (2.3.2.7), graphics/grd3dtexture.cpp
(2.1.2.6):
Fixed blue lighting bug. Put filtering flag set back in that I
accidentally removed Added some new functionality to my debuging
system - RT
2002-10-02 11:40 randomtiger
* code/: code.dsp (1.6.2.7), bmpman/bmpman.cpp (2.2.2.4),
bmpman/bmpman.h (2.0.2.3), graphics/2d.cpp (2.3.2.6),
graphics/grd3d.cpp (2.2.2.5), graphics/grd3d.h (2.0.2.2),
graphics/grd3dinternal.h (2.1.2.3), graphics/grd3drender.cpp
(2.3.2.6), graphics/grd3dtexture.cpp (2.1.2.5),
pcxutils/pcxutils.cpp (2.1.2.2):
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
2002-09-28 22:13 randomtiger
* code/: anim/animplay.cpp (2.1.2.2), bmpman/bmpman.cpp (2.2.2.3),
graphics/grd3d.cpp (2.2.2.4), graphics/grd3dinternal.h (2.1.2.2),
graphics/grd3drender.cpp (2.3.2.5), graphics/grd3dtexture.cpp
(2.1.2.4), weapon/weapons.cpp (2.1.2.2):
Sorted out some bits and pieces. The background nebula blends now
which is nice. – RT
2002-09-28 12:20 randomtiger
* code/graphics/: grd3d.cpp (2.2.2.3), grd3drender.cpp (2.3.2.4),
grd3dtexture.cpp (2.1.2.3):
Just a tiny code change that lets stuff work in 16 bit. For some
reason 16 bit code was taking a different code path for displaying
textures. So until I unstand why, Im cutting off that codepath
because it isnt easy to convert into DX8.
2002-09-28 00:18 randomtiger
* code/: bmpman/bmpman.cpp (2.2.2.2), bmpman/bmpman.h (2.0.2.2),
graphics/grd3drender.cpp (2.3.2.3), graphics/grd3dtexture.cpp
(2.1.2.2):
Did some work on trying to get textures to load from pcx, define
TX_ATTEMPT for access to it. Converted some DX7 blending calls to
DX8 which a fair difference to ingame visuals.
- RT
2002-09-24 18:56 randomtiger
* Freespace2.dsp (1.7.2.3), code/code.dsp (1.6.2.6),
code/anim/animplay.cpp (2.1.2.1), code/bmpman/bmpman.cpp (2.2.2.1),
code/bmpman/bmpman.h (2.0.2.1), code/cfile/cfile.cpp (2.3.2.1),
code/cmeasure/cmeasure.cpp (2.1.2.1),
code/controlconfig/controlsconfig.cpp (2.1.2.1),
code/cutscene/cutscenes.cpp (2.2.2.4), code/cutscene/movie.cpp
(2.1.2.4), code/cutscene/movie.h (2.1.2.2),
code/debugconsole/console.cpp (2.1.2.1),
code/debugconsole/dbugfile.cpp (2.1.2.2),
code/debugconsole/dbugfile.h (2.1.2.2),
code/freespace2/freespace.cpp (2.6.2.4),
code/freespace2/freespace.rc (2.0.2.1),
code/freespace2/freespaceresource.h (2.0.2.1),
code/gamehelp/gameplayhelp.cpp (2.1.2.1), code/globalincs/pstypes.h
(2.4.2.2), code/graphics/2d.cpp (2.3.2.5), code/graphics/bitblt.cpp
(2.1.2.1), code/graphics/grd3d.cpp (2.2.2.2), code/graphics/grd3d.h
(2.0.2.1), code/graphics/grd3dinternal.h (2.1.2.1),
code/graphics/grd3drender.cpp (2.3.2.2),
code/graphics/grd3dtexture.cpp (2.1.2.1),
code/graphics/grdirectdraw.cpp (2.1.2.2), code/hud/hudconfig.cpp
(2.2.2.1), code/hud/hudmessage.cpp (2.1.2.1),
code/menuui/barracks.cpp (2.2.2.1), code/menuui/credits.cpp
(2.2.2.1), code/menuui/mainhallmenu.cpp (2.3.2.4),
code/menuui/mainhalltemp.cpp (2.1.2.1), code/menuui/optionsmenu.cpp
(2.1.2.1), code/menuui/playermenu.cpp (2.2.2.1),
code/menuui/readyroom.cpp (2.1.2.1), code/menuui/techmenu.cpp
(2.1.2.1), code/menuui/trainingmenu.cpp (2.1.2.1),
code/mission/missioncampaign.cpp (2.3.2.3),
code/mission/missiongoals.cpp (2.1.2.1),
code/mission/missionhotkey.cpp (2.1.2.1),
code/mission/missionload.cpp (2.1.2.1),
code/missionui/missionbrief.cpp (2.1.2.1),
code/missionui/missioncmdbrief.cpp (2.1.2.1),
code/missionui/missiondebrief.cpp (2.2.2.1),
code/missionui/missionloopbrief.cpp (2.1.2.1),
code/missionui/missionpause.cpp (2.1.2.1),
code/missionui/missionshipchoice.cpp (2.1.2.1),
code/missionui/missionweaponchoice.cpp (2.1.2.1),
code/missionui/redalert.cpp (2.1.2.1),
code/network/multi_dogfight.cpp (2.1.2.1),
code/network/multi_ingame.cpp (2.1.2.1),
code/network/multi_pinfo.cpp (2.1.2.1),
code/network/multiteamselect.cpp (2.2.2.1),
code/network/multiui.cpp (2.4.2.1), code/pcxutils/pcxutils.cpp
(2.1.2.1), code/popup/popup.cpp (2.1.2.1), code/render/3ddraw.cpp
(2.2.2.1), code/ship/ship.cpp (2.6.2.1), code/stats/medals.cpp
(2.2.2.1), code/ui/gadget.cpp (2.1.2.1), code/weapon/weapons.cpp
(2.1.2.1):
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
2002-09-20 20:09 phreak
* code/freespace2/freespace.cpp (2.10):
did glare stuff in game_sunspot_process()
2002-09-20 20:05 phreak
* code/starfield/starfield.cpp (2.2):
glare parser stuff in stars_init()
2002-09-20 20:04 phreak
* code/starfield/starfield.h (2.2):
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:02 phreak
* code/hud/hudtarget.cpp (2.2):
lead indicator for dumbfire missiles
2002-09-20 20:01 phreak
* code/hud/hudtargetbox.cpp (2.3):
extra effects during cargo scan
2002-09-10 21:58 unknownplayer
* code/graphics/directx8/GrD3d81Stubs.cpp (1.1):
file GrD3d81Stubs.cpp was initially added on branch directx8.
2002-09-10 21:58 unknownplayer
* code/: freespace2/freespace.cpp (2.6.2.3), graphics/2d.cpp
(2.3.2.4), graphics/grdirectdraw.cpp (2.1.2.1),
graphics/directx8/GrD3D81.cpp (1.2.2.4),
graphics/directx8/GrD3D81.h (1.1.2.4),
graphics/directx8/GrD3d81Stubs.cpp (1.1.2.1):
Added the DX8 stub file, plus new CODE!
2002-09-08 02:36 unknownplayer
* code/: code.dsp (1.6.2.5), graphics/2d.cpp (2.3.2.3),
graphics/grd3d.cpp (2.2.2.1), graphics/grd3drender.cpp (2.3.2.1),
graphics/directx8/GrD3D81.cpp (1.2.2.3),
graphics/directx8/GrD3D81.h (1.1.2.3):
Framework for the new D3DRENDER class is in place, and gr_screen
function structures are now there too. The way it's done is
probably kind of inefficient, but until we're further along
actually drawing polygons we should keep it that way for
consistency's sake.
2002-09-01 08:18 unknownplayer
* Freespace2.dsp (1.7.2.2), code/code.dsp (1.6.2.4),
code/globalincs/pstypes.h (2.4.2.1), code/graphics/2d.cpp
(2.3.2.2), code/graphics/directx8/GrD3D81.cpp (1.2.2.2),
code/graphics/directx8/GrD3D81.h (1.1.2.2),
code/menuui/mainhallmenu.cpp (2.3.2.3):
Started writing some code for the new DX8.1 class and hit a serious
snag to do with window handling and DirectDraw (and possibly my
unfamiliarity with DX). It seems we may need to make some changes
further up the code because we no longer use DX through DD in 8.1
and the V code did that a lot (to go fullscreen and such check out
the device creation code)
2002-08-31 04:50 unknownplayer
* code/: code.dsp (1.6.2.3), graphics/2d.cpp (2.3.2.1),
graphics/directx8/GrD3D81.cpp (1.2.2.1),
graphics/directx8/GrD3D81.h (1.1.2.1):
Removed some older DX81 stuff I added before and changed some other
things. I'm currently thinking that I'm going to run with putting
everything into a specialized class with the d3d_init and
d3d_cleanup functions as gods. (Creation / Destruction functions -
i.e. gods :)
2002-08-31 04:48 unknownplayer
* code/graphics/directx8/grd3d81internal.h (1.2.2.1):
These are all officially now out of FS2 unless you have a specific
reason to need them. I'm running with the idea that we make a C++
class and use that as an effective way to control the code.
Rewriting V's stuff is just insanely difficult.
2002-08-28 21:47 randomtiger
* Freespace2.dsp (1.10), code/cutscene/cutscenes.cpp (2.2.2.3),
code/cutscene/movie.cpp (2.1.2.3):
Tiny change to DX branch to keep movie code optional (default off)
2002-08-28 12:39 randomtiger
* code/: code.dsp (1.6.2.2), cutscene/cutscenes.cpp (2.2.2.2),
cutscene/movie.cpp (2.1.2.2), debugconsole/dbugfile.cpp (2.1.2.1),
debugconsole/dbugfile.h (2.1.2.1), directx/dx8show.cpp (1.1.2.2),
directx/dx8show.h (1.1.2.2), freespace2/freespace.cpp (2.6.2.2),
menuui/mainhallmenu.cpp (2.3.2.2), mission/missioncampaign.cpp
(2.3.2.2), osapi/osapi.cpp (2.2.2.1), osapi/osapi.h (2.2.2.1):
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!
2002-08-28 10:51 randomtiger
* code/: code.dsp (1.9), debugconsole/dbugfile.cpp (2.1),
debugconsole/dbugfile.h (2.1), freespace2/freespace.cpp (2.9):
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-27 13:38 penguin
* Freespace2.dsp (1.9), code/code.dsp (1.8),
code/cmdline/cmdline.cpp (2.6), code/cmdline/cmdline.h (2.5),
code/cutscene/cutscenes.cpp (2.4), code/cutscene/movie.cpp (2.2),
code/cutscene/movie.h (2.2), code/directx/DShow.h (1.2),
code/directx/ddraw.lib (1.2), code/directx/dx8show.cpp (1.2),
code/directx/dx8show.h (1.2), code/directx/dxguid.lib (1.2),
code/directx/strmiids.lib (1.2), code/freespace2/freespace.cpp
(2.8), code/menuui/mainhallmenu.cpp (2.5),
code/mission/missioncampaign.cpp (2.5):
Moved DirectX8 stuff to directx8 branch; reverted to previous
2002-08-27 13:25 penguin
* code/directx/: DShow.h (1.1.2.1), ddraw.lib (1.1.2.1),
dx8show.cpp (1.1.2.1), dx8show.h (1.1.2.1), dxguid.lib (1.1.2.1),
strmiids.lib (1.1.2.1):
Moved to directx8 branch
2002-08-27 13:21 penguin
* code/: freespace2/freespace.cpp (2.6.2.1),
menuui/mainhallmenu.cpp (2.3.2.1), mission/missioncampaign.cpp
(2.3.2.1), code.dsp (1.6.2.1), cmdline/cmdline.cpp (2.4.2.1),
cmdline/cmdline.h (2.3.2.1), cutscene/cutscenes.cpp (2.2.2.1),
cutscene/movie.cpp (2.1.2.1), cutscene/movie.h (2.1.2.1),
Freespace2.dsp (1.7.2.1):
Moved to directx8 branch
2002-08-18 19:48 randomtiger
* Freespace2.dsp (1.8), code/code.dsp (1.7),
code/cmdline/cmdline.cpp (2.5), code/cmdline/cmdline.h (2.4),
code/cutscene/cutscenes.cpp (2.3), code/cutscene/movie.cpp (2.1),
code/cutscene/movie.h (2.1), code/directx/DShow.h (1.1),
code/directx/ddraw.lib (1.1), code/directx/dx8show.cpp (1.1),
code/directx/dx8show.h (1.1), code/directx/dxguid.lib (1.1),
code/directx/strmiids.lib (1.1), code/freespace2/freespace.cpp
(2.7), code/menuui/mainhallmenu.cpp (2.4),
code/mission/missioncampaign.cpp (2.4):
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-15 04:41 penguin
* code/globalincs/systemvars.h (2.1):
Added #include, needed for FRED
2002-08-13 03:40 penguin
Binary file not shown.
+4 -4
View File
@@ -43,7 +43,7 @@ RSC=rc.exe
# 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" /U "_DEBUG" /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /I "code" /D "_MBCS" /D "NDEBUG" /D "_WINDOWS" /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"
@@ -69,7 +69,7 @@ LINK32=link.exe
# 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 "USE_DX81" /U "NDEBUG" /Fr /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 "USE_DX81" /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"
@@ -79,10 +79,10 @@ BSC32=bscmake.exe
# 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 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:"Debug/fs2_open.exe" /libpath:"debug"
# ADD 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 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:"debug\fs2_open_debug.exe" /libpath:"debug"
# SUBTRACT LINK32 /pdb:none /incremental:no /map
# Begin Custom Build - Copying $(InputPath) to c:\games\freespace2
InputPath=.\Debug\fs2_open.exe
InputPath=.\debug\fs2_open_debug.exe
SOURCE="$(InputPath)"
"c:\games\freespace2\fs2_open.exe" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
+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.
+3 -80
View File
@@ -1,81 +1,4 @@
README for fs2_open, Release 0.1
WARNINGS:
========
This is very much an pre-alpha build. Don't expect too much from it!
In particular, do not run this in the same directory as existing pilot
files or anything else that you don't want to get destroyed...
I have tried to modify as little code as possible to keep the existing
Windows code from breaking, but I have not verified that this code
will still work on Windows. Some changes may be necessary.
There are occasional crashes and segfaults from time to time.
All of this was tested on my system only. I don't know if any
assumptions about my hardware have crept into the code. I guess it
goes without saying that this will only work on x86-based Linux
systems :-)
STATUS:
=======
Most 2D graphics appear to be working, although very slowly.
Improving the performance of the 2D graphic system is a high priority.
3D graphics are in a very primitive state right now. No texturing is
done, so all objects (ships, lasers, explosions, etc.) look "ghostly."
Nebula missions do not work at all.
Sound, joystick, and network are all disabled.
REQUIREMENTS:
=============
The only "non-standard" package that you will need (as far as I can
tell) is the SDL library, available at http://www.libsdl.org I think
SDL requires XFree86 release 4 or higher.
INSTALLING:
===========
There is no configure script, no options, etc. -- just a Makefile. It
is likely that you will need to adjust it to match your configuration,
in particular the location of the SDL files.
If everything is right, you should be able to run 'make' from the
fs2_open/code directory and create an 'fs2' executable.
RUNNING:
========
The fs2 executable should be copied (or symlinked) to the same
directory as the *.VP files. All the *.VP files that you need should
be here -- the code isn't smart enough to look in your CD for command
brief ANIs, etc.
It only runs in windowed mode, no full screen.
I have never run it in high-resolution mode (1024x768), so all bets
are off if you try it.
There seems to be a bug in some of the 'glob' routines that scan for
files in the 'data' directory, so you will have better results if you:
1. Keep everything in the *.VP file (i.e., no mods)
2. Only have one player file
I recommend that background graphics be turned off via the "Options"
screen or it will look very odd. Your in-game framerate will be
significantly higher if you turn off (or set to 'popup') as many HUD
gauges as possible.
Due to the painful slowness of the 2D UI, you might need to hold the
mouse button down a little longer to get buttons to activate.
===
Mike Harris (HLP penguin)
02 June 2002
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.
-700
View File
@@ -1,700 +0,0 @@
TARGET = fs2
ifeq ($(USE_SOUND), 1)
SOUND_DEF=
SOUND_OBJS= \
gamesnd/eventmusic.o \
gamesnd/gamesnd.o \
object/objectsnd.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 \
vcodec/codec1.o
else
SOUND_DEF=-DNO_SOUND
SOUND_OBJS=
endif # USE_SOUND
ifeq ($(USE_JOYSTICK), 1)
JOYSTICK_DEF=
JOYSTICK_OBJS= \
io/joy.o \
io/joy_ff.o \
io/swff_lib.o
else
JOYSTICK_DEF=-DNO_JOYSTICK
JOYSTICK_OBJS=
endif # USE_JOYSTICK
ifeq ($(USE_NETWORK), 1)
# no support for standalone server yet... (UI is Win32 specific)
NETWORK_DEF=-DNO_STANDALONE
NETWORK_OBJS= \
hud/hudobserver.o \
network/multi.o \
network/multimsgs.o \
network/multiteamselect.o \
network/multiui.o \
network/multiutil.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_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_voice.o \
network/multi_xfer.o \
network/psnet.o \
network/psnet2.o \
menuui/optionsmenumulti.o \
missionui/chatbox.o
#
# Network/stand_gui.o
#
else
NETWORK_DEF=-DNO_NETWORK -DNO_STANDALONE
NETWORK_OBJS=
endif # USE_NETWORK
ifeq ($(USE_OPENGL), 0)
OPENGL_DEF=
else
OPENGL_DEF=-DUSE_OPENGL
endif # USE_OPENGL
LDFLAGS = -g
LDLIBS = -L/usr/X11R6/lib -lSDL -lGL -lGLU -lpthread
CXXFLAGS = \
-g \
-I/usr/local/include/SDL \
-I. \
-fno-exceptions \
-D_DEBUG -DNO_CD_CHECK -UNDEBUG \
-DNO_DIRECT3D $(SOUND_DEF) $(JOYSTICK_DEF) $(NETWORK_DEF) $(OPENGL_DEF)
ANIM_OBJFILES = \
anim/animplay.o \
anim/packunpack.o
ASTEROID_OBJFILES = \
asteroid/asteroid.o
BMPMAN_OBJFILES = \
bmpman/bmpman.o
CFILE_OBJFILES = \
cfile/cfile.o \
cfile/cfilearchive.o \
cfile/cfilelist.o \
cfile/cfilesystem.o
CMDLINE_OBJFILES = \
cmdline/cmdline.o
CMEASURE_OBJFILES = \
cmeasure/cmeasure.o
CONTROLCONFIG_OBJFILES = \
controlconfig/controlsconfig.o \
controlconfig/controlsconfigcommon.o
CUTSCENE_OBJFILES = \
cutscene/cutscenes.o
DEBRIS_OBJFILES = \
debris/debris.o
DEBUGCONSOLE_OBJFILES = \
debugconsole/console.o
DEMO_OBJFILES = \
demo/demo.o
EXCEPTIONHANDLER_OBJFILES = \
exceptionhandler/exceptionhandler.o
FIREBALL_OBJFILES = \
fireball/fireballs.o \
fireball/warpineffect.o
GAMEHELP_OBJFILES = \
gamehelp/contexthelp.o \
gamehelp/gameplayhelp.o
GAMESEQUENCE_OBJFILES = \
gamesequence/gamesequence.o
# gamesnd/eventmusic.o
# gamesnd/gamesnd.o
GAMESND_OBJFILES =
# glide/glide.o
GLIDE_OBJFILES =
# globalincs/windebug.o
GLOBALINCS_OBJFILES = \
globalincs/alphacolors.o \
globalincs/crypt.o \
globalincs/systemvars.o \
globalincs/version.o
# graphics/grd3d.o
# graphics/grd3drender.o
# graphics/grd3dtexture.o
# graphics/grdirectdraw.o
# graphics/grglide.o
# graphics/grglidetexture.o
# graphics/grsoft.o
# graphics/scaler.o
# graphics/tmapgenericscans.o
# graphics/tmapscantiled128x128.o
# graphics/tmapscantiled16x16.o
# graphics/tmapscantiled256x256.o
# graphics/tmapscantiled32x32.o
# graphics/tmapscantiled64x64.o
# graphics/tmapscanline.o
# graphics/tmapper.o
GRAPHICS_OBJFILES = \
graphics/2d.o \
graphics/aaline.o \
graphics/bitblt.o \
graphics/circle.o \
graphics/colors.o \
graphics/font.o \
graphics/gradient.o \
graphics/gropengl.o \
graphics/grzbuffer.o \
graphics/line.o \
graphics/pixel.o \
graphics/rect.o \
graphics/shade.o
# hud/hudobserver.o
HUD_OBJFILES = \
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/hudreticle.o \
hud/hudshield.o \
hud/hudsquadmsg.o \
hud/hudtarget.o \
hud/hudtargetbox.o \
hud/hudwingmanstatus.o
INETFILE_OBJFILES = \
inetfile/cftp.o \
inetfile/chttpget.o \
inetfile/inetgetfile.o
# io/joy.o
# io/joy_ff.o
# io/swff_lib.o
IO_OBJFILES = \
io/key.o \
io/keycontrol.o \
io/mouse.o \
io/timer.o \
io/xmouse.o
JUMPNODE_OBJFILES = \
jumpnode/jumpnode.o
LIGHTING_OBJFILES = \
lighting/lighting.o
LOCALIZATION_OBJFILES = \
localization/fhash.o \
localization/localize.o
MATH_OBJFILES = \
math/fix.o \
math/floating.o \
math/fvi.o \
math/spline.o \
math/staticrand.o \
math/vecmat.o
# menuui/optionsmenumulti.o
MENUUI_OBJFILES = \
menuui/barracks.o \
menuui/credits.o \
menuui/fishtank.o \
menuui/mainhallmenu.o \
menuui/mainhalltemp.o \
menuui/optionsmenu.o \
menuui/playermenu.o \
menuui/readyroom.o \
menuui/snazzyui.o \
menuui/techmenu.o \
menuui/trainingmenu.o
MISSION_OBJFILES = \
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_OBJFILES = \
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_OBJFILES = \
model/modelcollide.o \
model/modelinterp.o \
model/modeloctant.o \
model/modelread.o
NEBULA_OBJFILES = \
nebula/neb.o \
nebula/neblightning.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/multimsgs.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/multiteamselect.o
# network/multiui.o
# network/psnet.o
# network/psnet2.o
# network/stand_gui.o
NETWORK_OBJFILES = \
network/multiutil.o
# object/objectsnd.o
OBJECT_OBJFILES = \
object/collidedebrisship.o \
object/collidedebrisweapon.o \
object/collideshipship.o \
object/collideshipweapon.o \
object/collideweaponweapon.o \
object/objcollide.o \
object/object.o \
object/objectsort.o
OBSERVER_OBJFILES = \
observer/observer.o
OSAPI_OBJFILES = \
osapi/osapi_unix.o \
osapi/osregistry_unix.o \
osapi/outwnd_unix.o
PALMAN_OBJFILES = \
palman/palman.o
PARSE_OBJFILES = \
parse/encrypt.o \
parse/parselo.o \
parse/sexp.o
PARTICLE_OBJFILES = \
particle/particle.o
PCXUTILS_OBJFILES = \
pcxutils/pcxutils.o
PHYSICS_OBJFILES = \
physics/physics.o
PLAYERMAN_OBJFILES = \
playerman/managepilot.o \
playerman/playercontrol.o
POPUP_OBJFILES = \
popup/popup.o \
popup/popupdead.o
RADAR_OBJFILES = \
radar/radar.o
RENDER_OBJFILES = \
render/3dclipper.o \
render/3ddraw.o \
render/3dlaser.o \
render/3dmath.o \
render/3dsetup.o
SHIP_OBJFILES = \
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_OBJFILES = \
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_OBJFILES = \
starfield/nebula.o \
starfield/starfield.o \
starfield/supernova.o
STATS_OBJFILES = \
stats/medals.o \
stats/scoring.o \
stats/stats.o
TGAUTILS_OBJFILES = \
tgautils/tgautils.o
UI_OBJFILES = \
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_OBJFILES = \
vcodec/codec1.o
WEAPON_OBJFILES = \
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
# SOUND_OBJFILES
# INETFILE_OBJFILES
# EXCEPTIONHANDLER_OBJFILES
OBJFILES = \
ANIM_OBJFILES \
ASTEROID_OBJFILES \
BMPMAN_OBJFILES \
CFILE_OBJFILES \
CMDLINE_OBJFILES \
CMEASURE_OBJFILES \
CONTROLCONFIG_OBJFILES \
CUTSCENE_OBJFILES \
DEBRIS_OBJFILES \
DEBUGCONSOLE_OBJFILES \
FIREBALL_OBJFILES \
GAMEHELP_OBJFILES \
GAMESEQUENCE_OBJFILES \
GAMESND_OBJFILES \
GLIDE_OBJFILES \
GLOBALINCS_OBJFILES \
GRAPHICS_OBJFILES \
HUD_OBJFILES \
IO_OBJFILES \
JUMPNODE_OBJFILES \
LIGHTING_OBJFILES \
MATH_OBJFILES \
MENUUI_OBJFILES \
MISSION_OBJFILES \
MISSIONUI_OBJFILES \
MODEL_OBJFILES \
NETWORK_OBJFILES \
OBJECT_OBJFILES \
OBSERVER_OBJFILES \
OSAPI_OBJFILES \
PALMAN_OBJFILES \
PARSE_OBJFILES \
PARTICLE_OBJFILES \
PCXUTILS_OBJFILES \
PHYSICS_OBJFILES \
PLAYERMAN_OBJFILES \
POPUP_OBJFILES \
RADAR_OBJFILES \
RENDER_OBJFILES \
SHIP_OBJFILES \
STARFIELD_OBJFILES \
STATS_OBJFILES \
UI_OBJFILES \
VCODEC_OBJFILES \
WEAPON_OBJFILES \
NEBULA_OBJFILES \
LOCALIZATION_OBJFILES \
TGAUTILS_OBJFILES \
DEMO_OBJFILES
# SOUND_OBJFILES
# INETFILE_OBJFILES
# EXCEPTIONHANDLER_OBJFILES
LIB_OBJFILES = \
$(ANIM_OBJFILES) \
$(ASTEROID_OBJFILES) \
$(BMPMAN_OBJFILES) \
$(CFILE_OBJFILES) \
$(CMDLINE_OBJFILES) \
$(CMEASURE_OBJFILES) \
$(CONTROLCONFIG_OBJFILES) \
$(CUTSCENE_OBJFILES) \
$(DEBRIS_OBJFILES) \
$(DEBUGCONSOLE_OBJFILES) \
$(FIREBALL_OBJFILES) \
$(GAMEHELP_OBJFILES) \
$(GAMESEQUENCE_OBJFILES) \
$(GAMESND_OBJFILES) \
$(GLIDE_OBJFILES) \
$(GLOBALINCS_OBJFILES) \
$(GRAPHICS_OBJFILES) \
$(HUD_OBJFILES) \
$(IO_OBJFILES) \
$(JUMPNODE_OBJFILES) \
$(LIGHTING_OBJFILES) \
$(MATH_OBJFILES) \
$(MENUUI_OBJFILES) \
$(MISSION_OBJFILES) \
$(MISSIONUI_OBJFILES) \
$(MODEL_OBJFILES) \
$(NETWORK_OBJFILES) \
$(OBJECT_OBJFILES) \
$(OBSERVER_OBJFILES) \
$(OSAPI_OBJFILES) \
$(PALMAN_OBJFILES) \
$(PARSE_OBJFILES) \
$(PARTICLE_OBJFILES) \
$(PCXUTILS_OBJFILES) \
$(PHYSICS_OBJFILES) \
$(PLAYERMAN_OBJFILES) \
$(POPUP_OBJFILES) \
$(RADAR_OBJFILES) \
$(RENDER_OBJFILES) \
$(SHIP_OBJFILES) \
$(STARFIELD_OBJFILES) \
$(STATS_OBJFILES) \
$(UI_OBJFILES) \
$(VCODEC_OBJFILES) \
$(WEAPON_OBJFILES) \
$(NEBULA_OBJFILES) \
$(LOCALIZATION_OBJFILES) \
$(TGAUTILS_OBJFILES) \
$(DEMO_OBJFILES) \
$(SOUND_OBJS) \
$(JOYSTICK_OBJS) \
$(NETWORK_OBJS)
FREESPACE2_OBJFILES = \
freespace2/freespace.o \
freespace2/levelpaging.o
STUB_OBJFILES = \
windows_stub/stubs.o
# ==============================
.PHONY: all clean code \
ANIM_OBJFILES \
ASTEROID_OBJFILES \
BMPMAN_OBJFILES \
CMDLINE_OBJFILES \
CMEASURE_OBJFILES \
CONTROLCONFIG_OBJFILES \
CUTSCENE_OBJFILES \
DEBRIS_OBJFILES \
DEBUGCONSOLE_OBJFILES \
FIREBALL_OBJFILES \
GAMEHELP_OBJFILES \
GAMESEQUENCE_OBJFILES \
GAMESND_OBJFILES \
GLIDE_OBJFILES \
GLOBALINCS_OBJFILES \
GRAPHICS_OBJFILES \
HUD_OBJFILES \
IO_OBJFILES \
JUMPNODE_OBJFILES \
LIGHTING_OBJFILES \
MATH_OBJFILES \
MENUUI_OBJFILES \
MISSION_OBJFILES \
MISSIONUI_OBJFILES \
MODEL_OBJFILES \
OBJECT_OBJFILES \
OBSERVER_OBJFILES \
OSAPI_OBJFILES \
PALMAN_OBJFILES \
PARSE_OBJFILES \
PARTICLE_OBJFILES \
PCXUTILS_OBJFILES \
PHYSICS_OBJFILES \
PLAYERMAN_OBJFILES \
POPUP_OBJFILES \
RADAR_OBJFILES \
RENDER_OBJFILES \
SHIP_OBJFILES \
SOUND_OBJFILES \
STARFIELD_OBJFILES \
STATS_OBJFILES \
UI_OBJFILES \
VCODEC_OBJFILES \
WEAPON_OBJFILES \
NEBULA_OBJFILES \
LOCALIZATION_OBJFILES \
TGAUTILS_OBJFILES \
DEMO_OBJFILES \
INETFILE_OBJFILES \
EXCEPTIONHANDLER_OBJFILES \
NETWORK_OBJFILES
.cpp.o:
$(CXX) $(CXXFLAGS) -c -o $@ $<
all: $(TARGET)
clean:
rm -f $(TARGET) libcode.a core *.o *~
find -name *.o -exec rm {} \;
find -name *~ -exec rm {} \;
code: libcode.a
# ==============================
libcode.a: $(LIB_OBJFILES)
$(AR) -r $@ $(LIB_OBJFILES)
# $(CXX) -o $@ $(LIB_OBJFILES)
fs2: libcode.a $(FREESPACE2_OBJFILES) $(STUB_OBJFILES)
$(CXX) $(LDFLAGS) -o $@ $(FREESPACE2_OBJFILES) $(STUB_OBJFILES) $(LDLIBS) -L. -lcode
# exceptions to the rule...
freespace2/freespace.o: freespace2/freespace.cpp
$(CXX) $(CXXFLAGS) -fexceptions -c -o $@ $<
ANIM_OBJFILES: $(ANIM_OBJFILES)
ASTEROID_OBJFILES: $(ASTEROID_OBJFILES)
BMPMAN_OBJFILES: $(BMPMAN_OBJFILES)
CMDLINE_OBJFILES: $(CMDLINE_OBJFILES)
CMEASURE_OBJFILES: $(CMEASURE_OBJFILES)
CONTROLCONFIG_OBJFILES: $(CONTROLCONFIG_OBJFILES)
CUTSCENE_OBJFILES: $(CUTSCENE_OBJFILES)
DEBRIS_OBJFILES: $(DEBRIS_OBJFILES)
DEBUGCONSOLE_OBJFILES: $(DEBUGCONSOLE_OBJFILES)
FIREBALL_OBJFILES: $(FIREBALL_OBJFILES)
GAMEHELP_OBJFILES: $(GAMEHELP_OBJFILES)
GAMESEQUENCE_OBJFILES: $(GAMESEQUENCE_OBJFILES)
GAMESND_OBJFILES: $(GAMESND_OBJFILES)
GLIDE_OBJFILES: $(GLIDE_OBJFILES)
GLOBALINCS_OBJFILES: $(GLOBALINCS_OBJFILES)
GRAPHICS_OBJFILES: $(GRAPHICS_OBJFILES)
HUD_OBJFILES: $(HUD_OBJFILES)
IO_OBJFILES: $(IO_OBJFILES)
JUMPNODE_OBJFILES: $(JUMPNODE_OBJFILES)
LIGHTING_OBJFILES: $(LIGHTING_OBJFILES)
MATH_OBJFILES: $(MATH_OBJFILES)
MENUUI_OBJFILES: $(MENUUI_OBJFILES)
MISSION_OBJFILES: $(MISSION_OBJFILES)
MISSIONUI_OBJFILES: $(MISSIONUI_OBJFILES)
MODEL_OBJFILES: $(MODEL_OBJFILES)
OBJECT_OBJFILES: $(OBJECT_OBJFILES)
OBSERVER_OBJFILES: $(OBSERVER_OBJFILES)
OSAPI_OBJFILES: $(OSAPI_OBJFILES)
PALMAN_OBJFILES: $(PALMAN_OBJFILES)
PARSE_OBJFILES: $(PARSE_OBJFILES)
PARTICLE_OBJFILES: $(PARTICLE_OBJFILES)
PCXUTILS_OBJFILES: $(PCXUTILS_OBJFILES)
PHYSICS_OBJFILES: $(PHYSICS_OBJFILES)
PLAYERMAN_OBJFILES: $(PLAYERMAN_OBJFILES)
POPUP_OBJFILES: $(POPUP_OBJFILES)
RADAR_OBJFILES: $(RADAR_OBJFILES)
RENDER_OBJFILES: $(RENDER_OBJFILES)
SHIP_OBJFILES: $(SHIP_OBJFILES)
SOUND_OBJFILES: $(SOUND_OBJFILES)
STARFIELD_OBJFILES: $(STARFIELD_OBJFILES)
STATS_OBJFILES: $(STATS_OBJFILES)
UI_OBJFILES: $(UI_OBJFILES)
VCODEC_OBJFILES: $(VCODEC_OBJFILES)
WEAPON_OBJFILES: $(WEAPON_OBJFILES)
NEBULA_OBJFILES: $(NEBULA_OBJFILES)
LOCALIZATION_OBJFILES: $(LOCALIZATION_OBJFILES)
TGAUTILS_OBJFILES: $(TGAUTILS_OBJFILES)
DEMO_OBJFILES: $(DEMO_OBJFILES)
INETFILE_OBJFILES: $(INETFILE_OBJFILES)
EXCEPTIONHANDLER_OBJFILES: $(EXCEPTIONHANDLER_OBJFILES)
NETWORK_OBJFILES: $(NETWORK_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
+286 -28
View File
@@ -9,13 +9,42 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.11 $
* $Date: 2003-01-19 01:07:41 $
* $Author: bobboau $
*
* Code to load and manage all bitmaps for the game
*
* $Log: not supported by cvs2svn $
* 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 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
*
@@ -250,7 +279,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.
@@ -491,11 +520,17 @@
#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;
// keep this defined to use per-ship nondarkening pixels
#define BMPMAN_SPECIAL_NONDARK
@@ -506,6 +541,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
#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)
typedef union bm_extra_info {
struct {
@@ -544,6 +582,7 @@ typedef struct bitmap_entry {
// Data for animations and user bitmaps
bm_extra_info info;
int mem_taken; //how much memory it takes up
#ifdef BMPMAN_NDEBUG
// bookeeping
ubyte used_last_frame; // If set, then it was used last frame
@@ -751,8 +790,6 @@ void bm_init()
#endif
bm_free_data(i); // clears flags, bbp, data, etc
}
}
#ifdef BMPMAN_NDEBUG
@@ -899,16 +936,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.
@@ -922,8 +958,10 @@ int bm_load( char * real_filename )
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();
@@ -940,23 +978,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){
@@ -979,13 +1045,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 {
@@ -994,6 +1092,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 );
@@ -1019,7 +1118,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 );
@@ -1670,6 +1769,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 );
@@ -1703,9 +1831,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); //?
}
}
}
@@ -1788,6 +1926,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;
@@ -2050,6 +2194,8 @@ 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 )
{
@@ -2059,7 +2205,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;
@@ -2077,7 +2243,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;
@@ -2096,7 +2262,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 {
@@ -2115,7 +2300,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;
@@ -2238,7 +2423,10 @@ int bm_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];
@@ -2334,6 +2522,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()
{
@@ -2361,6 +2565,13 @@ void BM_SELECT_SCREEN_FORMAT()
#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
@@ -2392,6 +2603,12 @@ void BM_SELECT_TEX_FORMAT()
#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
@@ -2423,6 +2640,12 @@ void BM_SELECT_ALPHA_TEX_FORMAT()
#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
@@ -2611,3 +2834,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;
}
+19 -3
View File
@@ -9,13 +9,24 @@
/*
* $Logfile: /Freespace2/code/Bmpman/BmpMan.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-01-19 01:07:41 $
* $Author: bobboau $
*
* Prototypes for Bitmap Manager functions
*
* $Log: not supported by cvs2svn $
* 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 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
*
@@ -351,4 +362,9 @@ void bm_get_components(ubyte *pixel, ubyte *r, ubyte *g, ubyte *b, ubyte *a);
// 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);
extern int GLOWMAP; //this holds a reference to a map that is a fully lit version of it's index -Bobboau
int bm_is_compressed(int num);
int bm_get_size(int num);
#endif
+18 -3
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.7 $
* $Date: 2002-11-10 16:29:53 $
* $Author: DTP $
*
* Utilities for operating on files
*
* $Log: not supported by cvs2svn $
* 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 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
*
@@ -206,6 +219,7 @@
#include <sys/mman.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "parse/encrypt.h"
@@ -1768,3 +1782,4 @@ int cflush(CFILE *cfile)
+43 -29
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/CFile/cfile.h $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-11-10 16:29:53 $
* $Author: DTP $
*
* <insert description of file here>
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -378,44 +391,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))
+65 -40
View File
@@ -9,9 +9,9 @@
/*
* $Logfile: /Freespace2/code/CFile/CfileSystem.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2002-11-10 16:28:08 $
* $Author: DTP $
*
* 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,15 @@
* all those locations, inherently enforcing precedence orders.
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -123,6 +132,7 @@
#include <sys/stat.h>
#endif
#include "cmdline/cmdline.h"
#include "globalincs/pstypes.h"
#include "cfile/cfile.h"
#include "cfile/cfilesystem.h"
@@ -248,10 +258,11 @@ 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, DIR_SEPARATOR_STR );
if(strlen(Pathtypes[i].path)) {
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
// }
}
#if defined _WIN32
@@ -337,11 +348,13 @@ 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 );
if(strlen(Pathtypes[i].path)) {
strcat( filespec, Pathtypes[i].path );
strcat( filespec, DIR_SEPARATOR_STR );
}
#if defined _WIN32
strcat( filespec, "*.vp" );
@@ -362,12 +375,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, 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;
@@ -434,12 +448,17 @@ 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 );
}
@@ -448,6 +467,8 @@ void cf_build_root_list(char *cdrom_dir)
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;
//======================================================
@@ -500,7 +521,7 @@ 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, DIR_SEPARATOR_STR );
}
@@ -593,9 +614,7 @@ 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 ));
@@ -621,6 +640,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;
@@ -644,38 +664,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;
@@ -705,7 +722,7 @@ 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 );
//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 ) {
@@ -868,8 +885,8 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
strcat( pack_filename, DIR_SEPARATOR_STR );
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
// restore original filespec
strcpy(filespec, temp);
@@ -892,12 +909,13 @@ int cf_find_file_location( char *filespec, int pathtype, char *pack_filename, in
strcat( pack_filename, f->name_ext );
}
}
return 1;
}
return 1;
}
}
return 0;
return 0;
}
@@ -953,6 +971,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
if (max < 1) {
Get_file_list_filter = NULL;
return 0;
}
@@ -973,6 +992,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
if (find_handle != -1) {
do {
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -1047,8 +1067,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;
}
@@ -1091,6 +1112,7 @@ int cf_get_file_list( int max, char **list, int pathtype, char *filter, int sort
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1124,6 +1146,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;
}
@@ -1154,7 +1177,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
find_handle = _findfirst( filespec, &find );
if (find_handle != -1) {
do {
if (num_files >= max)
if (num_files >= max)
break;
if (!(find.attrib & _A_SUBDIR)) {
@@ -1229,6 +1252,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)) {
@@ -1269,6 +1293,7 @@ int cf_get_file_list_preallocated( int max, char arr[][MAX_FILENAME_LEN], char *
}
Get_file_list_filter = NULL;
return num_files;
}
@@ -1301,7 +1326,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, DIR_SEPARATOR_STR);
strcat(path, DIR_SEPARATOR_STR);
}
// add filename
+81 -4
View File
@@ -9,11 +9,51 @@
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.cpp $
* $Revision: 2.4 $
* $Date: 2002-08-07 00:44:13 $
* $Author: DTP $
* $Revision: 2.17 $
* $Date: 2003-02-22 04:13:17 $
* $Author: wmcoolmon $
*
* $Log: not supported by cvs2svn $
* 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 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
*
@@ -255,6 +295,11 @@ 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 dshowvid_arg("-dshowvid", NULL); // Allows video streaming
cmdline_parm mod_arg("-mod", NULL); //DTP modsupport
cmdline_parm fps_arg("-fps", NULL);
int Cmdline_multi_stream_chat_to_file = 0;
int Cmdline_freespace_no_sound = 0;
@@ -273,6 +318,7 @@ 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;
@@ -283,6 +329,13 @@ 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_dshowvid = 0;
int Cmdline_show_fps = 0;
static cmdline_parm Parm_list(NULL, NULL);
static int Parm_list_inited = 0;
@@ -647,7 +700,31 @@ int parse_cmdline(int argc, char *argv[])
Cmdline_start_netgame = 1;
}
if (gf4fix_arg.found() ) {
Cmdline_gf4fix = 1;
Cmdline_gf4fix = 1;
}
if (allslev_arg.found() ) {
Cmdline_allslev = 1;
}
if(phreak_arg.found() ) {
Cmdline_phreak = 1;
}
if(dshowvid_arg.found() ) {
Cmdline_dshowvid = 1;
}
if(mod_arg.found() ) {
Cmdline_mod = mod_arg.str();
}
if (fps_arg.found())
{
Cmdline_show_fps = 1;
}
return 1;
}
+45 -3
View File
@@ -5,15 +5,51 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
/*
* $Logfile: /Freespace2/code/Cmdline/cmdline.h $
* $Revision: 2.3 $
* $Date: 2002-08-07 00:44:13 $
* $Author: DTP $
* $Revision: 2.17 $
* $Date: 2003-02-22 04:13:17 $
* $Author: wmcoolmon $
*
* $Log: not supported by cvs2svn $
* 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 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.
*
@@ -202,6 +238,12 @@ 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_dshowvid; //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.
#endif
+67 -7
View File
@@ -41,7 +41,7 @@ RSC=rc.exe
# PROP Intermediate_Dir "..\Release\Profile"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "_WINDOWS" /D "WIN32" /D "NDEBUG" /U "_DEBUG" /YX /FD /c
# ADD CPP /nologo /G5 /MT /W4 /GX /Zi /Ot /Ow /Og /Oi /Oy /Ob2 /I "." /D "NDEBUG" /D "_WINDOWS" /D "WIN32" /D "USE_OPENGL" /U "_DEBUG" /FR /YX /FD /c
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
# PROP Intermediate_Dir "..\Debug\Profile"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /U "NDEBUG" /FR /YX /FD /GZ /c
# ADD CPP /nologo /G5 /MTd /W4 /Gm /Gi /GX /ZI /Od /I "." /D "_WINDOWS" /D "WIN32" /D "_DEBUG" /D "USE_OPENGL" /U "NDEBUG" /FR /YX /FD /GZ /c
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
@@ -207,6 +207,14 @@ SOURCE=.\Cutscene\Cutscenes.cpp
SOURCE=.\Cutscene\Cutscenes.h
# End Source File
# Begin Source File
SOURCE=.\cutscene\movie.cpp
# End Source File
# Begin Source File
SOURCE=.\cutscene\movie.h
# End Source File
# End Group
# Begin Group "Debris"
@@ -227,12 +235,36 @@ SOURCE=.\Debris\Debris.h
SOURCE=.\DebugConsole\Console.cpp
# End Source File
# Begin Source File
SOURCE=.\debugconsole\dbugfile.cpp
# End Source File
# Begin Source File
SOURCE=.\debugconsole\dbugfile.h
# End Source File
# Begin Source File
SOURCE=.\debugconsole\timerbar.cpp
# End Source File
# Begin Source File
SOURCE=.\debugconsole\timerbar.h
# End Source File
# End Group
# Begin Group "DirectX"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\directx\dx8show.cpp
# End Source File
# Begin Source File
SOURCE=.\directx\dx8show.h
# End Source File
# Begin Source File
SOURCE=.\DirectX\vasync.h
# End Source File
# Begin Source File
@@ -301,10 +333,6 @@ SOURCE=.\DirectX\vdvp.h
# End Source File
# Begin Source File
SOURCE=.\DirectX\vDdraw.lib
# End Source File
# Begin Source File
SOURCE=.\DirectX\vDinput.lib
# End Source File
# Begin Source File
@@ -313,7 +341,15 @@ SOURCE=.\DirectX\vDsound.lib
# End Source File
# Begin Source File
SOURCE=.\DirectX\vDxguid.lib
SOURCE=.\directx\ddraw.lib
# End Source File
# Begin Source File
SOURCE=.\directx\dxguid.lib
# End Source File
# Begin Source File
SOURCE=.\directx\strmiids.lib
# End Source File
# End Group
# Begin Group "Fireball"
@@ -2475,5 +2511,29 @@ SOURCE=.\Network\stand_gui.cpp
SOURCE=.\Network\stand_gui.h
# End Source File
# End Group
# Begin Group "Decals"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\decals\decals.cpp
# End Source File
# Begin Source File
SOURCE=.\decals\decals.h
# End Source File
# End Group
# Begin Group "ddsutils"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\ddsutils\ddsutils.cpp
# End Source File
# Begin Source File
SOURCE=.\ddsutils\ddsutils.h
# End Source File
# End Group
# End Target
# End Project
+25 -5
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfig.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:21 $
* $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,20 @@
/*
* $Logfile: /Freespace2/code/ControlConfig/ControlsConfigCommon.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $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
*
@@ -536,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, "" }
};
+5 -2
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Cutscene/Cutscenes.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 2.4 $
* $Date: 2002-08-27 13:38:57 $
* $Author: penguin $
*
* Code for the cutscenes viewer screen
*
* $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/07 19:55:58 penguin
* Back-port to MSVC
*
+175
View File
@@ -0,0 +1,175 @@
#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_dshowvid)
{
return true;
}
/*
** Check file exists
*/
FILE *fp = fopen(name,"rb");
DBUGFILE_OUTPUT_1("About to play: %s",name);
if(fp == NULL)
{
DBUGFILE_OUTPUT_0("MOVIE ERROR: Cant open movie file");
return true;
}
fclose(fp);
if(movie_shutdown_fgx == true)
{
gr_activate(0);
}
#ifdef _WIN32
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_cleanup(0);
}
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());
}
}
*/
if (gr_screen.mode==GR_OPENGL)
{
gr_opengl_init(1);
}
#endif // _WIN32
if(movie_shutdown_fgx == true)
{
gr_activate(1);
}
return true;
}
bool movie_play_two(char *name1, char *name2, int unknown_value)
{
bool result = true;
// This should not be uncommented
if(!Cmdline_dshowvid)
{
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
+254
View File
@@ -0,0 +1,254 @@
#ifdef _WIN32
#include <windows.h>
#endif
#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/timeb.h>
#include "dbugfile.h"
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()
{
char big_buffer[1000];
char temp_buff[512];
strcpy(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.
_strtime( temp_buff);
strcat(dbugfile_filename, "(");
strcat(dbugfile_filename,temp_buff);
strcat(big_buffer,temp_buff);
strcat(dbugfile_filename, ")-(");
strcat(big_buffer, " ");
_strdate( 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 >= 0)
{
if(dbugfile_filename[len] == '/' || dbugfile_filename[len] == ':')
{
dbugfile_filename[len] = '-';
}
len--;
}
// open file
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\n", version, release_type);
}
fwrite(big_buffer, sizeof(char) * strlen(big_buffer), 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);
}
+41
View File
@@ -0,0 +1,41 @@
#ifndef _DBUGFILE_HEADER_
#define _DBUGFILE_HEADER_
void dbugfile_init();
void dbugfile_deinit();
void dbugfile_sprintf(int line, char *file, const char *format, ...);
#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_9(t,a,b,c,d,e,f,g,h) dbugfile_sprintf(__LINE__, __FILE__, t,a,b,c,d,e,f,g,h);
#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_9(t,a,b,c,d,e,f,g,h) ;
#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
*/
Binary file not shown.
+240
View File
@@ -0,0 +1,240 @@
#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;
// Initialize COM
RUN_FUNCTION_ROF(CoInitialize(NULL));
// 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();
CoUninitialize();
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.
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/ExceptionHandler/ExceptionHandler.cpp $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $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);
+23 -5
View File
@@ -9,13 +9,21 @@
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2002-12-07 01:37:41 $
* $Author: bobboau $
*
* Code to move, render and otherwise deal with fireballs.
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -343,7 +351,9 @@
#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
@@ -508,7 +518,9 @@ void fireball_load_data()
if ( Warp_glow_bitmap == -1 ) {
Warp_glow_bitmap = bm_load( NOX("warpglow01") );
}
}
// polymodel Warp_pm;
}
@@ -537,6 +549,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));
}
@@ -630,6 +647,7 @@ 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 );
+13 -3
View File
@@ -5,17 +5,25 @@
* or otherwise commercially exploit the source or things you created based on the
* source.
*
*/
*/
/*
* $Logfile: /Freespace2/code/Fireball/FireBalls.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:12:39 $
* $Author: penguin $
*
* Prototypes for fireball functions
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -206,4 +214,6 @@ float fireball_lifeleft_percent( object *obj );
extern void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float radius, float life_percent, float max_radius );
extern int Warp_glow_bitmap; // Internal
extern int wm;
#endif /* _FIREBALLS_H */
+113 -38
View File
@@ -7,15 +7,23 @@
*
*/
/*
/*
* $Logfile: /Freespace2/code/Fireball/WarpInEffect.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-01-05 23:41:50 $
* $Author: bobboau $
*
* Code for rendering the warp in effects for ships
*
* $Log: not supported by cvs2svn $
* 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
*
@@ -135,6 +143,9 @@
#include "fireball/fireballs.h"
#include "globalincs/linklist.h"
#include "io/timer.h"
#include "Weapon/Beam.h"
extern int wm;
DCF(norm,"normalize a zero length vector")
{
@@ -164,15 +175,19 @@ void draw_face( vertex *v1, vertex *v2, vertex *v3 )
}
#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 i;
int saved_gr_zbuffering = gr_zbuffer_get();
// gr_zbuffering = 0;
gr_set_bitmap( texture_bitmap_num, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 1.0f );
float Grid_depth = radius/2.5f;
@@ -180,43 +195,109 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
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->vec.uvec, radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[0], &orient->vec.fvec, Grid_depth );
if(wm > -1){
float model_Interp_scale_x = radius /20;
float model_Interp_scale_y = radius /20;
float model_Interp_scale_z = max_radius /20;
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 );
set_warp_gloabals(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->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.rvec, radius );
vm_vec_scale_add2( &vecs[2], &orient->vec.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->vec.uvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.rvec, -radius );
vm_vec_scale_add2( &vecs[3], &orient->vec.fvec, Grid_depth );
// Warp_Map = -1;//un sets the warp map
// vm_vec_scale_add( &vecs[4], &center, &orient->vec.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_gloabals(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 );
@@ -265,9 +346,3 @@ void warpin_render(matrix *orient, vector *pos, int texture_bitmap_num, float ra
gr_zbuffer_set( saved_gr_zbuffering );
}
+357 -138
View File
@@ -9,13 +9,97 @@
/*
* $Logfile: /Freespace2/code/Freespace2/FreeSpace.cpp $
* $Revision: 2.6 $
* $Date: 2002-08-13 03:34:00 $
* $Revision: 2.27 $
* $Date: 2003-03-02 05:23:34 $
* $Author: penguin $
*
* Freespace main body
*
* $Log: not supported by cvs2svn $
* Revision 2.26 2003/02/23 20:55:57 wmcoolmon
* 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.
*
* Revision 2.25 2003/02/16 19:00:56 phreak
* stupid typo -- my bad
*
* Revision 2.24 2003/02/16 18:53:59 phreak
* fixed around splash screen
* 2_splash.pcx is loaded in 1024x768
* splash.pcx is loaded in 640x480 or 2_splash.pcx isn't found
*
* Revision 2.23 2003/01/30 23:18:21 phreak
* cleaned up debug output
*
* Revision 2.22 2003/01/26 20:04:32 wmcoolmon
* Minor mod to preload screen code, added separate 1024x768 logo
* -C
*
* Revision 2.21 2003/01/26 02:58:33 wmcoolmon
* 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.
*
* Revision 2.20 2003/01/20 05:40:49 bobboau
* added several sExps for turning glow points and glow maps on and off
*
* Revision 2.19 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.18 2003/01/15 21:26:35 anonymous
* fixed the demo compilation. Define FS2_DEMO globally to compile as a demo. Make sure warp.pof is in your data/models directory.
*
* Revision 2.17 2003/01/14 04:00:16 Goober5000
* allowed for up to 256 main halls
* --Goober5000
*
* Revision 2.16 2002/12/21 13:39:03 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/18 22:21:23 phreak
* 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.
*
* Revision 2.14 2002/11/18 21:34:16 phreak
* made ogl be used if "NDEBUG" is not defined and "USE_OPENGL" is defined - phreak
*
* Revision 2.13 2002/10/22 17:42:09 randomtiger
* Fixed lighting bug that caused special pause to crash on debug build.
* Also added TAB functionality for special pause that toggles HUD. - RT
*
* Revision 2.12 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.11 2002/10/05 16:46:09 randomtiger
* 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.
*
* Revision 2.10 2002/09/20 20:09:01 phreak
* did glare stuff in game_sunspot_process()
*
<<<<<<< freespace.cpp
*
*
* Revision 2.51 2002/08/04 2`:08:55 PhReAk
* Draw mem usage - will be needed for increasing original limits
*
* Revision 2.51 2002/08/04 20:04:35 PhReAk
* Draw FPS when running debug build
*
=======
* Revision 2.9 2002/08/28 10:51:04 randomtiger
* 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!
*
* Revision 2.8 2002/08/27 13:38:57 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.6 2002/08/13 03:34:00 penguin
* 1. Disable CD checking
* 2. Add CVS tag to version string
*
>>>>>>> 2.9
* Revision 2.5 2002/08/04 05:11:05 penguin
* Don't write version to registry; change way version string is formatted
*
@@ -643,6 +727,8 @@ static const char RCS_Name[] = "$Name: not supported by cvs2svn $";
#include "hud/hudshield.h"
#include "ship/shiphit.h"
#include "missionui/missionloopbrief.h"
#include "debugconsole/dbugfile.h"
#include "debugconsole/timerbar.h"
#ifdef NDEBUG
#ifdef FRED
@@ -742,14 +828,16 @@ float frametimes[FRAME_FILTER];
float frametotal = 0.0f;
float flFrametime;
#ifdef RELEASE_REAL
int Show_framerate = 0;
#else
#ifndef NDEBUG
int Show_framerate = 1;
int Show_mem = 1;
#else
int Show_framerate = 0;
int Show_mem = 0;
#endif
int Framerate_cap = 120;
int Show_mem = 0;
int Show_cpu = 0;
int Show_target_debug_info = 0;
int Show_target_weapons = 0;
@@ -1007,7 +1095,7 @@ void game_do_training_checks();
void game_shutdown(void);
void game_show_event_debug(float frametime);
void game_event_debug_init();
void game_frame();
void game_frame(int paused = false);
void demo_upsell_show_screens();
void game_start_subspace_ambient_sound();
void game_stop_subspace_ambient_sound();
@@ -1028,17 +1116,25 @@ static char *Game_loading_ani_fname[GR_NUM_RESOLUTIONS] = {
};
#if defined(FS2_DEMO)
static char *Game_demo_title_screen_fname[GR_NUM_RESOLUTIONS] = {
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
"PreLoad",
"2_PreLoad"
};
#elif defined(OEM_BUILD)
static char *Game_demo_title_screen_fname[GR_NUM_RESOLUTIONS] = {
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
"OEMPreLoad",
"2_OEMPreLoad"
};
#else
static char *Game_title_screen_fname[GR_NUM_RESOLUTIONS] = {
"PreLoad",
"2_PreLoad"
};
#endif
static char *Game_logo_screen_fname[GR_NUM_RESOLUTIONS] = {
"PreLoadLogo",
"2_PreLoadLogo"
};
#ifdef _WIN32
// cdrom stuff
@@ -1175,7 +1271,7 @@ void game_framerate_check()
Gf_critical_time += flFrametime;
}
if(!Show_framerate){
if((!Show_framerate) || (!Cmdline_show_fps)) {
return;
}
@@ -1263,6 +1359,7 @@ DCF(sn_glare, "")
}
float Supernova_last_glare = 0.0f;
extern starfield_bitmap *stars_lookup_sun(starfield_bitmap_instance *s);
void game_sunspot_process(float frametime)
{
int n_lights, idx;
@@ -1330,6 +1427,7 @@ void game_sunspot_process(float frametime)
Sun_drew = 0;
} else {
if ( Sun_drew ) {
starfield_bitmap* sbm;
// check sunspots for all suns
n_lights = light_get_global_count();
@@ -1341,10 +1439,17 @@ void game_sunspot_process(float frametime)
vector light_dir;
light_get_global_dir(&light_dir, idx);
float dot = vm_vec_dot( &light_dir, &Eye_matrix.vec.fvec )*0.5f+0.5f;
Sun_spot_goal += (float)pow(dot,85.0f);
sbm=stars_lookup_sun(&Suns[idx]);
if (!sbm)
continue;
//only do sunglare stuff if this sun has one
if (sbm->glare)
{
float dot = vm_vec_dot( &light_dir, &Eye_matrix.vec.fvec )*0.5f+0.5f;
Sun_spot_goal += (float)pow(dot,85.0f);
}
// draw the glow for this sun
stars_draw_sun_glow(idx);
} else {
@@ -1427,7 +1532,7 @@ void game_flash_diminish(float frametime)
if ( Use_palette_flash ) {
int r,g,b;
static int or=0, og=0, ob=0;
static int o_r=0, o_g=0, o_b=0;
// Change the 200 to change the color range of colors.
r = fl2i( Game_flash_red*128.0f );
@@ -1455,9 +1560,9 @@ void game_flash_diminish(float frametime)
//mprintf(( "Flash! %d,%d,%d\n", r, g, b ));
or = r;
og = g;
ob = b;
o_r = r;
o_g = g;
o_b = b;
}
}
@@ -1932,7 +2037,7 @@ int game_start_mission()
game_post_level_init();
load_post_level_init = time(NULL) - load_post_level_init;
#ifndef NDEBUG
#if (!defined(NDEBUG)) && (!defined(NO_SOFTWARE_RENDERING))
{
void Do_model_timings_test();
Do_model_timings_test();
@@ -2320,44 +2425,38 @@ void game_init()
int trying_d3d = 0;
if (!Is_standalone && ptr && (strstr(ptr, NOX("3DFX Glide")))) {
#ifdef E3_BUILD
// always 640 for E3
gr_init(GR_640, GR_GLIDE);
#else
// regular or hi-res ?
#ifdef NDEBUG
if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){
#else
if(strstr(ptr, NOX("(1024x768)"))){
#endif
gr_init(GR_1024, GR_GLIDE);
} else {
gr_init(GR_640, GR_GLIDE);
}
#endif
} else if (!Is_standalone && ptr && (strstr(ptr, NOX("Direct 3D -") ))) {
#ifdef E3_BUILD
// always 640 for E3
trying_d3d = 1;
gr_init(GR_640, GR_DIRECT3D, depth);
#else
// regular or hi-res ?
#ifdef NDEBUG
if(has_sparky_hi && strstr(ptr, NOX("(1024x768)"))){
#else
if(strstr(ptr, NOX("(1024x768)"))){
#endif
// Direct 3D
trying_d3d = 1;
gr_init(GR_1024, GR_DIRECT3D, depth);
} else {
// Direct 3D
trying_d3d = 1;
gr_init(GR_640, GR_DIRECT3D, depth);
}
#endif
} else if (!Is_standalone && ptr && (strstr(ptr, NOX("OpenGL -") ))){
if (has_sparky_hi && strstr(ptr,NOX("1024x768"))){
gr_init(GR_1024, GR_OPENGL, depth);
} else {
gr_init(GR_640, GR_OPENGL, depth);
}
} else {
// Software
//NOT USED ANYMORE
Error(LOCATION,"Software mode is unsupported, use hardware acceleration. If not using software mode, then something was misspelled. GET A PROGRAMMER!!");
/*
#ifndef NDEBUG
if ( Use_fullscreen_at_startup && !Is_standalone) {
gr_init(GR_640, GR_DIRECTDRAW);
@@ -2371,6 +2470,7 @@ void game_init()
gr_init(GR_640, GR_SOFTWARE);
}
#endif
*/
}
// tried d3d ?
@@ -2407,12 +2507,12 @@ void game_init()
gr_set_gamma(Freespace_gamma);
#if defined(FS2_DEMO) || defined(OEM_BUILD)
//#if defined(FS2_DEMO) || defined(OEM_BUILD)
// add title screen
if(!Is_standalone){
display_title_screen();
}
#endif
//#endif
#ifndef NO_NETWORK
// attempt to load up master tracker registry info (login and password)
@@ -2461,7 +2561,9 @@ void game_init()
control_config_common_init(); // sets up localization stuff in the control config
parse_rank_tbl();
#ifndef FS2_DEMO
parse_medal_tbl();
#endif
cutscene_init();
key_init();
mouse_init();
@@ -2581,7 +2683,7 @@ void game_get_framerate()
}
Framecount++;
if (Show_framerate) {
if ((Show_framerate) || (Cmdline_show_fps)) {
gr_set_color_fast(&HUD_color_debug);
gr_string( 570, 2, text );
}
@@ -3913,6 +4015,8 @@ void game_flip_page_and_time_it()
void game_simulation_frame()
{
// mprintf(("about to render a frame\n"));
#ifndef NO_NETWORK
// blow ships up in multiplayer dogfight
if((Game_mode & GM_MULTIPLAYER) && (Net_player != NULL) && (Net_player->flags & NETINFO_FLAG_AM_MASTER) && (Netgame.type_flags & NG_TYPE_DOGFIGHT) && (f2fl(Missiontime) >= 2.0f) && !dogfight_blown){
@@ -3944,6 +4048,7 @@ void game_simulation_frame()
// process AWACS stuff - do this first thing
awacs_process();
//mprintf(("awacs procesed\n"));
// single player, set Player hits_this_frame to 0
if ( !(Game_mode & GM_MULTIPLAYER) && Player ) {
@@ -3965,6 +4070,7 @@ void game_simulation_frame()
// the basic idea being that because it con be confusing to deal with them on a multi-frame basis, they are only valid for
// frame
ship_process_targeting_lasers();
//mprintf(("targeting lasers procesed\n"));
// do this here so that it works for multiplayer
if ( Viewer_obj ) {
@@ -3991,6 +4097,7 @@ void game_simulation_frame()
} else {
physics_set_viewer( NULL, PHYSICS_VIEWER_FRONT );
}
//mprintf(("view stuff done\n"));
#define VM_PADLOCK_UP (1 << 7)
#define VM_PADLOCK_REAR (1 << 8)
@@ -4034,11 +4141,14 @@ void game_simulation_frame()
mission_eval_goals();
}
#endif // ifndef NO_NETWORK
//mprintf(("arivals\\departures done\n"));
// always check training objectives, even in multiplayer missions. we need to do this so that the directives gauge works properly on clients
if(!(Game_mode & GM_DEMO_PLAYBACK)){
training_check_objectives();
}
// mprintf(("objectives procesed\n"));
#ifndef NO_NETWORK
// do all interpolation now
@@ -4054,12 +4164,15 @@ void game_simulation_frame()
// move all objects - does interpolation now as well
obj_move_all(flFrametime);
}
// mprintf(("interpolation procesed\n"));
#endif // ifndef NO_NETWORK
// only process the message queue when the player is "in" the game
if ( !Pre_player_entry ){
message_queue_process(); // process any messages send to the player
}
//mprintf(("message queue procesed\n"));
if(!(Game_mode & GM_DEMO_PLAYBACK)){
message_maybe_distort(); // maybe distort incoming message if comms damaged
@@ -4067,12 +4180,14 @@ void game_simulation_frame()
player_process_pending_praise(); // maybe send off a delayed praise message to the player
player_maybe_play_all_alone_msg(); // mabye tell the player he is all alone
}
//mprintf(("assorted player stuff procesed\n"));
if(!(Game_mode & GM_STANDALONE_SERVER)){
// process some stuff every frame (before frame is rendered)
emp_process_local();
hud_update_frame(); // update hud systems
//mprintf(("HUD updated\n"));
if (!physics_paused) {
// Move particle system
@@ -4089,9 +4204,11 @@ void game_simulation_frame()
shockwave_move_all(flFrametime); // update all the shockwaves
}
//mprintf(("physics stuff procesed\n"));
// subspace missile strikes
ssm_process();
//mprintf(("SSM procesed\n"));
#ifndef NO_SOUND
obj_snd_do_frame(); // update the object-linked persistant sounds
@@ -4104,8 +4221,10 @@ void game_simulation_frame()
if ( Game_subspace_effect ) {
game_start_subspace_ambient_sound();
}
//mprintf(("sound procesed\n"));
#endif
}
}
// mprintf(("frame rendered\n"));
}
// Maybe render and process the dead-popup
@@ -4244,7 +4363,7 @@ void game_render_hud_3d(vector *eye_pos, matrix *eye_orient)
}
void game_frame()
void game_frame(int paused)
{
int actually_playing;
fix total_time1, total_time2;
@@ -4272,83 +4391,96 @@ void game_frame()
}
#endif
// start timing frame
timing_frame_start();
total_time1 = timer_get_fixed_seconds();
// var to hold which state we are in
actually_playing = game_actually_playing();
// start timing frame
timing_frame_start();
#ifndef NO_NETWORK
if ((!(Game_mode & GM_MULTIPLAYER)) || ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER))) {
if (!(Game_mode & GM_STANDALONE_SERVER)){
Assert( OBJ_INDEX(Player_obj) >= 0 );
total_time1 = timer_get_fixed_seconds();
if(paused)
{
// Reset the lights here or they just keep on increasing
light_reset();
}
else
{
// var to hold which state we are in
actually_playing = game_actually_playing();
#ifndef NO_NETWORK
if ((!(Game_mode & GM_MULTIPLAYER)) || ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER))) {
if (!(Game_mode & GM_STANDALONE_SERVER)){
Assert( OBJ_INDEX(Player_obj) >= 0 );
}
}
}
#else
Assert( OBJ_INDEX(Player_obj) >= 0 );
#endif // ifndef NO_NETWORK
if (Missiontime > Entry_delay_time){
Pre_player_entry = 0;
} else {
; //nprintf(("AI", "Framecount = %i, time = %7.3f\n", Framecount, f2fl(Missiontime)));
}
// Note: These are done even before the player enters, else buffers can overflow.
if (! (Game_mode & GM_STANDALONE_SERVER)){
radar_frame_init();
}
shield_frame_init();
if ( Player->control_mode != PCM_NORMAL )
camera_move();
if ( !Pre_player_entry && actually_playing ) {
if (! (Game_mode & GM_STANDALONE_SERVER) ) {
if( (!popup_running_state()) && (!popupdead_is_active()) ){
game_process_keys();
// don't read flying controls if we're playing a demo back
if(!(Game_mode & GM_DEMO_PLAYBACK)){
read_player_controls( Player_obj, flFrametime);
#else
Assert( OBJ_INDEX(Player_obj) >= 0 );
#endif // ifndef NO_NETWORK
if (Missiontime > Entry_delay_time){
Pre_player_entry = 0;
} else {
; //nprintf(("AI", "Framecount = %i, time = %7.3f\n", Framecount, f2fl(Missiontime)));
}
// Note: These are done even before the player enters, else buffers can overflow.
if (! (Game_mode & GM_STANDALONE_SERVER)){
radar_frame_init();
}
shield_frame_init();
if ( Player->control_mode != PCM_NORMAL )
camera_move();
if ( !Pre_player_entry && actually_playing ) {
if (! (Game_mode & GM_STANDALONE_SERVER) ) {
if( (!popup_running_state()) && (!popupdead_is_active()) ){
game_process_keys();
// don't read flying controls if we're playing a demo back
if(!(Game_mode & GM_DEMO_PLAYBACK)){
read_player_controls( Player_obj, flFrametime);
}
}
#ifndef NO_NETWORK
// if we're not the master, we may have to send the server-critical ship status button_info bits
if ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER)){
multi_maybe_send_ship_status();
}
#endif // ifndef NO_NETWORK
}
#ifndef NO_NETWORK
// if we're not the master, we may have to send the server-critical ship status button_info bits
if ((Game_mode & GM_MULTIPLAYER) && !(Net_player->flags & NETINFO_FLAG_AM_MASTER) && !(Net_player->flags & NETINFO_FLAG_OBSERVER)){
multi_maybe_send_ship_status();
}
#endif // ifndef NO_NETWORK
}
}
// Reset the whack stuff
game_whack_reset();
// These two lines must be outside of Pre_player_entry code,
// otherwise too many lights are added.
light_reset();
#ifndef NO_NETWORK
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.game_state == NETGAME_STATE_SERVER_TRANSFER)){
return;
}
#endif // ifndef NO_NETWORK
game_simulation_frame();
// Reset the whack stuff
game_whack_reset();
// These two lines must be outside of Pre_player_entry code,
// otherwise too many lights are added.
light_reset();
#ifndef NO_NETWORK
if ((Game_mode & GM_MULTIPLAYER) && (Netgame.game_state == NETGAME_STATE_SERVER_TRANSFER)){
return;
}
#endif // ifndef NO_NETWORK
game_simulation_frame();
// if not actually in a game play state, then return. This condition could only be true in
// a multiplayer game.
if (!actually_playing ) {
Assert( Game_mode & GM_MULTIPLAYER );
return;
}
// if not actually in a game play state, then return. This condition could only be true in
// a multiplayer game.
if ( !actually_playing ) {
Assert( Game_mode & GM_MULTIPLAYER );
return;
}
TIMERBAR_SWITCH_TYPE(TIMERBAR_D3DCODE);
if (!Pre_player_entry) {
if (! (Game_mode & GM_STANDALONE_SERVER)) {
clear_time1 = timer_get_fixed_seconds();
@@ -4463,7 +4595,7 @@ void game_frame()
nebl_process();
total_time2 = timer_get_fixed_seconds();
// Got some timing numbers
Timing_total = f2fl( total_time2 - total_time1 ) * 1000.0f;
Timing_clear = f2fl( clear_time2 - clear_time1 ) * 1000.0f;
@@ -4478,6 +4610,8 @@ void game_frame()
demo_close();
}
#endif
TIMERBAR_SWITCH_TYPE(TIMERBAR_DEFAULT);
}
#define MAX_FRAMETIME (F1_0/4) // Frametime gets saturated at this. Changed by MK on 11/1/97.
@@ -4675,6 +4809,9 @@ void game_do_frame()
game_set_frametime(GS_STATE_GAME_PLAY);
game_update_missiontime();
// if (Player_ship->flags & SF_DYING)
// flFrametime /= 15.0;
#if !defined(NO_NETWORK) && !defined(NO_STANDALONE)
if (Game_mode & GM_STANDALONE_SERVER) {
std_multi_set_standalone_missiontime(f2fl(Missiontime));
@@ -5956,11 +6093,7 @@ void game_enter_state( int old_state, int new_state )
#if defined(PRESS_TOUR_BUILD) || defined(PD_BUILD)
mht_init();
#else
if (Player->on_bastion) {
main_hall_init(1);
} else {
main_hall_init(0);
}
main_hall_init(Player->main_hall);
#endif
break;
@@ -6488,6 +6621,14 @@ void game_do_state(int state)
break;
case GS_STATE_GAME_PAUSED:
if(pause_get_type() == PAUSE_TYPE_VIEWER) {
read_player_controls( Player_obj, flFrametime);
// game_process_keys();
game_frame(true);
}
pause_do(0);
break;
@@ -7044,7 +7185,7 @@ int WinMainSub(int argc, char *argv[])
// movie_play( NOX("intro.mve"), 0 );
// debug version, movie will only play with -showmovies
#else if !defined(NDEBUG)
#elif !defined(NDEBUG)
// no soup for you!
// movie_play( NOX("intro.mve"), 0);
@@ -7098,17 +7239,22 @@ int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int nCmdSh
int main(int argc, char *argv[])
#endif
{
DBUGFILE_INIT();
int result = -1;
#ifdef _WIN32
#if defined(_MSC_VER)
__try {
#endif
result = WinMainSub(hInst, hPrev, szCmdLine, nCmdShow);
#if defined(_MSC_VER)
} __except(RecordExceptionInfo(GetExceptionInformation(), "Freespace 2 Main Thread")) {
// Do nothing here - RecordExceptionInfo() has already done
// everything that is needed. Actually this code won't even
// get called unless you return EXCEPTION_EXECUTE_HANDLER from
// the __except clause.
}
#endif
#else
try {
result = WinMainSub(argc, argv);
@@ -7119,6 +7265,7 @@ int main(int argc, char *argv[])
}
#endif
DBUGFILE_DEINIT()
return result;
}
@@ -7595,7 +7742,7 @@ void game_show_event_debug(float frametime)
#endif // NDEBUG
#ifndef NDEBUG
#if (!defined(NDEBUG)) && (!defined(NO_SOFTWARE_RENDERING))
FILE * Time_fp;
FILE * Texture_fp;
@@ -7836,6 +7983,10 @@ if ( FS_VERSION_BUILD == 0 ) {
sprintf(str,"V%d.%d.%d", FS_VERSION_MAJOR, FS_VERSION_MINOR, FS_VERSION_BUILD );
}
#ifdef FS2_DEMO
strcat(str, " Demo");
#endif
#ifdef _DEBUG
strcat(str, " Dbg");
#endif
@@ -8731,16 +8882,18 @@ int game_do_cd_mission_check(char *filename)
// checksums, just keep a list of all valid ones, if it matches any of them, keep it
#define NUM_SHIPS_TBL_CHECKSUMS 1
/*
#ifdef FS2_DEMO
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = {
-463907578, // US - beta 1
//-463907578, // US - beta 1
1696074201, // FS2 demo
};
*/
#else
int Game_ships_tbl_checksums[NUM_SHIPS_TBL_CHECKSUMS] = {
// -1022810006, // 1.0 FULL
-1254285366 // 1.2 FULL (German)
};
#endif
void verify_ships_tbl()
{
@@ -8798,16 +8951,18 @@ DCF(shipspew, "display the checksum for the current ships.tbl")
// checksums, just keep a list of all valid ones, if it matches any of them, keep it
#define NUM_WEAPONS_TBL_CHECKSUMS 1
/*
#ifdef FS2_DEMO
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = {
141718090, // US - beta 1
//141718090, // US - beta 1
-266420030, // demo 1
};
*/
#else
int Game_weapons_tbl_checksums[NUM_WEAPONS_TBL_CHECKSUMS] = {
// 399297860, // 1.0 FULL
-553984927 // 1.2 FULL (german)
};
#endif
void verify_weapons_tbl()
{
@@ -8871,17 +9026,64 @@ int game_hacked_data()
return 0;
}
//#define MAX_SPLASHSCREENS 64
//char Splash_screens[MAX_SPLASHSCREENS][MAX_FILENAME_LEN];
void display_title_screen()
{
#if defined(FS2_DEMO) || defined(OEM_BUILD)
///int title_bitmap;
int title_bitmap = -1;
int title_logo =-1;
/* _finddata_t find;
long find_handle;
char current_dir[256];
// load bitmap
int title_bitmap = bm_load(Game_demo_title_screen_fname[gr_screen.res]);
if (title_bitmap == -1) {
return;
//Get the find string
_getcwd(current_dir, 256);
strcat(current_dir, DIR_SEPARATOR_STR);
strcat(current_dir, "*.pcx");
//Let the search begin!
find_handle = _findfirst(current_dir, &find);
int i = 0;
if(find_handle != -1)
{
char *p;
do {
if(!(find.attrib & _A_SUBDIR) && (strlen(find.name) < MAX_FILENAME_LEN)) {
p = strchr( find.name, '.' );
if(p) {
*p = '\0';
}
if(stricmp(find.name, Game_logo_screen_fname[gr_screen.res])
&& stricmp(find.name, Game_title_screen_fname[gr_screen.res]))
{
strcpy(Splash_screens[i], find.name);
i++;
}
if(i == MAX_SPLASHSCREENS) {
break;
}
}
} while(!_findnext(find_handle, &find));
}
if(i) {
srand(time(NULL));
title_bitmap = bm_load(Splash_screens[rand() % i]);
} else {
title_bitmap = bm_load(Game_title_screen_fname[gr_screen.res]);
}
if (title_bitmap == -1 && title_logo == -1) {
// return;
}
*/
#ifndef NO_DIRECT3D
// d3d
if((gr_screen.mode == GR_DIRECT3D) && (Gr_bitmap_poly)){
@@ -8890,11 +9092,31 @@ void display_title_screen()
}
#endif
// set
gr_set_bitmap(title_bitmap);
title_logo = bm_load(Game_logo_screen_fname[gr_screen.res]);
title_bitmap = bm_load(Game_title_screen_fname[gr_screen.res]);
// draw
gr_bitmap(0, 0);
if(title_bitmap != -1)
{
// set
gr_set_bitmap(title_bitmap);
//Get bitmap's width and height
int width, height;
bm_get_info(title_bitmap, &width, &height);
//Draw it in the center of the screen
gr_bitmap((gr_screen.max_w - width)/2, (gr_screen.max_h - height)/2);
bm_unload(title_bitmap);
}
if(title_logo != -1)
{
gr_set_bitmap(title_logo);
gr_bitmap(0,0);
bm_unload(title_logo);
}
#ifndef NO_DIRECT3D
// d3d
@@ -8906,9 +9128,6 @@ void display_title_screen()
// flip
gr_flip();
bm_unload(title_bitmap);
#endif // FS2_DEMO || OEM_BUILD
}
// return true if the game is running with "low memory", which is less than 48MB
+30 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-01-25 04:17:39 $
* $Author: Goober5000 $
*
* C module for high-level control of event driven music
*
* $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:22 penguin
* Warpcore CVS sync
*
@@ -1415,6 +1418,30 @@ int event_music_next_soundtrack(int delta)
return Current_soundtrack_num;
}
// Goober5000 - along the same lines; this is for the sexp
void event_sexp_change_music(char *name)
{
Assert(name);
int i, new_soundtrack = -1;
if ( Event_music_enabled == FALSE || Event_music_level_inited == FALSE )
{
return;
}
for (i=0; i<Num_soundtracks; i++)
{
if (!stricmp(name, Soundtracks[i].name))
{
new_soundtrack = i;
}
}
event_music_level_close();
event_music_level_init(new_soundtrack);
}
// ----------------------------------------------------------------
// event_music_get_soundtrack_name()
//
+8 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/EventMusic.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-01-25 04:17:39 $
* $Author: Goober5000 $
*
* Header file for high-level control of event driven music
*
* $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:22 penguin
* Warpcore CVS sync
*
@@ -185,7 +188,7 @@ typedef struct tagSOUNDTRACK_INFO {
char pattern_fnames[MAX_PATTERNS][MAX_FILENAME_LEN];
} SOUNDTRACK_INFO;
#define MAX_SOUNDTRACKS 10
#define MAX_SOUNDTRACKS 25
extern SOUNDTRACK_INFO Soundtracks[MAX_SOUNDTRACKS];
extern int Num_soundtracks;
@@ -217,6 +220,7 @@ void event_music_start_default();
void event_music_get_info(char *outbuf);
void event_music_get_soundtrack_name(char *outbuf);
int event_music_next_soundtrack(int delta);
void event_sexp_change_music(char *name);
void event_music_set_soundtrack(char *name);
void event_music_set_score(int score_index, char *name);
int event_music_get_spooled_music_index(char *name);
+10 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Gamesnd/GameSnd.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-12-10 05:43:35 $
* $Author: Goober5000 $
*
* Routines to keep track of which sound files go where
*
* $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:22 penguin
* Warpcore CVS sync
*
@@ -530,6 +533,10 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
// copilot
#define SND_COPILOT 162
// added for ballistic primaries - Goober5000
#define SND_BALLISTIC_START_LOAD 165
#define SND_BALLISTIC_LOAD 166
// supernova 1 and supernova 2
#define SND_SUPERNOVA_1 173
#define SND_SUPERNOVA_2 174
@@ -538,7 +545,6 @@ extern game_snd Snds_flyby[MAX_SPECIES_NAMES][2];
#define SND_LIGHTNING_1 180
#define SND_LIGHTNING_2 181
//---------------------------------------------------
// Interface sounds
//---------------------------------------------------
+3
View File
@@ -62,6 +62,9 @@ typedef struct { float r, g, b, a; } FxColor4;
#elif defined(__unix__)
#define FX_ENTRY extern
#define FX_CALL
#elif defined(__GNUC__)
#define FX_ENTRY extern
#define FX_CALL
#else
#warning define FX_ENTRY & FX_CALL for your compiler
#define FX_ENTRY extern
+36 -11
View File
@@ -9,13 +9,25 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/PsTypes.h $
* $Revision: 2.4 $
* $Date: 2002-08-06 01:49:08 $
* $Revision: 2.8 $
* $Date: 2003-03-02 05:27:44 $
* $Author: penguin $
*
* Header file containg global typedefs, constants and macros
*
* $Log: not supported by cvs2svn $
* Revision 2.7 2003/01/18 19:48:19 phreak
* added some defines that deal with mages using DXTC
*
* Revision 2.6 2002/12/02 23:56:12 Goober5000
* fixed misspelling
*
* Revision 2.5 2002/12/02 20:49:14 Goober5000
* fixed misspelling of "category" as "catagory"
*
* Revision 2.4 2002/08/06 01:49:08 penguin
* Renamed ccode members to cc_or and cc_and
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
@@ -328,13 +340,22 @@ typedef struct vertex {
ubyte pad[2]; // pad structure to be 4 byte aligned.
} vertex;
#define BMP_AABITMAP (1<<0) // antialiased bitmap
#define BMP_AABITMAP (1<<0) // antialiased bitmap
#define BMP_TEX_XPARENT (1<<1) // transparent texture
#define BMP_TEX_NONDARK (1<<2) // nondarkening texture
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
#define BMP_TEX_OTHER (1<<3) // so we can identify all "normal" textures
#define BMP_TEX_DXT1 (1<<4) // dxt1 compressed 8r8g8b1a (24bit)
#define BMP_TEX_DXT3 (1<<5) // dxt3 compressed 8r8g8b4a (32bit)
#define BMP_TEX_DXT5 (1<<6) // dxt5 compressed 8r8g8b8a (32bit)
//compressed texture types
#define BMP_TEX_COMP ( BMP_TEX_DXT1 | BMP_TEX_DXT3 | BMP_TEX_DXT5 )
//non compressed textures
#define BMP_TEX_NONCOMP ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
// any texture type
#define BMP_TEX_ANY ( BMP_TEX_XPARENT | BMP_TEX_NONDARK | BMP_TEX_OTHER )
#define BMP_TEX_ANY ( BMP_TEX_COMP | BMP_TEX_NONCOMP )
// max res == 1024x768. max texture size == 256
#define MAX_BMAP_SECTIONS_X 4
@@ -383,12 +404,12 @@ extern void _cdecl Warning( char * filename, int line, char * format, ... );
// or,
// Error( LOCATION, "Error opening %s", filename );
#if defined(NDEBUG)
//#if defined(NDEBUG)
#define Assert(x) do {} while (0)
#else
void gr_activate(int);
#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
#endif
//#else
//void gr_activate(int);
//#define Assert(x) do { if (!(x)){ gr_activate(0); WinAssert(#x,__FILE__,__LINE__); gr_activate(1); } } while (0)
//#endif
//#define Int3() _asm { int 3 }
@@ -416,8 +437,12 @@ void gr_activate(int);
#endif // NDEBUG && DEMO
#endif // INTERPLAYQA
#ifndef min
#define min(a,b) (((a) < (b)) ? (a) : (b))
#endif
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
#define PI 3.141592654f
#define PI2 (3.141592654f*2.0f) // PI*2
@@ -497,7 +522,7 @@ extern float Dc_arg_float; // If Dc_arg_type & ARG_FLOAT is set, then this is th
void dc_printf( char *format, ... );
// Each dc_arg_type can have one or more of these flags set.
// This is because some things can fit into two catagories.
// This is because some things can fit into two categories.
// Like 1 can be an integer, a float, a string, or a true boolean
// value.
#define ARG_NONE (1<<0) // no argument
+9 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-11-22 20:56:15 $
* $Author: phreak $
*
* Variables and constants common to FreeSpace and Fred.
*
* $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:22 penguin
* Warpcore CVS sync
*
@@ -233,7 +236,9 @@ int Fred_found_unknown_ship_during_parsing = 0;
// If true, then we are using Direct3D hardware. This is used for game type stuff
// that changes when you're using hardware.
int D3D_enabled = 0;
int D3D_enabled = 0;
int OGL_inited=0;
// Values used for noise for thruster animations
float Noise[NOISE_NUM_FRAMES] = {
+16 -3
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/SystemVars.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:22 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Variables and constants common to FreeSpace and Fred.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/15 04:41:17 penguin
* Added #include, needed for FRED
*
* 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
*
@@ -192,6 +198,7 @@
#ifndef _SYSTEMVARS_H
#define _SYSTEMVARS_H
#include "globalincs/pstypes.h"
#include "math.h"
#define GM_MULTIPLAYER (1 << 0)
@@ -346,4 +353,10 @@ int current_detail_level();
extern int TotalRam;
void windebug_memwatch_init();
enum
{
TIMERBAR_DEFAULT,
TIMERBAR_D3DCODE,
};
#endif
+17 -4
View File
@@ -9,12 +9,25 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/version.h $
* $Revision: 2.2 $
* $Date: 2002-08-13 03:32:25 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2003-02-05 07:04:31 $
* $Author: Goober5000 $
*
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2003/01/30 23:24:34 phreak
* bumped to 3.50
*
* Revision 2.4 2002/12/31 20:09:14 Goober5000
* bumped to 3.4
* --Goober5000
*
* Revision 2.3 2002/11/10 20:40:02 inquisitor
* Bumped to 3.3
*
* Revision 2.2 2002/08/13 03:32:25 penguin
* Bumped to version 3.2
*
* Revision 2.1 2002/08/04 05:11:36 penguin
* Update version number to 3.1
*
@@ -126,7 +139,7 @@
// Major.Minor.Bugfix
#define FS_VERSION_MAJOR 3 // major version
#define FS_VERSION_MINOR 2 // increase by 1 for minor revs
#define FS_VERSION_MINOR 5 // increase by 1 for minor revs
#define FS_VERSION_BUILD 0 // bugfix release
#define VERSION_LOC_FNAME "version.nfo"
+34 -17
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/GlobalIncs/WinDebug.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 2.2 $
* $Date: 2003-03-02 05:30:26 $
* $Author: penguin $
*
* Debug stuff
*
* $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:22 penguin
* Warpcore CVS sync
*
@@ -116,12 +119,26 @@
#include <windows.h>
#include <windowsx.h>
#include <stdio.h>
#include <crtdbg.h>
#include "globalincs/pstypes.h"
#ifdef _MSC_VER
#include <crtdbg.h>
//Uncomment SHOW_CALL_STACK to show the call stack in Asserts, Warnings, and Errors
#define SHOW_CALL_STACK
#endif // _MSC_VER
#ifndef __ASSERT
#ifndef _DEBUG
#define _ASSERT(expr) ((void)0)
#else
#define _ASSERT(expr) (assert(expr))
// #error _ASSERT is not defined yet for debug mode with non-MSVC compilers
#endif
#endif
#ifdef SHOW_CALL_STACK
@@ -1006,8 +1023,6 @@ void getmem()
#ifndef NDEBUG
#include <crtdbg.h>
int TotalRam = 0;
#define nNoMansLandSize 4
@@ -1030,6 +1045,9 @@ typedef struct _CrtMemBlockHeader
#define pHdr(pbData) (((_CrtMemBlockHeader *)pbData)-1)
// this block of code is never referenced...
#if 0
int __cdecl MyAllocHook(
int nAllocType,
void * pvData,
@@ -1067,6 +1085,9 @@ int __cdecl MyAllocHook(
return( TRUE ); // Allow the memory operation to proceed
}
#endif // #if 0
void windebug_memwatch_init()
{
@@ -1120,7 +1141,7 @@ void *vm_malloc( int size, char *filename, int line )
void *vm_malloc( int size )
#endif
{
#ifndef NDEBUG
#if (!defined(NDEBUG)) && defined(_MSC_VER)
if ( !Heap ) {
TotalRam += size;
@@ -1179,27 +1200,23 @@ void vm_free( void *ptr )
return;
}
#ifndef NDEBUG
#if (!defined(NDEBUG)) && defined(_MSC_VER)
if ( !Heap ) {
#ifndef NDEBUG
_CrtMemBlockHeader *phd = pHdr(ptr);
int nSize = phd->nDataSize;
TotalRam -= nSize;
#endif
_free_dbg(ptr,_NORMAL_BLOCK);
return;
}
#endif
#ifndef NDEBUG
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
if ( Watch_malloc ) {
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
}
TotalRam -= actual_size;
#endif
int actual_size = HeapSize(Heap, HEAP_FLAG, ptr);
if ( Watch_malloc ) {
mprintf(( "Free %d bytes [%s(%d)]\n", actual_size, clean_filename(filename), line ));
}
TotalRam -= actual_size;
#endif
HeapFree( Heap, HEAP_FLAG, ptr );
HeapCompact(Heap, HEAP_FLAG);
}
+69 -38
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Graphics/2d.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:04 $
* $Revision: 2.5 $
* $Date: 2003-03-02 05:41:52 $
* $Author: penguin $
*
* Main file for 2d primitives.
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2002/11/18 21:32:11 phreak
* added some ogl functionality - phreak
*
* Revision 2.3 2002/08/01 01:41:04 penguin
* The big include file move
*
* Revision 2.2 2002/07/30 14:29:15 unknownplayer
*
* Started work on DX8.1 implementation. Updated the project files to encompass
@@ -513,9 +519,6 @@ void gr_close()
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
gr_soft_cleanup();
break;
case GR_DIRECTDRAW:
Int3();
gr_directdraw_cleanup();
@@ -528,6 +531,12 @@ void gr_close()
break;
#endif
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
gr_soft_cleanup();
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
gr_opengl_cleanup();
@@ -887,9 +896,6 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
if ( Gr_inited ) {
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
gr_soft_cleanup();
break;
case GR_DIRECTDRAW:
Int3();
gr_directdraw_cleanup();
@@ -904,7 +910,13 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
case GR_GLIDE:
gr_glide_cleanup();
break;
#endif
#endif // ifdef _WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
gr_soft_cleanup();
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
@@ -921,7 +933,7 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
#if defined(HARDWARE_ONLY) && defined(_WIN32)
if(!Fred_running && !Pofview_running && !Nebedit_running && !Is_standalone){
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D)){
if((mode != GR_GLIDE) && (mode != GR_DIRECT3D) && (mode != GR_OPENGL)){
mprintf(("Forcing glide startup!\n"));
mode = GR_GLIDE;
}
@@ -978,10 +990,6 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
gr_soft_init();
break;
// directdraw, direct3d,
case GR_DIRECTDRAW:
Int3();
@@ -1020,8 +1028,18 @@ int gr_init(int res, int mode, int depth, int fred_x, int fred_y)
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
Assert(Fred_running || Pofview_running || Is_standalone || Nebedit_running);
gr_soft_init();
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
Gr_bitmap_poly=1;
gr_screen.bits_per_pixel=depth;
gr_screen.bytes_per_pixel=depth/8;
gr_opengl_init();
break;
#endif // ifdef USE_OPENGL
@@ -1063,12 +1081,6 @@ void gr_force_windowed()
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
{
extern void gr_soft_force_windowed();
gr_soft_force_windowed();
}
break;
case GR_DIRECTDRAW:
{
Int3();
@@ -1086,8 +1098,19 @@ void gr_force_windowed()
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
{
extern void gr_soft_force_windowed();
gr_soft_force_windowed();
}
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
extern void opengl_minimize();
opengl_minimize();
break;
#endif // ifdef USE_OPENGL
@@ -1107,13 +1130,6 @@ void gr_activate(int active)
switch( gr_screen.mode ) {
#ifdef _WIN32
case GR_SOFTWARE:
{
extern void gr_soft_activate(int active);
gr_soft_activate(active);
return;
}
break;
case GR_DIRECTDRAW:
{
Int3();
@@ -1138,8 +1154,20 @@ void gr_activate(int active)
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
{
extern void gr_soft_activate(int active);
gr_soft_activate(active);
return;
}
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
extern void gr_opengl_activate(int active);
gr_opengl_activate(active);
break;
#endif // ifdef USE_OPENGL
@@ -1203,8 +1231,8 @@ void gr_bitmap(int x, int y)
int x_line, y_line;
int w, h;
// d3d and glide support texture poly shiz
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE)) && Gr_bitmap_poly){
// d3d and glide support texture poly shiz, ogl does too
if(((gr_screen.mode == GR_DIRECT3D) || (gr_screen.mode == GR_GLIDE) || (gr_screen.mode== GR_OPENGL)) && Gr_bitmap_poly){
int idx, s_idx;
// float u_scale, v_scale;
bitmap_section_info *sections;
@@ -1236,10 +1264,6 @@ void gr_bitmap(int x, int y)
// old school bitmaps
switch(gr_screen.mode){
#ifdef _WIN32
case GR_SOFTWARE:
grx_bitmap(x, y);
break;
case GR_DIRECTDRAW:
grx_bitmap(x, y);
break;
@@ -1251,9 +1275,14 @@ void gr_bitmap(int x, int y)
case GR_GLIDE:
gr_glide_bitmap(x, y);
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
grx_bitmap(x, y);
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
gr_opengl_bitmap(x, y);
@@ -1267,10 +1296,6 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
{
switch(gr_screen.mode){
#ifdef _WIN32
case GR_SOFTWARE:
grx_bitmap_ex(x, y, w, h, sx, sy);
break;
case GR_DIRECTDRAW:
grx_bitmap_ex(x, y, w, h, sx, sy);
break;
@@ -1284,6 +1309,12 @@ void gr_bitmap_ex(int x, int y, int w, int h, int sx, int sy)
break;
#endif // ifdef WIN32
#ifndef NO_SOFTWARE_RENDERING
case GR_SOFTWARE:
grx_bitmap_ex(x, y, w, h, sx, sy);
break;
#endif // ifndef NO_SOFTWARE_RENDERING
#ifdef USE_OPENGL
case GR_OPENGL:
gr_opengl_bitmap_ex(x, y, w, h, sx, sy);
+23 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/aaline.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:42:25 $
* $Author: penguin $
*
* Code to draw antialiased lines
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -246,11 +249,12 @@ void aaline_init_tables()
// less than 1.0 and less total bits are sufficient.
// Some of the steps here are not needed. This was originally
// written to simulate exact hardware behavior.
#if defined( _WIN32 ) && defined( _MSC_VER )
#if defined _WIN32
long int fix_xy_mult(long int oa, fix_xy ob)
{
int retval;
#if defined _MSC_VER
_asm {
mov edx, oa
mov eax, ob
@@ -258,11 +262,26 @@ long int fix_xy_mult(long int oa, fix_xy ob)
shrd eax,edx,20
mov retval, eax
}
#elif defined __GNUC__
asm(
"mov %1,%%edx;"
"mov %2,%%eax;"
"imul %%edx;"
"shrd $20,%%eax,%%edx;"
"mov %%eax,%0"
: "=g" (retval) // outputs
: "g" (oa), "g" (ob) // inputs
: "eax", "edx" // clobbered registers
);
#else
#error unknown compiler
#endif
return retval;
}
#else
#error unknown OS
long int fix_xy_mult(long int oa, fix_xy ob);
#endif // if defined( _WIN32 ) && defined( _MSC_VER )
#endif
+8 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/Font.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.4 $
* $Date: 2003-03-02 05:41:52 $
* $Author: penguin $
*
* source file for font stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.2 2002/07/29 20:12:31 penguin
* added #ifdef _WIN32 around windows-specific system headers
*
@@ -644,6 +647,7 @@ void gr8_string(int sx, int sy, char *s )
gr_unlock();
}
#ifndef NO_SOFTWARE_RENDERING
#ifdef _WIN32
HFONT MyhFont = NULL;
extern HDC hDibDC;
@@ -733,7 +737,8 @@ void gr_get_string_size_win(int *w, int *h, char *text)
if (h)
*h += size.cy;
}
#endif
#endif // ifdef _WIN32
#endif // ifndef NO_SOFTWARE_RENDERING
char grx_printf_text[2048];
+373
View File
@@ -0,0 +1,373 @@
/*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-95, Microsoft Corporation
Module Name:
glaux.h
Abstract:
Procedure declarations, constant definitions and macros for the OpenGL
Auxiliary Library.
--*/
#ifndef __GLAUX_H__
#define __GLAUX_H__
/*
* (c) Copyright 1993, Silicon Graphics, Inc.
* ALL RIGHTS RESERVED
* Permission to use, copy, modify, and distribute this software for
* any purpose and without fee is hereby granted, provided that the above
* copyright notice appear in all copies and that both the copyright notice
* and this permission notice appear in supporting documentation, and that
* the name of Silicon Graphics, Inc. not be used in advertising
* or publicity pertaining to distribution of the software without specific,
* written prior permission.
*
* THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
* AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
* INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
* FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL SILICON
* GRAPHICS, INC. BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
* SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
* KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
* LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
* THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC. HAS BEEN
* ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
* POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
*
* US Government Users Restricted Rights
* Use, duplication, or disclosure by the Government is subject to
* restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
* (c)(1)(ii) of the Rights in Technical Data and Computer Software
* clause at DFARS 252.227-7013 and/or in similar or successor
* clauses in the FAR or the DOD or NASA FAR Supplement.
* Unpublished-- rights reserved under the copyright laws of the
* United States. Contractor/manufacturer is Silicon Graphics,
* Inc., 2011 N. Shoreline Blvd., Mountain View, CA 94039-7311.
*
* OpenGL(TM) is a trademark of Silicon Graphics, Inc.
*/
#include <windows.h>
#include <GL/gl.h>
#include <GL/glu.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
** ToolKit Window Types
** In the future, AUX_RGBA may be a combination of both RGB and ALPHA
*/
#define AUX_RGB 0
#define AUX_RGBA AUX_RGB
#define AUX_INDEX 1
#define AUX_SINGLE 0
#define AUX_DOUBLE 2
#define AUX_DIRECT 0
#define AUX_INDIRECT 4
#define AUX_ACCUM 8
#define AUX_ALPHA 16
#define AUX_DEPTH24 32 /* 24-bit depth buffer */
#define AUX_STENCIL 64
#define AUX_AUX 128
#define AUX_DEPTH16 256 /* 16-bit depth buffer */
#define AUX_FIXED_332_PAL 512
#define AUX_DEPTH AUX_DEPTH16 /* default is 16-bit depth buffer */
/*
** Window Masks
*/
#define AUX_WIND_IS_RGB(x) (((x) & AUX_INDEX) == 0)
#define AUX_WIND_IS_INDEX(x) (((x) & AUX_INDEX) != 0)
#define AUX_WIND_IS_SINGLE(x) (((x) & AUX_DOUBLE) == 0)
#define AUX_WIND_IS_DOUBLE(x) (((x) & AUX_DOUBLE) != 0)
#define AUX_WIND_IS_INDIRECT(x) (((x) & AUX_INDIRECT) != 0)
#define AUX_WIND_IS_DIRECT(x) (((x) & AUX_INDIRECT) == 0)
#define AUX_WIND_HAS_ACCUM(x) (((x) & AUX_ACCUM) != 0)
#define AUX_WIND_HAS_ALPHA(x) (((x) & AUX_ALPHA) != 0)
#define AUX_WIND_HAS_DEPTH(x) (((x) & (AUX_DEPTH24 | AUX_DEPTH16)) != 0)
#define AUX_WIND_HAS_STENCIL(x) (((x) & AUX_STENCIL) != 0)
#define AUX_WIND_USES_FIXED_332_PAL(x) (((x) & AUX_FIXED_332_PAL) != 0)
/*
** ToolKit Event Structure
*/
typedef struct _AUX_EVENTREC {
GLint event;
GLint data[4];
} AUX_EVENTREC;
/*
** ToolKit Event Types
*/
#define AUX_EXPOSE 1
#define AUX_CONFIG 2
#define AUX_DRAW 4
#define AUX_KEYEVENT 8
#define AUX_MOUSEDOWN 16
#define AUX_MOUSEUP 32
#define AUX_MOUSELOC 64
/*
** Toolkit Event Data Indices
*/
#define AUX_WINDOWX 0
#define AUX_WINDOWY 1
#define AUX_MOUSEX 0
#define AUX_MOUSEY 1
#define AUX_MOUSESTATUS 3
#define AUX_KEY 0
#define AUX_KEYSTATUS 1
/*
** ToolKit Event Status Messages
*/
#define AUX_LEFTBUTTON 1
#define AUX_RIGHTBUTTON 2
#define AUX_MIDDLEBUTTON 4
#define AUX_SHIFT 1
#define AUX_CONTROL 2
/*
** ToolKit Key Codes
*/
#define AUX_RETURN 0x0D
#define AUX_ESCAPE 0x1B
#define AUX_SPACE 0x20
#define AUX_LEFT 0x25
#define AUX_UP 0x26
#define AUX_RIGHT 0x27
#define AUX_DOWN 0x28
#define AUX_A 'A'
#define AUX_B 'B'
#define AUX_C 'C'
#define AUX_D 'D'
#define AUX_E 'E'
#define AUX_F 'F'
#define AUX_G 'G'
#define AUX_H 'H'
#define AUX_I 'I'
#define AUX_J 'J'
#define AUX_K 'K'
#define AUX_L 'L'
#define AUX_M 'M'
#define AUX_N 'N'
#define AUX_O 'O'
#define AUX_P 'P'
#define AUX_Q 'Q'
#define AUX_R 'R'
#define AUX_S 'S'
#define AUX_T 'T'
#define AUX_U 'U'
#define AUX_V 'V'
#define AUX_W 'W'
#define AUX_X 'X'
#define AUX_Y 'Y'
#define AUX_Z 'Z'
#define AUX_a 'a'
#define AUX_b 'b'
#define AUX_c 'c'
#define AUX_d 'd'
#define AUX_e 'e'
#define AUX_f 'f'
#define AUX_g 'g'
#define AUX_h 'h'
#define AUX_i 'i'
#define AUX_j 'j'
#define AUX_k 'k'
#define AUX_l 'l'
#define AUX_m 'm'
#define AUX_n 'n'
#define AUX_o 'o'
#define AUX_p 'p'
#define AUX_q 'q'
#define AUX_r 'r'
#define AUX_s 's'
#define AUX_t 't'
#define AUX_u 'u'
#define AUX_v 'v'
#define AUX_w 'w'
#define AUX_x 'x'
#define AUX_y 'y'
#define AUX_z 'z'
#define AUX_0 '0'
#define AUX_1 '1'
#define AUX_2 '2'
#define AUX_3 '3'
#define AUX_4 '4'
#define AUX_5 '5'
#define AUX_6 '6'
#define AUX_7 '7'
#define AUX_8 '8'
#define AUX_9 '9'
/*
** ToolKit Gets and Sets
*/
#define AUX_FD 1 /* return fd (long) */
#define AUX_COLORMAP 3 /* pass buf of r, g and b (unsigned char) */
#define AUX_GREYSCALEMAP 4
#define AUX_FOGMAP 5 /* pass fog and color bits (long) */
#define AUX_ONECOLOR 6 /* pass index, r, g, and b (long) */
/*
** Color Macros
*/
#define AUX_BLACK 0
#define AUX_RED 13
#define AUX_GREEN 14
#define AUX_YELLOW 15
#define AUX_BLUE 16
#define AUX_MAGENTA 17
#define AUX_CYAN 18
#define AUX_WHITE 19
extern float auxRGBMap[20][3];
#define AUX_SETCOLOR(x, y) (AUX_WIND_IS_RGB((x)) ? \
glColor3fv(auxRGBMap[(y)]) : glIndexf((y)))
/*
** RGB Image Structure
*/
typedef struct _AUX_RGBImageRec {
GLint sizeX, sizeY;
unsigned char *data;
} AUX_RGBImageRec;
/*
** Prototypes
*/
void APIENTRY auxInitDisplayMode(GLenum);
void APIENTRY auxInitPosition(int, int, int, int);
/* GLenum APIENTRY auxInitWindow(LPCTSTR); */
#ifdef UNICODE
#define auxInitWindow auxInitWindowW
#else
#define auxInitWindow auxInitWindowA
#endif
GLenum APIENTRY auxInitWindowA(LPCSTR);
GLenum APIENTRY auxInitWindowW(LPCWSTR);
void APIENTRY auxCloseWindow(void);
void APIENTRY auxQuit(void);
void APIENTRY auxSwapBuffers(void);
typedef void (CALLBACK* AUXMAINPROC)(void);
void APIENTRY auxMainLoop(AUXMAINPROC);
typedef void (CALLBACK* AUXEXPOSEPROC)(int, int);
void APIENTRY auxExposeFunc(AUXEXPOSEPROC);
typedef void (CALLBACK* AUXRESHAPEPROC)(GLsizei, GLsizei);
void APIENTRY auxReshapeFunc(AUXRESHAPEPROC);
typedef void (CALLBACK* AUXIDLEPROC)(void);
void APIENTRY auxIdleFunc(AUXIDLEPROC);
typedef void (CALLBACK* AUXKEYPROC)(void);
void APIENTRY auxKeyFunc(int, AUXKEYPROC);
typedef void (CALLBACK* AUXMOUSEPROC)(AUX_EVENTREC *);
void APIENTRY auxMouseFunc(int, int, AUXMOUSEPROC);
int APIENTRY auxGetColorMapSize(void);
void APIENTRY auxGetMouseLoc(int *, int *);
void APIENTRY auxSetOneColor(int, float, float, float);
void APIENTRY auxSetFogRamp(int, int);
void APIENTRY auxSetGreyRamp(void);
void APIENTRY auxSetRGBMap(int, float *);
/* AUX_RGBImageRec * APIENTRY auxRGBImageLoad(LPCTSTR); */
#ifdef UNICODE
#define auxRGBImageLoad auxRGBImageLoadW
#else
#define auxRGBImageLoad auxRGBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxRGBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxRGBImageLoadW(LPCWSTR);
#ifdef UNICODE
#define auxDIBImageLoad auxDIBImageLoadW
#else
#define auxDIBImageLoad auxDIBImageLoadA
#endif
AUX_RGBImageRec * APIENTRY auxDIBImageLoadA(LPCSTR);
AUX_RGBImageRec * APIENTRY auxDIBImageLoadW(LPCWSTR);
void APIENTRY auxCreateFont(void);
/* void APIENTRY auxDrawStr(LPCTSTR); */
#ifdef UNICODE
#define auxDrawStr auxDrawStrW
#else
#define auxDrawStr auxDrawStrA
#endif
void APIENTRY auxDrawStrA(LPCSTR);
void APIENTRY auxDrawStrW(LPCWSTR);
void APIENTRY auxWireSphere(GLdouble);
void APIENTRY auxSolidSphere(GLdouble);
void APIENTRY auxWireCube(GLdouble);
void APIENTRY auxSolidCube(GLdouble);
void APIENTRY auxWireBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxSolidBox(GLdouble, GLdouble, GLdouble);
void APIENTRY auxWireTorus(GLdouble, GLdouble);
void APIENTRY auxSolidTorus(GLdouble, GLdouble);
void APIENTRY auxWireCylinder(GLdouble, GLdouble);
void APIENTRY auxSolidCylinder(GLdouble, GLdouble);
void APIENTRY auxWireIcosahedron(GLdouble);
void APIENTRY auxSolidIcosahedron(GLdouble);
void APIENTRY auxWireOctahedron(GLdouble);
void APIENTRY auxSolidOctahedron(GLdouble);
void APIENTRY auxWireTetrahedron(GLdouble);
void APIENTRY auxSolidTetrahedron(GLdouble);
void APIENTRY auxWireDodecahedron(GLdouble);
void APIENTRY auxSolidDodecahedron(GLdouble);
void APIENTRY auxWireCone(GLdouble, GLdouble);
void APIENTRY auxSolidCone(GLdouble, GLdouble);
void APIENTRY auxWireTeapot(GLdouble);
void APIENTRY auxSolidTeapot(GLdouble);
/*
** Window specific functions
** hwnd, hdc, and hglrc valid after auxInitWindow()
*/
HWND APIENTRY auxGetHWND(void);
HDC APIENTRY auxGetHDC(void);
HGLRC APIENTRY auxGetHGLRC(void);
/*
** Viewperf support functions and constants
*/
/* Display Mode Selection Criteria */
enum {
AUX_USE_ID = 1,
AUX_EXACT_MATCH,
AUX_MINIMUM_CRITERIA
};
void APIENTRY auxInitDisplayModePolicy(GLenum);
GLenum APIENTRY auxInitDisplayModeID(GLint);
GLenum APIENTRY auxGetDisplayModePolicy(void);
GLint APIENTRY auxGetDisplayModeID(void);
GLenum APIENTRY auxGetDisplayMode(void);
#ifdef __cplusplus
}
#endif
#endif /* __GLAUX_H__ */
+584
View File
@@ -0,0 +1,584 @@
/*++ BUILD Version: 0004 // Increment this if a change has global effects
Copyright (c) 1985-95, Microsoft Corporation
Module Name:
glu.h
Abstract:
Procedure declarations, constant definitions and macros for the OpenGL
Utility Library.
--*/
#ifndef __glu_h__
#ifndef __GLU_H__
#define __glu_h__
#define __GLU_H__
#include <GL/gl.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
** Copyright 1991-1993, Silicon Graphics, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of Silicon Graphics, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
*/
/*
** Return the error string associated with a particular error code.
** This will return 0 for an invalid error code.
**
** The generic function prototype that can be compiled for ANSI or Unicode
** is defined as follows:
**
** LPCTSTR APIENTRY gluErrorStringWIN (GLenum errCode);
*/
#ifdef UNICODE
#define gluErrorStringWIN(errCode) ((LPCSTR) gluErrorUnicodeStringEXT(errCode))
#else
#define gluErrorStringWIN(errCode) ((LPCWSTR) gluErrorString(errCode))
#endif
const GLubyte* APIENTRY gluErrorString (
GLenum errCode);
const wchar_t* APIENTRY gluErrorUnicodeStringEXT (
GLenum errCode);
const GLubyte* APIENTRY gluGetString (
GLenum name);
void APIENTRY gluOrtho2D (
GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top);
void APIENTRY gluPerspective (
GLdouble fovy,
GLdouble aspect,
GLdouble zNear,
GLdouble zFar);
void APIENTRY gluPickMatrix (
GLdouble x,
GLdouble y,
GLdouble width,
GLdouble height,
GLint viewport[4]);
void APIENTRY gluLookAt (
GLdouble eyex,
GLdouble eyey,
GLdouble eyez,
GLdouble centerx,
GLdouble centery,
GLdouble centerz,
GLdouble upx,
GLdouble upy,
GLdouble upz);
int APIENTRY gluProject (
GLdouble objx,
GLdouble objy,
GLdouble objz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *winx,
GLdouble *winy,
GLdouble *winz);
int APIENTRY gluUnProject (
GLdouble winx,
GLdouble winy,
GLdouble winz,
const GLdouble modelMatrix[16],
const GLdouble projMatrix[16],
const GLint viewport[4],
GLdouble *objx,
GLdouble *objy,
GLdouble *objz);
int APIENTRY gluScaleImage (
GLenum format,
GLint widthin,
GLint heightin,
GLenum typein,
const void *datain,
GLint widthout,
GLint heightout,
GLenum typeout,
void *dataout);
int APIENTRY gluBuild1DMipmaps (
GLenum target,
GLint components,
GLint width,
GLenum format,
GLenum type,
const void *data);
int APIENTRY gluBuild2DMipmaps (
GLenum target,
GLint components,
GLint width,
GLint height,
GLenum format,
GLenum type,
const void *data);
#ifdef __cplusplus
class GLUnurbs;
class GLUquadric;
class GLUtesselator;
/* backwards compatibility: */
typedef class GLUnurbs GLUnurbsObj;
typedef class GLUquadric GLUquadricObj;
typedef class GLUtesselator GLUtesselatorObj;
typedef class GLUtesselator GLUtriangulatorObj;
#else
typedef struct GLUnurbs GLUnurbs;
typedef struct GLUquadric GLUquadric;
typedef struct GLUtesselator GLUtesselator;
/* backwards compatibility: */
typedef struct GLUnurbs GLUnurbsObj;
typedef struct GLUquadric GLUquadricObj;
typedef struct GLUtesselator GLUtesselatorObj;
typedef struct GLUtesselator GLUtriangulatorObj;
#endif
GLUquadric* APIENTRY gluNewQuadric (void);
void APIENTRY gluDeleteQuadric (
GLUquadric *state);
void APIENTRY gluQuadricNormals (
GLUquadric *quadObject,
GLenum normals);
void APIENTRY gluQuadricTexture (
GLUquadric *quadObject,
GLboolean textureCoords);
void APIENTRY gluQuadricOrientation (
GLUquadric *quadObject,
GLenum orientation);
void APIENTRY gluQuadricDrawStyle (
GLUquadric *quadObject,
GLenum drawStyle);
void APIENTRY gluCylinder (
GLUquadric *qobj,
GLdouble baseRadius,
GLdouble topRadius,
GLdouble height,
GLint slices,
GLint stacks);
void APIENTRY gluDisk (
GLUquadric *qobj,
GLdouble innerRadius,
GLdouble outerRadius,
GLint slices,
GLint loops);
void APIENTRY gluPartialDisk (
GLUquadric *qobj,
GLdouble innerRadius,
GLdouble outerRadius,
GLint slices,
GLint loops,
GLdouble startAngle,
GLdouble sweepAngle);
void APIENTRY gluSphere (
GLUquadric *qobj,
GLdouble radius,
GLint slices,
GLint stacks);
void APIENTRY gluQuadricCallback (
GLUquadric *qobj,
GLenum which,
void (CALLBACK* fn)());
GLUtesselator* APIENTRY gluNewTess(
void );
void APIENTRY gluDeleteTess(
GLUtesselator *tess );
void APIENTRY gluTessBeginPolygon(
GLUtesselator *tess,
void *polygon_data );
void APIENTRY gluTessBeginContour(
GLUtesselator *tess );
void APIENTRY gluTessVertex(
GLUtesselator *tess,
GLdouble coords[3],
void *data );
void APIENTRY gluTessEndContour(
GLUtesselator *tess );
void APIENTRY gluTessEndPolygon(
GLUtesselator *tess );
void APIENTRY gluTessProperty(
GLUtesselator *tess,
GLenum which,
GLdouble value );
void APIENTRY gluTessNormal(
GLUtesselator *tess,
GLdouble x,
GLdouble y,
GLdouble z );
void APIENTRY gluTessCallback(
GLUtesselator *tess,
GLenum which,
void (CALLBACK *fn)());
void APIENTRY gluGetTessProperty(
GLUtesselator *tess,
GLenum which,
GLdouble *value );
GLUnurbs* APIENTRY gluNewNurbsRenderer (void);
void APIENTRY gluDeleteNurbsRenderer (
GLUnurbs *nobj);
void APIENTRY gluBeginSurface (
GLUnurbs *nobj);
void APIENTRY gluBeginCurve (
GLUnurbs *nobj);
void APIENTRY gluEndCurve (
GLUnurbs *nobj);
void APIENTRY gluEndSurface (
GLUnurbs *nobj);
void APIENTRY gluBeginTrim (
GLUnurbs *nobj);
void APIENTRY gluEndTrim (
GLUnurbs *nobj);
void APIENTRY gluPwlCurve (
GLUnurbs *nobj,
GLint count,
GLfloat *array,
GLint stride,
GLenum type);
void APIENTRY gluNurbsCurve (
GLUnurbs *nobj,
GLint nknots,
GLfloat *knot,
GLint stride,
GLfloat *ctlarray,
GLint order,
GLenum type);
void APIENTRY
gluNurbsSurface(
GLUnurbs *nobj,
GLint sknot_count,
float *sknot,
GLint tknot_count,
GLfloat *tknot,
GLint s_stride,
GLint t_stride,
GLfloat *ctlarray,
GLint sorder,
GLint torder,
GLenum type);
void APIENTRY
gluLoadSamplingMatrices (
GLUnurbs *nobj,
const GLfloat modelMatrix[16],
const GLfloat projMatrix[16],
const GLint viewport[4] );
void APIENTRY
gluNurbsProperty (
GLUnurbs *nobj,
GLenum property,
GLfloat value );
void APIENTRY
gluGetNurbsProperty (
GLUnurbs *nobj,
GLenum property,
GLfloat *value );
void APIENTRY
gluNurbsCallback (
GLUnurbs *nobj,
GLenum which,
void (CALLBACK* fn)() );
/**** Callback function prototypes ****/
/* gluQuadricCallback */
typedef void (CALLBACK* GLUquadricErrorProc) (GLenum);
/* gluTessCallback */
typedef void (CALLBACK* GLUtessBeginProc) (GLenum);
typedef void (CALLBACK* GLUtessEdgeFlagProc) (GLboolean);
typedef void (CALLBACK* GLUtessVertexProc) (void *);
typedef void (CALLBACK* GLUtessEndProc) (void);
typedef void (CALLBACK* GLUtessErrorProc) (GLenum);
typedef void (CALLBACK* GLUtessCombineProc) (GLdouble[3],
void*[4],
GLfloat[4],
void** );
typedef void (CALLBACK* GLUtessBeginDataProc) (GLenum, void *);
typedef void (CALLBACK* GLUtessEdgeFlagDataProc) (GLboolean, void *);
typedef void (CALLBACK* GLUtessVertexDataProc) (void *, void *);
typedef void (CALLBACK* GLUtessEndDataProc) (void *);
typedef void (CALLBACK* GLUtessErrorDataProc) (GLenum, void *);
typedef void (CALLBACK* GLUtessCombineDataProc) (GLdouble[3],
void*[4],
GLfloat[4],
void**,
void* );
/* gluNurbsCallback */
typedef void (CALLBACK* GLUnurbsErrorProc) (GLenum);
/**** Generic constants ****/
/* Version */
#define GLU_VERSION_1_1 1
#define GLU_VERSION_1_2 1
/* Errors: (return value 0 = no error) */
#define GLU_INVALID_ENUM 100900
#define GLU_INVALID_VALUE 100901
#define GLU_OUT_OF_MEMORY 100902
#define GLU_INCOMPATIBLE_GL_VERSION 100903
/* StringName */
#define GLU_VERSION 100800
#define GLU_EXTENSIONS 100801
/* Boolean */
#define GLU_TRUE GL_TRUE
#define GLU_FALSE GL_FALSE
/**** Quadric constants ****/
/* QuadricNormal */
#define GLU_SMOOTH 100000
#define GLU_FLAT 100001
#define GLU_NONE 100002
/* QuadricDrawStyle */
#define GLU_POINT 100010
#define GLU_LINE 100011
#define GLU_FILL 100012
#define GLU_SILHOUETTE 100013
/* QuadricOrientation */
#define GLU_OUTSIDE 100020
#define GLU_INSIDE 100021
/* Callback types: */
/* GLU_ERROR 100103 */
/**** Tesselation constants ****/
#define GLU_TESS_MAX_COORD 1.0e150
/* TessProperty */
#define GLU_TESS_WINDING_RULE 100140
#define GLU_TESS_BOUNDARY_ONLY 100141
#define GLU_TESS_TOLERANCE 100142
/* TessWinding */
#define GLU_TESS_WINDING_ODD 100130
#define GLU_TESS_WINDING_NONZERO 100131
#define GLU_TESS_WINDING_POSITIVE 100132
#define GLU_TESS_WINDING_NEGATIVE 100133
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
/* TessCallback */
#define GLU_TESS_BEGIN 100100 /* void (CALLBACK*)(GLenum type) */
#define GLU_TESS_VERTEX 100101 /* void (CALLBACK*)(void *data) */
#define GLU_TESS_END 100102 /* void (CALLBACK*)(void) */
#define GLU_TESS_ERROR 100103 /* void (CALLBACK*)(GLenum errno) */
#define GLU_TESS_EDGE_FLAG 100104 /* void (CALLBACK*)(GLboolean boundaryEdge) */
#define GLU_TESS_COMBINE 100105 /* void (CALLBACK*)(GLdouble coords[3],
void *data[4],
GLfloat weight[4],
void **dataOut) */
#define GLU_TESS_BEGIN_DATA 100106 /* void (CALLBACK*)(GLenum type,
void *polygon_data) */
#define GLU_TESS_VERTEX_DATA 100107 /* void (CALLBACK*)(void *data,
void *polygon_data) */
#define GLU_TESS_END_DATA 100108 /* void (CALLBACK*)(void *polygon_data) */
#define GLU_TESS_ERROR_DATA 100109 /* void (CALLBACK*)(GLenum errno,
void *polygon_data) */
#define GLU_TESS_EDGE_FLAG_DATA 100110 /* void (CALLBACK*)(GLboolean boundaryEdge,
void *polygon_data) */
#define GLU_TESS_COMBINE_DATA 100111 /* void (CALLBACK*)(GLdouble coords[3],
void *data[4],
GLfloat weight[4],
void **dataOut,
void *polygon_data) */
/* TessError */
#define GLU_TESS_ERROR1 100151
#define GLU_TESS_ERROR2 100152
#define GLU_TESS_ERROR3 100153
#define GLU_TESS_ERROR4 100154
#define GLU_TESS_ERROR5 100155
#define GLU_TESS_ERROR6 100156
#define GLU_TESS_ERROR7 100157
#define GLU_TESS_ERROR8 100158
#define GLU_TESS_MISSING_BEGIN_POLYGON GLU_TESS_ERROR1
#define GLU_TESS_MISSING_BEGIN_CONTOUR GLU_TESS_ERROR2
#define GLU_TESS_MISSING_END_POLYGON GLU_TESS_ERROR3
#define GLU_TESS_MISSING_END_CONTOUR GLU_TESS_ERROR4
#define GLU_TESS_COORD_TOO_LARGE GLU_TESS_ERROR5
#define GLU_TESS_NEED_COMBINE_CALLBACK GLU_TESS_ERROR6
/**** NURBS constants ****/
/* NurbsProperty */
#define GLU_AUTO_LOAD_MATRIX 100200
#define GLU_CULLING 100201
#define GLU_SAMPLING_TOLERANCE 100203
#define GLU_DISPLAY_MODE 100204
#define GLU_PARAMETRIC_TOLERANCE 100202
#define GLU_SAMPLING_METHOD 100205
#define GLU_U_STEP 100206
#define GLU_V_STEP 100207
/* NurbsSampling */
#define GLU_PATH_LENGTH 100215
#define GLU_PARAMETRIC_ERROR 100216
#define GLU_DOMAIN_DISTANCE 100217
/* NurbsTrim */
#define GLU_MAP1_TRIM_2 100210
#define GLU_MAP1_TRIM_3 100211
/* NurbsDisplay */
/* GLU_FILL 100012 */
#define GLU_OUTLINE_POLYGON 100240
#define GLU_OUTLINE_PATCH 100241
/* NurbsCallback */
/* GLU_ERROR 100103 */
/* NurbsErrors */
#define GLU_NURBS_ERROR1 100251
#define GLU_NURBS_ERROR2 100252
#define GLU_NURBS_ERROR3 100253
#define GLU_NURBS_ERROR4 100254
#define GLU_NURBS_ERROR5 100255
#define GLU_NURBS_ERROR6 100256
#define GLU_NURBS_ERROR7 100257
#define GLU_NURBS_ERROR8 100258
#define GLU_NURBS_ERROR9 100259
#define GLU_NURBS_ERROR10 100260
#define GLU_NURBS_ERROR11 100261
#define GLU_NURBS_ERROR12 100262
#define GLU_NURBS_ERROR13 100263
#define GLU_NURBS_ERROR14 100264
#define GLU_NURBS_ERROR15 100265
#define GLU_NURBS_ERROR16 100266
#define GLU_NURBS_ERROR17 100267
#define GLU_NURBS_ERROR18 100268
#define GLU_NURBS_ERROR19 100269
#define GLU_NURBS_ERROR20 100270
#define GLU_NURBS_ERROR21 100271
#define GLU_NURBS_ERROR22 100272
#define GLU_NURBS_ERROR23 100273
#define GLU_NURBS_ERROR24 100274
#define GLU_NURBS_ERROR25 100275
#define GLU_NURBS_ERROR26 100276
#define GLU_NURBS_ERROR27 100277
#define GLU_NURBS_ERROR28 100278
#define GLU_NURBS_ERROR29 100279
#define GLU_NURBS_ERROR30 100280
#define GLU_NURBS_ERROR31 100281
#define GLU_NURBS_ERROR32 100282
#define GLU_NURBS_ERROR33 100283
#define GLU_NURBS_ERROR34 100284
#define GLU_NURBS_ERROR35 100285
#define GLU_NURBS_ERROR36 100286
#define GLU_NURBS_ERROR37 100287
/**** Backwards compatibility for old tesselator ****/
void APIENTRY gluBeginPolygon( GLUtesselator *tess );
void APIENTRY gluNextContour( GLUtesselator *tess,
GLenum type );
void APIENTRY gluEndPolygon( GLUtesselator *tess );
/* Contours types -- obsolete! */
#define GLU_CW 100120
#define GLU_CCW 100121
#define GLU_INTERIOR 100122
#define GLU_EXTERIOR 100123
#define GLU_UNKNOWN 100124
/* Names without "TESS_" prefix */
#define GLU_BEGIN GLU_TESS_BEGIN
#define GLU_VERTEX GLU_TESS_VERTEX
#define GLU_END GLU_TESS_END
#define GLU_ERROR GLU_TESS_ERROR
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG
#ifdef __cplusplus
}
#endif
#endif /* __GLU_H__ */
#endif /* __glu_h__ */
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+582
View File
@@ -0,0 +1,582 @@
#ifndef __wglext_h_
#define __wglext_h_
#ifdef __cplusplus
extern "C" {
#endif
/*
** License Applicability. Except to the extent portions of this file are
** made subject to an alternative license as permitted in the SGI Free
** Software License B, Version 1.1 (the "License"), the contents of this
** file are subject only to the provisions of the License. You may not use
** this file except in compliance with the License. You may obtain a copy
** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
**
** http://oss.sgi.com/projects/FreeB
**
** Note that, as provided in the License, the Software is distributed on an
** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
**
** Original Code. The Original Code is: OpenGL Sample Implementation,
** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
** Copyright in any portions created by third parties is as indicated
** elsewhere herein. All Rights Reserved.
**
** Additional Notice Provisions: This software was created using the
** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has
** not been independently verified as being compliant with the OpenGL(R)
** version 1.2.1 Specification.
*/
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__)
#define WIN32_LEAN_AND_MEAN 1
#include <windows.h>
#endif
#ifndef APIENTRY
#define APIENTRY
#endif
#ifndef GLAPI
#define GLAPI extern
#endif
/*************************************************************/
/* Header file version number */
/* wglext.h last updated 2002/03/22 */
/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */
#define WGL_WGLEXT_VERSION 4
#ifndef WGL_ARB_buffer_region
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
#endif
#ifndef WGL_ARB_multisample
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
#define WGL_SAMPLES_ARB 0x2042
#endif
#ifndef WGL_ARB_extensions_string
#endif
#ifndef WGL_ARB_pixel_format
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
#define WGL_ACCELERATION_ARB 0x2003
#define WGL_NEED_PALETTE_ARB 0x2004
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
#define WGL_SWAP_METHOD_ARB 0x2007
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
#define WGL_TRANSPARENT_ARB 0x200A
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
#define WGL_SHARE_DEPTH_ARB 0x200C
#define WGL_SHARE_STENCIL_ARB 0x200D
#define WGL_SHARE_ACCUM_ARB 0x200E
#define WGL_SUPPORT_GDI_ARB 0x200F
#define WGL_SUPPORT_OPENGL_ARB 0x2010
#define WGL_DOUBLE_BUFFER_ARB 0x2011
#define WGL_STEREO_ARB 0x2012
#define WGL_PIXEL_TYPE_ARB 0x2013
#define WGL_COLOR_BITS_ARB 0x2014
#define WGL_RED_BITS_ARB 0x2015
#define WGL_RED_SHIFT_ARB 0x2016
#define WGL_GREEN_BITS_ARB 0x2017
#define WGL_GREEN_SHIFT_ARB 0x2018
#define WGL_BLUE_BITS_ARB 0x2019
#define WGL_BLUE_SHIFT_ARB 0x201A
#define WGL_ALPHA_BITS_ARB 0x201B
#define WGL_ALPHA_SHIFT_ARB 0x201C
#define WGL_ACCUM_BITS_ARB 0x201D
#define WGL_ACCUM_RED_BITS_ARB 0x201E
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
#define WGL_DEPTH_BITS_ARB 0x2022
#define WGL_STENCIL_BITS_ARB 0x2023
#define WGL_AUX_BUFFERS_ARB 0x2024
#define WGL_NO_ACCELERATION_ARB 0x2025
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
#define WGL_FULL_ACCELERATION_ARB 0x2027
#define WGL_SWAP_EXCHANGE_ARB 0x2028
#define WGL_SWAP_COPY_ARB 0x2029
#define WGL_SWAP_UNDEFINED_ARB 0x202A
#define WGL_TYPE_RGBA_ARB 0x202B
#define WGL_TYPE_COLORINDEX_ARB 0x202C
#endif
#ifndef WGL_ARB_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
#endif
#ifndef WGL_ARB_pbuffer
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
#define WGL_PBUFFER_LARGEST_ARB 0x2033
#define WGL_PBUFFER_WIDTH_ARB 0x2034
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
#define WGL_PBUFFER_LOST_ARB 0x2036
#endif
#ifndef WGL_ARB_render_texture
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
#define WGL_TEXTURE_FORMAT_ARB 0x2072
#define WGL_TEXTURE_TARGET_ARB 0x2073
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
#define WGL_TEXTURE_RGB_ARB 0x2075
#define WGL_TEXTURE_RGBA_ARB 0x2076
#define WGL_NO_TEXTURE_ARB 0x2077
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
#define WGL_TEXTURE_1D_ARB 0x2079
#define WGL_TEXTURE_2D_ARB 0x207A
#define WGL_MIPMAP_LEVEL_ARB 0x207B
#define WGL_CUBE_MAP_FACE_ARB 0x207C
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
#define WGL_FRONT_LEFT_ARB 0x2083
#define WGL_FRONT_RIGHT_ARB 0x2084
#define WGL_BACK_LEFT_ARB 0x2085
#define WGL_BACK_RIGHT_ARB 0x2086
#define WGL_AUX0_ARB 0x2087
#define WGL_AUX1_ARB 0x2088
#define WGL_AUX2_ARB 0x2089
#define WGL_AUX3_ARB 0x208A
#define WGL_AUX4_ARB 0x208B
#define WGL_AUX5_ARB 0x208C
#define WGL_AUX6_ARB 0x208D
#define WGL_AUX7_ARB 0x208E
#define WGL_AUX8_ARB 0x208F
#define WGL_AUX9_ARB 0x2090
#endif
#ifndef WGL_EXT_make_current_read
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
#endif
#ifndef WGL_EXT_pixel_format
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
#define WGL_ACCELERATION_EXT 0x2003
#define WGL_NEED_PALETTE_EXT 0x2004
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
#define WGL_SWAP_METHOD_EXT 0x2007
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
#define WGL_TRANSPARENT_EXT 0x200A
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
#define WGL_SHARE_DEPTH_EXT 0x200C
#define WGL_SHARE_STENCIL_EXT 0x200D
#define WGL_SHARE_ACCUM_EXT 0x200E
#define WGL_SUPPORT_GDI_EXT 0x200F
#define WGL_SUPPORT_OPENGL_EXT 0x2010
#define WGL_DOUBLE_BUFFER_EXT 0x2011
#define WGL_STEREO_EXT 0x2012
#define WGL_PIXEL_TYPE_EXT 0x2013
#define WGL_COLOR_BITS_EXT 0x2014
#define WGL_RED_BITS_EXT 0x2015
#define WGL_RED_SHIFT_EXT 0x2016
#define WGL_GREEN_BITS_EXT 0x2017
#define WGL_GREEN_SHIFT_EXT 0x2018
#define WGL_BLUE_BITS_EXT 0x2019
#define WGL_BLUE_SHIFT_EXT 0x201A
#define WGL_ALPHA_BITS_EXT 0x201B
#define WGL_ALPHA_SHIFT_EXT 0x201C
#define WGL_ACCUM_BITS_EXT 0x201D
#define WGL_ACCUM_RED_BITS_EXT 0x201E
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
#define WGL_DEPTH_BITS_EXT 0x2022
#define WGL_STENCIL_BITS_EXT 0x2023
#define WGL_AUX_BUFFERS_EXT 0x2024
#define WGL_NO_ACCELERATION_EXT 0x2025
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
#define WGL_FULL_ACCELERATION_EXT 0x2027
#define WGL_SWAP_EXCHANGE_EXT 0x2028
#define WGL_SWAP_COPY_EXT 0x2029
#define WGL_SWAP_UNDEFINED_EXT 0x202A
#define WGL_TYPE_RGBA_EXT 0x202B
#define WGL_TYPE_COLORINDEX_EXT 0x202C
#endif
#ifndef WGL_EXT_pbuffer
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
#define WGL_PBUFFER_LARGEST_EXT 0x2033
#define WGL_PBUFFER_WIDTH_EXT 0x2034
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
#endif
#ifndef WGL_EXT_depth_float
#define WGL_DEPTH_FLOAT_EXT 0x2040
#endif
#ifndef WGL_3DFX_multisample
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
#define WGL_SAMPLES_3DFX 0x2061
#endif
#ifndef WGL_EXT_multisample
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
#define WGL_SAMPLES_EXT 0x2042
#endif
#ifndef WGL_I3D_digital_video_control
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
#endif
#ifndef WGL_I3D_gamma
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
#endif
#ifndef WGL_I3D_genlock
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
#define WGL_GENLOCK_SOURCE_EXTENAL_SYNC_I3D 0x2045
#define WGL_GENLOCK_SOURCE_EXTENAL_FIELD_I3D 0x2046
#define WGL_GENLOCK_SOURCE_EXTENAL_TTL_I3D 0x2047
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
#endif
#ifndef WGL_I3D_image_buffer
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
#endif
#ifndef WGL_I3D_swap_frame_lock
#endif
/*************************************************************/
#ifndef WGL_ARB_pbuffer
DECLARE_HANDLE(HPBUFFERARB);
#endif
#ifndef WGL_EXT_pbuffer
DECLARE_HANDLE(HPBUFFEREXT);
#endif
#ifndef WGL_ARB_buffer_region
#define WGL_ARB_buffer_region 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HANDLE WINAPI wglCreateBufferRegionARB (HDC, int, UINT);
extern VOID WINAPI wglDeleteBufferRegionARB (HANDLE);
extern BOOL WINAPI wglSaveBufferRegionARB (HANDLE, int, int, int, int);
extern BOOL WINAPI wglRestoreBufferRegionARB (HANDLE, int, int, int, int, int, int);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
#endif
#ifndef WGL_ARB_multisample
#define WGL_ARB_multisample 1
#endif
#ifndef WGL_ARB_extensions_string
#define WGL_ARB_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringARB (HDC);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
#endif
#ifndef WGL_ARB_pixel_format
#define WGL_ARB_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivARB (HDC, int, int, UINT, const int *, int *);
extern BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC, int, int, UINT, const int *, FLOAT *);
extern BOOL WINAPI wglChoosePixelFormatARB (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#ifndef WGL_ARB_make_current_read
#define WGL_ARB_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentARB (HDC, HDC, HGLRC);
extern HDC WINAPI wglGetCurrentReadDCARB (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
#endif
#ifndef WGL_ARB_pbuffer
#define WGL_ARB_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFERARB WINAPI wglCreatePbufferARB (HDC, int, int, int, const int *);
extern HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB);
extern int WINAPI wglReleasePbufferDCARB (HPBUFFERARB, HDC);
extern BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB);
extern BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB, int, int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
#endif
#ifndef WGL_ARB_render_texture
#define WGL_ARB_render_texture 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglBindTexImageARB (HPBUFFERARB, int);
extern BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB, int);
extern BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB, const int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
#endif
#ifndef WGL_EXT_display_color_table
#define WGL_EXT_display_color_table 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort);
extern GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *, GLuint);
extern GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort);
extern VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
#endif
#ifndef WGL_EXT_extensions_string
#define WGL_EXT_extensions_string 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern const char * WINAPI wglGetExtensionsStringEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef const char * (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
#endif
#ifndef WGL_EXT_make_current_read
#define WGL_EXT_make_current_read 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglMakeContextCurrentEXT (HDC, HDC, HGLRC);
extern HDC WINAPI wglGetCurrentReadDCEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
#endif
#ifndef WGL_EXT_pbuffer
#define WGL_EXT_pbuffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC, int, int, int, const int *);
extern HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT);
extern int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT, HDC);
extern BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT);
extern BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT, int, int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
#endif
#ifndef WGL_EXT_pixel_format
#define WGL_EXT_pixel_format 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC, int, int, UINT, int *, int *);
extern BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC, int, int, UINT, int *, FLOAT *);
extern BOOL WINAPI wglChoosePixelFormatEXT (HDC, const int *, const FLOAT *, UINT, int *, UINT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
#endif
#ifndef WGL_EXT_swap_control
#define WGL_EXT_swap_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglSwapIntervalEXT (int);
extern int WINAPI wglGetSwapIntervalEXT (void);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
#endif
#ifndef WGL_EXT_depth_float
#define WGL_EXT_depth_float 1
#endif
#ifndef WGL_NV_vertex_array_range
#define WGL_NV_vertex_array_range 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern void* WINAPI wglAllocateMemoryNV (GLsizei, GLfloat, GLfloat, GLfloat);
extern void WINAPI wglFreeMemoryNV (void *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef void* (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
#endif
#ifndef WGL_3DFX_multisample
#define WGL_3DFX_multisample 1
#endif
#ifndef WGL_EXT_multisample
#define WGL_EXT_multisample 1
#endif
#ifndef WGL_OML_sync_control
#define WGL_OML_sync_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetSyncValuesOML (HDC, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglGetMscRateOML (HDC, INT32 *, INT32 *);
extern INT64 WINAPI wglSwapBuffersMscOML (HDC, INT64, INT64, INT64);
extern INT64 WINAPI wglSwapLayerBuffersMscOML (HDC, int, INT64, INT64, INT64);
extern BOOL WINAPI wglWaitForMscOML (HDC, INT64, INT64, INT64, INT64 *, INT64 *, INT64 *);
extern BOOL WINAPI wglWaitForSbcOML (HDC, INT64, INT64 *, INT64 *, INT64 *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, int fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
#endif
#ifndef WGL_I3D_digital_video_control
#define WGL_I3D_digital_video_control 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC, int, int *);
extern BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC, int, const int *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
#endif
#ifndef WGL_I3D_gamma
#define WGL_I3D_gamma 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetGammaTableParametersI3D (HDC, int, int *);
extern BOOL WINAPI wglSetGammaTableParametersI3D (HDC, int, const int *);
extern BOOL WINAPI wglGetGammaTableI3D (HDC, int, USHORT *, USHORT *, USHORT *);
extern BOOL WINAPI wglSetGammaTableI3D (HDC, int, const USHORT *, const USHORT *, const USHORT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
#endif
#ifndef WGL_I3D_genlock
#define WGL_I3D_genlock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableGenlockI3D (HDC);
extern BOOL WINAPI wglDisableGenlockI3D (HDC);
extern BOOL WINAPI wglIsEnabledGenlockI3D (HDC, BOOL *);
extern BOOL WINAPI wglGenlockSourceI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSourceEdgeI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSampleRateI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSampleRateI3D (HDC, UINT *);
extern BOOL WINAPI wglGenlockSourceDelayI3D (HDC, UINT);
extern BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC, UINT *);
extern BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC, UINT *, UINT *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
#endif
#ifndef WGL_I3D_image_buffer
#define WGL_I3D_image_buffer 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern LPVOID WINAPI wglCreateImageBufferI3D (HDC, DWORD, UINT);
extern BOOL WINAPI wglDestroyImageBufferI3D (HDC, LPVOID);
extern BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC, const HANDLE *, const LPVOID *, const DWORD *, UINT);
extern BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC, const LPVOID *, UINT);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
#endif
#ifndef WGL_I3D_swap_frame_lock
#define WGL_I3D_swap_frame_lock 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglEnableFrameLockI3D (void);
extern BOOL WINAPI wglDisableFrameLockI3D (void);
extern BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *);
extern BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
#endif
#ifndef WGL_I3D_swap_frame_usage
#define WGL_I3D_swap_frame_usage 1
#ifdef WGL_WGLEXT_PROTOTYPES
extern BOOL WINAPI wglGetFrameUsageI3D (float *);
extern BOOL WINAPI wglBeginFrameTrackingI3D (void);
extern BOOL WINAPI wglEndFrameTrackingI3D (void);
extern BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *, DWORD *, float *);
#endif /* WGL_WGLEXT_PROTOTYPES */
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
#endif
#ifdef __cplusplus
}
#endif
#endif
+28 -9
View File
@@ -9,13 +9,26 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3D.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.5 $
* $Date: 2003-03-02 05:43:48 $
* $Author: penguin $
*
* Code for our Direct3D renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.4 2003/01/14 05:53:58 Goober5000
* commented out some mprintfs that were clogging up the debug spew
* --Goober5000
*
* Revision 2.3 2002/10/05 16:46:09 randomtiger
* 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.
*
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/30 14:29:15 unknownplayer
*
* Started work on DX8.1 implementation. Updated the project files to encompass
@@ -209,6 +222,7 @@
#include "globalincs/systemvars.h"
#include "cfile/cfile.h"
#include "cmdline/cmdline.h"
#include "debugconsole/timerbar.h"
LPDIRECTDRAW lpDD1 = NULL;
@@ -657,14 +671,14 @@ HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtV
OP_NOP( D3D_ex_ptr );
}
OP_TRIANGLE_LIST( unsigned short(dwVertexCount-2), D3D_ex_ptr );
OP_TRIANGLE_LIST( (unsigned short)(dwVertexCount-2), D3D_ex_ptr );
LPD3DTRIANGLE tri = ( LPD3DTRIANGLE )D3D_ex_ptr;
for (i=0; i<(int)dwVertexCount-2; i++ ) {
tri->v1 = unsigned short(D3D_num_verts+0);
tri->v2 = unsigned short(D3D_num_verts+i+1);
tri->v3 = unsigned short(D3D_num_verts+i+2);
tri->v1 = (unsigned short)(D3D_num_verts+0);
tri->v2 = (unsigned short)(D3D_num_verts+i+1);
tri->v3 = (unsigned short)(D3D_num_verts+i+2);
tri->wFlags = D3DTRIFLAG_EDGEENABLETRIANGLE;
tri++;
@@ -704,8 +718,8 @@ HRESULT d3d_DrawPrimitive( D3DPRIMITIVETYPE dptPrimitiveType, D3DVERTEXTYPE dvtV
for (i=0; i<(int)nlines; i++ ) {
LPD3DLINE line = (LPD3DLINE )D3D_ex_ptr;
line->v1 = unsigned short(D3D_num_verts);
line->v2 = unsigned short(D3D_num_verts+1);
line->v1 = (unsigned short)(D3D_num_verts);
line->v2 = (unsigned short)(D3D_num_verts+1);
D3D_ex_ptr = (void *)(((LPD3DLINE)D3D_ex_ptr) + 1);
}
@@ -791,7 +805,10 @@ void d3d_stop_frame()
In_frame--;
TIMERBAR_END_FRAME();
ddrval = lpD3DDevice->EndScene();
TIMERBAR_START_FRAME();
if (ddrval != D3D_OK ) {
//mprintf(( "Failed to end scene!\n%s\n", d3d_error_string(ddrval) ));
return;
@@ -1804,7 +1821,7 @@ void gr_d3d_flip()
}
ddrval = lpFrontBuffer->Flip( NULL, DDFLIP_WAIT );
if ( ddrval == DDERR_SURFACELOST ) {
mprintf(( "Front surface lost... attempting to restore...\n" ));
// mprintf(( "Front surface lost... attempting to restore...\n" ));
os_sleep(1000); // Wait a second
// os poll?
@@ -2818,6 +2835,8 @@ void gr_d3d_init()
gr_clear();
gr_flip();
Mouse_hidden--;
TIMERBAR_SET_DRAW_FUNC(d3d_render_timer_bar);
}
char* d3d_error_string(HRESULT error)
+7 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DInternal.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-10-05 16:46:09 $
* $Author: randomtiger $
*
* Prototypes for the variables used internally by the Direct3D renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -217,6 +220,7 @@ void gr_d3d_set_palette(ubyte *new_palette, int restrict_alphacolor);
void gr_d3d_diamond(int x, int y, int width, int height);
void gr_d3d_print_screen(char *filename);
void d3d_render_timer_bar(int colour, float x, float y, float w, float h);
// Functions used to render. Calls either DrawPrim or Execute buffer code
HRESULT d3d_SetRenderState( D3DRENDERSTATETYPE dwRenderStateType, DWORD dwRenderState );
+97 -12
View File
@@ -9,13 +9,40 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DRender.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-07 00:45:25 $
* $Author: DTP $
* $Revision: 2.10 $
* $Date: 2003-03-02 05:43:48 $
* $Author: penguin $
*
* Code to actually render stuff using Direct3D
*
* $Log: not supported by cvs2svn $
* Revision 2.9 2003/02/16 05:14:28 bobboau
* 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
*
* Revision 2.8 2003/01/20 05:40:49 bobboau
* added several sExps for turning glow points and glow maps on and off
*
* Revision 2.7 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.6 2003/01/09 21:20:21 phreak
* fixed a small error in bob's code
*
* Revision 2.5 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.4 2002/10/05 16:46:09 randomtiger
* 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.
*
* Revision 2.3 2002/08/07 00:45:25 DTP
* Implented -GF4FIX commandline switch & #include "cmdline/cmdline.h"
*
* Revision 2.2 2002/08/03 19:42:17 randomtiger
* Fixed Geforce 4 bug that caused font and hall video distortion.
* Very small change in 'gr_d3d_aabitmap_ex_internal'
@@ -343,6 +370,7 @@
#include "nebula/neb.h"
#include "render/3d.h"
#include "cmdline/cmdline.h" //DTP for random tigers GF4fix, and the commandline switch.
#include "debugconsole/timerbar.h"
typedef enum gr_texture_source {
TEXTURE_SOURCE_NONE,
@@ -707,6 +735,7 @@ float flCAP( float x, float minx, float maxx)
}
#define NEBULA_COLORS 20
static float Interp_fog_level;
void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_scaler )
{
@@ -971,10 +1000,11 @@ void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_sca
src_v++;
}
int ra = 0, ga = 0, ba = 0;
// if we're rendering against a fullneb background
if(flags & TMAP_FLAG_PIXEL_FOG){
int r, g, b;
int ra, ga, ba;
// int ra, ga, ba;
ra = ga = ba = 0;
// get the average pixel color behind the vertices
@@ -994,10 +1024,26 @@ void gr_d3d_tmapper_internal( int nverts, vertex **verts, uint flags, int is_sca
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
// turn off fog
// if(flags & TMAP_FLAG_PIXEL_FOG){
// gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
// }
//this is my hack to get some sort of luminence mapping-Bobboau
if(GLOWMAP > 0){
gr_screen.gf_set_bitmap(GLOWMAP, GR_ALPHABLEND_FILTER, GR_BITBLT_MODE_NORMAL, 0.0);
if ( !gr_tcache_set(gr_screen.current_bitmap, tmap_type, &u_scale, &v_scale, 0, gr_screen.current_bitmap_sx, gr_screen.current_bitmap_sy )) {
mprintf(( "Not rendering a texture because it didn't fit in VRAM!\n" ));
return;
}
gr_d3d_set_state( TEXTURE_SOURCE_DECAL, ALPHA_BLEND_ALPHA_ADDITIVE, zbuffer_type );
for (i=0; i<nverts; i++ ) {
if(flags & TMAP_FLAG_PIXEL_FOG)d3d_verts[i].color = RGBA_MAKE((255 - ra), (255 - ga), (255 - ba), ((ba + ga + ra)/2));
else d3d_verts[i].color = RGBA_MAKE(255, 255, 255, 0);
}
if(flags & TMAP_FLAG_PIXEL_FOG)gr_fog_set(GR_FOGMODE_NONE, 0, 0, 0);
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN, D3DVT_TLVERTEX, (LPVOID)d3d_verts, nverts, NULL);
if(flags & TMAP_FLAG_PIXEL_FOG)gr_fog_set(GR_FOGMODE_FOG, ra, ga, ba);
}
}
void gr_d3d_tmapper( int nverts, vertex **verts, uint flags )
@@ -1262,9 +1308,9 @@ void gr_d3d_reset_clip()
void gr_d3d_init_color(color *c, int r, int g, int b)
{
c->screen_sig = gr_screen.signature;
c->red = unsigned char(r);
c->green = unsigned char(g);
c->blue = unsigned char(b);
c->red = (unsigned char) r;
c->green = (unsigned char) g;
c->blue = (unsigned char) b;
c->alpha = 255;
c->ac_type = AC_TYPE_NONE;
c->alphacolor = -1;
@@ -1281,7 +1327,7 @@ void gr_d3d_init_alphacolor( color *clr, int r, int g, int b, int alpha, int typ
gr_d3d_init_color( clr, r, g, b );
clr->alpha = unsigned char(alpha);
clr->alpha = (unsigned char) alpha;
clr->ac_type = (ubyte)type;
clr->alphacolor = -1;
clr->is_alphacolor = 1;
@@ -2297,5 +2343,44 @@ void gr_d3d_print_screen(char *filename)
}
void d3d_render_timer_bar(int colour, float x, float y, float w, float h)
{
static D3DCOLOR pre_set_colours[TIMERBAR_COLOUR_MAX] =
{
0xffff0000, // red
0xff00ff00, // green
0xff0000ff, // blue
};
D3DTLVERTEX d3d_verts[4];
static float max_fw = (float) gr_screen.max_w;
static float max_fh = (float) gr_screen.max_h;
d3d_verts[0].rhw = 1;
d3d_verts[0].color = pre_set_colours[colour];
d3d_verts[0].sx = max_fw * x;
d3d_verts[0].sy = max_fh * y;
d3d_verts[1].rhw = 1;
d3d_verts[1].color = pre_set_colours[colour];
d3d_verts[1].sx = max_fw * (x + w);
d3d_verts[1].sy = max_fh * y;
d3d_verts[2].rhw = 1;
d3d_verts[2].color = pre_set_colours[colour];
d3d_verts[2].sx = max_fw * (x + w);
d3d_verts[2].sy = max_fh * (y + h);
d3d_verts[3].rhw = 1;
d3d_verts[3].color = pre_set_colours[colour];
d3d_verts[3].sx = max_fw * x;
d3d_verts[3].sy = max_fh * (y + h);
gr_d3d_set_state(TEXTURE_SOURCE_NONE, ALPHA_BLEND_NONE, ZBUFFER_TYPE_NONE);
d3d_DrawPrimitive(D3DPT_TRIANGLEFAN,D3DVT_TLVERTEX,(LPVOID)d3d_verts,4,NULL);
}
+10 -3
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrD3DTexture.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:43:48 $
* $Author: penguin $
*
* Code to manage loading textures into VRAM for Direct3D
*
* $Log: not supported by cvs2svn $
* Revision 2.2 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.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -624,7 +630,7 @@ int d3d_create_texture_sub(int bitmap_type, int texture_handle, ushort *data, in
g /= Gr_ta_green.scale;
b /= Gr_ta_blue.scale;
a /= Gr_ta_alpha.scale;
xlat[i] = unsigned short(((a<<Gr_ta_alpha.shift) | (r << Gr_ta_red.shift) | (g << Gr_ta_green.shift) | (b << Gr_ta_blue.shift)));
xlat[i] = (unsigned short)(((a<<Gr_ta_alpha.shift) | (r << Gr_ta_red.shift) | (g << Gr_ta_green.shift) | (b << Gr_ta_blue.shift)));
}
xlat[15] = xlat[1];
@@ -963,6 +969,7 @@ int d3d_tcache_set(int bitmap_id, int bitmap_type, float *u_scale, float *v_scal
}
int n = bm_get_cache_slot( bitmap_id, 1 );
// if(n == -1)return -1;//for a bad handel, this was triping some assertion errors in the glowmap code
tcache_slot_d3d * t = &Textures[n];
if ( (D3D_last_bitmap_id == bitmap_id) && (D3D_last_bitmap_type==bitmap_type) && (t->bitmap_id == bitmap_id) && (D3D_last_section_x == sx) && (D3D_last_section_y == sy)) {
+8 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrDirectDraw.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-01-14 05:53:58 $
* $Author: Goober5000 $
*
* Code for software 8-bpp rendering using DirectDraw
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -419,7 +422,7 @@ TryFlipAgain:
HRESULT ddrval = lpFrontBuffer->Flip( NULL, DDFLIP_WAIT );
if ( ddrval == DDERR_SURFACELOST ) {
mprintf(( "Front surface lost... attempting to restore...\n" ));
// mprintf(( "Front surface lost... attempting to restore...\n" ));
os_sleep(1000); // Wait a second
goto TryFlipAgain;
} else if (ddrval != DD_OK ) {
@@ -463,7 +466,7 @@ TryFlipAgain:
}
ddrval = lpFrontBuffer->Blt( &dst_rect, lpBackBuffer, &src_rect, DDBLT_WAIT, 0 );
if ( ddrval == DDERR_SURFACELOST ) {
mprintf(( "Front surface lost... attempting to restore...\n" ));
// mprintf(( "Front surface lost... attempting to restore...\n" ));
os_sleep(1000); // Wait a second
goto TryFlipAgain;
} else if (ddrval != DD_OK ) {
+9 -6
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrGlide.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.2 $
* $Date: 2003-03-02 05:43:49 $
* $Author: penguin $
*
* Code that uses 3DFX's Glide graphics library
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -2170,9 +2173,9 @@ void gr_glide_set_palette(ubyte *new_palette, int force_flag )
void gr_glide_init_color(color *c, int r, int g, int b)
{
c->screen_sig = gr_screen.signature;
c->red = unsigned char(r);
c->green = unsigned char(g);
c->blue = unsigned char(b);
c->red = (unsigned char)(r);
c->green = (unsigned char)(g);
c->blue = (unsigned char)(b);
c->alpha = 255;
c->ac_type = AC_TYPE_NONE;
c->alphacolor = -1;
@@ -2189,7 +2192,7 @@ void gr_glide_init_alphacolor( color *clr, int r, int g, int b, int alpha, int t
gr_glide_init_color( clr, r, g, b );
clr->alpha = unsigned char(alpha);
clr->alpha = (unsigned char)(alpha);
clr->ac_type = (ubyte)type;
clr->alphacolor = -1;
clr->is_alphacolor = 1;
+7 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrInternal.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-01-18 19:49:02 $
* $Author: phreak $
*
* Include file for our Graphics directory
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:22 penguin
* Warpcore CVS sync
*
@@ -217,6 +220,7 @@ extern int Gr_gamma_lookup[256];
#define TCACHE_TYPE_XPARENT 2 // Bitmap with 0,255,0 = transparent. Alpha=0 if transparent, 1 if not.
#define TCACHE_TYPE_NONDARKENING 3 // Bitmap with 255,255,255 = non-darkening. Alpha=1 if non-darkening, 0 if not.
#define TCACHE_TYPE_BITMAP_SECTION 4 // section of a bitmap
#define TCACHE_TYPE_COMPRESSED (1<<31)
#endif
File diff suppressed because it is too large. Load diff
+8 -5
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrOpenGL.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
* $Revision: 2.1 $
* $Date: 2003-03-07 00:15:45 $
* $Author: phreak $
*
* Include file for OpenGL renderer
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:07 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -36,8 +39,8 @@
#ifndef _GROPENGL_H
#define _GROPENGL_H
void gr_opengl_init();
void gr_opengl_cleanup();
void gr_opengl_init(int reinit=0);
void gr_opengl_cleanup(int minimize=1);
void gr_opengl_bitmap(int x, int y);
void gr_opengl_bitmap_ex(int x, int y, int w, int h, int sx, int sy);
File diff suppressed because it is too large. Load diff
+6 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/GrSoft.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:43:49 $
* $Author: penguin $
*
* Code for our software renderer using standard Win32 functions. (Dibsections, etc)
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -567,7 +570,7 @@ void gr_buffer_create( int w, int h, int bpp )
Gr_blue.mask = 0xff;
DibInfo.Header.biCompression = BI_RGB;
DibInfo.Header.biBitCount = unsigned short(bpp);
DibInfo.Header.biBitCount = (unsigned short)(bpp);
break;
default:
+61 -10
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/Scaler.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:45:04 $
* $Author: penguin $
*
* Routines to scale a bitmap.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -817,8 +820,9 @@ void gr8_scaler(vertex *va, vertex *vb )
spixels = (ubyte *)bp->data;
gr_lock();
#ifndef NO_SOFTWARE_RENDERING
Tmap.pScreenBits = (uint)gr_screen.offscreen_buffer_base;
#endif
uint *zbuf;
for (y=dy0; y<=dy1; v += dv, y++ ) {
@@ -836,7 +840,8 @@ void gr8_scaler(vertex *va, vertex *vb )
}
if ( Gr_scaler_zbuffering && gr_zbuffering ) {
zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
// zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
}
#ifdef USE_COMPILED_CODE
@@ -876,7 +881,7 @@ void gr8_scaler(vertex *va, vertex *vb )
}
*/
#ifdef _WIN32
#if defined _WIN32 && defined _MSC_VER
_asm push esi
_asm push edi
_asm push edx
@@ -898,8 +903,33 @@ void gr8_scaler(vertex *va, vertex *vb )
_asm pop edx
_asm pop edi
_asm pop esi
#elif defined __GNUC__
asm(
"push %%esi;"
"push %%edi;"
"push %%edx;"
"push %%ecx;"
"push %%ebx;"
"push %%eax;"
"mov %0,%%ecx;" // lookup
"mov %1,%%esi;" // sbits
"mov %2,%%edi;" // dbits
"mov %3,%%eax;" // cc
"mov %4,%%edx;" // zbuf
"push %%ebp;"
"mov %5,%%ebp;" // Gr_global_z
"call *%%eax;"
"pop %%ebp;"
"pop %%eax;"
"pop %%ebx;"
"pop %%ecx;"
"pop %%edx;"
"pop %%edi;"
"pop %%esi;"
: /* no outputs */
: "g" (lookup), "g" (sbits), "g" (dbits), "g" (cc), "g" (zbuf), "g" (Gr_global_z));
#else
#warning not implemented
#error asm not implemented
#endif
}
#else
@@ -1100,7 +1130,8 @@ void gr8_aascaler(vertex *va, vertex *vb )
int x, tmp_u;
tmp_u = u;
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
// uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
for (x=0; x<w; x++ ) {
if ( fx_w > *zbuf ) {
@@ -1113,7 +1144,7 @@ void gr8_aascaler(vertex *va, vertex *vb )
tmp_u += du;
}
} else {
#ifdef _WIN32
#if defined _WIN32 && defined _MSC_VER
_asm push esi
_asm push edi
_asm push ecx
@@ -1129,8 +1160,27 @@ void gr8_aascaler(vertex *va, vertex *vb )
_asm pop ecx
_asm pop edi
_asm pop esi
#elif defined __GNUC__
asm(
"push %%esi;"
"push %%edi;"
"push %%ecx;"
"push %%ebx;"
"push %%eax;"
"mov %0,%%ecx;" // lookup
"mov %1,%%esi;" // sbits
"mov %2,%%edi;" // dbits
"mov %3,%%eax;" // cc
"call *%%eax;"
"pop %%eax;"
"pop %%ebx;"
"pop %%ecx;"
"pop %%edi;"
"pop %%esi;"
: /* no outputs */
: "g" (lookup), "g" (sbits), "g" (dbits), "g" (cc));
#else
#warning not implemented
#error asm not implemented
#endif
}
#else
@@ -1138,7 +1188,8 @@ void gr8_aascaler(vertex *va, vertex *vb )
int x, tmp_u;
tmp_u = u;
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
// uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)Tmap.pScreenBits];
uint *zbuf = (uint *)&gr_zbuffer[(uint)dbits-(uint)gr_screen.offscreen_buffer_base];
for (x=0; x<w; x++ ) {
if ( fx_w > *zbuf ) {
+8 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Graphics/Shade.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:40:28 $
* $Author: penguin $
*
* Routines to shade an area.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -197,7 +200,7 @@ void gr8_shade(int x,int y,int w,int h)
int left_over = w1 % 4;
if ( wd4 > 0 ) {
#ifdef _WIN32
#if defined _WIN32 && !defined __GNUC__
_asm push eax
_asm push ebx
_asm push ecx
@@ -248,7 +251,8 @@ void gr8_shade(int x,int y,int w,int h)
_asm pop ebx
_asm pop eax
#else
#warning not implemented
#warning asm not implemented
Error(LOCATION, "asm not implemented");
#endif
}
+34 -17
View File
@@ -9,13 +9,25 @@
/*
* $Logfile: /Freespace2/code/Hud/HUD.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2003-01-19 07:02:15 $
* $Author: Goober5000 $
*
* C module that contains all the HUD functions at a high level
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2003/01/17 07:59:09 Goober5000
* fixed some really strange behavior with strings not being truncated at the
* # symbol
* --Goober5000
*
* 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:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -372,12 +384,15 @@
#define HUD_NEW_ALPHA_NORMAL_HI 190
#define HUD_NEW_ALPHA_BRIGHT_HI 255
// This is used to prevent drawing of hud (and pause popup)
// globals that will control the color of the HUD gauges
int HUD_color_red = 0;
int HUD_color_green = 255;
int HUD_color_blue = 0;
int HUD_color_alpha = HUD_COLOR_ALPHA_DEFAULT; // 1 -> HUD_COLOR_ALPHA_USER_MAX
int HUD_draw = 1;
int HUD_contrast = 0; // high or lo contrast (for nebula, etc)
color HUD_color_defaults[HUD_NUM_COLOR_LEVELS]; // array of colors with different alpha blending
@@ -959,11 +974,18 @@ void HUD_init()
// default to high contrast in the nebula
HUD_contrast = 0;
HUD_draw = 1;
if(The_mission.flags & MISSION_FLAG_FULLNEB){
HUD_contrast = 1;
}
}
void hud_toggle_draw()
{
HUD_draw = !HUD_draw;
}
// return !0 if HUD is disabled (ie no gauges are shown/usable), otherwise return 0
int hud_disabled()
{
@@ -971,7 +993,7 @@ int hud_disabled()
//return 1;
//}
return 0;
return !HUD_draw;
}
// Determine if we should popup the weapons gauge on the HUD.
@@ -2459,7 +2481,14 @@ void hud_support_view_blit()
gr_string(0x8000, Support_text_val_coords[gr_screen.res][1], outstr);
} else {
if ( Hud_support_objnum == -1 ) {
sprintf(outstr, XSTR( "warping in", 230));
if (The_mission.support_ships.arrival_location == ARRIVE_FROM_DOCK_BAY)
{
sprintf(outstr, XSTR( "exiting hangar", -1));
}
else
{
sprintf(outstr, XSTR( "warping in", 230));
}
gr_string(0x8000, Support_text_val_coords[gr_screen.res][1], outstr);
} else {
ai_info *aip;
@@ -3088,18 +3117,6 @@ void hud_maybe_render_multi_text()
}
#endif
// cut any text off after (and including) '#' char
void hud_end_string_at_first_hash_symbol(char *src)
{
char *pointer_to_last_char;
pointer_to_last_char = strstr(src, NOX("#"));
if ( pointer_to_last_char ) {
*pointer_to_last_char = 0;
}
}
// set the offset values for this render frame
void HUD_set_offsets(object *viewer_obj, int wiggedy_wack)
{
+11 -6
View File
@@ -9,13 +9,20 @@
/*
* $Logfile: /Freespace2/code/Hud/HUD.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-01-17 07:59:09 $
* $Author: Goober5000 $
*
* Header file for functions that contain HUD functions at a high level
*
* $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:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -344,9 +351,6 @@ void hud_start_text_flash(char *txt, int t);
// convert a string to use mono spaced numbers
void hud_num_make_mono(char *num_str);
// cut any text off after (and including) '#' char
void hud_end_string_at_first_hash_symbol(char *src);
// functions for handling hud animations
void hud_anim_init(hud_anim *ha, int sx, int sy, char *filename);
int hud_anim_render(hud_anim *ha, float frametime, int draw_alpha=0, int loop=1, int hold_last=0, int reverse=0);
@@ -404,6 +408,7 @@ void hud_subspace_notify_abort();
// render multiplayer text message currently being entered if any
void hud_maybe_render_multi_text();
void hud_toggle_draw();
int hud_disabled();
int hud_support_find_closest( int objnum );
+22 -15
View File
@@ -9,13 +9,24 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDbrackets.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2003-01-27 07:46:33 $
* $Author: Goober5000 $
*
* C file that contains functions for drawing target brackets on the HUD
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/14 17:09:28 Goober5000
* 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
*
* Revision 2.2 2002/12/14 01:55:04 Goober5000
* added mission flag to show subsystem damage for fighterbays
* ~Goober5000~
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -227,6 +238,7 @@
#include "bmpman/bmpman.h"
#include "globalincs/linklist.h"
#include "weapon/emp.h"
#include "mission/missionparse.h"
#define FADE_FACTOR 2 // how much the bounding brackets get faded
#define LOWEST_RED 50 // lowest r value for bounding bracket
@@ -533,16 +545,6 @@ void draw_brackets_diamond_quick(int x1, int y1, int x2, int y2, int thick)
gr_line(center_x-x_delta, center_y+y_delta, center_x+x_delta, center_y-y_delta);
}
int subsys_is_fighterbay(ship_subsys *ss)
{
if ( !strnicmp(NOX("fighter"), ss->system_info->name, 7) ) {
return 1;
}
return 0;
}
// Draw bounding brackets for a subobject.
void draw_bounding_brackets_subobject()
{
@@ -608,8 +610,13 @@ void draw_bounding_brackets_subobject()
// determine if subsystem is on far or near side of the ship
Player->subsys_in_view = ship_subsystem_in_sight(targetp, subsys, &View_position, &subobj_pos, 0);
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
if ( (Player_ai->targeted_subsys->current_hits <= 0) && (!subsys_is_fighterbay(Player_ai->targeted_subsys)) ) {
// AL 29-3-98: If subsystem is destroyed, draw gray brackets
// Goober5000: this will now execute for fighterbays if the bay has been given a
// percentage subsystem strength in ships.tbl
// Goober5000: this will now execute for any subsys that takes damage and will not
// execute for any subsys that doesn't take damage
if ( (Player_ai->targeted_subsys->current_hits <= 0) && ( ship_subsys_takes_damage(Player_ai->targeted_subsys) ) )
{
gr_set_color_fast(&IFF_colors[IFF_COLOR_MESSAGE][1]);
} else {
hud_set_iff_color( targetp, 1 );
+10 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDconfig.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-01-15 21:29:04 $
* $Author: anonymous $
*
* C module to handle HUD configuration
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.1 2002/07/18 20:07:49 penguin
* Fixed bug (potential access of unitialized pointer) in hud_config_render_gauges() -- thanks to DTP for finding it!
*
@@ -503,8 +506,10 @@ struct HC_gauge_region HC_gauge_regions[GR_NUM_RESOLUTIONS][NUM_HUD_GAUGES] =
HC_gauge_region("none", 1, 1, -1, 0, 0, -1, 0, 0), // attacking target count
HC_gauge_region("HCB_38", 342, 138, 38, 0, 0, -1, 0, 0), // text flash gauge
HC_gauge_region("HCB_52", 465, 8, 52, 0, 0, -1, 0, 0), // comm menu
#ifndef FS2_DEMO
HC_gauge_region("HCB_46", 324, 264, 46, 0, 0, -1, 0, 0), // support view gauge
HC_gauge_region("HCB_47", 418, 262, 47, 0, 0, -1, 0, 0), // netlag icon gauge
#endif
//XSTR:ON
},
{ // GR_1024
@@ -546,8 +551,10 @@ struct HC_gauge_region HC_gauge_regions[GR_NUM_RESOLUTIONS][NUM_HUD_GAUGES] =
HC_gauge_region("none", 1, 1, -1, 0, 0, -1, 0, 0), // attacking target count
HC_gauge_region("2_HCB_38", 548, 222, 38, 0, 0, -1, 0, 0), // text flash gauge
HC_gauge_region("2_HCB_52", 744, 14, 52, 0, 0, -1, 0, 0), // comm menu
#ifndef FS2_DEMO
HC_gauge_region("2_HCB_46", 520, 422, 46, 0, 0, -1, 0, 0), // support view gauge
HC_gauge_region("2_HCB_47", 670, 419, 47, 0, 0, -1, 0, 0), // netlag icon gauge
#endif
//XSTR:ON
}
};
+32 -6
View File
@@ -9,13 +9,24 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDescort.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2003-01-18 09:25:41 $
* $Author: Goober5000 $
*
* C module for managing and displaying ships that are in an escort
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/31 07:26:40 Goober5000
* added damaged-escort-priority-all sexp
* --Goober5000
*
* Revision 2.2 2002/12/31 05:17:13 Goober5000
* fixed escort list behavior for stealthy ships
* --Goober5000
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -125,9 +136,6 @@ escort_info Escort_ships[MAX_ESCORT_SHIPS];
int Num_escort_ships;
// size of complete escort list, including all those wanting to get onto list but without space
#define MAX_COMPLETE_ESCORT_LIST 20
#define NUM_ESCORT_FRAMES 3
hud_frames Escort_gauges[NUM_ESCORT_FRAMES];
@@ -374,6 +382,24 @@ void hud_create_complete_escort_list(escort_info *escorts, int *num_escorts)
continue;
}
// don't process most stealth ships
if ( (Ships[objp->instance].flags2 & SF2_STEALTH) )
{
if ( Ships[objp->instance].team == TEAM_FRIENDLY )
{
// friendly stealths are only not seen when explicitly specified
if ( Ships[objp->instance].flags2 & SF2_FRIENDLY_STEALTH_INVIS )
{
continue;
}
}
// non-friendly stealths are never seen
else
{
continue;
}
}
// don't process ships that are dying, or objects that should be dead
if ( (Ships[objp->instance].flags & (SF_DYING|SF_DEPARTING)) || (objp->flags & OF_SHOULD_BE_DEAD) ){
continue;
+129 -37
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDets.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-12-10 05:43:34 $
* $Author: Goober5000 $
*
* C file that contains code to manage and display the Energy Transfer System (ETS)
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -502,12 +505,29 @@ void hud_show_ets()
return;
}
// if at least two gauges are not shown, don't show any
i = 0;
if (Player_obj->flags & OF_NO_LASERS) i++;
if (Player_obj->flags & OF_NO_SHIELDS) i++;
if (Player_obj->flags & OF_NO_ENGINES) i++;
if (i >= 2) return;
hud_set_gauge_color(HUD_ETS_GAUGE);
// draw the letters for the gauges first, before any clipping occurs
i = 0;
for ( j = 0; j < 3; j++ ) {
if ( j == 1 && Player_obj->flags & OF_NO_SHIELDS ) {
for ( j = 0; j < 3; j++ )
{
if (j == 0 && Player_obj->flags & OF_NO_LASERS)
{
continue;
}
if (j == 1 && Player_obj->flags & OF_NO_SHIELDS)
{
continue;
}
if (j == 2 && Player_obj->flags & OF_NO_ENGINES)
{
continue;
}
Assert(Ets_gauge_info != NULL);
@@ -522,15 +542,24 @@ void hud_show_ets()
switch (j) {
case 0:
index = ship_p->weapon_recharge_index;
if ( Player_obj->flags & OF_NO_LASERS )
{
continue;
}
break;
case 1:
index = ship_p->shield_recharge_index;
if ( Player_obj->flags & OF_NO_SHIELDS ) {
if ( Player_obj->flags & OF_NO_SHIELDS )
{
continue;
}
break;
case 2:
index = ship_p->engine_recharge_index;
if ( Player_obj->flags & OF_NO_ENGINES )
{
continue;
}
break;
}
@@ -609,13 +638,13 @@ void set_default_recharge_rates(object* obj)
return;
ship_properties = 0;
if ( ship_info_p->max_weapon_reserve )
if (!(obj->flags & OF_NO_LASERS))
ship_properties |= HAS_WEAPONS;
if (!(obj->flags & OF_NO_SHIELDS))
ship_properties |= HAS_SHIELDS;
if ( ship_info_p->max_speed )
if (!(obj->flags & OF_NO_ENGINES))
ship_properties |= HAS_ENGINES;
// the default charge rate depends on what systems are on each ship
@@ -680,43 +709,74 @@ void increase_recharge_rate(object* obj, SYSTEM_TYPE ship_system)
switch ( ship_system ) {
case WEAPONS:
if ( obj->flags & OF_NO_LASERS )
return;
gain_index = &ship_p->weapon_recharge_index;
lose_index1 = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_SHIELDS )
lose_index1 = NULL;
else
lose_index1 = &ship_p->shield_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
lose_index2 = NULL;
} else {
lose_index2 = &ship_p->shield_recharge_index;
}
else
lose_index2 = &ship_p->engine_recharge_index;
break;
case SHIELDS:
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_SHIELDS )
return;
}
gain_index = &ship_p->shield_recharge_index;
lose_index1 = &ship_p->weapon_recharge_index;
lose_index2 = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_LASERS )
lose_index1 = NULL;
else
lose_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
lose_index2 = NULL;
else
lose_index2 = &ship_p->engine_recharge_index;
break;
case ENGINES:
if ( obj->flags & OF_NO_ENGINES )
return;
gain_index = &ship_p->engine_recharge_index;
lose_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_LASERS )
lose_index1 = NULL;
else
lose_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS )
lose_index2 = NULL;
} else {
else
lose_index2 = &ship_p->shield_recharge_index;
}
break;
} // end switch
// return if we can't transfer energy
if (!lose_index1 && !lose_index2)
return;
// already full, nothing to do
count = MAX_ENERGY_INDEX - *gain_index;
if ( count > 2 )
count = 2;
if ( count <= 0 ) {
if ( obj == Player_obj ) {
if ( count <= 0 )
{
if ( obj == Player_obj )
{
snd_play( &Snds[SND_ENERGY_TRANS_FAIL], 0.0f );
}
return;
@@ -770,39 +830,65 @@ void decrease_recharge_rate(object* obj, SYSTEM_TYPE ship_system)
switch ( ship_system ) {
case WEAPONS:
if ( obj->flags & OF_NO_LASERS )
return;
lose_index = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_SHIELDS )
gain_index1 = NULL;
} else {
else
gain_index1 = &ship_p->shield_recharge_index;
}
gain_index2 = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
gain_index2 = NULL;
else
gain_index2 = &ship_p->engine_recharge_index;
break;
case SHIELDS:
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_SHIELDS )
return;
}
lose_index = &ship_p->shield_recharge_index;
gain_index1 = &ship_p->weapon_recharge_index;
gain_index2 = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_LASERS )
gain_index1 = NULL;
else
gain_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_ENGINES )
gain_index2 = NULL;
else
gain_index2 = &ship_p->engine_recharge_index;
break;
case ENGINES:
if ( obj->flags & OF_NO_ENGINES )
return;
lose_index = &ship_p->engine_recharge_index;
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_LASERS )
gain_index1 = NULL;
} else {
gain_index1 = &ship_p->shield_recharge_index;
}
else
gain_index1 = &ship_p->weapon_recharge_index;
if ( obj->flags & OF_NO_SHIELDS )
gain_index2 = NULL;
else
gain_index2 = &ship_p->shield_recharge_index;
gain_index2 = &ship_p->weapon_recharge_index;
break;
} // end switch
// return if we can't transfer energy
if (!gain_index1 && !gain_index2)
return;
// check how much there is to lose
count = min(2, *lose_index);
if ( count <= 0 ) {
@@ -882,7 +968,8 @@ void transfer_energy_to_shields(object* obj)
if (ship_p->flags & SF_DYING)
return;
if ( obj->flags & OF_NO_SHIELDS ) {
if ( obj->flags & OF_NO_LASERS || obj->flags & OF_NO_SHIELDS )
{
return;
}
@@ -900,6 +987,11 @@ void transfer_energy_to_weapons(object* obj)
if (ship_p->flags & SF_DYING)
return;
if ( obj->flags & OF_NO_LASERS || obj->flags & OF_NO_SHIELDS )
{
return;
}
transfer_energy_weapon_common(obj, get_shield_strength(obj), ship_p->weapon_energy, &ship_p->target_shields_delta, &ship_p->target_weapon_energy_delta, sinfo_p->max_weapon_reserve, 1.0f);
}
+10 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDgauges.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
* $Revision: 2.1 $
* $Date: 2003-01-15 21:29:04 $
* $Author: anonymous $
*
* HUD data common to FRED and FreeSpace
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:08 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -80,7 +83,11 @@
#define __HUD_COMMON_H__
// HUD gauge types
#ifdef FS2_DEMO
#define NUM_HUD_GAUGES 37
#else
#define NUM_HUD_GAUGES 39
#endif
#define HUD_LEAD_INDICATOR 0
#define HUD_ORIENTATION_TEE 1
+10 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDshield.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:23 $
* $Author: penguin $
* $Revision: 2.1 $
* $Date: 2003-01-06 17:14:52 $
* $Author: Goober5000 $
*
* Header file for the display and management of the HUD shield
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:08 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -89,4 +92,8 @@ void hud_shield_hit_reset(int player=0);
void shield_info_reset(shield_hit_info *shi);
// random page in stuff - moved here by Goober5000
extern void hud_ship_icon_page_in(ship_info *sip);
#endif /* __FREESPACE_HUDSHIELDBOX_H__ */
+23 -6
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDsquadmsg.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-01-19 22:20:23 $
* $Author: Goober5000 $
*
* File to control sqaudmate messaging
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -1174,13 +1177,27 @@ void hud_squadmsg_repair_rearm_abort( int toggle_state, object *obj)
hud_squadmsg_toggle(); // take us out of message mode
}
// Goober5000 - redone and added a bit
// returns 1 if an order is valid for a ship. Applies to things like departure when engines are blown, etc.
int hud_squadmsg_ship_order_valid( int shipnum, int order )
{
// disabled ships can't depart.
if ( (order == DEPART_ITEM) && (Ships[shipnum].flags & SF_DISABLED) )
return 0;
switch ( order )
{
case DEPART_ITEM:
// disabled ships can't depart.
if (Ships[shipnum].flags & SF_DISABLED)
return 0;
// Goober5000: also can't depart if no subspace drives and no capships in the area
if (Ships[shipnum].flags2 & SF2_NO_SUBSPACE_DRIVE)
{
// locate a capital ship on the same team:
if (ship_get_ship_with_dock_bay(Ships[shipnum].team) < 0)
return 0;
}
break;
}
return 1;
}
+448 -94
View File
@@ -9,13 +9,55 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtarget.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:05 $
* $Author: penguin $
* $Revision: 2.12 $
* $Date: 2003-01-17 07:59:09 $
* $Author: Goober5000 $
*
* C module to provide HUD targeting functions
*
* $Log: not supported by cvs2svn $
* Revision 2.11 2003/01/03 21:58:08 Goober5000
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
* has primitive sensors it can't target anything and objects don't appear
* on radar if they're outside a certain range. This range can be modified
* via the sexp primitive-sensors-set-range.
* --Goober5000
*
* Revision 2.10 2002/12/31 19:18:41 Goober5000
* if it ain't broke, don't fix it
* --Goober5000
*
* Revision 2.8 2002/12/22 21:31:01 Goober5000
* tweaked positioning of the new HUD graphics
* --Goober5000
*
* Revision 2.7 2002/12/21 18:03:49 Goober5000
* 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
*
* Revision 2.6 2002/12/19 10:54:37 Goober5000
* oops - squashed a bug :)
* --Goober5000
*
* Revision 2.5 2002/12/19 10:46:14 Goober5000
* implemented the revised HUD weapon display for ballistic primaries
* --Goober5000
*
* Revision 2.4 2002/12/13 08:13:30 Goober5000
* small tweaks and bug fixes for the ballistic primary conversion
* ~Goober5000~
*
* Revision 2.3 2002/12/10 05:42:42 Goober5000
* Full-fledged ballistic primary support added! Try it and see! :)
*
* Fixed lead indicator behavior; Phreak's version didn't work properly.
*
* Revision 2.2 2002/09/20 20:02:00 phreak
* lead indicator for dumbfire missiles
*
* Revision 2.1 2002/08/01 01:41:05 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:23 penguin
* Warpcore CVS sync
*
@@ -282,6 +324,8 @@ float Max_front_seperation[GR_NUM_RESOLUTIONS] = {
// This means the variables are not player-specific
static int Target_in_reticle = 0;
static int ballistic_hud_index = 0; // Goober5000
extern object obj_used_list; // dummy node in linked list of active objects
extern char *Cargo_names[];
@@ -480,47 +524,97 @@ static int Toggle_text_alpha = 255;
// animation files for the weapons gauge
#define NUM_WEAPON_GAUGES 5
hud_frames Weapon_gauges[NUM_WEAPON_GAUGES];
#define NUM_HUD_SETTINGS 2
hud_frames Weapon_gauges[NUM_HUD_SETTINGS][NUM_WEAPON_GAUGES];
int Weapon_gauges_loaded = 0;
// for primaries
int Weapon_gauge_primary_coords[GR_NUM_RESOLUTIONS][3][2] = {
{ // GR_640
// based on the # of primaries
{509, 273}, // top of weapon gauge, first frame, always
{497, 293}, // for the first primary
{497, 305} // for the second primary
int Weapon_gauge_primary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][3][2] =
{
{ // normal HUD
{ // GR_640
// based on the # of primaries
{509, 273}, // top of weapon gauge, first frame, always
{497, 293}, // for the first primary
{497, 305} // for the second primary
},
{ // GR_1024
// based on the # of primaries
{892, 525}, // top of weapon gauge, first frame, always
{880, 545}, // for the first primary
{880, 557} // for the second primary
}
},
{ // GR_1024
// based on the # of primaries
{892, 525}, // top of weapon gauge, first frame, always
{880, 545}, // for the first primary
{880, 557} // for the second primary
{ // ballistic HUD - slightly different alignment
{ // GR_640
// based on the # of primaries
{485, 273}, // top of weapon gauge, first frame, always
{485, 293}, // for the first primary
{485, 305} // for the second primary
},
{ // GR_1024
// based on the # of primaries
{868, 525}, // top of weapon gauge, first frame, always
{868, 545}, // for the first primary
{868, 557} // for the second primary
}
}
};
int Weapon_gauge_secondary_coords[GR_NUM_RESOLUTIONS][5][2] = {
{ // GR_640
// based on the # of secondaries
{497, 318}, // bottom of gauge, 0 secondaries
{497, 318}, // bottom of gauge, 1 secondaries
{497, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 335} // bottom of gauge, 3 secondaries
int Weapon_gauge_secondary_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][5][2] =
{
{ // normal HUD
{ // GR_640
// based on the # of secondaries
{497, 318}, // bottom of gauge, 0 secondaries
{497, 318}, // bottom of gauge, 1 secondaries
{497, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{497, 335} // bottom of gauge, 3 secondaries
},
{ // GR_1024
// based on the # of secondaries
{880, 570}, // bottom of gauge, 0 secondaries
{880, 570}, // bottom of gauge, 1 secondaries
{880, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 587} // bottom of gauge, 3 secondaries
}
},
{ // GR_1024
// based on the # of secondaries
{880, 570}, // bottom of gauge, 0 secondaries
{880, 570}, // bottom of gauge, 1 secondaries
{880, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{880, 587} // bottom of gauge, 3 secondaries
{ // ballistic HUD - slightly different alignment
{ // GR_640
// based on the # of secondaries
{485, 318}, // bottom of gauge, 0 secondaries
{485, 318}, // bottom of gauge, 1 secondaries
{485, 317}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{485, 326}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{485, 335} // bottom of gauge, 3 secondaries
},
{ // GR_1024
// based on the # of secondaries
{868, 570}, // bottom of gauge, 0 secondaries
{868, 570}, // bottom of gauge, 1 secondaries
{868, 569}, // middle of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{868, 578}, // bottom of gauge, 2 secondaries AND middle of gauge, 3 secondaries
{868, 587} // bottom of gauge, 3 secondaries
}
}
};
int Weapon_title_coords[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
518, 275
int Weapon_title_coords[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][2] =
{
{ // normal HUD
{ // GR_640
518, 274
},
{ // GR_1024
901, 527
}
},
{ // GR_1024
901, 527
{ // ballistic HUD - slightly different alignment
{ // GR_640
487, 274
},
{ // GR_1024
870, 527
}
}
};
int Weapon_plink_coords[GR_NUM_RESOLUTIONS][2][2] = {
@@ -563,6 +657,16 @@ int Weapon_secondary_y[GR_NUM_RESOLUTIONS][3] = {
579 // y location of where to draw text for the third secondary
}
};
int Weapon_primary_y[GR_NUM_RESOLUTIONS][2] = {
{ // GR_640
285, // y location of where to draw text for the first primary
295 // y location of where to draw text for the second primary
},
{ // GR_1024
537, // y location of where to draw text for the first primary
547 // y location of where to draw text for the second primary
}
};
int Weapon_secondary_name_x[GR_NUM_RESOLUTIONS] = {
536, // x location of where to draw weapon name
919
@@ -571,26 +675,48 @@ int Weapon_secondary_ammo_x[GR_NUM_RESOLUTIONS] = {
525, // x location of where to draw weapon ammo count
908
};
int Weapon_primary_ammo_x[GR_NUM_RESOLUTIONS] = {
525, // x location of where to draw primary weapon ammo count
908
};
int Weapon_secondary_reload_x[GR_NUM_RESOLUTIONS] = {
615, // x location of where to draw the weapon reload time
998
};
char *Weapon_gauge_fnames[GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] =
char *Weapon_gauge_fnames[NUM_HUD_SETTINGS][GR_NUM_RESOLUTIONS][NUM_WEAPON_GAUGES] =
{
//XSTR:OFF
{ // GR_640
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
},
{ // GR_1024
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
{ // normal HUD
{ // GR_640
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
},
{ // GR_1024
"weapons1",
"weapons2",
"weapons3",
"weapons4",
"weapons5"
}
},
{ // ballistic HUD - slightly different alignment
{ // GR_640
"weapons1_b",
"weapons2_b",
"weapons3_b",
"weapons4_b",
"weapons5_b"
},
{ // GR_1024
"weapons1_b",
"weapons2_b",
"weapons3_b",
"weapons4_b",
"weapons5_b"
}
}
//XSTR:ON
};
@@ -632,7 +758,7 @@ int hud_target_invalid_awacs(object *objp)
// if objp is ship object, first check if can be targeted with team info
if (objp->type == OBJ_SHIP) {
if (Player_ship != NULL) {
if (ship_is_visible_by_team(objp->instance, Player_ship->team)) {
if (ship_is_visible_by_team_new(objp, Player_ship)) {
return 0;
}
}
@@ -924,8 +1050,8 @@ object *hud_reticle_pick_target()
return return_objp;
}
// hud_target_hotkey_add_remove takes as it's parameter which hotkey (1-0) to add/remove the current
// target from. This functio behaves like the Shift-<selection> does in Windows -- using shift # will toggle
// hud_target_hotkey_add_remove takes as its parameter which hotkey (1-0) to add/remove the current
// target from. This function behaves like the Shift-<selection> does in Windows -- using shift # will toggle
// the current target in and out of the selection set.
void hud_target_hotkey_add_remove( int k, object *ctarget, int how_to_add )
{
@@ -1154,7 +1280,7 @@ void hud_keyed_targets_clear()
// Init data used for the weapons display on the HUD
void hud_weapons_init()
{
int i;
int i, j, k, hud_index, gauge_index, hud_warned;
Weapon_flash_info.is_bright = 0;
for ( i = 0; i < MAX_WEAPON_FLASH_LINES; i++ ) {
@@ -1162,13 +1288,71 @@ void hud_weapons_init()
Weapon_flash_info.flash_next[i] = 1;
}
if ( !Weapon_gauges_loaded ) {
for ( i = 0; i < NUM_WEAPON_GAUGES; i++ ) {
Weapon_gauges[i].first_frame = bm_load_animation(Weapon_gauge_fnames[gr_screen.res][i], &Weapon_gauges[i].num_frames);
if ( Weapon_gauges[i].first_frame < 0 ) {
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[gr_screen.res][i]);
if ( !Weapon_gauges_loaded )
{
hud_warned = 0;
for (hud_index = 0; hud_index < NUM_HUD_SETTINGS; hud_index++)
{
for ( gauge_index = 0; gauge_index < NUM_WEAPON_GAUGES; gauge_index++ )
{
Weapon_gauges[hud_index][gauge_index].first_frame = bm_load_animation(Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index], &Weapon_gauges[hud_index][gauge_index].num_frames);
// file not found?
if ( Weapon_gauges[hud_index][gauge_index].first_frame < 0 )
{
// if this is the ballistic hud setting, load the conventional ani
if (hud_index)
{
// give a single warning
if (!hud_warned)
{
// commented because it gets annoying, and the warning really isn't needed anyway - Goober5000
//Warning(LOCATION, "Warning: Ballistic HUD graphics not found. Defaulting to original graphics.\n");
hud_warned = 1;
}
Weapon_gauges[hud_index][gauge_index].first_frame = bm_load_animation(Weapon_gauge_fnames[0][gr_screen.res][gauge_index], &Weapon_gauges[hud_index][gauge_index].num_frames);
// and test again
if ( Weapon_gauges[hud_index][gauge_index].first_frame < 0 )
{
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index]);
}
}
// otherwise, display the regular warning
else
{
Warning(LOCATION,"Cannot load hud ani: %s\n",Weapon_gauge_fnames[hud_index][gr_screen.res][gauge_index]);
}
}
}
}
// reset the old coordinates if hud_warned
if (hud_warned)
{
// don't reset the first one, but reset all others
for (hud_index = 1; hud_index < NUM_HUD_SETTINGS; hud_index++)
{
for (i = 0; i < GR_NUM_RESOLUTIONS; i++)
{
for (k = 0; k < 2; k++)
{
for (j = 0; j < 3; j++)
{
Weapon_gauge_primary_coords[hud_index][i][j][k] = Weapon_gauge_primary_coords[0][i][j][k];
}
for (j = 0; j < 5; j++)
{
Weapon_gauge_secondary_coords[hud_index][i][j][k] = Weapon_gauge_secondary_coords[0][i][j][k];
}
Weapon_title_coords[hud_index][i][k] = Weapon_title_coords[0][i][k];
}
}
}
}
Weapon_gauges_loaded = 1;
}
}
@@ -1188,6 +1372,19 @@ void hud_init_targeting()
{
Assert(Player_ai != NULL);
int i;
// decide whether to realign HUD for ballistic primaries
ballistic_hud_index = 0;
for (i = 0; i < Player_ship->weapons.num_primary_banks; i++)
{
if (Weapon_info[Player_ship->weapons.primary_bank_weapons[i]].wi_flags2 & WIF2_BALLISTIC)
{
ballistic_hud_index = 1;
break;
}
}
// make sure there is no current target
set_target_objnum( Player_ai, -1 );
Player_ai->last_target = -1;
@@ -1253,8 +1450,6 @@ void hud_init_targeting()
} else {
Toggle_text_alpha = 160;
}
}
// Target the next or previous subobject on the currently selected ship, based on next_flag.
@@ -3185,7 +3380,7 @@ void hud_show_remote_detonate_missile()
}
}
// routine to possibly draw a bouding box around a ship sending a message to the player
// routine to possibly draw a bounding box around a ship sending a message to the player
void hud_show_message_sender()
{
object *targetp;
@@ -3811,18 +4006,28 @@ int hud_get_best_primary_bank(float *range)
num_to_test = min(1, swp->num_primary_banks);
}
for ( i = 0; i < num_to_test; i++ ) {
bank_to_fire = (swp->current_primary_bank+i)%2; // Max supported banks is 2
for ( i = 0; i < num_to_test; i++ )
{
bank_to_fire = (swp->current_primary_bank+i)%MAX_SUPPORTED_PRIMARY_BANKS; // Max supported banks is 2
// calculate the range of the weapon, and only display the lead target indicator when
// calculate the range of the weapon, and only display the lead target indicator
// if the weapon can actually hit the target
Assert(bank_to_fire >= 0);
Assert(swp->primary_bank_weapons[bank_to_fire] >= 0);
wip = &Weapon_info[swp->primary_bank_weapons[bank_to_fire]];
weapon_range = wip->max_speed * wip->lifetime;
if ( weapon_range > farthest_weapon_range ) {
// don't consider this primary if it's a ballistic that's out of ammo - Goober5000
if ( wip->wi_flags2 & WIF2_BALLISTIC )
{
if ( swp->primary_bank_ammo[bank_to_fire] <= 0)
{
continue;
}
}
if ( weapon_range > farthest_weapon_range )
{
best_bank = bank_to_fire;
farthest_weapon_range = weapon_range;
}
@@ -3912,6 +4117,7 @@ void hud_show_lead_indicator(vector *target_world_pos)
polymodel *po;
ship_weapon *swp;
weapon_info *wip;
weapon_info *tmp=NULL;
float dist_to_target, time_to_target, target_moved_dist, prange, srange;
int bank_to_fire, indicator_frame, frame_offset;
@@ -3971,18 +4177,50 @@ void hud_show_lead_indicator(vector *target_world_pos)
srange = ship_get_secondary_weapon_range(Player_ship);
if ( swp->current_secondary_bank >= 0 ) {
weapon_info *wip;
if ( swp->current_secondary_bank >= 0 )
{
int bank = swp->current_secondary_bank;
wip = &Weapon_info[swp->secondary_bank_weapons[bank]];
if ( wip->wi_flags & WIF_HOMING_ASPECT ) {
if ( !Player->target_in_lock_cone ) {
tmp = &Weapon_info[swp->secondary_bank_weapons[bank]];
if ( tmp->wi_flags & WIF_HOMING_ASPECT )
{
if ( !Player->target_in_lock_cone )
{
srange = -1.0f;
}
}
}
frame_offset=hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
frame_offset = hudtarget_lead_indicator_pick_frame(prange, srange, dist_to_target);
/* Commented out by Goober5000, because it's a bit buggy. The original Volition code
// is A-1 SUPAR and ought to work for dumbfires as well. O_o
--------------- Phreak's Non-Working Code (TM) ------------
if (dist_to_target < prange)
{
frame_offset=2;
if (tmp)
{
if ((dist_to_target < srange) && (tmp->wi_flags & WIF_HOMING_HEAT))
{
frame_offset=1;
}
}
}
else
{
frame_offset=-1;
if (tmp)
{
if((dist_to_target < srange) && (tmp->wi_flags & WIF_HOMING_HEAT))
{
frame_offset=0; // and this probably should be 2 - Goober5000
}
}
}
----------------------------------------------------------- */
if ( frame_offset < 0 ) {
return;
}
@@ -4027,6 +4265,66 @@ void hud_show_lead_indicator(vector *target_world_pos)
}
}
}
//do dumbfire lead indicator - color is orange (255,128,0) - bright, (192,96,0) - dim
//phreak changed 9/01/02
if(swp->current_secondary_bank>=0)
{
int bank=swp->current_secondary_bank;
wip=&Weapon_info[swp->secondary_bank_weapons[bank]];
//get out of here if the secondary weapon is a homer or if its out of range
if ( (wip->wi_flags & WIF_HOMING_HEAT) || (wip->wi_flags & WIF_HOMING_ASPECT))
return;
double max_dist=wip->lifetime*wip->max_speed;
if (dist_to_target > max_dist)
return;
}
//give it the "in secondary range frame
indicator_frame = Lead_indicator_gauge.first_frame;
Assert(wip->max_speed != 0);
time_to_target = dist_to_target / wip->max_speed;
target_moved_dist = targetp->phys_info.speed * time_to_target;
target_moving_direction = targetp->phys_info.vel;
// if we've reached here, the lead target indicator will be displayed
Players[Player_num].lead_indicator_active = 1;
// test if the target is moving at all
if ( vm_vec_mag_quick(&targetp->phys_info.vel) < 0.1f) // Find distance!
Players[Player_num].lead_target_pos = *target_world_pos;
else {
vm_vec_normalize(&target_moving_direction);
vm_vec_scale(&target_moving_direction,target_moved_dist);
vm_vec_add(&Players[Player_num].lead_target_pos, target_world_pos, &target_moving_direction );
polish_predicted_target_pos(target_world_pos, &Players[Player_num].lead_target_pos, dist_to_target, &last_delta_vector, 1); // Not used:, float time_to_enemy)
}
g3_rotate_vertex(&lead_target_vertex,&Players[Player_num].lead_target_pos);
if (lead_target_vertex.codes == 0) { // on screen
g3_project_vertex(&lead_target_vertex);
if (!(lead_target_vertex.flags & PF_OVERFLOW)) {
if ( hud_gauge_maybe_flash(HUD_LEAD_INDICATOR) == 1 ) {
hud_set_iff_color(targetp, 0);
} else {
hud_set_iff_color(targetp, 1);
}
if ( indicator_frame >= 0 ) {
GR_AABITMAP(indicator_frame, fl2i(lead_target_vertex.sx - Lead_indicator_half[gr_screen.res][0]), fl2i(lead_target_vertex.sy - Lead_indicator_half[gr_screen.res][1]));
}
}
}
}
// hud_cease_subsystem_targeting() will cease targeting the current targets subsystems
@@ -4529,16 +4827,26 @@ void hud_show_weapon_energy_gauge()
float percent_left;
int clip_h, i, w, h;
if ( Energy_bar_gauges.first_frame == -1 ){
if ( Energy_bar_gauges.first_frame == -1 )
{
return;
}
if ( Player_ship->weapons.num_primary_banks <= 0 ){
if ( Player_ship->weapons.num_primary_banks <= 0 )
{
return;
}
// also leave if no energy can be stored for weapons
if (Objects[Player_ship->objnum].flags & OF_NO_LASERS)
{
return;
}
percent_left = Player_ship->weapon_energy/Ship_info[Player_ship->ship_info_index].max_weapon_reserve;
if ( percent_left > 1 ) {
if ( percent_left > 1 )
{
percent_left = 1.0f;
}
@@ -4553,9 +4861,12 @@ void hud_show_weapon_energy_gauge()
}
hud_set_gauge_color(HUD_WEAPONS_ENERGY);
for ( i = 0; i < Player_ship->weapons.num_primary_banks; i++ ) {
if ( !timestamp_elapsed(Weapon_flash_info.flash_duration[i]) ) {
if ( Weapon_flash_info.is_bright & (1<<i) ) {
for ( i = 0; i < Player_ship->weapons.num_primary_banks; i++ )
{
if ( !timestamp_elapsed(Weapon_flash_info.flash_duration[i]) )
{
if ( Weapon_flash_info.is_bright & (1<<i) )
{
// hud_set_bright_color();
hud_set_gauge_color(HUD_WEAPONS_ENERGY, HUD_C_BRIGHT);
break;
@@ -4620,7 +4931,7 @@ void hud_show_target_triangle_indicator(vertex *projected_v)
}
}
// called from hud_show_weapons() to plot out the secondary weapon name and amo
// called from hud_show_weapons() to plot out the secondary weapon name and ammo
void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
{
char ammo_str[32];
@@ -4644,7 +4955,7 @@ void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
strcpy(weapon_name, wip->name);
}
hud_end_string_at_first_hash_symbol(weapon_name);
end_string_at_first_hash_symbol(weapon_name);
if ( sw->current_secondary_bank == i ) {
emp_hud_printf(Weapon_sunlinked_x[gr_screen.res], Weapon_secondary_y[gr_screen.res][i] - np*12, EG_NULL, "%c", Lcl_special_chars + 2);
@@ -4676,6 +4987,29 @@ void hud_show_secondary_weapon(int count, ship_weapon *sw, int dual_fire)
}
}
// called from hud_show_weapons() to plot out the primary weapon ammo - Goober5000
void hud_show_primary_weapon_ammo(int count, ship_weapon *sw)
{
char ammo_str[32];
int i, w, h;
for ( i = 0; i < count; i++ )
{
// for all ballistic weapons
if (Weapon_info[sw->primary_bank_weapons[i]].wi_flags2 & WIF2_BALLISTIC)
{
// print out the ammo right justified
sprintf(ammo_str, "%d", sw->primary_bank_ammo[i]);
hud_num_make_mono(ammo_str);
gr_get_string_size(&w, &h, ammo_str);
emp_hud_string(Weapon_primary_ammo_x[gr_screen.res] - w, Weapon_primary_y[gr_screen.res][i], EG_NULL, ammo_str);
hud_set_gauge_color(HUD_WEAPONS_GAUGE);
}
}
}
// start the weapon line (on the HUD) flashing
void hud_start_flash_weapon(int index)
{
@@ -4750,6 +5084,8 @@ void hud_show_cmeasure_gague()
void hud_show_weapons()
{
ship_weapon *sw;
int ship_is_ballistic;
int np, ns; // np == num primary, ns == num secondary
char name[NAME_LENGTH];
@@ -4760,6 +5096,7 @@ void hud_show_weapons()
Assert(Player_obj->instance >= 0 && Player_obj->instance < MAX_SHIPS);
sw = &Ships[Player_obj->instance].weapons;
ship_is_ballistic = (Ship_info[Ships[Player_obj->instance].ship_info_index].flags & SIF_BALLISTIC_PRIMARIES);
np = sw->num_primary_banks;
ns = sw->num_secondary_banks;
@@ -4772,14 +5109,14 @@ void hud_show_weapons()
hud_set_gauge_color(HUD_WEAPONS_GAUGE);
// draw top of primary display
GR_AABITMAP(Weapon_gauges[0].first_frame, Weapon_gauge_primary_coords[gr_screen.res][0][0], Weapon_gauge_primary_coords[gr_screen.res][0][1]);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][0].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][0][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][0][1]);
emp_hud_string(Weapon_title_coords[gr_screen.res][0], Weapon_title_coords[gr_screen.res][1], EG_WEAPON_TITLE, XSTR( "weapons", 328));
emp_hud_string(Weapon_title_coords[ballistic_hud_index][gr_screen.res][0], Weapon_title_coords[ballistic_hud_index][gr_screen.res][1], EG_WEAPON_TITLE, XSTR( "weapons", 328));
switch ( np ) {
case 0:
// draw bottom of border
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
emp_hud_string(Weapon_pname_coords[gr_screen.res][0][0], Weapon_pname_coords[gr_screen.res][0][1], EG_WEAPON_P1, XSTR( "<none>", 329));
@@ -4788,7 +5125,7 @@ void hud_show_weapons()
case 1:
// draw bottom of border
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
strcpy(name, Weapon_info[sw->primary_bank_weapons[0]].name);
if (Lcl_gr) {
@@ -4805,14 +5142,20 @@ void hud_show_weapons()
emp_hud_printf(Weapon_plink_coords[gr_screen.res][0][0], Weapon_plink_coords[gr_screen.res][0][1], EG_NULL, "%c", Lcl_special_chars + 2);
emp_hud_printf(Weapon_pname_coords[gr_screen.res][0][0], Weapon_pname_coords[gr_screen.res][0][1], EG_WEAPON_P2, "%s", name);
// check ballistic - Goober5000
if (ship_is_ballistic)
{
hud_show_primary_weapon_ammo(1, sw);
}
break;
case 2:
// draw border to accomodate second primary weapon
GR_AABITMAP(Weapon_gauges[1].first_frame, Weapon_gauge_primary_coords[gr_screen.res][1][0], Weapon_gauge_primary_coords[gr_screen.res][1][1]);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][1].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][1][1]);
// draw bottom of border
GR_AABITMAP(Weapon_gauges[2].first_frame, Weapon_gauge_primary_coords[gr_screen.res][2][0], Weapon_gauge_primary_coords[gr_screen.res][2][1]);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][2].first_frame, Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_primary_coords[ballistic_hud_index][gr_screen.res][2][1]);
strcpy(name, Weapon_info[sw->primary_bank_weapons[0]].name);
if (Lcl_gr) {
@@ -4847,6 +5190,13 @@ void hud_show_weapons()
}
emp_hud_printf(Weapon_pname_coords[gr_screen.res][1][0], Weapon_pname_coords[gr_screen.res][1][1], EG_WEAPON_P2, "%s", name);
np = 0;
// check ballistic - Goober5000
if (ship_is_ballistic)
{
hud_show_primary_weapon_ammo(2, sw);
}
break;
default:
@@ -4860,37 +5210,37 @@ void hud_show_weapons()
switch ( ns ) {
case 0:
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][0][0], Weapon_gauge_secondary_coords[gr_screen.res][0][1] - 12*np - 1);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][0][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][0][1] - 12*np - 1);
emp_hud_string(Weapon_pname_coords[gr_screen.res][0][0], Weapon_secondary_y[gr_screen.res][0] - np*12, EG_WEAPON_S1, XSTR( "<none>", 329));
break;
case 1:
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][1][0], Weapon_gauge_secondary_coords[gr_screen.res][1][1] - 12*np - 1);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][1][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][1][1] - 12*np - 1);
hud_show_secondary_weapon(1, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
break;
case 2:
// draw the middle border, only present when there are 2 or more secondaries
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][2][0], Weapon_gauge_secondary_coords[gr_screen.res][2][1] - np*12);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][1] - np*12);
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][3][0], Weapon_gauge_secondary_coords[gr_screen.res][3][1] - 12*np);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][1] - 12*np);
hud_show_secondary_weapon(2, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
break;
case 3:
// draw the middle border, only present when there are 2 or more secondaries
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][2][0], Weapon_gauge_secondary_coords[gr_screen.res][2][1] - np*12);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][2][1] - np*12);
// draw the bottm border, only present when there are 3 secondaries
GR_AABITMAP(Weapon_gauges[3].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][3][0], Weapon_gauge_secondary_coords[gr_screen.res][3][1] - np*12);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][3].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][3][1] - np*12);
// draw the bottom of the secondary weapons
GR_AABITMAP(Weapon_gauges[4].first_frame, Weapon_gauge_secondary_coords[gr_screen.res][4][0], Weapon_gauge_secondary_coords[gr_screen.res][4][1] - 12*np);
GR_AABITMAP(Weapon_gauges[ballistic_hud_index][4].first_frame, Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][4][0], Weapon_gauge_secondary_coords[ballistic_hud_index][gr_screen.res][4][1] - 12*np);
hud_show_secondary_weapon(3, sw, Player_ship->flags & SF_SECONDARY_DUAL_FIRE);
break;
@@ -5147,6 +5497,10 @@ void hud_show_auto_icons()
if ( Toggle_gauge.first_frame == -1 )
return;
// don't draw auto icons if we have primitive sensors - Goober5000
if (Player_ship->flags2 & SF2_PRIMITIVE_SENSORS)
return;
// display auto target icon
if ( hud_gauge_active(HUD_AUTO_TARGET) ) {
show_flag=1;
@@ -5574,7 +5928,7 @@ void hudtarget_page_in()
int i;
for ( i = 0; i < NUM_WEAPON_GAUGES; i++ ) {
bm_page_in_aabitmap( Weapon_gauges[i].first_frame, Weapon_gauges[i].num_frames);
bm_page_in_aabitmap( Weapon_gauges[ballistic_hud_index][i].first_frame, Weapon_gauges[ballistic_hud_index][i].num_frames);
}
bm_page_in_aabitmap( Lead_indicator_gauge.first_frame, Lead_indicator_gauge.num_frames);
bm_page_in_aabitmap( Energy_bar_gauges.first_frame, Energy_bar_gauges.num_frames);
+95 -28
View File
@@ -9,18 +9,64 @@
/*
* $Logfile: /Freespace2/code/Hud/HUDtargetbox.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 16:50:44 $
* $Author: phreak $
* $Revision: 2.13 $
* $Date: 2003-01-27 07:46:33 $
* $Author: Goober5000 $
*
* C module for drawing the target monitor box on the HUD
*
* $Log: not supported by cvs2svn $
* Revision 2.12 2003/01/17 07:59:09 Goober5000
* fixed some really strange behavior with strings not being truncated at the
* # symbol
* --Goober5000
*
* Revision 2.21 2002/08/04 23:17:40 PhReAk
* Revision 2.11 2003/01/17 01:48:50 Goober5000
* 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
*
* Revision 2.10 2003/01/15 20:49:10 Goober5000
* did the XSTR for the turret thing
* --Goober5000
*
* Revision 2.9 2003/01/15 16:52:27 Goober5000
* oops, that'll introduce a bug - naming it just plain "Turret" instead
* --Goober5000
*
* Revision 2.8 2003/01/15 16:48:59 Goober5000
* capship ballistic weapon displays "Cannon" on HUD instead of "Laser Turret"
* --Goober5000
*
* Revision 2.7 2003/01/15 07:09:09 Goober5000
* changed most references to modelnum to use ship instead of ship_info --
* this will help with the change-model sexp and any other instances of model
* changing
* --Goober5000
*
* Revision 2.6 2002/12/14 17:09:28 Goober5000
* 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
*
* Revision 2.5 2002/12/14 01:55:04 Goober5000
* added mission flag to show subsystem damage for fighterbays
* ~Goober5000~
*
* Revision 2.4 2002/10/22 23:02:40 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.3 2002/09/20 20:01:30 phreak
* extra effects during cargo scan
*
* Revision 2.2 2002/08/06 16:50:44 phreak
* added wireframe targetbox feature
*
* Revision 2.2 2002/08/04 23:17:40 phreak
* Did the toggling code for wireframes -> CTRL+SHIFT+Q
*
* Revision 2.2 2002/08/04 21:53:13 PhReAk
* Revision 2.2 2002/08/04 21:53:13 phreak
* Changed hud_render_target_asteroid, ...weapon, ...ship to render in wireframe
*
* Revision 2.1 2002/08/01 01:41:06 penguin
@@ -238,6 +284,7 @@
#include "network/multi.h"
#include "weapon/emp.h"
#include "localization/localize.h"
#include "cmdline/cmdline.h"
int Target_window_coords[GR_NUM_RESOLUTIONS][4] =
{
@@ -908,13 +955,21 @@ void get_turret_subsys_name(model_subsystem *system_info, char *outstr)
} else {
if (Weapon_info[system_info->turret_weapon_type].subtype == WP_LASER) {
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
// ballistic too! - Goober5000
if (Weapon_info[system_info->turret_weapon_type].wi_flags2 & WIF2_BALLISTIC)
{
sprintf(outstr, "%s", XSTR("Turret", 1487));
}
else
{
sprintf(outstr, "%s", XSTR("Laser turret", 1568));
}
} else if (Weapon_info[system_info->turret_weapon_type].subtype == WP_MISSILE) {
sprintf(outstr, "%s", XSTR("Missile lnchr", 1569));
} else {
// Illegal subtype
Int3();
sprintf(outstr, "%s", NOX("Turret"));
sprintf(outstr, "%s", XSTR("Turret", 1487));
}
}
} else {
@@ -974,10 +1029,7 @@ void hud_render_target_ship_info(object *target_objp)
mission_parse_lookup_alt_index(target_shipp->alt_type_index, temp_name);
} else {
strcpy(temp_name, Ship_info[base_index].name);
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
strcpy(temp_name, Ship_info[base_index].name);
hud_end_string_at_first_hash_symbol(temp_name);
}
end_string_at_first_hash_symbol(temp_name);
}
if (Lcl_gr) {
@@ -1045,7 +1097,10 @@ void hud_render_target_ship_info(object *target_objp)
// AL 23-3-98: Fighter bays are a special case. Player cannot destroy them, so don't
// show the subsystem strength
if ( strnicmp(NOX("fighter"), Player_ai->targeted_subsys->system_info->name, 7) ) {
// Goober5000: don't display any strength if we can't destroy this subsystem - but sometimes
// fighterbays can be destroyed
if ( ship_subsys_takes_damage(Player_ai->targeted_subsys) )
{
sprintf(outstr,XSTR( "%d%%", 341),screen_integrity);
gr_get_string_size(&w,&h,outstr);
gr_printf(Target_window_coords[gr_screen.res][0]+Target_window_coords[gr_screen.res][2]-w-1, Target_window_coords[gr_screen.res][1]+Target_window_coords[gr_screen.res][3] - h, "%s", outstr);
@@ -1208,12 +1263,26 @@ void hud_maybe_render_cargo_scan(ship_info *target_sip)
gr_line(x1, y1, x2, y1);
// RT Changed this to be optional
if(Cmdline_phreak) {
// added 2nd horizontal scan line - phreak
y1 = fl2i(Cargo_scan_coords[gr_screen.res][1] + Cargo_scan_coords[gr_screen.res][3] - ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][3] ));
gr_line(x1, y1, x2, y1);
}
// draw vertical scan line
x1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][0] + ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][2] ));
y1 = Cargo_scan_coords[gr_screen.res][1];
y2 = y1 + Cargo_scan_coords[gr_screen.res][3];
gr_line(x1, y1-3, x1, y2-1);
// RT Changed this to be optional
if(Cmdline_phreak) {
// added 2nd vertical scan line - phreak
x1 = fl2i(0.5f + Cargo_scan_coords[gr_screen.res][2] + Cargo_scan_coords[gr_screen.res][0] - ( (i2fl(Player->cargo_inspect_time) / scan_time) * Cargo_scan_coords[gr_screen.res][2] ));
gr_line(x1, y1-3, x1, y2-1);
}
}
// Get the eye position for an object at the origin, called from hud_render_target_ship()
@@ -1279,7 +1348,7 @@ void hud_render_target_ship(object *target_objp)
// hud_targetbox_get_eye(&camera_eye, &camera_orient, Player_obj->instance);
hud_render_target_setup(&camera_eye, &camera_orient, target_sip->closeup_zoom);
// model_clear_instance(target_sip->modelnum);
// model_clear_instance(target_shipp->modelnum);
ship_model_start( target_objp );
if (Targetbox_wire!=0)
@@ -1316,7 +1385,7 @@ void hud_render_target_ship(object *target_objp)
if(target_sip->modelnum_hud >= 0){
model_render( target_sip->modelnum_hud, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
} else {
model_render( target_sip->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
model_render( target_shipp->modelnum, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, target_shipp->replacement_textures);
}
ship_model_stop( target_objp );
@@ -1352,6 +1421,8 @@ void hud_render_target_ship(object *target_objp)
hud_blit_target_foreground();
hud_blit_target_integrity(0,OBJ_INDEX(target_objp));
hud_set_gauge_color(HUD_TARGET_MONITOR);
hud_render_target_ship_info(target_objp);
hud_maybe_render_cargo_scan(target_sip);
}
@@ -1377,7 +1448,6 @@ void hud_render_target_debris(object *target_objp)
//target_sip = &Ship_info[debrisp->ship_info_index];
target_team = obj_team(target_objp);
if ( Detail.targetview_model ) {
// take the forward orientation to be the vector from the player to the current target
vm_vec_sub(&orient_vec, &target_objp->pos, &Player_obj->pos);
@@ -1402,6 +1472,8 @@ void hud_render_target_debris(object *target_objp)
}
hud_render_target_setup(&camera_eye, &camera_orient, 0.5f);
model_clear_instance(debrisp->model_num);
// This calls the colour that doesnt get reset
submodel_render( debrisp->model_num, debrisp->submodel_num, &target_objp->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL );
hud_render_target_close();
}
@@ -1409,8 +1481,6 @@ void hud_render_target_debris(object *target_objp)
HUD_reset_clip();
hud_blit_target_foreground();
hud_blit_target_integrity(1);
// hud_set_default_color();
hud_set_gauge_color(HUD_TARGET_MONITOR);
// take ship "copies" into account before printing out ship class information
base_index = debrisp->ship_info_index;
@@ -1418,13 +1488,9 @@ void hud_render_target_debris(object *target_objp)
base_index = ship_info_base_lookup( debrisp->ship_info_index );
// print out ship class that debris came from
char *printable_ship_class = Ship_info[base_index].name;
if ( strstr(Ship_info[base_index].name, NOX("#")) ) {
char temp_name[NAME_LENGTH];
strcpy(temp_name, Ship_info[base_index].name);
hud_end_string_at_first_hash_symbol(temp_name);
printable_ship_class = temp_name;
}
char printable_ship_class[NAME_LENGTH];
strcpy(printable_ship_class, Ship_info[base_index].name);
end_string_at_first_hash_symbol(printable_ship_class);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_CLASS][0], Targetbox_coords[gr_screen.res][TBOX_CLASS][1], EG_TBOX_CLASS, printable_ship_class);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, XSTR( "debris", 348));
@@ -1444,6 +1510,7 @@ void hud_render_target_weapon(object *target_objp)
weapon_info *target_wip = NULL;
weapon *wp = NULL;
object *viewer_obj, *viewed_obj;
int *replacement_textures = NULL;
int target_team, is_homing, is_player_missile, missile_view, viewed_model_num, w, h;
float factor;
char outstr[100]; // temp buffer
@@ -1474,6 +1541,7 @@ void hud_render_target_weapon(object *target_objp)
viewed_obj = wp->homing_object;
missile_view = TRUE;
viewed_model_num = Ships[wp->homing_object->instance].modelnum;
replacement_textures = Ships[wp->homing_object->instance].replacement_textures;
}
if (Targetbox_wire!=0)
@@ -1521,7 +1589,7 @@ void hud_render_target_weapon(object *target_objp)
hud_render_target_setup(&camera_eye, &camera_orient, View_zoom/3);
model_clear_instance(viewed_model_num);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER);
model_render( viewed_model_num, &viewed_obj->orient, &obj_pos, flags | MR_NO_LIGHTING | MR_LOCK_DETAIL | MR_AUTOCENTER, -1, -1, replacement_textures);
hud_render_target_close();
}
@@ -1541,9 +1609,8 @@ void hud_render_target_weapon(object *target_objp)
gr_get_string_size(&w,&h,outstr);
// drop name past the # sign
if ( strstr(outstr, NOX("#")) ) {
hud_end_string_at_first_hash_symbol(outstr);
}
end_string_at_first_hash_symbol(outstr);
emp_hud_string(Targetbox_coords[gr_screen.res][TBOX_NAME][0], Targetbox_coords[gr_screen.res][TBOX_NAME][1], EG_TBOX_NAME, outstr);
// If a homing weapon, show time to impact
+141 -10
View File
@@ -9,13 +9,39 @@
/*
* $Logfile: /Freespace2/code/Io/KeyControl.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-06 16:49:22 $
* $Author: phreak $
* $Revision: 2.9 $
* $Date: 2003-01-18 10:00:43 $
* $Author: Goober5000 $
*
* Routines to read and deal with keyboard input.
*
* $Log: not supported by cvs2svn $
* Revision 2.8 2003/01/03 21:58:08 Goober5000
* Fixed some minor bugs, and added a primitive-sensors flag, where if a ship
* has primitive sensors it can't target anything and objects don't appear
* on radar if they're outside a certain range. This range can be modified
* via the sexp primitive-sensors-set-range.
* --Goober5000
*
* Revision 2.7 2002/12/31 18:59:43 Goober5000
* if it ain't broke, don't fix it
* --Goober5000
*
* Revision 2.5 2002/12/10 05:43:34 Goober5000
* Full-fledged ballistic primary support added! Try it and see! :)
*
* Revision 2.4 2002/10/19 03:50:29 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.3 2002/10/17 20:40:51 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.2 2002/08/06 16:49:22 phreak
* added keybing for wireframe hud,
* fixed previous missile cheat
*
*
* Revision 2.2 2002/08/04 23:15:40 PhReAk
* Fixed previous missile cheat, commented out beam_test(x) lines
@@ -357,6 +383,7 @@
#include "mission/missionmessage.h"
#include "menuui/mainhallmenu.h"
#include "ship/aigoals.h"
#include "missionui/missionpause.h"
// --------------------------------------------------------------
// Global to file
@@ -520,7 +547,9 @@ int Normal_key_set[] = {
TOGGLE_HUD_CONTRAST,
MULTI_TOGGLE_NETINFO,
MULTI_SELF_DESTRUCT
MULTI_SELF_DESTRUCT,
TOGGLE_HUD
};
int Dead_key_set[] = {
@@ -644,7 +673,9 @@ int Non_critical_key_set[] = {
TOGGLE_HUD_CONTRAST,
MULTI_TOGGLE_NETINFO,
MULTI_SELF_DESTRUCT
MULTI_SELF_DESTRUCT,
TOGGLE_HUD
};
@@ -746,9 +777,32 @@ void debug_max_secondary_weapons(object *objp)
int index;
ship *shipp = &Ships[objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
ship_weapon *swp = &shipp->weapons;
for ( index = 0; index < MAX_SECONDARY_BANKS; index++ ) {
shipp->weapons.secondary_bank_ammo[index] = sip->secondary_bank_ammo_capacity[index];
for ( index = 0; index < MAX_SECONDARY_BANKS; index++ )
{
swp->secondary_bank_ammo[index] = sip->secondary_bank_ammo_capacity[index];
}
}
void debug_max_primary_weapons(object *objp) // Goober5000
{
int index;
ship *shipp = &Ships[objp->instance];
ship_info *sip = &Ship_info[shipp->ship_info_index];
ship_weapon *swp = &shipp->weapons;
weapon_info *wip;
if (sip->flags & SIF_BALLISTIC_PRIMARIES)
{
for ( index = 0; index < MAX_PRIMARY_BANKS; index++ )
{
wip = &Weapon_info[swp->primary_bank_weapons[index]];
if (wip->wi_flags2 & WIF2_BALLISTIC)
{
swp->primary_bank_ammo[index] = sip->primary_bank_ammo_capacity[index];
}
}
}
}
@@ -1034,12 +1088,14 @@ void process_debug_keys(int k)
HUD_sourced_printf(HUD_SOURCE_HIDDEN, XSTR( "Weapon energy and missile count will always be at full for player", 16));
debug_max_secondary_weapons(Player_obj);
debug_max_primary_weapons(Player_obj);
if (k & KEY_SHIFTED) {
object *objp;
for ( objp = GET_FIRST(&obj_used_list); objp !=END_OF_LIST(&obj_used_list); objp = GET_NEXT(objp) )
if (objp->type == OBJ_SHIP)
debug_max_secondary_weapons(objp);
debug_max_primary_weapons(objp);
}
} else
@@ -1878,9 +1934,25 @@ void game_process_keys()
gameseq_post_event( GS_EVENT_DEBUG_PAUSE_GAME );
break;
case KEY_PAUSE:
case KEY_ALTED + KEY_PAUSE:
if( Game_mode & GM_DEAD_BLEW_UP ||
Game_mode & GM_DEAD_DIED) {
break;
}
pause_set_type(PAUSE_TYPE_VIEWER);
game_process_pause_key();
break;
case KEY_PAUSE:
if( Game_mode & GM_DEAD_BLEW_UP ||
Game_mode & GM_DEAD_DIED) {
break;
}
pause_set_type(PAUSE_TYPE_NORMAL);
game_process_pause_key();
break;
} // end switch
} while (k);
@@ -2176,6 +2248,8 @@ int button_function_critical(int n, net_player *p = NULL)
// return !0 if the action is allowed, otherwise return 0
int button_allowed(int n)
{
// RT Commented this out cos it was disabling use of keys when HUD is off
#if 0
if ( hud_disabled() ) {
switch (n) {
case SHOW_GOALS:
@@ -2194,6 +2268,7 @@ int button_allowed(int n)
return 0;
}
}
#endif
return 1;
}
@@ -2291,6 +2366,7 @@ int button_function_demo_valid(int n)
}
// execute function corresponding to action n (BUTTON_ #define from KeyControl.h)
// Goober5000: function returns 1 when action was taken
int button_function(int n)
{
Assert(n >= 0);
@@ -2305,7 +2381,58 @@ int button_function(int n)
if (Game_mode & GM_DEAD_DIED){
return 0;
}
// Goober5000 - if the ship doesn't have subspace drive, jump key doesn't work: so test and exit early
if (Player_ship->flags2 & SF2_NO_SUBSPACE_DRIVE)
{
switch(n)
{
case END_MISSION:
control_used(n); // set the timestamp for when we used the control, in case we need it
return 1; // pretend we took the action: if we return 0, strange stuff may happen
}
}
// Goober5000 - if we have primitive sensors, some keys don't work: so test and exit early
if (Player_ship->flags2 & SF2_PRIMITIVE_SENSORS)
{
switch (n)
{
case MATCH_TARGET_SPEED:
case TOGGLE_AUTO_MATCH_TARGET_SPEED:
case TOGGLE_AUTO_TARGETING:
case TARGET_NEXT:
case TARGET_PREV:
case TARGET_NEXT_CLOSEST_HOSTILE:
case TARGET_PREV_CLOSEST_HOSTILE:
case TARGET_NEXT_CLOSEST_FRIENDLY:
case TARGET_PREV_CLOSEST_FRIENDLY:
case TARGET_SHIP_IN_RETICLE:
case TARGET_LAST_TRANMISSION_SENDER:
case TARGET_CLOSEST_REPAIR_SHIP:
case TARGET_CLOSEST_SHIP_ATTACKING_TARGET:
case STOP_TARGETING_SHIP:
case TARGET_CLOSEST_SHIP_ATTACKING_SELF:
case TARGET_TARGETS_TARGET:
case TARGET_SUBOBJECT_IN_RETICLE:
case TARGET_NEXT_SUBOBJECT:
case TARGET_PREV_SUBOBJECT:
case STOP_TARGETING_SUBSYSTEM:
case TARGET_NEXT_BOMB:
case TARGET_PREV_BOMB:
case TARGET_NEXT_UNINSPECTED_CARGO:
case TARGET_PREV_UNINSPECTED_CARGO:
case TARGET_NEWEST_SHIP:
case TARGET_NEXT_LIVE_TURRET:
case TARGET_PREV_LIVE_TURRET:
case TARGET_NEXT_ESCORT_SHIP:
control_used(n); // set the timestamp for when we used the control, in case we need it
return 1; // pretend we took the action: if we return 0, strange stuff may happen
}
}
// now handle keys the regular way
switch (n) {
// cycle to next primary weapon
case CYCLE_NEXT_PRIMARY:
@@ -2358,7 +2485,7 @@ int button_function(int n)
// undefined in multiplayer for clients right now
// match target speed
case MATCH_TARGET_SPEED:
case MATCH_TARGET_SPEED:
control_used(MATCH_TARGET_SPEED);
// If player is auto-matching, break auto-match speed
if ( Player->flags & PLAYER_FLAGS_AUTO_MATCH_SPEED ) {
@@ -2849,6 +2976,10 @@ int button_function(int n)
}
break;
#endif
case TOGGLE_HUD:
gamesnd_play_iface(SND_USER_SELECT);
hud_toggle_draw();
break;
// following are not handled here, but we need to bypass the Int3()
case LAUNCH_COUNTERMEASURE:
+2 -2
View File
@@ -778,8 +778,8 @@ BOOL SWFF_WriteRegString(
// close the key
RegCloseKey(hKey);
if(lRet != ERROR_SUCCESS)
return FALSE;
/* if(lRet != ERROR_SUCCESS) // eh, this is unreachable code
return FALSE;*/
// if we have reached this point, then it was a success
return TRUE;
+91 -14
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Io/Timer.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:06 $
* $Revision: 2.3 $
* $Date: 2003-03-02 05:46:28 $
* $Author: penguin $
*
* Include file for timer stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -190,11 +193,12 @@ fix timer_get_fixed_seconds()
return 0;
}
#if defined(_WIN32) && defined(_MSC_VER)
#if defined(_WIN32)
int tmp;
LARGE_INTEGER temp_large;
timer_get(&temp_large);
#if defined(_MSC_VER)
// Timing in fixed point (16.16) seconds.
// Can be used for up to 1000 hours
_asm mov edx, temp_large.HighPart
@@ -212,9 +216,37 @@ sub_again:
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = fixed point seconds elapsed...
_asm mov tmp, eax
#elif defined(__GNUC__)
// Timing in fixed point (16.16) seconds.
// Can be used for up to 1000 hours
asm(
"mov %1, %%edx;" // temp_large.HighPart
"mov %2, %%eax;" // temp_large.LowPart
"shld $16,%%edx,%%eax;" // Keep 32+11 bits
"shl $16,%%eax;"
// edx:eax = number of 1.19Mhz pulses elapsed.
"mov %3,%%ebx;" // Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
"sub_again:"
"sub %%ebx,%%edx;" // subtract until negative...
"jns sub_again;" // ...to prevent divide overflow..."
"add %%ebx,%%edx;" // ...then add in to get correct value."
"div %%ebx;"
//eax = fixed point seconds elapsed...
"mov %%eax,%0;" // tmp
: "=g" (tmp)
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
: "edx", "eax", "ebx" );
#else
#error unknown Win32 compiler
#endif
return tmp;
#elif defined unix
@@ -247,14 +279,13 @@ int timer_get_milliseconds()
return 0;
}
#if defined(_WIN32) && defined(_MSC_VER)
#if defined(_WIN32)
int tmp;
LARGE_INTEGER temp_large;
timer_get(&temp_large);
temp_large.QuadPart *= (longlong)1000;
#if defined(_MSC_VER)
// Timing in milliseconds.
_asm mov edx, temp_large.HighPart
_asm mov eax, temp_large.LowPart
@@ -263,7 +294,6 @@ int timer_get_milliseconds()
//_asm shl eax, 16
// edx:eax = number of 1.19Mhz pulses elapsed.
_asm mov ebx, Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
sub_again:
_asm sub edx, ebx ; subtract until negative...
@@ -271,17 +301,41 @@ sub_again:
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = milliseconds elapsed...
_asm mov tmp, eax
#elif defined(__GNUC__)
// Timing in milliseconds.
asm(
"mov %1,%%edx;\n" // temp_large.HighPart
"mov %2,%%eax;\n" // temp_large.LowPart
// edx:eax = number of 1.19Mhz pulses elapsed.
"mov %3,%%ebx;\n" // Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
"sub_again2:"
"sub %%ebx,%%edx;\n" // subtract until negative...
"jns sub_again2;\n" // ...to prevent divide overflow...
"add %%ebx,%%edx;\n" // ...then add in to get correct value.
"div %%ebx;\n"
//eax = milliseconds elapsed...
"mov %%eax,%0;\n" // tmp
: "=g" (tmp)
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
: "edx", "eax", "ebx");
#else
#error unknown Win32 compiler
#endif
return tmp;
#else
#elif defined unix
timeval tmp_tv;
timer_get(&tmp_tv);
return (tmp_tv.tv_sec * 1000) + (tmp_tv.tv_usec / 1000);
#else
#error unknown architecture/compiler
#endif
}
@@ -293,14 +347,14 @@ int timer_get_microseconds()
return 0;
}
#if defined(_WIN32) && defined(_MSC_VER)
#if defined(_WIN32)
int tmp;
LARGE_INTEGER temp_large;
timer_get(&temp_large);
temp_large.QuadPart *= (longlong)1000000;
#if defined(_MSC_VER)
// Timing in milliseconds.
_asm mov edx, temp_large.HighPart
_asm mov eax, temp_large.LowPart
@@ -317,9 +371,30 @@ sub_again:
_asm add edx, ebx ; ...then add in to get correct value.
_asm div ebx
//eax = milliseconds elapsed...
_asm mov tmp, eax
#elif defined(__GNUC__)
// Timing in milliseconds.
asm(
"mov %1,%%edx;\n" // temp_large.HighPart
"mov %2,%%eax;\n" // temp_large.LowPart
// edx:eax = number of 1.19Mhz pulses elapsed.
"mov %3,%%ebx;\n" // Timer_freq
// Make sure we won't divide overflow. Make time wrap at about 9 hours
"sub_again3:"
"sub %%ebx,%%edx;\n" // subtract until negative...
"jns sub_again3;\n" // ...to prevent divide overflow...
"add %%ebx,%%edx;\n" // ...then add in to get correct value.
"div %%ebx;\n"
//eax = milliseconds elapsed...
"mov %%eax,%0;\n" // tmp
: "=g" (tmp)
: "g" (temp_large.HighPart), "g" (temp_large.LowPart), "g" (Timer_freq)
: "edx", "eax", "ebx");
#else
#error unknown Win32 compiler
#endif
return tmp;
#elif defined unix
@@ -328,6 +403,8 @@ sub_again:
timer_get(&tmp_tv);
return (tmp_tv.tv_sec * 1000000) + tmp_tv.tv_usec;
#else
#error unknown architecture/compiler
#endif
}
+7 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/JumpNode/JumpNode.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-12-17 01:56:36 $
* $Author: DTP $
*
* Header for everything to do with jump nodes
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -41,7 +44,7 @@
#include "parse/parselo.h"
#define MAX_JUMP_NODES 3
#define MAX_JUMP_NODES 50
typedef struct {
int modelnum;
+21 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Math/Fvi.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-12-07 01:37:41 $
* $Author: bobboau $
*
* Routines to find intersections of various 3d things.
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -204,6 +207,21 @@ void fvi_two_lines_in_3space(vector *p1, vector *v1, vector *p2, vector *v2, flo
}
}
//tells distance from a plain to a point-Bobboau
float fvi_point_dist_plane( vector *plane_pnt, vector *plane_norm, // Plane description, a point and a normal
vector *point //a point to test
)
{
float dist,D;
D = -vm_vec_dot(plane_norm,plane_pnt);
dist = vm_vec_dot(plane_norm, point) + D;
return dist;
}
//--------------------------------------------------------------------
// fvi_ray_plane - Finds the point on the specified plane where the
+9 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Math/Fvi.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-12-07 01:37:41 $
* $Author: bobboau $
*
* Prototypes for fvi stuff
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -81,6 +84,9 @@
#include "globalincs/pstypes.h"
//finds distance from point to plane
float fvi_point_dist_plane( vector *plane_pnt,vector *plane_norm, vector *point);
// fvi functions - fvi stands for Find Vector Intersection
// fvi_a_b - means find the intersection of something of type a with something of type b
// type can be:
+66 -3
View File
@@ -9,13 +9,28 @@
/*
* $Logfile: /Freespace2/code/Math/VecMat.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Revision: 2.4 $
* $Date: 2003-03-02 07:39:34 $
* $Author: penguin $
*
* C module containg functions for manipulating vectors and matricies
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2003/02/25 06:22:48 bobboau
* 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
*
* Revision 2.2 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.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -392,6 +407,41 @@ void vm_vec_sub2(vector *dest,vector *src)
}
#endif
void vm_vert2vec(vertex *vert, vector *vec) //takes a vertex and makes it into a vector-Bobboau
{
vec->xyz.x = vert->x;
vec->xyz.y = vert->y;
vec->xyz.z = vert->z;
}
void vm_vec2vert(vector *vec, vertex *vert) //takes a vector and makes it into a vertex-Bobboau
{
vert->x = vec->xyz.x;
vert->y = vec->xyz.y;
vert->z = vec->xyz.z;
}
//averages n vectors. returns ptr to dest
//dest can equal either source
vector *vm_vec_avg_n(vector *dest, int n, vector src[])
{
float x=0,y=0,z=0;
for(int i = 0; i<n; i++){
x += src[i].xyz.x;
y += src[i].xyz.y;
z += src[i].xyz.z;
}
dest->xyz.x = x / n;
dest->xyz.y = y / n;
dest->xyz.z = z / n;
return dest;
}
//averages two vectors. returns ptr to dest
//dest can equal either source
vector *vm_vec_avg(vector *dest,vector *src0,vector *src1)
@@ -403,6 +453,15 @@ vector *vm_vec_avg(vector *dest,vector *src0,vector *src1)
return dest;
}
//averages four vectors. returns ptr to dest
//dest can equal any source
vector *vm_vec_avg3(vector *dest,vector *src0,vector *src1,vector *src2)
{
dest->xyz.x = (src0->xyz.x + src1->xyz.x + src2->xyz.x) * 0.333333333f;
dest->xyz.y = (src0->xyz.y + src1->xyz.y + src2->xyz.y) * 0.333333333f;
dest->xyz.z = (src0->xyz.z + src1->xyz.z + src2->xyz.z) * 0.333333333f;
return dest;
}
//averages four vectors. returns ptr to dest
//dest can equal any source
@@ -605,14 +664,18 @@ float vm_vec_dist_quick(vector *v0,vector *v1)
//normalize a vector. returns mag of source vec
float vm_vec_copy_normalize(vector *dest,vector *src)
{
static int ben_warned = false;//added this so the warning could be sounded and you can still get on with playing-Bobboau
float m;
m = vm_vec_mag(src);
// Mainly here to trap attempts to normalize a null vector.
if (m <= 0.0f) {
Warning(LOCATION, "Null vector in vector normalize.\n"
if(!ben_warned){
Warning(LOCATION, "Null vector in vector normalize.\n"
"Trace out of vecmat.cpp and find offending code.\n");
ben_warned = true;
}
dest->xyz.x = 1.0f;
dest->xyz.y = 0.0f;
dest->xyz.z = 0.0f;
+15 -3
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/Math/VecMat.h $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2002-12-07 01:37:42 $
* $Author: bobboau $
*
* Header file for functions that manipulate vectors and matricies
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -296,11 +299,16 @@ void vm_vec_sub(vector *dest,vector *src0,vector *src1);
void vm_vec_sub2(vector *dest,vector *src);
#endif
//averages n vectors
vector *vm_vec_avg_n(vector *dest, int n, vector src[]);
//averages two vectors. returns ptr to dest
//dest can equal either source
vector *vm_vec_avg(vector *dest,vector *src0,vector *src1);
vector *vm_vec_avg3(vector *dest,vector *src0,vector *src1,vector *src2);
//averages four vectors. returns ptr to dest
//dest can equal any source
vector *vm_vec_avg4(vector *dest,vector *src0,vector *src1,vector *src2,vector *src3);
@@ -651,5 +659,9 @@ void vm_vec_random_in_circle(vector *out, vector *in, matrix *orient, float radi
// returns 0 if the point is inside the line segment, -1 if "before" the line segment and 1 ir "after" the line segment
int vm_vec_dist_to_line(vector *p, vector *l0, vector *l1, vector *nearest, float *dist);
void vm_vert2vec(vertex *vert, vector *vec);
void vm_vec2vert(vector *vec, vertex *vert);
#endif
+75 -6
View File
@@ -9,13 +9,31 @@
/*
* $Logfile: /Freespace2/code/MenuUI/Credits.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.7 $
* $Date: 2002-12-03 22:14:06 $
* $Author: Goober5000 $
*
* C source file for displaying game credits
*
* $Log: not supported by cvs2svn $
* Revision 2.6 2002/11/02 22:25:26 inquisitor
* Cleaned up the presentation a little, added HLP and VW, and, no offense to Kazan, removed Kazan.
*
* Revision 2.5 2002/11/02 22:11:35 DTP
* DOH forgot \n
*
* Revision 2.4 2002/11/02 22:10:48 DTP
* shameless self promotion
*
* Revision 2.3 2002/10/05 16:46:10 randomtiger
* 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.
*
* Revision 2.2 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.1 2002/07/07 19:55:59 penguin
* Back-port to MSVC
*
@@ -172,6 +190,41 @@
#include "globalincs/alphacolors.h"
#include "localization/localize.h"
// This is the fs2_open credit list, please only add yourself if you have actually contributed code// Rules!
char *fs2_open_credit_text =
"FS2_OPEN STAFF:\n"
"\n"
"\n"
"Project leader:\n"
"Edward \"Inquisitor\" Gardner\n"
"\n"
"Programmers:\n"
"\n"
"\"Bobboau\"\n"
"Dennis \"DTP\" Pedersen\n"
"Ian \"Goober5000\" Warfield\n"
"Joe \"Righteous1\" Dowd\n"
"Mike \"penguin\" Harris\n"
"\"Mysterial\"\n"
"\"PhReAk\"\n"
"Thomas \"Random Tiger\" Whittaker\n"
"Will \"Unknown PLayer\" Rousnel\n"
"\"WMCoolmon\"\n"
"Web support:\n"
"Icefire and the staff at Volitionwatch.com\n"
"Alex \"Thunder\" Avery and the staff at Hard Light Productions\n"
"\nSpecial thanks to:\n"
"\n"
"Volition for making FS2 such a great game\n"
"Dave Baranec for giving us the code and keeping us sanity checked\n"
"\n\n\n\n";
char *unmodified_credits = "ORIGINAL VOLITION STAFF:\n\n\n";
char *mod_check = "Design:";
#define CREDITS_MUSIC_DELAY 2000
#define CREDITS_SCROLL_RATE 15.0f
#define CREDITS_ARTWORK_DISPLAY_TIME 9.0f
@@ -374,7 +427,7 @@ void credits_init()
if(fp != NULL){
int size;
size = cfilelength(fp);
Credit_text = (char *) malloc(size + 200);
Credit_text = (char *) malloc(size + 200 + strlen(fs2_open_credit_text) + strlen(unmodified_credits));
cfclose(fp);
// open localization and parse
@@ -383,9 +436,25 @@ void credits_init()
reset_parse();
// keep reading everything in
strcpy(Credit_text,"");
while(!check_for_string_raw("#end")){
strcpy(Credit_text,fs2_open_credit_text);
bool first_run = true;
while(!check_for_string_raw("#end")){
stuff_string_line(line, 511);
// This is a bit odd but it means if a total conversion uses different credits the
// Volition credit wont happen
if(first_run == true)
{
if(strcmp(line, mod_check) == 0)
{
strcat(Credit_text, unmodified_credits);
}
first_run = false;
}
linep1 = line;
do {
+11 -3
View File
@@ -9,13 +9,19 @@
/*
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.cpp $
* $Revision: 2.3 $
* $Date: 2002-08-04 05:12:10 $
* $Author: penguin $
* $Revision: 2.6 $
* $Date: 2003-01-15 21:29:04 $
* $Author: anonymous $
*
* Header file for main-hall menu code
*
* $Log: not supported by cvs2svn $
* Revision 2.5 2002/08/27 13:38:58 penguin
* Moved DirectX8 stuff to directx8 branch; reverted to previous
*
* Revision 2.3 2002/08/04 05:12:10 penguin
* Change version display location
*
* Revision 2.2 2002/08/01 01:41:06 penguin
* The big include file move
*
@@ -2033,8 +2039,10 @@ void main_hall_read_table()
stuff_string(m->bitmap, F_NAME, NULL, MAX_FILENAME_LEN);
required_string("+Mask:");
stuff_string(m->mask, F_NAME, NULL, MAX_FILENAME_LEN);
#ifndef FS2_DEMO
required_string("+Music:");
stuff_string(m->music, F_NAME, NULL, MAX_FILENAME_LEN);
#endif
// intercom sounds
required_string("+Num Intercom Sounds:");
+11 -4
View File
@@ -9,13 +9,20 @@
/*
* $Logfile: /Freespace2/code/MenuUI/MainHallMenu.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:24 $
* $Author: penguin $
* $Revision: 2.2 $
* $Date: 2003-01-15 05:19:07 $
* $Author: Goober5000 $
*
* Header file for main-hall menu code
*
* $Log: not supported by cvs2svn $
* Revision 2.1 2003/01/14 04:00:15 Goober5000
* allowed for up to 256 main halls
* --Goober5000
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:09 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -63,7 +70,7 @@
#define _MAIN_HALL_MENU_HEADER_FILE
// the # of main halls we're supporting
#define NUM_MAIN_HALLS 2
#define NUM_MAIN_HALLS 10 // Goober5000 - bumped down to 10; don't go above 256 (size of ubyte)
// initialize the main hall proper
void main_hall_init(int main_hall_num);
+11 -8
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/MenuUI/PlayerMenu.cpp $
* $Revision: 2.2 $
* $Date: 2002-08-04 05:12:42 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-01-14 04:00:15 $
* $Author: Goober5000 $
*
* Code to drive the Player Select initial screen
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/08/04 05:12:42 penguin
* Display fs2_open version instead of "Freespace 2"
*
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
@@ -342,7 +345,7 @@ int Player_select_clone_flag; // clone the currently selected pilot
char Player_select_last_pilot[CALLSIGN_LEN + 10]; // callsign of the last used pilot, or none if there wasn't one
int Player_select_last_is_multi;
int Player_select_force_bastion = 0;
int Player_select_force_main_hall = 0;
// notification text areas
@@ -408,7 +411,7 @@ void player_select_init()
// start a looping ambient sound
main_hall_start_ambient();
Player_select_force_bastion = 0;
Player_select_force_main_hall = 0;
#ifdef FS2_DEMO
/*
@@ -723,8 +726,8 @@ void player_select_close()
Player = NULL;
}
if (Player_select_force_bastion) {
Player->on_bastion = 1;
if (Player_select_force_main_hall) {
Player->main_hall = 1;
}
}
@@ -1462,7 +1465,7 @@ void player_select_cancel_create()
DCF(bastion,"Sets the player to be on the bastion")
{
if(gameseq_get_state() == GS_STATE_INITIAL_PLAYER_SELECT){
Player_select_force_bastion = 1;
Player_select_force_main_hall = 1;
dc_printf("Player is now in the Bastion\n");
}
}
+36 -4
View File
@@ -9,13 +9,20 @@
/*
* $Logfile: /Freespace2/code/MenuUI/ReadyRoom.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.3 $
* $Date: 2003-03-03 04:28:37 $
* $Author: Goober5000 $
*
* Ready Room code, which is the UI screen for selecting Campaign/mission to play next mainly.
*
* $Log: not supported by cvs2svn $
* Revision 2.2 2002/10/19 03:50:29 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.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -102,6 +109,8 @@
#include "cfile/cfilesystem.h"
#include "freespace2/freespace.h"
#include "globalincs/alphacolors.h"
#include "cmdline/cmdline.h"
#include "menuui/techmenu.h" // for tech menu reset stuff
#define MAX_MISSIONS 1024
@@ -592,7 +601,7 @@ int build_campaign_mission_list_do_frame()
Campaign_mission_flags[Num_campaign_missions_with_info] = 0;
// Only allow missions already completed
if (Campaign.missions[Num_campaign_missions_with_info].completed) {
if (Campaign.missions[Num_campaign_missions_with_info].completed || Cmdline_allslev) {
if (!get_mission_info(Campaign.missions[Num_campaign_missions_with_info].name)) {
// add to list
Campaign_mission_names[Num_campaign_missions_with_info] = strdup(The_mission.name);
@@ -777,6 +786,10 @@ void sim_room_scroll_line_down()
gamesnd_play_iface(SND_GENERAL_FAIL);
}
/* Goober5000 - why are there two nearly identical functions?
(campaign_room_reset_campaign and ready_room_reset_campaign)
Looks like this function should be deprecated...
// returns: 0 = success, !0 = aborted or failed
int ready_room_reset_campaign()
{
@@ -787,11 +800,13 @@ int ready_room_reset_campaign()
if (z) {
mission_campaign_savefile_delete(Campaign.filename);
mission_campaign_load(Campaign.filename);
rval = 0;
}
return rval;
}
*/
// Decide if we should offer choice to resume this savegame
int sim_room_can_resume_savegame(char *savegame_filename)
@@ -1541,6 +1556,7 @@ int campaign_room_reset_campaign(int n)
mission_campaign_savefile_delete(filename);
mission_campaign_load(filename);
mission_campaign_next_mission();
return 0;
}
@@ -1563,6 +1579,13 @@ void campaign_room_commit()
mission_campaign_savefile_delete(Campaign_file_names[Selected_campaign_index]);
mission_campaign_load(Campaign_file_names[Selected_campaign_index]);
strcpy(Player->current_campaign, Campaign.filename); // track new campaign for player
// Goober5000 - reinitialize tech database if needed
if ( (Campaign.flags & CF_CUSTOM_TECH_DATABASE) || !stricmp(Campaign.filename, "freespace2") )
{
// reset tech database to what's in the tables
tech_reset_to_default();
}
}
if (mission_campaign_next_mission()) { // is campaign and next mission valid?
@@ -1615,8 +1638,17 @@ int campaign_room_button_pressed(int n)
else if (campaign_room_reset_campaign(Active_campaign_index))
gamesnd_play_iface(SND_GENERAL_FAIL);
else
{
gamesnd_play_iface(SND_USER_SELECT);
// Goober5000 - reinitialize tech database if needed
if ( (Campaign.flags & CF_CUSTOM_TECH_DATABASE) || !stricmp(Campaign.filename, "freespace2") )
{
// reset tech database to what's in the tables
tech_reset_to_default();
}
}
break;
}
+85 -9
View File
@@ -9,13 +9,25 @@
/*
* $Logfile: /Freespace2/code/MenuUI/TechMenu.cpp $
* $Revision: 2.1 $
* $Date: 2002-08-01 01:41:06 $
* $Author: penguin $
* $Revision: 2.4 $
* $Date: 2003-03-03 04:28:37 $
* $Author: Goober5000 $
*
* C module that contains functions to drive the Tech Menu user interface
*
* $Log: not supported by cvs2svn $
* Revision 2.3 2002/12/07 01:37:42 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/27 01:20:51 sesquipedalian
* Added Phreak's fix for the weapons room bug. Can now view a modified weapons.tbl in the tech room without crashing
*
* Revision 2.1 2002/08/01 01:41:06 penguin
* The big include file move
*
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
@@ -1043,10 +1055,11 @@ void techroom_change_tab(int num)
for (i=0; i<MAX_WEAPON_TYPES; i++) {
if (Weapon_info[i].wi_flags & mask) {
//following was commented out to fix the tech room crash bug when modified weapons.tbl is used. Fix by Phreak, implemented by Sesquipedalian.
// note: hack here to exclude dogfight weapons -- dont put weapon in if it has same description as pvs weapon
if ((Weapon_list_size > 0) && (!strcmp(Weapon_info[i].tech_desc, Weapon_list[Weapon_list_size-1].desc))) {
continue;
}
//if ((Weapon_list_size > 0) && (!strcmp(Weapon_info[i].tech_desc, Weapon_list[Weapon_list_size-1].desc))) {
// continue;
//}
// we have a weapon that should be in the tech db, so fill out the entry struct
Weapon_list[Weapon_list_size].index = i;
@@ -1092,7 +1105,7 @@ void techroom_change_tab(int num)
Intel_list_size = 0;
for (i=0; i<Intel_info_size; i++) {
if (Intel_info[i].in_tech_db != 0) {
if (Intel_info[i].flags & IIF_IN_TECH_DATABASE) {
// leave option for no animation if string == "none"
if (!strcmp(Intel_info[i].anim_filename, "none")) {
Intel_list[Intel_list_size].has_anim = 0;
@@ -1263,7 +1276,7 @@ int techroom_load_ani(anim **animpp, char *name)
void techroom_intel_init()
{
int rval;
int rval, temp;
static int inited = 0;
// open localization
@@ -1285,15 +1298,24 @@ void techroom_intel_init()
Assert(Intel_info_size < MAX_INTEL_ENTRIES);
if (Intel_info_size >= MAX_INTEL_ENTRIES) break;
Intel_info[Intel_info_size].flags = IIF_DEFAULT_VALUE;
required_string("$Name:");
stuff_string(Intel_info[Intel_info_size].name, F_NAME, NULL, 32);
required_string("$Anim:");
stuff_string(Intel_info[Intel_info_size].anim_filename, F_NAME, NULL, 32);
required_string("$AlwaysInTechRoom:");
stuff_int(&Intel_info[Intel_info_size].in_tech_db);
stuff_int(&temp);
if (temp)
{
Intel_info[Intel_info_size].flags |= IIF_IN_TECH_DATABASE;
}
required_string("$Description:");
stuff_string(Intel_info[Intel_info_size].desc, F_MULTITEXT, NULL, TECH_INTEL_DESC_LEN);
// set default to align with what we read - Goober5000
if (Intel_info[Intel_info_size].flags & IIF_IN_TECH_DATABASE)
Intel_info[Intel_info_size].flags |= IIF_DEFAULT_IN_TECH_DATABASE;
Intel_info_size++;
}
@@ -1502,6 +1524,7 @@ void techroom_close()
void techroom_do_frame(float frametime)
{
int i, k;
// turn off controls when overlay is on
@@ -1677,3 +1700,56 @@ void techroom_do_frame(float frametime)
gr_flip();
}
int intel_info_lookup(char *name)
{
int i;
// bogus
if (!name)
return -1;
for (i=0; i<Intel_info_size; i++)
if (!stricmp(name, Intel_info[i].name))
return i;
return -1;
}
// Goober5000
void tech_reset_to_default()
{
int i;
// ships
for (i=0; i<Num_ship_types; i++)
{
if (Ship_info[i].flags2 & SIF2_DEFAULT_IN_TECH_DATABASE)
Ship_info[i].flags |= SIF_IN_TECH_DATABASE;
else
Ship_info[i].flags &= ~SIF_IN_TECH_DATABASE;
if (Ship_info[i].flags2 & SIF2_DEFAULT_IN_TECH_DATABASE_M)
Ship_info[i].flags |= SIF_IN_TECH_DATABASE_M;
else
Ship_info[i].flags &= ~SIF_IN_TECH_DATABASE_M;
}
// weapons
for (i=0; i<Num_weapon_types; i++)
{
if (Weapon_info[i].wi_flags2 & WIF2_DEFAULT_IN_TECH_DATABASE)
Weapon_info[i].wi_flags |= WIF_IN_TECH_DATABASE;
else
Weapon_info[i].wi_flags &= ~WIF_IN_TECH_DATABASE;
}
// intelligence
for (i=0; i<Intel_info_size; i++)
{
if (Intel_info[i].flags & IIF_DEFAULT_IN_TECH_DATABASE)
Intel_info[i].flags |= IIF_IN_TECH_DATABASE;
else
Intel_info[i].flags &= ~IIF_IN_TECH_DATABASE;
}
}
+13 -4
View File
@@ -9,13 +9,16 @@
/*
* $Logfile: /Freespace2/code/MenuUI/TechMenu.h $
* $Revision: 2.0 $
* $Date: 2002-06-03 04:02:24 $
* $Author: penguin $
* $Revision: 2.1 $
* $Date: 2003-03-03 04:28:37 $
* $Author: Goober5000 $
*
* Header file for code that controls the Tech Room menu
*
* $Log: not supported by cvs2svn $
* Revision 2.0 2002/06/03 04:02:24 penguin
* Warpcore CVS sync
*
* Revision 1.1 2002/05/02 18:03:10 mharris
* Initial checkin - converted filenames and includes to lower case
*
@@ -79,9 +82,13 @@ typedef struct {
char name[32];
char desc[TECH_INTEL_DESC_LEN];
char anim_filename[32];
int in_tech_db; // determines if visible in tech db or not
int flags;
} intel_data;
// flags by Goober5000
#define IIF_DEFAULT_VALUE 0
#define IIF_IN_TECH_DATABASE (1 << 0) // in tech database? - Goober5000
#define IIF_DEFAULT_IN_TECH_DATABASE (1 << 1) // in tech database by default? - Goober5000
extern intel_data Intel_info[MAX_INTEL_ENTRIES];
extern int Intel_info_size;
@@ -93,5 +100,7 @@ void techroom_close();
void techroom_do_frame(float frametime);
int techroom_on_ships_tab();
void techroom_intel_init(); // called on startup so campaigns can manipulate tech room visibility
int intel_info_lookup(char *name);
extern void tech_reset_to_default();
#endif
Loaded 100 of 192 files, more files were not shown because too many files have changed in this diff. Show more